import { h } from "@stencil/core";
const QuestionIcon = `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.4809 13.8423H15.4C16.2962 13.8423 17 13.1288 17 12.2764V5.56582C17 4.71348 16.2962 4 15.4 4H4.6C3.70383 4 3 4.71348 3 5.56582V12.2764C3 13.1288 3.70383 13.8423 4.6 13.8423H6.19908L6.2 17L6.20346 16.9997L6.20502 16.9988L10.4809 13.8423ZM6.79895 17.8034C6.35668 18.1298 5.73 18.0406 5.39921 17.6042C5.26989 17.4335 5.2 17.2262 5.2 17.0133L5.19937 14.8423H4.6C3.16406 14.8423 2 13.6935 2 12.2764V5.56582C2 4.14876 3.16406 3 4.6 3H15.4C16.8359 3 18 4.14876 18 5.56582V12.2764C18 13.6935 16.8359 14.8423 15.4 14.8423H10.81L6.79895 17.8034Z" fill="#ffffff"/></svg>`;
/**
 * Display a simple text dialog box with an Ok button. This adds a partially-transparent overlay and screen-centered dialog
 * box with a message and optional header/title. An OK button is shown that will dismiss the message.
 * It can also be dismissed by clicking the background overlay.
 */
export class VerdocsQuestionDialog {
    constructor() {
        this.question = '';
        this.closed = false;
    }
    handleOk() {
        this.next.emit({ question: this.question });
    }
    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: '2d25d6034f32f73872e4e23e18f8f611845462ef', onExit: e => this.handleDismiss(e) }, h("div", { key: 'ded100d23158a50e01441f97bae61ca8afd29aa1', slot: "heading", class: "heading" }, h("div", { key: 'be66073c69e8251d7f407da52cec6e9d66678b3b', class: "icon", innerHTML: QuestionIcon }), h("div", { key: 'dfd7af4e47911d2dcd6e42a27c7c0d70a013d9b7', class: "title" }, "Ask the Sender a Question")), h("div", { key: 'a085530805a7b43395af9188838252ed43fb1f98', slot: "content", class: "content" }, h("textarea", { key: 'f195beca773dc9b8ca4f7860aef766a107db98c8', name: "question", rows: 6, placeholder: "Enter your question...", onInput: (e) => (this.question = e.target.value) }, this.question)), h("div", { key: '0f2a3ea22986937baf9b88181053417c5f20538e', class: "footer", slot: "footer" }, h("div", { key: 'e36cc205b8bdbb65aac6874987b17e3c05becd5f', class: "buttons" }, h("button", { key: 'aafa5ec2ae697f8c234199db40c7b85c80efeba0', class: "cancel", onClick: () => this.handleCancel() }, "Cancel"), h("button", { key: '394fc179810c776d0ad1c7ec1a2429310c965388', class: 'ok', onClick: () => this.handleOk() }, "OK")))));
    }
    static get is() { return "verdocs-question-dialog"; }
    static get originalStyleUrls() {
        return {
            "$": ["verdocs-question-dialog.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["verdocs-question-dialog.css"]
        };
    }
    static get properties() {
        return {
            "question": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "question",
                "defaultValue": "''"
            }
        };
    }
    static get states() {
        return {
            "closed": {}
        };
    }
    static get events() {
        return [{
                "method": "next",
                "name": "next",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Event fired when the user clicks the OK button."
                },
                "complexType": {
                    "original": "{question: string}",
                    "resolved": "{ question: string; }",
                    "references": {}
                }
            }, {
                "method": "exit",
                "name": "exit",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Event fired when Cancel is pressed. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name."
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=verdocs-question-dialog.js.map
