@opengis/surveyor 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,100 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { o as t } from "./surveyor-CDkI2Dcp.js";
3
+ import { t as n } from "./AppIcon-CO70tpMX.js";
4
+ import { createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, openBlock as l, ref as u, toDisplayString as d, vModelText as f, withCtx as p, withDirectives as m, withModifiers as h } from "vue";
5
+ import { RouterLink as g, useRoute as _ } from "vue-router";
6
+ //#region cabinet/src/pages/password/forgot.vue?vue&type=script&setup=true&lang.ts
7
+ var v = /*@__PURE__*/ c({
8
+ __name: "forgot",
9
+ setup(e, { expose: r }) {
10
+ r();
11
+ let i = _(), a = typeof i.query.email == "string" ? i.query.email : "", o = u(a), s = u(""), c = u(!1), l = u(!1);
12
+ function d(e) {
13
+ return e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) ? null : "Вкажіть коректний email" : "Вкажіть email";
14
+ }
15
+ async function f() {
16
+ s.value = "";
17
+ let e = o.value.trim().toLowerCase(), n = d(e);
18
+ if (n) {
19
+ s.value = n;
20
+ return;
21
+ }
22
+ c.value = !0;
23
+ try {
24
+ await t(e), l.value = !0;
25
+ } catch (e) {
26
+ s.value = e instanceof Error ? e.message : "Не вдалося надіслати лист";
27
+ } finally {
28
+ c.value = !1;
29
+ }
30
+ }
31
+ let p = {
32
+ route: i,
33
+ initialEmail: a,
34
+ email: o,
35
+ error: s,
36
+ submitting: c,
37
+ sent: l,
38
+ validateEmail: d,
39
+ submit: f,
40
+ AppIcon: n,
41
+ get RouterLink() {
42
+ return g;
43
+ }
44
+ };
45
+ return Object.defineProperty(p, "__isScriptSetup", {
46
+ enumerable: !1,
47
+ value: !0
48
+ }), p;
49
+ }
50
+ }), y = { class: "flex min-h-screen items-center justify-center bg-gradient-to-br from-brand-50 via-white to-slate-100 px-4" }, b = { class: "w-full max-w-md" }, x = { class: "mb-8 text-center" }, S = { class: "mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-100 to-brand-200 shadow-lg shadow-brand-600/20 ring-1 ring-brand-200/60" }, C = {
51
+ key: 0,
52
+ class: "rounded-2xl border border-slate-200 bg-white p-8 shadow-sm"
53
+ }, w = { class: "block text-sm font-medium text-slate-700" }, T = {
54
+ key: 0,
55
+ class: "mt-4 text-sm text-red-600"
56
+ }, E = ["disabled"], D = { class: "mt-6 text-center text-sm text-slate-500" };
57
+ function O(e, t, n, c, u, g) {
58
+ return l(), i("div", y, [a("div", b, [a("div", x, [
59
+ a("div", S, [s(c.AppIcon, {
60
+ name: "map-pinned",
61
+ class: "h-7 w-7 text-brand-600"
62
+ })]),
63
+ t[1] ||= a("h1", { class: "text-2xl font-semibold text-slate-900" }, "Відновлення пароля", -1),
64
+ t[2] ||= a("p", { class: "mt-1 text-sm text-slate-500" }, "Вкажіть email — надішлемо одноразове посилання", -1)
65
+ ]), c.sent ? (l(), i("div", C, [t[4] ||= a("p", { class: "rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800" }, " Якщо обліковий запис із цією адресою зареєстровано, на пошту надійде лист із посиланням для встановлення нового пароля. Посилання дійсне 1 годину. ", -1), s(c.RouterLink, {
66
+ to: "/login",
67
+ class: "mt-4 block w-full rounded-xl bg-brand-600 py-2.5 text-center text-sm font-semibold text-white transition-colors hover:bg-brand-700"
68
+ }, {
69
+ default: p(() => [...t[3] ||= [o(" Повернутися до входу ", -1)]]),
70
+ _: 1
71
+ })])) : (l(), i("form", {
72
+ key: 1,
73
+ class: "rounded-2xl border border-slate-200 bg-white p-8 shadow-sm",
74
+ onSubmit: h(c.submit, ["prevent"])
75
+ }, [
76
+ a("label", w, [t[5] ||= o(" Email ", -1), m(a("input", {
77
+ "onUpdate:modelValue": t[0] ||= (e) => c.email = e,
78
+ type: "email",
79
+ autocomplete: "username",
80
+ placeholder: "email@example.com",
81
+ class: "mt-1.5 h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:border-brand-400 focus:ring-1 focus:ring-brand-400"
82
+ }, null, 512), [[f, c.email]])]),
83
+ c.error ? (l(), i("p", T, d(c.error), 1)) : r("", !0),
84
+ a("button", {
85
+ type: "submit",
86
+ class: "mt-4 w-full rounded-xl bg-brand-600 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-60",
87
+ disabled: c.submitting
88
+ }, d(c.submitting ? "Надсилання…" : "Надіслати лист"), 9, E),
89
+ a("p", D, [t[7] ||= o(" Згадали пароль? ", -1), s(c.RouterLink, {
90
+ to: "/login",
91
+ class: "font-medium text-brand-700 hover:text-brand-900 hover:underline"
92
+ }, {
93
+ default: p(() => [...t[6] ||= [o(" Увійти ", -1)]]),
94
+ _: 1
95
+ })])
96
+ ], 32))])]);
97
+ }
98
+ var k = /*#__PURE__*/ e(v, [["render", O], ["__file", "C:/softpro/surveyor/cabinet/src/pages/password/forgot.vue"]]);
99
+ //#endregion
100
+ export { k as default };
@@ -0,0 +1,5 @@
1
+ import { ref as e } from "vue";
2
+ //#region cabinet/src/state/list-search.ts
3
+ var t = e("");
4
+ //#endregion
5
+ export { t };
@@ -0,0 +1,124 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { t } from "./auth-acuaYbYM.js";
3
+ import { t as n } from "./AppIcon-CO70tpMX.js";
4
+ import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, openBlock as u, ref as d, toDisplayString as f, vModelText as p, withCtx as m, withDirectives as h, withModifiers as g } from "vue";
5
+ import { RouterLink as _, useRoute as v, useRouter as y } from "vue-router";
6
+ //#region cabinet/src/pages/login/index.vue?vue&type=script&setup=true&lang.ts
7
+ var b = /*@__PURE__*/ l({
8
+ __name: "index",
9
+ setup(e, { expose: i }) {
10
+ i();
11
+ let a = v(), o = y(), s = d(""), c = d(""), l = d(""), u = d(!1), f = r(() => a.query.registered === "1"), p = r(() => a.query.reset === "1"), m = r(() => {
12
+ let e = s.value.trim();
13
+ return e ? {
14
+ path: "/password/forgot",
15
+ query: { email: e }
16
+ } : "/password/forgot";
17
+ });
18
+ function h() {
19
+ let e = a.query.redirect;
20
+ return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "/requests";
21
+ }
22
+ async function g() {
23
+ l.value = "";
24
+ let e = s.value.trim().toLowerCase();
25
+ if (!e || !c.value) {
26
+ l.value = "Вкажіть email і пароль";
27
+ return;
28
+ }
29
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
30
+ l.value = "Вкажіть коректний email";
31
+ return;
32
+ }
33
+ u.value = !0;
34
+ try {
35
+ await t.login(e, c.value), await t.checkUser();
36
+ let { loadCabinetContext: n } = await import("./organizations-DbVDoURw.js").then((e) => e.a);
37
+ await n(!0), await o.push(h());
38
+ } catch (e) {
39
+ l.value = e instanceof Error ? e.message : "Не вдалося увійти";
40
+ } finally {
41
+ u.value = !1;
42
+ }
43
+ }
44
+ let b = {
45
+ route: a,
46
+ router: o,
47
+ email: s,
48
+ password: c,
49
+ error: l,
50
+ submitting: u,
51
+ registeredNotice: f,
52
+ resetNotice: p,
53
+ forgotLink: m,
54
+ redirectTarget: h,
55
+ submit: g,
56
+ AppIcon: n,
57
+ get RouterLink() {
58
+ return _;
59
+ }
60
+ };
61
+ return Object.defineProperty(b, "__isScriptSetup", {
62
+ enumerable: !1,
63
+ value: !0
64
+ }), b;
65
+ }
66
+ }), x = { class: "flex min-h-screen items-center justify-center bg-gradient-to-br from-brand-50 via-white to-slate-100 px-4" }, S = { class: "w-full max-w-md" }, C = { class: "mb-8 text-center" }, w = { class: "mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-100 to-brand-200 shadow-lg shadow-brand-600/20 ring-1 ring-brand-200/60" }, T = {
67
+ key: 0,
68
+ class: "mb-4 rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800"
69
+ }, E = {
70
+ key: 1,
71
+ class: "mb-4 rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800"
72
+ }, D = { class: "block text-sm font-medium text-slate-700" }, O = { class: "mt-4 block text-sm font-medium text-slate-700" }, k = {
73
+ key: 0,
74
+ class: "mt-4 text-sm text-red-600"
75
+ }, A = ["disabled"], j = { class: "mt-4 text-center" };
76
+ function M(e, t, n, r, l, d) {
77
+ return u(), a("div", x, [o("div", S, [
78
+ o("div", C, [
79
+ o("div", w, [c(r.AppIcon, {
80
+ name: "map-pinned",
81
+ class: "h-7 w-7 text-brand-600"
82
+ })]),
83
+ t[2] ||= o("h1", { class: "text-2xl font-semibold text-slate-900" }, "Кабінет геодезиста", -1),
84
+ t[3] ||= o("p", { class: "mt-1 text-sm text-slate-500" }, "Вхід за email і паролем", -1)
85
+ ]),
86
+ r.registeredNotice ? (u(), a("p", T, " Реєстрацію завершено. Увійдіть, використовуючи вказаний під час реєстрації email. ")) : i("", !0),
87
+ r.resetNotice ? (u(), a("p", E, " Пароль змінено. Увійдіть, використовуючи новий пароль. ")) : i("", !0),
88
+ o("form", {
89
+ class: "rounded-2xl border border-slate-200 bg-white p-8 shadow-sm",
90
+ onSubmit: g(r.submit, ["prevent"])
91
+ }, [
92
+ o("label", D, [t[4] ||= s(" Email ", -1), h(o("input", {
93
+ "onUpdate:modelValue": t[0] ||= (e) => r.email = e,
94
+ type: "email",
95
+ autocomplete: "username",
96
+ placeholder: "email@example.com",
97
+ class: "mt-1.5 h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:border-brand-400 focus:ring-1 focus:ring-brand-400"
98
+ }, null, 512), [[p, r.email]])]),
99
+ o("label", O, [t[5] ||= s(" Пароль ", -1), h(o("input", {
100
+ "onUpdate:modelValue": t[1] ||= (e) => r.password = e,
101
+ type: "password",
102
+ autocomplete: "current-password",
103
+ placeholder: "Пароль",
104
+ class: "mt-1.5 h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:border-brand-400 focus:ring-1 focus:ring-brand-400"
105
+ }, null, 512), [[p, r.password]])]),
106
+ r.error ? (u(), a("p", k, f(r.error), 1)) : i("", !0),
107
+ o("button", {
108
+ type: "submit",
109
+ class: "mt-4 w-full rounded-xl bg-brand-600 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-60",
110
+ disabled: r.submitting
111
+ }, f(r.submitting ? "Вхід…" : "Увійти"), 9, A),
112
+ o("p", j, [c(r.RouterLink, {
113
+ to: r.forgotLink,
114
+ class: "text-sm font-medium text-slate-600 transition-colors hover:text-brand-700 hover:underline"
115
+ }, {
116
+ default: m(() => [...t[6] ||= [s(" Забули пароль? ", -1)]]),
117
+ _: 1
118
+ }, 8, ["to"])])
119
+ ], 32)
120
+ ])]);
121
+ }
122
+ var N = /*#__PURE__*/ e(b, [["render", M], ["__file", "C:/softpro/surveyor/cabinet/src/pages/login/index.vue"]]);
123
+ //#endregion
124
+ export { N as default };
@@ -0,0 +1,93 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { i as t } from "./surveyor-CDkI2Dcp.js";
3
+ import { a as n, n as r, o as i, s as a, t as o } from "./profile-aXlo4qqA.js";
4
+ import { ref as s } from "vue";
5
+ //#region cabinet/src/api/organizations.ts
6
+ var c = /* @__PURE__ */ e({
7
+ activeOrgId: () => y,
8
+ cabinetContextError: () => v,
9
+ cabinetContextLoaded: () => _,
10
+ loadCabinetContext: () => T,
11
+ resetCabinetContext: () => w,
12
+ setActiveOrgId: () => b,
13
+ userOrganizations: () => g
14
+ }), l = "surveyor_active_org_id", u = null;
15
+ function d(e) {
16
+ return e.replace(/^(ТОВ|ПП|ФОП)\s+/i, "").replace(/^[«"']+|[»"']+$/g, "").trim() || e;
17
+ }
18
+ function f(e) {
19
+ let t = e.replace(/[«»"']/g, " ").trim(), n = t.split(/\s+/).filter((e) => /[\p{L}\p{N}]/u.test(e));
20
+ if (n.length >= 2) {
21
+ let e = n[0].replace(/[^\p{L}\p{N}]/gu, ""), t = n[1].replace(/[^\p{L}\p{N}]/gu, "");
22
+ if (e && t) return `${e.charAt(0)}${t.charAt(0)}`.toUpperCase();
23
+ }
24
+ return (t.replace(/[^\p{L}\p{N}]/gu, "").slice(0, 2) || "ОР").toUpperCase();
25
+ }
26
+ function p(e) {
27
+ let t = e.email?.trim() || e.phone?.trim() || void 0;
28
+ return {
29
+ id: e.org_id,
30
+ name: e.name,
31
+ shortName: d(e.name),
32
+ avatarText: f(e.name),
33
+ subtitle: t
34
+ };
35
+ }
36
+ function m() {
37
+ try {
38
+ return localStorage.getItem(l) ?? "";
39
+ } catch {
40
+ return "";
41
+ }
42
+ }
43
+ function h(e) {
44
+ try {
45
+ e ? localStorage.setItem(l, e) : localStorage.removeItem(l);
46
+ } catch {}
47
+ }
48
+ var g = s([]), _ = s(!1), v = s(""), y = s(m());
49
+ function b(e) {
50
+ y.value = e, h(e), u && i(u.organizations, e);
51
+ }
52
+ function x() {
53
+ let e = g.value.map((e) => e.id);
54
+ if (e.length === 0) {
55
+ y.value = "", h("");
56
+ return;
57
+ }
58
+ e.includes(y.value) ? u && i(u.organizations, y.value) : b(e[0]);
59
+ }
60
+ var S = null, C = 0;
61
+ function w() {
62
+ C += 1, u = null, S = null, g.value = [], _.value = !1, v.value = "", y.value = "", h(""), n();
63
+ }
64
+ async function T(e = !1) {
65
+ if (!_.value || e) {
66
+ if (!S) {
67
+ let e = C;
68
+ S = (async () => {
69
+ v.value = "";
70
+ let n = await t();
71
+ if (e === C) {
72
+ if (u = n, g.value = n.organizations.map(p), r(n, y.value), x(), n.certificate_id) try {
73
+ let t = await a(n.certificate_id);
74
+ if (e !== C) return;
75
+ o(t);
76
+ } catch {
77
+ if (e !== C) return;
78
+ o(null);
79
+ }
80
+ else o(null);
81
+ e === C && (_.value = !0);
82
+ }
83
+ })().catch((t) => {
84
+ if (e === C) throw _.value = !1, g.value = [], u = null, v.value = t instanceof Error ? t.message : "Не вдалося завантажити профіль", t;
85
+ }).finally(() => {
86
+ S && e === C && (S = null);
87
+ });
88
+ }
89
+ return S;
90
+ }
91
+ }
92
+ //#endregion
93
+ export { c as a, T as i, v as n, b as o, _ as r, g as s, y as t };
@@ -1,5 +1,7 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { i as t, n, o as r, t as i } from "./profile-DxZHxGum.js";
2
+ import { n as t } from "./surveyor-CDkI2Dcp.js";
3
+ import { i as n, r } from "./profile-aXlo4qqA.js";
4
+ import { t as i } from "./AppIcon-CO70tpMX.js";
3
5
  import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, ref as g, renderList as _, toDisplayString as v, vModelDynamic as y, withDirectives as b } from "vue";
4
6
  //#region cabinet/src/pages/profile/components/PasswordModal.vue?vue&type=script&setup=true&lang.ts
5
7
  var x = 8, ee = /*@__PURE__*/ p({
@@ -7,13 +9,13 @@ var x = 8, ee = /*@__PURE__*/ p({
7
9
  emits: ["close"],
8
10
  setup(e, { expose: n, emit: a }) {
9
11
  n();
10
- let s = a, c = g(""), l = g(""), u = g(!1), d = g(!1), f = g(!1), p = g(!1), m = g(""), h = o(() => c.value.length > 0 && l.value.length > 0 && c.value !== l.value), _ = o(() => c.value.length > 0 && c.value.length < x), v = o(() => !f.value && !p.value && c.value.length >= x && c.value === l.value && !!i.uid);
12
+ let s = a, c = g(""), l = g(""), u = g(!1), d = g(!1), f = g(!1), p = g(!1), m = g(""), h = o(() => c.value.length > 0 && l.value.length > 0 && c.value !== l.value), _ = o(() => c.value.length > 0 && c.value.length < x), v = o(() => !f.value && !p.value && c.value.length >= x && c.value === l.value && !!r.uid);
11
13
  async function y() {
12
14
  if (v.value) {
13
15
  m.value = "", f.value = !0;
14
16
  try {
15
17
  await t({
16
- surveyorId: i.uid,
18
+ surveyorId: r.uid,
17
19
  password: c.value,
18
20
  passwordConfirmation: l.value
19
21
  }), p.value = !0, window.setTimeout(() => s("close"), 1200);
@@ -38,7 +40,7 @@ var x = 8, ee = /*@__PURE__*/ p({
38
40
  weak: _,
39
41
  canSave: v,
40
42
  save: y,
41
- AppIcon: r
43
+ AppIcon: i
42
44
  };
43
45
  return Object.defineProperty(b, "__isScriptSetup", {
44
46
  enumerable: !1,
@@ -126,7 +128,7 @@ var R = /*#__PURE__*/ e(ee, [["render", L], ["__file", "C:/softpro/surveyor/cabi
126
128
  __name: "index",
127
129
  setup(e, { expose: t }) {
128
130
  t();
129
- let a = g(!1), s = o(() => n(i)), c = o(() => `${i.surName.trim().charAt(0)}${i.userName.trim().charAt(0)}`.toUpperCase());
131
+ let a = g(!1), s = o(() => n(r)), c = o(() => `${r.surName.trim().charAt(0)}${r.userName.trim().charAt(0)}`.toUpperCase());
130
132
  function l(e, t, n) {
131
133
  let r = n.trim();
132
134
  return {
@@ -149,22 +151,22 @@ var R = /*#__PURE__*/ e(ee, [["render", L], ["__file", "C:/softpro/surveyor/cabi
149
151
  {
150
152
  icon: "building-2",
151
153
  label: "Назва організації",
152
- value: i.organization
154
+ value: r.organization
153
155
  },
154
156
  {
155
157
  icon: "map-pin",
156
158
  label: "Юридична адреса",
157
- value: i.orgAddress
159
+ value: r.orgAddress
158
160
  },
159
161
  {
160
162
  icon: "mail",
161
163
  label: "Email",
162
- value: i.orgEmail
164
+ value: r.orgEmail
163
165
  },
164
166
  {
165
167
  icon: "phone",
166
168
  label: "Телефон",
167
- value: i.orgPhone
169
+ value: r.orgPhone
168
170
  }
169
171
  ]
170
172
  },
@@ -179,20 +181,20 @@ var R = /*#__PURE__*/ e(ee, [["render", L], ["__file", "C:/softpro/surveyor/cabi
179
181
  {
180
182
  title: "Кваліфікаційний сертифікат",
181
183
  fields: [
182
- l("award", "Номер кваліфікаційного сертифіката", i.certificateNumber),
183
- l("calendar-days", "Дата видачі кваліфікаційного сертифіката", i.certificateDate),
184
- l("graduation-cap", "Назва навчального закладу, на базі якого складався кваліфікаційний іспит та який здійснював підвищення кваліфікації", i.institution),
185
- l("calendar-days", "Дата протоколу рішення Кваліфікаційної комісії про видачу кваліфікаційного сертифіката", i.protocolDate),
186
- l("file-text", "Номер протоколу рішення Кваліфікаційної комісії про видачу кваліфікаційного сертифіката", i.protocolNumber),
187
- l("graduation-cap", "Інформація про підвищення кваліфікації", i.qualificationIncrease),
188
- l("shield-alert", "Інформація щодо зупинення дії чи позбавлення кваліфікаційного сертифіката", i.certificateStopping),
189
- l("pause-circle", "Інформація щодо призупинення дії кваліфікаційного сертифіката", i.certificateSuspension)
184
+ l("award", "Номер кваліфікаційного сертифіката", r.certificateNumber),
185
+ l("calendar-days", "Дата видачі кваліфікаційного сертифіката", r.certificateDate),
186
+ l("graduation-cap", "Назва навчального закладу, на базі якого складався кваліфікаційний іспит та який здійснював підвищення кваліфікації", r.institution),
187
+ l("calendar-days", "Дата протоколу рішення Кваліфікаційної комісії про видачу кваліфікаційного сертифіката", r.protocolDate),
188
+ l("file-text", "Номер протоколу рішення Кваліфікаційної комісії про видачу кваліфікаційного сертифіката", r.protocolNumber),
189
+ l("graduation-cap", "Інформація про підвищення кваліфікації", r.qualificationIncrease),
190
+ l("shield-alert", "Інформація щодо зупинення дії чи позбавлення кваліфікаційного сертифіката", r.certificateStopping),
191
+ l("pause-circle", "Інформація щодо призупинення дії кваліфікаційного сертифіката", r.certificateSuspension)
190
192
  ]
191
193
  }
192
194
  ]),
193
- AppIcon: r,
195
+ AppIcon: i,
194
196
  get currentProfile() {
195
- return i;
197
+ return r;
196
198
  },
197
199
  PasswordModal: R
198
200
  };
@@ -0,0 +1,104 @@
1
+ import { a as e, t } from "./surveyor-CDkI2Dcp.js";
2
+ import { reactive as n } from "vue";
3
+ //#region cabinet/src/api/certificates.ts
4
+ function r(e) {
5
+ if (!e) return "";
6
+ let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
7
+ return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
8
+ }
9
+ async function i(n) {
10
+ let r = await fetch(t(`/api/resource/public_certificates/${encodeURIComponent(n)}`), { credentials: "include" });
11
+ if (!r.ok) throw Error(e(await r.text(), r.status));
12
+ return r.json();
13
+ }
14
+ //#endregion
15
+ //#region cabinet/src/api/profile.ts
16
+ function a() {
17
+ return {
18
+ certificateDate: "",
19
+ certificateNumber: "",
20
+ certificateVerified: !1,
21
+ institution: "",
22
+ protocolDate: "",
23
+ protocolNumber: "",
24
+ qualificationIncrease: "",
25
+ certificateStopping: "",
26
+ certificateSuspension: ""
27
+ };
28
+ }
29
+ function o() {
30
+ return {
31
+ uid: "",
32
+ login: "",
33
+ surName: "",
34
+ userName: "",
35
+ fatherName: "",
36
+ phone: "",
37
+ email: "",
38
+ enabled: !1,
39
+ type: "geodesist",
40
+ organization: "",
41
+ orgAddress: "",
42
+ orgPhone: "",
43
+ orgEmail: "",
44
+ ...a(),
45
+ registry: "Реєстр геодезистів",
46
+ workplace: ""
47
+ };
48
+ }
49
+ var s = n(o());
50
+ function c() {
51
+ Object.assign(s, o());
52
+ }
53
+ function l(e) {
54
+ return [
55
+ e.surName,
56
+ e.userName,
57
+ e.fatherName
58
+ ].filter(Boolean).join(" ");
59
+ }
60
+ function u(e, t) {
61
+ return t ? e.find((e) => e.org_id === t) ?? e[0] : e[0];
62
+ }
63
+ function d(e, t = "") {
64
+ let n = u(e.organizations, t);
65
+ Object.assign(s, {
66
+ uid: e.surveyor_id,
67
+ login: e.email,
68
+ surName: e.last_name,
69
+ userName: e.first_name,
70
+ fatherName: e.middle_name ?? "",
71
+ phone: e.phone ?? "",
72
+ email: e.email,
73
+ enabled: e.enabled,
74
+ type: "geodesist",
75
+ organization: n?.name ?? "",
76
+ orgAddress: n?.legal_address ?? "",
77
+ orgPhone: n?.phone ?? "",
78
+ orgEmail: n?.email ?? "",
79
+ workplace: n?.name ?? ""
80
+ });
81
+ }
82
+ function f(e) {
83
+ if (!e) {
84
+ Object.assign(s, a());
85
+ return;
86
+ }
87
+ Object.assign(s, {
88
+ certificateNumber: e.number_certificate?.trim() ?? "",
89
+ certificateDate: r(e.date_certificate),
90
+ institution: e.name_school?.trim() ?? "",
91
+ protocolDate: r(e.date_protocol),
92
+ protocolNumber: e.number_protocol?.trim() ?? "",
93
+ qualificationIncrease: e.certificate_increase?.trim() ?? "",
94
+ certificateStopping: e.certificate_stopping?.trim() ?? "",
95
+ certificateSuspension: r(e.certificate_suspension),
96
+ certificateVerified: e.isvalid === !0
97
+ });
98
+ }
99
+ function p(e, t) {
100
+ let n = u(e, t);
101
+ n && (s.organization = n.name, s.orgAddress = n.legal_address ?? "", s.orgPhone = n.phone, s.orgEmail = n.email, s.workplace = n.name);
102
+ }
103
+ //#endregion
104
+ export { c as a, l as i, d as n, p as o, s as r, i as s, f as t };
@@ -0,0 +1,102 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { r as t } from "./surveyor-CDkI2Dcp.js";
3
+ import { t as n } from "./AppIcon-CO70tpMX.js";
4
+ import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, openBlock as u, ref as d, toDisplayString as f, vModelText as p, withCtx as m, withDirectives as h, withModifiers as g } from "vue";
5
+ import { RouterLink as _, useRoute as v, useRouter as y } from "vue-router";
6
+ //#region cabinet/src/pages/registration/index.vue?vue&type=script&setup=true&lang.ts
7
+ var b = "Мінімум 8 символів", x = /*@__PURE__*/ l({
8
+ __name: "index",
9
+ setup(e, { expose: i }) {
10
+ i();
11
+ let a = v(), o = y(), s = d(""), c = d(""), l = d(""), u = d(!1), f = r(() => String(a.params.token ?? "").trim());
12
+ function p() {
13
+ return f.value ? s.value.length < 8 ? b : s.value === c.value ? null : "Паролі не збігаються" : "Посилання недійсне: відсутній токен";
14
+ }
15
+ async function m() {
16
+ l.value = "";
17
+ let e = p();
18
+ if (e) {
19
+ l.value = e;
20
+ return;
21
+ }
22
+ u.value = !0;
23
+ try {
24
+ await t(f.value, s.value, c.value), await o.push({
25
+ name: "login",
26
+ query: { registered: "1" }
27
+ });
28
+ } catch (e) {
29
+ l.value = e instanceof Error ? e.message : "Не вдалося завершити реєстрацію";
30
+ } finally {
31
+ u.value = !1;
32
+ }
33
+ }
34
+ let h = {
35
+ route: a,
36
+ router: o,
37
+ password: s,
38
+ passwordConfirmation: c,
39
+ error: l,
40
+ submitting: u,
41
+ token: f,
42
+ passwordHint: b,
43
+ validate: p,
44
+ submit: m,
45
+ AppIcon: n,
46
+ get RouterLink() {
47
+ return _;
48
+ }
49
+ };
50
+ return Object.defineProperty(h, "__isScriptSetup", {
51
+ enumerable: !1,
52
+ value: !0
53
+ }), h;
54
+ }
55
+ }), S = { class: "flex min-h-screen items-center justify-center bg-gradient-to-br from-brand-50 via-white to-slate-100 px-4" }, C = { class: "w-full max-w-md" }, w = { class: "mb-8 text-center" }, T = { class: "mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-100 to-brand-200 shadow-lg shadow-brand-600/20 ring-1 ring-brand-200/60" }, E = { class: "block text-sm font-medium text-slate-700" }, D = { class: "mt-4 block text-sm font-medium text-slate-700" }, O = {
56
+ key: 0,
57
+ class: "mt-4 text-sm text-red-600"
58
+ }, k = ["disabled"], A = { class: "mt-6 text-center text-sm text-slate-500" };
59
+ function j(e, t, n, r, l, d) {
60
+ return u(), a("div", S, [o("div", C, [o("div", w, [
61
+ o("div", T, [c(r.AppIcon, {
62
+ name: "map-pinned",
63
+ class: "h-7 w-7 text-brand-600"
64
+ })]),
65
+ t[2] ||= o("h1", { class: "text-2xl font-semibold text-slate-900" }, "Завершення реєстрації", -1),
66
+ t[3] ||= o("p", { class: "mt-1 text-sm text-slate-500" }, "Встановіть пароль для входу в кабінет геодезиста", -1)
67
+ ]), o("form", {
68
+ class: "rounded-2xl border border-slate-200 bg-white p-8 shadow-sm",
69
+ onSubmit: g(r.submit, ["prevent"])
70
+ }, [
71
+ o("label", E, [t[4] ||= s(" Пароль ", -1), h(o("input", {
72
+ "onUpdate:modelValue": t[0] ||= (e) => r.password = e,
73
+ type: "password",
74
+ autocomplete: "new-password",
75
+ placeholder: r.passwordHint,
76
+ class: "mt-1.5 h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:border-brand-400 focus:ring-1 focus:ring-brand-400"
77
+ }, null, 512), [[p, r.password]])]),
78
+ o("label", D, [t[5] ||= s(" Підтвердження пароля ", -1), h(o("input", {
79
+ "onUpdate:modelValue": t[1] ||= (e) => r.passwordConfirmation = e,
80
+ type: "password",
81
+ autocomplete: "new-password",
82
+ placeholder: "Повторіть пароль",
83
+ class: "mt-1.5 h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:border-brand-400 focus:ring-1 focus:ring-brand-400"
84
+ }, null, 512), [[p, r.passwordConfirmation]])]),
85
+ r.error ? (u(), a("p", O, f(r.error), 1)) : i("", !0),
86
+ o("button", {
87
+ type: "submit",
88
+ class: "mt-4 w-full rounded-xl bg-brand-600 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-60",
89
+ disabled: r.submitting || !r.token
90
+ }, f(r.submitting ? "Збереження…" : "Активувати обліковий запис"), 9, k),
91
+ o("p", A, [t[7] ||= s(" Уже маєте пароль? ", -1), c(r.RouterLink, {
92
+ to: "/login",
93
+ class: "font-medium text-brand-700 hover:text-brand-900 hover:underline"
94
+ }, {
95
+ default: m(() => [...t[6] ||= [s(" Увійти ", -1)]]),
96
+ _: 1
97
+ })])
98
+ ], 32)])]);
99
+ }
100
+ var M = /*#__PURE__*/ e(x, [["render", j], ["__file", "C:/softpro/surveyor/cabinet/src/pages/registration/index.vue"]]);
101
+ //#endregion
102
+ export { M as default };