@tonysamperi/ts-mapi-core 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/changelog.md +4 -1
  2. package/dist/cjs/index.cjs +1 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/index.d.cts +12 -8
  5. package/dist/cjs/services/http/index.cjs +1 -1
  6. package/dist/cjs/services/http/index.cjs.map +1 -1
  7. package/dist/cjs/services/http/index.d.cts +3 -4
  8. package/dist/cjs/services/http/smp-http.service.cjs +1 -1
  9. package/dist/cjs/services/http/smp-http.service.cjs.map +1 -1
  10. package/dist/cjs/services/http/smp-http.service.d.cts +6 -3
  11. package/dist/cjs/services/index.cjs +1 -1
  12. package/dist/cjs/services/index.cjs.map +1 -1
  13. package/dist/cjs/services/index.d.cts +3 -4
  14. package/dist/cjs/shared/api/index.cjs +1 -1
  15. package/dist/cjs/shared/api/index.cjs.map +1 -1
  16. package/dist/cjs/shared/api/smp-api-common-utils.class.cjs +1 -1
  17. package/dist/cjs/shared/api/smp-api-common-utils.class.cjs.map +1 -1
  18. package/dist/cjs/shared/giftcard/index.cjs.map +1 -1
  19. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs.map +1 -1
  20. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.d.cts +1 -1
  21. package/dist/cjs/shared/marketing-cloud/index.d.cts +1 -1
  22. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.cjs.map +1 -1
  23. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.d.cts +4 -4
  24. package/dist/cjs/shared/rxjs/index.cjs +1 -1
  25. package/dist/cjs/shared/rxjs/index.cjs.map +1 -1
  26. package/dist/cjs/shared/rxjs/index.d.cts +1 -0
  27. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs +1 -1
  28. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs.map +1 -1
  29. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.d.cts +3 -3
  30. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.cjs.map +1 -1
  31. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.d.cts +3 -3
  32. package/dist/cjs/shared/utils/cache/index.cjs +1 -1
  33. package/dist/cjs/shared/utils/cache/index.cjs.map +1 -1
  34. package/dist/cjs/shared/utils/cache/index.d.cts +2 -3
  35. package/dist/cjs/shared/utils/index.cjs +1 -1
  36. package/dist/cjs/shared/utils/index.cjs.map +1 -1
  37. package/dist/cjs/shared/utils/index.d.cts +2 -3
  38. package/dist/esm/chunk-C3LKT6AF.js +1 -0
  39. package/dist/esm/chunk-ENM3HAPF.js +1 -0
  40. package/dist/esm/{chunk-7MD4IY4X.js → chunk-GXH2KPSQ.js} +1 -1
  41. package/dist/esm/{chunk-VP72PKJQ.js → chunk-IPMN727M.js} +1 -1
  42. package/dist/esm/chunk-NVYQBLR6.js +1 -0
  43. package/dist/esm/index.d.ts +5 -5
  44. package/dist/esm/index.js +1 -1
  45. package/dist/esm/services/firebase/index.js +1 -1
  46. package/dist/esm/services/firebase/smp-firebase.service.js +1 -1
  47. package/dist/esm/services/http/index.d.ts +3 -4
  48. package/dist/esm/services/http/index.js +1 -1
  49. package/dist/esm/services/http/smp-http.service.d.ts +6 -3
  50. package/dist/esm/services/http/smp-http.service.js +1 -1
  51. package/dist/esm/services/index.d.ts +3 -4
  52. package/dist/esm/services/index.js +1 -1
  53. package/dist/esm/shared/api/index.js +1 -1
  54. package/dist/esm/shared/api/smp-api-common-utils.class.js +1 -1
  55. package/dist/esm/shared/common/index.js +1 -1
  56. package/dist/esm/shared/crypto/index.js +1 -1
  57. package/dist/esm/shared/crypto/smp-secure-code.class.js +1 -1
  58. package/dist/esm/shared/giftcard/smp-giftcard-transaction.class.d.ts +1 -1
  59. package/dist/esm/shared/marketing-cloud/index.d.ts +1 -1
  60. package/dist/esm/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.d.ts +4 -4
  61. package/dist/esm/shared/rxjs/index.d.ts +1 -0
  62. package/dist/esm/shared/rxjs/index.js +1 -1
  63. package/dist/esm/shared/rxjs/smp-rxjs-in-memory-cache.class.d.ts +3 -3
  64. package/dist/esm/shared/rxjs/smp-rxjs-in-memory-cache.class.js +1 -1
  65. package/dist/esm/shared/rxjs/smp-rxjs-throw-on-condition.function.d.ts +3 -3
  66. package/dist/esm/shared/utils/cache/index.d.ts +2 -3
  67. package/dist/esm/shared/utils/cache/index.js +1 -1
  68. package/dist/esm/shared/utils/index.d.ts +2 -3
  69. package/dist/esm/shared/utils/index.js +1 -1
  70. package/package.json +3 -1
  71. package/dist/cjs/shared/utils/cache/smp-cache-strategy.interface.cjs +0 -2
  72. package/dist/cjs/shared/utils/cache/smp-cache-strategy.interface.cjs.map +0 -1
  73. package/dist/cjs/shared/utils/cache/smp-cache-strategy.interface.d.cts +0 -12
  74. package/dist/esm/chunk-3XWLMKWI.js +0 -1
  75. package/dist/esm/chunk-FE4YONC4.js +0 -0
  76. package/dist/esm/chunk-MD2DPFLF.js +0 -1
  77. package/dist/esm/shared/utils/cache/smp-cache-strategy.interface.d.ts +0 -12
  78. package/dist/esm/shared/utils/cache/smp-cache-strategy.interface.js +0 -1
  79. /package/dist/esm/{chunk-6MJDU4CZ.js → chunk-DGUMFWCQ.js} +0 -0
  80. /package/dist/esm/{chunk-B3OEBKFG.js → chunk-JJLFJN7K.js} +0 -0
package/changelog.md CHANGED
@@ -1,5 +1,8 @@
1
+ ## 1.6.1
2
+ * Fixed missing exports in cjs build
3
+
1
4
  ## 1.6.0
2
- * Make arg optional in KikErrorResponse.create, to create a generic error by simply calling KikErrorResponse.create()
5
+ * Make arg optional in SmpErrorResponse.create, to create a generic error by simply calling SmpErrorResponse.create()
3
6
  * Add rxjs implementations of cache
4
7
 
5
8
  ## 1.5.0
@@ -1,2 +1,2 @@
1
- "use strict";var cs=Object.create;var xe=Object.defineProperty;var hs=Object.getOwnPropertyDescriptor;var ls=Object.getOwnPropertyNames;var ds=Object.getPrototypeOf,fs=Object.prototype.hasOwnProperty;var c=(i,e)=>xe(i,"name",{value:e,configurable:!0});var x=(i,e)=>()=>(i&&(e=i(i=0)),e);var Ee=(i,e)=>{for(var t in e)xe(i,t,{get:e[t],enumerable:!0})},Kt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ls(e))!fs.call(i,s)&&s!==t&&xe(i,s,{get:()=>e[s],enumerable:!(r=hs(e,s))||r.enumerable});return i};var ps=(i,e,t)=>(t=i!=null?cs(ds(i)):{},Kt(e||!i||!i.__esModule?xe(t,"default",{value:i,enumerable:!0}):t,i)),J=i=>Kt(xe({},"__esModule",{value:!0}),i);var Y,at=x(()=>{"use strict";Y=class{static{c(this,"SmpAbstractCacheStrategy")}}});function Re(i){return typeof i=="object"&&i!==null&&"value"in i&&"expiry"in i&&typeof i.expiry=="number"}var ct=x(()=>{"use strict";c(Re,"smpIsSmpCachedValue")});var qt,Xt=x(()=>{"use strict";qt=class{static{c(this,"SmpSessionManagerService")}get sessionId(){return this._sessionId||this._storage.getItem(this._sessionIdKey)||void 0}constructor(e="lggr_sid"){this._sessionIdKey=e,this._storage=this._getStorage(),this._sessionId=this.sessionId||this._generateSessionId()}_generateSessionId(){let e=this._generateUUID();return this._storage.setItem(this._sessionIdKey,e),e}_generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}_getStorage(){try{if(typeof window<"u"&&typeof window.sessionStorage==typeof isNaN)return sessionStorage}catch(e){console.warn(`${this.constructor.name}: error while checking sessionStorage`,e)}return{getItem:c(()=>null,"getItem"),setItem:c(()=>null,"setItem"),removeItem:c(()=>null,"removeItem"),clear:c(()=>null,"clear")}}}});var k,pt=x(()=>{"use strict";(function(i){i[i.OFF=0]="OFF",i[i.ERROR=1]="ERROR",i[i.WARN=2]="WARN",i[i.INFO=3]="INFO",i[i.LOG=4]="LOG",i[i.DEBUG=5]="DEBUG"})(k||(k={}))});function O(){}var Ue=x(()=>{"use strict";c(O,"smpNoop")});var gs,V,ut=x(()=>{"use strict";Ue();gs=class{static{c(this,"SmpConsoleOnlyMethods")}constructor(){this.group=O,this.groupCollapsed=O,this.groupEnd=O,this.time=O,this.timeEnd=O}},V=class Zt extends gs{static{c(this,"SmpLoggerMethods")}constructor(){super(...arguments),this.debug=O,this.error=O,this.info=O,this.log=O,this.warn=O}static describe(){return Object.getOwnPropertyNames(new Zt).map(e=>e)}}});var Ht,ke,Me,Jt=x(()=>{"use strict";Xt();pt();ut();Ue();ke="[DEFAULT]",Me=class extends V{static{c(this,"SmpLoggerService")}static get INSTANCE(){return this.get(ke)}static get INSTANCES(){return this._instances.keys()}static get NOOP_INSTANCE(){return this._noopInstance}get activeLevels(){return Object.values(k).filter(e=>+e>k.OFF&&+e<=this.level).map(e=>k[e])}get appName(){return this._appName}get currentConfig(){return{level:this.level,enableSessionId:this.enableSessionId,enablePreprocessing:this.enablePreprocessing,sensitiveProps:this._sensitiveProps}}get enablePreprocessing(){return this.preprocessArgs!==this._noopPreprocessArgs}get enableSessionId(){return!!this.sessionId}get level(){return this.constructor._level}get sessionId(){return this._sessionId}constructor(e){super(),this._sensitivePropMask="*****",this._sessionManager=new qt,this._loadConfig(e)}static destroy(e){return this._instances.delete(e)}static get(e=ke){return this._instances.get(e)||this._instances.get(ke)||this._noopInstance}static init(e,t=ke){let r;if(this._instances.has(t)){r=this.get(t);let s=r.currentConfig;r._loadConfig(Object.assign(Object.assign({},s),e))}else this._instances.set(t,new this(e)),r=this.get(t),r._appName=t;return r}static pop(e){let t=this.get(e);return this.destroy(e),t}destroy(){return this.constructor.destroy(this.appName)}filterSensitiveData(e){if(e===null||typeof e!="object"||Array.isArray(e)||e.constructor!==Object)return e;let t={};for(let r in e){let s=e[r];if(!Object.prototype.hasOwnProperty.call(e,r)||s===null||s===void 0){t[r]=s;continue}if(this._sensitiveProps.includes(r)){t[r]=this._sensitivePropMask;continue}t[r]=this.filterSensitiveData(s)}return t}preprocessArgs(e,...t){return this._defaultPreprocessArgs.apply(this,[e,...t])}_defaultPreprocessArgs(e,...t){let r=new Date;return[`${r.toISOString()}`,`${t.shift()}`.trim(),...t.map(s=>({tags:[this._appName,`level-${k[this.level]}`,e],timestamp:+r,sessionId:this.sessionId,metadata:this.filterSensitiveData(s)}))]}_loadConfig({sensitiveProps:e=[],level:t=k.OFF,enablePreprocessing:r=!1,enableSessionId:s=!1}){this._sensitiveProps=[...e,"pwd","password","buffer","token","accessToken","refreshToken"],this.preprocessArgs=r?this.preprocessArgs:this._noopPreprocessArgs,this._sessionId=s?this._sessionManager.sessionId:void 0,this._updateLevel(t)}_noopPreprocessArgs(...e){return e}_setup(e){let t=this.preprocessArgs.bind(this);this.activeLevels.forEach(r=>{let s=`${r}`.toLowerCase();typeof e[s]==typeof isNaN&&(this[s]=function(...o){e[s].apply(e,t.apply(null,[s,...o]))})}),this.level>k.OFF&&console&&(console.group&&console.groupEnd&&(this.group=console.group.bind(console),this.groupEnd=console.groupEnd.bind(console)),console.groupCollapsed&&(this.groupCollapsed=console.groupCollapsed.bind(console)),console.time&&console.timeEnd&&(this.time=console.time.bind(console),this.timeEnd=console.timeEnd.bind(console)))}_updateLevel(e=k.WARN){this.constructor.describe().forEach(t=>{this[t]=O}),this.constructor._level=e,console&&this._setup(console)}};Ht=Me;Me._instances=new Map;Me._level=k.OFF;Me._noopInstance=new Ht({level:k.OFF})});var Yt=x(()=>{"use strict"});var Qt=x(()=>{"use strict"});var er=x(()=>{"use strict";Yt();Qt();ut();pt();Ue()});var Ce=x(()=>{"use strict";Jt();er()});var q,tr=x(()=>{"use strict";q=function(i){return i.APPLE="APPLE",i.FACEBOOK="FACEBOOK",i.GOOGLE="GOOGLE",i}({})});var he,rr=x(()=>{"use strict";he=function(i){return i.POPUP="POPUP",i.REDIRECT="REDIRECT",i}({})});var Pe,yr=x(()=>{"use strict";Pe=function(i){return i.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",i.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",i.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",i.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",i.EMAIL_EXISTS="auth/email-already-exists",i.INVALID_ACTION_CODE="auth/invalid-action-code",i.POPUP_BLOCKED="auth/popup-blocked",i.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",i.USER_NOT_FOUND="auth/user-not-found",i.WRONG_PASSWORD="auth/wrong-password",i}({})});var zr={};Ee(zr,{SmpDynamoService:()=>Nt});var Lr,Ye,Je,Nt,$r=x(()=>{"use strict";Lr=require("@aws-sdk/client-dynamodb"),Ye=require("@aws-sdk/util-dynamodb");Ce();Je=function(i){return i.CouldNotDelete="ERR_COULD_NOT_DELETE",i.CouldNotRead="ERR_COULD_NOT_READ",i.CouldNotWrite="ERR_COULD_NOT_WRITE",i.ConditionalCheckFailedException="ERR_DUPE_TOKEN",i}(Je||{}),Nt=class{static{c(this,"SmpDynamoService")}_config;_tableName;get marshall(){return Ye.marshall}get unmarshall(){return Ye.unmarshall}_db;_logger;constructor(e,t){this._config=e,this._tableName=t,this._db=new Lr.DynamoDB([this._buildConfig()]),this._logger=new V}_buildConfig(){return this._config}_delete(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.deleteItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_DELETE")))}_read(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.getItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_READ")))}_write(e,t=this._tableName,r){let s={TableName:t,Item:this.marshall(e),...r};return this._db.putItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(Je[o.code]||"ERR_COULD_NOT_WRITE")))}}});var Wr={};Ee(Wr,{SmpFirebaseService:()=>Tt});var Ne,u,Tt,Kr=x(()=>{"use strict";Ce();Ne=require("firebase/app"),u=require("firebase/auth");tr();rr();yr();Tt=class i{static{c(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof i))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":q.FACEBOOK,"google.com":q.GOOGLE,"apple.com":q.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return(0,u.getAuth)(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=he.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||he.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new V,this._app=(0,Ne.getApps)().length?(0,Ne.getApps)()[0]:(0,Ne.initializeApp)(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new i(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return(0,u.checkActionCode)(this._auth,e)}confirmPasswordReset(e,t){return(0,u.confirmPasswordReset)(this._auth,e,t)}fetchSignInMethodsForEmail(e){return(0,u.fetchSignInMethodsForEmail)(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return(0,u.getRedirectResult)(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.sendEmailVerification)(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return(0,u.sendPasswordResetEmail)(this._auth,e,{url:t})}setPersistence(e){return(0,u.setPersistence)(this._auth,e?u.browserLocalPersistence:u.browserSessionPersistence)}signInWithCustomToken(e){return(0,u.signInWithCustomToken)(this._auth,e)}signInWithEmailAndPassword(e,t){return(0,u.signInWithEmailAndPassword)(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return(0,u.signOut)(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=u.EmailAuthProvider.credential(this.loggedUser.email,e);return(0,u.reauthenticateWithCredential)(this.loggedUser,r).then(()=>(0,u.updatePassword)(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.updateProfile)(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[q.APPLE]:new u.OAuthProvider("apple.com"),[q.FACEBOOK]:new u.FacebookAuthProvider().setCustomParameters({prompt:"select_account"}),[q.GOOGLE]:new u.GoogleAuthProvider().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===Pe.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=Pe["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:c(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===he.POPUP?u.signInWithPopup:u.signInWithRedirect)(this._auth,e).then(s=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),s.user)).catch(async s=>s?.code===Pe.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,he.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,s),await this._expandDifferentCredential(s),Promise.reject(s)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}}});var Sr,Ft,Qe,Gr=x(()=>{"use strict";Sr=require("rxjs"),Ft=require("ts-luxon");at();ct();Qe=class extends Y{static{c(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(e){return this._readRaw(e).pipe((0,Sr.map)(t=>{if(this._isSmpCachedValue(t)){if(t.expiry>=Ft.DateTime.now().ts)return t.value;this._removeRaw(e).subscribe();return}return t}))}remove(e){return this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0)return this._writeRaw(e,t,r);let s=Ft.DateTime.now().ts+r*1e3,o={value:t,expiry:s};return this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Re(e)}}});function Vr(i,e){return t=>t.pipe((0,et.catchError)(r=>(typeof i==typeof isNaN?Gs(i)?Vs(r,i):i(r):!1)?e(r):(0,et.throwError)(()=>r)))}function Gs(i){try{return Reflect.construct(String,[],i),!0}catch{return!1}}function Vs(i,e){return typeof i=="object"&&i!==null&&i.constructor===e}var et,qr=x(()=>{"use strict";et=require("rxjs");c(Vr,"smpRxjsCatchOnly");c(Gs,"isConstructor");c(Vs,"isExactInstance")});function tt(i=Xs){return e=>e.pipe((0,Xr.map)(t=>{if(~qs.indexOf(JSON.stringify(t)))throw i(t);return t}))}var Xr,qs,Xs,Ut=x(()=>{"use strict";Xr=require("rxjs");c(tt,"smpRxjsThrowIfEmpty");qs=[void 0,null,!1,0,"","0",[],{}].map(i=>JSON.stringify(i)),Xs=c(()=>new Error,"defaultErrorFactory")});function Zr(i,e){return t=>t.pipe((0,rt.filter)(r=>!i(r)),(0,rt.defaultIfEmpty)(!1),tt(e))}var rt,Hr=x(()=>{"use strict";rt=require("rxjs");Ut();c(Zr,"smpRxjsThrowOnCondition")});var st={};Ee(st,{SmpAbstractRxjsTtlCacheStrategy:()=>Qe,smpRxjsCatchOnly:()=>Vr,smpRxjsThrowIfEmpty:()=>tt,smpRxjsThrowOnCondition:()=>Zr});var it=x(()=>{"use strict";Gr();qr();Ut();Hr()});var R,H,ot,Zs,Jr=x(()=>{"use strict";R=ps(require("zod"),1),H=require("ts-luxon"),ot=class i extends R.default.ZodType{static{c(this,"SmpZodDateTime")}constructor(e){super({typeName:"SmpZodDateTime",coerce:e?.coerce??!1,checks:e?.checks??[]})}_parse(e){let t=this._getOrReturnCtx(e),r=t.data;if(this._def.coerce&&(r=this._coerceToDateTime(r),!(r instanceof H.DateTime)||!r.isValid))return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Invalid date format"}),R.default.INVALID;if((!(r instanceof H.DateTime)||!r.isValid)&&!this._def.coerce)return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Input must be a valid DateTime object"}),R.default.INVALID;let s={min:c((o,n,a)=>{if(o.min&&n<o.min)return{code:R.ZodIssueCode.too_small,minimum:o.min.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2265 ${o.min.toISODate()}`,path:a.path}},"min"),max:c((o,n,a)=>{if(o.max&&n>o.max)return{code:R.ZodIssueCode.too_big,maximum:o.max.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2264 ${o.max.toISODate()}`,path:a.path}},"max"),between:c((o,n,a)=>{if(o.min&&o.max&&(n<o.min||n>o.max))return{code:R.ZodIssueCode.custom,message:o.message??`Date must be between ${o.min.toISODate()} and ${o.max.toISODate()}`,path:a.path}},"between")};for(let o of this._def.checks)if(r instanceof H.DateTime&&r.isValid){let n=s[o.kind](o,r,t);n&&R.default.addIssueToContext(t,n)}return t.common.issues.length>0?R.default.INVALID:R.default.OK(r)}between(e,t,r){return new i({...this._def,checks:[...this._def.checks,{kind:"between",min:e.toUTC(),max:t.toUTC(),message:r}]})}coerce(){return new i({...this._def,coerce:!0})}max(e,t){return new i({...this._def,checks:[...this._def.checks,{kind:"max",max:e.toUTC(),message:t}]})}min(e,t){return new i({...this._def,checks:[...this._def.checks,{kind:"min",min:e.toUTC(),message:t}]})}_coerceToDateTime(e){if(e instanceof H.DateTime&&e.isValid)return e;let t={string:c(()=>H.DateTime.fromJSDate(new Date(e)),"string"),number:c(()=>H.DateTime.fromMillis(e),"number"),object:c(()=>H.DateTime.fromJSDate(e),"object"),default:c(()=>null,"default")};return(t[typeof e]||t.default)()}},Zs=c((i={})=>new ot({coerce:i.coerce??!1,checks:[]}),"smpZodDateTime")});var Yr={};Ee(Yr,{SmpZodDateTime:()=>ot,smpZodDateTime:()=>Zs});var Qr=x(()=>{"use strict";Jr()});var Js={};Ee(Js,{SMP_HEALTHZ:()=>_s,SmpAbstractCacheStrategy:()=>Y,SmpAbstractTtlCacheStrategy:()=>Q,SmpAesCrypt:()=>me,SmpApiCommonUtils:()=>mt,SmpBrowserCache:()=>Ae,SmpCommonUtils:()=>Ct,SmpCrypto:()=>qe,SmpErrorResponse:()=>L,SmpFilterException:()=>Bt,SmpFirebaseErrors:()=>Pe,SmpGenericResponse:()=>ce,SmpGiftcardTransaction:()=>He,SmpGiftcardTransactionHashStrategies:()=>oe,SmpGiftcardTransactionOps:()=>v,SmpHttpService:()=>dt,SmpHttpSessionStorageCache:()=>be,SmpHttpStatusCodes:()=>ft,SmpInMemoryCache:()=>Oe,SmpMarketingCloudValidators:()=>Es,SmpRegularExpressions:()=>Dt,SmpResponseMessage:()=>U,SmpResponseMessageTypes:()=>S,SmpRestVerbs:()=>gt,SmpSecureCode:()=>Xe,SmpSid:()=>Pt,SmpSocialSignInKeys:()=>q,SmpSocialSignInUxModes:()=>he,VERSION:()=>Hs,smpIsSmpCachedValue:()=>Re,smpNoop:()=>O});module.exports=J(Js);var ht=require("ts-luxon");at();ct();var Q=class extends Y{static{c(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(e){let t=this._readRaw(e);if(this._isSmpCachedValue(t)){if(t.expiry>=ht.DateTime.now().ts)return t.value;this._removeRaw(e);return}return t}remove(e){this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0){this._writeRaw(e,t,r);return}let s=ht.DateTime.now().ts+r*1e3,o={value:t,expiry:s};this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Re(e)}};var Ae=class extends Q{static{c(this,"SmpBrowserCache")}_storage;_prefix;constructor(e,t){super(),this._storage=e,this._prefix=t}_flushRaw(){let e=[],t=-1;for(;++t<this._storage.length;){let r=this._storage.key(t);r&&r.startsWith(this._prefix)&&e.push(r)}for(t=-1;++t<e.length;)this._storage.removeItem(e[t])}_readRaw(e){let t=this._storage.getItem(this._prefix+e);try{return t?JSON.parse(t):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+e}`);return}}_removeRaw(e){this._storage.removeItem(this._prefix+e)}_writeRaw(e,t){try{this._storage.setItem(this._prefix+e,JSON.stringify(t))}catch(r){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+e}`,r)}}};var be=class extends Ae{static{c(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var Oe=class extends Q{static{c(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(e){return this._staticSelf._storage.get(e)}_removeRaw(e){this._staticSelf._storage.delete(e)}_writeRaw(e,t){this._staticSelf._storage.set(e,t)}};var Ie=require("class-transformer");var G=require("class-transformer");var lt=require("class-transformer");var S=function(i){return i.INFO="INFO",i.SUCCESS="SUCCESS",i.WARNING="WARNING",i.ERROR="ERROR",i}({});function St(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(St,"_ts_decorate");function Te(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Te,"_ts_metadata");var U=class i{static{c(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(e,t=S.ERROR){this._message=e,this._type=t}static sanitizeMessages(e){return typeof e=="string"?e.length?[new i(e)]:[]:[e].flat().map(t=>typeof t=="string"?new i(t):t)}};St([(0,lt.Expose)(),Te("design:type",String),Te("design:paramtypes",[])],U.prototype,"message",null);St([(0,lt.Expose)(),Te("design:type",typeof S>"u"?Object:S),Te("design:paramtypes",[])],U.prototype,"type",null);function us(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(us,"_ts_decorate");function Gt(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Gt,"_ts_metadata");var ce=class i{static{c(this,"SmpGenericResponse")}_messages;data;set messages(e){this._messages=U.sanitizeMessages(e)}get messages(){return this._messages}constructor(e=[],t){this._messages=e,this.data=t}static buildInfo(e,t){return new i([e].flat().map(r=>new U(r,S.INFO)),t)}static buildSuccess(e,t){return new i([e].flat().map(r=>new U(r,S.SUCCESS)),t)}static fromPlain(e){return(0,G.plainToInstance)(i,e)}isError(){return!this.isSuccess()}isSuccess(){return"_errorCode"in this&&this._errorCode!==null&&this._errorCode!==void 0}serialize(){return(0,G.instanceToPlain)(this,{excludePrefixes:["_"]})}};us([(0,G.Expose)(),(0,G.Transform)(({value:i})=>i?.length?i:void 0),Gt("design:type",Object),Gt("design:paramtypes",[])],ce.prototype,"messages",null);function Vt(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(Vt,"_ts_decorate");function Fe(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Fe,"_ts_metadata");var L=class i extends ce{static{c(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new U("GENERIC_ERROR")]}get errorCode(){return this._errorCode}get status(){return this._status}get timestamp(){return this._timestamp}_timestamp;constructor(e=i.DEFAULT_MESSAGES,t="GENERIC_ERROR",r=500,s){super(e,s),this._errorCode=t,this._status=r,this._timestamp=Date.now()}static create({messages:e=i.DEFAULT_MESSAGES,...t}={}){return new i(U.sanitizeMessages(e),t.errorCode,t.status,t.data)}static fromPlain(e){let t=(0,Ie.plainToInstance)(ms,e,{excludePrefixes:["_"]}),r=new i;return Object.getOwnPropertyNames(t).forEach(s=>{s in r&&(r[s]=t[s])}),r}};Vt([(0,Ie.Expose)(),Fe("design:type",Object),Fe("design:paramtypes",[])],L.prototype,"errorCode",null);Vt([(0,Ie.Expose)(),Fe("design:type",Number),Fe("design:paramtypes",[])],L.prototype,"timestamp",null);var ms=class extends L{static{c(this,"SmpErrorResponseMutable")}set errorCode(e){this._errorCode=e}set status(e){this._status=e}set timestamp(e){this._timestamp=e}};var dt=class{static{c(this,"SmpHttpService")}static _cachePrefix="smp_rest_cache_";static _cacheStrategy=typeof sessionStorage<"u"?new be:new Oe;static _config={cachePrefix:this._cachePrefix,shared:new Map};static _errorClass=L;static _mergeParamsFallbackBaseUrl="https://ts-mapi-core";static $http(e){return this._generateAjax(e)}static async _generateAjax(e){if(e.cacheKey){let t=this._cacheRead(e.cacheKey);return t?Promise.resolve(t):this._generateAjaxBase(e).then(r=>(e.cacheKey&&this._cacheWrite(e.cacheKey,r),r))}return this._generateAjaxBase(e)}static async _generateAjaxBase(e){let t=await this._preprocessRequest(e),r={method:t.method,headers:new Headers({"content-type":"application/json",...t.headers}),body:t.body?JSON.stringify(t.body):null};return t.useCredentials&&(r.credentials="include"),t.url=this.mergeQueryParams(t.url,t.queryParams),fetch(t.url,r).then(s=>this._preprocessResponse(e,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(t.responseType){case"blob":return s.blob();case"arraybuffer":return s.arrayBuffer();case"text":return s.text();case"json":default:return s.json()}}return s.json().then(o=>{let n=o;try{n=this._errorClass.fromPlain(o)}catch(a){console.debug("http: failed to parse error response into ErrorResponse",a)}return Promise.reject({status:s.status,message:s.statusText,body:n})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(e,t){let r=e.startsWith("http");if(t){let s=new URL(e,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),o=Object.fromEntries(s.searchParams.entries());s.search=new URLSearchParams({...o,...Object.fromEntries(Object.entries(t).map(([n,a])=>[n,`${a}`]))}).toString(),e=r?s.href:s.pathname+s.search}return e}static _cacheKey(e){return`${this._config.cachePrefix}${e}`}static _cachePop(e){let t=this._cacheRead(e);return this._cacheRemove(e),t}static _cacheRead(e){return this._cacheStrategy.read(this._cacheKey(e))}static _cacheRemove(e){this._cacheStrategy.remove(this._cacheKey(e))}static _cacheWrite(e,t){this._cacheStrategy.write(this._cacheKey(e),t)}static async _preprocessRequest(e){return e}static async _preprocessResponse(e,t){return t}};var ft=function(i){return i[i.Continue=100]="Continue",i[i.SwitchingProtocols=101]="SwitchingProtocols",i[i.Processing=102]="Processing",i[i.EarlyHints=103]="EarlyHints",i[i.Ok=200]="Ok",i[i.Created=201]="Created",i[i.Accepted=202]="Accepted",i[i.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",i[i.NoContent=204]="NoContent",i[i.ResetContent=205]="ResetContent",i[i.PartialContent=206]="PartialContent",i[i.MultiStatus=207]="MultiStatus",i[i.AlreadyReported=208]="AlreadyReported",i[i.ImUsed=226]="ImUsed",i[i.MultipleChoices=300]="MultipleChoices",i[i.MovedPermanently=301]="MovedPermanently",i[i.Found=302]="Found",i[i.SeeOther=303]="SeeOther",i[i.NotModified=304]="NotModified",i[i.UseProxy=305]="UseProxy",i[i.Unused=306]="Unused",i[i.TemporaryRedirect=307]="TemporaryRedirect",i[i.PermanentRedirect=308]="PermanentRedirect",i[i.BadRequest=400]="BadRequest",i[i.Unauthorized=401]="Unauthorized",i[i.PaymentRequired=402]="PaymentRequired",i[i.Forbidden=403]="Forbidden",i[i.NotFound=404]="NotFound",i[i.MethodNotAllowed=405]="MethodNotAllowed",i[i.NotAcceptable=406]="NotAcceptable",i[i.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",i[i.RequestTimeout=408]="RequestTimeout",i[i.Conflict=409]="Conflict",i[i.Gone=410]="Gone",i[i.LengthRequired=411]="LengthRequired",i[i.PreconditionFailed=412]="PreconditionFailed",i[i.PayloadTooLarge=413]="PayloadTooLarge",i[i.UriTooLong=414]="UriTooLong",i[i.UnsupportedMediaType=415]="UnsupportedMediaType",i[i.RangeNotSatisfiable=416]="RangeNotSatisfiable",i[i.ExpectationFailed=417]="ExpectationFailed",i[i.ImATeapot=418]="ImATeapot",i[i.MisdirectedRequest=421]="MisdirectedRequest",i[i.UnprocessableEntity=422]="UnprocessableEntity",i[i.Locked=423]="Locked",i[i.FailedDependency=424]="FailedDependency",i[i.TooEarly=425]="TooEarly",i[i.UpgradeRequired=426]="UpgradeRequired",i[i.PreconditionRequired=428]="PreconditionRequired",i[i.TooManyRequests=429]="TooManyRequests",i[i.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",i[i.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",i[i.InternalServerError=500]="InternalServerError",i[i.NotImplemented=501]="NotImplemented",i[i.BadGateway=502]="BadGateway",i[i.ServiceUnavailable=503]="ServiceUnavailable",i[i.GatewayTimeout=504]="GatewayTimeout",i[i.HttpVersionNotSupported=505]="HttpVersionNotSupported",i[i.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",i[i.InsufficientStorage=507]="InsufficientStorage",i[i.LoopDetected=508]="LoopDetected",i[i.NotExtended=510]="NotExtended",i[i.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",i}({});Ce();var mt=class{static{c(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new V;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(e,t){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}static fromBearer(e=""){return e.split(" ")[1]}static getCountryFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[1]}static getLocaleFromReferer(e){return e?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(e,t){try{return e.replace(this._pathParamRegex,(r,s)=>{let o=t[s];return o!==void 0?encodeURIComponent(o):r})}catch(r){this._logger.warn("KikApiCommonUtils: couldn't interpolate params",r)}return e}};var _s={status:"OK"};var gt=function(i){return i.GET="GET",i.POST="POST",i.PUT="PUT",i.DELETE="DELETE",i.PATCH="PATCH",i}({});var X=class{static{c(this,"Hex")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s+=2)r[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new _(r,t/2)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push((s>>>4).toString(16)),t.push((s&15).toString(16))}return t.join("")}};var _=class _t{static{c(this,"WordArray")}constructor(e,t){this.words=e||[],t!==void 0?this.sigBytes=t:this.sigBytes=this.words.length*4}static random(e){let t=[],r=c(function(s){let o=987654321,n=4294967295;return function(){o=36969*(o&65535)+(o>>16)&n,s=18e3*(s&65535)+(s>>16)&n;let a=(o<<16)+s&n;return a/=4294967296,a+=.5,a*(Math.random()>.5?1:-1)}},"r");for(let s=0,o;s<e;s+=4){let n=r((o||Math.random())*4294967296);o=n()*987654071,t.push(n()*4294967296|0)}return new _t(t,e)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new _t(this.words.slice(0),this.sigBytes)}concat(e){if(this.clamp(),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let r=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];return this.sigBytes+=e.sigBytes,this}toString(e){return(e||X).stringify(this)}};var je=class{static{c(this,"Latin1")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s++)r[s>>>2]|=(e.charCodeAt(s)&255)<<24-s%4*8;return new _(r,t)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push(String.fromCharCode(s))}return t.join("")}};var I=class{static{c(this,"Utf8")}static parse(e){return je.parse(unescape(encodeURIComponent(e)))}static stringify(e){try{return decodeURIComponent(escape(je.stringify(e)))}catch(t){throw console.error("Malformed UTF-8 data",t),new Error("Malformed UTF-8 data")}}};var Le=class{static{c(this,"BufferedBlockAlgorithm")}constructor(e){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},e),this._data=new _,this._nDataBytes=0}clone(){let e=this.constructor();for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e[t]=this[t]);return e._data=this._data.clone(),e}reset(){this._data=new _,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=I.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let t=this.cfg.blockSize*4,r=this._data.sigBytes/t;e?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);let s=r*this.cfg.blockSize,o=Math.min(s*4,this._data.sigBytes),n;if(s){for(let a=0;a<s;a+=this.cfg.blockSize)this._doProcessBlock(this._data.words,a);n=this._data.words.splice(0,s),this._data.sigBytes-=o}return new _(n,o)}};var le=class{static{c(this,"CipherParams")}constructor(e){this.ciphertext=e.ciphertext,this.key=e.key,this.iv=e.iv,this.salt=e.salt,this.algorithm=e.algorithm,this.mode=e.mode,this.padding=e.padding,this.blockSize=e.blockSize,this.formatter=e.formatter}extend(e){return e.ciphertext!==void 0&&(this.ciphertext=e.ciphertext),e.key!==void 0&&(this.key=e.key),e.iv!==void 0&&(this.iv=e.iv),e.salt!==void 0&&(this.salt=e.salt),e.algorithm!==void 0&&(this.algorithm=e.algorithm),e.mode!==void 0&&(this.mode=e.mode),e.padding!==void 0&&(this.padding=e.padding),e.blockSize!==void 0&&(this.blockSize=e.blockSize),e.formatter!==void 0&&(this.formatter=e.formatter),this}toString(e){if(e)return e.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var $=class{static{c(this,"Base64")}static parse(e){let t=e.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let s=0;s<this._map.length;s++)this._reverseMap[this._map.charCodeAt(s)]=s}let r=this._map.charAt(64);if(r){let s=e.indexOf(r);s!==-1&&(t=s)}return this.parseLoop(e,t,this._reverseMap)}static parseLoop(e,t,r){let s=[],o=0;for(let n=0;n<t;n++)if(n%4){let a=r[e.charCodeAt(n-1)]<<n%4*2,h=r[e.charCodeAt(n)]>>>6-n%4*2;s[o>>>2]|=(a|h)<<24-o%4*8,o++}return new _(s,o)}static stringify(e){e.clamp();let t=[];for(let s=0;s<e.sigBytes;s+=3){let o=e.words[s>>>2]>>>24-s%4*8&255,n=e.words[s+1>>>2]>>>24-(s+1)%4*8&255,a=e.words[s+2>>>2]>>>24-(s+2)%4*8&255,h=o<<16|n<<8|a;for(let p=0;p<4&&s+p*.75<e.sigBytes;p++)t.push(this._map.charAt(h>>>6*(3-p)&63))}let r=this._map.charAt(64);if(r)for(;t.length%4;)t.push(r);return t.join("")}};$._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";$._reverseMap=void 0;var ze=class{static{c(this,"OpenSSL")}static parse(e){let t=$.parse(e),r;return t.words[0]===1398893684&&t.words[1]===1701076831&&(r=new _(t.words.slice(2,4)),t.words.splice(0,4),t.sigBytes-=16),new le({ciphertext:t,salt:r})}static stringify(e){if(!e.ciphertext)throw new Error("missing ciphertext in params");let t=e.ciphertext,r=e.salt,s;if(r){if(typeof r=="string")throw new Error("salt is expected to be a WordArray");s=new _([1398893684,1701076831]).concat(r).concat(t)}else s=t;return s.toString($)}};var ee=class{static{c(this,"SerializableCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(!o.format)throw new Error("could not determine format");if(t=this._parse(t,o.format),!t.ciphertext)throw new Error("could not determine ciphertext");return e.createDecryptor(r,o).finalize(t.ciphertext)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s),n=e.createEncryptor(r,o),a=n.finalize(t);return new le({ciphertext:a,key:r,iv:n.cfg.iv,algorithm:e,mode:n.cfg.mode,padding:n.cfg.padding,blockSize:n.cfg.blockSize,formatter:o.format})}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};ee.cfg={blockSize:4,iv:new _([]),format:ze};var b=class extends Le{static{c(this,"Hasher")}constructor(e){super(Object.assign({blockSize:512/32},e)),this.reset()}static _createHelper(e){function t(r,s){return new e(s).finalize(r)}return c(t,"helper"),t}finalize(e){return e&&this._append(e),this._doFinalize()}update(e){return this._append(e),this._process(),this}};var d=[];for(let i=0;i<64;i++)d[i]=Math.abs(Math.sin(i+1))*4294967296|0;var W=class f extends b{static{c(this,"MD5")}get hash(){return this._hash}static FF(e,t,r,s,o,n,a){let h=e+(t&r|~t&s)+o+a;return(h<<n|h>>>32-n)+t}static GG(e,t,r,s,o,n,a){let h=e+(t&s|r&~s)+o+a;return(h<<n|h>>>32-n)+t}static HH(e,t,r,s,o,n,a){let h=e+(t^r^s)+o+a;return(h<<n|h>>>32-n)+t}static II(e,t,r,s,o,n,a){let h=e+(r^(t|~s))+o+a;return(h<<n|h>>>32-n)+t}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;this._data.words[t>>>5]|=128<<24-t%32;let r=Math.floor(e/4294967296),s=e;this._data.words[(t+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,this._data.words[(t+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let o=0;o<4;o++)this._hash.words[o]=(this._hash.words[o]<<8|this._hash.words[o]>>>24)&16711935|(this._hash.words[o]<<24|this._hash.words[o]>>>8)&4278255360;return this._hash}_doProcessBlock(e,t){for(let h=0;h<16;h++){let p=t+h,g=e[p];e[p]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let r=Array.from({length:16});for(let h=0;h<16;h++)r[h]=e[t+h];let s=this._hash.words[0],o=this._hash.words[1],n=this._hash.words[2],a=this._hash.words[3];s=f.FF(s,o,n,a,r[0],7,d[0]),a=f.FF(a,s,o,n,r[1],12,d[1]),n=f.FF(n,a,s,o,r[2],17,d[2]),o=f.FF(o,n,a,s,r[3],22,d[3]),s=f.FF(s,o,n,a,r[4],7,d[4]),a=f.FF(a,s,o,n,r[5],12,d[5]),n=f.FF(n,a,s,o,r[6],17,d[6]),o=f.FF(o,n,a,s,r[7],22,d[7]),s=f.FF(s,o,n,a,r[8],7,d[8]),a=f.FF(a,s,o,n,r[9],12,d[9]),n=f.FF(n,a,s,o,r[10],17,d[10]),o=f.FF(o,n,a,s,r[11],22,d[11]),s=f.FF(s,o,n,a,r[12],7,d[12]),a=f.FF(a,s,o,n,r[13],12,d[13]),n=f.FF(n,a,s,o,r[14],17,d[14]),o=f.FF(o,n,a,s,r[15],22,d[15]),s=f.GG(s,o,n,a,r[1],5,d[16]),a=f.GG(a,s,o,n,r[6],9,d[17]),n=f.GG(n,a,s,o,r[11],14,d[18]),o=f.GG(o,n,a,s,r[0],20,d[19]),s=f.GG(s,o,n,a,r[5],5,d[20]),a=f.GG(a,s,o,n,r[10],9,d[21]),n=f.GG(n,a,s,o,r[15],14,d[22]),o=f.GG(o,n,a,s,r[4],20,d[23]),s=f.GG(s,o,n,a,r[9],5,d[24]),a=f.GG(a,s,o,n,r[14],9,d[25]),n=f.GG(n,a,s,o,r[3],14,d[26]),o=f.GG(o,n,a,s,r[8],20,d[27]),s=f.GG(s,o,n,a,r[13],5,d[28]),a=f.GG(a,s,o,n,r[2],9,d[29]),n=f.GG(n,a,s,o,r[7],14,d[30]),o=f.GG(o,n,a,s,r[12],20,d[31]),s=f.HH(s,o,n,a,r[5],4,d[32]),a=f.HH(a,s,o,n,r[8],11,d[33]),n=f.HH(n,a,s,o,r[11],16,d[34]),o=f.HH(o,n,a,s,r[14],23,d[35]),s=f.HH(s,o,n,a,r[1],4,d[36]),a=f.HH(a,s,o,n,r[4],11,d[37]),n=f.HH(n,a,s,o,r[7],16,d[38]),o=f.HH(o,n,a,s,r[10],23,d[39]),s=f.HH(s,o,n,a,r[13],4,d[40]),a=f.HH(a,s,o,n,r[0],11,d[41]),n=f.HH(n,a,s,o,r[3],16,d[42]),o=f.HH(o,n,a,s,r[6],23,d[43]),s=f.HH(s,o,n,a,r[9],4,d[44]),a=f.HH(a,s,o,n,r[12],11,d[45]),n=f.HH(n,a,s,o,r[15],16,d[46]),o=f.HH(o,n,a,s,r[2],23,d[47]),s=f.II(s,o,n,a,r[0],6,d[48]),a=f.II(a,s,o,n,r[7],10,d[49]),n=f.II(n,a,s,o,r[14],15,d[50]),o=f.II(o,n,a,s,r[5],21,d[51]),s=f.II(s,o,n,a,r[12],6,d[52]),a=f.II(a,s,o,n,r[3],10,d[53]),n=f.II(n,a,s,o,r[10],15,d[54]),o=f.II(o,n,a,s,r[1],21,d[55]),s=f.II(s,o,n,a,r[8],6,d[56]),a=f.II(a,s,o,n,r[15],10,d[57]),n=f.II(n,a,s,o,r[6],15,d[58]),o=f.II(o,n,a,s,r[13],21,d[59]),s=f.II(s,o,n,a,r[4],6,d[60]),a=f.II(a,s,o,n,r[11],10,d[61]),n=f.II(n,a,s,o,r[2],15,d[62]),o=f.II(o,n,a,s,r[9],21,d[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+o|0,this._hash.words[2]=this._hash.words[2]+n|0,this._hash.words[3]=this._hash.words[3]+a|0}};var wt=class sr{static{c(this,"EVPKDF")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:W,iterations:1},e)}static execute(e,t,r){return new sr(r).compute(e,t)}compute(e,t){let r=new this.cfg.hasher,s=new _,o;for(;s.words.length<this.cfg.keySize;){o&&r.update(o),o=r.update(e).finalize(t),r.reset();for(let n=1;n<this.cfg.iterations;n++)o=r.finalize(o),r.reset();s.concat(o)}return s.sigBytes=this.cfg.keySize*4,s}};var ir=class{static{c(this,"OpenSSLKdf")}static execute(e,t,r,s){s||(s=_.random(64/8));let o=new wt({keySize:t+r}).compute(e,s),n=new _(o.words.slice(t),r*4);return o.sigBytes=t*4,new le({key:o,iv:n,salt:s})}};var $e=class{static{c(this,"PasswordBasedCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.format===void 0)throw new Error("missing format in config");if(t=this._parse(t,o.format),o.kdf===void 0)throw new Error("the key derivation function must be set");let n=o.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv!==void 0&&(o.iv=n.iv),ee.decrypt.call(this,e,t,n.key,o)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.kdf===void 0)throw new Error("missing kdf in config");let n=o.kdf.execute(r,e.keySize,e.ivSize);return n.iv!==void 0&&(o.iv=n.iv),ee.encrypt.call(this,e,t,n.key,o).extend(n)}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};$e.cfg={blockSize:4,iv:new _([]),format:ze,kdf:ir};var or=class{static{c(this,"CipherHelper")}constructor(e){this._cipher=e}decrypt(e,t,r){return typeof t=="string"?$e.decrypt(this._cipher,e,t,r):ee.decrypt(this._cipher,e,t,r)}encrypt(e,t,r){return typeof t=="string"?$e.encrypt(this._cipher,e,t,r):ee.encrypt(this._cipher,e,t,r)}};var de=class extends Le{static{c(this,"Cipher")}constructor(e,t,r){super(Object.assign({blockSize:1},r)),this._xformMode=e,this._key=t,this.reset()}static _createHelper(e){return new or(e)}static createDecryptor(e,t){let r=this;return new r(this._DEC_XFORM_MODE,e,t)}static createEncryptor(e,t){return new this(this._ENC_XFORM_MODE,e,t)}finalize(e){return e&&this._append(e),this._doFinalize()}process(e){return this._append(e),this._process()}};de.ivSize=4;de.keySize=4;de._DEC_XFORM_MODE=2;de._ENC_XFORM_MODE=1;var te=class{static{c(this,"BlockCipherModeAlgorithm")}constructor(e,t){this.init(e,t)}init(e,t){this._cipher=e,this._iv=t}};var We=class{static{c(this,"BlockCipherMode")}static createDecryptor(e,t){let r=this.Decryptor;return new r(e,t)}static createEncryptor(e,t){let r=this.Encryptor;return new r(e,t)}};We.Decryptor=te;We.Encryptor=te;var nr=class extends te{static{c(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(e,t,this._cipher.cfg.blockSize),this._cipher.encryptBlock(e,t),this._prevBlock=e.slice(t,t+this._cipher.cfg.blockSize)}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var ar=class extends te{static{c(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let r=e.slice(t,t+this._cipher.cfg.blockSize);this._cipher.decryptBlock(e,t),this.xorBlock(e,t,this._cipher.cfg.blockSize),this._prevBlock=r}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var Z=class extends We{static{c(this,"CBC")}};Z.Decryptor=ar;Z.Encryptor=nr;var fe=class{static{c(this,"PKCS7")}static pad(e,t){let r=t*4,s=r-e.sigBytes%r,o=s<<24|s<<16|s<<8|s,n=[];for(let h=0;h<s;h+=4)n.push(o);let a=new _(n,s);e.concat(a)}static unpad(e){let t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};var Ke=class extends de{static{c(this,"BlockCipher")}constructor(e,t,r){super(e,t,Object.assign({blockSize:4,mode:Z,padding:fe},r))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let e;this._xformMode===this.constructor._ENC_XFORM_MODE?e=this.cfg.mode.createEncryptor:(e=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===e?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=e.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=e)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let e;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),e=this._process(!0)}else e=this._process(!0),this.cfg.padding.unpad(e);return e}_doProcessBlock(e,t){this._mode.processBlock(e,t)}};var l=class z{static{c(this,"X64Word")}constructor(e,t){this.high=e,this.low=t}add(e){let t=this.low+e.low|0,r=t>>>0<this.low>>>0?1:0,s=this.high+e.high+r|0;return new z(s,t)}and(e){return new z(this.high&e.high,this.low&e.low)}not(){return new z(~this.high,~this.low)}or(e){return new z(this.high|e.high,this.low|e.low)}rotL(e){return this.shiftL(e).or(this.shiftR(64-e))}rotR(e){return this.shiftR(e).or(this.shiftL(64-e))}shiftL(e){return e<32?new z(this.high<<e|this.low>>>32-e,this.low<<e):new z(this.low<<e-32,0)}shiftR(e){return e<32?new z(this.high>>>e,this.low>>>e|this.high<<32-e):new z(0,this.high>>>e-32)}xor(e){return new z(this.high^e.high,this.low^e.low)}};var cr=class yt{static{c(this,"X64WordArray")}constructor(e=[],t){this.words=e,this.sigBytes=t!==void 0?t:e.length*8}static create(e=[],t){return new yt(e,t)}clone(){let e=this.words.map(t=>new l(t.high,t.low));return new yt(e,this.sigBytes)}toX32(){let e=[];for(let t of this.words)e.push(t.high,t.low);return new _(e,this.sigBytes)}};var B=[],hr=[],lr=[],dr=[],fr=[],pr=[],xt=[],Et=[],Rt=[],At=[];(function(){let i=[];for(let r=0;r<256;r++)r<128?i[r]=r<<1:i[r]=r<<1^283;let e=0,t=0;for(let r=0;r<256;r++){let s=t^t<<1^t<<2^t<<3^t<<4;s=s>>>8^s&255^99,B[e]=s,hr[s]=e;let o=i[e],n=i[o],a=i[n],h=i[s]*257^s*16843008;lr[e]=h<<24|h>>>8,dr[e]=h<<16|h>>>16,fr[e]=h<<8|h>>>24,pr[e]=h,h=a*16843009^n*65537^o*257^e*16843008,xt[s]=h<<24|h>>>8,Et[s]=h<<16|h>>>16,Rt[s]=h<<8|h>>>24,At[s]=h,e?(e=o^i[i[i[a^o]]],t^=i[i[t]]):e=t=1}})();var ws=[0,1,2,4,8,16,32,64,128,27,54],Se=class extends Ke{static{c(this,"AES")}constructor(e,t,r){super(e,t,r),super.reset()}decryptBlock(e,t){let r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,xt,Et,Rt,At,hr),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r}encryptBlock(e,t){this._doCryptBlock(e,t,this._keySchedule,lr,dr,fr,pr,B)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,o=((this._nRounds=r+6)+1)*4,n=this._keySchedule=[];for(let a=0;a<o;a++)if(a<r)n[a]=t[a];else{let h=n[a-1];a%r?r>6&&a%r===4&&(h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255]):(h=h<<8|h>>>24,h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255],h^=ws[a/r|0]<<24),n[a]=n[a-r]^h}this._invKeySchedule=[];for(let a=0;a<o;a++){let h=o-a,p;a%4?p=n[h]:p=n[h-4],a<4||h<=4?this._invKeySchedule[a]=p:this._invKeySchedule[a]=xt[B[p>>>24]]^Et[B[p>>>16&255]]^Rt[B[p>>>8&255]]^At[B[p&255]]}}_doCryptBlock(e,t,r,s,o,n,a,h){let p=e[t]^r[0],g=e[t+1]^r[1],m=e[t+2]^r[2],w=e[t+3]^r[3],A=4;for(let C=1;C<this._nRounds;C++){let y=s[p>>>24]^o[g>>>16&255]^n[m>>>8&255]^a[w&255]^r[A++],E=s[g>>>24]^o[m>>>16&255]^n[w>>>8&255]^a[p&255]^r[A++],F=s[m>>>24]^o[w>>>16&255]^n[p>>>8&255]^a[g&255]^r[A++],nt=s[w>>>24]^o[p>>>16&255]^n[g>>>8&255]^a[m&255]^r[A++];p=y,g=E,m=F,w=nt}let P=(h[p>>>24]<<24|h[g>>>16&255]<<16|h[m>>>8&255]<<8|h[w&255])^r[A++],j=(h[g>>>24]<<24|h[m>>>16&255]<<16|h[w>>>8&255]<<8|h[p&255])^r[A++],N=(h[m>>>24]<<24|h[w>>>16&255]<<16|h[p>>>8&255]<<8|h[g&255])^r[A++],T=(h[w>>>24]<<24|h[p>>>16&255]<<16|h[g>>>8&255]<<8|h[m&255])^r[A++];e[t]=P,e[t+1]=j,e[t+2]=N,e[t+3]=T}};Se.keySize=256/32;var ys=[1732584193,4023233417,2562383102,271733878,3285377520],re=new Array(80),se=class extends b{static{c(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(ys.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)re[h]=e[t+h]|0;else{let w=re[h-3]^re[h-8]^re[h-14]^re[h-16];re[h]=w<<1|w>>>31}let p,g;h<20?(p=s&o|~s&n,g=1518500249):h<40?(p=s^o^n,g=1859775393):h<60?(p=s&o|s&n|o&n,g=2400959708):(p=s^o^n,g=3395469782);let m=(r<<5|r>>>27)+p+a+g+re[h];a=n,n=o,o=s<<30|s>>>2,s=r,r=m|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0}};var ur=[],mr=[];(function(){function i(s){let o=Math.sqrt(s);for(let n=2;n<=o;n++)if(!(s%n))return!1;return!0}c(i,"isPrime");function e(s){return(s-(s|0))*4294967296|0}c(e,"getFractionalBits");let t=2,r=0;for(;r<64;)i(t)&&(r<8&&(ur[r]=e(Math.pow(t,1/2))),mr[r]=e(Math.pow(t,1/3)),r++),t++})();var ie=[],Be=class extends b{static{c(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(ur.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4],h=this._hash.words[5],p=this._hash.words[6],g=this._hash.words[7];for(let m=0;m<64;m++){if(m<16)ie[m]=e[t+m]|0;else{let C=ie[m-15],y=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,E=ie[m-2],F=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;ie[m]=y+ie[m-7]+F+ie[m-16]}let w=a&h^~a&p,A=r&s^r&o^s&o,P=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),j=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),N=g+j+w+mr[m]+ie[m],T=P+A;g=p,p=h,h=a,a=n+N|0,n=o,o=s,s=r,r=N+T|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+p|0,this._hash.words[7]=this._hash.words[7]+g|0}};var bt=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],M=[];(function(){for(let i=0;i<80;i++)M[i]=new l(void 0,void 0)})();var Ot=class extends b{static{c(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new cr([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let e=this._data,t=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;return t[s>>>5]|=128<<24-s%32,t[(s+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(s+128>>>10<<5)+31]=r,e.sigBytes=t.length*4,this._process(),this._hash.toX32()}_doProcessBlock(e,t){let r=this._hash.words[0].high,s=this._hash.words[0].low,o=this._hash.words[1].high,n=this._hash.words[1].low,a=this._hash.words[2].high,h=this._hash.words[2].low,p=this._hash.words[3].high,g=this._hash.words[3].low,m=this._hash.words[4].high,w=this._hash.words[4].low,A=this._hash.words[5].high,P=this._hash.words[5].low,j=this._hash.words[6].high,N=this._hash.words[6].low,T=this._hash.words[7].high,C=this._hash.words[7].low;for(let y=0;y<80;y++){let E,F;if(y<16)F=M[y].high=e[t+y*2]|0,E=M[y].low=e[t+y*2+1]|0;else{let Lt=M[y-15],ne=Lt.high,we=Lt.low,ns=(ne>>>1|we<<31)^(ne>>>8|we<<24)^ne>>>7,zt=(we>>>1|ne<<31)^(we>>>8|ne<<24)^(we>>>7|ne<<25),$t=M[y-2],ae=$t.high,ye=$t.low,as=(ae>>>19|ye<<13)^(ae<<3|ye>>>29)^ae>>>6,Wt=(ye>>>19|ae<<13)^(ye<<3|ae>>>29)^(ye>>>6|ae<<26);E=zt+M[y-7].low,F=ns+M[y-7].high+(E>>>0<zt>>>0?1:0),E=E+Wt,F=F+as+(E>>>0<Wt>>>0?1:0),E=E+M[y-16].low,F=F+M[y-16].high+(E>>>0<M[y-16].low>>>0?1:0),M[y].high=F,M[y].low=E}let nt=m&A^~m&j,kt=w&P^~w&N,es=r&o^r&a^o&a,ts=s&n^s&h^n&h,rs=(r>>>28|s<<4)^(r<<30|s>>>2)^(r<<25|s>>>7),Mt=(s>>>28|r<<4)^(s<<30|r>>>2)^(s<<25|r>>>7),ss=(m>>>14|w<<18)^(m>>>18|w<<14)^(m<<23|w>>>9),is=(w>>>14|m<<18)^(w>>>18|m<<14)^(w<<23|m>>>9),D=C+is,K=T+ss+(D>>>0<C>>>0?1:0);D=D+kt,K=K+nt+(D>>>0<kt>>>0?1:0),D=D+bt[y].low,K=K+bt[y].high+(D>>>0<bt[y].low>>>0?1:0),D=D+E,K=K+F+(D>>>0<E>>>0?1:0);let jt=Mt+ts,os=rs+es+(jt>>>0<Mt>>>0?1:0);T=j,C=N,j=A,N=P,A=m,P=w,w=g+D|0,m=p+K+(w>>>0<g>>>0?1:0)|0,p=a,g=h,a=o,h=n,o=r,n=s,s=D+jt|0,r=K+os+(s>>>0<D>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+s,this._hash.words[0].high=this._hash.words[0].high+r+(this._hash.words[0].low>>>0<s>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+n,this._hash.words[1].high=this._hash.words[1].high+o+(this._hash.words[1].low>>>0<n>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+a+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+p+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+w,this._hash.words[4].high=this._hash.words[4].high+m+(this._hash.words[4].low>>>0<w>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+P,this._hash.words[5].high=this._hash.words[5].high+A+(this._hash.words[5].low>>>0<P>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+N,this._hash.words[6].high=this._hash.words[6].high+j+(this._hash.words[6].low>>>0<N>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+C,this._hash.words[7].high=this._hash.words[7].high+T+(this._hash.words[7].low>>>0<C>>>0?1:0)}};var gr=class{static{c(this,"HMAC")}constructor(e,t){this._hasher=new e;let r=typeof t=="string"?I.parse(t):t,s=this._hasher.cfg.blockSize,o=s*4;r.sigBytes>o&&(r=this._hasher.finalize(r)),r.clamp();let n=this._oKey=r.clone(),a=this._iKey=r.clone(),h=n.words,p=a.words;for(let g=0;g<s;g++)h[g]^=1549556828,p[g]^=909522486;n.sigBytes=a.sigBytes=o,this.reset()}finalize(e){let t=this._hasher.finalize(e);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(t))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(e){return this._hasher.update(e),this}};var It=class _r{static{c(this,"PBKDF2")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:Be,iterations:25e4},e)}static execute(e,t,r){return new _r(r).compute(e,t)}compute(e,t){let r=this.cfg,s=new gr(r.hasher,e),o=new _,n=new _([1]),a=o.words,h=n.words,p=r.keySize,g=r.iterations;for(;a.length<p;){let m=s.update(t).finalize(n);s.reset();let w=m.words,A=w.length,P=m;for(let j=1;j<g;j++){P=s.finalize(P),s.reset();let N=P.words;for(let T=0;T<A;T++)w[T]^=N[T]}o.concat(m),h[0]++}return o.sigBytes=p*4,o}};var ve=Ke._createHelper(Se);var pe=b._createHelper(W);var ue=b._createHelper(se);var Ge=b._createHelper(Be);var Ve=b._createHelper(Ot);var me=class{static{c(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?X.parse(this._initVector):void 0}_mode;_padding;constructor(e,t,r){this._password=e,this._salt=t,this._initVector=r,this._mode=Z,this._padding=fe}decryptAES(e){return ve.decrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(e){return ve.encrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return It.execute(this._password,X.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:se})}};var qe=class{static{c(this,"SmpCrypto")}static base64Decode(e){return I.stringify($.parse(e))}static base64Encode(e){return $.stringify(I.parse(e))}static md5(e){return pe(e).toString()}static sha1(e){return ue(e).toString()}static sha256(e){return Ge(e).toString()}static sha512(e){return Ve(e).toString()}};var Xe=class{static{c(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength;_seed;constructor(e){this._baseCode=e,this._crcLength=5,this._seed="changeme"}static check(e,t){if(new this(e).secureCode!==t)throw L.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:ft.BadRequest})}_encode(){let e=new W;return e.update(I.parse(this._seed+this._baseCode)),e.finalize().toString(X).substring(0,this._crcLength).toUpperCase()}};var ge=require("class-transformer"),Ze=require("ts-luxon");var v=function(i){return i.ACTIVATE="ACTIVATE",i.BLOCK="BLOCK",i.CHECK="CHECK",i.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",i.FREEZE="FREEZE",i.PURCHASE="PURCHASE",i.RECHARGE="RECHARGE",i.ROLLBACK="ROLLBACK",i.TRANSACTION="TRANSACTION",i.TRANSACTION_DETAIL="TRANSACTION_DETAIL",i.UNFREEZE="UNFREEZE",i.XREFUND="XREFUND",i}({});var oe=function(i){return i.MD5="MD5",i.MD5_HMAC="MD5_HMAC",i.SHA1="SHA1",i.SHA1_HMAC="SHA1_HMAC",i}({});function xs(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(xs,"_ts_decorate");function wr(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(wr,"_ts_metadata");var He=class{static{c(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new me("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _LOGGER=console;static _OP_CODES={[v.CHECK]:"",[v.TRANSACTION]:"",[v.TRANSACTION_DETAIL]:"",[v.ACTIVATE]:"A",[v.BLOCK]:"B",[v.DIGITAL_ACTIVATE]:"D",[v.FREEZE]:"F",[v.PURCHASE]:"P",[v.RECHARGE]:"G",[v.ROLLBACK]:"R",[v.UNFREEZE]:"U",[v.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies;_hashStrategy;constructor(e="ACTIVATION",t,r,s){this.gc=e,this.op=t,this.ot=r,this._hashStrategies={[oe.MD5]:o=>pe(o),[oe.MD5_HMAC]:o=>{let n=new W;return n.update(I.parse(o)),n.finalize()},[oe.SHA1]:o=>ue(o),[oe.SHA1_HMAC]:o=>{let n=new se;return n.update(I.parse(o)),n.finalize()}},this._hashStrategy=this._hashStrategies[oe.MD5],this._dto=typeof s=="number"&&s>=0?Ze.DateTime.fromMillis(+`${s}000`.slice(0,13)):Ze.DateTime.local()}static build({gc:e,op:t,ot:r,dto:s}){return new this(e,t,r,s?.ts)}static explode(e){let t=this.constructor,r=(e||"").split(t._SEP);if(r.length<4)throw new Error(`INVALID_TRANSACTION "${e}"`);return this.build({gc:r[1],op:t.prefixToOperation(r[2]),dto:Ze.DateTime.fromSeconds(+r[3])})}static isBase64(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)&&e.length%4===0}static parse(e){this._LOGGER.info(`${this.constructor.name}: trying to parse ${e}`);try{if(this.isBase64(e)){let t=this.constructor._AES_ENCODER.decryptAES(e),r=JSON.parse(t);return(0,ge.plainToInstance)(this,r)}else return this.explode(e)}catch(t){throw this._LOGGER.error(`${this.constructor.name}: failed to parse ${e}`,t),new Error(`UNPARSEABLE "${e}"`)}}static prefixToOperation(e){return Object.entries(this._OP_CODES).find(([,r])=>r===e)[0]}serialize(){return(0,ge.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let e=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(e)}};xs([(0,ge.Expose)(),wr("design:type",Number),wr("design:paramtypes",[])],He.prototype,"ts",null);var Es=function(i){return i.ListDetectiveValidator="ListDetectiveValidator",i.MXValidator="MXValidator",i.SyntaxValidator="SyntaxValidator",i}({});var Rs=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function xr(i){return i.match(Rs)}c(xr,"smpAsciiWords");var Ir="\\ud800-\\udfff",As="\\u0300-\\u036f",bs="\\ufe20-\\ufe2f",Os="\\u20d0-\\u20ff",Is="\\u1ab0-\\u1aff",Cs="\\u1dc0-\\u1dff",Bs=As+bs+Os+Is+Cs,Cr="\\u2700-\\u27bf",Br="a-z\\xdf-\\xf6\\xf8-\\xff",vs="\\xac\\xb1\\xd7\\xf7",Ps="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ds="\\u2000-\\u206f",Ns=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vr="A-Z\\xc0-\\xd6\\xd8-\\xde",Ts="\\ufe0e\\ufe0f",Pr=vs+Ps+Ds+Ns,Dr="['\u2019]",Er=`[${Pr}]`,Fs=`[${Bs}]`,Nr="\\d",Us=`[${Cr}]`,Tr=`[${Br}]`,Fr=`[^${Ir}${Pr+Nr+Cr+Br+vr}]`,ks="\\ud83c[\\udffb-\\udfff]",Ms=`(?:${Fs}|${ks})`,js=`[^${Ir}]`,Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",kr="[\\ud800-\\udbff][\\udc00-\\udfff]",_e=`[${vr}]`,Ls="\\u200d",Rr=`(?:${Tr}|${Fr})`,zs=`(?:${_e}|${Fr})`,Ar=`(?:${Dr}(?:d|ll|m|re|s|t|ve))?`,br=`(?:${Dr}(?:D|LL|M|RE|S|T|VE))?`,Mr=`${Ms}?`,jr=`[${Ts}]?`,$s=`(?:${Ls}(?:${[js,Ur,kr].join("|")})${jr+Mr})*`,Ws="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ks="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ss=jr+Mr+$s,Or=`(?:${[Us,Ur,kr].join("|")})${Ss}`,De=class{static{c(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${_e}?${Tr}+${Ar}(?=${[Er,_e,"$"].join("|")})`,`${zs}+${br}(?=${[Er,_e+Rr,"$"].join("|")})`,`${_e}?${Rr}+${Ar}`,`${_e}+${br}`,Ks,Ws,`${Nr}+`,Or].join("|"),"g");static RS_EMOJI=Or;static unicodeWords(e){return e.match(this.RE_UNICODE_WORDS)}};var Ct=class i{static{c(this,"SmpCommonUtils")}static arrayRemove(e,t){let r=[],s=e.filter((o,n)=>t(o,n)&&r.push(n));return r.reverse().forEach(o=>e.splice(o,1)),s}static assertIsArray(e,t){if(!Array.isArray(e))throw new Error(t||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(e,t){if(!this.isBoolean(e))throw new Error(t||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(e,t){if(!this.isFunction(e))throw new Error(t||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(e,t,r){if(!(e instanceof t))throw new Error(r||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(e,t){if(this.isEmpty(e))throw new Error(t||`${this.constructor.name} => entity was empty`)}static assertIsNumber(e,t){if(typeof e!="number")throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(e,t){if(!this.isNumeric(e))throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsObject(e,t){if(!this.isObject(e))throw new Error(t||`${this.constructor.name} => val was not an object`)}static assertIsString(e,t){if(!this.isString(e))throw new Error(t||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(e,t){if(!e)throw new Error(t||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...e){let t=e.filter(r=>!!r).join("/").replace(/(?<!:)\/\/+/g,"/");return t.startsWith("http")&&!t.endsWith("/")?`${t}/`:t}static downloadBlob(e,t){let r=window.URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.setAttribute("download",t),document.body.appendChild(s),s.click()}static generateRandomHexString(e=12){let t="0123456789abcdef",r="";for(let s=0;s<e;s++){let o=Math.floor(Math.random()*t.length);r+=t[o]}return r}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}static getDecimalPrecision(e){if(this.assertIsNumeric(e),!isFinite(+e))return 0;let t=1,r=0;for(;Math.round(+e*t)/t!==e;)t*=10,r++;return r}static getType(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static isBoolean(e){return typeof e=="boolean"}static isColor(e){if(!e||!this.isString(e))return!1;let t=new Option().style;return t.color=e,t.color!==""}static isEmpty(e){return!e&&e!==0}static isEqual(e,t){function r(){if(e.length!==t.length)return!1;for(let h=0;h<e.length;h++)if(!i.isEqual(e[h],t[h]))return!1;return!0}c(r,"areArraysEqual");function s(){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let h in e)if(Object.prototype.hasOwnProperty.call(e,h)&&!i.isEqual(e[h],t[h]))return!1;return!0}c(s,"areObjectsEqual");function o(){return e.toString()===t.toString()}c(o,"areFunctionsEqual");function n(){return e===t}c(n,"arePrimativesEqual");let a=this.getType(e);return a!==this.getType(t)?!1:a==="array"?r():a==="object"?s():a==="function"?o():n()}static isFormField(e){return/^(?:input|select|textarea|button)$/i.test(e.nodeName)}static isFunction(e){return typeof e==typeof isNaN}static isNotEmpty(e){return!this.isEmpty(e)}static isNumber(e){return typeof e=="number"&&this.isNumeric(e)}static isNumeric(e){return!isNaN(e)}static isObject(e){return!!e&&e===Object(e)&&e.constructor===Object}static isPrimitive(e){let t=this.getType(e);return t!=="function"&&(t!=="object"||!e)}static isString(e){return typeof e=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(e,t){if(this.assertIsFunction(t,`CommonUtils => expected type of iteratee to be Function, got ${typeof t}`),this.isObject(e))return Object.entries(e).reduce((r,[s,o])=>(r.push(t(o,s)),r),[]);if(Array.isArray(e))return e.map(t);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof t}`)}static mapObjectKeys(e,t){return Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,s,o),r),{})}static mapObjectValues(e,t){return this.isObject(e)?Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,o,s),r),{}):{}}static noop(){}static objectHasValue(e,t){return!!~Object.values(e).filter(r=>this.isEqual(r,t))}static omit(e,t){return Object.keys(e).filter(s=>!t.includes(s)).reduce((s,o)=>(s[o]=e[o],s),{})}static parseBoolean(e){return e?/^true$/i.test(e):!1}static parseJsonSafely(e){try{return JSON.parse(e)}catch(t){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:e,error:t});return}}static pick(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}static runSafely(e,t=null,r=[]){if(this.isFunction(e))return e.apply(t,r)}static sleep(e){return new Promise(t=>setTimeout(t,e))}static sprintf(e,...t){return this.isString(e)&&t.length?this.sprintf(e.replace("%s",String(t.shift())),...t):e}static stripComments(e){return typeof e=="string"?e.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):e}static submitFakeForm({action:e,method:t=gt.POST,data:r,target:s}){let o=Object.entries(r||{}).map(([a,h])=>`<input name="${a}" type="hidden" value="${h}" />`),n=document.createElement("form");n.method=t,n.action=e,n.innerHTML=`${o}`,n.target=s||"_self",document.body.append(n),n.submit()}static toCamelCase(e){return this.words(e.replace(/['\u2019]/g,"")).reduce((t,r,s)=>(r=r.toLowerCase(),t+(s?r.charAt(0).toUpperCase()+r.slice(1):r)),"")}static toKebabCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(e){return this.toCamelCase(e).replace(/^(.)/,t=>t.toUpperCase())}static toSnakeCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(e){return this.toSnakeCase(e).toUpperCase()}static words(e,t){return t===void 0?(De.HAS_UNICODE_WORD(e)?De.unicodeWords(e):xr(e))||[]:e.match(t)||[]}};var Bt=class extends Error{static{c(this,"SmpFilterException")}message;data;constructor(e="Filter Exception",t){super(),this.message=e,this.data=t}};var vt=require("ts-luxon");var Pt=class i{static{c(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return vt.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix;constructor(e=`sid-xxxx-${+vt.DateTime.now().ts}`,t=0){this.value=e,this.expiry=t,this._controlSuffix="$1"}static parse(e){return new i(e.value,e.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};Ce();var Dt=class{static{c(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var Hs="1.6.0";Object.defineProperties(module.exports,{SmpDynamoService:{get:c(()=>($r(),J(zr)).SmpDynamoService,"get")},SmpFirebaseService:{get:c(()=>(Kr(),J(Wr)).SmpFirebaseService,"get")},smpRxjsCatchOnly:{get:c(()=>(it(),J(st)).smpRxjsCatchOnly,"get")},smpRxjsThrowIfEmpty:{get:c(()=>(it(),J(st)).smpRxjsThrowIfEmpty,"get")},smpRxjsThrowOnCondition:{get:c(()=>(it(),J(st)).smpRxjsThrowOnCondition,"get")},smpZodDateTime:{get:c(()=>(Qr(),J(Yr)).smpZodDateTime,"get")}});0&&(module.exports={SMP_HEALTHZ,SmpAbstractCacheStrategy,SmpAbstractTtlCacheStrategy,SmpAesCrypt,SmpApiCommonUtils,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpService,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpIsSmpCachedValue,smpNoop});
1
+ "use strict";var ds=Object.create;var be=Object.defineProperty;var fs=Object.getOwnPropertyDescriptor;var ps=Object.getOwnPropertyNames;var us=Object.getPrototypeOf,ms=Object.prototype.hasOwnProperty;var c=(i,e)=>be(i,"name",{value:e,configurable:!0});var y=(i,e)=>()=>(i&&(e=i(i=0)),e);var Oe=(i,e)=>{for(var t in e)be(i,t,{get:e[t],enumerable:!0})},Zt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ps(e))!ms.call(i,s)&&s!==t&&be(i,s,{get:()=>e[s],enumerable:!(r=fs(e,s))||r.enumerable});return i};var gs=(i,e,t)=>(t=i!=null?ds(us(i)):{},Zt(e||!i||!i.__esModule?be(t,"default",{value:i,enumerable:!0}):t,i)),L=i=>Zt(be({},"__esModule",{value:!0}),i);var Q,lt=y(()=>{"use strict";Q=class{static{c(this,"SmpAbstractCacheStrategy")}}});function Ce(i){return typeof i=="object"&&i!==null&&"value"in i&&"expiry"in i&&typeof i.expiry=="number"}var dt=y(()=>{"use strict";c(Ce,"smpIsSmpCachedValue")});var Yt,Qt=y(()=>{"use strict";Yt=class{static{c(this,"SmpSessionManagerService")}get sessionId(){return this._sessionId||this._storage.getItem(this._sessionIdKey)||void 0}constructor(e="lggr_sid"){this._sessionIdKey=e,this._storage=this._getStorage(),this._sessionId=this.sessionId||this._generateSessionId()}_generateSessionId(){let e=this._generateUUID();return this._storage.setItem(this._sessionIdKey,e),e}_generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}_getStorage(){try{if(typeof window<"u"&&typeof window.sessionStorage==typeof isNaN)return sessionStorage}catch(e){console.warn(`${this.constructor.name}: error while checking sessionStorage`,e)}return{getItem:c(()=>null,"getItem"),setItem:c(()=>null,"setItem"),removeItem:c(()=>null,"removeItem"),clear:c(()=>null,"clear")}}}});var k,mt=y(()=>{"use strict";(function(i){i[i.OFF=0]="OFF",i[i.ERROR=1]="ERROR",i[i.WARN=2]="WARN",i[i.INFO=3]="INFO",i[i.LOG=4]="LOG",i[i.DEBUG=5]="DEBUG"})(k||(k={}))});function O(){}var Le=y(()=>{"use strict";c(O,"smpNoop")});var ys,Z,gt=y(()=>{"use strict";Le();ys=class{static{c(this,"SmpConsoleOnlyMethods")}constructor(){this.group=O,this.groupCollapsed=O,this.groupEnd=O,this.time=O,this.timeEnd=O}},Z=class er extends ys{static{c(this,"SmpLoggerMethods")}constructor(){super(...arguments),this.debug=O,this.error=O,this.info=O,this.log=O,this.warn=O}static describe(){return Object.getOwnPropertyNames(new er).map(e=>e)}}});var tr,ze,$e,rr=y(()=>{"use strict";Qt();mt();gt();Le();ze="[DEFAULT]",$e=class extends Z{static{c(this,"SmpLoggerService")}static get INSTANCE(){return this.get(ze)}static get INSTANCES(){return this._instances.keys()}static get NOOP_INSTANCE(){return this._noopInstance}get activeLevels(){return Object.values(k).filter(e=>+e>k.OFF&&+e<=this.level).map(e=>k[e])}get appName(){return this._appName}get currentConfig(){return{level:this.level,enableSessionId:this.enableSessionId,enablePreprocessing:this.enablePreprocessing,sensitiveProps:this._sensitiveProps}}get enablePreprocessing(){return this.preprocessArgs!==this._noopPreprocessArgs}get enableSessionId(){return!!this.sessionId}get level(){return this.constructor._level}get sessionId(){return this._sessionId}constructor(e){super(),this._sensitivePropMask="*****",this._sessionManager=new Yt,this._loadConfig(e)}static destroy(e){return this._instances.delete(e)}static get(e=ze){return this._instances.get(e)||this._instances.get(ze)||this._noopInstance}static init(e,t=ze){let r;if(this._instances.has(t)){r=this.get(t);let s=r.currentConfig;r._loadConfig(Object.assign(Object.assign({},s),e))}else this._instances.set(t,new this(e)),r=this.get(t),r._appName=t;return r}static pop(e){let t=this.get(e);return this.destroy(e),t}destroy(){return this.constructor.destroy(this.appName)}filterSensitiveData(e){if(e===null||typeof e!="object"||Array.isArray(e)||e.constructor!==Object)return e;let t={};for(let r in e){let s=e[r];if(!Object.prototype.hasOwnProperty.call(e,r)||s===null||s===void 0){t[r]=s;continue}if(this._sensitiveProps.includes(r)){t[r]=this._sensitivePropMask;continue}t[r]=this.filterSensitiveData(s)}return t}preprocessArgs(e,...t){return this._defaultPreprocessArgs.apply(this,[e,...t])}_defaultPreprocessArgs(e,...t){let r=new Date;return[`${r.toISOString()}`,`${t.shift()}`.trim(),...t.map(s=>({tags:[this._appName,`level-${k[this.level]}`,e],timestamp:+r,sessionId:this.sessionId,metadata:this.filterSensitiveData(s)}))]}_loadConfig({sensitiveProps:e=[],level:t=k.OFF,enablePreprocessing:r=!1,enableSessionId:s=!1}){this._sensitiveProps=[...e,"pwd","password","buffer","token","accessToken","refreshToken"],this.preprocessArgs=r?this.preprocessArgs:this._noopPreprocessArgs,this._sessionId=s?this._sessionManager.sessionId:void 0,this._updateLevel(t)}_noopPreprocessArgs(...e){return e}_setup(e){let t=this.preprocessArgs.bind(this);this.activeLevels.forEach(r=>{let s=`${r}`.toLowerCase();typeof e[s]==typeof isNaN&&(this[s]=function(...o){e[s].apply(e,t.apply(null,[s,...o]))})}),this.level>k.OFF&&console&&(console.group&&console.groupEnd&&(this.group=console.group.bind(console),this.groupEnd=console.groupEnd.bind(console)),console.groupCollapsed&&(this.groupCollapsed=console.groupCollapsed.bind(console)),console.time&&console.timeEnd&&(this.time=console.time.bind(console),this.timeEnd=console.timeEnd.bind(console)))}_updateLevel(e=k.WARN){this.constructor.describe().forEach(t=>{this[t]=O}),this.constructor._level=e,console&&this._setup(console)}};tr=$e;$e._instances=new Map;$e._level=k.OFF;$e._noopInstance=new tr({level:k.OFF})});var sr=y(()=>{"use strict"});var ir=y(()=>{"use strict"});var or=y(()=>{"use strict";sr();ir();gt();mt();Le()});var Pe=y(()=>{"use strict";rr();or()});var X,nr=y(()=>{"use strict";X=function(i){return i.APPLE="APPLE",i.FACEBOOK="FACEBOOK",i.GOOGLE="GOOGLE",i}({})});var le,ar=y(()=>{"use strict";le=function(i){return i.POPUP="POPUP",i.REDIRECT="REDIRECT",i}({})});var Fe,br=y(()=>{"use strict";Fe=function(i){return i.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",i.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",i.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",i.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",i.EMAIL_EXISTS="auth/email-already-exists",i.INVALID_ACTION_CODE="auth/invalid-action-code",i.POPUP_BLOCKED="auth/popup-blocked",i.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",i.USER_NOT_FOUND="auth/user-not-found",i.WRONG_PASSWORD="auth/wrong-password",i}({})});var Gr={};Oe(Gr,{SmpDynamoService:()=>Ft});var Kr,rt,tt,Ft,Vr=y(()=>{"use strict";Kr=require("@aws-sdk/client-dynamodb"),rt=require("@aws-sdk/util-dynamodb");Pe();tt=function(i){return i.CouldNotDelete="ERR_COULD_NOT_DELETE",i.CouldNotRead="ERR_COULD_NOT_READ",i.CouldNotWrite="ERR_COULD_NOT_WRITE",i.ConditionalCheckFailedException="ERR_DUPE_TOKEN",i}(tt||{}),Ft=class{static{c(this,"SmpDynamoService")}_config;_tableName;get marshall(){return rt.marshall}get unmarshall(){return rt.unmarshall}_db;_logger;constructor(e,t){this._config=e,this._tableName=t,this._db=new Kr.DynamoDB([this._buildConfig()]),this._logger=new Z}_buildConfig(){return this._config}_delete(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.deleteItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(tt[o.code]||"ERR_COULD_NOT_DELETE")))}_read(e,t=this._tableName,r){let s={TableName:t,Key:this.marshall(e),...r};return this._db.getItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(tt[o.code]||"ERR_COULD_NOT_READ")))}_write(e,t=this._tableName,r){let s={TableName:t,Item:this.marshall(e),...r};return this._db.putItem(s).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(tt[o.code]||"ERR_COULD_NOT_WRITE")))}}});var qr={};Oe(qr,{SmpFirebaseService:()=>Ut});var ke,u,Ut,Zr=y(()=>{"use strict";Pe();ke=require("firebase/app"),u=require("firebase/auth");nr();ar();br();Ut=class i{static{c(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof i))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":X.FACEBOOK,"google.com":X.GOOGLE,"apple.com":X.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return(0,u.getAuth)(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=le.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||le.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new Z,this._app=(0,ke.getApps)().length?(0,ke.getApps)()[0]:(0,ke.initializeApp)(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new i(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return(0,u.checkActionCode)(this._auth,e)}confirmPasswordReset(e,t){return(0,u.confirmPasswordReset)(this._auth,e,t)}fetchSignInMethodsForEmail(e){return(0,u.fetchSignInMethodsForEmail)(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return(0,u.getRedirectResult)(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.sendEmailVerification)(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return(0,u.sendPasswordResetEmail)(this._auth,e,{url:t})}setPersistence(e){return(0,u.setPersistence)(this._auth,e?u.browserLocalPersistence:u.browserSessionPersistence)}signInWithCustomToken(e){return(0,u.signInWithCustomToken)(this._auth,e)}signInWithEmailAndPassword(e,t){return(0,u.signInWithEmailAndPassword)(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return(0,u.signOut)(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=u.EmailAuthProvider.credential(this.loggedUser.email,e);return(0,u.reauthenticateWithCredential)(this.loggedUser,r).then(()=>(0,u.updatePassword)(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.updateProfile)(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[X.APPLE]:new u.OAuthProvider("apple.com"),[X.FACEBOOK]:new u.FacebookAuthProvider().setCustomParameters({prompt:"select_account"}),[X.GOOGLE]:new u.GoogleAuthProvider().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===Fe.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=Fe["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:c(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===le.POPUP?u.signInWithPopup:u.signInWithRedirect)(this._auth,e).then(s=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),s.user)).catch(async s=>s?.code===Fe.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,le.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,s),await this._expandDifferentCredential(s),Promise.reject(s)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}}});var Xr,kt,ye,Mt=y(()=>{"use strict";Xr=require("rxjs"),kt=require("ts-luxon");lt();dt();ye=class extends Q{static{c(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(e){return this._readRaw(e).pipe((0,Xr.map)(t=>{if(this._isSmpCachedValue(t)){if(t.expiry>=kt.DateTime.now().ts)return t.value;this._removeRaw(e).subscribe();return}return t}))}remove(e){return this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0)return this._writeRaw(e,t,r);let s=kt.DateTime.now().ts+r*1e3,o={value:t,expiry:s};return this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Ce(e)}}});function Hr(i,e){return t=>t.pipe((0,st.catchError)(r=>(typeof i==typeof isNaN?Zs(i)?Xs(r,i):i(r):!1)?e(r):(0,st.throwError)(()=>r)))}function Zs(i){try{return Reflect.construct(String,[],i),!0}catch{return!1}}function Xs(i,e){return typeof i=="object"&&i!==null&&i.constructor===e}var st,Jr=y(()=>{"use strict";st=require("rxjs");c(Hr,"smpRxjsCatchOnly");c(Zs,"isConstructor");c(Xs,"isExactInstance")});var S,it,Yr=y(()=>{"use strict";S=require("rxjs");Mt();it=class extends ye{static{c(this,"SmpRxjsInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){return(0,S.defer)(()=>(this._staticSelf._storage.clear(),(0,S.of)(void 0)))}_readRaw(e){return(0,S.defer)(()=>(0,S.of)(this._staticSelf._storage.get(e)))}_removeRaw(e){return(0,S.defer)(()=>(this._staticSelf._storage.delete(e),(0,S.of)(void 0)))}_writeRaw(e,t){return(0,S.defer)(()=>(this._staticSelf._storage.set(e,t),(0,S.of)(void 0)))}}});function ot(i=Js){return e=>e.pipe((0,Qr.map)(t=>{if(~Hs.indexOf(JSON.stringify(t)))throw i(t);return t}))}var Qr,Hs,Js,jt=y(()=>{"use strict";Qr=require("rxjs");c(ot,"smpRxjsThrowIfEmpty");Hs=[void 0,null,!1,0,"","0",[],{}].map(i=>JSON.stringify(i)),Js=c(()=>new Error,"defaultErrorFactory")});function es(i,e){return t=>t.pipe((0,nt.filter)(r=>!i(r)),(0,nt.defaultIfEmpty)(!1),ot(e))}var nt,ts=y(()=>{"use strict";nt=require("rxjs");jt();c(es,"smpRxjsThrowOnCondition")});var xe={};Oe(xe,{SmpAbstractRxjsTtlCacheStrategy:()=>ye,SmpRxjsInMemoryCache:()=>it,smpRxjsCatchOnly:()=>Hr,smpRxjsThrowIfEmpty:()=>ot,smpRxjsThrowOnCondition:()=>es});var Ee=y(()=>{"use strict";Mt();Jr();Yr();jt();ts()});var R,Y,at,Ys,rs=y(()=>{"use strict";R=gs(require("zod"),1),Y=require("ts-luxon"),at=class i extends R.default.ZodType{static{c(this,"SmpZodDateTime")}constructor(e){super({typeName:"SmpZodDateTime",coerce:e?.coerce??!1,checks:e?.checks??[]})}_parse(e){let t=this._getOrReturnCtx(e),r=t.data;if(this._def.coerce&&(r=this._coerceToDateTime(r),!(r instanceof Y.DateTime)||!r.isValid))return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Invalid date format"}),R.default.INVALID;if((!(r instanceof Y.DateTime)||!r.isValid)&&!this._def.coerce)return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Input must be a valid DateTime object"}),R.default.INVALID;let s={min:c((o,n,a)=>{if(o.min&&n<o.min)return{code:R.ZodIssueCode.too_small,minimum:o.min.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2265 ${o.min.toISODate()}`,path:a.path}},"min"),max:c((o,n,a)=>{if(o.max&&n>o.max)return{code:R.ZodIssueCode.too_big,maximum:o.max.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2264 ${o.max.toISODate()}`,path:a.path}},"max"),between:c((o,n,a)=>{if(o.min&&o.max&&(n<o.min||n>o.max))return{code:R.ZodIssueCode.custom,message:o.message??`Date must be between ${o.min.toISODate()} and ${o.max.toISODate()}`,path:a.path}},"between")};for(let o of this._def.checks)if(r instanceof Y.DateTime&&r.isValid){let n=s[o.kind](o,r,t);n&&R.default.addIssueToContext(t,n)}return t.common.issues.length>0?R.default.INVALID:R.default.OK(r)}between(e,t,r){return new i({...this._def,checks:[...this._def.checks,{kind:"between",min:e.toUTC(),max:t.toUTC(),message:r}]})}coerce(){return new i({...this._def,coerce:!0})}max(e,t){return new i({...this._def,checks:[...this._def.checks,{kind:"max",max:e.toUTC(),message:t}]})}min(e,t){return new i({...this._def,checks:[...this._def.checks,{kind:"min",min:e.toUTC(),message:t}]})}_coerceToDateTime(e){if(e instanceof Y.DateTime&&e.isValid)return e;let t={string:c(()=>Y.DateTime.fromJSDate(new Date(e)),"string"),number:c(()=>Y.DateTime.fromMillis(e),"number"),object:c(()=>Y.DateTime.fromJSDate(e),"object"),default:c(()=>null,"default")};return(t[typeof e]||t.default)()}},Ys=c((i={})=>new at({coerce:i.coerce??!1,checks:[]}),"smpZodDateTime")});var Lt={};Oe(Lt,{SmpZodDateTime:()=>at,smpZodDateTime:()=>Ys});var zt=y(()=>{"use strict";rs()});var ei={};Oe(ei,{SMP_HEALTHZ:()=>xs,SmpAbstractCacheStrategy:()=>Q,SmpAbstractTtlCacheStrategy:()=>ee,SmpAesCrypt:()=>ge,SmpApiCommonUtils:()=>_t,SmpBrowserCache:()=>Be,SmpCommonUtils:()=>vt,SmpCrypto:()=>Je,SmpErrorResponse:()=>z,SmpFilterException:()=>Dt,SmpFirebaseErrors:()=>Fe,SmpGenericResponse:()=>he,SmpGiftcardTransaction:()=>et,SmpGiftcardTransactionHashStrategies:()=>ne,SmpGiftcardTransactionOps:()=>v,SmpHttpService:()=>pt,SmpHttpSessionStorageCache:()=>ve,SmpHttpStatusCodes:()=>ut,SmpInMemoryCache:()=>De,SmpMarketingCloudValidators:()=>bs,SmpRegularExpressions:()=>Tt,SmpResponseMessage:()=>U,SmpResponseMessageTypes:()=>V,SmpRestVerbs:()=>wt,SmpSecureCode:()=>Ye,SmpSid:()=>Nt,SmpSocialSignInKeys:()=>X,SmpSocialSignInUxModes:()=>le,VERSION:()=>Qs,smpIsSmpCachedValue:()=>Ce,smpNoop:()=>O});module.exports=L(ei);var Ie=require("class-transformer");var q=require("class-transformer");var ht=require("class-transformer");var V=function(i){return i.INFO="INFO",i.SUCCESS="SUCCESS",i.WARNING="WARNING",i.ERROR="ERROR",i}({});function Xt(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(Xt,"_ts_decorate");function Me(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Me,"_ts_metadata");var U=class i{static{c(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(e,t=V.ERROR){this._message=e,this._type=t}static sanitizeMessages(e){return typeof e=="string"?e.length?[new i(e)]:[]:[e].flat().map(t=>typeof t=="string"?new i(t):t)}};Xt([(0,ht.Expose)(),Me("design:type",String),Me("design:paramtypes",[])],U.prototype,"message",null);Xt([(0,ht.Expose)(),Me("design:type",typeof V>"u"?Object:V),Me("design:paramtypes",[])],U.prototype,"type",null);function _s(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(_s,"_ts_decorate");function Ht(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Ht,"_ts_metadata");var he=class i{static{c(this,"SmpGenericResponse")}_messages;data;set messages(e){this._messages=U.sanitizeMessages(e)}get messages(){return this._messages}constructor(e=[],t){this._messages=e,this.data=t}static buildInfo(e,t){return new i([e].flat().map(r=>new U(r,V.INFO)),t)}static buildSuccess(e,t){return new i([e].flat().map(r=>new U(r,V.SUCCESS)),t)}static fromPlain(e){return(0,q.plainToInstance)(i,e)}isError(){return!this.isSuccess()}isSuccess(){return"_errorCode"in this&&this._errorCode!==null&&this._errorCode!==void 0}serialize(){return(0,q.instanceToPlain)(this,{excludePrefixes:["_"]})}};_s([(0,q.Expose)(),(0,q.Transform)(({value:i})=>i?.length?i:void 0),Ht("design:type",Object),Ht("design:paramtypes",[])],he.prototype,"messages",null);function Jt(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(Jt,"_ts_decorate");function je(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(je,"_ts_metadata");var z=class i extends he{static{c(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new U("GENERIC_ERROR")]}get errorCode(){return this._errorCode}get status(){return this._status}get timestamp(){return this._timestamp}_timestamp;constructor(e=i.DEFAULT_MESSAGES,t="GENERIC_ERROR",r=500,s){super(e,s),this._errorCode=t,this._status=r,this._timestamp=Date.now()}static create({messages:e=i.DEFAULT_MESSAGES,...t}={}){return new i(U.sanitizeMessages(e),t.errorCode,t.status,t.data)}static fromPlain(e){let t=(0,Ie.plainToInstance)(ws,e,{excludePrefixes:["_"]}),r=new i;return Object.getOwnPropertyNames(t).forEach(s=>{s in r&&(r[s]=t[s])}),r}};Jt([(0,Ie.Expose)(),je("design:type",Object),je("design:paramtypes",[])],z.prototype,"errorCode",null);Jt([(0,Ie.Expose)(),je("design:type",Number),je("design:paramtypes",[])],z.prototype,"timestamp",null);var ws=class extends z{static{c(this,"SmpErrorResponseMutable")}set errorCode(e){this._errorCode=e}set status(e){this._status=e}set timestamp(e){this._timestamp=e}};var ft=require("ts-luxon");lt();dt();var ee=class extends Q{static{c(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(e){let t=this._readRaw(e);if(this._isSmpCachedValue(t)){if(t.expiry>=ft.DateTime.now().ts)return t.value;this._removeRaw(e);return}return t}remove(e){this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0){this._writeRaw(e,t,r);return}let s=ft.DateTime.now().ts+r*1e3,o={value:t,expiry:s};this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Ce(e)}};var Be=class extends ee{static{c(this,"SmpBrowserCache")}_storage;_prefix;constructor(e,t){super(),this._storage=e,this._prefix=t}_flushRaw(){let e=[],t=-1;for(;++t<this._storage.length;){let r=this._storage.key(t);r&&r.startsWith(this._prefix)&&e.push(r)}for(t=-1;++t<e.length;)this._storage.removeItem(e[t])}_readRaw(e){let t=this._storage.getItem(this._prefix+e);try{return t?JSON.parse(t):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+e}`);return}}_removeRaw(e){this._storage.removeItem(this._prefix+e)}_writeRaw(e,t){try{this._storage.setItem(this._prefix+e,JSON.stringify(t))}catch(r){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+e}`,r)}}};var ve=class extends Be{static{c(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var De=class extends ee{static{c(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(e){return this._staticSelf._storage.get(e)}_removeRaw(e){this._staticSelf._storage.delete(e)}_writeRaw(e,t){this._staticSelf._storage.set(e,t)}};var pt=class{static{c(this,"SmpHttpService")}static _cachePrefix="smp_rest_cache_";static _cacheStrategy=typeof sessionStorage<"u"?new ve:new De;static _config={cachePrefix:this._cachePrefix,shared:new Map};static _errorClass=z;static _mergeParamsFallbackBaseUrl="https://ts-mapi-core.com";static $http(e){return this._generateAjax(e)}static async _generateAjax(e){if(e.cacheKey){let t=this._cacheRead(e.cacheKey);return t?Promise.resolve(t):this._generateAjaxBase(e).then(r=>(e.cacheKey&&this._cacheWrite(e.cacheKey,r),r))}return this._generateAjaxBase(e)}static async _generateAjaxBase(e){let t=await this._preprocessRequest(e),r={method:t.method,headers:new Headers({"content-type":"application/json",...t.headers}),body:t.body?JSON.stringify(t.body):null};return t.useCredentials&&(r.credentials="include"),t.url=this.mergeQueryParams(t.url,t.queryParams),fetch(t.url,r).then(s=>this._preprocessResponse(e,s)).then(s=>{if(s.ok){if(s.status===204||s.headers.get("content-length")==="0")return null;switch(t.responseType){case"blob":return s.blob();case"arraybuffer":return s.arrayBuffer();case"text":return s.text();case"json":default:return s.json()}}return s.json().then(o=>{let n=o;try{n=this._errorClass.fromPlain(o)}catch(a){console.debug("http: failed to parse error response into ErrorResponse",a)}return Promise.reject({status:s.status,message:s.statusText,body:n})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(e,t){let r=e.startsWith("http");if(t){let s=new URL(e,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),o=Object.fromEntries(s.searchParams.entries());s.search=new URLSearchParams({...o,...Object.fromEntries(Object.entries(t).map(([n,a])=>[n,`${a}`]))}).toString(),e=r?s.href:s.pathname+s.search}return e}static _cacheKey(e){return`${this._config.cachePrefix}${e}`}static _cachePop(e){let t=this._cacheRead(e);return this._cacheRemove(e),t}static _cacheRead(e){return this._cacheStrategy.read(this._cacheKey(e))}static _cacheRemove(e){this._cacheStrategy.remove(this._cacheKey(e))}static _cacheWrite(e,t){this._cacheStrategy.write(this._cacheKey(e),t)}static async _preprocessRequest(e){return e}static async _preprocessResponse(e,t){return t}};var ut=function(i){return i[i.Continue=100]="Continue",i[i.SwitchingProtocols=101]="SwitchingProtocols",i[i.Processing=102]="Processing",i[i.EarlyHints=103]="EarlyHints",i[i.Ok=200]="Ok",i[i.Created=201]="Created",i[i.Accepted=202]="Accepted",i[i.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",i[i.NoContent=204]="NoContent",i[i.ResetContent=205]="ResetContent",i[i.PartialContent=206]="PartialContent",i[i.MultiStatus=207]="MultiStatus",i[i.AlreadyReported=208]="AlreadyReported",i[i.ImUsed=226]="ImUsed",i[i.MultipleChoices=300]="MultipleChoices",i[i.MovedPermanently=301]="MovedPermanently",i[i.Found=302]="Found",i[i.SeeOther=303]="SeeOther",i[i.NotModified=304]="NotModified",i[i.UseProxy=305]="UseProxy",i[i.Unused=306]="Unused",i[i.TemporaryRedirect=307]="TemporaryRedirect",i[i.PermanentRedirect=308]="PermanentRedirect",i[i.BadRequest=400]="BadRequest",i[i.Unauthorized=401]="Unauthorized",i[i.PaymentRequired=402]="PaymentRequired",i[i.Forbidden=403]="Forbidden",i[i.NotFound=404]="NotFound",i[i.MethodNotAllowed=405]="MethodNotAllowed",i[i.NotAcceptable=406]="NotAcceptable",i[i.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",i[i.RequestTimeout=408]="RequestTimeout",i[i.Conflict=409]="Conflict",i[i.Gone=410]="Gone",i[i.LengthRequired=411]="LengthRequired",i[i.PreconditionFailed=412]="PreconditionFailed",i[i.PayloadTooLarge=413]="PayloadTooLarge",i[i.UriTooLong=414]="UriTooLong",i[i.UnsupportedMediaType=415]="UnsupportedMediaType",i[i.RangeNotSatisfiable=416]="RangeNotSatisfiable",i[i.ExpectationFailed=417]="ExpectationFailed",i[i.ImATeapot=418]="ImATeapot",i[i.MisdirectedRequest=421]="MisdirectedRequest",i[i.UnprocessableEntity=422]="UnprocessableEntity",i[i.Locked=423]="Locked",i[i.FailedDependency=424]="FailedDependency",i[i.TooEarly=425]="TooEarly",i[i.UpgradeRequired=426]="UpgradeRequired",i[i.PreconditionRequired=428]="PreconditionRequired",i[i.TooManyRequests=429]="TooManyRequests",i[i.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",i[i.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",i[i.InternalServerError=500]="InternalServerError",i[i.NotImplemented=501]="NotImplemented",i[i.BadGateway=502]="BadGateway",i[i.ServiceUnavailable=503]="ServiceUnavailable",i[i.GatewayTimeout=504]="GatewayTimeout",i[i.HttpVersionNotSupported=505]="HttpVersionNotSupported",i[i.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",i[i.InsufficientStorage=507]="InsufficientStorage",i[i.LoopDetected=508]="LoopDetected",i[i.NotExtended=510]="NotExtended",i[i.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",i}({});Pe();var _t=class{static{c(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new Z;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(e,t){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}static fromBearer(e=""){return e.split(" ")[1]}static getCountryFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[1]}static getLocaleFromReferer(e){return e?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(e,t){try{return e.replace(this._pathParamRegex,(r,s)=>{let o=t[s];return o!==void 0?encodeURIComponent(o):r})}catch(r){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,r)}return e}};var xs={status:"OK"};var wt=function(i){return i.GET="GET",i.POST="POST",i.PUT="PUT",i.DELETE="DELETE",i.PATCH="PATCH",i}({});var H=class{static{c(this,"Hex")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s+=2)r[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new _(r,t/2)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push((s>>>4).toString(16)),t.push((s&15).toString(16))}return t.join("")}};var _=class yt{static{c(this,"WordArray")}constructor(e,t){this.words=e||[],t!==void 0?this.sigBytes=t:this.sigBytes=this.words.length*4}static random(e){let t=[],r=c(function(s){let o=987654321,n=4294967295;return function(){o=36969*(o&65535)+(o>>16)&n,s=18e3*(s&65535)+(s>>16)&n;let a=(o<<16)+s&n;return a/=4294967296,a+=.5,a*(Math.random()>.5?1:-1)}},"r");for(let s=0,o;s<e;s+=4){let n=r((o||Math.random())*4294967296);o=n()*987654071,t.push(n()*4294967296|0)}return new yt(t,e)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new yt(this.words.slice(0),this.sigBytes)}concat(e){if(this.clamp(),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let r=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];return this.sigBytes+=e.sigBytes,this}toString(e){return(e||H).stringify(this)}};var Se=class{static{c(this,"Latin1")}static parse(e){let t=e.length,r=[];for(let s=0;s<t;s++)r[s>>>2]|=(e.charCodeAt(s)&255)<<24-s%4*8;return new _(r,t)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let s=e.words[r>>>2]>>>24-r%4*8&255;t.push(String.fromCharCode(s))}return t.join("")}};var I=class{static{c(this,"Utf8")}static parse(e){return Se.parse(unescape(encodeURIComponent(e)))}static stringify(e){try{return decodeURIComponent(escape(Se.stringify(e)))}catch(t){throw console.error("Malformed UTF-8 data",t),new Error("Malformed UTF-8 data")}}};var We=class{static{c(this,"BufferedBlockAlgorithm")}constructor(e){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},e),this._data=new _,this._nDataBytes=0}clone(){let e=this.constructor();for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e[t]=this[t]);return e._data=this._data.clone(),e}reset(){this._data=new _,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=I.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let t=this.cfg.blockSize*4,r=this._data.sigBytes/t;e?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);let s=r*this.cfg.blockSize,o=Math.min(s*4,this._data.sigBytes),n;if(s){for(let a=0;a<s;a+=this.cfg.blockSize)this._doProcessBlock(this._data.words,a);n=this._data.words.splice(0,s),this._data.sigBytes-=o}return new _(n,o)}};var de=class{static{c(this,"CipherParams")}constructor(e){this.ciphertext=e.ciphertext,this.key=e.key,this.iv=e.iv,this.salt=e.salt,this.algorithm=e.algorithm,this.mode=e.mode,this.padding=e.padding,this.blockSize=e.blockSize,this.formatter=e.formatter}extend(e){return e.ciphertext!==void 0&&(this.ciphertext=e.ciphertext),e.key!==void 0&&(this.key=e.key),e.iv!==void 0&&(this.iv=e.iv),e.salt!==void 0&&(this.salt=e.salt),e.algorithm!==void 0&&(this.algorithm=e.algorithm),e.mode!==void 0&&(this.mode=e.mode),e.padding!==void 0&&(this.padding=e.padding),e.blockSize!==void 0&&(this.blockSize=e.blockSize),e.formatter!==void 0&&(this.formatter=e.formatter),this}toString(e){if(e)return e.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var W=class{static{c(this,"Base64")}static parse(e){let t=e.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let s=0;s<this._map.length;s++)this._reverseMap[this._map.charCodeAt(s)]=s}let r=this._map.charAt(64);if(r){let s=e.indexOf(r);s!==-1&&(t=s)}return this.parseLoop(e,t,this._reverseMap)}static parseLoop(e,t,r){let s=[],o=0;for(let n=0;n<t;n++)if(n%4){let a=r[e.charCodeAt(n-1)]<<n%4*2,h=r[e.charCodeAt(n)]>>>6-n%4*2;s[o>>>2]|=(a|h)<<24-o%4*8,o++}return new _(s,o)}static stringify(e){e.clamp();let t=[];for(let s=0;s<e.sigBytes;s+=3){let o=e.words[s>>>2]>>>24-s%4*8&255,n=e.words[s+1>>>2]>>>24-(s+1)%4*8&255,a=e.words[s+2>>>2]>>>24-(s+2)%4*8&255,h=o<<16|n<<8|a;for(let p=0;p<4&&s+p*.75<e.sigBytes;p++)t.push(this._map.charAt(h>>>6*(3-p)&63))}let r=this._map.charAt(64);if(r)for(;t.length%4;)t.push(r);return t.join("")}};W._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";W._reverseMap=void 0;var Ke=class{static{c(this,"OpenSSL")}static parse(e){let t=W.parse(e),r;return t.words[0]===1398893684&&t.words[1]===1701076831&&(r=new _(t.words.slice(2,4)),t.words.splice(0,4),t.sigBytes-=16),new de({ciphertext:t,salt:r})}static stringify(e){if(!e.ciphertext)throw new Error("missing ciphertext in params");let t=e.ciphertext,r=e.salt,s;if(r){if(typeof r=="string")throw new Error("salt is expected to be a WordArray");s=new _([1398893684,1701076831]).concat(r).concat(t)}else s=t;return s.toString(W)}};var te=class{static{c(this,"SerializableCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(!o.format)throw new Error("could not determine format");if(t=this._parse(t,o.format),!t.ciphertext)throw new Error("could not determine ciphertext");return e.createDecryptor(r,o).finalize(t.ciphertext)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s),n=e.createEncryptor(r,o),a=n.finalize(t);return new de({ciphertext:a,key:r,iv:n.cfg.iv,algorithm:e,mode:n.cfg.mode,padding:n.cfg.padding,blockSize:n.cfg.blockSize,formatter:o.format})}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};te.cfg={blockSize:4,iv:new _([]),format:Ke};var b=class extends We{static{c(this,"Hasher")}constructor(e){super(Object.assign({blockSize:512/32},e)),this.reset()}static _createHelper(e){function t(r,s){return new e(s).finalize(r)}return c(t,"helper"),t}finalize(e){return e&&this._append(e),this._doFinalize()}update(e){return this._append(e),this._process(),this}};var d=[];for(let i=0;i<64;i++)d[i]=Math.abs(Math.sin(i+1))*4294967296|0;var K=class f extends b{static{c(this,"MD5")}get hash(){return this._hash}static FF(e,t,r,s,o,n,a){let h=e+(t&r|~t&s)+o+a;return(h<<n|h>>>32-n)+t}static GG(e,t,r,s,o,n,a){let h=e+(t&s|r&~s)+o+a;return(h<<n|h>>>32-n)+t}static HH(e,t,r,s,o,n,a){let h=e+(t^r^s)+o+a;return(h<<n|h>>>32-n)+t}static II(e,t,r,s,o,n,a){let h=e+(r^(t|~s))+o+a;return(h<<n|h>>>32-n)+t}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;this._data.words[t>>>5]|=128<<24-t%32;let r=Math.floor(e/4294967296),s=e;this._data.words[(t+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,this._data.words[(t+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let o=0;o<4;o++)this._hash.words[o]=(this._hash.words[o]<<8|this._hash.words[o]>>>24)&16711935|(this._hash.words[o]<<24|this._hash.words[o]>>>8)&4278255360;return this._hash}_doProcessBlock(e,t){for(let h=0;h<16;h++){let p=t+h,g=e[p];e[p]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let r=Array.from({length:16});for(let h=0;h<16;h++)r[h]=e[t+h];let s=this._hash.words[0],o=this._hash.words[1],n=this._hash.words[2],a=this._hash.words[3];s=f.FF(s,o,n,a,r[0],7,d[0]),a=f.FF(a,s,o,n,r[1],12,d[1]),n=f.FF(n,a,s,o,r[2],17,d[2]),o=f.FF(o,n,a,s,r[3],22,d[3]),s=f.FF(s,o,n,a,r[4],7,d[4]),a=f.FF(a,s,o,n,r[5],12,d[5]),n=f.FF(n,a,s,o,r[6],17,d[6]),o=f.FF(o,n,a,s,r[7],22,d[7]),s=f.FF(s,o,n,a,r[8],7,d[8]),a=f.FF(a,s,o,n,r[9],12,d[9]),n=f.FF(n,a,s,o,r[10],17,d[10]),o=f.FF(o,n,a,s,r[11],22,d[11]),s=f.FF(s,o,n,a,r[12],7,d[12]),a=f.FF(a,s,o,n,r[13],12,d[13]),n=f.FF(n,a,s,o,r[14],17,d[14]),o=f.FF(o,n,a,s,r[15],22,d[15]),s=f.GG(s,o,n,a,r[1],5,d[16]),a=f.GG(a,s,o,n,r[6],9,d[17]),n=f.GG(n,a,s,o,r[11],14,d[18]),o=f.GG(o,n,a,s,r[0],20,d[19]),s=f.GG(s,o,n,a,r[5],5,d[20]),a=f.GG(a,s,o,n,r[10],9,d[21]),n=f.GG(n,a,s,o,r[15],14,d[22]),o=f.GG(o,n,a,s,r[4],20,d[23]),s=f.GG(s,o,n,a,r[9],5,d[24]),a=f.GG(a,s,o,n,r[14],9,d[25]),n=f.GG(n,a,s,o,r[3],14,d[26]),o=f.GG(o,n,a,s,r[8],20,d[27]),s=f.GG(s,o,n,a,r[13],5,d[28]),a=f.GG(a,s,o,n,r[2],9,d[29]),n=f.GG(n,a,s,o,r[7],14,d[30]),o=f.GG(o,n,a,s,r[12],20,d[31]),s=f.HH(s,o,n,a,r[5],4,d[32]),a=f.HH(a,s,o,n,r[8],11,d[33]),n=f.HH(n,a,s,o,r[11],16,d[34]),o=f.HH(o,n,a,s,r[14],23,d[35]),s=f.HH(s,o,n,a,r[1],4,d[36]),a=f.HH(a,s,o,n,r[4],11,d[37]),n=f.HH(n,a,s,o,r[7],16,d[38]),o=f.HH(o,n,a,s,r[10],23,d[39]),s=f.HH(s,o,n,a,r[13],4,d[40]),a=f.HH(a,s,o,n,r[0],11,d[41]),n=f.HH(n,a,s,o,r[3],16,d[42]),o=f.HH(o,n,a,s,r[6],23,d[43]),s=f.HH(s,o,n,a,r[9],4,d[44]),a=f.HH(a,s,o,n,r[12],11,d[45]),n=f.HH(n,a,s,o,r[15],16,d[46]),o=f.HH(o,n,a,s,r[2],23,d[47]),s=f.II(s,o,n,a,r[0],6,d[48]),a=f.II(a,s,o,n,r[7],10,d[49]),n=f.II(n,a,s,o,r[14],15,d[50]),o=f.II(o,n,a,s,r[5],21,d[51]),s=f.II(s,o,n,a,r[12],6,d[52]),a=f.II(a,s,o,n,r[3],10,d[53]),n=f.II(n,a,s,o,r[10],15,d[54]),o=f.II(o,n,a,s,r[1],21,d[55]),s=f.II(s,o,n,a,r[8],6,d[56]),a=f.II(a,s,o,n,r[15],10,d[57]),n=f.II(n,a,s,o,r[6],15,d[58]),o=f.II(o,n,a,s,r[13],21,d[59]),s=f.II(s,o,n,a,r[4],6,d[60]),a=f.II(a,s,o,n,r[11],10,d[61]),n=f.II(n,a,s,o,r[2],15,d[62]),o=f.II(o,n,a,s,r[9],21,d[63]),this._hash.words[0]=this._hash.words[0]+s|0,this._hash.words[1]=this._hash.words[1]+o|0,this._hash.words[2]=this._hash.words[2]+n|0,this._hash.words[3]=this._hash.words[3]+a|0}};var xt=class cr{static{c(this,"EVPKDF")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:K,iterations:1},e)}static execute(e,t,r){return new cr(r).compute(e,t)}compute(e,t){let r=new this.cfg.hasher,s=new _,o;for(;s.words.length<this.cfg.keySize;){o&&r.update(o),o=r.update(e).finalize(t),r.reset();for(let n=1;n<this.cfg.iterations;n++)o=r.finalize(o),r.reset();s.concat(o)}return s.sigBytes=this.cfg.keySize*4,s}};var hr=class{static{c(this,"OpenSSLKdf")}static execute(e,t,r,s){s||(s=_.random(64/8));let o=new xt({keySize:t+r}).compute(e,s),n=new _(o.words.slice(t),r*4);return o.sigBytes=t*4,new de({key:o,iv:n,salt:s})}};var Ge=class{static{c(this,"PasswordBasedCipher")}static decrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.format===void 0)throw new Error("missing format in config");if(t=this._parse(t,o.format),o.kdf===void 0)throw new Error("the key derivation function must be set");let n=o.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv!==void 0&&(o.iv=n.iv),te.decrypt.call(this,e,t,n.key,o)}static encrypt(e,t,r,s){let o=Object.assign({},this.cfg,s);if(o.kdf===void 0)throw new Error("missing kdf in config");let n=o.kdf.execute(r,e.keySize,e.ivSize);return n.iv!==void 0&&(o.iv=n.iv),te.encrypt.call(this,e,t,n.key,o).extend(n)}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};Ge.cfg={blockSize:4,iv:new _([]),format:Ke,kdf:hr};var lr=class{static{c(this,"CipherHelper")}constructor(e){this._cipher=e}decrypt(e,t,r){return typeof t=="string"?Ge.decrypt(this._cipher,e,t,r):te.decrypt(this._cipher,e,t,r)}encrypt(e,t,r){return typeof t=="string"?Ge.encrypt(this._cipher,e,t,r):te.encrypt(this._cipher,e,t,r)}};var fe=class extends We{static{c(this,"Cipher")}constructor(e,t,r){super(Object.assign({blockSize:1},r)),this._xformMode=e,this._key=t,this.reset()}static _createHelper(e){return new lr(e)}static createDecryptor(e,t){let r=this;return new r(this._DEC_XFORM_MODE,e,t)}static createEncryptor(e,t){return new this(this._ENC_XFORM_MODE,e,t)}finalize(e){return e&&this._append(e),this._doFinalize()}process(e){return this._append(e),this._process()}};fe.ivSize=4;fe.keySize=4;fe._DEC_XFORM_MODE=2;fe._ENC_XFORM_MODE=1;var re=class{static{c(this,"BlockCipherModeAlgorithm")}constructor(e,t){this.init(e,t)}init(e,t){this._cipher=e,this._iv=t}};var Ve=class{static{c(this,"BlockCipherMode")}static createDecryptor(e,t){let r=this.Decryptor;return new r(e,t)}static createEncryptor(e,t){let r=this.Encryptor;return new r(e,t)}};Ve.Decryptor=re;Ve.Encryptor=re;var dr=class extends re{static{c(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(e,t,this._cipher.cfg.blockSize),this._cipher.encryptBlock(e,t),this._prevBlock=e.slice(t,t+this._cipher.cfg.blockSize)}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var fr=class extends re{static{c(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let r=e.slice(t,t+this._cipher.cfg.blockSize);this._cipher.decryptBlock(e,t),this.xorBlock(e,t,this._cipher.cfg.blockSize),this._prevBlock=r}xorBlock(e,t,r){let s;this._iv?(s=this._iv,this._iv=void 0):s=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=s[o]}};var J=class extends Ve{static{c(this,"CBC")}};J.Decryptor=fr;J.Encryptor=dr;var pe=class{static{c(this,"PKCS7")}static pad(e,t){let r=t*4,s=r-e.sigBytes%r,o=s<<24|s<<16|s<<8|s,n=[];for(let h=0;h<s;h+=4)n.push(o);let a=new _(n,s);e.concat(a)}static unpad(e){let t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};var qe=class extends fe{static{c(this,"BlockCipher")}constructor(e,t,r){super(e,t,Object.assign({blockSize:4,mode:J,padding:pe},r))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let e;this._xformMode===this.constructor._ENC_XFORM_MODE?e=this.cfg.mode.createEncryptor:(e=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===e?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=e.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=e)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let e;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),e=this._process(!0)}else e=this._process(!0),this.cfg.padding.unpad(e);return e}_doProcessBlock(e,t){this._mode.processBlock(e,t)}};var l=class ${static{c(this,"X64Word")}constructor(e,t){this.high=e,this.low=t}add(e){let t=this.low+e.low|0,r=t>>>0<this.low>>>0?1:0,s=this.high+e.high+r|0;return new $(s,t)}and(e){return new $(this.high&e.high,this.low&e.low)}not(){return new $(~this.high,~this.low)}or(e){return new $(this.high|e.high,this.low|e.low)}rotL(e){return this.shiftL(e).or(this.shiftR(64-e))}rotR(e){return this.shiftR(e).or(this.shiftL(64-e))}shiftL(e){return e<32?new $(this.high<<e|this.low>>>32-e,this.low<<e):new $(this.low<<e-32,0)}shiftR(e){return e<32?new $(this.high>>>e,this.low>>>e|this.high<<32-e):new $(0,this.high>>>e-32)}xor(e){return new $(this.high^e.high,this.low^e.low)}};var pr=class Et{static{c(this,"X64WordArray")}constructor(e=[],t){this.words=e,this.sigBytes=t!==void 0?t:e.length*8}static create(e=[],t){return new Et(e,t)}clone(){let e=this.words.map(t=>new l(t.high,t.low));return new Et(e,this.sigBytes)}toX32(){let e=[];for(let t of this.words)e.push(t.high,t.low);return new _(e,this.sigBytes)}};var B=[],ur=[],mr=[],gr=[],_r=[],wr=[],Rt=[],At=[],bt=[],Ot=[];(function(){let i=[];for(let r=0;r<256;r++)r<128?i[r]=r<<1:i[r]=r<<1^283;let e=0,t=0;for(let r=0;r<256;r++){let s=t^t<<1^t<<2^t<<3^t<<4;s=s>>>8^s&255^99,B[e]=s,ur[s]=e;let o=i[e],n=i[o],a=i[n],h=i[s]*257^s*16843008;mr[e]=h<<24|h>>>8,gr[e]=h<<16|h>>>16,_r[e]=h<<8|h>>>24,wr[e]=h,h=a*16843009^n*65537^o*257^e*16843008,Rt[s]=h<<24|h>>>8,At[s]=h<<16|h>>>16,bt[s]=h<<8|h>>>24,Ot[s]=h,e?(e=o^i[i[i[a^o]]],t^=i[i[t]]):e=t=1}})();var Es=[0,1,2,4,8,16,32,64,128,27,54],Ze=class extends qe{static{c(this,"AES")}constructor(e,t,r){super(e,t,r),super.reset()}decryptBlock(e,t){let r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,Rt,At,bt,Ot,ur),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r}encryptBlock(e,t){this._doCryptBlock(e,t,this._keySchedule,mr,gr,_r,wr,B)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,o=((this._nRounds=r+6)+1)*4,n=this._keySchedule=[];for(let a=0;a<o;a++)if(a<r)n[a]=t[a];else{let h=n[a-1];a%r?r>6&&a%r===4&&(h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255]):(h=h<<8|h>>>24,h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255],h^=Es[a/r|0]<<24),n[a]=n[a-r]^h}this._invKeySchedule=[];for(let a=0;a<o;a++){let h=o-a,p;a%4?p=n[h]:p=n[h-4],a<4||h<=4?this._invKeySchedule[a]=p:this._invKeySchedule[a]=Rt[B[p>>>24]]^At[B[p>>>16&255]]^bt[B[p>>>8&255]]^Ot[B[p&255]]}}_doCryptBlock(e,t,r,s,o,n,a,h){let p=e[t]^r[0],g=e[t+1]^r[1],m=e[t+2]^r[2],w=e[t+3]^r[3],A=4;for(let C=1;C<this._nRounds;C++){let x=s[p>>>24]^o[g>>>16&255]^n[m>>>8&255]^a[w&255]^r[A++],E=s[g>>>24]^o[m>>>16&255]^n[w>>>8&255]^a[p&255]^r[A++],F=s[m>>>24]^o[w>>>16&255]^n[p>>>8&255]^a[g&255]^r[A++],ct=s[w>>>24]^o[p>>>16&255]^n[g>>>8&255]^a[m&255]^r[A++];p=x,g=E,m=F,w=ct}let D=(h[p>>>24]<<24|h[g>>>16&255]<<16|h[m>>>8&255]<<8|h[w&255])^r[A++],j=(h[g>>>24]<<24|h[m>>>16&255]<<16|h[w>>>8&255]<<8|h[p&255])^r[A++],N=(h[m>>>24]<<24|h[w>>>16&255]<<16|h[p>>>8&255]<<8|h[g&255])^r[A++],T=(h[w>>>24]<<24|h[p>>>16&255]<<16|h[g>>>8&255]<<8|h[m&255])^r[A++];e[t]=D,e[t+1]=j,e[t+2]=N,e[t+3]=T}};Ze.keySize=256/32;var Rs=[1732584193,4023233417,2562383102,271733878,3285377520],se=new Array(80),ie=class extends b{static{c(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(Rs.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)se[h]=e[t+h]|0;else{let w=se[h-3]^se[h-8]^se[h-14]^se[h-16];se[h]=w<<1|w>>>31}let p,g;h<20?(p=s&o|~s&n,g=1518500249):h<40?(p=s^o^n,g=1859775393):h<60?(p=s&o|s&n|o&n,g=2400959708):(p=s^o^n,g=3395469782);let m=(r<<5|r>>>27)+p+a+g+se[h];a=n,n=o,o=s<<30|s>>>2,s=r,r=m|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0}};var yr=[],xr=[];(function(){function i(s){let o=Math.sqrt(s);for(let n=2;n<=o;n++)if(!(s%n))return!1;return!0}c(i,"isPrime");function e(s){return(s-(s|0))*4294967296|0}c(e,"getFractionalBits");let t=2,r=0;for(;r<64;)i(t)&&(r<8&&(yr[r]=e(Math.pow(t,1/2))),xr[r]=e(Math.pow(t,1/3)),r++),t++})();var oe=[],Ne=class extends b{static{c(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(yr.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],s=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4],h=this._hash.words[5],p=this._hash.words[6],g=this._hash.words[7];for(let m=0;m<64;m++){if(m<16)oe[m]=e[t+m]|0;else{let C=oe[m-15],x=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,E=oe[m-2],F=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;oe[m]=x+oe[m-7]+F+oe[m-16]}let w=a&h^~a&p,A=r&s^r&o^s&o,D=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),j=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),N=g+j+w+xr[m]+oe[m],T=D+A;g=p,p=h,h=a,a=n+N|0,n=o,o=s,s=r,r=N+T|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+s|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+p|0,this._hash.words[7]=this._hash.words[7]+g|0}};var It=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],M=[];(function(){for(let i=0;i<80;i++)M[i]=new l(void 0,void 0)})();var Ct=class extends b{static{c(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new pr([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let e=this._data,t=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;return t[s>>>5]|=128<<24-s%32,t[(s+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(s+128>>>10<<5)+31]=r,e.sigBytes=t.length*4,this._process(),this._hash.toX32()}_doProcessBlock(e,t){let r=this._hash.words[0].high,s=this._hash.words[0].low,o=this._hash.words[1].high,n=this._hash.words[1].low,a=this._hash.words[2].high,h=this._hash.words[2].low,p=this._hash.words[3].high,g=this._hash.words[3].low,m=this._hash.words[4].high,w=this._hash.words[4].low,A=this._hash.words[5].high,D=this._hash.words[5].low,j=this._hash.words[6].high,N=this._hash.words[6].low,T=this._hash.words[7].high,C=this._hash.words[7].low;for(let x=0;x<80;x++){let E,F;if(x<16)F=M[x].high=e[t+x*2]|0,E=M[x].low=e[t+x*2+1]|0;else{let Kt=M[x-15],ae=Kt.high,Re=Kt.low,hs=(ae>>>1|Re<<31)^(ae>>>8|Re<<24)^ae>>>7,Gt=(Re>>>1|ae<<31)^(Re>>>8|ae<<24)^(Re>>>7|ae<<25),Vt=M[x-2],ce=Vt.high,Ae=Vt.low,ls=(ce>>>19|Ae<<13)^(ce<<3|Ae>>>29)^ce>>>6,qt=(Ae>>>19|ce<<13)^(Ae<<3|ce>>>29)^(Ae>>>6|ce<<26);E=Gt+M[x-7].low,F=hs+M[x-7].high+(E>>>0<Gt>>>0?1:0),E=E+qt,F=F+ls+(E>>>0<qt>>>0?1:0),E=E+M[x-16].low,F=F+M[x-16].high+(E>>>0<M[x-16].low>>>0?1:0),M[x].high=F,M[x].low=E}let ct=m&A^~m&j,$t=w&D^~w&N,ss=r&o^r&a^o&a,is=s&n^s&h^n&h,os=(r>>>28|s<<4)^(r<<30|s>>>2)^(r<<25|s>>>7),St=(s>>>28|r<<4)^(s<<30|r>>>2)^(s<<25|r>>>7),ns=(m>>>14|w<<18)^(m>>>18|w<<14)^(m<<23|w>>>9),as=(w>>>14|m<<18)^(w>>>18|m<<14)^(w<<23|m>>>9),P=C+as,G=T+ns+(P>>>0<C>>>0?1:0);P=P+$t,G=G+ct+(P>>>0<$t>>>0?1:0),P=P+It[x].low,G=G+It[x].high+(P>>>0<It[x].low>>>0?1:0),P=P+E,G=G+F+(P>>>0<E>>>0?1:0);let Wt=St+is,cs=os+ss+(Wt>>>0<St>>>0?1:0);T=j,C=N,j=A,N=D,A=m,D=w,w=g+P|0,m=p+G+(w>>>0<g>>>0?1:0)|0,p=a,g=h,a=o,h=n,o=r,n=s,s=P+Wt|0,r=G+cs+(s>>>0<P>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+s,this._hash.words[0].high=this._hash.words[0].high+r+(this._hash.words[0].low>>>0<s>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+n,this._hash.words[1].high=this._hash.words[1].high+o+(this._hash.words[1].low>>>0<n>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+a+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+p+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+w,this._hash.words[4].high=this._hash.words[4].high+m+(this._hash.words[4].low>>>0<w>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+D,this._hash.words[5].high=this._hash.words[5].high+A+(this._hash.words[5].low>>>0<D>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+N,this._hash.words[6].high=this._hash.words[6].high+j+(this._hash.words[6].low>>>0<N>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+C,this._hash.words[7].high=this._hash.words[7].high+T+(this._hash.words[7].low>>>0<C>>>0?1:0)}};var Er=class{static{c(this,"HMAC")}constructor(e,t){this._hasher=new e;let r=typeof t=="string"?I.parse(t):t,s=this._hasher.cfg.blockSize,o=s*4;r.sigBytes>o&&(r=this._hasher.finalize(r)),r.clamp();let n=this._oKey=r.clone(),a=this._iKey=r.clone(),h=n.words,p=a.words;for(let g=0;g<s;g++)h[g]^=1549556828,p[g]^=909522486;n.sigBytes=a.sigBytes=o,this.reset()}finalize(e){let t=this._hasher.finalize(e);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(t))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(e){return this._hasher.update(e),this}};var Bt=class Rr{static{c(this,"PBKDF2")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:Ne,iterations:25e4},e)}static execute(e,t,r){return new Rr(r).compute(e,t)}compute(e,t){let r=this.cfg,s=new Er(r.hasher,e),o=new _,n=new _([1]),a=o.words,h=n.words,p=r.keySize,g=r.iterations;for(;a.length<p;){let m=s.update(t).finalize(n);s.reset();let w=m.words,A=w.length,D=m;for(let j=1;j<g;j++){D=s.finalize(D),s.reset();let N=D.words;for(let T=0;T<A;T++)w[T]^=N[T]}o.concat(m),h[0]++}return o.sigBytes=p*4,o}};var Te=qe._createHelper(Ze);var ue=b._createHelper(K);var me=b._createHelper(ie);var Xe=b._createHelper(Ne);var He=b._createHelper(Ct);var ge=class{static{c(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?H.parse(this._initVector):void 0}_mode;_padding;constructor(e,t,r){this._password=e,this._salt=t,this._initVector=r,this._mode=J,this._padding=pe}decryptAES(e){return Te.decrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(e){return Te.encrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return Bt.execute(this._password,H.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:ie})}};var Je=class{static{c(this,"SmpCrypto")}static base64Decode(e){return I.stringify(W.parse(e))}static base64Encode(e){return W.stringify(I.parse(e))}static md5(e){return ue(e).toString()}static sha1(e){return me(e).toString()}static sha256(e){return Xe(e).toString()}static sha512(e){return He(e).toString()}};var Ye=class{static{c(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength;_seed;constructor(e){this._baseCode=e,this._crcLength=5,this._seed="changeme"}static check(e,t){if(new this(e).secureCode!==t)throw z.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:ut.BadRequest})}_encode(){let e=new K;return e.update(I.parse(this._seed+this._baseCode)),e.finalize().toString(H).substring(0,this._crcLength).toUpperCase()}};var _e=require("class-transformer"),Qe=require("ts-luxon");var v=function(i){return i.ACTIVATE="ACTIVATE",i.BLOCK="BLOCK",i.CHECK="CHECK",i.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",i.FREEZE="FREEZE",i.PURCHASE="PURCHASE",i.RECHARGE="RECHARGE",i.ROLLBACK="ROLLBACK",i.TRANSACTION="TRANSACTION",i.TRANSACTION_DETAIL="TRANSACTION_DETAIL",i.UNFREEZE="UNFREEZE",i.XREFUND="XREFUND",i}({});var ne=function(i){return i.MD5="MD5",i.MD5_HMAC="MD5_HMAC",i.SHA1="SHA1",i.SHA1_HMAC="SHA1_HMAC",i}({});function As(i,e,t,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(As,"_ts_decorate");function Ar(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}c(Ar,"_ts_metadata");var et=class{static{c(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new ge("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _LOGGER=console;static _OP_CODES={[v.CHECK]:"",[v.TRANSACTION]:"",[v.TRANSACTION_DETAIL]:"",[v.ACTIVATE]:"A",[v.BLOCK]:"B",[v.DIGITAL_ACTIVATE]:"D",[v.FREEZE]:"F",[v.PURCHASE]:"P",[v.RECHARGE]:"G",[v.ROLLBACK]:"R",[v.UNFREEZE]:"U",[v.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies;_hashStrategy;constructor(e="ACTIVATION",t,r,s){this.gc=e,this.op=t,this.ot=r,this._hashStrategies={[ne.MD5]:o=>ue(o),[ne.MD5_HMAC]:o=>{let n=new K;return n.update(I.parse(o)),n.finalize()},[ne.SHA1]:o=>me(o),[ne.SHA1_HMAC]:o=>{let n=new ie;return n.update(I.parse(o)),n.finalize()}},this._hashStrategy=this._hashStrategies[ne.MD5],this._dto=typeof s=="number"&&s>=0?Qe.DateTime.fromMillis(+`${s}000`.slice(0,13)):Qe.DateTime.local()}static build({gc:e,op:t,ot:r,dto:s}){return new this(e,t,r,s?.ts)}static explode(e){let t=this.constructor,r=(e||"").split(t._SEP);if(r.length<4)throw new Error(`INVALID_TRANSACTION "${e}"`);return this.build({gc:r[1],op:t.prefixToOperation(r[2]),dto:Qe.DateTime.fromSeconds(+r[3])})}static isBase64(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)&&e.length%4===0}static parse(e){this._LOGGER.info(`${this.constructor.name}: trying to parse ${e}`);try{if(this.isBase64(e)){let t=this.constructor._AES_ENCODER.decryptAES(e),r=JSON.parse(t);return(0,_e.plainToInstance)(this,r)}else return this.explode(e)}catch(t){throw this._LOGGER.error(`${this.constructor.name}: failed to parse ${e}`,t),new Error(`UNPARSEABLE "${e}"`)}}static prefixToOperation(e){return Object.entries(this._OP_CODES).find(([,r])=>r===e)[0]}serialize(){return(0,_e.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let e=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(e)}};As([(0,_e.Expose)(),Ar("design:type",Number),Ar("design:paramtypes",[])],et.prototype,"ts",null);var bs=function(i){return i.ListDetectiveValidator="ListDetectiveValidator",i.MXValidator="MXValidator",i.SyntaxValidator="SyntaxValidator",i}({});var Os=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Or(i){return i.match(Os)}c(Or,"smpAsciiWords");var Pr="\\ud800-\\udfff",Is="\\u0300-\\u036f",Cs="\\ufe20-\\ufe2f",Bs="\\u20d0-\\u20ff",vs="\\u1ab0-\\u1aff",Ds="\\u1dc0-\\u1dff",Ps=Is+Cs+Bs+vs+Ds,Nr="\\u2700-\\u27bf",Tr="a-z\\xdf-\\xf6\\xf8-\\xff",Ns="\\xac\\xb1\\xd7\\xf7",Ts="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Fs="\\u2000-\\u206f",Us=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Fr="A-Z\\xc0-\\xd6\\xd8-\\xde",ks="\\ufe0e\\ufe0f",Ur=Ns+Ts+Fs+Us,kr="['\u2019]",Ir=`[${Ur}]`,Ms=`[${Ps}]`,Mr="\\d",js=`[${Nr}]`,jr=`[${Tr}]`,Lr=`[^${Pr}${Ur+Mr+Nr+Tr+Fr}]`,Ls="\\ud83c[\\udffb-\\udfff]",zs=`(?:${Ms}|${Ls})`,$s=`[^${Pr}]`,zr="(?:\\ud83c[\\udde6-\\uddff]){2}",$r="[\\ud800-\\udbff][\\udc00-\\udfff]",we=`[${Fr}]`,Ss="\\u200d",Cr=`(?:${jr}|${Lr})`,Ws=`(?:${we}|${Lr})`,Br=`(?:${kr}(?:d|ll|m|re|s|t|ve))?`,vr=`(?:${kr}(?:D|LL|M|RE|S|T|VE))?`,Sr=`${zs}?`,Wr=`[${ks}]?`,Ks=`(?:${Ss}(?:${[$s,zr,$r].join("|")})${Wr+Sr})*`,Gs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Vs="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qs=Wr+Sr+Ks,Dr=`(?:${[js,zr,$r].join("|")})${qs}`,Ue=class{static{c(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${we}?${jr}+${Br}(?=${[Ir,we,"$"].join("|")})`,`${Ws}+${vr}(?=${[Ir,we+Cr,"$"].join("|")})`,`${we}?${Cr}+${Br}`,`${we}+${vr}`,Vs,Gs,`${Mr}+`,Dr].join("|"),"g");static RS_EMOJI=Dr;static unicodeWords(e){return e.match(this.RE_UNICODE_WORDS)}};var vt=class i{static{c(this,"SmpCommonUtils")}static arrayRemove(e,t){let r=[],s=e.filter((o,n)=>t(o,n)&&r.push(n));return r.reverse().forEach(o=>e.splice(o,1)),s}static assertIsArray(e,t){if(!Array.isArray(e))throw new Error(t||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(e,t){if(!this.isBoolean(e))throw new Error(t||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(e,t){if(!this.isFunction(e))throw new Error(t||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(e,t,r){if(!(e instanceof t))throw new Error(r||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(e,t){if(this.isEmpty(e))throw new Error(t||`${this.constructor.name} => entity was empty`)}static assertIsNumber(e,t){if(typeof e!="number")throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(e,t){if(!this.isNumeric(e))throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsObject(e,t){if(!this.isObject(e))throw new Error(t||`${this.constructor.name} => val was not an object`)}static assertIsString(e,t){if(!this.isString(e))throw new Error(t||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(e,t){if(!e)throw new Error(t||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...e){let t=e.filter(r=>!!r).join("/").replace(/(?<!:)\/\/+/g,"/");return t.startsWith("http")&&!t.endsWith("/")?`${t}/`:t}static downloadBlob(e,t){let r=window.URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.setAttribute("download",t),document.body.appendChild(s),s.click()}static generateRandomHexString(e=12){let t="0123456789abcdef",r="";for(let s=0;s<e;s++){let o=Math.floor(Math.random()*t.length);r+=t[o]}return r}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}static getDecimalPrecision(e){if(this.assertIsNumeric(e),!isFinite(+e))return 0;let t=1,r=0;for(;Math.round(+e*t)/t!==e;)t*=10,r++;return r}static getType(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static isBoolean(e){return typeof e=="boolean"}static isColor(e){if(!e||!this.isString(e))return!1;let t=new Option().style;return t.color=e,t.color!==""}static isEmpty(e){return!e&&e!==0}static isEqual(e,t){function r(){if(e.length!==t.length)return!1;for(let h=0;h<e.length;h++)if(!i.isEqual(e[h],t[h]))return!1;return!0}c(r,"areArraysEqual");function s(){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let h in e)if(Object.prototype.hasOwnProperty.call(e,h)&&!i.isEqual(e[h],t[h]))return!1;return!0}c(s,"areObjectsEqual");function o(){return e.toString()===t.toString()}c(o,"areFunctionsEqual");function n(){return e===t}c(n,"arePrimativesEqual");let a=this.getType(e);return a!==this.getType(t)?!1:a==="array"?r():a==="object"?s():a==="function"?o():n()}static isFormField(e){return/^(?:input|select|textarea|button)$/i.test(e.nodeName)}static isFunction(e){return typeof e==typeof isNaN}static isNotEmpty(e){return!this.isEmpty(e)}static isNumber(e){return typeof e=="number"&&this.isNumeric(e)}static isNumeric(e){return!isNaN(e)}static isObject(e){return!!e&&e===Object(e)&&e.constructor===Object}static isPrimitive(e){let t=this.getType(e);return t!=="function"&&(t!=="object"||!e)}static isString(e){return typeof e=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(e,t){if(this.assertIsFunction(t,`CommonUtils => expected type of iteratee to be Function, got ${typeof t}`),this.isObject(e))return Object.entries(e).reduce((r,[s,o])=>(r.push(t(o,s)),r),[]);if(Array.isArray(e))return e.map(t);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof t}`)}static mapObjectKeys(e,t){return Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,s,o),r),{})}static mapObjectValues(e,t){return this.isObject(e)?Object.entries(e).reduce((r,[s,o])=>(r[s]=t.call(null,o,s),r),{}):{}}static noop(){}static objectHasValue(e,t){return!!~Object.values(e).filter(r=>this.isEqual(r,t))}static omit(e,t){return Object.keys(e).filter(s=>!t.includes(s)).reduce((s,o)=>(s[o]=e[o],s),{})}static parseBoolean(e){return e?/^true$/i.test(e):!1}static parseJsonSafely(e){try{return JSON.parse(e)}catch(t){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:e,error:t});return}}static pick(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}static runSafely(e,t=null,r=[]){if(this.isFunction(e))return e.apply(t,r)}static sleep(e){return new Promise(t=>setTimeout(t,e))}static sprintf(e,...t){return this.isString(e)&&t.length?this.sprintf(e.replace("%s",String(t.shift())),...t):e}static stripComments(e){return typeof e=="string"?e.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):e}static submitFakeForm({action:e,method:t=wt.POST,data:r,target:s}){let o=Object.entries(r||{}).map(([a,h])=>`<input name="${a}" type="hidden" value="${h}" />`),n=document.createElement("form");n.method=t,n.action=e,n.innerHTML=`${o}`,n.target=s||"_self",document.body.append(n),n.submit()}static toCamelCase(e){return this.words(e.replace(/['\u2019]/g,"")).reduce((t,r,s)=>(r=r.toLowerCase(),t+(s?r.charAt(0).toUpperCase()+r.slice(1):r)),"")}static toKebabCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(e){return this.toCamelCase(e).replace(/^(.)/,t=>t.toUpperCase())}static toSnakeCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(e){return this.toSnakeCase(e).toUpperCase()}static words(e,t){return t===void 0?(Ue.HAS_UNICODE_WORD(e)?Ue.unicodeWords(e):Or(e))||[]:e.match(t)||[]}};var Dt=class extends Error{static{c(this,"SmpFilterException")}message;data;constructor(e="Filter Exception",t){super(),this.message=e,this.data=t}};var Pt=require("ts-luxon");var Nt=class i{static{c(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return Pt.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix;constructor(e=`sid-xxxx-${+Pt.DateTime.now().ts}`,t=0){this.value=e,this.expiry=t,this._controlSuffix="$1"}static parse(e){return new i(e.value,e.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};Pe();var Tt=class{static{c(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var Qs="1.6.1";Object.defineProperties(module.exports,{SmpDynamoService:{get:c(()=>(Vr(),L(Gr)).SmpDynamoService,"get")},SmpFirebaseService:{get:c(()=>(Zr(),L(qr)).SmpFirebaseService,"get")},SmpAbstractRxjsTtlCacheStrategy:{get:c(()=>(Ee(),L(xe)).SmpAbstractRxjsTtlCacheStrategy,"get")},smpRxjsCatchOnly:{get:c(()=>(Ee(),L(xe)).smpRxjsCatchOnly,"get")},SmpRxjsInMemoryCache:{get:c(()=>(Ee(),L(xe)).SmpRxjsInMemoryCache,"get")},smpRxjsThrowIfEmpty:{get:c(()=>(Ee(),L(xe)).smpRxjsThrowIfEmpty,"get")},smpRxjsThrowOnCondition:{get:c(()=>(Ee(),L(xe)).smpRxjsThrowOnCondition,"get")},smpZodDateTime:{get:c(()=>(zt(),L(Lt)).smpZodDateTime,"get")},SmpZodDateTime:{get:c(()=>(zt(),L(Lt)).SmpZodDateTime,"get")}});0&&(module.exports={SMP_HEALTHZ,SmpAbstractCacheStrategy,SmpAbstractTtlCacheStrategy,SmpAesCrypt,SmpApiCommonUtils,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpService,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpIsSmpCachedValue,smpNoop});
2
2
  //# sourceMappingURL=index.cjs.map