PageSourceSearch

https://shop.jnf.org/cdn/shopifycloud/checkout-web/assets/c1/PaymentErrorBanner.CpfGIpPc.js

js jnf.org collected 2026-09-24 17:40:39 UTC 5,946 bytes, 1 lines download raw bytes

1import{h as X,u as f,f as me,T as q,A as z}from"./esnext-vendor.BBoIVOQW.js";import{W as _e,e as he,bC as c,A as Pe,bD as Ee,f as fe,bE as ve,bF as ge,bG as be,bH as Se,bI as Ae,bJ as Me,bK as Ce,bL as Re,bM as Ie}from"./hydrate.Tsur0pib.js";import{T as v,a5 as K,b3 as Te,ca as j,o as N,cb as Ve,a4 as Oe,cc as Ne,_ as J,aX as Be,cd as Le,aq as Fe,ah as De,ag as Ye,ce as we,cf as Ge,cg as He,ch as Ue,ci as ke,cj as xe,ck as We,W as Qe,cl as qe,cm as Je,cn as Xe,co as ze,cp as Ke,bf as je,cq as Ze,cr as $e}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{h as ea,a as aa,u as ra}from"./hooks-useGeneralPaymentErrorMessage.D4EkCdRM.js";function ta({bannerId:e,errorType:r,children:t,...n}){const{observability:i}=v(),{tone:y,...p}=n;return X(()=>{i.log("error_log_banner_error_banner_rendered","[Displayed Error] Error banner was rendered",{bannerId:e})},[e,i]),f(_e,{errorType:r,id:e,tone:y,...p,children:t})}function na(){const{checkout:e,i18n:r,shopPay:t}=v(),n=K(),{value:i}=n.paymentMethods,{value:y}=n.managedByMarketsPro,p=Be({managedByMarketsPro:y}),s=me(()=>Te({checkout:e})),g=he(),{value:m}=n.deferredTotal,o=t.session.selectedPaymentMethod.value,b=t.session.paymentMethodOption.value,{hasViolations:S}=c(j),u=o&&N(o)?Ve(o.paymentAttributes.brand):void 0,A=Oe(),_=q(()=>{if(b?.name!=="SHOPIFY_INSTALLMENTS"){if(A.value||!o||g.value&&!m?.amount.amount)return!0;if(N(o)){if(S)return!1;const h=i?.filter(l=>l.type==="direct").flatMap(l=>l.paymentBrands);if(h&&h.length>0){const l=Ne(o.paymentAttributes);return l?h.includes(l):void 0}}return J(o)?oa(s.value,p,i):!0}},[b?.name,A.value,o,g.value,m?.amount.amount,S,i,s.value,p]),R=q(()=>{if(o&&_===!1){if(N(o))return u?r.translate("payment.brand_not_available",{brand:u}):r.translate("payment.generic_incorrect_card_info");if(J(o))return s.value?r.translate("payment_errors.payment_method_unavailable_with_subscriptions"):r.translate("payment.shop_pay_ideal_unavailable_error")}},[_,o,u,r,s.value]);return{paymentMethods:i,isSelectedPaymentMethodSupported:_,notSupportedError:R,label:u}}function oa(e,r,t){return!e&&r&&t?.some(n=>Le(n,["ideal"]))}function sa(e){const{i18n:r}=v();if(e&&e.code!=="SURVEY_EXITED")return r.translate("hsa_qualification_errors",{scope:e.code.toLowerCase()})}function ia(){const{i18n:e,checkout:r,embed:t,shop:n,shopPay:i}=v(),{delegatedPaymentInstrument:y,inventoryRecoverySignal:p}=Fe(),{lastJourneyProgression:s}=De(),{progressing:g}=fe(),{walletUsedForSubmissionSignal:m,inMemoryApplePayParts:{asPaymentMethod:o},receiptErrorSignal:b}=Ye(),{paymentMethods:S}=K(),{notSupportedError:u}=na(),{hasViolations:A,violations:_}=c(j),{hasViolations:R}=c(we),{hasViolations:h}=c(Ge),{hasViolations:l}=c(He),{hasViolations:Z}=c(Ue),{violations:B}=c(ke),$=!(s.value.type==="success"||s.value.type==="error"?s.value.negotiationStage==="completion":!1)&&B.size===1&&B.values().next().value.code==="PAYMENTS_METHOD",{hasViolations:ee}=c(xe),I=ve(),{hasError:ae,error:M}=ge(We),{hasError:re,error:te}=be(),{hasError:L}=Se(),{hasError:ne}=Ae(),F=Me(M?{type:"payment",code:M}:void 0),D=sa(te),C=Qe(),oe=C.generalPaymentError.value,P=C.generalPaymentErrorCode.value,se=ea(C.directPaymentErrors),Y=aa(C.directPaymentErrors),d=z(!1),ie=Ce(),w=ra(oe,P),G=w&&!qe(P)&&!Je(P)&&!Xe(P)&&!ze(P),H=e.translate("order_errors.inventory_reservation_failure"),{hasViolations:U}=Re($e),le=!!Ke(S.value).length,ce=je("billingAddress").value,ue=Ie().value,de=m.value==="APPLE_PAY"||ue,pe=M==="INCORRECT_CVC"&&i?.session.selectedPaymentMethod.value?.paymentMethod==="CREDIT_CARD",T=n.hasFlagEnabled(Ze),V=T?p.value:void 0,k=V!=null&&V.receiptId===r.latestReceipt.value?.id,x=s.value.type==="failed"&&s.value.negotiationStage==="completion",W=!!(G||Y||I||x),O=k&&!V.dismissed&&!W;if(g.value)return{message:void 0,tone:"auto"};let a,E="critical";if(t&&r.configuration.isPaymentInstrumentsDelegationEnabled&&y.value&&U&&!ce&&(a=e.translate("payment_errors.payment_method_billing_address")),G&&(d.current=!0,E="warning",a=w),I&&(d.current=!0,a=I),(se||Y&&(d.current||T&&L))&&(a=e.translate("payment.generic_incorrect_card_info")),ae&&M&&F&&!
1d.current&&m.value!=="GOOGLE_PAY"&&(!de||o.value)&&!b.value&&!ie&&!pe&&(a=F),x&&s.value.type==="failed"&&(s.value.fetchFailed?a=e.translate("order_errors.network_failure"):s.value.reason==="decision_rule_block"?a=e.translate("payment_errors.generic_error"):a=e.translate("order_errors.creation_failure")),ne&&!d.current&&(a=e.translate("order_errors.creation_failure")),L&&(!T||!W)&&(k?O:!d.current)&&(a=H,O&&(E="critical")),re&&D&&!d.current&&(a=D),ee&&(a=e.translate("store_credit_errors.generic_error")),R&&(a=e.translate("payment.expired_payment_method")),A){const Q=[..._][0]?.nonLocalizedMessage?.split(":")[1]?.toLowerCase().trim();Q?a=e.translate("payment.brand_not_available",{brand:e.translate("payment_brand",{scope:Q})}):a=e.translate("payment.generic_incorrect_card_info")}l&&(a=e.translate("payment.generic_incorrect_card_info")),Z&&(a=e.translate("payment_errors.method_not_available")),h&&(a=e.translate("payment_errors.generic_error")),$&&(a=e.translate("payment_errors.available_methods_updated"),E="info"),u&&(a=u,E="critical"),le&&U&&(a=e.translate("address_management.invalid_billing_address_selected"));const ye=O&&a===H?r.latestReceipt.value?.id:void 0;return{message:a,tone:E,inventoryRecoveryReceiptId:ye}}function la({message:e,tone:r,inventoryRecoveryReceiptId:t}){const{observability:n}=v(),i=z(!!t).current;return X(()=>{t&&n.counter({name:"inventory_recovery_error_banner_displayed",value:1})},[t,n]),f(ca,{identifier:"PaymentErrorBanner",tone:r,suppressAutoFocus:i,children:e})}function ha(){const e=ia();return e.message?f(la,{...e}):null}function ca({children:e,identifier:r,tone:t,suppressAutoFocus:n=!1}){return t==="critical"||t==="warning"?f(ta,{errorType:Pe.PaymentError,bannerId:r,tone:t,autoFocus:!n,focusable:n,children:e}):f(Ee,{tone:t,children:e})}export{ta as E,ha as P,na as a,la as b,ca as c,ia as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.