import{r as i,d as o,B as l,h as a}from"./p-03169580.js";import{s as d}from"./p-ac5f2e11.js";import{g as t}from"./p-c0e85cbf.js";import"./p-59c95c5f.js";import"./p-c9699503.js";import"./p-bd8b186e.js";import"./p-795b799a.js";import"./p-3a8e6af1.js";const n="app-dashboard floodteam-activity-feed .feed-header h3{color:#fff}app-dashboard fireenjin-map{background:var(--ion-color-light-shade);border-radius:15px;display:block;margin:20px auto 0;overflow:hidden;max-width:calc(100% - 30px)}app-dashboard h1 a{padding:0}app-dashboard ion-grid{margin-top:0;padding-top:0}app-dashboard .title-divider{display:flex;justify-content:space-between;align-items:baseline}app-dashboard .title-divider>span{display:flex;align-items:baseline;padding-inline-end:5px;margin-top:auto}app-dashboard .title-divider>span>ion-button{margin-right:5px}";let e=class{constructor(l){i(this,l);this.fireenjinTrigger=o(this,"fireenjinTrigger",7);this.unreadCount=0;this.selectedStatuses=["book","evaluate","claim","mitigate","monitor","review"]}async onTrigger(i){var o,l,a,d,t;if(((o=i===null||i===void 0?void 0:i.detail)===null||o===void 0?void 0:o.trigger)==="set"&&((a=(l=i===null||i===void 0?void 0:i.detail)===null||l===void 0?void 0:l.payload)===null||a===void 0?void 0:a.name)==="status"){await this.mapEl.clearMarkers();this.selectedStatuses=((t=(d=i===null||i===void 0?void 0:i.detail)===null||d===void 0?void 0:d.payload)===null||t===void 0?void 0:t.value)||[]}}filterJobsByStatus(i,o){return i.filter((i=>o.includes(i===null||i===void 0?void 0:i.status)))}componentDidLoad(){if(!(l===null||l===void 0?void 0:l.isBrowser))return}render(){var i,o,l;return[a("ion-content",{class:"truck-background ion-padding"},a("floodteam-title-bar",null,a("ion-router-link",{href:"/profile"},"Welcome Back"," ",((i=d===null||d===void 0?void 0:d.profile)===null||i===void 0?void 0:i.firstName)?`, ${d.profile.firstName}`:"","!")),a("article",{id:"myjobs"},a("fireenjin-map",{googleMapsKey:(l=(o=d===null||d===void 0?void 0:d.config)===null||o===void 0?void 0:o.firebase)===null||l===void 0?void 0:l.apiKey,ref:i=>this.mapEl=i,markers:this.filterJobsByStatus(d===null||d===void 0?void 0:d.myJobs,this.selectedStatuses).map((i=>{var o,l;return{payload:{job:i},name:i===null||i===void 0?void 0:i.title,icon:null,position:{lat:(o=i===null||i===void 0?void 0:i.address)===null||o===void 0?void 0:o.lat,lng:(l=i===null||i===void 0?void 0:i.address)===null||l===void 0?void 0:l.lng}}}))}),a("floodteam-title-bar",null,a("ion-router-link",{href:"/jobs"},"My Jobs"," ",a("ion-badge",{style:{borderRadius:"15px"}},a("small",null,this.filterJobsByStatus(d===null||d===void 0?void 0:d.myJobs,this.selectedStatuses).length||0))),a("ion-buttons",{slot:"end"},a("ion-button",{onClick:i=>this.fireenjinTrigger.emit({event:i,name:"filter",type:"status",payload:{control:{name:"status",label:"Status",icon:"help-circle",multiple:true,options:t(),value:this.selectedStatuses}}}),color:"medium",fill:"outline",size:"small"},"Filter",a("ion-icon",{slot:"end",name:"funnel"})))),a("ion-card",null,a("ion-list",null,this.filterJobsByStatus(d===null||d===void 0?void 0:d.myJobs,this.selectedStatuses).map((i=>a("floodteam-item-job",{job:i}))))))),a("floodteam-navigation-footer",null)]}};e.style=n;export{e as app_dashboard};
//# sourceMappingURL=p-88dadcc3.entry.js.map