Loading
function(e,t,n){"use strict";n.d(t,{dL:()=>X,Ay:()=>en,oO:()=>ee}),n(321073);var l=n(627968),i=n(64700),s=n(575593),r=n(403581),a=n(278416),o=n(262427),u=n(376843),c=n(38785),d=n(214891),m=n(270537),h=n(241989),p=n(993408),f=n(287809),g=n(486020),E=n(428262),A=n(580630),C=n(284009),x=n.n(C),I=n(997101),_=n(17928),S=n(318254),y=n(821891),v=n(953689),T=n(10716),N=n(46225),j=n(20015),b=n(364995),R=n(31823),P=n(426398),L=n(427675),M=n(211159),O=n(977445),w=n(778307),k=n(218075),D=n(118982),U=n(615405),G=n(45938),F=n(937008),V=n(566980),B=n(818824),H=n(944355),W=n(367921),K=n(652215);function Y(e){let{paymentSourceType:t}=e,{isGift:n}=(0,F.Pv)(),{immediateDelivery:i}=(0,B.U)(),s=(0,W.Ro)({purchaseType:K.VVm.ONE_TIME,plan:null,premiumSubscription:null,isGift:n,planGroup:[],isPrepaidPaymentSource:!1});return(0,l.jsx)(H._P,{variant:n?{type:H.I0.GiftShop,purchaseButtonText:s}:{type:H.I0.Shop,purchaseButtonText:s},paymentSourceType:t,immediateDelivery:i})}var z=n(375708),Z=n(666995),q=n(319820),$=n(327105),J=n(594387);let X=e=>e.name,Q={[s.R.BUNDLE]:()=>z.intl.string($.default["jM8/71"]),[s.R.AVATAR_DECORATION]:()=>z.intl.string($.default.r29Oel),[s.R.PROFILE_EFFECT]:()=>z.intl.string($.default.eTYAvF),[s.R.NAMEPLATE]:()=>z.intl.string($.default.of9bom),[s.R.PROFILE_FRAME]:()=>z.intl.string($.default.HzDn6w)},ee=e=>{let t=z.intl.string($.default.iZe9Wy);if(null==e);else if(e.type in Q)return(0,Q[e.type])();return t},et=e=>{let{application:t,sku:n,invoicePreview:s,paymentMethodContent:u,legalContent:C,isGift:x,giftRecipient:I,upperInlineNoticeProps:_,footerInlineNoticeProps:y}=e,{product:v,isSocialLayerGameItem:T}=(0,q.AO)({sku:n}),{unifiedInvoiceSummaryProps:N,priceText:j}=i.useMemo(()=>(e=>{let{sku:t,invoicePreview:n}=e,l=[];if(null!=n){let{discount:e,basePrice:i,showTaxes:s}=(0,q.yh)({invoicePreview:n});return l.push({id:"sku",label:X(t),amount:i}),null!=e&&l.push({id:"discount",label:e.description,amount:e.amount>0?-1*e.amount:e.amount}),s&&l.push({id:"tax",label:z.intl.string(z.t["/I8zmP"]),amount:n.tax}),{unifiedInvoiceSummaryProps:{lineItems:l,label:z.intl.string($.default.eoXh7B),currency:n.currency},priceText:(0,A.$g)(i,n.currency),discount:e}}return{unifiedInvoiceSummaryProps:null,priceText:"",discount:null}})({sku:n,invoicePreview:s}),[n,s]),b=i.useMemo(()=>null!=N?(0,l.jsx)(m.Vm,{...N}):null,[N]),R=i.useMemo(()=>(e=>{let{sku:t,product:n,application:i,isSocialLayerGameItem:s,giftRecipient:o}=e,u=z.intl.string($.default.iZe9Wy);s?u=z.intl.string($.default.qwSlCO):null!=n?u=ee(n):t.productLine===K.EZt.GUILD_PRODUCT&&(u=z.intl.string($.default.hewwdA));let c=s?{header:i.name,headerIconSrc:g.Ay.getApplicationIconURL({id:i.id,icon:i.icon,size:16})}:{},d=(0,l.jsx)(h.WH,{sku:t,product:n}),m={};return null!=n&&(m=(e=>{let t=f.default.getCurrentUser(),n=E.Ay.canUseShopDiscounts(t),l=(0,p.xM)(t),i=(0,p.WD)(e,{hasShopDiscount:n,discount:(0,p.fT)(e,n)});if(null!=i&&!i.showDefaultPriceOnly&&i.showDiscountPrice){if(l===p.D0.NITRO)return{PriceIcon:r.t,priceTooltip:z.intl.string($.default.YUNJJa)};if(l===p.D0.THIRDPARTY)return{PriceIcon:a.g,priceTooltip:z.intl.string(J.default.DePOcS)}}return{}})(n)),{...c,...m,label:X(t),description:u,graphic:d,target:null!=o?{type:"gift",user:o}:void 0}})({sku:n,product:v,application:t,isSocialLayerGameItem:T,giftRecipient:I}),[n,v,t,T,I]),[P,L]=i.useMemo(()=>[z.intl.string($.default.Zxav97),null!=s?(0,A.$g)(s.total,s.currency):void 0],[s]),M=i.useMemo(()=>{let e=((e,t)=>{let{productLine:n,isGift:l}=t;if(null==e)return null;let i=e.orbsReward;if(null!=i&&i>0){let e=l?z.t["ZV+aS9"]:z.t["0StwHe"];return{Icon:S.C,text:z.intl.format(e,{orbCount:i}),gradientColor:n===K.EZt.SOCIAL_LAYER_GAME_ITEM?"green":"default"}}})(s,{productLine:n.productLine,isGift:x});return null!=e?(0,l.jsx)(o.J,{...e}):null},[s,x,n.productLine]),{setHeaderBadgeText:O,unsetHeaderBadgeText:w}=(0,d.v)();return i.useEffect(()=>(null!=M&&O(z.intl.string($.default.Fjpyfj)),()=>{w()}),[M,O,w]),(0,l.jsx)(c.T,{shouldShowGlobalNotices:!0,purchaseItemContent:(0,l.jsx)(h.f7,{...R,price:j}),invoiceSummaryContent:b,paymentMethodContent:u,legalContent:C,promotionalNoticeContent:M,upperInlineNoticeProps:_,footerInlineNoticeProps:y,invoiceTotalDueLabel:P,invoiceTotalDueValue:L})};function en(e){let{hasLegalTermsFlash:t,legalTermsNodeRef:n,handlePaymentSourceAdd:s}=e,{sku:r,application:a,invoicePreview:o,isGift:d,eligiblePaymentGateways:m,purchaseTermsAndLegalContent:h,isStepLoading:p,giftRecipient:f,warningAndErrorMessages:g,disabled:E}=(e=>{let{hasLegalTermsFlash:t,legalTermsNodeRef:n}=e,{selectedSkuId:s,setHasAcceptedTerms:r,purchaseState:a,checkoutInvoicePreview:o,paymentSourceId:u,purchasePreviewError:c,purchaseType:d}=(0,M.t4)(e=>({selectedSkuId:e.selectedSkuId,setHasAcceptedTerms:e.setHasAcceptedTerms,purchaseState:e.purchaseState,checkoutInvoicePreview:e.checkoutInvoicePreview,paymentSourceId:e.paymentSourceId,purchasePreviewError:e.purchasePreviewError,purchaseType:e.purchaseType})),{hasPaymentSources:m}=(0,P.jm)(),{application:h,isEmbeddedIAP:p}=(0,R.V)(),f=(0,_.bG)([T.A],()=>T.A.getFetchState()),{checkoutPaymentSources:g,hasInvoiceOrderContextLoaded:E}=(0,b.t)(),A=(0,L.gU)(),{isGift:C,giftRecipient:S}=(0,F.Pv)(),B=C&&(0,G.Ik)(S),{fetched:H,hasAlreadyLinked:W}=(0,N.RD)(h);x()(null!=s,"Expected selectedSkuId");let q=A[s],$=q?.eligiblePaymentGateways;x()(null!=q,"SKU must exist and be fetched."),x()(null!=h,"Application must exist.");let J=(0,O.uS)(h.id),X=I.M.EEA_COUNTRIES.has(U.A.ipCountryCodeWithFallback),Q=a===V.h.PURCHASING||a===V.h.COMPLETED,ee=g.find(e=>e.id===u)??null,et=null!=ee?ee.type:null,en=null!=$&&$.length>0&&(null==u||null===et)&&m?k.fU.SELECT_PAYMENT_METHOD:void 0,el=q.productLine===K.EZt.SOCIAL_LAYER_GAME_ITEM,ei=B&&!el,es=i.useMemo(()=>({testModeWarning:J?z.intl.string(z.t.OvMyMd):null,devShelfError:(0,j.n)(h,K.gfo.EMBEDDED)&&f===T.$.ERROR?z.intl.string(z.t.tAmECt):null,socialLayerGameItemDisclaimer:el&&H&&!W&&!C?(0,D.k3)(h):null}),[J,h,f,el,H,W,C]),er=i.useMemo(()=>q.productLine===K.EZt.COLLECTIBLES?(0,l.jsx)(Y,{paymentSourceType:et}):(0,l.jsx)(w.A,{isActive:t,ref:n,children:(0,l.jsx)(v.A,{onChange:r,forceShow:!0,showWithdrawalWaiver:X,disabled:Q,subscriptionPlan:null,finePrintClassname:Z.i,purchaseType:d,isGift:C,finePrint:(0,l.jsx)(y.A,{paymentSourceType:et,isEmbeddedIAP:p,purchaseType:d,productLine:q.productLine,isGift:C,applicationName:h.name,applicationId:h.id,hasAlreadyLinked:!H||W})})}),[t,n,r,X,Q,d,C,et,p,q.productLine,h.name,h.id,H,W]);return{sku:q,application:h,giftRecipient:S,isGift:C,invoicePreview:o,isEmbeddedIAP:p,shouldShowPurchaseReviewImage:ei,paymentRestrictionBannerType:en,devShelfFetchState:f,isStepLoading:!E&&null==c,purchasePreviewError:c,warningAndErrorMessages:es,purchaseTermsAndLegalContent:er,eligiblePaymentGateways:$,disabled:Q}})({hasLegalTermsFlash:t,legalTermsNodeRef:n}),A=i.useMemo(()=>({paymentGatewayRestrictions:m,shouldUseUnifiedCheckoutUI:!0}),[m]),C=(0,l.jsx)(u.N,{label:z.intl.string(z.t["u+Cw58"]),location:"OneTimeUnifiedCheckoutPurchaseReview",onPaymentSourceAdd:s,additionalPaymentSourceDropdownProps:A,disabled:E}),S=i.useMemo(()=>{let e=[];return null!=g.testModeWarning&&e.push({type:"warning",message:g.testModeWarning,key:"test-mode-warning-notice"}),null!=g.devShelfError&&e.push({type:"critical",message:g.devShelfError,key:"dev-shelf-error-notice"}),e.length>0?e:null},[g.testModeWarning,g.devShelfError]),B=i.useMemo(()=>{let e=[];return null!=g.socialLayerGameItemDisclaimer&&e.push({type:"info",message:g.socialLayerGameItemDisclaimer,key:"social-layer-game-item-disclaimer-notice"}),e.length>0?e:null},[g.socialLayerGameItemDisclaimer]);return p?(0,l.jsx)(c.E,{}):(0,l.jsx)(et,{application:a,giftRecipient:f,isGift:d,sku:r,invoicePreview:o,paymentMethodContent:C,legalContent:h,upperInlineNoticeProps:S,footerInlineNoticeProps:B})}}