import { h } from "@stencil/core";
export class BpSdkQuoteRequestCoverageItemContainer {
    constructor() {
        this.coverage = undefined;
        this.useExternal = false;
        this.description = undefined;
        this.amount = undefined;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-quote-request-coverage-item-container');
        customElements.whenDefined('bp-sdk-external-quote-request-coverage-item-container').then(() => {
            this.useExternal = true;
        });
        this.onCoverageChange(this.coverage);
    }
    onCoverageChange(coverage) {
        this.description = coverage === null || coverage === void 0 ? void 0 : coverage.description;
        this.amount = coverage === null || coverage === void 0 ? void 0 : coverage.value;
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-quote-request-coverage-item-container", { coverage: this.coverage });
    }
    renderInternal() {
        return h("bp-sdk-quote-request-coverage-item", { amount: this.amount, description: this.description });
    }
    static get is() { return "bp-sdk-quote-request-coverage-item-container"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-quote-request-coverage-item-container.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-quote-request-coverage-item-container.css"]
        };
    }
    static get properties() {
        return {
            "coverage": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "ICoverageLabel",
                    "resolved": "ICoverageLabel",
                    "references": {
                        "ICoverageLabel": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::ICoverageLabel"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Coverage information"
                }
            }
        };
    }
    static get states() {
        return {
            "useExternal": {},
            "description": {},
            "amount": {}
        };
    }
    static get watchers() {
        return [{
                "propName": "coverage",
                "methodName": "onCoverageChange"
            }];
    }
}
