import { Host, h } from "@stencil/core";
import { cls, getId } from "../../utils/helpers";
import { Lang } from "../../services/lang";
import IMask from "imask";
export class XInput {
    constructor() {
        /**
         * Typing timer instance
         */
        this.typingTimer = null;
        /**
         * Typing input event instance
         */
        this.typingEvent = null;
        /**
         * Element ID for internal reference
         */
        this.inputId = getId('input');
        this.label = undefined;
        this.name = undefined;
        this.type = 'text';
        this.placeholder = undefined;
        this.info = undefined;
        this.typingtimeout = 1200;
        this.validate = undefined;
        this.required = undefined;
        this.loading = undefined;
        this.readonly = undefined;
        this.cleanable = undefined;
        this.autofocus = undefined;
        this.capitalize = 'off';
        this.autocorrect = 'off';
        this.pattern = undefined;
        this.autocomplete = 'off';
        this.enterkeyhint = undefined;
        this.inputmode = undefined;
        this.max = undefined;
        this.min = undefined;
        this.step = undefined;
        this.maxlength = undefined;
        this.minlength = undefined;
        this.mask = undefined;
        this.value = '';
        this.inputType = this.type;
        this.isValid = true;
        this.isTyping = undefined;
        this.isFocused = undefined;
        this.isLoading = undefined;
        this.isDisabled = undefined;
    }
    /**
     * On watch mask pattern/options
     */
    maskChanged() {
        if (this.mask && !this.maskInstance) {
            this.maskInstance = IMask(this.el.querySelector('input'), this.mask);
        }
        this.maskInstance.updateOptions(this.mask);
    }
    /**
     * On watch type property hook
     */
    typeChanged() {
        this.validateInputType();
    }
    /**
     * Set the value of the input
     */
    async setValue(value) {
        this.value = value;
        this.internals.setFormValue(value);
        this.el.dispatchEvent(new InputEvent('input'));
    }
    /**
     * Validate the input and get the validation result
    */
    async checkValidity() {
        this.onValidate();
        return this.isValid;
    }
    /**
     * This is called when the 'disabled' attribute of the element or or an ancestor <fieldset> is updated
     *
     * @param disabled
     */
    formDisabledCallback(disabled) {
        this.isDisabled = disabled;
    }
    /**
     * This is called when the parent/owner form is reset
     */
    formResetCallback() {
        this.isValid = true;
        this.internals.setFormValue('');
        this.el.dispatchEvent(new InputEvent('input'));
    }
    /**
     * This is called on component before load
     */
    componentWillLoad() {
        this.validateInputType();
    }
    /**
     * This is called on component did load
     */
    componentDidLoad() {
        if (this.mask && !this.maskInstance) {
            this.maskInstance = IMask(this.el.querySelector('input'), this.mask);
        }
    }
    /**
     * Set element value by event
     *
     * @param event
     */
    onInput(event) {
        this.value = event.target.value;
        this.internals.setFormValue(event.target.value);
        this.el.dispatchEvent(new InputEvent('input'));
    }
    /**
     * This called on input field is unfocused
     */
    onBlurInput() {
        this.isFocused = false;
        setTimeout(() => this.onValidate(), 50);
    }
    /**
     * This called on input field is focused
     */
    onFocusInput() {
        this.isFocused = true;
    }
    /**
     * This called on input field was changed
     *
     * @param event
     */
    onKeyUpInput(event) {
        this.isTyping = true;
        this.typingEvent = event;
        clearTimeout(this.typingTimer);
        this.typingTimer = setTimeout(this.onDoneTypingInput.bind(this), this.typingtimeout);
    }
    /**
     * This called on input field detect key is down
     */
    onKeyDownInput(event) {
        clearTimeout(this.typingTimer);
        if (this.type === 'numeric') {
            if (event.key === 'ArrowUp') {
                this.sumValue();
            }
            if (event.key === 'ArrowDown') {
                this.subValue();
            }
        }
    }
    /**
     * This called on input field finished typing
     */
    onDoneTypingInput() {
        this.onValidate();
        this.isTyping = false;
        this.onDoneTypingEvent.emit(this.typingEvent);
    }
    /**
     * Validate the field input
     *
     * @returns
     */
    onValidate() {
        if (!this.validate) {
            return;
        }
        const selectors = ["input", "select", "textarea"];
        let input = null;
        selectors.forEach((selector) => {
            if (input === null) {
                input = this.el.querySelector(selector);
            }
        });
        this.isValid = (input === null || input === void 0 ? void 0 : input.validity) ? input.validity.valid : true;
        this.onValidateInputEvent.emit(input);
    }
    /**
     * Return validation of showing the input label
     *
     * @returns
     */
    showLabel() {
        var _a;
        return (this.label && this.placeholder) || (this.label && (((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()).length > 0 || this.isFocused)) || (this.label && ['color', 'otp', 'amount'].includes(this.type));
    }
    /**
     * Compute the placeholder value
     *
     * @returns
     */
    placeholderValue() {
        if (this.type == 'otp') {
            return [...Array(this.maxlength || 0).keys()].map(() => '0').join('');
        }
        if (this.type == 'color') {
            return Lang.get('fields.input.color');
        }
        if (this.type == 'amount') {
            return '0.00';
        }
        if (this.label) {
            if (this.placeholder) {
                return this.placeholder;
            }
            else if (!this.showLabel()) {
                return this.label;
            }
        }
        return this.placeholder;
    }
    /**
     * Show the content of input when type is `password`
     *
     * @returns
     */
    togglePasswordVisibility() {
        if (this.isDisabled) {
            return;
        }
        this.inputType = this.inputType == 'password' ? 'text' : 'password';
        setTimeout(() => {
            this.el.querySelector('input').focus();
        }, 100);
    }
    /**
     * Sumarize the actual value if type is `numeric`
     *
     * @returns
     */
    sumValue() {
        if (isNaN(parseInt(this.value.toString()))) {
            this.value = this.min ? this.min : 0;
        }
        if (typeof this.value !== 'number') {
            this.value = parseInt(this.value);
        }
        if (!isNaN(this.max) && this.value >= this.max) {
            return;
        }
        this.value = this.value + (this.step || 1);
        this.el.dispatchEvent(new InputEvent('input'));
    }
    /**
     * Substract the actual value if type is `numeric`
     *
     * @returns
     */
    subValue() {
        if (isNaN(parseInt(this.value.toString()))) {
            this.value = this.max ? this.max : 0;
        }
        if (typeof this.value !== 'number') {
            this.value = parseInt(this.value);
        }
        if (!isNaN(this.min) && this.value <= this.min) {
            return;
        }
        this.value = this.value - (this.step || 1);
        this.el.dispatchEvent(new InputEvent('input'));
    }
    /**
     * Validate the initials values of the input by type
     */
    validateInputType() {
        this.inputType = this.type;
        switch (this.type) {
            case 'email':
                this.inputmode = this.inputmode || 'email';
                break;
            case 'tel':
                this.inputmode = this.inputmode || 'tel';
                break;
            case 'url':
                this.inputmode = this.inputmode || 'url';
                break;
            case 'search':
                this.inputmode = this.inputmode || 'search';
                this.enterkeyhint = this.enterkeyhint || 'search';
                break;
            case 'number':
            case 'numeric':
                this.inputmode = this.inputmode || 'numeric';
                break;
            case 'amount':
                this.inputmode = this.inputmode || 'numeric';
                this.mask = {
                    mask: Number,
                    scale: 2,
                    radix: '.',
                    mapToRadix: ['.'],
                    thousandsSeparator: ',',
                    padFractionalZeros: false,
                    normalizeZeros: true,
                };
                break;
            case 'otp':
                this.inputmode = this.inputmode || 'text';
                this.inputType = 'tel';
                this.autocomplete = 'one-time-code';
                this.mask = [...Array(this.maxlength || 0).keys()].map(() => '0').join('');
                break;
            default:
                this.inputmode = this.inputmode || 'text';
                break;
        }
        if (this.mask) {
            this.inputType = 'text';
        }
    }
    /**
     * Clears the input value
     */
    clearInput() {
        this.value = '';
        this.el.dispatchEvent(new InputEvent('input'));
        if (this.typingTimer != null) {
            clearTimeout(this.typingTimer);
        }
        this.onClearInputEvent.emit(this.typingEvent);
    }
    /**
     * Paste the clipboard content to the input
     */
    pasteClipboard() {
        navigator.clipboard.readText().then((text) => {
            if (this.maskInstance) {
                this.maskInstance.unmaskedValue = text;
                this.value = this.maskInstance.value;
                this.internals.setFormValue(this.maskInstance.value);
                this.el.dispatchEvent(new InputEvent('input'));
            }
            else {
                this.value = text;
                this.internals.setFormValue(this.value);
                this.el.dispatchEvent(new InputEvent('input'));
            }
        });
    }
    /**
     * Render component
     */
    render() {
        return h(Host, { key: '78373111aca2487e8f81231085dc72968c0e6500', "data-for": this.name }, h("div", { key: '2a441bb2cc94a89d5d6729a5645c544724a0b734', class: cls({
                "input-container": true,
                "focus": this.isFocused,
                "loading": this.loading || this.isLoading,
                "disabled": this.isDisabled,
                "invalid": !this.isValid,
                "required": this.required,
            }) }, h("div", { key: '3ff24f0662b4b3f4cf3f10f794bff093d3dfa75e', class: "indicator" }, h("slot", { key: '36116b090487348948605ae85875a73da3a9e757', name: "indicator" })), h("div", { key: '9765e37b81622c1d0cf41da5c5027b807661bc8d', class: "separator" }), h("div", { key: '07ea36a6ddfa04f9b3215118acad5fa6e166b929', class: "buttons" }, this.inputType == 'numeric' && h("x-button", { key: 'd94a8aa86dbf96b85707fb11c69cf9ee45145e88', icon: "plus", onClick: () => this.sumValue() })), h("div", { key: 'aa44007e06b01c6f46d37a03502f07045c1fd6cf', class: "wrap" }, this.showLabel() && h("label", { key: '993b720d23dabd7f25aa52a637f427b9cfbea9ca', htmlFor: this.inputId }, this.label), h("input", { key: '40db7e144ee09ccfef674c784c1a4dc486ad6ab0', "data-field": this.type, id: this.inputId, type: this.inputType, required: this.required, disabled: this.isDisabled || this.loading || this.isLoading, pattern: this.pattern, readOnly: this.readonly, autoCorrect: this.autocorrect, autoCapitalize: this.capitalize, autoComplete: this.autocomplete, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholderValue(), value: this.value, onChange: (e) => this.onInput(e), onInput: (e) => this.onInput(e), onBlur: () => this.onBlurInput(), onFocus: () => this.onFocusInput(), onKeyUp: (e) => this.onKeyUpInput(e), onKeyDown: (e) => this.onKeyDownInput(e) }), this.inputType == 'color' && h("div", { key: '7d08bcdc2adafb5c9bd0dff7a2ec18fe945fbf18', class: "color-indicator" }, h("i", { key: '1fd63d79fcd9beeb7cec27642047835c41e6329e', style: { background: this.value.toString() } }), h("span", { key: '95f8bd69e00e812aa9d8011dbfc54272aa0c6590' }, this.value || this.placeholderValue()))), this.loading && h("div", { key: '9c894a09bac762465ef1acefa0c2787912ed5246', class: "loading-indicator" }), h("div", { key: 'fcce3834b3543e4cc083162f3d1ef4fa1b17e61b', class: "buttons" }, this.cleanable && (this.value.toString()).length > 0 && h("x-button", { key: '669f273db3b49e3dc53f88e6613d2bc159bfb64f', icon: "backclear", onClick: () => this.clearInput() }), this.type == 'password' && h("x-button", { key: '57a834f153586c26b72cb3644b4817e42b62ed47', icon: this.inputType == 'password' ? 'visible' : 'invisible', onClick: () => this.togglePasswordVisibility() }), this.type == 'otp' && h("x-button", { key: '25be5115c181c3ea206f23201d4a4e840f534c63', icon: "clipboard", onClick: () => this.pasteClipboard() }), this.inputType == 'numeric' && h("x-button", { key: '1bbe61293997b1fde2e4627b5b3432093035fba2', icon: "minus", onClick: () => this.subValue() }), h("slot", { key: '3244bc9d7f973b2bf45d63f4f11a3b0bb306218f', name: "buttons" })), this.info && h("div", { key: '4b7c0879e620a6930fa0ba6708125682ff3cd6c4', class: "info" }, h("x-tooltip", { key: 'a77ce689297104f0b1613e1bdfc3b58f095abcd2', content: this.info }, h("x-icon", { key: 'c2e5d16346b2afcd0055c78846ab0125d9f380da', name: "info" })))), h("slot", { key: 'c6630a4cc36596ac8cf7aa4f562a17128c8b5ff8' }));
    }
    static get is() { return "x-input"; }
    static get formAssociated() { return true; }
    static get originalStyleUrls() {
        return {
            "$": ["./style.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["style.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input label text"
                },
                "attribute": "label",
                "reflect": false
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input name for forms keys"
                },
                "attribute": "name",
                "reflect": false
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "InputType",
                    "resolved": "\"amount\" | \"color\" | \"email\" | \"number\" | \"numeric\" | \"otp\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"url\"",
                    "references": {
                        "InputType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputType"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input type"
                },
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'text'"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input placeholder text"
                },
                "attribute": "placeholder",
                "reflect": false
            },
            "info": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input information block"
                },
                "attribute": "info",
                "reflect": false
            },
            "typingtimeout": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input debounce time"
                },
                "attribute": "typingtimeout",
                "reflect": false,
                "defaultValue": "1200"
            },
            "validate": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element enable internal validation"
                },
                "attribute": "validate",
                "reflect": false
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input required for forms validations"
                },
                "attribute": "required",
                "reflect": false
            },
            "loading": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element show loading and block for edit"
                },
                "attribute": "loading",
                "reflect": false
            },
            "readonly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input block for edit"
                },
                "attribute": "readonly",
                "reflect": false
            },
            "cleanable": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input clear button"
                },
                "attribute": "cleanable",
                "reflect": false
            },
            "autofocus": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element autofocus on render"
                },
                "attribute": "autofocus",
                "reflect": false
            },
            "capitalize": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "InputAutocapitalizeTypes",
                    "resolved": "\"characters\" | \"none\" | \"off\" | \"on\" | \"sentences\" | \"words\"",
                    "references": {
                        "InputAutocapitalizeTypes": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputAutocapitalizeTypes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input autocapitalize options"
                },
                "attribute": "capitalize",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "autocorrect": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'on' | 'off'",
                    "resolved": "\"off\" | \"on\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input auto correction should be enabled"
                },
                "attribute": "autocorrect",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "pattern": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input regular expression that the value is checked against"
                },
                "attribute": "pattern",
                "reflect": false
            },
            "autocomplete": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputAutocompleteTypes",
                    "resolved": "\"name\" | \"url\" | \"on\" | \"off\" | \"email\" | \"tel\" | \"honorific-prefix\" | \"given-name\" | \"additional-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"photo\"",
                    "references": {
                        "InputAutocompleteTypes": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputAutocompleteTypes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input value of the control can be automatically completed by the browser"
                },
                "attribute": "autocomplete",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "enterkeyhint": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputEnterKeyHintType",
                    "resolved": "\"done\" | \"enter\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\"",
                    "references": {
                        "InputEnterKeyHintType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputEnterKeyHintType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input hint to the browser for which enter key to display"
                },
                "attribute": "enterkeyhint",
                "reflect": false
            },
            "inputmode": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputModeType",
                    "resolved": "\"decimal\" | \"email\" | \"none\" | \"numeric\" | \"search\" | \"tel\" | \"text\" | \"url\"",
                    "references": {
                        "InputModeType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputModeType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input hint to the browser for which keyboard to display"
                },
                "attribute": "inputmode",
                "reflect": false
            },
            "max": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input maximun value"
                },
                "attribute": "max",
                "reflect": false
            },
            "min": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input minimun value"
                },
                "attribute": "min",
                "reflect": false
            },
            "step": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input value in steps only for numeric|number type"
                },
                "attribute": "step",
                "reflect": false
            },
            "maxlength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input maximun count of characters"
                },
                "attribute": "maxlength",
                "reflect": false
            },
            "minlength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input minimun count of characters"
                },
                "attribute": "minlength",
                "reflect": false
            },
            "mask": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string | Object",
                    "resolved": "Object | string",
                    "references": {
                        "Object": {
                            "location": "global",
                            "id": "global::Object"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input imaks pattern/options"
                },
                "attribute": "mask",
                "reflect": false
            },
            "value": {
                "type": "any",
                "mutable": true,
                "complexType": {
                    "original": "string | number | null",
                    "resolved": "number | string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input value"
                },
                "attribute": "value",
                "reflect": false,
                "defaultValue": "''"
            }
        };
    }
    static get states() {
        return {
            "inputType": {},
            "isValid": {},
            "isTyping": {},
            "isFocused": {},
            "isLoading": {},
            "isDisabled": {}
        };
    }
    static get events() {
        return [{
                "method": "onDoneTypingEvent",
                "name": "doneTyping",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On done input typing finish event"
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "onClearInputEvent",
                "name": "clearInput",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On clear input event"
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "onValidateInputEvent",
                "name": "validated",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On validate input event"
                },
                "complexType": {
                    "original": "HTMLObjectElement",
                    "resolved": "HTMLObjectElement",
                    "references": {
                        "HTMLObjectElement": {
                            "location": "global",
                            "id": "global::HTMLObjectElement"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "setValue": {
                "complexType": {
                    "signature": "(value: string) => Promise<void>",
                    "parameters": [{
                            "name": "value",
                            "type": "string",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Set the value of the input",
                    "tags": []
                }
            },
            "checkValidity": {
                "complexType": {
                    "signature": "() => Promise<boolean>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<boolean>"
                },
                "docs": {
                    "text": "Validate the input and get the validation result",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "mask",
                "methodName": "maskChanged"
            }, {
                "propName": "type",
                "methodName": "typeChanged"
            }];
    }
    static get attachInternalsMemberName() { return "internals"; }
}
