@opengis/surveyor 0.0.15 → 0.0.17

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 (62) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +16 -0
  3. package/dist/chunks/{AppIcon-Di5F4Bu_.js → AppIcon-CO70tpMX.js} +1 -1
  4. package/dist/chunks/{AppealDetailField-DNpsGpPY.js → AppealDetailField-ByK9ZqR4.js} +4 -4
  5. package/dist/chunks/{AppealStatusBadge-z77wwkFD.js → AppealStatusBadge-BlAaNUSK.js} +2 -2
  6. package/dist/chunks/AppealStatusBadge-DzMn4RVy.js +295 -0
  7. package/dist/chunks/ApplicationGeometryExportModal-Cu6QmJjm.js +1245 -0
  8. package/dist/chunks/{BaseModal-DP_ilBdg.js → BaseModal-BJxKuONh.js} +2 -2
  9. package/dist/chunks/{FormFilePicker-D5fAUE0Z.js → FormFilePicker-DxPQlxgy.js} +2 -2
  10. package/dist/chunks/{MapLayerMenu-CI5cbLEC.js → MapLayerMenu-B0TEoCJm.js} +4 -4
  11. package/dist/chunks/{RegistryForm-Ct8xiLV0.js → RegistryForm-Dpis_ncj.js} +3 -3
  12. package/dist/chunks/{RegistryFormModal-DTi3g3CX.js → RegistryFormModal-CH4DbTvC.js} +4 -4
  13. package/dist/chunks/{RegistryToolbar-v7DdReH2.js → RegistryToolbar-DisEejvi.js} +8 -8
  14. package/dist/chunks/SurveyorTeleport-Cd6D92mo.js +30 -0
  15. package/dist/chunks/{TablePagination-Iri38U68.js → TablePagination-thQkE5iA.js} +7 -7
  16. package/dist/chunks/{UserAccessBadge-B5Q1LvNv.js → UserAccessBadge-DyZDv7Oo.js} +1 -1
  17. package/dist/chunks/{UserTypeBadge-CuAMctTK.js → UserTypeBadge-LvnMuKGo.js} +1 -1
  18. package/dist/chunks/{VerifiedBadge-D6L7mCdp.js → VerifiedBadge-bk0n-rlC.js} +2 -2
  19. package/dist/chunks/{applications-D6pHAQaK.js → applications-B6GAxopO.js} +16 -19
  20. package/dist/chunks/card-BCMJyzgE.js +1327 -0
  21. package/dist/chunks/card-BiKSZfYj.js +639 -0
  22. package/dist/chunks/{card-DcYkb_aF.js → card-Cs8_8A8i.js} +13 -13
  23. package/dist/chunks/{card-Ba8_kfj9.js → card-DVuqR0rL.js} +10 -10
  24. package/dist/chunks/{card-CJhdeB6f.js → card-n83dNORm.js} +25 -25
  25. package/dist/chunks/{card-TP5UFJb2.js → card-u5I--_Gb.js} +16 -16
  26. package/dist/chunks/{certificates-Ew5AekPn.js → certificates-CDunSANR.js} +31 -21
  27. package/dist/chunks/{create-CSIDl4gP.js → create-DQPxIZMW.js} +18 -18
  28. package/dist/chunks/{forgot-DnixBqdc.js → forgot-DfsFu-yY.js} +8 -8
  29. package/dist/chunks/{login-BWCQdEkv.js → login-Dl0nTWs9.js} +8 -8
  30. package/dist/chunks/{map-mZ8Rn4aR.js → map-BoHEgBCw.js} +922 -926
  31. package/dist/chunks/{map-layers-BdWEHPLx.js → map-layers-CRE8lZzH.js} +11 -11
  32. package/dist/chunks/{organizations-D0o0e_ps.js → organizations-D6aazMAe.js} +18 -18
  33. package/dist/chunks/{profile-F7mr0poI.js → profile-CkwMFh82.js} +3 -3
  34. package/dist/chunks/{registration-BRF4985_.js → registration-BSz1iLbO.js} +8 -8
  35. package/dist/chunks/requests-B9Ejt4av.js +303 -0
  36. package/dist/chunks/{requests-BCJN-CNx.js → requests-D1ix8U5f.js} +6 -6
  37. package/dist/chunks/{reset-OZCgLi6f.js → reset-D5G0x5Zi.js} +8 -8
  38. package/dist/chunks/{useEntityPath-8s0Y1tjA.js → useEntityPath-C5Owtidc.js} +1 -1
  39. package/dist/chunks/{users-Dr543AYk.js → users-DMe6JYI0.js} +15 -15
  40. package/dist/index.css +1 -2
  41. package/dist/index.js +47 -47
  42. package/migrations/20261016120000_map_layers.sql +156 -156
  43. package/migrations/20261016150000_password_reset.sql +15 -15
  44. package/migrations/20261016180000_settlement_lookup.sql +16 -16
  45. package/package.json +1 -4
  46. package/server/dictionaries/index.ts +17 -17
  47. package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
  48. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
  49. package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
  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 +11 -10
  54. package/server/resources/surveyor-admin/certificates.ts +25 -25
  55. package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
  56. package/server/suggests/index.ts +18 -1
  57. package/dist/chunks/AppealStatusBadge-COxcUM2Q.js +0 -185
  58. package/dist/chunks/ApplicationHistorySection-DHq-iJla.js +0 -788
  59. package/dist/chunks/SurveyorTeleport-D6-KXe_5.js +0 -23
  60. package/dist/chunks/card-CF5Lo4ui.js +0 -609
  61. package/dist/chunks/card-CVujkVkR.js +0 -1193
  62. package/dist/chunks/requests-F0Kp8OPp.js +0 -234
@@ -0,0 +1,1245 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { t } from "./SurveyorTeleport-Cd6D92mo.js";
3
+ import { a as n, c as r, i, n as a, r as o, t as s, u as c } from "./appealMapLayers-CQMK3rrz.js";
4
+ import { t as l } from "./application_status-BhNGiY2I.js";
5
+ import { a as u, d, i as f, l as p, r as m, s as h, t as g, u as _ } from "./mapLayersApi-CBLcbADa.js";
6
+ import { i as v, n as y, t as b } from "./geometry-DyhIVRcw.js";
7
+ import { t as ee } from "./MapLayerMenu-B0TEoCJm.js";
8
+ import { Fragment as x, computed as S, createBlock as C, createCommentVNode as w, createElementBlock as T, createElementVNode as E, createVNode as D, defineComponent as O, mergeModels as k, nextTick as te, normalizeClass as A, normalizeStyle as j, onBeforeUnmount as M, onMounted as ne, onUnmounted as re, openBlock as N, ref as P, renderList as F, shallowRef as ie, toDisplayString as I, useModel as L, vModelText as ae, watch as R, withCtx as z, withDirectives as B, withModifiers as V } from "vue";
9
+ import { ChevronDown as H, Crosshair as oe, History as U, MapPin as se, MapPinned as ce, MessageSquare as W, Send as G, ZoomIn as le, ZoomOut as ue } from "lucide-vue-next";
10
+ import { VsInputRichtext as K } from "@opengis/form";
11
+ //#region shared/map/components/AppealDetailMap.vue?vue&type=script&setup=true&lang.ts
12
+ var de = "appeal-map-popup-style", q = /*@__PURE__*/ O({
13
+ __name: "AppealDetailMap",
14
+ props: {
15
+ geom: {
16
+ type: null,
17
+ required: !0
18
+ },
19
+ address: {
20
+ type: [String, null],
21
+ required: !1
22
+ },
23
+ area: {
24
+ type: [
25
+ String,
26
+ Number,
27
+ null
28
+ ],
29
+ required: !1
30
+ },
31
+ location: {
32
+ type: [String, null],
33
+ required: !1
34
+ },
35
+ expanded: {
36
+ type: Boolean,
37
+ required: !1,
38
+ default: !1
39
+ },
40
+ variant: {
41
+ type: String,
42
+ required: !1,
43
+ default: "embedded"
44
+ }
45
+ },
46
+ setup(e, { expose: t }) {
47
+ t();
48
+ let l = e, x = i, C = a, w = o, T = [30.5234, 50.4501], E = {
49
+ padding: 30,
50
+ maxZoom: 17
51
+ }, D = P(null), O = P(null), k = ie(null), te = P(""), A = P(!0), j = P(s), M = P([]), N = P(r), F = P([]);
52
+ function I(e) {
53
+ return j.value.find((t) => t.id === e) ?? j.value[0] ?? s[0];
54
+ }
55
+ function L(e) {
56
+ return e.kind === "applications";
57
+ }
58
+ function ae() {
59
+ let e = n.find(L);
60
+ if (!e) throw Error("Static applications overlay is missing");
61
+ let t = typeof window < "u" ? window.location.origin : "";
62
+ return {
63
+ ...e,
64
+ tiles: e.tiles.map((e) => e.startsWith("/") ? `${t}${e}` : e)
65
+ };
66
+ }
67
+ async function z() {
68
+ let e = await g("application-card");
69
+ j.value = e.baseLayers, N.value = e.defaultBaseId;
70
+ let t = e.overlays.filter((e) => e.kind !== "geometry" && e.kind !== "applications"), n = e.overlays.find(L) ?? ae(), r = {
71
+ id: n.id,
72
+ label: n.label,
73
+ kind: "applications",
74
+ tiles: n.tiles,
75
+ sourceLayer: n.sourceLayer,
76
+ opacity: n.opacity,
77
+ hasFilters: n.hasFilters,
78
+ defaultVisible: !1
79
+ };
80
+ M.value = [r, ...t], F.value = M.value.filter((e) => e.defaultVisible).map((e) => e.id);
81
+ }
82
+ let B = null, V, H = null, U = null, W = !1, G = S(() => v(l.geom)), K = S(() => G.value ? y(G.value) : null), q = S(() => K.value ? b(K.value) : null), fe = S(() => l.variant === "panel" ? "relative min-h-[320px] w-full flex-1" : ["relative w-full transition-all duration-300", l.expanded ? "h-[520px]" : "h-[340px]"]);
83
+ function pe() {
84
+ return {
85
+ type: "FeatureCollection",
86
+ features: G.value ? [{
87
+ type: "Feature",
88
+ geometry: G.value,
89
+ properties: {}
90
+ }] : []
91
+ };
92
+ }
93
+ function J(e) {
94
+ K.value && e.fitBounds(K.value, {
95
+ ...E,
96
+ duration: 500
97
+ });
98
+ }
99
+ function Y(e, t) {
100
+ let n = pe(), r = e.getSource(x);
101
+ r?.setData ? r.setData(n) : (e.addSource(x, {
102
+ type: "geojson",
103
+ data: n
104
+ }), e.addLayer({
105
+ id: C,
106
+ type: "fill",
107
+ source: x,
108
+ paint: {
109
+ "fill-color": "#3b82f6",
110
+ "fill-opacity": .35
111
+ }
112
+ }), e.addLayer({
113
+ id: w,
114
+ type: "line",
115
+ source: x,
116
+ paint: {
117
+ "line-color": "#2563eb",
118
+ "line-width": 3
119
+ }
120
+ })), _e(e, t), ve(e, t);
121
+ }
122
+ function me(e, t) {
123
+ let n = e.trim(), r = n.match(/^(.+?)\s*\(([^)]+)\)\s*,?\s*(.*)$/);
124
+ if (r) {
125
+ let e = r[1].trim(), t = r[2].trim();
126
+ return {
127
+ title: [e, r[3].trim()].filter(Boolean).join(" "),
128
+ subtitle: t
129
+ };
130
+ }
131
+ let i = n.split(",").map((e) => e.trim()).filter(Boolean);
132
+ if (i.length >= 2) {
133
+ let e = i[i.length - 1], n = i.slice(0, -1).join(", "), r = /^\d+[a-zA-Zа-яА-ЯіїєґІЇЄҐ]?(?:[/-]\d+)?$/.test(e), a = r ? `${n}, ${e}` : n, o = t?.trim();
134
+ return o && !a.includes(o) ? {
135
+ title: r ? a : [n, e].filter(Boolean).join(" "),
136
+ subtitle: o
137
+ } : r ? {
138
+ title: a,
139
+ subtitle: ""
140
+ } : {
141
+ title: n,
142
+ subtitle: e
143
+ };
144
+ }
145
+ return {
146
+ title: n,
147
+ subtitle: t?.trim() || ""
148
+ };
149
+ }
150
+ function he() {
151
+ let e = l.address?.trim(), t = l.location?.trim(), n = !!(e && e !== "—"), r = !!(t && t !== "—");
152
+ return !n && !r ? null : n ? me(e, r ? t : void 0) : {
153
+ title: t,
154
+ subtitle: ""
155
+ };
156
+ }
157
+ function ge() {
158
+ let e = document.createElement("div");
159
+ return e.className = "appeal-map-pin", e.innerHTML = "\n <svg width=\"28\" height=\"36\" viewBox=\"0 0 28 36\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M14 0C6.268 0 0 6.268 0 14c0 10.5 14 22 14 22s14-11.5 14-22C28 6.268 21.732 0 14 0z\" fill=\"#2563EB\"/>\n <circle cx=\"14\" cy=\"14\" r=\"5.5\" fill=\"white\"/>\n </svg>\n ", e;
160
+ }
161
+ function _e(e, t) {
162
+ U?.remove(), U = null, q.value && (U = new t.Marker({
163
+ element: ge(),
164
+ anchor: "bottom"
165
+ }).setLngLat(q.value).addTo(e));
166
+ }
167
+ function X() {
168
+ let e = document.getElementById(de) ?? document.createElement("style");
169
+ e.id = de, e.textContent = "\n.appeal-map-popup .maplibregl-popup-content {\n min-width: 0;\n padding: 8px 8px 8px 10px !important;\n margin: 0;\n border: 1px solid #e2e8f0 !important;\n border-radius: 14px !important;\n background: #fff !important;\n box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06) !important;\n}\n.appeal-map-popup .maplibregl-popup-tip {\n width: 0 !important;\n height: 0 !important;\n border: 8px solid transparent !important;\n}\n.appeal-map-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n border-top-color: #fff !important;\n border-bottom-width: 0 !important;\n}\n.appeal-map-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n border-bottom-color: #fff !important;\n border-top-width: 0 !important;\n}\n.appeal-map-popup-body {\n position: relative;\n display: block;\n max-width: 260px;\n margin: 0 !important;\n padding: 2px 28px 2px 2px !important;\n text-align: left;\n}\n.appeal-map-popup-text {\n min-width: 0;\n margin: 0 !important;\n padding: 2px 0 !important;\n}\n.appeal-map-popup-title {\n margin: 0 !important;\n padding: 0 !important;\n font-size: 13px !important;\n font-weight: 600 !important;\n line-height: 1.35 !important;\n color: #0f172a !important;\n}\n.appeal-map-popup-subtitle {\n margin: 2px 0 0 !important;\n padding: 0 !important;\n font-size: 12px !important;\n font-weight: 400 !important;\n line-height: 1.35 !important;\n color: #64748b !important;\n}\n.appeal-map-popup-close,\n.appeal-map-popup-close:focus,\n.appeal-map-popup-close:focus-visible,\n.appeal-map-popup-close:active {\n position: absolute !important;\n top: -6px !important;\n right: -6px !important;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 20px !important;\n height: 20px !important;\n padding: 0 !important;\n margin: 0 !important;\n border: 0 !important;\n border-radius: 6px !important;\n background: transparent !important;\n color: #94a3b8 !important;\n opacity: 1 !important;\n outline: none !important;\n outline-offset: 0 !important;\n box-shadow: none !important;\n appearance: none !important;\n -webkit-appearance: none !important;\n cursor: pointer !important;\n}\n.appeal-map-popup-close::-moz-focus-inner {\n border: 0 !important;\n padding: 0 !important;\n}\n.appeal-map-popup-close svg {\n display: block;\n width: 12px !important;\n height: 12px !important;\n}\n.appeal-map-popup-close:hover {\n background: #f1f5f9 !important;\n color: #334155 !important;\n}\n", e.parentNode || document.head.appendChild(e);
170
+ }
171
+ function ve(e, t) {
172
+ X(), H?.remove(), H = null;
173
+ let n = he();
174
+ if (!q.value || !n) return;
175
+ let { title: r, subtitle: i } = n, a = document.createElement("div");
176
+ a.className = "appeal-map-popup-body";
177
+ let o = document.createElement("div");
178
+ o.className = "appeal-map-popup-text";
179
+ let s = document.createElement("p");
180
+ if (s.className = "appeal-map-popup-title", s.textContent = r, o.appendChild(s), i) {
181
+ let e = document.createElement("p");
182
+ e.className = "appeal-map-popup-subtitle", e.textContent = i, o.appendChild(e);
183
+ }
184
+ let c = document.createElement("button");
185
+ c.type = "button", c.className = "appeal-map-popup-close", c.setAttribute("aria-label", "Закрити"), c.style.setProperty("outline", "none", "important"), c.style.setProperty("border", "0", "important"), c.style.setProperty("box-shadow", "none", "important"), c.innerHTML = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>", c.addEventListener("click", (e) => {
186
+ e.preventDefault(), e.stopPropagation(), H?.remove();
187
+ }), a.append(o, c), H = new t.Popup({
188
+ closeButton: !1,
189
+ closeOnClick: !1,
190
+ offset: 42,
191
+ maxWidth: "280px",
192
+ className: "appeal-map-popup",
193
+ anchor: "bottom"
194
+ }).setLngLat(q.value).setDOMContent(a).addTo(e);
195
+ }
196
+ function Z(e) {
197
+ u(e, I(N.value), f(e, M.value, [C]));
198
+ }
199
+ function Q(e) {
200
+ h(e, M.value, F.value, C);
201
+ }
202
+ function ye(e) {
203
+ N.value !== e && (N.value = e);
204
+ }
205
+ function be(e) {
206
+ let t = F.value;
207
+ F.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
208
+ }
209
+ function xe() {
210
+ let e = B, t = O.value, n = D.value;
211
+ if (!e || !t || !n || k.value || n.clientWidth === 0 || n.clientHeight === 0) return;
212
+ let r = new e.Map({
213
+ container: t,
214
+ style: c(I(N.value)),
215
+ ...K.value ? {
216
+ bounds: K.value,
217
+ fitBoundsOptions: E
218
+ } : {
219
+ center: T,
220
+ zoom: 16
221
+ },
222
+ attributionControl: !1,
223
+ locale: _
224
+ });
225
+ r.on("load", () => {
226
+ r.resize(), Y(r, e), Q(r), A.value = !1;
227
+ }), r.on("error", (e) => {
228
+ console.warn("[AppealDetailMap]", e?.error ?? e);
229
+ }), k.value = r;
230
+ }
231
+ function Se() {
232
+ k.value?.zoomIn({ duration: 250 });
233
+ }
234
+ function Ce() {
235
+ k.value?.zoomOut({ duration: 250 });
236
+ }
237
+ function we() {
238
+ let e = k.value;
239
+ e && J(e);
240
+ }
241
+ function Te() {
242
+ let e = k.value, t = B;
243
+ if (!e || !t) return;
244
+ let n = () => {
245
+ Y(e, t), J(e);
246
+ };
247
+ e.isStyleLoaded() ? n() : e.once("load", n);
248
+ }
249
+ R(() => [
250
+ G.value,
251
+ l.address,
252
+ l.location
253
+ ], Te), R(N, () => {
254
+ let e = k.value;
255
+ if (!e) return;
256
+ let t = () => Z(e);
257
+ e.isStyleLoaded() ? t() : e.once("load", t);
258
+ }), R(F, () => {
259
+ let e = k.value;
260
+ e?.isStyleLoaded() && m(e, M.value, F.value);
261
+ }), ne(async () => {
262
+ try {
263
+ let [e] = await Promise.all([d(), z()]);
264
+ B = e;
265
+ } catch (e) {
266
+ console.error(e), A.value = !1, te.value = p;
267
+ return;
268
+ }
269
+ !W && D.value && (V = new ResizeObserver(() => {
270
+ k.value ? k.value.resize() : xe();
271
+ }), V.observe(D.value));
272
+ }), re(() => {
273
+ W = !0, V?.disconnect(), H?.remove(), H = null, U?.remove(), U = null, k.value?.remove(), k.value = null;
274
+ });
275
+ let $ = {
276
+ props: l,
277
+ POLYGON_SOURCE_ID: x,
278
+ POLYGON_FILL_ID: C,
279
+ POLYGON_LINE_ID: w,
280
+ FALLBACK_CENTER: T,
281
+ FIT_OPTIONS: E,
282
+ mapAreaRef: D,
283
+ containerRef: O,
284
+ mapRef: k,
285
+ mapLoadError: te,
286
+ mapLoading: A,
287
+ baseLayers: j,
288
+ overlayLayers: M,
289
+ activeBaseId: N,
290
+ activeOverlayIds: F,
291
+ baseLayer: I,
292
+ isApplications: L,
293
+ fallbackApplicationsOverlay: ae,
294
+ loadLayerSettings: z,
295
+ get ml() {
296
+ return B;
297
+ },
298
+ set ml(e) {
299
+ B = e;
300
+ },
301
+ get resizeObserver() {
302
+ return V;
303
+ },
304
+ set resizeObserver(e) {
305
+ V = e;
306
+ },
307
+ get addressPopup() {
308
+ return H;
309
+ },
310
+ set addressPopup(e) {
311
+ H = e;
312
+ },
313
+ get addressMarker() {
314
+ return U;
315
+ },
316
+ set addressMarker(e) {
317
+ U = e;
318
+ },
319
+ get disposed() {
320
+ return W;
321
+ },
322
+ set disposed(e) {
323
+ W = e;
324
+ },
325
+ geometry: G,
326
+ bounds: K,
327
+ center: q,
328
+ mapAreaClass: fe,
329
+ buildGeoJson: pe,
330
+ fitToGeometry: J,
331
+ ensureLayers: Y,
332
+ splitAddressLabel: me,
333
+ resolvePopupText: he,
334
+ createPinElement: ge,
335
+ showAddressMarker: _e,
336
+ POPUP_STYLE_ID: de,
337
+ ensurePopupStyles: X,
338
+ showAddressPopup: ve,
339
+ remountBasemap: Z,
340
+ remountOverlays: Q,
341
+ selectBase: ye,
342
+ toggleOverlay: be,
343
+ initMap: xe,
344
+ zoomIn: Se,
345
+ zoomOut: Ce,
346
+ resetView: we,
347
+ refreshLayers: Te,
348
+ get Crosshair() {
349
+ return oe;
350
+ },
351
+ get MapPin() {
352
+ return se;
353
+ },
354
+ get MapPinned() {
355
+ return ce;
356
+ },
357
+ get ZoomIn() {
358
+ return le;
359
+ },
360
+ get ZoomOut() {
361
+ return ue;
362
+ },
363
+ MapLayerMenu: ee
364
+ };
365
+ return Object.defineProperty($, "__isScriptSetup", {
366
+ enumerable: !1,
367
+ value: !0
368
+ }), $;
369
+ }
370
+ }), fe = {
371
+ key: 0,
372
+ class: "flex shrink-0 items-center justify-between border-b border-slate-100 px-5 py-3.5"
373
+ }, pe = { class: "flex items-center gap-2.5" }, J = {
374
+ ref: "containerRef",
375
+ class: "absolute inset-0 h-full w-full"
376
+ }, Y = {
377
+ key: 0,
378
+ class: "absolute inset-0 z-[5] flex items-center justify-center bg-white/90 px-4 text-center text-sm text-red-600"
379
+ }, me = {
380
+ key: 1,
381
+ class: "absolute inset-0 z-[5] flex items-center justify-center bg-white/80 text-sm text-slate-500"
382
+ }, he = { class: "absolute right-3 top-3 z-10 flex flex-col gap-1.5" }, ge = {
383
+ key: 1,
384
+ class: "flex shrink-0 items-center gap-2 border-t border-slate-100 px-5 py-2.5 text-xs text-slate-400"
385
+ }, _e = { class: "break-words" };
386
+ function X(e, t, n, r, i, a) {
387
+ return N(), T("div", { class: A(n.variant === "panel" ? "flex h-full flex-col rounded-xl border border-slate-200 bg-white shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)]" : void 0) }, [
388
+ n.variant === "panel" ? (N(), T("header", fe, [E("div", pe, [D(r.MapPinned, {
389
+ class: "h-[18px] w-[18px] text-[#1f5ae0]",
390
+ "stroke-width": 2,
391
+ "aria-hidden": "true"
392
+ }), t[0] ||= E("h2", { class: "text-[15px] font-semibold text-slate-800" }, "Інтерактивна карта", -1)]), t[1] ||= E("span", { class: "rounded-full bg-slate-100 px-2.5 py-1 text-xs font-medium text-slate-500" }, " Межі заявки ", -1)])) : w("", !0),
393
+ E("div", {
394
+ ref: "mapAreaRef",
395
+ class: A(r.mapAreaClass)
396
+ }, [
397
+ E("div", J, null, 512),
398
+ r.mapLoadError ? (N(), T("p", Y, I(r.mapLoadError), 1)) : r.mapLoading ? (N(), T("p", me, " Завантаження карти… ")) : w("", !0),
399
+ D(r.MapLayerMenu, {
400
+ "base-id": r.activeBaseId,
401
+ "active-overlay-ids": r.activeOverlayIds,
402
+ "base-layers": r.baseLayers,
403
+ overlays: r.overlayLayers,
404
+ onSelectBase: r.selectBase,
405
+ onToggleOverlay: r.toggleOverlay
406
+ }, null, 8, [
407
+ "base-id",
408
+ "active-overlay-ids",
409
+ "base-layers",
410
+ "overlays"
411
+ ]),
412
+ E("div", he, [
413
+ E("button", {
414
+ type: "button",
415
+ title: "Збільшити",
416
+ "aria-label": "Збільшити",
417
+ class: "flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)] transition-colors hover:bg-[#eef6ff] hover:text-[#1f5ae0]",
418
+ onClick: r.zoomIn
419
+ }, [D(r.ZoomIn, {
420
+ class: "h-4 w-4",
421
+ "stroke-width": 2,
422
+ "aria-hidden": "true"
423
+ })]),
424
+ E("button", {
425
+ type: "button",
426
+ title: "Зменшити",
427
+ "aria-label": "Зменшити",
428
+ class: "flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)] transition-colors hover:bg-[#eef6ff] hover:text-[#1f5ae0]",
429
+ onClick: r.zoomOut
430
+ }, [D(r.ZoomOut, {
431
+ class: "h-4 w-4",
432
+ "stroke-width": 2,
433
+ "aria-hidden": "true"
434
+ })]),
435
+ E("button", {
436
+ type: "button",
437
+ title: "Відновити масштаб",
438
+ "aria-label": "Відновити масштаб",
439
+ class: "flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)] transition-colors hover:bg-[#eef6ff] hover:text-[#1f5ae0]",
440
+ onClick: r.resetView
441
+ }, [D(r.Crosshair, {
442
+ class: "h-4 w-4",
443
+ "stroke-width": 2,
444
+ "aria-hidden": "true"
445
+ })])
446
+ ])
447
+ ], 2),
448
+ n.variant === "panel" ? (N(), T("footer", ge, [
449
+ D(r.MapPin, {
450
+ class: "h-3 w-3 shrink-0",
451
+ "stroke-width": 2,
452
+ "aria-hidden": "true"
453
+ }),
454
+ E("span", null, "Площа ділянки: " + I(n.area ?? "—") + " га", 1),
455
+ t[2] ||= E("span", { class: "text-slate-300" }, "·", -1),
456
+ E("span", _e, I(n.location), 1)
457
+ ])) : w("", !0)
458
+ ], 2);
459
+ }
460
+ var ve = /*#__PURE__*/ e(q, [
461
+ ["render", X],
462
+ ["__scopeId", "data-v-ded53fc4"],
463
+ ["__file", "C:/softpro/surveyor/shared/map/components/AppealDetailMap.vue"]
464
+ ]);
465
+ //#endregion
466
+ //#region shared/comments/applicationNotesApi.ts
467
+ function Z(e, t, n) {
468
+ return `/api/resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${n}`;
469
+ }
470
+ async function Q(e) {
471
+ let t = await e.text();
472
+ try {
473
+ let n = JSON.parse(t);
474
+ return (typeof n.error == "object" ? n.error?.message : void 0) || n.message || n.detail || t || `HTTP ${e.status}`;
475
+ } catch {
476
+ return t || `HTTP ${e.status}`;
477
+ }
478
+ }
479
+ async function ye(e, t) {
480
+ let n = "".replace(/\/$/, ""), r = await fetch(`${n}${Z(e, t, "comments")}`, { credentials: "include" });
481
+ if (!r.ok) throw Error(await Q(r));
482
+ return [...(await r.json()).rows ?? []].sort((e, t) => String(e.created_at ?? "").localeCompare(String(t.created_at ?? "")));
483
+ }
484
+ async function be(e, t, n) {
485
+ let r = n.trim();
486
+ if (!r) throw Error("Введіть текст коментаря");
487
+ let i = "".replace(/\/$/, ""), a = await fetch(`${i}${Z(e, t, "notes")}`, {
488
+ method: "POST",
489
+ credentials: "include",
490
+ headers: { "Content-Type": "application/json" },
491
+ body: JSON.stringify({ body: r })
492
+ });
493
+ if (!a.ok) throw Error(await Q(a));
494
+ return a.json();
495
+ }
496
+ //#endregion
497
+ //#region shared/comments/noteDisplay.ts
498
+ function xe(e) {
499
+ return e.split(/\s+/).map((e) => e[0]).filter(Boolean).join("").slice(0, 2).toUpperCase();
500
+ }
501
+ function Se(e) {
502
+ if (!e) return "";
503
+ let t = e.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/);
504
+ if (t) return `${t[3]}.${t[2]}.${t[1]} ${t[4]}:${t[5]}`;
505
+ let n = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
506
+ return n ? `${n[3]}.${n[2]}.${n[1]}` : e;
507
+ }
508
+ var Ce = {
509
+ name: "Невідомий користувач",
510
+ initials: "НК"
511
+ }, we = /* @__PURE__ */ new Set(/* @__PURE__ */ "A.B.BLOCKQUOTE.BR.CODE.DEL.EM.H1.H2.H3.H4.H5.H6.HR.I.IMG.LI.MARK.OL.P.PRE.S.SPAN.STRONG.SUB.SUP.TABLE.TBODY.TD.TH.THEAD.TR.U.UL".split(".")), Te = /* @__PURE__ */ new Set([
512
+ "SCRIPT",
513
+ "STYLE",
514
+ "IFRAME",
515
+ "OBJECT",
516
+ "EMBED",
517
+ "LINK",
518
+ "META"
519
+ ]);
520
+ function $(e) {
521
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
522
+ }
523
+ function Ee(e, t) {
524
+ let n = e.trim();
525
+ return t === "src" && /^data:image\/(?:png|jpe?g|gif|webp);/i.test(n) || /^(https?:|mailto:)/i.test(n) ? !0 : t === "href" && (n.startsWith("/") || n.startsWith("#"));
526
+ }
527
+ function De(e) {
528
+ let t = [];
529
+ for (let n of e.split(";")) {
530
+ let [e, ...r] = n.split(":"), i = e?.trim().toLowerCase(), a = r.join(":").trim();
531
+ i && a && (i === "text-align" && /^(left|right|center|justify)$/i.test(a) ? t.push(`text-align: ${a.toLowerCase()}`) : (i === "color" || i === "background-color") && /^(#[0-9a-f]{3,8}|rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)|rgba\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*(?:0|1|0?\.\d+)\s*\))$/i.test(a) && t.push(`${i}: ${a}`));
532
+ }
533
+ return t.join("; ");
534
+ }
535
+ function Oe(e) {
536
+ let t = e.tagName, n = e.getAttribute("href"), r = e.getAttribute("src"), i = e.getAttribute("alt"), a = e.getAttribute("title"), o = e.getAttribute("width"), s = e.getAttribute("height"), c = e.getAttribute("style"), l = e.getAttribute("colspan"), u = e.getAttribute("rowspan"), d = e.getAttribute("target");
537
+ for (let t of [...e.attributes]) e.removeAttribute(t.name);
538
+ t === "A" && n && Ee(n, "href") && (e.setAttribute("href", n.trim()), a && e.setAttribute("title", a), d === "_blank" && (e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"))), t === "IMG" && r && Ee(r, "src") && (e.setAttribute("src", r.trim()), i != null && e.setAttribute("alt", i), a && e.setAttribute("title", a), o && /^\d+$/.test(o) && e.setAttribute("width", o), s && /^\d+$/.test(s) && e.setAttribute("height", s)), (t === "TD" || t === "TH") && (l && /^\d+$/.test(l) && e.setAttribute("colspan", l), u && /^\d+$/.test(u) && e.setAttribute("rowspan", u));
539
+ let f = c ? De(c) : "";
540
+ f && e.setAttribute("style", f);
541
+ }
542
+ function ke(e) {
543
+ for (let t of [...e.childNodes]) {
544
+ if (t.nodeType !== Node.ELEMENT_NODE) {
545
+ t.nodeType === Node.COMMENT_NODE && t.remove();
546
+ continue;
547
+ }
548
+ let e = t;
549
+ if (Te.has(e.tagName)) {
550
+ e.remove();
551
+ continue;
552
+ }
553
+ if (ke(e), !we.has(e.tagName)) {
554
+ e.replaceWith(...e.childNodes);
555
+ continue;
556
+ }
557
+ Oe(e);
558
+ }
559
+ }
560
+ function Ae(e) {
561
+ return /<img\b/i.test(e) ? !0 : e.replace(/<[^>]*>/g, " ").replace(/&nbsp;|&#160;/gi, " ").replace(/\s+/g, " ").trim().length > 0;
562
+ }
563
+ function je(e) {
564
+ let t = e ?? "";
565
+ if (!/<\/?[a-z][\s\S]*?>/i.test(t)) return $(t).replace(/\n/g, "<br>");
566
+ let n = new DOMParser().parseFromString(t, "text/html");
567
+ return ke(n.body), n.body.innerHTML;
568
+ }
569
+ function Me(e) {
570
+ let t = e.created_by?.trim();
571
+ return t ? {
572
+ name: "Користувач",
573
+ initials: t.slice(0, 2).toUpperCase()
574
+ } : Ce;
575
+ }
576
+ //#endregion
577
+ //#region shared/comments/ApplicationCommentsSection.vue?vue&type=script&setup=true&lang.ts
578
+ var Ne = /*@__PURE__*/ O({
579
+ __name: "ApplicationCommentsSection",
580
+ props: {
581
+ applicationId: {
582
+ type: String,
583
+ required: !0
584
+ },
585
+ resource: {
586
+ type: String,
587
+ required: !0
588
+ },
589
+ variant: {
590
+ type: String,
591
+ required: !1,
592
+ default: "cabinet"
593
+ },
594
+ currentAuthor: {
595
+ type: Object,
596
+ required: !0
597
+ },
598
+ resolveAuthor: {
599
+ type: Function,
600
+ required: !1
601
+ }
602
+ },
603
+ setup(e, { expose: t }) {
604
+ t();
605
+ let n = [
606
+ "history",
607
+ "font_family",
608
+ "font_size",
609
+ "bold",
610
+ "italic",
611
+ "underline",
612
+ "strike",
613
+ "text_align",
614
+ "bullet_list",
615
+ "ordered_list",
616
+ "link",
617
+ "clear_formatting",
618
+ "help"
619
+ ], r = e, i = P([]), a = P({}), o = P(!0), s = P(""), c = P(""), l = P(!1), u = P(""), d = S(() => r.variant === "admin"), f = S(() => Ae(c.value) && !l.value), p = S(() => d.value ? "rounded-2xl border border-slate-200 bg-white shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)]" : "overflow-hidden rounded-2xl border border-gray-200 bg-white"), m = S(() => d.value ? "flex items-center gap-2.5 border-b border-slate-100 px-5 py-3.5" : "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3"), h = S(() => d.value ? "text-[15px] font-semibold text-slate-800" : "text-xs font-semibold uppercase tracking-wider text-gray-500"), g = S(() => (d.value, "flex flex-col gap-4 p-5"));
620
+ function _(e) {
621
+ return a.value[e.note_id] ?? r.resolveAuthor?.(e) ?? Me(e);
622
+ }
623
+ async function v() {
624
+ if (r.applicationId) {
625
+ o.value = !0, s.value = "";
626
+ try {
627
+ i.value = await ye(r.resource, r.applicationId), a.value = {};
628
+ } catch (e) {
629
+ i.value = [], s.value = e instanceof Error ? e.message : "Не вдалося завантажити коментарі";
630
+ } finally {
631
+ o.value = !1;
632
+ }
633
+ }
634
+ }
635
+ async function y() {
636
+ let e = c.value.trim();
637
+ if (Ae(e) && !l.value && r.applicationId) {
638
+ l.value = !0, u.value = "";
639
+ try {
640
+ let t = await be(r.resource, r.applicationId, e);
641
+ a.value = {
642
+ ...a.value,
643
+ [t.note_id]: r.currentAuthor
644
+ }, i.value = [...i.value, t].sort((e, t) => String(e.created_at ?? "").localeCompare(String(t.created_at ?? ""))), c.value = "";
645
+ } catch (e) {
646
+ u.value = e instanceof Error ? e.message : "Не вдалося надіслати коментар";
647
+ } finally {
648
+ l.value = !1;
649
+ }
650
+ }
651
+ }
652
+ R(() => r.applicationId, () => {
653
+ v();
654
+ }, { immediate: !0 });
655
+ let b = {
656
+ commentToolbar: n,
657
+ props: r,
658
+ notes: i,
659
+ localAuthors: a,
660
+ loading: o,
661
+ loadError: s,
662
+ draft: c,
663
+ sending: l,
664
+ sendError: u,
665
+ isAdmin: d,
666
+ canSend: f,
667
+ sectionClass: p,
668
+ headerClass: m,
669
+ titleClass: h,
670
+ bodyClass: g,
671
+ authorFor: _,
672
+ loadNotes: v,
673
+ submit: y,
674
+ get VsInputRichtext() {
675
+ return K;
676
+ },
677
+ get MessageSquare() {
678
+ return W;
679
+ },
680
+ get Send() {
681
+ return G;
682
+ },
683
+ get formatNoteDateTime() {
684
+ return Se;
685
+ },
686
+ get noteBodyHtml() {
687
+ return je;
688
+ }
689
+ };
690
+ return Object.defineProperty(b, "__isScriptSetup", {
691
+ enumerable: !1,
692
+ value: !0
693
+ }), b;
694
+ }
695
+ }), Pe = {
696
+ key: 1,
697
+ class: "text-center text-sm text-red-600"
698
+ }, Fe = {
699
+ key: 1,
700
+ class: "flex flex-col gap-4"
701
+ }, Ie = { class: "min-w-0 flex-1" }, Le = { class: "flex flex-wrap items-baseline justify-between gap-x-2" }, Re = { class: "text-[14px] font-semibold text-slate-800" }, ze = { class: "text-xs text-slate-400" }, Be = {
702
+ key: 0,
703
+ class: "mb-1.5 text-xs font-medium text-[#1f5ae0]"
704
+ }, Ve = ["innerHTML"], He = {
705
+ key: 1,
706
+ class: "rounded-xl bg-gray-50 px-4 py-3"
707
+ }, Ue = { class: "mb-1 flex items-center justify-between gap-2" }, We = { class: "text-xs font-semibold text-gray-800" }, Ge = { class: "text-xs text-gray-400" }, Ke = {
708
+ key: 0,
709
+ class: "mb-1 text-xs font-medium text-[#2663EB]"
710
+ }, qe = ["innerHTML"], Je = { class: "min-w-0 flex-1" }, Ye = { class: "!h-full overflow-hidden" }, Xe = { class: "mt-2 flex justify-end" }, Ze = ["disabled", "aria-label"], Qe = { key: 0 }, $e = {
711
+ key: 2,
712
+ class: "text-xs text-red-600"
713
+ };
714
+ function et(e, t, n, r, i, a) {
715
+ return N(), T("section", { class: A(r.sectionClass) }, [E("header", { class: A(r.headerClass) }, [D(r.MessageSquare, {
716
+ class: A(["shrink-0", r.isAdmin ? "h-[18px] w-[18px] text-[#1f5ae0]" : "h-3.5 w-3.5 text-gray-400"]),
717
+ "stroke-width": 2,
718
+ "aria-hidden": "true"
719
+ }, null, 8, ["class"]), E("h2", { class: A(r.titleClass) }, "Коментарі", 2)], 2), E("div", { class: A(r.bodyClass) }, [r.loading ? (N(), T("p", {
720
+ key: 0,
721
+ class: A(["text-center text-sm", r.isAdmin ? "text-slate-400" : "text-gray-400"])
722
+ }, " Завантаження… ", 2)) : r.loadError ? (N(), T("p", Pe, I(r.loadError), 1)) : (N(), T(x, { key: 2 }, [
723
+ r.notes.length === 0 ? (N(), T("p", {
724
+ key: 0,
725
+ class: A(["text-center text-sm italic", r.isAdmin ? "py-2 text-slate-400" : "py-4 text-gray-400"])
726
+ }, " Коментарів ще немає ", 2)) : (N(), T("ul", Fe, [(N(!0), T(x, null, F(r.notes, (e) => (N(), T("li", {
727
+ key: e.note_id,
728
+ class: "flex gap-3"
729
+ }, [E("div", { class: A(["flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold", r.isAdmin ? "bg-[#d9eaff] text-[#1a46b8]" : "bg-[#2663EB] text-white text-xs"]) }, I(r.authorFor(e).initials), 3), E("div", Ie, [r.isAdmin ? (N(), T(x, { key: 0 }, [
730
+ E("div", Le, [E("span", Re, I(r.authorFor(e).name), 1), E("time", ze, I(r.formatNoteDateTime(e.created_at)), 1)]),
731
+ r.authorFor(e).role ? (N(), T("p", Be, I(r.authorFor(e).role), 1)) : w("", !0),
732
+ E("div", {
733
+ class: "comment-body comment-body--admin text-[13px] leading-relaxed text-slate-600",
734
+ innerHTML: r.noteBodyHtml(e.body)
735
+ }, null, 8, Ve)
736
+ ], 64)) : (N(), T("div", He, [
737
+ E("div", Ue, [E("span", We, I(r.authorFor(e).name), 1), E("time", Ge, I(r.formatNoteDateTime(e.created_at)), 1)]),
738
+ r.authorFor(e).role ? (N(), T("p", Ke, I(r.authorFor(e).role), 1)) : w("", !0),
739
+ E("div", {
740
+ class: "comment-body text-sm text-gray-700",
741
+ innerHTML: r.noteBodyHtml(e.body)
742
+ }, null, 8, qe)
743
+ ]))])]))), 128))])),
744
+ E("div", { class: A(["flex items-start gap-3 border-t pt-4", r.isAdmin ? "border-slate-100" : "border-gray-100"]) }, [E("div", { class: A(["mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-xs font-semibold", r.isAdmin ? "bg-[#d9eaff] text-[#1a46b8]" : "bg-[#2663EB] text-white"]) }, I(n.currentAuthor.initials), 3), E("div", Je, [E("div", Ye, [D(r.VsInputRichtext, {
745
+ modelValue: r.draft,
746
+ "onUpdate:modelValue": t[0] ||= (e) => r.draft = e,
747
+ disabled: r.sending,
748
+ placeholder: r.isAdmin ? "Додати коментар…" : "Напишіть коментар...",
749
+ "richtext-props": {
750
+ height: "160px",
751
+ toolbar: r.commentToolbar
752
+ }
753
+ }, null, 8, [
754
+ "modelValue",
755
+ "disabled",
756
+ "placeholder",
757
+ "richtext-props"
758
+ ])]), E("div", Xe, [E("button", {
759
+ type: "button",
760
+ disabled: !r.canSend,
761
+ onClick: r.submit,
762
+ "aria-label": r.isAdmin ? void 0 : "Надіслати",
763
+ class: A(r.isAdmin ? "inline-flex items-center gap-1.5 rounded-lg bg-[#1f5ae0] px-4 py-2.5 text-sm font-medium text-white shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)] transition-all hover:bg-[#1a46b8] disabled:cursor-not-allowed disabled:opacity-40" : "rounded-lg bg-[#2663EB] p-1.5 text-white transition-all hover:bg-[#1d52cc] active:scale-95 disabled:cursor-not-allowed disabled:opacity-40")
764
+ }, [D(r.Send, {
765
+ class: "h-3.5 w-3.5",
766
+ "stroke-width": 2
767
+ }), r.isAdmin ? (N(), T("span", Qe, I(r.sending ? "Надсилання…" : "Надіслати"), 1)) : w("", !0)], 10, Ze)])])], 2),
768
+ r.sendError ? (N(), T("p", $e, I(r.sendError), 1)) : w("", !0)
769
+ ], 64))], 2)], 2);
770
+ }
771
+ var tt = /*#__PURE__*/ e(Ne, [
772
+ ["render", et],
773
+ ["__scopeId", "data-v-0f2a55e0"],
774
+ ["__file", "C:/softpro/surveyor/shared/comments/ApplicationCommentsSection.vue"]
775
+ ]), nt = /*@__PURE__*/ O({
776
+ __name: "ApplicationHistorySection",
777
+ props: {
778
+ items: {
779
+ type: [Array, null],
780
+ required: !1,
781
+ default: () => []
782
+ },
783
+ variant: {
784
+ type: String,
785
+ required: !1,
786
+ default: "cabinet"
787
+ }
788
+ },
789
+ setup(e, { expose: t }) {
790
+ t();
791
+ let n = e, r = P(!0), i = S(() => n.variant === "admin"), a = S(() => [...n.items ?? []].sort((e, t) => String(e.created_at ?? "").localeCompare(String(t.created_at ?? "")))), o = S(() => i.value ? "rounded-xl border border-slate-200 bg-white shadow-[0_1px_2px_0_rgb(15_23_42/0.04),0_1px_3px_0_rgb(15_23_42/0.06)]" : "overflow-hidden rounded-2xl border border-gray-200 bg-white"), s = S(() => i.value ? "flex items-center gap-2.5 border-b border-slate-100 px-5 py-3.5" : "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3"), c = S(() => i.value ? "text-[15px] font-semibold text-slate-800" : "text-xs font-semibold uppercase tracking-wider text-gray-500"), u = S(() => i.value ? "px-5 py-4" : "p-5");
792
+ function d(e, t) {
793
+ return t?.text?.trim() || (e ? l.items.find((t) => t.code === e)?.name ?? e : "");
794
+ }
795
+ function f(e) {
796
+ let t = d(e.status_from, e.status_from_data), n = d(e.status_to, e.status_to_data) || "—";
797
+ return t ? `${t} → ${n}` : n;
798
+ }
799
+ function p(e) {
800
+ if (!e) return "";
801
+ let t = e.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/);
802
+ if (t) return `${t[3]}.${t[2]}.${t[1]} ${t[4]}:${t[5]}`;
803
+ let n = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
804
+ return n ? `${n[3]}.${n[2]}.${n[1]}` : e;
805
+ }
806
+ let m = {
807
+ props: n,
808
+ open: r,
809
+ isAdmin: i,
810
+ events: a,
811
+ sectionClass: o,
812
+ headerClass: s,
813
+ titleClass: c,
814
+ bodyClass: u,
815
+ statusLabel: d,
816
+ historyTitle: f,
817
+ formatDateTime: p,
818
+ get ChevronDown() {
819
+ return H;
820
+ },
821
+ get History() {
822
+ return U;
823
+ }
824
+ };
825
+ return Object.defineProperty(m, "__isScriptSetup", {
826
+ enumerable: !1,
827
+ value: !0
828
+ }), m;
829
+ }
830
+ }), rt = {
831
+ key: 0,
832
+ class: "relative list-none"
833
+ }, it = { class: "relative z-10 mt-1 shrink-0" }, at = { class: "min-w-0 flex-1" }, ot = { class: "flex flex-wrap items-baseline justify-between gap-x-2 gap-y-1" };
834
+ function st(e, t, n, r, i, a) {
835
+ return N(), T("section", { class: A(r.sectionClass) }, [E("header", { class: A(r.headerClass) }, [D(r.History, {
836
+ class: A(["shrink-0", r.isAdmin ? "h-[18px] w-[18px] text-[#1f5ae0]" : "h-3.5 w-3.5 text-gray-400"]),
837
+ "stroke-width": 2,
838
+ "aria-hidden": "true"
839
+ }, null, 8, ["class"]), E("h2", { class: A(r.titleClass) }, "Історія", 2)], 2), E("div", { class: A(r.bodyClass) }, [E("button", {
840
+ type: "button",
841
+ class: A(["mb-3 flex w-full items-center justify-between text-xs font-medium transition-colors", r.isAdmin ? "text-slate-500 hover:text-[#1f5ae0]" : "text-gray-500 hover:text-[#2663EB]"]),
842
+ onClick: t[0] ||= (e) => r.open = !r.open
843
+ }, [E("span", null, I(r.open ? "Згорнути" : `Розгорнути (${r.events.length} подій)`), 1), D(r.ChevronDown, {
844
+ class: A(["h-4 w-4 transition-transform", r.open ? "" : "rotate-180"]),
845
+ "aria-hidden": "true"
846
+ }, null, 8, ["class"])], 2), r.open && r.events.length ? (N(), T("ol", rt, [t[1] ||= E("div", { class: "absolute bottom-2 left-[7px] top-2 w-px bg-slate-200" }, null, -1), (N(!0), T(x, null, F(r.events, (e, t) => (N(), T("li", {
847
+ key: e.history_id,
848
+ class: "relative flex gap-4 pb-6 last:pb-0"
849
+ }, [E("div", it, [E("span", { class: A(["block h-[15px] w-[15px] rounded-full border-2 border-white", t === r.events.length - 1 ? "bg-[#3479f6]" : "bg-slate-300"]) }, null, 2)]), E("div", at, [
850
+ E("div", ot, [E("p", { class: A(["text-[14px] font-semibold", r.isAdmin ? "text-slate-800" : "text-gray-900"]) }, I(r.historyTitle(e)), 3), E("time", { class: A(["text-xs", r.isAdmin ? "text-slate-400" : "text-gray-400"]) }, I(r.formatDateTime(e.created_at) || "—"), 3)]),
851
+ e.reason ? (N(), T("p", {
852
+ key: 0,
853
+ class: A(["mt-1 text-[13px] leading-relaxed", r.isAdmin ? "text-slate-600" : "text-gray-600"])
854
+ }, I(e.reason), 3)) : w("", !0),
855
+ E("p", { class: A(["mt-1 text-xs", r.isAdmin ? "text-slate-400" : "text-gray-400"]) }, I(e.changed_by_data?.text || "—"), 3)
856
+ ])]))), 128))])) : r.events.length ? w("", !0) : (N(), T("p", {
857
+ key: 1,
858
+ class: A(["text-sm", r.isAdmin ? "text-slate-400" : "text-gray-400"])
859
+ }, " Історія відсутня. ", 2))], 2)], 2);
860
+ }
861
+ var ct = /*#__PURE__*/ e(nt, [["render", st], ["__file", "C:/softpro/surveyor/shared/history/ApplicationHistorySection.vue"]]);
862
+ //#endregion
863
+ //#region shared/export/downloadAttachmentFilename.ts
864
+ function lt(e, t) {
865
+ let n = e.match(/filename\*?=(?:UTF-8''|")?([^";]+)/i)?.[1]?.replace(/"/g, "") ?? t;
866
+ try {
867
+ return decodeURIComponent(n);
868
+ } catch {
869
+ return n || t;
870
+ }
871
+ }
872
+ //#endregion
873
+ //#region shared/export/CrsSuggestionSelect.vue?vue&type=script&setup=true&lang.ts
874
+ var ut = /*@__PURE__*/ O({
875
+ __name: "CrsSuggestionSelect",
876
+ props: {
877
+ modelValue: {
878
+ type: String,
879
+ required: !0
880
+ },
881
+ displayValue: {
882
+ type: String,
883
+ required: !0
884
+ },
885
+ label: {
886
+ type: String,
887
+ required: !0
888
+ },
889
+ placeholder: {
890
+ type: String,
891
+ required: !1,
892
+ default: "Оберіть систему координат"
893
+ },
894
+ disabled: {
895
+ type: Boolean,
896
+ required: !1,
897
+ default: !1
898
+ },
899
+ loading: {
900
+ type: Boolean,
901
+ required: !1,
902
+ default: !1
903
+ },
904
+ options: {
905
+ type: Array,
906
+ required: !0
907
+ },
908
+ variant: {
909
+ type: String,
910
+ required: !1,
911
+ default: "admin"
912
+ }
913
+ },
914
+ emits: [
915
+ "update:modelValue",
916
+ "update:displayValue",
917
+ "search"
918
+ ],
919
+ setup(e, { expose: n, emit: r }) {
920
+ n();
921
+ let i = e, a = r, o = P(!1), s = P(""), c = P(null), l = P(null), u = P(null), d = P(null), f = S(() => {
922
+ let e = s.value.trim().toLowerCase();
923
+ return e ? i.options.filter((t) => t.text.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : i.options;
924
+ }), p = S(() => d.value ? {
925
+ left: `${d.value.left}px`,
926
+ width: `${d.value.width}px`,
927
+ top: `${d.value.bottom + 4}px`
928
+ } : { visibility: "hidden" }), m = S(() => i.variant === "cabinet" ? "border-[#2663EB] bg-white text-gray-900 ring-2 ring-[#2663EB]/15" : "border-[#8ec1ff] bg-white text-slate-900 ring-2 ring-[#d9eaff]"), h = S(() => i.variant === "cabinet" ? "border-gray-200 bg-white text-gray-900 hover:border-gray-300" : "border-slate-200 bg-white text-slate-900 hover:border-slate-300"), g = S(() => i.variant === "cabinet" ? "bg-[#EFF4FE] font-medium text-[#2663EB]" : "bg-[#eef6ff] font-medium text-[#1a46b8]");
929
+ function _() {
930
+ d.value = c.value?.getBoundingClientRect() ?? null;
931
+ }
932
+ function v() {
933
+ window.addEventListener("scroll", _, !0), window.addEventListener("resize", _);
934
+ }
935
+ function y() {
936
+ window.removeEventListener("scroll", _, !0), window.removeEventListener("resize", _);
937
+ }
938
+ function b() {
939
+ i.disabled || (o.value = !o.value);
940
+ }
941
+ function ee(e) {
942
+ a("update:modelValue", e.id), a("update:displayValue", e.text), o.value = !1;
943
+ }
944
+ function x(e) {
945
+ let t = e.target;
946
+ c.value?.contains(t) || l.value?.contains(t) || (o.value = !1);
947
+ }
948
+ let C;
949
+ R(s, (e) => {
950
+ o.value && (clearTimeout(C), C = setTimeout(() => a("search", e.trim()), 280));
951
+ }), R(o, async (e) => {
952
+ y(), e && (s.value = "", _(), v(), a("search", ""), await te(), u.value?.focus());
953
+ }), ne(() => document.addEventListener("mousedown", x)), M(() => {
954
+ document.removeEventListener("mousedown", x), y(), clearTimeout(C);
955
+ });
956
+ let w = {
957
+ props: i,
958
+ emit: a,
959
+ open: o,
960
+ query: s,
961
+ rootRef: c,
962
+ panelRef: l,
963
+ inputRef: u,
964
+ triggerRect: d,
965
+ filtered: f,
966
+ dropdownStyle: p,
967
+ triggerOpenClass: m,
968
+ triggerIdleClass: h,
969
+ selectedOptionClass: g,
970
+ refreshRect: _,
971
+ bindPositionListeners: v,
972
+ unbindPositionListeners: y,
973
+ toggle: b,
974
+ select: ee,
975
+ onDocumentClick: x,
976
+ get searchTimer() {
977
+ return C;
978
+ },
979
+ set searchTimer(e) {
980
+ C = e;
981
+ },
982
+ SurveyorTeleport: t
983
+ };
984
+ return Object.defineProperty(w, "__isScriptSetup", {
985
+ enumerable: !1,
986
+ value: !0
987
+ }), w;
988
+ }
989
+ }), dt = {
990
+ ref: "rootRef",
991
+ class: "relative"
992
+ }, ft = ["disabled"], pt = { class: "border-b border-slate-100 p-2" }, mt = { class: "max-h-48 overflow-y-auto" }, ht = {
993
+ key: 0,
994
+ class: "px-3 py-3 text-center text-xs text-slate-400"
995
+ }, gt = {
996
+ key: 1,
997
+ class: "px-3 py-3 text-center text-xs text-slate-400"
998
+ }, _t = ["onClick"];
999
+ function vt(e, t, n, r, i, a) {
1000
+ return N(), T("div", null, [E("label", { class: A(["mb-1 block text-xs font-medium", n.variant === "cabinet" ? "text-gray-700" : "text-slate-500"]) }, I(n.label), 3), E("div", dt, [E("button", {
1001
+ type: "button",
1002
+ disabled: n.disabled,
1003
+ class: A(["flex w-full items-center justify-between rounded-lg border px-3 py-2 text-left text-sm shadow-sm transition-all disabled:cursor-not-allowed disabled:bg-slate-50 disabled:text-slate-400", n.disabled ? "border-slate-200" : r.open ? r.triggerOpenClass : r.triggerIdleClass]),
1004
+ onClick: r.toggle
1005
+ }, [E("span", { class: A(n.displayValue ? "" : "text-slate-400") }, I(n.displayValue || n.placeholder), 3), (N(), T("svg", {
1006
+ class: A(["h-4 w-4 shrink-0 text-slate-400 transition-transform", r.open ? "rotate-180" : ""]),
1007
+ viewBox: "0 0 24 24",
1008
+ fill: "none",
1009
+ stroke: "currentColor",
1010
+ "stroke-width": "2",
1011
+ "aria-hidden": "true"
1012
+ }, [...t[2] ||= [E("path", { d: "m6 9 6 6 6-6" }, null, -1)]], 2))], 10, ft), D(r.SurveyorTeleport, null, {
1013
+ default: z(() => [r.open ? (N(), T("div", {
1014
+ key: 0,
1015
+ ref: "panelRef",
1016
+ class: "fixed z-[100] overflow-hidden rounded-lg border border-slate-200 bg-white shadow-lg",
1017
+ style: j(r.dropdownStyle),
1018
+ onMousedown: t[1] ||= V(() => {}, ["stop"])
1019
+ }, [E("div", pt, [B(E("input", {
1020
+ ref: "inputRef",
1021
+ "onUpdate:modelValue": t[0] ||= (e) => r.query = e,
1022
+ type: "text",
1023
+ placeholder: "Пошук…",
1024
+ class: "w-full rounded-md border border-slate-200 px-3 py-1.5 text-xs outline-none focus:border-[#8ec1ff] focus:ring-2 focus:ring-[#d9eaff]"
1025
+ }, null, 512), [[ae, r.query]])]), E("div", mt, [n.loading && r.filtered.length === 0 ? (N(), T("p", ht, " Завантаження… ")) : r.filtered.length === 0 ? (N(), T("p", gt, " Нічого не знайдено ")) : w("", !0), (N(!0), T(x, null, F(r.filtered, (e) => (N(), T("button", {
1026
+ key: e.id,
1027
+ type: "button",
1028
+ class: A(["w-full px-3 py-2 text-left text-sm transition-colors hover:bg-slate-50", n.modelValue === e.id ? r.selectedOptionClass : "text-slate-700"]),
1029
+ onClick: (t) => r.select(e)
1030
+ }, I(e.text), 11, _t))), 128))])], 36)) : w("", !0)]),
1031
+ _: 1
1032
+ })], 512)]);
1033
+ }
1034
+ var yt = /*#__PURE__*/ e(ut, [["render", vt], ["__file", "C:/softpro/surveyor/shared/export/CrsSuggestionSelect.vue"]]);
1035
+ //#endregion
1036
+ //#region shared/export/crsUtils.ts
1037
+ function bt(e) {
1038
+ let t = e.trim(), n = t.match(/^EPSG:(\d+)$/i);
1039
+ return n ? n[1] : t;
1040
+ }
1041
+ function xt(e) {
1042
+ let t = e.trim();
1043
+ if (/^EPSG:/i.test(t)) {
1044
+ let e = t.match(/^EPSG:(\d+)$/i);
1045
+ return e ? `EPSG:${e[1]}` : t;
1046
+ }
1047
+ return `EPSG:${t}`;
1048
+ }
1049
+ //#endregion
1050
+ //#region shared/export/loadCrsSuggest.ts
1051
+ function St(e, t = (e, t) => e || `HTTP ${t}`) {
1052
+ let n = 0;
1053
+ function r() {
1054
+ n += 1;
1055
+ }
1056
+ async function i(r) {
1057
+ let i = ++n, a = new URLSearchParams();
1058
+ r && a.set("q", r);
1059
+ let o = await fetch(e(`/api/suggestion/crs?${a}`), { credentials: "include" });
1060
+ if (!o.ok) {
1061
+ let e = await o.text();
1062
+ throw Error(t(e, o.status));
1063
+ }
1064
+ let s = await o.json();
1065
+ return i === n ? (s.data ?? []).map((e) => ({
1066
+ id: String(e.id),
1067
+ text: e.text
1068
+ })) : null;
1069
+ }
1070
+ return {
1071
+ load: i,
1072
+ invalidateInFlight: r
1073
+ };
1074
+ }
1075
+ //#endregion
1076
+ //#region shared/export/downloadApplicationGeometry.ts
1077
+ async function Ct(e, t, n) {
1078
+ let r = new URLSearchParams({ srid: bt(n) }), i = await fetch(e(`/api/surveyor/applications/${encodeURIComponent(t)}/export/geometry?${r}`), { credentials: "include" });
1079
+ if (!i.ok) {
1080
+ let e = await i.text(), t = e || `HTTP ${i.status}`;
1081
+ try {
1082
+ let n = JSON.parse(e);
1083
+ n.message && (t = n.message);
1084
+ } catch {}
1085
+ throw Error(t);
1086
+ }
1087
+ let a = await i.blob(), o = lt(i.headers.get("Content-Disposition") ?? "", `boundary_${t}.geojson`), s = URL.createObjectURL(a), c = document.createElement("a");
1088
+ c.href = s, c.download = o, c.click(), URL.revokeObjectURL(s);
1089
+ }
1090
+ //#endregion
1091
+ //#region shared/export/ApplicationGeometryExportModal.vue?vue&type=script&setup=true&lang.ts
1092
+ var wt = /*@__PURE__*/ O({
1093
+ __name: "ApplicationGeometryExportModal",
1094
+ props: /*@__PURE__*/ k({
1095
+ applicationId: {
1096
+ type: String,
1097
+ required: !0
1098
+ },
1099
+ buildUrl: {
1100
+ type: Function,
1101
+ required: !0
1102
+ },
1103
+ errorMessage: {
1104
+ type: Function,
1105
+ required: !1
1106
+ },
1107
+ variant: {
1108
+ type: String,
1109
+ required: !1,
1110
+ default: "admin"
1111
+ }
1112
+ }, {
1113
+ modelValue: {
1114
+ type: Boolean,
1115
+ required: !0
1116
+ },
1117
+ modelModifiers: {}
1118
+ }),
1119
+ emits: ["update:modelValue"],
1120
+ setup(e, { expose: n }) {
1121
+ n();
1122
+ let r = e, i = L(e, "modelValue"), a = P(""), o = P(""), s = P(!1), c = P(""), l = P(!1), u = P([]), d = St((e) => r.buildUrl(e), (e, t) => (r.errorMessage ?? ((e, t) => e || `HTTP ${t}`))(e, t));
1123
+ function f() {
1124
+ d.invalidateInFlight(), a.value = "", o.value = "", u.value = [], c.value = "", s.value = !1;
1125
+ }
1126
+ async function p(e) {
1127
+ l.value = !0;
1128
+ try {
1129
+ let t = await d.load(e);
1130
+ t && (u.value = t);
1131
+ } catch (e) {
1132
+ c.value = e instanceof Error ? e.message : "Не вдалося завантажити перелік СК";
1133
+ } finally {
1134
+ l.value = !1;
1135
+ }
1136
+ }
1137
+ R(i, (e) => {
1138
+ e && (f(), p(""));
1139
+ }), R(a, () => {
1140
+ c.value = "";
1141
+ });
1142
+ async function m() {
1143
+ c.value = "";
1144
+ let e = a.value.trim();
1145
+ if (!e) {
1146
+ c.value = "Оберіть систему координат";
1147
+ return;
1148
+ }
1149
+ s.value = !0;
1150
+ try {
1151
+ await Ct(r.buildUrl, r.applicationId, e), i.value = !1;
1152
+ } catch (e) {
1153
+ c.value = e instanceof Error ? e.message : "Не вдалося експортувати межі заявки";
1154
+ } finally {
1155
+ s.value = !1;
1156
+ }
1157
+ }
1158
+ function h() {
1159
+ i.value = !1;
1160
+ }
1161
+ let g = {
1162
+ props: r,
1163
+ open: i,
1164
+ srid: a,
1165
+ sridLabel: o,
1166
+ busy: s,
1167
+ error: c,
1168
+ optionsLoading: l,
1169
+ crsOptions: u,
1170
+ crsSuggest: d,
1171
+ resetForm: f,
1172
+ loadCrs: p,
1173
+ submit: m,
1174
+ cancel: h,
1175
+ shellClass: r.variant === "cabinet" ? "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 backdrop-blur-sm" : "fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 p-4",
1176
+ panelClass: r.variant === "cabinet" ? "w-full max-w-md overflow-hidden rounded-2xl bg-white shadow-2xl" : "flex max-h-[90vh] w-full max-w-md flex-col overflow-hidden rounded-2xl bg-white shadow-xl",
1177
+ SurveyorTeleport: t,
1178
+ CrsSuggestionSelect: yt
1179
+ };
1180
+ return Object.defineProperty(g, "__isScriptSetup", {
1181
+ enumerable: !1,
1182
+ value: !0
1183
+ }), g;
1184
+ }
1185
+ }), Tt = ["disabled"], Et = ["disabled"];
1186
+ function Dt(e, t, n, r, i, a) {
1187
+ return N(), C(r.SurveyorTeleport, null, {
1188
+ default: z(() => [r.open ? (N(), T("div", {
1189
+ key: 0,
1190
+ class: A(r.shellClass),
1191
+ onMousedown: V(r.cancel, ["self"])
1192
+ }, [E("div", {
1193
+ class: A(r.panelClass),
1194
+ role: "dialog",
1195
+ "aria-labelledby": "geometry-export-title"
1196
+ }, [
1197
+ E("div", { class: A(["flex items-center justify-between border-b px-6 py-4", n.variant === "cabinet" ? "border-gray-100 py-5" : "border-slate-100"]) }, [E("h2", {
1198
+ id: "geometry-export-title",
1199
+ class: A(["font-semibold text-slate-900", n.variant === "cabinet" ? "text-base" : "text-lg"])
1200
+ }, " Експорт меж заявки ", 2), E("button", {
1201
+ type: "button",
1202
+ class: "rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
1203
+ "aria-label": "Закрити",
1204
+ onClick: r.cancel
1205
+ }, " × ")], 2),
1206
+ E("div", { class: A(["space-y-4 px-6 py-4", n.variant === "cabinet" ? "py-5" : ""]) }, [D(r.CrsSuggestionSelect, {
1207
+ modelValue: r.srid,
1208
+ "onUpdate:modelValue": t[0] ||= (e) => r.srid = e,
1209
+ "display-value": r.sridLabel,
1210
+ "onUpdate:displayValue": t[1] ||= (e) => r.sridLabel = e,
1211
+ label: "Система координат",
1212
+ options: r.crsOptions,
1213
+ loading: r.optionsLoading,
1214
+ disabled: r.busy || r.optionsLoading || !r.crsOptions.length,
1215
+ variant: n.variant,
1216
+ onSearch: r.loadCrs
1217
+ }, null, 8, [
1218
+ "modelValue",
1219
+ "display-value",
1220
+ "options",
1221
+ "loading",
1222
+ "disabled",
1223
+ "variant"
1224
+ ]), r.error ? (N(), T("p", {
1225
+ key: 0,
1226
+ class: A(["text-xs text-red-700", n.variant === "cabinet" ? "rounded-lg border border-red-200 bg-red-50 px-3 py-2" : ""])
1227
+ }, I(r.error), 3)) : w("", !0)], 2),
1228
+ E("div", { class: A(["flex justify-end gap-2 border-t px-6 py-4", n.variant === "cabinet" ? "border-transparent pt-0" : "border-slate-100"]) }, [E("button", {
1229
+ type: "button",
1230
+ class: A(["px-4 py-2 text-sm text-slate-600 transition-colors hover:bg-slate-100", n.variant === "cabinet" ? "rounded-xl bg-gray-100 py-2.5 font-medium text-gray-600 hover:bg-gray-200" : "rounded-lg"]),
1231
+ disabled: r.busy,
1232
+ onClick: r.cancel
1233
+ }, " Скасувати ", 10, Tt), E("button", {
1234
+ type: "button",
1235
+ class: A(["px-4 py-2 text-sm font-semibold text-white disabled:opacity-50", n.variant === "cabinet" ? "rounded-xl bg-[#2663EB] py-2.5 font-medium hover:bg-[#1d52cc] disabled:cursor-not-allowed disabled:opacity-40" : "rounded-lg bg-[#1f5ae0] hover:bg-[#1a46b8]"]),
1236
+ disabled: r.busy || r.optionsLoading || !r.srid,
1237
+ onClick: r.submit
1238
+ }, I(r.busy ? "Експорт…" : "Експортувати"), 11, Et)], 2)
1239
+ ], 2)], 34)) : w("", !0)]),
1240
+ _: 1
1241
+ });
1242
+ }
1243
+ var Ot = /*#__PURE__*/ e(wt, [["render", Dt], ["__file", "C:/softpro/surveyor/shared/export/ApplicationGeometryExportModal.vue"]]);
1244
+ //#endregion
1245
+ export { lt as a, xe as c, yt as i, Ce as l, St as n, ct as o, xt as r, tt as s, Ot as t, ve as u };