@opengis/surveyor 0.0.10 → 0.0.12

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.
Files changed (64) hide show
  1. package/dist/chunks/{AppIcon-Di5F4Bu_.js → AppIcon-CO70tpMX.js} +1 -1
  2. package/dist/chunks/{AppealDetailField-DNpsGpPY.js → AppealDetailField-DNRGpnyD.js} +2 -2
  3. package/dist/chunks/{AppealStatusBadge-z77wwkFD.js → AppealStatusBadge-BlAaNUSK.js} +2 -2
  4. package/dist/chunks/{AppealStatusBadge-MP1qD952.js → AppealStatusBadge-Ct3EcB4_.js} +15 -1
  5. package/dist/chunks/{ApplicationHistorySection-DIoFZwH6.js → ApplicationHistorySection-D7KPV2cX.js} +155 -141
  6. package/dist/chunks/{BaseModal-DP_ilBdg.js → BaseModal-SjP521X9.js} +2 -2
  7. package/dist/chunks/{FormFilePicker-D5fAUE0Z.js → FormFilePicker-DxPQlxgy.js} +2 -2
  8. package/dist/chunks/{MapLayerMenu-CI5cbLEC.js → MapLayerMenu-AUeTqgEp.js} +1 -1
  9. package/dist/chunks/{RegistryForm-DbCxZsr0.js → RegistryForm-BlK1lExt.js} +2 -2
  10. package/dist/chunks/{RegistryFormModal-D_KLGj2d.js → RegistryFormModal-DhzEpxys.js} +3 -3
  11. package/dist/chunks/{RegistryToolbar-DvbrASlj.js → RegistryToolbar-DXOEcD84.js} +45 -154
  12. package/dist/chunks/{SurveyorTeleport-D6-KXe_5.js → SurveyorTeleport-CnSF0Ptl.js} +1 -1
  13. package/dist/chunks/TablePagination-CUtnDQQ_.js +116 -0
  14. package/dist/chunks/{UserAccessBadge-B5Q1LvNv.js → UserAccessBadge-DyZDv7Oo.js} +1 -1
  15. package/dist/chunks/{UserTypeBadge-CuAMctTK.js → UserTypeBadge-LvnMuKGo.js} +1 -1
  16. package/dist/chunks/{VerifiedBadge-D6L7mCdp.js → VerifiedBadge-bk0n-rlC.js} +2 -2
  17. package/dist/chunks/{buildSchema-CccjX9TJ.js → buildSchema-DEfhZEM8.js} +1 -1
  18. package/dist/chunks/{card-ylC5NYbz.js → card-BBx1zR0E.js} +316 -306
  19. package/dist/chunks/{card-BsTSF6aL.js → card-Bj4zFzbe.js} +47 -44
  20. package/dist/chunks/{card-CI7ntIHf.js → card-C-ohjNkC.js} +5 -5
  21. package/dist/chunks/{card--XUb1kFK.js → card-DEJs9IIP.js} +6 -6
  22. package/dist/chunks/card-VnUCFC7v.js +609 -0
  23. package/dist/chunks/{card-BrjnXf1N.js → card-_YyJbLNI.js} +13 -10
  24. package/dist/chunks/{certificates-BnseQylH.js → certificates-Be6u7Cix.js} +1 -1
  25. package/dist/chunks/{certificates-aJ-hvaP-.js → certificates-DtfZTFN9.js} +13 -12
  26. package/dist/chunks/{create-Bi7-j9Ri.js → create-Cgeu7aKO.js} +348 -293
  27. package/dist/chunks/{filterQuery-CvfZrkTC.js → filterQuery-Dka-mIso.js} +7 -3
  28. package/dist/chunks/{forgot-DnixBqdc.js → forgot-DoG6vXhq.js} +2 -2
  29. package/dist/chunks/{form-DDjELqZ9.js → form-CEfc_shb.js} +1 -1
  30. package/dist/chunks/{form-Bh6i5n1U.js → form-DZ3CbtkT.js} +1 -1
  31. package/dist/chunks/{login-BWCQdEkv.js → login-BWGylcSU.js} +2 -2
  32. package/dist/chunks/{map-CwsVIW79.js → map-DkKsEnCM.js} +1126 -831
  33. package/dist/chunks/{map-layers-BLiEYC4C.js → map-layers-BmuIMLHa.js} +13 -12
  34. package/dist/chunks/{organizations-mc6FlSwe.js → organizations-BO1dIl7v.js} +15 -14
  35. package/dist/chunks/{profile-F7mr0poI.js → profile-CkwMFh82.js} +3 -3
  36. package/dist/chunks/{registration-BRF4985_.js → registration-3GLgq-ae.js} +2 -2
  37. package/dist/chunks/{requests-7pD2ckdx.js → requests-BZ2jrt5J.js} +12 -11
  38. package/dist/chunks/{requests-BCJN-CNx.js → requests-rWq8ok3C.js} +5 -5
  39. package/dist/chunks/{resendSurveyorRegistration-BHTTVIw1.js → resendSurveyorRegistration-BQjL9IgM.js} +1 -1
  40. package/dist/chunks/{reset-OZCgLi6f.js → reset-CP9LsLkC.js} +2 -2
  41. package/dist/chunks/{resources-2e8RFqWR.js → resources-Cj8BzrBX.js} +18 -13
  42. package/dist/chunks/{surveyorAccount-C7UiiIYg.js → surveyorAccount-Cfba7ZVZ.js} +1 -1
  43. package/dist/chunks/{useEntityPath-8s0Y1tjA.js → useEntityPath-C5Owtidc.js} +1 -1
  44. package/dist/chunks/{users-CAEjpaI1.js → users-DOiQeVwn.js} +15 -14
  45. package/dist/index.css +1 -1
  46. package/dist/index.js +40 -40
  47. package/migrations/20261016120000_map_layers.sql +156 -156
  48. package/migrations/20261016150000_password_reset.sql +15 -15
  49. package/migrations/20261016180000_settlement_lookup.sql +16 -16
  50. package/package.json +1 -1
  51. package/server/dictionaries/index.ts +17 -17
  52. package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
  53. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
  54. package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
  55. package/server/modules/surveyor/services/mapLayers.ts +61 -61
  56. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -52
  57. package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -53
  58. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
  59. package/server/plugins/convertVector.ts +1 -1
  60. package/server/resources/helpers/settlement_lookup.ts +7 -7
  61. package/server/resources/surveyor-admin/map_layers.ts +69 -69
  62. package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
  63. package/server/resources/surveyor-admin/organizations.ts +61 -61
  64. package/dist/chunks/card-Cu8QOSIw.js +0 -539
@@ -1,21 +1,21 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { n as t, t as n } from "./useEntityPath-8s0Y1tjA.js";
3
- import { a as r, o as i } from "./resources-2e8RFqWR.js";
4
- import { t as a } from "./VerifiedBadge-D6L7mCdp.js";
5
- import { t as o } from "./UserAccessBadge-B5Q1LvNv.js";
6
- import { n as s, t as c } from "./AppealDetailField-DNpsGpPY.js";
7
- import { i as l, r as u, t as d } from "./surveyorAccount-C7UiiIYg.js";
8
- import { t as f } from "./SurveyorTeleport-D6-KXe_5.js";
9
- import { t as p } from "./BaseModal-DP_ilBdg.js";
10
- import { t as m } from "./RegistryForm-DbCxZsr0.js";
11
- import { n as h } from "./certificates-BnseQylH.js";
12
- import { n as g, t as _ } from "./resendSurveyorRegistration-BHTTVIw1.js";
13
- import { t as v } from "./form-DDjELqZ9.js";
14
- import { Fragment as y, computed as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as w, createTextVNode as T, createVNode as E, defineComponent as D, normalizeClass as O, normalizeStyle as k, onMounted as ee, onUnmounted as te, openBlock as A, ref as j, renderList as M, toDisplayString as N, vModelText as P, watch as F, withCtx as I, withDirectives as L, withModifiers as R } from "vue";
15
- import { RouterLink as z, useRoute as B, useRouter as V } from "vue-router";
16
- import { confirm as ne, notify as H } from "@opengis/core";
2
+ import { n as t, t as n } from "./useEntityPath-C5Owtidc.js";
3
+ import { c as r, s as i } from "./resources-Cj8BzrBX.js";
4
+ import { t as a } from "./VerifiedBadge-bk0n-rlC.js";
5
+ import { t as o } from "./UserAccessBadge-DyZDv7Oo.js";
6
+ import { n as s, t as c } from "./AppealDetailField-DNRGpnyD.js";
7
+ import { i as ee, r as l, t as u } from "./surveyorAccount-Cfba7ZVZ.js";
8
+ import { t as d } from "./SurveyorTeleport-CnSF0Ptl.js";
9
+ import { t as f } from "./BaseModal-SjP521X9.js";
10
+ import { t as p } from "./RegistryForm-BlK1lExt.js";
11
+ import { n as m } from "./certificates-Be6u7Cix.js";
12
+ import { n as h, t as g } from "./resendSurveyorRegistration-BQjL9IgM.js";
13
+ import { t as _ } from "./form-CEfc_shb.js";
14
+ import { Fragment as v, computed as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, defineComponent as E, normalizeClass as D, normalizeStyle as O, onMounted as te, onUnmounted as ne, openBlock as k, ref as A, renderList as j, resolveComponent as M, toDisplayString as N, vModelText as P, watch as F, withCtx as I, withDirectives as L, withModifiers as R } from "vue";
15
+ import { RouterLink as z, useRoute as B, useRouter as re } from "vue-router";
16
+ import { confirm as ie, notify as V } from "@opengis/core";
17
17
  //#region admin/src/components/ui/ValidityBadge.vue?vue&type=script&setup=true&lang.ts
18
- var U = /*@__PURE__*/ D({
18
+ var H = /*@__PURE__*/ E({
19
19
  __name: "ValidityBadge",
20
20
  props: { validity: {
21
21
  type: [String, null],
@@ -25,7 +25,7 @@ var U = /*@__PURE__*/ D({
25
25
  t();
26
26
  let n = e, r = {
27
27
  props: n,
28
- config: b(() => h[n.validity ?? ""] ?? h.no_data)
28
+ config: y(() => m[n.validity ?? ""] ?? m.no_data)
29
29
  };
30
30
  return Object.defineProperty(r, "__isScriptSetup", {
31
31
  enumerable: !1,
@@ -35,14 +35,14 @@ var U = /*@__PURE__*/ D({
35
35
  });
36
36
  //#endregion
37
37
  //#region admin/src/components/ui/ValidityBadge.vue
38
- function W(e, t, n, r, i, a) {
39
- return A(), S("span", { class: O(["inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium", [
38
+ function U(e, t, n, r, i, a) {
39
+ return k(), x("span", { class: D(["inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium", [
40
40
  r.config.bg,
41
41
  r.config.text,
42
42
  r.config.border
43
- ]]) }, [C("span", { class: O(["h-1.5 w-1.5 rounded-full", r.config.dot]) }, null, 2), T(" " + N(r.config.label), 1)], 2);
43
+ ]]) }, [S("span", { class: D(["h-1.5 w-1.5 rounded-full", r.config.dot]) }, null, 2), w(" " + N(r.config.label), 1)], 2);
44
44
  }
45
- var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/softpro/surveyor/admin/src/components/ui/ValidityBadge.vue"]]), ie = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors focus:border-brand-400 focus:ring-1 focus:ring-brand-400", G = /*@__PURE__*/ D({
45
+ var ae = /*#__PURE__*/ e(H, [["render", U], ["__file", "C:/softpro/surveyor/admin/src/components/ui/ValidityBadge.vue"]]), oe = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors focus:border-brand-400 focus:ring-1 focus:ring-brand-400", W = /*@__PURE__*/ E({
46
46
  __name: "OrganizationUsers",
47
47
  props: {
48
48
  orgId: {
@@ -61,126 +61,126 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/softpro/surveyor/admi
61
61
  emits: ["changed"],
62
62
  setup(e, { expose: n, emit: a }) {
63
63
  n();
64
- let s = e, c = a, m = j(null), v = j({
64
+ let s = e, c = a, p = A(null), _ = A({
65
65
  top: "0px",
66
66
  left: "0px"
67
- }), y = j(null), x = j(null), S = j(!1), C = j(null), w = j(""), T = j(""), E = j([]), D = j(!1), O = j(null), k = j(""), A = j(""), M = j({
67
+ }), v = A(null), b = A(null), x = A(!1), S = A(null), C = A(""), w = A(""), T = A([]), E = A(!1), D = A(null), O = A(""), k = A(""), j = A({
68
68
  last_name: "",
69
69
  first_name: "",
70
70
  middle_name: "",
71
71
  phone: ""
72
- }), N = 0, P = b(() => y.value === "add" ? "Додати користувача" : y.value === "edit" ? "Редагувати користувача" : ""), F = b(() => O.value?.certificate_status === "valid"), I = b(() => h[O.value?.certificate_status ?? ""]?.label ?? ""), L = b(() => O.value?.account_registered_at ? O.value : null);
73
- function R(e) {
72
+ }), M = 0, N = y(() => v.value === "add" ? "Додати користувача" : v.value === "edit" ? "Редагувати користувача" : ""), P = y(() => D.value?.certificate_status === "valid"), F = y(() => m[D.value?.certificate_status ?? ""]?.label ?? ""), I = y(() => D.value?.account_registered_at ? D.value : null);
73
+ function L(e) {
74
74
  return [
75
75
  e.last_name,
76
76
  e.first_name,
77
77
  e.middle_name
78
78
  ].filter(Boolean).join(" ") || "—";
79
79
  }
80
- function z(e) {
80
+ function R(e) {
81
81
  let t = e.certificate_id_data?.text;
82
82
  return t ? `№ ${t}` : "—";
83
83
  }
84
- function B(e) {
84
+ function z(e) {
85
85
  let t = e.text?.trim() ?? "", n = e.number_certificate?.trim();
86
86
  return n && t.endsWith(n) ? t.slice(0, -n.length).trim() || "—" : t || "—";
87
87
  }
88
- function V(e) {
88
+ function B(e) {
89
89
  return e.membership_enabled !== !1;
90
90
  }
91
- function U(e, t) {
92
- if (m.value === e) {
93
- m.value = null;
91
+ function re(e, t) {
92
+ if (p.value === e) {
93
+ p.value = null;
94
94
  return;
95
95
  }
96
- let n = t.currentTarget.getBoundingClientRect(), r = s.users.find((t) => t.surveyor_id === e), i = (2 + (r && _(r) ? 1 : 0) + (r && d(r) ? 1 : 0)) * 44 + 8, a = window.innerHeight - n.bottom < i + 8 ? n.top - i - 4 : n.bottom + 4, o = Math.min(Math.max(8, n.right - 256), window.innerWidth - 256 - 8);
97
- v.value = {
96
+ let n = t.currentTarget.getBoundingClientRect(), r = s.users.find((t) => t.surveyor_id === e), i = (2 + (r && g(r) ? 1 : 0) + (r && u(r) ? 1 : 0)) * 44 + 8, a = window.innerHeight - n.bottom < i + 8 ? n.top - i - 4 : n.bottom + 4, o = Math.min(Math.max(8, n.right - 256), window.innerWidth - 256 - 8);
97
+ _.value = {
98
98
  top: `${a}px`,
99
99
  left: `${o}px`
100
- }, m.value = e;
100
+ }, p.value = e;
101
101
  }
102
- function W(e) {
102
+ function H(e) {
103
103
  let t = e?.target;
104
- t instanceof Element && t.closest("[data-user-menu]") || (m.value = null);
104
+ t instanceof Element && t.closest("[data-user-menu]") || (p.value = null);
105
105
  }
106
- function G() {
107
- y.value = null, x.value = null, w.value = "";
106
+ function U() {
107
+ v.value = null, b.value = null, C.value = "";
108
108
  }
109
- function K() {
110
- T.value = "", E.value = [], Y.value = !1, O.value = null, k.value = "", A.value = "", w.value = "", y.value = "add";
109
+ function W() {
110
+ w.value = "", T.value = [], q.value = !1, D.value = null, O.value = "", k.value = "", C.value = "", v.value = "add";
111
111
  }
112
- function q(e) {
113
- m.value = null, x.value = e, M.value = {
112
+ function G(e) {
113
+ p.value = null, b.value = e, j.value = {
114
114
  last_name: e.last_name ?? "",
115
115
  first_name: e.first_name ?? "",
116
116
  middle_name: e.middle_name ?? "",
117
117
  phone: e.phone ?? ""
118
- }, w.value = "", y.value = "edit";
118
+ }, C.value = "", v.value = "edit";
119
119
  }
120
- function J(e, t) {
121
- w.value = e instanceof Error ? e.message : t;
120
+ function K(e, t) {
121
+ C.value = e instanceof Error ? e.message : t;
122
122
  }
123
- let Y = j(!1), X = 0;
124
- async function Z() {
125
- let e = T.value.trim(), t = ++X;
126
- if (O.value = null, Y.value = e.length >= 2, e.length < 2) {
127
- E.value = [], D.value = !1;
123
+ let q = A(!1), J = 0;
124
+ async function Y() {
125
+ let e = w.value.trim(), t = ++J;
126
+ if (D.value = null, q.value = e.length >= 2, e.length < 2) {
127
+ T.value = [], E.value = !1;
128
128
  return;
129
129
  }
130
- D.value = !0;
130
+ E.value = !0;
131
131
  try {
132
- let n = await r(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
133
- if (t !== X) return;
134
- E.value = (n.data ?? []).map((e) => ({
132
+ let n = await i(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
133
+ if (t !== J) return;
134
+ T.value = (n.data ?? []).map((e) => ({
135
135
  ...e,
136
136
  certificate_id: e.id
137
137
  }));
138
138
  } catch (e) {
139
- if (t !== X) return;
140
- E.value = [], J(e, "Не вдалося знайти сертифікати");
139
+ if (t !== J) return;
140
+ T.value = [], K(e, "Не вдалося знайти сертифікати");
141
141
  } finally {
142
- t === X && (D.value = !1);
142
+ t === J && (E.value = !1);
143
143
  }
144
144
  }
145
- function ae() {
146
- window.clearTimeout(N), N = window.setTimeout(() => void Z(), 300);
145
+ function X() {
146
+ window.clearTimeout(M), M = window.setTimeout(() => void Y(), 300);
147
147
  }
148
- function oe(e) {
149
- O.value = e, E.value = [], T.value = e.text?.trim() || e.number_certificate || "", k.value = e.account_email || e.surveyor_email || "", A.value = e.account_registered_at ? "" : e.account_phone || e.surveyor_phone || "", w.value = "";
148
+ function Z(e) {
149
+ D.value = e, T.value = [], w.value = e.text?.trim() || e.number_certificate || "", O.value = e.account_email || e.surveyor_email || "", k.value = e.account_registered_at ? "" : e.account_phone || e.surveyor_phone || "", C.value = "";
150
150
  }
151
151
  async function se() {
152
- let e = O.value;
153
- if (!e || S.value) return;
154
- if (!F.value) {
155
- w.value = "Додати користувача можна лише за дійсним сертифікатом";
152
+ let e = D.value;
153
+ if (!e || x.value) return;
154
+ if (!P.value) {
155
+ C.value = "Додати користувача можна лише за дійсним сертифікатом";
156
156
  return;
157
157
  }
158
158
  if (e.account_id && s.users.some((t) => t.surveyor_id === e.account_id)) {
159
- w.value = "Цей користувач уже є в організації";
159
+ C.value = "Цей користувач уже є в організації";
160
160
  return;
161
161
  }
162
- let t = k.value.trim().toLowerCase();
162
+ let t = O.value.trim().toLowerCase();
163
163
  if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)) {
164
- w.value = "Вкажіть коректний email";
164
+ C.value = "Вкажіть коректний email";
165
165
  return;
166
166
  }
167
- let n = L.value;
167
+ let n = I.value;
168
168
  if (n && t !== (n.account_email ?? "").trim().toLowerCase()) {
169
- w.value = "Email не збігається з email облікового запису цього сертифіката";
169
+ C.value = "Email не збігається з email облікового запису цього сертифіката";
170
170
  return;
171
171
  }
172
- S.value = !0, w.value = "";
172
+ x.value = !0, C.value = "";
173
173
  try {
174
- let i = await r("/api/surveyor/surveyors", {
174
+ let r = await i("/api/surveyor/surveyors", {
175
175
  method: "POST",
176
176
  body: JSON.stringify({
177
177
  organization_id: s.orgId,
178
178
  certificate_id: e.certificate_id,
179
179
  email: t,
180
- ...n ? {} : { phone: A.value.trim() }
180
+ ...n ? {} : { phone: k.value.trim() }
181
181
  })
182
182
  });
183
- H(i.registration_status === "attached" ? {
183
+ V(r.registration_status === "attached" ? {
184
184
  type: "success",
185
185
  title: "Користувача додано",
186
186
  message: "Наявний обліковий запис прикріплено до організації"
@@ -188,136 +188,136 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/softpro/surveyor/admi
188
188
  type: "success",
189
189
  title: "Користувача додано",
190
190
  message: "На email надіслано лист для завершення реєстрації"
191
- }), G(), c("changed");
191
+ }), U(), c("changed");
192
192
  } catch (e) {
193
- J(e, "Не вдалося додати користувача");
193
+ K(e, "Не вдалося додати користувача");
194
194
  } finally {
195
- S.value = !1;
195
+ x.value = !1;
196
196
  }
197
197
  }
198
198
  async function ce(e) {
199
- if (!C.value) {
200
- m.value = null, C.value = e.surveyor_id;
199
+ if (!S.value) {
200
+ p.value = null, S.value = e.surveyor_id;
201
201
  try {
202
- await g(e.surveyor_id);
202
+ await h(e.surveyor_id);
203
203
  } finally {
204
- C.value = null;
204
+ S.value = null;
205
205
  }
206
206
  }
207
207
  }
208
208
  function le(e) {
209
- d(e) && (m.value = null, ne({
209
+ u(e) && (p.value = null, ie({
210
210
  title: "Зміна пароля",
211
211
  type: "warning",
212
- message: `Згенерувати новий пароль для «${R(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
212
+ message: `Згенерувати новий пароль для «${L(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
213
213
  confirmButtonText: "Згенерувати",
214
214
  cancelButtonText: "Скасувати",
215
- onConfirm: () => u(e.surveyor_id)
215
+ onConfirm: () => l(e.surveyor_id)
216
216
  }));
217
217
  }
218
218
  function ue(e) {
219
- m.value = null;
220
- let t = !V(e);
221
- ne({
219
+ p.value = null;
220
+ let t = !B(e);
221
+ ie({
222
222
  title: t ? "Активація" : "Деактивація",
223
223
  type: t ? "warning" : "error",
224
- message: t ? `Активувати користувача «${R(e)}»?` : `Деактивувати користувача «${R(e)}» в організації «${s.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
224
+ message: t ? `Активувати користувача «${L(e)}»?` : `Деактивувати користувача «${L(e)}» в організації «${s.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
225
225
  confirmButtonText: t ? "Активувати" : "Деактивувати",
226
226
  cancelButtonText: "Скасувати",
227
227
  onConfirm: async () => {
228
- await l(e.surveyor_id, s.orgId, t) && c("changed");
228
+ await ee(e.surveyor_id, s.orgId, t) && c("changed");
229
229
  }
230
230
  });
231
231
  }
232
232
  async function Q() {
233
- if (!x.value || S.value) return;
233
+ if (!b.value || x.value) return;
234
234
  let e = {
235
- last_name: M.value.last_name.trim(),
236
- first_name: M.value.first_name.trim(),
237
- middle_name: M.value.middle_name.trim(),
238
- phone: M.value.phone.trim()
235
+ last_name: j.value.last_name.trim(),
236
+ first_name: j.value.first_name.trim(),
237
+ middle_name: j.value.middle_name.trim(),
238
+ phone: j.value.phone.trim()
239
239
  };
240
240
  if (!e.last_name || !e.first_name) {
241
- w.value = "Прізвище та імʼя обовʼязкові";
241
+ C.value = "Прізвище та імʼя обовʼязкові";
242
242
  return;
243
243
  }
244
- S.value = !0, w.value = "";
244
+ x.value = !0, C.value = "";
245
245
  try {
246
- await i("surveyors", x.value.surveyor_id, e), G(), c("changed");
246
+ await r("surveyors", b.value.surveyor_id, e), U(), c("changed");
247
247
  } catch (e) {
248
- J(e, "Не вдалося зберегти користувача");
248
+ K(e, "Не вдалося зберегти користувача");
249
249
  } finally {
250
- S.value = !1;
250
+ x.value = !1;
251
251
  }
252
252
  }
253
- ee(() => {
254
- document.addEventListener("click", W), window.addEventListener("resize", W), window.addEventListener("scroll", W, !0);
255
- }), te(() => {
256
- window.clearTimeout(N), document.removeEventListener("click", W), window.removeEventListener("resize", W), window.removeEventListener("scroll", W, !0);
253
+ te(() => {
254
+ document.addEventListener("click", H), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0);
255
+ }), ne(() => {
256
+ window.clearTimeout(M), document.removeEventListener("click", H), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
257
257
  });
258
258
  let $ = {
259
259
  props: s,
260
260
  emit: c,
261
- fieldClass: ie,
262
- openMenuId: m,
263
- menuStyle: v,
264
- dialog: y,
265
- activeUser: x,
266
- saving: S,
267
- resendingId: C,
268
- formError: w,
269
- certificateQuery: T,
270
- certificates: E,
271
- certificatesLoading: D,
272
- selectedCertificate: O,
273
- addEmail: k,
274
- addPhone: A,
275
- editDraft: M,
261
+ fieldClass: oe,
262
+ openMenuId: p,
263
+ menuStyle: _,
264
+ dialog: v,
265
+ activeUser: b,
266
+ saving: x,
267
+ resendingId: S,
268
+ formError: C,
269
+ certificateQuery: w,
270
+ certificates: T,
271
+ certificatesLoading: E,
272
+ selectedCertificate: D,
273
+ addEmail: O,
274
+ addPhone: k,
275
+ editDraft: j,
276
276
  get searchTimer() {
277
- return N;
277
+ return M;
278
278
  },
279
279
  set searchTimer(e) {
280
- N = e;
280
+ M = e;
281
281
  },
282
- dialogTitle: P,
283
- selectedAvailable: F,
284
- selectedStatusLabel: I,
285
- registeredAccount: L,
286
- personName: R,
287
- certificateLabel: z,
288
- certificatePerson: B,
289
- membershipEnabled: V,
290
- toggleMenu: U,
291
- closeMenu: W,
292
- closeDialog: G,
293
- openAdd: K,
294
- openEdit: q,
295
- fail: J,
296
- searched: Y,
282
+ dialogTitle: N,
283
+ selectedAvailable: P,
284
+ selectedStatusLabel: F,
285
+ registeredAccount: I,
286
+ personName: L,
287
+ certificateLabel: R,
288
+ certificatePerson: z,
289
+ membershipEnabled: B,
290
+ toggleMenu: re,
291
+ closeMenu: H,
292
+ closeDialog: U,
293
+ openAdd: W,
294
+ openEdit: G,
295
+ fail: K,
296
+ searched: q,
297
297
  get searchSeq() {
298
- return X;
298
+ return J;
299
299
  },
300
300
  set searchSeq(e) {
301
- X = e;
301
+ J = e;
302
302
  },
303
- searchCertificates: Z,
304
- onCertificateInput: ae,
305
- chooseCertificate: oe,
303
+ searchCertificates: Y,
304
+ onCertificateInput: X,
305
+ chooseCertificate: Z,
306
306
  submitAdd: se,
307
307
  resendRegistrationInvite: ce,
308
308
  resetPassword: le,
309
309
  toggleAccess: ue,
310
310
  submitEdit: Q,
311
311
  AppIcon: t,
312
- SurveyorTeleport: f,
313
- BaseModal: p,
312
+ SurveyorTeleport: d,
313
+ BaseModal: f,
314
314
  UserAccessBadge: o,
315
- ValidityBadge: re,
315
+ ValidityBadge: ae,
316
316
  get canResendSurveyorRegistration() {
317
- return _;
317
+ return g;
318
318
  },
319
319
  get canResetSurveyorPassword() {
320
- return d;
320
+ return u;
321
321
  }
322
322
  };
323
323
  return Object.defineProperty($, "__isScriptSetup", {
@@ -325,7 +325,7 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/softpro/surveyor/admi
325
325
  value: !0
326
326
  }), $;
327
327
  }
328
- }), K = { class: "rounded-xl border border-slate-200 bg-white shadow-card" }, q = { class: "flex items-center justify-between gap-2.5 border-b border-slate-100 px-5 py-3.5" }, J = { class: "flex items-center gap-2.5" }, Y = { class: "text-brand-600" }, X = { class: "overflow-x-auto" }, Z = { class: "w-full min-w-[1080px] table-fixed text-left text-[13px]" }, ae = { class: "divide-y divide-slate-100" }, oe = { class: "px-5 py-3.5" }, se = { class: "font-semibold text-slate-800" }, ce = {
328
+ }), G = { class: "rounded-xl border border-slate-200 bg-white shadow-card" }, K = { class: "flex items-center justify-between gap-2.5 border-b border-slate-100 px-5 py-3.5" }, q = { class: "flex items-center gap-2.5" }, J = { class: "text-brand-600" }, Y = { class: "overflow-x-auto" }, X = { class: "w-full min-w-[1080px] table-fixed text-left text-[13px]" }, Z = { class: "divide-y divide-slate-100" }, se = { class: "px-5 py-3.5" }, ce = {
329
329
  key: 0,
330
330
  class: "mt-1 text-xs text-slate-400"
331
331
  }, le = { class: "px-5 py-3.5 leading-snug text-slate-600" }, ue = { class: "px-5 py-3.5 leading-snug text-slate-600" }, Q = { class: "px-5 py-3.5 text-slate-600" }, $ = { class: "px-5 py-3.5" }, de = { class: "px-5 py-3.5 text-center" }, fe = [
@@ -364,108 +364,118 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/softpro/surveyor/admi
364
364
  class: "mt-3 text-sm text-red-600"
365
365
  }, Re = { class: "flex justify-end gap-3" }, ze = ["disabled"], Be = ["disabled"];
366
366
  function Ve(e, t, n, r, i, a) {
367
- return A(), S("section", K, [
368
- C("header", q, [C("div", J, [C("span", Y, [E(r.AppIcon, {
367
+ let o = M("RouterLink");
368
+ return k(), x("section", G, [
369
+ S("header", K, [S("div", q, [S("span", J, [T(r.AppIcon, {
369
370
  name: "users",
370
371
  class: "h-[18px] w-[18px]"
371
- })]), t[9] ||= C("h2", { class: "text-[15px] font-semibold text-slate-800" }, "Користувачі", -1)]), C("button", {
372
+ })]), t[9] ||= S("h2", { class: "text-[15px] font-semibold text-slate-800" }, "Користувачі", -1)]), S("button", {
372
373
  type: "button",
373
374
  class: "inline-flex h-8 items-center gap-1.5 rounded-lg bg-brand-600 px-3 text-[13px] font-semibold text-white shadow-sm transition-colors hover:bg-brand-700",
374
375
  onClick: r.openAdd
375
- }, [E(r.AppIcon, {
376
+ }, [T(r.AppIcon, {
376
377
  name: "plus",
377
378
  class: "h-3.5 w-3.5"
378
- }), t[10] ||= T(" Додати користувача ", -1)])]),
379
- C("div", X, [C("table", Z, [
380
- t[14] ||= C("colgroup", null, [
381
- C("col", { class: "w-[24%]" }),
382
- C("col", { class: "w-[17%]" }),
383
- C("col", { class: "w-[20%]" }),
384
- C("col", { class: "w-[15%]" }),
385
- C("col", { class: "w-[12%]" }),
386
- C("col", { class: "w-[12%]" })
379
+ }), t[10] ||= w(" Додати користувача ", -1)])]),
380
+ S("div", Y, [S("table", X, [
381
+ t[14] ||= S("colgroup", null, [
382
+ S("col", { class: "w-[24%]" }),
383
+ S("col", { class: "w-[17%]" }),
384
+ S("col", { class: "w-[20%]" }),
385
+ S("col", { class: "w-[15%]" }),
386
+ S("col", { class: "w-[12%]" }),
387
+ S("col", { class: "w-[12%]" })
387
388
  ], -1),
388
- t[15] ||= C("thead", { class: "bg-slate-50 text-xs font-semibold text-slate-500" }, [C("tr", null, [
389
- C("th", { class: "px-5 py-3" }, "ПІБ"),
390
- C("th", { class: "px-5 py-3" }, "Дата видачі та номер сертифіката"),
391
- C("th", { class: "px-5 py-3" }, "Email та номер телефону"),
392
- C("th", { class: "px-5 py-3" }, "Місце роботи"),
393
- C("th", { class: "px-5 py-3" }, "Статус"),
394
- C("th", { class: "px-5 py-3 text-center" }, "Дії")
389
+ t[15] ||= S("thead", { class: "bg-slate-50 text-xs font-semibold text-slate-500" }, [S("tr", null, [
390
+ S("th", { class: "px-5 py-3" }, "ПІБ"),
391
+ S("th", { class: "px-5 py-3" }, "Дата видачі та номер сертифіката"),
392
+ S("th", { class: "px-5 py-3" }, "Email та номер телефону"),
393
+ S("th", { class: "px-5 py-3" }, "Місце роботи"),
394
+ S("th", { class: "px-5 py-3" }, "Статус"),
395
+ S("th", { class: "px-5 py-3 text-center" }, "Дії")
395
396
  ])], -1),
396
- C("tbody", ae, [(A(!0), S(y, null, M(n.users, (e) => (A(), S("tr", {
397
+ S("tbody", Z, [(k(!0), x(v, null, j(n.users, (e) => (k(), x("tr", {
397
398
  key: e.surveyor_id,
398
399
  class: "align-top transition-colors hover:bg-brand-50/40"
399
400
  }, [
400
- C("td", oe, [C("p", se, N(r.personName(e)), 1), e.registered_at ? x("", !0) : (A(), S("p", ce, "Реєстрацію не завершено"))]),
401
- C("td", le, N(r.certificateLabel(e)), 1),
402
- C("td", ue, [C("p", null, N(e.email || "—"), 1), C("p", null, N(e.phone || "—"), 1)]),
403
- C("td", Q, N(n.orgName), 1),
404
- C("td", $, [E(r.UserAccessBadge, {
401
+ S("td", se, [T(o, {
402
+ to: {
403
+ name: "surveyor-detail",
404
+ params: { id: e.surveyor_id }
405
+ },
406
+ class: "font-semibold text-brand-700 hover:text-brand-900 hover:underline"
407
+ }, {
408
+ default: I(() => [w(N(r.personName(e)), 1)]),
409
+ _: 2
410
+ }, 1032, ["to"]), e.registered_at ? b("", !0) : (k(), x("p", ce, "Реєстрацію не завершено"))]),
411
+ S("td", le, N(r.certificateLabel(e)), 1),
412
+ S("td", ue, [S("p", null, N(e.email || "—"), 1), S("p", null, N(e.phone || "—"), 1)]),
413
+ S("td", Q, N(n.orgName), 1),
414
+ S("td", $, [T(r.UserAccessBadge, {
405
415
  "account-blocked": e.enabled === !1,
406
416
  "membership-disabled": !r.membershipEnabled(e)
407
417
  }, null, 8, ["account-blocked", "membership-disabled"])]),
408
- C("td", de, [C("button", {
418
+ S("td", de, [S("button", {
409
419
  type: "button",
410
420
  "data-user-menu": "",
411
421
  class: "inline-flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-brand-50 hover:text-brand-700",
412
422
  "aria-label": `Дії для ${r.personName(e)}`,
413
423
  "aria-expanded": r.openMenuId === e.surveyor_id,
414
424
  onClick: R((t) => r.toggleMenu(e.surveyor_id, t), ["stop"])
415
- }, [E(r.AppIcon, {
425
+ }, [T(r.AppIcon, {
416
426
  name: "more-vertical",
417
427
  class: "h-4 w-4"
418
- })], 8, fe), E(r.SurveyorTeleport, null, {
419
- default: I(() => [r.openMenuId === e.surveyor_id ? (A(), S("div", {
428
+ })], 8, fe), T(r.SurveyorTeleport, null, {
429
+ default: I(() => [r.openMenuId === e.surveyor_id ? (k(), x("div", {
420
430
  key: 0,
421
431
  "data-user-menu": "",
422
432
  class: "fixed z-50 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover",
423
- style: k(r.menuStyle)
433
+ style: O(r.menuStyle)
424
434
  }, [
425
- C("button", {
435
+ S("button", {
426
436
  type: "button",
427
437
  class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
428
438
  onClick: (t) => r.openEdit(e)
429
- }, [E(r.AppIcon, {
439
+ }, [T(r.AppIcon, {
430
440
  name: "pencil",
431
441
  class: "h-4 w-4 text-slate-400"
432
- }), t[11] ||= T(" Редагувати ", -1)], 8, pe),
433
- r.canResendSurveyorRegistration(e) ? (A(), S("button", {
442
+ }), t[11] ||= w(" Редагувати ", -1)], 8, pe),
443
+ r.canResendSurveyorRegistration(e) ? (k(), x("button", {
434
444
  key: 0,
435
445
  type: "button",
436
446
  class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-60",
437
447
  disabled: r.resendingId === e.surveyor_id,
438
448
  onClick: (t) => r.resendRegistrationInvite(e)
439
- }, [E(r.AppIcon, {
449
+ }, [T(r.AppIcon, {
440
450
  name: "send",
441
451
  class: "h-4 w-4 shrink-0 text-slate-400"
442
- }), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, me)) : x("", !0),
443
- r.canResetSurveyorPassword(e) ? (A(), S("button", {
452
+ }), w(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, me)) : b("", !0),
453
+ r.canResetSurveyorPassword(e) ? (k(), x("button", {
444
454
  key: 1,
445
455
  type: "button",
446
456
  class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
447
457
  onClick: (t) => r.resetPassword(e)
448
- }, [E(r.AppIcon, {
458
+ }, [T(r.AppIcon, {
449
459
  name: "key-round",
450
460
  class: "h-4 w-4 shrink-0 text-slate-400"
451
- }), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8, he)) : x("", !0),
452
- C("button", {
461
+ }), t[12] ||= w(" Згенерувати новий пароль ", -1)], 8, he)) : b("", !0),
462
+ S("button", {
453
463
  type: "button",
454
- class: O(["flex w-full items-center gap-2 px-3 py-2.5 text-sm transition-colors", r.membershipEnabled(e) ? "text-red-600 hover:bg-red-50" : "text-slate-700 hover:bg-slate-50"]),
464
+ class: D(["flex w-full items-center gap-2 px-3 py-2.5 text-sm transition-colors", r.membershipEnabled(e) ? "text-red-600 hover:bg-red-50" : "text-slate-700 hover:bg-slate-50"]),
455
465
  onClick: (t) => r.toggleAccess(e)
456
- }, [E(r.AppIcon, {
466
+ }, [T(r.AppIcon, {
457
467
  name: r.membershipEnabled(e) ? "user-x" : "power",
458
- class: O(["h-4 w-4 shrink-0", r.membershipEnabled(e) ? "" : "text-slate-400"])
459
- }, null, 8, ["name", "class"]), T(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, ge)
460
- ], 4)) : x("", !0)]),
468
+ class: D(["h-4 w-4 shrink-0", r.membershipEnabled(e) ? "" : "text-slate-400"])
469
+ }, null, 8, ["name", "class"]), w(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, ge)
470
+ ], 4)) : b("", !0)]),
461
471
  _: 2
462
472
  }, 1024)])
463
- ]))), 128)), n.users.length === 0 ? (A(), S("tr", _e, [...t[13] ||= [C("td", {
473
+ ]))), 128)), n.users.length === 0 ? (k(), x("tr", _e, [...t[13] ||= [S("td", {
464
474
  colspan: "6",
465
475
  class: "px-5 py-12 text-center text-sm text-slate-400"
466
- }, " Користувачів не знайдено. ", -1)]])) : x("", !0)])
476
+ }, " Користувачів не знайдено. ", -1)]])) : b("", !0)])
467
477
  ])]),
468
- E(r.BaseModal, {
478
+ T(r.BaseModal, {
469
479
  "model-value": r.dialog !== null,
470
480
  title: r.dialogTitle,
471
481
  width: "max-w-lg",
@@ -474,87 +484,87 @@ function Ve(e, t, n, r, i, a) {
474
484
  e || r.closeDialog();
475
485
  }
476
486
  }, {
477
- footer: I(() => [C("div", Re, [C("button", {
487
+ footer: I(() => [S("div", Re, [S("button", {
478
488
  type: "button",
479
489
  class: "rounded-lg px-4 py-2.5 text-sm font-medium text-slate-600 hover:bg-slate-100",
480
490
  disabled: r.saving,
481
491
  onClick: r.closeDialog
482
- }, " Скасувати ", 8, ze), C("button", {
492
+ }, " Скасувати ", 8, ze), S("button", {
483
493
  type: "button",
484
494
  class: "rounded-lg bg-brand-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-700 disabled:opacity-60",
485
495
  disabled: r.saving || r.dialog === "add" && !r.selectedAvailable,
486
496
  onClick: t[7] ||= (e) => r.dialog === "add" ? r.submitAdd() : r.submitEdit()
487
497
  }, N(r.saving ? "Збереження…" : r.dialog === "add" ? "Додати" : "Зберегти"), 9, Be)])]),
488
- default: I(() => [r.dialog === "add" ? (A(), S("div", ve, [
489
- C("label", ye, [t[16] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Сертифікат", -1), L(C("input", {
498
+ default: I(() => [r.dialog === "add" ? (k(), x("div", ve, [
499
+ S("label", ye, [t[16] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Сертифікат", -1), L(S("input", {
490
500
  "onUpdate:modelValue": t[0] ||= (e) => r.certificateQuery = e,
491
501
  type: "text",
492
- class: O(r.fieldClass),
502
+ class: D(r.fieldClass),
493
503
  placeholder: "Номер або прізвище",
494
504
  onInput: r.onCertificateInput
495
505
  }, null, 544), [[P, r.certificateQuery]])]),
496
- r.certificatesLoading ? (A(), S("p", be, "Пошук…")) : r.certificates.length ? (A(), S("ul", xe, [(A(!0), S(y, null, M(r.certificates, (e) => (A(), S("li", { key: e.certificate_id }, [C("button", {
506
+ r.certificatesLoading ? (k(), x("p", be, "Пошук…")) : r.certificates.length ? (k(), x("ul", xe, [(k(!0), x(v, null, j(r.certificates, (e) => (k(), x("li", { key: e.certificate_id }, [S("button", {
497
507
  type: "button",
498
508
  class: "flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm hover:bg-slate-50",
499
509
  onClick: (t) => r.chooseCertificate(e)
500
- }, [C("span", Ce, [C("span", we, "№ " + N(e.number_certificate || "—"), 1), C("span", Te, N(r.certificatePerson(e)), 1)]), E(r.ValidityBadge, {
510
+ }, [S("span", Ce, [S("span", we, "№ " + N(e.number_certificate || "—"), 1), S("span", Te, N(r.certificatePerson(e)), 1)]), T(r.ValidityBadge, {
501
511
  class: "shrink-0",
502
512
  validity: e.certificate_status
503
- }, null, 8, ["validity"])], 8, Se)]))), 128))])) : r.searched && !r.selectedCertificate ? (A(), S("p", Ee, "Сертифікат не знайдено. Нового користувача можна додати лише за сертифікатом з реєстру.")) : x("", !0),
504
- r.selectedCertificate && !r.selectedAvailable ? (A(), S("p", De, " Сертифікат має статус «" + N(r.selectedStatusLabel || "Невідомий") + "». Додати користувача можна лише за дійсним сертифікатом. ", 1)) : r.selectedCertificate ? (A(), S(y, { key: 4 }, [
505
- r.registeredAccount ? (A(), S("p", Oe, " Обліковий запис уже є: " + N(r.registeredAccount.account_name || "—") + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : x("", !0),
506
- C("label", ke, [t[17] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(C("input", {
513
+ }, null, 8, ["validity"])], 8, Se)]))), 128))])) : r.searched && !r.selectedCertificate ? (k(), x("p", Ee, "Сертифікат не знайдено. Нового користувача можна додати лише за сертифікатом з реєстру.")) : b("", !0),
514
+ r.selectedCertificate && !r.selectedAvailable ? (k(), x("p", De, " Сертифікат має статус «" + N(r.selectedStatusLabel || "Невідомий") + "». Додати користувача можна лише за дійсним сертифікатом. ", 1)) : r.selectedCertificate ? (k(), x(v, { key: 4 }, [
515
+ r.registeredAccount ? (k(), x("p", Oe, " Обліковий запис уже є: " + N(r.registeredAccount.account_name || "—") + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : b("", !0),
516
+ S("label", ke, [t[17] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(S("input", {
507
517
  "onUpdate:modelValue": t[1] ||= (e) => r.addEmail = e,
508
518
  type: "email",
509
- class: O(r.fieldClass),
519
+ class: D(r.fieldClass),
510
520
  placeholder: "user@example.com"
511
521
  }, null, 512), [[P, r.addEmail]])]),
512
- r.registeredAccount ? x("", !0) : (A(), S("label", Ae, [t[18] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
522
+ r.registeredAccount ? b("", !0) : (k(), x("label", Ae, [t[18] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(S("input", {
513
523
  "onUpdate:modelValue": t[2] ||= (e) => r.addPhone = e,
514
524
  type: "text",
515
- class: O(r.fieldClass),
525
+ class: D(r.fieldClass),
516
526
  placeholder: "+380…"
517
527
  }, null, 512), [[P, r.addPhone]])])),
518
- r.registeredAccount ? x("", !0) : (A(), S("p", je, "На email надійде лист для завершення реєстрації."))
519
- ], 64)) : x("", !0)
520
- ])) : r.dialog === "edit" ? (A(), S("div", Me, [
521
- C("label", Ne, [t[19] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), L(C("input", {
528
+ r.registeredAccount ? b("", !0) : (k(), x("p", je, "На email надійде лист для завершення реєстрації."))
529
+ ], 64)) : b("", !0)
530
+ ])) : r.dialog === "edit" ? (k(), x("div", Me, [
531
+ S("label", Ne, [t[19] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), L(S("input", {
522
532
  "onUpdate:modelValue": t[3] ||= (e) => r.editDraft.last_name = e,
523
533
  type: "text",
524
- class: O(r.fieldClass)
534
+ class: D(r.fieldClass)
525
535
  }, null, 512), [[P, r.editDraft.last_name]])]),
526
- C("label", Pe, [t[20] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), L(C("input", {
536
+ S("label", Pe, [t[20] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), L(S("input", {
527
537
  "onUpdate:modelValue": t[4] ||= (e) => r.editDraft.first_name = e,
528
538
  type: "text",
529
- class: O(r.fieldClass)
539
+ class: D(r.fieldClass)
530
540
  }, null, 512), [[P, r.editDraft.first_name]])]),
531
- C("label", Fe, [t[21] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), L(C("input", {
541
+ S("label", Fe, [t[21] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), L(S("input", {
532
542
  "onUpdate:modelValue": t[5] ||= (e) => r.editDraft.middle_name = e,
533
543
  type: "text",
534
- class: O(r.fieldClass)
544
+ class: D(r.fieldClass)
535
545
  }, null, 512), [[P, r.editDraft.middle_name]])]),
536
- C("label", Ie, [t[22] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
546
+ S("label", Ie, [t[22] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(S("input", {
537
547
  "onUpdate:modelValue": t[6] ||= (e) => r.editDraft.phone = e,
538
548
  type: "text",
539
- class: O(r.fieldClass)
549
+ class: D(r.fieldClass)
540
550
  }, null, 512), [[P, r.editDraft.phone]])])
541
- ])) : x("", !0), r.formError ? (A(), S("p", Le, N(r.formError), 1)) : x("", !0)]),
551
+ ])) : b("", !0), r.formError ? (k(), x("p", Le, N(r.formError), 1)) : b("", !0)]),
542
552
  _: 1
543
553
  }, 8, ["model-value", "title"])
544
554
  ]);
545
555
  }
546
- var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Ue = /*@__PURE__*/ D({
556
+ var He = /*#__PURE__*/ e(W, [["render", Ve], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Ue = /*@__PURE__*/ E({
547
557
  __name: "card",
548
- setup(e, { expose: i }) {
549
- i();
550
- let o = B(), { listPath: l } = n(), u = V(), d = j(null), f = j(!1), p = j(""), h = j(null), g = b(() => o.query.edit === "1"), _ = b(() => d.value?.surveyors ?? []), y = b(() => {
551
- let e = d.value;
558
+ setup(e, { expose: r }) {
559
+ r();
560
+ let o = B(), { listPath: ee } = n(), l = re(), u = A(null), d = A(!1), f = A(""), m = A(null), h = y(() => o.query.edit === "1"), g = y(() => u.value?.surveyors ?? []), v = y(() => {
561
+ let e = u.value;
552
562
  return e ? {
553
563
  ...e,
554
564
  id: e.org_id
555
565
  } : null;
556
566
  });
557
- function x(e) {
567
+ function b(e) {
558
568
  let t = e.split(".")[0] ?? "", n = t.replace(/-/g, "+").replace(/_/g, "/") + "=".repeat((4 - t.length % 4) % 4);
559
569
  try {
560
570
  return atob(n).split(/[/\\]/).pop() || "Скан-копія";
@@ -562,51 +572,51 @@ var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/softpro/surveyor/adm
562
572
  return "Скан-копія";
563
573
  }
564
574
  }
565
- function S(e, t = !1) {
575
+ function x(e, t = !1) {
566
576
  let n = `/api/file/${encodeURIComponent(e)}`;
567
577
  return t ? `${n}?download=true` : n;
568
578
  }
569
- function C() {
570
- u.replace({ query: {
579
+ function S() {
580
+ l.replace({ query: {
571
581
  ...o.query,
572
582
  edit: "1"
573
583
  } });
574
584
  }
575
- function w() {
585
+ function C() {
576
586
  let e = { ...o.query };
577
- delete e.edit, u.replace({ query: e });
587
+ delete e.edit, l.replace({ query: e });
578
588
  }
579
- async function T() {
580
- let e = d.value?.org_id;
581
- if (w(), e) try {
582
- await E(e);
589
+ async function w() {
590
+ let e = u.value?.org_id;
591
+ if (C(), e) try {
592
+ await T(e);
583
593
  } catch (e) {
584
- H({
594
+ V({
585
595
  type: "error",
586
596
  title: "Помилка",
587
597
  message: e instanceof Error ? e.message : "Не вдалося оновити організацію"
588
598
  });
589
599
  }
590
600
  }
591
- async function E(e) {
592
- d.value = await r(`/api/resource/organizations/${encodeURIComponent(e)}?include=surveyors&limit=100`);
601
+ async function T(e) {
602
+ u.value = await i(`/api/resource/organizations/${encodeURIComponent(e)}?include=surveyors&limit=100`);
593
603
  }
594
- async function D(e) {
595
- f.value = !0, p.value = "", d.value = null;
604
+ async function E(e) {
605
+ d.value = !0, f.value = "", u.value = null;
596
606
  try {
597
- await E(e);
607
+ await T(e);
598
608
  } catch (e) {
599
- d.value = null, p.value = e instanceof Error ? e.message : "Не вдалося завантажити організацію";
609
+ u.value = null, f.value = e instanceof Error ? e.message : "Не вдалося завантажити організацію";
600
610
  } finally {
601
- f.value = !1;
611
+ d.value = !1;
602
612
  }
603
613
  }
604
- async function O() {
605
- let e = d.value?.org_id;
614
+ async function D() {
615
+ let e = u.value?.org_id;
606
616
  if (e) try {
607
- await E(e);
617
+ await T(e);
608
618
  } catch (e) {
609
- H({
619
+ V({
610
620
  type: "error",
611
621
  title: "Помилка",
612
622
  message: e instanceof Error ? e.message : "Не вдалося оновити організацію"
@@ -614,44 +624,44 @@ var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/softpro/surveyor/adm
614
624
  }
615
625
  }
616
626
  F(() => String(o.params.id), (e) => {
617
- e && D(e);
627
+ e && E(e);
618
628
  }, { immediate: !0 });
619
- let k = {
629
+ let O = {
620
630
  route: o,
621
- listPath: l,
622
- router: u,
623
- organization: d,
624
- loading: f,
625
- error: p,
626
- formRef: h,
627
- editing: g,
628
- users: _,
629
- editRecord: y,
630
- fileName: x,
631
- fileUrl: S,
632
- startEdit: C,
633
- cancelEdit: w,
634
- onFormSaved: T,
635
- fetchOrganization: E,
636
- loadOrganization: D,
637
- refreshOrganization: O,
631
+ listPath: ee,
632
+ router: l,
633
+ organization: u,
634
+ loading: d,
635
+ error: f,
636
+ formRef: m,
637
+ editing: h,
638
+ users: g,
639
+ editRecord: v,
640
+ fileName: b,
641
+ fileUrl: x,
642
+ startEdit: S,
643
+ cancelEdit: C,
644
+ onFormSaved: w,
645
+ fetchOrganization: T,
646
+ loadOrganization: E,
647
+ refreshOrganization: D,
638
648
  AppIcon: t,
639
649
  get RouterLink() {
640
650
  return z;
641
651
  },
642
- RegistryForm: m,
652
+ RegistryForm: p,
643
653
  VerifiedBadge: a,
644
654
  AppealDetailSection: s,
645
655
  AppealDetailField: c,
646
656
  OrganizationUsers: He,
647
657
  get organizationForm() {
648
- return v;
658
+ return _;
649
659
  }
650
660
  };
651
- return Object.defineProperty(k, "__isScriptSetup", {
661
+ return Object.defineProperty(O, "__isScriptSetup", {
652
662
  enumerable: !1,
653
663
  value: !0
654
- }), k;
664
+ }), O;
655
665
  }
656
666
  }), We = {
657
667
  key: 0,
@@ -667,96 +677,96 @@ var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/softpro/surveyor/adm
667
677
  class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
668
678
  }, ot = { class: "text-sm text-slate-500" };
669
679
  function st(e, t, n, r, i, a) {
670
- return r.loading ? (A(), S("div", We, " Завантаження… ")) : r.organization ? (A(), S("div", Ge, [C("header", Ke, [C("nav", qe, [
671
- E(r.RouterLink, {
680
+ return r.loading ? (k(), x("div", We, " Завантаження… ")) : r.organization ? (k(), x("div", Ge, [S("header", Ke, [S("nav", qe, [
681
+ T(r.RouterLink, {
672
682
  to: r.listPath,
673
683
  class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
674
684
  }, {
675
- default: I(() => [E(r.AppIcon, {
685
+ default: I(() => [T(r.AppIcon, {
676
686
  name: "home",
677
687
  class: "h-3.5 w-3.5"
678
- }), t[1] ||= T(" Організації ", -1)]),
688
+ }), t[1] ||= w(" Організації ", -1)]),
679
689
  _: 1
680
690
  }, 8, ["to"]),
681
- t[2] ||= C("span", { class: "text-slate-300" }, "/", -1),
682
- C("span", Je, N(r.organization.name), 1)
683
- ]), C("div", Ye, [C("h1", Xe, N(r.organization.name), 1), r.editing ? x("", !0) : (A(), S("button", {
691
+ t[2] ||= S("span", { class: "text-slate-300" }, "/", -1),
692
+ S("span", Je, N(r.organization.name), 1)
693
+ ]), S("div", Ye, [S("h1", Xe, N(r.organization.name), 1), r.editing ? b("", !0) : (k(), x("button", {
684
694
  key: 0,
685
695
  type: "button",
686
696
  class: "inline-flex h-10 items-center gap-2 rounded-lg border border-slate-200 bg-white px-4 text-sm font-semibold text-slate-700 transition-colors hover:border-brand-300 hover:text-brand-700",
687
697
  onClick: r.startEdit
688
- }, [E(r.AppIcon, {
698
+ }, [T(r.AppIcon, {
689
699
  name: "pencil",
690
700
  class: "h-4 w-4"
691
- }), t[3] ||= T(" Редагувати ", -1)]))])]), C("div", Ze, [r.editing ? (A(), S("div", Qe, [E(r.RegistryForm, {
701
+ }), t[3] ||= w(" Редагувати ", -1)]))])]), S("div", Ze, [r.editing ? (k(), x("div", Qe, [T(r.RegistryForm, {
692
702
  ref: "formRef",
693
703
  config: r.organizationForm,
694
704
  record: r.editRecord,
695
705
  "hide-actions": "",
696
706
  onSaved: r.onFormSaved,
697
707
  onCancel: r.cancelEdit
698
- }, null, 8, ["config", "record"]), C("div", $e, [C("button", {
708
+ }, null, 8, ["config", "record"]), S("div", $e, [S("button", {
699
709
  type: "button",
700
710
  class: "inline-flex h-10 items-center rounded-lg bg-slate-100 px-4 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-200",
701
711
  onClick: r.cancelEdit
702
- }, " Скасувати "), C("button", {
712
+ }, " Скасувати "), S("button", {
703
713
  type: "button",
704
714
  class: "inline-flex h-10 items-center rounded-lg bg-brand-600 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-700",
705
715
  onClick: t[0] ||= (e) => r.formRef?.submit()
706
- }, " Зберегти зміни ")])])) : (A(), S(y, { key: 1 }, [E(r.AppealDetailSection, { title: "Інформація про організацію" }, {
707
- icon: I(() => [E(r.AppIcon, {
716
+ }, " Зберегти зміни ")])])) : (k(), x(v, { key: 1 }, [T(r.AppealDetailSection, { title: "Інформація про організацію" }, {
717
+ icon: I(() => [T(r.AppIcon, {
708
718
  name: "building-2",
709
719
  class: "h-[18px] w-[18px]"
710
720
  })]),
711
- default: I(() => [C("dl", et, [
712
- C("div", null, [t[4] ||= C("dt", { class: "mb-1 text-xs font-medium text-slate-500" }, "Верифіковано", -1), C("dd", null, [E(r.VerifiedBadge, { verified: !!r.organization.verified }, null, 8, ["verified"])])]),
713
- E(r.AppealDetailField, { label: "Організація яка звернулась" }, {
714
- default: I(() => [T(N(r.organization.name), 1)]),
721
+ default: I(() => [S("dl", et, [
722
+ S("div", null, [t[4] ||= S("dt", { class: "mb-1 text-xs font-medium text-slate-500" }, "Верифіковано", -1), S("dd", null, [T(r.VerifiedBadge, { verified: !!r.organization.verified }, null, 8, ["verified"])])]),
723
+ T(r.AppealDetailField, { label: "Організація яка звернулась" }, {
724
+ default: I(() => [w(N(r.organization.name), 1)]),
715
725
  _: 1
716
726
  }),
717
- E(r.AppealDetailField, { label: "Телефон організації" }, {
718
- default: I(() => [T(N(r.organization.phone || "—"), 1)]),
727
+ T(r.AppealDetailField, { label: "Телефон організації" }, {
728
+ default: I(() => [w(N(r.organization.phone || "—"), 1)]),
719
729
  _: 1
720
730
  }),
721
- E(r.AppealDetailField, { label: "Email організації" }, {
722
- default: I(() => [T(N(r.organization.email || "—"), 1)]),
731
+ T(r.AppealDetailField, { label: "Email організації" }, {
732
+ default: I(() => [w(N(r.organization.email || "—"), 1)]),
723
733
  _: 1
724
734
  }),
725
- E(r.AppealDetailField, {
735
+ T(r.AppealDetailField, {
726
736
  label: "Юридична адреса",
727
737
  full: ""
728
738
  }, {
729
- default: I(() => [T(N(r.organization.legal_address || "—"), 1)]),
739
+ default: I(() => [w(N(r.organization.legal_address || "—"), 1)]),
730
740
  _: 1
731
741
  })
732
742
  ])]),
733
743
  _: 1
734
- }), E(r.AppealDetailSection, { title: "Файли" }, w({
735
- icon: I(() => [E(r.AppIcon, {
744
+ }), T(r.AppealDetailSection, { title: "Файли" }, C({
745
+ icon: I(() => [T(r.AppIcon, {
736
746
  name: "file-check-2",
737
747
  class: "h-[18px] w-[18px]"
738
748
  })]),
739
- default: I(() => [C("div", null, [t[7] ||= C("p", { class: "text-sm font-semibold text-slate-800" }, "Скан копія", -1), C("p", it, N(r.organization.scan_path ? r.fileName(r.organization.scan_path) : "—"), 1)])]),
749
+ default: I(() => [S("div", null, [t[7] ||= S("p", { class: "text-sm font-semibold text-slate-800" }, "Скан копія", -1), S("p", it, N(r.organization.scan_path ? r.fileName(r.organization.scan_path) : "—"), 1)])]),
740
750
  _: 2
741
751
  }, [r.organization.scan_path ? {
742
752
  name: "actions",
743
- fn: I(() => [C("div", tt, [C("a", {
753
+ fn: I(() => [S("div", tt, [S("a", {
744
754
  href: r.fileUrl(r.organization.scan_path, !0),
745
755
  class: "inline-flex h-8 items-center gap-1.5 rounded-lg border border-slate-200 px-2.5 text-[13px] font-medium text-slate-600 transition-colors hover:border-brand-300 hover:bg-brand-50 hover:text-brand-700"
746
- }, [E(r.AppIcon, {
756
+ }, [T(r.AppIcon, {
747
757
  name: "download",
748
758
  class: "h-3.5 w-3.5"
749
- }), t[5] ||= T(" Завантажити ", -1)], 8, nt), C("a", {
759
+ }), t[5] ||= w(" Завантажити ", -1)], 8, nt), S("a", {
750
760
  href: r.fileUrl(r.organization.scan_path),
751
761
  target: "_blank",
752
762
  rel: "noopener",
753
763
  class: "inline-flex h-8 items-center gap-1.5 rounded-lg border border-slate-200 px-2.5 text-[13px] font-medium text-slate-600 transition-colors hover:border-brand-300 hover:bg-brand-50 hover:text-brand-700"
754
- }, [E(r.AppIcon, {
764
+ }, [T(r.AppIcon, {
755
765
  name: "eye",
756
766
  class: "h-3.5 w-3.5"
757
- }), t[6] ||= T(" Перегляд ", -1)], 8, rt)])]),
767
+ }), t[6] ||= w(" Перегляд ", -1)], 8, rt)])]),
758
768
  key: "0"
759
- } : void 0]), 1024)], 64)), E(r.OrganizationUsers, {
769
+ } : void 0]), 1024)], 64)), T(r.OrganizationUsers, {
760
770
  "org-id": r.organization.org_id,
761
771
  "org-name": r.organization.name,
762
772
  users: r.users,
@@ -765,14 +775,14 @@ function st(e, t, n, r, i, a) {
765
775
  "org-id",
766
776
  "org-name",
767
777
  "users"
768
- ])])])) : (A(), S("div", at, [C("p", ot, N(r.error || "Організацію не знайдено."), 1), E(r.RouterLink, {
778
+ ])])])) : (k(), x("div", at, [S("p", ot, N(r.error || "Організацію не знайдено."), 1), T(r.RouterLink, {
769
779
  to: r.listPath,
770
780
  class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
771
781
  }, {
772
- default: I(() => [...t[8] ||= [T(" Повернутися до реєстру ", -1)]]),
782
+ default: I(() => [...t[8] ||= [w(" Повернутися до реєстру ", -1)]]),
773
783
  _: 1
774
784
  }, 8, ["to"])]));
775
785
  }
776
- var ct = /*#__PURE__*/ e(Ue, [["render", st], ["__file", "D:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
786
+ var ct = /*#__PURE__*/ e(Ue, [["render", st], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
777
787
  //#endregion
778
788
  export { ct as default };