var uniflash;
(function (uniflash) {
    'use strict';
    angular.module('uniflash', ['ui.router', 'ui.bootstrap', 'ti_common', 'xml', 'ngFileUpload', 'cgBusy', 'angularResizable']);
    // Setting HTML5 Location Mode
    angular.module('uniflash').config(['$locationProvider',
        function ($locationProvider) {
            $locationProvider.hashPrefix('!');
        }
    ]);
    /** Stop angular parsing responses**/
    angular.module('uniflash').config(['$httpProvider',
        function ($httpProvider) {
            $httpProvider.defaults.transformResponse = angular.identity;
        }
    ]);
    angular.module('uniflash').config(['$logProvider',
        function ($logProvider) {
            $logProvider.debugEnabled(true);
        }
    ]);
    angular.module('uniflash').config(['x2jsProvider',
        function (x2jsProvider) {
            x2jsProvider.config = {
                escapeMode: false,
                useDoubleQuotes: true
            };
        }
    ]);
    //Then define the init function for starting up the application
    angular.element(document).ready(function () {
        //Then init the app
        angular.bootstrap(document, ['uniflash']);
    });
    angular.module('uniflash').config(configFileStorage);
    configFileStorage.$inject = ['ticPlatformConfigProvider'];
    function configFileStorage(ticPlatformConfig) {
        if (ticPlatformConfig.setWorkSpaceServer) {
            ticPlatformConfig.setWorkSpaceServer('/workspaceserver/uniflash/default');
        }
    }
    //register views
    (function (RegisteredViews) {
        RegisteredViews[RegisteredViews["Program"] = 0] = "Program";
        RegisteredViews[RegisteredViews["UtilitiesAndSettings"] = 1] = "UtilitiesAndSettings";
        RegisteredViews[RegisteredViews["Memory"] = 2] = "Memory";
        RegisteredViews[RegisteredViews["Downloads"] = 3] = "Downloads";
    })(uniflash.RegisteredViews || (uniflash.RegisteredViews = {}));
    var RegisteredViews = uniflash.RegisteredViews;
    angular.module('uniflash').config(viewsConfig);
    viewsConfig.$inject = ['ufMainViewProvider'];
    function viewsConfig(ufMainViewProvider) {
        var stateProvider = ufMainViewProvider.mainViewStateProvider;
        stateProvider.addViewState({
            name: 'Program',
            templateUrl: 'programs/programs.html',
            isCoreSensitive: true,
            title: 'Select and Load Images',
            viewType: RegisteredViews.Program
        });
        stateProvider.addViewState({
            name: 'Settings & Utilities',
            templateUrl: 'flash_properties/settings_main.html',
            isCoreSensitive: true,
            title: 'Find and Configure Settings and Utilities',
            viewType: RegisteredViews.UtilitiesAndSettings
        });
        stateProvider.addViewState({
            name: 'Memory',
            templateUrl: 'memory/memory_browser.html',
            isCoreSensitive: true,
            title: 'Memory Browser',
            viewType: RegisteredViews.Memory
        });
        stateProvider.addViewState({
            name: 'Standalone Command Line',
            templateUrl: 'standalone_dl/standalone_dl.html',
            isCoreSensitive: false,
            title: 'Generate Standalone Command Line Package',
            viewType: RegisteredViews.Downloads
        });
    }
})(uniflash || (uniflash = {}));
