import { Host, h } from "@stencil/core";
import { DetailItem, DetailSectionTitle, } from "../../../ui-components/details/utils";
import { formatMediumDate } from "../../../utils/utils";
export class OwnerDetails {
    render() {
        var _a;
        if (!((_a = this === null || this === void 0 ? void 0 : this.owners) === null || _a === void 0 ? void 0 : _a.length))
            return null;
        return (h(Host, null, !!(this === null || this === void 0 ? void 0 : this.owners.length) &&
            this.owners.map((owner) => {
                var _a, _b, _c, _d, _e;
                return [
                    h(DetailSectionTitle, { sectionTitle: `Owner ${owner === null || owner === void 0 ? void 0 : owner.name}'s Details` }),
                    h("div", { class: "d-flex flex-column gap-2 w-100 mt-3" }, h("div", { class: "col-md-6" }, h(DetailItem, { title: "Name", value: owner === null || owner === void 0 ? void 0 : owner.name }), h(DetailItem, { title: "Title", value: owner === null || owner === void 0 ? void 0 : owner.title }), h(DetailItem, { title: "Email", value: owner === null || owner === void 0 ? void 0 : owner.email }), h(DetailItem, { title: "Phone", value: owner === null || owner === void 0 ? void 0 : owner.phone }), h(DetailItem, { title: "Date of Birth", value: formatMediumDate(new Date(Number(owner === null || owner === void 0 ? void 0 : owner.dob_year), Number(owner === null || owner === void 0 ? void 0 : owner.dob_month) - 1, Number(owner === null || owner === void 0 ? void 0 : owner.dob_day))) }), h(DetailItem, { title: "Identification Number", value: `********${owner === null || owner === void 0 ? void 0 : owner.ssn_last4}` }), h(DetailItem, { title: "Line 1", value: (_a = owner === null || owner === void 0 ? void 0 : owner.address) === null || _a === void 0 ? void 0 : _a.line1 }), h(DetailItem, { title: "Line 2", value: (_b = owner === null || owner === void 0 ? void 0 : owner.address) === null || _b === void 0 ? void 0 : _b.line2 }), h(DetailItem, { title: "City", value: (_c = owner === null || owner === void 0 ? void 0 : owner.address) === null || _c === void 0 ? void 0 : _c.city }), h(DetailItem, { title: "State", value: (_d = owner === null || owner === void 0 ? void 0 : owner.address) === null || _d === void 0 ? void 0 : _d.state }), h(DetailItem, { title: "Zip", value: (_e = owner === null || owner === void 0 ? void 0 : owner.address) === null || _e === void 0 ? void 0 : _e.postal_code }))),
                ];
            })));
    }
    static get is() { return "owner-details"; }
    static get properties() {
        return {
            "owners": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "Identity[]",
                    "resolved": "Identity[]",
                    "references": {
                        "Identity": {
                            "location": "import",
                            "path": "../../../api/Identity",
                            "id": "src/api/Identity.ts::Identity"
                        }
                    }
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            }
        };
    }
}
