@opengis/surveyor 0.0.19 → 0.0.20

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 (57) hide show
  1. package/dist/chunks/{AppIcon-CO70tpMX.js → AppIcon-Di5F4Bu_.js} +1 -1
  2. package/dist/chunks/{AppealDetailField-ByK9ZqR4.js → AppealDetailField-CWayoaII.js} +2 -2
  3. package/dist/chunks/AppealStatusBadge-DRWZst3M.js +430 -0
  4. package/dist/chunks/{AppealStatusBadge-BlAaNUSK.js → AppealStatusBadge-z77wwkFD.js} +2 -2
  5. package/dist/chunks/{ApplicationGeometryExportModal-DhKC31To.js → ApplicationGeometryExportModal-CH9VrqxO.js} +312 -324
  6. package/dist/chunks/{BaseModal-BJxKuONh.js → BaseModal-X-hzV_I2.js} +2 -2
  7. package/dist/chunks/{FormFilePicker-DxPQlxgy.js → FormFilePicker-D5fAUE0Z.js} +2 -2
  8. package/dist/chunks/{MapLayerMenu-B0TEoCJm.js → MapLayerMenu-CyVxRSNX.js} +1 -1
  9. package/dist/chunks/{RegistryForm-Dpis_ncj.js → RegistryForm-J7R4RWO3.js} +1 -1
  10. package/dist/chunks/{RegistryFormModal-CH4DbTvC.js → RegistryFormModal-B_EDwu9O.js} +3 -3
  11. package/dist/chunks/{RegistryToolbar-DisEejvi.js → RegistryToolbar-BDVaZ2Rf.js} +5 -5
  12. package/dist/chunks/{SurveyorTeleport-Cd6D92mo.js → SurveyorTeleport-Y-NJhfsb.js} +1 -1
  13. package/dist/chunks/{TablePagination-thQkE5iA.js → TablePagination-CZhRgCVr.js} +2 -2
  14. package/dist/chunks/{UserAccessBadge-DyZDv7Oo.js → UserAccessBadge-B5Q1LvNv.js} +1 -1
  15. package/dist/chunks/{UserTypeBadge-LvnMuKGo.js → UserTypeBadge-CuAMctTK.js} +1 -1
  16. package/dist/chunks/{VerifiedBadge-bk0n-rlC.js → VerifiedBadge-D6L7mCdp.js} +2 -2
  17. package/dist/chunks/{card-n83dNORm.js → card-BMe6jQRR.js} +10 -10
  18. package/dist/chunks/{card-DVuqR0rL.js → card-Bw_EXY3D.js} +4 -4
  19. package/dist/chunks/{card-Cs8_8A8i.js → card-Cll0FQ0z.js} +6 -6
  20. package/dist/chunks/{card-u5I--_Gb.js → card-DMt5SAoD.js} +5 -5
  21. package/dist/chunks/{card-DuGbROGY.js → card-Dy333mEd.js} +9 -9
  22. package/dist/chunks/card-VMoiAe7V.js +1258 -0
  23. package/dist/chunks/{certificates-CDunSANR.js → certificates-URuwsRqg.js} +6 -6
  24. package/dist/chunks/{create-DQPxIZMW.js → create-CJXITPL0.js} +9 -9
  25. package/dist/chunks/downloadAttachmentFilename-B_4jZuOa.js +11 -0
  26. package/dist/chunks/{forgot-DfsFu-yY.js → forgot-JFlAKndO.js} +2 -2
  27. package/dist/chunks/{login-Dl0nTWs9.js → login-Bd6krLDP.js} +2 -2
  28. package/dist/chunks/{map-BoHEgBCw.js → map-CNPzf0wE.js} +44 -44
  29. package/dist/chunks/{map-layers-CRE8lZzH.js → map-layers-BgK6h6AD.js} +6 -6
  30. package/dist/chunks/{organizations-D6aazMAe.js → organizations-BLYhVQwf.js} +7 -7
  31. package/dist/chunks/{profile-CkwMFh82.js → profile-F7mr0poI.js} +3 -3
  32. package/dist/chunks/{registration-BSz1iLbO.js → registration-DIA4xV-t.js} +2 -2
  33. package/dist/chunks/{requests-D1ix8U5f.js → requests-CPVQ1Yy_.js} +5 -5
  34. package/dist/chunks/{requests-B9Ejt4av.js → requests-D-QPPUe4.js} +9 -9
  35. package/dist/chunks/{reset-D5G0x5Zi.js → reset-DR3GXwrH.js} +2 -2
  36. package/dist/chunks/{useEntityPath-C5Owtidc.js → useEntityPath-8s0Y1tjA.js} +1 -1
  37. package/dist/chunks/{users-DMe6JYI0.js → users-BsWV3iTt.js} +7 -7
  38. package/dist/index.js +40 -40
  39. package/migrations/20261016120000_map_layers.sql +156 -156
  40. package/migrations/20261016150000_password_reset.sql +15 -15
  41. package/migrations/20261016180000_settlement_lookup.sql +16 -16
  42. package/package.json +80 -80
  43. package/server/dictionaries/index.ts +17 -17
  44. package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
  45. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
  46. package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
  47. package/server/modules/surveyor/route.ts +20 -0
  48. package/server/modules/surveyor/schema.ts +11 -0
  49. package/server/modules/surveyor/services/changeApplicationStatus.ts +100 -0
  50. package/server/modules/surveyor/services/mapLayers.ts +61 -61
  51. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
  52. package/server/resources/helpers/settlement_lookup.ts +7 -7
  53. package/server/resources/surveyor-admin/applications.ts +126 -126
  54. package/server/resources/surveyor-admin/certificates.ts +113 -113
  55. package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
  56. package/dist/chunks/AppealStatusBadge-DzMn4RVy.js +0 -295
  57. package/dist/chunks/card-BP2byleo.js +0 -1327
@@ -0,0 +1,1258 @@
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 { d as r, l as i, s as a, u as o } from "./resources-Cj8BzrBX.js";
4
+ import { n as s, t as c } from "./AppealDetailField-CWayoaII.js";
5
+ import { t as l } from "./BaseModal-X-hzV_I2.js";
6
+ import { t as u } from "./RegistryForm-J7R4RWO3.js";
7
+ import { a as d, c as f, i as p, l as m, o as h, r as g, s as _, t as v } from "./AppealStatusBadge-DRWZst3M.js";
8
+ import { r as y } from "./geometry-DyhIVRcw.js";
9
+ import { a as b, c as x, i as S, l as C, n as w, o as T, r as E, s as D, t as O } from "./ApplicationGeometryExportModal-CH9VrqxO.js";
10
+ import { Fragment as k, computed as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createTextVNode as F, createVNode as I, defineComponent as L, mergeModels as R, normalizeClass as z, openBlock as B, ref as V, renderList as H, toDisplayString as U, useModel as W, vModelRadio as G, vModelSelect as K, vModelText as q, watch as J, withCtx as Y, withDirectives as X } from "vue";
11
+ import { RouterLink as ee, useRoute as te, useRouter as ne } from "vue-router";
12
+ import { notify as re } from "@opengis/core";
13
+ //#region admin/src/pages/requests/components/AppealDetailBoolean.vue?vue&type=script&setup=true&lang.ts
14
+ var Z = /*@__PURE__*/ L({
15
+ __name: "AppealDetailBoolean",
16
+ props: {
17
+ label: {
18
+ type: String,
19
+ required: !0
20
+ },
21
+ value: {
22
+ type: Boolean,
23
+ required: !0
24
+ }
25
+ },
26
+ setup(e, { expose: n }) {
27
+ n();
28
+ let r = { AppIcon: t };
29
+ return Object.defineProperty(r, "__isScriptSetup", {
30
+ enumerable: !1,
31
+ value: !0
32
+ }), r;
33
+ }
34
+ }), Q = { class: "mb-1 text-xs font-medium text-slate-500" }, ie = {
35
+ key: 0,
36
+ class: "inline-flex items-center gap-1.5 text-[14px] font-medium text-emerald-700"
37
+ }, ae = {
38
+ key: 1,
39
+ class: "inline-flex items-center gap-1.5 text-[14px] font-medium text-slate-400"
40
+ };
41
+ function $(e, t, n, r, i, a) {
42
+ return B(), N("div", null, [P("dt", Q, U(n.label), 1), P("dd", null, [n.value ? (B(), N("span", ie, [I(r.AppIcon, {
43
+ name: "circle-check",
44
+ class: "h-4 w-4"
45
+ }), t[0] ||= F(" Так ", -1)])) : (B(), N("span", ae, [I(r.AppIcon, {
46
+ name: "circle-x",
47
+ class: "h-4 w-4"
48
+ }), t[1] ||= F(" Ні ", -1)]))])]);
49
+ }
50
+ var oe = /*#__PURE__*/ e(Z, [["render", $], ["__file", "D:/softpro/surveyor/admin/src/pages/requests/components/AppealDetailBoolean.vue"]]), se = /*@__PURE__*/ L({
51
+ __name: "FormFilePicker",
52
+ props: {
53
+ fileName: {
54
+ type: String,
55
+ required: !1
56
+ },
57
+ accept: {
58
+ type: String,
59
+ required: !1
60
+ },
61
+ buttonLabel: {
62
+ type: String,
63
+ required: !1
64
+ }
65
+ },
66
+ emits: ["change"],
67
+ setup(e, { expose: n, emit: r }) {
68
+ n();
69
+ let i = e, a = r, o = V(null);
70
+ function s() {
71
+ o.value?.click();
72
+ }
73
+ function c(e) {
74
+ let t = e.target.files?.[0] ?? null;
75
+ a("change", t);
76
+ }
77
+ J(() => i.fileName, (e) => {
78
+ !e && o.value && (o.value.value = "");
79
+ });
80
+ let l = {
81
+ props: i,
82
+ emit: a,
83
+ inputRef: o,
84
+ openPicker: s,
85
+ onInputChange: c,
86
+ AppIcon: t
87
+ };
88
+ return Object.defineProperty(l, "__isScriptSetup", {
89
+ enumerable: !1,
90
+ value: !0
91
+ }), l;
92
+ }
93
+ }), ce = { class: "rounded-xl border border-dashed border-slate-200 bg-slate-50/80 px-4 py-3 transition-colors hover:border-slate-300 hover:bg-slate-50" }, le = { class: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between" }, ue = { class: "flex min-w-0 flex-1 items-center gap-3" }, de = { class: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-white text-slate-400 shadow-sm ring-1 ring-slate-100" }, fe = { class: "min-w-0" }, pe = {
94
+ key: 0,
95
+ class: "truncate text-sm font-medium text-slate-800"
96
+ }, me = {
97
+ key: 1,
98
+ class: "text-sm text-slate-400"
99
+ }, he = ["accept"];
100
+ function ge(e, t, n, r, i, a) {
101
+ return B(), N("div", ce, [P("div", le, [P("div", ue, [P("span", de, [I(r.AppIcon, {
102
+ name: "file-text",
103
+ class: "h-[18px] w-[18px]"
104
+ })]), P("div", fe, [n.fileName ? (B(), N("p", pe, U(n.fileName), 1)) : (B(), N("p", me, "Файл не обрано")), t[0] ||= P("p", { class: "mt-0.5 text-xs text-slate-400" }, "ZIP, GeoJSON або інший дозволений формат", -1)])]), P("button", {
105
+ type: "button",
106
+ class: "inline-flex shrink-0 items-center justify-center gap-2 rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:border-[#8ec1ff] hover:bg-[#eef6ff] hover:text-[#1a46b8]",
107
+ onClick: r.openPicker
108
+ }, [I(r.AppIcon, {
109
+ name: "upload",
110
+ class: "h-4 w-4 text-[#3479f6]"
111
+ }), F(" " + U(n.buttonLabel ?? "Обрати файл"), 1)])]), P("input", {
112
+ ref: "inputRef",
113
+ type: "file",
114
+ class: "hidden",
115
+ accept: n.accept,
116
+ onChange: r.onInputChange
117
+ }, null, 40, he)]);
118
+ }
119
+ var _e = /*#__PURE__*/ e(se, [["render", ge], ["__file", "D:/softpro/surveyor/admin/src/components/ui/FormFilePicker.vue"]]), ve = /*@__PURE__*/ L({
120
+ __name: "ApplicationWorkflowActions",
121
+ props: {
122
+ applicationId: {
123
+ type: String,
124
+ required: !0
125
+ },
126
+ status: {
127
+ type: String,
128
+ required: !0
129
+ }
130
+ },
131
+ emits: ["done", "error"],
132
+ setup(e, { expose: t, emit: n }) {
133
+ let r = e, i = n, a = V(!1), o = V(""), s = V(!1), c = V("issue"), u = V(""), d = V(null), g = V(""), v = V(!1), y = V(""), b = 0, x = V(!1), S = V("verified"), C = V(""), w = V(null), T = V(""), E = V(!1), D = V(""), O = 0, k = V(!1), j = A(() => r.status === "awaitingData"), M = A(() => r.status === "underReview"), N = A(() => r.status === "verified");
134
+ function P() {
135
+ o.value = "";
136
+ }
137
+ function F() {
138
+ d.value = null, g.value = "", y.value = "", v.value = !1, u.value = "", b += 1;
139
+ }
140
+ function I() {
141
+ w.value = null, T.value = "", D.value = "", E.value = !1, C.value = "", O += 1;
142
+ }
143
+ J(s, (e) => {
144
+ e || F();
145
+ }), J(x, (e) => {
146
+ e || I();
147
+ });
148
+ async function L(e) {
149
+ a.value = !0, o.value = "";
150
+ try {
151
+ await e(), i("done");
152
+ } catch (e) {
153
+ let t = e instanceof Error ? e.message : "Не вдалося виконати дію";
154
+ o.value = t, i("error", t);
155
+ } finally {
156
+ a.value = !1;
157
+ }
158
+ }
159
+ function R() {
160
+ P(), F(), c.value = "issue", s.value = !0;
161
+ }
162
+ function z() {
163
+ P(), F(), c.value = "replace", s.value = !0;
164
+ }
165
+ function B() {
166
+ P(), I(), x.value = !0;
167
+ }
168
+ function H() {
169
+ P(), k.value = !0;
170
+ }
171
+ async function U(e) {
172
+ if (d.value = e, g.value = "", y.value = "", !e) return;
173
+ let t = ++b;
174
+ v.value = !0;
175
+ try {
176
+ let n = await f(r.applicationId, e);
177
+ if (t !== b) return;
178
+ g.value = n.file_path;
179
+ } catch (e) {
180
+ if (t !== b) return;
181
+ y.value = e instanceof Error ? e.message : "Не вдалося завантажити файл", i("error", y.value);
182
+ } finally {
183
+ t === b && (v.value = !1);
184
+ }
185
+ }
186
+ async function W(e) {
187
+ if (w.value = e, T.value = "", D.value = "", !e) return;
188
+ let t = ++O;
189
+ E.value = !0;
190
+ try {
191
+ let n = await f(r.applicationId, e);
192
+ if (t !== O) return;
193
+ T.value = n.file_path;
194
+ } catch (e) {
195
+ if (t !== O) return;
196
+ D.value = e instanceof Error ? e.message : "Не вдалося завантажити файл", i("error", D.value);
197
+ } finally {
198
+ t === O && (E.value = !1);
199
+ }
200
+ }
201
+ async function G() {
202
+ if (!g.value) {
203
+ o.value = y.value || "Спочатку завантажте файл вихідних даних";
204
+ return;
205
+ }
206
+ await L(async () => {
207
+ c.value === "replace" ? await _(r.applicationId, g.value) : await h(r.applicationId, g.value, u.value), s.value = !1;
208
+ });
209
+ }
210
+ async function K() {
211
+ if (S.value === "dataIssued" && !C.value.trim()) {
212
+ o.value = "Вкажіть причину повернення на доопрацювання";
213
+ return;
214
+ }
215
+ if (w.value && !T.value) {
216
+ o.value = D.value || "Дочекайтесь завантаження файлу або оберіть інший";
217
+ return;
218
+ }
219
+ await L(async () => {
220
+ await m(r.applicationId, {
221
+ status: S.value,
222
+ ...T.value ? { file_path: T.value } : {},
223
+ ...S.value === "dataIssued" || C.value.trim() ? { note_4_file_corrected_geodetic_survey: C.value.trim() } : {}
224
+ }), x.value = !1;
225
+ });
226
+ }
227
+ async function q() {
228
+ await L(async () => {
229
+ await p(r.applicationId), k.value = !1;
230
+ });
231
+ }
232
+ t({
233
+ openIssue: R,
234
+ openReplaceOutput: z,
235
+ openVerify: B,
236
+ openComplete: H,
237
+ canIssue: j,
238
+ canVerify: M,
239
+ canComplete: N,
240
+ actionError: o,
241
+ busy: a
242
+ });
243
+ let Y = {
244
+ props: r,
245
+ emit: i,
246
+ busy: a,
247
+ actionError: o,
248
+ issueOpen: s,
249
+ issueMode: c,
250
+ issueNote: u,
251
+ issueFile: d,
252
+ issueUploadedPath: g,
253
+ issueUploadBusy: v,
254
+ issueUploadError: y,
255
+ get issueUploadSeq() {
256
+ return b;
257
+ },
258
+ set issueUploadSeq(e) {
259
+ b = e;
260
+ },
261
+ verifyOpen: x,
262
+ verifyDecision: S,
263
+ verifyNote: C,
264
+ verifyFile: w,
265
+ verifyUploadedPath: T,
266
+ verifyUploadBusy: E,
267
+ verifyUploadError: D,
268
+ get verifyUploadSeq() {
269
+ return O;
270
+ },
271
+ set verifyUploadSeq(e) {
272
+ O = e;
273
+ },
274
+ completeOpen: k,
275
+ canIssue: j,
276
+ canVerify: M,
277
+ canComplete: N,
278
+ resetErrors: P,
279
+ resetIssueModal: F,
280
+ resetVerifyModal: I,
281
+ runAction: L,
282
+ openIssue: R,
283
+ openReplaceOutput: z,
284
+ openVerify: B,
285
+ openComplete: H,
286
+ onIssueFileChange: U,
287
+ onVerifyFileChange: W,
288
+ submitIssue: G,
289
+ submitVerify: K,
290
+ submitComplete: q,
291
+ BaseModal: l,
292
+ FormFilePicker: _e
293
+ };
294
+ return Object.defineProperty(Y, "__isScriptSetup", {
295
+ enumerable: !1,
296
+ value: !0
297
+ }), Y;
298
+ }
299
+ }), ye = { class: "space-y-4" }, be = {
300
+ key: 0,
301
+ class: "mt-1.5 text-xs text-red-700"
302
+ }, xe = {
303
+ key: 1,
304
+ class: "mt-1.5 text-xs text-emerald-700"
305
+ }, Se = { key: 0 }, Ce = {
306
+ key: 1,
307
+ class: "text-xs text-red-700"
308
+ }, we = { class: "flex justify-end gap-2" }, Te = ["disabled"], Ee = { class: "space-y-4" }, De = { class: "flex gap-4 text-sm" }, Oe = { class: "flex items-center gap-2" }, ke = { class: "flex items-center gap-2" }, Ae = { class: "mb-1 block text-xs font-medium text-slate-500" }, je = {
309
+ key: 0,
310
+ class: "mt-1.5 text-xs text-red-700"
311
+ }, Me = {
312
+ key: 1,
313
+ class: "mt-1.5 text-xs text-emerald-700"
314
+ }, Ne = {
315
+ key: 0,
316
+ class: "text-xs text-red-700"
317
+ }, Pe = { class: "flex justify-end gap-2" }, Fe = ["disabled"], Ie = { class: "flex justify-end gap-2" }, Le = ["disabled"];
318
+ function Re(e, t, n, r, i, a) {
319
+ return B(), N(k, null, [
320
+ I(r.BaseModal, {
321
+ modelValue: r.issueOpen,
322
+ "onUpdate:modelValue": t[2] ||= (e) => r.issueOpen = e,
323
+ title: r.issueMode === "replace" ? "Заміна вихідних даних" : "Видача вихідних даних"
324
+ }, {
325
+ footer: Y(() => [P("div", we, [P("button", {
326
+ type: "button",
327
+ class: "rounded-lg px-4 py-2 text-sm text-slate-600 hover:bg-slate-100",
328
+ onClick: t[1] ||= (e) => r.issueOpen = !1
329
+ }, "Скасувати"), P("button", {
330
+ type: "button",
331
+ class: "rounded-lg bg-[#1f5ae0] px-4 py-2 text-sm font-semibold text-white hover:bg-[#1a46b8] disabled:opacity-50",
332
+ disabled: r.busy || r.issueUploadBusy || !r.issueUploadedPath,
333
+ onClick: r.submitIssue
334
+ }, U(r.issueMode === "replace" ? "Зберегти" : "Видати"), 9, Te)])]),
335
+ default: Y(() => [P("div", ye, [
336
+ P("div", null, [
337
+ t[10] ||= P("label", { class: "mb-1.5 block text-xs font-medium text-slate-500" }, "Файл", -1),
338
+ I(r.FormFilePicker, {
339
+ "file-name": r.issueUploadBusy ? "Завантаження…" : r.issueFile?.name,
340
+ onChange: r.onIssueFileChange
341
+ }, null, 8, ["file-name"]),
342
+ r.issueUploadError ? (B(), N("p", be, U(r.issueUploadError), 1)) : r.issueUploadedPath ? (B(), N("p", xe, "Файл завантажено")) : M("", !0)
343
+ ]),
344
+ r.issueMode === "issue" ? (B(), N("div", Se, [t[11] ||= P("label", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Примітка", -1), X(P("textarea", {
345
+ "onUpdate:modelValue": t[0] ||= (e) => r.issueNote = e,
346
+ rows: "3",
347
+ class: "w-full rounded-lg border border-slate-200 px-3 py-2 text-sm shadow-sm focus:border-[#8ec1ff] focus:outline-none focus:ring-2 focus:ring-[#d9eaff]"
348
+ }, null, 512), [[q, r.issueNote]])])) : M("", !0),
349
+ r.actionError ? (B(), N("p", Ce, U(r.actionError), 1)) : M("", !0)
350
+ ])]),
351
+ _: 1
352
+ }, 8, ["modelValue", "title"]),
353
+ I(r.BaseModal, {
354
+ modelValue: r.verifyOpen,
355
+ "onUpdate:modelValue": t[7] ||= (e) => r.verifyOpen = e,
356
+ title: "Перевірка матеріалів",
357
+ width: "max-w-xl"
358
+ }, {
359
+ footer: Y(() => [P("div", Pe, [P("button", {
360
+ type: "button",
361
+ class: "rounded-lg px-4 py-2 text-sm text-slate-600 hover:bg-slate-100",
362
+ onClick: t[6] ||= (e) => r.verifyOpen = !1
363
+ }, "Скасувати"), P("button", {
364
+ type: "button",
365
+ class: "rounded-lg bg-[#1f5ae0] px-4 py-2 text-sm font-semibold text-white hover:bg-[#1a46b8] disabled:opacity-50",
366
+ disabled: r.busy || r.verifyUploadBusy,
367
+ onClick: r.submitVerify
368
+ }, " Зберегти ", 8, Fe)])]),
369
+ default: Y(() => [P("div", Ee, [
370
+ P("div", De, [P("label", Oe, [X(P("input", {
371
+ "onUpdate:modelValue": t[3] ||= (e) => r.verifyDecision = e,
372
+ type: "radio",
373
+ value: "verified"
374
+ }, null, 512), [[G, r.verifyDecision]]), t[12] ||= F(" Прийняти ", -1)]), P("label", ke, [X(P("input", {
375
+ "onUpdate:modelValue": t[4] ||= (e) => r.verifyDecision = e,
376
+ type: "radio",
377
+ value: "dataIssued"
378
+ }, null, 512), [[G, r.verifyDecision]]), t[13] ||= F(" На доопрацювання ", -1)])]),
379
+ P("div", null, [P("label", Ae, U(r.verifyDecision === "dataIssued" ? "Причина (обовʼязково)" : "Примітка"), 1), X(P("textarea", {
380
+ "onUpdate:modelValue": t[5] ||= (e) => r.verifyNote = e,
381
+ rows: "3",
382
+ class: "w-full rounded-lg border border-slate-200 px-3 py-2 text-sm"
383
+ }, null, 512), [[q, r.verifyNote]])]),
384
+ P("div", null, [
385
+ t[14] ||= P("label", { class: "mb-1.5 block text-xs font-medium text-slate-500" }, "Виправлений файл (за потреби)", -1),
386
+ I(r.FormFilePicker, {
387
+ "file-name": r.verifyUploadBusy ? "Завантаження…" : r.verifyFile?.name,
388
+ "button-label": "Додати файл",
389
+ onChange: r.onVerifyFileChange
390
+ }, null, 8, ["file-name"]),
391
+ r.verifyUploadError ? (B(), N("p", je, U(r.verifyUploadError), 1)) : r.verifyUploadedPath ? (B(), N("p", Me, "Файл завантажено")) : M("", !0)
392
+ ]),
393
+ r.actionError ? (B(), N("p", Ne, U(r.actionError), 1)) : M("", !0)
394
+ ])]),
395
+ _: 1
396
+ }, 8, ["modelValue"]),
397
+ I(r.BaseModal, {
398
+ modelValue: r.completeOpen,
399
+ "onUpdate:modelValue": t[9] ||= (e) => r.completeOpen = e,
400
+ title: "Завершення заявки"
401
+ }, {
402
+ footer: Y(() => [P("div", Ie, [P("button", {
403
+ type: "button",
404
+ class: "rounded-lg px-4 py-2 text-sm text-slate-600 hover:bg-slate-100",
405
+ onClick: t[8] ||= (e) => r.completeOpen = !1
406
+ }, "Скасувати"), P("button", {
407
+ type: "button",
408
+ class: "rounded-lg bg-emerald-600 px-4 py-2 text-sm font-semibold text-white hover:bg-emerald-700 disabled:opacity-50",
409
+ disabled: r.busy,
410
+ onClick: r.submitComplete
411
+ }, " Підтвердити ", 8, Le)])]),
412
+ default: Y(() => [t[15] ||= P("p", { class: "text-sm text-slate-600" }, "Підтвердити внесення результатів до ЄЦТО та завершення заявки?", -1)]),
413
+ _: 1
414
+ }, 8, ["modelValue"])
415
+ ], 64);
416
+ }
417
+ var ze = /*#__PURE__*/ e(ve, [["render", Re], ["__file", "D:/softpro/surveyor/admin/src/pages/requests/components/ApplicationWorkflowActions.vue"]]), Be = "w-full rounded-lg border border-slate-200 px-3 py-2 text-sm shadow-sm focus:border-[#8ec1ff] focus:outline-none focus:ring-2 focus:ring-[#d9eaff]", Ve = "w-full appearance-none rounded-lg border border-slate-200 bg-white py-2 pl-3 pr-9 text-sm shadow-sm focus:border-[#8ec1ff] focus:outline-none focus:ring-2 focus:ring-[#d9eaff] disabled:bg-slate-50 disabled:text-slate-400", He = /*@__PURE__*/ L({
418
+ __name: "ApplicationVectorExportModal",
419
+ props: /*@__PURE__*/ R({ applicationId: {
420
+ type: String,
421
+ required: !0
422
+ } }, {
423
+ modelValue: {
424
+ type: Boolean,
425
+ required: !0
426
+ },
427
+ modelModifiers: {}
428
+ }),
429
+ emits: ["update:modelValue"],
430
+ setup(e, { expose: n }) {
431
+ n();
432
+ let a = e, o = W(e, "modelValue"), s = V(""), c = V(100), u = V(""), f = V(""), p = V(!1), m = V(""), h = V(!1), g = V(!1), _ = V([]), v = V([]), y = w(i, r);
433
+ function b() {
434
+ y.invalidateInFlight(), s.value = "", c.value = 100, u.value = "", f.value = "", _.value = [], v.value = [], m.value = "", p.value = !1;
435
+ }
436
+ async function x(e) {
437
+ g.value = !0;
438
+ try {
439
+ let t = await y.load(e);
440
+ t && (v.value = t);
441
+ } catch (e) {
442
+ m.value = e instanceof Error ? e.message : "Не вдалося завантажити перелік СК";
443
+ } finally {
444
+ g.value = !1;
445
+ }
446
+ }
447
+ async function C() {
448
+ h.value = !0, _.value = [];
449
+ try {
450
+ let e = new URLSearchParams({ q: "" }), t = await fetch(i(`/api/suggestion/gis-layers?${e}`), { credentials: "include" });
451
+ if (!t.ok) {
452
+ let e = await t.text();
453
+ throw Error(r(e, t.status));
454
+ }
455
+ let n = await t.json();
456
+ _.value = (n.data ?? []).map((e) => ({
457
+ id: String(e.id),
458
+ label: e.text
459
+ })), _.value.length === 1 && (s.value = _.value[0].id);
460
+ } catch (e) {
461
+ m.value = e instanceof Error ? e.message : "Не вдалося завантажити перелік шарів";
462
+ } finally {
463
+ h.value = !1;
464
+ }
465
+ }
466
+ J(o, (e) => {
467
+ e && (b(), C(), x(""));
468
+ }), J([
469
+ s,
470
+ c,
471
+ u
472
+ ], () => {
473
+ m.value = "";
474
+ });
475
+ async function T() {
476
+ m.value = "";
477
+ let e = s.value.trim();
478
+ if (!e) {
479
+ m.value = "Оберіть шар для експорту";
480
+ return;
481
+ }
482
+ let t = c.value;
483
+ if (!Number.isFinite(t) || t < 0) {
484
+ m.value = "Буфер має бути невідʼємним числом";
485
+ return;
486
+ }
487
+ let n = u.value.trim();
488
+ if (!n) {
489
+ m.value = "Оберіть систему координат";
490
+ return;
491
+ }
492
+ p.value = !0;
493
+ try {
494
+ await d(a.applicationId, {
495
+ layer_id: e,
496
+ buffer: t,
497
+ crs: E(n)
498
+ }), o.value = !1;
499
+ } catch (e) {
500
+ m.value = e instanceof Error ? e.message : "Не вдалося експортувати вектор";
501
+ } finally {
502
+ p.value = !1;
503
+ }
504
+ }
505
+ let D = {
506
+ props: a,
507
+ open: o,
508
+ layerId: s,
509
+ bufferMeters: c,
510
+ srid: u,
511
+ sridLabel: f,
512
+ busy: p,
513
+ error: m,
514
+ layersLoading: h,
515
+ crsLoading: g,
516
+ layerOptions: _,
517
+ crsOptions: v,
518
+ crsSuggest: y,
519
+ fieldClass: Be,
520
+ selectFieldClass: Ve,
521
+ resetForm: b,
522
+ loadCrs: x,
523
+ loadLayers: C,
524
+ submit: T,
525
+ BaseModal: l,
526
+ AppIcon: t,
527
+ CrsSuggestionSelect: S
528
+ };
529
+ return Object.defineProperty(D, "__isScriptSetup", {
530
+ enumerable: !1,
531
+ value: !0
532
+ }), D;
533
+ }
534
+ }), Ue = { class: "space-y-4" }, We = { class: "relative" }, Ge = ["disabled"], Ke = {
535
+ value: "",
536
+ disabled: ""
537
+ }, qe = ["value"], Je = {
538
+ key: 0,
539
+ class: "mt-1.5 text-xs text-slate-400"
540
+ }, Ye = ["disabled"], Xe = {
541
+ key: 0,
542
+ class: "text-xs text-red-700"
543
+ }, Ze = { class: "flex justify-end gap-2" }, Qe = ["disabled"], $e = ["disabled"];
544
+ function et(e, t, n, r, i, a) {
545
+ return B(), j(r.BaseModal, {
546
+ modelValue: r.open,
547
+ "onUpdate:modelValue": t[5] ||= (e) => r.open = e,
548
+ title: "Експорт векторного шару",
549
+ width: "max-w-md"
550
+ }, {
551
+ footer: Y(() => [P("div", Ze, [P("button", {
552
+ type: "button",
553
+ class: "rounded-lg px-4 py-2 text-sm text-slate-600 hover:bg-slate-100",
554
+ disabled: r.busy,
555
+ onClick: t[4] ||= (e) => r.open = !1
556
+ }, " Скасувати ", 8, Qe), P("button", {
557
+ type: "button",
558
+ class: "rounded-lg bg-[#1f5ae0] px-4 py-2 text-sm font-semibold text-white hover:bg-[#1a46b8] disabled:opacity-50",
559
+ disabled: r.busy || r.layersLoading || r.crsLoading || !r.layerId || !r.srid,
560
+ onClick: r.submit
561
+ }, U(r.busy ? "Експорт…" : "Завантажити"), 9, $e)])]),
562
+ default: Y(() => [P("div", Ue, [
563
+ P("div", null, [
564
+ t[6] ||= P("label", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Шар", -1),
565
+ P("div", We, [X(P("select", {
566
+ "onUpdate:modelValue": t[0] ||= (e) => r.layerId = e,
567
+ class: z(r.selectFieldClass),
568
+ disabled: r.layersLoading || r.busy || !r.layerOptions.length
569
+ }, [P("option", Ke, U(r.layersLoading ? "Завантаження…" : "Оберіть шар"), 1), (B(!0), N(k, null, H(r.layerOptions, (e) => (B(), N("option", {
570
+ key: e.id,
571
+ value: e.id
572
+ }, U(e.label), 9, qe))), 128))], 8, Ge), [[K, r.layerId]]), I(r.AppIcon, {
573
+ name: "chevron-down",
574
+ class: "pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-500"
575
+ })]),
576
+ !r.layersLoading && !r.layerOptions.length && !r.error ? (B(), N("p", Je, " Шари не знайдено. ")) : M("", !0)
577
+ ]),
578
+ P("div", null, [t[7] ||= P("label", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Буфер, м", -1), X(P("input", {
579
+ "onUpdate:modelValue": t[1] ||= (e) => r.bufferMeters = e,
580
+ type: "number",
581
+ min: "0",
582
+ step: "1",
583
+ class: z(r.fieldClass),
584
+ disabled: r.busy
585
+ }, null, 8, Ye), [[
586
+ q,
587
+ r.bufferMeters,
588
+ void 0,
589
+ { number: !0 }
590
+ ]])]),
591
+ I(r.CrsSuggestionSelect, {
592
+ modelValue: r.srid,
593
+ "onUpdate:modelValue": t[2] ||= (e) => r.srid = e,
594
+ "display-value": r.sridLabel,
595
+ "onUpdate:displayValue": t[3] ||= (e) => r.sridLabel = e,
596
+ label: "Система координат",
597
+ options: r.crsOptions,
598
+ loading: r.crsLoading,
599
+ disabled: r.busy || r.crsLoading || !r.crsOptions.length,
600
+ variant: "admin",
601
+ onSearch: r.loadCrs
602
+ }, null, 8, [
603
+ "modelValue",
604
+ "display-value",
605
+ "options",
606
+ "loading",
607
+ "disabled"
608
+ ]),
609
+ r.error ? (B(), N("p", Xe, U(r.error), 1)) : M("", !0)
610
+ ])]),
611
+ _: 1
612
+ }, 8, ["modelValue"]);
613
+ }
614
+ var tt = /*#__PURE__*/ e(He, [["render", et], ["__file", "D:/softpro/surveyor/admin/src/pages/requests/components/ApplicationVectorExportModal.vue"]]), nt = "inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-lg bg-[#eef6ff] px-2.5 py-1.5 text-xs font-medium text-[#1f5ae0] transition-colors hover:bg-[#d9eaff]", rt = "inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-lg border border-[#8ec1ff]/50 bg-white px-2.5 py-1.5 text-xs font-medium text-[#1f5ae0] shadow-sm transition-colors hover:border-[#599dff] hover:bg-[#eef6ff]/40 disabled:opacity-50", it = /*@__PURE__*/ L({
615
+ __name: "card",
616
+ setup(e, { expose: l }) {
617
+ l();
618
+ let d = te(), f = ne(), { listPath: p } = n("number"), m = V(null), h = V(null), _ = A(() => d.query.edit === "1"), S = V(""), w = V(!1), E = V(""), k = V(null), j = V(""), M = V(!1), N = V(!1), P = V(!1), F = A(() => Z(m.value?.organization)), I = A(() => Z(m.value?.surveyor)), L = A(() => {
619
+ let e = m.value;
620
+ return e ? {
621
+ ...e,
622
+ id: e.app_id
623
+ } : null;
624
+ }), R = A(() => g(L.value));
625
+ function z() {
626
+ f.replace({ query: {
627
+ ...d.query,
628
+ edit: "1"
629
+ } });
630
+ }
631
+ function B() {
632
+ let e = { ...d.query };
633
+ delete e.edit, f.replace({ query: e });
634
+ }
635
+ async function H() {
636
+ let e = m.value?.app_id;
637
+ if (B(), e) try {
638
+ await $(e);
639
+ } catch (e) {
640
+ re({
641
+ type: "error",
642
+ title: "Помилка",
643
+ message: e instanceof Error ? e.message : "Не вдалося оновити звернення"
644
+ });
645
+ }
646
+ }
647
+ let U = A(() => {
648
+ let e = I.value;
649
+ return e && [
650
+ e.last_name,
651
+ e.first_name,
652
+ e.middle_name
653
+ ].filter(Boolean).join(" ") || "—";
654
+ }), W = A(() => ({
655
+ name: "Адміністратор",
656
+ role: "Перевірка",
657
+ initials: "АД"
658
+ }));
659
+ function G(e) {
660
+ let t = U.value === "—" ? "Заявник" : U.value, n = {
661
+ name: t,
662
+ role: "Заявник",
663
+ initials: D(t)
664
+ };
665
+ if (!e.created_by) return x;
666
+ if (e.created_by === o.currentUser?.id) return W.value;
667
+ let r = I.value?.surveyor_id;
668
+ return r && e.created_by === r ? n : W.value;
669
+ }
670
+ let K = A(() => m.value?.address_id_data?.text || "—"), q = A(() => m.value?.is_found_address_id === !0 || !!m.value?.address_id_data?.text?.trim()), Y = A(() => y(m.value?.geom)), X = A(() => {
671
+ let e = m.value;
672
+ if (!e) return [];
673
+ let t = [];
674
+ return y(e.geom) && (t.push({
675
+ id: "geometry",
676
+ label: "Межі заявки",
677
+ action: "exportGeometry"
678
+ }), t.push({
679
+ id: "vector-export",
680
+ label: "Експортувати вектор",
681
+ action: "exportVector"
682
+ })), e.status === "reserve" ? t : (e.status === "awaitingData" && !e.file_output ? t.push({
683
+ id: "issue",
684
+ label: "Вихідні дані",
685
+ action: "issue"
686
+ }) : e.file_output && t.push({
687
+ id: "output",
688
+ token: e.file_output,
689
+ label: "Вихідні дані",
690
+ action: "download",
691
+ replaceable: e.status !== "completed" && e.status !== "cancelled"
692
+ }), e.file_geodetic_survey && t.push({
693
+ id: "survey",
694
+ token: e.file_geodetic_survey,
695
+ label: "Здане топографо-геодезичне знімання",
696
+ action: "download"
697
+ }), e.file_corrected_geodetic_survey && t.push({
698
+ id: "corrected",
699
+ token: e.file_corrected_geodetic_survey,
700
+ label: "Відкорегований файл топографо-геодезичного знімання",
701
+ note: e.note_4_file_corrected_geodetic_survey?.trim() || void 0,
702
+ action: "download"
703
+ }), e.status === "underReview" && t.push({
704
+ id: "verify",
705
+ label: "Перевірка зданого знімання",
706
+ action: "verify"
707
+ }), e.status === "verified" && t.push({
708
+ id: "complete",
709
+ label: "Внесення в ЄЦТО",
710
+ action: "complete"
711
+ }), t);
712
+ });
713
+ function Z(e) {
714
+ return Array.isArray(e) ? e[0] ?? null : e ?? null;
715
+ }
716
+ function Q(e) {
717
+ if (!e) return "";
718
+ let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
719
+ return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
720
+ }
721
+ function ie(e) {
722
+ return `/api/file/${encodeURIComponent(e)}?download=true`;
723
+ }
724
+ async function ae(e) {
725
+ if (S.value = "", e) try {
726
+ let t = await a(`/api/resource/certificates/${encodeURIComponent(e)}`);
727
+ S.value = Q(t.date_certificate);
728
+ } catch {
729
+ S.value = "";
730
+ }
731
+ }
732
+ async function $(e) {
733
+ m.value = await a(`/api/resource/applications/${encodeURIComponent(e)}?include=organization,surveyor,status_history&limit=100`), await ae(Z(m.value.surveyor)?.certificate_id);
734
+ }
735
+ async function se(e) {
736
+ w.value = !0, E.value = "", m.value = null, S.value = "";
737
+ try {
738
+ await $(e);
739
+ } catch (e) {
740
+ m.value = null, E.value = e instanceof Error ? e.message : "Не вдалося завантажити звернення";
741
+ } finally {
742
+ w.value = !1;
743
+ }
744
+ }
745
+ J(() => String(d.params.number), (e) => {
746
+ e && se(e);
747
+ }, { immediate: !0 });
748
+ let ce = {
749
+ route: d,
750
+ router: f,
751
+ listPath: p,
752
+ application: m,
753
+ formRef: h,
754
+ editing: _,
755
+ certificateDate: S,
756
+ loading: w,
757
+ error: E,
758
+ workflowRef: k,
759
+ workflowError: j,
760
+ workflowBusy: M,
761
+ vectorExportOpen: N,
762
+ geometryExportOpen: P,
763
+ organization: F,
764
+ surveyor: I,
765
+ editRecord: L,
766
+ applicationForm: R,
767
+ startEdit: z,
768
+ cancelEdit: B,
769
+ onFormSaved: H,
770
+ applicantName: U,
771
+ commentCurrentAuthor: W,
772
+ resolveNoteAuthor: G,
773
+ address: K,
774
+ showAddress: q,
775
+ showMap: Y,
776
+ files: X,
777
+ fileDownloadBtnClass: nt,
778
+ fileUploadBtnClass: rt,
779
+ firstRelation: Z,
780
+ formatDate: Q,
781
+ fileUrl: ie,
782
+ loadCertificateDate: ae,
783
+ fetchApplication: $,
784
+ loadApplication: se,
785
+ AppIcon: t,
786
+ get RouterLink() {
787
+ return ee;
788
+ },
789
+ RegistryForm: u,
790
+ AppealStatusBadge: v,
791
+ AppealDetailSection: s,
792
+ AppealDetailField: c,
793
+ AppealDetailBoolean: oe,
794
+ AppealDetailMap: C,
795
+ ApplicationCommentsSection: T,
796
+ ApplicationHistorySection: b,
797
+ ApplicationWorkflowActions: ze,
798
+ ApplicationVectorExportModal: tt,
799
+ ApplicationGeometryExportModal: O,
800
+ get apiUrl() {
801
+ return i;
802
+ },
803
+ get errorMessage() {
804
+ return r;
805
+ }
806
+ };
807
+ return Object.defineProperty(ce, "__isScriptSetup", {
808
+ enumerable: !1,
809
+ value: !0
810
+ }), ce;
811
+ }
812
+ }), at = {
813
+ key: 0,
814
+ class: "px-4 py-16 text-center text-sm text-slate-400"
815
+ }, ot = { key: 1 }, st = { class: "mb-6 pl-8 lg:pl-0" }, ct = { class: "mb-4 flex items-center gap-1.5 text-sm" }, lt = { class: "font-medium text-slate-700" }, ut = { class: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between" }, dt = { class: "flex flex-col gap-1.5" }, ft = { class: "text-xl font-bold tracking-tight text-slate-900" }, pt = { class: "text-sm font-medium text-slate-500" }, mt = { class: "flex flex-wrap items-center gap-3" }, ht = { class: "grid grid-cols-1 items-start gap-5 xl:grid-cols-[minmax(0,1fr)_420px]" }, gt = { class: "flex flex-col gap-5" }, _t = {
816
+ key: 0,
817
+ class: "rounded-xl border border-slate-200 bg-white p-5 shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)]"
818
+ }, vt = { class: "mt-4 flex justify-end gap-3 border-t border-slate-100 pt-4" }, yt = { class: "grid grid-cols-2 gap-x-6 gap-y-4" }, bt = { class: "grid grid-cols-2 gap-x-6 gap-y-4" }, xt = { class: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3" }, St = { class: "grid grid-cols-1 gap-y-3" }, Ct = { class: "grid min-w-0 grid-cols-1 gap-6 xl:grid-cols-2" }, wt = { class: "grid min-w-0 grid-cols-1 gap-x-5 gap-y-3.5 sm:grid-cols-2" }, Tt = { class: "min-w-0 border-t border-slate-100 pt-6 xl:border-l xl:border-t-0 xl:pl-6 xl:pt-0" }, Et = { class: "grid min-w-0 grid-cols-1 gap-x-5 gap-y-3.5 sm:grid-cols-2" }, Dt = { key: 1 }, Ot = {
819
+ key: 0,
820
+ class: "mb-3 text-xs text-slate-500"
821
+ }, kt = {
822
+ key: 1,
823
+ class: "mb-3 text-xs text-red-700"
824
+ }, At = {
825
+ key: 2,
826
+ class: "divide-y divide-slate-100"
827
+ }, jt = { class: "min-w-0" }, Mt = { class: "break-words text-sm font-medium text-slate-800" }, Nt = {
828
+ key: 0,
829
+ class: "mt-0.5 text-xs text-slate-400"
830
+ }, Pt = {
831
+ key: 0,
832
+ class: "flex shrink-0 items-center gap-2"
833
+ }, Ft = ["disabled"], It = ["href"], Lt = ["disabled"], Rt = ["disabled"], zt = ["disabled"], Bt = {
834
+ key: 3,
835
+ class: "text-sm text-slate-400"
836
+ }, Vt = { class: "xl:sticky xl:top-6 xl:self-start" }, Ht = { class: "h-[600px] xl:h-[calc(100vh-3rem)] xl:max-h-[760px]" }, Ut = {
837
+ key: 1,
838
+ class: "flex h-full min-h-[320px] flex-col items-center justify-center rounded-2xl border border-slate-200 bg-white p-8 text-center shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)]"
839
+ }, Wt = {
840
+ key: 2,
841
+ class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)]"
842
+ }, Gt = { class: "text-sm text-slate-500" };
843
+ function Kt(e, t, n, r, i, a) {
844
+ return r.loading ? (B(), N("div", at, " Завантаження… ")) : r.application ? (B(), N("div", ot, [
845
+ P("div", st, [P("nav", ct, [
846
+ I(r.RouterLink, {
847
+ to: r.listPath,
848
+ class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-[#1f5ae0]"
849
+ }, {
850
+ default: Y(() => [I(r.AppIcon, {
851
+ name: "home",
852
+ class: "h-3.5 w-3.5"
853
+ }), t[11] ||= F(" Звернення ", -1)]),
854
+ _: 1
855
+ }, 8, ["to"]),
856
+ I(r.AppIcon, {
857
+ name: "chevron-right",
858
+ class: "h-3.5 w-3.5 text-slate-300"
859
+ }),
860
+ P("span", lt, U(r.application.number || "—"), 1)
861
+ ]), P("div", ut, [P("div", dt, [P("h1", ft, "Звернення " + U(r.application.number || "—"), 1), P("p", pt, U(r.organization?.name || "—"), 1)]), P("div", mt, [I(r.AppealStatusBadge, {
862
+ status: r.application.status || "",
863
+ label: r.application.status_data?.text || void 0
864
+ }, null, 8, ["status", "label"]), r.editing ? M("", !0) : (B(), N("button", {
865
+ key: 0,
866
+ type: "button",
867
+ 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-[#8ec1ff] hover:text-[#1a46b8]",
868
+ onClick: r.startEdit
869
+ }, [I(r.AppIcon, {
870
+ name: "pencil",
871
+ class: "h-4 w-4"
872
+ }), t[12] ||= F(" Редагувати ", -1)]))])])]),
873
+ P("div", ht, [P("div", gt, [
874
+ r.editing ? (B(), N("div", _t, [
875
+ t[13] ||= P("h2", { class: "mb-4 text-sm font-semibold text-slate-800" }, "Редагування звернення", -1),
876
+ I(r.RegistryForm, {
877
+ ref: "formRef",
878
+ config: r.applicationForm,
879
+ record: r.editRecord,
880
+ "hide-actions": "",
881
+ onSaved: r.onFormSaved,
882
+ onCancel: r.cancelEdit
883
+ }, null, 8, ["config", "record"]),
884
+ P("div", vt, [P("button", {
885
+ type: "button",
886
+ 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",
887
+ onClick: r.cancelEdit
888
+ }, " Скасувати "), P("button", {
889
+ type: "button",
890
+ class: "inline-flex h-10 items-center rounded-lg bg-[#1f5ae0] px-4 text-sm font-semibold text-white transition-colors hover:bg-[#1a46b8]",
891
+ onClick: t[0] ||= (e) => r.formRef?.submit()
892
+ }, " Зберегти зміни ")])
893
+ ])) : M("", !0),
894
+ r.editing ? M("", !0) : (B(), N(k, { key: 1 }, [I(r.AppealDetailSection, { title: "Заявка" }, {
895
+ icon: Y(() => [I(r.AppIcon, {
896
+ name: "file-check-2",
897
+ class: "h-[18px] w-[18px]"
898
+ })]),
899
+ default: Y(() => [P("dl", yt, [
900
+ I(r.AppealDetailField, {
901
+ label: "Номер звернення",
902
+ highlight: ""
903
+ }, {
904
+ default: Y(() => [F(U(r.application.number || "—"), 1)]),
905
+ _: 1
906
+ }),
907
+ P("div", null, [t[14] ||= P("dt", { class: "mb-1 text-xs font-medium text-slate-500" }, "Статус", -1), P("dd", null, [I(r.AppealStatusBadge, {
908
+ status: r.application.status || "",
909
+ label: r.application.status_data?.text || void 0,
910
+ size: "sm"
911
+ }, null, 8, ["status", "label"])])]),
912
+ I(r.AppealDetailBoolean, {
913
+ label: "Внесено в ЄЦТО",
914
+ value: r.application.status === "completed" || !!r.application.integrated_at
915
+ }, null, 8, ["value"]),
916
+ I(r.AppealDetailField, { label: "Перевірив" }, {
917
+ default: Y(() => [F(U(r.application.verified_by_data?.text || "—"), 1)]),
918
+ _: 1
919
+ }),
920
+ I(r.AppealDetailField, { label: "Вид робіт" }, {
921
+ default: Y(() => [F(U(r.application.work_type_data?.text || "—"), 1)]),
922
+ _: 1
923
+ }),
924
+ I(r.AppealDetailField, {
925
+ label: "Опис запиту",
926
+ full: ""
927
+ }, {
928
+ default: Y(() => [F(U(r.application.description || "—"), 1)]),
929
+ _: 1
930
+ }),
931
+ I(r.AppealDetailField, {
932
+ label: "Підстава виконання робіт",
933
+ full: ""
934
+ }, {
935
+ default: Y(() => [F(U(r.application.execution_basis || "—"), 1)]),
936
+ _: 1
937
+ }),
938
+ I(r.AppealDetailField, {
939
+ label: "Примітки",
940
+ full: ""
941
+ }, {
942
+ default: Y(() => [F(U(r.application.notes || "—"), 1)]),
943
+ _: 1
944
+ }),
945
+ r.application.signature ? (B(), j(r.AppealDetailField, {
946
+ key: 0,
947
+ label: "Підпис",
948
+ full: ""
949
+ }, {
950
+ default: Y(() => [F(U(r.application.signature), 1)]),
951
+ _: 1
952
+ })) : M("", !0)
953
+ ])]),
954
+ _: 1
955
+ }), I(r.AppealDetailSection, { title: "Об'єкт робіт" }, {
956
+ icon: Y(() => [I(r.AppIcon, {
957
+ name: "building-2",
958
+ class: "h-[18px] w-[18px]"
959
+ })]),
960
+ default: Y(() => [P("dl", bt, [
961
+ I(r.AppealDetailField, {
962
+ label: "Площа, га",
963
+ highlight: ""
964
+ }, {
965
+ default: Y(() => [F(U(r.application.area ?? "—"), 1)]),
966
+ _: 1
967
+ }),
968
+ r.showAddress ? (B(), j(r.AppealDetailField, {
969
+ key: 0,
970
+ label: "Адреса",
971
+ full: ""
972
+ }, {
973
+ default: Y(() => [F(U(r.address), 1)]),
974
+ _: 1
975
+ })) : M("", !0),
976
+ r.application?.location ? (B(), j(r.AppealDetailField, {
977
+ key: 1,
978
+ label: "Місцезнаходження",
979
+ full: ""
980
+ }, {
981
+ default: Y(() => [F(U(r.application.location || "—"), 1)]),
982
+ _: 1
983
+ })) : M("", !0)
984
+ ])]),
985
+ _: 1
986
+ })], 64)),
987
+ I(r.AppealDetailSection, { title: "Дати та етапи" }, {
988
+ icon: Y(() => [I(r.AppIcon, {
989
+ name: "calendar-days",
990
+ class: "h-[18px] w-[18px]"
991
+ })]),
992
+ default: Y(() => [P("dl", xt, [
993
+ I(r.AppealDetailField, {
994
+ label: "Дата прийому заявки",
995
+ highlight: ""
996
+ }, {
997
+ default: Y(() => [F(U(r.formatDate(r.application.created_at) || "—"), 1)]),
998
+ _: 1
999
+ }),
1000
+ I(r.AppealDetailField, { label: "Дата видачі даних" }, {
1001
+ default: Y(() => [F(U(r.formatDate(r.application.source_data_issued_at) || "—"), 1)]),
1002
+ _: 1
1003
+ }),
1004
+ I(r.AppealDetailField, { label: "Дата скасування" }, {
1005
+ default: Y(() => [F(U(r.formatDate(r.application.cancelled_at) || "—"), 1)]),
1006
+ _: 1
1007
+ }),
1008
+ I(r.AppealDetailField, { label: "Дата прийому даних" }, {
1009
+ default: Y(() => [F(U(r.formatDate(r.application.survey_uploaded_at) || "—"), 1)]),
1010
+ _: 1
1011
+ }),
1012
+ I(r.AppealDetailField, { label: "Дата внесення в ЄЦТО" }, {
1013
+ default: Y(() => [F(U(r.formatDate(r.application.integrated_at) || "—"), 1)]),
1014
+ _: 1
1015
+ }),
1016
+ I(r.AppealDetailField, { label: "Дата перевірки" }, {
1017
+ default: Y(() => [F(U(r.formatDate(r.application.verified_at) || "—"), 1)]),
1018
+ _: 1
1019
+ })
1020
+ ])]),
1021
+ _: 1
1022
+ }),
1023
+ r.application.cancel_reason || r.application.status === "cancelled" ? (B(), j(r.AppealDetailSection, {
1024
+ key: 2,
1025
+ title: "Скасування",
1026
+ danger: ""
1027
+ }, {
1028
+ icon: Y(() => [I(r.AppIcon, {
1029
+ name: "ban",
1030
+ class: "h-[18px] w-[18px]"
1031
+ })]),
1032
+ default: Y(() => [P("dl", St, [I(r.AppealDetailField, {
1033
+ label: "Причина скасування заявки",
1034
+ full: "",
1035
+ highlight: ""
1036
+ }, {
1037
+ default: Y(() => [F(U(r.application.cancel_reason || "Причину не вказано"), 1)]),
1038
+ _: 1
1039
+ })])]),
1040
+ _: 1
1041
+ })) : M("", !0),
1042
+ I(r.AppealDetailSection, { title: "Інформація про заявника" }, {
1043
+ icon: Y(() => [I(r.AppIcon, {
1044
+ name: "user",
1045
+ class: "h-[18px] w-[18px]"
1046
+ })]),
1047
+ default: Y(() => [P("div", Ct, [P("dl", wt, [
1048
+ I(r.AppealDetailField, {
1049
+ label: "ПІБ",
1050
+ highlight: "",
1051
+ full: ""
1052
+ }, {
1053
+ default: Y(() => [F(U(r.applicantName), 1)]),
1054
+ _: 1
1055
+ }),
1056
+ I(r.AppealDetailField, { label: "Номер сертифікату" }, {
1057
+ default: Y(() => [F(U(r.surveyor?.certificate_id_data?.text || "—"), 1)]),
1058
+ _: 1
1059
+ }),
1060
+ I(r.AppealDetailField, { label: "Дата сертифікату" }, {
1061
+ default: Y(() => [F(U(r.certificateDate || "—"), 1)]),
1062
+ _: 1
1063
+ }),
1064
+ I(r.AppealDetailField, { label: "Номер телефону" }, {
1065
+ default: Y(() => [F(U(r.surveyor?.phone || "—"), 1)]),
1066
+ _: 1
1067
+ }),
1068
+ I(r.AppealDetailField, { label: "Email" }, {
1069
+ default: Y(() => [F(U(r.surveyor?.email || "—"), 1)]),
1070
+ _: 1
1071
+ })
1072
+ ]), P("div", Tt, [t[15] ||= P("h3", { class: "mb-3 text-xs font-semibold uppercase tracking-wide text-slate-400" }, "Організація", -1), P("dl", Et, [
1073
+ I(r.AppealDetailField, {
1074
+ label: "Назва організації",
1075
+ highlight: "",
1076
+ full: ""
1077
+ }, {
1078
+ default: Y(() => [r.organization?.org_id ? (B(), j(r.RouterLink, {
1079
+ key: 0,
1080
+ to: {
1081
+ name: "organization-detail",
1082
+ params: { id: r.organization.org_id }
1083
+ },
1084
+ class: "break-words text-[#1f5ae0] hover:text-[#1b3c95] hover:underline"
1085
+ }, {
1086
+ default: Y(() => [F(U(r.organization.name || "—"), 1)]),
1087
+ _: 1
1088
+ }, 8, ["to"])) : (B(), N("span", Dt, "—"))]),
1089
+ _: 1
1090
+ }),
1091
+ I(r.AppealDetailField, { label: "Телефон організації" }, {
1092
+ default: Y(() => [F(U(r.organization?.phone || "—"), 1)]),
1093
+ _: 1
1094
+ }),
1095
+ I(r.AppealDetailField, { label: "Email організації" }, {
1096
+ default: Y(() => [F(U(r.organization?.email || "—"), 1)]),
1097
+ _: 1
1098
+ }),
1099
+ I(r.AppealDetailField, {
1100
+ label: "Юридична адреса",
1101
+ full: ""
1102
+ }, {
1103
+ default: Y(() => [F(U(r.organization?.legal_address || "—"), 1)]),
1104
+ _: 1
1105
+ })
1106
+ ])])])]),
1107
+ _: 1
1108
+ }),
1109
+ I(r.AppealDetailSection, { title: "Файли" }, {
1110
+ icon: Y(() => [I(r.AppIcon, {
1111
+ name: "file-text",
1112
+ class: "h-[18px] w-[18px]"
1113
+ })]),
1114
+ default: Y(() => [
1115
+ r.application.status === "reserve" ? (B(), N("p", Ot, " Заявка в резерві: доступні лише межі території до зняття просторового конфлікту. ")) : M("", !0),
1116
+ r.workflowError ? (B(), N("p", kt, U(r.workflowError), 1)) : M("", !0),
1117
+ r.files.length ? (B(), N("ul", At, [(B(!0), N(k, null, H(r.files, (e) => (B(), N("li", {
1118
+ key: e.id,
1119
+ class: "flex items-center justify-between gap-4 py-3 first:pt-0 last:pb-0"
1120
+ }, [P("div", jt, [P("p", Mt, U(e.label), 1), e.note ? (B(), N("p", Nt, "Примітка: " + U(e.note), 1)) : M("", !0)]), e.action === "download" && (e.href || e.token) ? (B(), N("div", Pt, [e.replaceable ? (B(), N("button", {
1121
+ key: 0,
1122
+ type: "button",
1123
+ class: z(r.fileUploadBtnClass),
1124
+ disabled: r.workflowBusy,
1125
+ onClick: t[1] ||= (e) => {
1126
+ r.workflowError = "", r.workflowRef?.openReplaceOutput();
1127
+ }
1128
+ }, [I(r.AppIcon, {
1129
+ name: "upload",
1130
+ class: "h-3 w-3"
1131
+ }), t[16] ||= F(" Замінити ", -1)], 8, Ft)) : M("", !0), P("a", {
1132
+ href: e.href || (e.token ? r.fileUrl(e.token) : void 0),
1133
+ class: z(r.fileDownloadBtnClass)
1134
+ }, [I(r.AppIcon, {
1135
+ name: "download",
1136
+ class: "h-3 w-3"
1137
+ }), t[17] ||= F(" Завантажити ", -1)], 8, It)])) : e.action === "issue" ? (B(), N("button", {
1138
+ key: 1,
1139
+ type: "button",
1140
+ class: z(r.fileUploadBtnClass),
1141
+ disabled: r.workflowBusy,
1142
+ onClick: t[2] ||= (e) => {
1143
+ r.workflowError = "", r.workflowRef?.openIssue();
1144
+ }
1145
+ }, [I(r.AppIcon, {
1146
+ name: "upload",
1147
+ class: "h-3 w-3"
1148
+ }), t[18] ||= F(" Надіслати ", -1)], 8, Lt)) : e.action === "verify" ? (B(), N("button", {
1149
+ key: 2,
1150
+ type: "button",
1151
+ class: z(r.fileUploadBtnClass),
1152
+ disabled: r.workflowBusy,
1153
+ onClick: t[3] ||= (e) => r.workflowRef?.openVerify()
1154
+ }, [I(r.AppIcon, {
1155
+ name: "file-check-2",
1156
+ class: "h-3 w-3"
1157
+ }), t[19] ||= F(" Перевірити ", -1)], 8, Rt)) : e.action === "complete" ? (B(), N("button", {
1158
+ key: 3,
1159
+ type: "button",
1160
+ class: z(r.fileUploadBtnClass),
1161
+ disabled: r.workflowBusy,
1162
+ onClick: t[4] ||= (e) => r.workflowRef?.openComplete()
1163
+ }, [I(r.AppIcon, {
1164
+ name: "circle-check",
1165
+ class: "h-3 w-3"
1166
+ }), t[20] ||= F(" Підтвердити ", -1)], 8, zt)) : e.action === "exportGeometry" ? (B(), N("button", {
1167
+ key: 4,
1168
+ type: "button",
1169
+ class: z(r.fileDownloadBtnClass),
1170
+ onClick: t[5] ||= (e) => {
1171
+ r.workflowError = "", r.geometryExportOpen = !0;
1172
+ }
1173
+ }, [I(r.AppIcon, {
1174
+ name: "download",
1175
+ class: "h-3 w-3"
1176
+ }), t[21] ||= F(" Завантажити ", -1)])) : e.action === "exportVector" ? (B(), N("button", {
1177
+ key: 5,
1178
+ type: "button",
1179
+ class: z(r.fileDownloadBtnClass),
1180
+ onClick: t[6] ||= (e) => {
1181
+ r.workflowError = "", r.vectorExportOpen = !0;
1182
+ }
1183
+ }, [I(r.AppIcon, {
1184
+ name: "download",
1185
+ class: "h-3 w-3"
1186
+ }), t[22] ||= F(" Завантажити ", -1)])) : M("", !0)]))), 128))])) : (B(), N("p", Bt, "Файли відсутні."))
1187
+ ]),
1188
+ _: 1
1189
+ }),
1190
+ r.application.app_id ? (B(), j(r.ApplicationCommentsSection, {
1191
+ key: 3,
1192
+ "application-id": r.application.app_id,
1193
+ resource: "applications",
1194
+ variant: "admin",
1195
+ "current-author": r.commentCurrentAuthor,
1196
+ "resolve-author": r.resolveNoteAuthor
1197
+ }, null, 8, ["application-id", "current-author"])) : M("", !0),
1198
+ I(r.ApplicationHistorySection, {
1199
+ items: r.application.status_history || [],
1200
+ variant: "admin"
1201
+ }, null, 8, ["items"])
1202
+ ]), P("div", Vt, [P("div", Ht, [r.showMap && r.application ? (B(), j(r.AppealDetailMap, {
1203
+ key: r.application.app_id,
1204
+ geom: r.application.geom,
1205
+ address: r.address,
1206
+ area: r.application.area,
1207
+ location: r.application.location,
1208
+ variant: "panel"
1209
+ }, null, 8, [
1210
+ "geom",
1211
+ "address",
1212
+ "area",
1213
+ "location"
1214
+ ])) : (B(), N("div", Ut, [I(r.AppIcon, {
1215
+ name: "map",
1216
+ class: "mb-3 h-8 w-8 text-slate-300"
1217
+ }), t[23] ||= P("p", { class: "text-sm text-slate-500" }, "Геометрію заявки не вдалося відобразити", -1)]))])])]),
1218
+ r.application.app_id ? (B(), j(r.ApplicationWorkflowActions, {
1219
+ key: 0,
1220
+ ref: "workflowRef",
1221
+ "application-id": r.application.app_id,
1222
+ status: r.application.status || "",
1223
+ onDone: t[7] ||= (e) => {
1224
+ r.workflowError = "", r.workflowBusy = !1, r.loadApplication(r.application.app_id);
1225
+ },
1226
+ onError: t[8] ||= (e) => r.workflowError = e
1227
+ }, null, 8, ["application-id", "status"])) : M("", !0),
1228
+ r.application.app_id ? (B(), j(r.ApplicationGeometryExportModal, {
1229
+ key: 1,
1230
+ modelValue: r.geometryExportOpen,
1231
+ "onUpdate:modelValue": t[9] ||= (e) => r.geometryExportOpen = e,
1232
+ "application-id": r.application.app_id,
1233
+ "build-url": r.apiUrl,
1234
+ "error-message": r.errorMessage,
1235
+ variant: "admin"
1236
+ }, null, 8, [
1237
+ "modelValue",
1238
+ "application-id",
1239
+ "build-url",
1240
+ "error-message"
1241
+ ])) : M("", !0),
1242
+ r.application.app_id ? (B(), j(r.ApplicationVectorExportModal, {
1243
+ key: 2,
1244
+ modelValue: r.vectorExportOpen,
1245
+ "onUpdate:modelValue": t[10] ||= (e) => r.vectorExportOpen = e,
1246
+ "application-id": r.application.app_id
1247
+ }, null, 8, ["modelValue", "application-id"])) : M("", !0)
1248
+ ])) : (B(), N("div", Wt, [P("p", Gt, U(r.error || "Звернення не знайдено."), 1), I(r.RouterLink, {
1249
+ to: r.listPath,
1250
+ class: "mt-3 inline-block text-sm font-medium text-[#1f5ae0] hover:text-[#1a46b8]"
1251
+ }, {
1252
+ default: Y(() => [...t[24] ||= [F(" Повернутися до реєстру ", -1)]]),
1253
+ _: 1
1254
+ }, 8, ["to"])]));
1255
+ }
1256
+ var qt = /*#__PURE__*/ e(it, [["render", Kt], ["__file", "D:/softpro/surveyor/admin/src/pages/requests/card.vue"]]);
1257
+ //#endregion
1258
+ export { qt as default };