import{r as t,c as s,h as e}from"./p-e964d29c.js";import{d as i,a as r}from"./p-11286511.js";import"./p-7b48c7c5.js";import"./p-4f46f4bb.js";const o=class{constructor(e){t(this,e),this.updateCustomers=s(this,"updateCustomers",7),this.selected={}}componentWillLoad(){this.customersFiltered||this.filterCustomers()}handleFilterChanged(t){this.filter=t.detail,t.stopPropagation()}filterCustomers(){const t=this.customers&&(this.filter?i.filter(this.filter,this.customers):[...this.customers]);this.customersFiltered=t}handleSelectedChanged(t){this.selected=t.detail}onCreate(t){this.updateCustomers.emit(t.detail)}render(){return[e("ig-filter",{template:r.template,filter:this.filter}),e("ig-customer-actions",{whitelist:this.whitelist,selected:this.selected}),e("ig-customers-table",{customers:this.customersFiltered,orders:this.orders,selected:this.selected,whitelist:this.whitelist}),e("ig-customer-create-popup",{hidden:!0,onCreate:t=>this.onCreate(t)}),e("ig-customers-footer",{customers:this.customersFiltered})]}static get watchers(){return{customers:["filterCustomers"],filter:["filterCustomers"]}}};o.style=".sc-ig-customers-h{display:block;width:100%;max-width:90em;margin:auto}ig-customer-create-popup.sc-ig-customers{bottom:3.5em;margin-right:2.5em}";export{o as ig_customers}