class e{constructor(){this.debounceTimer=null}filter(e,t,s){if(!t||0===t.length)return{filteredItems:[],showNoResults:!0};if(!e||""===e.trim())return{filteredItems:[...t],showNoResults:!1};const i=e.toLowerCase(),l=t.filter((e=>s(e).toLowerCase().includes(i)));return{filteredItems:l,showNoResults:0===l.length}}debounceSearch(e,t,s){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{e(t),this.debounceTimer=null}),s)}cancelDebounce(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}}export{e as C};
