"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const WebSocketClientService_1 = require("./WebSocketClientService");
const angular = require("angular");
const CommonControllers_1 = require("./CommonControllers");
const Controllers_1 = require("./Controllers");
require('angular-route');
require('angular-sanitize');
require('@fortawesome/fontawesome-free');
require('chart.js');
require('angular-chart.js');
// require('./formio.full.js');
// var css = require('./app.css');
var css = require('./app.css');
/**
 * @type {angular.Module}
 */
var openflow;
(function (openflow) {
    "use strict";
    // .config(function (ChartJsProvider) {
    //     ChartJsProvider.setOptions({ responsive: true });
    //     ChartJsProvider.setOptions('Line', { responsive: true });
    // })
    //
    const webApp = angular.module("webApp", ['ngRoute', 'chart.js', 'ngLocalize', 'ngLocalize.Config'])
        .controller("MenuCtrl", Controllers_1.MenuCtrl)
        .controller("Providers", Controllers_1.ProvidersCtrl)
        .directive("timesince", CommonControllers_1.timesince.factory())
        .directive("timetoo", CommonControllers_1.timetoo.factory())
        .directive("translate", CommonControllers_1.translate.factory())
        .directive("textarea", CommonControllers_1.textarea.factory())
        .directive("fileread", CommonControllers_1.fileread.factory())
        .directive("copytext", CommonControllers_1.copytext.factory())
        .directive("jsonText", CommonControllers_1.jsonText.factory())
        .directive("ngType", CommonControllers_1.ngtype.factory())
        .directive("formatBytes", CommonControllers_1.formatBytes.factory())
        .directive("whenScrolled", CommonControllers_1.whenScrolled.factory())
        .service("userdata", CommonControllers_1.userdata)
        .service("WebSocketClientService", WebSocketClientService_1.WebSocketClientService)
        .directive('autoComplete', function ($timeout) {
        return function (scope, iElement, iAttrs) {
            iElement.autocomplete({
                source: scope[iAttrs.uiItems],
                select: function () {
                    $timeout(function () {
                        iElement.trigger('input');
                    }, 0);
                }
            });
        };
    })
        .service("api", CommonControllers_1.api);
    webApp.config([
        '$routeProvider',
        ($routeProvider) => {
            $routeProvider
                .when('/main', { templateUrl: 'Main.html', controller: Controllers_1.MainCtrl, controllerAs: 'ctrl' })
                .when('/Login', { templateUrl: 'Login.html', controller: Controllers_1.LoginCtrl, controllerAs: 'ctrl' })
                .when('/Providers', { templateUrl: 'Providers.html', controller: Controllers_1.ProvidersCtrl, controllerAs: 'ctrl' })
                .when('/Provider', { templateUrl: 'Provider.html', controller: Controllers_1.ProviderCtrl, controllerAs: 'ctrl' })
                .when('/Provider/:id', { templateUrl: 'Provider.html', controller: Controllers_1.ProviderCtrl, controllerAs: 'ctrl' })
                .when('/Users', { templateUrl: 'Users.html', controller: Controllers_1.UsersCtrl, controllerAs: 'ctrl' })
                .when('/User', { templateUrl: 'User.html', controller: Controllers_1.UserCtrl, controllerAs: 'ctrl' })
                .when('/User/:id', { templateUrl: 'User.html', controller: Controllers_1.UserCtrl, controllerAs: 'ctrl' })
                .when('/Roles', { templateUrl: 'Roles.html', controller: Controllers_1.RolesCtrl, controllerAs: 'ctrl' })
                .when('/Role', { templateUrl: 'Role.html', controller: Controllers_1.RoleCtrl, controllerAs: 'ctrl' })
                .when('/Role/:id', { templateUrl: 'Role.html', controller: Controllers_1.RoleCtrl, controllerAs: 'ctrl' })
                .when('/RPAWorkflows', { templateUrl: 'RPAWorkflows.html', controller: Controllers_1.RPAWorkflowsCtrl, controllerAs: 'ctrl' })
                .when('/RPAWorkflow/:id', { templateUrl: 'RPAWorkflow.html', controller: Controllers_1.RPAWorkflowCtrl, controllerAs: 'ctrl' })
                .when('/Workflows', { templateUrl: 'Workflows.html', controller: Controllers_1.WorkflowsCtrl, controllerAs: 'ctrl' })
                .when('/Reports', { templateUrl: 'Reports.html', controller: Controllers_1.ReportsCtrl, controllerAs: 'ctrl' })
                .when('/EditForm/:id', { templateUrl: 'EditForm.html', controller: Controllers_1.EditFormCtrl, controllerAs: 'ctrl' })
                .when('/EditForm', { templateUrl: 'EditForm.html', controller: Controllers_1.EditFormCtrl, controllerAs: 'ctrl' })
                .when('/Forms', { templateUrl: 'Forms.html', controller: Controllers_1.FormsCtrl, controllerAs: 'ctrl' })
                .when('/Form/:id', { templateUrl: 'Form.html', controller: Controllers_1.FormCtrl, controllerAs: 'ctrl' })
                .when('/Form/:id/:instance', { templateUrl: 'Form.html', controller: Controllers_1.FormCtrl, controllerAs: 'ctrl' })
                .when('/FormResources', { templateUrl: 'FormResources.html', controller: Controllers_1.FormResourcesCtrl, controllerAs: 'ctrl' })
                .when('/FormResource', { templateUrl: 'FormResource.html', controller: Controllers_1.FormResourceCtrl, controllerAs: 'ctrl' })
                .when('/FormResource/:id', { templateUrl: 'FormResource.html', controller: Controllers_1.FormResourceCtrl, controllerAs: 'ctrl' })
                .when('/Files', { templateUrl: 'Files.html', controller: Controllers_1.FilesCtrl, controllerAs: 'ctrl' })
                .when('/Entities', { templateUrl: 'Entities.html', controller: Controllers_1.EntitiesCtrl, controllerAs: 'ctrl' })
                .when('/Entities/:collection', { templateUrl: 'Entities.html', controller: Controllers_1.EntitiesCtrl, controllerAs: 'ctrl' })
                .when('/Entity/:collection', { templateUrl: 'Entity.html', controller: Controllers_1.EntityCtrl, controllerAs: 'ctrl' })
                .when('/Entity/:collection/:id', { templateUrl: 'Entity.html', controller: Controllers_1.EntityCtrl, controllerAs: 'ctrl' })
                .when('/Duplicates/:collection', { templateUrl: 'Duplicates.html', controller: Controllers_1.DuplicatesCtrl, controllerAs: 'ctrl' })
                .when('/History/:collection/:id', { templateUrl: 'History.html', controller: Controllers_1.HistoryCtrl, controllerAs: 'ctrl' })
                .when('/Deleted/:collection', { templateUrl: 'Deleted.html', controller: Controllers_1.DeletedCtrl, controllerAs: 'ctrl' })
                .when('/Nodered', { templateUrl: 'Nodered.html', controller: Controllers_1.NoderedCtrl, controllerAs: 'ctrl' })
                .when('/Nodered/:id', { templateUrl: 'Nodered.html', controller: Controllers_1.NoderedCtrl, controllerAs: 'ctrl' })
                .when('/hdrobots', { templateUrl: 'hdrobots.html', controller: Controllers_1.hdrobotsCtrl, controllerAs: 'ctrl' })
                .when('/Clients', { templateUrl: 'Clients.html', controller: Controllers_1.ClientsCtrl, controllerAs: 'ctrl' })
                .when('/Auditlogs', { templateUrl: 'Auditlogs.html', controller: Controllers_1.AuditlogsCtrl, controllerAs: 'ctrl' })
                .when('/Credentials', { templateUrl: 'Credentials.html', controller: Controllers_1.CredentialsCtrl, controllerAs: 'ctrl' })
                .when('/Credential', { templateUrl: 'Credential.html', controller: Controllers_1.CredentialCtrl, controllerAs: 'ctrl' })
                .when('/Credential/:id', { templateUrl: 'Credential.html', controller: Controllers_1.CredentialCtrl, controllerAs: 'ctrl' })
                .when('/OAuthClients', { templateUrl: 'OAuthClients.html', controller: Controllers_1.OAuthClientsCtrl, controllerAs: 'ctrl' })
                .when('/OAuthClient', { templateUrl: 'OAuthClient.html', controller: Controllers_1.OAuthClientCtrl, controllerAs: 'ctrl' })
                .when('/OAuthClient/:id', { templateUrl: 'OAuthClient.html', controller: Controllers_1.OAuthClientCtrl, controllerAs: 'ctrl' })
                .when('/Customers', { templateUrl: 'Customers.html', controller: Controllers_1.CustomersCtrl, controllerAs: 'ctrl' })
                .when('/Customer', { templateUrl: 'Customer.html', controller: Controllers_1.CustomerCtrl, controllerAs: 'ctrl' })
                .when('/Customer/:id', { templateUrl: 'Customer.html', controller: Controllers_1.CustomerCtrl, controllerAs: 'ctrl' })
                .when('/Customer/:id/:action', { templateUrl: 'Customer.html', controller: Controllers_1.CustomerCtrl, controllerAs: 'ctrl' })
                .when('/EntityRestrictions', { templateUrl: 'EntityRestrictions.html', controller: Controllers_1.EntityRestrictionsCtrl, controllerAs: 'ctrl' })
                .when('/EntityRestriction', { templateUrl: 'EntityRestriction.html', controller: Controllers_1.EntityRestrictionCtrl, controllerAs: 'ctrl' })
                .when('/EntityRestriction/:id', { templateUrl: 'EntityRestriction.html', controller: Controllers_1.EntityRestrictionCtrl, controllerAs: 'ctrl' })
                .when('/Resources', { templateUrl: 'Resources.html', controller: Controllers_1.ResourcesCtrl, controllerAs: 'ctrl' })
                .when('/Resource', { templateUrl: 'Resource.html', controller: Controllers_1.ResourceCtrl, controllerAs: 'ctrl' })
                .when('/Resource/:id', { templateUrl: 'Resource.html', controller: Controllers_1.ResourceCtrl, controllerAs: 'ctrl' })
                .when('/Workitems', { templateUrl: 'Workitems.html', controller: Controllers_1.WorkitemsCtrl, controllerAs: 'ctrl' })
                .when('/Workitems/:queue', { templateUrl: 'Workitems.html', controller: Controllers_1.WorkitemsCtrl, controllerAs: 'ctrl' })
                .when('/Workitem/:id', { templateUrl: 'Workitem.html', controller: Controllers_1.WorkitemCtrl, controllerAs: 'ctrl' })
                .when('/Workitem', { templateUrl: 'Workitem.html', controller: Controllers_1.WorkitemCtrl, controllerAs: 'ctrl' })
                .when('/WorkitemQueues', { templateUrl: 'WorkitemQueues.html', controller: Controllers_1.WorkitemQueuesCtrl, controllerAs: 'ctrl' })
                .when('/WorkitemQueue', { templateUrl: 'WorkitemQueue.html', controller: Controllers_1.WorkitemQueueCtrl, controllerAs: 'ctrl' })
                .when('/WorkitemQueue/:id', { templateUrl: 'WorkitemQueue.html', controller: Controllers_1.WorkitemQueueCtrl, controllerAs: 'ctrl' })
                .when('/WebsocketClients', { templateUrl: 'WebsocketClients.html', controller: Controllers_1.WebsocketClientsCtrl, controllerAs: 'ctrl' })
                // .when('/WebsocketClients/:id', { templateUrl: 'WebsocketClients.html', controller: WebsocketClientsCtrl, controllerAs: 'ctrl' })
                .when('/MailHists', { templateUrl: 'MailHists.html', controller: Controllers_1.MailHistsCtrl, controllerAs: 'ctrl' })
                .when('/MailHist/:id', { templateUrl: 'MailHist.html', controller: Controllers_1.MailHistCtrl, controllerAs: 'ctrl' })
                .otherwise({ redirectTo: '/main' });
        }
    ]);
    webApp.config([
        '$locationProvider',
        ($locationProvider) => {
            //$locationProvider.html5Mode(false);
            $locationProvider.hashPrefix('');
        }
    ]).value('localeConf', {
        basePath: 'languages',
        defaultLocale: 'en-US',
        sharedDictionary: 'common',
        fileExtension: '.json',
        persistSelection: true,
        cookieName: 'COOKIE_LOCALE_LANG',
        observableAttrs: new RegExp('^data-(?!ng-|i18n)'),
        delimiter: '::',
        validTokens: new RegExp('^[\\w\\.-]+\\.[\\w\\s\\.-]+\\w(:.*)?$')
    }).value('localeSupported', [
        'en-US',
        'da-DK'
    ]);
})(openflow || (openflow = {}));
//# sourceMappingURL=app.js.map