{"version":3,"sources":["webpack:///./src/assets/img/chevronLeft.svg","webpack:///./src/views/login/views/completeProfile.vue?3d2b","webpack:///./src/views/login/views/completeProfile.vue?b1f7","webpack:///./src/views/login/views/completeProfile.vue"],"names":["module","exports","_hoisted_1","class","_hoisted_2","src","_hoisted_3","_hoisted_4","_hoisted_5","render","_ctx","_cache","$props","$setup","$data","$options","_component_localized_text","_component_mini_spinner","_component_val_form","_directive_localizedPlaceholder","onClick","$event","back","localizedKey","text","onNext","completeProfile","default","type","user","name","required","key","value","afterText","surname","no_value","birthDate","args","changeDate","loading","cssClass","disabled","isDisabled","_","responseEmail","getProfileVM","then","x","this","date","Date","substring","email","store","state","firstSetupDone","$route","query","redirect","$router","replace","path","catch","error","$opModal","show","isError","message","finally","LoginServices","logout","components","__exports__"],"mappings":"mGAAAA,EAAOC,QAAU,IAA0B,gC,8ECI3C,MAAMC,EAAa,CAAEC,MAAO,kBACtBC,EAA0B,eAAa,MAAO,CAAEC,IAAK,KAAc,MAAO,GAC1EC,EAAa,CAAEH,MAAO,cACtBI,EAAa,CAAEJ,MAAO,cACtBK,EAAa,CAAEL,MAAO,oBAEtB,SAAUM,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,MAAMC,EAA4B,eAAkB,kBAC9CC,EAA0B,eAAkB,gBAC5CC,EAAsB,eAAkB,YACxCC,EAAkC,eAAkB,wBAE1D,OAAQ,iBAAc,eAAa,MAAOjB,EAAY,CACpD,eAAa,MAAO,CAClBC,MAAO,aACPiB,QAAST,EAAO,KAAOA,EAAO,GAAMU,GAAiBX,EAAKY,SACzD,CACDlB,IAEF,eAAaY,EAA2B,CACtCO,aAAc,wBACdC,KAAM,sBACNrB,MAAO,uCAET,eAAae,EAAqB,CAChCO,OAAQf,EAAKgB,gBACbvB,MAAO,qBACN,CACDwB,QAAS,eAAS,IAAM,CACtB,eAAa,MAAOrB,EAAY,CAC9B,eAAgB,eAAa,QAAS,CACpCsB,KAAM,OACNzB,MAAO,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KAA6B,IAAI,OACjC,KAAAgB,cAAwB,GACxB,KAAAL,SAAmB,EAEnB,UACI,OAAWM,eACVC,KAAMC,IAGH,GAFAC,KAAKpB,KAAOmB,EAETA,EAAEX,UAAU,CACX,IAAIa,EAAO,IAAIC,KAAKH,EAAEX,WACtBY,KAAKpB,KAAKQ,UAAY,eAA0Ba,GAAME,UAAU,EAAG,IAGvEH,KAAKJ,cAAgBG,EAAEK,QAI/B,aACQJ,KAAKpB,KAAKQ,YACVY,KAAKpB,KAAKQ,UAAY,eAA0B,IAAIc,MAAQC,UAAU,EAAG,KAGjF,kBACIH,KAAKT,SAAU,EACf,OAAWd,gBAAgBuB,KAAKpB,MAC/BkB,KAAMC,IACHM,EAAA,KAAMC,MAAM1B,KAAKC,KAAOmB,KAAKpB,KAAKC,KAC/BwB,EAAA,KAAMC,MAAM1B,KAAK2B,eACbP,KAAKQ,OAAOC,MAAMC,SACjBV,KAAKW,QAAQC,QAAQZ,KAAKQ,OAAOC,MAAMC,UAEvCV,KAAKW,QAAQC,QAAQ,SAGzBZ,KAAKW,QAAQC,QAAQ,CACjBC,KAAM,oBACNJ,MAAOT,KAAKQ,OAAOC,UAI9BK,MAAOC,IACJf,KAAKgB,SAASC,KAAK,OACnB,CACIC,SAAS,EACTC,QAASJ,EAAMI,YAEpBC,QAAS,KACRpB,KAAKT,SAAU,IAIvB,OACI8B,EAAA,KAAcC,SAGlB,iBACI,OAAQtB,KAAKpB,KAAKC,OAASmB,KAAKpB,KAAKM,UAAYc,KAAKpB,KAAKQ,YA3D9C,EAAe,gBAJnC,eAAQ,CACLmC,WAAY,MAGK,W,qBCRrB,MAAMC,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAShE,KAErD","file":"js/chunk-0529c1fe5968e6363cdb.js","sourcesContent":["module.exports = __webpack_public_path__ + \"img/chevronLeft.86209808.svg\";","import { createVNode as _createVNode, resolveComponent as _resolveComponent, vModelText as _vModelText, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, withCtx as _withCtx } from \"vue\"\nimport _imports_0 from '@/assets/img/chevronLeft.svg'\n\n\nconst _hoisted_1 = { class: \"genericPadding\" }\nconst _hoisted_2 = /*#__PURE__*/_createVNode(\"img\", { src: _imports_0 }, null, -1)\nconst _hoisted_3 = { class: \"form-group\" }\nconst _hoisted_4 = { class: \"form-group\" }\nconst _hoisted_5 = { class: \"form-group w-100\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_localized_text = _resolveComponent(\"localized-text\")!\n const _component_mini_spinner = _resolveComponent(\"mini-spinner\")!\n const _component_val_form = _resolveComponent(\"val-form\")!\n const _directive_localizedPlaceholder = _resolveDirective(\"localizedPlaceholder\")!\n\n return (_openBlock(), _createBlock(\"div\", _hoisted_1, [\n _createVNode(\"div\", {\n class: \"backbutton\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_ctx.back()))\n }, [\n _hoisted_2\n ]),\n _createVNode(_component_localized_text, {\n localizedKey: \"app_completailprofilo\",\n text: \"Completa il profilo\",\n class: \"fs_28 spaceCadet d-block mt-2 mb-5\"\n }),\n _createVNode(_component_val_form, {\n onNext: _ctx.completeProfile,\n class: \"registerContainer\"\n }, {\n default: _withCtx(() => [\n _createVNode(\"div\", _hoisted_3, [\n _withDirectives(_createVNode(\"input\", {\n type: \"text\",\n class: \"genericInput\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (_ctx.user.name = $event)),\n required: \"\"\n }, null, 512), [\n [_vModelText, _ctx.user.name],\n [_directive_localizedPlaceholder, {key: 'app_nome', value: 'Nome', afterText : '*'}]\n ])\n ]),\n _createVNode(\"div\", _hoisted_4, [\n _withDirectives(_createVNode(\"input\", {\n type: \"text\",\n class: \"genericInput\",\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => (_ctx.user.surname = $event)),\n required: \"\"\n }, null, 512), [\n [_vModelText, _ctx.user.surname],\n [_directive_localizedPlaceholder, {key: 'app_cognome', value: 'Cognome', afterText : '*'}]\n ])\n ]),\n _createVNode(\"div\", _hoisted_5, [\n _withDirectives(_createVNode(\"input\", {\n type: \"date\",\n class: [\"genericInput d-block w-100\", {no_value : !_ctx.user.birthDate}],\n onClick: _cache[4] || (_cache[4] = \n//@ts-ignore\n(...args) => (_ctx.changeDate && _ctx.changeDate(...args))),\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = ($event: any) => (_ctx.user.birthDate = $event)),\n required: \"\"\n }, null, 2), [\n [_directive_localizedPlaceholder, {key: 'app_dataDiNascita', value: 'Data di nascita', afterText : '*'}],\n [_vModelText, _ctx.user.birthDate]\n ])\n ]),\n (_ctx.loading)\n ? (_openBlock(), _createBlock(_component_mini_spinner, {\n key: 0,\n cssClass: 'my-5'\n }))\n : (_openBlock(), _createBlock(\"button\", {\n key: 1,\n type: \"submit\",\n class: \"genericButton bgGradient w-100 mt-5\",\n disabled: _ctx.isDisabled\n }, [\n _createVNode(_component_localized_text, {\n localizedKey: \"app_completeProfilo\",\n text: \"Completa profilo\",\n class: \"fs_14 white\"\n })\n ], 8, [\"disabled\"]))\n ]),\n _: 1\n }, 8, [\"onNext\"])\n ]))\n}","\r\nimport { Options, Vue } from 'vue-class-component';\r\nimport { UserClient } from '@/services/Services';\r\nimport * as OM from '@/model';\r\nimport store from '@/store';\r\nimport ModalSuccessError from '@/components/modalSuccessError.vue';\r\nimport { LoginServices } from '@/services/LoginServices';\r\nimport { getUniversalDate, getUniversalISOStringDate } from '@/utils';\r\n\r\n@Options({\r\n components: {\r\n }\r\n})\r\nexport default class CompleteProfile extends Vue {\r\n \r\n user: OM.CompleteProfileVM = new OM.CompleteProfileVM();\r\n responseEmail: string = \"\";\r\n loading: boolean = false;\r\n\r\n created(){\r\n UserClient.getProfileVM()\r\n .then( x => {\r\n this.user = x;\r\n \r\n if(x.birthDate){\r\n var date = new Date(x.birthDate);\r\n this.user.birthDate = getUniversalISOStringDate(date).substring(0, 10);\r\n }\r\n\r\n this.responseEmail = x.email;\r\n })\r\n }\r\n\r\n changeDate(){\r\n if(!this.user.birthDate)\r\n this.user.birthDate = getUniversalISOStringDate(new Date()).substring(0, 10);\r\n }\r\n\r\n completeProfile(){\r\n this.loading = true;\r\n UserClient.completeProfile(this.user)\r\n .then( x => {\r\n store.state.user.name = this.user.name;\r\n if(store.state.user.firstSetupDone){\r\n if(this.$route.query.redirect){\r\n this.$router.replace(this.$route.query.redirect as string);\r\n } else {\r\n this.$router.replace('/home');\r\n }\r\n } else {\r\n this.$router.replace({\r\n path: '/categories/false',\r\n query: this.$route.query\r\n });\r\n }\r\n })\r\n .catch( error => {\r\n this.$opModal.show(ModalSuccessError, \r\n {\r\n isError: true,\r\n message: error.message\r\n });\r\n }).finally( () => {\r\n this.loading = false;\r\n })\r\n }\r\n\r\n back(){\r\n LoginServices.logout();\r\n }\r\n\r\n get isDisabled(){\r\n return !this.user.name || !this.user.surname || !this.user.birthDate;\r\n }\r\n\r\n}\r\n","import { render } from \"./completeProfile.vue?vue&type=template&id=52ce886a&ts=true\"\nimport script from \"./completeProfile.vue?vue&type=script&lang=ts\"\nexport * from \"./completeProfile.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"C:\\\\Users\\\\rekt\\\\source\\\\repos\\\\uose\\\\uoseapp_new\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"sourceRoot":""}