import{r as e,c as t,h as a}from"./p-9add63ef.js";import{s}from"./p-1282ed4a.js";import"./p-2b28ea49.js";import"./p-dd24e53c.js";import"./p-d3366af3.js";import"./p-401e165e.js";import"./p-830ab1a3.js";import"./p-ec182234.js";import"./p-3f6362a4.js";import"./p-31faf2b8.js";import"./p-610295e2.js";const i=".cart-header{display:flex;align-items:center;justify-content:space-between;width:100%;font-size:1em}.cart-title{text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 var(--sc-spacing-small)}.cart__close{cursor:pointer}";const o=i;const r=class{constructor(a){e(this,a);this.scCloseCart=t(this,"scCloseCart",7)}getItemsCount(){var e,t;const a=((t=(e=s.checkout)===null||e===void 0?void 0:e.line_items)===null||t===void 0?void 0:t.data)||[];let i=0;a.forEach((e=>{i=i+(e===null||e===void 0?void 0:e.quantity)}));return i}render(){var e;return a("div",{key:"a98d0178e7cee53855de66b2b8a482a7b3979b4f",class:"cart-header"},a("sc-icon",{key:"6d033a04e5bf15426db6bf0209adb82fc24f3518",class:"cart__close",name:"arrow-right",onClick:()=>this.scCloseCart.emit(),onKeyDown:e=>{if("Enter"===(e===null||e===void 0?void 0:e.code)||"Space"===(e===null||e===void 0?void 0:e.code)){this.scCloseCart.emit()}},tabIndex:0,role:"button","aria-label":wp.i18n.__("Close Cart","surecart")}),a("div",{key:"2fc4b580ae472ff20329a16a76a5d35090891c6e",class:"cart-title"},a("slot",{key:"f24d357acfa1ac9c5fa5c6382790c1c74f31d3d9"})),a("sc-tag",{key:"13ae05191d43b57a126fe93df4b520cd6c34f082",size:"small"},((e=this===null||this===void 0?void 0:this.getItemsCount)===null||e===void 0?void 0:e.call(this))||0))}};r.style=o;export{r as sc_cart_header};
//# sourceMappingURL=p-813e9a25.entry.js.map