UNPKG

@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.64 MB
import{css as e,html as t,LitElement as i,adoptStyles as n,unsafeCSS as a,svg as r}from"lit";import{repeat as o}from"lit/directives/repeat.js";function s(e,t){this.v=e,this.k=t}function u(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 l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return new s(e,0)}function h(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 c=0;function f(e){return"__private_"+c+++"_"+e}function m(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,A(n.key),n)}}function p(e,t,i){return t&&m(e.prototype,t),i&&m(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(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 u(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)?u(e,t):void 0}}(e))||t){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}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 v(){return v=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},v.apply(null,arguments)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,M(e,t)}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function k(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 E(){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 T(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]())):(T(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,T(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=l,T(h,"constructor",l),T(l,"constructor",u),u.displayName="GeneratorFunction",T(l,a,"GeneratorFunction"),T(h),T(h,a,"Generator"),T(h,n,function(){return this}),T(h,"toString",function(){return"[object Generator]"}),(E=function(){return{w:r,m:c}})()}function S(e,t,i,n,a){var r=function(e,t,i,n,a){return new P(E().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 P(e,t){function i(n,a,r,o){try{var u=e[n](a),l=u.value;return l instanceof s?t.resolve(l.v).then(function(e){i("next",e,r,o)},function(e){i("throw",e,r,o)}):t.resolve(l).then(function(e){u.value=e,r(u)},function(e){return i("throw",e,r,o)})}catch(e){o(e)}}var n;this.next||(T(P.prototype),T(P.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),T(this,"_invoke",function(e,a,r){function o(){return new t(function(t,n){i(e,r,t,n)})}return n=n?n.then(o,o):o()},!0)}function T(e,t,i,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}T=function(e,t,i,n){function r(t,i){T(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))},T(e,t,i,n)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function A(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 D(e){var t="function"==typeof Map?new Map:void 0;return D=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(w())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var a=new(e.bind.apply(e,n));return i&&M(a,i.prototype),a}(e,arguments,y(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),M(i,e)},D(e)}var x,C,I,L,_,R,F,O,W,N,$,j,B=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(){},p(e,[{key:"shadowRoot",get:function(){return this.__host.__shadowRoot}}])}(),z=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},U=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)},H=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},G=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=H(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=H(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:v({get:()=>null!=o?o:s},K),srcElement:v({get:()=>e.target},K),currentTarget:v({get:()=>u},K),eventPhase:v({get:()=>r},K),composedPath:v({value:()=>t},K),stopPropagation:v({value:()=>{n=!0,l.call(e)}},K),stopImmediatePropagation:v({value:()=>{a=!0,d.call(e)}},K)});var h=(t,i,n)=>{"function"==typeof t?t(e):"function"==typeof(null==t?void 0:t.handleEvent)&&t.handleEvent(e),i.once&&n.delete(t)},c=()=>(u=null,r=0,!e.defaultPrevented),f=t.slice().reverse();o=this.__host&&e.composed?null:this;for(var m,p=e=>{for(s=this;s.__host&&e.includes(s.__host);)s=s.__host},y=g(f);!(m=y()).done;){var b=m.value;o||s&&s!==b.__host||p(f.slice(f.indexOf(b))),u=b,r=b===e.target?2:1;var w=b.__captureEventListeners.get(e.type);if(w)for(var k,E=g(w);!(k=E()).done;){var S=k.value;if(h(S[0],S[1],w),a)return c()}if(n)return c()}var P=e.bubbles?t:[this];s=null;for(var T,M=g(P);!(T=M()).done;){var A=T.value;o||s&&A!==s.__host||p(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=g(D);!(x=C()).done;){var I=x.value;if(h(I[0],I[1],D),a)return c()}if(n)return c()}return c()},e}(),V=G,K={__proto__:null,enumerable:!0};Object.freeze(K);var X=(N=function(){function e(e,t={}){if(x.set(this,!1),C.set(this,!1),I.set(this,!1),L.set(this,!1),_.set(this,Date.now()),R.set(this,!1),F.set(this,void 0),O.set(this,void 0),W.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;z(this,x,!!n,"f"),z(this,C,!!i,"f"),z(this,I,!!a,"f"),z(this,F,`${e}`,"f"),z(this,O,null,"f"),z(this,W,!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(){z(this,L,!0,"f")},t.composedPath=function(){return U(this,W,"f")?[U(this,O,"f")]:[]},t.stopPropagation=function(){z(this,R,!0,"f")},p(e,[{key:"target",get:function(){return U(this,O,"f")}},{key:"currentTarget",get:function(){return U(this,O,"f")}},{key:"srcElement",get:function(){return U(this,O,"f")}},{key:"type",get:function(){return U(this,F,"f")}},{key:"cancelable",get:function(){return U(this,x,"f")}},{key:"defaultPrevented",get:function(){return U(this,x,"f")&&U(this,L,"f")}},{key:"timeStamp",get:function(){return U(this,_,"f")}},{key:"returnValue",get:function(){return!U(this,x,"f")||!U(this,L,"f")}},{key:"bubbles",get:function(){return U(this,C,"f")}},{key:"composed",get:function(){return U(this,I,"f")}},{key:"eventPhase",get:function(){return U(this,W,"f")?N.AT_TARGET:N.NONE}},{key:"cancelBubble",get:function(){return U(this,R,"f")},set:function(e){e&&z(this,R,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,_=new WeakMap,R=new WeakMap,F=new WeakMap,O=new WeakMap,W=new WeakMap,N.NONE=0,N.CAPTURING_PHASE=1,N.AT_TARGET=2,N.BUBBLING_PHASE=3,N);Object.defineProperties(X.prototype,{initEvent:K,stopImmediatePropagation:K,preventDefault:K,target:K,currentTarget:K,srcElement:K,type:K,cancelable:K,defaultPrevented:K,timeStamp:K,composedPath:K,returnValue:K,bubbles:K,composed:K,eventPhase:K,cancelBubble:K,stopPropagation:K,isTrusted:K});var Y=(j=function(e){function t(t,i={}){var n,a;return a=e.call(this,t,i)||this,$.set(a,void 0),z(a,$,null!==(n=null==i?void 0:i.detail)&&void 0!==n?n:null,"f"),a}return b(t,e),t.prototype.initCustomEvent=function(e,t,i,n){throw new Error("Method not implemented.")},p(t,[{key:"detail",get:function(){return U(this,$,"f")}}])}(X),$=new WeakMap,j);Object.defineProperties(Y.prototype,{detail:K});var q,J,Q,Z=X,ee=Y;null!==(q=globalThis.Event)&&void 0!==q||(globalThis.Event=Z),null!==(J=globalThis.CustomEvent)&&void 0!==J||(globalThis.CustomEvent=ee);var te=new WeakMap,ie=e=>{var t=te.get(e);return void 0===t&&te.set(e,t=new Map),t},ne=function(e){function t(){return e.apply(this,arguments)||this}return b(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}b(t,e);var i=t.prototype;return i.setAttribute=function(e,t){ie(this).set(e,String(t))},i.removeAttribute=function(e){ie(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 ie(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 B(this);return this.__internals=e,e},i.getAttribute=function(e){var t=ie(this).get(e);return null!=t?t:null},p(t,[{key:"attributes",get:function(){return Array.from(ie(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()}}])}(V));function ae(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 re(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 oe(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!==(Q=globalThis.litServerRoot)&&void 0!==Q||(globalThis.litServerRoot=Object.defineProperty(new ne,"localName",{get:()=>"lit-server-root"})),"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ne),"function"==typeof SuppressedError&&SuppressedError;var se;!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"}(se||(se={}));var ue,le={},de=le.NAMI_SDK_VERSION,he=void 0===de?"3.3.2":de,ce=le.PLATFORM_ID_REQUIRED,fe=void 0===ce?"Platform ID is required":ce,me=le.DEVICE_ID_REQUIRED,pe=void 0===me?"Device ID is required":me,ge=le.EXTERNAL_ID_REQUIRED,ve=void 0===ge?"External ID is required":ge,ye=le.SDK_NOT_INITIALIZED,be=void 0===ye?"SDK has not been initialized. Make sure to call Nami.configure() first!":ye,we=le.CAMPAIGN_NOT_AVAILABLE,ke=void 0===we?"Campaign is not available":we,Ee=le.FLOW_SCREENS_NOT_AVAILABLE,Se=void 0===Ee?"Flow screens not available":Ee,Pe=le.UNABLE_TO_UPDATE_CDP_ID,Te=void 0===Pe?"Unable to update CDP id in anonymous mode":Pe,Me=le.ANONYMOUS_MODE_ALREADY_ON,Ae=void 0===Me?"Anonymous mode is already turned on.":Me,De=le.ANONYMOUS_MODE_ALREADY_OFF,xe=void 0===De?"Anonymous mode is already turned off.":De,Ce=le.DEVICE_ID_NOT_SET,Ie=void 0===Ce?"Nami Device ID is not set":Ce,Le=le.AUTH_DEVICE,_e=void 0===Le?"nami_auth_device":Le,Re=le.NAMI_CONFIGURATION,Fe=void 0===Re?"nami_configuration":Re,Oe=le.NAMI_PROFILE,We=void 0===Oe?"nami_profile":Oe,Ne=le.API_CONFIG,$e=void 0===Ne?"api_config":Ne,je=le.API_CAMPAIGN_RULES,Be=void 0===je?"api_campaign_rules":je,ze=le.API_PAYWALLS,Ue=void 0===ze?"api_paywalls":ze,He=le.API_PRODUCTS,Ge=void 0===He?"api_products":He,Ve=le.API_ACTIVE_ENTITLEMENTS,Ke=void 0===Ve?"api_active_entitlements":Ve,Xe=le.SERVER_NAMI_ENTITLEMENTS,Ye=void 0===Xe?"server_active_entitlements":Xe,qe=le.INITIAL_APP_CONFIG,Je=void 0===qe?"initial_app_config":qe,Qe=le.INITIAL_CAMPAIGN_RULES,Ze=void 0===Qe?"initial_campaign_rules":Qe,et=le.INITIAL_PAYWALLS,tt=void 0===et?"initial_paywalls":et,it=le.INITIAL_PRODUCTS,nt=void 0===it?"initial_products":it,at=le.LOCAL_NAMI_ENTITLEMENTS,rt=void 0===at?"local_active_entitlements":at,ot=le.CUSTOMER_ATTRIBUTES_KEY_PREFIX,st=void 0===ot?"nami_cmr_attributes_":ot,ut=le.NAMI_CUSTOMER_JOURNEY_STATE,lt=void 0===ut?"nami_customer_journey_state":ut,dt=le.ANONYMOUS_MODE,ht=void 0===dt?"nami_anonymous_mode":dt,ct=le.ANONYMOUS_UUID,ft=void 0===ct?"nami_anonymous_uuid":ct,mt=le.KEY_SESSION_COUNTER,pt=void 0===mt?"nami_session_counter":mt,gt=le.INITIAL_SESSION_COUNTER_VALUE,vt=void 0===gt?1:gt,yt=le.NAMI_LAST_IMPRESSION_ID,bt=void 0===yt?"nami_last_impression_id":yt,wt=le.NAMI_PURCHASE_IMPRESSION_ID,kt=void 0===wt?"nami_purchase_impression_id":wt,Et=le.NAMI_LAUNCH_ID,St=void 0===Et?"nami_launch_id":Et,Pt=le.NAMI_SESSION_ID,Tt=void 0===Pt?"nami_session_id":Pt,Mt=le.NAMI_LANGUAGE_CODE,At=void 0===Mt?"nami_language_code":Mt,Dt=le.NAMI_PURCHASE_CHANNEL,xt=void 0===Dt?"nami_purchase_channel":Dt,Ct=le.API_VERSION,It=le.BASE_URL_PATH,Lt=void 0===It?`sdk/${void 0===Ct?"v3":Ct}/platform`:It,_t=le.BASE_URL,Rt=void 0===_t?"https://app.namiml.com":_t,Ft=le.BASE_STAGING_URL,Ot=void 0===Ft?"https://app-staging.namiml.com":Ft,Wt=le.CUSTOM_HOST_PREFIX,Nt=void 0===Wt?"namiAPIHost=":Wt,$t=le.USE_STAGING_API,jt=void 0===$t?"useStagingAPI":$t,Bt=le.EXTENDED_CLIENT_INFO_PREFIX,zt=void 0===Bt?"extendedClientInfo":Bt,Ut=le.EXTENDED_CLIENT_INFO_DELIMITER,Ht=void 0===Ut?":":Ut,Gt=le.VALIDATE_PRODUCT_GROUPS,Vt=void 0===Gt?"validateProductGroups":Gt,Kt=le.API_MAX_CALLS_LIMIT,Xt=void 0===Kt?2:Kt,Yt=le.API_RETRY_DELAY_SEC,qt=void 0===Yt?2:Yt,Jt=le.API_TIMEOUT_LIMIT,Qt=void 0===Jt?2e4:Jt,Zt=le.DEVICE_API_TIMEOUT_LIMIT,ei=void 0===Zt?3e3:Zt,ti=le.STATUS_BAD_REQUEST,ii=void 0===ti?400:ti,ni=le.STATUS_NOT_FOUND,ai=void 0===ni?404:ni,ri=le.STATUS_CONFLICT,oi=void 0===ri?409:ri,si=le.STATUS_INTERNAL_SERVER_ERROR,ui=void 0===si?500:si,li=le.INITIAL_SUCCESS,di=void 0===li?"Initial success":li,hi=le.RECONFIG_SUCCESS,ci=void 0===hi?"Reconfig success":hi,fi=le.ALREADY_CONFIGURED,mi=void 0===fi?"Already configured":fi,pi=le.AVAILABLE_CAMPAIGNS_CHANGED,gi=void 0===pi?"AvailableCampaignsChanged":pi,vi=le.PAYWALL_ACTION_EVENT,yi=void 0===vi?"PaywallActionEvent":vi,bi=le.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,wi=void 0===bi?"AvailableActiveEntitlementsChanged":bi,ki=le.CUSTOMER_JOURNEY_STATE_CHANGED,Ei=void 0===ki?"CustomerJourneyStateChanged":ki,Si=le.SKU_TEXT_REGEX,Pi=void 0===Si?/\$\{sku\.(\w+)(:\d+)?\}/g:Si,Ti=le.VAR_REGEX,Mi=void 0===Ti?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:Ti,Ai=le.SMART_TEXT_PATTERN,Di=void 0===Ai?"${":Ai;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(ue||(ue={}));var xi={debug:ue.DEBUG,info:ue.INFO,warn:ue.WARN,error:ue.ERROR},Ci=function(){function e(){this.currentLogLevel=ue.DEBUG,this.setLogger=e=>{this.currentLogLevel=e?xi[e]:ue.WARN}}var t=e.prototype;return t.debug=function(e,...t){this.shouldLog(ue.DEBUG)&&console.debug(this.formatMessage(ue.DEBUG,e,...t))},t.info=function(e,...t){this.shouldLog(ue.INFO)&&console.info(this.formatMessage(ue.INFO,e,...t))},t.warn=function(e,...t){this.shouldLog(ue.WARN)&&console.warn(this.formatMessage(ue.WARN,e,...t))},t.error=function(e,...t){this.shouldLog(ue.ERROR)&&console.error(this.formatMessage(ue.ERROR,e,...t))},t.shouldLog=function(e){return e>=this.currentLogLevel},t.formatMessage=function(e,t,...i){var n=ue[e];return`[${(new Date).toISOString()}] [${n}] ${t} ${i=i.map(e=>"object"==typeof e?JSON.stringify(e):e)}`},e}(),Ii=new Ci;function Li(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 _i(e,t){return e===t||e!=e&&t!=t}function Ri(e,t){for(var i=e.length;i--;)if(_i(e[i][0],t))return i;return-1}var Fi=Array.prototype.splice;function Oi(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])}}Oi.prototype.clear=function(){this.__data__=[],this.size=0},Oi.prototype.delete=function(e){var t=this.__data__,i=Ri(t,e);return!(i<0)&&(i==t.length-1?t.pop():Fi.call(t,i,1),--this.size,!0)},Oi.prototype.get=function(e){var t=this.__data__,i=Ri(t,e);return i<0?void 0:t[i][1]},Oi.prototype.has=function(e){return Ri(this.__data__,e)>-1},Oi.prototype.set=function(e,t){var i=this.__data__,n=Ri(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var Wi="object"==typeof global&&global&&global.Object===Object&&global,Ni="object"==typeof self&&self&&self.Object===Object&&self,$i=Wi||Ni||Function("return this")(),ji=$i.Symbol,Bi=Object.prototype,zi=Bi.hasOwnProperty,Ui=Bi.toString,Hi=ji?ji.toStringTag:void 0;var Gi=Object.prototype.toString;var Vi=ji?ji.toStringTag:void 0;function Ki(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Vi&&Vi in Object(e)?function(e){var t=zi.call(e,Hi),i=e[Hi];try{e[Hi]=void 0;var n=!0}catch(e){}var a=Ui.call(e);return n&&(t?e[Hi]=i:delete e[Hi]),a}(e):function(e){return Gi.call(e)}(e)}function Xi(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Yi(e){if(!Xi(e))return!1;var t=Ki(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var qi,Ji=$i["__core-js_shared__"],Qi=(qi=/[^.]+$/.exec(Ji&&Ji.keys&&Ji.keys.IE_PROTO||""))?"Symbol(src)_1."+qi:"";var Zi=Function.prototype.toString;function en(e){if(null!=e){try{return Zi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var tn=/^\[object .+?Constructor\]$/,nn=Function.prototype,an=Object.prototype,rn=nn.toString,on=an.hasOwnProperty,sn=RegExp("^"+rn.call(on).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function un(e){return!(!Xi(e)||(t=e,Qi&&Qi in t))&&(Yi(e)?sn:tn).test(en(e));var t}function ln(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return un(i)?i:void 0}var dn=ln($i,"Map"),hn=ln(Object,"create");var cn=Object.prototype.hasOwnProperty;var fn=Object.prototype.hasOwnProperty;function mn(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 pn(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 gn(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])}}mn.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},mn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},mn.prototype.get=function(e){var t=this.__data__;if(hn){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return cn.call(t,e)?t[e]:void 0},mn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:fn.call(t,e)},mn.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},gn.prototype.clear=function(){this.size=0,this.__data__={hash:new mn,map:new(dn||Oi),string:new mn}},gn.prototype.delete=function(e){var t=pn(this,e).delete(e);return this.size-=t?1:0,t},gn.prototype.get=function(e){return pn(this,e).get(e)},gn.prototype.has=function(e){return pn(this,e).has(e)},gn.prototype.set=function(e,t){var i=pn(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function vn(e){var t=this.__data__=new Oi(e);this.size=t.size}vn.prototype.clear=function(){this.__data__=new Oi,this.size=0},vn.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},vn.prototype.get=function(e){return this.__data__.get(e)},vn.prototype.has=function(e){return this.__data__.has(e)},vn.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Oi){var n=i.__data__;if(!dn||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new gn(n)}return i.set(e,t),this.size=i.size,this};function yn(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new gn;++t<i;)this.add(e[t])}function bn(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 wn(e,t){return e.has(t)}yn.prototype.add=yn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},yn.prototype.has=function(e){return this.__data__.has(e)};function kn(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 yn: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(!bn(t,function(e,t){if(!wn(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 En=$i.Uint8Array;function Sn(e){var t=-1,i=Array(e.size);return e.forEach(function(e,n){i[++t]=[n,e]}),i}function Pn(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var Tn=ji?ji.prototype:void 0,Mn=Tn?Tn.valueOf:void 0;var An=Array.isArray;var Dn=Object.prototype.propertyIsEnumerable,xn=Object.getOwnPropertySymbols,Cn=xn?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}(xn(e),function(t){return Dn.call(e,t)}))}:function(){return[]};function In(e){return null!=e&&"object"==typeof e}function Ln(e){return In(e)&&"[object Arguments]"==Ki(e)}var _n=Object.prototype,Rn=_n.hasOwnProperty,Fn=_n.propertyIsEnumerable,On=Ln(function(){return arguments}())?Ln:function(e){return In(e)&&Rn.call(e,"callee")&&!Fn.call(e,"callee")};var Wn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Nn=Wn&&"object"==typeof module&&module&&!module.nodeType&&module,$n=Nn&&Nn.exports===Wn?$i.Buffer:void 0,jn=($n?$n.isBuffer:void 0)||function(){return!1},Bn=/^(?:0|[1-9]\d*)$/;function zn(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Bn.test(e))&&e>-1&&e%1==0&&e<t}function Un(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Hn={};function Gn(e){return function(t){return e(t)}}Hn["[object Float32Array]"]=Hn["[object Float64Array]"]=Hn["[object Int8Array]"]=Hn["[object Int16Array]"]=Hn["[object Int32Array]"]=Hn["[object Uint8Array]"]=Hn["[object Uint8ClampedArray]"]=Hn["[object Uint16Array]"]=Hn["[object Uint32Array]"]=!0,Hn["[object Arguments]"]=Hn["[object Array]"]=Hn["[object ArrayBuffer]"]=Hn["[object Boolean]"]=Hn["[object DataView]"]=Hn["[object Date]"]=Hn["[object Error]"]=Hn["[object Function]"]=Hn["[object Map]"]=Hn["[object Number]"]=Hn["[object Object]"]=Hn["[object RegExp]"]=Hn["[object Set]"]=Hn["[object String]"]=Hn["[object WeakMap]"]=!1;var Vn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kn=Vn&&"object"==typeof module&&module&&!module.nodeType&&module,Xn=Kn&&Kn.exports===Vn&&Wi.process,Yn=function(){try{var e=Kn&&Kn.require&&Kn.require("util").types;return e||Xn&&Xn.binding&&Xn.binding("util")}catch(e){}}(),qn=Yn&&Yn.isTypedArray,Jn=qn?Gn(qn):function(e){return In(e)&&Un(e.length)&&!!Hn[Ki(e)]},Qn=Object.prototype.hasOwnProperty;function Zn(e,t){var i=An(e),n=!i&&On(e),a=!i&&!n&&jn(e),r=!i&&!n&&!a&&Jn(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)!Qn.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||zn(l,u))||s.push(l);return s}var ea=Object.prototype;function ta(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ea)}function ia(e,t){return function(i){return e(t(i))}}var na=ia(Object.keys,Object),aa=Object.prototype.hasOwnProperty;function ra(e){return null!=(t=e)&&Un(t.length)&&!Yi(t)?Zn(e):function(e){if(!ta(e))return na(e);var t=[];for(var i in Object(e))aa.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e);var t}function oa(e){return function(e,t,i){var n=t(e);return An(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,ra,Cn)}var sa=Object.prototype.hasOwnProperty;var ua=ln($i,"DataView"),la=ln($i,"Promise"),da=ln($i,"Set"),ha=ln($i,"WeakMap"),ca="[object Map]",fa="[object Promise]",ma="[object Set]",pa="[object WeakMap]",ga="[object DataView]",va=en(ua),ya=en(dn),ba=en(la),wa=en(da),ka=en(ha),Ea=Ki;(ua&&Ea(new ua(new ArrayBuffer(1)))!=ga||dn&&Ea(new dn)!=ca||la&&Ea(la.resolve())!=fa||da&&Ea(new da)!=ma||ha&&Ea(new ha)!=pa)&&(Ea=function(e){var t=Ki(e),i="[object Object]"==t?e.constructor:void 0,n=i?en(i):"";if(n)switch(n){case va:return ga;case ya:return ca;case ba:return fa;case wa:return ma;case ka:return pa}return t});var Sa="[object Arguments]",Pa="[object Array]",Ta="[object Object]",Ma=Object.prototype.hasOwnProperty;function Aa(e,t,i,n,a,r){var o=An(e),s=An(t),u=o?Pa:Ea(e),l=s?Pa:Ea(t),d=(u=u==Sa?Ta:u)==Ta,h=(l=l==Sa?Ta:l)==Ta,c=u==l;if(c&&jn(e)){if(!jn(t))return!1;o=!0,d=!1}if(c&&!d)return r||(r=new vn),o||Jn(e)?kn(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 En(e),new En(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return _i(+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=Sn;case"[object Set]":var u=1&n;if(s||(s=Pn),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=kn(s(e),s(t),n,a,r,o);return o.delete(e),d;case"[object Symbol]":if(Mn)return Mn.call(e)==Mn.call(t)}return!1}(e,t,u,i,n,a,r);if(!(1&i)){var f=d&&Ma.call(e,"__wrapped__"),m=h&&Ma.call(t,"__wrapped__");if(f||m){var p=f?e.value():e,g=m?t.value():t;return r||(r=new vn),a(p,g,i,n,r)}}return!!c&&(r||(r=new vn),function(e,t,i,n,a,r){var o=1&i,s=oa(e),u=s.length;if(u!=oa(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:sa.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 Da(e,t,i,n,a){return e===t||(null==e||null==t||!In(e)&&!In(t)?e!=e&&t!=t:Aa(e,t,i,n,Da,a))}function xa(e){return e==e&&!Xi(e)}function Ca(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function Ia(e){var t=function(e){for(var t=ra(e),i=t.length;i--;){var n=t[i],a=e[n];t[i]=[n,a,xa(a)]}return t}(e);return 1==t.length&&t[0][2]?Ca(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(!Da(l,u,3,n,new vn))return!1}return!0}(i,0,t)}}function La(e){return"symbol"==typeof e||In(e)&&"[object Symbol]"==Ki(e)}var _a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ra=/^\w*$/;function Fa(e,t){if(An(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!La(e))||(Ra.test(e)||!_a.test(e)||null!=t&&e in Object(t))}function Oa(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(Oa.Cache||gn),i}Oa.Cache=gn;var Wa,Na,$a,ja=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ba=/\\(\\)?/g,za=(Wa=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ja,function(e,i,n,a){t.push(n?a.replace(Ba,"$1"):i||e)}),t},Na=Oa(Wa,function(e){return 500===$a.size&&$a.clear(),e}),$a=Na.cache,Na);var Ua=ji?ji.prototype:void 0,Ha=Ua?Ua.toString:void 0;function Ga(e){if("string"==typeof e)return e;if(An(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,Ga)+"";if(La(e))return Ha?Ha.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Va(e){return null==e?"":Ga(e)}function Ka(e,t){return An(e)?e:Fa(e,t)?[e]:za(Va(e))}function Xa(e){if("string"==typeof e||La(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ya(e,t){for(var i=0,n=(t=Ka(t,e)).length;null!=e&&i<n;)e=e[Xa(t[i++])];return i&&i==n?e:void 0}function qa(e,t){return null!=e&&t in Object(e)}function Ja(e,t){return null!=e&&function(e,t,i){for(var n=-1,a=(t=Ka(t,e)).length,r=!1;++n<a;){var o=Xa(t[n]);if(!(r=null!=e&&i(e,o)))break;e=e[o]}return r||++n!=a?r:!!(a=null==e?0:e.length)&&Un(a)&&zn(o,a)&&(An(e)||On(e))}(e,t,qa)}function Qa(e,t){return Fa(e)&&xa(t)?Ca(Xa(e),t):function(i){var n=function(e,t,i){var n=null==e?void 0:Ya(e,t);return void 0===n?i:n}(i,e);return void 0===n&&n===t?Ja(i,e):Da(t,n,3)}}function Za(e){return e}function er(e){return Fa(e)?(t=Xa(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Ya(t,e)}}(e);var t}function tr(e){return e!=e}function ir(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,tr,i)}(e,t,0)>-1}var nr=da&&1/Pn(new da([,-0]))[1]==1/0?function(e){return new da(e)}:function(){};function ar(e,t){return e&&e.length?function(e,t,i){var n=-1,a=ir,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:nr(e);if(l)return Pn(l);o=!1,a=wn,u=new yn}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?Za:"object"==typeof i?An(i)?Qa(i[0],i[1]):Ia(i):er(i)):[];var i}var rr=function(){function e(){this.memoryStore={}}var t=e.prototype;return t.setDevice=function(e){this.setItem(_e,e)},t.getDevice=function(){return this.getItem(_e)},t.resetDevice=function(){this.resetItem(_e)},t.getAnonymousMode=function(){return this.getItem(ht)||!1},t.setAnonymousMode=function(e){this.setItem(ht,e)},t.clearAnonymousMode=function(){this.resetItem(ht)},t.setAppConfig=function(e,t){this.setItem(e,t)},t.getAppConfig=function(e){return this.getItem(e)},t.setLanguageCode=function(e){this.setItem(At,e||"en")},t.getLanguageCode=function(){return this.getItem(At)||"en"},t.setCampaignRules=function(e,t){e!==Ze?this.setItem(e,t):this.memoryStore[Ze]=JSON.stringify(t)},t.getCampaignRules=function(e){return e===Ze?this.memoryStore[Ze]?JSON.parse(this.memoryStore[Ze]):null:this.getItem(e)},t.setPaywalls=function(e,t){e!==tt?this.setItem(e,t):this.memoryStore[tt]=JSON.stringify(t)},t.getPaywalls=function(e){return e===tt?this.memoryStore[tt]?JSON.parse(this.memoryStore[tt]):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(Ge))&&void 0!==e?e:[];return ar(Li([...null!==(t=this.getItem(nt))&&void 0!==t?t:[],...i]),"sku_ref_id")},t.setNamiConfig=function(e){this.setItem(Fe,e)},t.getNamiConfig=function(){return this.getItem(Fe)},t.setCustomerAttribute=function(e,t){this.setItem(st+e,t)},t.getCustomerAttribute=function(e){return this.getItem(st+e)},t.getAllCustomerAttributes=function(){return Object.entries(localStorage).filter(([e])=>e.includes(st)).map(([e,t])=>e.replace(st,"")+":"+t)},t.getAllCustomerAttributesKeys=function(){return Object.keys(localStorage).filter(e=>e.includes(st)).map(e=>e.replace(st,""))},t.clearCustomerAttribute=function(e){var t=st+e,i=this.getItem(t);return i&&this.resetItem(t),!!i},t.clearAllCustomerAttributes=function(){Object.keys(localStorage).filter(e=>e.includes(st)).map(e=>this.resetItem(e))},t.setNamiProfile=function(e){this.setItem(We,e)},t.getNamiProfile=function(){return this.getItem(We)},t.removeNamiProfile=function(){this.resetItem(We)},t.setCustomerJourneyState=function(e){this.setItem(lt,e)},t.getCustomerJourneyState=function(){return this.getItem(lt)},t.setSessionCounter=function(){var e=this.getItem(pt),t=e?parseInt(e):vt||vt;this.setItem(pt,t+1)},t.getSessionCounter=function(){var e=this.getItem(pt);return e?parseInt(e):vt},t.setLastImpressionId=function(e){this.setItem(bt,e)},t.getLastImpressionId=function(){var e;return null!==(e=this.getItem(bt))&&void 0!==e?e:""},t.setPurchaseImpression=function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(kt,t)},t.getPurchaseImpression=function(){var e;return null!==(e=this.getItem(kt))&&void 0!==e?e:""},t.setSessionId=function(e){e&&this.setItem(Tt,e)},t.getSessionId=function(){var e;return null!==(e=this.getItem(Tt))&&void 0!==e?e:""},t.clearSessionId=function(){this.resetItem(Tt)},t.setLaunchId=function(e){e&&this.setItem(St,e)},t.getLaunchId=function(){var e;return null!==(e=this.getItem(St))&&void 0!==e?e:""},t.clearLaunchId=function(){this.resetItem(St)},t.setPurchaseChannel=function(e){e&&this.setItem(xt,e)},t.getPurchaseChannel=function(){return this.getItem(xt)},t.getAnonymousUUID=function(){return this.getItem(ft)},t.setAnonymousUUID=function(e){this.setItem(ft,e)},t.clearAnonymousUUID=function(){this.resetItem(ft)},t.setItem=function(e,t){var i;try{i=JSON.stringify(t)}catch(t){return void Ii.error(`Serialization failed for ${e}`,t)}try{localStorage.setItem(e,i)}catch(t){Ii.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&&Ii.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&&Ii.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]},t.clear=function(){try{localStorage.clear()}catch(e){Ii.error("Error clearing localStorage:",e)}this.memoryStore={}},e}(),or=new rr,sr=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 b(t,e),t}(D(Error)),ur=function(e){function t(){return e.apply(this,arguments)||this}return b(t,e),t}(D(Error)),lr=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 b(t,e),t}(ur),dr=function(e){function t(){return e.call(this,be)||this}return b(t,e),t}(D(Error)),hr=function(e){function t(){return e.call(this,fe)||this}return b(t,e),t}(D(Error)),cr=function(e){function t(){return e.call(this,pe)||this}return b(t,e),t}(D(Error)),fr=function(e){function t(){return e.call(this,ve)||this}return b(t,e),t}(D(Error)),mr=function(e){function t(){return e.call(this,ke)||this}return b(t,e),t}(D(Error)),pr=function(e){function t(){return e.call(this,Se)||this}return b(t,e),t}(D(Error)),gr=function(e){function t(){return e.call(this,Ae)||this}return b(t,e),t}(D(Error)),vr=function(e){function t(){return e.call(this,xe)||this}return b(t,e),t}(D(Error)),yr=function(e){function t(){return e.call(this,xe)||this}return b(t,e),t}(D(Error)),br=function(e){function t(){return e.call(this,Te)||this}return b(t,e),t}(D(Error)),wr=function(e){function t(t){var i;return(i=e.call(this,t)||this).message=`BadRequestError: ${i.message}`,i}return b(t,e),t}(ur),kr=function(e){function t(t){var i;return(i=e.call(this,t)||this).message=`NotFoundError: ${i.message}`,i}return b(t,e),t}(ur),Er=function(e){function t(t,i){var n;return(n=e.call(this,i)||this).statusCode=t,n.message=`ClientError: ${n.message}`,n}return b(t,e),t}(ur),Sr=function(e){function t(t){var i;return(i=e.call(this,t)||this).message=`ServerError: ${i.message}`,i}return b(t,e),t}(ur),Pr=(e,t)=>{if(e==ii)throw new wr(t);if(e==ai)throw new kr(t);if(e==oi)throw new lr;if(e>ii&&e<ui)throw new Er(e,t);if(e>=ui)throw new Sr(t)};function Tr(e,t,i=Qt,n=Xt){var a,r,o;return S(function(s){for(;;)switch(s.n){case 0:return a=0,r=()=>{var o,s;return S(function(u){for(;;)switch(u.n){case 0:return u.n=1,d(Mr(e,t,i));case 1:if((o=u.v).ok){u.n=5;break}if(o.status!=oi){u.n=2;break}throw new lr;case 2:if(!(++a<=n)){u.n=4;break}return s=1e3*(a+qt),u.n=3,d(new Promise(e=>setTimeout(e,s)));case 3:return u.a(2,r());case 4:throw new sr(o.status,`Request failed after ${n} retries`);case 5:return u.a(2,o)}},null,null,null,Promise)},s.n=1,d(r());case 1:return o=s.v,s.a(2,o.json())}},null,null,null,Promise)}function Mr(e,t={},i){var n,a,r;return S(function(o){for(;;)switch(o.n){case 0:return n=new AbortController,a=setTimeout(()=>n.abort(),i),t.signal=n.signal,o.n=1,d(fetch(e,t));case 1:return r=o.v,clearTimeout(a),o.a(2,r)}},null,null,null,Promise)}function Ar(e){for(var t=e.length;--t>=0;)e[t]=0}Ar(new Array(576)),Ar(new Array(60)),Ar(new Array(512)),Ar(new Array(256)),Ar(new Array(29)),Ar(new Array(30));var Dr=(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},xr=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})()),Cr=(e,t,i,n)=>{var a=xr,r=n+i;e^=-1;for(var o=n;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},Ir={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"},Lr=0,_r=4,Rr=5,Fr=6,Or=0,Wr=1,Nr=2,$r=-2,jr=-3,Br=-4,zr=-5,Ur=8,Hr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Gr=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)Hr(i,n)&&(e[n]=i[n])}}return e},Vr=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},Kr=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Kr=!1}for(var Xr=new Uint8Array(256),Yr=0;Yr<256;Yr++)Xr[Yr]=Yr>=252?6:Yr>=248?5:Yr>=240?4:Yr>=224?3:Yr>=192?2:1;Xr[254]=Xr[254]=1;var qr=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},Jr=(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=Xr[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&&Kr)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)},Qr=(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+Xr[e[i]]>t?i:t};var Zr=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},eo=16209,to=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,T,M=e.state;i=e.next_in,P=e.input,n=i+(e.avail_in-5),a=e.next_out,T=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=M.dmax,u=M.wsize,l=M.whave,d=M.wnext,h=M.window,c=M.hold,f=M.bits,m=M.lencode,p=M.distcode,g=(1<<M.lenbits)-1,v=(1<<M.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))T[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){M.mode=16191;break e}e.msg="invalid literal/length code",M.mode=eo;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",M.mode=eo;break e}if(c>>>=b,f-=b,k>(b=a-r)){if((b=k-b)>l&&M.sane){e.msg="invalid distance too far back",M.mode=eo;break e}if(E=0,S=h,0===d){if(E+=u-b,b<w){w-=b;do{T[a++]=h[E++]}while(--b);E=a-k,S=T}}else if(d<b){if(E+=u+d-b,(b-=d)<w){w-=b;do{T[a++]=h[E++]}while(--b);if(E=0,d<w){w-=b=d;do{T[a++]=h[E++]}while(--b);E=a-k,S=T}}}else if(E+=d-b,b<w){w-=b;do{T[a++]=h[E++]}while(--b);E=a-k,S=T}for(;w>2;)T[a++]=S[E++],T[a++]=S[E++],T[a++]=S[E++],w-=3;w&&(T[a++]=S[E++],w>1&&(T[a++]=S[E++]))}else{E=a-k;do{T[a++]=T[E++],T[a++]=T[E++],T[a++]=T[E++],w-=3}while(w>2);w&&(T[a++]=T[E++],w>1&&(T[a++]=T[E++]))}break}if(64&b){e.msg="invalid distance code",M.mode=eo;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),M.hold=c,M.bits=f},io=15,no=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]),ao=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]),ro=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]),oo=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]),so=(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,T=0,M=0,A=0,D=null,x=new Uint16Array(16),C=new Uint16Array(16),I=null;for(y=0;y<=io;y++)x[y]=0;for(b=0;b<n;b++)x[t[i+b]]++;for(E=v,k=io;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),T=1,y=1;y<=io;y++)if(T<<=1,(T-=x[y])<0)return-1;if(T>0&&(0===e||1!==k))return-1;for(C[1]=0,y=1;y<io;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=no,I=ao,f=257):(D=ro,I=oo,f=0),A=0,b=0,y=w,c=r,S=E,P=0,d=-1,h=(M=1<<E)-1,1===e&&M>852||2===e&&M>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[i+o[b]]}if(y>E&&(A&h)!==d){for(0===P&&(P=E),c+=w,T=1<<(S=y-P);S+P<k&&!((T-=x[S+P])<=0);)S++,T<<=1;if(M+=1<<S,1===e&&M>852||2===e&&M>592)return 1;a[d=A&h]=E<<24|S<<16|c-r}