@base-framework/ui 1.2.47 → 1.2.50

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,9 +1,9 @@
1
- import { Div as r, Button as v, On as j, Span as T, Nav as f, Ul as p, Section as y, Li as w, Canvas as z } from "@base-framework/atoms";
2
- import { Component as k, Data as I, DateTime as U, router as b, NavLink as S, base as L, Dom as B } from "@base-framework/base";
3
- import { f as C, av as A, b0 as u, a7 as F } from "./full-page-B94AsK9X.js";
4
- import { Icons as D } from "./icons.es.js";
5
- import { IntervalTimer as O } from "@base-framework/organisms";
6
- class Lt extends k {
1
+ import { Div as r, Button as b, On as I, Span as M, Nav as f, Ul as p, Section as y, Li as w, Canvas as U } from "@base-framework/atoms";
2
+ import { Component as k, Data as A, DateTime as F, router as v, NavLink as B, base as P, Dom as W } from "@base-framework/base";
3
+ import { f as $, av as O, b0 as u, a7 as Y } from "./full-page-BSJ6rkbe.js";
4
+ import { Icons as S } from "./icons.es.js";
5
+ import { IntervalTimer as R } from "@base-framework/organisms";
6
+ class Pt extends k {
7
7
  /**
8
8
  * This will declare the props for the compiler.
9
9
  *
@@ -21,77 +21,77 @@ class Lt extends k {
21
21
  return r({ class: this.class || "" }, this.children);
22
22
  }
23
23
  }
24
- const Y = (s) => {
24
+ const E = (s) => {
25
25
  const t = new Date(s, 11, 31), e = new Date(s, 0, 1);
26
26
  return t.getDay() === 4 || // December 31 is a Thursday
27
27
  e.getDay() === 4;
28
- }, R = (s) => {
28
+ }, G = (s) => {
29
29
  const t = new Date(s.valueOf()), e = (t.getDay() + 6) % 7;
30
30
  t.setDate(t.getDate() - e + 3);
31
- const i = t.getFullYear(), a = new Date(i, 0, 4);
32
- a.setDate(a.getDate() - (a.getDay() + 6) % 7);
33
- const n = Math.ceil((t - a) / 6048e5) + 1;
34
- return n > 52 && !Y(i) ? {
31
+ const i = t.getFullYear(), n = new Date(i, 0, 4);
32
+ n.setDate(n.getDate() - (n.getDay() + 6) % 7);
33
+ const a = Math.ceil((t - n) / 6048e5) + 1;
34
+ return a > 52 && !E(i) ? {
35
35
  weekNumber: 1,
36
36
  year: i + 1
37
37
  } : {
38
- weekNumber: n,
38
+ weekNumber: a,
39
39
  year: i
40
40
  };
41
- }, E = (s, t, e) => {
41
+ }, V = (s, t, e) => {
42
42
  if (e === 0) return [];
43
43
  const i = new Date(s, t, 0).getDate();
44
44
  return Array.from(
45
45
  { length: e },
46
- (a, n) => new Date(s, t - 1, i - e + n + 1)
46
+ (n, a) => new Date(s, t - 1, i - e + a + 1)
47
47
  );
48
- }, G = (s, t, e) => Array.from({ length: e }, (i, a) => new Date(s, t + 1, a + 1)), P = (s, t) => {
49
- const e = new Date(t, 0, 4), i = (e.getDay() + 6) % 7, a = new Date(e);
50
- a.setDate(e.getDate() - i);
51
- const n = new Date(a);
52
- return n.setDate(a.getDate() + (s - 1) * 7), n;
53
- }, Bt = (s, t) => {
54
- const e = new Date(s, t, 1).getDay(), i = new Date(s, t + 1, 0).getDate(), a = [];
55
- let n = [];
48
+ }, X = (s, t, e) => Array.from({ length: e }, (i, n) => new Date(s, t + 1, n + 1)), C = (s, t) => {
49
+ const e = new Date(t, 0, 4), i = (e.getDay() + 6) % 7, n = new Date(e);
50
+ n.setDate(e.getDate() - i);
51
+ const a = new Date(n);
52
+ return a.setDate(n.getDate() + (s - 1) * 7), a;
53
+ }, Wt = (s, t) => {
54
+ const e = new Date(s, t, 1).getDay(), i = new Date(s, t + 1, 0).getDate(), n = [];
55
+ let a = [];
56
56
  for (let o = 1 - e; o <= i; o++) {
57
57
  const h = new Date(s, t, o);
58
- n.push(o > 0 ? h : null), (n.length === 7 || o === i) && (a.push([...n]), n = []);
58
+ a.push(o > 0 ? h : null), (a.length === 7 || o === i) && (n.push([...a]), a = []);
59
59
  }
60
- return a;
61
- }, Pt = (s, t) => {
60
+ return n;
61
+ }, Ct = (s, t) => {
62
62
  const e = new Date(s, t + 1, 0).getDate(), i = [];
63
- let a = [];
64
- for (let n = 1; n <= e; n++)
65
- a.push(new Date(s, t, n)), a.length === 7 && (i.push(a), a = []);
66
- return a.length > 0 && i.push(a), i;
67
- }, V = (s, t, e) => {
63
+ let n = [];
64
+ for (let a = 1; a <= e; a++)
65
+ n.push(new Date(s, t, a)), n.length === 7 && (i.push(n), n = []);
66
+ return n.length > 0 && i.push(n), i;
67
+ }, q = (s, t, e) => {
68
68
  const i = /* @__PURE__ */ new Date();
69
69
  return i.getDate() === s && i.getMonth() === t && i.getFullYear() === e;
70
- }, X = ({ day: s, month: t, year: e, weekNumber: i, selectWeek: a }) => {
71
- const n = V(s, t, e);
72
- return v({
70
+ }, H = ({ day: s, month: t, year: e, weekNumber: i, selectWeek: n }) => {
71
+ const a = q(s, t, e);
72
+ return b({
73
73
  text: s || "",
74
74
  disabled: !s,
75
75
  class: `
76
76
  px-2 py-1 text-center rounded-md
77
- ${n ? "bg-accent text-accent-foreground" : ""}
77
+ ${a ? "bg-accent text-accent-foreground" : ""}
78
78
  hover:bg-primary hover:text-primary-foreground
79
79
  `,
80
- click: () => a(i, e)
80
+ click: () => n(i, e)
81
81
  });
82
- }, q = (s, t) => {
83
- const e = new Date(s, t, 1).getDay(), i = new Date(s, t + 1, 0).getDate(), a = E(s, t, e), n = Array.from({ length: i }, (c, m) => new Date(s, t, m + 1)), o = (a.length + n.length) % 7, h = o === 0 ? 0 : 7 - o, l = G(s, t, h), d = [...a, ...n, ...l], g = [];
82
+ }, _ = (s, t) => {
83
+ const e = new Date(s, t, 1).getDay(), i = new Date(s, t + 1, 0).getDate(), n = V(s, t, e), a = Array.from({ length: i }, (c, m) => new Date(s, t, m + 1)), o = (n.length + a.length) % 7, h = o === 0 ? 0 : 7 - o, l = X(s, t, h), d = [...n, ...a, ...l], g = [];
84
84
  for (let c = 0; c < d.length; c += 7) {
85
- const m = d.slice(c, c + 7), x = m.find((N) => N) || new Date(s, t, 1), { weekNumber: M, year: $ } = R(x);
85
+ const m = d.slice(c, c + 7), x = m.find((z) => z) || new Date(s, t, 1), { weekNumber: N, year: j } = G(x);
86
86
  g.push({
87
- weekNumber: M,
88
- year: $,
87
+ weekNumber: N,
88
+ year: j,
89
89
  days: m
90
90
  });
91
91
  }
92
92
  return g;
93
- }, H = ({ selectWeek: s }) => j("month", (t, e, { data: i }) => {
94
- const { year: a, month: n, currentDate: o } = i, h = q(a, n);
93
+ }, J = ({ selectWeek: s }) => I("month", (t, e, { data: i }) => {
94
+ const { year: n, month: a, currentDate: o } = i, h = _(n, a);
95
95
  return r(
96
96
  { class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
97
97
  [
@@ -102,7 +102,7 @@ const Y = (s) => {
102
102
  class: "grid grid-cols-7 col-span-7 text-center text-muted-foreground items-center"
103
103
  },
104
104
  ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
105
- (l) => T({ class: "px-1 py-1", text: l })
105
+ (l) => M({ class: "px-1 py-1", text: l })
106
106
  )
107
107
  ),
108
108
  // Render each "week" row
@@ -128,7 +128,7 @@ const Y = (s) => {
128
128
  r(
129
129
  { class: "grid grid-cols-7 col-span-7 text-center" },
130
130
  d.map(
131
- (c) => X({
131
+ (c) => H({
132
132
  year: c?.getFullYear() || null,
133
133
  month: c?.getMonth() || null,
134
134
  day: c?.getDate() || null,
@@ -141,7 +141,7 @@ const Y = (s) => {
141
141
  )
142
142
  ]
143
143
  );
144
- }), W = ({ label: s, click: t }) => C(
144
+ }), T = ({ label: s, click: t }) => $(
145
145
  {
146
146
  class: `
147
147
  inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
@@ -152,20 +152,20 @@ const Y = (s) => {
152
152
  click: t,
153
153
  "aria-label": `${s} month`,
154
154
  variant: "icon",
155
- icon: s === "Previous" ? D.chevron.single.left : D.chevron.single.right
155
+ icon: s === "Previous" ? S.chevron.single.left : S.chevron.single.right
156
156
  }
157
- ), _ = ({ next: s, previous: t }) => r({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
158
- T("[[monthName]] [[year]]"),
159
- W({
157
+ ), K = ({ next: s, previous: t }) => r({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
158
+ M("[[monthName]] [[year]]"),
159
+ T({
160
160
  label: "Previous",
161
161
  click: t
162
162
  }),
163
- W({
163
+ T({
164
164
  label: "Next",
165
165
  click: s
166
166
  })
167
167
  ]);
168
- class Wt extends k {
168
+ class Tt extends k {
169
169
  /**
170
170
  * This will declare the props for the compiler.
171
171
  *
@@ -180,8 +180,8 @@ class Wt extends k {
180
180
  * @returns {Data}
181
181
  */
182
182
  setData() {
183
- const t = /* @__PURE__ */ new Date(), e = this.selectedWeek || this.calculateCurrentWeek(t), i = P(e, t.getFullYear());
184
- return new I({
183
+ const t = /* @__PURE__ */ new Date(), e = this.selectedWeek || this.calculateCurrentWeek(t), i = C(e, t.getFullYear());
184
+ return new A({
185
185
  monthName: this.getMonthName(i.getMonth()),
186
186
  year: i.getFullYear(),
187
187
  month: i.getMonth(),
@@ -208,8 +208,8 @@ class Wt extends k {
208
208
  calculateCurrentWeek(t) {
209
209
  const e = new Date(t.valueOf()), i = (t.getDay() + 6) % 7;
210
210
  e.setDate(e.getDate() - i + 3);
211
- const a = e.valueOf();
212
- return e.setMonth(0, 1), e.getDay() !== 4 && e.setMonth(0, 1 + (4 - e.getDay() + 7) % 7), 1 + Math.ceil((a - e) / 6048e5);
211
+ const n = e.valueOf();
212
+ return e.setMonth(0, 1), e.getDay() !== 4 && e.setMonth(0, 1 + (4 - e.getDay() + 7) % 7), 1 + Math.ceil((n - e) / 6048e5);
213
213
  }
214
214
  /**
215
215
  * Gets the name of the month.
@@ -218,7 +218,7 @@ class Wt extends k {
218
218
  * @returns {string}
219
219
  */
220
220
  getMonthName(t) {
221
- return U.monthNames[t];
221
+ return F.monthNames[t];
222
222
  }
223
223
  /**
224
224
  * Updates the calendar to show the previous month.
@@ -263,7 +263,7 @@ class Wt extends k {
263
263
  */
264
264
  selectWeek(t, e) {
265
265
  this.data.currentWeek = t;
266
- const i = P(t, e);
266
+ const i = C(t, e);
267
267
  this.setDate(i.getMonth(), i.getFullYear(), i.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(t);
268
268
  }
269
269
  /**
@@ -273,24 +273,24 @@ class Wt extends k {
273
273
  */
274
274
  render() {
275
275
  return r({ class: "week-calendar-container border rounded-md p-3" }, [
276
- _({
276
+ K({
277
277
  next: () => this.goToNextMonth(),
278
278
  previous: () => this.goToPreviousMonth()
279
279
  }),
280
- H({
280
+ J({
281
281
  selectWeek: (t, e) => this.selectWeek(t, e)
282
282
  })
283
283
  ]);
284
284
  }
285
285
  }
286
- const J = (s, t) => t.includes(s), K = (s, t, e) => s.exact ? e === t : J(t, e), Q = ({ text: s, href: t, exact: e, hidden: i }) => new S({
286
+ const Q = (s, t) => t.includes(s), Z = (s, t, e) => s.exact ? e === t : Q(t, e), tt = ({ text: s, href: t, exact: e, hidden: i }) => new B({
287
287
  text: s,
288
288
  href: t,
289
289
  exact: e,
290
290
  dataSet: ["selected", ["state", !0, "active"]],
291
291
  class: `${i ? "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`
292
292
  });
293
- class Tt extends k {
293
+ class Mt extends k {
294
294
  /**
295
295
  * This will declare the props for the compiler.
296
296
  *
@@ -318,7 +318,7 @@ class Tt extends k {
318
318
  class: "flex gap-x-4",
319
319
  map: [this.options, (t) => this.addLink(t)],
320
320
  watch: {
321
- value: ["[[path]]", b.data],
321
+ value: ["[[path]]", v.data],
322
322
  callBack: this.updateLinks.bind(this)
323
323
  }
324
324
  })
@@ -331,7 +331,7 @@ class Tt extends k {
331
331
  * @returns {void}
332
332
  */
333
333
  afterSetup() {
334
- const t = b.data.path;
334
+ const t = v.data.path;
335
335
  this.updateLinks(t);
336
336
  }
337
337
  /**
@@ -343,10 +343,10 @@ class Tt extends k {
343
343
  updateLinks(t) {
344
344
  let e = !1;
345
345
  this.deactivateAllLinks();
346
- for (const a of this.links) {
347
- if (!a.rendered)
346
+ for (const n of this.links) {
347
+ if (!n.rendered)
348
348
  continue;
349
- K(a, a.getLinkPath(), t) ? (this.updateLink(a, !0), e = !0) : this.updateLink(a, !1);
349
+ Z(n, n.getLinkPath(), t) ? (this.updateLink(n, !0), e = !0) : this.updateLink(n, !1);
350
350
  }
351
351
  const i = this?.links[0] ?? null;
352
352
  !e && i && this.updateLink(i, !0);
@@ -376,9 +376,9 @@ class Tt extends k {
376
376
  * @param {object} option
377
377
  * @returns {object}
378
378
  */
379
- addLink({ label: t, href: e, exact: i, hidden: a }) {
380
- const n = Q({ text: t, href: e, exact: i, hidden: a });
381
- return this.links.push(n), n;
379
+ addLink({ label: t, href: e, exact: i, hidden: n }) {
380
+ const a = tt({ text: t, href: e, exact: i, hidden: n });
381
+ return this.links.push(a), a;
382
382
  }
383
383
  /**
384
384
  * This will clear the links.
@@ -389,7 +389,7 @@ class Tt extends k {
389
389
  this.links = [];
390
390
  }
391
391
  }
392
- class Ct extends A {
392
+ class $t extends O {
393
393
  /**
394
394
  * This will get the overlay type.
395
395
  *
@@ -408,22 +408,22 @@ class Ct extends A {
408
408
  this.container = t, this.initialize();
409
409
  }
410
410
  }
411
- const Z = (s) => w(
411
+ const et = (s) => w(
412
412
  {
413
413
  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",
414
414
  dataStateSet: ["selected", ["state", s.value, "active"]]
415
415
  },
416
416
  [
417
- v({
417
+ b({
418
418
  class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md",
419
419
  onState: ["selected", { selected: s.value }],
420
420
  click: (t) => s.callBack(s.value)
421
421
  }, s.label)
422
422
  ]
423
- ), tt = (s, t) => (s.callBack = t, Z(s)), et = (s) => f({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${s.class}` }, [
424
- p({ class: "flex flex-auto flex-row", map: [s.options, (t) => tt(t, s.callBack)] })
423
+ ), st = (s, t) => et({ ...s, callBack: t }), it = (s) => f({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${s.class}` }, [
424
+ p({ class: "flex flex-auto flex-row", map: [s.options, (t) => st(t, s.callBack)] })
425
425
  ]);
426
- class Mt extends u {
426
+ class Nt extends u {
427
427
  /**
428
428
  * This will declare the props for the compiler.
429
429
  *
@@ -440,7 +440,7 @@ class Mt extends u {
440
440
  render() {
441
441
  const t = this.select.bind(this);
442
442
  return r({ class: "" }, [
443
- et({
443
+ it({
444
444
  class: this.class,
445
445
  options: this.options,
446
446
  callBack: t
@@ -490,9 +490,9 @@ class Mt extends u {
490
490
  if (!e || e.length < 1)
491
491
  return;
492
492
  const i = e[0];
493
- for (const a of e)
494
- if (a.value === t)
495
- return a.layout;
493
+ for (const n of e)
494
+ if (n.value === t)
495
+ return n.layout;
496
496
  return i.layout;
497
497
  }
498
498
  /**
@@ -512,23 +512,23 @@ class Mt extends u {
512
512
  };
513
513
  }
514
514
  }
515
- const st = (s) => w(
515
+ const nt = (s) => w(
516
516
  {
517
517
  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",
518
518
  dataStateSet: ["selected", ["state", s.value, "active"]]
519
519
  },
520
520
  [
521
- v({
521
+ b({
522
522
  class: "flex flex-auto justify-center items-center px-3 py-1.5 rounded-md disabled:opacity-50 disabled:cursor-not-allowed",
523
523
  onState: ["selected", { selected: s.value }],
524
524
  click: (t) => s.callBack(s.value),
525
525
  disabled: s.disabled
526
526
  }, s.label)
527
527
  ]
528
- ), it = (s, t) => (s.callBack = t, st(s)), at = (s) => f({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${s.class}` }, [
529
- p({ class: "flex flex-auto flex-row", map: [s.options, (t) => it(t, s.callBack)] })
528
+ ), at = (s, t) => nt({ ...s, callBack: t }), ot = (s) => f({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${s.class}` }, [
529
+ p({ class: "flex flex-auto flex-row", map: [s.options, (t) => at(t, s.callBack)] })
530
530
  ]);
531
- class $t extends u {
531
+ class jt extends u {
532
532
  /**
533
533
  * This will declare the props for the compiler.
534
534
  *
@@ -544,7 +544,7 @@ class $t extends u {
544
544
  */
545
545
  render() {
546
546
  const t = this.select.bind(this);
547
- return at({
547
+ return ot({
548
548
  class: this.class,
549
549
  options: this.options,
550
550
  callBack: t
@@ -571,17 +571,17 @@ class $t extends u {
571
571
  };
572
572
  }
573
573
  }
574
- const nt = (s, t) => new RegExp(`${s}($|/|\\.).*`).test(t), ot = (s, t) => {
574
+ const D = /* @__PURE__ */ new Map(), lt = (s, t) => (D.has(s) || D.set(s, new RegExp(`${s}($|/|\\.).*`)), D.get(s).test(t)), rt = (s, t) => {
575
575
  const e = s.getLinkPath();
576
- return s.exact ? t === e : nt(e, t);
577
- }, lt = ({ text: s, href: t, exact: e }) => new S({
576
+ return s.exact ? t === e : lt(e, t);
577
+ }, ct = ({ text: s, href: t, exact: e }) => new B({
578
578
  text: s,
579
579
  href: t,
580
580
  exact: e,
581
581
  dataSet: ["selected", ["state", !0, "active"]],
582
582
  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"
583
583
  });
584
- class rt extends u {
584
+ class ht extends u {
585
585
  /**
586
586
  * This will declare the props for the compiler.
587
587
  *
@@ -594,7 +594,7 @@ class rt extends u {
594
594
  * This will configure the links.
595
595
  */
596
596
  beforeSetup() {
597
- this.links = [];
597
+ this.links = [], this.activeLink = null;
598
598
  }
599
599
  /**
600
600
  * This will render the component.
@@ -607,7 +607,7 @@ class rt extends u {
607
607
  class: "flex flex-auto flex-row",
608
608
  map: [this.options, (t) => this.addLink(t)],
609
609
  watch: {
610
- value: ["[[path]]", b.data],
610
+ value: ["[[path]]", v.data],
611
611
  callBack: this.updateLinks.bind(this)
612
612
  }
613
613
  })
@@ -619,7 +619,7 @@ class rt extends u {
619
619
  * @returns {void}
620
620
  */
621
621
  afterSetup() {
622
- const t = b.data.path;
622
+ const t = v.data.path;
623
623
  this.updateLinks(t);
624
624
  }
625
625
  /**
@@ -629,23 +629,14 @@ class rt extends u {
629
629
  * @returns {void}
630
630
  */
631
631
  updateLinks(t) {
632
- let e = !1, i = this.links[0];
633
- this.deactivateAllLinks();
634
- for (const a of this.links)
635
- if (a.rendered !== !1 && (e = ot(a, t), e === !0)) {
636
- this.updateLink(a, !0);
632
+ const e = this.links[0];
633
+ let i = null;
634
+ for (const n of this.links)
635
+ if (n.rendered !== !1 && rt(n, t)) {
636
+ i = n;
637
637
  break;
638
638
  }
639
- e !== !0 && i && this.updateLink(i, !0);
640
- }
641
- /**
642
- * This will deactivate all links.
643
- *
644
- * @returns {void}
645
- */
646
- deactivateAllLinks() {
647
- for (const t of this.links)
648
- this.updateLink(t, !1);
639
+ i === null && e && (i = e), this.activeLink && this.activeLink !== i && this.updateLink(this.activeLink, !1), i && i !== this.activeLink && this.updateLink(i, !0), this.activeLink = i;
649
640
  }
650
641
  /**
651
642
  * This will update the link.
@@ -664,8 +655,8 @@ class rt extends u {
664
655
  * @returns {object}
665
656
  */
666
657
  addLink({ label: t, href: e, exact: i }) {
667
- const a = lt({ text: t, href: e, exact: i });
668
- return this.links.push(a), a;
658
+ const n = ct({ text: t, href: e, exact: i });
659
+ return this.links.push(n), n;
669
660
  }
670
661
  /**
671
662
  * This will remove all the links.
@@ -673,10 +664,10 @@ class rt extends u {
673
664
  * @returns {void}
674
665
  */
675
666
  beforeDestroy() {
676
- this.links = [];
667
+ this.links = [], this.activeLink = null;
677
668
  }
678
669
  }
679
- class Nt extends u {
670
+ class zt extends u {
680
671
  /**
681
672
  * This will declare the props for the compiler.
682
673
  *
@@ -692,7 +683,7 @@ class Nt extends u {
692
683
  */
693
684
  render() {
694
685
  return r({ class: "tab-panel" }, [
695
- new rt({
686
+ new ht({
696
687
  class: this.class,
697
688
  options: this.options
698
689
  }),
@@ -710,8 +701,8 @@ class Nt extends u {
710
701
  addGroup() {
711
702
  let t;
712
703
  const e = [], i = this.options;
713
- for (let a = 0, n = i.length; a < n; a++)
714
- t = i[a], e.push(
704
+ for (let n = 0, a = i.length; n < a; n++)
705
+ t = i[n], e.push(
715
706
  {
716
707
  uri: t.uri || t.href,
717
708
  component: t.component || null,
@@ -723,22 +714,22 @@ class Nt extends u {
723
714
  return e;
724
715
  }
725
716
  }
726
- const ct = (s) => w(
717
+ const dt = (s) => w(
727
718
  {
728
719
  class: "relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium text-muted-foreground transition-colors hover:text-foreground 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]:text-foreground after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary after:transition-all after:duration-200 after:scale-x-0 data-[state=active]:after:scale-x-100",
729
720
  dataStateSet: ["selected", ["state", s.value, "active"]]
730
721
  },
731
722
  [
732
- v({
723
+ b({
733
724
  class: "flex flex-auto justify-center items-center px-4 py-3 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
734
725
  onState: ["selected", { selected: s.value }],
735
726
  click: (t) => s.callBack(s.value)
736
727
  }, s.label)
737
728
  ]
738
- ), ht = (s, t) => (s.callBack = t, ct(s)), dt = (s) => f({ class: `border-b border-border ${s.class}` }, [
739
- p({ class: "flex flex-row items-center", map: [s.options, (t) => ht(t, s.callBack)] })
729
+ ), ut = (s, t) => (s.callBack = t, dt(s)), ft = (s) => f({ class: `border-b border-border ${s.class}` }, [
730
+ p({ class: "flex flex-row items-center", map: [s.options, (t) => ut(t, s.callBack)] })
740
731
  ]);
741
- class jt extends u {
732
+ class It extends u {
742
733
  /**
743
734
  * This will declare the props for the compiler.
744
735
  *
@@ -755,7 +746,7 @@ class jt extends u {
755
746
  render() {
756
747
  const t = this.select.bind(this);
757
748
  return r({ class: "underlined-button-tab-panel flex flex-auto flex-col" }, [
758
- dt({
749
+ ft({
759
750
  class: this.class,
760
751
  options: this.options,
761
752
  callBack: t
@@ -796,9 +787,9 @@ class jt extends u {
796
787
  if (!e || e.length < 1)
797
788
  return;
798
789
  const i = e[0];
799
- for (const a of e)
800
- if (a.value === t)
801
- return a.component;
790
+ for (const n of e)
791
+ if (n.value === t)
792
+ return n.component;
802
793
  return i.component;
803
794
  }
804
795
  /**
@@ -818,23 +809,23 @@ class jt extends u {
818
809
  };
819
810
  }
820
811
  }
821
- const ut = (s) => w(
812
+ const pt = (s) => w(
822
813
  {
823
814
  class: "relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium text-muted-foreground transition-colors hover:text-foreground 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]:text-foreground after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary after:transition-all after:duration-200 after:scale-x-0 data-[state=active]:after:scale-x-100",
824
815
  dataStateSet: ["selected", ["state", s.value, "active"]]
825
816
  },
826
817
  [
827
- v({
818
+ b({
828
819
  class: "flex flex-auto justify-center items-center px-4 py-3 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
829
820
  onState: ["selected", { selected: s.value }],
830
821
  click: (t) => s.callBack(s.value),
831
822
  disabled: s.disabled
832
823
  }, s.label)
833
824
  ]
834
- ), ft = (s, t) => (s.callBack = t, ut(s)), pt = (s) => f({ class: `border-b border-border ${s.class}` }, [
835
- p({ class: "flex flex-row items-center", map: [s.options, (t) => ft(t, s.callBack)] })
825
+ ), gt = (s, t) => pt({ ...s, callBack: t }), mt = (s) => f({ class: `border-b border-border ${s.class}` }, [
826
+ p({ class: "flex flex-row items-center", map: [s.options, (t) => gt(t, s.callBack)] })
836
827
  ]);
837
- class zt extends u {
828
+ class Ut extends u {
838
829
  /**
839
830
  * This will declare the props for the compiler.
840
831
  *
@@ -850,7 +841,7 @@ class zt extends u {
850
841
  */
851
842
  render() {
852
843
  const t = this.select.bind(this);
853
- return pt({
844
+ return mt({
854
845
  class: this.class,
855
846
  options: this.options,
856
847
  callBack: t
@@ -877,17 +868,17 @@ class zt extends u {
877
868
  };
878
869
  }
879
870
  }
880
- const gt = (s, t) => new RegExp(`${s}($|/|\\.).*`).test(t), mt = (s, t) => {
871
+ const L = /* @__PURE__ */ new Map(), vt = (s, t) => (L.has(s) || L.set(s, new RegExp(`${s}($|/|\\.).*`)), L.get(s).test(t)), bt = (s, t) => {
881
872
  const e = s.getLinkPath();
882
- return s.exact ? t === e : gt(e, t);
883
- }, bt = ({ text: s, href: t, exact: e }) => new S({
873
+ return s.exact ? t === e : vt(e, t);
874
+ }, kt = ({ text: s, href: t, exact: e }) => new B({
884
875
  text: s,
885
876
  href: t,
886
877
  exact: e,
887
878
  dataSet: ["selected", ["state", !0, "active"]],
888
879
  class: "relative inline-flex items-center justify-center whitespace-nowrap px-4 py-3 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground 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]:text-foreground after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary after:transition-all after:duration-200 after:scale-x-0 data-[state=active]:after:scale-x-100"
889
880
  });
890
- class vt extends u {
881
+ class xt extends u {
891
882
  /**
892
883
  * This will declare the props for the compiler.
893
884
  *
@@ -900,7 +891,7 @@ class vt extends u {
900
891
  * This will configure the links.
901
892
  */
902
893
  beforeSetup() {
903
- this.links = [];
894
+ this.links = [], this.activeLink = null;
904
895
  }
905
896
  /**
906
897
  * This will render the component.
@@ -914,7 +905,7 @@ class vt extends u {
914
905
  class: e,
915
906
  map: [this.options, (i) => this.addLink(i)],
916
907
  watch: {
917
- value: ["[[path]]", b.data],
908
+ value: ["[[path]]", v.data],
918
909
  callBack: this.updateLinks.bind(this)
919
910
  }
920
911
  })
@@ -926,7 +917,7 @@ class vt extends u {
926
917
  * @returns {void}
927
918
  */
928
919
  afterSetup() {
929
- const t = b.data.path;
920
+ const t = v.data.path;
930
921
  this.updateLinks(t);
931
922
  }
932
923
  /**
@@ -936,23 +927,14 @@ class vt extends u {
936
927
  * @returns {void}
937
928
  */
938
929
  updateLinks(t) {
939
- let e = !1, i = this.links[0];
940
- this.deactivateAllLinks();
941
- for (const a of this.links)
942
- if (a.rendered !== !1 && (e = mt(a, t), e === !0)) {
943
- this.updateLink(a, !0);
930
+ const e = this.links[0];
931
+ let i = null;
932
+ for (const n of this.links)
933
+ if (n.rendered !== !1 && bt(n, t)) {
934
+ i = n;
944
935
  break;
945
936
  }
946
- e !== !0 && i && this.updateLink(i, !0);
947
- }
948
- /**
949
- * This will deactivate all links.
950
- *
951
- * @returns {void}
952
- */
953
- deactivateAllLinks() {
954
- for (const t of this.links)
955
- this.updateLink(t, !1);
937
+ i === null && e && (i = e), this.activeLink && this.activeLink !== i && this.updateLink(this.activeLink, !1), i && i !== this.activeLink && this.updateLink(i, !0), this.activeLink = i;
956
938
  }
957
939
  /**
958
940
  * This will update the link.
@@ -971,8 +953,8 @@ class vt extends u {
971
953
  * @returns {object}
972
954
  */
973
955
  addLink({ label: t, href: e, exact: i }) {
974
- const a = bt({ text: t, href: e, exact: i });
975
- return this.links.push(a), a;
956
+ const n = kt({ text: t, href: e, exact: i });
957
+ return this.links.push(n), n;
976
958
  }
977
959
  /**
978
960
  * This will remove all the links.
@@ -980,10 +962,10 @@ class vt extends u {
980
962
  * @returns {void}
981
963
  */
982
964
  beforeDestroy() {
983
- this.links = [];
965
+ this.links = [], this.activeLink = null;
984
966
  }
985
967
  }
986
- class It extends u {
968
+ class At extends u {
987
969
  /**
988
970
  * This will declare the props for the compiler.
989
971
  *
@@ -999,7 +981,7 @@ class It extends u {
999
981
  */
1000
982
  render() {
1001
983
  return r({ class: "underlined-tab-panel flex flex-auto flex-col" }, [
1002
- new vt({
984
+ new xt({
1003
985
  class: this.class,
1004
986
  options: this.options,
1005
987
  scrollable: this.scrollable
@@ -1018,8 +1000,8 @@ class It extends u {
1018
1000
  addGroup() {
1019
1001
  let t;
1020
1002
  const e = [], i = this.options;
1021
- for (let a = 0, n = i.length; a < n; a++)
1022
- t = i[a], e.push(
1003
+ for (let n = 0, a = i.length; n < a; n++)
1004
+ t = i[n], e.push(
1023
1005
  {
1024
1006
  uri: t.uri || t.href,
1025
1007
  component: t.component || null,
@@ -1031,7 +1013,7 @@ class It extends u {
1031
1013
  return e;
1032
1014
  }
1033
1015
  }
1034
- class kt extends k {
1016
+ class yt extends k {
1035
1017
  /**
1036
1018
  * Runs before rendering, sets up defaults, a timer for drawing,
1037
1019
  * and basic canvas properties.
@@ -1041,7 +1023,7 @@ class kt extends k {
1041
1023
  onCreated() {
1042
1024
  this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
1043
1025
  const t = 1e3 / 60;
1044
- this.timer = new O(t, 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";
1026
+ this.timer = new R(t, 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";
1045
1027
  }
1046
1028
  /**
1047
1029
  * Renders a <canvas> element.
@@ -1049,7 +1031,7 @@ class kt extends k {
1049
1031
  * @returns {object} Layout definition for the canvas.
1050
1032
  */
1051
1033
  render() {
1052
- return z({
1034
+ return U({
1053
1035
  style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
1054
1036
  });
1055
1037
  }
@@ -1079,13 +1061,13 @@ class kt extends k {
1079
1061
  * @returns {Array} An array of [eventName, element, callback] definitions.
1080
1062
  */
1081
1063
  setupEvents() {
1082
- const t = this.panel, e = this.pointerPosition.bind(this), i = this.pointerUp.bind(this), a = this.pointerDown.bind(this), n = this.resize.bind(this), o = { passive: !1 };
1064
+ const t = this.panel, e = this.pointerPosition.bind(this), i = this.pointerUp.bind(this), n = this.pointerDown.bind(this), a = this.resize.bind(this), o = { passive: !1 };
1083
1065
  return [
1084
1066
  ["pointermove", t, e, o],
1085
1067
  ["pointerup", t, i],
1086
- ["pointerdown", t, a, o],
1068
+ ["pointerdown", t, n, o],
1087
1069
  ["pointerout", t, i],
1088
- ["resize", globalThis, n]
1070
+ ["resize", globalThis, a]
1089
1071
  ];
1090
1072
  }
1091
1073
  /**
@@ -1096,13 +1078,13 @@ class kt extends k {
1096
1078
  */
1097
1079
  getEventPosition(t) {
1098
1080
  let e, i;
1099
- const a = this.canvas, n = a.width / parseInt(a.style.width), o = a.getBoundingClientRect();
1081
+ const n = this.canvas, a = n.width / parseInt(n.style.width), o = n.getBoundingClientRect();
1100
1082
  if (t.touches && t.touches.length) {
1101
1083
  const d = t.touches[0];
1102
1084
  e = d.clientX, i = d.clientY;
1103
1085
  } else
1104
1086
  e = t.x || t.clientX, i = t.y || t.clientY;
1105
- const h = parseInt((e - o.left) * n), l = parseInt((i - o.top) * n);
1087
+ const h = parseInt((e - o.left) * a), l = parseInt((i - o.top) * a);
1106
1088
  this.mouse.x = h, this.mouse.y = l;
1107
1089
  }
1108
1090
  /**
@@ -1145,10 +1127,10 @@ class kt extends k {
1145
1127
  resize() {
1146
1128
  const { canvas: t, ctx: e } = this, i = t.toDataURL();
1147
1129
  if (this.scale(), this.setupBackground(e), i !== "data:,") {
1148
- const a = new globalThis.Image();
1149
- L.on("load", a, function n() {
1150
- e.drawImage(a, 0, 0), L.off("load", a, n);
1151
- }), a.src = i;
1130
+ const n = new globalThis.Image();
1131
+ P.on("load", n, function a() {
1132
+ e.drawImage(n, 0, 0), P.off("load", n, a);
1133
+ }), n.src = i;
1152
1134
  }
1153
1135
  this.draw();
1154
1136
  }
@@ -1167,7 +1149,7 @@ class kt extends k {
1167
1149
  * @returns {void}
1168
1150
  */
1169
1151
  noScaleResize() {
1170
- const t = B.getSize(container);
1152
+ const t = W.getSize(container);
1171
1153
  this.width = canvas.width = t.width, this.height = canvas.height = t.height;
1172
1154
  }
1173
1155
  /**
@@ -1177,11 +1159,11 @@ class kt extends k {
1177
1159
  * @returns {void}
1178
1160
  */
1179
1161
  scale() {
1180
- const t = this.canvas, e = this.container, i = B.getSize(e), a = this.targetSize, n = a.width, o = a.height;
1181
- let h = n + "px", l = o + "px";
1182
- if (this.width = t.width = n, this.height = t.height = o, i.width !== 0 && i.height !== 0) {
1183
- const d = i.width, g = i.height, c = d / n, m = g / o, x = Math.min(c, m);
1184
- h = n * x + "px", l = o * x + "px";
1162
+ const t = this.canvas, e = this.container, i = W.getSize(e), n = this.targetSize, a = n.width, o = n.height;
1163
+ let h = a + "px", l = o + "px";
1164
+ if (this.width = t.width = a, this.height = t.height = o, i.width !== 0 && i.height !== 0) {
1165
+ const d = i.width, g = i.height, c = d / a, m = g / o, x = Math.min(c, m);
1166
+ h = a * x + "px", l = o * x + "px";
1185
1167
  }
1186
1168
  t.style.width = h, t.style.height = l;
1187
1169
  }
@@ -1203,8 +1185,8 @@ class kt extends k {
1203
1185
  drawBottomLine(t) {
1204
1186
  const e = this.canvas;
1205
1187
  t.globalAlpha = 1, t.shadowBlur = 0;
1206
- const i = this.margin.x, a = this.height - this.margin.y;
1207
- t.beginPath(), t.moveTo(i, a), t.lineTo(e.width - this.margin.x, a), t.lineWidth = this.baseLineWidth, t.strokeStyle = this.baseStrokeColor, t.stroke(), t.closePath();
1188
+ const i = this.margin.x, n = this.height - this.margin.y;
1189
+ t.beginPath(), t.moveTo(i, n), t.lineTo(e.width - this.margin.x, n), t.lineWidth = this.baseLineWidth, t.strokeStyle = this.baseStrokeColor, t.stroke(), t.closePath();
1208
1190
  }
1209
1191
  /**
1210
1192
  * Adds a line to the current path, updating the 'signed' status.
@@ -1215,10 +1197,10 @@ class kt extends k {
1215
1197
  * @param {string} color The stroke color.
1216
1198
  * @returns {void}
1217
1199
  */
1218
- addLine(t, e, i, a) {
1200
+ addLine(t, e, i, n) {
1219
1201
  this.signed || (this.signed = !0);
1220
- const n = Math.round(e), o = Math.round(i);
1221
- t.lineWidth = this.lineWidth, t.strokeStyle = a, t.lineTo(n, o), t.stroke();
1202
+ const a = Math.round(e), o = Math.round(i);
1203
+ t.lineWidth = this.lineWidth, t.strokeStyle = n, t.lineTo(a, o), t.stroke();
1222
1204
  }
1223
1205
  /**
1224
1206
  * Clears the canvas, sets signed to false, and re-initializes
@@ -1257,7 +1239,7 @@ class kt extends k {
1257
1239
  this.timer.stop(), this.status = "stopped";
1258
1240
  }
1259
1241
  }
1260
- class Ut extends k {
1242
+ class Ft extends k {
1261
1243
  /**
1262
1244
  * Sets up default properties for the signature panel.
1263
1245
  *
@@ -1274,19 +1256,19 @@ class Ut extends k {
1274
1256
  */
1275
1257
  render() {
1276
1258
  return r({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
1277
- F({
1259
+ Y({
1278
1260
  cache: "hiddenInput",
1279
1261
  required: !0,
1280
1262
  bind: this.path + ".data"
1281
1263
  }),
1282
1264
  r({ class: "absolute top-2 right-2" }, [
1283
- C({
1265
+ $({
1284
1266
  variant: "icon",
1285
- icon: D.circleX,
1267
+ icon: S.circleX,
1286
1268
  click: this.reset.bind(this)
1287
1269
  })
1288
1270
  ]),
1289
- new kt({
1271
+ new yt({
1290
1272
  cache: "canvasLayer",
1291
1273
  margin: this.margin,
1292
1274
  targetSize: this.targetSize,
@@ -1344,26 +1326,26 @@ class Ut extends k {
1344
1326
  }
1345
1327
  }
1346
1328
  export {
1347
- Mt as B,
1348
- Ct as I,
1349
- Tt as N,
1350
- Lt as P,
1351
- Ut as S,
1352
- Nt as T,
1353
- jt as U,
1354
- Wt as W,
1355
- $t as a,
1356
- rt as b,
1357
- It as c,
1358
- zt as d,
1359
- vt as e,
1360
- X as f,
1361
- H as g,
1362
- _ as h,
1363
- R as i,
1364
- Bt as j,
1365
- P as k,
1366
- Pt as l,
1367
- G as m,
1368
- E as n
1329
+ Nt as B,
1330
+ $t as I,
1331
+ Mt as N,
1332
+ Pt as P,
1333
+ Ft as S,
1334
+ zt as T,
1335
+ It as U,
1336
+ Tt as W,
1337
+ jt as a,
1338
+ ht as b,
1339
+ At as c,
1340
+ Ut as d,
1341
+ xt as e,
1342
+ H as f,
1343
+ J as g,
1344
+ K as h,
1345
+ G as i,
1346
+ Wt as j,
1347
+ C as k,
1348
+ Ct as l,
1349
+ X as m,
1350
+ V as n
1369
1351
  };