@namiml/web-sdk
Version:
Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing
1 lines • 1.65 MB
JavaScript
"use strict";var e=require("lit"),t=require("lit/directives/repeat.js");function i(e,t){this.v=e,this.k=t}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e){return new i(e,0)}function o(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(()=>{if("undefined"==typeof globalThis){var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")();Object.defineProperty(e,"globalThis",{value:e,writable:!0,enumerable:!1,configurable:!0})}})(),"undefined"!=typeof Element&&"function"!=typeof Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var e=this.attributes,t=new Array(e.length),i=0;i<e.length;i+=1)t[i]=e[i].name;return t});var s=0;function u(e){return"__private_"+s+++"_"+e}function l(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E(n.key),n)}}function d(e,t,i){return t&&l(e.prototype,t),i&&l(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e))||t){i&&(e=i);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},c.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,k(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function g(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}function v(){var e,t,i="function"==typeof Symbol?Symbol:{},n=i.iterator||"@@iterator",a=i.toStringTag||"@@toStringTag";function r(i,n,a,r){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return w(l,"_invoke",function(i,n,a){var r,s,u,l=0,d=a||[],h=!1,c={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,i){return r=t,s=0,u=e,c.n=i,o}};function f(i,n){for(s=i,u=n,t=0;!h&&l&&!a&&t<d.length;t++){var a,r=d[t],f=c.p,m=r[2];i>3?(a=m===n)&&(u=r[(s=r[4])?5:(s=3,3)],r[4]=r[5]=e):r[0]<=f&&((a=i<2&&f<r[1])?(s=0,c.v=n,c.n=r[1]):f<m&&(a=i<3||r[0]>n||n>m)&&(r[4]=i,r[5]=n,c.n=m,s=0))}if(a||i>1)return o;throw h=!0,n}return function(a,d,m){if(l>1)throw TypeError("Generator is already running");for(h&&1===d&&f(d,m),s=d,u=m;(t=s<2?e:u)||!h;){r||(s?s<3?(s>1&&(c.n=-1),f(s,u)):c.n=u:c.v=u);try{if(l=2,r){if(s||(a="next"),t=r[a]){if(!(t=t.call(r,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=r.return)&&t.call(r),s<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),s=1);r=e}else if((t=(h=c.n<0)?u:i.call(n,c))!==o)break}catch(t){r=e,s=1,u=t}finally{l=1}}return{value:t,done:h}}}(i,a,r),!0),l}var o={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var d=[][n]?t(t([][n]())):(w(t={},n,function(){return this}),t),h=l.prototype=s.prototype=Object.create(d);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,w(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=l,w(h,"constructor",l),w(l,"constructor",u),u.displayName="GeneratorFunction",w(l,a,"GeneratorFunction"),w(h),w(h,a,"Generator"),w(h,n,function(){return this}),w(h,"toString",function(){return"[object Generator]"}),(v=function(){return{w:r,m:c}})()}function y(e,t,i,n,a){var r=function(e,t,i,n,a){return new b(v().w(e,t,i,n),a||Promise)}(e,t,i,n,a);return r.next().then(function(e){return e.done?e.value:r.next()})}function b(e,t){function n(a,r,o,s){try{var u=e[a](r),l=u.value;return l instanceof i?t.resolve(l.v).then(function(e){n("next",e,o,s)},function(e){n("throw",e,o,s)}):t.resolve(l).then(function(e){u.value=e,o(u)},function(e){return n("throw",e,o,s)})}catch(e){s(e)}}var a;this.next||(w(b.prototype),w(b.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),w(this,"_invoke",function(e,i,r){function o(){return new t(function(t,i){n(e,r,t,i)})}return a=a?a.then(o,o):o()},!0)}function w(e,t,i,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}w=function(e,t,i,n){function r(t,i){w(e,t,function(e){return this._invoke(t,i,e)})}t?a?a(e,t,{value:i,enumerable:!n,configurable:!n,writable:!n}):e[t]=i:(r("next",0),r("throw",1),r("return",2))},w(e,t,i,n)}function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}function E(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function S(e){var t="function"==typeof Map?new Map:void 0;return S=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return function(e,t,i){if(p())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var a=new(e.bind.apply(e,n));return i&&k(a,i.prototype),a}(e,arguments,f(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),k(i,e)},S(e)}var P,M,T,A,D,x,C,I,L,_,R,F,O=function(){function e(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}var t=e.prototype;return t.checkValidity=function(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0},t.reportValidity=function(){return!0},t.setFormValue=function(){},t.setValidity=function(){},d(e,[{key:"shadowRoot",get:function(){return this.__host.__shadowRoot}}])}(),N=function(e,t,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,i):a?a.value=i:t.set(e,i),i},W=function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)},$=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},j=function(){function e(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}var t=e.prototype;return t.addEventListener=function(e,t,i){var n;if(null!=t){var a=$(i)?this.__captureEventListeners:this.__eventListeners,r=a.get(e);if(void 0===r)r=new Map,a.set(e,r);else if(r.has(t))return;var o="object"==typeof i&&i?i:{};null===(n=o.signal)||void 0===n||n.addEventListener("abort",()=>this.removeEventListener(e,t,i)),r.set(t,null!=o?o:{})}},t.removeEventListener=function(e,t,i){if(null!=t){var n=$(i)?this.__captureEventListeners:this.__eventListeners,a=n.get(e);void 0!==a&&(a.delete(t),a.size||n.delete(e))}},t.dispatchEvent=function(e){var t=[this],i=this.__eventTargetParent;if(e.composed)for(;i;)t.push(i),i=i.__eventTargetParent;else for(;i&&i!==this.__host;)t.push(i),i=i.__eventTargetParent;var n=!1,a=!1,r=0,o=null,s=null,u=null,l=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:c({get:()=>null!=o?o:s},z),srcElement:c({get:()=>e.target},z),currentTarget:c({get:()=>u},z),eventPhase:c({get:()=>r},z),composedPath:c({value:()=>t},z),stopPropagation:c({value:()=>{n=!0,l.call(e)}},z),stopImmediatePropagation:c({value:()=>{a=!0,d.call(e)}},z)});var f=(t,i,n)=>{"function"==typeof t?t(e):"function"==typeof(null==t?void 0:t.handleEvent)&&t.handleEvent(e),i.once&&n.delete(t)},m=()=>(u=null,r=0,!e.defaultPrevented),p=t.slice().reverse();o=this.__host&&e.composed?null:this;for(var g,v=e=>{for(s=this;s.__host&&e.includes(s.__host);)s=s.__host},y=h(p);!(g=y()).done;){var b=g.value;o||s&&s!==b.__host||v(p.slice(p.indexOf(b))),u=b,r=b===e.target?2:1;var w=b.__captureEventListeners.get(e.type);if(w)for(var k,E=h(w);!(k=E()).done;){var S=k.value;if(f(S[0],S[1],w),a)return m()}if(n)return m()}var P=e.bubbles?t:[this];s=null;for(var M,T=h(P);!(M=T()).done;){var A=M.value;o||s&&A!==s.__host||v(P.slice(0,P.indexOf(A)+1)),u=A,r=A===e.target?2:3;var D=A.__eventListeners.get(e.type);if(D)for(var x,C=h(D);!(x=C()).done;){var I=x.value;if(f(I[0],I[1],D),a)return m()}if(n)return m()}return m()},e}(),B=j,z={__proto__:null,enumerable:!0};Object.freeze(z);var U=(_=function(){function e(e,t={}){if(P.set(this,!1),M.set(this,!1),T.set(this,!1),A.set(this,!1),D.set(this,Date.now()),x.set(this,!1),C.set(this,void 0),I.set(this,void 0),L.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,0===arguments.length)throw new Error("The type argument must be specified");if("object"!=typeof t||!t)throw new Error('The "options" argument must be an object');var i=t.bubbles,n=t.cancelable,a=t.composed;N(this,P,!!n,"f"),N(this,M,!!i,"f"),N(this,T,!!a,"f"),N(this,C,`${e}`,"f"),N(this,I,null,"f"),N(this,L,!1,"f")}var t=e.prototype;return t.initEvent=function(e,t,i){throw new Error("Method not implemented.")},t.stopImmediatePropagation=function(){this.stopPropagation()},t.preventDefault=function(){N(this,A,!0,"f")},t.composedPath=function(){return W(this,L,"f")?[W(this,I,"f")]:[]},t.stopPropagation=function(){N(this,x,!0,"f")},d(e,[{key:"target",get:function(){return W(this,I,"f")}},{key:"currentTarget",get:function(){return W(this,I,"f")}},{key:"srcElement",get:function(){return W(this,I,"f")}},{key:"type",get:function(){return W(this,C,"f")}},{key:"cancelable",get:function(){return W(this,P,"f")}},{key:"defaultPrevented",get:function(){return W(this,P,"f")&&W(this,A,"f")}},{key:"timeStamp",get:function(){return W(this,D,"f")}},{key:"returnValue",get:function(){return!W(this,P,"f")||!W(this,A,"f")}},{key:"bubbles",get:function(){return W(this,M,"f")}},{key:"composed",get:function(){return W(this,T,"f")}},{key:"eventPhase",get:function(){return W(this,L,"f")?_.AT_TARGET:_.NONE}},{key:"cancelBubble",get:function(){return W(this,x,"f")},set:function(e){e&&N(this,x,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),P=new WeakMap,M=new WeakMap,T=new WeakMap,A=new WeakMap,D=new WeakMap,x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,_.NONE=0,_.CAPTURING_PHASE=1,_.AT_TARGET=2,_.BUBBLING_PHASE=3,_);Object.defineProperties(U.prototype,{initEvent:z,stopImmediatePropagation:z,preventDefault:z,target:z,currentTarget:z,srcElement:z,type:z,cancelable:z,defaultPrevented:z,timeStamp:z,composedPath:z,returnValue:z,bubbles:z,composed:z,eventPhase:z,cancelBubble:z,stopPropagation:z,isTrusted:z});var H=(F=function(e){function t(t,i={}){var n,a;return a=e.call(this,t,i)||this,R.set(a,void 0),N(a,R,null!==(n=null==i?void 0:i.detail)&&void 0!==n?n:null,"f"),a}return m(t,e),t.prototype.initCustomEvent=function(e,t,i,n){throw new Error("Method not implemented.")},d(t,[{key:"detail",get:function(){return W(this,R,"f")}}])}(U),R=new WeakMap,F);Object.defineProperties(H.prototype,{detail:z});var G,V,K,X=U,Y=H;null!==(G=globalThis.Event)&&void 0!==G||(globalThis.Event=X),null!==(V=globalThis.CustomEvent)&&void 0!==V||(globalThis.CustomEvent=Y);var q=new WeakMap,J=e=>{var t=q.get(e);return void 0===t&&q.set(e,t=new Map),t},Q=function(e){function t(){return e.apply(this,arguments)||this}return m(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).__shadowRootMode=null,t.__shadowRoot=null,t.__internals=null,t}m(t,e);var i=t.prototype;return i.setAttribute=function(e,t){J(this).set(e,String(t))},i.removeAttribute=function(e){J(this).delete(e)},i.toggleAttribute=function(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)},i.hasAttribute=function(e){return J(this).has(e)},i.attachShadow=function(e){var t={host:this};return this.__shadowRootMode=e.mode,e&&"open"===e.mode&&(this.__shadowRoot=t),t},i.attachInternals=function(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var e=new O(this);return this.__internals=e,e},i.getAttribute=function(e){var t=J(this).get(e);return null!=t?t:null},d(t,[{key:"attributes",get:function(){return Array.from(J(this)).map(([e,t])=>({name:e,value:t}))}},{key:"shadowRoot",get:function(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}},{key:"localName",get:function(){return this.constructor.__localName}},{key:"tagName",get:function(){var e;return null===(e=this.localName)||void 0===e?void 0:e.toUpperCase()}}])}(B));function Z(e,t,i,n){var a,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}function ee(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function te(e,t,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,i):a?a.value=i:t.set(e,i),i}null!==(K=globalThis.litServerRoot)&&void 0!==K||(globalThis.litServerRoot=Object.defineProperty(new Q,"localName",{get:()=>"lit-server-root"})),"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=Q),"function"==typeof SuppressedError&&SuppressedError;var ie;!function(e){e.SDK="sdk",e.ML="ml",e.THIRD_PARTY_ANALYTICS="third_party_analytics",e.THIRD_PARTY_TRANSACTIONS="third_party_transactions",e.PAYWALL_PERSONALIZATION="paywall_personalization",e.ANONYMOUS_MODE_CAPABILITY="anonymous_allowed",e.LANGUAGE_MANAGEMENT="language_management",e.ENTITLEMENT_MANAGEMENT="entitlement_management"}(ie||(ie={}));var ne,ae={},re=ae.NAMI_SDK_VERSION,oe=void 0===re?"3.3.2":re,se=ae.PLATFORM_ID_REQUIRED,ue=void 0===se?"Platform ID is required":se,le=ae.DEVICE_ID_REQUIRED,de=void 0===le?"Device ID is required":le,he=ae.EXTERNAL_ID_REQUIRED,ce=void 0===he?"External ID is required":he,fe=ae.SDK_NOT_INITIALIZED,me=void 0===fe?"SDK has not been initialized. Make sure to call Nami.configure() first!":fe,pe=ae.CAMPAIGN_NOT_AVAILABLE,ge=void 0===pe?"Campaign is not available":pe,ve=ae.FLOW_SCREENS_NOT_AVAILABLE,ye=void 0===ve?"Flow screens not available":ve,be=ae.UNABLE_TO_UPDATE_CDP_ID,we=void 0===be?"Unable to update CDP id in anonymous mode":be,ke=ae.ANONYMOUS_MODE_ALREADY_ON,Ee=void 0===ke?"Anonymous mode is already turned on.":ke,Se=ae.ANONYMOUS_MODE_ALREADY_OFF,Pe=void 0===Se?"Anonymous mode is already turned off.":Se,Me=ae.DEVICE_ID_NOT_SET,Te=void 0===Me?"Nami Device ID is not set":Me,Ae=ae.AUTH_DEVICE,De=void 0===Ae?"nami_auth_device":Ae,xe=ae.NAMI_CONFIGURATION,Ce=void 0===xe?"nami_configuration":xe,Ie=ae.NAMI_PROFILE,Le=void 0===Ie?"nami_profile":Ie,_e=ae.API_CONFIG,Re=void 0===_e?"api_config":_e,Fe=ae.API_CAMPAIGN_RULES,Oe=void 0===Fe?"api_campaign_rules":Fe,Ne=ae.API_PAYWALLS,We=void 0===Ne?"api_paywalls":Ne,$e=ae.API_PRODUCTS,je=void 0===$e?"api_products":$e,Be=ae.API_ACTIVE_ENTITLEMENTS,ze=void 0===Be?"api_active_entitlements":Be,Ue=ae.SERVER_NAMI_ENTITLEMENTS,He=void 0===Ue?"server_active_entitlements":Ue,Ge=ae.INITIAL_APP_CONFIG,Ve=void 0===Ge?"initial_app_config":Ge,Ke=ae.INITIAL_CAMPAIGN_RULES,Xe=void 0===Ke?"initial_campaign_rules":Ke,Ye=ae.INITIAL_PAYWALLS,qe=void 0===Ye?"initial_paywalls":Ye,Je=ae.INITIAL_PRODUCTS,Qe=void 0===Je?"initial_products":Je,Ze=ae.LOCAL_NAMI_ENTITLEMENTS,et=void 0===Ze?"local_active_entitlements":Ze,tt=ae.CUSTOMER_ATTRIBUTES_KEY_PREFIX,it=void 0===tt?"nami_cmr_attributes_":tt,nt=ae.NAMI_CUSTOMER_JOURNEY_STATE,at=void 0===nt?"nami_customer_journey_state":nt,rt=ae.ANONYMOUS_MODE,ot=void 0===rt?"nami_anonymous_mode":rt,st=ae.ANONYMOUS_UUID,ut=void 0===st?"nami_anonymous_uuid":st,lt=ae.KEY_SESSION_COUNTER,dt=void 0===lt?"nami_session_counter":lt,ht=ae.INITIAL_SESSION_COUNTER_VALUE,ct=void 0===ht?1:ht,ft=ae.NAMI_LAST_IMPRESSION_ID,mt=void 0===ft?"nami_last_impression_id":ft,pt=ae.NAMI_PURCHASE_IMPRESSION_ID,gt=void 0===pt?"nami_purchase_impression_id":pt,vt=ae.NAMI_LAUNCH_ID,yt=void 0===vt?"nami_launch_id":vt,bt=ae.NAMI_SESSION_ID,wt=void 0===bt?"nami_session_id":bt,kt=ae.NAMI_LANGUAGE_CODE,Et=void 0===kt?"nami_language_code":kt,St=ae.NAMI_PURCHASE_CHANNEL,Pt=void 0===St?"nami_purchase_channel":St,Mt=ae.API_VERSION,Tt=ae.BASE_URL_PATH,At=void 0===Tt?`sdk/${void 0===Mt?"v3":Mt}/platform`:Tt,Dt=ae.BASE_URL,xt=void 0===Dt?"https://app.namiml.com":Dt,Ct=ae.BASE_STAGING_URL,It=void 0===Ct?"https://app-staging.namiml.com":Ct,Lt=ae.CUSTOM_HOST_PREFIX,_t=void 0===Lt?"namiAPIHost=":Lt,Rt=ae.USE_STAGING_API,Ft=void 0===Rt?"useStagingAPI":Rt,Ot=ae.EXTENDED_CLIENT_INFO_PREFIX,Nt=void 0===Ot?"extendedClientInfo":Ot,Wt=ae.EXTENDED_CLIENT_INFO_DELIMITER,$t=void 0===Wt?":":Wt,jt=ae.VALIDATE_PRODUCT_GROUPS,Bt=void 0===jt?"validateProductGroups":jt,zt=ae.API_MAX_CALLS_LIMIT,Ut=void 0===zt?2:zt,Ht=ae.API_RETRY_DELAY_SEC,Gt=void 0===Ht?2:Ht,Vt=ae.API_TIMEOUT_LIMIT,Kt=void 0===Vt?2e4:Vt,Xt=ae.DEVICE_API_TIMEOUT_LIMIT,Yt=void 0===Xt?3e3:Xt,qt=ae.STATUS_BAD_REQUEST,Jt=void 0===qt?400:qt,Qt=ae.STATUS_NOT_FOUND,Zt=void 0===Qt?404:Qt,ei=ae.STATUS_CONFLICT,ti=void 0===ei?409:ei,ii=ae.STATUS_INTERNAL_SERVER_ERROR,ni=void 0===ii?500:ii,ai=ae.INITIAL_SUCCESS,ri=void 0===ai?"Initial success":ai,oi=ae.RECONFIG_SUCCESS,si=void 0===oi?"Reconfig success":oi,ui=ae.ALREADY_CONFIGURED,li=void 0===ui?"Already configured":ui,di=ae.AVAILABLE_CAMPAIGNS_CHANGED,hi=void 0===di?"AvailableCampaignsChanged":di,ci=ae.PAYWALL_ACTION_EVENT,fi=void 0===ci?"PaywallActionEvent":ci,mi=ae.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,pi=void 0===mi?"AvailableActiveEntitlementsChanged":mi,gi=ae.CUSTOMER_JOURNEY_STATE_CHANGED,vi=void 0===gi?"CustomerJourneyStateChanged":gi,yi=ae.SKU_TEXT_REGEX,bi=void 0===yi?/\$\{sku\.(\w+)(:\d+)?\}/g:yi,wi=ae.VAR_REGEX,ki=void 0===wi?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:wi,Ei=ae.SMART_TEXT_PATTERN,Si=void 0===Ei?"${":Ei;exports.LogLevel=void 0,(ne=exports.LogLevel||(exports.LogLevel={}))[ne.DEBUG=1]="DEBUG",ne[ne.INFO=2]="INFO",ne[ne.WARN=3]="WARN",ne[ne.ERROR=4]="ERROR";var Pi={debug:exports.LogLevel.DEBUG,info:exports.LogLevel.INFO,warn:exports.LogLevel.WARN,error:exports.LogLevel.ERROR},Mi=function(){function e(){this.currentLogLevel=exports.LogLevel.DEBUG,this.setLogger=e=>{this.currentLogLevel=e?Pi[e]:exports.LogLevel.WARN}}var t=e.prototype;return t.debug=function(e,...t){this.shouldLog(exports.LogLevel.DEBUG)&&console.debug(this.formatMessage(exports.LogLevel.DEBUG,e,...t))},t.info=function(e,...t){this.shouldLog(exports.LogLevel.INFO)&&console.info(this.formatMessage(exports.LogLevel.INFO,e,...t))},t.warn=function(e,...t){this.shouldLog(exports.LogLevel.WARN)&&console.warn(this.formatMessage(exports.LogLevel.WARN,e,...t))},t.error=function(e,...t){this.shouldLog(exports.LogLevel.ERROR)&&console.error(this.formatMessage(exports.LogLevel.ERROR,e,...t))},t.shouldLog=function(e){return e>=this.currentLogLevel},t.formatMessage=function(e,t,...i){var n=exports.LogLevel[e];return`[${(new Date).toISOString()}] [${n}] ${t} ${i=i.map(e=>"object"==typeof e?JSON.stringify(e):e)}`},e}(),Ti=new Mi;function Ai(e){for(var t=-1,i=null==e?0:e.length,n=0,a=[];++t<i;){var r=e[t];r&&(a[n++]=r)}return a}function Di(e,t){return e===t||e!=e&&t!=t}function xi(e,t){for(var i=e.length;i--;)if(Di(e[i][0],t))return i;return-1}var Ci=Array.prototype.splice;function Ii(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Ii.prototype.clear=function(){this.__data__=[],this.size=0},Ii.prototype.delete=function(e){var t=this.__data__,i=xi(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ci.call(t,i,1),--this.size,!0)},Ii.prototype.get=function(e){var t=this.__data__,i=xi(t,e);return i<0?void 0:t[i][1]},Ii.prototype.has=function(e){return xi(this.__data__,e)>-1},Ii.prototype.set=function(e,t){var i=this.__data__,n=xi(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var Li="object"==typeof global&&global&&global.Object===Object&&global,_i="object"==typeof self&&self&&self.Object===Object&&self,Ri=Li||_i||Function("return this")(),Fi=Ri.Symbol,Oi=Object.prototype,Ni=Oi.hasOwnProperty,Wi=Oi.toString,$i=Fi?Fi.toStringTag:void 0;var ji=Object.prototype.toString;var Bi=Fi?Fi.toStringTag:void 0;function zi(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Bi&&Bi in Object(e)?function(e){var t=Ni.call(e,$i),i=e[$i];try{e[$i]=void 0;var n=!0}catch(e){}var a=Wi.call(e);return n&&(t?e[$i]=i:delete e[$i]),a}(e):function(e){return ji.call(e)}(e)}function Ui(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Hi(e){if(!Ui(e))return!1;var t=zi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Gi,Vi=Ri["__core-js_shared__"],Ki=(Gi=/[^.]+$/.exec(Vi&&Vi.keys&&Vi.keys.IE_PROTO||""))?"Symbol(src)_1."+Gi:"";var Xi=Function.prototype.toString;function Yi(e){if(null!=e){try{return Xi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var qi=/^\[object .+?Constructor\]$/,Ji=Function.prototype,Qi=Object.prototype,Zi=Ji.toString,en=Qi.hasOwnProperty,tn=RegExp("^"+Zi.call(en).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nn(e){return!(!Ui(e)||(t=e,Ki&&Ki in t))&&(Hi(e)?tn:qi).test(Yi(e));var t}function an(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return nn(i)?i:void 0}var rn=an(Ri,"Map"),on=an(Object,"create");var sn=Object.prototype.hasOwnProperty;var un=Object.prototype.hasOwnProperty;function ln(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function dn(e,t){var i,n,a=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?a["string"==typeof t?"string":"hash"]:a.map}function hn(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ln.prototype.clear=function(){this.__data__=on?on(null):{},this.size=0},ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ln.prototype.get=function(e){var t=this.__data__;if(on){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return sn.call(t,e)?t[e]:void 0},ln.prototype.has=function(e){var t=this.__data__;return on?void 0!==t[e]:un.call(t,e)},ln.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=on&&void 0===t?"__lodash_hash_undefined__":t,this},hn.prototype.clear=function(){this.size=0,this.__data__={hash:new ln,map:new(rn||Ii),string:new ln}},hn.prototype.delete=function(e){var t=dn(this,e).delete(e);return this.size-=t?1:0,t},hn.prototype.get=function(e){return dn(this,e).get(e)},hn.prototype.has=function(e){return dn(this,e).has(e)},hn.prototype.set=function(e,t){var i=dn(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function cn(e){var t=this.__data__=new Ii(e);this.size=t.size}cn.prototype.clear=function(){this.__data__=new Ii,this.size=0},cn.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},cn.prototype.get=function(e){return this.__data__.get(e)},cn.prototype.has=function(e){return this.__data__.has(e)},cn.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Ii){var n=i.__data__;if(!rn||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new hn(n)}return i.set(e,t),this.size=i.size,this};function fn(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new hn;++t<i;)this.add(e[t])}function mn(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function pn(e,t){return e.has(t)}fn.prototype.add=fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},fn.prototype.has=function(e){return this.__data__.has(e)};function gn(e,t,i,n,a,r){var o=1&i,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var l=r.get(e),d=r.get(t);if(l&&d)return l==t&&d==e;var h=-1,c=!0,f=2&i?new fn:void 0;for(r.set(e,t),r.set(t,e);++h<s;){var m=e[h],p=t[h];if(n)var g=o?n(p,m,h,t,e,r):n(m,p,h,e,t,r);if(void 0!==g){if(g)continue;c=!1;break}if(f){if(!mn(t,function(e,t){if(!pn(f,t)&&(m===e||a(m,e,i,n,r)))return f.push(t)})){c=!1;break}}else if(m!==p&&!a(m,p,i,n,r)){c=!1;break}}return r.delete(e),r.delete(t),c}var vn=Ri.Uint8Array;function yn(e){var t=-1,i=Array(e.size);return e.forEach(function(e,n){i[++t]=[n,e]}),i}function bn(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var wn=Fi?Fi.prototype:void 0,kn=wn?wn.valueOf:void 0;var En=Array.isArray;var Sn=Object.prototype.propertyIsEnumerable,Pn=Object.getOwnPropertySymbols,Mn=Pn?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,n=null==e?0:e.length,a=0,r=[];++i<n;){var o=e[i];t(o,i,e)&&(r[a++]=o)}return r}(Pn(e),function(t){return Sn.call(e,t)}))}:function(){return[]};function Tn(e){return null!=e&&"object"==typeof e}function An(e){return Tn(e)&&"[object Arguments]"==zi(e)}var Dn=Object.prototype,xn=Dn.hasOwnProperty,Cn=Dn.propertyIsEnumerable,In=An(function(){return arguments}())?An:function(e){return Tn(e)&&xn.call(e,"callee")&&!Cn.call(e,"callee")};var Ln="object"==typeof exports&&exports&&!exports.nodeType&&exports,_n=Ln&&"object"==typeof module&&module&&!module.nodeType&&module,Rn=_n&&_n.exports===Ln?Ri.Buffer:void 0,Fn=(Rn?Rn.isBuffer:void 0)||function(){return!1},On=/^(?:0|[1-9]\d*)$/;function Nn(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&On.test(e))&&e>-1&&e%1==0&&e<t}function Wn(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var $n={};function jn(e){return function(t){return e(t)}}$n["[object Float32Array]"]=$n["[object Float64Array]"]=$n["[object Int8Array]"]=$n["[object Int16Array]"]=$n["[object Int32Array]"]=$n["[object Uint8Array]"]=$n["[object Uint8ClampedArray]"]=$n["[object Uint16Array]"]=$n["[object Uint32Array]"]=!0,$n["[object Arguments]"]=$n["[object Array]"]=$n["[object ArrayBuffer]"]=$n["[object Boolean]"]=$n["[object DataView]"]=$n["[object Date]"]=$n["[object Error]"]=$n["[object Function]"]=$n["[object Map]"]=$n["[object Number]"]=$n["[object Object]"]=$n["[object RegExp]"]=$n["[object Set]"]=$n["[object String]"]=$n["[object WeakMap]"]=!1;var Bn="object"==typeof exports&&exports&&!exports.nodeType&&exports,zn=Bn&&"object"==typeof module&&module&&!module.nodeType&&module,Un=zn&&zn.exports===Bn&&Li.process,Hn=function(){try{var e=zn&&zn.require&&zn.require("util").types;return e||Un&&Un.binding&&Un.binding("util")}catch(e){}}(),Gn=Hn&&Hn.isTypedArray,Vn=Gn?jn(Gn):function(e){return Tn(e)&&Wn(e.length)&&!!$n[zi(e)]},Kn=Object.prototype.hasOwnProperty;function Xn(e,t){var i=En(e),n=!i&&In(e),a=!i&&!n&&Fn(e),r=!i&&!n&&!a&&Vn(e),o=i||n||a||r,s=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],u=s.length;for(var l in e)!Kn.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Nn(l,u))||s.push(l);return s}var Yn=Object.prototype;function qn(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Yn)}function Jn(e,t){return function(i){return e(t(i))}}var Qn=Jn(Object.keys,Object),Zn=Object.prototype.hasOwnProperty;function ea(e){return null!=(t=e)&&Wn(t.length)&&!Hi(t)?Xn(e):function(e){if(!qn(e))return Qn(e);var t=[];for(var i in Object(e))Zn.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e);var t}function ta(e){return function(e,t,i){var n=t(e);return En(e)?n:function(e,t){for(var i=-1,n=t.length,a=e.length;++i<n;)e[a+i]=t[i];return e}(n,i(e))}(e,ea,Mn)}var ia=Object.prototype.hasOwnProperty;var na=an(Ri,"DataView"),aa=an(Ri,"Promise"),ra=an(Ri,"Set"),oa=an(Ri,"WeakMap"),sa="[object Map]",ua="[object Promise]",la="[object Set]",da="[object WeakMap]",ha="[object DataView]",ca=Yi(na),fa=Yi(rn),ma=Yi(aa),pa=Yi(ra),ga=Yi(oa),va=zi;(na&&va(new na(new ArrayBuffer(1)))!=ha||rn&&va(new rn)!=sa||aa&&va(aa.resolve())!=ua||ra&&va(new ra)!=la||oa&&va(new oa)!=da)&&(va=function(e){var t=zi(e),i="[object Object]"==t?e.constructor:void 0,n=i?Yi(i):"";if(n)switch(n){case ca:return ha;case fa:return sa;case ma:return ua;case pa:return la;case ga:return da}return t});var ya="[object Arguments]",ba="[object Array]",wa="[object Object]",ka=Object.prototype.hasOwnProperty;function Ea(e,t,i,n,a,r){var o=En(e),s=En(t),u=o?ba:va(e),l=s?ba:va(t),d=(u=u==ya?wa:u)==wa,h=(l=l==ya?wa:l)==wa,c=u==l;if(c&&Fn(e)){if(!Fn(t))return!1;o=!0,d=!1}if(c&&!d)return r||(r=new cn),o||Vn(e)?gn(e,t,i,n,a,r):function(e,t,i,n,a,r,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new vn(e),new vn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Di(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=yn;case"[object Set]":var u=1&n;if(s||(s=bn),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;n|=2,o.set(e,t);var d=gn(s(e),s(t),n,a,r,o);return o.delete(e),d;case"[object Symbol]":if(kn)return kn.call(e)==kn.call(t)}return!1}(e,t,u,i,n,a,r);if(!(1&i)){var f=d&&ka.call(e,"__wrapped__"),m=h&&ka.call(t,"__wrapped__");if(f||m){var p=f?e.value():e,g=m?t.value():t;return r||(r=new cn),a(p,g,i,n,r)}}return!!c&&(r||(r=new cn),function(e,t,i,n,a,r){var o=1&i,s=ta(e),u=s.length;if(u!=ta(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:ia.call(t,d)))return!1}var h=r.get(e),c=r.get(t);if(h&&c)return h==t&&c==e;var f=!0;r.set(e,t),r.set(t,e);for(var m=o;++l<u;){var p=e[d=s[l]],g=t[d];if(n)var v=o?n(g,p,d,t,e,r):n(p,g,d,e,t,r);if(!(void 0===v?p===g||a(p,g,i,n,r):v)){f=!1;break}m||(m="constructor"==d)}if(f&&!m){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(f=!1)}return r.delete(e),r.delete(t),f}(e,t,i,n,a,r))}function Sa(e,t,i,n,a){return e===t||(null==e||null==t||!Tn(e)&&!Tn(t)?e!=e&&t!=t:Ea(e,t,i,n,Sa,a))}function Pa(e){return e==e&&!Ui(e)}function Ma(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function Ta(e){var t=function(e){for(var t=ea(e),i=t.length;i--;){var n=t[i],a=e[n];t[i]=[n,a,Pa(a)]}return t}(e);return 1==t.length&&t[0][2]?Ma(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var a=i.length,r=a;if(null==e)return!r;for(e=Object(e);a--;){var o=i[a];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++a<r;){var s=(o=i[a])[0],u=e[s],l=o[1];if(o[2]){if(void 0===u&&!(s in e))return!1}else if(!Sa(l,u,3,n,new cn))return!1}return!0}(i,0,t)}}function Aa(e){return"symbol"==typeof e||Tn(e)&&"[object Symbol]"==zi(e)}var Da=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xa=/^\w*$/;function Ca(e,t){if(En(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Aa(e))||(xa.test(e)||!Da.test(e)||null!=t&&e in Object(t))}function Ia(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,a=t?t.apply(this,n):n[0],r=i.cache;if(r.has(a))return r.get(a);var o=e.apply(this,n);return i.cache=r.set(a,o)||r,o};return i.cache=new(Ia.Cache||hn),i}Ia.Cache=hn;var La,_a,Ra,Fa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oa=/\\(\\)?/g,Na=(La=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Fa,function(e,i,n,a){t.push(n?a.replace(Oa,"$1"):i||e)}),t},_a=Ia(La,function(e){return 500===Ra.size&&Ra.clear(),e}),Ra=_a.cache,_a);var Wa=Fi?Fi.prototype:void 0,$a=Wa?Wa.toString:void 0;function ja(e){if("string"==typeof e)return e;if(En(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,a=Array(n);++i<n;)a[i]=t(e[i],i,e);return a}(e,ja)+"";if(Aa(e))return $a?$a.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ba(e){return null==e?"":ja(e)}function za(e,t){return En(e)?e:Ca(e,t)?[e]:Na(Ba(e))}function Ua(e){if("string"==typeof e||Aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ha(e,t){for(var i=0,n=(t=za(t,e)).length;null!=e&&i<n;)e=e[Ua(t[i++])];return i&&i==n?e:void 0}function Ga(e,t){return null!=e&&t in Object(e)}function Va(e,t){return null!=e&&function(e,t,i){for(var n=-1,a=(t=za(t,e)).length,r=!1;++n<a;){var o=Ua(t[n]);if(!(r=null!=e&&i(e,o)))break;e=e[o]}return r||++n!=a?r:!!(a=null==e?0:e.length)&&Wn(a)&&Nn(o,a)&&(En(e)||In(e))}(e,t,Ga)}function Ka(e,t){return Ca(e)&&Pa(t)?Ma(Ua(e),t):function(i){var n=function(e,t,i){var n=null==e?void 0:Ha(e,t);return void 0===n?i:n}(i,e);return void 0===n&&n===t?Va(i,e):Sa(t,n,3)}}function Xa(e){return e}function Ya(e){return Ca(e)?(t=Ua(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Ha(t,e)}}(e);var t}function qa(e){return e!=e}function Ja(e,t){return!!(null==e?0:e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=i-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i){for(var n=e.length,a=i+-1;++a<n;)if(t(e[a],a,e))return a;return-1}(e,qa,i)}(e,t,0)>-1}var Qa=ra&&1/bn(new ra([,-0]))[1]==1/0?function(e){return new ra(e)}:function(){};function Za(e,t){return e&&e.length?function(e,t,i){var n=-1,a=Ja,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:Qa(e);if(l)return bn(l);o=!1,a=pn,u=new fn}else u=t?[]:s;e:for(;++n<r;){var d=e[n],h=t?t(d):d;if(d=0!==d?d:0,o&&h==h){for(var c=u.length;c--;)if(u[c]===h)continue e;t&&u.push(h),s.push(d)}else a(u,h,i)||(u!==s&&u.push(h),s.push(d))}return s}(e,"function"==typeof(i=t)?i:null==i?Xa:"object"==typeof i?En(i)?Ka(i[0],i[1]):Ta(i):Ya(i)):[];var i}var er=function(){function e(){this.memoryStore={}}var t=e.prototype;return t.setDevice=function(e){this.setItem(De,e)},t.getDevice=function(){return this.getItem(De)},t.resetDevice=function(){this.resetItem(De)},t.getAnonymousMode=function(){return this.getItem(ot)||!1},t.setAnonymousMode=function(e){this.setItem(ot,e)},t.clearAnonymousMode=function(){this.resetItem(ot)},t.setAppConfig=function(e,t){this.setItem(e,t)},t.getAppConfig=function(e){return this.getItem(e)},t.setLanguageCode=function(e){this.setItem(Et,e||"en")},t.getLanguageCode=function(){return this.getItem(Et)||"en"},t.setCampaignRules=function(e,t){e!==Xe?this.setItem(e,t):this.memoryStore[Xe]=JSON.stringify(t)},t.getCampaignRules=function(e){return e===Xe?this.memoryStore[Xe]?JSON.parse(this.memoryStore[Xe]):null:this.getItem(e)},t.setPaywalls=function(e,t){e!==qe?this.setItem(e,t):this.memoryStore[qe]=JSON.stringify(t)},t.getPaywalls=function(e){return e===qe?this.memoryStore[qe]?JSON.parse(this.memoryStore[qe]):null:this.getItem(e)},t.setActiveEntitlements=function(e,t){this.setItem(e,t)},t.getActiveEntitlements=function(e){return this.getItem(e)||[]},t.setNamiEntitlements=function(e,t){this.setItem(e,t)},t.getNamiEntitlements=function(e){return this.getItem(e)||[]},t.setProducts=function(e,t){this.setItem(e,t)},t.getProducts=function(e){return this.getItem(e)},t.getCachedProducts=function(){var e,t,i=null!==(e=this.getItem(je))&&void 0!==e?e:[];return Za(Ai([...null!==(t=this.getItem(Qe))&&void 0!==t?t:[],...i]),"sku_ref_id")},t.setNamiConfig=function(e){this.setItem(Ce,e)},t.getNamiConfig=function(){return this.getItem(Ce)},t.setCustomerAttribute=function(e,t){this.setItem(it+e,t)},t.getCustomerAttribute=function(e){return this.getItem(it+e)},t.getAllCustomerAttributes=function(){return Object.entries(localStorage).filter(([e])=>e.includes(it)).map(([e,t])=>e.replace(it,"")+":"+t)},t.getAllCustomerAttributesKeys=function(){return Object.keys(localStorage).filter(e=>e.includes(it)).map(e=>e.replace(it,""))},t.clearCustomerAttribute=function(e){var t=it+e,i=this.getItem(t);return i&&this.resetItem(t),!!i},t.clearAllCustomerAttributes=function(){Object.keys(localStorage).filter(e=>e.includes(it)).map(e=>this.resetItem(e))},t.setNamiProfile=function(e){this.setItem(Le,e)},t.getNamiProfile=function(){return this.getItem(Le)},t.removeNamiProfile=function(){this.resetItem(Le)},t.setCustomerJourneyState=function(e){this.setItem(at,e)},t.getCustomerJourneyState=function(){return this.getItem(at)},t.setSessionCounter=function(){var e=this.getItem(dt),t=e?parseInt(e):ct||ct;this.setItem(dt,t+1)},t.getSessionCounter=function(){var e=this.getItem(dt);return e?parseInt(e):ct},t.setLastImpressionId=function(e){this.setItem(mt,e)},t.getLastImpressionId=function(){var e;return null!==(e=this.getItem(mt))&&void 0!==e?e:""},t.setPurchaseImpression=function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(gt,t)},t.getPurchaseImpression=function(){var e;return null!==(e=this.getItem(gt))&&void 0!==e?e:""},t.setSessionId=function(e){e&&this.setItem(wt,e)},t.getSessionId=function(){var e;return null!==(e=this.getItem(wt))&&void 0!==e?e:""},t.clearSessionId=function(){this.resetItem(wt)},t.setLaunchId=function(e){e&&this.setItem(yt,e)},t.getLaunchId=function(){var e;return null!==(e=this.getItem(yt))&&void 0!==e?e:""},t.clearLaunchId=function(){this.resetItem(yt)},t.setPurchaseChannel=function(e){e&&this.setItem(Pt,e)},t.getPurchaseChannel=function(){return this.getItem(Pt)},t.getAnonymousUUID=function(){return this.getItem(ut)},t.setAnonymousUUID=function(e){this.setItem(ut,e)},t.clearAnonymousUUID=function(){this.resetItem(ut)},t.setItem=function(e,t){var i;try{i=JSON.stringify(t)}catch(t){return void Ti.error(`Serialization failed for ${e}`,t)}try{localStorage.setItem(e,i)}catch(t){Ti.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=i}},t.getItem=function(e){try{var t=localStorage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){"undefined"!=typeof window&&Ti.error("Error getting item from localStorage:",e,": ",t)}var i=this.memoryStore[e];return null!=i?JSON.parse(i):null},t.resetItem=function(e){try{localStorage.removeItem(e)}catch(t){"undefined"!=typeof window&&Ti.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]},t.clear=function(){try{localStorage.clear()}catch(e){Ti.error("Error clearing localStorage:",e)}this.memoryStore={}},e}(),tr=new er,ir=function(e){function t(t,i){var n;return(n=e.call(this,i)||this).statusCode=t,n.status=t,n.message=`RetryLimitExceededError: ${n.message}`,n}return m(t,e),t}(S(Error)),nr=function(e){function t(){return e.apply(this,arguments)||this}return m(t,e),t}(S(Error)),ar=function(e){function t(){var t;return(t=e.call(this)||this).status=409,t.name="ConflictError",t.message="ConflictError: Server responded with conflict",t}return m(t,e),t}(nr),rr=function(e){function t(){return e.call(this,me)||this}return m(t,e),t}(S(Error)),or=function(e){function t(){return e.call(this,ue)||this}return m(t,e),t}(S(Error)),sr=function(e){function t(){return e.call(this,de)||this}return m(t,e),t}(S(Error)),ur=function(e){function t(){return e.call(this,ce)||this}return m(t,e),t}(S(Error)),lr=function(e){function t(){return e.call(this,ge)||this}return m(t,e),t}(S(Error)),dr=function(e){function t(){return e.call(this,ye)||this}return m(t,e),t}(S(Error)),hr=function(e){function t(){return e.call(this,Ee)||this}return m(t,e),t}(S(Error)),cr=function(e){function t(){return e.call(this,Pe)||this}return m(t,e),t}(S(Error)),fr=function(e){function t(){return e.call(this,Pe)||this}return m(t,e),t}(S(Error)),mr=function(e){function t(){return e.call(this,we)||this}return m(t,e),t}(S(Error)),pr=function(e){function t(t){var i;return(i=e.call(this,t)||this).message=`BadRequestError: ${i.message}`,i}return m(t,e),t}(nr),gr=function(e){function t(t){var i;return(i=e.call(this,t)||this).message=`NotFoundError: ${i.message}`,i}return m(t,e),t}(nr),vr=function(e){function t(t,i){var n;return(n=e.call(this,i)||this).statusCode=t,n.message=`ClientError: ${n.message}`,n}return m(t,e),t}(nr),yr=function(e){function t(t){var i;return(i=e.call(this,t)||this).message=`ServerError: ${i.message}`,i}return m(t,e),t}(nr),br=(e,t)=>{if(e==Jt)throw new pr(t);if(e==Zt)throw new gr(t);if(e==ti)throw new ar;if(e>Jt&&e<ni)throw new vr(e,t);if(e>=ni)throw new yr(t)};function wr(e,t,i=Kt,n=Ut){var a,o,s;return y(function(u){for(;;)switch(u.n){case 0:return a=0,o=()=>{var s,u;return y(function(l){for(;;)switch(l.n){case 0:return l.n=1,r(kr(e,t,i));case 1:if((s=l.v).ok){l.n=5;break}if(s.status!=ti){l.n=2;break}throw new ar;case 2:if(!(++a<=n)){l.n=4;break}return u=1e3*(a+Gt),l.n=3,r(new Promise(e=>setTimeout(e,u)));case 3:return l.a(2,o());case 4:throw new ir(s.status,`Request failed after ${n} retries`);case 5:return l.a(2,s)}},null,null,null,Promise)},u.n=1,r(o());case 1:return s=u.v,u.a(2,s.json())}},null,null,null,Promise)}function kr(e,t={},i){var n,a,o;return y(function(s){for(;;)switch(s.n){case 0:return n=new AbortController,a=setTimeout(()=>n.abort(),i),t.signal=n.signal,s.n=1,r(fetch(e,t));case 1:return o=s.v,clearTimeout(a),s.a(2,o)}},null,null,null,Promise)}function Er(e){for(var t=e.length;--t>=0;)e[t]=0}Er(new Array(576)),Er(new Array(60)),Er(new Array(512)),Er(new Array(256)),Er(new Array(29)),Er(new Array(30));var Sr=(e,t,i,n)=>{for(var a=65535&e,r=e>>>16&65535,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{r=r+(a=a+t[n++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16},Pr=new Uint32Array((()=>{for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})()),Mr=(e,t,i,n)=>{var a=Pr,r=n+i;e^=-1;for(var o=n;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},Tr={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ar=0,Dr=4,xr=5,Cr=6,Ir=0,Lr=1,_r=2,Rr=-2,Fr=-3,Or=-4,Nr=-5,Wr=8,$r=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),jr=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)$r(i,n)&&(e[n]=i[n])}}return e},Br=e=>{for(var t=0,i=0,n=e.length;i<n;i++)t+=e[i].length;for(var a=new Uint8Array(t),r=0,o=0,s=e.length;r<s;r++){var u=e[r];a.set(u,o),o+=u.length}return a},zr=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){zr=!1}for(var Ur=new Uint8Array(256),Hr=0;Hr<256;Hr++)Ur[Hr]=Hr>=252?6:Hr>=248?5:Hr>=240?4:Hr>=224?3:Hr>=192?2:1;Ur[254]=Ur[254]=1;var Gr=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,i,n,a,r,o=e.length,s=0;for(a=0;a<o;a++)55296==(64512&(i=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=e.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(n-56320),a++),s+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(s),r=0,a=0;r<s;a++)55296==(64512&(i=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=e.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(n-56320),a++),i<128?t[r++]=i:i<2048?(t[r++]=192|i>>>6,t[r++]=128|63&i):i<65536?(t[r++]=224|i>>>12,t[r++]=128|i>>>6&63,t[r++]=128|63&i):(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63,t[r++]=128|i>>>6&63,t[r++]=128|63&i);return t},Vr=(e,t)=>{var i,n,a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var r=new Array(2*a);for(n=0,i=0;i<a;){var o=e[i++];if(o<128)r[n++]=o;else{var s=Ur[o];if(s>4)r[n++]=65533,i+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&i<a;)o=o<<6|63&e[i++],s--;s>1?r[n++]=65533:o<65536?r[n++]=o:(o-=65536,r[n++]=55296|o>>10&1023,r[n++]=56320|1023&o)}}}return((e,t)=>{if(t<65534&&e.subarray&&zr)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i})(r,n)},Kr=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);for(var i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+Ur[e[i]]>t?i:t};var Xr=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Yr=16209,qr=function(e,t){var i,n,a,r,o,s,u,l,d,h,c,f,m,p,g,v,y,b,w,k,E,S,P,M,T=e.state;i=e.next_in,P=e.input,n=i+(e.avail_in-5),a=e.next_out,M=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=T.dmax,u=T.wsize,l=T.whave,d=T.wnext,h=T.window,c=T.hold,f=T.bits,m=T.lencode,p=T.distcode,g=(1<<T.lenbits)-1,v=(1<<T.distbits)-1;e:do{f<15&&(c+=P[i++]<<f,f+=8,c+=P[i++]<<f,f+=8),y=m[c&g];t:for(;;){if(c>>>=b=y>>>24,f-=b,0===(b=y>>>16&255))M[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){T.mode=16191;break e}e.msg="invalid literal/length code",T.mode=Yr;break e}y=m[(65535&y)+(c&(1<<b)-1)];continue t}for(w=65535&y,(b&=15)&&(f<b&&(c+=P[i++]<<f,f+=8),w+=c&(1<<b)-1,c>>>=b,f-=b),f<15&&(c+=P[i++]<<f,f+=8,c+=P[i++]<<f,f+=8),y=p[c&v];;){if(c>>>=b=y>>>24,f-=b,16&(b=y>>>16&255)){if(k=65535&y,f<(b&=15)&&(c+=P[i++]<<f,(f+=8)<b&&(c+=P[i++]<<f,f+=8)),(k+=c&(1<<b)-1)>s){e.msg="invalid distance too far back",T.mode=Yr;break e}if(c>>>=b,f-=b,k>(b=a-r)){if((b=k-b)>l&&T.sane){e.msg="invalid distance too far back",T.mode=Yr;break e}if(E=0,S=h,0===d){if(E+=u-b,b<w){w-=b;do{M[a++]=h[E++]}while(--b);E=a-k,S=M}}else if(d<b){if(E+=u+d-b,(b-=d)<w){w-=b;do{M[a++]=h[E++]}while(--b);if(E=0,d<w){w-=b=d;do{M[a++]=h[E++]}while(--b);E=a-k,S=M}}}else if(E+=d-b,b<w){w-=b;do{M[a++]=h[E++]}while(--b);E=a-k,S=M}for(;w>2;)M[a++]=S[E++],M[a++]=S[E++],M[a++]=S[E++],w-=3;w&&(M[a++]=S[E++],w>1&&(M[a++]=S[E++]))}else{E=a-k;do{M[a++]=M[E++],M[a++]=M[E++],M[a++]=M[E++],w-=3}while(w>2);w&&(M[a++]=M[E++],w>1&&(M[a++]=M[E++]))}break}if(64&b){e.msg="invalid distance code",T.mode=Yr;break e}y=p[(65535&y)+(c&(1<<b)-1)]}}break}}while(i<n&&a<o);i-=w=f>>3,c&=(1<<(f-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=a<o?o-a+257:257-(a-o),T.hold=c,T.bits=f},Jr=15,Qr=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Zr=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),eo=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),to=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),io=(e,t,i,n,a,r,o,s)=>{var u,l,d,h,c,f,m,p,g,v=s.bits,y=0,b=0,w=0,k=0,E=0,S=0,P=0,M=0,T=0,A=0,D=null,x=new Uint16Array(16),C=new Uint16Array(16),I=null;for(y=0;y<=Jr;y++)x[y]=0;for(b=0;b<n;b++)x[t[i+b]]++;for(E=v,k=Jr;k>=1&&0===x[k];k--);if(E>k&&(E=k),0===k)return a[r++]=20971520,a[r++]=20971520,s.bits=1,0;for(w=1;w<k&&0===x[w];w++);for(E<w&&(E=w),M=1,y=1;y<=Jr;y++)if(M<<=1,(M-=x[y])<0)return-1;if(M>0&&(0===e||1!==k))return-1;for(C[1]=0,y=1;y<Jr;y++)C[y+1]=C[y]+x[y];for(b=0;b<n;b++)0!==t[i+b]&&(o[C[t[i+b]]++]=b);if(0===e?(D=I=o,f=20):1===e?(D=Qr,I=Zr,f=257):(D=eo,I=to,f=0),A=0,b=0,y=w,c=r,S=E,P=0,d=-1,h=(T=1<<E)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){m=y-P,o[b]+1<f?(p=0,g=o[b]):o[b]>=f?(p=I[o[b]-f],g=D[o[b]-f]):(p=96,g=0),u=1<<y-P,w=l=1<<S;do{a[c+(A>>P)+(l-=u)]=m<<24|p<<16|g}while(0!==l);for(u=1<<y-1;A&u;)u>>=1;if(0!==u?(A&=u-1,A+=u):A=0,b++,0===--x[y]){if(y===k)break;y=t