'use strict';

var index = require('./index-CDEIqi_n.js');

const verdocsOkDialogCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-ok-dialog{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-ok-dialog.closed{display:none}verdocs-ok-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-ok-dialog .dialog{max-width:60%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-ok-dialog .heading{display:-ms-flexbox;display:flex;font-size:16px;-ms-flex-direction:row;flex-direction:row;padding:8px 16px;font-weight:bold;color:#ffffff;background:#46497d}verdocs-ok-dialog .content{font-size:16px;background:#ffffff;padding:20px}verdocs-ok-dialog .buttons{display:-ms-flexbox;display:flex;margin:30px 0 0 0;padding:0 20px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}verdocs-ok-dialog .buttons verdocs-button{margin-left:16px}";

const VerdocsOkDialog = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.next = index.createEvent(this, "next");
        this.exit = index.createEvent(this, "exit");
        /**
         * The title of the dialog. "title" is a reserved word, so we use heading.
         */
        this.heading = '';
        /**
         * The message content to display.
         */
        this.message = '';
        /**
         * Override the "OK" button's label
         */
        this.buttonLabel = 'OK';
        /**
         * If set, a cancel button will also be displayed. Note that the dialog is always cancelable by clicking the background
         * overlay to dismiss it.
         */
        this.showCancel = false;
        this.closed = false;
    }
    handleOk() {
        this.next.emit();
    }
    handleCancel() {
        this.exit.emit();
    }
    // We need a separate event handler for clicking the background because it can receive events "through" other child components
    handleDismiss(e) {
        this.closed = true;
        if (e.target.className === 'background-overlay') {
            e.preventDefault();
            this.exit.emit();
        }
    }
    render() {
        return (index.h(index.Host, { key: '12df94c0d9a87decf19d9a1b62c2ab7119681e03', class: this.closed ? 'closed' : '' }, index.h("div", { key: '29ecdb2e85dfb825d84efecd80729c184c798eed', class: "background-overlay", onClick: e => this.handleDismiss(e) }, index.h("div", { key: '15cdea7df133a16ad3da26b767c1f048c5b5be4a', class: "dialog" }, index.h("div", { key: '14739ce3942c365ab4dc1ffd12633865c8702ecf', class: "heading" }, this.heading), index.h("div", { key: 'c04aea2b91bbbe26b24d286a875720df437ac85a', class: "content" }, index.h("div", { key: '9e78186fed917d0bc4f8810fe2331f6b64c0ae43', class: "message", innerHTML: this.message }), index.h("div", { key: '26992bb398e78668235d42b87000128ac339bae9', class: "buttons" }, this.showCancel ? index.h("verdocs-button", { label: "CANCEL", variant: "outline", onClick: () => this.handleCancel() }) : index.h("div", { style: { display: 'none' } }), index.h("verdocs-button", { key: '077902f58556093dfe46056ad0c9d6750356e999', label: this.buttonLabel, onClick: () => this.handleOk() })))))));
    }
};
VerdocsOkDialog.style = verdocsOkDialogCss;

exports.verdocs_ok_dialog = VerdocsOkDialog;
//# sourceMappingURL=verdocs-ok-dialog.entry.cjs.js.map

//# sourceMappingURL=verdocs-ok-dialog.cjs.entry.js.map