import{F as O,m,r as W,l as $,P as d,_ as v,R as n,a1 as w,S as T,T as t,Q as l,W as o,X as u,a0 as s,a9 as z,a2 as p,Z as A,a6 as E,a7 as Q,e as r}from"./vendor-DYYUXsKb.js";import{bd as R,a_ as X,bD as Z,d as q}from"./index-DlGZkra7.js";import{u as G}from"./useSaveForLater-Ckq7X4Ku.js";import{u as H}from"./useCheckout-Ct_B6cll.js";/* empty css                                                                      */const J={class:"relative"},K={class:"mb-4 flex justify-between text-base font-black"},M={class:"border-y py-2 text-base font-normal"},U={class:"flex justify-between"},Y={key:0},ee={class:"list-disc pl-5 text-neutral-400 print:text-[color:var(--color-additional-950)]"},te={class:"flex items-center justify-between"},ae={class:"text-sm"},ne={key:0},se={class:"flex items-center justify-between"},oe={class:"text-sm"},le={key:1},ce={class:"flex items-center justify-between"},ue={class:"text-sm"},re={class:"flex justify-between"},ie={key:1,class:"flex justify-between"},me={class:"mt-4 flex justify-between text-base font-black"},de={class:"text-[--price-color] print:text-inherit"},ve={key:0,class:"mt-4 text-xs font-normal text-neutral-400"},pe=O({__name:"order-summary",props:{cart:{},selectedItems:{},noShipping:{type:Boolean},footnote:{type:Boolean}},setup(a){const c=a,{currentLanguage:f}=R(),{currentCurrency:g}=Z(),{changing:D}=X(),{changing:j}=H(),{loading:B}=G(),L=m(()=>D.value||j.value||B.value),h=W(!0),b=m(()=>$.sumBy(c.selectedItems??c.cart.items,e=>e.discountTotal?.amount??0)),C=m(()=>"shippingPrice"in c.cart?c.cart.shippingPrice:c.cart.shippingSubTotal),_=m(()=>$.sumBy(c.cart.shipments,e=>e.discountAmount?.amount)),x=m(()=>c.cart.discounts?.length||b.value>0||_.value>0);function S(e){return typeof e?.amount=="object"&&e?.amount!==null?e?.amount.amount:e?.amount}return(e,V)=>{const N=d("VcLoaderOverlay"),i=d("VcPriceDisplay"),I=d("VcIcon"),k=d("VcTotalDisplay"),P=d("VcWidget");return n(),v(P,{id:"order-summary",class:"max-md:mt-5 print:break-inside-avoid",title:e.$t("common.titles.order_summary")},{default:w(()=>[T(e.$slots,"header",{},void 0,!0),t("div",J,[u(N,{visible:L.value},null,8,["visible"]),t("div",K,[t("span",null,s(e.$t("common.labels.subtotal")),1),t("span",null,[u(i,{value:a.cart.subTotal},null,8,["value"])])]),t("div",M,[t("div",U,[(n(),v(z(x.value?"button":"span"),{class:"flex appearance-none items-center",onClick:V[0]||(V[0]=y=>h.value=!h.value)},{default:w(()=>[p(s(e.$t("common.labels.discount"))+" ",1),x.value?(n(),v(I,{key:0,class:"ml-1 fill-primary print:hidden",name:h.value?"chevron-down":"chevron-up",size:"xs"},null,8,["name"])):o("",!0)]),_:1})),a.cart.discountTotal?(n(),l("span",Y,[p(s(a.cart.discountTotal?.amount>0?"-":"")+" ",1),u(i,{value:a.cart.discountTotal},null,8,["value"])])):o("",!0)]),x.value?(n(),l("div",{key:0,class:A(["print:block",{hidden:h.value}])},[t("ul",ee,[(n(!0),l(E,null,Q(a.cart.discounts,(y,F)=>(n(),l("li",{key:F},[t("div",te,[t("span",ae,s(y.description||y.coupon),1),u(k,{amount:-S(y),"currency-code":r(g).code,"culture-name":r(f).cultureName},null,8,["amount","currency-code","culture-name"])])]))),128)),b.value>0?(n(),l("li",ne,[t("div",se,[t("span",oe,s(e.$t("common.labels.line_items")),1),u(k,{amount:-b.value,"currency-code":r(g).code,"culture-name":r(f).cultureName},null,8,["amount","currency-code","culture-name"])])])):o("",!0),_.value>0?(n(),l("li",le,[t("div",ce,[t("span",ue,s(e.$t("common.labels.shipping")),1),u(k,{amount:-_.value,"currency-code":r(g).code,"culture-name":r(f).cultureName},null,8,["amount","currency-code","culture-name"])])])):o("",!0)])],2)):o("",!0),t("div",re,[t("span",null,s(e.$t("common.labels.tax")),1),t("span",null,[p(s(a.cart.taxTotal?.amount>0?"+":"")+" ",1),a.cart.taxTotal?(n(),v(i,{key:0,value:a.cart.taxTotal},null,8,["value"])):o("",!0)])]),a.noShipping?o("",!0):(n(),l("div",ie,[t("span",null,s(e.$t("common.labels.shipping_cost")),1),t("span",null,[p(s(C.value?.amount>0?"+":"")+" ",1),u(i,{value:C.value},null,8,["value"])])]))]),t("div",me,[t("span",null,s(e.$t("common.labels.total")),1),t("span",de,[a.cart.total?(n(),v(i,{key:0,value:a.cart.total},null,8,["value"])):o("",!0)])])]),T(e.$slots,"footer",{},void 0,!0),a.footnote?(n(),l("div",ve,[T(e.$slots,"footnote",{},()=>[p(s(e.$t("common.messages.checkout_pricing_warning")),1)],!0)])):o("",!0)]),_:3},8,["title"])}}}),_e=q(pe,[["__scopeId","data-v-06ef4e31"]]);export{_e as O};
//# sourceMappingURL=order-summary-Bvu9y3wq.js.map
