webpackJsonp([25],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassOnePageModule", function() { return ClassOnePageModule; });
/* 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__class_one__ = __webpack_require__(1776);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngx_translate_core__ = __webpack_require__(136);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_components_module__ = __webpack_require__(958);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(7);
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 ClassOnePageModule = /** @class */ (function () {
    function ClassOnePageModule() {
    }
    ClassOnePageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__class_one__["a" /* ClassOnePage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_4__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__class_one__["a" /* ClassOnePage */]),
                __WEBPACK_IMPORTED_MODULE_3__ngx_translate_core__["b" /* TranslateModule */].forChild(),
            ],
            exports: [],
            entryComponents: []
        })
    ], ClassOnePageModule);
    return ClassOnePageModule;
}());

//# sourceMappingURL=class-one.module.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ClassOnePage; });
/* 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_ngx_logger__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__class_one_template__ = __webpack_require__(1777);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_util__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_util___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_util__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__class_one_selected__ = __webpack_require__(985);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__models_btnModel__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__providers_shared_data_service_shared_data_service__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__providers_activity_log_activity_log__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__providers_masterdata_service_masterdata_service__ = __webpack_require__(199);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__providers_dateFormate_dateFormates__ = __webpack_require__(200);
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 ClassOnePage = /** @class */ (function () {
    function ClassOnePage(logger, navParams, navigationProvider, bsCtx, toastCtrl, appMsDtPrv, modalCtrl, sharedDataService, activityLog, _crntDate) {
        this.logger = logger;
        this.navParams = navParams;
        this.navigationProvider = navigationProvider;
        this.bsCtx = bsCtx;
        this.toastCtrl = toastCtrl;
        this.appMsDtPrv = appMsDtPrv;
        this.modalCtrl = modalCtrl;
        this.sharedDataService = sharedDataService;
        this.activityLog = activityLog;
        this._crntDate = _crntDate;
        this.classOne_all_list = [];
        this.classOne_selected_list = [];
        this.sub_header = true;
        // available list
        this.available_items = [];
        this.pagesize = 4;
        this.lastIndex = 0;
        this.viewType = 'qc';
        this.sidebar = false;
        this.tools = {
            line: true,
            menu: true,
            shift: true,
            user: true,
        };
        this.currentPageConfig = this.navParams.get('conf');
        this.appMsDtPrv.setMsDtList(this.currentPageConfig.masterDataList);
        this.sub_header = this.currentPageConfig['order_heading'];
        if (this.currentPageConfig['view']) {
            this.viewType = this.currentPageConfig['view'];
        }
        if (!this.sub_header) {
            this.grid_class = 'main-grid_none_header';
        }
        if (this.currentPageConfig['sidebar_view']) {
            this.sidebarView = this.currentPageConfig['sidebar_view'];
        }
        if (this.currentPageConfig['sidebar']) {
            this.sidebar = this.currentPageConfig['sidebar'];
        }
        this.data_set = this.navParams.get('data');
        this.previous_data = this.data_set['data'];
        this.logger.debug(this.data_set['data']);
        this.viewModel = new __WEBPACK_IMPORTED_MODULE_7__models_btnModel__["a" /* ClassificationModel */](this.data_set['model']);
        this.logger.debug(this.viewModel);
        // if (this.viewModel['parent_input_categories'].length === 0) {
        //     let modal = this.modalCtrl.create(InstructionPopUp, {imgName: this.currentPageConfig.img_name});
        //     modal.present();
        // }
        this.logger.debug('listenForStateChanges data store in page one', this.data_set);
    }
    ClassOnePage.prototype.ngAfterViewInit = function () {
        this.logger.debug('class -one called  2', this.viewModel);
        // generate page body data
        this.prepareData();
    };
    ClassOnePage.prototype.prepareData = function () {
        var _this = this;
        try {
            this.currentPageData = [];
            this.classOne_all_list = [];
            // this.cacheSvc.get(CC_MOD_KEY, Crnt_M_D, url).then(respn => {
            var respn = this.appMsDtPrv.getCrntMsDtList(this.currentPageConfig['view_data'], this.viewModel.list_key);
            if (JSON.stringify(respn) !== '{}') {
                var resdata = respn['data'];
                var listName = respn['listname'];
                this.currentPageData = resdata;
                if (this.viewModel['parent_input_categories'].length === 0) {
                    this.currentPageData.forEach(function (item, index) {
                        _this.classOne_all_list.push({
                            'id': index,
                            'classOne_item': item,
                            'status': false
                        });
                    });
                    this.viewModel.setParentMasterCategories(this.classOne_all_list);
                    this.viewModel.setParentInputCategories(this.classOne_all_list);
                    this.viewModel.setListKey(listName);
                }
                else if (this.viewModel['parent_input_categories'].length > 0) {
                    this.classOne_all_list = [];
                    this.viewModel['parent_input_categories'].forEach(function (item, index) {
                        _this.classOne_all_list.push({
                            'id': index,
                            'classOne_item': item.classOne_item,
                            'status': false
                        });
                    });
                    this.viewModel.setListKey(listName);
                }
                this.lastIndex = this.currentPageData.length;
                this.doInfinite(this.infiniteScroll);
                // response = resdata;
            }
            else {
                this.classOne_all_list.push({
                    'id': '098',
                    'classOne_item': { name: 'this is sample department ' + this.currentPageConfig.title },
                    'status': false
                });
                this.logger.error('<<<< grading list not loading >>>>>');
            }
            // response;
            // });
        }
        catch (e) {
            this.logger.error(e);
        }
        this.currentPageConfig = this.navParams.get('conf');
        // load page header and footer
        this.currentPageheader = this.currentPageConfig['title'];
        this.currentPagebuttons = this.currentPageConfig['view_controles'];
        // check whether next page available
        if (this.currentPageConfig['next_view_ref'] !== 'EXIT') {
            this.nextPage = this.currentPageConfig['next_view_ref'];
        }
        else {
            this.nextPage = 'page_order_end';
        }
    };
    ClassOnePage.prototype.doInfinite = function (infiniteScroll) {
        var _this = this;
        var limit = this.lastIndex + this.pagesize;
        setTimeout(function () {
            for (var i = _this.lastIndex + 1; i <= limit; i++) {
                if (_this.viewModel['parent_input_categories'].length <= i) {
                    break;
                }
                _this.viewModel['parent_input_categories'].push(_this.viewModel['parent_input_categories'][i]);
                _this.lastIndex = i;
            }
            infiniteScroll.complete();
        }, 3500);
    };
    ClassOnePage.prototype.addCurrentOperation = function () {
        var _this = this;
        var modelData = {
            'model': this.viewModel,
            'btnConf': this.data_set['btnConf'],
            pgConf: this.currentPageConfig
        };
        var modal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_6__class_one_selected__["a" /* ClassOneSelected */], modelData, { cssClass: 'class-one-selected' });
        modal.onDidDismiss(function (dataRes) {
            _this.prepareData();
        });
        modal.present();
    };
    ClassOnePage.prototype.navigationClick = function (type) {
        var _this = this;
        this.classOne_selected_list = [];
        this.classOne_all_list.forEach(function (item, index) {
            if (item.status === true) {
                var temp = {};
                temp['data'] = item.classOne_item;
                temp['size'] = _this.viewModel.recent_grade; // todo: remove size from here
                if (_this.data_set['btnConf']['special_scn'] || _this.data_set['btnConf']['only_one_page']) {
                    temp['event_ac'] = {
                        size: _this.viewModel.select_item,
                        issues: item.classOne_item
                    };
                    var bctx = _this.bsCtx.getCurrentContext();
                    temp['bsns_cntxt'] = bctx.ctx;
                    temp['date'] = _this._crntDate.dashFormate();
                }
                _this.classOne_selected_list.push(temp);
            }
        });
        this.viewModel.setParentSelectedCategories(this.classOne_selected_list);
        var finalSelectedList = [];
        var finalMap = {};
        var date = new Date();
        var count = this.viewModel.count + 1;
        var ctxId = this.generateCtxId();
        var sname = this.activityLog.getCurrentStyleSilhouetteID();
        if (Object(__WEBPACK_IMPORTED_MODULE_5_util__["isUndefined"])(this.previous_data)) {
            finalMap['id'] = count + '@' + ctxId + '@' + date.getTime();
            finalMap['round'] = 1;
            finalMap['ctx'] = this.bsCtx.getCurrentContext().ctx;
            finalMap['sname'] = sname;
        }
        else {
            finalMap['id'] = this.previous_data['display_item']['id'];
            finalMap['round'] = this.previous_data['display_item']['round'] + 1;
            finalMap['ctx'] = this.previous_data['display_item']['ctx'];
            finalMap['sname'] = this.previous_data['display_item']['sname'];
        }
        // if (isUndefined(this.previous_data)) {
        //     finalMap['round'] = this.previous_data['round'] + 1;
        // } else {
        //     finalMap['round'] = 1;
        // }
        finalMap['result'] = this.classOne_selected_list;
        finalSelectedList.push(finalMap);
        if (type === 'cancel') {
            this.navigationProvider.exitToRoot(null);
        }
        else if (type === 'ok') {
            if (this.isSelected()) {
                if (this.nextPage !== 'page_order_end') {
                    var data = {};
                    data['type'] = 'push';
                    data['next_page'] = this.nextPage;
                    data['result'] = finalSelectedList;
                    data['result_type'] = this.viewModel['data_type'];
                    this.logger.debug('page one next View...', this.viewModel);
                    this.logger.debug(this.viewModel, 'parent');
                    this.navigationProvider.nextView(this.nextPage, {
                        data: finalSelectedList,
                        model: this.viewModel,
                        btnConf: this.data_set['btnConf']
                    });
                }
                else {
                    this.endAndExit(finalSelectedList);
                }
            }
        }
    };
    /*
     generate ctx id
     */
    ClassOnePage.prototype.generateCtxId = function () {
        var bsnsCtx = this.bsCtx.getCurrentContext();
        var id = null;
        if (!Object(__WEBPACK_IMPORTED_MODULE_5_util__["isUndefined"])(bsnsCtx.ctx)) {
            bsnsCtx.ctx.forEach(function (dt) {
                if (id === null) {
                    id = dt.v;
                }
                else {
                    id = id + '-' + dt.v;
                }
            });
        }
        return id;
    };
    ClassOnePage.prototype.isSelected = function () {
        if (this.viewModel['parent_selected_categories'].length > 0) {
            return true;
        }
        else {
            var toast = this.toastCtrl.create({
                message: 'Please Select Item(s) to Proceed',
                duration: 3000,
                position: 'middle',
                showCloseButton: true,
                closeButtonText: 'OK'
            });
            toast.present();
        }
        return false;
    };
    ClassOnePage.prototype.endAndExit = function (result) {
        var data = {};
        data['type'] = 'remove_all';
        data['next_page'] = this.nextPage;
        data['result'] = result;
        data['result_type'] = this.viewModel.name;
        this.logger.debug('page one select...', this.viewModel);
        this.viewModel.recentCatList(result);
        if (!this.data_set['btnConf']['ref_type']) {
            this.viewModel.updateGrades(this.viewModel['recent_grade']);
            this.viewModel.increment();
        }
        this.viewModel.concatRecentCatList(this.viewModel['parent_selected_categories']);
        this.sharedDataService.updateSharedDataService(this.data_set['btnConf'], this.viewModel.value, new __WEBPACK_IMPORTED_MODULE_7__models_btnModel__["a" /* ClassificationModel */](this.viewModel));
        this.navigationProvider.exitToRoot(null); // end the view chain
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* InfiniteScroll */]),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* InfiniteScroll */])
    ], ClassOnePage.prototype, "infiniteScroll", void 0);
    ClassOnePage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-class-one',
            template: __WEBPACK_IMPORTED_MODULE_3__class_one_template__["a" /* CLASS_ONE_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_4__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__["a" /* NavigationManager */], __WEBPACK_IMPORTED_MODULE_9__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["w" /* ToastController */], __WEBPACK_IMPORTED_MODULE_11__providers_masterdata_service_masterdata_service__["a" /* AppMasterDataCntrl */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* ModalController */], __WEBPACK_IMPORTED_MODULE_8__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */],
            __WEBPACK_IMPORTED_MODULE_10__providers_activity_log_activity_log__["a" /* ActivityLogProvider */], __WEBPACK_IMPORTED_MODULE_12__providers_dateFormate_dateFormates__["a" /* DateFormatting */]])
    ], ClassOnePage);
    return ClassOnePage;
}());

//# sourceMappingURL=class-one.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CLASS_ONE_HTML; });
/**
 * Created by Paramee Gunethilake on 5/3/2018.
 */
var CLASS_ONE_HTML = "\n  <ion-header>\n    <common-main-header [title]=\"currentPageConfig.title\" [tools]=\"tools\"\n    [header_disabled]=\"currentPageConfig?.subject_disable\"></common-main-header>\n  </ion-header>\n\n  <ion-content class=\"main-container\">\n  <ion-grid class=\"summary-grid\" *ngIf=\"sub_header\">\n   <ion-row class=\"summary-row\">\n    <ion-col class=\"summary-col\">\n      <core-domain-header></core-domain-header>\n    </ion-col>\n  </ion-row>\n  </ion-grid>\n  <ion-grid [ngClass]=\"grid_class\" class=\"main-grid\">\n  <ion-row class=\"add-btn-row\" align-items-center>\n\n   <ion-col col-4 class=\"aql-oper-col\" *ngIf=\"sidebar\">\n    <ion-row class=\"header-top\" style=\"border-bottom: 0px solid #CCCCCC;\">Departments / Station</ion-row>\n  </ion-col>\n  <ion-col>\n   <div class=\"hdr r-align-flx\">{{currentPageConfig.title}}</div>\n  </ion-col>\n  <ion-col col-1>\n   <button class=\"add-button\" ion-button (click)=\"addCurrentOperation()\"><ion-icon name=\"add\"></ion-icon></button>\n  </ion-col>\n\n  </ion-row>\n  <ion-row class=\"category-row\">\n\n  <ion-col col-4 class=\"aql-oper-col\" style=\"height: 100%;\" *ngIf=\"sidebar\">\n   <ion-row class=\"lhs-list-col\">\n    <ion-list class=\"selection-list\">\n      <ion-item class=\"selection-item multi-select-itm\" text-wrap>\n        <ion-label  class=\"selection-header departent step1-selec\">Selected Department 1</ion-label>\n        <ion-label  class=\"selection-header departent step2-selec\">Selected Station</ion-label>\n        <ion-checkbox>\n        </ion-checkbox>\n      </ion-item>\n    </ion-list>\n  </ion-row>\n  </ion-col>\n  <ion-col col-6 class=\"select-col\" no-padding *ngFor=\"let Singledata of classOne_all_list\" >\n  <ion-item class=\"selection-item\" [ngClass]=\"{'item-slct':Singledata.status == true, 'item-not-slct':Singledata.status == false}\">\n    <ion-label  class=\"selection-header\">{{Singledata.classOne_item.name}}\n    </ion-label>\n    <ion-checkbox [(ngModel)]=\"Singledata.status\">\n    </ion-checkbox>\n  </ion-item>\n  </ion-col>\n\n  <ion-infinite-scroll (ionInfinite)=\"doInfinite($event)\">\n  <ion-infinite-scroll-content loadingSpinner=\"bubbles\" position=\"top\" loadingText=\"Loading more Operations...\">\n  </ion-infinite-scroll-content>\n  </ion-infinite-scroll>\n  </ion-row>\n  <ion-row no-padding class=\"data-empty-time\" *ngIf=\"classOne_all_list.length === 0\">\n  <ion-col>\n   <div class=empt-msg><ion-icon name=\"md-alert\" class=\"ion-icon\" item-left></ion-icon><span class=\"space-rem\"></span>\n    Please Click <ion-icon name=\"add\" class=\"pls-ioc\"></ion-icon> button to add {{currentPageConfig['list_name']}}\n  </div>\n  </ion-col>\n  </ion-row>\n  </ion-grid>\n  </ion-content>\n\n  <ion-footer no-padding>\n  <ion-navbar no-padding>\n\n    <ion-grid no-padding>\n      <ion-row justify-content-end no-padding>\n        <ion-col *ngFor=\"let button of currentPagebuttons \" col-5 col-lg-2 col-md-3 class=\"right-pdn\">\n          <button [ngClass]=\"button.button_type\" ion-button [hidden]=\"!button.display\"\n          (click)=\"navigationClick(button.button_type)\" class=\"page-button help-category-btn\">\n        {{button.button_name}}</button>\n      </ion-col>\n    </ion-row>\n  </ion-grid>\n\n  </ion-navbar>\n  </ion-footer>\n";
//# sourceMappingURL=class-one-template.js.map

/***/ })

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