1import{q as Y,u as e,A as L,l as K,e as Z,h as X,g as c,_ as ee,k as d,j as ie,f as B,p as te,S as ne}from"./2c1ab0fe.BqEHHmaW.js";import{L as se,bO as ae,bP as oe,bQ as re,bR as le,K as pe,h as de,bS as ce,bT as ue,p as I,M as he,be as ge,R as me,N as ve,O as ye,U as E,_ as w,c as f,H as z,bU as R,P as fe,a6 as Se,V as G,I as be,n as _e,bV as ke}from"./164ad2e3.BA-GikTU.js";import{T as Pe}from"./7b0c98ea.B-oVlYQI.js";import{u as Ae,S as De,D as Ee}from"./d6447d9e.C1rIjiBE.js";import{b as Te,d as we,c as Me,P as xe,a as Ce}from"./a25deb9a.BtBRFgl8.js";import{S as Le}from"./f51e663e.BRJDCQ0a.js";import{O as h,bZ as Ie,P as M,bb as F,Q as H,aA as ze,o as Re,G as Ge,bz as Ne}from"./4c290a1e.FJVsH4yi.js";import{P as Oe}from"./f49d4216.DkTq21k4.js";import{a as V,b as W,E as q}from"./a422df8c.ggO-AlYl.js";import{T as Ue,h as Be}from"./65f3d4da.BdKZt11Z.js";import{m as Fe}from"./ac5a19ff.BHoedVx2.js";import{b as He,c as Ve,u as We}from"./64de7b49.DBBYkFfY.js";import{u as qe,S as N}from"./ca5e9c49.COugV1Xp.js";import"./app.D2gvVyTR.js";import"./60a453ce.BClq-svk.js";import"./0a7dffce.BHf0S_6c.js";import"./bb728e1c.uhKc-SJ5.js";import"./efa0389a.CmzfQUTJ.js";import"./8e79be58.BAhOGoFB.js";import"./3ca8ef7e.D9Nch_50.js";import"./31cc568e.Dti0cJak.js";import"./8599b02a.DjDpxYLZ.js";import"./347b440c.DhRFIYzk.js";import"./d5d34b3b.D_UYHSjm.js";import"./47b970b2.BwzlBSwQ.js";import"./29034f35.CKhRr7lV.js";import"./90e26f5f.RxBZE9Nq.js";function $e(){const{userEvents:i}=h(),t=Ie();return Y((n,a,r)=>{const l=t.value.defaultAttributes?.shopId||1,g={schemaId:"checkout_display_shipping_methods/1.0",payload:{eventTimestamp:a,shopId:l,apiClientId:r,promiseRetrievalTime:n}};i.monorailEvent(g)},[i,t.value.defaultAttributes?.shopId])}const $="/cdn/shopifycloud/checkout-web/assets/c1/assets/shipping.CG9i_A4v.svg",j=()=>{const{i18n:i,checkout:t}=h(),s=t.configuration.layout.isOnePage.value,n=e(se,{href:"/information",children:i.translate("shipping.shipping_information_redirect_link")});return e(q,{children:[!s&&e(V,{children:e("img",{src:$,alt:""})}),e(W,{children:i.translate("shipping.shipping_information_required_notice",{link:n})})]})},je=()=>{const{i18n:i,checkout:t}=h(),s=t.configuration.layout.isOnePage.value;return e(q,{children:[!s&&e(V,{children:e("img",{src:$,alt:""})}),e(W,{children:i.translate("shipping_errors.shipping_method_not_available_generic.one")})]})};function Je(){const{i18n:i}=h(),t=ae(),{allViolations:s,deliveryNext:n}=M(),a=F("deliveryNext"),r=$e(),l=L(a.peek()),[,g]=K(),m=L(void 0),u=Z(!1),{shippingAddress:S}=H(),T=Ae(g),b=oe();X(()=>{u.value=!0},[u]);const p=c(()=>{const o=t.value.shippableDeliveryLines;return o?ze(o):[]});ee(()=>ie(()=>{if(a.value){m.current??=Date.now();return}l.current=!1;const o=m.current;if(o==null)return;const v=Date.now(),P=v-o,A=p.peek()[0]?.methods[0]?.deliveryPromiseProviderApiClientId;if(m.current=void 0,!A)return;const D=Ge(A);B(()=>{r(P,v,Number(D)),b(P,Number(D))})}),[a,b,p,r]);const _=c(()=>s.value?.some(o=>"target"in o&&o.target.startsWith("$.cart.deliveryGroups[0].deliveryAddress"))),k=c(()=>Qe({deliveryLoading:a.value,showLoading:l.current,hasMounted:u.value,hasFilledShippingMethods:n.value?.status==="filled"&&p.value.length>0}));return e(d,{when:()=>!k.value,fallback:e(Oe,{text:i.translate("shipping.waiting_on_rate_notice")}),children:e(d,{when:()=>!_.value,fallback:e(Ye,{}),children:e(d,{when:()=>!Re(S.value),fallback:e(j,{}),children:e(d,{when:()=>n.value?.status==="filled",fallback:e(O,{}),children:e(d,{when:()=>p.value.length>0,fallback:e(O,{}),children:e(De,{lines:p.value,loading:T})})})})})})}function Qe({deliveryLoading:i,showLoading:t,hasMounted:s,hasFilledShippingMethods:n}){return i&&t&&(s||!n)}function O(){const{deliveryNext:i,shippingAddress:t}=M(),{shippingAddress:s}=H(),n=re();return e(d,{when:()=>{const a=s.value,r=n(a);return le({deliveryNext:i.value,proposedAddress:a,negotiatedAddress:t.value,reloadStrategy:r})},fallback:e(j,{}),children:e(je,{})})}function Ye(){const{router:i}=h();return i.redirect("/information"),null}const U=i=>e(w,{children:i});function Ai(){const{i18n:i,checkout:t}=h(),{nextPage:s,previousPage:n}=pe(),{progress:a,progressing:r}=de(),{deliveryNext:l,optionalDuties:g}=M(),m=F("deliveryNext").value,u=i.translate("shipping.shipping_method_title"),S=i.translate("shipping.duties_and_taxes_title"),T=i.translate("general.continue_to_payment_method"),b=t.configuration.layout.isOnePage.value,p=ce(),_=ue(),k=He(),o=c(()=>Ne(l.value)||k.value.showShipmentBreakdown?"small-400":"base"),v=Ve(),{customizationsBefore:P,customizationsAfter:A}=We({hasMultipleDeliveryGroups:v.value.hasMultipleDeliveryGroups,targeted:!1}).value,D=I("Checkout::Dynamic::Render","DELIVERY1"),J=I("Checkout::Dynamic::Render","DELIVERY2");qe({stage:m?N.Usable:N.Complete,id:"Shipping"}),he("shipping");const x=c(()=>l.value==null||l.value.status==="unavailable");
1ge(y=>{y.type==="success"&&y.negotiationStage==="progression"&&(p("pageSubmit",{timestamp:new Date}),_({type:"page_submit",page:"shipping"}))});const Q=c(()=>!!l.value);te(()=>{Q.value&&B(()=>{p("shippingMethodsFilled",{timestamp:new Date}),_({type:"shipping_methods_filled"})})});const C=c(()=>{const y=v.value.onlyDeliveryGroupType;return{groupType:y?Fe(y):void 0,includeDeliverySelectionGroups:!1}});return e(ne,{children:[e(Ue,{children:i.translate("shipping.title")}),e(me,{onSubmit:()=>a("shipping-page-submit"),disabled:r.value||x.value,implicitSubmit:T,children:e(ve,{section:"delivery",children:e(ye,{section:"delivery",children:e(Te,{children:[e(we,{children:[e(E,{customizations:D,render:U}),e(w,{accessibilityLabel:u,children:e(f,{gap:o.value,children:[e(f,{gap:"small-400",children:[e(z,{autoFocus:!b,id:R,level:1,children:u}),Be("shipping.shipping_method_notice",i)?e(fe,{children:i.translate("shipping.shipping_method_notice")}):null]}),e(f,{gap:"base",children:e(Se,{children:[e(d,{when:()=>k.value.showShipmentBreakdown,children:e(Pe,{children:e(Le,{})})}),e(E,{customizations:P,options:C.value}),e(Je,{}),e(E,{customizations:A,options:C.value})]})})]})}),e(d,{when:()=>g.value?.refuseDutiesPermitted,children:e(w,{accessibilityLabel:S,children:e(f,{gap:"large-200",children:[e(z,{id:`${R}-duties-and-taxes`,level:1,children:S}),e(Ee,{})]})})}),e(E,{customizations:J,render:U})]}),e(Me,{children:[e(xe,{children:e(G,{inlineSize:"fill",disabled:x.value,type:"submit",loading:r.value,size:"large",pixelId:"go_to_next_step",variant:"primary",children:s.label})}),n.route?e(Ce,{children:e(G,{href:n.route,variant:"plain",inlineSize:"fill",textDecoration:"none",pixelId:"go_to_previous_step",children:e(f,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(be,{type:"chevron-left",size:"small"}),e(_e,{children:n.label})]})})}):null]})]})})})}),e(ke.Prefetch,{})]})}export{Ai 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.