var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
import { Router } from 'aurelia-router';
import { DialogController } from 'aurelia-dialog';
import { ValidationRules, ValidationController } from 'aurelia-validation';
import { inject, InlineViewStrategy, ViewEngine, ViewResources, Container, computedFrom } from 'aurelia-framework';
import { I18N } from 'aurelia-i18n';
import { KeyboardShortcut } from './../../constants/constants';
import { Config } from '../../config';
export var CustomDialogType;
(function (CustomDialogType) {
    CustomDialogType[CustomDialogType["Error"] = 0] = "Error";
    CustomDialogType[CustomDialogType["Question"] = 1] = "Question";
    CustomDialogType[CustomDialogType["Warning"] = 2] = "Warning";
    CustomDialogType[CustomDialogType["Notification"] = 3] = "Notification";
    CustomDialogType[CustomDialogType["Edit"] = 4] = "Edit";
    CustomDialogType[CustomDialogType["Input"] = 5] = "Input";
    CustomDialogType[CustomDialogType["RichText"] = 6] = "RichText";
    CustomDialogType[CustomDialogType["Select"] = 7] = "Select";
    CustomDialogType[CustomDialogType["Custom"] = 8] = "Custom";
})(CustomDialogType || (CustomDialogType = {}));
export var DialogBoxViewModel = (function () {
    function DialogBoxViewModel(_controller, valController, router, viewEngine, viewResources) {
        var _this = this;
        this._controller = _controller;
        this.valController = valController;
        this.router = router;
        this.viewEngine = viewEngine;
        this.viewResources = viewResources;
        this.errorView = "<template>\n        <ux-dialog class=\"errorBox\">\n          <ui-dialog-header button-visible.one-time=\"false == lock\" icon=\"digi-alert-danger\" title.bind=\"inputParams.title\"\n            button-function.call=\"controller.cancel()\" size=\"xxl\">\n          </ui-dialog-header>\n      \n          <ux-dialog-body>\n            <div class=\"row dialog-box-message\">\n              <div if.bind=\"inputParams.isTranslated\" class=\"message\" t=\"[html]${inputParams.message}\"></div>\n              <div else class=\"message\" innerhtml.bind=\"inputParams.message\"></div>\n            </div>\n          </ux-dialog-body>\n\n          <ux-dialog-footer class=\"right\">\n            <ui-button repeat.for=\"action of inputParams.actions\" click.delegate=\"$parent.selectAction(action)\"\n              icon=\"${action.icon}\" t=\"[label]${action.label};[title]${action.title}\" class=\"${action.class}\" size=\"md\"\n              ui-theme.bind=\"action.theme\" type.bind=\"action.type\" keyboard-shortcut.bind=\"action.keyboardShortcut\">\n            </ui-button>\n          </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.warningView = "<template>\n        <ux-dialog class=\"warningBox\">\n          <ui-dialog-header button-visible.one-time=\"false == lock\" icon=\"digi-exclamation-circle\" title.bind=\"inputParams.title\"\n            button-function.call=\"controller.cancel()\" size=\"xxl\">\n          </ui-dialog-header>\n      \n          <ux-dialog-body>\n            <div class=\"row\">\n              <div class=\"col s12\">\n                <div if.bind=\"inputParams.isTranslated\" class=\"message\" t=\"[html]${inputParams.message}\"></div>\n                <div else class=\"message\" innerhtml.bind=\"inputParams.message\"></div>\n              </div>\n            </div>\n          </ux-dialog-body>\n\n          <ux-dialog-footer class=\"right\">\n            <ui-button repeat.for=\"action of inputParams.actions\" click.delegate=\"$parent.selectAction(action)\"\n              icon=\"${action.icon}\" t=\"[label]${action.label};[title]${action.title}\" class=\"${action.class}\" size=\"md\"\n              ui-theme.bind=\"action.theme\" type.bind=\"action.type\" keyboard-shortcut.bind=\"action.keyboardShortcut\">\n            </ui-button>\n          </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.questionView = "<template>\n        <ux-dialog class=\"questionBox\">\n          <ui-dialog-header button-visible.one-time=\"false == lock\" icon=\"digi-questions\" title.bind=\"inputParams.title\"\n            button-function.call=\"controller.cancel()\" size=\"xxl\">\n          </ui-dialog-header>\n      \n          <ux-dialog-body>\n            <div class=\"row\">\n      \n              <div class=\"col s12\">\n                <div if.bind=\"inputParams.isTranslated\" class=\"message\" t=\"[html]${inputParams.message}\"></div>\n                <div else class=\"message\" innerhtml.bind=\"inputParams.message\"></div>\n              </div>\n            </div>\n          </ux-dialog-body>\n      \n          <ux-dialog-footer class=\"right\">\n            <ui-button repeat.for=\"action of inputParams.actions\" click.delegate=\"$parent.selectAction(action)\"\n              icon=\"${action.icon}\" t=\"[label]${action.label};[title]${action.title}\" class=\"${action.class}\" size=\"md\"\n              ui-theme.bind=\"action.theme\" type.bind=\"action.type\" keyboard-shortcut.bind=\"action.keyboardShortcut\">\n            </ui-button>\n          </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.notificationView = "<template>\n        <ux-dialog class=\"notificationBox\">\n          <ui-dialog-header button-visible.one-time=\"false == lock\" icon=\"digi-alert-info\" title.bind=\"inputParams.title\"\n            button-function.call=\"controller.cancel()\" size=\"xxl\">\n          </ui-dialog-header>\n      \n          <ux-dialog-body>\n            <div class=\"row\">\n              <div class=\"col s12\">\n                <div if.bind=\"inputParams.isTranslated\" class=\"message\" t=\"[html]${inputParams.message}\"></div>\n                <div else class=\"message\" innerhtml.bind=\"inputParams.message\"></div>\n              </div>\n            </div>\n          </ux-dialog-body>\n          \n          <ux-dialog-footer class=\"right\">\n            <ui-button repeat.for=\"action of inputParams.actions\" click.delegate=\"$parent.selectAction(action)\"\n              icon=\"${action.icon}\" t=\"[label]${action.label};[title]${action.title}\" class=\"${action.class}\" size=\"md\"\n              ui-theme.bind=\"action.theme\" type.bind=\"action.type\" keyboard-shortcut.bind=\"action.keyboardShortcut\">\n            </ui-button>\n          </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.editView = "<template>\n        <ux-dialog class.bind=\"'editDialog ui-dialog-' + inputParams.position + ' ui-dialog-' + inputParams.size\">\n            <ui-dialog-header icon=\"${inputParams.icon}\" title.bind=\"inputParams.title\" button-function.call=\"cancel()\" size=\"xxl\">\n            </ui-dialog-header>\n\n            <ux-dialog-body>\n                <compose view-model.ref=\"customVM\" view-model.bind=\"inputParams.editVm\" model.bind=\"inputParams\" />\n            </ux-dialog-body>\n\n            <ux-dialog-footer view-model.bind=\"inputParams.editVm\" class=\"grid-dialog-footer\"\n                  if.bind=\"customVM.currentViewModel.dialogLeftActions.length > 0 || customVM.currentViewModel.dialogRightActions.length > 0 || inputParams.actions.length > 0 || inputParams.canSave\">\n                <div class=\"grid-dialog-footer__left\">\n                    <ui-button repeat.for=\"action of customVM.currentViewModel.dialogLeftActions\" click.delegate=\"$parent.selectAction(action)\" icon=\"${action.icon}\" t=\"[label]${action.label};[title]${action.title}\" size=\"md\" ui-theme=\"${action.theme}\" type=\"${action.type}\"></ui-button>\n                </div>\n                <div class=\"grid-dialog-footer__right\">\n                    <ui-button repeat.for=\"action of customVM.currentViewModel.dialogRightActions\" current.bind=\"customVM.currentViewModel\" disabled.bind=\"action.disabled\" click.delegate=\"$parent.selectAction(action)\" icon=\"${action.icon}\" t=\"[label]${action.label};[title]${action.title}\" size=\"md\" ui-theme=\"${action.theme}\" type=\"${action.type}\"></ui-button>\n                    <ui-button repeat.for=\"action of inputParams.actions\" click.delegate=\"$parent.selectAction(action)\" disabled.bind=\"action.disabled\" icon=\"${action.icon}\" t=\"[label]${action.label};[title]${action.title}\" class=\"${action.class}\" size=\"md\" ui-theme=\"${action.theme}\" type=\"${action.type}\"></ui-button>\n                    <ui-button if.one-time=\"inputParams.canSave\" disabled.bind=\"!customVM.currentViewModel.canSave\" click.delegate=\"saveEntity()\" icon=\"digi-save\" t=\"[label]common:general.save\" type=\"solid\" size=\"md\" ui-theme=\"primary\"></ui-button>\n                </div>\n            </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.inputView = "<template>\n        <ux-dialog class=\"editDialog ux-dialog-md\">\n          <ui-dialog-header icon.bind=\"inputParams.icon\" title.bind=\"inputParams.title\" size=\"xxl\" button-visible=\"true\"\n            button-function.call=\"controller.cancel()\">\n          </ui-dialog-header>\n      \n          <ux-dialog-body>\n            <ui-panel>\n              <div class=\"row\">\n                <div class=\"col l12\">\n                  <ui-field t=\"[label]${inputParams.message}\">\n                    <ui-input value.bind=\"input & validate\" ref=\"inputField\">\n                    </ui-input>\n                  </ui-field>\n                </div>\n              </div>\n            </ui-panel>\n          </ux-dialog-body>\n      \n          <ux-dialog-footer>\n            <ui-button class=\"right\" click.delegate=\"selectOption()\" icon=\"digi-save\" t=\"[label]common:general.save\"\n              type=\"solid\" size=\"md\" ui-theme=\"primary\"></ui-button>\n          </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.richtextView = "<template>\n        <ux-dialog class=\"editDialog ux-dialog-md\">\n          <ui-dialog-header icon.bind=\"inputParams.icon\" title.bind=\"inputParams.title\" size=\"xxl\" button-visible=\"true\" \n            button-function.call=\"controller.cancel()\">\n          </ui-dialog-header>\n\n          <ux-dialog-body>\n            <ui-panel>\n              <div class=\"row\">\n                <div class=\"col l12\">\n                  <label t=\"${inputParams.message}\" class=\"active\"></label>\n                  <tiny-mce content.two-way=\"input\" class=\"borderless\"></tiny-mce>\n                </div>\n              </div>\n            </ui-panel>\n          </ux-dialog-body>\n\n          <ux-dialog-footer>\n            <ui-button class=\"right\" click.delegate=\"selectOption()\" icon=\"digi-save\" t=\"[label]common:general.save\"\n              type=\"solid\" size=\"md\" ui-theme=\"primary\"></ui-button>\n          </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.selectView = "<template>\n        <ux-dialog class=\"editDialog ux-dialog-md\">\n          <ui-dialog-header icon.bind=\"inputParams.icon\" title.bind=\"inputParams.title\" size=\"xxl\" button-visible=\"true\" \n            button-function.call=\"controller.cancel()\">\n          </ui-dialog-header>\n      \n          <ux-dialog-body>\n            <ui-panel>\n              <div class=\"row\">\n                <div class=\"col l12\">\n                  <ui-field t=\"[label]${inputParams.message}\">\n                    <ui-select if.one-time=\"inputParams.isMultiple\" multiple value.bind=\"select\" data-allow-clear=\"true\"\n                      t=\"[placeholder]general.chooseAnOption\" data-source.bind=\"inputParams.service.gridDataSource\"\n                      options-text=\"${inputParams.optionsText}\" filter-properties.bind=\"inputParams.filterProperties\"\n                      options-value=\"${inputParams.optionsValue}\" sort-column=\"${inputParams.sortColumn}\">\n                    </ui-select>\n      \n                    <ui-select else value.bind=\"select\" data-allow-clear=\"true\" t=\"[placeholder]general.chooseAnOption\"\n                      data-source.bind=\"inputParams.service.gridDataSource\" options-text=\"${inputParams.optionsText}\"\n                      filter-properties.bind=\"inputParams.filterProperties\" options-value=\"${inputParams.optionsValue}\"\n                      sort-column=\"${inputParams.sortColumn}\">\n                    </ui-select>\n                  </ui-field>\n                </div>\n              </div>\n            </ui-panel>\n          </ux-dialog-body>\n      \n          <ux-dialog-footer> \n            <ui-button class=\"right\" click.delegate=\"selectOption()\" icon=\"digi-save\" t=\"[label]common:general.save\"\n              type=\"solid\" size=\"md\" ui-theme=\"primary\"></ui-button>\n          </ux-dialog-footer>\n        </ux-dialog>\n      </template>";
        this.customView = "<template>\n      <compose view-model.ref=\"customVM\" view-model.bind=\"inputParams.editVm\" model.bind=\"inputParams\" />\n    </template>";
        this.i18n = Container.instance.get(I18N);
        this.config = Container.instance.get(Config);
        this.defaultAction = {
            label: this.i18n.tr("general.ok", { ns: "common" }),
            title: this.i18n.tr("general.ok", { ns: "common" }),
            theme: 'primary',
            type: 'solid',
            disabled: false,
            fn: function () { _this.selectOption("Ok"); },
            keyboardShortcut: this.config.globalConfig.keyboardShortcutFwBox ? KeyboardShortcut.Enter : null
        };
    }
    Object.defineProperty(DialogBoxViewModel.prototype, "controller", {
        get: function () {
            return this._controller;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DialogBoxViewModel.prototype, "lock", {
        get: function () {
            return this.controller.settings.lock === true;
        },
        enumerable: false,
        configurable: true
    });
    DialogBoxViewModel.prototype.activate = function (config) {
        this.inputParams = config;
        this.inputParams.title = config.title || "Application";
        this.inputParams.actions = config.actions || (!this.inputParams.canSave ? [this.defaultAction] : []);
        this.inputParams.dialogType = config.dialogType || CustomDialogType.Error;
        this.inputParams.icon = config.icon || "digi-edit";
        this.inputParams.size = config.size || "lg";
        this.input = config.content || null;
        this.select = config.select || (config.isMultiple ? new Array() : null);
        if (this.inputParams.required && (this.inputParams.dialogType == CustomDialogType.Input || this.inputParams.dialogType == CustomDialogType.RichText)) {
            ValidationRules.ensure('input').required().on(this);
        }
    };
    DialogBoxViewModel.prototype.attached = function () {
        var _this = this;
        $(function () {
            var _a, _b, _c;
            if (document.activeElement != null) {
                document.activeElement.blur();
            }
            if (_this.inputParams.dialogType === CustomDialogType.Input) {
                setTimeout(function () {
                    $(_this.inputField).find('input').focus();
                }, 100);
            }
            else {
                (_c = (_b = (_a = $(document).find('ux-dialog-footer')) === null || _a === void 0 ? void 0 : _a.get(0)) === null || _b === void 0 ? void 0 : _b.firstElementChild) === null || _c === void 0 ? void 0 : _c.focus();
            }
        });
        if (this.inputParams.dialogType == CustomDialogType.Edit) {
            this.handleShortcutsEvent = function (event) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4, this.handleShortcuts.call(this, event)];
                    case 1: return [2, _a.sent()];
                }
            }); }); };
            document.addEventListener("keydown", this.handleShortcutsEvent, false);
        }
    };
    DialogBoxViewModel.prototype.detached = function () {
        if (this.inputParams.dialogType == CustomDialogType.Edit) {
            document.removeEventListener("keydown", this.handleShortcutsEvent, false);
        }
    };
    DialogBoxViewModel.prototype.handleShortcuts = function (event) {
        return __awaiter(this, void 0, void 0, function () {
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!(event.key == KeyboardShortcut.Escape || ((window.navigator.platform.match("Mac") ? event.metaKey : event.ctrlKey) && event.key == "s"))) return [3, 6];
                        event.stopImmediatePropagation();
                        event.preventDefault();
                        _a = event.key;
                        switch (_a) {
                            case "s": return [3, 1];
                            case KeyboardShortcut.Escape: return [3, 3];
                        }
                        return [3, 5];
                    case 1: return [4, this.saveEntity()];
                    case 2:
                        _b.sent();
                        return [3, 5];
                    case 3: return [4, this.cancel()];
                    case 4:
                        _b.sent();
                        return [3, 5];
                    case 5: return [2, true];
                    case 6: return [2];
                }
            });
        });
    };
    DialogBoxViewModel.prototype.cancel = function () {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function () {
            var result;
            return __generator(this, function (_c) {
                switch (_c.label) {
                    case 0:
                        if (!(((_b = (_a = this.customVM) === null || _a === void 0 ? void 0 : _a.currentViewModel) === null || _b === void 0 ? void 0 : _b.canDeactivate) != null)) return [3, 2];
                        return [4, this.customVM.currentViewModel.canDeactivate()];
                    case 1:
                        result = _c.sent();
                        if (result) {
                            this.controller.cancel();
                        }
                        return [3, 3];
                    case 2:
                        this.controller.cancel();
                        _c.label = 3;
                    case 3: return [2];
                }
            });
        });
    };
    DialogBoxViewModel.prototype.saveEntity = function () {
        return __awaiter(this, void 0, void 0, function () {
            var newEntity;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4, this.customVM.currentViewModel.saveCurrentEntity()];
                    case 1:
                        newEntity = _a.sent();
                        if (newEntity != null) {
                            this.controller.ok(newEntity);
                        }
                        return [2];
                }
            });
        });
    };
    DialogBoxViewModel.prototype.selectOption = function (dialogResult) {
        var _this = this;
        if (this.inputParams.dialogType == CustomDialogType.Input || this.inputParams.dialogType == CustomDialogType.RichText) {
            if (this.inputParams.required) {
                this.valController.validate().then(function (valResult) {
                    if (valResult.valid) {
                        _this.controller.ok(_this.input);
                    }
                });
            }
            else {
                this.controller.ok(this.input);
            }
        }
        else if (this.inputParams.dialogType == CustomDialogType.Select) {
            this.controller.ok(this.select);
        }
        else {
            this.controller.ok(dialogResult);
        }
    };
    DialogBoxViewModel.prototype.selectAction = function (action) {
        return __awaiter(this, void 0, void 0, function () {
            var promise;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!(action.fn != null)) return [3, 5];
                        promise = null;
                        if (typeof action.fn === "function") {
                            promise = action.fn(this);
                        }
                        else if (typeof action.fn === "string" && this.customVM.currentViewModel[action.fn] != null) {
                            promise = this.customVM.currentViewModel[action.fn]();
                        }
                        else {
                            throw new Error("action.fn must be a function or the name of a function on the dialog's view model");
                        }
                        if (!(promise != null)) return [3, 4];
                        if (!(typeof promise.then === "function")) return [3, 2];
                        return [4, promise.then(function (dialogCloseResult) {
                                if (dialogCloseResult != null && dialogCloseResult.wasCancelled != null) {
                                    if (!dialogCloseResult.wasCancelled && action.closeDialog) {
                                        _this.controller.ok();
                                    }
                                }
                                else if (action.closeDialog) {
                                    _this.controller.ok();
                                }
                            })];
                    case 1:
                        _a.sent();
                        return [3, 3];
                    case 2:
                        if (action.closeDialog) {
                            this.controller.ok();
                        }
                        _a.label = 3;
                    case 3: return [3, 5];
                    case 4:
                        if (action.closeDialog) {
                            this.controller.ok();
                        }
                        _a.label = 5;
                    case 5: return [2];
                }
            });
        });
    };
    DialogBoxViewModel.prototype.goTo = function (url) {
        this.router.navigate(url);
        this.controller.cancel();
    };
    DialogBoxViewModel.prototype.getViewStrategy = function () {
        switch (this.inputParams.dialogType) {
            case CustomDialogType.Error:
                return new InlineViewStrategy(this.errorView);
            case CustomDialogType.Question:
                return new InlineViewStrategy(this.questionView);
            case CustomDialogType.Notification:
                return new InlineViewStrategy(this.notificationView);
            case CustomDialogType.Warning:
                return new InlineViewStrategy(this.warningView);
            case CustomDialogType.Edit:
                return new InlineViewStrategy(this.editView);
            case CustomDialogType.Input:
                return new InlineViewStrategy(this.inputView);
            case CustomDialogType.RichText:
                return new InlineViewStrategy(this.richtextView);
            case CustomDialogType.Select:
                return new InlineViewStrategy(this.selectView);
            case CustomDialogType.Custom:
                return new InlineViewStrategy(this.customView);
            default:
                return null;
        }
    };
    __decorate([
        computedFrom('controller.settings.lock'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [])
    ], DialogBoxViewModel.prototype, "lock", null);
    DialogBoxViewModel = __decorate([
        inject(DialogController, ValidationController, Router),
        __metadata("design:paramtypes", [DialogController, ValidationController, Router, ViewEngine, ViewResources])
    ], DialogBoxViewModel);
    return DialogBoxViewModel;
}());

//# sourceMappingURL=dialog-box.js.map
