Build 573682stable
Module 735305
2,336 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{x:()=>T});var i=n(284009),r=n.n(i),s=n(976634),a=n(446044),o=n(426398),l=n(211083),u=n(463376),d=n(21713),c=n(650170),_=n(61299),h=n(174459),f=n(723702),E=n(937008),p=n(166532),m=n(566980),g=n(615310),A=n(652215),I=n(202541);function T(e){let{analyticsData:t,initialPlanId:n,breadcrumbSteps:i,handleStepChange:T,onReturn:S,continueSessionToInitialStep:N}=e,{paymentSources:C}=(0,o.jm)(),{selectedSkuId:y,setPurchaseState:v,contextMetadata:R,paymentSourceId:O,setPaymentSourceId:b,purchaseError:L,setPurchaseError:D,activeSubscription:P}=(0,c.t4)(e=>({selectedSkuId:e.selectedSkuId,setPurchaseState:e.setPurchaseState,contextMetadata:e.contextMetadata,paymentSourceId:e.paymentSourceId,setPaymentSourceId:e.setPaymentSourceId,purchaseError:e.purchaseError,setPurchaseError:e.setPurchaseError,activeSubscription:e.activeSubscription})),{purchaseErrorBlockRef:w}=(0,d.Gm)(),{paymentAuthenticationState:M}=(0,l.o)(),{enabled:x}=(0,a.Y)({location:"PaymentModalAddPaymentStep"}),{isPremiumGroupPurchase:U,isEligibleForTrial:k}=(0,u.i)(),{step:G,previousStep:V}=(0,g.Ay)(),{isGift:F}=(0,E.Pv)(),B={...(0,_._V)(),paymentSources:C,paymentSourceId:O,setPaymentSourceId:b,purchaseError:L,setPurchaseError:D,purchaseErrorBlockRef:w,paymentAuthenticationState:M,selectedSkuId:y,isGift:F},j=S??function(){T(Object.values(C).length<1&&null==n?p.pn.PLAN_SELECT:p.pn.REVIEW,{trackedFromStep:x?p.pn.PAYMENT_ELEMENT:p.pn.PAYMENT_TYPE})};r()(G,"Step should be set here");let H=(0,s.A)(()=>Date.now(),[G]),W=(0,s.A)(()=>null!=N&&null==V?x?p.pn.PAYMENT_ELEMENT:N:x?p.pn.PAYMENT_ELEMENT:p.pn.PAYMENT_TYPE,[N,V,x]);return(0,_.Y)({paymentModalArgs:B,initialStep:W,prependSteps:[p.pn.PROMOTION_INFO],appendSteps:[p.pn.REVIEW,p.pn.CONFIRM],breadcrumpSteps:i,currentBreadcrumpStep:G,usePaymentModalStep:!0,analyticsData:t,onReturn:U?void 0:j,onComplete:e=>{p.l_.has(e)?(v(m.h.COMPLETED),T(p.pn.CONFIRM,{trackedFromStep:e})):T(p.pn.REVIEW,{trackedFromStep:e})},onStepChange:e=>{let{currentStep:n,toStep:i}=e,r=Date.now();h.default.track(A.HAw.PAYMENT_FLOW_STEP,{...t,from_step:n,to_step:i,step_duration_ms:r-H,flow_duration_ms:r-R.startTime})},isEligibleForTrial:k,allowDesktopRedirectPurchase:(0,f.isDesktop)()&&null!=y&&[I.pe.TIER_0,I.pe.TIER_2].includes(y)&&!F&&null==P,continueSessionToInitialStep:N,shouldUseManaModal:!0})}}