sinde-ui 0.0.0-stage → 1.1.0

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 (92) hide show
  1. package/LICENSE.md +171 -0
  2. package/NOTICE +21 -0
  3. package/README.md +296 -2
  4. package/THIRD_PARTY_LICENSES.md +131 -0
  5. package/dist/chunks/use-ui-config-Ckaon2pR.mjs +10 -0
  6. package/dist/components/SAppShell.vue.d.ts +21 -0
  7. package/dist/components/SAsideNav.vue.d.ts +27 -0
  8. package/dist/components/SAvatar.vue.d.ts +21 -0
  9. package/dist/components/SBtn.vue.d.ts +15 -0
  10. package/dist/components/SCheckbox.vue.d.ts +24 -0
  11. package/dist/components/SCopy.vue.d.ts +26 -0
  12. package/dist/components/SCropper.vue.d.ts +16 -0
  13. package/dist/components/SDataTable.vue.d.ts +57 -0
  14. package/dist/components/SDateTimePicker/Calendar.vue.d.ts +40 -0
  15. package/dist/components/SDateTimePicker/Popover.vue.d.ts +22 -0
  16. package/dist/components/SDateTimePicker/QuickActions.vue.d.ts +13 -0
  17. package/dist/components/SDateTimePicker/Time.vue.d.ts +29 -0
  18. package/dist/components/SDateTimePicker/TimeWheel.vue.d.ts +15 -0
  19. package/dist/components/SDateTimePicker/index.vue.d.ts +33 -0
  20. package/dist/components/SDatetime.vue.d.ts +20 -0
  21. package/dist/components/SDocMarkdown.vue.d.ts +6 -0
  22. package/dist/components/SField.vue.d.ts +14 -0
  23. package/dist/components/SFile.vue.d.ts +27 -0
  24. package/dist/components/SGradation.vue.d.ts +24 -0
  25. package/dist/components/SIcon.vue.d.ts +8 -0
  26. package/dist/components/SImage.vue.d.ts +60 -0
  27. package/dist/components/SInput.vue.d.ts +21 -0
  28. package/dist/components/SLink.vue.d.ts +16 -0
  29. package/dist/components/SList.vue.d.ts +19 -0
  30. package/dist/components/SLoad.vue.d.ts +7 -0
  31. package/dist/components/SNav.vue.d.ts +13 -0
  32. package/dist/components/SNotification.vue.d.ts +15 -0
  33. package/dist/components/SNotificationHost.vue.d.ts +3 -0
  34. package/dist/components/SRange.vue.d.ts +19 -0
  35. package/dist/components/SScrollableEdges.vue.d.ts +21 -0
  36. package/dist/components/SSelect.vue.d.ts +39 -0
  37. package/dist/components/SSpoiler.vue.d.ts +24 -0
  38. package/dist/components/STextSpans.vue.d.ts +35 -0
  39. package/dist/components/STextarea.vue.d.ts +16 -0
  40. package/dist/components/SToggle.vue.d.ts +26 -0
  41. package/dist/components/STooltip.vue.d.ts +20 -0
  42. package/dist/components/STree.vue.d.ts +11 -0
  43. package/dist/components/icons/book-open.vue.d.ts +3 -0
  44. package/dist/components/icons/braces.vue.d.ts +3 -0
  45. package/dist/components/icons/calendar.vue.d.ts +3 -0
  46. package/dist/components/icons/camera.vue.d.ts +3 -0
  47. package/dist/components/icons/check.vue.d.ts +3 -0
  48. package/dist/components/icons/chevron.vue.d.ts +3 -0
  49. package/dist/components/icons/clock.vue.d.ts +3 -0
  50. package/dist/components/icons/close.vue.d.ts +3 -0
  51. package/dist/components/icons/collapse.vue.d.ts +3 -0
  52. package/dist/components/icons/contact-round.vue.d.ts +3 -0
  53. package/dist/components/icons/crown.vue.d.ts +3 -0
  54. package/dist/components/icons/expand.vue.d.ts +3 -0
  55. package/dist/components/icons/file-pen-line.vue.d.ts +3 -0
  56. package/dist/components/icons/fit-screen.vue.d.ts +3 -0
  57. package/dist/components/icons/flip-x.vue.d.ts +3 -0
  58. package/dist/components/icons/flip-y.vue.d.ts +3 -0
  59. package/dist/components/icons/home.vue.d.ts +3 -0
  60. package/dist/components/icons/inbox.vue.d.ts +3 -0
  61. package/dist/components/icons/layout.vue.d.ts +3 -0
  62. package/dist/components/icons/package.vue.d.ts +3 -0
  63. package/dist/components/icons/receipt.vue.d.ts +3 -0
  64. package/dist/components/icons/refresh.vue.d.ts +3 -0
  65. package/dist/components/icons/rotate-left.vue.d.ts +3 -0
  66. package/dist/components/icons/rotate-right.vue.d.ts +3 -0
  67. package/dist/components/icons/send.vue.d.ts +3 -0
  68. package/dist/components/icons/shield-alert.vue.d.ts +3 -0
  69. package/dist/components/icons/trash-2.vue.d.ts +3 -0
  70. package/dist/components/icons/users.vue.d.ts +3 -0
  71. package/dist/components/icons/vertical-dots.vue.d.ts +3 -0
  72. package/dist/components/icons/zoom-in.vue.d.ts +3 -0
  73. package/dist/components/icons/zoom-out.vue.d.ts +3 -0
  74. package/dist/composables/use-clipboard.d.ts +10 -0
  75. package/dist/composables/use-link-component.d.ts +5 -0
  76. package/dist/composables/use-notifications.d.ts +24 -0
  77. package/dist/composables/use-open-select.d.ts +2 -0
  78. package/dist/composables/use-optional-router.d.ts +16 -0
  79. package/dist/composables/use-sinde-user.d.ts +16 -0
  80. package/dist/composables/use-ui-config.d.ts +19 -0
  81. package/dist/icons.d.ts +5 -0
  82. package/dist/index.d.ts +44 -0
  83. package/dist/index.mjs +3965 -0
  84. package/dist/nuxt.d.ts +18 -0
  85. package/dist/nuxt.mjs +44 -0
  86. package/dist/runtime/plugin.mjs +8 -0
  87. package/dist/style.css +2 -0
  88. package/dist/utils/count-form.d.ts +2 -0
  89. package/dist/utils/date.d.ts +5 -0
  90. package/dist/utils/media.d.ts +9 -0
  91. package/dist/utils/picker-dt.d.ts +30 -0
  92. package/package.json +100 -4
package/dist/index.mjs ADDED
@@ -0,0 +1,3965 @@
1
+ import { n as e, t } from "./chunks/use-ui-config-Ckaon2pR.mjs";
2
+ import { Fragment as n, Teleport as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createTextVNode as u, createVNode as d, defineComponent as f, getCurrentInstance as p, inject as m, isRef as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, provide as w, reactive as T, readonly as E, ref as D, renderList as O, renderSlot as k, resolveComponent as A, resolveDynamicComponent as j, toDisplayString as M, toValue as N, unref as P, useId as F, useModel as I, vModelCheckbox as L, vModelText as R, vShow as ee, watch as z, withCtx as B, withDirectives as te, withKeys as V, withModifiers as ne } from "vue";
3
+ import { autoUpdate as re, flip as ie, offset as ae, shift as H, size as U, useFloating as W } from "@floating-ui/vue";
4
+ // \0rolldown/runtime.js
5
+ var oe = Object.defineProperty, G = (e, t) => {
6
+ let n = {};
7
+ for (var r in e) oe(n, r, {
8
+ get: e[r],
9
+ enumerable: !0
10
+ });
11
+ return t || oe(n, Symbol.toStringTag, { value: "Module" }), n;
12
+ }, se = { class: "flex min-h-dvh w-full flex-col gap-2 p-2 sm:p-4" }, K = { class: "flex min-w-0 flex-1 gap-3 lg:flex-row lg:items-start" }, ce = { class: "flex min-w-0 flex-1 flex-col gap-3" }, le = /* @__PURE__ */ f({
13
+ __name: "SAppShell",
14
+ emits: ["ready", "dispose"],
15
+ setup(e, { emit: t }) {
16
+ let n = t;
17
+ return S(() => n("ready")), x(() => n("dispose")), (e, t) => (C(), s("div", se, [c("div", K, [k(e.$slots, "nav"), c("div", ce, [k(e.$slots, "default")])])]));
18
+ }
19
+ }), q = (e, t) => {
20
+ let n = e.__vccOpts || e;
21
+ for (let [e, r] of t) n[e] = r;
22
+ return n;
23
+ }, ue = /* @__PURE__ */ G({ default: () => me }), de = {}, fe = {
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ viewBox: "0 0 24 24",
26
+ fill: "none",
27
+ stroke: "currentColor",
28
+ "stroke-width": "1.75",
29
+ "stroke-linecap": "round",
30
+ "stroke-linejoin": "round"
31
+ };
32
+ function pe(e, t) {
33
+ return C(), s("svg", fe, [...t[0] ||= [c("path", { d: "M3 4h6a3 3 0 0 1 3 3v13a2.5 2.5 0 0 0-2.5-2.5H3V4Z" }, null, -1), c("path", { d: "M21 4h-6a3 3 0 0 0-3 3v13a2.5 2.5 0 0 1 2.5-2.5H21V4Z" }, null, -1)]]);
34
+ }
35
+ var me = /*#__PURE__*/ q(de, [["render", pe]]), he = /* @__PURE__ */ G({ default: () => J }), ge = {}, _e = {
36
+ xmlns: "http://www.w3.org/2000/svg",
37
+ viewBox: "0 0 24 24",
38
+ fill: "none",
39
+ stroke: "currentColor",
40
+ "stroke-width": "1.75",
41
+ "stroke-linecap": "round",
42
+ "stroke-linejoin": "round"
43
+ };
44
+ function ve(e, t) {
45
+ return C(), s("svg", _e, [...t[0] ||= [c("path", { d: "M8 3H7a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2 2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1" }, null, -1), c("path", { d: "M16 3h1a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2 2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-1" }, null, -1)]]);
46
+ }
47
+ var J = /*#__PURE__*/ q(ge, [["render", ve]]), ye = /* @__PURE__ */ G({ default: () => Ce }), be = {}, xe = {
48
+ viewBox: "0 0 24 24",
49
+ fill: "currentColor"
50
+ };
51
+ function Se(e, t) {
52
+ return C(), s("svg", xe, [...t[0] ||= [c("path", { d: "M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z" }, null, -1)]]);
53
+ }
54
+ var Ce = /*#__PURE__*/ q(be, [["render", Se]]), we = /* @__PURE__ */ G({ default: () => Oe }), Te = {}, Ee = {
55
+ viewBox: "0 0 24 24",
56
+ fill: "currentColor"
57
+ };
58
+ function De(e, t) {
59
+ return C(), s("svg", Ee, [...t[0] ||= [c("path", { d: "M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z" }, null, -1)]]);
60
+ }
61
+ var Oe = /*#__PURE__*/ q(Te, [["render", De]]), ke = /* @__PURE__ */ G({ default: () => Ne }), Ae = {}, je = {
62
+ viewBox: "0 0 24 24",
63
+ fill: "currentColor"
64
+ };
65
+ function Me(e, t) {
66
+ return C(), s("svg", je, [...t[0] ||= [c("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }, null, -1)]]);
67
+ }
68
+ var Ne = /*#__PURE__*/ q(Ae, [["render", Me]]), Pe = /* @__PURE__ */ G({ default: () => Re }), Fe = {}, Ie = {
69
+ viewBox: "0 0 24 24",
70
+ fill: "currentColor"
71
+ };
72
+ function Le(e, t) {
73
+ return C(), s("svg", Ie, [...t[0] ||= [c("g", { transform: "translate(12 12) scale(1.25) translate(-12 -12)" }, [c("path", { d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" })], -1)]]);
74
+ }
75
+ var Re = /*#__PURE__*/ q(Fe, [["render", Le]]), ze = /* @__PURE__ */ G({ default: () => Ue }), Be = {}, Ve = {
76
+ viewBox: "0 0 24 24",
77
+ fill: "currentColor"
78
+ };
79
+ function He(e, t) {
80
+ return C(), s("svg", Ve, [...t[0] ||= [c("path", { d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }, null, -1), c("path", { d: "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" }, null, -1)]]);
81
+ }
82
+ var Ue = /*#__PURE__*/ q(Be, [["render", He]]), We = /* @__PURE__ */ G({ default: () => Je }), Ge = {}, Ke = {
83
+ viewBox: "0 0 24 24",
84
+ fill: "currentColor"
85
+ };
86
+ function qe(e, t) {
87
+ return C(), s("svg", Ke, [...t[0] ||= [c("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }, null, -1)]]);
88
+ }
89
+ var Je = /*#__PURE__*/ q(Ge, [["render", qe]]), Ye = /* @__PURE__ */ G({ default: () => $e }), Xe = {}, Ze = {
90
+ viewBox: "0 0 24 24",
91
+ fill: "currentColor"
92
+ };
93
+ function Qe(e, t) {
94
+ return C(), s("svg", Ze, [...t[0] ||= [c("g", { transform: "translate(12 12) scale(0.9) translate(-12 -12)" }, [c("path", { d: "M7.41 3.41 12 8l4.59-4.59L18 4.83l-6 6-6-6zM7.41 20.59 12 16l4.59 4.59L18 19.17l-6-6-6 6z" })], -1)]]);
95
+ }
96
+ var $e = /*#__PURE__*/ q(Xe, [["render", Qe]]), et = /* @__PURE__ */ G({ default: () => it }), tt = {}, nt = {
97
+ xmlns: "http://www.w3.org/2000/svg",
98
+ viewBox: "0 0 24 24",
99
+ fill: "none",
100
+ stroke: "currentColor",
101
+ "stroke-width": "1.75",
102
+ "stroke-linecap": "round",
103
+ "stroke-linejoin": "round"
104
+ };
105
+ function rt(e, t) {
106
+ return C(), s("svg", nt, [...t[0] ||= [
107
+ c("circle", {
108
+ cx: "12",
109
+ cy: "12",
110
+ r: "10"
111
+ }, null, -1),
112
+ c("circle", {
113
+ cx: "12",
114
+ cy: "9",
115
+ r: "3"
116
+ }, null, -1),
117
+ c("path", { d: "M6.5 19a6 6 0 0 1 11 0" }, null, -1)
118
+ ]]);
119
+ }
120
+ var it = /*#__PURE__*/ q(tt, [["render", rt]]), at = /* @__PURE__ */ G({ default: () => lt }), ot = {}, st = {
121
+ viewBox: "0 0 24 24",
122
+ fill: "currentColor"
123
+ };
124
+ function ct(e, t) {
125
+ return C(), s("svg", st, [...t[0] ||= [c("path", { d: "M5 16l-1-9 5 4 3-6 3 6 5-4-1 9H5zm1 2h12v2H6v-2z" }, null, -1)]]);
126
+ }
127
+ var lt = /*#__PURE__*/ q(ot, [["render", ct]]), ut = /* @__PURE__ */ G({ default: () => mt }), dt = {}, ft = {
128
+ viewBox: "0 0 24 24",
129
+ fill: "currentColor"
130
+ };
131
+ function pt(e, t) {
132
+ return C(), s("svg", ft, [...t[0] ||= [c("g", { transform: "translate(12 12) scale(0.9) translate(-12 -12)" }, [c("path", { d: "M12 5.83 16.59 10.41 18 9l-6-6-6 6 1.41 1.41zM12 18.17 7.41 13.59 6 15l6 6 6-6-1.41-1.41z" })], -1)]]);
133
+ }
134
+ var mt = /*#__PURE__*/ q(dt, [["render", pt]]), ht = /* @__PURE__ */ G({ default: () => yt }), gt = {}, _t = {
135
+ xmlns: "http://www.w3.org/2000/svg",
136
+ viewBox: "0 0 24 24",
137
+ fill: "none",
138
+ stroke: "currentColor",
139
+ "stroke-width": "1.75",
140
+ "stroke-linecap": "round",
141
+ "stroke-linejoin": "round"
142
+ };
143
+ function vt(e, t) {
144
+ return C(), s("svg", _t, [...t[0] ||= [
145
+ c("path", { d: "M12 20H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v3" }, null, -1),
146
+ c("path", { d: "M16 3v5h5" }, null, -1),
147
+ c("path", { d: "m18 14 3 3" }, null, -1),
148
+ c("path", { d: "m13 19 6.5-6.5a2.12 2.12 0 0 1 3 3L16 22l-4 1Z" }, null, -1)
149
+ ]]);
150
+ }
151
+ var yt = /*#__PURE__*/ q(gt, [["render", vt]]), bt = /* @__PURE__ */ G({ default: () => wt }), xt = {}, St = {
152
+ viewBox: "0 0 24 24",
153
+ fill: "currentColor"
154
+ };
155
+ function Ct(e, t) {
156
+ return C(), s("svg", St, [...t[0] ||= [c("path", { d: "M6 16h12V8H6v8zm2-6h8v4H8v-4zM4 4h4v2H6v2H4V4zm12 0h4v4h-2V6h-2V4zM4 20v-4h2v2h2v2H4zm12 0v-2h2v-2h2v4h-4z" }, null, -1)]]);
157
+ }
158
+ var wt = /*#__PURE__*/ q(xt, [["render", Ct]]), Tt = /* @__PURE__ */ G({ default: () => kt }), Et = {}, Dt = {
159
+ viewBox: "0 0 24 24",
160
+ fill: "currentColor"
161
+ };
162
+ function Ot(e, t) {
163
+ return C(), s("svg", Dt, [...t[0] ||= [c("path", { d: "M6.99 11 3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z" }, null, -1)]]);
164
+ }
165
+ var kt = /*#__PURE__*/ q(Et, [["render", Ot]]), At = /* @__PURE__ */ G({ default: () => Pt }), jt = {}, Mt = {
166
+ viewBox: "0 0 24 24",
167
+ fill: "currentColor"
168
+ };
169
+ function Nt(e, t) {
170
+ return C(), s("svg", Mt, [...t[0] ||= [c("path", { d: "M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z" }, null, -1)]]);
171
+ }
172
+ var Pt = /*#__PURE__*/ q(jt, [["render", Nt]]), Ft = /* @__PURE__ */ G({ default: () => zt }), It = {}, Lt = {
173
+ xmlns: "http://www.w3.org/2000/svg",
174
+ viewBox: "0 0 24 24",
175
+ fill: "none",
176
+ stroke: "currentColor",
177
+ "stroke-width": "1.75",
178
+ "stroke-linecap": "round",
179
+ "stroke-linejoin": "round"
180
+ };
181
+ function Rt(e, t) {
182
+ return C(), s("svg", Lt, [...t[0] ||= [c("path", { d: "M3 10.5 12 3l9 7.5" }, null, -1), c("path", { d: "M5 9.5V20a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1V9.5" }, null, -1)]]);
183
+ }
184
+ var zt = /*#__PURE__*/ q(It, [["render", Rt]]), Bt = /* @__PURE__ */ G({ default: () => Wt }), Vt = {}, Ht = {
185
+ xmlns: "http://www.w3.org/2000/svg",
186
+ viewBox: "0 0 24 24",
187
+ fill: "none",
188
+ stroke: "currentColor",
189
+ "stroke-width": "1.75",
190
+ "stroke-linecap": "round",
191
+ "stroke-linejoin": "round"
192
+ };
193
+ function Ut(e, t) {
194
+ return C(), s("svg", Ht, [...t[0] ||= [c("path", { d: "M4 4h16l2 11v4a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-4L4 4Z" }, null, -1), c("path", { d: "M2 15h6l2 3h4l2-3h6" }, null, -1)]]);
195
+ }
196
+ var Wt = /*#__PURE__*/ q(Vt, [["render", Ut]]), Gt = /* @__PURE__ */ G({ default: () => Yt }), Kt = {}, qt = {
197
+ xmlns: "http://www.w3.org/2000/svg",
198
+ viewBox: "0 0 24 24",
199
+ fill: "none",
200
+ stroke: "currentColor",
201
+ "stroke-width": "1.75",
202
+ "stroke-linecap": "round",
203
+ "stroke-linejoin": "round"
204
+ };
205
+ function Jt(e, t) {
206
+ return C(), s("svg", qt, [...t[0] ||= [
207
+ c("rect", {
208
+ x: "3",
209
+ y: "3",
210
+ width: "18",
211
+ height: "18",
212
+ rx: "2"
213
+ }, null, -1),
214
+ c("path", { d: "M3 9h18" }, null, -1),
215
+ c("path", { d: "M9 21V9" }, null, -1)
216
+ ]]);
217
+ }
218
+ var Yt = /*#__PURE__*/ q(Kt, [["render", Jt]]), Xt = /* @__PURE__ */ G({ default: () => en }), Zt = {}, Qt = {
219
+ xmlns: "http://www.w3.org/2000/svg",
220
+ viewBox: "0 0 24 24",
221
+ fill: "none",
222
+ stroke: "currentColor",
223
+ "stroke-width": "1.75",
224
+ "stroke-linecap": "round",
225
+ "stroke-linejoin": "round"
226
+ };
227
+ function $t(e, t) {
228
+ return C(), s("svg", Qt, [...t[0] ||= [
229
+ c("path", { d: "M21 8.5 12 3 3 8.5v7L12 21l9-5.5v-7Z" }, null, -1),
230
+ c("path", { d: "m3 8.5 9 5.5 9-5.5" }, null, -1),
231
+ c("path", { d: "M12 14v7" }, null, -1)
232
+ ]]);
233
+ }
234
+ var en = /*#__PURE__*/ q(Zt, [["render", $t]]), tn = /* @__PURE__ */ G({ default: () => on }), nn = {}, rn = {
235
+ xmlns: "http://www.w3.org/2000/svg",
236
+ viewBox: "0 0 24 24",
237
+ fill: "none",
238
+ stroke: "currentColor",
239
+ "stroke-width": "1.75",
240
+ "stroke-linecap": "round",
241
+ "stroke-linejoin": "round"
242
+ };
243
+ function an(e, t) {
244
+ return C(), s("svg", rn, [...t[0] ||= [
245
+ c("path", { d: "M5 3h14v18l-2.5-1.5L14 21l-2-1.5L10 21l-2.5-1.5L5 21V3Z" }, null, -1),
246
+ c("path", { d: "M9 8h6" }, null, -1),
247
+ c("path", { d: "M9 12h6" }, null, -1),
248
+ c("path", { d: "M9 16h4" }, null, -1)
249
+ ]]);
250
+ }
251
+ var on = /*#__PURE__*/ q(nn, [["render", an]]), sn = /* @__PURE__ */ G({ default: () => dn }), cn = {}, ln = {
252
+ viewBox: "0 0 24 24",
253
+ fill: "currentColor"
254
+ };
255
+ function un(e, t) {
256
+ return C(), s("svg", ln, [...t[0] ||= [c("path", { d: "M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-8 8s3.58 8 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" }, null, -1)]]);
257
+ }
258
+ var dn = /*#__PURE__*/ q(cn, [["render", un]]), fn = /* @__PURE__ */ G({ default: () => gn }), pn = {}, mn = {
259
+ viewBox: "0 0 24 24",
260
+ fill: "currentColor"
261
+ };
262
+ function hn(e, t) {
263
+ return C(), s("svg", mn, [...t[0] ||= [c("path", { d: "M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z" }, null, -1)]]);
264
+ }
265
+ var gn = /*#__PURE__*/ q(pn, [["render", hn]]), _n = /* @__PURE__ */ G({ default: () => xn }), vn = {}, yn = {
266
+ viewBox: "0 0 24 24",
267
+ fill: "currentColor"
268
+ };
269
+ function bn(e, t) {
270
+ return C(), s("svg", yn, [...t[0] ||= [c("path", { d: "M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11a7.906 7.906 0 0 0-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z" }, null, -1)]]);
271
+ }
272
+ var xn = /*#__PURE__*/ q(vn, [["render", bn]]), Sn = /* @__PURE__ */ G({ default: () => En }), Cn = {}, wn = {
273
+ xmlns: "http://www.w3.org/2000/svg",
274
+ viewBox: "0 0 24 24",
275
+ fill: "none",
276
+ stroke: "currentColor",
277
+ "stroke-width": "1.75",
278
+ "stroke-linecap": "round",
279
+ "stroke-linejoin": "round"
280
+ };
281
+ function Tn(e, t) {
282
+ return C(), s("svg", wn, [...t[0] ||= [c("path", { d: "m22 2-7 20-4-9-9-4Z" }, null, -1), c("path", { d: "M22 2 11 13" }, null, -1)]]);
283
+ }
284
+ var En = /*#__PURE__*/ q(Cn, [["render", Tn]]), Dn = /* @__PURE__ */ G({ default: () => jn }), On = {}, kn = {
285
+ xmlns: "http://www.w3.org/2000/svg",
286
+ viewBox: "0 0 24 24",
287
+ fill: "none",
288
+ stroke: "currentColor",
289
+ "stroke-width": "1.75",
290
+ "stroke-linecap": "round",
291
+ "stroke-linejoin": "round"
292
+ };
293
+ function An(e, t) {
294
+ return C(), s("svg", kn, [...t[0] ||= [
295
+ c("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }, null, -1),
296
+ c("path", { d: "M12 8v4" }, null, -1),
297
+ c("path", { d: "M12 16h.01" }, null, -1)
298
+ ]]);
299
+ }
300
+ var jn = /*#__PURE__*/ q(On, [["render", An]]), Mn = /* @__PURE__ */ G({ default: () => In }), Nn = {}, Pn = {
301
+ xmlns: "http://www.w3.org/2000/svg",
302
+ viewBox: "0 0 24 24",
303
+ fill: "none",
304
+ stroke: "currentColor",
305
+ "stroke-width": "1.75",
306
+ "stroke-linecap": "round",
307
+ "stroke-linejoin": "round"
308
+ };
309
+ function Fn(e, t) {
310
+ return C(), s("svg", Pn, [...t[0] ||= [
311
+ c("path", { d: "M3 6h18" }, null, -1),
312
+ c("path", { d: "M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2" }, null, -1),
313
+ c("path", { d: "m19 6-1 14H6L5 6" }, null, -1),
314
+ c("path", { d: "M10 11v5M14 11v5" }, null, -1)
315
+ ]]);
316
+ }
317
+ var In = /*#__PURE__*/ q(Nn, [["render", Fn]]), Ln = /* @__PURE__ */ G({ default: () => Vn }), Rn = {}, zn = {
318
+ xmlns: "http://www.w3.org/2000/svg",
319
+ viewBox: "0 0 24 24",
320
+ fill: "none",
321
+ stroke: "currentColor",
322
+ "stroke-width": "1.75",
323
+ "stroke-linecap": "round",
324
+ "stroke-linejoin": "round"
325
+ };
326
+ function Bn(e, t) {
327
+ return C(), s("svg", zn, [...t[0] ||= [
328
+ c("circle", {
329
+ cx: "9",
330
+ cy: "8",
331
+ r: "3.5"
332
+ }, null, -1),
333
+ c("path", { d: "M2.5 20a6.5 6.5 0 0 1 13 0" }, null, -1),
334
+ c("path", { d: "M16 5.2a3.5 3.5 0 0 1 0 5.6" }, null, -1),
335
+ c("path", { d: "M17.5 14.2A6.5 6.5 0 0 1 21.5 20" }, null, -1)
336
+ ]]);
337
+ }
338
+ var Vn = /*#__PURE__*/ q(Rn, [["render", Bn]]), Hn = /* @__PURE__ */ G({ default: () => Kn }), Un = {}, Wn = {
339
+ xmlns: "http://www.w3.org/2000/svg",
340
+ viewBox: "0 0 24 24",
341
+ fill: "currentColor",
342
+ "aria-hidden": "true",
343
+ focusable: "false"
344
+ };
345
+ function Gn(e, t) {
346
+ return C(), s("svg", Wn, [...t[0] ||= [
347
+ c("circle", {
348
+ cx: "12",
349
+ cy: "5",
350
+ r: "1.8"
351
+ }, null, -1),
352
+ c("circle", {
353
+ cx: "12",
354
+ cy: "12",
355
+ r: "1.8"
356
+ }, null, -1),
357
+ c("circle", {
358
+ cx: "12",
359
+ cy: "19",
360
+ r: "1.8"
361
+ }, null, -1)
362
+ ]]);
363
+ }
364
+ var Kn = /*#__PURE__*/ q(Un, [["render", Gn]]), qn = /* @__PURE__ */ G({ default: () => Zn }), Jn = {}, Yn = {
365
+ viewBox: "0 0 24 24",
366
+ fill: "currentColor"
367
+ };
368
+ function Xn(e, t) {
369
+ return C(), s("svg", Yn, [...t[0] ||= [c("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm-.5-7h1v2h2v1h-2v2H9v-2H7V9h2V7z" }, null, -1)]]);
370
+ }
371
+ var Zn = /*#__PURE__*/ q(Jn, [["render", Xn]]), Qn = /* @__PURE__ */ G({ default: () => nr }), $n = {}, er = {
372
+ viewBox: "0 0 24 24",
373
+ fill: "currentColor"
374
+ };
375
+ function tr(e, t) {
376
+ return C(), s("svg", er, [...t[0] ||= [c("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7V9z" }, null, -1)]]);
377
+ }
378
+ var nr = /*#__PURE__*/ q($n, [["render", tr]]), rr = Object.fromEntries(Object.entries(/* @__PURE__ */ Object.assign({
379
+ "./components/icons/book-open.vue": ue,
380
+ "./components/icons/braces.vue": he,
381
+ "./components/icons/calendar.vue": ye,
382
+ "./components/icons/camera.vue": we,
383
+ "./components/icons/check.vue": ke,
384
+ "./components/icons/chevron.vue": Pe,
385
+ "./components/icons/clock.vue": ze,
386
+ "./components/icons/close.vue": We,
387
+ "./components/icons/collapse.vue": Ye,
388
+ "./components/icons/contact-round.vue": et,
389
+ "./components/icons/crown.vue": at,
390
+ "./components/icons/expand.vue": ut,
391
+ "./components/icons/file-pen-line.vue": ht,
392
+ "./components/icons/fit-screen.vue": bt,
393
+ "./components/icons/flip-x.vue": Tt,
394
+ "./components/icons/flip-y.vue": At,
395
+ "./components/icons/home.vue": Ft,
396
+ "./components/icons/inbox.vue": Bt,
397
+ "./components/icons/layout.vue": Gt,
398
+ "./components/icons/package.vue": Xt,
399
+ "./components/icons/receipt.vue": tn,
400
+ "./components/icons/refresh.vue": sn,
401
+ "./components/icons/rotate-left.vue": fn,
402
+ "./components/icons/rotate-right.vue": _n,
403
+ "./components/icons/send.vue": Sn,
404
+ "./components/icons/shield-alert.vue": Dn,
405
+ "./components/icons/trash-2.vue": Mn,
406
+ "./components/icons/users.vue": Ln,
407
+ "./components/icons/vertical-dots.vue": Hn,
408
+ "./components/icons/zoom-in.vue": qn,
409
+ "./components/icons/zoom-out.vue": Qn
410
+ })).map(([e, t]) => [e.split("/").pop()?.replace(/\.vue$/, "").toLowerCase() ?? "", t.default])), ir = Object.keys(rr).sort(), ar = { icon: "inline-block shrink-0 align-middle" }, Y = /* @__PURE__ */ f({
411
+ __name: "SIcon",
412
+ props: { name: {} },
413
+ setup(e) {
414
+ let t = i(() => rr[e.name]);
415
+ return (e, n) => (C(), a(j(P(t)), { class: y(ar.icon) }, null, 8, ["class"]));
416
+ }
417
+ }), or = {
418
+ container: "inline-block w-fit",
419
+ containerBlock: "block",
420
+ tooltip: "pointer-events-none z-50 rounded-full bg-(--bg-default) px-3 py-1 text-xs text-white border border-white"
421
+ }, X = /* @__PURE__ */ f({
422
+ __name: "STooltip",
423
+ props: {
424
+ tooltip: {},
425
+ block: {
426
+ type: Boolean,
427
+ default: !1
428
+ }
429
+ },
430
+ setup(e, { slots: t }) {
431
+ let n = D(null), r = D(null), i = D(!1), { floatingStyles: a } = W(n, r, {
432
+ placement: "top",
433
+ middleware: [
434
+ ae(4),
435
+ ie(),
436
+ H()
437
+ ],
438
+ whileElementsMounted: re
439
+ });
440
+ return (c, l) => (C(), s("div", {
441
+ ref_key: "reference",
442
+ ref: n,
443
+ class: y(e.block ? or.containerBlock : or.container),
444
+ onMouseenter: l[0] ||= (e) => i.value = !0,
445
+ onMouseleave: l[1] ||= (e) => i.value = !1,
446
+ onFocus: l[2] ||= (e) => i.value = !0,
447
+ onBlur: l[3] ||= (e) => i.value = !1
448
+ }, [k(c.$slots, "default"), (e.tooltip || t.tooltip) && P(i) ? (C(), s("div", {
449
+ key: 0,
450
+ ref_key: "floating",
451
+ ref: r,
452
+ role: "tooltip",
453
+ style: b(P(a)),
454
+ class: y(or.tooltip)
455
+ }, [k(c.$slots, "tooltip", {}, () => [u(M(e.tooltip), 1)])], 6)) : o("", !0)], 34));
456
+ }
457
+ }), sr = () => (p()?.appContext.app)?.component("NuxtLink") ? A("NuxtLink") : "a", cr = () => p()?.appContext.config.globalProperties?.$router, lr = () => {
458
+ let e = cr();
459
+ return i(() => e?.currentRoute?.value?.path ?? "/");
460
+ }, ur = ["aria-label"], dr = { key: 1 }, fr = {
461
+ root: "flex min-w-0 flex-col gap-1",
462
+ heading: "px-3 text-[10px] font-medium tracking-wider uppercase opacity-40",
463
+ link: "flex items-center gap-2 rounded-lg text-left text-xs font-medium tracking-wider whitespace-nowrap uppercase transition-colors focus-visible:ring-2 focus-visible:ring-(--accent) focus-visible:outline-none",
464
+ active: "bg-current/10 text-(--text-default)",
465
+ idle: "opacity-50 hover:bg-current/5 hover:opacity-90",
466
+ expanded: "px-3 py-2",
467
+ compact: "justify-center px-2 py-2",
468
+ icon: "size-4 shrink-0",
469
+ initial: "text-[10px] leading-none"
470
+ }, pr = /* @__PURE__ */ f({
471
+ __name: "SAsideNav",
472
+ props: {
473
+ items: { default: () => [] },
474
+ collapsed: {
475
+ type: Boolean,
476
+ default: !1
477
+ },
478
+ heading: { default: "" },
479
+ ariaLabel: { default: "Боковая навигация" }
480
+ },
481
+ setup(e) {
482
+ let t = lr(), r = sr(), i = (e) => t.value === e || t.value.startsWith(`${e}/`), c = (e) => e.exact ? t.value === e.to : i(e.to) || (e.activePrefixes ?? []).some(i);
483
+ return (t, i) => (C(), s("nav", {
484
+ "aria-label": e.ariaLabel,
485
+ class: y(fr.root)
486
+ }, [e.heading && !e.collapsed ? (C(), s("span", {
487
+ key: 0,
488
+ class: y(fr.heading)
489
+ }, M(e.heading), 3)) : o("", !0), (C(!0), s(n, null, O(e.items, (t) => (C(), a(X, {
490
+ key: t.to,
491
+ tooltip: e.collapsed ? t.label : void 0,
492
+ block: ""
493
+ }, {
494
+ default: B(() => [(C(), a(j(P(r)), {
495
+ to: t.to,
496
+ href: P(r) === "a" ? t.to : void 0,
497
+ class: y([
498
+ fr.link,
499
+ c(t) ? fr.active : fr.idle,
500
+ e.collapsed ? fr.compact : fr.expanded
501
+ ]),
502
+ "aria-current": c(t) ? "page" : void 0,
503
+ "aria-label": e.collapsed ? t.label : void 0
504
+ }, {
505
+ default: B(() => [t.icon ? (C(), a(Y, {
506
+ key: 0,
507
+ name: t.icon,
508
+ class: y(fr.icon)
509
+ }, null, 8, ["name", "class"])) : o("", !0), e.collapsed ? t.icon ? o("", !0) : (C(), s("span", {
510
+ key: 2,
511
+ class: y(fr.initial)
512
+ }, M(t.label.slice(0, 1)), 3)) : (C(), s("span", dr, M(t.label), 1))]),
513
+ _: 2
514
+ }, 1032, [
515
+ "to",
516
+ "href",
517
+ "class",
518
+ "aria-current",
519
+ "aria-label"
520
+ ]))]),
521
+ _: 2
522
+ }, 1032, ["tooltip"]))), 128))], 10, ur));
523
+ }
524
+ }), mr = Symbol.for("sinde-ui:user"), hr = (e) => {
525
+ w(mr, i(() => e() ?? null));
526
+ }, gr = () => m(mr, i(() => null)), _r = ["src", "alt"], vr = {
527
+ link: "block size-8 shrink-0 cursor-pointer overflow-hidden rounded-full border border-current/10 bg-(--default) outline-none select-none focus-visible:ring-2 focus-visible:ring-(--accent)",
528
+ image: "size-full object-cover",
529
+ fallback: "flex size-full items-center justify-center text-[10px] leading-none font-semibold text-(--accent)"
530
+ }, yr = /* @__PURE__ */ f({
531
+ __name: "SAvatar",
532
+ props: {
533
+ src: { default: "" },
534
+ name: { default: "" },
535
+ to: { default: "" },
536
+ label: { default: "" }
537
+ },
538
+ setup(e) {
539
+ let t = sr(), n = gr(), r = i(() => e.name || n.value?.name || ""), o = i(() => e.src || n.value?.src || ""), c = i(() => e.to || n.value?.to || "/profile"), l = i(() => r.value || e.label || "Профиль"), u = i(() => (r.value || "?").slice(0, 2).toUpperCase());
540
+ return (e, n) => (C(), a(X, { tooltip: P(l) }, {
541
+ default: B(() => [(C(), a(j(P(t)), {
542
+ to: P(c),
543
+ href: P(t) === "a" ? P(c) : void 0,
544
+ class: y(vr.link),
545
+ "aria-label": `Профиль: ${P(l)}`
546
+ }, {
547
+ default: B(() => [P(o) ? (C(), s("img", {
548
+ key: 0,
549
+ src: P(o),
550
+ alt: P(l),
551
+ class: y(vr.image)
552
+ }, null, 10, _r)) : (C(), s("span", {
553
+ key: 1,
554
+ class: y(vr.fallback)
555
+ }, M(P(u)), 3))]),
556
+ _: 1
557
+ }, 8, [
558
+ "to",
559
+ "href",
560
+ "class",
561
+ "aria-label"
562
+ ]))]),
563
+ _: 1
564
+ }, 8, ["tooltip"]));
565
+ }
566
+ }), br = {
567
+ Idle: "idle",
568
+ Active: "active",
569
+ Load: "load",
570
+ Disabled: "disabled"
571
+ }, xr = {
572
+ base: "inline-flex items-center justify-center whitespace-nowrap rounded-full px-2 py-1 text-xs font-medium transition-all select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-black m-1",
573
+ states: {
574
+ [br.Idle]: "bg-(--text-default) text-(--bg-default) hover:bg-zinc-200 active:bg-zinc-300 focus-visible:ring-white",
575
+ [br.Active]: "bg-(--accent) text-white hover:bg-(--accent)/90 active:bg-(--accent)/70 focus-visible:ring-(--accent)/50",
576
+ [br.Load]: "cursor-wait! bg-zinc-800 text-zinc-400 focus-visible:ring-zinc-600",
577
+ [br.Disabled]: "cursor-not-allowed! bg-(--elevated) text-zinc-600 focus-visible:ring-zinc-800"
578
+ }
579
+ }, Sr = /* @__PURE__ */ f({
580
+ __name: "SBtn",
581
+ props: {
582
+ to: {},
583
+ label: { default: "" },
584
+ state: { default: () => br.Idle }
585
+ },
586
+ setup(e) {
587
+ let t = sr(), n = i(() => e.state === br.Disabled || e.state === br.Load), r = i(() => n.value || !e.to ? "button" : t), o = i(() => e.to ? void 0 : "button"), s = i(() => r.value === "button" ? void 0 : e.to), l = i(() => r.value === "a" ? e.to : void 0), u = i(() => [xr.base, xr.states[e.state]]), d = i(() => ({ "animate-pulse tracking-wide": e.state === br.Load }));
588
+ return (t, i) => (C(), a(j(P(r)), {
589
+ to: P(s),
590
+ href: P(l),
591
+ type: P(o),
592
+ disabled: P(n),
593
+ class: y(P(u))
594
+ }, {
595
+ default: B(() => [c("span", { class: y(P(d)) }, M(e.label), 3)]),
596
+ _: 1
597
+ }, 8, [
598
+ "to",
599
+ "href",
600
+ "type",
601
+ "disabled",
602
+ "class"
603
+ ]));
604
+ }
605
+ }), Cr = ["for"], wr = [
606
+ "id",
607
+ "checked",
608
+ "disabled",
609
+ "aria-checked"
610
+ ], Tr = { key: 0 }, Er = {
611
+ labelBase: "inline-flex w-fit items-center gap-2 select-none",
612
+ labelDisabled: "cursor-not-allowed opacity-50",
613
+ labelEnabled: "cursor-pointer",
614
+ box: "m-1 flex size-3 shrink-0 items-center justify-center bg-(--default) hover:bg-(--default-hover) ring-1 ring-(--border) peer-focus-visible:ring-2 peer-focus-visible:ring-(--accent)",
615
+ icon: "size-4 text-(--accent)",
616
+ partial: "size-1.5 bg-(--accent)"
617
+ }, Dr = /* @__PURE__ */ f({
618
+ __name: "SCheckbox",
619
+ props: /*@__PURE__*/ g({
620
+ id: {},
621
+ label: {},
622
+ disabled: {
623
+ type: Boolean,
624
+ default: !1
625
+ },
626
+ partial: {
627
+ type: Boolean,
628
+ default: !1
629
+ }
630
+ }, {
631
+ modelValue: {
632
+ type: [Boolean, String],
633
+ default: !1
634
+ },
635
+ modelModifiers: {}
636
+ }),
637
+ emits: ["update:modelValue"],
638
+ setup(e, { slots: t }) {
639
+ let n = I(e, "modelValue"), r = m("field-id", void 0), l = i(() => e.id || r || `checkbox-${F()}`), d = i(() => n.value === !0), f = i(() => n.value === "partial"), p = D(null), h = i(() => [Er.labelBase, e.disabled ? Er.labelDisabled : Er.labelEnabled]);
640
+ z(f, (e) => {
641
+ p.value && (p.value.indeterminate = e);
642
+ }, {
643
+ flush: "post",
644
+ immediate: !0
645
+ });
646
+ let g = () => n.value = e.partial ? n.value === !1 || n.value === !0 && "partial" : !d.value;
647
+ return (n, r) => (C(), s("label", {
648
+ for: P(l),
649
+ class: y(P(h))
650
+ }, [
651
+ c("input", {
652
+ id: P(l),
653
+ ref_key: "inputRef",
654
+ ref: p,
655
+ type: "checkbox",
656
+ checked: P(d),
657
+ disabled: e.disabled,
658
+ "aria-checked": P(f) ? "mixed" : P(d),
659
+ class: "peer sr-only",
660
+ onChange: g
661
+ }, null, 40, wr),
662
+ c("span", {
663
+ class: y(Er.box),
664
+ "aria-hidden": "true"
665
+ }, [P(d) ? (C(), a(Y, {
666
+ key: 0,
667
+ name: "check",
668
+ class: y(Er.icon)
669
+ }, null, 8, ["class"])) : P(f) ? (C(), s("span", {
670
+ key: 1,
671
+ class: y(Er.partial)
672
+ }, null, 2)) : o("", !0)], 2),
673
+ e.label || t.default ? (C(), s("span", Tr, [k(n.$slots, "default", {}, () => [u(M(e.label), 1)])])) : o("", !0)
674
+ ], 10, Cr));
675
+ }
676
+ }), Or = (e = 1500) => {
677
+ let t = D(!1), n = D(!1), r = i(() => typeof window < "u" && !!navigator?.clipboard), a = i(() => r.value && !n.value), o, s = () => {
678
+ clearTimeout(o), t.value = !0, o = setTimeout(() => {
679
+ t.value = !1;
680
+ }, e);
681
+ };
682
+ return x(() => {
683
+ clearTimeout(o);
684
+ }), {
685
+ isSupported: r,
686
+ copied: E(t),
687
+ copying: E(n),
688
+ isIdle: a,
689
+ copyFrom: async (e) => {
690
+ let t = N(e);
691
+ if (!t || !a.value) return !1;
692
+ n.value = !0;
693
+ try {
694
+ return await navigator.clipboard.writeText(t), s(), !0;
695
+ } catch {
696
+ return !1;
697
+ } finally {
698
+ n.value = !1;
699
+ }
700
+ },
701
+ paste: async (e) => {
702
+ if (!r.value) return null;
703
+ try {
704
+ let t = (await navigator.clipboard.readText()).trim();
705
+ return e && (e.value = t), t;
706
+ } catch {
707
+ return null;
708
+ }
709
+ }
710
+ };
711
+ }, kr = [
712
+ "data-state",
713
+ "aria-disabled",
714
+ "onKeydown"
715
+ ], Ar = {
716
+ base: "text-nowrap",
717
+ tooltipContent: "flex items-center gap-1.5",
718
+ checkIcon: "size-4 text-emerald-500"
719
+ }, jr = /* @__PURE__ */ f({
720
+ __name: "SCopy",
721
+ props: {
722
+ value: { default: "" },
723
+ hover: { default: "Копировать" },
724
+ done: { default: "Скопировано" },
725
+ disabled: {
726
+ type: Boolean,
727
+ default: !1
728
+ }
729
+ },
730
+ emits: ["copied"],
731
+ setup(e, { emit: t }) {
732
+ let n = t, { copied: r, copying: s, isSupported: d, copyFrom: f } = Or(1500), p = i(() => e.value ?? ""), m = i(() => e.disabled || !p.value), h = i(() => m.value ? "" : r.value ? e.done : e.hover), g = i(() => m.value || s.value ? "disabled" : "idle"), _ = async () => {
733
+ m.value || s.value || !d.value || await f(p.value) && n("copied", p.value);
734
+ };
735
+ return (e, t) => (C(), a(X, {
736
+ class: "w-fit",
737
+ tooltip: P(h)
738
+ }, l({
739
+ default: B(() => [c("span", {
740
+ class: y(Ar.base),
741
+ "data-state": P(g),
742
+ "aria-disabled": P(m) || void 0,
743
+ role: "button",
744
+ tabindex: "0",
745
+ onClick: _,
746
+ onKeydown: [V(ne(_, ["prevent"]), ["enter"]), V(ne(_, ["prevent"]), ["space"])]
747
+ }, [k(e.$slots, "default", {
748
+ copied: P(r),
749
+ copying: P(s),
750
+ state: P(g),
751
+ disabled: P(m),
752
+ copy: _
753
+ }, () => [u(M(P(p)), 1)])], 42, kr)]),
754
+ _: 2
755
+ }, [P(h) ? {
756
+ name: "tooltip",
757
+ fn: B(() => [c("span", { class: y(Ar.tooltipContent) }, [P(r) ? (C(), a(Y, {
758
+ key: 0,
759
+ name: "check",
760
+ class: y(Ar.checkIcon)
761
+ }, null, 8, ["class"])) : o("", !0), c("span", null, M(P(h)), 1)], 2)]),
762
+ key: "0"
763
+ } : void 0]), 1032, ["tooltip"]));
764
+ }
765
+ }), Mr = ["for"], Nr = [
766
+ "id",
767
+ "min",
768
+ "max",
769
+ "step",
770
+ "disabled"
771
+ ], Pr = {
772
+ wrapper: "flex w-full max-w-[300px] flex-col gap-1.5",
773
+ header: "flex items-center justify-between text-sm",
774
+ label: "font-medium text-(--text-default)",
775
+ value: "text-(--text-default) tabular-nums opacity-60",
776
+ slider: "h-2 w-full cursor-pointer appearance-none rounded-full transition focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--accent) disabled:cursor-not-allowed disabled:opacity-50 [&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-(--bg-default) [&::-moz-range-thumb]:bg-(--accent) [&::-moz-range-thumb]:shadow-sm [&::-moz-range-thumb]:transition [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-(--bg-default) [&::-webkit-slider-thumb]:bg-(--accent) [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:transition"
777
+ }, Fr = /* @__PURE__ */ f({
778
+ __name: "SRange",
779
+ props: /*@__PURE__*/ g({
780
+ label: { default: "" },
781
+ min: { default: 0 },
782
+ max: { default: 100 },
783
+ step: { default: 1 },
784
+ disabled: {
785
+ type: Boolean,
786
+ default: !1
787
+ },
788
+ showValue: {
789
+ type: Boolean,
790
+ default: !0
791
+ }
792
+ }, {
793
+ modelValue: { default: 0 },
794
+ modelModifiers: {}
795
+ }),
796
+ emits: ["update:modelValue"],
797
+ setup(e) {
798
+ let t = I(e, "modelValue"), n = F(), r = i(() => (Math.min(Math.max(t.value, e.min), e.max) - e.min) / (e.max - e.min) * 100);
799
+ return (i, a) => (C(), s("div", { class: y(Pr.wrapper) }, [e.label || e.showValue ? (C(), s("div", {
800
+ key: 0,
801
+ class: y(Pr.header)
802
+ }, [e.label ? (C(), s("label", {
803
+ key: 0,
804
+ for: P(n),
805
+ class: y(Pr.label)
806
+ }, M(e.label), 11, Mr)) : o("", !0), e.showValue ? (C(), s("span", {
807
+ key: 1,
808
+ class: y(Pr.value)
809
+ }, M(t.value), 3)) : o("", !0)], 2)) : o("", !0), te(c("input", {
810
+ id: P(n),
811
+ "onUpdate:modelValue": a[0] ||= (e) => t.value = e,
812
+ type: "range",
813
+ min: e.min,
814
+ max: e.max,
815
+ step: e.step,
816
+ disabled: e.disabled,
817
+ class: y(Pr.slider),
818
+ style: b({ background: `linear-gradient(to right, var(--accent) ${P(r)}%, var(--default) ${P(r)}%)` })
819
+ }, null, 14, Nr), [[
820
+ R,
821
+ t.value,
822
+ void 0,
823
+ { number: !0 }
824
+ ]])], 2));
825
+ }
826
+ }), Ir = {
827
+ root: "relative min-w-0 overflow-hidden",
828
+ edge: "pointer-events-none absolute opacity-0 transition-opacity",
829
+ edgeActive: "opacity-100",
830
+ layerDefault: "z-20",
831
+ layerRaised: "z-30",
832
+ left: "inset-y-0 left-0 w-16 shadow-[inset_40px_0_40px_-40px_var(--scroll-edge-shadow)]",
833
+ right: "inset-y-0 right-0 w-16 shadow-[inset_-40px_0_40px_-40px_var(--scroll-edge-shadow)]",
834
+ top: "inset-x-0 top-0 h-16 shadow-[inset_0_40px_40px_-40px_var(--scroll-edge-shadow)]",
835
+ bottom: "inset-x-0 bottom-0 h-16 shadow-[inset_0_-40px_40px_-40px_var(--scroll-edge-shadow)]",
836
+ leftTrim: "top-0 bottom-2 left-0 w-16 shadow-[inset_40px_0_40px_-40px_var(--scroll-edge-shadow)]",
837
+ rightTrim: "top-0 right-0 bottom-2 w-16 shadow-[inset_-40px_0_40px_-40px_var(--scroll-edge-shadow)]"
838
+ }, Lr = /* @__PURE__ */ f({
839
+ __name: "SScrollableEdges",
840
+ props: {
841
+ edges: { default: () => ({}) },
842
+ active: { default: () => ({}) },
843
+ axis: { default: "both" },
844
+ area: { default: "full" },
845
+ layer: { default: "default" },
846
+ hideScrollbar: {
847
+ type: Boolean,
848
+ default: !0
849
+ }
850
+ },
851
+ setup(e, { attrs: t }) {
852
+ let r = e, i = [
853
+ "left",
854
+ "right",
855
+ "top",
856
+ "bottom"
857
+ ], a = D(null), o = (e) => r.axis === "both" ? !0 : r.axis === "x" ? e === "left" || e === "right" : e === "top" || e === "bottom", l = (e) => o(e) && !!(r.active?.[e] ?? r.edges?.[e]), u = (e) => e === "left" ? r.area === "trim-bottom" ? Ir.leftTrim : Ir.left : e === "right" ? r.area === "trim-bottom" ? Ir.rightTrim : Ir.right : e === "top" ? Ir.top : Ir.bottom, d = (e) => {
858
+ let t = getComputedStyle(e).overflowX;
859
+ return (t === "auto" || t === "scroll") && e.scrollWidth > e.clientWidth;
860
+ }, f = null, p = (e) => {
861
+ let t = a.value;
862
+ if (f && t?.contains(f) && d(f)) return f;
863
+ let n = e instanceof HTMLElement ? e : null;
864
+ for (; t && n && t.contains(n);) {
865
+ if (d(n)) return f = n, n;
866
+ if (n === t) break;
867
+ n = n.parentElement;
868
+ }
869
+ let r = t && Array.from(t.querySelectorAll("*")).find(d) || null;
870
+ return f = r, r;
871
+ }, m = (e) => {
872
+ if (r.axis !== "x" || !e.deltaY || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
873
+ let t = p(e.target);
874
+ if (!t) return;
875
+ let n = t.scrollWidth - t.clientWidth, i = Math.min(Math.max(t.scrollLeft + e.deltaY, 0), n);
876
+ i !== t.scrollLeft && (e.preventDefault(), t.scrollLeft = i);
877
+ };
878
+ return (o, d) => (C(), s("div", _({
879
+ ref_key: "rootRef",
880
+ ref: a,
881
+ class: [Ir.root, e.hideScrollbar && "hide-scrollbar"]
882
+ }, t, { onWheel: m }), [k(o.$slots, "default"), (C(), s(n, null, O(i, (e) => c("span", {
883
+ key: e,
884
+ class: y([
885
+ Ir.edge,
886
+ u(e),
887
+ r.layer === "raised" ? Ir.layerRaised : Ir.layerDefault,
888
+ l(e) && Ir.edgeActive
889
+ ]),
890
+ "aria-hidden": "true"
891
+ }, null, 2)), 64))], 16));
892
+ }
893
+ }), Rr = D(null), zr = () => Rr, Br = [
894
+ "id",
895
+ "tabindex",
896
+ "aria-expanded",
897
+ "aria-controls",
898
+ "aria-activedescendant"
899
+ ], Vr = ["placeholder"], Hr = ["name", "value"], Ur = ["id"], Wr = [
900
+ "id",
901
+ "aria-selected",
902
+ "aria-disabled",
903
+ "onMouseenter",
904
+ "onMousedown"
905
+ ], Gr = {
906
+ wrapper: "relative m-1",
907
+ trigger: "relative flex h-9 w-full items-center justify-between gap-2 px-3 text-sm text-(--text-default) bg-(--default) hover:bg-(--default-hover) outline-none select-none focus:ring-2 focus:ring-(--accent) focus-within:ring-2 focus-within:ring-(--accent)",
908
+ input: "w-full bg-transparent outline-none text-sm text-(--text-default)",
909
+ label: "flex-1 min-w-0 truncate text-sm pointer-events-none",
910
+ clearButton: "size-4 shrink-0 flex items-center justify-center opacity-60 hover:opacity-100 cursor-pointer outline-none",
911
+ arrow: "size-4 shrink-0 pointer-events-none transition-transform duration-200",
912
+ dropdown: "fixed z-90 overflow-auto bg-(--elevated) text-(--text-default) ring-1 ring-(--border) outline-none",
913
+ noResults: "px-3 py-2 text-sm opacity-60",
914
+ option: "w-full px-3 py-1.5 text-left text-sm truncate transition-colors",
915
+ optionDisabled: "cursor-not-allowed opacity-50",
916
+ optionEnabled: "cursor-pointer",
917
+ optionActive: "bg-(--default-hover)",
918
+ optionSelected: "text-(--accent)"
919
+ }, Kr = /* @__PURE__ */ f({
920
+ __name: "SSelect",
921
+ props: /*@__PURE__*/ g({
922
+ options: { default: () => [] },
923
+ id: {},
924
+ name: {},
925
+ disabled: {
926
+ type: Boolean,
927
+ default: !1
928
+ },
929
+ invalid: {
930
+ type: Boolean,
931
+ default: !1
932
+ },
933
+ placeholder: { default: "Выберите значение" },
934
+ filter: {
935
+ type: Boolean,
936
+ default: !1
937
+ },
938
+ clearable: {
939
+ type: Boolean,
940
+ default: !1
941
+ },
942
+ allowCustom: {
943
+ type: Boolean,
944
+ default: !1
945
+ }
946
+ }, {
947
+ modelValue: {},
948
+ modelModifiers: {}
949
+ }),
950
+ emits: ["update:modelValue"],
951
+ setup(e) {
952
+ let t = I(e, "modelValue"), l = F(), u = i(() => e.id || m("field-id", void 0) || `select-${l}`), f = i(() => `${u.value}-listbox`), p = D(null), g = D(null), _ = D(null), w = zr(), T = i(() => w.value === l), E = D(-1), k = D(""), A = D("bottom-start"), { floatingStyles: j } = W(p, g, {
953
+ open: T,
954
+ whileElementsMounted: re,
955
+ placement: A,
956
+ middleware: [ae(4), U({ apply({ rects: e, availableHeight: t, elements: n }) {
957
+ Object.assign(n.floating.style, {
958
+ width: `${e.reference.width}px`,
959
+ maxHeight: `${Math.min(240, Math.max(48, t))}px`
960
+ });
961
+ } })]
962
+ }), N = () => {
963
+ let e = p.value;
964
+ if (!e) return;
965
+ let t = e.getBoundingClientRect(), n = g.value?.scrollHeight || L.value.length * 32 + 8, r = Math.min(n, 240), i = window.innerHeight - t.bottom - 4, a = t.top - 4, o;
966
+ o = i >= r ? "bottom-start" : a >= r || a > i ? "top-start" : "bottom-start", A.value !== o && (A.value = o);
967
+ }, L = i(() => {
968
+ if (!e.filter || !k.value.trim()) return e.options;
969
+ let t = k.value.toLowerCase().trim(), n = e.options.filter((e) => e.label.toLowerCase().includes(t) || String(e.value).toLowerCase().includes(t));
970
+ return e.allowCustom && t && !e.options.some((e) => String(e.value).toLowerCase() === t) ? [{
971
+ value: k.value.trim(),
972
+ label: `Использовать: ${k.value.trim()}`
973
+ }, ...n] : n;
974
+ }), ee = i(() => e.options.find((e) => e.value === t.value)), B = i(() => ee.value?.label || String(t.value ?? e.placeholder)), V = () => {
975
+ if (E.value < 0 || !g.value) return;
976
+ let e = document.getElementById(`${u.value}-opt-${E.value}`);
977
+ e && (e.offsetTop < g.value.scrollTop ? g.value.scrollTop = e.offsetTop : e.offsetTop + e.offsetHeight > g.value.scrollTop + g.value.clientHeight && (g.value.scrollTop = e.offsetTop + e.offsetHeight - g.value.clientHeight));
978
+ }, ie = (e, t) => {
979
+ let n = L.value.length;
980
+ if (!n) return -1;
981
+ let r = e;
982
+ for (let e = 0; e < n; e++) if (r = (r + t + n) % n, !L.value[r]?.disabled) return r;
983
+ return -1;
984
+ }, H = () => {
985
+ let e = L.value.findIndex((e) => e.value === t.value);
986
+ E.value = e >= 0 && !L.value[e]?.disabled ? e : L.value.findIndex((e) => !e.disabled);
987
+ }, oe = async () => {
988
+ e.disabled || (w.value = l, H(), N(), await v(), N(), e.filter && _.value && _.value.focus({ preventScroll: !0 }), V());
989
+ }, G = () => {
990
+ w.value === l && (w.value = null), k.value = "";
991
+ }, se = () => T.value ? G() : oe(), K = (n) => {
992
+ n.disabled || e.disabled || (t.value = n.value, G(), p.value?.focus({ preventScroll: !0 }));
993
+ }, ce = (e) => {
994
+ e.stopPropagation(), t.value = null, G(), p.value?.focus({ preventScroll: !0 });
995
+ }, le = (n) => {
996
+ if (n.key === "ArrowDown" || n.key === "ArrowUp") {
997
+ if (n.preventDefault(), !T.value) return oe();
998
+ let e = ie(E.value, n.key === "ArrowDown" ? 1 : -1);
999
+ e !== -1 && (E.value = e, V());
1000
+ } else if (n.key === "Enter") {
1001
+ n.preventDefault();
1002
+ let e = L.value[E.value];
1003
+ T.value && e ? K(e) : oe();
1004
+ } else n.key === "Escape" ? T.value && (n.preventDefault(), n.stopPropagation(), G(), p.value?.focus({ preventScroll: !0 })) : n.key === "Tab" ? G() : n.key !== "Backspace" && n.key !== "Delete" || T.value || !e.clearable && !e.allowCustom || e.disabled || (t.value = null);
1005
+ }, q = (e) => {
1006
+ T.value && !p.value?.contains(e.target) && !g.value?.contains(e.target) && G();
1007
+ };
1008
+ z(L, () => {
1009
+ T.value && H();
1010
+ }), z(() => e.disabled, (e) => {
1011
+ e && G();
1012
+ });
1013
+ let ue = () => {
1014
+ T.value && N();
1015
+ };
1016
+ S(() => {
1017
+ document.addEventListener("click", q), window.addEventListener("resize", ue);
1018
+ }), x(() => {
1019
+ G(), document.removeEventListener("click", q), window.removeEventListener("resize", ue);
1020
+ });
1021
+ let de = i(() => [
1022
+ Gr.trigger,
1023
+ e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger) focus-within:ring-(--danger)" : "ring-1 ring-(--border)",
1024
+ e.disabled && "cursor-not-allowed opacity-50"
1025
+ ]), fe = i(() => [Gr.label, !t.value && "opacity-60"]), pe = i(() => [Gr.arrow, T.value && "rotate-90"]), me = (e, n) => [
1026
+ Gr.option,
1027
+ e.disabled ? Gr.optionDisabled : Gr.optionEnabled,
1028
+ n === E.value && !e.disabled && Gr.optionActive,
1029
+ e.value === t.value && Gr.optionSelected
1030
+ ];
1031
+ return (i, l) => (C(), s("div", { class: y(Gr.wrapper) }, [
1032
+ c("div", {
1033
+ ref_key: "controlRef",
1034
+ ref: p,
1035
+ id: P(u),
1036
+ class: y(P(de)),
1037
+ tabindex: e.disabled ? -1 : 0,
1038
+ role: "combobox",
1039
+ "aria-expanded": P(T),
1040
+ "aria-controls": P(f),
1041
+ "aria-activedescendant": P(T) && P(E) >= 0 ? `${P(u)}-opt-${P(E)}` : void 0,
1042
+ onClick: se,
1043
+ onKeydown: le
1044
+ }, [
1045
+ e.filter && P(T) ? te((C(), s("input", {
1046
+ key: 0,
1047
+ ref_key: "inputRef",
1048
+ ref: _,
1049
+ "onUpdate:modelValue": l[0] ||= (e) => h(k) ? k.value = e : null,
1050
+ type: "text",
1051
+ class: y(Gr.input),
1052
+ placeholder: P(B),
1053
+ onClick: l[1] ||= ne(() => {}, ["stop"])
1054
+ }, null, 10, Vr)), [[R, P(k)]]) : (C(), s("span", {
1055
+ key: 1,
1056
+ class: y(P(fe))
1057
+ }, M(P(B)), 3)),
1058
+ (e.clearable || e.allowCustom) && t.value && !e.disabled ? (C(), s("button", {
1059
+ key: 2,
1060
+ type: "button",
1061
+ class: y(Gr.clearButton),
1062
+ tabindex: "-1",
1063
+ onClick: ce
1064
+ }, [d(Y, { name: "close" })], 2)) : o("", !0),
1065
+ d(Y, {
1066
+ name: "chevron",
1067
+ class: y(P(pe))
1068
+ }, null, 8, ["class"])
1069
+ ], 42, Br),
1070
+ e.name ? (C(), s("input", {
1071
+ key: 0,
1072
+ type: "hidden",
1073
+ name: e.name,
1074
+ value: String(t.value ?? "")
1075
+ }, null, 8, Hr)) : o("", !0),
1076
+ P(T) ? (C(), a(r, {
1077
+ key: 1,
1078
+ to: "body"
1079
+ }, [c("div", {
1080
+ id: P(f),
1081
+ ref_key: "listRef",
1082
+ ref: g,
1083
+ class: y(Gr.dropdown),
1084
+ style: b(P(j)),
1085
+ role: "listbox",
1086
+ "data-select-list": ""
1087
+ }, [P(L).length ? o("", !0) : (C(), s("div", {
1088
+ key: 0,
1089
+ class: y(Gr.noResults)
1090
+ }, "Ничего не найдено", 2)), (C(!0), s(n, null, O(P(L), (e, n) => (C(), s("div", {
1091
+ id: `${P(u)}-opt-${n}`,
1092
+ key: String(e.value ?? n),
1093
+ class: y(me(e, n)),
1094
+ role: "option",
1095
+ "aria-selected": e.value === t.value,
1096
+ "aria-disabled": e.disabled,
1097
+ onMouseenter: (t) => !e.disabled && (E.value = n),
1098
+ onMousedown: ne((t) => K(e), ["prevent"])
1099
+ }, M(e.label), 43, Wr))), 128))], 14, Ur)])) : o("", !0)
1100
+ ], 2));
1101
+ }
1102
+ }), qr = ["aria-label"], Jr = { class: "min-w-0 truncate text-sm font-semibold" }, Yr = { class: "flex shrink-0 items-center gap-2" }, Xr = ["src"], Zr = { class: "w-36 shrink-0" }, Z = {
1103
+ overlay: "fixed inset-0 z-60 flex touch-none flex-col overscroll-contain bg-(--bg-default) text-(--text-default)",
1104
+ header: "flex shrink-0 items-center justify-between gap-3 px-3 py-1",
1105
+ meta: "text-xs whitespace-nowrap tabular-nums opacity-60",
1106
+ iconButton: "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
1107
+ closeButton: "inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-full px-2 text-xs font-medium text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
1108
+ viewport: "min-h-0 flex-1",
1109
+ canvas: "ui-image-grid block size-full",
1110
+ footer: "shrink-0 px-3 py-2",
1111
+ controls: "overflow-x-auto overflow-y-hidden",
1112
+ controlsRow: "flex min-w-max items-center gap-2",
1113
+ actions: "ml-2 flex shrink-0 items-center gap-2",
1114
+ zoomField: "w-40 shrink-0 sm:w-64",
1115
+ error: "mt-2 text-sm text-(--danger)"
1116
+ }, Qr = /* @__PURE__ */ f({
1117
+ __name: "SCropper",
1118
+ props: {
1119
+ file: {},
1120
+ title: { default: "" },
1121
+ loading: {
1122
+ type: Boolean,
1123
+ default: !1
1124
+ },
1125
+ aspectRatio: { default: "free" }
1126
+ },
1127
+ emits: ["cancel", "confirm"],
1128
+ setup(e, { emit: t }) {
1129
+ let n = [
1130
+ {
1131
+ value: "free",
1132
+ label: "Свободная форма"
1133
+ },
1134
+ {
1135
+ value: "1:1",
1136
+ label: "1:1"
1137
+ },
1138
+ {
1139
+ value: "4:3",
1140
+ label: "4:3"
1141
+ },
1142
+ {
1143
+ value: "3:4",
1144
+ label: "3:4"
1145
+ },
1146
+ {
1147
+ value: "16:9",
1148
+ label: "16:9"
1149
+ },
1150
+ {
1151
+ value: "9:16",
1152
+ label: "9:16"
1153
+ }
1154
+ ], l = (e) => {
1155
+ switch (e) {
1156
+ case "1:1": return 1;
1157
+ case "4:3": return 4 / 3;
1158
+ case "3:4": return 3 / 4;
1159
+ case "16:9": return 16 / 9;
1160
+ case "9:16": return 9 / 16;
1161
+ default: return NaN;
1162
+ }
1163
+ }, u = (e) => Number.isFinite(e) && [
1164
+ ["1:1", 1],
1165
+ ["4:3", 4 / 3],
1166
+ ["3:4", 3 / 4],
1167
+ ["16:9", 16 / 9],
1168
+ ["9:16", 9 / 16]
1169
+ ].find(([, t]) => Math.abs(t - e) < 1e-4)?.[0] || "free", f = (e) => e === "free" ? NaN : e, p = D(u(f(e.aspectRatio))), m = i(() => l(p.value)), g = t, _ = D(null), b = D(null), w = D(null), E = D(null), O = D(""), k = D(""), A = D(1), j = D(.1), N = D(3), F = (e) => Math.round(e * 100) / 100, I = (e = b.value) => {
1170
+ let t = e?.$getTransform(), n = t ? Math.hypot(t[0], t[1]) : 0;
1171
+ return n > 0 && Number.isFinite(n) ? n : 0;
1172
+ }, L = () => {
1173
+ let e = I();
1174
+ e > 0 && (A.value = e, e > N.value && (N.value = F(e)));
1175
+ }, R = (e = !1) => {
1176
+ let t = I();
1177
+ t > 0 && (A.value = F(t), j.value = F(e ? t : Math.min(j.value, t)), N.value = Math.max(3, F(j.value * 3)));
1178
+ }, ee = D(""), te = D(null), V = T({
1179
+ left: !1,
1180
+ right: !1,
1181
+ top: !1,
1182
+ bottom: !1
1183
+ }), ne = () => {
1184
+ let e = te.value;
1185
+ e && (V.left = e.scrollLeft > 2, V.right = e.scrollLeft < Math.max(0, e.scrollWidth - e.clientWidth) - 2);
1186
+ }, re = i(() => e.title || "Кадрирование"), ie = null, ae = () => ie ??= import("cropperjs"), H = null, U = () => "image/webp", W = (e) => {
1187
+ let t = String(e || "").trim(), n = t.lastIndexOf(".");
1188
+ return n > 0 ? t.slice(0, n) : t || "image";
1189
+ }, oe = () => {
1190
+ O.value &&= (URL.revokeObjectURL(O.value), "");
1191
+ }, G = () => {
1192
+ let e = _.value, t = b.value, n = w.value;
1193
+ if (!e || !t || !n) return;
1194
+ let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = Math.max(i.left, r.left), o = Math.max(i.top, r.top), s = Math.min(i.right, r.right), c = Math.min(i.bottom, r.bottom), l = s - a, u = c - o;
1195
+ if (!(r.width > 0 && l > 0 && u > 0)) return;
1196
+ let d = .04, f = l * (1 - d * 2), p = u * (1 - d * 2), m = n.aspectRatio;
1197
+ Number.isFinite(m) && m > 0 && (f / p > m ? f = p * m : p = f / m), n.$change(a - r.left + (l - f) / 2, o - r.top + (u - p) / 2, f, p, m);
1198
+ }, se = async () => {
1199
+ let e = b.value;
1200
+ if (!e) return;
1201
+ try {
1202
+ await e.$ready();
1203
+ } catch {
1204
+ k.value = "Не удалось прочитать изображение.";
1205
+ return;
1206
+ }
1207
+ await v();
1208
+ let t = w.value;
1209
+ t && (t.aspectRatio = m.value), G(), R(!0);
1210
+ }, K = async () => {
1211
+ typeof window < "u" && e.file && (await ae(), await v(), await se());
1212
+ }, ce = () => {
1213
+ let e = b.value;
1214
+ e && (e.$center(e.initialFit || "contain"), G(), R());
1215
+ }, le = () => {
1216
+ let e = b.value;
1217
+ e && (e.$resetTransform(), e.$center(e.initialFit || "contain"), G(), R(!0));
1218
+ }, q = (e) => {
1219
+ let t = b.value;
1220
+ t && (t.$rotate(`${e}deg`), ce());
1221
+ }, ue = () => {
1222
+ b.value?.$scale(-1, 1);
1223
+ }, de = () => {
1224
+ b.value?.$scale(1, -1);
1225
+ }, fe = (e) => {
1226
+ e > 0 && Number.isFinite(e) && e !== 1 && (b.value?.$zoom(e >= 1 ? e - 1 : 1 - 1 / e), L());
1227
+ }, pe = (e) => {
1228
+ let t = I();
1229
+ if (!(t > 0) || !(e > 0) || !Number.isFinite(e)) return;
1230
+ let n = Math.min(N.value, Math.max(j.value, e));
1231
+ fe(n / t);
1232
+ }, me = () => fe(1.1), he = () => fe(1 / 1.1), ge = () => pe(Number(A.value)), _e = async () => {
1233
+ let t = b.value, n = w.value;
1234
+ if (!t || !n || !e.file || e.loading) return;
1235
+ k.value = "";
1236
+ let r = I(t);
1237
+ if (!(r > 0) || !(n.width > 0) || !(n.height > 0)) k.value = "Не удалось получить область кадрирования.";
1238
+ else try {
1239
+ let t = await n.$toCanvas({
1240
+ width: Math.max(1, Math.round(n.width / r)),
1241
+ height: Math.max(1, Math.round(n.height / r)),
1242
+ beforeDraw: (e) => {
1243
+ e.imageSmoothingEnabled = !0, e.imageSmoothingQuality = "high";
1244
+ }
1245
+ }), i = U(), a = await new Promise((e) => t.toBlob(e, i, .92));
1246
+ if (!a) {
1247
+ k.value = "Не удалось подготовить изображение к загрузке.";
1248
+ return;
1249
+ }
1250
+ g("confirm", new File([a], `${W(e.file.name)}-cropped.webp`, {
1251
+ type: i,
1252
+ lastModified: Date.now()
1253
+ }));
1254
+ } catch {
1255
+ k.value = "Не удалось подготовить изображение к загрузке.";
1256
+ }
1257
+ }, ve = () => {
1258
+ e.loading || g("cancel");
1259
+ }, J = (e) => {
1260
+ e.key === "Escape" && ve();
1261
+ }, ye = () => {
1262
+ requestAnimationFrame(ce), requestAnimationFrame(ne);
1263
+ };
1264
+ return z(() => e.file, async (e) => {
1265
+ k.value = "", A.value = 1, j.value = .1, N.value = 3, oe(), e && typeof window < "u" && (O.value = URL.createObjectURL(e), await K());
1266
+ }, { immediate: !0 }), z(() => e.aspectRatio, (e) => {
1267
+ p.value = u(f(e));
1268
+ }), z(p, (e) => {
1269
+ let t = w.value;
1270
+ t && (t.aspectRatio = l(e));
1271
+ }), S(async () => {
1272
+ typeof window < "u" && (ee.value = document.body.style.overflow, document.body.style.overflow = "hidden", window.addEventListener("keydown", J), H = new ResizeObserver(ye), E.value && H.observe(E.value), v(ne), await K());
1273
+ }), x(() => {
1274
+ oe(), H?.disconnect(), typeof window < "u" && (window.removeEventListener("keydown", J), document.body.style.overflow = ee.value);
1275
+ }), (t, i) => e.file ? (C(), a(r, {
1276
+ key: 0,
1277
+ to: "body"
1278
+ }, [c("div", {
1279
+ class: y(Z.overlay),
1280
+ role: "dialog",
1281
+ "aria-modal": "true",
1282
+ "aria-label": P(re)
1283
+ }, [
1284
+ c("header", { class: y(Z.header) }, [c("h2", Jr, M(P(re)), 1), c("div", Yr, [c("span", { class: y(Z.meta) }, M(Math.round(Math.max(0, P(A)) * 100)) + "%", 3), c("button", {
1285
+ type: "button",
1286
+ class: y(Z.closeButton),
1287
+ "aria-label": "Закрыть окно",
1288
+ onClick: ve
1289
+ }, [d(Y, {
1290
+ name: "close",
1291
+ class: "size-4"
1292
+ }), i[4] ||= c("span", { class: "hidden sm:inline" }, "Закрыть", -1)], 2)])], 2),
1293
+ c("div", {
1294
+ ref_key: "viewportRef",
1295
+ ref: E,
1296
+ class: y(Z.viewport)
1297
+ }, [c("cropper-canvas", {
1298
+ ref_key: "canvasRef",
1299
+ ref: _,
1300
+ class: y(Z.canvas),
1301
+ onTransform: L
1302
+ }, [
1303
+ c("cropper-image", {
1304
+ ref_key: "imageRef",
1305
+ ref: b,
1306
+ src: P(O),
1307
+ alt: "Изображение для кадрирования",
1308
+ rotatable: "",
1309
+ scalable: "",
1310
+ translatable: ""
1311
+ }, null, 8, Xr),
1312
+ i[6] ||= c("cropper-handle", {
1313
+ action: "move",
1314
+ "theme-color": "transparent"
1315
+ }, null, -1),
1316
+ c("cropper-selection", {
1317
+ ref_key: "selectionRef",
1318
+ ref: w,
1319
+ "initial-coverage": .92,
1320
+ movable: "",
1321
+ resizable: "",
1322
+ "theme-color": "var(--accent)"
1323
+ }, [...i[5] ||= [
1324
+ c("cropper-grid", {
1325
+ role: "grid",
1326
+ bordered: "",
1327
+ covered: ""
1328
+ }, null, -1),
1329
+ c("cropper-crosshair", { centered: "" }, null, -1),
1330
+ c("cropper-handle", {
1331
+ action: "move",
1332
+ "theme-color": "transparent"
1333
+ }, null, -1),
1334
+ c("cropper-handle", {
1335
+ action: "n-resize",
1336
+ "theme-color": "var(--accent)"
1337
+ }, null, -1),
1338
+ c("cropper-handle", {
1339
+ action: "e-resize",
1340
+ "theme-color": "var(--accent)"
1341
+ }, null, -1),
1342
+ c("cropper-handle", {
1343
+ action: "s-resize",
1344
+ "theme-color": "var(--accent)"
1345
+ }, null, -1),
1346
+ c("cropper-handle", {
1347
+ action: "w-resize",
1348
+ "theme-color": "var(--accent)"
1349
+ }, null, -1),
1350
+ c("cropper-handle", {
1351
+ action: "ne-resize",
1352
+ "theme-color": "var(--accent)"
1353
+ }, null, -1),
1354
+ c("cropper-handle", {
1355
+ action: "nw-resize",
1356
+ "theme-color": "var(--accent)"
1357
+ }, null, -1),
1358
+ c("cropper-handle", {
1359
+ action: "se-resize",
1360
+ "theme-color": "var(--accent)"
1361
+ }, null, -1),
1362
+ c("cropper-handle", {
1363
+ action: "sw-resize",
1364
+ "theme-color": "var(--accent)"
1365
+ }, null, -1)
1366
+ ]], 512)
1367
+ ], 34)], 2),
1368
+ c("footer", { class: y(Z.footer) }, [d(Lr, {
1369
+ active: P(V),
1370
+ axis: "x"
1371
+ }, {
1372
+ default: B(() => [c("div", {
1373
+ ref_key: "controlsRef",
1374
+ ref: te,
1375
+ class: y(Z.controls),
1376
+ onScrollPassive: ne
1377
+ }, [c("div", { class: y(Z.controlsRow) }, [
1378
+ d(X, { tooltip: "Повернуть против часовой стрелки на 90 градусов" }, {
1379
+ default: B(() => [c("button", {
1380
+ type: "button",
1381
+ class: y(Z.iconButton),
1382
+ "aria-label": "Повернуть против часовой стрелки на 90 градусов",
1383
+ onClick: i[0] ||= (e) => q(-90)
1384
+ }, [d(Y, {
1385
+ name: "rotate-left",
1386
+ class: "size-5"
1387
+ })], 2)]),
1388
+ _: 1
1389
+ }),
1390
+ d(X, { tooltip: "Повернуть по часовой стрелке на 90 градусов" }, {
1391
+ default: B(() => [c("button", {
1392
+ type: "button",
1393
+ class: y(Z.iconButton),
1394
+ "aria-label": "Повернуть по часовой стрелке на 90 градусов",
1395
+ onClick: i[1] ||= (e) => q(90)
1396
+ }, [d(Y, {
1397
+ name: "rotate-right",
1398
+ class: "size-5"
1399
+ })], 2)]),
1400
+ _: 1
1401
+ }),
1402
+ d(X, { tooltip: "Отразить по горизонтали" }, {
1403
+ default: B(() => [c("button", {
1404
+ type: "button",
1405
+ class: y(Z.iconButton),
1406
+ "aria-label": "Отразить по горизонтали",
1407
+ onClick: ue
1408
+ }, [d(Y, {
1409
+ name: "flip-x",
1410
+ class: "size-5"
1411
+ })], 2)]),
1412
+ _: 1
1413
+ }),
1414
+ d(X, { tooltip: "Отразить по вертикали" }, {
1415
+ default: B(() => [c("button", {
1416
+ type: "button",
1417
+ class: y(Z.iconButton),
1418
+ "aria-label": "Отразить по вертикали",
1419
+ onClick: de
1420
+ }, [d(Y, {
1421
+ name: "flip-y",
1422
+ class: "size-5"
1423
+ })], 2)]),
1424
+ _: 1
1425
+ }),
1426
+ d(X, { tooltip: "Уменьшить" }, {
1427
+ default: B(() => [c("button", {
1428
+ type: "button",
1429
+ class: y(Z.iconButton),
1430
+ "aria-label": "Уменьшить",
1431
+ onClick: he
1432
+ }, [d(Y, {
1433
+ name: "zoom-out",
1434
+ class: "size-5"
1435
+ })], 2)]),
1436
+ _: 1
1437
+ }),
1438
+ c("div", { class: y(Z.zoomField) }, [d(Fr, {
1439
+ modelValue: P(A),
1440
+ "onUpdate:modelValue": [i[2] ||= (e) => h(A) ? A.value = e : null, ge],
1441
+ modelModifiers: { number: !0 },
1442
+ min: P(j),
1443
+ max: P(N),
1444
+ step: .01,
1445
+ "show-value": !1
1446
+ }, null, 8, [
1447
+ "modelValue",
1448
+ "min",
1449
+ "max"
1450
+ ])], 2),
1451
+ d(X, { tooltip: "Увеличить" }, {
1452
+ default: B(() => [c("button", {
1453
+ type: "button",
1454
+ class: y(Z.iconButton),
1455
+ "aria-label": "Увеличить",
1456
+ onClick: me
1457
+ }, [d(Y, {
1458
+ name: "zoom-in",
1459
+ class: "size-5"
1460
+ })], 2)]),
1461
+ _: 1
1462
+ }),
1463
+ d(X, { tooltip: "Вместить" }, {
1464
+ default: B(() => [c("button", {
1465
+ type: "button",
1466
+ class: y(Z.iconButton),
1467
+ "aria-label": "Вместить",
1468
+ onClick: ce
1469
+ }, [d(Y, {
1470
+ name: "fit-screen",
1471
+ class: "size-5"
1472
+ })], 2)]),
1473
+ _: 1
1474
+ }),
1475
+ d(X, { tooltip: "Сбросить" }, {
1476
+ default: B(() => [c("button", {
1477
+ type: "button",
1478
+ class: y(Z.iconButton),
1479
+ "aria-label": "Сбросить",
1480
+ onClick: le
1481
+ }, [d(Y, {
1482
+ name: "refresh",
1483
+ class: "size-5"
1484
+ })], 2)]),
1485
+ _: 1
1486
+ }),
1487
+ c("div", Zr, [d(Kr, {
1488
+ modelValue: P(p),
1489
+ "onUpdate:modelValue": i[3] ||= (e) => h(p) ? p.value = e : null,
1490
+ options: n
1491
+ }, null, 8, ["modelValue"])]),
1492
+ c("div", { class: y(Z.actions) }, [d(Sr, {
1493
+ label: "Отмена",
1494
+ state: e.loading ? "disabled" : "idle",
1495
+ onClick: ve
1496
+ }, null, 8, ["state"]), d(Sr, {
1497
+ label: "Загрузить",
1498
+ state: e.loading ? "load" : "idle",
1499
+ onClick: _e
1500
+ }, null, 8, ["state"])], 2)
1501
+ ], 2)], 34)]),
1502
+ _: 1
1503
+ }, 8, ["active"]), P(k) ? (C(), s("p", {
1504
+ key: 0,
1505
+ class: y(Z.error)
1506
+ }, M(P(k)), 3)) : o("", !0)], 2)
1507
+ ], 10, qr)])) : o("", !0);
1508
+ }
1509
+ }), $r = {
1510
+ wrapper: "inline-flex items-center gap-1.5",
1511
+ spinner: "inline-block size-3 animate-spin rounded-full border-2 border-(--accent) border-t-transparent",
1512
+ label: "text-xs"
1513
+ }, ei = /* @__PURE__ */ f({
1514
+ __name: "SLoad",
1515
+ props: { label: {} },
1516
+ setup(e) {
1517
+ return (t, n) => (C(), s("span", { class: y($r.wrapper) }, [c("span", {
1518
+ role: "status",
1519
+ "aria-label": "Загрузка",
1520
+ class: y($r.spinner)
1521
+ }, null, 2), e.label ? (C(), s("span", {
1522
+ key: 0,
1523
+ class: y($r.label)
1524
+ }, M(e.label), 3)) : o("", !0)], 2));
1525
+ }
1526
+ }), ti = { class: "contents" }, ni = ["aria-sort"], ri = ["onClick"], ii = { class: "contents" }, ai = {
1527
+ wrapper: "relative w-full max-w-full overflow-x-auto min-w-0",
1528
+ loading: "pointer-events-none absolute top-1 right-1 z-10 flex items-center gap-1 rounded-full bg-(--bg-default) px-2 py-1",
1529
+ leadHead: "w-7 py-2 pr-2 text-left align-top",
1530
+ leadCell: "n w-7 py-2 pr-2 align-top text-xs",
1531
+ emptyRow: "col-span-full py-3 pr-4 text-sm opacity-75",
1532
+ dividerRow: "col-span-full py-0.5 pr-4",
1533
+ dividerContent: "flex items-center gap-2",
1534
+ dividerText: "n text-[10px] leading-none",
1535
+ dividerLine: "h-px flex-1 bg-(--border)",
1536
+ headBase: "py-2 pr-4 text-left align-top text-xs font-medium opacity-70",
1537
+ cellBase: "py-2 pr-4 align-top"
1538
+ }, oi = /* @__PURE__ */ f({
1539
+ __name: "SDataTable",
1540
+ props: {
1541
+ columns: { default: () => [] },
1542
+ rows: { default: () => [] },
1543
+ loading: {
1544
+ type: Boolean,
1545
+ default: !1
1546
+ },
1547
+ emptyText: { default: "" },
1548
+ rowKey: {
1549
+ type: [String, Function],
1550
+ default: "id"
1551
+ },
1552
+ nowrap: {
1553
+ type: Boolean,
1554
+ default: !1
1555
+ },
1556
+ rowNumbers: {
1557
+ type: Boolean,
1558
+ default: !1
1559
+ },
1560
+ divider: { type: Function },
1561
+ fixedLayout: {
1562
+ type: Boolean,
1563
+ default: !1
1564
+ }
1565
+ },
1566
+ setup(e) {
1567
+ let t = i(() => e.columns.length + +!!e.rowNumbers), r = i(() => e.emptyText || "Ничего не найдено."), a = (t, n) => {
1568
+ if (typeof e.rowKey == "function") return e.rowKey(t, n);
1569
+ let r = t[e.rowKey || "id"];
1570
+ return [
1571
+ "string",
1572
+ "number",
1573
+ "symbol"
1574
+ ].includes(typeof r) ? r : n;
1575
+ }, l = (e) => e == null || e === "" ? "—" : String(e), f = i(() => [
1576
+ "grid text-left text-sm",
1577
+ e.fixedLayout ? "w-full" : "w-max",
1578
+ e.nowrap && "whitespace-nowrap"
1579
+ ]), p = i(() => ({ gridTemplateColumns: e.fixedLayout ? `repeat(${t.value}, minmax(0, 1fr))` : `${e.rowNumbers ? "max-content " : ""}repeat(${e.columns.length}, max-content)` })), m = (t) => [
1580
+ ai.headBase,
1581
+ t.widthClass,
1582
+ t.headerClass,
1583
+ (e.nowrap || t.nowrap) && "whitespace-nowrap"
1584
+ ], h = (t) => [
1585
+ ai.cellBase,
1586
+ t.widthClass,
1587
+ t.cellClass,
1588
+ (e.nowrap || t.nowrap) && "whitespace-nowrap"
1589
+ ], g = D(""), _ = D("asc"), v = (e) => !!e.sortable && g.value === e.key, x = (e) => v(e) ? _.value === "asc" ? "ascending" : "descending" : "none", S = (e) => {
1590
+ e.sortable && (g.value === e.key ? _.value === "asc" ? _.value = "desc" : (g.value = "", _.value = "asc") : (g.value = e.key, _.value = "asc"));
1591
+ }, w = (e) => e == null || e === "", T = (e, t) => {
1592
+ if (typeof e == "number" && typeof t == "number") return e - t;
1593
+ if (typeof e == "boolean" && typeof t == "boolean") return Number(e) - Number(t);
1594
+ let n = String(e), r = String(t), i = /^\d{4}-\d{2}-\d{2}/;
1595
+ return i.test(n) && i.test(r) ? Date.parse(n) - Date.parse(r) : n.localeCompare(r, "ru", {
1596
+ numeric: !0,
1597
+ sensitivity: "base"
1598
+ });
1599
+ }, E = i(() => {
1600
+ let t = g.value;
1601
+ if (!t) return e.rows;
1602
+ let n = _.value === "asc" ? 1 : -1;
1603
+ return [...e.rows].sort((e, r) => {
1604
+ let i = e[t], a = r[t], o = w(i), s = w(a);
1605
+ return o || s ? o === s ? 0 : o ? 1 : -1 : n * T(i, a);
1606
+ });
1607
+ });
1608
+ return (t, i) => (C(), s("div", { class: y(ai.wrapper) }, [e.loading ? (C(), s("div", {
1609
+ key: 0,
1610
+ class: y(ai.loading)
1611
+ }, [d(ei)], 2)) : o("", !0), c("div", {
1612
+ class: y(P(f)),
1613
+ style: b(P(p))
1614
+ }, [
1615
+ c("div", ti, [e.rowNumbers ? (C(), s("div", {
1616
+ key: 0,
1617
+ class: y(ai.leadHead)
1618
+ }, null, 2)) : o("", !0), (C(!0), s(n, null, O(e.columns, (e) => (C(), s("div", {
1619
+ key: e.key,
1620
+ role: "columnheader",
1621
+ "aria-sort": e.sortable ? x(e) : void 0,
1622
+ class: y(m(e))
1623
+ }, [e.sortable ? (C(), s("button", {
1624
+ key: 0,
1625
+ type: "button",
1626
+ class: "flex w-full items-center gap-1 text-left",
1627
+ onClick: (t) => S(e)
1628
+ }, [k(t.$slots, `header-${e.key}`, {
1629
+ column: e,
1630
+ sortable: !0,
1631
+ sorted: v(e)
1632
+ }, () => [u(M(e.label), 1)]), d(Y, {
1633
+ name: "chevron",
1634
+ class: y(["size-3 transition", v(e) ? P(_) === "asc" ? "-rotate-90 opacity-100" : "rotate-90 opacity-100" : "rotate-90 opacity-0"])
1635
+ }, null, 8, ["class"])], 8, ri)) : k(t.$slots, `header-${e.key}`, {
1636
+ column: e,
1637
+ sortable: !1,
1638
+ sorted: !1
1639
+ }, () => [u(M(e.label), 1)], void 0, 1)], 10, ni))), 128))]),
1640
+ e.rows.length ? o("", !0) : (C(), s("div", {
1641
+ key: 0,
1642
+ class: y(ai.emptyRow)
1643
+ }, [k(t.$slots, "empty", {}, () => [u(M(P(r)), 1)])], 2)),
1644
+ (C(!0), s(n, null, O(P(E), (r, i) => (C(), s(n, { key: a(r, i) }, [e.divider?.(r, i) ? (C(), s("div", {
1645
+ key: 0,
1646
+ class: y(ai.dividerRow)
1647
+ }, [c("div", {
1648
+ class: y(ai.dividerContent),
1649
+ role: "separator"
1650
+ }, [c("span", { class: y(ai.dividerText) }, M(e.divider(r, i)), 3), c("span", { class: y(ai.dividerLine) }, null, 2)], 2)], 2)) : o("", !0), c("div", ii, [e.rowNumbers ? (C(), s("div", {
1651
+ key: 0,
1652
+ class: y(ai.leadCell)
1653
+ }, M(i + 1), 3)) : o("", !0), (C(!0), s(n, null, O(e.columns, (e) => (C(), s("div", {
1654
+ key: `${String(a(r, i))}:${e.key}`,
1655
+ class: y(h(e))
1656
+ }, [k(t.$slots, `cell-${e.key}`, {
1657
+ row: r,
1658
+ column: e,
1659
+ value: r[e.key],
1660
+ index: i
1661
+ }, () => [k(t.$slots, "cell", {
1662
+ row: r,
1663
+ column: e,
1664
+ value: r[e.key],
1665
+ index: i
1666
+ }, () => [u(M(l(r[e.key])), 1)])])], 2))), 128))])], 64))), 128))
1667
+ ], 6)], 2));
1668
+ }
1669
+ }), si = /* @__PURE__ */ new Map(), ci = (e, t) => {
1670
+ let n = `${e}-${JSON.stringify(t)}`, r = si.get(n);
1671
+ return r || (r = new Intl.DateTimeFormat(e, t), si.set(n, r)), r;
1672
+ }, li = {
1673
+ Short: "short",
1674
+ Full: "full"
1675
+ }, ui = (e, t = {}, n) => {
1676
+ if (!e) return "";
1677
+ let r = new Date(e);
1678
+ if (Number.isNaN(r.getTime())) return "";
1679
+ let i = (e) => ci("en-US", {
1680
+ timeZone: n,
1681
+ year: "numeric"
1682
+ }).format(e), a = t.fullYear || i(r) !== i(/* @__PURE__ */ new Date());
1683
+ return ci("ru-RU", {
1684
+ timeZone: n,
1685
+ month: t.view === li.Full ? "long" : "short",
1686
+ day: "numeric",
1687
+ year: a ? "numeric" : void 0,
1688
+ hour: "2-digit",
1689
+ minute: "2-digit",
1690
+ hour12: !1
1691
+ }).format(r);
1692
+ }, di = /* @__PURE__ */ f({
1693
+ __name: "SDatetime",
1694
+ props: {
1695
+ value: {},
1696
+ timeZone: {},
1697
+ view: { default: () => li.Short },
1698
+ fullYear: {
1699
+ type: Boolean,
1700
+ default: !1
1701
+ }
1702
+ },
1703
+ setup(t) {
1704
+ let n = e(), r = i(() => String(t.timeZone ?? n.timeZone ?? "").trim() || void 0), a = i(() => ui(t.value, {
1705
+ view: t.view,
1706
+ fullYear: t.fullYear
1707
+ }, r.value));
1708
+ return (e, t) => (C(), s("span", null, M(P(a)), 1));
1709
+ }
1710
+ }), fi = ["id", "aria-label"], pi = /* @__PURE__ */ f({
1711
+ __name: "Popover",
1712
+ props: {
1713
+ open: { type: Boolean },
1714
+ trigger: {},
1715
+ panelId: {},
1716
+ ariaLabel: {}
1717
+ },
1718
+ emits: ["close", "confirm"],
1719
+ setup(e, { emit: t }) {
1720
+ let n = t, i = D(null), s = D({}), l = () => {
1721
+ let t = e.trigger?.getBoundingClientRect(), n = i.value;
1722
+ if (!t || !n) return;
1723
+ let r = Math.min(n.offsetWidth, window.innerWidth - 16), a = window.innerHeight - t.bottom - 4 - 8, o = t.top - 4 - 8, c = a >= n.offsetHeight || a >= o, l = Math.min(Math.max(8, t.left), window.innerWidth - r - 8);
1724
+ s.value = {
1725
+ left: `${l}px`,
1726
+ maxWidth: `${window.innerWidth - 16}px`,
1727
+ maxHeight: `${Math.max(160, c ? a : o)}px`,
1728
+ top: c ? `${t.bottom + 4}px` : "",
1729
+ bottom: c ? "" : `${window.innerHeight - t.top + 4}px`
1730
+ };
1731
+ }, u = (t) => {
1732
+ if (!e.open) return;
1733
+ let r = t.target;
1734
+ e.trigger?.contains(r) || i.value?.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-select-list]") || n("close");
1735
+ }, d = (t) => {
1736
+ if (e.open) {
1737
+ if (t.key === "Escape") t.stopPropagation(), n("close"), e.trigger?.focus();
1738
+ else if (t.key === "Enter") {
1739
+ let e = t.target?.tagName;
1740
+ if (e === "INPUT" || e === "SELECT" || e === "TEXTAREA") return;
1741
+ t.preventDefault(), t.stopPropagation(), n("confirm");
1742
+ }
1743
+ }
1744
+ };
1745
+ return z(() => e.open, async (e) => {
1746
+ e && (await v(), l(), i.value?.focus());
1747
+ }), S(() => {
1748
+ document.addEventListener("pointerdown", u), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), e.open && l();
1749
+ }), x(() => {
1750
+ document.removeEventListener("pointerdown", u), window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
1751
+ }), (t, n) => e.open ? (C(), a(r, {
1752
+ key: 0,
1753
+ to: "body"
1754
+ }, [c("div", {
1755
+ id: e.panelId,
1756
+ ref_key: "panelRef",
1757
+ ref: i,
1758
+ class: "fixed z-50 flex flex-col gap-2 overflow-auto bg-(--elevated) p-3 text-(--text-default) ring-1 ring-(--border) outline-none",
1759
+ style: b(P(s)),
1760
+ role: "dialog",
1761
+ "aria-label": e.ariaLabel,
1762
+ tabindex: "-1",
1763
+ onKeydown: d
1764
+ }, [k(t.$slots, "default")], 44, fi)])) : o("", !0);
1765
+ }
1766
+ }), mi = (e, t = 2) => String(e).padStart(t, "0"), hi = (e, t, n) => {
1767
+ let r = new Date(e, t - 1, n);
1768
+ return r.getFullYear() === e && r.getMonth() === t - 1 && r.getDate() === n;
1769
+ }, gi = (e) => {
1770
+ let t = String(e || "").trim();
1771
+ if (!t) return null;
1772
+ let n = t.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/);
1773
+ if (n) {
1774
+ let [, e, t, r, i, a, o] = n;
1775
+ return hi(Number(e), Number(t), Number(r)) ? {
1776
+ year: Number(e),
1777
+ month: Number(t),
1778
+ day: Number(r),
1779
+ hour: Math.min(Number(i || 0), 23),
1780
+ minute: Math.min(Number(a || 0), 59),
1781
+ second: Math.min(Number(o || 0), 59)
1782
+ } : null;
1783
+ }
1784
+ let r = t.match(/^(\d{2}):(\d{2})(?::(\d{2}))?$/);
1785
+ if (!r) return null;
1786
+ let i = /* @__PURE__ */ new Date();
1787
+ return {
1788
+ year: i.getFullYear(),
1789
+ month: i.getMonth() + 1,
1790
+ day: i.getDate(),
1791
+ hour: Math.min(Number(r[1]), 23),
1792
+ minute: Math.min(Number(r[2]), 59),
1793
+ second: Math.min(Number(r[3] || 0), 59)
1794
+ };
1795
+ }, _i = (e, t) => {
1796
+ let n = `${mi(e.year, 4)}-${mi(e.month)}-${mi(e.day)}`, r = `${mi(e.hour)}:${mi(e.minute)}${t.showSeconds ? `:${mi(e.second)}` : ""}`;
1797
+ return t.showDate ? t.showTime ? `${n}T${r}` : n : r;
1798
+ }, vi = (e) => ({
1799
+ year: e.getFullYear(),
1800
+ month: e.getMonth() + 1,
1801
+ day: e.getDate(),
1802
+ hour: e.getHours(),
1803
+ minute: e.getMinutes(),
1804
+ second: e.getSeconds()
1805
+ }), yi = (e) => new Date(e.year, e.month - 1, e.day, e.hour, e.minute, e.second), bi = (e, t) => yi(e).getTime() - yi(t).getTime(), xi = (e, t) => e.year === t.year ? e.month === t.month ? e.day - t.day : e.month - t.month : e.year - t.year, Si = (e, t, n) => t && bi(e, t) < 0 ? { ...t } : n && bi(e, n) > 0 ? { ...n } : e, Ci = (e, t, n) => ci(t, {
1806
+ dateStyle: n.showDate ? "medium" : void 0,
1807
+ timeStyle: n.showTime ? n.showSeconds ? "medium" : "short" : void 0,
1808
+ hour12: !1
1809
+ }).format(yi(e)), wi = /* @__PURE__ */ new Map(), Ti = (e) => {
1810
+ let t = ci(e, {
1811
+ month: "long",
1812
+ timeZone: "UTC"
1813
+ });
1814
+ return Array.from({ length: 12 }, (e, n) => t.format(new Date(Date.UTC(2024, n, 15))));
1815
+ }, Ei = (e, t) => {
1816
+ let n = ci(e, {
1817
+ weekday: t,
1818
+ timeZone: "UTC"
1819
+ });
1820
+ return Array.from({ length: 7 }, (e, t) => n.format(new Date(Date.UTC(2024, 0, 1 + t))));
1821
+ }, Di = (e) => {
1822
+ let t = wi.get(e);
1823
+ if (t) return t;
1824
+ let n = {
1825
+ monthNames: Ti(e),
1826
+ weekdayNamesShort: Ei(e, "short"),
1827
+ weekdayNamesLong: Ei(e, "long")
1828
+ };
1829
+ return wi.set(e, n), n;
1830
+ }, Oi = (e) => {
1831
+ let t = String(e || "").trim();
1832
+ if (!t) return "UTC";
1833
+ try {
1834
+ return new Intl.DateTimeFormat("en-US", { timeZone: t }).format(/* @__PURE__ */ new Date(0)), t;
1835
+ } catch {
1836
+ return "UTC";
1837
+ }
1838
+ }, ki = () => {
1839
+ try {
1840
+ return Oi(Intl.DateTimeFormat().resolvedOptions().timeZone);
1841
+ } catch {
1842
+ return "UTC";
1843
+ }
1844
+ }, Ai = () => {
1845
+ try {
1846
+ let e = Intl.supportedValuesOf("timeZone");
1847
+ if (e.length) return (e.includes("UTC") ? e : ["UTC", ...e]).map((e) => ({
1848
+ value: e,
1849
+ label: e.replace(/_/g, " ")
1850
+ }));
1851
+ } catch {}
1852
+ return (/* @__PURE__ */ "UTC.Europe/Kaliningrad.Europe/Moscow.Europe/Samara.Asia/Yekaterinburg.Asia/Omsk.Asia/Novosibirsk.Asia/Krasnoyarsk.Asia/Irkutsk.Asia/Yakutsk.Asia/Vladivostok.Asia/Magadan.Asia/Kamchatka.Europe/Berlin.Europe/Paris.Europe/London.Asia/Tbilisi.Asia/Yerevan.Asia/Almaty.Asia/Tashkent.Asia/Dubai.Asia/Shanghai.Asia/Tokyo.America/New_York.America/Chicago.America/Denver.America/Los_Angeles".split(".")).map((e) => ({
1853
+ value: e,
1854
+ label: e
1855
+ }));
1856
+ }, ji = { class: "flex flex-col gap-2" }, Mi = { class: "flex items-center gap-1" }, Ni = ["aria-label", "disabled"], Pi = ["aria-label", "disabled"], Fi = ["aria-label"], Ii = {
1857
+ role: "row",
1858
+ class: "flex"
1859
+ }, Li = ["abbr"], Ri = [
1860
+ "data-day",
1861
+ "tabindex",
1862
+ "aria-selected",
1863
+ "aria-current",
1864
+ "aria-disabled",
1865
+ "aria-label",
1866
+ "onClick",
1867
+ "onKeydown"
1868
+ ], zi = /* @__PURE__ */ f({
1869
+ __name: "Calendar",
1870
+ props: {
1871
+ selected: {},
1872
+ min: {},
1873
+ max: {},
1874
+ localeInfo: {},
1875
+ labels: {}
1876
+ },
1877
+ emits: ["select", "commit"],
1878
+ setup(e, { emit: t }) {
1879
+ let r = t, a = /* @__PURE__ */ new Date(), o = e.selected || {
1880
+ year: a.getFullYear(),
1881
+ month: a.getMonth() + 1,
1882
+ day: 1
1883
+ }, l = D(o.year), u = D(o.month), f = D(""), p = D(null), m = i(() => e.min?.year ?? a.getFullYear() - 100), h = i(() => e.max?.year ?? a.getFullYear() + 100), g = i(() => !(l.value <= m.value && u.value === 1)), _ = i(() => !(l.value >= h.value && u.value === 12)), b = i(() => e.localeInfo.monthNames.map((e, t) => ({
1884
+ value: String(t + 1),
1885
+ label: e
1886
+ }))), x = i(() => Array.from({ length: h.value - m.value + 1 }, (e, t) => {
1887
+ let n = m.value + t;
1888
+ return {
1889
+ value: String(n),
1890
+ label: String(n)
1891
+ };
1892
+ })), S = (e, t) => new Date(e, t, 0).getDate(), w = () => {
1893
+ if (!e.selected) return;
1894
+ let t = Math.min(e.selected.day, S(l.value, u.value));
1895
+ r("commit", {
1896
+ year: l.value,
1897
+ month: u.value,
1898
+ day: t
1899
+ });
1900
+ }, T = (e) => {
1901
+ u.value = Number(e) || u.value, w();
1902
+ }, E = (e) => {
1903
+ l.value = Number(e) || l.value, w();
1904
+ }, k = (e) => {
1905
+ let t = u.value + e;
1906
+ if (t < 1) {
1907
+ if (l.value <= m.value) return;
1908
+ --l.value, u.value = 12;
1909
+ } else if (t > 12) {
1910
+ if (l.value >= h.value) return;
1911
+ l.value += 1, u.value = 1;
1912
+ } else u.value = t;
1913
+ };
1914
+ z(() => e.selected && `${e.selected.year}-${e.selected.month}`, () => {
1915
+ e.selected && (l.value = e.selected.year, u.value = e.selected.month);
1916
+ });
1917
+ let A = (e, t, n) => `${e}-${t}-${n}`, j = A(a.getFullYear(), a.getMonth() + 1, a.getDate()), N = i(() => e.selected ? A(e.selected.year, e.selected.month, e.selected.day) : ""), F = [
1918
+ 1,
1919
+ 2,
1920
+ 3,
1921
+ 4,
1922
+ 5,
1923
+ 6,
1924
+ 7
1925
+ ], I = i(() => {
1926
+ let e = new Date(l.value, u.value - 1, 1), t = (e.getDay() === 0 ? 7 : e.getDay()) - 1, n = new Date(l.value, u.value - 1, 1 - t);
1927
+ return Array.from({ length: 6 }, (e, t) => Array.from({ length: 7 }, (e, r) => {
1928
+ let i = new Date(n.getFullYear(), n.getMonth(), n.getDate() + t * 7 + r), a = {
1929
+ year: i.getFullYear(),
1930
+ month: i.getMonth() + 1,
1931
+ day: i.getDate()
1932
+ };
1933
+ return {
1934
+ ...a,
1935
+ inMonth: a.month === u.value && a.year === l.value,
1936
+ key: A(a.year, a.month, a.day)
1937
+ };
1938
+ }));
1939
+ }), L = (t) => {
1940
+ let n = {
1941
+ ...t,
1942
+ hour: 0,
1943
+ minute: 0,
1944
+ second: 0
1945
+ };
1946
+ return e.min && xi(n, e.min) < 0 ? !0 : !!(e.max && xi(n, e.max) > 0);
1947
+ }, R = i(() => {
1948
+ let e = I.value.flat();
1949
+ return e.some((e) => e.key === f.value) ? f.value : e.some((e) => e.key === N.value) ? N.value : e.some((e) => e.key === j && e.inMonth) ? j : e.find((e) => e.inMonth)?.key || "";
1950
+ }), ee = (e) => {
1951
+ L(e) || (f.value = e.key, r("select", {
1952
+ year: e.year,
1953
+ month: e.month,
1954
+ day: e.day
1955
+ }));
1956
+ }, B = async (e) => {
1957
+ let t = e.getFullYear(), n = e.getMonth() + 1;
1958
+ f.value = A(t, n, e.getDate()), (t !== l.value || n !== u.value) && (l.value = t, u.value = n), await v(), p.value?.querySelector(`[data-day="${f.value}"]`)?.focus();
1959
+ }, te = (e, t) => {
1960
+ let n = new Date(e.year, e.month - 1, e.day), r = (t) => B(new Date(e.year, e.month - 1, e.day + t));
1961
+ if (t.key === "ArrowLeft") r(-1);
1962
+ else if (t.key === "ArrowRight") r(1);
1963
+ else if (t.key === "ArrowUp") r(-7);
1964
+ else if (t.key === "ArrowDown") r(7);
1965
+ else if (t.key === "PageUp") B(new Date(e.year - +!!t.shiftKey, e.month - 1 - !t.shiftKey, e.day));
1966
+ else if (t.key === "PageDown") B(new Date(e.year + +!!t.shiftKey, e.month - 1 + +!t.shiftKey, e.day));
1967
+ else if (t.key === "Home") r(-(((n.getDay() === 0 ? 7 : n.getDay()) - 1 + 7) % 7));
1968
+ else if (t.key === "End") r(6 - ((n.getDay() === 0 ? 7 : n.getDay()) - 1 + 7) % 7);
1969
+ else if (t.key === "Enter" || t.key === " ") ee(e);
1970
+ else return;
1971
+ t.preventDefault();
1972
+ };
1973
+ return (t, r) => (C(), s("div", ji, [c("div", Mi, [
1974
+ c("button", {
1975
+ type: "button",
1976
+ class: "ui-focus inline-flex items-center justify-center rounded-full p-1 text-(--text-default) transition hover:bg-(--accent)/10 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent",
1977
+ "aria-label": e.labels.prevMonth,
1978
+ disabled: !P(g),
1979
+ onClick: r[0] ||= (e) => k(-1)
1980
+ }, [d(Y, {
1981
+ name: "chevron",
1982
+ class: "size-5 rotate-180"
1983
+ })], 8, Ni),
1984
+ d(Kr, {
1985
+ class: "min-w-32 flex-1",
1986
+ "model-value": String(P(u)),
1987
+ options: P(b),
1988
+ "aria-label": e.labels.month,
1989
+ "onUpdate:modelValue": r[1] ||= (e) => T(String(e ?? ""))
1990
+ }, null, 8, [
1991
+ "model-value",
1992
+ "options",
1993
+ "aria-label"
1994
+ ]),
1995
+ d(Kr, {
1996
+ class: "min-w-20",
1997
+ "model-value": String(P(l)),
1998
+ options: P(x),
1999
+ "aria-label": e.labels.year,
2000
+ "onUpdate:modelValue": r[2] ||= (e) => E(String(e ?? ""))
2001
+ }, null, 8, [
2002
+ "model-value",
2003
+ "options",
2004
+ "aria-label"
2005
+ ]),
2006
+ c("button", {
2007
+ type: "button",
2008
+ class: "ui-focus inline-flex items-center justify-center rounded-full p-1 text-(--text-default) transition hover:bg-(--accent)/10 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent",
2009
+ "aria-label": e.labels.nextMonth,
2010
+ disabled: !P(_),
2011
+ onClick: r[3] ||= (e) => k(1)
2012
+ }, [d(Y, {
2013
+ name: "chevron",
2014
+ class: "size-5"
2015
+ })], 8, Pi)
2016
+ ]), c("div", {
2017
+ ref_key: "gridRef",
2018
+ ref: p,
2019
+ role: "grid",
2020
+ "aria-label": e.labels.grid,
2021
+ class: "flex flex-col gap-0.5 select-none"
2022
+ }, [c("div", Ii, [(C(), s(n, null, O(F, (t) => c("span", {
2023
+ key: t,
2024
+ role: "columnheader",
2025
+ class: "w-9 py-1 text-center text-xs opacity-60",
2026
+ abbr: e.localeInfo.weekdayNamesLong[t - 1]
2027
+ }, M(e.localeInfo.weekdayNamesShort[t - 1]), 9, Li)), 64))]), (C(!0), s(n, null, O(P(I), (t, r) => (C(), s("div", {
2028
+ key: r,
2029
+ role: "row",
2030
+ class: "flex"
2031
+ }, [(C(!0), s(n, null, O(t, (t) => (C(), s("button", {
2032
+ key: t.key,
2033
+ type: "button",
2034
+ role: "gridcell",
2035
+ "data-day": t.key,
2036
+ class: y(["ui-focus flex size-9 items-center justify-center text-sm", [
2037
+ t.key === P(N) ? "bg-(--accent) text-(--bg-default)" : t.key === P(j) ? "ring-1 ring-(--accent) ring-inset" : "hover:bg-(--accent)/10",
2038
+ !t.inMonth && "opacity-40",
2039
+ L(t) && "cursor-not-allowed opacity-25 hover:bg-transparent"
2040
+ ]]),
2041
+ tabindex: t.key === P(R) ? 0 : -1,
2042
+ "aria-selected": t.key === P(N) ? "true" : "false",
2043
+ "aria-current": t.key === P(j) ? "date" : void 0,
2044
+ "aria-disabled": L(t) || void 0,
2045
+ "aria-label": `${t.day} ${e.localeInfo.monthNames[t.month - 1]} ${t.year}`,
2046
+ onClick: (e) => ee(t),
2047
+ onKeydown: (e) => te(t, e)
2048
+ }, M(t.day), 43, Ri))), 128))]))), 128))], 8, Fi)]));
2049
+ }
2050
+ }), Bi = [
2051
+ "aria-label",
2052
+ "aria-valuemin",
2053
+ "aria-valuemax",
2054
+ "aria-valuenow",
2055
+ "aria-valuetext"
2056
+ ], Vi = ["onClick"], Hi = /* @__PURE__ */ f({
2057
+ __name: "TimeWheel",
2058
+ props: {
2059
+ modelValue: {},
2060
+ values: {},
2061
+ labels: {},
2062
+ ariaLabel: { default: "" },
2063
+ disabledValues: { default: () => [] },
2064
+ loop: {
2065
+ type: Boolean,
2066
+ default: !0
2067
+ }
2068
+ },
2069
+ emits: ["update:modelValue"],
2070
+ setup(e, { emit: t }) {
2071
+ let r = t, a = i(() => e.values.length), o = i(() => new Set(e.disabledValues)), l = i(() => Math.max(0, e.values.indexOf(e.modelValue))), u = D(l.value), d = D(!1), f = (e) => (e % a.value + a.value) % a.value, p = (t) => o.value.has(e.values[f(t)] ?? -1), m = (t, n) => {
2072
+ if (!a.value) return 0;
2073
+ for (let r = 0; r < a.value; r += 1) {
2074
+ let i = n ? [t + r * n] : [t + r, t - r];
2075
+ for (let t of i) if (!(!e.loop && (t < 0 || t >= a.value)) && !p(t)) return t;
2076
+ }
2077
+ return t;
2078
+ }, h = (t, n = 0) => {
2079
+ let i = e.loop ? t : Math.min(Math.max(t, 0), a.value - 1);
2080
+ u.value = m(i, n);
2081
+ let o = e.values[f(u.value)];
2082
+ o !== void 0 && o !== e.modelValue && r("update:modelValue", o);
2083
+ }, g = (e) => h(Math.round(u.value) + e, Math.sign(e)), _ = i(() => String(Math.max(...e.values, 0)).length), v = "", S = null, w = () => {
2084
+ S && clearTimeout(S), S = setTimeout(() => v = "", 900);
2085
+ }, T = (t) => {
2086
+ let n = Math.max(...e.values), r = Number(v + t);
2087
+ !Number.isFinite(r) || r > n ? (r = Number(t), v = t) : v += t;
2088
+ let i = e.values.indexOf(r);
2089
+ i !== -1 && h(i), v.length >= _.value && (v = ""), w();
2090
+ };
2091
+ x(() => {
2092
+ S && clearTimeout(S);
2093
+ }), z(l, (e) => {
2094
+ !d.value && f(Math.round(u.value)) !== e && (u.value = e);
2095
+ }), z(a, () => {
2096
+ u.value = l.value;
2097
+ });
2098
+ let E = i(() => {
2099
+ let t = Math.round(u.value);
2100
+ return Array.from({ length: 7 }, (n, r) => {
2101
+ let i = t - 2 - 1 + r, o = !e.loop && (i < 0 || i >= a.value), s = f(i);
2102
+ return {
2103
+ index: i,
2104
+ label: o ? "" : e.labels[s] || "",
2105
+ disabled: p(i),
2106
+ offset: (i - u.value) * 32
2107
+ };
2108
+ });
2109
+ }), k = 0, A = 0, j = 0, N = (e) => {
2110
+ e.preventDefault();
2111
+ let t = performance.now();
2112
+ if (t - j < 80) return;
2113
+ j = t;
2114
+ let n = Math.sign(e.deltaY);
2115
+ n !== 0 && g(n);
2116
+ }, F = (e) => {
2117
+ (e.button === 0 || e.pointerType !== "mouse") && (d.value = !0, k = e.clientY, A = u.value, e.currentTarget.setPointerCapture(e.pointerId));
2118
+ }, I = (t) => {
2119
+ if (!d.value) return;
2120
+ let n = A + (k - t.clientY) / 32;
2121
+ u.value = e.loop ? n : Math.min(Math.max(n, -.4), a.value - .6);
2122
+ }, L = () => {
2123
+ d.value && (d.value = !1, h(Math.round(u.value)));
2124
+ }, R = (e) => {
2125
+ if (e.key === "ArrowUp") g(-1);
2126
+ else if (e.key === "ArrowDown") g(1);
2127
+ else if (e.key === "PageUp") g(-5);
2128
+ else if (e.key === "PageDown") g(5);
2129
+ else if (e.key === "Home") h(0, 1);
2130
+ else if (e.key === "End") h(a.value - 1, -1);
2131
+ else if (/^[0-9]$/.test(e.key)) T(e.key);
2132
+ else if (e.key === "Backspace") v = "";
2133
+ else return;
2134
+ e.preventDefault();
2135
+ }, ee = i(() => Math.min(...e.values)), B = i(() => Math.max(...e.values)), te = i(() => e.labels[l.value] || "");
2136
+ return (t, r) => (C(), s("div", {
2137
+ class: "ui-focus relative touch-none overflow-hidden text-(--text-default) select-none",
2138
+ style: b({
2139
+ height: "160px",
2140
+ width: "3.5rem"
2141
+ }),
2142
+ role: "spinbutton",
2143
+ tabindex: "0",
2144
+ "aria-label": e.ariaLabel,
2145
+ "aria-valuemin": P(ee),
2146
+ "aria-valuemax": P(B),
2147
+ "aria-valuenow": e.modelValue,
2148
+ "aria-valuetext": P(te),
2149
+ onPointerdown: F,
2150
+ onPointermove: I,
2151
+ onPointerup: L,
2152
+ onPointercancel: L,
2153
+ onWheel: N,
2154
+ onKeydown: R
2155
+ }, [c("div", {
2156
+ class: "pointer-events-none absolute inset-x-0 border-y border-(--accent)/40 bg-(--accent)/10",
2157
+ style: b({
2158
+ top: `${32 * P(2)}px`,
2159
+ height: "32px"
2160
+ })
2161
+ }, null, 4), (C(!0), s(n, null, O(P(E), (e) => (C(), s("div", {
2162
+ key: e.index,
2163
+ class: y(["absolute inset-x-0 flex cursor-pointer items-center justify-center text-sm tabular-nums", [!P(d) && "transition-transform duration-100", e.disabled ? "cursor-not-allowed opacity-25" : Math.abs(e.offset) < 2 ? "" : "opacity-55"]]),
2164
+ style: b({
2165
+ height: "32px",
2166
+ transform: `translateY(${e.offset + 32 * P(2)}px)`
2167
+ }),
2168
+ "aria-hidden": "true",
2169
+ onClick: (t) => h(e.index)
2170
+ }, M(e.label), 15, Vi))), 128))], 44, Bi));
2171
+ }
2172
+ }), Ui = { class: "flex items-start justify-center gap-1 text-(--text-default)" }, Wi = {
2173
+ key: 0,
2174
+ class: "flex h-40 items-center text-sm opacity-60",
2175
+ "aria-hidden": "true"
2176
+ }, Gi = /* @__PURE__ */ f({
2177
+ __name: "Time",
2178
+ props: {
2179
+ hour: {},
2180
+ minute: {},
2181
+ second: {},
2182
+ showSeconds: {
2183
+ type: Boolean,
2184
+ default: !1
2185
+ },
2186
+ disabledHours: { default: () => [] },
2187
+ disabledMinutes: { default: () => [] },
2188
+ disabledSeconds: { default: () => [] },
2189
+ labels: {}
2190
+ },
2191
+ emits: ["change"],
2192
+ setup(e, { emit: t }) {
2193
+ let n = t, r = Array.from({ length: 60 }, (e, t) => t), i = r.map((e) => String(e).padStart(2, "0")), l = Array.from({ length: 24 }, (e, t) => t), u = i.slice(0, 24);
2194
+ return (t, f) => (C(), s("div", Ui, [
2195
+ d(Hi, {
2196
+ "model-value": e.hour,
2197
+ values: P(l),
2198
+ labels: P(u),
2199
+ "aria-label": e.labels.hours,
2200
+ "disabled-values": e.disabledHours,
2201
+ "onUpdate:modelValue": f[0] ||= (e) => n("change", { hour: e })
2202
+ }, null, 8, [
2203
+ "model-value",
2204
+ "values",
2205
+ "labels",
2206
+ "aria-label",
2207
+ "disabled-values"
2208
+ ]),
2209
+ f[3] ||= c("span", {
2210
+ class: "flex h-40 items-center text-sm opacity-60",
2211
+ "aria-hidden": "true"
2212
+ }, ":", -1),
2213
+ d(Hi, {
2214
+ "model-value": e.minute,
2215
+ values: P(r),
2216
+ labels: P(i),
2217
+ "aria-label": e.labels.minutes,
2218
+ "disabled-values": e.disabledMinutes,
2219
+ "onUpdate:modelValue": f[1] ||= (e) => n("change", { minute: e })
2220
+ }, null, 8, [
2221
+ "model-value",
2222
+ "values",
2223
+ "labels",
2224
+ "aria-label",
2225
+ "disabled-values"
2226
+ ]),
2227
+ e.showSeconds ? (C(), s("span", Wi, ":")) : o("", !0),
2228
+ e.showSeconds ? (C(), a(Hi, {
2229
+ key: 1,
2230
+ "model-value": e.second,
2231
+ values: P(r),
2232
+ labels: P(i),
2233
+ "aria-label": e.labels.seconds,
2234
+ "disabled-values": e.disabledSeconds,
2235
+ "onUpdate:modelValue": f[2] ||= (e) => n("change", { second: e })
2236
+ }, null, 8, [
2237
+ "model-value",
2238
+ "values",
2239
+ "labels",
2240
+ "aria-label",
2241
+ "disabled-values"
2242
+ ])) : o("", !0)
2243
+ ]));
2244
+ }
2245
+ }), Ki = { class: "flex flex-wrap items-center gap-2" }, qi = {
2246
+ key: 0,
2247
+ class: "flex flex-wrap gap-1"
2248
+ }, Ji = {
2249
+ key: 1,
2250
+ class: "h-4 w-px bg-(--border)",
2251
+ "aria-hidden": "true"
2252
+ }, Yi = {
2253
+ key: 2,
2254
+ class: "flex flex-wrap gap-1"
2255
+ }, Xi = /* @__PURE__ */ f({
2256
+ __name: "QuickActions",
2257
+ props: {
2258
+ showDate: { type: Boolean },
2259
+ showTime: { type: Boolean },
2260
+ labels: {}
2261
+ },
2262
+ emits: ["action"],
2263
+ setup(e, { emit: t }) {
2264
+ let r = t, c = i(() => e.showDate ? [
2265
+ "yesterday",
2266
+ "today",
2267
+ "tomorrow"
2268
+ ] : []), l = i(() => e.showTime ? [
2269
+ "startOfDay",
2270
+ "now",
2271
+ "endOfDay"
2272
+ ] : []);
2273
+ return (t, i) => (C(), s("div", Ki, [
2274
+ P(c).length ? (C(), s("div", qi, [(C(!0), s(n, null, O(P(c), (t) => (C(), a(Sr, {
2275
+ key: t,
2276
+ label: e.labels[t],
2277
+ onClick: (e) => r("action", t)
2278
+ }, null, 8, ["label", "onClick"]))), 128))])) : o("", !0),
2279
+ P(c).length && P(l).length ? (C(), s("span", Ji)) : o("", !0),
2280
+ P(l).length ? (C(), s("div", Yi, [(C(!0), s(n, null, O(P(l), (t) => (C(), a(Sr, {
2281
+ key: t,
2282
+ label: e.labels[t],
2283
+ onClick: (e) => r("action", t)
2284
+ }, null, 8, ["label", "onClick"]))), 128))])) : o("", !0)
2285
+ ]));
2286
+ }
2287
+ }), Zi = { class: "inline-block" }, Qi = [
2288
+ "id",
2289
+ "tabindex",
2290
+ "aria-label",
2291
+ "aria-expanded",
2292
+ "aria-controls",
2293
+ "aria-invalid",
2294
+ "aria-disabled"
2295
+ ], $i = ["aria-hidden", "disabled"], ea = ["name", "value"], ta = { class: "flex flex-wrap items-start gap-4" }, na = /* @__PURE__ */ f({
2296
+ __name: "index",
2297
+ props: /*@__PURE__*/ g({
2298
+ disabled: {
2299
+ type: Boolean,
2300
+ default: !1
2301
+ },
2302
+ readonly: {
2303
+ type: Boolean,
2304
+ default: !1
2305
+ },
2306
+ invalid: {
2307
+ type: Boolean,
2308
+ default: !1
2309
+ },
2310
+ locale: { default: "ru-RU" },
2311
+ min: {},
2312
+ max: {},
2313
+ showDate: {
2314
+ type: Boolean,
2315
+ default: !0
2316
+ },
2317
+ showTime: {
2318
+ type: Boolean,
2319
+ default: !0
2320
+ },
2321
+ showSeconds: {
2322
+ type: Boolean,
2323
+ default: !1
2324
+ },
2325
+ closeOnSelect: { type: Boolean },
2326
+ showTimezone: {
2327
+ type: Boolean,
2328
+ default: !1
2329
+ },
2330
+ id: {},
2331
+ name: {},
2332
+ ariaLabel: {}
2333
+ }, {
2334
+ modelValue: { default: "" },
2335
+ modelModifiers: {},
2336
+ timezone: {},
2337
+ timezoneModifiers: {}
2338
+ }),
2339
+ emits: ["update:modelValue", "update:timezone"],
2340
+ setup(e, { expose: t }) {
2341
+ let n = I(e, "modelValue"), r = I(e, "timezone"), l = D(null);
2342
+ t({ focus: () => l.value?.focus() });
2343
+ let u = m("field-id", void 0), f = m("field-context", null), p = m("fieldset-disabled", D(!1)), g = F(), _ = i(() => e.id || f?.id.value || u || `datetime-${g}`), v = i(() => `${_.value}-panel`), b = i(() => !!(e.disabled || f?.disabled?.value || p.value)), x = i(() => e.locale || "ru-RU"), w = i(() => Di(x.value)), T = i(() => ({
2344
+ showDate: e.showDate,
2345
+ showTime: e.showTime,
2346
+ showSeconds: e.showTime && e.showSeconds
2347
+ })), E = i(() => gi(n.value)), O = i(() => !!E.value && !b.value && !e.readonly), k = i(() => gi(e.min)), A = i(() => gi(e.max)), j = i(() => E.value ? Ci(E.value, x.value, T.value) : ""), N = i(() => e.showDate ? e.showTime ? "Выберите дату и время" : "Выберите дату" : "Выберите время"), L = D(!1), R = i(() => e.closeOnSelect ?? !e.showTime), ee = () => {
2348
+ b.value || e.readonly || (L.value = !L.value);
2349
+ }, z = () => L.value = !1, te = () => {
2350
+ b.value || e.readonly || (n.value = "", l.value?.focus());
2351
+ }, V = (e) => {
2352
+ e.key === "Enter" || e.key === " " ? (e.preventDefault(), ee()) : e.key === "Escape" && L.value && (e.preventDefault(), e.stopPropagation(), z(), l.value?.focus());
2353
+ }, re = () => {
2354
+ let e = l.value?.closest("fieldset");
2355
+ if (!l.value || !e) return !1;
2356
+ let t = Array.from(e.querySelectorAll("[data-datetime-trigger]")), n = t[t.indexOf(l.value) + 1];
2357
+ return n ? (n.focus(), !0) : !1;
2358
+ }, ie = () => {
2359
+ let t = /* @__PURE__ */ new Date();
2360
+ return e.showTime ? vi(t) : {
2361
+ ...vi(t),
2362
+ hour: 0,
2363
+ minute: 0,
2364
+ second: 0
2365
+ };
2366
+ }, ae = (t) => {
2367
+ let r = Si(e.showSeconds ? t : {
2368
+ ...t,
2369
+ second: 0
2370
+ }, k.value, A.value);
2371
+ n.value = _i(r, T.value);
2372
+ }, H = (e) => {
2373
+ ae({
2374
+ ...E.value || ie(),
2375
+ ...e
2376
+ }), R.value && (z(), re() || l.value?.focus());
2377
+ }, U = (e) => ae({
2378
+ ...E.value || ie(),
2379
+ ...e
2380
+ }), W = () => {
2381
+ z(), re() || l.value?.focus();
2382
+ }, oe = (e) => ae({
2383
+ ...E.value || ie(),
2384
+ ...e
2385
+ }), G = (e, t) => !!(e && t && xi(e, t) === 0), se = i(() => {
2386
+ let e = [], t = E.value;
2387
+ if (G(t, k.value)) for (let t = 0; t < (k.value?.hour || 0); t += 1) e.push(t);
2388
+ if (G(t, A.value)) for (let t = (A.value?.hour ?? 23) + 1; t < 24; t += 1) e.push(t);
2389
+ return e;
2390
+ }), K = i(() => {
2391
+ let e = [], t = E.value;
2392
+ if (G(t, k.value) && t?.hour === k.value?.hour) for (let t = 0; t < (k.value?.minute || 0); t += 1) e.push(t);
2393
+ if (G(t, A.value) && t?.hour === A.value?.hour) for (let t = (A.value?.minute ?? 59) + 1; t < 60; t += 1) e.push(t);
2394
+ return e;
2395
+ }), ce = D("");
2396
+ S(() => {
2397
+ ce.value = ki();
2398
+ });
2399
+ let le = i({
2400
+ get: () => r.value || ce.value,
2401
+ set: (e) => {
2402
+ r.value = e;
2403
+ }
2404
+ }), q = i(() => e.showTimezone ? Ai() : []), ue = i(() => ({
2405
+ today: "Сегодня",
2406
+ now: "Сейчас",
2407
+ tomorrow: "Завтра",
2408
+ yesterday: "Вчера",
2409
+ startOfDay: "Начало дня",
2410
+ endOfDay: "Конец дня"
2411
+ })), de = i(() => ({
2412
+ grid: "Календарь",
2413
+ prevMonth: "Предыдущий месяц",
2414
+ nextMonth: "Следующий месяц",
2415
+ month: "Месяц",
2416
+ year: "Год"
2417
+ })), fe = i(() => ({
2418
+ hours: "Часы",
2419
+ minutes: "Минуты",
2420
+ seconds: "Секунды"
2421
+ })), pe = (t) => {
2422
+ let n = /* @__PURE__ */ new Date(), r = E.value || ie();
2423
+ if (t === "now") return ae(vi(n));
2424
+ if (t === "startOfDay") return ae({
2425
+ ...r,
2426
+ hour: 0,
2427
+ minute: 0,
2428
+ second: 0
2429
+ });
2430
+ if (t === "endOfDay") return ae({
2431
+ ...r,
2432
+ hour: 23,
2433
+ minute: 59,
2434
+ second: e.showSeconds ? 59 : 0
2435
+ });
2436
+ let i = t === "tomorrow" ? 1 : t === "yesterday" ? -1 : 0, a = new Date(n.getFullYear(), n.getMonth(), n.getDate() + i);
2437
+ ae({
2438
+ ...r,
2439
+ year: a.getFullYear(),
2440
+ month: a.getMonth() + 1,
2441
+ day: a.getDate()
2442
+ });
2443
+ }, me = i(() => [
2444
+ "relative flex h-9 w-full min-w-44 items-center justify-between gap-2 px-3 text-sm text-(--text-default) bg-(--default) hover:bg-(--default-hover) outline-none select-none focus:ring-2 focus:ring-(--accent) focus-within:ring-2 focus-within:ring-(--accent)",
2445
+ e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger) focus-within:ring-(--danger)" : "ring-1 ring-(--border)",
2446
+ b.value && "cursor-not-allowed opacity-50"
2447
+ ]);
2448
+ return (t, r) => (C(), s("div", Zi, [
2449
+ c("div", {
2450
+ id: P(_),
2451
+ ref_key: "triggerRef",
2452
+ ref: l,
2453
+ role: "combobox",
2454
+ tabindex: P(b) ? -1 : 0,
2455
+ class: y(P(me)),
2456
+ "data-datetime-trigger": "",
2457
+ "aria-label": e.ariaLabel || P(N),
2458
+ "aria-haspopup": "dialog",
2459
+ "aria-expanded": P(L) ? "true" : "false",
2460
+ "aria-controls": P(L) ? P(v) : void 0,
2461
+ "aria-invalid": e.invalid || void 0,
2462
+ "aria-disabled": P(b) || void 0,
2463
+ onClick: ee,
2464
+ onKeydown: V
2465
+ }, [
2466
+ d(Y, {
2467
+ name: e.showDate ? "calendar" : "clock",
2468
+ class: "size-4 shrink-0 opacity-60"
2469
+ }, null, 8, ["name"]),
2470
+ c("span", { class: y(["flex-1 truncate", !P(j) && "opacity-60"]) }, M(P(j) || P(N)), 3),
2471
+ c("button", {
2472
+ type: "button",
2473
+ tabindex: "-1",
2474
+ "aria-label": "Очистить",
2475
+ "aria-hidden": !P(O) || void 0,
2476
+ disabled: !P(O),
2477
+ class: "flex size-4 shrink-0 cursor-pointer items-center justify-center opacity-60 outline-none hover:opacity-100 disabled:pointer-events-none disabled:opacity-0",
2478
+ onClick: ne(te, ["stop"])
2479
+ }, [d(Y, { name: "close" })], 8, $i)
2480
+ ], 42, Qi),
2481
+ e.name ? (C(), s("input", {
2482
+ key: 0,
2483
+ type: "hidden",
2484
+ name: e.name,
2485
+ value: n.value || ""
2486
+ }, null, 8, ea)) : o("", !0),
2487
+ d(pi, {
2488
+ open: P(L),
2489
+ trigger: P(l),
2490
+ "panel-id": P(v),
2491
+ "aria-label": e.ariaLabel || P(N),
2492
+ onClose: z,
2493
+ onConfirm: W
2494
+ }, {
2495
+ default: B(() => [
2496
+ c("div", ta, [e.showDate ? (C(), a(zi, {
2497
+ key: 0,
2498
+ selected: P(E),
2499
+ min: P(k),
2500
+ max: P(A),
2501
+ "locale-info": P(w),
2502
+ labels: P(de),
2503
+ onSelect: H,
2504
+ onCommit: U
2505
+ }, null, 8, [
2506
+ "selected",
2507
+ "min",
2508
+ "max",
2509
+ "locale-info",
2510
+ "labels"
2511
+ ])) : o("", !0), e.showTime ? (C(), a(Gi, {
2512
+ key: 1,
2513
+ hour: P(E)?.hour ?? 0,
2514
+ minute: P(E)?.minute ?? 0,
2515
+ second: P(E)?.second ?? 0,
2516
+ "show-seconds": e.showSeconds,
2517
+ "disabled-hours": P(se),
2518
+ "disabled-minutes": P(K),
2519
+ labels: P(fe),
2520
+ onChange: oe
2521
+ }, null, 8, [
2522
+ "hour",
2523
+ "minute",
2524
+ "second",
2525
+ "show-seconds",
2526
+ "disabled-hours",
2527
+ "disabled-minutes",
2528
+ "labels"
2529
+ ])) : o("", !0)]),
2530
+ e.showTimezone ? (C(), a(Kr, {
2531
+ key: 0,
2532
+ modelValue: P(le),
2533
+ "onUpdate:modelValue": r[0] ||= (e) => h(le) ? le.value = e : null,
2534
+ class: "w-full",
2535
+ filter: "",
2536
+ options: P(q),
2537
+ "aria-label": "Часовой пояс"
2538
+ }, null, 8, ["modelValue", "options"])) : o("", !0),
2539
+ d(Xi, {
2540
+ "show-date": e.showDate,
2541
+ "show-time": e.showTime,
2542
+ labels: P(ue),
2543
+ onAction: pe
2544
+ }, null, 8, [
2545
+ "show-date",
2546
+ "show-time",
2547
+ "labels"
2548
+ ])
2549
+ ]),
2550
+ _: 1
2551
+ }, 8, [
2552
+ "open",
2553
+ "trigger",
2554
+ "panel-id",
2555
+ "aria-label"
2556
+ ])
2557
+ ]));
2558
+ }
2559
+ }), ra = ["innerHTML"], ia = /*#__PURE__*/ q(/* @__PURE__ */ f({
2560
+ __name: "SDocMarkdown",
2561
+ props: { html: {} },
2562
+ setup(e) {
2563
+ let t = D(null), n = {
2564
+ javascript: "js",
2565
+ js: "js",
2566
+ typescript: "ts",
2567
+ ts: "ts",
2568
+ vue: "vue",
2569
+ html: "html",
2570
+ xml: "xml",
2571
+ css: "css",
2572
+ scss: "css",
2573
+ sass: "css",
2574
+ json: "json",
2575
+ go: "go",
2576
+ golang: "go",
2577
+ bash: "bash",
2578
+ sh: "bash",
2579
+ shell: "bash",
2580
+ zsh: "bash",
2581
+ sql: "sql",
2582
+ yaml: "yaml",
2583
+ yml: "yaml",
2584
+ md: "md",
2585
+ markdown: "md"
2586
+ }, r = null, i = () => r ??= import("@speed-highlight/core"), a = (e) => e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"), o = async (e) => {
2587
+ let { highlightHTML: t } = await i(), n = e.split(/(<script\b[^>]*>[\s\S]*?<\/script>|<style\b[^>]*>[\s\S]*?<\/style>)/gi), r = [];
2588
+ for (let e of n) {
2589
+ let n = /^<script\b([^>]*)>([\s\S]*?)<\/script>$/i.exec(e);
2590
+ if (n) {
2591
+ let i = /lang=["']?(ts|typescript)["']?/i.test(n[1] ?? "") ? "ts" : "js", o = e.slice(0, e.indexOf(">") + 1);
2592
+ r.push(a(o), await t(n[2] ?? "", i, { block: !1 }), a("<\/script>"));
2593
+ continue;
2594
+ }
2595
+ let i = /^<style\b([^>]*)>([\s\S]*?)<\/style>$/i.exec(e);
2596
+ if (i) {
2597
+ let n = e.slice(0, e.indexOf(">") + 1);
2598
+ r.push(a(n), await t(i[2] ?? "", "css", { block: !1 }), a("</style>"));
2599
+ } else r.push(await t(e, "html", { block: !1 }));
2600
+ }
2601
+ return r.join("");
2602
+ }, c = async (e) => {
2603
+ let t = e.className.match(/language-([\w-]+)/)?.[1]?.toLowerCase(), r = t ? n[t] : void 0;
2604
+ if (!r || e.dataset.highlighted) return;
2605
+ e.dataset.highlighted = "true";
2606
+ let a = e.textContent ?? "";
2607
+ try {
2608
+ e.innerHTML = r === "vue" ? await o(a) : await (await i()).highlightHTML(a, r, { block: !1 });
2609
+ } catch {
2610
+ delete e.dataset.highlighted;
2611
+ }
2612
+ }, l = () => {
2613
+ t.value?.querySelectorAll("pre code").forEach((e) => void c(e));
2614
+ }, u = async (e) => {
2615
+ let t = e.target?.closest("[data-copy-code]");
2616
+ if (!t) return;
2617
+ let n = t.closest(".doc-code")?.querySelector("code");
2618
+ if (n) {
2619
+ try {
2620
+ await navigator.clipboard.writeText(n.textContent ?? ""), t.textContent = "скопировано";
2621
+ } catch {
2622
+ t.textContent = "не удалось";
2623
+ }
2624
+ window.setTimeout(() => {
2625
+ t.textContent = "копировать";
2626
+ }, 1500);
2627
+ }
2628
+ }, d = null;
2629
+ return S(() => {
2630
+ l();
2631
+ let e = (e) => void u(e);
2632
+ t.value?.addEventListener("click", e), d = () => t.value?.removeEventListener("click", e);
2633
+ }), x(() => d?.()), (n, r) => (C(), s("div", {
2634
+ ref_key: "root",
2635
+ ref: t,
2636
+ innerHTML: e.html
2637
+ }, null, 8, ra));
2638
+ }
2639
+ }), [["__scopeId", "data-v-71a37e31"]]), aa = {
2640
+ wrapper: "space-y-2",
2641
+ label: "text-xs text-(--accent)"
2642
+ }, oa = /* @__PURE__ */ f({
2643
+ __name: "SField",
2644
+ props: { label: {} },
2645
+ setup(e) {
2646
+ return (t, n) => (C(), s("div", { class: y(aa.wrapper) }, [e.label ? (C(), s("div", {
2647
+ key: 0,
2648
+ class: y(aa.label)
2649
+ }, M(e.label), 3)) : o("", !0), k(t.$slots, "default")], 2));
2650
+ }
2651
+ }), sa = (e, t) => {
2652
+ if (!Number.isFinite(e) || !Array.isArray(t) || t.length !== 3 || t.some((e) => typeof e != "string")) throw TypeError("Invalid arguments");
2653
+ let n = Math.abs(e), r = n % 10, i = n % 100;
2654
+ return n % 1 == 0 ? i >= 11 && i <= 19 ? t[2] : r === 1 ? t[0] : r >= 2 && r <= 4 ? t[1] : t[2] : t[1];
2655
+ }, ca = [
2656
+ "id",
2657
+ "name",
2658
+ "accept",
2659
+ "multiple",
2660
+ "disabled"
2661
+ ], la = {
2662
+ wrapper: "flex flex-col items-start gap-2",
2663
+ list: "flex max-h-32 flex-col gap-1 overflow-auto",
2664
+ item: "flex items-center justify-between gap-2 bg-(--elevated) px-2 py-1 text-sm text-(--text-default)",
2665
+ fileName: "min-w-0 wrap-break-word",
2666
+ removeBtn: "cursor-pointer hover:bg-(--danger)"
2667
+ }, ua = /* @__PURE__ */ f({
2668
+ __name: "SFile",
2669
+ props: /*@__PURE__*/ g({
2670
+ id: {},
2671
+ name: {},
2672
+ accept: {},
2673
+ buttonLabel: { default: "" },
2674
+ count: {},
2675
+ disabled: {
2676
+ type: Boolean,
2677
+ default: !1
2678
+ },
2679
+ loading: {
2680
+ type: Boolean,
2681
+ default: !1
2682
+ },
2683
+ multiple: {
2684
+ type: Boolean,
2685
+ default: !1
2686
+ },
2687
+ showList: {
2688
+ type: Boolean,
2689
+ default: !0
2690
+ }
2691
+ }, {
2692
+ modelValue: { default: () => [] },
2693
+ modelModifiers: {}
2694
+ }),
2695
+ emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
2696
+ setup(e, { expose: t, emit: r }) {
2697
+ let a = I(e, "modelValue"), l = r, u = m("field-id", void 0), f = F(), p = i(() => e.id || u || `file-${f}`), h = D(null), g = i(() => e.buttonLabel || (e.multiple ? "Выбрать файлы" : "Выбрать файл")), _ = i(() => {
2698
+ let t = e.loading && a.value.length ? a.value.length : Number(e.count || 0) || a.value.length;
2699
+ return t ? e.multiple ? `${t} ${sa(t, [
2700
+ "файл",
2701
+ "файла",
2702
+ "файлов"
2703
+ ])}` : a.value[0]?.name || g.value : g.value;
2704
+ }), v = i(() => e.loading ? "load" : e.disabled ? "disabled" : "idle"), b = () => {
2705
+ !e.disabled && !e.loading && h.value?.click();
2706
+ }, x = (e) => {
2707
+ let t = e.target, n = Array.from(t.files ?? []);
2708
+ a.value = n, l("change", e, n), t.value = "";
2709
+ }, S = (e) => {
2710
+ a.value = a.value.filter((t, n) => n !== e);
2711
+ }, w = () => {
2712
+ a.value = [], h.value && (h.value.value = "");
2713
+ };
2714
+ return t({
2715
+ reset: w,
2716
+ files: a
2717
+ }), z(() => e.loading, (t) => {
2718
+ !t && !e.showList && w();
2719
+ }), (t, r) => (C(), s("div", { class: y(la.wrapper) }, [
2720
+ c("input", {
2721
+ id: P(p),
2722
+ ref_key: "inputRef",
2723
+ ref: h,
2724
+ name: e.name,
2725
+ accept: e.accept,
2726
+ multiple: e.multiple,
2727
+ disabled: e.disabled || e.loading,
2728
+ type: "file",
2729
+ class: "sr-only",
2730
+ tabindex: "-1",
2731
+ "aria-hidden": "true",
2732
+ onChange: x
2733
+ }, null, 40, ca),
2734
+ d(Sr, {
2735
+ label: P(_),
2736
+ state: P(v),
2737
+ onClick: b
2738
+ }, null, 8, ["label", "state"]),
2739
+ e.showList && a.value.length && e.multiple ? (C(), s("div", {
2740
+ key: 0,
2741
+ class: y(la.list)
2742
+ }, [(C(!0), s(n, null, O(a.value, (e, t) => (C(), s("div", {
2743
+ key: e.name + t,
2744
+ class: y(la.item)
2745
+ }, [c("span", { class: y(la.fileName) }, M(e.name), 3), d(Sr, {
2746
+ class: y(la.removeBtn),
2747
+ state: P(v),
2748
+ label: "Удалить",
2749
+ onClick: (e) => S(t)
2750
+ }, null, 8, [
2751
+ "class",
2752
+ "state",
2753
+ "onClick"
2754
+ ])], 2))), 128))], 2)) : o("", !0)
2755
+ ], 2));
2756
+ }
2757
+ }), da = ["id", "aria-disabled"], fa = [
2758
+ "aria-checked",
2759
+ "aria-label",
2760
+ "disabled",
2761
+ "title",
2762
+ "onClick"
2763
+ ], pa = ["name", "value"], ma = {
2764
+ wrapper: "inline-flex flex-col gap-1 w-fit",
2765
+ wrapperDisabled: "opacity-50",
2766
+ grid: "grid gap-1",
2767
+ button: "ui-focus flex h-6 min-w-6 items-center justify-center",
2768
+ buttonDisabled: "cursor-not-allowed",
2769
+ buttonEnabled: "cursor-pointer",
2770
+ bar: "h-2 w-full",
2771
+ barActive: "bg-(--accent)",
2772
+ barInactive: "bg-(--elevated)",
2773
+ srOnly: "sr-only",
2774
+ optionLabel: "truncate text-center text-xs",
2775
+ optionLabelActive: "text-(--accent)",
2776
+ optionLabelInactive: "opacity-70"
2777
+ }, ha = /* @__PURE__ */ f({
2778
+ __name: "SGradation",
2779
+ props: /*@__PURE__*/ g({
2780
+ options: { default: () => [] },
2781
+ id: {},
2782
+ name: {},
2783
+ disabled: {
2784
+ type: Boolean,
2785
+ default: !1
2786
+ },
2787
+ clearValue: { default: "" }
2788
+ }, {
2789
+ modelValue: { default: "" },
2790
+ modelModifiers: {}
2791
+ }),
2792
+ emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
2793
+ setup(e, { emit: t }) {
2794
+ let r = I(e, "modelValue"), a = t, l = F(), u = i(() => e.id || `gradation-${l}`), d = i(() => String(r.value ?? "").trim()), f = i(() => e.options.map((e, t) => ({
2795
+ value: String(e.value).trim(),
2796
+ label: e.label?.trim() || `Уровень ${t + 1}`
2797
+ })).filter((e) => e.value)), p = i(() => f.value.findIndex((e) => e.value === d.value)), m = i(() => ({ gridTemplateColumns: `repeat(${f.value.length}, minmax(1.5rem, 1fr))` })), h = (t) => {
2798
+ if (e.disabled) return;
2799
+ let n = t === d.value ? e.clearValue : t;
2800
+ r.value = n, a("change", n);
2801
+ }, g = i(() => [ma.wrapper, e.disabled && ma.wrapperDisabled]), _ = i(() => [ma.button, e.disabled ? ma.buttonDisabled : ma.buttonEnabled]), v = (e) => [ma.bar, p.value >= 0 && e <= p.value ? ma.barActive : ma.barInactive], x = (e) => [ma.optionLabel, e.value === d.value ? ma.optionLabelActive : ma.optionLabelInactive];
2802
+ return (t, r) => (C(), s("div", { class: y(P(g)) }, [
2803
+ c("div", {
2804
+ id: P(u),
2805
+ "aria-disabled": e.disabled ? "true" : "false",
2806
+ "aria-label": "Градация",
2807
+ class: y(ma.grid),
2808
+ style: b(P(m)),
2809
+ role: "radiogroup"
2810
+ }, [(C(!0), s(n, null, O(P(f), (t, n) => (C(), s("button", {
2811
+ key: t.value,
2812
+ "aria-checked": t.value === P(d) ? "true" : "false",
2813
+ "aria-label": t.label,
2814
+ disabled: e.disabled,
2815
+ title: t.label,
2816
+ class: y(P(_)),
2817
+ role: "radio",
2818
+ type: "button",
2819
+ onClick: (e) => h(t.value)
2820
+ }, [c("span", { class: y(v(n)) }, null, 2), c("span", { class: y(ma.srOnly) }, M(t.label), 3)], 10, fa))), 128))], 14, da),
2821
+ c("div", {
2822
+ class: y(ma.grid),
2823
+ style: b(P(m))
2824
+ }, [(C(!0), s(n, null, O(P(f), (e) => (C(), s("span", {
2825
+ key: `label-${e.value}`,
2826
+ class: y(x(e))
2827
+ }, M(e.label), 3))), 128))], 6),
2828
+ e.name ? (C(), s("input", {
2829
+ key: 0,
2830
+ type: "hidden",
2831
+ name: e.name,
2832
+ value: P(d)
2833
+ }, null, 8, pa)) : o("", !0)
2834
+ ], 2));
2835
+ }
2836
+ }), ga = ["aria-label"], _a = ["src", "alt"], va = { class: "truncate" }, ya = ["aria-label"], ba = { class: "relative min-h-0 flex-1" }, xa = ["src", "alt"], Sa = [
2837
+ "data-thumb-index",
2838
+ "aria-label",
2839
+ "aria-current",
2840
+ "onClick"
2841
+ ], Ca = ["src", "alt"], Q = {
2842
+ trigger: "group relative block w-full max-w-full cursor-pointer overflow-hidden bg-(--elevated) p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2843
+ triggerImage: "aspect-4/3 w-full object-cover transition-transform duration-200 group-hover:scale-105",
2844
+ badge: "pointer-events-none absolute top-0 right-0 z-1 flex size-7 items-center justify-center bg-zinc-950/70 text-white opacity-80 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
2845
+ triggerLabel: "pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-center gap-1.5 bg-zinc-950/70 p-2 text-xs font-medium text-white opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
2846
+ overlay: "fixed inset-0 z-60 flex flex-col bg-(--bg-default) text-(--text-default)",
2847
+ toolbar: "relative z-10 flex shrink-0 items-center gap-2 overflow-x-auto px-2 py-1",
2848
+ meta: "text-xs whitespace-nowrap tabular-nums opacity-60",
2849
+ iconButton: "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2850
+ closeButton: "inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-full px-2 text-xs font-medium text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2851
+ stage: "absolute inset-0 bg-(--bg-default)",
2852
+ fitWrapper: "flex h-full w-full items-center justify-center",
2853
+ originalWrapper: "flex h-max w-max min-h-full min-w-full items-center justify-center",
2854
+ nav: "absolute inset-y-0 z-20 hidden w-16 cursor-pointer items-center justify-center text-(--text-default) bg-(--default-hover)/30 opacity-80 transition-colors select-none hover:bg-(--default-hover)/60 hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent) focus-visible:ring-inset md:flex",
2855
+ bottom: "relative z-10 flex shrink-0 flex-col gap-2 bg-(--bg-default) p-2",
2856
+ tools: "flex items-center justify-center gap-1",
2857
+ thumbs: "min-w-0 overflow-x-auto",
2858
+ thumbsRow: "flex min-w-max gap-2",
2859
+ thumb: "relative size-16 shrink-0 cursor-pointer overflow-hidden bg-(--elevated) p-0 opacity-70 transition-opacity select-none hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2860
+ thumbImage: "size-full object-cover",
2861
+ spinner: "pointer-events-none absolute inset-0 flex items-center justify-center"
2862
+ }, wa = /* @__PURE__ */ f({
2863
+ __name: "SImage",
2864
+ props: /*@__PURE__*/ g({
2865
+ src: { default: "" },
2866
+ title: { default: "" },
2867
+ alt: { default: "" },
2868
+ items: { default: () => [] },
2869
+ groups: { default: () => [] },
2870
+ initialIndex: { default: 0 },
2871
+ trigger: {
2872
+ type: Boolean,
2873
+ default: !0
2874
+ },
2875
+ triggerLabel: { default: "Открыть" },
2876
+ routeSync: {
2877
+ type: Boolean,
2878
+ default: !1
2879
+ },
2880
+ galleryName: { default: "" },
2881
+ wrap: {
2882
+ type: Boolean,
2883
+ default: !0
2884
+ },
2885
+ groupSwitching: {
2886
+ type: Boolean,
2887
+ default: !1
2888
+ }
2889
+ }, {
2890
+ modelValue: {
2891
+ type: Boolean,
2892
+ default: !1
2893
+ },
2894
+ modelModifiers: {}
2895
+ }),
2896
+ emits: /*@__PURE__*/ g([
2897
+ "change",
2898
+ "group-change",
2899
+ "group-previous",
2900
+ "group-next",
2901
+ "open",
2902
+ "close"
2903
+ ], ["update:modelValue"]),
2904
+ setup(e, { expose: t, emit: l }) {
2905
+ let u = I(e, "modelValue"), f = i(() => P(e.items) ?? []), p = i(() => P(e.groups) ?? []), m = lr(), h = cr(), g = D(!1), _ = l, w = D(Math.max(0, Math.trunc(e.initialIndex))), E = D(0), A = D("fit"), j = D(!1), N = D(0), F = T({
2906
+ x: 1,
2907
+ y: 1
2908
+ }), L = T({
2909
+ width: 0,
2910
+ height: 0
2911
+ }), R = T({}), V = T({
2912
+ width: 0,
2913
+ height: 0
2914
+ }), re = (e) => !Number.isFinite(e) || e <= 0 ? "" : e > 1022976 ? `${(e / 1024 / 1024).toFixed(1)}мб` : `${(e / 1024).toFixed(1)}кб`, ie = i(() => {
2915
+ let e = J.value;
2916
+ if (!e) return null;
2917
+ let t = e.fileSize ?? e.size ?? R[e.src];
2918
+ return typeof t == "number" && t > 0 ? t : null;
2919
+ }), ae = async (e) => {
2920
+ if (typeof window > "u" || !e || R[e] && R[e] > 0) return;
2921
+ let t = (() => {
2922
+ try {
2923
+ return new URL(e, window.location.href).href;
2924
+ } catch {
2925
+ return e;
2926
+ }
2927
+ })();
2928
+ for (let n of [t, e]) {
2929
+ let t = performance.getEntriesByName(n, "resource").at(-1), r = t?.decodedBodySize || t?.encodedBodySize || 0;
2930
+ if (r > 0) {
2931
+ R[e] = r;
2932
+ return;
2933
+ }
2934
+ }
2935
+ try {
2936
+ let t = await fetch(e, { method: "HEAD" }), n = Number(t.headers.get("content-length"));
2937
+ if (Number.isFinite(n) && n > 0) {
2938
+ R[e] = n;
2939
+ return;
2940
+ }
2941
+ } catch {}
2942
+ try {
2943
+ let t = await fetch(e, { headers: { Range: "bytes=0-0" } }), n = t.headers.get("content-range")?.match(/\/(\d+)\s*$/), r = n ? Number(n[1]) : NaN;
2944
+ if (Number.isFinite(r) && r > 0) {
2945
+ R[e] = r;
2946
+ return;
2947
+ }
2948
+ let i = Number(t.headers.get("content-length"));
2949
+ if (Number.isFinite(i) && i > 0) {
2950
+ R[e] = i;
2951
+ return;
2952
+ }
2953
+ } catch {}
2954
+ R[e] = 0;
2955
+ }, H = T({
2956
+ startX: 0,
2957
+ startY: 0,
2958
+ left: 0,
2959
+ top: 0,
2960
+ tracking: !1
2961
+ }), U = T({
2962
+ startX: 0,
2963
+ startY: 0,
2964
+ deltaX: 0,
2965
+ deltaY: 0,
2966
+ tracking: !1
2967
+ }), W = T({
2968
+ active: !1,
2969
+ startDistance: 0,
2970
+ startScale: 1
2971
+ }), oe = D(1), G = D(!1), se = D(null), K = D(null), ce = D(null), le = D(null), q = T({
2972
+ left: !1,
2973
+ right: !1,
2974
+ top: !1,
2975
+ bottom: !1
2976
+ }), ue = T({
2977
+ left: !1,
2978
+ right: !1,
2979
+ top: !1,
2980
+ bottom: !1
2981
+ }), de = T({
2982
+ left: !1,
2983
+ right: !1,
2984
+ top: !1,
2985
+ bottom: !1
2986
+ }), fe = D(""), pe = null, me = null, he = (e) => {
2987
+ let t = [];
2988
+ return (e ?? []).forEach((e, n) => {
2989
+ let r = String(e?.src ?? "").trim();
2990
+ if (!r) return;
2991
+ let i = String(e?.title ?? "").trim(), a = String(e?.alt ?? "").trim(), o = String(e?.thumbnailSrc ?? "").trim();
2992
+ t.push({
2993
+ src: r,
2994
+ title: i || void 0,
2995
+ alt: a || i || `Изображение ${n + 1}`,
2996
+ thumbnailSrc: o || void 0
2997
+ });
2998
+ }), t;
2999
+ }, ge = i(() => {
3000
+ let t = (p.value ?? []).map(he).filter((e) => e.length);
3001
+ if (t.length) return t;
3002
+ let n = he(f.value ?? []);
3003
+ if (n.length) return [n];
3004
+ let r = String(e.src ?? "").trim();
3005
+ return r ? [[{
3006
+ src: r,
3007
+ title: e.title || void 0,
3008
+ alt: String(e.alt ?? "").trim() || e.title || "Изображение"
3009
+ }]] : [];
3010
+ }), _e = i(() => ge.value[E.value] ?? []), ve = i(() => ge.value.length), J = i(() => _e.value[w.value] || null), ye = (e) => {
3011
+ let t = (String(e.src ?? "").split("?")[0] || "").split("/").pop() || "", n = t;
3012
+ try {
3013
+ n = decodeURIComponent(t);
3014
+ } catch {}
3015
+ return n.replace(/\.[a-z0-9]+$/i, "");
3016
+ }, be = i(() => {
3017
+ let e = m.value.match(/\/g\/([^/]+)\/([^/]+)$/);
3018
+ return !e?.[1] || !e[2] ? null : {
3019
+ name: decodeURIComponent(e[1]),
3020
+ image: decodeURIComponent(e[2])
3021
+ };
3022
+ }), xe = i(() => {
3023
+ if (!e.routeSync || !_e.value.length || !be.value || be.value.name !== e.galleryName.trim()) return null;
3024
+ let t = _e.value.findIndex((e) => ye(e) === be.value?.image);
3025
+ return t >= 0 ? t : null;
3026
+ }), Se = i(() => !(!u.value && xe.value === null || !J.value?.src)), Ce = i(() => {
3027
+ let e = J.value;
3028
+ return e ? A.value === "original" || V.width >= 532 && V.height >= 532 ? e.src : e.thumbnailSrc || e.src : "";
3029
+ }), we = async (t) => {
3030
+ if (!e.routeSync || typeof window > "u") return;
3031
+ let n = e.galleryName.trim();
3032
+ if (!n) return;
3033
+ let r = t === null ? null : _e.value[t], i = r ? ye(r) : null, a = m.value.replace(/\/g\/[^/]+\/[^/]+$/, ""), o = i ? `${a}/g/${encodeURIComponent(n)}/${encodeURIComponent(i)}` : a;
3034
+ if (h && m.value !== o) {
3035
+ g.value = !0;
3036
+ try {
3037
+ await h.replace(o + window.location.search + window.location.hash);
3038
+ } finally {
3039
+ g.value = !1;
3040
+ }
3041
+ }
3042
+ }, Te = i(() => _e.value.length > 1), Ee = i(() => J.value?.title || e.title), De = i(() => L.width > 0 && L.height > 0), Oe = i(() => Math.abs(N.value) / 90 % 2 == 1), ke = i(() => ({
3043
+ width: Oe.value ? L.height : L.width,
3044
+ height: Oe.value ? L.width : L.height
3045
+ })), Ae = i(() => !ke.value.width || !ke.value.height || !V.width || !V.height ? 1 : Math.min(1, Math.max(0, V.width - 20) / ke.value.width, Math.max(0, V.height - 20) / ke.value.height)), je = i(() => A.value === "fit" ? Ae.value : oe.value), Me = i(() => !!(j.value && ke.value.width && ke.value.height && V.width && V.height && (ke.value.width > V.width - 20 || ke.value.height > V.height - 20))), Ne = i(() => A.value === "original" && Me.value), Pe = i(() => !Ne.value), Fe = i(() => U.tracking && U.deltaX ? { transform: `translate3d(${U.deltaX}px, 0, 0)` } : void 0), Ie = i(() => j.value ? `${Math.round(je.value * 100)}%` : "…"), Le = i(() => {
3046
+ if (!De.value) return "";
3047
+ let e = [`${L.width}x${L.height}`], t = ie.value;
3048
+ if (t) {
3049
+ let n = re(t);
3050
+ n && e.push(n);
3051
+ }
3052
+ return e.join(" ");
3053
+ }), Re = i(() => De.value ? {
3054
+ width: `${Math.max(1, Math.round(ke.value.width * je.value))}px`,
3055
+ height: `${Math.max(1, Math.round(ke.value.height * je.value))}px`,
3056
+ flex: "0 0 auto"
3057
+ } : {
3058
+ width: "100%",
3059
+ height: "100%"
3060
+ }), ze = i(() => De.value ? {
3061
+ position: "absolute",
3062
+ left: "50%",
3063
+ top: "50%",
3064
+ width: `${Math.max(1, Math.round(L.width * je.value))}px`,
3065
+ height: `${Math.max(1, Math.round(L.height * je.value))}px`,
3066
+ maxWidth: "none",
3067
+ maxHeight: "none",
3068
+ transform: `translate(-50%, -50%) rotate(${N.value}deg) scale(${F.x}, ${F.y})`,
3069
+ transformOrigin: "center center"
3070
+ } : {
3071
+ position: "absolute",
3072
+ inset: "0",
3073
+ width: "100%",
3074
+ height: "100%",
3075
+ objectFit: "contain"
3076
+ }), Be = (e) => {
3077
+ let t = e % 360;
3078
+ return t < 0 ? t + 360 : t;
3079
+ }, Ve = () => {
3080
+ let e = K.value;
3081
+ e && (V.width = e.clientWidth, V.height = e.clientHeight);
3082
+ }, He = (e) => {
3083
+ e.left = !1, e.right = !1, e.top = !1, e.bottom = !1;
3084
+ }, Ue = (e, t, n) => {
3085
+ if (!e) return He(t);
3086
+ let r = n === "x" || n === "both", i = n === "y" || n === "both";
3087
+ t.left = r && e.scrollLeft > 2, t.right = r && e.scrollLeft < Math.max(0, e.scrollWidth - e.clientWidth) - 2, t.top = i && e.scrollTop > 2, t.bottom = i && e.scrollTop < Math.max(0, e.scrollHeight - e.clientHeight) - 2;
3088
+ }, We = () => {
3089
+ Ue(ce.value, q, "x"), Ue(K.value, ue, "both"), Ue(le.value, de, "x");
3090
+ }, Ge = () => {
3091
+ typeof window < "u" && (pe?.disconnect(), K.value && pe?.observe(K.value), Ve());
3092
+ }, Ke = () => {
3093
+ let e = se.value;
3094
+ e?.complete && e.naturalWidth && (L.width = e.naturalWidth, L.height = e.naturalHeight, j.value = !0, Ve());
3095
+ }, qe = () => {
3096
+ let e = ce.value;
3097
+ if (!e || !Te.value) return;
3098
+ let t = e.querySelector(`[data-thumb-index="${w.value}"]`);
3099
+ t && e.scrollTo({
3100
+ left: Math.max(0, t.offsetLeft - Math.max(0, (e.clientWidth - t.offsetWidth) / 2)),
3101
+ behavior: "smooth"
3102
+ });
3103
+ }, Je = () => {
3104
+ let e = K.value;
3105
+ e && A.value === "original" && (e.scrollLeft = Math.max(0, Math.round((e.scrollWidth - e.clientWidth) / 2)), e.scrollTop = Math.max(0, Math.round((e.scrollHeight - e.clientHeight) / 2)));
3106
+ }, Ye = (e) => {
3107
+ let t = _e.value.length;
3108
+ if (!t) return;
3109
+ let n = (Math.trunc(e) % t + t) % t;
3110
+ n !== w.value && (w.value = n, _("change", n), u.value && we(n));
3111
+ }, Xe = (e) => {
3112
+ let t = _e.value.length;
3113
+ if (!t) return;
3114
+ let n = (Math.trunc(e) % t + t) % t;
3115
+ w.value = n, _("change", n), u.value && we(n);
3116
+ }, Ze = (e) => {
3117
+ _e.value.length && (typeof e == "number" && Ye(e), u.value = !0, we(w.value));
3118
+ }, Qe = () => {
3119
+ u.value = !1, we(null);
3120
+ }, $e = () => {
3121
+ Te.value && Ye(w.value - 1);
3122
+ }, et = () => {
3123
+ Te.value && Ye(w.value + 1);
3124
+ }, tt = (e) => {
3125
+ let t = ve.value;
3126
+ t > 1 && (E.value = ((E.value + e) % t + t) % t, w.value = 0, nt(), _("change", 0), _("group-change", E.value)), _(e > 0 ? "group-next" : "group-previous");
3127
+ }, nt = () => {
3128
+ A.value = "fit", N.value = 0, F.x = 1, F.y = 1, oe.value = 1, W.active = !1;
3129
+ }, rt = () => {
3130
+ Me.value && (A.value === "original" && (oe.value = 1), A.value = A.value === "fit" ? "original" : "fit", v(() => A.value === "original" ? Je() : K.value?.scrollTo({
3131
+ top: 0,
3132
+ left: 0
3133
+ })));
3134
+ }, it = (e) => {
3135
+ N.value = Be(N.value + e), v(Je);
3136
+ }, at = (e) => {
3137
+ F[e] *= -1;
3138
+ }, ot = (e) => {
3139
+ let t = e.target;
3140
+ t && (L.width = t.naturalWidth || 0, L.height = t.naturalHeight || 0, j.value = !0, A.value = "fit", Ve(), qe());
3141
+ }, st = () => {
3142
+ typeof window < "u" && (window.removeEventListener("mousemove", ct), window.removeEventListener("mouseup", lt)), H.tracking = !1;
3143
+ }, ct = (e) => {
3144
+ let t = K.value;
3145
+ if (!H.tracking || !t || A.value !== "original" || !(e.buttons & 1)) return st();
3146
+ let n = e.clientX - H.startX, r = e.clientY - H.startY;
3147
+ !G.value && Math.abs(n) + Math.abs(r) > 4 && (G.value = !0, e.preventDefault()), t.scrollLeft = H.left - n, t.scrollTop = H.top - r;
3148
+ }, lt = () => {
3149
+ let e = G.value;
3150
+ st(), e && typeof window < "u" && (me !== null && window.clearTimeout(me), me = window.setTimeout(() => {
3151
+ G.value = !1, me = null;
3152
+ }, 0));
3153
+ }, ut = (e) => {
3154
+ let t = K.value;
3155
+ A.value === "original" && Me.value && t && e.button === 0 && (H.startX = e.clientX, H.startY = e.clientY, H.left = t.scrollLeft, H.top = t.scrollTop, H.tracking = !0, typeof window < "u" && (window.addEventListener("mousemove", ct), window.addEventListener("mouseup", lt)));
3156
+ }, dt = () => {
3157
+ G.value || rt();
3158
+ }, ft = (e) => {
3159
+ let t = e[0], n = e[1];
3160
+ return !t || !n ? 0 : Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY);
3161
+ }, pt = () => {
3162
+ U.startX = 0, U.startY = 0, U.deltaX = 0, U.deltaY = 0, U.tracking = !1, W.active = !1;
3163
+ }, mt = (e) => {
3164
+ if (e.touches.length >= 2) {
3165
+ if (pt(), A.value !== "original" || !Me.value) return;
3166
+ W.active = !0, W.startDistance = ft(e.touches), W.startScale = oe.value;
3167
+ return;
3168
+ }
3169
+ let t = e.touches[0];
3170
+ if (!t || !Pe.value) return pt();
3171
+ U.startX = t.clientX, U.startY = t.clientY, U.deltaX = 0, U.deltaY = 0, U.tracking = !0;
3172
+ }, ht = (e) => {
3173
+ if (W.active) {
3174
+ if (e.touches.length < 2 || !W.startDistance) return;
3175
+ let t = ft(e.touches);
3176
+ oe.value = Math.min(4, Math.max(1, W.startScale * t / W.startDistance)), e.cancelable && e.preventDefault();
3177
+ return;
3178
+ }
3179
+ if (Ne.value) return;
3180
+ let t = e.touches[0];
3181
+ t && U.tracking && Pe.value && (U.deltaX = t.clientX - U.startX, U.deltaY = t.clientY - U.startY, Math.abs(U.deltaX) > Math.abs(U.deltaY) && Math.abs(U.deltaX) > 12 && e.cancelable && e.preventDefault());
3182
+ }, gt = () => {
3183
+ if (W.active) {
3184
+ W.active = !1, oe.value <= 1.02 && (oe.value = 1);
3185
+ return;
3186
+ }
3187
+ if (!U.tracking || !Pe.value) return pt();
3188
+ let e = Math.abs(U.deltaX) > Math.abs(U.deltaY), t = Te.value && e && Math.abs(U.deltaX) >= 56, n = !e && Math.abs(U.deltaY) >= 56, r = U.deltaX < 0 ? 1 : -1, i = U.deltaY < 0 ? 1 : -1;
3189
+ pt(), n ? tt(i) : t && (r > 0 ? et() : $e());
3190
+ }, _t = (e) => {
3191
+ if (G.value) return;
3192
+ let t = e.target;
3193
+ t && (t.closest("img, button, a, [data-no-close]") || Qe());
3194
+ }, vt = (e) => {
3195
+ if (u.value) {
3196
+ if (e.key === "Escape") return Qe();
3197
+ if (e.key === "ArrowLeft") return $e();
3198
+ if (e.key === "ArrowRight") return et();
3199
+ if (e.key === "ArrowUp") return tt(-1);
3200
+ if (e.key === "ArrowDown") return tt(1);
3201
+ }
3202
+ };
3203
+ z(u, async (e) => {
3204
+ typeof window < "u" && (e ? (fe.value = document.body.style.overflow, document.body.style.overflow = "hidden", _("open"), await v(), Ge(), yt(), We(), Ke(), qe(), we(w.value)) : (document.body.style.overflow = fe.value, st(), pt(), nt(), we(null), _("close")));
3205
+ }), z(xe, (t) => {
3206
+ if (!g.value) {
3207
+ if (t === null) {
3208
+ if (e.groupSwitching) return;
3209
+ if (u.value && _e.value.length > 0) {
3210
+ we(w.value);
3211
+ return;
3212
+ }
3213
+ u.value &&= !1;
3214
+ } else w.value !== t && (w.value = t), u.value ||= !0, we(t);
3215
+ }
3216
+ }, { immediate: !0 }), z(() => J.value?.src, (e) => {
3217
+ j.value = !1, nt(), e && ae(e), v(() => {
3218
+ Ke(), qe(), We();
3219
+ });
3220
+ }), z(Ce, (e) => {
3221
+ e && (j.value = !1, v(() => {
3222
+ Ke(), We();
3223
+ }));
3224
+ }), z(Le, () => v(We)), z(() => _e.value, (e) => {
3225
+ e.length ? w.value >= e.length && (w.value = 0) : u.value && Qe();
3226
+ }), z(ve, (e) => {
3227
+ E.value > e - 1 && (E.value = Math.max(0, e - 1));
3228
+ }), z(() => e.initialIndex, (e) => {
3229
+ u.value || (w.value = Math.max(0, Math.trunc(e)));
3230
+ }), S(() => {
3231
+ typeof window < "u" && (window.addEventListener("keydown", vt), pe = new ResizeObserver(() => {
3232
+ Ve(), We();
3233
+ }), u.value && Ge(), We(), Ke(), J.value?.src && ae(J.value.src), v(() => {
3234
+ Ke(), qe();
3235
+ }));
3236
+ });
3237
+ let yt = () => {
3238
+ typeof window < "u" && [
3239
+ ce.value,
3240
+ K.value,
3241
+ le.value
3242
+ ].forEach((e) => {
3243
+ e && e.addEventListener("scroll", We, { passive: !0 });
3244
+ });
3245
+ };
3246
+ return x(() => {
3247
+ typeof window < "u" && (window.removeEventListener("keydown", vt), pe?.disconnect(), st(), pt(), me !== null && window.clearTimeout(me), u.value && (document.body.style.overflow = fe.value));
3248
+ }), t({
3249
+ open: Ze,
3250
+ close: Qe,
3251
+ goTo: Xe
3252
+ }), (t, i) => (C(), s(n, null, [e.trigger && P(J) ? (C(), s("button", {
3253
+ key: 0,
3254
+ type: "button",
3255
+ class: y(Q.trigger),
3256
+ "aria-label": `${e.triggerLabel}: ${P(J).alt || ""}`,
3257
+ onClick: i[0] ||= (e) => Ze()
3258
+ }, [
3259
+ c("img", {
3260
+ src: P(J).thumbnailSrc || P(J).src,
3261
+ alt: P(J).alt,
3262
+ class: y(Q.triggerImage),
3263
+ loading: "lazy",
3264
+ decoding: "async"
3265
+ }, null, 10, _a),
3266
+ c("span", {
3267
+ class: y(Q.badge),
3268
+ "aria-hidden": "true"
3269
+ }, [d(Y, {
3270
+ name: "expand",
3271
+ class: "size-4"
3272
+ })], 2),
3273
+ c("span", { class: y(Q.triggerLabel) }, [d(Y, {
3274
+ name: "expand",
3275
+ class: "size-4"
3276
+ }), c("span", va, M(e.triggerLabel), 1)], 2)
3277
+ ], 10, ga)) : o("", !0), P(Se) ? (C(), a(r, {
3278
+ key: 1,
3279
+ to: "body"
3280
+ }, [c("div", {
3281
+ class: y(Q.overlay),
3282
+ role: "dialog",
3283
+ "aria-modal": "true",
3284
+ "aria-label": P(Ee) || P(J)?.alt || "Изображение"
3285
+ }, [
3286
+ d(Lr, {
3287
+ active: P(de),
3288
+ axis: "x",
3289
+ class: "shrink-0"
3290
+ }, {
3291
+ default: B(() => [c("div", {
3292
+ ref_key: "toolbarRef",
3293
+ ref: le,
3294
+ class: y(Q.toolbar)
3295
+ }, [
3296
+ i[7] ||= c("div", { class: "flex-1" }, null, -1),
3297
+ P(Ee) ? (C(), s("span", {
3298
+ key: 0,
3299
+ class: y([Q.meta, "hidden max-w-40 truncate sm:block"])
3300
+ }, M(P(Ee)), 3)) : o("", !0),
3301
+ P(ve) > 1 ? (C(), s("span", {
3302
+ key: 1,
3303
+ class: y(Q.meta)
3304
+ }, M(P(E) + 1) + " / " + M(P(ve)), 3)) : o("", !0),
3305
+ P(Le) ? (C(), s("span", {
3306
+ key: 2,
3307
+ class: y(Q.meta)
3308
+ }, M(P(Le)), 3)) : o("", !0),
3309
+ c("span", { class: y(Q.meta) }, M(P(Ie)), 3),
3310
+ k(t.$slots, "toolbar-start", {
3311
+ index: P(w),
3312
+ item: P(J)
3313
+ }),
3314
+ c("button", {
3315
+ type: "button",
3316
+ class: y(Q.closeButton),
3317
+ "aria-label": "Закрыть",
3318
+ onClick: Qe
3319
+ }, [d(Y, {
3320
+ name: "close",
3321
+ class: "size-4"
3322
+ }), i[6] ||= c("span", { class: "hidden sm:inline" }, "Закрыть", -1)], 2)
3323
+ ], 2)]),
3324
+ _: 3
3325
+ }, 8, ["active"]),
3326
+ c("div", ba, [
3327
+ d(Lr, {
3328
+ active: P(ue),
3329
+ axis: "both",
3330
+ class: "h-full"
3331
+ }, {
3332
+ default: B(() => [c("div", {
3333
+ ref_key: "stageRef",
3334
+ ref: K,
3335
+ class: y([
3336
+ Q.stage,
3337
+ "ui-image-grid",
3338
+ P(A) === "original" ? "touch-pan-x touch-pan-y overflow-auto select-none" : "touch-pan-y overflow-hidden"
3339
+ ]),
3340
+ onClick: _t,
3341
+ onMousedown: ut,
3342
+ onTouchstart: mt,
3343
+ onTouchmove: ht,
3344
+ onTouchend: gt,
3345
+ onTouchcancel: pt
3346
+ }, [c("div", {
3347
+ class: y([P(A) === "original" ? Q.originalWrapper : Q.fitWrapper, "relative z-1"]),
3348
+ style: b(P(Fe)),
3349
+ onClick: _t
3350
+ }, [c("div", {
3351
+ style: b(P(Re)),
3352
+ class: "relative shrink-0"
3353
+ }, [P(J) ? te((C(), s("img", {
3354
+ ref_key: "imageRef",
3355
+ ref: se,
3356
+ key: P(J).src,
3357
+ src: P(Ce),
3358
+ alt: P(J).alt,
3359
+ style: b(P(ze)),
3360
+ class: y([
3361
+ "block select-none",
3362
+ P(A) === "original" ? P(Ne) ? P(H).tracking ? "cursor-grabbing" : "cursor-grab" : "cursor-zoom-out" : P(Me) ? "cursor-zoom-in" : "cursor-default",
3363
+ P(H).tracking ? "cursor-grabbing" : ""
3364
+ ]),
3365
+ decoding: "async",
3366
+ draggable: "false",
3367
+ onDragstart: i[1] ||= ne(() => {}, ["prevent"]),
3368
+ onLoad: ot,
3369
+ onClick: dt
3370
+ }, null, 46, xa)), [[ee, P(j)]]) : o("", !0)], 4), P(j) ? o("", !0) : (C(), s("div", {
3371
+ key: 0,
3372
+ class: y(Q.spinner)
3373
+ }, [d(ei)], 2))], 6)], 34)]),
3374
+ _: 1
3375
+ }, 8, ["active"]),
3376
+ P(Te) ? (C(), s("button", {
3377
+ key: 0,
3378
+ type: "button",
3379
+ class: y([Q.nav, "left-0"]),
3380
+ "aria-label": "Предыдущее изображение",
3381
+ onClick: $e
3382
+ }, [d(Y, {
3383
+ name: "chevron",
3384
+ class: "size-6 rotate-180"
3385
+ })], 2)) : o("", !0),
3386
+ P(Te) ? (C(), s("button", {
3387
+ key: 1,
3388
+ type: "button",
3389
+ class: y([Q.nav, "right-0"]),
3390
+ "aria-label": "Следующее изображение",
3391
+ onClick: et
3392
+ }, [d(Y, {
3393
+ name: "chevron",
3394
+ class: "size-6"
3395
+ })], 2)) : o("", !0)
3396
+ ]),
3397
+ c("div", { class: y(Q.bottom) }, [c("div", { class: y(Q.tools) }, [
3398
+ d(X, { tooltip: "Отразить горизонтально" }, {
3399
+ default: B(() => [c("button", {
3400
+ type: "button",
3401
+ class: y(Q.iconButton),
3402
+ "aria-label": "Отразить горизонтально",
3403
+ onClick: i[2] ||= (e) => at("x")
3404
+ }, [d(Y, {
3405
+ name: "flip-x",
3406
+ class: "size-4"
3407
+ })], 2)]),
3408
+ _: 1
3409
+ }),
3410
+ d(X, { tooltip: "Отразить вертикально" }, {
3411
+ default: B(() => [c("button", {
3412
+ type: "button",
3413
+ class: y(Q.iconButton),
3414
+ "aria-label": "Отразить вертикально",
3415
+ onClick: i[3] ||= (e) => at("y")
3416
+ }, [d(Y, {
3417
+ name: "flip-y",
3418
+ class: "size-4"
3419
+ })], 2)]),
3420
+ _: 1
3421
+ }),
3422
+ d(X, { tooltip: "Повернуть влево" }, {
3423
+ default: B(() => [c("button", {
3424
+ type: "button",
3425
+ class: y(Q.iconButton),
3426
+ "aria-label": "Повернуть влево",
3427
+ onClick: i[4] ||= (e) => it(-90)
3428
+ }, [d(Y, {
3429
+ name: "rotate-left",
3430
+ class: "size-4"
3431
+ })], 2)]),
3432
+ _: 1
3433
+ }),
3434
+ d(X, { tooltip: "Повернуть вправо" }, {
3435
+ default: B(() => [c("button", {
3436
+ type: "button",
3437
+ class: y(Q.iconButton),
3438
+ "aria-label": "Повернуть вправо",
3439
+ onClick: i[5] ||= (e) => it(90)
3440
+ }, [d(Y, {
3441
+ name: "rotate-right",
3442
+ class: "size-4"
3443
+ })], 2)]),
3444
+ _: 1
3445
+ })
3446
+ ], 2), P(Te) ? (C(), a(Lr, {
3447
+ key: 0,
3448
+ active: P(q),
3449
+ axis: "x"
3450
+ }, {
3451
+ default: B(() => [c("div", {
3452
+ ref_key: "thumbsRef",
3453
+ ref: ce,
3454
+ class: y(Q.thumbs)
3455
+ }, [c("div", { class: y(Q.thumbsRow) }, [(C(!0), s(n, null, O(P(_e), (e, t) => (C(), s("button", {
3456
+ key: `${e.src}:${t}`,
3457
+ type: "button",
3458
+ "data-thumb-index": t,
3459
+ "aria-label": `Открыть изображение ${t + 1}`,
3460
+ "aria-current": t === P(w) ? "true" : void 0,
3461
+ class: y([Q.thumb, t === P(w) ? "opacity-100" : ""]),
3462
+ onClick: (e) => Ye(t)
3463
+ }, [c("span", {
3464
+ class: y(["absolute inset-x-0 top-0 z-1 h-1", t === P(w) ? "bg-(--accent)" : "bg-transparent"]),
3465
+ "aria-hidden": "true"
3466
+ }, null, 2), c("img", {
3467
+ src: e.thumbnailSrc || e.src,
3468
+ alt: e.alt,
3469
+ class: y(Q.thumbImage),
3470
+ loading: "lazy",
3471
+ decoding: "async"
3472
+ }, null, 10, Ca)], 10, Sa))), 128))], 2)], 2)]),
3473
+ _: 1
3474
+ }, 8, ["active"])) : o("", !0)], 2)
3475
+ ], 10, ya)])) : o("", !0)], 64));
3476
+ }
3477
+ }), Ta = [
3478
+ "id",
3479
+ "disabled",
3480
+ "aria-invalid"
3481
+ ], Ea = { base: "box-border h-9 py-1 px-2 m-1 text-sm text-(--text-default) bg-(--default) hover:bg-(--default-hover)" }, Da = /* @__PURE__ */ f({
3482
+ __name: "SInput",
3483
+ props: /*@__PURE__*/ g({
3484
+ id: {},
3485
+ invalid: {
3486
+ type: Boolean,
3487
+ default: !1
3488
+ },
3489
+ disabled: {
3490
+ type: Boolean,
3491
+ default: !1
3492
+ }
3493
+ }, {
3494
+ modelValue: {},
3495
+ modelModifiers: {}
3496
+ }),
3497
+ emits: ["update:modelValue"],
3498
+ setup(e, { expose: t }) {
3499
+ let n = I(e, "modelValue"), r = m("field-context", null), a = m("fieldset-disabled", D(!1)), o = i(() => e.id || r?.id?.value || `input-${F()}`), c = i(() => !!(e.disabled || r?.disabled?.value || a.value)), l = i(() => [
3500
+ Ea.base,
3501
+ e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger)" : "ring-1 ring-(--border) focus:ring-2 focus:ring-(--accent)",
3502
+ c.value && "cursor-not-allowed opacity-50"
3503
+ ]), u = D(null);
3504
+ return t({ focus: () => u.value?.focus() }), (t, r) => te((C(), s("input", {
3505
+ id: P(o),
3506
+ ref_key: "inputRef",
3507
+ ref: u,
3508
+ "onUpdate:modelValue": r[0] ||= (e) => n.value = e,
3509
+ disabled: P(c),
3510
+ "aria-invalid": e.invalid || void 0,
3511
+ class: y(P(l))
3512
+ }, null, 10, Ta)), [[R, n.value]]);
3513
+ }
3514
+ }), Oa = { link: "text-(--link) hover:text-(--link-hover)" }, ka = /* @__PURE__ */ f({
3515
+ __name: "SLink",
3516
+ props: {
3517
+ to: {},
3518
+ label: { default: "" }
3519
+ },
3520
+ setup(e) {
3521
+ let t = sr();
3522
+ return (n, r) => (C(), a(j(P(t)), {
3523
+ class: y(Oa.link),
3524
+ to: e.to,
3525
+ href: P(t) === "a" ? e.to : void 0
3526
+ }, {
3527
+ default: B(() => [k(n.$slots, "default", {}, () => [u(M(e.label), 1)])]),
3528
+ _: 3
3529
+ }, 8, [
3530
+ "class",
3531
+ "to",
3532
+ "href"
3533
+ ]));
3534
+ }
3535
+ }), Aa = {
3536
+ list: "flex flex-col gap-1 pl-4 text-sm text-(--text-default)",
3537
+ listOl: "list-decimal",
3538
+ listUl: "list-disc",
3539
+ item: "leading-snug"
3540
+ }, ja = /* @__PURE__ */ f({
3541
+ __name: "SList",
3542
+ props: {
3543
+ items: {},
3544
+ tag: { default: "ul" }
3545
+ },
3546
+ setup(e) {
3547
+ let t = i(() => [Aa.list, e.tag === "ol" ? Aa.listOl : Aa.listUl]);
3548
+ return (r, i) => (C(), a(j(e.tag), { class: y(P(t)) }, {
3549
+ default: B(() => [(C(!0), s(n, null, O(e.items, (e, t) => (C(), s("li", {
3550
+ key: t,
3551
+ class: y(Aa.item)
3552
+ }, [k(r.$slots, "item", {
3553
+ item: e,
3554
+ index: t
3555
+ }, () => [u(M(e), 1)])], 2))), 128))]),
3556
+ _: 3
3557
+ }, 8, ["class"]));
3558
+ }
3559
+ }), Ma = { class: "mx-auto flex w-full max-w-4xl [scrollbar-width:none] items-center gap-1 overflow-x-auto px-4 sm:flex-wrap sm:overflow-visible sm:px-6 [&::-webkit-scrollbar]:hidden" }, Na = /* @__PURE__ */ f({
3560
+ __name: "SNav",
3561
+ props: { items: { default: () => [{
3562
+ to: "/",
3563
+ label: "начальная"
3564
+ }] } },
3565
+ setup(e) {
3566
+ let t = lr(), r = sr(), i = (e) => t.value === e || t.value.startsWith(`${e}/`), o = (e) => e.to === "/" ? t.value === "/" : i(e.to) ? !0 : (e.activePrefixes ?? []).some(i);
3567
+ return (t, i) => (C(), s("nav", Ma, [(C(!0), s(n, null, O(e.items, (e) => (C(), a(j(P(r)), {
3568
+ key: e.to,
3569
+ to: e.to,
3570
+ href: P(r) === "a" ? e.to : void 0,
3571
+ class: y(["shrink-0 rounded-full px-3 py-1 text-xs font-medium tracking-wider whitespace-nowrap uppercase transition-colors", o(e) ? "bg-current/5 text-(--text-default)" : "opacity-50 hover:bg-current/5 hover:opacity-90"])
3572
+ }, {
3573
+ default: B(() => [u(M(e.label), 1)]),
3574
+ _: 2
3575
+ }, 1032, [
3576
+ "to",
3577
+ "href",
3578
+ "class"
3579
+ ]))), 128))]));
3580
+ }
3581
+ }), Pa = { class: "flex items-start justify-between gap-3" }, Fa = { class: "min-w-0" }, Ia = {
3582
+ root: "fixed top-4 right-4 z-70 flex w-full max-w-sm flex-col gap-2",
3583
+ stack: "flex w-full flex-col gap-2",
3584
+ card: "rounded border border-(--border) bg-(--default) p-4 shadow-lg",
3585
+ title: "text-sm font-semibold",
3586
+ message: "text-sm opacity-80",
3587
+ success: "border-l-4 border-l-(--accent)",
3588
+ error: "border-l-4 border-l-(--danger)",
3589
+ info: "border-l-4 border-l-(--text-default)"
3590
+ }, La = /* @__PURE__ */ f({
3591
+ __name: "SNotification",
3592
+ props: {
3593
+ modelValue: {
3594
+ type: Boolean,
3595
+ default: !1
3596
+ },
3597
+ title: { default: "" },
3598
+ message: { default: "" },
3599
+ type: { default: "info" },
3600
+ duration: { default: 3e3 },
3601
+ floating: {
3602
+ type: Boolean,
3603
+ default: !0
3604
+ }
3605
+ },
3606
+ emits: ["update:modelValue"],
3607
+ setup(e, { emit: t }) {
3608
+ let n = e, l = t, u = i({
3609
+ get: () => n.modelValue,
3610
+ set: (e) => l("update:modelValue", e)
3611
+ }), d = null, f = () => {
3612
+ u.value = !1;
3613
+ }, p = () => {
3614
+ d !== null && window.clearTimeout(d), n.duration > 0 && (d = window.setTimeout(f, n.duration));
3615
+ };
3616
+ return z(() => n.modelValue, (e) => {
3617
+ e ? p() : d !== null && (window.clearTimeout(d), d = null);
3618
+ }, { immediate: !0 }), x(() => {
3619
+ d !== null && window.clearTimeout(d);
3620
+ }), (t, i) => P(u) ? (C(), a(r, {
3621
+ key: 0,
3622
+ to: "body",
3623
+ disabled: !n.floating
3624
+ }, [c("div", { class: y(n.floating ? Ia.root : Ia.stack) }, [c("div", { class: y([Ia.card, Ia[n.type]]) }, [c("div", Pa, [c("div", Fa, [e.title ? (C(), s("p", {
3625
+ key: 0,
3626
+ class: y(Ia.title)
3627
+ }, M(e.title), 3)) : o("", !0), e.message ? (C(), s("p", {
3628
+ key: 1,
3629
+ class: y(Ia.message)
3630
+ }, M(e.message), 3)) : o("", !0)]), c("button", {
3631
+ type: "button",
3632
+ class: "shrink-0 opacity-60 hover:opacity-100",
3633
+ "aria-label": "Закрыть",
3634
+ onClick: f
3635
+ }, " × ")])], 2)], 2)], 8, ["disabled"])) : o("", !0);
3636
+ }
3637
+ }), Ra = 4e3, za = 0, Ba = D([]), Va = () => {
3638
+ let e = (e) => {
3639
+ Ba.value = Ba.value.filter((t) => t.id !== e);
3640
+ }, t = (e) => {
3641
+ let t = ++za;
3642
+ return Ba.value = [...Ba.value, {
3643
+ duration: Ra,
3644
+ ...e,
3645
+ id: t
3646
+ }], t;
3647
+ };
3648
+ return {
3649
+ items: i(() => Ba.value),
3650
+ push: t,
3651
+ dismiss: e,
3652
+ success: (e, n) => t({
3653
+ type: "success",
3654
+ title: e,
3655
+ message: n
3656
+ }),
3657
+ error: (e, n) => t({
3658
+ type: "error",
3659
+ title: e,
3660
+ message: n,
3661
+ duration: 6e3
3662
+ }),
3663
+ info: (e, n) => t({
3664
+ type: "info",
3665
+ title: e,
3666
+ message: n
3667
+ })
3668
+ };
3669
+ }, Ha = { class: "pointer-events-none fixed top-4 right-4 z-70 flex w-[calc(100%-2rem)] max-w-sm flex-col gap-2" }, Ua = /* @__PURE__ */ f({
3670
+ __name: "SNotificationHost",
3671
+ setup(e) {
3672
+ let { items: t, dismiss: i } = Va();
3673
+ return (e, o) => (C(), a(r, { to: "body" }, [c("div", Ha, [(C(!0), s(n, null, O(P(t), (e) => (C(), s("div", {
3674
+ key: e.id,
3675
+ class: "pointer-events-auto"
3676
+ }, [d(La, {
3677
+ "model-value": !0,
3678
+ title: e.title,
3679
+ message: e.message,
3680
+ type: e.type,
3681
+ duration: e.duration,
3682
+ floating: !1,
3683
+ "onUpdate:modelValue": (t) => P(i)(e.id)
3684
+ }, null, 8, [
3685
+ "title",
3686
+ "message",
3687
+ "type",
3688
+ "duration",
3689
+ "onUpdate:modelValue"
3690
+ ])]))), 128))])]));
3691
+ }
3692
+ }), Wa = /* @__PURE__ */ f({
3693
+ __name: "SSpoiler",
3694
+ props: /*@__PURE__*/ g({ label: { default: "Подробнее" } }, {
3695
+ modelValue: {
3696
+ type: Boolean,
3697
+ default: !1
3698
+ },
3699
+ modelModifiers: {}
3700
+ }),
3701
+ emits: ["update:modelValue"],
3702
+ setup(e) {
3703
+ let t = I(e, "modelValue");
3704
+ return (n, r) => (C(), s("div", null, [c("button", {
3705
+ type: "button",
3706
+ class: "flex items-center gap-1 text-left text-(--link) hover:text-(--link-hover)",
3707
+ onClick: r[0] ||= (e) => t.value = !t.value
3708
+ }, [d(Y, {
3709
+ name: "chevron",
3710
+ class: y(["size-4 transition-transform duration-100", t.value && "rotate-90"])
3711
+ }, null, 8, ["class"]), c("span", null, M(e.label), 1)]), te(c("div", null, [k(n.$slots, "default")], 512), [[ee, t.value]])]));
3712
+ }
3713
+ }), Ga = {
3714
+ Tightest: "tightest",
3715
+ Tight: "tight",
3716
+ Normal: "normal",
3717
+ Wide: "wide",
3718
+ Widest: "widest"
3719
+ }, Ka = {
3720
+ Xs: "text-xs",
3721
+ Sm: "text-sm",
3722
+ Base: "text-base",
3723
+ Lg: "text-lg",
3724
+ Xl: "text-xl"
3725
+ }, qa = {
3726
+ Inherit: "text-inherit",
3727
+ Default: "text-(--text-default)",
3728
+ Accent: "text-(--accent)",
3729
+ Muted: "opacity-60"
3730
+ }, Ja = { container: "text-shadow-xs/80 font-light font-mono uppercase flex w-full justify-center" }, Ya = /* @__PURE__ */ f({
3731
+ __name: "STextSpans",
3732
+ props: {
3733
+ text: {},
3734
+ gap: { default: () => Ga.Wide },
3735
+ textSize: { default: () => Ka.Xs },
3736
+ textColor: { default: () => qa.Inherit }
3737
+ },
3738
+ setup(e) {
3739
+ let t = i(() => e.text.trim()), r = {
3740
+ [Ga.Tightest]: "gap-1",
3741
+ [Ga.Tight]: "gap-2",
3742
+ [Ga.Normal]: "gap-3",
3743
+ [Ga.Wide]: "gap-6",
3744
+ [Ga.Widest]: "gap-8"
3745
+ }, a = i(() => [
3746
+ Ja.container,
3747
+ e.textSize,
3748
+ e.textColor,
3749
+ r[e.gap]
3750
+ ]);
3751
+ return (e, r) => (C(), s("div", { class: y(P(a)) }, [(C(!0), s(n, null, O(P(t), (e, t) => (C(), s("span", { key: t }, M(e), 1))), 128))], 2));
3752
+ }
3753
+ }), Xa = [
3754
+ "id",
3755
+ "rows",
3756
+ "aria-invalid"
3757
+ ], Za = { textarea: "max-w-full resize bg-(--default) m-1 p-2 px-3 text-sm text-(--text-default) disabled:cursor-not-allowed disabled:opacity-50" }, Qa = /* @__PURE__ */ f({
3758
+ __name: "STextarea",
3759
+ props: /*@__PURE__*/ g({
3760
+ id: {},
3761
+ rows: { default: 3 },
3762
+ invalid: {
3763
+ type: Boolean,
3764
+ default: !1
3765
+ }
3766
+ }, {
3767
+ modelValue: { default: "" },
3768
+ modelModifiers: {}
3769
+ }),
3770
+ emits: ["update:modelValue"],
3771
+ setup(e) {
3772
+ let t = m("field-id", void 0), n = i(() => e.id || t || `textarea-${F()}`), r = I(e, "modelValue"), a = i(() => [Za.textarea, e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger)" : "ring-1 ring-(--border) focus:ring-2 focus:ring-(--accent)"]);
3773
+ return (t, i) => te((C(), s("textarea", {
3774
+ id: P(n),
3775
+ "onUpdate:modelValue": i[0] ||= (e) => r.value = e,
3776
+ rows: e.rows,
3777
+ "aria-invalid": e.invalid || void 0,
3778
+ class: y(P(a))
3779
+ }, null, 10, Xa)), [[R, r.value]]);
3780
+ }
3781
+ }), $a = ["for"], eo = [
3782
+ "id",
3783
+ "name",
3784
+ "disabled"
3785
+ ], to = {
3786
+ label: "relative inline-flex w-fit items-center gap-2 text-sm select-none",
3787
+ track: "ui-focus-peer relative h-4 w-7 shrink-0 rounded-full border-2 transition-colors duration-200",
3788
+ thumb: "absolute -top-0.5 -left-0.5 size-4 rounded-full border-2 transition-transform duration-200",
3789
+ text: "text-nowrap text-(--text-default)"
3790
+ }, no = /* @__PURE__ */ f({
3791
+ __name: "SToggle",
3792
+ props: /*@__PURE__*/ g({
3793
+ id: {},
3794
+ name: {},
3795
+ label: {},
3796
+ disabled: {
3797
+ type: Boolean,
3798
+ default: !1
3799
+ }
3800
+ }, {
3801
+ modelValue: {
3802
+ type: Boolean,
3803
+ default: !1
3804
+ },
3805
+ modelModifiers: {}
3806
+ }),
3807
+ emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
3808
+ setup(e, { emit: t, slots: n }) {
3809
+ let r = I(e, "modelValue"), a = t, l = m("field-id", void 0), d = i(() => e.id || l || `toggle-${F()}`), f = (e) => {
3810
+ a("change", e);
3811
+ }, p = i(() => [to.label, e.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"]), h = i(() => [to.track, r.value ? "border-(--accent) bg-(--accent)" : "border-white/40 bg-(--toggle-off-bg)"]), g = i(() => [to.thumb, r.value ? "translate-x-3 border-(--accent) bg-(--bg-default)" : "translate-x-0 border-transparent bg-white"]);
3812
+ return (t, i) => (C(), s("label", {
3813
+ for: P(d),
3814
+ class: y(P(p))
3815
+ }, [
3816
+ te(c("input", {
3817
+ id: P(d),
3818
+ name: e.name,
3819
+ type: "checkbox",
3820
+ class: "peer sr-only",
3821
+ "onUpdate:modelValue": i[0] ||= (e) => r.value = e,
3822
+ disabled: e.disabled,
3823
+ onChange: f
3824
+ }, null, 40, eo), [[L, r.value]]),
3825
+ c("span", {
3826
+ "aria-hidden": "true",
3827
+ class: y(P(h))
3828
+ }, [c("span", { class: y(P(g)) }, null, 2)], 2),
3829
+ e.label || n.default ? (C(), s("span", {
3830
+ key: 0,
3831
+ class: y(to.text)
3832
+ }, [k(t.$slots, "default", {}, () => [u(M(e.label), 1)])], 2)) : o("", !0)
3833
+ ], 10, $a));
3834
+ }
3835
+ }), ro = ["aria-label"], io = [
3836
+ "aria-label",
3837
+ "aria-expanded",
3838
+ "onClick"
3839
+ ], ao = {
3840
+ key: 1,
3841
+ class: "size-4 shrink-0"
3842
+ }, $ = {
3843
+ root: "flex min-w-0 flex-col items-start",
3844
+ header: "flex w-full min-w-0 items-center gap-2",
3845
+ title: "min-w-0 text-base font-semibold wrap-break-word",
3846
+ collapseBtn: "flex size-6 shrink-0 items-center justify-center rounded-full text-(--accent) hover:bg-(--elevated) outline-none focus-visible:ring-2 focus-visible:ring-(--accent) transition-colors cursor-pointer",
3847
+ collapseIcon: "size-4 pointer-events-none",
3848
+ list: "flex w-full min-w-0 flex-col gap-x-1",
3849
+ row: "group flex h-4 min-w-0 items-start gap-2",
3850
+ number: "h-4 shrink-0 text-right text-xs leading-4 text-(--text-default) tabular-nums",
3851
+ toggleBtn: "flex size-4 shrink-0 items-center justify-center rounded-full text-(--accent) hover:bg-(--elevated) outline-none focus-visible:ring-2 focus-visible:ring-(--accent) transition-colors cursor-pointer",
3852
+ toggleDisabled: "pointer-events-none opacity-0",
3853
+ toggleIcon: "size-4 pointer-events-none transition-transform duration-100",
3854
+ toggleIconActive: "rotate-90",
3855
+ itemBtn: "flex h-4 min-w-0 items-start text-base leading-4 outline-none focus-visible:ring-2 focus-visible:ring-(--accent) cursor-pointer group-hover:text-(--accent) transition-colors",
3856
+ itemLeaf: "flex h-4 min-w-0 items-start text-base leading-4",
3857
+ depth: "flex size-4 shrink-0 justify-start",
3858
+ depthLine: "h-4 w-px bg-(--text-default)",
3859
+ depthLineHover: "group-hover:bg-(--accent)",
3860
+ text: "text-sm h-4 self-start overflow-hidden leading-4 wrap-break-word"
3861
+ }, oo = /* @__PURE__ */ f({
3862
+ __name: "STree",
3863
+ props: {
3864
+ items: { default: () => [] },
3865
+ h: { default: "" }
3866
+ },
3867
+ setup(e) {
3868
+ let t = D(/* @__PURE__ */ new Set()), r = (e) => typeof e == "string" ? e : e.text, l = (e) => typeof e == "string" ? [] : e.children || [], u = i(() => {
3869
+ let n = [], i = 0, a = (e, o = 0, s = "", c = !0) => {
3870
+ e.forEach((e, u) => {
3871
+ let d = s ? `${s}.${u}` : String(u), f = l(e);
3872
+ i += 1, c && n.push({
3873
+ id: d,
3874
+ number: i,
3875
+ text: r(e),
3876
+ depth: o,
3877
+ children: f
3878
+ }), a(f, o + 1, d, c && t.value.has(d));
3879
+ });
3880
+ };
3881
+ return a(e.items), n;
3882
+ }), f = i(() => {
3883
+ let t = [], n = (e, r = "") => {
3884
+ e.forEach((e, i) => {
3885
+ let a = r ? `${r}.${i}` : String(i), o = l(e);
3886
+ o.length && (t.push(a), n(o, a));
3887
+ });
3888
+ };
3889
+ return n(e.items), t;
3890
+ }), p = i(() => {
3891
+ let t = 0, n = (e) => {
3892
+ e.forEach((e) => {
3893
+ t += 1, n(l(e));
3894
+ });
3895
+ };
3896
+ return n(e.items), t;
3897
+ }), m = i(() => `${Math.max(2, String(p.value).length)}ch`), h = i(() => f.value.length > 0), g = i(() => h.value && f.value.every((e) => t.value.has(e))), _ = i(() => g.value ? "Свернуть всё" : "Развернуть всё"), v = (e) => t.value.has(e), x = (e) => {
3898
+ e.children.length && (t.value.has(e.id) ? t.value.delete(e.id) : t.value.add(e.id));
3899
+ }, S = () => {
3900
+ t.value = g.value ? /* @__PURE__ */ new Set() : new Set(f.value);
3901
+ };
3902
+ return (r, i) => (C(), s("div", { class: y($.root) }, [e.h || P(h) ? (C(), s("div", {
3903
+ key: 0,
3904
+ class: y($.header)
3905
+ }, [e.h ? (C(), s("h2", {
3906
+ key: 0,
3907
+ class: y($.title)
3908
+ }, M(e.h), 3)) : o("", !0), P(h) ? (C(), a(X, {
3909
+ key: 1,
3910
+ tooltip: P(_)
3911
+ }, {
3912
+ default: B(() => [c("button", {
3913
+ type: "button",
3914
+ "aria-label": P(_),
3915
+ class: y($.collapseBtn),
3916
+ onClick: S
3917
+ }, [d(Y, {
3918
+ name: P(g) ? "collapse" : "expand",
3919
+ class: y($.collapseIcon)
3920
+ }, null, 8, ["name", "class"])], 10, ro)]),
3921
+ _: 1
3922
+ }, 8, ["tooltip"])) : o("", !0)], 2)) : o("", !0), c("div", { class: y($.list) }, [(C(!0), s(n, null, O(P(u), (e) => (C(), s("div", {
3923
+ key: e.id,
3924
+ class: y($.row)
3925
+ }, [
3926
+ c("span", {
3927
+ class: y($.number),
3928
+ style: b({ width: P(m) })
3929
+ }, M(e.number), 7),
3930
+ P(h) ? (C(), s(n, { key: 0 }, [e.children.length ? (C(), s("button", {
3931
+ key: 0,
3932
+ type: "button",
3933
+ tabindex: "-1",
3934
+ class: y($.toggleBtn),
3935
+ "aria-label": P(t).has(e.id) ? "Свернуть" : "Раскрыть",
3936
+ "aria-expanded": P(t).has(e.id),
3937
+ onClick: (t) => x(e)
3938
+ }, [d(Y, {
3939
+ name: "chevron",
3940
+ class: y([$.toggleIcon, v(e.id) && $.toggleIconActive])
3941
+ }, null, 8, ["class"])], 10, io)) : (C(), s("span", ao))], 64)) : o("", !0),
3942
+ (C(), a(j(e.children.length ? "button" : "div"), {
3943
+ type: e.children.length ? "button" : void 0,
3944
+ class: y(e.children.length ? $.itemBtn : $.itemLeaf),
3945
+ onClick: (t) => e.children.length && x(e)
3946
+ }, {
3947
+ default: B(() => [(C(!0), s(n, null, O(e.depth, (t) => (C(), s("span", {
3948
+ key: t,
3949
+ class: y($.depth)
3950
+ }, [c("span", { class: y([$.depthLine, t === e.depth && $.depthLineHover]) }, null, 2)], 2))), 128)), c("span", { class: y($.text) }, M(e.text), 3)]),
3951
+ _: 2
3952
+ }, 1032, [
3953
+ "type",
3954
+ "class",
3955
+ "onClick"
3956
+ ]))
3957
+ ], 2))), 128))], 2)], 2));
3958
+ }
3959
+ }), so = (e) => typeof e == "string" ? e.trim().replace(/^\/+/, "").replace(/\\/g, "/") : "", co = (t) => {
3960
+ let n = so(t);
3961
+ if (!n) return "";
3962
+ let r = e().mediaBasePath || "/api/media/files", i = n.split("/").map((e) => encodeURIComponent(e)).join("/");
3963
+ return `${r.replace(/\/+$/, "")}/${i}`;
3964
+ }, lo = so;
3965
+ export { br as BtnState, le as SAppShell, pr as SAsideNav, yr as SAvatar, Sr as SBtn, Dr as SCheckbox, jr as SCopy, Qr as SCropper, oi as SDataTable, na as SDateTimePicker, di as SDatetime, li as SDatetimeView, ia as SDocMarkdown, oa as SField, ua as SFile, ha as SGradation, Y as SIcon, wa as SImage, Da as SInput, ka as SLink, ja as SList, ei as SLoad, Na as SNav, La as SNotification, Ua as SNotificationHost, Fr as SRange, Lr as SScrollableEdges, Kr as SSelect, Wa as SSpoiler, Ya as STextSpans, Qa as STextarea, no as SToggle, X as STooltip, oo as STree, qa as TextColor, Ga as TextGap, Ka as TextSize, Ai as allTimeZoneOptions, Si as clampDateTimePickerParts, xi as compareDateOnly, sa as countForm, vi as dateToPickerParts, Ci as formatDateTimePickerDisplay, ci as getFormatter, ir as iconNames, rr as icons, ki as localTimeZone, co as mediaFileSrc, lo as normalizeMediaKey, gi as parseDateTimePickerModel, hr as provideSindeUser, Di as resolveDateTimePickerLocale, _i as serializeDateTimePickerModel, t as setSindeUiConfig, Or as useClipboard, sr as useLinkComponent, Va as useNotifications, zr as useOpenSelect, lr as useOptionalRoutePath, cr as useOptionalRouter, e as useSindeUiConfig, gr as useSindeUser };