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