Build 576754stable
Module 901930
1,764 characters · in 58c8987c33b44842.js, 331bf8185c686a13.jsDependencies
Source Raw
function(e,t,n){n.d(t,{A:()=>f,j:()=>I});var l=n(627968),r=n(64700),i=n(192308),a=n(349288),o=n(683071),s=n(308528),u=n(913122),c=n(136857),d=n(211083),m=n(655857),E=n(6938),C=n(834981),p=n(975571),h=n(166532),_=n(652215),S=n(375708);function I(e){let{planError:t}=e,{paymentError:n}=(0,d.o)(),{dropdownCurrencies:o}=(0,m.Jn)(),{purchaseError:I,purchasePreviewError:f}=(0,E.t4)(e=>({purchaseError:e.purchaseError,purchasePreviewError:e.purchasePreviewError})),N=null;null!=f?N=f:null!=n&&null==(0,h.ou)(n)?N=n:null!=I?N=I:null!=t&&(N=t);let A=(0,C.vx)(),y=r.useCallback(()=>{(0,i.closeAllModals)(),s.A.openPrivateChannel({recipientIds:A})},[A]),T=o.length>1,g=null!=N?N.message:"";if(null!=N&&N instanceof u.Ey&&(N.code===c.tG.CARD_DECLINED&&T&&(g+=` ${S.intl.string(S.t.iWvwQS)}`),N.code===c.tG.INVALID_GIFT_REDEMPTION_FRAUD_REJECTED&&(g=S.intl.string(S.t.ypuSd8)),N.code===_.t02.BILLING_NON_REFUNDABLE_PAYMENT_SOURCE&&(g=S.intl.string(S.t.mXMmWE)),N.code===c.tG.INVALID_CURRENCY_FOR_PAYMENT_SOURCE&&(g=S.intl.string(S.t.mC1Fjz)),(N.code===c.tG.BILLING_SPENDING_LIMIT_REACHED||N.code===c.tG.BILLING_SPENDING_LIMIT_WILL_EXCEED)&&(g=S.intl.format(S.t["mv/fF2"],{guardianHook:(e,t)=>A.length>0?(0,l.jsx)(a.Anchor,{onClick:y,children:e},t):(0,l.jsx)(r.Fragment,{children:e},t)})),N.code===c.tG.INVALID_BILLING_ADDRESS)){let e=S.intl.format(S.t.BPDKoA,{helpdeskArticle:p.A.getArticleURL(_.MVz.BILLING).concat(_.bNI.INVALID_BILLING_ADDRESS)});g=(0,l.jsxs)(l.Fragment,{children:[S.intl.string(S.t["yVIm/G"])," ",e]})}return{error:N,errorMessage:g}}function f(e){let{planError:t,purchaseErrorBlockRef:n,className:r}=e,{error:i,errorMessage:a}=I({planError:t});return null==i?null:(0,l.jsx)("div",{ref:n,className:r,children:(0,l.jsx)(o.w,{type:"critical",children:a})})}}