@gkucmierz/nano-ui 1.2.2 → 1.4.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.
package/dist/nano-ui.js CHANGED
@@ -1,120 +1,218 @@
1
- import { Teleport as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onUnmounted as f, openBlock as p, reactive as m, ref as h, renderSlot as g, resolveDirective as _, toDisplayString as v, unref as y, watch as b, withCtx as x, withDirectives as S, withKeys as C, withModifiers as w } from "vue";
1
+ import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onMounted as p, onUnmounted as m, openBlock as h, reactive as g, ref as _, renderList as v, renderSlot as y, resolveDirective as b, toDisplayString as x, unref as S, watch as C, withCtx as w, withDirectives as T, withKeys as E, withModifiers as D } from "vue";
2
+ //#region node_modules/@gkucmierz/analytics/dist/analytics.js
3
+ var O = new class {
4
+ constructor() {
5
+ this.appId = null, this.serverUrl = null, this.sessionId = null, this.isRealUser = !1, this.sessionActive = !1, this.eventQueue = [], this.botFlags = [];
6
+ }
7
+ init(e, t) {
8
+ this.appId = e, this.serverUrl = t || "", this.checkBotStatus(), this.sessionId = sessionStorage.getItem("analytics_session_id"), this.sessionId || (this.sessionId = this.uuidv4(), sessionStorage.setItem("analytics_session_id", this.sessionId)), sessionStorage.getItem("analytics_session_active") === "true" ? (this.isRealUser = !0, this.activateSession()) : this.setupInteractionListeners(), this.track("pageview", {
9
+ path: window.location.pathname,
10
+ referrer: document.referrer
11
+ }), this.setupUnloadTracking();
12
+ }
13
+ checkBotStatus() {
14
+ typeof navigator > "u" || (navigator.webdriver && this.botFlags.push("webdriver"), window.outerWidth === 0 && window.outerHeight === 0 && this.botFlags.push("zero-dimensions"), /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !window.chrome && this.botFlags.push("missing-chrome-object"), !/Mobi|Android|iPhone|iPad/i.test(navigator.userAgent) && (!navigator.plugins || navigator.plugins.length === 0) && this.botFlags.push("no-plugins-on-desktop"));
15
+ }
16
+ setupInteractionListeners() {
17
+ let e = () => {
18
+ this.isRealUser || (this.isRealUser = !0, sessionStorage.setItem("analytics_session_active", "true"), this.activateSession(), t());
19
+ }, t = () => {
20
+ window.removeEventListener("mousemove", e), window.removeEventListener("keydown", e), window.removeEventListener("scroll", e), window.removeEventListener("touchstart", e);
21
+ };
22
+ window.addEventListener("mousemove", e, {
23
+ once: !0,
24
+ passive: !0
25
+ }), window.addEventListener("keydown", e, {
26
+ once: !0,
27
+ passive: !0
28
+ }), window.addEventListener("scroll", e, {
29
+ once: !0,
30
+ passive: !0
31
+ }), window.addEventListener("touchstart", e, {
32
+ once: !0,
33
+ passive: !0
34
+ }), setTimeout(() => {
35
+ this.isRealUser || (this.botFlags.push("no-interaction-timeout"), this.activateSession(!0));
36
+ }, 8e3);
37
+ }
38
+ activateSession(e = !1) {
39
+ if (this.sessionActive) return;
40
+ this.sessionActive = !0;
41
+ let t = {
42
+ sessionId: this.sessionId,
43
+ appId: this.appId,
44
+ userAgent: navigator.userAgent,
45
+ screenWidth: window.screen.width,
46
+ screenHeight: window.screen.height,
47
+ isBot: e || this.botFlags.length > 0 ? 1 : 0,
48
+ botFlags: this.botFlags.join(","),
49
+ startedAt: (/* @__PURE__ */ new Date()).toISOString()
50
+ };
51
+ this.send("/api/session", t);
52
+ let n = [...this.eventQueue];
53
+ this.eventQueue = [], n.forEach((e) => {
54
+ this.send("/api/event", e);
55
+ });
56
+ }
57
+ track(e, t = {}) {
58
+ let n = {
59
+ sessionId: this.sessionId,
60
+ eventType: e === "pageview" ? "pageview" : "custom",
61
+ eventName: e,
62
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
63
+ metaData: JSON.stringify(t)
64
+ };
65
+ this.sessionActive ? this.send("/api/event", n) : this.eventQueue.push(n);
66
+ }
67
+ send(e, t) {
68
+ if (!this.serverUrl) return;
69
+ let n = `${this.serverUrl}${e}`, r = JSON.stringify(t);
70
+ try {
71
+ if (navigator.sendBeacon) {
72
+ let e = new Blob([r], { type: "application/json" });
73
+ navigator.sendBeacon(n, e);
74
+ } else fetch(n, {
75
+ method: "POST",
76
+ headers: { "Content-Type": "application/json" },
77
+ body: r,
78
+ keepalive: !0
79
+ }).catch(() => {});
80
+ } catch {}
81
+ }
82
+ setupUnloadTracking() {
83
+ let e = Date.now();
84
+ window.addEventListener("visibilitychange", () => {
85
+ if (document.visibilityState === "hidden") {
86
+ let t = Math.round((Date.now() - e) / 1e3);
87
+ this.track("session_duration", { duration: t });
88
+ }
89
+ });
90
+ }
91
+ uuidv4() {
92
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
93
+ var t = Math.random() * 16 | 0;
94
+ return (e == "x" ? t : t & 3 | 8).toString(16);
95
+ });
96
+ }
97
+ }();
98
+ typeof window < "u" && (window.Analytics = O);
99
+ //#endregion
2
100
  //#region src/directives/ripple.js
3
- var T = { mounted(e, t) {
101
+ var k = { mounted(e, t) {
4
102
  e.style.position = "relative", e.style.overflow = "hidden", e.addEventListener("click", function(n) {
5
103
  let r = e.getBoundingClientRect(), i = n.clientX - r.left, a = n.clientY - r.top, o = document.createElement("span"), s = Math.max(r.width, r.height), c = s / 2;
6
104
  o.style.width = o.style.height = `${s}px`, o.style.left = `${i - c}px`, o.style.top = `${a - c}px`, o.classList.add("ripple"), t.value && typeof t.value == "string" && (o.style.backgroundColor = t.value), e.appendChild(o), setTimeout(() => {
7
105
  o.remove();
8
106
  }, 600);
9
107
  });
10
- } }, E = m({
108
+ } }, A = g({
11
109
  isVisible: !1,
12
110
  text: "",
13
111
  customClass: "",
14
112
  targetRect: null
15
113
  });
16
- function D(e, t) {
114
+ function j(e, t) {
17
115
  if (!t) return;
18
116
  let n = typeof t == "object" ? t.text : t, r = typeof t == "object" && t.class || "";
19
117
  if (!n) return;
20
118
  e.hasAttribute("aria-label") || e.setAttribute("aria-label", n);
21
119
  let i = e.getBoundingClientRect();
22
- E.targetRect = {
120
+ A.targetRect = {
23
121
  top: i.top,
24
122
  left: i.left,
25
123
  width: i.width,
26
124
  bottom: i.bottom,
27
125
  right: i.right
28
- }, E.text = n, E.customClass = r, E.isVisible = !0;
126
+ }, A.text = n, A.customClass = r, A.isVisible = !0;
29
127
  }
30
- typeof window < "u" && window.addEventListener("scroll", O, {
128
+ typeof window < "u" && window.addEventListener("scroll", M, {
31
129
  passive: !0,
32
130
  capture: !0
33
131
  });
34
- function O() {
35
- E.isVisible = !1;
132
+ function M() {
133
+ A.isVisible = !1;
36
134
  }
37
135
  //#endregion
38
136
  //#region src/directives/tooltip.js
39
- var k = {
137
+ var N = {
40
138
  mounted(e, t) {
41
139
  e._tooltipOptions = t.value;
42
140
  let n = null, r = !1;
43
141
  e._handleMouseEnter = () => {
44
- r || D(e, e._tooltipOptions);
142
+ r || j(e, e._tooltipOptions);
45
143
  }, e._handleMouseLeave = () => {
46
- r || O();
144
+ r || M();
47
145
  }, e._handleFocus = () => {
48
- r || D(e, e._tooltipOptions);
146
+ r || j(e, e._tooltipOptions);
49
147
  }, e._handleBlur = () => {
50
- r || O();
148
+ r || M();
51
149
  }, e._handleTouchStart = () => {
52
150
  r = !0, n && clearTimeout(n), n = setTimeout(() => {
53
- D(e, e._tooltipOptions);
151
+ j(e, e._tooltipOptions);
54
152
  }, 400);
55
153
  }, e._handleTouchEnd = () => {
56
- n && clearTimeout(n), O(), setTimeout(() => {
154
+ n && clearTimeout(n), M(), setTimeout(() => {
57
155
  r = !1;
58
156
  }, 500);
59
157
  }, e._handleTouchCancel = () => {
60
- n && clearTimeout(n), O(), setTimeout(() => {
158
+ n && clearTimeout(n), M(), setTimeout(() => {
61
159
  r = !1;
62
160
  }, 500);
63
161
  }, e._handleContextMenu = (t) => {
64
162
  let n = typeof e._tooltipOptions == "object" ? e._tooltipOptions.text : e._tooltipOptions;
65
- r && E.isVisible && E.text === n && t.preventDefault();
163
+ r && A.isVisible && A.text === n && t.preventDefault();
66
164
  }, e.addEventListener("mouseenter", e._handleMouseEnter), e.addEventListener("mouseleave", e._handleMouseLeave), e.addEventListener("focus", e._handleFocus), e.addEventListener("blur", e._handleBlur), e.addEventListener("touchstart", e._handleTouchStart, { passive: !0 }), e.addEventListener("touchend", e._handleTouchEnd), e.addEventListener("touchmove", e._handleTouchCancel, { passive: !0 }), e.addEventListener("touchcancel", e._handleTouchCancel), e.addEventListener("contextmenu", e._handleContextMenu);
67
165
  },
68
166
  updated(e, t) {
69
167
  e._tooltipOptions = t.value;
70
168
  let n = typeof t.value == "object" ? t.value.text : t.value;
71
- E.isVisible && E.text !== n && (e.matches(":hover") || document.activeElement === e) && D(e, t.value);
169
+ A.isVisible && A.text !== n && (e.matches(":hover") || document.activeElement === e) && j(e, t.value);
72
170
  },
73
171
  unmounted(e) {
74
- e._handleMouseEnter && (e.removeEventListener("mouseenter", e._handleMouseEnter), e.removeEventListener("mouseleave", e._handleMouseLeave), e.removeEventListener("focus", e._handleFocus), e.removeEventListener("blur", e._handleBlur), e.removeEventListener("touchstart", e._handleTouchStart), e.removeEventListener("touchend", e._handleTouchEnd), e.removeEventListener("touchmove", e._handleTouchCancel), e.removeEventListener("touchcancel", e._handleTouchCancel), e.removeEventListener("contextmenu", e._handleContextMenu)), O();
172
+ e._handleMouseEnter && (e.removeEventListener("mouseenter", e._handleMouseEnter), e.removeEventListener("mouseleave", e._handleMouseLeave), e.removeEventListener("focus", e._handleFocus), e.removeEventListener("blur", e._handleBlur), e.removeEventListener("touchstart", e._handleTouchStart), e.removeEventListener("touchend", e._handleTouchEnd), e.removeEventListener("touchmove", e._handleTouchCancel), e.removeEventListener("touchcancel", e._handleTouchCancel), e.removeEventListener("contextmenu", e._handleContextMenu)), M();
75
173
  }
76
- }, A = /* @__PURE__ */ ((e, t) => {
174
+ }, P = (e, t) => {
77
175
  let n = e.__vccOpts || e;
78
176
  for (let [e, r] of t) n[e] = r;
79
177
  return n;
80
- })({
178
+ }, F = /* @__PURE__ */ P({
81
179
  __name: "GlobalTooltip",
82
180
  setup(e) {
83
- let t = h(null), n = h(0), r = h(0), i = h(0), o = h(!1);
84
- return b(() => E.isVisible, async (e) => {
181
+ let t = _(null), n = _(0), r = _(0), i = _(0), a = _(!1);
182
+ return C(() => A.isVisible, async (e) => {
85
183
  if (e) {
86
- if (await l(), !t.value || !E.targetRect) return;
87
- let e = E.targetRect, a = t.value.getBoundingClientRect(), s = window.innerWidth, c = window.innerHeight, u = e.top, d = c - e.bottom, f = e.top - a.height - 8;
88
- o.value = !1, (f < 8 || u < a.height + 8 && d > u) && (f = e.bottom + 8, o.value = !0), f + a.height > c - 8 && (f = c - a.height - 8), f < 8 && (f = 8);
89
- let p = e.left + e.width / 2, m = p - a.width / 2;
90
- m < 8 ? m = 8 : m + a.width > s - 8 && (m = s - a.width - 8);
91
- let h = p - (m + a.width / 2), g = a.width / 2 - 12;
184
+ if (await u(), !t.value || !A.targetRect) return;
185
+ let e = A.targetRect, o = t.value.getBoundingClientRect(), s = window.innerWidth, c = window.innerHeight, l = e.top, d = c - e.bottom, f = e.top - o.height - 8;
186
+ a.value = !1, (f < 8 || l < o.height + 8 && d > l) && (f = e.bottom + 8, a.value = !0), f + o.height > c - 8 && (f = c - o.height - 8), f < 8 && (f = 8);
187
+ let p = e.left + e.width / 2, m = p - o.width / 2;
188
+ m < 8 ? m = 8 : m + o.width > s - 8 && (m = s - o.width - 8);
189
+ let h = p - (m + o.width / 2), g = o.width / 2 - 12;
92
190
  h > g && (h = g), h < -g && (h = -g), i.value = h, n.value = m, r.value = f;
93
191
  }
94
- }), (e, s) => (p(), a("div", {
192
+ }), (e, s) => (h(), o("div", {
95
193
  ref_key: "tooltipRef",
96
194
  ref: t,
97
- class: u([
195
+ class: d([
98
196
  "global-tooltip",
99
197
  {
100
- visible: y(E).isVisible,
101
- "tooltip-bottom": o.value
198
+ visible: S(A).isVisible,
199
+ "tooltip-bottom": a.value
102
200
  },
103
- y(E).customClass
201
+ S(A).customClass
104
202
  ]),
105
- style: d({
203
+ style: f({
106
204
  transform: `translate(${n.value}px, ${r.value}px)`,
107
205
  "--arrow-offset": `${i.value}px`
108
206
  })
109
- }, v(y(E).text), 7));
207
+ }, x(S(A).text), 7));
110
208
  }
111
- }, [["__scopeId", "data-v-37c91a21"]]), ee = { class: "nano-modal-title" }, te = {
209
+ }, [["__scopeId", "data-v-37c91a21"]]), I = { class: "nano-modal-title" }, L = {
112
210
  key: 1,
113
211
  class: "nano-modal-body"
114
- }, j = {
212
+ }, R = {
115
213
  key: 2,
116
214
  class: "nano-modal-footer"
117
- }, M = { class: "nano-modal-actions" }, N = {
215
+ }, z = { class: "nano-modal-actions" }, B = {
118
216
  __name: "NanoModal",
119
217
  props: {
120
218
  visible: {
@@ -195,80 +293,80 @@ var k = {
195
293
  "ok",
196
294
  "cancel"
197
295
  ],
198
- setup(m, { emit: y }) {
199
- let T = m, E = y, D = h(null), O = h(null), k = h(null), A = h(null), N = h(null), P = h(null), F = h(!1), I = h(!1), L = 0, R = 0, z = 0, B = 0, V = 0, H = 0, U = 0, W = 0, G = n(() => {
296
+ setup(e, { emit: p }) {
297
+ let g = e, v = p, S = _(null), O = _(null), k = _(null), A = _(null), j = _(null), M = _(null), N = _(!1), P = _(!1), F = 0, B = 0, ee = 0, te = 0, V = 0, ne = 0, re = 0, ie = 0, ae = r(() => {
200
298
  let e = {};
201
- return N.value === null ? (e.maxWidth = typeof T.width == "number" ? `${T.width}px` : T.width, e.width = "100%") : (e.width = `${N.value}px`, e.maxWidth = "none"), P.value === null ? T.height !== "auto" && (e.height = typeof T.height == "number" ? `${T.height}px` : T.height) : (e.height = `${P.value}px`, e.maxHeight = "none"), k.value !== null && A.value !== null && (e.position = "absolute", e.left = `${k.value}px`, e.top = `${A.value}px`, e.transform = "none", e.margin = "0"), e;
202
- }), K = (e) => {
203
- if (T.draggable && !(e.target.tagName === "BUTTON" || e.target.closest("button"))) {
204
- if (F.value = !0, L = e.clientX, R = e.clientY, k.value === null) {
299
+ return j.value === null ? (e.maxWidth = typeof g.width == "number" ? `${g.width}px` : g.width, e.width = "100%") : (e.width = `${j.value}px`, e.maxWidth = "none"), M.value === null ? g.height !== "auto" && (e.height = typeof g.height == "number" ? `${g.height}px` : g.height) : (e.height = `${M.value}px`, e.maxHeight = "none"), k.value !== null && A.value !== null && (e.position = "absolute", e.left = `${k.value}px`, e.top = `${A.value}px`, e.transform = "none", e.margin = "0"), e;
300
+ }), oe = (e) => {
301
+ if (g.draggable && !(e.target.tagName === "BUTTON" || e.target.closest("button"))) {
302
+ if (N.value = !0, F = e.clientX, B = e.clientY, k.value === null) {
205
303
  let e = O.value.getBoundingClientRect();
206
- k.value = e.left, A.value = e.top, N.value === null && (N.value = e.width), P.value === null && (P.value = e.height);
304
+ k.value = e.left, A.value = e.top, j.value === null && (j.value = e.width), M.value === null && (M.value = e.height);
207
305
  }
208
- z = k.value, B = A.value, window.addEventListener("mousemove", q), window.addEventListener("mouseup", J);
306
+ ee = k.value, te = A.value, window.addEventListener("mousemove", se), window.addEventListener("mouseup", ce);
209
307
  }
210
- }, q = (e) => {
211
- if (!F.value) return;
212
- let t = z + (e.clientX - L), n = B + (e.clientY - R), r = window.innerWidth, i = window.innerHeight, a = O.value.getBoundingClientRect();
308
+ }, se = (e) => {
309
+ if (!N.value) return;
310
+ let t = ee + (e.clientX - F), n = te + (e.clientY - B), r = window.innerWidth, i = window.innerHeight, a = O.value.getBoundingClientRect();
213
311
  t < 0 && (t = 0), n < 0 && (n = 0), t + a.width > r && (t = r - a.width), n + a.height > i && (n = i - a.height), k.value = t, A.value = n;
214
- }, J = () => {
215
- F.value = !1, window.removeEventListener("mousemove", q), window.removeEventListener("mouseup", J);
216
- }, Y = (e) => {
217
- if (!T.resizable) return;
218
- e.preventDefault(), e.stopPropagation(), I.value = !0, V = e.clientX, H = e.clientY;
312
+ }, ce = () => {
313
+ N.value = !1, window.removeEventListener("mousemove", se), window.removeEventListener("mouseup", ce);
314
+ }, le = (e) => {
315
+ if (!g.resizable) return;
316
+ e.preventDefault(), e.stopPropagation(), P.value = !0, V = e.clientX, ne = e.clientY;
219
317
  let t = O.value.getBoundingClientRect();
220
- k.value === null && (k.value = t.left, A.value = t.top), U = t.width, W = t.height, window.addEventListener("mousemove", X), window.addEventListener("mouseup", Z);
221
- }, X = (e) => {
222
- if (!I.value) return;
223
- let t = U + (e.clientX - V), n = W + (e.clientY - H);
224
- t < T.minWidth && (t = T.minWidth), n < T.minHeight && (n = T.minHeight);
318
+ k.value === null && (k.value = t.left, A.value = t.top), re = t.width, ie = t.height, window.addEventListener("mousemove", ue), window.addEventListener("mouseup", de);
319
+ }, ue = (e) => {
320
+ if (!P.value) return;
321
+ let t = re + (e.clientX - V), n = ie + (e.clientY - ne);
322
+ t < g.minWidth && (t = g.minWidth), n < g.minHeight && (n = g.minHeight);
225
323
  let r = window.innerWidth - k.value, i = window.innerHeight - A.value;
226
- t > r && (t = r), n > i && (n = i), N.value = t, P.value = n;
227
- }, Z = () => {
228
- I.value = !1, window.removeEventListener("mousemove", X), window.removeEventListener("mouseup", Z);
229
- }, Q = (e) => {
230
- T.visible && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), $());
324
+ t > r && (t = r), n > i && (n = i), j.value = t, M.value = n;
325
+ }, de = () => {
326
+ P.value = !1, window.removeEventListener("mousemove", ue), window.removeEventListener("mouseup", de);
327
+ }, fe = (e) => {
328
+ g.visible && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), pe());
231
329
  };
232
- b(() => T.visible, async (e) => {
233
- e ? (k.value = null, A.value = null, N.value = null, P.value = null, document.body.style.overflow = "hidden", window.addEventListener("keydown", Q, { capture: !0 }), await l(), D.value && D.value.focus()) : (document.body.style.overflow = "", window.removeEventListener("keydown", Q, { capture: !0 }), J(), Z());
234
- }), f(() => {
235
- document.body.style.overflow = "", window.removeEventListener("keydown", Q, { capture: !0 }), J(), Z();
330
+ C(() => g.visible, async (e) => {
331
+ e ? (k.value = null, A.value = null, j.value = null, M.value = null, document.body.style.overflow = "hidden", window.addEventListener("keydown", fe, { capture: !0 }), await u(), S.value && S.value.focus()) : (document.body.style.overflow = "", window.removeEventListener("keydown", fe, { capture: !0 }), ce(), de());
332
+ }), m(() => {
333
+ document.body.style.overflow = "", window.removeEventListener("keydown", fe, { capture: !0 }), ce(), de();
236
334
  });
237
- let $ = () => E("close"), ne = () => {
238
- T.closeOnBackdrop && $();
239
- }, re = () => E("ok"), ie = () => {
240
- E("cancel"), $();
335
+ let pe = () => v("close"), me = () => {
336
+ g.closeOnBackdrop && pe();
337
+ }, he = () => v("ok"), ge = () => {
338
+ v("cancel"), pe();
241
339
  };
242
- return (n, l) => {
243
- let f = _("ripple");
244
- return p(), r(e, { to: "body" }, [c(t, { name: "nano-modal-fade" }, {
245
- default: x(() => [m.visible ? (p(), a("div", {
340
+ return (r, u) => {
341
+ let p = b("ripple");
342
+ return h(), i(t, { to: "body" }, [l(n, { name: "nano-modal-fade" }, {
343
+ default: w(() => [e.visible ? (h(), o("div", {
246
344
  key: 0,
247
- class: u(["nano-modal-overlay", { "nano-glass": m.glassmorphism }]),
248
- onClick: w(ne, ["self"]),
249
- onKeydown: l[1] ||= C(w((...e) => n.handleEsc && n.handleEsc(...e), ["stop"]), ["esc"]),
345
+ class: d(["nano-modal-overlay", { "nano-glass": e.glassmorphism }]),
346
+ onClick: D(me, ["self"]),
347
+ onKeydown: u[1] ||= E(D((...e) => r.handleEsc && r.handleEsc(...e), ["stop"]), ["esc"]),
250
348
  tabindex: "-1",
251
349
  ref_key: "modalOverlay",
252
- ref: D
253
- }, [o("div", {
254
- class: u(["nano-modal-window", {
255
- "is-dragging": F.value,
256
- "is-resizing": I.value
350
+ ref: S
351
+ }, [s("div", {
352
+ class: d(["nano-modal-window", {
353
+ "is-dragging": N.value,
354
+ "is-resizing": P.value
257
355
  }]),
258
- style: d(G.value),
356
+ style: f(ae.value),
259
357
  ref_key: "modalWindow",
260
358
  ref: O
261
359
  }, [
262
- m.showHeader ? (p(), a("div", {
360
+ e.showHeader ? (h(), o("div", {
263
361
  key: 0,
264
- class: u(["nano-modal-header", { "is-draggable": m.draggable }]),
265
- onMousedown: K
266
- }, [g(n.$slots, "header", {}, () => [o("h2", ee, v(m.title), 1)]), o("button", {
362
+ class: d(["nano-modal-header", { "is-draggable": e.draggable }]),
363
+ onMousedown: oe
364
+ }, [y(r.$slots, "header", {}, () => [s("h2", I, x(e.title), 1)]), s("button", {
267
365
  class: "nano-modal-close-btn",
268
- onClick: w($, ["stop"]),
366
+ onClick: D(pe, ["stop"]),
269
367
  "aria-label": "Close",
270
- onMousedown: l[0] ||= w(() => {}, ["stop"])
271
- }, [...l[2] ||= [o("svg", {
368
+ onMousedown: u[0] ||= D(() => {}, ["stop"])
369
+ }, [...u[2] ||= [s("svg", {
272
370
  xmlns: "http://www.w3.org/2000/svg",
273
371
  width: "24",
274
372
  height: "24",
@@ -278,51 +376,872 @@ var k = {
278
376
  "stroke-width": "2",
279
377
  "stroke-linecap": "round",
280
378
  "stroke-linejoin": "round"
281
- }, [o("line", {
379
+ }, [s("line", {
282
380
  x1: "18",
283
381
  y1: "6",
284
382
  x2: "6",
285
383
  y2: "18"
286
- }), o("line", {
384
+ }), s("line", {
287
385
  x1: "6",
288
386
  y1: "6",
289
387
  x2: "18",
290
388
  y2: "18"
291
- })], -1)]], 32)], 34)) : i("", !0),
292
- m.showBody ? (p(), a("div", te, [g(n.$slots, "body")])) : i("", !0),
293
- m.showFooter ? (p(), a("div", j, [g(n.$slots, "footer", {}, () => [o("div", M, [m.showCancel ? S((p(), a("button", {
389
+ })], -1)]], 32)], 34)) : a("", !0),
390
+ e.showBody ? (h(), o("div", L, [y(r.$slots, "body")])) : a("", !0),
391
+ e.showFooter ? (h(), o("div", R, [y(r.$slots, "footer", {}, () => [s("div", z, [e.showCancel ? T((h(), o("button", {
294
392
  key: 0,
295
393
  class: "nano-btn nano-btn-secondary",
296
- onClick: ie
297
- }, [s(v(m.cancelText), 1)])), [[f]]) : i("", !0), m.showOk ? S((p(), a("button", {
394
+ onClick: ge
395
+ }, [c(x(e.cancelText), 1)])), [[p]]) : a("", !0), e.showOk ? T((h(), o("button", {
298
396
  key: 1,
299
- class: u(["nano-btn", "nano-btn-" + m.okVariant]),
300
- onClick: re
301
- }, [s(v(m.okText), 1)], 2)), [[f]]) : i("", !0)])])])) : i("", !0),
302
- m.resizable ? (p(), a("div", {
397
+ class: d(["nano-btn", "nano-btn-" + e.okVariant]),
398
+ onClick: he
399
+ }, [c(x(e.okText), 1)], 2)), [[p]]) : a("", !0)])])])) : a("", !0),
400
+ e.resizable ? (h(), o("div", {
303
401
  key: 3,
304
402
  class: "nano-modal-resizer",
305
- onMousedown: Y
306
- }, [...l[3] ||= [o("svg", {
403
+ onMousedown: le
404
+ }, [...u[3] ||= [s("svg", {
307
405
  width: "10",
308
406
  height: "10",
309
407
  viewBox: "0 0 10 10",
310
408
  fill: "none",
311
409
  xmlns: "http://www.w3.org/2000/svg"
312
- }, [o("path", {
410
+ }, [s("path", {
313
411
  d: "M9 1V9H1",
314
412
  stroke: "currentColor",
315
413
  "stroke-width": "2",
316
414
  "stroke-linecap": "round",
317
415
  "stroke-linejoin": "round"
318
- })], -1)]], 32)) : i("", !0)
319
- ], 6)], 34)) : i("", !0)]),
416
+ })], -1)]], 32)) : a("", !0)
417
+ ], 6)], 34)) : a("", !0)]),
320
418
  _: 3
321
419
  })]);
322
420
  };
323
421
  }
324
- }, P = { install(e) {
325
- e.directive("ripple", T), e.directive("tooltip", k), e.component("GlobalTooltip", A), e.component("NanoModal", N);
422
+ }, ee = ["viewBox"], te = { key: 0 }, V = [
423
+ "id",
424
+ "x1",
425
+ "y1",
426
+ "x2",
427
+ "y2"
428
+ ], ne = ["stop-color"], re = ["stop-color"], ie = [
429
+ "id",
430
+ "y1",
431
+ "y2"
432
+ ], ae = ["stop-color"], oe = ["stop-color"], se = [
433
+ "id",
434
+ "y1",
435
+ "y2"
436
+ ], ce = ["stop-color"], le = ["stop-color"], ue = { key: 1 }, de = ["x", "y"], fe = { key: 2 }, pe = ["d", "fill"], me = ["d", "stroke"], he = ["d", "fill"], ge = ["d", "fill"], _e = ["d", "fill"], ve = ["d", "stroke"], ye = ["d", "fill"], be = ["d", "stroke"], xe = ["d", "stroke-width"], Se = ["transform"], Ce = ["font-size"], we = ["font-size"], Te = ["d", "fill"], Ee = ["d", "stroke"], De = ["d", "fill"], Oe = ["d", "fill"], ke = ["d", "fill"], Ae = ["d", "stroke"], je = ["d", "fill"], Me = ["d", "stroke"], Ne = ["d", "stroke-width"], Pe = ["onMouseenter", "onClick"], Fe = ["d"], Ie = ["d"], Le = ["onMouseenter", "onClick"], Re = ["d", "stroke"], ze = ["y", "fill"], Be = ["onMouseenter", "onClick"], Ve = ["d", "stroke"], He = ["y", "fill"], Ue = /* @__PURE__ */ P({
437
+ __name: "ThreeDDonutChart",
438
+ props: {
439
+ data: {
440
+ type: Array,
441
+ required: !0
442
+ },
443
+ isExpanded: {
444
+ type: Boolean,
445
+ default: !1
446
+ },
447
+ hoveredItemId: {
448
+ type: [String, Number],
449
+ default: null
450
+ },
451
+ centerValue: {
452
+ type: [String, Number],
453
+ default: ""
454
+ },
455
+ centerLabel: {
456
+ type: String,
457
+ default: ""
458
+ },
459
+ emptyText: {
460
+ type: String,
461
+ default: ""
462
+ },
463
+ currentLowFxMode: {
464
+ type: Boolean,
465
+ default: !1
466
+ },
467
+ immediate: {
468
+ type: Boolean,
469
+ default: !1
470
+ },
471
+ rotationAngle: {
472
+ type: Number,
473
+ default: -90
474
+ },
475
+ autoRotate: {
476
+ type: Boolean,
477
+ default: !1
478
+ },
479
+ slopeRatio: {
480
+ type: Number,
481
+ default: .5
482
+ },
483
+ aggregateOthers: {
484
+ type: Boolean,
485
+ default: !1
486
+ },
487
+ othersThreshold: {
488
+ type: Number,
489
+ default: .01
490
+ },
491
+ othersLabel: {
492
+ type: String,
493
+ default: "Other"
494
+ },
495
+ othersColor: {
496
+ type: String,
497
+ default: "#64748b"
498
+ },
499
+ valueDecimals: {
500
+ type: Number,
501
+ default: void 0
502
+ },
503
+ selectedItemId: {
504
+ type: [String, Number],
505
+ default: null
506
+ },
507
+ selectable: {
508
+ type: Boolean,
509
+ default: !1
510
+ },
511
+ is3D: {
512
+ type: Boolean,
513
+ default: !0
514
+ },
515
+ showLabels: {
516
+ type: Boolean,
517
+ default: !0
518
+ }
519
+ },
520
+ emits: ["update:hoveredItemId", "update:selectedItemId"],
521
+ setup(t, { expose: n, emit: i }) {
522
+ let c = t, l = i, g = null, y = _(null), b = _(null), S = r({
523
+ get() {
524
+ return c.selectedItemId !== void 0 && c.selectedItemId !== null ? c.selectedItemId : b.value;
525
+ },
526
+ set(e) {
527
+ b.value = e, l("update:selectedItemId", e);
528
+ }
529
+ }), w = r(() => j.value ? null : y.value === null ? c.selectable ? S.value : null : y.value), T = !1, E = (e) => {
530
+ !c.selectable || j.value || (T = !0, S.value === e ? S.value = null : S.value = e);
531
+ }, D = (e) => {
532
+ j.value || (y.value = e);
533
+ }, O = _(null), k = (e) => {
534
+ if (c.selectable) {
535
+ if (T) {
536
+ T = !1;
537
+ return;
538
+ }
539
+ O.value && O.value.contains(e.target) && (S.value = null);
540
+ }
541
+ }, A = _([]), j = r(() => (c.data || []).filter((e) => e.value > .001).length <= 1), M = [
542
+ "#3b82f6",
543
+ "#10b981",
544
+ "#a855f7",
545
+ "#f59e0b",
546
+ "#ec4899",
547
+ "#14b8a6",
548
+ "#f43f5e",
549
+ "#6366f1"
550
+ ], N = (e, t = .6) => {
551
+ if (!e) return "#000000";
552
+ let n = 0, r = 0, i = 0, a = 1;
553
+ if (e.startsWith("#")) {
554
+ let t = e.slice(1);
555
+ t.length === 3 ? (n = parseInt(t[0] + t[0], 16), r = parseInt(t[1] + t[1], 16), i = parseInt(t[2] + t[2], 16)) : t.length === 6 && (n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16));
556
+ } else if (e.startsWith("rgb")) {
557
+ let t = e.match(/\d+(\.\d+)?/g);
558
+ t && (n = parseInt(t[0]), r = parseInt(t[1]), i = parseInt(t[2]), t[3] && (a = parseFloat(t[3])));
559
+ } else return e;
560
+ return n = Math.floor(n * t), r = Math.floor(r * t), i = Math.floor(i * t), `rgba(${n}, ${r}, ${i}, ${a})`;
561
+ }, P = (e, t = 1.2) => {
562
+ if (!e) return "#ffffff";
563
+ let n = 0, r = 0, i = 0, a = 1;
564
+ if (e.startsWith("#")) {
565
+ let t = e.slice(1);
566
+ t.length === 3 ? (n = parseInt(t[0] + t[0], 16), r = parseInt(t[1] + t[1], 16), i = parseInt(t[2] + t[2], 16)) : t.length === 6 && (n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16));
567
+ } else if (e.startsWith("rgb")) {
568
+ let t = e.match(/\d+(\.\d+)?/g);
569
+ t && (n = parseInt(t[0]), r = parseInt(t[1]), i = parseInt(t[2]), t[3] && (a = parseFloat(t[3])));
570
+ } else return e;
571
+ return n = Math.min(255, Math.floor(n * t)), r = Math.min(255, Math.floor(r * t)), i = Math.min(255, Math.floor(i * t)), `rgba(${n}, ${r}, ${i}, ${a})`;
572
+ }, F = (e, t) => e.color ? e.color : M[t % M.length], I = (e, t, n, r) => {
573
+ if (e.length === 0) return;
574
+ e.sort((e, t) => e.desiredY - t.desiredY);
575
+ for (let t = 1; t < e.length; t++) e[t].finalY < e[t - 1].finalY + 15 && (e[t].finalY = e[t - 1].finalY + 15);
576
+ let i = n - 15;
577
+ if (e[e.length - 1].finalY > i) {
578
+ e[e.length - 1].finalY = i;
579
+ for (let t = e.length - 2; t >= 0; t--) e[t].finalY > e[t + 1].finalY - 15 && (e[t].finalY = e[t + 1].finalY - 15);
580
+ }
581
+ if (e[0].finalY < 15) {
582
+ e[0].finalY = 15;
583
+ for (let t = 1; t < e.length; t++) e[t].finalY < e[t - 1].finalY + 15 && (e[t].finalY = e[t - 1].finalY + 15);
584
+ }
585
+ }, L = (e) => typeof e == "number" ? c.valueDecimals !== void 0 && c.valueDecimals !== null ? e.toFixed(c.valueDecimals) : Number(e.toFixed(10)) : e, R = (e, t = 15) => e ? e.length > t ? e.slice(0, t - 1) + "…" : e : "", z = (e) => String(e).replace(/[^a-zA-Z0-9_-]/g, "_"), B = r(() => {
586
+ let e = c.data || [];
587
+ if (e.length === 0) return [];
588
+ let t = e.reduce((e, t) => e + (t.value || 0), 0);
589
+ if (!c.aggregateOthers) return e.map((e) => {
590
+ let n = e.value || 0, r = t > 0 ? Math.round(n / t * 100) : 0;
591
+ return {
592
+ ...e,
593
+ percentage: r
594
+ };
595
+ });
596
+ if (t === 0) return e.map((e) => ({
597
+ ...e,
598
+ percentage: 0
599
+ }));
600
+ let n = t * c.othersThreshold, r = [], i = 0;
601
+ if (e.forEach((e) => {
602
+ (e.value || 0) < n ? i += e.value || 0 : r.push({ ...e });
603
+ }), i > 0) {
604
+ let t = r.findIndex((e) => e.id === "other" || e.name.toLowerCase() === c.othersLabel.toLowerCase());
605
+ t === -1 ? r.push({
606
+ id: "other",
607
+ name: c.othersLabel,
608
+ value: i,
609
+ color: c.othersColor,
610
+ unit: e[0]?.unit || "x"
611
+ }) : r[t].value += i;
612
+ }
613
+ let a = r.reduce((e, t) => e + (t.value || 0), 0);
614
+ return r.map((e) => {
615
+ let t = e.value || 0, n = a > 0 ? Math.round(t / a * 100) : 0;
616
+ return {
617
+ ...e,
618
+ percentage: n
619
+ };
620
+ });
621
+ }), Ue = r(() => A.value.reduce((e, t) => e + t.value, 0)), We = r(() => {
622
+ if (c.centerValue !== void 0 && c.centerValue !== "") return c.centerValue;
623
+ let e = Z.value.find((e) => e.item.id === w.value);
624
+ return e ? L(e.item.value) : c.valueDecimals === void 0 ? Math.round(Ue.value) : L(Ue.value);
625
+ }), Ge = r(() => {
626
+ let e = Z.value.find((e) => e.item.id === w.value);
627
+ return e ? R(e.item.name, 12).toUpperCase() : (c.centerLabel || "").toUpperCase();
628
+ }), Ke = (e, t = !1) => {
629
+ let n = new Map(A.value.map((e) => [e.id, e])), r = new Map(e.map((e) => [e.id, e])), i = [];
630
+ e.forEach((e) => {
631
+ let r = n.get(e.id);
632
+ r ? i.push({
633
+ id: e.id,
634
+ name: e.name,
635
+ value: t ? e.value : r.value,
636
+ startValue: r.value,
637
+ targetValue: e.value,
638
+ startPercentage: r.percentage || 0,
639
+ targetPercentage: e.percentage || 0,
640
+ percentage: t ? e.percentage || 0 : r.percentage || 0,
641
+ color: e.color,
642
+ unit: e.unit
643
+ }) : i.push({
644
+ id: e.id,
645
+ name: e.name,
646
+ value: 0,
647
+ startValue: 0,
648
+ targetValue: e.value,
649
+ startPercentage: 0,
650
+ targetPercentage: e.percentage || 0,
651
+ percentage: t && e.percentage || 0,
652
+ color: e.color,
653
+ unit: e.unit
654
+ });
655
+ }), A.value.forEach((e) => {
656
+ r.has(e.id) || i.push({
657
+ id: e.id,
658
+ name: e.name,
659
+ value: t ? 0 : e.value,
660
+ startValue: e.value,
661
+ targetValue: 0,
662
+ startPercentage: e.percentage || 0,
663
+ targetPercentage: 0,
664
+ percentage: t ? 0 : e.percentage || 0,
665
+ color: e.color,
666
+ unit: e.unit
667
+ });
668
+ }), A.value = i, t && (A.value = A.value.filter((e) => e.targetValue > 0));
669
+ }, qe = (e, t = -90) => {
670
+ if (!e || e.length === 0) return t;
671
+ let n = e.reduce((e, t) => e + (t.value || 0), 0);
672
+ if (n === 0) return t;
673
+ let r = 0, i = e.map((e) => {
674
+ let t = (e.value || 0) / n * Math.PI * 2, i = r + t / 2;
675
+ return r += t, { originalMidAngleNoRot: i };
676
+ }), a = t, o = Infinity, s = Infinity;
677
+ for (let e = -180; e <= 180; e += 2) {
678
+ let n = e * Math.PI / 180, r = 0, c = 0;
679
+ i.forEach((e) => {
680
+ let t = e.originalMidAngleNoRot + n;
681
+ Math.cos(t) < 0 ? r++ : c++;
682
+ });
683
+ let l = Math.abs(r - c), u = Math.abs(e - t);
684
+ l < o ? (o = l, a = e, s = u) : l === o && u < s && (a = e, s = u);
685
+ }
686
+ return a;
687
+ }, Je = r(() => c.autoRotate && B.value && B.value.length > 0 ? qe(B.value, c.rotationAngle) : c.rotationAngle), H = _(Je.value), Ye = _(!1), Xe = _(!1), Ze = null, U = c.is3D, W = _(c.isExpanded ? 380 : 60), G = _(c.isExpanded ? 160 : 60), K = _(c.isExpanded ? 180 : 48), q = _(c.isExpanded ? U ? 180 * c.slopeRatio : 180 : U ? 48 * c.slopeRatio : 48), Qe = _(c.isExpanded ? 95 : 31), J = _(c.isExpanded ? U ? 95 * c.slopeRatio : 95 : U ? 31 * c.slopeRatio : 31), $e = c.isExpanded && U ? 32 : 0, Y = _(U && c.slopeRatio > .5 ? $e * (2 - 2 * c.slopeRatio) : $e), et = _(c.isExpanded ? 760 : 120), tt = _(c.isExpanded ? 320 : 120), X = _(c.isExpanded && c.showLabels ? 1 : 0), nt = r(() => {
688
+ let e = (K.value - 48) / 132;
689
+ return 13 + 6 * Math.max(0, Math.min(1, e));
690
+ }), rt = r(() => {
691
+ let e = (K.value - 48) / 132;
692
+ return 7 + 1.5 * Math.max(0, Math.min(1, e));
693
+ }), it = r(() => G.value - Y.value / 2), Z = r(() => {
694
+ let e = A.value, t = Ue.value;
695
+ if (t === 0) return [];
696
+ let n = [], r = H.value * Math.PI / 180, i = W.value;
697
+ G.value;
698
+ let a = K.value, o = q.value, s = Qe.value, l = J.value, u = Y.value, d = it.value, f = e.filter((e) => e.value > .001);
699
+ if (f.length === 1) {
700
+ let t = f[0], n = e.indexOf(t), r = F(t, n), p = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} M ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d} Z`, m = "", h = "";
701
+ u > 0 && (m = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} L ${i - a} ${d + u} A ${a} ${o} 0 0 0 ${i + a} ${d + u} Z`, h = `M ${i - s} ${d} A ${s} ${l} 0 0 1 ${i + s} ${d} L ${i + s} ${d + u} A ${s} ${l} 0 0 0 ${i - s} ${d + u} Z`);
702
+ let g = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} L ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d} Z`, _ = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} M ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d}`, v = h, y = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} L ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d} Z`, b = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} M ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d}`, x = m, S = H.value * Math.PI / 180 + Math.PI, C = i + a * Math.cos(S), w = d + o * Math.sin(S), T = i + (a + 25) * Math.cos(S), E = d + (o + 35 * c.slopeRatio) * Math.sin(S), D = i + (a + s) / 2 * Math.cos(S), O = d + (o + l) / 2 * Math.sin(S), k = a - s, A = o - l;
703
+ return [{
704
+ item: t,
705
+ index: n,
706
+ color: r,
707
+ isSingleSlice: !0,
708
+ midAngle: 3 * Math.PI / 2,
709
+ originalMidAngle: S,
710
+ originalTopPath: g,
711
+ fullTopPath: p,
712
+ hoverPath: p,
713
+ originalOuterWallPath: m,
714
+ originalInnerWallPath: v,
715
+ topStrokePath: _,
716
+ outerWallStrokePath: "",
717
+ innerWallStrokePath: v,
718
+ midY: d - o,
719
+ topPath: g,
720
+ outerWallPath: "",
721
+ innerWallPath: v,
722
+ startCutPath: "",
723
+ endCutPath: "",
724
+ x0: C,
725
+ y0: w,
726
+ x1: T,
727
+ y1: E,
728
+ topGradX1: D - k / 2,
729
+ topGradY1: O - A / 2,
730
+ topGradX2: D + k / 2,
731
+ topGradY2: O + A / 2,
732
+ wallY1: d,
733
+ wallY2: d + u
734
+ }, {
735
+ item: t,
736
+ index: n,
737
+ color: r,
738
+ isSingleSlice: !0,
739
+ midAngle: Math.PI / 2,
740
+ originalMidAngle: S,
741
+ originalTopPath: y,
742
+ fullTopPath: p,
743
+ hoverPath: p,
744
+ originalOuterWallPath: m,
745
+ originalInnerWallPath: "",
746
+ topStrokePath: b,
747
+ outerWallStrokePath: x,
748
+ innerWallStrokePath: "",
749
+ midY: d + o,
750
+ topPath: y,
751
+ outerWallPath: x,
752
+ innerWallPath: "",
753
+ startCutPath: "",
754
+ endCutPath: "",
755
+ x0: C,
756
+ y0: w,
757
+ x1: T,
758
+ y1: E,
759
+ topGradX1: D - k / 2,
760
+ topGradY1: O - A / 2,
761
+ topGradX2: D + k / 2,
762
+ topGradY2: O + A / 2,
763
+ wallY1: d,
764
+ wallY2: d + u
765
+ }];
766
+ }
767
+ return e.forEach((e, f) => {
768
+ let p = e.value / t * Math.PI * 2;
769
+ if (p <= 0) return;
770
+ p >= Math.PI * 2 - .001 && (p = Math.PI * 2 - .001);
771
+ let m = r, h = r + p, g = m + p / 2, _ = F(e, f), v = i + a * Math.cos(m), y = d + o * Math.sin(m), b = i + a * Math.cos(h), x = d + o * Math.sin(h), S = i + s * Math.cos(h), C = d + l * Math.sin(h), w = i + s * Math.cos(m), T = d + l * Math.sin(m), E = +(p > Math.PI), D = `M ${v} ${y} A ${a} ${o} 0 ${E} 1 ${b} ${x} L ${S} ${C} A ${s} ${l} 0 ${E} 0 ${w} ${T} Z`, O = u > 0 ? `M ${v} ${y} A ${a} ${o} 0 ${E} 1 ${b} ${x} L ${b} ${x + u} A ${a} ${o} 0 ${E} 0 ${v} ${y + u} Z` : "", k = u > 0 ? `M ${w} ${T} A ${s} ${l} 0 ${E} 1 ${S} ${C} L ${S} ${C + u} A ${s} ${l} 0 ${E} 0 ${w} ${T + u} Z` : "", A = ((e) => {
772
+ let t = e % (Math.PI * 2);
773
+ return t < 0 && (t += Math.PI * 2), t;
774
+ })(m), j = A + p, M = [], N = Math.ceil(A / Math.PI), P = Math.floor(j / Math.PI);
775
+ for (let e = N; e <= P; e++) M.push(e * Math.PI);
776
+ let I = [{
777
+ start: A,
778
+ end: j
779
+ }];
780
+ M.forEach((e) => {
781
+ let t = [];
782
+ I.forEach((n) => {
783
+ n.start < e && n.end > e ? (t.push({
784
+ start: n.start,
785
+ end: Math.min(n.end, e + 2e-4)
786
+ }), t.push({
787
+ start: Math.max(n.start, e - 2e-4),
788
+ end: n.end
789
+ })) : t.push(n);
790
+ }), I = t;
791
+ }), I.forEach((t) => {
792
+ let r = t.start, p = t.end, m = (r + p) / 2, h = i + a * Math.cos(r), v = d + o * Math.sin(r), y = i + a * Math.cos(p), b = d + o * Math.sin(p), x = i + s * Math.cos(p), S = d + l * Math.sin(p), C = i + s * Math.cos(r), w = d + l * Math.sin(r), T = +(p - r > Math.PI), E = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} L ${x} ${S} A ${s} ${l} 0 ${T} 0 ${C} ${w} Z`, M = Math.abs(p - j) >= .001, N = Math.abs(r - A) >= .001, P = "";
793
+ M ? (P = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} M ${x} ${S} A ${s} ${l} 0 ${T} 0 ${C} ${w}`, N || (P += ` L ${h} ${v}`)) : (P = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} L ${x} ${S} A ${s} ${l} 0 ${T} 0 ${C} ${w}`, N || (P += " Z"));
794
+ let F = "", I = "", L = "", R = "", z = "", B = "";
795
+ u > 0 && (F = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} L ${y} ${b + u} A ${a} ${o} 0 ${T} 0 ${h} ${v + u} Z`, I = `M ${C} ${w} A ${s} ${l} 0 ${T} 1 ${x} ${S} L ${x} ${S + u} A ${s} ${l} 0 ${T} 0 ${C} ${w + u} Z`, M ? (L = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} M ${y} ${b + u} A ${a} ${o} 0 ${T} 0 ${h} ${v + u}`, N || (L += ` L ${h} ${v}`)) : (L = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} L ${y} ${b + u} A ${a} ${o} 0 ${T} 0 ${h} ${v + u}`, N || (L += " Z")), M ? (R = `M ${C} ${w} A ${s} ${l} 0 ${T} 1 ${x} ${S} M ${x} ${S + u} A ${s} ${l} 0 ${T} 0 ${C} ${w + u}`, N || (R += ` L ${C} ${w}`)) : (R = `M ${C} ${w} A ${s} ${l} 0 ${T} 1 ${x} ${S} L ${x} ${S + u} A ${s} ${l} 0 ${T} 0 ${C} ${w + u}`, N || (R += " Z")), Math.abs(r - A) < .001 && (z = `M ${h} ${v} L ${C} ${w} L ${C} ${w + u} L ${h} ${v + u} Z`), Math.abs(p - j) < .001 && (B = `M ${y} ${b} L ${x} ${S} L ${x} ${S + u} L ${y} ${b + u} Z`));
796
+ let ee = d + o * Math.sin(m), te = i + a * Math.cos(g), V = d + o * Math.sin(g), ne = i + (a + 25) * Math.cos(g), re = d + (o + 35 * c.slopeRatio) * Math.sin(g), ie = i + (a + s) / 2 * Math.cos(g), ae = d + (o + l) / 2 * Math.sin(g), oe = a - s, se = o - l;
797
+ n.push({
798
+ item: e,
799
+ index: f,
800
+ color: _,
801
+ midAngle: m,
802
+ originalMidAngle: g,
803
+ originalTopPath: D,
804
+ originalOuterWallPath: O,
805
+ originalInnerWallPath: k,
806
+ topStrokePath: P,
807
+ outerWallStrokePath: L,
808
+ innerWallStrokePath: R,
809
+ midY: ee,
810
+ topPath: E,
811
+ outerWallPath: F,
812
+ innerWallPath: I,
813
+ startCutPath: z,
814
+ endCutPath: B,
815
+ x0: te,
816
+ y0: V,
817
+ x1: ne,
818
+ y1: re,
819
+ topGradX1: ie - oe / 2,
820
+ topGradY1: ae - se / 2,
821
+ topGradX2: ie + oe / 2,
822
+ topGradY2: ae + se / 2,
823
+ wallY1: V,
824
+ wallY2: V + u
825
+ });
826
+ }), r += p;
827
+ }), n.sort((e, t) => {
828
+ let n = w.value === e.item.id, r = w.value === t.item.id;
829
+ return n && !r ? 1 : !n && r ? -1 : e.midY - t.midY;
830
+ });
831
+ }), at = r(() => {
832
+ let e = /* @__PURE__ */ new Set(), t = [];
833
+ return Z.value.forEach((n) => {
834
+ e.has(n.item.id) || (e.add(n.item.id), t.push(n));
835
+ }), t;
836
+ }), ot = (e) => w.value === e.item.id ? { transform: `translate(${10 * Math.cos(e.originalMidAngle)}px, ${10 * Math.sin(e.originalMidAngle)}px)` } : {}, st = r(() => {
837
+ if (X.value <= .001) return {
838
+ left: [],
839
+ right: []
840
+ };
841
+ let e = [], t = [];
842
+ return at.value.forEach((n) => {
843
+ let r = Math.cos(n.originalMidAngle) < 0, i = Math.sin(n.originalMidAngle) > 0, a = Y.value, o = n.y0 + (i ? a : 0), s = n.y1 + (i ? a : 0), c = {
844
+ item: n.item,
845
+ index: n.index,
846
+ color: n.color,
847
+ x0: n.x0,
848
+ y0: o,
849
+ x1: n.x1,
850
+ y1: s,
851
+ desiredY: s,
852
+ finalY: s,
853
+ isLeft: r,
854
+ originalMidAngle: n.originalMidAngle
855
+ };
856
+ r ? e.push(c) : t.push(c);
857
+ }), I(e, 144, 320, 1), I(t, 144, 320, 1), {
858
+ left: e,
859
+ right: t
860
+ };
861
+ }), ct = r(() => st.value.left), lt = r(() => st.value.right), ut = (e) => {
862
+ let t = w.value === e.item.id, n = e.x0, r = e.y0, i = e.finalY;
863
+ if (t) {
864
+ let t = 10 * Math.cos(e.originalMidAngle || 0), a = 10 * Math.sin(e.originalMidAngle || 0);
865
+ n += t, r += a, i -= 5;
866
+ }
867
+ let a = n + 30 * Math.cos(e.originalMidAngle || 0), o = r + 30 * Math.sin(e.originalMidAngle || 0), s = e.isLeft, c = Math.sin(e.originalMidAngle || 0) < 0, l = W.value, u = K.value, d = s ? l - u - 15 : l + u + 15, f = s ? Math.min(d, a - 30) : Math.max(d, a + 30);
868
+ return `M ${n} ${r} C ${a} ${o}, ${f} ${c ? Math.min(o, i) : Math.max(o, i)}, ${s ? 90 : 670} ${i}`;
869
+ }, Q = (e = 450) => {
870
+ if (c.currentLowFxMode || c.immediate) {
871
+ A.value.forEach((e) => {
872
+ e.value = e.targetValue, e.percentage = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
873
+ }), A.value = A.value.filter((e) => e.targetValue > 0), H.value = Je.value;
874
+ let e = c.is3D;
875
+ W.value = c.isExpanded ? 380 : 60, G.value = c.isExpanded ? 160 : 60, K.value = c.isExpanded ? 180 : 48, q.value = c.isExpanded ? e ? 180 * c.slopeRatio : 180 : e ? 48 * c.slopeRatio : 48, Qe.value = c.isExpanded ? 95 : 31, J.value = c.isExpanded ? e ? 95 * c.slopeRatio : 95 : e ? 31 * c.slopeRatio : 31;
876
+ let t = c.isExpanded && e ? 32 : 0;
877
+ Y.value = e && c.slopeRatio > .5 ? t * (2 - 2 * c.slopeRatio) : t, et.value = c.isExpanded ? 760 : 120, tt.value = c.isExpanded ? 320 : 120, X.value = c.isExpanded && c.showLabels ? 1 : 0, Ye.value = !1;
878
+ return;
879
+ }
880
+ g && cancelAnimationFrame(g), Ye.value = !0;
881
+ let t = performance.now(), n = H.value, r = Je.value, i = W.value, a = G.value, o = K.value, s = q.value, l = Qe.value, u = J.value, d = Y.value, f = et.value, p = tt.value, m = X.value, h = c.is3D, _ = c.isExpanded ? 380 : 60, v = c.isExpanded ? 160 : 60, y = c.isExpanded ? 180 : 48, b = c.isExpanded ? h ? 180 * c.slopeRatio : 180 : h ? 48 * c.slopeRatio : 48, x = c.isExpanded ? 95 : 31, S = c.isExpanded ? h ? 95 * c.slopeRatio : 95 : h ? 31 * c.slopeRatio : 31, C = c.isExpanded && h ? 32 : 0, w = h && c.slopeRatio > .5 ? C * (2 - 2 * c.slopeRatio) : C, T = c.isExpanded ? 760 : 120, E = c.isExpanded ? 320 : 120, D = c.isExpanded && c.showLabels ? 1 : 0, O = (c) => {
882
+ let h = c - t, C = Math.min(1, h / e), k = 1 - (1 - C) ** 3;
883
+ A.value.forEach((e) => {
884
+ e.value = e.startValue + (e.targetValue - e.startValue) * k;
885
+ let t = e.startPercentage === void 0 ? 0 : e.startPercentage, n = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
886
+ e.percentage = Math.round(t + (n - t) * k);
887
+ }), H.value = n + (r - n) * k, W.value = i + (_ - i) * k, G.value = a + (v - a) * k, K.value = o + (y - o) * k, q.value = s + (b - s) * k, Qe.value = l + (x - l) * k, J.value = u + (S - u) * k, Y.value = d + (w - d) * k, et.value = f + (T - f) * k, tt.value = p + (E - p) * k, X.value = m + (D - m) * k, C < 1 ? g = requestAnimationFrame(O) : (g = null, A.value.forEach((e) => {
888
+ e.value = e.targetValue, e.percentage = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
889
+ }), A.value = A.value.filter((e) => e.targetValue > 0), W.value = _, G.value = v, K.value = y, q.value = b, Qe.value = x, J.value = S, Y.value = w, et.value = T, tt.value = E, X.value = D, Ye.value = !1);
890
+ };
891
+ g = requestAnimationFrame(O);
892
+ }, $ = (e) => {
893
+ if (e.isSingleSlice) return !0;
894
+ let t = Z.value, n = -1;
895
+ for (let r = t.length - 1; r >= 0; r--) if (t[r].item.id === e.item.id) {
896
+ n = r;
897
+ break;
898
+ }
899
+ return t.indexOf(e) === n;
900
+ };
901
+ return C(B, (e) => {
902
+ let t = c.immediate || c.currentLowFxMode;
903
+ Ke(e || [], t), t || Q();
904
+ }, {
905
+ deep: !0,
906
+ immediate: !0
907
+ }), C(() => c.rotationAngle, () => {
908
+ Xe.value = !0, Ze && clearTimeout(Ze), Ze = setTimeout(() => {
909
+ Xe.value = !1;
910
+ }, 100);
911
+ }), C(Je, (e) => {
912
+ c.immediate || c.currentLowFxMode ? H.value = e : Q();
913
+ }), C(() => c.isExpanded, () => {
914
+ u(() => {
915
+ Q();
916
+ });
917
+ }), C(() => c.is3D, () => {
918
+ u(() => {
919
+ Q();
920
+ });
921
+ }), C(() => c.showLabels, () => {
922
+ u(() => {
923
+ Q();
924
+ });
925
+ }), C(() => c.slopeRatio, (e) => {
926
+ if (c.is3D) {
927
+ q.value = c.isExpanded ? 180 * e : 48, J.value = c.isExpanded ? 95 * e : 31;
928
+ let t = c.isExpanded ? 32 : 0;
929
+ Y.value = e > .5 ? t * (2 - 2 * e) : t;
930
+ }
931
+ }), C(() => c.hoveredItemId, (e) => {
932
+ y.value !== e && (y.value = e);
933
+ }), C(y, (e) => {
934
+ c.hoveredItemId !== e && l("update:hoveredItemId", e);
935
+ }), p(() => {
936
+ document.addEventListener("click", k), u(() => {
937
+ Q();
938
+ });
939
+ }), m(() => {
940
+ document.removeEventListener("click", k), g && cancelAnimationFrame(g);
941
+ }), n({ redraw: () => {
942
+ g && cancelAnimationFrame(g), g = null, A.value.forEach((e) => {
943
+ e.value = e.targetValue;
944
+ }), A.value = A.value.filter((e) => e.targetValue > 0);
945
+ } }), (n, r) => (h(), o("div", {
946
+ ref_key: "wrapperRef",
947
+ ref: O,
948
+ class: d(["donut-canvas-wrapper", {
949
+ "is-expanded": t.isExpanded,
950
+ "no-transitions": Ye.value || Xe.value
951
+ }])
952
+ }, [(h(), o("svg", {
953
+ viewBox: `0 0 ${et.value} ${tt.value}`,
954
+ class: "items-svg-chart",
955
+ xmlns: "http://www.w3.org/2000/svg"
956
+ }, [B.value && B.value.length > 0 ? (h(), o("defs", te, [
957
+ (h(!0), o(e, null, v(at.value, (e) => (h(), o("linearGradient", {
958
+ key: "top-grad-" + z(e.item.id),
959
+ id: "top-grad-" + z(e.item.id),
960
+ gradientUnits: "userSpaceOnUse",
961
+ x1: e.topGradX1,
962
+ y1: e.topGradY1,
963
+ x2: e.topGradX2,
964
+ y2: e.topGradY2
965
+ }, [s("stop", {
966
+ offset: "0%",
967
+ "stop-color": P(e.color, 1.15)
968
+ }, null, 8, ne), s("stop", {
969
+ offset: "100%",
970
+ "stop-color": N(e.color, .85)
971
+ }, null, 8, re)], 8, V))), 128)),
972
+ (h(!0), o(e, null, v(at.value, (e) => (h(), o("linearGradient", {
973
+ key: "outer-grad-" + z(e.item.id),
974
+ id: "outer-grad-" + z(e.item.id),
975
+ gradientUnits: "userSpaceOnUse",
976
+ x1: "0",
977
+ y1: e.wallY1,
978
+ x2: "0",
979
+ y2: e.wallY2
980
+ }, [s("stop", {
981
+ offset: "0%",
982
+ "stop-color": N(e.color, .75)
983
+ }, null, 8, ae), s("stop", {
984
+ offset: "100%",
985
+ "stop-color": N(e.color, .5)
986
+ }, null, 8, oe)], 8, ie))), 128)),
987
+ (h(!0), o(e, null, v(at.value, (e) => (h(), o("linearGradient", {
988
+ key: "inner-grad-" + z(e.item.id),
989
+ id: "inner-grad-" + z(e.item.id),
990
+ gradientUnits: "userSpaceOnUse",
991
+ x1: "0",
992
+ y1: e.wallY1,
993
+ x2: "0",
994
+ y2: e.wallY2
995
+ }, [s("stop", {
996
+ offset: "0%",
997
+ "stop-color": N(e.color, .6)
998
+ }, null, 8, ce), s("stop", {
999
+ offset: "100%",
1000
+ "stop-color": N(e.color, .4)
1001
+ }, null, 8, le)], 8, se))), 128))
1002
+ ])) : a("", !0), !B.value || B.value.length === 0 ? (h(), o("g", ue, [s("text", {
1003
+ x: t.isExpanded ? 380 : 60,
1004
+ y: t.isExpanded ? 160 : 60,
1005
+ fill: "#64748b",
1006
+ "font-size": "12",
1007
+ "font-family": "system-ui, -apple-system, sans-serif",
1008
+ "text-anchor": "middle",
1009
+ "dominant-baseline": "middle"
1010
+ }, x(t.emptyText || "No data"), 9, de)])) : (h(), o("g", fe, [
1011
+ (h(!0), o(e, null, v(Z.value.filter((e) => e.midY < it.value), (e) => (h(), o("g", {
1012
+ key: "slice-sub-back-" + e.item.id + "-" + e.midAngle,
1013
+ class: d(["slice-group-3d", {
1014
+ "is-hovered": w.value === e.item.id,
1015
+ "is-dimmed": w.value !== null && w.value !== e.item.id
1016
+ }]),
1017
+ style: f(ot(e))
1018
+ }, [
1019
+ t.isExpanded && e.innerWallPath ? (h(), o("path", {
1020
+ key: 0,
1021
+ d: e.innerWallPath,
1022
+ fill: `url(#inner-grad-${z(e.item.id)})`
1023
+ }, null, 8, pe)) : a("", !0),
1024
+ t.isExpanded && e.innerWallStrokePath ? (h(), o("path", {
1025
+ key: 1,
1026
+ d: e.innerWallStrokePath,
1027
+ fill: "none",
1028
+ stroke: `url(#inner-grad-${z(e.item.id)})`,
1029
+ "stroke-width": "0.8",
1030
+ "stroke-linejoin": "round"
1031
+ }, null, 8, me)) : a("", !0),
1032
+ t.isExpanded && e.startCutPath ? (h(), o("path", {
1033
+ key: 2,
1034
+ d: e.startCutPath,
1035
+ fill: N(e.color, .65)
1036
+ }, null, 8, he)) : a("", !0),
1037
+ t.isExpanded && e.endCutPath ? (h(), o("path", {
1038
+ key: 3,
1039
+ d: e.endCutPath,
1040
+ fill: N(e.color, .75)
1041
+ }, null, 8, ge)) : a("", !0),
1042
+ t.isExpanded && e.outerWallPath ? (h(), o("path", {
1043
+ key: 4,
1044
+ d: e.outerWallPath,
1045
+ fill: `url(#outer-grad-${z(e.item.id)})`
1046
+ }, null, 8, _e)) : a("", !0),
1047
+ t.isExpanded && e.outerWallStrokePath ? (h(), o("path", {
1048
+ key: 5,
1049
+ d: e.outerWallStrokePath,
1050
+ fill: "none",
1051
+ stroke: `url(#outer-grad-${z(e.item.id)})`,
1052
+ "stroke-width": "0.8",
1053
+ "stroke-linejoin": "round"
1054
+ }, null, 8, ve)) : a("", !0),
1055
+ $(e) ? (h(), o("path", {
1056
+ key: 6,
1057
+ d: e.originalTopPath,
1058
+ fill: `url(#top-grad-${z(e.item.id)})`
1059
+ }, null, 8, ye)) : a("", !0),
1060
+ $(e) ? (h(), o("path", {
1061
+ key: 7,
1062
+ d: e.topStrokePath,
1063
+ fill: "none",
1064
+ stroke: `url(#top-grad-${z(e.item.id)})`,
1065
+ "stroke-width": "0.8",
1066
+ "stroke-linejoin": "round"
1067
+ }, null, 8, be)) : a("", !0),
1068
+ $(e) ? (h(), o("path", {
1069
+ key: 8,
1070
+ d: e.topStrokePath,
1071
+ fill: "none",
1072
+ stroke: "rgba(255, 255, 255, 0.16)",
1073
+ "stroke-width": t.isExpanded ? .8 : .5,
1074
+ "stroke-linejoin": "round"
1075
+ }, null, 8, xe)) : a("", !0)
1076
+ ], 6))), 128)),
1077
+ s("g", {
1078
+ transform: `translate(${W.value}, ${G.value})`,
1079
+ class: "center-text-group"
1080
+ }, [s("text", {
1081
+ x: "0",
1082
+ y: "-3",
1083
+ class: "center-text-value",
1084
+ "font-size": nt.value,
1085
+ "font-weight": "bold",
1086
+ "font-family": "'JetBrains Mono', monospace",
1087
+ "text-anchor": "middle",
1088
+ "dominant-baseline": "middle"
1089
+ }, x(We.value), 9, Ce), s("text", {
1090
+ x: "0",
1091
+ y: "10",
1092
+ class: "center-text-label",
1093
+ "font-size": rt.value,
1094
+ "font-family": "system-ui, -apple-system, sans-serif",
1095
+ "font-weight": "600",
1096
+ "text-anchor": "middle",
1097
+ "dominant-baseline": "middle"
1098
+ }, x(Ge.value), 9, we)], 8, Se),
1099
+ (h(!0), o(e, null, v(Z.value.filter((e) => e.midY >= it.value), (e) => (h(), o("g", {
1100
+ key: "slice-sub-front-" + e.item.id + "-" + e.midAngle,
1101
+ class: d(["slice-group-3d", {
1102
+ "is-hovered": w.value === e.item.id,
1103
+ "is-dimmed": w.value !== null && w.value !== e.item.id
1104
+ }]),
1105
+ style: f(ot(e))
1106
+ }, [
1107
+ t.isExpanded && e.innerWallPath ? (h(), o("path", {
1108
+ key: 0,
1109
+ d: e.innerWallPath,
1110
+ fill: `url(#inner-grad-${z(e.item.id)})`
1111
+ }, null, 8, Te)) : a("", !0),
1112
+ t.isExpanded && e.innerWallStrokePath ? (h(), o("path", {
1113
+ key: 1,
1114
+ d: e.innerWallStrokePath,
1115
+ fill: "none",
1116
+ stroke: `url(#inner-grad-${z(e.item.id)})`,
1117
+ "stroke-width": "0.8",
1118
+ "stroke-linejoin": "round"
1119
+ }, null, 8, Ee)) : a("", !0),
1120
+ t.isExpanded && e.startCutPath ? (h(), o("path", {
1121
+ key: 2,
1122
+ d: e.startCutPath,
1123
+ fill: N(e.color, .65)
1124
+ }, null, 8, De)) : a("", !0),
1125
+ t.isExpanded && e.endCutPath ? (h(), o("path", {
1126
+ key: 3,
1127
+ d: e.endCutPath,
1128
+ fill: N(e.color, .75)
1129
+ }, null, 8, Oe)) : a("", !0),
1130
+ t.isExpanded && e.outerWallPath ? (h(), o("path", {
1131
+ key: 4,
1132
+ d: e.outerWallPath,
1133
+ fill: `url(#outer-grad-${z(e.item.id)})`
1134
+ }, null, 8, ke)) : a("", !0),
1135
+ t.isExpanded && e.outerWallStrokePath ? (h(), o("path", {
1136
+ key: 5,
1137
+ d: e.outerWallStrokePath,
1138
+ fill: "none",
1139
+ stroke: `url(#outer-grad-${z(e.item.id)})`,
1140
+ "stroke-width": "0.8",
1141
+ "stroke-linejoin": "round"
1142
+ }, null, 8, Ae)) : a("", !0),
1143
+ $(e) ? (h(), o("path", {
1144
+ key: 6,
1145
+ d: e.originalTopPath,
1146
+ fill: `url(#top-grad-${z(e.item.id)})`
1147
+ }, null, 8, je)) : a("", !0),
1148
+ $(e) ? (h(), o("path", {
1149
+ key: 7,
1150
+ d: e.topStrokePath,
1151
+ fill: "none",
1152
+ stroke: `url(#top-grad-${z(e.item.id)})`,
1153
+ "stroke-width": "0.8",
1154
+ "stroke-linejoin": "round"
1155
+ }, null, 8, Me)) : a("", !0),
1156
+ $(e) ? (h(), o("path", {
1157
+ key: 8,
1158
+ d: e.topStrokePath,
1159
+ fill: "none",
1160
+ stroke: "rgba(255, 255, 255, 0.16)",
1161
+ "stroke-width": t.isExpanded ? .8 : .5,
1162
+ "stroke-linejoin": "round"
1163
+ }, null, 8, Ne)) : a("", !0)
1164
+ ], 6))), 128)),
1165
+ (h(!0), o(e, null, v(at.value, (e) => (h(), o("g", {
1166
+ key: "hover-trigger-" + e.item.id,
1167
+ class: "hover-trigger-group",
1168
+ style: f({ cursor: c.selectable && !j.value ? "pointer" : "default" }),
1169
+ onMouseenter: (t) => D(e.item.id),
1170
+ onMouseleave: r[0] ||= (e) => y.value = null,
1171
+ onClick: (t) => E(e.item.id)
1172
+ }, [s("path", {
1173
+ d: e.hoverPath || e.originalTopPath,
1174
+ fill: "transparent"
1175
+ }, null, 8, Fe), e.originalOuterWallPath ? (h(), o("path", {
1176
+ key: 0,
1177
+ d: e.originalOuterWallPath,
1178
+ fill: "transparent"
1179
+ }, null, 8, Ie)) : a("", !0)], 44, Pe))), 128)),
1180
+ s("g", {
1181
+ class: "labels-layer",
1182
+ style: f({
1183
+ opacity: X.value,
1184
+ pointerEvents: X.value > .01 ? "auto" : "none"
1185
+ })
1186
+ }, [(h(!0), o(e, null, v(ct.value, (e, t) => (h(), o("g", {
1187
+ key: "label-left-" + e.item.id,
1188
+ class: d(["label-group", {
1189
+ "is-hovered": w.value === e.item.id,
1190
+ "is-dimmed": w.value !== null && w.value !== e.item.id
1191
+ }]),
1192
+ onMouseenter: (t) => D(e.item.id),
1193
+ onMouseleave: r[1] ||= (e) => y.value = null,
1194
+ onClick: (t) => E(e.item.id),
1195
+ style: f({ cursor: c.selectable && !j.value ? "pointer" : "default" })
1196
+ }, [s("path", {
1197
+ d: ut(e),
1198
+ fill: "none",
1199
+ stroke: e.color,
1200
+ "stroke-width": "1.2"
1201
+ }, null, 8, Re), s("text", {
1202
+ x: "85",
1203
+ y: e.finalY,
1204
+ fill: e.color,
1205
+ "font-size": "11",
1206
+ "font-weight": "600",
1207
+ "font-family": "system-ui, -apple-system, sans-serif",
1208
+ "text-anchor": "end",
1209
+ "dominant-baseline": "middle",
1210
+ style: f(w.value === e.item.id ? "transform: translate(0, -5px);" : "")
1211
+ }, x(R(e.item.name, 24)) + " " + x(L(e.item.value)) + " " + x(e.item.unit || "") + " (" + x(e.item.percentage) + "%) ", 13, ze)], 46, Le))), 128)), (h(!0), o(e, null, v(lt.value, (e, t) => (h(), o("g", {
1212
+ key: "label-right-" + e.item.id,
1213
+ class: d(["label-group", {
1214
+ "is-hovered": w.value === e.item.id,
1215
+ "is-dimmed": w.value !== null && w.value !== e.item.id
1216
+ }]),
1217
+ onMouseenter: (t) => D(e.item.id),
1218
+ onMouseleave: r[2] ||= (e) => y.value = null,
1219
+ onClick: (t) => E(e.item.id),
1220
+ style: f({ cursor: c.selectable && !j.value ? "pointer" : "default" })
1221
+ }, [s("path", {
1222
+ d: ut(e),
1223
+ fill: "none",
1224
+ stroke: e.color,
1225
+ "stroke-width": "1.2"
1226
+ }, null, 8, Ve), s("text", {
1227
+ x: "675",
1228
+ y: e.finalY,
1229
+ fill: e.color,
1230
+ "font-size": "11",
1231
+ "font-weight": "600",
1232
+ "font-family": "system-ui, -apple-system, sans-serif",
1233
+ "text-anchor": "start",
1234
+ "dominant-baseline": "middle",
1235
+ style: f(w.value === e.item.id ? "transform: translate(0, -5px);" : "")
1236
+ }, x(R(e.item.name, 24)) + " " + x(L(e.item.value)) + " " + x(e.item.unit || "") + " (" + x(e.item.percentage) + "%) ", 13, He)], 46, Be))), 128))], 4)
1237
+ ]))], 8, ee))], 2));
1238
+ }
1239
+ }, [["__scopeId", "data-v-fcf8b2a7"]]);
1240
+ //#endregion
1241
+ //#region src/index.js
1242
+ O.init("nano-ui", "https://analytics.7u.pl");
1243
+ var We = { install(e) {
1244
+ e.directive("ripple", k), e.directive("tooltip", N), e.component("GlobalTooltip", F), e.component("NanoModal", B), e.component("ThreeDDonutChart", Ue);
326
1245
  } };
327
1246
  //#endregion
328
- export { A as GlobalTooltip, N as NanoModal, T as Ripple, P as default, O as hideTooltip, D as showTooltip, k as tooltipDirective, E as tooltipState };
1247
+ export { F as GlobalTooltip, B as NanoModal, k as Ripple, Ue as ThreeDDonutChart, We as default, M as hideTooltip, j as showTooltip, N as tooltipDirective, A as tooltipState };