@base-framework/ui 1.0.217 → 1.0.219

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 D, Div as o, On as v, Span as S, Th as N, UseParent as E, I as Q, Thead as X, Tr as q, Table as M, P as w, Li as I, Time as K, Nav as C, Ul as b, Section as j, Canvas as G } from "@base-framework/atoms";
2
- import { Atom as f, Component as g, Data as L, DateTime as V, router as x, NavLink as A, DataTracker as Y, Jot as _, base as W, Dom as O } from "@base-framework/base";
3
- import { B as y, I as J } from "./buttons-Cm9etaEG.js";
4
- import { Icons as k } from "./icons.es.js";
5
- import { F as Z, A as ee, P as te } from "./calendar-Bn55oWBo.js";
6
- import { TableBody as se, DataTableBody as ae, ScrollableTableBody as ie, List as ne, IntervalTimer as oe } from "@base-framework/organisms";
7
- import { C as le, I as re, H as ce } from "./inputs-CMjx5-IX.js";
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
8
  f((t, e) => ({
9
9
  class: "flex items-center px-4 py-2",
10
10
  ...t,
11
11
  children: e
12
12
  }));
13
- f(({ value: t, label: e }) => D({
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 dt extends g {
19
+ class pt extends g {
20
20
  /**
21
21
  * This will declare the props for the compiler.
22
22
  *
@@ -34,77 +34,77 @@ class dt extends g {
34
34
  return o({ class: this.class || "" }, this.children);
35
35
  }
36
36
  }
37
- const de = (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
- }, he = (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 && !de(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
- }, ue = (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
- }, fe = (t, e, s) => Array.from({ length: s }, (a, i) => new Date(t, e + 1, i + 1)), z = (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
- }, ht = (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
- const h = new Date(t, e, l);
71
- n.push(l > 0 ? h : null), (n.length === 7 || l === a) && (i.push([...n]), n = []);
70
+ const u = new Date(t, e, l);
71
+ i.push(l > 0 ? u : null), (i.length === 7 || l === a) && (n.push([...i]), i = []);
72
72
  }
73
- return i;
74
- }, ut = (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
- }, ge = (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
- }, me = ({ day: t, month: e, year: s, weekNumber: a, selectWeek: i }) => {
84
- const n = ge(t, e, s);
85
- return D({
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
- }, pe = (t, e) => {
96
- const s = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate(), i = ue(t, e, s), n = Array.from({ length: a }, (c, m) => new Date(t, e, m + 1)), l = (i.length + n.length) % 7, h = l === 0 ? 0 : 7 - l, r = fe(t, e, h), d = [...i, ...n, ...r], u = [];
97
- for (let c = 0; c < d.length; c += 7) {
98
- const m = d.slice(c, c + 7), p = m.find((R) => R) || new Date(t, e, 1), { weekNumber: T, year: B } = he(p);
99
- u.push({
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
100
  weekNumber: T,
101
101
  year: B,
102
- days: m
102
+ days: p
103
103
  });
104
104
  }
105
- return u;
106
- }, ye = ({ selectWeek: t }) => v("month", (e, s, { data: a }) => {
107
- const { year: i, month: n, currentDate: l } = a, h = pe(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
  [
@@ -119,8 +119,8 @@ const de = (t) => {
119
119
  )
120
120
  ),
121
121
  // Render each "week" row
122
- ...h.map(
123
- ({ weekNumber: r, days: d, year: u }) => o({
122
+ ...u.map(
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
126
  ring: r
@@ -129,7 +129,7 @@ const de = (t) => {
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(r, u),
132
+ click: () => t(r, h),
133
133
  // If you have a 'currentWeek' state, you can highlight it with 'onSet'
134
134
  onSet: ["currentWeek", {
135
135
  "text-primary-foreground": r,
@@ -140,11 +140,11 @@ const de = (t) => {
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
- d.map(
144
- (c) => me({
145
- year: (c == null ? void 0 : c.getFullYear()) || null,
146
- month: (c == null ? void 0 : c.getMonth()) || null,
147
- day: (c == null ? void 0 : c.getDate()) || null,
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
148
  weekNumber: r,
149
149
  selectWeek: t
150
150
  })
@@ -154,7 +154,7 @@ const de = (t) => {
154
154
  )
155
155
  ]
156
156
  );
157
- }), $ = ({ label: t, click: e }) => y(
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 de = (t) => {
165
165
  click: e,
166
166
  "aria-label": `${t} month`,
167
167
  variant: "icon",
168
- icon: t === "Previous" ? k.chevron.single.left : k.chevron.single.right
168
+ icon: t === "Previous" ? w.chevron.single.left : w.chevron.single.right
169
169
  }
170
- ), we = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
170
+ ), xe = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
171
171
  S("[[monthName]] [[year]]"),
172
- $({
172
+ z({
173
173
  label: "Previous",
174
174
  click: e
175
175
  }),
176
- $({
176
+ z({
177
177
  label: "Next",
178
178
  click: t
179
179
  })
180
180
  ]);
181
- class ft extends g {
181
+ class bt extends g {
182
182
  /**
183
183
  * This will declare the props for the compiler.
184
184
  *
@@ -193,7 +193,7 @@ class ft extends g {
193
193
  * @returns {Data}
194
194
  */
195
195
  setData() {
196
- const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = z(s, e.getFullYear());
196
+ const e = /* @__PURE__ */ new Date(), s = this.selectedWeek || this.calculateCurrentWeek(e), a = $(s, e.getFullYear());
197
197
  return new L({
198
198
  monthName: this.getMonthName(a.getMonth()),
199
199
  year: a.getFullYear(),
@@ -221,8 +221,8 @@ class ft extends g {
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 ft extends g {
231
231
  * @returns {string}
232
232
  */
233
233
  getMonthName(e) {
234
- return V.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 ft extends g {
276
276
  */
277
277
  selectWeek(e, s) {
278
278
  this.data.currentWeek = e;
279
- const a = z(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,52 +286,116 @@ class ft extends g {
286
286
  */
287
287
  render() {
288
288
  return o({ class: "week-calendar-container border rounded-md bg-background p-3" }, [
289
- we({
289
+ xe({
290
290
  next: () => this.goToNextMonth(),
291
291
  previous: () => this.goToPreviousMonth()
292
292
  }),
293
- ye({
293
+ be({
294
294
  selectWeek: (e, s) => this.selectWeek(e, s)
295
295
  })
296
296
  ]);
297
297
  }
298
298
  }
299
- const be = (t) => o({ class: "py-1" }, t), xe = () => o(
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(
300
318
  { class: "grid grid-cols-7 text-center text-sm font-medium text-muted-foreground mb-1" },
301
- ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(be)
302
- ), ke = ({ day: t, iso: e, disabled: s, isStart: a, isEnd: i, isBetween: n, onClick: l }) => y(
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(
303
321
  {
304
- class: "flex items-center justify-center h-9 p-0 text-sm rounded-md " + (a || i ? "bg-primary text-primary-foreground" : n ? "bg-muted text-foreground" : ""),
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" : ""),
305
323
  disabled: s,
306
324
  click: () => !s && l(e)
307
325
  },
308
326
  t.toString()
309
- ), De = ({ cells: t }) => o(
327
+ ), Ce = ({ cells: t }) => o(
310
328
  { class: "grid grid-cols-7 gap-1" },
311
329
  t.map(
312
- (e) => e === null ? o() : ke(
330
+ (e) => 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
+ }) : null
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(
313
361
  {
314
- day: e.day,
315
- iso: e.iso,
316
- disabled: e.disabled,
317
- isStart: e.isStart,
318
- isEnd: e.isEnd,
319
- isBetween: e.isBetween,
320
- onClick: e.onClick
321
- }
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)
322
369
  )
323
370
  )
324
- ), ve = ({ start: t, end: e, selecting: s, onSelectStart: a, onSelectEnd: i }) => o({ class: "flex space-x-2 mb-3" }, [
325
- y(
371
+ ), Te = ({ start: t, end: e, selecting: s, onSelectStart: a, onSelectEnd: n }) => o({ class: "flex space-x-2 mb-3" }, [
372
+ m(
326
373
  { click: a, variant: s === "start" ? "primary" : "ghost" },
327
374
  t ? `Start: ${t}` : "Select start"
328
375
  ),
329
- y(
330
- { click: i, variant: s === "end" ? "primary" : "ghost" },
376
+ m(
377
+ { click: n, variant: s === "end" ? "primary" : "ghost" },
331
378
  e ? `End: ${e}` : "Select end"
332
379
  )
333
- ]);
334
- class gt extends g {
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 {
335
399
  /**
336
400
  * Declare compiler props.
337
401
  *
@@ -363,10 +427,12 @@ class gt extends g {
363
427
  /**
364
428
  * Initialize component state.
365
429
  *
366
- * @returns {{selecting:string,start:string|null,end:string|null}}
430
+ * @returns {{view:string,selecting:string,start:string|null,end:string|null}}
367
431
  */
368
432
  setupStates() {
369
433
  return {
434
+ view: "calendar",
435
+ // 'calendar', 'months', or 'years'
370
436
  selecting: "start",
371
437
  start: this.startDate,
372
438
  end: this.endDate
@@ -381,62 +447,101 @@ class gt extends g {
381
447
  handleClick(e) {
382
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));
383
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
+ }
384
460
  /**
385
461
  * Render the range calendar.
386
462
  *
387
463
  * @returns {object}
388
464
  */
389
465
  render() {
390
- const { today: e, current: s } = this.data, { start: a, end: i, selecting: n } = this.state, l = new Date(s.year, s.month, 1).getDay(), h = new Date(s.year, s.month + 1, 0).getDate(), r = [];
391
- for (let d = 0; d < l; d++)
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++)
392
468
  r.push(null);
393
- for (let d = 1; d <= h; d++) {
394
- const u = Z(s.year, s.month, d), m = /* @__PURE__ */ new Date(u + "T00:00:00") < new Date(e.year, e.month, e.date), p = this.blockPriorDates && m, T = a === u, B = i === u, R = a && i && u > a && u < i;
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;
395
471
  r.push({
396
- day: d,
397
- iso: u,
398
- disabled: p,
472
+ day: c,
473
+ iso: h,
474
+ disabled: y,
399
475
  isStart: T,
400
476
  isEnd: B,
401
- isBetween: R,
402
- onClick: (U) => this.handleClick(U)
477
+ isBetween: M,
478
+ click: (Q) => this.handleClick(Q)
403
479
  });
404
480
  }
405
481
  return o({ class: "range-calendar p-4 rounded-md border min-w-80" }, [
406
- ve({
482
+ Te({
407
483
  start: a,
408
- end: i,
409
- selecting: n,
484
+ end: n,
485
+ selecting: i,
410
486
  onSelectStart: () => this.state.selecting = "start",
411
487
  onSelectEnd: () => this.state.selecting = "end"
412
488
  }),
413
- xe(),
414
- De({ cells: r })
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
+ })
415
520
  ]);
416
521
  }
417
522
  }
418
- const Se = (t, e) => {
523
+ const Me = (t, e) => {
419
524
  const s = t.toggleAllSelectedRows();
420
525
  e.state.checked = !s;
421
- }, Ie = (t) => N({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
422
- E((e) => new le({ class: "mr-2", onChange: (s, a) => Se(e, a) }))
423
- ]), Ce = ({ 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 }) => {
424
529
  const l = t || "justify-start";
425
- return N({
426
- class: `cursor-pointer py-3 px-4 text-base ${n || ""}`,
427
- click: e && (() => i(s))
530
+ return j({
531
+ class: `cursor-pointer py-3 px-4 text-base ${i || ""}`,
532
+ click: e && (() => n(s))
428
533
  }, [
429
534
  o({ class: `flex flex-auto w-full items-center ${l}` }, [
430
535
  S(a),
431
- e && Q({ class: "ml-2", html: k.arrows.upDown })
536
+ e && K({ class: "ml-2", html: w.arrows.upDown })
432
537
  ])
433
538
  ]);
434
- }, P = (t) => X([
435
- q({
539
+ }, P = (t) => G([
540
+ _({
436
541
  class: "text-muted-foreground border-b",
437
542
  map: [
438
543
  t.headers,
439
- (e) => e.label === "checkbox" ? Ie({ toggle: t.toggle }) : Ce({
544
+ (e) => e.label === "checkbox" ? Re({ toggle: t.toggle }) : Pe({
440
545
  align: e.align,
441
546
  sortable: e.sortable,
442
547
  key: e.key,
@@ -445,15 +550,15 @@ const Se = (t, e) => {
445
550
  })
446
551
  ]
447
552
  })
448
- ]), Le = ({ key: t, rows: e, selectRow: s, rowItem: a, emptyState: i }) => new se({
553
+ ]), We = ({ key: t, rows: e, selectRow: s, rowItem: a, emptyState: n }) => new ne({
449
554
  cache: "list",
450
555
  key: t,
451
556
  items: e,
452
- rowItem: (n) => a(n, s),
557
+ rowItem: (i) => a(i, s),
453
558
  class: "divide-y divide-border",
454
- emptyState: i
559
+ emptyState: n
455
560
  });
456
- class F extends g {
561
+ class U extends g {
457
562
  /**
458
563
  * Initializes component data.
459
564
  *
@@ -513,8 +618,8 @@ class F extends g {
513
618
  selectRow(e) {
514
619
  const s = e.selected ?? !1;
515
620
  e.selected = !s;
516
- const a = this.data.get("selectedRows"), i = e.selected ? [...a, e] : a.filter((n) => n !== e);
517
- 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();
518
623
  }
519
624
  /**
520
625
  * Renders the DataTable component.
@@ -524,14 +629,14 @@ class F extends g {
524
629
  render() {
525
630
  const e = this.rows, s = this.border !== !1 ? "border" : "";
526
631
  return o({ class: "w-full flex flex-auto flex-col" }, [
527
- v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
632
+ D("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
528
633
  o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
529
- M({ class: "w-full" }, [
634
+ R({ class: "w-full" }, [
530
635
  // @ts-ignore
531
636
  this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
532
637
  // @ts-ignore
533
638
  this.customHeader ?? null,
534
- Le({
639
+ We({
535
640
  // @ts-ignore
536
641
  key: this.key,
537
642
  rows: e,
@@ -606,7 +711,7 @@ class F extends g {
606
711
  this.data.selectedRows = [];
607
712
  }
608
713
  }
609
- const Te = (t) => new ae({
714
+ const Oe = (t) => new ie({
610
715
  cache: "list",
611
716
  loadMoreItems: t.loadMoreItems,
612
717
  offset: t.offset,
@@ -617,7 +722,7 @@ const Te = (t) => new ae({
617
722
  rowItem: (e) => t.rowItem(e, t.selectRow),
618
723
  class: "divide-y divide-border"
619
724
  });
620
- class Be extends F {
725
+ class $e extends U {
621
726
  /**
622
727
  * Renders the DataTable component.
623
728
  *
@@ -626,14 +731,14 @@ class Be extends F {
626
731
  render() {
627
732
  const e = this.rows, s = this.border !== !1 ? "border" : "";
628
733
  return o({ class: "w-full flex flex-auto flex-col" }, [
629
- v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
734
+ D("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
630
735
  o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
631
- M({ class: "w-full" }, [
736
+ R({ class: "w-full" }, [
632
737
  // @ts-ignore
633
738
  this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
634
739
  // @ts-ignore
635
740
  this.customHeader ?? null,
636
- Te({
741
+ Oe({
637
742
  // @ts-ignore
638
743
  loadMoreItems: this.loadMoreItems,
639
744
  // @ts-ignore
@@ -665,7 +770,7 @@ class Be extends F {
665
770
  this.list.refresh();
666
771
  }
667
772
  }
668
- const mt = f((t) => new Be(
773
+ const kt = f((t) => new $e(
669
774
  {
670
775
  cache: t.cache ?? "list",
671
776
  tableData: t.data,
@@ -681,7 +786,7 @@ const mt = f((t) => new Be(
681
786
  border: t.border,
682
787
  emptyState: t.emptyState
683
788
  }
684
- )), Re = (t) => new ie({
789
+ )), ze = (t) => new oe({
685
790
  cache: "list",
686
791
  scrollContainer: t.scrollContainer,
687
792
  loadMoreItems: t.loadMoreItems,
@@ -693,7 +798,7 @@ const mt = f((t) => new Be(
693
798
  rowItem: (e) => t.rowItem(e, t.selectRow),
694
799
  class: "divide-y divide-border"
695
800
  });
696
- class Me extends F {
801
+ class Ne extends U {
697
802
  /**
698
803
  * Renders the DataTable component.
699
804
  *
@@ -702,14 +807,14 @@ class Me extends F {
702
807
  render() {
703
808
  const e = this.rows, s = this.border !== !1 ? "border" : "";
704
809
  return o({ class: "w-full flex flex-auto flex-col" }, [
705
- v("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
810
+ D("hasItems", (a) => a === !1 && this.emptyState ? this.emptyState() : null),
706
811
  o({ class: `w-full rounded-md ${s} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
707
- M({ class: "w-full" }, [
812
+ R({ class: "w-full" }, [
708
813
  // @ts-ignore
709
814
  this.headers && P({ headers: this.headers, sort: (a) => this.sortRows(a) }),
710
815
  // @ts-ignore
711
816
  this.customHeader ?? null,
712
- Re({
817
+ ze({
713
818
  // @ts-ignore
714
819
  scrollContainer: this.scrollContainer,
715
820
  // @ts-ignore
@@ -743,7 +848,7 @@ class Me extends F {
743
848
  this.list.refresh();
744
849
  }
745
850
  }
746
- const pt = f((t) => new Me(
851
+ const vt = f((t) => new Ne(
747
852
  {
748
853
  cache: t.cache ?? "list",
749
854
  tableData: t.data,
@@ -760,45 +865,45 @@ const pt = f((t) => new Me(
760
865
  border: t.border,
761
866
  emptyState: t.emptyState
762
867
  }
763
- )), Pe = f(({ name: t, email: e }) => o({ class: "min-w-0 flex-auto" }, [
764
- w({ class: "text-base font-semibold leading-6 m-0" }, t),
765
- w({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, e)
766
- ])), We = () => 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" }, [
767
872
  o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
768
873
  o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
769
874
  ]),
770
- w({ class: "text-xs leading-5 text-gray-500" }, "Online")
771
- ]), Oe = (t) => w({ class: "text-xs leading-5 text-muted-foreground" }, [
875
+ b({ class: "text-xs leading-5 text-gray-500" }, "Online")
876
+ ]), Ae = (t) => b({ class: "text-xs leading-5 text-muted-foreground" }, [
772
877
  S("Last seen "),
773
- K({ datetime: t }, "3h ago")
774
- ]), ze = (t, e) => t === "online" ? We() : Oe(e), $e = f(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
775
- w({ class: "text-sm leading-6 m-0" }, t),
776
- ze(s, e)
777
- ])), Ne = (t) => t.split(" ").map((s) => s[0]).join(""), je = f((t) => I({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
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" }, [
778
883
  o({ class: "flex min-w-0 gap-x-4" }, [
779
- ee({ src: t.image, alt: t.name, fallbackText: Ne(t.name) }),
780
- Pe({ 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 })
781
886
  ]),
782
- $e({
887
+ Fe({
783
888
  role: t.role,
784
889
  lastSeen: t.lastSeen,
785
890
  status: t.status
786
891
  })
787
- ])), yt = f((t) => new ne({
892
+ ])), Dt = f((t) => new le({
788
893
  cache: "list",
789
894
  key: "name",
790
895
  items: t.users,
791
896
  role: "list",
792
897
  class: "divide-y divide-border",
793
- rowItem: je
794
- })), Ae = (t, e) => e.includes(t), Ye = (t, e, s) => t.exact ? s === e : Ae(e, s), Fe = ({ text: t, href: e, exact: s, hidden: a }) => new A({
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({
795
900
  text: t,
796
901
  href: e,
797
902
  exact: s,
798
903
  dataSet: ["selected", ["state", !0, "active"]],
799
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`
800
905
  });
801
- class wt extends g {
906
+ class St extends g {
802
907
  /**
803
908
  * This will declare the props for the compiler.
804
909
  *
@@ -819,14 +924,14 @@ class wt extends g {
819
924
  * @returns {object}
820
925
  */
821
926
  render() {
822
- return C(
927
+ return I(
823
928
  { class: `flex items-center justify-center p-2 text-muted-foreground rounded-md ${this.class || ""}` },
824
929
  [
825
- b({
930
+ x({
826
931
  class: "flex space-x-4",
827
932
  map: [this.options, (e) => this.addLink(e)],
828
933
  watch: {
829
- value: ["[[path]]", x.data],
934
+ value: ["[[path]]", k.data],
830
935
  callBack: this.updateLinks.bind(this)
831
936
  }
832
937
  })
@@ -839,7 +944,7 @@ class wt extends g {
839
944
  * @returns {void}
840
945
  */
841
946
  afterSetup() {
842
- const e = x.data.path;
947
+ const e = k.data.path;
843
948
  this.updateLinks(e);
844
949
  }
845
950
  /**
@@ -854,7 +959,7 @@ class wt extends g {
854
959
  for (const a of this.links) {
855
960
  if (!a.rendered)
856
961
  continue;
857
- Ye(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);
858
963
  }
859
964
  !s && this.links[0] && this.updateLink(this.links[0], !0);
860
965
  }
@@ -883,9 +988,9 @@ class wt extends g {
883
988
  * @param {object} option
884
989
  * @returns {object}
885
990
  */
886
- addLink({ label: e, href: s, exact: a, hidden: i }) {
887
- const n = Fe({ text: e, href: s, exact: a, hidden: i });
888
- 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;
889
994
  }
890
995
  /**
891
996
  * This will clear the links.
@@ -896,13 +1001,13 @@ class wt extends g {
896
1001
  this.links = [];
897
1002
  }
898
1003
  }
899
- const bt = f((t) => {
1004
+ const Ct = f((t) => {
900
1005
  const e = t.margin || "m-4 ml-0";
901
1006
  return t.allowHistory = t.allowHistory === !0, o({ class: `flex-none ${e}` }, [
902
- y({ variant: "back", class: "ghost", ...t })
1007
+ m({ variant: "back", class: "ghost", ...t })
903
1008
  ]);
904
1009
  });
905
- class H extends g {
1010
+ class E extends g {
906
1011
  /**
907
1012
  * This will declare the props for the compiler.
908
1013
  *
@@ -989,13 +1094,13 @@ class H extends g {
989
1094
  return this.children;
990
1095
  }
991
1096
  }
992
- Y.addType("dockableOverlay", (t) => {
1097
+ F.addType("dockableOverlay", (t) => {
993
1098
  if (!t)
994
1099
  return;
995
1100
  const e = t.component;
996
1101
  e && e.rendered === !0 && e.state.docked === !1 && e.destroy();
997
1102
  });
998
- class xt extends H {
1103
+ class It extends E {
999
1104
  /**
1000
1105
  * This will stop presistence.
1001
1106
  *
@@ -1061,7 +1166,7 @@ class xt extends H {
1061
1166
  * @returns {void}
1062
1167
  */
1063
1168
  afterSetup() {
1064
- Y.add(
1169
+ F.add(
1065
1170
  this.container,
1066
1171
  "dockableOverlay",
1067
1172
  {
@@ -1104,7 +1209,7 @@ class xt extends H {
1104
1209
  document.documentElement.style.overflowY = "auto";
1105
1210
  }
1106
1211
  }
1107
- class kt extends H {
1212
+ class Lt extends E {
1108
1213
  /**
1109
1214
  * This will get the overlay type.
1110
1215
  *
@@ -1123,7 +1228,7 @@ class kt extends H {
1123
1228
  this.container = e, this.initialize();
1124
1229
  }
1125
1230
  }
1126
- const He = f(({ index: t, click: e, state: s }, a) => I({
1231
+ const Ke = f(({ index: t, click: e, state: s }, a) => C({
1127
1232
  class: "p-2 cursor-pointer hover:bg-muted/50",
1128
1233
  onState: [
1129
1234
  [s, "selectedIndex", {
@@ -1132,11 +1237,11 @@ const He = f(({ index: t, click: e, state: s }, a) => I({
1132
1237
  }]
1133
1238
  ],
1134
1239
  click: () => e(t)
1135
- }, a)), Ue = f(({ selectOption: t, state: e }) => b({
1240
+ }, a)), Ge = f(({ selectOption: t, state: e }) => x({
1136
1241
  class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
1137
- for: ["filteredOptions", (s, a) => He({ index: a, click: t, state: e }, s.label)]
1138
- })), Ee = f((t) => o({ class: "relative flex items-center" }, [
1139
- re({
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({
1140
1245
  cache: "input",
1141
1246
  class: t.class ?? "",
1142
1247
  placeholder: t.placeholder ?? "Search...",
@@ -1152,22 +1257,22 @@ const He = f(({ index: t, click: e, state: s }, a) => I({
1152
1257
  ]
1153
1258
  }),
1154
1259
  t.icon && o({ class: "absolute flex right-0 mr-2" }, [
1155
- J(t.icon)
1260
+ ee(t.icon)
1156
1261
  ])
1157
- ])), Qe = (t) => o({
1262
+ ])), Ve = (t) => o({
1158
1263
  class: "relative flex fle-auto flex-col",
1159
1264
  onState: ["open", (e, s, a) => {
1160
1265
  if (e)
1161
- return new te({
1266
+ return new ae({
1162
1267
  cache: "dropdown",
1163
1268
  parent: a,
1164
1269
  button: a.input,
1165
1270
  size: "xl"
1166
1271
  }, [
1167
- Ue(t)
1272
+ Ge(t)
1168
1273
  ]);
1169
1274
  }]
1170
- }), Dt = _(
1275
+ }), Tt = Z(
1171
1276
  {
1172
1277
  /**
1173
1278
  * This will set up the data object.
@@ -1264,7 +1369,7 @@ const He = f(({ index: t, click: e, state: s }, a) => I({
1264
1369
  */
1265
1370
  render() {
1266
1371
  return o({ class: "relative w-full max-w-md" }, [
1267
- Ee({
1372
+ _e({
1268
1373
  // @ts-ignore
1269
1374
  state: this.state,
1270
1375
  // @ts-ignore
@@ -1276,7 +1381,7 @@ const He = f(({ index: t, click: e, state: s }, a) => I({
1276
1381
  // @ts-ignore
1277
1382
  handleKeyDown: this.handleKeyDown.bind(this)
1278
1383
  }),
1279
- Qe({
1384
+ Ve({
1280
1385
  // @ts-ignore
1281
1386
  state: this.state,
1282
1387
  // @ts-ignore
@@ -1287,22 +1392,22 @@ const He = f(({ index: t, click: e, state: s }, a) => I({
1287
1392
  ]);
1288
1393
  }
1289
1394
  }
1290
- ), Xe = (t) => I(
1395
+ ), Je = (t) => C(
1291
1396
  {
1292
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",
1293
1398
  dataSet: ["selected", ["state", t.value, "active"]]
1294
1399
  },
1295
1400
  [
1296
- D({
1401
+ v({
1297
1402
  class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md",
1298
1403
  onSet: ["selected", { selected: t.value }],
1299
1404
  click: (e) => t.callBack(t.value)
1300
1405
  }, t.label)
1301
1406
  ]
1302
- ), qe = (t, e) => (t.callBack = e, Xe(t)), Ke = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1303
- b({ class: "flex flex-auto flex-row", map: [t.options, (e) => qe(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)] })
1304
1409
  ]);
1305
- class vt extends g {
1410
+ class Bt extends g {
1306
1411
  /**
1307
1412
  * This will declare the props for the compiler.
1308
1413
  *
@@ -1319,12 +1424,12 @@ class vt extends g {
1319
1424
  render() {
1320
1425
  const e = this.select.bind(this);
1321
1426
  return o({ class: "" }, [
1322
- Ke({
1427
+ et({
1323
1428
  class: this.class,
1324
1429
  options: this.options,
1325
1430
  callBack: e
1326
1431
  }),
1327
- j({
1432
+ Y({
1328
1433
  class: "tab-content",
1329
1434
  onState: ["selected", this.updateContent.bind(this)]
1330
1435
  })
@@ -1368,9 +1473,9 @@ class vt extends g {
1368
1473
  if (!s || s.length < 1)
1369
1474
  return;
1370
1475
  const a = s[0];
1371
- for (const i of s)
1372
- if (i.value === e)
1373
- return i.layout;
1476
+ for (const n of s)
1477
+ if (n.value === e)
1478
+ return n.layout;
1374
1479
  return a.layout;
1375
1480
  }
1376
1481
  /**
@@ -1390,23 +1495,23 @@ class vt extends g {
1390
1495
  };
1391
1496
  }
1392
1497
  }
1393
- const Ge = (t) => I(
1498
+ const tt = (t) => C(
1394
1499
  {
1395
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",
1396
1501
  dataSet: ["selected", ["state", t.value, "active"]]
1397
1502
  },
1398
1503
  [
1399
- D({
1504
+ v({
1400
1505
  class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md disabled:opacity-50 disabled:cursor-not-allowed",
1401
1506
  onSet: ["selected", { selected: t.value }],
1402
1507
  click: (e) => t.callBack(t.value),
1403
1508
  disabled: t.disabled
1404
1509
  }, t.label)
1405
1510
  ]
1406
- ), Ve = (t, e) => (t.callBack = e, Ge(t)), _e = (t) => C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${t.class}` }, [
1407
- b({ class: "flex flex-auto flex-row", map: [t.options, (e) => Ve(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)] })
1408
1513
  ]);
1409
- class St extends g {
1514
+ class Mt extends g {
1410
1515
  /**
1411
1516
  * This will declare the props for the compiler.
1412
1517
  *
@@ -1422,7 +1527,7 @@ class St extends g {
1422
1527
  */
1423
1528
  render() {
1424
1529
  const e = this.select.bind(this);
1425
- return _e({
1530
+ return at({
1426
1531
  class: this.class,
1427
1532
  options: this.options,
1428
1533
  callBack: e
@@ -1449,17 +1554,17 @@ class St extends g {
1449
1554
  };
1450
1555
  }
1451
1556
  }
1452
- const Je = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), Ze = (t, e) => {
1557
+ const nt = (t, e) => new RegExp(`${t}($|/|\\.).*`).test(e), it = (t, e) => {
1453
1558
  const s = t.getLinkPath();
1454
- return t.exact ? e === s : Je(s, e);
1455
- }, et = ({ text: t, href: e, exact: s }) => new A({
1559
+ return t.exact ? e === s : nt(s, e);
1560
+ }, ot = ({ text: t, href: e, exact: s }) => new H({
1456
1561
  text: t,
1457
1562
  href: e,
1458
1563
  exact: s,
1459
1564
  dataSet: ["selected", ["state", !0, "active"]],
1460
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"
1461
1566
  });
1462
- class tt extends g {
1567
+ class lt extends g {
1463
1568
  /**
1464
1569
  * This will declare the props for the compiler.
1465
1570
  *
@@ -1480,12 +1585,12 @@ class tt extends g {
1480
1585
  * @returns {object}
1481
1586
  */
1482
1587
  render() {
1483
- return C({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
1484
- b({
1588
+ return I({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${this.class}` }, [
1589
+ x({
1485
1590
  class: "flex flex-auto flex-row",
1486
1591
  map: [this.options, (e) => this.addLink(e)],
1487
1592
  watch: {
1488
- value: ["[[path]]", x.data],
1593
+ value: ["[[path]]", k.data],
1489
1594
  callBack: this.updateLinks.bind(this)
1490
1595
  }
1491
1596
  })
@@ -1497,7 +1602,7 @@ class tt extends g {
1497
1602
  * @returns {void}
1498
1603
  */
1499
1604
  afterSetup() {
1500
- const e = x.data.path;
1605
+ const e = k.data.path;
1501
1606
  this.updateLinks(e);
1502
1607
  }
1503
1608
  /**
@@ -1509,9 +1614,9 @@ class tt extends g {
1509
1614
  updateLinks(e) {
1510
1615
  let s = !1, a = this.links[0];
1511
1616
  this.deactivateAllLinks();
1512
- for (const i of this.links)
1513
- if (i.rendered !== !1 && (s = Ze(i, e), s === !0)) {
1514
- 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);
1515
1620
  break;
1516
1621
  }
1517
1622
  s !== !0 && a && this.updateLink(a, !0);
@@ -1542,8 +1647,8 @@ class tt extends g {
1542
1647
  * @returns {object}
1543
1648
  */
1544
1649
  addLink({ label: e, href: s, exact: a }) {
1545
- const i = et({ text: e, href: s, exact: a });
1546
- return this.links.push(i), i;
1650
+ const n = ot({ text: e, href: s, exact: a });
1651
+ return this.links.push(n), n;
1547
1652
  }
1548
1653
  /**
1549
1654
  * This will remove all the links.
@@ -1554,7 +1659,7 @@ class tt extends g {
1554
1659
  this.links = [];
1555
1660
  }
1556
1661
  }
1557
- class It extends g {
1662
+ class Rt extends g {
1558
1663
  /**
1559
1664
  * This will declare the props for the compiler.
1560
1665
  *
@@ -1570,11 +1675,11 @@ class It extends g {
1570
1675
  */
1571
1676
  render() {
1572
1677
  return o({ class: "tab-panel" }, [
1573
- new tt({
1678
+ new lt({
1574
1679
  class: this.class,
1575
1680
  options: this.options
1576
1681
  }),
1577
- j({
1682
+ Y({
1578
1683
  class: "tab-content",
1579
1684
  switch: this.addGroup()
1580
1685
  })
@@ -1588,8 +1693,8 @@ class It extends g {
1588
1693
  addGroup() {
1589
1694
  let e;
1590
1695
  const s = [], a = this.options;
1591
- for (let i = 0, n = a.length; i < n; i++)
1592
- e = a[i], s.push(
1696
+ for (let n = 0, i = a.length; n < i; n++)
1697
+ e = a[n], s.push(
1593
1698
  {
1594
1699
  uri: e.uri || e.href,
1595
1700
  component: e.component,
@@ -1600,7 +1705,7 @@ class It extends g {
1600
1705
  return s;
1601
1706
  }
1602
1707
  }
1603
- class st extends g {
1708
+ class rt extends g {
1604
1709
  /**
1605
1710
  * Runs before rendering, sets up defaults, a timer for drawing,
1606
1711
  * and basic canvas properties.
@@ -1610,7 +1715,7 @@ class st extends g {
1610
1715
  onCreated() {
1611
1716
  this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
1612
1717
  const e = 1e3 / 60;
1613
- this.timer = new oe(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";
1614
1719
  }
1615
1720
  /**
1616
1721
  * Renders a <canvas> element.
@@ -1618,7 +1723,7 @@ class st extends g {
1618
1723
  * @returns {object} Layout definition for the canvas.
1619
1724
  */
1620
1725
  render() {
1621
- return G({
1726
+ return J({
1622
1727
  style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
1623
1728
  });
1624
1729
  }
@@ -1648,13 +1753,13 @@ class st extends g {
1648
1753
  * @returns {Array} An array of [eventName, element, callback] definitions.
1649
1754
  */
1650
1755
  setupEvents() {
1651
- 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 };
1652
1757
  return [
1653
1758
  ["pointermove", e, s, l],
1654
1759
  ["pointerup", e, a],
1655
- ["pointerdown", e, i, l],
1760
+ ["pointerdown", e, n, l],
1656
1761
  ["pointerout", e, a],
1657
- ["resize", globalThis, n]
1762
+ ["resize", globalThis, i]
1658
1763
  ];
1659
1764
  }
1660
1765
  /**
@@ -1665,14 +1770,14 @@ class st extends g {
1665
1770
  */
1666
1771
  getEventPosition(e) {
1667
1772
  let s, a;
1668
- 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();
1669
1774
  if (e.touches && e.touches.length) {
1670
- const d = e.touches[0];
1671
- s = d.clientX, a = d.clientY;
1775
+ const c = e.touches[0];
1776
+ s = c.clientX, a = c.clientY;
1672
1777
  } else
1673
1778
  s = e.x || e.clientX, a = e.y || e.clientY;
1674
- const h = parseInt((s - l.left) * n), r = parseInt((a - l.top) * n);
1675
- this.mouse.x = h, this.mouse.y = r;
1779
+ const u = parseInt((s - l.left) * i), r = parseInt((a - l.top) * i);
1780
+ this.mouse.x = u, this.mouse.y = r;
1676
1781
  }
1677
1782
  /**
1678
1783
  * Called when the pointer goes down on the canvas.
@@ -1714,10 +1819,10 @@ class st extends g {
1714
1819
  resize() {
1715
1820
  const { canvas: e, ctx: s } = this, a = e.toDataURL();
1716
1821
  if (this.scale(), this.setupBackground(s), a !== "data:,") {
1717
- const i = new globalThis.Image();
1718
- W.on("load", i, function n() {
1719
- s.drawImage(i, 0, 0), W.off("load", i, n);
1720
- }), 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;
1721
1826
  }
1722
1827
  this.draw();
1723
1828
  }
@@ -1746,13 +1851,13 @@ class st extends g {
1746
1851
  * @returns {void}
1747
1852
  */
1748
1853
  scale() {
1749
- const e = this.canvas, s = this.container, a = O.getSize(s), i = this.targetSize, n = i.width, l = i.height;
1750
- let h = n + "px", r = l + "px";
1751
- if (this.width = e.width = n, this.height = e.height = l, a.width !== 0 && a.height !== 0) {
1752
- const d = a.width, u = a.height, c = d / n, m = u / l, p = Math.min(c, m);
1753
- h = n * p + "px", r = l * p + "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";
1754
1859
  }
1755
- e.style.width = h, e.style.height = r;
1860
+ e.style.width = u, e.style.height = r;
1756
1861
  }
1757
1862
  /**
1758
1863
  * Main drawing loop. If the mouse is down, adds a line
@@ -1772,8 +1877,8 @@ class st extends g {
1772
1877
  drawBottomLine(e) {
1773
1878
  const s = this.canvas;
1774
1879
  e.globalAlpha = 1, e.shadowBlur = 0;
1775
- const a = this.margin.x, i = this.height - this.margin.y;
1776
- 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();
1777
1882
  }
1778
1883
  /**
1779
1884
  * Adds a line to the current path, updating the 'signed' status.
@@ -1784,10 +1889,10 @@ class st extends g {
1784
1889
  * @param {string} color The stroke color.
1785
1890
  * @returns {void}
1786
1891
  */
1787
- addLine(e, s, a, i) {
1892
+ addLine(e, s, a, n) {
1788
1893
  this.signed || (this.signed = !0);
1789
- const n = Math.round(s), l = Math.round(a);
1790
- 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();
1791
1896
  }
1792
1897
  /**
1793
1898
  * Clears the canvas, sets signed to false, and re-initializes
@@ -1826,7 +1931,7 @@ class st extends g {
1826
1931
  this.timer.stop(), this.status = "stopped";
1827
1932
  }
1828
1933
  }
1829
- class Ct extends g {
1934
+ class Pt extends g {
1830
1935
  /**
1831
1936
  * Sets up default properties for the signature panel.
1832
1937
  *
@@ -1843,19 +1948,19 @@ class Ct extends g {
1843
1948
  */
1844
1949
  render() {
1845
1950
  return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
1846
- ce({
1951
+ he({
1847
1952
  cache: "hiddenInput",
1848
1953
  required: !0,
1849
1954
  bind: this.path + ".data"
1850
1955
  }),
1851
1956
  o({ class: "absolute top-2 right-2" }, [
1852
- y({
1957
+ m({
1853
1958
  variant: "icon",
1854
- icon: k.circleX,
1959
+ icon: w.circleX,
1855
1960
  click: this.reset.bind(this)
1856
1961
  })
1857
1962
  ]),
1858
- new st({
1963
+ new rt({
1859
1964
  cache: "canvasLayer",
1860
1965
  margin: this.margin,
1861
1966
  targetSize: this.targetSize,
@@ -1905,37 +2010,37 @@ class Ct extends g {
1905
2010
  }
1906
2011
  }
1907
2012
  export {
1908
- bt as B,
1909
- Ie as C,
1910
- Le as D,
1911
- Ce as H,
1912
- kt as I,
1913
- wt as N,
1914
- H as O,
1915
- dt as P,
1916
- gt as R,
1917
- pt as S,
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,
1918
2023
  P as T,
1919
- je as U,
1920
- ft as W,
1921
- fe as a,
1922
- z as b,
1923
- he as c,
1924
- ht as d,
1925
- ut as e,
1926
- me as f,
1927
- ue as g,
1928
- ye as h,
1929
- we as i,
1930
- F as j,
1931
- mt as k,
1932
- yt as l,
1933
- xt as m,
1934
- Dt as n,
1935
- Ee as o,
1936
- vt as p,
1937
- St as q,
1938
- tt as r,
1939
- It as s,
1940
- Ct 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
1941
2046
  };