{"version":3,"sources":["webpack:///./src/features/useRoleByRouteInAdmin.ts","webpack:///./src/helpers/validation.ts","webpack:///./src/views/admin/users/AdminUserCreate.vue?0c49","webpack:///./src/views/admin/users/AdminUserCreate.vue","webpack:///./src/views/admin/users/AdminUserCreate.vue?f274","webpack:///./src/helpers/regex.ts","webpack:///./src/helpers/cleavePlugin.ts","webpack:///./src/views/admin/users/AdminUserCreate.vue?0f24","webpack:///./src/constants/index.ts"],"names":["useRoleByRouteInAdmin","cov_1axvepug94","f","roleByRoute","s","ref","watch","router","currentRoute","value","b","meta","role","UserRoles","LAWYER","LANDOWNER","immediate","cov_2csbspw5gy","actualCoverage","hasLowerAndUpperCase","hasLowerCaseRegex","test","hasUpperCaseRegex","hasPasswordLength","length","hasSpecialChars","hasSpecialCharsRegex","hasDigits","hasDigitsRegex","hasNumberAndSymbol","validatePassword","validateDocumentMimeType","mimeType","allowedDocumentMimeTypes","includes","validPhoneNumber","validOptionalPhoneNumber","_withScopeId","n","_pushScopeId","_popScopeId","_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_createElementVNode","_hoisted_7","key","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","_createElementBlock","_Fragment","_toDisplayString","headerText","_withDirectives","_normalizeClass","error","v$","firstName","$error","$event","form","type","placeholder","_vModelText","$errors","$message","_createCommentVNode","middleName","lastName","email","emailError","onInput","_createVNode","phone","modelValue","options","phoneNumberOption","onClick","go","createUser","_defineComponent","__name","setup","__props","expose","__expose","computed","reactive","rules","required","$autoDirty","useVuelidate","async","$touch","isFormCorrect","$validate","user","toLowerCase","store","dispatch","then","res","push","name","params","userId","data","_id","catch","response","message","__returned__","Cleave","CreateUser","Object","defineProperty","enumerable","__exports__","getRegex","string","cov_1f6uyvd7xm","RegExp","latinCharactersRegex","cov_290zsd572f","blocks","startsWith","delimiter","phonePlaceholder","getCurrencyOptions","numeral","numeralThousandsGroupStyle","numeralPositiveOnly","noImmediatePrefix","cov_1doyi2xpv9","MaxFileSize"],"mappings":"s1GAIM,SAAUA,IAAqBC,IAAAC,EAAA,KACnC,MAAMC,GAAWF,IAAAG,EAAA,KAAGC,iBAAI,KAexB,OAfyCJ,IAAAG,EAAA,KAEzCE,mBACE,KAAML,IAAAC,EAAA,KAAAD,IAAAG,EAAA,KAAAG,aAAOC,aAAaC,OACzBA,IAASR,IAAAC,EAAA,KAAAD,IAAAG,EAAA,KACRD,EAAYM,OACVR,IAAAS,EAAA,QAAAD,EAAME,KAAKC,OAAIX,IAAAS,EAAA,QAAID,EAAME,KAAKC,OAASC,eAAUC,SAAMb,IAAAS,EAAA,QACnDG,eAAUC,SAAMb,IAAAS,EAAA,QAChBG,eAAUE,aAElB,CACEC,WAAW,IAEbf,IAAAG,EAAA,KAEK,CAAED,e,2nOCQR,OAAAc,EAAA,kBAAAC,KAAAD,IAtBoDA,IAAAb,EAAA,KAEhD,MAAMe,EAAwBV,IACnCQ,IAAAf,EAAA,KAAAe,IAAAb,EAAA,KAAAa,IAAAP,EAAA,QAAAU,uBAAkBC,KAAKZ,KAAMQ,IAAAP,EAAA,QAAIY,uBAAkBD,KAAKZ,KAAOQ,IAAAb,EAAA,KAC1D,MAAMmB,EAAqBd,IAChCQ,IAAAf,EAAA,KAAAe,IAAAb,EAAA,KAAAa,IAAAP,EAAA,QAAAD,EAAMe,QAAU,IAACP,IAAAP,EAAA,QAAID,EAAMe,QAAU,KAAGP,IAAAb,EAAA,KACnC,MAAMqB,EAAmBhB,IAC9BQ,IAAAf,EAAA,KAAAe,IAAAb,EAAA,KAAAsB,0BAAqBL,KAAKZ,IAAOQ,IAAAb,EAAA,KAC5B,MAAMuB,EAAalB,IAAkBQ,IAAAf,EAAA,KAAAe,IAAAb,EAAA,KAAAwB,oBAA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IAA4BC,IAAA9I,EAAA,KAAA8I,IAAA5I,EAAA,SAAI6I,OAAOF,EAAQ,MAEpD3H,GAAiB4H,IAAA5I,EAAA,KAAG0I,EAAS,gBAC7BxH,GAAiB0H,IAAA5I,EAAA,KAAG0I,EAAS,gBAC7BpH,GAAoBsH,IAAA5I,EAAA,KAAG0I,EAClC,yDAEWlH,GAAcoH,IAAA5I,EAAA,KAAG0I,EAAS,iBAC1BI,GAAoBF,IAAA5I,EAAA,KAAG0I,EAAS,8B,mmHCRvC,SAAU1C,EAAkBH,GAChC,OAD6CkD,IAAAjJ,EAAA,KAAAiJ,IAAA/I,EAAA,KACtC,CACLgJ,QAAQD,IAAAzI,EAAA,SAACuF,IAAKkD,IAAAzI,EAAA,QAAS,OAALuF,QAAK,IAALA,KAAOoD,WAAW,OAAIF,IAAAzI,EAAA,QAAG,CAAC,EAAG,EAAG,EAAG,KAAEyI,IAAAzI,EAAA,QAAG,CAAC,EAAG,EAAG,KACjE4I,UAAW,K,iKAIR,MAAMC,GAAgBJ,IAAA/I,EAAA,KAAG,gBAAe+I,IAAA/I,EAAA,KAExC,MAAMoJ,EAAqBA,EAChCC,WAAON,IAAAzI,EAAA,SAAG,GACVgJ,8BAA0BP,IAAAzI,EAAA,QAAG,YAC7BiJ,uBAAmBR,IAAAzI,EAAA,SAAG,OAKAyI,IAAAjJ,EAAA,KAAAiJ,IAAA/I,EAAA,MACtBqJ,UACAC,6BACAC,sBACAC,mBAAmB,K,kCCrBrB,W,w9CCAO,MAAM3H,GAAwB4H,IAAAzJ,EAAA,KAAG,CACtC,aACA,YACA,aACA,aACA,QACA,oBAEW0J,GAAWD,IAAAzJ,EAAA,KAAG","file":"js/admin33.34188aca.js","sourcesContent":["import { ref, Ref, watch } from \"vue\";\nimport router from \"@/router\";\nimport { UserRoles } from \"@/enums/UserRoles\";\n\nexport function useRoleByRouteInAdmin(): { roleByRoute: Ref } {\n const roleByRoute = ref(\"\" as UserRoles);\n\n watch(\n () => router.currentRoute.value,\n (value) => {\n roleByRoute.value =\n value.meta.role && value.meta.role === UserRoles.LAWYER\n ? UserRoles.LAWYER\n : UserRoles.LANDOWNER;\n },\n {\n immediate: true,\n }\n );\n\n return { roleByRoute };\n}\n","import {\n hasLowerCaseRegex,\n hasUpperCaseRegex,\n hasSpecialCharsRegex,\n hasDigitsRegex,\n} from \"@/helpers/regex\";\nimport { allowedDocumentMimeTypes } from \"@/constants\";\n\nexport const hasLowerAndUpperCase = (value: string) =>\n hasLowerCaseRegex.test(value) && hasUpperCaseRegex.test(value);\nexport const hasPasswordLength = (value: string) =>\n value.length >= 4 && value.length <= 16;\nexport const hasSpecialChars = (value: string) =>\n hasSpecialCharsRegex.test(value);\nexport const hasDigits = (value: string) => hasDigitsRegex.test(value);\nexport const hasNumberAndSymbol = (value: string) =>\n hasDigits(value) && hasSpecialChars(value);\nexport const validatePassword = (value: string) =>\n hasLowerAndUpperCase(value) &&\n hasPasswordLength(value) &&\n hasNumberAndSymbol(value);\nexport const validateDocumentMimeType = (mimeType: string): boolean =>\n allowedDocumentMimeTypes.includes(mimeType);\nexport const validPhoneNumber = (value: string) =>\n /^(\\+61|0)4\\d{8}$/.test(value);\nexport const validOptionalPhoneNumber = (value: string) => {\n if (value) {\n return validPhoneNumber(value);\n }\n return true;\n};\n","import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, vModelText as _vModelText, normalizeClass as _normalizeClass, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-a2d5a8d8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"dashboard-header\" }\nconst _hoisted_2 = { class: \"title-main\" }\nconst _hoisted_3 = { class: \"default-form\" }\nconst _hoisted_4 = { class: \"input-row\" }\nconst _hoisted_5 = { class: \"input-wr\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"First Name\", -1))\nconst _hoisted_7 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_8 = { class: \"input-wr\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Middle Name\", -1))\nconst _hoisted_10 = { class: \"input-wr\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Last Name\", -1))\nconst _hoisted_12 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_13 = { class: \"input-row\" }\nconst _hoisted_14 = { class: \"input-wr\" }\nconst _hoisted_15 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Email\", -1))\nconst _hoisted_16 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_17 = {\n key: 1,\n class: \"error-hint\"\n}\nconst _hoisted_18 = { class: \"input-wr\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { class: \"label\" }, \"Phone\", -1))\nconst _hoisted_20 = {\n key: 0,\n class: \"error-hint\"\n}\nconst _hoisted_21 = { class: \"input-row\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"h2\", _hoisted_2, _toDisplayString($setup.headerText), 1)\n ]),\n _createElementVNode(\"form\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.firstName.$error }]),\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => (($setup.form.firstName) = $event)),\n type: \"text\",\n placeholder: \"First Name\"\n }, null, 2), [\n [_vModelText, $setup.form.firstName]\n ]),\n ($setup.v$.firstName.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_7, _toDisplayString($setup.v$.firstName.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _withDirectives(_createElementVNode(\"input\", {\n class: \"input\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (($setup.form.middleName) = $event)),\n type: \"text\",\n placeholder: \"Middle Name\"\n }, null, 512), [\n [_vModelText, $setup.form.middleName]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.lastName.$error }]),\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (($setup.form.lastName) = $event)),\n type: \"text\",\n placeholder: \"Last Name\"\n }, null, 2), [\n [_vModelText, $setup.form.lastName]\n ]),\n ($setup.v$.lastName.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, _toDisplayString($setup.v$.lastName.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", _hoisted_14, [\n _hoisted_15,\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([\"input\", { error: $setup.v$.email.$error || $setup.emailError }]),\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => (($setup.form.email) = $event)),\n onInput: _cache[4] || (_cache[4] = ($event: any) => ($setup.emailError = '')),\n type: \"email\",\n placeholder: \"Email\"\n }, null, 34), [\n [_vModelText, $setup.form.email]\n ]),\n ($setup.v$.email.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, _toDisplayString($setup.v$.email.$errors[0].$message), 1))\n : _createCommentVNode(\"\", true),\n ($setup.emailError)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_17, _toDisplayString($setup.emailError), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode($setup[\"Cleave\"], {\n class: _normalizeClass([\"input\", { error: $setup.v$.phone.$error }]),\n modelValue: $setup.form.phone,\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = ($event: any) => (($setup.form.phone) = $event)),\n options: $setup.phoneNumberOption($setup.form.phone),\n placeholder: \"0412 345 678\"\n }, null, 8, [\"modelValue\", \"options\", \"class\"]),\n ($setup.v$.phone.$error)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_20, \"Invalid phone\"))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_21, [\n _createElementVNode(\"button\", {\n class: \"button default outlined cancel-btn\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => ($setup.router.go(-1))),\n type: \"button\"\n }, \"Cancel\"),\n _createElementVNode(\"button\", {\n class: \"button default primary create-btn\",\n onClick: $setup.createUser,\n type: \"button\"\n }, \"Create\")\n ])\n ])\n ], 64))\n}","import { defineComponent as _defineComponent } from 'vue'\nimport Cleave from \"vue-cleave-component\";\nimport {computed, reactive, ref, watch} from \"vue\";\nimport useVuelidate from \"@vuelidate/core\";\nimport {email, required} from \"@vuelidate/validators\";\nimport {validPhoneNumber} from \"@/helpers/validation\";\nimport store from \"@/store\";\nimport router from \"@/router\";\nimport {CreateUser} from \"@/types/CreateUser\";\nimport {UserRoles} from \"@/enums/UserRoles\";\nimport {phoneNumberOption} from \"@/helpers/cleavePlugin\";\nimport {useRoleByRouteInAdmin} from \"@/features/useRoleByRouteInAdmin\";\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AdminUserCreate',\n setup(__props, { expose: __expose }) {\n __expose();\n\nconst {roleByRoute} = useRoleByRouteInAdmin();\n\nconst headerText = computed(() => {\n return roleByRoute.value === UserRoles.LAWYER\n ? \"Add Contact person (Trust account)\"\n : \"Add Land Owner\";\n});\nconst form = reactive({\n firstName: \"\",\n middleName: \"\",\n lastName: \"\",\n email: \"\",\n phone: \"\",\n});\nconst rules = computed(() => {\n return {\n firstName: { required, $autoDirty: true },\n lastName: { required, $autoDirty: true },\n email: { required, email, $autoDirty: true },\n phone: { validPhoneNumber, $autoDirty: true },\n };\n});\nconst v$ = useVuelidate(rules, form);\nconst emailError = ref(\"\");\n\nwatch(\n () => router.currentRoute.value,\n (value) => {\n roleByRoute.value =\n value.meta.role && value.meta.role === UserRoles.LAWYER\n ? UserRoles.LAWYER\n : UserRoles.LANDOWNER;\n },\n {\n immediate: true,\n }\n);\n\nconst createUser = async () => {\n v$.value.$touch();\n const isFormCorrect = await v$.value.$validate();\n if (!isFormCorrect) {\n return;\n }\n const user: CreateUser = {\n firstName: form.firstName,\n middleName: form.middleName,\n lastName: form.lastName,\n email: form.email.toLowerCase(),\n phone: form.phone,\n role: roleByRoute.value,\n };\n store\n .dispatch(\"user/createUser\", user)\n .then((res) => {\n router.push({\n name:\n roleByRoute.value === UserRoles.LAWYER\n ? \"AdminLawyerDetailsUpdate\"\n : \"AdminLandownerDetailsUpdate\",\n params: {\n userId: res.data._id,\n },\n });\n })\n .catch((error) => {\n if (error.response.data.message) {\n emailError.value = error.response.data.message;\n }\n });\n};\n\nconst __returned__ = { roleByRoute, headerText, form, rules, v$, emailError, createUser, get Cleave() { return Cleave }, computed, reactive, ref, watch, get useVuelidate() { return useVuelidate }, get email() { return email }, get required() { return required }, get validPhoneNumber() { return validPhoneNumber }, get store() { return store }, get router() { return router }, get CreateUser() { return CreateUser }, get UserRoles() { return UserRoles }, get phoneNumberOption() { return phoneNumberOption }, get useRoleByRouteInAdmin() { return useRoleByRouteInAdmin } }\nObject.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })\nreturn __returned__\n}\n\n})","import { render } from \"./AdminUserCreate.vue?vue&type=template&id=a2d5a8d8&scoped=true&ts=true&lang=pug\"\nimport script from \"./AdminUserCreate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AdminUserCreate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AdminUserCreate.vue?vue&type=style&index=0&id=a2d5a8d8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/codebuild/output/src264950160/src/lottrackr-front/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-a2d5a8d8\"]])\n\nexport default __exports__","const getRegex = (string: string | RegExp) => new RegExp(string, \"u\");\n\nexport const hasLowerCaseRegex = getRegex(\"^.*[a-z].*$\");\nexport const hasUpperCaseRegex = getRegex(\"^.*[A-Z].*$\");\nexport const hasSpecialCharsRegex = getRegex(\n \"^.*[`!@#$%^&*()_+\\\\-=\\\\[\\\\]{};':\\\"\\\\\\\\|,.<>\\\\/?~].*$\"\n);\nexport const hasDigitsRegex = getRegex(\"^.*[+0-9].*$\");\nexport const latinCharactersRegex = getRegex(/^[A-Za-z0-9(),.`\\-&\\s]*$/);\n","export function phoneNumberOption(phone: string) {\n return {\n blocks: !phone || phone?.startsWith(\"+\") ? [3, 3, 3, 3] : [4, 3, 3],\n delimiter: \" \",\n };\n}\n\nexport const phonePlaceholder = \"0412 345 678\";\n\nexport const getCurrencyOptions = ({\n numeral = true,\n numeralThousandsGroupStyle = \"thousand\",\n numeralPositiveOnly = true,\n}: {\n numeral?: boolean;\n numeralThousandsGroupStyle?: NumeralThousandsGroupStyle;\n numeralPositiveOnly?: boolean;\n}): CurrencyOptions => ({\n numeral,\n numeralThousandsGroupStyle,\n numeralPositiveOnly,\n noImmediatePrefix: true,\n});\ntype NumeralThousandsGroupStyle = \"thousand\" | \"lakh\" | \"wan\";\n\ntype CurrencyOptions = {\n numeral: boolean;\n numeralThousandsGroupStyle: NumeralThousandsGroupStyle;\n numeralPositiveOnly: boolean;\n noImmediatePrefix: boolean;\n};\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./AdminUserCreate.vue?vue&type=style&index=0&id=a2d5a8d8&lang=scss&scoped=true\"","export const allowedDocumentMimeTypes = [\n \"image/jpeg\",\n \"image/png\",\n \"image/heic\",\n \"image/heif\",\n \".heic\",\n \"application/pdf\",\n];\nexport const MaxFileSize = 26214400;\n"],"sourceRoot":""}