'use strict';

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

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

const BpSdkChip = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.type = undefined;
        this.text = undefined;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-chip');
        customElements.whenDefined('bp-sdk-external-chip').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return index.h("bp-sdk-external-chip", { type: this.type, text: this.text });
    }
    renderInternal() {
        return [
            index.h("bp-sdk-chip-before", { text: this.text }),
            index.h("span", { class: `bp-sdk-chip bp-sdk-chip__${this.type}`, innerHTML: this.text }),
            index.h("bp-sdk-chip-after", { text: this.text }),
        ];
    }
};

exports.bp_sdk_chip = BpSdkChip;
