reslib 2.1.1 → 2.2.0

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.
@@ -2,4 +2,4 @@
2
2
  %{failedRulesErrors}`,oneOf:`The field %{fieldName} must match at least one of the following validation rules:
3
3
  %{failedRulesErrors}`,allOf:`The field %{fieldName} must match all of the following validation rules:
4
4
  %{failedRulesErrors}`,validateNested:`The field %{fieldName} must be a valid nested object. Errors:
5
- %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var he={auth:Q,currencies:q,countries:$,dates:X,resources:_,validator:ee};function Me(t){return typeof t=="boolean"||!t||typeof t=="number"||typeof t=="string"||typeof t=="symbol"?false:Object(t).constructor===Promise||t.constructor&&(t.constructor.name==="Promise"||t.constructor.name==="AsyncFunction")||t instanceof Promise||typeof(t==null?void 0:t.then)=="function"&&typeof(t==null?void 0:t.catch)=="function"&&typeof(t==null?void 0:t.finally)=="function"?true:t&&typeof t.constructor=="function"&&Function.prototype.toString.call(t.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function te(t){return t&&Object.prototype.toString.call(t)==="[object Promise]"?true:Me(t)}function ie(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var R=()=>{var t;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((t=process==null?void 0:process.versions)!=null&&t.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},De=()=>{var t,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((t=window==null?void 0:window.process)==null?void 0:t.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Ce=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(t){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},Te=()=>typeof window=="undefined"&&typeof process!="undefined",ae=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),be=()=>{if(!ie()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let t=navigator.userAgent.toLowerCase();return /android/i.test(t)},Se=()=>{var t;return !ae()||!(window!=null&&window.ReactNativeWebView)?false:typeof((t=window==null?void 0:window.ReactNativeWebView)==null?void 0:t.postMessage)=="function"},Ye=()=>R()&&process.platform==="darwin",we=()=>R()&&process.platform==="win32",Ae=()=>R()&&process.platform==="linux",re={isWeb:ie,isLinux:Ae,isDarwin:Ye,isWin32:we,isNode:R,isElectron:De,isTouchDevice:Ce,isServerSide:Te,isClientSide:ae,isAndroidMobileBrowser:be,isReactNativeWebview:Se};function c(t){return !!(t&&typeof t=="string")}var S=class t{static decycle(e,i=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(i.includes(e))return null;let a=i.concat([e]);return Array.isArray(e)?e.map(r=>t.decycle(r,a)):Object.fromEntries(Object.entries(e).map(([r,n])=>[r,t.decycle(n,a)]))}static stringify(e,i=false){return typeof e=="string"?e:JSON.stringify(i!==false?t.decycle(e):e)}static isJSON(e){if(typeof e!="string")return false;let i=e.trim();if(i.length===0)return false;let a=i[0];if(a!=="{"&&a!=="[")return false;try{let r=JSON.parse(i);return r!==null&&typeof r=="object"}catch(r){return false}}static parse(e,i){if(typeof e=="string")try{e=JSON.parse(e,i);}catch(a){return e}if(e&&typeof e=="object")for(let a in e){let r=e[a];t.isJSON(r)&&(e[a]=t.parse(r,i));}return e}};var C=class C{static get storage(){var i;let e=Reflect.getMetadata(C.sessionStorageMetaData,C);if(V(e)&&(this._storage=e),this._storage)return this._storage;if(re.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((i=window.localStorage)!=null&&i.getItem))this._storage={get:a=>window.localStorage.getItem(a),set:(a,r)=>window.localStorage.setItem(a,r),remove:a=>window.localStorage.removeItem(a),removeAll:()=>window.localStorage.clear()};else {let a={};this._storage={get:r=>a[r],set:(r,n)=>a[r]=n,remove:r=>{delete a[r];},removeAll:()=>a={}};}return this._storage}static set storage(e){V(e)&&Reflect.defineMetadata(C.sessionStorageMetaData,e,C);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){c(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!c(e))return "";e=e.trim().replace(/\s+/g,"-");let i=this.keyNamespace;return i?`${i}-${e}`:e}};C.sessionStorageMetaData=Symbol("sessionStorage"),C._keyNamespace=void 0;var g=C;function H(t){return g.sanitizeKey(t)}var ne=(t,e)=>(t=t&&S.stringify(t,e),t==null&&(t=""),t),oe=t=>{if(te(t))return new Promise((e,i)=>{t.then(a=>{e(S.parse(a));}).catch(a=>{i(a);});});if(t!=null)return S.parse(t)},Ie=t=>{if(t=H(t),g.storage&&t&&typeof t=="string"){let e=g.storage.get(t);return oe(e)}},Ne=t=>{if(t=H(t),g.storage&&t&&typeof t=="string")return g.storage.remove(t)},ve=()=>{if(g.storage)return g.storage.removeAll()},V=t=>{if(!t)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof t[e]=="function")}catch(e){return false}},B={get:Ie,set:(t,e,i=true)=>(t=H(t),g.storage.set(t,ne(e,i))),remove:Ne,handleGetValue:oe,sanitizeKey:H,handleSetValue:ne,isValidStorage:V,Manager:g,removeAll:ve};function f(...t){for(var e in t){let i=t[e];if(c(i))return i}return ""}function I(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function N(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}function v(t){return !t||typeof t!="object"?false:t instanceof Date?true:typeof t.getTime!="function"?false:!(Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))}function W(t){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:t===document?true:"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&typeof t=="object"&&t.nodeType===1&&!!t.nodeName}function m(t){if(t===null||typeof t!="object"||W(t)||v(t)||N(t)||I(t))return false;let e=Object.getPrototypeOf(t);if(e===null)return true;let i=e.constructor;if(typeof i!="function")return false;if(i===Object)return true;let a=i.prototype;return typeof a!="object"?false:a===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function j(t){if(Array.isArray(t)){let a=[];for(var e=0;e<t.length;e++)a[e]=j(t[e]);return a}else if(m(t)&&t){let a={};for(var i in t)t.hasOwnProperty(i)&&(a[i]=j(t[i]));return a}else return t}Object.getSize=function(t,e=false){if(!t||typeof t!="object")return 0;if(Array.isArray(t))return t.length;typeof e!="boolean"&&(e=false);let i=0;for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&(i++,e===true))return i;return i};function Y(t,...e){let i=Array.isArray(t),a=m(t);(t==null||!i&&!a)&&(t={});for(let r=0;r<e.length;r++){let n=e[r];if(n==null)continue;let o=m(n),l=Array.isArray(n);if(!(!o&&!l)){if(i){l&&se(t,n);continue}else if(l)continue;for(let s in n){let u=n[s];if(u==null)continue;if(u===n){t[s]=t;continue}let M=t[s],T=Array.isArray(M),O=Array.isArray(u);if(T){O?se(t[s],u):t[s]=u;continue}else if(!m(M)){t[s]=u;continue}if(O||!m(u)){t[s]=u;continue}t[s]=Y({},M,u);}}}return t}var se=(t,e)=>{let i=e.length,a=0;for(let r=0;r<t.length;r++){let n=t[r],o=e[r];if(r<i){let l=Array.isArray(n),s=Array.isArray(o),u=m(n),M=m(o);l&&s||u&&M?(t[a]=Y(l?[]:{},n,o),a++):o!=null?(t[a]=o,a++):n!=null&&(t[a]=n,a++);}}for(let r=t.length;r<i;r++)e[r]!==void 0&&e[r]!==null&&t.push(e[r]);return t};function E(t,e){return x(t,"",{},e)}function x(t,e="",i={},a){if(i=m(i)?i:{},I(t)||v(t)||N(t)||Array.isArray(t)&&(a!=null&&a.skipArrays))return e&&(i[e]=t),i;if(typeof t=="function"||typeof t=="object"&&!m(t)&&!Le(t))return i;if(t instanceof Map||t instanceof WeakMap)return Array.from(t.entries()).forEach(([r,n])=>{let o=e?`${e}[${String(r)}]`:String(r);x(n,o,i,a);}),i;if(Array.isArray(t)||t instanceof Set||t instanceof WeakSet)return (Array.isArray(t)?t:Array.from(t)).forEach((n,o)=>{let l=e?`${e}[${o}]`:String(o);x(n,l,i,a);}),i;if(m(t))for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=t[r],o=e?e.endsWith("]")?`${e}.${r}`:`${e}.${r}`:r;x(n,o,i,a);}return i}function Le(t){return Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof WeakMap||t instanceof WeakSet}function Oe(t){return Object.entries(t)}Object.typedEntries=Oe;Object.flatten=E;Object.clone=j;function L(t,e){if(t==null)return "";if(typeof t=="string")return t;if((typeof t=="number"||typeof t=="object"&&t instanceof Number)&&typeof t.formatNumber=="function")return t.formatNumber();if(t instanceof Date||typeof t=="object"&&t!==null&&t.constructor===Date)return typeof t.toFormat=="function"?t.toFormat():t.toISOString();if(t instanceof Error)return `Error: ${t.message}`;if(N(t))return t.toString();if(I(t))return String(t);if(Array.isArray(t))return JSON.stringify(t);if(typeof t=="object"&&t!==null){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();if(typeof t.toString=="function"){let i=t.toString();if(i!=="[object Object]")return i}return JSON.stringify(t)}return typeof(t==null?void 0:t.toString)=="function"?t.toString():String(t)}function de(t,e,i){let a=(i==null?void 0:i.valueFormatter)||L,r=f(t);if(!m(e)||!e)return r;let n=(i==null?void 0:i.tagRegex)||/%\{([^}]+)\}/g,o=new Set,l,s=f(t);for(;(l=n.exec(s))!==null;){let u=l[1];u!==void 0&&o.add(u);}return o.forEach(u=>{if(i!=null&&i.tagRegex){let z=new RegExp(i.tagRegex.source,i.tagRegex.flags);[...s.matchAll(z)].forEach(F=>{let me=F[0];if(!F[1])return;let P=F[1],k=Object.prototype.hasOwnProperty.call(e,P)?e[P]:void 0,fe=k===void 0?"":(()=>{try{return a(k,P,L)}catch(He){return L(k)}})(),ye=me.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(ye,"g"),fe);});return}let M=`%{${u}}`,T=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,O=T===void 0?"":(()=>{try{return a(T,u,L)}catch(z){return L(T)}})(),ue=M.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(ue,"g"),O);}),r}function h(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}var p=class p{constructor(e={},i={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;c(i.locale)&&(this.locale=i.locale),c(i.fallbackLocale)&&(this._fallbackLocale=i.fallbackLocale),typeof i.interpolate=="function"&&(this.interpolateFunc=i.interpolate),this._hasDefaultTranslations||(this.registerTranslations(K),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!p.instance){let i=p.getLocaleFromSession(),a=Object.assign({locale:i||"en"},e);p.instance=new p({},a);}return p.instance}static createInstance(e={},i={}){return new p(e,i)}static flattenObject(e){return m(e)?E(e):e}static getLocaleFromSession(){let e=B.get("i18n.locale");return c(e)?e:void 0}static registerMomentLocale(e,i){return c(e)&&m(i)&&Array.isArray(i.months)&&(this.momentLocales[e]=Y({},this.momentLocales[e],i)),this.momentLocales}static getClassTanslationKeys(e){return J(e,le)}translate(e,i){var o;i=i||{};let a=f(i==null?void 0:i.locale,this.getLocale()),r=Array.isArray(e)?e:[e],n;for(let l of r){if(!c(l))continue;let s=this.lookup(l,a);if(s===void 0&&a!==this._fallbackLocale&&(s=this.lookup(l,this._fallbackLocale)),s!==void 0){n=s;break}}if(n===void 0)return i.defaultValue!==void 0?i.defaultValue:this.missingTranslation(e,i);if(typeof i.count=="number"&&m(n)){let l=i.count,s="other";l===0&&n.zero!==void 0?s="zero":l===1&&n.one!==void 0&&(s="one"),n[s]!==void 0?n=n[s]:n.other&&(n=n.other);}return typeof n=="string"&&(h(i.count)&&!i.countStr&&(i.countStr=typeof((o=i.count)==null?void 0:o.formatNumber)=="function"?i.count.formatNumber():i.count.toString()),n=this.performInterpolation(n,i)),n}t(e,i){return this.translate(e,i)}has(e,i){let a=i||this.getLocale(),r=Array.isArray(e)?e:[e];for(let n of r)if(this.lookup(n,a)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,i=false){return G(this,null,function*(){return this.locale===e&&i!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&p.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),i=Array.isArray(this._locales)?this._locales:["en"],a=[...e,...i.filter(r=>!e.includes(r))];return Array.from(new Set(a))}hasLocale(e){return c(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===p.instance}registerTranslations(e){return this._translations=Y({},this._translations,e),this._translations}getTranslations(e){return c(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,i){if(!c(e)||typeof i!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=i;}loadNamespace(e,i,a=true){return !c(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(i=f(i,this.getLocale()),c(i)?this.namespaceResolvers[e](i).then(r=>{let n={};return n[i]=Object.assign({},r),m(r)&&a!==false&&this.registerTranslations(n),n}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,i=true){return G(this,null,function*(){e=f(e,this.getLocale());let a=[],r={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&a.push(this.namespaceResolvers[o](e).then(l=>{Y(r,l);}));yield Promise.all(a);let n={};return n[e]=r,i!==false&&this.registerTranslations(n),this._namespacesLoaded[e]=true,n})}get(e,i){i=f(i,this.getLocale());let a=(c(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(c);if(!a.length)return;let r=this.getTranslations(i);for(let n of a)if(m(r))r=r[n];else return;return r}translateClass(e,i){let a=p.getClassTanslationKeys(e);for(let r in a)c(a[r])&&(a[r]=this.translate(a[r],i));return a}translateObject(e,i){if(!m(e))return {};let a={};for(let r in e){let n=e[r];c(n)&&(a[r]=this.translate(n,i));}return a}applyTranslations(e){try{let i=Object.getOwnPropertyNames(e);for(let a of i){let r=Reflect.getMetadata(le,e,a);if(r)try{e[a]=this.translate(r);}catch(n){A.error(n," resolving translation for key : ",r," on object : ",e);}}}catch(i){A.error(i," resolving translations for object : ",e);}}missingTranslation(e,i){let a=f(Array.isArray(e)?e.filter(c)[0]:f(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,a,f(i==null?void 0:i.defaultValue),i):a}lookup(e,i){let a=this._translations[i];if(!a)return;if(Object.prototype.hasOwnProperty.call(a,e))return a[e];let r=e.split("."),n=a;for(let o of r)if(m(n)&&Object.prototype.hasOwnProperty.call(n,o))n=n[o];else return;return n}performInterpolation(e,i){let a=E(i);return this.interpolateFunc?this.interpolateFunc(this,e,i):this.defaultInterpolator(e,a)}defaultInterpolator(e,i){return de(e,i,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){B.set("i18n.locale",e);}getMomentLocale(e){return p.momentLocales[e]}setMomentLocale(e){try{return b__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(i){console.error(i," setting moment locale : ",e);}return false}};p.momentLocales={};var w=p;w.getInstance();var le=Symbol("TRANSLATION_KEY");function U(t){return !!(t==null||typeof t=="undefined"||typeof t=="string"&&t===""||Array.isArray(t)&&!t.length)}var d=class d{static parseString(e,i){if(c(e)&&c(i))try{let a=b__default.default(e,i,!0);if(a.isValid())return {date:a.toDate(),matchedFormat:i,isValid:!0}}catch(a){}try{if(Array.isArray(i)&&(i!=null&&i.length))for(let a of i){let r=ce(e,a);if(r)return r}for(let a of d.DATE_FORMATS){let r=ce(e,a);if(r)return r}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(a){return {date:null,matchedFormat:null,isValid:false,error:a instanceof Error?a.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let i=e?d.parseDate(e):new Date;return i?i.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,i){if(d.isDateObj(e))return e;if(!c(i)){let a=d.parseString(e);return a!=null&&a.isValid?a.date:null}if(U(e))return null;try{let a=b__default.default(e,i,!0);if(a!=null&&a.isValid())return a.toDate()}catch(a){console.error(a," parsing date with moment : ",e," format is : ",i);}return null}static toSQLDateTimeFormat(e){if(!d.isDateObj(e))return "";let i=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");return `${i}-${a}-${r} ${n}:${o}:${l}`}static getI18n(e){return w.isI18nInstance(e)?e:w.getInstance()}static getDefaultDateTimeFormat(e){return f(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return f(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!d.isDateObj(e))return "";let i=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return `${i}-${a}-${r}`}static toSQLTimeFormat(e){if(!d.isDateObj(e))return "";let i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),r=String(e.getSeconds()).padStart(2,"0");return `${i}:${a}:${r}`}static getDefaultTimeFormat(e){return f(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,i){if(e==null||typeof e=="boolean")return false;if(d.isDateObj(e))return true;if(h(e)){let r=new Date(e);return r&&!isNaN(r.getTime())}if(c(e))return !!d.parseDate(e,i);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let a=new Date(e);return d.isDateObj(a)}static addToDate(e,i,a){if(h(e)||(e=0),U(i)&&(i=new Date),d.isValidDate(i)&&c(i)&&(i=new Date(i)),d.isValidDate(i)||(i=c(i)?new Date(i):new Date),c(a)&&typeof i["set"+a]=="function"&&typeof i["get"+a]=="function"){let r="set"+a,n="get"+a;i=new Date(i[r](i[n]()+e));}return i}static addDays(e,i){return d.addToDate(e,i,"Date")}static addMilliseconds(e,i){return h(e)||(e=0),d.isDateObj(i)||(i=new Date),i=i||new Date,new Date(i.getTime()+e)}static addSeconds(e,i){return h(e)||(e=0),d.addMilliseconds(e*1e3,i)}static addMinutes(e,i){return h(e)||(e=0),d.addMilliseconds(e*6e4,i)}static addHours(e,i){return h(e)||(e=0),d.addMilliseconds(e*36e5,i)}static addMonths(e,i,a){return d.addToDate(e,i,"Month")}static addWeeks(e,i){return e=(h(e)?e:0)*7,d.addToDate(e,i,"Date")}static addYears(e,i){h(e)||(e=0);let a=new Date(d.addToDate(0,i)),r=a.getFullYear();return r+e<0?e=0:e+=r,a.setFullYear(e),new Date(a)}static formatDate(e,i){try{let a=b__default.default(e);if(a.isValid())return a.format(f(i,d.getDefaultDateTimeFormat()))}catch(a){}return f(d.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let i=e?b__default.default.utc(e):b__default.default.utc();return {year:i.year(),day:i.day(),month:i.month(),monthString:i.format("MM"),hours:i.hours(),date:i.date(),minutes:i.minutes(),seconds:i.seconds(),monthName:i.format("MMMM"),dayName:i.format("dddd"),dayNameShort:i.format("ddd")}}};d.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],d.SQL_DATE_FORMAT="YYYY-MM-DD",d.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",d.SQL_TIME_FORMAT="HH:mm:ss",d.getCurrentMonthDaysRange=e=>{let i=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(i.getFullYear(),i.getMonth(),1),r=new Date(i.getFullYear(),i.getMonth()+1,0);return {first:a,last:r}},d.getPreviousWeekDaysRange=e=>{let i=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(i.getTime()-3600*24*7*1e3),r=new Date(a),n=a.getDay(),o=a.getDate()-n+(n===0?-6:1),l=new Date(a.setDate(o)),s=new Date(r.setDate(o+6));return {first:l,last:s}},d.getCurrentWeekDaysRange=e=>{let i=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=i.getDay(),r=i.getDate()-a+(a==0?-6:1),n=new Date(i),o=new Date(i.setDate(r));return n.setDate(n.getDate()+6),{first:o,last:n}},d.isDateObj=v;var y=d,ce=(t,e)=>{let i=b__default.default(t,e,true);try{if(i.isValid()&&i.format(e)===t||b__default.default.utc(i,!0).format(e)===t)return {date:i.toDate(),matchedFormat:e,isValid:!0}}catch(a){}return null};Date.prototype.toSQLDateTimeFormat=function(){return y.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return y.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return y.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(t){return y.formatDate(this,t)};Date.prototype.addYears=function(t){return y.addYears(t,this)};Date.prototype.addMonths=function(t){return y.addMonths(t,this)};Date.prototype.addMinutes=function(t){return y.addMinutes(t,this)};Date.prototype.addSeconds=function(t){return y.addSeconds(t,this)};Date.prototype.addDays=function(t){return y.addDays(t,this)};Date.prototype.addWeeks=function(t){return y.addWeeks(t,this)};Date.prototype.addHours=function(t){return y.addHours(t,this)};var D=class D{static get logger(){let e=Reflect.getMetadata(D.loggerMetaData,D);return Z(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){Z(e)&&Reflect.defineMetadata(D.loggerMetaData,e,D);}static _log(e,...i){let a=D.logger;e=f(e),e&&typeof a[e]=="function"?a[e](D.getDateTimeString(),...i):console.log("Logger level not found : [",e,"]",...i);}static getDateTimeString(){let{day:e,year:i,hours:a,minutes:r,seconds:n,dayNameShort:o,monthName:l}=y.getUTCDateTimeDetails(),s=e<10?"0"+e:e,u=a<10?"0"+a:a,M=r<10?"0"+r:r,T=n<10?"0"+n:n;return "["+[o,s,l,i].join(" ")+" "+[u,M,T].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};D.loggerMetaData=Symbol("logger-meta-data");var A=D,Z=t=>{if(!t)return false;try{return ["warn","info","error"].every(e=>typeof t[e]=="function")}catch(e){return false}};function ai(){return function(t){try{let e=new t;if(!Z(e))return;A.logger=e;}catch(e){console.error(e," registering logger");}}}exports.AttachLogger=ai;exports.Logger=A;
5
+ %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var he={auth:Q,currencies:q,countries:$,dates:X,resources:_,validator:ee};function Me(t){return typeof t=="boolean"||!t||typeof t=="number"||typeof t=="string"||typeof t=="symbol"?false:Object(t).constructor===Promise||t.constructor&&(t.constructor.name==="Promise"||t.constructor.name==="AsyncFunction")||t instanceof Promise||typeof(t==null?void 0:t.then)=="function"&&typeof(t==null?void 0:t.catch)=="function"&&typeof(t==null?void 0:t.finally)=="function"?true:t&&typeof t.constructor=="function"&&Function.prototype.toString.call(t.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function te(t){return t&&Object.prototype.toString.call(t)==="[object Promise]"?true:Me(t)}function ie(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var R=()=>{var t;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((t=process==null?void 0:process.versions)!=null&&t.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},De=()=>{var t,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((t=window==null?void 0:window.process)==null?void 0:t.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Ce=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(t){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},Te=()=>typeof window=="undefined"&&typeof process!="undefined",ae=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),be=()=>{if(!ie()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let t=navigator.userAgent.toLowerCase();return /android/i.test(t)},Se=()=>{var t;return !ae()||!(window!=null&&window.ReactNativeWebView)?false:typeof((t=window==null?void 0:window.ReactNativeWebView)==null?void 0:t.postMessage)=="function"},Ye=()=>R()&&process.platform==="darwin",we=()=>R()&&process.platform==="win32",Ae=()=>R()&&process.platform==="linux",re={isWeb:ie,isLinux:Ae,isDarwin:Ye,isWin32:we,isNode:R,isElectron:De,isTouchDevice:Ce,isServerSide:Te,isClientSide:ae,isAndroidMobileBrowser:be,isReactNativeWebview:Se};function c(t){return !!(t&&typeof t=="string")}var S=class t{static decycle(e,i=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(i.includes(e))return null;let a=i.concat([e]);return Array.isArray(e)?e.map(r=>t.decycle(r,a)):Object.fromEntries(Object.entries(e).map(([r,n])=>[r,t.decycle(n,a)]))}static stringify(e,i=false,a,r){return typeof e=="string"?e:JSON.stringify(i!==false?t.decycle(e):e,a,r)}static isJSON(e){if(typeof e!="string")return false;let i=e.trim();if(i.length===0)return false;let a=i[0];if(a!=="{"&&a!=="[")return false;try{let r=JSON.parse(i);return r!==null&&typeof r=="object"}catch(r){return false}}static parse(e,i){if(typeof e=="string")try{e=JSON.parse(e,i);}catch(a){return e}if(e&&typeof e=="object")for(let a in e){let r=e[a];t.isJSON(r)&&(e[a]=t.parse(r,i));}return e}};var C=class C{static get storage(){var i;let e=Reflect.getMetadata(C.sessionStorageMetaData,C);if(V(e)&&(this._storage=e),this._storage)return this._storage;if(re.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((i=window.localStorage)!=null&&i.getItem))this._storage={get:a=>window.localStorage.getItem(a),set:(a,r)=>window.localStorage.setItem(a,r),remove:a=>window.localStorage.removeItem(a),removeAll:()=>window.localStorage.clear()};else {let a={};this._storage={get:r=>a[r],set:(r,n)=>a[r]=n,remove:r=>{delete a[r];},removeAll:()=>a={}};}return this._storage}static set storage(e){V(e)&&Reflect.defineMetadata(C.sessionStorageMetaData,e,C);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){c(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!c(e))return "";e=e.trim().replace(/\s+/g,"-");let i=this.keyNamespace;return i?`${i}-${e}`:e}};C.sessionStorageMetaData=Symbol("sessionStorage"),C._keyNamespace=void 0;var g=C;function H(t){return g.sanitizeKey(t)}var ne=(t,e)=>(t=t&&S.stringify(t,e),t==null&&(t=""),t),oe=t=>{if(te(t))return new Promise((e,i)=>{t.then(a=>{e(S.parse(a));}).catch(a=>{i(a);});});if(t!=null)return S.parse(t)},Ie=t=>{if(t=H(t),g.storage&&t&&typeof t=="string"){let e=g.storage.get(t);return oe(e)}},Ne=t=>{if(t=H(t),g.storage&&t&&typeof t=="string")return g.storage.remove(t)},ve=()=>{if(g.storage)return g.storage.removeAll()},V=t=>{if(!t)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof t[e]=="function")}catch(e){return false}},B={get:Ie,set:(t,e,i=true)=>(t=H(t),g.storage.set(t,ne(e,i))),remove:Ne,handleGetValue:oe,sanitizeKey:H,handleSetValue:ne,isValidStorage:V,Manager:g,removeAll:ve};function f(...t){for(var e in t){let i=t[e];if(c(i))return i}return ""}function I(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function N(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}function v(t){return !t||typeof t!="object"?false:t instanceof Date?true:typeof t.getTime!="function"?false:!(Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))}function W(t){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:t===document?true:"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&typeof t=="object"&&t.nodeType===1&&!!t.nodeName}function m(t){if(t===null||typeof t!="object"||W(t)||v(t)||N(t)||I(t))return false;let e=Object.getPrototypeOf(t);if(e===null)return true;let i=e.constructor;if(typeof i!="function")return false;if(i===Object)return true;let a=i.prototype;return typeof a!="object"?false:a===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function j(t){if(Array.isArray(t)){let a=[];for(var e=0;e<t.length;e++)a[e]=j(t[e]);return a}else if(m(t)&&t){let a={};for(var i in t)t.hasOwnProperty(i)&&(a[i]=j(t[i]));return a}else return t}Object.getSize=function(t,e=false){if(!t||typeof t!="object")return 0;if(Array.isArray(t))return t.length;typeof e!="boolean"&&(e=false);let i=0;for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&(i++,e===true))return i;return i};function Y(t,...e){let i=Array.isArray(t),a=m(t);(t==null||!i&&!a)&&(t={});for(let r=0;r<e.length;r++){let n=e[r];if(n==null)continue;let o=m(n),l=Array.isArray(n);if(!(!o&&!l)){if(i){l&&se(t,n);continue}else if(l)continue;for(let s in n){let u=n[s];if(u==null)continue;if(u===n){t[s]=t;continue}let M=t[s],T=Array.isArray(M),O=Array.isArray(u);if(T){O?se(t[s],u):t[s]=u;continue}else if(!m(M)){t[s]=u;continue}if(O||!m(u)){t[s]=u;continue}t[s]=Y({},M,u);}}}return t}var se=(t,e)=>{let i=e.length,a=0;for(let r=0;r<t.length;r++){let n=t[r],o=e[r];if(r<i){let l=Array.isArray(n),s=Array.isArray(o),u=m(n),M=m(o);l&&s||u&&M?(t[a]=Y(l?[]:{},n,o),a++):o!=null?(t[a]=o,a++):n!=null&&(t[a]=n,a++);}}for(let r=t.length;r<i;r++)e[r]!==void 0&&e[r]!==null&&t.push(e[r]);return t};function E(t,e){return x(t,"",{},e)}function x(t,e="",i={},a){if(i=m(i)?i:{},I(t)||v(t)||N(t)||Array.isArray(t)&&(a!=null&&a.skipArrays))return e&&(i[e]=t),i;if(typeof t=="function"||typeof t=="object"&&!m(t)&&!Le(t))return i;if(t instanceof Map||t instanceof WeakMap)return Array.from(t.entries()).forEach(([r,n])=>{let o=e?`${e}[${String(r)}]`:String(r);x(n,o,i,a);}),i;if(Array.isArray(t)||t instanceof Set||t instanceof WeakSet)return (Array.isArray(t)?t:Array.from(t)).forEach((n,o)=>{let l=e?`${e}[${o}]`:String(o);x(n,l,i,a);}),i;if(m(t))for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=t[r],o=e?e.endsWith("]")?`${e}.${r}`:`${e}.${r}`:r;x(n,o,i,a);}return i}function Le(t){return Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof WeakMap||t instanceof WeakSet}function Oe(t){return Object.entries(t)}Object.typedEntries=Oe;Object.flatten=E;Object.clone=j;function L(t,e){if(t==null)return "";if(typeof t=="string")return t;if((typeof t=="number"||typeof t=="object"&&t instanceof Number)&&typeof t.formatNumber=="function")return t.formatNumber();if(t instanceof Date||typeof t=="object"&&t!==null&&t.constructor===Date)return typeof t.toFormat=="function"?t.toFormat():t.toISOString();if(t instanceof Error)return `Error: ${t.message}`;if(N(t))return t.toString();if(I(t))return String(t);if(Array.isArray(t))return JSON.stringify(t);if(typeof t=="object"&&t!==null){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();if(typeof t.toString=="function"){let i=t.toString();if(i!=="[object Object]")return i}return JSON.stringify(t)}return typeof(t==null?void 0:t.toString)=="function"?t.toString():String(t)}function de(t,e,i){let a=(i==null?void 0:i.valueFormatter)||L,r=f(t);if(!m(e)||!e)return r;let n=(i==null?void 0:i.tagRegex)||/%\{([^}]+)\}/g,o=new Set,l,s=f(t);for(;(l=n.exec(s))!==null;){let u=l[1];u!==void 0&&o.add(u);}return o.forEach(u=>{if(i!=null&&i.tagRegex){let z=new RegExp(i.tagRegex.source,i.tagRegex.flags);[...s.matchAll(z)].forEach(F=>{let me=F[0];if(!F[1])return;let P=F[1],k=Object.prototype.hasOwnProperty.call(e,P)?e[P]:void 0,fe=k===void 0?"":(()=>{try{return a(k,P,L)}catch(He){return L(k)}})(),ye=me.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(ye,"g"),fe);});return}let M=`%{${u}}`,T=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,O=T===void 0?"":(()=>{try{return a(T,u,L)}catch(z){return L(T)}})(),ue=M.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(ue,"g"),O);}),r}function h(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}var p=class p{constructor(e={},i={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;c(i.locale)&&(this.locale=i.locale),c(i.fallbackLocale)&&(this._fallbackLocale=i.fallbackLocale),typeof i.interpolate=="function"&&(this.interpolateFunc=i.interpolate),this._hasDefaultTranslations||(this.registerTranslations(K),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!p.instance){let i=p.getLocaleFromSession(),a=Object.assign({locale:i||"en"},e);p.instance=new p({},a);}return p.instance}static createInstance(e={},i={}){return new p(e,i)}static flattenObject(e){return m(e)?E(e):e}static getLocaleFromSession(){let e=B.get("i18n.locale");return c(e)?e:void 0}static registerMomentLocale(e,i){return c(e)&&m(i)&&Array.isArray(i.months)&&(this.momentLocales[e]=Y({},this.momentLocales[e],i)),this.momentLocales}static getClassTanslationKeys(e){return J(e,le)}translate(e,i){var o;i=i||{};let a=f(i==null?void 0:i.locale,this.getLocale()),r=Array.isArray(e)?e:[e],n;for(let l of r){if(!c(l))continue;let s=this.lookup(l,a);if(s===void 0&&a!==this._fallbackLocale&&(s=this.lookup(l,this._fallbackLocale)),s!==void 0){n=s;break}}if(n===void 0)return i.defaultValue!==void 0?i.defaultValue:this.missingTranslation(e,i);if(typeof i.count=="number"&&m(n)){let l=i.count,s="other";l===0&&n.zero!==void 0?s="zero":l===1&&n.one!==void 0&&(s="one"),n[s]!==void 0?n=n[s]:n.other&&(n=n.other);}return typeof n=="string"&&(h(i.count)&&!i.countStr&&(i.countStr=typeof((o=i.count)==null?void 0:o.formatNumber)=="function"?i.count.formatNumber():i.count.toString()),n=this.performInterpolation(n,i)),n}t(e,i){return this.translate(e,i)}has(e,i){let a=i||this.getLocale(),r=Array.isArray(e)?e:[e];for(let n of r)if(this.lookup(n,a)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,i=false){return G(this,null,function*(){return this.locale===e&&i!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&p.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),i=Array.isArray(this._locales)?this._locales:["en"],a=[...e,...i.filter(r=>!e.includes(r))];return Array.from(new Set(a))}hasLocale(e){return c(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===p.instance}registerTranslations(e){return this._translations=Y({},this._translations,e),this._translations}getTranslations(e){return c(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,i){if(!c(e)||typeof i!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=i;}loadNamespace(e,i,a=true){return !c(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(i=f(i,this.getLocale()),c(i)?this.namespaceResolvers[e](i).then(r=>{let n={};return n[i]=Object.assign({},r),m(r)&&a!==false&&this.registerTranslations(n),n}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,i=true){return G(this,null,function*(){e=f(e,this.getLocale());let a=[],r={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&a.push(this.namespaceResolvers[o](e).then(l=>{Y(r,l);}));yield Promise.all(a);let n={};return n[e]=r,i!==false&&this.registerTranslations(n),this._namespacesLoaded[e]=true,n})}get(e,i){i=f(i,this.getLocale());let a=(c(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(c);if(!a.length)return;let r=this.getTranslations(i);for(let n of a)if(m(r))r=r[n];else return;return r}translateClass(e,i){let a=p.getClassTanslationKeys(e);for(let r in a)c(a[r])&&(a[r]=this.translate(a[r],i));return a}translateObject(e,i){if(!m(e))return {};let a={};for(let r in e){let n=e[r];c(n)&&(a[r]=this.translate(n,i));}return a}applyTranslations(e){try{let i=Object.getOwnPropertyNames(e);for(let a of i){let r=Reflect.getMetadata(le,e,a);if(r)try{e[a]=this.translate(r);}catch(n){A.error(n," resolving translation for key : ",r," on object : ",e);}}}catch(i){A.error(i," resolving translations for object : ",e);}}missingTranslation(e,i){let a=f(Array.isArray(e)?e.filter(c)[0]:f(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,a,f(i==null?void 0:i.defaultValue),i):a}lookup(e,i){let a=this._translations[i];if(!a)return;if(Object.prototype.hasOwnProperty.call(a,e))return a[e];let r=e.split("."),n=a;for(let o of r)if(m(n)&&Object.prototype.hasOwnProperty.call(n,o))n=n[o];else return;return n}performInterpolation(e,i){let a=E(i);return this.interpolateFunc?this.interpolateFunc(this,e,i):this.defaultInterpolator(e,a)}defaultInterpolator(e,i){return de(e,i,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){B.set("i18n.locale",e);}getMomentLocale(e){return p.momentLocales[e]}setMomentLocale(e){try{return b__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(i){console.error(i," setting moment locale : ",e);}return false}};p.momentLocales={};var w=p;w.getInstance();var le=Symbol("TRANSLATION_KEY");function U(t){return !!(t==null||typeof t=="undefined"||typeof t=="string"&&t===""||Array.isArray(t)&&!t.length)}var d=class d{static parseString(e,i){if(c(e)&&c(i))try{let a=b__default.default(e,i,!0);if(a.isValid())return {date:a.toDate(),matchedFormat:i,isValid:!0}}catch(a){}try{if(Array.isArray(i)&&(i!=null&&i.length))for(let a of i){let r=ce(e,a);if(r)return r}for(let a of d.DATE_FORMATS){let r=ce(e,a);if(r)return r}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(a){return {date:null,matchedFormat:null,isValid:false,error:a instanceof Error?a.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let i=e?d.parseDate(e):new Date;return i?i.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,i){if(d.isDateObj(e))return e;if(!c(i)){let a=d.parseString(e);return a!=null&&a.isValid?a.date:null}if(U(e))return null;try{let a=b__default.default(e,i,!0);if(a!=null&&a.isValid())return a.toDate()}catch(a){console.error(a," parsing date with moment : ",e," format is : ",i);}return null}static toSQLDateTimeFormat(e){if(!d.isDateObj(e))return "";let i=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");return `${i}-${a}-${r} ${n}:${o}:${l}`}static getI18n(e){return w.isI18nInstance(e)?e:w.getInstance()}static getDefaultDateTimeFormat(e){return f(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return f(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!d.isDateObj(e))return "";let i=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return `${i}-${a}-${r}`}static toSQLTimeFormat(e){if(!d.isDateObj(e))return "";let i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),r=String(e.getSeconds()).padStart(2,"0");return `${i}:${a}:${r}`}static getDefaultTimeFormat(e){return f(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,i){if(e==null||typeof e=="boolean")return false;if(d.isDateObj(e))return true;if(h(e)){let r=new Date(e);return r&&!isNaN(r.getTime())}if(c(e))return !!d.parseDate(e,i);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let a=new Date(e);return d.isDateObj(a)}static addToDate(e,i,a){if(h(e)||(e=0),U(i)&&(i=new Date),d.isValidDate(i)&&c(i)&&(i=new Date(i)),d.isValidDate(i)||(i=c(i)?new Date(i):new Date),c(a)&&typeof i["set"+a]=="function"&&typeof i["get"+a]=="function"){let r="set"+a,n="get"+a;i=new Date(i[r](i[n]()+e));}return i}static addDays(e,i){return d.addToDate(e,i,"Date")}static addMilliseconds(e,i){return h(e)||(e=0),d.isDateObj(i)||(i=new Date),i=i||new Date,new Date(i.getTime()+e)}static addSeconds(e,i){return h(e)||(e=0),d.addMilliseconds(e*1e3,i)}static addMinutes(e,i){return h(e)||(e=0),d.addMilliseconds(e*6e4,i)}static addHours(e,i){return h(e)||(e=0),d.addMilliseconds(e*36e5,i)}static addMonths(e,i,a){return d.addToDate(e,i,"Month")}static addWeeks(e,i){return e=(h(e)?e:0)*7,d.addToDate(e,i,"Date")}static addYears(e,i){h(e)||(e=0);let a=new Date(d.addToDate(0,i)),r=a.getFullYear();return r+e<0?e=0:e+=r,a.setFullYear(e),new Date(a)}static formatDate(e,i){try{let a=b__default.default(e);if(a.isValid())return a.format(f(i,d.getDefaultDateTimeFormat()))}catch(a){}return f(d.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let i=e?b__default.default.utc(e):b__default.default.utc();return {year:i.year(),day:i.day(),month:i.month(),monthString:i.format("MM"),hours:i.hours(),date:i.date(),minutes:i.minutes(),seconds:i.seconds(),monthName:i.format("MMMM"),dayName:i.format("dddd"),dayNameShort:i.format("ddd")}}};d.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],d.SQL_DATE_FORMAT="YYYY-MM-DD",d.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",d.SQL_TIME_FORMAT="HH:mm:ss",d.getCurrentMonthDaysRange=e=>{let i=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(i.getFullYear(),i.getMonth(),1),r=new Date(i.getFullYear(),i.getMonth()+1,0);return {first:a,last:r}},d.getPreviousWeekDaysRange=e=>{let i=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(i.getTime()-3600*24*7*1e3),r=new Date(a),n=a.getDay(),o=a.getDate()-n+(n===0?-6:1),l=new Date(a.setDate(o)),s=new Date(r.setDate(o+6));return {first:l,last:s}},d.getCurrentWeekDaysRange=e=>{let i=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=i.getDay(),r=i.getDate()-a+(a==0?-6:1),n=new Date(i),o=new Date(i.setDate(r));return n.setDate(n.getDate()+6),{first:o,last:n}},d.isDateObj=v;var y=d,ce=(t,e)=>{let i=b__default.default(t,e,true);try{if(i.isValid()&&i.format(e)===t||b__default.default.utc(i,!0).format(e)===t)return {date:i.toDate(),matchedFormat:e,isValid:!0}}catch(a){}return null};Date.prototype.toSQLDateTimeFormat=function(){return y.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return y.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return y.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(t){return y.formatDate(this,t)};Date.prototype.addYears=function(t){return y.addYears(t,this)};Date.prototype.addMonths=function(t){return y.addMonths(t,this)};Date.prototype.addMinutes=function(t){return y.addMinutes(t,this)};Date.prototype.addSeconds=function(t){return y.addSeconds(t,this)};Date.prototype.addDays=function(t){return y.addDays(t,this)};Date.prototype.addWeeks=function(t){return y.addWeeks(t,this)};Date.prototype.addHours=function(t){return y.addHours(t,this)};var D=class D{static get logger(){let e=Reflect.getMetadata(D.loggerMetaData,D);return Z(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){Z(e)&&Reflect.defineMetadata(D.loggerMetaData,e,D);}static _log(e,...i){let a=D.logger;e=f(e),e&&typeof a[e]=="function"?a[e](D.getDateTimeString(),...i):console.log("Logger level not found : [",e,"]",...i);}static getDateTimeString(){let{day:e,year:i,hours:a,minutes:r,seconds:n,dayNameShort:o,monthName:l}=y.getUTCDateTimeDetails(),s=e<10?"0"+e:e,u=a<10?"0"+a:a,M=r<10?"0"+r:r,T=n<10?"0"+n:n;return "["+[o,s,l,i].join(" ")+" "+[u,M,T].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};D.loggerMetaData=Symbol("logger-meta-data");var A=D,Z=t=>{if(!t)return false;try{return ["warn","info","error"].every(e=>typeof t[e]=="function")}catch(e){return false}};function ai(){return function(t){try{let e=new t;if(!Z(e))return;A.logger=e;}catch(e){console.error(e," registering logger");}}}exports.AttachLogger=ai;exports.Logger=A;
@@ -2,5 +2,5 @@
2
2
  %{failedRulesErrors}`,oneOf:`The field %{fieldName} must match at least one of the following validation rules:
3
3
  %{failedRulesErrors}`,allOf:`The field %{fieldName} must match all of the following validation rules:
4
4
  %{failedRulesErrors}`,validateNested:`The field %{fieldName} must be a valid nested object. Errors:
5
- %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Dt={auth:Fe,currencies:ke,countries:Ee,dates:Be,resources:Ke,validator:Ue};function c(t){return !!(t&&typeof t=="string")}function m(...t){for(var e in t){let r=t[e];if(c(r))return r}return ""}function X(t){return !!(t==null||typeof t=="undefined"||typeof t=="string"&&t===""||Array.isArray(t)&&!t.length)}function T(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function j(t){return !t||typeof t!="object"?false:t instanceof Date?true:typeof t.getTime!="function"?false:!(Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))}var y=class y{static parseString(e,r){if(c(e)&&c(r))try{let n=$__default.default(e,r,!0);if(n.isValid())return {date:n.toDate(),matchedFormat:r,isValid:!0}}catch(n){}try{if(Array.isArray(r)&&(r!=null&&r.length))for(let n of r){let a=He(e,n);if(a)return a}for(let n of y.DATE_FORMATS){let a=He(e,n);if(a)return a}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(n){return {date:null,matchedFormat:null,isValid:false,error:n instanceof Error?n.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let r=e?y.parseDate(e):new Date;return r?r.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,r){if(y.isDateObj(e))return e;if(!c(r)){let n=y.parseString(e);return n!=null&&n.isValid?n.date:null}if(X(e))return null;try{let n=$__default.default(e,r,!0);if(n!=null&&n.isValid())return n.toDate()}catch(n){console.error(n," parsing date with moment : ",e," format is : ",r);}return null}static toSQLDateTimeFormat(e){if(!y.isDateObj(e))return "";let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return `${r}-${n}-${a} ${i}:${o}:${s}`}static getI18n(e){return k.isI18nInstance(e)?e:k.getInstance()}static getDefaultDateTimeFormat(e){return m(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return m(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!y.isDateObj(e))return "";let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${r}-${n}-${a}`}static toSQLTimeFormat(e){if(!y.isDateObj(e))return "";let r=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return `${r}:${n}:${a}`}static getDefaultTimeFormat(e){return m(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,r){if(e==null||typeof e=="boolean")return false;if(y.isDateObj(e))return true;if(T(e)){let a=new Date(e);return a&&!isNaN(a.getTime())}if(c(e))return !!y.parseDate(e,r);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let n=new Date(e);return y.isDateObj(n)}static addToDate(e,r,n){if(T(e)||(e=0),X(r)&&(r=new Date),y.isValidDate(r)&&c(r)&&(r=new Date(r)),y.isValidDate(r)||(r=c(r)?new Date(r):new Date),c(n)&&typeof r["set"+n]=="function"&&typeof r["get"+n]=="function"){let a="set"+n,i="get"+n;r=new Date(r[a](r[i]()+e));}return r}static addDays(e,r){return y.addToDate(e,r,"Date")}static addMilliseconds(e,r){return T(e)||(e=0),y.isDateObj(r)||(r=new Date),r=r||new Date,new Date(r.getTime()+e)}static addSeconds(e,r){return T(e)||(e=0),y.addMilliseconds(e*1e3,r)}static addMinutes(e,r){return T(e)||(e=0),y.addMilliseconds(e*6e4,r)}static addHours(e,r){return T(e)||(e=0),y.addMilliseconds(e*36e5,r)}static addMonths(e,r,n){return y.addToDate(e,r,"Month")}static addWeeks(e,r){return e=(T(e)?e:0)*7,y.addToDate(e,r,"Date")}static addYears(e,r){T(e)||(e=0);let n=new Date(y.addToDate(0,r)),a=n.getFullYear();return a+e<0?e=0:e+=a,n.setFullYear(e),new Date(n)}static formatDate(e,r){try{let n=$__default.default(e);if(n.isValid())return n.format(m(r,y.getDefaultDateTimeFormat()))}catch(n){}return m(y.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let r=e?$__default.default.utc(e):$__default.default.utc();return {year:r.year(),day:r.day(),month:r.month(),monthString:r.format("MM"),hours:r.hours(),date:r.date(),minutes:r.minutes(),seconds:r.seconds(),monthName:r.format("MMMM"),dayName:r.format("dddd"),dayNameShort:r.format("ddd")}}};y.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],y.SQL_DATE_FORMAT="YYYY-MM-DD",y.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",y.SQL_TIME_FORMAT="HH:mm:ss",y.getCurrentMonthDaysRange=e=>{let r=y.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(r.getFullYear(),r.getMonth(),1),a=new Date(r.getFullYear(),r.getMonth()+1,0);return {first:n,last:a}},y.getPreviousWeekDaysRange=e=>{let r=y.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(r.getTime()-3600*24*7*1e3),a=new Date(n),i=n.getDay(),o=n.getDate()-i+(i===0?-6:1),s=new Date(n.setDate(o)),l=new Date(a.setDate(o+6));return {first:s,last:l}},y.getCurrentWeekDaysRange=e=>{let r=y.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=r.getDay(),a=r.getDate()-n+(n==0?-6:1),i=new Date(r),o=new Date(r.setDate(a));return i.setDate(i.getDate()+6),{first:o,last:i}},y.isDateObj=j;var M=y,He=(t,e)=>{let r=$__default.default(t,e,true);try{if(r.isValid()&&r.format(e)===t||$__default.default.utc(r,!0).format(e)===t)return {date:r.toDate(),matchedFormat:e,isValid:!0}}catch(n){}return null};Date.prototype.toSQLDateTimeFormat=function(){return M.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return M.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return M.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(t){return M.formatDate(this,t)};Date.prototype.addYears=function(t){return M.addYears(t,this)};Date.prototype.addMonths=function(t){return M.addMonths(t,this)};Date.prototype.addMinutes=function(t){return M.addMinutes(t,this)};Date.prototype.addSeconds=function(t){return M.addSeconds(t,this)};Date.prototype.addDays=function(t){return M.addDays(t,this)};Date.prototype.addWeeks=function(t){return M.addWeeks(t,this)};Date.prototype.addHours=function(t){return M.addHours(t,this)};var L=class L{static get logger(){let e=Reflect.getMetadata(L.loggerMetaData,L);return Ve(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){Ve(e)&&Reflect.defineMetadata(L.loggerMetaData,e,L);}static _log(e,...r){let n=L.logger;e=m(e),e&&typeof n[e]=="function"?n[e](L.getDateTimeString(),...r):console.log("Logger level not found : [",e,"]",...r);}static getDateTimeString(){let{day:e,year:r,hours:n,minutes:a,seconds:i,dayNameShort:o,monthName:s}=M.getUTCDateTimeDetails(),l=e<10?"0"+e:e,u=n<10?"0"+n:n,p=a<10?"0"+a:a,b=i<10?"0"+i:i;return "["+[o,l,s,r].join(" ")+" "+[u,p,b].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};L.loggerMetaData=Symbol("logger-meta-data");var w=L,Ve=t=>{if(!t)return false;try{return ["warn","info","error"].every(e=>typeof t[e]=="function")}catch(e){return false}};function Ct(t){return typeof t=="boolean"||!t||typeof t=="number"||typeof t=="string"||typeof t=="symbol"?false:Object(t).constructor===Promise||t.constructor&&(t.constructor.name==="Promise"||t.constructor.name==="AsyncFunction")||t instanceof Promise||typeof(t==null?void 0:t.then)=="function"&&typeof(t==null?void 0:t.catch)=="function"&&typeof(t==null?void 0:t.finally)=="function"?true:t&&typeof t.constructor=="function"&&Function.prototype.toString.call(t.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ye(t){return t&&Object.prototype.toString.call(t)==="[object Promise]"?true:Ct(t)}function $e(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var _=()=>{var t;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((t=process==null?void 0:process.versions)!=null&&t.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},St=()=>{var t,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((t=window==null?void 0:window.process)==null?void 0:t.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Rt=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(t){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},Nt=()=>typeof window=="undefined"&&typeof process!="undefined",Ge=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Mt=()=>{if(!$e()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let t=navigator.userAgent.toLowerCase();return /android/i.test(t)},At=()=>{var t;return !Ge()||!(window!=null&&window.ReactNativeWebView)?false:typeof((t=window==null?void 0:window.ReactNativeWebView)==null?void 0:t.postMessage)=="function"},vt=()=>_()&&process.platform==="darwin",Pt=()=>_()&&process.platform==="win32",Ot=()=>_()&&process.platform==="linux",ze={isWeb:$e,isLinux:Ot,isDarwin:vt,isWin32:Pt,isNode:_,isElectron:St,isTouchDevice:Rt,isServerSide:Nt,isClientSide:Ge,isAndroidMobileBrowser:Mt,isReactNativeWebview:At};var B=class t{static decycle(e,r=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(r.includes(e))return null;let n=r.concat([e]);return Array.isArray(e)?e.map(a=>t.decycle(a,n)):Object.fromEntries(Object.entries(e).map(([a,i])=>[a,t.decycle(i,n)]))}static stringify(e,r=false){return typeof e=="string"?e:JSON.stringify(r!==false?t.decycle(e):e)}static isJSON(e){if(typeof e!="string")return false;let r=e.trim();if(r.length===0)return false;let n=r[0];if(n!=="{"&&n!=="[")return false;try{let a=JSON.parse(r);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(e,r){if(typeof e=="string")try{e=JSON.parse(e,r);}catch(n){return e}if(e&&typeof e=="object")for(let n in e){let a=e[n];t.isJSON(a)&&(e[n]=t.parse(a,r));}return e}};var K=class K{static get storage(){var r;let e=Reflect.getMetadata(K.sessionStorageMetaData,K);if(ge(e)&&(this._storage=e),this._storage)return this._storage;if(ze.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((r=window.localStorage)!=null&&r.getItem))this._storage={get:n=>window.localStorage.getItem(n),set:(n,a)=>window.localStorage.setItem(n,a),remove:n=>window.localStorage.removeItem(n),removeAll:()=>window.localStorage.clear()};else {let n={};this._storage={get:a=>n[a],set:(a,i)=>n[a]=i,remove:a=>{delete n[a];},removeAll:()=>n={}};}return this._storage}static set storage(e){ge(e)&&Reflect.defineMetadata(K.sessionStorageMetaData,e,K);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){c(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!c(e))return "";e=e.trim().replace(/\s+/g,"-");let r=this.keyNamespace;return r?`${r}-${e}`:e}};K.sessionStorageMetaData=Symbol("sessionStorage"),K._keyNamespace=void 0;var O=K;function ee(t){return O.sanitizeKey(t)}var We=(t,e)=>(t=t&&B.stringify(t,e),t==null&&(t=""),t),je=t=>{if(ye(t))return new Promise((e,r)=>{t.then(n=>{e(B.parse(n));}).catch(n=>{r(n);});});if(t!=null)return B.parse(t)},xt=t=>{if(t=ee(t),O.storage&&t&&typeof t=="string"){let e=O.storage.get(t);return je(e)}},wt=t=>{if(t=ee(t),O.storage&&t&&typeof t=="string")return O.storage.remove(t)},Yt=()=>{if(O.storage)return O.storage.removeAll()},ge=t=>{if(!t)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof t[e]=="function")}catch(e){return false}},R={get:xt,set:(t,e,r=true)=>(t=ee(t),O.storage.set(t,We(e,r))),remove:wt,handleGetValue:je,sanitizeKey:ee,handleSetValue:We,isValidStorage:ge,Manager:O,removeAll:Yt};function G(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function z(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}function pe(t){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:t===document?true:"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&typeof t=="object"&&t.nodeType===1&&!!t.nodeName}function d(t){if(t===null||typeof t!="object"||pe(t)||j(t)||z(t)||G(t))return false;let e=Object.getPrototypeOf(t);if(e===null)return true;let r=e.constructor;if(typeof r!="function")return false;if(r===Object)return true;let n=r.prototype;return typeof n!="object"?false:n===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function be(t){if(Array.isArray(t)){let n=[];for(var e=0;e<t.length;e++)n[e]=be(t[e]);return n}else if(d(t)&&t){let n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=be(t[r]));return n}else return t}Object.getSize=function(t,e=false){if(!t||typeof t!="object")return 0;if(Array.isArray(t))return t.length;typeof e!="boolean"&&(e=false);let r=0;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&(r++,e===true))return r;return r};function x(t,...e){let r=Array.isArray(t),n=d(t);(t==null||!r&&!n)&&(t={});for(let a=0;a<e.length;a++){let i=e[a];if(i==null)continue;let o=d(i),s=Array.isArray(i);if(!(!o&&!s)){if(r){s&&Ze(t,i);continue}else if(s)continue;for(let l in i){let u=i[l];if(u==null)continue;if(u===i){t[l]=t;continue}let p=t[l],b=Array.isArray(p),D=Array.isArray(u);if(b){D?Ze(t[l],u):t[l]=u;continue}else if(!d(p)){t[l]=u;continue}if(D||!d(u)){t[l]=u;continue}t[l]=x({},p,u);}}}return t}var Ze=(t,e)=>{let r=e.length,n=0;for(let a=0;a<t.length;a++){let i=t[a],o=e[a];if(a<r){let s=Array.isArray(i),l=Array.isArray(o),u=d(i),p=d(o);s&&l||u&&p?(t[n]=x(s?[]:{},i,o),n++):o!=null?(t[n]=o,n++):i!=null&&(t[n]=i,n++);}}for(let a=t.length;a<r;a++)e[a]!==void 0&&e[a]!==null&&t.push(e[a]);return t};function re(t,e){return te(t,"",{},e)}function te(t,e="",r={},n){if(r=d(r)?r:{},G(t)||j(t)||z(t)||Array.isArray(t)&&(n!=null&&n.skipArrays))return e&&(r[e]=t),r;if(typeof t=="function"||typeof t=="object"&&!d(t)&&!Lt(t))return r;if(t instanceof Map||t instanceof WeakMap)return Array.from(t.entries()).forEach(([a,i])=>{let o=e?`${e}[${String(a)}]`:String(a);te(i,o,r,n);}),r;if(Array.isArray(t)||t instanceof Set||t instanceof WeakSet)return (Array.isArray(t)?t:Array.from(t)).forEach((i,o)=>{let s=e?`${e}[${o}]`:String(o);te(i,s,r,n);}),r;if(d(t))for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let i=t[a],o=e?e.endsWith("]")?`${e}.${a}`:`${e}.${a}`:a;te(i,o,r,n);}return r}function Lt(t){return Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof WeakMap||t instanceof WeakSet}function It(t){return Object.entries(t)}Object.typedEntries=It;Object.flatten=re;Object.clone=be;function Z(t,e){if(t==null)return "";if(typeof t=="string")return t;if((typeof t=="number"||typeof t=="object"&&t instanceof Number)&&typeof t.formatNumber=="function")return t.formatNumber();if(t instanceof Date||typeof t=="object"&&t!==null&&t.constructor===Date)return typeof t.toFormat=="function"?t.toFormat():t.toISOString();if(t instanceof Error)return `Error: ${t.message}`;if(z(t))return t.toString();if(G(t))return String(t);if(Array.isArray(t))return JSON.stringify(t);if(typeof t=="object"&&t!==null){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();if(typeof t.toString=="function"){let r=t.toString();if(r!=="[object Object]")return r}return JSON.stringify(t)}return typeof(t==null?void 0:t.toString)=="function"?t.toString():String(t)}function ne(t,e,r){let n=(r==null?void 0:r.valueFormatter)||Z,a=m(t);if(!d(e)||!e)return a;let i=(r==null?void 0:r.tagRegex)||/%\{([^}]+)\}/g,o=new Set,s,l=m(t);for(;(s=i.exec(l))!==null;){let u=s[1];u!==void 0&&o.add(u);}return o.forEach(u=>{if(r!=null&&r.tagRegex){let h=new RegExp(r.tagRegex.source,r.tagRegex.flags);[...l.matchAll(h)].forEach(C=>{let N=C[0];if(!C[1])return;let J=C[1],de=Object.prototype.hasOwnProperty.call(e,J)?e[J]:void 0,yt=de===void 0?"":(()=>{try{return n(de,J,Z)}catch(ir){return Z(de)}})(),gt=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(gt,"g"),yt);});return}let p=`%{${u}}`,b=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,D=b===void 0?"":(()=>{try{return n(b,u,Z)}catch(h){return Z(b)}})(),v=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(v,"g"),D);}),a}var P=class P{constructor(e={},r={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;c(r.locale)&&(this.locale=r.locale),c(r.fallbackLocale)&&(this._fallbackLocale=r.fallbackLocale),typeof r.interpolate=="function"&&(this.interpolateFunc=r.interpolate),this._hasDefaultTranslations||(this.registerTranslations(fe),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!P.instance){let r=P.getLocaleFromSession(),n=Object.assign({locale:r||"en"},e);P.instance=new P({},n);}return P.instance}static createInstance(e={},r={}){return new P(e,r)}static flattenObject(e){return d(e)?re(e):e}static getLocaleFromSession(){let e=R.get("i18n.locale");return c(e)?e:void 0}static registerMomentLocale(e,r){return c(e)&&d(r)&&Array.isArray(r.months)&&(this.momentLocales[e]=x({},this.momentLocales[e],r)),this.momentLocales}static getClassTanslationKeys(e){return me(e,Qe)}translate(e,r){var o;r=r||{};let n=m(r==null?void 0:r.locale,this.getLocale()),a=Array.isArray(e)?e:[e],i;for(let s of a){if(!c(s))continue;let l=this.lookup(s,n);if(l===void 0&&n!==this._fallbackLocale&&(l=this.lookup(s,this._fallbackLocale)),l!==void 0){i=l;break}}if(i===void 0)return r.defaultValue!==void 0?r.defaultValue:this.missingTranslation(e,r);if(typeof r.count=="number"&&d(i)){let s=r.count,l="other";s===0&&i.zero!==void 0?l="zero":s===1&&i.one!==void 0&&(l="one"),i[l]!==void 0?i=i[l]:i.other&&(i=i.other);}return typeof i=="string"&&(T(r.count)&&!r.countStr&&(r.countStr=typeof((o=r.count)==null?void 0:o.formatNumber)=="function"?r.count.formatNumber():r.count.toString()),i=this.performInterpolation(i,r)),i}t(e,r){return this.translate(e,r)}has(e,r){let n=r||this.getLocale(),a=Array.isArray(e)?e:[e];for(let i of a)if(this.lookup(i,n)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,r=false){return f(this,null,function*(){return this.locale===e&&r!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&P.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),r=Array.isArray(this._locales)?this._locales:["en"],n=[...e,...r.filter(a=>!e.includes(a))];return Array.from(new Set(n))}hasLocale(e){return c(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===P.instance}registerTranslations(e){return this._translations=x({},this._translations,e),this._translations}getTranslations(e){return c(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,r){if(!c(e)||typeof r!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=r;}loadNamespace(e,r,n=true){return !c(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(r=m(r,this.getLocale()),c(r)?this.namespaceResolvers[e](r).then(a=>{let i={};return i[r]=Object.assign({},a),d(a)&&n!==false&&this.registerTranslations(i),i}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,r=true){return f(this,null,function*(){e=m(e,this.getLocale());let n=[],a={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&n.push(this.namespaceResolvers[o](e).then(s=>{x(a,s);}));yield Promise.all(n);let i={};return i[e]=a,r!==false&&this.registerTranslations(i),this._namespacesLoaded[e]=true,i})}get(e,r){r=m(r,this.getLocale());let n=(c(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(c);if(!n.length)return;let a=this.getTranslations(r);for(let i of n)if(d(a))a=a[i];else return;return a}translateClass(e,r){let n=P.getClassTanslationKeys(e);for(let a in n)c(n[a])&&(n[a]=this.translate(n[a],r));return n}translateObject(e,r){if(!d(e))return {};let n={};for(let a in e){let i=e[a];c(i)&&(n[a]=this.translate(i,r));}return n}applyTranslations(e){try{let r=Object.getOwnPropertyNames(e);for(let n of r){let a=Reflect.getMetadata(Qe,e,n);if(a)try{e[n]=this.translate(a);}catch(i){w.error(i," resolving translation for key : ",a," on object : ",e);}}}catch(r){w.error(r," resolving translations for object : ",e);}}missingTranslation(e,r){let n=m(Array.isArray(e)?e.filter(c)[0]:m(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,n,m(r==null?void 0:r.defaultValue),r):n}lookup(e,r){let n=this._translations[r];if(!n)return;if(Object.prototype.hasOwnProperty.call(n,e))return n[e];let a=e.split("."),i=n;for(let o of a)if(d(i)&&Object.prototype.hasOwnProperty.call(i,o))i=i[o];else return;return i}performInterpolation(e,r){let n=re(r);return this.interpolateFunc?this.interpolateFunc(this,e,r):this.defaultInterpolator(e,n)}defaultInterpolator(e,r){return ne(e,r,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){R.set("i18n.locale",e);}getMomentLocale(e){return P.momentLocales[e]}setMomentLocale(e){try{return $__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(r){console.error(r," setting moment locale : ",e);}return false}};P.momentLocales={};var k=P,ae=k.getInstance();var Qe=Symbol("TRANSLATION_KEY");var he=function(t){let e={},r={},n=Array.prototype.slice;return F(S({},Object.assign({},t)),{on:function(a,i){return i&&a&&(e[a]=e[a]||[]).push(i),{remove:()=>{this.off(a,i);}}},finally:function(a,i){return i&&a?((r[a]=r[a]||[]).push(i),this):this},off:function(a,i){if(!a)return this;if(a=="*"&&!i)e={};else if(i)for(var o=e[a],s=0,l;l=o&&o[s];++s)l==i&&o.splice(s--,1);return this},once:function(a,i){let o=(...s)=>{this.off(a,o),i.apply(this,s);};return this.on(a,o)},trigger:function(a,...i){if(!a)return this;let o,s,l,u=null;typeof i[i.length-1]=="function"&&(u=i.pop()),o=n.call(e[a]||[],0);let p=[];for(l=0;s=o[l];++l)typeof s=="function"&&p.push(s.apply(this,i));typeof e["*"]=="function"&&a!="*"&&(this.trigger(a,...i),this.trigger("*",...i));var b=n.call(r[a]||[],0);for(l=0;s=b[l];++l)s.call(this,p,i);return u&&u.call(this,p,i),this},offAll:function(){return e={},r={},this},getEventCallBacks:function(){return e}})},Je=function(t){if(Ft(t))return t;let e=t||{},r=he();return Object.defineProperties(e,{_____isObservable:{value:true},on:{value:r.on.bind(e)},finally:{value:r.finally.bind(e)},off:{value:r.off.bind(e)},offAll:{value:r.offAll.bind(e)},once:{value:r.once.bind(e)},getEventCallBacks:{value:r.getEventCallBacks.bind(e)},trigger:{value:r.trigger.bind(e)}}),e};function Ft(t){if(!t||["string","boolean","number"].includes(typeof t))return false;try{return (t==null?void 0:t._____isObservable)===!0&&typeof(t==null?void 0:t.on)=="function"&&typeof(t==null?void 0:t.trigger)=="function"&&typeof(t==null?void 0:t.off)=="function"}catch(e){}return false}function Te(...t){if(t.length===1)return Array.isArray(t[0])?t[0]:[];let e=null;for(var r in t){let n=t[r];if(Array.isArray(n)){if(n.length)return n;e||(e=n);}}return e||[]}var ie=function(t,e=""){if(!t||typeof t!="string")return "";if(!e||typeof e!="string")return t.trim();let r=t.length;for(;t.startsWith(e)&&r>=0;)t=t.slice(e.length),--r;return t.toString()},De=function(t,e=""){if(!t||typeof t!="string")return "";if(!e||typeof e!="string")return t.trim();let r=t.length;for(;t.endsWith(e)&&r>=0;)t=t.slice(0,-e.length),--r;return t.toString()},Ce=(t,e=true)=>typeof t!="string"?false:e!==false?/^\d*\.?\d+$/.test(t):/^\d+$/.test(t);String.prototype.ltrim=function(t){return ie(this.toString(),t)};String.prototype.rtrim=function(t){return De(this.toString(),t)};String.prototype.isNumber=function(t=true){return Ce(this.toString(),t)};String.prototype.replaceAll=function(t,e){return !c(t)||!c(e)?this.toString():this.toString().split(t).join(e)};var kt=t=>c(t)?(t=t.trim(),t.replace(/(.)([A-Z][a-z]+)/,"$1_$2").replace(/([a-z0-9])([A-Z])/,"$1_$2").toUpperCase()):"";String.prototype.toSnakeCase=function(){return kt(this.toString())};var Bt=t=>c(t)?(t=t.trim(),t.charAt(0)+t.replace(/(_\w)/g,e=>e[1].toUpperCase()).substring(1)):"";String.prototype.toCamelCase=function(){return Bt(this.toString())};var Kt=function(t){return !t||typeof t!="string"?"":(t=t.trim(),t.charAt(0).toUpperCase()+t.slice(1))};String.prototype.upperFirst=function(){return Kt(this.toString())};var Ut=function(t){return !t||typeof t!="string"?"":(t=t.trim(),t.charAt(0).toLowerCase()+t.slice(1))};String.prototype.lowerFirst=function(){return Ut(this.toString())};var Vt=(t,e=true)=>{if(typeof t!="string")return "";let r=$t(t);return t=typeof r.search=="string"?r.search:"",e&&t?"?"+ie(t,"?"):(t=De(ie(t.trim(),"?"),"?"),t)},qe=function(t,e={}){return typeof t!="string"?{}:Ht__default.default.parse(Vt(t,false),S({allowSparse:true,decoder:r=>decodeURIComponent(r.replace(/\+/g," "))},Object.assign({},e)))};var $t=t=>{if(typeof t!="string")return {};if(typeof URL!="undefined"&&URL&&Gt(t))try{return new URL(t)}catch(n){}t=zt(t)?decodeURIComponent(t):t;var e=t.match(/^(([^:\\/?#]+:)?(?:\/\/((?:([^\\/?#:]*):([^\\/?#:]*)@)?([^\\/?#:]*)(?::([^\\/?#:]*))?)))?([^?#]*)(\?[^#]*)?(#.*)?$/);let r=e?{hash:e[10]||"",host:e[3]||"",hostname:e[6]||"",href:e[0]||"",origin:e[1]||"",pathname:e[8]||(e[1]?"/":""),port:e[7]||"",protocol:e[2]||"",search:e[9]||"",username:e[4]||"",password:e[5]||""}:{};return r.protocol&&r.protocol.length==2&&(r.protocol="file:///"+r.protocol.toUpperCase(),r.origin=r.protocol+"//"+r.host),r.protocol&&(r.href=r.origin+r.pathname+r.search+r.hash),r};function Gt(t,e={}){let{requireHost:r=true,allowedProtocols:n}=Object.assign({},e);if(!c(t)||!c(t.trim()))return false;let a=t;if(typeof URL!="undefined"&&URL)try{let i=new URL(a);if(!i.protocol||i.protocol===":")return !1;let o=i.protocol.slice(0,-1);if(n&&n.length>0&&!n.includes(o))return !1;if(r)if(["http","https","ftp","ftps","ws","wss"].includes(o)){if(!c(i.hostname)||!i.hostname.trim()||!c(i.host)||!i.host.trim())return !1;let l=`${o}://`;if(!a.startsWith(l)||a.slice(l.length).startsWith("/"))return !1;let p=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,b=i.hostname.match(p);if(b&&!b.slice(1,5).map(Number).every(h=>h>=0&&h<=255))return !1}else return !1;return !0}catch(i){return false}if(r){let i=a.indexOf("://");if(i===-1)return false;let o=a.slice(0,i);if(!o||n&&n.length>0&&!n.includes(o))return false;let s=a.slice(i+3);if(s==="")return false;let l=s.indexOf("@"),u=l>=0?s.slice(l+1):s;if(u===""||u.startsWith("/"))return false;let p=u.indexOf("/"),b=u.indexOf("?"),D=u.indexOf("#"),v=Math.min(p>=0?p:u.length,b>=0?b:u.length,D>=0?D:u.length),h=u.slice(0,v);if(!h)return false;let A=h;if(h.startsWith("[")){let C=h.indexOf("]");if(C===-1)return false;A=h.slice(0,C+1);let N=h.slice(C+1);if(N&&!N.startsWith(":"))return false}else {let C=h.indexOf(":");C>=0&&(A=h.slice(0,C));}if(!A)return false;if(A==="localhost")return true;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(A))return !A.split(".").map(Number).some(N=>N>255||N<0);if(/^\[.*\]$/.test(A)){let C=A.slice(1,-1);return !(!C||C.includes(":::"))}return !!(/^[a-zA-Z\d-]*(\.[a-zA-Z\d-]+)*$/.test(A)&&A!=="")}else {let i="[a-zA-Z][a-zA-Z\\d+\\-.]*";return n&&n.length>0&&(i=`(?:${n.join("|")})`),new RegExp(`^(${i}):.+$`).test(a)}}var zt=t=>{if(!c(t)||!t.includes("%"))return false;let e=/%[0-9A-Fa-f]{2}/g;if(!t.match(e))return false;try{let n=decodeURIComponent(t);if(n!==t)return !0;try{if(decodeURIComponent(n)!==n)return !0}catch(a){return !0}}catch(n){return false}return false};var Y={USD:{symbol:"$",name:"US Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"USD",namePlural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbolNative:"$",decimalDigits:2,format:"%s %v",rounding:0,code:"CAD",namePlural:"Canadian dollars"},EUR:{symbol:"\u20AC",name:"Euro",symbolNative:"\u20AC",decimalDigits:2,rounding:0,code:"EUR",namePlural:"euros"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbolNative:"\u062F.\u0625.\u200F",decimalDigits:2,rounding:0,code:"AED",namePlural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbolNative:"\u060B",decimalDigits:0,rounding:0,code:"AFN",namePlural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbolNative:"Lek",decimalDigits:0,rounding:0,code:"ALL",namePlural:"Albanian lek\xEB"},AMD:{symbol:"AMD",name:"Armenian Dram",symbolNative:"\u0564\u0580.",decimalDigits:0,rounding:0,code:"AMD",namePlural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"ARS",namePlural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"AUD",namePlural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbolNative:"\u043C\u0430\u043D.",decimalDigits:2,rounding:0,code:"AZN",namePlural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbolNative:"KM",decimalDigits:2,rounding:0,code:"BAM",namePlural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbolNative:"\u09F3",decimalDigits:2,rounding:0,code:"BDT",namePlural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbolNative:"\u043B\u0432.",decimalDigits:2,rounding:0,code:"BGN",namePlural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbolNative:"\u062F.\u0628.\u200F",decimalDigits:2,rounding:0,code:"BHD",namePlural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbolNative:"FBu",decimalDigits:0,rounding:0,code:"BIF",namePlural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BND",namePlural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbolNative:"Bs",decimalDigits:2,rounding:0,code:"BOB",namePlural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbolNative:"R$",decimalDigits:2,rounding:0,code:"BRL",namePlural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbolNative:"P",decimalDigits:2,rounding:0,code:"BWP",namePlural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbolNative:"BYR",decimalDigits:0,rounding:0,code:"BYR",namePlural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BZD",namePlural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbolNative:"FrCD",decimalDigits:2,rounding:0,code:"CDF",namePlural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbolNative:"CHF",decimalDigits:2,rounding:.05,code:"CHF",namePlural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"CLP",namePlural:"Chilean pesos"},CNY:{symbol:"CN\xA5",name:"Chinese Yuan",symbolNative:"CN\xA5",decimalDigits:2,rounding:0,code:"CNY",namePlural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"COP",namePlural:"Colombian pesos"},CRC:{symbol:"\u20A1",name:"Costa Rican Col\xF3n",symbolNative:"\u20A1",decimalDigits:0,rounding:0,code:"CRC",namePlural:"Costa Rican col\xF3ns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbolNative:"CV$",decimalDigits:2,rounding:0,code:"CVE",namePlural:"Cape Verdean escudos"},CZK:{symbol:"K\u010D",name:"Czech Republic Koruna",symbolNative:"K\u010D",decimalDigits:2,rounding:0,code:"CZK",namePlural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbolNative:"Fdj",decimalDigits:0,rounding:0,code:"DJF",namePlural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"DKK",namePlural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbolNative:"RD$",decimalDigits:2,rounding:0,code:"DOP",namePlural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbolNative:"\u062F.\u062C.\u200F",decimalDigits:2,rounding:0,code:"DZD",namePlural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbolNative:"kr",decimalDigits:2,rounding:0,code:"EEK",namePlural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbolNative:"\u062C.\u0645.\u200F",decimalDigits:2,rounding:0,code:"EGP",namePlural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbolNative:"Nfk",decimalDigits:2,rounding:0,code:"ERN",namePlural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbolNative:"Br",decimalDigits:2,rounding:0,code:"ETB",namePlural:"Ethiopian birrs"},GBP:{symbol:"\xA3",name:"British Pound Sterling",symbolNative:"\xA3",decimalDigits:2,rounding:0,code:"GBP",namePlural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbolNative:"GEL",decimalDigits:2,rounding:0,code:"GEL",namePlural:"Georgian laris"},GHS:{symbol:"GH\u20B5",name:"Ghanaian Cedi",symbolNative:"GH\u20B5",decimalDigits:2,rounding:0,code:"GHS",namePlural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbolNative:"FG",decimalDigits:0,rounding:0,code:"GNF",namePlural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbolNative:"Q",decimalDigits:2,rounding:0,code:"GTQ",namePlural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"HKD",namePlural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbolNative:"L",decimalDigits:2,rounding:0,code:"HNL",namePlural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbolNative:"kn",decimalDigits:2,rounding:0,code:"HRK",namePlural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbolNative:"Ft",decimalDigits:0,rounding:0,code:"HUF",namePlural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbolNative:"Rp",decimalDigits:0,rounding:0,code:"IDR",namePlural:"Indonesian rupiahs"},ILS:{symbol:"\u20AA",name:"Israeli New Sheqel",symbolNative:"\u20AA",decimalDigits:2,rounding:0,code:"ILS",namePlural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbolNative:"\u099F\u0995\u09BE",decimalDigits:2,rounding:0,code:"INR",namePlural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbolNative:"\u062F.\u0639.\u200F",decimalDigits:0,rounding:0,code:"IQD",namePlural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbolNative:"\uFDFC",decimalDigits:0,rounding:0,code:"IRR",namePlural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Kr\xF3na",symbolNative:"kr",decimalDigits:0,rounding:0,code:"ISK",namePlural:"Icelandic kr\xF3nur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"JMD",namePlural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbolNative:"\u062F.\u0623.\u200F",decimalDigits:2,rounding:0,code:"JOD",namePlural:"Jordanian dinars"},JPY:{symbol:"\xA5",name:"Japanese Yen",symbolNative:"\uFFE5",decimalDigits:0,rounding:0,code:"JPY",namePlural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbolNative:"Ksh",decimalDigits:2,rounding:0,code:"KES",namePlural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbolNative:"\u17DB",decimalDigits:2,rounding:0,code:"KHR",namePlural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbolNative:"FC",decimalDigits:0,rounding:0,code:"KMF",namePlural:"Comorian francs"},KRW:{symbol:"\u20A9",name:"South Korean Won",symbolNative:"\u20A9",decimalDigits:0,rounding:0,code:"KRW",namePlural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbolNative:"\u062F.\u0643.\u200F",decimalDigits:2,rounding:0,code:"KWD",namePlural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbolNative:"\u0442\u04A3\u0433.",decimalDigits:2,rounding:0,code:"KZT",namePlural:"Kazakhstani tenges"},LBP:{symbol:"LB\xA3",name:"Lebanese Pound",symbolNative:"\u0644.\u0644.\u200F",decimalDigits:0,rounding:0,code:"LBP",namePlural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbolNative:"SL Re",decimalDigits:2,rounding:0,code:"LKR",namePlural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbolNative:"Lt",decimalDigits:2,rounding:0,code:"LTL",namePlural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbolNative:"Ls",decimalDigits:2,rounding:0,code:"LVL",namePlural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbolNative:"\u062F.\u0644.\u200F",decimalDigits:2,rounding:0,code:"LYD",namePlural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbolNative:"\u062F.\u0645.\u200F",decimalDigits:2,rounding:0,code:"MAD",namePlural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbolNative:"MDL",decimalDigits:2,rounding:0,code:"MDL",namePlural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbolNative:"MGA",decimalDigits:0,rounding:0,code:"MGA",namePlural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbolNative:"MKD",decimalDigits:2,rounding:0,code:"MKD",namePlural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbolNative:"K",decimalDigits:0,rounding:0,code:"MMK",namePlural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbolNative:"MOP$",decimalDigits:2,rounding:0,code:"MOP",namePlural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbolNative:"MURs",decimalDigits:0,rounding:0,code:"MUR",namePlural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"MXN",namePlural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbolNative:"RM",decimalDigits:2,rounding:0,code:"MYR",namePlural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbolNative:"MTn",decimalDigits:2,rounding:0,code:"MZN",namePlural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbolNative:"N$",decimalDigits:2,rounding:0,code:"NAD",namePlural:"Namibian dollars"},NGN:{symbol:"\u20A6",name:"Nigerian Naira",symbolNative:"\u20A6",decimalDigits:2,rounding:0,code:"NGN",namePlural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan C\xF3rdoba",symbolNative:"C$",decimalDigits:2,rounding:0,code:"NIO",namePlural:"Nicaraguan c\xF3rdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"NOK",namePlural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbolNative:"\u0928\u0947\u0930\u0942",decimalDigits:2,rounding:0,code:"NPR",namePlural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"NZD",namePlural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbolNative:"\u0631.\u0639.\u200F",decimalDigits:2,rounding:0,code:"OMR",namePlural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbolNative:"B/.",decimalDigits:2,rounding:0,code:"PAB",namePlural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbolNative:"S/.",decimalDigits:2,rounding:0,code:"PEN",namePlural:"Peruvian nuevos soles"},PHP:{symbol:"\u20B1",name:"Philippine Peso",symbolNative:"\u20B1",decimalDigits:2,rounding:0,code:"PHP",namePlural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbolNative:"\u20A8",decimalDigits:0,rounding:0,code:"PKR",namePlural:"Pakistani rupees"},PLN:{symbol:"z\u0142",name:"Polish Zloty",symbolNative:"z\u0142",decimalDigits:2,rounding:0,code:"PLN",namePlural:"Polish zlotys"},PYG:{symbol:"\u20B2",name:"Paraguayan Guarani",symbolNative:"\u20B2",decimalDigits:0,rounding:0,code:"PYG",namePlural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbolNative:"\u0631.\u0642.\u200F",decimalDigits:2,rounding:0,code:"QAR",namePlural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbolNative:"RON",decimalDigits:2,rounding:0,code:"RON",namePlural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbolNative:"\u0434\u0438\u043D.",decimalDigits:0,rounding:0,code:"RSD",namePlural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbolNative:"\u0440\u0443\u0431.",decimalDigits:2,rounding:0,code:"RUB",namePlural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbolNative:"FR",decimalDigits:0,rounding:0,code:"RWF",namePlural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbolNative:"\u0631.\u0633.\u200F",decimalDigits:2,rounding:0,code:"SAR",namePlural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbolNative:"SDG",decimalDigits:2,rounding:0,code:"SDG",namePlural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbolNative:"kr",decimalDigits:2,rounding:0,code:"SEK",namePlural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"SGD",namePlural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbolNative:"Ssh",decimalDigits:0,rounding:0,code:"SOS",namePlural:"Somali shillings"},SYP:{symbol:"SY\xA3",name:"Syrian Pound",symbolNative:"\u0644.\u0633.\u200F",decimalDigits:0,rounding:0,code:"SYP",namePlural:"Syrian pounds"},THB:{symbol:"\u0E3F",name:"Thai Baht",symbolNative:"\u0E3F",decimalDigits:2,rounding:0,code:"THB",namePlural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbolNative:"\u062F.\u062A.\u200F",decimalDigits:2,rounding:0,code:"TND",namePlural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Pa\u02BBanga",symbolNative:"T$",decimalDigits:2,rounding:0,code:"TOP",namePlural:"Tongan pa\u02BBanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbolNative:"TL",decimalDigits:2,rounding:0,code:"TRY",namePlural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"TTD",namePlural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbolNative:"NT$",decimalDigits:2,rounding:0,code:"TWD",namePlural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbolNative:"TSh",decimalDigits:0,rounding:0,code:"TZS",namePlural:"Tanzanian shillings"},UAH:{symbol:"\u20B4",name:"Ukrainian Hryvnia",symbolNative:"\u20B4",decimalDigits:2,rounding:0,code:"UAH",namePlural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbolNative:"USh",decimalDigits:0,rounding:0,code:"UGX",namePlural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"UYU",namePlural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbolNative:"UZS",decimalDigits:0,rounding:0,code:"UZS",namePlural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bol\xEDvar",symbolNative:"Bs.F.",decimalDigits:2,rounding:0,code:"VEF",namePlural:"Venezuelan bol\xEDvars"},VND:{symbol:"\u20AB",name:"Vietnamese Dong",symbolNative:"\u20AB",decimalDigits:0,rounding:0,code:"VND",namePlural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbolNative:"FCFA",decimalDigits:0,rounding:0,code:"XAF",namePlural:"francs CFA"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbolNative:"CFA",decimalDigits:0,rounding:0,code:"XOF",namePlural:"francs CFA"},YER:{symbol:"YR",name:"Yemeni Rial",symbolNative:"\u0631.\u064A.\u200F",decimalDigits:0,rounding:0,code:"YER",namePlural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbolNative:"R",decimalDigits:2,rounding:0,code:"ZAR",namePlural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbolNative:"ZK",decimalDigits:0,rounding:0,code:"ZMK",namePlural:"Zambian kwachas"}};var I=t=>t&&typeof t=="object"&&!Array.isArray(t)&&t.name&&typeof t.name=="string"&&t.symbol&&typeof t.symbol=="string";var Xe="%v %s",Se=t=>{let e=R.get("currencyFormat");return e&&typeof e=="string"&&e.includes("%v")?e:t!==false?Xe:""};function _e(t){return t=t&&typeof t=="string"?t.trim():"",R.set("currencyFormat",t)}var Wt=t=>{if(!I(t)){let r=typeof t=="object"&&t&&!Array.isArray(t)?m(t.code,t.name):typeof t=="string"?t:void 0;r&&(r=r.trim().toUpperCase()),r&&I(Y[r])?t=Y[r]:typeof t=="string"&&(r=t.trim().toUpperCase(),I(Y[r])&&(t=Y[r]));}let e=Object.assign({},t);if(!e.format){let r=Se();r&&(e.format=r);}return e.format&&_e(e.format),R.set("appConfigCurrency",e),e},jt=()=>{var a,i,o,s;let t=Object.assign({},R.get("appConfigCurrency")),e=R.get("currencyCode");if(c(e)&&I(Y[e.trim().toUpperCase()])&&(t=S(S({},Y[e.trim().toUpperCase()]),t)),!c(t==null?void 0:t.format)){let l=Se(false);c(l)&&l.includes("%v")&&(t.format=l);}let n=Y["USD"];return S(S({symbol:n.symbol,format:(a=n.format)!=null?a:"%v %s",decimalSeparator:(i=n.decimalSeparator)!=null?i:".",thousandSeparator:(o=n.thousandSeparator)!=null?o:",",decimalDigits:(s=n.decimalDigits)!=null?s:0},Object.assign({},ae.get("currencies"))),t)},U={getFormat:Se,setFormat:_e,setCurrency:Wt,getCurrency:jt,defaultCurrencyFormat:Xe};var Zt=t=>t&&typeof t=="object";function Ne(t){let e=Object.assign({},U.getCurrency());if(t&&Zt(t))for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r]!==void 0&&(e[r]=t[r]);if(c(e.format)){let r=rt(e.format);r.format&&(e.format=r.format),typeof r.decimalDigits=="number"&&(e.decimalDigits=r.decimalDigits);}return e}function Me(t,e){return t=typeof t=="number"?t:0,e=typeof e=="number"?e:0,t=Math.round(Math.abs(t)),isNaN(t)?e:t}function Qt(t){let e=U.getCurrency(),r=(e==null?void 0:e.format).toLowerCase();return typeof t=="string"&&(t=t.toLowerCase()),(typeof t!="string"||!t.match("%v"))&&(t=r),{pos:t,neg:t.replace("-","").replace("%v","-%v"),zero:t}}var oe=(t,e)=>{let r=U.getCurrency();if(t=t||0,typeof t=="number")return t;e=e||r.decimalSeparator;let n=new RegExp("[^0-9-"+e+"]","g"),a=parseFloat((""+t).replace(/\((?=\d+)(.*)\)/,"-$1").replace(n,"").replace(e,"."));return isNaN(a)?0:a},Re=(t,e)=>{let r=U.getCurrency();e=Me(e,r.decimalDigits);let a=String(t).replace(/[^\d.-]/g,"");if(a.length>15&&!a.includes("."))return a+"."+"0".repeat(e);try{let i=Number(a);if(isNaN(i))return "NaN";let o=+(i+"e"+e);return (+(Math.round(o)+"e-"+e)).toFixed(e)}catch(i){return "NaN"}},et=(t,e,r,n)=>{var b;t=oe(t);let a=I(e)?e:U.getCurrency();typeof e=="number"&&(a.decimalDigits=e),typeof a.decimalDigits!="number"&&(a.decimalDigits=(b=String(t).split(".")[1])==null?void 0:b.length),r!==void 0&&(a.thousandSeparator=r),n!==void 0&&(a.decimalSeparator=n);let i=Ne(a),o=Me(i.decimalDigits),s=t<0?"-":"",l=parseInt(Re(Math.abs(t||0),o),10)+"",u=l.length>3?l.length%3:0,p="";if(o){let D=String(parseFloat(Re(Math.abs(t),o))||0);D.includes(".")&&(p=m(D.split(".")[1]).trim());}return s+(u?l.substring(0,u)+i.thousandSeparator:"")+l.substring(u).replace(/(\d{3})(?=\d)/g,"$1"+i.thousandSeparator)+(o&&p?i.decimalSeparator+p:"")},tt=(t,e,r,n,a,i)=>{t=oe(t);let o=I(e)?e:U.getCurrency();e!==void 0&&typeof e=="string"&&(o.symbol=e),r!==void 0&&(o.decimalDigits=r),n!==void 0&&(o.thousandSeparator=n),a!==void 0&&(o.decimalSeparator=a),c(i)&&(o.format=i);let s=Ne(o),l=Qt(s.format),u=m(t>0?l.pos:t<0?l.neg:l.zero),p=m(s.symbol),b=u.replace(p&&"%s",p),D=et(Math.abs(t),Me(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),v=b.replace("%v",D);return F(S({},s),{formattedValue:b,formattedNumber:D,symbol:s.symbol,usedFormat:u,result:v})},Jt=(t,e,r,n,a,i)=>tt(t,e,r,n,a,i).result,rt=t=>{t=m(t).trim();let e={};if(t){let r=/(\.)(\#{0,9}\s*$)/,n=t.match(r);Array.isArray(n)&&n.length===3&&(e.decimalDigits=m(n[2]).trim().length),t=t.replace(r,"");}return e.format=t,e},W={parse:oe,session:U,formatMoney:Jt,currencies:Y,isCurrency:I,formatNumber:et,formatMoneyAsObject:tt,unformat:oe,toFixed:Re,prepareOptions:Ne,parseFormat:rt};var{currencies:nt}=W;Number.prototype.countDecimals=function(){let t=String(this.toString()).match(/\.(\d+)/);return t?t[1].length:0};Number.prototype.formatNumber=function(t,e,r){return W.formatNumber(this.valueOf(),t,e,r)};Number.prototype.formatMoney=function(t,e,r,n,a){return W.formatMoney(this.valueOf(),t,e,r,n,a)};var qt=(t,e,r,n)=>{var C;if(t===null||typeof t!="number"||isNaN(t))return {result:"",format:"",suffix:"",formattedValue:"",minAbreviationDecimalDigits:0,value:NaN};if(!isFinite(t)){let N=t>0?"\u221E":"-\u221E";return {result:N,value:t,format:"",suffix:"",formattedValue:N,minAbreviationDecimalDigits:0}}let a=Math.abs(t)<1e3,i=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"},{value:1e3,suffix:"K"},{value:1,suffix:""}],o=t.countDecimals?t.countDecimals():Math.floor(t)===t?0:((C=t.toString().split(".")[1])==null?void 0:C.length)||0,s=i.find(N=>Math.abs(t)>=N.value)||i[i.length-1],l=a?t:t/(s.value===1?1:s.value),u=s.suffix,p=Xt(l,5);if(t===0)return {result:"0",value:0,format:"",suffix:"",formattedValue:"0",minAbreviationDecimalDigits:0};let D=T(e)&&e>0?e:s.value===1?Math.min(o,5):Math.max(p,0),v=l.toFixed(D);r=m(r),n=m(n,".");let h=v.toString().split(".");return h[0]=h[0].replace(/\B(?=(\d{3})+(?!\d))/g,r),D>0&&h.length===1?h.push("0".repeat(D)):D>0&&h.length>1&&h[1].length<D&&(h[1]=h[1].padEnd(D,"0")),v=h.join(n),{result:v+u,value:t,format:u,suffix:u,formattedValue:v,minAbreviationDecimalDigits:p}};function Xt(t,e){let r=Math.abs(t);if(Number.isInteger(r))return 0;let n=r.toString().split(".")[1]||"",a=0;for(;a<n.length&&n[a]==="0";)a++;return r<1&&a>0?Math.min(a+e,n.length):Math.min(e,n.length)}var at=(t,e,r,n)=>qt(t,e,r,n).result;Number.prototype.abreviate2FormatNumber=function(t,e,r){return at(this.valueOf(),t,e,r)};var it=(t,e,r,n,a,i)=>{if(!T(t))return "";let l=W.formatMoneyAsObject(t,e,r,n,a,i),{formattedValue:o}=l,s=Ie(l,["formattedValue"]);return o.replace("%v",at(t,s.decimalDigits,s.thousandSeparator,s.decimalSeparator))};Number.prototype.abreviate2FormatMoney=function(t,e,r,n,a){return it(this.valueOf(),t,e,r,n,a)};Object.keys(nt).forEach(t=>{let e=t,r=nt[e],n=`format${e}`,a=`abreviate2Format${e}`;Number.prototype[n]=function(i,o,s,l){return W.formatMoney(this.valueOf(),r,i,o,s,l)},Number.prototype[a]=function(i,o,s,l){return it(this.valueOf(),r,i,o,s,l)};});function _t(t){return m(t).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function se(t,e){var r=Object.prototype.toString.call(t);return r==="[object "+e+"]"}function H(t,e){if(["boolean","undefined"].includes(typeof t)||t===null)return String(t);if(T(t))return t.formatNumber();if(t instanceof Date)return t.toFormat();if(t instanceof Error)return t==null?void 0:t.toString();e=Object.assign({},e);let{parenthesis:r}=e,n=r?"(":"",a=r?")":"";return typeof t=="string"?(e==null?void 0:e.escapeString)!==false?"'"+_t(t)+"'":t:se(t,"RegExp")||se(t,"Number")||se(t,"Boolean")?t.toString():se(t,"Date")?"new Date("+t.getTime()+")":Array.isArray(t)?"["+t.map(i=>H(i,e)).join(",")+"]":typeof t=="object"?n+"{"+Object.keys(t).map(i=>{var o=t[i];return H(i,e)+":"+H(o,e)}).join(",")+"}"+a:t&&typeof(t==null?void 0:t.toString)=="function"?t==null?void 0:t.toString():String(t)}var tr=ve__default.default.AES.encrypt,rr=ve__default.default.AES.decrypt,ot="auth-decrypted-key",st="user-session",lt={get:t=>f(null,null,function*(){return R.get(t)}),set:(t,e)=>f(null,null,function*(){yield R.set(t,e);}),remove:t=>f(null,null,function*(){yield R.remove(t);})},Ae=class t{static get(e,r){if(c(r))return t.getData(e)[r]}static set(e,r,n){let a=t.getData(e);return c(r)?a[r]=n:d(r)&&(a=r),R.set(t.getKey(e),a),a}static getKey(e){let r=Q.getSignedUser();return `auth-${H((r==null?void 0:r.id)||(r==null?void 0:r.email))}-${e||""}`}static getData(e){if(!c(e))return {};let r=t.getKey(e);return Object.assign({},R.get(r))}static getStorage(e){return {sessionName:e,get:r=>t.get(e,r),set:(r,n)=>t.set(e,r,n),getData:()=>t.getData(e),getKey:()=>t.getKey(e)}}},g=class g{static _isMasterAdmin(e){return e=d(e)?e:g.getSignedUser(),typeof g.isMasterAdmin=="function"?g.isMasterAdmin(e):false}static getSignedUser(){if(d(g.localUserRef.current))return g.localUserRef.current;let e=R.get(st);if(e)try{let r=rr(e,ot);if(r&&typeof(r==null?void 0:r.toString)=="function"){let n=r.toString(ve__default.default.enc.Utf8);return g.localUserRef.current=B.parse(n),g.localUserRef.current}}catch(r){w.log("getting local user ",r);}return null}static setSignedUser(e,r){return f(this,null,function*(){g.localUserRef.current=e;let n=e,a=null;try{d(n)&&(n.sessionCreatedAt=new Date().getTime()),a=n?tr(JSON.stringify(n),ot).toString():null;}catch(i){g.localUserRef.current=null,w.log(i," setting local user");}if(yield R.set(st,a),r){let i=d(n)&&a&&a!==null?"SIGN_IN":"SIGN_OUT";g.events.trigger(i,n);}return e})}static signIn(e,r=true){return f(this,null,function*(){if(!d(e))throw new Error(ae.t("auth.invalidSignInUser"));return yield g.setSignedUser(e,r)})}static signOut(e=true){return f(this,null,function*(){return yield g.setSignedUser(null,e)})}static isResourceActionTupleArray(e){return Array.isArray(e)&&e.length===2&&c(e[0])&&c(e[1])}static isResourceActionTupleObject(e){return !Array.isArray(e)&&typeof e=="object"&&d(e)&&c(e.resourceName)&&c(e.action)}static isAllowed(e,r){if(r=Object.assign({},r||g.getSignedUser()),typeof e=="boolean")return e;if(g._isMasterAdmin(r)||!e)return true;if(typeof e=="function")return !!e(r);if(g.isResourceActionTupleObject(e)){if(g.checkUserPermission(r,e.resourceName,e.action))return true}else if(g.isResourceActionTupleArray(e)){if(g.checkUserPermission(r,e[0],e[1]))return true}else if(Array.isArray(e))for(let n in e){let a=e[n];if(g.isResourceActionTupleArray(a)){if(g.checkUserPermission(r,a[0],a[1]))return true}else if(g.isResourceActionTupleObject(a)&&g.checkUserPermission(r,a.resourceName,a.action))return true}return false}static checkUserPermission(e,r,n="read"){if(!d(e)||!e)return false;if(d(e.perms)&&e.perms&&g.checkPermission(e.perms,r,n))return true;if(Array.isArray(e==null?void 0:e.roles)){for(let a in e.roles){let i=e.roles[a];if(d(i)&&d(i.perms)&&g.checkPermission(i.perms,r,n))return true}return false}return false}static checkPermission(e,r,n="read"){if(e=Object.assign({},e),r=c(r)?r:"",!d(e)||!r)return false;let a=String(r).trim().toLowerCase();n=c(n)?n:"read";let i=[];for(let o in e)if(String(o).toLowerCase().trim()===a&&Array.isArray(e[o])){i=e[o];break}if(!Array.isArray(i)||!i.length)return false;if(i.includes("all"))return true;for(let o in i)if(g.isAllowedForAction(i[o],n))return true;return false}static isAllowedForAction(e,r){return !c(r)||!c(e)?false:String(r).trim().toLowerCase()===String(e).trim().toLowerCase()}static get Session(){return Ae}static get secureStorage(){let e=Reflect.getMetadata(g.authStorageMetaData,g);return ct(e)&&(this._secureStorage=e),this._secureStorage?this._secureStorage:lt}static set secureStorage(e){ct(e)&&Reflect.defineMetadata(g.authStorageMetaData,e,g);}static getToken(){return f(this,null,function*(){return yield this.secureStorage.get("auth-token")})}static setToken(e){return f(this,null,function*(){yield this.secureStorage.set("auth-token",e);})}};g.events=Je({}),g.localUserRef={current:null},g._secureStorage=lt,g.authStorageMetaData=Symbol("auth:storage:meta");var Q=g;var ct=t=>{if(!t)return false;try{return ["get","set","remove"].every(e=>typeof t[e]=="function")}catch(e){return false}};var le=Symbol("fieldsResourcesMetadata");function Li(t){return function(e,r){var i;let n=Object.assign({},Reflect.getMetadata(le,e)||{}),a=String((i=Reflect.getMetadata("design:type",e,r))==null?void 0:i.name).toLowerCase();t.type===void 0&&(t.type=["string","number","boolean","date"].includes(a)?a:"text"),n[r]=S({name:r},Object.assign({},t)),Reflect.defineMetadata(le,n,e);}}function Ii(t){let e=Reflect.getMetadata(le,t.prototype);return Object.assign({},e)}function ut(t){let e=Reflect.getMetadata(le,Object.getPrototypeOf(t).constructor);return Object.assign({},e)}var ce=class t{static normalizePagination(e){let{page:r,skip:n,limit:a}=Object.assign({},e);return T(a)?(T(n)&&n>0?r=Math.floor(n/a)+1:T(r)&&r>0?n=(r-1)*a:(r=1,n=0),{page:r,skip:n,limit:a}):{}}static normalizeOrderBy(e){let r=Array.isArray(e)?e:c(e)?[e]:[],n={};return r.forEach(a=>{if(!c(a)||String(a).trim()==="")return;let i=String(a).startsWith("-"),o=i?"desc":"asc",s=i?String(a).slice(1):a,l=s;n[l]!==void 0&&console.warn(`Duplicate orderBy field: ${s}. Using last occurrence.`),n[l]=o;}),n}static canPaginateResult(e){return d(e)?T(e.limit):false}static getPaginationMetaData(e,r){let{limit:n,page:a,skip:i}=t.normalizePagination(r);e=T(e)?e:0;let o={total:e};return typeof n=="number"&&n>0&&typeof a=="number"&&a>=0&&(o.currentPage=a,o.pageSize=n,o.totalPages=Math.ceil(e/n),o.hasNextPage=o.currentPage<o.totalPages,o.hasPreviousPage=o.currentPage>1,o.nextPage=o.hasNextPage?o.currentPage+1:void 0,o.previousPage=o.hasPreviousPage?o.currentPage-1:void 0,o.lastPage=o.totalPages),o}static paginate(e,r,n){let a=t.getPaginationMetaData(r,n),{currentPage:i,pageSize:o,totalPages:s}=a;if(Array.isArray(e)&&T(i)&&T(o)&&T(s)){let l=Math.max(0,i-1)*o,u=l+o;e=e.slice(l,u);}return {data:e,total:r,meta:a}}static parseQueryOptions(e){var N;let r=x({},e==null?void 0:e.params,qe(e==null?void 0:e.url)),n=x({},r,(N=e==null?void 0:e.headers)==null?void 0:N["x-filters"],e==null?void 0:e.filters),a=Pe(n.limit),i=Pe(n.skip),o=Pe(n.page),s=t.normalizePagination({limit:a,skip:i,page:o}),l=n.distinct;typeof l=="number"&&(l=!!l),(typeof l=="boolean"||Array.isArray(l)&&l.length)&&(s.distinct=l);let u=n.orderBy,p=t.normalizeOrderBy(u);p&&Object.getSize(p,true)>0&&(s.orderBy=p);let b=Te(n.include);b.length&&(s.include=b);let D=n.cache;D!==void 0&&(s.cache=!!D);let v=n.cacheTTL;v!==void 0&&(s.cacheTTL=v);let h=nr(n.where);d(h)&&Object.getSize(h,true)&&(s.where=h);let A=n.includeDeleted;typeof A=="boolean"&&(s.includeDeleted=A);let C=Te(n.relations);return C.length&&(s.relations=C),F(S({},s),{queryParams:r})}},nr=(...t)=>{for(let e of t)if(Array.isArray(e)&&e.length||c(e)||d(e)&&Object.getSize(e,true))return e},Pe=t=>{if(Ce(t))return Number(t);if(typeof t=="number")return t};var dt=["$and","$or","$nor","$not"],mt=["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin","$exists","$type","$regex","$size","$mod","$all","$elemMatch"],zi={LOGICAL:dt,COMPARAISON:mt,ALL:[...dt,...mt],ARRAY:["$all","$elemMatch","$in","$nin"]};var ft=Symbol("resources"),ar=Symbol("resourceFromClassName"),ue=class ue{constructor(){this.init();}getMetaData(){return Object.assign({},Reflect.getMetadata(V.resourceMetaData,this.constructor))}destroy(){}getResourceContext(e){return F(S({},Object.assign({},e)),{resourceLabel:this.getLabel(),resourceName:this.getName()})}getI18n(){return k.getInstance()}get INVALID_DATA_PROVIDER_ERROR(){return this.getI18n().t("resources.invalidDataProvider",this.getResourceContext())}hasDataService(){let e=this.getDataService();return e!=null&&typeof(e==null?void 0:e.update)=="function"&&typeof(e==null?void 0:e.create)=="function"&&typeof(e==null?void 0:e.find)=="function"&&typeof(e==null?void 0:e.update)=="function"&&typeof(e==null?void 0:e.delete)=="function"}trigger(e,...r){ue.events.trigger(e,this.getResourceContext(),...r);}authorizeAction(e){return f(this,null,function*(){if(!this.hasDataService())throw new Error(this.INVALID_DATA_PROVIDER_ERROR);let r;switch(e){case "read":r=this.canUserRead();break;case "create":r=this.canUserCreate();break;case "update":r=this.canUserUpdate();break;case "delete":r=this.canUserDelete();break;default:r=this.isAllowed(e);break}if(!r)throw new Error(this.getI18n().t(this.buildTranslationPath("forbiddenError"),this.getResourceContext({action:e})))})}find(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>{var r;return (r=this.getDataService())==null?void 0:r.find(e).then(n=>(this.trigger("find",n),n))})})}findOne(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findOne(e).then(r=>(this.trigger("findOne",r),r)))})}buildTranslationPath(e){let r=this.getName(),n=`resources${c(r)?`.${r}`:""}.`;return c(e)?`${n}${e.trim().ltrim(".")}`:n}findOneOrFail(e){return f(this,null,function*(){let r=yield this.findOne(e);if(!d(r)||!r)throw new Error(this.getI18n().t(this.buildTranslationPath("notFoundError"),Object.assign({},{options:JSON.stringify(e)},this.getResourceContext())));return r})}beforeCreate(e){return f(this,null,function*(){})}afterCreate(e){return f(this,null,function*(){})}beforeUpdate(e,r){return f(this,null,function*(){})}afterUpdate(e,r,n){return f(this,null,function*(){})}beforeDelete(e){return f(this,null,function*(){})}afterDelete(e,r){return f(this,null,function*(){})}beforeCreateMany(e){return f(this,null,function*(){})}afterCreateMany(e,r){return f(this,null,function*(){})}beforeUpdateMany(e,r){return f(this,null,function*(){})}afterUpdateMany(e,r,n){return f(this,null,function*(){})}beforeDeleteMany(e){return f(this,null,function*(){})}afterDeleteMany(e,r){return f(this,null,function*(){})}create(e){return f(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreate(e).then(()=>this.getDataService().create(e).then(r=>this.afterCreate(r).then(()=>(this.trigger("create",r),r)))))})}update(e,r){return f(this,null,function*(){return this.authorizeAction("update").then(()=>f(this,null,function*(){return this.beforeUpdate(e,r).then(()=>{var n;return (n=this.getDataService())==null?void 0:n.update(e,r).then(a=>this.afterUpdate(a,e,r).then(()=>(this.trigger("update",a,e,r),a)))})}))})}delete(e){return f(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDelete(e).then(()=>{var r;return (r=this.getDataService())==null?void 0:r.delete(e).then(n=>this.afterDelete(n,e).then(()=>(this.trigger("delete",n,e),n)))}))})}findAndCount(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findAndCount(e).then(r=>(this.trigger("findAndCount",r),r)))})}findAndPaginate(e){return f(this,null,function*(){e=Object.assign({},e);let[r,n]=yield this.findAndCount(e);return ce.paginate(r,n,e)})}createMany(e){return f(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreateMany(e).then(()=>this.getDataService().createMany(e).then(r=>this.afterCreateMany(r,e).then(()=>(this.trigger("createMany",r,e),r)))))})}updateMany(e,r){return f(this,null,function*(){return this.authorizeAction("update").then(()=>this.beforeUpdateMany(e,r).then(()=>this.getDataService().updateMany(e,r).then(n=>this.afterUpdateMany(n,e,r).then(()=>(this.trigger("updateMany",n,e,r),n)))))})}deleteMany(e){return f(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDeleteMany(e).then(()=>this.getDataService().deleteMany(e).then(r=>this.afterDeleteMany(r,e).then(()=>(this.trigger("deleteMany",r,e),r)))))})}count(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().count(e).then(r=>(this.trigger("read",r),r)))})}exists(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().exists(e).then(r=>(this.trigger("exits",r),r)))})}updateMetadata(e){e=Object.assign({},e);let r=x({},this.getMetaData(),e);return Reflect.defineMetadata(V.resourceMetaData,r,this.constructor),r}init(){this.getFields();}getTranslations(e){e=m(e,this.getI18n().getLocale());let r=String(this.getName()).trim();if(!c(r))return {};let n=this.getI18n().get(["resources",r],e);return d(n)&&n?n:{}}translate(e,r){let n=c(e)?e.trim().split("."):Array.isArray(e)?e:[];return n[0]!=="resources"&&!V.hasResource(n[1])&&n.unshift(this.getName(),"resources"),this.getI18n().translate(n,r)}getName(){return m(this.name,this.getMetaData().name)}getActions(){return (!d(this.actions)||!this.actions)&&(this.actions={}),this.actions}hasAction(e){if(!c(e))return false;let r=this.getActions();return d(r[e])&&r[e]!==void 0}isAllowed(e,r){let n=[];return c(e)?n.push([this.getName(),e]):Array.isArray(e)&&e.forEach(a=>{c(a)&&n.push([this.getName(),a]);}),Q.isAllowed(n,r)}canUserRead(e){return this.isAllowed("read",e)}canUserCreate(e){return this.isAllowed("create",e)}canUserUpdate(e){return this.isAllowed("update",e)}canUserDelete(e){return this.isAllowed("delete",e)}translateProperty(e,r,n){e=m(e).trim(),n=Object.assign({},{resourceName:this.getName()},n);let a=this.getTranslations();if(c(e)&&a[e]){let i=H(this.getI18n().t(e,n));if(c(i)&&i.includes("."+e.ltrim(".")))return i}return m(r,e)}getLabel(){let e=this.getMetaData().label,r=this.translateProperty("label",m(e,this.label,this.getName()));return String(r).toLowerCase().trim()!="label"?r:m(this.getName())}getTitle(){return this.translateProperty("title",m(this.getMetaData().title,this.title,this.getLabel()))}getFields(){try{return this.fields=ut(this),this.fields}catch(e){w.log(e," getting resources fieldss");}return {}}interpolate(e,r,n){return ne(e,this.getResourceContext(r),S({tagRegex:/\{([^}]+)\}/g},n))}getActionLabel(e,r){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.label,r)}getActionTitle(e,r){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.title,r)}getAction(e){if(!c(e))return {};let r=this.getActions();return d(r[e])&&r[e]||{}}getPrimaryKeys(){let e=[];if(d(this.fields))for(let r in this.fields)d(this.fields[r])&&this.fields[r].primaryKey&&e.push(this.fields[r]);return e}};ue.events=he();var Oe=ue,E=class E{static getAllMetaData(){return Object.assign({},Reflect.getMetadata(ft,E))}static addMetaData(e,r){let n=this.getAllMetaData();!c(e)||!e||(r=Object.assign({},r),r.name=c(r==null?void 0:r.name)?r.name:e,n[e]=r,Reflect.defineMetadata(ft,n,E));}static getAllClassNames(){return Object.assign({},Reflect.getMetadata(ar,E))}static getNameFromClassName(e){return c(e)?this.getAllClassNames()[e]:void 0}static getMetaDataFromName(e){let r=this.getAllMetaData();if(!(!c(e)||!e))return r[e]}static getMetaDataFromClass(e){return Object.assign({},Reflect.getMetadata(E.resourceMetaData,e.prototype))}static getMetaDataByClassName(e){let r=this.getNameFromClassName(e);if(r)return this.getMetaDataFromName(r)}static getAllNames(){return Object.keys(this.resources)}static getResource(e){return typeof e=="string"&&e?this.resources[e]:null}static hasResource(e){if(!c(e)||!e)return false;let r=E.getMetaDataFromName(e);return d(r)&&(r==null?void 0:r.name)==e?true:!!this.getResource(e)}static addResource(e,r){typeof e=="string"&&e&&r&&r instanceof Oe&&(this.resources[e]=r);}static removeResource(e){return typeof e=="string"&&delete this.resources[e],this.resources}static getResources(){return this.resources}};E.resourceMetaData=Symbol("resource"),E.resources={};var V=E;function no(t){return function(e){if(t=Object.assign({},t),typeof e=="function"&&t!=null&&t.instanciate)try{let r=new e;r.updateMetadata(t),V.addResource(t.name,r);}catch(r){}Reflect.defineMetadata(V.resourceMetaData,t,e),V.addMetaData(t.name,t);}}
5
+ %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Dt={auth:Fe,currencies:ke,countries:Ee,dates:Be,resources:Ke,validator:Ue};function c(t){return !!(t&&typeof t=="string")}function m(...t){for(var e in t){let r=t[e];if(c(r))return r}return ""}function X(t){return !!(t==null||typeof t=="undefined"||typeof t=="string"&&t===""||Array.isArray(t)&&!t.length)}function T(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function j(t){return !t||typeof t!="object"?false:t instanceof Date?true:typeof t.getTime!="function"?false:!(Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))}var y=class y{static parseString(e,r){if(c(e)&&c(r))try{let n=$__default.default(e,r,!0);if(n.isValid())return {date:n.toDate(),matchedFormat:r,isValid:!0}}catch(n){}try{if(Array.isArray(r)&&(r!=null&&r.length))for(let n of r){let a=He(e,n);if(a)return a}for(let n of y.DATE_FORMATS){let a=He(e,n);if(a)return a}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(n){return {date:null,matchedFormat:null,isValid:false,error:n instanceof Error?n.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let r=e?y.parseDate(e):new Date;return r?r.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,r){if(y.isDateObj(e))return e;if(!c(r)){let n=y.parseString(e);return n!=null&&n.isValid?n.date:null}if(X(e))return null;try{let n=$__default.default(e,r,!0);if(n!=null&&n.isValid())return n.toDate()}catch(n){console.error(n," parsing date with moment : ",e," format is : ",r);}return null}static toSQLDateTimeFormat(e){if(!y.isDateObj(e))return "";let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return `${r}-${n}-${a} ${i}:${o}:${s}`}static getI18n(e){return k.isI18nInstance(e)?e:k.getInstance()}static getDefaultDateTimeFormat(e){return m(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return m(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!y.isDateObj(e))return "";let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${r}-${n}-${a}`}static toSQLTimeFormat(e){if(!y.isDateObj(e))return "";let r=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return `${r}:${n}:${a}`}static getDefaultTimeFormat(e){return m(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,r){if(e==null||typeof e=="boolean")return false;if(y.isDateObj(e))return true;if(T(e)){let a=new Date(e);return a&&!isNaN(a.getTime())}if(c(e))return !!y.parseDate(e,r);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let n=new Date(e);return y.isDateObj(n)}static addToDate(e,r,n){if(T(e)||(e=0),X(r)&&(r=new Date),y.isValidDate(r)&&c(r)&&(r=new Date(r)),y.isValidDate(r)||(r=c(r)?new Date(r):new Date),c(n)&&typeof r["set"+n]=="function"&&typeof r["get"+n]=="function"){let a="set"+n,i="get"+n;r=new Date(r[a](r[i]()+e));}return r}static addDays(e,r){return y.addToDate(e,r,"Date")}static addMilliseconds(e,r){return T(e)||(e=0),y.isDateObj(r)||(r=new Date),r=r||new Date,new Date(r.getTime()+e)}static addSeconds(e,r){return T(e)||(e=0),y.addMilliseconds(e*1e3,r)}static addMinutes(e,r){return T(e)||(e=0),y.addMilliseconds(e*6e4,r)}static addHours(e,r){return T(e)||(e=0),y.addMilliseconds(e*36e5,r)}static addMonths(e,r,n){return y.addToDate(e,r,"Month")}static addWeeks(e,r){return e=(T(e)?e:0)*7,y.addToDate(e,r,"Date")}static addYears(e,r){T(e)||(e=0);let n=new Date(y.addToDate(0,r)),a=n.getFullYear();return a+e<0?e=0:e+=a,n.setFullYear(e),new Date(n)}static formatDate(e,r){try{let n=$__default.default(e);if(n.isValid())return n.format(m(r,y.getDefaultDateTimeFormat()))}catch(n){}return m(y.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let r=e?$__default.default.utc(e):$__default.default.utc();return {year:r.year(),day:r.day(),month:r.month(),monthString:r.format("MM"),hours:r.hours(),date:r.date(),minutes:r.minutes(),seconds:r.seconds(),monthName:r.format("MMMM"),dayName:r.format("dddd"),dayNameShort:r.format("ddd")}}};y.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],y.SQL_DATE_FORMAT="YYYY-MM-DD",y.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",y.SQL_TIME_FORMAT="HH:mm:ss",y.getCurrentMonthDaysRange=e=>{let r=y.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(r.getFullYear(),r.getMonth(),1),a=new Date(r.getFullYear(),r.getMonth()+1,0);return {first:n,last:a}},y.getPreviousWeekDaysRange=e=>{let r=y.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(r.getTime()-3600*24*7*1e3),a=new Date(n),i=n.getDay(),o=n.getDate()-i+(i===0?-6:1),s=new Date(n.setDate(o)),l=new Date(a.setDate(o+6));return {first:s,last:l}},y.getCurrentWeekDaysRange=e=>{let r=y.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=r.getDay(),a=r.getDate()-n+(n==0?-6:1),i=new Date(r),o=new Date(r.setDate(a));return i.setDate(i.getDate()+6),{first:o,last:i}},y.isDateObj=j;var M=y,He=(t,e)=>{let r=$__default.default(t,e,true);try{if(r.isValid()&&r.format(e)===t||$__default.default.utc(r,!0).format(e)===t)return {date:r.toDate(),matchedFormat:e,isValid:!0}}catch(n){}return null};Date.prototype.toSQLDateTimeFormat=function(){return M.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return M.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return M.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(t){return M.formatDate(this,t)};Date.prototype.addYears=function(t){return M.addYears(t,this)};Date.prototype.addMonths=function(t){return M.addMonths(t,this)};Date.prototype.addMinutes=function(t){return M.addMinutes(t,this)};Date.prototype.addSeconds=function(t){return M.addSeconds(t,this)};Date.prototype.addDays=function(t){return M.addDays(t,this)};Date.prototype.addWeeks=function(t){return M.addWeeks(t,this)};Date.prototype.addHours=function(t){return M.addHours(t,this)};var L=class L{static get logger(){let e=Reflect.getMetadata(L.loggerMetaData,L);return Ve(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){Ve(e)&&Reflect.defineMetadata(L.loggerMetaData,e,L);}static _log(e,...r){let n=L.logger;e=m(e),e&&typeof n[e]=="function"?n[e](L.getDateTimeString(),...r):console.log("Logger level not found : [",e,"]",...r);}static getDateTimeString(){let{day:e,year:r,hours:n,minutes:a,seconds:i,dayNameShort:o,monthName:s}=M.getUTCDateTimeDetails(),l=e<10?"0"+e:e,u=n<10?"0"+n:n,p=a<10?"0"+a:a,b=i<10?"0"+i:i;return "["+[o,l,s,r].join(" ")+" "+[u,p,b].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};L.loggerMetaData=Symbol("logger-meta-data");var w=L,Ve=t=>{if(!t)return false;try{return ["warn","info","error"].every(e=>typeof t[e]=="function")}catch(e){return false}};function Ct(t){return typeof t=="boolean"||!t||typeof t=="number"||typeof t=="string"||typeof t=="symbol"?false:Object(t).constructor===Promise||t.constructor&&(t.constructor.name==="Promise"||t.constructor.name==="AsyncFunction")||t instanceof Promise||typeof(t==null?void 0:t.then)=="function"&&typeof(t==null?void 0:t.catch)=="function"&&typeof(t==null?void 0:t.finally)=="function"?true:t&&typeof t.constructor=="function"&&Function.prototype.toString.call(t.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ye(t){return t&&Object.prototype.toString.call(t)==="[object Promise]"?true:Ct(t)}function $e(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var _=()=>{var t;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((t=process==null?void 0:process.versions)!=null&&t.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},St=()=>{var t,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((t=window==null?void 0:window.process)==null?void 0:t.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Rt=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(t){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},Nt=()=>typeof window=="undefined"&&typeof process!="undefined",Ge=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Mt=()=>{if(!$e()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let t=navigator.userAgent.toLowerCase();return /android/i.test(t)},At=()=>{var t;return !Ge()||!(window!=null&&window.ReactNativeWebView)?false:typeof((t=window==null?void 0:window.ReactNativeWebView)==null?void 0:t.postMessage)=="function"},vt=()=>_()&&process.platform==="darwin",Pt=()=>_()&&process.platform==="win32",Ot=()=>_()&&process.platform==="linux",ze={isWeb:$e,isLinux:Ot,isDarwin:vt,isWin32:Pt,isNode:_,isElectron:St,isTouchDevice:Rt,isServerSide:Nt,isClientSide:Ge,isAndroidMobileBrowser:Mt,isReactNativeWebview:At};var B=class t{static decycle(e,r=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(r.includes(e))return null;let n=r.concat([e]);return Array.isArray(e)?e.map(a=>t.decycle(a,n)):Object.fromEntries(Object.entries(e).map(([a,i])=>[a,t.decycle(i,n)]))}static stringify(e,r=false,n,a){return typeof e=="string"?e:JSON.stringify(r!==false?t.decycle(e):e,n,a)}static isJSON(e){if(typeof e!="string")return false;let r=e.trim();if(r.length===0)return false;let n=r[0];if(n!=="{"&&n!=="[")return false;try{let a=JSON.parse(r);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(e,r){if(typeof e=="string")try{e=JSON.parse(e,r);}catch(n){return e}if(e&&typeof e=="object")for(let n in e){let a=e[n];t.isJSON(a)&&(e[n]=t.parse(a,r));}return e}};var K=class K{static get storage(){var r;let e=Reflect.getMetadata(K.sessionStorageMetaData,K);if(ge(e)&&(this._storage=e),this._storage)return this._storage;if(ze.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((r=window.localStorage)!=null&&r.getItem))this._storage={get:n=>window.localStorage.getItem(n),set:(n,a)=>window.localStorage.setItem(n,a),remove:n=>window.localStorage.removeItem(n),removeAll:()=>window.localStorage.clear()};else {let n={};this._storage={get:a=>n[a],set:(a,i)=>n[a]=i,remove:a=>{delete n[a];},removeAll:()=>n={}};}return this._storage}static set storage(e){ge(e)&&Reflect.defineMetadata(K.sessionStorageMetaData,e,K);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){c(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!c(e))return "";e=e.trim().replace(/\s+/g,"-");let r=this.keyNamespace;return r?`${r}-${e}`:e}};K.sessionStorageMetaData=Symbol("sessionStorage"),K._keyNamespace=void 0;var O=K;function ee(t){return O.sanitizeKey(t)}var We=(t,e)=>(t=t&&B.stringify(t,e),t==null&&(t=""),t),je=t=>{if(ye(t))return new Promise((e,r)=>{t.then(n=>{e(B.parse(n));}).catch(n=>{r(n);});});if(t!=null)return B.parse(t)},xt=t=>{if(t=ee(t),O.storage&&t&&typeof t=="string"){let e=O.storage.get(t);return je(e)}},wt=t=>{if(t=ee(t),O.storage&&t&&typeof t=="string")return O.storage.remove(t)},Yt=()=>{if(O.storage)return O.storage.removeAll()},ge=t=>{if(!t)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof t[e]=="function")}catch(e){return false}},R={get:xt,set:(t,e,r=true)=>(t=ee(t),O.storage.set(t,We(e,r))),remove:wt,handleGetValue:je,sanitizeKey:ee,handleSetValue:We,isValidStorage:ge,Manager:O,removeAll:Yt};function G(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function z(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}function pe(t){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:t===document?true:"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&typeof t=="object"&&t.nodeType===1&&!!t.nodeName}function d(t){if(t===null||typeof t!="object"||pe(t)||j(t)||z(t)||G(t))return false;let e=Object.getPrototypeOf(t);if(e===null)return true;let r=e.constructor;if(typeof r!="function")return false;if(r===Object)return true;let n=r.prototype;return typeof n!="object"?false:n===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function be(t){if(Array.isArray(t)){let n=[];for(var e=0;e<t.length;e++)n[e]=be(t[e]);return n}else if(d(t)&&t){let n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=be(t[r]));return n}else return t}Object.getSize=function(t,e=false){if(!t||typeof t!="object")return 0;if(Array.isArray(t))return t.length;typeof e!="boolean"&&(e=false);let r=0;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&(r++,e===true))return r;return r};function x(t,...e){let r=Array.isArray(t),n=d(t);(t==null||!r&&!n)&&(t={});for(let a=0;a<e.length;a++){let i=e[a];if(i==null)continue;let o=d(i),s=Array.isArray(i);if(!(!o&&!s)){if(r){s&&Ze(t,i);continue}else if(s)continue;for(let l in i){let u=i[l];if(u==null)continue;if(u===i){t[l]=t;continue}let p=t[l],b=Array.isArray(p),D=Array.isArray(u);if(b){D?Ze(t[l],u):t[l]=u;continue}else if(!d(p)){t[l]=u;continue}if(D||!d(u)){t[l]=u;continue}t[l]=x({},p,u);}}}return t}var Ze=(t,e)=>{let r=e.length,n=0;for(let a=0;a<t.length;a++){let i=t[a],o=e[a];if(a<r){let s=Array.isArray(i),l=Array.isArray(o),u=d(i),p=d(o);s&&l||u&&p?(t[n]=x(s?[]:{},i,o),n++):o!=null?(t[n]=o,n++):i!=null&&(t[n]=i,n++);}}for(let a=t.length;a<r;a++)e[a]!==void 0&&e[a]!==null&&t.push(e[a]);return t};function re(t,e){return te(t,"",{},e)}function te(t,e="",r={},n){if(r=d(r)?r:{},G(t)||j(t)||z(t)||Array.isArray(t)&&(n!=null&&n.skipArrays))return e&&(r[e]=t),r;if(typeof t=="function"||typeof t=="object"&&!d(t)&&!Lt(t))return r;if(t instanceof Map||t instanceof WeakMap)return Array.from(t.entries()).forEach(([a,i])=>{let o=e?`${e}[${String(a)}]`:String(a);te(i,o,r,n);}),r;if(Array.isArray(t)||t instanceof Set||t instanceof WeakSet)return (Array.isArray(t)?t:Array.from(t)).forEach((i,o)=>{let s=e?`${e}[${o}]`:String(o);te(i,s,r,n);}),r;if(d(t))for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let i=t[a],o=e?e.endsWith("]")?`${e}.${a}`:`${e}.${a}`:a;te(i,o,r,n);}return r}function Lt(t){return Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof WeakMap||t instanceof WeakSet}function It(t){return Object.entries(t)}Object.typedEntries=It;Object.flatten=re;Object.clone=be;function Z(t,e){if(t==null)return "";if(typeof t=="string")return t;if((typeof t=="number"||typeof t=="object"&&t instanceof Number)&&typeof t.formatNumber=="function")return t.formatNumber();if(t instanceof Date||typeof t=="object"&&t!==null&&t.constructor===Date)return typeof t.toFormat=="function"?t.toFormat():t.toISOString();if(t instanceof Error)return `Error: ${t.message}`;if(z(t))return t.toString();if(G(t))return String(t);if(Array.isArray(t))return JSON.stringify(t);if(typeof t=="object"&&t!==null){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();if(typeof t.toString=="function"){let r=t.toString();if(r!=="[object Object]")return r}return JSON.stringify(t)}return typeof(t==null?void 0:t.toString)=="function"?t.toString():String(t)}function ne(t,e,r){let n=(r==null?void 0:r.valueFormatter)||Z,a=m(t);if(!d(e)||!e)return a;let i=(r==null?void 0:r.tagRegex)||/%\{([^}]+)\}/g,o=new Set,s,l=m(t);for(;(s=i.exec(l))!==null;){let u=s[1];u!==void 0&&o.add(u);}return o.forEach(u=>{if(r!=null&&r.tagRegex){let h=new RegExp(r.tagRegex.source,r.tagRegex.flags);[...l.matchAll(h)].forEach(C=>{let N=C[0];if(!C[1])return;let J=C[1],de=Object.prototype.hasOwnProperty.call(e,J)?e[J]:void 0,yt=de===void 0?"":(()=>{try{return n(de,J,Z)}catch(ir){return Z(de)}})(),gt=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(gt,"g"),yt);});return}let p=`%{${u}}`,b=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,D=b===void 0?"":(()=>{try{return n(b,u,Z)}catch(h){return Z(b)}})(),v=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(v,"g"),D);}),a}var P=class P{constructor(e={},r={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;c(r.locale)&&(this.locale=r.locale),c(r.fallbackLocale)&&(this._fallbackLocale=r.fallbackLocale),typeof r.interpolate=="function"&&(this.interpolateFunc=r.interpolate),this._hasDefaultTranslations||(this.registerTranslations(fe),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!P.instance){let r=P.getLocaleFromSession(),n=Object.assign({locale:r||"en"},e);P.instance=new P({},n);}return P.instance}static createInstance(e={},r={}){return new P(e,r)}static flattenObject(e){return d(e)?re(e):e}static getLocaleFromSession(){let e=R.get("i18n.locale");return c(e)?e:void 0}static registerMomentLocale(e,r){return c(e)&&d(r)&&Array.isArray(r.months)&&(this.momentLocales[e]=x({},this.momentLocales[e],r)),this.momentLocales}static getClassTanslationKeys(e){return me(e,Qe)}translate(e,r){var o;r=r||{};let n=m(r==null?void 0:r.locale,this.getLocale()),a=Array.isArray(e)?e:[e],i;for(let s of a){if(!c(s))continue;let l=this.lookup(s,n);if(l===void 0&&n!==this._fallbackLocale&&(l=this.lookup(s,this._fallbackLocale)),l!==void 0){i=l;break}}if(i===void 0)return r.defaultValue!==void 0?r.defaultValue:this.missingTranslation(e,r);if(typeof r.count=="number"&&d(i)){let s=r.count,l="other";s===0&&i.zero!==void 0?l="zero":s===1&&i.one!==void 0&&(l="one"),i[l]!==void 0?i=i[l]:i.other&&(i=i.other);}return typeof i=="string"&&(T(r.count)&&!r.countStr&&(r.countStr=typeof((o=r.count)==null?void 0:o.formatNumber)=="function"?r.count.formatNumber():r.count.toString()),i=this.performInterpolation(i,r)),i}t(e,r){return this.translate(e,r)}has(e,r){let n=r||this.getLocale(),a=Array.isArray(e)?e:[e];for(let i of a)if(this.lookup(i,n)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,r=false){return f(this,null,function*(){return this.locale===e&&r!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&P.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),r=Array.isArray(this._locales)?this._locales:["en"],n=[...e,...r.filter(a=>!e.includes(a))];return Array.from(new Set(n))}hasLocale(e){return c(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===P.instance}registerTranslations(e){return this._translations=x({},this._translations,e),this._translations}getTranslations(e){return c(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,r){if(!c(e)||typeof r!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=r;}loadNamespace(e,r,n=true){return !c(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(r=m(r,this.getLocale()),c(r)?this.namespaceResolvers[e](r).then(a=>{let i={};return i[r]=Object.assign({},a),d(a)&&n!==false&&this.registerTranslations(i),i}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,r=true){return f(this,null,function*(){e=m(e,this.getLocale());let n=[],a={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&n.push(this.namespaceResolvers[o](e).then(s=>{x(a,s);}));yield Promise.all(n);let i={};return i[e]=a,r!==false&&this.registerTranslations(i),this._namespacesLoaded[e]=true,i})}get(e,r){r=m(r,this.getLocale());let n=(c(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(c);if(!n.length)return;let a=this.getTranslations(r);for(let i of n)if(d(a))a=a[i];else return;return a}translateClass(e,r){let n=P.getClassTanslationKeys(e);for(let a in n)c(n[a])&&(n[a]=this.translate(n[a],r));return n}translateObject(e,r){if(!d(e))return {};let n={};for(let a in e){let i=e[a];c(i)&&(n[a]=this.translate(i,r));}return n}applyTranslations(e){try{let r=Object.getOwnPropertyNames(e);for(let n of r){let a=Reflect.getMetadata(Qe,e,n);if(a)try{e[n]=this.translate(a);}catch(i){w.error(i," resolving translation for key : ",a," on object : ",e);}}}catch(r){w.error(r," resolving translations for object : ",e);}}missingTranslation(e,r){let n=m(Array.isArray(e)?e.filter(c)[0]:m(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,n,m(r==null?void 0:r.defaultValue),r):n}lookup(e,r){let n=this._translations[r];if(!n)return;if(Object.prototype.hasOwnProperty.call(n,e))return n[e];let a=e.split("."),i=n;for(let o of a)if(d(i)&&Object.prototype.hasOwnProperty.call(i,o))i=i[o];else return;return i}performInterpolation(e,r){let n=re(r);return this.interpolateFunc?this.interpolateFunc(this,e,r):this.defaultInterpolator(e,n)}defaultInterpolator(e,r){return ne(e,r,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){R.set("i18n.locale",e);}getMomentLocale(e){return P.momentLocales[e]}setMomentLocale(e){try{return $__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(r){console.error(r," setting moment locale : ",e);}return false}};P.momentLocales={};var k=P,ae=k.getInstance();var Qe=Symbol("TRANSLATION_KEY");var he=function(t){let e={},r={},n=Array.prototype.slice;return F(S({},Object.assign({},t)),{on:function(a,i){return i&&a&&(e[a]=e[a]||[]).push(i),{remove:()=>{this.off(a,i);}}},finally:function(a,i){return i&&a?((r[a]=r[a]||[]).push(i),this):this},off:function(a,i){if(!a)return this;if(a=="*"&&!i)e={};else if(i)for(var o=e[a],s=0,l;l=o&&o[s];++s)l==i&&o.splice(s--,1);return this},once:function(a,i){let o=(...s)=>{this.off(a,o),i.apply(this,s);};return this.on(a,o)},trigger:function(a,...i){if(!a)return this;let o,s,l,u=null;typeof i[i.length-1]=="function"&&(u=i.pop()),o=n.call(e[a]||[],0);let p=[];for(l=0;s=o[l];++l)typeof s=="function"&&p.push(s.apply(this,i));typeof e["*"]=="function"&&a!="*"&&(this.trigger(a,...i),this.trigger("*",...i));var b=n.call(r[a]||[],0);for(l=0;s=b[l];++l)s.call(this,p,i);return u&&u.call(this,p,i),this},offAll:function(){return e={},r={},this},getEventCallBacks:function(){return e}})},Je=function(t){if(Ft(t))return t;let e=t||{},r=he();return Object.defineProperties(e,{_____isObservable:{value:true},on:{value:r.on.bind(e)},finally:{value:r.finally.bind(e)},off:{value:r.off.bind(e)},offAll:{value:r.offAll.bind(e)},once:{value:r.once.bind(e)},getEventCallBacks:{value:r.getEventCallBacks.bind(e)},trigger:{value:r.trigger.bind(e)}}),e};function Ft(t){if(!t||["string","boolean","number"].includes(typeof t))return false;try{return (t==null?void 0:t._____isObservable)===!0&&typeof(t==null?void 0:t.on)=="function"&&typeof(t==null?void 0:t.trigger)=="function"&&typeof(t==null?void 0:t.off)=="function"}catch(e){}return false}function Te(...t){if(t.length===1)return Array.isArray(t[0])?t[0]:[];let e=null;for(var r in t){let n=t[r];if(Array.isArray(n)){if(n.length)return n;e||(e=n);}}return e||[]}var ie=function(t,e=""){if(!t||typeof t!="string")return "";if(!e||typeof e!="string")return t.trim();let r=t.length;for(;t.startsWith(e)&&r>=0;)t=t.slice(e.length),--r;return t.toString()},De=function(t,e=""){if(!t||typeof t!="string")return "";if(!e||typeof e!="string")return t.trim();let r=t.length;for(;t.endsWith(e)&&r>=0;)t=t.slice(0,-e.length),--r;return t.toString()},Ce=(t,e=true)=>typeof t!="string"?false:e!==false?/^\d*\.?\d+$/.test(t):/^\d+$/.test(t);String.prototype.ltrim=function(t){return ie(this.toString(),t)};String.prototype.rtrim=function(t){return De(this.toString(),t)};String.prototype.isNumber=function(t=true){return Ce(this.toString(),t)};String.prototype.replaceAll=function(t,e){return !c(t)||!c(e)?this.toString():this.toString().split(t).join(e)};var kt=t=>c(t)?(t=t.trim(),t.replace(/(.)([A-Z][a-z]+)/,"$1_$2").replace(/([a-z0-9])([A-Z])/,"$1_$2").toUpperCase()):"";String.prototype.toSnakeCase=function(){return kt(this.toString())};var Bt=t=>c(t)?(t=t.trim(),t.charAt(0)+t.replace(/(_\w)/g,e=>e[1].toUpperCase()).substring(1)):"";String.prototype.toCamelCase=function(){return Bt(this.toString())};var Kt=function(t){return !t||typeof t!="string"?"":(t=t.trim(),t.charAt(0).toUpperCase()+t.slice(1))};String.prototype.upperFirst=function(){return Kt(this.toString())};var Ut=function(t){return !t||typeof t!="string"?"":(t=t.trim(),t.charAt(0).toLowerCase()+t.slice(1))};String.prototype.lowerFirst=function(){return Ut(this.toString())};var Vt=(t,e=true)=>{if(typeof t!="string")return "";let r=$t(t);return t=typeof r.search=="string"?r.search:"",e&&t?"?"+ie(t,"?"):(t=De(ie(t.trim(),"?"),"?"),t)},qe=function(t,e={}){return typeof t!="string"?{}:Ht__default.default.parse(Vt(t,false),S({allowSparse:true,decoder:r=>decodeURIComponent(r.replace(/\+/g," "))},Object.assign({},e)))};var $t=t=>{if(typeof t!="string")return {};if(typeof URL!="undefined"&&URL&&Gt(t))try{return new URL(t)}catch(n){}t=zt(t)?decodeURIComponent(t):t;var e=t.match(/^(([^:\\/?#]+:)?(?:\/\/((?:([^\\/?#:]*):([^\\/?#:]*)@)?([^\\/?#:]*)(?::([^\\/?#:]*))?)))?([^?#]*)(\?[^#]*)?(#.*)?$/);let r=e?{hash:e[10]||"",host:e[3]||"",hostname:e[6]||"",href:e[0]||"",origin:e[1]||"",pathname:e[8]||(e[1]?"/":""),port:e[7]||"",protocol:e[2]||"",search:e[9]||"",username:e[4]||"",password:e[5]||""}:{};return r.protocol&&r.protocol.length==2&&(r.protocol="file:///"+r.protocol.toUpperCase(),r.origin=r.protocol+"//"+r.host),r.protocol&&(r.href=r.origin+r.pathname+r.search+r.hash),r};function Gt(t,e={}){let{requireHost:r=true,allowedProtocols:n}=Object.assign({},e);if(!c(t)||!c(t.trim()))return false;let a=t;if(typeof URL!="undefined"&&URL)try{let i=new URL(a);if(!i.protocol||i.protocol===":")return !1;let o=i.protocol.slice(0,-1);if(n&&n.length>0&&!n.includes(o))return !1;if(r)if(["http","https","ftp","ftps","ws","wss"].includes(o)){if(!c(i.hostname)||!i.hostname.trim()||!c(i.host)||!i.host.trim())return !1;let l=`${o}://`;if(!a.startsWith(l)||a.slice(l.length).startsWith("/"))return !1;let p=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,b=i.hostname.match(p);if(b&&!b.slice(1,5).map(Number).every(h=>h>=0&&h<=255))return !1}else return !1;return !0}catch(i){return false}if(r){let i=a.indexOf("://");if(i===-1)return false;let o=a.slice(0,i);if(!o||n&&n.length>0&&!n.includes(o))return false;let s=a.slice(i+3);if(s==="")return false;let l=s.indexOf("@"),u=l>=0?s.slice(l+1):s;if(u===""||u.startsWith("/"))return false;let p=u.indexOf("/"),b=u.indexOf("?"),D=u.indexOf("#"),v=Math.min(p>=0?p:u.length,b>=0?b:u.length,D>=0?D:u.length),h=u.slice(0,v);if(!h)return false;let A=h;if(h.startsWith("[")){let C=h.indexOf("]");if(C===-1)return false;A=h.slice(0,C+1);let N=h.slice(C+1);if(N&&!N.startsWith(":"))return false}else {let C=h.indexOf(":");C>=0&&(A=h.slice(0,C));}if(!A)return false;if(A==="localhost")return true;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(A))return !A.split(".").map(Number).some(N=>N>255||N<0);if(/^\[.*\]$/.test(A)){let C=A.slice(1,-1);return !(!C||C.includes(":::"))}return !!(/^[a-zA-Z\d-]*(\.[a-zA-Z\d-]+)*$/.test(A)&&A!=="")}else {let i="[a-zA-Z][a-zA-Z\\d+\\-.]*";return n&&n.length>0&&(i=`(?:${n.join("|")})`),new RegExp(`^(${i}):.+$`).test(a)}}var zt=t=>{if(!c(t)||!t.includes("%"))return false;let e=/%[0-9A-Fa-f]{2}/g;if(!t.match(e))return false;try{let n=decodeURIComponent(t);if(n!==t)return !0;try{if(decodeURIComponent(n)!==n)return !0}catch(a){return !0}}catch(n){return false}return false};var Y={USD:{symbol:"$",name:"US Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"USD",namePlural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbolNative:"$",decimalDigits:2,format:"%s %v",rounding:0,code:"CAD",namePlural:"Canadian dollars"},EUR:{symbol:"\u20AC",name:"Euro",symbolNative:"\u20AC",decimalDigits:2,rounding:0,code:"EUR",namePlural:"euros"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbolNative:"\u062F.\u0625.\u200F",decimalDigits:2,rounding:0,code:"AED",namePlural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbolNative:"\u060B",decimalDigits:0,rounding:0,code:"AFN",namePlural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbolNative:"Lek",decimalDigits:0,rounding:0,code:"ALL",namePlural:"Albanian lek\xEB"},AMD:{symbol:"AMD",name:"Armenian Dram",symbolNative:"\u0564\u0580.",decimalDigits:0,rounding:0,code:"AMD",namePlural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"ARS",namePlural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"AUD",namePlural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbolNative:"\u043C\u0430\u043D.",decimalDigits:2,rounding:0,code:"AZN",namePlural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbolNative:"KM",decimalDigits:2,rounding:0,code:"BAM",namePlural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbolNative:"\u09F3",decimalDigits:2,rounding:0,code:"BDT",namePlural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbolNative:"\u043B\u0432.",decimalDigits:2,rounding:0,code:"BGN",namePlural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbolNative:"\u062F.\u0628.\u200F",decimalDigits:2,rounding:0,code:"BHD",namePlural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbolNative:"FBu",decimalDigits:0,rounding:0,code:"BIF",namePlural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BND",namePlural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbolNative:"Bs",decimalDigits:2,rounding:0,code:"BOB",namePlural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbolNative:"R$",decimalDigits:2,rounding:0,code:"BRL",namePlural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbolNative:"P",decimalDigits:2,rounding:0,code:"BWP",namePlural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbolNative:"BYR",decimalDigits:0,rounding:0,code:"BYR",namePlural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BZD",namePlural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbolNative:"FrCD",decimalDigits:2,rounding:0,code:"CDF",namePlural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbolNative:"CHF",decimalDigits:2,rounding:.05,code:"CHF",namePlural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"CLP",namePlural:"Chilean pesos"},CNY:{symbol:"CN\xA5",name:"Chinese Yuan",symbolNative:"CN\xA5",decimalDigits:2,rounding:0,code:"CNY",namePlural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"COP",namePlural:"Colombian pesos"},CRC:{symbol:"\u20A1",name:"Costa Rican Col\xF3n",symbolNative:"\u20A1",decimalDigits:0,rounding:0,code:"CRC",namePlural:"Costa Rican col\xF3ns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbolNative:"CV$",decimalDigits:2,rounding:0,code:"CVE",namePlural:"Cape Verdean escudos"},CZK:{symbol:"K\u010D",name:"Czech Republic Koruna",symbolNative:"K\u010D",decimalDigits:2,rounding:0,code:"CZK",namePlural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbolNative:"Fdj",decimalDigits:0,rounding:0,code:"DJF",namePlural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"DKK",namePlural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbolNative:"RD$",decimalDigits:2,rounding:0,code:"DOP",namePlural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbolNative:"\u062F.\u062C.\u200F",decimalDigits:2,rounding:0,code:"DZD",namePlural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbolNative:"kr",decimalDigits:2,rounding:0,code:"EEK",namePlural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbolNative:"\u062C.\u0645.\u200F",decimalDigits:2,rounding:0,code:"EGP",namePlural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbolNative:"Nfk",decimalDigits:2,rounding:0,code:"ERN",namePlural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbolNative:"Br",decimalDigits:2,rounding:0,code:"ETB",namePlural:"Ethiopian birrs"},GBP:{symbol:"\xA3",name:"British Pound Sterling",symbolNative:"\xA3",decimalDigits:2,rounding:0,code:"GBP",namePlural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbolNative:"GEL",decimalDigits:2,rounding:0,code:"GEL",namePlural:"Georgian laris"},GHS:{symbol:"GH\u20B5",name:"Ghanaian Cedi",symbolNative:"GH\u20B5",decimalDigits:2,rounding:0,code:"GHS",namePlural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbolNative:"FG",decimalDigits:0,rounding:0,code:"GNF",namePlural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbolNative:"Q",decimalDigits:2,rounding:0,code:"GTQ",namePlural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"HKD",namePlural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbolNative:"L",decimalDigits:2,rounding:0,code:"HNL",namePlural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbolNative:"kn",decimalDigits:2,rounding:0,code:"HRK",namePlural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbolNative:"Ft",decimalDigits:0,rounding:0,code:"HUF",namePlural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbolNative:"Rp",decimalDigits:0,rounding:0,code:"IDR",namePlural:"Indonesian rupiahs"},ILS:{symbol:"\u20AA",name:"Israeli New Sheqel",symbolNative:"\u20AA",decimalDigits:2,rounding:0,code:"ILS",namePlural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbolNative:"\u099F\u0995\u09BE",decimalDigits:2,rounding:0,code:"INR",namePlural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbolNative:"\u062F.\u0639.\u200F",decimalDigits:0,rounding:0,code:"IQD",namePlural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbolNative:"\uFDFC",decimalDigits:0,rounding:0,code:"IRR",namePlural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Kr\xF3na",symbolNative:"kr",decimalDigits:0,rounding:0,code:"ISK",namePlural:"Icelandic kr\xF3nur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"JMD",namePlural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbolNative:"\u062F.\u0623.\u200F",decimalDigits:2,rounding:0,code:"JOD",namePlural:"Jordanian dinars"},JPY:{symbol:"\xA5",name:"Japanese Yen",symbolNative:"\uFFE5",decimalDigits:0,rounding:0,code:"JPY",namePlural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbolNative:"Ksh",decimalDigits:2,rounding:0,code:"KES",namePlural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbolNative:"\u17DB",decimalDigits:2,rounding:0,code:"KHR",namePlural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbolNative:"FC",decimalDigits:0,rounding:0,code:"KMF",namePlural:"Comorian francs"},KRW:{symbol:"\u20A9",name:"South Korean Won",symbolNative:"\u20A9",decimalDigits:0,rounding:0,code:"KRW",namePlural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbolNative:"\u062F.\u0643.\u200F",decimalDigits:2,rounding:0,code:"KWD",namePlural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbolNative:"\u0442\u04A3\u0433.",decimalDigits:2,rounding:0,code:"KZT",namePlural:"Kazakhstani tenges"},LBP:{symbol:"LB\xA3",name:"Lebanese Pound",symbolNative:"\u0644.\u0644.\u200F",decimalDigits:0,rounding:0,code:"LBP",namePlural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbolNative:"SL Re",decimalDigits:2,rounding:0,code:"LKR",namePlural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbolNative:"Lt",decimalDigits:2,rounding:0,code:"LTL",namePlural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbolNative:"Ls",decimalDigits:2,rounding:0,code:"LVL",namePlural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbolNative:"\u062F.\u0644.\u200F",decimalDigits:2,rounding:0,code:"LYD",namePlural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbolNative:"\u062F.\u0645.\u200F",decimalDigits:2,rounding:0,code:"MAD",namePlural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbolNative:"MDL",decimalDigits:2,rounding:0,code:"MDL",namePlural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbolNative:"MGA",decimalDigits:0,rounding:0,code:"MGA",namePlural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbolNative:"MKD",decimalDigits:2,rounding:0,code:"MKD",namePlural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbolNative:"K",decimalDigits:0,rounding:0,code:"MMK",namePlural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbolNative:"MOP$",decimalDigits:2,rounding:0,code:"MOP",namePlural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbolNative:"MURs",decimalDigits:0,rounding:0,code:"MUR",namePlural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"MXN",namePlural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbolNative:"RM",decimalDigits:2,rounding:0,code:"MYR",namePlural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbolNative:"MTn",decimalDigits:2,rounding:0,code:"MZN",namePlural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbolNative:"N$",decimalDigits:2,rounding:0,code:"NAD",namePlural:"Namibian dollars"},NGN:{symbol:"\u20A6",name:"Nigerian Naira",symbolNative:"\u20A6",decimalDigits:2,rounding:0,code:"NGN",namePlural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan C\xF3rdoba",symbolNative:"C$",decimalDigits:2,rounding:0,code:"NIO",namePlural:"Nicaraguan c\xF3rdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"NOK",namePlural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbolNative:"\u0928\u0947\u0930\u0942",decimalDigits:2,rounding:0,code:"NPR",namePlural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"NZD",namePlural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbolNative:"\u0631.\u0639.\u200F",decimalDigits:2,rounding:0,code:"OMR",namePlural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbolNative:"B/.",decimalDigits:2,rounding:0,code:"PAB",namePlural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbolNative:"S/.",decimalDigits:2,rounding:0,code:"PEN",namePlural:"Peruvian nuevos soles"},PHP:{symbol:"\u20B1",name:"Philippine Peso",symbolNative:"\u20B1",decimalDigits:2,rounding:0,code:"PHP",namePlural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbolNative:"\u20A8",decimalDigits:0,rounding:0,code:"PKR",namePlural:"Pakistani rupees"},PLN:{symbol:"z\u0142",name:"Polish Zloty",symbolNative:"z\u0142",decimalDigits:2,rounding:0,code:"PLN",namePlural:"Polish zlotys"},PYG:{symbol:"\u20B2",name:"Paraguayan Guarani",symbolNative:"\u20B2",decimalDigits:0,rounding:0,code:"PYG",namePlural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbolNative:"\u0631.\u0642.\u200F",decimalDigits:2,rounding:0,code:"QAR",namePlural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbolNative:"RON",decimalDigits:2,rounding:0,code:"RON",namePlural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbolNative:"\u0434\u0438\u043D.",decimalDigits:0,rounding:0,code:"RSD",namePlural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbolNative:"\u0440\u0443\u0431.",decimalDigits:2,rounding:0,code:"RUB",namePlural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbolNative:"FR",decimalDigits:0,rounding:0,code:"RWF",namePlural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbolNative:"\u0631.\u0633.\u200F",decimalDigits:2,rounding:0,code:"SAR",namePlural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbolNative:"SDG",decimalDigits:2,rounding:0,code:"SDG",namePlural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbolNative:"kr",decimalDigits:2,rounding:0,code:"SEK",namePlural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"SGD",namePlural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbolNative:"Ssh",decimalDigits:0,rounding:0,code:"SOS",namePlural:"Somali shillings"},SYP:{symbol:"SY\xA3",name:"Syrian Pound",symbolNative:"\u0644.\u0633.\u200F",decimalDigits:0,rounding:0,code:"SYP",namePlural:"Syrian pounds"},THB:{symbol:"\u0E3F",name:"Thai Baht",symbolNative:"\u0E3F",decimalDigits:2,rounding:0,code:"THB",namePlural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbolNative:"\u062F.\u062A.\u200F",decimalDigits:2,rounding:0,code:"TND",namePlural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Pa\u02BBanga",symbolNative:"T$",decimalDigits:2,rounding:0,code:"TOP",namePlural:"Tongan pa\u02BBanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbolNative:"TL",decimalDigits:2,rounding:0,code:"TRY",namePlural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"TTD",namePlural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbolNative:"NT$",decimalDigits:2,rounding:0,code:"TWD",namePlural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbolNative:"TSh",decimalDigits:0,rounding:0,code:"TZS",namePlural:"Tanzanian shillings"},UAH:{symbol:"\u20B4",name:"Ukrainian Hryvnia",symbolNative:"\u20B4",decimalDigits:2,rounding:0,code:"UAH",namePlural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbolNative:"USh",decimalDigits:0,rounding:0,code:"UGX",namePlural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"UYU",namePlural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbolNative:"UZS",decimalDigits:0,rounding:0,code:"UZS",namePlural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bol\xEDvar",symbolNative:"Bs.F.",decimalDigits:2,rounding:0,code:"VEF",namePlural:"Venezuelan bol\xEDvars"},VND:{symbol:"\u20AB",name:"Vietnamese Dong",symbolNative:"\u20AB",decimalDigits:0,rounding:0,code:"VND",namePlural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbolNative:"FCFA",decimalDigits:0,rounding:0,code:"XAF",namePlural:"francs CFA"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbolNative:"CFA",decimalDigits:0,rounding:0,code:"XOF",namePlural:"francs CFA"},YER:{symbol:"YR",name:"Yemeni Rial",symbolNative:"\u0631.\u064A.\u200F",decimalDigits:0,rounding:0,code:"YER",namePlural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbolNative:"R",decimalDigits:2,rounding:0,code:"ZAR",namePlural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbolNative:"ZK",decimalDigits:0,rounding:0,code:"ZMK",namePlural:"Zambian kwachas"}};var I=t=>t&&typeof t=="object"&&!Array.isArray(t)&&t.name&&typeof t.name=="string"&&t.symbol&&typeof t.symbol=="string";var Xe="%v %s",Se=t=>{let e=R.get("currencyFormat");return e&&typeof e=="string"&&e.includes("%v")?e:t!==false?Xe:""};function _e(t){return t=t&&typeof t=="string"?t.trim():"",R.set("currencyFormat",t)}var Wt=t=>{if(!I(t)){let r=typeof t=="object"&&t&&!Array.isArray(t)?m(t.code,t.name):typeof t=="string"?t:void 0;r&&(r=r.trim().toUpperCase()),r&&I(Y[r])?t=Y[r]:typeof t=="string"&&(r=t.trim().toUpperCase(),I(Y[r])&&(t=Y[r]));}let e=Object.assign({},t);if(!e.format){let r=Se();r&&(e.format=r);}return e.format&&_e(e.format),R.set("appConfigCurrency",e),e},jt=()=>{var a,i,o,s;let t=Object.assign({},R.get("appConfigCurrency")),e=R.get("currencyCode");if(c(e)&&I(Y[e.trim().toUpperCase()])&&(t=S(S({},Y[e.trim().toUpperCase()]),t)),!c(t==null?void 0:t.format)){let l=Se(false);c(l)&&l.includes("%v")&&(t.format=l);}let n=Y["USD"];return S(S({symbol:n.symbol,format:(a=n.format)!=null?a:"%v %s",decimalSeparator:(i=n.decimalSeparator)!=null?i:".",thousandSeparator:(o=n.thousandSeparator)!=null?o:",",decimalDigits:(s=n.decimalDigits)!=null?s:0},Object.assign({},ae.get("currencies"))),t)},U={getFormat:Se,setFormat:_e,setCurrency:Wt,getCurrency:jt,defaultCurrencyFormat:Xe};var Zt=t=>t&&typeof t=="object";function Ne(t){let e=Object.assign({},U.getCurrency());if(t&&Zt(t))for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r]!==void 0&&(e[r]=t[r]);if(c(e.format)){let r=rt(e.format);r.format&&(e.format=r.format),typeof r.decimalDigits=="number"&&(e.decimalDigits=r.decimalDigits);}return e}function Me(t,e){return t=typeof t=="number"?t:0,e=typeof e=="number"?e:0,t=Math.round(Math.abs(t)),isNaN(t)?e:t}function Qt(t){let e=U.getCurrency(),r=(e==null?void 0:e.format).toLowerCase();return typeof t=="string"&&(t=t.toLowerCase()),(typeof t!="string"||!t.match("%v"))&&(t=r),{pos:t,neg:t.replace("-","").replace("%v","-%v"),zero:t}}var oe=(t,e)=>{let r=U.getCurrency();if(t=t||0,typeof t=="number")return t;e=e||r.decimalSeparator;let n=new RegExp("[^0-9-"+e+"]","g"),a=parseFloat((""+t).replace(/\((?=\d+)(.*)\)/,"-$1").replace(n,"").replace(e,"."));return isNaN(a)?0:a},Re=(t,e)=>{let r=U.getCurrency();e=Me(e,r.decimalDigits);let a=String(t).replace(/[^\d.-]/g,"");if(a.length>15&&!a.includes("."))return a+"."+"0".repeat(e);try{let i=Number(a);if(isNaN(i))return "NaN";let o=+(i+"e"+e);return (+(Math.round(o)+"e-"+e)).toFixed(e)}catch(i){return "NaN"}},et=(t,e,r,n)=>{var b;t=oe(t);let a=I(e)?e:U.getCurrency();typeof e=="number"&&(a.decimalDigits=e),typeof a.decimalDigits!="number"&&(a.decimalDigits=(b=String(t).split(".")[1])==null?void 0:b.length),r!==void 0&&(a.thousandSeparator=r),n!==void 0&&(a.decimalSeparator=n);let i=Ne(a),o=Me(i.decimalDigits),s=t<0?"-":"",l=parseInt(Re(Math.abs(t||0),o),10)+"",u=l.length>3?l.length%3:0,p="";if(o){let D=String(parseFloat(Re(Math.abs(t),o))||0);D.includes(".")&&(p=m(D.split(".")[1]).trim());}return s+(u?l.substring(0,u)+i.thousandSeparator:"")+l.substring(u).replace(/(\d{3})(?=\d)/g,"$1"+i.thousandSeparator)+(o&&p?i.decimalSeparator+p:"")},tt=(t,e,r,n,a,i)=>{t=oe(t);let o=I(e)?e:U.getCurrency();e!==void 0&&typeof e=="string"&&(o.symbol=e),r!==void 0&&(o.decimalDigits=r),n!==void 0&&(o.thousandSeparator=n),a!==void 0&&(o.decimalSeparator=a),c(i)&&(o.format=i);let s=Ne(o),l=Qt(s.format),u=m(t>0?l.pos:t<0?l.neg:l.zero),p=m(s.symbol),b=u.replace(p&&"%s",p),D=et(Math.abs(t),Me(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),v=b.replace("%v",D);return F(S({},s),{formattedValue:b,formattedNumber:D,symbol:s.symbol,usedFormat:u,result:v})},Jt=(t,e,r,n,a,i)=>tt(t,e,r,n,a,i).result,rt=t=>{t=m(t).trim();let e={};if(t){let r=/(\.)(\#{0,9}\s*$)/,n=t.match(r);Array.isArray(n)&&n.length===3&&(e.decimalDigits=m(n[2]).trim().length),t=t.replace(r,"");}return e.format=t,e},W={parse:oe,session:U,formatMoney:Jt,currencies:Y,isCurrency:I,formatNumber:et,formatMoneyAsObject:tt,unformat:oe,toFixed:Re,prepareOptions:Ne,parseFormat:rt};var{currencies:nt}=W;Number.prototype.countDecimals=function(){let t=String(this.toString()).match(/\.(\d+)/);return t?t[1].length:0};Number.prototype.formatNumber=function(t,e,r){return W.formatNumber(this.valueOf(),t,e,r)};Number.prototype.formatMoney=function(t,e,r,n,a){return W.formatMoney(this.valueOf(),t,e,r,n,a)};var qt=(t,e,r,n)=>{var C;if(t===null||typeof t!="number"||isNaN(t))return {result:"",format:"",suffix:"",formattedValue:"",minAbreviationDecimalDigits:0,value:NaN};if(!isFinite(t)){let N=t>0?"\u221E":"-\u221E";return {result:N,value:t,format:"",suffix:"",formattedValue:N,minAbreviationDecimalDigits:0}}let a=Math.abs(t)<1e3,i=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"},{value:1e3,suffix:"K"},{value:1,suffix:""}],o=t.countDecimals?t.countDecimals():Math.floor(t)===t?0:((C=t.toString().split(".")[1])==null?void 0:C.length)||0,s=i.find(N=>Math.abs(t)>=N.value)||i[i.length-1],l=a?t:t/(s.value===1?1:s.value),u=s.suffix,p=Xt(l,5);if(t===0)return {result:"0",value:0,format:"",suffix:"",formattedValue:"0",minAbreviationDecimalDigits:0};let D=T(e)&&e>0?e:s.value===1?Math.min(o,5):Math.max(p,0),v=l.toFixed(D);r=m(r),n=m(n,".");let h=v.toString().split(".");return h[0]=h[0].replace(/\B(?=(\d{3})+(?!\d))/g,r),D>0&&h.length===1?h.push("0".repeat(D)):D>0&&h.length>1&&h[1].length<D&&(h[1]=h[1].padEnd(D,"0")),v=h.join(n),{result:v+u,value:t,format:u,suffix:u,formattedValue:v,minAbreviationDecimalDigits:p}};function Xt(t,e){let r=Math.abs(t);if(Number.isInteger(r))return 0;let n=r.toString().split(".")[1]||"",a=0;for(;a<n.length&&n[a]==="0";)a++;return r<1&&a>0?Math.min(a+e,n.length):Math.min(e,n.length)}var at=(t,e,r,n)=>qt(t,e,r,n).result;Number.prototype.abreviate2FormatNumber=function(t,e,r){return at(this.valueOf(),t,e,r)};var it=(t,e,r,n,a,i)=>{if(!T(t))return "";let l=W.formatMoneyAsObject(t,e,r,n,a,i),{formattedValue:o}=l,s=Ie(l,["formattedValue"]);return o.replace("%v",at(t,s.decimalDigits,s.thousandSeparator,s.decimalSeparator))};Number.prototype.abreviate2FormatMoney=function(t,e,r,n,a){return it(this.valueOf(),t,e,r,n,a)};Object.keys(nt).forEach(t=>{let e=t,r=nt[e],n=`format${e}`,a=`abreviate2Format${e}`;Number.prototype[n]=function(i,o,s,l){return W.formatMoney(this.valueOf(),r,i,o,s,l)},Number.prototype[a]=function(i,o,s,l){return it(this.valueOf(),r,i,o,s,l)};});function _t(t){return m(t).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function se(t,e){var r=Object.prototype.toString.call(t);return r==="[object "+e+"]"}function H(t,e){if(["boolean","undefined"].includes(typeof t)||t===null)return String(t);if(T(t))return t.formatNumber();if(t instanceof Date)return t.toFormat();if(t instanceof Error)return t==null?void 0:t.toString();e=Object.assign({},e);let{parenthesis:r}=e,n=r?"(":"",a=r?")":"";return typeof t=="string"?(e==null?void 0:e.escapeString)!==false?"'"+_t(t)+"'":t:se(t,"RegExp")||se(t,"Number")||se(t,"Boolean")?t.toString():se(t,"Date")?"new Date("+t.getTime()+")":Array.isArray(t)?"["+t.map(i=>H(i,e)).join(",")+"]":typeof t=="object"?n+"{"+Object.keys(t).map(i=>{var o=t[i];return H(i,e)+":"+H(o,e)}).join(",")+"}"+a:t&&typeof(t==null?void 0:t.toString)=="function"?t==null?void 0:t.toString():String(t)}var tr=ve__default.default.AES.encrypt,rr=ve__default.default.AES.decrypt,ot="auth-decrypted-key",st="user-session",lt={get:t=>f(null,null,function*(){return R.get(t)}),set:(t,e)=>f(null,null,function*(){yield R.set(t,e);}),remove:t=>f(null,null,function*(){yield R.remove(t);})},Ae=class t{static get(e,r){if(c(r))return t.getData(e)[r]}static set(e,r,n){let a=t.getData(e);return c(r)?a[r]=n:d(r)&&(a=r),R.set(t.getKey(e),a),a}static getKey(e){let r=Q.getSignedUser();return `auth-${H((r==null?void 0:r.id)||(r==null?void 0:r.email))}-${e||""}`}static getData(e){if(!c(e))return {};let r=t.getKey(e);return Object.assign({},R.get(r))}static getStorage(e){return {sessionName:e,get:r=>t.get(e,r),set:(r,n)=>t.set(e,r,n),getData:()=>t.getData(e),getKey:()=>t.getKey(e)}}},g=class g{static _isMasterAdmin(e){return e=d(e)?e:g.getSignedUser(),typeof g.isMasterAdmin=="function"?g.isMasterAdmin(e):false}static getSignedUser(){if(d(g.localUserRef.current))return g.localUserRef.current;let e=R.get(st);if(e)try{let r=rr(e,ot);if(r&&typeof(r==null?void 0:r.toString)=="function"){let n=r.toString(ve__default.default.enc.Utf8);return g.localUserRef.current=B.parse(n),g.localUserRef.current}}catch(r){w.log("getting local user ",r);}return null}static setSignedUser(e,r){return f(this,null,function*(){g.localUserRef.current=e;let n=e,a=null;try{d(n)&&(n.sessionCreatedAt=new Date().getTime()),a=n?tr(JSON.stringify(n),ot).toString():null;}catch(i){g.localUserRef.current=null,w.log(i," setting local user");}if(yield R.set(st,a),r){let i=d(n)&&a&&a!==null?"SIGN_IN":"SIGN_OUT";g.events.trigger(i,n);}return e})}static signIn(e,r=true){return f(this,null,function*(){if(!d(e))throw new Error(ae.t("auth.invalidSignInUser"));return yield g.setSignedUser(e,r)})}static signOut(e=true){return f(this,null,function*(){return yield g.setSignedUser(null,e)})}static isResourceActionTupleArray(e){return Array.isArray(e)&&e.length===2&&c(e[0])&&c(e[1])}static isResourceActionTupleObject(e){return !Array.isArray(e)&&typeof e=="object"&&d(e)&&c(e.resourceName)&&c(e.action)}static isAllowed(e,r){if(r=Object.assign({},r||g.getSignedUser()),typeof e=="boolean")return e;if(g._isMasterAdmin(r)||!e)return true;if(typeof e=="function")return !!e(r);if(g.isResourceActionTupleObject(e)){if(g.checkUserPermission(r,e.resourceName,e.action))return true}else if(g.isResourceActionTupleArray(e)){if(g.checkUserPermission(r,e[0],e[1]))return true}else if(Array.isArray(e))for(let n in e){let a=e[n];if(g.isResourceActionTupleArray(a)){if(g.checkUserPermission(r,a[0],a[1]))return true}else if(g.isResourceActionTupleObject(a)&&g.checkUserPermission(r,a.resourceName,a.action))return true}return false}static checkUserPermission(e,r,n="read"){if(!d(e)||!e)return false;if(d(e.perms)&&e.perms&&g.checkPermission(e.perms,r,n))return true;if(Array.isArray(e==null?void 0:e.roles)){for(let a in e.roles){let i=e.roles[a];if(d(i)&&d(i.perms)&&g.checkPermission(i.perms,r,n))return true}return false}return false}static checkPermission(e,r,n="read"){if(e=Object.assign({},e),r=c(r)?r:"",!d(e)||!r)return false;let a=String(r).trim().toLowerCase();n=c(n)?n:"read";let i=[];for(let o in e)if(String(o).toLowerCase().trim()===a&&Array.isArray(e[o])){i=e[o];break}if(!Array.isArray(i)||!i.length)return false;if(i.includes("all"))return true;for(let o in i)if(g.isAllowedForAction(i[o],n))return true;return false}static isAllowedForAction(e,r){return !c(r)||!c(e)?false:String(r).trim().toLowerCase()===String(e).trim().toLowerCase()}static get Session(){return Ae}static get secureStorage(){let e=Reflect.getMetadata(g.authStorageMetaData,g);return ct(e)&&(this._secureStorage=e),this._secureStorage?this._secureStorage:lt}static set secureStorage(e){ct(e)&&Reflect.defineMetadata(g.authStorageMetaData,e,g);}static getToken(){return f(this,null,function*(){return yield this.secureStorage.get("auth-token")})}static setToken(e){return f(this,null,function*(){yield this.secureStorage.set("auth-token",e);})}};g.events=Je({}),g.localUserRef={current:null},g._secureStorage=lt,g.authStorageMetaData=Symbol("auth:storage:meta");var Q=g;var ct=t=>{if(!t)return false;try{return ["get","set","remove"].every(e=>typeof t[e]=="function")}catch(e){return false}};var le=Symbol("fieldsResourcesMetadata");function Li(t){return function(e,r){var i;let n=Object.assign({},Reflect.getMetadata(le,e)||{}),a=String((i=Reflect.getMetadata("design:type",e,r))==null?void 0:i.name).toLowerCase();t.type===void 0&&(t.type=["string","number","boolean","date"].includes(a)?a:"text"),n[r]=S({name:r},Object.assign({},t)),Reflect.defineMetadata(le,n,e);}}function Ii(t){let e=Reflect.getMetadata(le,t.prototype);return Object.assign({},e)}function ut(t){let e=Reflect.getMetadata(le,Object.getPrototypeOf(t).constructor);return Object.assign({},e)}var ce=class t{static normalizePagination(e){let{page:r,skip:n,limit:a}=Object.assign({},e);return T(a)?(T(n)&&n>0?r=Math.floor(n/a)+1:T(r)&&r>0?n=(r-1)*a:(r=1,n=0),{page:r,skip:n,limit:a}):{}}static normalizeOrderBy(e){let r=Array.isArray(e)?e:c(e)?[e]:[],n={};return r.forEach(a=>{if(!c(a)||String(a).trim()==="")return;let i=String(a).startsWith("-"),o=i?"desc":"asc",s=i?String(a).slice(1):a,l=s;n[l]!==void 0&&console.warn(`Duplicate orderBy field: ${s}. Using last occurrence.`),n[l]=o;}),n}static canPaginateResult(e){return d(e)?T(e.limit):false}static getPaginationMetaData(e,r){let{limit:n,page:a,skip:i}=t.normalizePagination(r);e=T(e)?e:0;let o={total:e};return typeof n=="number"&&n>0&&typeof a=="number"&&a>=0&&(o.currentPage=a,o.pageSize=n,o.totalPages=Math.ceil(e/n),o.hasNextPage=o.currentPage<o.totalPages,o.hasPreviousPage=o.currentPage>1,o.nextPage=o.hasNextPage?o.currentPage+1:void 0,o.previousPage=o.hasPreviousPage?o.currentPage-1:void 0,o.lastPage=o.totalPages),o}static paginate(e,r,n){let a=t.getPaginationMetaData(r,n),{currentPage:i,pageSize:o,totalPages:s}=a;if(Array.isArray(e)&&T(i)&&T(o)&&T(s)){let l=Math.max(0,i-1)*o,u=l+o;e=e.slice(l,u);}return {data:e,total:r,meta:a}}static parseQueryOptions(e){var N;let r=x({},e==null?void 0:e.params,qe(e==null?void 0:e.url)),n=x({},r,(N=e==null?void 0:e.headers)==null?void 0:N["x-filters"],e==null?void 0:e.filters),a=Pe(n.limit),i=Pe(n.skip),o=Pe(n.page),s=t.normalizePagination({limit:a,skip:i,page:o}),l=n.distinct;typeof l=="number"&&(l=!!l),(typeof l=="boolean"||Array.isArray(l)&&l.length)&&(s.distinct=l);let u=n.orderBy,p=t.normalizeOrderBy(u);p&&Object.getSize(p,true)>0&&(s.orderBy=p);let b=Te(n.include);b.length&&(s.include=b);let D=n.cache;D!==void 0&&(s.cache=!!D);let v=n.cacheTTL;v!==void 0&&(s.cacheTTL=v);let h=nr(n.where);d(h)&&Object.getSize(h,true)&&(s.where=h);let A=n.includeDeleted;typeof A=="boolean"&&(s.includeDeleted=A);let C=Te(n.relations);return C.length&&(s.relations=C),F(S({},s),{queryParams:r})}},nr=(...t)=>{for(let e of t)if(Array.isArray(e)&&e.length||c(e)||d(e)&&Object.getSize(e,true))return e},Pe=t=>{if(Ce(t))return Number(t);if(typeof t=="number")return t};var dt=["$and","$or","$nor","$not"],mt=["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin","$exists","$type","$regex","$size","$mod","$all","$elemMatch"],zi={LOGICAL:dt,COMPARAISON:mt,ALL:[...dt,...mt],ARRAY:["$all","$elemMatch","$in","$nin"]};var ft=Symbol("resources"),ar=Symbol("resourceFromClassName"),ue=class ue{constructor(){this.init();}getMetaData(){return Object.assign({},Reflect.getMetadata(V.resourceMetaData,this.constructor))}destroy(){}getResourceContext(e){return F(S({},Object.assign({},e)),{resourceLabel:this.getLabel(),resourceName:this.getName()})}getI18n(){return k.getInstance()}get INVALID_DATA_PROVIDER_ERROR(){return this.getI18n().t("resources.invalidDataProvider",this.getResourceContext())}hasDataService(){let e=this.getDataService();return e!=null&&typeof(e==null?void 0:e.update)=="function"&&typeof(e==null?void 0:e.create)=="function"&&typeof(e==null?void 0:e.find)=="function"&&typeof(e==null?void 0:e.update)=="function"&&typeof(e==null?void 0:e.delete)=="function"}trigger(e,...r){ue.events.trigger(e,this.getResourceContext(),...r);}authorizeAction(e){return f(this,null,function*(){if(!this.hasDataService())throw new Error(this.INVALID_DATA_PROVIDER_ERROR);let r;switch(e){case "read":r=this.canUserRead();break;case "create":r=this.canUserCreate();break;case "update":r=this.canUserUpdate();break;case "delete":r=this.canUserDelete();break;default:r=this.isAllowed(e);break}if(!r)throw new Error(this.getI18n().t(this.buildTranslationPath("forbiddenError"),this.getResourceContext({action:e})))})}find(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>{var r;return (r=this.getDataService())==null?void 0:r.find(e).then(n=>(this.trigger("find",n),n))})})}findOne(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findOne(e).then(r=>(this.trigger("findOne",r),r)))})}buildTranslationPath(e){let r=this.getName(),n=`resources${c(r)?`.${r}`:""}.`;return c(e)?`${n}${e.trim().ltrim(".")}`:n}findOneOrFail(e){return f(this,null,function*(){let r=yield this.findOne(e);if(!d(r)||!r)throw new Error(this.getI18n().t(this.buildTranslationPath("notFoundError"),Object.assign({},{options:JSON.stringify(e)},this.getResourceContext())));return r})}beforeCreate(e){return f(this,null,function*(){})}afterCreate(e){return f(this,null,function*(){})}beforeUpdate(e,r){return f(this,null,function*(){})}afterUpdate(e,r,n){return f(this,null,function*(){})}beforeDelete(e){return f(this,null,function*(){})}afterDelete(e,r){return f(this,null,function*(){})}beforeCreateMany(e){return f(this,null,function*(){})}afterCreateMany(e,r){return f(this,null,function*(){})}beforeUpdateMany(e,r){return f(this,null,function*(){})}afterUpdateMany(e,r,n){return f(this,null,function*(){})}beforeDeleteMany(e){return f(this,null,function*(){})}afterDeleteMany(e,r){return f(this,null,function*(){})}create(e){return f(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreate(e).then(()=>this.getDataService().create(e).then(r=>this.afterCreate(r).then(()=>(this.trigger("create",r),r)))))})}update(e,r){return f(this,null,function*(){return this.authorizeAction("update").then(()=>f(this,null,function*(){return this.beforeUpdate(e,r).then(()=>{var n;return (n=this.getDataService())==null?void 0:n.update(e,r).then(a=>this.afterUpdate(a,e,r).then(()=>(this.trigger("update",a,e,r),a)))})}))})}delete(e){return f(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDelete(e).then(()=>{var r;return (r=this.getDataService())==null?void 0:r.delete(e).then(n=>this.afterDelete(n,e).then(()=>(this.trigger("delete",n,e),n)))}))})}findAndCount(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findAndCount(e).then(r=>(this.trigger("findAndCount",r),r)))})}findAndPaginate(e){return f(this,null,function*(){e=Object.assign({},e);let[r,n]=yield this.findAndCount(e);return ce.paginate(r,n,e)})}createMany(e){return f(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreateMany(e).then(()=>this.getDataService().createMany(e).then(r=>this.afterCreateMany(r,e).then(()=>(this.trigger("createMany",r,e),r)))))})}updateMany(e,r){return f(this,null,function*(){return this.authorizeAction("update").then(()=>this.beforeUpdateMany(e,r).then(()=>this.getDataService().updateMany(e,r).then(n=>this.afterUpdateMany(n,e,r).then(()=>(this.trigger("updateMany",n,e,r),n)))))})}deleteMany(e){return f(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDeleteMany(e).then(()=>this.getDataService().deleteMany(e).then(r=>this.afterDeleteMany(r,e).then(()=>(this.trigger("deleteMany",r,e),r)))))})}count(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().count(e).then(r=>(this.trigger("read",r),r)))})}exists(e){return f(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().exists(e).then(r=>(this.trigger("exits",r),r)))})}updateMetadata(e){e=Object.assign({},e);let r=x({},this.getMetaData(),e);return Reflect.defineMetadata(V.resourceMetaData,r,this.constructor),r}init(){this.getFields();}getTranslations(e){e=m(e,this.getI18n().getLocale());let r=String(this.getName()).trim();if(!c(r))return {};let n=this.getI18n().get(["resources",r],e);return d(n)&&n?n:{}}translate(e,r){let n=c(e)?e.trim().split("."):Array.isArray(e)?e:[];return n[0]!=="resources"&&!V.hasResource(n[1])&&n.unshift(this.getName(),"resources"),this.getI18n().translate(n,r)}getName(){return m(this.name,this.getMetaData().name)}getActions(){return (!d(this.actions)||!this.actions)&&(this.actions={}),this.actions}hasAction(e){if(!c(e))return false;let r=this.getActions();return d(r[e])&&r[e]!==void 0}isAllowed(e,r){let n=[];return c(e)?n.push([this.getName(),e]):Array.isArray(e)&&e.forEach(a=>{c(a)&&n.push([this.getName(),a]);}),Q.isAllowed(n,r)}canUserRead(e){return this.isAllowed("read",e)}canUserCreate(e){return this.isAllowed("create",e)}canUserUpdate(e){return this.isAllowed("update",e)}canUserDelete(e){return this.isAllowed("delete",e)}translateProperty(e,r,n){e=m(e).trim(),n=Object.assign({},{resourceName:this.getName()},n);let a=this.getTranslations();if(c(e)&&a[e]){let i=H(this.getI18n().t(e,n));if(c(i)&&i.includes("."+e.ltrim(".")))return i}return m(r,e)}getLabel(){let e=this.getMetaData().label,r=this.translateProperty("label",m(e,this.label,this.getName()));return String(r).toLowerCase().trim()!="label"?r:m(this.getName())}getTitle(){return this.translateProperty("title",m(this.getMetaData().title,this.title,this.getLabel()))}getFields(){try{return this.fields=ut(this),this.fields}catch(e){w.log(e," getting resources fieldss");}return {}}interpolate(e,r,n){return ne(e,this.getResourceContext(r),S({tagRegex:/\{([^}]+)\}/g},n))}getActionLabel(e,r){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.label,r)}getActionTitle(e,r){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.title,r)}getAction(e){if(!c(e))return {};let r=this.getActions();return d(r[e])&&r[e]||{}}getPrimaryKeys(){let e=[];if(d(this.fields))for(let r in this.fields)d(this.fields[r])&&this.fields[r].primaryKey&&e.push(this.fields[r]);return e}};ue.events=he();var Oe=ue,E=class E{static getAllMetaData(){return Object.assign({},Reflect.getMetadata(ft,E))}static addMetaData(e,r){let n=this.getAllMetaData();!c(e)||!e||(r=Object.assign({},r),r.name=c(r==null?void 0:r.name)?r.name:e,n[e]=r,Reflect.defineMetadata(ft,n,E));}static getAllClassNames(){return Object.assign({},Reflect.getMetadata(ar,E))}static getNameFromClassName(e){return c(e)?this.getAllClassNames()[e]:void 0}static getMetaDataFromName(e){let r=this.getAllMetaData();if(!(!c(e)||!e))return r[e]}static getMetaDataFromClass(e){return Object.assign({},Reflect.getMetadata(E.resourceMetaData,e.prototype))}static getMetaDataByClassName(e){let r=this.getNameFromClassName(e);if(r)return this.getMetaDataFromName(r)}static getAllNames(){return Object.keys(this.resources)}static getResource(e){return typeof e=="string"&&e?this.resources[e]:null}static hasResource(e){if(!c(e)||!e)return false;let r=E.getMetaDataFromName(e);return d(r)&&(r==null?void 0:r.name)==e?true:!!this.getResource(e)}static addResource(e,r){typeof e=="string"&&e&&r&&r instanceof Oe&&(this.resources[e]=r);}static removeResource(e){return typeof e=="string"&&delete this.resources[e],this.resources}static getResources(){return this.resources}};E.resourceMetaData=Symbol("resource"),E.resources={};var V=E;function no(t){return function(e){if(t=Object.assign({},t),typeof e=="function"&&t!=null&&t.instanciate)try{let r=new e;r.updateMetadata(t),V.addResource(t.name,r);}catch(r){}Reflect.defineMetadata(V.resourceMetaData,t,e),V.addMetaData(t.name,t);}}
6
6
  exports.FieldMeta=Li;exports.MONGO_OPERATORS=zi;exports.Resource=Oe;exports.ResourceMeta=no;exports.ResourcePaginationHelper=ce;exports.ResourcesManager=V;exports.buildPropertyDecorator=Tt;exports.fieldsMetaData=le;exports.getDecoratedProperties=me;exports.getDecoratedProperty=lr;exports.getFields=ut;exports.getFieldsFromClass=Ii;
@@ -1 +1 @@
1
- 'use strict';require('reflect-metadata');function S(e){return typeof e=="boolean"||!e||typeof e=="number"||typeof e=="string"||typeof e=="symbol"?false:Object(e).constructor===Promise||e.constructor&&(e.constructor.name==="Promise"||e.constructor.name==="AsyncFunction")||e instanceof Promise||typeof(e==null?void 0:e.then)=="function"&&typeof(e==null?void 0:e.catch)=="function"&&typeof(e==null?void 0:e.finally)=="function"?true:e&&typeof e.constructor=="function"&&Function.prototype.toString.call(e.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function d(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:S(e)}function y(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var c=()=>{var e;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((e=process==null?void 0:process.versions)!=null&&e.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(t){}return false},h=()=>{var e,t;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((e=window==null?void 0:window.process)==null?void 0:e.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((t=process.versions)!=null&&t.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},v=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(t){}}return false},N=()=>typeof window=="undefined"&&typeof process!="undefined",p=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),A=()=>{if(!y()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},D=()=>{var e;return !p()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},P=()=>c()&&process.platform==="darwin",x=()=>c()&&process.platform==="win32",C=()=>c()&&process.platform==="linux",m={isWeb:y,isLinux:C,isDarwin:P,isWin32:x,isNode:c,isElectron:h,isTouchDevice:v,isServerSide:N,isClientSide:p,isAndroidMobileBrowser:A,isReactNativeWebview:D};function f(e){return !!(e&&typeof e=="string")}var a=class e{static decycle(t,r=[]){if(typeof t=="function")return;if(!t||typeof t!="object")return t;if(r.includes(t))return null;let n=r.concat([t]);return Array.isArray(t)?t.map(o=>e.decycle(o,n)):Object.fromEntries(Object.entries(t).map(([o,g])=>[o,e.decycle(g,n)]))}static stringify(t,r=false){return typeof t=="string"?t:JSON.stringify(r!==false?e.decycle(t):t)}static isJSON(t){if(typeof t!="string")return false;let r=t.trim();if(r.length===0)return false;let n=r[0];if(n!=="{"&&n!=="[")return false;try{let o=JSON.parse(r);return o!==null&&typeof o=="object"}catch(o){return false}}static parse(t,r){if(typeof t=="string")try{t=JSON.parse(t,r);}catch(n){return t}if(t&&typeof t=="object")for(let n in t){let o=t[n];e.isJSON(o)&&(t[n]=e.parse(o,r));}return t}};var s=class s{static get storage(){var r;let t=Reflect.getMetadata(s.sessionStorageMetaData,s);if(l(t)&&(this._storage=t),this._storage)return this._storage;if(m.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((r=window.localStorage)!=null&&r.getItem))this._storage={get:n=>window.localStorage.getItem(n),set:(n,o)=>window.localStorage.setItem(n,o),remove:n=>window.localStorage.removeItem(n),removeAll:()=>window.localStorage.clear()};else {let n={};this._storage={get:o=>n[o],set:(o,g)=>n[o]=g,remove:o=>{delete n[o];},removeAll:()=>n={}};}return this._storage}static set storage(t){l(t)&&Reflect.defineMetadata(s.sessionStorageMetaData,t,s);}static get keyNamespace(){return f(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(t){f(t)&&(this._keyNamespace=t.trim().replace(/\s+/g,"-"));}static sanitizeKey(t){if(!t||!f(t))return "";t=t.trim().replace(/\s+/g,"-");let r=this.keyNamespace;return r?`${r}-${t}`:t}};s.sessionStorageMetaData=Symbol("sessionStorage"),s._keyNamespace=void 0;var i=s;function u(e){return i.sanitizeKey(e)}var w=(e,t)=>(e=e&&a.stringify(e,t),e==null&&(e=""),e),b=e=>{if(d(e))return new Promise((t,r)=>{e.then(n=>{t(a.parse(n));}).catch(n=>{r(n);});});if(e!=null)return a.parse(e)},O=e=>{if(e=u(e),i.storage&&e&&typeof e=="string"){let t=i.storage.get(e);return b(t)}},T=e=>{if(e=u(e),i.storage&&e&&typeof e=="string")return i.storage.remove(e)},W=()=>{if(i.storage)return i.storage.removeAll()},l=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(t=>typeof e[t]=="function")}catch(t){return false}},$={get:O,set:(e,t,r=true)=>(e=u(e),i.storage.set(e,w(t,r))),remove:T,handleGetValue:b,sanitizeKey:u,handleSetValue:w,isValidStorage:l,Manager:i,removeAll:W};function B(){return function(e){try{let t=new e;if(!l(t))return;i.storage=t;}catch(t){console.error(t," registering session storage");}}}exports.AttachSessionStorage=B;exports.Session=$;
1
+ 'use strict';require('reflect-metadata');function S(e){return typeof e=="boolean"||!e||typeof e=="number"||typeof e=="string"||typeof e=="symbol"?false:Object(e).constructor===Promise||e.constructor&&(e.constructor.name==="Promise"||e.constructor.name==="AsyncFunction")||e instanceof Promise||typeof(e==null?void 0:e.then)=="function"&&typeof(e==null?void 0:e.catch)=="function"&&typeof(e==null?void 0:e.finally)=="function"?true:e&&typeof e.constructor=="function"&&Function.prototype.toString.call(e.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function d(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:S(e)}function y(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var c=()=>{var e;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((e=process==null?void 0:process.versions)!=null&&e.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(t){}return false},h=()=>{var e,t;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((e=window==null?void 0:window.process)==null?void 0:e.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((t=process.versions)!=null&&t.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},v=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(t){}}return false},N=()=>typeof window=="undefined"&&typeof process!="undefined",p=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),A=()=>{if(!y()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},D=()=>{var e;return !p()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},P=()=>c()&&process.platform==="darwin",x=()=>c()&&process.platform==="win32",C=()=>c()&&process.platform==="linux",m={isWeb:y,isLinux:C,isDarwin:P,isWin32:x,isNode:c,isElectron:h,isTouchDevice:v,isServerSide:N,isClientSide:p,isAndroidMobileBrowser:A,isReactNativeWebview:D};function f(e){return !!(e&&typeof e=="string")}var a=class e{static decycle(t,r=[]){if(typeof t=="function")return;if(!t||typeof t!="object")return t;if(r.includes(t))return null;let n=r.concat([t]);return Array.isArray(t)?t.map(o=>e.decycle(o,n)):Object.fromEntries(Object.entries(t).map(([o,g])=>[o,e.decycle(g,n)]))}static stringify(t,r=false,n,o){return typeof t=="string"?t:JSON.stringify(r!==false?e.decycle(t):t,n,o)}static isJSON(t){if(typeof t!="string")return false;let r=t.trim();if(r.length===0)return false;let n=r[0];if(n!=="{"&&n!=="[")return false;try{let o=JSON.parse(r);return o!==null&&typeof o=="object"}catch(o){return false}}static parse(t,r){if(typeof t=="string")try{t=JSON.parse(t,r);}catch(n){return t}if(t&&typeof t=="object")for(let n in t){let o=t[n];e.isJSON(o)&&(t[n]=e.parse(o,r));}return t}};var s=class s{static get storage(){var r;let t=Reflect.getMetadata(s.sessionStorageMetaData,s);if(l(t)&&(this._storage=t),this._storage)return this._storage;if(m.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((r=window.localStorage)!=null&&r.getItem))this._storage={get:n=>window.localStorage.getItem(n),set:(n,o)=>window.localStorage.setItem(n,o),remove:n=>window.localStorage.removeItem(n),removeAll:()=>window.localStorage.clear()};else {let n={};this._storage={get:o=>n[o],set:(o,g)=>n[o]=g,remove:o=>{delete n[o];},removeAll:()=>n={}};}return this._storage}static set storage(t){l(t)&&Reflect.defineMetadata(s.sessionStorageMetaData,t,s);}static get keyNamespace(){return f(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(t){f(t)&&(this._keyNamespace=t.trim().replace(/\s+/g,"-"));}static sanitizeKey(t){if(!t||!f(t))return "";t=t.trim().replace(/\s+/g,"-");let r=this.keyNamespace;return r?`${r}-${t}`:t}};s.sessionStorageMetaData=Symbol("sessionStorage"),s._keyNamespace=void 0;var i=s;function u(e){return i.sanitizeKey(e)}var w=(e,t)=>(e=e&&a.stringify(e,t),e==null&&(e=""),e),b=e=>{if(d(e))return new Promise((t,r)=>{e.then(n=>{t(a.parse(n));}).catch(n=>{r(n);});});if(e!=null)return a.parse(e)},O=e=>{if(e=u(e),i.storage&&e&&typeof e=="string"){let t=i.storage.get(e);return b(t)}},T=e=>{if(e=u(e),i.storage&&e&&typeof e=="string")return i.storage.remove(e)},W=()=>{if(i.storage)return i.storage.removeAll()},l=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(t=>typeof e[t]=="function")}catch(t){return false}},$={get:O,set:(e,t,r=true)=>(e=u(e),i.storage.set(e,w(t,r))),remove:T,handleGetValue:b,sanitizeKey:u,handleSetValue:w,isValidStorage:l,Manager:i,removeAll:W};function B(){return function(e){try{let t=new e;if(!l(t))return;i.storage=t;}catch(t){console.error(t," registering session storage");}}}exports.AttachSessionStorage=B;exports.Session=$;