@rokt/dcui-orchestrator 0.0.4-rc.11 → 0.0.4-rc.13
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/index.cjs +23 -23
- package/dist/index.js +23 -23
- package/dist/modules/instant-purchase/src/actions/checkout-lifecycle.d.ts +11 -0
- package/dist/modules/instant-purchase/src/actions/index.d.ts +1 -0
- package/dist/modules/instant-purchase/src/components/checkout-state-button-trigger/checkout-state-button-trigger.d.ts +66 -0
- package/dist/modules/instant-purchase/src/sagas/checkout-lifecycle/index.d.ts +1 -0
- package/dist/modules/instant-purchase/src/sagas/checkout-lifecycle/sagas.d.ts +3 -0
- package/node_modules/@rokt/dcui-layout-schema/dist/schema.d.ts +2 -2
- package/node_modules/@rokt/dcui-layout-schema/dist/schema.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@rokt/dcui-layout-schema/package.json +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.1/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.10/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.11/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.12/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.13/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.14/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.15/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.16/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.17/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.18/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.19/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.2/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.20/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.21/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.22/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.23/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.3/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.4/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.5/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.6/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.7/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.8/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v0.9/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.0/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.1/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.2/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.3/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.4/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.5/index.js +1 -1
- package/node_modules/@rokt/dcui-layout-schema/v1.6/index.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as o,useRef as r,createContext as s,useContext as l,useState as c,useMemo as d,useCallback as u,forwardRef as p}from"react";import{createRoot as y}from"react-dom/client";import{useDispatch as f,useSelector as m,connect as h,Provider as v}from"react-redux";import{path as g,assocPath as b,when as I,allPass as E,hasPath as S,complement as w,pathEq as C,cond as O,mergeDeepWith as T,T as x,flip as A,type as L,unary as N,identity as _,concat as R,zipWith as D,slice as k,is as P,equals as j,always as $,compose as G,propOr as F,__ as M,prop as B,memoizeWith as U,mapObjIndexed as V,where as z,not as H,isEmpty as W,forEachObjIndexed as q,pipe as J,split as K,replace as Y,reduce as Z,reduced as Q,partial as X,curry as ee,anyPass as te,toPairs as ne,keys as ie,all as ae,flatten as oe,map as re,values as se,ifElse as le,isNil as ce,over as de,lensPath as ue,zip as pe,pathOr as ye,evolve as fe,append as me,gt as he,lt as ve,either as ge,view as be,add as Ie,lte as Ee,mergeWith as Se,indexBy as we,mergeRight as Ce,lensProp as Oe,defaultTo as Te,findIndex as xe,sortBy as Ae,reject as Le,whereEq as Ne,uniqBy as _e,find as Re,has as De,omit as ke,assoc as Pe,gte as je,clone as $e,mergeDeepRight as Ge,isNotEmpty as Fe,F as Me}from"ramda";import{css as Be,cx as Ue,keyframes as Ve}from"@emotion/css";import{call as ze,actionChannel as He,take as We,put as qe,cancelled as Je,select as Ke,all as Ye,takeEvery as Ze,fork as Qe,takeLatest as Xe,spawn as et,race as tt,delay as nt}from"redux-saga/effects";import{configureStore as it,combineReducers as at}from"@reduxjs/toolkit";import ot,{buffers as rt,eventChannel as st,END as lt}from"redux-saga";import{all as ct,spawn as dt,takeEvery as ut,call as pt,put as yt,take as ft,delay as mt}from"@redux-saga/core/effects";import ht from"embla-carousel-react";import vt from"insane";import gt from"@emotion/css/create-instance";function bt(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],o=g(t,e);return o&&Array.isArray(o)&&o.length?b(t,o.map(I(E([S(n),w(S(a)),C("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function It(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Et(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function St(){return"ontouchstart"in document.documentElement}function wt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function Ct(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ot(e){return Ct(e)&&"Fulfillment"===e.action}function Tt(e){return Ct(e)&&"Url"===e.action}function xt(e){return Ct(e)&&"External"===e.action}function At(e){return(Ot(e)||Tt(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Lt(e={}){return Object.assign({light:"https://plus.unsplash.com/premium_photo-1675826774817-fe983ceb0475?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80",dark:"https://images.unsplash.com/photo-1679941734238-56628f5991f7?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80"},e)}const Nt={pluginId:"shared",pageInstanceGuid:"N/A"};var _t;!function(e){e.DCUI="DCUI",e.Partner="partner"}(_t||(_t={}));const Rt=["SignalCartItemQuantitySelected"],Dt="ERROR",kt="WARNING";class Pt extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const jt=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const $t=(e,t)=>R(e,k(e.length,t.length,t)),Gt=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?$t(t,e):t,i=t.length>e.length?$t(e,t):e;return D(Vt,i,n)}return t},Ft=e=>null==e,Mt=e=>!Ft(e),Bt=(e,t)=>Ft(t)?e:t,Ut=(e,t)=>{throw new Pt("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Vt(e,t){return O([[(e,t)=>L(e)!==L(t)&&Mt(e)&&Mt(t),Ut],[(e,t)=>Ft(e)||Ft(t),Bt],[(e,t)=>"Object"===L(e),T(Vt)],[(e,t)=>"Array"===L(e),Gt],[x,A(N(_))]])(e,t)}function zt(e,t){return Vt(e,t)}function Ht(e=0){return`breakpoint-${e}px`}function Wt(e,t){return t?`${t}-child${e}`:void 0}const qt="GLOBAL/RAISE_METRIC",Jt="GLOBAL/OFFER_ENGAGEMENT";function Kt(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ot(e.responseOption)&&"fulfillment"in e&&wt(e.fulfillment)}function Yt(e){return xt(e)}function Zt(e){return Tt(e)}function Qt(e){return function(e){return Ct(e)&&"CaptureOnly"===e.action}(e)}function Xt(e){return!!(At(e)||"responseOption"in e&&At(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const en="GLOBAL/RAISE_SIGNAL",tn="GLOBAL/OFFER_LIFECYCLE",nn="GLOBAL/SET_CUSTOM_STATE",an="GLOBAL/SEND_PARTNER",on="GLOBAL/PREPARE_SIGNAL",rn="GLOBAL/OPEN_LINK",sn="GLOBAL/SET_PARTNER_VALIDATION_STATUS",ln="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",cn="GLOBAL/LAUNCH_CHILD_LAYOUT",dn={RAISE_METRIC:qt,PREPARE_SIGNAL:on,OFFER_ENGAGEMENT:Jt,RAISE_SIGNAL:en,OFFER_LIFECYCLE:tn,SEND_PARTNER:an,SET_CUSTOM_STATE:nn,SET_DOMAIN_STATE:"GLOBAL/SET_DOMAIN_STATE",OPEN_LINK:rn,SET_PARTNER_VALIDATION_STATUS:sn,SET_GLOBAL_OFFER_DATA_CART:ln,LAUNCH_CHILD_LAYOUT:cn},un="data-open-in-app",pn="data-click-signal-context";function yn(e,t){function n(e){var n;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(n=e.target)||void 0===n?void 0:n.closest("a");if(i){const n=i.getAttribute("href"),a=i.getAttribute(pn);if(a&&t({type:en,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(un)&&(a="inApp"),t({type:rn,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function fn(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&mn(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const mn=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],o=i[i.length-1],{activeElement:r}=window.document;if(1!==i.length)return r===a&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},hn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function vn(e,t){return t?"false"!==hn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${Ht(e)} ${t.trim()}`:`#app-container.${Ht(e)} & {${t}}`:"";var n}const gn={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function bn(e){return function(e){return Object.keys(gn).indexOf(e)>-1}(e)?gn[e]:""}const In={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function En(e,t){if(!In[e]||!In[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return In[e][t]}function Sn(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function wn(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function Cn(e,t){return`${e}:${t};`}function On(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Tn extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function xn(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new Tn(n,JSON.stringify(t));return!0}function An(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Ln(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function Nn(e){if(null==e||""===e)return"value must not be omitted"}function _n(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Rn(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Dn(e){if(null!=e&&""!==e)return"value must not be specified"}function kn(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function Pn(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||An(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function jn(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function $n(e){if("string"!=typeof e)return"value must be a string"}const Gn=P(Object);function Fn(e){const t=Object.entries(e);return n=>Gn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Mn(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Bn(e,t,n){return xn(An,n)?Cn(En(e,t),`${n}`):""}function Un(e){return(t,n,i)=>xn(Ln(Object.keys(e)),i)?Cn(En(t,n),`${e[i]}`):""}function Vn(e){return xn(Nn,e)?Sn({light:t(Rn,!1),dark:t(jn(Dn,Rn),!0)},wn("\n "))(e):"";function t(e,t){return n=>{if(xn(e,n)&&n){const e=Cn("background-image",`url("${n}")`);return t?On(e):e}return""}}}function zn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),xn(jn(Dn,Ln(Object.keys(t))),e)&&e?Cn("background-size",t[e]):""}const Hn=O([[j("top-left"),$("top left")],[j("top-right"),$("top right")],[j("bottom-left"),$("bottom left")],[j("bottom-right"),$("bottom right")],[x,_]]);function Wn(e){const t="string"==typeof e?e.toLowerCase():e;return xn(jn(Dn,Ln(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Cn("background-position",Hn(t)):""}function qn(e,t,n){return xn(jn(An,Pn(2,3,4)),n)?Cn(En(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Jn(e){return(t,n,i)=>xn(kn({fit:Ln(e),percentage:An,fixed:An}),i)?Cn(En(t,n),function(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}(i)):""}const Kn=Fn({light:_n,dark:jn(Dn,_n)});function Yn(e,t,n){return i=>{if(i){const a=Cn(En(e,t),Qn(String(i)));return n?On(a):a}return""}}function Zn(e,t,n){return xn(Kn,n)?Sn({light:Yn(e,t,!1),dark:Yn(e,t,!0)},wn("\n "))(n):""}function Qn(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const Xn=Fn({offsetX:jn(Dn,An),offsetY:jn(Dn,An),blurRadius:jn(Dn,An),spreadRadius:jn(Dn,An),color:Kn}),ei=e=>t=>null!=t?String(t):e,ti=G(R(M,"px"),ei("0")),ni=e=>t=>"string"==typeof t?e(t):t,ii=G(ni(R(M,"px")),ei(void 0)),ai=G(ni(Qn),B("dark"));function oi(e,t,n){return Cn(e,Sn({offsetX:ti,offsetY:ti,blurRadius:t.spreadRadius?ti:ii,spreadRadius:ii,color:n},wn(" "))(t))}const ri={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},si={container:{justifyContent:Un(ri),alignItems:Un(ri),shadow:function(e,t,n){var i;if(xn(Xn,n)){const a=En(e,t);return wn("\n")(oi(a,n,G(Qn,F("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?On(oi(a,n,ai)):"")}return""},gap:qn,overflow:Un({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return xn(Mn,n)?Cn(En(e,t),`blur(${n.toString()}px)`):""},opacity:Bn},text:{textColor:Zn,fontSize:qn,fontFamily:function(e,t,n){return xn($n,n)?Cn(En(e,t),(i=`${n}`,i.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var i},fontWeight:Un({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Un({normal:"normal",italic:"italic"}),lineHeight:qn,lineLimit:function(e,t,n){return xn(An,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:qn,baselineTextAlign:Un({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Un({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Un({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Un({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:Zn,backgroundImage:function(e,t,n){return xn(Nn,n)?Sn({url:Vn,position:Wn,scale:zn},wn)(n):""}},dimension:{width:Jn(["wrap-content","fit-width"]),maxWidth:qn,minWidth:qn,height:Jn(["wrap-content","fit-height"]),maxHeight:qn,minHeight:qn,rotateZ:(li="Z",(e,t,n)=>{const i=`rotate${li}`;return xn(An,n)?Cn(En(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Un(ri),weight:Bn,order:Bn},spacing:{margin:qn,padding:qn,offset:function(e,t,n){return xn(Pn(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:Zn,borderRadius:qn,borderWidth:qn,borderStyle:Un({solid:"solid",dashed:"dashed"})}};var li;function ci(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!si[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=si[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const di="FAILED_TEMPLATING_DATA",ui=new Map;function pi(e){return String.fromCharCode(97+e)}function yi(e,t,n){const i=`${e||Nt.pluginId}-${void 0!==t?String(t):"outer"}`,a=ui.get(i);if(a&&a.sheet.container.isConnected)return a.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${pi(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return ui.set(i,o),o.css}const fi="%%%OWN_CLASS_REF%%%",mi=U(((e,t,n,i)=>`${String(e)}-${t}-${n}`),hi);function hi(e,t,n,i){const a=yi(t,n,i);let o=1;return function t(n,i=!1){var r;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(r=s.elements)&&void 0!==r?r:{});try{const t=c.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:vi(a,l,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(fi,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function vi(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const o=a?ci(a):"";switch(!0){case"default"===i:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${bn(i)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${fi}${bn(i)} & {\n${o}\n}\n`;default:return`\n &${bn(i)} {\n${o}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${vn(i,t)}\n`):e}),"")}const gi=s($(void 0)),bi=()=>l(gi),Ii=s(null);function Ei(e,t){var n;const i=l(Ii);return i&&null!==(n=t(i))&&void 0!==n?n:e}const Si=s((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),wi=Si.Consumer,Ci=()=>l(Si),Oi=e=>a.createElement(Si.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),Ti=s(null),xi=()=>l(Ti),Ai=s({get(){throw Error("Offer context has not been set")}}),Li=e=>a.createElement(Ai.Provider,{value:{get:()=>e.context}},e.children),Ni=()=>l(Ai).get(),_i=()=>{try{return l(Ai).get().creative.copy}catch(e){return}},Ri=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Di=G(H,W),ki=z({url:Di,title:Di});function Pi(e,t,n){return t.reduce(((t,n)=>{const[i,a]=n.slice(0,-1).split("["),o=a?a.split(","):[];if(!i)throw new Error($i(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){ji(t,e,"openLinks",1,2);const i=Gi(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Fi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Ri,((e,t)=>`<a ${un} ${a?`${pn}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){ji(t,e,"sliceText",2,2);const i=Gi(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=Gi(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===i)return function(e,t){const n=new RegExp("(?<=<a.*>).*(?=</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,t))):e.slice(0,t)}(n,a);throw Error($i(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error($i(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,o,t)}),n)}function ji(e,t,n,i,a){const o=new Error($i(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} arguments; received ${e.length}.`));if(e.length<i||e.length>a)throw o}function $i(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Gi(e,t,n,i,a){const o=Fi(e,n,i);if(null!==o)return o;throw Error($i(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Fi(e,t,n){return n(e[t])}const Mi="DATA",Bi="STATE",Ui=new RegExp(`^(${Mi}|${Bi})`),Vi=new RegExp(`^${Bi}`),zi=new RegExp(`%\\^(?:${Mi}|${Bi})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Hi=Symbol("invalid");function Wi(e,t="creativeCopy"){const n=qi({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:qi(t,n,this.dataMap)});let i=!1;const a=t,o=J(k(2,-2),K("|"),(e=>{const t=Z(((e,t)=>{let n;if(Ui.test(t)){if(!this.dataMap.has(t)&&Vi.test(t))throw new Pt(di,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=K(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===Hi)throw new Pt(di,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(i.length>1&&n)try{n=Pi(i[0],i.slice(1),n)}catch(e){throw new Pt(di,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return n?Q({provided:!0,value:n}):e}return Q({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),r=Y(zi,o,a);return!1===i?r:""}.bind({dataMap:n})}function qi(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Mi}${t?"."+t:""}`),"state"in e&&a(e.state,`${Bi}${t?"."+t:""}`),i;function a(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,Hi),e&&"object"==typeof e&&q(((e,n)=>a(e,`${t}.${n}`)),e)}}const Ji=s(Wi({})),Ki=Ji.Consumer,Yi=Ji.Provider,Zi=()=>l(Ji),Qi=s(null),Xi=Qi.Provider,ea=s("OUTER"),ta=()=>"VARIANT"===l(ea),na=s(void 0),ia=()=>l(na);var aa,oa,ra,sa,la,ca,da=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))},ua=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},pa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class ya{constructor(e,t,n,i,a){aa.set(this,void 0),oa.set(this,void 0),ra.set(this,new Set),sa.set(this,void 0),la.set(this,void 0),ca.set(this,void 0),ua(this,aa,X(e.subscribe.bind(e),[n]),"f"),ua(this,oa,X(e.dispatch.bind(e),[n]),"f"),ua(this,sa,t,"f"),ua(this,la,i,"f"),ua(this,ca,a,"f"),this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=pa(this,aa,"f").call(this,e),n=()=>{t(),pa(this,ra,"f").delete(n)};return pa(this,ra,"f").add(n),n}onInteractivityChange(e){return pa(this,la,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=pa(this,ca,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),pa(this,ra,"f").delete(n)};return pa(this,ra,"f").add(n),n}globalDispatch(e){pa(this,oa,"f").call(this,e)}dispose(){pa(this,ra,"f").forEach((e=>e())),ua(this,ra,new Set,"f"),pa(this,la,"f").clear()}createChildPlugin(e){return pa(this,sa,"f").call(this,e)}}aa=new WeakMap,oa=new WeakMap,ra=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap;class fa{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>da(this,void 0,void 0,(function*(){})),onClose:()=>da(this,void 0,void 0,(function*(){})),putConfig:()=>da(this,void 0,void 0,(function*(){})),send:()=>da(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var ma,ha,va=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},ga=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class ba{constructor(e){ma.set(this,void 0),ha.set(this,new Set),va(this,ma,e,"f")}subscribe(e){return ga(this,ha,"f").add(e),!0===e(ga(this,ma,"f"))&&ga(this,ha,"f").delete(e),()=>{ga(this,ha,"f").delete(e)}}publish(e){va(this,ma,e,"f"),ga(this,ha,"f").forEach((e=>{!0===e(ga(this,ma,"f"))&&ga(this,ha,"f").delete(e)}))}clear(){ga(this,ha,"f").clear()}}ma=new WeakMap,ha=new WeakMap;var Ia=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Ea=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const Sa="breakpoint-0px";class wa{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,i,a,o,r,s,l,c;const d=this.appFactory,u=this.logger,p=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new fa;return c=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0),o.set(this,!1),r.set(this,null),s.set(this,null);const e=this.attachShadow({mode:"open"});Ea(this,a,document.createElement("div"),"f"),Ia(this,a,"f").id="app-container",Ia(this,a,"f").classList.add("default"),e.appendChild(Ia(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":Ia(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Ia(this,i,"f").call(this,o);break;case"active-breakpoint":Ia(this,t,"m",l).call(this,o,a)}}makeInteractivityUpdateHandler(e){Ea(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,t,i){const a="true"===this.getAttribute("visible"),o=this.getAttribute("slotInstanceGuid");Ea(this,n,(a=>{a&&(Ea(this,n,(()=>null),"f"),0===e&&i.globalDispatch({type:tn,payload:{event:"Interactive"}}),t&&(i.globalDispatch({type:en,payload:{name:"SignalImpression",parentGuid:t}}),this.trackViewability(t,i)),o&&i.globalDispatch({type:en,payload:{name:"SignalImpression",parentGuid:o}}))}),"f"),Ia(this,n,"f").call(this,a)}trackViewability(e,t){Ia(this,o,"f")||("IntersectionObserver"in window&&!Ia(this,r,"f")?(Ea(this,r,new IntersectionObserver((n=>{n.forEach((n=>{n.isIntersecting&&n.intersectionRatio>=.5?Ia(this,s,"f")||Ea(this,s,window.setTimeout((()=>{t.globalDispatch({type:en,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!0}}}),Ea(this,o,!0,"f"),Ia(this,r,"f")&&(Ia(this,r,"f").disconnect(),Ea(this,r,null,"f"))}),1e3),"f"):Ia(this,s,"f")&&(clearTimeout(Ia(this,s,"f")),Ea(this,s,null,"f"))}))}),{threshold:.5}),"f"),Ia(this,r,"f").observe(Ia(this,a,"f"))):(t.globalDispatch({type:en,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!1}}}),Ea(this,o,!0,"f")))}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&y(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){y(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Ia(this,r,"f")&&(Ia(this,r,"f").disconnect(),Ea(this,r,null,"f")),Ia(this,s,"f")&&(clearTimeout(Ia(this,s,"f")),Ea(this,s,null,"f"))}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");Ia(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),f=new ba("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),m=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"";d||y("Cannot create app without factory. Please build the connector withAppFactory.");const h=p({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},f);this.makeInteractivityUpdateHandler(f),d({rootElement:Ia(this,a,"f"),gateway:h,logger:u,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:m,pluginId:o||Nt.pluginId}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,h)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,t=new WeakSet,l=function(e,t){Ia(this,a,"f").classList.remove(t||Sa),Ia(this,a,"f").classList.add(e||Sa)},c;function y(e){throw u({level:Dt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Ca=s({get:()=>new fa}),Oa=e=>a.createElement(Ca.Provider,{value:{get:()=>e.context}},e.children);const Ta=s({get(){throw Error("Layout Schema context has not been set")}}),xa=e=>a.createElement(Ta.Provider,{value:{get:()=>e.context}},e.children),Aa=()=>l(Ta).get(),La=s("ENABLED"),Na=()=>l(La);function _a(e){const t=Da(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Da(t,this.dataMap)});if(!n)throw new Pt("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const Ra={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Da(e,t=Ra){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const ka=s(_a({}));ka.Consumer;const Pa=ka.Provider,ja=()=>l(ka),$a=s({});function Ga({info:e,children:t}){const n=l($a);return a.createElement($a.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const Fa=s({get(){throw Error("Catalog Item context has not been set")}}),Ma=e=>a.createElement(Fa.Provider,{value:{get:()=>e.context}},e.children),Ba=()=>l(Fa).get(),Ua=s(""),Va=()=>l(Ua),za=s(""),Ha=G(te([W,ae(W)]),oe,re(se),re(le(ce,$({}),_)),se,F({},"value")),Wa=G(W,B("predicates"));function qa(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Ja=ee(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(ci(i)),transitionBaseClassname:e(qa(t,(a=i,ne(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ie(n).map((e=>En(t,e))):[]})))))};var a})),Ka=te([Ha,Wa]);const Ya={is:j,"is-not":G(H,j),"is-below":ve,"is-above":he};function Za(e,t){return e.includes(t)}const Qa={is:j,"is-not":G(H,j),exists:Za,"not-exists":G(H,Za)},Xa={exists:G(H,ge(ce,W)),"not-exists":ge(ce,W)},eo={"is-true":j(!0),"is-false":j(!1)},to={is:j,"is-not":G(H,j)};function no(e){return(t,n)=>n[e]}const io=O([[(e,t)=>j("Breakpoint",e),no("activeBreakpoint")],[(e,t)=>j("Progression",e),no("progressionIndex")],[(e,t)=>j("Position",e),no("positionIndex")]]);function ao(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const oo=O([[j("Breakpoint"),(e,t,n)=>{const i=ue(["breakpoints",t]);return J(de(i,Number),be(i))(n)}],[j("Progression"),(e,t,n)=>O([[he(0),Ie(n.totalGroups)],[Ee(0),_]])(Number(t))],[j("Position"),(e,t,n)=>O([[he(0),Ie(n.totalOffers)],[Ee(0),_]])(Number(t))]]),ro=G(H,isNaN);function so(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,to[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Xa[e.predicate.condition])(ao(t,e.predicate.value));case"StaticBoolean":return(0,eo[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Ya[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Ya[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Qa[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Ya[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,Ya[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Ya[e.predicate.condition],i=null!==(a=io(e.type,t))&&void 0!==a?a:NaN,o=oo(e.type,e.predicate.value,t);return!!ro(i)&&n(i,o)}}}))}function lo(e){return ye(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const co={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function uo(e,t,n,i){const a=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:o,uncached:r}=a.reduce(((t,i)=>function(e,t,n,i){const a=function(e,t){switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${ao(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${io(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return fe(po(o)?{cached:me(o)}:{uncached:me({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=so(r.map((({predicate:e})=>e)),n);return pe(r,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(s)}const po=P(Boolean);const yo=ee(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:lo(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a:0,totalOffers:null!==(r=null===(o=n.progression)||void 0===o?void 0:o.totalOffers)&&void 0!==r?r:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,positionIndex:e,creativeCopy:t}})),fo=ue(["predicate","content","input"]),mo=ue(["predicate","content","value"]);function ho(e,t){const n=de(fo,(t=>t?e(t):"")),i=de(mo,(t=>"string"==typeof t?e(t):t)),a=G(n,i);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?a(e):n(e):e))}const vo=ae(j(!0));function go(e){const t=ta(),n=ia(),i=r(new Map),a=_i(),o=Ei(co,yo(n,a)),s=Zi();return d((()=>V((e=>{const n=ho(s,e);return vo(uo(i,n,o,t))}),e)),[i,e,o,t,s])}function bo(e){e&&(e.style.display="")}function Io(e){e&&(e.style.display="none")}function Eo(e){return e.settings.duration}const So=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],wo=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function Co(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?So:wo,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?bo(e):Io(e)},a.oncancel=()=>{t?bo(e):Io(e)},()=>{a.finish()}}return t?bo(e):Io(e),()=>{}}function Oo({inTransitions:e,outTransitions:t,visible:n,children:i,containerClassName:s}){const l=r(null);return o((()=>n&&e?e.forEach((e=>{l.current&&function(e,t,n,i){if("FadeIn"===i)Co(e,t,n)}(l.current,n,Eo(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)Co(e,t,n)}(l.current,n,Eo(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function To(e){const t=Ci(),n=function(e){const t=ta(),n=ia(),i=r(new Map),a=_i(),o=Ei(co,yo(n,a)),s=ho(Zi(),e);return d((()=>vo(uo(i,s,o,t))),[i,s,o,t])}(e.schema.predicates),i=a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0))));return e.schema.transition?a.createElement(Oo,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},i):"functionally"===e.schema.hide?a.createElement(La.Provider,{value:n?"ENABLED":"DISABLED"},i):n?a.createElement(a.Fragment,null,i):null}const xo=Se(((e,t)=>`${e||""} ${t||""}`.trim())),Ao=e=>{var t;const n=l(Qi),i=ia(),a=xi()||document.head,o=Va(),r=yi(o,i,a),s=u(mi,[]),c=Ei([],(e=>Object.values(e.breakpoint.breakpoints))),d=n||s(c,o,i,a),p=e.styles?d(e.styles):{},y=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Ja(e);return V((e=>Ka(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(r,null===(t=e.styles)||void 0===t?void 0:t.conditionalTransitions):void 0,f=go(y?V(F([],"predicates"),y):{}),m=V(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(y,t):void 0),f),h=y?V(B("transitionBaseClassname"),y):{},v=e.styles?(g=h,xo(xo(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function Lo(e){const t=Ci();return a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function No(e){const t=Ci();return a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const _o={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",un,pn],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Ro=new Map([["&","_;^;_"]]),Do=new RegExp(`<a *(?=${_o.allowedAttributes.a.join("|")}|>)`,"g"),ko=new RegExp('<a [^>]*href="([^"]+)"',"g"),Po=new RegExp("(<br *?>)|(<br *?/>)","g"),jo="<br/>";function $o(e){const t=Zi(),n=Na(),i=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(ko,((e,t)=>{const n=t.replaceAll("&",Ro.get("&"));return e.replace(t,n)})).replaceAll(Po,jo)}(e);return t===vt(t,_o)}(n))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return n.trim()?n:""}),[e.schema.value,t]),{tabIndex:o,styles:r,isDisabled:s}=It(n);return i?a.createElement(Ao,{styles:e.schema.styles},(({classnames:t})=>{const n=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=i,new RegExp("</(p|ul|ol)>").test(l)?a.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Do,`<a ${n.join(" ")}`)}}):a.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Do,`<a ${n.join(" ")}`)}});var l})):null}function Go(e){const t=Zi()(e.schema.value),n=Na(),{tabIndex:i,styles:o,isDisabled:r}=It(n);return t?a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{const s={tabIndex:i,"aria-hidden":r,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?a.createElement("span",Object.assign({style:o},s),t):a.createElement("p",Object.assign({style:o},s),t)})):null}function Fo(e,t,n){if("BasicText"===e.type)return a.createElement(Go,{schema:e.node,testId:t,isInline:null!=n&&n})}function Mo(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Wt(i,n)))))}function Bo(e){const t=bi(),n=Ci(),i=Ni(),r=Zi(),s=ia(),l=Na(),c=i.creative.responseOptionsMap[e.schema.responseKey],d=xt(c);o((()=>{d&&t(function(e){if(e.externalKey)return{type:on,payload:{criteria:{key:e.externalKey},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:e.externalKey}}}};throw new Error(`Invalid External Response: No 'externalKey' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,t,d]);const u=c?r({data:c},"creativeResponse"):r,{tabIndex:p,styles:y,isDisabled:f}=It(l);return Ct(c)&&!d&&void 0!==s?a.createElement(Ao,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return a.createElement("button",{type:"button",tabIndex:p,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},y),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const n=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(wt(n))return{fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId};throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,c);t({type:Jt,payload:n})},className:null==o?void 0:o.own,disabled:f},a.createElement(Yi,{value:u},(null==o?void 0:o.own)?function(e,t,n,i,o){return a.createElement(Xi,{value:n(t)},Mo(e,i,o))}(e.schema.children,o.own,r,n,e.testId):Mo(e.schema.children,n,e.testId)))})):null}function Uo(e){const t=Na(),{styles:n,isDisabled:i}=It(t);return e.schema.url.light?a.createElement(Ao,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function Vo(e){const t=Na(),{styles:n,isDisabled:i}=It(t),o=(e=>{const t=l(ka),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}})(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?a.createElement(Ao,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:o.alt,title:o.title,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const zo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ho(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?zt(zo,e.schema.styles):zo,o=Na(),{styles:r,isDisabled:s}=It(o);return t?a.createElement(Ao,{styles:i},(({classnames:i})=>a.createElement("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==i?void 0:i.own)?" "+i.own:""),"data-testid":e.testId,"data-e2e":`StaticIcon-${t}`},!s&&n?{title:n}:{"aria-hidden":"true"}),t))):null}const Wo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class qo extends a.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===hn.REPORT_RENDER_ERRORS&&this.props.reporter({level:Dt,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===hn.DISPLAY_ERRORS?a.createElement("pre",{style:Wo},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}qo.contextType=$a;const Jo={internally:"_top",externally:"_blank"};function Ko(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Yo(e){var t;const n=Jo[e.schema.open],i=Ci(),o=Na(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(Ao,{styles:e.schema.styles},(({classnames:t,mapperRef:o})=>{var c;return a.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=n?n:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=e.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:e.isInline?"inline":"block"},s),className:null==t?void 0:t.own},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(Xi,{value:n(t)},Ko(e,i,o))}(e.schema.children,null==t?void 0:t.own,o,i,e.testId):Ko(e.schema.children,i,e.testId))})):null}function Zo(e,t,n){if("StaticLink"===e.type)return a.createElement(Yo,{schema:e.node,testId:t,isInline:null!=n&&n})}const Qo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Xo(e){const t=(n=e.schema.iconKey,l(ka)(n,"icons"));var n;const i=null==t?void 0:t.name,o=e.schema.styles?zt(Qo,e.schema.styles):Qo,r=Na(),{styles:s}=It(r);return i?a.createElement(Ao,{styles:o},(({classnames:t})=>a.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const er=Be`
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as o,useRef as r,createContext as s,useContext as l,useState as c,useMemo as d,useCallback as u,forwardRef as p}from"react";import{createRoot as y}from"react-dom/client";import{useDispatch as f,useSelector as m,connect as h,Provider as v}from"react-redux";import{path as g,assocPath as b,when as I,allPass as E,hasPath as S,complement as w,pathEq as C,cond as O,mergeDeepWith as T,T as x,flip as A,type as L,unary as N,identity as _,concat as R,zipWith as D,slice as k,is as P,equals as j,always as $,compose as G,propOr as F,__ as M,prop as B,memoizeWith as U,mapObjIndexed as V,where as z,not as H,isEmpty as W,forEachObjIndexed as q,pipe as J,split as K,replace as Y,reduce as Z,reduced as Q,partial as X,curry as ee,anyPass as te,toPairs as ne,keys as ie,all as ae,flatten as oe,map as re,values as se,ifElse as le,isNil as ce,over as de,lensPath as ue,zip as pe,pathOr as ye,evolve as fe,append as me,gt as he,lt as ve,either as ge,view as be,add as Ie,lte as Ee,mergeWith as Se,indexBy as we,mergeRight as Ce,lensProp as Oe,defaultTo as Te,findIndex as xe,sortBy as Ae,reject as Le,whereEq as Ne,uniqBy as _e,find as Re,has as De,omit as ke,assoc as Pe,gte as je,clone as $e,mergeDeepRight as Ge,isNotEmpty as Fe,F as Me}from"ramda";import{css as Be,cx as Ue,keyframes as Ve}from"@emotion/css";import{call as ze,actionChannel as He,take as We,put as qe,cancelled as Je,select as Ke,all as Ye,takeEvery as Ze,fork as Qe,takeLatest as Xe,spawn as et,race as tt,delay as nt}from"redux-saga/effects";import{configureStore as it,combineReducers as at}from"@reduxjs/toolkit";import ot,{buffers as rt,eventChannel as st,END as lt}from"redux-saga";import{all as ct,spawn as dt,takeEvery as ut,call as pt,put as yt,take as ft,delay as mt}from"@redux-saga/core/effects";import ht from"embla-carousel-react";import vt from"insane";import gt from"@emotion/css/create-instance";function bt(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],o=g(t,e);return o&&Array.isArray(o)&&o.length?b(t,o.map(I(E([S(n),w(S(a)),C("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function It(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Et(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function St(){return"ontouchstart"in document.documentElement}function wt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function Ct(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ot(e){return Ct(e)&&"Fulfillment"===e.action}function Tt(e){return Ct(e)&&"Url"===e.action}function xt(e){return Ct(e)&&"External"===e.action}function At(e){return(Ot(e)||Tt(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Lt(e={}){return Object.assign({light:"https://plus.unsplash.com/premium_photo-1675826774817-fe983ceb0475?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80",dark:"https://images.unsplash.com/photo-1679941734238-56628f5991f7?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80"},e)}const Nt={pluginId:"shared",pageInstanceGuid:"N/A"};var _t;!function(e){e.DCUI="DCUI",e.Partner="partner"}(_t||(_t={}));const Rt=["SignalCartItemQuantitySelected"],Dt="ERROR",kt="WARNING";class Pt extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const jt=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const $t=(e,t)=>R(e,k(e.length,t.length,t)),Gt=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?$t(t,e):t,i=t.length>e.length?$t(e,t):e;return D(Vt,i,n)}return t},Ft=e=>null==e,Mt=e=>!Ft(e),Bt=(e,t)=>Ft(t)?e:t,Ut=(e,t)=>{throw new Pt("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Vt(e,t){return O([[(e,t)=>L(e)!==L(t)&&Mt(e)&&Mt(t),Ut],[(e,t)=>Ft(e)||Ft(t),Bt],[(e,t)=>"Object"===L(e),T(Vt)],[(e,t)=>"Array"===L(e),Gt],[x,A(N(_))]])(e,t)}function zt(e,t){return Vt(e,t)}function Ht(e=0){return`breakpoint-${e}px`}function Wt(e,t){return t?`${t}-child${e}`:void 0}const qt="GLOBAL/RAISE_METRIC",Jt="GLOBAL/OFFER_ENGAGEMENT";function Kt(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ot(e.responseOption)&&"fulfillment"in e&&wt(e.fulfillment)}function Yt(e){return xt(e)}function Zt(e){return Tt(e)}function Qt(e){return function(e){return Ct(e)&&"CaptureOnly"===e.action}(e)}function Xt(e){return!!(At(e)||"responseOption"in e&&At(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const en="GLOBAL/RAISE_SIGNAL",tn="GLOBAL/OFFER_LIFECYCLE",nn="GLOBAL/SET_CUSTOM_STATE",an="GLOBAL/SEND_PARTNER",on="GLOBAL/SET_DOMAIN_STATE",rn="GLOBAL/PREPARE_SIGNAL",sn="GLOBAL/OPEN_LINK",ln="GLOBAL/SET_PARTNER_VALIDATION_STATUS",cn="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",dn="GLOBAL/LAUNCH_CHILD_LAYOUT",un={RAISE_METRIC:qt,PREPARE_SIGNAL:rn,OFFER_ENGAGEMENT:Jt,RAISE_SIGNAL:en,OFFER_LIFECYCLE:tn,SEND_PARTNER:an,SET_CUSTOM_STATE:nn,SET_DOMAIN_STATE:on,OPEN_LINK:sn,SET_PARTNER_VALIDATION_STATUS:ln,SET_GLOBAL_OFFER_DATA_CART:cn,LAUNCH_CHILD_LAYOUT:dn},pn="data-open-in-app",yn="data-click-signal-context";function fn(e,t){function n(e){var n;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(n=e.target)||void 0===n?void 0:n.closest("a");if(i){const n=i.getAttribute("href"),a=i.getAttribute(yn);if(a&&t({type:en,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(pn)&&(a="inApp"),t({type:sn,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function mn(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&hn(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const hn=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],o=i[i.length-1],{activeElement:r}=window.document;if(1!==i.length)return r===a&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},vn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function gn(e,t){return t?"false"!==vn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${Ht(e)} ${t.trim()}`:`#app-container.${Ht(e)} & {${t}}`:"";var n}const bn={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function In(e){return function(e){return Object.keys(bn).indexOf(e)>-1}(e)?bn[e]:""}const En={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function Sn(e,t){if(!En[e]||!En[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return En[e][t]}function wn(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Cn(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function On(e,t){return`${e}:${t};`}function Tn(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class xn extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function An(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new xn(n,JSON.stringify(t));return!0}function Ln(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Nn(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function _n(e){if(null==e||""===e)return"value must not be omitted"}function Rn(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Dn(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function kn(e){if(null!=e&&""!==e)return"value must not be specified"}function Pn(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function jn(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||Ln(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function $n(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function Gn(e){if("string"!=typeof e)return"value must be a string"}const Fn=P(Object);function Mn(e){const t=Object.entries(e);return n=>Fn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Bn(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Un(e,t,n){return An(Ln,n)?On(Sn(e,t),`${n}`):""}function Vn(e){return(t,n,i)=>An(Nn(Object.keys(e)),i)?On(Sn(t,n),`${e[i]}`):""}function zn(e){return An(_n,e)?wn({light:t(Dn,!1),dark:t($n(kn,Dn),!0)},Cn("\n "))(e):"";function t(e,t){return n=>{if(An(e,n)&&n){const e=On("background-image",`url("${n}")`);return t?Tn(e):e}return""}}}function Hn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),An($n(kn,Nn(Object.keys(t))),e)&&e?On("background-size",t[e]):""}const Wn=O([[j("top-left"),$("top left")],[j("top-right"),$("top right")],[j("bottom-left"),$("bottom left")],[j("bottom-right"),$("bottom right")],[x,_]]);function qn(e){const t="string"==typeof e?e.toLowerCase():e;return An($n(kn,Nn(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?On("background-position",Wn(t)):""}function Jn(e,t,n){return An($n(Ln,jn(2,3,4)),n)?On(Sn(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Kn(e){return(t,n,i)=>An(Pn({fit:Nn(e),percentage:Ln,fixed:Ln}),i)?On(Sn(t,n),function(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}(i)):""}const Yn=Mn({light:Rn,dark:$n(kn,Rn)});function Zn(e,t,n){return i=>{if(i){const a=On(Sn(e,t),Xn(String(i)));return n?Tn(a):a}return""}}function Qn(e,t,n){return An(Yn,n)?wn({light:Zn(e,t,!1),dark:Zn(e,t,!0)},Cn("\n "))(n):""}function Xn(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const ei=Mn({offsetX:$n(kn,Ln),offsetY:$n(kn,Ln),blurRadius:$n(kn,Ln),spreadRadius:$n(kn,Ln),color:Yn}),ti=e=>t=>null!=t?String(t):e,ni=G(R(M,"px"),ti("0")),ii=e=>t=>"string"==typeof t?e(t):t,ai=G(ii(R(M,"px")),ti(void 0)),oi=G(ii(Xn),B("dark"));function ri(e,t,n){return On(e,wn({offsetX:ni,offsetY:ni,blurRadius:t.spreadRadius?ni:ai,spreadRadius:ai,color:n},Cn(" "))(t))}const si={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},li={container:{justifyContent:Vn(si),alignItems:Vn(si),shadow:function(e,t,n){var i;if(An(ei,n)){const a=Sn(e,t);return Cn("\n")(ri(a,n,G(Xn,F("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?Tn(ri(a,n,oi)):"")}return""},gap:Jn,overflow:Vn({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return An(Bn,n)?On(Sn(e,t),`blur(${n.toString()}px)`):""},opacity:Un},text:{textColor:Qn,fontSize:Jn,fontFamily:function(e,t,n){return An(Gn,n)?On(Sn(e,t),(i=`${n}`,i.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var i},fontWeight:Vn({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Vn({normal:"normal",italic:"italic"}),lineHeight:Jn,lineLimit:function(e,t,n){return An(Ln,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:Jn,baselineTextAlign:Vn({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Vn({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Vn({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Vn({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:Qn,backgroundImage:function(e,t,n){return An(_n,n)?wn({url:zn,position:qn,scale:Hn},Cn)(n):""}},dimension:{width:Kn(["wrap-content","fit-width"]),maxWidth:Jn,minWidth:Jn,height:Kn(["wrap-content","fit-height"]),maxHeight:Jn,minHeight:Jn,rotateZ:(ci="Z",(e,t,n)=>{const i=`rotate${ci}`;return An(Ln,n)?On(Sn(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Vn(si),weight:Un,order:Un},spacing:{margin:Jn,padding:Jn,offset:function(e,t,n){return An(jn(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:Qn,borderRadius:Jn,borderWidth:Jn,borderStyle:Vn({solid:"solid",dashed:"dashed"})}};var ci;function di(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!li[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=li[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const ui="FAILED_TEMPLATING_DATA",pi=new Map;function yi(e){return String.fromCharCode(97+e)}function fi(e,t,n){const i=`${e||Nt.pluginId}-${void 0!==t?String(t):"outer"}`,a=pi.get(i);if(a&&a.sheet.container.isConnected)return a.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${yi(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return pi.set(i,o),o.css}const mi="%%%OWN_CLASS_REF%%%",hi=U(((e,t,n,i)=>`${String(e)}-${t}-${n}`),vi);function vi(e,t,n,i){const a=fi(t,n,i);let o=1;return function t(n,i=!1){var r;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(r=s.elements)&&void 0!==r?r:{});try{const t=c.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:gi(a,l,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(mi,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function gi(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const o=a?di(a):"";switch(!0){case"default"===i:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${In(i)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${mi}${In(i)} & {\n${o}\n}\n`;default:return`\n &${In(i)} {\n${o}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${gn(i,t)}\n`):e}),"")}const bi=s($(void 0)),Ii=()=>l(bi),Ei=s(null);function Si(e,t){var n;const i=l(Ei);return i&&null!==(n=t(i))&&void 0!==n?n:e}const wi=s((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),Ci=wi.Consumer,Oi=()=>l(wi),Ti=e=>a.createElement(wi.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),xi=s(null),Ai=()=>l(xi),Li=s({get(){throw Error("Offer context has not been set")}}),Ni=e=>a.createElement(Li.Provider,{value:{get:()=>e.context}},e.children),_i=()=>l(Li).get(),Ri=()=>{try{return l(Li).get().creative.copy}catch(e){return}},Di=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),ki=G(H,W),Pi=z({url:ki,title:ki});function ji(e,t,n){return t.reduce(((t,n)=>{const[i,a]=n.slice(0,-1).split("["),o=a?a.split(","):[];if(!i)throw new Error(Gi(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){$i(t,e,"openLinks",1,2);const i=Fi(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Mi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Di,((e,t)=>`<a ${pn} ${a?`${yn}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){$i(t,e,"sliceText",2,2);const i=Fi(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=Fi(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===i)return function(e,t){const n=new RegExp("(?<=<a.*>).*(?=</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,t))):e.slice(0,t)}(n,a);throw Error(Gi(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error(Gi(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,o,t)}),n)}function $i(e,t,n,i,a){const o=new Error(Gi(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} arguments; received ${e.length}.`));if(e.length<i||e.length>a)throw o}function Gi(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Fi(e,t,n,i,a){const o=Mi(e,n,i);if(null!==o)return o;throw Error(Gi(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Mi(e,t,n){return n(e[t])}const Bi="DATA",Ui="STATE",Vi=new RegExp(`^(${Bi}|${Ui})`),zi=new RegExp(`^${Ui}`),Hi=new RegExp(`%\\^(?:${Bi}|${Ui})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Wi=Symbol("invalid");function qi(e,t="creativeCopy"){const n=Ji({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Ji(t,n,this.dataMap)});let i=!1;const a=t,o=J(k(2,-2),K("|"),(e=>{const t=Z(((e,t)=>{let n;if(Vi.test(t)){if(!this.dataMap.has(t)&&zi.test(t))throw new Pt(ui,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=K(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===Wi)throw new Pt(ui,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(i.length>1&&n)try{n=ji(i[0],i.slice(1),n)}catch(e){throw new Pt(ui,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return n?Q({provided:!0,value:n}):e}return Q({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),r=Y(Hi,o,a);return!1===i?r:""}.bind({dataMap:n})}function Ji(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Bi}${t?"."+t:""}`),"state"in e&&a(e.state,`${Ui}${t?"."+t:""}`),i;function a(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,Wi),e&&"object"==typeof e&&q(((e,n)=>a(e,`${t}.${n}`)),e)}}const Ki=s(qi({})),Yi=Ki.Consumer,Zi=Ki.Provider,Qi=()=>l(Ki),Xi=s(null),ea=Xi.Provider,ta=s("OUTER"),na=()=>"VARIANT"===l(ta),ia=s(void 0),aa=()=>l(ia);var oa,ra,sa,la,ca,da,ua=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))},pa=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},ya=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class fa{constructor(e,t,n,i,a){oa.set(this,void 0),ra.set(this,void 0),sa.set(this,new Set),la.set(this,void 0),ca.set(this,void 0),da.set(this,void 0),pa(this,oa,X(e.subscribe.bind(e),[n]),"f"),pa(this,ra,X(e.dispatch.bind(e),[n]),"f"),pa(this,la,t,"f"),pa(this,ca,i,"f"),pa(this,da,a,"f"),this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=ya(this,oa,"f").call(this,e),n=()=>{t(),ya(this,sa,"f").delete(n)};return ya(this,sa,"f").add(n),n}onInteractivityChange(e){return ya(this,ca,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=ya(this,da,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),ya(this,sa,"f").delete(n)};return ya(this,sa,"f").add(n),n}globalDispatch(e){ya(this,ra,"f").call(this,e)}dispose(){ya(this,sa,"f").forEach((e=>e())),pa(this,sa,new Set,"f"),ya(this,ca,"f").clear()}createChildPlugin(e){return ya(this,la,"f").call(this,e)}}oa=new WeakMap,ra=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap,da=new WeakMap;class ma{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>ua(this,void 0,void 0,(function*(){})),onClose:()=>ua(this,void 0,void 0,(function*(){})),putConfig:()=>ua(this,void 0,void 0,(function*(){})),send:()=>ua(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var ha,va,ga=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},ba=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Ia{constructor(e){ha.set(this,void 0),va.set(this,new Set),ga(this,ha,e,"f")}subscribe(e){return ba(this,va,"f").add(e),!0===e(ba(this,ha,"f"))&&ba(this,va,"f").delete(e),()=>{ba(this,va,"f").delete(e)}}publish(e){ga(this,ha,e,"f"),ba(this,va,"f").forEach((e=>{!0===e(ba(this,ha,"f"))&&ba(this,va,"f").delete(e)}))}clear(){ba(this,va,"f").clear()}}ha=new WeakMap,va=new WeakMap;var Ea=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Sa=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const wa="breakpoint-0px";class Ca{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,i,a,o,r,s,l,c;const d=this.appFactory,u=this.logger,p=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new ma;return c=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.set(this,void 0),o.set(this,!1),r.set(this,null),s.set(this,null);const e=this.attachShadow({mode:"open"});Sa(this,a,document.createElement("div"),"f"),Ea(this,a,"f").id="app-container",Ea(this,a,"f").classList.add("default"),e.appendChild(Ea(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":Ea(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Ea(this,i,"f").call(this,o);break;case"active-breakpoint":Ea(this,t,"m",l).call(this,o,a)}}makeInteractivityUpdateHandler(e){Sa(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,t,i){const a="true"===this.getAttribute("visible"),o=this.getAttribute("slotInstanceGuid");Sa(this,n,(a=>{a&&(Sa(this,n,(()=>null),"f"),0===e&&i.globalDispatch({type:tn,payload:{event:"Interactive"}}),t&&(i.globalDispatch({type:en,payload:{name:"SignalImpression",parentGuid:t}}),this.trackViewability(t,i)),o&&i.globalDispatch({type:en,payload:{name:"SignalImpression",parentGuid:o}}))}),"f"),Ea(this,n,"f").call(this,a)}trackViewability(e,t){Ea(this,o,"f")||("IntersectionObserver"in window&&!Ea(this,r,"f")?(Sa(this,r,new IntersectionObserver((n=>{n.forEach((n=>{n.isIntersecting&&n.intersectionRatio>=.5?Ea(this,s,"f")||Sa(this,s,window.setTimeout((()=>{t.globalDispatch({type:en,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!0}}}),Sa(this,o,!0,"f"),Ea(this,r,"f")&&(Ea(this,r,"f").disconnect(),Sa(this,r,null,"f"))}),1e3),"f"):Ea(this,s,"f")&&(clearTimeout(Ea(this,s,"f")),Sa(this,s,null,"f"))}))}),{threshold:.5}),"f"),Ea(this,r,"f").observe(Ea(this,a,"f"))):(t.globalDispatch({type:en,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!1}}}),Sa(this,o,!0,"f")))}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&y(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){y(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Ea(this,r,"f")&&(Ea(this,r,"f").disconnect(),Sa(this,r,null,"f")),Ea(this,s,"f")&&(clearTimeout(Ea(this,s,"f")),Sa(this,s,null,"f"))}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");Ea(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),f=new Ia("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),m=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"";d||y("Cannot create app without factory. Please build the connector withAppFactory.");const h=p({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},f);this.makeInteractivityUpdateHandler(f),d({rootElement:Ea(this,a,"f"),gateway:h,logger:u,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:m,pluginId:o||Nt.pluginId}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,h)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,t=new WeakSet,l=function(e,t){Ea(this,a,"f").classList.remove(t||wa),Ea(this,a,"f").classList.add(e||wa)},c;function y(e){throw u({level:Dt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Oa=s({get:()=>new ma}),Ta=e=>a.createElement(Oa.Provider,{value:{get:()=>e.context}},e.children);const xa=s({get(){throw Error("Layout Schema context has not been set")}}),Aa=e=>a.createElement(xa.Provider,{value:{get:()=>e.context}},e.children),La=()=>l(xa).get(),Na=s("ENABLED"),_a=()=>l(Na);function Ra(e){const t=ka(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:ka(t,this.dataMap)});if(!n)throw new Pt("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const Da={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function ka(e,t=Da){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const Pa=s(Ra({}));Pa.Consumer;const ja=Pa.Provider,$a=()=>l(Pa),Ga=s({});function Fa({info:e,children:t}){const n=l(Ga);return a.createElement(Ga.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const Ma=s({get(){throw Error("Catalog Item context has not been set")}}),Ba=e=>a.createElement(Ma.Provider,{value:{get:()=>e.context}},e.children),Ua=()=>l(Ma).get(),Va=s(""),za=()=>l(Va),Ha=s(""),Wa=G(te([W,ae(W)]),oe,re(se),re(le(ce,$({}),_)),se,F({},"value")),qa=G(W,B("predicates"));function Ja(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Ka=ee(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(di(i)),transitionBaseClassname:e(Ja(t,(a=i,ne(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ie(n).map((e=>Sn(t,e))):[]})))))};var a})),Ya=te([Wa,qa]);const Za={is:j,"is-not":G(H,j),"is-below":ve,"is-above":he};function Qa(e,t){return e.includes(t)}const Xa={is:j,"is-not":G(H,j),exists:Qa,"not-exists":G(H,Qa)},eo={exists:G(H,ge(ce,W)),"not-exists":ge(ce,W)},to={"is-true":j(!0),"is-false":j(!1)},no={is:j,"is-not":G(H,j)};function io(e){return(t,n)=>n[e]}const ao=O([[(e,t)=>j("Breakpoint",e),io("activeBreakpoint")],[(e,t)=>j("Progression",e),io("progressionIndex")],[(e,t)=>j("Position",e),io("positionIndex")]]);function oo(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const ro=O([[j("Breakpoint"),(e,t,n)=>{const i=ue(["breakpoints",t]);return J(de(i,Number),be(i))(n)}],[j("Progression"),(e,t,n)=>O([[he(0),Ie(n.totalGroups)],[Ee(0),_]])(Number(t))],[j("Position"),(e,t,n)=>O([[he(0),Ie(n.totalOffers)],[Ee(0),_]])(Number(t))]]),so=G(H,isNaN);function lo(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,no[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,eo[e.predicate.condition])(oo(t,e.predicate.value));case"StaticBoolean":return(0,to[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Za[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Za[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Xa[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Za[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,Za[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Za[e.predicate.condition],i=null!==(a=ao(e.type,t))&&void 0!==a?a:NaN,o=ro(e.type,e.predicate.value,t);return!!so(i)&&n(i,o)}}}))}function co(e){return ye(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const uo={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function po(e,t,n,i){const a=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:o,uncached:r}=a.reduce(((t,i)=>function(e,t,n,i){const a=function(e,t){switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${oo(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${ao(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return fe(yo(o)?{cached:me(o)}:{uncached:me({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=lo(r.map((({predicate:e})=>e)),n);return pe(r,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(s)}const yo=P(Boolean);const fo=ee(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:co(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a:0,totalOffers:null!==(r=null===(o=n.progression)||void 0===o?void 0:o.totalOffers)&&void 0!==r?r:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,positionIndex:e,creativeCopy:t}})),mo=ue(["predicate","content","input"]),ho=ue(["predicate","content","value"]);function vo(e,t){const n=de(mo,(t=>t?e(t):"")),i=de(ho,(t=>"string"==typeof t?e(t):t)),a=G(n,i);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?a(e):n(e):e))}const go=ae(j(!0));function bo(e){const t=na(),n=aa(),i=r(new Map),a=Ri(),o=Si(uo,fo(n,a)),s=Qi();return d((()=>V((e=>{const n=vo(s,e);return go(po(i,n,o,t))}),e)),[i,e,o,t,s])}function Io(e){e&&(e.style.display="")}function Eo(e){e&&(e.style.display="none")}function So(e){return e.settings.duration}const wo=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],Co=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function Oo(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?wo:Co,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?Io(e):Eo(e)},a.oncancel=()=>{t?Io(e):Eo(e)},()=>{a.finish()}}return t?Io(e):Eo(e),()=>{}}function To({inTransitions:e,outTransitions:t,visible:n,children:i,containerClassName:s}){const l=r(null);return o((()=>n&&e?e.forEach((e=>{l.current&&function(e,t,n,i){if("FadeIn"===i)Oo(e,t,n)}(l.current,n,So(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)Oo(e,t,n)}(l.current,n,So(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function xo(e){const t=Oi(),n=function(e){const t=na(),n=aa(),i=r(new Map),a=Ri(),o=Si(uo,fo(n,a)),s=vo(Qi(),e);return d((()=>go(po(i,s,o,t))),[i,s,o,t])}(e.schema.predicates),i=a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0))));return e.schema.transition?a.createElement(To,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},i):"functionally"===e.schema.hide?a.createElement(Na.Provider,{value:n?"ENABLED":"DISABLED"},i):n?a.createElement(a.Fragment,null,i):null}const Ao=Se(((e,t)=>`${e||""} ${t||""}`.trim())),Lo=e=>{var t;const n=l(Xi),i=aa(),a=Ai()||document.head,o=za(),r=fi(o,i,a),s=u(hi,[]),c=Si([],(e=>Object.values(e.breakpoint.breakpoints))),d=n||s(c,o,i,a),p=e.styles?d(e.styles):{},y=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Ka(e);return V((e=>Ya(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(r,null===(t=e.styles)||void 0===t?void 0:t.conditionalTransitions):void 0,f=bo(y?V(F([],"predicates"),y):{}),m=V(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(y,t):void 0),f),h=y?V(B("transitionBaseClassname"),y):{},v=e.styles?(g=h,Ao(Ao(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function No(e){const t=Oi();return a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function _o(e){const t=Oi();return a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const Ro={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",pn,yn],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Do=new Map([["&","_;^;_"]]),ko=new RegExp(`<a *(?=${Ro.allowedAttributes.a.join("|")}|>)`,"g"),Po=new RegExp('<a [^>]*href="([^"]+)"',"g"),jo=new RegExp("(<br *?>)|(<br *?/>)","g"),$o="<br/>";function Go(e){const t=Qi(),n=_a(),i=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Po,((e,t)=>{const n=t.replaceAll("&",Do.get("&"));return e.replace(t,n)})).replaceAll(jo,$o)}(e);return t===vt(t,Ro)}(n))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return n.trim()?n:""}),[e.schema.value,t]),{tabIndex:o,styles:r,isDisabled:s}=It(n);return i?a.createElement(Lo,{styles:e.schema.styles},(({classnames:t})=>{const n=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=i,new RegExp("</(p|ul|ol)>").test(l)?a.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(ko,`<a ${n.join(" ")}`)}}):a.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(ko,`<a ${n.join(" ")}`)}});var l})):null}function Fo(e){const t=Qi()(e.schema.value),n=_a(),{tabIndex:i,styles:o,isDisabled:r}=It(n);return t?a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{const s={tabIndex:i,"aria-hidden":r,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?a.createElement("span",Object.assign({style:o},s),t):a.createElement("p",Object.assign({style:o},s),t)})):null}function Mo(e,t,n){if("BasicText"===e.type)return a.createElement(Fo,{schema:e.node,testId:t,isInline:null!=n&&n})}function Bo(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Wt(i,n)))))}function Uo(e){const t=Ii(),n=Oi(),i=_i(),r=Qi(),s=aa(),l=_a(),c=i.creative.responseOptionsMap[e.schema.responseKey],d=xt(c);o((()=>{d&&t(function(e){if(e.externalKey)return{type:rn,payload:{criteria:{key:e.externalKey},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:e.externalKey}}}};throw new Error(`Invalid External Response: No 'externalKey' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,t,d]);const u=c?r({data:c},"creativeResponse"):r,{tabIndex:p,styles:y,isDisabled:f}=It(l);return Ct(c)&&!d&&void 0!==s?a.createElement(Lo,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return a.createElement("button",{type:"button",tabIndex:p,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},y),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const n=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(wt(n))return{fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId};throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,c);t({type:Jt,payload:n})},className:null==o?void 0:o.own,disabled:f},a.createElement(Zi,{value:u},(null==o?void 0:o.own)?function(e,t,n,i,o){return a.createElement(ea,{value:n(t)},Bo(e,i,o))}(e.schema.children,o.own,r,n,e.testId):Bo(e.schema.children,n,e.testId)))})):null}function Vo(e){const t=_a(),{styles:n,isDisabled:i}=It(t);return e.schema.url.light?a.createElement(Lo,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function zo(e){const t=_a(),{styles:n,isDisabled:i}=It(t),o=(e=>{const t=l(Pa),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}})(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?a.createElement(Lo,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:o.alt,title:o.title,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const Ho={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Wo(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?zt(Ho,e.schema.styles):Ho,o=_a(),{styles:r,isDisabled:s}=It(o);return t?a.createElement(Lo,{styles:i},(({classnames:i})=>a.createElement("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==i?void 0:i.own)?" "+i.own:""),"data-testid":e.testId,"data-e2e":`StaticIcon-${t}`},!s&&n?{title:n}:{"aria-hidden":"true"}),t))):null}const qo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Jo extends a.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===vn.REPORT_RENDER_ERRORS&&this.props.reporter({level:Dt,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===vn.DISPLAY_ERRORS?a.createElement("pre",{style:qo},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}Jo.contextType=Ga;const Ko={internally:"_top",externally:"_blank"};function Yo(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Zo(e){var t;const n=Ko[e.schema.open],i=Oi(),o=_a(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(Lo,{styles:e.schema.styles},(({classnames:t,mapperRef:o})=>{var c;return a.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=n?n:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=e.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:e.isInline?"inline":"block"},s),className:null==t?void 0:t.own},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(ea,{value:n(t)},Yo(e,i,o))}(e.schema.children,null==t?void 0:t.own,o,i,e.testId):Yo(e.schema.children,i,e.testId))})):null}function Qo(e,t,n){if("StaticLink"===e.type)return a.createElement(Zo,{schema:e.node,testId:t,isInline:null!=n&&n})}const Xo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function er(e){const t=(n=e.schema.iconKey,l(Pa)(n,"icons"));var n;const i=null==t?void 0:t.name,o=e.schema.styles?zt(Xo,e.schema.styles):Xo,r=_a(),{styles:s}=It(r);return i?a.createElement(Lo,{styles:o},(({classnames:t})=>a.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const tr=Be`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
overflow: hidden;
|
|
@@ -6,7 +6,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
6
6
|
> * {
|
|
7
7
|
position: absolute !important;
|
|
8
8
|
}
|
|
9
|
-
`;function
|
|
9
|
+
`;function nr(e){const t=Oi(),n=r(null);return o((()=>{const e=new ResizeObserver((()=>{requestAnimationFrame((()=>{if(n.current){const e=Array.from(n.current.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0);n.current.style.height=`${e}px`}}))}));return n.current&&Array.from(n.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]),a.createElement(Lo,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{ref:n,className:[tr,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0,"data-testid":e.testId,"data-e2e":"ZStack"},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const ir={elements:{own:[{default:{dimension:{width:{type:"percentage",value:100},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#000"}},border:{borderRadius:25}}}],thumb:[{default:{dimension:{width:{type:"fixed",value:50},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#FFF"}},text:{fontSize:22,fontFamily:"rokt-icons",horizontalTextAlign:"center"},border:{borderRadius:25}}}],fill:[{default:{background:{backgroundColor:{light:"#000"}}}}],label:[{default:{text:{fontSize:18,textColor:{light:"#FFF"},horizontalTextAlign:"center"}}}]}};function ar(e){const[t,n]=c(!1),[i,s]=c(!1),l=za(),d=_a(),u=aa(),p=Ii(),{customStateKey:y,customStateValue:f,label:m,a11yLabel:h,thumb:v}=e.schema,{containerClass:g,trackClass:b,fillClass:I,thumbClass:E,labelClass:S,buttonClass:w}=function(e,t){const n=fi(e,t);return{containerClass:n`
|
|
10
10
|
position: relative;
|
|
11
11
|
z-index: 1;
|
|
12
12
|
flex: 1;
|
|
@@ -54,7 +54,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
54
54
|
z-index: 0;
|
|
55
55
|
background-color: #00000000;
|
|
56
56
|
color: #00000000;
|
|
57
|
-
`}}(l,u);if(!y)throw new Error("No custom state key provided for state trigger node.");const C={type:nn,payload:{key:y,value:null!=f?f:1}},O={type:en,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},T=e.schema.styles?zt(nr,e.schema.styles):nr,x=r(null),A=r(null),L=r(null),N=r(!1),_=r(void 0),{isDisabled:R}=It(d);o((()=>{if(t)return St()?(document.addEventListener("touchmove",P),document.addEventListener("touchend",D)):(document.addEventListener("mousemove",P),document.addEventListener("mouseup",D)),M}),[t]);const D=()=>{M(),_.current=void 0,n(!1),i||(F(!0),N.current?(G($()),j()):G(0))},k=e=>{t||i||R||(_.current=or(e),F(!1),n(!0))},P=e=>{var t,n;if(ar(L)){const i=Math.min(Math.max(0,(null!==(t=or(e))&&void 0!==t?t:0)-(null!==(n=_.current)&&void 0!==n?n:0)),$());G(i),i/$()*100>=75?N.current=!0:N.current=!1}},j=()=>{var e,t;s(!0),p(C),p(O),null===(t=null===(e=ar(x).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},$=()=>ar(x).getBoundingClientRect().width-ar(L).getBoundingClientRect().width,G=e=>{var t;ar(L).style.transform=`translateX(${e}px)`,ar(A).style.transform=`translateX(${e+(null===(t=ar(L))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},F=e=>{e?(ar(L).style.transition="transform .2s",ar(A).style.transition="transform .2s"):(ar(L).style.transition="",ar(A).style.transition="")},M=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",D),document.removeEventListener("touchmove",P),document.removeEventListener("touchend",D)};return a.createElement(Ao,{styles:T},(({classnames:t})=>{var n,o,r,s,l,c;return a.createElement("div",{className:`${g}`,"data-testid":e.testId,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${b} ${null!==(n=null==t?void 0:t.own)&&void 0!==n?n:""}`,ref:x,"aria-hidden":!0,"data-testid":e.testId&&`${e.testId}-track`},(null==m?void 0:m.value)?a.createElement("div",{className:`${S} ${null!==(o=null==t?void 0:t.label)&&void 0!==o?o:""}`,"data-testid":e.testId&&`${e.testId}-label`},m.value):null,a.createElement("div",{className:`${I} ${null!==(r=null==t?void 0:t.fill)&&void 0!==r?r:""}`,ref:A,"data-testid":e.testId&&`${e.testId}-fill`}),a.createElement("div",{className:`${E} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:L,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:k,onTouchStart:k},null!==(l=null==v?void 0:v.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:w,"aria-label":null!=h?h:void 0,onClick:j,disabled:i||R,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==m?void 0:m.value)&&void 0!==c?c:"Unlock Offers"))}))}function ar(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function or(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function rr(e){const t=Ci();return a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",flexWrap:"wrap"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function sr(e){const t=Na(),n=bi(),i=e.schema.customStateKey,o=Ei(0,(e=>e.customStates[i])),{tabIndex:r,styles:s,isDisabled:l}=It(t),c=()=>{n({type:nn,payload:{key:i,value:o?0:1}})};return a.createElement(Ao,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ToggleButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({cursor:"pointer"},s)},a.createElement(wi,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function lr(e){const t=Ci();return a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",overflowX:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function cr(e){const t=Ci();return a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column",overflowY:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const dr=s({extensions:{ctx:new Map,cache:[]}}),ur=()=>l(dr).extensions;function pr({extensions:e,extendStore:t,children:n}){const i=ur(),o=new Map([...i.ctx,...e.ctx]),r=i.cache.concat(e.cache);return a.createElement(dr.Provider,{value:{extensions:{ctx:o,cache:r},extendStore:t}},n)}function yr(e,t){const n=function(e){try{const t=JSON.parse(e);if(null!=t&&"object"==typeof t&&"type"in t&&"Extension"===t.type&&"name"in t&&"string"==typeof t.name&&t.name.trim().length>0&&"body"in t&&"object"==typeof t.body)return{type:"Extension",name:t.name,body:t.body}}catch(e){}return null}(t),i=n?e.ctx.get(n.name):null;return n&&i?[n,i]:null}function fr({data:e}){const t=yr(ur(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(dr);o((()=>{e&&t&&!n.cache.includes(e.name)&&(t(e),n.cache.push(e.name))}),[e,n.cache,t])})((n=null==t?void 0:t[1])?{sagas:n.sagas,reducer:n.reducer,name:n.name,interceptors:n.interceptors}:void 0),t){const[e,n]=t;return n.componentFactory(e.body)}return null}function mr(e,t){if(Et("Extension",e))return a.createElement(fr,{data:e.node.data})}function hr(e){const t=ja(),n=Ni(),i=Zi(),r=Ci(),s=bi(),l=d((()=>n.catalogItems||[]),[n]),c=e=>i({data:e},"catalogItem");return o((()=>{for(const e of l)s({type:en,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"CatalogStackedCollection",className:null==n?void 0:n.own,style:{display:"flex",flexDirection:"column"}},a.Children.toArray(l.map(((n,i)=>a.createElement(Ma,{context:n},a.createElement(Pa,{value:t(n)},a.createElement(Yi,{value:c(n)},r(e.schema.template,void 0,Wt(i,e.testId))))))))))):null}const vr={BasicText:(e,t)=>Fo(e,t,!0),StaticLink:(e,t)=>Zo(e,t,!0)};function gr(e){const t=Ci();return a.createElement(Oi,{value:t,overrides:vr},a.createElement(wi,null,(t=>a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))})))))}function br(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Wt(i,n)))))}function Ir(e){const t=Na(),n=bi(),i=Ci(),o=Zi(),{event:r}=e.schema,{tabIndex:s,styles:l,isDisabled:c}=It(t),d=V((e=>o(e)),r.data||{}),u=()=>{n({type:an,payload:{name:r.type,body:{offerId:d.providerOfferId,title:d.title,description:d.description}}})};return a.createElement(Ao,{styles:e.schema.styles},(({classnames:t,mapperRef:n})=>{var r;return a.createElement("button",{"aria-disabled":c,"aria-label":null!==(r=e.schema.a11yLabel)&&void 0!==r?r:void 0,className:null==t?void 0:t.own,"data-e2e":"PartnerEventButtonTrigger","data-testid":e.testId,disabled:c,onClick:u,tabIndex:s,type:"button",style:Object.assign({cursor:"pointer"},l)},a.createElement(Yi,{value:o},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(Xi,{value:n(t)},br(e,i,o))}(e.schema.children,t.own,n,i,e.testId):br(e.schema.children,i,e.testId)))}))}function Er(e){const t=bi(),n=e.schema.delay?e.schema.delay:1,i=e.schema.customStateKey,a=Ei(0,(e=>e.customStates[i]));return function({delay:e,callback:t}){const n=r(null);o((()=>{n.current=setTimeout(t,e)}),[])}({delay:n,callback:()=>{t({type:nn,payload:{key:i,value:a?0:1}})}}),null}function Sr(e){const t=Na(),n=Zi()(e.schema.value),i=bi(),o=e.schema.customStateKey,r=Ei(0,(e=>e.customStates[o])),{tabIndex:s,styles:l,isDisabled:c}=It(t),d=()=>{navigator.clipboard.writeText(n),r||i({type:nn,payload:{key:o,value:1}})};return a.createElement(Ao,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:d,"data-testid":e.testId,"data-e2e":"CopyToClipboardButton",disabled:c,"aria-disabled":c,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:s,style:Object.assign({cursor:"pointer"},l)},a.createElement(wi,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function wr(e){return()=>{throw new Pt("FAILED_CREATING_UNHANDLED_NODE",`The default mapper does not handle the ${e} node. Make sure when you use the NodeMapperProvider, you pass an override for ${e} node.`)}}const Cr={Column:function(e,t){if("Column"===e.type)return a.createElement(Lo,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(No,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(Uo,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(Vo,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement(Bo,{schema:e.node,testId:t})},OneByOneDistribution:wr("OneByOneDistribution"),StackedDistribution:wr("StackedDistribution"),CarouselDistribution:wr("CarouselDistribution"),GroupedDistribution:wr("GroupedDistribution"),ProgressIndicator:wr("ProgressIndicator"),ProgressControl:wr("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(To,{schema:e.node,testId:t})},Overlay:wr("Overlay"),CloseButton:wr("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement($o,{schema:e.node,testId:t})},BasicText:Fo,StaticLink:Zo,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(Xo,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(Ho,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(tr,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(rr,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(ir,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(sr,{schema:e.node,testId:t})},PartnerEventButtonTrigger:function(e,t){if("PartnerEventButtonTrigger"===e.type)return a.createElement(Ir,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(Er,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(hr,{schema:e.node,testId:t})},CatalogResponseButton:wr("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(lr,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(cr,{schema:e.node,testId:t})},EscapeHatch:mr,BottomSheet:wr("BottomSheet"),CatalogQuantityOption:wr("CatalogQuantityOption"),CatalogRadioGroup:wr("CatalogRadioGroup"),CatalogQuantityCounter:wr("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(gr,{schema:e.node,testId:t})},CopyToClipboardButton:function(e,t){if("CopyToClipboardButton"===e.type)return a.createElement(Sr,{schema:e.node,testId:t})}};function Or(e){return function(t,n,i){const o=n&&n[t.type],r=null!=o?o:Cr[t.type];return a.createElement(qo,{schema:t,reporter:e},r&&r(t,i)||function(e){throw new Pt("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const Tr={transformLinksToAnchorText:function(e={}){return{data:V((e=>ki(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function xr(e){const{childLayouts:t}=e,n=bi(),[i,a]=d((()=>{const e=we(B("childLayoutId"),t);return[e,V((e=>e.childLayoutSchema.predicates),e)]}),[t]),r=go(a);o((()=>{Object.entries(r).forEach((([e,t])=>{const a=i[e];t&&a&&n({type:cn,payload:a})}))}),[r,i,n])}function Ar(e){const{settings:t,dispatch:n,children:i}=e,r=Wi(t.offerData.creative.copy||{})(Tr.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=Or(t.logger),[l,d]=c("ENABLED");return o((()=>t.gateway.onInteractivityChange(d)),[t]),yn(t.rootElement,n),a.createElement(ea.Provider,{value:"VARIANT"},a.createElement(Ti.Provider,{value:t.rootElement},a.createElement(Ua.Provider,{value:t.pluginId},a.createElement(Oa,{context:t.gateway},a.createElement(xa,{context:t.layoutSchema},a.createElement(za.Provider,{value:t.schemaVersion},a.createElement(Li,{context:t.offerData},a.createElement(Pa,{value:_a(t.offerData.creative)},a.createElement(La.Provider,{value:l},a.createElement(Oi,{value:s},a.createElement(na.Provider,{value:t.offerPositionIndex},a.createElement(gi.Provider,{value:n},a.createElement(Yi,{value:r},a.createElement(Lr,null,a.createElement(xr,{childLayouts:t.childLayouts}),i))))))))))))))}function Lr(e){var t;const{children:n}=e,i=Va(),r=function(){const[e,t]=c(null),n=l(Ca).get();return o((()=>n.onGlobalStateChange((n=>{j(n,e)||t(n)}))),[n]),e}(),s=l(Ti)||void 0,d=ia(),p=u((e=>hi(e,i,d,s)),[s]);return r?a.createElement(Xi,{value:p(Object.values(null!==(t=null==r?void 0:r.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(Ii.Provider,{value:r},n)):null}function Nr(e){return a.createElement("style",{"data-testid":e.testId},"\n* {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n}\nbody {\n margin: 0;\n font-family: sans-serif;\n}\np {\n margin: 0;\n}\nimg {\n max-width: 100%;\n}\n")}function _r(e,t,n,i,a,o){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){o.current.isRunning=!0,a&&"in"===t&&function(e,t){e.style.height=`${t.clientHeight}px`}(a,e);const r=e.animate(n,{duration:i,iterations:1});return r.onfinish=()=>{"in"===t?bo(e):Io(e),o.current.isRunning=!1},r.oncancel=()=>{"in"===t?bo(e):Io(e),o.current.isRunning=!1},()=>{r.finish()}}return"in"===t?bo(e):Io(e),()=>{}}const Rr={FadeInOut:{in:[{opacity:0,display:"none"},{opacity:0,display:"none",offset:.5},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],out:[{opacity:1},{opacity:0,offset:.75},{opacity:0}]}};function Dr({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=r(null),p=r({isRunning:!1}),y=Eo(t);return o((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&t.forEach((e=>{e.contentBoxSize?function(e,t){var n;Array.isArray(e.contentBoxSize)&&e.contentBoxSize[0]?t.style.height=e.contentBoxSize[0].blockSize+"px":"object"==typeof(n=e.contentBoxSize)&&null!=n&&"blockSize"in n&&"number"==typeof n.blockSize&&"inlineSize"in n&&"number"==typeof n.inlineSize?t.style.height=e.contentBoxSize.blockSize+"px":t.style.height="auto"}(e,i):e.contentRect&&function(e,t){t.style.height=`${e.contentRect.height}px`}(e,i)}))}));return e&&u.current&&(bo(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),o((()=>e&&!l&&u.current&&i?(d(!0),_r(u.current,"in",Rr[t.type].in,y,i,p)):!e&&l&&u.current&&i?(d(!1),_r(u.current,"out",Rr[t.type].out,y/2,i,p)):()=>{}),[e,i,y]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function kr(e){const t=Ci();return a.createElement(Ao,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t(e.schema.template))}))}const Pr="ACTIVE/ADD",jr="ACTIVE/DELETE",$r="BREAKPOINT/UPDATE_ACTIVE",Gr="BREAKPOINT/INITIALISE",Fr="BREAKPOINT/SET_BREAKPOINTS",Mr="FONTS/SET",Br="LAYOUT/UPDATE",Ur="CONFIG/HANDLE",Vr="PLUGIN/CLOSE_PLUGIN",zr="SETTINGS/SET",Hr="CACHE/ADD_SERIALIZED_VALUE",Wr="CACHE/UPDATE_SERIALIZED_VALUE",qr="CACHE/CLEAR_SERIALIZED_VALUE",Jr="SIGNAL/QUEUE",Kr="SIGNAL/PROCESSED",Yr="SIGNAL/PROCESS",Zr="OVERLAY/DISMISS_OVERLAY",Qr="ERROR/REPORT",Xr="LOG",es="CUSTOM_STATES/SET",ts={LAYOUT_UPDATE:Br,UPDATE_ACTIVE_BREAKPOINT:$r,INITIALISE_BREAKPOINT:Gr,ACTIVE_ADD:Pr,ACTIVE_DELETE:jr,SET_FONTS:Mr,QUEUE_SIGNAL:Jr,SIGNAL_PROCESSED:Kr,CACHE_SERIALIZED_VALUE:Hr,UPDATE_CACHED_SERIALIZED_VALUE:Wr,CLEAR_SERIALIZED_VALUE_FROM_CACHE:qr,SET_SETTINGS:zr,SET_CUSTOM_STATE:es},ns={HANDLE_CONFIG:Ur,SET_BREAKPOINTS:Fr,CLOSE_PLUGIN:Vr,RAISE_METRIC:qt,PREPARE_SIGNAL:on,DISMISS_OVERLAY:Zr,REPORT_ERROR:Qr,LOG:Xr,OPEN_LINK:rn},is="plugin-overlay",as="plugin";function os(t){var n;const i=t.schema.styles,o=f(),r={type:(null===(n=t.action)||void 0===n?void 0:n.type)||Zr,payload:{id:is,dismissalMethod:t.schema.dismissalMethod}},s=()=>{o(r)},l=Na(),{tabIndex:c,styles:d,isDisabled:u}=It(l);return e(Ao,{styles:i,children:({classnames:n})=>{var i;return e("button",{title:"Close",className:null==n?void 0:n.own,onClick:s,"data-testid":t.testId,"data-e2e":"CloseButton",disabled:u,tabIndex:c,"aria-disabled":u,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign({cursor:"pointer"},d),children:e(wi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const rs={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ss;function ls({isOpen:n,schema:i,testId:r,children:s}){const l=fn(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(as))),u=f(),p=()=>{u({type:ns.DISMISS_OVERLAY,payload:{id:is,dismissalMethod:"rokt_backdrop"}})};o((()=>{c&&u({type:en,payload:{name:"SignalActivation",parentGuid:c}})}),[c]),o((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const y=Na(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=i.styles?Ce(rs,i.styles):rs;if(!n)return null;const I=e(wi,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(Ao,{styles:b,children:({classnames:n})=>{var a;return t("div",{className:null==n?void 0:n.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto"},g),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?p:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(I,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(ss||(ss={}));const cs={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const ds=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(cs,t.styles):cs;return e(Ao,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const us=h((function(e){return{isOpen:e.active.has(is)}}))((function(t){return e(ls,Object.assign({},t,{children:(n,i)=>e(ds,Object.assign({},t,{ref:i,children:n}))}))}));const ps=h((function(e){return{isOpen:e.active.has(is)}})),ys={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const fs=p((function({schema:t,testId:n,children:i},a){const s=r(null),l=t.styles?Ce(ys,t.styles):ys;return o((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(Ao,{styles:l,children:({classnames:t})=>e("div",{style:{width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end"},ref:s,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const ms=ps((function(t){return e(ls,Object.assign({},t,{children:(n,i)=>e(fs,Object.assign({},t,{ref:i,children:n}))}))}));const hs="DisplayPreset.FULLSCREEN",vs="DisplayPreset.EMBEDDED",gs="DisplayPreset.ATTACHED",bs="ERROR",Is="INFO",Es="WARNING";var Ss;!function(e){e.PAYPAL="Paypal"}(Ss||(Ss={}));const ws="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*Cs(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(dn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield ze(t.globalDispatch.bind(t),n))}function Os(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function Ts(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function xs(e){return re(Ts,e)}function*As(e,t){const n=yield He(e,rt.expanding(10));for(;n;){const e=yield We(n);yield ze(t,e)}}function*Ls(e,t){const n=yield We(e);yield ze(t,n)}function*Ns(e){for(;;){const t=yield We(e);yield qe(t)}}function*_s(e,t){const n=de(Oe("moduleName"),Te("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?xs(n):{}});try{yield ze(e,i)}catch(e){}t.payload.level===bs&&(yield qe({type:an,payload:{name:"PLACEMENT_FAILURE"}}),yield qe({type:ns.CLOSE_PLUGIN}))}const Rs="INVALID_RESPONSE_OBJECT",Ds="FAILED_TO_OPEN_LINK",ks="NO_PARENT_GUID",Ps="FAILED_TO_NOTIFY_INTERACTIVE",js="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var $s=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function Gs(e,t){return n=>n&&n.replace(e,t)}const Fs=Gs(/['""();{}@:[\]!/=]/g,""),Ms=/^(normal|italic|oblique( \d+deg)*)$/i,Bs=(e="")=>Ms.test(e)?e:void 0,Us=Gs(/[;{}@[\]!]/g,"");function Vs(e){const{fontFamily:t,sources:n}=e,i=$s(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function zs(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:Fs(e.fontFamily)||"",style:Bs(e.style),weight:Fs(e.weight),sources:e.sources.map((e=>Us(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():Vs(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',Vs(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function Hs(e){const t=f(),n=m((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=ws.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return o((()=>{zs(JSON.parse(n)).catch((e=>{const n={type:Qr,payload:{level:Is,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),o((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function Ws(e){return null!=e?e:null}function qs(){return new Set([is])}function Js(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const Ks=Ae(B(1)),Ys=re(B(0)),Zs=e=>G(xe(j(e)),Ys,Ks,ne,ye({},["breakpoint","breakpoints"]));function Qs(e){return Zs(e.breakpoint.activeBreakpoint)(e)}function Xs(e,t){return e.customStates[`module${t}`]||{}}function el(e){return`${e.name}:${e.parentGuid}`}function tl(e,t){return!e.processed.includes(el(t))||(n=t.name,void 0!==Rt.find((e=>e===n)));var n}function nl(){return new Map}const il={layout:function(e=Ws(),t){return t.type===Br?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case $r:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case Gr:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},t.payload.breakpoints),initialised:!0};default:return e}},active:function(e=qs(),t){var n,i;switch(t.type){case Pr:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case jr:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},fonts:function(e=[],t){return t.type===Mr?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case Jr:return fe({queue:n=>tl(e,t.payload.signal)?_e(J(B("signal"),el),n.concat(t.payload)):n},e);case Kr:return fe({queue:e=>Le(J(B("signal"),Ne({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:me(el(t.payload))},e);default:return e}},serializableCache:function(e=nl(),t){switch(t.type){case Hr:case Wr:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case qr:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0},t){return t.type===zr?T(((e,t)=>ce(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===es){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return b([n,t.payload.key],Number(t.payload.value),e)}return e}return e}};function*al(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,st((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield qe({type:ts.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield qe({type:ts.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield qe({type:Qr,payload:{level:Es,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Je())&&a.close()}}catch(e){const n=e;yield qe({type:Qr,payload:{level:bs,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function ol(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:Ur,payload:t})}),(e=>{i(e)})),o=t.fonts.subscribe((e=>{i({type:Mr,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),o.unsubscribe()}}),rt.sliding(2))}var rl=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),sl=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),ll=Object.freeze({__proto__:null,V1:rl,V2:sl}),cl=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),dl=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const ul="LINK_NAVIGATION_REQUEST",pl="REALTIME_OFFER_FULFILLMENT_SUCCESS",yl="REALTIME_OFFER_FULFILLMENT_FAILURE";var fl=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const ml={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function hl({url:e,urlBehavior:t,external:n},i=window){return fl(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(ul,{url:e}).then((()=>null));const a=ml[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var vl=Object.freeze({__proto__:null,openLink:hl});function gl(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:Qr,payload:{level:Es,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var bl=Object.freeze({__proto__:null,makePluginWarningAction:gl});function Il(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var El=Object.freeze({__proto__:null,isWindow:Il}),Sl=Object.assign(Object.assign(Object.assign({},vl),bl),El);function*wl(e=10){(yield Ke((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*wl(e-1)))}function*Cl(e){try{yield*wl(10),yield pt(e.close)}catch(e){const t=Sl.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield yt(t)}}function*Ol(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&jt.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_CREATIVE_SENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Tl=F("FAILED_TO_PARSE_CONFIG","code");function*xl(e,t){var n;const i=yield pt(ol,e.configService,e.themeService,t);for(;;)try{const e=yield ft(i);yield yt(e)}catch(e){const t=e;yield yt({type:Qr,payload:{level:bs,code:Tl(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*Al(e,t){yield ct([dt(xl,e,t),ut(an,Ol,e.partnerInteractionService)])}function Ll(e){switch(e){case"ATTACHED":return gs;case"EMBEDDED":return vs;default:return hs}}function*Nl(e,t){const n={preset:Ll(t)};yield pt(e.setDisplaySettings,n),yield yt({type:ts.ACTIVE_ADD,payload:{id:as}})}function*_l(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield ze(e,{code:t.payload.code,level:Is,message:t.payload.message||"Plugin Generic Log",additionalInformation:xs(i)})}catch(e){}}function*Rl(e){yield qe({type:ts.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield qe({type:Yr})}function*Dl(e){yield qe({type:ts.QUEUE_SIGNAL,payload:e.payload}),yield qe({type:Yr})}function*kl(e,t){const n=yield Ke((e=>e.signal.queue.filter((t=>tl(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*Pl(e.signal,i(t));break;case"SignalViewed":yield*jl(e.signal,i(t));break;case"SignalDismissal":yield*$l(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*Gl(e.signal,i(t));break;case"SignalLoadStart":yield*Fl(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*Ml(e.signal,i(t,!0));break;case"SignalUserInteraction":yield*Bl(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*Ul(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*Vl(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*zl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*Hl(e.signal,i(t))}yield qe({type:ts.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?ze(e.prepareExternalSignal,t.key,i,a,o):ze(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*Pl(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield Wl(e,t)}}function*jl(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.objectData.supportedByBrowser.toString()}})}catch(t){yield Wl(e,t)}}function*$l(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield Wl(e,t)}}function*Gl(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield Wl(e,t)}}function*Fl(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield Wl(e,t)}}function*Ml(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return t}(e))}catch(t){yield Wl(e,t)}}function*Bl(e,t){const n=e.parentGuid?e.parentGuid:yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!n||"string"!=typeof n)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,n,{objectData:{action:e.action,context:e.context}})}catch(t){yield Wl(e,t)}}function*Ul(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Wl(e,t)}}function*Vl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Wl(e,t)}}function*zl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Wl(e,t)}}function*Hl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Wl(e,t)}}function Wl(e,t){const n=Sl.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return qe(n)}function*ql(e){yield qe({type:es,payload:e.payload})}function*Jl(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield Ke((e=>e.serializableCache.has(t))))||(yield ze(e.notifyInteractive),yield qe({type:Hr,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield qe({type:Qr,payload:{level:Is,code:Ps,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*Kl(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield ze(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield ze(hl,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield qe(gl(e,"Failed to open link",Ds,{url:t.payload.url,urlBehaviour:n}))}}function*Yl(e){const t=yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:ts.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Vr}),t?yield qe({type:en,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield qe({type:Qr,payload:{level:Is,code:ks,message:"ParentGuid does not exist"}})}const Zl=h((function(e){return{isOpen:e.active.has(is)}})),Ql="undefined"!=typeof window;function Xl(e,t){o((()=>{if(!Ql||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,t])}const ec="Minimized",tc=()=>{const e=r(null),t=r(null),n=r(null),i=r(null),a=r(null),s=Ei(0,(e=>e.customStates[ec])),l=bi(),c=Na(),d=r(0),p=r(!1),y=r(0),f=r([]),m=r(void 0),{isDisabled:h}=It(c);Xl(e,!!s);const v=u((()=>{k(),m.current=void 0,p.current=!1,_(!0);g()?S():N(0)}),[]),g=()=>{const e=L();return s?e<=-.2:e>=.2};o((()=>{s?(C(),l(ic(!0))):(O(),l(ic(!1)))}),[s,l]),o((()=>{requestAnimationFrame((()=>{D(!s,n),D(!!s,i),R()}))}),[]);const b=u((e=>{if(t.current){e.preventDefault();const t=E(e);N(t)}}),[t]),I=u((e=>{Date.now()-y.current<200||(y.current=Date.now(),s?w(!1):p.current||h||(p.current=!0,A(),m.current=nc(e),_(!1),P()))}),[s,h]);o((()=>{const e=t.current;return e&&(e.addEventListener("mousedown",I),e.addEventListener("touchstart",I)),()=>{null==e||e.removeEventListener("mousedown",I),null==e||e.removeEventListener("touchstart",I)}}),[t,I]);const E=e=>{var t,n;return(null!==(t=nc(e))&&void 0!==t?t:0)-(null!==(n=m.current)&&void 0!==n?n:0)},S=()=>{w(!s)},w=e=>{const t=(e=>({type:nn,payload:{key:ec,value:e?1:0}}))(e);t&&l(t)},C=()=>{var e,t,a,o;const r=null!==(t=null===(e=n.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(o=null===(a=i.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r;_(!0),R(!0,!0),N(s),D(!1,n),D(!0,i),j()},O=()=>{_(!0),R(!0,!1),N(0),m.current=void 0,D(!0,n),D(!1,i),$()},T=u((()=>{p.current&&(x(),requestAnimationFrame(T))}),[]),x=()=>{f.current.push({yPosition:d.current,timestamp:Date.now()}),f.current.length>20&&f.current.shift()},A=u((()=>{f.current=[],T()}),[T]),L=()=>{const e=f.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},N=e=>{const n=Math.round(e);d.current=n,t.current&&(t.current.style.transform=`translateY(${n}px)`)},_=e=>{e?t.current&&(t.current.style.transition="transform .2s"):t.current&&(t.current.style.transition="")},R=(e,t=!1)=>{const a=t?i:n,o=t?n:i;o.current&&(o.current.style.transition="opacity .5s"),a.current&&(a.current.style.transition="opacity .2s")},D=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},k=u((()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)}),[b,v]),P=u((()=>{St()?(document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",v)):(document.addEventListener("mousemove",b,{passive:!1}),document.addEventListener("mouseup",v))}),[b,v]),j=()=>{const t=e.current;t&&(a.current=setTimeout((()=>{var e;const i=((null===(e=n.current)||void 0===e?void 0:e.clientHeight)||0)+1;t.style.height=i+"px"}),200))},$=()=>{a.current&&clearTimeout(a.current),e.current&&(e.current.style.height="100000px")};return{wrapperRef:e,containerRef:t,minimizedChildRef:n,maximizedChildRef:i}};function nc(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const ic=e=>({type:en,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}}),ac={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var oc;function rc({schema:t,testId:n}){const i=fn(),a=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=m((e=>e.active.has(as))),l=r(null),c=f(),d=()=>{c({type:ns.DISMISS_OVERLAY,payload:{id:is,dismissalMethod:"rokt_backdrop"}})},u=Ei(0,(e=>e.customStates[ec]));o((()=>{p(!!u)}),[u]),Xl(l,!!u);const p=e=>{const t=l.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{a&&c({type:en,payload:{name:"SignalActivation",parentGuid:a}})}),[a]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()}))}),[s]);const y=Na(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=t.styles?Ce(ac,t.styles):ac;return e(Ao,{styles:b,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:"1",transition:"opacity 0.2s ease-in-out"},g),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:l,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?d:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function sc(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(oc||(oc={}));const lc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function cc(t){const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(dc,Object.assign({},t,{slots:n,currentIndex:i}))}function dc(n){const{wrapperRef:i,containerRef:a,minimizedChildRef:o,maximizedChildRef:r}=tc();return n.isOpen?t("div",{ref:i,style:{height:"100000px"},children:[e(rc,Object.assign({},n)),e(pc,Object.assign({},n,{containerRef:a,minimizedChildRef:o,maximizedChildRef:r}))]}):null}const uc=Be`
|
|
57
|
+
`}}(l,u);if(!y)throw new Error("No custom state key provided for state trigger node.");const C={type:nn,payload:{key:y,value:null!=f?f:1}},O={type:en,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},T=e.schema.styles?zt(ir,e.schema.styles):ir,x=r(null),A=r(null),L=r(null),N=r(!1),_=r(void 0),{isDisabled:R}=It(d);o((()=>{if(t)return St()?(document.addEventListener("touchmove",P),document.addEventListener("touchend",D)):(document.addEventListener("mousemove",P),document.addEventListener("mouseup",D)),M}),[t]);const D=()=>{M(),_.current=void 0,n(!1),i||(F(!0),N.current?(G($()),j()):G(0))},k=e=>{t||i||R||(_.current=rr(e),F(!1),n(!0))},P=e=>{var t,n;if(or(L)){const i=Math.min(Math.max(0,(null!==(t=rr(e))&&void 0!==t?t:0)-(null!==(n=_.current)&&void 0!==n?n:0)),$());G(i),i/$()*100>=75?N.current=!0:N.current=!1}},j=()=>{var e,t;s(!0),p(C),p(O),null===(t=null===(e=or(x).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},$=()=>or(x).getBoundingClientRect().width-or(L).getBoundingClientRect().width,G=e=>{var t;or(L).style.transform=`translateX(${e}px)`,or(A).style.transform=`translateX(${e+(null===(t=or(L))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},F=e=>{e?(or(L).style.transition="transform .2s",or(A).style.transition="transform .2s"):(or(L).style.transition="",or(A).style.transition="")},M=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",D),document.removeEventListener("touchmove",P),document.removeEventListener("touchend",D)};return a.createElement(Lo,{styles:T},(({classnames:t})=>{var n,o,r,s,l,c;return a.createElement("div",{className:`${g}`,"data-testid":e.testId,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${b} ${null!==(n=null==t?void 0:t.own)&&void 0!==n?n:""}`,ref:x,"aria-hidden":!0,"data-testid":e.testId&&`${e.testId}-track`},(null==m?void 0:m.value)?a.createElement("div",{className:`${S} ${null!==(o=null==t?void 0:t.label)&&void 0!==o?o:""}`,"data-testid":e.testId&&`${e.testId}-label`},m.value):null,a.createElement("div",{className:`${I} ${null!==(r=null==t?void 0:t.fill)&&void 0!==r?r:""}`,ref:A,"data-testid":e.testId&&`${e.testId}-fill`}),a.createElement("div",{className:`${E} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:L,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:k,onTouchStart:k},null!==(l=null==v?void 0:v.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:w,"aria-label":null!=h?h:void 0,onClick:j,disabled:i||R,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==m?void 0:m.value)&&void 0!==c?c:"Unlock Offers"))}))}function or(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function rr(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function sr(e){const t=Oi();return a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",flexWrap:"wrap"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function lr(e){const t=_a(),n=Ii(),i=e.schema.customStateKey,o=Si(0,(e=>e.customStates[i])),{tabIndex:r,styles:s,isDisabled:l}=It(t),c=()=>{n({type:nn,payload:{key:i,value:o?0:1}})};return a.createElement(Lo,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ToggleButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({cursor:"pointer"},s)},a.createElement(Ci,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function cr(e){const t=Oi();return a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",overflowX:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function dr(e){const t=Oi();return a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column",overflowY:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const ur=s({extensions:{ctx:new Map,cache:[]}}),pr=()=>l(ur).extensions;function yr({extensions:e,extendStore:t,children:n}){const i=pr(),o=new Map([...i.ctx,...e.ctx]),r=i.cache.concat(e.cache);return a.createElement(ur.Provider,{value:{extensions:{ctx:o,cache:r},extendStore:t}},n)}function fr(e,t){const n=function(e){try{const t=JSON.parse(e);if(null!=t&&"object"==typeof t&&"type"in t&&"Extension"===t.type&&"name"in t&&"string"==typeof t.name&&t.name.trim().length>0&&"body"in t&&"object"==typeof t.body)return{type:"Extension",name:t.name,body:t.body}}catch(e){}return null}(t),i=n?e.ctx.get(n.name):null;return n&&i?[n,i]:null}function mr({data:e}){const t=fr(pr(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(ur);o((()=>{e&&t&&!n.cache.includes(e.name)&&(t(e),n.cache.push(e.name))}),[e,n.cache,t])})((n=null==t?void 0:t[1])?{sagas:n.sagas,reducer:n.reducer,name:n.name,interceptors:n.interceptors}:void 0),t){const[e,n]=t;return n.componentFactory(e.body)}return null}function hr(e,t){if(Et("Extension",e))return a.createElement(mr,{data:e.node.data})}function vr(e){const t=$a(),n=_i(),i=Qi(),r=Oi(),s=Ii(),l=d((()=>n.catalogItems||[]),[n]),c=e=>i({data:e},"catalogItem");return o((()=>{for(const e of l)s({type:en,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"CatalogStackedCollection",className:null==n?void 0:n.own,style:{display:"flex",flexDirection:"column"}},a.Children.toArray(l.map(((n,i)=>a.createElement(Ba,{context:n},a.createElement(ja,{value:t(n)},a.createElement(Zi,{value:c(n)},r(e.schema.template,void 0,Wt(i,e.testId))))))))))):null}const gr={BasicText:(e,t)=>Mo(e,t,!0),StaticLink:(e,t)=>Qo(e,t,!0)};function br(e){const t=Oi();return a.createElement(Ti,{value:t,overrides:gr},a.createElement(Ci,null,(t=>a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))})))))}function Ir(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Wt(i,n)))))}function Er(e){const t=_a(),n=Ii(),i=Oi(),o=Qi(),{event:r}=e.schema,{tabIndex:s,styles:l,isDisabled:c}=It(t),d=V((e=>o(e)),r.data||{}),u=()=>{n({type:an,payload:{name:r.type,body:{offerId:d.providerOfferId,title:d.title,description:d.description}}})};return a.createElement(Lo,{styles:e.schema.styles},(({classnames:t,mapperRef:n})=>{var r;return a.createElement("button",{"aria-disabled":c,"aria-label":null!==(r=e.schema.a11yLabel)&&void 0!==r?r:void 0,className:null==t?void 0:t.own,"data-e2e":"PartnerEventButtonTrigger","data-testid":e.testId,disabled:c,onClick:u,tabIndex:s,type:"button",style:Object.assign({cursor:"pointer"},l)},a.createElement(Zi,{value:o},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(ea,{value:n(t)},Ir(e,i,o))}(e.schema.children,t.own,n,i,e.testId):Ir(e.schema.children,i,e.testId)))}))}function Sr(e){const t=Ii(),n=e.schema.delay?e.schema.delay:1,i=e.schema.customStateKey,a=Si(0,(e=>e.customStates[i]));return function({delay:e,callback:t}){const n=r(null);o((()=>{n.current=setTimeout(t,e)}),[])}({delay:n,callback:()=>{t({type:nn,payload:{key:i,value:a?0:1}})}}),null}function wr(e){const t=_a(),n=Qi()(e.schema.value),i=Ii(),o=e.schema.customStateKey,r=Si(0,(e=>e.customStates[o])),{tabIndex:s,styles:l,isDisabled:c}=It(t),d=()=>{navigator.clipboard.writeText(n),r||i({type:nn,payload:{key:o,value:1}})};return a.createElement(Lo,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:d,"data-testid":e.testId,"data-e2e":"CopyToClipboardButton",disabled:c,"aria-disabled":c,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:s,style:Object.assign({cursor:"pointer"},l)},a.createElement(Ci,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function Cr(e){return()=>{throw new Pt("FAILED_CREATING_UNHANDLED_NODE",`The default mapper does not handle the ${e} node. Make sure when you use the NodeMapperProvider, you pass an override for ${e} node.`)}}const Or={Column:function(e,t){if("Column"===e.type)return a.createElement(No,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(_o,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(Vo,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(zo,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement(Uo,{schema:e.node,testId:t})},OneByOneDistribution:Cr("OneByOneDistribution"),StackedDistribution:Cr("StackedDistribution"),CarouselDistribution:Cr("CarouselDistribution"),GroupedDistribution:Cr("GroupedDistribution"),ProgressIndicator:Cr("ProgressIndicator"),ProgressControl:Cr("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(xo,{schema:e.node,testId:t})},Overlay:Cr("Overlay"),CloseButton:Cr("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement(Go,{schema:e.node,testId:t})},BasicText:Mo,StaticLink:Qo,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(er,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(Wo,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(nr,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(sr,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(ar,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(lr,{schema:e.node,testId:t})},PartnerEventButtonTrigger:function(e,t){if("PartnerEventButtonTrigger"===e.type)return a.createElement(Er,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(Sr,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(vr,{schema:e.node,testId:t})},CatalogResponseButton:Cr("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(cr,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(dr,{schema:e.node,testId:t})},EscapeHatch:hr,BottomSheet:Cr("BottomSheet"),CatalogQuantityOption:Cr("CatalogQuantityOption"),CatalogRadioGroup:Cr("CatalogRadioGroup"),CatalogQuantityCounter:Cr("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(br,{schema:e.node,testId:t})},CopyToClipboardButton:function(e,t){if("CopyToClipboardButton"===e.type)return a.createElement(wr,{schema:e.node,testId:t})}};function Tr(e){return function(t,n,i){const o=n&&n[t.type],r=null!=o?o:Or[t.type];return a.createElement(Jo,{schema:t,reporter:e},r&&r(t,i)||function(e){throw new Pt("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const xr={transformLinksToAnchorText:function(e={}){return{data:V((e=>Pi(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function Ar(e){const{childLayouts:t}=e,n=Ii(),[i,a]=d((()=>{const e=we(B("childLayoutId"),t);return[e,V((e=>e.childLayoutSchema.predicates),e)]}),[t]),r=bo(a);o((()=>{Object.entries(r).forEach((([e,t])=>{const a=i[e];t&&a&&n({type:dn,payload:a})}))}),[r,i,n])}function Lr(e){const{settings:t,dispatch:n,children:i}=e,r=qi(t.offerData.creative.copy||{})(xr.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=Tr(t.logger),[l,d]=c("ENABLED");return o((()=>t.gateway.onInteractivityChange(d)),[t]),fn(t.rootElement,n),a.createElement(ta.Provider,{value:"VARIANT"},a.createElement(xi.Provider,{value:t.rootElement},a.createElement(Va.Provider,{value:t.pluginId},a.createElement(Ta,{context:t.gateway},a.createElement(Aa,{context:t.layoutSchema},a.createElement(Ha.Provider,{value:t.schemaVersion},a.createElement(Ni,{context:t.offerData},a.createElement(ja,{value:Ra(t.offerData.creative)},a.createElement(Na.Provider,{value:l},a.createElement(Ti,{value:s},a.createElement(ia.Provider,{value:t.offerPositionIndex},a.createElement(bi.Provider,{value:n},a.createElement(Zi,{value:r},a.createElement(Nr,null,a.createElement(Ar,{childLayouts:t.childLayouts}),i))))))))))))))}function Nr(e){var t;const{children:n}=e,i=za(),r=function(){const[e,t]=c(null),n=l(Oa).get();return o((()=>n.onGlobalStateChange((n=>{j(n,e)||t(n)}))),[n]),e}(),s=l(xi)||void 0,d=aa(),p=u((e=>vi(e,i,d,s)),[s]);return r?a.createElement(ea,{value:p(Object.values(null!==(t=null==r?void 0:r.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(Ei.Provider,{value:r},n)):null}function _r(e){return a.createElement("style",{"data-testid":e.testId},"\n* {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n}\nbody {\n margin: 0;\n font-family: sans-serif;\n}\np {\n margin: 0;\n}\nimg {\n max-width: 100%;\n}\n")}function Rr(e,t,n,i,a,o){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){o.current.isRunning=!0,a&&"in"===t&&function(e,t){e.style.height=`${t.clientHeight}px`}(a,e);const r=e.animate(n,{duration:i,iterations:1});return r.onfinish=()=>{"in"===t?Io(e):Eo(e),o.current.isRunning=!1},r.oncancel=()=>{"in"===t?Io(e):Eo(e),o.current.isRunning=!1},()=>{r.finish()}}return"in"===t?Io(e):Eo(e),()=>{}}const Dr={FadeInOut:{in:[{opacity:0,display:"none"},{opacity:0,display:"none",offset:.5},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],out:[{opacity:1},{opacity:0,offset:.75},{opacity:0}]}};function kr({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=r(null),p=r({isRunning:!1}),y=So(t);return o((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&t.forEach((e=>{e.contentBoxSize?function(e,t){var n;Array.isArray(e.contentBoxSize)&&e.contentBoxSize[0]?t.style.height=e.contentBoxSize[0].blockSize+"px":"object"==typeof(n=e.contentBoxSize)&&null!=n&&"blockSize"in n&&"number"==typeof n.blockSize&&"inlineSize"in n&&"number"==typeof n.inlineSize?t.style.height=e.contentBoxSize.blockSize+"px":t.style.height="auto"}(e,i):e.contentRect&&function(e,t){t.style.height=`${e.contentRect.height}px`}(e,i)}))}));return e&&u.current&&(Io(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),o((()=>e&&!l&&u.current&&i?(d(!0),Rr(u.current,"in",Dr[t.type].in,y,i,p)):!e&&l&&u.current&&i?(d(!1),Rr(u.current,"out",Dr[t.type].out,y/2,i,p)):()=>{}),[e,i,y]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function Pr(e){const t=Oi();return a.createElement(Lo,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t(e.schema.template))}))}const jr="ACTIVE/ADD",$r="ACTIVE/DELETE",Gr="BREAKPOINT/UPDATE_ACTIVE",Fr="BREAKPOINT/INITIALISE",Mr="BREAKPOINT/SET_BREAKPOINTS",Br="FONTS/SET",Ur="LAYOUT/UPDATE",Vr="CONFIG/HANDLE",zr="PLUGIN/CLOSE_PLUGIN",Hr="SETTINGS/SET",Wr="CACHE/ADD_SERIALIZED_VALUE",qr="CACHE/UPDATE_SERIALIZED_VALUE",Jr="CACHE/CLEAR_SERIALIZED_VALUE",Kr="SIGNAL/QUEUE",Yr="SIGNAL/PROCESSED",Zr="SIGNAL/PROCESS",Qr="OVERLAY/DISMISS_OVERLAY",Xr="ERROR/REPORT",es="LOG",ts="CUSTOM_STATES/SET",ns={LAYOUT_UPDATE:Ur,UPDATE_ACTIVE_BREAKPOINT:Gr,INITIALISE_BREAKPOINT:Fr,ACTIVE_ADD:jr,ACTIVE_DELETE:$r,SET_FONTS:Br,QUEUE_SIGNAL:Kr,SIGNAL_PROCESSED:Yr,CACHE_SERIALIZED_VALUE:Wr,UPDATE_CACHED_SERIALIZED_VALUE:qr,CLEAR_SERIALIZED_VALUE_FROM_CACHE:Jr,SET_SETTINGS:Hr,SET_CUSTOM_STATE:ts},is={HANDLE_CONFIG:Vr,SET_BREAKPOINTS:Mr,CLOSE_PLUGIN:zr,RAISE_METRIC:qt,PREPARE_SIGNAL:rn,DISMISS_OVERLAY:Qr,REPORT_ERROR:Xr,LOG:es,OPEN_LINK:sn},as="plugin-overlay",os="plugin";function rs(t){var n;const i=t.schema.styles,o=f(),r={type:(null===(n=t.action)||void 0===n?void 0:n.type)||Qr,payload:{id:as,dismissalMethod:t.schema.dismissalMethod}},s=()=>{o(r)},l=_a(),{tabIndex:c,styles:d,isDisabled:u}=It(l);return e(Lo,{styles:i,children:({classnames:n})=>{var i;return e("button",{title:"Close",className:null==n?void 0:n.own,onClick:s,"data-testid":t.testId,"data-e2e":"CloseButton",disabled:u,tabIndex:c,"aria-disabled":u,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign({cursor:"pointer"},d),children:e(Ci,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const ss={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ls;function cs({isOpen:n,schema:i,testId:r,children:s}){const l=mn(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(os))),u=f(),p=()=>{u({type:is.DISMISS_OVERLAY,payload:{id:as,dismissalMethod:"rokt_backdrop"}})};o((()=>{c&&u({type:en,payload:{name:"SignalActivation",parentGuid:c}})}),[c]),o((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const y=_a(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=i.styles?Ce(ss,i.styles):ss;if(!n)return null;const I=e(Ci,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(Lo,{styles:b,children:({classnames:n})=>{var a;return t("div",{className:null==n?void 0:n.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto"},g),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?p:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(I,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(ls||(ls={}));const ds={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const us=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(ds,t.styles):ds;return e(Lo,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const ps=h((function(e){return{isOpen:e.active.has(as)}}))((function(t){return e(cs,Object.assign({},t,{children:(n,i)=>e(us,Object.assign({},t,{ref:i,children:n}))}))}));const ys=h((function(e){return{isOpen:e.active.has(as)}})),fs={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const ms=p((function({schema:t,testId:n,children:i},a){const s=r(null),l=t.styles?Ce(fs,t.styles):fs;return o((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(Lo,{styles:l,children:({classnames:t})=>e("div",{style:{width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end"},ref:s,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const hs=ys((function(t){return e(cs,Object.assign({},t,{children:(n,i)=>e(ms,Object.assign({},t,{ref:i,children:n}))}))}));const vs="DisplayPreset.FULLSCREEN",gs="DisplayPreset.EMBEDDED",bs="DisplayPreset.ATTACHED",Is="ERROR",Es="INFO",Ss="WARNING";var ws;!function(e){e.PAYPAL="Paypal"}(ws||(ws={}));const Cs="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*Os(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(un).includes(e.type)})(n)&&!e.includes(n.type)&&(yield ze(t.globalDispatch.bind(t),n))}function Ts(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function xs(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function As(e){return re(xs,e)}function*Ls(e,t){const n=yield He(e,rt.expanding(10));for(;n;){const e=yield We(n);yield ze(t,e)}}function*Ns(e,t){const n=yield We(e);yield ze(t,n)}function*_s(e){for(;;){const t=yield We(e);yield qe(t)}}function*Rs(e,t){const n=de(Oe("moduleName"),Te("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?As(n):{}});try{yield ze(e,i)}catch(e){}t.payload.level===Is&&(yield qe({type:an,payload:{name:"PLACEMENT_FAILURE"}}),yield qe({type:is.CLOSE_PLUGIN}))}const Ds="INVALID_RESPONSE_OBJECT",ks="FAILED_TO_OPEN_LINK",Ps="NO_PARENT_GUID",js="FAILED_TO_NOTIFY_INTERACTIVE",$s="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Gs=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function Fs(e,t){return n=>n&&n.replace(e,t)}const Ms=Fs(/['""();{}@:[\]!/=]/g,""),Bs=/^(normal|italic|oblique( \d+deg)*)$/i,Us=(e="")=>Bs.test(e)?e:void 0,Vs=Fs(/[;{}@[\]!]/g,"");function zs(e){const{fontFamily:t,sources:n}=e,i=Gs(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function Hs(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:Ms(e.fontFamily)||"",style:Us(e.style),weight:Ms(e.weight),sources:e.sources.map((e=>Vs(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():zs(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',zs(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function Ws(e){const t=f(),n=m((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=Cs.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return o((()=>{Hs(JSON.parse(n)).catch((e=>{const n={type:Xr,payload:{level:Es,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),o((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function qs(e){return null!=e?e:null}function Js(){return new Set([as])}function Ks(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const Ys=Ae(B(1)),Zs=re(B(0)),Qs=e=>G(xe(j(e)),Zs,Ys,ne,ye({},["breakpoint","breakpoints"]));function Xs(e){return Qs(e.breakpoint.activeBreakpoint)(e)}function el(e,t){return e.customStates[`module${t}`]||{}}function tl(e){return`${e.name}:${e.parentGuid}`}function nl(e,t){return!e.processed.includes(tl(t))||(n=t.name,void 0!==Rt.find((e=>e===n)));var n}function il(){return new Map}const al={layout:function(e=qs(),t){return t.type===Ur?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case Gr:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case Fr:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},t.payload.breakpoints),initialised:!0};default:return e}},active:function(e=Js(),t){var n,i;switch(t.type){case jr:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case $r:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},fonts:function(e=[],t){return t.type===Br?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case Kr:return fe({queue:n=>nl(e,t.payload.signal)?_e(J(B("signal"),tl),n.concat(t.payload)):n},e);case Yr:return fe({queue:e=>Le(J(B("signal"),Ne({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:me(tl(t.payload))},e);default:return e}},serializableCache:function(e=il(),t){switch(t.type){case Wr:case qr:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case Jr:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0},t){return t.type===Hr?T(((e,t)=>ce(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===ts){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return b([n,t.payload.key],Number(t.payload.value),e)}return e}return e}};function*ol(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,st((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield qe({type:ns.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield qe({type:ns.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield qe({type:Xr,payload:{level:Ss,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Je())&&a.close()}}catch(e){const n=e;yield qe({type:Xr,payload:{level:Is,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function rl(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:Vr,payload:t})}),(e=>{i(e)})),o=t.fonts.subscribe((e=>{i({type:Br,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),o.unsubscribe()}}),rt.sliding(2))}var sl=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),ll=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),cl=Object.freeze({__proto__:null,V1:sl,V2:ll}),dl=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),ul=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const pl="LINK_NAVIGATION_REQUEST",yl="REALTIME_OFFER_FULFILLMENT_SUCCESS",fl="REALTIME_OFFER_FULFILLMENT_FAILURE";var ml=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const hl={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function vl({url:e,urlBehavior:t,external:n},i=window){return ml(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(pl,{url:e}).then((()=>null));const a=hl[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var gl=Object.freeze({__proto__:null,openLink:vl});function bl(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:Xr,payload:{level:Ss,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var Il=Object.freeze({__proto__:null,makePluginWarningAction:bl});function El(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var Sl=Object.freeze({__proto__:null,isWindow:El}),wl=Object.assign(Object.assign(Object.assign({},gl),Il),Sl);function*Cl(e=10){(yield Ke((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*Cl(e-1)))}function*Ol(e){try{yield*Cl(10),yield pt(e.close)}catch(e){const t=wl.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield yt(t)}}function*Tl(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&jt.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_CREATIVE_SENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const xl=F("FAILED_TO_PARSE_CONFIG","code");function*Al(e,t){var n;const i=yield pt(rl,e.configService,e.themeService,t);for(;;)try{const e=yield ft(i);yield yt(e)}catch(e){const t=e;yield yt({type:Xr,payload:{level:Is,code:xl(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*Ll(e,t){yield ct([dt(Al,e,t),ut(an,Tl,e.partnerInteractionService)])}function Nl(e){switch(e){case"ATTACHED":return bs;case"EMBEDDED":return gs;default:return vs}}function*_l(e,t){const n={preset:Nl(t)};yield pt(e.setDisplaySettings,n),yield yt({type:ns.ACTIVE_ADD,payload:{id:os}})}function*Rl(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield ze(e,{code:t.payload.code,level:Es,message:t.payload.message||"Plugin Generic Log",additionalInformation:As(i)})}catch(e){}}function*Dl(e){yield qe({type:ns.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield qe({type:Zr})}function*kl(e){yield qe({type:ns.QUEUE_SIGNAL,payload:e.payload}),yield qe({type:Zr})}function*Pl(e,t){const n=yield Ke((e=>e.signal.queue.filter((t=>nl(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*jl(e.signal,i(t));break;case"SignalViewed":yield*$l(e.signal,i(t));break;case"SignalDismissal":yield*Gl(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*Fl(e.signal,i(t));break;case"SignalLoadStart":yield*Ml(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*Bl(e.signal,i(t,!0));break;case"SignalUserInteraction":yield*Ul(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*Vl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*zl(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*Hl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*Wl(e.signal,i(t))}yield qe({type:ns.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?ze(e.prepareExternalSignal,t.key,i,a,o):ze(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*jl(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield ql(e,t)}}function*$l(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.objectData.supportedByBrowser.toString()}})}catch(t){yield ql(e,t)}}function*Gl(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield ql(e,t)}}function*Fl(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield ql(e,t)}}function*Ml(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield ql(e,t)}}function*Bl(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return t}(e))}catch(t){yield ql(e,t)}}function*Ul(e,t){const n=e.parentGuid?e.parentGuid:yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!n||"string"!=typeof n)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,n,{objectData:{action:e.action,context:e.context}})}catch(t){yield ql(e,t)}}function*Vl(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield ql(e,t)}}function*zl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield ql(e,t)}}function*Hl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield ql(e,t)}}function*Wl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield ql(e,t)}}function ql(e,t){const n=wl.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return qe(n)}function*Jl(e){yield qe({type:ts,payload:e.payload})}function*Kl(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield Ke((e=>e.serializableCache.has(t))))||(yield ze(e.notifyInteractive),yield qe({type:Wr,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield qe({type:Xr,payload:{level:Es,code:js,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*Yl(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield ze(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield ze(vl,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield qe(bl(e,"Failed to open link",ks,{url:t.payload.url,urlBehaviour:n}))}}function*Zl(e){const t=yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:ns.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:zr}),t?yield qe({type:en,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield qe({type:Xr,payload:{level:Es,code:Ps,message:"ParentGuid does not exist"}})}const Ql=h((function(e){return{isOpen:e.active.has(as)}})),Xl="undefined"!=typeof window;function ec(e,t){o((()=>{if(!Xl||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,t])}const tc="Minimized",nc=()=>{const e=r(null),t=r(null),n=r(null),i=r(null),a=r(null),s=Si(0,(e=>e.customStates[tc])),l=Ii(),c=_a(),d=r(0),p=r(!1),y=r(0),f=r([]),m=r(void 0),{isDisabled:h}=It(c);ec(e,!!s);const v=u((()=>{k(),m.current=void 0,p.current=!1,_(!0);g()?S():N(0)}),[]),g=()=>{const e=L();return s?e<=-.2:e>=.2};o((()=>{s?(C(),l(ac(!0))):(O(),l(ac(!1)))}),[s,l]),o((()=>{requestAnimationFrame((()=>{D(!s,n),D(!!s,i),R()}))}),[]);const b=u((e=>{if(t.current){e.preventDefault();const t=E(e);N(t)}}),[t]),I=u((e=>{Date.now()-y.current<200||(y.current=Date.now(),s?w(!1):p.current||h||(p.current=!0,A(),m.current=ic(e),_(!1),P()))}),[s,h]);o((()=>{const e=t.current;return e&&(e.addEventListener("mousedown",I),e.addEventListener("touchstart",I)),()=>{null==e||e.removeEventListener("mousedown",I),null==e||e.removeEventListener("touchstart",I)}}),[t,I]);const E=e=>{var t,n;return(null!==(t=ic(e))&&void 0!==t?t:0)-(null!==(n=m.current)&&void 0!==n?n:0)},S=()=>{w(!s)},w=e=>{const t=(e=>({type:nn,payload:{key:tc,value:e?1:0}}))(e);t&&l(t)},C=()=>{var e,t,a,o;const r=null!==(t=null===(e=n.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(o=null===(a=i.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r;_(!0),R(!0,!0),N(s),D(!1,n),D(!0,i),j()},O=()=>{_(!0),R(!0,!1),N(0),m.current=void 0,D(!0,n),D(!1,i),$()},T=u((()=>{p.current&&(x(),requestAnimationFrame(T))}),[]),x=()=>{f.current.push({yPosition:d.current,timestamp:Date.now()}),f.current.length>20&&f.current.shift()},A=u((()=>{f.current=[],T()}),[T]),L=()=>{const e=f.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},N=e=>{const n=Math.round(e);d.current=n,t.current&&(t.current.style.transform=`translateY(${n}px)`)},_=e=>{e?t.current&&(t.current.style.transition="transform .2s"):t.current&&(t.current.style.transition="")},R=(e,t=!1)=>{const a=t?i:n,o=t?n:i;o.current&&(o.current.style.transition="opacity .5s"),a.current&&(a.current.style.transition="opacity .2s")},D=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},k=u((()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)}),[b,v]),P=u((()=>{St()?(document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",v)):(document.addEventListener("mousemove",b,{passive:!1}),document.addEventListener("mouseup",v))}),[b,v]),j=()=>{const t=e.current;t&&(a.current=setTimeout((()=>{var e;const i=((null===(e=n.current)||void 0===e?void 0:e.clientHeight)||0)+1;t.style.height=i+"px"}),200))},$=()=>{a.current&&clearTimeout(a.current),e.current&&(e.current.style.height="100000px")};return{wrapperRef:e,containerRef:t,minimizedChildRef:n,maximizedChildRef:i}};function ic(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const ac=e=>({type:en,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}}),oc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var rc;function sc({schema:t,testId:n}){const i=mn(),a=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=m((e=>e.active.has(os))),l=r(null),c=f(),d=()=>{c({type:is.DISMISS_OVERLAY,payload:{id:as,dismissalMethod:"rokt_backdrop"}})},u=Si(0,(e=>e.customStates[tc]));o((()=>{p(!!u)}),[u]),ec(l,!!u);const p=e=>{const t=l.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{a&&c({type:en,payload:{name:"SignalActivation",parentGuid:a}})}),[a]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()}))}),[s]);const y=_a(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=t.styles?Ce(oc,t.styles):oc;return e(Lo,{styles:b,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:"1",transition:"opacity 0.2s ease-in-out"},g),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:l,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?d:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function lc(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(rc||(rc={}));const cc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function dc(t){const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(uc,Object.assign({},t,{slots:n,currentIndex:i}))}function uc(n){const{wrapperRef:i,containerRef:a,minimizedChildRef:o,maximizedChildRef:r}=nc();return n.isOpen?t("div",{ref:i,style:{height:"100000px"},children:[e(sc,Object.assign({},n)),e(yc,Object.assign({},n,{containerRef:a,minimizedChildRef:o,maximizedChildRef:r}))]}):null}const pc=Be`
|
|
58
58
|
display: flex;
|
|
59
59
|
position: relative;
|
|
60
60
|
overflow: hidden;
|
|
@@ -62,7 +62,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
62
62
|
> * {
|
|
63
63
|
position: absolute !important;
|
|
64
64
|
}
|
|
65
|
-
`,pc=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u},p){var y,f;const m=r(null),h=r(null),v=r(!0),g=n.styles?Ce(lc,n.styles):lc,b=Ci(),I=()=>{const e=h.current;if(!e)return 0;return Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0)};o((()=>{const e=new ResizeObserver((()=>{(()=>{const e=h.current;if(!e)return;const t=I();e.style.height=`${t}px`})(),v.current&&(()=>{const e=I(),t=m.current;t&&(v.current=!1,t.style.setProperty("transform",`translateY(${e}px)`),requestAnimationFrame((()=>{t.style.transition="transform 0.8s",t.style.setProperty("transform","translateY(0px)")})))})()}));return h.current&&Array.from(h.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const E=null===(f=null===(y=s[l])||void 0===y?void 0:y.offer)||void 0===f?void 0:f.creative,S=null==E?void 0:E.copy,w=Wi(S||{})(Tr.transformLinksToAnchorText(null==E?void 0:E.links),"creativeLink");return e(Ao,{styles:g,children:({classnames:o})=>{var r;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:m,children:t("div",{className:null==o?void 0:o.own,style:{height:"100%",position:"relative",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",border:"1px solid #D5D7DA",borderBottom:"none",margin:"0px -1px"},ref:d,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(sc,{}),e("div",{ref:h,className:uc,"aria-label":null!==(r=n.a11yLabel)&&void 0!==r?r:void 0,children:a.Children.toArray([e("div",{ref:u,style:{width:"100%"},children:b(n.children[0],void 0,Wt(0,i))},"0"),e(Yi,{value:w,children:e(Pa,{value:_a(E),children:e("div",{ref:c,style:{width:"100%"},children:S&&e("div",{children:b(n.children[1],void 0,Wt(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*yc(){(yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ke((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:nn,payload:{key:"Minimized",value:1}}))}Zl(cc);const fc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var mc;function hc({isOpen:t,schema:n,testId:i,children:r}){const s=fn(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(as))),d=f();o((()=>{l&&d({type:en,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),o((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const u=Na(),{tabIndex:p,isDisabled:y,styles:h}=It(u),v=n.styles?Ce(fc,n.styles):fc;if(!t)return null;const g=e(wi,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(Ao,{styles:v,children:({classnames:t})=>{var a;return e("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"10000px",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto",flexDirection:"column",justifyContent:"flex-end"},h),"aria-label":null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:p,"data-testid":i,"data-e2e":"Overlay-Wrapper",children:r(g,s)})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(mc||(mc={}));const vc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const gc=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(vc,t.styles):vc;return e(Ao,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:"center"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const bc=h((function(e){return{isOpen:e.active.has(is)}}))((function(t){return e(hc,Object.assign({},t,{children:(n,i)=>e(gc,Object.assign({},t,{ref:i,children:n}))}))})),Ic=Zl(cc),Ec={name:"minimized-bottomsheet-extension",sagas:function*(){yield Ye([Ze("OFFER_LIFECYCLE",yc)])},componentFactory:t=>"Overlay"===t.type?e(bc,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(Ic,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const Sc=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=(r=e.progression.totalCount,(s=e.progression.groupSize)<=0||r<=0||s>r?0:Math.ceil(r/s));let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}var r,s;return{numOfIndicators:0,activeIndex:0,startIndex:0}})),wc=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"37",height:"29",viewBox:"0 0 37 29",fill:"inherit",style:{maxWidth:"44px",maxHeight:"32px",width:"100%",height:"100%"}},a.createElement("path",{d:"M5.62263 14.7123L5.48251 5.86667L11.3433 4.79804L11.3655 6.53531L7.57989 7.22555L7.61586 9.03828L11.0283 8.41606L11.0513 10.1575L7.63884 10.7797L7.69779 14.3339L5.62263 14.7123ZM17.5824 3.66043L19.6534 3.28282L19.745 8.98818C19.7555 9.64756 19.6126 10.2497 19.3164 10.7947C19.0224 11.3363 18.6042 11.7908 18.0619 12.1583C17.5191 12.5229 16.8858 12.7712 16.1619 12.9032C15.4352 13.0357 14.7983 13.019 14.2512 12.8531C13.7035 12.6844 13.2748 12.3843 12.9651 11.9527C12.6549 11.5184 12.4931 10.9717 12.4799 10.3129L12.3882 4.60752L14.4634 4.22914L14.5473 9.74965C14.5538 10.0546 14.6243 10.3146 14.7588 10.5298C14.8957 10.7416 15.0825 10.8952 15.3194 10.9907C15.5557 11.0833 15.8276 11.1016 16.135 11.0455C16.4453 10.989 16.717 10.8716 16.9501 10.6933C17.1828 10.5123 17.3621 10.2919 17.488 10.0321C17.6134 9.76959 17.6728 9.48585 17.6663 9.18094L17.5824 3.66043ZM28.2611 1.71333L28.4012 10.5589L26.6405 10.88L23.1503 6.39639L23.0916 6.40709L23.1693 11.5129L21.0941 11.8913L20.954 3.04567L22.7399 2.72004L26.2075 7.19908L26.2788 7.18608L26.1901 2.09094L28.2611 1.71333ZM4.24231 28.1783L4.10219 19.3327L9.96295 18.2641L9.98516 20.0013L6.19957 20.6916L6.23554 22.5043L9.64803 21.8821L9.67101 23.6235L6.25852 24.2457L6.31747 27.7999L4.24231 28.1783ZM11.933 26.776L9.70271 27.1827L12.4594 17.8089L15.2221 17.3051L18.2591 25.6225L16.0288 26.0292L13.9145 19.7787L13.8474 19.7909L11.933 26.776ZM11.5852 23.3481L16.247 22.4981L16.2661 24.1233L11.6043 24.9733L11.5852 23.3481ZM26.4764 18.4671L24.4054 18.8447C24.3768 18.6247 24.3205 18.4343 24.2363 18.2735C24.1516 18.1099 24.0407 17.9771 23.9037 17.875C23.7662 17.7701 23.6063 17.7011 23.4241 17.6679C23.2419 17.6347 23.0376 17.6387 22.8113 17.68C22.3781 17.759 22.005 17.9382 21.6921 18.2176C21.3792 18.497 21.1409 18.861 20.9772 19.3096C20.8136 19.7581 20.7359 20.2747 20.7444 20.8594C20.7576 21.423 20.8423 21.8797 20.9985 22.2295C21.1575 22.5788 21.3782 22.823 21.6605 22.9621C21.9424 23.0985 22.2748 23.1317 22.6577 23.0619C22.9064 23.0165 23.1316 22.9451 23.3333 22.8477C23.5373 22.747 23.7155 22.6235 23.8679 22.4774C24.0203 22.3312 24.1446 22.1656 24.2408 21.9805C24.3393 21.7922 24.4051 21.591 24.4383 21.3771L26.5261 20.9964C26.4914 21.3926 26.3895 21.7996 26.2202 22.2174C26.0532 22.6319 25.8184 23.0227 25.5157 23.3898C25.213 23.7568 24.842 24.0743 24.4028 24.342C23.9636 24.6098 23.4548 24.7965 22.8762 24.902C22.0853 25.0462 21.371 24.993 20.7333 24.7426C20.0985 24.4916 19.5925 24.0525 19.2153 23.4253C18.8405 22.7948 18.6436 21.9846 18.6249 20.9947C18.6089 20.0359 18.7692 19.1967 19.1057 18.4769C19.4451 17.7566 19.9106 17.1736 20.5022 16.7279C21.0965 16.2817 21.764 15.991 22.5047 15.856C23.0413 15.7581 23.5366 15.7429 23.9907 15.8103C24.4471 15.8743 24.8501 16.0174 25.1996 16.2396C25.5486 16.459 25.8322 16.7552 26.0504 17.1284C26.2714 17.501 26.4134 17.9473 26.4764 18.4671ZM27.362 16.8329L27.3398 15.0956L34.5966 13.7725L34.6188 15.5097L32.0154 15.9844L32.1333 23.0928L30.0875 23.4658L29.9696 16.3575L27.362 16.8329Z",fill:"inherit"})),Cc="FunFactMode";function Oc({activeIndex:e,startIndex:t,numOfIndicators:n,schema:i,slots:r}){var s,l,d;const p=Na(),y=f(),{tabIndex:m,styles:h,isDisabled:v}=It(p),g=Array(n+1).fill(i.indicator),[b,I]=c(new Set([t])),[E,S]=c(!1),w=Ei(0,(e=>e.customStates[Cc])),C=u((e=>b.has(e)||b.has(e-1)),[b]);o((()=>{I((t=>new Set([...t,e])))}),[e,w]),o((()=>{w&&S(!0)}),[w]);const O=()=>{y({type:nn,payload:{key:Cc,value:1}})},T=null===(l=null===(s=r[e])||void 0===s?void 0:s.offer)||void 0===l?void 0:l.creative,x=null===(d=null==T?void 0:T.images.creativeImage)||void 0===d?void 0:d.light;return n>0&&(L=n+t+1,(A=e)>=t&&A<=L)?a.createElement(Ki,null,(o=>a.createElement(Ao,{styles:i.styles},(i=>{var r;const s=i.classnames,l=t=>{var i,a,o,r;return t===n&&w?`${null==s?void 0:s.indicator} ${null!==(i=null==s?void 0:s.activeIndicator)&&void 0!==i?i:""}`:t!==e||w?b.has(t)||t===n&&E?`${null==s?void 0:s.indicator} ${null!==(o=null==s?void 0:s.seenIndicator)&&void 0!==o?o:""}`:t==e+1?`${null==s?void 0:s.indicator} ${null!==(r=null==s?void 0:s.clickableIndicator)&&void 0!==r?r:""}`:`${null==s?void 0:s.indicator}`:`${null==s?void 0:s.indicator} ${null!==(a=null==s?void 0:s.activeIndicator)&&void 0!==a?a:""}`};return a.createElement("div",{className:null!==(r=null==s?void 0:s.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row",gap:"8px"},h),"data-e2e":"ProgressIndicator",tabIndex:m,"aria-hidden":v},a.Children.toArray(g.map(((i,r)=>{return r===n?a.createElement("button",{onClick:E||e==n-1?O:void 0,className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",fill:w?"#101828":"#A3A3A3",cursor:E||e==n-1?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(i),a.createElement("div",{style:{marginTop:"3px",marginLeft:"2px"},"data-testid":"fun-fact-icon"},wc)):r!==e||w?a.createElement("button",{onClick:(s=r,()=>{C(s)&&(y({type:"PROGRESSION/INITIALISE",payload:{totalCount:n,currentGroupIndex:s,groupSize:1}}),w&&y({type:nn,payload:{key:Cc,value:0}}))}),className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:C(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`)):a.createElement("button",{className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:C(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),x?a.createElement("img",{src:x,style:{marginTop:"3px"}}):a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`));var s}))))})))):null;var A,L}const Tc=Sc(((e,t)=>{const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return a.createElement(Oc,Object.assign({},e,{slots:n,currentIndex:i,partnerColor:t}))})),xc=({children:e,partnerColor:t,schema:n})=>{var i;const o=Ci(),r=d((()=>Math.random()),[]),s=Wi((null!==(i=Ac[Math.floor(r*Ac.length)])&&void 0!==i?i:{text:"",header:""})||{},"funfact"),l=Be`
|
|
65
|
+
`,yc=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u},p){var y,f;const m=r(null),h=r(null),v=r(!0),g=n.styles?Ce(cc,n.styles):cc,b=Oi(),I=()=>{const e=h.current;if(!e)return 0;return Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0)};o((()=>{const e=new ResizeObserver((()=>{(()=>{const e=h.current;if(!e)return;const t=I();e.style.height=`${t}px`})(),v.current&&(()=>{const e=I(),t=m.current;t&&(v.current=!1,t.style.setProperty("transform",`translateY(${e}px)`),requestAnimationFrame((()=>{t.style.transition="transform 0.8s",t.style.setProperty("transform","translateY(0px)")})))})()}));return h.current&&Array.from(h.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const E=null===(f=null===(y=s[l])||void 0===y?void 0:y.offer)||void 0===f?void 0:f.creative,S=null==E?void 0:E.copy,w=qi(S||{})(xr.transformLinksToAnchorText(null==E?void 0:E.links),"creativeLink");return e(Lo,{styles:g,children:({classnames:o})=>{var r;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:m,children:t("div",{className:null==o?void 0:o.own,style:{height:"100%",position:"relative",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",border:"1px solid #D5D7DA",borderBottom:"none",margin:"0px -1px"},ref:d,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(lc,{}),e("div",{ref:h,className:pc,"aria-label":null!==(r=n.a11yLabel)&&void 0!==r?r:void 0,children:a.Children.toArray([e("div",{ref:u,style:{width:"100%"},children:b(n.children[0],void 0,Wt(0,i))},"0"),e(Zi,{value:w,children:e(ja,{value:Ra(E),children:e("div",{ref:c,style:{width:"100%"},children:S&&e("div",{children:b(n.children[1],void 0,Wt(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*fc(){(yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ke((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:nn,payload:{key:"Minimized",value:1}}))}Ql(dc);const mc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var hc;function vc({isOpen:t,schema:n,testId:i,children:r}){const s=mn(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(os))),d=f();o((()=>{l&&d({type:en,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),o((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const u=_a(),{tabIndex:p,isDisabled:y,styles:h}=It(u),v=n.styles?Ce(mc,n.styles):mc;if(!t)return null;const g=e(Ci,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(Lo,{styles:v,children:({classnames:t})=>{var a;return e("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"10000px",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto",flexDirection:"column",justifyContent:"flex-end"},h),"aria-label":null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:p,"data-testid":i,"data-e2e":"Overlay-Wrapper",children:r(g,s)})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(hc||(hc={}));const gc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const bc=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(gc,t.styles):gc;return e(Lo,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:"center"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const Ic=h((function(e){return{isOpen:e.active.has(as)}}))((function(t){return e(vc,Object.assign({},t,{children:(n,i)=>e(bc,Object.assign({},t,{ref:i,children:n}))}))})),Ec=Ql(dc),Sc={name:"minimized-bottomsheet-extension",sagas:function*(){yield Ye([Ze("OFFER_LIFECYCLE",fc)])},componentFactory:t=>"Overlay"===t.type?e(Ic,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(Ec,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const wc=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=(r=e.progression.totalCount,(s=e.progression.groupSize)<=0||r<=0||s>r?0:Math.ceil(r/s));let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}var r,s;return{numOfIndicators:0,activeIndex:0,startIndex:0}})),Cc=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"37",height:"29",viewBox:"0 0 37 29",fill:"inherit",style:{maxWidth:"44px",maxHeight:"32px",width:"100%",height:"100%"}},a.createElement("path",{d:"M5.62263 14.7123L5.48251 5.86667L11.3433 4.79804L11.3655 6.53531L7.57989 7.22555L7.61586 9.03828L11.0283 8.41606L11.0513 10.1575L7.63884 10.7797L7.69779 14.3339L5.62263 14.7123ZM17.5824 3.66043L19.6534 3.28282L19.745 8.98818C19.7555 9.64756 19.6126 10.2497 19.3164 10.7947C19.0224 11.3363 18.6042 11.7908 18.0619 12.1583C17.5191 12.5229 16.8858 12.7712 16.1619 12.9032C15.4352 13.0357 14.7983 13.019 14.2512 12.8531C13.7035 12.6844 13.2748 12.3843 12.9651 11.9527C12.6549 11.5184 12.4931 10.9717 12.4799 10.3129L12.3882 4.60752L14.4634 4.22914L14.5473 9.74965C14.5538 10.0546 14.6243 10.3146 14.7588 10.5298C14.8957 10.7416 15.0825 10.8952 15.3194 10.9907C15.5557 11.0833 15.8276 11.1016 16.135 11.0455C16.4453 10.989 16.717 10.8716 16.9501 10.6933C17.1828 10.5123 17.3621 10.2919 17.488 10.0321C17.6134 9.76959 17.6728 9.48585 17.6663 9.18094L17.5824 3.66043ZM28.2611 1.71333L28.4012 10.5589L26.6405 10.88L23.1503 6.39639L23.0916 6.40709L23.1693 11.5129L21.0941 11.8913L20.954 3.04567L22.7399 2.72004L26.2075 7.19908L26.2788 7.18608L26.1901 2.09094L28.2611 1.71333ZM4.24231 28.1783L4.10219 19.3327L9.96295 18.2641L9.98516 20.0013L6.19957 20.6916L6.23554 22.5043L9.64803 21.8821L9.67101 23.6235L6.25852 24.2457L6.31747 27.7999L4.24231 28.1783ZM11.933 26.776L9.70271 27.1827L12.4594 17.8089L15.2221 17.3051L18.2591 25.6225L16.0288 26.0292L13.9145 19.7787L13.8474 19.7909L11.933 26.776ZM11.5852 23.3481L16.247 22.4981L16.2661 24.1233L11.6043 24.9733L11.5852 23.3481ZM26.4764 18.4671L24.4054 18.8447C24.3768 18.6247 24.3205 18.4343 24.2363 18.2735C24.1516 18.1099 24.0407 17.9771 23.9037 17.875C23.7662 17.7701 23.6063 17.7011 23.4241 17.6679C23.2419 17.6347 23.0376 17.6387 22.8113 17.68C22.3781 17.759 22.005 17.9382 21.6921 18.2176C21.3792 18.497 21.1409 18.861 20.9772 19.3096C20.8136 19.7581 20.7359 20.2747 20.7444 20.8594C20.7576 21.423 20.8423 21.8797 20.9985 22.2295C21.1575 22.5788 21.3782 22.823 21.6605 22.9621C21.9424 23.0985 22.2748 23.1317 22.6577 23.0619C22.9064 23.0165 23.1316 22.9451 23.3333 22.8477C23.5373 22.747 23.7155 22.6235 23.8679 22.4774C24.0203 22.3312 24.1446 22.1656 24.2408 21.9805C24.3393 21.7922 24.4051 21.591 24.4383 21.3771L26.5261 20.9964C26.4914 21.3926 26.3895 21.7996 26.2202 22.2174C26.0532 22.6319 25.8184 23.0227 25.5157 23.3898C25.213 23.7568 24.842 24.0743 24.4028 24.342C23.9636 24.6098 23.4548 24.7965 22.8762 24.902C22.0853 25.0462 21.371 24.993 20.7333 24.7426C20.0985 24.4916 19.5925 24.0525 19.2153 23.4253C18.8405 22.7948 18.6436 21.9846 18.6249 20.9947C18.6089 20.0359 18.7692 19.1967 19.1057 18.4769C19.4451 17.7566 19.9106 17.1736 20.5022 16.7279C21.0965 16.2817 21.764 15.991 22.5047 15.856C23.0413 15.7581 23.5366 15.7429 23.9907 15.8103C24.4471 15.8743 24.8501 16.0174 25.1996 16.2396C25.5486 16.459 25.8322 16.7552 26.0504 17.1284C26.2714 17.501 26.4134 17.9473 26.4764 18.4671ZM27.362 16.8329L27.3398 15.0956L34.5966 13.7725L34.6188 15.5097L32.0154 15.9844L32.1333 23.0928L30.0875 23.4658L29.9696 16.3575L27.362 16.8329Z",fill:"inherit"})),Oc="FunFactMode";function Tc({activeIndex:e,startIndex:t,numOfIndicators:n,schema:i,slots:r}){var s,l,d;const p=_a(),y=f(),{tabIndex:m,styles:h,isDisabled:v}=It(p),g=Array(n+1).fill(i.indicator),[b,I]=c(new Set([t])),[E,S]=c(!1),w=Si(0,(e=>e.customStates[Oc])),C=u((e=>b.has(e)||b.has(e-1)),[b]);o((()=>{I((t=>new Set([...t,e])))}),[e,w]),o((()=>{w&&S(!0)}),[w]);const O=()=>{y({type:nn,payload:{key:Oc,value:1}})},T=null===(l=null===(s=r[e])||void 0===s?void 0:s.offer)||void 0===l?void 0:l.creative,x=null===(d=null==T?void 0:T.images.creativeImage)||void 0===d?void 0:d.light;return n>0&&(L=n+t+1,(A=e)>=t&&A<=L)?a.createElement(Yi,null,(o=>a.createElement(Lo,{styles:i.styles},(i=>{var r;const s=i.classnames,l=t=>{var i,a,o,r;return t===n&&w?`${null==s?void 0:s.indicator} ${null!==(i=null==s?void 0:s.activeIndicator)&&void 0!==i?i:""}`:t!==e||w?b.has(t)||t===n&&E?`${null==s?void 0:s.indicator} ${null!==(o=null==s?void 0:s.seenIndicator)&&void 0!==o?o:""}`:t==e+1?`${null==s?void 0:s.indicator} ${null!==(r=null==s?void 0:s.clickableIndicator)&&void 0!==r?r:""}`:`${null==s?void 0:s.indicator}`:`${null==s?void 0:s.indicator} ${null!==(a=null==s?void 0:s.activeIndicator)&&void 0!==a?a:""}`};return a.createElement("div",{className:null!==(r=null==s?void 0:s.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row",gap:"8px"},h),"data-e2e":"ProgressIndicator",tabIndex:m,"aria-hidden":v},a.Children.toArray(g.map(((i,r)=>{return r===n?a.createElement("button",{onClick:E||e==n-1?O:void 0,className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",fill:w?"#101828":"#A3A3A3",cursor:E||e==n-1?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(i),a.createElement("div",{style:{marginTop:"3px",marginLeft:"2px"},"data-testid":"fun-fact-icon"},Cc)):r!==e||w?a.createElement("button",{onClick:(s=r,()=>{C(s)&&(y({type:"PROGRESSION/INITIALISE",payload:{totalCount:n,currentGroupIndex:s,groupSize:1}}),w&&y({type:nn,payload:{key:Oc,value:0}}))}),className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:C(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`)):a.createElement("button",{className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:C(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),x?a.createElement("img",{src:x,style:{marginTop:"3px"}}):a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`));var s}))))})))):null;var A,L}const xc=wc(((e,t)=>{const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return a.createElement(Tc,Object.assign({},e,{slots:n,currentIndex:i,partnerColor:t}))})),Ac=({children:e,partnerColor:t,schema:n})=>{var i;const o=Oi(),r=d((()=>Math.random()),[]),s=qi((null!==(i=Lc[Math.floor(r*Lc.length)])&&void 0!==i?i:{text:"",header:""})||{},"funfact"),l=Be`
|
|
66
66
|
display: inline;
|
|
67
67
|
margin: 8px 16px;
|
|
68
68
|
p {
|
|
@@ -72,7 +72,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
72
72
|
font-size: 24px;
|
|
73
73
|
font-weight: 600;
|
|
74
74
|
color: ${t};
|
|
75
|
-
`;return a.createElement(
|
|
75
|
+
`;return a.createElement(Zi,{value:s},a.createElement(Lo,{styles:n.styles},(t=>{const n=t.classnames;return a.createElement(a.Fragment,null,a.Children.toArray(null==e?void 0:e.map(((e,t)=>a.createElement("div",{className:`${l} ${null==n?void 0:n.own}`},0===t?a.createElement(a.Fragment,null,a.createElement("p",{className:`${c} ${null==n?void 0:n.own}`},"Did you know...")," ",a.createElement("span",{className:`${null==n?void 0:n.own}`},o(e))):a.createElement("span",{className:`${null==n?void 0:n.own}`},o(e)))))))})))},Lc=[{header:"the Eiffel Tower can grow taller in summer?",text:"The heat causes the metal to expand, adding up to six inches to its height."},{header:"flamingos aren't born pink?",text:"Their feathers turn pink from eating shrimp and algae rich in carotenoids."},{header:"bananas are berries, but strawberries aren't?",text:"Botanically, strawberries are aggregate fruits, while bananas meet all the criteria for a true berry."},{header:"a day on Venus is longer than a year on Venus?",text:"It takes Venus 243 Earth days to rotate once but only 225 Earth days to orbit the Sun."},{header:"sea cucumbers can eject their guts when threatened?",text:"This defense mechanism helps them escape predators and they regenerate the lost organs later."},{header:"prunes used to be said instead of cheese for photos?",text:'In the 1840s, people said "prunes" to maintain a tight-lipped expression instead of smiling.'},{header:"some frogs can freeze solid and survive?",text:"Species like wood frogs produce special proteins that prevent ice from damaging their cells."},{header:"Venus is the only planet that spins clockwise?",text:"Its unusual rotation direction makes it stand out among other planets in our solar system."},{header:"cats have 230 bones while humans have only 206?",text:"Their extra bones make them incredibly flexible jumpers and climbers."},{header:"the Statue of Liberty once functioned as a lighthouse?",text:"From 1886 to 1902, its light could be seen up to 24 miles away."},{header:"the first commercial flight lasted just 23 minutes?",text:"It flew between St. Petersburg and Tampa, Florida, in 1914."},{header:"octopuses have blue blood and nine brains?",text:"Their unique blood helps them survive in low-oxygen environments, and each arm has its own mini-brain."},{header:"hummingbirds can fly backward?",text:"They're the only birds capable of this agile movement thanks to their unique wing structure."},{header:"gorillas burp when they're happy?",text:"It's one of their ways of expressing contentment and relaxation."},{header:"Australia is wider than the Moon?",text:"Australia spans about 2,485 miles across, while the Moon's diameter is only about 2,159 miles."},{header:"ants can carry up to 50 times their body weight?",text:"These tiny insects are incredibly strong for their size due to their muscle structure."},{header:"lightning is five times hotter than the surface of the Sun?",text:"A single bolt can reach temperatures of up to 50,000 degrees Fahrenheit."},{header:"sharks are the only fish that can blink with both eyes?",text:"They have an extra eyelid called a nictitating membrane for protection during attacks or feeding."},{header:"octopuses have three hearts?",text:"Two pump blood to the gills, while the third pumps it to the rest of the body—and it stops beating when they swim."},{header:"a group of flamingos is called a flamboyance?",text:"Their bright pink color and synchronized movements make this name quite fitting."},{header:"honey never spoils?",text:"Archaeologists have found pots of honey in ancient Egyptian tombs that are still edible."},{header:"cats can't taste sweetness?",text:"Their taste buds lack the receptors for sugary flavors, which might explain their disinterest in desserts."},{header:"a crocodile can't stick out its tongue?",text:"A special membrane holds their tongue in place, helping them swallow prey underwater."},{header:"sea otters hold hands while they sleep?",text:"This keeps them from drifting apart in the water, especially when they're napping in groups."},{header:"bananas glow blue under black light?",text:"This happens because of the way their peel breaks down as they ripen."},{header:"a watermelon is 92% water?",text:"That's why it's such a refreshing snack on a hot day!"},{header:"butterflies taste with their feet?",text:"Their taste sensors are located on their legs, helping them identify suitable plants for laying eggs."},{header:"an ostrich's eye is bigger than its brain?",text:"This might explain why these birds rely more on instinct than intelligence."},{header:"kangaroos can't walk backward?",text:"Their muscular tails and body structure make this movement impossible."},{header:"avocados are fruits, not vegetables?",text:"They're technically berries because of their fleshy pulp and single seed."},{header:"dolphins have names for each other?",text:"They use unique whistles to identify and call out to specific individuals in their pods."},{header:'the Hollywood sign originally said "Hollywoodland"?',text:"It was installed in 1923 as an advertisement for a real estate development."},{header:"giraffe tongues can be up to 20 inches long?",text:"Their dark color helps protect them from sunburn while reaching for leaves."},{header:"M&M's were the first candy eaten in space?",text:"Astronauts love them because they don't crumble and create messes in zero gravity."},{header:"starfish don't have brains?",text:"They rely on a simple nervous system to sense their surroundings and move around."},{header:"peanuts are legumes, not nuts?",text:"They grow underground like beans and peas, making them part of the legume family."},{header:"the shortest war in history lasted only 38 minutes?",text:"It was between Britain and Zanzibar on August 27, 1896."},{header:"clouds can weigh over a million pounds?",text:"Despite their massive weight, the water droplets are spread out enough to float in the air!"}];function*Nc(){(yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ke((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:nn,payload:{key:"FunFactMode",value:1}}))}const _c={name:"logo-clickable-progression-extension",sagas:function*(){yield Ye([Ze("OFFER_LIFECYCLE",Nc)])},componentFactory:e=>e?"fun-fact"===e.variant?a.createElement(Ac,{partnerColor:e.partnerColor,schema:e},e.children):a.createElement(xc,{schema:Object.assign(Object.assign({},e),{indicator:""}),partnerColor:e.partnerColor}):a.createElement("div",null,"Could not render Logo Clickable Progression"),interceptors:{}};const Rc=Be`
|
|
76
76
|
height: 20px;
|
|
77
77
|
border-radius: 4px;
|
|
78
78
|
width: 100%;
|
|
@@ -81,40 +81,40 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
81
81
|
background-size: 200% 100%;
|
|
82
82
|
animation: 1.5s ${Ve`to { background-position-x: -200%; }`} linear
|
|
83
83
|
infinite;
|
|
84
|
-
`,Rc=Be`
|
|
85
|
-
width: 75%;
|
|
86
84
|
`,Dc=Be`
|
|
85
|
+
width: 75%;
|
|
86
|
+
`,kc=Be`
|
|
87
87
|
height: 40px;
|
|
88
88
|
width: 200px;
|
|
89
|
-
`,
|
|
89
|
+
`,Pc=Be`
|
|
90
90
|
width: 150px;
|
|
91
|
-
`;function
|
|
91
|
+
`;function jc({hasLoaded:e,animationSpeedMS:t,styles:n}){const[i,r]=c(!0);return o((()=>{if(e){const e=setTimeout((()=>{r(!1)}),t);return()=>clearTimeout(e)}return()=>null}),[e]),i?a.createElement("div",{"data-testid":"skeleton",className:Be(Object.assign({height:"100%"},null==n?void 0:n.skeleton))},a.createElement("div",{className:Be`
|
|
92
92
|
padding: 30px 24px;
|
|
93
93
|
display: flex;
|
|
94
94
|
flex-direction: column;
|
|
95
95
|
gap: 16px;
|
|
96
96
|
height: inherit;
|
|
97
97
|
justify-content: center;
|
|
98
|
-
`},a.createElement("div",{className:
|
|
98
|
+
`},a.createElement("div",{className:Rc}),a.createElement("div",{className:Rc}),a.createElement("div",{className:Rc}),a.createElement("div",{className:Ue(Rc,Dc)}),a.createElement("div",{className:Be`
|
|
99
99
|
display: flex;
|
|
100
100
|
gap: 16px;
|
|
101
101
|
align-items: center;
|
|
102
|
-
`},a.createElement("div",{className:Ue(
|
|
102
|
+
`},a.createElement("div",{className:Ue(Rc,kc)}),a.createElement("div",{className:Ue(Rc,Pc)})))):null}function $c({styles:e,hasLoaded:t,partnerText:n,animationSpeedMS:i}){if(!Array.isArray(n)||!(null==n?void 0:n.length))throw new Error("partnerText must be an string[]");const[r,s]=c(!0);return o((()=>{if(t){const e=setTimeout((()=>{s(!1)}),i);return()=>clearTimeout(e)}return()=>null}),[t]),r?a.createElement("div",{"data-testid":"partner-text",className:Be(Object.assign({height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:t?0:1,transition:`opacity ${i}ms ease-in-out`},null==e?void 0:e.partnerText))},n?a.Children.toArray(n.map((e=>a.createElement("p",{className:Be`
|
|
103
103
|
font-weight: 600;
|
|
104
104
|
font-size: 14px;
|
|
105
105
|
line-height: 21px;
|
|
106
106
|
padding: 0 16px;
|
|
107
|
-
`},e)))):null):null}const
|
|
107
|
+
`},e)))):null):null}const Gc=Ve`
|
|
108
108
|
0% { width: 0; }
|
|
109
109
|
100% { width: 100%; }
|
|
110
|
-
}`;function
|
|
110
|
+
}`;function Fc(e){const[t,n]=c(!1),[i,r]=c(!1),s=f(),l=Oi(),{type:d,children:u,durationMS:p,styles:y,partnerText:m,animationSpeedMS:h}=e.data;let v=null;switch(d){case"skeleton":v=a.createElement(jc,{hasLoaded:t,animationSpeedMS:h,styles:y});break;case"partnerText":v=a.createElement($c,{partnerText:m,hasLoaded:t,animationSpeedMS:h,styles:y})}return o((()=>{let e=null;const t=setTimeout((()=>{n(!0),e=setTimeout((()=>{r(!0)}),h)}),1.25*p);return()=>{t&&clearTimeout(t),e&&clearTimeout(e)}}),[p,s]),a.createElement("div",{"data-testid":"Loading"},a.createElement("div",{className:Be`
|
|
111
111
|
position: relative;
|
|
112
112
|
`},a.createElement("div",{className:Be`
|
|
113
113
|
height: 4px;
|
|
114
114
|
background-color: ${(null==y?void 0:y.primaryColor)||"#7F56D9"};
|
|
115
115
|
position: absolute;
|
|
116
116
|
top: 0;
|
|
117
|
-
animation: ${
|
|
117
|
+
animation: ${Gc} ${p}ms linear forwards;
|
|
118
118
|
transition: opacity ${h}ms ease-in-out;
|
|
119
119
|
opacity: ${t?0:1};
|
|
120
120
|
`}),a.createElement("div",{className:Be`
|
|
@@ -133,7 +133,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
133
133
|
z-index: 10;
|
|
134
134
|
transition: opacity ${h}ms ease-in-out;
|
|
135
135
|
${i?"\n opacity: 1;\n user-select: auto;\n pointer-events: auto;\n ":"\n opacity: 0;\n user-select: none;\n pointer-events: none;\n "}
|
|
136
|
-
`},a.Children.toArray(u.map((e=>l(e))))))))}const Fc={name:"loading-extension",componentFactory:e=>a.createElement(Gc,{data:e}),interceptors:{}},Mc=1e3;function Bc(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/Mc,a=r(null),s=()=>{const t=(new Date).getTime()/Mc;n(Math.max(Math.floor(e-(t-i)),0))};return o((()=>(a.current=setInterval(s,Mc),()=>{a.current&&"number"==typeof a.current&&clearInterval(a.current)})),[]),{minutes:Math.floor(t/60).toString(),seconds:Math.floor(Math.min(t%60,59)).toLocaleString("en-US",{minimumIntegerDigits:2,maximumFractionDigits:0,useGrouping:!1}),timeRemaining:t,restartTimer:function(){a.current&&"number"==typeof a.current&&clearInterval(a.current),n(e),a.current=setInterval(s,Mc)}}}((null==t?void 0:t.duration)||300),d=m((e=>{const t=g(["progression","currentGroupIndex"],e);return"number"==typeof t?t:0})),u=f();o((()=>{l()}),[d]),o((()=>{0===s&&(u({type:en,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=Na(),{tabIndex:y,styles:h,isDisabled:v}=It(p);return a.createElement("p",{tabIndex:y,style:Object.assign(Object.assign({},null==t?void 0:t.styles),h),"aria-hidden":v,"data-e2e":"Timer"},`${n}:${i}`)}const Uc={name:"timer-progression-extension",componentFactory:e=>a.createElement(Bc,{data:e}),interceptors:{}},Vc="MODULE/ADD_LOADED",zc="MODULE/LOAD",Hc="PROGRESSION/INITIALISE",Wc="PROGRESSION/NEXT",qc="PROGRESSION/PREV",Jc="PROGRESSION/UPDATE_GROUP_SIZE",Kc="PROGRESSION/PROCESS",Yc="SLOTS/SET",Zc="INSTANT_PURCHASE/DISMISS",Qc="OFFER_LIFECYCLE",Xc="DOMAIN_STATES/SET",ed="OFFER_ENGAGEMENT",td="GLOBAL_OFFER_DATA_STATE/SET_CART",nd=Object.assign(Object.assign({},ts),{NEXT_IN_PROGRESSION:Wc,PREV_IN_PROGRESSION:qc,INITIALISE_PROGRESSION:Hc,UPDATE_GROUP_SIZE:Jc,SET_SLOTS:Yc,ADD_LOADED_MODULE:Vc,SET_DOMAIN_STATE:Xc,SET_GLOBAL_OFFER_DATA_CART:td}),id=Object.assign(Object.assign({},ns),{LOAD_MODULES:zc,DISMISS_INSTANT_PURCHASE:Zc,PROCESS_PROGRESSION:Kc,OFFER_LIFECYCLE:Qc,OFFER_ENGAGEMENT:ed,SET_PARTNER_VALIDATION_STATUS:sn});function ad(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function od(e,t){const n=[];if(t<=0||e<=0||t>e)throw Error(`Could not generate the progression groups with groupSize: ${t} and totalCount: ${e}`);for(let i=0;i<ad(e,t);i++){const a=[];for(let n=0;n<t;n++)a.push(Math.min(i*t+n,e-1));n.push([...new Set(a)])}return n}const rd=Symbol("root");function sd(){return{[rd]:{}}}const ld=Object.assign({progression:function(e=null,t){switch(t.type){case Hc:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<ad(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:od(e,i)})}return null;case Jc:{const{groupSize:n}=t.payload,i=null==e?void 0:e.totalCount;return i&&n<=i&&n>0?Object.assign(Object.assign({},e),{groupSize:n,indexGroups:od(i,n),currentGroupIndex:0}):null}case Wc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.min(i+1,ad(t,n)-1)}):null}case qc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.max(i-1,0)}):null}default:return e}},slots:function(e=[],t){return t.type===Yc?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===Vc?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=sd(),t){if(t.type===Xc){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:rd;return n===rd?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[rd]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===td){if(t.payload.cart){const n=`module${t.payload.offerPositionIndex}`;return Object.assign(Object.assign({},e),{[n]:{cart:t.payload.cart}})}return e}return e}},il);function cd(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:Ws(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:qs(),fonts:[],signal:{queue:[],processed:[]},serializableCache:nl(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:sd(),globalOfferDataState:{}}),e)}function dd(e){var t;return!!e.progression&&(1===e.progression.groupSize&&e.progression.currentGroupIndex===(null===(t=e.progression)||void 0===t?void 0:t.totalCount)-1)}function ud(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:ad(e.progression.totalCount,e.progression.groupSize),isLast:dd(e)}:null}function pd(e,t){return e.domainStates[`module${t}`]||{offerComplete:0}}function yd(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>t.cart?e+t.cart.reduce(((e,t)=>e+t.quantity),0):e),0)}function fd(i){var a;const{config:o,position:r,visible:s,container:c,testId:d}=i,u=Va(),p=Na(),y=m(Js),f=l(za),h=`rokt-${o.layoutVariant.moduleName}-${u}`;return t(n,{children:[!s&&e("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},"aria-hidden":"true"}),e(h,{style:{display:"flex",flexDirection:"column"===c?"column":"row",width:"100%"},slotInstanceGuid:o.instanceGuid,layoutSchema:JSON.stringify(o.layoutVariant.layoutVariantSchema),schemaVersion:f,childLayouts:JSON.stringify(null!==(a=o.layoutVariant.childLayouts)&&void 0!==a?a:[]),offerData:JSON.stringify(o.offer),offerPositionIndex:r,visible:s,container:c,interactivity:p,"data-testid":d,"data-e2e":`OfferSlot-${r}`,"aria-hidden":!s,"module-component":!0,"plugin-id":u,"active-breakpoint":Ht(y)})]})}function md({schema:t,testId:n}){const i=t.styles,o=m((e=>e.slots)),s=r(null),l=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),c=Na(),{tabIndex:d,isDisabled:u,styles:p}=It(c);return o.length&&o[l]?e(Ao,{styles:i,children:({classnames:i})=>e("div",{ref:s,"data-testid":n,"data-e2e":"OneByOneDistribution",className:null==i?void 0:i.own,tabIndex:d,"aria-hidden":u,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},p),children:a.Children.toArray(o.map(((n,i)=>e(Dr,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(fd,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const hd=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=ad(e.progression.totalCount,e.progression.groupSize);let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}return{numOfIndicators:0,activeIndex:0,startIndex:0}}))((function({activeIndex:t,startIndex:n,numOfIndicators:a,schema:o}){const r=Na(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=Array(a).fill(o.indicator);return a>0&&(p=a+n-1,(u=t)>=n&&u<=p)?e(Ki,{children:a=>e(Ao,{styles:o.styles,children:o=>{var r;const u=o.classnames,p=e=>{var n,i;return e===t?`${null==u?void 0:u.indicator} ${(null==u?void 0:u.activeIndicator)?u.activeIndicator:null!==(n=null==u?void 0:u.seenIndicator)&&void 0!==n?n:""}`:e<t?`${null==u?void 0:u.indicator} ${null!==(i=null==u?void 0:u.seenIndicator)&&void 0!==i?i:""}`:null==u?void 0:u.indicator};return e("div",{className:null!==(r=null==u?void 0:u.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row"},l),"data-e2e":"ProgressIndicator",tabIndex:s,"aria-hidden":c,children:i.Children.toArray(d.map(((t,i)=>e("span",{className:p(i+n),style:{display:"flex"},children:a({state:{indicatorPosition:String(i+1+n)}})(t)}))))})}})}):null;var u,p}));const vd="partnerValidationUI",gd="stackedViewableItems";function bd(t){var n;const i=f(),r=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=go(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=G((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||r.length}),Re((([e,t])=>t)),ne)(l);o((()=>{i({type:Wr,payload:{key:gd,value:String(c)}})}),[c]);const d=r.slice(0,c),u=Na(),{tabIndex:p,isDisabled:y,styles:h}=It(u);return(null==d?void 0:d.length)>0?e(Ao,{styles:t.schema.styles,children:({classnames:n})=>e("div",{"data-testid":t.testId,"data-e2e":"StackedDistribution",className:null==n?void 0:n.own,"aria-hidden":y,tabIndex:p,style:Object.assign({display:"flex",flexDirection:"column"},h),children:a.Children.toArray(d.map(((t,n)=>e(fd,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function Id(t){const n=t.schema.styles,i=f(),o=Na(),r="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:s,styles:l,isDisabled:c}=It(o),d=()=>{i({type:"Backward"===t.schema.direction?nd.PREV_IN_PROGRESSION:nd.NEXT_IN_PROGRESSION})};return e(Ao,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:r,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:r,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(wi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function Ed({schema:t,testId:n}){var i,r,s,l,c,d,u,p,y;const h=m((e=>e.progression)),v=null==h?void 0:h.indexGroups[null==h?void 0:h.currentGroupIndex],g=null!==(i=null==h?void 0:h.currentGroupIndex)&&void 0!==i?i:0,b=m((e=>e.slots)),I=m(Qs),E=t.viewableItems.length-1,[S,w]=ht({slidesToScroll:null!==(r=t.viewableItems[Math.min(I,E)])&&void 0!==r?r:"auto",containScroll:"trimSnaps"}),C=f(),O=Na(),{tabIndex:T,isDisabled:x,styles:A}=It(O),L=`${null!==(p=null===(u=null===(d=null===(c=null===(l=null===(s=t.styles)||void 0===s?void 0:s.elements)||void 0===l?void 0:l.own[I])||void 0===c?void 0:c.default)||void 0===d?void 0:d.container)||void 0===u?void 0:u.gap)&&void 0!==p?p:"0"}px`;o((()=>{function e(e){var t,n;const i=null!==(t=null==e?void 0:e.selectedScrollSnap())&&void 0!==t?t:0,a=null!==(n=null==e?void 0:e.previousScrollSnap())&&void 0!==n?n:0;i!==g&&(i>a?C({type:nd.NEXT_IN_PROGRESSION}):i<a&&C({type:nd.PREV_IN_PROGRESSION}))}return null!=g&&(null==w||w.on("select",e),null==w||w.scrollTo(g)),()=>{null==w||w.off("select",e)}}),[w,g,C]);const N={overflow:"hidden"},_={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:L,alignItems:"stretch"},R=e=>{var t;return null!==(t=null==v?void 0:v.includes(e))&&void 0!==t&&t},D=t.peekThroughSize[Math.min(I,t.peekThroughSize.length-1)],k=D?"Fixed"===(P=D).type?`${P.value}px`:`${P.value}%`:"0px";var P;const j=null!==(y=t.viewableItems[Math.min(E,I)])&&void 0!==y?y:1,$={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(k)?`(100% - 2 * ${k} - (${j} + 1) * ${L})/${j}`:`(100% - (${j} - 1) * ${L})/${j}`})`,position:"relative",display:"flex",overflow:"auto"};return(null==b?void 0:b.length)>0?e(Ao,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign({},N),A),"aria-disabled":x,tabIndex:T,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:_,"data-testid":n&&`${n}-container`,"data-e2e":"CarouselDistribution-Container",children:a.Children.toArray(b.map(((t,i)=>e("div",{style:$,"data-testid":n&&`${n}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`,children:e(fd,{config:t,position:i,container:"row",visible:R(i)})}))))})})}):null}function Sd({schema:t,testId:n}){const i=Va(),o=d((()=>yi(i)([{display:"flex",flexDirection:"column"}])),[i]),s=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.groupSize)||0})),l=m((e=>{var t;return((null===(t=e.progression)||void 0===t?void 0:t.indexGroups)||[]).map((t=>t.map((t=>e.slots[t])).filter((e=>null!=e))))})),c=r(null),u=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),p=Na(),{tabIndex:y,isDisabled:f,styles:h}=It(p);return l.length?e(Ao,{styles:t.styles,children:({classnames:i})=>e("div",{ref:c,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":f,tabIndex:y,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},h),children:a.Children.toArray(l.map(((r,l)=>e(Dr,{effect:t.transition,visible:l===u,parentElement:c.current,containerClassName:[o,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,children:a.Children.toArray(r.map(((t,i)=>{const a=s*l+i;return e(fd,{config:t,position:a,visible:l===u,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const wd={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",External:"External"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"},conversionType:{Default:"Default",RealTime:"RealTime"}};function Cd(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function Od(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:V(Td,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new Pt("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:Cd("Creative",e.instanceGuid,t)}}function Td(e){try{let t,n;e.urlBehavior&&(t=wd.urlBehavior[e.urlBehavior]),e.conversionType&&(n=wd.conversionType[e.conversionType]);return Object.assign(Object.assign({},e),{urlBehavior:t,action:wd.action[e.action],signalType:wd.signalType[e.signalType],conversionType:n})}catch(t){throw t.message?t:Cd("CreativeResponse",e.instanceGuid)}}function xd(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function Ad(){o((()=>{const e=new ResizeObserver(function(e=100){let t;return()=>{t&&clearTimeout(t),t=setTimeout((()=>{var e,n;null===(n=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===n||n.resize(),t=void 0}),e)}}());return e.observe(document.body),()=>{e.disconnect()}}),[])}const Ld={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(md,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(bd,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(hd,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(Id,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(us,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(os,{schema:t.node})},EscapeHatch:(Nd=[function(t,n){if(Et("CloseButton",t)){const n=JSON.parse(t.node.data);return e(os,{schema:n.node,action:n.action})}},mr],e=>Nd.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(Ed,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(Sd,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(ms,{schema:t.node})}};var Nd;function _d(e,t){e({type:en,payload:{name:"SignalActivation",parentGuid:t}})}function Rd({pageInstanceGuid:t}){var n,i,a,r,s,l;const c=m((e=>e.layout),j),d=f(),u=m((e=>({breakpoint:e.breakpoint,progression:ud(e),customStates:e.customStates.root,domainStates:e.domainStates[rd]})),j),p=m((e=>e.slots.length)),y=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(gd))&&void 0!==t?t:"");return p-n})),h=m(yd);yn(xi(),d),o((()=>(c&&document.body.addEventListener("click",_d.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",_d.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),Ad(),o((()=>{if(c){const e={type:en,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:Xr,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:id.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const o=Wi({})({state:{progression:(null!==(i=null===(n=u.progression)||void 0===n?void 0:n.activeGroupIndex)&&void 0!==i?i:0)+1,maxProgression:null!==(r=null===(a=u.progression)||void 0===a?void 0:a.totalGroups)&&void 0!==r?r:1,availableOffersCount:null!==(l=null===(s=u.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:p,selectedCatalogItemQuantity:h,hiddenItemCount:y}}),f=Or(v);return e(Ga,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(Yi,{value:o,children:e(Oi,{value:f,overrides:Ld,children:e(Ii.Provider,{value:u,children:e(gi.Provider,{value:d,children:e(ea.Provider,{value:"OUTER",children:e(za.Provider,{value:c.layoutSchemaVersion,children:e(wi,{children:e=>e(c.layoutSchema)})})})})})})})})}return null}var Dd=Object.freeze({__proto__:null,getDistribution:function e(t){var n;switch(t.type){case"OneByOneDistribution":case"StackedDistribution":case"CarouselDistribution":case"GroupedDistribution":return t;case"Row":case"Column":case"When":case"ZStack":case"FlowRow":case"InlineContainer":case"ScrollableRow":case"ScrollableColumn":case"BottomSheet":case"Overlay":for(const n of t.node.children){const t=e(n);if(t)return t}break;case"EscapeHatch":try{const{name:i,body:a}=JSON.parse(t.node.data);if(("loading-extension"===i||"minimized-bottomsheet-extension"===i)&&(null===(n=null==a?void 0:a.children)||void 0===n?void 0:n.length))for(const t of a.children){const n=e(t);if(n)return n}break}catch(e){break}case"StaticImage":case"DataImage":case"RichText":case"BasicText":case"ProgressIndicator":case"CreativeResponse":case"StaticLink":case"CloseButton":case"ProgressControl":case"StaticIcon":case"DataIcon":case"SlideStateTrigger":case"ToggleButtonStateTrigger":case"TimerStateTrigger":case"CatalogStackedCollection":case"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":case"PartnerEventButtonTrigger":case"CopyToClipboardButton":break;default:!function(e){throw Error(`Could not handle layout: ${JSON.stringify(e)}`)}(t)}},getDistributionViewableItems:function(e){switch(null==e?void 0:e.type){case"CarouselDistribution":case"GroupedDistribution":return e.node.viewableItems;default:return}}}),kd=Object.assign({},Dd);function*Pd(e,t){const n=kd.getDistribution(t),i=null==n?void 0:n.type,a=yield Ke(Qs),o=function(e=0,t){var n;switch(null==t?void 0:t.type){case"CarouselDistribution":case"GroupedDistribution":{const i=Math.min(t.node.viewableItems.length,e);return null!==(n=t.node.viewableItems[i])&&void 0!==n?n:1}default:return 1}}("number"==typeof a?a:0,n);"OneByOneDistribution"!==i&&"CarouselDistribution"!==i&&"GroupedDistribution"!==i||(yield yt({type:nd.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:o}}))}function*jd(e,t){const{instanceGuid:n,layoutSchemaVersion:i,outerLayoutSchema:a,slots:o}=t.payload;n?yield yt({type:en,payload:{name:"SignalLoadComplete",parentGuid:n}}):yield yt({type:Qr,payload:{level:Is,code:ks,message:"Layout instance guid does not exist"}}),yield yt({type:zc,payload:{modules:o.map((e=>e.layoutVariant.moduleName))}}),yield yt({type:Fr,payload:a.breakpoints}),yield yt({type:nd.LAYOUT_UPDATE,payload:{instanceGuid:n,layoutSchemaVersion:i,layoutSchema:a.layout,settings:a.settings}}),yield yt({type:nd.SET_SLOTS,payload:o}),ce(a.settings)||(yield yt({type:nd.SET_SETTINGS,payload:a.settings})),yield*Pd(o.length,a.layout);const r=yield*function*(e,t,n){const i=null==t?void 0:t.enablePartnerValidation,a=["add-to-cart"],o=n.some((e=>a.some((t=>t===e.layoutVariant.moduleName))));if(i&&o)try{yield pt(e.send,dl.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt($d,e,dl.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:vd}})))}catch(e){return yield yt({type:Qr,payload:{level:bs,code:js,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,a.settings,o);"OK"===r&&(yield pt(Nl,e.display,a.display))}function*$d(e,t,n){const i=st((i=>{const a=e.onEvent(t).subscribe((e=>{i(n(e))}));return()=>{a.unsubscribe()}}));for(;;){const e=yield ft(i);yield yt(e)}}function Gd(e){return Ou(e)}function Fd(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const Md=ae(te([function(e){return"Row"===e.type&&zd(e.node.children)},function(e){return"Column"===e.type&&zd(e.node.children)},Jd,Kd])),Bd=ae(te([function(e){return"Row"===e.type&&Hd(e.node.children)},function(e){return"Column"===e.type&&Hd(e.node.children)},Kd,Jd,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&Hd(e.node.children)}])),Ud=ae(te([function(e){return"Row"===e.type&&Wd(e.node.children)},function(e){return"Column"===e.type&&Wd(e.node.children)},Kd,Jd])),Vd=ae(te([function(e){return"Row"===e.type&&qd(e.node.children)},function(e){return"Column"===e.type&&qd(e.node.children)},Jd,function(e){return"RichText"===e.type},Kd,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&qd(e.node.children)},function(e){return"StaticLink"===e.type&&qd(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&qd(e.node.children)}]));function zd(e){return Md(e)}function Hd(e){return Bd(e)}function Wd(e){return Ud(e)}function qd(e){return Vd(e)}function Jd(e){return"StaticImage"===e.type}function Kd(e){return"BasicText"===e.type}const Yd=ue(["styles","elements","link"]),Zd=ue(["styles","elements","activeIndicator"]),Qd=ue(["styles","elements","indicator"]),Xd=ue(["styles","elements","seenIndicator"]),eu=ue(["focussed"]),tu=ue(["hovered"]),nu=ue(["default"]),iu=ue(["pressed"]),au=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},ou=I(S(["styles","elements","link"]),J(de(Yd,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),de(Yd,re(I(De("focussed"),de(eu,au)))),de(Yd,re(I(De("hovered"),de(tu,au)))),de(Yd,re(I(De("default"),de(nu,au)))),de(Yd,re(I(De("pressed"),de(iu,au)))))),ru=J(I(S(["styles","elements","activeIndicator"]),de(Zd,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),de(Qd,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),de(Xd,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function su(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const lu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),cu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),du=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),uu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),pu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),yu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),fu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),mu=e=>{switch(e){case"is":return"is";case"is not":return"is-not";case"is below":return"is-below";case"is above":return"is-above";default:throw Fd("When",`Invalid condition: ${e}`)}},hu=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw Fd("When",`Invalid target: ${e}`)}},vu=e=>{const{target:t,condition:n,value:i}=e;return{type:hu(t),predicate:{condition:mu(n),value:i}}};function gu(e){return{predicates:e.predicates.map(vu),children:e.children.map((e=>Ou(e)))}}function bu(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function Iu(e){const t=e.children.map((e=>Ou(e)));if(zd(t))return Object.assign(Object.assign({},e),{children:t,styles:su(e.styles,pu)});throw Fd("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Eu(e){const t=e.children.map((e=>Ou(e)));if(Hd(t))return Object.assign(Object.assign({},e),{children:t,styles:su(e.styles,yu)});throw Fd("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function Su(e){const t=e.children.map((e=>Ou(e)));if(Wd(t))return Object.assign(Object.assign({},e),{children:t,styles:su(e.styles,fu)});throw Fd("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const wu=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function Cu(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:wu(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>Ou(e)));if(qd(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw Fd("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Ou(e){switch(e.type){case"When":return{type:"When",node:gu(e.node)};case"OneByOneDistribution":return{type:e.type,node:bu(e.node)};case"Overlay":return{type:e.type,node:Cu(e.node)};case"Column":return{type:e.type,node:(r=e.node,{styles:su(r.styles,lu),children:r.children.map((e=>Ou(e)))})};case"Row":return{type:e.type,node:(o=e.node,{styles:su(o.styles,cu),children:o.children.map((e=>Ou(e)))})};case"RichText":return{type:e.type,node:(a=e.node,ou(a))};case"CloseButton":return{type:e.type,node:Iu(e.node)};case"CreativeResponse":return{type:e.type,node:Eu(e.node)};case"StaticLink":return{type:e.type,node:Su(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:su(i.styles,du)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:su(n.styles,uu)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,ru(t))};default:return e}var t,n,i,a,o,r}function Tu(e){return Rp(e)}function xu(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const Au=e=>"scroll"===e||"auto"===e?"visible":e,Lu=ue(["elements","own"]),Nu=ue(["transitions","transition","value","own"]),_u=ue(["elements","wrapper"]),Ru=ue(["transitions","transition","value","wrapper"]),Du=ue(["elements","indicator"]),ku=ue(["transitions","transition","value","indicator"]),Pu=ue(["elements","activeIndicator"]),ju=ue(["transitions","transition","value","activeIndicator"]),$u=ue(["elements","seenIndicator"]),Gu=ue(["transitions","transition","value","seenIndicator"]),Fu=ue(["default","container","overflow"]),Mu=ue(["pressed","container","overflow"]),Bu=ue(["hovered","container","overflow"]),Uu=ue(["focussed","container","overflow"]),Vu=ue(["disabled","container","overflow"]),zu=ue(["container","overflow"]),Hu=J(I(S(["default","container","overflow"]),de(Fu,Au)),I(S(["pressed","container","overflow"]),de(Mu,Au)),I(S(["hovered","container","overflow"]),de(Bu,Au)),I(S(["focussed","container","overflow"]),de(Uu,Au)),I(S(["disabled","container","overflow"]),de(Vu,Au))),Wu=I(S(["container","overflow"]),de(zu,Au)),qu=J(I(S(["elements","own"]),de(Lu,re(Hu))),I(S(["transitions","transition","value","own"]),de(Nu,Wu))),Ju=I(De("transitions"),(e=>{var t;return G(ke(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),Ku=J(qu,Ju),Yu=J(I(S(["elements","wrapper"]),de(_u,re(Hu))),I(S(["transitions","transition","value","wrapper"]),de(Ru,Wu))),Zu=J(I(S(["elements","indicator"]),de(Du,re(Hu))),I(S(["transitions","transition","value","indicator"]),de(ku,Wu))),Qu=J(I(S(["elements","activeIndicator"]),de(Pu,re(Hu))),I(S(["transitions","transition","value","activeIndicator"]),de(ju,Wu))),Xu=J(I(S(["elements","seenIndicator"]),de($u,re(Hu))),I(S(["transitions","transition","value","seenIndicator"]),de(Gu,Wu)));function ep(e){return"StaticImage"===e.type}function tp(e){return"StaticIcon"===e.type}function np(e){return"BasicText"===e.type}function ip(e){return"DataImage"===e.type}function ap(e){return"DataIcon"===e.type}function op(e){return"RichText"===e.type}function rp(e){return"SlideStateTrigger"===e.type}function sp(e){return"ToggleButtonStateTrigger"===e.type}const lp=ae(te([function(e){return"Row"===e.type&&cp(e.node.children)},function(e){return"Column"===e.type&&cp(e.node.children)},ep,tp,op,np,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&cp(e.node.children)},function(e){return"StaticLink"===e.type&&cp(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CarouselDistribution"===e.type},function(e){return"GroupedDistribution"===e.type},function(e){return"CloseButton"===e.type&&cp(e.node.children)},function(e){return"ProgressControl"===e.type&&bp(e.node.children)},function(e){return"ZStack"===e.type&&cp(e.node.children)},function(e){return"FlowRow"===e.type&&cp(e.node.children)},rp,sp]));function cp(e){return lp(e)}const dp=J(qu,Yu,Ju);function up(e){const t=e.children.map((e=>Rp(e)));if(cp(t))return Object.assign(Object.assign({},ke(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?dp(e.styles):void 0});throw xu("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function pp(e){const t=e.children.map((e=>Rp(e)));if(bp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Ku(e.styles):void 0});throw xu("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function yp(e){const t=e.children.map((e=>Rp(e)));if(Ep(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Ku(e.styles):void 0});throw xu("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function fp(e){const t=e.children.map((e=>Rp(e)));if(bp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Ku(e.styles):void 0});throw xu("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const mp=J(qu,Zu,Qu,Xu,Ju);const hp=ae(te([np,ep,tp,ip,ap,function(e){return"Row"===e.type&&vp(e.node.children)},function(e){return"FlowRow"===e.type&&vp(e.node.children)},function(e){return"Column"===e.type&&vp(e.node.children)},function(e){return"ZStack"===e.type&&vp(e.node.children)},function(e){return"When"===e.type&&vp(e.node.children)}]));function vp(e){return hp(e)}const gp=ae(te([np,ep,tp,function(e){return"Row"===e.type&&bp(e.node.children)},function(e){return"FlowRow"===e.type&&bp(e.node.children)},function(e){return"Column"===e.type&&bp(e.node.children)},function(e){return"ZStack"===e.type&&bp(e.node.children)},function(e){return"When"===e.type&&bp(e.node.children)}]));function bp(e){return gp(e)}const Ip=ae(te([np,ep,tp,ip,ap,function(e){return"Row"===e.type&&Ep(e.node.children)},function(e){return"FlowRow"===e.type&&Ep(e.node.children)},function(e){return"Column"===e.type&&Ep(e.node.children)},function(e){return"ZStack"===e.type&&Ep(e.node.children)},function(e){return"When"===e.type&&Ep(e.node.children)}]));function Ep(e){return Ip(e)}function Sp(e){const t=e.children.map((e=>Rp(e)));if(vp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Ku(e.styles):void 0});throw xu("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function wp(e){const t=e.children.map((e=>Rp(e)));if(Ep(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Ku(e.styles):void 0});throw xu("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Cp(e){return"Row"===e.type&&xp(e.node.children)}function Op(e){return"Column"===e.type&&xp(e.node.children)}const Tp=ae(te([np,ep,tp,ip,ap,op,function(e){return"StaticLink"===e.type},rp,sp,function(e){return"CatalogResponseButton"===e.type},Cp,function(e){return"FlowRow"===e.type&&xp(e.node.children)},Op,function(e){return"ZStack"===e.type&&xp(e.node.children)},function(e){return"When"===e.type&&xp(e.node.children)}]));function xp(e){return Tp(e)}const Ap=te([Cp,Op]);function Lp(e){const t=Rp(e.template);if(function(e){return Ap(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?Ku(e.styles):void 0});throw xu("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function Np(e){const t=e.children.map((e=>Rp(e)));if(vp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Ku(e.styles):void 0});throw xu("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function _p(e){const t=e.transition?{inTransition:e.transition.in,outTransition:e.transition.out}:void 0;return Object.assign(Object.assign({},e),{children:e.children.map((e=>Rp(e))),transition:t})}function Rp(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>Rp(e))),styles:v.styles?Ku(v.styles):void 0}))};case"When":return{type:e.type,node:_p(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?Ku(h.styles):void 0,children:h.children.map((e=>Rp(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>Rp(e))),styles:m.styles?Ku(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(f=e.node,Object.assign(Object.assign({},f),{styles:f.styles?Ku(f.styles):void 0,children:f.children.map((e=>Rp(e)))}))};case"Overlay":return{type:e.type,node:up(e.node)};case"ProgressControl":return{type:e.type,node:fp(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(y=e.node,Object.assign(Object.assign({},ke(["settings"],y)),{viewableItems:y.settings.viewableItems,peekThroughSize:y.settings.peekThroughSize,styles:y.styles?Ku(y.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:pp(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:yp(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},ke(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?Ku(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?Ku(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},ke(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?mp(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?Ku(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?Ku(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:Sp(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:Np(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:wp(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:Lp(e.node)};case"RichText":return{type:"RichText",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?Ju(r.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?Ju(o.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?Ju(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?Ju(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?Ju(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?Ju(t.styles):void 0}))};default:return e}var t,n,i,a,o,r,s,l,c,d,u,p,y,f,m,h,v}function Dp(e){const t=e.split("."),n=Number(t[0]),i=Number(t[1]);if(t.length<2||Number.isNaN(n)||Number.isNaN(i))throw Error(`Fail to convert version ${e} to a valid version.`);return{major:n,minor:i}}function kp(e,t){return e.major===t.major&&e.minor===t.minor}const Pp=(e,t,n)=>E([Ee(e),je(t)])(n);function jp(e,t){return kp(t,{major:0,minor:0})?jp(Gd(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Pp(1,23,t.minor)}(0,t)?jp(Tu(e),{major:1,minor:0}):e}function $p(e,t){return kp(t,{major:0,minor:0})?$p(function(e){return Object.assign(Object.assign({},e),{layout:Gd(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Pp(1,23,t.minor)}(0,t)?$p(function(e){return Object.assign(Object.assign({},e),{layout:Tu(e.layout)})}(e),{major:1,minor:0}):e}function Gp(e,t,n,i){const a=Dp(n);if(i){const s=Dp(i);if(r=a,(o=s).major<r.major||o.major===r.major&&o.minor<r.minor||kp(s,a))return t(e,s);throw Error(`Could not migrate received layout config, config schema version ${i} is higher than the supported version ${n}.`)}return t(e,Dp("0.0"));var o,r}function Fp(e){var t;try{return Object.assign(Object.assign({},$e(e)),{offer:Object.assign(Object.assign({},$e(e.offer)),{creative:Od(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},$e(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?xd(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema,childLayouts:re(Mp,null!==(t=e.layoutVariant.childLayouts)&&void 0!==t?t:[])})})}catch(t){throw t.message?t:Cd("Slot",e.instanceGuid)}}function Mp(e){return Object.assign(Object.assign({},$e(e)),{childLayoutSchema:"string"==typeof e.childLayoutSchema?xd(e.childLayoutSchema,"ChildLayoutRootSchema",e.childLayoutId):e.childLayoutSchema})}function Bp(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},$e(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?xd(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:re(Fp,e.slots)})}catch(t){throw t.message?t:Cd("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=ue(["outerLayoutSchema"]),a=ue(["slots"]),o=ue(["layoutVariant","layoutVariantSchema"]);return J(de(a,re(de(o,(e=>Gp(e,jp,t,n))))),de(i,(e=>Gp(e,$p,t,n))))(e)}(t,ws.DCUI_SCHEMA_VERSION)}}const Up=O([[z({signalType:j("SignalSecondaryResponse")}),function*(e,t){return yield qe({type:Qr,payload:{level:Es,code:Rs,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[z({isPositive:j(!0)}),function*(e,t,n){var i;if("url"in e&&e.url){const a=e.instanceGuid;yield qe({type:en,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:a,responseActionPayload:{name:"Url",transformedTrafficURL:e.url,creativeInstanceGuid:e.creativeInstanceGuid}}});const o=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(i=e.urlBehavior)&&void 0!==i?i:"newTab",r=yield*function*(e,t,n){try{const i=yield ze(hl,t),a=Il(i)?i.ref:void 0;return yield ze(e.addAdvertiserWindowRef,a,n),Il(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield qe({type:Qr,payload:{level:Es,code:Ds,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield qe({type:Qr,payload:{level:Es,code:Ds,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:o,external:{partner:n}},a);return"self"===o?"END":r}return yield qe({type:Qr,payload:{level:Es,code:Rs,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[x,function*(){return"EXPLICIT_DISMISSAL"}]]);function*Vp(e){return yield qe({type:Qr,payload:{level:Es,code:Rs,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*zp(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=Zt(t.payload)||Qt(t.payload)||Yt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield qe({type:an,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:Xr,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield qe({type:an,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Vp(a):yield*Up(a,e.context,e.partner);break;case"CaptureOnly":yield qe({type:an,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:an,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Vp(a):yield*function*(e){return yield qe({type:en,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:"CaptureOnly",creativeInstanceGuid:e.creativeInstanceGuid}}}),e.isPositive?"SUCCESS":"EXPLICIT_DISMISSAL"}(a);break;case"Fulfillment":yield qe({type:Qr,payload:{level:Es,code:"INCORRECTLY_HANDLE_FULFILLMENT_ACTION",message:`Fulfillment action is incorrectly handled by the orchestrator instead of a module with the option ID: ${a.instanceGuid}`}}),n="ERROR";break;case"External":yield qe({type:Qr,payload:{level:Es,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}Xt(t.payload)||(yield qe(function(e,t){switch(e){case"SUCCESS":return{type:Qc,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:Qc,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:Qc,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:Qc,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:Qc,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:Kc,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Hp(e,t,n,i){return st((a=>(i().then((e=>Promise.all([t.getRoktPageInstanceGuid(),(t.getUId||t.getPluginInstanceId)()]).then((([t,n])=>Object.assign(Object.assign({},e),{pageInstanceGuid:t,pluginInstanceId:n}))).catch((()=>e)))).then((({moduleConnectorBuilder:t,pageInstanceGuid:i,pluginInstanceId:o})=>{const r=`rokt-${n}-${o}`.toLowerCase();if(!customElements.get(r)){const o=t.withGatewayFactory(e).withLogger((e=>{a({type:Qr,payload:{level:e.level,code:e.code,message:e.message,additionalInformation:Object.assign(Object.assign({},e.additionalInformation),{moduleName:n,layoutType:"LayoutVariant",pageInstanceGuid:null!=i?i:"N/A"})}})})).build();customElements.define(r,o)}})).catch((e=>{const t=e&&"object"==typeof e&&"message"in e?e.message:void 0,i=e&&"object"==typeof e&&"stack"in e?e.stack:void 0;a({type:Qr,payload:{level:Dt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const Wp={"standard-marketing":()=>Promise.resolve().then((function(){return ff})),"add-to-cart":()=>Promise.resolve().then((function(){return mm})),"instant-purchase":()=>Promise.resolve().then((function(){return Qm})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return Nh}))};function*qp(e,t,n){let i=yield Ke((e=>e.module.loadedModules));for(const a of n.payload.modules)i&&!(null==i?void 0:i.includes(a))&&(i=[...i,a],yield Qe(Jp,e,t,a))}function*Jp(e,t,n){if(n in Wp){yield qe({type:Vc,payload:n});const i=yield ze(Hp,e,t,n,Wp[n]);yield ze(Ns,i)}else yield qe({type:Qr,payload:{level:bs,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*Kp(e){const t=yield Ke((e=>kd.getDistributionViewableItems(e.layout?kd.getDistribution(e.layout.layoutSchema):void 0))),n=yield Ke((n=>{var i;const a=Zs(e.payload.activeBreakpoint)(n);return a>=0&&t?null!==(i=t[Math.min(t.length-1,a)])&&void 0!==i?i:1:void 0}));if("number"==typeof n){const e={type:Jc,payload:{groupSize:n}};yield qe(e)}}const Yp=O([[(e,t,n,i)=>"END"===e.offerProcessStatus,$({type:Vr})],[(e,t,n,i)=>t.isLastOffer&&n,$({type:Vr})],[(e,t,n,i)=>1===i&&!t.isLastOffer,$({type:Wc})],[x,$(void 0)]]);function*Zp(e){const t=yield Ke((e=>({exists:null!==e.progression,isLastOffer:dd(e)}))),n=yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.groupSize}));var i;null!=(i=t)&&i instanceof Object&&"exists"in i&&"isLastOffer"in i&&t.exists&&(yield*function*(e,t,n){const i=yield Ke((e=>e.settings.closeOnComplete)),a=Yp(e,t,"boolean"==typeof i&&i,n);a&&(a.type===Vr&&(yield qe({type:an,payload:{name:"PLACEMENT_COMPLETED"}})),yield qe(a))}(e.payload,t,n))}function Qp(e){return e.type===Qc&&"Interactive"===e.payload.event}function Xp(e){return e.type===Qc&&"Interactive"!==e.payload.event}function*ey(e){switch(e.payload.event){case"Dismissed":yield qe({type:Kc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield qe({type:Xc,payload:{key:"offerComplete",value:O([[j("Error"),$(-1)],[j("Success"),$(1)],[x,$(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:Kc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield qe({type:qt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:an,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*ty(e,t){var n;try{const n=yield Ke((e=>{var t,n,i;return null!==(i=null===(n=null===(t=e.layout)||void 0===t?void 0:t.settings)||void 0===n?void 0:n.enablePartnerValidation)&&void 0!==i&&i}));n&&(yield ze(e.partner.send,dl.PartnerValidationEvent.SET_PARTNER_VALIDATION_STATUS,{errors:t.payload.errors}))}catch(i){const a=yield Ke((({slots:e})=>{var n,i;return"number"==typeof t.payload.offerPositionIndex?null!==(i=null===(n=e.at(t.payload.offerPositionIndex))||void 0===n?void 0:n.layoutVariant.moduleName)&&void 0!==i?i:"Unknown":"orchestrator"})),o=null!==(n=yield ze(e.context.getRoktPageInstanceGuid))&&void 0!==n?n:"N/A",r={type:Qr,payload:{level:kt,code:"PARTNER_VALIDATION_UPDATE_FAILED",message:"Failed to update the partner with error status",additionalInformation:{moduleName:a,layoutType:"number"==typeof t.payload.offerPositionIndex?"LayoutVariant":"OuterLayout",pageInstanceGuid:o}}};yield qe(r)}}function*ny(e){const t=yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:nd.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Vr}),t?(yield qe({type:en,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield qe({type:en,payload:{name:"SignalDismissal",parentGuid:t}})):yield qe({type:Qr,payload:{level:Is,code:ks,message:"ParentGuid does not exist"}})}function*iy(e,t){yield Ye([Ze(Qr,_s.bind(null,e.errorService.raise)),Xe(Ur,jd.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ze(zc,qp.bind(null,t,e.contextService)),Xe(ed,zp.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ze(Kc,Zp),Ze(Xp,ey),Ls(Qp,ey),Xe(Fr,al.bind(null,e.displayService)),Xe(Vr,Cl.bind(null,e.contextService)),Xe(Zc,ny),Xe(Zr,Yl),Ze(en,Rl),Ze(on,Dl),As(qt,Jl.bind(null,e.metricsService)),As(Yr,kl.bind(null,e.rdnService)),Ze(Xr,_l.bind(null,e.errorService.raise)),Xe($r,Kp),Ze(nn,ql),Ze(rn,Kl.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),Xe(sn,ty.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var ay,oy,ry,sy,ly,cy=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},dy=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const uy={[dn.SET_CUSTOM_STATE]:nd.SET_CUSTOM_STATE,[dn.SET_DOMAIN_STATE]:nd.SET_DOMAIN_STATE,[dn.SET_GLOBAL_OFFER_DATA_CART]:nd.SET_GLOBAL_OFFER_DATA_CART,[dn.OFFER_LIFECYCLE]:id.OFFER_LIFECYCLE,[dn.OFFER_ENGAGEMENT]:id.OFFER_ENGAGEMENT,[dn.SET_PARTNER_VALIDATION_STATUS]:id.SET_PARTNER_VALIDATION_STATUS};class py{constructor(e){ay.add(this),oy.set(this,void 0),cy(this,oy,e,"f")}getState(e){const t=dy(this,oy,"f").getState();return{breakpoint:t.breakpoint,progression:ud(t),customStates:Xs(t,e.offerPositionIndex),domainStates:pd(t,e.offerPositionIndex)}}dispatch(e,t){dy(this,oy,"f").dispatch(dy(this,ay,"m",ly).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),dy(this,oy,"f").subscribe((()=>{t(this.getState(e))}))}}function yy(e,t){const n=ot(),i={},a=it({reducer:ld,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},cd()),t),middleware:e=>{return e({thunk:!1,serializableCheck:!1}).concat((t=i,e=>e=>n=>{if("object"==typeof n&&null!==n&&"type"in n){const i=n.type,a=t[`${i}`];return e(a?a(n):n)}return e(n)}),n);var t}}),o=(r=function(e){return new py(e)}(a),s=e.childPlugin.create,l=e.partnerInteractionService.onEvent,(e,t)=>new ya(r,s,e,t,l));var r,s,l;n.run(iy,e,o),n.run(Al,e,Bp);const c={};return Object.assign(Object.assign({},a),{extend:({reducer:e,interceptors:t,sagas:o})=>{e&&(Object.assign(c,e),a.replaceReducer(at(Object.assign(Object.assign({},ld),c)))),t&&Object.assign(i,t),o&&n.run(o)}})}oy=new WeakMap,ay=new WeakSet,ry=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n.offerPositionIndex,creativeInstanceGuid:n.creativeInstanceGuid})}},sy=function(e,t){return t.type===on?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):(t.payload.creativeInstanceGuid=e.creativeInstanceGuid,t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid)),t},ly=function(e,t){return function(e){return e.type in uy}(t)?dy(this,ay,"m",ry).call(this,uy[t.type],t.payload,e):t.type===en||t.type===on?dy(this,ay,"m",sy).call(this,e,t):t};var fy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const my={ctx:new Map([[Uc.name,Uc],[Fc.name,Fc],[Ec.name,Ec],[Nc.name,Nc]]),cache:[]};function hy(n,i){return fy(this,void 0,void 0,(function*(){const{pluginId:o,pageInstanceGuid:r}=yield function(e){return Promise.allSettled([(e.contextService.getUId||e.contextService.getPluginInstanceId)(),e.contextService.getRoktPageInstanceGuid()]).then((([e,t])=>({pluginId:"fulfilled"===e.status?e.value:Nt.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:Nt.pageInstanceGuid}))).catch((()=>Nt))}(i),s=y(n),l=yy(i);s.render(t(a.StrictMode,{children:[e(Nr,{}),e(v,{store:l,children:t(Ua.Provider,{value:o,children:[e(Hs,{}),e(Ti.Provider,{value:n,children:e(pr,{extensions:my,extendStore:l.extend.bind(l),children:e(Rd,{pageInstanceGuid:r})})})]})})]}))}))}class vy{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const gy=()=>{},by=(e=gy,t=gy,n=gy)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class Iy{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=by(e,t,n);let a,o=!0;const r={next:e=>{o&&i.next(e)},complete:()=>{o&&(a&&a(),i.complete(),o=!1)},error:e=>{o&&(i.error(e),o=!1)}};a=this._setupFn(r),o||a&&a();const s=new vy;return s.add({unsubscribe:()=>{a&&a(),o=!1}}),s}}class Ey extends Iy{constructor(){super((e=>(this._isComplete&&e.complete(),this._observers.push(e),()=>this._observers=this._observers.filter((t=>t!==e))))),this._observers=[],this._isComplete=!1}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){this._isComplete=!0;for(const e of this._observers)e.complete()}asObservable(){return new Iy((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class Sy extends Ey{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=by(e,t,n);return i.next(this._lastValue),super.subscribe(i)}next(e){return this._lastValue=e,super.next(e)}getValue(){return this._lastValue}}class wy extends Ey{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=by(e,t,n);let a=!0;return this._buffer.filter((e=>(e===this._error&&(a=!1),a))).forEach((e=>i.next(e))),this._error&&i.error(this._error),i.error=e=>{this._error=e,t(e)},super.subscribe(i)}next(e){this._error||this._addToBuffer(e),super.next(e)}error(e){this._error=e,this._addToBuffer(e),super.error(e)}_addToBuffer(e){-1!==this._bufferLength&&this._buffer.length===this._bufferLength?(this._buffer.shift(),this._buffer.push(e)):this._buffer.push(e)}}const Cy={CompletedBeforeEmit:"CompletedBeforeEmit"},Oy=(e,t)=>{let n;const i="object"==typeof t;return new Promise(((a,o)=>{n=e.subscribe(a,o,(()=>{i?a(t.defaultValue):o(new Error(Cy.CompletedBeforeEmit))}))})).then((e=>(n.unsubscribe(),e))).catch((e=>{throw n.unsubscribe(),e}))},Ty=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),xy=(e,t)=>new Iy((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function Ay(e){return new Iy((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const Ly=(...e)=>new Iy((t=>{const n=new vy;let i=0;for(const a of e)n.add(a.subscribe((e=>t.next(e)),(e=>t.error(e)),(()=>{i+=1,i>=e.length&&t.complete()})));return()=>n.unsubscribe()})),Ny=(...e)=>new Iy((t=>{for(const n of e)t.next(n)})),_y=(...e)=>new Iy((t=>{if(!e.length)return t.complete(),gy;const n=new vy,i=new Array(e.length),a=new Array(e.length),o=e=>!i.includes(void 0)&&t.next(e);for(let t=0;t<e.length;t++){const r=e[t].subscribe((e=>{a[t]=e,i[t]=!0,o(a)}));n.add(r)}return()=>n.unsubscribe()}));var Ry=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};function Dy(e,t){return new ky(e,t)}class ky{constructor(e,t){this._target=e,this._handler=t}subscribe(e,t,n){const i=e.next?e.next.bind(e):e,a={next:(...e)=>Ry(this,void 0,void 0,(function*(){try{yield i(...e)}catch(e){this._handler(e)}})),error:e.error?e.error.bind(e):t,complete:e.complete?e.complete.bind(e):n};return this._target.subscribe(a)}}class Py{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var jy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const $y=e=>(...t)=>new Iy((n=>{const i=e.subscribe((e=>jy(void 0,void 0,void 0,(function*(){try{let i=new Py(e);for(const e of t){const t=e(i);if(i=t.then?yield t:t,!0===i.skip||!0===i.complete)break}if(i.skip)return;n.next(i.value),!0===i.complete&&n.complete()}catch(e){n.error(e)}}))),(e=>n.error(e)),(()=>n.complete()));return()=>i.unsubscribe()})),Gy=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),Fy=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),My=e=>t=>{const n=e(t.value);return new Py(n)},By=e=>t=>(e(t.value),t),Uy={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},Vy={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},zy={getBreakpointCSSClass:Ht},Hy="CHILD_LAYOUTS/ADD_LAUNCHED",Wy="DYNAMIC_DATA/ADD";function qy(e={launched:{}},t){if(t.type===Hy){const n=t.payload;return n.childLayoutId?b(["launched",n.childLayoutId],n.shouldRelaunch,e):e}return e}function Jy(e=null,t){return e}function Ky(e=null,t){if(t.type===Wy){const n=t.payload;return e?n?Ge(e,n):e:n}return e}function Yy(e,t){var n;return null===(n=e.childLayouts.launched[t])||void 0===n||n}function Zy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer}function Qy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.schemaVersion}function Xy(e){var t,n;return null!==(n=null===(t=e.dynamicData)||void 0===t?void 0:t.text)&&void 0!==n?n:{}}const ef="FAILED_TO_LAUNCH_CHILD_LAYOUT";function*tf(e,t,n){var i;if(yield null===(i=Ke(Yy,n.payload.childLayoutId))||void 0===i||i){const i=yield Ke(Qy),o=yield Ke(Zy),r=yield Ke(Xy);try{const s=(a=function(e,t,n,i){return{instanceGuid:e.instanceGuid,childLayoutId:e.childLayoutId,childLayoutSchema:e.childLayoutSchema,offer:t,layoutSchemaVersion:n,content:{text:i}}}(n.payload,o,i,r),JSON.parse(JSON.stringify(a)));try{yield ze(e.createChildPlugin,{name:"dcui-child",config:s,targetElementSelector:n.payload.targetElementSelector})}catch(e){yield ze(t,{level:kt,code:ef,message:"Could not launch child layout, failed creating plugin."})}}catch(e){yield ze(t,{level:kt,code:ef,message:"Could not launch child layout, failed to make the child layout config serializable."})}yield qe({type:Hy,payload:{childLayoutId:n.payload.childLayoutId,shouldRelaunch:!1}})}var a}function nf(){const t=Aa(),n=m(Xy),i=Zi()({state:n},"textContent");return e(Yi,{value:i,children:e(wi,{children:e=>e(t)})})}const af={staticData:Jy,dynamicData:Ky,childLayouts:qy};function of(e={}){return Object.assign({staticData:null,dynamicData:null,childLayouts:{launched:{}}},e)}function rf(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function sf(e){return"object"==typeof e&&null!==e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&"string"==typeof t))}function*lf(e,t,n,i){for(;;){switch(yield We(e)){case"CLOSED":t({type:tn,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":if(n&&i){yield ze(i);break}t({type:tn,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:tn,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*cf(e,t,n){if(Kt(n)){const{responseOption:i,fulfillment:a}=n,o=Xt(n);yield qe({type:en,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const r=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof r&&"onClose"in r&&"close"in r){const i=yield ze(rf,r);if("object"==typeof i&&"take"in i){const a=function(e,t,n,i){if(n.responseOption.rclid)return function*(){yield qe({type:an,payload:{name:"REALTIME_OFFER_FULFILLMENT_CONVERSION",body:{rclid:n.responseOption.rclid,accountID:n.accountID,referralCreativeID:n.referralCreativeID}}}),yield ze(df,e,t,i)}}(e,t,n,r);return void(yield ze(lf,i,e.globalDispatch.bind(e),o,a))}}yield ze(t,{level:Dt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Dt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}function*df(e,t,n){const i=function(e){return st((t=>{const n=e.onEvent({name:pl,source:"partner",callback:e=>{sf(e)&&t({eventName:pl,data:e})}},{name:yl,source:"partner",callback:e=>{sf(e)&&t({eventName:yl,data:e})}});return()=>{n()}}))}(e);try{for(;;){const a=yield We(i);switch(a.eventName){case pl:yield qe({type:an,payload:{name:pl,body:a.data}}),yield qe({type:Wy,payload:{text:a.data}}),e.globalDispatch({type:tn,payload:{event:"Completed",completionReason:"Success"}}),n&&(yield ze(n.close.bind(n)));break;case yl:e.globalDispatch({type:tn,payload:{event:"Completed",completionReason:"Error"}}),n&&(yield ze(n.close.bind(n)));break;default:t({level:Dt,code:"UNKNOWN_REALTIME_OFFER_FULFILLMENT_EVENT",message:`Unknown event: ${a.eventName}`})}}}catch(e){const n=e;t({level:kt,code:"FAILED_TO_PROCESS_REALTIME_OFFER_FULFILLMENT_EVENT",message:null==n?void 0:n.message})}finally{(yield Je())&&i.close()}}function*uf(e,t,n){const i=Zt(n.payload)||Qt(n.payload)||Yt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":yield ze(e.globalDispatch.bind(e),n),Xt(n.payload)&&(yield qe({type:an,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID}}}),yield ze(df,e,t));break;case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:an,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:an,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*cf(e,t,n.payload)}}function*pf(e,t){yield Ye([Xe(Jt,uf.bind(null,e,t)),Ze(cn,tf.bind(null,e,t)),Ze("*",Cs.bind(null,[Jt,cn],e))])}Object.assign({},dn);const yf=(new wa).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=of({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=of()){const i=ot(),a=it({reducer:af,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(pf,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ga,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Nr,{}),e(v,{store:s,children:e(Ar,{settings:n,dispatch:s.dispatch,children:e(nf,{})})})]})}))}}));var ff=Object.freeze({__proto__:null,moduleConnectorBuilder:yf});const mf="CART/UPDATE",hf="CATALOG_ITEM/RESPONSE",vf="USER_CREATIVE_RESPONSE_HISTORY/ADD",gf=O([[(e,t)=>0!==t,j],[(e,t)=>!Number.isNaN(e)&&0===t,j],[(e,t)=>Number.isNaN(e)&&0===t,Me]]);function bf({isChecked:t,isDisabled:n,outerClassname:i,outerCheckedClassname:a,innerClassname:o,innerCheckedClassname:r}){return e("span",{style:{display:"flex"},children:e("span",{className:`${i} ${t?a:""}`,tabIndex:n?-1:1,style:{display:"flex",boxSizing:"border-box"},children:e("span",{className:`${o} ${t?r:""}`,style:{flex:1}})})})}const If="catalogRadioGroup__label",Ef=["Enter","Space"],Sf={elements:{own:[],optionContainer:[],radioButtonInner:[{default:{border:{borderRadius:11},background:{backgroundColor:{light:"#FFF"}}}}],radioButtonInnerChecked:[{default:{background:{backgroundColor:{light:"#529ff4"}}}}],radioButtonOuter:[{default:{border:{borderRadius:16,borderColor:{light:"#999"},borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"fixed",value:16},height:{type:"fixed",value:16}},spacing:{padding:"4"}}}],radioButtonOuterChecked:[]}};function wf(e,t,n){return e.map(O([[G(j("Required"),F("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[x,$("")]])).filter(Fe)}function Cf({schema:n,testId:i}){const r=f(),s=Ba(),[l,c]=m((e=>{var t,i;const a=s.cartItemId in e.cart?null!==(i=null===(t=e.cart[s.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==i?i:0:NaN;return[a,wf(n.validations,n.options.length,a)]})),d=Na(),{tabIndex:u,styles:p,isDisabled:y}=It(d);o((()=>{y||r(Of(c))}),[]);const h=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=s.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=s.maxItemCount)&&void 0!==n?n:1/0)}));function v(e){r({type:hf,payload:{catalogItem:s,quantity:e}});const t=wf(n.validations,n.options.length,e);r(Of(t))}return h.length>0?e(Ao,{styles:n.styles?zt(Sf,n.styles):Sf,children:({classnames:n,mapperRef:o})=>e("div",{className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},p),children:e(Xi,{value:o(If),children:a.Children.toArray(h.map(((a,o)=>{var r;const c=gf(l,a.quantity),d=e=>i?`${i}-option${o}${e}`:void 0;return t("label",{tabIndex:u,"aria-disabled":y,style:{display:"flex"},className:`${If} ${null!==(r=null==n?void 0:n.optionContainer)&&void 0!==r?r:""}`,onKeyDown:e=>{c||!Ef.includes(e.code)||y||v(a.quantity)},"data-e2e":"CatalogRadioGroup-Option","data-e2e-quantity":`${a.quantity}`,"data-testid":d("Label"),children:[e("input",{type:"radio",style:{display:"none"},tabIndex:-1,name:s.instanceGuid,value:a.quantity,checked:c,onChange:()=>v(a.quantity),"aria-disabled":y,disabled:y}),e(bf,{isChecked:c,isDisabled:y,innerClassname:null==n?void 0:n.radioButtonInner,innerCheckedClassname:null==n?void 0:n.radioButtonInnerChecked,outerClassname:null==n?void 0:n.radioButtonOuter,outerCheckedClassname:null==n?void 0:n.radioButtonOuterChecked}),e(kr,{schema:a,testId:d("Content")})]})})))})})}):null}function Of(e){return{type:sn,payload:{errors:e}}}function Tf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function xf(t){const n=f(),i=Ci(),a=Ba(),o=Na(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return e(Ao,{styles:t.schema.styles,children:({classnames:o})=>e("button",{type:"button",tabIndex:r,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:hf,payload:{catalogItem:a,quantity:1}})},className:null==o?void 0:o.own,children:Tf(t.schema.children,i,t.testId)})})}const Af={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},Lf=new Map([["&","_;^;_"]]),Nf=new RegExp(`<a *(?=${Af.allowedAttributes.a.join("|")}|>)`,"g"),_f=new RegExp(`<a *(?:(?:${Af.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Rf=new RegExp("(<br *?>)|(<br *?/>)","g"),Df=new RegExp(`<ul *(?=${Af.allowedAttributes.ul.join("|")}|>)`,"g"),kf=new RegExp(`<ol *(?=${Af.allowedAttributes.ol.join("|")}|>)`,"g"),Pf=new RegExp("<li *(?=>|\\s[^>]*>)","g"),jf="<br/>";function $f(t){const n=Zi(),i=Na(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(_f,((e,t)=>{const n=t.replaceAll("&",Lf.get("&"));return e.replace(t,n)})).replaceAll(Rf,jf)}(e);return t===vt(t,Af)}(e))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Ao,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class="${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0)),l=((null==n?void 0:n.list)?`class="${n.list}"`:"")+' style="list-style-type: none; padding-inline-start: 0px; display: flex; flex-direction: column;"',c=((null==n?void 0:n.listItem)?`class="${n.listItem}"`:"")+' style="display: flex; align-items: flex-start; flex-shrink: 0; flex-grow: 1;"',d=`class="rokt-icon${(null==n?void 0:n.span)?" "+n.span:""}" style="display: inline-block; pointer-events: none; user-select: none;" aria-disabled="true"`,u=a.replace(Nf,`<a ${i.join(" ")}`).replace(Df,`<ul ${l}`).replace(kf,`<ol ${l}`).replace(Pf,`<li ${c}><span ${d}>Check</span`);return p=a,new RegExp("</(p|ul|ol)>").test(p)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}});var p}}):null}const Gf={internally:"_top",externally:"_blank"};function Ff(t,n,i,a,o){return e(Xi,{value:i(n),children:Mf(t,a,o)})}function Mf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Bf(t){var n,i;const a=Gf[t.schema.open],o=Ci(),r=Ba(),s=Na(),l=f(),c=null!==(n=r.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=It(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(Ao,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:en,payload:{name:"SignalResponse",parentGuid:null!==(e=r.instanceGuid)&&void 0!==e?e:"",responseActionPayload:{name:"Url",transformedTrafficURL:c}}})},"data-testid":t.testId,"data-e2e":"CatalogUrlLink",target:null!=a?a:"_blank",tabIndex:d,"aria-disabled":p,"aria-label":null!==(s=t.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:"block"},u),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Ff(t.schema.children,null==n?void 0:n.own,i,o,t.testId):Mf(t.schema.children,o,t.testId)})}}):null}function Uf(e,t){const n=e.cart[t];return n||null}function Vf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[],a=function(e){return Object.values(e.cart).filter((e=>null!==e))}(e);return a.filter((e=>i.find((t=>t.catalogItemId===e.catalogItemId))))}function zf(e,t){var n,i,a,o;const r=null===(n=e.staticData)||void 0===n?void 0:n.offer;if(r){const n=function(e){return Vf(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=Uf(e,t.cartItemId),l=(null!==(i=null==r?void 0:r.maxTotalItemsQtyInOffer)&&void 0!==i?i:1/0)-n,c=(null!==(a=t.maxItemCount)&&void 0!==a?a:1/0)-(null!==(o=null==s?void 0:s.quantity)&&void 0!==o?o:0);return Math.min(l,c)}return 0}function Hf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[];return i.length>0?i:null}function Wf(e,t){var n,i;return null!==(i=null===(n=Hf(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function qf(e){var t;const n=null===(t=Hf(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function Jf(e){var t,n;return null!==(n=null===(t=qf(e))||void 0===t?void 0:t.reduce(((e,t)=>{var n;return e+(null!==(n=t.preSelectedQuantity)&&void 0!==n?n:0)}),0))&&void 0!==n?n:0}const Kf=G((e=>e.filter((e=>!ce(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),ne,B("cart"));function Yf(t,n,i,a,o){return e(Xi,{value:i(n),children:a(t,void 0,o)})}function Zf(e,t,n){return t(e,void 0,n)}function Qf(i){var a;const{schema:o,testId:r}=i,{a11yInputLabel:s,styles:l,showInputField:c,buttons:d,forcedUpsellText:u}=o,{increment:p,decrement:y,a11yIncrementLabel:h,a11yDecrementLabel:v}=d||{},g=f(),b=Ba(),I=Ci(),E=Zi(),S=Na(),{tabIndex:w,styles:C,isDisabled:O}=It(S),T=m((e=>function(e,t){var n,i,a;const o=Wf(e,t);return Boolean(o&&(null!==(n=o.preSelectedQuantity)&&void 0!==n?n:0)>0&&o.preSelectedQuantity===(null!==(i=o.minItemCount)&&void 0!==i?i:0)&&o.preSelectedQuantity===(null!==(a=o.maxItemCount)&&void 0!==a?a:0))}(e,b.catalogItemId))),x=m((e=>Uf(e,b.cartItemId))),A=m((e=>zf(e,b))),L=(null==x?void 0:x.quantity)||0,N=It(O||L<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),_=It(O||A<=0?"DISABLED":S),R=It(O||T?"DISABLED":S),D=e=>{var t;const n=e.target.value;if(0===n.length)k(null!==(t=b.minItemCount)&&void 0!==t?t:0);else{const e=Number(n);!Number.isNaN(e)&&e>=0&&k(e)}},k=e=>{O||g({type:hf,payload:{catalogItem:b,quantity:e}})};return e(Ao,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign({display:"flex",flexDirection:"row"},C),children:T&&u?e(Go,{schema:u,isInline:!1,testId:r?`${r}-forced-upsell-text`:void 0}):t(n,{children:[y?e("button",{className:null==i?void 0:i.decrementButton,style:Object.assign(Object.assign({},N.styles),{cursor:N.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(L-1)},tabIndex:N.tabIndex,"aria-label":v||void 0,disabled:N.isDisabled,"data-testid":r?`${r}-decrement-button`:void 0,children:e(Yi,{value:E,children:(null==i?void 0:i.decrementButton)?Yf(y,i.decrementButton,a,I,r):Zf(y,I,r)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},R),{cursor:R.isDisabled?"not-allowed":"auto",caretColor:R.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:L,onChange:D,"aria-label":s||void 0,tabIndex:w,disabled:O,"data-testid":r?`${r}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:C,"data-testid":r?`${r}-quantity-text`:void 0,children:L}),p?e("button",{className:null==i?void 0:i.incrementButton,style:Object.assign(Object.assign({},_.styles),{cursor:_.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(L+1)},tabIndex:_.tabIndex,"aria-label":h||void 0,disabled:_.isDisabled,"data-testid":r?`${r}-increment-button`:void 0,children:e(Yi,{value:E,children:(null==i?void 0:i.incrementButton)?Yf(p,i.incrementButton,a,I,r):Zf(p,I,r)})}):null]})})})}const Xf={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(xf,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"InsuranceRichText":return e($f,{schema:n.node});case"CatalogUrlLink":return e(Bf,{schema:n.node});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(Cf,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(Qf,{schema:t.node})}};function em(){const t=Aa(),n=Ci();return e(Oi,{value:n,overrides:Xf,children:e(wi,{children:e=>e(t)})})}const tm={cart:function(e={},t){if(t.type===mf){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,o=Os(n,i);return Object.assign(Object.assign({},e),{[a]:o})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===vf?e.concat(t.payload.responseId):e},staticData:Jy,childLayouts:qy};const nm="INVALID_PARTNER_MESSAGE",im="MISCONFIGURED_CATALOG_ITEM",am="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*om(e){var t,n;const i=yield Ke(qf),a=yield Ke(Jf),o=yield Ke((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(dm(a)&&dm(o)&&a>o)yield ze(e,{level:kt,code:im,message:`Catalog items preselected quantities (${a}) exceeds the maximum allowed quantity (${o}) for this offer`});else if(i&&Array.isArray(i))for(const a of i){const i=null!==(t=a.preSelectedQuantity)&&void 0!==t?t:0,o=null!==(n=a.maxItemCount)&&void 0!==n?n:1/0;i>o?yield ze(e,{level:kt,code:im,message:`Preselected quantity (${i}) is greater than maxItemCount (${o}) for catalog item (${a.instanceGuid})`}):yield*cm(a,i,!0)}}function*rm(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*cm(i,a,!1)){const n=yield Ke((e=>{var t,n,i;const a=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative.responseOptionsMap.positive,o=e.userCreativeResponseHistory.at(-1),r=null===(n=e.staticData)||void 0===n?void 0:n.offer.creative.responseOptionsMap.negative;if(a&&o&&a.id===o&&"SignalGatedResponse"===(null==r?void 0:r.signalType))return function(e,t){var n;switch(e.action){case"Fulfillment":{const i=null==t?void 0:t.creative.fulfillment;return wt(i)?{type:Jt,payload:{fulfillment:i,responseOption:e,accountID:null!==(n=null==t?void 0:t.accountId)&&void 0!==n?n:""}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:Jt,payload:Object.assign(Object.assign({},e),{accountID:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:Jt,payload:e}}}(r,null===(i=e.staticData)||void 0===i?void 0:i.offer)}));null!=(o=n)&&"object"==typeof o&&"type"in o&&"payload"in o&&"object"==typeof o.payload?yield ze(e.globalDispatch,n):function(e){return"string"==typeof e}(n)&&(yield ze(t,{level:kt,code:"INVALID_RESPONSE_OBJECT",message:n}))}var o}function*sm(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:ll.V2.PartnerMessage.UpdateCartItem,source:"partner",callback:e=>{!function(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&!("unitPrice"in e)}(e)?t({level:kt,code:nm,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield We(n);yield ze(lm,e,t)}}catch(e){const n=e;t({level:kt,code:am,message:null==n?void 0:n.message})}finally{(yield Je())&&n.close()}}function*lm(e,t){const{cartItemId:n,quantity:i}=e,a=yield Ke(Uf,n);if(um(a)){const e=yield Ke(Wf,a.catalogItemId);null!==(o=e)&&"object"==typeof o&&"catalogItemId"in o&&"price"in o?yield*cm(e,i,!1):yield ze(t,{level:kt,code:am,message:`Catalog item not found for cart item id (${n})`})}else yield ze(t,{level:kt,code:am,message:`Cart item not found for cart item id (${n})`});var o}function*cm(e,t,n){var i;const a=yield Ke(Uf,e.cartItemId),o=yield Ke(zf,e),r=dm(o)?o:0,s=um(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=r){yield qe({type:mf,payload:{catalogItem:e,quantity:t}});const i=yield Ke(Uf,e.cartItemId),o=yield Ke(Kf);return yield qe({type:ln,payload:{cart:o}}),yield qe({type:en,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield qe({type:an,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function dm(e){return"number"==typeof e}function um(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*pm(e,t){var n;yield qe({type:vf,payload:{responseId:(n=t.payload,Kt(n)?n.responseOption.id:n.id)}}),yield ze(e.globalDispatch.bind(e),t)}function*ym(e,t){yield Ye([et(om.bind(null,t)),et(sm.bind(null,e,t)),Xe(hf,rm.bind(null,e,t)),Xe(Jt,pm.bind(null,e)),Ze(cn,tf.bind(null,e,t)),Ze("*",Cs.bind(null,[Jt,cn],e))])}Object.assign(Object.assign({},dn),{CATALOG_ITEM_RESPONSE:hf});const fm=(new wa).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=function(e={}){return Object.assign({cart:{},userCreativeResponseHistory:[],staticData:null,childLayouts:{launched:{}}},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n){const i=ot(),a=it({reducer:tm,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(ym,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ga,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Nr,{}),e(v,{store:s,children:e(Ar,{settings:n,dispatch:s.dispatch,children:e(em,{})})})]})}))}}));var mm=Object.freeze({__proto__:null,moduleConnectorBuilder:fm});const hm="CATALOG/TRIGGER_SELECT_ITEM",vm="CATALOG/SET_SELECTED_ITEM",gm="INSTANT_PURCHASE/INITIATE",bm="INSTANT_PURCHASE/PARTNER_RESPONSE";function Im(t,n,i,a,o){return e(Xi,{value:i(n),children:Em(t,a,o)})}function Em(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Sm(t){const n=f(),i=Ci(),a=Na(),{tabIndex:o,styles:r,isDisabled:s}=It(a),l=Ba(),c=Wi(l,"catalogItem");return e(Ao,{styles:t.schema.styles,children:({classnames:a,mapperRef:d})=>e("button",{type:"button",tabIndex:o,"aria-disabled":s,disabled:s,style:Object.assign({cursor:"pointer"},r),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:gm,payload:{catalogItem:l,quantity:1}})},className:null==a?void 0:a.own,children:e(Yi,{value:c,children:(null==a?void 0:a.own)?Im(t.schema.children,a.own,d,i,t.testId):Em(t.schema.children,i,t.testId)})})})}function wm(t,n,i,a,o){return e(Xi,{value:i(n),children:a(t,void 0,o)})}function Cm(e,t,n){return t(e,void 0,n)}const Om=["ArrowDown","ArrowUp","Enter","Escape","Tab"];function Tm(n){const i=Ni(),a=Ci(),s=Ba(),l=Zi(),u=e=>l({data:e},"catalogItem"),p=d((()=>i.catalogItems||[]),[i]),y=Na(),{styles:m,isDisabled:h}=It(y),v=r(null),g=r([]),[b,I]=c(!1),[E,S]=c(0),w=f();function C(){h||(b?T():O())}function O(){h||I(!0)}function T(){h||I(!1)}function x(e){S(p.indexOf(e)),T(),w({type:hm,payload:{catalogItem:e}})}o((()=>{if(b){const e=g.current[E];e&&e.focus()}}),[b,E]);const A={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},dimension:{width:{type:"percentage",value:100}}}}]}};function L(e){if(!h&&Om.includes(e.key))switch(e.key){case"ArrowDown":{e.preventDefault();const t=E+1;t<p.length&&S(t);break}case"ArrowUp":{e.preventDefault();const t=E-1;t>=0&&S(t);break}case"Enter":if(e.preventDefault(),b){const e=p[E];e&&x(e)}else O();break;case"Tab":if(b){T();const e=p.indexOf(s);-1!==e&&S(e)}break;case"Escape":if(e.preventDefault(),b){T();const e=p.indexOf(s);-1!==e&&S(e)}}}return e(Ao,{styles:n.schema.styles?zt(A,n.schema.styles):A,children:({classnames:i,mapperRef:o})=>t("div",{ref:v,className:null==i?void 0:i.own,onKeyDown:L,onClick:C,onBlur:e=>{var t;(null===(t=v.current)||void 0===t?void 0:t.contains(e.relatedTarget))||b&&T()},"data-e2e":"DropDown","data-testid":n.testId?`${n.testId}-drop-down-container`:void 0,"aria-disabled":h,style:Object.assign({position:"relative"},m),tabIndex:0,children:[e("div",{className:null==i?void 0:i.dropDownSelectedElement,"aria-disabled":h,"data-testid":n.testId?`${n.testId}-drop-down-selected-element`:void 0,style:Object.assign({cursor:"pointer"},m),children:e(Yi,{value:u(s),children:(null==i?void 0:i.dropDownSelectedElement)?wm(n.schema.closedTemplate,i.dropDownSelectedElement,o,a,n.testId):Cm(n.schema.closedTemplate,a,n.testId)})}),b&&e("ul",{className:null==i?void 0:i.dropDownListContainer,onClick:e=>e.stopPropagation(),"data-testid":n.testId?`${n.testId}-drop-down-list-container`:void 0,tabIndex:-1,style:Object.assign({listStyle:"none",padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,backgroundColor:"#FFF",overflow:"hidden"},m),children:p.map(((t,r)=>e("li",{ref:e=>function(e,t){g.current[t]=e}(e,r),className:null==i?void 0:i.dropDownListElement,onClick:e=>{e.stopPropagation(),h||x(t)},tabIndex:-1,"data-e2e":"DropDownItem","data-testid":n.testId?`${n.testId}-drop-down-item-${r}`:void 0,style:Object.assign({cursor:"pointer",display:"flex"},m),children:e(Yi,{value:u(t),children:(null==i?void 0:i.dropDownListElement)?wm(n.schema.openTemplate,i.dropDownListElement,o,a,n.testId):Cm(n.schema.openTemplate,a,n.testId)})},t.catalogItemId)))})]})})}function xm(t){const n=Ci(),i=ja(),r=Zi(),s=bi(),l=Ni().catalogItems||[],c=m((e=>e.selectedItem))||l[0];return o((()=>{c&&s({type:en,payload:{name:"SignalImpression",parentGuid:null==c?void 0:c.instanceGuid}})}),[c,s]),c?e(Ao,{styles:t.schema.styles,children:({classnames:o})=>{return e("div",{"data-testid":t.testId,"data-e2e":"CatalogCombinedCollection",className:null==o?void 0:o.own,style:{display:"flex",flexDirection:"column"},children:a.Children.toArray(e(Ma,{context:c,children:e(Pa,{value:i(c),children:e(Yi,{value:(s=c,r({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})}))});var s}}):null}function Am(n){const{schema:{imageKeys:i,styles:o},testId:r}=n,[s,d]=c(0),u=Na(),p=function(e){const t=l(ka);return e.reduce(((e,n)=>{const i=t(`${n}.src`,"copy"),a=t(`${n}.title`,"copy");return void 0===i?e:[...e,Lt({light:i,title:a})]}),[])}(i),{styles:y,isDisabled:f,tabIndex:m}=It(u),h=p[s]||p[0];return p.length>0&&h?e(Ao,{styles:o,children:({classnames:n})=>t("div",{className:null==n?void 0:n.own,children:[e("img",{"aria-hidden":f,src:h.light,alt:h.alt,title:h.title,className:null==n?void 0:n.mainImage,style:y,"data-testid":`${r}-main-image`,"data-e2e":"ImageGallery-mainImage"}),e("div",{className:null==n?void 0:n.thumbnailList,style:Object.assign(Object.assign({},y),{display:"flex"}),children:a.Children.toArray(p.map(((t,i)=>e("img",{src:t.light,alt:t.alt,title:t.title,className:null==n?void 0:n.thumbnailImage,style:Object.assign(Object.assign({},y),{cursor:f?"not-allowed":"pointer",pointerEvents:"auto"}),"data-testid":`${r}-thumbnail-${i}`,"data-e2e":"ImageGallery-thumbnail",tabIndex:m,onClick:()=>d(i)}))))})]})}):null}function Lm(t){const n=Na(),i=bi(),{customStateKey:o,customStateValue:r}=t.schema,{tabIndex:s,styles:l,isDisabled:c}=It(n),d=()=>{i({type:nn,payload:{key:o,value:r}})};return e(Ao,{styles:t.schema.styles,children:({classnames:n})=>{var i;return e("button",{className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ButtonStateTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,tabIndex:s,style:Object.assign({backgroundColor:"transparent",cursor:"pointer",margin:0,padding:0},l),children:e(wi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const Nm=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/;function _m(t){const n=Zi(),i=Na(),{schema:a,testId:o}=t,r=n(a.value),{tabIndex:s,styles:l,isDisabled:c}=It(i);return"string"==typeof(d=r)&&Nm.test(d)?e(Ao,{styles:a.styles,children:({classnames:t})=>e("div",{"aria-hidden":c,className:null==t?void 0:t.own,"data-e2e":"ColorSwatch","data-testid":o,style:Object.assign({backgroundColor:r},l),tabIndex:s})}):null;var d}const Rm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(Sm,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"CatalogDropDown":return e(Tm,{schema:n.node});case"CatalogCombinedCollection":return e(xm,{schema:n.node});case"ImageGallery":return e(Am,{schema:n.node});case"ButtonStateTrigger":return e(Lm,{schema:n.node});case"ColorSwatch":return e(_m,{schema:n.node});default:return}}}};function Dm(){const t=Aa(),n=Ci(),i=m(Xy),a=Zi()({state:i},"textContent");return e(Oi,{value:n,overrides:Rm,children:e(Yi,{value:a,children:e(wi,{children:e=>e(t)})})})}const km={staticData:Jy,selectedItem:(e=null,t)=>t.type===vm?t.payload:e,dynamicData:Ky,childLayouts:qy};function Pm(e={}){return Object.assign({staticData:null,selectedItem:null,dynamicData:null,childLayouts:{launched:{}}},e)}const jm="INVALID_RESPONSE_OBJECT";function $m(e,t){return st((n=>e.onEvent({name:cl.PartnerMessage.CartItemInstantPurchaseResponse,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"upsellItems"in i&&Array.isArray(i.upsellItems)&&i.upsellItems.every((e=>"object"==typeof e))&&"totalUpsellPrice"in i&&"number"==typeof i.totalUpsellPrice&&"currency"in i&&"string"==typeof i.currency&&"paid"in i&&"boolean"==typeof i.paid&&"success"in i&&"boolean"==typeof i.success?n(e):t({level:kt,code:"MALFORMED_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Gm(e,t){var n;try{for(;;){const t=yield We(e);t&&(yield qe({type:bm,payload:t}))}}catch(e){yield ze(t,{level:kt,code:"INSTANT_PURCHASE_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase channel"})}finally{e.close()}}function Fm(e){const t=function(e){var t,n;return null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[]}(e);return t[0]}const Mm="Unknown failure reason";function*Bm(){const e=yield Ke(Fm);e&&(yield*Wm(e))}function*Um(e){const{catalogItem:t}=e.payload;yield*Wm(t)}function*Vm(e,t,n){const{catalogItem:i,quantity:a}=n.payload,o=Os(i,a);o?(yield qe({type:en,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield Qe(Hm,e,t),yield qe({type:an,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[o],totalUpsellPrice:o.totalPrice||0,currency:o.currency}}})):yield ze(t,{level:kt,code:jm,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`})}function*zm(e,t){const n=yield Ke((e=>e.staticData));if(!n)return yield ze(e,{level:kt,code:"MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE",message:"App state is not configured with static data."}),void(yield*Km("Error"));if(!n.offer.catalogItems)return yield ze(e,{level:kt,code:"MISSING_CATALOG_ITEMS",message:"No catalog items found within offer data."}),void(yield*Km("Error"));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};let a,o;t.payload.success?(a=qm,o="Success"):(a=(e,n)=>function(e,t,n,i){return{name:"SignalCartItemInstantPurchaseFailure",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,failureReason:i.reason||Mm,providerId:n.accountId.toString()}}}(e,n,i,t.payload),o="Unspecified"),yield*function*(e,t,n,i){const a=[];for(const i of e.upsellItems){const e=Jm(i,t.catalogItems);void 0===e?a.push(i):yield qe({type:en,payload:n(e,i.quantity)})}a.length>0&&(yield*function*(e,t){const n=JSON.stringify(e,null,"\t").replaceAll('"',"");yield ze(t,{level:kt,code:jm,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}(t.payload,i,a,e),yield*Km(o)}function*Hm(e,t){const n=$m(e,t),{timeout:i}=yield tt({channelListener:ze(Gm,n,t),timeout:nt(6e4)});i&&(yield ze(t,{level:kt,code:"INSTANT_PURCHASE_RESPONSE_TIMEOUT",message:"Instant-purchase response timed out after 60000ms"}),n.close(),yield qe({type:tn,payload:{event:"Dismissed",dismissalReason:"Implicit"}}))}function*Wm(e){var t,n,i;yield qe({type:vm,payload:e});const a={title:null!==(t=e.title)&&void 0!==t?t:"",description:null!==(n=e.description)&&void 0!==n?n:"",price:null!==(i=e.priceFormatted)&&void 0!==i?i:""};e.copy&&Object.entries(e.copy).forEach((([e,t])=>{a[`copy.${e}`]=t})),yield qe({type:Wy,payload:{text:a}})}function qm(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:_t.DCUI}}}function Jm(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*Km(e){yield qe({type:tn,payload:{event:"Completed",completionReason:e}})}function*Ym(e,t){yield Ye([et(Bm),Ze(hm,Um),Xe(gm,Vm.bind(null,e,t)),Xe(bm,zm.bind(null,t)),Ze(cn,tf.bind(null,e,t)),Ze("*",Cs.bind(null,[Jt,cn],e))])}Object.assign(Object.assign({},dn),{INITIATE_INSTANT_PURCHASE:gm,INSTANT_PURCHASE_PARTNER_RESPONSE:bm});const Zm=(new wa).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=Pm({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Pm()){const i=ot(),a=it({reducer:km,devTools:{name:"Instant Purchase"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Ym,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ga,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Nr,{}),e(v,{store:s,children:e(Ar,{settings:n,dispatch:s.dispatch,children:e(Dm,{})})})]})}))}}));var Qm=Object.freeze({__proto__:null,moduleConnectorBuilder:Zm});const Xm=s(null),eh=({children:t})=>{var n;const[i,a]=c([]),[r,s]=c(0),[l,d]=c(0),u=Zi();return o((()=>{let e=0;const t=i.length,n=setInterval((()=>{e=e+1>=t?0:e+1,s(e)}),l);return()=>clearInterval(n)}),[l,i]),e(Xm.Provider,{value:{images:i,activeIndex:r,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(Yi,{value:u({data:{"image.title":null===(n=i[r])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function th({active:t,duration:n,containerStyles:i,indicatorStyles:a}){const s=r(null);return o((()=>{t&&s.current&&function(e,t){const n="animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype,i=[{width:0},{width:"100%"}];if(n){const n=e.animate(i,{duration:t,iterations:1});return()=>{n.finish()}}}(s.current,n)}),[t]),e("div",{style:Object.assign({position:"relative",height:"2px",width:"100%",backgroundColor:"#FFFFFF66"},i),children:e("span",{ref:s,style:Object.assign({animationIterationCount:"infinite",animationFillMode:"forwards",animationTimingFunction:"linear",position:"absolute",top:0,left:0,height:"100%",backgroundColor:"#FFF",width:t?"100%":0},a)})})}function nh(e){const t=l(ka),n=[];return e.forEach((e=>{const i=t(`${e}.src`,"copy"),a=t(`${e}.title`,"copy");if(void 0===i)return;const o=Lt({light:i,title:a});n.push(o)})),n}function ih({schema:n,testId:i}){const r=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=r,u=l(Xm),p=nh(d);return o((()=>{null==u||u.setImages(p),null==u||u.setDuration(c)}),[]),t("div",{"data-testid":i,style:Object.assign({position:"relative",flexShrink:1,flexGrow:0,width:"100%"},s.elements.own),children:[a.Children.toArray(p.map(((t,n)=>e("img",{src:t.light,alt:t.title,style:Object.assign({opacity:n===(null==u?void 0:u.activeIndex)?1:0,position:0===n?"relative":"absolute",display:0===n?"block":"",top:0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%",transition:"opacity 300ms ease-in-out",objectFit:"contain"},s.elements.image)})))),e("div",{style:Object.assign({display:"flex",gap:"2px",width:"70%",position:"absolute",margin:"0 15%",bottom:"8px",zIndex:20,justifyContent:"center"},s.elements.indicatorWrapper),children:a.Children.toArray(p.map(((t,n)=>e(th,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const ah={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},oh=new Map([["&","_;^;_"]]),rh=new RegExp(`<a *(?=${ah.allowedAttributes.a.join("|")}|>)`,"g"),sh=new RegExp("<span*>","g"),lh=new RegExp(`<a *(?:(?:${ah.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),ch=new RegExp("(<br *?>)|(<br *?/>)","g"),dh="<br/>";function uh(t){const n=Zi(),i=Na(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(lh,((e,t)=>{const n=t.replaceAll("&",oh.get("&"));return e.replace(t,n)})).replaceAll(ch,dh)}(e);return t===vt(t,ah)}(e))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Ao,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(rh,`<a ${i.join(" ")}`).replace(sh,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(rh,`<a ${i.join(" ")}`).replace(sh,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var l}}):null}function ph({schema:t}){const n=Ci(),i=yi(Va(),ia()),o=JSON.parse(t.data),[r]=ht({loop:!1,align:"start",slidesToScroll:2,containScroll:"trimSnaps"}),{styles:s,body:{tierItems:l}}=o;if(!l||!l.length)return;const c=l.length>2;return e("div",{className:i`
|
|
136
|
+
`},a.Children.toArray(u.map((e=>l(e))))))))}const Mc={name:"loading-extension",componentFactory:e=>a.createElement(Fc,{data:e}),interceptors:{}},Bc=1e3;function Uc(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/Bc,a=r(null),s=()=>{const t=(new Date).getTime()/Bc;n(Math.max(Math.floor(e-(t-i)),0))};return o((()=>(a.current=setInterval(s,Bc),()=>{a.current&&"number"==typeof a.current&&clearInterval(a.current)})),[]),{minutes:Math.floor(t/60).toString(),seconds:Math.floor(Math.min(t%60,59)).toLocaleString("en-US",{minimumIntegerDigits:2,maximumFractionDigits:0,useGrouping:!1}),timeRemaining:t,restartTimer:function(){a.current&&"number"==typeof a.current&&clearInterval(a.current),n(e),a.current=setInterval(s,Bc)}}}((null==t?void 0:t.duration)||300),d=m((e=>{const t=g(["progression","currentGroupIndex"],e);return"number"==typeof t?t:0})),u=f();o((()=>{l()}),[d]),o((()=>{0===s&&(u({type:en,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=_a(),{tabIndex:y,styles:h,isDisabled:v}=It(p);return a.createElement("p",{tabIndex:y,style:Object.assign(Object.assign({},null==t?void 0:t.styles),h),"aria-hidden":v,"data-e2e":"Timer"},`${n}:${i}`)}const Vc={name:"timer-progression-extension",componentFactory:e=>a.createElement(Uc,{data:e}),interceptors:{}},zc="MODULE/ADD_LOADED",Hc="MODULE/LOAD",Wc="PROGRESSION/INITIALISE",qc="PROGRESSION/NEXT",Jc="PROGRESSION/PREV",Kc="PROGRESSION/UPDATE_GROUP_SIZE",Yc="PROGRESSION/PROCESS",Zc="SLOTS/SET",Qc="INSTANT_PURCHASE/DISMISS",Xc="OFFER_LIFECYCLE",ed="DOMAIN_STATES/SET",td="OFFER_ENGAGEMENT",nd="GLOBAL_OFFER_DATA_STATE/SET_CART",id=Object.assign(Object.assign({},ns),{NEXT_IN_PROGRESSION:qc,PREV_IN_PROGRESSION:Jc,INITIALISE_PROGRESSION:Wc,UPDATE_GROUP_SIZE:Kc,SET_SLOTS:Zc,ADD_LOADED_MODULE:zc,SET_DOMAIN_STATE:ed,SET_GLOBAL_OFFER_DATA_CART:nd}),ad=Object.assign(Object.assign({},is),{LOAD_MODULES:Hc,DISMISS_INSTANT_PURCHASE:Qc,PROCESS_PROGRESSION:Yc,OFFER_LIFECYCLE:Xc,OFFER_ENGAGEMENT:td,SET_PARTNER_VALIDATION_STATUS:ln});function od(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function rd(e,t){const n=[];if(t<=0||e<=0||t>e)throw Error(`Could not generate the progression groups with groupSize: ${t} and totalCount: ${e}`);for(let i=0;i<od(e,t);i++){const a=[];for(let n=0;n<t;n++)a.push(Math.min(i*t+n,e-1));n.push([...new Set(a)])}return n}const sd=Symbol("root");function ld(){return{[sd]:{}}}const cd=Object.assign({progression:function(e=null,t){switch(t.type){case Wc:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<od(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:rd(e,i)})}return null;case Kc:{const{groupSize:n}=t.payload,i=null==e?void 0:e.totalCount;return i&&n<=i&&n>0?Object.assign(Object.assign({},e),{groupSize:n,indexGroups:rd(i,n),currentGroupIndex:0}):null}case qc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.min(i+1,od(t,n)-1)}):null}case Jc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.max(i-1,0)}):null}default:return e}},slots:function(e=[],t){return t.type===Zc?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===zc?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=ld(),t){if(t.type===ed){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:sd;return n===sd?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[sd]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===nd){if(t.payload.cart){const n=`module${t.payload.offerPositionIndex}`;return Object.assign(Object.assign({},e),{[n]:{cart:t.payload.cart}})}return e}return e}},al);function dd(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:qs(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:Js(),fonts:[],signal:{queue:[],processed:[]},serializableCache:il(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:ld(),globalOfferDataState:{}}),e)}function ud(e){var t;return!!e.progression&&(1===e.progression.groupSize&&e.progression.currentGroupIndex===(null===(t=e.progression)||void 0===t?void 0:t.totalCount)-1)}function pd(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:od(e.progression.totalCount,e.progression.groupSize),isLast:ud(e)}:null}function yd(e,t){return e.domainStates[`module${t}`]||{offerComplete:0,checkout:0}}function fd(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>t.cart?e+t.cart.reduce(((e,t)=>e+t.quantity),0):e),0)}function md(i){var a;const{config:o,position:r,visible:s,container:c,testId:d}=i,u=za(),p=_a(),y=m(Ks),f=l(Ha),h=`rokt-${o.layoutVariant.moduleName}-${u}`;return t(n,{children:[!s&&e("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},"aria-hidden":"true"}),e(h,{style:{display:"flex",flexDirection:"column"===c?"column":"row",width:"100%"},slotInstanceGuid:o.instanceGuid,layoutSchema:JSON.stringify(o.layoutVariant.layoutVariantSchema),schemaVersion:f,childLayouts:JSON.stringify(null!==(a=o.layoutVariant.childLayouts)&&void 0!==a?a:[]),offerData:JSON.stringify(o.offer),offerPositionIndex:r,visible:s,container:c,interactivity:p,"data-testid":d,"data-e2e":`OfferSlot-${r}`,"aria-hidden":!s,"module-component":!0,"plugin-id":u,"active-breakpoint":Ht(y)})]})}function hd({schema:t,testId:n}){const i=t.styles,o=m((e=>e.slots)),s=r(null),l=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),c=_a(),{tabIndex:d,isDisabled:u,styles:p}=It(c);return o.length&&o[l]?e(Lo,{styles:i,children:({classnames:i})=>e("div",{ref:s,"data-testid":n,"data-e2e":"OneByOneDistribution",className:null==i?void 0:i.own,tabIndex:d,"aria-hidden":u,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},p),children:a.Children.toArray(o.map(((n,i)=>e(kr,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(md,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const vd=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=od(e.progression.totalCount,e.progression.groupSize);let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}return{numOfIndicators:0,activeIndex:0,startIndex:0}}))((function({activeIndex:t,startIndex:n,numOfIndicators:a,schema:o}){const r=_a(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=Array(a).fill(o.indicator);return a>0&&(p=a+n-1,(u=t)>=n&&u<=p)?e(Yi,{children:a=>e(Lo,{styles:o.styles,children:o=>{var r;const u=o.classnames,p=e=>{var n,i;return e===t?`${null==u?void 0:u.indicator} ${(null==u?void 0:u.activeIndicator)?u.activeIndicator:null!==(n=null==u?void 0:u.seenIndicator)&&void 0!==n?n:""}`:e<t?`${null==u?void 0:u.indicator} ${null!==(i=null==u?void 0:u.seenIndicator)&&void 0!==i?i:""}`:null==u?void 0:u.indicator};return e("div",{className:null!==(r=null==u?void 0:u.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row"},l),"data-e2e":"ProgressIndicator",tabIndex:s,"aria-hidden":c,children:i.Children.toArray(d.map(((t,i)=>e("span",{className:p(i+n),style:{display:"flex"},children:a({state:{indicatorPosition:String(i+1+n)}})(t)}))))})}})}):null;var u,p}));const gd="partnerValidationUI",bd="stackedViewableItems";function Id(t){var n;const i=f(),r=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=bo(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=G((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||r.length}),Re((([e,t])=>t)),ne)(l);o((()=>{i({type:qr,payload:{key:bd,value:String(c)}})}),[c]);const d=r.slice(0,c),u=_a(),{tabIndex:p,isDisabled:y,styles:h}=It(u);return(null==d?void 0:d.length)>0?e(Lo,{styles:t.schema.styles,children:({classnames:n})=>e("div",{"data-testid":t.testId,"data-e2e":"StackedDistribution",className:null==n?void 0:n.own,"aria-hidden":y,tabIndex:p,style:Object.assign({display:"flex",flexDirection:"column"},h),children:a.Children.toArray(d.map(((t,n)=>e(md,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function Ed(t){const n=t.schema.styles,i=f(),o=_a(),r="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:s,styles:l,isDisabled:c}=It(o),d=()=>{i({type:"Backward"===t.schema.direction?id.PREV_IN_PROGRESSION:id.NEXT_IN_PROGRESSION})};return e(Lo,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:r,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:r,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Ci,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function Sd({schema:t,testId:n}){var i,r,s,l,c,d,u,p,y;const h=m((e=>e.progression)),v=null==h?void 0:h.indexGroups[null==h?void 0:h.currentGroupIndex],g=null!==(i=null==h?void 0:h.currentGroupIndex)&&void 0!==i?i:0,b=m((e=>e.slots)),I=m(Xs),E=t.viewableItems.length-1,[S,w]=ht({slidesToScroll:null!==(r=t.viewableItems[Math.min(I,E)])&&void 0!==r?r:"auto",containScroll:"trimSnaps"}),C=f(),O=_a(),{tabIndex:T,isDisabled:x,styles:A}=It(O),L=`${null!==(p=null===(u=null===(d=null===(c=null===(l=null===(s=t.styles)||void 0===s?void 0:s.elements)||void 0===l?void 0:l.own[I])||void 0===c?void 0:c.default)||void 0===d?void 0:d.container)||void 0===u?void 0:u.gap)&&void 0!==p?p:"0"}px`;o((()=>{function e(e){var t,n;const i=null!==(t=null==e?void 0:e.selectedScrollSnap())&&void 0!==t?t:0,a=null!==(n=null==e?void 0:e.previousScrollSnap())&&void 0!==n?n:0;i!==g&&(i>a?C({type:id.NEXT_IN_PROGRESSION}):i<a&&C({type:id.PREV_IN_PROGRESSION}))}return null!=g&&(null==w||w.on("select",e),null==w||w.scrollTo(g)),()=>{null==w||w.off("select",e)}}),[w,g,C]);const N={overflow:"hidden"},_={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:L,alignItems:"stretch"},R=e=>{var t;return null!==(t=null==v?void 0:v.includes(e))&&void 0!==t&&t},D=t.peekThroughSize[Math.min(I,t.peekThroughSize.length-1)],k=D?"Fixed"===(P=D).type?`${P.value}px`:`${P.value}%`:"0px";var P;const j=null!==(y=t.viewableItems[Math.min(E,I)])&&void 0!==y?y:1,$={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(k)?`(100% - 2 * ${k} - (${j} + 1) * ${L})/${j}`:`(100% - (${j} - 1) * ${L})/${j}`})`,position:"relative",display:"flex",overflow:"auto"};return(null==b?void 0:b.length)>0?e(Lo,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign({},N),A),"aria-disabled":x,tabIndex:T,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:_,"data-testid":n&&`${n}-container`,"data-e2e":"CarouselDistribution-Container",children:a.Children.toArray(b.map(((t,i)=>e("div",{style:$,"data-testid":n&&`${n}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`,children:e(md,{config:t,position:i,container:"row",visible:R(i)})}))))})})}):null}function wd({schema:t,testId:n}){const i=za(),o=d((()=>fi(i)([{display:"flex",flexDirection:"column"}])),[i]),s=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.groupSize)||0})),l=m((e=>{var t;return((null===(t=e.progression)||void 0===t?void 0:t.indexGroups)||[]).map((t=>t.map((t=>e.slots[t])).filter((e=>null!=e))))})),c=r(null),u=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),p=_a(),{tabIndex:y,isDisabled:f,styles:h}=It(p);return l.length?e(Lo,{styles:t.styles,children:({classnames:i})=>e("div",{ref:c,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":f,tabIndex:y,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},h),children:a.Children.toArray(l.map(((r,l)=>e(kr,{effect:t.transition,visible:l===u,parentElement:c.current,containerClassName:[o,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,children:a.Children.toArray(r.map(((t,i)=>{const a=s*l+i;return e(md,{config:t,position:a,visible:l===u,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const Cd={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",External:"External"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"},conversionType:{Default:"Default",RealTime:"RealTime"}};function Od(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function Td(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:V(xd,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new Pt("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:Od("Creative",e.instanceGuid,t)}}function xd(e){try{let t,n;e.urlBehavior&&(t=Cd.urlBehavior[e.urlBehavior]),e.conversionType&&(n=Cd.conversionType[e.conversionType]);return Object.assign(Object.assign({},e),{urlBehavior:t,action:Cd.action[e.action],signalType:Cd.signalType[e.signalType],conversionType:n})}catch(t){throw t.message?t:Od("CreativeResponse",e.instanceGuid)}}function Ad(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function Ld(){o((()=>{const e=new ResizeObserver(function(e=100){let t;return()=>{t&&clearTimeout(t),t=setTimeout((()=>{var e,n;null===(n=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===n||n.resize(),t=void 0}),e)}}());return e.observe(document.body),()=>{e.disconnect()}}),[])}const Nd={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(hd,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(Id,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(vd,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(Ed,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(ps,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(rs,{schema:t.node})},EscapeHatch:(_d=[function(t,n){if(Et("CloseButton",t)){const n=JSON.parse(t.node.data);return e(rs,{schema:n.node,action:n.action})}},hr],e=>_d.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(Sd,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(wd,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(hs,{schema:t.node})}};var _d;function Rd(e,t){e({type:en,payload:{name:"SignalActivation",parentGuid:t}})}function Dd({pageInstanceGuid:t}){var n,i,a,r,s,l;const c=m((e=>e.layout),j),d=f(),u=m((e=>({breakpoint:e.breakpoint,progression:pd(e),customStates:e.customStates.root,domainStates:e.domainStates[sd]})),j),p=m((e=>e.slots.length)),y=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(bd))&&void 0!==t?t:"");return p-n})),h=m(fd);fn(Ai(),d),o((()=>(c&&document.body.addEventListener("click",Rd.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",Rd.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),Ld(),o((()=>{if(c){const e={type:en,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:es,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:ad.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const o=qi({})({state:{progression:(null!==(i=null===(n=u.progression)||void 0===n?void 0:n.activeGroupIndex)&&void 0!==i?i:0)+1,maxProgression:null!==(r=null===(a=u.progression)||void 0===a?void 0:a.totalGroups)&&void 0!==r?r:1,availableOffersCount:null!==(l=null===(s=u.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:p,selectedCatalogItemQuantity:h,hiddenItemCount:y}}),f=Tr(v);return e(Fa,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(Zi,{value:o,children:e(Ti,{value:f,overrides:Nd,children:e(Ei.Provider,{value:u,children:e(bi.Provider,{value:d,children:e(ta.Provider,{value:"OUTER",children:e(Ha.Provider,{value:c.layoutSchemaVersion,children:e(Ci,{children:e=>e(c.layoutSchema)})})})})})})})})}return null}var kd=Object.freeze({__proto__:null,getDistribution:function e(t){var n;switch(t.type){case"OneByOneDistribution":case"StackedDistribution":case"CarouselDistribution":case"GroupedDistribution":return t;case"Row":case"Column":case"When":case"ZStack":case"FlowRow":case"InlineContainer":case"ScrollableRow":case"ScrollableColumn":case"BottomSheet":case"Overlay":for(const n of t.node.children){const t=e(n);if(t)return t}break;case"EscapeHatch":try{const{name:i,body:a}=JSON.parse(t.node.data);if(("loading-extension"===i||"minimized-bottomsheet-extension"===i)&&(null===(n=null==a?void 0:a.children)||void 0===n?void 0:n.length))for(const t of a.children){const n=e(t);if(n)return n}break}catch(e){break}case"StaticImage":case"DataImage":case"RichText":case"BasicText":case"ProgressIndicator":case"CreativeResponse":case"StaticLink":case"CloseButton":case"ProgressControl":case"StaticIcon":case"DataIcon":case"SlideStateTrigger":case"ToggleButtonStateTrigger":case"TimerStateTrigger":case"CatalogStackedCollection":case"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":case"PartnerEventButtonTrigger":case"CopyToClipboardButton":break;default:!function(e){throw Error(`Could not handle layout: ${JSON.stringify(e)}`)}(t)}},getDistributionViewableItems:function(e){switch(null==e?void 0:e.type){case"CarouselDistribution":case"GroupedDistribution":return e.node.viewableItems;default:return}}}),Pd=Object.assign({},kd);function*jd(e,t){const n=Pd.getDistribution(t),i=null==n?void 0:n.type,a=yield Ke(Xs),o=function(e=0,t){var n;switch(null==t?void 0:t.type){case"CarouselDistribution":case"GroupedDistribution":{const i=Math.min(t.node.viewableItems.length,e);return null!==(n=t.node.viewableItems[i])&&void 0!==n?n:1}default:return 1}}("number"==typeof a?a:0,n);"OneByOneDistribution"!==i&&"CarouselDistribution"!==i&&"GroupedDistribution"!==i||(yield yt({type:id.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:o}}))}function*$d(e,t){const{instanceGuid:n,layoutSchemaVersion:i,outerLayoutSchema:a,slots:o}=t.payload;n?yield yt({type:en,payload:{name:"SignalLoadComplete",parentGuid:n}}):yield yt({type:Xr,payload:{level:Es,code:Ps,message:"Layout instance guid does not exist"}}),yield yt({type:Hc,payload:{modules:o.map((e=>e.layoutVariant.moduleName))}}),yield yt({type:Mr,payload:a.breakpoints}),yield yt({type:id.LAYOUT_UPDATE,payload:{instanceGuid:n,layoutSchemaVersion:i,layoutSchema:a.layout,settings:a.settings}}),yield yt({type:id.SET_SLOTS,payload:o}),ce(a.settings)||(yield yt({type:id.SET_SETTINGS,payload:a.settings})),yield*jd(o.length,a.layout);const r=yield*function*(e,t,n){const i=null==t?void 0:t.enablePartnerValidation,a=["add-to-cart"],o=n.some((e=>a.some((t=>t===e.layoutVariant.moduleName))));if(i&&o)try{yield pt(e.send,ul.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt(Gd,e,ul.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:gd}})))}catch(e){return yield yt({type:Xr,payload:{level:Is,code:$s,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,a.settings,o);"OK"===r&&(yield pt(_l,e.display,a.display))}function*Gd(e,t,n){const i=st((i=>{const a=e.onEvent(t).subscribe((e=>{i(n(e))}));return()=>{a.unsubscribe()}}));for(;;){const e=yield ft(i);yield yt(e)}}function Fd(e){return Tu(e)}function Md(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const Bd=ae(te([function(e){return"Row"===e.type&&Hd(e.node.children)},function(e){return"Column"===e.type&&Hd(e.node.children)},Kd,Yd])),Ud=ae(te([function(e){return"Row"===e.type&&Wd(e.node.children)},function(e){return"Column"===e.type&&Wd(e.node.children)},Yd,Kd,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&Wd(e.node.children)}])),Vd=ae(te([function(e){return"Row"===e.type&&qd(e.node.children)},function(e){return"Column"===e.type&&qd(e.node.children)},Yd,Kd])),zd=ae(te([function(e){return"Row"===e.type&&Jd(e.node.children)},function(e){return"Column"===e.type&&Jd(e.node.children)},Kd,function(e){return"RichText"===e.type},Yd,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&Jd(e.node.children)},function(e){return"StaticLink"===e.type&&Jd(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&Jd(e.node.children)}]));function Hd(e){return Bd(e)}function Wd(e){return Ud(e)}function qd(e){return Vd(e)}function Jd(e){return zd(e)}function Kd(e){return"StaticImage"===e.type}function Yd(e){return"BasicText"===e.type}const Zd=ue(["styles","elements","link"]),Qd=ue(["styles","elements","activeIndicator"]),Xd=ue(["styles","elements","indicator"]),eu=ue(["styles","elements","seenIndicator"]),tu=ue(["focussed"]),nu=ue(["hovered"]),iu=ue(["default"]),au=ue(["pressed"]),ou=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},ru=I(S(["styles","elements","link"]),J(de(Zd,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),de(Zd,re(I(De("focussed"),de(tu,ou)))),de(Zd,re(I(De("hovered"),de(nu,ou)))),de(Zd,re(I(De("default"),de(iu,ou)))),de(Zd,re(I(De("pressed"),de(au,ou)))))),su=J(I(S(["styles","elements","activeIndicator"]),de(Qd,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),de(Xd,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),de(eu,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function lu(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const cu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),du=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),uu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),pu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),yu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),fu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),mu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),hu=e=>{switch(e){case"is":return"is";case"is not":return"is-not";case"is below":return"is-below";case"is above":return"is-above";default:throw Md("When",`Invalid condition: ${e}`)}},vu=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw Md("When",`Invalid target: ${e}`)}},gu=e=>{const{target:t,condition:n,value:i}=e;return{type:vu(t),predicate:{condition:hu(n),value:i}}};function bu(e){return{predicates:e.predicates.map(gu),children:e.children.map((e=>Tu(e)))}}function Iu(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function Eu(e){const t=e.children.map((e=>Tu(e)));if(Hd(t))return Object.assign(Object.assign({},e),{children:t,styles:lu(e.styles,yu)});throw Md("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Su(e){const t=e.children.map((e=>Tu(e)));if(Wd(t))return Object.assign(Object.assign({},e),{children:t,styles:lu(e.styles,fu)});throw Md("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function wu(e){const t=e.children.map((e=>Tu(e)));if(qd(t))return Object.assign(Object.assign({},e),{children:t,styles:lu(e.styles,mu)});throw Md("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const Cu=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function Ou(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:Cu(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>Tu(e)));if(Jd(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw Md("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Tu(e){switch(e.type){case"When":return{type:"When",node:bu(e.node)};case"OneByOneDistribution":return{type:e.type,node:Iu(e.node)};case"Overlay":return{type:e.type,node:Ou(e.node)};case"Column":return{type:e.type,node:(r=e.node,{styles:lu(r.styles,cu),children:r.children.map((e=>Tu(e)))})};case"Row":return{type:e.type,node:(o=e.node,{styles:lu(o.styles,du),children:o.children.map((e=>Tu(e)))})};case"RichText":return{type:e.type,node:(a=e.node,ru(a))};case"CloseButton":return{type:e.type,node:Eu(e.node)};case"CreativeResponse":return{type:e.type,node:Su(e.node)};case"StaticLink":return{type:e.type,node:wu(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:lu(i.styles,uu)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:lu(n.styles,pu)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,su(t))};default:return e}var t,n,i,a,o,r}function xu(e){return Dp(e)}function Au(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const Lu=e=>"scroll"===e||"auto"===e?"visible":e,Nu=ue(["elements","own"]),_u=ue(["transitions","transition","value","own"]),Ru=ue(["elements","wrapper"]),Du=ue(["transitions","transition","value","wrapper"]),ku=ue(["elements","indicator"]),Pu=ue(["transitions","transition","value","indicator"]),ju=ue(["elements","activeIndicator"]),$u=ue(["transitions","transition","value","activeIndicator"]),Gu=ue(["elements","seenIndicator"]),Fu=ue(["transitions","transition","value","seenIndicator"]),Mu=ue(["default","container","overflow"]),Bu=ue(["pressed","container","overflow"]),Uu=ue(["hovered","container","overflow"]),Vu=ue(["focussed","container","overflow"]),zu=ue(["disabled","container","overflow"]),Hu=ue(["container","overflow"]),Wu=J(I(S(["default","container","overflow"]),de(Mu,Lu)),I(S(["pressed","container","overflow"]),de(Bu,Lu)),I(S(["hovered","container","overflow"]),de(Uu,Lu)),I(S(["focussed","container","overflow"]),de(Vu,Lu)),I(S(["disabled","container","overflow"]),de(zu,Lu))),qu=I(S(["container","overflow"]),de(Hu,Lu)),Ju=J(I(S(["elements","own"]),de(Nu,re(Wu))),I(S(["transitions","transition","value","own"]),de(_u,qu))),Ku=I(De("transitions"),(e=>{var t;return G(ke(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),Yu=J(Ju,Ku),Zu=J(I(S(["elements","wrapper"]),de(Ru,re(Wu))),I(S(["transitions","transition","value","wrapper"]),de(Du,qu))),Qu=J(I(S(["elements","indicator"]),de(ku,re(Wu))),I(S(["transitions","transition","value","indicator"]),de(Pu,qu))),Xu=J(I(S(["elements","activeIndicator"]),de(ju,re(Wu))),I(S(["transitions","transition","value","activeIndicator"]),de($u,qu))),ep=J(I(S(["elements","seenIndicator"]),de(Gu,re(Wu))),I(S(["transitions","transition","value","seenIndicator"]),de(Fu,qu)));function tp(e){return"StaticImage"===e.type}function np(e){return"StaticIcon"===e.type}function ip(e){return"BasicText"===e.type}function ap(e){return"DataImage"===e.type}function op(e){return"DataIcon"===e.type}function rp(e){return"RichText"===e.type}function sp(e){return"SlideStateTrigger"===e.type}function lp(e){return"ToggleButtonStateTrigger"===e.type}const cp=ae(te([function(e){return"Row"===e.type&&dp(e.node.children)},function(e){return"Column"===e.type&&dp(e.node.children)},tp,np,rp,ip,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&dp(e.node.children)},function(e){return"StaticLink"===e.type&&dp(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CarouselDistribution"===e.type},function(e){return"GroupedDistribution"===e.type},function(e){return"CloseButton"===e.type&&dp(e.node.children)},function(e){return"ProgressControl"===e.type&&Ip(e.node.children)},function(e){return"ZStack"===e.type&&dp(e.node.children)},function(e){return"FlowRow"===e.type&&dp(e.node.children)},sp,lp]));function dp(e){return cp(e)}const up=J(Ju,Zu,Ku);function pp(e){const t=e.children.map((e=>Dp(e)));if(dp(t))return Object.assign(Object.assign({},ke(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?up(e.styles):void 0});throw Au("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function yp(e){const t=e.children.map((e=>Dp(e)));if(Ip(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Yu(e.styles):void 0});throw Au("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function fp(e){const t=e.children.map((e=>Dp(e)));if(Sp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Yu(e.styles):void 0});throw Au("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function mp(e){const t=e.children.map((e=>Dp(e)));if(Ip(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Yu(e.styles):void 0});throw Au("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const hp=J(Ju,Qu,Xu,ep,Ku);const vp=ae(te([ip,tp,np,ap,op,function(e){return"Row"===e.type&&gp(e.node.children)},function(e){return"FlowRow"===e.type&&gp(e.node.children)},function(e){return"Column"===e.type&&gp(e.node.children)},function(e){return"ZStack"===e.type&&gp(e.node.children)},function(e){return"When"===e.type&&gp(e.node.children)}]));function gp(e){return vp(e)}const bp=ae(te([ip,tp,np,function(e){return"Row"===e.type&&Ip(e.node.children)},function(e){return"FlowRow"===e.type&&Ip(e.node.children)},function(e){return"Column"===e.type&&Ip(e.node.children)},function(e){return"ZStack"===e.type&&Ip(e.node.children)},function(e){return"When"===e.type&&Ip(e.node.children)}]));function Ip(e){return bp(e)}const Ep=ae(te([ip,tp,np,ap,op,function(e){return"Row"===e.type&&Sp(e.node.children)},function(e){return"FlowRow"===e.type&&Sp(e.node.children)},function(e){return"Column"===e.type&&Sp(e.node.children)},function(e){return"ZStack"===e.type&&Sp(e.node.children)},function(e){return"When"===e.type&&Sp(e.node.children)}]));function Sp(e){return Ep(e)}function wp(e){const t=e.children.map((e=>Dp(e)));if(gp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Yu(e.styles):void 0});throw Au("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function Cp(e){const t=e.children.map((e=>Dp(e)));if(Sp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Yu(e.styles):void 0});throw Au("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Op(e){return"Row"===e.type&&Ap(e.node.children)}function Tp(e){return"Column"===e.type&&Ap(e.node.children)}const xp=ae(te([ip,tp,np,ap,op,rp,function(e){return"StaticLink"===e.type},sp,lp,function(e){return"CatalogResponseButton"===e.type},Op,function(e){return"FlowRow"===e.type&&Ap(e.node.children)},Tp,function(e){return"ZStack"===e.type&&Ap(e.node.children)},function(e){return"When"===e.type&&Ap(e.node.children)}]));function Ap(e){return xp(e)}const Lp=te([Op,Tp]);function Np(e){const t=Dp(e.template);if(function(e){return Lp(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?Yu(e.styles):void 0});throw Au("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function _p(e){const t=e.children.map((e=>Dp(e)));if(gp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?Yu(e.styles):void 0});throw Au("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function Rp(e){const t=e.transition?{inTransition:e.transition.in,outTransition:e.transition.out}:void 0;return Object.assign(Object.assign({},e),{children:e.children.map((e=>Dp(e))),transition:t})}function Dp(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>Dp(e))),styles:v.styles?Yu(v.styles):void 0}))};case"When":return{type:e.type,node:Rp(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?Yu(h.styles):void 0,children:h.children.map((e=>Dp(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>Dp(e))),styles:m.styles?Yu(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(f=e.node,Object.assign(Object.assign({},f),{styles:f.styles?Yu(f.styles):void 0,children:f.children.map((e=>Dp(e)))}))};case"Overlay":return{type:e.type,node:pp(e.node)};case"ProgressControl":return{type:e.type,node:mp(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(y=e.node,Object.assign(Object.assign({},ke(["settings"],y)),{viewableItems:y.settings.viewableItems,peekThroughSize:y.settings.peekThroughSize,styles:y.styles?Yu(y.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:yp(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:fp(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},ke(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?Yu(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?Yu(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},ke(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?hp(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?Yu(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?Yu(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:wp(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:_p(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:Cp(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:Np(e.node)};case"RichText":return{type:"RichText",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?Ku(r.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?Ku(o.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?Ku(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?Ku(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?Ku(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?Ku(t.styles):void 0}))};default:return e}var t,n,i,a,o,r,s,l,c,d,u,p,y,f,m,h,v}function kp(e){const t=e.split("."),n=Number(t[0]),i=Number(t[1]);if(t.length<2||Number.isNaN(n)||Number.isNaN(i))throw Error(`Fail to convert version ${e} to a valid version.`);return{major:n,minor:i}}function Pp(e,t){return e.major===t.major&&e.minor===t.minor}const jp=(e,t,n)=>E([Ee(e),je(t)])(n);function $p(e,t){return Pp(t,{major:0,minor:0})?$p(Fd(e),{major:0,minor:1}):function(e,t){return 0===t.major&&jp(1,23,t.minor)}(0,t)?$p(xu(e),{major:1,minor:0}):e}function Gp(e,t){return Pp(t,{major:0,minor:0})?Gp(function(e){return Object.assign(Object.assign({},e),{layout:Fd(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&jp(1,23,t.minor)}(0,t)?Gp(function(e){return Object.assign(Object.assign({},e),{layout:xu(e.layout)})}(e),{major:1,minor:0}):e}function Fp(e,t,n,i){const a=kp(n);if(i){const s=kp(i);if(r=a,(o=s).major<r.major||o.major===r.major&&o.minor<r.minor||Pp(s,a))return t(e,s);throw Error(`Could not migrate received layout config, config schema version ${i} is higher than the supported version ${n}.`)}return t(e,kp("0.0"));var o,r}function Mp(e){var t;try{return Object.assign(Object.assign({},$e(e)),{offer:Object.assign(Object.assign({},$e(e.offer)),{creative:Td(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},$e(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?Ad(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema,childLayouts:re(Bp,null!==(t=e.layoutVariant.childLayouts)&&void 0!==t?t:[])})})}catch(t){throw t.message?t:Od("Slot",e.instanceGuid)}}function Bp(e){return Object.assign(Object.assign({},$e(e)),{childLayoutSchema:"string"==typeof e.childLayoutSchema?Ad(e.childLayoutSchema,"ChildLayoutRootSchema",e.childLayoutId):e.childLayoutSchema})}function Up(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},$e(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?Ad(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:re(Mp,e.slots)})}catch(t){throw t.message?t:Od("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=ue(["outerLayoutSchema"]),a=ue(["slots"]),o=ue(["layoutVariant","layoutVariantSchema"]);return J(de(a,re(de(o,(e=>Fp(e,$p,t,n))))),de(i,(e=>Fp(e,Gp,t,n))))(e)}(t,Cs.DCUI_SCHEMA_VERSION)}}const Vp=O([[z({signalType:j("SignalSecondaryResponse")}),function*(e,t){return yield qe({type:Xr,payload:{level:Ss,code:Ds,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[z({isPositive:j(!0)}),function*(e,t,n){var i;if("url"in e&&e.url){const a=e.instanceGuid;yield qe({type:en,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:a,responseActionPayload:{name:"Url",transformedTrafficURL:e.url,creativeInstanceGuid:e.creativeInstanceGuid}}});const o=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(i=e.urlBehavior)&&void 0!==i?i:"newTab",r=yield*function*(e,t,n){try{const i=yield ze(vl,t),a=El(i)?i.ref:void 0;return yield ze(e.addAdvertiserWindowRef,a,n),El(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield qe({type:Xr,payload:{level:Ss,code:ks,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield qe({type:Xr,payload:{level:Ss,code:ks,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:o,external:{partner:n}},a);return"self"===o?"END":r}return yield qe({type:Xr,payload:{level:Ss,code:Ds,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[x,function*(){return"EXPLICIT_DISMISSAL"}]]);function*zp(e){return yield qe({type:Xr,payload:{level:Ss,code:Ds,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*Hp(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=Zt(t.payload)||Qt(t.payload)||Yt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield qe({type:an,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:es,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield qe({type:an,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*zp(a):yield*Vp(a,e.context,e.partner);break;case"CaptureOnly":yield qe({type:an,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:an,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*zp(a):yield*function*(e){return yield qe({type:en,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:"CaptureOnly",creativeInstanceGuid:e.creativeInstanceGuid}}}),e.isPositive?"SUCCESS":"EXPLICIT_DISMISSAL"}(a);break;case"Fulfillment":yield qe({type:Xr,payload:{level:Ss,code:"INCORRECTLY_HANDLE_FULFILLMENT_ACTION",message:`Fulfillment action is incorrectly handled by the orchestrator instead of a module with the option ID: ${a.instanceGuid}`}}),n="ERROR";break;case"External":yield qe({type:Xr,payload:{level:Ss,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}Xt(t.payload)||(yield qe(function(e,t){switch(e){case"SUCCESS":return{type:Xc,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:Xc,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:Xc,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:Xc,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:Xc,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:Yc,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Wp(e,t,n,i){return st((a=>(i().then((e=>Promise.all([t.getRoktPageInstanceGuid(),(t.getUId||t.getPluginInstanceId)()]).then((([t,n])=>Object.assign(Object.assign({},e),{pageInstanceGuid:t,pluginInstanceId:n}))).catch((()=>e)))).then((({moduleConnectorBuilder:t,pageInstanceGuid:i,pluginInstanceId:o})=>{const r=`rokt-${n}-${o}`.toLowerCase();if(!customElements.get(r)){const o=t.withGatewayFactory(e).withLogger((e=>{a({type:Xr,payload:{level:e.level,code:e.code,message:e.message,additionalInformation:Object.assign(Object.assign({},e.additionalInformation),{moduleName:n,layoutType:"LayoutVariant",pageInstanceGuid:null!=i?i:"N/A"})}})})).build();customElements.define(r,o)}})).catch((e=>{const t=e&&"object"==typeof e&&"message"in e?e.message:void 0,i=e&&"object"==typeof e&&"stack"in e?e.stack:void 0;a({type:Xr,payload:{level:Dt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const qp={"standard-marketing":()=>Promise.resolve().then((function(){return mf})),"add-to-cart":()=>Promise.resolve().then((function(){return hm})),"instant-purchase":()=>Promise.resolve().then((function(){return ih})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return Ph}))};function*Jp(e,t,n){let i=yield Ke((e=>e.module.loadedModules));for(const a of n.payload.modules)i&&!(null==i?void 0:i.includes(a))&&(i=[...i,a],yield Qe(Kp,e,t,a))}function*Kp(e,t,n){if(n in qp){yield qe({type:zc,payload:n});const i=yield ze(Wp,e,t,n,qp[n]);yield ze(_s,i)}else yield qe({type:Xr,payload:{level:Is,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*Yp(e){const t=yield Ke((e=>Pd.getDistributionViewableItems(e.layout?Pd.getDistribution(e.layout.layoutSchema):void 0))),n=yield Ke((n=>{var i;const a=Qs(e.payload.activeBreakpoint)(n);return a>=0&&t?null!==(i=t[Math.min(t.length-1,a)])&&void 0!==i?i:1:void 0}));if("number"==typeof n){const e={type:Kc,payload:{groupSize:n}};yield qe(e)}}const Zp=O([[(e,t,n,i)=>"END"===e.offerProcessStatus,$({type:zr})],[(e,t,n,i)=>t.isLastOffer&&n,$({type:zr})],[(e,t,n,i)=>1===i&&!t.isLastOffer,$({type:qc})],[x,$(void 0)]]);function*Qp(e){const t=yield Ke((e=>({exists:null!==e.progression,isLastOffer:ud(e)}))),n=yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.groupSize}));var i;null!=(i=t)&&i instanceof Object&&"exists"in i&&"isLastOffer"in i&&t.exists&&(yield*function*(e,t,n){const i=yield Ke((e=>e.settings.closeOnComplete)),a=Zp(e,t,"boolean"==typeof i&&i,n);a&&(a.type===zr&&(yield qe({type:an,payload:{name:"PLACEMENT_COMPLETED"}})),yield qe(a))}(e.payload,t,n))}function Xp(e){return e.type===Xc&&"Interactive"===e.payload.event}function ey(e){return e.type===Xc&&"Interactive"!==e.payload.event}function*ty(e){switch(e.payload.event){case"Dismissed":yield qe({type:Yc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield qe({type:ed,payload:{key:"offerComplete",value:O([[j("Error"),$(-1)],[j("Success"),$(1)],[x,$(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:Yc,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield qe({type:qt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:an,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*ny(e,t){var n;try{const n=yield Ke((e=>{var t,n,i;return null!==(i=null===(n=null===(t=e.layout)||void 0===t?void 0:t.settings)||void 0===n?void 0:n.enablePartnerValidation)&&void 0!==i&&i}));n&&(yield ze(e.partner.send,ul.PartnerValidationEvent.SET_PARTNER_VALIDATION_STATUS,{errors:t.payload.errors}))}catch(i){const a=yield Ke((({slots:e})=>{var n,i;return"number"==typeof t.payload.offerPositionIndex?null!==(i=null===(n=e.at(t.payload.offerPositionIndex))||void 0===n?void 0:n.layoutVariant.moduleName)&&void 0!==i?i:"Unknown":"orchestrator"})),o=null!==(n=yield ze(e.context.getRoktPageInstanceGuid))&&void 0!==n?n:"N/A",r={type:Xr,payload:{level:kt,code:"PARTNER_VALIDATION_UPDATE_FAILED",message:"Failed to update the partner with error status",additionalInformation:{moduleName:a,layoutType:"number"==typeof t.payload.offerPositionIndex?"LayoutVariant":"OuterLayout",pageInstanceGuid:o}}};yield qe(r)}}function*iy(e){const t=yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:id.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:zr}),t?(yield qe({type:en,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield qe({type:en,payload:{name:"SignalDismissal",parentGuid:t}})):yield qe({type:Xr,payload:{level:Es,code:Ps,message:"ParentGuid does not exist"}})}function*ay(e,t){yield Ye([Ze(Xr,Rs.bind(null,e.errorService.raise)),Xe(Vr,$d.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ze(Hc,Jp.bind(null,t,e.contextService)),Xe(td,Hp.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ze(Yc,Qp),Ze(ey,ty),Ns(Xp,ty),Xe(Mr,ol.bind(null,e.displayService)),Xe(zr,Ol.bind(null,e.contextService)),Xe(Qc,iy),Xe(Qr,Zl),Ze(en,Dl),Ze(rn,kl),Ls(qt,Kl.bind(null,e.metricsService)),Ls(Zr,Pl.bind(null,e.rdnService)),Ze(es,Rl.bind(null,e.errorService.raise)),Xe(Gr,Yp),Ze(nn,Jl),Ze(sn,Yl.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),Xe(ln,ny.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var oy,ry,sy,ly,cy,dy=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},uy=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const py={[un.SET_CUSTOM_STATE]:id.SET_CUSTOM_STATE,[un.SET_DOMAIN_STATE]:id.SET_DOMAIN_STATE,[un.SET_GLOBAL_OFFER_DATA_CART]:id.SET_GLOBAL_OFFER_DATA_CART,[un.OFFER_LIFECYCLE]:ad.OFFER_LIFECYCLE,[un.OFFER_ENGAGEMENT]:ad.OFFER_ENGAGEMENT,[un.SET_PARTNER_VALIDATION_STATUS]:ad.SET_PARTNER_VALIDATION_STATUS};class yy{constructor(e){oy.add(this),ry.set(this,void 0),dy(this,ry,e,"f")}getState(e){const t=uy(this,ry,"f").getState();return{breakpoint:t.breakpoint,progression:pd(t),customStates:el(t,e.offerPositionIndex),domainStates:yd(t,e.offerPositionIndex)}}dispatch(e,t){uy(this,ry,"f").dispatch(uy(this,oy,"m",cy).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),uy(this,ry,"f").subscribe((()=>{t(this.getState(e))}))}}function fy(e,t){const n=ot(),i={},a=it({reducer:cd,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},dd()),t),middleware:e=>{return e({thunk:!1,serializableCheck:!1}).concat((t=i,e=>e=>n=>{if("object"==typeof n&&null!==n&&"type"in n){const i=n.type,a=t[`${i}`];return e(a?a(n):n)}return e(n)}),n);var t}}),o=(r=function(e){return new yy(e)}(a),s=e.childPlugin.create,l=e.partnerInteractionService.onEvent,(e,t)=>new fa(r,s,e,t,l));var r,s,l;n.run(ay,e,o),n.run(Ll,e,Up);const c={};return Object.assign(Object.assign({},a),{extend:({reducer:e,interceptors:t,sagas:o})=>{e&&(Object.assign(c,e),a.replaceReducer(at(Object.assign(Object.assign({},cd),c)))),t&&Object.assign(i,t),o&&n.run(o)}})}ry=new WeakMap,oy=new WeakSet,sy=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n.offerPositionIndex,creativeInstanceGuid:n.creativeInstanceGuid})}},ly=function(e,t){return t.type===rn?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):(t.payload.creativeInstanceGuid=e.creativeInstanceGuid,t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid)),t},cy=function(e,t){return function(e){return e.type in py}(t)?uy(this,oy,"m",sy).call(this,py[t.type],t.payload,e):t.type===en||t.type===rn?uy(this,oy,"m",ly).call(this,e,t):t};var my=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const hy={ctx:new Map([[Vc.name,Vc],[Mc.name,Mc],[Sc.name,Sc],[_c.name,_c]]),cache:[]};function vy(n,i){return my(this,void 0,void 0,(function*(){const{pluginId:o,pageInstanceGuid:r}=yield function(e){return Promise.allSettled([(e.contextService.getUId||e.contextService.getPluginInstanceId)(),e.contextService.getRoktPageInstanceGuid()]).then((([e,t])=>({pluginId:"fulfilled"===e.status?e.value:Nt.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:Nt.pageInstanceGuid}))).catch((()=>Nt))}(i),s=y(n),l=fy(i);s.render(t(a.StrictMode,{children:[e(_r,{}),e(v,{store:l,children:t(Va.Provider,{value:o,children:[e(Ws,{}),e(xi.Provider,{value:n,children:e(yr,{extensions:hy,extendStore:l.extend.bind(l),children:e(Dd,{pageInstanceGuid:r})})})]})})]}))}))}class gy{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const by=()=>{},Iy=(e=by,t=by,n=by)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class Ey{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=Iy(e,t,n);let a,o=!0;const r={next:e=>{o&&i.next(e)},complete:()=>{o&&(a&&a(),i.complete(),o=!1)},error:e=>{o&&(i.error(e),o=!1)}};a=this._setupFn(r),o||a&&a();const s=new gy;return s.add({unsubscribe:()=>{a&&a(),o=!1}}),s}}class Sy extends Ey{constructor(){super((e=>(this._isComplete&&e.complete(),this._observers.push(e),()=>this._observers=this._observers.filter((t=>t!==e))))),this._observers=[],this._isComplete=!1}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){this._isComplete=!0;for(const e of this._observers)e.complete()}asObservable(){return new Ey((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class wy extends Sy{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=Iy(e,t,n);return i.next(this._lastValue),super.subscribe(i)}next(e){return this._lastValue=e,super.next(e)}getValue(){return this._lastValue}}class Cy extends Sy{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=Iy(e,t,n);let a=!0;return this._buffer.filter((e=>(e===this._error&&(a=!1),a))).forEach((e=>i.next(e))),this._error&&i.error(this._error),i.error=e=>{this._error=e,t(e)},super.subscribe(i)}next(e){this._error||this._addToBuffer(e),super.next(e)}error(e){this._error=e,this._addToBuffer(e),super.error(e)}_addToBuffer(e){-1!==this._bufferLength&&this._buffer.length===this._bufferLength?(this._buffer.shift(),this._buffer.push(e)):this._buffer.push(e)}}const Oy={CompletedBeforeEmit:"CompletedBeforeEmit"},Ty=(e,t)=>{let n;const i="object"==typeof t;return new Promise(((a,o)=>{n=e.subscribe(a,o,(()=>{i?a(t.defaultValue):o(new Error(Oy.CompletedBeforeEmit))}))})).then((e=>(n.unsubscribe(),e))).catch((e=>{throw n.unsubscribe(),e}))},xy=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),Ay=(e,t)=>new Ey((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function Ly(e){return new Ey((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const Ny=(...e)=>new Ey((t=>{const n=new gy;let i=0;for(const a of e)n.add(a.subscribe((e=>t.next(e)),(e=>t.error(e)),(()=>{i+=1,i>=e.length&&t.complete()})));return()=>n.unsubscribe()})),_y=(...e)=>new Ey((t=>{for(const n of e)t.next(n)})),Ry=(...e)=>new Ey((t=>{if(!e.length)return t.complete(),by;const n=new gy,i=new Array(e.length),a=new Array(e.length),o=e=>!i.includes(void 0)&&t.next(e);for(let t=0;t<e.length;t++){const r=e[t].subscribe((e=>{a[t]=e,i[t]=!0,o(a)}));n.add(r)}return()=>n.unsubscribe()}));var Dy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};function ky(e,t){return new Py(e,t)}class Py{constructor(e,t){this._target=e,this._handler=t}subscribe(e,t,n){const i=e.next?e.next.bind(e):e,a={next:(...e)=>Dy(this,void 0,void 0,(function*(){try{yield i(...e)}catch(e){this._handler(e)}})),error:e.error?e.error.bind(e):t,complete:e.complete?e.complete.bind(e):n};return this._target.subscribe(a)}}class jy{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var $y=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const Gy=e=>(...t)=>new Ey((n=>{const i=e.subscribe((e=>$y(void 0,void 0,void 0,(function*(){try{let i=new jy(e);for(const e of t){const t=e(i);if(i=t.then?yield t:t,!0===i.skip||!0===i.complete)break}if(i.skip)return;n.next(i.value),!0===i.complete&&n.complete()}catch(e){n.error(e)}}))),(e=>n.error(e)),(()=>n.complete()));return()=>i.unsubscribe()})),Fy=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),My=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),By=e=>t=>{const n=e(t.value);return new jy(n)},Uy=e=>t=>(e(t.value),t),Vy={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},zy={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},Hy={getBreakpointCSSClass:Ht},Wy="CHILD_LAYOUTS/ADD_LAUNCHED",qy="DYNAMIC_DATA/ADD";function Jy(e={launched:{}},t){if(t.type===Wy){const n=t.payload;return n.childLayoutId?b(["launched",n.childLayoutId],n.shouldRelaunch,e):e}return e}function Ky(e=null,t){return e}function Yy(e=null,t){if(t.type===qy){const n=t.payload;return e?n?Ge(e,n):e:n}return e}function Zy(e,t){var n;return null===(n=e.childLayouts.launched[t])||void 0===n||n}function Qy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer}function Xy(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.schemaVersion}function ef(e){var t,n;return null!==(n=null===(t=e.dynamicData)||void 0===t?void 0:t.text)&&void 0!==n?n:{}}const tf="FAILED_TO_LAUNCH_CHILD_LAYOUT";function*nf(e,t,n){var i;if(yield null===(i=Ke(Zy,n.payload.childLayoutId))||void 0===i||i){const i=yield Ke(Xy),o=yield Ke(Qy),r=yield Ke(ef);try{const s=(a=function(e,t,n,i){return{instanceGuid:e.instanceGuid,childLayoutId:e.childLayoutId,childLayoutSchema:e.childLayoutSchema,offer:t,layoutSchemaVersion:n,content:{text:i}}}(n.payload,o,i,r),JSON.parse(JSON.stringify(a)));try{yield ze(e.createChildPlugin,{name:"dcui-child",config:s,targetElementSelector:n.payload.targetElementSelector})}catch(e){yield ze(t,{level:kt,code:tf,message:"Could not launch child layout, failed creating plugin."})}}catch(e){yield ze(t,{level:kt,code:tf,message:"Could not launch child layout, failed to make the child layout config serializable."})}yield qe({type:Wy,payload:{childLayoutId:n.payload.childLayoutId,shouldRelaunch:!1}})}var a}function af(){const t=La(),n=m(ef),i=Qi()({state:n},"textContent");return e(Zi,{value:i,children:e(Ci,{children:e=>e(t)})})}const of={staticData:Ky,dynamicData:Yy,childLayouts:Jy};function rf(e={}){return Object.assign({staticData:null,dynamicData:null,childLayouts:{launched:{}}},e)}function sf(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function lf(e){return"object"==typeof e&&null!==e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&"string"==typeof t))}function*cf(e,t,n,i){for(;;){switch(yield We(e)){case"CLOSED":t({type:tn,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":if(n&&i){yield ze(i);break}t({type:tn,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:tn,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*df(e,t,n){if(Kt(n)){const{responseOption:i,fulfillment:a}=n,o=Xt(n);yield qe({type:en,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const r=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof r&&"onClose"in r&&"close"in r){const i=yield ze(sf,r);if("object"==typeof i&&"take"in i){const a=function(e,t,n,i){if(n.responseOption.rclid)return function*(){yield qe({type:an,payload:{name:"REALTIME_OFFER_FULFILLMENT_CONVERSION",body:{rclid:n.responseOption.rclid,accountID:n.accountID,referralCreativeID:n.referralCreativeID}}}),yield ze(uf,e,t,i)}}(e,t,n,r);return void(yield ze(cf,i,e.globalDispatch.bind(e),o,a))}}yield ze(t,{level:Dt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Dt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}function*uf(e,t,n){const i=function(e){return st((t=>{const n=e.onEvent({name:yl,source:"partner",callback:e=>{lf(e)&&t({eventName:yl,data:e})}},{name:fl,source:"partner",callback:e=>{lf(e)&&t({eventName:fl,data:e})}});return()=>{n()}}))}(e);try{for(;;){const a=yield We(i);switch(a.eventName){case yl:yield qe({type:an,payload:{name:yl,body:a.data}}),yield qe({type:qy,payload:{text:a.data}}),e.globalDispatch({type:tn,payload:{event:"Completed",completionReason:"Success"}}),n&&(yield ze(n.close.bind(n)));break;case fl:e.globalDispatch({type:tn,payload:{event:"Completed",completionReason:"Error"}}),n&&(yield ze(n.close.bind(n)));break;default:t({level:Dt,code:"UNKNOWN_REALTIME_OFFER_FULFILLMENT_EVENT",message:`Unknown event: ${a.eventName}`})}}}catch(e){const n=e;t({level:kt,code:"FAILED_TO_PROCESS_REALTIME_OFFER_FULFILLMENT_EVENT",message:null==n?void 0:n.message})}finally{(yield Je())&&i.close()}}function*pf(e,t,n){const i=Zt(n.payload)||Qt(n.payload)||Yt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":yield ze(e.globalDispatch.bind(e),n),Xt(n.payload)&&(yield qe({type:an,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID}}}),yield ze(uf,e,t));break;case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:an,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:an,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*df(e,t,n.payload)}}function*yf(e,t){yield Ye([Xe(Jt,pf.bind(null,e,t)),Ze(dn,nf.bind(null,e,t)),Ze("*",Os.bind(null,[Jt,dn],e))])}Object.assign({},un);const ff=(new Ca).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=rf({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=rf()){const i=ot(),a=it({reducer:of,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(yf,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Fa,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(_r,{}),e(v,{store:s,children:e(Lr,{settings:n,dispatch:s.dispatch,children:e(af,{})})})]})}))}}));var mf=Object.freeze({__proto__:null,moduleConnectorBuilder:ff});const hf="CART/UPDATE",vf="CATALOG_ITEM/RESPONSE",gf="USER_CREATIVE_RESPONSE_HISTORY/ADD",bf=O([[(e,t)=>0!==t,j],[(e,t)=>!Number.isNaN(e)&&0===t,j],[(e,t)=>Number.isNaN(e)&&0===t,Me]]);function If({isChecked:t,isDisabled:n,outerClassname:i,outerCheckedClassname:a,innerClassname:o,innerCheckedClassname:r}){return e("span",{style:{display:"flex"},children:e("span",{className:`${i} ${t?a:""}`,tabIndex:n?-1:1,style:{display:"flex",boxSizing:"border-box"},children:e("span",{className:`${o} ${t?r:""}`,style:{flex:1}})})})}const Ef="catalogRadioGroup__label",Sf=["Enter","Space"],wf={elements:{own:[],optionContainer:[],radioButtonInner:[{default:{border:{borderRadius:11},background:{backgroundColor:{light:"#FFF"}}}}],radioButtonInnerChecked:[{default:{background:{backgroundColor:{light:"#529ff4"}}}}],radioButtonOuter:[{default:{border:{borderRadius:16,borderColor:{light:"#999"},borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"fixed",value:16},height:{type:"fixed",value:16}},spacing:{padding:"4"}}}],radioButtonOuterChecked:[]}};function Cf(e,t,n){return e.map(O([[G(j("Required"),F("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[x,$("")]])).filter(Fe)}function Of({schema:n,testId:i}){const r=f(),s=Ua(),[l,c]=m((e=>{var t,i;const a=s.cartItemId in e.cart?null!==(i=null===(t=e.cart[s.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==i?i:0:NaN;return[a,Cf(n.validations,n.options.length,a)]})),d=_a(),{tabIndex:u,styles:p,isDisabled:y}=It(d);o((()=>{y||r(Tf(c))}),[]);const h=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=s.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=s.maxItemCount)&&void 0!==n?n:1/0)}));function v(e){r({type:vf,payload:{catalogItem:s,quantity:e}});const t=Cf(n.validations,n.options.length,e);r(Tf(t))}return h.length>0?e(Lo,{styles:n.styles?zt(wf,n.styles):wf,children:({classnames:n,mapperRef:o})=>e("div",{className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},p),children:e(ea,{value:o(Ef),children:a.Children.toArray(h.map(((a,o)=>{var r;const c=bf(l,a.quantity),d=e=>i?`${i}-option${o}${e}`:void 0;return t("label",{tabIndex:u,"aria-disabled":y,style:{display:"flex"},className:`${Ef} ${null!==(r=null==n?void 0:n.optionContainer)&&void 0!==r?r:""}`,onKeyDown:e=>{c||!Sf.includes(e.code)||y||v(a.quantity)},"data-e2e":"CatalogRadioGroup-Option","data-e2e-quantity":`${a.quantity}`,"data-testid":d("Label"),children:[e("input",{type:"radio",style:{display:"none"},tabIndex:-1,name:s.instanceGuid,value:a.quantity,checked:c,onChange:()=>v(a.quantity),"aria-disabled":y,disabled:y}),e(If,{isChecked:c,isDisabled:y,innerClassname:null==n?void 0:n.radioButtonInner,innerCheckedClassname:null==n?void 0:n.radioButtonInnerChecked,outerClassname:null==n?void 0:n.radioButtonOuter,outerCheckedClassname:null==n?void 0:n.radioButtonOuterChecked}),e(Pr,{schema:a,testId:d("Content")})]})})))})})}):null}function Tf(e){return{type:ln,payload:{errors:e}}}function xf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Af(t){const n=f(),i=Oi(),a=Ua(),o=_a(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return e(Lo,{styles:t.schema.styles,children:({classnames:o})=>e("button",{type:"button",tabIndex:r,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:vf,payload:{catalogItem:a,quantity:1}})},className:null==o?void 0:o.own,children:xf(t.schema.children,i,t.testId)})})}const Lf={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},Nf=new Map([["&","_;^;_"]]),_f=new RegExp(`<a *(?=${Lf.allowedAttributes.a.join("|")}|>)`,"g"),Rf=new RegExp(`<a *(?:(?:${Lf.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Df=new RegExp("(<br *?>)|(<br *?/>)","g"),kf=new RegExp(`<ul *(?=${Lf.allowedAttributes.ul.join("|")}|>)`,"g"),Pf=new RegExp(`<ol *(?=${Lf.allowedAttributes.ol.join("|")}|>)`,"g"),jf=new RegExp("<li *(?=>|\\s[^>]*>)","g"),$f="<br/>";function Gf(t){const n=Qi(),i=_a(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Rf,((e,t)=>{const n=t.replaceAll("&",Nf.get("&"));return e.replace(t,n)})).replaceAll(Df,$f)}(e);return t===vt(t,Lf)}(e))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Lo,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class="${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0)),l=((null==n?void 0:n.list)?`class="${n.list}"`:"")+' style="list-style-type: none; padding-inline-start: 0px; display: flex; flex-direction: column;"',c=((null==n?void 0:n.listItem)?`class="${n.listItem}"`:"")+' style="display: flex; align-items: flex-start; flex-shrink: 0; flex-grow: 1;"',d=`class="rokt-icon${(null==n?void 0:n.span)?" "+n.span:""}" style="display: inline-block; pointer-events: none; user-select: none;" aria-disabled="true"`,u=a.replace(_f,`<a ${i.join(" ")}`).replace(kf,`<ul ${l}`).replace(Pf,`<ol ${l}`).replace(jf,`<li ${c}><span ${d}>Check</span`);return p=a,new RegExp("</(p|ul|ol)>").test(p)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}});var p}}):null}const Ff={internally:"_top",externally:"_blank"};function Mf(t,n,i,a,o){return e(ea,{value:i(n),children:Bf(t,a,o)})}function Bf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Uf(t){var n,i;const a=Ff[t.schema.open],o=Oi(),r=Ua(),s=_a(),l=f(),c=null!==(n=r.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=It(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(Lo,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:en,payload:{name:"SignalResponse",parentGuid:null!==(e=r.instanceGuid)&&void 0!==e?e:"",responseActionPayload:{name:"Url",transformedTrafficURL:c}}})},"data-testid":t.testId,"data-e2e":"CatalogUrlLink",target:null!=a?a:"_blank",tabIndex:d,"aria-disabled":p,"aria-label":null!==(s=t.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:"block"},u),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Mf(t.schema.children,null==n?void 0:n.own,i,o,t.testId):Bf(t.schema.children,o,t.testId)})}}):null}function Vf(e,t){const n=e.cart[t];return n||null}function zf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[],a=function(e){return Object.values(e.cart).filter((e=>null!==e))}(e);return a.filter((e=>i.find((t=>t.catalogItemId===e.catalogItemId))))}function Hf(e,t){var n,i,a,o;const r=null===(n=e.staticData)||void 0===n?void 0:n.offer;if(r){const n=function(e){return zf(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=Vf(e,t.cartItemId),l=(null!==(i=null==r?void 0:r.maxTotalItemsQtyInOffer)&&void 0!==i?i:1/0)-n,c=(null!==(a=t.maxItemCount)&&void 0!==a?a:1/0)-(null!==(o=null==s?void 0:s.quantity)&&void 0!==o?o:0);return Math.min(l,c)}return 0}function Wf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[];return i.length>0?i:null}function qf(e,t){var n,i;return null!==(i=null===(n=Wf(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function Jf(e){var t;const n=null===(t=Wf(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function Kf(e){var t,n;return null!==(n=null===(t=Jf(e))||void 0===t?void 0:t.reduce(((e,t)=>{var n;return e+(null!==(n=t.preSelectedQuantity)&&void 0!==n?n:0)}),0))&&void 0!==n?n:0}const Yf=G((e=>e.filter((e=>!ce(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),ne,B("cart"));function Zf(t,n,i,a,o){return e(ea,{value:i(n),children:a(t,void 0,o)})}function Qf(e,t,n){return t(e,void 0,n)}function Xf(i){var a;const{schema:o,testId:r}=i,{a11yInputLabel:s,styles:l,showInputField:c,buttons:d,forcedUpsellText:u}=o,{increment:p,decrement:y,a11yIncrementLabel:h,a11yDecrementLabel:v}=d||{},g=f(),b=Ua(),I=Oi(),E=Qi(),S=_a(),{tabIndex:w,styles:C,isDisabled:O}=It(S),T=m((e=>function(e,t){var n,i,a;const o=qf(e,t);return Boolean(o&&(null!==(n=o.preSelectedQuantity)&&void 0!==n?n:0)>0&&o.preSelectedQuantity===(null!==(i=o.minItemCount)&&void 0!==i?i:0)&&o.preSelectedQuantity===(null!==(a=o.maxItemCount)&&void 0!==a?a:0))}(e,b.catalogItemId))),x=m((e=>Vf(e,b.cartItemId))),A=m((e=>Hf(e,b))),L=(null==x?void 0:x.quantity)||0,N=It(O||L<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),_=It(O||A<=0?"DISABLED":S),R=It(O||T?"DISABLED":S),D=e=>{var t;const n=e.target.value;if(0===n.length)k(null!==(t=b.minItemCount)&&void 0!==t?t:0);else{const e=Number(n);!Number.isNaN(e)&&e>=0&&k(e)}},k=e=>{O||g({type:vf,payload:{catalogItem:b,quantity:e}})};return e(Lo,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign({display:"flex",flexDirection:"row"},C),children:T&&u?e(Fo,{schema:u,isInline:!1,testId:r?`${r}-forced-upsell-text`:void 0}):t(n,{children:[y?e("button",{className:null==i?void 0:i.decrementButton,style:Object.assign(Object.assign({},N.styles),{cursor:N.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(L-1)},tabIndex:N.tabIndex,"aria-label":v||void 0,disabled:N.isDisabled,"data-testid":r?`${r}-decrement-button`:void 0,children:e(Zi,{value:E,children:(null==i?void 0:i.decrementButton)?Zf(y,i.decrementButton,a,I,r):Qf(y,I,r)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},R),{cursor:R.isDisabled?"not-allowed":"auto",caretColor:R.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:L,onChange:D,"aria-label":s||void 0,tabIndex:w,disabled:O,"data-testid":r?`${r}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:C,"data-testid":r?`${r}-quantity-text`:void 0,children:L}),p?e("button",{className:null==i?void 0:i.incrementButton,style:Object.assign(Object.assign({},_.styles),{cursor:_.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(L+1)},tabIndex:_.tabIndex,"aria-label":h||void 0,disabled:_.isDisabled,"data-testid":r?`${r}-increment-button`:void 0,children:e(Zi,{value:E,children:(null==i?void 0:i.incrementButton)?Zf(p,i.incrementButton,a,I,r):Qf(p,I,r)})}):null]})})})}const em={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(Af,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"InsuranceRichText":return e(Gf,{schema:n.node});case"CatalogUrlLink":return e(Uf,{schema:n.node});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(Of,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(Xf,{schema:t.node})}};function tm(){const t=La(),n=Oi();return e(Ti,{value:n,overrides:em,children:e(Ci,{children:e=>e(t)})})}const nm={cart:function(e={},t){if(t.type===hf){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,o=Ts(n,i);return Object.assign(Object.assign({},e),{[a]:o})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===gf?e.concat(t.payload.responseId):e},staticData:Ky,childLayouts:Jy};const im="INVALID_PARTNER_MESSAGE",am="MISCONFIGURED_CATALOG_ITEM",om="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*rm(e){var t,n;const i=yield Ke(Jf),a=yield Ke(Kf),o=yield Ke((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(um(a)&&um(o)&&a>o)yield ze(e,{level:kt,code:am,message:`Catalog items preselected quantities (${a}) exceeds the maximum allowed quantity (${o}) for this offer`});else if(i&&Array.isArray(i))for(const a of i){const i=null!==(t=a.preSelectedQuantity)&&void 0!==t?t:0,o=null!==(n=a.maxItemCount)&&void 0!==n?n:1/0;i>o?yield ze(e,{level:kt,code:am,message:`Preselected quantity (${i}) is greater than maxItemCount (${o}) for catalog item (${a.instanceGuid})`}):yield*dm(a,i,!0)}}function*sm(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*dm(i,a,!1)){const n=yield Ke((e=>{var t,n,i;const a=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative.responseOptionsMap.positive,o=e.userCreativeResponseHistory.at(-1),r=null===(n=e.staticData)||void 0===n?void 0:n.offer.creative.responseOptionsMap.negative;if(a&&o&&a.id===o&&"SignalGatedResponse"===(null==r?void 0:r.signalType))return function(e,t){var n;switch(e.action){case"Fulfillment":{const i=null==t?void 0:t.creative.fulfillment;return wt(i)?{type:Jt,payload:{fulfillment:i,responseOption:e,accountID:null!==(n=null==t?void 0:t.accountId)&&void 0!==n?n:""}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:Jt,payload:Object.assign(Object.assign({},e),{accountID:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:Jt,payload:e}}}(r,null===(i=e.staticData)||void 0===i?void 0:i.offer)}));null!=(o=n)&&"object"==typeof o&&"type"in o&&"payload"in o&&"object"==typeof o.payload?yield ze(e.globalDispatch,n):function(e){return"string"==typeof e}(n)&&(yield ze(t,{level:kt,code:"INVALID_RESPONSE_OBJECT",message:n}))}var o}function*lm(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:cl.V2.PartnerMessage.UpdateCartItem,source:"partner",callback:e=>{!function(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&!("unitPrice"in e)}(e)?t({level:kt,code:im,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield We(n);yield ze(cm,e,t)}}catch(e){const n=e;t({level:kt,code:om,message:null==n?void 0:n.message})}finally{(yield Je())&&n.close()}}function*cm(e,t){const{cartItemId:n,quantity:i}=e,a=yield Ke(Vf,n);if(pm(a)){const e=yield Ke(qf,a.catalogItemId);null!==(o=e)&&"object"==typeof o&&"catalogItemId"in o&&"price"in o?yield*dm(e,i,!1):yield ze(t,{level:kt,code:om,message:`Catalog item not found for cart item id (${n})`})}else yield ze(t,{level:kt,code:om,message:`Cart item not found for cart item id (${n})`});var o}function*dm(e,t,n){var i;const a=yield Ke(Vf,e.cartItemId),o=yield Ke(Hf,e),r=um(o)?o:0,s=pm(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=r){yield qe({type:hf,payload:{catalogItem:e,quantity:t}});const i=yield Ke(Vf,e.cartItemId),o=yield Ke(Yf);return yield qe({type:cn,payload:{cart:o}}),yield qe({type:en,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield qe({type:an,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function um(e){return"number"==typeof e}function pm(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*ym(e,t){var n;yield qe({type:gf,payload:{responseId:(n=t.payload,Kt(n)?n.responseOption.id:n.id)}}),yield ze(e.globalDispatch.bind(e),t)}function*fm(e,t){yield Ye([et(rm.bind(null,t)),et(lm.bind(null,e,t)),Xe(vf,sm.bind(null,e,t)),Xe(Jt,ym.bind(null,e)),Ze(dn,nf.bind(null,e,t)),Ze("*",Os.bind(null,[Jt,dn],e))])}Object.assign(Object.assign({},un),{CATALOG_ITEM_RESPONSE:vf});const mm=(new Ca).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=function(e={}){return Object.assign({cart:{},userCreativeResponseHistory:[],staticData:null,childLayouts:{launched:{}}},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n){const i=ot(),a=it({reducer:nm,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(fm,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Fa,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(_r,{}),e(v,{store:s,children:e(Lr,{settings:n,dispatch:s.dispatch,children:e(tm,{})})})]})}))}}));var hm=Object.freeze({__proto__:null,moduleConnectorBuilder:mm});const vm="CATALOG/TRIGGER_SELECT_ITEM",gm="CATALOG/SET_SELECTED_ITEM",bm="CHECKOUT_LIFECYCLE",Im="INSTANT_PURCHASE/INITIATE",Em="INSTANT_PURCHASE/PARTNER_RESPONSE";function Sm(t,n,i,a,o){return e(ea,{value:i(n),children:wm(t,a,o)})}function wm(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Cm(t){const n=f(),i=Oi(),a=_a(),{tabIndex:o,styles:r,isDisabled:s}=It(a),l=Ua(),c=qi(l,"catalogItem");return e(Lo,{styles:t.schema.styles,children:({classnames:a,mapperRef:d})=>e("button",{type:"button",tabIndex:o,"aria-disabled":s,disabled:s,style:Object.assign({cursor:"pointer"},r),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:Im,payload:{catalogItem:l,quantity:1}})},className:null==a?void 0:a.own,children:e(Zi,{value:c,children:(null==a?void 0:a.own)?Sm(t.schema.children,a.own,d,i,t.testId):wm(t.schema.children,i,t.testId)})})})}function Om(t){const n=_a(),i=Ii(),{customStateKey:o,customStateValue:r}=t.schema,{tabIndex:s,styles:l,isDisabled:c}=It(n),d=()=>{i({type:nn,payload:{key:o,value:r}})};return e(Lo,{styles:t.schema.styles,children:({classnames:n})=>{var i;return e("button",{className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ButtonStateTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,tabIndex:s,style:Object.assign({backgroundColor:"transparent",cursor:"pointer",margin:0,padding:0},l),children:e(Ci,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function Tm(t){const n=Oi(),i=$a(),r=Qi(),s=Ii(),l=_i().catalogItems||[],c=m((e=>e.selectedItem))||l[0];return o((()=>{c&&s({type:en,payload:{name:"SignalImpression",parentGuid:null==c?void 0:c.instanceGuid}})}),[c,s]),c?e(Lo,{styles:t.schema.styles,children:({classnames:o})=>{return e("div",{"data-testid":t.testId,"data-e2e":"CatalogCombinedCollection",className:null==o?void 0:o.own,style:{display:"flex",flexDirection:"column"},children:a.Children.toArray(e(Ba,{context:c,children:e(ja,{value:i(c),children:e(Zi,{value:(s=c,r({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})}))});var s}}):null}function xm(t,n,i,a,o){return e(ea,{value:i(n),children:a(t,void 0,o)})}function Am(e,t,n){return t(e,void 0,n)}const Lm=["ArrowDown","ArrowUp","Enter","Escape","Tab"];function Nm(n){const i=_i(),a=Oi(),s=Ua(),l=Qi(),u=e=>l({data:e},"catalogItem"),p=d((()=>i.catalogItems||[]),[i]),y=_a(),{styles:m,isDisabled:h}=It(y),v=r(null),g=r([]),[b,I]=c(!1),[E,S]=c(0),w=f();function C(){h||(b?T():O())}function O(){h||I(!0)}function T(){h||I(!1)}function x(e){S(p.indexOf(e)),T(),w({type:vm,payload:{catalogItem:e}})}o((()=>{if(b){const e=g.current[E];e&&e.focus()}}),[b,E]);const A={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},dimension:{width:{type:"percentage",value:100}}}}]}};function L(e){if(!h&&Lm.includes(e.key))switch(e.key){case"ArrowDown":{e.preventDefault();const t=E+1;t<p.length&&S(t);break}case"ArrowUp":{e.preventDefault();const t=E-1;t>=0&&S(t);break}case"Enter":if(e.preventDefault(),b){const e=p[E];e&&x(e)}else O();break;case"Tab":if(b){T();const e=p.indexOf(s);-1!==e&&S(e)}break;case"Escape":if(e.preventDefault(),b){T();const e=p.indexOf(s);-1!==e&&S(e)}}}return e(Lo,{styles:n.schema.styles?zt(A,n.schema.styles):A,children:({classnames:i,mapperRef:o})=>t("div",{ref:v,className:null==i?void 0:i.own,onKeyDown:L,onClick:C,onBlur:e=>{var t;(null===(t=v.current)||void 0===t?void 0:t.contains(e.relatedTarget))||b&&T()},"data-e2e":"DropDown","data-testid":n.testId?`${n.testId}-drop-down-container`:void 0,"aria-disabled":h,style:Object.assign({position:"relative"},m),tabIndex:0,children:[e("div",{className:null==i?void 0:i.dropDownSelectedElement,"aria-disabled":h,"data-testid":n.testId?`${n.testId}-drop-down-selected-element`:void 0,style:Object.assign({cursor:"pointer"},m),children:e(Zi,{value:u(s),children:(null==i?void 0:i.dropDownSelectedElement)?xm(n.schema.closedTemplate,i.dropDownSelectedElement,o,a,n.testId):Am(n.schema.closedTemplate,a,n.testId)})}),b&&e("ul",{className:null==i?void 0:i.dropDownListContainer,onClick:e=>e.stopPropagation(),"data-testid":n.testId?`${n.testId}-drop-down-list-container`:void 0,tabIndex:-1,style:Object.assign({listStyle:"none",padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,backgroundColor:"#FFF",overflow:"hidden"},m),children:p.map(((t,r)=>e("li",{ref:e=>function(e,t){g.current[t]=e}(e,r),className:null==i?void 0:i.dropDownListElement,onClick:e=>{e.stopPropagation(),h||x(t)},tabIndex:-1,"data-e2e":"DropDownItem","data-testid":n.testId?`${n.testId}-drop-down-item-${r}`:void 0,style:Object.assign({cursor:"pointer",display:"flex"},m),children:e(Zi,{value:u(t),children:(null==i?void 0:i.dropDownListElement)?xm(n.schema.openTemplate,i.dropDownListElement,o,a,n.testId):Am(n.schema.openTemplate,a,n.testId)})},t.catalogItemId)))})]})})}function _m(t){const n=t.schema.styles,i=f(),o=m((e=>e.staticData)),r=_a(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=()=>{var e;i({type:bm,payload:{event:"Checkout",targetStep:t.schema.targetStep,offerPositionIndex:null!==(e=null==o?void 0:o.position)&&void 0!==e?e:0}})};return e(Lo,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:t.schema.targetStep,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"CheckoutStateButtonTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:t.schema.targetStep,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Ci,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Wt(i,t.testId)))))})})}})}const Rm=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/;function Dm(t){const n=Qi(),i=_a(),{schema:a,testId:o}=t,r=n(a.value),{tabIndex:s,styles:l,isDisabled:c}=It(i);return"string"==typeof(d=r)&&Rm.test(d)?e(Lo,{styles:a.styles,children:({classnames:t})=>e("div",{"aria-hidden":c,className:null==t?void 0:t.own,"data-e2e":"ColorSwatch","data-testid":o,style:Object.assign({backgroundColor:r},l),tabIndex:s})}):null;var d}function km(n){const{schema:{imageKeys:i,styles:o},testId:r}=n,[s,d]=c(0),u=_a(),p=function(e){const t=l(Pa);return e.reduce(((e,n)=>{const i=t(`${n}.src`,"copy"),a=t(`${n}.title`,"copy");return void 0===i?e:[...e,Lt({light:i,title:a})]}),[])}(i),{styles:y,isDisabled:f,tabIndex:m}=It(u),h=p[s]||p[0];return p.length>0&&h?e(Lo,{styles:o,children:({classnames:n})=>t("div",{className:null==n?void 0:n.own,children:[e("img",{"aria-hidden":f,src:h.light,alt:h.alt,title:h.title,className:null==n?void 0:n.mainImage,style:y,"data-testid":`${r}-main-image`,"data-e2e":"ImageGallery-mainImage"}),e("div",{className:null==n?void 0:n.thumbnailList,style:Object.assign(Object.assign({},y),{display:"flex"}),children:a.Children.toArray(p.map(((t,i)=>e("img",{src:t.light,alt:t.alt,title:t.title,className:null==n?void 0:n.thumbnailImage,style:Object.assign(Object.assign({},y),{cursor:f?"not-allowed":"pointer",pointerEvents:"auto"}),"data-testid":`${r}-thumbnail-${i}`,"data-e2e":"ImageGallery-thumbnail",tabIndex:m,onClick:()=>d(i)}))))})]})}):null}const Pm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(Cm,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"ButtonStateTrigger":return e(Om,{schema:n.node});case"CatalogCombinedCollection":return e(Tm,{schema:n.node});case"CatalogDropDown":return e(Nm,{schema:n.node});case"CheckoutStateButtonTrigger":return e(_m,{schema:n.node});case"ColorSwatch":return e(Dm,{schema:n.node});case"ImageGallery":return e(km,{schema:n.node});default:return}}}};function jm(){const t=La(),n=Oi(),i=m(ef),a=Qi()({state:i},"textContent");return e(Ti,{value:n,overrides:Pm,children:e(Zi,{value:a,children:e(Ci,{children:e=>e(t)})})})}const $m={staticData:Ky,selectedItem:(e=null,t)=>t.type===gm?t.payload:e,dynamicData:Yy,childLayouts:Jy};function Gm(e={}){return Object.assign({staticData:null,selectedItem:null,dynamicData:null,childLayouts:{launched:{}}},e)}const Fm="INVALID_RESPONSE_OBJECT";function Mm(e,t){return st((n=>e.onEvent({name:dl.PartnerMessage.CartItemInstantPurchaseResponse,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"upsellItems"in i&&Array.isArray(i.upsellItems)&&i.upsellItems.every((e=>"object"==typeof e))&&"totalUpsellPrice"in i&&"number"==typeof i.totalUpsellPrice&&"currency"in i&&"string"==typeof i.currency&&"paid"in i&&"boolean"==typeof i.paid&&"success"in i&&"boolean"==typeof i.success?n(e):t({level:kt,code:"MALFORMED_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Bm(e,t){var n;try{for(;;){const t=yield We(e);t&&(yield qe({type:Em,payload:t}))}}catch(e){yield ze(t,{level:kt,code:"INSTANT_PURCHASE_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase channel"})}finally{e.close()}}function Um(e){const t=function(e){var t,n;return null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[]}(e);return t[0]}const Vm="Unknown failure reason";function*zm(){const e=yield Ke(Um);e&&(yield*Km(e))}function*Hm(e){const{catalogItem:t}=e.payload;yield*Km(t)}function*Wm(e,t,n){const{catalogItem:i,quantity:a}=n.payload,o=Ts(i,a);o?(yield qe({type:en,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield Qe(Jm,e,t),yield qe({type:an,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[o],totalUpsellPrice:o.totalPrice||0,currency:o.currency}}})):yield ze(t,{level:kt,code:Fm,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`})}function*qm(e,t){const n=yield Ke((e=>e.staticData));if(!n)return yield ze(e,{level:kt,code:"MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE",message:"App state is not configured with static data."}),void(yield*Qm("Error"));if(!n.offer.catalogItems)return yield ze(e,{level:kt,code:"MISSING_CATALOG_ITEMS",message:"No catalog items found within offer data."}),void(yield*Qm("Error"));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};let a,o;t.payload.success?(a=Ym,o="Success"):(a=(e,n)=>function(e,t,n,i){return{name:"SignalCartItemInstantPurchaseFailure",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,failureReason:i.reason||Vm,providerId:n.accountId.toString()}}}(e,n,i,t.payload),o="Unspecified"),yield*function*(e,t,n,i){const a=[];for(const i of e.upsellItems){const e=Zm(i,t.catalogItems);void 0===e?a.push(i):yield qe({type:en,payload:n(e,i.quantity)})}a.length>0&&(yield*function*(e,t){const n=JSON.stringify(e,null,"\t").replaceAll('"',"");yield ze(t,{level:kt,code:Fm,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}(t.payload,i,a,e),yield*Qm(o)}function*Jm(e,t){const n=Mm(e,t),{timeout:i}=yield tt({channelListener:ze(Bm,n,t),timeout:nt(6e4)});i&&(yield ze(t,{level:kt,code:"INSTANT_PURCHASE_RESPONSE_TIMEOUT",message:"Instant-purchase response timed out after 60000ms"}),n.close(),yield qe({type:tn,payload:{event:"Dismissed",dismissalReason:"Implicit"}}))}function*Km(e){var t,n,i;yield qe({type:gm,payload:e});const a={title:null!==(t=e.title)&&void 0!==t?t:"",description:null!==(n=e.description)&&void 0!==n?n:"",price:null!==(i=e.priceFormatted)&&void 0!==i?i:""};e.copy&&Object.entries(e.copy).forEach((([e,t])=>{a[`copy.${e}`]=t})),yield qe({type:qy,payload:{text:a}})}function Ym(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:_t.DCUI}}}function Zm(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*Qm(e){yield qe({type:tn,payload:{event:"Completed",completionReason:e}})}function*Xm(e){"Checkout"===e.payload.event&&(yield qe({type:on,payload:{key:"checkout",value:eh(e.payload),offerPositionIndex:e.payload.offerPositionIndex}}))}function eh(e){var t;return null!==(t={ViewOffer:0,ViewTransactionDetails:1,EditPayment:2,EditShipping:3,EditPaymentAndShipping:4,CostBreakdown:5,Confirmation:6,CloseOffer:7}[e.targetStep])&&void 0!==t?t:0}function*th(e,t){yield Ye([et(zm),Ze(bm,Xm),Ze(vm,Hm),Xe(Im,Wm.bind(null,e,t)),Xe(Em,qm.bind(null,t)),Ze(dn,nf.bind(null,e,t)),Ze("*",Os.bind(null,[Jt,dn],e))])}Object.assign(Object.assign({},un),{INITIATE_INSTANT_PURCHASE:Im,INSTANT_PURCHASE_PARTNER_RESPONSE:Em});const nh=(new Ca).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=Gm({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Gm()){const i=ot(),a=it({reducer:$m,devTools:{name:"Instant Purchase"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(th,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Fa,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(_r,{}),e(v,{store:s,children:e(Lr,{settings:n,dispatch:s.dispatch,children:e(jm,{})})})]})}))}}));var ih=Object.freeze({__proto__:null,moduleConnectorBuilder:nh});const ah=s(null),oh=({children:t})=>{var n;const[i,a]=c([]),[r,s]=c(0),[l,d]=c(0),u=Qi();return o((()=>{let e=0;const t=i.length,n=setInterval((()=>{e=e+1>=t?0:e+1,s(e)}),l);return()=>clearInterval(n)}),[l,i]),e(ah.Provider,{value:{images:i,activeIndex:r,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(Zi,{value:u({data:{"image.title":null===(n=i[r])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function rh({active:t,duration:n,containerStyles:i,indicatorStyles:a}){const s=r(null);return o((()=>{t&&s.current&&function(e,t){const n="animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype,i=[{width:0},{width:"100%"}];if(n){const n=e.animate(i,{duration:t,iterations:1});return()=>{n.finish()}}}(s.current,n)}),[t]),e("div",{style:Object.assign({position:"relative",height:"2px",width:"100%",backgroundColor:"#FFFFFF66"},i),children:e("span",{ref:s,style:Object.assign({animationIterationCount:"infinite",animationFillMode:"forwards",animationTimingFunction:"linear",position:"absolute",top:0,left:0,height:"100%",backgroundColor:"#FFF",width:t?"100%":0},a)})})}function sh(e){const t=l(Pa),n=[];return e.forEach((e=>{const i=t(`${e}.src`,"copy"),a=t(`${e}.title`,"copy");if(void 0===i)return;const o=Lt({light:i,title:a});n.push(o)})),n}function lh({schema:n,testId:i}){const r=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=r,u=l(ah),p=sh(d);return o((()=>{null==u||u.setImages(p),null==u||u.setDuration(c)}),[]),t("div",{"data-testid":i,style:Object.assign({position:"relative",flexShrink:1,flexGrow:0,width:"100%"},s.elements.own),children:[a.Children.toArray(p.map(((t,n)=>e("img",{src:t.light,alt:t.title,style:Object.assign({opacity:n===(null==u?void 0:u.activeIndex)?1:0,position:0===n?"relative":"absolute",display:0===n?"block":"",top:0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%",transition:"opacity 300ms ease-in-out",objectFit:"contain"},s.elements.image)})))),e("div",{style:Object.assign({display:"flex",gap:"2px",width:"70%",position:"absolute",margin:"0 15%",bottom:"8px",zIndex:20,justifyContent:"center"},s.elements.indicatorWrapper),children:a.Children.toArray(p.map(((t,n)=>e(rh,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const ch={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},dh=new Map([["&","_;^;_"]]),uh=new RegExp(`<a *(?=${ch.allowedAttributes.a.join("|")}|>)`,"g"),ph=new RegExp("<span*>","g"),yh=new RegExp(`<a *(?:(?:${ch.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),fh=new RegExp("(<br *?>)|(<br *?/>)","g"),mh="<br/>";function hh(t){const n=Qi(),i=_a(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(yh,((e,t)=>{const n=t.replaceAll("&",dh.get("&"));return e.replace(t,n)})).replaceAll(fh,mh)}(e);return t===vt(t,ch)}(e))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Lo,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(uh,`<a ${i.join(" ")}`).replace(ph,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(uh,`<a ${i.join(" ")}`).replace(ph,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var l}}):null}function vh({schema:t}){const n=Oi(),i=fi(za(),aa()),o=JSON.parse(t.data),[r]=ht({loop:!1,align:"start",slidesToScroll:2,containScroll:"trimSnaps"}),{styles:s,body:{tierItems:l}}=o;if(!l||!l.length)return;const c=l.length>2;return e("div",{className:i`
|
|
137
137
|
position: relative;
|
|
138
138
|
`,"data-testid":"ProductTierCarousel",children:e("div",Object.assign({},c&&{ref:r},{className:i`
|
|
139
139
|
width: 100%;
|
|
@@ -172,24 +172,24 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
|
|
|
172
172
|
background-color: ${(null===(d=null==s?void 0:s.primaryColor)||void 0===d?void 0:d.light)||"#F9FAFB"};
|
|
173
173
|
color: #f9fafb;
|
|
174
174
|
}
|
|
175
|
-
`,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const
|
|
176
|
-
${
|
|
177
|
-
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M14.2951 18L15.7051 16.59L11.1251 12L15.7051 7.41L14.2951 6L8.29508 12L14.2951 18Z",fill:"#ffffff"})})})}function
|
|
178
|
-
${
|
|
179
|
-
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"#ffffff"})})})}function
|
|
175
|
+
`,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const gh=(e,t)=>`\n position: absolute;\n top: 0;\n ${t?"right: 0;":"left: 0;"}\n bottom: 0;\n opacity: 0;\n z-index: 10;\n padding: 0 16px;\n transition: opacity 200ms ease-in-out;\n pointer-events: ${e?"none":"auto"};\n background: linear-gradient(${t?"":"-"}90deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.70) 100%);\n &:hover {\n opacity: ${e?0:1};\n }\n`;function bh({disabled:t,onClick:n}){const i=fi(za(),aa());return e("button",{onClick:n,disabled:t,className:i`
|
|
176
|
+
${gh(t)}
|
|
177
|
+
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M14.2951 18L15.7051 16.59L11.1251 12L15.7051 7.41L14.2951 6L8.29508 12L14.2951 18Z",fill:"#ffffff"})})})}function Ih({disabled:t,onClick:n}){const i=fi(za(),aa());return e("button",{onClick:n,disabled:t,className:i`
|
|
178
|
+
${gh(t,!0)}
|
|
179
|
+
`,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"#ffffff"})})})}function Eh(e){const t=l(Pa);return e.map((e=>({src:t(`${e}.link.src`,"copy"),open:t(`${e}.link.open`,"copy")})))}function Sh(e){return{type:"StaticImage",node:{url:e,styles:{elements:{own:[{default:{border:{borderRadius:5,borderWidth:"0"},dimension:{width:{type:"percentage",value:100}}}}]}}}}}function wh(e,t){return{type:"CreativeResponse",node:{responseKey:"positive",styles:{elements:{own:[{default:{spacing:{padding:"0"},background:{backgroundColor:{light:"#F9FAFB"}},border:{borderWidth:"0"}}}]}},children:t?[Sh(t)]:[]}}}function Ch({schema:n}){var i,r;const s=Oi(),l=fi(za(),aa()),d=function(e){try{return JSON.parse(e.data)}catch(e){return null}}(n),[u,p]=[sh((null===(i=null==d?void 0:d.body)||void 0===i?void 0:i.imageKeys)||[]),Eh((null===(r=null==d?void 0:d.body)||void 0===r?void 0:r.imageKeys)||[])],y=_i(),f=y.creative.responseOptionsMap.positive,{carousel:m,styles:h}=(null==d?void 0:d.body)||{},v=(null==m?void 0:m.slidesToScroll)||3,g=(null==m?void 0:m.aspectRatio)||"1/1",b=!(null==m?void 0:m.disabled)&&Array.isArray(u)&&u.length>2,I=b?u:null==u?void 0:u.slice(0,v),[E,S]=ht({loop:!1,align:"start",slidesToScroll:v,containScroll:"trimSnaps"}),{prevBtnDisabled:w,nextBtnDisabled:C,onPrevButtonClick:O,onNextButtonClick:T}=function(e){const[t,n]=c(!0),[i,a]=c(!0);return o((()=>{if(!e)return;const t=()=>{n(!e.canScrollPrev()),a(!e.canScrollNext())};t(),e.on("reInit",t).on("select",t)}),[e]),{prevBtnDisabled:t,nextBtnDisabled:i,onPrevButtonClick:e?e.scrollPrev:void 0,onNextButtonClick:e?e.scrollNext:void 0}}(S);return d&&I&&I.length&&f?t("div",{"data-testid":"product-catalog-carousel",className:l`
|
|
180
180
|
position: relative;
|
|
181
181
|
margin: 8px 0;
|
|
182
182
|
${h||""}
|
|
183
|
-
`,children:[b?e(
|
|
183
|
+
`,children:[b?e(bh,{onClick:O,disabled:w}):null,e("div",Object.assign({},b&&{ref:E},{className:l`
|
|
184
184
|
width: 100%;
|
|
185
185
|
margin: auto;
|
|
186
186
|
overflow: hidden;
|
|
187
187
|
`,children:e("div",{className:l`
|
|
188
188
|
display: flex;
|
|
189
189
|
gap: 16px;
|
|
190
|
-
`,children:a.Children.toArray(I.map(((t,n)=>{var i,a;const o=Object.assign(Object.assign({},f),{url:null===(i=null==p?void 0:p[n])||void 0===i?void 0:i.src}),r=Object.assign(Object.assign({},y),{creative:Object.assign(Object.assign({},y.creative),{responseOptionsMap:Object.assign(Object.assign({},y.creative.responseOptionsMap),{positive:o})})});return e(
|
|
190
|
+
`,children:a.Children.toArray(I.map(((t,n)=>{var i,a;const o=Object.assign(Object.assign({},f),{url:null===(i=null==p?void 0:p[n])||void 0===i?void 0:i.src}),r=Object.assign(Object.assign({},y),{creative:Object.assign(Object.assign({},y.creative),{responseOptionsMap:Object.assign(Object.assign({},y.creative.responseOptionsMap),{positive:o})})});return e(Ni,{context:r,children:e("div",{"data-testid":"carousel-item",className:l`
|
|
191
191
|
min-width: 0;
|
|
192
192
|
overflow: hidden;
|
|
193
193
|
aspect-ratio: ${g};
|
|
194
194
|
${b?"flex: 0 0 33%;":`width: ${100/v}%;`}
|
|
195
|
-
`,children:s((null===(a=null==p?void 0:p[n])||void 0===a?void 0:a.src)?
|
|
195
|
+
`,children:s((null===(a=null==p?void 0:p[n])||void 0===a?void 0:a.src)?wh(p[n],t):Sh(t))})})})))})})),b?e(Ih,{onClick:T,disabled:C}):null]}):null}function Oh({schema:i}){const a=JSON.parse(i.data),{styles:o,content:r,smallFontSize:s,largeFontSize:l}=a,c=Qi();return t(n,{children:[e("style",{children:`\n @keyframes textAnimation {\n 0% { transform: scale(1); }\n 42% { transform: scale(1.2); } /* 800ms out of 1900ms cycle */\n 60% { transform: scale(1.2); }\n 100% { transform: scale(1); }\n }\n\n .animated-text {\n font-size: ${s}px;\n animation: textAnimation 1.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;\n }\n `}),e("p",{style:Object.assign({},o),className:"animated-text",children:c(r)})]})}const Th={EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"ImageCarousel":return e(lh,{schema:t.node});case"RichText":return e(hh,{schema:n.node});case"ProductTierCarousel":return e(vh,{schema:t.node});case"ProductCatalogCarousel":return e(Ch,{schema:t.node});case"TextAnimate":return e(Oh,{schema:t.node});default:return}}}};function xh(){const t=La(),n=Oi();return e(oh,{children:e(Ti,{value:n,overrides:Th,children:e(Ci,{children:e=>e(t)})})})}const Ah={staticData:Ky,childLayouts:Jy};function Lh(e={}){return Object.assign({staticData:null,childLayouts:{launched:{}}},e)}function Nh(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function*_h(e,t){for(;;){switch(yield We(e)){case"CLOSED":t({type:tn,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":t({type:tn,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:tn,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*Rh(e,t,n){const i=Zt(n.payload)||Qt(n.payload)||Yt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:an,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:an,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*function*(e,t,n){if(Kt(n)){const{responseOption:i,fulfillment:a}=n;yield qe({type:en,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const o=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof o&&"onClose"in o){const t=yield ze(Nh,o);if("object"==typeof t&&"take"in t)return void(yield ze(_h,t,e.globalDispatch.bind(e)))}yield ze(t,{level:Dt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Dt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}(e,t,n.payload)}}function*Dh(e,t){yield Ye([Xe(Jt,Rh.bind(null,e,t)),Ze(dn,nf.bind(null,e,t)),Ze("*",Os.bind(null,[Jt,dn],e))])}Object.assign({},un);const kh=(new Ca).withAppFactory((function(n){if(n.rootElement){const i=y(n.rootElement),o=Lh({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),r=function(e,t,n=Lh()){const i=ot(),a=it({reducer:Ah,devTools:{name:"layouts-xp-sandbox"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Dh,e,t),a}(n.gateway,n.logger,o);i.render(e(a.StrictMode,{children:t(Fa,{info:{layoutType:"LayoutVariant",referralCreativeId:String(n.offerData.creative.referralCreativeId)||"N/A"},children:[e(_r,{}),e(v,{store:r,children:e(Lr,{settings:n,dispatch:r.dispatch,children:e(xh,{})})})]})}))}}));var Ph=Object.freeze({__proto__:null,moduleConnectorBuilder:kh});export{wy as BehaviorSubject,Py as CatchSubscriber,Vy as DisplayPreset,zy as ErrorLevel,Oy as FirstValueFromError,Ey as Observable,Cy as ReplaySubject,Sy as Subject,gy as Subscription,ky as addCatchToSubscriber,Ry as combineLatest,Hy as dcuiUtils,Fy as filter,My as first,Ty as firstValueFrom,Ay as fromEvent,Ly as fromPromise,vy as init,xy as lastValueFrom,By as map,Ny as merge,by as noop,Iy as normaliseToObserver,_y as of,Gy as pipe,Uy as tap};
|