1import{k as D,q as v,T as fe,u as e,X as ye,x as ve,A as B,o as _e,G as Se,h as K,f as C,i as h,S as H,Q as Ce}from"./esnext-vendor.7EcvH7tF.js";import{f as E,aG as Ae,eO as Pe,eP as be,bC as V,Z as Ie,k as u,l as I,P as T,$ as k,eQ as ke,bG as Ne,dN as Z,y as Y,m as A,eR as Re,p as N,U as b,eS as De,cZ as Ee,dV as Me,cm as we,eT as Le,d0 as F,B as Te,bW as xe,bX as Oe,bg as Fe,M as ze,V as Be,N as He,O as Ve,eU as Ge,bZ as Ue,K as ee,eV as We,a4 as te,eW as qe,bY as ne,eX as je,cP as $,j as se,I as Ke,L as $e}from"./hydrate.CvWSYK3c.js";import{F as ie}from"./localization-index.8vJFxOS9.js";import{A as Xe,B as Je}from"./BillingAddressForm.BLCoRu_E.js";import{C as Qe}from"./Captcha.uTxdGdBM.js";import{u as Ze,e as oe,P as ae,f as re,g as ce,D as Ye,h as et,i as tt,j as nt,k as st,l as it,m as ot,U as at,V as rt,n as ct,o as dt,E as lt,C as ut}from"./components-VatNumberValidationField.B3PhNjwY.js";import{D as pt}from"./PendingShipping.7OdN0MKO.js";import{b as ht,d as mt,c as gt,a as ft,P as yt}from"./Page.iFMNx-gv.js";import{Q as g,H as vt,S as R,aY as de,ac as _t,es as St,x as Ct,a2 as M,et as At,b5 as Pt,bl as bt,eu as It,ab as kt,ad as Nt,ak as Rt}from"./utilities-previous.BNOUhCqt.js";import{C as x}from"./Choice.CmWf9O2o.js";import{C as G}from"./crypto-constants.wrSwcTv4.js";import{u as Dt}from"./shop-pay-installments-monorail.B28AmH4_.js";import{A as L}from"./AddressPresenter.mAxMJOkn.js";import{C as Et}from"./Checkbox.BcOmMA-W.js";import{C as le,S as Mt}from"./ChangeCompanyLocationLink.D2yMha9m.js";import{S as wt}from"./business-customer-constants.D2XM6iUD.js";import"./app.9pOKhaB_.js";import"./shared-negotiation-input-redeemable.nWvx5Mgl.js";import"./shared-permissions.FyWsJaGm.js";import"./hooks-useShopPayExternalAppContext.DJNBHtP3.js";import"./components-RedirectionNotice.module.wDj6pdp6.js";import"./amazon-pay-useAmazonPayPaymentLine.Dzl9q1le.js";import"./PhoneField.z-nvF4Oi.js";import"./hooks-useSuppressShopPayModalOnLoad.C3rujIgw.js";import"./Popover.snh8_-Id.js";import"./ShopPayCaptcha.BRfpdziH.js";import"./PaymentErrorBanner.CWfF0M8f.js";import"./hooks-useGeneralPaymentErrorMessage.4RHEltgi.js";import"./useShopPayButtonClassName.D12YSXlR.js";import"./addresses-is-address-empty.ChTbY4tb.js";import"./hooks-useShowShopPayOptin.COfgoH5j.js";import"./hooks-useShouldRevealCustomization.xDutk-8T.js";import"./hooks-useForceShopPayUrl.Bj-sC8MR.js";import"./ImpressionEventCapture.DHoHQcSz.js";import"./ShopPayLogo.Cv8_PxcC.js";import"./hooks-useWalletsTimeout.CvRsT5TD.js";import"./hooks-useWalletsMonorailTrack.D-8b2KUL.js";import"./utilities-publishMessage.BFG4jKHA.js";import"./hooks-usePickupPoints.Dc_AUzii.js";import"./TransitionHeight.BQH3tbCb.js";import"./AutocompleteField-hooks.B3HDb4t8.js";const ue=ye(null),Lt=({children:t})=>{const[n,i]=D(void 0),[s,o]=D(void 0),[a,l]=D(void 0),[r,d]=D(void 0),c=v((m,p)=>{i(m),o(p)},[i,o]),y=v((m,p)=>{l(m),d(p)},[l,d]),f=fe(()=>({prefetchTime:n,prefetchAddress:s,negotiateTime:a,negotiateAddress:r,setPrefetchPoint:c,setNegotiatePoint:y}),[n,s,a,r,c,y]);return e(ue.Provider,{value:f,children:t})},Tt=()=>ve(ue);var U=(t=>(t.Autocomplete="PREFETCH_SHIPPING_RATES_ON_AUTOCOMPLETE",t))(U||{});const xt=()=>{const{shop:{id:t},source:{checkoutSessionIdentifier:n,sourceId:i}}=g(),s=n||i||"",o=new Date().valueOf(),a=`${s}-${o}`;return v((r,d,c)=>({schemaId:"prefetching_of_rates_time_gain/2.0",payload:{eventId:a,prefetchingOfRatesProjectName:"prefetch_on_address_autocomplete",prefetchingOfRatesProjectVersion:"v2",shopId:parseInt(vt(t),10),checkoutToken:s,successfulEarlyFetch:c,prefetchingRoutingRequestSubmittedAt:r,normalRoutingRequestSubmittedAt:d}}),[s,t,a])},X=()=>new Date().valueOf(),J=(t,n)=>t.name===n.name&&t.city===n.city&&t.countryCode===n.countryCode&&t.zoneCode===n.zoneCode&&t.postalCode===n.postalCode&&t.address1===n.address1&&t.address2===n.address2&&t.company===n.company&&t.firstName===n.firstName&&t.lastName===n.lastName&&t.phone===n.phone,pe=()=>{const{userEvents:t}=g(),{shippingAddress:n}=R(),i=xt(),s=Tt(),o=v(r=>{const d=X();if(r===U.Autocomplete){const c=n.value;s?.setPrefetchPoint(d,c)}},[s,n]),a=v(()=>{const r=s?.prefetchTime,d=s?.prefetchAddress,c=s?.negotiateTime,y=s?.negotiateAddress;if(r===void 0||d===void 0)return;const f=X(),m=n.value,p=y!==void 0&&!J(m,y);if(!c||p){const _=J(d,m);t.monorailEvent(i(r,f,_)),s?.setNegotiatePoint(f,m)}},[t,s,n,i]),l=v(()=>{a()},[a]);return{capturePrefetch:o,captureNegotiate:l}},Ot=()=>{const{checkout:t,shop:{prefetchShippingRatesEnabled:n}}=g(),s=!t.configuration.layout.isOnePage.value,{negotiate:o}=E(),{capturePrefetch:a}=pe();return v(()=>{s&&n&&(a(U.Autocomplete),o({include:[],silenceViolations:["non-stock"],prefetch:!1}))},[a,o,n,s])};function Ft(){const{negotiate:t}=E(),{shippingAddress:n}=R(),{observability:i,checkout:{wallets:s}}=g(),o=B(!0),a=B(void 0);_e(()=>{const l=s.activeSession.value,r=n.fields.countryCode.value;if(!l){if(o.current){o.current=!1,a.current=r;return}if(r&&r!==a.current){a.current=r;const d=async()=>{await t({fieldsToResolve:["deliveryNext"],negotiationStage:"negotiation"}),i.log("three_page_checkout_shipping_address_country_change_negotiation","Negotiating due to shipping address country change")};Se(()=>{d()})}}})}function W({additionalFieldGroups:t,settings:n,showSavedAddressSelector:i}){const{shippingAddress:s}=R(),{deliveryMethodsAddressErrors:o}=de(),{inMemoryPayPalParts:{accountStatus:a}}=_t(),l=St(),r=Ot(),{shouldGateCrossBorder:d,crossBorderGate:c}=Dt(),y=(_,S,P)=>{d(_)?c(S,{onCancel:P}):S()},{checkout:f}=g(),{availableDeliveryAddresses:m,mustSelectProvidedAddress:p}=f.proposal.negotiated.fields;return Ae(),Ft(),e(Xe,{id:"shippingAddressForm",addressType:"shipping",addressErrors:o,address:s,countries:l,settings:n,additionalFieldGroups:t,loading:a.value.status==="loading",onAddressAutoComplete:r,onBeforeCountryChange:y,availableAddresses:m,mustSelectProvidedAddress:p,showSavedAddressSelector:i})}const zt="business_customer_shipping_address_selector",Q="existing_shipping_address",z="custom_shipping_address";function Bt({existingShippingAddress:t,addressErrors:n}){const{i18n:i}=g(),{shippingAddress:s}=R(),{negotiate:o}=E(),{resetAddressErrors:a}=Pe(n),[l,r]=D(!1),d=be(),c=V(),y=Ct(s.peek(),t),{value:f}=M().deliveryNext,[m,p]=D([y?Q:z]),_=v(async P=>{p(P),r(!0),P[0]===z?s.value={...At,company:""}:s.value=t,await o({fieldsToResolve:["merchandiseLines","deliveryNext"],onComplete(){a(),r(!1)}})}
1,[t,o,s,a]);Ie({active:l});const S=c.value&&(!d.value||!Pt(f));return e(k,{children:e(u,{gap:"base",children:e(G,{name:zt,values:m,onChange:_,hideRadioControl:!S,children:[e(x,{value:Q,children:e(u,{children:[e(I,{type:"strong",children:e(L,{hiddenFields:["address2","phone","company","city","postalCode","zoneCode","countryCode","firstName","lastName"],address:t})}),e(L,{textColor:"subdued",hiddenFields:["phone","company","address1","firstName","lastName"],address:t}),e(L,{textColor:"subdued",hiddenFields:["address2","phone","company","city","postalCode","zoneCode","countryCode","phone","company","address1"],address:t})]})}),S&&e(x,{value:z,selectedContent:e(W,{showSavedAddressSelector:!1}),children:e(u,{children:[e(T,{children:e(I,{type:"strong",children:i.translate("contact.different_shipping_address_label")})}),e(T,{color:"subdued",children:i.translate("contact.different_shipping_address_text")})]})})]})})})}function Ht(){const{i18n:t,checkout:n,persistence:i,source:s}=g(),{setShippingAddressAsDefault:o}=R(),a=n.addressManager.shipping.value;K(()=>{const c=i?.get(bt.SetShippingAddressAsDefault,{scope:It(s)});o.value=c??!1},[]);const l=C(()=>a.canSetDefaultAddress.value&&a.addresses.value.length>0&&a.selectedAddress.value?.default!==!0),r=B(a.selectedAddress.peek()?.id);K(()=>{const c=a.selectedAddress.value?.id;c!=null&&c!==r.current&&(o.value=!1),r.current=c},[a.selectedAddress.value?.id,o]);const d=v(c=>{o.value=c},[o]);return l.value?e(Et,{id:"three_page_set_default_shipping_address",name:"set_default_shipping_address",checked:o.value??!1,onChange:d,label:t.translate("address_management.address_form.default_address")}):null}const Vt=["delivery_methods_company_location_no_address_item"];function Gt(){const t=M().buyerIdentity.value?.purchasingCompany,n=Ze(),i=C(()=>!n.value.isContact);return t?e(Ut,{purchasingCompany:t}):e(H,{children:[e(W,{}),e(Ht,{}),e(oe,{}),e(h,{when:i,children:e(ae,{})})]})}function Ut({purchasingCompany:t}){const{i18n:n,source:i}=g(),{deliveryMethodsAddressErrors:s}=de(),o=V(),a=ke(),l=i.type==="draftOrder",{shippingAddress:r}=R(),d=t.location.shippingAddress,c=l?r.value:d;return c&&a.value?e(Bt,{existingShippingAddress:c,addressErrors:s}):!o.value&&!d?e(u,{gap:"large-200",children:[e(G,{name:"delivery_methods_company_location_no_address",values:Vt,hideRadioControl:!0,children:e(x,{value:"delivery_methods_company_location_no_address_item",children:e(u,{children:[e(I,{children:t.location.name}),e(I,{color:"subdued",children:n.translate("review.blocks.no_address")})]})})}),e(Ne,{tone:"info",children:n.translate("delivery_options.company_location_no_address_banner")})]}):e(W,{showSavedAddressSelector:!1})}const Wt=["selected_pickup_company_location"];function qt(){const{i18n:t}=g(),n=M().buyerIdentity.value?.purchasingCompany,i=n?.location.shippingAddress,s=Z();return n?e(k,{accessibilityLabel:t.translate("company_location.location_title"),children:e(u,{gap:"base",children:[e(Y,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"baseline",gap:"base",children:[e(A,{level:1,children:t.translate("company_location.location_title")}),e(h,{when:s,children:e(le,{})})]}),e(G,{name:"pickup_company_locations_list",values:Wt,hideRadioControl:!0,children:e(x,{value:"selected_pickup_company_location",children:e(u,{children:[e(I,{children:n.location.name}),i?e(L,{address:i,textSize:"small",textColor:"subdued",hiddenFields:wt}):e(T,{children:e(I,{type:"small",color:"subdued",children:t.translate("review.blocks.no_address")})})]})})})]})}):null}function jt(){const{i18n:t}=g(),n=M().buyerIdentity.value?.purchasingCompany,i=V(),s=Z();if(n){const o=i.value&&!n.location.shippingAddress;return e(Y,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",children:[e(u,{gap:"small-400",children:[e(A,{level:1,id:"deliveryAddress",children:t.translate("contact.ship_to_company",{companyName:n.location.name})}),o&&e(I,{color:"subdued",children:t.translate("contact.different_shipping_address_text")})]}),e(h,{when:s,children:e(le,{})})]})}return e(A,{id:"deliveryAddress",level:1,children:t.translate("delivery_options.shipping_address")})}function Kt(){const{i18n:t}=g(),n=Re(),i=N("Checkout::Dynamic::Render","INFORMATION3"),s=re(),o=a=>e(k,{children:a});return e(u,{gap:"large-400",children:[n&&e(H,{children:[n.options.value.some(({id:a})=>a==="PICKUP_POINT")&&e(ce.Prefetch,{}),e(k,{accessibilityLabel:t.translate("contact.delivery_option_title"),children:e(u,{gap:"base",children:[e(A,{level:1,children:t.translate("contact.delivery_option_title")}),e(Ye,{})]})}),e(b,{customizations:i,render:o})]}),e(et,{name:"delivery-methods",children:e($t,{})}),e(h,{when:s,children:e(tt,{})}),!n&&e(b,{customizations:i,render:o})]})}function $t(){const{methods:t}=De(),{i18n:n,checkout:{wallets:i}}=g(),{negotiate:s}=E(),o=Ee(),a=M().buyerIdentity,l=C(()=>a.value?.purchasingCompany),r=Me(),{shippingAddress:d}=R(),c=v(()=>{i.activeSession.value||s({include:[],fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address"],runListenersOnError:!0})},[i,s]),y=we(),f=re(),m=C(()=>t.value.includes("PICK_UP")&&t.value.includes("SHIPPING")),p=C(()=>y.value&&m.value),_=C(()=>!p.value),S=C(()=>t.value.includes("PICKUP_POINT")),P=C(()=>t.value.includes("SHIPPING")),O=nt();Le(d,()=>{r&&r.taxId.reset()});const he=N("Checkout::DeliveryAddress::RenderBefore"),me=N("purchase.checkout.delivery-address.render-after"),ge=C(()=>l.value?.location.name?n.translate("contact.ship_to_company",{companyName:l.value.location.name}):n.translate("delivery_options.shipping_address")),q=e(F,{sectionId:"localPickup",children:e(u,{gap:"small",children:[e(h,{when:p,children:e(A,{level:2,children:n.translate("delivery_options.pickup")})}),O?e(st,{}):e(it,{}),e(qt,{})]})}),j=e(F,{sectionId:"shippingAddressForm",children:e(k,{accessibilityLabel:ge.value,accessibilityRole:"group",children:[e(u,{gap:"base",children:[e(h,{when:p,children:[e(A,{id:"deliveryAddress",level:2,children:n.translate("delivery_options.ship_to_address")}),e(h,{when:f,children:e(Te,{border:"base",padding:"base",borderRadius:"large",children:e(ot,{selectedDeliveryMethodType:"SHIPPING"})})})]}),e(h,{when:_,children:e(jt,{})}),e(h,{when:o,children:e(T,{color:"subdued",children:n.translate("contact.shipping_used_as_billing_notice")})}),e(b,{customizations:he}),e(at,{}),e(ie,{children:[e(Mt,{onValid:c,children:e(Gt,{})}),r&&e(rt,{taxId:r.taxId,applied:r.applied})]}),e(b,{customizations:me})]}),e(Xt,{})]})});return e(h,{when:S,fallback:e(h,{when:p,fallback:e(h,{when:P,fallback:q,children:j}),children:e(u,{gap:"large-300",children:[q,j]})}),children:e(F,{sectionId:"pickupPoints",children:e(ce,{})})})}function Xt(){const t=xe(),n=Oe();return Fe(i=>{i.type==="success"&&i.negotiationStage==="progression"&&(t("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),n({type:"section_complete",section:"deliveryAddress"}))}),null}function Vn(){const{i18n:t,checkout:n}=g(),{progress:i,progressing:s}=E(),o=n.isShippingRequired.value?t.translate("general.continue_to_shipping_method"):t.translate("general.continue_to_payment_method");return ze("information"),e(H,{children:[e(kt,{hasError:!1,children:t.translate("contact.title")}),e(Be,{onSubmit:()=>i("information-page-submit"),disabled:s.value,implicitSubmit:o,children:e(He,{section:"contact",children:e(Ve,{section:"contact",children:e(Jt,{})})})}
1),e(h,{when:n.isShippingRequired,fallback:e(Ue.Prefetch,{}),children:e(Ge.Preload,{})}),e(ct,{id:"Information"})]})}const w=t=>e(k,{children:t}),Jt=Ce(function(){const{previousPage:n}=ee(),{checkout:i,client:s,i18n:o,shop:{hasStorefront:a}}=g(),l=We(),r=te(),d=dt(),c=M().buyerIdentity.value?.purchasingCompany,y=qe(),f=o.translate("contact.contact_method_title"),m=o.translate("payment.billing_address_title"),p=e(h,{when:y,fallback:e(A,{id:ne,level:1,children:f}),children:e(Zt,{contactTitle:f,loginUrl:s.unstable_getSerialization("loginUrl")||""})}),_=N("Checkout::Contact::RenderAfter"),S=N("Checkout::Dynamic::Render","INFORMATION1"),P=N("Checkout::Dynamic::Render","INFORMATION2"),O=N("Checkout::Dynamic::Render","INFORMATION3");return e(Lt,{children:e(je,{children:[e(h,{when:()=>d.value!=="hidden",children:e(lt,{})}),e(ht,{children:[e(mt,{children:[e(b,{customizations:S,render:w}),e(k,{accessibilityLabel:f,children:e(u,{gap:"base",children:[p,e(ut,{hideAllOptIns:!!c,hideContactInfoEntry:!!c}),e(b,{customizations:_,render:w})]})}),e(b,{customizations:P,render:w}),e(h,{when:i.isShippingRequired,fallback:e($,{target:"cart.paymentLines[0].billingAddress",children:[e(k,{accessibilityRole:"group",accessibilityLabelledBy:"billingAddress",children:e(u,{gap:"base",children:[e(A,{id:"billingAddress",children:m}),e(ie,{children:[e(Je,{}),e(oe,{}),e(ae,{})]})]})}),e(b,{customizations:O,render:w})]}),children:e($,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(Kt,{})})}),e(Qe,{})]}),e(gt,{children:[e(Qt,{}),a&&l.value&&n.route&&e(ft,{children:e(se,{href:n.route,variant:"plain",inlineSize:"fill",textDecoration:"none",ref:r("go_to_previous_step"),children:e(u,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(Ke,{type:"chevron-left",size:"small"}),e(I,{children:n.label})]})})})]})]})]})})});function Qt(){const{progressing:t,prefetch:n}=E(),i=Nt().isBlocked.value,{nextPage:s}=ee(),{captureNegotiate:o}=pe(),a=te(),l=pt.usePreload(),r=Rt(),d=()=>{o(),n(),s.id==="shipping"&&l()};return e(yt,{children:e(se,{variant:"primary",disabled:i||!r.value,type:"submit",loading:t.value,size:"large",inlineSize:"fill",onMouseEnter:d,ref:a("go_to_next_step"),children:s.label})})}function Zt({contactTitle:t,loginUrl:n}){const{i18n:i,source:s}=g(),o=s.type==="simulated";return e(u,{direction:"inline",justifyContent:"space-between",alignItems:"baseline",children:[e(A,{id:ne,level:1,children:t}),e($e,{href:o?void 0:n,children:i.translate("customer_account.sign_in_link_label")})]})}export{Vn 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.