@base-framework/ui 1.0.216 → 1.0.218

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,22 +1,22 @@
1
- import { Button as k, Div as o, On as v, Span as D, Th as O, UseParent as F, I as E, Thead as Q, Tr as X, Table as L, P as p, Li as S, Time as q, Nav as I, Ul as w, Section as z, Canvas as K } from "@base-framework/atoms";
2
- import { Atom as d, Component as h, Data as C, DateTime as G, router as y, NavLink as $, DataTracker as N, Jot as V, base as M, Dom as R } from "@base-framework/base";
3
- import { B as T, I as _ } from "./buttons-Cm9etaEG.js";
4
- import { Icons as x } from "./icons.es.js";
5
- import { TableBody as J, DataTableBody as Z, ScrollableTableBody as ee, List as te, IntervalTimer as se } from "@base-framework/organisms";
6
- import { C as ae, I as ie, H as ne } from "./inputs-CMjx5-IX.js";
7
- import { A as oe, P as le } from "./calendar-Bn55oWBo.js";
8
- d((t, e) => ({
1
+ import { Button as v, Div as o, On as D, Span as S, OnState as X, Th as j, UseParent as q, I as K, Thead as G, Tr as _, Table as R, P as b, Li as C, Time as V, Nav as I, Ul as x, Section as Y, Canvas as J } from "@base-framework/atoms";
2
+ import { Atom as f, Component as g, Data as L, DateTime as A, router as k, NavLink as H, DataTracker as F, Jot as Z, base as W, Dom as O } from "@base-framework/base";
3
+ import { B as m, I as ee } from "./buttons-Cm9etaEG.js";
4
+ import { Icons as w } from "./icons.es.js";
5
+ import { F as te, A as se, P as ae } from "./calendar-Bn55oWBo.js";
6
+ import { TableBody as ne, DataTableBody as ie, ScrollableTableBody as oe, List as le, IntervalTimer as re } from "@base-framework/organisms";
7
+ import { C as ce, I as de, H as he } from "./inputs-CMjx5-IX.js";
8
+ f((t, e) => ({
9
9
  class: "flex items-center px-4 py-2",
10
10
  ...t,
11
11
  children: e
12
12
  }));
13
- d(({ value: t, label: e }) => k({
13
+ f(({ value: t, label: e }) => v({
14
14
  class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-md px-8 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
15
15
  onState: ["performance", { active: t }],
16
16
  dataSet: ["performance", ["state", t, "active"]],
17
17
  click: (s, { state: a }) => a.performance = t
18
18
  }, e));
19
- class at extends h {
19
+ class pt extends g {
20
20
  /**
21
21
  * This will declare the props for the compiler.
22
22
  *
@@ -34,77 +34,77 @@ class at extends h {
34
34
  return o({ class: this.class || "" }, this.children);
35
35
  }
36
36
  }
37
- const re = (t) => {
37
+ const ue = (t) => {
38
38
  const e = new Date(t, 11, 31), s = new Date(t, 0, 1);
39
39
  return e.getDay() === 4 || // December 31 is a Thursday
40
40
  s.getDay() === 4;
41
- }, ce = (t) => {
41
+ }, fe = (t) => {
42
42
  const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
43
43
  e.setDate(e.getDate() - s + 3);
44
- const a = e.getFullYear(), i = new Date(a, 0, 4);
45
- i.setDate(i.getDate() - (i.getDay() + 6) % 7);
46
- const n = Math.ceil((e - i) / 6048e5) + 1;
47
- return n > 52 && !re(a) ? {
44
+ const a = e.getFullYear(), n = new Date(a, 0, 4);
45
+ n.setDate(n.getDate() - (n.getDay() + 6) % 7);
46
+ const i = Math.ceil((e - n) / 6048e5) + 1;
47
+ return i > 52 && !ue(a) ? {
48
48
  weekNumber: 1,
49
49
  year: a + 1
50
50
  } : {
51
- weekNumber: n,
51
+ weekNumber: i,
52
52
  year: a
53
53
  };
54
- }, de = (t, e, s) => {
54
+ }, ge = (t, e, s) => {
55
55
  if (s === 0) return [];
56
56
  const a = new Date(t, e, 0).getDate();
57
57
  return Array.from(
58
58
  { length: s },
59
- (i, n) => new Date(t, e - 1, a - s + n + 1)
59
+ (n, i) => new Date(t, e - 1, a - s + i + 1)
60
60
  );
61
- }, he = (t, e, s) => Array.from({ length: s }, (a, i) => new Date(t, e + 1, i + 1)), W = (t, e) => {
62
- const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7, i = new Date(s);
63
- i.setDate(s.getDate() - a);
64
- const n = new Date(i);
65
- return n.setDate(i.getDate() + (t - 1) * 7), n;
66
- }, it = (t, e) => {
67
- const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = [];
68
- let n = [];
61
+ }, me = (t, e, s) => Array.from({ length: s }, (a, n) => new Date(t, e + 1, n + 1)), $ = (t, e) => {
62
+ const s = new Date(e, 0, 4), a = (s.getDay() + 6) % 7, n = new Date(s);
63
+ n.setDate(s.getDate() - a);
64
+ const i = new Date(n);
65
+ return i.setDate(n.getDate() + (t - 1) * 7), i;
66
+ }, yt = (t, e) => {
67
+ const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), n = [];
68
+ let i = [];
69
69
  for (let l = 1 - s; l <= a; l++) {
70
70
  const u = new Date(t, e, l);
71
- n.push(l > 0 ? u : null), (n.length === 7 || l === a) && (i.push([...n]), n = []);
71
+ i.push(l > 0 ? u : null), (i.length === 7 || l === a) && (n.push([...i]), i = []);
72
72
  }
73
- return i;
74
- }, nt = (t, e) => {
73
+ return n;
74
+ }, wt = (t, e) => {
75
75
  const s = new Date(t, e + 1, 0).getDate(), a = [];
76
- let i = [];
77
- for (let n = 1; n <= s; n++)
78
- i.push(new Date(t, e, n)), i.length === 7 && (a.push(i), i = []);
79
- return i.length > 0 && a.push(i), a;
80
- }, ue = (t, e, s) => {
76
+ let n = [];
77
+ for (let i = 1; i <= s; i++)
78
+ n.push(new Date(t, e, i)), n.length === 7 && (a.push(n), n = []);
79
+ return n.length > 0 && a.push(n), a;
80
+ }, pe = (t, e, s) => {
81
81
  const a = /* @__PURE__ */ new Date();
82
82
  return a.getDate() === t && a.getMonth() === e && a.getFullYear() === s;
83
- }, fe = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: i }) => {
84
- const n = ue(t, e, s);
85
- return k({
83
+ }, ye = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: n }) => {
84
+ const i = pe(t, e, s);
85
+ return v({
86
86
  text: t || "",
87
87
  disabled: !t,
88
88
  class: `
89
89
  px-2 py-1 text-center rounded-md
90
- ${n ? "bg-accent text-accent-foreground" : ""}
90
+ ${i ? "bg-accent text-accent-foreground" : ""}
91
91
  hover:bg-primary hover:text-primary-foreground
92
92
  `,
93
- click: () => i(a, s)
93
+ click: () => n(a, s)
94
94
  });
95
- }, ge = (t, e) => {
96
- const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = de(t, e, s), n = Array.from({ length: a }, (r, m) => new Date(t, e, m + 1)), l = (i.length + n.length) % 7, u = l === 0 ? 0 : 7 - l, c = he(t, e, u), f = [...i, ...n, ...c], g = [];
97
- for (let r = 0; r < f.length; r += 7) {
98
- const m = f.slice(r, r + 7), b = m.find((H) => H) || new Date(t, e, 1), { weekNumber: U, year: Y } = ce(b);
99
- g.push({
100
- weekNumber: U,
101
- year: Y,
102
- days: m
95
+ }, we = (t, e) => {
96
+ const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), n = ge(t, e, s), i = Array.from({ length: a }, (d, p) => new Date(t, e, p + 1)), l = (n.length + i.length) % 7, u = l === 0 ? 0 : 7 - l, r = me(t, e, u), c = [...n, ...i, ...r], h = [];
97
+ for (let d = 0; d < c.length; d += 7) {
98
+ const p = c.slice(d, d + 7), y = p.find((M) => M) || new Date(t, e, 1), { weekNumber: T, year: B } = fe(y);
99
+ h.push({
100
+ weekNumber: T,
101
+ year: B,
102
+ days: p
103
103
  });
104
104
  }
105
- return g;
106
- }, me = ({ selectWeek: t }) => v("month", (e, s, { data: a }) => {
107
- const { year: i, month: n, currentDate: l } = a, u = ge(i, n);
105
+ return h;
106
+ }, be = ({ selectWeek: t }) => D("month", (e, s, { data: a }) => {
107
+ const { year: n, month: i, currentDate: l } = a, u = we(n, i);
108
108
  return o(
109
109
  { class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
110
110
  [
@@ -115,37 +115,37 @@ const re = (t) => {
115
115
  class: "grid grid-cols-7 col-span-7 text-center text-muted-foreground items-center"
116
116
  },
117
117
  ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
118
- (c) => D({ class: "px-1 py-1", text: c })
118
+ (r) => S({ class: "px-1 py-1", text: r })
119
119
  )
120
120
  ),
121
121
  // Render each "week" row
122
122
  ...u.map(
123
- ({ weekNumber: c, days: f, year: g }) => o({
123
+ ({ weekNumber: r, days: c, year: h }) => o({
124
124
  class: "grid grid-cols-8 col-span-8 items-center ring-primary rounded-sm px-1",
125
125
  onSet: ["currentWeek", {
126
- ring: c
126
+ ring: r
127
127
  }]
128
128
  }, [
129
129
  // Left column: ISO week number
130
130
  o({
131
131
  class: "font-medium text-center col-span-1 rounded-sm cursor-pointer",
132
- click: () => t(c, g),
132
+ click: () => t(r, h),
133
133
  // If you have a 'currentWeek' state, you can highlight it with 'onSet'
134
134
  onSet: ["currentWeek", {
135
- "text-primary-foreground": c,
136
- "bg-primary": c
135
+ "text-primary-foreground": r,
136
+ "bg-primary": r
137
137
  }],
138
- text: c ? `W${c}` : ""
138
+ text: r ? `W${r}` : ""
139
139
  }),
140
140
  // The 7 cells for each day in the row
141
141
  o(
142
142
  { class: "grid grid-cols-7 col-span-7 text-center" },
143
- f.map(
144
- (r) => fe({
145
- year: (r == null ? void 0 : r.getFullYear()) || null,
146
- month: (r == null ? void 0 : r.getMonth()) || null,
147
- day: (r == null ? void 0 : r.getDate()) || null,
148
- weekNumber: c,
143
+ c.map(
144
+ (d) => ye({
145
+ year: (d == null ? void 0 : d.getFullYear()) || null,
146
+ month: (d == null ? void 0 : d.getMonth()) || null,
147
+ day: (d == null ? void 0 : d.getDate()) || null,
148
+ weekNumber: r,
149
149
  selectWeek: t
150
150
  })
151
151
  )
@@ -154,7 +154,7 @@ const re = (t) => {
154
154
  )
155
155
  ]
156
156
  );
157
- }), P = ({ label: t, click: e }) => T(
157
+ }), z = ({ label: t, click: e }) => m(
158
158
  {
159
159
  class: `
160
160
  inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
@@ -165,20 +165,20 @@ const re = (t) => {
165
165
  click: e,
166
166
  "aria-label": `${t} month`,
167
167
  variant: "icon",
168
- icon: t === "Previous" ? x.chevron.single.left : x.chevron.single.right
168
+ icon: t === "Previous" ? w.chevron.single.left : w.chevron.single.right
169
169
  }
170
- ), pe = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
171
- D("[[monthName]] [[year]]"),
172
- P({
170
+ ), xe = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
171
+ S("[[monthName]] [[year]]"),
172
+ z({
173
173
  label: "Previous",
174
174
  click: e
175
175
  }),
176
- P({
176
+ z({
177
177
  label: "Next",
178
178
  click: t
179
179
  })
180
180
  ]);
181
- class ot extends h {
181
+ class bt extends g {
182
182
  /**
183
183
  * This will declare the props for the compiler.
184
184
  *
@@ -193,8 +193,8 @@ class ot extends h {
193
193
  * @returns {Data}
194
194
  */
195
195
  setData() {
196
- const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = W(s, e.getFullYear());
197
- return new C({
196
+ const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = $(s, e.getFullYear());
197
+ return new L({
198
198
  monthName: this.getMonthName(a.getMonth()),
199
199
  year: a.getFullYear(),
200
200
  month: a.getMonth(),
@@ -221,8 +221,8 @@ class ot extends h {
221
221
  calculateCurrentWeek(e) {
222
222
  const s = new Date(e.valueOf()), a = (e.getDay() + 6) % 7;
223
223
  s.setDate(s.getDate() - a + 3);
224
- const i = s.valueOf();
225
- return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((i - s) / 6048e5);
224
+ const n = s.valueOf();
225
+ return s.setMonth(0, 1), s.getDay() !== 4 && s.setMonth(0, 1 + (4 - s.getDay() + 7) % 7), 1 + Math.ceil((n - s) / 6048e5);
226
226
  }
227
227
  /**
228
228
  * Gets the name of the month.
@@ -231,7 +231,7 @@ class ot extends h {
231
231
  * @returns {string}
232
232
  */
233
233
  getMonthName(e) {
234
- return G.monthNames[e];
234
+ return A.monthNames[e];
235
235
  }
236
236
  /**
237
237
  * Updates the calendar to show the previous month.
@@ -276,7 +276,7 @@ class ot extends h {
276
276
  */
277
277
  selectWeek(e, s) {
278
278
  this.data.currentWeek = e;
279
- const a = W(e, s);
279
+ const a = $(e, s);
280
280
  this.setDate(a.getMonth(), a.getFullYear(), a.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(e);
281
281
  }
282
282
  /**
@@ -286,38 +286,262 @@ class ot extends h {
286
286
  */
287
287
  render() {
288
288
  return o({ class: "week-calendar-container border rounded-md bg-background p-3" }, [
289
- pe({
289
+ xe({
290
290
  next: () => this.goToNextMonth(),
291
291
  previous: () => this.goToPreviousMonth()
292
292
  }),
293
- me({
293
+ be({
294
294
  selectWeek: (e, s) => this.selectWeek(e, s)
295
295
  })
296
296
  ]);
297
297
  }
298
298
  }
299
- const we = (t, e) => {
299
+ const N = ({ label: t, click: e }) => m(
300
+ {
301
+ class: `
302
+ inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
303
+ opacity-50 hover:opacity-100 text-muted-foreground absolute
304
+ ${t === "Previous" ? "left-1" : "right-1"}
305
+ focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
306
+ `,
307
+ click: e,
308
+ "aria-label": `${t} month`,
309
+ variant: "icon",
310
+ icon: t === "Previous" ? w.chevron.single.left : w.chevron.single.right
311
+ }
312
+ ), ke = ({ onMonthClick: t, onYearClick: e, next: s, previous: a }) => o({ class: "flex items-center justify-center space-x-2 relative min-h-12 text-sm font-medium" }, [
313
+ m({ click: t, variant: "ghost", "aria-label": "Select month" }, "[[monthName]]"),
314
+ m({ click: e, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
315
+ N({ label: "Previous", click: a }),
316
+ N({ label: "Next", click: s })
317
+ ]), ve = (t) => o({ class: "py-1" }, t), De = () => o(
318
+ { class: "grid grid-cols-7 text-center text-sm font-medium text-muted-foreground mb-1" },
319
+ ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(ve)
320
+ ), Se = ({ day: t, iso: e, disabled: s, isStart: a, isEnd: n, isBetween: i, click: l }) => m(
321
+ {
322
+ class: "flex items-center justify-center h-9 p-0 text-sm rounded-md " + (a || n ? "bg-primary text-primary-foreground" : i ? "bg-muted text-foreground" : ""),
323
+ disabled: s,
324
+ click: () => !s && l(e)
325
+ },
326
+ t.toString()
327
+ ), Ce = ({ cells: t }) => o(
328
+ { class: "grid grid-cols-7 gap-1" },
329
+ t.map(
330
+ (e) => Se({
331
+ day: e.day,
332
+ iso: e.iso,
333
+ disabled: e.disabled,
334
+ isStart: e.isStart,
335
+ isEnd: e.isEnd,
336
+ isBetween: e.isBetween,
337
+ click: e.click
338
+ })
339
+ )
340
+ ), Ie = f((t, e) => o({ class: "fex flex-auto flex-col" }, [
341
+ ke({
342
+ onMonthClick: t.onMonthClick,
343
+ onYearClick: t.onYearClick,
344
+ next: t.next,
345
+ previous: t.previous
346
+ }),
347
+ o({
348
+ class: "flex flex-auto flex-col w-full",
349
+ onSet: [
350
+ "currentDate",
351
+ () => [
352
+ De(),
353
+ Ce({ cells: t.cells })
354
+ ]
355
+ ]
356
+ })
357
+ ])), Le = ({ currentMonth: t, currentYear: e, onSelect: s }) => o(
358
+ { class: "grid grid-cols-3 gap-2" },
359
+ A.monthNames.map(
360
+ (a, n) => m(
361
+ {
362
+ click: (i) => {
363
+ i.preventDefault(), i.stopPropagation(), s(n);
364
+ },
365
+ variant: t === n ? "primary" : "ghost",
366
+ "aria-label": `Select ${a} ${e}`
367
+ },
368
+ a.substring(0, 3)
369
+ )
370
+ )
371
+ ), Te = ({ start: t, end: e, selecting: s, onSelectStart: a, onSelectEnd: n }) => o({ class: "flex space-x-2 mb-3" }, [
372
+ m(
373
+ { click: a, variant: s === "start" ? "primary" : "ghost" },
374
+ t ? `Start: ${t}` : "Select start"
375
+ ),
376
+ m(
377
+ { click: n, variant: s === "end" ? "primary" : "ghost" },
378
+ e ? `End: ${e}` : "Select end"
379
+ )
380
+ ]), Be = ({ currentYear: t, onSelect: e }) => {
381
+ const s = t - 50, a = Array.from({ length: 101 }, (n, i) => s + i);
382
+ return o(
383
+ { class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
384
+ a.map(
385
+ (n) => m(
386
+ {
387
+ click: (i) => {
388
+ i.preventDefault(), i.stopPropagation(), e(n);
389
+ },
390
+ variant: n === t ? "primary" : "ghost",
391
+ "aria-label": `Select ${n}`
392
+ },
393
+ n.toString()
394
+ )
395
+ )
396
+ );
397
+ };
398
+ class xt extends g {
399
+ /**
400
+ * Declare compiler props.
401
+ *
402
+ * @returns {void}
403
+ */
404
+ declareProps() {
405
+ this.startDate = null, this.endDate = null, this.onRangeSelect = null, this.blockPriorDates = !1;
406
+ }
407
+ /**
408
+ * Initialize reactive data for today and current view.
409
+ *
410
+ * @returns {Data}
411
+ */
412
+ setData() {
413
+ const e = /* @__PURE__ */ new Date();
414
+ return new L({
415
+ today: {
416
+ date: e.getDate(),
417
+ month: e.getMonth(),
418
+ year: e.getFullYear()
419
+ },
420
+ current: {
421
+ date: e.getDate(),
422
+ month: e.getMonth(),
423
+ year: e.getFullYear()
424
+ }
425
+ });
426
+ }
427
+ /**
428
+ * Initialize component state.
429
+ *
430
+ * @returns {{view:string,selecting:string,start:string|null,end:string|null}}
431
+ */
432
+ setupStates() {
433
+ return {
434
+ view: "calendar",
435
+ // 'calendar', 'months', or 'years'
436
+ selecting: "start",
437
+ start: this.startDate,
438
+ end: this.endDate
439
+ };
440
+ }
441
+ /**
442
+ * Handle a date cell click.
443
+ *
444
+ * @param {string} isoDate
445
+ * @returns {void}
446
+ */
447
+ handleClick(e) {
448
+ this.state.selecting === "start" ? (this.state.start = e, this.state.end = null, this.state.selecting = "end") : (this.state.end = e, this.state.selecting = "start", typeof this.onRangeSelect == "function" && this.onRangeSelect(this.state.start, this.state.end));
449
+ }
450
+ /**
451
+ * Update current month/year in data.
452
+ *
453
+ * @param {{month:number,year:number}} obj
454
+ * @returns {void}
455
+ */
456
+ setCurrent({ month: e, year: s }) {
457
+ const a = this.data.current;
458
+ a.month = (e + 12) % 12, a.year = s + (e < 0 ? -1 : e > 11 ? 1 : 0);
459
+ }
460
+ /**
461
+ * Render the range calendar.
462
+ *
463
+ * @returns {object}
464
+ */
465
+ render() {
466
+ const { today: e, current: s } = this.data, { start: a, end: n, selecting: i } = this.state, l = new Date(s.year, s.month, 1).getDay(), u = new Date(s.year, s.month + 1, 0).getDate(), r = [];
467
+ for (let c = 0; c < l; c++)
468
+ r.push(null);
469
+ for (let c = 1; c <= u; c++) {
470
+ const h = te(s.year, s.month, c), p = /* @__PURE__ */ new Date(h + "T00:00:00") < new Date(e.year, e.month, e.date), y = this.blockPriorDates && p, T = a === h, B = n === h, M = a && n && h > a && h < n;
471
+ r.push({
472
+ day: c,
473
+ iso: h,
474
+ disabled: y,
475
+ isStart: T,
476
+ isEnd: B,
477
+ isBetween: M,
478
+ click: (Q) => this.handleClick(Q)
479
+ });
480
+ }
481
+ return o({ class: "range-calendar p-4 rounded-md border min-w-80" }, [
482
+ Te({
483
+ start: a,
484
+ end: n,
485
+ selecting: i,
486
+ onSelectStart: () => this.state.selecting = "start",
487
+ onSelectEnd: () => this.state.selecting = "end"
488
+ }),
489
+ X("view", (c) => {
490
+ switch (c) {
491
+ case "months":
492
+ return Le(
493
+ {
494
+ currentMonth: s.month,
495
+ currentYear: s.year,
496
+ onSelect: (h) => {
497
+ this.setCurrent({ month: h, year: s.year }), this.state.view = "calendar";
498
+ }
499
+ }
500
+ );
501
+ case "years":
502
+ return Be(
503
+ {
504
+ currentYear: s.year,
505
+ onSelect: (h) => {
506
+ this.setCurrent({ month: s.month, year: h }), this.state.view = "calendar";
507
+ }
508
+ }
509
+ );
510
+ default:
511
+ return Ie({
512
+ onMonthClick: () => this.state.view = "months",
513
+ onYearClick: () => this.state.view = "years",
514
+ next: () => this.setCurrent({ month: s.month + 1, year: s.year }),
515
+ previous: () => this.setCurrent({ month: s.month - 1, year: s.year }),
516
+ cells: r
517
+ });
518
+ }
519
+ })
520
+ ]);
521
+ }
522
+ }
523
+ const Me = (t, e) => {
300
524
  const s = t.toggleAllSelectedRows();
301
525
  e.state.checked = !s;
302
- }, be = (t) => O({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
303
- F((e) => new ae({ class: "mr-2", onChange: (s, a) => we(e, a) }))
304
- ]), ye = ({ align: t, sortable: e, key: s, label: a, sort: i, class: n }) => {
526
+ }, Re = (t) => j({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
527
+ q((e) => new ce({ class: "mr-2", onChange: (s, a) => Me(e, a) }))
528
+ ]), Pe = ({ align: t, sortable: e, key: s, label: a, sort: n, class: i }) => {
305
529
  const l = t || "justify-start";
306
- return O({
307
- class: `cursor-pointer py-3 px-4 text-base ${n || ""}`,
308
- click: e && (() => i(s))
530
+ return j({
531
+ class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
532
+ click: e && (() => n(s))
309
533
  }, [
310
534
  o({ class: `flex flex-auto w-full items-center ${l}` }, [
311
- D(a),
312
- e && E({ class: "ml-2", html: x.arrows.upDown })
535
+ S(a),
536
+ e && K({ class: "ml-2", html: w.arrows.upDown })
313
537
  ])
314
538
  ]);
315
- }, B = (t) => Q([
316
- X({
539
+ }, P = (t) => G([
540
+ _({
317
541
  class: "text-muted-foreground border-b",
318
542
  map: [
319
543
  t.headers,
320
- (e) => e.label === "checkbox" ? be({ toggle: t.toggle }) : ye({
544
+ (e) => e.label === "checkbox" ? Re({ toggle: t.toggle }) : Pe({
321
545
  align: e.align,
322
546
  sortable: e.sortable,
323
547
  key: e.key,
@@ -326,15 +550,15 @@ const we = (t, e) => {
326
550
  })
327
551
  ]
328
552
  })
329
- ]), xe = ({ key: t, rows: e, selectRow: s, rowItem: a, emptyState: i }) => new J({
553
+ ]), We = ({ key: t, rows: e, selectRow: s, rowItem: a, emptyState: n }) => new ne({
330
554
  cache: "list",
331
555
  key: t,
332
556
  items: e,
333
- rowItem: (n) => a(n, s),
557
+ rowItem: (i) => a(i, s),
334
558
  class: "divide-y divide-border",
335
- emptyState: i
559
+ emptyState: n
336
560
  });
337
- class j extends h {
561
+ class U extends g {
338
562
  /**
339
563
  * Initializes component data.
340
564
  *
@@ -342,7 +566,7 @@ class j extends h {
342
566
  */
343
567
  setData() {
344
568
  let e = this.rows && this.rows.length > 0;
345
- return (this.loadMoreItems || this.tableData) && !e && (e = null), new C({
569
+ return (this.loadMoreItems || this.tableData) && !e && (e = null), new L({
346
570
  selectedRows: [],
347
571
  // @ts-ignore
348
572
  hasItems: e,
@@ -394,8 +618,8 @@ class j extends h {
394
618
  selectRow(e) {
395
619
  const s = e.selected ?? !1;
396
620
  e.selected = !s;
397
- const a = this.data.get("selectedRows"), i = e.selected ? [...a, e] : a.filter((n) => n !== e);
398
- this.data.selectedRows = i, this.updateSelected();
621
+ const a = this.data.get("selectedRows"), n = e.selected ? [...a, e] : a.filter((i) => i !== e);
622
+ this.data.selectedRows = n, this.updateSelected();
399
623
  }
400
624
  /**
401
625
  * Renders the DataTable component.
@@ -405,14 +629,14 @@ class j extends h {
405
629
  render() {
406
630
  const e = this.rows, s = this.border !== !1 ? "border" : "";
407
631
  return o({ class: "w-full flex flex-auto flex-col" }, [
408
- v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
632
+ D("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
409
633
  o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
410
- L({ class: "w-full" }, [
634
+ R({ class: "w-full" }, [
411
635
  // @ts-ignore
412
- this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
636
+ this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
413
637
  // @ts-ignore
414
638
  this.customHeader ?? null,
415
- xe({
639
+ We({
416
640
  // @ts-ignore
417
641
  key: this.key,
418
642
  rows: e,
@@ -487,7 +711,7 @@ class j extends h {
487
711
  this.data.selectedRows = [];
488
712
  }
489
713
  }
490
- const ke = (t) => new Z({
714
+ const Oe = (t) => new ie({
491
715
  cache: "list",
492
716
  loadMoreItems: t.loadMoreItems,
493
717
  offset: t.offset,
@@ -498,7 +722,7 @@ const ke = (t) => new Z({
498
722
  rowItem: (e) => t.rowItem(e, t.selectRow),
499
723
  class: "divide-y divide-border"
500
724
  });
501
- class ve extends j {
725
+ class $e extends U {
502
726
  /**
503
727
  * Renders the DataTable component.
504
728
  *
@@ -507,14 +731,14 @@ class ve extends j {
507
731
  render() {
508
732
  const e = this.rows, s = this.border !== !1 ? "border" : "";
509
733
  return o({ class: "w-full flex flex-auto flex-col" }, [
510
- v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
734
+ D("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
511
735
  o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
512
- L({ class: "w-full" }, [
736
+ R({ class: "w-full" }, [
513
737
  // @ts-ignore
514
- this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
738
+ this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
515
739
  // @ts-ignore
516
740
  this.customHeader ?? null,
517
- ke({
741
+ Oe({
518
742
  // @ts-ignore
519
743
  loadMoreItems: this.loadMoreItems,
520
744
  // @ts-ignore
@@ -546,7 +770,7 @@ class ve extends j {
546
770
  this.list.refresh();
547
771
  }
548
772
  }
549
- const lt = d((t) => new ve(
773
+ const kt = f((t) => new $e(
550
774
  {
551
775
  cache: t.cache ?? "list",
552
776
  tableData: t.data,
@@ -562,7 +786,7 @@ const lt = d((t) => new ve(
562
786
  border: t.border,
563
787
  emptyState: t.emptyState
564
788
  }
565
- )), De = (t) => new ee({
789
+ )), ze = (t) => new oe({
566
790
  cache: "list",
567
791
  scrollContainer: t.scrollContainer,
568
792
  loadMoreItems: t.loadMoreItems,
@@ -574,7 +798,7 @@ const lt = d((t) => new ve(
574
798
  rowItem: (e) => t.rowItem(e, t.selectRow),
575
799
  class: "divide-y divide-border"
576
800
  });
577
- class Se extends j {
801
+ class Ne extends U {
578
802
  /**
579
803
  * Renders the DataTable component.
580
804
  *
@@ -583,14 +807,14 @@ class Se extends j {
583
807
  render() {
584
808
  const e = this.rows, s = this.border !== !1 ? "border" : "";
585
809
  return o({ class: "w-full flex flex-auto flex-col" }, [
586
- v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
810
+ D("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
587
811
  o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
588
- L({ class: "w-full" }, [
812
+ R({ class: "w-full" }, [
589
813
  // @ts-ignore
590
- this.headers && B({ headers: this.headers, sort: (a) => this.sortRows(a) }),
814
+ this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
591
815
  // @ts-ignore
592
816
  this.customHeader ?? null,
593
- De({
817
+ ze({
594
818
  // @ts-ignore
595
819
  scrollContainer: this.scrollContainer,
596
820
  // @ts-ignore
@@ -624,7 +848,7 @@ class Se extends j {
624
848
  this.list.refresh();
625
849
  }
626
850
  }
627
- const rt = d((t) => new Se(
851
+ const vt = f((t) => new Ne(
628
852
  {
629
853
  cache: t.cache ?? "list",
630
854
  tableData: t.data,
@@ -641,45 +865,45 @@ const rt = d((t) => new Se(
641
865
  border: t.border,
642
866
  emptyState: t.emptyState
643
867
  }
644
- )), Ie = d(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
645
- p({ class: "text-base font-semibold leading-6 m-0" }, t),
646
- p({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
647
- ])), Le = () => o({ class: "flex items-center gap-x-1.5" }, [
868
+ )), je = f(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
869
+ b({ class: "text-base font-semibold leading-6 m-0" }, t),
870
+ b({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
871
+ ])), Ye = () => o({ class: "flex items-center gap-x-1.5" }, [
648
872
  o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
649
873
  o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
650
874
  ]),
651
- p({ class: "text-xs leading-5 text-gray-500" }, "Online")
652
- ]), Ce = (t) => p({ class: "text-xs leading-5 text-muted-foreground" }, [
653
- D("Last seen "),
654
- q({ datetime: t }, "3h ago")
655
- ]), Te = (t, e) => t === "online" ? Le() : Ce(e), Be = d(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
656
- p({ class: "text-sm leading-6 m-0" }, t),
657
- Te(s, e)
658
- ])), Me = (t) => t.split(" ").map((s) => s[0]).join(""), Re = d((t) => S({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
875
+ b({ class: "text-xs leading-5 text-gray-500" }, "Online")
876
+ ]), Ae = (t) => b({ class: "text-xs leading-5 text-muted-foreground" }, [
877
+ S("Last seen "),
878
+ V({ datetime: t }, "3h ago")
879
+ ]), He = (t, e) => t === "online" ? Ye() : Ae(e), Fe = f(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
880
+ b({ class: "text-sm leading-6 m-0" }, t),
881
+ He(s, e)
882
+ ])), Ue = (t) => t.split(" ").map((s) => s[0]).join(""), Ee = f((t) => C({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
659
883
  o({ class: "flex min-w-0 gap-x-4" }, [
660
- oe({ src: t.image, alt: t.name, fallbackText: Me(t.name) }),
661
- Ie({ name: t.name, email: t.email })
884
+ se({ src: t.image, alt: t.name, fallbackText: Ue(t.name) }),
885
+ je({ name: t.name, email: t.email })
662
886
  ]),
663
- Be({
887
+ Fe({
664
888
  role: t.role,
665
889
  lastSeen: t.lastSeen,
666
890
  status: t.status
667
891
  })
668
- ])), ct = d((t) => new te({
892
+ ])), Dt = f((t) => new le({
669
893
  cache: "list",
670
894
  key: "name",
671
895
  items: t.users,
672
896
  role: "list",
673
897
  class: "divide-y divide-border",
674
- rowItem: Re
675
- })), We = (t, e) => e.includes(t), Pe = (t, e, s) => t.exact ? s === e : We(e, s), Oe = ({ text: t, href: e, exact: s, hidden: a }) => new $({
898
+ rowItem: Ee
899
+ })), Qe = (t, e) => e.includes(t), Xe = (t, e, s) => t.exact ? s === e : Qe(e, s), qe = ({ text: t, href: e, exact: s, hidden: a }) => new H({
676
900
  text: t,
677
901
  href: e,
678
902
  exact: s,
679
903
  dataSet: ["selected", ["state", !0, "active"]],
680
904
  class: `${a ? "hidden" : "inline-flex"} items-center justify-center whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring focus-visible:ring-offset-background hover:bg-primary hover:text-primary-foreground disabled:opacity-50 disabled:pointer-events-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`
681
905
  });
682
- class dt extends h {
906
+ class St extends g {
683
907
  /**
684
908
  * This will declare the props for the compiler.
685
909
  *
@@ -703,11 +927,11 @@ class dt extends h {
703
927
  return I(
704
928
  { class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
705
929
  [
706
- w({
930
+ x({
707
931
  class: "flex space-x-4",
708
932
  map: [this.options, (e) => this.addLink(e)],
709
933
  watch: {
710
- value: ["[[path]]", y.data],
934
+ value: ["[[path]]", k.data],
711
935
  callBack: this.updateLinks.bind(this)
712
936
  }
713
937
  })
@@ -720,7 +944,7 @@ class dt extends h {
720
944
  * @returns {void}
721
945
  */
722
946
  afterSetup() {
723
- const e = y.data.path;
947
+ const e = k.data.path;
724
948
  this.updateLinks(e);
725
949
  }
726
950
  /**
@@ -735,7 +959,7 @@ class dt extends h {
735
959
  for (const a of this.links) {
736
960
  if (!a.rendered)
737
961
  continue;
738
- Pe(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
962
+ Xe(a, a.getLinkPath(), e) ? (this.updateLink(a, !0), s = !0) : this.updateLink(a, !1);
739
963
  }
740
964
  !s && this.links[0] && this.updateLink(this.links[0], !0);
741
965
  }
@@ -764,9 +988,9 @@ class dt extends h {
764
988
  * @param {object} option
765
989
  * @returns {object}
766
990
  */
767
- addLink({ label: e, href: s, exact: a, hidden: i }) {
768
- const n = Oe({ text: e, href: s, exact: a, hidden: i });
769
- return this.links.push(n), n;
991
+ addLink({ label: e, href: s, exact: a, hidden: n }) {
992
+ const i = qe({ text: e, href: s, exact: a, hidden: n });
993
+ return this.links.push(i), i;
770
994
  }
771
995
  /**
772
996
  * This will clear the links.
@@ -777,13 +1001,13 @@ class dt extends h {
777
1001
  this.links = [];
778
1002
  }
779
1003
  }
780
- const ht = d((t) => {
1004
+ const Ct = f((t) => {
781
1005
  const e = t.margin || "m-4 ml-0";
782
1006
  return t.allowHistory = t.allowHistory === !0, o({ class: `flex-none ${e}` }, [
783
- T({ variant: "back", class: "ghost", ...t })
1007
+ m({ variant: "back", class: "ghost", ...t })
784
1008
  ]);
785
1009
  });
786
- class A extends h {
1010
+ class E extends g {
787
1011
  /**
788
1012
  * This will declare the props for the compiler.
789
1013
  *
@@ -870,13 +1094,13 @@ class A extends h {
870
1094
  return this.children;
871
1095
  }
872
1096
  }
873
- N.addType("dockableOverlay", (t) => {
1097
+ F.addType("dockableOverlay", (t) => {
874
1098
  if (!t)
875
1099
  return;
876
1100
  const e = t.component;
877
1101
  e && e.rendered === !0 && e.state.docked === !1 && e.destroy();
878
1102
  });
879
- class ut extends A {
1103
+ class It extends E {
880
1104
  /**
881
1105
  * This will stop presistence.
882
1106
  *
@@ -942,7 +1166,7 @@ class ut extends A {
942
1166
  * @returns {void}
943
1167
  */
944
1168
  afterSetup() {
945
- N.add(
1169
+ F.add(
946
1170
  this.container,
947
1171
  "dockableOverlay",
948
1172
  {
@@ -985,7 +1209,7 @@ class ut extends A {
985
1209
  document.documentElement.style.overflowY = "auto";
986
1210
  }
987
1211
  }
988
- class ft extends A {
1212
+ class Lt extends E {
989
1213
  /**
990
1214
  * This will get the overlay type.
991
1215
  *
@@ -1004,7 +1228,7 @@ class ft extends A {
1004
1228
  this.container = e, this.initialize();
1005
1229
  }
1006
1230
  }
1007
- const ze = d(({ index: t, click: e, state: s }, a) => S({
1231
+ const Ke = f(({ index: t, click: e, state: s }, a) => C({
1008
1232
  class: "p-2 cursor-pointer hover:bg-muted/50",
1009
1233
  onState: [
1010
1234
  [s, "selectedIndex", {
@@ -1013,11 +1237,11 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
1013
1237
  }]
1014
1238
  ],
1015
1239
  click: () => e(t)
1016
- }, a)), $e = d(({ selectOption: t, state: e }) => w({
1240
+ }, a)), Ge = f(({ selectOption: t, state: e }) => x({
1017
1241
  class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
1018
- for: ["filteredOptions", (s, a) => ze({ index: a, click: t, state: e }, s.label)]
1019
- })), Ne = d((t) => o({ class: "relative flex items-center" }, [
1020
- ie({
1242
+ for: ["filteredOptions", (s, a) => Ke({ index: a, click: t, state: e }, s.label)]
1243
+ })), _e = f((t) => o({ class: "relative flex items-center" }, [
1244
+ de({
1021
1245
  cache: "input",
1022
1246
  class: t.class ?? "",
1023
1247
  placeholder: t.placeholder ?? "Search...",
@@ -1033,22 +1257,22 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
1033
1257
  ]
1034
1258
  }),
1035
1259
  t.icon && o({ class: "absolute flex right-0 mr-2" }, [
1036
- _(t.icon)
1260
+ ee(t.icon)
1037
1261
  ])
1038
- ])), je = (t) => o({
1262
+ ])), Ve = (t) => o({
1039
1263
  class: "relative flex fle-auto flex-col",
1040
1264
  onState: ["open", (e, s, a) => {
1041
1265
  if (e)
1042
- return new le({
1266
+ return new ae({
1043
1267
  cache: "dropdown",
1044
1268
  parent: a,
1045
1269
  button: a.input,
1046
1270
  size: "xl"
1047
1271
  }, [
1048
- $e(t)
1272
+ Ge(t)
1049
1273
  ]);
1050
1274
  }]
1051
- }), gt = V(
1275
+ }), Tt = Z(
1052
1276
  {
1053
1277
  /**
1054
1278
  * This will set up the data object.
@@ -1057,7 +1281,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
1057
1281
  */
1058
1282
  setData() {
1059
1283
  const t = this.options || [];
1060
- return new C({
1284
+ return new L({
1061
1285
  options: t,
1062
1286
  filteredOptions: t
1063
1287
  });
@@ -1145,7 +1369,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
1145
1369
  */
1146
1370
  render() {
1147
1371
  return o({ class: "relative w-full max-w-md" }, [
1148
- Ne({
1372
+ _e({
1149
1373
  // @ts-ignore
1150
1374
  state: this.state,
1151
1375
  // @ts-ignore
@@ -1157,7 +1381,7 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
1157
1381
  // @ts-ignore
1158
1382
  handleKeyDown: this.handleKeyDown.bind(this)
1159
1383
  }),
1160
- je({
1384
+ Ve({
1161
1385
  // @ts-ignore
1162
1386
  state: this.state,
1163
1387
  // @ts-ignore
@@ -1168,22 +1392,22 @@ const ze = d(({ index: t, click: e, state: s }, a) => S({
1168
1392
  ]);
1169
1393
  }
1170
1394
  }
1171
- ), Ae = (t) => S(
1395
+ ), Je = (t) => C(
1172
1396
  {
1173
1397
  class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
1174
1398
  dataSet: ["selected", ["state", t.value, "active"]]
1175
1399
  },
1176
1400
  [
1177
- k({
1401
+ v({
1178
1402
  class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md",
1179
1403
  onSet: ["selected", { selected: t.value }],
1180
1404
  click: (e) => t.callBack(t.value)
1181
1405
  }, t.label)
1182
1406
  ]
1183
- ), Ue = (t, e) => (t.callBack = e, Ae(t)), Ye = (t) => I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1184
- w({ class: "flex flex-auto flex-row", map: [t.options, (e) => Ue(e, t.callBack)] })
1407
+ ), Ze = (t, e) => (t.callBack = e, Je(t)), et = (t) => I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1408
+ x({ class: "flex flex-auto flex-row", map: [t.options, (e) => Ze(e, t.callBack)] })
1185
1409
  ]);
1186
- class mt extends h {
1410
+ class Bt extends g {
1187
1411
  /**
1188
1412
  * This will declare the props for the compiler.
1189
1413
  *
@@ -1200,12 +1424,12 @@ class mt extends h {
1200
1424
  render() {
1201
1425
  const e = this.select.bind(this);
1202
1426
  return o({ class: "" }, [
1203
- Ye({
1427
+ et({
1204
1428
  class: this.class,
1205
1429
  options: this.options,
1206
1430
  callBack: e
1207
1431
  }),
1208
- z({
1432
+ Y({
1209
1433
  class: "tab-content",
1210
1434
  onState: ["selected", this.updateContent.bind(this)]
1211
1435
  })
@@ -1249,9 +1473,9 @@ class mt extends h {
1249
1473
  if (!s || s.length < 1)
1250
1474
  return;
1251
1475
  const a = s[0];
1252
- for (const i of s)
1253
- if (i.value === e)
1254
- return i.layout;
1476
+ for (const n of s)
1477
+ if (n.value === e)
1478
+ return n.layout;
1255
1479
  return a.layout;
1256
1480
  }
1257
1481
  /**
@@ -1271,23 +1495,23 @@ class mt extends h {
1271
1495
  };
1272
1496
  }
1273
1497
  }
1274
- const He = (t) => S(
1498
+ const tt = (t) => C(
1275
1499
  {
1276
1500
  class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm",
1277
1501
  dataSet: ["selected", ["state", t.value, "active"]]
1278
1502
  },
1279
1503
  [
1280
- k({
1504
+ v({
1281
1505
  class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md disabled:opacity-50 disabled:cursor-not-allowed",
1282
1506
  onSet: ["selected", { selected: t.value }],
1283
1507
  click: (e) => t.callBack(t.value),
1284
1508
  disabled: t.disabled
1285
1509
  }, t.label)
1286
1510
  ]
1287
- ), Fe = (t, e) => (t.callBack = e, He(t)), Ee = (t) => I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1288
- w({ class: "flex flex-auto flex-row", map: [t.options, (e) => Fe(e, t.callBack)] })
1511
+ ), st = (t, e) => (t.callBack = e, tt(t)), at = (t) => I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1512
+ x({ class: "flex flex-auto flex-row", map: [t.options, (e) => st(e, t.callBack)] })
1289
1513
  ]);
1290
- class pt extends h {
1514
+ class Mt extends g {
1291
1515
  /**
1292
1516
  * This will declare the props for the compiler.
1293
1517
  *
@@ -1303,7 +1527,7 @@ class pt extends h {
1303
1527
  */
1304
1528
  render() {
1305
1529
  const e = this.select.bind(this);
1306
- return Ee({
1530
+ return at({
1307
1531
  class: this.class,
1308
1532
  options: this.options,
1309
1533
  callBack: e
@@ -1330,17 +1554,17 @@ class pt extends h {
1330
1554
  };
1331
1555
  }
1332
1556
  }
1333
- const Qe = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), Xe = (t, e) => {
1557
+ const nt = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), it = (t, e) => {
1334
1558
  const s = t.getLinkPath();
1335
- return t.exact ? e === s : Qe(s, e);
1336
- }, qe = ({ text: t, href: e, exact: s }) => new $({
1559
+ return t.exact ? e === s : nt(s, e);
1560
+ }, ot = ({ text: t, href: e, exact: s }) => new H({
1337
1561
  text: t,
1338
1562
  href: e,
1339
1563
  exact: s,
1340
1564
  dataSet: ["selected", ["state", !0, "active"]],
1341
1565
  class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm"
1342
1566
  });
1343
- class Ke extends h {
1567
+ class lt extends g {
1344
1568
  /**
1345
1569
  * This will declare the props for the compiler.
1346
1570
  *
@@ -1362,11 +1586,11 @@ class Ke extends h {
1362
1586
  */
1363
1587
  render() {
1364
1588
  return I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
1365
- w({
1589
+ x({
1366
1590
  class: "flex flex-auto flex-row",
1367
1591
  map: [this.options, (e) => this.addLink(e)],
1368
1592
  watch: {
1369
- value: ["[[path]]", y.data],
1593
+ value: ["[[path]]", k.data],
1370
1594
  callBack: this.updateLinks.bind(this)
1371
1595
  }
1372
1596
  })
@@ -1378,7 +1602,7 @@ class Ke extends h {
1378
1602
  * @returns {void}
1379
1603
  */
1380
1604
  afterSetup() {
1381
- const e = y.data.path;
1605
+ const e = k.data.path;
1382
1606
  this.updateLinks(e);
1383
1607
  }
1384
1608
  /**
@@ -1390,9 +1614,9 @@ class Ke extends h {
1390
1614
  updateLinks(e) {
1391
1615
  let s = !1, a = this.links[0];
1392
1616
  this.deactivateAllLinks();
1393
- for (const i of this.links)
1394
- if (i.rendered !== !1 && (s = Xe(i, e), s === !0)) {
1395
- this.updateLink(i, !0);
1617
+ for (const n of this.links)
1618
+ if (n.rendered !== !1 && (s = it(n, e), s === !0)) {
1619
+ this.updateLink(n, !0);
1396
1620
  break;
1397
1621
  }
1398
1622
  s !== !0 && a && this.updateLink(a, !0);
@@ -1423,8 +1647,8 @@ class Ke extends h {
1423
1647
  * @returns {object}
1424
1648
  */
1425
1649
  addLink({ label: e, href: s, exact: a }) {
1426
- const i = qe({ text: e, href: s, exact: a });
1427
- return this.links.push(i), i;
1650
+ const n = ot({ text: e, href: s, exact: a });
1651
+ return this.links.push(n), n;
1428
1652
  }
1429
1653
  /**
1430
1654
  * This will remove all the links.
@@ -1435,7 +1659,7 @@ class Ke extends h {
1435
1659
  this.links = [];
1436
1660
  }
1437
1661
  }
1438
- class wt extends h {
1662
+ class Rt extends g {
1439
1663
  /**
1440
1664
  * This will declare the props for the compiler.
1441
1665
  *
@@ -1451,11 +1675,11 @@ class wt extends h {
1451
1675
  */
1452
1676
  render() {
1453
1677
  return o({ class: "tab-panel" }, [
1454
- new Ke({
1678
+ new lt({
1455
1679
  class: this.class,
1456
1680
  options: this.options
1457
1681
  }),
1458
- z({
1682
+ Y({
1459
1683
  class: "tab-content",
1460
1684
  switch: this.addGroup()
1461
1685
  })
@@ -1469,8 +1693,8 @@ class wt extends h {
1469
1693
  addGroup() {
1470
1694
  let e;
1471
1695
  const s = [], a = this.options;
1472
- for (let i = 0, n = a.length; i < n; i++)
1473
- e = a[i], s.push(
1696
+ for (let n = 0, i = a.length; n < i; n++)
1697
+ e = a[n], s.push(
1474
1698
  {
1475
1699
  uri: e.uri || e.href,
1476
1700
  component: e.component,
@@ -1481,7 +1705,7 @@ class wt extends h {
1481
1705
  return s;
1482
1706
  }
1483
1707
  }
1484
- class Ge extends h {
1708
+ class rt extends g {
1485
1709
  /**
1486
1710
  * Runs before rendering, sets up defaults, a timer for drawing,
1487
1711
  * and basic canvas properties.
@@ -1491,7 +1715,7 @@ class Ge extends h {
1491
1715
  onCreated() {
1492
1716
  this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
1493
1717
  const e = 1e3 / 60;
1494
- this.timer = new se(e, this.draw.bind(this)), this.width = 0, this.height = 0, this.signed = !1, this.mouse = { x: 0, y: 0, status: "up" }, this.margin = this.margin || { x: 40, y: 60 }, this.targetSize = this.targetSize || { width: 740, height: 345 }, this.baseLineWidth = this.baseLineWidth || 2, this.baseStrokeColor = this.baseStrokeColor || "#000000";
1718
+ this.timer = new re(e, this.draw.bind(this)), this.width = 0, this.height = 0, this.signed = !1, this.mouse = { x: 0, y: 0, status: "up" }, this.margin = this.margin || { x: 40, y: 60 }, this.targetSize = this.targetSize || { width: 740, height: 345 }, this.baseLineWidth = this.baseLineWidth || 2, this.baseStrokeColor = this.baseStrokeColor || "#000000";
1495
1719
  }
1496
1720
  /**
1497
1721
  * Renders a <canvas> element.
@@ -1499,7 +1723,7 @@ class Ge extends h {
1499
1723
  * @returns {object} Layout definition for the canvas.
1500
1724
  */
1501
1725
  render() {
1502
- return K({
1726
+ return J({
1503
1727
  style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
1504
1728
  });
1505
1729
  }
@@ -1529,13 +1753,13 @@ class Ge extends h {
1529
1753
  * @returns {Array} An array of [eventName, element, callback] definitions.
1530
1754
  */
1531
1755
  setupEvents() {
1532
- const e = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this), i = this.pointerDown.bind(this), n = this.resize.bind(this), l = { passive: !1 };
1756
+ const e = this.panel, s = this.pointerPosition.bind(this), a = this.pointerUp.bind(this), n = this.pointerDown.bind(this), i = this.resize.bind(this), l = { passive: !1 };
1533
1757
  return [
1534
1758
  ["pointermove", e, s, l],
1535
1759
  ["pointerup", e, a],
1536
- ["pointerdown", e, i, l],
1760
+ ["pointerdown", e, n, l],
1537
1761
  ["pointerout", e, a],
1538
- ["resize", globalThis, n]
1762
+ ["resize", globalThis, i]
1539
1763
  ];
1540
1764
  }
1541
1765
  /**
@@ -1546,14 +1770,14 @@ class Ge extends h {
1546
1770
  */
1547
1771
  getEventPosition(e) {
1548
1772
  let s, a;
1549
- const i = this.canvas, n = i.width / parseInt(i.style.width), l = i.getBoundingClientRect();
1773
+ const n = this.canvas, i = n.width / parseInt(n.style.width), l = n.getBoundingClientRect();
1550
1774
  if (e.touches && e.touches.length) {
1551
- const f = e.touches[0];
1552
- s = f.clientX, a = f.clientY;
1775
+ const c = e.touches[0];
1776
+ s = c.clientX, a = c.clientY;
1553
1777
  } else
1554
1778
  s = e.x || e.clientX, a = e.y || e.clientY;
1555
- const u = parseInt((s - l.left) * n), c = parseInt((a - l.top) * n);
1556
- this.mouse.x = u, this.mouse.y = c;
1779
+ const u = parseInt((s - l.left) * i), r = parseInt((a - l.top) * i);
1780
+ this.mouse.x = u, this.mouse.y = r;
1557
1781
  }
1558
1782
  /**
1559
1783
  * Called when the pointer goes down on the canvas.
@@ -1595,10 +1819,10 @@ class Ge extends h {
1595
1819
  resize() {
1596
1820
  const { canvas: e, ctx: s } = this, a = e.toDataURL();
1597
1821
  if (this.scale(), this.setupBackground(s), a !== "data:,") {
1598
- const i = new globalThis.Image();
1599
- M.on("load", i, function n() {
1600
- s.drawImage(i, 0, 0), M.off("load", i, n);
1601
- }), i.src = a;
1822
+ const n = new globalThis.Image();
1823
+ W.on("load", n, function i() {
1824
+ s.drawImage(n, 0, 0), W.off("load", n, i);
1825
+ }), n.src = a;
1602
1826
  }
1603
1827
  this.draw();
1604
1828
  }
@@ -1617,7 +1841,7 @@ class Ge extends h {
1617
1841
  * @returns {void}
1618
1842
  */
1619
1843
  noScaleResize() {
1620
- const e = R.getSize(container);
1844
+ const e = O.getSize(container);
1621
1845
  this.width = canvas.width = e.width, this.height = canvas.height = e.height;
1622
1846
  }
1623
1847
  /**
@@ -1627,13 +1851,13 @@ class Ge extends h {
1627
1851
  * @returns {void}
1628
1852
  */
1629
1853
  scale() {
1630
- const e = this.canvas, s = this.container, a = R.getSize(s), i = this.targetSize, n = i.width, l = i.height;
1631
- let u = n + "px", c = l + "px";
1632
- if (this.width = e.width = n, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
1633
- const f = a.width, g = a.height, r = f / n, m = g / l, b = Math.min(r, m);
1634
- u = n * b + "px", c = l * b + "px";
1854
+ const e = this.canvas, s = this.container, a = O.getSize(s), n = this.targetSize, i = n.width, l = n.height;
1855
+ let u = i + "px", r = l + "px";
1856
+ if (this.width = e.width = i, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
1857
+ const c = a.width, h = a.height, d = c / i, p = h / l, y = Math.min(d, p);
1858
+ u = i * y + "px", r = l * y + "px";
1635
1859
  }
1636
- e.style.width = u, e.style.height = c;
1860
+ e.style.width = u, e.style.height = r;
1637
1861
  }
1638
1862
  /**
1639
1863
  * Main drawing loop. If the mouse is down, adds a line
@@ -1653,8 +1877,8 @@ class Ge extends h {
1653
1877
  drawBottomLine(e) {
1654
1878
  const s = this.canvas;
1655
1879
  e.globalAlpha = 1, e.shadowBlur = 0;
1656
- const a = this.margin.x, i = this.height - this.margin.y;
1657
- e.beginPath(), e.moveTo(a, i), e.lineTo(s.width - this.margin.x, i), e.lineWidth = this.baseLineWidth, e.strokeStyle = this.baseStrokeColor, e.stroke(), e.closePath();
1880
+ const a = this.margin.x, n = this.height - this.margin.y;
1881
+ e.beginPath(), e.moveTo(a, n), e.lineTo(s.width - this.margin.x, n), e.lineWidth = this.baseLineWidth, e.strokeStyle = this.baseStrokeColor, e.stroke(), e.closePath();
1658
1882
  }
1659
1883
  /**
1660
1884
  * Adds a line to the current path, updating the 'signed' status.
@@ -1665,10 +1889,10 @@ class Ge extends h {
1665
1889
  * @param {string} color The stroke color.
1666
1890
  * @returns {void}
1667
1891
  */
1668
- addLine(e, s, a, i) {
1892
+ addLine(e, s, a, n) {
1669
1893
  this.signed || (this.signed = !0);
1670
- const n = Math.round(s), l = Math.round(a);
1671
- e.lineWidth = this.lineWidth, e.strokeStyle = i, e.lineTo(n, l), e.stroke();
1894
+ const i = Math.round(s), l = Math.round(a);
1895
+ e.lineWidth = this.lineWidth, e.strokeStyle = n, e.lineTo(i, l), e.stroke();
1672
1896
  }
1673
1897
  /**
1674
1898
  * Clears the canvas, sets signed to false, and re-initializes
@@ -1707,7 +1931,7 @@ class Ge extends h {
1707
1931
  this.timer.stop(), this.status = "stopped";
1708
1932
  }
1709
1933
  }
1710
- class bt extends h {
1934
+ class Pt extends g {
1711
1935
  /**
1712
1936
  * Sets up default properties for the signature panel.
1713
1937
  *
@@ -1724,19 +1948,19 @@ class bt extends h {
1724
1948
  */
1725
1949
  render() {
1726
1950
  return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
1727
- ne({
1951
+ he({
1728
1952
  cache: "hiddenInput",
1729
1953
  required: !0,
1730
1954
  bind: this.path + ".data"
1731
1955
  }),
1732
1956
  o({ class: "absolute top-2 right-2" }, [
1733
- T({
1957
+ m({
1734
1958
  variant: "icon",
1735
- icon: x.circleX,
1959
+ icon: w.circleX,
1736
1960
  click: this.reset.bind(this)
1737
1961
  })
1738
1962
  ]),
1739
- new Ge({
1963
+ new rt({
1740
1964
  cache: "canvasLayer",
1741
1965
  margin: this.margin,
1742
1966
  targetSize: this.targetSize,
@@ -1786,36 +2010,37 @@ class bt extends h {
1786
2010
  }
1787
2011
  }
1788
2012
  export {
1789
- ht as B,
1790
- be as C,
1791
- xe as D,
1792
- ye as H,
1793
- ft as I,
1794
- dt as N,
1795
- A as O,
1796
- at as P,
1797
- rt as S,
1798
- B as T,
1799
- Re as U,
1800
- ot as W,
1801
- he as a,
1802
- W as b,
1803
- ce as c,
1804
- it as d,
1805
- nt as e,
1806
- fe as f,
1807
- de as g,
1808
- me as h,
1809
- pe as i,
1810
- j,
1811
- lt as k,
1812
- ct as l,
1813
- ut as m,
1814
- gt as n,
1815
- Ne as o,
1816
- mt as p,
1817
- pt as q,
1818
- Ke as r,
1819
- wt as s,
1820
- bt as t
2013
+ Ct as B,
2014
+ Re as C,
2015
+ We as D,
2016
+ Pe as H,
2017
+ Lt as I,
2018
+ St as N,
2019
+ E as O,
2020
+ pt as P,
2021
+ xt as R,
2022
+ vt as S,
2023
+ P as T,
2024
+ Ee as U,
2025
+ bt as W,
2026
+ me as a,
2027
+ $ as b,
2028
+ fe as c,
2029
+ yt as d,
2030
+ wt as e,
2031
+ ye as f,
2032
+ ge as g,
2033
+ be as h,
2034
+ xe as i,
2035
+ U as j,
2036
+ kt as k,
2037
+ Dt as l,
2038
+ It as m,
2039
+ Tt as n,
2040
+ _e as o,
2041
+ Bt as p,
2042
+ Mt as q,
2043
+ lt as r,
2044
+ Rt as s,
2045
+ Pt as t
1821
2046
  };