import { h } from "@stencil/core";
export class BpSdkMessageOutlet {
    constructor() {
        this.answerId = undefined;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-message-outlet');
        customElements.whenDefined('bp-sdk-external-message-outlet').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-message-outlet", { answerId: this.answerId });
    }
    renderInternal() {
        return h("div", { class: "bp-sdk-message-outlet__container" });
    }
    static get is() { return "bp-sdk-message-outlet"; }
    static get originalStyleUrls() {
        return {
            "$": ["bp-sdk-message-outlet"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-message-outlet.css"]
        };
    }
    static get properties() {
        return {
            "answerId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Answer id"
                },
                "attribute": "answer-id",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
