var __spreadArray=this&&this.__spreadArray||function(t,e){for(var s=0,r=e.length,i=t.length;s<r;s++,i++)t[i]=e[s];return t};import{r as registerInstance,c as createEvent,h}from"./index-98dfb63a.js";import{d as dist,a as Customer}from"./index-997ef4e9.js";import"./index-649488b2.js";import"./Token-0644b4fc.js";var styleCss=".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}";var IntergiroCustomers=function(){function t(t){registerInstance(this,t);this.updateCustomers=createEvent(this,"updateCustomers",7);this.selected={}}t.prototype.componentWillLoad=function(){if(!this.customersFiltered)this.filterCustomers()};t.prototype.handleFilterChanged=function(t){this.filter=t.detail;t.stopPropagation()};t.prototype.filterCustomers=function(){var t=this.customers&&(this.filter?dist.filter(this.filter,this.customers):__spreadArray([],this.customers));this.customersFiltered=t};t.prototype.handleSelectedChanged=function(t){this.selected=t.detail};t.prototype.onCreate=function(t){this.updateCustomers.emit(t.detail)};t.prototype.render=function(){var t=this;return[h("ig-filter",{template:Customer.template,filter:this.filter}),h("ig-customer-actions",{whitelist:this.whitelist,selected:this.selected}),h("ig-customers-table",{customers:this.customersFiltered,orders:this.orders,selected:this.selected,whitelist:this.whitelist}),h("ig-customer-create-popup",{hidden:true,onCreate:function(e){return t.onCreate(e)}}),h("ig-customers-footer",{customers:this.customersFiltered})]};Object.defineProperty(t,"watchers",{get:function(){return{customers:["filterCustomers"],filter:["filterCustomers"]}},enumerable:false,configurable:true});return t}();IntergiroCustomers.style=styleCss;export{IntergiroCustomers as ig_customers};