Loading
function(e,t,n){n.d(t,{A:()=>Q,L:()=>X});var l=n(627968),r=n(64700),i=n(503698),a=n.n(i),s=n(997101),o=n(17928),u=n(661531),c=n(289873),d=n(885574),p=n(834730),m=n(683071),h=n(534514),A=n(821891),C=n(953689),E=n(546605),y=n(531260),P=n(364995),S=n(31823),_=n(426398),I=n(463376),f=n(473617),T=n(722847),N=n(995835),v=n(937008),g=n(768050),x=n(349786),R=n(800471),M=n(71867),b=n(222707),L=n(421094),j=n(216641),O=n(615405),w=n(67480),D=n(45938),U=n(428262),k=n(242874),G=n(881489),Y=n(735164),F=n(778307),B=n(165191),W=n(218075),H=n(361597),V=n(344159),K=n(285719),Z=n(299301),q=n(788868),z=n(818348),$=n(375708),J=n(814304);let X=e=>{let{selectedPlanId:t,paymentSources:n,trialId:l,metadata:i,isTrial:a=!1}=e,{selectedSkuId:s,priceOptions:u}=(0,T.t4)(e=>({selectedSkuId:e.selectedSkuId,priceOptions:e.checkoutPriceOptions})),{hasPaymentSources:c}=(0,_.jm)(),{activeSubscription:d,defaultPlanId:p,startedPaymentFlowWithPaymentSourcesRef:m}=(0,g.P5)(),{isEmbeddedIAP:h}=(0,S.V)(),{isPremium:A,isPremiumGroupPurchase:C,isEligibleForDiscount:N}=(0,I.i)(),{checkoutPaymentSources:x}=(0,P.t)(),{isGift:M,giftRecipient:b,selectedGiftStyle:L}=(0,v.Pv)(),O=(0,G.ds)()&&!M,k=s??"",Y=(0,o.bG)([w.A],()=>w.A.get(k),[k]),F=Y?.eligiblePaymentGateways,B=(0,R.vT)({isTrial:a,isGift:M,selectedSkuId:s,startedPaymentFlowWithPaymentSources:m.current}),{subscriptionPlan:W,purchaseDisabled:H,checkoutInvoicePreview:K,invoiceSummaryTypeWithPreview:Z,proratedInvoicePreview:z,renewalInvoicePreview:J,discountInvoicePreview:X,subscriptionPeriodEnd:Q}=(0,f.V)({selectedPlanId:t,priceOptions:u,trialId:l,metadata:i,isTrial:a}),ee=M&&(0,D.Ik)(b),et=u.paymentSourceId,en=(0,j.g)(n,et),el=(0,E.vg)("PremiumSubscriptionReview")?x?.find(e=>e.id===et)?.relocationCountry??null:null,{hasEntitlements:er,entitlements:ei}=(0,V.X)(W.id,M),ea=(0,U.J$)(u.paymentSourceId),es=(0,y.A)({forceFetch:!1,excludeReverseTrial:!1,excludeReverseTrialFromCountdown:!0}),eo=!B&&(es.isFractionalPremiumActive||O)&&q.JM.has(t),eu=r.useMemo(()=>(0,U.Tm)({skuId:s,isPremium:A,defaultPlanId:p}),[s,p,A]),ec=r.useMemo(()=>er&&null==et?$.intl.format($.t["2wPRSF"],{months:ei.length}):null,[er,et,ei]);return{disabled:H,activeSubscription:d,subscriptionPeriodEnd:Q,plan:W,premiumPlanOptions:eu,checkoutInvoicePreview:K,invoiceSummaryTypeWithPreview:Z,discountInvoicePreview:X,renewalInvoicePreview:J,proratedInvoicePreview:z,isGift:M,isEmbeddedIAP:h,paymentSourceType:en,giftRecipient:b,selectedGiftStyle:L,isInOneStepSubscriptionCheckout:B,shouldAllowPlanSelect:B&&!C,hasPaymentSources:c,paymentSourceId:et,eligiblePaymentGateways:F,inReverseTrial:O,fractionalPremiumInfo:es,showFractionalPremiumBannerInInvoiceSummary:eo,isPrepaid:ea,isCustomGift:ee,isPremium:A,isPremiumGroupPurchase:C,isEligibleForDiscount:N,hasEntitlements:er,entitlements:ei,paymentSourceOptionalWarningCopy:ec,selectedSourceRelocationCountry:el}};function Q(e){let{selectedPlanId:t,planGroup:n,paymentSources:i,handlePaymentSourceAdd:o,setHasAcceptedTerms:E,legalTermsNodeRef:y,hasLegalTermsFlash:P,trialId:S,trialFooterMessageOverride:_,reviewWarningMessage:I,metadata:f,hideSubscriptionDetails:v,referralTrialOfferId:g,isTrial:R=!1,isDiscount:j=!1,handleClose:w}=e,{disabled:D,isEmbeddedIAP:G,paymentSourceType:V,giftRecipient:q,selectedGiftStyle:Q,subscriptionPeriodEnd:ee,premiumPlanOptions:et,shouldAllowPlanSelect:en,hasPaymentSources:el,paymentSourceId:er,eligiblePaymentGateways:ei,inReverseTrial:ea,fractionalPremiumInfo:es,plan:eo,isGift:eu,invoiceSummaryTypeWithPreview:ec,checkoutInvoicePreview:ed,renewalInvoicePreview:ep,showFractionalPremiumBannerInInvoiceSummary:em,isPrepaid:eh,isCustomGift:eA,isPremium:eC,isPremiumGroupPurchase:eE,hasEntitlements:ey,paymentSourceOptionalWarningCopy:eP,selectedSourceRelocationCountry:eS}=X({selectedPlanId:t,paymentSources:i,trialId:S,metadata:f,isTrial:R}),e_=(0,T.t4)(e=>e.checkoutPriceOptions),eI=r.useMemo(()=>(0,U.l6)(e_,ed?.checkoutContext?.available_plans),[e_,ed]),ef=(0,N.I)({skuId:eo?.skuId,isGift:eu,className:J.Gw});if(null!=ec&&ec.type===Z.N$.LOADING)return(0,l.jsx)("div",{className:J.zp,children:(0,l.jsx)(c.y,{})});let eT=(0,l.jsx)(Z.eb,{invoiceSummaryTypeWithPreview:ec,priceOptions:e_,trialFooterMessageOverride:_,hideSubscriptionDetails:v,referralTrialOfferId:g,isTrial:R,inReverseTrial:ea,fractionalPremiumInfo:es,plan:eo,showFractionalPremiumBanner:em,isPrepaid:eh,isCustomGift:eA,enablePremiumBrandRefresh:eC}),eN=s.M.EEA_COUNTRIES.has(O.A.ipCountryCodeWithFallback),ev=$.intl.formatToPlainString($.t["sBpy9/"],{planName:eo.name});eu&&!eA?ev=$.intl.string($.t.J5a0eb):eu&&eA?ev="":(0,U.ys)(eo.id)&&(ev=U.Ay.getBillingReviewSubheader(null,eo));let eg=null!=ei&&ei.length>0&&(null==er||null===V)&&el?W.fU.SELECT_PAYMENT_METHOD:void 0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.k,{location:"PremiumSubscriptionReview",paymentSourceId:er}),(0,l.jsxs)("div",{children:[(0,l.jsx)(W.je,{paymentRestrictionBannerType:eg}),null!=I&&(0,l.jsxs)("div",{className:J.Je,children:[(0,l.jsx)(d.m,{size:"custom",color:u.A.unsafe_rawColors.YELLOW_300.css,width:20,height:20}),(0,l.jsx)(p.E,{className:J.CJ,variant:"text-sm/normal",children:I})]}),eE&&(0,l.jsx)("div",{className:J.Ni,children:(0,l.jsx)(m.w,{type:"info",children:(0,l.jsx)(p.E,{variant:"text-sm/medium",children:(0,b.Nn)()})})}),ef,en&&(0,l.jsxs)("div",{children:[(0,l.jsx)(M.P,{planSkuId:eo?.skuId,referralTrialOfferId:g}),(0,l.jsx)(H.$p,{disabled:D,planOptions:et,selectedPlanId:t,planGroup:n,subscriptionPeriodEnd:ee,showTotal:!1,priceOptions:eI,handleClose:w}),(0,l.jsx)(Y.pK,{})]}),!R&&""!==ev&&(0,l.jsx)(h.D,{variant:"heading-md/semibold",className:J.wx,children:ev}),eA&&null!=Q&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(B.A,{defaultAnimationState:k.oA.LOOP,giftStyle:Q,shouldAnimate:!0,className:J.Os}),(0,l.jsx)(K.Z,{giftRecipient:q})]}),eT,(0,l.jsxs)("div",{className:J.LC,children:[(0,l.jsx)(L.K,{label:$.intl.string(R?$.t["YH7B+D"]:$.t["mmDvV+"]),handlePaymentSourceAdd:o,isTrial:R,isDiscount:j,disabled:D,hasEntitlements:ey,eligiblePaymentGateways:ei,shouldUseUnifiedCheckoutUI:!1,paymentSourceDropdownClassName:a()({[J.E4]:eC}),paymentSourceDropdownPrependOption:ey&&!R?{label:$.intl.string($.t.IGU7El),value:null}:null}),null!=eP?(0,l.jsx)("div",{className:J.QN,children:eP}):null]}),(0,l.jsx)(F.A,{isActive:P,ref:y,children:(0,l.jsx)(C.A,{onChange:E,forceShow:!0,finePrint:_??(0,l.jsx)(A.A,{hide:R||j,subscriptionPlan:eo,renewalInvoice:ep,isGift:eu,paymentSourceType:V,isEmbeddedIAP:G,basePrice:(0,U.y8)(eo.id,!1,eu,eI),willRelocateStoreCountry:null!=eS}),showPricingLink:eo.currency!==z.Yr.USD,showWithdrawalWaiver:eN,disabled:D,isTrial:R&&null==_,isDiscount:j,subscriptionPlan:eo,isGift:eu})})]})]})}}