@namiml/web-sdk 3.3.9-dev.202603132233 → 3.3.9-dev.202603141600
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nami-web.cjs +6 -4
- package/dist/nami-web.mjs +6 -4
- package/dist/nami-web.umd.js +6 -4
- package/package.json +1 -1
package/dist/nami-web.mjs
CHANGED
|
@@ -88,7 +88,7 @@ import{css as e,html as t,LitElement as n,unsafeCSS as i,svg as a}from"lit";impo
|
|
|
88
88
|
padding-top: 0;
|
|
89
89
|
padding-bottom: 0;
|
|
90
90
|
}
|
|
91
|
-
`)),Sc=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Ec=globalThis,Mc=Ec.ShadowRoot&&(void 0===Ec.ShadyCSS||Ec.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pc=Symbol(),Tc=new WeakMap,_c=function(){return p((function e(t,n,i){if(h(this,e),this._$cssResult$=!0,i!==Pc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}),[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(Mc&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Tc.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Tc.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Dc=(e,t)=>{if(Mc)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(var n,i=g(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=Ec.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},Ac=Mc?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=g(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return(e=>new _c("string"==typeof e?e:e+"",void 0,Pc))(n)})(e):e,xc=Object.is,Cc=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,Lc=Object.getOwnPropertyNames,Fc=Object.getOwnPropertySymbols,Rc=Object.getPrototypeOf,Wc=globalThis,Oc=Wc.trustedTypes,Nc=Oc?Oc.emptyScript:"",jc=Wc.reactiveElementPolyfillSupport,$c=(e,t)=>e,zc={toAttribute(e,t){switch(t){case Boolean:e=e?Nc:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Bc=(e,t)=>!xc(e,t),Hc={attribute:!0,type:String,converter:zc,reflect:!1,useDefault:!1,hasChanged:Bc};null!==(yc=Symbol.metadata)&&void 0!==yc||(Symbol.metadata=Symbol("metadata")),null!==(bc=Wc.litPropertyMetadata)&&void 0!==bc||(Wc.litPropertyMetadata=new WeakMap);var Uc=function(){function e(){var t;return h(this,e),(t=d(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return k(e,I(HTMLElement)),p(e,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((e=>e(this)))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=g(this.constructor.elementProperties.keys());!(e=n()).done;){var i=e.value;this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return Dc(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){var a,r=(void 0!==(null===(a=n.converter)||void 0===a?void 0:a.toAttribute)?n.converter:zc).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){var a,r,o,s=n.getPropertyOptions(i),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:zc;this._$Em=i;var l=u.fromAttribute(t,s.type);this[i]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n){if(void 0!==e){var i,a,r=this.constructor,o=this[e];if(null!=n||(n=r.getPropertyOptions(e)),!((null!==(i=n.hasChanged)&&void 0!==i?i:Bc)(o,t)||n.useDefault&&n.reflect&&o===(null===(a=this._$Ej)||void 0===a?void 0:a.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:i,wrapped:a},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return T((function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,l(this._$ES);case 2:n.n=4;break;case 3:n.p=3,t=n.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){n.n=5;break}return n.n=5,l(e);case 5:return n.a(2,!this.isUpdatePending)}}),null,this,[[1,3]],Promise)}},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var e;if(null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(var t,n=g(this._$Ep);!(t=n()).done;){var i=t.value,a=i[0],r=i[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=g(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,m=this[d];!0!==c||this._$AL.has(d)||void 0===m||this.C(d,void 0,h,m)}}var f=!1,v=this._$AL;try{var p;(f=this.shouldUpdate(v))?(this.willUpdate(v),null!==(p=this._$EO)&&void 0!==p&&p.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(v)):this._$EM()}catch(v){throw f=!1,this._$EM(),v}f&&this._$AE(v)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=Hc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Cc(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Ic(this.prototype,e))&&void 0!==i?i:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var i=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:Hc}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty($c("elementProperties"))){var e=Rc(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty($c("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($c("properties")))for(var e=this.properties,t=0,n=[...Lc(e),...Fc(e)];t<n.length;t++){var i=n[t];this.createProperty(i,e[i])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=g(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var h,c=g(this.elementProperties);!(h=c()).done;){var m=h.value,f=m[0],v=m[1],p=this._$Eu(f,v);void 0!==p&&this._$Eh.set(p,f)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=g(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(Ac(a))}else void 0!==e&&t.push(Ac(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}();Uc.elementStyles=[],Uc.shadowRootOptions={mode:"open"},Uc[$c("elementProperties")]=new Map,Uc[$c("finalized")]=new Map,null!=jc&&jc({ReactiveElement:Uc}),(null!==(wc=Wc.reactiveElementVersions)&&void 0!==wc?wc:Wc.reactiveElementVersions=[]).push("2.1.1");var Gc={attribute:!0,type:String,converter:zc,reflect:!1,hasChanged:Bc},Vc=(e=Gc,t,n)=>{var i=n.kind,a=n.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===i){var o=n.name;return{set(n){var i=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,i,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===i){var s=n.name;return function(n){var i=this[s];t.call(this,n),this.requestUpdate(s,i,e)}}throw Error("Unsupported decorator location: "+i)};function Xc(e){return(t,n)=>"object"==typeof n?Vc(e,t,n):((e,t,n)=>{var i=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Kc(e){return Xc(y({},e,{state:!0,attribute:!1}))}function Yc(e){return!e||"object"==typeof e&&0==Object.keys(e).length}var qc,Jc="entry",Qc="screen",Zc="branch",em="exit",tm="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.PAUSE="flowPause",e.RESUME="flowResume"}(qc||(qc={}));var nm="__handoff_sequence__",im="__buy_sku__",am="__default__",rm="__appear__",om="__disappear__",sm="__login_success__",um="__login_failure__",lm="__logout_success__",dm="__logout_failure__",hm="__purchase_success__",cm="__remoteback__",mm="__tag_update__",fm="and",vm="or",pm="i_contains",gm="equals",ym="i_equals",bm="not_equals",wm="not_i_equals",km="not_contains",Sm="set",Em="notSet",Mm=function(){function e(){h(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return p(e,[{key:"registerNamespaceResolver",value:function(e,t){this.namespaceResolvers.set(e,t)}},{key:"resetResolvers",value:function(){this.resolvers.clear()}},{key:"evaluate",value:function(e){var t,n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=n.map((e=>this.evaluateFilter(e)));switch(e.operator){case fm:return i.every((e=>e));case vm:return i.some((e=>e));default:return i.every((e=>e))}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;switch(e.operator){case fm:for(var i,a=g(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case vm:for(var o,s=g(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=g(n);!(l=d()).done;){var h=l.value;if(!this.evaluateFilter(h))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(e.operator===Sm)return null!=t;if(e.operator===Em)return null==t;if(null==t)return!![bm,wm,km].includes(e.operator);switch(e.operator){case pm:return Array.isArray(t)?e.values.some((e=>t.some((t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case gm:return e.values.some((e=>{if("string"==typeof t)return t===e;if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for equals comparison: "+typeof t),!1}));case ym:return e.values.some((e=>{if("string"==typeof t)return 0===t.localeCompare(e,void 0,{sensitivity:"accent"});if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for i_equals comparison: "+typeof t),!1}));case bm:return e.values.every((e=>"string"!=typeof t||t!==e));case wm:return e.values.every((e=>"string"!=typeof t||0!==t.localeCompare(e,void 0,{sensitivity:"accent"})));case km:return e.values.every((e=>"string"!=typeof t||!t.includes(e)));default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return t;var n=e.lastIndexOf(".");if(-1!==n){var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);return void 0!==r?this.extractProperty(a,r):void this.log(`Could not resolve base identifier: ${i}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort(((e,t)=>t.length-e.length)),i=g(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r)return r(e)}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){$n.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),Pm=function(){return p((function e(){h(this,e)}),[{key:"register",value:function(){Mm.shared.registerNamespaceResolver(this.namespace,(e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)}))}},{key:"resolveKeyPath",value:function(e,t){for(var n,i=t,a=g(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=a()).done;){var r=n.value;if(null==i||"object"!=typeof i)return;i=i[r]}return i}}])}(),Tm=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="LaunchContext",n.context=t,n.register(),n}return k(e,Pm),p(e,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(),_m=function(){function e(){var t,n,i,a;h(this,e),(a=d(this,e)).namespace="Device";var r=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",o=Intl.DateTimeFormat().resolvedOptions().timeZone,s=hu();return a.context={osName:s.os_name,osVersion:s.os_version,appVersion:s.extended_platform_version,sdkVersion:s.sdk_version,deviceModel:s.device_model,screenWidth:window.innerWidth,screenHeight:window.innerHeight,formFactor:s.form_factor,tvQuality:a.tvQuality(null!==(t=s.form_factor)&&void 0!==t?t:"desktop"),tvResolution:a.tvResolution(null!==(n=s.form_factor)&&void 0!==n?n:"desktop"),screenSize:a.screenSizeTier(null!==(i=s.form_factor)&&void 0!==i?i:"desktop"),language:s.language,country:r,timezone:o},a.register(),a}return k(e,Pm),p(e,[{key:"screenSizeTier",value:function(e){var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r);switch(e){case"phone":return o<1136?"tiny":o<1334?"small":o<1920?"medium":o<2560?"large":"huge";case"tablet":return o<2048?"medium":o<2732?"large":"huge";case"television":return o<1920?"medium":o<3840?"large":"huge";case"desktop":return o<1440?"small":o<2560?"medium":o<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return o>=3840||s>=2160?"4K":o>=1920||s>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return s<720&&o<1280?"SD":s>=720&&s<1080&&o>=1280&&o<1920?"720p":s>=1080&&s<1440&&o>=1920&&o<2560?"1080p":s>=1440&&s<2160&&o>=2560&&o<3840?"1440p":s>=2160&&s<3e3&&o>=3840&&o<5e3?"4K":s>=3e3&&o>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(),Dm=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],Am=function(){function e(){h(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return p(e,[{key:"setSearchParams",value:function(){this.params=this.extractSafeParams()}},{key:"safeValue",value:function(e){if(!e)return null;try{var t=decodeURIComponent(e).trim();return!t||/^null|undefined$/i.test(t)||((e=>e.includes("://")||/^\/.*\?/.test(e))(t)||(e=>/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/.test(e))(t)||(e=>/^[A-Za-z0-9_-]{40,}$/.test(e)||/^[A-Fa-f0-9]{40,}$/.test(e)||/^ya29\./.test(e)||/^sk_/.test(e)||/^ghp_/.test(e))(t))?null:((e,t=128)=>e.length>t?e.slice(0,t):e)(t)}catch(e){return null}}},{key:"extractSafeParams",value:function(){var e=window.location,t={},n=new Set;try{for(var i,a=new URLSearchParams(e.search),r=(e,i)=>{var a=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>Dm.some((t=>t.test(e))))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=g(a.entries());!(i=o()).done;){var s=i.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();Am._instance=null;var xm,Cm=()=>Am.instance.params,Im=/\{\{\s*([^}]+?)\s*\}\}/g,Lm=function(){return p((function e(t){h(this,e),this.flowManager=t,this.urlParams=Cm()}),[{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,h,c,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Tm(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(i=null==f||null===(a=f.campaign)||void 0===a?void 0:a.value)&&void 0!==i?i:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(h=m.currentFlowStep)||void 0===h?void 0:h.name;case"buttonText":return null==m||null===(c=m.currentButton)||void 0===c?void 0:c.firstTextValue();case"slideNumber":var b=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=b?`${b+1}`:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Im,((e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}))}},{key:"interpolateDeep",value:function(e){return"string"==typeof e?this.interpolateLiquidVariables(e):Array.isArray(e)?e.map((e=>this.interpolateDeep(e))):e&&"object"==typeof e?Object.entries(e).reduce(((e,[t,n])=>y({},e,{[t]:this.interpolateDeep(n)})),{}):e}}])}(),Fm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="urlParams",t.context=Cm(),t.register(),t}return k(e,Pm),p(e,[{key:"resolveValue",value:function(e){return $n.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(),Rm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="state",t.register(),t}return k(e,Pm),p(e,[{key:"getContextProvider",value:function(){var e=Jh.providers;if(0!==e.length){var t=e.find((e=>e.flow));return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(),Wm=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="Placement",n.campaign=t,n.register(),n}return k(e,Pm),p(e,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Jh.providers;if(0!==n.length){var i=n.find((e=>e.flow));return i?i.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(),Om=function(){return p((function e(){h(this,e),this.load()}),[{key:"setExternalId",value:function(e){return this.externalId=e,this}},{key:"getExternalId",value:function(){return this.externalId}},{key:"isLoggedIn",value:function(){return!!this.externalId}},{key:"save",value:function(){return this.externalId?Qr.setNamiProfile({externalId:this.externalId}):Qr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Qr.getNamiProfile();e&&(this.externalId=e.externalId),Jh.setIsLoggedIn(!!this.externalId)}},{key:"login",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return n.n=1,l(zs.instance.login(e));case 1:(t=n.v).external_id&&Jh.setIsLoggedIn(!0),this.setExternalId(t.external_id).save();case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"logout",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(zs.instance.logout());case 1:Jh.setIsLoggedIn(!1),this.setExternalId(void 0).save();case 2:return e.a(2)}}),null,this,null,Promise)}}])}();Om.instance=new Om,function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(xm||(xm={}));var Nm=function(){return p((function e(){h(this,e),this.emitter=Hu.getInstance(),Mm.shared.registerNamespaceResolver("UserTags",(t=>{var n=t.replace("UserTags.",""),i=e.getCustomerAttribute(n);if(null!=i){var a=i.toLowerCase();return"true"===a||"false"===a?"true"===a:isNaN(Number(i))?i:parseInt(i,10)}return null}))}),[{key:"isSDKInitialized",get:function(){return fc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Om.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||$n.debug(Pe),Om.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,a,r,o,s;return T((function(u){for(;;)switch(u.p=u.n){case 0:if(this.instance.isSDKInitialized){u.n=1;break}throw t=new no,this.invokeStateHandler(xm.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){u.n=2;break}throw n=new ho,this.invokeStateHandler(xm.LOGIN,!1,n),n;case 2:return u.p=2,u.n=3,l(Om.instance.login(e));case 3:return u.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(xm.LOGIN,!0),zm.instance.flowOpen&&(i=zm.instance.currentFlow,(a=null==i?void 0:i.currentFlowStep)&&i.executeLifecycle(a,sm)),u.n=6;break;case 5:throw u.p=5,s=u.v,this.invokeStateHandler(xm.LOGIN,!1,s),zm.instance.flowOpen&&(r=zm.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,um)),s;case 6:return u.a(2)}}),null,this,[[2,5]],Promise)}},{key:"logout",value:function(){var e,t,n,i,a,r,o;return T((function(s){for(;;)switch(s.p=s.n){case 0:if(this.instance.isSDKInitialized){s.n=1;break}throw e=new no,this.invokeStateHandler(xm.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){s.n=2;break}throw t=new ho,this.invokeStateHandler(xm.LOGOUT,!1,t),t;case 2:return s.p=2,s.n=3,l(Om.instance.logout());case 3:return s.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(xm.LOGOUT,!0),zm.instance.flowOpen&&(n=zm.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&n.executeLifecycle(i,lm)),s.n=6;break;case 5:throw s.p=5,o=s.v,this.invokeStateHandler(xm.LOGOUT,!1,o),zm.instance.flowOpen&&(a=zm.instance.currentFlow,(r=null==a?void 0:a.currentFlowStep)&&a.executeLifecycle(r,dm)),o;case 6:return s.a(2)}}),null,this,[[2,5]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return T((function(t){for(;;)switch(t.n){case 0:return t.n=1,l(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}}),null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(this.updateCustomerDataPlatformId(null));case 1:return e.a(2)}}),null,this,null,Promise)}},{key:"registerAccountStateHandler",value:function(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}},{key:"setAnonymousMode",value:function(e){var t,n,i,a,r;return T((function(o){for(;;)switch(o.n){case 0:if(t=e?xm.ANONYMOUS_MODE_ON:xm.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){o.n=1;break}throw n=new no,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){o.n=2;break}return $n.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),o.a(2);case 2:if(this.inAnonymousMode()!==e){o.n=3;break}return i=e?new uo:new lo,this.invokeStateHandler(t,!1,i),o.a(2);case 3:if(!e){o.n=4;break}Qr.setAnonymousMode(e),Qr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(xm.ANONYMOUS_MODE_ON,!0),o.n=6;break;case 4:return Qr.clearAnonymousMode(),r=null===(a=Qr.getNamiConfig())||void 0===a?void 0:a.namiCommands,o.n=5,l(Vu.instance.createOrUpdateDevice(hu(r)));case 5:Qr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(xm.ANONYMOUS_MODE_OFF,!0);case 6:return o.a(2)}}),null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Ju()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new no;if(Qr.setCustomerAttribute(e,t),Rs(me.PAYWALL_PERSONALIZATION)?(Jh.setCustomerAttribute({[e]:t}),$n.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):$n.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`),zm.instance.flowOpen){var n=zm.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,mm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;var t=Qr.getCustomerAttribute(e);return null!=t?Rs(me.PAYWALL_PERSONALIZATION)?$n.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):$n.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):$n.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;Qr.clearCustomerAttribute(e)?(Jh.removeCustomerAttribute(e),$n.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):$n.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;Qr.getAllCustomerAttributesKeys().forEach((e=>{Jh.removeCustomerAttribute(e)})),Qr.clearAllCustomerAttributes(),$n.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}},{key:"journeyState",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Qr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:Oe}},{key:"registerJourneyStateHandler",value:function(e){if(Ws("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(An,e),()=>{this.instance.emitter.removeListener(An,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:if(this.instance.isSDKInitialized){r.n=1;break}throw t=new no,this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){r.n=6;break}return r.p=2,r.n=3,l(Vu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!0),r.n=5;break;case 4:r.p=4,a=r.v,this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,a);case 5:r.n=7;break;case 6:return $n.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Qr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new co,this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),r.a(2);case 7:return r.a(2)}}),null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=Rs(me.ANONYMOUS_MODE_CAPABILITY),t=Rs(me.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return T((function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,l(Promise.all([Xu.instance.fetchProducts(),Ku.instance.fetchPaywalls().then((e=>Uu.instance.fetchCampaignRules(e)))]));case 1:return e.a(2)}}),null,this,null,Promise)}}])}();Nm.instance=new Nm;var jm=function(){return p((function e(t={}){var n,i,a,r,o;h(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(i=t.name)&&void 0!==i?i:"",this.steps=null!==(a=t.steps)&&void 0!==a?a:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(o=t.transition)&&void 0!==o?o:"none"}),[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Xs(this.screens)}}])}(),$m=function(){function e(t,n,i,a){var r,o;h(this,e),(o=d(this,e,[null!==(r=t.flow.object)&&void 0!==r?r:{}])).stepcrumbs=[],o.branchcrumbs=[],o.activeHandoffSequence=null,o.currentScreenState=null,o.isPaused=!1,o.timerStates={},o.campaign=t,o.component=n,o.context=a,o.manager=i,o.branchcrumbs=[],o.stepcrumbs=[],o.registerResolvers(a);var s=o.findStepByType(Jc);return s&&o.forward(s.id),o}return k(e,jm),p(e,[{key:"registerResolvers",value:function(e){e&&new Tm(e),new _m,new Fm,new Rm,new Wm(this.campaign),Mm.shared.registerNamespaceResolver("Flow",(e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map((e=>e.id));case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}))}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some((e=>"screen"===e.type));return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find((t=>t.id===e))}},{key:"findStepByType",value:function(e){return this.steps.find((t=>t.type===e))}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some((e=>this.branchcrumbs.includes(e)))}},{key:"finished",value:function(){this.manager.finishFlow()}},{key:"back",value:function(){this.previousStepAvailable?this.backToPreviousScreenStep():$n.debug("No previous step available")}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=Vs(n.screen);return r&&this.component.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Jh.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}$n.warn("No previous screen step found to return to")}else $n.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t){if(this.isStepActive(t))switch(t.type){case Jc:case em:return this.stepcrumbs.push(t),void this.executeLifecycle(t,am);case Zc:return void this.handleBranchStep(t);case Qc:return void this.handleScreenStep(t);case tm:return}}else $n.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?$n.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,$n.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,$n.info(`Flow resumed from step ${e}`),this.forward(e)}else $n.warn("No step to resume from");else $n.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var i=e.actions[t];i&&this.executeFullLifecycles(i,n)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;$n.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var i=this.lifecycles(e);i&&(this.currentButton=t,this.executeFullLifecycles(i,n))}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;[a.before,a.action,a.after].forEach((e=>null==e?void 0:e.forEach((e=>this.shouldRun(e)&&this.performAction(e,t)))))}}},{key:"triggerBeforeActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.before)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"triggerAfterActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.after)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some((e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length}))}},{key:"shouldRun",value:function(e){return!e.conditions||e.conditions.every((e=>Mm.shared.evaluate(e)))}},{key:"performAction",value:function(e,t){var n;if(this.currentFlowStep){var i=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0,a=n=>{var i,a,r,o,s,u,l;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case qc.BACK:this.back();break;case qc.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.step?this.forward(e.parameters.step):this.next();break;case qc.NAVIGATE:var d;if(null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(d=this.previousFlowStep)||void 0===d?void 0:d.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case qc.FINISHED:case qc.DISMISS:this.finished();break;case qc.EXIT:var h=this.steps.find((e=>e.type===em));h&&this.forward(h.id);break;case qc.PAUSE:this.pause();break;case qc.RESUME:this.resumeFromPause();break;case qc.HANDOFF:if(null!==(o=e.parameters)&&void 0!==o&&o.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var c=this.getFormData();e.parameters.handoffTag===nm?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,c)}else $n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else $n.debug("No handoffStepHandler found",e);break;case qc.LOG:var m;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)$n.info(`logEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(m=e.id)&&void 0!==m?m:"unknown"}`);break;case qc.TRACK:var f;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)$n.info(`trackEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(f=e.id)&&void 0!==f?f:"unknown"}`);break;case qc.SET_VIDEO:null!==(l=e.parameters)&&void 0!==l&&l.name&&e.parameters.url?Jh.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):$n.warn("Missing name, url for setting video details");break;case qc.BLOCK_BACK:var v,p=null===(v=e.parameters)||void 0===v?void 0:v.step,g=p?this.getStep(p):void 0;g?g.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:$n.warn("Missing step for blocking back");break;case qc.FLOW_EVENT:var y,b=new Lm(this.manager),w=Object.fromEntries(Object.entries(null!==(y=e.parameters)&&void 0!==y?y:{}).map((([e,t])=>[e,b.interpolateDeep(t)])));this.manager.eventHandler?this.manager.eventHandler(w):$n.warn("Missing event handler",w);break;case qc.FLOW_ENABLED:Jh.setUserInteractionEnabled(!0);break;case qc.FLOW_DISABLED:Jh.setUserInteractionEnabled(!1);break;case qc.SET_TAGS:e.parameters&&(Jh.setUserTags(e.parameters),Object.entries(e.parameters).forEach((([e,t])=>{Nm.setCustomerAttribute(e,t)})));break;default:$n.warn(`Missing action handler for ${e.function}`,e)}else $n.debug(`Skipped action for stale flow step ${n}`)};i?setTimeout(a.bind(this,this.currentFlowStep.id),i):a(this.currentFlowStep.id)}else $n.warn("No current flow step")}},{key:"nextStep",value:function(e){if(e){var t=this.steps.findIndex((t=>t.id===e.id));if(-1!==t){for(var n,i=g(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}$n.debug(`No active next step found after ${e.id}`)}else $n.error(`Could not find next step for step ${e.id}`)}else $n.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Vs(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),this.component.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):$n.error("No paywall or campaign found for next step")}},{key:"handleBranchStep",value:function(e){this.stepcrumbs.push(e);for(var t=0,n=Object.entries(e.actions);t<n.length;t++){var i=n[t],a=i[0],r=i[1];if(r)for(var o,s=g(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=g(u.action);!(l=d()).done;){var h,c,m=l.value;if(this.shouldRun(m))return this.branchcrumbs.push(a),null===(h=u.before)||void 0===h||h.forEach((e=>{this.performAction(e)})),u.action.forEach((e=>{this.shouldRun(e)&&this.performAction(e)})),void(null===(c=u.after)||void 0===c||c.forEach((e=>{this.performAction(e)})))}else $n.warn(`No actions defined for branch tag ${a}`)}}$n.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return y({},null!==(e=null===(t=Jh.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t).sort();if(0!==n.length){var i=n.filter((e=>!0===t[e]));if(0===i.length)return $n.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:y({},t),remainingKeys:[...i]},this.resumeNextHandoff()}else $n.warn("formStates is empty, no handoffs to perform")}else $n.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return $n.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return $n.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var i=n.remainingKeys.shift(),a=n.formStates[i];$n.debug(`Starting handoff for ${i} → ${String(a)}`),this.activeHandoffSequence=n;var r=`${i}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(),zm=function(){function e(){h(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return p(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var i=new $m(e,t,this,n);return this.flowOpen=!0,this.currentFlow=i,i}},{key:"finishFlow",value:function(){this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter((e=>e.type===Qc));if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter((e=>e.type===Qc));if(0===n.length)return 0;var i=this.buildNavGraph(this.currentFlow),a=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,i),o=0;if(r)o=this.calculateBranchingProgress(n,t,a,r,i);else{var s=t.findIndex((e=>e.id===a.id));o=s>=0?(s+1)/t.length:0}return o=Math.max(0,Math.min(1,o)),e&&this.setLastAnimatedFlowProgress(e,o),o}},{key:"findBranchPoint",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;if(this.hasBranching(a,e,t))return a}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,i,a){var r=e.length,o=t.findIndex((e=>e.id===i.id)),s=e.findIndex((e=>e.id===i.id)),u=t.findIndex((e=>e.id===n.id));if(-1===s||n.id===i.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,a),d=r+l;return $n.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return 0;var a=new Set,r=0,o=(e,s)=>{if(!a.has(e)){a.add(e);var u=(n.get(e)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));if(0!==u.length)for(var l,d=g(u);!(l=d()).done;){var h=l.value;o(h,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return!1;var a=(n.get(e.id)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));return a.length>1}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach((e=>{e.actions&&Object.values(e.actions).forEach((t=>{Array.isArray(t)&&t.forEach((t=>{t.action&&t.action.forEach((t=>{if("flowNav"===t.function){var i,a=null===(i=t.parameters)||void 0===i?void 0:i.step;a&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(a))}}))}))}))}));var i=new Map;return n.forEach(((e,t)=>{i.set(t,Array.from(e))})),this.navGraphCache.set(e,i),i}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var i=null===(t=n.actions)||void 0===t?void 0:t[rm];if(!i)return null;for(var a,r=g(i);!(a=r()).done;)for(var o,s,u=g(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===qc.NAVIGATE||d.function===qc.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var h=d.parameters.delay,c=Number(h);if(!isNaN(c)&&c>0)return c/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e}},{key:"resume",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;if(n&&i&&i.currentFlowStep){if(i.activeHandoffSequence)return $n.debug(`Resuming flow at handoff sequence ${i.currentFlowStep.id}`),void i.resumeNextHandoff();$n.debug(`Resuming flow at step ${i.currentFlowStep.id}`),i.executeLifecycle(i.currentFlowStep,"__resume__")}else $n.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?($n.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.finished()):$n.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?!0===i.resumeFromBookmark?i.pause():$n.warn("This flow cannot be paused"):$n.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();var Bm=e=>{var t;return T((function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map((e=>e.family))),e.forEach((e=>{var n=Hm(e);if(!t.has(n)){var i=new FontFace(n,`url(${e.file})`);document.fonts.add(i)}})),n.a(2,document.fonts.ready.then())}),null,null,null,Promise)};function Hm(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function Um(e,t,n){var i,a,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return $n.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var h={minDistance:null!==(i=null==n?void 0:n.minDistance)&&void 0!==i?i:30,maxDuration:null!==(a=null==n?void 0:n.maxDuration)&&void 0!==a?a:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},c=e.style.touchAction;h.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,M=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var i=e;return i.scrollHeight>i.clientHeight}catch(e){return!1}},P=e=>h.pointerTypes.includes(e.pointerType),T=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===h.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var i,a;if(M(n))return n;n=n.parentElement||(null!==(i=null===(a=n.parentNode)||void 0===a?void 0:a.host)&&void 0!==i?i:null)}return null})(n,e):null)||(S=!0);try{var i;null==e||null===(i=e.setPointerCapture)||void 0===i||i.call(e,t.pointerId)}catch(e){try{var a;null==n||null===(a=n.setPointerCapture)||void 0===a||a.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&P(e)){if(p=e.clientX,g=e.clientY,h.lockAxis&&!b){var n=Math.abs(p-f),i=Math.abs(g-v);(n>2||i>2)&&(b=i>=n?"y":"x")}if("y"===h.axisHint&&("y"===b||!h.lockAxis)){var a=g-v,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-y,u=o/Math.max(s,1),l=o>=h.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=h.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=h.minDistance){E=!0;var c=performance.now(),M={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:a,absX:Math.abs(p-f),absY:o,duration:c-y,velocity:o/Math.max(c-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:c,originalEvent:e};t(M)}}}},D=e=>{if(e.pointerId===m)if(P(e))if(w)A();else if(E||k)A();else{var n,i=performance.now(),a=i-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=h.lockAxis&&b?b:"x"===h.axisHint?"x":"y"===h.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=h.maxDuration,c=h.minDistance;if(w&&"y"===n&&S&&(c+=h.edgeLeakThreshold),d&&l>=c){var M;M="x"===n?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(a,1);t({direction:M,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:T,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:i,originalEvent:e})}A()}else A()},A=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!h.passiveListeners&&{passive:!0},C=h.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",T,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",D,x),e.addEventListener("pointercancel",D,x),e.addEventListener("lostpointercapture",D,x);return{destroy:()=>{e.removeEventListener("pointerdown",T,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",D,x),e.removeEventListener("pointercancel",D,x),e.removeEventListener("lostpointercapture",D,x),h.preventScrollOnSwipe&&(e.style.touchAction=c),A()},updateOptions:t=>{Object.assign(h,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=c)}}}var Gm,Vm,Xm,Km,Ym,qm,Jm,Qm,Zm,ef,tf,nf=e=>e,af=function(){function e(t,n,i){var a;return h(this,e),(a=d(this,e)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a.formFactor=cu(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a._savedScrollY=0,a._sheetDragStartY=0,a._sheetIsDragging=!1,a._dismissThreshold=100,a.type=t,a.value=n,a.context=i,a.setPaywallData(),M(a,a)}return k(e,n),p(e,[{key:"setPaywallData",value:function(){var e=Au(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,n,i=null==e||null===(t=e.template)||void 0===t||null===(t=t.initialState)||void 0===t?void 0:t.presentation_style;return(n=i)&&pc.has(n)?"sheet"===n?"fullscreen":n:"fullscreen"}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"connectedCallback",value:function(){var t;x(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),document.addEventListener("keydown",this.handleKeyDownEvent.bind(this)),this._swipeHandler=Um(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.presentationStyle=this.getPresentationStyle(this.paywall),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var t,n;x(e,"disconnectedCallback",this)([]),Qr.clearLaunchId(),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this.handleKeyDownEvent.bind(this)),Hu.getInstance().removeAllListeners(Pn),this.restoreStyles(),null===(n=this._halfSheetAbortController)||void 0===n||n.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){"television"===this.formFactor&&(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),this._originalBodyStyles.background=document.body.style.background,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior?document.body.style.overscrollBehavior:null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior?document.documentElement.style.overscrollBehavior:null,document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none"),this.isHalfSheet&&(this._savedScrollY=window.scrollY,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach((([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)})),Object.entries(this._originalDocumentStyles).forEach((([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)})),this._savedScrollY>0&&(window.scrollTo(0,this._savedScrollY),this._savedScrollY=0)}},{key:"handleKeyDownEvent",value:function(e){!this.flow||10009!==e.keyCode&&"Backspace"!==e.key&&"GoBack"!==e.key||this.flow.triggerActions(cm)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,n;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var i=this._halfSheetAbortController.signal,a=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content");if(a&&r){a.addEventListener("touchstart",(e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)}),{passive:!0,signal:i}),a.addEventListener("touchmove",(e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(a.style.transform=`translateY(${t}px)`,a.style.transition="none",e.preventDefault())}}),{passive:!1,signal:i}),a.addEventListener("touchend",(()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,n=a.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((n?parseFloat(n[1]):0)>this._dismissThreshold)if(null!==(e=null===(t=this.flow)||void 0===t?void 0:t.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==e&&e){var i;a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out",null===(i=this.flow)||void 0===i||i.triggerActions("__swipe_down__")}else{var r;a.style.transform="translateY(100%)",a.style.transition="transform 0.2s ease-in";var o=null===(r=this.shadowRoot)||void 0===r?void 0:r.querySelector(".nami-half-sheet-backdrop");o&&o.classList.add("nami-dismissing"),setTimeout((()=>{var e;null===(e=this.flow)||void 0===e||e.finished()}),200)}else a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out"}}),{signal:i})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container");if(n){n.focus();var i=null===(t=this._halfSheetAbortController)||void 0===t?void 0:t.signal;n.addEventListener("keydown",(e=>{if("Tab"===e.key){var t=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var i,a,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(a=this.shadowRoot)||void 0===a?void 0:a.activeElement)!==o||(e.preventDefault(),r.focus())}}}),i?{signal:i}:void 0)}}},{key:"firstUpdated",value:function(){this.timeSpentOnPaywall=Date.now(),Bs(this.campaign)&&(this.flow=zm.instance.presentFlow(this.campaign,this,this.context)),this.isHalfSheet&&this.updateComplete.then((()=>{this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()}))}},{key:"updated",value:function(t){x(e,"updated",this)([t]),this.isHalfSheet&&t.has("presentationStyle")&&(this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap())}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){n.n=1;break}return this.pages=[e],n.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){n.n=2;break}return n.a(2);case 2:return this.pages=[t,e],this.currentOffset=0,n.n=3,l(this.updateComplete);case 3:requestAnimationFrame((()=>{this.currentOffset=1,setTimeout((()=>{this.pages=[e],this.currentOffset=0,this.paywall=e}),250)}));case 4:return n.a(2)}}),null,this,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,i,a,r;return T((function(o){for(;;)switch(o.n){case 0:if(null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,om),a=this.presentationStyle,r=this.getPresentationStyle(e),"fullscreen"!==a||"compact_sheet"!==r){o.n=1;break}console.warn("Unsupported transition: fullscreen → compact_sheet. Presenting as fullscreen."),o.n=4;break;case 1:if("compact_sheet"!==a||"fullscreen"!==r&&"sheet"!==r){o.n=3;break}return o.n=2,l(this.animateHalfSheetExpand());case 2:this.presentationStyle="fullscreen",o.n=4;break;case 3:this.presentationStyle=r;case 4:return this.animation=t,o.n=5,l(this.updatePages(e));case 5:null!==(i=this.flow)&&void 0!==i&&i.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,rm);case 6:return o.a(2)}}),null,this,null,Promise)}},{key:"animateHalfSheetExpand",value:function(){var e,t;return T((function(n){for(;;)switch(n.n){case 0:if(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container")){n.n=1;break}return n.a(2);case 1:return t.classList.add("nami-expanding"),n.n=2,l(new Promise((e=>setTimeout(e,300))));case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Jh.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?t(Gm||(Gm=nf``)):this.isHalfSheet?this.renderHalfSheet():t(Vm||(Vm=nf`
|
|
91
|
+
`)),Sc=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Ec=globalThis,Mc=Ec.ShadowRoot&&(void 0===Ec.ShadyCSS||Ec.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pc=Symbol(),Tc=new WeakMap,_c=function(){return p((function e(t,n,i){if(h(this,e),this._$cssResult$=!0,i!==Pc)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}),[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(Mc&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Tc.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Tc.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Dc=(e,t)=>{if(Mc)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(var n,i=g(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=Ec.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}},Ac=Mc?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=g(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return(e=>new _c("string"==typeof e?e:e+"",void 0,Pc))(n)})(e):e,xc=Object.is,Cc=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,Lc=Object.getOwnPropertyNames,Fc=Object.getOwnPropertySymbols,Rc=Object.getPrototypeOf,Wc=globalThis,Oc=Wc.trustedTypes,Nc=Oc?Oc.emptyScript:"",jc=Wc.reactiveElementPolyfillSupport,$c=(e,t)=>e,zc={toAttribute(e,t){switch(t){case Boolean:e=e?Nc:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Bc=(e,t)=>!xc(e,t),Hc={attribute:!0,type:String,converter:zc,reflect:!1,useDefault:!1,hasChanged:Bc};null!==(yc=Symbol.metadata)&&void 0!==yc||(Symbol.metadata=Symbol("metadata")),null!==(bc=Wc.litPropertyMetadata)&&void 0!==bc||(Wc.litPropertyMetadata=new WeakMap);var Uc=function(){function e(){var t;return h(this,e),(t=d(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return k(e,I(HTMLElement)),p(e,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((e=>e(this)))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=g(this.constructor.elementProperties.keys());!(e=n()).done;){var i=e.value;this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return Dc(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){var a,r=(void 0!==(null===(a=n.converter)||void 0===a?void 0:a.toAttribute)?n.converter:zc).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){var a,r,o,s=n.getPropertyOptions(i),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:zc;this._$Em=i;var l=u.fromAttribute(t,s.type);this[i]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n){if(void 0!==e){var i,a,r=this.constructor,o=this[e];if(null!=n||(n=r.getPropertyOptions(e)),!((null!==(i=n.hasChanged)&&void 0!==i?i:Bc)(o,t)||n.useDefault&&n.reflect&&o===(null===(a=this._$Ej)||void 0===a?void 0:a.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:i,wrapped:a},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return T((function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,l(this._$ES);case 2:n.n=4;break;case 3:n.p=3,t=n.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){n.n=5;break}return n.n=5,l(e);case 5:return n.a(2,!this.isUpdatePending)}}),null,this,[[1,3]],Promise)}},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var e;if(null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(var t,n=g(this._$Ep);!(t=n()).done;){var i=t.value,a=i[0],r=i[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=g(o);!(s=u()).done;){var l=s.value,d=l[0],h=l[1],c=h.wrapped,m=this[d];!0!==c||this._$AL.has(d)||void 0===m||this.C(d,void 0,h,m)}}var f=!1,v=this._$AL;try{var p;(f=this.shouldUpdate(v))?(this.willUpdate(v),null!==(p=this._$EO)&&void 0!==p&&p.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(v)):this._$EM()}catch(v){throw f=!1,this._$EM(),v}f&&this._$AE(v)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=Hc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Cc(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Ic(this.prototype,e))&&void 0!==i?i:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var i=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:Hc}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty($c("elementProperties"))){var e=Rc(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty($c("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($c("properties")))for(var e=this.properties,t=0,n=[...Lc(e),...Fc(e)];t<n.length;t++){var i=n[t];this.createProperty(i,e[i])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=g(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var h,c=g(this.elementProperties);!(h=c()).done;){var m=h.value,f=m[0],v=m[1],p=this._$Eu(f,v);void 0!==p&&this._$Eh.set(p,f)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=g(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(Ac(a))}else void 0!==e&&t.push(Ac(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}();Uc.elementStyles=[],Uc.shadowRootOptions={mode:"open"},Uc[$c("elementProperties")]=new Map,Uc[$c("finalized")]=new Map,null!=jc&&jc({ReactiveElement:Uc}),(null!==(wc=Wc.reactiveElementVersions)&&void 0!==wc?wc:Wc.reactiveElementVersions=[]).push("2.1.1");var Gc={attribute:!0,type:String,converter:zc,reflect:!1,hasChanged:Bc},Vc=(e=Gc,t,n)=>{var i=n.kind,a=n.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===i){var o=n.name;return{set(n){var i=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,i,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===i){var s=n.name;return function(n){var i=this[s];t.call(this,n),this.requestUpdate(s,i,e)}}throw Error("Unsupported decorator location: "+i)};function Xc(e){return(t,n)=>"object"==typeof n?Vc(e,t,n):((e,t,n)=>{var i=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Kc(e){return Xc(y({},e,{state:!0,attribute:!1}))}function Yc(e){return!e||"object"==typeof e&&0==Object.keys(e).length}var qc,Jc="entry",Qc="screen",Zc="branch",em="exit",tm="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.PAUSE="flowPause",e.RESUME="flowResume"}(qc||(qc={}));var nm="__handoff_sequence__",im="__buy_sku__",am="__default__",rm="__appear__",om="__disappear__",sm="__login_success__",um="__login_failure__",lm="__logout_success__",dm="__logout_failure__",hm="__purchase_success__",cm="__remoteback__",mm="__tag_update__",fm="and",vm="or",pm="i_contains",gm="equals",ym="i_equals",bm="not_equals",wm="not_i_equals",km="not_contains",Sm="set",Em="notSet",Mm=function(){function e(){h(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return p(e,[{key:"registerNamespaceResolver",value:function(e,t){this.namespaceResolvers.set(e,t)}},{key:"resetResolvers",value:function(){this.resolvers.clear()}},{key:"evaluate",value:function(e){var t,n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=n.map((e=>this.evaluateFilter(e)));switch(e.operator){case fm:return i.every((e=>e));case vm:return i.some((e=>e));default:return i.every((e=>e))}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;switch(e.operator){case fm:for(var i,a=g(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case vm:for(var o,s=g(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=g(n);!(l=d()).done;){var h=l.value;if(!this.evaluateFilter(h))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(e.operator===Sm)return null!=t;if(e.operator===Em)return null==t;if(null==t)return!![bm,wm,km].includes(e.operator);switch(e.operator){case pm:return Array.isArray(t)?e.values.some((e=>t.some((t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case gm:return e.values.some((e=>{if("string"==typeof t)return t===e;if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for equals comparison: "+typeof t),!1}));case ym:return e.values.some((e=>{if("string"==typeof t)return 0===t.localeCompare(e,void 0,{sensitivity:"accent"});if("boolean"==typeof t){var n="true"===e.toLowerCase();return t===n}return this.log("Unsupported type for i_equals comparison: "+typeof t),!1}));case bm:return e.values.every((e=>"string"!=typeof t||t!==e));case wm:return e.values.every((e=>"string"!=typeof t||0!==t.localeCompare(e,void 0,{sensitivity:"accent"})));case km:return e.values.every((e=>"string"!=typeof t||!t.includes(e)));default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return t;var n=e.lastIndexOf(".");if(-1!==n){var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);return void 0!==r?this.extractProperty(a,r):void this.log(`Could not resolve base identifier: ${i}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort(((e,t)=>t.length-e.length)),i=g(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r)return r(e)}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){$n.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),Pm=function(){return p((function e(){h(this,e)}),[{key:"register",value:function(){Mm.shared.registerNamespaceResolver(this.namespace,(e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)}))}},{key:"resolveKeyPath",value:function(e,t){for(var n,i=t,a=g(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=a()).done;){var r=n.value;if(null==i||"object"!=typeof i)return;i=i[r]}return i}}])}(),Tm=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="LaunchContext",n.context=t,n.register(),n}return k(e,Pm),p(e,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(),_m=function(){function e(){var t,n,i,a;h(this,e),(a=d(this,e)).namespace="Device";var r=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",o=Intl.DateTimeFormat().resolvedOptions().timeZone,s=hu();return a.context={osName:s.os_name,osVersion:s.os_version,appVersion:s.extended_platform_version,sdkVersion:s.sdk_version,deviceModel:s.device_model,screenWidth:window.innerWidth,screenHeight:window.innerHeight,formFactor:s.form_factor,tvQuality:a.tvQuality(null!==(t=s.form_factor)&&void 0!==t?t:"desktop"),tvResolution:a.tvResolution(null!==(n=s.form_factor)&&void 0!==n?n:"desktop"),screenSize:a.screenSizeTier(null!==(i=s.form_factor)&&void 0!==i?i:"desktop"),language:s.language,country:r,timezone:o},a.register(),a}return k(e,Pm),p(e,[{key:"screenSizeTier",value:function(e){var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r);switch(e){case"phone":return o<1136?"tiny":o<1334?"small":o<1920?"medium":o<2560?"large":"huge";case"tablet":return o<2048?"medium":o<2732?"large":"huge";case"television":return o<1920?"medium":o<3840?"large":"huge";case"desktop":return o<1440?"small":o<2560?"medium":o<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return o>=3840||s>=2160?"4K":o>=1920||s>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e){if("television"!==e)return"";var t=window.screen.width,n=window.screen.height,i=window.devicePixelRatio||1,a=Math.round(t*i),r=Math.round(n*i),o=Math.max(a,r),s=Math.min(a,r);return s<720&&o<1280?"SD":s>=720&&s<1080&&o>=1280&&o<1920?"720p":s>=1080&&s<1440&&o>=1920&&o<2560?"1080p":s>=1440&&s<2160&&o>=2560&&o<3840?"1440p":s>=2160&&s<3e3&&o>=3840&&o<5e3?"4K":s>=3e3&&o>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(),Dm=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],Am=function(){function e(){h(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return p(e,[{key:"setSearchParams",value:function(){this.params=this.extractSafeParams()}},{key:"safeValue",value:function(e){if(!e)return null;try{var t=decodeURIComponent(e).trim();return!t||/^null|undefined$/i.test(t)||((e=>e.includes("://")||/^\/.*\?/.test(e))(t)||(e=>/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/.test(e))(t)||(e=>/^[A-Za-z0-9_-]{40,}$/.test(e)||/^[A-Fa-f0-9]{40,}$/.test(e)||/^ya29\./.test(e)||/^sk_/.test(e)||/^ghp_/.test(e))(t))?null:((e,t=128)=>e.length>t?e.slice(0,t):e)(t)}catch(e){return null}}},{key:"extractSafeParams",value:function(){var e=window.location,t={},n=new Set;try{for(var i,a=new URLSearchParams(e.search),r=(e,i)=>{var a=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>Dm.some((t=>t.test(e))))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=g(a.entries());!(i=o()).done;){var s=i.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();Am._instance=null;var xm,Cm=()=>Am.instance.params,Im=/\{\{\s*([^}]+?)\s*\}\}/g,Lm=function(){return p((function e(t){h(this,e),this.flowManager=t,this.urlParams=Cm()}),[{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,h,c,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Tm(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(i=null==f||null===(a=f.campaign)||void 0===a?void 0:a.value)&&void 0!==i?i:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(h=m.currentFlowStep)||void 0===h?void 0:h.name;case"buttonText":return null==m||null===(c=m.currentButton)||void 0===c?void 0:c.firstTextValue();case"slideNumber":var b=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=b?`${b+1}`:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Im,((e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}))}},{key:"interpolateDeep",value:function(e){return"string"==typeof e?this.interpolateLiquidVariables(e):Array.isArray(e)?e.map((e=>this.interpolateDeep(e))):e&&"object"==typeof e?Object.entries(e).reduce(((e,[t,n])=>y({},e,{[t]:this.interpolateDeep(n)})),{}):e}}])}(),Fm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="urlParams",t.context=Cm(),t.register(),t}return k(e,Pm),p(e,[{key:"resolveValue",value:function(e){return $n.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(),Rm=function(){function e(){var t;return h(this,e),(t=d(this,e)).namespace="state",t.register(),t}return k(e,Pm),p(e,[{key:"getContextProvider",value:function(){var e=Jh.providers;if(0!==e.length){var t=e.find((e=>e.flow));return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(),Wm=function(){function e(t){var n;return h(this,e),(n=d(this,e)).namespace="Placement",n.campaign=t,n.register(),n}return k(e,Pm),p(e,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Jh.providers;if(0!==n.length){var i=n.find((e=>e.flow));return i?i.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(),Om=function(){return p((function e(){h(this,e),this.load()}),[{key:"setExternalId",value:function(e){return this.externalId=e,this}},{key:"getExternalId",value:function(){return this.externalId}},{key:"isLoggedIn",value:function(){return!!this.externalId}},{key:"save",value:function(){return this.externalId?Qr.setNamiProfile({externalId:this.externalId}):Qr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Qr.getNamiProfile();e&&(this.externalId=e.externalId),Jh.setIsLoggedIn(!!this.externalId)}},{key:"login",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:return n.n=1,l(zs.instance.login(e));case 1:(t=n.v).external_id&&Jh.setIsLoggedIn(!0),this.setExternalId(t.external_id).save();case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"logout",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(zs.instance.logout());case 1:Jh.setIsLoggedIn(!1),this.setExternalId(void 0).save();case 2:return e.a(2)}}),null,this,null,Promise)}}])}();Om.instance=new Om,function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(xm||(xm={}));var Nm=function(){return p((function e(){h(this,e),this.emitter=Hu.getInstance(),Mm.shared.registerNamespaceResolver("UserTags",(t=>{var n=t.replace("UserTags.",""),i=e.getCustomerAttribute(n);if(null!=i){var a=i.toLowerCase();return"true"===a||"false"===a?"true"===a:isNaN(Number(i))?i:parseInt(i,10)}return null}))}),[{key:"isSDKInitialized",get:function(){return fc.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Om.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||$n.debug(Pe),Om.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,a,r,o,s;return T((function(u){for(;;)switch(u.p=u.n){case 0:if(this.instance.isSDKInitialized){u.n=1;break}throw t=new no,this.invokeStateHandler(xm.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){u.n=2;break}throw n=new ho,this.invokeStateHandler(xm.LOGIN,!1,n),n;case 2:return u.p=2,u.n=3,l(Om.instance.login(e));case 3:return u.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(xm.LOGIN,!0),zm.instance.flowOpen&&(i=zm.instance.currentFlow,(a=null==i?void 0:i.currentFlowStep)&&i.executeLifecycle(a,sm)),u.n=6;break;case 5:throw u.p=5,s=u.v,this.invokeStateHandler(xm.LOGIN,!1,s),zm.instance.flowOpen&&(r=zm.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,um)),s;case 6:return u.a(2)}}),null,this,[[2,5]],Promise)}},{key:"logout",value:function(){var e,t,n,i,a,r,o;return T((function(s){for(;;)switch(s.p=s.n){case 0:if(this.instance.isSDKInitialized){s.n=1;break}throw e=new no,this.invokeStateHandler(xm.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){s.n=2;break}throw t=new ho,this.invokeStateHandler(xm.LOGOUT,!1,t),t;case 2:return s.p=2,s.n=3,l(Om.instance.logout());case 3:return s.n=4,l(nc.instance.fetchActiveEntitlements());case 4:this.invokeStateHandler(xm.LOGOUT,!0),zm.instance.flowOpen&&(n=zm.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&n.executeLifecycle(i,lm)),s.n=6;break;case 5:throw s.p=5,o=s.v,this.invokeStateHandler(xm.LOGOUT,!1,o),zm.instance.flowOpen&&(a=zm.instance.currentFlow,(r=null==a?void 0:a.currentFlowStep)&&a.executeLifecycle(r,dm)),o;case 6:return s.a(2)}}),null,this,[[2,5]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return T((function(t){for(;;)switch(t.n){case 0:return t.n=1,l(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}}),null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return T((function(e){for(;;)switch(e.n){case 0:return e.n=1,l(this.updateCustomerDataPlatformId(null));case 1:return e.a(2)}}),null,this,null,Promise)}},{key:"registerAccountStateHandler",value:function(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}},{key:"setAnonymousMode",value:function(e){var t,n,i,a,r;return T((function(o){for(;;)switch(o.n){case 0:if(t=e?xm.ANONYMOUS_MODE_ON:xm.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){o.n=1;break}throw n=new no,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){o.n=2;break}return $n.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),o.a(2);case 2:if(this.inAnonymousMode()!==e){o.n=3;break}return i=e?new uo:new lo,this.invokeStateHandler(t,!1,i),o.a(2);case 3:if(!e){o.n=4;break}Qr.setAnonymousMode(e),Qr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(xm.ANONYMOUS_MODE_ON,!0),o.n=6;break;case 4:return Qr.clearAnonymousMode(),r=null===(a=Qr.getNamiConfig())||void 0===a?void 0:a.namiCommands,o.n=5,l(Vu.instance.createOrUpdateDevice(hu(r)));case 5:Qr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(xm.ANONYMOUS_MODE_OFF,!0);case 6:return o.a(2)}}),null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Ju()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new no;if(Qr.setCustomerAttribute(e,t),Rs(me.PAYWALL_PERSONALIZATION)?(Jh.setCustomerAttribute({[e]:t}),$n.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):$n.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`),zm.instance.flowOpen){var n=zm.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,mm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;var t=Qr.getCustomerAttribute(e);return null!=t?Rs(me.PAYWALL_PERSONALIZATION)?$n.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):$n.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):$n.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new no;Qr.clearCustomerAttribute(e)?(Jh.removeCustomerAttribute(e),$n.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):$n.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new no;Qr.getAllCustomerAttributesKeys().forEach((e=>{Jh.removeCustomerAttribute(e)})),Qr.clearAllCustomerAttributes(),$n.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}},{key:"journeyState",value:function(){if(!this.instance.isSDKInitialized)throw new no;return Qr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Qr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:Oe}},{key:"registerJourneyStateHandler",value:function(e){if(Ws("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(An,e),()=>{this.instance.emitter.removeListener(An,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,i,a;return T((function(r){for(;;)switch(r.p=r.n){case 0:if(this.instance.isSDKInitialized){r.n=1;break}throw t=new no,this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){r.n=6;break}return r.p=2,r.n=3,l(Vu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!0),r.n=5;break;case 4:r.p=4,a=r.v,this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,a);case 5:r.n=7;break;case 6:return $n.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Qr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new co,this.invokeStateHandler(xm.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),r.a(2);case 7:return r.a(2)}}),null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=Rs(me.ANONYMOUS_MODE_CAPABILITY),t=Rs(me.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return T((function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,l(Promise.all([Xu.instance.fetchProducts(),Ku.instance.fetchPaywalls().then((e=>Uu.instance.fetchCampaignRules(e)))]));case 1:return e.a(2)}}),null,this,null,Promise)}}])}();Nm.instance=new Nm;var jm=function(){return p((function e(t={}){var n,i,a,r,o;h(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(i=t.name)&&void 0!==i?i:"",this.steps=null!==(a=t.steps)&&void 0!==a?a:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(o=t.transition)&&void 0!==o?o:"none"}),[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&Xs(this.screens)}}])}(),$m=function(){function e(t,n,i,a){var r,o;h(this,e),(o=d(this,e,[null!==(r=t.flow.object)&&void 0!==r?r:{}])).stepcrumbs=[],o.branchcrumbs=[],o.activeHandoffSequence=null,o.currentScreenState=null,o.isPaused=!1,o.timerStates={},o.campaign=t,o.component=n,o.context=a,o.manager=i,o.branchcrumbs=[],o.stepcrumbs=[],o.registerResolvers(a);var s=o.findStepByType(Jc);return s&&o.forward(s.id),o}return k(e,jm),p(e,[{key:"registerResolvers",value:function(e){e&&new Tm(e),new _m,new Fm,new Rm,new Wm(this.campaign),Mm.shared.registerNamespaceResolver("Flow",(e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map((e=>e.id));case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}))}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some((e=>"screen"===e.type));return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find((t=>t.id===e))}},{key:"findStepByType",value:function(e){return this.steps.find((t=>t.type===e))}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some((e=>this.branchcrumbs.includes(e)))}},{key:"finished",value:function(){this.manager.finishFlow()}},{key:"back",value:function(){this.previousStepAvailable?this.backToPreviousScreenStep():$n.debug("No previous step available")}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=Vs(n.screen);return r&&this.component.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Jh.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}$n.warn("No previous screen step found to return to")}else $n.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t){if(this.isStepActive(t))switch(t.type){case Jc:case em:return this.stepcrumbs.push(t),void this.executeLifecycle(t,am);case Zc:return void this.handleBranchStep(t);case Qc:return void this.handleScreenStep(t);case tm:return}}else $n.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?$n.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,$n.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,$n.info(`Flow resumed from step ${e}`),this.forward(e)}else $n.warn("No step to resume from");else $n.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var i=e.actions[t];i&&this.executeFullLifecycles(i,n)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;$n.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var i=this.lifecycles(e);i&&(this.currentButton=t,this.executeFullLifecycles(i,n))}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;[a.before,a.action,a.after].forEach((e=>null==e?void 0:e.forEach((e=>this.shouldRun(e)&&this.performAction(e,t)))))}}},{key:"triggerBeforeActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.before)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"triggerAfterActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=g(i);!(a=r()).done;){var o;null===(o=a.value.after)||void 0===o||o.forEach((e=>this.shouldRun(e)&&this.performAction(e,n)))}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some((e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length}))}},{key:"shouldRun",value:function(e){return!e.conditions||e.conditions.every((e=>Mm.shared.evaluate(e)))}},{key:"performAction",value:function(e,t){var n;if(this.currentFlowStep){var i=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0,a=n=>{var i,a,r,o,s,u,l;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case qc.BACK:this.back();break;case qc.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.step?this.forward(e.parameters.step):this.next();break;case qc.NAVIGATE:var d;if(null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(d=this.previousFlowStep)||void 0===d?void 0:d.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case qc.FINISHED:case qc.DISMISS:this.finished();break;case qc.EXIT:var h=this.steps.find((e=>e.type===em));h&&this.forward(h.id);break;case qc.PAUSE:this.pause();break;case qc.RESUME:this.resumeFromPause();break;case qc.HANDOFF:if(null!==(o=e.parameters)&&void 0!==o&&o.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)$n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var c=this.getFormData();e.parameters.handoffTag===nm?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,c)}else $n.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else $n.debug("No handoffStepHandler found",e);break;case qc.LOG:var m;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)$n.info(`logEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(m=e.id)&&void 0!==m?m:"unknown"}`);break;case qc.TRACK:var f;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)$n.info(`trackEvent → ${e.parameters.eventName}`);else $n.warn(`Missing 'eventName' in logEvent action ${null!==(f=e.id)&&void 0!==f?f:"unknown"}`);break;case qc.SET_VIDEO:null!==(l=e.parameters)&&void 0!==l&&l.name&&e.parameters.url?Jh.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):$n.warn("Missing name, url for setting video details");break;case qc.BLOCK_BACK:var v,p=null===(v=e.parameters)||void 0===v?void 0:v.step,g=p?this.getStep(p):void 0;g?g.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:$n.warn("Missing step for blocking back");break;case qc.FLOW_EVENT:var y,b=new Lm(this.manager),w=Object.fromEntries(Object.entries(null!==(y=e.parameters)&&void 0!==y?y:{}).map((([e,t])=>[e,b.interpolateDeep(t)])));this.manager.eventHandler?this.manager.eventHandler(w):$n.warn("Missing event handler",w);break;case qc.FLOW_ENABLED:Jh.setUserInteractionEnabled(!0);break;case qc.FLOW_DISABLED:Jh.setUserInteractionEnabled(!1);break;case qc.SET_TAGS:e.parameters&&(Jh.setUserTags(e.parameters),Object.entries(e.parameters).forEach((([e,t])=>{Nm.setCustomerAttribute(e,t)})));break;default:$n.warn(`Missing action handler for ${e.function}`,e)}else $n.debug(`Skipped action for stale flow step ${n}`)};i?setTimeout(a.bind(this,this.currentFlowStep.id),i):a(this.currentFlowStep.id)}else $n.warn("No current flow step")}},{key:"nextStep",value:function(e){if(e){var t=this.steps.findIndex((t=>t.id===e.id));if(-1!==t){for(var n,i=g(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}$n.debug(`No active next step found after ${e.id}`)}else $n.error(`Could not find next step for step ${e.id}`)}else $n.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Vs(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),this.component.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):$n.error("No paywall or campaign found for next step")}},{key:"handleBranchStep",value:function(e){this.stepcrumbs.push(e);for(var t=0,n=Object.entries(e.actions);t<n.length;t++){var i=n[t],a=i[0],r=i[1];if(r)for(var o,s=g(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=g(u.action);!(l=d()).done;){var h,c,m=l.value;if(this.shouldRun(m))return this.branchcrumbs.push(a),null===(h=u.before)||void 0===h||h.forEach((e=>{this.performAction(e)})),u.action.forEach((e=>{this.shouldRun(e)&&this.performAction(e)})),void(null===(c=u.after)||void 0===c||c.forEach((e=>{this.performAction(e)})))}else $n.warn(`No actions defined for branch tag ${a}`)}}$n.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return y({},null!==(e=null===(t=Jh.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t).sort();if(0!==n.length){var i=n.filter((e=>!0===t[e]));if(0===i.length)return $n.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:y({},t),remainingKeys:[...i]},this.resumeNextHandoff()}else $n.warn("formStates is empty, no handoffs to perform")}else $n.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return $n.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return $n.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var i=n.remainingKeys.shift(),a=n.formStates[i];$n.debug(`Starting handoff for ${i} → ${String(a)}`),this.activeHandoffSequence=n;var r=`${i}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(),zm=function(){function e(){h(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return p(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var i=new $m(e,t,this,n);return this.flowOpen=!0,this.currentFlow=i,i}},{key:"finishFlow",value:function(){this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter((e=>e.type===Qc));if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter((e=>e.type===Qc));if(0===n.length)return 0;var i=this.buildNavGraph(this.currentFlow),a=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,i),o=0;if(r)o=this.calculateBranchingProgress(n,t,a,r,i);else{var s=t.findIndex((e=>e.id===a.id));o=s>=0?(s+1)/t.length:0}return o=Math.max(0,Math.min(1,o)),e&&this.setLastAnimatedFlowProgress(e,o),o}},{key:"findBranchPoint",value:function(e,t){for(var n,i=g(e);!(n=i()).done;){var a=n.value;if(this.hasBranching(a,e,t))return a}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,i,a){var r=e.length,o=t.findIndex((e=>e.id===i.id)),s=e.findIndex((e=>e.id===i.id)),u=t.findIndex((e=>e.id===n.id));if(-1===s||n.id===i.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,a),d=r+l;return $n.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return 0;var a=new Set,r=0,o=(e,s)=>{if(!a.has(e)){a.add(e);var u=(n.get(e)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));if(0!==u.length)for(var l,d=g(u);!(l=d()).done;){var h=l.value;o(h,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var i=t.findIndex((t=>t.id===e.id));if(-1===i)return!1;var a=(n.get(e.id)||[]).filter((e=>{var n=t.findIndex((t=>t.id===e));return n>i}));return a.length>1}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach((e=>{e.actions&&Object.values(e.actions).forEach((t=>{Array.isArray(t)&&t.forEach((t=>{t.action&&t.action.forEach((t=>{if("flowNav"===t.function){var i,a=null===(i=t.parameters)||void 0===i?void 0:i.step;a&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(a))}}))}))}))}));var i=new Map;return n.forEach(((e,t)=>{i.set(t,Array.from(e))})),this.navGraphCache.set(e,i),i}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var i=null===(t=n.actions)||void 0===t?void 0:t[rm];if(!i)return null;for(var a,r=g(i);!(a=r()).done;)for(var o,s,u=g(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===qc.NAVIGATE||d.function===qc.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var h=d.parameters.delay,c=Number(h);if(!isNaN(c)&&c>0)return c/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e}},{key:"resume",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;if(n&&i&&i.currentFlowStep){if(i.activeHandoffSequence)return $n.debug(`Resuming flow at handoff sequence ${i.currentFlowStep.id}`),void i.resumeNextHandoff();$n.debug(`Resuming flow at step ${i.currentFlowStep.id}`),i.executeLifecycle(i.currentFlowStep,"__resume__")}else $n.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?($n.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.finished()):$n.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?!0===i.resumeFromBookmark?i.pause():$n.warn("This flow cannot be paused"):$n.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();var Bm=e=>{var t;return T((function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map((e=>e.family))),e.forEach((e=>{var n=Hm(e);if(!t.has(n)){var i=new FontFace(n,`url(${e.file})`);document.fonts.add(i)}})),n.a(2,document.fonts.ready.then())}),null,null,null,Promise)};function Hm(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function Um(e,t,n){var i,a,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return $n.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var h={minDistance:null!==(i=null==n?void 0:n.minDistance)&&void 0!==i?i:30,maxDuration:null!==(a=null==n?void 0:n.maxDuration)&&void 0!==a?a:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},c=e.style.touchAction;h.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,M=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var i=e;return i.scrollHeight>i.clientHeight}catch(e){return!1}},P=e=>h.pointerTypes.includes(e.pointerType),T=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(P(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===h.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var i,a;if(M(n))return n;n=n.parentElement||(null!==(i=null===(a=n.parentNode)||void 0===a?void 0:a.host)&&void 0!==i?i:null)}return null})(n,e):null)||(S=!0);try{var i;null==e||null===(i=e.setPointerCapture)||void 0===i||i.call(e,t.pointerId)}catch(e){try{var a;null==n||null===(a=n.setPointerCapture)||void 0===a||a.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&P(e)){if(p=e.clientX,g=e.clientY,h.lockAxis&&!b){var n=Math.abs(p-f),i=Math.abs(g-v);(n>2||i>2)&&(b=i>=n?"y":"x")}if("y"===h.axisHint&&("y"===b||!h.lockAxis)){var a=g-v,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-y,u=o/Math.max(s,1),l=o>=h.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=h.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=h.minDistance){E=!0;var c=performance.now(),M={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:a,absX:Math.abs(p-f),absY:o,duration:c-y,velocity:o/Math.max(c-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:c,originalEvent:e};t(M)}}}},D=e=>{if(e.pointerId===m)if(P(e))if(w)A();else if(E||k)A();else{var n,i=performance.now(),a=i-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=h.lockAxis&&b?b:"x"===h.axisHint?"x":"y"===h.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=h.maxDuration,c=h.minDistance;if(w&&"y"===n&&S&&(c+=h.edgeLeakThreshold),d&&l>=c){var M;M="x"===n?r>0?"right":"left":o>0?"down":"up";var T=l/Math.max(a,1);t({direction:M,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:T,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:i,originalEvent:e})}A()}else A()},A=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!h.passiveListeners&&{passive:!0},C=h.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",T,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",D,x),e.addEventListener("pointercancel",D,x),e.addEventListener("lostpointercapture",D,x);return{destroy:()=>{e.removeEventListener("pointerdown",T,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",D,x),e.removeEventListener("pointercancel",D,x),e.removeEventListener("lostpointercapture",D,x),h.preventScrollOnSwipe&&(e.style.touchAction=c),A()},updateOptions:t=>{Object.assign(h,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=c)}}}var Gm,Vm,Xm,Km,Ym,qm,Jm,Qm,Zm,ef,tf,nf=e=>e,af=function(){function e(t,n,i){var a;return h(this,e),(a=d(this,e)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a.formFactor=cu(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a._savedScrollY=0,a._sheetDragStartY=0,a._sheetIsDragging=!1,a._dismissThreshold=100,a.type=t,a.value=n,a.context=i,a.setPaywallData(),M(a,a)}return k(e,n),p(e,[{key:"setPaywallData",value:function(){var e=Au(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,n,i=null==e||null===(t=e.template)||void 0===t||null===(t=t.initialState)||void 0===t?void 0:t.presentation_style;return(n=i)&&pc.has(n)?"sheet"===n?"fullscreen":n:"fullscreen"}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"connectedCallback",value:function(){var t;x(e,"connectedCallback",this)([]),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),document.addEventListener("keydown",this.handleKeyDownEvent.bind(this)),this._swipeHandler=Um(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.presentationStyle=this.getPresentationStyle(this.paywall),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var t,n;x(e,"disconnectedCallback",this)([]),Qr.clearLaunchId(),null!==(t=window.TVJS)&&void 0!==t&&t.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this.handleKeyDownEvent.bind(this)),Hu.getInstance().removeAllListeners(Pn),this.restoreStyles(),null===(n=this._halfSheetAbortController)||void 0===n||n.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){"television"===this.formFactor&&(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),this._originalBodyStyles.background=document.body.style.background,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior?document.body.style.overscrollBehavior:null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior?document.documentElement.style.overscrollBehavior:null,document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none",this.isHalfSheet||(this._originalBodyStyles.overflow=document.body.style.overflow,document.body.style.overflow="hidden")),this.isHalfSheet&&(this._savedScrollY=window.scrollY,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach((([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)})),Object.entries(this._originalDocumentStyles).forEach((([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)})),this._savedScrollY>0&&(window.scrollTo(0,this._savedScrollY),this._savedScrollY=0)}},{key:"handleKeyDownEvent",value:function(e){!this.flow||10009!==e.keyCode&&"Backspace"!==e.key&&"GoBack"!==e.key||this.flow.triggerActions(cm)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,n;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var i=this._halfSheetAbortController.signal,a=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content");if(a&&r){a.addEventListener("touchstart",(e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)}),{passive:!0,signal:i}),a.addEventListener("touchmove",(e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(a.style.transform=`translateY(${t}px)`,a.style.transition="none",e.preventDefault())}}),{passive:!1,signal:i}),a.addEventListener("touchend",(()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,n=a.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((n?parseFloat(n[1]):0)>this._dismissThreshold)if(null!==(e=null===(t=this.flow)||void 0===t?void 0:t.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==e&&e){var i;a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out",null===(i=this.flow)||void 0===i||i.triggerActions("__swipe_down__")}else{var r;a.style.transform="translateY(100%)",a.style.transition="transform 0.2s ease-in";var o=null===(r=this.shadowRoot)||void 0===r?void 0:r.querySelector(".nami-half-sheet-backdrop");o&&o.classList.add("nami-dismissing"),setTimeout((()=>{var e;null===(e=this.flow)||void 0===e||e.finished()}),200)}else a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out"}}),{signal:i})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container");if(n){n.focus();var i=null===(t=this._halfSheetAbortController)||void 0===t?void 0:t.signal;n.addEventListener("keydown",(e=>{if("Tab"===e.key){var t=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var i,a,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(a=this.shadowRoot)||void 0===a?void 0:a.activeElement)!==o||(e.preventDefault(),r.focus())}}}),i?{signal:i}:void 0)}}},{key:"firstUpdated",value:function(){this.timeSpentOnPaywall=Date.now(),Bs(this.campaign)&&(this.flow=zm.instance.presentFlow(this.campaign,this,this.context)),this.isHalfSheet&&this.updateComplete.then((()=>{this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()}))}},{key:"updated",value:function(t){x(e,"updated",this)([t]),this.isHalfSheet&&t.has("presentationStyle")&&(this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap())}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t;return T((function(n){for(;;)switch(n.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){n.n=1;break}return this.pages=[e],n.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){n.n=2;break}return n.a(2);case 2:return this.pages=[t,e],this.currentOffset=0,n.n=3,l(this.updateComplete);case 3:requestAnimationFrame((()=>{this.currentOffset=1,setTimeout((()=>{this.pages=[e],this.currentOffset=0,this.paywall=e}),250)}));case 4:return n.a(2)}}),null,this,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,i,a,r;return T((function(o){for(;;)switch(o.n){case 0:if(null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,om),a=this.presentationStyle,r=this.getPresentationStyle(e),"fullscreen"!==a||"compact_sheet"!==r){o.n=1;break}console.warn("Unsupported transition: fullscreen → compact_sheet. Presenting as fullscreen."),o.n=4;break;case 1:if("compact_sheet"!==a||"fullscreen"!==r&&"sheet"!==r){o.n=3;break}return o.n=2,l(this.animateHalfSheetExpand());case 2:this.presentationStyle="fullscreen",o.n=4;break;case 3:this.presentationStyle=r;case 4:return this.animation=t,o.n=5,l(this.updatePages(e));case 5:null!==(i=this.flow)&&void 0!==i&&i.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,rm);case 6:return o.a(2)}}),null,this,null,Promise)}},{key:"animateHalfSheetExpand",value:function(){var e,t;return T((function(n){for(;;)switch(n.n){case 0:if(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".nami-half-sheet-container")){n.n=1;break}return n.a(2);case 1:return t.classList.add("nami-expanding"),n.n=2,l(new Promise((e=>setTimeout(e,300))));case 2:return n.a(2)}}),null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return Jh.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?t(Gm||(Gm=nf``)):this.isHalfSheet?this.renderHalfSheet():t(Vm||(Vm=nf`
|
|
92
92
|
<div class="nami-flow-container">
|
|
93
93
|
${0}
|
|
94
94
|
</div>
|
|
@@ -123,6 +123,8 @@ import{css as e,html as t,LitElement as n,unsafeCSS as i,svg as a}from"lit";impo
|
|
|
123
123
|
:host {
|
|
124
124
|
box-sizing: border-box;
|
|
125
125
|
width: 100%;
|
|
126
|
+
height: 100vh;
|
|
127
|
+
height: 100dvh;
|
|
126
128
|
display: block;
|
|
127
129
|
}
|
|
128
130
|
:host(.nami-disabled) {
|
|
@@ -130,8 +132,8 @@ import{css as e,html as t,LitElement as n,unsafeCSS as i,svg as a}from"lit";impo
|
|
|
130
132
|
}
|
|
131
133
|
.nami-flow-container {
|
|
132
134
|
position: relative;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
height: 100vh;
|
|
136
|
+
height: 100dvh;
|
|
135
137
|
overflow: hidden;
|
|
136
138
|
|
|
137
139
|
/* Safe area support for iOS */
|
|
@@ -262,7 +264,7 @@ import{css as e,html as t,LitElement as n,unsafeCSS as i,svg as a}from"lit";impo
|
|
|
262
264
|
`),e,e,e,function(e){return fb[e]||fb.CheckCircleOutlined}(e))}},{key:"render",value:function(){return this.renderSvgIcon(this.shouldRenderCurrentIcon()?this.component.name:this.previousSymbolName)}}])}();de([Xc({type:Object})],ax.prototype,"component",void 0),de([Xc({type:Boolean})],ax.prototype,"inFocusedState",void 0),de([Xc({type:Number})],ax.prototype,"scaleFactor",void 0),ax=de([Sc("nami-symbol")],ax);var rx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).inFocusedState=!1,t.scaleFactor=1,t}return k(e,If),p(e,[{key:"styles",value:function(){var e=this.component,t=this.scaleFactor,n=this.inFocusedState,a=e.hidden,r=e.fontSize,o=e.alignment,s=e.strikethrough,u=e.spacing;return i(`\n :host {\n line-height: ${ex(r,t)}px;\n display: ${a?"none":"grid"};\n overflow-wrap: anywhere;\n width: fit-content;\n ${Yf(e,n)}\n ${tx(e,n)}\n font-size: ${(null!=r?r:ZA)*t}px;\n text-align: ${o||"center"};\n ${ov("string"!=typeof s&&s)}\n ${sv(e.fontName)}\n ${uv(e,t,n)}\n ${QA(e)}\n ${qf(e)}\n ${function({alignment:e,horizontalAlignment:t}){return Of("justify-content",t&&Rf[t]?Rf[t]:e&&Rf[e]?Rf[e]:"center")}(e)}\n }\n :host > :not(:first-child) {\n margin-top: ${u||0}px;\n }\n .anticon {\n text-rendering: optimizelegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: inherit;\n display: inline-block;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -.125em;\n }\n .anticon svg {\n display: inline-block;\n line-height: 1;\n }\n\n :host .bullet-text-wrapper {\n line-height: ${ex(r,t)}px;\n display: inline;\n overflow-wrap: anywhere;\n width: fit-content;\n ${Yf(e,n)}\n ${tx(e,n)}\n font-size: ${(null!=r?r:ZA)*t}px;\n text-align: ${o||"center"};\n ${ov("string"!=typeof s&&s)}\n ${sv(e.fontName)}\n }\n ${QA(e,":host .bullet-text-wrapper")}\n :host .bullet-text-wrapper p {\n margin: 0;\n line-height: ${ex(r,t)}px;\n }\n `)}},{key:"render",value:function(){var e=this.component,n=e.fontColor,i=e.fontSize,a=e.activeFontColor,r=e.bulletComponent,o=e.texts,s=e.spacing,u=r?y({fontColor:n,fontSize:i,activeFontColor:a,spacing:s},r):null;if(!Array.isArray(o))return t(VA||(VA=JA``));var l=o.map((e=>e?t(XA||(XA=JA`<nami-text-list-item-wrapper .component=${0} .scaleFactor=${0}>
|
|
263
265
|
${0}
|
|
264
266
|
<div class="bullet-text-wrapper" .innerHTML="${0}"></div>
|
|
265
|
-
</nami-text-list-item-wrapper>`),this.component,this.scaleFactor,u&&t(KA||(KA=JA`<nami-symbol .component=${0} .scaleFactor=${0}></nami-symbol>`),u,this.scaleFactor),cy(e)):null));return t(YA||(YA=JA`${0}`),l)}}])}();de([Xc({type:Object})],rx.prototype,"component",void 0),de([Xc({type:Boolean})],rx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],rx.prototype,"scaleFactor",void 0),rx=de([Sc("nami-text-list")],rx);(()=>{var e,t=!0;try{new RegExp("","u"),new RegExp("😀","u"),new RegExp("\\p{P}","u")}catch(e){t=!1}if(!t){var n=null===(e=cy.Lexer)||void 0===e?void 0:e.rules,i=null==n?void 0:n.inline;i&&Object.values(i).forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t]=(e=>{if(!(e instanceof RegExp))return e;if(!/\\p\{/.test(e.source))return e;var t="!\"#$%&'()*+,\\-./:;<=>?@[\\\\]^_`{|}~",n=e.source.replace(/\\p\{P\}\\p\{S\}/g,t).replace(/\\p\{P\}/g,t).replace(/\\p\{S\}/g,t),i=e.flags.replace(/u/g,"");return new RegExp(n,i)})(e[t])}))}))}})();var ox=function(){function e(){var t;return h(this,e),(t=d(this,e)).inFocusedState=!1,t.scaleFactor=1,t.handleFocusIn=()=>t.setFocusState(!0),t.handleFocusOut=e=>{var n,i,a=null!==(n=e.relatedTarget)&&void 0!==n?n:null;if(!a)return t.setFocusState(!1);a===t||null!==(i=t.shadowRoot)&&void 0!==i&&i.contains(a)||t.setFocusState(!1)},t.handleFocusChanged=e=>{var n=e.detail;t.setFocusState(!0===(null==n?void 0:n.inFocusedState))},t.addEventListener("focusin",t.handleFocusIn),t.addEventListener("focusout",t.handleFocusOut),t.addEventListener("focus-changed",t.handleFocusChanged),t}return k(e,If),p(e,[{key:"disconnectedCallback",value:function(){x(e,"disconnectedCallback",this)([]),this.removeEventListener("focusin",this.handleFocusIn),this.removeEventListener("focusout",this.handleFocusOut),this.removeEventListener("focus-changed",this.handleFocusChanged)}},{key:"styles",value:function(){var e=this.component,t=this.scaleFactor,n=this.minSDKVersion,a=e.backgroundBlur,r="vertical"===e.direction,o=r?"width":"height",s=r?"margin-top":"margin-left",u=e.fillImage?i(`\n line-height: 1.5715;\n background-image: url(${e.fillImage});\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n height: 100%;\n width: 100%;\n `):i(Yf(e,!1));return i(`\n :host {\n box-sizing: border-box;\n display: ${e.hidden?"none":"flex"};\n ${a?`backdrop-filter: blur(${a}px);`:""}\n ${u};\n ${dv(e.position)}\n ${qf(e)}\n ${uv(e,t,!1)}\n }\n :host(:focus),\n :host(.nami-focus-within){\n ${Yf(e,!0)}\n ${uv(e,t,!0)}\n }\n :host(:focus-visible){\n ${fv(e)}\n }\n :host > * {\n ${Qf(n,o)}\n }\n :host > *:not(:first-child) {\n ${s}: ${e.spacing?e.spacing*t:0}px;\n }\n `)}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>np(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}},{key:"setFocusState",value:function(e){this.inFocusedState!==e&&(this.inFocusedState=e,this.classList.toggle("nami-focus-within",e),this.toggleAttribute("data-nami-focused",e))}}])}();de([Xc({type:Object})],ox.prototype,"component",void 0),de([Xc({type:Boolean})],ox.prototype,"inFocusedState",void 0),de([Xc({type:Number})],ox.prototype,"scaleFactor",void 0),de([Xc({type:Object})],ox.prototype,"minSDKVersion",void 0),ox=de([Sc("nami-container")],ox);var sx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).inFocusedState=!1,t.scaleFactor=1,t}return k(e,If),p(e,[{key:"styles",value:function(){var e=this.component.backgroundBlur,t="vertical"===this.component.direction,n=t?"width":"height",a=t?"margin-top":"margin-left",r=this.component.fillImage?i(`\n line-height: 1.5715;\n background-image: url(${this.component.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):i(Yf(this.component,!1));return i(`\n :host {\n opacity: 0;\n display: ${this.component.hidden?"none":"flex"};\n ${r};\n ${e?`backdrop-filter: blur(${e}px);`:""}\n ${dv(this.component.position)}\n ${qf(this.component)}\n ${uv(this.component,this.scaleFactor,!1)}\n transition: transform .5s ease-in;\n }\n :host > *:not(:first-child) {\n ${a}: ${this.component.spacing?this.component.spacing*this.scaleFactor:0}px;\n }\n :host(:focus){\n ${Yf(this.component,!0)}\n ${uv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${fv(this.component)}\n }\n :host > * {\n ${n}: 100%;\n }\n :host(.fade-in){\n opacity: 1;\n animation: fadeIn 0.5s ease-in\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n `)}},{key:"updated",value:function(){var e=this.contextProvider.state.currentGroupId;Gu(e,this.currentGroupId)||(this.classList.remove("fade-in"),setTimeout((()=>this.classList.add("fade-in")),100),this.currentGroupId=e)}},{key:"render",value:function(){var e,t,n=this.contextProvider.state,i=n.mediaList,a=n.currentGroupId,r=n.selectedPaywall,o=n.formFactor,s=jd(this.contextProvider.productDetails,null!==(e=null==r?void 0:r.sku_menus)&&void 0!==e?e:[],(null===(t=this.component)||void 0===t?void 0:t.subsetGroup)||a);return wv(this.contextProvider,s,this.component,i).map((([e,t])=>(this.inFocusedState="television"==o?e:this.inFocusedState,t.map((e=>np(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))))}}])}();de([Xc({type:Object})],sx.prototype,"component",void 0),de([Xc({type:Boolean})],sx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],sx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],sx.prototype,"minSDKVersion",void 0),sx=de([Sc("nami-product-container")],sx);var ux,lx,dx=e=>e,hx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).inFocusedState=!1,t.scaleFactor=1,t}return k(e,If),p(e,[{key:"styles",value:function(){var e,t,n=this.component,a=n.imageCropping,r=n.alignment,o=n.height,s=n.width,u=n.rightMargin,l=n.spacing,d=n.hidden,h=n.blur,c="fit"===a,m=this.contextConsumer.state.formFactor;return i(`\n :host {\n display: ${"television"===m?"flex":"inline-block"};\n ${d?"display:none;":""}\n position: relative;\n height: ${Gf(null!=o?o:"100%",this.scaleFactor)};\n width: ${Gf(null!==(e="fitContent"==s?o:s)&&void 0!==e?e:"100%",this.scaleFactor)};\n }\n :host img {\n transition: all 0.3s;\n object-fit: ${c?"contain":"cover"};\n object-position: ${r} center;\n height: ${Gf(null!=o?o:"100%",this.scaleFactor)};\n width: ${Gf(null!==(t="fitContent"==s?o:s)&&void 0!==t?t:"100%",this.scaleFactor)};\n margin-right: ${u||l||0}px;\n ${h?`filter: blur(${h}px);`:""}\n flex-shrink: ${"number"==typeof s?0:1};\n }\n `)}},{key:"render",value:function(){var e,n=this.component,i=n.url,a=n.alt,r=n.title,o=n.focusedBorderColor,s=n.focusedFillColor,u=n.fillColor;return i?(!o&&ep(u,s)||(this.tabIndex=0),this.ariaLabel=null!==(e=null!=a?a:r)&&void 0!==e?e:"",t(ux||(ux=dx`<img src="${0}" alt="${0}" />`),i,this.ariaLabel)):(this.tabIndex=-1,this.ariaLabel=null,t(lx||(lx=dx``)))}}])}();de([Xc({type:Object})],hx.prototype,"component",void 0),de([Xc({type:Boolean})],hx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],hx.prototype,"scaleFactor",void 0),hx=de([Sc("nami-image")],hx);var cx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).fullscreen=!1,t.inFocusedState=!1,t.scaleFactor=1,t}return k(e,If),p(e,[{key:"connectedCallback",value:function(){x(e,"connectedCallback",this)([]),document.body.style.background=this.component.fillColor||"transparent"}},{key:"styles",value:function(){var e;if(!this.contextConsumer||!this.component)return i("");var t=this.component,n=this.scaleFactor,a=this.contextConsumer.state.formFactor,r=t.backgroundBlur,o="vertical"===t.direction?"margin-top":"margin-left";return i(`\n :host {\n max-height: ${"television"===a?"100vh":""};\n display: ${t.hidden?"none":"flex"};\n flex-direction: column;\n overflow: hidden;\n ${Jf(t)}\n position: fixed;\n width: 100%;\n bottom: 0px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${null!==(e=t.zIndex)&&void 0!==e?e:1};\n top: 0px;\n ${r?`backdrop-filter: blur(${r}px);`:""}\n ${Yf(t,!1)}\n transition: all 0.3s;\n ${ev(t,n)}\n }\n :host(:focus){\n ${Yf(t,!0)}\n }\n :host > *:not(:first-child) {\n ${o}: ${t.spacing?t.spacing*n:0}px;\n }\n `)}},{key:"updated",value:function(){var e,t,n=Array.from(document.getElementsByTagName("nami-paywall")),i=null===(e=this.component.fillColor)||void 0===e?void 0:e.includes("gradient"),a=null===(t=this.shadowRoot)||void 0===t?void 0:t.innerHTML.includes("nami-image");n[0]&&(n[0].style.position=!a||i?"relative":"","undefined"!=typeof window&&"undefined"!=typeof CSS&&CSS.supports("height: 100dvh")?n[0].style.minHeight=!a||i?"100dvh":"100%":n[0].style.minHeight=!a||i?"100vh":"100%")}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>np(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}}])}();de([Xc({type:Object})],cx.prototype,"component",void 0),de([Xc({type:Boolean})],cx.prototype,"fullscreen",void 0),de([Xc({type:Boolean})],cx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],cx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],cx.prototype,"minSDKVersion",void 0),cx=de([Sc("nami-background-container")],cx);var mx,fx=e=>e,vx=function(){function t(){var e;return h(this,t),(e=d(this,t,arguments)).zIndex=2,e.inFocusedState=!1,e.scaleFactor=1,e}return k(t,If),p(t,[{key:"styles",value:function(){var t=this.contextConsumer,n=this.component,a=this.zIndex,r=this.scaleFactor;if(!t)return e(mx||(mx=fx``));var o=t.state.formFactor,s=n.backgroundBlur,u="phone"!==o?"width: 100%;":"",l="vertical"===n.direction?"margin-top":"margin-left";return i(`\n :host {\n box-sizing: border-box;\n display: ${n.hidden?"none":"flex"};\n position: relative;\n flex: 1;\n min-height: 0;\n ${qf(n)}\n ${iv(n,r)}\n ${u}\n align-items: center;\n justify-content: flex-start;\n justify-content: start;\n ${s?`backdrop-filter: blur(${s}px);`:""}\n z-index: ${a};\n transition: all 0.3s;\n overflow-y: ${"television"===o?"hidden":"scroll"};\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${ev(n,r)}\n ${Yf(n,!1)}\n }\n :host::-webkit-scrollbar {\n display: none;\n }\n :host(:focus){\n ${Yf(n,!0)}\n }\n :host > * {\n width: 100%;\n }\n :host > *:not(:first-child) {\n ${l}: ${n.spacing?n.spacing*r:0}px;\n }\n `)}},{key:"firstUpdated",value:function(){var e=new CustomEvent("child-spacing",{detail:{spacing:this.component.spacing},bubbles:!0,composed:!0});this.dispatchEvent(e)}},{key:"render",value:function(){var e;return(null===(e=this.component.components)||void 0===e?void 0:e.map((e=>np(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))||[]}}])}();de([Xc({type:Object})],vx.prototype,"component",void 0),de([Xc({type:Number})],vx.prototype,"zIndex",void 0),de([Xc({type:Boolean})],vx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],vx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],vx.prototype,"minSDKVersion",void 0),vx=de([Sc("nami-content-container")],vx);var px,gx=e=>e,yx=function(){function e(){var t;return h(this,e),(t=d(this,e)).inFocusedState=!1,t.scaleFactor=1,t._handleClick=e=>{e.preventDefault(),Rp({contextProvider:t.contextProvider,onTap:t.component.onTap})},t.addEventListener("click",t._handleClick),t}return k(e,If),p(e,[{key:"styles",value:function(){var e,t,n=hv("active",this.component.components[0]),a=hv("inactive",this.component.components[0]);return i(`\n :host {\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${qf(this.component)}\n ${Yf(this.component,!1)}\n ${uv(this.component,this.scaleFactor,!1)}\n ${this.component.hidden?"display:none;":""}\n }\n :host(:focus){\n ${Yf(this.component,!0)}\n ${uv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${fv(this.component)}\n }\n .toggle{\n ${e=this.component,t=this.scaleFactor,`\n position: absolute;\n top: ${Uf(t,e.topPadding)}px;\n bottom: ${Uf(t,e.bottomPadding)}px;\n width: calc(50% - ${Uf(t,e.leftPadding)/2}px) !important;\n `}\n transition: transform .5s cubic-bezier(.77, 0, .175, 1);\n ${cv(a,this.scaleFactor,!1)}\n }\n\n :host(:focus) .toggle{\n ${cv(n,this.scaleFactor,!0)}\n }\n \n nami-segment-picker-item:nth-of-type(1).active~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${Yf(n,!0)}\n ${mv(n,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(2).active~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${Yf(n,!0)}\n ${mv(n,this.scaleFactor)}\n `)}},{key:"render",value:function(){this.role="tablist";var e=this.component.components.map((e=>np(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion)));return t(px||(px=gx`${0}<div class="toggle"></div>`),e)}}])}();de([Xc({type:Object})],yx.prototype,"component",void 0),de([Xc({type:Boolean})],yx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],yx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],yx.prototype,"minSDKVersion",void 0),yx=de([Sc("nami-segment-picker")],yx);var bx,wx=e=>e,kx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).inFocusedState=!1,t.scaleFactor=1,t._handleFocus=()=>{t.inFocusedState=!0,t._announceButtonLabel()},t._handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||t._handleClick()},t._handleClick=()=>{t._updateFormState(),t.requestUpdate("component")},t._handleHover=()=>{t.inFocusedState=!0},t}return k(e,If),p(e,[{key:"connectedCallback",value:function(){x(e,"connectedCallback",this)([]),this._isActive=!!this.component.checked,this.classList.toggle("active",this._isActive),this.component.formId&&this._updateFormState(),this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("focus",this._handleFocus)}},{key:"disconnectedCallback",value:function(){x(e,"disconnectedCallback",this)([]),this.removeEventListener("click",this._handleClick),this.removeEventListener("mouseover",this._handleHover),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("focus",this._handleFocus)}},{key:"_announceButtonLabel",value:function(){var e=this.component.text||"";e&&mc(e)}},{key:"_getParentPicker",value:function(){var e=this.getRootNode();return e instanceof ShadowRoot?e.host:null}},{key:"_getParentFormId",value:function(){var e;return null===(e=this._getParentPicker())||void 0===e?void 0:e.component.formId}},{key:"_updateFormState",value:function(){if(this.contextProvider)if(this.component.formId){var e=this._getParentFormId();e&&this.contextProvider.setFormState(e,this.component.formId)}else this.component.id&&this.contextProvider.setCurrentGroupData(this.component.id,this.component.text||"")}},{key:"updated",value:function(e){var t;if(e.has("component")&&this.contextProvider){var n=null!==(t=e.get("component"))&&void 0!==t?t:this.component;if(n.formId){var i=this._getParentFormId();i&&this.contextProvider.state.formStates[i]&&(this._isActive=this.contextProvider.state.formStates[i]===n.formId)}else this._isActive=Gu(n.id,this.contextProvider.state.currentGroupId);if(this.classList.toggle("active",this._isActive),this._isActive){var a=this.getRootNode();if(a instanceof ShadowRoot)a.querySelectorAll("nami-segment-picker-item").forEach((e=>{e!==this&&e.requestUpdate("component",e)}))}}}},{key:"styles",value:function(){var e,t,n=hv("active",this.component),a=hv("inactive",this.component);return i(`\n :host {\n box-sizing: border-box;\n display: ${this.component.hidden?"none":"inline-flex"};\n position: relative;\n ${cv(y({},a,this.component),this.scaleFactor,this.inFocusedState)}\n ${rv(null!==(e=this.component.inactiveDropShadow)&&void 0!==e?e:this.component.dropShadow)}\n }\n\n :host > * {\n cursor: pointer;\n }\n\n :host(.active) {\n z-index: 1 !important;\n ${mv(y({},n,this.component),this.scaleFactor)}\n ${rv(null!==(t=this.component.activeDropShadow)&&void 0!==t?t:this.component.dropShadow)}\n }\n\n input {\n visibility: hidden;\n position: absolute;\n top: 0;\n }\n `)}},{key:"render",value:function(){return this.tabIndex=0,this.role="tab",this.ariaSelected=`${this._isActive}`,this.ariaLabel=this.component.text||"",t(bx||(bx=wx`<input type="radio"
|
|
267
|
+
</nami-text-list-item-wrapper>`),this.component,this.scaleFactor,u&&t(KA||(KA=JA`<nami-symbol .component=${0} .scaleFactor=${0}></nami-symbol>`),u,this.scaleFactor),cy(e)):null));return t(YA||(YA=JA`${0}`),l)}}])}();de([Xc({type:Object})],rx.prototype,"component",void 0),de([Xc({type:Boolean})],rx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],rx.prototype,"scaleFactor",void 0),rx=de([Sc("nami-text-list")],rx);(()=>{var e,t=!0;try{new RegExp("","u"),new RegExp("😀","u"),new RegExp("\\p{P}","u")}catch(e){t=!1}if(!t){var n=null===(e=cy.Lexer)||void 0===e?void 0:e.rules,i=null==n?void 0:n.inline;i&&Object.values(i).forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t]=(e=>{if(!(e instanceof RegExp))return e;if(!/\\p\{/.test(e.source))return e;var t="!\"#$%&'()*+,\\-./:;<=>?@[\\\\]^_`{|}~",n=e.source.replace(/\\p\{P\}\\p\{S\}/g,t).replace(/\\p\{P\}/g,t).replace(/\\p\{S\}/g,t),i=e.flags.replace(/u/g,"");return new RegExp(n,i)})(e[t])}))}))}})();var ox=function(){function e(){var t;return h(this,e),(t=d(this,e)).inFocusedState=!1,t.scaleFactor=1,t.handleFocusIn=()=>t.setFocusState(!0),t.handleFocusOut=e=>{var n,i,a=null!==(n=e.relatedTarget)&&void 0!==n?n:null;if(!a)return t.setFocusState(!1);a===t||null!==(i=t.shadowRoot)&&void 0!==i&&i.contains(a)||t.setFocusState(!1)},t.handleFocusChanged=e=>{var n=e.detail;t.setFocusState(!0===(null==n?void 0:n.inFocusedState))},t.addEventListener("focusin",t.handleFocusIn),t.addEventListener("focusout",t.handleFocusOut),t.addEventListener("focus-changed",t.handleFocusChanged),t}return k(e,If),p(e,[{key:"disconnectedCallback",value:function(){x(e,"disconnectedCallback",this)([]),this.removeEventListener("focusin",this.handleFocusIn),this.removeEventListener("focusout",this.handleFocusOut),this.removeEventListener("focus-changed",this.handleFocusChanged)}},{key:"styles",value:function(){var e=this.component,t=this.scaleFactor,n=this.minSDKVersion,a=e.backgroundBlur,r="vertical"===e.direction,o=r?"width":"height",s=r?"margin-top":"margin-left",u=e.fillImage?i(`\n line-height: 1.5715;\n background-image: url(${e.fillImage});\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n height: 100%;\n width: 100%;\n `):i(Yf(e,!1));return i(`\n :host {\n box-sizing: border-box;\n display: ${e.hidden?"none":"flex"};\n ${a?`backdrop-filter: blur(${a}px);`:""}\n ${u};\n ${dv(e.position)}\n ${qf(e)}\n ${uv(e,t,!1)}\n }\n :host(:focus),\n :host(.nami-focus-within){\n ${Yf(e,!0)}\n ${uv(e,t,!0)}\n }\n :host(:focus-visible){\n ${fv(e)}\n }\n :host > * {\n ${Qf(n,o)}\n }\n :host > *:not(:first-child) {\n ${s}: ${e.spacing?e.spacing*t:0}px;\n }\n `)}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>np(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}},{key:"setFocusState",value:function(e){this.inFocusedState!==e&&(this.inFocusedState=e,this.classList.toggle("nami-focus-within",e),this.toggleAttribute("data-nami-focused",e))}}])}();de([Xc({type:Object})],ox.prototype,"component",void 0),de([Xc({type:Boolean})],ox.prototype,"inFocusedState",void 0),de([Xc({type:Number})],ox.prototype,"scaleFactor",void 0),de([Xc({type:Object})],ox.prototype,"minSDKVersion",void 0),ox=de([Sc("nami-container")],ox);var sx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).inFocusedState=!1,t.scaleFactor=1,t}return k(e,If),p(e,[{key:"styles",value:function(){var e=this.component.backgroundBlur,t="vertical"===this.component.direction,n=t?"width":"height",a=t?"margin-top":"margin-left",r=this.component.fillImage?i(`\n line-height: 1.5715;\n background-image: url(${this.component.fillImage});\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n `):i(Yf(this.component,!1));return i(`\n :host {\n opacity: 0;\n display: ${this.component.hidden?"none":"flex"};\n ${r};\n ${e?`backdrop-filter: blur(${e}px);`:""}\n ${dv(this.component.position)}\n ${qf(this.component)}\n ${uv(this.component,this.scaleFactor,!1)}\n transition: transform .5s ease-in;\n }\n :host > *:not(:first-child) {\n ${a}: ${this.component.spacing?this.component.spacing*this.scaleFactor:0}px;\n }\n :host(:focus){\n ${Yf(this.component,!0)}\n ${uv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${fv(this.component)}\n }\n :host > * {\n ${n}: 100%;\n }\n :host(.fade-in){\n opacity: 1;\n animation: fadeIn 0.5s ease-in\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n `)}},{key:"updated",value:function(){var e=this.contextProvider.state.currentGroupId;Gu(e,this.currentGroupId)||(this.classList.remove("fade-in"),setTimeout((()=>this.classList.add("fade-in")),100),this.currentGroupId=e)}},{key:"render",value:function(){var e,t,n=this.contextProvider.state,i=n.mediaList,a=n.currentGroupId,r=n.selectedPaywall,o=n.formFactor,s=jd(this.contextProvider.productDetails,null!==(e=null==r?void 0:r.sku_menus)&&void 0!==e?e:[],(null===(t=this.component)||void 0===t?void 0:t.subsetGroup)||a);return wv(this.contextProvider,s,this.component,i).map((([e,t])=>(this.inFocusedState="television"==o?e:this.inFocusedState,t.map((e=>np(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))))}}])}();de([Xc({type:Object})],sx.prototype,"component",void 0),de([Xc({type:Boolean})],sx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],sx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],sx.prototype,"minSDKVersion",void 0),sx=de([Sc("nami-product-container")],sx);var ux,lx,dx=e=>e,hx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).inFocusedState=!1,t.scaleFactor=1,t}return k(e,If),p(e,[{key:"styles",value:function(){var e,t,n=this.component,a=n.imageCropping,r=n.alignment,o=n.height,s=n.width,u=n.rightMargin,l=n.spacing,d=n.hidden,h=n.blur,c="fit"===a,m=this.contextConsumer.state.formFactor;return i(`\n :host {\n display: ${"television"===m?"flex":"inline-block"};\n ${d?"display:none;":""}\n position: relative;\n height: ${Gf(null!=o?o:"100%",this.scaleFactor)};\n width: ${Gf(null!==(e="fitContent"==s?o:s)&&void 0!==e?e:"100%",this.scaleFactor)};\n }\n :host img {\n transition: all 0.3s;\n object-fit: ${c?"contain":"cover"};\n object-position: ${r} center;\n height: ${Gf(null!=o?o:"100%",this.scaleFactor)};\n width: ${Gf(null!==(t="fitContent"==s?o:s)&&void 0!==t?t:"100%",this.scaleFactor)};\n margin-right: ${u||l||0}px;\n ${h?`filter: blur(${h}px);`:""}\n flex-shrink: ${"number"==typeof s?0:1};\n }\n `)}},{key:"render",value:function(){var e,n=this.component,i=n.url,a=n.alt,r=n.title,o=n.focusedBorderColor,s=n.focusedFillColor,u=n.fillColor;return i?(!o&&ep(u,s)||(this.tabIndex=0),this.ariaLabel=null!==(e=null!=a?a:r)&&void 0!==e?e:"",t(ux||(ux=dx`<img src="${0}" alt="${0}" />`),i,this.ariaLabel)):(this.tabIndex=-1,this.ariaLabel=null,t(lx||(lx=dx``)))}}])}();de([Xc({type:Object})],hx.prototype,"component",void 0),de([Xc({type:Boolean})],hx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],hx.prototype,"scaleFactor",void 0),hx=de([Sc("nami-image")],hx);var cx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).fullscreen=!1,t.inFocusedState=!1,t.scaleFactor=1,t}return k(e,If),p(e,[{key:"connectedCallback",value:function(){x(e,"connectedCallback",this)([]),document.body.style.background=this.component.fillColor||"transparent"}},{key:"styles",value:function(){var e;if(!this.contextConsumer||!this.component)return i("");var t=this.component,n=this.scaleFactor,a=this.contextConsumer.state.formFactor,r=t.backgroundBlur,o="vertical"===t.direction?"margin-top":"margin-left";return i(`\n :host {\n max-height: ${"television"===a?"100vh":""};\n display: ${t.hidden?"none":"flex"};\n flex-direction: column;\n overflow: hidden;\n ${Jf(t)}\n position: fixed;\n width: 100%;\n bottom: 0px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${null!==(e=t.zIndex)&&void 0!==e?e:1};\n top: 0px;\n ${r?`backdrop-filter: blur(${r}px);`:""}\n ${Yf(t,!1)}\n transition: all 0.3s;\n ${ev(t,n)}\n }\n :host(:focus){\n ${Yf(t,!0)}\n }\n :host > *:not(:first-child) {\n ${o}: ${t.spacing?t.spacing*n:0}px;\n }\n `)}},{key:"updated",value:function(){var e,t,n=Array.from(document.getElementsByTagName("nami-paywall")),i=null===(e=this.component.fillColor)||void 0===e?void 0:e.includes("gradient"),a=null===(t=this.shadowRoot)||void 0===t?void 0:t.innerHTML.includes("nami-image");n[0]&&(n[0].style.position=!a||i?"relative":"","undefined"!=typeof window&&"undefined"!=typeof CSS&&CSS.supports("height: 100dvh")?n[0].style.minHeight=!a||i?"100dvh":"100%":n[0].style.minHeight=!a||i?"100vh":"100%")}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map((e=>np(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion)))}}])}();de([Xc({type:Object})],cx.prototype,"component",void 0),de([Xc({type:Boolean})],cx.prototype,"fullscreen",void 0),de([Xc({type:Boolean})],cx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],cx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],cx.prototype,"minSDKVersion",void 0),cx=de([Sc("nami-background-container")],cx);var mx,fx=e=>e,vx=function(){function t(){var e;return h(this,t),(e=d(this,t,arguments)).zIndex=2,e.inFocusedState=!1,e.scaleFactor=1,e}return k(t,If),p(t,[{key:"styles",value:function(){var t,n=this.contextConsumer,a=this.component,r=this.zIndex,o=this.scaleFactor;if(!n)return e(mx||(mx=fx``));var s=n.state.formFactor,u=a.backgroundBlur,l="phone"!==s?"width: 100%;":"",d=null!==(t=a.width)&&void 0!==t?t:a.fixedWidth,h="phone"===s?"max-width:100%; "+(void 0!==d?`width: ${Gf(d,o)};`:""):iv(a,o),c="vertical"===a.direction?"margin-top":"margin-left";return i(`\n :host {\n box-sizing: border-box;\n display: ${a.hidden?"none":"flex"};\n position: relative;\n flex: 1;\n min-height: 0;\n ${qf(a)}\n ${h}\n ${l}\n align-items: center;\n justify-content: flex-start;\n justify-content: start;\n ${u?`backdrop-filter: blur(${u}px);`:""}\n z-index: ${r};\n transition: all 0.3s;\n overflow-y: ${"television"===s?"hidden":"scroll"};\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${ev(a,o)}\n ${Yf(a,!1)}\n }\n :host::-webkit-scrollbar {\n display: none;\n }\n :host(:focus){\n ${Yf(a,!0)}\n }\n :host > * {\n width: 100%;\n }\n :host > *:not(:first-child) {\n ${c}: ${a.spacing?a.spacing*o:0}px;\n }\n `)}},{key:"firstUpdated",value:function(){var e=new CustomEvent("child-spacing",{detail:{spacing:this.component.spacing},bubbles:!0,composed:!0});this.dispatchEvent(e)}},{key:"render",value:function(){var e;return(null===(e=this.component.components)||void 0===e?void 0:e.map((e=>np(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))||[]}}])}();de([Xc({type:Object})],vx.prototype,"component",void 0),de([Xc({type:Number})],vx.prototype,"zIndex",void 0),de([Xc({type:Boolean})],vx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],vx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],vx.prototype,"minSDKVersion",void 0),vx=de([Sc("nami-content-container")],vx);var px,gx=e=>e,yx=function(){function e(){var t;return h(this,e),(t=d(this,e)).inFocusedState=!1,t.scaleFactor=1,t._handleClick=e=>{e.preventDefault(),Rp({contextProvider:t.contextProvider,onTap:t.component.onTap})},t.addEventListener("click",t._handleClick),t}return k(e,If),p(e,[{key:"styles",value:function(){var e,t,n=hv("active",this.component.components[0]),a=hv("inactive",this.component.components[0]);return i(`\n :host {\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${qf(this.component)}\n ${Yf(this.component,!1)}\n ${uv(this.component,this.scaleFactor,!1)}\n ${this.component.hidden?"display:none;":""}\n }\n :host(:focus){\n ${Yf(this.component,!0)}\n ${uv(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${fv(this.component)}\n }\n .toggle{\n ${e=this.component,t=this.scaleFactor,`\n position: absolute;\n top: ${Uf(t,e.topPadding)}px;\n bottom: ${Uf(t,e.bottomPadding)}px;\n width: calc(50% - ${Uf(t,e.leftPadding)/2}px) !important;\n `}\n transition: transform .5s cubic-bezier(.77, 0, .175, 1);\n ${cv(a,this.scaleFactor,!1)}\n }\n\n :host(:focus) .toggle{\n ${cv(n,this.scaleFactor,!0)}\n }\n \n nami-segment-picker-item:nth-of-type(1).active~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${Yf(n,!0)}\n ${mv(n,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(2).active~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${Yf(n,!0)}\n ${mv(n,this.scaleFactor)}\n `)}},{key:"render",value:function(){this.role="tablist";var e=this.component.components.map((e=>np(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion)));return t(px||(px=gx`${0}<div class="toggle"></div>`),e)}}])}();de([Xc({type:Object})],yx.prototype,"component",void 0),de([Xc({type:Boolean})],yx.prototype,"inFocusedState",void 0),de([Xc({type:Number})],yx.prototype,"scaleFactor",void 0),de([Xc({type:Object})],yx.prototype,"minSDKVersion",void 0),yx=de([Sc("nami-segment-picker")],yx);var bx,wx=e=>e,kx=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).inFocusedState=!1,t.scaleFactor=1,t._handleFocus=()=>{t.inFocusedState=!0,t._announceButtonLabel()},t._handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||t._handleClick()},t._handleClick=()=>{t._updateFormState(),t.requestUpdate("component")},t._handleHover=()=>{t.inFocusedState=!0},t}return k(e,If),p(e,[{key:"connectedCallback",value:function(){x(e,"connectedCallback",this)([]),this._isActive=!!this.component.checked,this.classList.toggle("active",this._isActive),this.component.formId&&this._updateFormState(),this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("focus",this._handleFocus)}},{key:"disconnectedCallback",value:function(){x(e,"disconnectedCallback",this)([]),this.removeEventListener("click",this._handleClick),this.removeEventListener("mouseover",this._handleHover),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("focus",this._handleFocus)}},{key:"_announceButtonLabel",value:function(){var e=this.component.text||"";e&&mc(e)}},{key:"_getParentPicker",value:function(){var e=this.getRootNode();return e instanceof ShadowRoot?e.host:null}},{key:"_getParentFormId",value:function(){var e;return null===(e=this._getParentPicker())||void 0===e?void 0:e.component.formId}},{key:"_updateFormState",value:function(){if(this.contextProvider)if(this.component.formId){var e=this._getParentFormId();e&&this.contextProvider.setFormState(e,this.component.formId)}else this.component.id&&this.contextProvider.setCurrentGroupData(this.component.id,this.component.text||"")}},{key:"updated",value:function(e){var t;if(e.has("component")&&this.contextProvider){var n=null!==(t=e.get("component"))&&void 0!==t?t:this.component;if(n.formId){var i=this._getParentFormId();i&&this.contextProvider.state.formStates[i]&&(this._isActive=this.contextProvider.state.formStates[i]===n.formId)}else this._isActive=Gu(n.id,this.contextProvider.state.currentGroupId);if(this.classList.toggle("active",this._isActive),this._isActive){var a=this.getRootNode();if(a instanceof ShadowRoot)a.querySelectorAll("nami-segment-picker-item").forEach((e=>{e!==this&&e.requestUpdate("component",e)}))}}}},{key:"styles",value:function(){var e,t,n=hv("active",this.component),a=hv("inactive",this.component);return i(`\n :host {\n box-sizing: border-box;\n display: ${this.component.hidden?"none":"inline-flex"};\n position: relative;\n ${cv(y({},a,this.component),this.scaleFactor,this.inFocusedState)}\n ${rv(null!==(e=this.component.inactiveDropShadow)&&void 0!==e?e:this.component.dropShadow)}\n }\n\n :host > * {\n cursor: pointer;\n }\n\n :host(.active) {\n z-index: 1 !important;\n ${mv(y({},n,this.component),this.scaleFactor)}\n ${rv(null!==(t=this.component.activeDropShadow)&&void 0!==t?t:this.component.dropShadow)}\n }\n\n input {\n visibility: hidden;\n position: absolute;\n top: 0;\n }\n `)}},{key:"render",value:function(){return this.tabIndex=0,this.role="tab",this.ariaSelected=`${this._isActive}`,this.ariaLabel=this.component.text||"",t(bx||(bx=wx`<input type="radio"
|
|
266
268
|
autocomplete="off"
|
|
267
269
|
id="${0}"
|
|
268
270
|
name="${0}"
|