@actionexec/dashboards 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,39 @@
1
- import { jsx as i, jsxs as w } from "react/jsx-runtime";
2
- import H from "react-datepicker";
3
- import { useState as x, useRef as P, useMemo as O, useLayoutEffect as J, useEffect as V } from "react";
4
- import { createPortal as q } from "react-dom";
5
- const K = "https://action-data-api-7mbrztperq-rj.a.run.app", B = "/external/dashboards";
6
- let C = K;
7
- function ge(e) {
8
- C = e.replace(/\/$/, "");
1
+ import { jsx as i, jsxs as T } from "react/jsx-runtime";
2
+ import K from "react-datepicker";
3
+ import { useState as P, useRef as R, useMemo as $, useLayoutEffect as B, useEffect as Q } from "react";
4
+ import { createPortal as Z } from "react-dom";
5
+ const ee = "https://action-data-api-7mbrztperq-rj.a.run.app", te = "/external/dashboards";
6
+ let U = ee;
7
+ function Ee(e) {
8
+ U = e.replace(/\/$/, "");
9
9
  }
10
- class Q extends Error {
10
+ class ae extends Error {
11
11
  constructor(t, a, r) {
12
12
  super(t), this.status = a, this.payload = r, this.name = "ApiError";
13
13
  }
14
14
  }
15
- async function R(e, t, a) {
16
- const r = new URL(`${C}${B}${e}`);
15
+ async function G(e, t, a) {
16
+ const r = new URL(`${U}${te}${e}`);
17
17
  if (a)
18
18
  for (const [o, l] of Object.entries(a)) r.searchParams.set(o, l);
19
- const s = await fetch(r.toString(), {
19
+ const n = await fetch(r.toString(), {
20
20
  headers: { Authorization: `Bearer ${t}` }
21
21
  });
22
- if (!s.ok) {
22
+ if (!n.ok) {
23
23
  let o;
24
24
  try {
25
- o = await s.json();
25
+ o = await n.json();
26
26
  } catch {
27
27
  }
28
- throw new Q(
29
- `Requisicao falhou (${s.status}) em ${e}`,
30
- s.status,
28
+ throw new ae(
29
+ `Requisicao falhou (${n.status}) em ${e}`,
30
+ n.status,
31
31
  o
32
32
  );
33
33
  }
34
- return await s.json();
34
+ return await n.json();
35
35
  }
36
- const pe = (e) => R("/layout", e), me = (e, t) => R("/render", e, t), m = {
36
+ const Se = (e) => G("/layout", e), we = (e, t) => G("/render", e, t), m = {
37
37
  series0: 0,
38
38
  series1: 1,
39
39
  series2: 2,
@@ -47,7 +47,7 @@ const pe = (e) => R("/layout", e), me = (e, t) => R("/render", e, t), m = {
47
47
  accent: 10,
48
48
  success: 11,
49
49
  error: 12
50
- }, X = 5, N = 13, Z = {
50
+ }, re = 5, L = 13, ne = {
51
51
  series0: "Série 1",
52
52
  series1: "Série 2",
53
53
  series2: "Série 3",
@@ -152,20 +152,20 @@ const pe = (e) => R("/layout", e), me = (e, t) => R("/render", e, t), m = {
152
152
  "#e11d48"
153
153
  ]
154
154
  }
155
- }, $ = v.action.colors;
156
- function D(e) {
157
- const t = $;
155
+ }, Y = v.action.colors;
156
+ function N(e) {
157
+ const t = Y;
158
158
  if (!e || e.length === 0) return [...t];
159
- if (e.length >= N) return e.slice(0, N);
159
+ if (e.length >= L) return e.slice(0, L);
160
160
  const a = [...e];
161
- for (let r = e.length; r < N; r++) a.push(t[r]);
161
+ for (let r = e.length; r < L; r++) a.push(t[r]);
162
162
  return a;
163
163
  }
164
- function ee(e) {
165
- return D(e).slice(0, X);
164
+ function se(e) {
165
+ return N(e).slice(0, re);
166
166
  }
167
- function he(e) {
168
- const t = D(e);
167
+ function De(e) {
168
+ const t = N(e);
169
169
  return {
170
170
  "--bg-dark": t[m.bgDark],
171
171
  "--bg-paper": t[m.bgPaper],
@@ -181,11 +181,11 @@ function he(e) {
181
181
  "--color-warning": t[m.series3]
182
182
  };
183
183
  }
184
- const te = $, ae = 30, re = 10, be = {
185
- gridColumns: ae,
186
- gridRows: re,
184
+ const oe = Y, ce = 30, le = 10, ye = {
185
+ gridColumns: ce,
186
+ gridRows: le,
187
187
  widgets: []
188
- }, _e = {
188
+ }, Ne = {
189
189
  kpi_card: "KPI Card",
190
190
  gauge: "Gauge",
191
191
  chart: "Gráfico",
@@ -193,35 +193,35 @@ const te = $, ae = 30, re = 10, be = {
193
193
  filter: "Filtro",
194
194
  variable: "Variável",
195
195
  color_palette: "Paleta de Cores"
196
- }, we = ["kpi_card", "gauge", "chart", "table"], Te = ["filter", "variable", "color_palette"], Se = /* @__PURE__ */ new Set(["filter", "variable", "color_palette"]), Ee = {
196
+ }, Le = ["kpi_card", "gauge", "chart", "table"], ve = ["filter", "variable", "color_palette"], Me = /* @__PURE__ */ new Set(["filter", "variable", "color_palette"]), Pe = {
197
197
  sum: "Soma",
198
198
  avg: "Média",
199
199
  count: "Contagem",
200
200
  min: "Mínimo",
201
201
  max: "Máximo",
202
202
  count_distinct: "Contagem Distinta"
203
- }, se = {
203
+ }, ie = {
204
204
  currency: "Moeda (R$)",
205
205
  number: "Número",
206
206
  integer: "Inteiro",
207
207
  percentage: "Porcentagem",
208
208
  date: "Data",
209
209
  text: "Texto"
210
- }, ye = Object.entries(se).filter(([e]) => e !== "date" && e !== "text"), De = {
210
+ }, xe = Object.entries(ie).filter(([e]) => e !== "date" && e !== "text"), Ae = {
211
211
  yoy: "vs Ano Anterior",
212
212
  mom: "vs Mês Anterior",
213
213
  target: "vs Meta",
214
214
  none: "Nenhuma"
215
- }, Ne = {
215
+ }, Ce = {
216
216
  bar: "Barras",
217
217
  line: "Linhas",
218
218
  area: "Área",
219
219
  pie: "Pizza"
220
- }, ve = {
220
+ }, ke = {
221
221
  date_range: "Periodo",
222
222
  select: "Seleção Única",
223
223
  multi_select: "Seleção Múltipla"
224
- }, k = "", Le = {
224
+ }, F = "", Oe = {
225
225
  kpi_card: { x: 0, y: 0, w: 6, h: 3 },
226
226
  gauge: { x: 0, y: 0, w: 6, h: 5 },
227
227
  chart: { x: 0, y: 0, w: 6, h: 6 },
@@ -229,15 +229,33 @@ const te = $, ae = 30, re = 10, be = {
229
229
  filter: { x: 0, y: 0, w: 4, h: 2 },
230
230
  variable: { x: 0, y: 0, w: 4, h: 2 },
231
231
  color_palette: { x: 0, y: 0, w: 4, h: 2 }
232
- }, xe = {
232
+ }, Ie = {
233
233
  kpi_card: { label: "Novo KPI", aggregation: "sum", format: "number" },
234
234
  gauge: { label: "Novo Gauge", aggregation: "sum" },
235
235
  chart: { label: "Novo Grafico", chartType: "bar", xAxis: { column: "", granularity: "day" }, series: [] },
236
236
  table: { label: "Nova Tabela", columns: [] },
237
237
  filter: { label: "Novo Filtro", filterType: "select" },
238
238
  variable: { label: "Nova Variavel", variableValue: 0, variableFormat: "number", locked: !1 },
239
- color_palette: { label: "Paleta de Cores", paletteColors: te, locked: !1 }
240
- }, Me = [
239
+ color_palette: { label: "Paleta de Cores", paletteColors: oe, locked: !1 }
240
+ }, A = 6, C = 16, k = 1, x = 24, ue = 80, de = (e, t, a) => Math.min(Math.max(e, t), a), E = (e) => Number.isFinite(e) && e > 0;
241
+ function Re(e, t, a = A, r = C) {
242
+ if (!E(t) || !Number.isFinite(e)) return 0;
243
+ const n = e - r * 2 - a * (t - 1);
244
+ return Math.max(0, n / t);
245
+ }
246
+ function $e(e, t = k) {
247
+ return !E(e) || !E(t) ? x : de(e / t, x, ue);
248
+ }
249
+ function Fe(e, t, a = A, r = C) {
250
+ return e <= 0 ? r * 2 : e * t + (e - 1) * a + r * 2;
251
+ }
252
+ function Ue(e, t, a = k) {
253
+ return !E(e) || !E(t) || !E(a) ? 1 : e * a / t;
254
+ }
255
+ function Ge(e, t = k, a = A, r = C) {
256
+ return !E(e) || !E(t) ? 0 : x * t * e + a * (e - 1) + r * 2;
257
+ }
258
+ const Ye = [
241
259
  "Jan",
242
260
  "Fev",
243
261
  "Mar",
@@ -250,7 +268,7 @@ const te = $, ae = 30, re = 10, be = {
250
268
  "Out",
251
269
  "Nov",
252
270
  "Dez"
253
- ], Ae = [
271
+ ], He = [
254
272
  "Janeiro",
255
273
  "Fevereiro",
256
274
  "Marco",
@@ -264,84 +282,84 @@ const te = $, ae = 30, re = 10, be = {
264
282
  "Novembro",
265
283
  "Dezembro"
266
284
  ];
267
- function Pe(e) {
285
+ function We(e) {
268
286
  return { start: `${e}-01-01`, end: `${e}-12-31` };
269
287
  }
270
- function Oe(e) {
288
+ function je(e) {
271
289
  if (!e) return null;
272
290
  const t = e.match(/^(\d{4})/);
273
291
  return t ? { year: parseInt(t[1]) } : null;
274
292
  }
275
- function ke(e, t) {
276
- const a = new Date(e, t, 0).getDate(), r = (s) => String(s).padStart(2, "0");
293
+ function ze(e, t) {
294
+ const a = new Date(e, t, 0).getDate(), r = (n) => String(n).padStart(2, "0");
277
295
  return {
278
296
  start: `${e}-${r(t)}-01`,
279
297
  end: `${e}-${r(t)}-${r(a)}`
280
298
  };
281
299
  }
282
- function F(e) {
300
+ function H(e) {
283
301
  const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()));
284
302
  t.setUTCDate(t.getUTCDate() + 4 - (t.getUTCDay() || 7));
285
303
  const a = new Date(Date.UTC(t.getUTCFullYear(), 0, 1));
286
304
  return Math.ceil(((t.getTime() - a.getTime()) / 864e5 + 1) / 7);
287
305
  }
288
- function Ce(e, t) {
289
- const a = new Date(e, 0, 4), r = (a.getDay() + 6) % 7, s = new Date(a.getTime() - r * 864e5), o = new Date(s.getTime() + (t - 1) * 7 * 864e5), l = new Date(o.getTime() + 6 * 864e5), d = (h) => String(h).padStart(2, "0"), f = (h) => `${h.getFullYear()}-${d(h.getMonth() + 1)}-${d(h.getDate())}`;
306
+ function Je(e, t) {
307
+ const a = new Date(e, 0, 4), r = (a.getDay() + 6) % 7, n = new Date(a.getTime() - r * 864e5), o = new Date(n.getTime() + (t - 1) * 7 * 864e5), l = new Date(o.getTime() + 6 * 864e5), d = (h) => String(h).padStart(2, "0"), f = (h) => `${h.getFullYear()}-${d(h.getMonth() + 1)}-${d(h.getDate())}`;
290
308
  return { start: f(o), end: f(l) };
291
309
  }
292
- function Re(e, t) {
310
+ function Ve(e, t) {
293
311
  const a = /* @__PURE__ */ new Set(), r = new Date(e, t, 0).getDate();
294
- for (let s = 1; s <= r; s++)
295
- a.add(F(new Date(e, t - 1, s)));
296
- return Array.from(a).sort((s, o) => s - o);
312
+ for (let n = 1; n <= r; n++)
313
+ a.add(H(new Date(e, t - 1, n)));
314
+ return Array.from(a).sort((n, o) => n - o);
297
315
  }
298
- function $e(e, t) {
299
- const a = new Date(e, t, 0).getDate(), r = (d) => String(d).padStart(2, "0"), s = [];
316
+ function Xe(e, t) {
317
+ const a = new Date(e, t, 0).getDate(), r = (d) => String(d).padStart(2, "0"), n = [];
300
318
  let o = 1, l = 1;
301
319
  for (; o <= a; ) {
302
320
  const d = o, f = Math.min(o + 6, a), h = `${e}-${r(t)}-${r(d)}`, c = `${e}-${r(t)}-${r(f)}`, u = `${l}° Semana (${r(d)}/${r(t)} - ${r(f)}/${r(t)})`;
303
- s.push({ index: l, startDay: d, endDay: f, start: h, end: c, label: u }), o = f + 1, l++;
321
+ n.push({ index: l, startDay: d, endDay: f, start: h, end: c, label: u }), o = f + 1, l++;
304
322
  }
305
- return s;
323
+ return n;
306
324
  }
307
- function Fe(e, t, a) {
325
+ function qe(e, t, a) {
308
326
  if (!e) return 1;
309
- const r = (l) => String(l).padStart(2, "0"), s = e.match(new RegExp(`^${t}-${r(a)}-(\\d{2})`));
310
- if (!s) return 1;
311
- const o = parseInt(s[1]);
327
+ const r = (l) => String(l).padStart(2, "0"), n = e.match(new RegExp(`^${t}-${r(a)}-(\\d{2})`));
328
+ if (!n) return 1;
329
+ const o = parseInt(n[1]);
312
330
  return Math.ceil(o / 7);
313
331
  }
314
- function Ie(e) {
332
+ function Ke(e) {
315
333
  if (!e) return null;
316
334
  const t = e.match(/^(\d{4})-(\d{2})/);
317
335
  return t ? { year: parseInt(t[1]), month: parseInt(t[2]) } : null;
318
336
  }
319
- function Ue(e) {
337
+ function Be(e) {
320
338
  if (!e) return null;
321
339
  const t = /* @__PURE__ */ new Date(e + "T00:00:00");
322
- return isNaN(t.getTime()) ? null : { year: t.getFullYear(), week: F(t) };
340
+ return isNaN(t.getTime()) ? null : { year: t.getFullYear(), week: H(t) };
323
341
  }
324
- function Ye(e) {
325
- const t = /* @__PURE__ */ new Date(), a = e != null && e.min ? parseInt(e.min.slice(0, 4)) : t.getFullYear() - 2, r = e != null && e.max ? parseInt(e.max.slice(0, 4)) : t.getFullYear(), s = [];
326
- for (let o = r; o >= a; o--) s.push(o);
327
- return s;
342
+ function Qe(e) {
343
+ const t = /* @__PURE__ */ new Date(), a = e != null && e.min ? parseInt(e.min.slice(0, 4)) : t.getFullYear() - 2, r = e != null && e.max ? parseInt(e.max.slice(0, 4)) : t.getFullYear(), n = [];
344
+ for (let o = r; o >= a; o--) n.push(o);
345
+ return n;
328
346
  }
329
347
  function y(e) {
330
348
  if (!e) return null;
331
349
  const [t, a, r] = e.split("-").map(Number);
332
350
  return !t || !a || !r ? null : new Date(t, a - 1, r);
333
351
  }
334
- function ne(e) {
352
+ function fe(e) {
335
353
  if (!e) return "";
336
354
  const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
337
355
  return `${t}-${a}-${r}`;
338
356
  }
339
- function Ge({
357
+ function Ze({
340
358
  value: e,
341
359
  onChange: t,
342
360
  minIso: a,
343
361
  maxIso: r,
344
- placeholder: s,
362
+ placeholder: n,
345
363
  selectsStart: o,
346
364
  selectsEnd: l,
347
365
  startIso: d,
@@ -350,10 +368,10 @@ function Ge({
350
368
  disabled: c
351
369
  }) {
352
370
  return /* @__PURE__ */ i("div", { className: `ddp-field ${h ?? ""}`, children: /* @__PURE__ */ i(
353
- H,
371
+ K,
354
372
  {
355
373
  selected: y(e),
356
- onChange: (u) => t(ne(u)),
374
+ onChange: (u) => t(fe(u)),
357
375
  selectsStart: o,
358
376
  selectsEnd: l,
359
377
  startDate: y(d) ?? void 0,
@@ -361,7 +379,7 @@ function Ge({
361
379
  minDate: y(a) ?? void 0,
362
380
  maxDate: y(r) ?? void 0,
363
381
  dateFormat: "dd/MM/yyyy",
364
- placeholderText: s ?? "Selecione...",
382
+ placeholderText: n ?? "Selecione...",
365
383
  disabled: c,
366
384
  portalId: "ddp-portal",
367
385
  popperPlacement: "bottom-start",
@@ -375,54 +393,54 @@ function Ge({
375
393
  }
376
394
  ) });
377
395
  }
378
- function We({ options: e, value: t, multi: a, onChange: r }) {
379
- const [s, o] = x(!1), [l, d] = x(""), [f, h] = x(null), c = P(null), u = P(null), g = O(
380
- () => t ? t.split(k).filter(Boolean) : [],
396
+ function et({ options: e, value: t, multi: a, onChange: r }) {
397
+ const [n, o] = P(!1), [l, d] = P(""), [f, h] = P(null), c = R(null), u = R(null), g = $(
398
+ () => t ? t.split(F).filter(Boolean) : [],
381
399
  [t]
382
- ), b = O(() => {
383
- const n = l.trim().toLowerCase();
384
- return n ? e.filter((p) => p.toLowerCase().includes(n)) : e;
385
- }, [e, l]), T = () => {
386
- const n = c.current;
387
- if (!n) return;
388
- const p = n.getBoundingClientRect(), _ = 4, S = window.innerHeight - p.bottom - _, E = p.top - _, A = S < 200 && E > S, z = Math.max(150, Math.min(360, A ? E : S));
400
+ ), b = $(() => {
401
+ const s = l.trim().toLowerCase();
402
+ return s ? e.filter((p) => p.toLowerCase().includes(s)) : e;
403
+ }, [e, l]), S = () => {
404
+ const s = c.current;
405
+ if (!s) return;
406
+ const p = s.getBoundingClientRect(), _ = 4, w = window.innerHeight - p.bottom - _, D = p.top - _, I = w < 200 && D > w, q = Math.max(150, Math.min(360, I ? D : w));
389
407
  h({
390
408
  left: p.left,
391
409
  width: p.width,
392
- maxHeight: z,
393
- ...A ? { bottom: window.innerHeight - p.top + _ } : { top: p.bottom + _ }
410
+ maxHeight: q,
411
+ ...I ? { bottom: window.innerHeight - p.top + _ } : { top: p.bottom + _ }
394
412
  });
395
413
  };
396
- J(() => {
397
- if (!s) return;
398
- T();
399
- const n = () => T();
400
- return window.addEventListener("scroll", n, !0), window.addEventListener("resize", n), () => {
401
- window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n);
414
+ B(() => {
415
+ if (!n) return;
416
+ S();
417
+ const s = () => S();
418
+ return window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
419
+ window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
402
420
  };
403
- }, [s]), V(() => {
404
- if (!s) return;
405
- const n = (p) => {
406
- var S, E;
421
+ }, [n]), Q(() => {
422
+ if (!n) return;
423
+ const s = (p) => {
424
+ var w, D;
407
425
  const _ = p.target;
408
- (S = c.current) != null && S.contains(_) || (E = u.current) != null && E.contains(_) || o(!1);
426
+ (w = c.current) != null && w.contains(_) || (D = u.current) != null && D.contains(_) || o(!1);
409
427
  };
410
- return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
411
- }, [s]);
412
- const I = () => {
428
+ return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
429
+ }, [n]);
430
+ const W = () => {
413
431
  o(!1), d("");
414
- }, L = (n) => {
432
+ }, M = (s) => {
415
433
  var p;
416
- r(n), d(""), o(!1), (p = c.current) == null || p.blur();
417
- }, M = (n) => {
418
- const p = g.includes(n) ? g.filter((_) => _ !== n) : [...g, n];
419
- r(p.join(k));
420
- }, U = () => {
434
+ r(s), d(""), o(!1), (p = c.current) == null || p.blur();
435
+ }, O = (s) => {
436
+ const p = g.includes(s) ? g.filter((_) => _ !== s) : [...g, s];
437
+ r(p.join(F));
438
+ }, j = () => {
421
439
  o(!0), a || d("");
422
- }, Y = (n) => {
440
+ }, z = (s) => {
423
441
  var p;
424
- n.key === "Escape" ? (I(), (p = c.current) == null || p.blur()) : n.key === "Enter" && b.length > 0 && (n.preventDefault(), a ? (M(b[0]), d("")) : L(b[0]));
425
- }, G = a || s ? l : t || "", W = a && g.length > 0 ? `${g.length} selecionado(s)` : s ? "Buscar..." : "Todos", j = s && f ? q(
442
+ s.key === "Escape" ? (W(), (p = c.current) == null || p.blur()) : s.key === "Enter" && b.length > 0 && (s.preventDefault(), a ? (O(b[0]), d("")) : M(b[0]));
443
+ }, J = a || n ? l : t || "", V = a && g.length > 0 ? `${g.length} selecionado(s)` : n ? "Buscar..." : "Todos", X = n && f ? Z(
426
444
  /* @__PURE__ */ i(
427
445
  "div",
428
446
  {
@@ -436,7 +454,7 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
436
454
  bottom: f.bottom,
437
455
  maxHeight: f.maxHeight
438
456
  },
439
- children: /* @__PURE__ */ w("div", { className: "widget-filter__search-list", children: [
457
+ children: /* @__PURE__ */ T("div", { className: "widget-filter__search-list", children: [
440
458
  a && g.length > 0 && /* @__PURE__ */ i(
441
459
  "button",
442
460
  {
@@ -446,12 +464,12 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
446
464
  children: "Limpar seleção"
447
465
  }
448
466
  ),
449
- !a && /* @__PURE__ */ w(
467
+ !a && /* @__PURE__ */ T(
450
468
  "button",
451
469
  {
452
470
  type: "button",
453
471
  className: `widget-filter__search-option${t ? "" : " is-selected"}`,
454
- onClick: () => L(""),
472
+ onClick: () => M(""),
455
473
  children: [
456
474
  /* @__PURE__ */ i("span", { className: "widget-filter__search-check", "aria-hidden": !0, children: t ? "" : "✓" }),
457
475
  "Todos"
@@ -459,35 +477,35 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
459
477
  }
460
478
  ),
461
479
  b.length === 0 ? /* @__PURE__ */ i("span", { className: "widget-filter__search-empty", children: "Nenhuma opção" }) : b.map(
462
- (n) => a ? /* @__PURE__ */ w(
480
+ (s) => a ? /* @__PURE__ */ T(
463
481
  "label",
464
482
  {
465
- className: `widget-filter__search-option${g.includes(n) ? " is-selected" : ""}`,
483
+ className: `widget-filter__search-option${g.includes(s) ? " is-selected" : ""}`,
466
484
  children: [
467
485
  /* @__PURE__ */ i(
468
486
  "input",
469
487
  {
470
488
  type: "checkbox",
471
- checked: g.includes(n),
472
- onChange: () => M(n)
489
+ checked: g.includes(s),
490
+ onChange: () => O(s)
473
491
  }
474
492
  ),
475
- n
493
+ s
476
494
  ]
477
495
  },
478
- n
479
- ) : /* @__PURE__ */ w(
496
+ s
497
+ ) : /* @__PURE__ */ T(
480
498
  "button",
481
499
  {
482
500
  type: "button",
483
- className: `widget-filter__search-option${t === n ? " is-selected" : ""}`,
484
- onClick: () => L(n),
501
+ className: `widget-filter__search-option${t === s ? " is-selected" : ""}`,
502
+ onClick: () => M(s),
485
503
  children: [
486
- /* @__PURE__ */ i("span", { className: "widget-filter__search-check", "aria-hidden": !0, children: t === n ? "✓" : "" }),
487
- n
504
+ /* @__PURE__ */ i("span", { className: "widget-filter__search-check", "aria-hidden": !0, children: t === s ? "✓" : "" }),
505
+ s
488
506
  ]
489
507
  },
490
- n
508
+ s
491
509
  )
492
510
  )
493
511
  ] })
@@ -495,74 +513,74 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
495
513
  ),
496
514
  document.body
497
515
  ) : null;
498
- return /* @__PURE__ */ w("div", { className: "widget-filter__search", children: [
516
+ return /* @__PURE__ */ T("div", { className: "widget-filter__search", children: [
499
517
  /* @__PURE__ */ i(
500
518
  "input",
501
519
  {
502
520
  ref: c,
503
521
  type: "text",
504
522
  className: "widget-filter__search-field",
505
- value: G,
506
- placeholder: W,
507
- onFocus: U,
523
+ value: J,
524
+ placeholder: V,
525
+ onFocus: j,
508
526
  onClick: () => o(!0),
509
- onChange: (n) => {
510
- d(n.target.value), o(!0);
527
+ onChange: (s) => {
528
+ d(s.target.value), o(!0);
511
529
  },
512
- onKeyDown: Y
530
+ onKeyDown: z
513
531
  }
514
532
  ),
515
- j
533
+ X
516
534
  ] });
517
535
  }
518
- const oe = [
536
+ const ge = [
519
537
  m.bgDark,
520
538
  m.bgPaper,
521
539
  m.bgElevated,
522
540
  m.accent,
523
541
  m.success
524
542
  ];
525
- function ce(e) {
543
+ function pe(e) {
526
544
  if (!e) return !0;
527
- const t = D(e);
545
+ const t = N(e);
528
546
  return Object.values(v).some(
529
547
  (a) => JSON.stringify(a.colors) === JSON.stringify(t)
530
548
  );
531
549
  }
532
- const le = [
550
+ const me = [
533
551
  { label: "Series", slots: ["series0", "series1", "series2", "series3", "series4"] },
534
552
  { label: "Tema", slots: ["bgDark", "bgPaper", "bgElevated", "textPrimary", "textMuted"] },
535
553
  { label: "Estados", slots: ["accent", "success", "error"] }
536
554
  ];
537
- function je({
555
+ function tt({
538
556
  selected: e,
539
557
  onSelect: t,
540
558
  customMode: a,
541
559
  onCustomModeChange: r,
542
- disabled: s
560
+ disabled: n
543
561
  }) {
544
562
  var h;
545
- const o = a ?? !ce(e), l = D(e), d = o || (h = Object.entries(v).find(
563
+ const o = a ?? !pe(e), l = N(e), d = o || (h = Object.entries(v).find(
546
564
  ([, c]) => JSON.stringify(c.colors) === JSON.stringify(l)
547
565
  )) == null ? void 0 : h[0], f = (c, u) => {
548
566
  const g = [...l];
549
- for (; g.length < N; ) g.push("#000000");
567
+ for (; g.length < L; ) g.push("#000000");
550
568
  g[c] = u, t(g);
551
569
  };
552
- return /* @__PURE__ */ w("div", { className: `palette-selector ${s ? "palette-selector--disabled" : ""}`, children: [
553
- r && /* @__PURE__ */ w("label", { className: "config-panel__checkbox", children: [
570
+ return /* @__PURE__ */ T("div", { className: `palette-selector ${n ? "palette-selector--disabled" : ""}`, children: [
571
+ r && /* @__PURE__ */ T("label", { className: "config-panel__checkbox", children: [
554
572
  /* @__PURE__ */ i(
555
573
  "input",
556
574
  {
557
575
  type: "checkbox",
558
576
  checked: o,
559
577
  onChange: (c) => r(c.target.checked),
560
- disabled: s
578
+ disabled: n
561
579
  }
562
580
  ),
563
581
  "Customizar"
564
582
  ] }),
565
- o ? /* @__PURE__ */ i("div", { className: "palette-selector__custom", children: le.map((c) => /* @__PURE__ */ w("div", { className: "palette-selector__row", children: [
583
+ o ? /* @__PURE__ */ i("div", { className: "palette-selector__custom", children: me.map((c) => /* @__PURE__ */ T("div", { className: "palette-selector__row", children: [
566
584
  /* @__PURE__ */ i("span", { className: "palette-selector__row-label", children: c.label }),
567
585
  /* @__PURE__ */ i("div", { className: "palette-selector__row-slots", children: c.slots.map((u) => {
568
586
  const g = m[u];
@@ -573,36 +591,36 @@ function je({
573
591
  className: "palette-selector__color-input",
574
592
  value: l[g] || "#000000",
575
593
  onChange: (b) => f(g, b.target.value),
576
- disabled: s,
577
- title: Z[u]
594
+ disabled: n,
595
+ title: ne[u]
578
596
  },
579
597
  u
580
598
  );
581
599
  }) })
582
600
  ] }, c.label)) }) : /* @__PURE__ */ i("div", { className: "palette-selector__options", children: Object.entries(v).map(([c, u]) => {
583
- const g = D(u.colors);
584
- return /* @__PURE__ */ w(
601
+ const g = N(u.colors);
602
+ return /* @__PURE__ */ T(
585
603
  "button",
586
604
  {
587
605
  className: `palette-selector__option ${d === c ? "palette-selector__option--active" : ""}`,
588
606
  onClick: () => t(u.colors),
589
- disabled: s,
607
+ disabled: n,
590
608
  children: [
591
- /* @__PURE__ */ i("div", { className: "palette-selector__bar", children: ee(u.colors).map((b, T) => /* @__PURE__ */ i(
609
+ /* @__PURE__ */ i("div", { className: "palette-selector__bar", children: se(u.colors).map((b, S) => /* @__PURE__ */ i(
592
610
  "span",
593
611
  {
594
612
  className: "palette-selector__swatch",
595
613
  style: { backgroundColor: b }
596
614
  },
597
- T
615
+ S
598
616
  )) }),
599
- /* @__PURE__ */ i("div", { className: "palette-selector__bar palette-selector__bar--theme", children: oe.map((b, T) => /* @__PURE__ */ i(
617
+ /* @__PURE__ */ i("div", { className: "palette-selector__bar palette-selector__bar--theme", children: ge.map((b, S) => /* @__PURE__ */ i(
600
618
  "span",
601
619
  {
602
620
  className: "palette-selector__swatch",
603
621
  style: { backgroundColor: g[b] }
604
622
  },
605
- T
623
+ S
606
624
  )) }),
607
625
  /* @__PURE__ */ i("span", { className: "palette-selector__label", children: u.label })
608
626
  ]
@@ -613,53 +631,63 @@ function je({
613
631
  ] });
614
632
  }
615
633
  export {
616
- Ee as A,
617
- Re as B,
618
- Ne as C,
619
- we as D,
620
- be as E,
621
- ve as F,
622
- Ye as G,
623
- y as H,
624
- Ie as I,
625
- Fe as J,
626
- Ue as K,
627
- Oe as L,
628
- Ae as M,
629
- ye as N,
630
- ge as O,
634
+ je as $,
635
+ Pe as A,
636
+ fe as B,
637
+ k as C,
638
+ Le as D,
639
+ ye as E,
640
+ ke as F,
641
+ A as G,
642
+ N as H,
643
+ We as I,
644
+ H as J,
645
+ ze as K,
646
+ Xe as L,
647
+ ue as M,
648
+ xe as N,
649
+ De as O,
631
650
  v as P,
632
- pe as Q,
633
- me as R,
634
- X as S,
635
- N as T,
636
- Q as U,
637
- _e as W,
638
- De as a,
639
- Se as b,
640
- Te as c,
641
- je as d,
642
- xe as e,
643
- Le as f,
644
- ae as g,
645
- re as h,
646
- te as i,
647
- $ as j,
648
- Ge as k,
649
- se as l,
650
- Me as m,
651
- k as n,
652
- m as o,
653
- Z as p,
654
- We as q,
655
- ne as r,
656
- D as s,
657
- Pe as t,
658
- F as u,
659
- ke as v,
660
- $e as w,
661
- he as x,
662
- ee as y,
663
- Ce as z
651
+ se as Q,
652
+ Je as R,
653
+ re as S,
654
+ L as T,
655
+ Ve as U,
656
+ Qe as V,
657
+ Ne as W,
658
+ y as X,
659
+ Ke as Y,
660
+ qe as Z,
661
+ Be as _,
662
+ Ce as a,
663
+ Ee as a0,
664
+ Se as a1,
665
+ we as a2,
666
+ ae as a3,
667
+ Ae as b,
668
+ Me as c,
669
+ ve as d,
670
+ tt as e,
671
+ Ie as f,
672
+ Oe as g,
673
+ ce as h,
674
+ le as i,
675
+ oe as j,
676
+ Y as k,
677
+ Ze as l,
678
+ ie as m,
679
+ C as n,
680
+ x as o,
681
+ He as p,
682
+ Ye as q,
683
+ F as r,
684
+ m as s,
685
+ ne as t,
686
+ et as u,
687
+ $e as v,
688
+ Re as w,
689
+ Fe as x,
690
+ Ge as y,
691
+ Ue as z
664
692
  };
665
- //# sourceMappingURL=ColorPaletteSelector-Bsda66uL.js.map
693
+ //# sourceMappingURL=ColorPaletteSelector-BSAe2YMH.js.map