PageSourceSearch

https://shopping.newhollandbrew.com/cdn/shopifycloud/checkout-web/assets/c1/page-Payment.DUXBHSF1.js

js newhollandbrew.com collected 2026-09-24 17:38:15 UTC 11,745 bytes, 1 lines download raw bytes

1import{u as e,k as C,f as bt,h as vt,p as Ct,S as f,i as m,T as _t,A as Et,q as Rt}from"./esnext-vendor.BBoIVOQW.js";import{u as Mt,T as Ft,S as kt,b as At,G as wt,c as Tt,d as Bt,D as Dt,e as zt}from"./useAddressMutationsWithNegotiation.CQZ3NdoZ.js";import{L as It,P as Lt,R as xt,u as Ht,S as Nt}from"./RememberMeSection.CAvXhS1Q.js";import{A as c,L as Ot,W as d,cL as Wt,J as Ut,f as Vt,cM as qt,c2 as Gt,v as Kt,bK as Yt,bJ as Jt,cN as Qt,q as S,_ as $t,m as jt,N as Xt,U as l,cO as Zt,Y as F,k as x,n as ea,by as H,cP as ta,b as aa,P as ra,Q as na,I as sa,l as ia,cQ as le,H as oa,K as la,M as ca,cE as da}from"./hydrate.Tsur0pib.js";import{u as he,a as ye,V as ua,b as ma,c as pa,d as ha,e as ya}from"./components-PaymentMethodProgressionHost.CYFvVPub.js";import{a as Pa,u as ga,b as fa}from"./hooks-useGeneralPaymentErrorMessage.D4EkCdRM.js";import{u as Sa}from"./components-RedirectionNotice.module.qsrQCJ0v.js";import{B as ba}from"./BillingAddressSelector.DUqZsdpg.js";import{C as va}from"./Captcha.CzAUNpY9.js";import{M as Ca}from"./hooks-useShopPayNewSignupLoginExperiment.CXtCCSeF.js";import{u as _a,S as ce,b as Ea,d as Ra,c as Ma,P as Fa,a as ka}from"./Page.B9pV9lua.js";import{u as Aa,P as wa,R as Ta,a as Ba,V as Da,S as za}from"./PaymentButtons.yQkz3rTh.js";import{P as de}from"./hooks-useWalletsTimeout.BmMXm9Gc.js";import{T as O,a5 as ue,bZ as Ia,aq as La,ah as N,cW as xa,aj as Ha,W as me,m as Na,cX as Oa,bW as Wa,cl as Ua,as as Va,ai as qa,cY as Ga,ap as Ka,b8 as pe}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{I as Ya}from"./ImpressionEventCapture.IVS9ZWTI.js";import{K as Ja}from"./KnownBuyerPaymentMethodSelector.ChqahkS_.js";import"./app.CUBUOQtX.js";import"./amazon-pay-useAmazonPayPaymentLine.CMgi35Fb.js";import"./PaymentIcon.CEAvn1dM.js";import"./PaymentLine.DOb0V3pD.js";import"./shop-pay-installments-types._vopm3yK.js";import"./localization-index.P2wbDjPJ.js";import"./Theme-ThemeOverride.DLuOqK2F.js";import"./IncentiveBadge.DttARc72.js";import"./Choice.18syyoW7.js";import"./Checkbox.dqdh-9I_.js";import"./hooks-useUpdateCheckoutAddress.8zTRFnp4.js";import"./hooks-useShopPayExternalAppContext.YLtTu3k6.js";import"./helpers-derivations.f29j39ws.js";import"./redemption-promotions.C4GFMar5.js";import"./graphql-PaymentSessionMutation.KqKA7ogg.js";import"./payment-usePaymentExemptionReason.lTG2U3gh.js";import"./helpers-credit-card-disabled.CM3LQmkz.js";import"./shop-pay-normalizeBuyerDetails.z6w6H1D3.js";import"./hooks-useShopPayProgressIntercepts.CTuACx9_.js";import"./proposal-delegated-payment-instrument.D8Rq5lsx.js";import"./hooks-useShowShopPayOptin.BPTq9EIX.js";import"./AddressPresenter.Ce4uWLSc.js";import"./shared-permissions.DW7FOCqf.js";import"./Section.CfudEpRb.js";import"./ChangeCompanyLocationLink.a6EWibK9.js";import"./BillingAddressForm.BMqAGUql.js";import"./shipping-methods-grouping.S_i1LuzE.js";import"./PhoneField.D8EvZ0Pm.js";import"./hooks-useSuppressShopPayModalOnLoad.CwH45iIp.js";import"./PayButton-helpers.Xs3mcmMx.js";import"./ShopPayCaptcha.C5fpu37T.js";import"./PaymentErrorBanner.CpfGIpPc.js";import"./cross-border-hooks.BN4C-Hww.js";import"./hooks-usePaypalRowEffects.DxXBLDNF.js";function Qa(){const{i18n:a,shop:{developmentShop:n},url:r}=O();return n?e(d,{errorType:c.PaymentError,tone:"warning",children:a.translate("payment_errors.development_store_with_order_limit",{development_store_order_testing_docs_link:e(Ot,{href:r.developmentStoreOrderTestingDocs(),children:a.translate("payment_errors.development_store_order_testing_docs_link")})})}):null}const y=a=>e(F,{children:a});function $a({hostedFieldsLoaded:a,children:n}){const{i18n:r,shop:s,source:u,checkout:o,observability:_}=O(),{giftCardsEnabled:k,discountCodesEnabled:p,acceptTipPayments:h}=s,{configuration:b}=o,i=o.latestReceipt.value,Pe=Wt(),ge=p&&Pe.value,{nextPage:P,previousPage:A}=Ut(),[fe,Se]=C(!1),[be,W]=C(!1),[ve,Ce]=C(!1),_e=u.type==="simulated",U=ue().buyerIdentity.value?.purchasingCompany,E=!!U,Ee=u.type==="draftOrder",V=E&&Ee,Re=Ia(),{cartLineChangeLoadingSignal:Me}=La(),Fe=Me.value,[q,w]=C(!1),[G,ke]=C(),{negotiate:K,progress:Ae,progressing:we}=Vt(),Y=N().isBlocked.value,Te=xa(),T=Ha(),J=ue(),Q=J.paymentMethods,Be=E&&!o.isShippingRequired.value,De=Aa(),R=!Te.value||T.value,{billingAddressOption:ze,directPaymentErrors:Ie,generalPaymentError:$,generalPaymentErrorCode:j,paymentLines:{value:v}}=me(),Le=Na({shop:s,checkout:o,paymentMethods:Q?.value}),xe=v.some(t=>t.method.type==="wallet"||t.method.type==="walletsPlatformPaymentMethod"),He=!R&&o.isShippingRequired.value&&!xe&&ze.value==="shipping"?!1:Oa({lines:v,paymentMethods:Q?.value,purchasingCompany:!!U,isBillingAddressForced:!Le})||!R,X=me().localizationExtensions.value,{value:Ne}=Wa(),Oe=Ne.length!==0,Z=R&&Oe||!R,B=v.some(t=>t.method.type==="direct"),{displayedPaymentMethods:We}=he({experienceType:"list"}
1),Ue=ye(We).mode==="knownBuyerShared",Ve=qt().value,qe=Gt(),Ge=Kt({isPayWithPayPalButton:!0}).value.status==="error";Mt();const Ke=J.managedByMarketsPro,ee=Y||_e&&P.id!=="review"||qe.value&&Ge||Fe,{lastJourneyProgression:Ye}=N(),Je=async()=>{if(!ee){w(!0);try{await Ae("payment-form-submit",t=>{const M=t.status==="failed",L="receipt"in t&&t.receipt?.status==="failed"&&t.receipt?.failure?.type==="order",St=t.status==="success"&&"receipt"in t&&t.receipt.status==="failed";w(!1),Ce(t.status==="fetch_failed"),W(M||L),Se(St)})}catch(t){t instanceof Error&&ke(t)}finally{w(!1)}}},D=Yt(),Qe=bt(()=>Pa(Ie)),z=i?.status==="failed",g=z&&i?.failure.type==="payment"?i.failure:void 0,te=g?.code==="AUTHENTICATION_ERROR",$e=z&&i?.failure?.type==="inventory"?i.failure:void 0,je=ve,Xe=!!(be||z&&i?.failure?.type==="order"),Ze=g!=null&&!te,et=Jt(g),tt=$.value&&!Ua(j.value),at=ga($.value,j.value),rt=r.translate("payment.title"),nt=r.translate("general.pay_now_button_label"),st=o.configuration.layout.isOnePage.value,it=Qt(),ot=i?.status==="failed"&&i.failure.type==="payment"&&i.failure.code==="GENERIC_ERROR"&&v[0]?.method.type==="walletsPlatformPaymentMethod"&&v[0]?.method.name===Va.AmazonPay;_a({stage:B&&!a?ce.Usable:ce.Complete,id:"Payment"}),qa("payment");const ae=!!g,re=i?.id,ne=!!(g&&Ga.has(g.code));if(vt(()=>{if(!(D||!ae||E)){if(ne){_.log("payment_form_skip_negotiate_captcha","[PaymentForm] Skipped negotiate for CAPTCHA_REQUIRED receipt — handled by useHandleReceipt",{receiptId:re});return}(async()=>await K({silenceViolations:["all"],fieldsToResolve:["paymentLines"]}))()}},[ae,D,E,K,_,ne,re]),G)throw G;const lt=S("Checkout::Dynamic::Render","PAYMENT1"),se=S("Checkout::Dynamic::Render","PAYMENT2"),ie=S("Checkout::Dynamic::Render","PAYMENT3"),oe=S("Checkout::Dynamic::Render","PAYMENT4"),ct=S("purchase.checkout.payment-method-list.render-before"),dt=S("purchase.checkout.payment-method-list.render-after"),ut=b.visibility.showReductions,mt=Ka(),pt=$t({base:!0,medium:!1}),ht=!mt.value||pt;let I=null;b.visibility.showAside?ht&&(I=e(oa,{above:"small",children:e(le,{headerLevel:1,monorailSection:"payment"})})):I=e(le,{headerLevel:1,monorailSection:"payment"});const yt=ut&&!V&&(k||p)?I:null,Pt=V||Re.value?!1:h&&!pe(u),gt=Ke.value&&Z&&P.id!=="review",ft=q||we.value;return Ct(()=>{Ye.value.type==="failed"&&W(!0)}),e(f,{children:[e(jt,{children:rt}),e(Xt,{onSubmit:Je,disabled:q||Y,implicitSubmit:nt,children:e(Ea,{children:[e(Ra,{children:[e(l,{customizations:lt,render:y}),e(ja,{genericPaymentError:Ze,shouldSuppressReceiptError:D,inventoryReservationFailure:$e,isAmazonPaymentDeclineScenario:ot,networkFailure:je,orderFailure:Xe,paymentErrorMessage:et,processingFailed:fe}),e(Qa,{}),yt,Pt?e(f,{children:[e(Zt,{sectionId:"tips",children:e(Ft,{renderInSection:!0,headingLevel:1})}),e(l,{customizations:se,render:y})]}):null,X.length>0&&e(f,{children:e(F,{accessibilityLabel:r.translate("localized_fields.additional_information.title"),children:e(x,{gap:"base",children:[e(ea,{id:`${H}-localized-fields`,level:1,children:r.translate("localized_fields.additional_information.title")}),X.map((t,M)=>{const L=`${t.value.key}${M}`;return e(It,{localizationExtension:t,index:M},L)})]})})}),e(f,{}),e(F,{accessibilityRole:"group",accessibilityLabelledBy:H,children:e(x,{gap:"base",children:[e(Lt,{headingId:H,autoFocus:!st}),e(m,{when:b.visibility.showStoreCreditRedemption,children:e(kt,{})}),tt?e(d,{errorType:c.PaymentError,tone:"critical",children:at}):null,e(m,{when:Qe,children:e(d,{errorType:c.PaymentError,tone:"critical",children:r.translate("payment.generic_incorrect_card_info")})}),te?e(d,{errorType:c.PaymentError,tone:"critical",children:r.translate("payment_errors.three_d_secure_failed")}):null,e(l,{customizations:ct}),e(m,{when:b.visibility.showStoreCreditRedemption,children:e(At,{})}),n,e(l,{customizations:dt}),e(m,{when:De,children:e(va,{})})]})}),e(wt,{}),h?e(l,{customizations:ie,render:y}):e(l,{customizations:se,render:y}),He&&(o.isShippingRequired.value||pe(u)||Be)&&!it.value&&!(Ue&&B)?e(ba,{}):null,h?e(l,{customizations:oe,render:y}):e(l,{customizations:ie,render:y}),e(xt,{compact:!0}),!h&&e(l,{customizations:oe,render:y}),Ve&&!B?e(F,{children:e(ua,{})}):null,e(m,{when:T,children:e(de,{placement:"default",wrapInSection:!0}
1)}),e(m,{when:b.visibility.showPurchaseOrderNumberField,children:e(ma,{})})]}),gt&&e(Ca,{}),e(wa,{}),ge&&e(ta,{targetSelector:'input[name="reductions"]',icon:"discount",label:r.translate("order_summary.discount_discovery.add_code")}),e(m,{when:T,children:e(de,{placement:"above-pay-button"})}),e(Ma,{children:[e(Fa,{children:[e(Ta,{children:e(Ba,{disabled:!Z||ee,loading:ft,defaultLabel:P.label,pixelId:"go_to_next_step"})}),P.notice?e(f,{children:[e(aa,{blockSize:"small-200"}),e(ra,{textAlign:"center",color:"subdued",type:"small",children:P.notice})]}):null]}),A.route?e(ka,{children:e(na,{href:A.route,variant:"plain",inlineSize:"fill",textDecoration:"none",pixelId:"go_to_previous_step",children:e(x,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(sa,{type:"chevron-left",size:"small"}),e(ia,{children:A.label})]})})}):null]}),P.id==="review"?null:e(f,{children:[e(Da,{}),e(za,{})]})]})})]})}const ja=({orderFailure:a,inventoryReservationFailure:n,isAmazonPaymentDeclineScenario:r,genericPaymentError:s,processingFailed:u,shouldSuppressReceiptError:o,paymentErrorMessage:_,networkFailure:k})=>{const{i18n:p}=O(),{lastJourneyProgression:h}=N();return r?null:(s||u)&&!o?e(d,{errorType:c.PaymentError,tone:"critical",children:_}):k?e(d,{errorType:c.PaymentError,tone:"critical",children:p.translate("order_errors.network_failure")}):n?e(d,{errorType:c.PaymentError,tone:"critical",children:p.translate("order_errors.inventory_reservation_failure")}):a?h.value.type==="failed"&&h.value.reason==="decision_rule_block"?e(d,{errorType:c.PaymentError,tone:"critical",children:p.translate("payment_errors.generic_error")}):e(d,{errorType:c.PaymentError,tone:"critical",children:p.translate("order_errors.creation_failure")}):null};function Xa(){const a=Tt({enableAutoSelect:!1}),{expandedSlot:n}=Bt(a);return e(Ja,{msiSlot:n,hideChoiceListChrome:!1,detailsPresentation:"boxed"})}function Za(){const{displayedPaymentMethods:a}=he({experienceType:"list"}),n=ye(a),r=_t(()=>a.map(s=>"name"in s?s.name:s.type),[a]);return n.mode==="knownBuyerShared"?e(Ya,{impressionType:"payment",impressionFeatures:pa(r,n),children:e(Xa,{})}):e(ha,{})}function Zr(){const a=Et(!1),n=Ht(),r=fa(),{postPurchaseEnabled:s}=Sa(),u=Rt(()=>{a.current=!0},[]);return e(da,{target:"cart.paymentLines[0]",children:[e(la,{section:"payment",children:e(ca,{section:"payment",children:e($a,{hostedFieldsLoaded:a.current,children:e(Dt,{blurValidationEnabled:!0,onSetFieldErrors:r,onLoadSuccess:u,children:[e(er,{}),e(Za,{}),e(m,{when:n,children:e(Nt,{})})]})})})}),s&&e(zt,{})]})}function er(){return ya(),null}export{er as PaymentMethodCustomizations,Zr as default};

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.