import { h } from "@stencil/core";
export class BpSdkQuestionGroupLabel {
    constructor() {
        this.labelId = undefined;
        this.label = undefined;
        this.useExternal = false;
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-question-group-label');
        customElements.whenDefined('bp-sdk-external-question-group-label').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-question-group-label", { label: this.label, labelId: this.labelId });
    }
    renderInternal() {
        return (h("h2", { id: this.labelId, class: "bp-sdk-question-group__label" }, this.label));
    }
    static get is() { return "bp-sdk-question-group-label"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-question-group-label.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-question-group-label.css"]
        };
    }
    static get properties() {
        return {
            "labelId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Label id"
                },
                "attribute": "label-id",
                "reflect": false
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Label to display"
                },
                "attribute": "label",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
