{"version":3,"sources":["webpack:///./source/application/profile/profile.module.js","webpack:///./source/application/profile/profile.component.js","webpack:///./source/layouts/APROF/layout.js"],"names":["angular","module","userHandler","component","profileComponent","name","bindings","templateUrl","transclude","controller","UserHandlerService","$rootScope","notificationService","loaderService","this","emailRegex","model","messages","document","on","attr","window","userInfo","originalUserInfo","copy","showError","message","id","$event","preventDefault","showAnotherPassword","password","password_again","modelName","length","profileForm","$setValidity","countOfCriteria","test","isValid","isTheSame","saveNameAndMail","show","params","email","userId","callback","location","origin","marketing","saveNameAndEmail","then","originalPassword","saveNewPassword","reload","catch","error","hide","data","newPassword","JSON","stringify","dataLayer","push","event","dependencies"],"mappings":"kKAAA,KACA,I,EAAA,SACA,G,EAAA,Q,2BAEA,I,EAEeA,QAAQC,OAFH,UAEuB,CAACC,YAAcC,UAAU,mBAAoBC,oBAAkBC,K,8HCN1G,I,EAAA,G,EAAA,O,iMAEA,IAEaD,EAAmB,CAC/BE,SAAU,GAEVC,YAAa,wBACbC,YAAY,EACZC,WAAU,WACT,WAAYC,EAAoBC,EAAYC,EAAqBC,I,4FAAe,SAE/EC,KAAKJ,mBAAqBA,EAC1BI,KAAKC,WAAa,yJAClBD,KAAKE,MAAQ,GACbF,KAAKG,SAAW,GAChBH,KAAKH,WAAaA,EAClBG,KAAKF,oBAAsBA,EAC3BE,KAAKD,cAAgBA,E,UATb,2F,EAAA,G,EAAA,kCAaR,aAAEK,UAAUC,GAAG,WAAW,YACzB,aAAE,aAAaC,KAAK,OAAQ,aAC5B,aAAE,mBAAmBA,KAAK,OAAQ,aAClC,aAAE,qBAAqBA,KAAK,OAAQ,eAEjCC,OAAOC,UACVR,KAAKS,iBAAmBvB,QAAQwB,KAAKH,OAAOC,UAC5CR,KAAKE,MAAQK,OAAOC,UAEpBR,KAAKF,oBAAoBa,UAAU,CAACC,QAAS,WAtBtC,sCA0BOC,IACf,aAAE,IAAMA,GAAIP,KAAK,OAAQ,UA3BjB,mCA8BIQ,GACZA,EAAOC,iB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UAAU,CAACC,QAAS8B,EAAME,KAAOF,EAAME,KAAKF,MAAQ,wBAzFtE,wCA6FS,WACbb,EAAS,CACZZ,SAAUjB,KAAKE,MAAMoC,iBACrBO,YAAa7C,KAAKE,MAAMe,SACxBc,OAAQ/B,KAAKE,MAAM6B,OACnBC,SAAUzB,OAAO0B,SAASC,OAAS,aAEpClC,KAAKJ,mBAAmB2C,gBAAgBV,GAAQQ,MAAK,WACpD9B,OAAO0B,SAASO,YACdC,OAAM,SAACC,GACT,EAAK3C,cAAc4C,KAAK,GACxB,EAAK7C,oBAAoBa,UAAU,CAACC,QAAS8B,EAAME,KAAOF,EAAME,KAAKF,MAAQ,wBAxGtE,4CA6GR,OAAOI,KAAKC,UAAU/C,KAAKE,SAAW4C,KAAKC,UAAU/C,KAAKS,oBA7GlD,4CAiHRF,OAAOyC,UAAUC,KAAK,CACrBC,MAAO,6B,2BAlHA,M,oKCTX,OACA,I,EAAA,G,EAAA,O,2BACA,MACA,MACA,OACA,I,EAEehE,UAAQC,OAFH,YAEuBoB,OAAO4C,cAAc5D,K","file":"layouts/APROF/layout.bundle.js","sourcesContent":["import 'angular';\nimport { profileComponent } from './profile.component';\nimport userHandler from './../../frame/header/user-handler.module';\n\nconst MODULE_NAME = 'profile';\n\nexport default angular.module(MODULE_NAME, [userHandler]).component('profileComponent', profileComponent).name;\n\n\n","import $ from 'jquery';\n\nconst VALIDATE_CRITERIA_COUNT = 3;\n\nexport const profileComponent = {\n\tbindings: {\n\t},\n\ttemplateUrl: 'profile-template.html',\n\ttransclude: true,\n\tcontroller: class ProfileComponent {\n\t\tconstructor(UserHandlerService, $rootScope, notificationService, loaderService) {\n\t\t\t'ngInject';\n\t\t\tthis.UserHandlerService = UserHandlerService;\n\t\t\tthis.emailRegex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\t\tthis.model = {};\n\t\t\tthis.messages = {};\n\t\t\tthis.$rootScope = $rootScope;\n\t\t\tthis.notificationService = notificationService;\n\t\t\tthis.loaderService = loaderService;\n\t\t}\n\n\t\t$onInit() {\n\t\t\t$(document).on('mouseup', ()=>{\n\t\t\t\t$('#password').attr('type', 'password');\n\t\t\t\t$('#password_again').attr('type', 'password');\n\t\t\t\t$('#originalPassword').attr('type', 'password');\n\t\t\t});\n\t\t\tif (window.userInfo) {\n\t\t\t\tthis.originalUserInfo = angular.copy(window.userInfo);\n\t\t\t\tthis.model = window.userInfo;\n\t\t\t} else {\n\t\t\t\tthis.notificationService.showError({message: 'hack'});\n\t\t\t}\n\t\t}\n\n\t\tsetFieldVisible(id) {\n\t\t\t$('#' + id).attr('type', 'text');\n\t\t}\n\n\t\tshowPassword($event) {\n\t\t\t$event.preventDefault();\n\t\t\tthis.showAnotherPassword = !this.showAnotherPassword;\n\t\t\tif (!this.showAnotherPassword) {\n\t\t\t\tthis.model.password = '';\n\t\t\t\tthis.model.password_again = '';\n\t\t\t}\n\t\t}\n\n\t\tvalidatePw(modelName) {\n\t\t\tif (this.model[modelName]) {\n\t\t\t\tif (this.model[modelName].length >= 15) {\n\t\t\t\t\tthis.profileForm[modelName].$setValidity('criteria', true);\n\t\t\t\t} else {\n\t\t\t\t\tlet countOfCriteria = 0;\n\t\t\t\t\tif (/[\\! \"#\\$%&'\\(\\)\\*\\+,-\\.\\/:;<=>\\?@\\[\\]\\^_`{\\|}~]/.test(this.model[modelName])) {\n\t\t\t\t\t\tcountOfCriteria++;\n\t\t\t\t\t}\n\t\t\t\t\tif (/[a-z]/.test(this.model[modelName])) {\n\t\t\t\t\t\tcountOfCriteria++;\n\t\t\t\t\t}\n\t\t\t\t\tif (/[A-Z]/.test(this.model[modelName])) {\n\t\t\t\t\t\tcountOfCriteria++;\n\t\t\t\t\t}\n\t\t\t\t\tif (/[0-9]/.test(this.model[modelName])) {\n\t\t\t\t\t\tcountOfCriteria++;\n\t\t\t\t\t}\n\t\t\t\t\tlet isValid = countOfCriteria >= VALIDATE_CRITERIA_COUNT;\n\t\t\t\t\tthis.profileForm[modelName].$setValidity('criteria', isValid);\n\t\t\t\t}\n\t\t\t\tif (modelName == 'password_again') {\n\t\t\t\t\tlet isTheSame = this.model[modelName] == this.model.password || !this.showAnotherPassword;\n\t\t\t\t\tthis.profileForm[modelName].$setValidity('isTheSame', isTheSame);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsaveChanges() {\n\t\t\tthis.saveNameAndMail();\n\t\t}\n\n\t\tsaveNameAndMail() {\n\t\t\tthis.loaderService.show();\n\t\t\tthis.messages = {};\n\t\t\tlet params = {\n\t\t\t\tname: this.model.name,\n\t\t\t\temail: this.model.email,\n\t\t\t\tuserId: this.model.userId,\n\t\t\t\tcallback: window.location.origin + '/callback',\n\t\t\t\tmarketing: this.model.marketing\n\t\t\t};\n\t\t\tthis.UserHandlerService.saveNameAndEmail(params).then(() => {\n\t\t\t\tif (this.model.originalPassword && this.model.password && this.model.password_again && this.model.password_again == this.model.password) {\n\t\t\t\t\tthis.saveNewPassword();\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.reload();\n\t\t\t\t}\n\t\t\t}).catch((error) => {\n\t\t\t\tthis.loaderService.hide(1);\n\t\t\t\tthis.notificationService.showError({message: error.data ? error.data.error : 'technicalError'});\n\t\t\t});\n\t\t}\n\n\t\tsaveNewPassword() {\n\t\t\tlet params = {\n\t\t\t\tpassword: this.model.originalPassword,\n\t\t\t\tnewPassword: this.model.password,\n\t\t\t\tuserId: this.model.userId,\n\t\t\t\tcallback: window.location.origin + '/callback'\n\t\t\t};\n\t\t\tthis.UserHandlerService.saveNewPassword(params).then(() => {\n\t\t\t\twindow.location.reload();\n\t\t\t}).catch((error) => {\n\t\t\t\tthis.loaderService.hide(1);\n\t\t\t\tthis.notificationService.showError({message: error.data ? error.data.error : 'technicalError'});\n\t\t\t});\n\t\t}\n\n\t\tisTheSameAsOriginal() {\n\t\t\treturn JSON.stringify(this.model) === JSON.stringify(this.originalUserInfo);\n\t\t}\n\n\t\tsubscriptionChanged() {\n\t\t\twindow.dataLayer.push({\n\t\t\t\tevent: 'newsletterSubscribe'\n\t\t\t});\n\t\t}\n\t}\n};\n","import './layout.pcss';\nimport angular from 'angular';\nimport 'angular-i18n/angular-locale_hu-hu';\nimport '../../common/common';\nimport '../../application/profile/profile.module';\nconst MODULE_NAME = 'APROF-app';\n\nexport default angular.module(MODULE_NAME, window.dependencies).name;\n\n\n"],"sourceRoot":""}