@tenorlab/react-dashboard 1.2.3 → 1.2.5
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import ae, { useState as
|
|
1
|
+
import ae, { useState as ce, useCallback as ue, useMemo as st, forwardRef as le, useRef as Ct, Suspense as St, useEffect as Dt } from "react";
|
|
2
2
|
import { jsxs as W, jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import ct from "react-dom";
|
|
4
|
+
const Tt = [
|
|
5
5
|
{
|
|
6
6
|
key: "grid-gap",
|
|
7
|
-
|
|
7
|
+
name: "Gap",
|
|
8
8
|
description: "Set the gap between widgets in the dashboard grid",
|
|
9
9
|
cssProperty: "--bwj-dashboard-gap",
|
|
10
10
|
step: 0.1,
|
|
@@ -15,7 +15,7 @@ const Nt = [
|
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
key: "widget-width",
|
|
18
|
-
|
|
18
|
+
name: "Widget Width",
|
|
19
19
|
description: "Set the min width for the widgets",
|
|
20
20
|
cssProperty: "--bwj-widget-width",
|
|
21
21
|
step: 0.1,
|
|
@@ -26,7 +26,7 @@ const Nt = [
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
key: "widget-border-radius",
|
|
29
|
-
|
|
29
|
+
name: "Widget Border Radius",
|
|
30
30
|
description: "Set the border radius for the widgets",
|
|
31
31
|
cssProperty: "--bwj-widget-border-radius",
|
|
32
32
|
step: 0.1,
|
|
@@ -37,7 +37,7 @@ const Nt = [
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
key: "widget-inner-padding-x",
|
|
40
|
-
|
|
40
|
+
name: "Widget Horiz Padding",
|
|
41
41
|
description: "Set the horizontal padding for the widgets",
|
|
42
42
|
cssProperty: "--bwj-widget-inner-px",
|
|
43
43
|
step: 0.1,
|
|
@@ -48,7 +48,7 @@ const Nt = [
|
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
key: "widget-inner-padding-y",
|
|
51
|
-
|
|
51
|
+
name: "Widget Vertical Padding",
|
|
52
52
|
description: "Set the vertical padding for the widgets",
|
|
53
53
|
cssProperty: "--bwj-widget-inner-py",
|
|
54
54
|
step: 0.1,
|
|
@@ -59,7 +59,7 @@ const Nt = [
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
key: "widget-header-padding-y",
|
|
62
|
-
|
|
62
|
+
name: "Widget Header Vertical Padding",
|
|
63
63
|
description: "Set the vertical padding for the widget headers",
|
|
64
64
|
cssProperty: "--bwj-widget-header-py",
|
|
65
65
|
step: 0.1,
|
|
@@ -70,7 +70,7 @@ const Nt = [
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
key: "widget-title-font-size",
|
|
73
|
-
|
|
73
|
+
name: "Widget Title Font Size",
|
|
74
74
|
description: "Set the font size for the widget titles",
|
|
75
75
|
cssProperty: "--bwj-widget-title-size",
|
|
76
76
|
step: 0.1,
|
|
@@ -79,9 +79,9 @@ const Nt = [
|
|
|
79
79
|
defaultValue: "1.0rem",
|
|
80
80
|
value: "1.0rem"
|
|
81
81
|
}
|
|
82
|
-
],
|
|
82
|
+
], Et = ["rem", "pc", "cm", "in", "em", "vh", "vw", "%"], Nt = (e, n) => Et.includes(e) ? n : 1, _t = {
|
|
83
83
|
incrementOrDecrementValue: (e, n) => {
|
|
84
|
-
const t = e.value.match(/([\d.]+)/), r = t ? parseFloat(t[1]) : 0,
|
|
84
|
+
const t = e.value.match(/([\d.]+)/), r = t ? parseFloat(t[1]) : 0, i = e.value.match(/([^\d.]+)/), o = i ? i[1] : e.defaultUnit, a = Nt(o, e.step) * n, b = `${Math.max(r + a, e.minValue).toFixed(1)}${o}`;
|
|
85
85
|
return {
|
|
86
86
|
...e,
|
|
87
87
|
value: b
|
|
@@ -96,13 +96,13 @@ const Nt = [
|
|
|
96
96
|
responsiveGrid: !1,
|
|
97
97
|
widgets: [],
|
|
98
98
|
childWidgetsConfig: [],
|
|
99
|
-
cssSettings: [...
|
|
100
|
-
}, Ae = 0.7, Fe = 1, Mt = 0.05,
|
|
99
|
+
cssSettings: [...Tt]
|
|
100
|
+
}, Ae = 0.7, Fe = 1, Mt = 0.05, lt = (e) => {
|
|
101
101
|
let n = Number(e || 0);
|
|
102
102
|
return n < Ae && (n = Ae), n > Fe && (n = Fe), n;
|
|
103
103
|
}, Pn = (e, n) => {
|
|
104
104
|
let t = Number(Number((Mt * n).toFixed(2)).toFixed(2)), r = Number((Number(e) + t).toFixed(2));
|
|
105
|
-
return
|
|
105
|
+
return lt(r);
|
|
106
106
|
}, $n = (e) => {
|
|
107
107
|
let n = {
|
|
108
108
|
...e
|
|
@@ -110,11 +110,11 @@ const Nt = [
|
|
|
110
110
|
return n.widgets = n.widgets.filter((t) => {
|
|
111
111
|
if (`${t}`.includes("WidgetContainer")) {
|
|
112
112
|
const r = n.childWidgetsConfig.filter(
|
|
113
|
-
(
|
|
113
|
+
(i) => i.parentWidgetKey === t
|
|
114
114
|
);
|
|
115
115
|
if (!r || r.length === 0)
|
|
116
116
|
return n.widgets = n.widgets.filter(
|
|
117
|
-
(
|
|
117
|
+
(i) => i !== t
|
|
118
118
|
), !1;
|
|
119
119
|
}
|
|
120
120
|
return !0;
|
|
@@ -123,23 +123,22 @@ const Nt = [
|
|
|
123
123
|
const n = e.widgets.filter(
|
|
124
124
|
(r) => r.includes("WidgetContainer")
|
|
125
125
|
), t = {};
|
|
126
|
-
return n.forEach((r,
|
|
127
|
-
const d = `${r.split("_container")[0]}_container${
|
|
126
|
+
return n.forEach((r, i) => {
|
|
127
|
+
const d = `${r.split("_container")[0]}_container${i + 1}`;
|
|
128
128
|
t[r] = d;
|
|
129
129
|
}), e.widgets = e.widgets.map((r) => t[r] || r), e.childWidgetsConfig = e.childWidgetsConfig.map((r) => {
|
|
130
|
-
const
|
|
130
|
+
const i = r.parentWidgetKey, o = t[i];
|
|
131
131
|
return {
|
|
132
132
|
...r,
|
|
133
133
|
// If a new key exists, use it. If not, keep the original key.
|
|
134
|
-
parentWidgetKey:
|
|
134
|
+
parentWidgetKey: o || i
|
|
135
135
|
};
|
|
136
136
|
}), e;
|
|
137
137
|
}, ge = (e, n) => {
|
|
138
|
-
const t = `${e}`.includes("Container"), r = t ? ["Container"] : ["Widget"],
|
|
138
|
+
const t = `${e}`.includes("Container"), r = t ? ["Container"] : ["Widget"], i = n?.name || e, o = n?.description || (t ? "Container" : "Unknown");
|
|
139
139
|
return {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
description: i,
|
|
140
|
+
name: i,
|
|
141
|
+
description: o,
|
|
143
142
|
categories: r,
|
|
144
143
|
noDuplicatedWidgets: !0,
|
|
145
144
|
icon: void 0,
|
|
@@ -157,7 +156,7 @@ const Nt = [
|
|
|
157
156
|
e,
|
|
158
157
|
{
|
|
159
158
|
key: e,
|
|
160
|
-
title: r.
|
|
159
|
+
title: r.name,
|
|
161
160
|
isContainer: `${e}`.includes("Container"),
|
|
162
161
|
meta: r,
|
|
163
162
|
component: n
|
|
@@ -169,7 +168,7 @@ const Nt = [
|
|
|
169
168
|
e,
|
|
170
169
|
{
|
|
171
170
|
key: e,
|
|
172
|
-
title: r.
|
|
171
|
+
title: r.name,
|
|
173
172
|
isContainer: !1,
|
|
174
173
|
meta: r,
|
|
175
174
|
loader: n
|
|
@@ -178,81 +177,80 @@ const Nt = [
|
|
|
178
177
|
}, It = (e) => {
|
|
179
178
|
const n = e.match(/\/widget-([a-zA-Z0-9-]+)\/index\.ts$/);
|
|
180
179
|
if (n && n[1]) {
|
|
181
|
-
const t = n[1], r = t.split("-"),
|
|
180
|
+
const t = n[1], r = t.split("-"), i = `Widget${r.map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join("")}`, o = r.map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ");
|
|
182
181
|
return {
|
|
183
|
-
key:
|
|
184
|
-
title:
|
|
182
|
+
key: i,
|
|
183
|
+
title: o,
|
|
185
184
|
folder: t
|
|
186
185
|
};
|
|
187
186
|
}
|
|
188
187
|
return null;
|
|
189
188
|
}, Ot = (e, n, t, r) => {
|
|
190
|
-
const
|
|
191
|
-
if (!
|
|
189
|
+
const i = `${n}/widget-${t}/meta.ts`, o = e[i];
|
|
190
|
+
if (!o)
|
|
192
191
|
return;
|
|
193
192
|
const a = `${r}Meta`;
|
|
194
|
-
return
|
|
193
|
+
return o[a] || void 0;
|
|
195
194
|
}, In = async (e) => new Promise(async (n, t) => {
|
|
196
195
|
const r = [];
|
|
197
196
|
try {
|
|
198
|
-
const
|
|
199
|
-
for (const a in
|
|
200
|
-
const d =
|
|
197
|
+
const o = await (await fetch(`${e}?${Math.random()}`)).json();
|
|
198
|
+
for (const a in o) {
|
|
199
|
+
const d = o[a], b = () => import(
|
|
201
200
|
/* @vite-ignore */
|
|
202
201
|
d.url
|
|
203
|
-
),
|
|
204
|
-
|
|
205
|
-
description: d.meta
|
|
206
|
-
categories: d.meta
|
|
207
|
-
noDuplicatedWidgets: d.meta
|
|
202
|
+
), m = {
|
|
203
|
+
name: d.meta?.name || "Unknown",
|
|
204
|
+
description: d.meta?.description || "Remote Plugin",
|
|
205
|
+
categories: d.meta?.categories || ["Widget"],
|
|
206
|
+
noDuplicatedWidgets: d.meta?.noDuplicatedWidgets ?? !0,
|
|
208
207
|
icon: void 0,
|
|
209
208
|
// Or a logic to map a string name to a Lucide component
|
|
210
|
-
externalDependencies: d.meta
|
|
209
|
+
externalDependencies: d.meta?.externalDependencies || []
|
|
211
210
|
};
|
|
212
|
-
r.push(dt(a, b,
|
|
211
|
+
r.push(dt(a, b, m));
|
|
213
212
|
}
|
|
214
213
|
n({
|
|
215
214
|
entries: r,
|
|
216
215
|
message: "",
|
|
217
216
|
details: ""
|
|
218
217
|
});
|
|
219
|
-
} catch (
|
|
220
|
-
console.error("Remote plugin discovery failed:",
|
|
218
|
+
} catch (i) {
|
|
219
|
+
console.error("Remote plugin discovery failed:", i), t({
|
|
221
220
|
entries: [],
|
|
222
221
|
message: "Remote plugin discovery failed:",
|
|
223
|
-
details: typeof
|
|
222
|
+
details: typeof i == "object" ? JSON.stringify(i) : i
|
|
224
223
|
});
|
|
225
224
|
}
|
|
226
225
|
}), On = (e, n, t, r = !0) => {
|
|
227
|
-
const
|
|
228
|
-
for (const
|
|
229
|
-
const a = n[
|
|
226
|
+
const i = [];
|
|
227
|
+
for (const o in n) {
|
|
228
|
+
const a = n[o], d = It(o);
|
|
230
229
|
if (d && a) {
|
|
231
|
-
const { key: b, title:
|
|
230
|
+
const { key: b, title: m, folder: h } = d;
|
|
232
231
|
let u = Ot(t, e, h, b);
|
|
233
232
|
if (u || (u = ge(b, {
|
|
234
|
-
title: g,
|
|
235
233
|
description: `Local ${r ? "dynamic" : "static"} widget`
|
|
236
234
|
})), r)
|
|
237
|
-
|
|
235
|
+
i.push(
|
|
238
236
|
dt(b, a, u)
|
|
239
237
|
);
|
|
240
238
|
else {
|
|
241
239
|
const p = a.default || a;
|
|
242
|
-
|
|
240
|
+
i.push(Wt(b, p, u));
|
|
243
241
|
}
|
|
244
242
|
}
|
|
245
243
|
}
|
|
246
|
-
return
|
|
244
|
+
return i;
|
|
247
245
|
}, Le = (e) => {
|
|
248
246
|
let n;
|
|
249
|
-
const t = /* @__PURE__ */ new Set(), r = (
|
|
250
|
-
const u = typeof
|
|
247
|
+
const t = /* @__PURE__ */ new Set(), r = (m, h) => {
|
|
248
|
+
const u = typeof m == "function" ? m(n) : m;
|
|
251
249
|
if (!Object.is(u, n)) {
|
|
252
250
|
const p = n;
|
|
253
251
|
n = h ?? (typeof u != "object" || u === null) ? u : Object.assign({}, n, u), t.forEach((y) => y(n, p));
|
|
254
252
|
}
|
|
255
|
-
},
|
|
253
|
+
}, i = () => n, d = { setState: r, getState: i, getInitialState: () => b, subscribe: (m) => (t.add(m), () => t.delete(m)) }, b = n = e(r, i, d);
|
|
256
254
|
return d;
|
|
257
255
|
}, Rt = ((e) => e ? Le(e) : Le), kt = (e) => e;
|
|
258
256
|
function jt(e, n = kt) {
|
|
@@ -273,9 +271,9 @@ const At = (e) => {
|
|
|
273
271
|
const t = Lt(e);
|
|
274
272
|
return `${n}_${t}`;
|
|
275
273
|
}, Ut = (e) => {
|
|
276
|
-
const { dashboardConfig: n, widgetKey: t, parentWidgetKey: r, noDuplicatedWidgets:
|
|
274
|
+
const { dashboardConfig: n, widgetKey: t, parentWidgetKey: r, noDuplicatedWidgets: i } = e;
|
|
277
275
|
if (r) {
|
|
278
|
-
if (
|
|
276
|
+
if (i && n.childWidgetsConfig.find(
|
|
279
277
|
(a) => a.parentWidgetKey === r && a.widgetKey === t
|
|
280
278
|
))
|
|
281
279
|
return {
|
|
@@ -283,7 +281,7 @@ const At = (e) => {
|
|
|
283
281
|
message: `DashboardStore: addWidget: Widget already added (${t})`,
|
|
284
282
|
updatedDashboardConfig: n
|
|
285
283
|
};
|
|
286
|
-
const
|
|
284
|
+
const o = [
|
|
287
285
|
...n.childWidgetsConfig,
|
|
288
286
|
{ parentWidgetKey: r, widgetKey: t }
|
|
289
287
|
// new entry
|
|
@@ -292,22 +290,22 @@ const At = (e) => {
|
|
|
292
290
|
success: !0,
|
|
293
291
|
updatedDashboardConfig: {
|
|
294
292
|
...n,
|
|
295
|
-
childWidgetsConfig:
|
|
293
|
+
childWidgetsConfig: o
|
|
296
294
|
}
|
|
297
295
|
};
|
|
298
296
|
} else {
|
|
299
|
-
if (
|
|
297
|
+
if (i && n.widgets.includes(t))
|
|
300
298
|
return {
|
|
301
299
|
success: !1,
|
|
302
300
|
message: `DashboardStore: addWidget: Widget already added (${t})`,
|
|
303
301
|
updatedDashboardConfig: n
|
|
304
302
|
};
|
|
305
|
-
const
|
|
303
|
+
const o = [...n.widgets, t];
|
|
306
304
|
return {
|
|
307
305
|
success: !0,
|
|
308
306
|
updatedDashboardConfig: {
|
|
309
307
|
...n,
|
|
310
|
-
widgets:
|
|
308
|
+
widgets: o
|
|
311
309
|
}
|
|
312
310
|
};
|
|
313
311
|
}
|
|
@@ -315,64 +313,64 @@ const At = (e) => {
|
|
|
315
313
|
if ((t || "").trim().length > 0) {
|
|
316
314
|
const r = e.childWidgetsConfig.filter(
|
|
317
315
|
(b) => b.parentWidgetKey !== t
|
|
318
|
-
),
|
|
316
|
+
), i = e.childWidgetsConfig.filter(
|
|
319
317
|
(b) => b.parentWidgetKey === t && b.widgetKey !== n
|
|
320
|
-
),
|
|
318
|
+
), o = [...r, ...i];
|
|
321
319
|
let a = {
|
|
322
320
|
...e,
|
|
323
|
-
childWidgetsConfig:
|
|
321
|
+
childWidgetsConfig: o
|
|
324
322
|
};
|
|
325
323
|
return `${n}`.includes("Container") && (a = Pt(a)), {
|
|
326
324
|
success: !0,
|
|
327
325
|
updatedDashboardConfig: a
|
|
328
326
|
};
|
|
329
327
|
} else {
|
|
330
|
-
const r = e.widgets.filter((
|
|
331
|
-
(
|
|
328
|
+
const r = e.widgets.filter((o) => o !== n), i = e.childWidgetsConfig.filter(
|
|
329
|
+
(o) => o.parentWidgetKey !== n
|
|
332
330
|
);
|
|
333
331
|
return {
|
|
334
332
|
success: !0,
|
|
335
333
|
updatedDashboardConfig: {
|
|
336
334
|
...e,
|
|
337
335
|
widgets: r,
|
|
338
|
-
childWidgetsConfig:
|
|
336
|
+
childWidgetsConfig: i
|
|
339
337
|
}
|
|
340
338
|
};
|
|
341
339
|
}
|
|
342
340
|
}, Yt = (e, n, t, r) => {
|
|
343
341
|
if ((r || "").trim().length > 0) {
|
|
344
|
-
const
|
|
342
|
+
const i = e.childWidgetsConfig.filter(
|
|
345
343
|
(h) => h.parentWidgetKey !== r
|
|
346
344
|
);
|
|
347
|
-
let
|
|
345
|
+
let o = e.childWidgetsConfig.filter(
|
|
348
346
|
(h) => h.parentWidgetKey === r
|
|
349
347
|
);
|
|
350
|
-
const a =
|
|
348
|
+
const a = o.indexOf(t);
|
|
351
349
|
let d = a + n;
|
|
352
|
-
if (d = Math.max(0, d), d = Math.min(
|
|
350
|
+
if (d = Math.max(0, d), d = Math.min(o.length - 1, d), d === a)
|
|
353
351
|
return {
|
|
354
352
|
success: !1,
|
|
355
353
|
message: `DashboardStore: moveWidget: Widget already at min/max position (${t})`,
|
|
356
354
|
updatedDashboardConfig: e
|
|
357
355
|
};
|
|
358
|
-
const b = [...
|
|
359
|
-
return b.splice(d, 0,
|
|
356
|
+
const b = [...o], [m] = b.splice(a, 1);
|
|
357
|
+
return b.splice(d, 0, m), {
|
|
360
358
|
success: !0,
|
|
361
359
|
updatedDashboardConfig: {
|
|
362
360
|
...e,
|
|
363
|
-
childWidgetsConfig: [...
|
|
361
|
+
childWidgetsConfig: [...i, ...b]
|
|
364
362
|
}
|
|
365
363
|
};
|
|
366
364
|
} else {
|
|
367
|
-
const
|
|
368
|
-
let a =
|
|
369
|
-
if (a = Math.max(0, a), a = Math.min(
|
|
365
|
+
const i = e.widgets || [], o = i.indexOf(t);
|
|
366
|
+
let a = o + n;
|
|
367
|
+
if (a = Math.max(0, a), a = Math.min(i.length - 1, a), a === o)
|
|
370
368
|
return {
|
|
371
369
|
success: !1,
|
|
372
370
|
message: `DashboardStore: moveWidget: Widget already at min/max position (${t})`,
|
|
373
371
|
updatedDashboardConfig: e
|
|
374
372
|
};
|
|
375
|
-
const d = [...
|
|
373
|
+
const d = [...i], [b] = d.splice(o, 1);
|
|
376
374
|
return d.splice(a, 0, b), {
|
|
377
375
|
success: !0,
|
|
378
376
|
updatedDashboardConfig: {
|
|
@@ -396,79 +394,79 @@ const At = (e) => {
|
|
|
396
394
|
setTargetContainerKey: (t) => (e(() => ({ targetContainerKey: t })), t),
|
|
397
395
|
setAllDashboardConfigs: (t) => (e(() => ({ allDashboardConfigs: t })), n().allDashboardConfigs),
|
|
398
396
|
setCurrentDashboardConfig: (t) => {
|
|
399
|
-
const r = n(),
|
|
400
|
-
...r.allDashboardConfigs.filter((
|
|
397
|
+
const r = n(), i = [
|
|
398
|
+
...r.allDashboardConfigs.filter((o) => o.dashboardId !== t.dashboardId),
|
|
401
399
|
t
|
|
402
400
|
];
|
|
403
401
|
return e(() => ({
|
|
404
402
|
...r,
|
|
405
|
-
allDashboardConfigs:
|
|
403
|
+
allDashboardConfigs: i,
|
|
406
404
|
currentDashboardConfig: t
|
|
407
|
-
})),
|
|
405
|
+
})), i;
|
|
408
406
|
},
|
|
409
407
|
addDashboardConfig: (t) => {
|
|
410
|
-
const r = n(),
|
|
411
|
-
...r.allDashboardConfigs.filter((
|
|
408
|
+
const r = n(), i = [
|
|
409
|
+
...r.allDashboardConfigs.filter((o) => o.dashboardId !== t.dashboardId),
|
|
412
410
|
t
|
|
413
411
|
];
|
|
414
412
|
return e(() => ({
|
|
415
413
|
...r,
|
|
416
|
-
allDashboardConfigs:
|
|
414
|
+
allDashboardConfigs: i,
|
|
417
415
|
currentDashboardConfig: t
|
|
418
|
-
})),
|
|
416
|
+
})), i;
|
|
419
417
|
},
|
|
420
418
|
deleteDashboardConfigById: (t) => {
|
|
421
|
-
const r = n(),
|
|
419
|
+
const r = n(), i = [...r.allDashboardConfigs.filter((o) => o.dashboardId !== t)];
|
|
422
420
|
return e(() => ({
|
|
423
421
|
...r,
|
|
424
|
-
allDashboardConfigs:
|
|
425
|
-
currentDashboardConfig:
|
|
426
|
-
})),
|
|
422
|
+
allDashboardConfigs: i,
|
|
423
|
+
currentDashboardConfig: i[0] || Ce
|
|
424
|
+
})), i;
|
|
427
425
|
},
|
|
428
426
|
selectDashboardById: (t) => (e(() => {
|
|
429
|
-
const r = n(),
|
|
430
|
-
return
|
|
431
|
-
currentDashboardConfig:
|
|
427
|
+
const r = n(), i = r.allDashboardConfigs.find((o) => o.dashboardId === t);
|
|
428
|
+
return i ? {
|
|
429
|
+
currentDashboardConfig: i
|
|
432
430
|
} : {
|
|
433
431
|
...r
|
|
434
432
|
};
|
|
435
433
|
}), n().currentDashboardConfig),
|
|
436
434
|
addWidget: (t) => {
|
|
437
|
-
const r = n(),
|
|
435
|
+
const r = n(), i = Ut({
|
|
438
436
|
dashboardConfig: r.currentDashboardConfig,
|
|
439
437
|
...t
|
|
440
|
-
}),
|
|
438
|
+
}), o = [
|
|
441
439
|
...r.allDashboardConfigs.filter(
|
|
442
|
-
(a) => a.dashboardId !==
|
|
440
|
+
(a) => a.dashboardId !== i.updatedDashboardConfig.dashboardId
|
|
443
441
|
),
|
|
444
|
-
|
|
442
|
+
i.updatedDashboardConfig
|
|
445
443
|
];
|
|
446
|
-
return
|
|
447
|
-
allDashboardConfigs:
|
|
448
|
-
currentDashboardConfig:
|
|
444
|
+
return i.success && e(() => ({
|
|
445
|
+
allDashboardConfigs: o,
|
|
446
|
+
currentDashboardConfig: i.updatedDashboardConfig
|
|
449
447
|
})), {
|
|
450
|
-
...
|
|
451
|
-
allUpdatedDashboardConfigs:
|
|
448
|
+
...i,
|
|
449
|
+
allUpdatedDashboardConfigs: o
|
|
452
450
|
};
|
|
453
451
|
},
|
|
454
452
|
removeWidget: (t, r) => {
|
|
455
|
-
const
|
|
456
|
-
...
|
|
457
|
-
(d) => d.dashboardId !==
|
|
453
|
+
const i = n(), o = qt(i.currentDashboardConfig, t, r), a = [
|
|
454
|
+
...i.allDashboardConfigs.filter(
|
|
455
|
+
(d) => d.dashboardId !== o.updatedDashboardConfig.dashboardId
|
|
458
456
|
),
|
|
459
|
-
|
|
457
|
+
o.updatedDashboardConfig
|
|
460
458
|
];
|
|
461
|
-
return
|
|
459
|
+
return o.success && e(() => ({
|
|
462
460
|
allDashboardConfigs: a,
|
|
463
|
-
currentDashboardConfig:
|
|
461
|
+
currentDashboardConfig: o.updatedDashboardConfig
|
|
464
462
|
})), {
|
|
465
|
-
...
|
|
463
|
+
...o,
|
|
466
464
|
allUpdatedDashboardConfigs: a
|
|
467
465
|
};
|
|
468
466
|
},
|
|
469
|
-
moveWidget: (t, r,
|
|
470
|
-
const
|
|
471
|
-
...
|
|
467
|
+
moveWidget: (t, r, i) => {
|
|
468
|
+
const o = n(), a = Yt(o.currentDashboardConfig, t, r, i), d = [
|
|
469
|
+
...o.allDashboardConfigs.filter(
|
|
472
470
|
(b) => b.dashboardId !== a.updatedDashboardConfig.dashboardId
|
|
473
471
|
),
|
|
474
472
|
a.updatedDashboardConfig
|
|
@@ -484,29 +482,29 @@ const At = (e) => {
|
|
|
484
482
|
}), Rn = Ft()((...e) => ({
|
|
485
483
|
...zt(...e)
|
|
486
484
|
})), ut = (e, n) => `dashboards_${n}_${e}`, Bt = async (e, n, t, r) => {
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
485
|
+
const i = localStorage.getItem(ut(e, n));
|
|
486
|
+
if (i)
|
|
489
487
|
try {
|
|
490
|
-
const
|
|
491
|
-
return
|
|
488
|
+
const o = JSON.parse(i);
|
|
489
|
+
return o.length < 1 ? [r] : (o.forEach((a) => {
|
|
492
490
|
a.dashboardId || (a.dashboardId = "default"), a.dashboardName || (a.dashboardName = `Dashboard ${a.dashboardId}`), a.responsiveGrid = a.responsiveGrid ?? !1, (a.widgets || []).length < 1 && (a.widgets = r.widgets);
|
|
493
491
|
const d = (a.cssSettings || []).filter(
|
|
494
|
-
(b) => r.cssSettings.some((
|
|
492
|
+
(b) => r.cssSettings.some((m) => m.key === b.key)
|
|
495
493
|
);
|
|
496
494
|
if (d.length < 1)
|
|
497
495
|
a.cssSettings = [...r.cssSettings];
|
|
498
496
|
else {
|
|
499
|
-
d.forEach((
|
|
500
|
-
|
|
497
|
+
d.forEach((m) => {
|
|
498
|
+
m.value = (m.value || "").replace(/NaN/g, "");
|
|
501
499
|
const h = r.cssSettings.find(
|
|
502
|
-
(u) => u.key ===
|
|
500
|
+
(u) => u.key === m.key
|
|
503
501
|
);
|
|
504
502
|
h && (Object.keys(h).forEach((u) => {
|
|
505
|
-
u in
|
|
506
|
-
}),
|
|
503
|
+
u in m || (m[u] = h[u]);
|
|
504
|
+
}), 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"));
|
|
507
505
|
});
|
|
508
|
-
const b = r.cssSettings.filter((
|
|
509
|
-
(h) => h.key ===
|
|
506
|
+
const b = r.cssSettings.filter((m) => !d.some(
|
|
507
|
+
(h) => h.key === m.key
|
|
510
508
|
));
|
|
511
509
|
a.cssSettings = [...d, ...b];
|
|
512
510
|
}
|
|
@@ -515,28 +513,28 @@ const At = (e) => {
|
|
|
515
513
|
), a.childWidgetsConfig = a.childWidgetsConfig.filter(
|
|
516
514
|
(b) => t.has(b.widgetKey)
|
|
517
515
|
), a.zoomScale ? a.zoomScale < 0.7 && (a.zoomScale = 0.7) : a.zoomScale = 1;
|
|
518
|
-
}),
|
|
519
|
-
} catch (
|
|
520
|
-
console.warn("Error parsing saved dashboard config:",
|
|
516
|
+
}), o);
|
|
517
|
+
} catch (o) {
|
|
518
|
+
console.warn("Error parsing saved dashboard config:", o);
|
|
521
519
|
}
|
|
522
520
|
return [r];
|
|
523
521
|
}, Ht = async (e, n, t, r) => {
|
|
524
|
-
t.forEach((
|
|
525
|
-
if (
|
|
522
|
+
t.forEach((o) => {
|
|
523
|
+
if (o.userID = e, o.clientAppKey = n, o.responsiveGrid = o.responsiveGrid ?? !1, typeof o != "object")
|
|
526
524
|
throw new Error("Invalid dashboard configuration");
|
|
527
|
-
|
|
525
|
+
o.widgets = o.widgets.filter(
|
|
528
526
|
(a) => a.includes("WidgetContainer") || r.has(a)
|
|
529
|
-
),
|
|
527
|
+
), o.childWidgetsConfig = o.childWidgetsConfig.filter(
|
|
530
528
|
(a) => r.has(a.widgetKey)
|
|
531
|
-
),
|
|
529
|
+
), o.zoomScale ? o.zoomScale < 0.7 && (o.zoomScale = 0.7) : o.zoomScale = 1;
|
|
532
530
|
});
|
|
533
|
-
const
|
|
534
|
-
return localStorage.setItem(ut(e, n),
|
|
531
|
+
const i = JSON.stringify(t);
|
|
532
|
+
return localStorage.setItem(ut(e, n), i), !0;
|
|
535
533
|
}, Kt = {
|
|
536
534
|
getSavedDashboards: Bt,
|
|
537
535
|
saveDashboards: Ht
|
|
538
536
|
}, kn = () => Kt, jn = () => {
|
|
539
|
-
const [e, n] =
|
|
537
|
+
const [e, n] = ce({}), [t, r] = ce({}), i = ue((h) => {
|
|
540
538
|
const u = h.dashboardId;
|
|
541
539
|
n((p) => {
|
|
542
540
|
const y = {
|
|
@@ -552,16 +550,16 @@ const At = (e) => {
|
|
|
552
550
|
// Forces a reset to just this one entry
|
|
553
551
|
};
|
|
554
552
|
});
|
|
555
|
-
}, []),
|
|
553
|
+
}, []), o = ue(
|
|
556
554
|
(h) => {
|
|
557
555
|
n((u) => {
|
|
558
|
-
const p = h.dashboardId, y = u[p] || [], D = t[p] ?? -1,
|
|
559
|
-
undoIndex:
|
|
556
|
+
const p = h.dashboardId, y = u[p] || [], D = t[p] ?? -1, g = y.slice(0, D + 1), v = {
|
|
557
|
+
undoIndex: g.length,
|
|
560
558
|
// New index based on trimmed length
|
|
561
559
|
config: h
|
|
562
|
-
}, w = [...
|
|
563
|
-
return r((
|
|
564
|
-
...
|
|
560
|
+
}, w = [...g, v];
|
|
561
|
+
return r((T) => ({
|
|
562
|
+
...T,
|
|
565
563
|
[p]: w.length - 1
|
|
566
564
|
// Index is now the last element's index
|
|
567
565
|
})), {
|
|
@@ -604,9 +602,9 @@ const At = (e) => {
|
|
|
604
602
|
]
|
|
605
603
|
);
|
|
606
604
|
return {
|
|
607
|
-
initializeHistoryForDashboard:
|
|
605
|
+
initializeHistoryForDashboard: i,
|
|
608
606
|
resetAllHistory: () => n({}),
|
|
609
|
-
addUndoEntry:
|
|
607
|
+
addUndoEntry: o,
|
|
610
608
|
removeUndoHistoryForDashboard: a,
|
|
611
609
|
undo: d,
|
|
612
610
|
redo: b,
|
|
@@ -831,7 +829,7 @@ const G = (e, ...n) => [
|
|
|
831
829
|
].join(" ").trim(), re = (e, n = "color") => {
|
|
832
830
|
if (typeof window > "u") return "#FFFFFF";
|
|
833
831
|
const t = document.createElement("div");
|
|
834
|
-
Array.isArray(e) ? e.forEach((
|
|
832
|
+
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);
|
|
835
833
|
const r = window.getComputedStyle(t)[n];
|
|
836
834
|
return document.body.removeChild(t), r;
|
|
837
835
|
}, Kn = {
|
|
@@ -866,8 +864,8 @@ const G = (e, ...n) => [
|
|
|
866
864
|
className: n,
|
|
867
865
|
size: t = "medium",
|
|
868
866
|
value: r,
|
|
869
|
-
onChange:
|
|
870
|
-
onKeyDown:
|
|
867
|
+
onChange: i,
|
|
868
|
+
onKeyDown: o,
|
|
871
869
|
placeholder: a = ""
|
|
872
870
|
}) => {
|
|
873
871
|
const d = st(() => t === "small" ? "py-1.5 px-3 text-sm" : "py-2.5 px-4 text-base", [t]), b = G("flex flex-col mb-4", n || ""), h = `${G(`
|
|
@@ -885,8 +883,8 @@ const G = (e, ...n) => [
|
|
|
885
883
|
id: e,
|
|
886
884
|
type: "text",
|
|
887
885
|
value: r,
|
|
888
|
-
onChange:
|
|
889
|
-
onKeyDown: (u) =>
|
|
886
|
+
onChange: i,
|
|
887
|
+
onKeyDown: (u) => o && o(u),
|
|
890
888
|
placeholder: a,
|
|
891
889
|
className: h,
|
|
892
890
|
"aria-label": e
|
|
@@ -908,18 +906,18 @@ function J(e) {
|
|
|
908
906
|
tooltip: n,
|
|
909
907
|
disabled: t,
|
|
910
908
|
isIconButton: r,
|
|
911
|
-
className:
|
|
912
|
-
buttonType:
|
|
909
|
+
className: i,
|
|
910
|
+
buttonType: o,
|
|
913
911
|
category: a,
|
|
914
912
|
px: d,
|
|
915
913
|
py: b,
|
|
916
|
-
children:
|
|
914
|
+
children: m,
|
|
917
915
|
...h
|
|
918
916
|
} = e, u = () => {
|
|
919
|
-
const y = e.isIconButton || !1, D = e.category || "primary",
|
|
917
|
+
const y = e.isIconButton || !1, D = e.category || "primary", g = e.buttonType || "normal", v = e.disabled || !1, w = e.className || "", T = e.font || "semibold", C = Number((e.border || 0) > 0 ? e.border : 0);
|
|
920
918
|
let S = (e.borderColor || "").trim();
|
|
921
919
|
S = S.length > 0 ? S : "";
|
|
922
|
-
const
|
|
920
|
+
const l = Number((e.borderHover || 0) > 0 ? e.borderHover : 0), N = e.shadow || "sm", c = e.shadowHover || "md", f = (e.addCss || "").trim(), M = e.justifyCss || "justify-center";
|
|
923
921
|
if (y)
|
|
924
922
|
return G(
|
|
925
923
|
"flex flex-row items-center",
|
|
@@ -931,41 +929,41 @@ function J(e) {
|
|
|
931
929
|
"rounded-sm focus:outline-none focus:ring focus:ring-offset",
|
|
932
930
|
"transition-all duration-150",
|
|
933
931
|
"text-sm",
|
|
934
|
-
`font-${
|
|
932
|
+
`font-${T}`
|
|
935
933
|
];
|
|
936
934
|
if (v)
|
|
937
|
-
|
|
935
|
+
g === "ghost" ? $.push("text-disabled border-disabled cursor-not-allowed") : $.push("bg-disabled content-disabled border-disabled cursor-not-allowed");
|
|
938
936
|
else {
|
|
939
937
|
$.push("cursor-pointer");
|
|
940
938
|
let I = "";
|
|
941
|
-
Se.has(
|
|
942
|
-
const
|
|
943
|
-
$.push(
|
|
939
|
+
Se.has(g) ? I = `${Se.get(g)}` : I = `${Se.get("normal")}`, C < 1 && (I = I.replace("border-[category]", ""));
|
|
940
|
+
const E = I.replace(/\[category\]/g, D).trim();
|
|
941
|
+
$.push(E);
|
|
944
942
|
}
|
|
945
|
-
return C > 0 ? ($.push(`border-[${C}px]`), $.push(`border-${S}`)) : ($.push("border-[1px]"), $.push("border-transparent")),
|
|
943
|
+
return C > 0 ? ($.push(`border-[${C}px]`), $.push(`border-${S}`)) : ($.push("border-[1px]"), $.push("border-transparent")), l > 0 ? ($.push(`hover:border-[${l}px] group-hover:border-[${l}px]`), $.push(`hover:border-${S} group-hover:border-${S}`)) : $.push("hover:border-[1px] group-hover:border-[1px]"), $.push(`shadow-${N}`), $.push(`hover:shadow-${c} group-hover:shadow-${c}`), f.length > 0 && $.push(f), f.indexOf("hidden") === -1 && $.push("inline-flex"), $.push(M), $.join(" ").trim();
|
|
946
944
|
}, p = () => {
|
|
947
945
|
const y = e.px || 0.7, D = e.py || 0.25;
|
|
948
946
|
return {
|
|
949
947
|
padding: r ? 0 : `${D}rem ${y}rem `
|
|
950
948
|
};
|
|
951
949
|
};
|
|
952
|
-
return /* @__PURE__ */ s("button", { type: "button", disabled: t, className: u(), style: p(), ...h, children:
|
|
950
|
+
return /* @__PURE__ */ s("button", { type: "button", disabled: t, className: u(), style: p(), ...h, children: m });
|
|
953
951
|
}
|
|
954
952
|
const rn = (e) => e.direction === "row" ? G("flex flex-row items-center gap-2", e.classNames || "") : G("flex flex-col gap-2 w-full", e.classNames || "");
|
|
955
953
|
function on(e) {
|
|
956
|
-
const { children: n, testId: t, classNames: r, direction:
|
|
957
|
-
return /* @__PURE__ */ s("div", { "data-testid": t || "not-set", className: a, ...
|
|
954
|
+
const { children: n, testId: t, classNames: r, direction: i, ...o } = e, a = rn(e);
|
|
955
|
+
return /* @__PURE__ */ s("div", { "data-testid": t || "not-set", className: a, ...o, children: n });
|
|
958
956
|
}
|
|
959
|
-
const Gn =
|
|
957
|
+
const Gn = le(
|
|
960
958
|
(e, n) => {
|
|
961
|
-
const { classNames: t, innerClass: r, ...
|
|
959
|
+
const { classNames: t, innerClass: r, ...i } = e, o = G(t || "", "w-full"), a = G(
|
|
962
960
|
`w-full flex overflow-hidden justify-between items-center gap-0
|
|
963
961
|
rounded-md border`,
|
|
964
962
|
r || ""
|
|
965
963
|
);
|
|
966
|
-
return /* @__PURE__ */ s(on, { direction: "row", classNames:
|
|
964
|
+
return /* @__PURE__ */ s(on, { direction: "row", classNames: o, ...i, children: /* @__PURE__ */ s("div", { className: a, children: e.children }) });
|
|
967
965
|
}
|
|
968
|
-
), Zn =
|
|
966
|
+
), Zn = le((e, n) => /* @__PURE__ */ s(
|
|
969
967
|
"div",
|
|
970
968
|
{
|
|
971
969
|
"data-testid": e.testId || "not-set",
|
|
@@ -976,7 +974,7 @@ const Gn = ce(
|
|
|
976
974
|
},
|
|
977
975
|
children: e.children
|
|
978
976
|
}
|
|
979
|
-
)), Jn =
|
|
977
|
+
)), Jn = le(
|
|
980
978
|
(e, n) => /* @__PURE__ */ s(
|
|
981
979
|
"div",
|
|
982
980
|
{
|
|
@@ -985,7 +983,7 @@ const Gn = ce(
|
|
|
985
983
|
children: e.children
|
|
986
984
|
}
|
|
987
985
|
)
|
|
988
|
-
), Qn =
|
|
986
|
+
), Qn = le((e, n) => /* @__PURE__ */ s(
|
|
989
987
|
"div",
|
|
990
988
|
{
|
|
991
989
|
"data-testid": e.testId || "not-set",
|
|
@@ -1005,76 +1003,76 @@ var Ve;
|
|
|
1005
1003
|
function sn() {
|
|
1006
1004
|
if (Ve) return U;
|
|
1007
1005
|
Ve = 1;
|
|
1008
|
-
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,
|
|
1009
|
-
function C(
|
|
1010
|
-
if (typeof
|
|
1011
|
-
var
|
|
1012
|
-
switch (
|
|
1006
|
+
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, a = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, d = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, b = 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, p = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, y = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, D = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, g = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, v = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, w = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, T = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
1007
|
+
function C(l) {
|
|
1008
|
+
if (typeof l == "object" && l !== null) {
|
|
1009
|
+
var N = l.$$typeof;
|
|
1010
|
+
switch (N) {
|
|
1013
1011
|
case n:
|
|
1014
|
-
switch (
|
|
1012
|
+
switch (l = l.type, l) {
|
|
1015
1013
|
case b:
|
|
1016
|
-
case
|
|
1014
|
+
case m:
|
|
1017
1015
|
case r:
|
|
1018
|
-
case i:
|
|
1019
1016
|
case o:
|
|
1017
|
+
case i:
|
|
1020
1018
|
case u:
|
|
1021
|
-
return
|
|
1019
|
+
return l;
|
|
1022
1020
|
default:
|
|
1023
|
-
switch (
|
|
1021
|
+
switch (l = l && l.$$typeof, l) {
|
|
1024
1022
|
case d:
|
|
1025
1023
|
case h:
|
|
1026
1024
|
case D:
|
|
1027
1025
|
case y:
|
|
1028
1026
|
case a:
|
|
1029
|
-
return
|
|
1027
|
+
return l;
|
|
1030
1028
|
default:
|
|
1031
|
-
return
|
|
1029
|
+
return N;
|
|
1032
1030
|
}
|
|
1033
1031
|
}
|
|
1034
1032
|
case t:
|
|
1035
|
-
return
|
|
1033
|
+
return N;
|
|
1036
1034
|
}
|
|
1037
1035
|
}
|
|
1038
1036
|
}
|
|
1039
|
-
function S(
|
|
1040
|
-
return C(
|
|
1041
|
-
}
|
|
1042
|
-
return U.AsyncMode = b, U.ConcurrentMode =
|
|
1043
|
-
return S(
|
|
1044
|
-
}, U.isConcurrentMode = S, U.isContextConsumer = function(
|
|
1045
|
-
return C(
|
|
1046
|
-
}, U.isContextProvider = function(
|
|
1047
|
-
return C(
|
|
1048
|
-
}, U.isElement = function(
|
|
1049
|
-
return typeof
|
|
1050
|
-
}, U.isForwardRef = function(
|
|
1051
|
-
return C(
|
|
1052
|
-
}, U.isFragment = function(
|
|
1053
|
-
return C(
|
|
1054
|
-
}, U.isLazy = function(
|
|
1055
|
-
return C(
|
|
1056
|
-
}, U.isMemo = function(
|
|
1057
|
-
return C(
|
|
1058
|
-
}, U.isPortal = function(
|
|
1059
|
-
return C(
|
|
1060
|
-
}, U.isProfiler = function(
|
|
1061
|
-
return C(
|
|
1062
|
-
}, U.isStrictMode = function(
|
|
1063
|
-
return C(
|
|
1064
|
-
}, U.isSuspense = function(
|
|
1065
|
-
return C(
|
|
1066
|
-
}, U.isValidElementType = function(
|
|
1067
|
-
return typeof
|
|
1037
|
+
function S(l) {
|
|
1038
|
+
return C(l) === m;
|
|
1039
|
+
}
|
|
1040
|
+
return U.AsyncMode = b, U.ConcurrentMode = m, U.ContextConsumer = d, U.ContextProvider = a, U.Element = n, U.ForwardRef = h, U.Fragment = r, U.Lazy = D, U.Memo = y, U.Portal = t, U.Profiler = o, U.StrictMode = i, U.Suspense = u, U.isAsyncMode = function(l) {
|
|
1041
|
+
return S(l) || C(l) === b;
|
|
1042
|
+
}, U.isConcurrentMode = S, U.isContextConsumer = function(l) {
|
|
1043
|
+
return C(l) === d;
|
|
1044
|
+
}, U.isContextProvider = function(l) {
|
|
1045
|
+
return C(l) === a;
|
|
1046
|
+
}, U.isElement = function(l) {
|
|
1047
|
+
return typeof l == "object" && l !== null && l.$$typeof === n;
|
|
1048
|
+
}, U.isForwardRef = function(l) {
|
|
1049
|
+
return C(l) === h;
|
|
1050
|
+
}, U.isFragment = function(l) {
|
|
1051
|
+
return C(l) === r;
|
|
1052
|
+
}, U.isLazy = function(l) {
|
|
1053
|
+
return C(l) === D;
|
|
1054
|
+
}, U.isMemo = function(l) {
|
|
1055
|
+
return C(l) === y;
|
|
1056
|
+
}, U.isPortal = function(l) {
|
|
1057
|
+
return C(l) === t;
|
|
1058
|
+
}, U.isProfiler = function(l) {
|
|
1059
|
+
return C(l) === o;
|
|
1060
|
+
}, U.isStrictMode = function(l) {
|
|
1061
|
+
return C(l) === i;
|
|
1062
|
+
}, U.isSuspense = function(l) {
|
|
1063
|
+
return C(l) === u;
|
|
1064
|
+
}, U.isValidElementType = function(l) {
|
|
1065
|
+
return typeof l == "string" || typeof l == "function" || l === r || l === m || l === o || l === i || l === u || l === p || typeof l == "object" && l !== null && (l.$$typeof === D || l.$$typeof === y || l.$$typeof === a || l.$$typeof === d || l.$$typeof === h || l.$$typeof === v || l.$$typeof === w || l.$$typeof === T || l.$$typeof === g);
|
|
1068
1066
|
}, U.typeOf = C, U;
|
|
1069
1067
|
}
|
|
1070
1068
|
var q = {};
|
|
1071
1069
|
var Ue;
|
|
1072
|
-
function
|
|
1070
|
+
function cn() {
|
|
1073
1071
|
return Ue || (Ue = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1074
|
-
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,
|
|
1072
|
+
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, a = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, d = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, b = 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, p = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, y = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, D = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, g = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, v = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, w = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, T = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
1075
1073
|
function C(_) {
|
|
1076
1074
|
return typeof _ == "string" || typeof _ == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1077
|
-
_ === r || _ ===
|
|
1075
|
+
_ === r || _ === m || _ === o || _ === i || _ === u || _ === p || typeof _ == "object" && _ !== null && (_.$$typeof === D || _.$$typeof === y || _.$$typeof === a || _.$$typeof === d || _.$$typeof === h || _.$$typeof === v || _.$$typeof === w || _.$$typeof === T || _.$$typeof === g);
|
|
1078
1076
|
}
|
|
1079
1077
|
function S(_) {
|
|
1080
1078
|
if (typeof _ == "object" && _ !== null) {
|
|
@@ -1084,10 +1082,10 @@ function ln() {
|
|
|
1084
1082
|
var me = _.type;
|
|
1085
1083
|
switch (me) {
|
|
1086
1084
|
case b:
|
|
1087
|
-
case
|
|
1085
|
+
case m:
|
|
1088
1086
|
case r:
|
|
1089
|
-
case i:
|
|
1090
1087
|
case o:
|
|
1088
|
+
case i:
|
|
1091
1089
|
case u:
|
|
1092
1090
|
return me;
|
|
1093
1091
|
default:
|
|
@@ -1108,12 +1106,12 @@ function ln() {
|
|
|
1108
1106
|
}
|
|
1109
1107
|
}
|
|
1110
1108
|
}
|
|
1111
|
-
var
|
|
1109
|
+
var l = b, N = m, c = d, f = a, M = n, $ = h, I = r, E = D, z = y, X = t, Q = o, K = i, ee = u, se = !1;
|
|
1112
1110
|
function de(_) {
|
|
1113
1111
|
return se || (se = !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(_) || S(_) === b;
|
|
1114
1112
|
}
|
|
1115
1113
|
function x(_) {
|
|
1116
|
-
return S(_) ===
|
|
1114
|
+
return S(_) === m;
|
|
1117
1115
|
}
|
|
1118
1116
|
function P(_) {
|
|
1119
1117
|
return S(_) === d;
|
|
@@ -1140,37 +1138,37 @@ function ln() {
|
|
|
1140
1138
|
return S(_) === t;
|
|
1141
1139
|
}
|
|
1142
1140
|
function Y(_) {
|
|
1143
|
-
return S(_) ===
|
|
1141
|
+
return S(_) === o;
|
|
1144
1142
|
}
|
|
1145
1143
|
function V(_) {
|
|
1146
|
-
return S(_) ===
|
|
1144
|
+
return S(_) === i;
|
|
1147
1145
|
}
|
|
1148
1146
|
function Z(_) {
|
|
1149
1147
|
return S(_) === u;
|
|
1150
1148
|
}
|
|
1151
|
-
q.AsyncMode =
|
|
1149
|
+
q.AsyncMode = l, q.ConcurrentMode = N, q.ContextConsumer = c, q.ContextProvider = f, q.Element = M, q.ForwardRef = $, q.Fragment = I, q.Lazy = E, q.Memo = z, q.Portal = X, q.Profiler = Q, q.StrictMode = K, q.Suspense = ee, q.isAsyncMode = de, q.isConcurrentMode = x, q.isContextConsumer = P, q.isContextProvider = A, q.isElement = k, q.isForwardRef = O, q.isFragment = F, q.isLazy = R, q.isMemo = j, q.isPortal = L, q.isProfiler = Y, q.isStrictMode = V, q.isSuspense = Z, q.isValidElementType = C, q.typeOf = S;
|
|
1152
1150
|
})()), q;
|
|
1153
1151
|
}
|
|
1154
1152
|
var qe;
|
|
1155
1153
|
function yt() {
|
|
1156
|
-
return qe || (qe = 1, process.env.NODE_ENV === "production" ? ye.exports = sn() : ye.exports =
|
|
1154
|
+
return qe || (qe = 1, process.env.NODE_ENV === "production" ? ye.exports = sn() : ye.exports = cn()), ye.exports;
|
|
1157
1155
|
}
|
|
1158
|
-
var
|
|
1159
|
-
function
|
|
1160
|
-
if (Ye) return
|
|
1156
|
+
var Te, Ye;
|
|
1157
|
+
function ln() {
|
|
1158
|
+
if (Ye) return Te;
|
|
1161
1159
|
Ye = 1;
|
|
1162
1160
|
var e = Object.getOwnPropertySymbols, n = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
|
|
1163
|
-
function r(
|
|
1164
|
-
if (
|
|
1161
|
+
function r(o) {
|
|
1162
|
+
if (o == null)
|
|
1165
1163
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
1166
|
-
return Object(
|
|
1164
|
+
return Object(o);
|
|
1167
1165
|
}
|
|
1168
|
-
function
|
|
1166
|
+
function i() {
|
|
1169
1167
|
try {
|
|
1170
1168
|
if (!Object.assign)
|
|
1171
1169
|
return !1;
|
|
1172
|
-
var
|
|
1173
|
-
if (
|
|
1170
|
+
var o = new String("abc");
|
|
1171
|
+
if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5")
|
|
1174
1172
|
return !1;
|
|
1175
1173
|
for (var a = {}, d = 0; d < 10; d++)
|
|
1176
1174
|
a["_" + String.fromCharCode(d)] = d;
|
|
@@ -1179,38 +1177,38 @@ function cn() {
|
|
|
1179
1177
|
});
|
|
1180
1178
|
if (b.join("") !== "0123456789")
|
|
1181
1179
|
return !1;
|
|
1182
|
-
var
|
|
1180
|
+
var m = {};
|
|
1183
1181
|
return "abcdefghijklmnopqrst".split("").forEach(function(h) {
|
|
1184
|
-
|
|
1185
|
-
}), Object.keys(Object.assign({},
|
|
1182
|
+
m[h] = h;
|
|
1183
|
+
}), Object.keys(Object.assign({}, m)).join("") === "abcdefghijklmnopqrst";
|
|
1186
1184
|
} catch {
|
|
1187
1185
|
return !1;
|
|
1188
1186
|
}
|
|
1189
1187
|
}
|
|
1190
|
-
return
|
|
1191
|
-
for (var d, b = r(
|
|
1188
|
+
return Te = i() ? Object.assign : function(o, a) {
|
|
1189
|
+
for (var d, b = r(o), m, h = 1; h < arguments.length; h++) {
|
|
1192
1190
|
d = Object(arguments[h]);
|
|
1193
1191
|
for (var u in d)
|
|
1194
1192
|
n.call(d, u) && (b[u] = d[u]);
|
|
1195
1193
|
if (e) {
|
|
1196
|
-
|
|
1197
|
-
for (var p = 0; p <
|
|
1198
|
-
t.call(d,
|
|
1194
|
+
m = e(d);
|
|
1195
|
+
for (var p = 0; p < m.length; p++)
|
|
1196
|
+
t.call(d, m[p]) && (b[m[p]] = d[m[p]]);
|
|
1199
1197
|
}
|
|
1200
1198
|
}
|
|
1201
1199
|
return b;
|
|
1202
|
-
},
|
|
1200
|
+
}, Te;
|
|
1203
1201
|
}
|
|
1204
|
-
var
|
|
1202
|
+
var Ee, ze;
|
|
1205
1203
|
function Oe() {
|
|
1206
|
-
if (ze) return
|
|
1204
|
+
if (ze) return Ee;
|
|
1207
1205
|
ze = 1;
|
|
1208
1206
|
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1209
|
-
return
|
|
1207
|
+
return Ee = e, Ee;
|
|
1210
1208
|
}
|
|
1211
|
-
var
|
|
1209
|
+
var Ne, Be;
|
|
1212
1210
|
function bt() {
|
|
1213
|
-
return Be || (Be = 1,
|
|
1211
|
+
return Be || (Be = 1, Ne = Function.call.bind(Object.prototype.hasOwnProperty)), Ne;
|
|
1214
1212
|
}
|
|
1215
1213
|
var _e, He;
|
|
1216
1214
|
function dn() {
|
|
@@ -1220,8 +1218,8 @@ function dn() {
|
|
|
1220
1218
|
};
|
|
1221
1219
|
if (process.env.NODE_ENV !== "production") {
|
|
1222
1220
|
var n = /* @__PURE__ */ Oe(), t = {}, r = /* @__PURE__ */ bt();
|
|
1223
|
-
e = function(
|
|
1224
|
-
var a = "Warning: " +
|
|
1221
|
+
e = function(o) {
|
|
1222
|
+
var a = "Warning: " + o;
|
|
1225
1223
|
typeof console < "u" && console.error(a);
|
|
1226
1224
|
try {
|
|
1227
1225
|
throw new Error(a);
|
|
@@ -1229,19 +1227,19 @@ function dn() {
|
|
|
1229
1227
|
}
|
|
1230
1228
|
};
|
|
1231
1229
|
}
|
|
1232
|
-
function o
|
|
1230
|
+
function i(o, a, d, b, m) {
|
|
1233
1231
|
if (process.env.NODE_ENV !== "production") {
|
|
1234
|
-
for (var h in
|
|
1235
|
-
if (r(
|
|
1232
|
+
for (var h in o)
|
|
1233
|
+
if (r(o, h)) {
|
|
1236
1234
|
var u;
|
|
1237
1235
|
try {
|
|
1238
|
-
if (typeof
|
|
1236
|
+
if (typeof o[h] != "function") {
|
|
1239
1237
|
var p = Error(
|
|
1240
|
-
(b || "React class") + ": " + d + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof
|
|
1238
|
+
(b || "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`."
|
|
1241
1239
|
);
|
|
1242
1240
|
throw p.name = "Invariant Violation", p;
|
|
1243
1241
|
}
|
|
1244
|
-
u =
|
|
1242
|
+
u = o[h](a, h, b, d, null, n);
|
|
1245
1243
|
} catch (D) {
|
|
1246
1244
|
u = D;
|
|
1247
1245
|
}
|
|
@@ -1249,7 +1247,7 @@ function dn() {
|
|
|
1249
1247
|
(b || "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)."
|
|
1250
1248
|
), u instanceof Error && !(u.message in t)) {
|
|
1251
1249
|
t[u.message] = !0;
|
|
1252
|
-
var y =
|
|
1250
|
+
var y = m ? m() : "";
|
|
1253
1251
|
e(
|
|
1254
1252
|
"Failed " + d + " type: " + u.message + (y ?? "")
|
|
1255
1253
|
);
|
|
@@ -1257,17 +1255,17 @@ function dn() {
|
|
|
1257
1255
|
}
|
|
1258
1256
|
}
|
|
1259
1257
|
}
|
|
1260
|
-
return
|
|
1258
|
+
return i.resetWarningCache = function() {
|
|
1261
1259
|
process.env.NODE_ENV !== "production" && (t = {});
|
|
1262
|
-
}, _e =
|
|
1260
|
+
}, _e = i, _e;
|
|
1263
1261
|
}
|
|
1264
1262
|
var Me, Ke;
|
|
1265
1263
|
function un() {
|
|
1266
1264
|
if (Ke) return Me;
|
|
1267
1265
|
Ke = 1;
|
|
1268
|
-
var e = yt(), n =
|
|
1266
|
+
var e = yt(), n = ln(), t = /* @__PURE__ */ Oe(), r = /* @__PURE__ */ bt(), i = /* @__PURE__ */ dn(), o = function() {
|
|
1269
1267
|
};
|
|
1270
|
-
process.env.NODE_ENV !== "production" && (
|
|
1268
|
+
process.env.NODE_ENV !== "production" && (o = function(d) {
|
|
1271
1269
|
var b = "Warning: " + d;
|
|
1272
1270
|
typeof console < "u" && console.error(b);
|
|
1273
1271
|
try {
|
|
@@ -1279,9 +1277,9 @@ function un() {
|
|
|
1279
1277
|
return null;
|
|
1280
1278
|
}
|
|
1281
1279
|
return Me = function(d, b) {
|
|
1282
|
-
var
|
|
1280
|
+
var m = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
|
|
1283
1281
|
function u(x) {
|
|
1284
|
-
var P = x && (
|
|
1282
|
+
var P = x && (m && x[m] || x[h]);
|
|
1285
1283
|
if (typeof P == "function")
|
|
1286
1284
|
return P;
|
|
1287
1285
|
}
|
|
@@ -1294,25 +1292,25 @@ function un() {
|
|
|
1294
1292
|
object: w("object"),
|
|
1295
1293
|
string: w("string"),
|
|
1296
1294
|
symbol: w("symbol"),
|
|
1297
|
-
any:
|
|
1295
|
+
any: T(),
|
|
1298
1296
|
arrayOf: C,
|
|
1299
1297
|
element: S(),
|
|
1300
|
-
elementType:
|
|
1301
|
-
instanceOf:
|
|
1298
|
+
elementType: l(),
|
|
1299
|
+
instanceOf: N,
|
|
1302
1300
|
node: $(),
|
|
1303
1301
|
objectOf: f,
|
|
1304
|
-
oneOf:
|
|
1302
|
+
oneOf: c,
|
|
1305
1303
|
oneOfType: M,
|
|
1306
|
-
shape:
|
|
1304
|
+
shape: E,
|
|
1307
1305
|
exact: z
|
|
1308
1306
|
};
|
|
1309
1307
|
function D(x, P) {
|
|
1310
1308
|
return x === P ? x !== 0 || 1 / x === 1 / P : x !== x && P !== P;
|
|
1311
1309
|
}
|
|
1312
|
-
function
|
|
1310
|
+
function g(x, P) {
|
|
1313
1311
|
this.message = x, this.data = P && typeof P == "object" ? P : {}, this.stack = "";
|
|
1314
1312
|
}
|
|
1315
|
-
|
|
1313
|
+
g.prototype = Error.prototype;
|
|
1316
1314
|
function v(x) {
|
|
1317
1315
|
if (process.env.NODE_ENV !== "production")
|
|
1318
1316
|
var P = {}, A = 0;
|
|
@@ -1326,12 +1324,12 @@ function un() {
|
|
|
1326
1324
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
1327
1325
|
var te = L + ":" + j;
|
|
1328
1326
|
!P[te] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
1329
|
-
A < 3 && (
|
|
1327
|
+
A < 3 && (o(
|
|
1330
1328
|
"You are manually calling a React.PropTypes validation function for the `" + V + "` prop on `" + L + "`. 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."
|
|
1331
1329
|
), P[te] = !0, A++);
|
|
1332
1330
|
}
|
|
1333
1331
|
}
|
|
1334
|
-
return R[j] == null ? F ? R[j] === null ? new
|
|
1332
|
+
return R[j] == null ? F ? R[j] === null ? new g("The " + Y + " `" + V + "` is marked as required " + ("in `" + L + "`, but its value is `null`.")) : new g("The " + Y + " `" + V + "` is marked as required in " + ("`" + L + "`, but its value is `undefined`.")) : null : x(R, j, L, Y, V);
|
|
1335
1333
|
}
|
|
1336
1334
|
var O = k.bind(null, !1);
|
|
1337
1335
|
return O.isRequired = k.bind(null, !0), O;
|
|
@@ -1341,7 +1339,7 @@ function un() {
|
|
|
1341
1339
|
var L = A[k], Y = K(L);
|
|
1342
1340
|
if (Y !== x) {
|
|
1343
1341
|
var V = ee(L);
|
|
1344
|
-
return new
|
|
1342
|
+
return new g(
|
|
1345
1343
|
"Invalid " + F + " `" + R + "` of type " + ("`" + V + "` supplied to `" + O + "`, expected ") + ("`" + x + "`."),
|
|
1346
1344
|
{ expectedType: x }
|
|
1347
1345
|
);
|
|
@@ -1350,17 +1348,17 @@ function un() {
|
|
|
1350
1348
|
}
|
|
1351
1349
|
return v(P);
|
|
1352
1350
|
}
|
|
1353
|
-
function
|
|
1351
|
+
function T() {
|
|
1354
1352
|
return v(a);
|
|
1355
1353
|
}
|
|
1356
1354
|
function C(x) {
|
|
1357
1355
|
function P(A, k, O, F, R) {
|
|
1358
1356
|
if (typeof x != "function")
|
|
1359
|
-
return new
|
|
1357
|
+
return new g("Property `" + R + "` of component `" + O + "` has invalid PropType notation inside arrayOf.");
|
|
1360
1358
|
var j = A[k];
|
|
1361
1359
|
if (!Array.isArray(j)) {
|
|
1362
1360
|
var L = K(j);
|
|
1363
|
-
return new
|
|
1361
|
+
return new g("Invalid " + F + " `" + R + "` of type " + ("`" + L + "` supplied to `" + O + "`, expected an array."));
|
|
1364
1362
|
}
|
|
1365
1363
|
for (var Y = 0; Y < j.length; Y++) {
|
|
1366
1364
|
var V = x(j, Y, O, F, R + "[" + Y + "]", t);
|
|
@@ -1376,38 +1374,38 @@ function un() {
|
|
|
1376
1374
|
var R = P[A];
|
|
1377
1375
|
if (!d(R)) {
|
|
1378
1376
|
var j = K(R);
|
|
1379
|
-
return new
|
|
1377
|
+
return new g("Invalid " + O + " `" + F + "` of type " + ("`" + j + "` supplied to `" + k + "`, expected a single ReactElement."));
|
|
1380
1378
|
}
|
|
1381
1379
|
return null;
|
|
1382
1380
|
}
|
|
1383
1381
|
return v(x);
|
|
1384
1382
|
}
|
|
1385
|
-
function
|
|
1383
|
+
function l() {
|
|
1386
1384
|
function x(P, A, k, O, F) {
|
|
1387
1385
|
var R = P[A];
|
|
1388
1386
|
if (!e.isValidElementType(R)) {
|
|
1389
1387
|
var j = K(R);
|
|
1390
|
-
return new
|
|
1388
|
+
return new g("Invalid " + O + " `" + F + "` of type " + ("`" + j + "` supplied to `" + k + "`, expected a single ReactElement type."));
|
|
1391
1389
|
}
|
|
1392
1390
|
return null;
|
|
1393
1391
|
}
|
|
1394
1392
|
return v(x);
|
|
1395
1393
|
}
|
|
1396
|
-
function
|
|
1394
|
+
function N(x) {
|
|
1397
1395
|
function P(A, k, O, F, R) {
|
|
1398
1396
|
if (!(A[k] instanceof x)) {
|
|
1399
1397
|
var j = x.name || p, L = de(A[k]);
|
|
1400
|
-
return new
|
|
1398
|
+
return new g("Invalid " + F + " `" + R + "` of type " + ("`" + L + "` supplied to `" + O + "`, expected ") + ("instance of `" + j + "`."));
|
|
1401
1399
|
}
|
|
1402
1400
|
return null;
|
|
1403
1401
|
}
|
|
1404
1402
|
return v(P);
|
|
1405
1403
|
}
|
|
1406
|
-
function
|
|
1404
|
+
function c(x) {
|
|
1407
1405
|
if (!Array.isArray(x))
|
|
1408
|
-
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ?
|
|
1406
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? o(
|
|
1409
1407
|
"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])."
|
|
1410
|
-
) :
|
|
1408
|
+
) : o("Invalid argument supplied to oneOf, expected an array.")), a;
|
|
1411
1409
|
function P(A, k, O, F, R) {
|
|
1412
1410
|
for (var j = A[k], L = 0; L < x.length; L++)
|
|
1413
1411
|
if (D(j, x[L]))
|
|
@@ -1416,17 +1414,17 @@ function un() {
|
|
|
1416
1414
|
var te = ee(_);
|
|
1417
1415
|
return te === "symbol" ? String(_) : _;
|
|
1418
1416
|
});
|
|
1419
|
-
return new
|
|
1417
|
+
return new g("Invalid " + F + " `" + R + "` of value `" + String(j) + "` " + ("supplied to `" + O + "`, expected one of " + Y + "."));
|
|
1420
1418
|
}
|
|
1421
1419
|
return v(P);
|
|
1422
1420
|
}
|
|
1423
1421
|
function f(x) {
|
|
1424
1422
|
function P(A, k, O, F, R) {
|
|
1425
1423
|
if (typeof x != "function")
|
|
1426
|
-
return new
|
|
1424
|
+
return new g("Property `" + R + "` of component `" + O + "` has invalid PropType notation inside objectOf.");
|
|
1427
1425
|
var j = A[k], L = K(j);
|
|
1428
1426
|
if (L !== "object")
|
|
1429
|
-
return new
|
|
1427
|
+
return new g("Invalid " + F + " `" + R + "` of type " + ("`" + L + "` supplied to `" + O + "`, expected an object."));
|
|
1430
1428
|
for (var Y in j)
|
|
1431
1429
|
if (r(j, Y)) {
|
|
1432
1430
|
var V = x(j, Y, O, F, R + "." + Y, t);
|
|
@@ -1439,11 +1437,11 @@ function un() {
|
|
|
1439
1437
|
}
|
|
1440
1438
|
function M(x) {
|
|
1441
1439
|
if (!Array.isArray(x))
|
|
1442
|
-
return process.env.NODE_ENV !== "production" &&
|
|
1440
|
+
return process.env.NODE_ENV !== "production" && o("Invalid argument supplied to oneOfType, expected an instance of array."), a;
|
|
1443
1441
|
for (var P = 0; P < x.length; P++) {
|
|
1444
1442
|
var A = x[P];
|
|
1445
1443
|
if (typeof A != "function")
|
|
1446
|
-
return
|
|
1444
|
+
return o(
|
|
1447
1445
|
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + se(A) + " at index " + P + "."
|
|
1448
1446
|
), a;
|
|
1449
1447
|
}
|
|
@@ -1455,26 +1453,26 @@ function un() {
|
|
|
1455
1453
|
_.data && r(_.data, "expectedType") && Y.push(_.data.expectedType);
|
|
1456
1454
|
}
|
|
1457
1455
|
var te = Y.length > 0 ? ", expected one of type [" + Y.join(", ") + "]" : "";
|
|
1458
|
-
return new
|
|
1456
|
+
return new g("Invalid " + j + " `" + L + "` supplied to " + ("`" + R + "`" + te + "."));
|
|
1459
1457
|
}
|
|
1460
1458
|
return v(k);
|
|
1461
1459
|
}
|
|
1462
1460
|
function $() {
|
|
1463
1461
|
function x(P, A, k, O, F) {
|
|
1464
|
-
return X(P[A]) ? null : new
|
|
1462
|
+
return X(P[A]) ? null : new g("Invalid " + O + " `" + F + "` supplied to " + ("`" + k + "`, expected a ReactNode."));
|
|
1465
1463
|
}
|
|
1466
1464
|
return v(x);
|
|
1467
1465
|
}
|
|
1468
1466
|
function I(x, P, A, k, O) {
|
|
1469
|
-
return new
|
|
1467
|
+
return new g(
|
|
1470
1468
|
(x || "React class") + ": " + P + " type `" + A + "." + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + O + "`."
|
|
1471
1469
|
);
|
|
1472
1470
|
}
|
|
1473
|
-
function
|
|
1471
|
+
function E(x) {
|
|
1474
1472
|
function P(A, k, O, F, R) {
|
|
1475
1473
|
var j = A[k], L = K(j);
|
|
1476
1474
|
if (L !== "object")
|
|
1477
|
-
return new
|
|
1475
|
+
return new g("Invalid " + F + " `" + R + "` of type `" + L + "` " + ("supplied to `" + O + "`, expected `object`."));
|
|
1478
1476
|
for (var Y in x) {
|
|
1479
1477
|
var V = x[Y];
|
|
1480
1478
|
if (typeof V != "function")
|
|
@@ -1491,14 +1489,14 @@ function un() {
|
|
|
1491
1489
|
function P(A, k, O, F, R) {
|
|
1492
1490
|
var j = A[k], L = K(j);
|
|
1493
1491
|
if (L !== "object")
|
|
1494
|
-
return new
|
|
1492
|
+
return new g("Invalid " + F + " `" + R + "` of type `" + L + "` " + ("supplied to `" + O + "`, expected `object`."));
|
|
1495
1493
|
var Y = n({}, A[k], x);
|
|
1496
1494
|
for (var V in Y) {
|
|
1497
1495
|
var Z = x[V];
|
|
1498
1496
|
if (r(x, V) && typeof Z != "function")
|
|
1499
1497
|
return I(O, F, R, V, ee(Z));
|
|
1500
1498
|
if (!Z)
|
|
1501
|
-
return new
|
|
1499
|
+
return new g(
|
|
1502
1500
|
"Invalid " + F + " `" + R + "` key `" + V + "` supplied to `" + O + "`.\nBad object: " + JSON.stringify(A[k], null, " ") + `
|
|
1503
1501
|
Valid keys: ` + JSON.stringify(Object.keys(x), null, " ")
|
|
1504
1502
|
);
|
|
@@ -1579,7 +1577,7 @@ Valid keys: ` + JSON.stringify(Object.keys(x), null, " ")
|
|
|
1579
1577
|
function de(x) {
|
|
1580
1578
|
return !x.constructor || !x.constructor.name ? p : x.constructor.name;
|
|
1581
1579
|
}
|
|
1582
|
-
return y.checkPropTypes =
|
|
1580
|
+
return y.checkPropTypes = i, y.resetWarningCache = i.resetWarningCache, y.PropTypes = y, y;
|
|
1583
1581
|
}, Me;
|
|
1584
1582
|
}
|
|
1585
1583
|
var Pe, Xe;
|
|
@@ -1592,7 +1590,7 @@ function fn() {
|
|
|
1592
1590
|
function t() {
|
|
1593
1591
|
}
|
|
1594
1592
|
return t.resetWarningCache = n, Pe = function() {
|
|
1595
|
-
function r(a, d, b,
|
|
1593
|
+
function r(a, d, b, m, h, u) {
|
|
1596
1594
|
if (u !== e) {
|
|
1597
1595
|
var p = new Error(
|
|
1598
1596
|
"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"
|
|
@@ -1601,10 +1599,10 @@ function fn() {
|
|
|
1601
1599
|
}
|
|
1602
1600
|
}
|
|
1603
1601
|
r.isRequired = r;
|
|
1604
|
-
function
|
|
1602
|
+
function i() {
|
|
1605
1603
|
return r;
|
|
1606
1604
|
}
|
|
1607
|
-
var
|
|
1605
|
+
var o = {
|
|
1608
1606
|
array: r,
|
|
1609
1607
|
bigint: r,
|
|
1610
1608
|
bool: r,
|
|
@@ -1614,20 +1612,20 @@ function fn() {
|
|
|
1614
1612
|
string: r,
|
|
1615
1613
|
symbol: r,
|
|
1616
1614
|
any: r,
|
|
1617
|
-
arrayOf:
|
|
1615
|
+
arrayOf: i,
|
|
1618
1616
|
element: r,
|
|
1619
1617
|
elementType: r,
|
|
1620
|
-
instanceOf:
|
|
1618
|
+
instanceOf: i,
|
|
1621
1619
|
node: r,
|
|
1622
|
-
objectOf:
|
|
1623
|
-
oneOf:
|
|
1624
|
-
oneOfType:
|
|
1625
|
-
shape:
|
|
1626
|
-
exact:
|
|
1620
|
+
objectOf: i,
|
|
1621
|
+
oneOf: i,
|
|
1622
|
+
oneOfType: i,
|
|
1623
|
+
shape: i,
|
|
1624
|
+
exact: i,
|
|
1627
1625
|
checkPropTypes: t,
|
|
1628
1626
|
resetWarningCache: n
|
|
1629
1627
|
};
|
|
1630
|
-
return
|
|
1628
|
+
return o.PropTypes = o, o;
|
|
1631
1629
|
}, Pe;
|
|
1632
1630
|
}
|
|
1633
1631
|
var Ge;
|
|
@@ -1645,213 +1643,213 @@ function hn() {
|
|
|
1645
1643
|
if (Ze) return be.exports;
|
|
1646
1644
|
Ze = 1;
|
|
1647
1645
|
function e(t) {
|
|
1648
|
-
var r,
|
|
1649
|
-
if (typeof t == "string" || typeof t == "number")
|
|
1646
|
+
var r, i, o = "";
|
|
1647
|
+
if (typeof t == "string" || typeof t == "number") o += t;
|
|
1650
1648
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
1651
1649
|
var a = t.length;
|
|
1652
|
-
for (r = 0; r < a; r++) t[r] && (
|
|
1653
|
-
} else for (
|
|
1654
|
-
return
|
|
1650
|
+
for (r = 0; r < a; r++) t[r] && (i = e(t[r])) && (o && (o += " "), o += i);
|
|
1651
|
+
} else for (i in t) t[i] && (o && (o += " "), o += i);
|
|
1652
|
+
return o;
|
|
1655
1653
|
}
|
|
1656
1654
|
function n() {
|
|
1657
|
-
for (var t, r,
|
|
1658
|
-
return
|
|
1655
|
+
for (var t, r, i = 0, o = "", a = arguments.length; i < a; i++) (t = arguments[i]) && (r = e(t)) && (o && (o += " "), o += r);
|
|
1656
|
+
return o;
|
|
1659
1657
|
}
|
|
1660
1658
|
return be.exports = n, be.exports.clsx = n, be.exports;
|
|
1661
1659
|
}
|
|
1662
|
-
var B = {},
|
|
1660
|
+
var B = {}, oe = {}, Je;
|
|
1663
1661
|
function we() {
|
|
1664
|
-
if (Je) return
|
|
1665
|
-
Je = 1, Object.defineProperty(
|
|
1662
|
+
if (Je) return oe;
|
|
1663
|
+
Je = 1, Object.defineProperty(oe, "__esModule", {
|
|
1666
1664
|
value: !0
|
|
1667
|
-
}),
|
|
1668
|
-
function e(
|
|
1669
|
-
for (let d = 0, b =
|
|
1670
|
-
if (a.apply(a, [
|
|
1665
|
+
}), oe.dontSetMe = i, oe.findInArray = e, oe.int = r, oe.isFunction = n, oe.isNum = t;
|
|
1666
|
+
function e(o, a) {
|
|
1667
|
+
for (let d = 0, b = o.length; d < b; d++)
|
|
1668
|
+
if (a.apply(a, [o[d], d, o])) return o[d];
|
|
1671
1669
|
}
|
|
1672
|
-
function n(
|
|
1673
|
-
return typeof
|
|
1670
|
+
function n(o) {
|
|
1671
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Function]";
|
|
1674
1672
|
}
|
|
1675
|
-
function t(
|
|
1676
|
-
return typeof
|
|
1673
|
+
function t(o) {
|
|
1674
|
+
return typeof o == "number" && !isNaN(o);
|
|
1677
1675
|
}
|
|
1678
|
-
function r(
|
|
1679
|
-
return parseInt(
|
|
1676
|
+
function r(o) {
|
|
1677
|
+
return parseInt(o, 10);
|
|
1680
1678
|
}
|
|
1681
|
-
function o
|
|
1682
|
-
if (
|
|
1679
|
+
function i(o, a, d) {
|
|
1680
|
+
if (o[a])
|
|
1683
1681
|
return new Error(`Invalid prop ${a} passed to ${d} - do not set this, set it on the child.`);
|
|
1684
1682
|
}
|
|
1685
|
-
return
|
|
1683
|
+
return oe;
|
|
1686
1684
|
}
|
|
1687
|
-
var
|
|
1685
|
+
var ie = {}, Qe;
|
|
1688
1686
|
function gn() {
|
|
1689
|
-
if (Qe) return
|
|
1690
|
-
Qe = 1, Object.defineProperty(
|
|
1687
|
+
if (Qe) return ie;
|
|
1688
|
+
Qe = 1, Object.defineProperty(ie, "__esModule", {
|
|
1691
1689
|
value: !0
|
|
1692
|
-
}),
|
|
1690
|
+
}), ie.browserPrefixToKey = t, ie.browserPrefixToStyle = r, ie.default = void 0, ie.getPrefix = n;
|
|
1693
1691
|
const e = ["Moz", "Webkit", "O", "ms"];
|
|
1694
1692
|
function n() {
|
|
1695
|
-
let
|
|
1693
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
|
|
1696
1694
|
if (typeof window > "u") return "";
|
|
1697
1695
|
const a = window.document?.documentElement?.style;
|
|
1698
|
-
if (!a ||
|
|
1696
|
+
if (!a || o in a) return "";
|
|
1699
1697
|
for (let d = 0; d < e.length; d++)
|
|
1700
|
-
if (t(
|
|
1698
|
+
if (t(o, e[d]) in a) return e[d];
|
|
1701
1699
|
return "";
|
|
1702
1700
|
}
|
|
1703
|
-
function t(
|
|
1704
|
-
return a ? `${a}${o
|
|
1701
|
+
function t(o, a) {
|
|
1702
|
+
return a ? `${a}${i(o)}` : o;
|
|
1705
1703
|
}
|
|
1706
|
-
function r(
|
|
1707
|
-
return a ? `-${a.toLowerCase()}-${
|
|
1704
|
+
function r(o, a) {
|
|
1705
|
+
return a ? `-${a.toLowerCase()}-${o}` : o;
|
|
1708
1706
|
}
|
|
1709
|
-
function o
|
|
1707
|
+
function i(o) {
|
|
1710
1708
|
let a = "", d = !0;
|
|
1711
|
-
for (let b = 0; b <
|
|
1712
|
-
d ? (a +=
|
|
1709
|
+
for (let b = 0; b < o.length; b++)
|
|
1710
|
+
d ? (a += o[b].toUpperCase(), d = !1) : o[b] === "-" ? d = !0 : a += o[b];
|
|
1713
1711
|
return a;
|
|
1714
1712
|
}
|
|
1715
|
-
return
|
|
1713
|
+
return ie.default = n(), ie;
|
|
1716
1714
|
}
|
|
1717
1715
|
var et;
|
|
1718
1716
|
function Re() {
|
|
1719
1717
|
if (et) return B;
|
|
1720
1718
|
et = 1, Object.defineProperty(B, "__esModule", {
|
|
1721
1719
|
value: !0
|
|
1722
|
-
}), B.addClassName =
|
|
1720
|
+
}), B.addClassName = l, B.addEvent = a, B.addUserSelectStyles = T, B.createCSSTransform = y, B.createSVGTransform = D, B.getTouch = v, B.getTouchIdentifier = w, B.getTranslation = g, B.innerHeight = h, B.innerWidth = u, B.matchesSelector = i, B.matchesSelectorAndParentsTo = o, B.offsetXYFromParent = p, B.outerHeight = b, B.outerWidth = m, B.removeClassName = N, B.removeEvent = d, B.scheduleRemoveUserSelectStyles = C;
|
|
1723
1721
|
var e = we(), n = t(gn());
|
|
1724
|
-
function t(
|
|
1722
|
+
function t(c, f) {
|
|
1725
1723
|
if (typeof WeakMap == "function") var M = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap();
|
|
1726
|
-
return (t = function(I,
|
|
1727
|
-
if (!
|
|
1724
|
+
return (t = function(I, E) {
|
|
1725
|
+
if (!E && I && I.__esModule) return I;
|
|
1728
1726
|
var z, X, Q = { __proto__: null, default: I };
|
|
1729
1727
|
if (I === null || typeof I != "object" && typeof I != "function") return Q;
|
|
1730
|
-
if (z =
|
|
1728
|
+
if (z = E ? $ : M) {
|
|
1731
1729
|
if (z.has(I)) return z.get(I);
|
|
1732
1730
|
z.set(I, Q);
|
|
1733
1731
|
}
|
|
1734
1732
|
for (const K in I) K !== "default" && {}.hasOwnProperty.call(I, K) && ((X = (z = Object.defineProperty) && Object.getOwnPropertyDescriptor(I, K)) && (X.get || X.set) ? z(Q, K, X) : Q[K] = I[K]);
|
|
1735
1733
|
return Q;
|
|
1736
|
-
})(
|
|
1734
|
+
})(c, f);
|
|
1737
1735
|
}
|
|
1738
1736
|
let r = "";
|
|
1739
|
-
function
|
|
1737
|
+
function i(c, f) {
|
|
1740
1738
|
return r || (r = (0, e.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(M) {
|
|
1741
|
-
return (0, e.isFunction)(
|
|
1742
|
-
})), (0, e.isFunction)(
|
|
1739
|
+
return (0, e.isFunction)(c[M]);
|
|
1740
|
+
})), (0, e.isFunction)(c[r]) ? c[r](f) : !1;
|
|
1743
1741
|
}
|
|
1744
|
-
function
|
|
1745
|
-
let $ =
|
|
1742
|
+
function o(c, f, M) {
|
|
1743
|
+
let $ = c;
|
|
1746
1744
|
do {
|
|
1747
|
-
if (
|
|
1745
|
+
if (i($, f)) return !0;
|
|
1748
1746
|
if ($ === M) return !1;
|
|
1749
1747
|
$ = $.parentNode;
|
|
1750
1748
|
} while ($);
|
|
1751
1749
|
return !1;
|
|
1752
1750
|
}
|
|
1753
|
-
function a(
|
|
1754
|
-
if (!
|
|
1751
|
+
function a(c, f, M, $) {
|
|
1752
|
+
if (!c) return;
|
|
1755
1753
|
const I = {
|
|
1756
1754
|
capture: !0,
|
|
1757
1755
|
...$
|
|
1758
1756
|
};
|
|
1759
|
-
|
|
1757
|
+
c.addEventListener ? c.addEventListener(f, M, I) : c.attachEvent ? c.attachEvent("on" + f, M) : c["on" + f] = M;
|
|
1760
1758
|
}
|
|
1761
|
-
function d(
|
|
1762
|
-
if (!
|
|
1759
|
+
function d(c, f, M, $) {
|
|
1760
|
+
if (!c) return;
|
|
1763
1761
|
const I = {
|
|
1764
1762
|
capture: !0,
|
|
1765
1763
|
...$
|
|
1766
1764
|
};
|
|
1767
|
-
|
|
1765
|
+
c.removeEventListener ? c.removeEventListener(f, M, I) : c.detachEvent ? c.detachEvent("on" + f, M) : c["on" + f] = null;
|
|
1768
1766
|
}
|
|
1769
|
-
function b(
|
|
1770
|
-
let f =
|
|
1771
|
-
const M =
|
|
1767
|
+
function b(c) {
|
|
1768
|
+
let f = c.clientHeight;
|
|
1769
|
+
const M = c.ownerDocument.defaultView.getComputedStyle(c);
|
|
1772
1770
|
return f += (0, e.int)(M.borderTopWidth), f += (0, e.int)(M.borderBottomWidth), f;
|
|
1773
1771
|
}
|
|
1774
|
-
function
|
|
1775
|
-
let f =
|
|
1776
|
-
const M =
|
|
1772
|
+
function m(c) {
|
|
1773
|
+
let f = c.clientWidth;
|
|
1774
|
+
const M = c.ownerDocument.defaultView.getComputedStyle(c);
|
|
1777
1775
|
return f += (0, e.int)(M.borderLeftWidth), f += (0, e.int)(M.borderRightWidth), f;
|
|
1778
1776
|
}
|
|
1779
|
-
function h(
|
|
1780
|
-
let f =
|
|
1781
|
-
const M =
|
|
1777
|
+
function h(c) {
|
|
1778
|
+
let f = c.clientHeight;
|
|
1779
|
+
const M = c.ownerDocument.defaultView.getComputedStyle(c);
|
|
1782
1780
|
return f -= (0, e.int)(M.paddingTop), f -= (0, e.int)(M.paddingBottom), f;
|
|
1783
1781
|
}
|
|
1784
|
-
function u(
|
|
1785
|
-
let f =
|
|
1786
|
-
const M =
|
|
1782
|
+
function u(c) {
|
|
1783
|
+
let f = c.clientWidth;
|
|
1784
|
+
const M = c.ownerDocument.defaultView.getComputedStyle(c);
|
|
1787
1785
|
return f -= (0, e.int)(M.paddingLeft), f -= (0, e.int)(M.paddingRight), f;
|
|
1788
1786
|
}
|
|
1789
|
-
function p(
|
|
1787
|
+
function p(c, f, M) {
|
|
1790
1788
|
const I = f === f.ownerDocument.body ? {
|
|
1791
1789
|
left: 0,
|
|
1792
1790
|
top: 0
|
|
1793
|
-
} : f.getBoundingClientRect(),
|
|
1791
|
+
} : f.getBoundingClientRect(), E = (c.clientX + f.scrollLeft - I.left) / M, z = (c.clientY + f.scrollTop - I.top) / M;
|
|
1794
1792
|
return {
|
|
1795
|
-
x:
|
|
1793
|
+
x: E,
|
|
1796
1794
|
y: z
|
|
1797
1795
|
};
|
|
1798
1796
|
}
|
|
1799
|
-
function y(
|
|
1800
|
-
const M =
|
|
1797
|
+
function y(c, f) {
|
|
1798
|
+
const M = g(c, f, "px");
|
|
1801
1799
|
return {
|
|
1802
1800
|
[(0, n.browserPrefixToKey)("transform", n.default)]: M
|
|
1803
1801
|
};
|
|
1804
1802
|
}
|
|
1805
|
-
function D(
|
|
1806
|
-
return
|
|
1803
|
+
function D(c, f) {
|
|
1804
|
+
return g(c, f, "");
|
|
1807
1805
|
}
|
|
1808
|
-
function
|
|
1806
|
+
function g(c, f, M) {
|
|
1809
1807
|
let {
|
|
1810
1808
|
x: $,
|
|
1811
1809
|
y: I
|
|
1812
|
-
} =
|
|
1810
|
+
} = c, E = `translate(${$}${M},${I}${M})`;
|
|
1813
1811
|
if (f) {
|
|
1814
1812
|
const z = `${typeof f.x == "string" ? f.x : f.x + M}`, X = `${typeof f.y == "string" ? f.y : f.y + M}`;
|
|
1815
|
-
|
|
1813
|
+
E = `translate(${z}, ${X})` + E;
|
|
1816
1814
|
}
|
|
1817
|
-
return
|
|
1815
|
+
return E;
|
|
1818
1816
|
}
|
|
1819
|
-
function v(
|
|
1820
|
-
return
|
|
1817
|
+
function v(c, f) {
|
|
1818
|
+
return c.targetTouches && (0, e.findInArray)(c.targetTouches, (M) => f === M.identifier) || c.changedTouches && (0, e.findInArray)(c.changedTouches, (M) => f === M.identifier);
|
|
1821
1819
|
}
|
|
1822
|
-
function w(
|
|
1823
|
-
if (
|
|
1824
|
-
if (
|
|
1820
|
+
function w(c) {
|
|
1821
|
+
if (c.targetTouches && c.targetTouches[0]) return c.targetTouches[0].identifier;
|
|
1822
|
+
if (c.changedTouches && c.changedTouches[0]) return c.changedTouches[0].identifier;
|
|
1825
1823
|
}
|
|
1826
|
-
function
|
|
1827
|
-
if (!
|
|
1828
|
-
let f =
|
|
1829
|
-
f || (f =
|
|
1824
|
+
function T(c) {
|
|
1825
|
+
if (!c) return;
|
|
1826
|
+
let f = c.getElementById("react-draggable-style-el");
|
|
1827
|
+
f || (f = c.createElement("style"), f.type = "text/css", f.id = "react-draggable-style-el", f.innerHTML = `.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
1830
1828
|
`, f.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
1831
|
-
`,
|
|
1829
|
+
`, c.getElementsByTagName("head")[0].appendChild(f)), c.body && l(c.body, "react-draggable-transparent-selection");
|
|
1832
1830
|
}
|
|
1833
|
-
function C(
|
|
1831
|
+
function C(c) {
|
|
1834
1832
|
window.requestAnimationFrame ? window.requestAnimationFrame(() => {
|
|
1835
|
-
S(
|
|
1836
|
-
}) : S(
|
|
1833
|
+
S(c);
|
|
1834
|
+
}) : S(c);
|
|
1837
1835
|
}
|
|
1838
|
-
function S(
|
|
1839
|
-
if (
|
|
1836
|
+
function S(c) {
|
|
1837
|
+
if (c)
|
|
1840
1838
|
try {
|
|
1841
|
-
if (
|
|
1842
|
-
|
|
1839
|
+
if (c.body && N(c.body, "react-draggable-transparent-selection"), c.selection)
|
|
1840
|
+
c.selection.empty();
|
|
1843
1841
|
else {
|
|
1844
|
-
const f = (
|
|
1842
|
+
const f = (c.defaultView || window).getSelection();
|
|
1845
1843
|
f && f.type !== "Caret" && f.removeAllRanges();
|
|
1846
1844
|
}
|
|
1847
1845
|
} catch {
|
|
1848
1846
|
}
|
|
1849
1847
|
}
|
|
1850
|
-
function c
|
|
1851
|
-
|
|
1848
|
+
function l(c, f) {
|
|
1849
|
+
c.classList ? c.classList.add(f) : c.className.match(new RegExp(`(?:^|\\s)${f}(?!\\S)`)) || (c.className += ` ${f}`);
|
|
1852
1850
|
}
|
|
1853
|
-
function
|
|
1854
|
-
|
|
1851
|
+
function N(c, f) {
|
|
1852
|
+
c.classList ? c.classList.remove(f) : c.className = c.className.replace(new RegExp(`(?:^|\\s)${f}(?!\\S)`, "g"), "");
|
|
1855
1853
|
}
|
|
1856
1854
|
return B;
|
|
1857
1855
|
}
|
|
@@ -1860,52 +1858,52 @@ function xt() {
|
|
|
1860
1858
|
if (tt) return ne;
|
|
1861
1859
|
tt = 1, Object.defineProperty(ne, "__esModule", {
|
|
1862
1860
|
value: !0
|
|
1863
|
-
}), ne.canDragX =
|
|
1861
|
+
}), ne.canDragX = i, ne.canDragY = o, ne.createCoreData = d, ne.createDraggableData = b, ne.getBoundPosition = t, ne.getControlPosition = a, ne.snapToGrid = r;
|
|
1864
1862
|
var e = we(), n = Re();
|
|
1865
1863
|
function t(u, p, y) {
|
|
1866
1864
|
if (!u.props.bounds) return [p, y];
|
|
1867
1865
|
let {
|
|
1868
1866
|
bounds: D
|
|
1869
1867
|
} = u.props;
|
|
1870
|
-
D = typeof D == "string" ? D :
|
|
1871
|
-
const
|
|
1868
|
+
D = typeof D == "string" ? D : m(D);
|
|
1869
|
+
const g = h(u);
|
|
1872
1870
|
if (typeof D == "string") {
|
|
1873
1871
|
const {
|
|
1874
1872
|
ownerDocument: v
|
|
1875
|
-
} =
|
|
1876
|
-
let
|
|
1877
|
-
if (D === "parent" ?
|
|
1873
|
+
} = g, w = v.defaultView;
|
|
1874
|
+
let T;
|
|
1875
|
+
if (D === "parent" ? T = g.parentNode : T = g.getRootNode().querySelector(D), !(T instanceof w.HTMLElement))
|
|
1878
1876
|
throw new Error('Bounds selector "' + D + '" could not find an element.');
|
|
1879
|
-
const C =
|
|
1877
|
+
const C = T, S = w.getComputedStyle(g), l = w.getComputedStyle(C);
|
|
1880
1878
|
D = {
|
|
1881
|
-
left: -
|
|
1882
|
-
top: -
|
|
1883
|
-
right: (0, n.innerWidth)(C) - (0, n.outerWidth)(
|
|
1884
|
-
bottom: (0, n.innerHeight)(C) - (0, n.outerHeight)(
|
|
1879
|
+
left: -g.offsetLeft + (0, e.int)(l.paddingLeft) + (0, e.int)(S.marginLeft),
|
|
1880
|
+
top: -g.offsetTop + (0, e.int)(l.paddingTop) + (0, e.int)(S.marginTop),
|
|
1881
|
+
right: (0, n.innerWidth)(C) - (0, n.outerWidth)(g) - g.offsetLeft + (0, e.int)(l.paddingRight) - (0, e.int)(S.marginRight),
|
|
1882
|
+
bottom: (0, n.innerHeight)(C) - (0, n.outerHeight)(g) - g.offsetTop + (0, e.int)(l.paddingBottom) - (0, e.int)(S.marginBottom)
|
|
1885
1883
|
};
|
|
1886
1884
|
}
|
|
1887
1885
|
return (0, e.isNum)(D.right) && (p = Math.min(p, D.right)), (0, e.isNum)(D.bottom) && (y = Math.min(y, D.bottom)), (0, e.isNum)(D.left) && (p = Math.max(p, D.left)), (0, e.isNum)(D.top) && (y = Math.max(y, D.top)), [p, y];
|
|
1888
1886
|
}
|
|
1889
1887
|
function r(u, p, y) {
|
|
1890
|
-
const D = Math.round(p / u[0]) * u[0],
|
|
1891
|
-
return [D,
|
|
1888
|
+
const D = Math.round(p / u[0]) * u[0], g = Math.round(y / u[1]) * u[1];
|
|
1889
|
+
return [D, g];
|
|
1892
1890
|
}
|
|
1893
|
-
function
|
|
1891
|
+
function i(u) {
|
|
1894
1892
|
return u.props.axis === "both" || u.props.axis === "x";
|
|
1895
1893
|
}
|
|
1896
|
-
function
|
|
1894
|
+
function o(u) {
|
|
1897
1895
|
return u.props.axis === "both" || u.props.axis === "y";
|
|
1898
1896
|
}
|
|
1899
1897
|
function a(u, p, y) {
|
|
1900
1898
|
const D = typeof p == "number" ? (0, n.getTouch)(u, p) : null;
|
|
1901
1899
|
if (typeof p == "number" && !D) return null;
|
|
1902
|
-
const
|
|
1900
|
+
const g = h(y), v = y.props.offsetParent || g.offsetParent || g.ownerDocument.body;
|
|
1903
1901
|
return (0, n.offsetXYFromParent)(D || u, v, y.props.scale);
|
|
1904
1902
|
}
|
|
1905
1903
|
function d(u, p, y) {
|
|
1906
|
-
const D = !(0, e.isNum)(u.lastX),
|
|
1904
|
+
const D = !(0, e.isNum)(u.lastX), g = h(u);
|
|
1907
1905
|
return D ? {
|
|
1908
|
-
node:
|
|
1906
|
+
node: g,
|
|
1909
1907
|
deltaX: 0,
|
|
1910
1908
|
deltaY: 0,
|
|
1911
1909
|
lastX: p,
|
|
@@ -1913,7 +1911,7 @@ function xt() {
|
|
|
1913
1911
|
x: p,
|
|
1914
1912
|
y
|
|
1915
1913
|
} : {
|
|
1916
|
-
node:
|
|
1914
|
+
node: g,
|
|
1917
1915
|
deltaX: p - u.lastX,
|
|
1918
1916
|
deltaY: y - u.lastY,
|
|
1919
1917
|
lastX: u.lastX,
|
|
@@ -1934,7 +1932,7 @@ function xt() {
|
|
|
1934
1932
|
lastY: u.state.y
|
|
1935
1933
|
};
|
|
1936
1934
|
}
|
|
1937
|
-
function
|
|
1935
|
+
function m(u) {
|
|
1938
1936
|
return {
|
|
1939
1937
|
left: u.left,
|
|
1940
1938
|
top: u.top,
|
|
@@ -1966,40 +1964,40 @@ function mn() {
|
|
|
1966
1964
|
rt = 1, Object.defineProperty(he, "__esModule", {
|
|
1967
1965
|
value: !0
|
|
1968
1966
|
}), he.default = void 0;
|
|
1969
|
-
var e = b(ae), n = d(/* @__PURE__ */ vt()), t = d(
|
|
1970
|
-
function d(
|
|
1971
|
-
return
|
|
1967
|
+
var e = b(ae), n = d(/* @__PURE__ */ vt()), t = d(ct), r = Re(), i = xt(), o = we(), a = d(wt());
|
|
1968
|
+
function d(g) {
|
|
1969
|
+
return g && g.__esModule ? g : { default: g };
|
|
1972
1970
|
}
|
|
1973
|
-
function b(
|
|
1974
|
-
if (typeof WeakMap == "function") var w = /* @__PURE__ */ new WeakMap(),
|
|
1971
|
+
function b(g, v) {
|
|
1972
|
+
if (typeof WeakMap == "function") var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap();
|
|
1975
1973
|
return (b = function(C, S) {
|
|
1976
1974
|
if (!S && C && C.__esModule) return C;
|
|
1977
|
-
var
|
|
1978
|
-
if (C === null || typeof C != "object" && typeof C != "function") return
|
|
1979
|
-
if (
|
|
1980
|
-
if (
|
|
1981
|
-
|
|
1975
|
+
var l, N, c = { __proto__: null, default: C };
|
|
1976
|
+
if (C === null || typeof C != "object" && typeof C != "function") return c;
|
|
1977
|
+
if (l = S ? T : w) {
|
|
1978
|
+
if (l.has(C)) return l.get(C);
|
|
1979
|
+
l.set(C, c);
|
|
1982
1980
|
}
|
|
1983
|
-
for (const f in C) f !== "default" && {}.hasOwnProperty.call(C, f) && ((
|
|
1984
|
-
return
|
|
1985
|
-
})(
|
|
1981
|
+
for (const f in C) f !== "default" && {}.hasOwnProperty.call(C, f) && ((N = (l = Object.defineProperty) && Object.getOwnPropertyDescriptor(C, f)) && (N.get || N.set) ? l(c, f, N) : c[f] = C[f]);
|
|
1982
|
+
return c;
|
|
1983
|
+
})(g, v);
|
|
1986
1984
|
}
|
|
1987
|
-
function g
|
|
1988
|
-
return (v = h(v)) in
|
|
1985
|
+
function m(g, v, w) {
|
|
1986
|
+
return (v = h(v)) in g ? Object.defineProperty(g, v, { value: w, enumerable: !0, configurable: !0, writable: !0 }) : g[v] = w, g;
|
|
1989
1987
|
}
|
|
1990
|
-
function h(
|
|
1991
|
-
var v = u(
|
|
1988
|
+
function h(g) {
|
|
1989
|
+
var v = u(g, "string");
|
|
1992
1990
|
return typeof v == "symbol" ? v : v + "";
|
|
1993
1991
|
}
|
|
1994
|
-
function u(
|
|
1995
|
-
if (typeof
|
|
1996
|
-
var w =
|
|
1992
|
+
function u(g, v) {
|
|
1993
|
+
if (typeof g != "object" || !g) return g;
|
|
1994
|
+
var w = g[Symbol.toPrimitive];
|
|
1997
1995
|
if (w !== void 0) {
|
|
1998
|
-
var
|
|
1999
|
-
if (typeof
|
|
1996
|
+
var T = w.call(g, v);
|
|
1997
|
+
if (typeof T != "object") return T;
|
|
2000
1998
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2001
1999
|
}
|
|
2002
|
-
return (v === "string" ? String : Number)(
|
|
2000
|
+
return (v === "string" ? String : Number)(g);
|
|
2003
2001
|
}
|
|
2004
2002
|
const p = {
|
|
2005
2003
|
touch: {
|
|
@@ -2015,66 +2013,66 @@ function mn() {
|
|
|
2015
2013
|
};
|
|
2016
2014
|
let y = p.mouse, D = class extends e.Component {
|
|
2017
2015
|
constructor() {
|
|
2018
|
-
super(...arguments),
|
|
2016
|
+
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", (v) => {
|
|
2019
2017
|
if (this.props.onMouseDown(v), !this.props.allowAnyClick && typeof v.button == "number" && v.button !== 0) return !1;
|
|
2020
2018
|
const w = this.findDOMNode();
|
|
2021
2019
|
if (!w || !w.ownerDocument || !w.ownerDocument.body)
|
|
2022
2020
|
throw new Error("<DraggableCore> not mounted on DragStart!");
|
|
2023
2021
|
const {
|
|
2024
|
-
ownerDocument:
|
|
2022
|
+
ownerDocument: T
|
|
2025
2023
|
} = w;
|
|
2026
|
-
if (this.props.disabled || !(v.target instanceof
|
|
2024
|
+
if (this.props.disabled || !(v.target instanceof T.defaultView.Node) || this.props.handle && !(0, r.matchesSelectorAndParentsTo)(v.target, this.props.handle, w) || this.props.cancel && (0, r.matchesSelectorAndParentsTo)(v.target, this.props.cancel, w))
|
|
2027
2025
|
return;
|
|
2028
2026
|
v.type === "touchstart" && !this.props.allowMobileScroll && v.preventDefault();
|
|
2029
2027
|
const C = (0, r.getTouchIdentifier)(v);
|
|
2030
2028
|
this.touchIdentifier = C;
|
|
2031
|
-
const S = (0,
|
|
2029
|
+
const S = (0, i.getControlPosition)(v, C, this);
|
|
2032
2030
|
if (S == null) return;
|
|
2033
2031
|
const {
|
|
2034
|
-
x:
|
|
2035
|
-
y:
|
|
2036
|
-
} = S,
|
|
2037
|
-
(0, a.default)("DraggableCore: handleDragStart: %j",
|
|
2038
|
-
}),
|
|
2039
|
-
const w = (0,
|
|
2032
|
+
x: l,
|
|
2033
|
+
y: N
|
|
2034
|
+
} = S, c = (0, i.createCoreData)(this, l, N);
|
|
2035
|
+
(0, a.default)("DraggableCore: handleDragStart: %j", c), (0, a.default)("calling", this.props.onStart), !(this.props.onStart(v, c) === !1 || this.mounted === !1) && (this.props.enableUserSelectHack && (0, r.addUserSelectStyles)(T), this.dragging = !0, this.lastX = l, this.lastY = N, (0, r.addEvent)(T, y.move, this.handleDrag), (0, r.addEvent)(T, y.stop, this.handleDragStop));
|
|
2036
|
+
}), m(this, "handleDrag", (v) => {
|
|
2037
|
+
const w = (0, i.getControlPosition)(v, this.touchIdentifier, this);
|
|
2040
2038
|
if (w == null) return;
|
|
2041
2039
|
let {
|
|
2042
|
-
x:
|
|
2040
|
+
x: T,
|
|
2043
2041
|
y: C
|
|
2044
2042
|
} = w;
|
|
2045
2043
|
if (Array.isArray(this.props.grid)) {
|
|
2046
|
-
let
|
|
2047
|
-
if ([
|
|
2048
|
-
|
|
2044
|
+
let N = T - this.lastX, c = C - this.lastY;
|
|
2045
|
+
if ([N, c] = (0, i.snapToGrid)(this.props.grid, N, c), !N && !c) return;
|
|
2046
|
+
T = this.lastX + N, C = this.lastY + c;
|
|
2049
2047
|
}
|
|
2050
|
-
const S = (0,
|
|
2048
|
+
const S = (0, i.createCoreData)(this, T, C);
|
|
2051
2049
|
if ((0, a.default)("DraggableCore: handleDrag: %j", S), this.props.onDrag(v, S) === !1 || this.mounted === !1) {
|
|
2052
2050
|
try {
|
|
2053
2051
|
this.handleDragStop(new MouseEvent("mouseup"));
|
|
2054
2052
|
} catch {
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2053
|
+
const c = document.createEvent("MouseEvents");
|
|
2054
|
+
c.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(c);
|
|
2057
2055
|
}
|
|
2058
2056
|
return;
|
|
2059
2057
|
}
|
|
2060
|
-
this.lastX =
|
|
2061
|
-
}),
|
|
2058
|
+
this.lastX = T, this.lastY = C;
|
|
2059
|
+
}), m(this, "handleDragStop", (v) => {
|
|
2062
2060
|
if (!this.dragging) return;
|
|
2063
|
-
const w = (0,
|
|
2061
|
+
const w = (0, i.getControlPosition)(v, this.touchIdentifier, this);
|
|
2064
2062
|
if (w == null) return;
|
|
2065
2063
|
let {
|
|
2066
|
-
x:
|
|
2064
|
+
x: T,
|
|
2067
2065
|
y: C
|
|
2068
2066
|
} = w;
|
|
2069
2067
|
if (Array.isArray(this.props.grid)) {
|
|
2070
|
-
let
|
|
2071
|
-
[
|
|
2068
|
+
let c = T - this.lastX || 0, f = C - this.lastY || 0;
|
|
2069
|
+
[c, f] = (0, i.snapToGrid)(this.props.grid, c, f), T = this.lastX + c, C = this.lastY + f;
|
|
2072
2070
|
}
|
|
2073
|
-
const S = (0,
|
|
2071
|
+
const S = (0, i.createCoreData)(this, T, C);
|
|
2074
2072
|
if (this.props.onStop(v, S) === !1 || this.mounted === !1) return !1;
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2077
|
-
}),
|
|
2073
|
+
const N = this.findDOMNode();
|
|
2074
|
+
N && this.props.enableUserSelectHack && (0, r.scheduleRemoveUserSelectStyles)(N.ownerDocument), (0, a.default)("DraggableCore: handleDragStop: %j", S), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, N && ((0, a.default)("DraggableCore: Removing handlers"), (0, r.removeEvent)(N.ownerDocument, y.move, this.handleDrag), (0, r.removeEvent)(N.ownerDocument, y.stop, this.handleDragStop));
|
|
2075
|
+
}), m(this, "onMouseDown", (v) => (y = p.mouse, this.handleDragStart(v))), m(this, "onMouseUp", (v) => (y = p.mouse, this.handleDragStop(v))), m(this, "onTouchStart", (v) => (y = p.touch, this.handleDragStart(v))), m(this, "onTouchEnd", (v) => (y = p.touch, this.handleDragStop(v)));
|
|
2078
2076
|
}
|
|
2079
2077
|
componentDidMount() {
|
|
2080
2078
|
this.mounted = !0;
|
|
@@ -2113,7 +2111,7 @@ function mn() {
|
|
|
2113
2111
|
});
|
|
2114
2112
|
}
|
|
2115
2113
|
};
|
|
2116
|
-
return he.default = D,
|
|
2114
|
+
return he.default = D, m(D, "displayName", "DraggableCore"), m(D, "propTypes", {
|
|
2117
2115
|
/**
|
|
2118
2116
|
* `allowAnyClick` allows dragging using any mouse button.
|
|
2119
2117
|
* By default, we only accept the left button.
|
|
@@ -2145,8 +2143,8 @@ function mn() {
|
|
|
2145
2143
|
* `offsetParent`, if set, uses the passed DOM node to compute drag offsets
|
|
2146
2144
|
* instead of using the parent node.
|
|
2147
2145
|
*/
|
|
2148
|
-
offsetParent: function(
|
|
2149
|
-
if (
|
|
2146
|
+
offsetParent: function(g, v) {
|
|
2147
|
+
if (g[v] && g[v].nodeType !== 1)
|
|
2150
2148
|
throw new Error("Draggable's offsetParent must be a DOM Node.");
|
|
2151
2149
|
},
|
|
2152
2150
|
/**
|
|
@@ -2240,10 +2238,10 @@ function mn() {
|
|
|
2240
2238
|
/**
|
|
2241
2239
|
* These properties should be defined on the child, not here.
|
|
2242
2240
|
*/
|
|
2243
|
-
className:
|
|
2244
|
-
style:
|
|
2245
|
-
transform:
|
|
2246
|
-
}),
|
|
2241
|
+
className: o.dontSetMe,
|
|
2242
|
+
style: o.dontSetMe,
|
|
2243
|
+
transform: o.dontSetMe
|
|
2244
|
+
}), m(D, "defaultProps", {
|
|
2247
2245
|
allowAnyClick: !1,
|
|
2248
2246
|
// by default only accept left click
|
|
2249
2247
|
allowMobileScroll: !1,
|
|
@@ -2260,9 +2258,9 @@ function mn() {
|
|
|
2260
2258
|
scale: 1
|
|
2261
2259
|
}), he;
|
|
2262
2260
|
}
|
|
2263
|
-
var
|
|
2261
|
+
var ot;
|
|
2264
2262
|
function pn() {
|
|
2265
|
-
return
|
|
2263
|
+
return ot || (ot = 1, (function(e) {
|
|
2266
2264
|
Object.defineProperty(e, "__esModule", {
|
|
2267
2265
|
value: !0
|
|
2268
2266
|
}), Object.defineProperty(e, "DraggableCore", {
|
|
@@ -2271,62 +2269,62 @@ function pn() {
|
|
|
2271
2269
|
return b.default;
|
|
2272
2270
|
}
|
|
2273
2271
|
}), e.default = void 0;
|
|
2274
|
-
var n = u(ae), t = h(/* @__PURE__ */ vt()), r = h(
|
|
2272
|
+
var n = u(ae), t = h(/* @__PURE__ */ vt()), r = h(ct), i = hn(), o = Re(), a = xt(), d = we(), b = h(mn()), m = h(wt());
|
|
2275
2273
|
function h(w) {
|
|
2276
2274
|
return w && w.__esModule ? w : { default: w };
|
|
2277
2275
|
}
|
|
2278
|
-
function u(w,
|
|
2276
|
+
function u(w, T) {
|
|
2279
2277
|
if (typeof WeakMap == "function") var C = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap();
|
|
2280
|
-
return (u = function(
|
|
2281
|
-
if (!
|
|
2282
|
-
var
|
|
2283
|
-
if (
|
|
2284
|
-
if (
|
|
2285
|
-
if (
|
|
2286
|
-
|
|
2278
|
+
return (u = function(l, N) {
|
|
2279
|
+
if (!N && l && l.__esModule) return l;
|
|
2280
|
+
var c, f, M = { __proto__: null, default: l };
|
|
2281
|
+
if (l === null || typeof l != "object" && typeof l != "function") return M;
|
|
2282
|
+
if (c = N ? S : C) {
|
|
2283
|
+
if (c.has(l)) return c.get(l);
|
|
2284
|
+
c.set(l, M);
|
|
2287
2285
|
}
|
|
2288
|
-
for (const $ in
|
|
2286
|
+
for (const $ in l) $ !== "default" && {}.hasOwnProperty.call(l, $) && ((f = (c = Object.defineProperty) && Object.getOwnPropertyDescriptor(l, $)) && (f.get || f.set) ? c(M, $, f) : M[$] = l[$]);
|
|
2289
2287
|
return M;
|
|
2290
|
-
})(w,
|
|
2288
|
+
})(w, T);
|
|
2291
2289
|
}
|
|
2292
2290
|
function p() {
|
|
2293
2291
|
return p = Object.assign ? Object.assign.bind() : function(w) {
|
|
2294
|
-
for (var
|
|
2295
|
-
var C = arguments[
|
|
2292
|
+
for (var T = 1; T < arguments.length; T++) {
|
|
2293
|
+
var C = arguments[T];
|
|
2296
2294
|
for (var S in C) ({}).hasOwnProperty.call(C, S) && (w[S] = C[S]);
|
|
2297
2295
|
}
|
|
2298
2296
|
return w;
|
|
2299
2297
|
}, p.apply(null, arguments);
|
|
2300
2298
|
}
|
|
2301
|
-
function y(w,
|
|
2302
|
-
return (
|
|
2299
|
+
function y(w, T, C) {
|
|
2300
|
+
return (T = D(T)) in w ? Object.defineProperty(w, T, { value: C, enumerable: !0, configurable: !0, writable: !0 }) : w[T] = C, w;
|
|
2303
2301
|
}
|
|
2304
2302
|
function D(w) {
|
|
2305
|
-
var
|
|
2306
|
-
return typeof
|
|
2303
|
+
var T = g(w, "string");
|
|
2304
|
+
return typeof T == "symbol" ? T : T + "";
|
|
2307
2305
|
}
|
|
2308
|
-
function
|
|
2306
|
+
function g(w, T) {
|
|
2309
2307
|
if (typeof w != "object" || !w) return w;
|
|
2310
2308
|
var C = w[Symbol.toPrimitive];
|
|
2311
2309
|
if (C !== void 0) {
|
|
2312
|
-
var S = C.call(w,
|
|
2310
|
+
var S = C.call(w, T);
|
|
2313
2311
|
if (typeof S != "object") return S;
|
|
2314
2312
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2315
2313
|
}
|
|
2316
|
-
return (
|
|
2314
|
+
return (T === "string" ? String : Number)(w);
|
|
2317
2315
|
}
|
|
2318
2316
|
class v extends n.Component {
|
|
2319
2317
|
// React 16.3+
|
|
2320
2318
|
// Arity (props, state)
|
|
2321
|
-
static getDerivedStateFromProps(
|
|
2319
|
+
static getDerivedStateFromProps(T, C) {
|
|
2322
2320
|
let {
|
|
2323
2321
|
position: S
|
|
2324
|
-
} =
|
|
2325
|
-
prevPropsPosition:
|
|
2322
|
+
} = T, {
|
|
2323
|
+
prevPropsPosition: l
|
|
2326
2324
|
} = C;
|
|
2327
|
-
return S && (!
|
|
2325
|
+
return S && (!l || S.x !== l.x || S.y !== l.y) ? ((0, m.default)("Draggable: getDerivedStateFromProps %j", {
|
|
2328
2326
|
position: S,
|
|
2329
|
-
prevPropsPosition:
|
|
2327
|
+
prevPropsPosition: l
|
|
2330
2328
|
}), {
|
|
2331
2329
|
x: S.x,
|
|
2332
2330
|
y: S.y,
|
|
@@ -2335,19 +2333,19 @@ function pn() {
|
|
|
2335
2333
|
}
|
|
2336
2334
|
}) : null;
|
|
2337
2335
|
}
|
|
2338
|
-
constructor(
|
|
2339
|
-
super(
|
|
2340
|
-
if ((0,
|
|
2336
|
+
constructor(T) {
|
|
2337
|
+
super(T), y(this, "onDragStart", (C, S) => {
|
|
2338
|
+
if ((0, m.default)("Draggable: onDragStart: %j", S), this.props.onStart(C, (0, a.createDraggableData)(this, S)) === !1) return !1;
|
|
2341
2339
|
this.setState({
|
|
2342
2340
|
dragging: !0,
|
|
2343
2341
|
dragged: !0
|
|
2344
2342
|
});
|
|
2345
2343
|
}), y(this, "onDrag", (C, S) => {
|
|
2346
2344
|
if (!this.state.dragging) return !1;
|
|
2347
|
-
(0,
|
|
2348
|
-
const
|
|
2349
|
-
x:
|
|
2350
|
-
y:
|
|
2345
|
+
(0, m.default)("Draggable: onDrag: %j", S);
|
|
2346
|
+
const l = (0, a.createDraggableData)(this, S), N = {
|
|
2347
|
+
x: l.x,
|
|
2348
|
+
y: l.y,
|
|
2351
2349
|
slackX: 0,
|
|
2352
2350
|
slackY: 0
|
|
2353
2351
|
};
|
|
@@ -2355,17 +2353,17 @@ function pn() {
|
|
|
2355
2353
|
const {
|
|
2356
2354
|
x: f,
|
|
2357
2355
|
y: M
|
|
2358
|
-
} =
|
|
2359
|
-
|
|
2360
|
-
const [$, I] = (0, a.getBoundPosition)(this,
|
|
2361
|
-
|
|
2356
|
+
} = N;
|
|
2357
|
+
N.x += this.state.slackX, N.y += this.state.slackY;
|
|
2358
|
+
const [$, I] = (0, a.getBoundPosition)(this, N.x, N.y);
|
|
2359
|
+
N.x = $, N.y = I, N.slackX = this.state.slackX + (f - N.x), N.slackY = this.state.slackY + (M - N.y), l.x = N.x, l.y = N.y, l.deltaX = N.x - this.state.x, l.deltaY = N.y - this.state.y;
|
|
2362
2360
|
}
|
|
2363
|
-
if (this.props.onDrag(C,
|
|
2364
|
-
this.setState(
|
|
2361
|
+
if (this.props.onDrag(C, l) === !1) return !1;
|
|
2362
|
+
this.setState(N);
|
|
2365
2363
|
}), y(this, "onDragStop", (C, S) => {
|
|
2366
2364
|
if (!this.state.dragging || this.props.onStop(C, (0, a.createDraggableData)(this, S)) === !1) return !1;
|
|
2367
|
-
(0,
|
|
2368
|
-
const
|
|
2365
|
+
(0, m.default)("Draggable: onDragStop: %j", S);
|
|
2366
|
+
const N = {
|
|
2369
2367
|
dragging: !1,
|
|
2370
2368
|
slackX: 0,
|
|
2371
2369
|
slackY: 0
|
|
@@ -2375,26 +2373,26 @@ function pn() {
|
|
|
2375
2373
|
x: f,
|
|
2376
2374
|
y: M
|
|
2377
2375
|
} = this.props.position;
|
|
2378
|
-
|
|
2376
|
+
N.x = f, N.y = M;
|
|
2379
2377
|
}
|
|
2380
|
-
this.setState(
|
|
2378
|
+
this.setState(N);
|
|
2381
2379
|
}), this.state = {
|
|
2382
2380
|
// Whether or not we are currently dragging.
|
|
2383
2381
|
dragging: !1,
|
|
2384
2382
|
// Whether or not we have been dragged before.
|
|
2385
2383
|
dragged: !1,
|
|
2386
2384
|
// Current transform x and y.
|
|
2387
|
-
x:
|
|
2388
|
-
y:
|
|
2385
|
+
x: T.position ? T.position.x : T.defaultPosition.x,
|
|
2386
|
+
y: T.position ? T.position.y : T.defaultPosition.y,
|
|
2389
2387
|
prevPropsPosition: {
|
|
2390
|
-
...
|
|
2388
|
+
...T.position
|
|
2391
2389
|
},
|
|
2392
2390
|
// Used for compensating for out-of-bounds drags
|
|
2393
2391
|
slackX: 0,
|
|
2394
2392
|
slackY: 0,
|
|
2395
2393
|
// Can only determine if SVG after mounting
|
|
2396
2394
|
isElementSVG: !1
|
|
2397
|
-
},
|
|
2395
|
+
}, 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.");
|
|
2398
2396
|
}
|
|
2399
2397
|
componentDidMount() {
|
|
2400
2398
|
typeof window.SVGElement < "u" && this.findDOMNode() instanceof window.SVGElement && this.setState({
|
|
@@ -2413,31 +2411,31 @@ function pn() {
|
|
|
2413
2411
|
}
|
|
2414
2412
|
render() {
|
|
2415
2413
|
const {
|
|
2416
|
-
axis:
|
|
2414
|
+
axis: T,
|
|
2417
2415
|
bounds: C,
|
|
2418
2416
|
children: S,
|
|
2419
|
-
defaultPosition:
|
|
2420
|
-
defaultClassName:
|
|
2421
|
-
defaultClassNameDragging:
|
|
2417
|
+
defaultPosition: l,
|
|
2418
|
+
defaultClassName: N,
|
|
2419
|
+
defaultClassNameDragging: c,
|
|
2422
2420
|
defaultClassNameDragged: f,
|
|
2423
2421
|
position: M,
|
|
2424
2422
|
positionOffset: $,
|
|
2425
2423
|
scale: I,
|
|
2426
|
-
...
|
|
2424
|
+
...E
|
|
2427
2425
|
} = this.props;
|
|
2428
2426
|
let z = {}, X = null;
|
|
2429
|
-
const K = !!!M || this.state.dragging, ee = M ||
|
|
2427
|
+
const K = !!!M || this.state.dragging, ee = M || l, se = {
|
|
2430
2428
|
// Set left if horizontal drag is enabled
|
|
2431
2429
|
x: (0, a.canDragX)(this) && K ? this.state.x : ee.x,
|
|
2432
2430
|
// Set top if vertical drag is enabled
|
|
2433
2431
|
y: (0, a.canDragY)(this) && K ? this.state.y : ee.y
|
|
2434
2432
|
};
|
|
2435
|
-
this.state.isElementSVG ? X = (0,
|
|
2436
|
-
const de = (0,
|
|
2437
|
-
[
|
|
2433
|
+
this.state.isElementSVG ? X = (0, o.createSVGTransform)(se, $) : z = (0, o.createCSSTransform)(se, $);
|
|
2434
|
+
const de = (0, i.clsx)(S.props.className || "", N, {
|
|
2435
|
+
[c]: this.state.dragging,
|
|
2438
2436
|
[f]: this.state.dragged
|
|
2439
2437
|
});
|
|
2440
|
-
return /* @__PURE__ */ n.createElement(b.default, p({},
|
|
2438
|
+
return /* @__PURE__ */ n.createElement(b.default, p({}, E, {
|
|
2441
2439
|
onStart: this.onDragStart,
|
|
2442
2440
|
onDrag: this.onDrag,
|
|
2443
2441
|
onStop: this.onDragStop
|
|
@@ -2573,10 +2571,10 @@ function pn() {
|
|
|
2573
2571
|
});
|
|
2574
2572
|
})(De)), De;
|
|
2575
2573
|
}
|
|
2576
|
-
var
|
|
2574
|
+
var it;
|
|
2577
2575
|
function yn() {
|
|
2578
|
-
if (
|
|
2579
|
-
|
|
2576
|
+
if (it) return fe.exports;
|
|
2577
|
+
it = 1;
|
|
2580
2578
|
const {
|
|
2581
2579
|
default: e,
|
|
2582
2580
|
DraggableCore: n
|
|
@@ -2584,7 +2582,7 @@ function yn() {
|
|
|
2584
2582
|
return fe.exports = e, fe.exports.default = e, fe.exports.DraggableCore = n, fe.exports;
|
|
2585
2583
|
}
|
|
2586
2584
|
var bn = yn();
|
|
2587
|
-
const vn = /* @__PURE__ */ an(bn), xn =
|
|
2585
|
+
const vn = /* @__PURE__ */ an(bn), xn = le((e, n) => {
|
|
2588
2586
|
const r = {
|
|
2589
2587
|
...{
|
|
2590
2588
|
// 1. Take it out of the document flow
|
|
@@ -2602,25 +2600,25 @@ const vn = /* @__PURE__ */ an(bn), xn = ce((e, n) => {
|
|
|
2602
2600
|
boxShadow: "rgba(0, 0, 0, 0.5) 7px 7px 10px 0px"
|
|
2603
2601
|
},
|
|
2604
2602
|
...e.style || {}
|
|
2605
|
-
},
|
|
2603
|
+
}, i = e.testId || "not-set", o = e.className || "panel", a = Ct(null);
|
|
2606
2604
|
return (
|
|
2607
2605
|
// 3. Pass the internal ref to the Draggable component via 'nodeRef'
|
|
2608
2606
|
/* @__PURE__ */ s(
|
|
2609
2607
|
vn,
|
|
2610
2608
|
{
|
|
2611
2609
|
nodeRef: a,
|
|
2612
|
-
"data-testid":
|
|
2610
|
+
"data-testid": i,
|
|
2613
2611
|
axis: "both",
|
|
2614
2612
|
handle: ".handle",
|
|
2615
|
-
onStart: (
|
|
2613
|
+
onStart: (m, h) => {
|
|
2616
2614
|
e.onDraggingChange?.(!0);
|
|
2617
2615
|
},
|
|
2618
|
-
onStop: (
|
|
2616
|
+
onStop: (m, h) => {
|
|
2619
2617
|
setTimeout(() => {
|
|
2620
2618
|
e.onDraggingChange?.(!1);
|
|
2621
2619
|
}, 100);
|
|
2622
2620
|
},
|
|
2623
|
-
children: /* @__PURE__ */ s("div", { ref: a, className:
|
|
2621
|
+
children: /* @__PURE__ */ s("div", { ref: a, className: o, style: r, children: e.children })
|
|
2624
2622
|
}
|
|
2625
2623
|
)
|
|
2626
2624
|
);
|
|
@@ -2650,23 +2648,23 @@ function nr({ children: e, addCssClasses: n }) {
|
|
|
2650
2648
|
}
|
|
2651
2649
|
const rr = (e) => {
|
|
2652
2650
|
console.warn("showToast TODO", e);
|
|
2653
|
-
}, wn = (e) => e < 0.8 ? 1 : e <= 1 ? 0 : e > 1 ? -1 : 0,
|
|
2654
|
-
let t =
|
|
2655
|
-
const r = e.responsiveGrid || !1,
|
|
2651
|
+
}, wn = (e) => e < 0.8 ? 1 : e <= 1 ? 0 : e > 1 ? -1 : 0, or = le((e, n) => {
|
|
2652
|
+
let t = lt(Number(e.zoomScale || 0));
|
|
2653
|
+
const r = e.responsiveGrid || !1, i = e.isEditing || !1, o = {
|
|
2656
2654
|
"--bwj-dashboard-transform-scale": t,
|
|
2657
2655
|
"--bwj-dashboard-add-cols": wn(t)
|
|
2658
2656
|
}, a = G(
|
|
2659
2657
|
"dashboard-main-grid w-full",
|
|
2660
|
-
|
|
2658
|
+
i ? "editing" : "",
|
|
2661
2659
|
r ? "responsive-grid" : "",
|
|
2662
|
-
`border border-dashed ${
|
|
2660
|
+
`border border-dashed ${i ? "border-primary border-opacity-50" : "border-transparent"}`
|
|
2663
2661
|
);
|
|
2664
|
-
return /* @__PURE__ */ s("div", { className: a, style:
|
|
2662
|
+
return /* @__PURE__ */ s("div", { className: a, style: o, children: e.children });
|
|
2665
2663
|
}), $e = "size-5", Cn = (e, n) => {
|
|
2666
2664
|
const t = e.hideTitle && !e.isEditing, r = e.noBorder;
|
|
2667
|
-
let
|
|
2668
|
-
r ?
|
|
2669
|
-
const
|
|
2665
|
+
let i = `dashboard-widget ${e.isEditing ? "editing" : ""} border border-solid`;
|
|
2666
|
+
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`);
|
|
2667
|
+
const o = () => {
|
|
2670
2668
|
e.onRemoveClick && e.widgetKey && e.onRemoveClick(e.widgetKey, e.parentWidgetKey);
|
|
2671
2669
|
}, a = (b) => {
|
|
2672
2670
|
e.onMoveClick && e.widgetKey && e.onMoveClick(b, e.widgetKey, e.parentWidgetKey);
|
|
@@ -2675,7 +2673,7 @@ const rr = (e) => {
|
|
|
2675
2673
|
t ? "hidden" : "flex items-center justify-between border-b border-solid border-card-invert",
|
|
2676
2674
|
t ? "border-opacity-0" : "border-opacity-20"
|
|
2677
2675
|
);
|
|
2678
|
-
return /* @__PURE__ */ W("div", { className:
|
|
2676
|
+
return /* @__PURE__ */ W("div", { className: i, children: [
|
|
2679
2677
|
/* @__PURE__ */ W("div", { className: d, children: [
|
|
2680
2678
|
/* @__PURE__ */ W("div", { className: "widget-title-wrapper w-full flex flex-row gap-2 items-center justify-between", children: [
|
|
2681
2679
|
/* @__PURE__ */ W("h2", { className: "widget-title", children: [
|
|
@@ -2724,7 +2722,7 @@ const rr = (e) => {
|
|
|
2724
2722
|
placement: "top",
|
|
2725
2723
|
title: "Remove Widget"
|
|
2726
2724
|
},
|
|
2727
|
-
onClick: () =>
|
|
2725
|
+
onClick: () => o(),
|
|
2728
2726
|
children: /* @__PURE__ */ s(gt, { className: $e })
|
|
2729
2727
|
}
|
|
2730
2728
|
)
|
|
@@ -2733,9 +2731,9 @@ const rr = (e) => {
|
|
|
2733
2731
|
] }),
|
|
2734
2732
|
/* @__PURE__ */ s("div", { className: "widget-inner", children: e.children })
|
|
2735
2733
|
] });
|
|
2736
|
-
}, at =
|
|
2737
|
-
const t = (
|
|
2738
|
-
return !(r[0] !==
|
|
2734
|
+
}, at = le(Cn), Sn = (e, n) => {
|
|
2735
|
+
const t = (o) => o.replace(/[^0-9.]/g, ""), r = t(e).split(".").map(Number), i = t(n).split(".").map(Number);
|
|
2736
|
+
return !(r[0] !== i[0] || r[1] < i[1]);
|
|
2739
2737
|
};
|
|
2740
2738
|
function Dn(e) {
|
|
2741
2739
|
return /* @__PURE__ */ s("div", { className: "dashboard-widget", children: /* @__PURE__ */ W("div", { className: "absolute inset-0 bg-black flex flex-col items-center justify-center text-center", children: [
|
|
@@ -2743,47 +2741,47 @@ function Dn(e) {
|
|
|
2743
2741
|
/* @__PURE__ */ s("div", { className: "animate-ping rounded-full h-32 w-32 border-8 border-white" })
|
|
2744
2742
|
] }) });
|
|
2745
2743
|
}
|
|
2746
|
-
function
|
|
2744
|
+
function Tn({
|
|
2747
2745
|
index: e,
|
|
2748
2746
|
maxIndex: n,
|
|
2749
2747
|
widgetKey: t,
|
|
2750
2748
|
parentWidgetKey: r,
|
|
2751
|
-
targetContainerKey:
|
|
2752
|
-
childWidgetsConfig:
|
|
2749
|
+
targetContainerKey: i,
|
|
2750
|
+
childWidgetsConfig: o,
|
|
2753
2751
|
widgetCatalog: a,
|
|
2754
2752
|
isEditing: d,
|
|
2755
2753
|
// for additional props passed to all widget from the dashboard through the DynamicWidgetLoader:
|
|
2756
2754
|
extraProps: b,
|
|
2757
|
-
onRemoveClick:
|
|
2755
|
+
onRemoveClick: m,
|
|
2758
2756
|
onMoveClick: h,
|
|
2759
2757
|
selectContainer: u
|
|
2760
2758
|
}) {
|
|
2761
|
-
const p = `${t}`.split("_"), y = p.length > 1, D = y ? p[0] : t,
|
|
2762
|
-
if (!
|
|
2759
|
+
const p = `${t}`.split("_"), y = p.length > 1, D = y ? p[0] : t, g = a.get(D);
|
|
2760
|
+
if (!g)
|
|
2763
2761
|
return /* @__PURE__ */ s("div", { className: "flex", children: /* @__PURE__ */ W("p", { children: [
|
|
2764
2762
|
"Widget not found in catalog: ",
|
|
2765
2763
|
D
|
|
2766
2764
|
] }) });
|
|
2767
2765
|
let v = null, w = !1;
|
|
2768
|
-
const
|
|
2766
|
+
const T = !!g.isContainer, C = y ? mt(t) : "", S = T ? (o || []).filter((c) => c.parentWidgetKey === t) : [], l = {
|
|
2769
2767
|
index: e,
|
|
2770
2768
|
maxIndex: n,
|
|
2771
2769
|
widgetKey: t,
|
|
2772
2770
|
parentWidgetKey: r,
|
|
2773
2771
|
isEditing: d,
|
|
2774
2772
|
extraProps: b,
|
|
2775
|
-
title: y ? C :
|
|
2776
|
-
onRemoveClick:
|
|
2773
|
+
title: y ? C : g.title,
|
|
2774
|
+
onRemoveClick: m,
|
|
2777
2775
|
onMoveClick: h
|
|
2778
2776
|
};
|
|
2779
|
-
if (
|
|
2780
|
-
if (!
|
|
2781
|
-
const
|
|
2777
|
+
if (g.component ? (v = g.component, w = !1) : g.loader && (w = !0, v = st(() => {
|
|
2778
|
+
if (!g) return null;
|
|
2779
|
+
const c = typeof __HOST_REACT_VERSION__ < "u" ? __HOST_REACT_VERSION__ : "19.2.3", f = g.meta?.externalDependencies || [], M = f.find(($) => $.startsWith("react@"));
|
|
2782
2780
|
if (M) {
|
|
2783
2781
|
const $ = M.split("@")[1];
|
|
2784
|
-
if (!Sn(
|
|
2782
|
+
if (!Sn(c, $))
|
|
2785
2783
|
return ae.lazy(async () => ({
|
|
2786
|
-
default: () => /* @__PURE__ */ s(at, { ...
|
|
2784
|
+
default: () => /* @__PURE__ */ s(at, { ...l, children: /* @__PURE__ */ W("div", { className: "p-4 border border-dashed border-danger", children: [
|
|
2787
2785
|
/* @__PURE__ */ W("p", { className: "font-bold", children: [
|
|
2788
2786
|
'Failed to load "',
|
|
2789
2787
|
t,
|
|
@@ -2803,36 +2801,36 @@ function Nn({
|
|
|
2803
2801
|
] }),
|
|
2804
2802
|
". Host is running",
|
|
2805
2803
|
" ",
|
|
2806
|
-
/* @__PURE__ */ s("strong", { children:
|
|
2804
|
+
/* @__PURE__ */ s("strong", { children: c }),
|
|
2807
2805
|
"."
|
|
2808
2806
|
] })
|
|
2809
2807
|
] }),
|
|
2810
2808
|
/* @__PURE__ */ W("div", { className: "flex flex-col mt-3", children: [
|
|
2811
2809
|
/* @__PURE__ */ s("h5", { children: "Externals:" }),
|
|
2812
|
-
/* @__PURE__ */ s("dl", { className: "ml-2 flex flex-col text-xs", children: f.map((I,
|
|
2810
|
+
/* @__PURE__ */ s("dl", { className: "ml-2 flex flex-col text-xs", children: f.map((I, E) => /* @__PURE__ */ W("dd", { children: [
|
|
2813
2811
|
"- ",
|
|
2814
2812
|
I
|
|
2815
|
-
] },
|
|
2813
|
+
] }, E)) })
|
|
2816
2814
|
] })
|
|
2817
2815
|
] }) })
|
|
2818
2816
|
}));
|
|
2819
2817
|
}
|
|
2820
|
-
if (
|
|
2821
|
-
return
|
|
2822
|
-
if (
|
|
2818
|
+
if (g.component)
|
|
2819
|
+
return g.component;
|
|
2820
|
+
if (g.loader) {
|
|
2823
2821
|
const $ = async () => {
|
|
2824
2822
|
try {
|
|
2825
|
-
return await
|
|
2823
|
+
return await g.loader();
|
|
2826
2824
|
} catch (I) {
|
|
2827
2825
|
return console.error(`CDN Load Failure for ${t}:`, I), {
|
|
2828
|
-
default: () => /* @__PURE__ */ s(at, { ...
|
|
2826
|
+
default: () => /* @__PURE__ */ s(at, { ...l, children: /* @__PURE__ */ W("div", { className: "p-4 border border-dashed border-danger", children: [
|
|
2829
2827
|
/* @__PURE__ */ W("p", { className: "font-bold", children: [
|
|
2830
2828
|
'Failed to load "',
|
|
2831
2829
|
t,
|
|
2832
2830
|
'"'
|
|
2833
2831
|
] }),
|
|
2834
2832
|
/* @__PURE__ */ s("p", { className: "text-xs italic", children: "The remote plugin is unavailable or incompatible." }),
|
|
2835
|
-
/* @__PURE__ */ s("pre", { className: "text-xs overflow-hidden", children: JSON.stringify(
|
|
2833
|
+
/* @__PURE__ */ s("pre", { className: "text-xs overflow-hidden", children: JSON.stringify(g.meta || {}, null, 2) })
|
|
2836
2834
|
] }) })
|
|
2837
2835
|
};
|
|
2838
2836
|
}
|
|
@@ -2840,48 +2838,48 @@ function Nn({
|
|
|
2840
2838
|
return ae.lazy($);
|
|
2841
2839
|
}
|
|
2842
2840
|
return null;
|
|
2843
|
-
}, [
|
|
2841
|
+
}, [g, t])), !v)
|
|
2844
2842
|
return /* @__PURE__ */ s("div", { className: "flex", children: /* @__PURE__ */ W("p", { children: [
|
|
2845
2843
|
"Widget definition incomplete: ",
|
|
2846
2844
|
D
|
|
2847
2845
|
] }) });
|
|
2848
|
-
const
|
|
2849
|
-
highlight:
|
|
2846
|
+
const N = T ? {
|
|
2847
|
+
highlight: i === t,
|
|
2850
2848
|
selectContainer: u,
|
|
2851
2849
|
// The children prop is the recursive call back to DynamicWidgetLoader
|
|
2852
|
-
children: S.map((
|
|
2853
|
-
|
|
2850
|
+
children: S.map((c, f) => /* @__PURE__ */ s(
|
|
2851
|
+
Tn,
|
|
2854
2852
|
{
|
|
2855
2853
|
index: f,
|
|
2856
2854
|
maxIndex: S.length - 1,
|
|
2857
|
-
widgetKey:
|
|
2858
|
-
parentWidgetKey:
|
|
2855
|
+
widgetKey: c.widgetKey,
|
|
2856
|
+
parentWidgetKey: c.parentWidgetKey,
|
|
2859
2857
|
widgetCatalog: a,
|
|
2860
2858
|
isEditing: d,
|
|
2861
2859
|
extraProps: b,
|
|
2862
|
-
onRemoveClick:
|
|
2860
|
+
onRemoveClick: m,
|
|
2863
2861
|
onMoveClick: h
|
|
2864
2862
|
},
|
|
2865
|
-
`${
|
|
2863
|
+
`${c.widgetKey}_${f}`
|
|
2866
2864
|
))
|
|
2867
2865
|
} : {};
|
|
2868
|
-
return w ? /* @__PURE__ */ s(St, { fallback: /* @__PURE__ */ s(Dn, { title: `Loading ${
|
|
2866
|
+
return w ? /* @__PURE__ */ s(St, { fallback: /* @__PURE__ */ s(Dn, { title: `Loading ${g.title}` }), children: /* @__PURE__ */ s(v, { ...l, ...N }) }) : /* @__PURE__ */ s(v, { ...l, ...N });
|
|
2869
2867
|
}
|
|
2870
2868
|
const xe = "size-5";
|
|
2871
2869
|
function ke(e) {
|
|
2872
|
-
const n = e.highlight || !1, t = e.direction || "column", r = e.children.length > 0,
|
|
2873
|
-
let d = n ? "border-transparent" :
|
|
2870
|
+
const n = e.highlight || !1, t = e.direction || "column", r = e.children.length > 0, i = e.isEditing || !1;
|
|
2871
|
+
let d = n ? "border-transparent" : i && !r ? "border-card-invert" : "border-transparent";
|
|
2874
2872
|
const b = ["large", "xlarge"].includes(e.size || "");
|
|
2875
|
-
let
|
|
2876
|
-
["large", "xlarge"].indexOf(e.size || "") > -1 && (
|
|
2873
|
+
let m = "";
|
|
2874
|
+
["large", "xlarge"].indexOf(e.size || "") > -1 && (m = `${e.size}-widget`);
|
|
2877
2875
|
let h = "";
|
|
2878
2876
|
t === "row" && !r ? h = "min-h-48" : t === "column" && !r && (h = "min-h-96");
|
|
2879
2877
|
let u = G(
|
|
2880
2878
|
"dashboard-widget-container relative ",
|
|
2881
2879
|
r ? "" : "has-no-children",
|
|
2882
|
-
|
|
2880
|
+
i ? "editing" : "",
|
|
2883
2881
|
h,
|
|
2884
|
-
|
|
2882
|
+
m,
|
|
2885
2883
|
b ? "widget-container-grid" : "widget-container-flex",
|
|
2886
2884
|
`direction-${t}`,
|
|
2887
2885
|
`border ${d}`,
|
|
@@ -2891,7 +2889,7 @@ function ke(e) {
|
|
|
2891
2889
|
e.onRemoveClick && e.widgetKey && e.onRemoveClick(e.widgetKey);
|
|
2892
2890
|
}, D = (v) => {
|
|
2893
2891
|
e.onMoveClick && e.widgetKey && e.onMoveClick(v, e.widgetKey, e.parentWidgetKey);
|
|
2894
|
-
},
|
|
2892
|
+
}, g = () => {
|
|
2895
2893
|
e.selectContainer && e.widgetKey && e.selectContainer(e.widgetKey);
|
|
2896
2894
|
};
|
|
2897
2895
|
return /* @__PURE__ */ W("div", { "data-testid": `container_${e.widgetKey}`, className: u, children: [
|
|
@@ -2900,7 +2898,7 @@ function ke(e) {
|
|
|
2900
2898
|
"div",
|
|
2901
2899
|
{
|
|
2902
2900
|
className: "widget-title-wrapper w-full flex whitespace-nowrap",
|
|
2903
|
-
onClick:
|
|
2901
|
+
onClick: g,
|
|
2904
2902
|
children: /* @__PURE__ */ s("span", { className: "text-sm font-semibold capitalize", children: e.title })
|
|
2905
2903
|
}
|
|
2906
2904
|
),
|
|
@@ -2915,7 +2913,7 @@ function ke(e) {
|
|
|
2915
2913
|
placement: "top",
|
|
2916
2914
|
title: "Target this Container"
|
|
2917
2915
|
},
|
|
2918
|
-
onClick:
|
|
2916
|
+
onClick: g,
|
|
2919
2917
|
children: /* @__PURE__ */ s(
|
|
2920
2918
|
tn,
|
|
2921
2919
|
{
|
|
@@ -2970,7 +2968,7 @@ function ke(e) {
|
|
|
2970
2968
|
/* @__PURE__ */ s("div", { "data-testid": `childrenwrapper_${e.widgetKey}`, className: "widget-container-inner", children: e.children })
|
|
2971
2969
|
] });
|
|
2972
2970
|
}
|
|
2973
|
-
function
|
|
2971
|
+
function ir(e) {
|
|
2974
2972
|
const { direction: n, ...t } = e;
|
|
2975
2973
|
return /* @__PURE__ */ s(ke, { direction: "column", ...t });
|
|
2976
2974
|
}
|
|
@@ -2988,23 +2986,23 @@ function We({
|
|
|
2988
2986
|
alreadyAdded: n,
|
|
2989
2987
|
addWidget: t
|
|
2990
2988
|
}) {
|
|
2991
|
-
const [r,
|
|
2989
|
+
const [r, i] = ce(!1), o = e.icon || nn, a = e.name || "Unknown", d = e.description || "---", m = (e.noDuplicatedWidgets || !1) && n, h = G(`
|
|
2992
2990
|
flex flex-row gap-2 p-2 rounded-md border text-sm bg-card content-card backdrop-opacity-100
|
|
2993
|
-
${
|
|
2991
|
+
${m ? "border-disabled fill-disabled text-disabled" : "cursor-pointer border-primary fill-danger hover:fill-primary content-primary hover:brightness-110"}
|
|
2994
2992
|
`);
|
|
2995
2993
|
return /* @__PURE__ */ W("div", { className: h, style: { width: "calc(100% - 1rem)" }, onClick: () => {
|
|
2996
|
-
|
|
2994
|
+
m || t();
|
|
2997
2995
|
}, children: [
|
|
2998
|
-
/* @__PURE__ */ s(
|
|
2996
|
+
/* @__PURE__ */ s(o, { className: "" }),
|
|
2999
2997
|
/* @__PURE__ */ W("div", { className: "w-full", children: [
|
|
3000
2998
|
/* @__PURE__ */ W("div", { className: "flex flex-row items-center gap-2 justify-between", children: [
|
|
3001
2999
|
/* @__PURE__ */ s("span", { className: "font-bold", children: a }),
|
|
3002
|
-
/* @__PURE__ */ s("div", { className: "text-xs", children:
|
|
3000
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: m ? "(Added)" : "" })
|
|
3003
3001
|
] }),
|
|
3004
3002
|
/* @__PURE__ */ W("div", { className: "flex flex-col text-xs", children: [
|
|
3005
3003
|
/* @__PURE__ */ s("div", { children: d }),
|
|
3006
3004
|
/* @__PURE__ */ s("div", { className: "mt-3 cursor-pointer", onClick: (y) => {
|
|
3007
|
-
y.stopPropagation(), y.preventDefault(),
|
|
3005
|
+
y.stopPropagation(), y.preventDefault(), i(!r);
|
|
3008
3006
|
}, children: "Externals:" }),
|
|
3009
3007
|
r && /* @__PURE__ */ s("dl", { className: "ml-2 flex flex-col text-xs", children: e.externalDependencies.map((y, D) => /* @__PURE__ */ W("dd", { children: [
|
|
3010
3008
|
"- ",
|
|
@@ -3014,21 +3012,21 @@ function We({
|
|
|
3014
3012
|
] })
|
|
3015
3013
|
] });
|
|
3016
3014
|
}
|
|
3017
|
-
function
|
|
3015
|
+
function En({
|
|
3018
3016
|
item: e,
|
|
3019
3017
|
onSettingItemChanged: n
|
|
3020
3018
|
}) {
|
|
3021
|
-
const t = e.
|
|
3019
|
+
const t = e.name || "Unknown", r = e.description || "---", i = G(`
|
|
3022
3020
|
flex flex-row gap-2 p-2 rounded-md border text-sm bg-card content-card backdrop-opacity-100
|
|
3023
|
-
`),
|
|
3021
|
+
`), o = (d) => {
|
|
3024
3022
|
const b = d.key;
|
|
3025
3023
|
if (["ArrowUp", "ArrowDown"].includes(b)) {
|
|
3026
3024
|
d.preventDefault();
|
|
3027
|
-
const
|
|
3025
|
+
const m = _t.incrementOrDecrementValue(
|
|
3028
3026
|
e,
|
|
3029
3027
|
b === "ArrowUp" ? 1 : -1
|
|
3030
3028
|
);
|
|
3031
|
-
n(
|
|
3029
|
+
n(m);
|
|
3032
3030
|
}
|
|
3033
3031
|
}, a = (d) => {
|
|
3034
3032
|
n({
|
|
@@ -3036,7 +3034,7 @@ function Tn({
|
|
|
3036
3034
|
value: d.target.value || ""
|
|
3037
3035
|
});
|
|
3038
3036
|
};
|
|
3039
|
-
return /* @__PURE__ */ s("div", { className:
|
|
3037
|
+
return /* @__PURE__ */ s("div", { className: i, style: { width: "calc(100% - 1rem)" }, children: /* @__PURE__ */ W("div", { className: "w-full", children: [
|
|
3040
3038
|
/* @__PURE__ */ s("div", { className: "flex flex-row items-center gap-2 justify-between", children: /* @__PURE__ */ s("span", { className: "font-bold", children: t }) }),
|
|
3041
3039
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2 text-xs", children: /* @__PURE__ */ s("div", { children: r }) }),
|
|
3042
3040
|
/* @__PURE__ */ W("div", { children: [
|
|
@@ -3049,7 +3047,7 @@ function Tn({
|
|
|
3049
3047
|
className: "w-full",
|
|
3050
3048
|
value: e.value,
|
|
3051
3049
|
onChange: a,
|
|
3052
|
-
onKeyDown:
|
|
3050
|
+
onKeyDown: o
|
|
3053
3051
|
}
|
|
3054
3052
|
)
|
|
3055
3053
|
] })
|
|
@@ -3059,47 +3057,47 @@ const Ie = (e, n) => [
|
|
|
3059
3057
|
...n.widgets.filter((r) => r.indexOf("Container") === -1),
|
|
3060
3058
|
...n.childWidgetsConfig.map((r) => r.widgetKey)
|
|
3061
3059
|
].includes(e);
|
|
3062
|
-
function
|
|
3060
|
+
function cr({
|
|
3063
3061
|
targetContainerKey: e,
|
|
3064
3062
|
widgetsCatalog: n,
|
|
3065
3063
|
currentDashboardConfig: t,
|
|
3066
3064
|
undoStatus: r,
|
|
3067
|
-
addWidget:
|
|
3068
|
-
addContainer:
|
|
3065
|
+
addWidget: i,
|
|
3066
|
+
addContainer: o,
|
|
3069
3067
|
onSettingItemsUpdated: a,
|
|
3070
3068
|
onResetToDefaultDashboardClick: d,
|
|
3071
3069
|
onUndoOrRedo: b,
|
|
3072
|
-
onDoneClick:
|
|
3070
|
+
onDoneClick: m
|
|
3073
3071
|
}) {
|
|
3074
|
-
const [h, u] =
|
|
3075
|
-
widgetKey:
|
|
3076
|
-
metaData: $t(
|
|
3077
|
-
})),
|
|
3078
|
-
|
|
3079
|
-
}, C = (
|
|
3072
|
+
const [h, u] = ce("Editing"), [p, y] = ce(0), [D, g] = ce(""), w = Array.from(n.keys()).map((E) => ({
|
|
3073
|
+
widgetKey: E,
|
|
3074
|
+
metaData: $t(E, n)
|
|
3075
|
+
})), T = (E) => {
|
|
3076
|
+
g(E.target.value);
|
|
3077
|
+
}, C = (E) => {
|
|
3080
3078
|
const z = D.trim().toLowerCase();
|
|
3081
|
-
return z.length < 1 ? !0 :
|
|
3082
|
-
}, S = (
|
|
3079
|
+
return z.length < 1 ? !0 : E.name.trim().toLowerCase().includes(z) || E.description.toLowerCase().includes(z);
|
|
3080
|
+
}, S = (E) => {
|
|
3083
3081
|
const z = D.trim().toLowerCase();
|
|
3084
|
-
return z.length < 1 ? !0 :
|
|
3085
|
-
},
|
|
3082
|
+
return z.length < 1 ? !0 : E.name.trim().toLowerCase().includes(z) || E.description.toLowerCase().includes(z);
|
|
3083
|
+
}, l = (E) => G(
|
|
3086
3084
|
"px-4 py-2 font-medium cursor-pointer border-b-2 border-transparent hover:border-primary focus:outline-none",
|
|
3087
|
-
|
|
3088
|
-
),
|
|
3085
|
+
E === p ? "text-primary border-primary" : ""
|
|
3086
|
+
), N = !!e;
|
|
3089
3087
|
Dt(() => {
|
|
3090
3088
|
if (e) {
|
|
3091
3089
|
y(0);
|
|
3092
|
-
const
|
|
3093
|
-
u(`Editing ${
|
|
3090
|
+
const E = mt(e);
|
|
3091
|
+
u(`Editing ${E}`);
|
|
3094
3092
|
} else
|
|
3095
3093
|
u("Editing Dashboard");
|
|
3096
3094
|
}, [e]);
|
|
3097
|
-
const
|
|
3098
|
-
|
|
3099
|
-
}, f = (
|
|
3100
|
-
const z = (t.cssSettings || []).map((X) => X.key ===
|
|
3095
|
+
const c = (E) => {
|
|
3096
|
+
N ? i(E, e) : i(E);
|
|
3097
|
+
}, f = (E) => {
|
|
3098
|
+
const z = (t.cssSettings || []).map((X) => X.key === E.key ? E : X);
|
|
3101
3099
|
a(z);
|
|
3102
|
-
}, [M, $] =
|
|
3100
|
+
}, [M, $] = ce(!1);
|
|
3103
3101
|
return /* @__PURE__ */ s(
|
|
3104
3102
|
xn,
|
|
3105
3103
|
{
|
|
@@ -3112,8 +3110,8 @@ function lr({
|
|
|
3112
3110
|
minHeight: "360px",
|
|
3113
3111
|
backdropFilter: "blur(8px)"
|
|
3114
3112
|
},
|
|
3115
|
-
onDraggingChange: (
|
|
3116
|
-
$(
|
|
3113
|
+
onDraggingChange: (E) => {
|
|
3114
|
+
$(E);
|
|
3117
3115
|
},
|
|
3118
3116
|
children: /* @__PURE__ */ W("div", { className: "flex flex-col gap-2 p-2", children: [
|
|
3119
3117
|
/* @__PURE__ */ W("div", { className: "flex flex-row gap-2 justify-between", children: [
|
|
@@ -3123,7 +3121,7 @@ function lr({
|
|
|
3123
3121
|
"h2",
|
|
3124
3122
|
{
|
|
3125
3123
|
className: "flex-1 text-base margin-0 capitalize",
|
|
3126
|
-
title:
|
|
3124
|
+
title: N ? h : `Editing dashboard: ${t.dashboardName}`,
|
|
3127
3125
|
children: h
|
|
3128
3126
|
}
|
|
3129
3127
|
)
|
|
@@ -3173,10 +3171,10 @@ function lr({
|
|
|
3173
3171
|
] })
|
|
3174
3172
|
] }),
|
|
3175
3173
|
/* @__PURE__ */ W("div", { className: "flex border-b border-gray-200", children: [
|
|
3176
|
-
/* @__PURE__ */ s("button", { onClick: () => y(0), className:
|
|
3177
|
-
/* @__PURE__ */ s("button", { onClick: () => y(1), className:
|
|
3178
|
-
!
|
|
3179
|
-
!
|
|
3174
|
+
/* @__PURE__ */ s("button", { onClick: () => y(0), className: l(0), children: "Widgets" }),
|
|
3175
|
+
/* @__PURE__ */ s("button", { onClick: () => y(1), className: l(1), children: "Charts" }),
|
|
3176
|
+
!N && /* @__PURE__ */ s("button", { onClick: () => y(2), className: l(2), children: "Containers" }),
|
|
3177
|
+
!N && /* @__PURE__ */ s("button", { onClick: () => y(3), className: l(3), children: /* @__PURE__ */ s(Xt, {}) })
|
|
3180
3178
|
] }),
|
|
3181
3179
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-1 w-full", children: /* @__PURE__ */ s(
|
|
3182
3180
|
pt,
|
|
@@ -3185,7 +3183,7 @@ function lr({
|
|
|
3185
3183
|
size: "small",
|
|
3186
3184
|
className: "w-full",
|
|
3187
3185
|
value: D,
|
|
3188
|
-
onChange:
|
|
3186
|
+
onChange: T
|
|
3189
3187
|
}
|
|
3190
3188
|
) }),
|
|
3191
3189
|
/* @__PURE__ */ W(
|
|
@@ -3197,46 +3195,46 @@ function lr({
|
|
|
3197
3195
|
},
|
|
3198
3196
|
children: [
|
|
3199
3197
|
p === 0 && w.filter(
|
|
3200
|
-
(
|
|
3201
|
-
).map((
|
|
3198
|
+
(E) => E.metaData.categories.includes("Widget") && C(E.metaData)
|
|
3199
|
+
).map((E) => /* @__PURE__ */ s(
|
|
3202
3200
|
We,
|
|
3203
3201
|
{
|
|
3204
|
-
widgetKey:
|
|
3205
|
-
metaData:
|
|
3206
|
-
alreadyAdded: Ie(
|
|
3207
|
-
addWidget: () =>
|
|
3202
|
+
widgetKey: E.widgetKey,
|
|
3203
|
+
metaData: E.metaData,
|
|
3204
|
+
alreadyAdded: Ie(E.widgetKey, t),
|
|
3205
|
+
addWidget: () => c(E.widgetKey)
|
|
3208
3206
|
},
|
|
3209
|
-
|
|
3207
|
+
E.widgetKey
|
|
3210
3208
|
)),
|
|
3211
3209
|
p === 1 && w.filter(
|
|
3212
|
-
(
|
|
3213
|
-
).map((
|
|
3210
|
+
(E) => E.metaData.categories.includes("Chart") && C(E.metaData)
|
|
3211
|
+
).map((E) => /* @__PURE__ */ s(
|
|
3214
3212
|
We,
|
|
3215
3213
|
{
|
|
3216
|
-
widgetKey:
|
|
3217
|
-
metaData:
|
|
3218
|
-
alreadyAdded: Ie(
|
|
3219
|
-
addWidget: () =>
|
|
3214
|
+
widgetKey: E.widgetKey,
|
|
3215
|
+
metaData: E.metaData,
|
|
3216
|
+
alreadyAdded: Ie(E.widgetKey, t),
|
|
3217
|
+
addWidget: () => c(E.widgetKey)
|
|
3220
3218
|
},
|
|
3221
|
-
|
|
3219
|
+
E.widgetKey
|
|
3222
3220
|
)),
|
|
3223
|
-
!
|
|
3221
|
+
!N && p === 2 && w.filter((E) => E.metaData.categories.includes("Container")).map((E) => /* @__PURE__ */ s(
|
|
3224
3222
|
We,
|
|
3225
3223
|
{
|
|
3226
|
-
widgetKey:
|
|
3227
|
-
metaData:
|
|
3228
|
-
alreadyAdded: Ie(
|
|
3229
|
-
addWidget: () =>
|
|
3224
|
+
widgetKey: E.widgetKey,
|
|
3225
|
+
metaData: E.metaData,
|
|
3226
|
+
alreadyAdded: Ie(E.widgetKey, t),
|
|
3227
|
+
addWidget: () => o(E.widgetKey)
|
|
3230
3228
|
},
|
|
3231
|
-
|
|
3229
|
+
E.widgetKey
|
|
3232
3230
|
)),
|
|
3233
|
-
!
|
|
3234
|
-
|
|
3231
|
+
!N && p === 3 && (t.cssSettings || []).filter(S).map((E) => /* @__PURE__ */ s(
|
|
3232
|
+
En,
|
|
3235
3233
|
{
|
|
3236
|
-
item:
|
|
3234
|
+
item: E,
|
|
3237
3235
|
onSettingItemChanged: f
|
|
3238
3236
|
},
|
|
3239
|
-
|
|
3237
|
+
E.key
|
|
3240
3238
|
))
|
|
3241
3239
|
]
|
|
3242
3240
|
}
|
|
@@ -3249,7 +3247,7 @@ function lr({
|
|
|
3249
3247
|
placement: "bottom",
|
|
3250
3248
|
title: "Click to exit edit mode"
|
|
3251
3249
|
},
|
|
3252
|
-
onClick:
|
|
3250
|
+
onClick: m,
|
|
3253
3251
|
children: "Done"
|
|
3254
3252
|
}
|
|
3255
3253
|
) })
|
|
@@ -3262,14 +3260,14 @@ export {
|
|
|
3262
3260
|
J as Button,
|
|
3263
3261
|
nn as CircleQuestionMark,
|
|
3264
3262
|
tn as CrosshairIcon,
|
|
3265
|
-
|
|
3263
|
+
or as DashboardGrid,
|
|
3266
3264
|
Fe as DashboardMaxZoomScale,
|
|
3267
3265
|
Ae as DashboardMinZoomScale,
|
|
3268
3266
|
at as DashboardWidgetBase,
|
|
3269
3267
|
Mt as DashboardZoomStep,
|
|
3270
3268
|
Fn as DeleteIcon,
|
|
3271
3269
|
xn as DraggablePanel,
|
|
3272
|
-
|
|
3270
|
+
Tn as DynamicWidgetLoader,
|
|
3273
3271
|
Ln as EditIcon,
|
|
3274
3272
|
Vn as GridIcon,
|
|
3275
3273
|
en as HandGrabIcon,
|
|
@@ -3291,10 +3289,10 @@ export {
|
|
|
3291
3289
|
pt as TextField,
|
|
3292
3290
|
Gt as TimerResetIcon,
|
|
3293
3291
|
Zt as UndoIcon,
|
|
3294
|
-
|
|
3292
|
+
ir as WidgetContainerColumn,
|
|
3295
3293
|
ar as WidgetContainerLarge,
|
|
3296
3294
|
sr as WidgetContainerRow,
|
|
3297
|
-
|
|
3295
|
+
cr as WidgetsCatalogFlyout,
|
|
3298
3296
|
tr as WrapperColumnContent,
|
|
3299
3297
|
nr as WrapperColumnContentListItem,
|
|
3300
3298
|
gt as XCircleIcon,
|
|
@@ -3304,11 +3302,11 @@ export {
|
|
|
3304
3302
|
Ce as blankDashboardConfig,
|
|
3305
3303
|
dt as createDynamicEntry,
|
|
3306
3304
|
Wt as createStaticEntry,
|
|
3307
|
-
|
|
3305
|
+
Tt as cssSettingsCatalog,
|
|
3308
3306
|
Xn as cssVarsUtils,
|
|
3309
3307
|
_t as dashboardSettingsUtils,
|
|
3310
3308
|
Pt as ensureContainersSequence,
|
|
3311
|
-
|
|
3309
|
+
lt as ensureZoomScaleIsWithinRange,
|
|
3312
3310
|
ge as getDefaultWidgetMetaFromKey,
|
|
3313
3311
|
Wn as getDefaultWidgetMetaFromMap,
|
|
3314
3312
|
G as getDistinctCssClasses,
|