import{r as s,d as i,h as t}from"./p-f8363b1b.js";const e=class{constructor(t){s(this,t),this.ionInput=i(this,"ionInput",7),this.fireenjinSelectUser=i(this,"fireenjinSelectUser",7),this.placeholder="Search Users",this.disableSearch=!1,this.mode="inline",this.limit=5,this.results=[]}async selectUser(s,i){this.value=i.email,this.fireenjinSelectUser.emit({event:s,user:i}),setTimeout((async()=>{await this.inputSearchEl.checkValidity({setValidationClass:!0})}),200),"popover"===this.mode?await this.inputSearchEl.closePopover():"inline"===this.mode&&await this.inputSearchEl.clearResults()}render(){return t("fireenjin-input-search",{labelPosition:this.labelPosition,lines:this.lines,iconEnd:this.iconEnd,iconStart:this.iconStart,mode:this.mode,label:this.label,ref:s=>this.inputSearchEl=s,endpoint:"searchUsers",resultsKey:"searchUsers.results",name:this.name,searchParams:{limit:this.limit?this.limit:null},results:this.results,placeholder:this.placeholder,value:this.value,template:s=>t("ion-item",{onClick:i=>this.selectUser(i,s),style:{cursor:"pointer"}},t("ion-label",null,t("h2",null,s.firstName?s.firstName:""," ",s.lastName?s.lastName:""),t("p",null,s.email?s.email:"No email on file")),t("ion-icon",{name:"checkmark-circle"}))},t("slot",{name:"start"}),t("slot",{name:"end"}))}};e.style="";export{e as fireenjin_input_search_user}