const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["component-SubscriptionGroupLine.CSr12qRp.js","dist-vendor.DBR6g02j.js","shop-pay-ButtonWithRegisterWebPixel.Bb6ujYnt.js","shop-pay-FullScreenBackground.CUfzz8_n.js","app.KE0-95OJ.js","assets/app.fH9d1Lew.css","assets/FullScreenBackground.-XSmsMDv.css","images-flag-icon.C_eXYJRt.js","images-payment-icon.BXeXx6hF.js","assets/ButtonWithRegisterWebPixel.BztvPw8A.css","hooks-SubscriptionPriceBreakdown.C9qdq8J0.js","assets/SubscriptionPriceBreakdown.BSemv9tH.css","components-ShipmentLine.mg09Rb5v.js","hooks-MerchandiseModal.D9nwZJ9z.js","utilities-shipping-options.B2lHBfDE.js","MerchandisePreviewThumbnail-StackedMerchandisePreview.CMjBZmt9.js","assets/StackedMerchandisePreview.D6OuIVjc.css"])))=>i.map(i=>d[i]);
import{a as b,g as v,r as S,u as e,f,k}from"./dist-vendor.DBR6g02j.js";import{o as T,a as _,p as x,q as I}from"./shop-pay-FullScreenBackground.CUfzz8_n.js";import{N as w,R as h,ae as g,k as a,G as B,af as y,T as u,I as m,ag as D,t as L,ah as C}from"./shop-pay-ButtonWithRegisterWebPixel.Bb6ujYnt.js";import{u as G,M as P,a as R}from"./hooks-MerchandiseModal.D9nwZJ9z.js";import{_ as q}from"./app.KE0-95OJ.js";import{S as A,M}from"./MerchandisePreviewThumbnail-StackedMerchandisePreview.CMjBZmt9.js";function z(n){return n.status==="available"&&n.methods.some(({methodType:i})=>i==="SHIPPING"||i==="LOCAL")}function J(){const n=T();return b(()=>{const i=n.value?.filter(z);return{shippableDeliveryLines:i?.length?i:void 0}})}const N=v({load:()=>S(()=>q(()=>import("./component-SubscriptionGroupLine.CSr12qRp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])))});function K({subscriptionLines:n}){const{i18n:i}=_(),{extensionsBefore:s,extensionsAfter:t}=G({targeted:!0,hasMultipleDeliveryGroups:!0}),l=n.length;return l===0?null:e(B,{gridAutoRows:"minmax(auto, max-content)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(auto, max-content)",gap:"small-200",children:[e(w,{level:3,children:i.translate("shipping.shipping_method_recurring_shipments_group_title.other")}),e(h,{extensions:s,options:{groupType:g("SUBSCRIPTION"),includeDeliverySelectionGroups:!1}}),e(a,{background:"subdued",padding:"base",borderRadius:"base",gap:"@media (inline-size >= extraSmall) small-100, small-200",children:n.map((r,c)=>e(N,{subscriptionLine:r,subscriptionLinesLength:l,index:c,showDivider:!1},r.id||x()))}),e(h,{extensions:t,options:{groupType:g("SUBSCRIPTION"),includeDeliverySelectionGroups:!1}})]})}function O({quantityTitle:n,open:i,onClick:s,controlId:t}){return e(y,{expanded:i,controlId:t,onClick:s,children:e(a,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(u,{children:n}),e(m,{size:"small-200",type:i?"chevron-up":"chevron-down"})]})})}function E({targetMerchandiseLines:n,selectedDeliveryMethod:i,merchandiseQuantityText:s,modalHeader:t}){return e(y,{overlay:e(P,{merchandiseLines:n,deliveryMethod:i,modalHeader:t}),children:e(a,{direction:"inline",alignItems:"center",gap:"base",children:[n.length>1?e(A,{merchandiseItem:n[0],merchandiseLinesLength:n.length}):e(M,{merchandiseItem:n[0],hideBadge:!0}),e(a,{direction:"inline",alignItems:"center",gap:"small-500",children:[e(m,{tone:"accent",type:"truck",size:"small"}),e(u,{tone:"accent",size:"small",children:s})]})]})})}function W(){const{i18n:n}=_(),[i,s]=f(!1),{selectedDeliveryMethod:t}=R().value,l=I();if(!t)return null;const o=t.priceBreakdown??[],r=n.translate("shipping.split_shipping_multiple_shipment_quantity_label",{quantity:o.length}),c=l.value?n.translate("shipping.split_shipping_first_shipment_notice",{quantity_shipments:r}):n.translate("shipping.split_shipping_shipment_notice",{quantity_shipments:r});return e(k,{children:[e(u,{color:"subdued",children:e(a,{direction:"inline",alignItems:"center",gap:"small-500",children:[e(m,{type:"truck"}),e(O,{quantityTitle:c,open:i,onClick:()=>s(p=>!p),controlId:"shipmentBreakdown"})]})}),e(D,{open:i,id:"shipmentBreakdown",children:[e(L,{blockSize:"small-100"}),e(a,{gap:"small-100",children:o.map(({targetMerchandiseLines:p},d)=>e(E,{targetMerchandiseLines:p,selectedDeliveryMethod:t,merchandiseQuantityText:n.translate("order_summary.discount_discovery.merchandise_quantity_label",{count:C(p)}),modalHeader:n.translate("shipping.split_shipping_merchandise_shipment_number",{number:d+1,total:o.length})},d))})]})]})}export{W as S,K as a,z as s,J as u};
