1import{q as K,u as e,A as L,k as Q,e as X,h as Z,f as c,_ as ee,i as d,j as ie,G as U,p as te,S as ne}from"./esnext-vendor.BBoIVOQW.js";import{L as se,bs as ae,bt as oe,bu as re,bv as le,J as pe,f as de,bw as ce,bx as ue,q as I,b1 as he,m as ge,N as me,K as ve,M as ye,U as w,Y as x,k as f,n as z,by as G,P as fe,a6 as Se,Q as R,I as be,l as _e,bz as ke,aw as Pe}from"./hydrate.Tsur0pib.js";import{T as De}from"./TransitionHeight.BCpWGRvL.js";import{u as Ae,S as we,D as Ee}from"./ShippingLines.a_Lo3tMv.js";import{u as xe,b as Me,d as Te,c as Ce,P as Le,a as Ie,S as N}from"./Page.B9pV9lua.js";import{S as ze}from"./ShipmentBreakdown.BNMywNRQ.js";import{T as h,bV as Ge,a5 as M,bf as F,W,aO as Re,t as Ne,I as Oe,ai as Be,be as Ue,bJ as Fe}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{P as We}from"./PendingShipping.B15tiX3F.js";import{a as q,b as H,E as J}from"./IncentiveBadge.DttARc72.js";import{b as qe,c as He,u as Je}from"./MerchandiseModal.BB8GJAb2.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"./ShippingMethodSelector.DQZ35n22.js";import"./TextArea.An2gFfWj.js";import"./localization-index.P2wbDjPJ.js";import"./ShippingMethodRateLabel.Doe-JTYM.js";import"./EstimatedDeliveryContent.B6SO5ZZV.js";import"./PhoneField.D8EvZ0Pm.js";import"./shipping-methods-grouping.S_i1LuzE.js";import"./amazon-pay-useAmazonPayPaymentLine.CMgi35Fb.js";import"./hooks-useSuppressShopPayModalOnLoad.CwH45iIp.js";import"./SubscriptionPriceBreakdown.CqzG7Z3N.js";function Ve(){const{userEvents:i}=h(),t=Ge();return K((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 V="/cdn/shopifycloud/checkout-web/assets/c1/assets/shipping.CG9i_A4v.svg",Y=()=>{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(J,{children:[!s&&e(q,{children:e("img",{src:V,alt:""})}),e(H,{children:i.translate("shipping.shipping_information_required_notice",{link:n})})]})},Ye=()=>{const{i18n:i,checkout:t}=h(),s=t.configuration.layout.isOnePage.value;return e(J,{children:[!s&&e(q,{children:e("img",{src:V,alt:""})}),e(H,{children:i.translate("shipping_errors.shipping_method_not_available_generic.one")})]})};function $e(){const{i18n:i}=h(),t=ae(),{allViolations:s,deliveryNext:n}=M(),a=F("deliveryNext"),r=Ve(),l=L(a.peek()),[,g]=Q(),m=L(void 0),u=X(!1),{shippingAddress:S}=W(),E=Ae(g),b=oe();Z(()=>{u.value=!0},[u]);const p=c(()=>{const o=t.value.shippableDeliveryLines;return o?Re(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,D=p.peek()[0]?.methods[0]?.deliveryPromiseProviderApiClientId;if(m.current=void 0,!D)return;const A=Oe(D);U(()=>{r(P,v,Number(A)),b(P,Number(A))})}),[a,b,p,r]);const _=c(()=>s.value?.some(o=>"target"in o&&o.target.startsWith("$.cart.deliveryGroups[0].deliveryAddress"))),k=c(()=>je({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(We,{text:i.translate("shipping.waiting_on_rate_notice")}),children:e(d,{when:()=>!_.value,fallback:e(Ke,{}),children:e(d,{when:()=>!Ne(S.value),fallback:e(Y,{}),children:e(d,{when:()=>n.value?.status==="filled",fallback:e(O,{}),children:e(d,{when:()=>p.value.length>0,fallback:e(O,{}),children:e(we,{lines:p.value,loading:E})})})})})})}function je({deliveryLoading:i,showLoading:t,hasMounted:s,hasFilledShippingMethods:n}){return i&&t&&(s||!n)}function O(){const{deliveryNext:i,shippingAddress:t}=M(),{shippingAddress:s}=W(),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(Y,{}),children:e(Ye,{})})}function Ke(){const{router:i}=h();return i.redirect("/information"),null}const B=i=>e(x,{children:i});function Pi(){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"),E=i.translate("general.continue_to_payment_method"),b=t.configuration.layout.isOnePage.value,p=ce(),_=ue(),k=qe(),o=c(()=>Fe(l.value)||k.value.showShipmentBreakdown?"small-400":"base"),v=He(),{
1customizationsBefore:P,customizationsAfter:D}=Je({hasMultipleDeliveryGroups:v.value.hasMultipleDeliveryGroups,targeted:!1}).value,A=I("Checkout::Dynamic::Render","DELIVERY1"),$=I("Checkout::Dynamic::Render","DELIVERY2");xe({stage:m?N.Usable:N.Complete,id:"Shipping"}),Be("shipping");const T=c(()=>l.value==null||l.value.status==="unavailable");he(y=>{y.type==="success"&&y.negotiationStage==="progression"&&(p("pageSubmit",{timestamp:new Date}),_({type:"page_submit",page:"shipping"}))});const j=c(()=>!!l.value);te(()=>{j.value&&U(()=>{p("shippingMethodsFilled",{timestamp:new Date}),_({type:"shipping_methods_filled"})})});const C=c(()=>{const y=v.value.onlyDeliveryGroupType;return{groupType:y?Pe(y):void 0,includeDeliverySelectionGroups:!1}});return e(ne,{children:[e(ge,{children:i.translate("shipping.title")}),e(me,{onSubmit:()=>a("shipping-page-submit"),disabled:r.value||T.value,implicitSubmit:E,children:e(ve,{section:"delivery",children:e(ye,{section:"delivery",children:e(Me,{children:[e(Te,{children:[e(w,{customizations:A,render:B}),e(x,{accessibilityLabel:u,children:e(f,{gap:o.value,children:[e(f,{gap:"small-400",children:[e(z,{autoFocus:!b,id:G,level:1,children:u}),Ue("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(De,{children:e(ze,{})})}),e(w,{customizations:P,options:C.value}),e($e,{}),e(w,{customizations:D,options:C.value})]})})]})}),e(d,{when:()=>g.value?.refuseDutiesPermitted,children:e(x,{accessibilityLabel:S,children:e(f,{gap:"large-200",children:[e(z,{id:`${G}-duties-and-taxes`,level:1,children:S}),e(Ee,{})]})})}),e(w,{customizations:$,render:B})]}),e(Ce,{children:[e(Le,{children:e(R,{inlineSize:"fill",disabled:T.value,type:"submit",loading:r.value,size:"large",pixelId:"go_to_next_step",variant:"primary",children:s.label})}),n.route?e(Ie,{children:e(R,{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{Pi 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.