import{u as e,h as _,b as g}from"./vendor.CynPCimz.js";import{a4 as m,f as s,T as c,a3 as o,b as k,a5 as y,a6 as b,a7 as w,$ as f,a8 as B}from"./app.BXvw8ij6.js";import{M as S}from"./MerchandiseModal.DgHv-af3.js";import{S as T,M as v}from"./StackedMerchandisePreview.C4beDLLT.js";function I({quantityTitle:n,open:i,onClick:a,controlId:t}){return e(m,{expanded:i,controlId:t,onClick:a,children:e(s,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(c,{children:n}),e(o,{size:"small-200",type:i?"chevron-up":"chevron-down"})]})})}function q({targetMerchandiseLines:n,selectedDeliveryMethod:i,merchandiseQuantityText:a,modalHeader:t}){return e(m,{overlay:e(S,{merchandiseLines:n,deliveryMethod:i,modalHeader:t}),children:e(s,{direction:"inline",alignItems:"center",gap:"base",children:[n.length>1?e(T,{merchandiseItem:n[0],merchandiseLinesLength:n.length}):e(v,{merchandiseItem:n[0],hideBadge:!0}),e(s,{direction:"inline",alignItems:"center",gap:"small-500",children:[e(o,{tone:"accent",type:"truck",size:"small"}),e(c,{tone:"accent",size:"small",children:a})]})]})})}function D(){const{i18n:n}=k(),[i,a]=_(!1),{selectedDeliveryMethod:t}=y(),d=b();if(!t)return null;const l=t.priceBreakdown??[],p=n.translate("shipping.split_shipping_multiple_shipment_quantity_label",{quantity:l.length}),u=d?n.translate("shipping.split_shipping_first_shipment_notice",{quantity_shipments:p}):n.translate("shipping.split_shipping_shipment_notice",{quantity_shipments:p});return e(g,{children:[e(c,{color:"subdued",children:e(s,{direction:"inline",alignItems:"center",gap:"small-500",children:[e(o,{type:"truck"}),e(I,{quantityTitle:u,open:i,onClick:()=>a(r=>!r),controlId:"shipmentBreakdown"})]})}),e(w,{open:i,id:"shipmentBreakdown",children:[e(f,{spacing:"small100"}),e(s,{gap:"small-100",children:l.map(({targetMerchandiseLines:r},h)=>e(q,{targetMerchandiseLines:r,selectedDeliveryMethod:t,merchandiseQuantityText:n.translate("order_summary.discount_discovery.merchandise_quantity_label",{count:B(r)}),modalHeader:n.translate("shipping.split_shipping_merchandise_shipment_number",{number:h+1,total:l.length})},h))})]})]})}export{D as S};
