'use strict';

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

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

const bpSdkBusinessClassificationSelectorNudgeCss = "";
const BpSdkBusinessClassificationSelectorNudgeStyle0 = bpSdkBusinessClassificationSelectorNudgeCss;

const BpSdkBusinessClassificationSelectorNudge = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.onYesClick = (evt) => {
            var _a;
            this.handleYesClick((_a = this.refilter) === null || _a === void 0 ? void 0 : _a.key, evt);
        };
        this.onNoClick = (evt) => {
            var _a;
            this.handleNoClick((_a = this.refilter) === null || _a === void 0 ? void 0 : _a.key, evt);
        };
        this.useExternal = false;
        this.refilter = undefined;
        this.handleYesClick = undefined;
        this.handleNoClick = undefined;
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-business-classification-selector-nudge');
        customElements.whenDefined('bp-sdk-external-business-classification-selector-nudge').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (index.h("bp-sdk-external-business-classification-selector-nudge", { refilter: this.refilter, handleYesClick: this.handleYesClick, handleNoClick: this.handleNoClick }));
    }
    renderInternal() {
        var _a;
        return (index.h("div", { class: "bp-sdk-business-classification-selector-nudge__container" }, index.h("span", { class: "bp-sdk-business-classification-selector-nudge__question" }, (_a = this.refilter) === null || _a === void 0 ? void 0 : _a.text), index.h("button", { class: "bp-sdk-business-classification-selector-nudge__btn bp-sdk-business-classification-selector-nudge__btn--yes", onClick: this.onYesClick }, "Yes"), index.h("button", { class: "bp-sdk-business-classification-selector-nudge__btn bp-sdk-business-classification-selector-nudge__btn--no", onClick: this.onNoClick }, "No")));
    }
};
BpSdkBusinessClassificationSelectorNudge.style = BpSdkBusinessClassificationSelectorNudgeStyle0;

exports.bp_sdk_business_classification_selector_nudge = BpSdkBusinessClassificationSelectorNudge;
