webpackJsonp([12],{

/***/ 1476:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StoreMainPageModule", function() { return StoreMainPageModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__store_main_page__ = __webpack_require__(1574);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__component_common_module__ = __webpack_require__(989);
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 StoreMainPageModule = /** @class */ (function () {
    function StoreMainPageModule() {
    }
    StoreMainPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [__WEBPACK_IMPORTED_MODULE_2__store_main_page__["a" /* StoreMainPage */]],
            imports: [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__store_main_page__["a" /* StoreMainPage */]), __WEBPACK_IMPORTED_MODULE_4__component_common_module__["a" /* StoreComponentsModule */], __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */]],
            exports: [__WEBPACK_IMPORTED_MODULE_2__store_main_page__["a" /* StoreMainPage */]]
        })
    ], StoreMainPageModule);
    return StoreMainPageModule;
}());

//# sourceMappingURL=store-main-page.module.js.map

/***/ }),

/***/ 1574:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StoreMainPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__store_main_page_template__ = __webpack_require__(1575);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_ministore_data_provider__ = __webpack_require__(70);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__providers_store_data_service__ = __webpack_require__(990);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_ngx_logger__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ncinga_sp_nsp_app_core_dist_providers_app_events__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ministore_utils__ = __webpack_require__(39);
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 StoreMainPage = /** @class */ (function () {
    function StoreMainPage(navParams, navManager, events, dataProvider, toastCtrl, logger, dataService, appContext, appState) {
        this.navParams = navParams;
        this.navManager = navManager;
        this.events = events;
        this.dataProvider = dataProvider;
        this.toastCtrl = toastCtrl;
        this.logger = logger;
        this.dataService = dataService;
        this.appContext = appContext;
        this.appState = appState;
        this.viewConf = {};
        this.view_conf = {};
        this.tab_next_view_refs = [];
        this.title = 'Store';
        this.args = {};
        this.tabParams = {};
        this.tabRefs = {};
        this.test = {};
        var conf = this.navParams.data.conf;
        this.configurePage(conf);
        if (this.subject) {
            this.appContext.setCurrentStation(this.subject);
        }
        this.setNextViewConfs();
    }
    StoreMainPage.prototype.setNextViewConfs = function () {
        var _this = this;
        this.tab_next_view_refs.forEach(function (viewRef) {
            var view_conf = __WEBPACK_IMPORTED_MODULE_9__ministore_utils__["a" /* MUtils */].getDeepCopy(_this.navManager.selectViewConf(_this.tabRefs[viewRef]));
            view_conf['sku_type'] = _this.sku_type;
            view_conf['subject'] = _this.tabParams[viewRef];
            var conf = {
                conf: view_conf,
                data: {
                    app_type: _this.app_type
                },
            };
            _this.view_conf[viewRef] = conf;
        });
    };
    StoreMainPage.prototype.configurePage = function (value) {
        if (value) {
            this.app_type = value.app_type;
            this.sku_type = value.sku_type;
            this.subject = value.subject;
            this.dataService.setSkuType(this.sku_type);
            this.view_descriptor = value;
            this.dataService.setPartially(value.partially);
            this.title = this.view_descriptor.title;
            var component_descriptors = this.view_descriptor.components_descriptor;
            var tabs_conf = __WEBPACK_IMPORTED_MODULE_9__ministore_utils__["a" /* MUtils */].getComponentConfig('navigation_tab', component_descriptors);
            this.default_tab_config = tabs_conf['default_tab'];
            this.second_tab_config = tabs_conf['second_tab'];
            this.tab_next_view_refs = [];
            this.tab_next_view_refs.push(this.default_tab_config.id);
            this.tab_next_view_refs.push(this.second_tab_config.id);
            this.tab1Root = this.default_tab_config.view_type;
            this.tab2Root = this.second_tab_config.view_type;
            this.tab1Subject = this.default_tab_config.subject;
            this.tab2Subject = this.second_tab_config.subject;
            this.tab1Ref = this.default_tab_config.next_view_ref;
            this.tab2Ref = this.second_tab_config.next_view_ref;
            this.third_tab_config = tabs_conf['third_tab'];
            this.fourth_tab_config = tabs_conf['fourth_tab'];
            this.tabParams[this.default_tab_config.id] = this.tab1Subject;
            this.tabParams[this.second_tab_config.id] = this.tab2Subject;
            this.tabRefs[this.default_tab_config.id] = this.tab1Ref;
            this.tabRefs[this.second_tab_config.id] = this.tab2Ref;
            if (this.third_tab_config) {
                this.tab_next_view_refs.push(this.third_tab_config.id);
                this.tab3Root = this.third_tab_config.view_type;
                this.tab3Subject = this.third_tab_config.subject;
                this.tabParams[this.third_tab_config.id] = this.tab3Subject;
                this.tab3Ref = this.third_tab_config.next_view_ref;
                this.tabRefs[this.third_tab_config.id] = this.tab3Ref;
            }
            if (this.fourth_tab_config) {
                this.tab_next_view_refs.push(this.fourth_tab_config.id);
                this.tab4Root = this.fourth_tab_config.view_type;
                this.tab4Subject = this.fourth_tab_config.subject;
                this.tabParams[this.fourth_tab_config.id] = this.tab4Subject;
                this.tab4Ref = this.fourth_tab_config.next_view_ref;
                this.tabRefs[this.fourth_tab_config.id] = this.tab4Ref;
            }
        }
    };
    StoreMainPage.prototype.ionViewDidLoad = function () {
        if (this.tabRef) {
            this.tabRef.select(0);
        }
        if (this.subject) {
            this.appContext.setCurrentStation(this.subject);
        }
        this.initEventListeners();
        var stationId = this.appContext.getCurrentSubject().id;
        var args = {
            station_id: stationId,
            range: {
                startTime: {
                    ts: 0,
                    offset: new Date().getTimezoneOffset()
                },
                endTime: {
                    ts: Date.now(),
                    offset: new Date().getTimezoneOffset()
                }
            }
        };
        this.dataService.startUp(stationId, this.app_type, args);
        /// this.tabRef.initTabs();
    };
    StoreMainPage.prototype.ionViewWillEnter = function () {
    };
    StoreMainPage.prototype.initEventListeners = function () {
        var _this = this;
        this.appState.subscribe(__WEBPACK_IMPORTED_MODULE_8__ncinga_sp_nsp_app_core_dist_providers_app_events__["b" /* APPEvents */].APP_SUBJECT_CHANGE, function (res) {
            var args = {
                station_id: res,
                range: {
                    startTime: {
                        ts: 0,
                        offset: new Date().getTimezoneOffset()
                    },
                    endTime: {
                        ts: Date.now(),
                        offset: new Date().getTimezoneOffset()
                    }
                }
            };
            _this.logger.debug(res);
            _this.dataService.startUp(res, _this.app_type, args);
        });
    };
    StoreMainPage.prototype.openPage = function (pageName, conf) {
        if (this.tabRef) {
            this.tabRef.viewCtrl._nav.setRoot(pageName, conf);
        }
    };
    StoreMainPage.prototype.ionViewDidEnter = function () {
        this.displayTabs = true;
    };
    StoreMainPage.prototype.ionViewDidLeave = function () {
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])('navTab'),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["v" /* Tabs */])
    ], StoreMainPage.prototype, "tabRef", void 0);
    StoreMainPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'store-main-page',
            template: __WEBPACK_IMPORTED_MODULE_2__store_main_page_template__["a" /* STORES_MAIN_PAGE_TEMPLATE */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */], __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__["a" /* NavigationManager */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* Events */],
            __WEBPACK_IMPORTED_MODULE_4__providers_ministore_data_provider__["a" /* MiniStoreDataProvider */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["x" /* ToastController */],
            __WEBPACK_IMPORTED_MODULE_6_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_5__providers_store_data_service__["a" /* StoreDataService */],
            __WEBPACK_IMPORTED_MODULE_7__ncinga_sp_nsp_app_core_dist__["d" /* ApplicationContext */], __WEBPACK_IMPORTED_MODULE_7__ncinga_sp_nsp_app_core_dist__["e" /* ApplicationService */]])
    ], StoreMainPage);
    return StoreMainPage;
}());

//# sourceMappingURL=store-main-page.js.map

/***/ }),

/***/ 1575:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return STORES_MAIN_PAGE_TEMPLATE; });
var STORES_MAIN_PAGE_TEMPLATE = "\n<ion-header>\n<common-main-header [title]=\"title\"></common-main-header>\n\n</ion-header>\n<ion-content>\n<ion-tabs class=\"tabs-navigator\" #navTab *ngIf=\"displayTabs && default_tab_config && second_tab_config\">\n      <ion-tab class=\"nav-tab\" *ngIf=\"default_tab_config\" [root]=\"tab1Root\" [tabTitle]=\"default_tab_config.title\"\n      [rootParams]=\"view_conf[default_tab_config.id]\" tabIcon=\"paper\"></ion-tab>\n      <ion-tab class=\"nav-tab\" *ngIf=\"second_tab_config\" [root]=\"tab2Root\" [tabTitle]=\"second_tab_config.title\"\n        [rootParams]=\"view_conf[second_tab_config.id]\" tabIcon=\"folder-open\"></ion-tab>\n        <ion-tab class=\"nav-tab\" *ngIf=\"third_tab_config\" [root]=\"tab3Root\" [tabTitle]=\"third_tab_config.title\"\n        [rootParams]=\"view_conf[third_tab_config.id]\" tabIcon=\"folder-open\"></ion-tab>\n                <ion-tab class=\"nav-tab\" *ngIf=\"fourth_tab_config\" [rootParams]=\"view_conf[fourth_tab_config.id]\"\n                 [root]=\"tab4Root\" [tabTitle]=\"fourth_tab_config.title\"\n                 tabIcon=\"folder-open\"></ion-tab>\n    </ion-tabs>\n</ion-content>\n<!--<ion-footer class=\"store-menubar-header\">\n<ion-navbar>\n<common-header-comp header_title=\"samples\"></common-header-comp>\n</ion-navbar>\n</ion-footer>-->\n";
//# sourceMappingURL=store-main-page-template.js.map

/***/ })

});
//# sourceMappingURL=12.js.map