reslib 1.0.3 → 1.1.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.
- package/build/auth/index.js +1 -1
- package/build/countries/index.js +1 -1
- package/build/currency/index.js +1 -1
- package/build/currency/session.js +2 -2
- package/build/i18n/index.js +1 -1
- package/build/inputFormatter/index.js +1 -1
- package/build/logger/index.js +1 -1
- package/build/resources/index.js +1 -1
- package/build/translations/index.d.ts +4 -0
- package/build/translations/index.js +1 -1
- package/build/translations/validator.en.d.ts +4 -0
- package/build/translations/validator.en.js +1 -1
- package/build/utils/date/dateHelper.js +1 -1
- package/build/utils/date/index.js +1 -1
- package/build/utils/index.js +2 -2
- package/build/utils/numbers.js +1 -1
- package/build/validator/index.js +3 -3
- package/build/validator/rules/array.js +1 -1
- package/build/validator/rules/boolean.js +1 -1
- package/build/validator/rules/date.js +1 -1
- package/build/validator/rules/default.js +1 -1
- package/build/validator/rules/enum.js +1 -1
- package/build/validator/rules/file.js +2 -2
- package/build/validator/rules/format.d.ts +169 -0
- package/build/validator/rules/format.js +3 -3
- package/build/validator/rules/index.d.ts +1 -0
- package/build/validator/rules/index.js +3 -3
- package/build/validator/rules/multiRules.js +1 -1
- package/build/validator/rules/numeric.js +1 -1
- package/build/validator/rules/object.d.ts +71 -0
- package/build/validator/rules/object.js +5 -0
- package/build/validator/rules/string.js +1 -1
- package/build/validator/rules/target.js +1 -1
- package/build/validator/validator.js +1 -1
- package/package.json +249 -244
package/build/logger/index.js
CHANGED
|
@@ -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}",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Ee={auth:oe,currencies:se,countries:ne,dates:de,resources:le,validator:ce};function Ie(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 ue(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:Ie(e)}function me(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var x=()=>{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(r){}return false},Le=()=>{var e,r;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"&&((r=process.versions)!=null&&r.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Pe=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(r){}}return false},Re=()=>typeof window=="undefined"&&typeof process!="undefined",fe=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),xe=()=>{if(!me()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},He=()=>{var e;return !fe()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},Fe=()=>x()&&process.platform==="darwin",ke=()=>x()&&process.platform==="win32",Be=()=>x()&&process.platform==="linux",ye={isWeb:me,isLinux:Be,isDarwin:Fe,isWin32:ke,isNode:x,isElectron:Le,isTouchDevice:Pe,isServerSide:Re,isClientSide:fe,isAndroidMobileBrowser:xe,isReactNativeWebview:He};function u(e){return !!(e&&typeof e=="string")}var O=class e{static decycle(r,t=[]){if(typeof r=="function")return;if(!r||typeof r!="object")return r;if(t.includes(r))return null;let a=t.concat([r]);return Array.isArray(r)?r.map(i=>e.decycle(i,a)):Object.fromEntries(Object.entries(r).map(([i,n])=>[i,e.decycle(n,a)]))}static stringify(r,t=false){return typeof r=="string"?r:JSON.stringify(t!==false?e.decycle(r):r)}static isJSON(r){if(typeof r!="string")return false;let t=r.trim();if(t.length===0)return false;let a=t[0];if(a!=="{"&&a!=="[")return false;try{let i=JSON.parse(t);return i!==null&&typeof i=="object"}catch(i){return false}}static parse(r,t){if(typeof r=="string")try{r=JSON.parse(r,t);}catch(a){return r}if(r&&typeof r=="object")for(let a in r){let i=r[a];e.isJSON(i)&&(r[a]=e.parse(i,t));}return r}};var D=class D{static get storage(){var t;let r=Reflect.getMetadata(D.sessionStorageMetaData,D);if(V(r)&&(this._storage=r),this._storage)return this._storage;if(ye.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.getItem))this._storage={get:a=>window.localStorage.getItem(a),set:(a,i)=>window.localStorage.setItem(a,i),remove:a=>window.localStorage.removeItem(a),removeAll:()=>window.localStorage.clear()};else {let a={};this._storage={get:i=>a[i],set:(i,n)=>a[i]=n,remove:i=>{delete a[i];},removeAll:()=>a={}};}return this._storage}static set storage(r){V(r)&&Reflect.defineMetadata(D.sessionStorageMetaData,r,D);}static get keyNamespace(){return u(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(r){u(r)&&(this._keyNamespace=r.trim().replace(/\s+/g,"-"));}static sanitizeKey(r){if(!r||!u(r))return "";r=r.trim().replace(/\s+/g,"-");let t=this.keyNamespace;return t?`${t}-${r}`:r}};D.sessionStorageMetaData=Symbol("sessionStorage"),D._keyNamespace=void 0;var b=D;function H(e){return b.sanitizeKey(e)}var pe=(e,r)=>(e=e&&O.stringify(e,r),e==null&&(e=""),e),ge=e=>{if(ue(e))return new Promise((r,t)=>{e.then(a=>{r(O.parse(a));}).catch(a=>{t(a);});});if(e!=null)return O.parse(e)},Ge=e=>{if(e=H(e),b.storage&&e&&typeof e=="string"){let r=b.storage.get(e);return ge(r)}},Ke=e=>{if(e=H(e),b.storage&&e&&typeof e=="string")return b.storage.remove(e)},Ve=()=>{if(b.storage)return b.storage.removeAll()},V=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(r=>typeof e[r]=="function")}catch(r){return false}},W={get:Ge,set:(e,r,t=true)=>(e=H(e),b.storage.set(e,pe(r,t))),remove:Ke,handleGetValue:ge,sanitizeKey:H,handleSetValue:pe,isValidStorage:V,Manager:b,removeAll:Ve};function f(...e){for(var r in e){let t=e[r];if(u(t))return t}return ""}function S(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function w(e){if(e instanceof RegExp)return true;if(!e||typeof e!="object"||!Object.prototype.toString.call(e).includes("RegExp"))return false;try{return new RegExp(e),!0}catch(r){return false}}function E(e){return !e||typeof e!="object"?false:e instanceof Date?true:typeof e.getTime!="function"?false:!(Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))}function U(e){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:e===document?true:"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&typeof e=="object"&&e.nodeType===1&&!!e.nodeName}function m(e){if(e===null||typeof e!="object"||U(e)||E(e)||w(e)||S(e))return false;let r=Object.getPrototypeOf(e);if(r===null)return true;let t=r.constructor;if(typeof t!="function")return false;if(t===Object)return true;let a=t.prototype;return typeof a!="object"?false:a===Object.prototype?true:typeof r.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")&&typeof r.isPrototypeOf=="function"}function Z(e){if(Array.isArray(e)){let a=[];for(var r=0;r<e.length;r++)a[r]=Z(e[r]);return a}else if(m(e)&&e){let a={};for(var t in e)e.hasOwnProperty(t)&&(a[t]=Z(e[t]));return a}else return e}Object.getSize=function(e,r=false){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.length;typeof r!="boolean"&&(r=false);let t=0;for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&(t++,r===true))return t;return t};function I(e,...r){let t=Array.isArray(e),a=m(e);(e==null||!t&&!a)&&(e={});for(let i=0;i<r.length;i++){let n=r[i];if(n==null)continue;let o=m(n),d=Array.isArray(n);if(!(!o&&!d)){if(t){d&&he(e,n);continue}else if(d)continue;for(let c in n){let l=n[c];if(l==null)continue;if(l===n){e[c]=e;continue}let y=e[c],h=Array.isArray(y),M=Array.isArray(l);if(h){M?he(e[c],l):e[c]=l;continue}else if(!m(y)){e[c]=l;continue}if(M||!m(l)){e[c]=l;continue}e[c]=I({},y,l);}}}return e}var he=(e,r)=>{let t=r.length,a=0;for(let i=0;i<e.length;i++){let n=e[i],o=r[i];if(i<t){let d=Array.isArray(n),c=Array.isArray(o),l=m(n),y=m(o);d&&c||l&&y?(e[a]=I(d?[]:{},n,o),a++):o!=null?(e[a]=o,a++):n!=null&&(e[a]=n,a++);}}for(let i=e.length;i<t;i++)r[i]!==void 0&&r[i]!==null&&e.push(r[i]);return e};function We(e,r){return F(e,"",{},r)}function F(e,r="",t={},a){if(t=m(t)?t:{},S(e)||E(e)||w(e)||Array.isArray(e)&&(a!=null&&a.skipArrays))return r&&(t[r]=e),t;if(typeof e=="function"||typeof e=="object"&&!m(e)&&!Ue(e))return t;if(e instanceof Map||e instanceof WeakMap)return Array.from(e.entries()).forEach(([i,n])=>{let o=r?`${r}[${String(i)}]`:String(i);F(n,o,t,a);}),t;if(Array.isArray(e)||e instanceof Set||e instanceof WeakSet)return (Array.isArray(e)?e:Array.from(e)).forEach((n,o)=>{let d=r?`${r}[${o}]`:String(o);F(n,d,t,a);}),t;if(m(e))for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let n=e[i],o=r?r.endsWith("]")?`${r}.${i}`:`${r}.${i}`:i;F(n,o,t,a);}return t}function Ue(e){return Array.isArray(e)||e instanceof Set||e instanceof Map||e instanceof WeakMap||e instanceof WeakSet}function Ze(e){return Object.entries(e)}Object.typedEntries=Ze;Object.flatten=We;Object.clone=Z;function L(e,r){if(e==null)return "";if(typeof e=="string")return e;if((typeof e=="number"||typeof e=="object"&&e instanceof Number)&&typeof e.formatNumber=="function")return e.formatNumber();if(e instanceof Date||typeof e=="object"&&e!==null&&e.constructor===Date)return typeof e.toFormat=="function"?e.toFormat():e.toISOString();if(e instanceof Error)return `Error: ${e.message}`;if(w(e))return e.toString();if(S(e))return String(e);if(Array.isArray(e))return JSON.stringify(e);if(typeof e=="object"&&e!==null){if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString();if(typeof e.toString=="function"){let t=e.toString();if(t!=="[object Object]")return t}return JSON.stringify(e)}return typeof(e==null?void 0:e.toString)=="function"?e.toString():String(e)}function be(e,r,t){let a=L,i=f(e);if(!m(r)||!r)return i;let n=/%\{([^}]+)\}/g,o=new Set,d,c=f(e);for(;(d=n.exec(c))!==null;){let l=d[1];l!==void 0&&o.add(l);}return o.forEach(l=>{let y;y=`%{${l}}`;let h=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,M=h===void 0?"":(()=>{try{return a(h,l,L)}catch(Q){return L(h)}})(),Se=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(Se,"g"),M);}),i}function z(e){return !!(e==null||typeof e=="number"&&isNaN(e)||typeof e=="string"&&e.trim()==="")}function T(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function ze(e){return f(e).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 k(e,r){var t=Object.prototype.toString.call(e);return t==="[object "+r+"]"}function A(e,r){if(["boolean","undefined"].includes(typeof e)||e===null)return String(e);if(T(e))return e.formatNumber();if(e instanceof Date)return e.toFormat();if(e instanceof Error)return e==null?void 0:e.toString();r=Object.assign({},r);let{parenthesis:t}=r,a=t?"(":"",i=t?")":"";return typeof e=="string"?(r==null?void 0:r.escapeString)!==false?"'"+ze(e)+"'":e:k(e,"RegExp")||k(e,"Number")||k(e,"Boolean")?e.toString():k(e,"Date")?"new Date("+e.getTime()+")":Array.isArray(e)?"["+e.map(n=>A(n,r)).join(",")+"]":typeof e=="object"?a+"{"+Object.keys(e).map(n=>{var o=e[n];return A(n,r)+":"+A(o,r)}).join(",")+"}"+i:e&&typeof(e==null?void 0:e.toString)=="function"?e==null?void 0:e.toString():String(e)}var Ce=Symbol("TRANSLATION_KEY");var p=class p extends i18nJs.I18n{constructor(t={},a={}){super({},a);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=ae();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(K),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(t),this.loadNamespaces();}static[Symbol.hasInstance](t){return this.isI18nInstance(t)}static isI18nInstance(t){if(!t||typeof t!="object")return false;try{if(t instanceof i18nJs.I18n)return !0}catch(a){}return typeof t.getLocale=="function"&&typeof t.translate=="function"&&typeof t.translateTarget=="function"}translate(t,a){return this.isPluralizeOptions(a)&&this.canPluralize(t)?(typeof a.count=="number"&&(a.countStr=a.count.formatNumber()),this.pluralize(a.count,t,a)):super.translate(t,a)}translateTarget(t,a){let i=p.getTargetTanslationKeys(t);for(let n in i)u(i[n])&&(i[n]=this.translate(i[n],a));return i}translateObject(t,a){if(!m(t))return {};let i={};for(let n in t){let o=t[n];u(o)&&(i[n]=Me.translate(o,a));}return i}static getTargetTanslationKeys(t){return ie(t,Ce)}on(t,a){return this._observableFactory.on.call(this,t,a)}finally(t,a){return this._observableFactory.finally.call(this,t,a)}off(t,a){var i;return (i=this._observableFactory)==null?void 0:i.off.call(this,t,a)}trigger(t,...a){var i;return (i=this._observableFactory)==null?void 0:i.trigger.call(this,t,...a)}offAll(){var t;return (t=this._observableFactory)==null?void 0:t.offAll.call(this)}once(t,a){var i;return (i=this._observableFactory)==null?void 0:i.once.call(this,t,a)}getEventCallBacks(){var t;return (t=this._observableFactory)==null?void 0:t.getEventCallBacks.call(this)}static getInstance(t){if(!this.isI18nInstance(p.instance)){let a=p.getLocaleFromSession();p.instance=this.createInstance({},Object.assign({},a?{locale:a}:{},t));}return p.instance}isDefaultInstance(){return this===p.instance}static setLocaleToSession(t){W.set("i18n.locale",t);}static getLocaleFromSession(){let t=W.get("i18n.locale");return u(t)?t:""}canPluralize(t,a){a=f(a,this.getLocale());let i=this.getNestedTranslation(t,a);return !m(i)||!i?false:u(i==null?void 0:i.one)&&u(i==null?void 0:i.other)}getNestedTranslation(t,a){a=f(a,this.getLocale());let i=(u(t)?t.trim().split("."):Array.isArray(t)?t:[]).filter(u);if(!i.length)return;let n=this.getTranslations(a);for(let o of i)if(m(n))n=n[o];else return;return n}isPluralizeOptions(t){return !!(m(t)&&t&&typeof t.count=="number")}static RegisterTranslations(t){return p.getInstance().registerTranslations(t)}static createInstance(t={},a={}){let d=Object.assign({},a),{interpolate:i}=d,n=re(d,["interpolate"]),o=new p(t,n);return o.interpolate=(c,l,y)=>{let h=p.flattenObject(y),M=this.defaultInterpolator(c,l,h);return u(M)&&M!==l&&(l=M),typeof i=="function"?i(c,l,y):be(l,y)},o}getTranslations(t){let a=m(this.translations)?this.translations:{};return u(t)?m(a[t])?a[t]:{}:a}static registerMomentLocale(t,a){return u(t)&&m(a)&&Array.isArray(a.months)&&(this.momentLocales[t]=I({},this.momentLocales[t],a)),this.momentLocales}static getMomentLocale(t){return this.momentLocales[t]}static setMomentLocale(t){try{return v__default.default.updateLocale(t,this.getMomentLocale(t)),!0}catch(a){console.error(a," setting moment locale : ",t);}return false}registerTranslations(t){return this.store(t),this.getTranslations()}store(t){super.store(t),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(t){try{let a=Object.getOwnPropertyNames(t);for(let i of a){let n=Reflect.getMetadata(Ce,t,i);if(n)try{t[i]=this.translate(n);}catch(o){N.error(o," resolving translation for key : ",n);}}}catch(a){N.error(a," resolving translations for target : ",t);}}getMissingPlaceholderString(t,a,i){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,t,f(a),Object.assign({},i)):t}getLocale(){return super.locale}setLocales(t){return this._locales=Array.isArray(t)?t:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(t){return u(t)&&this.getLocales().includes(t)}getLocales(){let t=Object.keys(this.getTranslations()),a=Array.isArray(this._locales)?this._locales:["en"],i=[...t,...a.filter(n=>!t.includes(n))];return i.includes("en")||i.push("en"),i}isLocaleSupported(t){return u(t)?this.getLocales().includes(t):false}isLoading(){return this._isLoading}setLocale(t,a=false){return super.locale===t&&a!==true&&this._namespacesLoaded[t]?Promise.resolve(this.getLocale()):new Promise((i,n)=>(this._isLoading=true,this.trigger("namespaces-before-load",t),this.loadNamespaces(t).then(o=>{this.isDefaultInstance()&&(p.instance=this,this.isLocaleSupported(t)&&p.setLocaleToSession(t)),super.locale=t,p.setMomentLocale(t),this.trigger("locale-changed",t,o),i(t);}).catch(n).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(t,a){if(!u(t)||typeof a!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",t,a);return}this.namespaceResolvers[t]=a;}static RegisterNamespaceResolver(t,a){return p.getInstance().registerNamespaceResolver(t,a)}loadNamespace(t,a,i=true){return !u(t)||!this.namespaceResolvers[t]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${t}".`)):(a=f(a,this.getLocale()),u(a)?this.namespaceResolvers[t](a).then(n=>{let o={};return o[a]=Object.assign({},n),m(n)&&(i!==false&&this.store(o),this.trigger("namespace-loaded",t,a,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${t}".`)))}static LoadNamespace(t,a,i=true){return p.getInstance().loadNamespace(t,a,i)}loadNamespaces(t,a=true){let i=[],n={};t=f(t,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&i.push(new Promise(d=>{this.namespaceResolvers[o](t).then(c=>{I(n,c);}).finally(()=>{d(true);});}));return Promise.all(i).then(()=>{let o={};return o[t]=n,a!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",t,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(t,a=true){return p.getInstance().loadNamespaces(t,a)}static flattenObject(t){return m(t)?Object.flatten(t):t}static defaultInterpolator(t,a,i){return z(a)?"":S(a)?(a=String(a),!m(i)||!i||!m(i)||!i?a:a.replace(/%{(.*?)}/g,(n,o)=>z(i[o])?"":S(i[o])?String(i[o]):A(i[o],{escapeString:false}))):A(a,{escapeString:false})}};p.momentLocales={};var Y=p,Me=Y.getInstance();try{Object.setPrototypeOf(Me,Y.prototype);}catch(e){}function J(e){return !!(e==null||typeof e=="undefined"||typeof e=="string"&&e===""||Array.isArray(e)&&!e.length)}var s=class s{static parseString(r,t){if(u(r)&&u(t))try{let a=v__default.default(r,t,!0);if(a.isValid())return {date:a.toDate(),matchedFormat:t,isValid:!0}}catch(a){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let a of t){let i=De(r,a);if(i)return i}for(let a of s.DATE_FORMATS){let i=De(r,a);if(i)return i}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(r){let t=r?s.parseDate(r):new Date;return t?t.toISOString():""}static isoStringToDate(r){return new Date(r)}static parseDate(r,t){if(s.isDateObj(r))return r;if(!u(t)){let a=s.parseString(r);return a!=null&&a.isValid?a.date:null}if(J(r))return null;try{let a=v__default.default(r,t,!0);if(a!=null&&a.isValid())return a.toDate()}catch(a){console.error(a," parsing date with moment : ",r," format is : ",t);}return null}static toSQLDateTimeFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0"),n=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0"),d=String(r.getSeconds()).padStart(2,"0");return `${t}-${a}-${i} ${n}:${o}:${d}`}static getI18n(r){return Y.isI18nInstance(r)?r:Y.getInstance()}static getDefaultDateTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0");return `${t}-${a}-${i}`}static toSQLTimeFormat(r){if(!s.isDateObj(r))return "";let t=String(r.getHours()).padStart(2,"0"),a=String(r.getMinutes()).padStart(2,"0"),i=String(r.getSeconds()).padStart(2,"0");return `${t}:${a}:${i}`}static getDefaultTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(r,t){if(r==null||typeof r=="boolean")return false;if(s.isDateObj(r))return true;if(T(r)){let i=new Date(r);return i&&!isNaN(i.getTime())}if(u(r))return !!s.parseDate(r,t);if(r!=null&&r.toString&&(r==null?void 0:r.toString())==parseInt(r).toString())return false;let a=new Date(r);return s.isDateObj(a)}static addToDate(r,t,a){if(T(r)||(r=0),J(t)&&(t=new Date),s.isValidDate(t)&&u(t)&&(t=new Date(t)),s.isValidDate(t)||(t=u(t)?new Date(t):new Date),u(a)&&typeof t["set"+a]=="function"&&typeof t["get"+a]=="function"){let i="set"+a,n="get"+a;t=new Date(t[i](t[n]()+r));}return t}static addDays(r,t){return s.addToDate(r,t,"Date")}static addMilliseconds(r,t){return T(r)||(r=0),s.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+r)}static addSeconds(r,t){return T(r)||(r=0),s.addMilliseconds(r*1e3,t)}static addMinutes(r,t){return T(r)||(r=0),s.addMilliseconds(r*6e4,t)}static addHours(r,t){return T(r)||(r=0),s.addMilliseconds(r*36e5,t)}static addMonths(r,t,a){return s.addToDate(r,t,"Month")}static addWeeks(r,t){return r=(T(r)?r:0)*7,s.addToDate(r,t,"Date")}static addYears(r,t){T(r)||(r=0);let a=new Date(s.addToDate(0,t)),i=a.getFullYear();return i+r<0?r=0:r+=i,a.setFullYear(r),new Date(a)}static formatDate(r,t){try{let a=v__default.default(r);if(a.isValid())return a.format(f(t,s.getDefaultDateTimeFormat()))}catch(a){}return f(s.isValidDate(r)?r==null?void 0:r.toString():"")}static getUTCDateTimeDetails(r){let t=r?v__default.default.utc(r):v__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};s.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"],s.SQL_DATE_FORMAT="YYYY-MM-DD",s.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",s.SQL_TIME_FORMAT="HH:mm:ss",s.getCurrentMonthDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getFullYear(),t.getMonth(),1),i=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:a,last:i}},s.getPreviousWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getTime()-3600*24*7*1e3),i=new Date(a),n=a.getDay(),o=a.getDate()-n+(n===0?-6:1),d=new Date(a.setDate(o)),c=new Date(i.setDate(o+6));return {first:d,last:c}},s.getCurrentWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),a=t.getDay(),i=t.getDate()-a+(a==0?-6:1),n=new Date(t),o=new Date(t.setDate(i));return n.setDate(n.getDate()+6),{first:o,last:n}},s.isDateObj=E;var g=s,De=(e,r)=>{let t=v__default.default(e,r,true);try{if(t.isValid()&&t.format(r)===e||v__default.default.utc(t,!0).format(r)===e)return {date:t.toDate(),matchedFormat:r,isValid:!0}}catch(a){}return null};Date.prototype.toSQLDateTimeFormat=function(){return g.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return g.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return g.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(e){return g.formatDate(this,e)};Date.prototype.addYears=function(e){return g.addYears(e,this)};Date.prototype.addMonths=function(e){return g.addMonths(e,this)};Date.prototype.addMinutes=function(e){return g.addMinutes(e,this)};Date.prototype.addSeconds=function(e){return g.addSeconds(e,this)};Date.prototype.addDays=function(e){return g.addDays(e,this)};Date.prototype.addWeeks=function(e){return g.addWeeks(e,this)};Date.prototype.addHours=function(e){return g.addHours(e,this)};var C=class C{static get logger(){let r=Reflect.getMetadata(C.loggerMetaData,C);return $(r)&&(this._logger=r),this._logger?this._logger:console}static set logger(r){$(r)&&Reflect.defineMetadata(C.loggerMetaData,r,C);}static _log(r,...t){let a=C.logger;r=f(r),r&&typeof a[r]=="function"?a[r](C.getDateTimeString(),...t):console.log("Logger level not found : [",r,"]",...t);}static getDateTimeString(){let{day:r,year:t,hours:a,minutes:i,seconds:n,dayNameShort:o,monthName:d}=g.getUTCDateTimeDetails(),c=r<10?"0"+r:r,l=a<10?"0"+a:a,y=i<10?"0"+i:i,h=n<10?"0"+n:n;return "["+[o,c,d,t].join(" ")+" "+[l,y,h].join(":")+"]"}static log(...r){this._log("log",...r);}static info(...r){this._log("info",...r);}static debug(...r){this._log("debug",...r);}static warn(...r){this._log("warn",...r);}static error(...r){this._log("error",...r);}};C.loggerMetaData=Symbol("logger-meta-data");var N=C,$=e=>{if(!e)return false;try{return ["warn","info","error"].every(r=>typeof e[r]=="function")}catch(r){return false}};function Pr(){return function(e){try{let r=new e;if(!$(r))return;N.logger=r;}catch(r){console.error(r," registering logger");}}}exports.AttachLogger=Pr;exports.Logger=N;
|
|
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",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Ee={auth:oe,currencies:se,countries:ne,dates:de,resources:le,validator:ce};function Ie(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 ue(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:Ie(e)}function me(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var x=()=>{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(r){}return false},Le=()=>{var e,r;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"&&((r=process.versions)!=null&&r.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Pe=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(r){}}return false},Re=()=>typeof window=="undefined"&&typeof process!="undefined",fe=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),xe=()=>{if(!me()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},He=()=>{var e;return !fe()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},Fe=()=>x()&&process.platform==="darwin",ke=()=>x()&&process.platform==="win32",Be=()=>x()&&process.platform==="linux",ye={isWeb:me,isLinux:Be,isDarwin:Fe,isWin32:ke,isNode:x,isElectron:Le,isTouchDevice:Pe,isServerSide:Re,isClientSide:fe,isAndroidMobileBrowser:xe,isReactNativeWebview:He};function u(e){return !!(e&&typeof e=="string")}var O=class e{static decycle(r,t=[]){if(typeof r=="function")return;if(!r||typeof r!="object")return r;if(t.includes(r))return null;let a=t.concat([r]);return Array.isArray(r)?r.map(i=>e.decycle(i,a)):Object.fromEntries(Object.entries(r).map(([i,n])=>[i,e.decycle(n,a)]))}static stringify(r,t=false){return typeof r=="string"?r:JSON.stringify(t!==false?e.decycle(r):r)}static isJSON(r){if(typeof r!="string")return false;let t=r.trim();if(t.length===0)return false;let a=t[0];if(a!=="{"&&a!=="[")return false;try{let i=JSON.parse(t);return i!==null&&typeof i=="object"}catch(i){return false}}static parse(r,t){if(typeof r=="string")try{r=JSON.parse(r,t);}catch(a){return r}if(r&&typeof r=="object")for(let a in r){let i=r[a];e.isJSON(i)&&(r[a]=e.parse(i,t));}return r}};var D=class D{static get storage(){var t;let r=Reflect.getMetadata(D.sessionStorageMetaData,D);if(V(r)&&(this._storage=r),this._storage)return this._storage;if(ye.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.getItem))this._storage={get:a=>window.localStorage.getItem(a),set:(a,i)=>window.localStorage.setItem(a,i),remove:a=>window.localStorage.removeItem(a),removeAll:()=>window.localStorage.clear()};else {let a={};this._storage={get:i=>a[i],set:(i,n)=>a[i]=n,remove:i=>{delete a[i];},removeAll:()=>a={}};}return this._storage}static set storage(r){V(r)&&Reflect.defineMetadata(D.sessionStorageMetaData,r,D);}static get keyNamespace(){return u(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(r){u(r)&&(this._keyNamespace=r.trim().replace(/\s+/g,"-"));}static sanitizeKey(r){if(!r||!u(r))return "";r=r.trim().replace(/\s+/g,"-");let t=this.keyNamespace;return t?`${t}-${r}`:r}};D.sessionStorageMetaData=Symbol("sessionStorage"),D._keyNamespace=void 0;var b=D;function H(e){return b.sanitizeKey(e)}var pe=(e,r)=>(e=e&&O.stringify(e,r),e==null&&(e=""),e),ge=e=>{if(ue(e))return new Promise((r,t)=>{e.then(a=>{r(O.parse(a));}).catch(a=>{t(a);});});if(e!=null)return O.parse(e)},Ge=e=>{if(e=H(e),b.storage&&e&&typeof e=="string"){let r=b.storage.get(e);return ge(r)}},Ke=e=>{if(e=H(e),b.storage&&e&&typeof e=="string")return b.storage.remove(e)},Ve=()=>{if(b.storage)return b.storage.removeAll()},V=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(r=>typeof e[r]=="function")}catch(r){return false}},W={get:Ge,set:(e,r,t=true)=>(e=H(e),b.storage.set(e,pe(r,t))),remove:Ke,handleGetValue:ge,sanitizeKey:H,handleSetValue:pe,isValidStorage:V,Manager:b,removeAll:Ve};function f(...e){for(var r in e){let t=e[r];if(u(t))return t}return ""}function S(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function w(e){if(e instanceof RegExp)return true;if(!e||typeof e!="object"||!Object.prototype.toString.call(e).includes("RegExp"))return false;try{return new RegExp(e),!0}catch(r){return false}}function E(e){return !e||typeof e!="object"?false:e instanceof Date?true:typeof e.getTime!="function"?false:!(Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))}function U(e){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:e===document?true:"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&typeof e=="object"&&e.nodeType===1&&!!e.nodeName}function m(e){if(e===null||typeof e!="object"||U(e)||E(e)||w(e)||S(e))return false;let r=Object.getPrototypeOf(e);if(r===null)return true;let t=r.constructor;if(typeof t!="function")return false;if(t===Object)return true;let a=t.prototype;return typeof a!="object"?false:a===Object.prototype?true:typeof r.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")&&typeof r.isPrototypeOf=="function"}function Z(e){if(Array.isArray(e)){let a=[];for(var r=0;r<e.length;r++)a[r]=Z(e[r]);return a}else if(m(e)&&e){let a={};for(var t in e)e.hasOwnProperty(t)&&(a[t]=Z(e[t]));return a}else return e}Object.getSize=function(e,r=false){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.length;typeof r!="boolean"&&(r=false);let t=0;for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&(t++,r===true))return t;return t};function I(e,...r){let t=Array.isArray(e),a=m(e);(e==null||!t&&!a)&&(e={});for(let i=0;i<r.length;i++){let n=r[i];if(n==null)continue;let o=m(n),d=Array.isArray(n);if(!(!o&&!d)){if(t){d&&he(e,n);continue}else if(d)continue;for(let c in n){let l=n[c];if(l==null)continue;if(l===n){e[c]=e;continue}let y=e[c],h=Array.isArray(y),M=Array.isArray(l);if(h){M?he(e[c],l):e[c]=l;continue}else if(!m(y)){e[c]=l;continue}if(M||!m(l)){e[c]=l;continue}e[c]=I({},y,l);}}}return e}var he=(e,r)=>{let t=r.length,a=0;for(let i=0;i<e.length;i++){let n=e[i],o=r[i];if(i<t){let d=Array.isArray(n),c=Array.isArray(o),l=m(n),y=m(o);d&&c||l&&y?(e[a]=I(d?[]:{},n,o),a++):o!=null?(e[a]=o,a++):n!=null&&(e[a]=n,a++);}}for(let i=e.length;i<t;i++)r[i]!==void 0&&r[i]!==null&&e.push(r[i]);return e};function We(e,r){return F(e,"",{},r)}function F(e,r="",t={},a){if(t=m(t)?t:{},S(e)||E(e)||w(e)||Array.isArray(e)&&(a!=null&&a.skipArrays))return r&&(t[r]=e),t;if(typeof e=="function"||typeof e=="object"&&!m(e)&&!Ue(e))return t;if(e instanceof Map||e instanceof WeakMap)return Array.from(e.entries()).forEach(([i,n])=>{let o=r?`${r}[${String(i)}]`:String(i);F(n,o,t,a);}),t;if(Array.isArray(e)||e instanceof Set||e instanceof WeakSet)return (Array.isArray(e)?e:Array.from(e)).forEach((n,o)=>{let d=r?`${r}[${o}]`:String(o);F(n,d,t,a);}),t;if(m(e))for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let n=e[i],o=r?r.endsWith("]")?`${r}.${i}`:`${r}.${i}`:i;F(n,o,t,a);}return t}function Ue(e){return Array.isArray(e)||e instanceof Set||e instanceof Map||e instanceof WeakMap||e instanceof WeakSet}function Ze(e){return Object.entries(e)}Object.typedEntries=Ze;Object.flatten=We;Object.clone=Z;function L(e,r){if(e==null)return "";if(typeof e=="string")return e;if((typeof e=="number"||typeof e=="object"&&e instanceof Number)&&typeof e.formatNumber=="function")return e.formatNumber();if(e instanceof Date||typeof e=="object"&&e!==null&&e.constructor===Date)return typeof e.toFormat=="function"?e.toFormat():e.toISOString();if(e instanceof Error)return `Error: ${e.message}`;if(w(e))return e.toString();if(S(e))return String(e);if(Array.isArray(e))return JSON.stringify(e);if(typeof e=="object"&&e!==null){if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString();if(typeof e.toString=="function"){let t=e.toString();if(t!=="[object Object]")return t}return JSON.stringify(e)}return typeof(e==null?void 0:e.toString)=="function"?e.toString():String(e)}function be(e,r,t){let a=L,i=f(e);if(!m(r)||!r)return i;let n=/%\{([^}]+)\}/g,o=new Set,d,c=f(e);for(;(d=n.exec(c))!==null;){let l=d[1];l!==void 0&&o.add(l);}return o.forEach(l=>{let y;y=`%{${l}}`;let h=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,M=h===void 0?"":(()=>{try{return a(h,l,L)}catch(Q){return L(h)}})(),Se=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(Se,"g"),M);}),i}function z(e){return !!(e==null||typeof e=="number"&&isNaN(e)||typeof e=="string"&&e.trim()==="")}function T(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function ze(e){return f(e).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 k(e,r){var t=Object.prototype.toString.call(e);return t==="[object "+r+"]"}function A(e,r){if(["boolean","undefined"].includes(typeof e)||e===null)return String(e);if(T(e))return e.formatNumber();if(e instanceof Date)return e.toFormat();if(e instanceof Error)return e==null?void 0:e.toString();r=Object.assign({},r);let{parenthesis:t}=r,a=t?"(":"",i=t?")":"";return typeof e=="string"?(r==null?void 0:r.escapeString)!==false?"'"+ze(e)+"'":e:k(e,"RegExp")||k(e,"Number")||k(e,"Boolean")?e.toString():k(e,"Date")?"new Date("+e.getTime()+")":Array.isArray(e)?"["+e.map(n=>A(n,r)).join(",")+"]":typeof e=="object"?a+"{"+Object.keys(e).map(n=>{var o=e[n];return A(n,r)+":"+A(o,r)}).join(",")+"}"+i:e&&typeof(e==null?void 0:e.toString)=="function"?e==null?void 0:e.toString():String(e)}var Ce=Symbol("TRANSLATION_KEY");var p=class p extends i18nJs.I18n{constructor(t={},a={}){super({},a);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=ae();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(K),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(t),this.loadNamespaces();}static[Symbol.hasInstance](t){return this.isI18nInstance(t)}static isI18nInstance(t){if(!t||typeof t!="object")return false;try{if(t instanceof i18nJs.I18n)return !0}catch(a){}return typeof t.getLocale=="function"&&typeof t.translate=="function"&&typeof t.translateTarget=="function"}translate(t,a){return this.isPluralizeOptions(a)&&this.canPluralize(t)?(typeof a.count=="number"&&(a.countStr=a.count.formatNumber()),this.pluralize(a.count,t,a)):super.translate(t,a)}translateTarget(t,a){let i=p.getTargetTanslationKeys(t);for(let n in i)u(i[n])&&(i[n]=this.translate(i[n],a));return i}translateObject(t,a){if(!m(t))return {};let i={};for(let n in t){let o=t[n];u(o)&&(i[n]=Me.translate(o,a));}return i}static getTargetTanslationKeys(t){return ie(t,Ce)}on(t,a){return this._observableFactory.on.call(this,t,a)}finally(t,a){return this._observableFactory.finally.call(this,t,a)}off(t,a){var i;return (i=this._observableFactory)==null?void 0:i.off.call(this,t,a)}trigger(t,...a){var i;return (i=this._observableFactory)==null?void 0:i.trigger.call(this,t,...a)}offAll(){var t;return (t=this._observableFactory)==null?void 0:t.offAll.call(this)}once(t,a){var i;return (i=this._observableFactory)==null?void 0:i.once.call(this,t,a)}getEventCallBacks(){var t;return (t=this._observableFactory)==null?void 0:t.getEventCallBacks.call(this)}static getInstance(t){if(!this.isI18nInstance(p.instance)){let a=p.getLocaleFromSession();p.instance=this.createInstance({},Object.assign({},a?{locale:a}:{},t));}return p.instance}isDefaultInstance(){return this===p.instance}static setLocaleToSession(t){W.set("i18n.locale",t);}static getLocaleFromSession(){let t=W.get("i18n.locale");return u(t)?t:""}canPluralize(t,a){a=f(a,this.getLocale());let i=this.getNestedTranslation(t,a);return !m(i)||!i?false:u(i==null?void 0:i.one)&&u(i==null?void 0:i.other)}getNestedTranslation(t,a){a=f(a,this.getLocale());let i=(u(t)?t.trim().split("."):Array.isArray(t)?t:[]).filter(u);if(!i.length)return;let n=this.getTranslations(a);for(let o of i)if(m(n))n=n[o];else return;return n}isPluralizeOptions(t){return !!(m(t)&&t&&typeof t.count=="number")}static RegisterTranslations(t){return p.getInstance().registerTranslations(t)}static createInstance(t={},a={}){let d=Object.assign({},a),{interpolate:i}=d,n=re(d,["interpolate"]),o=new p(t,n);return o.interpolate=(c,l,y)=>{let h=p.flattenObject(y),M=this.defaultInterpolator(c,l,h);return u(M)&&M!==l&&(l=M),typeof i=="function"?i(c,l,y):be(l,y)},o}getTranslations(t){let a=m(this.translations)?this.translations:{};return u(t)?m(a[t])?a[t]:{}:a}static registerMomentLocale(t,a){return u(t)&&m(a)&&Array.isArray(a.months)&&(this.momentLocales[t]=I({},this.momentLocales[t],a)),this.momentLocales}static getMomentLocale(t){return this.momentLocales[t]}static setMomentLocale(t){try{return v__default.default.updateLocale(t,this.getMomentLocale(t)),!0}catch(a){console.error(a," setting moment locale : ",t);}return false}registerTranslations(t){return this.store(t),this.getTranslations()}store(t){super.store(t),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(t){try{let a=Object.getOwnPropertyNames(t);for(let i of a){let n=Reflect.getMetadata(Ce,t,i);if(n)try{t[i]=this.translate(n);}catch(o){N.error(o," resolving translation for key : ",n);}}}catch(a){N.error(a," resolving translations for target : ",t);}}getMissingPlaceholderString(t,a,i){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,t,f(a),Object.assign({},i)):t}getLocale(){return super.locale}setLocales(t){return this._locales=Array.isArray(t)?t:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(t){return u(t)&&this.getLocales().includes(t)}getLocales(){let t=Object.keys(this.getTranslations()),a=Array.isArray(this._locales)?this._locales:["en"],i=[...t,...a.filter(n=>!t.includes(n))];return i.includes("en")||i.push("en"),i}isLocaleSupported(t){return u(t)?this.getLocales().includes(t):false}isLoading(){return this._isLoading}setLocale(t,a=false){return super.locale===t&&a!==true&&this._namespacesLoaded[t]?Promise.resolve(this.getLocale()):new Promise((i,n)=>(this._isLoading=true,this.trigger("namespaces-before-load",t),this.loadNamespaces(t).then(o=>{this.isDefaultInstance()&&(p.instance=this,this.isLocaleSupported(t)&&p.setLocaleToSession(t)),super.locale=t,p.setMomentLocale(t),this.trigger("locale-changed",t,o),i(t);}).catch(n).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(t,a){if(!u(t)||typeof a!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",t,a);return}this.namespaceResolvers[t]=a;}static RegisterNamespaceResolver(t,a){return p.getInstance().registerNamespaceResolver(t,a)}loadNamespace(t,a,i=true){return !u(t)||!this.namespaceResolvers[t]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${t}".`)):(a=f(a,this.getLocale()),u(a)?this.namespaceResolvers[t](a).then(n=>{let o={};return o[a]=Object.assign({},n),m(n)&&(i!==false&&this.store(o),this.trigger("namespace-loaded",t,a,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${t}".`)))}static LoadNamespace(t,a,i=true){return p.getInstance().loadNamespace(t,a,i)}loadNamespaces(t,a=true){let i=[],n={};t=f(t,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&i.push(new Promise(d=>{this.namespaceResolvers[o](t).then(c=>{I(n,c);}).finally(()=>{d(true);});}));return Promise.all(i).then(()=>{let o={};return o[t]=n,a!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",t,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(t,a=true){return p.getInstance().loadNamespaces(t,a)}static flattenObject(t){return m(t)?Object.flatten(t):t}static defaultInterpolator(t,a,i){return z(a)?"":S(a)?(a=String(a),!m(i)||!i||!m(i)||!i?a:a.replace(/%{(.*?)}/g,(n,o)=>z(i[o])?"":S(i[o])?String(i[o]):A(i[o],{escapeString:false}))):A(a,{escapeString:false})}};p.momentLocales={};var Y=p,Me=Y.getInstance();try{Object.setPrototypeOf(Me,Y.prototype);}catch(e){}function J(e){return !!(e==null||typeof e=="undefined"||typeof e=="string"&&e===""||Array.isArray(e)&&!e.length)}var s=class s{static parseString(r,t){if(u(r)&&u(t))try{let a=v__default.default(r,t,!0);if(a.isValid())return {date:a.toDate(),matchedFormat:t,isValid:!0}}catch(a){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let a of t){let i=De(r,a);if(i)return i}for(let a of s.DATE_FORMATS){let i=De(r,a);if(i)return i}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(r){let t=r?s.parseDate(r):new Date;return t?t.toISOString():""}static isoStringToDate(r){return new Date(r)}static parseDate(r,t){if(s.isDateObj(r))return r;if(!u(t)){let a=s.parseString(r);return a!=null&&a.isValid?a.date:null}if(J(r))return null;try{let a=v__default.default(r,t,!0);if(a!=null&&a.isValid())return a.toDate()}catch(a){console.error(a," parsing date with moment : ",r," format is : ",t);}return null}static toSQLDateTimeFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0"),n=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0"),d=String(r.getSeconds()).padStart(2,"0");return `${t}-${a}-${i} ${n}:${o}:${d}`}static getI18n(r){return Y.isI18nInstance(r)?r:Y.getInstance()}static getDefaultDateTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0");return `${t}-${a}-${i}`}static toSQLTimeFormat(r){if(!s.isDateObj(r))return "";let t=String(r.getHours()).padStart(2,"0"),a=String(r.getMinutes()).padStart(2,"0"),i=String(r.getSeconds()).padStart(2,"0");return `${t}:${a}:${i}`}static getDefaultTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(r,t){if(r==null||typeof r=="boolean")return false;if(s.isDateObj(r))return true;if(T(r)){let i=new Date(r);return i&&!isNaN(i.getTime())}if(u(r))return !!s.parseDate(r,t);if(r!=null&&r.toString&&(r==null?void 0:r.toString())==parseInt(r).toString())return false;let a=new Date(r);return s.isDateObj(a)}static addToDate(r,t,a){if(T(r)||(r=0),J(t)&&(t=new Date),s.isValidDate(t)&&u(t)&&(t=new Date(t)),s.isValidDate(t)||(t=u(t)?new Date(t):new Date),u(a)&&typeof t["set"+a]=="function"&&typeof t["get"+a]=="function"){let i="set"+a,n="get"+a;t=new Date(t[i](t[n]()+r));}return t}static addDays(r,t){return s.addToDate(r,t,"Date")}static addMilliseconds(r,t){return T(r)||(r=0),s.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+r)}static addSeconds(r,t){return T(r)||(r=0),s.addMilliseconds(r*1e3,t)}static addMinutes(r,t){return T(r)||(r=0),s.addMilliseconds(r*6e4,t)}static addHours(r,t){return T(r)||(r=0),s.addMilliseconds(r*36e5,t)}static addMonths(r,t,a){return s.addToDate(r,t,"Month")}static addWeeks(r,t){return r=(T(r)?r:0)*7,s.addToDate(r,t,"Date")}static addYears(r,t){T(r)||(r=0);let a=new Date(s.addToDate(0,t)),i=a.getFullYear();return i+r<0?r=0:r+=i,a.setFullYear(r),new Date(a)}static formatDate(r,t){try{let a=v__default.default(r);if(a.isValid())return a.format(f(t,s.getDefaultDateTimeFormat()))}catch(a){}return f(s.isValidDate(r)?r==null?void 0:r.toString():"")}static getUTCDateTimeDetails(r){let t=r?v__default.default.utc(r):v__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};s.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"],s.SQL_DATE_FORMAT="YYYY-MM-DD",s.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",s.SQL_TIME_FORMAT="HH:mm:ss",s.getCurrentMonthDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getFullYear(),t.getMonth(),1),i=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:a,last:i}},s.getPreviousWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getTime()-3600*24*7*1e3),i=new Date(a),n=a.getDay(),o=a.getDate()-n+(n===0?-6:1),d=new Date(a.setDate(o)),c=new Date(i.setDate(o+6));return {first:d,last:c}},s.getCurrentWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),a=t.getDay(),i=t.getDate()-a+(a==0?-6:1),n=new Date(t),o=new Date(t.setDate(i));return n.setDate(n.getDate()+6),{first:o,last:n}},s.isDateObj=E;var g=s,De=(e,r)=>{let t=v__default.default(e,r,true);try{if(t.isValid()&&t.format(r)===e||v__default.default.utc(t,!0).format(r)===e)return {date:t.toDate(),matchedFormat:r,isValid:!0}}catch(a){}return null};Date.prototype.toSQLDateTimeFormat=function(){return g.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return g.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return g.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(e){return g.formatDate(this,e)};Date.prototype.addYears=function(e){return g.addYears(e,this)};Date.prototype.addMonths=function(e){return g.addMonths(e,this)};Date.prototype.addMinutes=function(e){return g.addMinutes(e,this)};Date.prototype.addSeconds=function(e){return g.addSeconds(e,this)};Date.prototype.addDays=function(e){return g.addDays(e,this)};Date.prototype.addWeeks=function(e){return g.addWeeks(e,this)};Date.prototype.addHours=function(e){return g.addHours(e,this)};var C=class C{static get logger(){let r=Reflect.getMetadata(C.loggerMetaData,C);return $(r)&&(this._logger=r),this._logger?this._logger:console}static set logger(r){$(r)&&Reflect.defineMetadata(C.loggerMetaData,r,C);}static _log(r,...t){let a=C.logger;r=f(r),r&&typeof a[r]=="function"?a[r](C.getDateTimeString(),...t):console.log("Logger level not found : [",r,"]",...t);}static getDateTimeString(){let{day:r,year:t,hours:a,minutes:i,seconds:n,dayNameShort:o,monthName:d}=g.getUTCDateTimeDetails(),c=r<10?"0"+r:r,l=a<10?"0"+a:a,y=i<10?"0"+i:i,h=n<10?"0"+n:n;return "["+[o,c,d,t].join(" ")+" "+[l,y,h].join(":")+"]"}static log(...r){this._log("log",...r);}static info(...r){this._log("info",...r);}static debug(...r){this._log("debug",...r);}static warn(...r){this._log("warn",...r);}static error(...r){this._log("error",...r);}};C.loggerMetaData=Symbol("logger-meta-data");var N=C,$=e=>{if(!e)return false;try{return ["warn","info","error"].every(r=>typeof e[r]=="function")}catch(r){return false}};function Pr(){return function(e){try{let r=new e;if(!$(r))return;N.logger=r;}catch(r){console.error(r," registering logger");}}}exports.AttachLogger=Pr;exports.Logger=N;
|
package/build/resources/index.js
CHANGED
|
@@ -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}",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var St={auth:ke,currencies:Be,countries:Fe,dates:Ke,resources:Ue,validator:He};function c(r){return !!(r&&typeof r=="string")}function m(...r){for(var e in r){let t=r[e];if(c(t))return t}return ""}function te(r){return !!(r==null||typeof r=="undefined"||typeof r=="string"&&r===""||Array.isArray(r)&&!r.length)}function D(r){return typeof r=="number"&&!isNaN(r)&&isFinite(r)}function Q(r){return !r||typeof r!="object"?false:r instanceof Date?true:typeof r.getTime!="function"?false:!(Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))}var g=class g{static parseString(e,t){if(c(e)&&c(t))try{let n=V__default.default(e,t,!0);if(n.isValid())return {date:n.toDate(),matchedFormat:t,isValid:!0}}catch(n){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let n of t){let a=$e(e,n);if(a)return a}for(let n of g.DATE_FORMATS){let a=$e(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 t=e?g.parseDate(e):new Date;return t?t.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,t){if(g.isDateObj(e))return e;if(!c(t)){let n=g.parseString(e);return n!=null&&n.isValid?n.date:null}if(te(e))return null;try{let n=V__default.default(e,t,!0);if(n!=null&&n.isValid())return n.toDate()}catch(n){console.error(n," parsing date with moment : ",e," format is : ",t);}return null}static toSQLDateTimeFormat(e){if(!g.isDateObj(e))return "";let t=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 `${t}-${n}-${a} ${i}:${o}:${s}`}static getI18n(e){return z.isI18nInstance(e)?e:z.getInstance()}static getDefaultDateTimeFormat(e){return m(this.getI18n(e).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return m(this.getI18n(e).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!g.isDateObj(e))return "";let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${t}-${n}-${a}`}static toSQLTimeFormat(e){if(!g.isDateObj(e))return "";let t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return `${t}:${n}:${a}`}static getDefaultTimeFormat(e){return m(this.getI18n(e).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,t){if(e==null||typeof e=="boolean")return false;if(g.isDateObj(e))return true;if(D(e)){let a=new Date(e);return a&&!isNaN(a.getTime())}if(c(e))return !!g.parseDate(e,t);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let n=new Date(e);return g.isDateObj(n)}static addToDate(e,t,n){if(D(e)||(e=0),te(t)&&(t=new Date),g.isValidDate(t)&&c(t)&&(t=new Date(t)),g.isValidDate(t)||(t=c(t)?new Date(t):new Date),c(n)&&typeof t["set"+n]=="function"&&typeof t["get"+n]=="function"){let a="set"+n,i="get"+n;t=new Date(t[a](t[i]()+e));}return t}static addDays(e,t){return g.addToDate(e,t,"Date")}static addMilliseconds(e,t){return D(e)||(e=0),g.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+e)}static addSeconds(e,t){return D(e)||(e=0),g.addMilliseconds(e*1e3,t)}static addMinutes(e,t){return D(e)||(e=0),g.addMilliseconds(e*6e4,t)}static addHours(e,t){return D(e)||(e=0),g.addMilliseconds(e*36e5,t)}static addMonths(e,t,n){return g.addToDate(e,t,"Month")}static addWeeks(e,t){return e=(D(e)?e:0)*7,g.addToDate(e,t,"Date")}static addYears(e,t){D(e)||(e=0);let n=new Date(g.addToDate(0,t)),a=n.getFullYear();return a+e<0?e=0:e+=a,n.setFullYear(e),new Date(n)}static formatDate(e,t){try{let n=V__default.default(e);if(n.isValid())return n.format(m(t,g.getDefaultDateTimeFormat()))}catch(n){}return m(g.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let t=e?V__default.default.utc(e):V__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};g.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"],g.SQL_DATE_FORMAT="YYYY-MM-DD",g.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",g.SQL_TIME_FORMAT="HH:mm:ss",g.getCurrentMonthDaysRange=e=>{let t=g.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:n,last:a}},g.getPreviousWeekDaysRange=e=>{let t=g.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(t.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}},g.getCurrentWeekDaysRange=e=>{let t=g.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=t.getDay(),a=t.getDate()-n+(n==0?-6:1),i=new Date(t),o=new Date(t.setDate(a));return i.setDate(i.getDate()+6),{first:o,last:i}},g.isDateObj=Q;var v=g,$e=(r,e)=>{let t=V__default.default(r,e,true);try{if(t.isValid()&&t.format(e)===r||V__default.default.utc(t,!0).format(e)===r)return {date:t.toDate(),matchedFormat:e,isValid:!0}}catch(n){}return null};Date.prototype.toSQLDateTimeFormat=function(){return v.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return v.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return v.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(r){return v.formatDate(this,r)};Date.prototype.addYears=function(r){return v.addYears(r,this)};Date.prototype.addMonths=function(r){return v.addMonths(r,this)};Date.prototype.addMinutes=function(r){return v.addMinutes(r,this)};Date.prototype.addSeconds=function(r){return v.addSeconds(r,this)};Date.prototype.addDays=function(r){return v.addDays(r,this)};Date.prototype.addWeeks=function(r){return v.addWeeks(r,this)};Date.prototype.addHours=function(r){return v.addHours(r,this)};var I=class I{static get logger(){let e=Reflect.getMetadata(I.loggerMetaData,I);return Ge(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){Ge(e)&&Reflect.defineMetadata(I.loggerMetaData,e,I);}static _log(e,...t){let n=I.logger;e=m(e),e&&typeof n[e]=="function"?n[e](I.getDateTimeString(),...t):console.log("Logger level not found : [",e,"]",...t);}static getDateTimeString(){let{day:e,year:t,hours:n,minutes:a,seconds:i,dayNameShort:o,monthName:s}=v.getUTCDateTimeDetails(),l=e<10?"0"+e:e,u=n<10?"0"+n:n,f=a<10?"0"+a:a,b=i<10?"0"+i:i;return "["+[o,l,s,t].join(" ")+" "+[u,f,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);}};I.loggerMetaData=Symbol("logger-meta-data");var Y=I,Ge=r=>{if(!r)return false;try{return ["warn","info","error"].every(e=>typeof r[e]=="function")}catch(e){return false}};function Nt(r){return typeof r=="boolean"||!r||typeof r=="number"||typeof r=="string"||typeof r=="symbol"?false:Object(r).constructor===Promise||r.constructor&&(r.constructor.name==="Promise"||r.constructor.name==="AsyncFunction")||r instanceof Promise||typeof(r==null?void 0:r.then)=="function"&&typeof(r==null?void 0:r.catch)=="function"&&typeof(r==null?void 0:r.finally)=="function"?true:r&&typeof r.constructor=="function"&&Function.prototype.toString.call(r.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ge(r){return r&&Object.prototype.toString.call(r)==="[object Promise]"?true:Nt(r)}function Ve(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var re=()=>{var r;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((r=process==null?void 0:process.versions)!=null&&r.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},Rt=()=>{var r,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((r=window==null?void 0:window.process)==null?void 0:r.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)},Mt=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(r){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},At=()=>typeof window=="undefined"&&typeof process!="undefined",ze=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),vt=()=>{if(!Ve()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let r=navigator.userAgent.toLowerCase();return /android/i.test(r)},Pt=()=>{var r;return !ze()||!(window!=null&&window.ReactNativeWebView)?false:typeof((r=window==null?void 0:window.ReactNativeWebView)==null?void 0:r.postMessage)=="function"},Ot=()=>re()&&process.platform==="darwin",xt=()=>re()&&process.platform==="win32",wt=()=>re()&&process.platform==="linux",We={isWeb:Ve,isLinux:wt,isDarwin:Ot,isWin32:xt,isNode:re,isElectron:Rt,isTouchDevice:Mt,isServerSide:At,isClientSide:ze,isAndroidMobileBrowser:vt,isReactNativeWebview:Pt};var U=class r{static decycle(e,t=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(t.includes(e))return null;let n=t.concat([e]);return Array.isArray(e)?e.map(a=>r.decycle(a,n)):Object.fromEntries(Object.entries(e).map(([a,i])=>[a,r.decycle(i,n)]))}static stringify(e,t=false){return typeof e=="string"?e:JSON.stringify(t!==false?r.decycle(e):e)}static isJSON(e){if(typeof e!="string")return false;let t=e.trim();if(t.length===0)return false;let n=t[0];if(n!=="{"&&n!=="[")return false;try{let a=JSON.parse(t);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(e,t){if(typeof e=="string")try{e=JSON.parse(e,t);}catch(n){return e}if(e&&typeof e=="object")for(let n in e){let a=e[n];r.isJSON(a)&&(e[n]=r.parse(a,t));}return e}};var H=class H{static get storage(){var t;let e=Reflect.getMetadata(H.sessionStorageMetaData,H);if(pe(e)&&(this._storage=e),this._storage)return this._storage;if(We.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.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){pe(e)&&Reflect.defineMetadata(H.sessionStorageMetaData,e,H);}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 t=this.keyNamespace;return t?`${t}-${e}`:e}};H.sessionStorageMetaData=Symbol("sessionStorage"),H._keyNamespace=void 0;var x=H;function ne(r){return x.sanitizeKey(r)}var je=(r,e)=>(r=r&&U.stringify(r,e),r==null&&(r=""),r),Ze=r=>{if(ge(r))return new Promise((e,t)=>{r.then(n=>{e(U.parse(n));}).catch(n=>{t(n);});});if(r!=null)return U.parse(r)},Yt=r=>{if(r=ne(r),x.storage&&r&&typeof r=="string"){let e=x.storage.get(r);return Ze(e)}},Lt=r=>{if(r=ne(r),x.storage&&r&&typeof r=="string")return x.storage.remove(r)},Et=()=>{if(x.storage)return x.storage.removeAll()},pe=r=>{if(!r)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof r[e]=="function")}catch(e){return false}},R={get:Yt,set:(r,e,t=true)=>(r=ne(r),x.storage.set(r,je(e,t))),remove:Lt,handleGetValue:Ze,sanitizeKey:ne,handleSetValue:je,isValidStorage:pe,Manager:x,removeAll:Et};function F(r){return r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function W(r){if(r instanceof RegExp)return true;if(!r||typeof r!="object"||!Object.prototype.toString.call(r).includes("RegExp"))return false;try{return new RegExp(r),!0}catch(e){return false}}function be(r){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:r===document?true:"HTMLElement"in window?!!r&&r instanceof HTMLElement:!!r&&typeof r=="object"&&r.nodeType===1&&!!r.nodeName}function d(r){if(r===null||typeof r!="object"||be(r)||Q(r)||W(r)||F(r))return false;let e=Object.getPrototypeOf(r);if(e===null)return true;let t=e.constructor;if(typeof t!="function")return false;if(t===Object)return true;let n=t.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 he(r){if(Array.isArray(r)){let n=[];for(var e=0;e<r.length;e++)n[e]=he(r[e]);return n}else if(d(r)&&r){let n={};for(var t in r)r.hasOwnProperty(t)&&(n[t]=he(r[t]));return n}else return r}Object.getSize=function(r,e=false){if(!r||typeof r!="object")return 0;if(Array.isArray(r))return r.length;typeof e!="boolean"&&(e=false);let t=0;for(let n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t++,e===true))return t;return t};function L(r,...e){let t=Array.isArray(r),n=d(r);(r==null||!t&&!n)&&(r={});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(t){s&&Qe(r,i);continue}else if(s)continue;for(let l in i){let u=i[l];if(u==null)continue;if(u===i){r[l]=r;continue}let f=r[l],b=Array.isArray(f),h=Array.isArray(u);if(b){h?Qe(r[l],u):r[l]=u;continue}else if(!d(f)){r[l]=u;continue}if(h||!d(u)){r[l]=u;continue}r[l]=L({},f,u);}}}return r}var Qe=(r,e)=>{let t=e.length,n=0;for(let a=0;a<r.length;a++){let i=r[a],o=e[a];if(a<t){let s=Array.isArray(i),l=Array.isArray(o),u=d(i),f=d(o);s&&l||u&&f?(r[n]=L(s?[]:{},i,o),n++):o!=null?(r[n]=o,n++):i!=null&&(r[n]=i,n++);}}for(let a=r.length;a<t;a++)e[a]!==void 0&&e[a]!==null&&r.push(e[a]);return r};function It(r,e){return ae(r,"",{},e)}function ae(r,e="",t={},n){if(t=d(t)?t:{},F(r)||Q(r)||W(r)||Array.isArray(r)&&(n!=null&&n.skipArrays))return e&&(t[e]=r),t;if(typeof r=="function"||typeof r=="object"&&!d(r)&&!Ft(r))return t;if(r instanceof Map||r instanceof WeakMap)return Array.from(r.entries()).forEach(([a,i])=>{let o=e?`${e}[${String(a)}]`:String(a);ae(i,o,t,n);}),t;if(Array.isArray(r)||r instanceof Set||r instanceof WeakSet)return (Array.isArray(r)?r:Array.from(r)).forEach((i,o)=>{let s=e?`${e}[${o}]`:String(o);ae(i,s,t,n);}),t;if(d(r))for(let a in r){if(!Object.prototype.hasOwnProperty.call(r,a))continue;let i=r[a],o=e?e.endsWith("]")?`${e}.${a}`:`${e}.${a}`:a;ae(i,o,t,n);}return t}function Ft(r){return Array.isArray(r)||r instanceof Set||r instanceof Map||r instanceof WeakMap||r instanceof WeakSet}function kt(r){return Object.entries(r)}Object.typedEntries=kt;Object.flatten=It;Object.clone=he;function J(r,e){if(r==null)return "";if(typeof r=="string")return r;if((typeof r=="number"||typeof r=="object"&&r instanceof Number)&&typeof r.formatNumber=="function")return r.formatNumber();if(r instanceof Date||typeof r=="object"&&r!==null&&r.constructor===Date)return typeof r.toFormat=="function"?r.toFormat():r.toISOString();if(r instanceof Error)return `Error: ${r.message}`;if(W(r))return r.toString();if(F(r))return String(r);if(Array.isArray(r))return JSON.stringify(r);if(typeof r=="object"&&r!==null){if(typeof r.toString=="function"&&r.toString!==Object.prototype.toString)return r.toString();if(typeof r.toString=="function"){let t=r.toString();if(t!=="[object Object]")return t}return JSON.stringify(r)}return typeof(r==null?void 0:r.toString)=="function"?r.toString():String(r)}function ie(r,e,t){let n=(t==null?void 0:t.valueFormatter)||J,a=m(r);if(!d(e)||!e)return a;let i=(t==null?void 0:t.tagRegex)||/%\{([^}]+)\}/g,o=new Set,s,l=m(r);for(;(s=i.exec(l))!==null;){let u=s[1];u!==void 0&&o.add(u);}return o.forEach(u=>{let f;if(t!=null&&t.tagRegex){let T=new RegExp(t.tagRegex.source,t.tagRegex.flags);[...l.matchAll(T)].forEach(C=>{let A=C[0];if(!C[1])return;let X=C[1],me=Object.prototype.hasOwnProperty.call(e,X)?e[X]:void 0,gt=me===void 0?"":(()=>{try{return n(me,X,J)}catch(sr){return J(me)}})(),pt=A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(pt,"g"),gt);});return}else f=`%{${u}}`;let b=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,h=b===void 0?"":(()=>{try{return n(b,u,J)}catch(T){return J(b)}})(),O=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(O,"g"),h);}),a}function Te(r){return !!(r==null||typeof r=="number"&&isNaN(r)||typeof r=="string"&&r.trim()==="")}function Bt(r){return m(r).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 oe(r,e){var t=Object.prototype.toString.call(r);return t==="[object "+e+"]"}function w(r,e){if(["boolean","undefined"].includes(typeof r)||r===null)return String(r);if(D(r))return r.formatNumber();if(r instanceof Date)return r.toFormat();if(r instanceof Error)return r==null?void 0:r.toString();e=Object.assign({},e);let{parenthesis:t}=e,n=t?"(":"",a=t?")":"";return typeof r=="string"?(e==null?void 0:e.escapeString)!==false?"'"+Bt(r)+"'":r:oe(r,"RegExp")||oe(r,"Number")||oe(r,"Boolean")?r.toString():oe(r,"Date")?"new Date("+r.getTime()+")":Array.isArray(r)?"["+r.map(i=>w(i,e)).join(",")+"]":typeof r=="object"?n+"{"+Object.keys(r).map(i=>{var o=r[i];return w(i,e)+":"+w(o,e)}).join(",")+"}"+a:r&&typeof(r==null?void 0:r.toString)=="function"?r==null?void 0:r.toString():String(r)}var qe=Symbol("TRANSLATION_KEY");var N=class N extends i18nJs.I18n{constructor(t={},n={}){super({},n);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=Z();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(ye),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(t),this.loadNamespaces();}static[Symbol.hasInstance](t){return this.isI18nInstance(t)}static isI18nInstance(t){if(!t||typeof t!="object")return false;try{if(t instanceof i18nJs.I18n)return !0}catch(n){}return typeof t.getLocale=="function"&&typeof t.translate=="function"&&typeof t.translateTarget=="function"}translate(t,n){return this.isPluralizeOptions(n)&&this.canPluralize(t)?(typeof n.count=="number"&&(n.countStr=n.count.formatNumber()),this.pluralize(n.count,t,n)):super.translate(t,n)}translateTarget(t,n){let a=N.getTargetTanslationKeys(t);for(let i in a)c(a[i])&&(a[i]=this.translate(a[i],n));return a}translateObject(t,n){if(!d(t))return {};let a={};for(let i in t){let o=t[i];c(o)&&(a[i]=M.translate(o,n));}return a}static getTargetTanslationKeys(t){return fe(t,qe)}on(t,n){return this._observableFactory.on.call(this,t,n)}finally(t,n){return this._observableFactory.finally.call(this,t,n)}off(t,n){var a;return (a=this._observableFactory)==null?void 0:a.off.call(this,t,n)}trigger(t,...n){var a;return (a=this._observableFactory)==null?void 0:a.trigger.call(this,t,...n)}offAll(){var t;return (t=this._observableFactory)==null?void 0:t.offAll.call(this)}once(t,n){var a;return (a=this._observableFactory)==null?void 0:a.once.call(this,t,n)}getEventCallBacks(){var t;return (t=this._observableFactory)==null?void 0:t.getEventCallBacks.call(this)}static getInstance(t){if(!this.isI18nInstance(N.instance)){let n=N.getLocaleFromSession();N.instance=this.createInstance({},Object.assign({},n?{locale:n}:{},t));}return N.instance}isDefaultInstance(){return this===N.instance}static setLocaleToSession(t){R.set("i18n.locale",t);}static getLocaleFromSession(){let t=R.get("i18n.locale");return c(t)?t:""}canPluralize(t,n){n=m(n,this.getLocale());let a=this.getNestedTranslation(t,n);return !d(a)||!a?false:c(a==null?void 0:a.one)&&c(a==null?void 0:a.other)}getNestedTranslation(t,n){n=m(n,this.getLocale());let a=(c(t)?t.trim().split("."):Array.isArray(t)?t:[]).filter(c);if(!a.length)return;let i=this.getTranslations(n);for(let o of a)if(d(i))i=i[o];else return;return i}isPluralizeOptions(t){return !!(d(t)&&t&&typeof t.count=="number")}static RegisterTranslations(t){return N.getInstance().registerTranslations(t)}static createInstance(t={},n={}){let s=Object.assign({},n),{interpolate:a}=s,i=ee(s,["interpolate"]),o=new N(t,i);return o.interpolate=(l,u,f)=>{let b=N.flattenObject(f),h=this.defaultInterpolator(l,u,b);return c(h)&&h!==u&&(u=h),typeof a=="function"?a(l,u,f):ie(u,f)},o}getTranslations(t){let n=d(this.translations)?this.translations:{};return c(t)?d(n[t])?n[t]:{}:n}static registerMomentLocale(t,n){return c(t)&&d(n)&&Array.isArray(n.months)&&(this.momentLocales[t]=L({},this.momentLocales[t],n)),this.momentLocales}static getMomentLocale(t){return this.momentLocales[t]}static setMomentLocale(t){try{return V__default.default.updateLocale(t,this.getMomentLocale(t)),!0}catch(n){console.error(n," setting moment locale : ",t);}return false}registerTranslations(t){return this.store(t),this.getTranslations()}store(t){super.store(t),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(t){try{let n=Object.getOwnPropertyNames(t);for(let a of n){let i=Reflect.getMetadata(qe,t,a);if(i)try{t[a]=this.translate(i);}catch(o){Y.error(o," resolving translation for key : ",i);}}}catch(n){Y.error(n," resolving translations for target : ",t);}}getMissingPlaceholderString(t,n,a){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,t,m(n),Object.assign({},a)):t}getLocale(){return super.locale}setLocales(t){return this._locales=Array.isArray(t)?t:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(t){return c(t)&&this.getLocales().includes(t)}getLocales(){let t=Object.keys(this.getTranslations()),n=Array.isArray(this._locales)?this._locales:["en"],a=[...t,...n.filter(i=>!t.includes(i))];return a.includes("en")||a.push("en"),a}isLocaleSupported(t){return c(t)?this.getLocales().includes(t):false}isLoading(){return this._isLoading}setLocale(t,n=false){return super.locale===t&&n!==true&&this._namespacesLoaded[t]?Promise.resolve(this.getLocale()):new Promise((a,i)=>(this._isLoading=true,this.trigger("namespaces-before-load",t),this.loadNamespaces(t).then(o=>{this.isDefaultInstance()&&(N.instance=this,this.isLocaleSupported(t)&&N.setLocaleToSession(t)),super.locale=t,N.setMomentLocale(t),this.trigger("locale-changed",t,o),a(t);}).catch(i).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(t,n){if(!c(t)||typeof n!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",t,n);return}this.namespaceResolvers[t]=n;}static RegisterNamespaceResolver(t,n){return N.getInstance().registerNamespaceResolver(t,n)}loadNamespace(t,n,a=true){return !c(t)||!this.namespaceResolvers[t]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${t}".`)):(n=m(n,this.getLocale()),c(n)?this.namespaceResolvers[t](n).then(i=>{let o={};return o[n]=Object.assign({},i),d(i)&&(a!==false&&this.store(o),this.trigger("namespace-loaded",t,n,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${t}".`)))}static LoadNamespace(t,n,a=true){return N.getInstance().loadNamespace(t,n,a)}loadNamespaces(t,n=true){let a=[],i={};t=m(t,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&a.push(new Promise(s=>{this.namespaceResolvers[o](t).then(l=>{L(i,l);}).finally(()=>{s(true);});}));return Promise.all(a).then(()=>{let o={};return o[t]=i,n!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",t,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(t,n=true){return N.getInstance().loadNamespaces(t,n)}static flattenObject(t){return d(t)?Object.flatten(t):t}static defaultInterpolator(t,n,a){return Te(n)?"":F(n)?(n=String(n),!d(a)||!a||!d(a)||!a?n:n.replace(/%{(.*?)}/g,(i,o)=>Te(a[o])?"":F(a[o])?String(a[o]):w(a[o],{escapeString:false}))):w(n,{escapeString:false})}};N.momentLocales={};var z=N,M=z.getInstance();try{Object.setPrototypeOf(M,z.prototype);}catch(r){}function De(...r){if(r.length===1)return Array.isArray(r[0])?r[0]:[];let e=null;for(var t in r){let n=r[t];if(Array.isArray(n)){if(n.length)return n;e||(e=n);}}return e||[]}var se=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.startsWith(e)&&t>=0;)r=r.slice(e.length),--t;return r.toString()},Ce=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.endsWith(e)&&t>=0;)r=r.slice(0,-e.length),--t;return r.toString()},Se=(r,e=true)=>typeof r!="string"?false:e!==false?/^\d*\.?\d+$/.test(r):/^\d+$/.test(r);String.prototype.ltrim=function(r){return se(this.toString(),r)};String.prototype.rtrim=function(r){return Ce(this.toString(),r)};String.prototype.isNumber=function(r=true){return Se(this.toString(),r)};String.prototype.replaceAll=function(r,e){return !c(r)||!c(e)?this.toString():this.toString().split(r).join(e)};var Ut=r=>c(r)?(r=r.trim(),r.replace(/(.)([A-Z][a-z]+)/,"$1_$2").replace(/([a-z0-9])([A-Z])/,"$1_$2").toUpperCase()):"";String.prototype.toSnakeCase=function(){return Ut(this.toString())};var Ht=r=>c(r)?(r=r.trim(),r.charAt(0)+r.replace(/(_\w)/g,e=>e[1].toUpperCase()).substring(1)):"";String.prototype.toCamelCase=function(){return Ht(this.toString())};var $t=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toUpperCase()+r.slice(1))};String.prototype.upperFirst=function(){return $t(this.toString())};var Gt=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toLowerCase()+r.slice(1))};String.prototype.lowerFirst=function(){return Gt(this.toString())};var zt=(r,e=true)=>{if(typeof r!="string")return "";let t=Wt(r);return r=typeof t.search=="string"?t.search:"",e&&r?"?"+se(r,"?"):(r=Ce(se(r.trim(),"?"),"?"),r)},Xe=function(r,e={}){return typeof r!="string"?{}:Vt__default.default.parse(zt(r,false),S({allowSparse:true,decoder:t=>decodeURIComponent(t.replace(/\+/g," "))},Object.assign({},e)))};var Wt=r=>{if(typeof r!="string")return {};if(typeof URL!="undefined"&&URL&&jt(r))try{return new URL(r)}catch(n){}r=Zt(r)?decodeURIComponent(r):r;var e=r.match(/^(([^:\\/?#]+:)?(?:\/\/((?:([^\\/?#:]*):([^\\/?#:]*)@)?([^\\/?#:]*)(?::([^\\/?#:]*))?)))?([^?#]*)(\?[^#]*)?(#.*)?$/);let t=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 t.protocol&&t.protocol.length==2&&(t.protocol="file:///"+t.protocol.toUpperCase(),t.origin=t.protocol+"//"+t.host),t.protocol&&(t.href=t.origin+t.pathname+t.search+t.hash),t};function jt(r,e={}){let{requireHost:t=true,allowedProtocols:n}=Object.assign({},e);if(!c(r)||!c(r.trim()))return false;let a=r;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(t)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 f=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,b=i.hostname.match(f);if(b&&!b.slice(1,5).map(Number).every(T=>T>=0&&T<=255))return !1}else return !1;return !0}catch(i){return false}if(t){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 f=u.indexOf("/"),b=u.indexOf("?"),h=u.indexOf("#"),O=Math.min(f>=0?f:u.length,b>=0?b:u.length,h>=0?h:u.length),T=u.slice(0,O);if(!T)return false;let P=T;if(T.startsWith("[")){let C=T.indexOf("]");if(C===-1)return false;P=T.slice(0,C+1);let A=T.slice(C+1);if(A&&!A.startsWith(":"))return false}else {let C=T.indexOf(":");C>=0&&(P=T.slice(0,C));}if(!P)return false;if(P==="localhost")return true;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(P))return !P.split(".").map(Number).some(A=>A>255||A<0);if(/^\[.*\]$/.test(P)){let C=P.slice(1,-1);return !(!C||C.includes(":::"))}return !!(/^[a-zA-Z\d-]*(\.[a-zA-Z\d-]+)*$/.test(P)&&P!=="")}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=r=>{if(!c(r)||!r.includes("%"))return false;let e=/%[0-9A-Fa-f]{2}/g;if(!r.match(e))return false;try{let n=decodeURIComponent(r);if(n!==r)return !0;try{if(decodeURIComponent(n)!==n)return !0}catch(a){return !0}}catch(n){return false}return false};var E={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 k=r=>r&&typeof r=="object"&&!Array.isArray(r)&&r.name&&typeof r.name=="string"&&r.symbol&&typeof r.symbol=="string";var _e="%v %s",Ne=r=>{let e=R.get("currencyFormat");return e&&typeof e=="string"&&e.includes("%v")?e:r!==false?_e:""};function et(r){return r=r&&typeof r=="string"?r.trim():"",R.set("currencyFormat",r)}var Qt=r=>{if(!k(r)){let t=typeof r=="object"&&r&&!Array.isArray(r)?m(r.code,r.name):typeof r=="string"?r:void 0;t&&(t=t.trim().toUpperCase()),t&&k(E[t])?r=E[t]:typeof r=="string"&&(t=r.trim().toUpperCase(),k(E[t])&&(r=E[t]));}let e=Object.assign({},r);if(!e.format){let t=Ne();t&&(e.format=t);}return e.format&&et(e.format),R.set("appConfigCurrency",e),e},Jt=()=>{var a,i,o,s;let r=Object.assign({},R.get("appConfigCurrency")),e=R.get("currencyCode");if(c(e)&&k(E[e.trim().toUpperCase()])&&(r=S(S({},E[e.trim().toUpperCase()]),r)),!c(r==null?void 0:r.format)){let l=Ne(false);c(l)&&l.includes("%v")&&(r.format=l);}let n=E["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({},M.getNestedTranslation("currencies"))),r)},$={getFormat:Ne,setFormat:et,setCurrency:Qt,getCurrency:Jt,defaultCurrencyFormat:_e};var qt=r=>r&&typeof r=="object";function Me(r){let e=Object.assign({},$.getCurrency());if(r&&qt(r))for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&r[t]!==void 0&&(e[t]=r[t]);if(c(e.format)){let t=nt(e.format);t.format&&(e.format=t.format),typeof t.decimalDigits=="number"&&(e.decimalDigits=t.decimalDigits);}return e}function Ae(r,e){return r=typeof r=="number"?r:0,e=typeof e=="number"?e:0,r=Math.round(Math.abs(r)),isNaN(r)?e:r}function Xt(r){let e=$.getCurrency(),t=(e==null?void 0:e.format).toLowerCase();return typeof r=="string"&&(r=r.toLowerCase()),(typeof r!="string"||!r.match("%v"))&&(r=t),{pos:r,neg:r.replace("-","").replace("%v","-%v"),zero:r}}var le=(r,e)=>{let t=$.getCurrency();if(r=r||0,typeof r=="number")return r;e=e||t.decimalSeparator;let n=new RegExp("[^0-9-"+e+"]","g"),a=parseFloat((""+r).replace(/\((?=\d+)(.*)\)/,"-$1").replace(n,"").replace(e,"."));return isNaN(a)?0:a},Re=(r,e)=>{let t=$.getCurrency();e=Ae(e,t.decimalDigits);let a=String(r).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"}},tt=(r,e,t,n)=>{var b;r=le(r);let a=k(e)?e:$.getCurrency();typeof e=="number"&&(a.decimalDigits=e),typeof a.decimalDigits!="number"&&(a.decimalDigits=(b=String(r).split(".")[1])==null?void 0:b.length),t!==void 0&&(a.thousandSeparator=t),n!==void 0&&(a.decimalSeparator=n);let i=Me(a),o=Ae(i.decimalDigits),s=r<0?"-":"",l=parseInt(Re(Math.abs(r||0),o),10)+"",u=l.length>3?l.length%3:0,f="";if(o){let h=String(parseFloat(Re(Math.abs(r),o))||0);h.includes(".")&&(f=m(h.split(".")[1]).trim());}return s+(u?l.substring(0,u)+i.thousandSeparator:"")+l.substring(u).replace(/(\d{3})(?=\d)/g,"$1"+i.thousandSeparator)+(o&&f?i.decimalSeparator+f:"")},rt=(r,e,t,n,a,i)=>{r=le(r);let o=k(e)?e:$.getCurrency();e!==void 0&&typeof e=="string"&&(o.symbol=e),t!==void 0&&(o.decimalDigits=t),n!==void 0&&(o.thousandSeparator=n),a!==void 0&&(o.decimalSeparator=a),c(i)&&(o.format=i);let s=Me(o),l=Xt(s.format),u=m(r>0?l.pos:r<0?l.neg:l.zero),f=m(s.symbol),b=u.replace(f&&"%s",f),h=tt(Math.abs(r),Ae(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),O=b.replace("%v",h);return K(S({},s),{formattedValue:b,formattedNumber:h,symbol:s.symbol,usedFormat:u,result:O})},_t=(r,e,t,n,a,i)=>rt(r,e,t,n,a,i).result,nt=r=>{r=m(r).trim();let e={};if(r){let t=/(\.)(\#{0,9}\s*$)/,n=r.match(t);Array.isArray(n)&&n.length===3&&(e.decimalDigits=m(n[2]).trim().length),r=r.replace(t,"");}return e.format=r,e},j={parse:le,session:$,formatMoney:_t,currencies:E,isCurrency:k,formatNumber:tt,formatMoneyAsObject:rt,unformat:le,toFixed:Re,prepareOptions:Me,parseFormat:nt};var{currencies:at}=j;Number.prototype.countDecimals=function(){let r=String(this.toString()).match(/\.(\d+)/);return r?r[1].length:0};Number.prototype.formatNumber=function(r,e,t){return j.formatNumber(this.valueOf(),r,e,t)};Number.prototype.formatMoney=function(r,e,t,n,a){return j.formatMoney(this.valueOf(),r,e,t,n,a)};var er=(r,e,t,n)=>{var C;if(r===null||typeof r!="number"||isNaN(r))return {result:"",format:"",suffix:"",formattedValue:"",minAbreviationDecimalDigits:0,value:NaN};if(!isFinite(r)){let A=r>0?"\u221E":"-\u221E";return {result:A,value:r,format:"",suffix:"",formattedValue:A,minAbreviationDecimalDigits:0}}let a=Math.abs(r)<1e3,i=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"},{value:1e3,suffix:"K"},{value:1,suffix:""}],o=r.countDecimals?r.countDecimals():Math.floor(r)===r?0:((C=r.toString().split(".")[1])==null?void 0:C.length)||0,s=i.find(A=>Math.abs(r)>=A.value)||i[i.length-1],l=a?r:r/(s.value===1?1:s.value),u=s.suffix,f=tr(l,5);if(r===0)return {result:"0",value:0,format:"",suffix:"",formattedValue:"0",minAbreviationDecimalDigits:0};let h=D(e)&&e>0?e:s.value===1?Math.min(o,5):Math.max(f,0),O=l.toFixed(h);t=m(t),n=m(n,".");let T=O.toString().split(".");return T[0]=T[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),h>0&&T.length===1?T.push("0".repeat(h)):h>0&&T.length>1&&T[1].length<h&&(T[1]=T[1].padEnd(h,"0")),O=T.join(n),{result:O+u,value:r,format:u,suffix:u,formattedValue:O,minAbreviationDecimalDigits:f}};function tr(r,e){let t=Math.abs(r);if(Number.isInteger(t))return 0;let n=t.toString().split(".")[1]||"",a=0;for(;a<n.length&&n[a]==="0";)a++;return t<1&&a>0?Math.min(a+e,n.length):Math.min(e,n.length)}var it=(r,e,t,n)=>er(r,e,t,n).result;Number.prototype.abreviate2FormatNumber=function(r,e,t){return it(this.valueOf(),r,e,t)};var ot=(r,e,t,n,a,i)=>{if(!D(r))return "";let l=j.formatMoneyAsObject(r,e,t,n,a,i),{formattedValue:o}=l,s=ee(l,["formattedValue"]);return o.replace("%v",it(r,s.decimalDigits,s.thousandSeparator,s.decimalSeparator))};Number.prototype.abreviate2FormatMoney=function(r,e,t,n,a){return ot(this.valueOf(),r,e,t,n,a)};Object.keys(at).forEach(r=>{let e=r,t=at[e],n=`format${e}`,a=`abreviate2Format${e}`;Number.prototype[n]=function(i,o,s,l){return j.formatMoney(this.valueOf(),t,i,o,s,l)},Number.prototype[a]=function(i,o,s,l){return ot(this.valueOf(),t,i,o,s,l)};});var nr=Pe__default.default.AES.encrypt,ar=Pe__default.default.AES.decrypt,st="auth-decrypted-key",lt="user-session",ct={get:r=>y(null,null,function*(){return R.get(r)}),set:(r,e)=>y(null,null,function*(){yield R.set(r,e);}),remove:r=>y(null,null,function*(){yield R.remove(r);})},ve=class r{static get(e,t){if(c(t))return r.getData(e)[t]}static set(e,t,n){let a=r.getData(e);return c(t)?a[t]=n:d(t)&&(a=t),R.set(r.getKey(e),a),a}static getKey(e){let t=q.getSignedUser();return `auth-${w((t==null?void 0:t.id)||(t==null?void 0:t.email))}-${e||""}`}static getData(e){if(!c(e))return {};let t=r.getKey(e);return Object.assign({},R.get(t))}static getStorage(e){return {sessionName:e,get:t=>r.get(e,t),set:(t,n)=>r.set(e,t,n),getData:()=>r.getData(e),getKey:()=>r.getKey(e)}}},p=class p{static _isMasterAdmin(e){return e=d(e)?e:p.getSignedUser(),typeof p.isMasterAdmin=="function"?p.isMasterAdmin(e):false}static getSignedUser(){if(d(p.localUserRef.current))return p.localUserRef.current;let e=R.get(lt);if(e)try{let t=ar(e,st);if(t&&typeof(t==null?void 0:t.toString)=="function"){let n=t.toString(Pe__default.default.enc.Utf8);return p.localUserRef.current=U.parse(n),p.localUserRef.current}}catch(t){Y.log("getting local user ",t);}return null}static setSignedUser(e,t){return y(this,null,function*(){p.localUserRef.current=e;let n=e,a=null;try{d(n)&&(n.sessionCreatedAt=new Date().getTime()),a=n?nr(JSON.stringify(n),st).toString():null;}catch(i){p.localUserRef.current=null,Y.log(i," setting local user");}if(yield R.set(lt,a),t){let i=d(n)&&a&&a!==null?"SIGN_IN":"SIGN_OUT";p.events.trigger(i,n);}return e})}static signIn(e,t=true){return y(this,null,function*(){if(!d(e))throw new Error(M.t("auth.invalidSignInUser"));return yield p.setSignedUser(e,t)})}static signOut(e=true){return y(this,null,function*(){return yield p.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,t){if(t=Object.assign({},t||p.getSignedUser()),typeof e=="boolean")return e;if(p._isMasterAdmin(t)||!e)return true;if(typeof e=="function")return !!e(t);if(p.isResourceActionTupleObject(e)){if(p.checkUserPermission(t,e.resourceName,e.action))return true}else if(p.isResourceActionTupleArray(e)){if(p.checkUserPermission(t,e[0],e[1]))return true}else if(Array.isArray(e))for(let n in e){let a=e[n];if(p.isResourceActionTupleArray(a)){if(p.checkUserPermission(t,a[0],a[1]))return true}else if(p.isResourceActionTupleObject(a)&&p.checkUserPermission(t,a.resourceName,a.action))return true}return false}static checkUserPermission(e,t,n="read"){if(!d(e)||!e)return false;if(d(e.perms)&&e.perms&&p.checkPermission(e.perms,t,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)&&p.checkPermission(i.perms,t,n))return true}return false}return false}static checkPermission(e,t,n="read"){if(e=Object.assign({},e),t=c(t)?t:"",!d(e)||!t)return false;let a=String(t).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(p.isAllowedForAction(i[o],n))return true;return false}static isAllowedForAction(e,t){return !c(t)||!c(e)?false:String(t).trim().toLowerCase()===String(e).trim().toLowerCase()}static get Session(){return ve}static get secureStorage(){let e=Reflect.getMetadata(p.authStorageMetaData,p);return ut(e)&&(this._secureStorage=e),this._secureStorage?this._secureStorage:ct}static set secureStorage(e){ut(e)&&Reflect.defineMetadata(p.authStorageMetaData,e,p);}static getToken(){return y(this,null,function*(){return yield this.secureStorage.get("auth-token")})}static setToken(e){return y(this,null,function*(){yield this.secureStorage.set("auth-token",e);})}};p.events=Ie({}),p.localUserRef={current:null},p._secureStorage=ct,p.authStorageMetaData=Symbol("auth:storage:meta");var q=p;var ut=r=>{if(!r)return false;try{return ["get","set","remove"].every(e=>typeof r[e]=="function")}catch(e){return false}};var ce=Symbol("fieldsResourcesMetadata");function Vi(r){return function(e,t){var i;let n=Object.assign({},Reflect.getMetadata(ce,e)||{}),a=String((i=Reflect.getMetadata("design:type",e,t))==null?void 0:i.name).toLowerCase();r.type===void 0&&(r.type=["string","number","boolean","date"].includes(a)?a:"text"),n[t]=S({name:t},Object.assign({},r)),Reflect.defineMetadata(ce,n,e);}}function zi(r){let e=Reflect.getMetadata(ce,r.prototype);return Object.assign({},e)}function dt(r){let e=Reflect.getMetadata(ce,Object.getPrototypeOf(r).constructor);return Object.assign({},e)}var ue=class r{static normalizePagination(e){let{page:t,skip:n,limit:a}=Object.assign({},e);return D(a)?(D(n)&&n>0?t=Math.floor(n/a)+1:D(t)&&t>0?n=(t-1)*a:(t=1,n=0),{page:t,skip:n,limit:a}):{}}static normalizeOrderBy(e){let t=Array.isArray(e)?e:c(e)?[e]:[],n={};return t.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)?D(e.limit):false}static getPaginationMetaData(e,t){let{limit:n,page:a,skip:i}=r.normalizePagination(t);e=D(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,t,n){let a=r.getPaginationMetaData(t,n),{currentPage:i,pageSize:o,totalPages:s}=a;if(Array.isArray(e)&&D(i)&&D(o)&&D(s)){let l=Math.max(0,i-1)*o,u=l+o;e=e.slice(l,u);}return {data:e,total:t,meta:a}}static parseQueryOptions(e){var A;let t=L({},e==null?void 0:e.params,Xe(e==null?void 0:e.url)),n=L({},t,(A=e==null?void 0:e.headers)==null?void 0:A["x-filters"],e==null?void 0:e.filters),a=Oe(n.limit),i=Oe(n.skip),o=Oe(n.page),s=r.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,f=r.normalizeOrderBy(u);f&&Object.getSize(f,true)>0&&(s.orderBy=f);let b=De(n.include);b.length&&(s.include=b);let h=n.cache;h!==void 0&&(s.cache=!!h);let O=n.cacheTTL;O!==void 0&&(s.cacheTTL=O);let T=ir(n.where);d(T)&&Object.getSize(T,true)&&(s.where=T);let P=n.includeDeleted;typeof P=="boolean"&&(s.includeDeleted=P);let C=De(n.relations);return C.length&&(s.relations=C),K(S({},s),{queryParams:t})}},ir=(...r)=>{for(let e of r)if(Array.isArray(e)&&e.length||c(e)||d(e)&&Object.getSize(e,true))return e},Oe=r=>{if(Se(r))return Number(r);if(typeof r=="number")return r};var mt=["$and","$or","$nor","$not"],ft=["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin","$exists","$type","$regex","$size","$mod","$all","$elemMatch"],ro={LOGICAL:mt,COMPARAISON:ft,ALL:[...mt,...ft],ARRAY:["$all","$elemMatch","$in","$nin"]};var yt=Symbol("resources"),or=Symbol("resourceFromClassName"),de=class de{constructor(){this._onDictionaryChangedListener=M.on("translations-changed",this.onI18nChange.bind(this)),this._onLocaleChangeListener=M.on("locale-changed",this.onI18nChange.bind(this)),this.init();}getMetaData(){return Object.assign({},Reflect.getMetadata(G.resourceMetaData,this.constructor))}onI18nChange(){this.resolveTranslations();}resolveTranslations(){return M.resolveTranslations(this)}destroy(){var e,t;(e=this._onDictionaryChangedListener)==null||e.remove(),(t=this._onLocaleChangeListener)==null||t.remove();}getResourceContext(e){return K(S({},Object.assign({},e)),{resourceLabel:this.getLabel(),resourceName:this.getName()})}get INVALID_DATA_PROVIDER_ERROR(){return M.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,...t){de.events.trigger(e,this.getResourceContext(),...t);}authorizeAction(e){return y(this,null,function*(){if(!this.hasDataService())throw new Error(this.INVALID_DATA_PROVIDER_ERROR);let t;switch(e){case "read":t=this.canUserRead();break;case "create":t=this.canUserCreate();break;case "update":t=this.canUserUpdate();break;case "delete":t=this.canUserDelete();break;default:t=this.isAllowed(e);break}if(!t)throw new Error(M.t(this.buildTranslationPath("forbiddenError"),this.getResourceContext({action:e})))})}find(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>{var t;return (t=this.getDataService())==null?void 0:t.find(e).then(n=>(this.trigger("find",n),n))})})}findOne(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findOne(e).then(t=>(this.trigger("findOne",t),t)))})}buildTranslationPath(e){let t=this.getName(),n=`resources${c(t)?`.${t}`:""}.`;return c(e)?`${n}${e.trim().ltrim(".")}`:n}findOneOrFail(e){return y(this,null,function*(){let t=yield this.findOne(e);if(!d(t)||!t)throw new Error(M.t(this.buildTranslationPath("notFoundError"),Object.assign({},{options:JSON.stringify(e)},this.getResourceContext())));return t})}beforeCreate(e){return y(this,null,function*(){})}afterCreate(e){return y(this,null,function*(){})}beforeUpdate(e,t){return y(this,null,function*(){})}afterUpdate(e,t,n){return y(this,null,function*(){})}beforeDelete(e){return y(this,null,function*(){})}afterDelete(e,t){return y(this,null,function*(){})}beforeCreateMany(e){return y(this,null,function*(){})}afterCreateMany(e,t){return y(this,null,function*(){})}beforeUpdateMany(e,t){return y(this,null,function*(){})}afterUpdateMany(e,t,n){return y(this,null,function*(){})}beforeDeleteMany(e){return y(this,null,function*(){})}afterDeleteMany(e,t){return y(this,null,function*(){})}create(e){return y(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreate(e).then(()=>this.getDataService().create(e).then(t=>this.afterCreate(t).then(()=>(this.trigger("create",t),t)))))})}update(e,t){return y(this,null,function*(){return this.authorizeAction("update").then(()=>y(this,null,function*(){return this.beforeUpdate(e,t).then(()=>{var n;return (n=this.getDataService())==null?void 0:n.update(e,t).then(a=>this.afterUpdate(a,e,t).then(()=>(this.trigger("update",a,e,t),a)))})}))})}delete(e){return y(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDelete(e).then(()=>{var t;return (t=this.getDataService())==null?void 0:t.delete(e).then(n=>this.afterDelete(n,e).then(()=>(this.trigger("delete",n,e),n)))}))})}findAndCount(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findAndCount(e).then(t=>(this.trigger("findAndCount",t),t)))})}findAndPaginate(e){return y(this,null,function*(){e=Object.assign({},e);let[t,n]=yield this.findAndCount(e);return ue.paginate(t,n,e)})}createMany(e){return y(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreateMany(e).then(()=>this.getDataService().createMany(e).then(t=>this.afterCreateMany(t,e).then(()=>(this.trigger("createMany",t,e),t)))))})}updateMany(e,t){return y(this,null,function*(){return this.authorizeAction("update").then(()=>this.beforeUpdateMany(e,t).then(()=>this.getDataService().updateMany(e,t).then(n=>this.afterUpdateMany(n,e,t).then(()=>(this.trigger("updateMany",n,e,t),n)))))})}deleteMany(e){return y(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDeleteMany(e).then(()=>this.getDataService().deleteMany(e).then(t=>this.afterDeleteMany(t,e).then(()=>(this.trigger("deleteMany",t,e),t)))))})}count(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().count(e).then(t=>(this.trigger("read",t),t)))})}exists(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().exists(e).then(t=>(this.trigger("exits",t),t)))})}updateMetadata(e){e=Object.assign({},e);let t=L({},this.getMetaData(),e);return Reflect.defineMetadata(G.resourceMetaData,t,this.constructor),t}init(){this.resolveTranslations(),this.getFields();}getTranslations(e){e=m(e,M.getLocale());let t=String(this.getName()).trim();if(!c(t))return {};let n=M.getNestedTranslation(["resources",t],e);return d(n)&&n?n:{}}translate(e,t){let n=c(e)?e.trim().split("."):Array.isArray(e)?e:[];return n[0]!=="resources"&&!G.hasResource(n[1])&&n.unshift(this.getName(),"resources"),M.translate(n,t)}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 t=this.getActions();return d(t[e])&&t[e]!==void 0}isAllowed(e,t){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,t)}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,t,n){e=m(e).trim(),n=Object.assign({},{resourceName:this.getName()},n);let a=this.getTranslations();if(c(e)&&a[e]){let i=w(M.t(e,n));if(c(i)&&i.includes("."+e.ltrim(".")))return i}return m(t,e)}getLabel(){let e=this.getMetaData().label,t=this.translateProperty("label",m(e,this.label,this.getName()));return String(t).toLowerCase().trim()!="label"?t:m(this.getName())}getTitle(){return this.translateProperty("title",m(this.getMetaData().title,this.title,this.getLabel()))}getFields(){try{return this.resolveTranslations(),this.fields=dt(this),this.fields}catch(e){Y.log(e," getting resources fieldss");}return {}}interpolate(e,t,n){return ie(e,this.getResourceContext(t),S({tagRegex:/\{([^}]+)\}/g},n))}getActionLabel(e,t){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.label,t)}getActionTitle(e,t){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.title,t)}getAction(e){if(!c(e))return {};let t=this.getActions();return d(t[e])&&t[e]||{}}getPrimaryKeys(){let e=[];if(d(this.fields))for(let t in this.fields)d(this.fields[t])&&this.fields[t].primaryKey&&e.push(this.fields[t]);return e}};de.events=Z();var xe=de,B=class B{static getAllMetaData(){return Object.assign({},Reflect.getMetadata(yt,B))}static addMetaData(e,t){let n=this.getAllMetaData();!c(e)||!e||(t=Object.assign({},t),t.name=c(t==null?void 0:t.name)?t.name:e,n[e]=t,Reflect.defineMetadata(yt,n,B));}static getAllClassNames(){return Object.assign({},Reflect.getMetadata(or,B))}static getNameFromClassName(e){return c(e)?this.getAllClassNames()[e]:void 0}static getMetaDataFromName(e){let t=this.getAllMetaData();if(!(!c(e)||!e))return t[e]}static getMetaDataFromTarget(e){return Object.assign({},Reflect.getMetadata(B.resourceMetaData,e.prototype))}static getMetaDataByClassName(e){let t=this.getNameFromClassName(e);if(t)return this.getMetaDataFromName(t)}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 t=B.getMetaDataFromName(e);return d(t)&&(t==null?void 0:t.name)==e?true:!!this.getResource(e)}static addResource(e,t){typeof e=="string"&&e&&t&&t instanceof xe&&(this.resources[e]=t);}static removeResource(e){return typeof e=="string"&&delete this.resources[e],this.resources}static getResources(){return this.resources}};B.resourceMetaData=Symbol("resource"),B.resources={};var G=B;function go(r){return function(e){if(r=Object.assign({},r),typeof e=="function"&&r!=null&&r.instanciate)try{let t=new e;t.updateMetadata(r),G.addResource(r.name,t);}catch(t){}Reflect.defineMetadata(G.resourceMetaData,r,e),G.addMetaData(r.name,r);}}
|
|
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",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var St={auth:ke,currencies:Be,countries:Fe,dates:Ke,resources:Ue,validator:He};function c(r){return !!(r&&typeof r=="string")}function m(...r){for(var e in r){let t=r[e];if(c(t))return t}return ""}function te(r){return !!(r==null||typeof r=="undefined"||typeof r=="string"&&r===""||Array.isArray(r)&&!r.length)}function D(r){return typeof r=="number"&&!isNaN(r)&&isFinite(r)}function Q(r){return !r||typeof r!="object"?false:r instanceof Date?true:typeof r.getTime!="function"?false:!(Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))}var g=class g{static parseString(e,t){if(c(e)&&c(t))try{let n=V__default.default(e,t,!0);if(n.isValid())return {date:n.toDate(),matchedFormat:t,isValid:!0}}catch(n){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let n of t){let a=$e(e,n);if(a)return a}for(let n of g.DATE_FORMATS){let a=$e(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 t=e?g.parseDate(e):new Date;return t?t.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,t){if(g.isDateObj(e))return e;if(!c(t)){let n=g.parseString(e);return n!=null&&n.isValid?n.date:null}if(te(e))return null;try{let n=V__default.default(e,t,!0);if(n!=null&&n.isValid())return n.toDate()}catch(n){console.error(n," parsing date with moment : ",e," format is : ",t);}return null}static toSQLDateTimeFormat(e){if(!g.isDateObj(e))return "";let t=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 `${t}-${n}-${a} ${i}:${o}:${s}`}static getI18n(e){return z.isI18nInstance(e)?e:z.getInstance()}static getDefaultDateTimeFormat(e){return m(this.getI18n(e).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return m(this.getI18n(e).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!g.isDateObj(e))return "";let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${t}-${n}-${a}`}static toSQLTimeFormat(e){if(!g.isDateObj(e))return "";let t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return `${t}:${n}:${a}`}static getDefaultTimeFormat(e){return m(this.getI18n(e).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,t){if(e==null||typeof e=="boolean")return false;if(g.isDateObj(e))return true;if(D(e)){let a=new Date(e);return a&&!isNaN(a.getTime())}if(c(e))return !!g.parseDate(e,t);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let n=new Date(e);return g.isDateObj(n)}static addToDate(e,t,n){if(D(e)||(e=0),te(t)&&(t=new Date),g.isValidDate(t)&&c(t)&&(t=new Date(t)),g.isValidDate(t)||(t=c(t)?new Date(t):new Date),c(n)&&typeof t["set"+n]=="function"&&typeof t["get"+n]=="function"){let a="set"+n,i="get"+n;t=new Date(t[a](t[i]()+e));}return t}static addDays(e,t){return g.addToDate(e,t,"Date")}static addMilliseconds(e,t){return D(e)||(e=0),g.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+e)}static addSeconds(e,t){return D(e)||(e=0),g.addMilliseconds(e*1e3,t)}static addMinutes(e,t){return D(e)||(e=0),g.addMilliseconds(e*6e4,t)}static addHours(e,t){return D(e)||(e=0),g.addMilliseconds(e*36e5,t)}static addMonths(e,t,n){return g.addToDate(e,t,"Month")}static addWeeks(e,t){return e=(D(e)?e:0)*7,g.addToDate(e,t,"Date")}static addYears(e,t){D(e)||(e=0);let n=new Date(g.addToDate(0,t)),a=n.getFullYear();return a+e<0?e=0:e+=a,n.setFullYear(e),new Date(n)}static formatDate(e,t){try{let n=V__default.default(e);if(n.isValid())return n.format(m(t,g.getDefaultDateTimeFormat()))}catch(n){}return m(g.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let t=e?V__default.default.utc(e):V__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};g.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"],g.SQL_DATE_FORMAT="YYYY-MM-DD",g.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",g.SQL_TIME_FORMAT="HH:mm:ss",g.getCurrentMonthDaysRange=e=>{let t=g.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:n,last:a}},g.getPreviousWeekDaysRange=e=>{let t=g.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=new Date(t.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}},g.getCurrentWeekDaysRange=e=>{let t=g.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),n=t.getDay(),a=t.getDate()-n+(n==0?-6:1),i=new Date(t),o=new Date(t.setDate(a));return i.setDate(i.getDate()+6),{first:o,last:i}},g.isDateObj=Q;var v=g,$e=(r,e)=>{let t=V__default.default(r,e,true);try{if(t.isValid()&&t.format(e)===r||V__default.default.utc(t,!0).format(e)===r)return {date:t.toDate(),matchedFormat:e,isValid:!0}}catch(n){}return null};Date.prototype.toSQLDateTimeFormat=function(){return v.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return v.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return v.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(r){return v.formatDate(this,r)};Date.prototype.addYears=function(r){return v.addYears(r,this)};Date.prototype.addMonths=function(r){return v.addMonths(r,this)};Date.prototype.addMinutes=function(r){return v.addMinutes(r,this)};Date.prototype.addSeconds=function(r){return v.addSeconds(r,this)};Date.prototype.addDays=function(r){return v.addDays(r,this)};Date.prototype.addWeeks=function(r){return v.addWeeks(r,this)};Date.prototype.addHours=function(r){return v.addHours(r,this)};var I=class I{static get logger(){let e=Reflect.getMetadata(I.loggerMetaData,I);return Ge(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){Ge(e)&&Reflect.defineMetadata(I.loggerMetaData,e,I);}static _log(e,...t){let n=I.logger;e=m(e),e&&typeof n[e]=="function"?n[e](I.getDateTimeString(),...t):console.log("Logger level not found : [",e,"]",...t);}static getDateTimeString(){let{day:e,year:t,hours:n,minutes:a,seconds:i,dayNameShort:o,monthName:s}=v.getUTCDateTimeDetails(),l=e<10?"0"+e:e,u=n<10?"0"+n:n,f=a<10?"0"+a:a,b=i<10?"0"+i:i;return "["+[o,l,s,t].join(" ")+" "+[u,f,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);}};I.loggerMetaData=Symbol("logger-meta-data");var Y=I,Ge=r=>{if(!r)return false;try{return ["warn","info","error"].every(e=>typeof r[e]=="function")}catch(e){return false}};function Nt(r){return typeof r=="boolean"||!r||typeof r=="number"||typeof r=="string"||typeof r=="symbol"?false:Object(r).constructor===Promise||r.constructor&&(r.constructor.name==="Promise"||r.constructor.name==="AsyncFunction")||r instanceof Promise||typeof(r==null?void 0:r.then)=="function"&&typeof(r==null?void 0:r.catch)=="function"&&typeof(r==null?void 0:r.finally)=="function"?true:r&&typeof r.constructor=="function"&&Function.prototype.toString.call(r.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ge(r){return r&&Object.prototype.toString.call(r)==="[object Promise]"?true:Nt(r)}function Ve(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var re=()=>{var r;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((r=process==null?void 0:process.versions)!=null&&r.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},Rt=()=>{var r,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((r=window==null?void 0:window.process)==null?void 0:r.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)},Mt=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(r){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},At=()=>typeof window=="undefined"&&typeof process!="undefined",ze=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),vt=()=>{if(!Ve()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let r=navigator.userAgent.toLowerCase();return /android/i.test(r)},Pt=()=>{var r;return !ze()||!(window!=null&&window.ReactNativeWebView)?false:typeof((r=window==null?void 0:window.ReactNativeWebView)==null?void 0:r.postMessage)=="function"},Ot=()=>re()&&process.platform==="darwin",xt=()=>re()&&process.platform==="win32",wt=()=>re()&&process.platform==="linux",je={isWeb:Ve,isLinux:wt,isDarwin:Ot,isWin32:xt,isNode:re,isElectron:Rt,isTouchDevice:Mt,isServerSide:At,isClientSide:ze,isAndroidMobileBrowser:vt,isReactNativeWebview:Pt};var U=class r{static decycle(e,t=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(t.includes(e))return null;let n=t.concat([e]);return Array.isArray(e)?e.map(a=>r.decycle(a,n)):Object.fromEntries(Object.entries(e).map(([a,i])=>[a,r.decycle(i,n)]))}static stringify(e,t=false){return typeof e=="string"?e:JSON.stringify(t!==false?r.decycle(e):e)}static isJSON(e){if(typeof e!="string")return false;let t=e.trim();if(t.length===0)return false;let n=t[0];if(n!=="{"&&n!=="[")return false;try{let a=JSON.parse(t);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(e,t){if(typeof e=="string")try{e=JSON.parse(e,t);}catch(n){return e}if(e&&typeof e=="object")for(let n in e){let a=e[n];r.isJSON(a)&&(e[n]=r.parse(a,t));}return e}};var H=class H{static get storage(){var t;let e=Reflect.getMetadata(H.sessionStorageMetaData,H);if(pe(e)&&(this._storage=e),this._storage)return this._storage;if(je.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.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){pe(e)&&Reflect.defineMetadata(H.sessionStorageMetaData,e,H);}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 t=this.keyNamespace;return t?`${t}-${e}`:e}};H.sessionStorageMetaData=Symbol("sessionStorage"),H._keyNamespace=void 0;var x=H;function ne(r){return x.sanitizeKey(r)}var We=(r,e)=>(r=r&&U.stringify(r,e),r==null&&(r=""),r),Ze=r=>{if(ge(r))return new Promise((e,t)=>{r.then(n=>{e(U.parse(n));}).catch(n=>{t(n);});});if(r!=null)return U.parse(r)},Yt=r=>{if(r=ne(r),x.storage&&r&&typeof r=="string"){let e=x.storage.get(r);return Ze(e)}},Lt=r=>{if(r=ne(r),x.storage&&r&&typeof r=="string")return x.storage.remove(r)},Et=()=>{if(x.storage)return x.storage.removeAll()},pe=r=>{if(!r)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof r[e]=="function")}catch(e){return false}},R={get:Yt,set:(r,e,t=true)=>(r=ne(r),x.storage.set(r,We(e,t))),remove:Lt,handleGetValue:Ze,sanitizeKey:ne,handleSetValue:We,isValidStorage:pe,Manager:x,removeAll:Et};function F(r){return r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function j(r){if(r instanceof RegExp)return true;if(!r||typeof r!="object"||!Object.prototype.toString.call(r).includes("RegExp"))return false;try{return new RegExp(r),!0}catch(e){return false}}function be(r){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:r===document?true:"HTMLElement"in window?!!r&&r instanceof HTMLElement:!!r&&typeof r=="object"&&r.nodeType===1&&!!r.nodeName}function d(r){if(r===null||typeof r!="object"||be(r)||Q(r)||j(r)||F(r))return false;let e=Object.getPrototypeOf(r);if(e===null)return true;let t=e.constructor;if(typeof t!="function")return false;if(t===Object)return true;let n=t.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 he(r){if(Array.isArray(r)){let n=[];for(var e=0;e<r.length;e++)n[e]=he(r[e]);return n}else if(d(r)&&r){let n={};for(var t in r)r.hasOwnProperty(t)&&(n[t]=he(r[t]));return n}else return r}Object.getSize=function(r,e=false){if(!r||typeof r!="object")return 0;if(Array.isArray(r))return r.length;typeof e!="boolean"&&(e=false);let t=0;for(let n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t++,e===true))return t;return t};function L(r,...e){let t=Array.isArray(r),n=d(r);(r==null||!t&&!n)&&(r={});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(t){s&&Qe(r,i);continue}else if(s)continue;for(let l in i){let u=i[l];if(u==null)continue;if(u===i){r[l]=r;continue}let f=r[l],b=Array.isArray(f),h=Array.isArray(u);if(b){h?Qe(r[l],u):r[l]=u;continue}else if(!d(f)){r[l]=u;continue}if(h||!d(u)){r[l]=u;continue}r[l]=L({},f,u);}}}return r}var Qe=(r,e)=>{let t=e.length,n=0;for(let a=0;a<r.length;a++){let i=r[a],o=e[a];if(a<t){let s=Array.isArray(i),l=Array.isArray(o),u=d(i),f=d(o);s&&l||u&&f?(r[n]=L(s?[]:{},i,o),n++):o!=null?(r[n]=o,n++):i!=null&&(r[n]=i,n++);}}for(let a=r.length;a<t;a++)e[a]!==void 0&&e[a]!==null&&r.push(e[a]);return r};function It(r,e){return ae(r,"",{},e)}function ae(r,e="",t={},n){if(t=d(t)?t:{},F(r)||Q(r)||j(r)||Array.isArray(r)&&(n!=null&&n.skipArrays))return e&&(t[e]=r),t;if(typeof r=="function"||typeof r=="object"&&!d(r)&&!Ft(r))return t;if(r instanceof Map||r instanceof WeakMap)return Array.from(r.entries()).forEach(([a,i])=>{let o=e?`${e}[${String(a)}]`:String(a);ae(i,o,t,n);}),t;if(Array.isArray(r)||r instanceof Set||r instanceof WeakSet)return (Array.isArray(r)?r:Array.from(r)).forEach((i,o)=>{let s=e?`${e}[${o}]`:String(o);ae(i,s,t,n);}),t;if(d(r))for(let a in r){if(!Object.prototype.hasOwnProperty.call(r,a))continue;let i=r[a],o=e?e.endsWith("]")?`${e}.${a}`:`${e}.${a}`:a;ae(i,o,t,n);}return t}function Ft(r){return Array.isArray(r)||r instanceof Set||r instanceof Map||r instanceof WeakMap||r instanceof WeakSet}function kt(r){return Object.entries(r)}Object.typedEntries=kt;Object.flatten=It;Object.clone=he;function J(r,e){if(r==null)return "";if(typeof r=="string")return r;if((typeof r=="number"||typeof r=="object"&&r instanceof Number)&&typeof r.formatNumber=="function")return r.formatNumber();if(r instanceof Date||typeof r=="object"&&r!==null&&r.constructor===Date)return typeof r.toFormat=="function"?r.toFormat():r.toISOString();if(r instanceof Error)return `Error: ${r.message}`;if(j(r))return r.toString();if(F(r))return String(r);if(Array.isArray(r))return JSON.stringify(r);if(typeof r=="object"&&r!==null){if(typeof r.toString=="function"&&r.toString!==Object.prototype.toString)return r.toString();if(typeof r.toString=="function"){let t=r.toString();if(t!=="[object Object]")return t}return JSON.stringify(r)}return typeof(r==null?void 0:r.toString)=="function"?r.toString():String(r)}function ie(r,e,t){let n=(t==null?void 0:t.valueFormatter)||J,a=m(r);if(!d(e)||!e)return a;let i=(t==null?void 0:t.tagRegex)||/%\{([^}]+)\}/g,o=new Set,s,l=m(r);for(;(s=i.exec(l))!==null;){let u=s[1];u!==void 0&&o.add(u);}return o.forEach(u=>{let f;if(t!=null&&t.tagRegex){let T=new RegExp(t.tagRegex.source,t.tagRegex.flags);[...l.matchAll(T)].forEach(C=>{let A=C[0];if(!C[1])return;let X=C[1],me=Object.prototype.hasOwnProperty.call(e,X)?e[X]:void 0,gt=me===void 0?"":(()=>{try{return n(me,X,J)}catch(sr){return J(me)}})(),pt=A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(pt,"g"),gt);});return}else f=`%{${u}}`;let b=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,h=b===void 0?"":(()=>{try{return n(b,u,J)}catch(T){return J(b)}})(),O=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(O,"g"),h);}),a}function Te(r){return !!(r==null||typeof r=="number"&&isNaN(r)||typeof r=="string"&&r.trim()==="")}function Bt(r){return m(r).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 oe(r,e){var t=Object.prototype.toString.call(r);return t==="[object "+e+"]"}function w(r,e){if(["boolean","undefined"].includes(typeof r)||r===null)return String(r);if(D(r))return r.formatNumber();if(r instanceof Date)return r.toFormat();if(r instanceof Error)return r==null?void 0:r.toString();e=Object.assign({},e);let{parenthesis:t}=e,n=t?"(":"",a=t?")":"";return typeof r=="string"?(e==null?void 0:e.escapeString)!==false?"'"+Bt(r)+"'":r:oe(r,"RegExp")||oe(r,"Number")||oe(r,"Boolean")?r.toString():oe(r,"Date")?"new Date("+r.getTime()+")":Array.isArray(r)?"["+r.map(i=>w(i,e)).join(",")+"]":typeof r=="object"?n+"{"+Object.keys(r).map(i=>{var o=r[i];return w(i,e)+":"+w(o,e)}).join(",")+"}"+a:r&&typeof(r==null?void 0:r.toString)=="function"?r==null?void 0:r.toString():String(r)}var qe=Symbol("TRANSLATION_KEY");var N=class N extends i18nJs.I18n{constructor(t={},n={}){super({},n);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=Z();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(ye),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(t),this.loadNamespaces();}static[Symbol.hasInstance](t){return this.isI18nInstance(t)}static isI18nInstance(t){if(!t||typeof t!="object")return false;try{if(t instanceof i18nJs.I18n)return !0}catch(n){}return typeof t.getLocale=="function"&&typeof t.translate=="function"&&typeof t.translateTarget=="function"}translate(t,n){return this.isPluralizeOptions(n)&&this.canPluralize(t)?(typeof n.count=="number"&&(n.countStr=n.count.formatNumber()),this.pluralize(n.count,t,n)):super.translate(t,n)}translateTarget(t,n){let a=N.getTargetTanslationKeys(t);for(let i in a)c(a[i])&&(a[i]=this.translate(a[i],n));return a}translateObject(t,n){if(!d(t))return {};let a={};for(let i in t){let o=t[i];c(o)&&(a[i]=M.translate(o,n));}return a}static getTargetTanslationKeys(t){return fe(t,qe)}on(t,n){return this._observableFactory.on.call(this,t,n)}finally(t,n){return this._observableFactory.finally.call(this,t,n)}off(t,n){var a;return (a=this._observableFactory)==null?void 0:a.off.call(this,t,n)}trigger(t,...n){var a;return (a=this._observableFactory)==null?void 0:a.trigger.call(this,t,...n)}offAll(){var t;return (t=this._observableFactory)==null?void 0:t.offAll.call(this)}once(t,n){var a;return (a=this._observableFactory)==null?void 0:a.once.call(this,t,n)}getEventCallBacks(){var t;return (t=this._observableFactory)==null?void 0:t.getEventCallBacks.call(this)}static getInstance(t){if(!this.isI18nInstance(N.instance)){let n=N.getLocaleFromSession();N.instance=this.createInstance({},Object.assign({},n?{locale:n}:{},t));}return N.instance}isDefaultInstance(){return this===N.instance}static setLocaleToSession(t){R.set("i18n.locale",t);}static getLocaleFromSession(){let t=R.get("i18n.locale");return c(t)?t:""}canPluralize(t,n){n=m(n,this.getLocale());let a=this.getNestedTranslation(t,n);return !d(a)||!a?false:c(a==null?void 0:a.one)&&c(a==null?void 0:a.other)}getNestedTranslation(t,n){n=m(n,this.getLocale());let a=(c(t)?t.trim().split("."):Array.isArray(t)?t:[]).filter(c);if(!a.length)return;let i=this.getTranslations(n);for(let o of a)if(d(i))i=i[o];else return;return i}isPluralizeOptions(t){return !!(d(t)&&t&&typeof t.count=="number")}static RegisterTranslations(t){return N.getInstance().registerTranslations(t)}static createInstance(t={},n={}){let s=Object.assign({},n),{interpolate:a}=s,i=ee(s,["interpolate"]),o=new N(t,i);return o.interpolate=(l,u,f)=>{let b=N.flattenObject(f),h=this.defaultInterpolator(l,u,b);return c(h)&&h!==u&&(u=h),typeof a=="function"?a(l,u,f):ie(u,f)},o}getTranslations(t){let n=d(this.translations)?this.translations:{};return c(t)?d(n[t])?n[t]:{}:n}static registerMomentLocale(t,n){return c(t)&&d(n)&&Array.isArray(n.months)&&(this.momentLocales[t]=L({},this.momentLocales[t],n)),this.momentLocales}static getMomentLocale(t){return this.momentLocales[t]}static setMomentLocale(t){try{return V__default.default.updateLocale(t,this.getMomentLocale(t)),!0}catch(n){console.error(n," setting moment locale : ",t);}return false}registerTranslations(t){return this.store(t),this.getTranslations()}store(t){super.store(t),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(t){try{let n=Object.getOwnPropertyNames(t);for(let a of n){let i=Reflect.getMetadata(qe,t,a);if(i)try{t[a]=this.translate(i);}catch(o){Y.error(o," resolving translation for key : ",i);}}}catch(n){Y.error(n," resolving translations for target : ",t);}}getMissingPlaceholderString(t,n,a){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,t,m(n),Object.assign({},a)):t}getLocale(){return super.locale}setLocales(t){return this._locales=Array.isArray(t)?t:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(t){return c(t)&&this.getLocales().includes(t)}getLocales(){let t=Object.keys(this.getTranslations()),n=Array.isArray(this._locales)?this._locales:["en"],a=[...t,...n.filter(i=>!t.includes(i))];return a.includes("en")||a.push("en"),a}isLocaleSupported(t){return c(t)?this.getLocales().includes(t):false}isLoading(){return this._isLoading}setLocale(t,n=false){return super.locale===t&&n!==true&&this._namespacesLoaded[t]?Promise.resolve(this.getLocale()):new Promise((a,i)=>(this._isLoading=true,this.trigger("namespaces-before-load",t),this.loadNamespaces(t).then(o=>{this.isDefaultInstance()&&(N.instance=this,this.isLocaleSupported(t)&&N.setLocaleToSession(t)),super.locale=t,N.setMomentLocale(t),this.trigger("locale-changed",t,o),a(t);}).catch(i).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(t,n){if(!c(t)||typeof n!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",t,n);return}this.namespaceResolvers[t]=n;}static RegisterNamespaceResolver(t,n){return N.getInstance().registerNamespaceResolver(t,n)}loadNamespace(t,n,a=true){return !c(t)||!this.namespaceResolvers[t]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${t}".`)):(n=m(n,this.getLocale()),c(n)?this.namespaceResolvers[t](n).then(i=>{let o={};return o[n]=Object.assign({},i),d(i)&&(a!==false&&this.store(o),this.trigger("namespace-loaded",t,n,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${t}".`)))}static LoadNamespace(t,n,a=true){return N.getInstance().loadNamespace(t,n,a)}loadNamespaces(t,n=true){let a=[],i={};t=m(t,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&a.push(new Promise(s=>{this.namespaceResolvers[o](t).then(l=>{L(i,l);}).finally(()=>{s(true);});}));return Promise.all(a).then(()=>{let o={};return o[t]=i,n!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",t,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(t,n=true){return N.getInstance().loadNamespaces(t,n)}static flattenObject(t){return d(t)?Object.flatten(t):t}static defaultInterpolator(t,n,a){return Te(n)?"":F(n)?(n=String(n),!d(a)||!a||!d(a)||!a?n:n.replace(/%{(.*?)}/g,(i,o)=>Te(a[o])?"":F(a[o])?String(a[o]):w(a[o],{escapeString:false}))):w(n,{escapeString:false})}};N.momentLocales={};var z=N,M=z.getInstance();try{Object.setPrototypeOf(M,z.prototype);}catch(r){}function De(...r){if(r.length===1)return Array.isArray(r[0])?r[0]:[];let e=null;for(var t in r){let n=r[t];if(Array.isArray(n)){if(n.length)return n;e||(e=n);}}return e||[]}var se=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.startsWith(e)&&t>=0;)r=r.slice(e.length),--t;return r.toString()},Ce=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.endsWith(e)&&t>=0;)r=r.slice(0,-e.length),--t;return r.toString()},Se=(r,e=true)=>typeof r!="string"?false:e!==false?/^\d*\.?\d+$/.test(r):/^\d+$/.test(r);String.prototype.ltrim=function(r){return se(this.toString(),r)};String.prototype.rtrim=function(r){return Ce(this.toString(),r)};String.prototype.isNumber=function(r=true){return Se(this.toString(),r)};String.prototype.replaceAll=function(r,e){return !c(r)||!c(e)?this.toString():this.toString().split(r).join(e)};var Ut=r=>c(r)?(r=r.trim(),r.replace(/(.)([A-Z][a-z]+)/,"$1_$2").replace(/([a-z0-9])([A-Z])/,"$1_$2").toUpperCase()):"";String.prototype.toSnakeCase=function(){return Ut(this.toString())};var Ht=r=>c(r)?(r=r.trim(),r.charAt(0)+r.replace(/(_\w)/g,e=>e[1].toUpperCase()).substring(1)):"";String.prototype.toCamelCase=function(){return Ht(this.toString())};var $t=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toUpperCase()+r.slice(1))};String.prototype.upperFirst=function(){return $t(this.toString())};var Gt=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toLowerCase()+r.slice(1))};String.prototype.lowerFirst=function(){return Gt(this.toString())};var zt=(r,e=true)=>{if(typeof r!="string")return "";let t=jt(r);return r=typeof t.search=="string"?t.search:"",e&&r?"?"+se(r,"?"):(r=Ce(se(r.trim(),"?"),"?"),r)},Xe=function(r,e={}){return typeof r!="string"?{}:Vt__default.default.parse(zt(r,false),S({allowSparse:true,decoder:t=>decodeURIComponent(t.replace(/\+/g," "))},Object.assign({},e)))};var jt=r=>{if(typeof r!="string")return {};if(typeof URL!="undefined"&&URL&&Wt(r))try{return new URL(r)}catch(n){}r=Zt(r)?decodeURIComponent(r):r;var e=r.match(/^(([^:\\/?#]+:)?(?:\/\/((?:([^\\/?#:]*):([^\\/?#:]*)@)?([^\\/?#:]*)(?::([^\\/?#:]*))?)))?([^?#]*)(\?[^#]*)?(#.*)?$/);let t=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 t.protocol&&t.protocol.length==2&&(t.protocol="file:///"+t.protocol.toUpperCase(),t.origin=t.protocol+"//"+t.host),t.protocol&&(t.href=t.origin+t.pathname+t.search+t.hash),t};function Wt(r,e={}){let{requireHost:t=true,allowedProtocols:n}=Object.assign({},e);if(!c(r)||!c(r.trim()))return false;let a=r;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(t)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 f=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,b=i.hostname.match(f);if(b&&!b.slice(1,5).map(Number).every(T=>T>=0&&T<=255))return !1}else return !1;return !0}catch(i){return false}if(t){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 f=u.indexOf("/"),b=u.indexOf("?"),h=u.indexOf("#"),O=Math.min(f>=0?f:u.length,b>=0?b:u.length,h>=0?h:u.length),T=u.slice(0,O);if(!T)return false;let P=T;if(T.startsWith("[")){let C=T.indexOf("]");if(C===-1)return false;P=T.slice(0,C+1);let A=T.slice(C+1);if(A&&!A.startsWith(":"))return false}else {let C=T.indexOf(":");C>=0&&(P=T.slice(0,C));}if(!P)return false;if(P==="localhost")return true;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(P))return !P.split(".").map(Number).some(A=>A>255||A<0);if(/^\[.*\]$/.test(P)){let C=P.slice(1,-1);return !(!C||C.includes(":::"))}return !!(/^[a-zA-Z\d-]*(\.[a-zA-Z\d-]+)*$/.test(P)&&P!=="")}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=r=>{if(!c(r)||!r.includes("%"))return false;let e=/%[0-9A-Fa-f]{2}/g;if(!r.match(e))return false;try{let n=decodeURIComponent(r);if(n!==r)return !0;try{if(decodeURIComponent(n)!==n)return !0}catch(a){return !0}}catch(n){return false}return false};var E={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 k=r=>r&&typeof r=="object"&&!Array.isArray(r)&&r.name&&typeof r.name=="string"&&r.symbol&&typeof r.symbol=="string";var _e="%v %s",Ne=r=>{let e=R.get("currencyFormat");return e&&typeof e=="string"&&e.includes("%v")?e:r!==false?_e:""};function et(r){return r=r&&typeof r=="string"?r.trim():"",R.set("currencyFormat",r)}var Qt=r=>{if(!k(r)){let t=typeof r=="object"&&r&&!Array.isArray(r)?m(r.code,r.name):typeof r=="string"?r:void 0;t&&(t=t.trim().toUpperCase()),t&&k(E[t])?r=E[t]:typeof r=="string"&&(t=r.trim().toUpperCase(),k(E[t])&&(r=E[t]));}let e=Object.assign({},r);if(!e.format){let t=Ne();t&&(e.format=t);}return e.format&&et(e.format),R.set("appConfigCurrency",e),e},Jt=()=>{var a,i,o,s;let r=Object.assign({},R.get("appConfigCurrency")),e=R.get("currencyCode");if(c(e)&&k(E[e.trim().toUpperCase()])&&(r=S(S({},E[e.trim().toUpperCase()]),r)),!c(r==null?void 0:r.format)){let l=Ne(false);c(l)&&l.includes("%v")&&(r.format=l);}let n=E["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({},M.getNestedTranslation("currencies"))),r)},$={getFormat:Ne,setFormat:et,setCurrency:Qt,getCurrency:Jt,defaultCurrencyFormat:_e};var qt=r=>r&&typeof r=="object";function Me(r){let e=Object.assign({},$.getCurrency());if(r&&qt(r))for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&r[t]!==void 0&&(e[t]=r[t]);if(c(e.format)){let t=nt(e.format);t.format&&(e.format=t.format),typeof t.decimalDigits=="number"&&(e.decimalDigits=t.decimalDigits);}return e}function Ae(r,e){return r=typeof r=="number"?r:0,e=typeof e=="number"?e:0,r=Math.round(Math.abs(r)),isNaN(r)?e:r}function Xt(r){let e=$.getCurrency(),t=(e==null?void 0:e.format).toLowerCase();return typeof r=="string"&&(r=r.toLowerCase()),(typeof r!="string"||!r.match("%v"))&&(r=t),{pos:r,neg:r.replace("-","").replace("%v","-%v"),zero:r}}var le=(r,e)=>{let t=$.getCurrency();if(r=r||0,typeof r=="number")return r;e=e||t.decimalSeparator;let n=new RegExp("[^0-9-"+e+"]","g"),a=parseFloat((""+r).replace(/\((?=\d+)(.*)\)/,"-$1").replace(n,"").replace(e,"."));return isNaN(a)?0:a},Re=(r,e)=>{let t=$.getCurrency();e=Ae(e,t.decimalDigits);let a=String(r).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"}},tt=(r,e,t,n)=>{var b;r=le(r);let a=k(e)?e:$.getCurrency();typeof e=="number"&&(a.decimalDigits=e),typeof a.decimalDigits!="number"&&(a.decimalDigits=(b=String(r).split(".")[1])==null?void 0:b.length),t!==void 0&&(a.thousandSeparator=t),n!==void 0&&(a.decimalSeparator=n);let i=Me(a),o=Ae(i.decimalDigits),s=r<0?"-":"",l=parseInt(Re(Math.abs(r||0),o),10)+"",u=l.length>3?l.length%3:0,f="";if(o){let h=String(parseFloat(Re(Math.abs(r),o))||0);h.includes(".")&&(f=m(h.split(".")[1]).trim());}return s+(u?l.substring(0,u)+i.thousandSeparator:"")+l.substring(u).replace(/(\d{3})(?=\d)/g,"$1"+i.thousandSeparator)+(o&&f?i.decimalSeparator+f:"")},rt=(r,e,t,n,a,i)=>{r=le(r);let o=k(e)?e:$.getCurrency();e!==void 0&&typeof e=="string"&&(o.symbol=e),t!==void 0&&(o.decimalDigits=t),n!==void 0&&(o.thousandSeparator=n),a!==void 0&&(o.decimalSeparator=a),c(i)&&(o.format=i);let s=Me(o),l=Xt(s.format),u=m(r>0?l.pos:r<0?l.neg:l.zero),f=m(s.symbol),b=u.replace(f&&"%s",f),h=tt(Math.abs(r),Ae(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),O=b.replace("%v",h);return K(S({},s),{formattedValue:b,formattedNumber:h,symbol:s.symbol,usedFormat:u,result:O})},_t=(r,e,t,n,a,i)=>rt(r,e,t,n,a,i).result,nt=r=>{r=m(r).trim();let e={};if(r){let t=/(\.)(\#{0,9}\s*$)/,n=r.match(t);Array.isArray(n)&&n.length===3&&(e.decimalDigits=m(n[2]).trim().length),r=r.replace(t,"");}return e.format=r,e},W={parse:le,session:$,formatMoney:_t,currencies:E,isCurrency:k,formatNumber:tt,formatMoneyAsObject:rt,unformat:le,toFixed:Re,prepareOptions:Me,parseFormat:nt};var{currencies:at}=W;Number.prototype.countDecimals=function(){let r=String(this.toString()).match(/\.(\d+)/);return r?r[1].length:0};Number.prototype.formatNumber=function(r,e,t){return W.formatNumber(this.valueOf(),r,e,t)};Number.prototype.formatMoney=function(r,e,t,n,a){return W.formatMoney(this.valueOf(),r,e,t,n,a)};var er=(r,e,t,n)=>{var C;if(r===null||typeof r!="number"||isNaN(r))return {result:"",format:"",suffix:"",formattedValue:"",minAbreviationDecimalDigits:0,value:NaN};if(!isFinite(r)){let A=r>0?"\u221E":"-\u221E";return {result:A,value:r,format:"",suffix:"",formattedValue:A,minAbreviationDecimalDigits:0}}let a=Math.abs(r)<1e3,i=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"},{value:1e3,suffix:"K"},{value:1,suffix:""}],o=r.countDecimals?r.countDecimals():Math.floor(r)===r?0:((C=r.toString().split(".")[1])==null?void 0:C.length)||0,s=i.find(A=>Math.abs(r)>=A.value)||i[i.length-1],l=a?r:r/(s.value===1?1:s.value),u=s.suffix,f=tr(l,5);if(r===0)return {result:"0",value:0,format:"",suffix:"",formattedValue:"0",minAbreviationDecimalDigits:0};let h=D(e)&&e>0?e:s.value===1?Math.min(o,5):Math.max(f,0),O=l.toFixed(h);t=m(t),n=m(n,".");let T=O.toString().split(".");return T[0]=T[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),h>0&&T.length===1?T.push("0".repeat(h)):h>0&&T.length>1&&T[1].length<h&&(T[1]=T[1].padEnd(h,"0")),O=T.join(n),{result:O+u,value:r,format:u,suffix:u,formattedValue:O,minAbreviationDecimalDigits:f}};function tr(r,e){let t=Math.abs(r);if(Number.isInteger(t))return 0;let n=t.toString().split(".")[1]||"",a=0;for(;a<n.length&&n[a]==="0";)a++;return t<1&&a>0?Math.min(a+e,n.length):Math.min(e,n.length)}var it=(r,e,t,n)=>er(r,e,t,n).result;Number.prototype.abreviate2FormatNumber=function(r,e,t){return it(this.valueOf(),r,e,t)};var ot=(r,e,t,n,a,i)=>{if(!D(r))return "";let l=W.formatMoneyAsObject(r,e,t,n,a,i),{formattedValue:o}=l,s=ee(l,["formattedValue"]);return o.replace("%v",it(r,s.decimalDigits,s.thousandSeparator,s.decimalSeparator))};Number.prototype.abreviate2FormatMoney=function(r,e,t,n,a){return ot(this.valueOf(),r,e,t,n,a)};Object.keys(at).forEach(r=>{let e=r,t=at[e],n=`format${e}`,a=`abreviate2Format${e}`;Number.prototype[n]=function(i,o,s,l){return W.formatMoney(this.valueOf(),t,i,o,s,l)},Number.prototype[a]=function(i,o,s,l){return ot(this.valueOf(),t,i,o,s,l)};});var nr=Pe__default.default.AES.encrypt,ar=Pe__default.default.AES.decrypt,st="auth-decrypted-key",lt="user-session",ct={get:r=>y(null,null,function*(){return R.get(r)}),set:(r,e)=>y(null,null,function*(){yield R.set(r,e);}),remove:r=>y(null,null,function*(){yield R.remove(r);})},ve=class r{static get(e,t){if(c(t))return r.getData(e)[t]}static set(e,t,n){let a=r.getData(e);return c(t)?a[t]=n:d(t)&&(a=t),R.set(r.getKey(e),a),a}static getKey(e){let t=q.getSignedUser();return `auth-${w((t==null?void 0:t.id)||(t==null?void 0:t.email))}-${e||""}`}static getData(e){if(!c(e))return {};let t=r.getKey(e);return Object.assign({},R.get(t))}static getStorage(e){return {sessionName:e,get:t=>r.get(e,t),set:(t,n)=>r.set(e,t,n),getData:()=>r.getData(e),getKey:()=>r.getKey(e)}}},p=class p{static _isMasterAdmin(e){return e=d(e)?e:p.getSignedUser(),typeof p.isMasterAdmin=="function"?p.isMasterAdmin(e):false}static getSignedUser(){if(d(p.localUserRef.current))return p.localUserRef.current;let e=R.get(lt);if(e)try{let t=ar(e,st);if(t&&typeof(t==null?void 0:t.toString)=="function"){let n=t.toString(Pe__default.default.enc.Utf8);return p.localUserRef.current=U.parse(n),p.localUserRef.current}}catch(t){Y.log("getting local user ",t);}return null}static setSignedUser(e,t){return y(this,null,function*(){p.localUserRef.current=e;let n=e,a=null;try{d(n)&&(n.sessionCreatedAt=new Date().getTime()),a=n?nr(JSON.stringify(n),st).toString():null;}catch(i){p.localUserRef.current=null,Y.log(i," setting local user");}if(yield R.set(lt,a),t){let i=d(n)&&a&&a!==null?"SIGN_IN":"SIGN_OUT";p.events.trigger(i,n);}return e})}static signIn(e,t=true){return y(this,null,function*(){if(!d(e))throw new Error(M.t("auth.invalidSignInUser"));return yield p.setSignedUser(e,t)})}static signOut(e=true){return y(this,null,function*(){return yield p.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,t){if(t=Object.assign({},t||p.getSignedUser()),typeof e=="boolean")return e;if(p._isMasterAdmin(t)||!e)return true;if(typeof e=="function")return !!e(t);if(p.isResourceActionTupleObject(e)){if(p.checkUserPermission(t,e.resourceName,e.action))return true}else if(p.isResourceActionTupleArray(e)){if(p.checkUserPermission(t,e[0],e[1]))return true}else if(Array.isArray(e))for(let n in e){let a=e[n];if(p.isResourceActionTupleArray(a)){if(p.checkUserPermission(t,a[0],a[1]))return true}else if(p.isResourceActionTupleObject(a)&&p.checkUserPermission(t,a.resourceName,a.action))return true}return false}static checkUserPermission(e,t,n="read"){if(!d(e)||!e)return false;if(d(e.perms)&&e.perms&&p.checkPermission(e.perms,t,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)&&p.checkPermission(i.perms,t,n))return true}return false}return false}static checkPermission(e,t,n="read"){if(e=Object.assign({},e),t=c(t)?t:"",!d(e)||!t)return false;let a=String(t).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(p.isAllowedForAction(i[o],n))return true;return false}static isAllowedForAction(e,t){return !c(t)||!c(e)?false:String(t).trim().toLowerCase()===String(e).trim().toLowerCase()}static get Session(){return ve}static get secureStorage(){let e=Reflect.getMetadata(p.authStorageMetaData,p);return ut(e)&&(this._secureStorage=e),this._secureStorage?this._secureStorage:ct}static set secureStorage(e){ut(e)&&Reflect.defineMetadata(p.authStorageMetaData,e,p);}static getToken(){return y(this,null,function*(){return yield this.secureStorage.get("auth-token")})}static setToken(e){return y(this,null,function*(){yield this.secureStorage.set("auth-token",e);})}};p.events=Ie({}),p.localUserRef={current:null},p._secureStorage=ct,p.authStorageMetaData=Symbol("auth:storage:meta");var q=p;var ut=r=>{if(!r)return false;try{return ["get","set","remove"].every(e=>typeof r[e]=="function")}catch(e){return false}};var ce=Symbol("fieldsResourcesMetadata");function Vi(r){return function(e,t){var i;let n=Object.assign({},Reflect.getMetadata(ce,e)||{}),a=String((i=Reflect.getMetadata("design:type",e,t))==null?void 0:i.name).toLowerCase();r.type===void 0&&(r.type=["string","number","boolean","date"].includes(a)?a:"text"),n[t]=S({name:t},Object.assign({},r)),Reflect.defineMetadata(ce,n,e);}}function zi(r){let e=Reflect.getMetadata(ce,r.prototype);return Object.assign({},e)}function dt(r){let e=Reflect.getMetadata(ce,Object.getPrototypeOf(r).constructor);return Object.assign({},e)}var ue=class r{static normalizePagination(e){let{page:t,skip:n,limit:a}=Object.assign({},e);return D(a)?(D(n)&&n>0?t=Math.floor(n/a)+1:D(t)&&t>0?n=(t-1)*a:(t=1,n=0),{page:t,skip:n,limit:a}):{}}static normalizeOrderBy(e){let t=Array.isArray(e)?e:c(e)?[e]:[],n={};return t.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)?D(e.limit):false}static getPaginationMetaData(e,t){let{limit:n,page:a,skip:i}=r.normalizePagination(t);e=D(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,t,n){let a=r.getPaginationMetaData(t,n),{currentPage:i,pageSize:o,totalPages:s}=a;if(Array.isArray(e)&&D(i)&&D(o)&&D(s)){let l=Math.max(0,i-1)*o,u=l+o;e=e.slice(l,u);}return {data:e,total:t,meta:a}}static parseQueryOptions(e){var A;let t=L({},e==null?void 0:e.params,Xe(e==null?void 0:e.url)),n=L({},t,(A=e==null?void 0:e.headers)==null?void 0:A["x-filters"],e==null?void 0:e.filters),a=Oe(n.limit),i=Oe(n.skip),o=Oe(n.page),s=r.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,f=r.normalizeOrderBy(u);f&&Object.getSize(f,true)>0&&(s.orderBy=f);let b=De(n.include);b.length&&(s.include=b);let h=n.cache;h!==void 0&&(s.cache=!!h);let O=n.cacheTTL;O!==void 0&&(s.cacheTTL=O);let T=ir(n.where);d(T)&&Object.getSize(T,true)&&(s.where=T);let P=n.includeDeleted;typeof P=="boolean"&&(s.includeDeleted=P);let C=De(n.relations);return C.length&&(s.relations=C),K(S({},s),{queryParams:t})}},ir=(...r)=>{for(let e of r)if(Array.isArray(e)&&e.length||c(e)||d(e)&&Object.getSize(e,true))return e},Oe=r=>{if(Se(r))return Number(r);if(typeof r=="number")return r};var mt=["$and","$or","$nor","$not"],ft=["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin","$exists","$type","$regex","$size","$mod","$all","$elemMatch"],ro={LOGICAL:mt,COMPARAISON:ft,ALL:[...mt,...ft],ARRAY:["$all","$elemMatch","$in","$nin"]};var yt=Symbol("resources"),or=Symbol("resourceFromClassName"),de=class de{constructor(){this._onDictionaryChangedListener=M.on("translations-changed",this.onI18nChange.bind(this)),this._onLocaleChangeListener=M.on("locale-changed",this.onI18nChange.bind(this)),this.init();}getMetaData(){return Object.assign({},Reflect.getMetadata(G.resourceMetaData,this.constructor))}onI18nChange(){this.resolveTranslations();}resolveTranslations(){return M.resolveTranslations(this)}destroy(){var e,t;(e=this._onDictionaryChangedListener)==null||e.remove(),(t=this._onLocaleChangeListener)==null||t.remove();}getResourceContext(e){return K(S({},Object.assign({},e)),{resourceLabel:this.getLabel(),resourceName:this.getName()})}get INVALID_DATA_PROVIDER_ERROR(){return M.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,...t){de.events.trigger(e,this.getResourceContext(),...t);}authorizeAction(e){return y(this,null,function*(){if(!this.hasDataService())throw new Error(this.INVALID_DATA_PROVIDER_ERROR);let t;switch(e){case "read":t=this.canUserRead();break;case "create":t=this.canUserCreate();break;case "update":t=this.canUserUpdate();break;case "delete":t=this.canUserDelete();break;default:t=this.isAllowed(e);break}if(!t)throw new Error(M.t(this.buildTranslationPath("forbiddenError"),this.getResourceContext({action:e})))})}find(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>{var t;return (t=this.getDataService())==null?void 0:t.find(e).then(n=>(this.trigger("find",n),n))})})}findOne(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findOne(e).then(t=>(this.trigger("findOne",t),t)))})}buildTranslationPath(e){let t=this.getName(),n=`resources${c(t)?`.${t}`:""}.`;return c(e)?`${n}${e.trim().ltrim(".")}`:n}findOneOrFail(e){return y(this,null,function*(){let t=yield this.findOne(e);if(!d(t)||!t)throw new Error(M.t(this.buildTranslationPath("notFoundError"),Object.assign({},{options:JSON.stringify(e)},this.getResourceContext())));return t})}beforeCreate(e){return y(this,null,function*(){})}afterCreate(e){return y(this,null,function*(){})}beforeUpdate(e,t){return y(this,null,function*(){})}afterUpdate(e,t,n){return y(this,null,function*(){})}beforeDelete(e){return y(this,null,function*(){})}afterDelete(e,t){return y(this,null,function*(){})}beforeCreateMany(e){return y(this,null,function*(){})}afterCreateMany(e,t){return y(this,null,function*(){})}beforeUpdateMany(e,t){return y(this,null,function*(){})}afterUpdateMany(e,t,n){return y(this,null,function*(){})}beforeDeleteMany(e){return y(this,null,function*(){})}afterDeleteMany(e,t){return y(this,null,function*(){})}create(e){return y(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreate(e).then(()=>this.getDataService().create(e).then(t=>this.afterCreate(t).then(()=>(this.trigger("create",t),t)))))})}update(e,t){return y(this,null,function*(){return this.authorizeAction("update").then(()=>y(this,null,function*(){return this.beforeUpdate(e,t).then(()=>{var n;return (n=this.getDataService())==null?void 0:n.update(e,t).then(a=>this.afterUpdate(a,e,t).then(()=>(this.trigger("update",a,e,t),a)))})}))})}delete(e){return y(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDelete(e).then(()=>{var t;return (t=this.getDataService())==null?void 0:t.delete(e).then(n=>this.afterDelete(n,e).then(()=>(this.trigger("delete",n,e),n)))}))})}findAndCount(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().findAndCount(e).then(t=>(this.trigger("findAndCount",t),t)))})}findAndPaginate(e){return y(this,null,function*(){e=Object.assign({},e);let[t,n]=yield this.findAndCount(e);return ue.paginate(t,n,e)})}createMany(e){return y(this,null,function*(){return this.authorizeAction("create").then(()=>this.beforeCreateMany(e).then(()=>this.getDataService().createMany(e).then(t=>this.afterCreateMany(t,e).then(()=>(this.trigger("createMany",t,e),t)))))})}updateMany(e,t){return y(this,null,function*(){return this.authorizeAction("update").then(()=>this.beforeUpdateMany(e,t).then(()=>this.getDataService().updateMany(e,t).then(n=>this.afterUpdateMany(n,e,t).then(()=>(this.trigger("updateMany",n,e,t),n)))))})}deleteMany(e){return y(this,null,function*(){return this.authorizeAction("delete").then(()=>this.beforeDeleteMany(e).then(()=>this.getDataService().deleteMany(e).then(t=>this.afterDeleteMany(t,e).then(()=>(this.trigger("deleteMany",t,e),t)))))})}count(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().count(e).then(t=>(this.trigger("read",t),t)))})}exists(e){return y(this,null,function*(){return this.authorizeAction("read").then(()=>this.getDataService().exists(e).then(t=>(this.trigger("exits",t),t)))})}updateMetadata(e){e=Object.assign({},e);let t=L({},this.getMetaData(),e);return Reflect.defineMetadata(G.resourceMetaData,t,this.constructor),t}init(){this.resolveTranslations(),this.getFields();}getTranslations(e){e=m(e,M.getLocale());let t=String(this.getName()).trim();if(!c(t))return {};let n=M.getNestedTranslation(["resources",t],e);return d(n)&&n?n:{}}translate(e,t){let n=c(e)?e.trim().split("."):Array.isArray(e)?e:[];return n[0]!=="resources"&&!G.hasResource(n[1])&&n.unshift(this.getName(),"resources"),M.translate(n,t)}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 t=this.getActions();return d(t[e])&&t[e]!==void 0}isAllowed(e,t){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,t)}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,t,n){e=m(e).trim(),n=Object.assign({},{resourceName:this.getName()},n);let a=this.getTranslations();if(c(e)&&a[e]){let i=w(M.t(e,n));if(c(i)&&i.includes("."+e.ltrim(".")))return i}return m(t,e)}getLabel(){let e=this.getMetaData().label,t=this.translateProperty("label",m(e,this.label,this.getName()));return String(t).toLowerCase().trim()!="label"?t:m(this.getName())}getTitle(){return this.translateProperty("title",m(this.getMetaData().title,this.title,this.getLabel()))}getFields(){try{return this.resolveTranslations(),this.fields=dt(this),this.fields}catch(e){Y.log(e," getting resources fieldss");}return {}}interpolate(e,t,n){return ie(e,this.getResourceContext(t),S({tagRegex:/\{([^}]+)\}/g},n))}getActionLabel(e,t){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.label,t)}getActionTitle(e,t){var n;return this.interpolate((n=this.getAction(e))==null?void 0:n.title,t)}getAction(e){if(!c(e))return {};let t=this.getActions();return d(t[e])&&t[e]||{}}getPrimaryKeys(){let e=[];if(d(this.fields))for(let t in this.fields)d(this.fields[t])&&this.fields[t].primaryKey&&e.push(this.fields[t]);return e}};de.events=Z();var xe=de,B=class B{static getAllMetaData(){return Object.assign({},Reflect.getMetadata(yt,B))}static addMetaData(e,t){let n=this.getAllMetaData();!c(e)||!e||(t=Object.assign({},t),t.name=c(t==null?void 0:t.name)?t.name:e,n[e]=t,Reflect.defineMetadata(yt,n,B));}static getAllClassNames(){return Object.assign({},Reflect.getMetadata(or,B))}static getNameFromClassName(e){return c(e)?this.getAllClassNames()[e]:void 0}static getMetaDataFromName(e){let t=this.getAllMetaData();if(!(!c(e)||!e))return t[e]}static getMetaDataFromTarget(e){return Object.assign({},Reflect.getMetadata(B.resourceMetaData,e.prototype))}static getMetaDataByClassName(e){let t=this.getNameFromClassName(e);if(t)return this.getMetaDataFromName(t)}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 t=B.getMetaDataFromName(e);return d(t)&&(t==null?void 0:t.name)==e?true:!!this.getResource(e)}static addResource(e,t){typeof e=="string"&&e&&t&&t instanceof xe&&(this.resources[e]=t);}static removeResource(e){return typeof e=="string"&&delete this.resources[e],this.resources}static getResources(){return this.resources}};B.resourceMetaData=Symbol("resource"),B.resources={};var G=B;function go(r){return function(e){if(r=Object.assign({},r),typeof e=="function"&&r!=null&&r.instanciate)try{let t=new e;t.updateMetadata(r),G.addResource(r.name,t);}catch(t){}Reflect.defineMetadata(G.resourceMetaData,r,e),G.addMetaData(r.name,r);}}
|
|
6
6
|
exports.FieldMeta=Vi;exports.MONGO_OPERATORS=ro;exports.Resource=xe;exports.ResourceMeta=go;exports.ResourcePaginationHelper=ue;exports.ResourcesManager=G;exports.buildPropertyDecorator=Ct;exports.fieldsMetaData=ce;exports.getDecoratedProperties=fe;exports.getDecoratedProperty=fr;exports.getFields=dt;exports.getFieldsFromTarget=zi;
|
|
@@ -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}",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var T={auth:i,currencies:a,countries:e,dates:d,resources:o,validator:r};exports.en=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",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var T={auth:i,currencies:a,countries:e,dates:d,resources:o,validator:r};exports.en=T;
|