import { ConfigState, DynamicLayoutComponent, CoreModule } from '@abp/ng.core'; import { getSettingTabs, ThemeSharedModule } from '@abp/ng.theme.shared'; import { Component, NgModule } from '@angular/core'; import { Router, RouterModule } from '@angular/router'; import { Action, Selector, State, Store, NgxsModule } from '@ngxs/store'; import { __decorate, __metadata } from 'tslib'; /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var SetSelectedSettingTab = /** @class */ (function () { function SetSelectedSettingTab(payload) { this.payload = payload; } SetSelectedSettingTab.type = '[SettingManagement] Set Selected Tab'; return SetSelectedSettingTab; }()); if (false) { /** @type {?} */ SetSelectedSettingTab.type; /** @type {?} */ SetSelectedSettingTab.prototype.payload; } /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var SettingManagementState = /** @class */ (function () { function SettingManagementState() { } /** * @param {?} __0 * @return {?} */ SettingManagementState.getSelectedTab = /** * @param {?} __0 * @return {?} */ function (_a) { var selectedTab = _a.selectedTab; return selectedTab; }; /** * @param {?} __0 * @param {?} __1 * @return {?} */ SettingManagementState.prototype.settingManagementAction = /** * @param {?} __0 * @param {?} __1 * @return {?} */ function (_a, _b) { var patchState = _a.patchState; var payload = _b.payload; patchState({ selectedTab: payload, }); }; __decorate([ Action(SetSelectedSettingTab), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, SetSelectedSettingTab]), __metadata("design:returntype", void 0) ], SettingManagementState.prototype, "settingManagementAction", null); __decorate([ Selector(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], SettingManagementState, "getSelectedTab", null); SettingManagementState = __decorate([ State({ name: 'SettingManagementState', defaults: (/** @type {?} */ ({ selectedTab: {} })), }) ], SettingManagementState); return SettingManagementState; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var SettingManagementComponent = /** @class */ (function () { function SettingManagementComponent(router, store) { this.router = router; this.store = store; this.settings = []; this.trackByFn = (/** * @param {?} _ * @param {?} item * @return {?} */ function (_, item) { return item.name; }); } Object.defineProperty(SettingManagementComponent.prototype, "selected", { get: /** * @return {?} */ function () { /** @type {?} */ var value = this.store.selectSnapshot(SettingManagementState.getSelectedTab); if ((!value || !value.component) && this.settings.length) { return this.settings[0]; } return value; }, set: /** * @param {?} value * @return {?} */ function (value) { this.store.dispatch(new SetSelectedSettingTab(value)); }, enumerable: true, configurable: true }); /** * @return {?} */ SettingManagementComponent.prototype.ngOnInit = /** * @return {?} */ function () { var _this = this; this.settings = getSettingTabs() .filter((/** * @param {?} setting * @return {?} */ function (setting) { return _this.store.selectSnapshot(ConfigState.getGrantedPolicy(setting.requiredPolicy)); })) .sort((/** * @param {?} a * @param {?} b * @return {?} */ function (a, b) { return a.order - b.order; })); if (!this.selected && this.settings.length) { this.selected = this.settings[0]; } }; SettingManagementComponent.decorators = [ { type: Component, args: [{ selector: 'abp-setting-management', template: "