1import{k as e,u as a,w as i,S as t,H as n,z as l,h as r}from"./2c1ab0fe.RaLGJvq2.js";import{b_ as s,d9 as o,j as c,aN as u,ei as d,ej as p,i as v,L as m,dg as h,ek as b,el as f,cz as y,E as k,S as g,em as _,f as w,ct as L,en as A,dI as N,eo as C,ep as j,a0 as S,d as P,eq as I,er as x,cv as R,c5 as z,H as F,es as B,h as U,an as D}from"./164ad2e3.CFfy82JW.js";import{du as E,bE as O,a as K,C as $,dv as q,D as M,b3 as T,dw as H,bF as V,cy as W,bp as G,dx as Q,dy as J,d7 as X,a4 as Y,b2 as Z}from"./f67abd2c.C46XWaN_.js";import{B as ee}from"./b9c0319a.DGWqQY9k.js";import{D as ae,u as ie,S as te,a as ne,R as le,b as re}from"./910cd6e2.WHbnX682.js";import{L as se,a as oe,R as ce}from"./03fde911.wtvQldAo.js";import{S as ue}from"./79974aab.B6la8WQu.js";import{u as de,h as pe}from"./17425706.DYx1euOe.js";import{R as ve,P as me}from"./e77f7fe0.B3OVPclh.js";import{A as he}from"./4b1c22b7.CBznZX-z.js";import{u as be,P as fe,a as ye,R as ke,D as ge,b as _e}from"./60575ca1.ioZmSubW.js";import{u as we}from"./160e80e7.BC4CPrTW.js";import{S as Le}from"./9e94a50b.BevpX_k4.js";import{a as Ae}from"./22345fd4.MHNxKXFg.js";import"./d0bb51ec.J_EOosAq.js";import"./app.tqmx-w8m.js";import"./60a453ce.BDU_ws-c.js";import"./e12db40c.mIeTs0Fw.js";import"./9dba8418.B8kf8LtI.js";import"./efa0389a.BJsVfRJM.js";import"./74835653.B3I-NlXD.js";import"./3ca8ef7e.vFUF4jyH.js";import"./2495faa4.DxVlDpSd.js";import"./a9fa9fda.-Ml-d3Ge.js";import"./ca3e798e.BWruLT5k.js";import"./47b970b2.CyfePLc5.js";import"./064f6ac1.DtwFC3xO.js";import"./347b440c._Xyn_DDB.js";import"./9ce08e25.u3_drbXY.js";import"./181d38d3.C-HSH76g.js";import"./792bb671.B3OvVnSg.js";import"./598fef4e.BG924mLA.js";function Ne(){const{source:a,checkout:{negotiator:i}}=K(),t=i.current.fields.buyerIdentity,n=u(),l=d();return e(()=>{const e=t.value?.purchasingCompany,i=n.value;if(e){if(l.value)return"/information";if(i)return i}if(!$(a))return"/information"})}function Ce({accessibilityLabel:e,href:i}){const{i18n:t}=K(),n=t.translate("review.blocks.change_link_label");return a(m,{href:i,accessibilityLabel:e,children:a(v,{children:n})})}const je=["firstName","lastName"];function Se({hiddenFields:e,...a}){return{...a,hiddenFields:[...new Set([...e??[],...je])]}}function Pe({withWrappedAddress:i=!1,label:t}){const{i18n:n,source:l,checkout:r}=K(),s=r.negotiator.current.fields.deliveryNext,o=T("deliveryNext"),u=r.proposal.facts.delivery??[],v=e(()=>H(s.value)),m=r.negotiator.current.fields.shippingAddress,g=T("shippingAddress"),w=e(()=>u.length>0?u[0].deliveryAddress:m.value),{shippingAddress:L,billingAddress:A}=r.negotiator.parts,N=e(()=>"unavailable"===s.value?.status?L.value:w.value),{selectedPickupPoint:C}=we(),j=r.negotiator.current.fields.billingAddress,S=e(()=>j.value??A.value),P=r.negotiator.current.fields.buyerIdentity.value?.purchasingCompany,I=h(),x=e(()=>g.value&&null==w.value),R=e(()=>$(l)?!b({checkout:r}):!r.isShippingRequired.value),z=e(()=>R.value?S.value:N.value),F=f(),B=be({address:z}).value,U=z.value,D=P&&R.value?n.translate("review.blocks.company_location"):n.translate("review.blocks.billing_address_title"),E=R.value?D:n.translate("review.blocks.shipping_address_title"),O=R.value?n.translate("review.blocks.change_billing_address_link_label"):n.translate("review.blocks.change_shipping_address_link_label"),W=P?.location;let G;if(B)G=B;else if(i)G={hiddenFields:["phone"],multiline:!0};else{const e=U?.countryCode??C?.pickupLocation.address.countryCode;G=e&&_.includes(e)?{hiddenFields:["phone"],multiline:!1}:{hiddenFields:["firstName","lastName","phone"],multiline:!1}}const Q={...Se(G),multiline:!1},J=Boolean(W&&(o.value||null==U||V(U)||!F.value)),X=J?W?.name:(()=>{if(null!=U&&!V(U)&&!J)return n.formatName(U.firstName,U.lastName,!0)||U.firstName||U.lastName})(),Y=y(C?.pickupLocation.address,{hiddenFields:["countryCode"]}),Z=C?.pickupLocation.name,ee=n.translate("review.blocks.no_address"),ae=n.translate("pickup_point.title").toLowerCase(),ie=!W||r.isShippingRequired.value,te=I?.taxId.value,ne=function({showLoading:a,displayBillingAddress:i}){const{source:t,shop:{customerAccountLocationsUrl:n},checkout:{negotiator:l}}=K(),r=l.current.fields.buyerIdentity,s=c(),o=d(),u=q();return e(()=>{const e=r.value?.purchasingCompany,l="draftOrder"===t.type,c=p(s.value.plan,"/information"),d=M(e);return!(a.value||(!e||!d&&!o.value||!n||$(t)||l)&&(!u.value&&!i.value||!c))})}({showLoading:x,displayBillingAddress:R}),le=Ne(),re=a(Ce,{href:le.value,accessibilityLabel:O}),se=t??E,oe=ne.value?re:void 0;
1let ce=X,ue=a(Ie,{address:U,addressDetailsPresentationProps:Q,companyLocationName:W?.name,deliveryNextLoading:o.value,isOnetimeShippingAddress:F.value,noAddressLabel:ee,showAddress:ie,vatNumber:te});return x.value?(ce=a(k,{}),ue=void 0):v.value&&(ce=Z,ue=a(xe,{formattedAddress:Y,pickupPoint:C,pickupPointLabel:ae})),a(ve,{label:se,primaryAction:oe,primaryContent:ce,secondaryContent:ue})}function Ie({address:e,addressDetailsPresentationProps:i,companyLocationName:t,deliveryNextLoading:n,isOnetimeShippingAddress:l,noAddressLabel:r,showAddress:s,vatNumber:o}){return n&&t?a(k,{}):null==e||V(e)?s||o?a(g,{children:[s&&a(v,{size:"small",color:"subdued",children:r}),o&&a(ae,{vatNumber:o})]}):null:t&&!l?s?a(g,{children:a(he,{textColor:"subdued",textSize:"small",...i,address:e})}):null:a(g,{children:[a(he,{...i,address:e}),o&&a(ae,{vatNumber:o})]})}function xe({formattedAddress:e,pickupPoint:i,pickupPointLabel:t}){if(!i)return null;const n=`${i.pickupLocation.carrierName} ${t}`;return a(g,{children:[e?a(v,{type:"address",children:e}):null,a(v,{color:"subdued",size:"small",children:n})]})}function Re(){const{i18n:t,checkout:{negotiator:n}}=K(),{purchaseOrderNumber:l}=n.current.fields,r=T("purchaseOrderNumber"),s=e(()=>r.value&&void 0===l.value),o=t.translate("review.blocks.no_purchase_order_number_long"),c=e(()=>{const e=l.value;return void 0!==e&&""!==e.trim()?`#${e}`:void 0}),u=t.translate("review.blocks.purchase_order_number_title"),d=()=>a(Ce,{href:"/payment",accessibilityLabel:t.translate("review.blocks.change_purchase_order_number_label")});return a(i,{when:()=>!s.value,fallback:a(ve,{label:u,primaryContent:a(k,{})}),children:a(i,{when:c,fallback:a(ve,{label:u,primaryAction:d(),secondaryContent:a(w,{children:o})}),children:e=>a(ve,{label:u,primaryAction:d(),primaryContent:a(fe,{children:e})})})})}function ze(){const{i18n:e,checkout:{negotiator:i}}=K(),t=Ne(),n=i.current.fields.buyerIdentity.value?.purchasingCompany,l=n?.location,r=de();if(!l)return null;const s=e.translate("company_location.location_title"),o=r.value?a(Ce,{href:t.value,accessibilityLabel:e.translate("contact.change_company_location_link_label")}):void 0,c=a(v,{children:l.name}),u=l.shippingAddress?a(he,{hiddenFields:Le,address:l.shippingAddress}):a(v,{children:e.translate("review.blocks.no_address")});return a(ve,{label:s,primaryAction:o,primaryContent:c,secondaryContent:u})}function Fe(){const{i18n:t,checkout:n}=K(),{contactInfo:l}=n.negotiator.current.fields,r=T("contactInfo"),{geolocation:s}=L(),{buyerIdentity:o}=n.negotiator.current.fields,u=c();ye(r.value);const d=n.proposal.facts.contactMethod?.phoneNumber,{formattedNumber:v}=Ae(s.country.code,d??void 0),{formattedNumber:m}=Ae(s.country.code,l.value?.phone),h=e(()=>r.value&&null==(l.value?.email??l.value?.phone)),b=e(()=>!h.value&&p(u.value.plan,"/information")&&!o.value?.purchasingCompany),f=e(()=>{const e=n.proposal.facts.contactMethod?.email,a=""===v?void 0:v,i=l.value?.email;return e||a||i||(""===m?void 0:m)}),y=t.translate("review.blocks.contact_method_title"),g=b.value?a(Ce,{href:"/information",accessibilityLabel:t.translate("review.blocks.change_contact_method_link_label")}):void 0;return a(ve,{label:y,primaryAction:g,primaryContent:a(i,{when:()=>!h.value,fallback:a(k,{}),children:()=>a(ke,{contactInfo:f.value})})})}function Be(){const{checkout:i,i18n:t,source:n}=K(),l=c(),r=i.negotiator.current.fields.deliveryNext,s=T("deliveryNext"),o="draftOrder"===n.type,u=e(()=>W(r.value)),d=A(),v=ie({deliveryLines:"filled"===r.value?.status?r.value.lines:void 0}),m=e(()=>N({checkout:i,source:n})),h=e(()=>{if(m.value?.pickupAddress)return m.value.pickupAddress;if(!r.value||"unavailable"===r.value.status)return;const e=u.value?.map(e=>e.pickupLocation?.address).filter(e=>void 0!==e);return e?.[0]}),b=e(()=>{if(r.value&&"unavailable"!==r.value.status)return m.value?m.value.pickupAddressName:u.value?.find(({methodType:e})=>"PICK_UP"===e)?.pickupLocation?.name}),f=e(()=>Boolean(u.value?.some(({methodType:e})=>"PICK_UP"===e)||m.value?.pickupAddress)),y=e(()=>f.value?"/information":"/shipping"),k=e(()=>!d.value&&!o&&(!$(n)&&p(l.value.plan,y.value)||$(n)&&f.value)),g=e(()=>f.value?t.translate("review.blocks.change_delivery_method_link_label"):t.translate("review.blocks.change_shipping_method_link_label")),_=k.value?a(Ce,{href:y.value,accessibilityLabel:g.value}):void 0,w=t.translate("shipping.title"),L=t.translate("delivery_options.pickup"),C=f.value?L:w,j=a(Ue,{showSkeleton:s.value&&!r.value,splitShippingRollupSummary:v,isLocalPickupSelected:f.value,pickupLocationName:b.value}),S=a(De,{showSkeleton:s.value&&!r.value,splitShippingRollupSummary:v,isLocalPickupSelected:f.value,pickupAddress:h.value,pickupLocationName:b.value});return a(ve,{label:C,primaryAction:_,primaryContent:j,secondaryContent:S})}function Ue({showSkeleton:e,splitShippingRollupSummary:i,isLocalPickupSelected:t,pickupLocationName:n}){return e?a(k,{}):i?a(te,{summary:i}):t?a(se,{pickupLocationName:n}):a(ge,{})}function De({showSkeleton:e,splitShippingRollupSummary:i,isLocalPickupSelected:t,pickupAddress:n,pickupLocationName:l}){return e?a(k,{}):i?a(ne,{summary:i}):t?a(oe,{address:n,pickupLocationName:l}):a(_e,{})}function Ee(){const{i18n:l,checkout:{negotiator:r}}=K(),{acceptPaymentVaulting:s,paymentLines:o}=r.parts,u=T("paymentLines"),d=T("shippingAddress"),v=c(),m=C(),h=j(m.value),b=G(),f=e(()=>{const e=o.value;return e?Q(J(e,b.value)).map((e,a)=>({key:`${e.method.type}-${a+1}`,line:e})):[]}),y=e(()=>
1o.value?.some(e=>"direct"===e.method.type)),_=e(()=>!u.value&&null!=o.value&&!d.value),L=e(()=>{const e=o.value?.some(e=>"deferred"===e.method.type);return!e}),A=e(()=>Boolean(s.value&&y.value)),N=e(()=>p(v.value.plan,"/payment")&&_.value).value?a(Ce,{href:"/payment",accessibilityLabel:l.translate("review.blocks.change_payment_method_link_label")}):void 0,I=l.translate("payment.title"),x=a(i,{when:_,fallback:a(k,{}),children:a(n,{each:f,getKey:e=>e.key,children:({line:e})=>a(t,{children:[a(me,{paymentLine:e,showCardBrandLabel:!0}),a(P,{blockSize:"small-400"})]})})});let R;return(L.value||A.value)&&(R=_.value?a(t,{children:[a(i,{when:L,children:a(w,{children:h})}),a(i,{when:A,children:a(g,{direction:"inline",gap:"small-400",alignItems:"center",children:[a(S,{type:"check",size:"small"}),a(w,{children:l.translate("review.blocks.payment_method_saved_company_location")})]})})]}):a(k,{})),a(ve,{label:I,primaryAction:N,primaryContent:x,secondaryContent:R})}function Oe(){const{checkout:e,i18n:n,source:l}=K(),{deliveryNext:r}=e.negotiator.current.fields,s=I(),o=c(),{value:u}=r,d=T("deliveryNext").value,v=ie({deliveryLines:"filled"===u?.status?u.lines:void 0}),m=X(u).find(({method:e})=>"PICK_UP"===e.methodType),h=p(o.value.plan,"/information")?a(Ce,{href:"/information",accessibilityLabel:n.translate("review.blocks.change_shipping_address_link_label")}):void 0,b=p(o.value.plan,"/shipping")?a(Ce,{href:"/shipping",accessibilityLabel:n.translate("review.blocks.change_shipping_method_link_label")}):void 0,f=v?a(te,{summary:v}):void 0,y=v?a(ne,{summary:v}):void 0,g=m?.method.pickupLocation?.address,_=N({checkout:e,source:l})?.pickupAddressName??m?.method.pickupLocation?.name,w=a(se,{pickupLocationName:_}),L=a(oe,{address:g,pickupLocationName:_});let A,C;return d?(A=a(k,{}),C=a(k,{})):(A=f??a(ge,{}),C=y??a(_e,{})),a(t,{children:[a(ve,{label:n.translate("review.blocks.pickup_items_at",{count:s.value.PICK_UP||0}),primaryAction:h,primaryContent:w,secondaryContent:L}),a(i,{when:()=>s.value.SHIPPING,children:e=>a(t,{children:[a(Pe,{label:n.translate("review.blocks.ship_items_to",{count:e})}),a(ve,{label:n.translate("shipping.title"),primaryAction:b,primaryContent:A,secondaryContent:C})]})})]})}function Ke({showPayment:n,showAddress:u=!0}){const{i18n:d,shop:p,checkout:{negotiator:v}}=K(),m=c(),h=p.hasFlagEnabled(Y),{buyerIdentity:b}=v.current.fields,f=e(()=>"review"===m.value?.currentPage?.id),y=Z(),k=e(()=>!f.value||!y.value),g=e(()=>{if(k.value)return f.value?z:B}),_=e(()=>f.value&&!y.value?d.translate("review.review_title"):d.translate("review.title")),[L,A]=l(!1),C=function(){const{hasViolations:e,violations:a}=s(O);return o().value&&e&&!E(a)}(),j=function(){const a=x(),{checkout:i,router:t,source:n}=K();return e(()=>{const e=N({checkout:i,source:n}),l=e&&0===e.lines.length;return(t.currentUrlMatches("/payment")||t.currentUrlMatches("/review"))&&!a.value&&!l&&i.isShippingRequired.value})}(),S=R();r(()=>{!L&&C&&A(!0)},[C,L]);const I=function(){const a=c();return e(()=>{const{plan:e}=a.value;return e.greenPath.some(({id:e})=>"payment"===e)})}(),$=e(()=>void 0!==b.value?.purchasingCompany&&I.value),q=a(t,{children:[u&&a(Pe,{withWrappedAddress:f.value}),!u&&a(i,{when:()=>b.value?.purchasingCompany,children:a(ze,{})}),a(i,{when:j,children:a(Be,{})})]}),M=a(ce,{accessibilityLabel:d.translate("review.block_title"),renderAsCard:h,children:[a(Fe,{}),a(i,{when:S,fallback:q,children:a(Oe,{})}),n?a(Ee,{}):null,a(i,{when:()=>$.value&&f.value,children:a(Re,{})})]}),T=a(i,{when:k,fallback:M,children:a(D,{children:M})});return a(U,{accessibilityLabel:void 0===g.value?_.value:void 0,accessibilityLabelledBy:g.value,children:[a(i,{when:f,children:a(t,{children:[a(le,{id:z}),pe("review.review_notice_html",d)?a(w,{children:a(re,{})}):null,a(P,{blockSize:"large-200"})]})}),a(i,{when:()=>!f.value,children:a(F,{id:B,visibility:"hidden",children:_.value})}),h?a(ue,{target:"edgeToEdgeCard",children:T}):T,L&&a(t,{children:[a(P,{blockSize:"base"}),a(ee,{})]})]})}export{Ke 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.