import{cU as r,o as S,bx as T,a as e,a$ as Z,cV as U,cW as V,cX as q,cY as Q,bA as F,cZ as ee,A as ie,Y as E,U as se,bq as te,c_ as ne,c$ as ae,T as re,bD as oe,y as P,d0 as le,d1 as ce,d2 as de,d3 as pe,d4 as he,d5 as ue,af as ge,a2 as me,d6 as ye,d7 as ve,d8 as fe,d9 as be,aH as Se,da as _e,db as xe,E as R,a3 as De,a4 as B,dc as ke,a6 as Ee,ai as Pe,bt as Ae,an as Te,aw as Me,ao as we,ap as Ie,R as f,aS as A,B as b,b6 as G,dd as W,de as Ce,ac as Le,df as Re,dg as Be,dh as N,di as Ge,aB as We,I as Ne,aC as Oe,dj as ze,K as He}from"./app.B46ok1sD.js";import{P as Ue,a as Ve,b as qe,c as Fe,B as O,d as Ye}from"./ButtonWithRegisterWebPixel.rRVMeKxb.js";import{S as $e}from"./ShipmentBreakdown.C1_Ur001.js";import"./NoAddressLocationFullDetour.IjvhIHxd.js";import"./MerchandiseModal.DirPaH8W.js";import"./StackedMerchandisePreview.DFzVGx4n.js";const Y=i=>r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 76.975 59.756",...i},r("g",{style:{fill:"none",stroke:"none"}},r("path",{d:"M0 0h61.79M5.83 30.622h15.155M5.829 27.109h15.156M5.829 23.596h9.91",style:{stroke:"#b3b3b3",strokeWidth:2},transform:"translate(1 20.112)"}),r("path",{d:"M8.073 18.159h49.373l6.179 9.953v36.009a2.62 2.62 0 0 1-2.623 2.635H4.459a2.62 2.62 0 0 1-2.623-2.635V28.112zm24.657 0v9.72z",style:{stroke:"#b3b3b3",strokeWidth:2},transform:"translate(-.836 -8)"}),r("g",{transform:"translate(49.788 1)"},r("circle",{cx:13.094,cy:13.094,r:13.094,style:{fill:"#fff",stroke:"#b3b3b3",strokeWidth:2}}),r("path",{d:"M13.094 4.676v11.36",style:{stroke:"#b3b3b3",strokeWidth:2}}),r("circle",{cx:13.028,cy:20.108,r:1.403,style:{fill:"#b3b3b3"}})))),je=()=>{const i=S(),o=T(),t=e(Z,{href:"/information",children:i("shipping.shipping_information_redirect_link")});return e(q,{children:[!o&&e(U,{children:e(Y,{})}),e(V,{children:i("shipping.shipping_information_required_notice",{link:t})})]})},z=()=>{const i=S(),o=T();return e(q,{children:[!o&&e(U,{children:e(Y,{})}),e(V,{children:i("shipping_errors.shipping_method_not_available_generic.one")})]})};function Je(){const{value:i}=Q(),{value:o,loading:t}=F(),_=S(),h=ee(),c=ie(!0),[,u]=E(),[d,n]=E(void 0),{shippingAddress:g}=se(),m=g.value,{value:x}=te(),D=ne(u),p=ae(),a=re(()=>i?oe(i).filter(s=>s.status!=="not_required"&&!s.hasNoDeliveryMethods):[],[i]);return P(()=>{if(!t){if(d){const s=Date.now(),y=s-d,l=a[0]?.methods[0]?.deliveryPromiseProviderApiClientId;if(l){const v=le(l);h(y,s,Number(v)),p(y,Number(v))}n(void 0)}c.current=!1}t&&!d&&n(Date.now())},[t,h,a,d,p]),t&&c.current?e(ce,{text:_("shipping.waiting_on_rate_notice")}):x?.some(s=>"target"in s&&s.target.startsWith("$.cart.deliveryGroups[0].deliveryAddress"))?e(de,{to:"/information"}):pe(m)?e(je,{}):o?.status!=="filled"?e(z,{}):a.length===0?e(z,{}):e(he,{lines:a,loading:D})}const H=i=>e(A,{children:i});function si(){const i=ue(),{nextPage:o,previousPage:t}=ge(),{progress:_,progressing:h}=me(),{value:c,loading:u}=F(),{value:d}=ye(),n=S(),g=n("shipping.shipping_method_title"),m=n("shipping.duties_and_taxes_title"),x=n("general.continue_to_payment_method"),D=T(),p=ve(),a=fe(),M=be(),{showShipmentBreakdown:s}=Se(),{hasMultipleDeliveryGroups:y,onlyDeliveryGroupType:l}=_e(),{extensionsBefore:v,extensionsAfter:$}=xe({hasMultipleDeliveryGroups:y,targeted:!1}),j=R("Checkout::Dynamic::Render","DELIVERY1"),J=R("Checkout::Dynamic::Render","DELIVERY2"),[k,K]=E(!1);P(()=>{!u&&!k&&K(!0)},[u,k]),De({stage:u?B.Usable:B.Complete,id:"Shipping"});const w=ke();Ee(w,{pageInteractive:k});const X=Pe(w,_),I=c==null||c.status==="unavailable";Ae(L=>{L.type==="success"&&L.negotiationStage==="progression"&&(p("pageSubmit",{timestamp:new Date}),a({type:"page_submit",page:"shipping"}))});const C=!!c;return P(()=>{C&&(p("shippingMethodsFilled",{timestamp:new Date}),a({type:"shipping_methods_filled"}))},[C,p,a]),e(He,{children:[e(Te,{children:n("shipping.title")}),e(Me,{onSubmit:X,disabled:h||I,implicitSubmit:x,children:e(we,{section:"delivery",children:e(Ie,{section:"delivery",children:e(Ue,{children:[e(Ve,{children:[e(f,{extensions:j,render:H}),e(A,{accessibilityLabel:g,children:e(b,{spacing:M||s?"small400":"base",children:[e(b,{spacing:"small400",children:[e(G,{autoFocus:!D,id:W,level:1,children:g}),Ce("shipping.shipping_method_notice",i)?e(Le,{children:n("shipping.shipping_method_notice")}):null]}),e(b,{children:e(Re,{children:[s?e(Be,{children:e($e,{})}):null,e(f,{extensions:v,options:{groupType:l&&N(l),includeDeliverySelectionGroups:!1}}),e(Je,{}),e(f,{extensions:$,options:{groupType:l&&N(l),includeDeliverySelectionGroups:!1}})]})})]})}),d?.refuseDutiesPermitted&&e(A,{accessibilityLabel:m,children:e(b,{spacing:"large200",children:[e(G,{id:`${W}-duties-and-taxes`,level:1,children:m}),e(Ge,{})]})}),e(f,{extensions:J,render:H})]}),e(qe,{children:[e(Fe,{children:e(O,{inlineSize:"fill",disabled:I,type:"submit",loading:h,size:"large",pixelId:"go_to_next_step",variant:"primary",children:o.label})}),t.route?e(Ye,{children:e(O,{href:t.route,variant:"plain",inlineSize:"fill",textDecoration:"none",pixelId:"go_to_previous_step",children:e(We,{spacing:"small200",blockAlignment:"center",children:[e(Ne,{type:"chevron-left",size:"small"}),e(Oe,{children:t.label})]})})}):null]})]})})})}),e(ze.Prefetch,{})]})}export{si as default};