@rokt/dcui-orchestrator 0.2.1-rc.57 → 0.2.1-rc.59

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),a=require("react-redux"),i=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("@reduxjs/toolkit"),l=require("redux-saga"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance"),f=require("embla-carousel-autoplay"),y=require("embla-carousel-fade");function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var h=m(t);function v(e){const t=["elements","own"],n=["default","dimension","width","type"],a=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=i.path(t,e);return r&&Array.isArray(r)&&r.length?i.assocPath(t,r.map(i.when(i.allPass([i.hasPath(n),i.complement(i.hasPath(o)),i.pathEq("fixed",n)]),(e=>i.assocPath(o,i.path(a,e),e)))),e):e}function g(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function b(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function I(){return"ontouchstart"in document.documentElement}function E(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function x(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function S(e){return x(e)&&"Fulfillment"===e.action}function C(e){return x(e)&&"Url"===e.action}function w(e){return x(e)&&"ExternalPaymentTrigger"===e.action}function T(e){return(S(e)||C(e))&&"RealTime"===e.conversionType&&"rclid"in e}function O(e){return(S(e)||C(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}const A={pluginId:"shared",pageInstanceGuid:"N/A"};var j;!function(e){e.DCUI="DCUI",e.Partner="partner"}(j||(j={}));const R=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction"],N="ERROR",k="WARNING";class L extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const D=["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","INITIATE_INSTANT_PURCHASE_EVENT","INITIATE_CART_ITEM_EVENT","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const _=(e,t)=>i.concat(e,i.slice(e.length,t.length,t)),P=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?_(t,e):t,a=t.length>e.length?_(e,t):e;return i.zipWith(B,a,n)}return t},$=e=>null==e,F=e=>!$(e),G=(e,t)=>$(t)?e:t,M=(e,t)=>{throw new L("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function B(e,t){return i.cond([[(e,t)=>F(e)&&F(t)&&i.type(e)!==i.type(t)&&("Object"===i.type(e)||"Object"===i.type(t)),M],[(e,t)=>$(e)||$(t),G],[(e,t)=>"Object"===i.type(e),i.mergeDeepWith(B)],[(e,t)=>"Array"===i.type(e),P],[i.T,i.flip(i.unary(i.identity))]])(e,t)}function U(e,t){return B(e,t)}function V(e=0){return`breakpoint-${e}px`}function z(e,t){return t?`${t}-child${e}`:void 0}const q="GLOBAL/RAISE_METRIC",H="GLOBAL/OFFER_ENGAGEMENT";function W(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&S(e.responseOption)&&"fulfillment"in e&&E(e.fulfillment)}function K(e){return w(e)}function Y(e){return C(e)}function J(e){return function(e){return x(e)&&"CaptureOnly"===e.action}(e)}function Z(e){return!!(T(e)||"responseOption"in e&&T(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Q(e){return!!(O(e)||"responseOption"in e&&O(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const X="GLOBAL/RAISE_SIGNAL",ee="GLOBAL/OFFER_LIFECYCLE",te="GLOBAL/SET_CUSTOM_STATE",ne="GLOBAL/SEND_PARTNER",ae="GLOBAL/SET_DOMAIN_STATE",ie="GLOBAL/PREPARE_SIGNAL",oe="GLOBAL/OPEN_LINK",re="GLOBAL/SET_PARTNER_VALIDATION_STATUS",se="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",le="GLOBAL/LAUNCH_CHILD_LAYOUT",ce="GLOBAL/CART_ITEM_EVENT/INITIATE",de="GLOBAL/CART_ITEM_EVENT/RESPONSE",ue="GLOBAL/CART_SERVICE/INITIALIZE",pe={RAISE_METRIC:q,PREPARE_SIGNAL:ie,OFFER_ENGAGEMENT:H,RAISE_SIGNAL:X,OFFER_LIFECYCLE:ee,SEND_PARTNER:ne,SET_CUSTOM_STATE:te,SET_DOMAIN_STATE:ae,OPEN_LINK:oe,SET_PARTNER_VALIDATION_STATUS:re,SET_GLOBAL_OFFER_DATA_CART:se,LAUNCH_CHILD_LAYOUT:le,INITIATE_CART_ITEM_EVENT:ce,CART_ITEM_RESPONSE:de},fe="data-open-in-app",ye="data-click-signal-context";function me(e,n){function a(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const a=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(a){const t=a.getAttribute("href"),i=a.getAttribute(ye);if(i&&n({type:X,payload:{name:"SignalUserInteraction",action:"Click",context:i}}),t){e.preventDefault();let i="newTab";a.hasAttribute(fe)&&(i="inApp"),n({type:oe,payload:{url:t,urlBehaviour:i}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",a),()=>{e.removeEventListener("click",a)}):()=>{}),[e])}function he(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&ve(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const ve=(e,t)=>{var n;const a=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!a)return;const i=a[0],o=a[a.length-1],{activeElement:r}=window.document;if(1!==a.length)return r===i&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(i&&i.focus(),void e.preventDefault());e.preventDefault()},ge=i.sortBy(i.prop(1)),be=i.map(i.prop(0)),Ie="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function Ee(e,t){return t?"false"!==Ie.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${V(e)} ${t.trim()}`:`#app-container.${V(e)} & {${t}}`:"";var n}const xe={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function Se(e){return function(e){return Object.keys(xe).indexOf(e)>-1}(e)?xe[e]:""}const Ce={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 we(e,t){if(!Ce[e]||!Ce[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return Ce[e][t]}function Te(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Oe(...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 Ae(e,t){return`${e}:${t};`}function je(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Re extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Ne(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 Re(n,JSON.stringify(t));return!0}function ke(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Le(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 De(e){if(null==e||""===e)return"value must not be omitted"}function _e(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 Pe(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 $e(e){if(null!=e&&""!==e)return"value must not be specified"}function Fe(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 Ge(...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||ke(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Me(e,t){return n=>{const a=e(n),i=t(n);if(a&&i)return`one of these must be true: ${a} -OR- ${i}`}}function Be(e){if("string"!=typeof e)return"value must be a string"}const Ue=i.is(Object);function Ve(e){const t=Object.entries(e);return n=>Ue(n)&&!Array.isArray(n)?t.reduce(((e,[t,a])=>e||a(n[t])),void 0):`Input value (${e}) must be an object`}function ze(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function qe(e,t,n){return Ne(ke,n)?Ae(we(e,t),`${n}`):""}function He(e){return(t,n,a)=>Ne(Le(Object.keys(e)),a)?Ae(we(t,n),`${e[a]}`):""}function We(e){return Ne(De,e)?Te({light:t(Pe,!1),dark:t(Me($e,Pe),!0)},Oe("\n "))(e):"";function t(e,t){return n=>{if(Ne(e,n)&&n){const e=Ae("background-image",`url("${n}")`);return t?je(e):e}return""}}}function Ke(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Ne(Me($e,Le(Object.keys(t))),e)&&e?Ae("background-size",t[e]):""}const Ye=i.cond([[i.equals("top-left"),i.always("top left")],[i.equals("top-right"),i.always("top right")],[i.equals("bottom-left"),i.always("bottom left")],[i.equals("bottom-right"),i.always("bottom right")],[i.T,i.identity]]);function Je(e){const t="string"==typeof e?e.toLowerCase():e;return Ne(Me($e,Le(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Ae("background-position",Ye(t)):""}function Ze(e,t,n){return Ne(Me(ke,Ge(2,3,4)),n)?Ae(we(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Qe(e){return(t,n,a)=>Ne(Fe({fit:Le(e),percentage:ke,fixed:ke}),a)?Ae(we(t,n),Xe(a)):""}function Xe(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]}}const et=Ve({light:_e,dark:Me($e,_e)});function tt(e,t,n){return a=>{if(a){const i=Ae(we(e,t),at(String(a)));return n?je(i):i}return""}}function nt(e,t,n){return Ne(et,n)?Te({light:tt(e,t,!1),dark:tt(e,t,!0)},Oe("\n "))(n):""}function at(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 it=Ve({offsetX:Me($e,ke),offsetY:Me($e,ke),blurRadius:Me($e,ke),spreadRadius:Me($e,ke),color:et}),ot=e=>t=>null!=t?String(t):e,rt=i.compose(i.concat(i.__,"px"),ot("0")),st=e=>t=>"string"==typeof t?e(t):t,lt=i.compose(st(i.concat(i.__,"px")),ot(void 0)),ct=i.compose(st(at),i.prop("dark"));function dt(e,t,n){return Ae(e,Te({offsetX:rt,offsetY:rt,blurRadius:t.spreadRadius?rt:lt,spreadRadius:lt,color:n},Oe(" "))(t))}const ut={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},pt={container:{justifyContent:He(ut),alignItems:He(ut),shadow:function(e,t,n){var a,o,r;if(Ne(it,n)){const s=we(e,t);return Oe("\n")(dt(s,n,(o="light",r="#80000000",i.compose(at,i.propOr(r,o)))),(null===(a=n.color)||void 0===a?void 0:a.dark)?je(dt(s,n,ct)):"")}return""},gap:Ze,overflow:He({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return Ne(ze,n)?Ae(we(e,t),`blur(${n.toString()}px)`):""},opacity:qe},text:{textColor:nt,fontSize:Ze,fontFamily:function(e,t,n){return Ne(Be,n)?Ae(we(e,t),(a=`${n}`,a.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 a},fontWeight:He({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:He({normal:"normal",italic:"italic"}),lineHeight:Ze,lineLimit:function(e,t,n){return Ne(ke,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:Ze,baselineTextAlign:He({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:He({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:He({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:He({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:nt,backgroundImage:function(e,t,n){return Ne(De,n)?Te({url:We,position:Je,scale:Ke},Oe)(n):""}},dimension:{width:Qe(["wrap-content","fit-width"]),maxWidth:Ze,minWidth:Ze,height:Qe(["wrap-content","fit-height"]),maxHeight:Ze,minHeight:Ze,rotateZ:(ft="Z",(e,t,n)=>{const a=`rotate${ft}`;return Ne(ke,n)?Ae(we(e,t),`${a}(${n.toString()}deg)`):""})},flexChild:{alignSelf:He(ut),weight:qe,order:qe},spacing:{margin:Ze,padding:Ze,offset:function(e,t,n){return Ne(Ge(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:nt,borderRadius:Ze,borderWidth:Ze,borderStyle:He({solid:"solid",dashed:"dashed"})}};var ft;function yt(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((a=>{if(!pt[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const i=pt[n][a];if(!i)throw new Error(`No styling transformer exists for property: ${n}.${a.toString()}`);try{t+=i(n,a,e[n][a])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${a.toString()}: ${e.message}`),e}})),t)),"")}const mt="FAILED_TEMPLATING_DATA",ht=new Map;function vt(e){return String.fromCharCode(97+e)}function gt(e,t,n){const a=`${e||A.pluginId}-${void 0!==t?String(t):"outer"}`,i=ht.get(a);if(i&&i.sheet.container.isConnected)return i.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${vt(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return ht.set(a,o),o.css}const bt="%%%OWN_CLASS_REF%%%",It=i.memoizeWith(((e,t,n,a)=>`${String(e)}-${t}-${n}`),Et);function Et(e,t,n,a){const i=gt(t,n,a);let o=1;return function t(n,a=!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,i])=>Object.assign(Object.assign({},t),{[n]:xt(i,l,a,String(n),e)})),{}),n=Object.entries(t),r=a?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?i(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const a=n.replace(bt,r);return Object.assign(Object.assign({},e),{[t]:a?i(a):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function xt(e,t,n,a,i){return e.map(function(e,t,n){return a=>Object.entries(a).map((([a,i])=>{const o=i?yt(i):"";switch(!0){case"default"===a:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${Se(a)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${bt}${Se(a)} & {\n${o}\n}\n`;default:return`\n &${Se(a)} {\n${o}\n}\n`}})).join("")}(t,n,a)).reduce(((e,t,n)=>{const a=i[n];return void 0!==a?e+(0===n?t:`${Ee(a,t)}\n`):e}),"")}const St=t.createContext(i.always(void 0)),Ct=()=>t.useContext(St),wt=t.createContext(null);function Tt(e,n){var a;const i=t.useContext(wt);return i&&null!==(a=n(i))&&void 0!==a?a:e}const Ot=t.createContext((()=>{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")})),At=Ot.Consumer,jt=()=>t.useContext(Ot),Rt=e=>t.createElement(Ot.Provider,{value:(t,n,a)=>e.value(t,null!=n?n:e.overrides,a)},e.children),Nt=t.createContext(null),kt=()=>t.useContext(Nt),Lt=t.createContext({get(){throw Error("Offer context has not been set")}}),Dt=e=>t.createElement(Lt.Provider,{value:{get:()=>e.context}},e.children),_t=()=>t.useContext(Lt).get(),Pt=()=>{try{return t.useContext(Lt).get().creative.copy}catch(e){return}},$t=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Ft=i.compose(i.not,i.isEmpty),Gt=i.where({url:Ft,title:Ft});function Mt(e,t,n){return t.reduce(((t,n)=>{const[a,i]=n.slice(0,-1).split("["),o=i?i.split(","):[];if(!a)throw new Error(Ut(e,"This Meta Attribute could not be parsed."));return function(e,t,n,a){switch(t){case"openLinks":return function(e,t,n){Bt(t,e,"openLinks",1,2);const a=Vt(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),i=zt(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===a)return n.replace($t,((e,t)=>`<a ${fe} ${i?`${ye}="${i}" `:""}${t}`));return n}(e,n,a);case"sliceText":return function(e,t,n){Bt(t,e,"sliceText",2,2);const a=Vt(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),i=Vt(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"===a)return function(e,t){const n=new RegExp(">.*(?:</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,i);throw Error(Ut(e,`Unknown "SliceBy" value. ${a}`))}(e,n,a);default:throw new Error(Ut(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,o,t)}),n)}function Bt(e,t,n,a,i){const o=new Error(Ut(t,`${n} meta attribute takes ${a!=i?`between ${a} and ${i}`:a} arguments; received ${e.length}.`));if(e.length<a||e.length>i)throw o}function Ut(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Vt(e,t,n,a,i){const o=zt(e,n,a);if(null!==o)return o;throw Error(Ut(t,i||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function zt(e,t,n){return n(e[t])}const qt="DATA",Ht="STATE",Wt=new RegExp(`^(${qt}|${Ht})`),Kt=new RegExp(`^${Ht}`),Yt=new RegExp(`%\\^(?:${qt}|${Ht})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Jt=Symbol("invalid");function Zt(e,t="creativeCopy"){const n=Qt({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Qt(t,n,this.dataMap)});let a=!1;const o=t,r=i.pipe(i.slice(2,-2),i.split("|"),(e=>{const t=i.reduce(((e,t)=>{let n;if(Wt.test(t)){if(!this.dataMap.has(t)&&Kt.test(t))throw new L(mt,`Invalid use of STATE template key in a context it does not exist: ${t}`);const a=i.split(":",t);if(a[0]){if(n=this.dataMap.get(a[0]),n&&n===Jt)throw new L(mt,`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(a.length>1&&n)try{n=Mt(a[0],a.slice(1),n)}catch(e){throw new L(mt,`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?i.reduced({provided:!0,value:n}):e}return i.reduced({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(a=!0),t.value})),s=i.replace(Yt,r,o);return!1===a?s:""}.bind({dataMap:n})}function Qt(e,t,n){const a=new Map(n);return"data"in e&&o(e.data,`${qt}${t?"."+t:""}`),"state"in e&&o(e.state,`${Ht}${t?"."+t:""}`),a;function o(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?a.set(t,(null==e?void 0:e.toString())||""):a.set(t,Jt),e&&"object"==typeof e&&i.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const Xt=t.createContext(Zt({})),en=Xt.Consumer,tn=Xt.Provider,nn=()=>t.useContext(Xt),an=t.createContext(null),on=an.Provider,rn=t.createContext("OUTER"),sn=()=>"VARIANT"===t.useContext(rn),ln=t.createContext(void 0),cn=()=>t.useContext(ln);var dn,un,pn,fn,yn,mn,hn=function(e,t,n,a){return new(n||(n=Promise))((function(i,o){function r(e){try{l(a.next(e))}catch(e){o(e)}}function s(e){try{l(a.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((a=a.apply(e,t||[])).next())}))},vn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},gn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class bn{constructor(e,t,n,a,o){dn.set(this,void 0),un.set(this,void 0),pn.set(this,new Set),fn.set(this,void 0),yn.set(this,void 0),mn.set(this,void 0),vn(this,dn,i.partial(e.subscribe.bind(e),[n]),"f"),vn(this,un,i.partial(e.dispatch.bind(e),[n]),"f"),vn(this,fn,t,"f"),vn(this,yn,a,"f"),vn(this,mn,o,"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=gn(this,dn,"f").call(this,e),n=()=>{t(),gn(this,pn,"f").delete(n)};return gn(this,pn,"f").add(n),n}onInteractivityChange(e){return gn(this,yn,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=gn(this,mn,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),gn(this,pn,"f").delete(n)};return gn(this,pn,"f").add(n),n}globalDispatch(e){gn(this,un,"f").call(this,e)}dispose(){gn(this,pn,"f").forEach((e=>e())),vn(this,pn,new Set,"f"),gn(this,yn,"f").clear()}createChildPlugin(e){return gn(this,fn,"f").call(this,e)}}dn=new WeakMap,un=new WeakMap,pn=new WeakMap,fn=new WeakMap,yn=new WeakMap,mn=new WeakMap;class In{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>hn(this,void 0,void 0,(function*(){})),onClose:()=>hn(this,void 0,void 0,(function*(){})),putConfig:()=>hn(this,void 0,void 0,(function*(){})),send:()=>hn(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var En,xn,Sn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},Cn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class wn{constructor(e){En.set(this,void 0),xn.set(this,new Set),Sn(this,En,e,"f")}subscribe(e){return Cn(this,xn,"f").add(e),!0===e(Cn(this,En,"f"))&&Cn(this,xn,"f").delete(e),()=>{Cn(this,xn,"f").delete(e)}}publish(e){Sn(this,En,e,"f"),Cn(this,xn,"f").forEach((e=>{!0===e(Cn(this,En,"f"))&&Cn(this,xn,"f").delete(e)}))}clear(){Cn(this,xn,"f").clear()}}En=new WeakMap,xn=new WeakMap;var Tn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)},On=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n};const An="breakpoint-0px";class jn{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,a,i,o,r,s,l,c,d,u,p,f;const y=this.appFactory,m=this.logger,h=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new In;return f=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),a.set(this,(()=>null)),i.set(this,void 0),o.set(this,!1),r.set(this,null),s.set(this,null),l.set(this,null);const e=this.attachShadow({mode:"open"});On(this,i,document.createElement("div"),"f"),Tn(this,i,"f").id="app-container",Tn(this,i,"f").classList.add("default"),e.appendChild(Tn(this,i,"f"))}attributeChangedCallback(e,i,o){if(o!==i)switch(e){case"visible":Tn(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Tn(this,a,"f").call(this,o);break;case"active-breakpoint":Tn(this,t,"m",c).call(this,o,i)}}makeInteractivityUpdateHandler(e){On(this,a,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,a,i){const o="true"===this.getAttribute("visible"),r=this.getAttribute("slotInstanceGuid");On(this,n,(o=>{o?(On(this,n,(()=>null),"f"),0===e&&i.globalDispatch({type:ee,payload:{event:"Interactive"}}),a&&(i.globalDispatch({type:X,payload:{name:"SignalImpression",parentGuid:a}}),this.trackViewability(a,i)),r&&i.globalDispatch({type:X,payload:{name:"SignalImpression",parentGuid:r}})):Tn(this,t,"m",p).call(this)}),"f"),Tn(this,n,"f").call(this,o)}trackViewability(e,n){if(!Tn(this,o,"f"))if("IntersectionObserver"in window&&!Tn(this,r,"f")){const a=()=>{Tn(this,o,"f")||(n.globalDispatch({type:X,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),On(this,o,!0,"f"),Tn(this,t,"m",p).call(this),Tn(this,i,"f").removeEventListener("click",a))};Tn(this,i,"f").addEventListener("click",a),On(this,r,new IntersectionObserver((r=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=.5?Tn(this,t,"m",u).call(this,(()=>{Tn(this,o,"f")||(n.globalDispatch({type:X,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),On(this,o,!0,"f"),Tn(this,t,"m",p).call(this),Tn(this,i,"f").removeEventListener("click",a))})):Tn(this,t,"m",d).call(this)}))}),{threshold:.5}),"f"),On(this,l,(()=>{var e,n;"visible"===document.visibilityState?null===(e=Tn(this,r,"f"))||void 0===e||e.observe(Tn(this,i,"f")):(Tn(this,t,"m",d).call(this),null===(n=Tn(this,r,"f"))||void 0===n||n.disconnect())}),"f"),document.addEventListener("visibilitychange",Tn(this,l,"f")),Tn(this,l,"f").call(this)}else n.globalDispatch({type:X,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),On(this,o,!0,"f")}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&v(`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){v(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Tn(this,t,"m",p).call(this)}connectedCallback(){var e,t,n;const a=this.getAttribute("container"),o=this.getAttribute("plugin-id");Tn(this,i,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===a?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),d=new wn("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),u=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",p=this.getJSONAttr("offerState","{}");y||v("Cannot create app without factory. Please build the connector withAppFactory.");const f=h({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},d);this.makeInteractivityUpdateHandler(d),y({rootElement:Tn(this,i,"f"),gateway:f,logger:m,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:u,pluginId:o||A.pluginId,offerState:p}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,f)}},n=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,t=new WeakSet,c=function(e,t){Tn(this,i,"f").classList.remove(t||An),Tn(this,i,"f").classList.add(e||An)},d=function(){Tn(this,s,"f")&&(clearTimeout(Tn(this,s,"f")),On(this,s,null,"f"))},u=function(e){Tn(this,t,"m",d).call(this),On(this,s,window.setTimeout(e,1e3),"f")},p=function(){Tn(this,t,"m",d).call(this),Tn(this,r,"f")&&(Tn(this,r,"f").disconnect(),On(this,r,null,"f")),Tn(this,l,"f")&&(document.removeEventListener("visibilitychange",Tn(this,l,"f")),On(this,l,null,"f"))},f;function v(e){throw m({level:N,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Rn=t.createContext({get:()=>new In}),Nn=e=>t.createElement(Rn.Provider,{value:{get:()=>e.context}},e.children);const kn=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),Ln=e=>t.createElement(kn.Provider,{value:{get:()=>e.context}},e.children),Dn=()=>t.useContext(kn).get(),_n=t.createContext("ENABLED"),Pn=()=>t.useContext(_n);function $n(e){const t=Gn(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Gn(t,this.dataMap)});if(!n)throw new L("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const a=t;return i.path([n,a],this.dataMap)}.bind({dataMap:t})}const Fn={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Gn(e,t=Fn){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 Mn=t.createContext($n({}));Mn.Consumer;const Bn=Mn.Provider,Un=e=>{const n=t.useContext(Mn),a=e.split("|");for(const e of a){const t=n(e.trim(),"images");if(t)return t}},Vn=()=>t.useContext(Mn),zn=t.createContext({});function qn({info:e,children:n}){const a=t.useContext(zn);return t.createElement(zn.Provider,{value:Object.assign(Object.assign({},a),e)},n)}const Hn=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),Wn=e=>t.createElement(Hn.Provider,{value:{get:()=>e.context}},e.children),Kn=()=>t.useContext(Hn).get(),Yn=t.createContext(""),Jn=()=>t.useContext(Yn),Zn=t.createContext(""),Qn=t.createContext(void 0);function Xn({children:e}){const n=t.useMemo((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return t.createElement(Qn.Provider,{value:n},e)}const ea=i.compose(i.anyPass([i.isEmpty,i.all(i.isEmpty)]),i.flatten,i.map(i.values),i.map(i.ifElse(i.isNil,i.always({}),i.identity)),i.values,i.propOr({},"value")),ta=i.compose(i.isEmpty,i.prop("predicates"));function na(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const aa=i.curry(((e,{duration:t,predicates:n,styles:a})=>{return{predicates:n,classname:e(yt(a)),transitionBaseClassname:e(na(t,(o=a,i.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?i.keys(n).map((e=>we(t,e))):[]})))))};var o})),ia=i.anyPass([ea,ta]);const oa={is:i.equals,"is-not":i.compose(i.not,i.equals),"is-below":i.lt,"is-above":i.gt};function ra(e,t){return e.includes(t)}const sa={is:i.equals,"is-not":i.compose(i.not,i.equals),exists:ra,"not-exists":i.compose(i.not,ra)},la={exists:i.compose(i.not,i.either(i.isNil,i.isEmpty)),"not-exists":i.either(i.isNil,i.isEmpty)},ca={"is-true":i.equals(!0),"is-false":i.equals(!1)},da={is:i.equals,"is-not":i.compose(i.not,i.equals)};function ua(e){return(t,n)=>n[e]}const pa=i.cond([[(e,t)=>i.equals("Breakpoint",e),ua("activeBreakpoint")],[(e,t)=>i.equals("Progression",e),ua("progressionIndex")],[(e,t)=>i.equals("Position",e),ua("positionIndex")]]);function fa(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const ya=i.cond([[i.equals("Breakpoint"),(e,t,n)=>{const a=i.lensPath(["breakpoints",t]);return i.pipe(i.over(a,Number),i.view(a))(n)}],[i.equals("Progression"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalGroups)],[i.lte(0),i.identity]])(Number(t))],[i.equals("Position"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalOffers)],[i.lte(0),i.identity]])(Number(t))]]),ma=i.compose(i.not,isNaN);function ha(e,t){return e.map((e=>{var n,a,i;switch(e.type){case"StaticString":return(0,da[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,la[e.predicate.condition])(fa(t,e.predicate.value));case"StaticBoolean":return(0,ca[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,oa[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,oa[e.predicate.condition])(null!==(a=t.domainStates[e.predicate.key])&&void 0!==a?a: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,sa[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,oa[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,oa[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=oa[e.predicate.condition],a=null!==(i=pa(e.type,t))&&void 0!==i?i:NaN,o=ya(e.type,e.predicate.value,t);return!!ma(a)&&n(a,o)}}}))}function va(e){return i.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const ga={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function ba(e,t,n,a){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:a?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,a)=>function(e,t,n,a){const o=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:${fa(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:${pa(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return i.evolve(Ia(r)?{cached:i.append(r)}:{uncached:i.append({key:o,predicate:e})},a)}(a,n,e,t)),{cached:[],uncached:[]}),l=ha(s.map((({predicate:e})=>e)),n);return i.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const Ia=i.is(Boolean);const Ea=i.curry(((e,t,n)=>{var a,i,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:va(n),progressionIndex:null!==(i=null===(a=n.progression)||void 0===a?void 0:a.activeGroupIndex)&&void 0!==i?i: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}})),xa=i.lensPath(["predicate","content","input"]),Sa=i.lensPath(["predicate","content","value"]),Ca=i.lensPath(["predicate","key"]);function wa(e,t){const n=i.over(xa,(t=>t?e(t):"")),a=i.over(Sa,(t=>"string"==typeof t?e(t):t)),o=i.compose(n,a),r=i.over(Ca,(t=>t?e(t):""));return t.map((e=>{switch(e.type){case"Placeholder":return"TextValue"===e.predicate.type?o(e):n(e);case"CustomState":return r(e);default:return e}}))}const Ta=i.all(i.equals(!0));function Oa(e){const n=sn(),a=cn(),o=t.useRef(new Map),r=Pt(),s=Tt(ga,Ea(a,r)),l=nn();return t.useMemo((()=>i.mapObjIndexed((e=>{const t=wa(l,e);return Ta(ba(o,t,s,n))}),e)),[o,e,s,n,l])}function Aa(e){e&&(e.style.display="")}function ja(e){e&&(e.style.display="none")}function Ra(e){return e.settings.duration}const Na=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],ka=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function La(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const a=t?Na:ka,i=e.animate(a,{duration:n,iterations:1});return i.onfinish=()=>{t?Aa(e):ja(e)},i.oncancel=()=>{t?Aa(e):ja(e)},()=>{i.finish()}}return t?Aa(e):ja(e),()=>{}}function Da({inTransitions:e,outTransitions:n,visible:a,children:i,containerClassName:o}){const r=t.useRef(null);return t.useEffect((()=>a&&e?e.forEach((e=>{r.current&&function(e,t,n,a){if("FadeIn"===a)La(e,t,n)}(r.current,a,Ra(e),e.type)})):!a&&n?n.forEach((e=>{r.current&&function(e,t,n,a){if("FadeOut"===a)La(e,t,n)}(r.current,a,Ra(e),e.type)})):()=>{}),[a]),t.createElement("div",{ref:r,style:{display:"none"},className:o},i)}function _a(e){const n=jt(),a=function(e){const n=sn(),a=cn(),i=t.useRef(new Map),o=Pt(),r=Tt(ga,Ea(a,o)),s=wa(nn(),e);return t.useMemo((()=>Ta(ba(i,s,r,n))),[i,s,r,n])}(e.schema.predicates),i=t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,e.testId?`${e.testId}-child${a}`:void 0))));return e.schema.transition?t.createElement(Da,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:a},i):"functionally"===e.schema.hide?t.createElement(_n.Provider,{value:a?"ENABLED":"DISABLED"},i):a?t.createElement(t.Fragment,null,i):null}const Pa=i.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),$a=e=>{var n;const a=t.useContext(an),o=cn(),r=kt()||document.head,s=Jn(),l=gt(s,o,r),c=t.useCallback(It,[]),d=Tt([],(e=>Object.values(e.breakpoint.breakpoints))),u=a||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=aa(e);return i.mapObjIndexed((e=>ia(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,y=Oa(f?i.mapObjIndexed(i.propOr([],"predicates"),f):{}),m=i.mapObjIndexed(((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}(f,t):void 0),y),h=f?i.mapObjIndexed(i.prop("transitionBaseClassname"),f):{},v=e.styles?(g=h,Pa(Pa(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:u})};function Fa(e){const n=jt();return t.createElement($a,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.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},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,z(a,e.testId))))))}))}function Ga(e){const n=jt();return t.createElement($a,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.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},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,z(a,e.testId))))))}))}const Ma={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",fe,ye],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Ba=new Map([["&","_;^;_"]]),Ua=new RegExp(`<a *(?=${Ma.allowedAttributes.a.join("|")}|>)`,"g"),Va=new RegExp('<a [^>]*href="([^"]+)"',"g"),za=new RegExp("(<br *?>)|(<br *?/>)","g"),qa="<br/>";function Ha(e){const n=nn(),a=Pn(),i=t.useMemo((()=>{const t=n(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Va,((e,t)=>{const n=t.replaceAll("&",Ba.get("&"));return e.replace(t,n)})).replaceAll(za,qa)}(e);return t===u(t,Ma)}(t))throw new L("FAILED_SANITISING_HTML","Invalid HTML tags");return t.trim()?t:""}),[e.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=g(a);return i?t.createElement($a,{styles:e.schema.styles},(({classnames:n})=>{const a=[(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=i,new RegExp("</(p|ul|ol)>").test(l)?t.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ua,`<a ${a.join(" ")}`)}}):t.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ua,`<a ${a.join(" ")}`)}});var l})):null}function Wa(e){const n=nn()(e.schema.value),a=Pn(),{tabIndex:i,styles:o,isDisabled:r}=g(a);return n?t.createElement($a,{styles:e.schema.styles},(({classnames:a})=>{const s={tabIndex:i,"aria-hidden":r,className:null==a?void 0:a.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?t.createElement("span",Object.assign({style:o},s),n):t.createElement("p",Object.assign({style:o},s),n)})):null}function Ka(e,n,a){if("BasicText"===e.type)return t.createElement(Wa,{schema:e.node,testId:n,isInline:null!=a&&a})}function Ya(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,z(t,a)))))}function Ja(e){const n=Ct(),a=jt(),i=_t(),o=nn(),r=cn(),s=Pn(),l=i.creative.responseOptionsMap[e.schema.responseKey],c=w(l);t.useEffect((()=>{c&&n(function(e){if(e.paymentTriggerConfig)return{type:ie,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(l))}),[l,n,c]);const d=l?o({data:l},"creativeResponse"):o,{tabIndex:u,styles:p,isDisabled:f}=g(s);return x(l)&&!c&&void 0!==r?t.createElement($a,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return t.createElement("button",{type:"button",tabIndex:u,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},p),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:t=>{t.preventDefault();const a=function(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(E(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,urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,l,e.schema.openLinks);n({type:H,payload:a})},className:null==o?void 0:o.own,disabled:f},t.createElement(tn,{value:d},(null==o?void 0:o.own)?function(e,n,a,i,o){return t.createElement(on,{value:a(n)},Ya(e,i,o))}(e.schema.children,o.own,r,a,e.testId):Ya(e.schema.children,a,e.testId)))})):null}function Za(e){const n=Pn(),{styles:a,isDisabled:i}=g(n);return e.schema.url.light?t.createElement($a,{styles:v(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function Qa(e){const n=Pn(),{styles:a,isDisabled:i}=g(n),o=Un(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?t.createElement($a,{styles:v(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const Xa={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function ei(e){const n=e.schema.name,a=e.schema.description,i=e.schema.styles?U(Xa,e.schema.styles):Xa,o=Pn(),{styles:r,isDisabled:s}=g(o);return n?t.createElement($a,{styles:i},(({classnames:i})=>t.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-${n}`},!s&&a?{title:a}:{"aria-hidden":"true"}),n))):null}const ti={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class ni extends t.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"===Ie.REPORT_RENDER_ERRORS&&this.props.reporter({level:N,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"===Ie.DISPLAY_ERRORS?t.createElement("pre",{style:ti},t.createElement("strong",null,"Error:")," [",t.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}ni.contextType=zn;const ai={internally:"_top",externally:"_blank"};function ii(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,a?`${a}-child${t}`:void 0))))}function oi(e){var n;const a=ai[e.schema.open],i=jt(),o=Pn(),{tabIndex:r,styles:s,isDisabled:l}=g(o);return(null===(n=e.schema.children)||void 0===n?void 0:n.length)>0?t.createElement($a,{styles:e.schema.styles},(({classnames:n,mapperRef:o})=>{var c;return t.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=a?a:"_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==n?void 0:n.own},(null==n?void 0:n.own)?function(e,n,a,i,o){return t.createElement(on,{value:a(n)},ii(e,i,o))}(e.schema.children,null==n?void 0:n.own,o,i,e.testId):ii(e.schema.children,i,e.testId))})):null}function ri(e,n,a){if("StaticLink"===e.type)return t.createElement(oi,{schema:e.node,testId:n,isInline:null!=a&&a})}const si={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function li(e){const n=(a=e.schema.iconKey,t.useContext(Mn)(a,"icons"));var a;const i=null==n?void 0:n.name,o=e.schema.styles?U(si,e.schema.styles):si,r=Pn(),{styles:s}=g(r);return i?t.createElement($a,{styles:o},(({classnames:n})=>t.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==n?void 0:n.own)?" "+n.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const ci=o.css`
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),a=require("react-redux"),i=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("@reduxjs/toolkit"),l=require("redux-saga"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance"),f=require("embla-carousel-autoplay"),y=require("embla-carousel-fade");function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var h=m(t);function v(e){const t=["elements","own"],n=["default","dimension","width","type"],a=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=i.path(t,e);return r&&Array.isArray(r)&&r.length?i.assocPath(t,r.map(i.when(i.allPass([i.hasPath(n),i.complement(i.hasPath(o)),i.pathEq("fixed",n)]),(e=>i.assocPath(o,i.path(a,e),e)))),e):e}function g(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function b(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function I(){return"ontouchstart"in document.documentElement}function E(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function x(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function S(e){return x(e)&&"Fulfillment"===e.action}function C(e){return x(e)&&"Url"===e.action}function w(e){return x(e)&&"ExternalPaymentTrigger"===e.action}function T(e){return(S(e)||C(e))&&"RealTime"===e.conversionType&&"rclid"in e}function O(e){return(S(e)||C(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}const A={pluginId:"shared",pageInstanceGuid:"N/A"};var j;!function(e){e.DCUI="DCUI",e.Partner="partner"}(j||(j={}));const R=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction"],N="ERROR",k="WARNING";class L extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const D=["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","INITIATE_INSTANT_PURCHASE_EVENT","INITIATE_CART_ITEM_EVENT","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const _=(e,t)=>i.concat(e,i.slice(e.length,t.length,t)),P=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?_(t,e):t,a=t.length>e.length?_(e,t):e;return i.zipWith(B,a,n)}return t},$=e=>null==e,F=e=>!$(e),G=(e,t)=>$(t)?e:t,M=(e,t)=>{throw new L("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function B(e,t){return i.cond([[(e,t)=>F(e)&&F(t)&&i.type(e)!==i.type(t)&&("Object"===i.type(e)||"Object"===i.type(t)),M],[(e,t)=>$(e)||$(t),G],[(e,t)=>"Object"===i.type(e),i.mergeDeepWith(B)],[(e,t)=>"Array"===i.type(e),P],[i.T,i.flip(i.unary(i.identity))]])(e,t)}function U(e,t){return B(e,t)}function V(e=0){return`breakpoint-${e}px`}function z(e,t){return t?`${t}-child${e}`:void 0}const q="GLOBAL/RAISE_METRIC",H="GLOBAL/OFFER_ENGAGEMENT";function W(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&S(e.responseOption)&&"fulfillment"in e&&E(e.fulfillment)}function K(e){return w(e)}function Y(e){return C(e)}function J(e){return function(e){return x(e)&&"CaptureOnly"===e.action}(e)}function Z(e){return!!(T(e)||"responseOption"in e&&T(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Q(e){return!!(O(e)||"responseOption"in e&&O(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const X="GLOBAL/RAISE_SIGNAL",ee="GLOBAL/OFFER_LIFECYCLE",te="GLOBAL/SET_CUSTOM_STATE",ne="GLOBAL/SEND_PARTNER",ae="GLOBAL/SET_DOMAIN_STATE",ie="GLOBAL/PREPARE_SIGNAL",oe="GLOBAL/OPEN_LINK",re="GLOBAL/SET_PARTNER_VALIDATION_STATUS",se="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",le="GLOBAL/LAUNCH_CHILD_LAYOUT",ce="GLOBAL/CART_ITEM_EVENT/INITIATE",de="GLOBAL/CART_ITEM_EVENT/RESPONSE",ue="GLOBAL/CART_SERVICE/INITIALIZE",pe={RAISE_METRIC:q,PREPARE_SIGNAL:ie,OFFER_ENGAGEMENT:H,RAISE_SIGNAL:X,OFFER_LIFECYCLE:ee,SEND_PARTNER:ne,SET_CUSTOM_STATE:te,SET_DOMAIN_STATE:ae,OPEN_LINK:oe,SET_PARTNER_VALIDATION_STATUS:re,SET_GLOBAL_OFFER_DATA_CART:se,LAUNCH_CHILD_LAYOUT:le,INITIATE_CART_ITEM_EVENT:ce,CART_ITEM_RESPONSE:de},fe="data-open-in-app",ye="data-click-signal-context";function me(e,n){function a(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const a=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(a){const t=a.getAttribute("href"),i=a.getAttribute(ye);if(i&&n({type:X,payload:{name:"SignalUserInteraction",action:"Click",context:i}}),t){e.preventDefault();let i="newTab";a.hasAttribute(fe)&&(i="inApp"),n({type:oe,payload:{url:t,urlBehaviour:i}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",a),()=>{e.removeEventListener("click",a)}):()=>{}),[e])}function he(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&ve(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const ve=(e,t)=>{var n;const a=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!a)return;const i=a[0],o=a[a.length-1],{activeElement:r}=window.document;if(1!==a.length)return r===i&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(i&&i.focus(),void e.preventDefault());e.preventDefault()},ge=i.sortBy(i.prop(1)),be=i.map(i.prop(0)),Ie="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function Ee(e,t){return t?"false"!==Ie.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${V(e)} ${t.trim()}`:`#app-container.${V(e)} & {${t}}`:"";var n}const xe={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function Se(e){return function(e){return Object.keys(xe).indexOf(e)>-1}(e)?xe[e]:""}const Ce={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 we(e,t){if(!Ce[e]||!Ce[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return Ce[e][t]}function Te(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Oe(...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 Ae(e,t){return`${e}:${t};`}function je(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Re extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Ne(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 Re(n,JSON.stringify(t));return!0}function ke(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Le(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 De(e){if(null==e||""===e)return"value must not be omitted"}function _e(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 Pe(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 $e(e){if(null!=e&&""!==e)return"value must not be specified"}function Fe(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 Ge(...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||ke(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Me(e,t){return n=>{const a=e(n),i=t(n);if(a&&i)return`one of these must be true: ${a} -OR- ${i}`}}function Be(e){if("string"!=typeof e)return"value must be a string"}const Ue=i.is(Object);function Ve(e){const t=Object.entries(e);return n=>Ue(n)&&!Array.isArray(n)?t.reduce(((e,[t,a])=>e||a(n[t])),void 0):`Input value (${e}) must be an object`}function ze(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function qe(e,t,n){return Ne(ke,n)?Ae(we(e,t),`${n}`):""}function He(e){return(t,n,a)=>Ne(Le(Object.keys(e)),a)?Ae(we(t,n),`${e[a]}`):""}function We(e){return Ne(De,e)?Te({light:t(Pe,!1),dark:t(Me($e,Pe),!0)},Oe("\n "))(e):"";function t(e,t){return n=>{if(Ne(e,n)&&n){const e=Ae("background-image",`url("${n}")`);return t?je(e):e}return""}}}function Ke(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Ne(Me($e,Le(Object.keys(t))),e)&&e?Ae("background-size",t[e]):""}const Ye=i.cond([[i.equals("top-left"),i.always("top left")],[i.equals("top-right"),i.always("top right")],[i.equals("bottom-left"),i.always("bottom left")],[i.equals("bottom-right"),i.always("bottom right")],[i.T,i.identity]]);function Je(e){const t="string"==typeof e?e.toLowerCase():e;return Ne(Me($e,Le(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Ae("background-position",Ye(t)):""}function Ze(e,t,n){return Ne(Me(ke,Ge(2,3,4)),n)?Ae(we(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Qe(e){return(t,n,a)=>Ne(Fe({fit:Le(e),percentage:ke,fixed:ke}),a)?Ae(we(t,n),Xe(a)):""}function Xe(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]}}const et=Ve({light:_e,dark:Me($e,_e)});function tt(e,t,n){return a=>{if(a){const i=Ae(we(e,t),at(String(a)));return n?je(i):i}return""}}function nt(e,t,n){return Ne(et,n)?Te({light:tt(e,t,!1),dark:tt(e,t,!0)},Oe("\n "))(n):""}function at(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 it=Ve({offsetX:Me($e,ke),offsetY:Me($e,ke),blurRadius:Me($e,ke),spreadRadius:Me($e,ke),color:et}),ot=e=>t=>null!=t?String(t):e,rt=i.compose(i.concat(i.__,"px"),ot("0")),st=e=>t=>"string"==typeof t?e(t):t,lt=i.compose(st(i.concat(i.__,"px")),ot(void 0)),ct=i.compose(st(at),i.prop("dark"));function dt(e,t,n){return Ae(e,Te({offsetX:rt,offsetY:rt,blurRadius:t.spreadRadius?rt:lt,spreadRadius:lt,color:n},Oe(" "))(t))}const ut={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},pt={container:{justifyContent:He(ut),alignItems:He(ut),shadow:function(e,t,n){var a,o,r;if(Ne(it,n)){const s=we(e,t);return Oe("\n")(dt(s,n,(o="light",r="#80000000",i.compose(at,i.propOr(r,o)))),(null===(a=n.color)||void 0===a?void 0:a.dark)?je(dt(s,n,ct)):"")}return""},gap:Ze,overflow:He({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return Ne(ze,n)?Ae(we(e,t),`blur(${n.toString()}px)`):""},opacity:qe},text:{textColor:nt,fontSize:Ze,fontFamily:function(e,t,n){return Ne(Be,n)?Ae(we(e,t),(a=`${n}`,a.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 a},fontWeight:He({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:He({normal:"normal",italic:"italic"}),lineHeight:Ze,lineLimit:function(e,t,n){return Ne(ke,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:Ze,baselineTextAlign:He({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:He({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:He({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:He({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:nt,backgroundImage:function(e,t,n){return Ne(De,n)?Te({url:We,position:Je,scale:Ke},Oe)(n):""}},dimension:{width:Qe(["wrap-content","fit-width"]),maxWidth:Ze,minWidth:Ze,height:Qe(["wrap-content","fit-height"]),maxHeight:Ze,minHeight:Ze,rotateZ:(ft="Z",(e,t,n)=>{const a=`rotate${ft}`;return Ne(ke,n)?Ae(we(e,t),`${a}(${n.toString()}deg)`):""})},flexChild:{alignSelf:He(ut),weight:qe,order:qe},spacing:{margin:Ze,padding:Ze,offset:function(e,t,n){return Ne(Ge(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:nt,borderRadius:Ze,borderWidth:Ze,borderStyle:He({solid:"solid",dashed:"dashed"})}};var ft;function yt(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((a=>{if(!pt[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const i=pt[n][a];if(!i)throw new Error(`No styling transformer exists for property: ${n}.${a.toString()}`);try{t+=i(n,a,e[n][a])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${a.toString()}: ${e.message}`),e}})),t)),"")}const mt="FAILED_TEMPLATING_DATA",ht=new Map;function vt(e){return String.fromCharCode(97+e)}function gt(e,t,n){const a=`${e||A.pluginId}-${void 0!==t?String(t):"outer"}`,i=ht.get(a);if(i&&i.sheet.container.isConnected)return i.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${vt(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return ht.set(a,o),o.css}const bt="%%%OWN_CLASS_REF%%%",It=i.memoizeWith(((e,t,n,a)=>`${String(e)}-${t}-${n}`),Et);function Et(e,t,n,a){const i=gt(t,n,a);let o=1;return function t(n,a=!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,i])=>Object.assign(Object.assign({},t),{[n]:xt(i,l,a,String(n),e)})),{}),n=Object.entries(t),r=a?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?i(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const a=n.replace(bt,r);return Object.assign(Object.assign({},e),{[t]:a?i(a):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function xt(e,t,n,a,i){return e.map(function(e,t,n){return a=>Object.entries(a).map((([a,i])=>{const o=i?yt(i):"";switch(!0){case"default"===a:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${Se(a)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${bt}${Se(a)} & {\n${o}\n}\n`;default:return`\n &${Se(a)} {\n${o}\n}\n`}})).join("")}(t,n,a)).reduce(((e,t,n)=>{const a=i[n];return void 0!==a?e+(0===n?t:`${Ee(a,t)}\n`):e}),"")}const St=t.createContext(i.always(void 0)),Ct=()=>t.useContext(St),wt=t.createContext(null);function Tt(e,n){var a;const i=t.useContext(wt);return i&&null!==(a=n(i))&&void 0!==a?a:e}const Ot=t.createContext((()=>{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")})),At=Ot.Consumer,jt=()=>t.useContext(Ot),Rt=e=>t.createElement(Ot.Provider,{value:(t,n,a)=>e.value(t,null!=n?n:e.overrides,a)},e.children),Nt=t.createContext(null),kt=()=>t.useContext(Nt),Lt=t.createContext({get(){throw Error("Offer context has not been set")}}),Dt=e=>t.createElement(Lt.Provider,{value:{get:()=>e.context}},e.children),_t=()=>t.useContext(Lt).get(),Pt=()=>{try{return t.useContext(Lt).get().creative.copy}catch(e){return}},$t=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Ft=i.compose(i.not,i.isEmpty),Gt=i.where({url:Ft,title:Ft});function Mt(e,t,n){return t.reduce(((t,n)=>{const[a,i]=n.slice(0,-1).split("["),o=i?i.split(","):[];if(!a)throw new Error(Ut(e,"This Meta Attribute could not be parsed."));return function(e,t,n,a){switch(t){case"openLinks":return function(e,t,n){Bt(t,e,"openLinks",1,2);const a=Vt(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),i=zt(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===a)return n.replace($t,((e,t)=>`<a ${fe} ${i?`${ye}="${i}" `:""}${t}`));return n}(e,n,a);case"sliceText":return function(e,t,n){Bt(t,e,"sliceText",2,2);const a=Vt(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),i=Vt(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"===a)return function(e,t){const n=new RegExp(">.*(?:</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,i);throw Error(Ut(e,`Unknown "SliceBy" value. ${a}`))}(e,n,a);default:throw new Error(Ut(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,o,t)}),n)}function Bt(e,t,n,a,i){const o=new Error(Ut(t,`${n} meta attribute takes ${a!=i?`between ${a} and ${i}`:a} arguments; received ${e.length}.`));if(e.length<a||e.length>i)throw o}function Ut(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Vt(e,t,n,a,i){const o=zt(e,n,a);if(null!==o)return o;throw Error(Ut(t,i||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function zt(e,t,n){return n(e[t])}const qt="DATA",Ht="STATE",Wt=new RegExp(`^(${qt}|${Ht})`),Kt=new RegExp(`^${Ht}`),Yt=new RegExp(`%\\^(?:${qt}|${Ht})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Jt=Symbol("invalid");function Zt(e,t="creativeCopy"){const n=Qt({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Qt(t,n,this.dataMap)});let a=!1;const o=t,r=i.pipe(i.slice(2,-2),i.split("|"),(e=>{const t=i.reduce(((e,t)=>{let n;if(Wt.test(t)){if(!this.dataMap.has(t)&&Kt.test(t))throw new L(mt,`Invalid use of STATE template key in a context it does not exist: ${t}`);const a=i.split(":",t);if(a[0]){if(n=this.dataMap.get(a[0]),n&&n===Jt)throw new L(mt,`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(a.length>1&&n)try{n=Mt(a[0],a.slice(1),n)}catch(e){throw new L(mt,`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?i.reduced({provided:!0,value:n}):e}return i.reduced({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(a=!0),t.value})),s=i.replace(Yt,r,o);return!1===a?s:""}.bind({dataMap:n})}function Qt(e,t,n){const a=new Map(n);return"data"in e&&o(e.data,`${qt}${t?"."+t:""}`),"state"in e&&o(e.state,`${Ht}${t?"."+t:""}`),a;function o(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?a.set(t,(null==e?void 0:e.toString())||""):a.set(t,Jt),e&&"object"==typeof e&&i.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const Xt=t.createContext(Zt({})),en=Xt.Consumer,tn=Xt.Provider,nn=()=>t.useContext(Xt),an=t.createContext(null),on=an.Provider,rn=t.createContext("OUTER"),sn=()=>"VARIANT"===t.useContext(rn),ln=t.createContext(void 0),cn=()=>t.useContext(ln);var dn,un,pn,fn,yn,mn,hn=function(e,t,n,a){return new(n||(n=Promise))((function(i,o){function r(e){try{l(a.next(e))}catch(e){o(e)}}function s(e){try{l(a.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((a=a.apply(e,t||[])).next())}))},vn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},gn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class bn{constructor(e,t,n,a,o){dn.set(this,void 0),un.set(this,void 0),pn.set(this,new Set),fn.set(this,void 0),yn.set(this,void 0),mn.set(this,void 0),vn(this,dn,i.partial(e.subscribe.bind(e),[n]),"f"),vn(this,un,i.partial(e.dispatch.bind(e),[n]),"f"),vn(this,fn,t,"f"),vn(this,yn,a,"f"),vn(this,mn,o,"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=gn(this,dn,"f").call(this,e),n=()=>{t(),gn(this,pn,"f").delete(n)};return gn(this,pn,"f").add(n),n}onInteractivityChange(e){return gn(this,yn,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=gn(this,mn,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),gn(this,pn,"f").delete(n)};return gn(this,pn,"f").add(n),n}globalDispatch(e){gn(this,un,"f").call(this,e)}dispose(){gn(this,pn,"f").forEach((e=>e())),vn(this,pn,new Set,"f"),gn(this,yn,"f").clear()}createChildPlugin(e){return gn(this,fn,"f").call(this,e)}}dn=new WeakMap,un=new WeakMap,pn=new WeakMap,fn=new WeakMap,yn=new WeakMap,mn=new WeakMap;class In{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>hn(this,void 0,void 0,(function*(){})),onClose:()=>hn(this,void 0,void 0,(function*(){})),putConfig:()=>hn(this,void 0,void 0,(function*(){})),send:()=>hn(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var En,xn,Sn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},Cn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class wn{constructor(e){En.set(this,void 0),xn.set(this,new Set),Sn(this,En,e,"f")}subscribe(e){return Cn(this,xn,"f").add(e),!0===e(Cn(this,En,"f"))&&Cn(this,xn,"f").delete(e),()=>{Cn(this,xn,"f").delete(e)}}publish(e){Sn(this,En,e,"f"),Cn(this,xn,"f").forEach((e=>{!0===e(Cn(this,En,"f"))&&Cn(this,xn,"f").delete(e)}))}clear(){Cn(this,xn,"f").clear()}}En=new WeakMap,xn=new WeakMap;var Tn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)},On=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n};const An="breakpoint-0px";class jn{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,a,i,o,r,s,l,c,d,u,p,f;const y=this.appFactory,m=this.logger,h=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new In;return f=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),a.set(this,(()=>null)),i.set(this,void 0),o.set(this,!1),r.set(this,null),s.set(this,null),l.set(this,null);const e=this.attachShadow({mode:"open"});On(this,i,document.createElement("div"),"f"),Tn(this,i,"f").id="app-container",Tn(this,i,"f").classList.add("default"),e.appendChild(Tn(this,i,"f"))}attributeChangedCallback(e,i,o){if(o!==i)switch(e){case"visible":Tn(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Tn(this,a,"f").call(this,o);break;case"active-breakpoint":Tn(this,t,"m",c).call(this,o,i)}}makeInteractivityUpdateHandler(e){On(this,a,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,a,i){const o="true"===this.getAttribute("visible"),r=this.getAttribute("slotInstanceGuid");On(this,n,(o=>{o?(On(this,n,(()=>null),"f"),0===e&&i.globalDispatch({type:ee,payload:{event:"Interactive"}}),a&&(i.globalDispatch({type:X,payload:{name:"SignalImpression",parentGuid:a}}),this.trackViewability(a,i)),r&&i.globalDispatch({type:X,payload:{name:"SignalImpression",parentGuid:r}})):Tn(this,t,"m",p).call(this)}),"f"),Tn(this,n,"f").call(this,o)}trackViewability(e,n){if(!Tn(this,o,"f"))if("IntersectionObserver"in window&&!Tn(this,r,"f")){const a=()=>{Tn(this,o,"f")||(n.globalDispatch({type:X,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),On(this,o,!0,"f"),Tn(this,t,"m",p).call(this),Tn(this,i,"f").removeEventListener("click",a))};Tn(this,i,"f").addEventListener("click",a),On(this,r,new IntersectionObserver((r=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=.5?Tn(this,t,"m",u).call(this,(()=>{Tn(this,o,"f")||(n.globalDispatch({type:X,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),On(this,o,!0,"f"),Tn(this,t,"m",p).call(this),Tn(this,i,"f").removeEventListener("click",a))})):Tn(this,t,"m",d).call(this)}))}),{threshold:.5}),"f"),On(this,l,(()=>{var e,n;"visible"===document.visibilityState?null===(e=Tn(this,r,"f"))||void 0===e||e.observe(Tn(this,i,"f")):(Tn(this,t,"m",d).call(this),null===(n=Tn(this,r,"f"))||void 0===n||n.disconnect())}),"f"),document.addEventListener("visibilitychange",Tn(this,l,"f")),Tn(this,l,"f").call(this)}else n.globalDispatch({type:X,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),On(this,o,!0,"f")}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&v(`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){v(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Tn(this,t,"m",p).call(this)}connectedCallback(){var e,t,n;const a=this.getAttribute("container"),o=this.getAttribute("plugin-id");Tn(this,i,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===a?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),d=new wn("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),u=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",p=this.getJSONAttr("offerState","{}");y||v("Cannot create app without factory. Please build the connector withAppFactory.");const f=h({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},d);this.makeInteractivityUpdateHandler(d),y({rootElement:Tn(this,i,"f"),gateway:f,logger:m,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:u,pluginId:o||A.pluginId,offerState:p}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,f)}},n=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,t=new WeakSet,c=function(e,t){Tn(this,i,"f").classList.remove(t||An),Tn(this,i,"f").classList.add(e||An)},d=function(){Tn(this,s,"f")&&(clearTimeout(Tn(this,s,"f")),On(this,s,null,"f"))},u=function(e){Tn(this,t,"m",d).call(this),On(this,s,window.setTimeout(e,1e3),"f")},p=function(){Tn(this,t,"m",d).call(this),Tn(this,r,"f")&&(Tn(this,r,"f").disconnect(),On(this,r,null,"f")),Tn(this,l,"f")&&(document.removeEventListener("visibilitychange",Tn(this,l,"f")),On(this,l,null,"f"))},f;function v(e){throw m({level:N,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Rn=t.createContext({get:()=>new In}),Nn=e=>t.createElement(Rn.Provider,{value:{get:()=>e.context}},e.children);const kn=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),Ln=e=>t.createElement(kn.Provider,{value:{get:()=>e.context}},e.children),Dn=()=>t.useContext(kn).get(),_n=t.createContext("ENABLED"),Pn=()=>t.useContext(_n);function $n(e){const t=Gn(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Gn(t,this.dataMap)});if(!n)throw new L("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const a=t;return i.path([n,a],this.dataMap)}.bind({dataMap:t})}const Fn={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Gn(e,t=Fn){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 Mn=t.createContext($n({}));Mn.Consumer;const Bn=Mn.Provider,Un=e=>{const n=t.useContext(Mn),a=e.split("|");for(const e of a){const t=n(e.trim(),"images");if(t)return t}},Vn=()=>t.useContext(Mn),zn=t.createContext({});function qn({info:e,children:n}){const a=t.useContext(zn);return t.createElement(zn.Provider,{value:Object.assign(Object.assign({},a),e)},n)}const Hn=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),Wn=e=>t.createElement(Hn.Provider,{value:{get:()=>e.context}},e.children),Kn=()=>t.useContext(Hn).get(),Yn=t.createContext(""),Jn=()=>t.useContext(Yn),Zn=t.createContext(""),Qn=t.createContext(void 0);function Xn({children:e}){const n=t.useMemo((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return t.createElement(Qn.Provider,{value:n},e)}const ea=i.compose(i.anyPass([i.isEmpty,i.all(i.isEmpty)]),i.flatten,i.map(i.values),i.map(i.ifElse(i.isNil,i.always({}),i.identity)),i.values,i.propOr({},"value")),ta=i.compose(i.isEmpty,i.prop("predicates"));function na(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const aa=i.curry(((e,{duration:t,predicates:n,styles:a})=>{return{predicates:n,classname:e(yt(a)),transitionBaseClassname:e(na(t,(o=a,i.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?i.keys(n).map((e=>we(t,e))):[]})))))};var o})),ia=i.anyPass([ea,ta]);const oa={is:i.equals,"is-not":i.compose(i.not,i.equals),"is-below":i.lt,"is-above":i.gt};function ra(e,t){return e.includes(t)}const sa={is:i.equals,"is-not":i.compose(i.not,i.equals),exists:ra,"not-exists":i.compose(i.not,ra)},la={exists:i.compose(i.not,i.either(i.isNil,i.isEmpty)),"not-exists":i.either(i.isNil,i.isEmpty)},ca={"is-true":i.equals(!0),"is-false":i.equals(!1)},da={is:i.equals,"is-not":i.compose(i.not,i.equals)};function ua(e){return(t,n)=>n[e]}const pa=i.cond([[(e,t)=>i.equals("Breakpoint",e),ua("activeBreakpoint")],[(e,t)=>i.equals("Progression",e),ua("progressionIndex")],[(e,t)=>i.equals("Position",e),ua("positionIndex")]]);function fa(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const ya=i.cond([[i.equals("Breakpoint"),(e,t,n)=>{const a=i.lensPath(["breakpoints",t]);return i.pipe(i.over(a,Number),i.view(a))(n)}],[i.equals("Progression"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalGroups)],[i.lte(0),i.identity]])(Number(t))],[i.equals("Position"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalOffers)],[i.lte(0),i.identity]])(Number(t))]]),ma=i.compose(i.not,isNaN);function ha(e,t){return e.map((e=>{var n,a,i;switch(e.type){case"StaticString":return(0,da[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,la[e.predicate.condition])(fa(t,e.predicate.value));case"StaticBoolean":return(0,ca[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,oa[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,oa[e.predicate.condition])(null!==(a=t.domainStates[e.predicate.key])&&void 0!==a?a: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,sa[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,oa[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,oa[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=oa[e.predicate.condition],a=null!==(i=pa(e.type,t))&&void 0!==i?i:NaN,o=ya(e.type,e.predicate.value,t);return!!ma(a)&&n(a,o)}}}))}function va(e){return i.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const ga={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function ba(e,t,n,a){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:a?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,a)=>function(e,t,n,a){const o=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:${fa(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:${pa(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return i.evolve(Ia(r)?{cached:i.append(r)}:{uncached:i.append({key:o,predicate:e})},a)}(a,n,e,t)),{cached:[],uncached:[]}),l=ha(s.map((({predicate:e})=>e)),n);return i.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const Ia=i.is(Boolean);const Ea=i.curry(((e,t,n)=>{var a,i,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:va(n),progressionIndex:null!==(i=null===(a=n.progression)||void 0===a?void 0:a.activeGroupIndex)&&void 0!==i?i: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}})),xa=i.lensPath(["predicate","content","input"]),Sa=i.lensPath(["predicate","content","value"]),Ca=i.lensPath(["predicate","key"]);function wa(e,t){const n=i.over(xa,(t=>t?e(t):"")),a=i.over(Sa,(t=>"string"==typeof t?e(t):t)),o=i.compose(n,a),r=i.over(Ca,(t=>t?e(t):""));return t.map((e=>{switch(e.type){case"Placeholder":return"TextValue"===e.predicate.type?o(e):n(e);case"CustomState":return r(e);default:return e}}))}const Ta=i.all(i.equals(!0));function Oa(e){const n=sn(),a=cn(),o=t.useRef(new Map),r=Pt(),s=Tt(ga,Ea(a,r)),l=nn();return t.useMemo((()=>i.mapObjIndexed((e=>{const t=wa(l,e);return Ta(ba(o,t,s,n))}),e)),[o,e,s,n,l])}function Aa(e){e&&(e.style.display="")}function ja(e){e&&(e.style.display="none")}function Ra(e){return e.settings.duration}const Na=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],ka=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function La(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const a=t?Na:ka,i=e.animate(a,{duration:n,iterations:1});return i.onfinish=()=>{t?Aa(e):ja(e)},i.oncancel=()=>{t?Aa(e):ja(e)},()=>{i.finish()}}return t?Aa(e):ja(e),()=>{}}function Da({inTransitions:e,outTransitions:n,visible:a,children:i,containerClassName:o}){const r=t.useRef(null);return t.useEffect((()=>a&&e?e.forEach((e=>{r.current&&function(e,t,n,a){if("FadeIn"===a)La(e,t,n)}(r.current,a,Ra(e),e.type)})):!a&&n?n.forEach((e=>{r.current&&function(e,t,n,a){if("FadeOut"===a)La(e,t,n)}(r.current,a,Ra(e),e.type)})):()=>{}),[a]),t.createElement("div",{ref:r,style:{display:"none"},className:o},i)}function _a(e){const n=jt(),a=function(e){const n=sn(),a=cn(),i=t.useRef(new Map),o=Pt(),r=Tt(ga,Ea(a,o)),s=wa(nn(),e);return t.useMemo((()=>Ta(ba(i,s,r,n))),[i,s,r,n])}(e.schema.predicates),i=t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,e.testId?`${e.testId}-child${a}`:void 0))));return e.schema.transition?t.createElement(Da,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:a},i):"functionally"===e.schema.hide?t.createElement(_n.Provider,{value:a?"ENABLED":"DISABLED"},i):a?t.createElement(t.Fragment,null,i):null}const Pa=i.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),$a=e=>{var n;const a=t.useContext(an),o=cn(),r=kt()||document.head,s=Jn(),l=gt(s,o,r),c=t.useCallback(It,[]),d=Tt([],(e=>Object.values(e.breakpoint.breakpoints))),u=a||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=aa(e);return i.mapObjIndexed((e=>ia(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,y=Oa(f?i.mapObjIndexed(i.propOr([],"predicates"),f):{}),m=i.mapObjIndexed(((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}(f,t):void 0),y),h=f?i.mapObjIndexed(i.prop("transitionBaseClassname"),f):{},v=e.styles?(g=h,Pa(Pa(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:u})};function Fa(e){const n=jt();return t.createElement($a,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.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},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,z(a,e.testId))))))}))}function Ga(e){const n=jt();return t.createElement($a,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.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},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,z(a,e.testId))))))}))}const Ma={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",fe,ye],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Ba=new Map([["&","_;^;_"]]),Ua=new RegExp(`<a *(?=${Ma.allowedAttributes.a.join("|")}|>)`,"g"),Va=new RegExp('<a [^>]*href="([^"]+)"',"g"),za=new RegExp("(<br *?>)|(<br *?/>)","g"),qa="<br/>";function Ha(e){const n=nn(),a=Pn(),i=t.useMemo((()=>{const t=n(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Va,((e,t)=>{const n=t.replaceAll("&",Ba.get("&"));return e.replace(t,n)})).replaceAll(za,qa)}(e);return t===u(t,Ma)}(t))throw new L("FAILED_SANITISING_HTML","Invalid HTML tags");return t.trim()?t:""}),[e.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=g(a);return i?t.createElement($a,{styles:e.schema.styles},(({classnames:n})=>{const a=[(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=i,new RegExp("</(p|ul|ol)>").test(l)?t.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ua,`<a ${a.join(" ")}`)}}):t.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ua,`<a ${a.join(" ")}`)}});var l})):null}function Wa(e){const n=nn()(e.schema.value),a=Pn(),{tabIndex:i,styles:o,isDisabled:r}=g(a);return n?t.createElement($a,{styles:e.schema.styles},(({classnames:a})=>{const s={tabIndex:i,"aria-hidden":r,className:null==a?void 0:a.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?t.createElement("span",Object.assign({style:o},s),n):t.createElement("p",Object.assign({style:o},s),n)})):null}function Ka(e,n,a){if("BasicText"===e.type)return t.createElement(Wa,{schema:e.node,testId:n,isInline:null!=a&&a})}function Ya(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,z(t,a)))))}function Ja(e){const n=Ct(),a=jt(),i=_t(),o=nn(),r=cn(),s=Pn(),l=i.creative.responseOptionsMap[e.schema.responseKey],c=w(l);t.useEffect((()=>{c&&n(function(e){if(e.paymentTriggerConfig)return{type:ie,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(l))}),[l,n,c]);const d=l?o({data:l},"creativeResponse"):o,{tabIndex:u,styles:p,isDisabled:f}=g(s);return x(l)&&!c&&void 0!==r?t.createElement($a,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>t.createElement("button",{type:"button",tabIndex:u,"aria-disabled":f,"aria-label":e.schema.a11yLabel?d(e.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},p),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:t=>{t.preventDefault();const a=function(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(E(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,urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,l,e.schema.openLinks);n({type:H,payload:a})},className:null==o?void 0:o.own,disabled:f},t.createElement(tn,{value:d},(null==o?void 0:o.own)?function(e,n,a,i,o){return t.createElement(on,{value:a(n)},Ya(e,i,o))}(e.schema.children,o.own,r,a,e.testId):Ya(e.schema.children,a,e.testId))))):null}function Za(e){const n=Pn(),{styles:a,isDisabled:i}=g(n);return e.schema.url.light?t.createElement($a,{styles:v(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function Qa(e){const n=Pn(),{styles:a,isDisabled:i}=g(n),o=Un(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?t.createElement($a,{styles:v(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const Xa={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function ei(e){const n=e.schema.name,a=e.schema.description,i=e.schema.styles?U(Xa,e.schema.styles):Xa,o=Pn(),{styles:r,isDisabled:s}=g(o);return n?t.createElement($a,{styles:i},(({classnames:i})=>t.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-${n}`},!s&&a?{title:a}:{"aria-hidden":"true"}),n))):null}const ti={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class ni extends t.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"===Ie.REPORT_RENDER_ERRORS&&this.props.reporter({level:N,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"===Ie.DISPLAY_ERRORS?t.createElement("pre",{style:ti},t.createElement("strong",null,"Error:")," [",t.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}ni.contextType=zn;const ai={internally:"_top",externally:"_blank"};function ii(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,a?`${a}-child${t}`:void 0))))}function oi(e){var n;const a=ai[e.schema.open],i=jt(),o=Pn(),{tabIndex:r,styles:s,isDisabled:l}=g(o);return(null===(n=e.schema.children)||void 0===n?void 0:n.length)>0?t.createElement($a,{styles:e.schema.styles},(({classnames:n,mapperRef:o})=>{var c;return t.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=a?a:"_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==n?void 0:n.own},(null==n?void 0:n.own)?function(e,n,a,i,o){return t.createElement(on,{value:a(n)},ii(e,i,o))}(e.schema.children,null==n?void 0:n.own,o,i,e.testId):ii(e.schema.children,i,e.testId))})):null}function ri(e,n,a){if("StaticLink"===e.type)return t.createElement(oi,{schema:e.node,testId:n,isInline:null!=a&&a})}const si={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function li(e){const n=(a=e.schema.iconKey,t.useContext(Mn)(a,"icons"));var a;const i=null==n?void 0:n.name,o=e.schema.styles?U(si,e.schema.styles):si,r=Pn(),{styles:s}=g(r);return i?t.createElement($a,{styles:o},(({classnames:n})=>t.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==n?void 0:n.own)?" "+n.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const ci=o.css`
2
2
  display: flex;
3
3
  position: relative;
4
4
  overflow: hidden;