@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
@@ -0,0 +1,609 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { n as t, t as n } from "./useEntityPath-C5Owtidc.js";
3
+ import { c as r, o as i, s as a } from "./resources-Cj8BzrBX.js";
4
+ import { t as ee } from "./UserTypeBadge-LvnMuKGo.js";
5
+ import { n as te, t as ne } from "./AppealDetailField-DNRGpnyD.js";
6
+ import { a as re, i as ie, n as ae, r as oe, t as se } from "./surveyorAccount-Cfba7ZVZ.js";
7
+ import { t as ce } from "./TablePagination-CUtnDQQ_.js";
8
+ import { n as le, t as ue } from "./resendSurveyorRegistration-BQjL9IgM.js";
9
+ import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, onMounted as de, onUnmounted as fe, openBlock as g, ref as _, renderList as v, toDisplayString as y, vModelText as b, watch as x, withCtx as S, withDirectives as C, withModifiers as w } from "vue";
10
+ import { RouterLink as pe, useRoute as me } from "vue-router";
11
+ import { confirm as he, notify as T } from "@opengis/core";
12
+ //#region admin/src/pages/users/card.vue?vue&type=script&setup=true&lang.ts
13
+ var ge = "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", E = /*@__PURE__*/ m({
14
+ __name: "card",
15
+ setup(e, { expose: o }) {
16
+ o();
17
+ let c = me(), { listPath: l } = n(), u = _(null), d = _(!1), f = _(!1), p = _(!1), m = _(""), h = _(!1), g = _(!1), v = _({
18
+ last_name: "",
19
+ first_name: "",
20
+ middle_name: "",
21
+ email: "",
22
+ phone: ""
23
+ }), y = s(() => {
24
+ let e = u.value?.certificate;
25
+ return Array.isArray(e) ? e[0] ?? null : e ?? null;
26
+ }), b = s(() => u.value?.organizations ?? []), S = s(() => b.value.length > 1), C = _([]);
27
+ function w(e) {
28
+ return !S.value || C.value.includes(e);
29
+ }
30
+ function E(e) {
31
+ C.value = C.value.includes(e) ? C.value.filter((t) => t !== e) : [...C.value, e];
32
+ }
33
+ function D(e) {
34
+ return e.membership_enabled !== !1;
35
+ }
36
+ let O = _([]), k = _(1), A = _(10), j = _(0), M = _(!1), N = _(""), P = 0, F = !1;
37
+ function I(e) {
38
+ return [
39
+ e.last_name,
40
+ e.first_name,
41
+ e.middle_name
42
+ ].filter(Boolean).join(" ") || "—";
43
+ }
44
+ let L = s(() => h.value ? I(v.value) : u.value ? I(u.value) : ""), R = s(() => String(y.value?.certificate_type ?? "")), z = s(() => u.value ? ue(u.value) : !1), B = s(() => u.value ? se(u.value) : !1), V = s(() => !u.value || re(u.value));
45
+ function H(e) {
46
+ if (!e) return "";
47
+ let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
48
+ return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
49
+ }
50
+ function U(e) {
51
+ return e.address_id_data?.text || e.location || "—";
52
+ }
53
+ function W(e) {
54
+ v.value = {
55
+ last_name: e.last_name ?? "",
56
+ first_name: e.first_name ?? "",
57
+ middle_name: e.middle_name ?? "",
58
+ email: e.email ?? "",
59
+ phone: e.phone ?? ""
60
+ };
61
+ }
62
+ function G() {
63
+ u.value && (W(u.value), g.value = !1, h.value = !0);
64
+ }
65
+ function K() {
66
+ u.value && W(u.value), h.value = !1;
67
+ }
68
+ async function q() {
69
+ if (!u.value || f.value) return;
70
+ let e = {
71
+ last_name: v.value.last_name.trim(),
72
+ first_name: v.value.first_name.trim(),
73
+ middle_name: v.value.middle_name.trim(),
74
+ email: v.value.email.trim().toLowerCase(),
75
+ phone: v.value.phone.trim()
76
+ };
77
+ if (!e.last_name || !e.first_name || !e.email) {
78
+ T({
79
+ type: "warning",
80
+ title: "Перевірте поля",
81
+ message: "Прізвище, імʼя та email обовʼязкові"
82
+ });
83
+ return;
84
+ }
85
+ f.value = !0;
86
+ try {
87
+ await r("surveyors", u.value.surveyor_id, e), u.value = {
88
+ ...u.value,
89
+ ...e
90
+ }, h.value = !1;
91
+ } catch (e) {
92
+ T({
93
+ type: "error",
94
+ title: "Помилка збереження",
95
+ message: e instanceof Error ? e.message : "Не вдалося зберегти користувача"
96
+ });
97
+ } finally {
98
+ f.value = !1;
99
+ }
100
+ }
101
+ async function J() {
102
+ if (u.value && !p.value && z.value) {
103
+ g.value = !1, p.value = !0;
104
+ try {
105
+ await le(u.value.surveyor_id);
106
+ } finally {
107
+ p.value = !1;
108
+ }
109
+ }
110
+ }
111
+ function Y() {
112
+ if (!u.value || !B.value) return;
113
+ let e = u.value.surveyor_id, t = I(u.value);
114
+ g.value = !1, he({
115
+ title: "Зміна пароля",
116
+ type: "warning",
117
+ message: `Згенерувати новий пароль для «${t}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
118
+ confirmButtonText: "Згенерувати",
119
+ cancelButtonText: "Скасувати",
120
+ onConfirm: () => oe(e)
121
+ });
122
+ }
123
+ function _e() {
124
+ if (!u.value) return;
125
+ let e = u.value.surveyor_id;
126
+ g.value = !1, ae(u.value, I(u.value), (t) => {
127
+ u.value?.surveyor_id === e && (u.value = {
128
+ ...u.value,
129
+ enabled: t
130
+ });
131
+ });
132
+ }
133
+ function ve(e) {
134
+ if (!u.value) return;
135
+ let t = u.value.surveyor_id, n = e.org_id, r = e.name || "—", i = I(u.value), a = !D(e);
136
+ he({
137
+ title: a ? "Активація" : "Деактивація",
138
+ type: a ? "warning" : "error",
139
+ message: a ? `Активувати користувача «${i}» в організації «${r}»?` : `Деактивувати користувача «${i}» в організації «${r}»? Доступ до заявок цієї організації буде вимкнено.`,
140
+ confirmButtonText: a ? "Активувати" : "Деактивувати",
141
+ cancelButtonText: "Скасувати",
142
+ onConfirm: async () => {
143
+ await ie(t, n, a) && u.value?.surveyor_id === t && (u.value = {
144
+ ...u.value,
145
+ organizations: (u.value.organizations ?? []).map((e) => e.org_id === n ? {
146
+ ...e,
147
+ membership_enabled: a
148
+ } : e)
149
+ });
150
+ }
151
+ });
152
+ }
153
+ function X(e) {
154
+ let t = e?.target;
155
+ t instanceof Element && t.closest("[data-user-header-menu]") || (g.value = !1);
156
+ }
157
+ async function Z(e) {
158
+ let t = ++P, n = k.value;
159
+ M.value = !0, N.value = "";
160
+ try {
161
+ let r = await i("surveyors", e, "applications", {
162
+ page: n,
163
+ limit: A.value
164
+ });
165
+ if (t !== P) return;
166
+ let a = r.rows ?? [];
167
+ if (a.length === 0 && n > 1) {
168
+ F = !0, k.value = n - 1;
169
+ return;
170
+ }
171
+ O.value = a, j.value = Number(r.total) || 0;
172
+ } catch (e) {
173
+ if (t !== P) return;
174
+ O.value = [], j.value = 0, N.value = e instanceof Error ? e.message : "Не вдалося завантажити заявки";
175
+ } finally {
176
+ t === P && (M.value = !1);
177
+ }
178
+ }
179
+ async function Q(e) {
180
+ d.value = !0, m.value = "", u.value = null, g.value = !1, h.value = !1, C.value = [], O.value = [], N.value = "", j.value = 0, (k.value !== 1 || A.value !== 10) && (F = !0, k.value = 1, A.value = 10), Z(e);
181
+ try {
182
+ u.value = await a(`/api/resource/surveyors/${encodeURIComponent(e)}?include=certificate,organizations&limit=100`);
183
+ } catch (e) {
184
+ u.value = null, m.value = e instanceof Error ? e.message : "Не вдалося завантажити користувача";
185
+ } finally {
186
+ d.value = !1;
187
+ }
188
+ }
189
+ x([k, A], ([e, t], [, n]) => {
190
+ if (F) {
191
+ F = !1;
192
+ return;
193
+ }
194
+ if (t !== n && e !== 1) {
195
+ F = !0, k.value = 1;
196
+ return;
197
+ }
198
+ let r = String(c.params.id ?? "");
199
+ r && Z(r);
200
+ }), x(() => String(c.params.id), (e) => {
201
+ e && Q(e);
202
+ }, { immediate: !0 }), de(() => document.addEventListener("click", X)), fe(() => document.removeEventListener("click", X));
203
+ let $ = {
204
+ fieldClass: ge,
205
+ route: c,
206
+ listPath: l,
207
+ surveyor: u,
208
+ loading: d,
209
+ saving: f,
210
+ resending: p,
211
+ error: m,
212
+ editing: h,
213
+ menuOpen: g,
214
+ draft: v,
215
+ certificate: y,
216
+ organizations: b,
217
+ organizationsAccordion: S,
218
+ openOrganizations: C,
219
+ organizationOpen: w,
220
+ toggleOrganization: E,
221
+ membershipEnabled: D,
222
+ applications: O,
223
+ applicationsPage: k,
224
+ applicationsPageSize: A,
225
+ applicationsTotal: j,
226
+ applicationsLoading: M,
227
+ applicationsError: N,
228
+ get applicationsRequestId() {
229
+ return P;
230
+ },
231
+ set applicationsRequestId(e) {
232
+ P = e;
233
+ },
234
+ get ignoreApplicationsPagingWatch() {
235
+ return F;
236
+ },
237
+ set ignoreApplicationsPagingWatch(e) {
238
+ F = e;
239
+ },
240
+ personName: I,
241
+ fullName: L,
242
+ registryType: R,
243
+ showResendRegistration: z,
244
+ showResetPassword: B,
245
+ accountEnabled: V,
246
+ formatDate: H,
247
+ appealAddress: U,
248
+ fillDraft: W,
249
+ startEdit: G,
250
+ cancelEdit: K,
251
+ saveEdit: q,
252
+ resendRegistrationInvite: J,
253
+ resetPassword: Y,
254
+ toggleAccountBlock: _e,
255
+ toggleMembership: ve,
256
+ closeMenu: X,
257
+ loadApplications: Z,
258
+ loadSurveyor: Q,
259
+ AppIcon: t,
260
+ get RouterLink() {
261
+ return pe;
262
+ },
263
+ AppealDetailSection: te,
264
+ AppealDetailField: ne,
265
+ UserTypeBadge: ee,
266
+ TablePagination: ce
267
+ };
268
+ return Object.defineProperty($, "__isScriptSetup", {
269
+ enumerable: !1,
270
+ value: !0
271
+ }), $;
272
+ }
273
+ }), D = {
274
+ key: 0,
275
+ class: "px-4 py-16 text-center text-sm text-slate-400"
276
+ }, O = {
277
+ key: 1,
278
+ class: "pl-0"
279
+ }, k = { class: "mb-6" }, A = { class: "mb-4 flex items-center gap-1.5 text-sm" }, j = { class: "font-medium text-slate-700" }, M = { class: "flex items-start justify-between gap-4" }, N = { class: "flex min-w-0 flex-wrap items-center gap-3" }, P = { class: "text-xl font-bold tracking-tight text-slate-900" }, F = {
280
+ key: 1,
281
+ class: "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-2 py-0.5 text-xs font-medium text-slate-600"
282
+ }, I = {
283
+ class: "relative shrink-0",
284
+ "data-user-header-menu": ""
285
+ }, L = ["aria-expanded"], R = {
286
+ key: 0,
287
+ class: "absolute right-0 top-11 z-20 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover"
288
+ }, z = ["disabled"], B = { class: "flex flex-col gap-5" }, V = {
289
+ key: 0,
290
+ class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2"
291
+ }, H = { class: "block" }, U = { class: "block" }, W = { class: "block" }, G = { class: "block" }, K = { class: "block sm:col-span-2" }, q = {
292
+ key: 1,
293
+ class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2"
294
+ }, J = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, Y = {
295
+ key: 0,
296
+ class: "py-6 text-center text-sm text-slate-400"
297
+ }, _e = ["aria-expanded", "onClick"], ve = { class: "flex min-w-0 flex-wrap items-center gap-2" }, X = { class: "break-words text-sm font-semibold text-slate-800" }, Z = {
298
+ key: 0,
299
+ class: "text-xs font-medium text-amber-700"
300
+ }, Q = { class: "flex flex-wrap items-center gap-3" }, $ = ["onClick"], ye = {
301
+ key: 0,
302
+ class: "py-6 text-center text-sm text-slate-400"
303
+ }, be = {
304
+ key: 1,
305
+ class: "py-6 text-center text-sm text-red-500"
306
+ }, xe = {
307
+ key: 2,
308
+ class: "py-6 text-center text-sm text-slate-400"
309
+ }, Se = { key: 3 }, Ce = { class: "min-w-full table-fixed text-left text-[13px]" }, we = { class: "divide-y divide-slate-100" }, Te = { class: "px-1 py-3" }, Ee = { class: "px-1 py-3 text-slate-600" }, De = { class: "px-1 py-3 text-slate-600" }, Oe = {
310
+ key: 0,
311
+ class: "flex justify-end gap-3 rounded-xl border border-slate-200 bg-white px-5 py-4 shadow-card"
312
+ }, ke = ["disabled"], Ae = ["disabled"], je = {
313
+ key: 2,
314
+ class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
315
+ }, Me = { class: "text-sm text-slate-500" };
316
+ function Ne(e, t, n, r, i, a) {
317
+ return r.loading ? (g(), u("div", D, " Завантаження… ")) : r.surveyor ? (g(), u("div", O, [d("header", k, [d("nav", A, [
318
+ p(r.RouterLink, {
319
+ to: r.listPath,
320
+ class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
321
+ }, {
322
+ default: S(() => [p(r.AppIcon, {
323
+ name: "home",
324
+ class: "h-3.5 w-3.5"
325
+ }), t[8] ||= f(" Реєстр користувачів ", -1)]),
326
+ _: 1
327
+ }, 8, ["to"]),
328
+ t[9] ||= d("span", { class: "text-slate-300" }, "/", -1),
329
+ d("span", j, y(r.fullName), 1)
330
+ ]), d("div", M, [d("div", N, [d("h1", P, y(r.fullName), 1), r.registryType ? (g(), c(r.UserTypeBadge, {
331
+ key: 0,
332
+ type: r.registryType
333
+ }, null, 8, ["type"])) : r.certificate?.certificate_type_data?.text ? (g(), u("span", F, y(r.certificate.certificate_type_data.text), 1)) : l("", !0)]), d("div", I, [d("button", {
334
+ type: "button",
335
+ class: "inline-flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 transition-colors hover:border-brand-300 hover:text-brand-700",
336
+ "aria-label": "Дії",
337
+ "aria-expanded": r.menuOpen,
338
+ onClick: t[0] ||= w((e) => r.menuOpen = !r.menuOpen, ["stop"])
339
+ }, [p(r.AppIcon, {
340
+ name: "more-vertical",
341
+ class: "h-4 w-4"
342
+ })], 8, L), r.menuOpen ? (g(), u("div", R, [
343
+ d("button", {
344
+ type: "button",
345
+ class: "flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
346
+ onClick: r.startEdit
347
+ }, [p(r.AppIcon, {
348
+ name: "pencil",
349
+ class: "h-4 w-4 shrink-0 text-slate-400"
350
+ }), t[10] ||= f(" Редагувати ", -1)]),
351
+ r.showResendRegistration ? (g(), u("button", {
352
+ key: 0,
353
+ type: "button",
354
+ class: "flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-60",
355
+ disabled: r.resending,
356
+ onClick: r.resendRegistrationInvite
357
+ }, [p(r.AppIcon, {
358
+ name: "send",
359
+ class: "h-4 w-4 shrink-0 text-slate-400"
360
+ }), f(" " + y(r.resending ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, z)) : l("", !0),
361
+ r.showResetPassword ? (g(), u("button", {
362
+ key: 1,
363
+ type: "button",
364
+ class: "flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
365
+ onClick: r.resetPassword
366
+ }, [p(r.AppIcon, {
367
+ name: "key-round",
368
+ class: "h-4 w-4 shrink-0 text-slate-400"
369
+ }), t[11] ||= f(" Згенерувати новий пароль ", -1)])) : l("", !0),
370
+ d("button", {
371
+ type: "button",
372
+ class: h(["flex w-full items-center gap-2 whitespace-nowrap px-3 py-2.5 text-sm transition-colors", r.accountEnabled ? "text-red-600 hover:bg-red-50" : "text-slate-700 hover:bg-slate-50"]),
373
+ onClick: r.toggleAccountBlock
374
+ }, [p(r.AppIcon, {
375
+ name: r.accountEnabled ? "ban" : "power",
376
+ class: h(["h-4 w-4 shrink-0", r.accountEnabled ? "" : "text-slate-400"])
377
+ }, null, 8, ["name", "class"]), f(" " + y(r.accountEnabled ? "Заблокувати повністю" : "Розблокувати"), 1)], 2)
378
+ ])) : l("", !0)])])]), d("div", B, [
379
+ p(r.AppealDetailSection, { title: "Інформація про користувача" }, {
380
+ icon: S(() => [p(r.AppIcon, {
381
+ name: "user",
382
+ class: "h-[18px] w-[18px]"
383
+ })]),
384
+ default: S(() => [r.editing ? (g(), u("dl", V, [
385
+ d("label", H, [t[12] ||= d("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), C(d("input", {
386
+ "onUpdate:modelValue": t[1] ||= (e) => r.draft.last_name = e,
387
+ type: "text",
388
+ class: h(r.fieldClass)
389
+ }, null, 512), [[b, r.draft.last_name]])]),
390
+ d("label", U, [t[13] ||= d("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), C(d("input", {
391
+ "onUpdate:modelValue": t[2] ||= (e) => r.draft.first_name = e,
392
+ type: "text",
393
+ class: h(r.fieldClass)
394
+ }, null, 512), [[b, r.draft.first_name]])]),
395
+ d("label", W, [t[14] ||= d("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), C(d("input", {
396
+ "onUpdate:modelValue": t[3] ||= (e) => r.draft.middle_name = e,
397
+ type: "text",
398
+ class: h(r.fieldClass)
399
+ }, null, 512), [[b, r.draft.middle_name]])]),
400
+ d("label", G, [t[15] ||= d("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Електронна пошта спеціаліста", -1), C(d("input", {
401
+ "onUpdate:modelValue": t[4] ||= (e) => r.draft.email = e,
402
+ type: "email",
403
+ class: h(r.fieldClass)
404
+ }, null, 512), [[b, r.draft.email]])]),
405
+ d("label", K, [t[16] ||= d("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Номер телефону спеціаліста", -1), C(d("input", {
406
+ "onUpdate:modelValue": t[5] ||= (e) => r.draft.phone = e,
407
+ type: "text",
408
+ class: h(r.fieldClass)
409
+ }, null, 512), [[b, r.draft.phone]])])
410
+ ])) : (g(), u("dl", q, [
411
+ p(r.AppealDetailField, {
412
+ label: "ПІБ",
413
+ highlight: ""
414
+ }, {
415
+ default: S(() => [f(y(r.fullName), 1)]),
416
+ _: 1
417
+ }),
418
+ p(r.AppealDetailField, { label: "Електронна пошта спеціаліста" }, {
419
+ default: S(() => [f(y(r.surveyor.email || "—"), 1)]),
420
+ _: 1
421
+ }),
422
+ p(r.AppealDetailField, { label: "Номер телефону спеціаліста" }, {
423
+ default: S(() => [f(y(r.surveyor.phone || "—"), 1)]),
424
+ _: 1
425
+ }),
426
+ r.showResendRegistration ? (g(), c(r.AppealDetailField, {
427
+ key: 0,
428
+ label: "Статус реєстрації"
429
+ }, {
430
+ default: S(() => [...t[17] ||= [d("span", { class: "text-amber-700" }, "Очікує завершення", -1)]]),
431
+ _: 1
432
+ })) : l("", !0),
433
+ p(r.AppealDetailField, { label: "Доступ до кабінету" }, {
434
+ default: S(() => [d("span", { class: h(r.accountEnabled ? "text-emerald-700" : "text-red-600") }, y(r.accountEnabled ? "Активний" : "Заблоковано"), 3)]),
435
+ _: 1
436
+ })
437
+ ]))]),
438
+ _: 1
439
+ }),
440
+ p(r.AppealDetailSection, { title: "Інформація про сертифікат" }, {
441
+ icon: S(() => [p(r.AppIcon, {
442
+ name: "award",
443
+ class: "h-[18px] w-[18px]"
444
+ })]),
445
+ default: S(() => [d("dl", J, [
446
+ p(r.AppealDetailField, { label: "Дата видачі кваліфікаційного сертифіката" }, {
447
+ default: S(() => [f(y(r.formatDate(r.certificate?.date_certificate) || "—"), 1)]),
448
+ _: 1
449
+ }),
450
+ p(r.AppealDetailField, { label: "Номер кваліфікаційного сертифіката" }, {
451
+ default: S(() => [f(y(r.certificate?.number_certificate || "—"), 1)]),
452
+ _: 1
453
+ }),
454
+ p(r.AppealDetailField, {
455
+ label: "Назва навчального закладу",
456
+ full: ""
457
+ }, {
458
+ default: S(() => [f(y(r.certificate?.name_school || "—"), 1)]),
459
+ _: 1
460
+ }),
461
+ p(r.AppealDetailField, { label: "Реєстр" }, {
462
+ default: S(() => [f(y(r.certificate?.certificate_type_data?.text || "—"), 1)]),
463
+ _: 1
464
+ }),
465
+ p(r.AppealDetailField, { label: "Місце роботи інженера-геодезиста" }, {
466
+ default: S(() => [f(y(r.certificate?.work_place || "—"), 1)]),
467
+ _: 1
468
+ })
469
+ ])]),
470
+ _: 1
471
+ }),
472
+ p(r.AppealDetailSection, { title: "Інформація про організацію" }, {
473
+ icon: S(() => [p(r.AppIcon, {
474
+ name: "building-2",
475
+ class: "h-[18px] w-[18px]"
476
+ })]),
477
+ default: S(() => [r.organizations.length === 0 ? (g(), u("p", Y, "Організацію не вказано.")) : (g(), u("div", {
478
+ key: 1,
479
+ class: h(r.organizationsAccordion ? "flex flex-col gap-2" : "")
480
+ }, [(g(!0), u(o, null, v(r.organizations, (e) => (g(), u("div", {
481
+ key: e.org_id,
482
+ class: h(r.organizationsAccordion ? "overflow-hidden rounded-lg border border-slate-200" : "")
483
+ }, [r.organizationsAccordion ? (g(), u("button", {
484
+ key: 0,
485
+ type: "button",
486
+ class: "flex w-full cursor-pointer items-center justify-between gap-3 bg-slate-50/60 px-4 py-3 text-left transition-colors hover:bg-slate-50",
487
+ "aria-expanded": r.organizationOpen(e.org_id),
488
+ onClick: (t) => r.toggleOrganization(e.org_id)
489
+ }, [d("span", ve, [d("span", X, y(e.name || "—"), 1), r.membershipEnabled(e) ? l("", !0) : (g(), u("span", Z, "Вимкнено в організації"))]), p(r.AppIcon, {
490
+ name: "chevron-down",
491
+ class: h(["h-4 w-4 shrink-0 text-slate-400 transition-transform", r.organizationOpen(e.org_id) ? "rotate-180" : ""])
492
+ }, null, 8, ["class"])], 8, _e)) : l("", !0), r.organizationOpen(e.org_id) ? (g(), u("dl", {
493
+ key: 1,
494
+ class: h(["grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2", r.organizationsAccordion ? "border-t border-slate-100 px-4 py-4" : ""])
495
+ }, [
496
+ p(r.AppealDetailField, {
497
+ label: "Назва організації",
498
+ highlight: ""
499
+ }, {
500
+ default: S(() => [p(r.RouterLink, {
501
+ to: {
502
+ name: "organization-detail",
503
+ params: { id: e.org_id }
504
+ },
505
+ class: "text-brand-600 transition-colors hover:text-brand-800 hover:underline"
506
+ }, {
507
+ default: S(() => [f(y(e.name || "—"), 1)]),
508
+ _: 2
509
+ }, 1032, ["to"])]),
510
+ _: 2
511
+ }, 1024),
512
+ p(r.AppealDetailField, {
513
+ label: "Юридична адреса",
514
+ full: ""
515
+ }, {
516
+ default: S(() => [f(y(e.legal_address || "—"), 1)]),
517
+ _: 2
518
+ }, 1024),
519
+ p(r.AppealDetailField, { label: "Email організації" }, {
520
+ default: S(() => [f(y(e.email || "—"), 1)]),
521
+ _: 2
522
+ }, 1024),
523
+ p(r.AppealDetailField, { label: "Телефон організації" }, {
524
+ default: S(() => [f(y(e.phone || "—"), 1)]),
525
+ _: 2
526
+ }, 1024),
527
+ p(r.AppealDetailField, {
528
+ label: "Доступ до організації",
529
+ full: ""
530
+ }, {
531
+ default: S(() => [d("span", Q, [d("span", { class: h(r.membershipEnabled(e) ? "text-emerald-700" : "text-red-600") }, y(r.membershipEnabled(e) ? "Активний" : "Деактивовано"), 3), d("button", {
532
+ type: "button",
533
+ class: h(["inline-flex cursor-pointer items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors", r.membershipEnabled(e) ? "border-red-200 text-red-600 hover:bg-red-50" : "border-slate-200 text-slate-700 hover:bg-slate-50"]),
534
+ onClick: (t) => r.toggleMembership(e)
535
+ }, [p(r.AppIcon, {
536
+ name: r.membershipEnabled(e) ? "user-x" : "power",
537
+ class: "h-3.5 w-3.5"
538
+ }, null, 8, ["name"]), f(" " + y(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, $)])]),
539
+ _: 2
540
+ }, 1024)
541
+ ], 2)) : l("", !0)], 2))), 128))], 2))]),
542
+ _: 1
543
+ }),
544
+ p(r.AppealDetailSection, { title: "Заявки користувача" }, {
545
+ icon: S(() => [p(r.AppIcon, {
546
+ name: "clipboard-list",
547
+ class: "h-[18px] w-[18px]"
548
+ })]),
549
+ default: S(() => [r.applicationsLoading && r.applications.length === 0 ? (g(), u("p", ye, "Завантаження…")) : r.applicationsError && r.applications.length === 0 ? (g(), u("p", be, y(r.applicationsError), 1)) : r.applications.length === 0 ? (g(), u("p", xe, "Заявок не знайдено.")) : (g(), u("div", Se, [d("div", { class: h(["overflow-x-auto", r.applicationsLoading ? "opacity-60" : ""]) }, [d("table", Ce, [
550
+ t[18] ||= d("colgroup", null, [
551
+ d("col", { class: "w-[20%]" }),
552
+ d("col", { class: "w-[25%]" }),
553
+ d("col", { class: "w-[55%]" })
554
+ ], -1),
555
+ t[19] ||= d("thead", { class: "text-xs font-semibold text-slate-500" }, [d("tr", { class: "border-b border-slate-100" }, [
556
+ d("th", { class: "px-1 py-2.5" }, "Номер"),
557
+ d("th", { class: "px-1 py-2.5" }, "Статус"),
558
+ d("th", { class: "px-1 py-2.5" }, "Адреса")
559
+ ])], -1),
560
+ d("tbody", we, [(g(!0), u(o, null, v(r.applications, (e) => (g(), u("tr", {
561
+ key: e.app_id,
562
+ class: "transition-colors hover:bg-brand-50/40"
563
+ }, [
564
+ d("td", Te, [p(r.RouterLink, {
565
+ to: `/requests/${e.app_id}`,
566
+ class: "font-semibold text-brand-700 hover:text-brand-900 hover:underline"
567
+ }, {
568
+ default: S(() => [f(y(e.number || "—"), 1)]),
569
+ _: 2
570
+ }, 1032, ["to"])]),
571
+ d("td", Ee, y(e.status_data?.text || e.status || "—"), 1),
572
+ d("td", De, y(r.appealAddress(e)), 1)
573
+ ]))), 128))])
574
+ ])], 2), r.applicationsTotal > 0 ? (g(), c(r.TablePagination, {
575
+ key: 0,
576
+ page: r.applicationsPage,
577
+ "onUpdate:page": t[6] ||= (e) => r.applicationsPage = e,
578
+ "page-size": r.applicationsPageSize,
579
+ "onUpdate:pageSize": t[7] ||= (e) => r.applicationsPageSize = e,
580
+ total: r.applicationsTotal
581
+ }, null, 8, [
582
+ "page",
583
+ "page-size",
584
+ "total"
585
+ ])) : l("", !0)]))]),
586
+ _: 1
587
+ }),
588
+ r.editing ? (g(), u("div", Oe, [d("button", {
589
+ type: "button",
590
+ 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",
591
+ disabled: r.saving,
592
+ onClick: r.cancelEdit
593
+ }, " Скасувати ", 8, ke), d("button", {
594
+ type: "button",
595
+ 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 disabled:opacity-60",
596
+ disabled: r.saving,
597
+ onClick: r.saveEdit
598
+ }, y(r.saving ? "Збереження…" : "Зберегти зміни"), 9, Ae)])) : l("", !0)
599
+ ])])) : (g(), u("div", je, [d("p", Me, y(r.error || "Користувача не знайдено."), 1), p(r.RouterLink, {
600
+ to: r.listPath,
601
+ class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
602
+ }, {
603
+ default: S(() => [...t[20] ||= [f(" Повернутися до реєстру ", -1)]]),
604
+ _: 1
605
+ }, 8, ["to"])]));
606
+ }
607
+ var Pe = /*#__PURE__*/ e(E, [["render", Ne], ["__file", "C:/softpro/surveyor/admin/src/pages/users/card.vue"]]);
608
+ //#endregion
609
+ export { Pe as default };
@@ -1,11 +1,11 @@
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, i } from "./resources-2e8RFqWR.js";
4
- import { t as a } from "./VerifiedBadge-D6L7mCdp.js";
5
- import { t as o } from "./UserTypeBadge-CuAMctTK.js";
6
- import { t as s } from "./UserAccessBadge-B5Q1LvNv.js";
7
- import { n as c, t as l } from "./AppealDetailField-DNpsGpPY.js";
8
- import { a as u } from "./surveyorAccount-C7UiiIYg.js";
2
+ import { n as t, t as n } from "./useEntityPath-C5Owtidc.js";
3
+ import { a 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 "./UserTypeBadge-LvnMuKGo.js";
6
+ import { t as s } from "./UserAccessBadge-DyZDv7Oo.js";
7
+ import { n as c, t as l } from "./AppealDetailField-DNRGpnyD.js";
8
+ import { a as u } from "./surveyorAccount-Cfba7ZVZ.js";
9
9
  import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, normalizeClass as b, openBlock as x, ref as S, renderList as C, toDisplayString as w, watch as T, withCtx as E } from "vue";
10
10
  import { RouterLink as D, useRoute as O } from "vue-router";
11
11
  //#region admin/src/pages/certificates/card.vue?vue&type=script&setup=true&lang.ts
@@ -39,7 +39,7 @@ var k = /*@__PURE__*/ y({
39
39
  async function E(e) {
40
40
  _.value = !0, v.value = "", h.value = null, g.value = [];
41
41
  try {
42
- let [t, n] = await Promise.all([r(`/api/resource/certificates/${encodeURIComponent(e)}`), i("surveyors", {
42
+ let [t, n] = await Promise.all([i(`/api/resource/certificates/${encodeURIComponent(e)}`), r("surveyors", {
43
43
  page: 1,
44
44
  limit: 100,
45
45
  filters: { certificate_id: e }
@@ -272,7 +272,10 @@ function $(e, t, n, r, i, a) {
272
272
  class: "transition-colors hover:bg-brand-50/40"
273
273
  }, [
274
274
  g("td", K, [v(r.RouterLink, {
275
- to: `/users/${e.surveyor_id}`,
275
+ to: {
276
+ name: "surveyor-detail",
277
+ params: { id: e.surveyor_id }
278
+ },
276
279
  class: "font-semibold text-brand-700 hover:text-brand-900 hover:underline"
277
280
  }, {
278
281
  default: E(() => [_(w(r.personName(e)), 1)]),
@@ -293,6 +296,6 @@ function $(e, t, n, r, i, a) {
293
296
  _: 1
294
297
  }, 8, ["to"])]));
295
298
  }
296
- var te = /*#__PURE__*/ e(k, [["render", $], ["__file", "D:/softpro/surveyor/admin/src/pages/certificates/card.vue"]]);
299
+ var te = /*#__PURE__*/ e(k, [["render", $], ["__file", "C:/softpro/surveyor/admin/src/pages/certificates/card.vue"]]);
297
300
  //#endregion
298
301
  export { te as default };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { o as t, t as n } from "./resources-2e8RFqWR.js";
2
+ import { c as t, n } from "./resources-Cj8BzrBX.js";
3
3
  import { n as r } from "./account-types-Br7gx_D_.js";
4
4
  //#region admin/src/static/registry/certificates/resource.ts
5
5
  var i = "certificates", a = {