import { p as proxyCustomElement, H, c as createEvent, h } from './p-CUAGH_8P.js';
import { d as defineCustomElement$1 } from './p-Ba_mXs1J.js';

const verdocsOkDialogCss = "verdocs-ok-dialog{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-ok-dialog.closed{display:none}verdocs-ok-dialog .buttons{gap:12px;display:-ms-flexbox;display:flex;margin-top:0;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-ok-dialog .buttons button{padding:8px 16px;height:40px;display:-ms-flexbox;display:flex;font-size:14px;font-weight:400;cursor:pointer;-ms-flex-align:center;align-items:center;border-radius:var(--verdocs-button-radius, 4px);-ms-flex-pack:center;justify-content:center;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}verdocs-ok-dialog .buttons button.cancel{background-color:transparent;border:var(--verdocs-button-secondary-border, 1px solid #d1d5db);color:var(--verdocs-button-secondary-color, #374151)}verdocs-ok-dialog .buttons button.ok{background-color:var(--verdocs-primary-color, #55bc81);border:1px solid transparent;color:#ffffff}verdocs-ok-dialog .buttons button.ok:hover{background-color:var(--verdocs-primary-color-hover, #2b995b)}verdocs-ok-dialog .buttons button:disabled{background-color:var(--verdocs-button-disabled-bg, #e5e7eb);color:var(--verdocs-button-disabled-color, #9ca3af);cursor:not-allowed}";

const VerdocsOkDialog = /*@__PURE__*/ proxyCustomElement(class VerdocsOkDialog extends H {
    constructor(registerHost) {
        super();
        if (registerHost !== false) {
            this.__registerHost();
        }
        this.next = createEvent(this, "next");
        this.exit = 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 (h("verdocs-dialog", { key: '71f5ccb53d253e815c7071919eb667adcba7cbf6', onExit: e => this.handleDismiss(e) }, h("div", { key: '8a9818924124a1355b2fb9b5fa0c3db2d2e85f24', slot: "heading", class: "heading" }, h("div", { key: '5fc6b98d0c1cd975c106616708721115bd54ee12', class: "icon" }, h("svg", { key: '836f0a6c196c173f5de0839f69b073afb0ab1bae', width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: '8943629b994d18a59b077a785dcbe0958005f395', "clip-path": "url(#clip0_34208_4881)" }, h("path", { key: '657bc1542a8ed6a02830f63e51ad5a9e04a721a6', d: "M3.125 0.75C1.88398 0.75 0.875 1.75898 0.875 3V16.5C0.875 17.741 1.88398 18.75 3.125 18.75H12.125C13.366 18.75 14.375 17.741 14.375 16.5V15.8215C14.2801 15.8602 14.1852 15.8918 14.0867 15.9164L11.9738 16.4437C11.8684 16.4684 11.7629 16.4859 11.6574 16.493C11.6258 16.4965 11.5941 16.5 11.5625 16.5H9.3125C9.09805 16.5 8.90469 16.3805 8.80977 16.1906L8.50039 15.5684C8.44062 15.4488 8.32109 15.375 8.19102 15.375C8.06094 15.375 7.93789 15.4488 7.88164 15.5684L7.57227 16.1906C7.47031 16.398 7.24883 16.5211 7.02031 16.5C6.7918 16.4789 6.59492 16.3207 6.53164 16.1027L5.9375 14.1445L5.59297 15.2977C5.37852 16.0113 4.72109 16.5 3.97578 16.5H3.6875C3.37812 16.5 3.125 16.2469 3.125 15.9375C3.125 15.6281 3.37812 15.375 3.6875 15.375H3.97578C4.22539 15.375 4.44336 15.2133 4.51367 14.9742L5.0375 13.234C5.15703 12.8367 5.52266 12.5625 5.9375 12.5625C6.35234 12.5625 6.71797 12.8367 6.8375 13.234L7.24531 14.591C7.50547 14.373 7.83594 14.25 8.1875 14.25C8.74648 14.25 9.25625 14.5664 9.50586 15.0656L9.66055 15.375H9.97344C9.86445 15.0656 9.84336 14.7281 9.92422 14.3977L10.4516 12.2848C10.55 11.8875 10.7539 11.5289 11.0422 11.2406L14.375 7.90781V6.375H9.875C9.25273 6.375 8.75 5.87227 8.75 5.25V0.75H3.125ZM9.875 0.75V5.25H14.375L9.875 0.75ZM20.2039 5.66133C19.6555 5.11289 18.766 5.11289 18.2141 5.66133L17.1805 6.69492L19.6766 9.19102L20.7102 8.15742C21.2586 7.60898 21.2586 6.71953 20.7102 6.16758L20.2039 5.66133ZM11.8402 12.0352C11.6961 12.1793 11.5941 12.3586 11.5449 12.559L11.0176 14.6719C10.9684 14.8652 11.0246 15.0656 11.1652 15.2063C11.3059 15.3469 11.5062 15.4031 11.6996 15.3539L13.8125 14.8266C14.0094 14.7773 14.1922 14.6754 14.3363 14.5312L18.8785 9.98555L16.3824 7.48945L11.8402 12.0352Z", fill: "white" })), h("defs", { key: '8c89805faaf706a352a09cdb9e4366d3b2c697b3' }, h("clipPath", { key: 'e76eabac419a70b4fc8be4973f70509712b2ba12', id: "clip0_34208_4881" }, h("path", { key: '7820f18f95934053693bc282d451e40bbdbac518', d: "M0.875 0.75H21.125V18.75H0.875V0.75Z", fill: "white" }))))), h("div", { key: '79e11a044511904b7c07c655ef67deebe299915c', class: "title" }, " ", this.heading)), h("div", { key: '84ad2b3657ac06ef807557d68b24156964adef00', slot: "content", class: "content", innerHTML: this.message }), h("div", { key: 'b18ad4282201a68caa040f5400fbdd0103eac20a', class: "footer", slot: "footer" }, h("div", { key: '4add506ce666b657c3a23a0ed960ea305fc3904b', class: "buttons" }, this.showCancel && (h("button", { key: '1d2fc583027ed4994a90babdec18e3828d403fd7', class: "cancel", onClick: () => this.handleCancel() }, "Cancel")), h("button", { key: 'd1331922dc64b8af4b19aef0dd0684406d17c58a', class: !this.showCancel ? 'ok single' : 'ok', onClick: () => this.handleOk() }, "OK")))));
    }
    static get style() { return verdocsOkDialogCss; }
}, [256, "verdocs-ok-dialog", {
        "heading": [1],
        "message": [1],
        "buttonLabel": [1, "button-label"],
        "showCancel": [4, "show-cancel"],
        "closed": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["verdocs-ok-dialog", "verdocs-dialog"];
    components.forEach(tagName => { switch (tagName) {
        case "verdocs-ok-dialog":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, VerdocsOkDialog);
            }
            break;
        case "verdocs-dialog":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { VerdocsOkDialog as V, defineCustomElement as d };
//# sourceMappingURL=p-o9BQIoXw.js.map

//# sourceMappingURL=p-o9BQIoXw.js.map