@sunrise-upc/sales-static-components 3.8.7-beta.2 → 3.8.7-beta.4
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/cjs/components/Constants.js +1 -1
- package/dist/cjs/components/Constants.js.map +1 -1
- package/dist/cjs/components/GlobalPromoRibbon/GlobalPromoRibbon.css +66 -79
- package/dist/cjs/components/GlobalPromoRibbon/GlobalPromoRibbon.js +1 -1
- package/dist/cjs/components/GlobalPromoRibbon/GlobalPromoRibbon.js.map +1 -1
- package/dist/cjs/components/GlobalPromoRibbon/GlobalPromoRibbon.module.scss.css +218 -0
- package/dist/cjs/components/GlobalPromoRibbon/GlobalPromoRibbon.module.scss.js +3 -0
- package/dist/cjs/components/GlobalPromoRibbon/GlobalPromoRibbon.module.scss.js.map +1 -0
- package/dist/cjs/components/RibbonRenderer/RibbonRenderer.js +1 -1
- package/dist/cjs/components/RibbonRenderer/RibbonRenderer.js.map +1 -1
- package/dist/cjs/components/StageTeaserV3/StageTeaserV3.js +1 -1
- package/dist/cjs/components/StageTeaserV3/StageTeaserV3.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/services/customerSegmentSync.js +2 -0
- package/dist/cjs/services/customerSegmentSync.js.map +1 -0
- package/dist/esm/components/Constants.js +1 -1
- package/dist/esm/components/Constants.js.map +1 -1
- package/dist/esm/components/GlobalPromoRibbon/GlobalPromoRibbon.css +66 -79
- package/dist/esm/components/GlobalPromoRibbon/GlobalPromoRibbon.js +1 -1
- package/dist/esm/components/GlobalPromoRibbon/GlobalPromoRibbon.js.map +1 -1
- package/dist/esm/components/GlobalPromoRibbon/GlobalPromoRibbon.module.scss.css +218 -0
- package/dist/esm/components/GlobalPromoRibbon/GlobalPromoRibbon.module.scss.js +3 -0
- package/dist/esm/components/GlobalPromoRibbon/GlobalPromoRibbon.module.scss.js.map +1 -0
- package/dist/esm/components/RibbonRenderer/RibbonRenderer.js +1 -1
- package/dist/esm/components/RibbonRenderer/RibbonRenderer.js.map +1 -1
- package/dist/esm/components/StageTeaserV3/StageTeaserV3.js +1 -1
- package/dist/esm/components/StageTeaserV3/StageTeaserV3.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/services/customerSegmentSync.js +2 -0
- package/dist/esm/services/customerSegmentSync.js.map +1 -0
- package/dist/index.d.ts +44 -2
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../RibbonComponent/utils.js"),r=require("../Constants.js");const i=e=>e.trim().toLowerCase(),o=e=>e?Array.isArray(e)?e:[e]:[],
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../RibbonComponent/utils.js"),r=require("../Constants.js");const i=e=>e.trim().toLowerCase(),o=()=>{if("undefined"==typeof window)return new Set;const e=window.localStorage.getItem("tealium_va");if(!e)return new Set;try{const t=JSON.parse(e),n=null==t?void 0:t.audiences;return n&&"object"==typeof n?new Set(Object.keys(n).filter(Boolean).map(e=>String(e).trim().toLowerCase())):new Set}catch(e){return new Set}},s=e=>e?Array.isArray(e)?e:[e]:[],u=e=>e?n.calculateDateTime(new Date(e.trim().replace(/-/g,"/"))):null,a=()=>{if("undefined"==typeof window)return{};const e=window.localStorage.getItem(r.DISMISSED_RIBBONS_STORAGE_KEY);if(!e)return{};try{const t=JSON.parse(e);return t&&"object"==typeof t?Object.entries(t).reduce((e,[t,n])=>("string"==typeof t&&Number.isFinite(n)&&(e[t]=Number(n)),e),{}):{}}catch(e){return{}}},c=(e,t)=>{const n=Object.entries(e).filter(([,e])=>Number.isFinite(e)&&Number(e)>t),i=Object.fromEntries(n);return"undefined"!=typeof window&&(0===n.length?window.localStorage.removeItem(r.DISMISSED_RIBBONS_STORAGE_KEY):n.length!==Object.keys(e).length&&window.localStorage.setItem(r.DISMISSED_RIBBONS_STORAGE_KEY,JSON.stringify(i))),i};exports.default=({ribbonConfig:n,metadata:l,channel:d,renderRibbon:m})=>{const[f,S]=t.useState(null),[w,E]=t.useState(new Set),[b,g]=t.useState(!1),[_,p]=t.useState(new Date),[T,O]=t.useState(0);t.useEffect(()=>{if("undefined"==typeof window)return;const e=window.localStorage.getItem(r.CUSTOMER_GROUP_STORAGE_KEY);S(e),E(o()),g(!0)},[]),t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{O(e=>e+1),p(new Date)};return window.addEventListener(r.RIBBON_DISMISS_UPDATED_EVENT,e),()=>{window.removeEventListener(r.RIBBON_DISMISS_UPDATED_EVENT,e)}},[]),t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{S(window.localStorage.getItem(r.CUSTOMER_GROUP_STORAGE_KEY)),E(o()),p(new Date)};return window.addEventListener(r.CUSTOMER_SEGMENT_REFRESH_EVENT,e),()=>{window.removeEventListener(r.CUSTOMER_SEGMENT_REFRESH_EVENT,e)}},[]);const h=n||(null==l?void 0:l.ribbonConfig),v=d||process.env.NEXT_PUBLIC_CHANNEL||"";if(t.useEffect(()=>{var e;if(!(null===(e=null==h?void 0:h.ribbons)||void 0===e?void 0:e.length))return;const t=_.getTime(),n=c(a(),t),r=h.ribbons.flatMap(e=>{const n=[],r=u(e.scheduleStartTime),i=u(e.scheduleEndTime);if(r){const e=r.getTime();e>t&&n.push(e)}if(i){const e=i.getTime();e>t&&n.push(e)}return n}).concat(Object.values(n).filter(e=>e>t)).sort((e,t)=>e-t)[0];if(!r)return;const i=r-t,o=window.setTimeout(()=>{p(new Date)},Math.max(i,0));return()=>{window.clearTimeout(o)}},[null==h?void 0:h.ribbons,_,T]),!b)return null;if(!(null==h?void 0:h.ribbons)||!Array.isArray(h.ribbons)||0===h.ribbons.length)return null;const y=c(a(),_.getTime()),N=h.ribbons.filter(e=>{if(!e.component)return!1;if(e._uid&&y[e._uid]&&y[e._uid]>_.getTime())return!1;if(!((e,t)=>{const n=u(e.scheduleStartTime),r=u(e.scheduleEndTime),i=!n||t.getTime()>=n.getTime(),o=!r||r.getTime()>t.getTime();return i&&o})(e,_))return!1;if((null==e?void 0:e.microsites)&&!((e,t)=>{if(!Array.isArray(e.microsites)||0===e.microsites.length)return!1;const n=i(t);return e.microsites.some(e=>"string"==typeof e&&i(e)===n)})(e,v))return!1;if("globalPromoRibbon"!==e.component)return!0;return s(e.tealiumAudiences).length>0?((e,t)=>{const n=s(e).map(e=>String(e).trim().toLowerCase());return!n.length||!!t.size&&n.some(e=>t.has(e))})(e.tealiumAudiences,w):((e,t)=>{const n=s(e).map(e=>String(e).trim().toLowerCase());return!n.length||!!n.includes("all")||!!t&&n.includes(t.toLowerCase())})(e.customerType,f)}),R=N.find(e=>"heroLogin"===e.component),I=N.find(e=>"heroLogin"!==e.component),D=[];return I&&D.push(I),R&&D.push(R),0===D.length?null:e.jsx("div",{className:"ribbons-wrapper",children:D.map((t,n)=>e.jsx("div",{className:"ribbon-item",children:m(Object.assign(Object.assign({},t),{_uid:t._uid||`ribbon-${n}`,component:t.component}),n)},t._uid||n))})};
|
|
2
2
|
//# sourceMappingURL=RibbonRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RibbonRenderer.js","sources":["../../../../../src/components/RibbonRenderer/RibbonRenderer.tsx"],"sourcesContent":[null],"names":["normalizeMicrositeValue","value","trim","toLowerCase","
|
|
1
|
+
{"version":3,"file":"RibbonRenderer.js","sources":["../../../../../src/components/RibbonRenderer/RibbonRenderer.tsx"],"sourcesContent":[null],"names":["normalizeMicrositeValue","value","trim","toLowerCase","getTealiumAudienceKeys","window","Set","rawValue","localStorage","getItem","parsed","JSON","parse","audiences","Object","keys","filter","Boolean","map","audience","String","_a","normalizeStringArray","Array","isArray","getScheduleDateTime","calculateDateTime","Date","replace","getDismissedRibbonsMap","DISMISSED_RIBBONS_STORAGE_KEY","entries","reduce","acc","uid","expiresAt","Number","isFinite","pruneExpiredDismissedRibbons","dismissedRibbonsMap","nowMs","activeEntries","cleanedMap","fromEntries","length","removeItem","setItem","stringify","ribbonConfig","metadata","channel","renderRibbon","userCustomerGroup","setUserCustomerGroup","useState","tealiumAudiences","setTealiumAudiences","isHydrated","setIsHydrated","currentTime","setCurrentTime","dismissedRibbonVersion","setDismissedRibbonVersion","useEffect","customerGroup","CUSTOMER_GROUP_STORAGE_KEY","onDismissedRibbonUpdated","previousVersion","addEventListener","RIBBON_DISMISS_UPDATED_EVENT","removeEventListener","onCustomerSegmentRefresh","CUSTOMER_SEGMENT_REFRESH_EVENT","resolvedRibbonConfig","currentChannel","process","env","NEXT_PUBLIC_CHANNEL","ribbons","presentTimeMs","getTime","nextRecalculationTimeMs","flatMap","ribbon","times","startTime","scheduleStartTime","endTime","scheduleEndTime","startTimeMs","push","endTimeMs","concat","values","timeMs","sort","a","b","delay","timer","setTimeout","Math","max","clearTimeout","eligibleRibbons","component","_uid","hasStarted","notExpired","isRibbonWithinScheduleWindow","microsites","normalizedChannel","some","microsite","isRibbonAllowedForChannel","ribbonAudiences","availableAudiences","normalizedRibbonAudiences","size","has","matchesTealiumAudiences","ribbonCustomerGroup","customerGroups","group","includes","matchesCustomerGroup","customerType","heroLoginRibbon","find","nonHeroLoginRibbon","ribbonsToRender","_jsx","className","children","index","assign"],"mappings":"gMA0CA,MAAMA,EAA2BC,GAA0BA,EAAMC,OAAOC,cAelEC,EAAyB,KAC7B,GAAsB,oBAAXC,OACT,OAAO,IAAIC,IAGb,MAAMC,EAAWF,OAAOG,aAAaC,QAAQ,cAC7C,IAAKF,EACH,OAAO,IAAID,IAGb,IACE,MAAMI,EAASC,KAAKC,MAAML,GACpBM,EAAYH,aAAM,EAANA,EAAQG,UAE1B,OAAKA,GAAkC,iBAAdA,EAIlB,IAAIP,IACTQ,OAAOC,KAAKF,GACTG,OAAOC,SACPC,IAAKC,GAAaC,OAAOD,GAAUjB,OAAOC,gBANtC,IAAIG,GAQf,CAAE,MAAAe,GACA,OAAO,IAAIf,GACb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});var e=require("../../node_modules/tslib/tslib.es6.js"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.js"),t=require("react/jsx-runtime"),l=require("react"),i=require("react-loading-skeleton");require("react-loading-skeleton/dist/skeleton.css");var n=require("./StageTeaserSwiperV3.js"),r=require("./StageTeaserV3.module.scss.js"),o=require("./DoubleGrid/DoubleGridComponent.js"),u=require("./SingleGrid/SingleGridComponent.js"),s=require("../RibbonComponent/utils.js"),d=require("../../services/CustomerService.js"),a=require("../../services/customerSegmentSync.js"),c=require("cookies-next"),v=require("../Constants.js");const m=i.default||i,f=a.createCustomerGroupFetcher({fetchCustomerProfile:d.customerGroup});exports.default=({content:i})=>{var d,S,g;const[E,h]=l.useState(null),[w,p]=l.useState(null),[T,C]=l.useState(!0),[O,_]=l.useState(!1),[R,y]=l.useState(!1),[j,x]=l.useState(!1),[M,G]=l.useState(null),[b,N]=l.useState(0),U=l.useRef(null),A=l.useRef(null),V=l.useRef(null),q=!!c.getCookie(v.AUTHCOOKIE),F=e=>e?s.calculateDateTime(new Date(e.trim().replace(/-/g,"/"))):null,I=(e,t)=>{const l=(Array.isArray(e)?e:[e]).filter(Boolean).map(e=>String(e).trim().toLowerCase());return!l.length||!!t.size&&l.some(e=>t.has(e))},W=e=>(Array.isArray(e)?e:[e]).filter(Boolean).map(e=>String(e).trim()).length>0,k=(e,t,l=!1)=>{const i=(Array.isArray(e)?e:[e]).filter(Boolean).map(e=>String(e).trim().toLowerCase()),n=i.length>0;return t?!!i.includes("all")||i.includes(t.toLowerCase()):!!l&&(!n||i.includes("all"))};l.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{N(e=>e+1)};return window.addEventListener(v.CUSTOMER_SEGMENT_REFRESH_EVENT,e),()=>{window.removeEventListener(v.CUSTOMER_SEGMENT_REFRESH_EVENT,e)}},[]),l.useEffect(()=>{let t=!0;return e.__awaiter(void 0,void 0,void 0,function*(){t&&(C(!0),_(!1),y(!1),x(!1));const e=V.current,l=null!==e&&e!==q,i=!0===e&&!q;if(V.current=q,i&&"undefined"!=typeof window&&window.localStorage.removeItem(v.CUSTOMER_GROUP_STORAGE_KEY),l&&p(null),"undefined"!=typeof window){const e=window.localStorage.getItem(v.CUSTOMER_GROUP_STORAGE_KEY);if(e&&!l&&q&&"NEW_CUSTOMER"!==e)return p(e),y(!1),void _(!0)}if(!q)return p("NEW_CUSTOMER"),"undefined"!=typeof window&&window.localStorage.setItem(v.CUSTOMER_GROUP_STORAGE_KEY,"NEW_CUSTOMER"),y(!1),void _(!0);try{const e=yield a.resolveCustomerGroup({fetchCustomerGroup:f,isLoggedIn:()=>q,storageKey:v.CUSTOMER_GROUP_STORAGE_KEY,newCustomerValue:"NEW_CUSTOMER"});t&&(p(e),y(!1),"undefined"!=typeof window&&e&&window.localStorage.setItem(v.CUSTOMER_GROUP_STORAGE_KEY,e),_(!0))}catch(e){t&&(p(null),y(!0),_(!0))}}),()=>{t=!1}},[q,b]),l.useEffect(()=>{const e=()=>{U.current&&(clearTimeout(U.current),U.current=null)};if(!O)return void x(!1);const t=R&&!w;if(!w&&!t)return void(O&&(h(null),x(!0),C(!1)));x(!1);const l=(null==i?void 0:i.teaserSlides)||[],n=(()=>{if("undefined"==typeof window)return new Set;const e=window.localStorage.getItem("tealium_va");if(!e)return new Set;try{const t=JSON.parse(e),l=null==t?void 0:t.audiences;return l&&"object"==typeof l?new Set(Object.keys(l).filter(Boolean).map(e=>String(e).trim().toLowerCase())):new Set}catch(e){return new Set}})(),r={FIXNET:null==i?void 0:i.fixnetOrder,MOBILE:null==i?void 0:i.mobileOrder,FIXNET_MOBILE:null==i?void 0:i.mobileFixnetOrder,DEFAULT:null==i?void 0:i.defaultOrder},o=w?r[w]:null;if(o){const e=o.split(",").map(e=>e.trim()).filter(e=>e.length>0),t=new Map(e.map((e,t)=>[e,t])),i=new Map(l.map((e,t)=>[e,t]));l.sort((e,l)=>{var n,r,o,u,s,d;const a=String(null!==(n=null==e?void 0:e.id)&&void 0!==n?n:"").trim(),c=String(null!==(r=null==l?void 0:l.id)&&void 0!==r?r:"").trim(),v=null!==(o=i.get(e))&&void 0!==o?o:0,m=null!==(u=i.get(l))&&void 0!==u?u:0,f=null!==(s=t.get(a))&&void 0!==s?s:t.get(String(v)),S=null!==(d=t.get(c))&&void 0!==d?d:t.get(String(m));return null==f&&null==S?v-m:null==f?1:null==S?-1:Number(f)-Number(S)})}const u=l.filter(e=>!0===(null==e?void 0:e.active)&&(W(null==e?void 0:e.tealiumAudiences)?I(null==e?void 0:e.tealiumAudiences,n):k(null==e?void 0:e.customerType,w,t))),s=()=>{const e=new Date,t=[];u.forEach(l=>{((e,t)=>{const l=F(null==e?void 0:e.scheduleStartTime),i=F(null==e?void 0:e.scheduleEndTime),n=!l||t.getTime()>=l.getTime(),r=!i||i.getTime()>t.getTime();return n&&r})(l,e)&&(t.includes(l)||t.push(l))}),h(t.length>0?t:null),x(!0),C(!1)},d=()=>{e();const l=((null==i?void 0:i.teaserSlides)||[]).filter(e=>!0===(null==e?void 0:e.active)&&(W(null==e?void 0:e.tealiumAudiences)?I(null==e?void 0:e.tealiumAudiences,n):k(null==e?void 0:e.customerType,w,t))),r=(new Date).getTime(),o=l.flatMap(e=>{const t=[],l=F(null==e?void 0:e.scheduleStartTime),i=F(null==e?void 0:e.scheduleEndTime);if(l){const e=l.getTime();e>r&&t.push(e)}if(i){const e=i.getTime();e>r&&t.push(e)}return t}).sort((e,t)=>e-t)[0];if(!o)return;const u=o-r;U.current=setTimeout(()=>{s(),d()},Math.max(u,0))};return s(),d(),()=>{e()}},[null==i?void 0:i.teaserSlides,w,O,R]),l.useEffect(()=>{if(!A.current||!(null==E?void 0:E.length))return;const e=()=>{var e;const t=null===(e=A.current)||void 0===e?void 0:e.offsetHeight;t&&t>0&&G(t)};e();const t=new ResizeObserver(e);return t.observe(A.current),()=>{t.disconnect()}},[null==E?void 0:E.length,null==i?void 0:i.isSlimVersion,null==i?void 0:i.isFullWidth]);const L=null==i?void 0:i.isFullWidth,$=null===(d=null==i?void 0:i.solidBgColor)||void 0===d?void 0:d.color,B=(e,l)=>"single"===(null==e?void 0:e.layoutgrid)?t.jsx(u.default,{content:e,isFullWidth:L,isSlimVersion:null==i?void 0:i.isSlimVersion,isFirstSlide:0===l},l):t.jsx(o.default,{content:e,isFullWidth:L,isSlimVersion:null==i?void 0:i.isSlimVersion,isFirstSlide:0===l},l),D=t.jsx("div",{ref:A,className:`${r.default.outerContainer} ${L?r.default.fullWidth:""} ${(null==i?void 0:i.isSlimVersion)&&L?r.default.slimVersion:""}`,style:{backgroundColor:$},children:(null==E?void 0:E.length)>1?t.jsx(n.default,{content:i,isFullWidth:L,children:null===(S=E||[])||void 0===S?void 0:S.map((e,t)=>B(e,t))}):t.jsx("div",{className:L?"":r.default.singleSlideCentered,children:B(null==E?void 0:E[0],0)})});if(T||!O||!j){const e=(null===(g=null==i?void 0:i.teaserSlides)||void 0===g?void 0:g.length)>1,l={backgroundColor:$,minHeight:M?`${M}px`:void 0},n={display:"block",height:M?`${Math.max(M-48,0)}px`:void 0};return t.jsx("div",{className:`${r.default.outerContainer} ${L?r.default.fullWidth:""} ${(null==i?void 0:i.isSlimVersion)&&L?r.default.slimVersion:""}`,style:l,children:t.jsxs("div",{className:L?"":r.default.singleSlideCentered,children:[t.jsx("div",{className:`${r.default.skeletonContainer} ${(null==i?void 0:i.isSlimVersion)?r.default.slimVersion:""}`,children:t.jsx(m,{height:"100%",borderRadius:L?0:32,style:n})}),e&&t.jsx("div",{style:{marginTop:"24px",height:"10px"}})]})})}return(null==E?void 0:E.length)?D:null};
|
|
3
3
|
//# sourceMappingURL=StageTeaserV3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageTeaserV3.js","sources":["../../../../../src/components/StageTeaserV3/StageTeaserV3.tsx"],"sourcesContent":[null],"names":["Skeleton","SkeletonRaw","default","content","displayArray","setdisplayArray","useState","customerGroupValue","setCustomerGroupValue","isInitialSkeletonVisible","setIsInitialSkeletonVisible","isCustomerGroupResolved","setIsCustomerGroupResolved","didCustomerGroupApiFail","setDidCustomerGroupApiFail","isDisplaySlidesFiltered","setIsDisplaySlidesFiltered","measuredTeaserHeight","setMeasuredTeaserHeight","recalculateTimerRef","useRef","teaserContainerRef","previousExistingCustomerRef","existingCustomer","getCookie","AUTHCOOKIE","getScheduleDateTime","value","calculateDateTime","Date","trim","replace","matchesTealiumAudiences","slideAudiences","availableAudiences","normalizedSlideAudiences","Array","isArray","filter","Boolean","map","audience","String","toLowerCase","length","size","some","has","hasTealiumAudiencesConfigured","matchesCustomerType","customerType","customerGroup","allowAllOrUnsetAudienceFallback","normalizedTypes","type","hasAudienceConfigured","includes","useEffect","isMounted","__awaiter","hasExistingCustomerChanged","current","window","localStorage","removeItem","CUSTOMER_GROUP_STORAGE_KEY","cachedGroup","getItem","setItem","group","resolvedGroup","error","clearRecalculateTimer","clearTimeout","shouldUseAllAudienceFallback","teaserSlides","availableTealiumAudiences","Set","rawValue","parsed","JSON","parse","audiences","Object","keys","getTealiumAudienceKeys","orderConfig","FIXNET","fixnetOrder","MOBILE","mobileOrder","FIXNET_MOBILE","mobileFixnetOrder","DEFAULT","defaultOrder","selectedOrder","orderKeys","split","orderMap","Map","index","originalIndexMap","slide","sort","a","b","aIdKey","_a","id","bIdKey","_b","aOriginalIndex","_c","get","bOriginalIndex","_d","aIndex","_e","bIndex","_f","Number","activeSlides","slider","active","tealiumAudiences","recalculateDisplayArray","presentTime","toDisplay","forEach","currentTime","startTime","scheduleStartTime","endTime","scheduleEndTime","hasStarted","getTime","notExpired","isSlideWithinScheduleWindow","push","scheduleNextStartRecalculation","presentTimeMs","nextRecalculationTimeMs","flatMap","times","startTimeMs","endTimeMs","delay","setTimeout","Math","max","updateHeight","nextHeight","offsetHeight","observer","ResizeObserver","observe","disconnect","isSlimVersion","isFullWidth","solidBackGroundColor","solidBgColor","color","renderTeaserCard","card","key","layoutgrid","_jsx","SingleGridComponent","isFirstSlide","DoubleGridComponent","stageTeaserJsx","ref","className","Styles","outerContainer","fullWidth","slimVersion","style","backgroundColor","children","StageTeaserSwiperV3","singleSlideCentered","showDots","loadingContainerStyle","minHeight","undefined","loadingSkeletonStyle","display","height","_jsxs","skeletonContainer","borderRadius","marginTop"],"mappings":"4kBAIA,MAAMA,EAAYC,EAAoBC,SAAWD,kBAahB,EAAGE,wBAClC,MAAOC,EAAcC,GAAmBC,EAAAA,SAAc,OAC/CC,EAAoBC,GAAyBF,EAAAA,SAAc,OAC3DG,EAA0BC,GAA+BJ,EAAAA,UAAkB,IAC3EK,EAAyBC,GAA8BN,EAAAA,UAAkB,IACzEO,EAAyBC,GAA8BR,EAAAA,UAAkB,IACzES,EAAyBC,GAA8BV,EAAAA,UAAkB,IACzEW,EAAsBC,GAA2BZ,EAAAA,SAAwB,MAC1Ea,EAAsBC,EAAAA,OAA6C,MACnEC,EAAqBD,EAAAA,OAA8B,MACnDE,EAA8BF,EAAAA,OAAuB,MAErDG,IADiBC,EAAAA,UAAUC,cAG3BC,EAAuBC,GACtBA,EAIEC,EAAAA,kBAAkB,IAAIC,KAAKF,EAAMG,OAAOC,QAAQ,KAAM,OAHpD,KAkCLC,EAA0B,CAACC,EAAqBC,KACpD,MAAMC,GAA4BC,MAAMC,QAAQJ,GAAkBA,EAAiB,CAACA,IACjFK,OAAOC,SACPC,IAAKC,GAAkBC,OAAOD,GAAUX,OAAOa,eAElD,OAAKR,EAAyBS,UAIzBV,EAAmBW,MAIjBV,EAAyBW,KAAML,GAAaP,EAAmBa,IAAIN,KAGtEO,EAAiCf,IACHG,MAAMC,QAAQJ,GAAkBA,EAAiB,CAACA,IACjFK,OAAOC,SACPC,IAAKC,GAAkBC,OAAOD,GAAUX,QAEXc,OAAS,EAGrCK,EAAsB,CAC1BC,EACAC,EACAC,GAA2C,KAE3C,MACMC,GADgBjB,MAAMC,QAAQa,GAAgBA,EAAe,CAACA,IAEjEZ,OAAOC,SACPC,IAAKc,GAAcZ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AAWvK,EAAuB,GAAGA,WAA2BwK,GAE5DC,EAA4C,CAChDC,QAAS,QACTC,OAAQ3K,EAAuB,GAAGmI,KAAKC,IAAIpI,EAAuB,GAAI,YAASwK,GAGjF,OACEnB,EAAAA,IAAA,MAAA,CACEM,UAAW,GAAGC,UAAOC,kBACnBhB,EAAce,EAAAA,QAAOE,UAAY,OAC/B5K,aAAO,EAAPA,EAAS0J,gBAAiBC,EAAce,EAAAA,QAAOG,YAAc,KACjEC,MAAOM,EAAqBJ,SAE5BU,EAAAA,YAAKjB,UAAYd,EAA2C,GAA7Be,EAAAA,QAAOQ,oBAAwBF,SAAA,CAC5Db,EAAAA,IAAA,MAAA,CAAKM,UAAW,GAAGC,UAAOiB,sBAAqB3L,aAAO,EAAPA,EAAS0J,eAAgBgB,UAAOG,YAAc,KAAIG,SAC/Fb,MAACtK,EAAQ,CACP4L,OAAO,OACPG,aAAcjC,EAAc,EAAI,GAChCmB,MAAOS,MAGVJ,GACChB,MAAA,MAAA,CAAKW,MAAO,CAAEe,UAAW,OAAQJ,OAAQ,cAKnD,CAEA,OAAIxL,aAAY,EAAZA,EAAcwC,QACT8H,EAGF"}
|
|
1
|
+
{"version":3,"file":"StageTeaserV3.js","sources":["../../../../../src/components/StageTeaserV3/StageTeaserV3.tsx"],"sourcesContent":[null],"names":["Skeleton","SkeletonRaw","default","fetchCustomerGroup","createCustomerGroupFetcher","fetchCustomerProfile","customerGroup","content","displayArray","setdisplayArray","useState","customerGroupValue","setCustomerGroupValue","isInitialSkeletonVisible","setIsInitialSkeletonVisible","isCustomerGroupResolved","setIsCustomerGroupResolved","didCustomerGroupApiFail","setDidCustomerGroupApiFail","isDisplaySlidesFiltered","setIsDisplaySlidesFiltered","measuredTeaserHeight","setMeasuredTeaserHeight","customerSegmentRefreshVersion","setCustomerSegmentRefreshVersion","recalculateTimerRef","useRef","teaserContainerRef","previousExistingCustomerRef","existingCustomer","getCookie","AUTHCOOKIE","getScheduleDateTime","value","calculateDateTime","Date","trim","replace","matchesTealiumAudiences","slideAudiences","availableAudiences","normalizedSlideAudiences","Array","isArray","filter","Boolean","map","audience","String","toLowerCase","length","size","some","has","hasTealiumAudiencesConfigured","matchesCustomerType","customerType","allowAllOrUnsetAudienceFallback","normalizedTypes","type","hasAudienceConfigured","includes","useEffect","window","onCustomerSegmentRefresh","previousValue","addEventListener","CUSTOMER_SEGMENT_REFRESH_EVENT","removeEventListener","isMounted","__awaiter","previousExistingCustomer","current","hasExistingCustomerChanged","didCustomerLogout","localStorage","removeItem","CUSTOMER_GROUP_STORAGE_KEY","cachedGroup","getItem","setItem","resolvedGroup","resolveCustomerGroup","isLoggedIn","storageKey","newCustomerValue","error","clearRecalculateTimer","clearTimeout","shouldUseAllAudienceFallback","teaserSlides","availableTealiumAudiences","Set","rawValue","parsed","JSON","parse","audiences","Object","keys","getTealiumAudienceKeys","orderConfig","FIXNET","fixnetOrder","MOBILE","mobileOrder","FIXNET_MOBILE","mobileFixnetOrder","DEFAULT","defaultOrder","selectedOrder","orderKeys","split","orderMap","Map","index","originalIndexMap","slide","sort","a","b","aIdKey","_a","id","bIdKey","_b","aOriginalIndex","_c","get","bOriginalIndex","_d","aIndex","_e","bIndex","_f","Number","activeSlides","slider","active","tealiumAudiences","recalculateDisplayArray","presentTime","toDisplay","forEach","currentTime","startTime","scheduleStartTime","endTime","scheduleEndTime","hasStarted","getTime","notExpired","isSlideWithinScheduleWindow","push","scheduleNextStartRecalculation","presentTimeMs","nextRecalculationTimeMs","flatMap","times","startTimeMs","endTimeMs","delay","setTimeout","Math","max","updateHeight","nextHeight","offsetHeight","observer","ResizeObserver","observe","disconnect","isSlimVersion","isFullWidth","solidBackGroundColor","solidBgColor","color","renderTeaserCard","card","key","layoutgrid","_jsx","SingleGridComponent","isFirstSlide","DoubleGridComponent","stageTeaserJsx","ref","className","Styles","outerContainer","fullWidth","slimVersion","style","backgroundColor","children","StageTeaserSwiperV3","singleSlideCentered","showDots","loadingContainerStyle","minHeight","undefined","loadingSk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BF,SAC3DjB,EAAiBzK,aAAY,EAAZA,EAAe,GAAI,OAW7C,GAJEK,IACCE,IACAI,EAEqB,CACtB,MAAMkL,GAAgC,QAArBtE,EAAAxH,aAAO,EAAPA,EAASmF,oBAAY,IAAAqC,OAAA,EAAAA,EAAE7E,QAAS,EAC3CoJ,EAA6C,CACjDL,gBAAiBnB,EACjByB,UAAWlL,EAAuB,GAAGA,WAA2BmL,GAE5DC,EAA4C,CAChDC,QAAS,QACTC,OAAQtL,EAAuB,GAAG8I,KAAKC,IAAI/I,EAAuB,GAAI,YAASmL,GAGjF,OACEnB,EAAAA,IAAA,MAAA,CACEM,UAAW,GAAGC,UAAOC,kBACnBhB,EAAce,EAAAA,QAAOE,UAAY,OAC/BvL,aAAO,EAAPA,EAASqK,gBAAiBC,EAAce,EAAAA,QAAOG,YAAc,KACjEC,MAAOM,EAAqBJ,SAE5BU,EAAAA,YAAKjB,UAAYd,EAA2C,GAA7Be,EAAAA,QAAOQ,oBAAwBF,SAAA,CAC5Db,EAAAA,IAAA,MAAA,CAAKM,UAAW,GAAGC,UAAOiB,sBAAqBtM,aAAO,EAAPA,EAASqK,eAAgBgB,UAAOG,YAAc,KAAIG,SAC/Fb,MAACrL,EAAQ,CACP2M,OAAO,OACPG,aAAcjC,EAAc,EAAI,GAChCmB,MAAOS,MAGVJ,GACChB,MAAA,MAAA,CAAKW,MAAO,CAAEe,UAAW,OAAQJ,OAAQ,cAKnD,CAEA,OAAInM,aAAY,EAAZA,EAAc0C,QACTuI,EAGF"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./components/RibbonComponent/RibbonComponent.js"),o=require("./components/RibbonRenderer/RibbonRenderer.js"),r=require("./components/GlobalPromoRibbon/GlobalPromoRibbon.js"),t=require("./components/FalconButtonV3/FalconButtonV3.js"),n=require("./components/StageTeaserComponent/StageTeaserComponent.js"),s=require("./components/ImageComponent/ImageComponent.js"),a=require("./components/TextComponent/TextComponent.js"),
|
|
1
|
+
"use strict";var e=require("./components/RibbonComponent/RibbonComponent.js"),o=require("./components/RibbonRenderer/RibbonRenderer.js"),r=require("./components/GlobalPromoRibbon/GlobalPromoRibbon.js"),t=require("./components/FalconButtonV3/FalconButtonV3.js"),n=require("./components/StageTeaserComponent/StageTeaserComponent.js"),s=require("./components/ImageComponent/ImageComponent.js"),a=require("./components/TextComponent/TextComponent.js"),p=require("./components/ButtonGroup/ButtonGroup.js"),i=require("./components/ImageWithText/ImageWithText.js"),u=require("./components/ImageWithTextWrapper/ImageWithTextWrapper.js"),m=require("./components/InternetAndTvCardsBenefits/InternetAndTvCardsBenefits.js"),c=require("./components/linecheck/LineCheckV2.js"),C=require("./components/StageTeaserV3/StageTeaserV3.js"),l=require("./components/StageTeaserV3/PromoBubble/PromoBubble.js"),x=require("./components/FalconMainNavigation/FalconMainNavigation.js"),d=require("./components/SearchWrapper/SearchWrapper.js"),f=require("./components/MinimizedHeader/MinimizedHeader.js"),g=require("./services/LinecheckBasicPropConfig.js"),b=require("./services/CustomerPropConfig.js"),j=require("./services/CartPropConfig.js"),q=require("./services/customerSegmentSync.js"),T=require("./services/CustomerService.js");exports.RibbonComponent=e.default,exports.RibbonRenderer=o.default,exports.GlobalPromoRibbon=r.default,exports.FalconButtonV3=t.default,exports.StageTeaserComponent=n.default,exports.ImageComponent=s.default,exports.TextComponent=a.default,exports.ButtonGroup=p.default,exports.ImageWithText=i.default,exports.ImageWithTextWrapper=u.default,exports.InternetAndTvCardsBenefits=m.default,exports.LineCheckV2=c.default,exports.StageTeaserV3=C.default,exports.PromoBubble=l.default,exports.FalconMainNavigation=x.default,exports.SearchWrapper=d.default,exports.MinimizedHeader=f.default,exports.LinecheckBasicPropConfig=g.LinecheckBasicPropConfig,exports.CustomerPropConfig=b.CustomerPropConfig,exports.CartPropConfig=j.CartPropConfig,exports.createCustomerGroupFetcher=q.createCustomerGroupFetcher,exports.createCustomerSegmentSync=q.createCustomerSegmentSync,exports.extractCustomerGroupFromProfile=q.extractCustomerGroupFromProfile,exports.resolveCustomerGroup=q.resolveCustomerGroup,exports.customerGroup=T.customerGroup;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("../node_modules/tslib/tslib.es6.js"),t=require("../components/Constants.js");const r=e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null},o=e=>{var t,o;const n=r(null==e?void 0:e.customerGroup);if(n)return n;const i=r(null===(o=null===(t=null==e?void 0:e.relatedParty)||void 0===t?void 0:t[0])||void 0===o?void 0:o.segment);return i||null},n=new Map,i=e=>"undefined"==typeof window?null:r(window.localStorage.getItem(e)),u=(e,t)=>{"undefined"!=typeof window&&(t?window.localStorage.setItem(e,t):window.localStorage.removeItem(e))},s=o=>e.__awaiter(void 0,void 0,void 0,function*(){const s=o.storageKey||t.CUSTOMER_GROUP_STORAGE_KEY,d=o.newCustomerValue||"NEW_CUSTOMER";if("undefined"==typeof window)return null;if(!o.isLoggedIn())return u(s,d),d;if(!o.forceRefresh){const e=i(s);if(e&&e!==d)return e}const l=n.get(s);if(l)return l;const f=e.__awaiter(void 0,void 0,void 0,function*(){try{const e=r(yield o.fetchCustomerGroup());return u(s,e),e}catch(e){return o.onError&&o.onError(e),i(s)}finally{n.delete(s)}});return n.set(s,f),f});exports.createCustomerGroupFetcher=t=>()=>e.__awaiter(void 0,void 0,void 0,function*(){const e=yield t.fetchCustomerProfile();return o(e||{})}),exports.createCustomerSegmentSync=r=>{var o;const n=r.storageKey||t.CUSTOMER_GROUP_STORAGE_KEY,u=r.refreshEventName||t.CUSTOMER_SEGMENT_REFRESH_EVENT,d=null!==(o=r.minSyncIntervalMs)&&void 0!==o?o:8e3,l=r.newCustomerValue||"NEW_CUSTOMER";let f=null,a=0;const c=e=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(u,{detail:{customerGroup:e,refreshedAt:Date.now()}}))};return{refreshCustomerSegmentAfterLogin:()=>e.__awaiter(void 0,void 0,void 0,function*(){if("undefined"==typeof window)return null;if(f)return f;if(Date.now()-a<d){const e=i(n);return c(e),e}return f=e.__awaiter(void 0,void 0,void 0,function*(){try{const e=yield s({fetchCustomerGroup:r.fetchCustomerGroup,isLoggedIn:r.isLoggedIn,storageKey:n,newCustomerValue:l,forceRefresh:!0,onError:r.onError});return a=Date.now(),c(e),e}finally{f=null}}),f}),subscribeToCustomerSegmentRefresh:e=>{if("undefined"==typeof window)return()=>{};const t=t=>{e(t)};return window.addEventListener(u,t),()=>{window.removeEventListener(u,t)}},dispatchCustomerSegmentRefreshEvent:c}},exports.extractCustomerGroupFromProfile=o,exports.resolveCustomerGroup=s;
|
|
2
|
+
//# sourceMappingURL=customerSegmentSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customerSegmentSync.js","sources":["../../../../src/services/customerSegmentSync.ts"],"sourcesContent":[null],"names":["normalizeCustomerGroup","value","normalized","trim","length","extractCustomerGroupFromProfile","profile","directCustomerGroup","customerGroup","relatedPartySegment","_b","_a","relatedParty","segment","inFlightCustomerGroupByStorageKey","Map","getCachedCustomerGroup","storageKey","window","localStorage","getItem","setCachedCustomerGroup","setItem","removeItem","resolveCustomerGroup","options","__awaiter","CUSTOMER_GROUP_STORAGE_KEY","newCustomerValue","isLoggedIn","forceRefresh","cachedCustomerGroup","inFlightCustomerGroup","get","customerGroupPromise","resolvedCustomerGroup","fetchCustomerGroup","error","onError","delete","set","customerProfile","fetchCustomerProfile","refreshEventName","CUSTOMER_SEGMENT_REFRESH_EVENT","minSyncIntervalMs","inFlightSync","lastSyncedAtMs","dispatchCustomerSegmentRefreshEvent","dispatchEvent","CustomEvent","detail","refreshedAt","Date","now","refreshCustomerSegmentAfterLogin","subscribeToCustomerSegmentRefresh","handler","eventListener","event","addEventListener","removeEventListener"],"mappings":"yGA8CA,MAAMA,EAA0BC,IAC9B,GAAqB,iBAAVA,EACT,OAAO,KAGT,MAAMC,EAA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s="right",
|
|
1
|
+
const e="center",t="left",s="right",r="transparent",o="00",c="#da291c",i="clicked",n="after",a="before",f="#ffffff",m="h1",d="h2",h="h3",l="h4",g="extra",u="semiextra",b="none",p=1439,R=1023,A=767,P="stack",U="col-lg-6",x="col-lg-4",D="col-lg-3",E="en",G="sunriseAuth",k=768,S=1024,T=1440,_="img",v="icon",y="svg",B="auth-stamp",F="PreToPost",I="customerGroup",L="dismissedRibbonsByUid",M="ribbonDismissUpdated",X="customerSegmentRefresh",j="one-commerce-cartId",q="SMART_UPGRADE",w="FLEX_UPGRADE";export{n as AFTER,G as AUTHCOOKIE,B as AUTHSTAMP,a as BEFORE,j as CART_COOKIE,e as CENTER,D as COLLG3,x as COLLG4,U as COLLG6,f as COLORWHITE,I as CUSTOMER_GROUP_STORAGE_KEY,X as CUSTOMER_SEGMENT_REFRESH_EVENT,E as DEFAULTLOCALE,L as DISMISSED_RIBBONS_STORAGE_KEY,g as EXTRA,i as FALCONBUTTONCLICKED,w as FLEX_UPGRADE,m as H1,d as H2,h as H3,l as H4,v as ICON,_ as IMG,t as LEFT,T as LGDESKSTART,p as MDDESKEND,S as MDDESKSTART,A as MOBEND,b as NONE,F as PRE_TO_POST_PROMOTION_ID,c as PRIMARYCOLORS,M as RIBBON_DISMISS_UPDATED_EVENT,s as RIGHT,u as SEMIEXTRA,q as SMART_UPGRADE,P as STACK,y as SVG,R as TABEND,k as TABSTART,r as TRANSPARENT,o as ZEROES};
|
|
2
2
|
//# sourceMappingURL=Constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sources":["../../../../src/components/Constants.ts"],"sourcesContent":[null],"names":["CENTER","LEFT","RIGHT","TRANSPARENT","ZEROES","PRIMARYCOLORS","FALCONBUTTONCLICKED","AFTER","BEFORE","COLORWHITE","H1","H2","H3","H4","EXTRA","SEMIEXTRA","NONE","MDDESKEND","TABEND","MOBEND","STACK","COLLG6","COLLG4","COLLG3","DEFAULTLOCALE","AUTHCOOKIE","TABSTART","MDDESKSTART","LGDESKSTART","IMG","ICON","SVG","AUTHSTAMP","PRE_TO_POST_PROMOTION_ID","CUSTOMER_GROUP_STORAGE_KEY","DISMISSED_RIBBONS_STORAGE_KEY","RIBBON_DISMISS_UPDATED_EVENT","CART_COOKIE","SMART_UPGRADE","FLEX_UPGRADE"],"mappings":"AAAO,MAAMA,EAAS,SACTC,EAAO,OACPC,EAAQ,QACRC,EAAc,cACdC,EAAS,KACTC,EAAgB,UAChBC,EAAsB,UACtBC,EAAQ,QACRC,EAAS,SAETC,EAAa,UACbC,EAAK,KACLC,EAAK,KACLC,EAAK,KACLC,EAAK,KACLC,EAAQ,QACRC,EAAY,YACZC,EAAM,OAENC,EAAY,KACZC,EAAS,KACTC,EAAS,IACTC,EAAQ,QACRC,EAAS,WACTC,EAAS,WACTC,EAAS,WAWTC,EAAgB,KAChBC,EAAa,cAcbC,EAAW,IACXC,EAAc,KACdC,EAAc,KAgCdC,EAAM,MACNC,EAAO,OACPC,EAAM,MA0DNC,EAAY,aAWZC,EAA2B,YAG3BC,EAA6B,gBAC7BC,EAAgC,wBAChCC,EAA+B,uBAC/BC,EAAc,sBACdC,EAAgB,gBAChBC,EAAe"}
|
|
1
|
+
{"version":3,"file":"Constants.js","sources":["../../../../src/components/Constants.ts"],"sourcesContent":[null],"names":["CENTER","LEFT","RIGHT","TRANSPARENT","ZEROES","PRIMARYCOLORS","FALCONBUTTONCLICKED","AFTER","BEFORE","COLORWHITE","H1","H2","H3","H4","EXTRA","SEMIEXTRA","NONE","MDDESKEND","TABEND","MOBEND","STACK","COLLG6","COLLG4","COLLG3","DEFAULTLOCALE","AUTHCOOKIE","TABSTART","MDDESKSTART","LGDESKSTART","IMG","ICON","SVG","AUTHSTAMP","PRE_TO_POST_PROMOTION_ID","CUSTOMER_GROUP_STORAGE_KEY","DISMISSED_RIBBONS_STORAGE_KEY","RIBBON_DISMISS_UPDATED_EVENT","CUSTOMER_SEGMENT_REFRESH_EVENT","CART_COOKIE","SMART_UPGRADE","FLEX_UPGRADE"],"mappings":"AAAO,MAAMA,EAAS,SACTC,EAAO,OACPC,EAAQ,QACRC,EAAc,cACdC,EAAS,KACTC,EAAgB,UAChBC,EAAsB,UACtBC,EAAQ,QACRC,EAAS,SAETC,EAAa,UACbC,EAAK,KACLC,EAAK,KACLC,EAAK,KACLC,EAAK,KACLC,EAAQ,QACRC,EAAY,YACZC,EAAM,OAENC,EAAY,KACZC,EAAS,KACTC,EAAS,IACTC,EAAQ,QACRC,EAAS,WACTC,EAAS,WACTC,EAAS,WAWTC,EAAgB,KAChBC,EAAa,cAcbC,EAAW,IACXC,EAAc,KACdC,EAAc,KAgCdC,EAAM,MACNC,EAAO,OACPC,EAAM,MA0DNC,EAAY,aAWZC,EAA2B,YAG3BC,EAA6B,gBAC7BC,EAAgC,wBAChCC,EAA+B,uBAC/BC,EAAiC,yBACjCC,EAAc,sBACdC,EAAgB,gBAChBC,EAAe"}
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
/* center a block element */
|
|
2
|
+
/* use this to any of the pseudo elements as these are the mandatory properties */
|
|
3
|
+
/* setting styles in separate formats for cross browser support */
|
|
4
|
+
/* specify the max width for an element and apply ellipses and truncate the overflow */
|
|
5
|
+
/* vertically center alilgn any HTML element */
|
|
6
|
+
/* add basePath to assets */
|
|
7
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ {
|
|
2
8
|
width: 100%;
|
|
3
9
|
position: relative;
|
|
4
10
|
}
|
|
5
|
-
.
|
|
11
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__card___3ODSA {
|
|
6
12
|
display: flex;
|
|
7
13
|
align-items: center;
|
|
8
14
|
justify-content: center;
|
|
9
|
-
padding:16px 0;
|
|
15
|
+
padding: 16px 0;
|
|
10
16
|
}
|
|
11
|
-
.
|
|
17
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__darkText___3alAL {
|
|
12
18
|
color: #ffffff !important;
|
|
13
19
|
}
|
|
14
|
-
.
|
|
15
|
-
color: #ffffff;
|
|
20
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__darkDescription___hx83k a {
|
|
21
|
+
color: #ffffff;
|
|
16
22
|
}
|
|
17
|
-
.
|
|
23
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__image___PoqTP {
|
|
18
24
|
margin-top: 5px;
|
|
19
25
|
margin-right: 8px;
|
|
20
26
|
}
|
|
21
|
-
.
|
|
27
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__icon___ywexl {
|
|
22
28
|
height: 24px;
|
|
23
29
|
width: 24px;
|
|
24
30
|
}
|
|
25
|
-
.
|
|
31
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__textContainer___ybSQ6 {
|
|
26
32
|
margin: 8px 0;
|
|
27
33
|
font-weight: 700;
|
|
28
34
|
font-size: 18px;
|
|
@@ -31,98 +37,85 @@ color: #ffffff;
|
|
|
31
37
|
text-align: center;
|
|
32
38
|
font-style: normal;
|
|
33
39
|
}
|
|
34
|
-
|
|
35
|
-
.globalPromoRibbon_TextContainer span {
|
|
40
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__textContainer___ybSQ6 span {
|
|
36
41
|
display: inline-block;
|
|
37
42
|
vertical-align: bottom;
|
|
38
43
|
}
|
|
39
|
-
.
|
|
44
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__title___G9Rmd {
|
|
40
45
|
font-weight: 700;
|
|
41
46
|
}
|
|
42
|
-
.
|
|
47
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__description___YkYuL {
|
|
43
48
|
font-weight: 400;
|
|
44
49
|
}
|
|
45
|
-
.
|
|
50
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__closeIcon___ceOnI {
|
|
46
51
|
position: absolute;
|
|
47
52
|
right: 20px;
|
|
48
53
|
top: 50%;
|
|
49
54
|
transform: translateY(-50%);
|
|
50
55
|
margin: 0;
|
|
51
56
|
}
|
|
52
|
-
|
|
53
|
-
.globalPromoRibbon_CloseIcon1 {
|
|
57
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__closeIconMobile___8EkZL {
|
|
54
58
|
cursor: pointer;
|
|
55
59
|
}
|
|
56
|
-
|
|
57
|
-
.globalPromoRibbon_ButtonSection {
|
|
60
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttonSection___mhUVI {
|
|
58
61
|
display: flex;
|
|
59
62
|
align-items: center;
|
|
60
63
|
justify-content: center;
|
|
61
64
|
}
|
|
62
|
-
.
|
|
65
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttons___2VjNK {
|
|
63
66
|
display: flex;
|
|
64
67
|
gap: 16px;
|
|
65
68
|
flex-wrap: wrap;
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
.globalPromoRibbon_Button a {
|
|
69
|
-
text-decoration: none;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.globalPromoRibbon_Button {
|
|
70
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__button___ijSva {
|
|
73
71
|
text-wrap: nowrap;
|
|
74
72
|
}
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__button___ijSva a {
|
|
74
|
+
text-decoration: none;
|
|
75
|
+
}
|
|
76
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__descriptionBlockSection___lf74x {
|
|
77
77
|
display: flex;
|
|
78
78
|
align-items: center;
|
|
79
79
|
justify-content: center;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/* Desktop modifiers */
|
|
82
83
|
@media (min-width: 1024px) {
|
|
83
|
-
.
|
|
84
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ.GlobalPromoRibbon-module__slim___uw0I- .GlobalPromoRibbon-module__card___3ODSA {
|
|
84
85
|
min-height: 60px;
|
|
85
86
|
padding: 8px 0;
|
|
86
87
|
}
|
|
87
|
-
|
|
88
|
-
.globalPromoRibbon_Slim .globalPromoRibbon_descriptionBlockSection {
|
|
88
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ.GlobalPromoRibbon-module__slim___uw0I- .GlobalPromoRibbon-module__descriptionBlockSection___lf74x {
|
|
89
89
|
min-height: 24px;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
.globalPromoRibbon_Slim .globalPromoRibbon_TextContainer {
|
|
91
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ.GlobalPromoRibbon-module__slim___uw0I- .GlobalPromoRibbon-module__textContainer___ybSQ6 {
|
|
93
92
|
margin: 0;
|
|
94
93
|
}
|
|
95
|
-
|
|
96
|
-
.globalPromoRibbon_Slim .globalPromoRibbon_ButtonSection {
|
|
94
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ.GlobalPromoRibbon-module__slim___uw0I- .GlobalPromoRibbon-module__buttonSection___mhUVI {
|
|
97
95
|
gap: 20px;
|
|
98
96
|
padding-left: 20px;
|
|
99
97
|
}
|
|
100
|
-
|
|
101
|
-
.globalPromoRibbon_Slim .globalPromoRibbon_Buttons {
|
|
98
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ.GlobalPromoRibbon-module__slim___uw0I- .GlobalPromoRibbon-module__buttons___2VjNK {
|
|
102
99
|
gap: 12px;
|
|
103
100
|
flex-wrap: nowrap;
|
|
104
101
|
}
|
|
105
|
-
|
|
106
102
|
}
|
|
107
|
-
/* Mobile only
|
|
108
|
-
@media
|
|
109
|
-
.
|
|
110
|
-
display: flex;
|
|
103
|
+
/* Mobile only */
|
|
104
|
+
@media (max-width: 767px) {
|
|
105
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__card___3ODSA {
|
|
111
106
|
flex-direction: column;
|
|
112
|
-
align-items: center;
|
|
113
|
-
justify-content: center;
|
|
114
107
|
margin-left: 0;
|
|
115
108
|
min-height: 100px;
|
|
116
109
|
padding: 10px 0;
|
|
117
110
|
}
|
|
118
|
-
.
|
|
111
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__closeIconMobile___8EkZL {
|
|
119
112
|
position: absolute;
|
|
120
113
|
right: 20px;
|
|
121
114
|
top: 24px;
|
|
122
115
|
transform: translateY(-50%);
|
|
123
116
|
margin: 0;
|
|
124
117
|
}
|
|
125
|
-
.
|
|
118
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttonSection___mhUVI {
|
|
126
119
|
display: flex;
|
|
127
120
|
align-items: center;
|
|
128
121
|
justify-content: center;
|
|
@@ -131,101 +124,95 @@ color: #ffffff;
|
|
|
131
124
|
margin-left: 0;
|
|
132
125
|
width: 100%;
|
|
133
126
|
}
|
|
134
|
-
.
|
|
127
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttons___2VjNK {
|
|
135
128
|
gap: 10px;
|
|
136
129
|
justify-content: center;
|
|
137
130
|
flex-wrap: nowrap;
|
|
138
131
|
}
|
|
139
|
-
.
|
|
132
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__descriptionBlockSection___lf74x {
|
|
140
133
|
width: 100%;
|
|
141
134
|
min-height: 24px;
|
|
142
135
|
padding: 0 52px 0 20px;
|
|
143
136
|
margin-left: 0;
|
|
144
137
|
box-sizing: border-box;
|
|
145
138
|
}
|
|
146
|
-
.
|
|
139
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__textContainer___ybSQ6 {
|
|
147
140
|
margin: 0;
|
|
148
141
|
}
|
|
149
|
-
.
|
|
142
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__textContainer___ybSQ6 p {
|
|
150
143
|
margin: 0;
|
|
151
144
|
white-space: nowrap;
|
|
152
145
|
overflow: hidden;
|
|
153
146
|
text-overflow: ellipsis;
|
|
154
147
|
}
|
|
155
|
-
.
|
|
148
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__timer___mfsvU {
|
|
156
149
|
margin-left: 0;
|
|
157
150
|
padding-bottom: 8px;
|
|
158
151
|
}
|
|
159
|
-
.
|
|
152
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__closeIcon___ceOnI {
|
|
160
153
|
display: none;
|
|
161
154
|
}
|
|
162
155
|
}
|
|
163
|
-
|
|
164
|
-
@media
|
|
165
|
-
.
|
|
156
|
+
/* Small mobile only */
|
|
157
|
+
@media (max-width: 320px) {
|
|
158
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttons___2VjNK {
|
|
166
159
|
gap: 6px;
|
|
167
160
|
}
|
|
168
|
-
|
|
169
|
-
.globalPromoRibbon_Button .falcon-button-defaults {
|
|
161
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__button___ijSva .GlobalPromoRibbon-module__falcon-button-defaults___tqZw8 {
|
|
170
162
|
padding: 10px 16px;
|
|
171
163
|
}
|
|
172
164
|
}
|
|
173
|
-
/*
|
|
174
|
-
@media
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
/* Tablet only viewport */
|
|
178
|
-
@media all and (min-width: 768px) and (max-width: 1023px) {
|
|
179
|
-
.globalPromoRibbon_Card{
|
|
165
|
+
/* Tablet only */
|
|
166
|
+
@media (min-width: 768px) and (max-width: 1023px) {
|
|
167
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__card___3ODSA {
|
|
180
168
|
justify-content: center;
|
|
181
169
|
}
|
|
182
|
-
.
|
|
183
|
-
display: flex;
|
|
170
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttonSection___mhUVI {
|
|
184
171
|
flex-direction: column;
|
|
185
172
|
padding-right: 0;
|
|
186
173
|
padding-left: 32px;
|
|
187
174
|
margin: 6px 0 0 0;
|
|
188
175
|
align-items: center;
|
|
189
176
|
}
|
|
190
|
-
.
|
|
177
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__closeIcon___ceOnI {
|
|
191
178
|
display: none;
|
|
192
179
|
}
|
|
193
|
-
.
|
|
180
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__closeIconMobile___8EkZL {
|
|
194
181
|
margin-right: 0;
|
|
195
182
|
position: absolute;
|
|
196
183
|
right: 40px;
|
|
197
184
|
padding-left: 16px;
|
|
198
185
|
}
|
|
199
|
-
.
|
|
186
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__descriptionBlockSection___lf74x {
|
|
200
187
|
margin-left: 0;
|
|
201
188
|
}
|
|
202
189
|
}
|
|
203
|
-
|
|
204
|
-
/* Desktop only viewport */
|
|
190
|
+
/* Desktop and above */
|
|
205
191
|
@media (min-width: 1024px) {
|
|
206
|
-
.
|
|
192
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__card___3ODSA {
|
|
207
193
|
justify-content: center;
|
|
208
|
-
margin-left:0;
|
|
194
|
+
margin-left: 0;
|
|
209
195
|
}
|
|
210
|
-
.
|
|
196
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__descriptionBlockSection___lf74x {
|
|
211
197
|
margin: 0;
|
|
212
198
|
}
|
|
213
|
-
.
|
|
199
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttonSection___mhUVI {
|
|
214
200
|
padding-left: 32px;
|
|
215
201
|
}
|
|
216
|
-
.
|
|
202
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__closeIconMobile___8EkZL {
|
|
217
203
|
display: none;
|
|
218
204
|
}
|
|
219
205
|
}
|
|
220
|
-
|
|
221
|
-
|
|
206
|
+
/* Large desktop */
|
|
207
|
+
@media (min-width: 1440px) {
|
|
208
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__card___3ODSA {
|
|
222
209
|
max-width: 1440px;
|
|
223
210
|
margin: auto;
|
|
224
211
|
}
|
|
225
|
-
.
|
|
212
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__descriptionBlockSection___lf74x {
|
|
226
213
|
margin: 0;
|
|
227
214
|
}
|
|
228
|
-
.
|
|
215
|
+
.GlobalPromoRibbon-module__globalPromoRibbon___P85VQ .GlobalPromoRibbon-module__buttonSection___mhUVI {
|
|
229
216
|
padding-left: 32px;
|
|
230
217
|
}
|
|
231
218
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './GlobalPromoRibbon.css';
|
|
2
|
-
import{jsx as e,Fragment as
|
|
2
|
+
import{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import{useState as o,useRef as l,useEffect as t}from"react";import r from"./GlobalPromoRibbon.module.scss.js";import a from"../RibbonComponent/RibbonComponentTimer/RibbonComponentTimer.js";import{calculateDateTime as d}from"../RibbonComponent/utils.js";import{trackNewDatalayerEvent as s}from"../../utils/AnalyticUtils.js";import{VIEWPROMOTION as u,ALL as c,RIBBON as m,CMS as v}from"../../utils/AnalyticsConstants.js";import b from"../FalconButtonV3/FalconButtonV3.js";import{CUSTOMER_GROUP_STORAGE_KEY as g,DISMISSED_RIBBONS_STORAGE_KEY as p,RIBBON_DISMISS_UPDATED_EVENT as f}from"../Constants.js";const w=e=>e?(Array.isArray(e)?e:[e]).filter(Boolean).map(e=>String(e).trim().toLowerCase()):[],h=e=>e?d(new Date(e.trim().replace(/-/g,"/"))):null,T=e=>{if(!(null==e?void 0:e.endTime))return!1;return d(new Date(e.endTime.replace(/-/g,"/"))).getTime()<=Date.now()},y=({content:d})=>{var y,S,N,I,C,k,_,j,B;const[L,O]=o(!1),[x,R]=o(!1),[A,D]=o(!1),[E,U]=o(new Date),V=l(null),[F,J]=o(!1),[P,G]=o(!1),[$,M]=o(null==d?void 0:d.teaserTimer[0]),[H,W]=o(T(null===(y=null==d?void 0:d.teaserTimer)||void 0===y?void 0:y[0]));t(()=>{O(!0);const e=window.localStorage.getItem(g),n=(()=>{var e;if("undefined"==typeof window)return new Set;const n=window.localStorage.getItem("tealium_va");if(!n)return new Set;try{const i=null===(e=JSON.parse(n))||void 0===e?void 0:e.audiences;return i&&"object"==typeof i?new Set(Object.keys(i).map(e=>e.trim().toLowerCase())):new Set}catch(e){return new Set}})(),i=w(null==d?void 0:d.tealiumAudiences).length>0;D(i?((e,n)=>{const i=w(e);return!i.length||i.some(e=>n.has(e))})(null==d?void 0:d.tealiumAudiences,n):((e,n)=>{const i=w(e);return!(i.length&&!i.includes("all"))||Boolean(n&&i.includes(n.trim().toLowerCase()))})(null==d?void 0:d.customerType,e)),R(!0)},[]);const q=()=>{if(!1===F){if("undefined"!=typeof window&&(null==d?void 0:d._uid)&&Number(null==d?void 0:d.expireTime)>0){const e=Date.now()+60*Number(d.expireTime)*1e3,n=(()=>{if("undefined"==typeof window)return{};const e=window.localStorage.getItem(p);if(!e)return{};try{const n=JSON.parse(e);return n&&"object"==typeof n?Object.entries(n).reduce((e,[n,i])=>("string"==typeof n&&Number.isFinite(i)&&(e[n]=Number(i)),e),{}):{}}catch(e){return{}}})();n[d._uid]=e,window.localStorage.setItem(p,JSON.stringify(n)),window.dispatchEvent(new Event(f))}J(!0)}};t(()=>{var e;if(null===(e=null==d?void 0:d.teaserTimer[0])||void 0===e?void 0:e.startTime){const e=null==d?void 0:d.teaserTimer[0];M(e),W(T(e))}else W(!1);G(!0)},[null==d?void 0:d.teaserTimer]),t(()=>{const e=h(null==d?void 0:d.scheduleStartTime),n=h(null==d?void 0:d.scheduleEndTime),i=E.getTime(),o=[e,n].filter(e=>Boolean(e)).map(e=>e.getTime()).filter(e=>e>i).sort((e,n)=>e-n)[0];if(!o)return;const l=o-i,t=window.setTimeout(()=>{U(new Date)},Math.max(l,0));return()=>{window.clearTimeout(t)}},[null==d?void 0:d.scheduleStartTime,null==d?void 0:d.scheduleEndTime,E]),t(()=>{var e;const n=new IntersectionObserver(e=>{var n,i;e[0].isIntersecting&&e[0].intersectionRatio>=.5&&!(null===(n=localStorage.getItem("analyticsUids"))||void 0===n?void 0:n.includes(d._uid))&&(s(u,u,{banner_promotion_name:null!==(i=null==d?void 0:d.bannerPromotionName)&&void 0!==i?i:null==d?void 0:d.title,banner_source:v,banner_type:m,banner_location:null==d?void 0:d.bannerLocation,audience_name:c,promotion_objective:c}),localStorage.setItem("analyticsUids",JSON.stringify([...localStorage.getItem("analyticsUids")?JSON.parse(localStorage.getItem("analyticsUids")||""):[],d._uid])))},{threshold:.5});return V.current&&!(null===(e=localStorage.getItem("analyticsUids"))||void 0===e?void 0:e.includes(d._uid))&&n.observe(V.current),()=>{n.disconnect()}});const z=h(null==d?void 0:d.scheduleStartTime),K=h(null==d?void 0:d.scheduleEndTime),Q=!z||E.getTime()>=z.getTime(),X=!K||K.getTime()>E.getTime(),Y=!1===F&&P&&x&&A&&(Q&&X),Z=(null==d?void 0:d.gradientBackgroundGlobal)&&"none"!==(null==d?void 0:d.gradientBackgroundGlobal)?d.gradientBackgroundGlobal.replace(/;\s*$/,""):null==d?void 0:d.backgroundColor;return e("div",{className:"body-banner",suppressHydrationWarning:!0,children:L&&Y&&e(n,{children:e("div",{className:`${r.globalPromoRibbon} ${(null==d?void 0:d.slimVersion)?r.slim:""}`,style:{background:Z},ref:V,children:i("div",{className:r.card,children:[i("div",{className:r.descriptionBlockSection,children:[(null===(S=null==d?void 0:d.icon)||void 0===S?void 0:S.filename)&&e("div",{className:r.image,children:e("img",{className:r.icon,src:null===(N=null==d?void 0:d.icon)||void 0===N?void 0:N.filename})}),(null==d?void 0:d.title)&&i("div",{className:r.textContainer,children:[e("span",{style:{color:null==d?void 0:d.titleColor},children:null==d?void 0:d.title}),e("div",{})]})]}),i("div",{className:r.buttonSection,children:[(null===(I=null==d?void 0:d.teaserTimer[0])||void 0===I?void 0:I.startTime)&&!H&&e("div",{className:r.timer,children:e(a,{content:$,setTimerExpired:W,isSlimVersion:Boolean(null==d?void 0:d.slimVersion)})}),(null===(C=null==d?void 0:d.buttons)||void 0===C?void 0:C.length)?e("div",{className:r.buttons,children:d.buttons.map((n,i)=>{var o,l,t,a,s,u,c,m;return e(b,{wrapperClassName:r.button,href:n.href||(null===(o=n.buttonLink)||void 0===o?void 0:o.url)||(null===(l=n.buttonLink)||void 0===l?void 0:l.cached_url)||"",label:n.buttonLabel||n.label||"",buttonType:n.buttonType,isSlim:Boolean(null==d?void 0:d.slimVersion),target:null!==(a=null!==(t=n.target)&&void 0!==t?t:n.linkTarget)&&void 0!==a?a:"",rel:null!==(s=n.rel)&&void 0!==s?s:"_blank"===n.linkTarget?"opener":"noopener",iconFilename:n.iconFilename||(null===(u=n.buttonIcon)||void 0===u?void 0:u.filename),iconPosition:n.iconPosition},`${n.href||(null===(c=n.buttonLink)||void 0===c?void 0:c.url)||(null===(m=n.buttonLink)||void 0===m?void 0:m.cached_url)||i}`)})}):null,(null===(k=null==d?void 0:d.closeIcon)||void 0===k?void 0:k.filename)&&(null==d?void 0:d.showCloseIcon)&&e("div",{className:r.closeIcon,onClick:q,children:e("img",{src:null===(_=null==d?void 0:d.closeIcon)||void 0===_?void 0:_.filename})})]}),(null===(j=null==d?void 0:d.closeIcon)||void 0===j?void 0:j.filename)&&(null==d?void 0:d.showCloseIcon)&&e("div",{className:r.closeIconMobile,onClick:q,children:e("img",{src:null===(B=null==d?void 0:d.closeIcon)||void 0===B?void 0:B.filename})})]})})})})};export{y as default};
|
|
3
3
|
//# sourceMappingURL=GlobalPromoRibbon.js.map
|