-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8155.js
1 lines (1 loc) · 14.2 KB
/
8155.js
1
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[8155],{68155:(e,a,t)=>{t.r(a),t.d(a,{default:()=>ca});var s=t(30758),i=t(75773),n=t(37),r=t(93492),o=t(99035),l=t(13505),c=t(55480),d=t(51824),m=t(47517),h=t(39876),p=t(82362);const x="t_HhrMRQykkfPlBj5Bqg",u="rPZpSQivkcUpuKUQ5hQR",f="Nz9dhLHeQc78xXXo5hvO",g="nSzy4mYX_IKfAZBIAH1o",j="Mn0mjlP624SdPXlf0XD9",b="BkzyB9IfZLLrRaOv6hs8";var y=t(86070);const v=({data:e})=>{const{spec:a}=(0,p.r)(n.Z,{data:{identifier:"benefitsEducation",reason:`${e.campaignId}:${e.userEligibility}`}}),t=(0,s.useMemo)((()=>a.educationListContainerFactory()),[a]),i=(0,h.t)(t);return(0,y.jsx)("div",{className:x,ref:i,"data-testid":"benefit-education-list",children:(0,y.jsxs)("div",{className:u,children:[(0,y.jsx)(l.E,{className:f,as:"h2",size:24,variant:"titleSmall",color:"white",semanticColor:"textBase",children:e.header}),(0,y.jsx)("div",{className:j,children:(0,y.jsx)(c.b,{as:"ul",listStyleReset:!1,className:b,"aria-label":"premium-benefits",children:e.benefits.map(((e,a)=>(0,y.jsxs)("div",{className:g,children:[(0,y.jsx)(d.i,{}),(0,y.jsx)(m.K,{"data-testid":"premium-benefit-item",className:g,color:"white",condensed:!0,style:{marginLeft:"4px"},children:e},a)]},a)))})})]})})};var N=t(97500),I=t.n(N),k=t(44994),w=t(30320),E=t(87732),C=t(82855);const T="hpcwgABmQsxArg6CHmwL",S="NiPwJn5g6wyg__gXXQLT",D=()=>(0,y.jsxs)("div",{className:T,children:[(0,y.jsx)(E.Z,{className:S,semanticColor:"textBase",variant:"balladBold",children:"Premium"}),(0,y.jsx)(C.G,{height:"24px",condensed:!0,semanticColor:"textBase"})]}),_="Cd1FDj9Rc0qIjN_tp7X1",M="SzqsgkOe1qmgXDHysfCq",B="pY8CBZh9OXtJgDOFUbxN",L="mdN0LAS0jJsu8omAuHEA",P="Dsan_DkzDFvoatncFM1d",F="_1oI8WowXCA7XxN26B_uM",H="Tsde0ahv9SWmrVQZiUjg",z="vfwvxoZzAqqywq61ZbPT",U="dXilYFJ25GVUny5tyRi3",A="L5BFjkg4z0IOpYeVwtkZ",R="IEjSVoB2p4KMxvDxFNMr",V="tybZ2Wyz6nkkgBFBcqzw",X="oaLgU5wxEC9uoejIfHel",O="uETtHkEVMnAvijF28fnf",$="S8eI0WpcfpToa5Gvdwoj",W="IAKbjrKVegAYqDE15Wr8",q="PREMIUM_TIER",K=(0,s.memo)((()=>(0,y.jsx)(D,{}))),Z=({tiers:e,benefitLabel:a})=>(0,y.jsx)("thead",{className:H,children:(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{className:I()(R,V),children:a}),e.map(((e,a)=>{const t=e.id===q?(0,y.jsx)("div",{className:I()(L,e.id===q?F:P),children:e.id===q&&(0,y.jsx)("div",{className:A,children:(0,y.jsx)(K,{})})}):(0,y.jsx)("div",{className:I()(L,e.id===q?F:P),dangerouslySetInnerHTML:{__html:e.name}});return(0,y.jsx)("th",{className:R,children:t},a)}))]})}),Q=({benefit:e,index:a,tierBenefit:t})=>{const[i,n]=(0,s.useState)(!1);return(0,y.jsxs)("tr",{className:z,style:{"--animationDelay":100*a+"ms"},onMouseOver:()=>n(!0),onMouseLeave:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),children:[(0,y.jsxs)("td",{className:I()(X),children:[(0,y.jsx)("span",{tabIndex:0,role:"tooltip",children:e.name}),(0,y.jsx)("div",{className:I()(W,{[M]:i}),children:i&&(0,y.jsx)(k.m,{colorSet:"invertedLight",dangerouslySetInnerHTML:{__html:e?.explanation}})})]}),t.map((e=>(0,y.jsx)("td",{className:O,children:(0,y.jsx)("div",{className:I()($,{[U]:e.id===q}),children:e.isBenefitPresent?(0,y.jsx)(w.k,{className:B,size:"large"}):"—"})},e.id)))]})},G=({tableData:e,spec:a})=>{const{ref:t,inView:n}=(0,i.Wx)({triggerOnce:!0}),r=(0,s.useCallback)((a=>e.comparison.find((e=>e.benefitId===a))),[e.comparison]),o=(0,s.useMemo)((()=>a?.comparisonTableFactory()),[a]),l=(0,h.t)(o);return(0,y.jsx)("div",{className:I()(_,{[M]:n}),ref:t,"data-testid":"comparison-table",children:(0,y.jsxs)("table",{ref:l,children:[(0,y.jsx)(Z,{tiers:e.tier,benefitLabel:e.benefitLabelText}),(0,y.jsx)("tbody",{children:e.benefit.map(((e,a)=>{const t=r(e.benefitId);return t?(0,y.jsx)(Q,{index:a,benefit:e,tierBenefit:t.tierBenefit},e.name):null}))})]})})};var J=t(10993),Y=t(555),ee=t(21974),ae=t(79966),te=t(14403);const se=(e,a)=>{const t=new URL(e);return t.searchParams.set("ref",a),t.toString()},ie=e=>se(e,"desktop_app_native_pdp");var ne=t(42626);const re="Gu5dPC6H3JLIutCvB2z_",oe="fdX405sq8Q1nFlEC9x0e",le="oFrTU99CFAivZDoYIehj",ce="eSQahsR_fNEO7f9YY2gh",de="uhiFjUXjo84p6X7gz0hu",me="LVupwO4wvJkgmBd0lBjx",he="Gvwcl9dk5DOWt72tB3Vv",pe="gTxsEwDpaubk8J6F7suV",xe="GJtyFY_rr6HKawuGm6ud",ue=({data:e,refToStorefront:a,locale:t,useLatestTweakit:i})=>{const r=ie(e.cta[0].link),{spec:o,logger:c}=(0,p.r)(n.Z,{data:{identifier:"hero",reason:`${e.campaignId}:${e.offerTypeId}`}}),d=(0,s.useMemo)((()=>o.heroContainerFactory({identifier:"hero",reason:`${e.campaignId}:${e.userEligibility}`})),[o,e.campaignId,e.userEligibility]),m=(0,h.t)(d),{openURLWithSessionTransfer:x}=(0,ne.L)(),u=(0,s.useCallback)((a=>{x(r,"_blank"),a.preventDefault(),c.logInteraction(d.heroCheckoutButtonFactory({reason:`${e.campaignId}:${e.offerTypeId}`}).hitNavigateToExternalUri({destination:r}))}),[d,c,x,e.campaignId,e.offerTypeId,r]),f=(0,s.useCallback)((e=>{setTimeout((()=>{a.current&&a?.current.scrollIntoView({behavior:"smooth",block:"start"})}),500),e.preventDefault(),c.logInteraction(d.heroViewPlansButtonFactory().hitQuickScroll())}),[d,c,a]),g=e.showCountdownTimer?((e,a,t)=>{const s=new Date;s.setHours(0,0,0,0);const i=new Date(e);i.setHours(0,0,0,0);const n=i.getTime()-s.getTime(),r=Math.round(n/864e5);return 0===r?a.offerEndsToday:1===r?a.offerEndsTomorrow:new te.Ay(a.offerEndsInXDays,t).format({0:r})})(e.offerEndDate,e.countdownTimer,t):"",j={margin:e.showCountdownTimer?"16px 0 24px":"24px 0"};return(0,y.jsx)("div",{className:I()(re,{[xe]:i}),ref:m,style:{"--background-image-url":`url(${e.backgroundDesktop.url})`,"--theme-color":e.themeHexColor},children:(0,y.jsx)("div",{className:oe,children:(0,y.jsxs)("div",{className:le,"data-testid":"premium-hero",children:[(0,y.jsx)(l.E,{as:"h1",variant:"titleMedium",color:"white",semanticColor:"textBase",style:{paddingBottom:"8px",fontSize:i?"48px":"32px"},children:(0,y.jsx)("span",{dangerouslySetInnerHTML:{__html:e.header}})}),(0,y.jsx)(l.E,{as:"p",variant:"marginal",color:"white",semanticColor:"textBase",style:{fontSize:i?"24px":"18px"},children:e.subheader&&e.subheader.map(((e,a)=>(0,y.jsx)("span",{dangerouslySetInnerHTML:{__html:`${e} `}},a)))}),e.showCountdownTimer&&g&&(0,y.jsx)("div",{className:he,children:(0,y.jsxs)("div",{className:pe,children:[(0,y.jsx)(J.z,{size:"small",semanticColor:"textAnnouncement"}),(0,y.jsx)(l.E,{as:"p",variant:"bodySmall",color:"white",semanticColor:"textBase",children:g})]})}),(0,y.jsxs)("div",{className:de,style:j,children:[(0,y.jsx)(Y.$,{colorSet:"invertedLight",className:me,onClick:u,"aria-label":e.cta[0].accessibilityText,children:e.cta[0].text}),(0,y.jsx)(ee.n,{style:{borderColor:"white"},className:me,onClick:f,"aria-label":e.cta[1].accessibilityText,children:e.cta[1].text})]}),(0,y.jsx)(l.E,{as:"p",variant:"marginal",color:"white",semanticColor:"textBase",onClick:ae.k,onKeyDown:ae.k,children:(0,y.jsx)("span",{className:ce,"data-testid":"hero-terms-link",dangerouslySetInnerHTML:{__html:e?.legalDisclaimer}})})]})})})},fe="D4IPcSaP_aw1kTzBFmts",ge="UZnaIbk7HeCMnM47oVX8",je="cfaF1MarYjXXEVrUqcyw",be="A747Ht40xUR4hVc5y3nM",ye="WAqRKrOJRFZWIIUpu2gQ",ve="hHfwjHBV1PCImQaPWNH6",Ne="sWRyHyVg69dDodEMFlbS",Ie=({data:e})=>{const a=e.paymentIcons?[...e.paymentIcons]:[];let t,s=[],i=[];const n=e.additionalPaymentMethodsLabel;a.length>5?(s=a.slice(0,4),i=a.slice(s.length,a.length),t=n.replace("{0}",i.length.toString())):s=a||[];const r={"grid-template-columns":`repeat(${i.length<4?i.length:4}, 1fr)`};return(0,y.jsxs)("div",{className:fe,"data-testid":"payment-icons",children:[(0,y.jsx)("ul",{className:ge,children:s.map((({url:e,label:a},t)=>(0,y.jsx)("li",{className:je,children:(0,y.jsx)("div",{role:"img",className:be,style:{backgroundImage:`url(${e})`},"aria-label":a})},`icon-${t}`)))}),i.length>0&&(0,y.jsx)("div",{className:ye,children:(0,y.jsxs)("div",{className:Ne,tabIndex:0,children:[(0,y.jsx)("span",{children:t}),(0,y.jsx)("ul",{className:ve,style:r,children:i.map((({url:e,label:a},t)=>(0,y.jsx)("li",{className:je,children:(0,y.jsx)("div",{role:"img",className:be,style:{backgroundImage:`url(${e})`},"aria-label":a})},`icon-${t}`)))})]})})]})},ke="mhc6hFEWbMgtklj338kj",we="z6VAlMqaVg7J6oVde_PC",Ee="fGlxTBS_az1VSDF_JNZj",Ce=({testid:e,data:a})=>(0,y.jsx)("div",{className:ke,"data-testid":e,children:(0,y.jsxs)("div",{className:we,children:[(0,y.jsx)(l.E,{as:"h1",variant:"titleMedium",color:"white",semanticColor:"textBase",children:a.headline}),(0,y.jsx)(l.E,{as:"p",variant:"marginal",color:"white",size:18,semanticColor:"textBase",style:{fontSize:"18px"},className:Ee,children:a.text})]})});var Te=t(62411),Se=t(17353),De=t(59134),_e=t(99802);const Me="ESjbOIOvjhCXWqPUuiZt",Be="eQY43pDGc3LhbExUrDtj",Le="CxK9MKBKmtH_YjEC9fNo",Pe="tfpGIPCxEkP6rluWFTzT",Fe="w92DKQuLYpcrnO8kaEVd",He="GtuNtAimrtglxgjNwzR1",ze="DIqvj_Xf91jsfoIdGX65",Ue="yKstAHtOxSSH18_7g67E",Ae="m9c_rcjsn5oTIhIin4Qz",Re="LtjDRL21jc7aL3AGXUD_",Ve="mANjYkmyc8VXfqfmgyEO",Xe="ld8oiOrKE00Qom62WsG3",Oe="ecDLzzYeaEoOZ1zJDWS1",$e="q1lO7Evj8ava1CSbczX0",We=({text:e})=>(0,y.jsx)("div",{className:Ae,children:e}),qe=(0,s.memo)((()=>(0,y.jsx)(D,{}))),Ke=({benefits:e})=>(0,y.jsx)("ul",{className:Xe,children:e.map((e=>(0,y.jsx)("li",{children:e},e)))}),Ze=({options:e})=>(0,y.jsx)("ul",{className:Fe,children:e.map((e=>(0,y.jsx)("li",{children:(0,y.jsx)(l.E,{as:"p",variant:"bodyMediumBold",children:e})},e)))}),Qe=({primaryPriceDescription:e,secondaryPriceDescription:a})=>(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l.E,{as:"p",className:He,variant:"bodyMediumBold",children:e}),(0,y.jsx)(l.E,{as:"p",className:ze,variant:"bodySmallBold",children:a})]}),Ge=({planName:e,hideLogo:a=!1,primaryPriceDescription:t,secondaryPriceDescription:s,prepaidOptionsDescription:i})=>(0,y.jsxs)("div",{className:Ve,children:[!a&&(0,y.jsx)(qe,{}),(0,y.jsx)(l.E,{as:"h3",variant:"titleMedium",className:Pe,children:e}),i?(0,y.jsx)(Ze,{options:i}):(0,y.jsx)(Qe,{primaryPriceDescription:t,secondaryPriceDescription:s}),(0,y.jsx)(De.d,{className:Ue})]}),Je=({children:e,data:a,cardIndex:t,spec:i,noPills:n,noBadges:r})=>{const o=(0,_e.s)(),l=(c=a.encoreColorSetName,d=a.fallbackEncoreColorSetName,Se[`${c}Set`]||Se[`${d}Set`]||Se.premiumFallbackSet);var c,d;const m=l.background.base;const p="basicTier"===a.encoreColorSetName,x=ie(a.checkoutUrl),u=(0,s.useMemo)((()=>(e=>{const{planId:a,prepaidSection:t}=e;return"PREMIUM_MINI"===a?t?.prepaidOption.map((e=>e.priceDescription)):void 0})(a)),[a]),{openURLWithSessionTransfer:f}=(0,ne.L)(),g=i?.planCardFactory({identifier:a.planId,reason:`${a.offerTypeId}`,position:t}),j=(0,h.t)(g),b=(0,s.useCallback)((()=>{g&&o.logInteraction(g.planCardButtonFactory({position:0}).hitNavigateToExternalUri({destination:x})),f(x)}),[f,o,x,g]);return(0,y.jsxs)("div",{"data-testid":"plan-card",ref:j,style:{"--theme-color":m},className:Le,children:[!r&&a.description&&(0,y.jsx)(We,{text:a.description}),r||!a.description&&!n&&(0,y.jsx)("span",{className:Re}),(0,y.jsx)(Ge,{planName:a.shortPlanName,hideLogo:p,primaryPriceDescription:a.primaryPriceDescription,secondaryPriceDescription:a.secondaryPriceDescription,prepaidOptionsDescription:u}),(0,y.jsx)(Ke,{benefits:a.benefit}),(0,y.jsx)(Y.$,{onClick:b,fullWidth:!0,UNSAFE_colorSet:l,className:Oe,"aria-label":a.checkoutAccessibilityText,children:a.checkoutUrlText}),e]})};var Ye=t(76252);const ea=(0,s.forwardRef)((({text:e,onClick:a,onKeyDown:t,role:s},i)=>(0,y.jsx)("div",{ref:i,className:$e,dangerouslySetInnerHTML:{__html:e},onClick:a,onKeyDown:t,role:s}))),aa=(0,s.forwardRef)((({data:e,spec:a},t)=>{const i=(0,s.useMemo)((()=>a?.storefrontContainerFactory({identifier:"Storefront"})),[a]),n=(0,h.t)(i),r="CA"===(0,Te.d4)(Ye.JJ),o=(0,s.useRef)([]),l=e=>a=>{o.current[e]=a};(0,s.useEffect)((()=>{(()=>{let e=0;o.current.forEach((a=>{a&&a.offsetHeight>e&&(e=a.offsetHeight)})),o.current.forEach((a=>{a&&(a.style.height=`${e}px`)}))})()}),[e?.planCard]);let c=!0;return e?.planCard.forEach((e=>{e.description&&(c=!1)})),(0,y.jsx)("div",{ref:n,className:Me,"data-testid":"storefront",children:(0,y.jsx)("div",{className:Be,ref:t,children:e?.planCard?.map(((e,a)=>(0,y.jsx)(Je,{data:e,cardIndex:a,spec:i,noPills:c,noBadges:r,children:(0,y.jsx)(ea,{ref:l(a),text:e.legalDisclaimer,onClick:ae.k,onKeyDown:ae.k,role:"link"})},e.planId)))})})}));var ta=t(43165),sa=t(98962);var ia=t(46710),na=t(49593);const ra=`${t(44816).Zc}/premium-marketing`,oa=(e,a,t)=>{const{data:s,isLoading:i,isError:n}=(0,ia.I)({queryKey:["premium-page"],queryFn:async()=>{const s=await(async(e,a,t)=>{const s=na.n.getInstance(),i=await s.build().withHost(ra).withMethod("GET").withoutMarket().withPath("/marketingPage").withQueryParameters(((e,a,t)=>{const s={locale:e,automatedPaymentIcons:!0};return a&&(s.userEligibility=a),t&&(s.dateTimeOverride=t),s})(e,a,t)).withJsonContentType().withEndpointIdentifier("/marketingPage").send();return i.body})(e,a,t);return s.marketingPage},gcTime:18e5,staleTime:6e5});return{data:s??null,loading:i,error:n}},la="M3AKQVe3nkvUMc5RgBTW",ca=()=>{const e=function(){const e=(0,Te.d4)(sa.Ht);return e?.locale??""??ta.h.en}(),a=sessionStorage.getItem("eligibility")||"",t=sessionStorage.getItem("datetime")||"",l=decodeURIComponent(t),{loading:c,data:d}=oa(e,a,l),m=(0,s.useRef)(null);let h="premium_page:native_pdp";h="premium_page:desktop_app_native_pdp";const{spec:x,logger:u}=(0,p.r)(n.Z,{data:{identifier:h,reason:`${d?.campaignId}:${d?.userEligibility}`}}),{ref:f,inView:g}=(0,i.Wx)({fallbackInView:!0,triggerOnce:!0});return(0,s.useEffect)((()=>{g&&u.logImpression(x.impression())}),[g,u,x]),!c&&d?(0,y.jsxs)("div",{ref:f,className:la,"data-testid":"premium-page",children:[(0,y.jsx)(ue,{data:{campaignId:d.campaignId,userEligibility:d.userEligibility,...d.hero},refToStorefront:m,locale:e,useLatestTweakit:!1}),(0,y.jsx)(Ce,{testid:"benefit-education-header",data:{headline:d.benefitEducation.header,text:d.benefitEducation.subheader}}),d.storefront.paymentIcon&&(0,y.jsx)(Ie,{data:{paymentIcons:d.storefront.paymentIcon,additionalPaymentMethodsLabel:d.storefront.additionalPaymentMethodsLabel}}),(0,y.jsx)(v,{data:{header:d.benefitEducation.benefitListHeader,benefits:d.benefitEducation.benefit,userEligibility:d.userEligibility,campaignId:d.campaignId}}),(0,y.jsx)("div",{ref:m,children:(0,y.jsx)(aa,{data:d.storefront,spec:x})}),(0,y.jsx)(Ce,{testid:"comparison-table-header",data:{headline:d.comparisonTable.header,text:d.comparisonTable.subheader}}),(0,y.jsx)(G,{tableData:d.comparisonTable,spec:x})]}):(0,y.jsx)(o.LoadingPage,{hasError:!1,errorMessage:r.Ru.get("error.not_found.title.page")})}}}]);