'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-ceff47a0.js');

const BpSdkMessage = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.message = undefined;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-message');
        customElements.whenDefined('bp-sdk-external-message').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return index.h("bp-sdk-external-message", { message: this.message });
    }
    renderInternal() {
        var _a;
        return index.h("aside", { role: "alert", "aria-live": "polite", class: "bp-sdk-message__container", innerHTML: (_a = this.message) === null || _a === void 0 ? void 0 : _a.target });
    }
};

exports.bp_sdk_message = BpSdkMessage;
