var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f)
        throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
        throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m")
        throw new TypeError("Private method is not writable");
    if (kind === "a" && !f)
        throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
        throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var _GxIdeBpmTaskDocuments_instances, _GxIdeBpmTaskDocuments__componentLocale, _GxIdeBpmTaskDocuments_renderedFirstTime, _GxIdeBpmTaskDocuments_shortcutsSrc, _GxIdeBpmTaskDocuments_chShortcutsEl, _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl, _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl, _GxIdeBpmTaskDocuments_newEnabledCheckboxEl, _GxIdeBpmTaskDocuments_newRequiredCheckboxEl, _GxIdeBpmTaskDocuments_readEnabledCheckboxEl, _GxIdeBpmTaskDocuments_readRequiredCheckboxEl, _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl, _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl, _GxIdeBpmTaskDocuments_getAllCheckboxes, _GxIdeBpmTaskDocuments_addDocument, _GxIdeBpmTaskDocuments_cancelCallbackHandler, _GxIdeBpmTaskDocuments_confirmCallbackHandler, _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler, _GxIdeBpmTaskDocuments_handleCheckboxChange, _GxIdeBpmTaskDocuments_handleDeleteButton, _GxIdeBpmTaskDocuments_listenDocumentSelected, _GxIdeBpmTaskDocuments_objectSelectionChangedHandler, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler, _GxIdeBpmTaskDocuments_renderActions, _GxIdeBpmTaskDocuments_renderEmptyState, _GxIdeBpmTaskDocuments_renderFooter, _GxIdeBpmTaskDocuments_renderMain;
import { Host, h, getAssetPath } from "@stencil/core";
import { Locale } from "../../../common/locale";
import { convertSuggestedDocumentsToSuggestItems, taskDocumentsToActionListItemModel } from "./helpers";
import { getIconPath } from "@genexus/mercury";
const CHECKED_VALUE = "true";
const CSS_BUNDLES = [
    "resets/box-sizing",
    "components/list-box",
    "components/tabular-grid",
    "utils/form--full",
    "utils/layout",
    "utils/spacing",
    "chameleon/scrollbar"
];
const MODULE_ICON = getIconPath({
    category: "objects",
    name: "module"
});
const MORE_ICON = getIconPath({
    category: "gemini-tools",
    name: "show-more-horizontal",
    colorType: "primary"
});
const DELETE_ICON = getIconPath({
    category: "menus",
    name: "delete",
    colorType: "primary"
});
const NODENAME = "CH-CHECKBOX";
export class GxIdeBpmTaskDocuments {
    constructor() {
        _GxIdeBpmTaskDocuments_instances.add(this);
        _GxIdeBpmTaskDocuments__componentLocale.set(this, void 0);
        _GxIdeBpmTaskDocuments_renderedFirstTime.set(this, false);
        _GxIdeBpmTaskDocuments_shortcutsSrc.set(this, getAssetPath(`./gx-ide-assets/bpm-task-documents/shortcuts.json`));
        _GxIdeBpmTaskDocuments_chShortcutsEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_newEnabledCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_newRequiredCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_readEnabledCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_readRequiredCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl.set(this, void 0);
        _GxIdeBpmTaskDocuments_cancelCallbackHandler.set(this, () => {
            this.cancelCallback();
        });
        _GxIdeBpmTaskDocuments_confirmCallbackHandler.set(this, () => {
            this.confirmCallback(this.documents);
        });
        _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler.set(this, async (e) => {
            const value = e.detail;
            this.suggestDocumentsCallback(value)
                .then(result => {
                this.suggestedDocuments =
                    convertSuggestedDocumentsToSuggestItems(result);
            })
                .catch(() => {
                // to do
            });
        });
        _GxIdeBpmTaskDocuments_handleDeleteButton.set(this, () => {
            this.documents = this.documents.filter(doc => doc.name !== this.selectedDocument.name);
            this.selectedDocument = null;
            __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, "f").call(this);
        });
        _GxIdeBpmTaskDocuments_listenDocumentSelected.set(this, async (e) => {
            if (e.detail) {
                __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_addDocument).call(this, e.detail);
            }
        });
        _GxIdeBpmTaskDocuments_objectSelectionChangedHandler.set(this, (e) => {
            this.selectedDocument = this.documents.find(doc => { var _a; return doc.name === ((_a = e.detail[0]) === null || _a === void 0 ? void 0 : _a.item.caption); });
        });
        _GxIdeBpmTaskDocuments_refreshDocumentsActionListState.set(this, () => {
            var _a, _b;
            (_a = this.documents) === null || _a === void 0 ? void 0 : _a.sort((a, b) => {
                return a.name.localeCompare(b.name);
            });
            this.documentsActionListState = taskDocumentsToActionListItemModel(this.documents, this.selectedDocument);
            this.selectedDocument =
                this.selectedDocument || ((_b = this.documents) === null || _b === void 0 ? void 0 : _b[0]) || null;
        });
        _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler.set(this, async () => {
            const callbackResult = await this.selectDocumentCallback();
            if (callbackResult) {
                this.documentName = callbackResult;
                __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_addDocument).call(this, callbackResult);
            }
        });
        _GxIdeBpmTaskDocuments_renderActions.set(this, () => {
            var _a, _b, _c, _d, _e, _f, _g, _h;
            return (h("ch-tabular-grid", { class: "tabular-grid scrollable", rowSelectionMode: "none", keyboardNavigationMode: "focus", columnResizeMode: "single" }, h("ch-tabular-grid-columnset", { class: "tabular-grid-column-set" }, h("ch-tabular-grid-column", { class: "tabular-grid-column", columnId: "code", columnName: "", settingable: false, sortable: false }), h("ch-tabular-grid-column", { class: "tabular-grid-column", columnId: "enabled", settingable: false, sortable: false, columnName: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.enabledCheckbox }), h("ch-tabular-grid-column", { class: "tabular-grid-column", columnId: "required", settingable: false, sortable: false, columnName: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.requiredCheckbox })), h("ch-tabular-grid-row", {
                // read
                class: "tabular-grid-row", rowid: "read"
            }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.readLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_a = this.selectedDocument) === null || _a === void 0 ? void 0 : _a.readEnabled.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_readEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_b = this.selectedDocument) === null || _b === void 0 ? void 0 : _b.readRequired.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_readRequiredCheckboxEl, el, "f")) }))), h("ch-tabular-grid-row", {
                // new
                class: "tabular-grid-row", rowid: "read"
            }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.newLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_c = this.selectedDocument) === null || _c === void 0 ? void 0 : _c.newEnabled.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_newEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_d = this.selectedDocument) === null || _d === void 0 ? void 0 : _d.newRequired.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_newRequiredCheckboxEl, el, "f")) }))), h("ch-tabular-grid-row", {
                // update
                class: "tabular-grid-row", rowid: "read"
            }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.updateLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_e = this.selectedDocument) === null || _e === void 0 ? void 0 : _e.updateEnabled.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_f = this.selectedDocument) === null || _f === void 0 ? void 0 : _f.updateRequired.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl, el, "f")) }))), h("ch-tabular-grid-row", {
                // delete
                class: "tabular-grid-row", rowid: "read"
            }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.deleteLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_g = this.selectedDocument) === null || _g === void 0 ? void 0 : _g.deleteEnabled.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_h = this.selectedDocument) === null || _h === void 0 ? void 0 : _h.deleteRequired.toString(), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl, el, "f")) })))));
        });
        _GxIdeBpmTaskDocuments_renderEmptyState.set(this, () => {
            return (h("gx-ide-empty-state", { class: "recent-objects__empty-state", stateIconSrc: MODULE_ICON, isAnimated: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderedFirstTime, "f"), stateTitle: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").emptyRightPanelInfo.title }, h("button", { class: "button-secondary", onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler, "f") }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").emptyRightPanelInfo.buttonCaption)));
        });
        _GxIdeBpmTaskDocuments_renderFooter.set(this, () => {
            return (h("footer", { class: "footer dialog-footer dialog-footer-with-border spacing-body-block-end spacing-body-inline" }, h("div", { class: "buttons-spacer" }, h("button", { class: "button-secondary", id: "button-cancel", onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_cancelCallbackHandler, "f"), part: "button-cancel" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").footer.cancelButton), h("button", { class: "button-primary", id: "button-create", onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_confirmCallbackHandler, "f"), part: "button-create" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").footer.confirmButton))));
        });
        _GxIdeBpmTaskDocuments_renderMain.set(this, () => {
            return [
                h("div", { class: "documents__list spacing-body-inline" }, h("ch-action-list-render", { selection: "single", class: "list-box", model: this.documentsActionListState, onSelectedItemsChange: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_objectSelectionChangedHandler, "f") })),
                __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderActions, "f").call(this)
            ];
        });
        this.documentsActionListState = [];
        this.documentName = null;
        this.selectedDocument = null;
        this.suggestedDocuments = undefined;
        this.documents = undefined;
        this.cancelCallback = undefined;
        this.confirmCallback = undefined;
        this.selectDocumentCallback = undefined;
        this.suggestDocumentsCallback = undefined;
    }
    async componentWillLoad() {
        __classPrivateFieldSet(this, _GxIdeBpmTaskDocuments__componentLocale, await Locale.getComponentStrings(this.el), "f");
        __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, "f").call(this);
    }
    componentDidRender() {
        if (!__classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderedFirstTime, "f")) {
            this.componentDidRenderFirstTime.emit(__classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").componentName);
            __classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_renderedFirstTime, true, "f");
        }
        const shadowRoot = this.el.shadowRoot;
        const checkboxes = __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_getAllCheckboxes).call(this, shadowRoot);
        if (checkboxes) {
            checkboxes.forEach(checkbox => {
                checkbox.addEventListener("input", __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_handleCheckboxChange).bind(this));
            });
        }
    }
    /**
     * Suspends or reactivates the shortcuts
     */
    async suspendShortcuts(suspendShortcuts) {
        if (suspendShortcuts) {
            __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_chShortcutsEl, "f").suspend = true;
        }
        else {
            __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_chShortcutsEl, "f").suspend = false;
        }
    }
    render() {
        return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_chShortcutsEl, el, "f")) }), h("section", { class: "section" }, h("div", { class: "main field-group" }, h("div", { class: "documents__header buttons-spacer spacing-body-inline spacing-body-block-start" }, h("ch-combo-box-render", { class: "combo-box documents__suggest", model: this.suggestedDocuments, placeholder: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.suggestPlaceholder, suggest: true, onInput: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler, "f"), onChange: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_listenDocumentSelected, "f"), suggestOptions: {
                alreadyProcessed: false,
                autoExpand: true,
                hideMatchesAndShowNonMatches: false,
                highlightMatchedItems: false,
                matchCase: false,
                regularExpression: false,
                strict: false
            } }), h("span", null, h("button", { class: "button-tertiary button-icon-only", "aria-label": __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.addDocumentButtonLabel, title: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.addDocumentButtonLabel, onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler, "f") }, h("ch-image", { class: "icon-xs", src: MORE_ICON })), h("button", { class: "button-tertiary button-icon-only", "aria-label": __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.clearDocumentButtonLabel, title: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.clearDocumentButtonLabel, onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_handleDeleteButton, "f") }, h("ch-image", { class: "icon-xs", src: DELETE_ICON })))), this.documentsActionListState.length
            ? __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderMain, "f").call(this)
            : __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderEmptyState, "f").call(this)), __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderFooter, "f").call(this))));
    }
    static get is() { return "gx-ide-bpm-task-documents"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["task-documents.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["task-documents.css"]
        };
    }
    static get assetsDirs() { return ["gx-ide-assets/bpm-task-documents"]; }
    static get properties() {
        return {
            "documents": {
                "type": "unknown",
                "mutable": true,
                "complexType": {
                    "original": "TaskDocumentData[]",
                    "resolved": "TaskDocumentData[]",
                    "references": {
                        "TaskDocumentData": {
                            "location": "local",
                            "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
                            "id": "src/components/bpm/task-documents/task-documents.tsx::TaskDocumentData"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "property",
                            "text": "documents"
                        }, {
                            "name": "description",
                            "text": "The current value of the documents for the task"
                        }],
                    "text": ""
                }
            },
            "cancelCallback": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "CancelCallback",
                    "resolved": "() => Promise<void>",
                    "references": {
                        "CancelCallback": {
                            "location": "local",
                            "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
                            "id": "src/components/bpm/task-documents/task-documents.tsx::CancelCallback"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "property",
                            "text": "cancelCallback"
                        }, {
                            "name": "description",
                            "text": "Callback invoked when the user cancels the application declaration (Cancel button)"
                        }],
                    "text": ""
                }
            },
            "confirmCallback": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "ConfirmCallback",
                    "resolved": "(data: TaskDocumentData[]) => Promise<void>",
                    "references": {
                        "ConfirmCallback": {
                            "location": "local",
                            "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
                            "id": "src/components/bpm/task-documents/task-documents.tsx::ConfirmCallback"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "property",
                            "text": "confirmCallback"
                        }, {
                            "name": "description",
                            "text": "Callback invoked when the user confirms the application declaration (Ok button)"
                        }],
                    "text": ""
                }
            },
            "selectDocumentCallback": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "SelectDocumentCallback",
                    "resolved": "() => Promise<string>",
                    "references": {
                        "SelectDocumentCallback": {
                            "location": "local",
                            "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
                            "id": "src/components/bpm/task-documents/task-documents.tsx::SelectDocumentCallback"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "property",
                            "text": "selectDocumentCallback"
                        }, {
                            "name": "description",
                            "text": "Callback invoked when the user presses the '...' button to access the WorkflowDocuments selection dialog. Returns the name of the document to be inserted in the input or 'undefined' if it was canceled."
                        }],
                    "text": ""
                }
            },
            "suggestDocumentsCallback": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "SuggestDocumentsCallback",
                    "resolved": "(documentName: string) => Promise<string[]>",
                    "references": {
                        "SuggestDocumentsCallback": {
                            "location": "local",
                            "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
                            "id": "src/components/bpm/task-documents/task-documents.tsx::SuggestDocumentsCallback"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "property",
                            "text": "suggestDocumentsCallback"
                        }, {
                            "name": "description",
                            "text": "Callback that must be called to obtain options for the document input."
                        }],
                    "text": ""
                }
            }
        };
    }
    static get states() {
        return {
            "documentsActionListState": {},
            "documentName": {},
            "selectedDocument": {},
            "suggestedDocuments": {}
        };
    }
    static get events() {
        return [{
                "method": "componentDidRenderFirstTime",
                "name": "componentDidRenderFirstTime",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [{
                            "name": "description",
                            "text": "Gets fired when the component has rendered for the first time."
                        }],
                    "text": ""
                },
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                }
            }];
    }
    static get methods() {
        return {
            "suspendShortcuts": {
                "complexType": {
                    "signature": "(suspendShortcuts: boolean) => Promise<void>",
                    "parameters": [{
                            "name": "suspendShortcuts",
                            "type": "boolean",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Suspends or reactivates the shortcuts",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
}
_GxIdeBpmTaskDocuments__componentLocale = new WeakMap(), _GxIdeBpmTaskDocuments_renderedFirstTime = new WeakMap(), _GxIdeBpmTaskDocuments_shortcutsSrc = new WeakMap(), _GxIdeBpmTaskDocuments_chShortcutsEl = new WeakMap(), _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_newEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_newRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_readEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_readRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_cancelCallbackHandler = new WeakMap(), _GxIdeBpmTaskDocuments_confirmCallbackHandler = new WeakMap(), _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler = new WeakMap(), _GxIdeBpmTaskDocuments_handleDeleteButton = new WeakMap(), _GxIdeBpmTaskDocuments_listenDocumentSelected = new WeakMap(), _GxIdeBpmTaskDocuments_objectSelectionChangedHandler = new WeakMap(), _GxIdeBpmTaskDocuments_refreshDocumentsActionListState = new WeakMap(), _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler = new WeakMap(), _GxIdeBpmTaskDocuments_renderActions = new WeakMap(), _GxIdeBpmTaskDocuments_renderEmptyState = new WeakMap(), _GxIdeBpmTaskDocuments_renderFooter = new WeakMap(), _GxIdeBpmTaskDocuments_renderMain = new WeakMap(), _GxIdeBpmTaskDocuments_instances = new WeakSet(), _GxIdeBpmTaskDocuments_getAllCheckboxes = function _GxIdeBpmTaskDocuments_getAllCheckboxes(node) {
    const checkboxes = [];
    node.childNodes.forEach(child => {
        if (child.nodeName === NODENAME) {
            checkboxes.push(child);
        }
        else if (child instanceof HTMLElement) {
            checkboxes.push(...__classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_getAllCheckboxes).call(this, child));
        }
    });
    return checkboxes;
}, _GxIdeBpmTaskDocuments_addDocument = function _GxIdeBpmTaskDocuments_addDocument(documentName) {
    const documentExists = this.documents.some(doc => doc.name === documentName);
    if (!documentExists) {
        this.documents = [
            ...this.documents,
            {
                name: documentName,
                deleteEnabled: false,
                deleteRequired: false,
                newEnabled: false,
                newRequired: false,
                readEnabled: false,
                readRequired: false,
                updateEnabled: false,
                updateRequired: false
            }
        ];
        __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, "f").call(this);
    }
}, _GxIdeBpmTaskDocuments_handleCheckboxChange = function _GxIdeBpmTaskDocuments_handleCheckboxChange() {
    const data = {
        name: this.selectedDocument.name,
        readEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_readEnabledCheckboxEl, "f").value === CHECKED_VALUE,
        readRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_readRequiredCheckboxEl, "f").value === CHECKED_VALUE,
        newEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_newEnabledCheckboxEl, "f").value === CHECKED_VALUE,
        newRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_newRequiredCheckboxEl, "f").value === CHECKED_VALUE,
        updateEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl, "f").value === CHECKED_VALUE,
        updateRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl, "f").value === CHECKED_VALUE,
        deleteEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl, "f").value === CHECKED_VALUE,
        deleteRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl, "f").value === CHECKED_VALUE
    };
    this.selectedDocument = data;
    this.documents = this.documents.map(doc => doc.name === this.selectedDocument.name ? this.selectedDocument : doc);
};
//# sourceMappingURL=task-documents.js.map
