'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Licensed Materials - Property of IBM * IBM Business Analytics (C) Copyright IBM Corp. 2020 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['jquery', '../../lib/@waca/dashboard-common/dist/core/APIFactory', '../deprecated/LegacyViewControllersAPI', '../../dashboard/layout/LayoutController', '../../dashboard/loader/WidgetLoader'], function ($, APIFactory, LegacyViewControllersAPI, LayoutController, WidgetLoader) { /** * @implements LegacyViewControllersAPI * @hideconstructor */ var LegacyViewControllers = function () { function LegacyViewControllers(_ref) { var environment = _ref.environment, layoutController = _ref.layoutController; _classCallCheck(this, LegacyViewControllers); this._widgetLoader = layoutController && layoutController.widgetLoader || this._createWidgetLoader(environment); this._layoutController = layoutController || this._createLayoutController(environment); } LegacyViewControllers.prototype.getAPI = function getAPI() { if (!this._api) { this._api = APIFactory.createAPI(this, [LegacyViewControllersAPI]); } return this._api; }; LegacyViewControllers.prototype.getLayoutController = function getLayoutController() { return this._layoutController; }; LegacyViewControllers.prototype.getWidgetLoader = function getWidgetLoader() { return this._widgetLoader; }; LegacyViewControllers.prototype._createWidgetLoader = function _createWidgetLoader(env) { return new WidgetLoader({ glassContext: env.glassContext, services: env.serviceRegistry, appSettings: {}, dashboardApi: env.dashboardApi, eventRouter: env.eventRouter, widgetRegistry: env.widgetRegistry, loadedWidgets: {}, boardModel: env.boardModel, contentFeatureLoader: env.internalCanvas, canvas: env.canvas }); }; LegacyViewControllers.prototype._createLayoutController = function _createLayoutController(env) { return new LayoutController({ glassContext: env.glassContext, services: env.serviceRegistry, appSettings: {}, contentFeatureLoader: env.internalCanvas, dashboardApi: env.dashboardApi, eventRouter: env.eventRouter, $el: $('body'), boardModel: env.boardModel, boardModuleFactory: env.boardModuleFactory, widgetLoader: this._widgetLoader, layoutExtensions: env.layoutExtensions, gatewayUrl: 'v1', cdnUrl: '', canvas: env.canvas }); }; LegacyViewControllers.prototype.destroy = function destroy() { this.getWidgetLoader().cleanup(); this.getLayoutController().destroy(); }; return LegacyViewControllers; }(); return LegacyViewControllers; }); //# sourceMappingURL=LegacyViewControllers.js.map