import { r as registerInstance, h } from './index-77a9c9e7.js';

const BpSdkMessage = class {
    constructor(hostRef) {
        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 h("bp-sdk-external-message", { message: this.message });
    }
    renderInternal() {
        var _a;
        return h("aside", { role: "alert", "aria-live": "polite", class: "bp-sdk-message__container", innerHTML: (_a = this.message) === null || _a === void 0 ? void 0 : _a.target });
    }
};

export { BpSdkMessage as bp_sdk_message };
