@tsed/ajv 8.9.5 → 8.10.0-rc.1

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.
@@ -0,0 +1,56 @@
1
+ (function(Jt,ao){typeof exports=="object"&&typeof module<"u"?ao(exports,require("\0/home/runner/work/tsed/tsed/node_modules/reflect-metadata/Reflect.js?commonjs-external"),require("/home/runner/work/tsed/tsed/node_modules/ajv/dist/ajv.js"),require("/home/runner/work/tsed/tsed/node_modules/ajv-errors/dist/index.js"),require("/home/runner/work/tsed/tsed/node_modules/ajv-formats/dist/index.js"),require("\0/home/runner/work/tsed/tsed/node_modules/change-case/dist/index.js?commonjs-external"),require("\0/home/runner/work/tsed/tsed/node_modules/statuses/index.js?commonjs-external"),require("\0/home/runner/work/tsed/tsed/node_modules/picomatch/index.js?commonjs-external")):typeof define=="function"&&define.amd?define(["exports","\0/home/runner/work/tsed/tsed/node_modules/reflect-metadata/Reflect.js?commonjs-external","/home/runner/work/tsed/tsed/node_modules/ajv/dist/ajv.js","/home/runner/work/tsed/tsed/node_modules/ajv-errors/dist/index.js","/home/runner/work/tsed/tsed/node_modules/ajv-formats/dist/index.js","\0/home/runner/work/tsed/tsed/node_modules/change-case/dist/index.js?commonjs-external","\0/home/runner/work/tsed/tsed/node_modules/statuses/index.js?commonjs-external","\0/home/runner/work/tsed/tsed/node_modules/picomatch/index.js?commonjs-external"],ao):(Jt=typeof globalThis<"u"?globalThis:Jt||self,ao(Jt["@tsed/ajv"]={},Jt.require$$0,Jt.ajv_js,Jt.AjvErrors,Jt.AjvFormats,Jt.require$$0$1,Jt.require$$1,Jt.require$$2))})(this,function(Jt,ao,gi,Au,Ru,xu,ju,Cu){"use strict";var Ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},co={exports:{}},_u=co.exports,Ta;function ku(){return Ta||(Ta=1,function(ve,ke){(function(n,Ee){Ee(ke)})(_u,function(n){var Ee=u=>{throw TypeError(u)},tt=(u,m,S)=>m.has(u)||Ee("Cannot "+S),Me=(u,m,S)=>(tt(u,m,"read from private field"),S?S.call(u):m.get(u)),lt=(u,m,S)=>m.has(u)?Ee("Cannot add the same private member more than once"):m instanceof WeakSet?m.add(u):m.set(u,S),De=(u,m,S,P)=>(tt(u,m,"write to private field"),m.set(u,S),S),Z,rt,me,ht,Ye=(u=>(u.PARAM="parameter",u.PARAM_CTOR="parameter.constructor",u.PARAM_STC="parameter.static",u.PROP="property",u.PROP_STC="property.static",u.METHOD="method",u.METHOD_STC="method.static",u.CLASS="class",u))(Ye||{});function nt(u){return u.prototype?u:u.constructor}function Be(u){return nt(u)}function dt(u){const[m,S,P]=u,y=l=>m!==Be(m)?l:`${l}.static`;return typeof P=="number"?S?y("parameter"):"parameter.constructor":P&&P.value?y("method"):S&&P===void 0||P?y("property"):Ye.CLASS}function $t(u){return u===Date||u instanceof Date&&!isNaN(+u)}function at(u){return typeof u=="function"}function Ut(u){return u==null}function Vt(u){return typeof u=="boolean"||u instanceof Boolean||u===Boolean}function Lt(u){return typeof u=="boolean"||u instanceof Boolean||u===Boolean}function ir(u){return typeof u=="number"}function Zt(u){return typeof u=="number"||u instanceof Number||u===Number}function $e(u){return typeof u=="string"}function ln(u){return typeof u=="string"||u instanceof String||u===String}function bs(u){return ln(u)||Zt(u)||Lt(u)}function mt(u){return $e(u)||ir(u)||Vt(u)}function le(u){return[String,Number,Boolean].includes(u)}function hn(u){return u instanceof RegExp}function G(u){return typeof u=="symbol"}function kn(u){return typeof u=="symbol"||u instanceof Symbol||u===Symbol}const br=u=>Ut(u)||mt(u)||G(u)||at(u),dr=(u,m=new WeakMap)=>{if(br(u))return u;const S=m.get(u);if(S)return S;if(ArrayBuffer.isView(u))return Buffer.isBuffer(u)?Buffer.from(u):new(Be(u))(u.buffer.slice(0),u.byteOffset,u.byteLength);if($t(u))return new Date(u);if(hn(u))return new RegExp(u);if(Array.isArray(u)){const y=[];return m.set(u,y),u.forEach((l,ne)=>y[ne]=dr(l,m)),y}if(u instanceof Map){const y=new Map;return m.set(u,y),u.forEach((l,ne)=>y.set(dr(ne,m),dr(l,m))),y}if(u instanceof Set){const y=new Set;return m.set(u,y),u.forEach(l=>y.add(dr(l,m))),y}const P=Object.create(Reflect.getPrototypeOf(u));return m.set(u,P),Reflect.ownKeys(u).forEach(y=>{const l=Object.getOwnPropertyDescriptor(u,y);l&&(at(l.value)?Object.defineProperty(P,y,l):Object.defineProperty(P,y,{...l,value:dr(l.value,m)}))}),P};function ar(u){return u?Be(u)!==Object?Object.create(u):{}:{}}function Ir(u){return["__proto__","constructor","prototype"].includes(u)}function Nr(u){return Object.keys(u).filter(m=>!Ir(m))}function Je(u){return(m,S,P)=>{const y=m.findIndex(l=>u(l,S));return y===-1?[...m,S]:(m[y]=mr(m[y],S,P),m)}}const zr=Je((u,m)=>u===m);function d({reducers:u,parentKey:m}){return u?m&&u[m]?u[m]:u.default||zr:zr}function Ar(u,m){return mt(u)||G(u)||at(u)||m===void 0}function Le(u,m){return u==null||u===""&&m!==""}function mr(u,m,S={}){if(Le(m,u))return u;if(Ar(m,u))return m;if(Array.isArray(u)){const y=d(S);return[].concat(m).reduce((l,ne)=>y(l,ne,S),[...u])}const P=ar(u);return[...Nr(u),...Nr(m)].reduce((y,l)=>{var ne;const xe=u&&u[l],Te=mr(xe,m&&m[l],{...S,parentKey:l});return S.cleanUndefinedProps&&Te===void 0||(y[l]=((ne=S.alter)==null?void 0:ne.call(S,l,Te))??Te),y},P)}function _t(u,m){return Reflect.getOwnPropertyDescriptor(u&&u.prototype||u,m)}function ws(u,m){var S;return(S=_t(u,m))==null?void 0:S.value}function cr(u){return typeof u=="function"?u.name:u.constructor.name}const is=u=>u.toString().replace("Symbol(","").replace(")","");function wr(u){switch(typeof u){default:return""+u;case"symbol":return is(u);case"function":return cr(u)}}var $r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Ks<"u"?Ks:typeof self<"u"?self:{},as={};/*! *****************************************************************************
2
+ Copyright (C) Microsoft. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */var dn;function yr(){if(dn)return as;dn=1;var u;return function(m){(function(S){var P=typeof globalThis=="object"?globalThis:typeof $r=="object"?$r:typeof self=="object"?self:typeof this=="object"?this:Te(),y=l(m);typeof P.Reflect<"u"&&(y=l(P.Reflect,y)),S(y,P),typeof P.Reflect>"u"&&(P.Reflect=m);function l(_e,Ve){return function(Mt,ur){Object.defineProperty(_e,Mt,{configurable:!0,writable:!0,value:ur}),Ve&&Ve(Mt,ur)}}function ne(){try{return Function("return this;")()}catch{}}function xe(){try{return(0,eval)("(function() { return this; })()")}catch{}}function Te(){return ne()||xe()}})(function(S,P){var y=Object.prototype.hasOwnProperty,l=typeof Symbol=="function",ne=l&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",xe=l&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",Te=typeof Object.create=="function",_e={__proto__:[]}instanceof Array,Ve=!Te&&!_e,Mt={create:Te?function(){return ut(Object.create(null))}:_e?function(){return ut({__proto__:null})}:function(){return ut({})},has:Ve?function(T,j){return y.call(T,j)}:function(T,j){return j in T},get:Ve?function(T,j){return y.call(T,j)?T[j]:void 0}:function(T,j){return T[j]}},ur=Object.getPrototypeOf(Function),er=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:He(),Er=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:qt(),Bt=typeof WeakMap=="function"?WeakMap:_r(),Jr=l?Symbol.for("@reflect-metadata:registry"):void 0,st=X(),Kn=z(st);function sn(T,j,D,K){if(Oe(D)){if(!ys(T))throw new TypeError;if(!gs(j))throw new TypeError;return Hn(T,j)}else{if(!ys(T))throw new TypeError;if(!bt(j))throw new TypeError;if(!bt(K)&&!Oe(K)&&!Cr(K))throw new TypeError;return Cr(K)&&(K=void 0),D=zt(D),un(T,j,D,K)}}S("decorate",sn);function fr(T,j){function D(K,Q){if(!bt(K))throw new TypeError;if(!Oe(Q)&&!Qn(Q))throw new TypeError;lr(T,j,K,Q)}return D}S("metadata",fr);function Vr(T,j,D,K){if(!bt(D))throw new TypeError;return Oe(K)||(K=zt(K)),lr(T,j,D,K)}S("defineMetadata",Vr);function on(T,j,D){if(!bt(j))throw new TypeError;return Oe(D)||(D=zt(D)),zn(T,j,D)}S("hasMetadata",on);function Jn(T,j,D){if(!bt(j))throw new TypeError;return Oe(D)||(D=zt(D)),pr(T,j,D)}S("hasOwnMetadata",Jn);function Vn(T,j,D){if(!bt(j))throw new TypeError;return Oe(D)||(D=zt(D)),Yn(T,j,D)}S("getMetadata",Vn);function Wn(T,j,D){if(!bt(j))throw new TypeError;return Oe(D)||(D=zt(D)),Xn(T,j,D)}S("getOwnMetadata",Wn);function an(T,j){if(!bt(T))throw new TypeError;return Oe(j)||(j=zt(j)),Zn(T,j)}S("getMetadataKeys",an);function cn(T,j){if(!bt(T))throw new TypeError;return Oe(j)||(j=zt(j)),Rn(T,j)}S("getOwnMetadataKeys",cn);function Cs(T,j,D){if(!bt(j))throw new TypeError;if(Oe(D)||(D=zt(D)),!bt(j))throw new TypeError;Oe(D)||(D=zt(D));var K=Qe(j,D,!1);return Oe(K)?!1:K.OrdinaryDeleteMetadata(T,j,D)}S("deleteMetadata",Cs);function Hn(T,j){for(var D=T.length-1;D>=0;--D){var K=T[D],Q=K(j);if(!Oe(Q)&&!Cr(Q)){if(!gs(Q))throw new TypeError;j=Q}}return j}function un(T,j,D,K){for(var Q=T.length-1;Q>=0;--Q){var ye=T[Q],he=ye(j,D,K);if(!Oe(he)&&!Cr(he)){if(!bt(he))throw new TypeError;K=he}}return K}function zn(T,j,D){var K=pr(T,j,D);if(K)return!0;var Q=b(j);return Cr(Q)?!1:zn(T,Q,D)}function pr(T,j,D){var K=Qe(j,D,!1);return Oe(K)?!1:tr(K.OrdinaryHasOwnMetadata(T,j,D))}function Yn(T,j,D){var K=pr(T,j,D);if(K)return Xn(T,j,D);var Q=b(j);if(!Cr(Q))return Yn(T,Q,D)}function Xn(T,j,D){var K=Qe(j,D,!1);if(!Oe(K))return K.OrdinaryGetOwnMetadata(T,j,D)}function lr(T,j,D,K){var Q=Qe(D,K,!0);Q.OrdinaryDefineOwnMetadata(T,j,D,K)}function Zn(T,j){var D=Rn(T,j),K=b(T);if(K===null)return D;var Q=Zn(K,j);if(Q.length<=0)return D;if(D.length<=0)return Q;for(var ye=new Er,he=[],oe=0,L=D;oe<L.length;oe++){var B=L[oe],H=ye.has(B);H||(ye.add(B),he.push(B))}for(var ae=0,Ie=Q;ae<Ie.length;ae++){var B=Ie[ae],H=ye.has(B);H||(ye.add(B),he.push(B))}return he}function Rn(T,j){var D=Qe(T,j,!1);return D?D.OrdinaryOwnMetadataKeys(T,j):[]}function xn(T){if(T===null)return 1;switch(typeof T){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return T===null?1:6;default:return 6}}function Oe(T){return T===void 0}function Cr(T){return T===null}function _s(T){return typeof T=="symbol"}function bt(T){return typeof T=="object"?T!==null:typeof T=="function"}function ks(T,j){switch(xn(T)){case 0:return T;case 1:return T;case 2:return T;case 3:return T;case 4:return T;case 5:return T}var D="string",K=Ds(T,ne);if(K!==void 0){var Q=K.call(T,D);if(bt(Q))throw new TypeError;return Q}return jn(T)}function jn(T,j){var D,K;{var Q=T.toString;if(rr(Q)){var K=Q.call(T);if(!bt(K))return K}var D=T.valueOf;if(rr(D)){var K=D.call(T);if(!bt(K))return K}}throw new TypeError}function tr(T){return!!T}function ms(T){return""+T}function zt(T){var j=ks(T);return _s(j)?j:ms(j)}function ys(T){return Array.isArray?Array.isArray(T):T instanceof Object?T instanceof Array:Object.prototype.toString.call(T)==="[object Array]"}function rr(T){return typeof T=="function"}function gs(T){return typeof T=="function"}function Qn(T){switch(xn(T)){case 3:return!0;case 4:return!0;default:return!1}}function ie(T,j){return T===j||T!==T&&j!==j}function Ds(T,j){var D=T[j];if(D!=null){if(!rr(D))throw new TypeError;return D}}function i(T){var j=Ds(T,xe);if(!rr(j))throw new TypeError;var D=j.call(T);if(!bt(D))throw new TypeError;return D}function o(T){return T.value}function p(T){var j=T.next();return j.done?!1:j}function v(T){var j=T.return;j&&j.call(T)}function b(T){var j=Object.getPrototypeOf(T);if(typeof T!="function"||T===ur||j!==ur)return j;var D=T.prototype,K=D&&Object.getPrototypeOf(D);if(K==null||K===Object.prototype)return j;var Q=K.constructor;return typeof Q!="function"||Q===T?j:Q}function A(){var T;!Oe(Jr)&&typeof P.Reflect<"u"&&!(Jr in P.Reflect)&&typeof P.Reflect.defineMetadata=="function"&&(T=je(P.Reflect));var j,D,K,Q=new Bt,ye={registerProvider:he,getProvider:L,setProvider:H};return ye;function he(ae){if(!Object.isExtensible(ye))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case T===ae:break;case Oe(j):j=ae;break;case j===ae:break;case Oe(D):D=ae;break;case D===ae:break;default:K===void 0&&(K=new Er),K.add(ae);break}}function oe(ae,Ie){if(!Oe(j)){if(j.isProviderFor(ae,Ie))return j;if(!Oe(D)){if(D.isProviderFor(ae,Ie))return j;if(!Oe(K))for(var Xe=i(K);;){var wt=p(Xe);if(!wt)return;var nr=o(wt);if(nr.isProviderFor(ae,Ie))return v(Xe),nr}}}if(!Oe(T)&&T.isProviderFor(ae,Ie))return T}function L(ae,Ie){var Xe=Q.get(ae),wt;return Oe(Xe)||(wt=Xe.get(Ie)),Oe(wt)&&(wt=oe(ae,Ie),Oe(wt)||(Oe(Xe)&&(Xe=new er,Q.set(ae,Xe)),Xe.set(Ie,wt))),wt}function B(ae){if(Oe(ae))throw new TypeError;return j===ae||D===ae||!Oe(K)&&K.has(ae)}function H(ae,Ie,Xe){if(!B(Xe))throw new Error("Metadata provider not registered.");var wt=L(ae,Ie);if(wt!==Xe){if(!Oe(wt))return!1;var nr=Q.get(ae);Oe(nr)&&(nr=new er,Q.set(ae,nr)),nr.set(Ie,Xe)}return!0}}function X(){var T;return!Oe(Jr)&&bt(P.Reflect)&&Object.isExtensible(P.Reflect)&&(T=P.Reflect[Jr]),Oe(T)&&(T=A()),!Oe(Jr)&&bt(P.Reflect)&&Object.isExtensible(P.Reflect)&&Object.defineProperty(P.Reflect,Jr,{enumerable:!1,configurable:!1,writable:!1,value:T}),T}function z(T){var j=new Bt,D={isProviderFor:function(B,H){var ae=j.get(B);return Oe(ae)?!1:ae.has(H)},OrdinaryDefineOwnMetadata:he,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:ye,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:L};return st.registerProvider(D),D;function K(B,H,ae){var Ie=j.get(B),Xe=!1;if(Oe(Ie)){if(!ae)return;Ie=new er,j.set(B,Ie),Xe=!0}var wt=Ie.get(H);if(Oe(wt)){if(!ae)return;if(wt=new er,Ie.set(H,wt),!T.setProvider(B,H,D))throw Ie.delete(H),Xe&&j.delete(B),new Error("Wrong provider for target.")}return wt}function Q(B,H,ae){var Ie=K(H,ae,!1);return Oe(Ie)?!1:tr(Ie.has(B))}function ye(B,H,ae){var Ie=K(H,ae,!1);if(!Oe(Ie))return Ie.get(B)}function he(B,H,ae,Ie){var Xe=K(ae,Ie,!0);Xe.set(B,H)}function oe(B,H){var ae=[],Ie=K(B,H,!1);if(Oe(Ie))return ae;for(var Xe=Ie.keys(),wt=i(Xe),nr=0;;){var Js=p(wt);if(!Js)return ae.length=nr,ae;var lo=o(Js);try{ae[nr]=lo}catch(Vs){try{v(wt)}finally{throw Vs}}nr++}}function L(B,H,ae){var Ie=K(H,ae,!1);if(Oe(Ie)||!Ie.delete(B))return!1;if(Ie.size===0){var Xe=j.get(H);Oe(Xe)||(Xe.delete(ae),Xe.size===0&&j.delete(Xe))}return!0}}function je(T){var j=T.defineMetadata,D=T.hasOwnMetadata,K=T.getOwnMetadata,Q=T.getOwnMetadataKeys,ye=T.deleteMetadata,he=new Bt,oe={isProviderFor:function(L,B){var H=he.get(L);return!Oe(H)&&H.has(B)?!0:Q(L,B).length?(Oe(H)&&(H=new Er,he.set(L,H)),H.add(B),!0):!1},OrdinaryDefineOwnMetadata:j,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:K,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:ye};return oe}function Qe(T,j,D){var K=st.getProvider(T,j);if(!Oe(K))return K;if(D){if(st.setProvider(T,j,Kn))return Kn;throw new Error("Illegal state.")}}function He(){var T={},j=[],D=function(){function oe(L,B,H){this._index=0,this._keys=L,this._values=B,this._selector=H}return oe.prototype["@@iterator"]=function(){return this},oe.prototype[xe]=function(){return this},oe.prototype.next=function(){var L=this._index;if(L>=0&&L<this._keys.length){var B=this._selector(this._keys[L],this._values[L]);return L+1>=this._keys.length?(this._index=-1,this._keys=j,this._values=j):this._index++,{value:B,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function(L){throw this._index>=0&&(this._index=-1,this._keys=j,this._values=j),L},oe.prototype.return=function(L){return this._index>=0&&(this._index=-1,this._keys=j,this._values=j),{value:L,done:!0}},oe}(),K=function(){function oe(){this._keys=[],this._values=[],this._cacheKey=T,this._cacheIndex=-2}return Object.defineProperty(oe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),oe.prototype.has=function(L){return this._find(L,!1)>=0},oe.prototype.get=function(L){var B=this._find(L,!1);return B>=0?this._values[B]:void 0},oe.prototype.set=function(L,B){var H=this._find(L,!0);return this._values[H]=B,this},oe.prototype.delete=function(L){var B=this._find(L,!1);if(B>=0){for(var H=this._keys.length,ae=B+1;ae<H;ae++)this._keys[ae-1]=this._keys[ae],this._values[ae-1]=this._values[ae];return this._keys.length--,this._values.length--,ie(L,this._cacheKey)&&(this._cacheKey=T,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=T,this._cacheIndex=-2},oe.prototype.keys=function(){return new D(this._keys,this._values,Q)},oe.prototype.values=function(){return new D(this._keys,this._values,ye)},oe.prototype.entries=function(){return new D(this._keys,this._values,he)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[xe]=function(){return this.entries()},oe.prototype._find=function(L,B){if(!ie(this._cacheKey,L)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(ie(this._keys[H],L)){this._cacheIndex=H;break}}return this._cacheIndex<0&&B&&(this._cacheIndex=this._keys.length,this._keys.push(L),this._values.push(void 0)),this._cacheIndex},oe}();return K;function Q(oe,L){return oe}function ye(oe,L){return L}function he(oe,L){return[oe,L]}}function qt(){var T=function(){function j(){this._map=new er}return Object.defineProperty(j.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),j.prototype.has=function(D){return this._map.has(D)},j.prototype.add=function(D){return this._map.set(D,D),this},j.prototype.delete=function(D){return this._map.delete(D)},j.prototype.clear=function(){this._map.clear()},j.prototype.keys=function(){return this._map.keys()},j.prototype.values=function(){return this._map.keys()},j.prototype.entries=function(){return this._map.entries()},j.prototype["@@iterator"]=function(){return this.keys()},j.prototype[xe]=function(){return this.keys()},j}();return T}function _r(){var T=16,j=Mt.create(),D=K();return function(){function L(){this._key=K()}return L.prototype.has=function(B){var H=Q(B,!1);return H!==void 0?Mt.has(H,this._key):!1},L.prototype.get=function(B){var H=Q(B,!1);return H!==void 0?Mt.get(H,this._key):void 0},L.prototype.set=function(B,H){var ae=Q(B,!0);return ae[this._key]=H,this},L.prototype.delete=function(B){var H=Q(B,!1);return H!==void 0?delete H[this._key]:!1},L.prototype.clear=function(){this._key=K()},L}();function K(){var L;do L="@@WeakMap@@"+oe();while(Mt.has(j,L));return j[L]=!0,L}function Q(L,B){if(!y.call(L,D)){if(!B)return;Object.defineProperty(L,D,{value:Mt.create()})}return L[D]}function ye(L,B){for(var H=0;H<B;++H)L[H]=Math.random()*255|0;return L}function he(L){if(typeof Uint8Array=="function"){var B=new Uint8Array(L);return typeof crypto<"u"?crypto.getRandomValues(B):typeof msCrypto<"u"?msCrypto.getRandomValues(B):ye(B,L),B}return ye(new Array(L),L)}function oe(){var L=he(T);L[6]=L[6]&79|64,L[8]=L[8]&191|128;for(var B="",H=0;H<T;++H){var ae=L[H];(H===4||H===6||H===8)&&(B+="-"),ae<16&&(B+="0"),B+=ae.toString(16).toLowerCase()}return B}}function ut(T){return T.__=void 0,delete T.__,T}})}(u||(u={})),as}yr();const mn="design:paramtypes",cs="design:type",gr="design:returntype",Ur=new Map,Lr=class{static get(m,S,P){return Reflect.getMetadata(m,Be(S),P)}static getOwn(m,S,P){return Reflect.getOwnMetadata(m,Be(S),P)}static getType(m,S){return Reflect.getMetadata(cs,m,S)}static getOwnType(m,S){return Reflect.getMetadata(cs,m,S)}static getReturnType(m,S){return Reflect.getMetadata(gr,m,S)}static getOwnReturnType(m,S){return Reflect.getOwnMetadata(gr,m,S)}static has(m,S,P){try{return Reflect.hasMetadata(m,Be(S),P)}catch{}return!1}static hasOwn(m,S,P){return Reflect.hasOwnMetadata(m,Be(S),P)}static delete(m,S,P){return Reflect.deleteMetadata(m,Be(S),P)}static setParamTypes(m,S,P){return this.set(mn,P,m.prototype,S)}static set(m,S,P,y){const l=Ur.has(m)?Ur.get(m)||[]:[],ne=Be(P);l.indexOf(ne)===-1&&(l.push(ne),Ur.set(m,l)),Reflect.defineMetadata(m,S,Be(P),y)}static getParamTypes(m,S){return Reflect.getMetadata(mn,m,S)||[]}static getOwnParamTypes(m,S){return Reflect.getOwnMetadata(mn,m,S)||[]}};Lr.getTargetsFromPropertyKey=u=>Ur.has(u)?Ur.get(u)||[]:[];let Qt=Lr;const us="tsed:class:store",Et="tsed:method:store",Yr="tsed:property:store",yn="tsed:param:store",Xr=new Map;function Ft(u,...m){if(G(m[0]))return Xr.has(m[0])||Xr.set(m[0],new Ze),Xr.get(m[0]);{const S=Qt;return S.hasOwn(u,...m)||S.set(u,new Ze,...m),S.getOwn(u,...m)}}function Dn(u){const[m,S,P]=u;switch(dt(u)){case Ye.PARAM_CTOR:case Ye.PARAM_STC:case Ye.PARAM:const y=Ft(yn,m,S);return y.has(""+P)||y.set(""+P,new Ze),y.get(""+P);case Ye.PROP:case Ye.PROP_STC:return Ft(Yr,m,S);case Ye.METHOD:case Ye.METHOD_STC:return Ft(Et,m,S);case Ye.CLASS:return Ft(us,m)}}class Ze{constructor(){this._entries=new Map}static from(...m){return Dn(m)}static fromMethod(m,S){return Ze.from(m,S,_t(m,S))}static mergeStoreFrom(m,S,...P){const y=Ze.from(m,...P);return Ze.from(S,...P)._entries.forEach((l,ne)=>{y.merge(ne,l)}),y}static mergeStoreMethodFrom(m,S,P){return this.mergeStoreFrom(m,S,P,_t(m,P))}get(m,S){return this._entries.get(wr(m))||S}has(m){return this._entries.has(wr(m))}set(m,S){return this._entries.set(wr(m),S),this}delete(m){return this._entries.delete(wr(m))}merge(m,S,P=!1){let y=this.get(m);return y&&(S=dr(S),y=dr(y),S=P?mr(S,y):mr(y,S)),this.set(m,S),this}toJson(){return[...this._entries.entries()].reduce((m,[S,P])=>({...m,[S]:P}),{})}}function Zr(u){return(...m)=>{const S=Ze.from(...m),P=u(S,m);return typeof P=="function"&&P(...m),m[2]}}function gn(u,m){return Zr(S=>{S.merge(u,m)})}function Fr(u,m){return Zr(S=>{S.set(u,m)})}class ct extends Error{constructor(m,S){super(ct.buildMessage(m,S))}static buildMessage(m,S){const[P,y,l]=S,ne=dt(S),xe=ne.split("/")[0],Te=xe==="parameter"?".["+l+"]":"",_e=y?"."+y:xe==="parameter"?".constructor":"",Ve=wr(Be(P))+_e+Te;return`${m.name} cannot be used as ${ne} decorator on ${Ve}`}}var Tr=(u=>(u.PROD="production",u.DEV="development",u.TEST="test",u))(Tr||{});const fs=Tr,kt=Function;Ks.Type=kt;function Qr(u){return u&&Object.getPrototypeOf(u)}function en(u){return Qr(u)}function vr(u){const m=[];let S=Be(u);for(;S&&wr(S)!=="";)m.unshift(S),S=en(S);return m}function tn(u){return typeof u=="object"}function Rr(u){return!!u&&typeof u.lift=="function"&&typeof u.subscribe=="function"}function In(u){return u===Promise||u instanceof Promise||!!u&&typeof u.subscribe!="function"&&typeof u.then=="function"}function Nn(u){return u!==null&&typeof u=="object"&&typeof u.pipe=="function"}function Rt(u){return tn(u)&&"data"in u&&"headers"in u&&"status"in u&&"statusText"in u}var ps=(u=>(u.PENDING="PENDING",u.CANCELED="CANCELED",u.RESOLVED="RESOLVED",u.REJECTED="REJECTED",u))(ps||{}),xr=(u=>(u.STREAM="STREAM",u.BUFFER="BUFFER",u.DATA="DATA",u))(xr||{});class Br{constructor({hasNextFunction:m=!1}={}){lt(this,Z),lt(this,rt),lt(this,me),lt(this,ht),this.status="PENDING",De(this,me,!1),De(this,me,m),De(this,ht,new Promise((S,P)=>{De(this,Z,S),De(this,rt,P)}))}isDone(){return this.status!=="PENDING"}get next(){return De(this,me,!0),m=>{if(!this.isDone())return m?this.reject(m):this.resolve({type:"DATA"})}}call(m){if(this.isDone())return Promise.resolve(this);try{this.handle(m())}catch(S){this.reject(S)}return Me(this,ht)}reject(m){this.isDone()||(this.done("REJECTED"),Me(this,rt).call(this,m))}resolve(m={}){this.isDone()||(this.done("RESOLVED"),Me(this,Z).call(this,{...m,state:"RESOLVED"}))}destroy(){}cancel(){if(!this.isDone())return this.done("CANCELED"),Me(this,Z).call(this,{state:"CANCELED"})}done(m){this.destroy(),this.status=m}handle(m,S={}){if(!this.isDone()){if(m){if(this.isCanceledResponse(m))return this.cancel();if(Rr(m)&&(m=m.toPromise()),Rt(m))return this.handle(m.data,{...S,status:m.status,headers:m.headers});if(Nn(m))return this.resolve({...S,type:"STREAM",data:m});if(Nn(m)||Buffer.isBuffer(m))return this.resolve({...S,type:"BUFFER",data:m});if(In(m))return m.then(P=>this.handle(P,S)).catch(P=>P.response&&Rt(P.response)?this.handle(P.response):this.reject(P))}if(!Me(this,me))return this.resolve({...S,data:m,type:"DATA"})}}isCanceledResponse(m){return m==="CANCELED"}}Z=new WeakMap,rt=new WeakMap,me=new WeakMap,ht=new WeakMap;function $n(u){try{u()}catch(m){return m}}async function St(u){try{await u()}catch(m){return m}}function Ts(u,m=[]){return Object.entries(u).reduce((S,[P,y])=>(Ir(P)||m.includes(P)||y===void 0||(S[P]=y),S),{})}function vn(u){return typeof u=="function"?u:u.constructor}function On(u){return vn(u)}function Re(u){return Be(u)===u?u.prototype:u}function Wt(u){const m=new Map;return u=Be(u),vr(u).forEach(S=>{Reflect.ownKeys(Re(S)).forEach(P=>{var y;G(P)||P==="constructor"||(y=Object.getOwnPropertyDescriptor(Re(S),P))!=null&&y.get||m.set(P,{target:S,propertyKey:P})})}),Array.from(m.values())}function xt(u,m){Wt(u).forEach(({target:S,propertyKey:P})=>{const y=Re(u);S!==Be(u)&&(Object.defineProperty(y,P,{writable:!0,configurable:!0,value(...xe){return Re(S)[P].apply(this,xe)}}),Ze.mergeStoreMethodFrom(u,S,P));let l=_t(u,P);const ne=m(y,P,l)||l;ne&&Object.defineProperty(y,P,ne)})}function Or(u,m){return[u,m,_t(u,m)]}function yt(u){return Array.isArray(u)}function Pr(u){return u===Array||yt(u)}function Ht(u){return u&&at(u)&&!u.prototype}function Sn(u){return u&&"isBuffer"in u&&typeof u.isBuffer=="function"?!0:Ps(u)}function Ps(u){return!!(u&&(u===Uint8Array||u instanceof Uint8Array))}function bn(u){return u===Object}function Es(u){return bn(Be(u))&&u!==Object}function wn(u){return!u||Ht(u)?!1:!(G(u)||bs(u)||bn(u)||$t(u)||In(u)||Pr(u)||Sn(u))}function ls(u){return wn(u)?Be(u):u}function qr(u){return`${(On(u).toString().split(`
15
+ `).find(m=>m.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function Tn(u){return qr(u).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(m=>m.trim())}function rn(){return`e${Math.random().toString(36).substring(7)}`}const Un=u=>{const[m,S,P,y="."]=u;return tn(S)||$e(m)?{expression:m,scope:S,defaultValue:P,separator:y}:{expression:S,scope:m,defaultValue:P,separator:y}};function Gr(...u){const m=Un(u);let S=m.scope;const{expression:P,defaultValue:y,separator:l}=m;if(!P)return S;if(!S)return y;const ne=P.split(l),xe=Te=>{if(S){if(S[Te]!==void 0||tn(S)&&Te in S)return S[Te];if(at(S.get))return S.get(Te)}};for(;(S=xe(ne.shift()))&&ne.length;);return S===void 0?y:S}function Pn(u){return u&&typeof u.toJSON=="function"}function Ln(u,m){let S="0.0.0.0",P=m;return typeof m=="string"&&m.indexOf(":")>-1&&([S,P]=m.split(":"),P=+P),{protocol:u,address:S,port:P,toString(){return[`${this.protocol}://${this.address}`,typeof this.port=="number"&&this.port].filter(Boolean).join(":")}}}function Kr(u,m){for(const S of vr(u)){const P=Object.getOwnPropertyDescriptor(S&&S.prototype||S,m);if(P)return P}}function Fn(u){return Pr(u)||u===Map||u instanceof Map||u===Set||u instanceof Set||u===WeakMap||u instanceof WeakMap||u===WeakSet||u instanceof WeakSet}function Ms(u){return u===""||Ut(u)}function Bn(u,m){const S=Be(u);if(S){const P=Kr(S,m);if(P)return P.enumerable}return Object.prototype.propertyIsEnumerable.call(u,m)}function As(u,m,S=5){if(!u||!m)return!1;for(u=Be(u),m=Be(m);wr(u)!=="";){if(!S)return!1;if(u===m)return!0;u=Qr(u),S--}return!1}function hs(u){return!!(u&&u!=null&&u._isAMomentObject)}function jr(u){return u&&u._bsontype}function En(u){return!!(Pn(u)&&u.$isMongooseModelPrototype||jr(u))}function Rs(u){return!(Buffer.isBuffer(u)||Nn(u)||Vt(u)||ir(u)||$e(u)||Ut(u))}function nn(u){return ln(u)?"string":Zt(u)?"number":Lt(u)?"boolean":"any"}function qn(u,m,S,P="."){const y=m.split(P),l=(ne,xe)=>Ir(ne)?!1:xe?(typeof u.set=="function"?u.set(ne,S):u[ne]=S,!1):(typeof u.set=="function"?(u.has(ne)||u.set(ne,{}),u=u.get(ne)):u=u[ne]=u[ne]||{},!0);for(;l(y.shift(),!y.length););}function gt(u){return u?$e(u)?m=>m[u]:u:(m,S)=>String(S)}function xs(u,m){if(yt(u)){const P=gt(m||"id");return u.reduce((y,l,ne)=>([].concat(P(l,ne)).forEach(xe=>{var Te;const _e=y.get(xe);l=((Te=_e==null?void 0:_e.merge)==null?void 0:Te.call(_e,l))||l,y.set(xe,l)}),y),new Map)}const S=gt(m);return Object.entries(u).reduce((P,[y,l])=>P.set(S(l,y),l),new Map)}function Gn(u){return Array.from(new Set(u).values())}function js(u,m="id"){const S=new Map;return u.forEach(P=>{S.set(P[m],P)}),Array.from(S.values())}function Mn(...u){return(...m)=>{const S=typeof m[2]=="object";if(u.filter(P=>!!P).forEach(P=>{const y=P(...m);S&&typeof y=="object"&&(m[2]=y)}),S)return m[2]}}function ds(u){return(m,S)=>u(m,S,_t(m,S))}function An(...u){return(m,S)=>{u.filter(Boolean).forEach(P=>P(m,S,_t(m,S)))}}n.AnyToPromise=Br,n.AnyToPromiseResponseTypes=xr,n.AnyToPromiseStatus=ps,n.CLASS_STORE=us,n.DecoratorTypes=Ye,n.Env=Tr,n.EnvTypes=fs,n.METHOD_STORE=Et,n.Metadata=Qt,n.PARAM_STORE=yn,n.PROPERTY_STORE=Yr,n.Store=Ze,n.StoreFn=Zr,n.StoreMerge=gn,n.StoreSet=Fr,n.Type=kt,n.UnsupportedDecoratorType=ct,n.ancestorOf=Qr,n.ancestorsOf=vr,n.catchAsyncError=St,n.catchError=$n,n.classOf=Be,n.cleanObject=Ts,n.constructorOf=On,n.createInstance=ar,n.decorateMethodsOf=xt,n.decoratorArgs=Or,n.decoratorTypeOf=dt,n.deepClone=dr,n.deepMerge=mr,n.descriptorOf=_t,n.getClass=nt,n.getClassOrSymbol=ls,n.getConstructor=vn,n.getConstructorArgNames=Tn,n.getHostInfoFromPort=Ln,n.getInheritedClass=en,n.getRandomId=rn,n.getValue=Gr,n.hasJsonMethod=Pn,n.inheritedDescriptorOf=Kr,n.isArray=yt,n.isArrayOrArrayClass=Pr,n.isArrowFn=Ht,n.isBoolean=Vt,n.isBooleanOrBooleanClass=Lt,n.isBuffer=Sn,n.isClass=wn,n.isClassObject=bn,n.isCollection=Fn,n.isDate=$t,n.isEmpty=Ms,n.isEnumerable=Bn,n.isFunction=at,n.isInheritedFrom=As,n.isMethodDescriptor=ws,n.isMomentObject=hs,n.isMongooseObject=En,n.isNil=Ut,n.isNumber=ir,n.isNumberOrNumberClass=Zt,n.isObject=tn,n.isObjectID=jr,n.isObservable=Rr,n.isPlainObject=Es,n.isPrimitive=mt,n.isPrimitiveClass=le,n.isPrimitiveOrPrimitiveClass=bs,n.isPromise=In,n.isProtectedKey=Ir,n.isRegExp=hn,n.isSerializable=Rs,n.isStream=Nn,n.isString=$e,n.isStringOrStringClass=ln,n.isSymbol=G,n.isSymbolOrSymbolClass=kn,n.isUint8Array=Ps,n.mergeReducerBuilder=Je,n.methodsOf=Wt,n.nameOf=wr,n.nameOfClass=cr,n.nameOfSymbol=is,n.objectKeys=Nr,n.primitiveOf=nn,n.prototypeOf=Re,n.setValue=qn,n.toMap=xs,n.toStringConstructor=qr,n.uniq=Gn,n.uniqBy=js,n.useDecorators=Mn,n.useMethodDecorator=ds,n.useMethodDecorators=An,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})})}(co,co.exports)),co.exports}var Mr=ku(),uo={exports:{}},Du=uo.exports,Pa;function Iu(){return Pa||(Pa=1,function(ve,ke){(function(n,Ee){Ee(ke,ao)})(Du,function(n){var Ee=i=>{throw TypeError(i)},tt=(i,o,p)=>o.has(i)||Ee("Cannot "+p),Me=(i,o,p)=>(tt(i,o,"read from private field"),p?p.call(i):o.get(i)),lt=(i,o,p)=>o.has(i)?Ee("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(i):o.set(i,p),De=(i,o,p,v)=>(tt(i,o,"write to private field"),o.set(i,p),p),Z,rt,me,ht,Ye,nt,Be;const dt=Symbol("DI_INVOKE_OPTIONS"),$t=Symbol("DI_INJECTABLE_PROPS"),at="DI_USE_OPTIONS",Ut="DI_USE_PARAM_OPTIONS",Vt="DI_INTERCEPTOR_OPTIONS";function Lt(i){return Array.isArray(i)}function ir(i){return i===Array||Lt(i)}var Zt={exports:{}},$e=Zt.exports,ln;function bs(){return ln||(ln=1,function(i,o){(function(p,v){v(o)})($e,function(p){var v=Q=>{throw TypeError(Q)},b=(Q,ye,he)=>ye.has(Q)||v("Cannot "+he),A=(Q,ye,he)=>(b(Q,ye,"read from private field"),he?he.call(Q):ye.get(Q)),X=(Q,ye,he)=>ye.has(Q)?v("Cannot add the same private member more than once"):ye instanceof WeakSet?ye.add(Q):ye.set(Q,he),z;function je(Q,ye){return!Q||!ye.ref||Q&&ye.ref===Q}class Qe{constructor(){X(this,z,new Map)}has(ye){var he;return!!((he=A(this,z).get(ye))!=null&&he.length)}on(ye,he,oe){let L=he;oe||(oe=L,L=void 0);const B=A(this,z).get(ye)||[];return B.push({cb:oe,ref:L}),A(this,z).set(ye,B),this}once(ye,he,oe){oe||(oe=he);const L=(...B)=>{oe(...B),this.off(ye,L)};return this.on(ye,he,L),this}off(ye,he){const oe=(L,B)=>{B.length?A(this,z).set(L,B):A(this,z).delete(L)};if(typeof ye=="string"&&he){let L=A(this,z).get(ye);L&&oe(ye,L.filter(B=>B.cb!==he))}else{const L=ye;A(this,z).forEach((B,H)=>{oe(H,B.filter(ae=>ae.ref!==L))})}return this}emit(ye,he,oe){Array.isArray(he)&&(oe=he,he=void 0),oe||(oe=[]);const L=A(this,z).get(ye);if(L!=null&&L.length)for(const B of L)je(he,B)&&B.cb.apply(null,oe)}async asyncEmit(ye,he,oe){Array.isArray(he)&&(oe=he,he=void 0);const L=A(this,z).get(ye);if(L!=null&&L.length){const B=L.filter(H=>je(he,H)).map(H=>H.cb.apply(null,oe));await Promise.all(B)}}alter(ye,he,oe=[],L=null){const B=A(this,z).get(ye);if(B!=null&&B.length)for(const{cb:H}of B)he=H.call(L,he,...oe);return he}async asyncAlter(ye,he,oe=[],L=null){const B=A(this,z).get(ye);if(B!=null&&B.length)for(const H of B)he=await H.cb.call(L,he,...oe);return he}destroy(){A(this,z).clear()}}z=new WeakMap;const He=new Qe,qt=He.on.bind(He),_r=He.once.bind(He),ut=He.off.bind(He),T=He.emit.bind(He),j=He.asyncEmit.bind(He),D=He.alter.bind(He),K=He.asyncAlter.bind(He);p.$alter=D,p.$asyncAlter=K,p.$asyncEmit=j,p.$emit=T,p.$off=ut,p.$on=qt,p.$once=_r,p.Hooks=Qe,p.hooks=He,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})})}(Zt,Zt.exports)),Zt.exports}var mt=bs();class le extends Map{constructor(){super(...arguments),this.hooks=new mt.Hooks}async destroy(){await this.hooks.asyncEmit("$onDestroy")}}function hn(i){return i.prototype?i:i.constructor}function G(i){return hn(i)}function kn(i){return i===Date||i instanceof Date&&!isNaN(+i)}function br(i){return typeof i=="function"}function dr(i){return i==null}function ar(i){return typeof i=="boolean"||i instanceof Boolean||i===Boolean}function Ir(i){return typeof i=="boolean"||i instanceof Boolean||i===Boolean}function Nr(i){return typeof i=="number"}function Je(i){return typeof i=="number"||i instanceof Number||i===Number}function zr(i){return typeof i=="string"}function d(i){return typeof i=="string"||i instanceof String||i===String}function Ar(i){return d(i)||Je(i)||Ir(i)}function Le(i){return zr(i)||Nr(i)||ar(i)}function mr(i){return i instanceof RegExp}function _t(i){return typeof i=="symbol"}const ws=i=>dr(i)||Le(i)||_t(i)||br(i),cr=(i,o=new WeakMap)=>{if(ws(i))return i;const p=o.get(i);if(p)return p;if(ArrayBuffer.isView(i))return Buffer.isBuffer(i)?Buffer.from(i):new(G(i))(i.buffer.slice(0),i.byteOffset,i.byteLength);if(kn(i))return new Date(i);if(mr(i))return new RegExp(i);if(Array.isArray(i)){const b=[];return o.set(i,b),i.forEach((A,X)=>b[X]=cr(A,o)),b}if(i instanceof Map){const b=new Map;return o.set(i,b),i.forEach((A,X)=>b.set(cr(X,o),cr(A,o))),b}if(i instanceof Set){const b=new Set;return o.set(i,b),i.forEach(A=>b.add(cr(A,o))),b}const v=Object.create(Reflect.getPrototypeOf(i));return o.set(i,v),Reflect.ownKeys(i).forEach(b=>{const A=Object.getOwnPropertyDescriptor(i,b);A&&(br(A.value)?Object.defineProperty(v,b,A):Object.defineProperty(v,b,{...A,value:cr(A.value,o)}))}),v};function is(i){return i?G(i)!==Object?Object.create(i):{}:{}}function wr(i){return["__proto__","constructor","prototype"].includes(i)}function $r(i){return Object.keys(i).filter(o=>!wr(o))}function as(i){return(o,p,v)=>{const b=o.findIndex(A=>i(A,p));return b===-1?[...o,p]:(o[b]=gr(o[b],p,v),o)}}const dn=as((i,o)=>i===o);function yr({reducers:i,parentKey:o}){return i?o&&i[o]?i[o]:i.default||dn:dn}function mn(i,o){return Le(i)||_t(i)||br(i)||o===void 0}function cs(i,o){return i==null||i===""&&o!==""}function gr(i,o,p={}){if(cs(o,i))return i;if(mn(o,i))return o;if(Array.isArray(i)){const b=yr(p);return[].concat(o).reduce((A,X)=>b(A,X,p),[...i])}const v=is(i);return[...$r(i),...$r(o)].reduce((b,A)=>{var X;const z=i&&i[A],je=gr(z,o&&o[A],{...p,parentKey:A});return p.cleanUndefinedProps&&je===void 0||(b[A]=((X=p.alter)==null?void 0:X.call(p,A,je))??je),b},v)}function Ur(i){return i&&br(i)&&!i.prototype}function Lr(i){return i&&"isBuffer"in i&&typeof i.isBuffer=="function"?!0:Qt(i)}function Qt(i){return!!(i&&(i===Uint8Array||i instanceof Uint8Array))}function us(i){return i===Object}function Et(i){return i===Promise||i instanceof Promise||!!i&&typeof i.subscribe!="function"&&typeof i.then=="function"}function Yr(i){return!i||Ur(i)?!1:!(_t(i)||Ar(i)||us(i)||kn(i)||Et(i)||ir(i)||Lr(i))}function yn(i){return i&&Object.getPrototypeOf(i)}function Xr(i){return yn(i)}function Ft(i){return typeof i=="function"?i.name:i.constructor.name}const Dn=i=>i.toString().replace("Symbol(","").replace(")","");function Ze(i){switch(typeof i){default:return""+i;case"symbol":return Dn(i);case"function":return Ft(i)}}function Zr(i,o,p=5){if(!i||!o)return!1;for(i=G(i),o=G(o);Ze(i)!=="";){if(!p)return!1;if(i===o)return!0;i=yn(i),p--}return!1}function gn(i){return typeof i=="object"}function Fr(i){return Yr(i)?G(i):i}var ct;(function(i){i.PARAM="parameter",i.PARAM_CTOR="parameter.constructor",i.PARAM_STC="parameter.static",i.PROP="property",i.PROP_STC="property.static",i.METHOD="method",i.METHOD_STC="method.static",i.CLASS="class"})(ct||(ct={}));function Tr(i){const[o,p,v]=i,b=A=>o!==G(o)?A:`${A}.static`;return typeof v=="number"?p?b("parameter"):"parameter.constructor":v&&v.value?b("method"):p&&v===void 0||v?b("property"):ct.CLASS}function fs(i,o){return Reflect.getOwnPropertyDescriptor(i&&i.prototype||i,o)}const kt="design:paramtypes",Qr="design:type",en="design:returntype",vr=new Map,tn=class{static get(o,p,v){return Reflect.getMetadata(o,G(p),v)}static getOwn(o,p,v){return Reflect.getOwnMetadata(o,G(p),v)}static getType(o,p){return Reflect.getMetadata(Qr,o,p)}static getOwnType(o,p){return Reflect.getMetadata(Qr,o,p)}static getReturnType(o,p){return Reflect.getMetadata(en,o,p)}static getOwnReturnType(o,p){return Reflect.getOwnMetadata(en,o,p)}static has(o,p,v){try{return Reflect.hasMetadata(o,G(p),v)}catch{}return!1}static hasOwn(o,p,v){return Reflect.hasOwnMetadata(o,G(p),v)}static delete(o,p,v){return Reflect.deleteMetadata(o,G(p),v)}static setParamTypes(o,p,v){return this.set(kt,v,o.prototype,p)}static set(o,p,v,b){const A=vr.has(o)?vr.get(o)||[]:[],X=G(v);A.indexOf(X)===-1&&(A.push(X),vr.set(o,A)),Reflect.defineMetadata(o,p,G(v),b)}static getParamTypes(o,p){return Reflect.getMetadata(kt,o,p)||[]}static getOwnParamTypes(o,p){return Reflect.getOwnMetadata(kt,o,p)||[]}};tn.getTargetsFromPropertyKey=i=>vr.has(i)?vr.get(i)||[]:[];let Rr=tn;const In="tsed:class:store",Nn="tsed:method:store",Rt="tsed:property:store",ps="tsed:param:store",xr=new Map;function Br(i,...o){if(_t(o[0]))return xr.has(o[0])||xr.set(o[0],new St),xr.get(o[0]);{const p=Rr;return p.hasOwn(i,...o)||p.set(i,new St,...o),p.getOwn(i,...o)}}function $n(i){const[o,p,v]=i;switch(Tr(i)){case ct.PARAM_CTOR:case ct.PARAM_STC:case ct.PARAM:const b=Br(ps,o,p);return b.has(""+v)||b.set(""+v,new St),b.get(""+v);case ct.PROP:case ct.PROP_STC:return Br(Rt,o,p);case ct.METHOD:case ct.METHOD_STC:return Br(Nn,o,p);case ct.CLASS:return Br(In,o)}}class St{constructor(){this._entries=new Map}static from(...o){return $n(o)}static fromMethod(o,p){return St.from(o,p,fs(o,p))}static mergeStoreFrom(o,p,...v){const b=St.from(o,...v);return St.from(p,...v)._entries.forEach((A,X)=>{b.merge(X,A)}),b}static mergeStoreMethodFrom(o,p,v){return this.mergeStoreFrom(o,p,v,fs(o,v))}get(o,p){return this._entries.get(Ze(o))||p}has(o){return this._entries.has(Ze(o))}set(o,p){return this._entries.set(Ze(o),p),this}delete(o){return this._entries.delete(Ze(o))}merge(o,p,v=!1){let b=this.get(o);return b&&(p=cr(p),b=cr(b),p=v?gr(p,b):gr(b,p)),this.set(o,p),this}toJson(){return[...this._entries.entries()].reduce((o,[p,v])=>({...o,[p]:v}),{})}}function Ts(i){const o=[];let p=G(i);for(;p&&Ze(p)!=="";)o.unshift(p),p=Xr(p);return o}function vn(i){return G(i)===i?i.prototype:i}function On(i){const o=new Map;return i=G(i),Ts(i).forEach(p=>{Reflect.ownKeys(vn(p)).forEach(v=>{var b;_t(v)||v==="constructor"||(b=Object.getOwnPropertyDescriptor(vn(p),v))!=null&&b.get||o.set(v,{target:p,propertyKey:v})})}),Array.from(o.values())}function Re(i){return On(i).reduce((o,{propertyKey:p})=>{if(String(p).startsWith("$")){const v=(b,...A)=>b==null?void 0:b[p](...A);return{...o,[p]:v}}return o},{})}var Wt=(i=>(i.SINGLETON="singleton",i.REQUEST="request",i.INSTANCE="instance",i))(Wt||{}),xt=(i=>(i.VALUE="value",i.PROVIDER="provider",i.MODULE="module",i.CONTROLLER="controller",i.INTERCEPTOR="interceptor",i.MIDDLEWARE="middleware",i))(xt||{});const Or=class Ic{constructor(o,p={}){lt(this,Z),lt(this,rt),lt(this,me),lt(this,ht),this.type=xt.PROVIDER,this.hooks={},this.token=o,this.useClass=o,Object.assign(this,p),p instanceof Ic&&(De(this,Z,Me(p,Z)),De(this,me,Me(p,me)),De(this,ht,Me(p,ht)))}get token(){return Me(this,rt)}set token(o){o&&(De(this,rt,Fr(o)),De(this,ht,De(this,me,St.from(o))))}get provide(){return this.token}set provide(o){this.token=o}get useClass(){return Me(this,Z)}set useClass(o){Yr(o)&&(De(this,Z,G(o)),De(this,me,St.from(o)),this.hooks=Re(Me(this,Z)))}get className(){return this.name}get name(){return Ze(this.token)}get store(){return Me(this,me)}get path(){return this.store.get("path","/")}set path(o){this.store.set("path",o)}get scope(){return this.isAsync()?Wt.SINGLETON:this.get("scope",Wt.SINGLETON)}set scope(o){this.store.set("scope",o)}get configuration(){return this.get("configuration")}set configuration(o){this.store.set("configuration",o)}get children(){return this.store.get("childrenControllers",[])}set children(o){this.store.set("childrenControllers",o)}getArgOpts(o){return this.store.get(`${Ut}:${o}`)}get(o,p){return this.store.get(o)||Me(this,ht).get(o)||p}isAsync(){return!!this.useAsyncFactory}clone(){return new(G(this))(this.token,this)}hasChildren(){return!!this.children.length}hasParent(){return!!this.store.get("parentController")}toString(){return["Token",this.name,this.useClass&&Ze(this.useClass),this.useFactory&&"Factory",this.useValue&&"Value",this.useAsyncFactory&&"AsyncFactory"].filter(Boolean).join(":")}reset(){return this.useValue=void 0,this.useFactory=void 0,this.useAsyncFactory=void 0,this}};Z=new WeakMap,rt=new WeakMap,me=new WeakMap,ht=new WeakMap;let yt=Or;class Pr extends Map{constructor(){super(...arguments),lt(this,Ye,new Map)}get(o){return super.get(Fr(o))}has(o){return super.has(Fr(o))}set(o,p){return super.set(Fr(o),p),this}merge(o,p){if(p.global===!1)return Ht.createProvider(o,p);const v=this.createIfNotExists(o,p);return Object.keys(p).forEach(b=>{v[b]=p[b]}),this.set(o,v),v}delete(o){return super.delete(Fr(o))}createRegistry(o,p,v={}){const b=this.getRegistrySettings(o);return v=Object.assign(b,{...v,model:p}),Me(this,Ye).set(o,v),this}getRegistrySettings(o){let p=xt.PROVIDER;if(typeof o=="string")p=o;else{const v=this.get(o);v&&(p=v.type)}return Me(this,Ye).get(p)||{model:yt}}createProvider(o,p){const v=p.type||xt.PROVIDER,{model:b=yt}=Me(this,Ye).get(v)||{};return new b(o,p)}createIfNotExists(o,p){if(!this.has(o)){const v=this.createProvider(o,p);this.set(o,v)}return this.get(o)}}Ye=new WeakMap;const Ht=new Pr;class Sn extends Map{add(o,p={}){var v;const b=((v=Ht.get(o))==null?void 0:v.clone())||new yt(o);return Object.assign(b,p),super.set(o,b)}addProvider(o,p={}){return this.add(o,p)}hasProvider(o){return super.has(o)}setProvider(o,p){return super.set(o,p)}getProvider(o){return super.get(o)}getProviders(o){const p=[].concat(o).map(String);return[...this].reduce((v,[b,A])=>p.includes(String(A.type))||!o?[...v,A]:v,[])}addProviders(o){o.forEach(p=>{this.hasProvider(p.token)||this.setProvider(p.token,p.clone())})}}function Ps(i){return typeof i=="function"?i:i.constructor}function bn(i){return Ps(i)}function Es(i){return`${(bn(i).toString().split(`
16
+ `).find(o=>o.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function wn(i){return Es(i).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(o=>o.trim())}const ls=i=>o=>!process.env.NO_COLOR&&process.env.NODE_ENV!=="production"?i(o):o,qr=ls(i=>`\x1B[31m${i}\x1B[39m`),Tn=ls(i=>`\x1B[33m${i}\x1B[39m`),rn=ls(i=>`\x1B[32m${i}\x1B[39m`),Un={red:qr,yellow:Tn,green:rn};class Gr extends Error{constructor(o,p){super(zr(p)?p:""),this.name="INJECTION_ERROR",this.tokens=[],this.tokens=[o],p&&(zr(p)?this.origin={message:p,stack:this.stack}:p.tokens?(this.tokens=this.tokens.concat(p.tokens),this.origin=p.origin):(this.origin=p,this.stack=p.stack));const v=this.origin?`
17
+ Origin: `+this.origin.message:"",b=this.tokens.map(A=>Ze(A)).join(" > ");this.message=`Injection failed on ${b}${v}`}static throwInjectorError(o,p,v){throw p&&Yr(o)&&(v.message=Pn(o,{...p,message:v.message})),new Gr(o,v)}}function Pn(i,o){let p="";const v=wn(i).map((z,je)=>(o.index===je&&(p=z,z=Un.red(z)),`${z}: ${Ze(o.deps[je])}`)).join(", "),b=Ze(i)+"->constructor("+v+")",A=b.indexOf(p)-5,X=z=>" ".repeat(z)+Un.red("^"+"‾".repeat(p.length-1));return"Unable to inject dependency. "+o.message+`
18
+
19
+ `+b+`
20
+ `+(A>-1?X(A):"")}function Ln(i){const o=new Sn(Ht.entries());return i&&o.delete(i),o}function Kr(i,o){return Rr.getOwn("override:ctor:design:paramtypes",i,o)||[...Rr.getParamTypes(i,o)]}function Fn(i,o){Rr.set("override:ctor:design:paramtypes",o,i)}const Ms=i=>{const[o,p,v,b="."]=i;return gn(p)||zr(o)?{expression:o,scope:p,defaultValue:v,separator:b}:{expression:p,scope:o,defaultValue:v,separator:b}};function Bn(...i){const o=Ms(i);let p=o.scope;const{expression:v,defaultValue:b,separator:A}=o;if(!v)return p;if(!p)return b;const X=v.split(A),z=je=>{if(p){if(p[je]!==void 0||gn(p)&&je in p)return p[je];if(br(p.get))return p.get(je)}};for(;(p=z(X.shift()))&&X.length;);return p===void 0?b:p}function As(i,o,p,v="."){const b=o.split(v),A=(X,z)=>wr(X)?!1:z?(typeof i.set=="function"?i.set(X,p):i[X]=p,!1):(typeof i.set=="function"?(i.has(X)||i.set(X,{}),i=i.get(X)):i=i[X]=i[X]||{},!0);for(;A(b.shift(),!b.length););}const hs=Symbol.for("CONFIGURATION");class jr{constructor(o={}){this.default=new Map,this.map=new Map,Object.entries({imports:[],routes:[],logger:{},...o}).forEach(([p,v])=>{this.default.set(p,v)})}get version(){return this.get("version")}set version(o){this.map.set("version",o)}get rootDir(){return this.get("rootDir")}set rootDir(o){this.map.set("rootDir",o)}get env(){return this.map.get("env")}set env(o){this.map.set("env",o)}get imports(){return this.get("imports")}set imports(o){this.map.set("imports",o)}get routes(){return this.get("routes")}set routes(o){this.map.set("routes",o)}get logger(){return this.get("logger")}set logger(o){const p={...this.logger,...o};this.map.set("logger",p)}get debug(){return this.logger.level==="debug"}set debug(o){this.logger={...this.logger,level:o?"debug":"info"}}forEach(o,p){return new Set([...Array.from(this.default.keys()),...Array.from(this.map.keys())]).forEach(v=>{o(this.getRaw(v),v,this.map)},p)}set(o,p){return typeof o=="string"?Reflect.has(this,o)?this[o]=p:this.setRaw(o,p):Object.entries(o).forEach(([v,b])=>{this.set(v,b)}),this}setRaw(o,p){return As(this.map,o,p),this}get(o,p){return this.getRaw(o,p)}getRaw(o,p){const v=Bn(this.map,o);return v!==void 0?v:Bn(this.default,o,p)}}const En=["mount","imports"],Rs=class wa extends Sn{constructor(){super(),lt(this,nt),lt(this,Be),this.logger=console,this.resolvedConfiguration=!1,De(this,nt,new le),De(this,Be,!1),Me(this,nt).set(wa,this),Me(this,nt).set(jr,new jr)}get settings(){return Me(this,nt).get(jr)}set settings(o){Me(this,nt).set(jr,o)}isLoaded(){return Me(this,Be)}toArray(){return[...Me(this,nt).values()]}get(o,p){return this.has(o)?Me(this,nt).get(o):this.resolve(o,p)}getMany(o,p){return this.getProviders(o).map(v=>this.resolve(v.token,p))}has(o){return Me(this,nt).get(o)!==void 0}alias(o,p){return Me(this,nt).set(p,Me(this,nt).get(o)),this}resolve(o,p={}){let v=p.locals?p.locals.get(o):void 0;if(v!==void 0)return v;if(o===Ut)return p.useOpts;if(v=p.rebuild?void 0:Me(this,nt).get(o),v!=null)return v;const b=this.ensureProvider(o);if(!b||p.rebuild)return v=this.invokeToken(o,p),b?this.setToCache(b,v):v;switch(v=this.invokeToken(o,p),b.scope){case Wt.SINGLETON:return p.rebuild||this.registerHooks(b,p),this.setToCache(b,v);case Wt.REQUEST:return p.locals&&(p.locals.set(b.token,v),this.registerHooks(b,p)),v}return v}invoke(o,p={}){return this.resolve(o,p)}async loadAsync(){for(const[,o]of this)!this.has(o.token)&&o.isAsync()&&await this.resolve(o.token)}loadSync(){for(const[,o]of this)!this.has(o.token)&&o.scope===Wt.SINGLETON&&this.resolve(o.token)}async load(o=Ln()){De(this,Be,!0),await mt.$asyncEmit("$beforeInit"),await this.bootstrap(o),await this.loadAsync(),this.loadSync(),await mt.$asyncEmit("$onInit")}async resolveConfiguration(){if(this.resolvedConfiguration)return;const o=new Map;super.forEach(p=>{p.configuration&&p.type!=="server:module"&&Object.entries(p.configuration).forEach(([v,b])=>{En.includes(v)||(b=o.has(v)?gr(o.get(v),b):cr(b),o.set(v,b))})}),o.forEach((p,v)=>{this.settings.set(v,gr(p,this.settings.get(v)))}),await mt.$asyncEmit("$afterResolveConfiguration",this.settings),this.resolvedConfiguration=!0}emit(o,...p){return mt.$asyncEmit(o,p)}alter(o,p,...v){return mt.$alter(o,p,v)}alterAsync(o,p,...v){return mt.$asyncAlter(o,p,v)}async destroy(){await mt.$asyncEmit("$onDestroy"),Me(this,nt).forEach((o,p)=>{mt.$off(p)})}async bootstrap(o=Ln()){return this.addProviders(o),await this.resolveConfiguration(),this.resolveImportsProviders(),this}ensureProvider(o,p=!1){return!this.hasProvider(o)&&(Ht.has(o)||p)&&this.addProvider(o),this.getProvider(o)}invokeToken(o,p={}){const v=this.mapInvokeOptions(o,p);if(!v)return;const{token:b,deps:A,construct:X,imports:z,provider:je}=v;mt.$emit("$beforeInvoke",b,[v]),mt.$emit(`$beforeInvoke:${String(je.type)}`,[v]);let Qe,He=!1;try{const qt=ut=>(T,j)=>(He={token:T,index:j,deps:A},Lt(T)?this.getMany(T[0],p):Zr(T,yt,1)?je:this.resolve(T,{parent:ut,locals:p.locals,useOpts:(je==null?void 0:je.getArgOpts(j))||p.useOpts}));z.forEach(qt());const _r=A.map(qt(b));He=!1,Qe=X(_r)}catch(qt){Gr.throwInjectorError(b,He,qt)}if(Qe===void 0)throw new Gr(b,`Unable to create new instance from undefined value. Check your provider declaration for ${Ze(b)}`);return Qe&&Yr(G(Qe))&&Reflect.defineProperty(Qe,dt,{get:()=>({rebuild:p.rebuild,locals:p.locals})}),mt.$emit("$afterInvoke",b,[Qe,v]),Qe}resolveImportsProviders(){var o;this.settings.imports=(o=this.settings.imports)==null?void 0:o.filter(p=>gn(p)&&"token"in p&&p.token!==wa).map(p=>{if(gn(p)&&"token"in p){const{token:v,...b}=p,A=this.ensureProvider(v,!0);if(A){if(A.useValue=void 0,A.useAsyncFactory=void 0,A.useFactory=void 0,"useClass"in b){A.useClass=b.useClass;return}if("useFactory"in b){A.useFactory=b.useFactory;return}if("useAsyncFactory"in b){A.useAsyncFactory=b.useAsyncFactory;return}if("use"in b){A.useValue=b.use;return}}}return p}).filter(Boolean)}mapInvokeOptions(o,p){const v=p.locals||new le;p.locals=v;let b=p.imports,A=p.deps,X;if(!o||o===Object)throw new Error("Given token is undefined. Could mean a circular dependency problem. Try to use @Inject(() => Token) to solve it.");let z;if(this.hasProvider(o)?z=this.getProvider(o):z=new yt(o),A=A||z.deps,b=b||z.imports,z.useValue!==void 0)X=()=>br(z.useValue)?z.useValue():z.useValue;else if(z.useFactory)X=je=>z.useFactory(...je);else if(z.useAsyncFactory)X=async je=>(je=await Promise.all(je),z.useAsyncFactory(...je));else if(z.useClass)A=A||Kr(z.useClass),X=je=>new z.useClass(...je);else return!1;return{token:o,deps:A||[],imports:b||[],construct:X,provider:z,locals:v}}registerHooks(o,p){var v;if(o.hooks){if(o.scope===Wt.REQUEST){if(p.locals&&(v=o.hooks)!=null&&v.$onDestroy){const{locals:b}=p;p.locals.hooks.on("$onDestroy",(...A)=>{var X,z;return(z=(X=o.hooks)==null?void 0:X.$onDestroy)==null?void 0:z.call(X,b.get(o.token),...A)})}return}Object.entries(o.hooks).forEach(([b,A])=>{const X=(...z)=>A(Me(this,nt).get(o.token),...z);mt.$on(b,o.token,X)})}}setToCache(o,p){const v=b=>{Me(this,nt).set(o.token,b),o!=null&&o.alias&&this.alias(o.token,o.alias)};return"isAsync"in o&&!o.isAsync()&&!Et(p)?(v(p),p):(v(p),p=p.then(b=>(v(b),b)),p)}};nt=new WeakMap,Be=new WeakMap;let nn=Rs,qn=new nn;function gt(){return qn}async function xs(){await qn.destroy(),qn=new nn}function Gn(i,o){const p=gt(),v=new le,b=Kr(i),A=[],X=Math.max(b.length,o.length);for(let z=0;z<X;z++)if(o[z]!==void 0)A.push(o[z]);else{const je=b[z],Qe=Lt(je)?p.getMany(je[0],{locals:v,parent:i}):p.invoke(je,{locals:v,parent:i});A.push(Qe)}return A}function js(){return i=>class extends i{constructor(...o){super(...Gn(i,o))}}}function Mn(i,o){if(i){const p=St.from(i);return o&&p.set("configuration",o),p.get("configuration",o)}return gt().settings}class ds extends yt{constructor(o,p={}){super(o,p),this.type=xt.CONTROLLER}get middlewares(){return Object.assign({use:[],useAfter:[],useBefore:[]},this.store.get("middlewares",{}))}set middlewares(o){const p=this.middlewares,v=(b,A,X)=>A[b]=A[b].concat(X[b]);Object.keys(o).forEach(b=>{v(b,p,o)}),this.store.set("middlewares",p)}}Ht.createRegistry(xt.CONTROLLER,ds);function An({token:i,provide:o,...p}){return S(i||o,{...p,token:i||o}).inspect()}function u(i,o={}){return(p,v={})=>{const b={global:!gt().isLoaded(),...v,...o,token:p},A=Ht.merge(p,b);return b.global||gt().setProvider(p,A),i.reduce((X,z)=>({...X,[z]:function(je){return A[z]=je,this}}),{factory(X){return A.reset(),A.useFactory=X,this},asyncFactory(X){return A.reset(),A.useAsyncFactory=X,this},value(X){return A.reset(),A.useValue=X,A.type=xt.VALUE,this},class(X){return A.reset(),A.useClass=X,this},store(){return A.store},inspect(){return A},token(){return A.token}})}}const m=["type","scope","path","alias","hooks","deps","imports","configuration","priority"],S=u(m),P=u(m,{type:xt.INTERCEPTOR}),y=u([...m,"middlewares"],{type:xt.CONTROLLER});function l(i){try{i()}catch(o){return o}}class ne extends Error{constructor(o,p){super(`Object isn't a valid token. Please check the token set on ${Ze(G(o))}.${p}.
21
+ - Check that it is not a circular reference.
22
+ - Check that the token (class or symbol) exists`),this.name="INVALID_TOKEN_ERROR"}}let xe,Te={};const _e=[];function Ve({providers:i,rebuild:o}={}){return(!xe||i)&&(xe=new le,i&&(i.forEach(p=>{xe.set(p.token,p.use)}),xe.set(nn,gt())),o&&(Te.rebuild=o)),xe}function Mt(){return{...Te}}function ur(){xe&&_e.push(xe),xe=void 0,Te={}}function er(){ur(),_e.map(i=>i.clear())}function Er(i,o){return gt().resolve(i,{...o,...Mt(),locals:(o==null?void 0:o.locals)||Ve()})}function Bt(i,o){return gt().getMany(i,{...o,locals:(o==null?void 0:o.locals)||Ve()})}function Jr(i,{target:o,propertyKey:p,parameterIndex:v}){const b=Kr(o,p),A=b[v];b[v]=A===Array?[i]:i,Rr.setParamTypes(o,p,b),Fn(o,b)}function st(i,o,p){const v=i||Rr.getType(o,p);if(v===Object)throw new ne(o,String(p));return v}function Kn(i,o,{token:p,transform:v=A=>A,useOpts:b}){const A=Symbol();i[$t]||Reflect.defineProperty(i,$t,{value:new Set,enumerable:!1,configurable:!1}),i[$t].add(o),l(()=>Reflect.deleteProperty(i,o)),Reflect.defineProperty(i,o,{get(){var X,z;const je=st(p,i,o),Qe=Rr.getType(i,o),He={rebuild:!!((X=this[dt])!=null&&X.rebuild),locals:(z=this[dt])==null?void 0:z.locals,useOpts:b||St.from(i,o).get(at)};return this[A]===void 0&&(this[A]=Qe===Array?Bt(p,He):Er(je,He)),[].concat(this[A]).forEach((qt,_r)=>{Et(this[A])&&qt.then(ut=>{this[A][_r]=ut,Qe!==Array&&(this[A]=ut)})}),v(this[A],{self:this,target:i,propertyKey:o})}})}function sn(i,o={}){return o=typeof o=="function"?{transform:o}:o,(p,v,b)=>{switch(Tr([p,v,b])){case ct.PARAM_CTOR:i&&Jr(i,{target:p,propertyKey:v,parameterIndex:b});break;case ct.PROP:Kn(p,v,{...o,token:i})}}}function fr(i={}){return(...o)=>{switch(Tr(o)){case ct.CLASS:Mn(o[0],i);break;default:case ct.PARAM_CTOR:return sn(jr)(o[0],o[1],o[2])}}}S(fr).factory(()=>gt().settings);function Vr(i,o){return gt().settings.get(i,o)}function on(i,o,p,v){const b=Symbol();l(()=>Reflect.deleteProperty(i,o)),Reflect.defineProperty(i,o,{get(){if(this[b]!==void 0)return this[b];const A=Vr(p,v);return this[b]=Object.freeze(cr(A)),this[b]},set(A){(Vr(p,v)||this[b])===void 0&&A!==void 0&&(this[b]=A)},enumerable:!0,configurable:!0})}function Jn(i,o){return(p,v)=>on(p,v,i,o)}function Vn(...i){return(...o)=>{const p=typeof o[2]=="object";if(i.filter(v=>!!v).forEach(v=>{const b=v(...o);p&&typeof b=="object"&&(o[2]=b)}),p)return o[2]}}function Wn(i){return typeof i=="string"||i instanceof RegExp||ir(i)?{path:i}:i}function an(i){const{children:o=[],path:p,...v}=Wn(i);return Vn(b=>{const A=y(b,v);p&&A.store().set("path",p),A.store().set("childrenControllers",o),o.forEach(X=>{St.from(X).set("parentController",G(b))})})}function cn(i={}){return o=>{const p={...i,...i.token?{useClass:o}:{token:o}};S(p.token,p)}}function Cs(i,o){On(i).forEach(({target:p,propertyKey:v})=>{const b=vn(i);p!==G(i)&&(Object.defineProperty(b,v,{writable:!0,configurable:!0,value(...z){return vn(p)[v].apply(this,z)}}),St.mergeStoreMethodFrom(i,p,v));let A=fs(i,v);const X=o(b,v,A)||A;X&&Object.defineProperty(b,v,X)})}function Hn(i,o){return St.fromMethod(i,o).get(Vt)}function un(i,o,p,v){const b=G(i),A=Reflect.getOwnPropertyDescriptor(b.prototype,o),X=A.value,z=Symbol();St.fromMethod(b,o).set(Vt,v);function je(...Qe){var He,qt;const _r=j=>{if(!j)return X.apply(this,Qe);throw j},ut={target:b,propertyKey:o,args:Qe,options:v,next:_r},T={rebuild:!!((He=this[dt])!=null&&He.rebuild),locals:(qt=this[dt])==null?void 0:qt.locals};return this[z]=this[z]||Er(p,T),this[z].intercept({...ut,options:v},_r)}return A.value=je,Reflect.deleteProperty(b.prototype,o),Reflect.defineProperty(b.prototype,o,A),A}function zn(i,o){return(...p)=>{const[v,b]=p;switch(Tr(p)){case ct.CLASS:Cs(v,zn(i,o));break;case ct.METHOD:return un(v,b,i,o)}}}function pr(){return cn({type:xt.INTERCEPTOR})}async function Yn(i){const{default:o}=await i();if(!gt().has(o)){const p=await Er(o);"$onInit"in p&&br(p.$onInit)&&await p.$onInit()}return gt().get(o)}async function Xn(i){try{return await Yn(i)}catch{return}}function lr(i,o=!1){function p(v,b){return async()=>{try{const{[v]:A}=await b();return{default:A}}catch(A){if(!o)throw A;return}}}return br(i[0])?p("default",i[0]):p(i[0],i[1])}function Zn(...i){let o=lr(i);return(p,v)=>{l(()=>Reflect.deleteProperty(p,v)),Reflect.defineProperty(p,v,{async get(){return Yn(o)}})}}function Rn(...i){const o=lr(i,!0);return(p,v)=>{l(()=>Reflect.deleteProperty(p,v)),Reflect.defineProperty(p,v,{async get(){return Xn(o)}})}}function xn(i={}){const{scopes:o,imports:p,deps:v,scope:b,...A}=i;return Vn(fr(A),cn({type:xt.MODULE,scope:Wt.SINGLETON,imports:p,deps:v,injectable:!1}))}function Oe(i){return(...o)=>{const p=St.from(...o),v=i(p,o);return typeof v=="function"&&v(...o),o[2]}}function Cr(i,o){return Oe(p=>{p.set(i,o)})}function _s(i=Wt.REQUEST){return Cr("scope",i)}function bt(i,o,p){_s(Wt.INSTANCE)(G(i)),sn(Ut)(i,o,p)}function ks(i){return o=>{Ht.get(i).useClass=o}}function jn(){return cn()}class tr extends Error{constructor(o,p){super(tr.buildMessage(o,p))}static buildMessage(o,p){const[v,b,A]=p,X=Tr(p),z=X.split("/")[0],je=z==="parameter"?".["+A+"]":"",Qe=b?"."+b:z==="parameter"?".constructor":"",He=Ze(G(v))+Qe+je;return`${o.name} cannot be used as ${X} decorator on ${He}`}}function ms(i){return(o,p,v)=>{switch(Tr([o,p,v])){case ct.PARAM_CTOR:St.from(o).merge(`${Ut}:${v}`,i);break;case ct.PROP:St.from(o,p).set(at,i);break;default:throw new tr(ms,[o,p,v])}}}function zt(i,o,p,v){const b={get(){return gt().settings.get(p,v)},set(A){gt().settings.set(p,A)},enumerable:!0,configurable:!0};l(()=>Reflect.deleteProperty(i,o)),l(()=>Reflect.defineProperty(i,o,b))}function ys(i,o){return(p,v)=>zt(p,v,i,o)}var rr=(i=>(i.METHOD="method",i.PROPERTY="property",i.CONSTANT="constant",i.VALUE="value",i.INTERCEPTOR="interceptor",i))(rr||{});function gs(i,o){return Object.freeze({get value(){return gt().settings.get(i,o)},set value(p){gt().settings.set(i,p)}})}const Qn=Symbol.for("LOGGER");S(Qn).factory(()=>gt().logger);function ie(i={},o={}){return Object.entries(o).reduce((p,[v,b])=>({...p,[v]:(p[v]||[]).concat(b)}),i)}function Ds(i,o={}){const p=St.from(i).get("configuration")||{};return{...p,...o,mount:ie(p.mount,o.mount)}}n.AutoInjectable=js,n.CONFIGURATION=hs,n.Configuration=fr,n.Constant=Jn,n.Container=Sn,n.Controller=an,n.ControllerProvider=ds,n.DIConfiguration=jr,n.DI_INJECTABLE_PROPS=$t,n.DI_INTERCEPTOR_OPTIONS=Vt,n.DI_INVOKE_OPTIONS=dt,n.DI_USE_OPTIONS=at,n.DI_USE_PARAM_OPTIONS=Ut,n.GlobalProviderRegistry=Pr,n.GlobalProviders=Ht,n.Inject=sn,n.Injectable=cn,n.InjectablePropertyType=rr,n.InjectionError=Gr,n.InjectorService=nn,n.Intercept=zn,n.Interceptor=pr,n.InvalidPropertyTokenError=ne,n.LOGGER=Qn,n.LazyInject=Zn,n.LocalsContainer=le,n.Module=xn,n.OptionalLazyInject=Rn,n.Opts=bt,n.OverrideProvider=ks,n.Provider=yt,n.ProviderScope=Wt,n.ProviderType=xt,n.Scope=_s,n.Service=jn,n.UseOpts=ms,n.Value=ys,n.bindConstant=on,n.bindIntercept=un,n.bindValue=zt,n.cleanAllLocalsContainer=er,n.colors=Un,n.configuration=Mn,n.constant=Vr,n.controller=y,n.createContainer=Ln,n.destroyInjector=xs,n.detachLocalsContainer=ur,n.discoverHooks=Re,n.getConfiguration=Ds,n.getConstructorDependencies=Kr,n.getInterceptorOptions=Hn,n.inject=Er,n.injectMany=Bt,n.injectable=S,n.injector=gt,n.interceptor=P,n.invokeOptions=Mt,n.lazyInject=Yn,n.localsContainer=Ve,n.mergeMount=ie,n.optionalLazyInject=Xn,n.providerBuilder=u,n.refValue=gs,n.registerProvider=An,n.setConstructorDependencies=Fn,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})})}(uo,uo.exports)),uo.exports}var Dr=Iu();function Nu(ve,ke={}){return Mr.useDecorators(Dr.Injectable({type:"ajv:formats"}),Mr.StoreSet("ajv:formats",{name:ve,options:ke}))}function $u(ve){return Mr.useDecorators(Dr.Injectable({type:"ajv:keyword"}),Mr.StoreSet("ajv:keyword",{...ve,metaSchema:ve.metaSchema&&ve.metaSchema.toJSON?ve.metaSchema.toJSON():ve.metaSchema}))}var fo={exports:{}},Uu=fo.exports,Ea;function Lu(){return Ea||(Ea=1,function(ve,ke){(function(n,Ee){Ee(ke)})(Uu,function(n){var Ee=P=>{throw TypeError(P)},tt=(P,y,l)=>y.has(P)||Ee("Cannot "+l),Me=(P,y,l)=>y.has(P)?Ee("Cannot add the same private member more than once"):y instanceof WeakSet?y.add(P):y.set(P,l),lt=(P,y,l)=>(tt(P,y,"access private method"),l),De,Z,rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Ks<"u"?Ks:typeof self<"u"?self:{};function me(P){return P&&P.__esModule&&Object.prototype.hasOwnProperty.call(P,"default")?P.default:P}var ht={exports:{}},Ye=ht.exports,nt;function Be(){return nt||(nt=1,function(P,y){(function(l,ne){ne(y)})(Ye,function(l){var ne=a=>{throw TypeError(a)},xe=(a,g,E)=>g.has(a)||ne("Cannot "+E),Te=(a,g,E)=>(xe(a,g,"read from private field"),E?E.call(a):g.get(a)),_e=(a,g,E)=>g.has(a)?ne("Cannot add the same private member more than once"):g instanceof WeakSet?g.add(a):g.set(a,E),Ve=(a,g,E,$)=>(xe(a,g,"write to private field"),g.set(a,E),E),Mt,ur,er,Er,Bt=(a=>(a.PARAM="parameter",a.PARAM_CTOR="parameter.constructor",a.PARAM_STC="parameter.static",a.PROP="property",a.PROP_STC="property.static",a.METHOD="method",a.METHOD_STC="method.static",a.CLASS="class",a))(Bt||{});function Jr(a){return a.prototype?a:a.constructor}function st(a){return Jr(a)}function Kn(a){const[g,E,$]=a,q=ge=>g!==st(g)?ge:`${ge}.static`;return typeof $=="number"?E?q("parameter"):"parameter.constructor":$&&$.value?q("method"):E&&$===void 0||$?q("property"):Bt.CLASS}function sn(a){return a===Date||a instanceof Date&&!isNaN(+a)}function fr(a){return typeof a=="function"}function Vr(a){return a==null}function on(a){return typeof a=="boolean"||a instanceof Boolean||a===Boolean}function Jn(a){return typeof a=="boolean"||a instanceof Boolean||a===Boolean}function Vn(a){return typeof a=="number"}function Wn(a){return typeof a=="number"||a instanceof Number||a===Number}function an(a){return typeof a=="string"}function cn(a){return typeof a=="string"||a instanceof String||a===String}function Cs(a){return cn(a)||Wn(a)||Jn(a)}function Hn(a){return an(a)||Vn(a)||on(a)}function un(a){return[String,Number,Boolean].includes(a)}function zn(a){return a instanceof RegExp}function pr(a){return typeof a=="symbol"}function Yn(a){return typeof a=="symbol"||a instanceof Symbol||a===Symbol}const Xn=a=>Vr(a)||Hn(a)||pr(a)||fr(a),lr=(a,g=new WeakMap)=>{if(Xn(a))return a;const E=g.get(a);if(E)return E;if(ArrayBuffer.isView(a))return Buffer.isBuffer(a)?Buffer.from(a):new(st(a))(a.buffer.slice(0),a.byteOffset,a.byteLength);if(sn(a))return new Date(a);if(zn(a))return new RegExp(a);if(Array.isArray(a)){const q=[];return g.set(a,q),a.forEach((ge,qe)=>q[qe]=lr(ge,g)),q}if(a instanceof Map){const q=new Map;return g.set(a,q),a.forEach((ge,qe)=>q.set(lr(qe,g),lr(ge,g))),q}if(a instanceof Set){const q=new Set;return g.set(a,q),a.forEach(ge=>q.add(lr(ge,g))),q}const $=Object.create(Reflect.getPrototypeOf(a));return g.set(a,$),Reflect.ownKeys(a).forEach(q=>{const ge=Object.getOwnPropertyDescriptor(a,q);ge&&(fr(ge.value)?Object.defineProperty($,q,ge):Object.defineProperty($,q,{...ge,value:lr(ge.value,g)}))}),$};function Zn(a){return a?st(a)!==Object?Object.create(a):{}:{}}function Rn(a){return["__proto__","constructor","prototype"].includes(a)}function xn(a){return Object.keys(a).filter(g=>!Rn(g))}function Oe(a){return(g,E,$)=>{const q=g.findIndex(ge=>a(ge,E));return q===-1?[...g,E]:(g[q]=jn(g[q],E,$),g)}}const Cr=Oe((a,g)=>a===g);function _s({reducers:a,parentKey:g}){return a?g&&a[g]?a[g]:a.default||Cr:Cr}function bt(a,g){return Hn(a)||pr(a)||fr(a)||g===void 0}function ks(a,g){return a==null||a===""&&g!==""}function jn(a,g,E={}){if(ks(g,a))return a;if(bt(g,a))return g;if(Array.isArray(a)){const q=_s(E);return[].concat(g).reduce((ge,qe)=>q(ge,qe,E),[...a])}const $=Zn(a);return[...xn(a),...xn(g)].reduce((q,ge)=>{var qe;const jt=a&&a[ge],vt=jn(jt,g&&g[ge],{...E,parentKey:ge});return E.cleanUndefinedProps&&vt===void 0||(q[ge]=((qe=E.alter)==null?void 0:qe.call(E,ge,vt))??vt),q},$)}function tr(a,g){return Reflect.getOwnPropertyDescriptor(a&&a.prototype||a,g)}function ms(a,g){var E;return(E=tr(a,g))==null?void 0:E.value}function zt(a){return typeof a=="function"?a.name:a.constructor.name}const ys=a=>a.toString().replace("Symbol(","").replace(")","");function rr(a){switch(typeof a){default:return""+a;case"symbol":return ys(a);case"function":return zt(a)}}var gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof rt<"u"?rt:typeof self<"u"?self:{},Qn={};/*! *****************************************************************************
23
+ Copyright (C) Microsoft. All rights reserved.
24
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
25
+ this file except in compliance with the License. You may obtain a copy of the
26
+ License at http://www.apache.org/licenses/LICENSE-2.0
27
+
28
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
29
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
30
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
31
+ MERCHANTABLITY OR NON-INFRINGEMENT.
32
+
33
+ See the Apache Version 2.0 License for specific language governing permissions
34
+ and limitations under the License.
35
+ ***************************************************************************** */var ie;function Ds(){if(ie)return Qn;ie=1;var a;return function(g){(function(E){var $=typeof globalThis=="object"?globalThis:typeof gs=="object"?gs:typeof self=="object"?self:typeof this=="object"?this:vt(),q=ge(g);typeof $.Reflect<"u"&&(q=ge($.Reflect,q)),E(q,$),typeof $.Reflect>"u"&&($.Reflect=g);function ge(fn,Cn){return function(ts,vs){Object.defineProperty(fn,ts,{configurable:!0,writable:!0,value:vs}),Cn&&Cn(ts,vs)}}function qe(){try{return Function("return this;")()}catch{}}function jt(){try{return(0,eval)("(function() { return this; })()")}catch{}}function vt(){return qe()||jt()}})(function(E,$){var q=Object.prototype.hasOwnProperty,ge=typeof Symbol=="function",qe=ge&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",jt=ge&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",vt=typeof Object.create=="function",fn={__proto__:[]}instanceof Array,Cn=!vt&&!fn,ts={create:vt?function(){return $s(Object.create(null))}:fn?function(){return $s({__proto__:null})}:function(){return $s({})},has:Cn?function(R,C){return q.call(R,C)}:function(R,C){return C in R},get:Cn?function(R,C){return q.call(R,C)?R[C]:void 0}:function(R,C){return R[C]}},vs=Object.getPrototypeOf(Function),zs=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ii(),So=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:ai(),bo=typeof WeakMap=="function"?WeakMap:ra(),Os=ge?Symbol.for("@reflect-metadata:registry"):void 0,eo=ea(),kr=ta(eo);function Ko(R,C,I,W){if(Ae(I)){if(!Qo(R))throw new TypeError;if(!ei(C))throw new TypeError;return Wi(R,C)}else{if(!Qo(R))throw new TypeError;if(!Ct(C))throw new TypeError;if(!Ct(W)&&!Ae(W)&&!Is(W))throw new TypeError;return Is(W)&&(W=void 0),I=pn(I),Hi(R,C,I,W)}}E("decorate",Ko);function Jo(R,C){function I(W,Se){if(!Ct(W))throw new TypeError;if(!Ae(Se)&&!Zi(Se))throw new TypeError;zo(R,C,W,Se)}return I}E("metadata",Jo);function Bi(R,C,I,W){if(!Ct(I))throw new TypeError;return Ae(W)||(W=pn(W)),zo(R,C,I,W)}E("defineMetadata",Bi);function Vo(R,C,I){if(!Ct(C))throw new TypeError;return Ae(I)||(I=pn(I)),Wo(R,C,I)}E("hasMetadata",Vo);function wo(R,C,I){if(!Ct(C))throw new TypeError;return Ae(I)||(I=pn(I)),To(R,C,I)}E("hasOwnMetadata",wo);function qi(R,C,I){if(!Ct(C))throw new TypeError;return Ae(I)||(I=pn(I)),Ho(R,C,I)}E("getMetadata",qi);function Gi(R,C,I){if(!Ct(C))throw new TypeError;return Ae(I)||(I=pn(I)),Ys(R,C,I)}E("getOwnMetadata",Gi);function Ki(R,C){if(!Ct(R))throw new TypeError;return Ae(C)||(C=pn(C)),Yo(R,C)}E("getMetadataKeys",Ki);function Ji(R,C){if(!Ct(R))throw new TypeError;return Ae(C)||(C=pn(C)),Po(R,C)}E("getOwnMetadataKeys",Ji);function Vi(R,C,I){if(!Ct(C))throw new TypeError;if(Ae(I)||(I=pn(I)),!Ct(C))throw new TypeError;Ae(I)||(I=pn(I));var W=Ns(C,I,!1);return Ae(W)?!1:W.OrdinaryDeleteMetadata(R,C,I)}E("deleteMetadata",Vi);function Wi(R,C){for(var I=R.length-1;I>=0;--I){var W=R[I],Se=W(C);if(!Ae(Se)&&!Is(Se)){if(!ei(Se))throw new TypeError;C=Se}}return C}function Hi(R,C,I,W){for(var Se=R.length-1;Se>=0;--Se){var It=R[Se],At=It(C,I,W);if(!Ae(At)&&!Is(At)){if(!Ct(At))throw new TypeError;W=At}}return W}function Wo(R,C,I){var W=To(R,C,I);if(W)return!0;var Se=Ao(C);return Is(Se)?!1:Wo(R,Se,I)}function To(R,C,I){var W=Ns(C,I,!1);return Ae(W)?!1:Zo(W.OrdinaryHasOwnMetadata(R,C,I))}function Ho(R,C,I){var W=To(R,C,I);if(W)return Ys(R,C,I);var Se=Ao(C);if(!Is(Se))return Ho(R,Se,I)}function Ys(R,C,I){var W=Ns(C,I,!1);if(!Ae(W))return W.OrdinaryGetOwnMetadata(R,C,I)}function zo(R,C,I,W){var Se=Ns(I,W,!0);Se.OrdinaryDefineOwnMetadata(R,C,I,W)}function Yo(R,C){var I=Po(R,C),W=Ao(R);if(W===null)return I;var Se=Yo(W,C);if(Se.length<=0)return I;if(I.length<=0)return Se;for(var It=new So,At=[],Ne=0,ee=I;Ne<ee.length;Ne++){var se=ee[Ne],ue=It.has(se);ue||(It.add(se),At.push(se))}for(var pe=0,Fe=Se;pe<Fe.length;pe++){var se=Fe[pe],ue=It.has(se);ue||(It.add(se),At.push(se))}return At}function Po(R,C){var I=Ns(R,C,!1);return I?I.OrdinaryOwnMetadataKeys(R,C):[]}function Xo(R){if(R===null)return 1;switch(typeof R){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return R===null?1:6;default:return 6}}function Ae(R){return R===void 0}function Is(R){return R===null}function Eo(R){return typeof R=="symbol"}function Ct(R){return typeof R=="object"?R!==null:typeof R=="function"}function zi(R,C){switch(Xo(R)){case 0:return R;case 1:return R;case 2:return R;case 3:return R;case 4:return R;case 5:return R}var I="string",W=ti(R,qe);if(W!==void 0){var Se=W.call(R,I);if(Ct(Se))throw new TypeError;return Se}return Yi(R)}function Yi(R,C){var I,W;{var Se=R.toString;if(to(Se)){var W=Se.call(R);if(!Ct(W))return W}var I=R.valueOf;if(to(I)){var W=I.call(R);if(!Ct(W))return W}}throw new TypeError}function Zo(R){return!!R}function Xi(R){return""+R}function pn(R){var C=zi(R);return Eo(C)?C:Xi(C)}function Qo(R){return Array.isArray?Array.isArray(R):R instanceof Object?R instanceof Array:Object.prototype.toString.call(R)==="[object Array]"}function to(R){return typeof R=="function"}function ei(R){return typeof R=="function"}function Zi(R){switch(Xo(R)){case 3:return!0;case 4:return!0;default:return!1}}function Mo(R,C){return R===C||R!==R&&C!==C}function ti(R,C){var I=R[C];if(I!=null){if(!to(I))throw new TypeError;return I}}function ri(R){var C=ti(R,jt);if(!to(C))throw new TypeError;var I=C.call(R);if(!Ct(I))throw new TypeError;return I}function ni(R){return R.value}function si(R){var C=R.next();return C.done?!1:C}function oi(R){var C=R.return;C&&C.call(R)}function Ao(R){var C=Object.getPrototypeOf(R);if(typeof R!="function"||R===vs||C!==vs)return C;var I=R.prototype,W=I&&Object.getPrototypeOf(I);if(W==null||W===Object.prototype)return C;var Se=W.constructor;return typeof Se!="function"||Se===R?C:Se}function Qi(){var R;!Ae(Os)&&typeof $.Reflect<"u"&&!(Os in $.Reflect)&&typeof $.Reflect.defineMetadata=="function"&&(R=ro($.Reflect));var C,I,W,Se=new bo,It={registerProvider:At,getProvider:ee,setProvider:ue};return It;function At(pe){if(!Object.isExtensible(It))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case R===pe:break;case Ae(C):C=pe;break;case C===pe:break;case Ae(I):I=pe;break;case I===pe:break;default:W===void 0&&(W=new So),W.add(pe);break}}function Ne(pe,Fe){if(!Ae(C)){if(C.isProviderFor(pe,Fe))return C;if(!Ae(I)){if(I.isProviderFor(pe,Fe))return C;if(!Ae(W))for(var pt=ri(W);;){var Tt=si(pt);if(!Tt)return;var Wr=ni(Tt);if(Wr.isProviderFor(pe,Fe))return oi(pt),Wr}}}if(!Ae(R)&&R.isProviderFor(pe,Fe))return R}function ee(pe,Fe){var pt=Se.get(pe),Tt;return Ae(pt)||(Tt=pt.get(Fe)),Ae(Tt)&&(Tt=Ne(pe,Fe),Ae(Tt)||(Ae(pt)&&(pt=new zs,Se.set(pe,pt)),pt.set(Fe,Tt))),Tt}function se(pe){if(Ae(pe))throw new TypeError;return C===pe||I===pe||!Ae(W)&&W.has(pe)}function ue(pe,Fe,pt){if(!se(pt))throw new Error("Metadata provider not registered.");var Tt=ee(pe,Fe);if(Tt!==pt){if(!Ae(Tt))return!1;var Wr=Se.get(pe);Ae(Wr)&&(Wr=new zs,Se.set(pe,Wr)),Wr.set(Fe,pt)}return!0}}function ea(){var R;return!Ae(Os)&&Ct($.Reflect)&&Object.isExtensible($.Reflect)&&(R=$.Reflect[Os]),Ae(R)&&(R=Qi()),!Ae(Os)&&Ct($.Reflect)&&Object.isExtensible($.Reflect)&&Object.defineProperty($.Reflect,Os,{enumerable:!1,configurable:!1,writable:!1,value:R}),R}function ta(R){var C=new bo,I={isProviderFor:function(se,ue){var pe=C.get(se);return Ae(pe)?!1:pe.has(ue)},OrdinaryDefineOwnMetadata:At,OrdinaryHasOwnMetadata:Se,OrdinaryGetOwnMetadata:It,OrdinaryOwnMetadataKeys:Ne,OrdinaryDeleteMetadata:ee};return eo.registerProvider(I),I;function W(se,ue,pe){var Fe=C.get(se),pt=!1;if(Ae(Fe)){if(!pe)return;Fe=new zs,C.set(se,Fe),pt=!0}var Tt=Fe.get(ue);if(Ae(Tt)){if(!pe)return;if(Tt=new zs,Fe.set(ue,Tt),!R.setProvider(se,ue,I))throw Fe.delete(ue),pt&&C.delete(se),new Error("Wrong provider for target.")}return Tt}function Se(se,ue,pe){var Fe=W(ue,pe,!1);return Ae(Fe)?!1:Zo(Fe.has(se))}function It(se,ue,pe){var Fe=W(ue,pe,!1);if(!Ae(Fe))return Fe.get(se)}function At(se,ue,pe,Fe){var pt=W(pe,Fe,!0);pt.set(se,ue)}function Ne(se,ue){var pe=[],Fe=W(se,ue,!1);if(Ae(Fe))return pe;for(var pt=Fe.keys(),Tt=ri(pt),Wr=0;;){var no=si(Tt);if(!no)return pe.length=Wr,pe;var ci=ni(no);try{pe[Wr]=ci}catch(ui){try{oi(Tt)}finally{throw ui}}Wr++}}function ee(se,ue,pe){var Fe=W(ue,pe,!1);if(Ae(Fe)||!Fe.delete(se))return!1;if(Fe.size===0){var pt=C.get(ue);Ae(pt)||(pt.delete(pe),pt.size===0&&C.delete(pt))}return!0}}function ro(R){var C=R.defineMetadata,I=R.hasOwnMetadata,W=R.getOwnMetadata,Se=R.getOwnMetadataKeys,It=R.deleteMetadata,At=new bo,Ne={isProviderFor:function(ee,se){var ue=At.get(ee);return!Ae(ue)&&ue.has(se)?!0:Se(ee,se).length?(Ae(ue)&&(ue=new So,At.set(ee,ue)),ue.add(se),!0):!1},OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:I,OrdinaryGetOwnMetadata:W,OrdinaryOwnMetadataKeys:Se,OrdinaryDeleteMetadata:It};return Ne}function Ns(R,C,I){var W=eo.getProvider(R,C);if(!Ae(W))return W;if(I){if(eo.setProvider(R,C,kr))return kr;throw new Error("Illegal state.")}}function ii(){var R={},C=[],I=function(){function Ne(ee,se,ue){this._index=0,this._keys=ee,this._values=se,this._selector=ue}return Ne.prototype["@@iterator"]=function(){return this},Ne.prototype[jt]=function(){return this},Ne.prototype.next=function(){var ee=this._index;if(ee>=0&&ee<this._keys.length){var se=this._selector(this._keys[ee],this._values[ee]);return ee+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:se,done:!1}}return{value:void 0,done:!0}},Ne.prototype.throw=function(ee){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),ee},Ne.prototype.return=function(ee){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:ee,done:!0}},Ne}(),W=function(){function Ne(){this._keys=[],this._values=[],this._cacheKey=R,this._cacheIndex=-2}return Object.defineProperty(Ne.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ne.prototype.has=function(ee){return this._find(ee,!1)>=0},Ne.prototype.get=function(ee){var se=this._find(ee,!1);return se>=0?this._values[se]:void 0},Ne.prototype.set=function(ee,se){var ue=this._find(ee,!0);return this._values[ue]=se,this},Ne.prototype.delete=function(ee){var se=this._find(ee,!1);if(se>=0){for(var ue=this._keys.length,pe=se+1;pe<ue;pe++)this._keys[pe-1]=this._keys[pe],this._values[pe-1]=this._values[pe];return this._keys.length--,this._values.length--,Mo(ee,this._cacheKey)&&(this._cacheKey=R,this._cacheIndex=-2),!0}return!1},Ne.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=R,this._cacheIndex=-2},Ne.prototype.keys=function(){return new I(this._keys,this._values,Se)},Ne.prototype.values=function(){return new I(this._keys,this._values,It)},Ne.prototype.entries=function(){return new I(this._keys,this._values,At)},Ne.prototype["@@iterator"]=function(){return this.entries()},Ne.prototype[jt]=function(){return this.entries()},Ne.prototype._find=function(ee,se){if(!Mo(this._cacheKey,ee)){this._cacheIndex=-1;for(var ue=0;ue<this._keys.length;ue++)if(Mo(this._keys[ue],ee)){this._cacheIndex=ue;break}}return this._cacheIndex<0&&se&&(this._cacheIndex=this._keys.length,this._keys.push(ee),this._values.push(void 0)),this._cacheIndex},Ne}();return W;function Se(Ne,ee){return Ne}function It(Ne,ee){return ee}function At(Ne,ee){return[Ne,ee]}}function ai(){var R=function(){function C(){this._map=new zs}return Object.defineProperty(C.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),C.prototype.has=function(I){return this._map.has(I)},C.prototype.add=function(I){return this._map.set(I,I),this},C.prototype.delete=function(I){return this._map.delete(I)},C.prototype.clear=function(){this._map.clear()},C.prototype.keys=function(){return this._map.keys()},C.prototype.values=function(){return this._map.keys()},C.prototype.entries=function(){return this._map.entries()},C.prototype["@@iterator"]=function(){return this.keys()},C.prototype[jt]=function(){return this.keys()},C}();return R}function ra(){var R=16,C=ts.create(),I=W();return function(){function ee(){this._key=W()}return ee.prototype.has=function(se){var ue=Se(se,!1);return ue!==void 0?ts.has(ue,this._key):!1},ee.prototype.get=function(se){var ue=Se(se,!1);return ue!==void 0?ts.get(ue,this._key):void 0},ee.prototype.set=function(se,ue){var pe=Se(se,!0);return pe[this._key]=ue,this},ee.prototype.delete=function(se){var ue=Se(se,!1);return ue!==void 0?delete ue[this._key]:!1},ee.prototype.clear=function(){this._key=W()},ee}();function W(){var ee;do ee="@@WeakMap@@"+Ne();while(ts.has(C,ee));return C[ee]=!0,ee}function Se(ee,se){if(!q.call(ee,I)){if(!se)return;Object.defineProperty(ee,I,{value:ts.create()})}return ee[I]}function It(ee,se){for(var ue=0;ue<se;++ue)ee[ue]=Math.random()*255|0;return ee}function At(ee){if(typeof Uint8Array=="function"){var se=new Uint8Array(ee);return typeof crypto<"u"?crypto.getRandomValues(se):typeof msCrypto<"u"?msCrypto.getRandomValues(se):It(se,ee),se}return It(new Array(ee),ee)}function Ne(){var ee=At(R);ee[6]=ee[6]&79|64,ee[8]=ee[8]&191|128;for(var se="",ue=0;ue<R;++ue){var pe=ee[ue];(ue===4||ue===6||ue===8)&&(se+="-"),pe<16&&(se+="0"),se+=pe.toString(16).toLowerCase()}return se}}function $s(R){return R.__=void 0,delete R.__,R}})}(a||(a={})),Qn}Ds();const i="design:paramtypes",o="design:type",p="design:returntype",v=new Map,b=class{static get(a,g,E){return Reflect.getMetadata(a,st(g),E)}static getOwn(a,g,E){return Reflect.getOwnMetadata(a,st(g),E)}static getType(a,g){return Reflect.getMetadata(o,a,g)}static getOwnType(a,g){return Reflect.getMetadata(o,a,g)}static getReturnType(a,g){return Reflect.getMetadata(p,a,g)}static getOwnReturnType(a,g){return Reflect.getOwnMetadata(p,a,g)}static has(a,g,E){try{return Reflect.hasMetadata(a,st(g),E)}catch{}return!1}static hasOwn(a,g,E){return Reflect.hasOwnMetadata(a,st(g),E)}static delete(a,g,E){return Reflect.deleteMetadata(a,st(g),E)}static setParamTypes(a,g,E){return this.set(i,E,a.prototype,g)}static set(a,g,E,$){const q=v.has(a)?v.get(a)||[]:[],ge=st(E);q.indexOf(ge)===-1&&(q.push(ge),v.set(a,q)),Reflect.defineMetadata(a,g,st(E),$)}static getParamTypes(a,g){return Reflect.getMetadata(i,a,g)||[]}static getOwnParamTypes(a,g){return Reflect.getOwnMetadata(i,a,g)||[]}};b.getTargetsFromPropertyKey=a=>v.has(a)?v.get(a)||[]:[];let A=b;const X="tsed:class:store",z="tsed:method:store",je="tsed:property:store",Qe="tsed:param:store",He=new Map;function qt(a,...g){if(pr(g[0]))return He.has(g[0])||He.set(g[0],new ut),He.get(g[0]);{const E=A;return E.hasOwn(a,...g)||E.set(a,new ut,...g),E.getOwn(a,...g)}}function _r(a){const[g,E,$]=a;switch(Kn(a)){case Bt.PARAM_CTOR:case Bt.PARAM_STC:case Bt.PARAM:const q=qt(Qe,g,E);return q.has(""+$)||q.set(""+$,new ut),q.get(""+$);case Bt.PROP:case Bt.PROP_STC:return qt(je,g,E);case Bt.METHOD:case Bt.METHOD_STC:return qt(z,g,E);case Bt.CLASS:return qt(X,g)}}class ut{constructor(){this._entries=new Map}static from(...g){return _r(g)}static fromMethod(g,E){return ut.from(g,E,tr(g,E))}static mergeStoreFrom(g,E,...$){const q=ut.from(g,...$);return ut.from(E,...$)._entries.forEach((ge,qe)=>{q.merge(qe,ge)}),q}static mergeStoreMethodFrom(g,E,$){return this.mergeStoreFrom(g,E,$,tr(g,$))}get(g,E){return this._entries.get(rr(g))||E}has(g){return this._entries.has(rr(g))}set(g,E){return this._entries.set(rr(g),E),this}delete(g){return this._entries.delete(rr(g))}merge(g,E,$=!1){let q=this.get(g);return q&&(E=lr(E),q=lr(q),E=$?jn(E,q):jn(q,E)),this.set(g,E),this}toJson(){return[...this._entries.entries()].reduce((g,[E,$])=>({...g,[E]:$}),{})}}function T(a){return(...g)=>{const E=ut.from(...g),$=a(E,g);return typeof $=="function"&&$(...g),g[2]}}function j(a,g){return T(E=>{E.merge(a,g)})}function D(a,g){return T(E=>{E.set(a,g)})}class K extends Error{constructor(g,E){super(K.buildMessage(g,E))}static buildMessage(g,E){const[$,q,ge]=E,qe=Kn(E),jt=qe.split("/")[0],vt=jt==="parameter"?".["+ge+"]":"",fn=q?"."+q:jt==="parameter"?".constructor":"",Cn=rr(st($))+fn+vt;return`${g.name} cannot be used as ${qe} decorator on ${Cn}`}}var Q=(a=>(a.PROD="production",a.DEV="development",a.TEST="test",a))(Q||{});const ye=Q,he=Function;rt.Type=he;function oe(a){return a&&Object.getPrototypeOf(a)}function L(a){return oe(a)}function B(a){const g=[];let E=st(a);for(;E&&rr(E)!=="";)g.unshift(E),E=L(E);return g}function H(a){return typeof a=="object"}function ae(a){return!!a&&typeof a.lift=="function"&&typeof a.subscribe=="function"}function Ie(a){return a===Promise||a instanceof Promise||!!a&&typeof a.subscribe!="function"&&typeof a.then=="function"}function Xe(a){return a!==null&&typeof a=="object"&&typeof a.pipe=="function"}function wt(a){return H(a)&&"data"in a&&"headers"in a&&"status"in a&&"statusText"in a}var nr=(a=>(a.PENDING="PENDING",a.CANCELED="CANCELED",a.RESOLVED="RESOLVED",a.REJECTED="REJECTED",a))(nr||{}),Js=(a=>(a.STREAM="STREAM",a.BUFFER="BUFFER",a.DATA="DATA",a))(Js||{});class lo{constructor({hasNextFunction:g=!1}={}){_e(this,Mt),_e(this,ur),_e(this,er),_e(this,Er),this.status="PENDING",Ve(this,er,!1),Ve(this,er,g),Ve(this,Er,new Promise((E,$)=>{Ve(this,Mt,E),Ve(this,ur,$)}))}isDone(){return this.status!=="PENDING"}get next(){return Ve(this,er,!0),g=>{if(!this.isDone())return g?this.reject(g):this.resolve({type:"DATA"})}}call(g){if(this.isDone())return Promise.resolve(this);try{this.handle(g())}catch(E){this.reject(E)}return Te(this,Er)}reject(g){this.isDone()||(this.done("REJECTED"),Te(this,ur).call(this,g))}resolve(g={}){this.isDone()||(this.done("RESOLVED"),Te(this,Mt).call(this,{...g,state:"RESOLVED"}))}destroy(){}cancel(){if(!this.isDone())return this.done("CANCELED"),Te(this,Mt).call(this,{state:"CANCELED"})}done(g){this.destroy(),this.status=g}handle(g,E={}){if(!this.isDone()){if(g){if(this.isCanceledResponse(g))return this.cancel();if(ae(g)&&(g=g.toPromise()),wt(g))return this.handle(g.data,{...E,status:g.status,headers:g.headers});if(Xe(g))return this.resolve({...E,type:"STREAM",data:g});if(Xe(g)||Buffer.isBuffer(g))return this.resolve({...E,type:"BUFFER",data:g});if(Ie(g))return g.then($=>this.handle($,E)).catch($=>$.response&&wt($.response)?this.handle($.response):this.reject($))}if(!Te(this,er))return this.resolve({...E,data:g,type:"DATA"})}}isCanceledResponse(g){return g==="CANCELED"}}Mt=new WeakMap,ur=new WeakMap,er=new WeakMap,Er=new WeakMap;function Vs(a){try{a()}catch(g){return g}}async function bi(a){try{await a()}catch(g){return g}}function wi(a,g=[]){return Object.entries(a).reduce((E,[$,q])=>(Rn($)||g.includes($)||q===void 0||(E[$]=q),E),{})}function hr(a){return typeof a=="function"?a:a.constructor}function es(a){return hr(a)}function Ws(a){return st(a)===a?a.prototype:a}function Io(a){const g=new Map;return a=st(a),B(a).forEach(E=>{Reflect.ownKeys(Ws(E)).forEach($=>{var q;pr($)||$==="constructor"||(q=Object.getOwnPropertyDescriptor(Ws(E),$))!=null&&q.get||g.set($,{target:E,propertyKey:$})})}),Array.from(g.values())}function Ti(a,g){Io(a).forEach(({target:E,propertyKey:$})=>{const q=Ws(a);E!==st(a)&&(Object.defineProperty(q,$,{writable:!0,configurable:!0,value(...jt){return Ws(E)[$].apply(this,jt)}}),ut.mergeStoreMethodFrom(a,E,$));let ge=tr(a,$);const qe=g(q,$,ge)||ge;qe&&Object.defineProperty(q,$,qe)})}function Pi(a,g){return[a,g,tr(a,g)]}function ho(a){return Array.isArray(a)}function mo(a){return a===Array||ho(a)}function No(a){return a&&fr(a)&&!a.prototype}function yo(a){return a&&"isBuffer"in a&&typeof a.isBuffer=="function"?!0:Zs(a)}function Zs(a){return!!(a&&(a===Uint8Array||a instanceof Uint8Array))}function go(a){return a===Object}function vo(a){return go(st(a))&&a!==Object}function $o(a){return!a||No(a)?!1:!(pr(a)||Cs(a)||go(a)||sn(a)||Ie(a)||mo(a)||yo(a))}function Ei(a){return $o(a)?st(a):a}function Uo(a){return`${(es(a).toString().split(`
36
+ `).find(g=>g.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function Mi(a){return Uo(a).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(g=>g.trim())}function Ai(){return`e${Math.random().toString(36).substring(7)}`}const Ri=a=>{const[g,E,$,q="."]=a;return H(E)||an(g)?{expression:g,scope:E,defaultValue:$,separator:q}:{expression:E,scope:g,defaultValue:$,separator:q}};function xi(...a){const g=Ri(a);let E=g.scope;const{expression:$,defaultValue:q,separator:ge}=g;if(!$)return E;if(!E)return q;const qe=$.split(ge),jt=vt=>{if(E){if(E[vt]!==void 0||H(E)&&vt in E)return E[vt];if(fr(E.get))return E.get(vt)}};for(;(E=jt(qe.shift()))&&qe.length;);return E===void 0?q:E}function Oo(a){return a&&typeof a.toJSON=="function"}function ji(a,g){let E="0.0.0.0",$=g;return typeof g=="string"&&g.indexOf(":")>-1&&([E,$]=g.split(":"),$=+$),{protocol:a,address:E,port:$,toString(){return[`${this.protocol}://${this.address}`,typeof this.port=="number"&&this.port].filter(Boolean).join(":")}}}function Lo(a,g){for(const E of B(a)){const $=Object.getOwnPropertyDescriptor(E&&E.prototype||E,g);if($)return $}}function Fo(a){return mo(a)||a===Map||a instanceof Map||a===Set||a instanceof Set||a===WeakMap||a instanceof WeakMap||a===WeakSet||a instanceof WeakSet}function Ci(a){return a===""||Vr(a)}function _i(a,g){const E=st(a);if(E){const $=Lo(E,g);if($)return $.enumerable}return Object.prototype.propertyIsEnumerable.call(a,g)}function Bo(a,g,E=5){if(!a||!g)return!1;for(a=st(a),g=st(g);rr(a)!=="";){if(!E)return!1;if(a===g)return!0;a=oe(a),E--}return!1}function ki(a){return!!(a&&a!=null&&a._isAMomentObject)}function qo(a){return a&&a._bsontype}function Di(a){return!!(Oo(a)&&a.$isMongooseModelPrototype||qo(a))}function Ii(a){return!(Buffer.isBuffer(a)||Xe(a)||on(a)||Vn(a)||an(a)||Vr(a))}function Ni(a){return cn(a)?"string":Wn(a)?"number":Jn(a)?"boolean":"any"}function $i(a,g,E,$="."){const q=g.split($),ge=(qe,jt)=>Rn(qe)?!1:jt?(typeof a.set=="function"?a.set(qe,E):a[qe]=E,!1):(typeof a.set=="function"?(a.has(qe)||a.set(qe,{}),a=a.get(qe)):a=a[qe]=a[qe]||{},!0);for(;ge(q.shift(),!q.length););}function Go(a){return a?an(a)?g=>g[a]:a:(g,E)=>String(E)}function Dt(a,g){if(ho(a)){const $=Go(g||"id");return a.reduce((q,ge,qe)=>([].concat($(ge,qe)).forEach(jt=>{var vt;const fn=q.get(jt);ge=((vt=fn==null?void 0:fn.merge)==null?void 0:vt.call(fn,ge))||ge,q.set(jt,ge)}),q),new Map)}const E=Go(g);return Object.entries(a).reduce(($,[q,ge])=>$.set(E(ge,q),ge),new Map)}function Qs(a){return Array.from(new Set(a).values())}function Ui(a,g="id"){const E=new Map;return a.forEach($=>{E.set($[g],$)}),Array.from(E.values())}function Li(...a){return(...g)=>{const E=typeof g[2]=="object";if(a.filter($=>!!$).forEach($=>{const q=$(...g);E&&typeof q=="object"&&(g[2]=q)}),E)return g[2]}}function Fi(a){return(g,E)=>a(g,E,tr(g,E))}function Hs(...a){return(g,E)=>{a.filter(Boolean).forEach($=>$(g,E,tr(g,E)))}}l.AnyToPromise=lo,l.AnyToPromiseResponseTypes=Js,l.AnyToPromiseStatus=nr,l.CLASS_STORE=X,l.DecoratorTypes=Bt,l.Env=Q,l.EnvTypes=ye,l.METHOD_STORE=z,l.Metadata=A,l.PARAM_STORE=Qe,l.PROPERTY_STORE=je,l.Store=ut,l.StoreFn=T,l.StoreMerge=j,l.StoreSet=D,l.Type=he,l.UnsupportedDecoratorType=K,l.ancestorOf=oe,l.ancestorsOf=B,l.catchAsyncError=bi,l.catchError=Vs,l.classOf=st,l.cleanObject=wi,l.constructorOf=es,l.createInstance=Zn,l.decorateMethodsOf=Ti,l.decoratorArgs=Pi,l.decoratorTypeOf=Kn,l.deepClone=lr,l.deepMerge=jn,l.descriptorOf=tr,l.getClass=Jr,l.getClassOrSymbol=Ei,l.getConstructor=hr,l.getConstructorArgNames=Mi,l.getHostInfoFromPort=ji,l.getInheritedClass=L,l.getRandomId=Ai,l.getValue=xi,l.hasJsonMethod=Oo,l.inheritedDescriptorOf=Lo,l.isArray=ho,l.isArrayOrArrayClass=mo,l.isArrowFn=No,l.isBoolean=on,l.isBooleanOrBooleanClass=Jn,l.isBuffer=yo,l.isClass=$o,l.isClassObject=go,l.isCollection=Fo,l.isDate=sn,l.isEmpty=Ci,l.isEnumerable=_i,l.isFunction=fr,l.isInheritedFrom=Bo,l.isMethodDescriptor=ms,l.isMomentObject=ki,l.isMongooseObject=Di,l.isNil=Vr,l.isNumber=Vn,l.isNumberOrNumberClass=Wn,l.isObject=H,l.isObjectID=qo,l.isObservable=ae,l.isPlainObject=vo,l.isPrimitive=Hn,l.isPrimitiveClass=un,l.isPrimitiveOrPrimitiveClass=Cs,l.isPromise=Ie,l.isProtectedKey=Rn,l.isRegExp=zn,l.isSerializable=Ii,l.isStream=Xe,l.isString=an,l.isStringOrStringClass=cn,l.isSymbol=pr,l.isSymbolOrSymbolClass=Yn,l.isUint8Array=Zs,l.mergeReducerBuilder=Oe,l.methodsOf=Io,l.nameOf=rr,l.nameOfClass=zt,l.nameOfSymbol=ys,l.objectKeys=xn,l.primitiveOf=Ni,l.prototypeOf=Ws,l.setValue=$i,l.toMap=Dt,l.toStringConstructor=Uo,l.uniq=Qs,l.uniqBy=Ui,l.useDecorators=Li,l.useMethodDecorator=Fi,l.useMethodDecorators=Hs,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})})}(ht,ht.exports)),ht.exports}var dt=Be();const $t=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),at=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Ut=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),Vt=/[^\p{L}\d]+/giu,Lt="$1\0$2",ir="";function Zt(P){let y=P.trim();y=y.replace($t,Lt).replace(at,Lt),y=y.replace(Vt,"\0");let l=0,ne=y.length;for(;y.charAt(l)==="\0";)l++;if(l===ne)return[];for(;y.charAt(ne-1)==="\0";)ne--;return y.slice(l,ne).split(/\0/g)}function $e(P){const y=Zt(P);for(let l=0;l<y.length;l++){const ne=y[l],xe=Ut.exec(ne);if(xe){const Te=xe.index+(xe[1]??xe[2]).length;y.splice(l,1,ne.slice(0,Te),ne.slice(Te))}}return y}function ln(P,y){const[l,ne,xe]=mt(P,y);return l+ne.map(bs(void 0)).join("_")+xe}function bs(P){return P===!1?y=>y.toUpperCase():y=>y.toLocaleUpperCase(P)}function mt(P,y={}){const l=y.split??(y.separateNumbers?$e:Zt),ne=y.prefixCharacters??ir,xe=y.suffixCharacters??ir;let Te=0,_e=P.length;for(;Te<P.length;){const Ve=P.charAt(Te);if(!ne.includes(Ve))break;Te++}for(;_e>Te;){const Ve=_e-1,Mt=P.charAt(Ve);if(!xe.includes(Mt))break;_e=Ve}return[P.slice(0,Te),l(P.slice(Te,_e)),P.slice(_e)]}const le={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",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",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:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
37
+ * statuses
38
+ * Copyright(c) 2014 Jonathan Ong
39
+ * Copyright(c) 2016 Douglas Christopher Wilson
40
+ * MIT Licensed
41
+ */var hn,G;function kn(){if(G)return hn;G=1;var P=le;hn=Te,Te.message=P,Te.code=y(P),Te.codes=l(P),Te.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},Te.empty={204:!0,205:!0,304:!0},Te.retry={502:!0,503:!0,504:!0};function y(_e){var Ve={};return Object.keys(_e).forEach(function(Mt){var ur=_e[Mt],er=Number(Mt);Ve[ur.toLowerCase()]=er}),Ve}function l(_e){return Object.keys(_e).map(function(Ve){return Number(Ve)})}function ne(_e){var Ve=_e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Te.code,Ve))throw new Error('invalid status message: "'+_e+'"');return Te.code[Ve]}function xe(_e){if(!Object.prototype.hasOwnProperty.call(Te.message,_e))throw new Error("invalid status code: "+_e);return Te.message[_e]}function Te(_e){if(typeof _e=="number")return xe(_e);if(typeof _e!="string")throw new TypeError("code must be a number or string");var Ve=parseInt(_e,10);return isNaN(Ve)?ne(_e):xe(Ve)}return hn}var br=kn();const dr=me(br);class ar extends Error{constructor(y=500,l="",ne){super(l),Me(this,De),this.name="HTTP_EXCEPTION",this.type="HTTP_EXCEPTION",this.headers={},this.status=y,this.message=l,this.name=lt(this,De,Z).call(this),this.setOrigin(ne),Error.captureStackTrace(this)}static validate(y,l){if(y<100||y>=600)throw new Error("Status must be between 100 and 599");if(y.toString()[0]!==l.charAt(0))throw new Error(`Status ${y} does not belong to the family ${l}`);return y}setHeaders(y){return this.headers={...this.headers,...y},this}setHeader(y,l){return this.headers[y]=l,this}setOrigin(y){y&&(y instanceof Error?(this.origin=y,this.message=`${this.message}, innerException: ${this.origin.message}`.trim()):typeof y=="string"?(this.origin=new Error(y),this.message=`${this.message}, innerException: ${this.origin.message}`.trim()):this.body=y)}toString(){return`${this.name}(${this.status}): ${this.message} `.trim()}}De=new WeakSet,Z=function(){try{return this.status===200?"SUCCESS":ln(String(dr(this.status)))}catch{return ln(dt.nameOf(dt.classOf(this)))}};class Ir extends ar{}var Nr=(P=>(P["3xx"]="3xx",P["4xx"]="4xx",P["5xx"]="5xx",P))(Nr||{});class Je extends ar{constructor(y,l,ne){super(ar.validate(y,Nr["4xx"]),l,ne)}}const zr=class Nc extends Je{constructor(y,l){super(Nc.STATUS,y,l),this.name="BAD_MAPPING"}};zr.STATUS=421;let d=zr;const Ar=class $c extends Je{constructor(y,l){super($c.STATUS,y,l)}};Ar.STATUS=400;let Le=Ar;const mr=class Uc extends Je{constructor(y,l){super(Uc.STATUS,y,l)}};mr.STATUS=409;let _t=mr;const ws=class Lc extends Je{constructor(y,l){super(Lc.STATUS,y,l)}};ws.STATUS=417;let cr=ws;const is=class Fc extends Je{constructor(y,l){super(Fc.STATUS,y,l)}};is.STATUS=403;let wr=is;const $r=class Bc extends Je{constructor(y,l){super(Bc.STATUS,y,l)}};$r.STATUS=410;let as=$r;const dn=class qc extends Je{constructor(y,l){super(qc.STATUS,y,l),this.name="IM_A_TEAPOT"}};dn.STATUS=418;let yr=dn;const mn=class Gc extends Je{constructor(y,l){super(Gc.STATUS,y,l)}};mn.STATUS=411;let cs=mn;const gr=class Kc extends Je{constructor(y,l){super(Kc.STATUS,y,l)}};gr.STATUS=405;let Ur=gr;const Lr=class Jc extends Je{constructor(y,l){super(Jc.STATUS,y,l)}};Lr.STATUS=421;let Qt=Lr;const us=class Vc extends Je{constructor(y,l="You must accept content-type "+y){super(Vc.STATUS,l)}};us.STATUS=406;let Et=us;const Yr=class Wc extends Je{constructor(y,l){super(Wc.STATUS,y,l)}};Yr.STATUS=404;let yn=Yr;const Xr=class Hc extends Je{constructor(y,l){super(Hc.STATUS,y,l)}};Xr.STATUS=402;let Ft=Xr;const Dn=class zc extends Je{constructor(y,l){super(zc.STATUS,y,l)}};Dn.STATUS=412;let Ze=Dn;const Zr=class Yc extends Je{constructor(y,l){super(Yc.STATUS,y,l)}};Zr.STATUS=428;let gn=Zr;const Fr=class Xc extends Je{constructor(y,l){super(Xc.STATUS,y,l)}};Fr.STATUS=407;let ct=Fr;const Tr=class Zc extends Je{constructor(y,l){super(Zc.STATUS,y,l)}};Tr.STATUS=413;let fs=Tr;const kt=class Qc extends Je{constructor(y,l){super(Qc.STATUS,y,l)}};kt.STATUS=431;let Qr=kt;const en=class eu extends Je{constructor(y,l){super(eu.STATUS,y,l)}};en.STATUS=416;let vr=en;const tn=class tu extends Je{constructor(y,l){super(tu.STATUS,y,l)}};tn.STATUS=408;let Rr=tn;const In=class ru extends Je{constructor(y,l){super(ru.STATUS,y,l)}};In.STATUS=414;let Nn=In;const Rt=class nu extends Je{constructor(y,l){super(nu.STATUS,y,l)}};Rt.STATUS=429;let ps=Rt;const xr=class su extends Je{constructor(y,l){super(su.STATUS,y,l)}};xr.STATUS=401;let Br=xr;const $n=class ou extends Je{constructor(y,l){super(ou.STATUS,y,l)}};$n.STATUS=451;let St=$n;const Ts=class iu extends Je{constructor(y,l){super(iu.STATUS,y,l)}};Ts.STATUS=422;let vn=Ts;const On=class au extends Je{constructor(y,l){super(au.STATUS,y,l)}};On.STATUS=415;let Re=On;const Wt=class cu extends Je{constructor(y,l){super(cu.STATUS,y,l)}};Wt.STATUS=426;let xt=Wt;class Or extends ar{constructor(y,l,ne){super(ar.validate(y,Nr["3xx"]),l,ne)}}class yt extends ar{constructor(y,l,ne){super(ar.validate(y,Nr["5xx"]),l,ne)}}const Pr=class uu extends Or{constructor(y,l){super(uu.STATUS,y,l)}};Pr.STATUS=301;let Ht=Pr;const Sn=class fu extends Or{constructor(y,l){super(fu.STATUS,y,l),this.name="MOVED_TEMPORARILY"}};Sn.STATUS=302;let Ps=Sn;const bn=class pu extends Or{constructor(y,l){super(pu.STATUS,y,l)}};bn.STATUS=300;let Es=bn;const wn=class lu extends Or{constructor(y,l){super(lu.STATUS,y,l)}};wn.STATUS=304;let ls=wn;const qr=class hu extends Or{constructor(y,l){super(hu.STATUS,y,l)}};qr.STATUS=308;let Tn=qr;const rn=class du extends Or{constructor(y,l){super(du.STATUS,y,l)}};rn.STATUS=303;let Un=rn;const Gr=class mu extends Or{constructor(y,l){super(mu.STATUS,y,l)}};Gr.STATUS=307;let Pn=Gr;const Ln=class yu extends Or{constructor(y,l){super(yu.STATUS,y,l)}};Ln.STATUS=305;let Kr=Ln;const Fn=class gu extends yt{constructor(y,l){super(gu.STATUS,y,l)}};Fn.STATUS=502;let Ms=Fn;const Bn=class vu extends yt{constructor(y,l){super(vu.STATUS,y,l)}};Bn.STATUS=509;let As=Bn;const hs=class Ou extends yt{constructor(y,l){super(Ou.STATUS,y,l)}};hs.STATUS=504;let jr=hs;const En=class Su extends yt{constructor(y,l){super(Su.STATUS,y,l)}};En.STATUS=500;let Rs=En;const nn=class bu extends yt{constructor(y,l){super(bu.STATUS,y,l)}};nn.STATUS=511;let qn=nn;const gt=class wu extends yt{constructor(y,l){super(wu.STATUS,y,l)}};gt.STATUS=510;let xs=gt;const Gn=class Tu extends yt{constructor(y,l){super(Tu.STATUS,y,l)}};Gn.STATUS=501;let js=Gn;const Mn=class Pu extends yt{constructor(y,l){super(Pu.STATUS,y,l),this.name="PROXY_ERROR"}};Mn.STATUS=502;let ds=Mn;const An=class Eu extends yt{constructor(y,l){super(Eu.STATUS,y,l)}};An.STATUS=503;let u=An;const m=class Mu extends yt{constructor(y,l){super(Mu.STATUS,y,l)}};m.STATUS=506;let S=m;n.BadGateway=Ms,n.BadMapping=d,n.BadRequest=Le,n.BandwidthLimitExceeded=As,n.ClientException=Je,n.Conflict=_t,n.Exception=ar,n.ExpectationFailed=cr,n.Forbidden=wr,n.GatewayTimeout=jr,n.Gone=as,n.HTTPException=Ir,n.ImATeapot=yr,n.InternalServerError=Rs,n.LengthRequired=cs,n.MethodNotAllowed=Ur,n.MisdirectedRequest=Qt,n.MovedPermanently=Ht,n.MovedTemporarily=Ps,n.MultipleChoices=Es,n.NetworkAuthenticationRequired=qn,n.NotAcceptable=Et,n.NotExtended=xs,n.NotFound=yn,n.NotImplemented=js,n.NotModified=ls,n.PaymentRequired=Ft,n.PermanentRedirect=Tn,n.PreconditionFailed=Ze,n.PreconditionRequired=gn,n.ProxyAuthentificationRequired=ct,n.ProxyError=ds,n.RedirectException=Or,n.RequestEntityTooLarge=fs,n.RequestHeaderFieldsTooLarge=Qr,n.RequestRangeUnsatisfiable=vr,n.RequestTimeout=Rr,n.RequestURITooLong=Nn,n.SeeOther=Un,n.ServerException=yt,n.ServiceUnavailable=u,n.StatusFamily=Nr,n.TemporaryRedirect=Pn,n.TooManyRequests=ps,n.Unauthorized=Br,n.UnavailableForLegalReasons=St,n.UnprocessableEntity=vn,n.UnsupportedMediaType=Re,n.UpgradeRequired=xt,n.UseProxy=Kr,n.VariantAlsoNegotiates=S,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})})}(fo,fo.exports)),fo.exports}var Fu=Lu();class Ma extends Fu.BadRequest{constructor(ke,n=[]){super(ke),this.name="AJV_VALIDATION_ERROR",this.errors=n}}function Do(ve,ke){if(ke[ve])return ke[ve].bind(ke)}function Bu(){return Dr.injector().getProviders("ajv:keyword")}function qu(){return Bu().map(ve=>{const ke=ve.store.get("ajv:keyword",{}),n=Dr.inject(ve.token);return Mr.cleanObject({coerceTypes:"array",...ke,validate:Do("validate",n),compile:Do("compile",n),code:Do("code",n),macro:Do("macro",n)})})}function Gu(){return Dr.injector().getProviders("ajv:formats")}function Ku(){return Gu().map(ve=>{var tt;const{name:ke,options:n}=ve.store.get("ajv:formats",{}),Ee=Dr.inject(ve.token);return{name:ke,options:{...n,validate:Ee.validate.bind(Ee),compare:(tt=Ee.compare)==null?void 0:tt.bind(Ee)}}})}Dr.injectable(gi.Ajv).scope(Dr.ProviderScope.SINGLETON).factory(()=>{const{errorFormatter:ve,keywords:ke=[],...n}=Dr.constant("ajv")||{},Ee={verbose:!1,coerceTypes:!0,strict:!1,keywords:[...ke,...qu()],discriminator:!0,allErrors:!0,...n},tt=new gi.Ajv(Ee);return Au(tt),Ru(tt),Ku().forEach(({name:Me,options:lt})=>{tt.addFormat(Me,lt)}),tt});var po={exports:{}},Ju=po.exports,Aa;function Vu(){return Aa||(Aa=1,function(ve,ke){(function(n,Ee){Ee(ke,xu,ju,Cu)})(Ju,function(n,Ee,tt,Me){var lt=t=>{throw TypeError(t)},De=(t,e,r)=>e.has(t)||lt("Cannot "+r),Z=(t,e,r)=>(De(t,e,"read from private field"),r?r.call(t):e.get(t)),rt=(t,e,r)=>e.has(t)?lt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),me=(t,e,r,s)=>(De(t,e,"write to private field"),e.set(t,r),r),ht,Ye,nt,Be,dt,$t,at,Ut,Vt,Lt,ir,Zt,$e=(t=>(t.ALL="ALL",t.GET="GET",t.POST="POST",t.PUT="PUT",t.PATCH="PATCH",t.HEAD="HEAD",t.DELETE="DELETE",t.OPTIONS="OPTIONS",t.TRACE="TRACE",t.PUBLISH="PUBLISH",t.SUBSCRIBE="SUBSCRIBE",t.CUSTOM="CUSTOM",t))($e||{});const ln=["ALL","GET","POST","PUT","PATCH","HEAD","DELETE","OPTIONS","TRACE","CUSTOM"],bs=["PUBLISH","SUBSCRIBE"],mt=new Map;function le(t,e,r){return mt.set(r?`${r}:${t}`:t,e)}function hn(t,e){const r=mt.get(`${e==null?void 0:e.specType}:${t}`)||mt.get(t);if(r)return r;throw new Error(`JsonSchema ${t} mapper doesn't exists`)}function G(t,e,r,s){return hn(t,r)(...e,r,s)}function kn(t){return mt.has(t)}function br(t,e){return t.find(r=>mt.has(`${e==null?void 0:e.specType}:${r}`))||t.find(r=>mt.has(r))}function dr(t){return t.split("/").filter(Boolean).join("/")}var ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Ks<"u"?Ks:typeof self<"u"?self:{},Ir={exports:{}},Nr=Ir.exports,Je;function zr(){return Je||(Je=1,function(t,e){(function(r,s){s(e)})(Nr,function(r){var s=c=>{throw TypeError(c)},f=(c,O,M)=>O.has(c)||s("Cannot "+M),h=(c,O,M)=>(f(c,O,"read from private field"),M?M.call(c):O.get(c)),w=(c,O,M)=>O.has(c)?s("Cannot add the same private member more than once"):O instanceof WeakSet?O.add(c):O.set(c,M),k=(c,O,M,U)=>(f(c,O,"write to private field"),O.set(c,M),M),F,V,te,we,ft=(c=>(c.PARAM="parameter",c.PARAM_CTOR="parameter.constructor",c.PARAM_STC="parameter.static",c.PROP="property",c.PROP_STC="property.static",c.METHOD="method",c.METHOD_STC="method.static",c.CLASS="class",c))(ft||{});function Sr(c){return c.prototype?c:c.constructor}function et(c){return Sr(c)}function rs(c){const[O,M,U]=c,J=be=>O!==et(O)?be:`${be}.static`;return typeof U=="number"?M?J("parameter"):"parameter.constructor":U&&U.value?J("method"):M&&U===void 0||U?J("property"):ft.CLASS}function Ss(c){return c===Date||c instanceof Date&&!isNaN(+c)}function Us(c){return typeof c=="function"}function Nt(c){return c==null}function Ge(c){return typeof c=="boolean"||c instanceof Boolean||c===Boolean}function Ue(c){return typeof c=="boolean"||c instanceof Boolean||c===Boolean}function Ot(c){return typeof c=="number"}function ot(c){return typeof c=="number"||c instanceof Number||c===Number}function it(c){return typeof c=="string"}function Hr(c){return typeof c=="string"||c instanceof String||c===String}function fi(c){return Hr(c)||ot(c)||Ue(c)}function na(c){return it(c)||Ot(c)||Ge(c)}function Zu(c){return[String,Number,Boolean].includes(c)}function $a(c){return c instanceof RegExp}function so(c){return typeof c=="symbol"}function Qu(c){return typeof c=="symbol"||c instanceof Symbol||c===Symbol}const ef=c=>Nt(c)||na(c)||so(c)||Us(c),Ls=(c,O=new WeakMap)=>{if(ef(c))return c;const M=O.get(c);if(M)return M;if(ArrayBuffer.isView(c))return Buffer.isBuffer(c)?Buffer.from(c):new(et(c))(c.buffer.slice(0),c.byteOffset,c.byteLength);if(Ss(c))return new Date(c);if($a(c))return new RegExp(c);if(Array.isArray(c)){const J=[];return O.set(c,J),c.forEach((be,ze)=>J[ze]=Ls(be,O)),J}if(c instanceof Map){const J=new Map;return O.set(c,J),c.forEach((be,ze)=>J.set(Ls(ze,O),Ls(be,O))),J}if(c instanceof Set){const J=new Set;return O.set(c,J),c.forEach(be=>J.add(Ls(be,O))),J}const U=Object.create(Reflect.getPrototypeOf(c));return O.set(c,U),Reflect.ownKeys(c).forEach(J=>{const be=Object.getOwnPropertyDescriptor(c,J);be&&(Us(be.value)?Object.defineProperty(U,J,be):Object.defineProperty(U,J,{...be,value:Ls(be.value,O)}))}),U};function Ua(c){return c?et(c)!==Object?Object.create(c):{}:{}}function pi(c){return["__proto__","constructor","prototype"].includes(c)}function sa(c){return Object.keys(c).filter(O=>!pi(O))}function La(c){return(O,M,U)=>{const J=O.findIndex(be=>c(be,M));return J===-1?[...O,M]:(O[J]=Ro(O[J],M,U),O)}}const Fa=La((c,O)=>c===O);function tf({reducers:c,parentKey:O}){return c?O&&c[O]?c[O]:c.default||Fa:Fa}function rf(c,O){return na(c)||so(c)||Us(c)||O===void 0}function nf(c,O){return c==null||c===""&&O!==""}function Ro(c,O,M={}){if(nf(O,c))return c;if(rf(O,c))return O;if(Array.isArray(c)){const J=tf(M);return[].concat(O).reduce((be,ze)=>J(be,ze,M),[...c])}const U=Ua(c);return[...sa(c),...sa(O)].reduce((J,be)=>{var ze;const Gt=c&&c[be],sr=Ro(Gt,O&&O[be],{...M,parentKey:be});return M.cleanUndefinedProps&&sr===void 0||(J[be]=((ze=M.alter)==null?void 0:ze.call(M,be,sr))??sr),J},U)}function Fs(c,O){return Reflect.getOwnPropertyDescriptor(c&&c.prototype||c,O)}function sf(c,O){var M;return(M=Fs(c,O))==null?void 0:M.value}function Ba(c){return typeof c=="function"?c.name:c.constructor.name}const qa=c=>c.toString().replace("Symbol(","").replace(")","");function Bs(c){switch(typeof c){default:return""+c;case"symbol":return qa(c);case"function":return Ba(c)}}var Ga=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ar<"u"?ar:typeof self<"u"?self:{},Ka={};/*! *****************************************************************************
42
+ Copyright (C) Microsoft. All rights reserved.
43
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
44
+ this file except in compliance with the License. You may obtain a copy of the
45
+ License at http://www.apache.org/licenses/LICENSE-2.0
46
+
47
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
48
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
49
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
50
+ MERCHANTABLITY OR NON-INFRINGEMENT.
51
+
52
+ See the Apache Version 2.0 License for specific language governing permissions
53
+ and limitations under the License.
54
+ ***************************************************************************** */var Ja;function of(){if(Ja)return Ka;Ja=1;var c;return function(O){(function(M){var U=typeof globalThis=="object"?globalThis:typeof Ga=="object"?Ga:typeof self=="object"?self:typeof this=="object"?this:sr(),J=be(O);typeof U.Reflect<"u"&&(J=be(U.Reflect,J)),M(J,U),typeof U.Reflect>"u"&&(U.Reflect=O);function be(ss,Xs){return function(qs,Co){Object.defineProperty(ss,qs,{configurable:!0,writable:!0,value:Co}),Xs&&Xs(qs,Co)}}function ze(){try{return Function("return this;")()}catch{}}function Gt(){try{return(0,eval)("(function() { return this; })()")}catch{}}function sr(){return ze()||Gt()}})(function(M,U){var J=Object.prototype.hasOwnProperty,be=typeof Symbol=="function",ze=be&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",Gt=be&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",sr=typeof Object.create=="function",ss={__proto__:[]}instanceof Array,Xs=!sr&&!ss,qs={create:sr?function(){return ba(Object.create(null))}:ss?function(){return ba({__proto__:null})}:function(){return ba({})},has:Xs?function(x,_){return J.call(x,_)}:function(x,_){return _ in x},get:Xs?function(x,_){return J.call(x,_)?x[_]:void 0}:function(x,_){return x[_]}},Co=Object.getPrototypeOf(Function),_o=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ip(),ya=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:ap(),ga=typeof WeakMap=="function"?WeakMap:cp(),oo=be?Symbol.for("@reflect-metadata:registry"):void 0,mi=np(),vc=sp(mi);function Lf(x,_,N,Y){if(Ce(N)){if(!Ac(x))throw new TypeError;if(!Rc(_))throw new TypeError;return zf(x,_)}else{if(!Ac(x))throw new TypeError;if(!Yt(_))throw new TypeError;if(!Yt(Y)&&!Ce(Y)&&!io(Y))throw new TypeError;return io(Y)&&(Y=void 0),N=os(N),Yf(x,_,N,Y)}}M("decorate",Lf);function Ff(x,_){function N(Y,Pe){if(!Yt(Y))throw new TypeError;if(!Ce(Pe)&&!tp(Pe))throw new TypeError;wc(x,_,Y,Pe)}return N}M("metadata",Ff);function Bf(x,_,N,Y){if(!Yt(N))throw new TypeError;return Ce(Y)||(Y=os(Y)),wc(x,_,N,Y)}M("defineMetadata",Bf);function qf(x,_,N){if(!Yt(_))throw new TypeError;return Ce(N)||(N=os(N)),Oc(x,_,N)}M("hasMetadata",qf);function Gf(x,_,N){if(!Yt(_))throw new TypeError;return Ce(N)||(N=os(N)),va(x,_,N)}M("hasOwnMetadata",Gf);function Kf(x,_,N){if(!Yt(_))throw new TypeError;return Ce(N)||(N=os(N)),Sc(x,_,N)}M("getMetadata",Kf);function Jf(x,_,N){if(!Yt(_))throw new TypeError;return Ce(N)||(N=os(N)),bc(x,_,N)}M("getOwnMetadata",Jf);function Vf(x,_){if(!Yt(x))throw new TypeError;return Ce(_)||(_=os(_)),Tc(x,_)}M("getMetadataKeys",Vf);function Wf(x,_){if(!Yt(x))throw new TypeError;return Ce(_)||(_=os(_)),Pc(x,_)}M("getOwnMetadataKeys",Wf);function Hf(x,_,N){if(!Yt(_))throw new TypeError;if(Ce(N)||(N=os(N)),!Yt(_))throw new TypeError;Ce(N)||(N=os(N));var Y=ko(_,N,!1);return Ce(Y)?!1:Y.OrdinaryDeleteMetadata(x,_,N)}M("deleteMetadata",Hf);function zf(x,_){for(var N=x.length-1;N>=0;--N){var Y=x[N],Pe=Y(_);if(!Ce(Pe)&&!io(Pe)){if(!Rc(Pe))throw new TypeError;_=Pe}}return _}function Yf(x,_,N,Y){for(var Pe=x.length-1;Pe>=0;--Pe){var or=x[Pe],Xt=or(_,N,Y);if(!Ce(Xt)&&!io(Xt)){if(!Yt(Xt))throw new TypeError;Y=Xt}}return Y}function Oc(x,_,N){var Y=va(x,_,N);if(Y)return!0;var Pe=Sa(_);return io(Pe)?!1:Oc(x,Pe,N)}function va(x,_,N){var Y=ko(_,N,!1);return Ce(Y)?!1:Mc(Y.OrdinaryHasOwnMetadata(x,_,N))}function Sc(x,_,N){var Y=va(x,_,N);if(Y)return bc(x,_,N);var Pe=Sa(_);if(!io(Pe))return Sc(x,Pe,N)}function bc(x,_,N){var Y=ko(_,N,!1);if(!Ce(Y))return Y.OrdinaryGetOwnMetadata(x,_,N)}function wc(x,_,N,Y){var Pe=ko(N,Y,!0);Pe.OrdinaryDefineOwnMetadata(x,_,N,Y)}function Tc(x,_){var N=Pc(x,_),Y=Sa(x);if(Y===null)return N;var Pe=Tc(Y,_);if(Pe.length<=0)return N;if(N.length<=0)return Pe;for(var or=new ya,Xt=[],Ke=0,re=N;Ke<re.length;Ke++){var ce=re[Ke],fe=or.has(ce);fe||(or.add(ce),Xt.push(ce))}for(var de=0,We=Pe;de<We.length;de++){var ce=We[de],fe=or.has(ce);fe||(or.add(ce),Xt.push(ce))}return Xt}function Pc(x,_){var N=ko(x,_,!1);return N?N.OrdinaryOwnMetadataKeys(x,_):[]}function Ec(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function Ce(x){return x===void 0}function io(x){return x===null}function Xf(x){return typeof x=="symbol"}function Yt(x){return typeof x=="object"?x!==null:typeof x=="function"}function Zf(x,_){switch(Ec(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var N="string",Y=xc(x,ze);if(Y!==void 0){var Pe=Y.call(x,N);if(Yt(Pe))throw new TypeError;return Pe}return Qf(x)}function Qf(x,_){var N,Y;{var Pe=x.toString;if(yi(Pe)){var Y=Pe.call(x);if(!Yt(Y))return Y}var N=x.valueOf;if(yi(N)){var Y=N.call(x);if(!Yt(Y))return Y}}throw new TypeError}function Mc(x){return!!x}function ep(x){return""+x}function os(x){var _=Zf(x);return Xf(_)?_:ep(_)}function Ac(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}function yi(x){return typeof x=="function"}function Rc(x){return typeof x=="function"}function tp(x){switch(Ec(x)){case 3:return!0;case 4:return!0;default:return!1}}function Oa(x,_){return x===_||x!==x&&_!==_}function xc(x,_){var N=x[_];if(N!=null){if(!yi(N))throw new TypeError;return N}}function jc(x){var _=xc(x,Gt);if(!yi(_))throw new TypeError;var N=_.call(x);if(!Yt(N))throw new TypeError;return N}function Cc(x){return x.value}function _c(x){var _=x.next();return _.done?!1:_}function kc(x){var _=x.return;_&&_.call(x)}function Sa(x){var _=Object.getPrototypeOf(x);if(typeof x!="function"||x===Co||_!==Co)return _;var N=x.prototype,Y=N&&Object.getPrototypeOf(N);if(Y==null||Y===Object.prototype)return _;var Pe=Y.constructor;return typeof Pe!="function"||Pe===x?_:Pe}function rp(){var x;!Ce(oo)&&typeof U.Reflect<"u"&&!(oo in U.Reflect)&&typeof U.Reflect.defineMetadata=="function"&&(x=op(U.Reflect));var _,N,Y,Pe=new ga,or={registerProvider:Xt,getProvider:re,setProvider:fe};return or;function Xt(de){if(!Object.isExtensible(or))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case x===de:break;case Ce(_):_=de;break;case _===de:break;case Ce(N):N=de;break;case N===de:break;default:Y===void 0&&(Y=new ya),Y.add(de);break}}function Ke(de,We){if(!Ce(_)){if(_.isProviderFor(de,We))return _;if(!Ce(N)){if(N.isProviderFor(de,We))return _;if(!Ce(Y))for(var Pt=jc(Y);;){var Kt=_c(Pt);if(!Kt)return;var _n=Cc(Kt);if(_n.isProviderFor(de,We))return kc(Pt),_n}}}if(!Ce(x)&&x.isProviderFor(de,We))return x}function re(de,We){var Pt=Pe.get(de),Kt;return Ce(Pt)||(Kt=Pt.get(We)),Ce(Kt)&&(Kt=Ke(de,We),Ce(Kt)||(Ce(Pt)&&(Pt=new _o,Pe.set(de,Pt)),Pt.set(We,Kt))),Kt}function ce(de){if(Ce(de))throw new TypeError;return _===de||N===de||!Ce(Y)&&Y.has(de)}function fe(de,We,Pt){if(!ce(Pt))throw new Error("Metadata provider not registered.");var Kt=re(de,We);if(Kt!==Pt){if(!Ce(Kt))return!1;var _n=Pe.get(de);Ce(_n)&&(_n=new _o,Pe.set(de,_n)),_n.set(We,Pt)}return!0}}function np(){var x;return!Ce(oo)&&Yt(U.Reflect)&&Object.isExtensible(U.Reflect)&&(x=U.Reflect[oo]),Ce(x)&&(x=rp()),!Ce(oo)&&Yt(U.Reflect)&&Object.isExtensible(U.Reflect)&&Object.defineProperty(U.Reflect,oo,{enumerable:!1,configurable:!1,writable:!1,value:x}),x}function sp(x){var _=new ga,N={isProviderFor:function(ce,fe){var de=_.get(ce);return Ce(de)?!1:de.has(fe)},OrdinaryDefineOwnMetadata:Xt,OrdinaryHasOwnMetadata:Pe,OrdinaryGetOwnMetadata:or,OrdinaryOwnMetadataKeys:Ke,OrdinaryDeleteMetadata:re};return mi.registerProvider(N),N;function Y(ce,fe,de){var We=_.get(ce),Pt=!1;if(Ce(We)){if(!de)return;We=new _o,_.set(ce,We),Pt=!0}var Kt=We.get(fe);if(Ce(Kt)){if(!de)return;if(Kt=new _o,We.set(fe,Kt),!x.setProvider(ce,fe,N))throw We.delete(fe),Pt&&_.delete(ce),new Error("Wrong provider for target.")}return Kt}function Pe(ce,fe,de){var We=Y(fe,de,!1);return Ce(We)?!1:Mc(We.has(ce))}function or(ce,fe,de){var We=Y(fe,de,!1);if(!Ce(We))return We.get(ce)}function Xt(ce,fe,de,We){var Pt=Y(de,We,!0);Pt.set(ce,fe)}function Ke(ce,fe){var de=[],We=Y(ce,fe,!1);if(Ce(We))return de;for(var Pt=We.keys(),Kt=jc(Pt),_n=0;;){var Dc=_c(Kt);if(!Dc)return de.length=_n,de;var up=Cc(Dc);try{de[_n]=up}catch(fp){try{kc(Kt)}finally{throw fp}}_n++}}function re(ce,fe,de){var We=Y(fe,de,!1);if(Ce(We)||!We.delete(ce))return!1;if(We.size===0){var Pt=_.get(fe);Ce(Pt)||(Pt.delete(de),Pt.size===0&&_.delete(Pt))}return!0}}function op(x){var _=x.defineMetadata,N=x.hasOwnMetadata,Y=x.getOwnMetadata,Pe=x.getOwnMetadataKeys,or=x.deleteMetadata,Xt=new ga,Ke={isProviderFor:function(re,ce){var fe=Xt.get(re);return!Ce(fe)&&fe.has(ce)?!0:Pe(re,ce).length?(Ce(fe)&&(fe=new ya,Xt.set(re,fe)),fe.add(ce),!0):!1},OrdinaryDefineOwnMetadata:_,OrdinaryHasOwnMetadata:N,OrdinaryGetOwnMetadata:Y,OrdinaryOwnMetadataKeys:Pe,OrdinaryDeleteMetadata:or};return Ke}function ko(x,_,N){var Y=mi.getProvider(x,_);if(!Ce(Y))return Y;if(N){if(mi.setProvider(x,_,vc))return vc;throw new Error("Illegal state.")}}function ip(){var x={},_=[],N=function(){function Ke(re,ce,fe){this._index=0,this._keys=re,this._values=ce,this._selector=fe}return Ke.prototype["@@iterator"]=function(){return this},Ke.prototype[Gt]=function(){return this},Ke.prototype.next=function(){var re=this._index;if(re>=0&&re<this._keys.length){var ce=this._selector(this._keys[re],this._values[re]);return re+1>=this._keys.length?(this._index=-1,this._keys=_,this._values=_):this._index++,{value:ce,done:!1}}return{value:void 0,done:!0}},Ke.prototype.throw=function(re){throw this._index>=0&&(this._index=-1,this._keys=_,this._values=_),re},Ke.prototype.return=function(re){return this._index>=0&&(this._index=-1,this._keys=_,this._values=_),{value:re,done:!0}},Ke}(),Y=function(){function Ke(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return Object.defineProperty(Ke.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ke.prototype.has=function(re){return this._find(re,!1)>=0},Ke.prototype.get=function(re){var ce=this._find(re,!1);return ce>=0?this._values[ce]:void 0},Ke.prototype.set=function(re,ce){var fe=this._find(re,!0);return this._values[fe]=ce,this},Ke.prototype.delete=function(re){var ce=this._find(re,!1);if(ce>=0){for(var fe=this._keys.length,de=ce+1;de<fe;de++)this._keys[de-1]=this._keys[de],this._values[de-1]=this._values[de];return this._keys.length--,this._values.length--,Oa(re,this._cacheKey)&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},Ke.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},Ke.prototype.keys=function(){return new N(this._keys,this._values,Pe)},Ke.prototype.values=function(){return new N(this._keys,this._values,or)},Ke.prototype.entries=function(){return new N(this._keys,this._values,Xt)},Ke.prototype["@@iterator"]=function(){return this.entries()},Ke.prototype[Gt]=function(){return this.entries()},Ke.prototype._find=function(re,ce){if(!Oa(this._cacheKey,re)){this._cacheIndex=-1;for(var fe=0;fe<this._keys.length;fe++)if(Oa(this._keys[fe],re)){this._cacheIndex=fe;break}}return this._cacheIndex<0&&ce&&(this._cacheIndex=this._keys.length,this._keys.push(re),this._values.push(void 0)),this._cacheIndex},Ke}();return Y;function Pe(Ke,re){return Ke}function or(Ke,re){return re}function Xt(Ke,re){return[Ke,re]}}function ap(){var x=function(){function _(){this._map=new _o}return Object.defineProperty(_.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),_.prototype.has=function(N){return this._map.has(N)},_.prototype.add=function(N){return this._map.set(N,N),this},_.prototype.delete=function(N){return this._map.delete(N)},_.prototype.clear=function(){this._map.clear()},_.prototype.keys=function(){return this._map.keys()},_.prototype.values=function(){return this._map.keys()},_.prototype.entries=function(){return this._map.entries()},_.prototype["@@iterator"]=function(){return this.keys()},_.prototype[Gt]=function(){return this.keys()},_}();return x}function cp(){var x=16,_=qs.create(),N=Y();return function(){function re(){this._key=Y()}return re.prototype.has=function(ce){var fe=Pe(ce,!1);return fe!==void 0?qs.has(fe,this._key):!1},re.prototype.get=function(ce){var fe=Pe(ce,!1);return fe!==void 0?qs.get(fe,this._key):void 0},re.prototype.set=function(ce,fe){var de=Pe(ce,!0);return de[this._key]=fe,this},re.prototype.delete=function(ce){var fe=Pe(ce,!1);return fe!==void 0?delete fe[this._key]:!1},re.prototype.clear=function(){this._key=Y()},re}();function Y(){var re;do re="@@WeakMap@@"+Ke();while(qs.has(_,re));return _[re]=!0,re}function Pe(re,ce){if(!J.call(re,N)){if(!ce)return;Object.defineProperty(re,N,{value:qs.create()})}return re[N]}function or(re,ce){for(var fe=0;fe<ce;++fe)re[fe]=Math.random()*255|0;return re}function Xt(re){if(typeof Uint8Array=="function"){var ce=new Uint8Array(re);return typeof crypto<"u"?crypto.getRandomValues(ce):typeof msCrypto<"u"?msCrypto.getRandomValues(ce):or(ce,re),ce}return or(new Array(re),re)}function Ke(){var re=Xt(x);re[6]=re[6]&79|64,re[8]=re[8]&191|128;for(var ce="",fe=0;fe<x;++fe){var de=re[fe];(fe===4||fe===6||fe===8)&&(ce+="-"),de<16&&(ce+="0"),ce+=de.toString(16).toLowerCase()}return ce}}function ba(x){return x.__=void 0,delete x.__,x}})}(c||(c={})),Ka}of();const oa="design:paramtypes",Va="design:type",Wa="design:returntype",xo=new Map,Ha=class{static get(c,O,M){return Reflect.getMetadata(c,et(O),M)}static getOwn(c,O,M){return Reflect.getOwnMetadata(c,et(O),M)}static getType(c,O){return Reflect.getMetadata(Va,c,O)}static getOwnType(c,O){return Reflect.getMetadata(Va,c,O)}static getReturnType(c,O){return Reflect.getMetadata(Wa,c,O)}static getOwnReturnType(c,O){return Reflect.getOwnMetadata(Wa,c,O)}static has(c,O,M){try{return Reflect.hasMetadata(c,et(O),M)}catch{}return!1}static hasOwn(c,O,M){return Reflect.hasOwnMetadata(c,et(O),M)}static delete(c,O,M){return Reflect.deleteMetadata(c,et(O),M)}static setParamTypes(c,O,M){return this.set(oa,M,c.prototype,O)}static set(c,O,M,U){const J=xo.has(c)?xo.get(c)||[]:[],be=et(M);J.indexOf(be)===-1&&(J.push(be),xo.set(c,J)),Reflect.defineMetadata(c,O,et(M),U)}static getParamTypes(c,O){return Reflect.getMetadata(oa,c,O)||[]}static getOwnParamTypes(c,O){return Reflect.getOwnMetadata(oa,c,O)||[]}};Ha.getTargetsFromPropertyKey=c=>xo.has(c)?xo.get(c)||[]:[];let za=Ha;const Ya="tsed:class:store",Xa="tsed:method:store",Za="tsed:property:store",Qa="tsed:param:store",ia=new Map;function li(c,...O){if(so(O[0]))return ia.has(O[0])||ia.set(O[0],new ns),ia.get(O[0]);{const M=za;return M.hasOwn(c,...O)||M.set(c,new ns,...O),M.getOwn(c,...O)}}function af(c){const[O,M,U]=c;switch(rs(c)){case ft.PARAM_CTOR:case ft.PARAM_STC:case ft.PARAM:const J=li(Qa,O,M);return J.has(""+U)||J.set(""+U,new ns),J.get(""+U);case ft.PROP:case ft.PROP_STC:return li(Za,O,M);case ft.METHOD:case ft.METHOD_STC:return li(Xa,O,M);case ft.CLASS:return li(Ya,O)}}class ns{constructor(){this._entries=new Map}static from(...O){return af(O)}static fromMethod(O,M){return ns.from(O,M,Fs(O,M))}static mergeStoreFrom(O,M,...U){const J=ns.from(O,...U);return ns.from(M,...U)._entries.forEach((be,ze)=>{J.merge(ze,be)}),J}static mergeStoreMethodFrom(O,M,U){return this.mergeStoreFrom(O,M,U,Fs(O,U))}get(O,M){return this._entries.get(Bs(O))||M}has(O){return this._entries.has(Bs(O))}set(O,M){return this._entries.set(Bs(O),M),this}delete(O){return this._entries.delete(Bs(O))}merge(O,M,U=!1){let J=this.get(O);return J&&(M=Ls(M),J=Ls(J),M=U?Ro(M,J):Ro(J,M)),this.set(O,M),this}toJson(){return[...this._entries.entries()].reduce((O,[M,U])=>({...O,[M]:U}),{})}}function aa(c){return(...O)=>{const M=ns.from(...O),U=c(M,O);return typeof U=="function"&&U(...O),O[2]}}function cf(c,O){return aa(M=>{M.merge(c,O)})}function uf(c,O){return aa(M=>{M.set(c,O)})}class ca extends Error{constructor(O,M){super(ca.buildMessage(O,M))}static buildMessage(O,M){const[U,J,be]=M,ze=rs(M),Gt=ze.split("/")[0],sr=Gt==="parameter"?".["+be+"]":"",ss=J?"."+J:Gt==="parameter"?".constructor":"",Xs=Bs(et(U))+ss+sr;return`${O.name} cannot be used as ${ze} decorator on ${Xs}`}}var ua=(c=>(c.PROD="production",c.DEV="development",c.TEST="test",c))(ua||{});const ff=ua,ec=Function;ar.Type=ec;function fa(c){return c&&Object.getPrototypeOf(c)}function tc(c){return fa(c)}function pa(c){const O=[];let M=et(c);for(;M&&Bs(M)!=="";)O.unshift(M),M=tc(M);return O}function hi(c){return typeof c=="object"}function rc(c){return!!c&&typeof c.lift=="function"&&typeof c.subscribe=="function"}function la(c){return c===Promise||c instanceof Promise||!!c&&typeof c.subscribe!="function"&&typeof c.then=="function"}function di(c){return c!==null&&typeof c=="object"&&typeof c.pipe=="function"}function nc(c){return hi(c)&&"data"in c&&"headers"in c&&"status"in c&&"statusText"in c}var sc=(c=>(c.PENDING="PENDING",c.CANCELED="CANCELED",c.RESOLVED="RESOLVED",c.REJECTED="REJECTED",c))(sc||{}),oc=(c=>(c.STREAM="STREAM",c.BUFFER="BUFFER",c.DATA="DATA",c))(oc||{});class pf{constructor({hasNextFunction:O=!1}={}){w(this,F),w(this,V),w(this,te),w(this,we),this.status="PENDING",k(this,te,!1),k(this,te,O),k(this,we,new Promise((M,U)=>{k(this,F,M),k(this,V,U)}))}isDone(){return this.status!=="PENDING"}get next(){return k(this,te,!0),O=>{if(!this.isDone())return O?this.reject(O):this.resolve({type:"DATA"})}}call(O){if(this.isDone())return Promise.resolve(this);try{this.handle(O())}catch(M){this.reject(M)}return h(this,we)}reject(O){this.isDone()||(this.done("REJECTED"),h(this,V).call(this,O))}resolve(O={}){this.isDone()||(this.done("RESOLVED"),h(this,F).call(this,{...O,state:"RESOLVED"}))}destroy(){}cancel(){if(!this.isDone())return this.done("CANCELED"),h(this,F).call(this,{state:"CANCELED"})}done(O){this.destroy(),this.status=O}handle(O,M={}){if(!this.isDone()){if(O){if(this.isCanceledResponse(O))return this.cancel();if(rc(O)&&(O=O.toPromise()),nc(O))return this.handle(O.data,{...M,status:O.status,headers:O.headers});if(di(O))return this.resolve({...M,type:"STREAM",data:O});if(di(O)||Buffer.isBuffer(O))return this.resolve({...M,type:"BUFFER",data:O});if(la(O))return O.then(U=>this.handle(U,M)).catch(U=>U.response&&nc(U.response)?this.handle(U.response):this.reject(U))}if(!h(this,te))return this.resolve({...M,data:O,type:"DATA"})}}isCanceledResponse(O){return O==="CANCELED"}}F=new WeakMap,V=new WeakMap,te=new WeakMap,we=new WeakMap;function lf(c){try{c()}catch(O){return O}}async function hf(c){try{await c()}catch(O){return O}}function df(c,O=[]){return Object.entries(c).reduce((M,[U,J])=>(pi(U)||O.includes(U)||J===void 0||(M[U]=J),M),{})}function ic(c){return typeof c=="function"?c:c.constructor}function ac(c){return ic(c)}function jo(c){return et(c)===c?c.prototype:c}function cc(c){const O=new Map;return c=et(c),pa(c).forEach(M=>{Reflect.ownKeys(jo(M)).forEach(U=>{var J;so(U)||U==="constructor"||(J=Object.getOwnPropertyDescriptor(jo(M),U))!=null&&J.get||O.set(U,{target:M,propertyKey:U})})}),Array.from(O.values())}function mf(c,O){cc(c).forEach(({target:M,propertyKey:U})=>{const J=jo(c);M!==et(c)&&(Object.defineProperty(J,U,{writable:!0,configurable:!0,value(...Gt){return jo(M)[U].apply(this,Gt)}}),ns.mergeStoreMethodFrom(c,M,U));let be=Fs(c,U);const ze=O(J,U,be)||be;ze&&Object.defineProperty(J,U,ze)})}function yf(c,O){return[c,O,Fs(c,O)]}function ha(c){return Array.isArray(c)}function da(c){return c===Array||ha(c)}function uc(c){return c&&Us(c)&&!c.prototype}function fc(c){return c&&"isBuffer"in c&&typeof c.isBuffer=="function"?!0:pc(c)}function pc(c){return!!(c&&(c===Uint8Array||c instanceof Uint8Array))}function ma(c){return c===Object}function gf(c){return ma(et(c))&&c!==Object}function lc(c){return!c||uc(c)?!1:!(so(c)||fi(c)||ma(c)||Ss(c)||la(c)||da(c)||fc(c))}function vf(c){return lc(c)?et(c):c}function hc(c){return`${(ac(c).toString().split(`
55
+ `).find(O=>O.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function Of(c){return hc(c).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(O=>O.trim())}function Sf(){return`e${Math.random().toString(36).substring(7)}`}const bf=c=>{const[O,M,U,J="."]=c;return hi(M)||it(O)?{expression:O,scope:M,defaultValue:U,separator:J}:{expression:M,scope:O,defaultValue:U,separator:J}};function wf(...c){const O=bf(c);let M=O.scope;const{expression:U,defaultValue:J,separator:be}=O;if(!U)return M;if(!M)return J;const ze=U.split(be),Gt=sr=>{if(M){if(M[sr]!==void 0||hi(M)&&sr in M)return M[sr];if(Us(M.get))return M.get(sr)}};for(;(M=Gt(ze.shift()))&&ze.length;);return M===void 0?J:M}function dc(c){return c&&typeof c.toJSON=="function"}function Tf(c,O){let M="0.0.0.0",U=O;return typeof O=="string"&&O.indexOf(":")>-1&&([M,U]=O.split(":"),U=+U),{protocol:c,address:M,port:U,toString(){return[`${this.protocol}://${this.address}`,typeof this.port=="number"&&this.port].filter(Boolean).join(":")}}}function mc(c,O){for(const M of pa(c)){const U=Object.getOwnPropertyDescriptor(M&&M.prototype||M,O);if(U)return U}}function Pf(c){return da(c)||c===Map||c instanceof Map||c===Set||c instanceof Set||c===WeakMap||c instanceof WeakMap||c===WeakSet||c instanceof WeakSet}function Ef(c){return c===""||Nt(c)}function Mf(c,O){const M=et(c);if(M){const U=mc(M,O);if(U)return U.enumerable}return Object.prototype.propertyIsEnumerable.call(c,O)}function Af(c,O,M=5){if(!c||!O)return!1;for(c=et(c),O=et(O);Bs(c)!=="";){if(!M)return!1;if(c===O)return!0;c=fa(c),M--}return!1}function Rf(c){return!!(c&&c!=null&&c._isAMomentObject)}function yc(c){return c&&c._bsontype}function xf(c){return!!(dc(c)&&c.$isMongooseModelPrototype||yc(c))}function jf(c){return!(Buffer.isBuffer(c)||di(c)||Ge(c)||Ot(c)||it(c)||Nt(c))}function Cf(c){return Hr(c)?"string":ot(c)?"number":Ue(c)?"boolean":"any"}function _f(c,O,M,U="."){const J=O.split(U),be=(ze,Gt)=>pi(ze)?!1:Gt?(typeof c.set=="function"?c.set(ze,M):c[ze]=M,!1):(typeof c.set=="function"?(c.has(ze)||c.set(ze,{}),c=c.get(ze)):c=c[ze]=c[ze]||{},!0);for(;be(J.shift(),!J.length););}function gc(c){return c?it(c)?O=>O[c]:c:(O,M)=>String(M)}function kf(c,O){if(ha(c)){const U=gc(O||"id");return c.reduce((J,be,ze)=>([].concat(U(be,ze)).forEach(Gt=>{var sr;const ss=J.get(Gt);be=((sr=ss==null?void 0:ss.merge)==null?void 0:sr.call(ss,be))||be,J.set(Gt,be)}),J),new Map)}const M=gc(O);return Object.entries(c).reduce((U,[J,be])=>U.set(M(be,J),be),new Map)}function Df(c){return Array.from(new Set(c).values())}function If(c,O="id"){const M=new Map;return c.forEach(U=>{M.set(U[O],U)}),Array.from(M.values())}function Nf(...c){return(...O)=>{const M=typeof O[2]=="object";if(c.filter(U=>!!U).forEach(U=>{const J=U(...O);M&&typeof J=="object"&&(O[2]=J)}),M)return O[2]}}function $f(c){return(O,M)=>c(O,M,Fs(O,M))}function Uf(...c){return(O,M)=>{c.filter(Boolean).forEach(U=>U(O,M,Fs(O,M)))}}r.AnyToPromise=pf,r.AnyToPromiseResponseTypes=oc,r.AnyToPromiseStatus=sc,r.CLASS_STORE=Ya,r.DecoratorTypes=ft,r.Env=ua,r.EnvTypes=ff,r.METHOD_STORE=Xa,r.Metadata=za,r.PARAM_STORE=Qa,r.PROPERTY_STORE=Za,r.Store=ns,r.StoreFn=aa,r.StoreMerge=cf,r.StoreSet=uf,r.Type=ec,r.UnsupportedDecoratorType=ca,r.ancestorOf=fa,r.ancestorsOf=pa,r.catchAsyncError=hf,r.catchError=lf,r.classOf=et,r.cleanObject=df,r.constructorOf=ac,r.createInstance=Ua,r.decorateMethodsOf=mf,r.decoratorArgs=yf,r.decoratorTypeOf=rs,r.deepClone=Ls,r.deepMerge=Ro,r.descriptorOf=Fs,r.getClass=Sr,r.getClassOrSymbol=vf,r.getConstructor=ic,r.getConstructorArgNames=Of,r.getHostInfoFromPort=Tf,r.getInheritedClass=tc,r.getRandomId=Sf,r.getValue=wf,r.hasJsonMethod=dc,r.inheritedDescriptorOf=mc,r.isArray=ha,r.isArrayOrArrayClass=da,r.isArrowFn=uc,r.isBoolean=Ge,r.isBooleanOrBooleanClass=Ue,r.isBuffer=fc,r.isClass=lc,r.isClassObject=ma,r.isCollection=Pf,r.isDate=Ss,r.isEmpty=Ef,r.isEnumerable=Mf,r.isFunction=Us,r.isInheritedFrom=Af,r.isMethodDescriptor=sf,r.isMomentObject=Rf,r.isMongooseObject=xf,r.isNil=Nt,r.isNumber=Ot,r.isNumberOrNumberClass=ot,r.isObject=hi,r.isObjectID=yc,r.isObservable=rc,r.isPlainObject=gf,r.isPrimitive=na,r.isPrimitiveClass=Zu,r.isPrimitiveOrPrimitiveClass=fi,r.isPromise=la,r.isProtectedKey=pi,r.isRegExp=$a,r.isSerializable=jf,r.isStream=di,r.isString=it,r.isStringOrStringClass=Hr,r.isSymbol=so,r.isSymbolOrSymbolClass=Qu,r.isUint8Array=pc,r.mergeReducerBuilder=La,r.methodsOf=cc,r.nameOf=Bs,r.nameOfClass=Ba,r.nameOfSymbol=qa,r.objectKeys=sa,r.primitiveOf=Cf,r.prototypeOf=jo,r.setValue=_f,r.toMap=kf,r.toStringConstructor=hc,r.uniq=Df,r.uniqBy=If,r.useDecorators=Nf,r.useMethodDecorator=$f,r.useMethodDecorators=Uf,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})})}(Ir,Ir.exports)),Ir.exports}var d=zr();const Ar=new Map;class Le{constructor(e){this.isStore=!0;const{target:r,propertyKey:s,descriptor:f,index:h,decoratorType:w}=e;this.target=r,this.propertyKey=s,this.propertyName=String(s),this.descriptor=f,this.index=h,this.decoratorType=w,this.token=r,this.store=e.store,this.parent=this}get targetName(){return d.nameOf(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return d.isArrayOrArrayClass(this.collectionType)}get discriminatorAncestor(){const e=d.ancestorsOf(this.target).find(r=>Le.from(r).schema.isDiscriminator);return e&&Le.from(e)}get isPrimitive(){return d.isPrimitiveOrPrimitiveClass(this._type)}get isDate(){return d.isDate(this.computedType)}get isObject(){return d.isObject(this.computedType)}get isClass(){return d.isClass(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){var e;return this.schema.isDiscriminator&&((e=this.discriminatorAncestor)==null?void 0:e.schema.discriminator().base)!==this.target}static from(...e){if(e[0].isStore)return e[0];const r=e[0];e.length>1&&(e[0]=d.prototypeOf(e[0]));const s=d.Store.from(...e);if(!s.has("JsonEntityStore")){const f=d.decoratorTypeOf(e),h=Ar.get(f),w=new h({store:s,decoratorType:f,target:d.classOf(r),propertyKey:e[1],index:typeof e[2]=="number"?e[2]:void 0,descriptor:typeof e[2]=="object"?e[2]:void 0});w.build(),s.set("JsonEntityStore",w)}return s.get("JsonEntityStore")}static fromMethod(e,r){return this.from(e,r,d.descriptorOf(e,r))}static get(e,r,s){return Le.from(d.prototypeOf(e),r,s)}isGetterOnly(){return d.isObject(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,r){return this.store.get(e,r)}set(e,r){return this.store.set(e,r)}toString(){return[this.targetName,this.propertyName,this.index].filter(e=>e!==void 0).join(":")}buildType(e){d.isCollection(e)?this.collectionType=e:(this._type=e,this._type&&d.isPlainObject(this._type)&&(this._type=String))}set path(e){this.store.set("path",e)}get path(){return this.store.get("path")}getBestType(){return this.itemSchema.hasDiscriminator?this.itemSchema.discriminator().base:d.isClassObject(this.type)?this.itemSchema.getTarget():d.isArrowFn(this.type)?this.type():this.type}}function mr(t){return e=>{Ar.set(t,e)}}var _t={exports:{}},ws=_t.exports,cr;function is(){return cr||(cr=1,function(t,e){(function(r,s){s(e)})(ws,function(r){var s=Nt=>{throw TypeError(Nt)},f=(Nt,Ge,Ue)=>Ge.has(Nt)||s("Cannot "+Ue),h=(Nt,Ge,Ue)=>(f(Nt,Ge,"read from private field"),Ue?Ue.call(Nt):Ge.get(Nt)),w=(Nt,Ge,Ue)=>Ge.has(Nt)?s("Cannot add the same private member more than once"):Ge instanceof WeakSet?Ge.add(Nt):Ge.set(Nt,Ue),k;function F(Nt,Ge){return!Nt||!Ge.ref||Nt&&Ge.ref===Nt}class V{constructor(){w(this,k,new Map)}has(Ge){var Ue;return!!((Ue=h(this,k).get(Ge))!=null&&Ue.length)}on(Ge,Ue,Ot){let ot=Ue;Ot||(Ot=ot,ot=void 0);const it=h(this,k).get(Ge)||[];return it.push({cb:Ot,ref:ot}),h(this,k).set(Ge,it),this}once(Ge,Ue,Ot){Ot||(Ot=Ue);const ot=(...it)=>{Ot(...it),this.off(Ge,ot)};return this.on(Ge,Ue,ot),this}off(Ge,Ue){const Ot=(ot,it)=>{it.length?h(this,k).set(ot,it):h(this,k).delete(ot)};if(typeof Ge=="string"&&Ue){let ot=h(this,k).get(Ge);ot&&Ot(Ge,ot.filter(it=>it.cb!==Ue))}else{const ot=Ge;h(this,k).forEach((it,Hr)=>{Ot(Hr,it.filter(fi=>fi.ref!==ot))})}return this}emit(Ge,Ue,Ot){Array.isArray(Ue)&&(Ot=Ue,Ue=void 0),Ot||(Ot=[]);const ot=h(this,k).get(Ge);if(ot!=null&&ot.length)for(const it of ot)F(Ue,it)&&it.cb.apply(null,Ot)}async asyncEmit(Ge,Ue,Ot){Array.isArray(Ue)&&(Ot=Ue,Ue=void 0);const ot=h(this,k).get(Ge);if(ot!=null&&ot.length){const it=ot.filter(Hr=>F(Ue,Hr)).map(Hr=>Hr.cb.apply(null,Ot));await Promise.all(it)}}alter(Ge,Ue,Ot=[],ot=null){const it=h(this,k).get(Ge);if(it!=null&&it.length)for(const{cb:Hr}of it)Ue=Hr.call(ot,Ue,...Ot);return Ue}async asyncAlter(Ge,Ue,Ot=[],ot=null){const it=h(this,k).get(Ge);if(it!=null&&it.length)for(const Hr of it)Ue=await Hr.cb.call(ot,Ue,...Ot);return Ue}destroy(){h(this,k).clear()}}k=new WeakMap;const te=new V,we=te.on.bind(te),ft=te.once.bind(te),Sr=te.off.bind(te),et=te.emit.bind(te),rs=te.asyncEmit.bind(te),Ss=te.alter.bind(te),Us=te.asyncAlter.bind(te);r.$alter=Ss,r.$asyncAlter=Us,r.$asyncEmit=rs,r.$emit=et,r.$off=Sr,r.$on=we,r.$once=ft,r.Hooks=V,r.hooks=te,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})})}(_t,_t.exports)),_t.exports}var wr=is();const $r=new Map;function as(t){return d.isPromise(t)||t===Function?Object:d.isClass(t)||d.isSymbol(t)||d.isPrimitiveOrPrimitiveClass(t)||d.isClassObject(t)||d.isDate(t)||d.isCollection(t)?d.classOf(t):d.isArrowFn(t)?t():t}const dn=["string","number","integer","boolean","object","array","null","any"];function yr(t){return t===null?"null":d.isPrimitiveOrPrimitiveClass(t)?dn.indexOf(t)>-1?t:typeof t=="string"?t==="file"?"file":"generic":d.primitiveOf(t):t===Array?"array":d.isArray(t)?t.map(yr):t===Set?"array":d.isDate(t)||d.isBuffer(t)?"string":"object"}const mn=t=>d.isObject(t)&&t!==null?Object.entries(t).reduce((e,[r,s])=>isNaN(+r)?e.concat(s):e,[]):t;function cs(t){const e=t.reduce((f,h)=>f.concat(mn(h)),[]),r=f=>f===null?"null":typeof f,s=e.reduce((f,h)=>f.add(r(h)),new Set);return{values:d.uniq(e),types:s}}function gr(t){return String(t).replace(/^(\/)(.*)(\/)$/,"$2")}class Ur{constructor({base:e,propertyName:r,types:s,values:f}={}){this.values=new Map,this.types=new Map,Object.assign(this,d.cleanObject({base:e,propertyName:r,types:s?new Map(s):void 0,values:f?new Map(f):void 0}))}add(e,r){return r.forEach(s=>{this.values.set(s,e)}),this.types.set(e,r),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const r=this.types.get(e);return r?r[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function Lr(t){return t instanceof Et?t:Object.entries(t).reduce((e,[r,s])=>(e[gr(r)]=Qt(s),e),{})}function Qt(t){return d.isArray(t)?t.map(Qt):t.isStore||t.$isJsonDocument||t.isLazyRef?t:d.classOf(t)!==Object&&d.isClass(t)?Le.from(t).schema:d.isObject(t)?Et.from(t):d.isPrimitiveClass(t)?Et.from({type:t}):t}const us=class Gs extends Map{constructor(e={}){super(),rt(this,ht),rt(this,Ye),rt(this,nt),rt(this,Be),rt(this,dt),rt(this,$t),rt(this,at),rt(this,Ut),rt(this,Vt),rt(this,Lt),this.$kind="schema",this.$isJsonDocument=!0,this.$hooks=new wr.Hooks,this.$required=new Set,this.$allow=[],this.$forwardGroups=!1,this.$ignore=!1,this.isDiscriminatorKey=!1,this.isDiscriminator=!1,me(this,ht,!1),me(this,Ye,null),me(this,Be,[]),me(this,dt,new Map),me(this,Ut,!1),me(this,Vt,!1),me(this,Lt,!1),e&&this.assign(e)}get alias(){return Z(this,dt)}get nestedGenerics(){return Z(this,Be)}set nestedGenerics(e){me(this,Be,e)}get genericLabels(){return Z(this,nt)}set genericLabels(e){me(this,nt,e)}get isClass(){return d.isClass(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes(Z(this,at))}get isCollection(){return Z(this,Vt)}get isGeneric(){return Z(this,Ut)}get discriminatorAncestor(){const e=d.ancestorsOf(Z(this,at)).find(r=>Le.from(r).schema.isDiscriminator);return e&&Le.from(e).schema}get hasGenerics(){return!!(this.nestedGenerics&&this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return Z(this,Lt)}get isNullable(){return Z(this,ht)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!Z(this,Ye)}static from(e={}){return new Gs(e)}nullable(e){me(this,ht,e)}itemSchema(e={}){return me(this,$t,Z(this,$t)||Qt(e)),Z(this,$t).assign(e),Z(this,$t)}getAliasOf(e){return Z(this,dt).get(e)}addAlias(e,r){return Z(this,dt).set(e,r),Z(this,dt).set(r,e),this}removeAlias(e){const r=Z(this,dt).get(e);return r&&Z(this,dt).delete(r),Z(this,dt).delete(e),this}$id(e){return super.set("$id",e),this}$ref(e){return super.set("$ref",e),this}$schema(e){return super.set("$schema",e),this}label(e){return me(this,Lt,!0),super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){return typeof e!="boolean"&&this.$hooks.on("ignore",e),this.$ignore=e,this}default(e){return super.set("default",e),this}const(e){return super.set("const",e),this}description(e){return super.set("description",e),this}discriminator(){return this.isDiscriminator=!0,me(this,Ye,Z(this,Ye)||new Ur({base:Z(this,at)}))}discriminatorKey(e){return this.discriminator().propertyName=e,this.isDiscriminator=!0,this}discriminatorValue(...e){const r=this.discriminatorAncestor.discriminator();r.add(Z(this,at),e),this.isDiscriminator=!0;const s=this.get("properties"),f=s[r.propertyName]||new Gs({type:"string"});return e.length===1?(f.const(e[0]),f.examples([e[0]])):(f.enum(...e),f.examples(e)),s[r.propertyName]=f,this.set("properties",s),this}additionalItems(e){return super.set("additionalItems",Qt(e)),this}contains(e){return super.set("contains",Qt(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",me(this,$t,Qt(e))),this}maxItems(e){return super.set("maxItems",e),this}minItems(e){return super.set("minItems",e),this}uniqueItems(e){return super.set("uniqueItems",e),this}maxProperties(e){return super.set("maxProperties",e),this}minProperties(e){return super.set("minProperties",e),this}allow(...e){return[].concat(this.getJsonType()).includes("string")&&!this.has("minLength")&&this.minLength(1),e.forEach(r=>{switch(r){case"":this.set("minLength",void 0);break;case null:this.any(...["null"].concat(this.getJsonType(),this.$allow.map(s=>typeof s)));break}}),this.$allow.push(...e),this}required(e=!0){if(d.isArray(e))this.$required.clear(),e.forEach(r=>this.$required.add(r));else{const r=this.clone();return r.$selfRequired=e,[].concat(r.getJsonType()).includes("string")&&r.minLength(1),r}return this}addRequired(e){return this.$required.add(e),this}removeRequired(e){return this.$required.delete(e),this}isRequired(e){return this.$required.has(e)}properties(e){return super.set("properties",Lr(e)),this}addProperty(e,r){const s=this.get("properties")||{};return s[e]=r,super.set("properties",Lr(s)),this}patternProperties(e){return super.set("patternProperties",Lr(e)),this}additionalProperties(e){return super.set("additionalProperties",Qt(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",Lr(e)),this}propertyNames(e){return super.set("propertyNames",Qt(e)),this}enum(e,...r){if($r.has(e))return this.enum($r.get(e));if(e instanceof Gs)e.getName()?super.set("enum",e):super.set("enum",e.get("enum")).any(...e.get("enum").map(s=>typeof s));else{const{values:s,types:f}=cs([e,r].flat());super.set("enum",s).any(...f)}return this}definitions(e){return super.set("definitions",Lr(e)),this}allOf(e){return this.setManyOf("allOf",e),this}anyOf(e){return this.setManyOf("anyOf",e),this}oneOf(e){return this.setManyOf("oneOf",e),this}not(e){return super.set("not",Qt(e)),this}multipleOf(e){return super.set("multipleOf",e),this}maximum(e){return super.set("maximum",e),this}exclusiveMaximum(e){return super.set("exclusiveMaximum",e),this}minimum(e){return super.set("minimum",e),this}exclusiveMinimum(e){return super.set("exclusiveMinimum",e),this}maxLength(e){return super.set("maxLength",e),this}minLength(e){return super.set("minLength",e),this}pattern(e){return super.set("pattern",gr(e)),this}format(e){return super.set("format",e),this}type(e){switch(e){case"map":case Map:super.set("type",yr(e)),me(this,at,e),me(this,Vt,!0),this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case"array":case Array:super.set("type",yr(e)),me(this,at,e),me(this,Vt,!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"set":case Set:super.set("type",yr(e)),me(this,at,e),me(this,Vt,!0),this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":this.integer();break;case"number":case"string":case"boolean":case"object":case Object:case Date:case Boolean:case Number:case String:super.set("type",yr(e)),me(this,at,e),this.has("properties")||super.set("properties",{});break;default:if(d.isClass(e)||d.isFunction(e))super.set("type",void 0),me(this,at,e),this.has("properties")||super.set("properties",{});else{const r=yr(e);r==="generic"?(me(this,Ut,!0),super.set("$ref",e)):super.set("type",r)}}return this}any(...e){var r;return e=e.length?e:["integer","number","string","boolean","array","object","null"],e=d.uniq(e).map(s=>d.isClass(s)?s:{type:yr(s)}),e.length>1?this.anyOf(e):this.type(((r=e[0])==null?void 0:r.type)||e[0]),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(e){return super.set("title",e),this}readOnly(e){return super.set("readOnly",e),this}writeOnly(e){return super.set("writeOnly",e),this}customKey(e,r){return super.set(`#${e}`,r),this}toObject(e){return this.toJSON(e)}toJSON(e){return G("schema",[this],e)}assign(e={}){return(e instanceof Gs?[...e.entries()]:Object.entries(e)).forEach(([r,s])=>{this.set(r,s)}),e instanceof Gs&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),e.$required.forEach(r=>{this.$required.add(r)}),me(this,Ye,Z(this,Ye)?new Ur(Z(this,Ye)):null),this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,me(this,Lt,Z(e,Lt)),me(this,dt,new Map(Z(this,dt).entries())),Z(e,nt)&&me(this,nt,[...Z(e,nt)]),me(this,Be,Z(e,Be).map(r=>[...r])),me(this,at,Z(e,at)),me(this,Ut,Z(e,Ut)),me(this,Vt,Z(e,Vt)),me(this,Lt,Z(e,Lt)),me(this,ht,Z(e,ht)),super.set("type",e.get("type"))),this}set(e,r){return e in this?d.isFunction(this[e])&&this[e](r):super.set(e,r),this}getComputedType(){return as(Z(this,at))}getComputedItemType(){return Z(this,$t)?Z(this,$t).getComputedType():this.getComputedType()}getJsonType(){return this.get("anyOf")?this.get("anyOf").map(e=>e.getJsonType()):this.get("type")||yr(this.getComputedType())}getTarget(){return Z(this,at)}getName(){return this.get("name")||(d.isClass(Z(this,at))?d.nameOf(d.classOf(this.getComputedType())):"")}clone(){return new Gs(this)}setManyOf(e,r){let s=r.filter(h=>(h==null?void 0:h.type)==="null"?(this.nullable(!0),!1):!0).map(Qt);if(s.length===1&&!(r[0]instanceof Gs)&&!this.isNullable){if(!s[0].hasDiscriminator)return this.type(r[0]);const h=s[0].discriminator().children();if(!h.length)return this.type(r[0]);s=h.map(Qt)}super.set(e,s);const f=s[0];if(f.isDiscriminator){const h=f.discriminatorAncestor.discriminator(),{propertyName:w}=h;super.set("discriminator",{propertyName:w,mapping:s.reduce((k,F)=>{var V;return(V=h.types.get(F.getTarget()))==null||V.forEach(te=>{k[te]=F}),k},{})}),this.isDiscriminator=!0,me(this,Ye,h)}}};ht=new WeakMap,Ye=new WeakMap,nt=new WeakMap,Be=new WeakMap,dt=new WeakMap,$t=new WeakMap,at=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Lt=new WeakMap;let Et=us;var Yr=(t,e,r,s)=>{for(var f=e,h=t.length-1,w;h>=0;h--)(w=t[h])&&(f=w(f)||f);return f};n.JsonClassStore=class extends Le{constructor(){super(...arguments),this.children=new Map}get path(){return this.store.get("path","/")}set path(t){this.store.set("path",t)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=Et.from({type:this.type})}},n.JsonClassStore=Yr([mr(d.DecoratorTypes.CLASS)],n.JsonClassStore);const yn=t=>Number(t)&&200<=Number(t)&&Number(t)<300,Xr=t=>Number(t)&&300<=Number(t)&&Number(t)<400;class Ft extends Map{constructor(e={}){super(),this.$kind="map",this.$isJsonDocument=!0,this.assign(e)}assign(e={}){return Object.entries(e).forEach(([r,s])=>{d.isFunction(this[r])?this[r](s):this.set(r,s)}),this}toJSON(e){return G("map",[this],e)}}function Dn(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];let f=typeof s,h={example:s};return f==="object"&&(h=s,h.example=h.value===void 0?h.example:h.value,delete h.value,f=typeof h.example),h.type=h.type||f,e[r]=d.cleanObject(h),e},{})}function Ze(t,e=Ft){return Object.entries(t).reduce((r,[s,f])=>(r.set(s,new e(f)),r),new Ft)}class Zr extends Ft{constructor(){super(...arguments),this.$kind="operationMedia",this.groups=[]}schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}}class gn extends Ft{constructor(e={}){super(e),this.$kind="operationResponse",this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",Dn(e)),this}content(e){return this.set("content",Ze(e,Zr)),this}getContent(){return this.get("content")}getMedia(e,r=!0){var s;return r&&this.addMedia(e),(s=this.getContent())==null?void 0:s.get(e)}addMedia(e){const r=this.get("content");return r.has(e)||r.set(e,new Zr),this}isBinary(){return this.getContent().has("application/octet-stream")}}class Fr extends Ft{constructor(e,r){super(),this.method=e,this.path=r}summary(e){return super.set("summary",e),this}description(e){return super.set("description",e),this}}class ct extends Ft{constructor(e={}){super({parameters:[],responses:new Ft,...e}),rt(this,ir),rt(this,Zt),this.$kind="operation",this.operationPaths=new Map,me(this,Zt,!1)}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return Z(this,ir)}tags(e){return super.set("tags",e),this}addTags(e){return e=d.uniqBy([...this.get("tags")||[],...e],"name"),this.tags(e)}summary(e){return super.set("summary",e),this}operationId(e){return this.set("operationId",e),this}responses(e){return this.set("responses",e),this}defaultStatus(e){return me(this,ir,e),this}getStatus(){return Z(this,ir)||200}setRedirection(e=302){return me(this,Zt,!0),me(this,ir,e),this}isRedirection(e){return Z(this,Zt)&&e?Xr(e):Z(this,Zt)}addResponse(e,r){if((yn(e)||Xr(e))&&!Z(this,ir)){const h=this.getResponseOf(200);this.getResponses().set(e.toString(),h).delete("200"),this.defaultStatus(Number(e))}const s=e==="default"?this.getStatus().toString():e.toString(),f=this.getResponses().get(s);return f?(r.forEach((h,w)=>{["content"].includes(w)||f.set(w,d.deepMerge(f.get(w),h))}),f.status=Number(s)):(r.status=Number(s),this.getResponses().set(s,r)),this}getResponses(){return this.get("responses")}getResponseOf(e){return(e==="default"?this.response:this.getResponses().get(String(e)))||new gn}ensureResponseOf(e){return this.addResponse(e,this.getResponseOf(e)),this.getResponseOf(e)}getHeadersOf(e){return this.getResponseOf(e).get("headers")||{}}getContentTypeOf(e){return[...this.getResponseOf(e).get("content").keys()].slice(-1)[0]}security(e){return this.set("security",e),this}addSecurityScopes(e,r){const s=this.get("security")||{};return s[e]=d.uniq([...s[e]||[],...r]),this.security(s)}description(e){return super.set("description",e),this}deprecated(e){return super.set("deprecated",e),this}parameters(e){return super.set("parameters",e),this}addParameter(e,r){e===-1&&(e=this.get("parameters").length),this.get("parameters")[e]=r}consumes(e){return super.set("consumes",e),this}produces(e){return super.set("produces",e),this}addProduce(e){const r=d.uniq([].concat(this.get("produces"),e)).filter(Boolean);this.set("produces",r)}addOperationPath(e,r){const s=new Fr(e,r);return this.operationPaths.set(String(e)+String(r),s),s}getAllowedOperationPath(e){return e?[...this.operationPaths.values()].filter(({method:r})=>r&&e.includes(r.toUpperCase())):[...this.operationPaths.values()]}}ir=new WeakMap,Zt=new WeakMap;var Tr=(t,e,r,s)=>{for(var f=e,h=t.length-1,w;h>=0;h--)(w=t[h])&&(f=w(f)||f);return f};n.JsonMethodStore=class extends Le{constructor(t){super({store:d.Store.fromMethod(t.target,t.propertyKey),descriptor:d.descriptorOf(t.target,t.propertyKey),...t}),this.parent=Le.from(this.target),this.middlewares=[],this.beforeMiddlewares=[],this.afterMiddlewares=[],this.operation=new ct,this.children=new Map;const{beforeMiddlewares:e=[],middlewares:r=[],afterMiddlewares:s=[]}=t;this.after(s),this.before(e),this.use(r)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(t){this.store.set("view",t)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(t){this.store.set("acceptMimes",t)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(t,e,r){return r=r||d.descriptorOf(d.prototypeOf(t),e),Le.from(d.prototypeOf(t),e,r)}getResponseOptions(t,{contentType:e="application/json",includes:r}={}){var s;const f=this.operation.getResponseOf(t).getMedia(e,!1);if(f&&f.has("schema")){const h=f.get("schema");let w=f.groups;return r&&(s=f.allowedGroups)!=null&&s.size&&(w=[...w||[],...r.filter(k=>f.allowedGroups.has(k))]),{type:h.getComputedItemType(),groups:w}}return{type:this.type}}before(t){return this.beforeMiddlewares=this.beforeMiddlewares.concat(t).filter(d.isFunction),this}after(t){return this.afterMiddlewares=this.afterMiddlewares.concat(t).filter(d.isFunction),this}use(t){return this.middlewares=this.middlewares.concat(t).filter(d.isFunction),this}get(t){const e=d.Store.from(this.target).get(t);return d.deepMerge(e,this.store.get(t))}getParamTypes(){return[...this.children.values()].reduce((t,e)=>({...t,[e.paramType]:!0}),{})}build(){if(!this._type){let t=d.Metadata.getReturnType(this.target,this.propertyKey);t=d.isPromise(t)?void 0:t,this.buildType(t)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),d.isCollection(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=Et.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}},n.JsonMethodStore=Tr([mr(d.DecoratorTypes.METHOD)],n.JsonMethodStore);const fs=n.JsonMethodStore;var kt=(t=>(t.BODY="body",t.PATH="path",t.QUERY="query",t.HEADER="header",t.COOKIES="cookie",t.FILES="files",t))(kt||{});function Qr(t){return String(t).toLowerCase().replace("raw_","").replace("cookies","cookie")}function en(t){return Object.values(kt).includes(Qr(t))}class vr extends Ft{constructor(){super(...arguments),this.$kind="operationInParameter",this.nestedGenerics=[],this.$schema=new Et}getName(){const e=this.get("name");return this.get("in")==="files"?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,r=""){return this.set("in",Qr(e)),this.expression=r,this}required(e){return this.set("required",e),this}schema(e){return e?(this.$schema=e,this):this.$schema}itemSchema(e){return this.$schema.isCollection?(e&&this.$schema.itemSchema(e),this.$schema.itemSchema()):(e&&this.schema(e),this.schema())}toJSON(e){return G("operationInParameter",[this],e)}}var tn=(t,e,r,s)=>{for(var f=e,h=t.length-1,w;h>=0;h--)(w=t[h])&&(f=w(f)||f);return f};n.JsonParameterStore=class extends Le{constructor(t){super(t),this.parameter=new vr,this.parent=Le.fromMethod(this.target,this.propertyKey),this.pipes=t.pipes||[],this.paramType=t.paramType||this.paramType,this.expression=t.expression||this.expression,this.dataPath=t.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(t){this.parameter.nestedGenerics=t}get required(){return!!this.parameter.get("required")}set required(t){this.parameter.required(t)}get allowedRequiredValues(){return this.schema.$allow}get schema(){return this.parameter.$schema}static getParams(t,e){const r=[],s=d.ancestorsOf(t).reverse().find(f=>d.isMethodDescriptor(f,e)&&Le.fromMethod(f,e).children.size);return s?(Le.fromMethod(s,e).children.forEach((f,h)=>{r[+h]=f}),r):[]}static get(t,e,r){return Le.from(d.prototypeOf(t),e,r)}isRequired(t){return this.required&&[void 0,null,""].includes(t)&&!this.allowedRequiredValues.includes(t)}build(){if(!this._type){const t=d.Metadata.getParamTypes(d.prototypeOf(this.target),this.propertyKey)[this.index];this.buildType(t)}this._type=this._type||Object,this.parent.children.set(this.index,this),this.parent.operation.addParameter(this.index,this.parameter),this.collectionType&&this.parameter.schema().type(this.collectionType),d.isClass(this._type)?this.parameter.itemSchema(Le.from(this._type).schema):this.parameter.itemSchema().type(this._type)}},n.JsonParameterStore=tn([mr(d.DecoratorTypes.PARAM)],n.JsonParameterStore);const Rr=n.JsonParameterStore;var In=(t,e,r,s)=>{for(var f=e,h=t.length-1,w;h>=0;h--)(w=t[h])&&(f=w(f)||f);return f};n.JsonPropertyStore=class extends Le{constructor(){super(...arguments),this.parent=Le.from(this.target)}get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(t){t?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(t){return this.required&&[void 0,null,""].includes(t)&&!this.allowedRequiredValues.includes(t)}build(){this._type||this.buildType(d.Metadata.getType(d.prototypeOf(this.target),this.propertyKey)),this._type=this._type||Object;let t=this.parent.schema.get("properties")[this.propertyName];t||(this.parent.children.set(this.propertyName,this),t=Et.from({type:this.collectionType||this.type}),this.collectionType&&t.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}static get(t,e){return Le.from(d.prototypeOf(t),e)}},n.JsonPropertyStore=In([mr(d.DecoratorTypes.PROP)],n.JsonPropertyStore);const Nn=n.JsonPropertyStore;Ar.set(d.DecoratorTypes.CLASS,n.JsonClassStore),Ar.set(d.DecoratorTypes.PROP,n.JsonPropertyStore),Ar.set(d.DecoratorTypes.PARAM,n.JsonParameterStore),Ar.set(d.DecoratorTypes.METHOD,n.JsonMethodStore);function Rt(...t){return Le.from(...t)}class ps extends Map{constructor(){super(...arguments),this.$kind="operationPaths",this.$isJsonDocument=!0,this.getKey=(e,r)=>`${e}-${r}`}setOperationPath(e){const r=this.getKey(e.method,e.path);this.set(r,e)}}function xr(t){const e=t.isStore?t:Rt(t);return e.$inherited||(e.$inherited=d.ancestorsOf(e.target).reverse().reduce((r,s)=>r.set(s,Rt(s)),new Map)),e.$inherited}function Br(t){const e=t.isStore?t:Rt(t);if(!e.$operations){const r=new ps;e.$operations=new Map,xr(e).forEach(s=>{s.children.forEach(f=>{f instanceof n.JsonMethodStore&&!e.$operations.has(f.propertyKey)&&e.$operations.set(f.propertyKey,f)})}),e.$operations.forEach(s=>{s.operation.operationPaths.forEach(f=>{r.setOperationPath(f)})}),r.clear()}return e.$operations}function $n(t){return!t.store.get("hidden")}const St=[$e.PUBLISH,$e.SUBSCRIBE];function Ts(t){return(e,{operationPath:r,operationStore:s})=>{var f,h,w,k;const F=t.ctrlRootPath||"/",V=r.method.toLowerCase(),te=Ee.camelCase(`${V.toLowerCase()} ${s.parent.schema.getName()}`),we=G("message",[s,r],t);return{...e,[F]:{...e[F],[V]:{...(f=e[F])==null?void 0:f[V],operationId:te,message:{oneOf:[...((k=(w=(h=e[F])==null?void 0:h[V])==null?void 0:w.message)==null?void 0:k.oneOf)||[],we]}}}}}}function vn(t){return e=>{const r=e.operation.getAllowedOperationPath(St);return r.length===0?[]:r.map(s=>({operationPath:s,operationStore:e}))}}function On(t,{channels:e,rootPath:r,...s}){const f=Rt(t).path,h=dr(r+f);return s={...s,ctrlRootPath:h},[...Br(t).values()].filter($n).flatMap(vn()).reduce(Ts(s),e)}le("channels",On);var Re=(t=>(t.JSON="jsonschema",t.SWAGGER="swagger2",t.OPENAPI="openapi3",t.ASYNCAPI="asyncapi2",t))(Re||{});function Wt(t,e){var r;const s={channels:G("channels",[t],e)};return s.tags=d.uniqBy(e.tags,"name"),(r=e.components)!=null&&r.schemas&&Object.keys(e.components.schemas).length&&(s.components={...e.components,schemas:e.components.schemas}),s}le("generate",Wt,Re.ASYNCAPI);function xt(t,e){return e.length?e.length===1?e[0]:{[t]:e}:null}function Or(t,e,{tags:r=[],defaultTags:s=[],...f}={}){const{path:h,method:w}=e,k=String(h);let F=d.getValue(f.components,"messages."+h,d.cleanObject({description:t.operation.get("description"),summary:t.operation.get("summary")}));if(w.toUpperCase()===$e.PUBLISH){const V=G("payload",[t,e],f);V&&(F.payload=V);const te=t.operation.getAllowedOperationPath([$e.SUBSCRIBE]).map(ft=>G("message",[t,ft],f)).filter(Boolean),we=xt("oneOf",te);we&&(F["x-response"]=we)}else{const V=G("response",[t,e],f);V&&(F["x-response"]=V)}return f.components.messages=f.components.messages||{},f.components.messages[k]=F,{$ref:`#/components/messages/${k}`}}le("message",Or,Re.ASYNCAPI);function yt(t,e){return t.reduce((r,s,f)=>r.set(s,e[f]),new Map)}function Pr(t){if(t.genericLabels&&t.genericTypes){const{genericLabels:e,genericTypes:r,...s}=t;return{...s,generics:yt(e,r)}}return t}function Ht(t){const[e,...r]=t.nestedGenerics;return{genericTypes:e,nestedGenerics:r}}function Sn(t,e={}){return{...e,groups:t.groups,groupsName:t.groupsName}}function Ps(t,e){return t.get("parameters").filter(r=>en(r.get("in")))}function bn(t,e,r){const s=Ps(t.operation),f=Ee.pascalCase([e.path,e.method,"Payload"].join(" "));d.setValue(r,`components.schemas.${f}`,{});const h=s.map(w=>{const k=Sn(w,r),F=G("item",[w.$schema],{...k,...Ht(w)});switch(w.get("in")){case kt.BODY:return F;case kt.QUERY:case kt.PATH:case kt.HEADER:return{type:"object",properties:{[w.get("name")]:F}}}return F},{}).filter(Boolean);return xt("allOf",h)}le("payload",bn,Re.ASYNCAPI);function Es(t,e,r){const s=t.operation.getResponses(),f=[],h=[],w=[],k=[];[...s.entries()].forEach(([ft,Sr])=>{const et=G("map",[Sr],r);if(f.push(+ft),h.push(et.description),+ft!=204){const{content:rs}=et,Ss=rs[Object.keys(rs)[0]];w.push(Ss)}});const F=Ee.pascalCase([e.path,e.method,"Response"].join(" ")),V={type:"object",properties:{status:{type:"number",enum:f},statusText:{type:"string",enum:h}},required:["status"]},te=xt("oneOf",w);te&&d.setValue(V,"properties.data",te);const we=xt("oneOf",k);return k.length&&d.setValue(V,"properties.error",we),d.setValue(r,`components.schemas.${F}`,V),{$ref:`#/components/schemas/${F}`}}le("response",Es,Re.ASYNCAPI);class wn{constructor(e){this.getType=e,this.isLazyRef=!0}get target(){return this.getType()}get schema(){return Rt(this.getType()).schema}get name(){return d.nameOf(this.getType())}}function ls(t){const{host:e=`#/${[Re.OPENAPI,Re.ASYNCAPI].includes(t.specType)?"components/schemas":"definitions"}`}=t;return e}function qr(t,e){return e.groups&&e.groups.length?Ee.pascalCase(`${t} ${e.groupsName||e.groups.join(" ")}`):t}function Tn(t,e,r){const s={$ref:`${ls(r)}/${t}`},f=e.isReadOnly,h=e.isWriteOnly;return d.cleanObject({readOnly:f?!0:void 0,writeOnly:h?!0:void 0,...f||h?{anyOf:[s]}:s})}function rn(t,e,r){const s=qr(t.getName(),r);return e&&d.setValue(r,`components.schemas.${s}`,e),Tn(s,t,r)}function Un(t,e={}){if(typeof t!="object"||t===null)return t;if(t instanceof wn)return G("lazyRef",[t],e);if(t instanceof Et&&t.get("enum")instanceof Et){const r=t.get("enum");return rn(r,r.toJSON(e),e)}if(t.$kind&&t.$isJsonDocument){const r=br([t.$kind,"map"],e),s=G(r,[t],Pr(e));return t.canRef?rn(t,s,e):s}return G("object",[t],e)}le("any",Un);function Gr(t,e){const r=Le.from(t.class),s=qr(r.schema.getName()||t.getName(),e);if(t.hasGenerics){const{type:f,properties:h,additionalProperties:w,items:k,...F}=t.toJSON(e),V={...G("any",[r.schema],{...e,...Ht(t),root:!1}),...F};if(V.title){const te=qr(V.title,e);return d.setValue(e.components,`schemas.${te}`,V),delete V.title,Tn(te,t,e)}return V}return d.getValue(e,`components.schemas.${s}`)||(d.setValue(e,`components.schemas.${s}`,{}),e.components.schemas[s]=G("any",[r.schema],Pr({...e,root:!1}))),Tn(s,t,e)}le("class",Gr);function Pn(t,e,r){var s;if((s=t.discriminator)!=null&&s.mapping){const f=Object.entries(t.discriminator.mapping),h={};for(const[w,k]of f)h[w]=d.isString(k)?k:rn(k,null,r).$ref;t.discriminator.mapping=h}return t}function Ln(t){var e;return(e=t.discriminator)!=null&&e.mapping&&delete t.discriminator.mapping,t}le("discriminatorMapping",Ln);function Kr(t,e,r){var s;return r.inlineEnums&&(s=t.enum)!=null&&s.$isJsonDocument&&(t.enum=t.enum.toJSON().enum),t.enum&&(t.type=t.type==="object"||t.type===void 0?"string":t.type),t}le("enums",Kr);function Fn(t,e){const{generics:r}=e;if(r&&t.$ref&&r.has(t.$ref)){let s=r.get(t.$ref);if(d.isPrimitiveClass(s))return{type:yr(s)};if(s===Date)return{type:"string",format:"date-time"};if(s.toJSON)return s.toJSON({...e,generics:void 0});if(s===Object)return{type:"object"};if(d.isClass(s)){const f={class:s};if(e.nestedGenerics.length===0)return G("class",[f],{...e,generics:void 0});const h=Le.from(f.class);return G("schema",[h.schema],{...e,...Ht(e),root:!1})}}return t}le("generics",Fn);function Ms(t,e){if(e!=null&&e.type&&e!=null&&e.$ref){const{$ref:r,...s}=e;e={allOf:[{$ref:r},s]}}return e}function Bn(t,{target:e,...r}){const s=Array.from(xr(e).entries()).filter(([f])=>d.classOf(f)!==d.classOf(e));if(s.length){const f=s.reduce((h,[,w])=>d.deepMerge(h,G("schema",[w.schema],r),{alter:Ms}),{});return d.deepMerge(f,t,{alter:Ms})}return t}le("inheritedClass",Bn);function As(t,e){return t&&t.isClass?G("class",[t],e):G("any",[t],e)}le("item",As);function hs(t,e){var r;const s=t.name;if((r=e.$refs)!=null&&r.find(h=>h===t.target))return Tn(s,t.schema,e);e.$refs=[...e.$refs||[],t.target];const f=t.getType()&&G("schema",[t.schema],Pr(e));return rn(t.schema,f,e)}le("lazyRef",hs);function jr(t,{ignore:e=[],...r}={}){return r=Pr(r),Array.from(t.entries()).reduce((s,[f,h])=>(e.includes(f)||(s[f]=G("item",[h],r)),s),{})}le("map",jr);const En=["oneOf","allOf","anyOf"],Rs=["minLength","maxLength","pattern","format"],nn=[],qn=["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf"],gt=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains"],xs=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains","patternProperties","dependencies"],Gn=["const","enum"];function js(t,e){return e!=null&&e.isNullable&&(t.discriminator||(t.$ref?t=d.cleanObject({...t,$ref:void 0,anyOf:[{type:"null"},{$ref:t.$ref}]}):En.some(r=>{if(t[r])if(t[r]=t[r].filter(s=>s.type!=="null"),t[r].length===1){const s=t[r];t=d.cleanObject({...t,...s[0],[r]:void 0,type:["null",Number.isInteger(t.multipleOf)?"integer":s[0].type]})}else t[r]=[{type:"null"}].concat(t[r]).map(s=>(Number.isInteger(s.multipleOf)&&(s.type="integer"),s)),delete t.type}))),t}le("nullable",js);function Mn(t,e){var r,s;if(d.isBoolean(t.$ignore)&&t.$ignore)return!0;let f=(r=t==null?void 0:t.$hooks)==null?void 0:r.alter("ignore",!1,[e]);return f||(e.groups!==!1?(s=t==null?void 0:t.$hooks)==null?void 0:s.alter("groups",!1,[e.groups]):f)}function ds(t,e){const{specType:r,operationIdFormatter:s,root:f,components:h,genericTypes:w,nestedGenerics:k,useAlias:F,genericLabels:V,...te}=e;return Object.entries(t).reduce((we,[ft,Sr])=>{if(e.withIgnoredProps!==!1&&!Mn(Sr,te)){const et={...e,groups:t!=null&&t.$forwardGroups||Sr!=null&&Sr.$forwardGroups?e.groups:void 0};we[ft]=G("item",[Sr],et),we[ft]=G("nullable",[we[ft],Sr],et)}return we},d.isArray(t)?[]:{})}le("object",ds);function An(t,e,r){return t.map(s=>G("item",[s],{...e,genericLabels:r.genericLabels}))}le("anyOf",An),le("allOf",An),le("oneOf",An);function u(t,e,r){return t.isClass?G("class",[t],e):G("any",[t],{...e,genericLabels:r.genericLabels})}le("properties",u),le("items",u),le("additionalProperties",u),le("propertyNames",u),le("contains",u),le("dependencies",u),le("patternProperties",u),le("additionalItems",u),le("not",u),le("definitions",u);function m(t,e,r){var s;return r.groups!==!1?(s=e==null?void 0:e.$hooks)==null?void 0:s.alter("requiredGroups",t,[r.groups]):t}function S(t,e,r={}){const{useAlias:s}=r,f=Object.keys(t.properties||{});return(h,w)=>{const k=s&&e.alias.get(w)||w;return f.includes(k)?h.concat(k):h}}function P(t,e,r){let s=t.required||[];return s=[...s,...e.$required],e.get("properties")&&(s=Object.entries(e.get("properties")).reduce((f,[h,w])=>w&&w.$selfRequired!==void 0?w.$selfRequired?f.concat(h):f.filter(k=>k===h):f,s)),m(d.uniq(s),e,r)}function y(t,e,r){if(r.groups&&r.groups.includes("partial"))return t.discriminator?{...t,required:[t.discriminator.propertyName]}:t;let s=P(t,e,r);return s=d.uniq(s).reduce(S(t,e,r),[]),t.discriminator&&s.push(t.discriminator.propertyName),s.length&&(t.required=s),t}le("required",y);function l(t,e){return Object.entries(t).reduce((r,[s,f])=>(s=e.get(s)||s,r[s]=f,r),{})}function ne(t){return En.find(e=>t[e])}const xe={string:{properties:Rs,is:d.isString},number:{properties:qn,is:d.isNumber},boolean:{properties:nn,is:d.isBoolean},array:{properties:gt,is:()=>!1},object:{properties:xs,is:()=>!1}};function Te(t,e,r){const s=xe[t];s==null||s.properties.concat(Gn).forEach(f=>{e[f]!==void 0&&(Gn.includes(f)?r[f]=e[f].filter(s.is):(r[f]=e[f],delete e[f]))})}function _e(t,e,r){const s=ne(t);return s&&(t[s].forEach(f=>{Te(f.type,t,f)}),En.forEach(f=>{t[f]&&r.groups!==!1&&e.$hooks.has(f)&&(t={...t,[f]:e.$hooks.alter(f,t[f],[r.groups])})}),delete t.const,delete t.enum,t.items||t.properties||delete t.type),t}const Ve=["name","$required","$hooks","_nestedGenerics",Re.OPENAPI,Re.SWAGGER,Re.JSON],Mt=[];function ur(t,e){return typeof e=="object"&&["items","properties","additionalProperties"].includes(t)&&Object.keys(e).length===0}function er(t,e,r){return typeof e=="object"&&r&&["properties","additionalProperties"].includes(t)}function Er(t,{specType:e=Re.JSON,customKeys:r=!1}){return Ve.includes(t)||t.startsWith("#")&&(r===!1||e!==Re.JSON)||e!==Re.JSON&&Mt.includes(t)}function Bt(t,e,r){return t==="examples"&&d.isObject(e)&&[Re.OPENAPI,Re.ASYNCAPI].includes(r.specType)}function Jr(t){let e=!1;t||(e=!0,t={components:{schemas:{}},inlineEnums:!0});const{useAlias:r=!0,components:s={schemas:{}}}=t;return t={...t,useAlias:r,components:s},{addDef:e,options:t}}function st(t,e){const{useAlias:r}=e;return[...t.keys()].filter(s=>!Er(s,e)).reduce((s,f)=>{let h=t.get(f);if(f=f.replace(/^#/,""),f==="type")return s[f]=t.getJsonType(),s;if(Bt(f,h,e)&&(f="example",h=Object.values(h)[0]),h&&typeof h=="object"&&kn(f)){if(h=G(f,[h],e,t),ur(f,h))return s;er(f,h,r)&&(h=l(h,t.alias))}return s[f]=h,s},{})}function Kn(t,e){let r=st(t,e);return t.isClass&&(r=G("inheritedClass",[r],{...e,root:!1,target:t.getComputedType()})),r=G("generics",[r],{...e,root:!1}),t.has(e.specType)&&(r={...r,...t.get(e.specType).toJSON(e)}),d.isFunction(r.default)&&(r.default=r.default()),r=G("required",[r,t],e),r=G("nullable",[r,t],e),r=_e(r,t,e),r=G("enums",[r,t],e),r=G("discriminatorMapping",[r,t],e),r}function sn(t,e){const{options:r,addDef:s}=Jr(e),f=Kn(t,r);return s&&Object.keys(d.getValue(r,"components.schemas",{})).length&&(f.definitions=r.components.schemas),f}le("schema",sn),le("discriminatorMapping",Pn,Re.OPENAPI),le("discriminatorMapping",Pn,Re.SWAGGER),le("discriminatorMapping",Pn,Re.ASYNCAPI);function fr(t,e,r){return t=Kr(t,e,r),t.const&&(t.enum=[t.const],delete t.const),t}le("enums",fr,Re.OPENAPI),le("enums",fr,Re.SWAGGER),le("enums",fr,Re.ASYNCAPI);function Vr(t,e){e={...e,specType:Re.OPENAPI};const r={paths:G("paths",[t],e)};return r.tags=d.uniqBy(e.tags,"name"),Object.keys(d.getValue(e,"components.schemas",{})).length&&(r.components={schemas:e.components.schemas}),r}le("generate",Vr,Re.OPENAPI),le("generate",Vr,Re.SWAGGER);function on(t,e){var r,s,f,h;return e!=null&&e.isNullable?t.$ref?d.cleanObject({...t,...t.$ref&&{anyOf:[{$ref:t.$ref}],type:void 0},nullable:!0,$ref:void 0}):d.cleanObject({...t,...((r=t.anyOf)==null?void 0:r.length)===1?{...t.anyOf[0],anyOf:void 0,type:Number.isInteger(t.multipleOf)?"integer":(s=t.anyOf[0])==null?void 0:s.type}:{type:((f=t.anyOf)==null?void 0:f.length)>1?void 0:t.type,anyOf:(h=t.anyOf)==null?void 0:h.map(w=>(Number.isInteger(w.multipleOf)&&(w.type="integer"),w))},nullable:!0}):t}le("nullable",on,Re.OPENAPI),le("nullable",on,Re.SWAGGER);function Jn(t,{jsonSchema:e}){const r={type:"string",format:"binary",oneOf:void 0};return e.type==="array"?(e.items=d.cleanObject({...e.items,...r}),t.schema=e,t):(t.schema=d.cleanObject({...e,...r}),t)}le("operationInFiles",Jn);function Vn(t,e={}){return{...e,groups:t.groups,groupsName:t.groupsName}}function Wn(t,e){var r;const s=Vn(t,e),f={...((r=s.components)==null?void 0:r.schemas)||{}},{type:h,schema:w,...k}=G("map",[t],s),F=G("item",[t.$schema],{...s,...Ht(t)});k.required=k.required||t.get("in")===kt.PATH;const V={...s,jsonSchema:F,jsonParameter:t,oldSchemas:f},te=Ee.camelCase(`operationIn ${t.get("in")}`);return kn(te)?G(te,[k],V):(k.schema=F,k)}le("operationInParameter",Wn);function an(t,e){return t.flatMap(r=>G("operationInParameter",[r],e)).filter(Boolean)}le("operationInParameters",an);function cn(t,e){if(!e)return;let r=!1;const s=Object.entries(e).reduce((f,[h,{value:w,description:k,...F}])=>w[t]===void 0?f:(r=!0,{...f,[h]:{...F,value:w[t],description:k}}),{});return r?s:void 0}function Cs(t,{jsonParameter:e,...r}){var s,f,h;const w=qr(e.$schema.getName(),r),k=(f=(s=r.components)==null?void 0:s.schemas)==null?void 0:f[w];return k&&!((h=r.oldSchemas)!=null&&h[w])&&delete r.components.schemas[e.$schema.getName()],Object.entries((k==null?void 0:k.properties)||{}).reduce((F,[V,{description:te,...we}])=>[...F,d.cleanObject({...t,name:V,required:((k==null?void 0:k.required)||[]).includes(V),description:te,schema:we,style:we.$ref?"deepObject":void 0,examples:cn(V,t.examples)})],[])}function Hn(t,{jsonSchema:e,jsonParameters:r,...s}){if(e.$ref){if(!t.name)return Cs(t,s);t.style="deepObject"}return t.schema=e,t}le("operationInQuery",Hn);const un=tt.codes.reduce((t,e)=>{const r=String(tt(e));return{...t,[String(e)]:{label:r,code:Ee.constantCase(r)}}},{});un[200].label="Success",un[200].code="SUCCESS";function zn(t){var e;return(e=un[t])==null?void 0:e.code}function pr(t){var e;return(e=un[t])==null?void 0:e.label}function Yn(t,e){return t.get("parameters").filter(r=>en(r.get("in"))).reduce((r,s)=>{const[f,h]=r;return[kt.BODY,kt.FILES].includes(s.get("in"))?[f,[...h,s]]:[[...f,s],h]},[[],[]])}function Xn(t,{tags:e=[],defaultTags:r=[],...s}={}){var f,h;const{consumes:w,produces:k,...F}=G("map",[t],{...s,ignore:["parameters"]});F.security&&(F.security=[].concat(F.security)),t.get("responses").size===0&&(F.responses={200:{description:pr(200)}});const V={...s,consumes:(f=t.get("consumes"))!=null&&f.length?t.get("consumes"):["application/json"]},[te,we]=Yn(t);F.parameters=G("operationInParameters",[te],s),we.length&&(F.requestBody=G("operationRequestBody",[we],V));const ft=(h=F.tags)!=null&&h.length?F.tags:r;return ft.length&&(F.tags=ft.map(({name:Sr})=>Sr)),e.push(...ft),F}le("operation",Xn);function lr(t,e){let r=[...t.groups||[]];return G("map",[t],{...e,groups:r,groupsName:t.groupsName})}le("operationMedia",lr);class Zn extends Ft{constructor(e={}){super(e),this.$kind="operationRequestBody",this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",Ze(e)),this}addContent(e,r,s){const f=this.get("content"),h=new Ft;return h.set("schema",r),s&&h.set("examples",s),f.set(e,h),this}required(e){return this.set("required",e),this}}function Rn(t,e){let r=new Et;const s={},f=[];let h=0;const w=t.some(k=>k.get("in")==="files");return t.forEach(k=>{const F=k.getName();[...k.entries()].filter(([te])=>!["in","name"].includes(te)).forEach(([te,we])=>{s[te]===void 0&&(s[te]=we)});const V=G("operationInParameter",[k],e);if(F){const te={...V.schema||{type:V.type}};w&&V.description&&(te.description=V.description),r.addProperty(F,te),k.get("required")&&r.addRequired(F),h++}else f.push(V)}),!h&&f.length===1?f[0]:(r.type("object"),s.description&&w&&delete s.description,{schema:r.toJSON(e),required:!1,...s})}function xn(t,{consumes:e,...r}){const{schema:s,description:f,examples:h,in:w,...k}=Rn(t,r),F=new Zn(k);return f&&F.description(f),e.forEach(V=>{F.addContent(V,s,h)}),G("map",[F],r)}le("operationRequestBody",xn);function Oe(t,e={}){const r=G("map",[t],e);return t.status===204&&delete r.content,r.headers&&Object.entries(r.headers).forEach(([s,{type:f,...h}])=>{r.headers[s]={...h,schema:{type:f}}}),r}le("operationResponse",Oe);function Cr(t,e){return t.map(r=>e.parameters.find(s=>s.in===r.in&&s.name===r.name)||r).concat(...e.parameters.filter(r=>r.in!=="path"))}function _s(t){const[e,r]=t.split("="),s=(r||e).split("."),f=s.splice(0,1)[0];return{prefix:r&&e?`${e}=`:"",name:f,postfix:s.length?`.${s.join(".")}`:""}}function bt(t){let e=0;return t.split("").filter(r=>{r==="("&&e++;const s=e===0;return r===")"&&e--,s}).join("").split("/").filter(r=>!!r)}function ks(t,e=""){e instanceof RegExp&&(e=e.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const r=[],s=[];let f=!1,h="";return bt(`${t}${e}`).map(w=>{const k=w.replace(":","").replace("?","");if(w.includes(":")){const F=w.includes("?");F&&!f&&(f=!0,s.push({path:h,parameters:[].concat(r)}));const{prefix:V,name:te,postfix:we}=_s(k);h+=`/${V}{${te}}${we}`,r.push({in:"path",name:te,type:"string",required:!0}),F&&f&&s.push({path:h,parameters:[].concat(r)})}else h+=`/${w}`}),s.length?s:[{path:h,parameters:[].concat(r)}]}const jn="%c.%m";function tr(t=""){const e=new Map,r=(s,f)=>{const h=(t||jn).replace(/%c/,s).replace(/%m/,f);return t===""?Ee.camelCase(h):h};return(s,f,h="")=>{const w=r(s,f),k=s+f;if(!e.has(k))return e.set(k,0),w;const F=h.match(/{(\w+)}/gi);if(F){const te=s+f+F[0];if(!e.has(te))return e.set(te,0),Ee.camelCase(`${w} By ${F}`)}const V=e.get(k)+1;return e.set(k,V),`${w}_${V}`}}function ms(t,{store:e,operationIdFormatter:r}){return r(e.parent.schema.get("name")||e.parent.targetName,e.propertyName,t)}const zt=[$e.ALL,$e.GET,$e.POST,$e.PUT,$e.PATCH,$e.HEAD,$e.OPTIONS,$e.DELETE,$e.TRACE];function ys(t,{path:e,method:r,operation:s}){return{...t,[e]:{...t[e],[r.toLowerCase()]:s}}}function rr(t){return({operationPath:e,operation:r,operationStore:s})=>{const{path:f,method:h}=e;return ks(t.ctrlRootPath,f).map(({path:w,parameters:k})=>(w=w||"/",k=Cr(k.map(({type:F,...V})=>({...V,schema:{type:F}})),r),{operation:{...r,...e.toJSON(t),parameters:k,operationId:r.operationId||ms(w,{...t,store:s})},method:h,path:w}))}}function gs(t){return e=>{const r=e.operation.getAllowedOperationPath(zt);if(r.length===0)return[];const s=G("operation",[e.operation],t);return r.map(f=>({operationPath:f,operation:s,operationStore:e}))}}function Qn(t,{paths:e,rootPath:r,...s}){const f=Rt(t).path,h=dr(r+f);return s={...s,ctrlRootPath:h},[...Br(t).values()].filter($n).filter(w=>w.operation.getAllowedOperationPath(zt).length>0).flatMap(gs(s)).flatMap(rr(s)).reduce(ys,e)}le("paths",Qn);function ie(t){return(...e)=>{const r=t(Rt(...e),e);typeof r=="function"&&r(...e)}}function Ds(...t){return ie(e=>{e.store.set("childrenControllers",t),t.forEach(r=>{d.Store.from(r).set("parentController",e.token)})})}function i(t,...e){return ie(r=>{t=t||Ee.snakeCase(r.targetName),r.discriminatorAncestor&&r.schema.discriminatorValue(t,...e)})}function o(t,e){if(!t)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const r={};let s=!1;const f=(...h)=>{const w=Le.from(...h);e&&(w.collectionType=e,w.schema.type(e)),w.type=t,w.itemSchema.type(t),w.schema.assign(r),w.isArray&&s&&(w.schema.set("contains",w.schema.get("items")),w.schema.delete("items"))};return f.MinItems=h=>(r.minItems=h,f),f.MaxItems=h=>(r.maxItems=h,f),f.MinProperties=h=>(r.minProperties=h,f),f.MaxProperties=h=>(r.maxProperties=h,f),f.Contains=()=>(s=!0,f),f.UniqueItems=(h=!0)=>(r.uniqueItems=h,f),f}function p(t){return o(t,Array)}function v(t){return o(t,Map)}function b(t){return o(t).Contains()}function A(t,e){const r={};return(...s)=>{const f=d.useDecorators(e(...s));return f.Error=h=>(r.message=h,d.useDecorators(f,r.message&&ie(w=>{const k=w.parentSchema.get("#errorMessage")||{};t==="required"?w.parentSchema.customKey("errorMessage",d.deepMerge(k,{[t]:{[w.propertyName]:h}})):w.itemSchema.customKey("errorMessage",d.deepMerge(k,{[t]:h}))}))),f}}const X=A("maxItems",t=>{if(t<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return ie(e=>{e.schema.maxItems(t)})}),z=A("maxProperties",t=>{if(t<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return ie(e=>{e.isCollection?e.schema.maxProperties(t):e.itemSchema.maxProperties(t)})}),je=A("minItems",t=>{if(t<0)throw new Error("The value of minItems MUST be a non-negative integer.");return ie(e=>{e.schema.minItems(t)})}),Qe=A("minProperties",t=>{if(t<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return ie(e=>{e.isCollection?e.schema.minProperties(t):e.itemSchema.minProperties(t)})}),He=A("uniqueItems",(t=!0)=>ie(e=>{e.schema.uniqueItems(t)}));function qt(t){return ie((e,r)=>{e.itemSchema.additionalProperties(t)})}function _r(...t){return ie(e=>{e.itemSchema.allOf(t)})}function ut(t){return ie(e=>{t&&((d.isClass(t)||d.isArrowFn(t))&&(e.type=t),e.itemSchema.type(t))})}function T(...t){const e=t.find(r=>d.isClass(r));return d.useDecorators(e&&ut(e),ie((r,s)=>{r.decoratorType===d.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===d.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName),r.schema.allow(...t)}))}function j(...t){return ie(e=>{e.itemSchema.any(...t)})}function D(...t){return ie(e=>{e.itemSchema.anyOf(t)})}function K(t){return ie(e=>{e.itemSchema.const(t)})}function Q(t,e){return ie(r=>{r.itemSchema.customKey(t,e)})}function ye(t){return ie(e=>{Object.entries(t).forEach(([r,s])=>{e.itemSchema.customKey(r,s)})})}function he(t){return ie(e=>{e.itemSchema.default(t)})}function oe(t){return ie(e=>{const r=e.parentSchema.get("#errorMessage")||{};e.parentSchema.customKey("errorMessage",{...r,...t})})}function L(t){return d.useDecorators(oe({_:t}))}function B(t){return ie((e,r)=>{var s;switch(d.decoratorTypeOf(r)){case d.DecoratorTypes.PROP:case d.DecoratorTypes.CLASS:e.schema.description(t);break;case d.DecoratorTypes.PARAM:e.parameter.description(t);break;case d.DecoratorTypes.METHOD:(s=e.operation)==null||s.description(t);break}})}function H(){return d.useDecorators(ut(),ie(t=>{t.discriminatorKey()}))}function ae(t,...e){return ie(r=>{r.itemSchema.enum(t,...e)})}const Ie=A("enum",ae);function Xe(...t){return ie(e=>{e.schema.examples(t)})}function wt(t){return ie(e=>{e.parameter.examples(t)})}const nr=A("maximum",(t,e=!1)=>ie(r=>{e?r.itemSchema.exclusiveMaximum(t):r.itemSchema.maximum(t)})),Js=nr,lo=A("exclusiveMaximum",(t,e=!0)=>nr(t,e)),Vs=A("minimum",(t,e=!1)=>ie(r=>{e?r.itemSchema.exclusiveMinimum(t):r.itemSchema.minimum(t)})),bi=Vs,wi=A("exclusiveMinimum",(t,e=!0)=>Vs(t,e));var hr=(t=>(t.DATE_TIME="date-time",t.DATE="date",t.TIME="time",t.EMAIL="email",t.HOSTNAME="hostname",t.IPV4="ipv4",t.IPV6="ipv6",t.URI="uri",t.URL="url",t.URI_REF="uri-reference",t.URI_TEMPLATE="uri-template",t.JSON_POINTER="json-pointer",t.RELATIVE_JSON_POINTER="relative-json-pointer",t.UUID="uuid",t.REGEX="regex",t))(hr||{});const es=A("format",t=>ie(e=>{e.itemSchema.format(t)})),Ws=A("format",()=>es(hr.EMAIL)),Io=A("format",()=>es(hr.DATE_TIME)),Ti=A("format",()=>es(hr.DATE)),Pi=A("format",()=>es(hr.TIME)),ho=A("format",()=>es(hr.URI)),mo=A("format",()=>es(hr.URL));function No(t=!0){return ie(e=>{e.schema.$forwardGroups=t})}function yo(t,e){e=[].concat(e),t=[].concat(t);let r=new Set,s=new Set,f=new Set,h=0,w=k=>{f.add(k.output)};for(let k=0;k<e.length;k++){let F=Me(String(e[k]),{onResult:w},!0),V=F.state.negated||F.state.negatedExtglob;V&&h++;for(let te of t){let we=F(te,!0);(V?!we.isMatch:we.isMatch)&&(V?r.add(we.output):(r.delete(we.output),s.add(we.output)))}}return!!(h===e.length?[...f]:[...s]).filter(k=>!r.has(k)).length}function Zs(t,e=[]){const r=t.filter(f=>f.startsWith("!")).map(f=>f.replace("!","")),s=t.filter(f=>!f.startsWith("!"));return r.length&&e.length&&yo(r,e)?!0:s.length?!yo(t.filter(f=>!f.startsWith("!")),e):!1}function go(t,e){const r=Object.entries(t[0]);e.children.forEach(s=>{const f=r.filter(([,h])=>h.includes(s.propertyName)).map(([h])=>h);vo(...f)(s.target,s.propertyKey)})}function vo(...t){return ie(e=>{switch(e.decoratorType){case d.DecoratorTypes.CLASS:go(t,e);break;case d.DecoratorTypes.PROP:Q("x-groups",t)(e.target,e.propertyKey),e.schema.$hooks.on("groups",(s,f)=>!s&&Zs(t,f)?!0:s);break;case d.DecoratorTypes.PARAM:let r="";t.length==2&&d.isArray(t[1])&&(r=t[0],t=t[1]),e.parameter.groups=t,e.parameter.groupsName=r;break}})}function $o(){return d.StoreSet("hidden",!0)}function Ei(t=!0){return ie(e=>{e.schema.ignore(t)})}function Uo(){return ie(t=>{t.itemSchema.type("integer")})}function Mi(t,e=!1){return ie(r=>{e?r.schema.label(t):r.itemSchema.label(t)})}const Ai=A("maxLength",t=>{if(t<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return ie(e=>{e.itemSchema.maxLength(t)})}),Ri=A("minLength",t=>{if(t<0)throw new Error("The value of minLength MUST be a non-negative integer.");return ie(e=>{e.itemSchema.minLength(t)})}),xi=A("multipleOf",t=>{if(t<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return ie(e=>{e.itemSchema.multipleOf(t)})});function Oo(t){return ie((e,r)=>{switch(d.decoratorTypeOf(r)){case d.DecoratorTypes.CLASS:e.schema.name(t);break;case d.DecoratorTypes.PARAM:e.parameter.name(t);break;default:e.parent.schema.addAlias(r[1],t)}})}function ji(t,...e){return e=[t,...e],d.useDecorators(e.length===1&&ut(e[0]),j(null,...e))}function Lo(...t){return ie(e=>{e.itemSchema.oneOf(t)})}function Fo(){return ie(t=>{switch(t.decoratorType){case d.DecoratorTypes.PARAM:t.required=!1;break;case d.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName);break}})}const Ci=A("pattern",t=>ie(e=>{e.itemSchema.pattern(t)}));function _i(t=!0){return ie(e=>{e.itemSchema.readOnly(t)})}function Bo(t){return ie(e=>{e.schema.assign(t)})}function ki(t,e){return ie(r=>{r.schema.set(t,e)})}function qo(t,...e){return Bo({properties:{...e.reduce((r,s)=>({...r,[s]:t}),{})}})}const Di=A("required",(t=!0,...e)=>t?T(...e):Fo());function Ii(...t){return ie(e=>{e.parent.schema.$hooks.on("requiredGroups",(r,s)=>Zs(t,s)?r.filter(f=>f!==e.propertyKey):r)})}function Ni(t){return ie(e=>{e.schema.title(t)})}function $i(t){return ie(()=>d.useDecorators(oe({type:t})))}function Go(t=!0){return ie(e=>{e.itemSchema.writeOnly(t)})}function Dt(t=Object){if(d.isClass(t)){const{schema:e}=Rt(t);return e.properties=function(r){return Object.entries(r).forEach(([s,f])=>{Rt(t.prototype,s).schema.assign(f)}),this},e}return Et.from({type:t})}function Qs(){return Dt(String)}function Ui(t){return d.isObject(t)&&!("toJSON"in t)}function Li(...t){const e=[t.map(s=>Ui(s)?Qs().enum(Object.values(s)):s)],r=(...s)=>{const f=Le.from(...s);f.nestedGenerics=e};return r.Nested=(...s)=>(e.push(s),r),r}function Fi(...t){return e=>{const r=Le.from(e);r.schema.genericLabels=t}}function Hs(...t){return ie((e,r)=>{switch(e.decoratorType){case d.DecoratorTypes.METHOD:e.operation.consumes(t);break;case d.DecoratorTypes.CLASS:d.decorateMethodsOf(r[0],Hs(...t));break;default:throw new d.UnsupportedDecoratorType(Hs,r)}})}function a(...t){return d.useDecorators(Hs(...t),d.StoreSet("acceptMimes",t))}class g extends Map{constructor(e={}){super(),this.actions=[],Object.entries(e).forEach(([r,s])=>{this.set(r,s)})}addAction(e){return this.actions.push(e),this}build(){const e=(...f)=>this.bind(f,e),r=f=>(...h)=>(f(...h),e),s=f=>r((...h)=>{f in this?this[f](...h):this.set(f,h[0])});return this.methods.forEach(f=>{e[Ee.pascalCase(f)]=s(f)}),e}toObject(){return[...this.entries()].reduce((e,[r,s])=>({...e,[r]:s}),{})}getMergedKey(e,r){let s=this.get(e)||r;if(s)return this.decoratorType===d.DecoratorTypes.CLASS&&(s={...s,...r||{}}),{...r||{},...s}}bind(e,r){this.entity=Le.from(...e),this.beforeInit(),this.onInit(e,r),this.afterInit()}onInit(e,r){this.forEach((s,f)=>{this.onMapKey(f,s)})}onMapKey(e,r){this.entity.set(e,r)}runActions(){return this.actions.forEach(e=>{e(this)}),this}beforeInit(){}afterInit(){}}const E=new Map;function $(t,e){E.set(t,e)}function q(t){return E.get(t)}function ge(t){return d.isObject(t)&&!("toJSON"in t)}function qe(t){return t.map(e=>ge(e)?Qs().enum(Object.values(e)):e)}class jt extends g{constructor({status:e,model:r}){super(),this.methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location","binary"],this.model(r),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&pr(e)&&!this.get("description")&&(this.set("description",pr(e)),this.get("model")||this.model(q(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...Dn(e)}),this}header(e,r){return r===void 0&&d.isString(e)?this.headers({[e]:{type:"string"}}):this.headers({[e]:r})}location(e,r={}){return this.headers({Location:{...r,value:e}}),this}groups(...e){return e.length===2&&d.isArray(e[1])?(this.set("groupsName",e[0]),this.set("groups",e[1])):this.set("groups",e),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const r=this.get("model");return this.checkPrimitive(r),this.checkCollection(r),this.addAction(s=>{this.get("schema").nestedGenerics.push(qe(e))}),this}of(...e){const r=this.get("model");return this.checkPrimitive(r),this.addAction(()=>{const s=this.get("schema");d.isCollection(r)?s==null||s.itemSchema({type:e[0]}):s==null||s.nestedGenerics.push(qe(e))}),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction(()=>{this.get("schema").assign(e)}),this}examples(e){return this.set("examples",d.isString(e)?[e]:e),this}title(e){return this.schema({title:e})}binary(){return this.type(String),this.set("contentType","application/octet-stream"),this.schema({format:"binary"}),this}checkPrimitive(e){if(d.isPrimitiveOrPrimitiveClass(e))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(e){if(d.isCollection(e))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const e=this.get("model");let r=this.get("contentType");return(e&&!d.isPlainObject(e)&&!d.isPrimitiveOrPrimitiveClass(e)||this.hasOfTypes)&&(r=r||"application/json"),r}getStatus(){return this.get("status")||"default"}onInit(e,r){switch(d.decoratorTypeOf(e)){case d.DecoratorTypes.METHOD:this.entity=Le.from(...e),this.entity.operation&&this.map();break;case d.DecoratorTypes.CLASS:this.decoratorType=d.DecoratorTypes.CLASS,d.decorateMethodsOf(e[0],r);break}}map(){const e=this.get("model"),{entity:r,decoratorType:s}=this,f=this.entity.operation,h=this.getStatus(),w=f.ensureResponseOf(h),k=this.getContentType();let{description:F=w.get("description")}=this.toObject();F&&(F=s===d.DecoratorTypes.CLASS&&w.get("description")||F,w.description(F));const V=this.getMergedKey("headers",w.get("headers"));return V&&w.headers(V),this.mapMedia(w),(yn(this.get("status"))||h==="default")&&e&&(r.type=e),k&&f.addProduce(k),this.runActions()}mapMedia(e){const r=this.getContentType(),s=this.get("model"),f=e.getMedia(r||"*/*"),h=f.get("schema")||new Et({type:s}),w=this.get("groups"),k=this.get("groupsName"),F=this.get("allowedGroups"),V=this.entity.operation;if(s&&(d.isArray(s)?h.oneOf(s.map(we=>({type:we}))):h.type(s)),this.set("schema",h),f.schema(h),f.groups=w,f.groupsName=k,F){f.allowedGroups=F;const we=new vr;we.in("query").name("includes"),we.schema(Et.from({type:"array",items:{type:"string",enum:[...F]}})),V.addParameter(-1,we)}const te=this.get("examples");return te&&f.examples(te),f}manyOf(e,r){const s=this.get("model");return this.hasOfTypes=!0,this.addAction(()=>{const f=this.get("schema");d.isCollection(s)?(f.type(s||Object),f.itemSchema().set(e,r)):f.set(e,r)}),this}}function vt(t,e){return new jt({status:t,model:e}).build()}function fn(t){return vt().ContentType(t)}function Cn(t=!0){return ie((e,r)=>{switch(d.decoratorTypeOf(r)){case d.DecoratorTypes.METHOD:e.operation.deprecated(t);break;case d.DecoratorTypes.CLASS:d.decorateMethodsOf(r[0],Cn(t));break;case d.DecoratorTypes.PARAM:e.parameter.set("deprecated",t);break;case d.DecoratorTypes.PROP:e.schema.set("deprecated",t);break;default:throw new d.UnsupportedDecoratorType(Cn,r)}})}function ts(t,e){return e!==void 0&&(t={[t]:e}),e===void 0&&d.isString(t)&&(t={[t]:{type:"string"}}),vt().Headers(t)}function vs(t){const e=new vr,r={},s=(f,h,w)=>{const k=Le.from(f,h,w);switch(k.decoratorType){case d.DecoratorTypes.PARAM:k.parameter.in(t);break;case d.DecoratorTypes.METHOD:e.in(t),k.operation.addParameter(-1,e),e.schema(Et.from(r));break;case d.DecoratorTypes.CLASS:d.decorateMethodsOf(f,s);break;default:throw new d.UnsupportedDecoratorType(vs,[f,h,w])}};return s.Type=f=>(r.type=f,s),s.Name=f=>(e.name(f),s),s.Description=f=>(e.description(f),s),s.Required=(f=!0)=>(e.required(f),s),s.Pattern=f=>s.Schema({pattern:f.toString()}),s.Schema=f=>(Object.assign(r,f.toJSON?f.toJSON():f),s),s}function zs(t){return(...e)=>{const[r,s,f]=e,h=d.Metadata.getParamTypes(r,s)[f]===Array;t=typeof t=="object"?void 0:t;const w=[t,!h&&"0"].filter(Boolean).join(".");d.useDecorators(vs(kt.FILES),Oo(w),d.useMethodDecorators(vt(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),Hs("multipart/form-data")))(...e)}}function So(t,e){return vt().Location(t,e)}const bo=new Set([...Object.keys($e).filter(t=>t!==$e.CUSTOM).map(t=>t.toLowerCase())]);function Os(t){let e,r;const s=t.filter(f=>typeof f=="string"&&bo.has(f.toLowerCase())?(e=f.toLocaleUpperCase(),!1):typeof f=="string"||f instanceof RegExp?(r=f||"/",!1):!!f);return{path:r,method:e,use:s}}class eo extends g{constructor(){super(...arguments),this.methods=["name","description","summary","method","id","use","useAfter","useBefore"]}beforeInit(){const e=this.get("path"),r=$e[this.get("method")]||$e.CUSTOM;e&&(this.operationPath=this.entity.operation.addOperationPath(r,e))}onMapKey(e,r){var s,f;switch(e){case"name":case"id":this.entity.operation.operationId(r);return;case"summary":(s=this.operationPath)==null||s.summary(r),this.entity.operation.summary(r);return;case"description":(f=this.operationPath)==null||f.description(r),this.entity.operation.description(r);return;case"use":this.entity.use(r);return;case"useAfter":this.entity.after(r);return;case"useBefore":this.entity.before(r);return}return super.onMapKey(e,r)}}function kr(...t){const e=Os(t);return new eo(e).build()}function Ko(t){return ie((e,r)=>{if(e.decoratorType!==d.DecoratorTypes.METHOD)throw new d.UnsupportedDecoratorType(Ko,r);e.operation.operationId(t)})}function Jo(t,e="/"){return ie((r,s)=>{if(r.decoratorType!==d.DecoratorTypes.METHOD)throw new d.UnsupportedDecoratorType(Jo,s);r.operation.addOperationPath(t.toUpperCase(),e)})}function Bi(){return vo("partial")}function Vo(t){return ie((e,r)=>{if(e.decoratorType!==d.DecoratorTypes.CLASS)throw new d.UnsupportedDecoratorType(Vo,r);e.path=t})}function wo(...t){return ie((e,r)=>{switch(e.decoratorType){case d.DecoratorTypes.METHOD:e.operation.produces(t);break;case d.DecoratorTypes.CLASS:d.decorateMethodsOf(r[0],wo(...t));break;default:throw new d.UnsupportedDecoratorType(wo,r)}})}function qi(t){return kr($e.PUBLISH,t)}function Gi(...t){const{status:e,url:r,meta:s}=t.reduce((f,h)=>d.isNumber(h)?(f.status=h,f):d.isString(h)?(f.url=h,f):(f.meta=h,f),{status:302,url:"",meta:{}});return d.useDecorators(vt(e).Location(r,s),ie(f=>{var h;(h=f.operation)==null||h.setRedirection(e)}))}function Ki(t="/",...e){return kr(...[$e.ALL,t].concat(e))}function Ji(t="/",...e){return kr(...[$e.GET,t].concat(e))}function Vi(t="/",...e){return kr(...[$e.POST,t].concat(e))}function Wi(t="/",...e){return kr(...[$e.PUT,t].concat(e))}function Hi(t="/",...e){return kr(...[$e.DELETE,t].concat(e))}function Wo(t="/",...e){return kr(...[$e.HEAD,t].concat(e))}function To(t="/",...e){return kr(...[$e.PATCH,t].concat(e))}function Ho(t="/",...e){return kr(...[$e.OPTIONS,t].concat(e))}function Ys(t,...e){return ie((r,s)=>{switch(r.decoratorType){case d.DecoratorTypes.METHOD:Array.isArray(t)?r.operation.security(t):r.operation.addSecurityScopes(t,e);break;case d.DecoratorTypes.CLASS:Array.isArray(t)?d.decorateMethodsOf(s[0],Ys(t)):d.decorateMethodsOf(s[0],Ys(t,...e));break;default:throw new d.UnsupportedDecoratorType(Ys,s)}})}function zo(t,e){return vt(t,e)}function Yo(t){return kr($e.SUBSCRIBE,t)}function Po(t){return ie((e,r)=>{if(e.decoratorType!==d.DecoratorTypes.METHOD)throw new d.UnsupportedDecoratorType(Po,r);e.operation.summary(t)})}function Xo(t){return t.map(e=>typeof e=="string"?{name:e}:e)}function Ae(...t){return ie((e,r)=>{switch(e.decoratorType){case d.DecoratorTypes.METHOD:e.operation.addTags(Xo(t));break;case d.DecoratorTypes.CLASS:d.decorateMethodsOf(r[0],Ae(...t));break;default:throw new d.UnsupportedDecoratorType(Ae,r)}})}function Is(t,e){return d.StoreSet("view",{path:t,options:e})}function Eo(t,e){if(t instanceof RegExp||e instanceof RegExp){if(!t)return e;if(!e)return t;const s=t instanceof RegExp?t:new RegExp(t,"gi"),f=e instanceof RegExp?e:new RegExp(e,"gi");return new RegExp(s.source+f.source,(s.global?"g":"")+(s.ignoreCase?"i":"")+(s.multiline?"m":""))}t&&e&&t.endsWith("/")&&e.startsWith("/")&&(e=e.slice(1));const r=(t||"")+(e||"");return r.endsWith("/")&&r.length>1?r.slice(0,-1):r}class Ct{constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){var e;return(e=this.operationPath)==null?void 0:e.path}get fullPath(){return Eo(this.basePath,this.path)}get method(){var e;return((e=this.operationPath)==null?void 0:e.method)||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}function zi(...t){return Dt().allOf(t)}function Yi(...t){return Dt().any(...t)}function Zo(...t){return Dt().anyOf(t)}function Xi(){return Dt(Boolean)}function pn(){return Dt(Array)}function Qo(){return Dt(Map).unknown(!0)}function to(){return Dt(Array).uniqueItems(!0)}function ei(){return Dt(Date).format(hr.DATE)}function Zi(){return Dt(Date).format(hr.DATE_TIME)}function Mo(){return Dt(Date).format(hr.TIME)}function ti(){return Dt(String).format(hr.EMAIL)}function ri(t){const e=Qs().enum(t);return $r.set(t,e),e}function ni(){return Dt(Number).integer()}function si(t){try{if(t())return Le.from(t()).schema}catch{}return new wn(t)}function oi(){return Dt(Number)}function Ao(t={}){return Dt(Object).properties(t)}function Qi(...t){return Dt().oneOf(t)}function ea(){return Dt(String).format(hr.URI)}function ta(){return Dt(String).format(hr.URL)}const ro=d.mergeReducerBuilder((t,e)=>t.type&&t.type&&t.type===e.type&&e.type==="array"?JSON.stringify(t.items)===JSON.stringify(e.items):t.type&&t.type===e.type||t.$ref&&t.$ref===e.$ref),Ns=d.mergeReducerBuilder((t,e)=>t.in===e.in&&t.name===e.name),ii=d.mergeReducerBuilder((t,e)=>!!Object.keys(e).find(r=>!!t[r])),ai=d.mergeReducerBuilder((t,e)=>t.name===e.name),ra={security:ii,parameters:Ns,oneOf:ro,anyOf:ro,allOf:ro,tags:ai};function $s(t,e){return d.deepMerge(t,e,{reducers:ra,cleanUndefinedProps:!0})}const R=new Map;function C(t,e,r){R.has(t)||R.set(t,new Map);const s=R.get(t),f=JSON.stringify(e);return s.has(f)||s.set(f,r()),s.get(f)}function I(t,e){const r=Rt(t),{rootPath:s="/"}=e;return e={...e,rootPath:s,defaultTags:[d.cleanObject({name:r.schema.getName(),description:r.schema.get("description")})]},G("generate",[r],e)}function W(t,e={}){if(e={specType:Re.OPENAPI,...e,tags:[],paths:{},channels:{},components:{},operationIdFormatter:e.operationIdFormatter||tr(e.operationIdPattern),root:!1},d.isArray(t)){let r={};return e={...e,append(s){r=$s(r,s)}},t.forEach(({token:s,...f})=>{const h=W(s,{...e,...f});e.append(h)}),r}return C(t,e,()=>I(t,e))}function Se(t){return t.startsWith("3.")?Re.OPENAPI:Re.SWAGGER}function It(t){return"openapi"in t?Re.OPENAPI:Re.SWAGGER}function At(t){const{title:e,description:r,version:s,termsOfService:f,contact:h,license:w}=t;return d.cleanObject({version:s,title:e,description:r,termsOfService:f,contact:h,license:w})}function Ne(t,{version:e,specVersion:r,acceptMimes:s=["application/json"]}){const{paths:f,security:h,tags:w,host:k,basePath:F,schemes:V,consumes:te=[],produces:we=["application/json"],definitions:ft,parameters:Sr,responses:et,securityDefinitions:rs,externalDocs:Ss}=t;return{swagger:r,consumes:d.uniq([...s,...te]),produces:d.uniq([...we]),info:At(d.getValue(t,"info",{})),paths:f,host:k,basePath:F,schemes:V,definitions:ft,parameters:Sr,responses:et,security:h,securityDefinitions:rs,tags:w,externalDocs:Ss}}function ee(t,{specVersion:e}){const{servers:r,paths:s,components:f,security:h,tags:w,externalDocs:k}=t;return{openapi:e,info:At(d.getValue(t,"info",{})),servers:r,paths:s,components:f,security:h,tags:w,externalDocs:k}}function se(t,{fileSpec:e,acceptMimes:r,specVersion:s,version:f}){s=s||d.getValue(t,"openapi",d.getValue(t,"swagger","2.0"));const h={specVersion:s,acceptMimes:r};switch(Se(s)){case Re.OPENAPI:t=ee(t,h),e=e&&ee(e,h);break;default:case Re.SWAGGER:t=Ne(t,h),e=e&&Ne(e,h);break}return t=$s(t,e),d.setValue(t,"info.title",d.getValue(t,"info.title","Api documentation")),d.setValue(t,"info.version",d.getValue(t,"info.version",f)),t}const ue=["get","put","post","delete","options","head","patch","trace"],pe=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],Fe=["type","items"],pt=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,Tt={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function Wr(t){return t.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/")}function no(t){if(Array.isArray(t))t.forEach(no);else if(typeof t=="object")for(let e in t)e==="$ref"?t.$ref=Wr(t.$ref):no(t[e])}function ci(t){return new RegExp(pt,"i").test(t)}function ui(t){const e=Object.keys(Tt).map(r=>Tt[r]);return Object.keys(t).filter(r=>e.indexOf(r)>-1||ci(r))}function ja(t){function e(r){const{scheme:s,type:f,name:h,bearerFormat:w,flows:k,...F}=r;switch(f){case"http":if(s==="basic")return{...F,type:s};if(s==="bearer")return{...F,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const V=Object.keys(k)[0],te=k[V];let we=V;return we==="clientCredentials"?we="application":we==="authorizationCode"&&(we="accessCode"),{type:f,flow:we,authorizationUrl:te.authorizationUrl,tokenUrl:te.tokenUrl,scopes:te.scopes}}}return Object.entries(t).reduce((r,[s,f])=>{const h=e(f);return h&&(r[s]=h),r},{})}function Ca(t){let e=t.url;const r=t.variables||{};for(const f in r){const h=r[f]||{};if(h.default){const w=RegExp(`{${f}}`,"g");e=e.replace(w,h.default)}}const s=new URL(e);return{host:s.host?s.host:void 0,basePath:s.pathname,schemes:s.protocol!==null?[s.protocol.substring(0,s.protocol.length-1)]:void 0}}class _a{constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?Ca(e):{}}resolveReference(e,r,s){if(!r||!r.$ref)return r;const f=r.$ref;if(f.startsWith("#")){const h=f.split("/").map(k=>k.replace(/~1/g,"/").replace(/~0/g,"~"));h.shift();let w=e;return h.forEach(k=>{w=w[k]}),s?JSON.parse(JSON.stringify(w)):w}}convert(){const e={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,no(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],d.cleanObject({...e,...this.spec})}convertOperations(e,r){return Object.entries(e).reduce((s,[f,h])=>{const w=s[f]=this.resolveReference({...r,paths:s},h,!0);return this.convertParameters(w),Object.keys(w).forEach(k=>{if(ue.indexOf(k)>=0){const F=w[k]=this.resolveReference({...r,paths:s},w[k],!0);this.convertOperationParameters(F),this.convertResponses(F)}}),s},e)}convertOperationParameters(e){let r,s,f,h;if(e.parameters=e.parameters||[],e.requestBody){let w=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const k=ui(e.requestBody.content)[0],F={content:{}},V=e.requestBody.content[k];V&&V.schema&&V.schema.$ref&&!V.schema.$ref.startsWith("#")&&(w=this.resolveReference(this.spec,V.schema,!0),F.content[`${k}`]={schema:w},w=F)}if(w.name="body",r=w.content,r&&Object.keys(r).length){if(f=Object.keys(r).filter(k=>k.indexOf("/")>0),h=f.filter(k=>k.indexOf("*")<0),s=ui(r)[0],delete w.content,[Tt.APPLICATION_X_WWW_URLENCODED,Tt.MULTIPART_FORM_DATA].includes(s))if(e.consumes=h,w.in="formData",w.schema=r[s].schema,w.schema=this.resolveReference(this.spec,w.schema,!0),w.schema.type==="object"&&w.schema.properties){const k=w.schema.required||[];Object.keys(w.schema.properties).forEach(F=>{var V;const te=w.schema.properties[F];if(!te.readOnly){const we={name:F,in:"formData",schema:te};k.indexOf(F)>=0&&(we.required=!0),(V=e.parameters)==null||V.push(we)}})}else e.parameters.push(w);else s?(e.consumes=h,w.in="body",w.schema=r[s].schema,e.parameters.push(w)):f&&(e.consumes=h||["application/octet-stream"],w.in="body",w.name=w.name||"file",delete w.type,w.schema=r[f[0]].schema||{type:"string",format:"binary"},e.parameters.push(w));w.schema&&this.convertSchema(w.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){e.parameters!==void 0&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach((r,s)=>{if(r=e.parameters[s]=this.resolveReference(this.spec,r,!1),r.in!=="body"){if(this.copySchemaProperties(r,pe),this.copySchemaProperties(r,Fe),this.copySchemaXProperties(r),!r.description){const f=this.resolveReference(this.spec,r.schema,!1);f&&f.description&&(r.description=f.description)}r.example!==void 0&&(r["x-example"]=r.example),delete r.schema,delete r.allowReserved,delete r.example}if(r.type==="array")switch(r.style||(r.in==="query"||r.in==="cookie"?"form":"simple")){case"matrix":r.collectionFormat=r.explode?void 0:"csv";break;case"label":r.collectionFormat=void 0;break;case"simple":r.collectionFormat="csv";break;case"spaceDelimited":r.collectionFormat="ssv";break;case"pipeDelimited":r.collectionFormat="pipes";break;case"deepOpbject":r.collectionFormat="multi";break;case"form":r.collectionFormat=r.explode===!1?"csv":"multi";break}delete r.style,delete r.explode}))}copySchemaProperties(e,r){let s=this.resolveReference(this.spec,e.schema,!0);s&&r.forEach(f=>{const h=s[f];f==="additionalProperties"&&typeof h=="boolean"||h!==void 0&&(e[f]=h)})}copySchemaXProperties(e){let r=this.resolveReference(this.spec,e.schema,!0);r&&Object.keys(r).forEach(s=>{Reflect.hasOwnProperty.call(r,s)&&!Reflect.hasOwnProperty.call(e,s)&&s.startsWith("x-")&&(e[s]=r[s])})}convertResponses(e){Object.keys(e.responses||{}).forEach(r=>{const s=e.responses[r]=this.resolveReference(this.spec,e.responses[r],!0);if(s.content){let f=null,h=null;if(Object.keys(s.content).forEach(w=>{const k=w.indexOf("*")<0?w:"application/octet-stream";e.produces?e.produces.indexOf(k)<0&&e.produces.push(k):e.produces=[k];const F=s.content[w];f=f||F.schema,!h&&ci(k)&&(h=F.schema),F.example&&(s.examples=s.examples||{},s.examples[k]=F.example)}),f){s.schema=h||f;const w=this.resolveReference(this.spec,s.schema,!0);w&&s.schema.$ref&&!s.schema.$ref.startsWith("#")&&(s.schema=w),this.convertSchema(s.schema,"response")}}Object.keys(s.headers||{}).forEach(f=>{const h=this.resolveReference(this.spec,s.headers[f],!0);h.schema&&(h.type=h.schema.type,h.format=h.schema.format,delete h.schema),s.headers[f]=h}),delete s.content})}convertSchema(e,r){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const s in e.allOf)this.convertSchema(e.allOf[s],r);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach(s=>{e.properties[s].writeOnly===!0&&r==="response"?delete e.properties[s]:(this.convertSchema(e.properties[s],r),delete e.properties[s].writeOnly)});break;case"array":e.items&&this.convertSchema(e.items,r)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),e.deprecated!==void 0&&(e["x-deprecated"]===void 0&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach(e=>{this.convertSchema(this.spec.definitions[e])}),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach(r=>{const s=e[r];if(typeof s!="string"){console.warn(`Ignoring ${s} for ${r} in discriminator.mapping.`);return}let f;if(/^[a-zA-Z0-9._-]+$/.test(s))try{f=this.resolveReference(this.spec,{$ref:`#/components/schemas/${s}`},!1)}catch(h){console.debug(`Error resolving ${s} for ${r} as schema name in discriminator.mapping: ${h}`)}if(!f)try{f=this.resolveReference(this.spec,{$ref:s},!1)}catch(h){console.debug(`Error resolving ${s} for ${r} in discriminator.mapping: ${h}`)}f?(f["x-discriminator-value"]=r,f["x-ms-discriminator-value"]=r):console.warn(`Unable to resolve ${s} for ${r} in discriminator.mapping.`)})}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=ja(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function ka(t){return new _a(t).convert()}function Wu({tokens:t,...e}){const{version:r="1.0.0",acceptMimes:s,fileSpec:f={},specVersion:h}=e,w=se(d.getValue(e,"spec",{}),{fileSpec:f,version:r,specVersion:h,acceptMimes:s}),k=It(w);let F=W(t,e);const V=$s(w,F);return e.sortPaths&&(V.paths=Object.fromEntries(Object.entries(V.paths).sort(([te],[we])=>te.localeCompare(we)))),k===Re.SWAGGER?ka(V):V}const Da="$cache:schemes";function Hu(t){return JSON.stringify(t)}function zu(t,e){const r=t.store.get(Da)||new Map,s=Hu(e);if(!r.has(s)){const f=G("schema",[t.schema],e);Object.keys(d.getValue(e,"components.schemas",{})).length&&(f.definitions=e.components.schemas),r.set(s,f)}return t.store.set(Da,r),r.get(s)}function Yu(t,e={}){var r;const s=Rt(t),f=e.specType||Re.JSON;return e={endpoint:!0,groups:[],inlineEnums:f===Re.JSON,...e,specType:f,components:{schemas:{}}},s.decoratorType==="parameter"&&(e={...e,genericTypes:s.nestedGenerics[0],nestedGenerics:s.nestedGenerics,groups:(r=s.parameter)==null?void 0:r.groups}),zu(s,e)}function Ia(t,e={}){const r=t.isStore?t:Rt(t),s=Eo(e.basePath,r.path);let f=[];return e.withChildren&&(f=r.get("childrenControllers",[]).reduce((h,w)=>h.concat(Ia(w,{...e,basePath:s})),f)),[...Br(t).values()].reduce((h,w)=>{const{operation:k}=w;return k&&k.getAllowedOperationPath(e.allowedVerbs).forEach(F=>{h.push(new Ct({basePath:s,token:t,endpoint:w,operationPath:F}))}),h},f)}function Na(t){const e=t.isStore?t:Rt(t);if(!e.$properties){const r=xr(e);e.$properties=new Map,r.forEach(s=>{s.children.forEach(f=>{e.$properties.has(f.propertyKey)||e.$properties.set(f.propertyKey,f)})})}return e.$properties}function Xu(t,e={}){const r=Na(t),s=new Map;return r.forEach((f,h)=>{!e.withIgnoredProps&&Mn(f.itemSchema,e)||s.set(h,f)}),s}n.ARRAY_PROPERTIES=gt,n.AcceptMime=a,n.AdditionalProperties=qt,n.All=Ki,n.AllOf=_r,n.Allow=T,n.Any=j,n.AnyOf=D,n.ArrayOf=p,n.BOOLEAN_PROPERTIES=nn,n.COMMON_PROPERTIES=Gn,n.Children=Ds,n.CollectionContains=b,n.CollectionOf=o,n.Const=K,n.Consumes=Hs,n.ContentType=fn,n.Converter=_a,n.CustomKey=Q,n.CustomKeys=ye,n.DateFormat=Ti,n.DateTime=Io,n.DecoratorContext=g,n.Default=he,n.DefaultMsg=L,n.Delete=Hi,n.Deprecated=Cn,n.Description=B,n.Discriminator=Ur,n.DiscriminatorKey=H,n.DiscriminatorValue=i,n.Email=Ws,n.EndpointMetadata=fs,n.Enum=Ie,n.ErrorMsg=oe,n.Example=Xe,n.Examples=wt,n.ExclusiveMaximum=lo,n.ExclusiveMinimum=wi,n.For=ki,n.Format=es,n.ForwardGroups=No,n.GenericOf=Li,n.Generics=Fi,n.Get=Ji,n.Groups=vo,n.HTTP_STATUS_MESSAGES=un,n.Head=Wo,n.Header=ts,n.Hidden=$o,n.Ignore=Ei,n.In=vs,n.InFile=zs,n.Integer=Uo,n.JSON_TYPES=dn,n.JsonEntitiesContainer=Ar,n.JsonEntityComponent=mr,n.JsonEntityFn=ie,n.JsonEntityStore=Le,n.JsonFormatTypes=hr,n.JsonLazyRef=wn,n.JsonMap=Ft,n.JsonMedia=Zr,n.JsonMethodPath=Fr,n.JsonOperation=ct,n.JsonOperationPathsMap=ps,n.JsonOperationRoute=Ct,n.JsonParameter=vr,n.JsonParameterTypes=kt,n.JsonRequestBody=Zn,n.JsonResponse=gn,n.JsonSchema=Et,n.LabelledAs=Mi,n.Location=So,n.MANY_OF_PROPERTIES=En,n.MapOf=v,n.Max=Js,n.MaxItems=X,n.MaxLength=Ai,n.MaxProperties=z,n.Maximum=nr,n.Min=bi,n.MinItems=je,n.MinLength=Ri,n.MinProperties=Qe,n.Minimum=Vs,n.MultipleOf=xi,n.NUMBER_PROPERTIES=qn,n.Name=Oo,n.Nullable=ji,n.OBJECT_PROPERTIES=xs,n.OPERATION_HTTP_VERBS=ln,n.OPERATION_WS_VERBS=bs,n.OneOf=Lo,n.Operation=kr,n.OperationId=Ko,n.OperationPath=Jo,n.OperationVerbs=$e,n.Optional=Fo,n.Options=Ho,n.ParamMetadata=Rr,n.Partial=Bi,n.Patch=To,n.Path=Vo,n.Pattern=Ci,n.Post=Vi,n.Produces=wo,n.Property=ut,n.PropertyMetadata=Nn,n.Publish=qi,n.Put=Wi,n.ReadOnly=_i,n.RecordOf=qo,n.Redirect=Gi,n.Required=Di,n.RequiredGroups=Ii,n.Returns=vt,n.STRING_PROPERTIES=Rs,n.Schema=Bo,n.Security=Ys,n.SpecTypes=Re,n.Status=zo,n.Subscribe=Yo,n.Summary=Po,n.Tags=Ae,n.TimeFormat=Pi,n.Title=Ni,n.TypeError=$i,n.UniqueItems=He,n.Uri=ho,n.Url=mo,n.View=Is,n.WriteOnly=Go,n.allOf=zi,n.alterIgnore=Mn,n.alterOneOf=_e,n.alterRequiredGroups=m,n.any=Yi,n.anyMapper=Un,n.anyOf=Zo,n.array=pn,n.boolean=Xi,n.buildPath=dr,n.channelsMapper=On,n.classMapper=Gr,n.concatParameters=Cr,n.concatPath=Eo,n.createRef=Tn,n.createRefName=qr,n.date=ei,n.datetime=Zi,n.defineStatusModel=$,n.discriminatorMappingMapper=Pn,n.email=ti,n.enums=ri,n.enumsMapper=Kr,n.enumsRegistry=$r,n.execMapper=G,n.execOneOfMapper=br,n.formatParameterType=Qr,n.from=Dt,n.generateSpec=Wu,n.genericsMapper=Fn,n.getComputedType=as,n.getGenericsMap=yt,n.getInheritedStores=xr,n.getJsonEntityStore=Rt,n.getJsonPathParameters=ks,n.getJsonSchema=Yu,n.getJsonSchemaMapper=hn,n.getJsonType=yr,n.getOperationId=ms,n.getOperationsRoutes=Ia,n.getOperationsStores=Br,n.getProperties=Xu,n.getPropertiesStores=Na,n.getSpec=W,n.getSpecType=Se,n.getSpecTypeFromSpec=It,n.getStatusConstant=zn,n.getStatusMessage=pr,n.getStatusModel=q,n.hasMapper=kn,n.inheritedClassMapper=Bn,n.integer=ni,n.isParameterType=en,n.isRedirectionStatus=Xr,n.isSuccessStatus=yn,n.itemMapper=As,n.lazyRef=si,n.lazyRefMapper=hs,n.makeOf=xt,n.map=Qo,n.mapAliasedProperties=l,n.mapGenericsOptions=Pr,n.mapHeaders=Dn,n.mapMapper=jr,n.mapOpenSpec=se,n.mapOpenSpec2=Ne,n.mapOpenSpec3=ee,n.mapOpenSpecInfo=At,n.mapOperationOptions=Os,n.matchGroups=Zs,n.mergeSpec=$s,n.messageMapper=Or,n.nullableMapper=js,n.nullableMapperOpenApi=on,n.number=oi,n.object=Ao,n.objectMapper=ds,n.ofMapper=An,n.oneOf=Qi,n.operationIdFormatter=tr,n.operationInFilesMapper=Jn,n.operationInParameterMapper=Wn,n.operationInParametersMapper=an,n.operationInQueryMapper=Hn,n.operationMapper=Xn,n.operationMediaMapper=lr,n.operationRequestBodyMapper=xn,n.operationResponseMapper=Oe,n.parameters=Ns,n.pathsMapper=Qn,n.payloadMapper=bn,n.popGenerics=Ht,n.propertiesMapper=u,n.registerJsonSchemaMapper=le,n.removeHiddenOperation=$n,n.requiredMapper=y,n.responsePayloadMapper=Es,n.schemaMapper=sn,n.schemesReducer=ro,n.security=ii,n.serializeEnum=mn,n.serializeEnumValues=cs,n.set=to,n.string=Qs,n.tagsReducer=ai,n.time=Mo,n.toJsonMapCollection=Ze,n.toJsonRegex=gr,n.toRef=rn,n.transformInformation=Ca,n.transformSecurity=ja,n.transformToOS2=ka,n.uri=ea,n.url=ta,n.withErrorMsg=A,n.wrapEnumsMapper=fr,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})})}(po,po.exports)),po.exports}var vi=Vu();function Oi(ve){return ve.params&&ve.params.missingProperty?`.${ve.params.missingProperty}`:Si(ve)}function Si(ve){return Mr.getValue(ve,"dataPath",Mr.getValue(ve,"instancePath","")).replace(/\//gi,".")}function Ra(ve){var lt,De;const ke=JSON.stringify(ve.data===void 0?"undefined":ve.data),n=Z=>Z.filter(Boolean).join("").trim(),[,Ee,...tt]=Si(ve).split("."),Me=tt.length?"."+tt.join("."):"";if(ve.dataPath=Oi(ve),ve.collectionName){const Z=ve.modelName||"";switch(ve.collectionName){case"Array":return n([`${Z}[${Ee}]${Me}`,` ${ve.message}. Given value: ${ke}`]);case"Map":return n([`Map<${Ee}, ${Z}>${Me}`,` ${ve.message}. Given value: ${ke}`]);case"Set":return n([`Set<${Ee}, ${Z}>${Me}`,` ${ve.message}. Given value: ${ke}`])}}return n([!ve.modelName&&"Value",`${ve.modelName||""}`,!((lt=ve==null?void 0:ve.params)!=null&&lt.missingProperty)&&ve.dataPath||((De=ve==null?void 0:ve.params)==null?void 0:De.missingProperty)&&(ve.instancePath||"").replace(/\//g,"."),` ${ve.message}. Given value: ${ke}`])}class xa{constructor(){this.name="ajv",this.errorFormatter=Dr.constant("ajv.errorFormatter",Ra),this.returnsCoercedValues=Dr.constant("ajv.returnsCoercedValues"),this.ajv=Dr.inject(gi.Ajv)}async validate(ke,n){let{schema:Ee,type:tt,collectionType:Me,returnsCoercedValues:lt=this.returnsCoercedValues,...De}=this.mapOptions(n);const Z=Ee||vi.getJsonSchema(tt,{...De,customKeys:!0});if(Z){const rt=this.returnsCoercedValues?ke:Mr.deepClone(ke),me=this.ajv.compile(Z),ht=await me(rt),{errors:Ye}=me;if(!ht&&Ye)throw this.mapErrors(Ye,{type:tt,collectionType:Me,async:!0,value:rt});if(lt)return rt}return ke}mapOptions(ke){return ke instanceof vi.JsonSchema?{schema:ke.toJSON({customKeys:!0})}:ke}mapErrors(ke,n){const{type:Ee,collectionType:tt,value:Me}=n,lt=ke.map(De=>{tt&&(De.collectionName=Mr.nameOf(tt));const Z=Oi(De);return De.data||(Z?De.data=Mr.getValue(Me,Z.replace(/^\./,"")):De.schemaPath!=="#/required"&&(De.data=Me)),Z&&Z.match(/pwd|password|mdp|secret/)&&(De.data="[REDACTED]"),Ee&&(De.modelName=Mr.nameOf(Ee),De.message=this.mapClassError(De,Ee)),this.errorFormatter.call(this,De,{})}).join(`
56
+ `);return new Ma(lt,ke)}mapClassError(ke,n){var tt;const Ee=Mr.getValue(ke,"params.missingProperty");if(Ee){const Me=vi.JsonEntityStore.from(Mr.prototypeOf(n),Ee);if(Me)return Mr.setValue(ke,"params.missingProperty",Me.name||Ee),(tt=ke.message)==null?void 0:tt.replace(`'${Ee}'`,`'${Me.name||Ee}'`)}return ke.message}}Dr.injectable(xa).type("validator:service"),Jt.AjvService=xa,Jt.AjvValidationError=Ma,Jt.Formats=Nu,Jt.Keyword=$u,Jt.defaultErrorFormatter=Ra,Jt.getInstancePath=Si,Jt.getPath=Oi,Object.defineProperty(Jt,Symbol.toStringTag,{value:"Module"})});