(self["webpackChunkLearningchain"] = self["webpackChunkLearningchain"] || []).push([["src_app_home_home_module_ts"],{

/***/ 5089:
/*!*********************************************!*\
  !*** ./src/app/home/home-routing.module.ts ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HomePageRoutingModule": () => (/* binding */ HomePageRoutingModule)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ 1855);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2741);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ 9535);
/* harmony import */ var _home_page__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./home.page */ 9460);




const routes = [
    {
        path: '',
        component: _home_page__WEBPACK_IMPORTED_MODULE_0__.HomePage,
    }
];
let HomePageRoutingModule = class HomePageRoutingModule {
};
HomePageRoutingModule = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
    (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule)({
        imports: [_angular_router__WEBPACK_IMPORTED_MODULE_3__.RouterModule.forChild(routes)],
        exports: [_angular_router__WEBPACK_IMPORTED_MODULE_3__.RouterModule]
    })
], HomePageRoutingModule);



/***/ }),

/***/ 2711:
/*!*************************************!*\
  !*** ./src/app/home/home.module.ts ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HomePageModule": () => (/* binding */ HomePageModule)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ 1855);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2741);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 6274);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ionic/angular */ 6820);
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ 3324);
/* harmony import */ var _home_page__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./home.page */ 9460);
/* harmony import */ var _home_routing_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./home-routing.module */ 5089);







let HomePageModule = class HomePageModule {
};
HomePageModule = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
    (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.NgModule)({
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_4__.CommonModule,
            _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormsModule,
            _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.IonicModule,
            _home_routing_module__WEBPACK_IMPORTED_MODULE_1__.HomePageRoutingModule
        ],
        declarations: [_home_page__WEBPACK_IMPORTED_MODULE_0__.HomePage]
    })
], HomePageModule);



/***/ }),

/***/ 9460:
/*!***********************************!*\
  !*** ./src/app/home/home.page.ts ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HomePage": () => (/* binding */ HomePage)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! tslib */ 1855);
/* harmony import */ var _raw_loader_home_page_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !raw-loader!./home.page.html */ 9764);
/* harmony import */ var _home_page_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./home.page.scss */ 2610);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 2741);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ionic/angular */ 6820);
/* harmony import */ var _services_api_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services/api.service */ 3734);
/* harmony import */ var _services_common_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/common.service */ 6880);
/* harmony import */ var _services_db_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../services/db.service */ 5185);
/* harmony import */ var src_environments_environment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/environments/environment */ 4766);









let HomePage = class HomePage {
    constructor(navCtrl, apiService, commonService, dbService) {
        this.navCtrl = navCtrl;
        this.apiService = apiService;
        this.commonService = commonService;
        this.dbService = dbService;
        this.username = '';
        this.password = '';
        this.row_data = [];
        this.passwordType = 'password';
        this.passwordIcon = 'eye-off';
    }
    login() {
        this.generatetoken();
    }
    signup() {
        this.navCtrl.navigateForward(['/signup']);
    }
    getRecord() {
        this.dbService.getRows();
        this.dbService.databaseObj.executeSql("SELECT * FROM learningchaintb WHERE UserName = ? and Password =  ? ", [this.username, this.password])
            .then((res) => {
            this.row_data = [];
            if (res.rows.length > 0) {
                for (var i = 0; i < res.rows.length; i++) {
                    this.row_data.push(res.rows.item(i));
                }
                this.navCtrl.navigateRoot(['/menu']);
                localStorage.setItem("loginData", JSON.stringify(this.row_data[0]));
                localStorage.setItem("UserName", this.row_data[0].UserName);
            }
            else {
                let header = "Login";
                let sheader = "Invalid Data";
                let mesg = "Username/Password are wrong";
                this.commonService.showAlert(header, sheader, mesg);
            }
        })
            .catch(e => {
            this.commonService.showErrorShowToast("Something went wrong");
        });
    }
    generatetoken() {
        let data = {
            clientID: src_environments_environment__WEBPACK_IMPORTED_MODULE_5__.environment.clientID,
            secretKey: src_environments_environment__WEBPACK_IMPORTED_MODULE_5__.environment.secretKey
        };
        this.apiService.postAuthData('users/authenticate', data).subscribe((response) => {
            setTimeout(() => {
            }, 1000);
            this.token = response.token;
            localStorage.setItem("Token", "Bearer " + this.token);
            console.log(this.token);
            this.getRecord();
            // this.signup(); 
            //this.createwallet();   
        }, err => {
            this.commonService.showToast(err.message);
            // alert("message in err "+ JSON.stringify(err))
            setTimeout(() => {
                this.commonService.dismissLoader();
            }, 1000);
        });
    }
    hideShowPassword() {
        this.passwordType = this.passwordType === 'text' ? 'password' : 'text';
        this.passwordIcon = this.passwordIcon === 'eye-off' ? 'eye' : 'eye-off';
    }
};
HomePage.ctorParameters = () => [
    { type: _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.NavController },
    { type: _services_api_service__WEBPACK_IMPORTED_MODULE_2__.ApiService },
    { type: _services_common_service__WEBPACK_IMPORTED_MODULE_3__.CommonService },
    { type: _services_db_service__WEBPACK_IMPORTED_MODULE_4__.DbService }
];
HomePage = (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
    (0,_angular_core__WEBPACK_IMPORTED_MODULE_8__.Component)({
        selector: 'app-home',
        template: _raw_loader_home_page_html__WEBPACK_IMPORTED_MODULE_0__.default,
        styles: [_home_page_scss__WEBPACK_IMPORTED_MODULE_1__.default]
    })
], HomePage);



/***/ }),

/***/ 2610:
/*!*************************************!*\
  !*** ./src/app/home/home.page.scss ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (".section {\n  height: 100%;\n}\n\n.section1 {\n  height: 28%;\n  background-color: #D3EBF2;\n  border-bottom-left-radius: 2px;\n  border-bottom-right-radius: 2px;\n  text-align: center;\n  padding-top: 23%;\n}\n\n.section2 {\n  background-color: #D3EBF2;\n  border-bottom-left-radius: 100%;\n  border-bottom-right-radius: 100%;\n  height: 13%;\n  margin-top: -9%;\n}\n\n.lbl {\n  margin-left: 6px;\n}\n\n.headlogin {\n  text-align: center;\n  margin-top: 24px;\n  color: white;\n}\n\nion-item {\n  --min-height: 42px;\n  --padding-start: 6px;\n  --inner-padding-end: 6px;\n  border: 1px gray solid;\n  border-radius: 50px;\n  margin-left: 15px;\n  margin-right: 15px;\n  margin-bottom: 20px;\n}\n\n.signupbtn {\n  height: 40px;\n  background: #D3EBF2;\n  text-transform: capitalize;\n  border-radius: 60px;\n  margin-top: 40px;\n  color: white;\n  font-family: inherit;\n  font-weight: 540;\n  letter-spacing: 1px;\n  text-align: center;\n}\n\n.passwordIcon {\n  position: relative !important;\n  margin-top: auto;\n  margin-bottom: auto;\n  vertical-align: middle;\n  align-items: center;\n  justify-content: center;\n}\n\n.showpwd {\n  font-size: 20px;\n  color: black;\n}\n\n.showpwdbtn {\n  background: transparent !important;\n}\n\nion-content {\n  --background: #51A7DD;\n}\n/*# sourceMappingURL=data:application/json;base64,  */");

/***/ }),

/***/ 9764:
/*!***************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/home/home.page.html ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("<ion-content [fullscreen]=\"true\">\n\n              <div class=\"section\">\n\n                        <div class=\"section1\">\n                            <img src=\"../assets/images/logo.png\" height=\"82\"/>\n                        </div>\n\n                        <div class=\"section2\">\n                          \n                        </div>\n\n                        <div class=\"section3\">\n\n                                  <h3 class=\"headlogin\"> Login </h3>\n\n                                  <ion-item lines=\"none\">\n                                          <ion-input type=\"tel\" required class=\"inputbox1\" name=\"username\" [(ngModel)]=\"username\" placeholder=\"Mobile Number\"><img src=\"../assets/images/user.png\" class=\"inptimg1\"/></ion-input>\n                                  </ion-item>\n                                  <p class=\"valid_message\" *ngIf=\"(username.length > 0 && (username.length != 10 ))\">\n                                        Mobile number must contain only numbers and it must be 10 digits long\n                                  </p>   \n                                  <ion-item lines=\"none\">\n                                                 <ion-input [type]=\"passwordType\" required class=\"inputbox1\" name=\"password\" [(ngModel)]=\"password\" placeholder=\"Password\"><img src=\"../assets/images/padlock.png\" class=\"inptimg1\"/>\n                                                        <!-- <ion-icon item-end name=\"eye\" class=\"passwordIcon\"></ion-icon> -->\n                                                </ion-input>\n                                                <button ion-button clear type=\"button\" class=\"showpwdbtn\"  item-right (click)='hideShowPassword()'> <ion-icon [name]=\"passwordIcon\"  class=\"showpwd\"> </ion-icon> </button> \n                                  </ion-item>\n\n                                  <ion-button type=\"submit\" class=\"btn\" (click)=\"login()\">Log in</ion-button> <br/>\n                                  <button type=\"submit\" (click)=\"signup()\" class=\"btn signupbtn\">Sign Up</button>\n\n                        </div>\n\n              </div>\n\n</ion-content>");

/***/ })

}]);
//# sourceMappingURL=src_app_home_home_module_ts.js.map