1import{q as e,u as i,A as a,k as s,e as t,h as n,f as r,_ as l,i as o,j as c,G as d,o as p,S as u}from"./2c1ab0fe.D_oO1jU7.js";import{L as h,bO as m,bP as v,bQ as g,bR as f,K as b,h as _,bS as y,bT as j,p as k,M as w,be as D,R as S,N as x,O as P,U as z,_ as A,c as I,H as L,bU as N,P as M,a6 as E,V as G,I as O,n as R,bV as T}from"./164ad2e3.DgUUtBtV.js";import{T as C}from"./7b0c98ea.0CGJF8wQ.js";import{u as V,S as F,D as B}from"./d6447d9e.wAHKQJgC.js";import{b as U,d as Q,c as q,P as W,a as Y}from"./a25deb9a.XIOr6b3K.js";import{S as $}from"./f51e663e.C08Dmcez.js";import{O as H,bZ as K,P as X,bb as Z,Q as J,aA as ee,o as ie,G as ae,bz as se}from"./4c290a1e.D9lE9kmU.js";import{P as te}from"./f49d4216.DMwWemXC.js";import{a as ne,b as re,E as le}from"./a422df8c.CGT3eUwi.js";import{T as oe,h as ce}from"./65f3d4da.8ZfwXSRH.js";import{m as de}from"./ac5a19ff.CrIDx928.js";import{b as pe,c as ue,u as he}from"./64de7b49.Dffug7P1.js";import{u as me,S as ve}from"./ca5e9c49.BL-l7mUG.js";import"./app.bDJ3v-8C.js";import"./60a453ce.BIyixFcg.js";import"./0a7dffce.BMM606kb.js";import"./bb728e1c.BObJOhlA.js";import"./efa0389a.-R9eik6_.js";import"./8e79be58.CObm0ydZ.js";import"./3ca8ef7e.DT3qvctx.js";import"./31cc568e.CsDC1k63.js";import"./8599b02a.yKiXuwTF.js";import"./347b440c.oWH9qB5Z.js";import"./d5d34b3b.HJgnljYP.js";import"./47b970b2.Bspt4mBz.js";import"./29034f35.BY8rOPhQ.js";import"./90e26f5f.DVFq2b8a.js";const ge="/cdn/shopifycloud/checkout-web/assets/c1/assets/shipping.CG9i_A4v.svg",fe=()=>{const{i18n:e,checkout:a}=H(),s=a.configuration.layout.isOnePage.value,t=i(h,{href:"/information",children:e.translate("shipping.shipping_information_redirect_link")});return i(le,{children:[!s&&i(ne,{children:i("img",{src:ge,alt:""})}),i(re,{children:e.translate("shipping.shipping_information_required_notice",{link:t})})]})},be=()=>{const{i18n:e,checkout:a}=H(),s=a.configuration.layout.isOnePage.value;return i(le,{children:[!s&&i(ne,{children:i("img",{src:ge,alt:""})}),i(re,{children:e.translate("shipping_errors.shipping_method_not_available_generic.one")})]})};function _e(){const{i18n:p}=H(),u=m(),{allViolations:h,deliveryNext:g}=X(),f=Z("deliveryNext"),b=function(){const{userEvents:i}=H(),a=K();return e(((e,s,t)=>{const n={schemaId:"checkout_display_shipping_methods/1.0",payload:{eventTimestamp:s,shopId:a.value.defaultAttributes?.shopId||1,apiClientId:t,promiseRetrievalTime:e}};i.monorailEvent(n)}),[i,a.value.defaultAttributes?.shopId])}(),_=a(f.peek()),[,y]=s(),j=a(void 0),k=t(!1),{shippingAddress:w}=J(),D=V(y),S=v();n((()=>{k.value=!0}),[k]);const x=r((()=>{const e=u.value.shippableDeliveryLines;return e?ee(e):[]}));l((()=>c((()=>{if(f.value)return void(j.current??=Date.now());_.current=!1;const e=j.current;if(null==e)return;const i=Date.now(),a=i-e,s=x.peek()[0]?.methods[0]?.deliveryPromiseProviderApiClientId;if(j.current=void 0,!s)return;const t=ae(s);d((()=>{b(a,i,Number(t)),S(a,Number(t))}))}))),[f,S,x,b]);const P=r((()=>h.value?.some((e=>"target"in e&&e.target.startsWith("$.cart.deliveryGroups[0].deliveryAddress"))))),z=r((()=>function({deliveryLoading:e,showLoading:i,hasMounted:a,hasFilledShippingMethods:s}){return e&&i&&(a||!s)}({deliveryLoading:f.value,showLoading:_.current,hasMounted:k.value,hasFilledShippingMethods:"filled"===g.value?.status&&x.value.length>0})));return i(o,{when:()=>!z.value,fallback:i(te,{text:p.translate("shipping.waiting_on_rate_notice")}),children:i(o,{when:()=>!P.value,fallback:i(je,{}),children:i(o,{when:()=>!ie(w.value),fallback:i(fe,{}),children:i(o,{when:()=>"filled"===g.value?.status,fallback:i(ye,{}),children:i(o,{when:()=>x.value.length>0,fallback:i(ye,{}),children:i(F,{lines:x.value,loading:D})})})})})})}function ye(){const{deliveryNext:e,shippingAddress:a}=X(),{shippingAddress:s}=J(),t=g();return i(o,{when:()=>{const i=s.value,n=t(i);return f({deliveryNext:e.value,proposedAddress:i,negotiatedAddress:a.value,reloadStrategy:n})},fallback:i(fe,{}),children:i(be,{})})}function je(){const{router:e}=H();return e.redirect("/information"),null}const ke=e=>i(A,{children:e});function we(){const{i18n:e,checkout:a}=H(),{nextPage:s,previousPage:t}=b(),{progress:n,progressing:l}=_(),{deliveryNext:c,optionalDuties:h}=X(),m=Z("deliveryNext").value,v=e.translate("shipping.shipping_method_title"),g=e.translate("shipping.duties_and_taxes_title"),f=e.translate("general.continue_to_payment_method"),V=a.configuration.layout.isOnePage.value,F=y(),K=j(),J=pe(),ee=r((()=>se(c.value)||J.value.showShipmentBreakdown?"small-400":"base")),ie=ue(),{customizationsBefore:ae,customizationsAfter:te}=he({hasMultipleDeliveryGroups:ie.value.hasMultipleDeliveryGroups,targeted:!1}).value,ne=k("Checkout::Dynamic::Render","DELIVERY1"),re=k("Checkout::Dynamic::Render","DELIVERY2");me({stage:m?ve.Usable:ve.Complete,id:"Shipping"}),w("shipping");const le=r((()=>null==c.value||"unavailable"===c.value.status));D((e=>{"success"===e.type&&"progression"===e.negotiationStage&&(F("pageSubmit",{timestamp:new Date}),K({type:"page_submit",page:"shipping"}))}));const ge=r((()=>Boolean(c.value)));p((()=>{ge.value&&d((()=>{F("shippingMethodsFilled",{timestamp:new Date}),K({type:"shipping_methods_filled"})}))}));const fe=r((()=>{const e=ie.value.onlyDeliveryGroupType;return{groupType:e?de(e):void 0,includeDeliverySelectionGroups:!1}}));return i(u,{children:[i(oe,{children:e.translate("shipping.title")}),i(S,{onSubmit:()=>n("shipping-page-submit"),disabled:l.value||le.value,implicitSubmit:f,children:i(x,{section:"delivery",children:i(P,{section:"delivery",children:i(U,{children:[i(Q,{children:[i(z,{customizations:ne,render:ke}),i(A,{accessibilityLabel:v,children:i(I,{gap:ee.value,children:[i(I,{gap:"small-400",children:[i(L,{autoFocus:!V,id:N,level:1,children:v}),ce("shipping.shipping_method_notice",e)?i(M,{children:e.translate("shipping.shipping_method_notice")}):null]}),i(I,{gap:"base",children:i(E,{children:[i(o,{when:()=>J.value.showShipmentBreakdown,children:i(C,{children:i($,{})})}),i(z,{customizations:ae,options:fe.value}),i(_e,{}),i(z,{customizations:te,options:fe.value})]})})]})}),i(o,{when:()=>h.value?.refuseDutiesPermitted,children:i(A,{accessibilityLabel:g,children:i(I,{gap:"large-200",children:[i(L,{id:`${N}-duties-and-taxes`,level:1,children:g}),i(B,{})]})})}),i(z,{customizations:re,render:ke})]}),i(q,{children:[i(W,{children:i(G,{inlineSize:"fill",disabled:le.value,type:"submit",loading:l.value,size:"large",pixelId:"go_to_next_step",variant:"primary",children:s.label})}),t.route?i(Y,{children:i(G,{href:t.route,variant:"plain",inlineSize:"fill",textDecoration:"none",pixelId:"go_to_previous_step",children:i(I,{direction:"inline",gap:"small-200",alignItems:"center",children:[i(O,{type:"chevron-left",size:"small"}),i(R,{children:t.label})]})})}):null]})]})})})}),i(T.Prefetch,{})]})}
1export{we 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.