import{r as o,d as i,B as s,h as e}from"./p-9b6cc562.js";import{t}from"./p-a4d32aeb.js";import{s as n}from"./p-889c70e7.js";import"./p-24c4a299.js";import"./p-8cd54418.js";import"./p-e5527167.js";import"./p-95e9f2f6.js";import"./p-86bd3473.js";import"./p-65879f9e.js";import"./p-60cf0cc2.js";const r=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.userId=void 0,this.query=void 0,this.paginationEl=void 0,this.jobs=[]}async onSuccess(o){var i,s,e,t,r,l;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)&&(n.user=null===(l=null===(r=null==o?void 0:o.detail)||void 0===r?void 0:r.data)||void 0===l?void 0:l.user)}async presentToast(){(await t.create({message:"The user has been updated.",duration:2e3})).present()}componentDidLoad(){(null==s?void 0:s.isBrowser)&&setTimeout((()=>{n.feedFetchData={...(null==n?void 0:n.feedFetchData)||{},userId:this.userId,myFeed:null}}),2e3)}render(){var o;return[e("ion-content",{scrollEvents:!0,class:"ion-padding"},e("floodteam-title-bar",{pin:{icon:"person",href:`/users/${this.userId}`,name:(null===(o=null==n?void 0:n.user)||void 0===o?void 0:o.firstName)||"User"}},e("ion-router-link",{href:"/users"},"Users")),e("ion-grid",null,e("ion-row",null,e("ion-col",null,e("ion-card",{class:"ion-padding"},e("floodteam-form-user",{userId:this.userId,showPhoto:!0}))),e("ion-col",null,e("fireenjin-pagination",{name:"user-jobs",ref:o=>this.paginationEl=o,disableVirtualScroll:!0,listEl:({result:o})=>e("floodteam-item-job",{job:o}),endpoint:"listJobs",limit:4,fetchParams:{withPayables:!0},fetchData:{userId:this.userId},resultsKey:"jobs",query:this.query,removeDuplicates:!0}))))),e("floodteam-navigation-footer",null)]}};r.style="app-user ion-card,app-user ion-card ion-list{overflow:visible !important;contain:none !important}";export{r as app_user}