import { h } from "@stencil/core";
import isAdmin from "../../../helpers/auth/isAdmin";
import formatUSD from "../../../helpers/formatUSD";
export class ItemJob {
  constructor() {
    this.job = undefined;
    this.lines = "inset";
  }
  render() {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
    return (h("ion-item", { lines: this.lines, href: `/jobs/${(_a = this.job) === null || _a === void 0 ? void 0 : _a.id}`, detail: true }, h("fireenjin-avatar", { slot: "start", style: {
        display: "inline-block",
        position: "relative",
        borderRadius: "4px",
        padding: "0 !important",
        overflow: "hidden",
        marginRight: "10px",
      }, initials: ((_b = this.job) === null || _b === void 0 ? void 0 : _b.title) ? (_c = this.job) === null || _c === void 0 ? void 0 : _c.title.charAt(0) : "", src: (_f = (_e = (_d = this.job) === null || _d === void 0 ? void 0 : _d.photos) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.url }), h("ion-label", { class: "ion-text-wrap", style: { position: "relative", textOverflow: "initial" } }, h("h2", null, (_g = this.job) === null || _g === void 0 ? void 0 : _g.title), h("fireenjin-chip-bar", null, h("floodteam-select-status", { jobId: (_h = this.job) === null || _h === void 0 ? void 0 : _h.id, value: (_j = this.job) === null || _j === void 0 ? void 0 : _j.status }), h("floodteam-select-location", { disabled: true, jobId: (_k = this.job) === null || _k === void 0 ? void 0 : _k.id, value: (_m = (_l = this.job) === null || _l === void 0 ? void 0 : _l.location) === null || _m === void 0 ? void 0 : _m.id }), isAdmin() && (h("ion-chip", null, h("ion-icon", { class: "ft-icon-style", name: "logo-usd" }), h("ion-label", null, "Owed ", formatUSD(((_o = this.job) === null || _o === void 0 ? void 0 : _o.amountOwed) || 0)))), h("ion-router-link", { onClick: (event) => event.stopPropagation(), href: `/jobs/${(_p = this.job) === null || _p === void 0 ? void 0 : _p.id}/scope` }, h("ion-chip", null, h("ion-icon", { class: "ft-icon-style", name: "list" }), h("ion-label", null, "View Scope"))), h("floodteam-select-job-service-types", { disabled: true, jobId: (_q = this.job) === null || _q === void 0 ? void 0 : _q.id, value: ((_r = this.job) === null || _r === void 0 ? void 0 : _r.serviceTypes) || [] })))));
  }
  static get is() { return "floodteam-item-job"; }
  static get properties() {
    return {
      "job": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "Job",
          "resolved": "{ __typename?: \"Job\"; address?: Address; afterhours?: boolean; agent?: User; amountBilled?: number; amountDeducted?: number; amountOwed?: number; amountPaid?: number; appointment?: Appointment; appointments?: Appointment[]; attributionToken?: Token; category?: number; cause?: string; claimNumber?: string; createdAt?: string; createdBy?: User; customer?: User; dateOfLoss?: string; efileCount?: number; efiles?: Efile[]; feed?: Feed[]; id?: string; invoices?: Invoice[]; isFranchise?: boolean; isInsured?: boolean; isSearchable?: boolean; lastNotifiedAt?: string; location?: Location; lostReason?: string; manager?: User; matterportModelId?: string; notionId?: string; payModel?: PayModel; payables?: Payable[]; payments?: Payment[]; phone?: string; photos?: Photo[]; picture?: string; propertyAge?: number; ratings?: Rating[]; readings?: Reading[]; referral?: User; serviceStillNeeded?: string; serviceTypes?: string[]; services?: ScopeService[]; sites?: Site[]; status?: string; success?: User; tags?: string[]; title?: string; updatedAt?: string; updatedBy?: User; userIds?: string[]; users?: User[]; weather?: Weather[]; weatherIds?: string[]; }",
          "references": {
            "Job": {
              "location": "import",
              "path": "../../../sdk"
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        }
      },
      "lines": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "\"none\" | \"inset\" | \"full\"",
          "resolved": "\"full\" | \"inset\" | \"none\"",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "lines",
        "reflect": false,
        "defaultValue": "\"inset\""
      }
    };
  }
}
