import { h } from "@stencil/core";
export class BpSdkQuoteRequestHeaderContainer {
    constructor() {
        this.carrier = undefined;
        this.customLogoBaseUrl = undefined;
        this.showCustomLogo = undefined;
        this.showLogo = undefined;
        this.quoteId = undefined;
        this.useExternal = false;
        this.name = undefined;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-quote-request-header-container');
        customElements.whenDefined('bp-sdk-external-quote-request-header-container').then(() => {
            this.useExternal = true;
        });
        this.onCarrierChange(this.carrier);
    }
    onCarrierChange(carrier) {
        this.name = carrier === null || carrier === void 0 ? void 0 : carrier.name;
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-quote-request-header-container", { carrier: this.carrier, customLogoBaseUrl: this.customLogoBaseUrl, showCustomLogo: this.showCustomLogo, showLogo: this.showLogo, quoteId: this.quoteId }));
    }
    renderInternal() {
        return (h("bp-sdk-quote-request-header", { carrier: this.carrier, customLogoBaseUrl: this.customLogoBaseUrl, name: this.name, showCustomLogo: this.showCustomLogo, showLogo: this.showLogo, quoteId: this.quoteId }));
    }
    static get is() { return "bp-sdk-quote-request-header-container"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-quote-request-header-container.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-quote-request-header-container.css"]
        };
    }
    static get properties() {
        return {
            "carrier": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "ICarrier",
                    "resolved": "ICarrier",
                    "references": {
                        "ICarrier": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::ICarrier"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Carrier"
                }
            },
            "customLogoBaseUrl": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Custom logo base url"
                },
                "attribute": "custom-logo-base-url",
                "reflect": false
            },
            "showCustomLogo": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Should show custom logo"
                },
                "attribute": "show-custom-logo",
                "reflect": false
            },
            "showLogo": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Should show logo"
                },
                "attribute": "show-logo",
                "reflect": false
            },
            "quoteId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Quote ID"
                },
                "attribute": "quote-id",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {},
            "name": {}
        };
    }
    static get watchers() {
        return [{
                "propName": "carrier",
                "methodName": "onCarrierChange"
            }];
    }
}
