1import{f as o,u as e,i as b,S as E,s as Re,k as De,h as Fe}from"./esnext-vendor.BBoIVOQW.js";import{bL as Be,ds as Ee,o as M,a1 as Me,dK as ie,dL as T,l as x,L as Oe,dM as Te,dz as xe,dN as Ue,dO as He,cf as We,ai as N,k as U,dP as Ge,P as V,dr as Ve,dQ as ze,c8 as je,dR as Ke,cT as J,dS as $e,dT as qe,I as Je,b as K,dU as Qe,dV as Ye,ca as Xe,by as Z,n as Ze,dW as ee,Y as en,a6 as nn}from"./hydrate.Tsur0pib.js";import{dO as tn,cr as sn,a5 as P,T as w,b8 as H,dP as an,dQ as on,bf as R,dR as rn,W as se,t as $,dv as ln,a4 as cn,dS as dn,dT as un,d5 as pn,ak as hn,bd as vn,be as mn}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{B as yn}from"./BillingAddressSelector.DUqZsdpg.js";import{D as ne,u as ae,S as oe,a as re,R as gn,b as fn}from"./Middot.OBjXYL_E.js";import{u as bn,P as kn,a as Cn,R as Ln,L as le,D as ce,b as de,c as ue,d as wn}from"./components-DeliveryReviewMethods.CzUxdUfp.js";import{S as _n}from"./Section-SectionStyleOverride.DC78UZTk.js";import{R as I,P as Pn}from"./PaymentLine.DOb0V3pD.js";import{A as q}from"./AddressPresenter.Ce4uWLSc.js";import{u as te}from"./hooks-useSuppressShopPayModalOnLoad.CwH45iIp.js";import"./app.CUBUOQtX.js";import"./shared-permissions.DW7FOCqf.js";import"./hooks-useShopPayExternalAppContext.YLtTu3k6.js";import"./Choice.18syyoW7.js";import"./shop-pay-installments-types._vopm3yK.js";import"./Checkbox.dqdh-9I_.js";import"./BillingAddressForm.BMqAGUql.js";import"./localization-index.P2wbDjPJ.js";import"./shipping-methods-grouping.S_i1LuzE.js";import"./amazon-pay-useAmazonPayPaymentLine.CMgi35Fb.js";import"./PhoneField.D8EvZ0Pm.js";import"./components-RedirectionNotice.module.qsrQCJ0v.js";import"./EstimatedDeliveryContent.B6SO5ZZV.js";import"./ShippingMethodRateLabel.Doe-JTYM.js";import"./shipping-methods-consolidated-included.Bra92G5_.js";import"./negotiated-findSelectedDeliveryMethod.DhxHslog.js";import"./PaymentIcon.CEAvn1dM.js";import"./Theme-ThemeOverride.DLuOqK2F.js";function An(){const{hasViolations:i,violations:t}=Be(sn);return Ee().value&&i&&!tn(t)}function Sn(){const i=M();return o(()=>{const{plan:t}=i.value;return t.greenPath.some(({id:n})=>n==="payment")})}function pe(){const i=P().buyerIdentity,{source:t}=w(),n=Me(),a=ie();return o(()=>{const s=i.value?.purchasingCompany,l=n.value;if(s){if(a.value)return"/information";if(l)return l}if(!H(t))return"/information"})}function In({showLoading:i,displayBillingAddress:t}){const n=P().buyerIdentity,{source:a,shop:{customerAccountLocationsUrl:s}}=w(),l=M(),d=ie(),r=an();return o(()=>{const c=n.value?.purchasingCompany,y=a.type==="draftOrder",p=T(l.value.plan,"/information"),v=on(c);return i.value?!1:c&&(v||d.value)&&s&&!H(a)&&!y?!0:!r.value&&!t.value?!1:!!p})}function D({accessibilityLabel:i,href:t}){const{i18n:n}=w(),a=n.translate("review.blocks.change_link_label");return e(Oe,{href:t,accessibilityLabel:i,children:e(x,{children:a})})}const Nn=["firstName","lastName"];function Rn({hiddenFields:i,...t}){return{...t,hiddenFields:[...new Set([...i??[],...Nn])]}}function he({withWrappedAddress:i=!1,label:t}){const{i18n:n,source:a,checkout:s}=w(),l=P(),d=l.deliveryNext,r=R("deliveryNext"),c=s.proposal.facts.delivery??[],y=o(()=>rn(d.value)),p=l.shippingAddress,v=R("shippingAddress"),m=o(()=>c.length>0?c[0].deliveryAddress:p.value),{shippingAddress:h,billingAddress:C}=se(),A=o(()=>d.value?.status==="unavailable"?h.value:m.value),{selectedPickupPoint:g}=Te(),_=l.billingAddress,L=o(()=>_.value??C.value),u=P().buyerIdentity.value?.purchasingCompany,f=xe(),k=o(()=>v.value&&m.value==null),F=o(()=>H(a)?!Ue({checkout:s}):!s.isShippingRequired.value),B=o(()=>F.value?L.value:A.value),O=He(),Q=bn({address:B}).value,S=B.value,ve=u&&F.value?n.translate("review.blocks.company_location"):n.translate("review.blocks.billing_address_title"),me=F.value?ve:n.translate("review.blocks.shipping_address_title"),ye=F.value?n.translate("review.blocks.change_billing_address_link_label"):n.translate("review.blocks.change_shipping_address_link_label"),W=u?.location;let G;if(Q)G=Q;else if(i)G={hiddenFields:["phone"],multiline:!0};else{const X=S?.countryCode??g?.pickupLocation.address.countryCode;G=X&&Ge.includes(X)?{hiddenFields:["phone"],multiline:!1}:{hiddenFields:["firstName","lastName","phone"],multiline:!1}}const ge={...Rn(G),multiline:!1},Y=!!(W&&(r.value||S==null||$(S)||!O.value)),fe=Y?W?.name:(()=>
1{if(!(S==null||$(S)||Y))return n.formatName(S.firstName,S.lastName,!0)||S.firstName||S.lastName})(),be=We(g?.pickupLocation.address,{hiddenFields:["countryCode"]}),ke=g?.pickupLocation.name,Ce=n.translate("review.blocks.no_address"),Le=n.translate("pickup_point.title").toLowerCase(),we=W?s.isShippingRequired.value:!0,_e=f?.taxId.value,Pe=In({showLoading:k,displayBillingAddress:F}),Ae=pe(),Se=e(D,{href:Ae.value,accessibilityLabel:ye}),Ie=t??me,Ne=Pe.value?Se:void 0;let z=fe,j=e(Dn,{address:S,addressDetailsPresentationProps:ge,companyLocationName:W?.name,deliveryNextLoading:r.value,isOnetimeShippingAddress:O.value,noAddressLabel:Ce,showAddress:we,vatNumber:_e});return k.value?(z=e(N,{}),j=void 0):y.value&&(z=ke,j=e(Fn,{formattedAddress:be,pickupPoint:g,pickupPointLabel:Le})),e(I,{label:Ie,primaryAction:Ne,primaryContent:z,secondaryContent:j})}function Dn({address:i,addressDetailsPresentationProps:t,companyLocationName:n,deliveryNextLoading:a,isOnetimeShippingAddress:s,noAddressLabel:l,showAddress:d,vatNumber:r}){return a&&n?e(N,{}):i==null||$(i)?!d&&!r?null:e(U,{children:[d&&e(x,{size:"small",color:"subdued",children:l}),r&&e(ne,{vatNumber:r})]}):n&&!s?d?e(U,{children:e(q,{textColor:"subdued",textSize:"small",...t,address:i})}):null:e(U,{children:[e(q,{...t,address:i}),r&&e(ne,{vatNumber:r})]})}function Fn({formattedAddress:i,pickupPoint:t,pickupPointLabel:n}){if(!t)return null;const a=`${t.pickupLocation.carrierName} ${n}`;return e(U,{children:[i?e(x,{type:"address",children:i}):null,e(x,{color:"subdued",size:"small",children:a})]})}const Bn="#";function En(){const{i18n:i}=w(),{purchaseOrderNumber:t}=P(),n=R("purchaseOrderNumber"),a=o(()=>n.value&&t.value===void 0),s=i.translate("review.blocks.no_purchase_order_number_long"),l=o(()=>{const c=t.value;return c!==void 0&&c.trim()!==""?`${Bn}${c}`:void 0}),d=i.translate("review.blocks.purchase_order_number_title"),r=()=>e(D,{href:"/payment",accessibilityLabel:i.translate("review.blocks.change_purchase_order_number_label")});return e(b,{when:()=>!a.value,fallback:e(I,{label:d,primaryContent:e(N,{})}),children:e(b,{when:l,fallback:e(I,{label:d,primaryAction:r(),secondaryContent:e(V,{children:s})}),children:c=>e(I,{label:d,primaryAction:r(),primaryContent:e(kn,{children:c})})})})}function Mn(){const{i18n:i}=w(),t=pe(),a=P().buyerIdentity.value?.purchasingCompany?.location,s=Ve();if(!a)return null;const l=i.translate("company_location.location_title"),d=s.value?e(D,{href:t.value,accessibilityLabel:i.translate("contact.change_company_location_link_label")}):void 0,r=e(x,{children:a.name}),c=a.shippingAddress?e(q,{hiddenFields:ze,address:a.shippingAddress}):e(x,{children:i.translate("review.blocks.no_address")});return e(I,{label:l,primaryAction:d,primaryContent:r,secondaryContent:c})}function On(){const{i18n:i,checkout:t}=w(),{contactInfo:n}=P(),a=R("contactInfo"),{geolocation:s}=je(),{buyerIdentity:l}=P(),d=M();Cn(a.value);const r=t.proposal.facts.contactMethod?.phoneNumber,{formattedNumber:c}=te(s.country.code,r??void 0),{formattedNumber:y}=te(s.country.code,n.value?.phone),p=o(()=>a.value&&(n.value?.email??n.value?.phone)==null),v=o(()=>!p.value&&T(d.value.plan,"/information")&&!l.value?.purchasingCompany),m=o(()=>{const g=t.proposal.facts.contactMethod?.email,_=c===""?void 0:c,L=n.value?.email;return g||_||L||(y===""?void 0:y)}),h=i.translate("review.blocks.contact_method_title"),C=v.value?e(D,{href:"/information",accessibilityLabel:i.translate("review.blocks.change_contact_method_link_label")}):void 0;return e(I,{label:h,primaryAction:C,primaryContent:e(b,{when:()=>!p.value,fallback:e(N,{}),children:()=>e(Ln,{contactInfo:m.value})})})}function Tn(){const{checkout:i,i18n:t,source:n}=w(),a=M(),s=P().deliveryNext,l=R("deliveryNext"),d=n.type==="draftOrder",r=o(()=>ln(s.value)),c=Ke(),y=ae({deliveryLines:s.value?.status==="filled"?s.value.lines:void 0}),p=o(()=>J({checkout:i,source:n})),v=o(()=>p.value?.pickupAddress?p.value.pickupAddress:!s.value||s.value.status==="unavailable"?void 0:r.value?.map(O=>O.pickupLocation?.address).filter(O=>O!==void 0)?.[0]),m=o(()=>{if(!(!s.value||s.value.status==="unavailable"))return p.value?p.value.pickupAddressName:r.value?.find(({methodType:B})=>B==="PICK_UP")?.pickupLocation?.name}),h=o(()=>!!(r.value?.some(({methodType:B})=>B==="PICK_UP")||p.value?.pickupAddress)),C=o(()=>h.value?"/information":"/shipping"),A=o(()=>!c.value&&!d&&(!H(n)&&T(a.value.plan,C.value)||H(n)&&h.value)),g=o(()=>h.value?t.translate("review.blocks.change_delivery_method_link_label"):t.translate("review.blocks.change_shipping_method_link_label")),_=A.value?e(D,{href:C.value,accessibilityLabel:g.value}):void 0,L=t.translate("shipping.title"),u=t.translate("delivery_options.pickup"),f=h.value?u:L,k=e(xn,{showSkeleton:l.value&&!s.value,splitShippingRollupSummary:y,isLocalPickupSelected:h.value,pickupLocationName:m.value}),F=e(Un,{showSkeleton:l.value&&!s.value,splitShippingRollupSummary:y,isLocalPickupSelected:h.value,pickupAddress:v.value,pickupLocationName:m.value});return e(I,{label:f,primaryAction:_,primaryContent:k,secondaryContent:F})}function xn({showSkeleton:i,splitShippingRollupSummary:t,isLocalPickupSelected:n,pickupLocationName:a}){return i?e(N,{}):t?e(oe,{summary:t}):n?e(le,{pickupLocationName:a}):e(ce,{})}function Un({showSkeleton:i,splitShippingRollupSummary:t,isLocalPickupSelected:n,pickupAddress:a,pickupLocationName:s}){return i?e(N,{}):t?e(re,{summary:t}):n?e(de,{address:a,pickupLocationName:s}):e(ue,{})}function Hn(){const{i18n:i}=w(),{acceptPaymentVaulting:t,paymentLines:n}=se(),a=R("paymentLines"),s=R("shippingAddress"),l=M(),d=$e(),r=qe(d.value),
1c=cn(),y=o(()=>{const u=n.value;return u?dn(un(u,c.value)).map((f,k)=>({key:`${f.method.type}-${k+1}`,line:f})):[]}),p=o(()=>n.value?.some(u=>u.method.type==="direct")),v=o(()=>!a.value&&n.value!=null&&!s.value),m=o(()=>!n.value?.some(f=>f.method.type==="deferred")),h=o(()=>!!(t.value&&p.value)),A=o(()=>T(l.value.plan,"/payment")&&v.value).value?e(D,{href:"/payment",accessibilityLabel:i.translate("review.blocks.change_payment_method_link_label")}):void 0,g=i.translate("payment.title"),_=e(b,{when:v,fallback:e(N,{}),children:e(Re,{each:y,getKey:u=>u.key,children:({line:u})=>e(E,{children:[e(Pn,{paymentLine:u,showCardBrandLabel:!0}),e(K,{blockSize:"small-400"})]})})});let L;return(m.value||h.value)&&(L=v.value?e(E,{children:[e(b,{when:m,children:e(V,{children:r})}),e(b,{when:h,children:e(U,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(Je,{type:"check",size:"small"}),e(V,{children:i.translate("review.blocks.payment_method_saved_company_location")})]})})]}):e(N,{})),e(I,{label:g,primaryAction:A,primaryContent:_,secondaryContent:L})}function Wn(){const{checkout:i,i18n:t,source:n}=w(),{deliveryNext:a}=P(),s=Qe(),l=M(),{value:d}=a,r=R("deliveryNext").value,c=ae({deliveryLines:d?.status==="filled"?d.lines:void 0}),p=pn(d).find(({method:k})=>k.methodType==="PICK_UP"),v=T(l.value.plan,"/information")?e(D,{href:"/information",accessibilityLabel:t.translate("review.blocks.change_shipping_address_link_label")}):void 0,m=T(l.value.plan,"/shipping")?e(D,{href:"/shipping",accessibilityLabel:t.translate("review.blocks.change_shipping_method_link_label")}):void 0,h=c?e(oe,{summary:c}):void 0,C=c?e(re,{summary:c}):void 0,A=p?.method.pickupLocation?.address,g=J({checkout:i,source:n})?.pickupAddressName??p?.method.pickupLocation?.name,_=e(le,{pickupLocationName:g}),L=e(de,{address:A,pickupLocationName:g});let u,f;return r?(u=e(N,{}),f=e(N,{})):(u=h??e(ce,{}),f=C??e(ue,{})),e(E,{children:[e(I,{label:t.translate("review.blocks.pickup_items_at",{count:s.value.PICK_UP||0}),primaryAction:v,primaryContent:_,secondaryContent:L}),e(b,{when:()=>s.value.SHIPPING,children:k=>e(E,{children:[e(he,{label:t.translate("review.blocks.ship_items_to",{count:k})}),e(I,{label:t.translate("shipping.title"),primaryAction:m,primaryContent:u,secondaryContent:f})]})})]})}function Gn(){const i=Ye(),{checkout:t,router:n,source:a}=w();return o(()=>{const s=J({checkout:t,source:a}),l=s&&s.lines.length===0;return(n.currentUrlMatches("/payment")||n.currentUrlMatches("/review"))&&!i.value&&!l&&t.isShippingRequired.value})}function ft({showPayment:i,showAddress:t=!0}){const{i18n:n,shop:a}=w(),s=M(),l=a.hasFlagEnabled(hn),{buyerIdentity:d}=P(),r=o(()=>s.value?.currentPage?.id==="review"),c=vn(),y=o(()=>!r.value||!c.value),p=o(()=>{if(y.value)return r.value?Z:ee}),v=o(()=>r.value&&!c.value?n.translate("review.review_title"):n.translate("review.title")),[m,h]=De(!1),C=An(),A=Gn(),g=Xe();Fe(()=>{!m&&C&&h(!0)},[C,m]);const _=Sn(),L=o(()=>d.value?.purchasingCompany!==void 0&&_.value),u=e(E,{children:[t&&e(he,{withWrappedAddress:r.value}),!t&&e(b,{when:()=>d.value?.purchasingCompany,children:e(Mn,{})}),e(b,{when:A,children:e(Tn,{})})]}),f=e(wn,{accessibilityLabel:n.translate("review.block_title"),renderAsCard:l,children:[e(On,{}),e(b,{when:g,fallback:u,children:e(Wn,{})}),i?e(Hn,{}):null,e(b,{when:()=>L.value&&r.value,children:e(En,{})})]}),k=e(b,{when:y,fallback:f,children:e(nn,{children:f})});return e(en,{accessibilityLabel:p.value===void 0?v.value:void 0,accessibilityLabelledBy:p.value,children:[e(b,{when:r,children:e(E,{children:[e(gn,{id:Z}),mn("review.review_notice_html",n)?e(V,{children:e(fn,{})}):null,e(K,{blockSize:"large-200"})]})}),e(b,{when:()=>!r.value,children:e(Ze,{id:ee,visibility:"hidden",children:v.value})}),l?e(_n,{target:"edgeToEdgeCard",children:k}):k,m&&e(E,{children:[e(K,{blockSize:"base"}),e(yn,{})]})]})}export{ft 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.