@tenorlab/react-dashboard 1.0.6 → 1.0.7

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 (35) hide show
  1. package/dist/components/DashboardGrid.d.ts +2 -0
  2. package/dist/components/DashboardWidgetBase.d.ts +4 -0
  3. package/dist/components/DynamicWidgetLoader.d.ts +23 -0
  4. package/dist/components/WidgetContainer.d.ts +4 -0
  5. package/dist/components/WidgetsCatalogFlyout.d.ts +14 -0
  6. package/dist/components/dashboard-primitives/Buttons.d.ts +2 -0
  7. package/dist/components/dashboard-primitives/DraggablePanel.d.ts +10 -0
  8. package/dist/components/dashboard-primitives/ListItem.d.ts +14 -0
  9. package/dist/components/dashboard-primitives/Stack.d.ts +9 -0
  10. package/dist/components/dashboard-primitives/TextField.d.ts +6 -0
  11. package/dist/components/dashboard-primitives/Wrappers.d.ts +6 -0
  12. package/dist/components/dashboard-primitives/color-utils.d.ts +12 -0
  13. package/dist/components/dashboard-primitives/css-vars-utils.d.ts +6 -0
  14. package/dist/components/dashboard-primitives/icons/index.d.ts +29 -0
  15. package/dist/components/dashboard-primitives/index.d.ts +13 -0
  16. package/dist/components/dashboard-primitives/interfaces.d.ts +46 -0
  17. package/dist/components/dashboard-primitives/parse-container-title.d.ts +2 -0
  18. package/dist/components/dashboard-primitives/use-distinct-css-classes.d.ts +1 -0
  19. package/dist/components/dashboard-settings/dashboard-settings-utils.d.ts +4 -0
  20. package/dist/components/dashboard-settings/dashboard-settings.d.ts +2 -0
  21. package/dist/components/dashboard-settings/index.d.ts +2 -0
  22. package/dist/components/index.d.ts +11 -0
  23. package/dist/components/interfaces/core-react.interfaces.d.ts +21 -0
  24. package/dist/components/interfaces/core.base.d.ts +80 -0
  25. package/dist/components/interfaces/core.interfaces.d.ts +39 -0
  26. package/dist/components/interfaces/core.utils.d.ts +51 -0
  27. package/dist/components/interfaces/index.d.ts +5 -0
  28. package/dist/components/interfaces/storage-service.interfaces.d.ts +8 -0
  29. package/dist/components/use-dashboard-storage-service.d.ts +2 -0
  30. package/dist/components/use-dashboard-store.d.ts +33 -0
  31. package/dist/components/use-dashboard-undo-service.d.ts +13 -0
  32. package/dist/index.d.ts +2 -0
  33. package/dist/react-dashboard.css +1 -0
  34. package/dist/react-dashboard.es.js +3230 -0
  35. package/package.json +1 -1
@@ -0,0 +1,3230 @@
1
+ import se, { useState as ce, useCallback as ue, useMemo as at, forwardRef as le, useRef as xt, Suspense as wt, useEffect as Ct } from "react";
2
+ import { jsxs as W, jsx as a } from "react/jsx-runtime";
3
+ import st from "react-dom";
4
+ const St = [
5
+ {
6
+ key: "grid-gap",
7
+ displayName: "Gap",
8
+ description: "Set the gap between widgets in the dashboard grid",
9
+ cssProperty: "--bwj-dashboard-gap",
10
+ step: 0.1,
11
+ defaultUnit: "rem",
12
+ minValue: 0,
13
+ defaultValue: "1.25rem",
14
+ value: "1.25rem"
15
+ },
16
+ {
17
+ key: "widget-width",
18
+ displayName: "Widget Width",
19
+ description: "Set the min width for the widgets",
20
+ cssProperty: "--bwj-widget-width",
21
+ step: 0.1,
22
+ defaultUnit: "rem",
23
+ minValue: 6,
24
+ defaultValue: "21rem",
25
+ value: "21rem"
26
+ },
27
+ {
28
+ key: "widget-border-radius",
29
+ displayName: "Widget Border Radius",
30
+ description: "Set the border radius for the widgets",
31
+ cssProperty: "--bwj-widget-border-radius",
32
+ step: 0.1,
33
+ defaultUnit: "rem",
34
+ minValue: 0,
35
+ defaultValue: "0.33rem",
36
+ value: "0.33rem"
37
+ },
38
+ {
39
+ key: "widget-inner-padding-x",
40
+ displayName: "Widget Horiz Padding",
41
+ description: "Set the horizontal padding for the widgets",
42
+ cssProperty: "--bwj-widget-inner-px",
43
+ step: 0.1,
44
+ defaultUnit: "rem",
45
+ minValue: 0,
46
+ defaultValue: "1.0rem",
47
+ value: "1.0rem"
48
+ },
49
+ {
50
+ key: "widget-inner-padding-y",
51
+ displayName: "Widget Vertical Padding",
52
+ description: "Set the vertical padding for the widgets",
53
+ cssProperty: "--bwj-widget-inner-py",
54
+ step: 0.1,
55
+ defaultUnit: "rem",
56
+ minValue: 0,
57
+ defaultValue: "0.75rem",
58
+ value: "0.75rem"
59
+ },
60
+ {
61
+ key: "widget-header-padding-y",
62
+ displayName: "Widget Header Vertical Padding",
63
+ description: "Set the vertical padding for the widget headers",
64
+ cssProperty: "--bwj-widget-header-py",
65
+ step: 0.1,
66
+ defaultUnit: "rem",
67
+ minValue: 0,
68
+ defaultValue: "1.0rem",
69
+ value: "1.0rem"
70
+ },
71
+ {
72
+ key: "widget-title-font-size",
73
+ displayName: "Widget Title Font Size",
74
+ description: "Set the font size for the widget titles",
75
+ cssProperty: "--bwj-widget-title-size",
76
+ step: 0.1,
77
+ defaultUnit: "rem",
78
+ minValue: 0,
79
+ defaultValue: "1.0rem",
80
+ value: "1.0rem"
81
+ }
82
+ ], Dt = ["rem", "pc", "cm", "in", "em", "vh", "vw", "%"], Tt = (e, n) => Dt.includes(e) ? n : 1, Nt = {
83
+ incrementOrDecrementValue: (e, n) => {
84
+ const t = e.value.match(/([\d.]+)/), r = t ? parseFloat(t[1]) : 0, i = e.value.match(/([^\d.]+)/), o = i ? i[1] : e.defaultUnit, s = Tt(o, e.step) * n, y = `${Math.max(r + s, e.minValue).toFixed(1)}${o}`;
85
+ return {
86
+ ...e,
87
+ value: y
88
+ };
89
+ }
90
+ }, Ce = {
91
+ userID: 0,
92
+ clientAppKey: "",
93
+ dashboardId: "default",
94
+ dashboardName: "Default",
95
+ zoomScale: 1,
96
+ responsiveGrid: !1,
97
+ widgets: [],
98
+ childWidgetsConfig: [],
99
+ cssSettings: [...St]
100
+ }, Ae = 0.7, Le = 1, Et = 0.05, lt = (e) => {
101
+ let n = Number(e || 0);
102
+ return n < Ae && (n = Ae), n > Le && (n = Le), n;
103
+ }, Nn = (e, n) => {
104
+ let t = Number(Number((Et * n).toFixed(2)).toFixed(2)), r = Number((Number(e) + t).toFixed(2));
105
+ return lt(r);
106
+ }, En = (e) => {
107
+ let n = {
108
+ ...e
109
+ };
110
+ return n.widgets = n.widgets.filter((t) => {
111
+ if (`${t}`.includes("WidgetContainer")) {
112
+ const r = n.childWidgetsConfig.filter(
113
+ (i) => i.parentWidgetKey === t
114
+ );
115
+ if (!r || r.length === 0)
116
+ return n.widgets = n.widgets.filter(
117
+ (i) => i !== t
118
+ ), !1;
119
+ }
120
+ return !0;
121
+ }), n;
122
+ }, _t = (e) => {
123
+ const n = e.widgets.filter(
124
+ (r) => r.includes("WidgetContainer")
125
+ ), t = {};
126
+ return n.forEach((r, i) => {
127
+ const d = `${r.split("_container")[0]}_container${i + 1}`;
128
+ t[r] = d;
129
+ }), e.widgets = e.widgets.map((r) => t[r] || r), e.childWidgetsConfig = e.childWidgetsConfig.map((r) => {
130
+ const i = r.parentWidgetKey, o = t[i];
131
+ return {
132
+ ...r,
133
+ // If a new key exists, use it. If not, keep the original key.
134
+ parentWidgetKey: o || i
135
+ };
136
+ }), e;
137
+ }, xe = (e, n) => {
138
+ const t = `${e}`.includes("Container"), r = t ? ["Container"] : ["Widget"], i = n?.title || e, o = n?.description || (t ? "Container" : "Unknown");
139
+ return {
140
+ title: i,
141
+ displayName: e,
142
+ description: o,
143
+ categories: r,
144
+ noDuplicatedWidgets: !0,
145
+ icon: void 0
146
+ };
147
+ }, _n = (e, n, t) => {
148
+ const r = n[e];
149
+ return r || xe(e, t);
150
+ }, Mt = (e, n) => {
151
+ const r = n.get(e)?.meta;
152
+ return r || xe(e);
153
+ }, Mn = (e, n, t) => {
154
+ const r = t || xe(e);
155
+ return [
156
+ e,
157
+ {
158
+ key: e,
159
+ title: r.displayName,
160
+ isContainer: `${e}`.includes("Container"),
161
+ meta: r,
162
+ component: n
163
+ }
164
+ ];
165
+ }, Pt = (e, n, t) => {
166
+ const r = t || xe(e);
167
+ return [
168
+ e,
169
+ {
170
+ key: e,
171
+ title: r.displayName,
172
+ isContainer: !1,
173
+ meta: r,
174
+ loader: n
175
+ }
176
+ ];
177
+ }, Pn = (e) => {
178
+ const n = e.match(/\/widget-([a-zA-Z0-9-]+)\/index\.ts$/);
179
+ if (n && n[1]) {
180
+ const t = n[1], r = `Widget${t.split("-").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join("")}`, i = t.split("-").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
181
+ return { key: r, title: i, folder: t };
182
+ }
183
+ return null;
184
+ }, $n = async (e) => new Promise(async (n, t) => {
185
+ const r = [];
186
+ try {
187
+ const o = await (await fetch(`${e}?${Math.random()}`)).json();
188
+ for (const s in o) {
189
+ const d = o[s], y = () => import(
190
+ /* @vite-ignore */
191
+ d.url
192
+ ), m = {
193
+ displayName: d.meta.displayName,
194
+ description: d.meta.description || "Remote Plugin",
195
+ categories: d.meta.categories || ["Widget"],
196
+ noDuplicatedWidgets: d.meta.noDuplicatedWidgets ?? !0,
197
+ icon: void 0
198
+ // Or a logic to map a string name to a Lucide component
199
+ };
200
+ r.push(Pt(s, y, m));
201
+ }
202
+ n({
203
+ entries: r,
204
+ message: "",
205
+ details: ""
206
+ });
207
+ } catch (i) {
208
+ console.error("Remote plugin discovery failed:", i), t({
209
+ entries: [],
210
+ message: "Remote plugin discovery failed:",
211
+ details: typeof i == "object" ? JSON.stringify(i) : i
212
+ });
213
+ }
214
+ }), Fe = (e) => {
215
+ let n;
216
+ const t = /* @__PURE__ */ new Set(), r = (m, h) => {
217
+ const u = typeof m == "function" ? m(n) : m;
218
+ if (!Object.is(u, n)) {
219
+ const g = n;
220
+ n = h ?? (typeof u != "object" || u === null) ? u : Object.assign({}, n, u), t.forEach((p) => p(n, g));
221
+ }
222
+ }, i = () => n, d = { setState: r, getState: i, getInitialState: () => y, subscribe: (m) => (t.add(m), () => t.delete(m)) }, y = n = e(r, i, d);
223
+ return d;
224
+ }, $t = ((e) => e ? Fe(e) : Fe), Wt = (e) => e;
225
+ function It(e, n = Wt) {
226
+ const t = se.useSyncExternalStore(
227
+ e.subscribe,
228
+ se.useCallback(() => n(e.getState()), [e, n]),
229
+ se.useCallback(() => n(e.getInitialState()), [e, n])
230
+ );
231
+ return se.useDebugValue(t), t;
232
+ }
233
+ const Ot = (e) => {
234
+ const n = $t(e), t = (r) => It(n, r);
235
+ return Object.assign(t, n), t;
236
+ }, Rt = ((e) => Ot), jt = (e) => {
237
+ const n = e.widgets.filter((r) => r.includes("WidgetContainer")).map((r) => Number(r.split("_")[1].replace("container", "")));
238
+ return `container${n.length > 0 ? Math.max(...n) + 1 : 1}`;
239
+ }, kt = (e, n) => {
240
+ const t = jt(e);
241
+ return `${n}_${t}`;
242
+ }, At = (e) => {
243
+ const { dashboardConfig: n, widgetKey: t, parentWidgetKey: r, noDuplicatedWidgets: i } = e;
244
+ if (r) {
245
+ if (i && n.childWidgetsConfig.find(
246
+ (s) => s.parentWidgetKey === r && s.widgetKey === t
247
+ ))
248
+ return {
249
+ success: !1,
250
+ message: `DashboardStore: addWidget: Widget already added (${t})`,
251
+ updatedDashboardConfig: n
252
+ };
253
+ const o = [
254
+ ...n.childWidgetsConfig,
255
+ { parentWidgetKey: r, widgetKey: t }
256
+ // new entry
257
+ ];
258
+ return {
259
+ success: !0,
260
+ updatedDashboardConfig: {
261
+ ...n,
262
+ childWidgetsConfig: o
263
+ }
264
+ };
265
+ } else {
266
+ if (i && n.widgets.includes(t))
267
+ return {
268
+ success: !1,
269
+ message: `DashboardStore: addWidget: Widget already added (${t})`,
270
+ updatedDashboardConfig: n
271
+ };
272
+ const o = [...n.widgets, t];
273
+ return {
274
+ success: !0,
275
+ updatedDashboardConfig: {
276
+ ...n,
277
+ widgets: o
278
+ }
279
+ };
280
+ }
281
+ }, Lt = (e, n, t) => {
282
+ if ((t || "").trim().length > 0) {
283
+ const r = e.childWidgetsConfig.filter(
284
+ (y) => y.parentWidgetKey !== t
285
+ ), i = e.childWidgetsConfig.filter(
286
+ (y) => y.parentWidgetKey === t && y.widgetKey !== n
287
+ ), o = [...r, ...i];
288
+ let s = {
289
+ ...e,
290
+ childWidgetsConfig: o
291
+ };
292
+ return `${n}`.includes("Container") && (s = _t(s)), {
293
+ success: !0,
294
+ updatedDashboardConfig: s
295
+ };
296
+ } else {
297
+ const r = e.widgets.filter((o) => o !== n), i = e.childWidgetsConfig.filter(
298
+ (o) => o.parentWidgetKey !== n
299
+ );
300
+ return {
301
+ success: !0,
302
+ updatedDashboardConfig: {
303
+ ...e,
304
+ widgets: r,
305
+ childWidgetsConfig: i
306
+ }
307
+ };
308
+ }
309
+ }, Ft = (e, n, t, r) => {
310
+ if ((r || "").trim().length > 0) {
311
+ const i = e.childWidgetsConfig.filter(
312
+ (h) => h.parentWidgetKey !== r
313
+ );
314
+ let o = e.childWidgetsConfig.filter(
315
+ (h) => h.parentWidgetKey === r
316
+ );
317
+ const s = o.indexOf(t);
318
+ let d = s + n;
319
+ if (d = Math.max(0, d), d = Math.min(o.length - 1, d), d === s)
320
+ return {
321
+ success: !1,
322
+ message: `DashboardStore: moveWidget: Widget already at min/max position (${t})`,
323
+ updatedDashboardConfig: e
324
+ };
325
+ const y = [...o], [m] = y.splice(s, 1);
326
+ return y.splice(d, 0, m), {
327
+ success: !0,
328
+ updatedDashboardConfig: {
329
+ ...e,
330
+ childWidgetsConfig: [...i, ...y]
331
+ }
332
+ };
333
+ } else {
334
+ const i = e.widgets || [], o = i.indexOf(t);
335
+ let s = o + n;
336
+ if (s = Math.max(0, s), s = Math.min(i.length - 1, s), s === o)
337
+ return {
338
+ success: !1,
339
+ message: `DashboardStore: moveWidget: Widget already at min/max position (${t})`,
340
+ updatedDashboardConfig: e
341
+ };
342
+ const d = [...i], [y] = d.splice(o, 1);
343
+ return d.splice(s, 0, y), {
344
+ success: !0,
345
+ updatedDashboardConfig: {
346
+ ...e,
347
+ widgets: d
348
+ }
349
+ };
350
+ }
351
+ }, Ut = (e, n) => ({
352
+ isLoading: !1,
353
+ isEditing: !1,
354
+ allDashboardConfigs: [Ce],
355
+ currentDashboardConfig: Ce,
356
+ targetContainerKey: void 0,
357
+ getNextContainerKey: (t) => kt(n().currentDashboardConfig, t),
358
+ setIsLoading: (t) => (e(() => ({ isLoading: t })), t),
359
+ setIsEditing: (t) => {
360
+ let r = n().targetContainerKey;
361
+ return t || (r = void 0), e(() => ({ isEditing: t, targetContainerKey: r })), t;
362
+ },
363
+ setTargetContainerKey: (t) => (e(() => ({ targetContainerKey: t })), t),
364
+ setAllDashboardConfigs: (t) => (e(() => ({ allDashboardConfigs: t })), n().allDashboardConfigs),
365
+ setCurrentDashboardConfig: (t) => {
366
+ const r = n(), i = [
367
+ ...r.allDashboardConfigs.filter((o) => o.dashboardId !== t.dashboardId),
368
+ t
369
+ ];
370
+ return e(() => ({
371
+ ...r,
372
+ allDashboardConfigs: i,
373
+ currentDashboardConfig: t
374
+ })), i;
375
+ },
376
+ addDashboardConfig: (t) => {
377
+ const r = n(), i = [
378
+ ...r.allDashboardConfigs.filter((o) => o.dashboardId !== t.dashboardId),
379
+ t
380
+ ];
381
+ return e(() => ({
382
+ ...r,
383
+ allDashboardConfigs: i,
384
+ currentDashboardConfig: t
385
+ })), i;
386
+ },
387
+ deleteDashboardConfigById: (t) => {
388
+ const r = n(), i = [...r.allDashboardConfigs.filter((o) => o.dashboardId !== t)];
389
+ return e(() => ({
390
+ ...r,
391
+ allDashboardConfigs: i,
392
+ currentDashboardConfig: i[0] || Ce
393
+ })), i;
394
+ },
395
+ selectDashboardById: (t) => (e(() => {
396
+ const r = n(), i = r.allDashboardConfigs.find((o) => o.dashboardId === t);
397
+ return i ? {
398
+ currentDashboardConfig: i
399
+ } : {
400
+ ...r
401
+ };
402
+ }), n().currentDashboardConfig),
403
+ addWidget: (t) => {
404
+ const r = n(), i = At({
405
+ dashboardConfig: r.currentDashboardConfig,
406
+ ...t
407
+ }), o = [
408
+ ...r.allDashboardConfigs.filter(
409
+ (s) => s.dashboardId !== i.updatedDashboardConfig.dashboardId
410
+ ),
411
+ i.updatedDashboardConfig
412
+ ];
413
+ return i.success && e(() => ({
414
+ allDashboardConfigs: o,
415
+ currentDashboardConfig: i.updatedDashboardConfig
416
+ })), {
417
+ ...i,
418
+ allUpdatedDashboardConfigs: o
419
+ };
420
+ },
421
+ removeWidget: (t, r) => {
422
+ const i = n(), o = Lt(i.currentDashboardConfig, t, r), s = [
423
+ ...i.allDashboardConfigs.filter(
424
+ (d) => d.dashboardId !== o.updatedDashboardConfig.dashboardId
425
+ ),
426
+ o.updatedDashboardConfig
427
+ ];
428
+ return o.success && e(() => ({
429
+ allDashboardConfigs: s,
430
+ currentDashboardConfig: o.updatedDashboardConfig
431
+ })), {
432
+ ...o,
433
+ allUpdatedDashboardConfigs: s
434
+ };
435
+ },
436
+ moveWidget: (t, r, i) => {
437
+ const o = n(), s = Ft(o.currentDashboardConfig, t, r, i), d = [
438
+ ...o.allDashboardConfigs.filter(
439
+ (y) => y.dashboardId !== s.updatedDashboardConfig.dashboardId
440
+ ),
441
+ s.updatedDashboardConfig
442
+ ];
443
+ return s.success && e(() => ({
444
+ allDashboardConfigs: d,
445
+ currentDashboardConfig: s.updatedDashboardConfig
446
+ })), {
447
+ ...s,
448
+ allUpdatedDashboardConfigs: d
449
+ };
450
+ }
451
+ }), Wn = Rt()((...e) => ({
452
+ ...Ut(...e)
453
+ })), ct = (e, n) => `dashboards_${n}_${e}`, Vt = async (e, n, t, r) => {
454
+ const i = localStorage.getItem(ct(e, n));
455
+ if (i)
456
+ try {
457
+ const o = JSON.parse(i);
458
+ return o.length < 1 ? [r] : (o.forEach((s) => {
459
+ s.dashboardId || (s.dashboardId = "default"), s.dashboardName || (s.dashboardName = `Dashboard ${s.dashboardId}`), s.responsiveGrid = s.responsiveGrid ?? !1, (s.widgets || []).length < 1 && (s.widgets = r.widgets);
460
+ const d = (s.cssSettings || []).filter(
461
+ (y) => r.cssSettings.some((m) => m.key === y.key)
462
+ );
463
+ if (d.length < 1)
464
+ s.cssSettings = [...r.cssSettings];
465
+ else {
466
+ d.forEach((m) => {
467
+ m.value = (m.value || "").replace(/NaN/g, "");
468
+ const h = r.cssSettings.find(
469
+ (u) => u.key === m.key
470
+ );
471
+ h && (Object.keys(h).forEach((u) => {
472
+ u in m || (m[u] = h[u]);
473
+ }), m.step = h.step, m.minValue = h.minValue, m.defaultValue = h.defaultValue, m.defaultUnit = h.defaultUnit, /\d+/g.test(m.value) === !1 && (m.value = h ? h.value : "1.0rem"));
474
+ });
475
+ const y = r.cssSettings.filter((m) => !d.some(
476
+ (h) => h.key === m.key
477
+ ));
478
+ s.cssSettings = [...d, ...y];
479
+ }
480
+ s.widgets = s.widgets.filter(
481
+ (y) => y.includes("WidgetContainer") || t.has(y)
482
+ ), s.childWidgetsConfig = s.childWidgetsConfig.filter(
483
+ (y) => t.has(y.widgetKey)
484
+ ), s.zoomScale ? s.zoomScale < 0.7 && (s.zoomScale = 0.7) : s.zoomScale = 1;
485
+ }), o);
486
+ } catch (o) {
487
+ console.warn("Error parsing saved dashboard config:", o);
488
+ }
489
+ return [r];
490
+ }, Yt = async (e, n, t, r) => {
491
+ t.forEach((o) => {
492
+ if (o.userID = e, o.clientAppKey = n, o.responsiveGrid = o.responsiveGrid ?? !1, typeof o != "object")
493
+ throw new Error("Invalid dashboard configuration");
494
+ o.widgets = o.widgets.filter(
495
+ (s) => s.includes("WidgetContainer") || r.has(s)
496
+ ), o.childWidgetsConfig = o.childWidgetsConfig.filter(
497
+ (s) => r.has(s.widgetKey)
498
+ ), o.zoomScale ? o.zoomScale < 0.7 && (o.zoomScale = 0.7) : o.zoomScale = 1;
499
+ });
500
+ const i = JSON.stringify(t);
501
+ return localStorage.setItem(ct(e, n), i), !0;
502
+ }, qt = {
503
+ getSavedDashboards: Vt,
504
+ saveDashboards: Yt
505
+ }, In = () => qt, On = () => {
506
+ const [e, n] = ce({}), [t, r] = ce({}), i = ue((h) => {
507
+ const u = h.dashboardId;
508
+ n((g) => {
509
+ const p = {
510
+ undoIndex: 0,
511
+ config: h
512
+ };
513
+ return r((w) => ({
514
+ ...w,
515
+ [u]: 0
516
+ })), {
517
+ ...g,
518
+ [u]: [p]
519
+ // Forces a reset to just this one entry
520
+ };
521
+ });
522
+ }, []), o = ue(
523
+ (h) => {
524
+ n((u) => {
525
+ const g = h.dashboardId, p = u[g] || [], w = t[g] ?? -1, v = p.slice(0, w + 1), b = {
526
+ undoIndex: v.length,
527
+ // New index based on trimmed length
528
+ config: h
529
+ }, C = [...v, b];
530
+ return r((T) => ({
531
+ ...T,
532
+ [g]: C.length - 1
533
+ // Index is now the last element's index
534
+ })), {
535
+ ...u,
536
+ [g]: C
537
+ };
538
+ });
539
+ },
540
+ [t]
541
+ ), s = ue((h) => {
542
+ n((u) => {
543
+ if (!u[h])
544
+ return u;
545
+ const { [h]: g, ...p } = u;
546
+ return p;
547
+ }), r((u) => {
548
+ const { [h]: g, ...p } = u;
549
+ return p;
550
+ });
551
+ }, []), d = ue(
552
+ (h) => {
553
+ r((u) => {
554
+ const g = u[h] ?? -1, p = Math.max(0, g - 1);
555
+ return p !== g ? { ...u, [h]: p } : u;
556
+ });
557
+ },
558
+ [
559
+ //loadConfigFromHistory
560
+ ]
561
+ ), y = ue(
562
+ (h) => {
563
+ r((u) => {
564
+ const g = e[h]?.length || 0, p = u[h] ?? -1, w = Math.min(g - 1, p + 1);
565
+ return w !== p ? { ...u, [h]: w } : u;
566
+ });
567
+ },
568
+ [
569
+ e
570
+ //loadConfigFromHistory,
571
+ ]
572
+ );
573
+ return {
574
+ initializeHistoryForDashboard: i,
575
+ resetAllHistory: () => n({}),
576
+ addUndoEntry: o,
577
+ removeUndoHistoryForDashboard: s,
578
+ undo: d,
579
+ redo: y,
580
+ getUndoStatus: (h) => {
581
+ const u = t[h] ?? -1, g = e[h]?.length || 0, p = u <= 0, w = u >= g - 1;
582
+ return { isUndoDisabled: p, isRedoDisabled: w };
583
+ },
584
+ undoHistory: e,
585
+ historyIndex: t
586
+ // (Optional: You might expose undoHistory and historyIndex if needed for debugging)
587
+ };
588
+ };
589
+ function K({
590
+ children: e,
591
+ className: n
592
+ }) {
593
+ return /* @__PURE__ */ a(
594
+ "svg",
595
+ {
596
+ xmlns: "http://www.w3.org/2000/svg",
597
+ width: "24",
598
+ height: "24",
599
+ viewBox: "0 0 24 24",
600
+ fill: "none",
601
+ stroke: "currentColor",
602
+ strokeWidth: "2",
603
+ strokeLinecap: "round",
604
+ strokeLinejoin: "round",
605
+ className: n,
606
+ children: e
607
+ }
608
+ );
609
+ }
610
+ function Rn({ className: e }) {
611
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-circle-plus-icon lucide-circle-plus ${e}`, children: [
612
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
613
+ /* @__PURE__ */ a("path", { d: "M8 12h8" }),
614
+ /* @__PURE__ */ a("path", { d: "M12 8v8" })
615
+ ] });
616
+ }
617
+ function jn({ className: e }) {
618
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-trash2-icon lucide-trash-2 ${e}`, children: [
619
+ /* @__PURE__ */ a("path", { d: "M10 11v6" }),
620
+ /* @__PURE__ */ a("path", { d: "M14 11v6" }),
621
+ /* @__PURE__ */ a("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
622
+ /* @__PURE__ */ a("path", { d: "M3 6h18" }),
623
+ /* @__PURE__ */ a("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
624
+ ] });
625
+ }
626
+ function kn({ className: e }) {
627
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-square-pen-icon lucide-square-pen ${e}`, children: [
628
+ /* @__PURE__ */ a("path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
629
+ /* @__PURE__ */ a("path", { d: "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" })
630
+ ] });
631
+ }
632
+ function An({ className: e }) {
633
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-grid3x3-icon lucide-grid-3x3 ${e}`, children: [
634
+ /* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
635
+ /* @__PURE__ */ a("path", { d: "M3 9h18" }),
636
+ /* @__PURE__ */ a("path", { d: "M3 15h18" }),
637
+ /* @__PURE__ */ a("path", { d: "M9 3v18" }),
638
+ /* @__PURE__ */ a("path", { d: "M15 3v18" })
639
+ ] });
640
+ }
641
+ function Ln({ className: e }) {
642
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-monitor-icon lucide-monitor ${e}`, children: [
643
+ /* @__PURE__ */ a("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
644
+ /* @__PURE__ */ a("line", { x1: "8", x2: "16", y1: "21", y2: "21" }),
645
+ /* @__PURE__ */ a("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
646
+ ] });
647
+ }
648
+ function Fn({ className: e }) {
649
+ return /* @__PURE__ */ W(
650
+ K,
651
+ {
652
+ className: `lucide lucide-monitor-smartphone-icon lucide-monitor-smartphone ${e}`,
653
+ children: [
654
+ /* @__PURE__ */ a("path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8" }),
655
+ /* @__PURE__ */ a("path", { d: "M10 19v-3.96 3.15" }),
656
+ /* @__PURE__ */ a("path", { d: "M7 19h5" }),
657
+ /* @__PURE__ */ a("rect", { width: "6", height: "10", x: "16", y: "12", rx: "2" })
658
+ ]
659
+ }
660
+ );
661
+ }
662
+ function dt({ className: e }) {
663
+ return /* @__PURE__ */ W(
664
+ K,
665
+ {
666
+ className: `lucide lucide-circle-arrow-left-icon lucide-circle-arrow-left ${e}`,
667
+ children: [
668
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
669
+ /* @__PURE__ */ a("path", { d: "m12 8-4 4 4 4" }),
670
+ /* @__PURE__ */ a("path", { d: "M16 12H8" })
671
+ ]
672
+ }
673
+ );
674
+ }
675
+ function ut({ className: e }) {
676
+ return /* @__PURE__ */ W(
677
+ K,
678
+ {
679
+ className: `lucide lucide-circle-arrow-right-icon lucide-circle-arrow-right ${e}`,
680
+ children: [
681
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
682
+ /* @__PURE__ */ a("path", { d: "m12 16 4-4-4-4" }),
683
+ /* @__PURE__ */ a("path", { d: "M8 12h8" })
684
+ ]
685
+ }
686
+ );
687
+ }
688
+ function zt({ className: e }) {
689
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-settings-icon lucide-settings ${e}`, children: [
690
+ /* @__PURE__ */ a("path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }),
691
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "3" })
692
+ ] });
693
+ }
694
+ function Un({ className: e }) {
695
+ return /* @__PURE__ */ W(
696
+ K,
697
+ {
698
+ className: `lucide lucide-tablet-smartphone-icon lucide-tablet-smartphone ${e}`,
699
+ children: [
700
+ /* @__PURE__ */ a("rect", { width: "10", height: "14", x: "3", y: "8", rx: "2" }),
701
+ /* @__PURE__ */ a("path", { d: "M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4" }),
702
+ /* @__PURE__ */ a("path", { d: "M8 18h.01" })
703
+ ]
704
+ }
705
+ );
706
+ }
707
+ function ft({ className: e }) {
708
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-circle-x-icon lucide-circle-x ${e}`, children: [
709
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
710
+ /* @__PURE__ */ a("path", { d: "m15 9-6 6" }),
711
+ /* @__PURE__ */ a("path", { d: "m9 9 6 6" })
712
+ ] });
713
+ }
714
+ function Vn({ className: e }) {
715
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-zoom-in-icon lucide-zoom-in ${e}`, children: [
716
+ /* @__PURE__ */ a("circle", { cx: "11", cy: "11", r: "8" }),
717
+ /* @__PURE__ */ a("line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }),
718
+ /* @__PURE__ */ a("line", { x1: "11", x2: "11", y1: "8", y2: "14" }),
719
+ /* @__PURE__ */ a("line", { x1: "8", x2: "14", y1: "11", y2: "11" })
720
+ ] });
721
+ }
722
+ function Yn({ className: e }) {
723
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-zoom-out-icon lucide-zoom-out ${e}`, children: [
724
+ /* @__PURE__ */ a("circle", { cx: "11", cy: "11", r: "8" }),
725
+ /* @__PURE__ */ a("line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }),
726
+ /* @__PURE__ */ a("line", { x1: "8", x2: "14", y1: "11", y2: "11" })
727
+ ] });
728
+ }
729
+ function Bt({ className: e }) {
730
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-timer-reset-icon lucide-timer-reset ${e}`, children: [
731
+ /* @__PURE__ */ a("path", { d: "M10 2h4" }),
732
+ /* @__PURE__ */ a("path", { d: "M12 14v-4" }),
733
+ /* @__PURE__ */ a("path", { d: "M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6" }),
734
+ /* @__PURE__ */ a("path", { d: "M9 17H4v5" })
735
+ ] });
736
+ }
737
+ function Kt({ className: e }) {
738
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-undo-icon lucide-undo ${e}`, children: [
739
+ /* @__PURE__ */ a("path", { d: "M3 7v6h6" }),
740
+ /* @__PURE__ */ a("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })
741
+ ] });
742
+ }
743
+ function Ht({ className: e }) {
744
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-redo-icon lucide-redo ${e}`, children: [
745
+ /* @__PURE__ */ a("path", { d: "M21 7v6h-6" }),
746
+ /* @__PURE__ */ a("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })
747
+ ] });
748
+ }
749
+ function Xt({ className: e }) {
750
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-hand-icon lucide-hand ${e}`, children: [
751
+ /* @__PURE__ */ a("path", { d: "M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2" }),
752
+ /* @__PURE__ */ a("path", { d: "M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2" }),
753
+ /* @__PURE__ */ a("path", { d: "M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8" }),
754
+ /* @__PURE__ */ a("path", { d: "M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15" })
755
+ ] });
756
+ }
757
+ function Gt({ className: e }) {
758
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-hand-grab-icon lucide-hand-grab ${e}`, children: [
759
+ /* @__PURE__ */ a("path", { d: "M18 11.5V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1.4" }),
760
+ /* @__PURE__ */ a("path", { d: "M14 10V8a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2" }),
761
+ /* @__PURE__ */ a("path", { d: "M10 9.9V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v5" }),
762
+ /* @__PURE__ */ a("path", { d: "M6 14a2 2 0 0 0-2-2a2 2 0 0 0-2 2" }),
763
+ /* @__PURE__ */ a("path", { d: "M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-4a8 8 0 0 1-8-8 2 2 0 1 1 4 0" })
764
+ ] });
765
+ }
766
+ function Zt({ className: e }) {
767
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-crosshair-icon lucide-crosshair ${e}`, children: [
768
+ /* @__PURE__ */ a("line", { x1: "22", x2: "18", y1: "12", y2: "12" }),
769
+ /* @__PURE__ */ a("line", { x1: "6", x2: "2", y1: "12", y2: "12" }),
770
+ /* @__PURE__ */ a("line", { x1: "12", x2: "12", y1: "6", y2: "2" }),
771
+ /* @__PURE__ */ a("line", { x1: "12", x2: "12", y1: "22", y2: "18" })
772
+ ] });
773
+ }
774
+ function qn({ className: e }) {
775
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-target-icon lucide-target ${e}`, children: [
776
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
777
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "6" }),
778
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "2" })
779
+ ] });
780
+ }
781
+ function Jt({ className: e }) {
782
+ return /* @__PURE__ */ W(
783
+ K,
784
+ {
785
+ className: `lucide lucide-file-question-mark-icon lucide-file-question-mark ${e}`,
786
+ children: [
787
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
788
+ /* @__PURE__ */ a("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
789
+ /* @__PURE__ */ a("path", { d: "M12 17h.01" })
790
+ ]
791
+ }
792
+ );
793
+ }
794
+ const Z = (e, ...n) => [
795
+ ...new Set(
796
+ [e || "", ...n].join(" ").trim().replace(/\n+/gi, " ").replace(/\s+/gi, " ").split(" ")
797
+ )
798
+ ].join(" ").trim(), re = (e, n = "color") => {
799
+ if (typeof window > "u") return "#FFFFFF";
800
+ const t = document.createElement("div");
801
+ Array.isArray(e) ? e.forEach((i) => t.classList.add(i)) : e.split(" ").forEach((i) => t.classList.add(i)), t.style.display = "none", document.body.appendChild(t);
802
+ const r = window.getComputedStyle(t)[n];
803
+ return document.body.removeChild(t), r;
804
+ }, zn = {
805
+ primary: re("text-primary", "color"),
806
+ secondary: re("text-secondary", "color"),
807
+ success: re("text-success", "color"),
808
+ danger: re("text-danger", "color"),
809
+ warning: re("text-warning", "color"),
810
+ info: re("text-info", "color"),
811
+ disabled: re("text-disabled", "color"),
812
+ neutral: re("text-neutral", "color"),
813
+ body: re("text-body", "color")
814
+ }, Bn = {
815
+ getCssVariableValue: (e) => {
816
+ const n = document.documentElement;
817
+ return getComputedStyle(n).getPropertyValue(e).trim() || null;
818
+ },
819
+ setCssVariableValue: (e, n) => {
820
+ document.documentElement.style.setProperty(e, n);
821
+ },
822
+ restoreCssVarsFromSettings: (e) => {
823
+ const n = document.documentElement;
824
+ e.forEach((t) => {
825
+ n.style.setProperty(t.cssProperty, t.value);
826
+ });
827
+ }
828
+ }, ht = (e) => {
829
+ const n = `${e}`.split("_");
830
+ return n.length > 1 ? n[1].replace(/(\D)(\d+)/, "$1 $2") : "Container";
831
+ }, gt = ({
832
+ label: e,
833
+ className: n,
834
+ size: t = "medium",
835
+ value: r,
836
+ onChange: i,
837
+ onKeyDown: o,
838
+ placeholder: s = ""
839
+ }) => {
840
+ const d = at(() => t === "small" ? "py-1.5 px-3 text-sm" : "py-2.5 px-4 text-base", [t]), y = Z("flex flex-col mb-4", n || ""), h = `${Z(`
841
+ block w-full rounded-md px-3 py-1.5 text-base
842
+ bg-formfield content-formfield
843
+ outline-1 -outline-offset-1 outline-primary
844
+ placeholder:text-disabled
845
+ focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-200 sm:text-sm/6
846
+ `)} ${d}`;
847
+ return /* @__PURE__ */ W("div", { className: y, children: [
848
+ /* @__PURE__ */ a("label", { htmlFor: e, className: "block text-sm/6 font-medium mb-1.5", children: e }),
849
+ /* @__PURE__ */ a(
850
+ "input",
851
+ {
852
+ id: e,
853
+ type: "text",
854
+ value: r,
855
+ onChange: i,
856
+ onKeyDown: (u) => o && o(u),
857
+ placeholder: s,
858
+ className: h,
859
+ "aria-label": e
860
+ }
861
+ )
862
+ ] });
863
+ }, Se = /* @__PURE__ */ new Map([
864
+ [
865
+ "normal",
866
+ "group bg-[category] content-[category] hover:bg-[category] group-hover:bg-[category] focus:outline-[category] focus:outline-offset-[category]"
867
+ ],
868
+ [
869
+ "ghost",
870
+ "group bg-transparent border-[category] text-[category] hover:text-[category] group-hover:text-[category] focus:outline-[category] focus:outline-offset-[category]"
871
+ ]
872
+ ]);
873
+ function J(e) {
874
+ const {
875
+ tooltip: n,
876
+ disabled: t,
877
+ isIconButton: r,
878
+ className: i,
879
+ buttonType: o,
880
+ category: s,
881
+ px: d,
882
+ py: y,
883
+ children: m,
884
+ ...h
885
+ } = e, u = () => {
886
+ const p = e.isIconButton || !1, w = e.category || "primary", v = e.buttonType || "normal", b = e.disabled || !1, C = e.className || "", T = e.font || "semibold", S = Number((e.border || 0) > 0 ? e.border : 0);
887
+ let D = (e.borderColor || "").trim();
888
+ D = D.length > 0 ? D : "";
889
+ const c = Number((e.borderHover || 0) > 0 ? e.borderHover : 0), N = e.shadow || "sm", l = e.shadowHover || "md", f = (e.addCss || "").trim(), P = e.justifyCss || "justify-center";
890
+ if (p)
891
+ return Z(
892
+ "flex flex-row items-center",
893
+ b ? "text-disabled" : `text-${w} hover:brightness-110 cursor-pointer`,
894
+ C || ""
895
+ );
896
+ const $ = [
897
+ "relative cursor-pointer",
898
+ "rounded-sm focus:outline-none focus:ring focus:ring-offset",
899
+ "transition-all duration-150",
900
+ "text-sm",
901
+ `font-${T}`
902
+ ];
903
+ if (b)
904
+ v === "ghost" ? $.push("text-disabled border-disabled cursor-not-allowed") : $.push("bg-disabled content-disabled border-disabled cursor-not-allowed");
905
+ else {
906
+ $.push("cursor-pointer");
907
+ let O = "";
908
+ Se.has(v) ? O = `${Se.get(v)}` : O = `${Se.get("normal")}`, S < 1 && (O = O.replace("border-[category]", ""));
909
+ const E = O.replace(/\[category\]/g, w).trim();
910
+ $.push(E);
911
+ }
912
+ return S > 0 ? ($.push(`border-[${S}px]`), $.push(`border-${D}`)) : ($.push("border-[1px]"), $.push("border-transparent")), c > 0 ? ($.push(`hover:border-[${c}px] group-hover:border-[${c}px]`), $.push(`hover:border-${D} group-hover:border-${D}`)) : $.push("hover:border-[1px] group-hover:border-[1px]"), $.push(`shadow-${N}`), $.push(`hover:shadow-${l} group-hover:shadow-${l}`), f.length > 0 && $.push(f), f.indexOf("hidden") === -1 && $.push("inline-flex"), $.push(P), $.join(" ").trim();
913
+ }, g = () => {
914
+ const p = e.px || 0.7, w = e.py || 0.25;
915
+ return {
916
+ padding: r ? 0 : `${w}rem ${p}rem `
917
+ };
918
+ };
919
+ return /* @__PURE__ */ a("button", { type: "button", disabled: t, className: u(), style: g(), ...h, children: m });
920
+ }
921
+ const Qt = (e) => e.direction === "row" ? Z("flex flex-row items-center gap-2", e.classNames || "") : Z("flex flex-col gap-2 w-full", e.classNames || "");
922
+ function en(e) {
923
+ const { children: n, testId: t, classNames: r, direction: i, ...o } = e, s = Qt(e);
924
+ return /* @__PURE__ */ a("div", { "data-testid": t || "not-set", className: s, ...o, children: n });
925
+ }
926
+ const Kn = le(
927
+ (e, n) => {
928
+ const { classNames: t, innerClass: r, ...i } = e, o = Z(t || "", "w-full"), s = Z(
929
+ `w-full flex overflow-hidden justify-between items-center gap-0
930
+ rounded-md border`,
931
+ r || ""
932
+ );
933
+ return /* @__PURE__ */ a(en, { direction: "row", classNames: o, ...i, children: /* @__PURE__ */ a("div", { className: s, children: e.children }) });
934
+ }
935
+ ), Hn = le((e, n) => /* @__PURE__ */ a(
936
+ "div",
937
+ {
938
+ "data-testid": e.testId || "not-set",
939
+ className: "flex items-center justify-center",
940
+ style: {
941
+ flexShrink: 0,
942
+ padding: "0.75rem 0 0.75rem 0.75rem"
943
+ },
944
+ children: e.children
945
+ }
946
+ )), Xn = le(
947
+ (e, n) => /* @__PURE__ */ a(
948
+ "div",
949
+ {
950
+ "data-testid": e.testId || "not-set",
951
+ className: "flex-1 flex flex-col gap-0 truncate p-2",
952
+ children: e.children
953
+ }
954
+ )
955
+ ), Gn = le((e, n) => /* @__PURE__ */ a(
956
+ "div",
957
+ {
958
+ "data-testid": e.testId || "not-set",
959
+ className: "flex flex-row items-center justify-between gap-1 h-full",
960
+ style: {
961
+ flexShrink: 0,
962
+ paddingRight: "0.65rem"
963
+ },
964
+ children: e.children
965
+ }
966
+ ));
967
+ function tn(e) {
968
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
969
+ }
970
+ var fe = { exports: {} }, De = {}, me = { exports: {} }, pe = { exports: {} }, V = {};
971
+ var Ue;
972
+ function nn() {
973
+ if (Ue) return V;
974
+ Ue = 1;
975
+ var e = typeof Symbol == "function" && Symbol.for, n = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, t = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, i = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, o = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, s = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, d = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, y = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, m = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, h = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, u = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, g = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, p = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, w = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, v = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, b = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, C = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, T = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
976
+ function S(c) {
977
+ if (typeof c == "object" && c !== null) {
978
+ var N = c.$$typeof;
979
+ switch (N) {
980
+ case n:
981
+ switch (c = c.type, c) {
982
+ case y:
983
+ case m:
984
+ case r:
985
+ case o:
986
+ case i:
987
+ case u:
988
+ return c;
989
+ default:
990
+ switch (c = c && c.$$typeof, c) {
991
+ case d:
992
+ case h:
993
+ case w:
994
+ case p:
995
+ case s:
996
+ return c;
997
+ default:
998
+ return N;
999
+ }
1000
+ }
1001
+ case t:
1002
+ return N;
1003
+ }
1004
+ }
1005
+ }
1006
+ function D(c) {
1007
+ return S(c) === m;
1008
+ }
1009
+ return V.AsyncMode = y, V.ConcurrentMode = m, V.ContextConsumer = d, V.ContextProvider = s, V.Element = n, V.ForwardRef = h, V.Fragment = r, V.Lazy = w, V.Memo = p, V.Portal = t, V.Profiler = o, V.StrictMode = i, V.Suspense = u, V.isAsyncMode = function(c) {
1010
+ return D(c) || S(c) === y;
1011
+ }, V.isConcurrentMode = D, V.isContextConsumer = function(c) {
1012
+ return S(c) === d;
1013
+ }, V.isContextProvider = function(c) {
1014
+ return S(c) === s;
1015
+ }, V.isElement = function(c) {
1016
+ return typeof c == "object" && c !== null && c.$$typeof === n;
1017
+ }, V.isForwardRef = function(c) {
1018
+ return S(c) === h;
1019
+ }, V.isFragment = function(c) {
1020
+ return S(c) === r;
1021
+ }, V.isLazy = function(c) {
1022
+ return S(c) === w;
1023
+ }, V.isMemo = function(c) {
1024
+ return S(c) === p;
1025
+ }, V.isPortal = function(c) {
1026
+ return S(c) === t;
1027
+ }, V.isProfiler = function(c) {
1028
+ return S(c) === o;
1029
+ }, V.isStrictMode = function(c) {
1030
+ return S(c) === i;
1031
+ }, V.isSuspense = function(c) {
1032
+ return S(c) === u;
1033
+ }, V.isValidElementType = function(c) {
1034
+ return typeof c == "string" || typeof c == "function" || c === r || c === m || c === o || c === i || c === u || c === g || typeof c == "object" && c !== null && (c.$$typeof === w || c.$$typeof === p || c.$$typeof === s || c.$$typeof === d || c.$$typeof === h || c.$$typeof === b || c.$$typeof === C || c.$$typeof === T || c.$$typeof === v);
1035
+ }, V.typeOf = S, V;
1036
+ }
1037
+ var Y = {};
1038
+ var Ve;
1039
+ function rn() {
1040
+ return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && (function() {
1041
+ var e = typeof Symbol == "function" && Symbol.for, n = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, t = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, i = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, o = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, s = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, d = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, y = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, m = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, h = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, u = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, g = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, p = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, w = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, v = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, b = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, C = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, T = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
1042
+ function S(_) {
1043
+ return typeof _ == "string" || typeof _ == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1044
+ _ === r || _ === m || _ === o || _ === i || _ === u || _ === g || typeof _ == "object" && _ !== null && (_.$$typeof === w || _.$$typeof === p || _.$$typeof === s || _.$$typeof === d || _.$$typeof === h || _.$$typeof === b || _.$$typeof === C || _.$$typeof === T || _.$$typeof === v);
1045
+ }
1046
+ function D(_) {
1047
+ if (typeof _ == "object" && _ !== null) {
1048
+ var te = _.$$typeof;
1049
+ switch (te) {
1050
+ case n:
1051
+ var ge = _.type;
1052
+ switch (ge) {
1053
+ case y:
1054
+ case m:
1055
+ case r:
1056
+ case o:
1057
+ case i:
1058
+ case u:
1059
+ return ge;
1060
+ default:
1061
+ var ke = ge && ge.$$typeof;
1062
+ switch (ke) {
1063
+ case d:
1064
+ case h:
1065
+ case w:
1066
+ case p:
1067
+ case s:
1068
+ return ke;
1069
+ default:
1070
+ return te;
1071
+ }
1072
+ }
1073
+ case t:
1074
+ return te;
1075
+ }
1076
+ }
1077
+ }
1078
+ var c = y, N = m, l = d, f = s, P = n, $ = h, O = r, E = w, z = p, X = t, Q = o, H = i, ee = u, ae = !1;
1079
+ function de(_) {
1080
+ return ae || (ae = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), x(_) || D(_) === y;
1081
+ }
1082
+ function x(_) {
1083
+ return D(_) === m;
1084
+ }
1085
+ function M(_) {
1086
+ return D(_) === d;
1087
+ }
1088
+ function A(_) {
1089
+ return D(_) === s;
1090
+ }
1091
+ function j(_) {
1092
+ return typeof _ == "object" && _ !== null && _.$$typeof === n;
1093
+ }
1094
+ function I(_) {
1095
+ return D(_) === h;
1096
+ }
1097
+ function L(_) {
1098
+ return D(_) === r;
1099
+ }
1100
+ function R(_) {
1101
+ return D(_) === w;
1102
+ }
1103
+ function k(_) {
1104
+ return D(_) === p;
1105
+ }
1106
+ function F(_) {
1107
+ return D(_) === t;
1108
+ }
1109
+ function q(_) {
1110
+ return D(_) === o;
1111
+ }
1112
+ function U(_) {
1113
+ return D(_) === i;
1114
+ }
1115
+ function G(_) {
1116
+ return D(_) === u;
1117
+ }
1118
+ Y.AsyncMode = c, Y.ConcurrentMode = N, Y.ContextConsumer = l, Y.ContextProvider = f, Y.Element = P, Y.ForwardRef = $, Y.Fragment = O, Y.Lazy = E, Y.Memo = z, Y.Portal = X, Y.Profiler = Q, Y.StrictMode = H, Y.Suspense = ee, Y.isAsyncMode = de, Y.isConcurrentMode = x, Y.isContextConsumer = M, Y.isContextProvider = A, Y.isElement = j, Y.isForwardRef = I, Y.isFragment = L, Y.isLazy = R, Y.isMemo = k, Y.isPortal = F, Y.isProfiler = q, Y.isStrictMode = U, Y.isSuspense = G, Y.isValidElementType = S, Y.typeOf = D;
1119
+ })()), Y;
1120
+ }
1121
+ var Ye;
1122
+ function mt() {
1123
+ return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? pe.exports = nn() : pe.exports = rn()), pe.exports;
1124
+ }
1125
+ var Te, qe;
1126
+ function on() {
1127
+ if (qe) return Te;
1128
+ qe = 1;
1129
+ var e = Object.getOwnPropertySymbols, n = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
1130
+ function r(o) {
1131
+ if (o == null)
1132
+ throw new TypeError("Object.assign cannot be called with null or undefined");
1133
+ return Object(o);
1134
+ }
1135
+ function i() {
1136
+ try {
1137
+ if (!Object.assign)
1138
+ return !1;
1139
+ var o = new String("abc");
1140
+ if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5")
1141
+ return !1;
1142
+ for (var s = {}, d = 0; d < 10; d++)
1143
+ s["_" + String.fromCharCode(d)] = d;
1144
+ var y = Object.getOwnPropertyNames(s).map(function(h) {
1145
+ return s[h];
1146
+ });
1147
+ if (y.join("") !== "0123456789")
1148
+ return !1;
1149
+ var m = {};
1150
+ return "abcdefghijklmnopqrst".split("").forEach(function(h) {
1151
+ m[h] = h;
1152
+ }), Object.keys(Object.assign({}, m)).join("") === "abcdefghijklmnopqrst";
1153
+ } catch {
1154
+ return !1;
1155
+ }
1156
+ }
1157
+ return Te = i() ? Object.assign : function(o, s) {
1158
+ for (var d, y = r(o), m, h = 1; h < arguments.length; h++) {
1159
+ d = Object(arguments[h]);
1160
+ for (var u in d)
1161
+ n.call(d, u) && (y[u] = d[u]);
1162
+ if (e) {
1163
+ m = e(d);
1164
+ for (var g = 0; g < m.length; g++)
1165
+ t.call(d, m[g]) && (y[m[g]] = d[m[g]]);
1166
+ }
1167
+ }
1168
+ return y;
1169
+ }, Te;
1170
+ }
1171
+ var Ne, ze;
1172
+ function Oe() {
1173
+ if (ze) return Ne;
1174
+ ze = 1;
1175
+ var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
1176
+ return Ne = e, Ne;
1177
+ }
1178
+ var Ee, Be;
1179
+ function pt() {
1180
+ return Be || (Be = 1, Ee = Function.call.bind(Object.prototype.hasOwnProperty)), Ee;
1181
+ }
1182
+ var _e, Ke;
1183
+ function an() {
1184
+ if (Ke) return _e;
1185
+ Ke = 1;
1186
+ var e = function() {
1187
+ };
1188
+ if (process.env.NODE_ENV !== "production") {
1189
+ var n = /* @__PURE__ */ Oe(), t = {}, r = /* @__PURE__ */ pt();
1190
+ e = function(o) {
1191
+ var s = "Warning: " + o;
1192
+ typeof console < "u" && console.error(s);
1193
+ try {
1194
+ throw new Error(s);
1195
+ } catch {
1196
+ }
1197
+ };
1198
+ }
1199
+ function i(o, s, d, y, m) {
1200
+ if (process.env.NODE_ENV !== "production") {
1201
+ for (var h in o)
1202
+ if (r(o, h)) {
1203
+ var u;
1204
+ try {
1205
+ if (typeof o[h] != "function") {
1206
+ var g = Error(
1207
+ (y || "React class") + ": " + d + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
1208
+ );
1209
+ throw g.name = "Invariant Violation", g;
1210
+ }
1211
+ u = o[h](s, h, y, d, null, n);
1212
+ } catch (w) {
1213
+ u = w;
1214
+ }
1215
+ if (u && !(u instanceof Error) && e(
1216
+ (y || "React class") + ": type specification of " + d + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof u + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
1217
+ ), u instanceof Error && !(u.message in t)) {
1218
+ t[u.message] = !0;
1219
+ var p = m ? m() : "";
1220
+ e(
1221
+ "Failed " + d + " type: " + u.message + (p ?? "")
1222
+ );
1223
+ }
1224
+ }
1225
+ }
1226
+ }
1227
+ return i.resetWarningCache = function() {
1228
+ process.env.NODE_ENV !== "production" && (t = {});
1229
+ }, _e = i, _e;
1230
+ }
1231
+ var Me, He;
1232
+ function sn() {
1233
+ if (He) return Me;
1234
+ He = 1;
1235
+ var e = mt(), n = on(), t = /* @__PURE__ */ Oe(), r = /* @__PURE__ */ pt(), i = /* @__PURE__ */ an(), o = function() {
1236
+ };
1237
+ process.env.NODE_ENV !== "production" && (o = function(d) {
1238
+ var y = "Warning: " + d;
1239
+ typeof console < "u" && console.error(y);
1240
+ try {
1241
+ throw new Error(y);
1242
+ } catch {
1243
+ }
1244
+ });
1245
+ function s() {
1246
+ return null;
1247
+ }
1248
+ return Me = function(d, y) {
1249
+ var m = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
1250
+ function u(x) {
1251
+ var M = x && (m && x[m] || x[h]);
1252
+ if (typeof M == "function")
1253
+ return M;
1254
+ }
1255
+ var g = "<<anonymous>>", p = {
1256
+ array: C("array"),
1257
+ bigint: C("bigint"),
1258
+ bool: C("boolean"),
1259
+ func: C("function"),
1260
+ number: C("number"),
1261
+ object: C("object"),
1262
+ string: C("string"),
1263
+ symbol: C("symbol"),
1264
+ any: T(),
1265
+ arrayOf: S,
1266
+ element: D(),
1267
+ elementType: c(),
1268
+ instanceOf: N,
1269
+ node: $(),
1270
+ objectOf: f,
1271
+ oneOf: l,
1272
+ oneOfType: P,
1273
+ shape: E,
1274
+ exact: z
1275
+ };
1276
+ function w(x, M) {
1277
+ return x === M ? x !== 0 || 1 / x === 1 / M : x !== x && M !== M;
1278
+ }
1279
+ function v(x, M) {
1280
+ this.message = x, this.data = M && typeof M == "object" ? M : {}, this.stack = "";
1281
+ }
1282
+ v.prototype = Error.prototype;
1283
+ function b(x) {
1284
+ if (process.env.NODE_ENV !== "production")
1285
+ var M = {}, A = 0;
1286
+ function j(L, R, k, F, q, U, G) {
1287
+ if (F = F || g, U = U || k, G !== t) {
1288
+ if (y) {
1289
+ var _ = new Error(
1290
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
1291
+ );
1292
+ throw _.name = "Invariant Violation", _;
1293
+ } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
1294
+ var te = F + ":" + k;
1295
+ !M[te] && // Avoid spamming the console because they are often not actionable except for lib authors
1296
+ A < 3 && (o(
1297
+ "You are manually calling a React.PropTypes validation function for the `" + U + "` prop on `" + F + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
1298
+ ), M[te] = !0, A++);
1299
+ }
1300
+ }
1301
+ return R[k] == null ? L ? R[k] === null ? new v("The " + q + " `" + U + "` is marked as required " + ("in `" + F + "`, but its value is `null`.")) : new v("The " + q + " `" + U + "` is marked as required in " + ("`" + F + "`, but its value is `undefined`.")) : null : x(R, k, F, q, U);
1302
+ }
1303
+ var I = j.bind(null, !1);
1304
+ return I.isRequired = j.bind(null, !0), I;
1305
+ }
1306
+ function C(x) {
1307
+ function M(A, j, I, L, R, k) {
1308
+ var F = A[j], q = H(F);
1309
+ if (q !== x) {
1310
+ var U = ee(F);
1311
+ return new v(
1312
+ "Invalid " + L + " `" + R + "` of type " + ("`" + U + "` supplied to `" + I + "`, expected ") + ("`" + x + "`."),
1313
+ { expectedType: x }
1314
+ );
1315
+ }
1316
+ return null;
1317
+ }
1318
+ return b(M);
1319
+ }
1320
+ function T() {
1321
+ return b(s);
1322
+ }
1323
+ function S(x) {
1324
+ function M(A, j, I, L, R) {
1325
+ if (typeof x != "function")
1326
+ return new v("Property `" + R + "` of component `" + I + "` has invalid PropType notation inside arrayOf.");
1327
+ var k = A[j];
1328
+ if (!Array.isArray(k)) {
1329
+ var F = H(k);
1330
+ return new v("Invalid " + L + " `" + R + "` of type " + ("`" + F + "` supplied to `" + I + "`, expected an array."));
1331
+ }
1332
+ for (var q = 0; q < k.length; q++) {
1333
+ var U = x(k, q, I, L, R + "[" + q + "]", t);
1334
+ if (U instanceof Error)
1335
+ return U;
1336
+ }
1337
+ return null;
1338
+ }
1339
+ return b(M);
1340
+ }
1341
+ function D() {
1342
+ function x(M, A, j, I, L) {
1343
+ var R = M[A];
1344
+ if (!d(R)) {
1345
+ var k = H(R);
1346
+ return new v("Invalid " + I + " `" + L + "` of type " + ("`" + k + "` supplied to `" + j + "`, expected a single ReactElement."));
1347
+ }
1348
+ return null;
1349
+ }
1350
+ return b(x);
1351
+ }
1352
+ function c() {
1353
+ function x(M, A, j, I, L) {
1354
+ var R = M[A];
1355
+ if (!e.isValidElementType(R)) {
1356
+ var k = H(R);
1357
+ return new v("Invalid " + I + " `" + L + "` of type " + ("`" + k + "` supplied to `" + j + "`, expected a single ReactElement type."));
1358
+ }
1359
+ return null;
1360
+ }
1361
+ return b(x);
1362
+ }
1363
+ function N(x) {
1364
+ function M(A, j, I, L, R) {
1365
+ if (!(A[j] instanceof x)) {
1366
+ var k = x.name || g, F = de(A[j]);
1367
+ return new v("Invalid " + L + " `" + R + "` of type " + ("`" + F + "` supplied to `" + I + "`, expected ") + ("instance of `" + k + "`."));
1368
+ }
1369
+ return null;
1370
+ }
1371
+ return b(M);
1372
+ }
1373
+ function l(x) {
1374
+ if (!Array.isArray(x))
1375
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? o(
1376
+ "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
1377
+ ) : o("Invalid argument supplied to oneOf, expected an array.")), s;
1378
+ function M(A, j, I, L, R) {
1379
+ for (var k = A[j], F = 0; F < x.length; F++)
1380
+ if (w(k, x[F]))
1381
+ return null;
1382
+ var q = JSON.stringify(x, function(G, _) {
1383
+ var te = ee(_);
1384
+ return te === "symbol" ? String(_) : _;
1385
+ });
1386
+ return new v("Invalid " + L + " `" + R + "` of value `" + String(k) + "` " + ("supplied to `" + I + "`, expected one of " + q + "."));
1387
+ }
1388
+ return b(M);
1389
+ }
1390
+ function f(x) {
1391
+ function M(A, j, I, L, R) {
1392
+ if (typeof x != "function")
1393
+ return new v("Property `" + R + "` of component `" + I + "` has invalid PropType notation inside objectOf.");
1394
+ var k = A[j], F = H(k);
1395
+ if (F !== "object")
1396
+ return new v("Invalid " + L + " `" + R + "` of type " + ("`" + F + "` supplied to `" + I + "`, expected an object."));
1397
+ for (var q in k)
1398
+ if (r(k, q)) {
1399
+ var U = x(k, q, I, L, R + "." + q, t);
1400
+ if (U instanceof Error)
1401
+ return U;
1402
+ }
1403
+ return null;
1404
+ }
1405
+ return b(M);
1406
+ }
1407
+ function P(x) {
1408
+ if (!Array.isArray(x))
1409
+ return process.env.NODE_ENV !== "production" && o("Invalid argument supplied to oneOfType, expected an instance of array."), s;
1410
+ for (var M = 0; M < x.length; M++) {
1411
+ var A = x[M];
1412
+ if (typeof A != "function")
1413
+ return o(
1414
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ae(A) + " at index " + M + "."
1415
+ ), s;
1416
+ }
1417
+ function j(I, L, R, k, F) {
1418
+ for (var q = [], U = 0; U < x.length; U++) {
1419
+ var G = x[U], _ = G(I, L, R, k, F, t);
1420
+ if (_ == null)
1421
+ return null;
1422
+ _.data && r(_.data, "expectedType") && q.push(_.data.expectedType);
1423
+ }
1424
+ var te = q.length > 0 ? ", expected one of type [" + q.join(", ") + "]" : "";
1425
+ return new v("Invalid " + k + " `" + F + "` supplied to " + ("`" + R + "`" + te + "."));
1426
+ }
1427
+ return b(j);
1428
+ }
1429
+ function $() {
1430
+ function x(M, A, j, I, L) {
1431
+ return X(M[A]) ? null : new v("Invalid " + I + " `" + L + "` supplied to " + ("`" + j + "`, expected a ReactNode."));
1432
+ }
1433
+ return b(x);
1434
+ }
1435
+ function O(x, M, A, j, I) {
1436
+ return new v(
1437
+ (x || "React class") + ": " + M + " type `" + A + "." + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + I + "`."
1438
+ );
1439
+ }
1440
+ function E(x) {
1441
+ function M(A, j, I, L, R) {
1442
+ var k = A[j], F = H(k);
1443
+ if (F !== "object")
1444
+ return new v("Invalid " + L + " `" + R + "` of type `" + F + "` " + ("supplied to `" + I + "`, expected `object`."));
1445
+ for (var q in x) {
1446
+ var U = x[q];
1447
+ if (typeof U != "function")
1448
+ return O(I, L, R, q, ee(U));
1449
+ var G = U(k, q, I, L, R + "." + q, t);
1450
+ if (G)
1451
+ return G;
1452
+ }
1453
+ return null;
1454
+ }
1455
+ return b(M);
1456
+ }
1457
+ function z(x) {
1458
+ function M(A, j, I, L, R) {
1459
+ var k = A[j], F = H(k);
1460
+ if (F !== "object")
1461
+ return new v("Invalid " + L + " `" + R + "` of type `" + F + "` " + ("supplied to `" + I + "`, expected `object`."));
1462
+ var q = n({}, A[j], x);
1463
+ for (var U in q) {
1464
+ var G = x[U];
1465
+ if (r(x, U) && typeof G != "function")
1466
+ return O(I, L, R, U, ee(G));
1467
+ if (!G)
1468
+ return new v(
1469
+ "Invalid " + L + " `" + R + "` key `" + U + "` supplied to `" + I + "`.\nBad object: " + JSON.stringify(A[j], null, " ") + `
1470
+ Valid keys: ` + JSON.stringify(Object.keys(x), null, " ")
1471
+ );
1472
+ var _ = G(k, U, I, L, R + "." + U, t);
1473
+ if (_)
1474
+ return _;
1475
+ }
1476
+ return null;
1477
+ }
1478
+ return b(M);
1479
+ }
1480
+ function X(x) {
1481
+ switch (typeof x) {
1482
+ case "number":
1483
+ case "string":
1484
+ case "undefined":
1485
+ return !0;
1486
+ case "boolean":
1487
+ return !x;
1488
+ case "object":
1489
+ if (Array.isArray(x))
1490
+ return x.every(X);
1491
+ if (x === null || d(x))
1492
+ return !0;
1493
+ var M = u(x);
1494
+ if (M) {
1495
+ var A = M.call(x), j;
1496
+ if (M !== x.entries) {
1497
+ for (; !(j = A.next()).done; )
1498
+ if (!X(j.value))
1499
+ return !1;
1500
+ } else
1501
+ for (; !(j = A.next()).done; ) {
1502
+ var I = j.value;
1503
+ if (I && !X(I[1]))
1504
+ return !1;
1505
+ }
1506
+ } else
1507
+ return !1;
1508
+ return !0;
1509
+ default:
1510
+ return !1;
1511
+ }
1512
+ }
1513
+ function Q(x, M) {
1514
+ return x === "symbol" ? !0 : M ? M["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && M instanceof Symbol : !1;
1515
+ }
1516
+ function H(x) {
1517
+ var M = typeof x;
1518
+ return Array.isArray(x) ? "array" : x instanceof RegExp ? "object" : Q(M, x) ? "symbol" : M;
1519
+ }
1520
+ function ee(x) {
1521
+ if (typeof x > "u" || x === null)
1522
+ return "" + x;
1523
+ var M = H(x);
1524
+ if (M === "object") {
1525
+ if (x instanceof Date)
1526
+ return "date";
1527
+ if (x instanceof RegExp)
1528
+ return "regexp";
1529
+ }
1530
+ return M;
1531
+ }
1532
+ function ae(x) {
1533
+ var M = ee(x);
1534
+ switch (M) {
1535
+ case "array":
1536
+ case "object":
1537
+ return "an " + M;
1538
+ case "boolean":
1539
+ case "date":
1540
+ case "regexp":
1541
+ return "a " + M;
1542
+ default:
1543
+ return M;
1544
+ }
1545
+ }
1546
+ function de(x) {
1547
+ return !x.constructor || !x.constructor.name ? g : x.constructor.name;
1548
+ }
1549
+ return p.checkPropTypes = i, p.resetWarningCache = i.resetWarningCache, p.PropTypes = p, p;
1550
+ }, Me;
1551
+ }
1552
+ var Pe, Xe;
1553
+ function ln() {
1554
+ if (Xe) return Pe;
1555
+ Xe = 1;
1556
+ var e = /* @__PURE__ */ Oe();
1557
+ function n() {
1558
+ }
1559
+ function t() {
1560
+ }
1561
+ return t.resetWarningCache = n, Pe = function() {
1562
+ function r(s, d, y, m, h, u) {
1563
+ if (u !== e) {
1564
+ var g = new Error(
1565
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
1566
+ );
1567
+ throw g.name = "Invariant Violation", g;
1568
+ }
1569
+ }
1570
+ r.isRequired = r;
1571
+ function i() {
1572
+ return r;
1573
+ }
1574
+ var o = {
1575
+ array: r,
1576
+ bigint: r,
1577
+ bool: r,
1578
+ func: r,
1579
+ number: r,
1580
+ object: r,
1581
+ string: r,
1582
+ symbol: r,
1583
+ any: r,
1584
+ arrayOf: i,
1585
+ element: r,
1586
+ elementType: r,
1587
+ instanceOf: i,
1588
+ node: r,
1589
+ objectOf: i,
1590
+ oneOf: i,
1591
+ oneOfType: i,
1592
+ shape: i,
1593
+ exact: i,
1594
+ checkPropTypes: t,
1595
+ resetWarningCache: n
1596
+ };
1597
+ return o.PropTypes = o, o;
1598
+ }, Pe;
1599
+ }
1600
+ var Ge;
1601
+ function yt() {
1602
+ if (Ge) return me.exports;
1603
+ if (Ge = 1, process.env.NODE_ENV !== "production") {
1604
+ var e = mt(), n = !0;
1605
+ me.exports = /* @__PURE__ */ sn()(e.isElement, n);
1606
+ } else
1607
+ me.exports = /* @__PURE__ */ ln()();
1608
+ return me.exports;
1609
+ }
1610
+ var ye = { exports: {} }, Ze;
1611
+ function cn() {
1612
+ if (Ze) return ye.exports;
1613
+ Ze = 1;
1614
+ function e(t) {
1615
+ var r, i, o = "";
1616
+ if (typeof t == "string" || typeof t == "number") o += t;
1617
+ else if (typeof t == "object") if (Array.isArray(t)) {
1618
+ var s = t.length;
1619
+ for (r = 0; r < s; r++) t[r] && (i = e(t[r])) && (o && (o += " "), o += i);
1620
+ } else for (i in t) t[i] && (o && (o += " "), o += i);
1621
+ return o;
1622
+ }
1623
+ function n() {
1624
+ for (var t, r, i = 0, o = "", s = arguments.length; i < s; i++) (t = arguments[i]) && (r = e(t)) && (o && (o += " "), o += r);
1625
+ return o;
1626
+ }
1627
+ return ye.exports = n, ye.exports.clsx = n, ye.exports;
1628
+ }
1629
+ var B = {}, oe = {}, Je;
1630
+ function we() {
1631
+ if (Je) return oe;
1632
+ Je = 1, Object.defineProperty(oe, "__esModule", {
1633
+ value: !0
1634
+ }), oe.dontSetMe = i, oe.findInArray = e, oe.int = r, oe.isFunction = n, oe.isNum = t;
1635
+ function e(o, s) {
1636
+ for (let d = 0, y = o.length; d < y; d++)
1637
+ if (s.apply(s, [o[d], d, o])) return o[d];
1638
+ }
1639
+ function n(o) {
1640
+ return typeof o == "function" || Object.prototype.toString.call(o) === "[object Function]";
1641
+ }
1642
+ function t(o) {
1643
+ return typeof o == "number" && !isNaN(o);
1644
+ }
1645
+ function r(o) {
1646
+ return parseInt(o, 10);
1647
+ }
1648
+ function i(o, s, d) {
1649
+ if (o[s])
1650
+ return new Error(`Invalid prop ${s} passed to ${d} - do not set this, set it on the child.`);
1651
+ }
1652
+ return oe;
1653
+ }
1654
+ var ie = {}, Qe;
1655
+ function dn() {
1656
+ if (Qe) return ie;
1657
+ Qe = 1, Object.defineProperty(ie, "__esModule", {
1658
+ value: !0
1659
+ }), ie.browserPrefixToKey = t, ie.browserPrefixToStyle = r, ie.default = void 0, ie.getPrefix = n;
1660
+ const e = ["Moz", "Webkit", "O", "ms"];
1661
+ function n() {
1662
+ let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
1663
+ if (typeof window > "u") return "";
1664
+ const s = window.document?.documentElement?.style;
1665
+ if (!s || o in s) return "";
1666
+ for (let d = 0; d < e.length; d++)
1667
+ if (t(o, e[d]) in s) return e[d];
1668
+ return "";
1669
+ }
1670
+ function t(o, s) {
1671
+ return s ? `${s}${i(o)}` : o;
1672
+ }
1673
+ function r(o, s) {
1674
+ return s ? `-${s.toLowerCase()}-${o}` : o;
1675
+ }
1676
+ function i(o) {
1677
+ let s = "", d = !0;
1678
+ for (let y = 0; y < o.length; y++)
1679
+ d ? (s += o[y].toUpperCase(), d = !1) : o[y] === "-" ? d = !0 : s += o[y];
1680
+ return s;
1681
+ }
1682
+ return ie.default = n(), ie;
1683
+ }
1684
+ var et;
1685
+ function Re() {
1686
+ if (et) return B;
1687
+ et = 1, Object.defineProperty(B, "__esModule", {
1688
+ value: !0
1689
+ }), B.addClassName = c, B.addEvent = s, B.addUserSelectStyles = T, B.createCSSTransform = p, B.createSVGTransform = w, B.getTouch = b, B.getTouchIdentifier = C, B.getTranslation = v, B.innerHeight = h, B.innerWidth = u, B.matchesSelector = i, B.matchesSelectorAndParentsTo = o, B.offsetXYFromParent = g, B.outerHeight = y, B.outerWidth = m, B.removeClassName = N, B.removeEvent = d, B.scheduleRemoveUserSelectStyles = S;
1690
+ var e = we(), n = t(dn());
1691
+ function t(l, f) {
1692
+ if (typeof WeakMap == "function") var P = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap();
1693
+ return (t = function(O, E) {
1694
+ if (!E && O && O.__esModule) return O;
1695
+ var z, X, Q = { __proto__: null, default: O };
1696
+ if (O === null || typeof O != "object" && typeof O != "function") return Q;
1697
+ if (z = E ? $ : P) {
1698
+ if (z.has(O)) return z.get(O);
1699
+ z.set(O, Q);
1700
+ }
1701
+ for (const H in O) H !== "default" && {}.hasOwnProperty.call(O, H) && ((X = (z = Object.defineProperty) && Object.getOwnPropertyDescriptor(O, H)) && (X.get || X.set) ? z(Q, H, X) : Q[H] = O[H]);
1702
+ return Q;
1703
+ })(l, f);
1704
+ }
1705
+ let r = "";
1706
+ function i(l, f) {
1707
+ return r || (r = (0, e.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(P) {
1708
+ return (0, e.isFunction)(l[P]);
1709
+ })), (0, e.isFunction)(l[r]) ? l[r](f) : !1;
1710
+ }
1711
+ function o(l, f, P) {
1712
+ let $ = l;
1713
+ do {
1714
+ if (i($, f)) return !0;
1715
+ if ($ === P) return !1;
1716
+ $ = $.parentNode;
1717
+ } while ($);
1718
+ return !1;
1719
+ }
1720
+ function s(l, f, P, $) {
1721
+ if (!l) return;
1722
+ const O = {
1723
+ capture: !0,
1724
+ ...$
1725
+ };
1726
+ l.addEventListener ? l.addEventListener(f, P, O) : l.attachEvent ? l.attachEvent("on" + f, P) : l["on" + f] = P;
1727
+ }
1728
+ function d(l, f, P, $) {
1729
+ if (!l) return;
1730
+ const O = {
1731
+ capture: !0,
1732
+ ...$
1733
+ };
1734
+ l.removeEventListener ? l.removeEventListener(f, P, O) : l.detachEvent ? l.detachEvent("on" + f, P) : l["on" + f] = null;
1735
+ }
1736
+ function y(l) {
1737
+ let f = l.clientHeight;
1738
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1739
+ return f += (0, e.int)(P.borderTopWidth), f += (0, e.int)(P.borderBottomWidth), f;
1740
+ }
1741
+ function m(l) {
1742
+ let f = l.clientWidth;
1743
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1744
+ return f += (0, e.int)(P.borderLeftWidth), f += (0, e.int)(P.borderRightWidth), f;
1745
+ }
1746
+ function h(l) {
1747
+ let f = l.clientHeight;
1748
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1749
+ return f -= (0, e.int)(P.paddingTop), f -= (0, e.int)(P.paddingBottom), f;
1750
+ }
1751
+ function u(l) {
1752
+ let f = l.clientWidth;
1753
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1754
+ return f -= (0, e.int)(P.paddingLeft), f -= (0, e.int)(P.paddingRight), f;
1755
+ }
1756
+ function g(l, f, P) {
1757
+ const O = f === f.ownerDocument.body ? {
1758
+ left: 0,
1759
+ top: 0
1760
+ } : f.getBoundingClientRect(), E = (l.clientX + f.scrollLeft - O.left) / P, z = (l.clientY + f.scrollTop - O.top) / P;
1761
+ return {
1762
+ x: E,
1763
+ y: z
1764
+ };
1765
+ }
1766
+ function p(l, f) {
1767
+ const P = v(l, f, "px");
1768
+ return {
1769
+ [(0, n.browserPrefixToKey)("transform", n.default)]: P
1770
+ };
1771
+ }
1772
+ function w(l, f) {
1773
+ return v(l, f, "");
1774
+ }
1775
+ function v(l, f, P) {
1776
+ let {
1777
+ x: $,
1778
+ y: O
1779
+ } = l, E = `translate(${$}${P},${O}${P})`;
1780
+ if (f) {
1781
+ const z = `${typeof f.x == "string" ? f.x : f.x + P}`, X = `${typeof f.y == "string" ? f.y : f.y + P}`;
1782
+ E = `translate(${z}, ${X})` + E;
1783
+ }
1784
+ return E;
1785
+ }
1786
+ function b(l, f) {
1787
+ return l.targetTouches && (0, e.findInArray)(l.targetTouches, (P) => f === P.identifier) || l.changedTouches && (0, e.findInArray)(l.changedTouches, (P) => f === P.identifier);
1788
+ }
1789
+ function C(l) {
1790
+ if (l.targetTouches && l.targetTouches[0]) return l.targetTouches[0].identifier;
1791
+ if (l.changedTouches && l.changedTouches[0]) return l.changedTouches[0].identifier;
1792
+ }
1793
+ function T(l) {
1794
+ if (!l) return;
1795
+ let f = l.getElementById("react-draggable-style-el");
1796
+ f || (f = l.createElement("style"), f.type = "text/css", f.id = "react-draggable-style-el", f.innerHTML = `.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
1797
+ `, f.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
1798
+ `, l.getElementsByTagName("head")[0].appendChild(f)), l.body && c(l.body, "react-draggable-transparent-selection");
1799
+ }
1800
+ function S(l) {
1801
+ window.requestAnimationFrame ? window.requestAnimationFrame(() => {
1802
+ D(l);
1803
+ }) : D(l);
1804
+ }
1805
+ function D(l) {
1806
+ if (l)
1807
+ try {
1808
+ if (l.body && N(l.body, "react-draggable-transparent-selection"), l.selection)
1809
+ l.selection.empty();
1810
+ else {
1811
+ const f = (l.defaultView || window).getSelection();
1812
+ f && f.type !== "Caret" && f.removeAllRanges();
1813
+ }
1814
+ } catch {
1815
+ }
1816
+ }
1817
+ function c(l, f) {
1818
+ l.classList ? l.classList.add(f) : l.className.match(new RegExp(`(?:^|\\s)${f}(?!\\S)`)) || (l.className += ` ${f}`);
1819
+ }
1820
+ function N(l, f) {
1821
+ l.classList ? l.classList.remove(f) : l.className = l.className.replace(new RegExp(`(?:^|\\s)${f}(?!\\S)`, "g"), "");
1822
+ }
1823
+ return B;
1824
+ }
1825
+ var ne = {}, tt;
1826
+ function vt() {
1827
+ if (tt) return ne;
1828
+ tt = 1, Object.defineProperty(ne, "__esModule", {
1829
+ value: !0
1830
+ }), ne.canDragX = i, ne.canDragY = o, ne.createCoreData = d, ne.createDraggableData = y, ne.getBoundPosition = t, ne.getControlPosition = s, ne.snapToGrid = r;
1831
+ var e = we(), n = Re();
1832
+ function t(u, g, p) {
1833
+ if (!u.props.bounds) return [g, p];
1834
+ let {
1835
+ bounds: w
1836
+ } = u.props;
1837
+ w = typeof w == "string" ? w : m(w);
1838
+ const v = h(u);
1839
+ if (typeof w == "string") {
1840
+ const {
1841
+ ownerDocument: b
1842
+ } = v, C = b.defaultView;
1843
+ let T;
1844
+ if (w === "parent" ? T = v.parentNode : T = v.getRootNode().querySelector(w), !(T instanceof C.HTMLElement))
1845
+ throw new Error('Bounds selector "' + w + '" could not find an element.');
1846
+ const S = T, D = C.getComputedStyle(v), c = C.getComputedStyle(S);
1847
+ w = {
1848
+ left: -v.offsetLeft + (0, e.int)(c.paddingLeft) + (0, e.int)(D.marginLeft),
1849
+ top: -v.offsetTop + (0, e.int)(c.paddingTop) + (0, e.int)(D.marginTop),
1850
+ right: (0, n.innerWidth)(S) - (0, n.outerWidth)(v) - v.offsetLeft + (0, e.int)(c.paddingRight) - (0, e.int)(D.marginRight),
1851
+ bottom: (0, n.innerHeight)(S) - (0, n.outerHeight)(v) - v.offsetTop + (0, e.int)(c.paddingBottom) - (0, e.int)(D.marginBottom)
1852
+ };
1853
+ }
1854
+ return (0, e.isNum)(w.right) && (g = Math.min(g, w.right)), (0, e.isNum)(w.bottom) && (p = Math.min(p, w.bottom)), (0, e.isNum)(w.left) && (g = Math.max(g, w.left)), (0, e.isNum)(w.top) && (p = Math.max(p, w.top)), [g, p];
1855
+ }
1856
+ function r(u, g, p) {
1857
+ const w = Math.round(g / u[0]) * u[0], v = Math.round(p / u[1]) * u[1];
1858
+ return [w, v];
1859
+ }
1860
+ function i(u) {
1861
+ return u.props.axis === "both" || u.props.axis === "x";
1862
+ }
1863
+ function o(u) {
1864
+ return u.props.axis === "both" || u.props.axis === "y";
1865
+ }
1866
+ function s(u, g, p) {
1867
+ const w = typeof g == "number" ? (0, n.getTouch)(u, g) : null;
1868
+ if (typeof g == "number" && !w) return null;
1869
+ const v = h(p), b = p.props.offsetParent || v.offsetParent || v.ownerDocument.body;
1870
+ return (0, n.offsetXYFromParent)(w || u, b, p.props.scale);
1871
+ }
1872
+ function d(u, g, p) {
1873
+ const w = !(0, e.isNum)(u.lastX), v = h(u);
1874
+ return w ? {
1875
+ node: v,
1876
+ deltaX: 0,
1877
+ deltaY: 0,
1878
+ lastX: g,
1879
+ lastY: p,
1880
+ x: g,
1881
+ y: p
1882
+ } : {
1883
+ node: v,
1884
+ deltaX: g - u.lastX,
1885
+ deltaY: p - u.lastY,
1886
+ lastX: u.lastX,
1887
+ lastY: u.lastY,
1888
+ x: g,
1889
+ y: p
1890
+ };
1891
+ }
1892
+ function y(u, g) {
1893
+ const p = u.props.scale;
1894
+ return {
1895
+ node: g.node,
1896
+ x: u.state.x + g.deltaX / p,
1897
+ y: u.state.y + g.deltaY / p,
1898
+ deltaX: g.deltaX / p,
1899
+ deltaY: g.deltaY / p,
1900
+ lastX: u.state.x,
1901
+ lastY: u.state.y
1902
+ };
1903
+ }
1904
+ function m(u) {
1905
+ return {
1906
+ left: u.left,
1907
+ top: u.top,
1908
+ right: u.right,
1909
+ bottom: u.bottom
1910
+ };
1911
+ }
1912
+ function h(u) {
1913
+ const g = u.findDOMNode();
1914
+ if (!g)
1915
+ throw new Error("<DraggableCore>: Unmounted during event!");
1916
+ return g;
1917
+ }
1918
+ return ne;
1919
+ }
1920
+ var he = {}, ve = {}, nt;
1921
+ function bt() {
1922
+ if (nt) return ve;
1923
+ nt = 1, Object.defineProperty(ve, "__esModule", {
1924
+ value: !0
1925
+ }), ve.default = e;
1926
+ function e() {
1927
+ }
1928
+ return ve;
1929
+ }
1930
+ var rt;
1931
+ function un() {
1932
+ if (rt) return he;
1933
+ rt = 1, Object.defineProperty(he, "__esModule", {
1934
+ value: !0
1935
+ }), he.default = void 0;
1936
+ var e = y(se), n = d(/* @__PURE__ */ yt()), t = d(st), r = Re(), i = vt(), o = we(), s = d(bt());
1937
+ function d(v) {
1938
+ return v && v.__esModule ? v : { default: v };
1939
+ }
1940
+ function y(v, b) {
1941
+ if (typeof WeakMap == "function") var C = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap();
1942
+ return (y = function(S, D) {
1943
+ if (!D && S && S.__esModule) return S;
1944
+ var c, N, l = { __proto__: null, default: S };
1945
+ if (S === null || typeof S != "object" && typeof S != "function") return l;
1946
+ if (c = D ? T : C) {
1947
+ if (c.has(S)) return c.get(S);
1948
+ c.set(S, l);
1949
+ }
1950
+ for (const f in S) f !== "default" && {}.hasOwnProperty.call(S, f) && ((N = (c = Object.defineProperty) && Object.getOwnPropertyDescriptor(S, f)) && (N.get || N.set) ? c(l, f, N) : l[f] = S[f]);
1951
+ return l;
1952
+ })(v, b);
1953
+ }
1954
+ function m(v, b, C) {
1955
+ return (b = h(b)) in v ? Object.defineProperty(v, b, { value: C, enumerable: !0, configurable: !0, writable: !0 }) : v[b] = C, v;
1956
+ }
1957
+ function h(v) {
1958
+ var b = u(v, "string");
1959
+ return typeof b == "symbol" ? b : b + "";
1960
+ }
1961
+ function u(v, b) {
1962
+ if (typeof v != "object" || !v) return v;
1963
+ var C = v[Symbol.toPrimitive];
1964
+ if (C !== void 0) {
1965
+ var T = C.call(v, b);
1966
+ if (typeof T != "object") return T;
1967
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1968
+ }
1969
+ return (b === "string" ? String : Number)(v);
1970
+ }
1971
+ const g = {
1972
+ touch: {
1973
+ start: "touchstart",
1974
+ move: "touchmove",
1975
+ stop: "touchend"
1976
+ },
1977
+ mouse: {
1978
+ start: "mousedown",
1979
+ move: "mousemove",
1980
+ stop: "mouseup"
1981
+ }
1982
+ };
1983
+ let p = g.mouse, w = class extends e.Component {
1984
+ constructor() {
1985
+ super(...arguments), m(this, "dragging", !1), m(this, "lastX", NaN), m(this, "lastY", NaN), m(this, "touchIdentifier", null), m(this, "mounted", !1), m(this, "handleDragStart", (b) => {
1986
+ if (this.props.onMouseDown(b), !this.props.allowAnyClick && typeof b.button == "number" && b.button !== 0) return !1;
1987
+ const C = this.findDOMNode();
1988
+ if (!C || !C.ownerDocument || !C.ownerDocument.body)
1989
+ throw new Error("<DraggableCore> not mounted on DragStart!");
1990
+ const {
1991
+ ownerDocument: T
1992
+ } = C;
1993
+ if (this.props.disabled || !(b.target instanceof T.defaultView.Node) || this.props.handle && !(0, r.matchesSelectorAndParentsTo)(b.target, this.props.handle, C) || this.props.cancel && (0, r.matchesSelectorAndParentsTo)(b.target, this.props.cancel, C))
1994
+ return;
1995
+ b.type === "touchstart" && !this.props.allowMobileScroll && b.preventDefault();
1996
+ const S = (0, r.getTouchIdentifier)(b);
1997
+ this.touchIdentifier = S;
1998
+ const D = (0, i.getControlPosition)(b, S, this);
1999
+ if (D == null) return;
2000
+ const {
2001
+ x: c,
2002
+ y: N
2003
+ } = D, l = (0, i.createCoreData)(this, c, N);
2004
+ (0, s.default)("DraggableCore: handleDragStart: %j", l), (0, s.default)("calling", this.props.onStart), !(this.props.onStart(b, l) === !1 || this.mounted === !1) && (this.props.enableUserSelectHack && (0, r.addUserSelectStyles)(T), this.dragging = !0, this.lastX = c, this.lastY = N, (0, r.addEvent)(T, p.move, this.handleDrag), (0, r.addEvent)(T, p.stop, this.handleDragStop));
2005
+ }), m(this, "handleDrag", (b) => {
2006
+ const C = (0, i.getControlPosition)(b, this.touchIdentifier, this);
2007
+ if (C == null) return;
2008
+ let {
2009
+ x: T,
2010
+ y: S
2011
+ } = C;
2012
+ if (Array.isArray(this.props.grid)) {
2013
+ let N = T - this.lastX, l = S - this.lastY;
2014
+ if ([N, l] = (0, i.snapToGrid)(this.props.grid, N, l), !N && !l) return;
2015
+ T = this.lastX + N, S = this.lastY + l;
2016
+ }
2017
+ const D = (0, i.createCoreData)(this, T, S);
2018
+ if ((0, s.default)("DraggableCore: handleDrag: %j", D), this.props.onDrag(b, D) === !1 || this.mounted === !1) {
2019
+ try {
2020
+ this.handleDragStop(new MouseEvent("mouseup"));
2021
+ } catch {
2022
+ const l = document.createEvent("MouseEvents");
2023
+ l.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(l);
2024
+ }
2025
+ return;
2026
+ }
2027
+ this.lastX = T, this.lastY = S;
2028
+ }), m(this, "handleDragStop", (b) => {
2029
+ if (!this.dragging) return;
2030
+ const C = (0, i.getControlPosition)(b, this.touchIdentifier, this);
2031
+ if (C == null) return;
2032
+ let {
2033
+ x: T,
2034
+ y: S
2035
+ } = C;
2036
+ if (Array.isArray(this.props.grid)) {
2037
+ let l = T - this.lastX || 0, f = S - this.lastY || 0;
2038
+ [l, f] = (0, i.snapToGrid)(this.props.grid, l, f), T = this.lastX + l, S = this.lastY + f;
2039
+ }
2040
+ const D = (0, i.createCoreData)(this, T, S);
2041
+ if (this.props.onStop(b, D) === !1 || this.mounted === !1) return !1;
2042
+ const N = this.findDOMNode();
2043
+ N && this.props.enableUserSelectHack && (0, r.scheduleRemoveUserSelectStyles)(N.ownerDocument), (0, s.default)("DraggableCore: handleDragStop: %j", D), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, N && ((0, s.default)("DraggableCore: Removing handlers"), (0, r.removeEvent)(N.ownerDocument, p.move, this.handleDrag), (0, r.removeEvent)(N.ownerDocument, p.stop, this.handleDragStop));
2044
+ }), m(this, "onMouseDown", (b) => (p = g.mouse, this.handleDragStart(b))), m(this, "onMouseUp", (b) => (p = g.mouse, this.handleDragStop(b))), m(this, "onTouchStart", (b) => (p = g.touch, this.handleDragStart(b))), m(this, "onTouchEnd", (b) => (p = g.touch, this.handleDragStop(b)));
2045
+ }
2046
+ componentDidMount() {
2047
+ this.mounted = !0;
2048
+ const b = this.findDOMNode();
2049
+ b && (0, r.addEvent)(b, g.touch.start, this.onTouchStart, {
2050
+ passive: !1
2051
+ });
2052
+ }
2053
+ componentWillUnmount() {
2054
+ this.mounted = !1;
2055
+ const b = this.findDOMNode();
2056
+ if (b) {
2057
+ const {
2058
+ ownerDocument: C
2059
+ } = b;
2060
+ (0, r.removeEvent)(C, g.mouse.move, this.handleDrag), (0, r.removeEvent)(C, g.touch.move, this.handleDrag), (0, r.removeEvent)(C, g.mouse.stop, this.handleDragStop), (0, r.removeEvent)(C, g.touch.stop, this.handleDragStop), (0, r.removeEvent)(b, g.touch.start, this.onTouchStart, {
2061
+ passive: !1
2062
+ }), this.props.enableUserSelectHack && (0, r.scheduleRemoveUserSelectStyles)(C);
2063
+ }
2064
+ }
2065
+ // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
2066
+ // the underlying DOM node ourselves. See the README for more information.
2067
+ findDOMNode() {
2068
+ return this.props?.nodeRef ? this.props?.nodeRef?.current : t.default.findDOMNode(this);
2069
+ }
2070
+ render() {
2071
+ return /* @__PURE__ */ e.cloneElement(e.Children.only(this.props.children), {
2072
+ // Note: mouseMove handler is attached to document so it will still function
2073
+ // when the user drags quickly and leaves the bounds of the element.
2074
+ onMouseDown: this.onMouseDown,
2075
+ onMouseUp: this.onMouseUp,
2076
+ // onTouchStart is added on `componentDidMount` so they can be added with
2077
+ // {passive: false}, which allows it to cancel. See
2078
+ // https://developers.google.com/web/updates/2017/01/scrolling-intervention
2079
+ onTouchEnd: this.onTouchEnd
2080
+ });
2081
+ }
2082
+ };
2083
+ return he.default = w, m(w, "displayName", "DraggableCore"), m(w, "propTypes", {
2084
+ /**
2085
+ * `allowAnyClick` allows dragging using any mouse button.
2086
+ * By default, we only accept the left button.
2087
+ *
2088
+ * Defaults to `false`.
2089
+ */
2090
+ allowAnyClick: n.default.bool,
2091
+ /**
2092
+ * `allowMobileScroll` turns off cancellation of the 'touchstart' event
2093
+ * on mobile devices. Only enable this if you are having trouble with click
2094
+ * events. Prefer using 'handle' / 'cancel' instead.
2095
+ *
2096
+ * Defaults to `false`.
2097
+ */
2098
+ allowMobileScroll: n.default.bool,
2099
+ children: n.default.node.isRequired,
2100
+ /**
2101
+ * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
2102
+ * with the exception of `onMouseDown`, will not fire.
2103
+ */
2104
+ disabled: n.default.bool,
2105
+ /**
2106
+ * By default, we add 'user-select:none' attributes to the document body
2107
+ * to prevent ugly text selection during drag. If this is causing problems
2108
+ * for your app, set this to `false`.
2109
+ */
2110
+ enableUserSelectHack: n.default.bool,
2111
+ /**
2112
+ * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
2113
+ * instead of using the parent node.
2114
+ */
2115
+ offsetParent: function(v, b) {
2116
+ if (v[b] && v[b].nodeType !== 1)
2117
+ throw new Error("Draggable's offsetParent must be a DOM Node.");
2118
+ },
2119
+ /**
2120
+ * `grid` specifies the x and y that dragging should snap to.
2121
+ */
2122
+ grid: n.default.arrayOf(n.default.number),
2123
+ /**
2124
+ * `handle` specifies a selector to be used as the handle that initiates drag.
2125
+ *
2126
+ * Example:
2127
+ *
2128
+ * ```jsx
2129
+ * let App = React.createClass({
2130
+ * render: function () {
2131
+ * return (
2132
+ * <Draggable handle=".handle">
2133
+ * <div>
2134
+ * <div className="handle">Click me to drag</div>
2135
+ * <div>This is some other content</div>
2136
+ * </div>
2137
+ * </Draggable>
2138
+ * );
2139
+ * }
2140
+ * });
2141
+ * ```
2142
+ */
2143
+ handle: n.default.string,
2144
+ /**
2145
+ * `cancel` specifies a selector to be used to prevent drag initialization.
2146
+ *
2147
+ * Example:
2148
+ *
2149
+ * ```jsx
2150
+ * let App = React.createClass({
2151
+ * render: function () {
2152
+ * return(
2153
+ * <Draggable cancel=".cancel">
2154
+ * <div>
2155
+ * <div className="cancel">You can't drag from here</div>
2156
+ * <div>Dragging here works fine</div>
2157
+ * </div>
2158
+ * </Draggable>
2159
+ * );
2160
+ * }
2161
+ * });
2162
+ * ```
2163
+ */
2164
+ cancel: n.default.string,
2165
+ /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
2166
+ * Unfortunately, in order for <Draggable> to work properly, we need raw access
2167
+ * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
2168
+ * as in this example:
2169
+ *
2170
+ * function MyComponent() {
2171
+ * const nodeRef = React.useRef(null);
2172
+ * return (
2173
+ * <Draggable nodeRef={nodeRef}>
2174
+ * <div ref={nodeRef}>Example Target</div>
2175
+ * </Draggable>
2176
+ * );
2177
+ * }
2178
+ *
2179
+ * This can be used for arbitrarily nested components, so long as the ref ends up
2180
+ * pointing to the actual child DOM node and not a custom component.
2181
+ */
2182
+ nodeRef: n.default.object,
2183
+ /**
2184
+ * Called when dragging starts.
2185
+ * If this function returns the boolean false, dragging will be canceled.
2186
+ */
2187
+ onStart: n.default.func,
2188
+ /**
2189
+ * Called while dragging.
2190
+ * If this function returns the boolean false, dragging will be canceled.
2191
+ */
2192
+ onDrag: n.default.func,
2193
+ /**
2194
+ * Called when dragging stops.
2195
+ * If this function returns the boolean false, the drag will remain active.
2196
+ */
2197
+ onStop: n.default.func,
2198
+ /**
2199
+ * A workaround option which can be passed if onMouseDown needs to be accessed,
2200
+ * since it'll always be blocked (as there is internal use of onMouseDown)
2201
+ */
2202
+ onMouseDown: n.default.func,
2203
+ /**
2204
+ * `scale`, if set, applies scaling while dragging an element
2205
+ */
2206
+ scale: n.default.number,
2207
+ /**
2208
+ * These properties should be defined on the child, not here.
2209
+ */
2210
+ className: o.dontSetMe,
2211
+ style: o.dontSetMe,
2212
+ transform: o.dontSetMe
2213
+ }), m(w, "defaultProps", {
2214
+ allowAnyClick: !1,
2215
+ // by default only accept left click
2216
+ allowMobileScroll: !1,
2217
+ disabled: !1,
2218
+ enableUserSelectHack: !0,
2219
+ onStart: function() {
2220
+ },
2221
+ onDrag: function() {
2222
+ },
2223
+ onStop: function() {
2224
+ },
2225
+ onMouseDown: function() {
2226
+ },
2227
+ scale: 1
2228
+ }), he;
2229
+ }
2230
+ var ot;
2231
+ function fn() {
2232
+ return ot || (ot = 1, (function(e) {
2233
+ Object.defineProperty(e, "__esModule", {
2234
+ value: !0
2235
+ }), Object.defineProperty(e, "DraggableCore", {
2236
+ enumerable: !0,
2237
+ get: function() {
2238
+ return y.default;
2239
+ }
2240
+ }), e.default = void 0;
2241
+ var n = u(se), t = h(/* @__PURE__ */ yt()), r = h(st), i = cn(), o = Re(), s = vt(), d = we(), y = h(un()), m = h(bt());
2242
+ function h(C) {
2243
+ return C && C.__esModule ? C : { default: C };
2244
+ }
2245
+ function u(C, T) {
2246
+ if (typeof WeakMap == "function") var S = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap();
2247
+ return (u = function(c, N) {
2248
+ if (!N && c && c.__esModule) return c;
2249
+ var l, f, P = { __proto__: null, default: c };
2250
+ if (c === null || typeof c != "object" && typeof c != "function") return P;
2251
+ if (l = N ? D : S) {
2252
+ if (l.has(c)) return l.get(c);
2253
+ l.set(c, P);
2254
+ }
2255
+ for (const $ in c) $ !== "default" && {}.hasOwnProperty.call(c, $) && ((f = (l = Object.defineProperty) && Object.getOwnPropertyDescriptor(c, $)) && (f.get || f.set) ? l(P, $, f) : P[$] = c[$]);
2256
+ return P;
2257
+ })(C, T);
2258
+ }
2259
+ function g() {
2260
+ return g = Object.assign ? Object.assign.bind() : function(C) {
2261
+ for (var T = 1; T < arguments.length; T++) {
2262
+ var S = arguments[T];
2263
+ for (var D in S) ({}).hasOwnProperty.call(S, D) && (C[D] = S[D]);
2264
+ }
2265
+ return C;
2266
+ }, g.apply(null, arguments);
2267
+ }
2268
+ function p(C, T, S) {
2269
+ return (T = w(T)) in C ? Object.defineProperty(C, T, { value: S, enumerable: !0, configurable: !0, writable: !0 }) : C[T] = S, C;
2270
+ }
2271
+ function w(C) {
2272
+ var T = v(C, "string");
2273
+ return typeof T == "symbol" ? T : T + "";
2274
+ }
2275
+ function v(C, T) {
2276
+ if (typeof C != "object" || !C) return C;
2277
+ var S = C[Symbol.toPrimitive];
2278
+ if (S !== void 0) {
2279
+ var D = S.call(C, T);
2280
+ if (typeof D != "object") return D;
2281
+ throw new TypeError("@@toPrimitive must return a primitive value.");
2282
+ }
2283
+ return (T === "string" ? String : Number)(C);
2284
+ }
2285
+ class b extends n.Component {
2286
+ // React 16.3+
2287
+ // Arity (props, state)
2288
+ static getDerivedStateFromProps(T, S) {
2289
+ let {
2290
+ position: D
2291
+ } = T, {
2292
+ prevPropsPosition: c
2293
+ } = S;
2294
+ return D && (!c || D.x !== c.x || D.y !== c.y) ? ((0, m.default)("Draggable: getDerivedStateFromProps %j", {
2295
+ position: D,
2296
+ prevPropsPosition: c
2297
+ }), {
2298
+ x: D.x,
2299
+ y: D.y,
2300
+ prevPropsPosition: {
2301
+ ...D
2302
+ }
2303
+ }) : null;
2304
+ }
2305
+ constructor(T) {
2306
+ super(T), p(this, "onDragStart", (S, D) => {
2307
+ if ((0, m.default)("Draggable: onDragStart: %j", D), this.props.onStart(S, (0, s.createDraggableData)(this, D)) === !1) return !1;
2308
+ this.setState({
2309
+ dragging: !0,
2310
+ dragged: !0
2311
+ });
2312
+ }), p(this, "onDrag", (S, D) => {
2313
+ if (!this.state.dragging) return !1;
2314
+ (0, m.default)("Draggable: onDrag: %j", D);
2315
+ const c = (0, s.createDraggableData)(this, D), N = {
2316
+ x: c.x,
2317
+ y: c.y,
2318
+ slackX: 0,
2319
+ slackY: 0
2320
+ };
2321
+ if (this.props.bounds) {
2322
+ const {
2323
+ x: f,
2324
+ y: P
2325
+ } = N;
2326
+ N.x += this.state.slackX, N.y += this.state.slackY;
2327
+ const [$, O] = (0, s.getBoundPosition)(this, N.x, N.y);
2328
+ N.x = $, N.y = O, N.slackX = this.state.slackX + (f - N.x), N.slackY = this.state.slackY + (P - N.y), c.x = N.x, c.y = N.y, c.deltaX = N.x - this.state.x, c.deltaY = N.y - this.state.y;
2329
+ }
2330
+ if (this.props.onDrag(S, c) === !1) return !1;
2331
+ this.setState(N);
2332
+ }), p(this, "onDragStop", (S, D) => {
2333
+ if (!this.state.dragging || this.props.onStop(S, (0, s.createDraggableData)(this, D)) === !1) return !1;
2334
+ (0, m.default)("Draggable: onDragStop: %j", D);
2335
+ const N = {
2336
+ dragging: !1,
2337
+ slackX: 0,
2338
+ slackY: 0
2339
+ };
2340
+ if (!!this.props.position) {
2341
+ const {
2342
+ x: f,
2343
+ y: P
2344
+ } = this.props.position;
2345
+ N.x = f, N.y = P;
2346
+ }
2347
+ this.setState(N);
2348
+ }), this.state = {
2349
+ // Whether or not we are currently dragging.
2350
+ dragging: !1,
2351
+ // Whether or not we have been dragged before.
2352
+ dragged: !1,
2353
+ // Current transform x and y.
2354
+ x: T.position ? T.position.x : T.defaultPosition.x,
2355
+ y: T.position ? T.position.y : T.defaultPosition.y,
2356
+ prevPropsPosition: {
2357
+ ...T.position
2358
+ },
2359
+ // Used for compensating for out-of-bounds drags
2360
+ slackX: 0,
2361
+ slackY: 0,
2362
+ // Can only determine if SVG after mounting
2363
+ isElementSVG: !1
2364
+ }, T.position && !(T.onDrag || T.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
2365
+ }
2366
+ componentDidMount() {
2367
+ typeof window.SVGElement < "u" && this.findDOMNode() instanceof window.SVGElement && this.setState({
2368
+ isElementSVG: !0
2369
+ });
2370
+ }
2371
+ componentWillUnmount() {
2372
+ this.state.dragging && this.setState({
2373
+ dragging: !1
2374
+ });
2375
+ }
2376
+ // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
2377
+ // the underlying DOM node ourselves. See the README for more information.
2378
+ findDOMNode() {
2379
+ return this.props?.nodeRef?.current ?? r.default.findDOMNode(this);
2380
+ }
2381
+ render() {
2382
+ const {
2383
+ axis: T,
2384
+ bounds: S,
2385
+ children: D,
2386
+ defaultPosition: c,
2387
+ defaultClassName: N,
2388
+ defaultClassNameDragging: l,
2389
+ defaultClassNameDragged: f,
2390
+ position: P,
2391
+ positionOffset: $,
2392
+ scale: O,
2393
+ ...E
2394
+ } = this.props;
2395
+ let z = {}, X = null;
2396
+ const H = !!!P || this.state.dragging, ee = P || c, ae = {
2397
+ // Set left if horizontal drag is enabled
2398
+ x: (0, s.canDragX)(this) && H ? this.state.x : ee.x,
2399
+ // Set top if vertical drag is enabled
2400
+ y: (0, s.canDragY)(this) && H ? this.state.y : ee.y
2401
+ };
2402
+ this.state.isElementSVG ? X = (0, o.createSVGTransform)(ae, $) : z = (0, o.createCSSTransform)(ae, $);
2403
+ const de = (0, i.clsx)(D.props.className || "", N, {
2404
+ [l]: this.state.dragging,
2405
+ [f]: this.state.dragged
2406
+ });
2407
+ return /* @__PURE__ */ n.createElement(y.default, g({}, E, {
2408
+ onStart: this.onDragStart,
2409
+ onDrag: this.onDrag,
2410
+ onStop: this.onDragStop
2411
+ }), /* @__PURE__ */ n.cloneElement(n.Children.only(D), {
2412
+ className: de,
2413
+ style: {
2414
+ ...D.props.style,
2415
+ ...z
2416
+ },
2417
+ transform: X
2418
+ }));
2419
+ }
2420
+ }
2421
+ e.default = b, p(b, "displayName", "Draggable"), p(b, "propTypes", {
2422
+ // Accepts all props <DraggableCore> accepts.
2423
+ ...y.default.propTypes,
2424
+ /**
2425
+ * `axis` determines which axis the draggable can move.
2426
+ *
2427
+ * Note that all callbacks will still return data as normal. This only
2428
+ * controls flushing to the DOM.
2429
+ *
2430
+ * 'both' allows movement horizontally and vertically.
2431
+ * 'x' limits movement to horizontal axis.
2432
+ * 'y' limits movement to vertical axis.
2433
+ * 'none' limits all movement.
2434
+ *
2435
+ * Defaults to 'both'.
2436
+ */
2437
+ axis: t.default.oneOf(["both", "x", "y", "none"]),
2438
+ /**
2439
+ * `bounds` determines the range of movement available to the element.
2440
+ * Available values are:
2441
+ *
2442
+ * 'parent' restricts movement within the Draggable's parent node.
2443
+ *
2444
+ * Alternatively, pass an object with the following properties, all of which are optional:
2445
+ *
2446
+ * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
2447
+ *
2448
+ * All values are in px.
2449
+ *
2450
+ * Example:
2451
+ *
2452
+ * ```jsx
2453
+ * let App = React.createClass({
2454
+ * render: function () {
2455
+ * return (
2456
+ * <Draggable bounds={{right: 300, bottom: 300}}>
2457
+ * <div>Content</div>
2458
+ * </Draggable>
2459
+ * );
2460
+ * }
2461
+ * });
2462
+ * ```
2463
+ */
2464
+ bounds: t.default.oneOfType([t.default.shape({
2465
+ left: t.default.number,
2466
+ right: t.default.number,
2467
+ top: t.default.number,
2468
+ bottom: t.default.number
2469
+ }), t.default.string, t.default.oneOf([!1])]),
2470
+ defaultClassName: t.default.string,
2471
+ defaultClassNameDragging: t.default.string,
2472
+ defaultClassNameDragged: t.default.string,
2473
+ /**
2474
+ * `defaultPosition` specifies the x and y that the dragged item should start at
2475
+ *
2476
+ * Example:
2477
+ *
2478
+ * ```jsx
2479
+ * let App = React.createClass({
2480
+ * render: function () {
2481
+ * return (
2482
+ * <Draggable defaultPosition={{x: 25, y: 25}}>
2483
+ * <div>I start with transformX: 25px and transformY: 25px;</div>
2484
+ * </Draggable>
2485
+ * );
2486
+ * }
2487
+ * });
2488
+ * ```
2489
+ */
2490
+ defaultPosition: t.default.shape({
2491
+ x: t.default.number,
2492
+ y: t.default.number
2493
+ }),
2494
+ positionOffset: t.default.shape({
2495
+ x: t.default.oneOfType([t.default.number, t.default.string]),
2496
+ y: t.default.oneOfType([t.default.number, t.default.string])
2497
+ }),
2498
+ /**
2499
+ * `position`, if present, defines the current position of the element.
2500
+ *
2501
+ * This is similar to how form elements in React work - if no `position` is supplied, the component
2502
+ * is uncontrolled.
2503
+ *
2504
+ * Example:
2505
+ *
2506
+ * ```jsx
2507
+ * let App = React.createClass({
2508
+ * render: function () {
2509
+ * return (
2510
+ * <Draggable position={{x: 25, y: 25}}>
2511
+ * <div>I start with transformX: 25px and transformY: 25px;</div>
2512
+ * </Draggable>
2513
+ * );
2514
+ * }
2515
+ * });
2516
+ * ```
2517
+ */
2518
+ position: t.default.shape({
2519
+ x: t.default.number,
2520
+ y: t.default.number
2521
+ }),
2522
+ /**
2523
+ * These properties should be defined on the child, not here.
2524
+ */
2525
+ className: d.dontSetMe,
2526
+ style: d.dontSetMe,
2527
+ transform: d.dontSetMe
2528
+ }), p(b, "defaultProps", {
2529
+ ...y.default.defaultProps,
2530
+ axis: "both",
2531
+ bounds: !1,
2532
+ defaultClassName: "react-draggable",
2533
+ defaultClassNameDragging: "react-draggable-dragging",
2534
+ defaultClassNameDragged: "react-draggable-dragged",
2535
+ defaultPosition: {
2536
+ x: 0,
2537
+ y: 0
2538
+ },
2539
+ scale: 1
2540
+ });
2541
+ })(De)), De;
2542
+ }
2543
+ var it;
2544
+ function hn() {
2545
+ if (it) return fe.exports;
2546
+ it = 1;
2547
+ const {
2548
+ default: e,
2549
+ DraggableCore: n
2550
+ } = fn();
2551
+ return fe.exports = e, fe.exports.default = e, fe.exports.DraggableCore = n, fe.exports;
2552
+ }
2553
+ var gn = hn();
2554
+ const mn = /* @__PURE__ */ tn(gn), pn = le((e, n) => {
2555
+ const r = {
2556
+ ...{
2557
+ // 1. Take it out of the document flow
2558
+ position: "fixed",
2559
+ // 2. Set initial viewport position (e.g., top right)
2560
+ top: "6rem",
2561
+ right: "1rem",
2562
+ // 3. Ensure it stacks above other content
2563
+ zIndex: 1,
2564
+ // Add your layout/appearance styles
2565
+ width: "360px",
2566
+ minHeight: "360px",
2567
+ borderStyle: "solid",
2568
+ borderWidth: "3px",
2569
+ boxShadow: "rgba(0, 0, 0, 0.5) 7px 7px 10px 0px"
2570
+ },
2571
+ ...e.style || {}
2572
+ }, i = e.testId || "not-set", o = e.className || "panel", s = xt(null);
2573
+ return (
2574
+ // 3. Pass the internal ref to the Draggable component via 'nodeRef'
2575
+ /* @__PURE__ */ a(
2576
+ mn,
2577
+ {
2578
+ nodeRef: s,
2579
+ "data-testid": i,
2580
+ axis: "both",
2581
+ handle: ".handle",
2582
+ onStart: (m, h) => {
2583
+ e.onDraggingChange?.(!0);
2584
+ },
2585
+ onStop: (m, h) => {
2586
+ setTimeout(() => {
2587
+ e.onDraggingChange?.(!1);
2588
+ }, 100);
2589
+ },
2590
+ children: /* @__PURE__ */ a("div", { ref: s, className: o, style: r, children: e.children })
2591
+ }
2592
+ )
2593
+ );
2594
+ });
2595
+ function Jn({ children: e }) {
2596
+ return /* @__PURE__ */ a(
2597
+ "div",
2598
+ {
2599
+ className: "w-full h-full flex-1 flex flex-col gap-2 items-end justify-end content-end",
2600
+ style: {
2601
+ minHeight: "140px"
2602
+ },
2603
+ children: e
2604
+ }
2605
+ );
2606
+ }
2607
+ function Qn({ children: e }) {
2608
+ return /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-end", children: e });
2609
+ }
2610
+ const er = (e) => {
2611
+ console.warn("showToast TODO", e);
2612
+ }, yn = (e) => e < 0.8 ? 1 : e <= 1 ? 0 : e > 1 ? -1 : 0, tr = le((e, n) => {
2613
+ let t = lt(Number(e.zoomScale || 0));
2614
+ const r = e.responsiveGrid || !1, i = e.isEditing || !1, o = {
2615
+ "--bwj-dashboard-transform-scale": t,
2616
+ "--bwj-dashboard-add-cols": yn(t)
2617
+ }, s = Z(
2618
+ "dashboard-main-grid w-full",
2619
+ i ? "editing" : "",
2620
+ r ? "responsive-grid" : "",
2621
+ //`border border-dashed ${isEditing ? 'border-primary border-opacity-50' : 'border-transparent'}`,
2622
+ "border border-solid border-primary"
2623
+ );
2624
+ return /* @__PURE__ */ a("div", { className: s, style: o, children: e.children });
2625
+ }), $e = "size-5", vn = (e, n) => {
2626
+ const t = e.hideTitle && !e.isEditing, r = e.noBorder;
2627
+ let i = `dashboard-widget ${e.isEditing ? "editing" : ""} border border-solid`;
2628
+ r ? i = `${i} border-transparent border-opacity-0` : (e.borderCssClasses || "").trim().length > 0 ? i = `${i} ${e.borderCssClasses}` : i = `${i} border-card-invert border-opacity-20`, e.noShadow && (i = `${i} no-shadow`), e.noPadding && (i = `${i} no-padding p-0`), (e.backgroundCssClasses || "").trim().length > 0 ? i = `${i} ${e.backgroundCssClasses}` : i = `${i} bg-card content-card`, ["large", "xlarge"].indexOf(e.size || "") > -1 && (i = `${i} ${e.size}-widget`);
2629
+ const o = () => {
2630
+ e.onRemoveClick && e.widgetKey && e.onRemoveClick(e.widgetKey, e.parentWidgetKey);
2631
+ }, s = (y) => {
2632
+ e.onMoveClick && e.widgetKey && e.onMoveClick(y, e.widgetKey, e.parentWidgetKey);
2633
+ }, d = Z(
2634
+ "widget-header",
2635
+ t ? "hidden" : "flex items-center justify-between border-b border-solid border-card-invert",
2636
+ t ? "border-opacity-0" : "border-opacity-20"
2637
+ );
2638
+ return /* @__PURE__ */ W("div", { className: i, children: [
2639
+ /* @__PURE__ */ W("div", { className: d, children: [
2640
+ /* @__PURE__ */ W("div", { className: "widget-title-wrapper w-full flex flex-row gap-2 items-center justify-between", children: [
2641
+ /* @__PURE__ */ W("h2", { className: "widget-title", children: [
2642
+ e.title,
2643
+ " "
2644
+ ] }),
2645
+ /* @__PURE__ */ a("div", {})
2646
+ ] }),
2647
+ /* @__PURE__ */ a("div", { "data-testid": "collapse-and-other-actions", children: /* @__PURE__ */ W("div", { className: "actions-inner", children: [
2648
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("span", { className: "hidden", children: "Widget" }) }),
2649
+ /* @__PURE__ */ W("div", { className: "actions-buttons-container", children: [
2650
+ /* @__PURE__ */ a(
2651
+ J,
2652
+ {
2653
+ "data-testid": `move-widget-left_${e.title}`,
2654
+ isIconButton: !0,
2655
+ disabled: e.index < 1,
2656
+ tooltip: {
2657
+ placement: "top",
2658
+ title: `${e.index < 1 ? "Already at min position" : "Move Widget to the left/up"}`
2659
+ },
2660
+ onClick: () => s(-1),
2661
+ children: /* @__PURE__ */ a(dt, { className: $e })
2662
+ }
2663
+ ),
2664
+ /* @__PURE__ */ a(
2665
+ J,
2666
+ {
2667
+ "data-testid": `move-widget-right_${e.title}`,
2668
+ isIconButton: !0,
2669
+ disabled: e.index >= e.maxIndex,
2670
+ tooltip: {
2671
+ placement: "top",
2672
+ title: `${e.index >= e.maxIndex ? "Already at max position" : "Move Widget to the right/down"}`
2673
+ },
2674
+ onClick: () => s(1),
2675
+ children: /* @__PURE__ */ a(ut, { className: $e })
2676
+ }
2677
+ ),
2678
+ /* @__PURE__ */ a(
2679
+ J,
2680
+ {
2681
+ "data-testid": `remove-container_${e.title}`,
2682
+ isIconButton: !0,
2683
+ tooltip: {
2684
+ placement: "top",
2685
+ title: "Remove Widget"
2686
+ },
2687
+ onClick: () => o(),
2688
+ children: /* @__PURE__ */ a(ft, { className: $e })
2689
+ }
2690
+ )
2691
+ ] })
2692
+ ] }) })
2693
+ ] }),
2694
+ /* @__PURE__ */ a("div", { className: "widget-inner", children: e.children })
2695
+ ] });
2696
+ }, bn = le(vn);
2697
+ function xn(e) {
2698
+ return /* @__PURE__ */ a("div", { className: "dashboard-widget", children: /* @__PURE__ */ W("div", { className: "absolute inset-0 bg-black flex flex-col items-center justify-center text-center", children: [
2699
+ /* @__PURE__ */ a("div", { className: "w-full absolute opacity-100 text-primary", children: e.title }),
2700
+ /* @__PURE__ */ a("div", { className: "animate-ping rounded-full h-32 w-32 border-8 border-white" })
2701
+ ] }) });
2702
+ }
2703
+ function wn({
2704
+ index: e,
2705
+ maxIndex: n,
2706
+ widgetKey: t,
2707
+ parentWidgetKey: r,
2708
+ targetContainerKey: i,
2709
+ childWidgetsConfig: o,
2710
+ widgetCatalog: s,
2711
+ isEditing: d,
2712
+ onRemoveClick: y,
2713
+ onMoveClick: m,
2714
+ selectContainer: h
2715
+ }) {
2716
+ const u = `${t}`.split("_"), g = u.length > 1, p = g ? u[0] : t, w = s.get(p);
2717
+ if (!w)
2718
+ return /* @__PURE__ */ a("div", { className: "flex", children: /* @__PURE__ */ W("p", { children: [
2719
+ "Widget not found in catalog: ",
2720
+ p
2721
+ ] }) });
2722
+ let v = null, b = !1;
2723
+ if (w.component ? (v = w.component, b = !1) : w.loader && (b = !0, v = at(() => {
2724
+ if (!w) return null;
2725
+ if (w.component)
2726
+ return w.component;
2727
+ if (w.loader) {
2728
+ const l = async () => {
2729
+ try {
2730
+ return await w.loader();
2731
+ } catch (f) {
2732
+ return console.error(`CDN Load Failure for ${t}:`, f), {
2733
+ default: () => /* @__PURE__ */ a(bn, { ...D, children: /* @__PURE__ */ W("div", { className: "p-4 border border-dashed border-danger", children: [
2734
+ /* @__PURE__ */ W("p", { className: "font-bold", children: [
2735
+ 'Failed to load "',
2736
+ t,
2737
+ '"'
2738
+ ] }),
2739
+ /* @__PURE__ */ a("p", { className: "text-xs italic", children: "The remote plugin is unavailable or incompatible." }),
2740
+ /* @__PURE__ */ a("pre", { className: "text-xs overflow-hidden", children: JSON.stringify(w.meta || {}, null, 2) })
2741
+ ] }) })
2742
+ };
2743
+ }
2744
+ };
2745
+ return se.lazy(l);
2746
+ }
2747
+ return null;
2748
+ }, [w, t])), !v)
2749
+ return /* @__PURE__ */ a("div", { className: "flex", children: /* @__PURE__ */ W("p", { children: [
2750
+ "Widget definition incomplete: ",
2751
+ p
2752
+ ] }) });
2753
+ const C = !!w.isContainer, T = g ? ht(t) : "", S = C ? (o || []).filter((l) => l.parentWidgetKey === t) : [], D = {
2754
+ index: e,
2755
+ maxIndex: n,
2756
+ widgetKey: t,
2757
+ parentWidgetKey: r,
2758
+ isEditing: d,
2759
+ title: g ? T : w.title,
2760
+ onRemoveClick: y,
2761
+ onMoveClick: m
2762
+ }, c = C ? {
2763
+ highlight: i === t,
2764
+ selectContainer: h,
2765
+ // The children prop is the recursive call back to DynamicWidgetLoader
2766
+ children: S.map((l, f) => /* @__PURE__ */ a(
2767
+ wn,
2768
+ {
2769
+ index: f,
2770
+ maxIndex: S.length - 1,
2771
+ widgetKey: l.widgetKey,
2772
+ parentWidgetKey: l.parentWidgetKey,
2773
+ widgetCatalog: s,
2774
+ isEditing: d,
2775
+ onRemoveClick: y,
2776
+ onMoveClick: m
2777
+ },
2778
+ `${l.widgetKey}_${f}`
2779
+ ))
2780
+ } : {}, N = () => /* @__PURE__ */ a(v, { ...D, ...c });
2781
+ return b ? /* @__PURE__ */ a(wt, { fallback: /* @__PURE__ */ a(xn, { title: `Loading ${w.title}` }), children: /* @__PURE__ */ a(N, {}) }) : /* @__PURE__ */ a(N, {});
2782
+ }
2783
+ const be = "size-5";
2784
+ function je(e) {
2785
+ const n = e.highlight || !1, t = e.direction || "column", r = e.children.length > 0, i = e.isEditing || !1;
2786
+ let d = n ? "border-transparent" : i && !r ? "border-card-invert" : "border-transparent";
2787
+ const y = ["large", "xlarge"].includes(e.size || "");
2788
+ let m = "";
2789
+ ["large", "xlarge"].indexOf(e.size || "") > -1 && (m = `${e.size}-widget`);
2790
+ let h = "";
2791
+ t === "row" && !r ? h = "min-h-48" : t === "column" && !r && (h = "min-h-96");
2792
+ let u = Z(
2793
+ "dashboard-widget-container relative ",
2794
+ r ? "" : "has-no-children",
2795
+ i ? "editing" : "",
2796
+ h,
2797
+ m,
2798
+ y ? "widget-container-grid" : "widget-container-flex",
2799
+ `direction-${t}`,
2800
+ `border ${d}`,
2801
+ `${n ? "highlight-container" : ""} ${d}`
2802
+ ), g = `widget-container-header direction-${t} flex items-center border-1 ${d}`;
2803
+ const p = () => {
2804
+ e.onRemoveClick && e.widgetKey && e.onRemoveClick(e.widgetKey);
2805
+ }, w = (b) => {
2806
+ e.onMoveClick && e.widgetKey && e.onMoveClick(b, e.widgetKey, e.parentWidgetKey);
2807
+ }, v = () => {
2808
+ e.selectContainer && e.widgetKey && e.selectContainer(e.widgetKey);
2809
+ };
2810
+ return /* @__PURE__ */ W("div", { "data-testid": `container_${e.widgetKey}`, className: u, children: [
2811
+ /* @__PURE__ */ W("div", { className: g, children: [
2812
+ /* @__PURE__ */ a(
2813
+ "div",
2814
+ {
2815
+ className: "widget-title-wrapper w-full flex whitespace-nowrap",
2816
+ onClick: v,
2817
+ children: /* @__PURE__ */ a("span", { className: "text-sm font-semibold capitalize", children: e.title })
2818
+ }
2819
+ ),
2820
+ /* @__PURE__ */ a("div", { "data-testid": "collapse-and-other-actions", children: /* @__PURE__ */ a("div", { className: "actions-inner", children: /* @__PURE__ */ W("div", { className: "actions-buttons-container", children: [
2821
+ /* @__PURE__ */ a(
2822
+ J,
2823
+ {
2824
+ "data-testid": `open-widgets-catalog-from-container_${e.title}`,
2825
+ isIconButton: !0,
2826
+ className: "whitespace-nowrap",
2827
+ tooltip: {
2828
+ placement: "top",
2829
+ title: "Target this Container"
2830
+ },
2831
+ onClick: v,
2832
+ children: /* @__PURE__ */ a(
2833
+ Zt,
2834
+ {
2835
+ className: `${be} ${n ? "text-success" : "text-disabled"}`
2836
+ }
2837
+ )
2838
+ }
2839
+ ),
2840
+ /* @__PURE__ */ a(
2841
+ J,
2842
+ {
2843
+ "data-testid": `move-container-left_${e.title}`,
2844
+ isIconButton: !0,
2845
+ disabled: e.index < 1,
2846
+ tooltip: {
2847
+ placement: "top",
2848
+ title: `${e.index < 1 ? "Already at min position" : "Move Container to the left/up"}`
2849
+ },
2850
+ onClick: () => w(-1),
2851
+ children: /* @__PURE__ */ a(dt, { className: be })
2852
+ }
2853
+ ),
2854
+ /* @__PURE__ */ a(
2855
+ J,
2856
+ {
2857
+ "data-testid": `move-container-right_${e.title}`,
2858
+ isIconButton: !0,
2859
+ disabled: e.index >= e.maxIndex,
2860
+ tooltip: {
2861
+ placement: "top",
2862
+ title: `${e.index >= e.maxIndex ? "Already at max position" : "Move Container to the right/down"}`
2863
+ },
2864
+ onClick: () => w(1),
2865
+ children: /* @__PURE__ */ a(ut, { className: be })
2866
+ }
2867
+ ),
2868
+ /* @__PURE__ */ a(
2869
+ J,
2870
+ {
2871
+ "data-testid": `remove-container_${e.title}`,
2872
+ isIconButton: !0,
2873
+ tooltip: {
2874
+ placement: "top",
2875
+ title: "Remove Container"
2876
+ },
2877
+ onClick: () => p(),
2878
+ children: /* @__PURE__ */ a(ft, { className: be })
2879
+ }
2880
+ )
2881
+ ] }) }) })
2882
+ ] }),
2883
+ /* @__PURE__ */ a("div", { "data-testid": `childrenwrapper_${e.widgetKey}`, className: "widget-container-inner", children: e.children })
2884
+ ] });
2885
+ }
2886
+ function nr(e) {
2887
+ const { direction: n, ...t } = e;
2888
+ return /* @__PURE__ */ a(je, { direction: "column", ...t });
2889
+ }
2890
+ function rr(e) {
2891
+ const { size: n, ...t } = e;
2892
+ return /* @__PURE__ */ a(je, { size: "large", ...t });
2893
+ }
2894
+ function or(e) {
2895
+ const { direction: n, ...t } = e;
2896
+ return /* @__PURE__ */ a(je, { direction: "row", ...t });
2897
+ }
2898
+ function We({
2899
+ // widgetKey,
2900
+ metaData: e,
2901
+ alreadyAdded: n,
2902
+ addWidget: t
2903
+ }) {
2904
+ const r = e.icon || Jt, i = e.displayName || "Unknown", o = e.description || "---", d = (e.noDuplicatedWidgets || !1) && n, y = Z(`
2905
+ flex flex-row gap-2 p-2 rounded-md border text-sm bg-card content-card backdrop-opacity-100
2906
+ ${d ? "border-disabled fill-disabled text-disabled" : "cursor-pointer border-primary fill-danger hover:fill-primary content-primary hover:brightness-110"}
2907
+ `);
2908
+ return /* @__PURE__ */ W("div", { className: y, style: { width: "calc(100% - 1rem)" }, onClick: () => {
2909
+ d || t();
2910
+ }, children: [
2911
+ /* @__PURE__ */ a(r, { className: "" }),
2912
+ /* @__PURE__ */ W("div", { className: "w-full", children: [
2913
+ /* @__PURE__ */ W("div", { className: "flex flex-row items-center gap-2 justify-between", children: [
2914
+ /* @__PURE__ */ a("span", { className: "font-bold", children: i }),
2915
+ /* @__PURE__ */ a("div", { className: "text-xs", children: d ? "(Added)" : "" })
2916
+ ] }),
2917
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 text-xs", children: /* @__PURE__ */ a("div", { children: o }) })
2918
+ ] })
2919
+ ] });
2920
+ }
2921
+ function Cn({
2922
+ item: e,
2923
+ onSettingItemChanged: n
2924
+ }) {
2925
+ const t = e.displayName || "Unknown", r = e.description || "---", i = Z(`
2926
+ flex flex-row gap-2 p-2 rounded-md border text-sm bg-card content-card backdrop-opacity-100
2927
+ `), o = (d) => {
2928
+ const y = d.key;
2929
+ if (["ArrowUp", "ArrowDown"].includes(y)) {
2930
+ d.preventDefault();
2931
+ const m = Nt.incrementOrDecrementValue(
2932
+ e,
2933
+ y === "ArrowUp" ? 1 : -1
2934
+ );
2935
+ n(m);
2936
+ }
2937
+ }, s = (d) => {
2938
+ n({
2939
+ ...e,
2940
+ value: d.target.value || ""
2941
+ });
2942
+ };
2943
+ return /* @__PURE__ */ a("div", { className: i, style: { width: "calc(100% - 1rem)" }, children: /* @__PURE__ */ W("div", { className: "w-full", children: [
2944
+ /* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2 justify-between", children: /* @__PURE__ */ a("span", { className: "font-bold", children: t }) }),
2945
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 text-xs", children: /* @__PURE__ */ a("div", { children: r }) }),
2946
+ /* @__PURE__ */ W("div", { children: [
2947
+ "Value:",
2948
+ /* @__PURE__ */ a(
2949
+ gt,
2950
+ {
2951
+ label: "Filter...",
2952
+ size: "small",
2953
+ className: "w-full",
2954
+ value: e.value,
2955
+ onChange: s,
2956
+ onKeyDown: o
2957
+ }
2958
+ )
2959
+ ] })
2960
+ ] }) });
2961
+ }
2962
+ const Ie = (e, n) => [
2963
+ ...n.widgets.filter((r) => r.indexOf("Container") === -1),
2964
+ ...n.childWidgetsConfig.map((r) => r.widgetKey)
2965
+ ].includes(e);
2966
+ function ir({
2967
+ targetContainerKey: e,
2968
+ widgetsCatalog: n,
2969
+ currentDashboardConfig: t,
2970
+ undoStatus: r,
2971
+ addWidget: i,
2972
+ addContainer: o,
2973
+ onSettingItemsUpdated: s,
2974
+ onResetToDefaultDashboardClick: d,
2975
+ onUndoOrRedo: y,
2976
+ onDoneClick: m
2977
+ }) {
2978
+ const [h, u] = ce("Editing"), [g, p] = ce(0), [w, v] = ce(""), C = Array.from(n.keys()).map((E) => ({
2979
+ widgetKey: E,
2980
+ metaData: Mt(E, n)
2981
+ })), T = (E) => {
2982
+ v(E.target.value);
2983
+ }, S = (E) => {
2984
+ const z = w.trim().toLowerCase();
2985
+ return z.length < 1 ? !0 : E.displayName.trim().toLowerCase().includes(z) || E.description.toLowerCase().includes(z);
2986
+ }, D = (E) => {
2987
+ const z = w.trim().toLowerCase();
2988
+ return z.length < 1 ? !0 : E.displayName.trim().toLowerCase().includes(z) || E.description.toLowerCase().includes(z);
2989
+ }, c = (E) => Z(
2990
+ "px-4 py-2 font-medium cursor-pointer border-b-2 border-transparent hover:border-primary focus:outline-none",
2991
+ E === g ? "text-primary border-primary" : ""
2992
+ ), N = !!e;
2993
+ Ct(() => {
2994
+ if (e) {
2995
+ p(0);
2996
+ const E = ht(e);
2997
+ u(`Editing ${E}`);
2998
+ } else
2999
+ u("Editing Dashboard");
3000
+ }, [e]);
3001
+ const l = (E) => {
3002
+ N ? i(E, e) : i(E);
3003
+ }, f = (E) => {
3004
+ const z = (t.cssSettings || []).map((X) => X.key === E.key ? E : X);
3005
+ s(z);
3006
+ }, [P, $] = ce(!1);
3007
+ return /* @__PURE__ */ a(
3008
+ pn,
3009
+ {
3010
+ testId: "dashboard-catalog-flyout",
3011
+ className: "bg-body content-body bg-opacity-70 border-2 border-primary",
3012
+ style: {
3013
+ width: "360px",
3014
+ minWidth: "360px",
3015
+ maxWidth: "360px",
3016
+ minHeight: "360px",
3017
+ backdropFilter: "blur(8px)"
3018
+ },
3019
+ onDraggingChange: (E) => {
3020
+ $(E);
3021
+ },
3022
+ children: /* @__PURE__ */ W("div", { className: "flex flex-col gap-2 p-2", children: [
3023
+ /* @__PURE__ */ W("div", { className: "flex flex-row gap-2 justify-between", children: [
3024
+ /* @__PURE__ */ W("div", { className: "handle flex-1 flex gap-2 w-full hover:text-primary cursor-grab", children: [
3025
+ P ? /* @__PURE__ */ a(Gt, { className: "size-5" }) : /* @__PURE__ */ a(Xt, { className: "size-5" }),
3026
+ /* @__PURE__ */ a(
3027
+ "h2",
3028
+ {
3029
+ className: "flex-1 text-base margin-0 capitalize",
3030
+ title: N ? h : `Editing dashboard: ${t.dashboardName}`,
3031
+ children: h
3032
+ }
3033
+ )
3034
+ ] }),
3035
+ /* @__PURE__ */ W("div", { className: "flex flex-row gap-2 items-center", children: [
3036
+ /* @__PURE__ */ a(
3037
+ J,
3038
+ {
3039
+ "data-testid": "undo-dashboard-config-change",
3040
+ isIconButton: !0,
3041
+ tooltip: {
3042
+ placement: "bottom",
3043
+ title: "Undo"
3044
+ },
3045
+ disabled: r.isUndoDisabled,
3046
+ onClick: () => y("Undo"),
3047
+ children: /* @__PURE__ */ a(Kt, { className: "size-5" })
3048
+ }
3049
+ ),
3050
+ /* @__PURE__ */ a(
3051
+ J,
3052
+ {
3053
+ "data-testid": "redo-dashboard-config-change",
3054
+ isIconButton: !0,
3055
+ tooltip: {
3056
+ placement: "bottom",
3057
+ title: "Redo"
3058
+ },
3059
+ disabled: r.isRedoDisabled,
3060
+ onClick: () => y("Redo"),
3061
+ children: /* @__PURE__ */ a(Ht, { className: "size-5" })
3062
+ }
3063
+ ),
3064
+ /* @__PURE__ */ a(
3065
+ J,
3066
+ {
3067
+ "data-testid": "reset-dashboard-to-default",
3068
+ isIconButton: !0,
3069
+ tooltip: {
3070
+ placement: "bottom",
3071
+ title: "Reset this dashboard to the default configuration"
3072
+ },
3073
+ onClick: d,
3074
+ children: /* @__PURE__ */ a(Bt, { className: "size-5" })
3075
+ }
3076
+ )
3077
+ ] })
3078
+ ] }),
3079
+ /* @__PURE__ */ W("div", { className: "flex border-b border-gray-200", children: [
3080
+ /* @__PURE__ */ a("button", { onClick: () => p(0), className: c(0), children: "Widgets" }),
3081
+ /* @__PURE__ */ a("button", { onClick: () => p(1), className: c(1), children: "Charts" }),
3082
+ !N && /* @__PURE__ */ a("button", { onClick: () => p(2), className: c(2), children: "Containers" }),
3083
+ !N && /* @__PURE__ */ a("button", { onClick: () => p(3), className: c(3), children: /* @__PURE__ */ a(zt, {}) })
3084
+ ] }),
3085
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-1 w-full", children: /* @__PURE__ */ a(
3086
+ gt,
3087
+ {
3088
+ label: "Filter...",
3089
+ size: "small",
3090
+ className: "w-full",
3091
+ value: w,
3092
+ onChange: T
3093
+ }
3094
+ ) }),
3095
+ /* @__PURE__ */ W(
3096
+ "div",
3097
+ {
3098
+ className: "flex flex-col gap-2 overflow-x-hidden overflow-y-auto",
3099
+ style: {
3100
+ maxHeight: "360px"
3101
+ },
3102
+ children: [
3103
+ g === 0 && C.filter(
3104
+ (E) => E.metaData.categories.includes("Widget") && S(E.metaData)
3105
+ ).map((E) => /* @__PURE__ */ a(
3106
+ We,
3107
+ {
3108
+ widgetKey: E.widgetKey,
3109
+ metaData: E.metaData,
3110
+ alreadyAdded: Ie(E.widgetKey, t),
3111
+ addWidget: () => l(E.widgetKey)
3112
+ },
3113
+ E.widgetKey
3114
+ )),
3115
+ g === 1 && C.filter(
3116
+ (E) => E.metaData.categories.includes("Chart") && S(E.metaData)
3117
+ ).map((E) => /* @__PURE__ */ a(
3118
+ We,
3119
+ {
3120
+ widgetKey: E.widgetKey,
3121
+ metaData: E.metaData,
3122
+ alreadyAdded: Ie(E.widgetKey, t),
3123
+ addWidget: () => l(E.widgetKey)
3124
+ },
3125
+ E.widgetKey
3126
+ )),
3127
+ !N && g === 2 && C.filter((E) => E.metaData.categories.includes("Container")).map((E) => /* @__PURE__ */ a(
3128
+ We,
3129
+ {
3130
+ widgetKey: E.widgetKey,
3131
+ metaData: E.metaData,
3132
+ alreadyAdded: Ie(E.widgetKey, t),
3133
+ addWidget: () => o(E.widgetKey)
3134
+ },
3135
+ E.widgetKey
3136
+ )),
3137
+ !N && g === 3 && (t.cssSettings || []).filter(D).map((E) => /* @__PURE__ */ a(
3138
+ Cn,
3139
+ {
3140
+ item: E,
3141
+ onSettingItemChanged: f
3142
+ },
3143
+ E.key
3144
+ ))
3145
+ ]
3146
+ }
3147
+ ),
3148
+ /* @__PURE__ */ a("div", { className: "mt-4 w-full flex flex-row justify-end pt-1", children: /* @__PURE__ */ a(
3149
+ J,
3150
+ {
3151
+ className: "bg-opacity-100",
3152
+ tooltip: {
3153
+ placement: "bottom",
3154
+ title: "Click to exit edit mode"
3155
+ },
3156
+ onClick: m,
3157
+ children: "Done"
3158
+ }
3159
+ ) })
3160
+ ] })
3161
+ }
3162
+ );
3163
+ }
3164
+ export {
3165
+ Rn as AddIcon,
3166
+ J as Button,
3167
+ Jt as CircleQuestionMark,
3168
+ Zt as CrosshairIcon,
3169
+ tr as DashboardGrid,
3170
+ Le as DashboardMaxZoomScale,
3171
+ Ae as DashboardMinZoomScale,
3172
+ bn as DashboardWidgetBase,
3173
+ Et as DashboardZoomStep,
3174
+ jn as DeleteIcon,
3175
+ pn as DraggablePanel,
3176
+ wn as DynamicWidgetLoader,
3177
+ kn as EditIcon,
3178
+ An as GridIcon,
3179
+ Gt as HandGrabIcon,
3180
+ Xt as HandIcon,
3181
+ Kn as ListItem,
3182
+ Hn as ListItemLeftChild,
3183
+ Xn as ListItemMiddleChild,
3184
+ Gn as ListItemRightChild,
3185
+ Ln as MonitorIcon,
3186
+ Fn as MonitorSmartphoneIcon,
3187
+ dt as MoveLeftIcon,
3188
+ ut as MoveRightIcon,
3189
+ Ht as RedoIcon,
3190
+ zt as SettingsIcon,
3191
+ en as Stack,
3192
+ K as SvgBaseWrapper,
3193
+ Un as TabletSmartphoneIcon,
3194
+ qn as TargetIcon,
3195
+ gt as TextField,
3196
+ Bt as TimerResetIcon,
3197
+ Kt as UndoIcon,
3198
+ nr as WidgetContainerColumn,
3199
+ rr as WidgetContainerLarge,
3200
+ or as WidgetContainerRow,
3201
+ ir as WidgetsCatalogFlyout,
3202
+ Jn as WrapperColumnContent,
3203
+ Qn as WrapperColumnContentListItem,
3204
+ ft as XCircleIcon,
3205
+ Vn as ZoomInIcon,
3206
+ Yn as ZoomOutIcon,
3207
+ Ce as blankDashboardConfig,
3208
+ Pt as createDynamicEntry,
3209
+ Mn as createStaticEntry,
3210
+ St as cssSettingsCatalog,
3211
+ Bn as cssVarsUtils,
3212
+ Nt as dashboardSettingsUtils,
3213
+ _t as ensureContainersSequence,
3214
+ lt as ensureZoomScaleIsWithinRange,
3215
+ xe as getDefaultWidgetMetaFromKey,
3216
+ _n as getDefaultWidgetMetaFromMap,
3217
+ Z as getDistinctCssClasses,
3218
+ Nn as getNewZoomScaleWithinRange,
3219
+ Mt as getWidgetMetaFromCatalog,
3220
+ ht as parseContainerTitle,
3221
+ Pn as parseKeyAndTitleFromFilePath,
3222
+ $n as remoteWidgetDiscovery,
3223
+ En as removeEmptyContainers,
3224
+ re as resolveColorFromClass,
3225
+ zn as resolvedColors,
3226
+ er as showToast,
3227
+ In as useDashboardStorageService,
3228
+ Wn as useDashboardStore,
3229
+ On as useDashboardUndoService
3230
+ };