import{r as o,d as i,h as s}from"./p-f8363b1b.js";import{t as e}from"./p-510e3bc9.js";import"./p-d2ac57a0.js";import"./p-f44f0a67.js";const t=class{constructor(s){o(this,s),this.floodteamOpenModal=i(this,"floodteamOpenModal",7),this.floodteamCloseModal=i(this,"floodteamCloseModal",7),this.fireenjinFetch=i(this,"fireenjinFetch",7),this.user={},this.jobs=[]}async onSuccess(o){var i,s,e,t,n,r;if("addUser"===o.detail.endpoint){const t=document.querySelector("ion-router");if(!t||!(null===(e=null===(s=null===(i=null==o?void 0:o.detail)||void 0===i?void 0:i.data)||void 0===s?void 0:s.addUser)||void 0===e?void 0:e.id))return;t.push(`/users/${o.detail.data.addUser.id}`)}else"editUser"===o.detail.endpoint?this.presentToast():"findUser"===(null===(t=null==o?void 0:o.detail)||void 0===t?void 0:t.endpoint)&&(this.user=null===(r=null===(n=null==o?void 0:o.detail)||void 0===n?void 0:n.data)||void 0===r?void 0:r.user)}async presentToast(){(await e.create({message:"The user has been updated.",duration:2e3})).present()}render(){return[s("ion-content",{scrollEvents:!0,class:"ion-padding"},s("floodteam-title-bar",{pin:{icon:"person",href:`/users/${this.userId}`,name:this.user.firstName||"User"}},s("ion-router-link",{href:"/users"},"Users")),s("ion-grid",null,s("ion-row",null,s("ion-col",null,s("ion-card",{class:"ion-padding"},s("floodteam-form-user",{userId:this.userId,showPhoto:!0}))),s("ion-col",null,s("fireenjin-pagination",{ref:o=>this.paginationEl=o,disableVirtualScroll:!0,listEl:({result:o})=>s("floodteam-item-job",{job:o}),endpoint:"listJobs",limit:4,fetchParams:{withPayables:!0},fetchData:{userId:this.userId},resultsKey:"jobs",query:this.query,removeDuplicates:!0}))))),s("floodteam-navigation-footer",null)]}};t.style="app-user ion-card,app-user ion-card ion-list{overflow:visible !important;contain:none !important}";export{t as app_user}