@shlinkio/shlink-frontend-kit 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,207 +1,207 @@
1
- import { jsxs as b, jsx as s, Fragment as G } from "react/jsx-runtime";
2
- import p, { clsx as f } from "clsx";
3
- import { useRef as I, useState as S, useEffect as T, forwardRef as N, useCallback as v, createContext as X, useContext as E, useId as _, useImperativeHandle as ke, useMemo as D } from "react";
4
- import { Link as q, useNavigate as we, useLocation as se, NavLink as ve } from "react-router";
5
- import { faClose as Ne, faEyeSlash as Ce, faEye as Ae, faCircleNotch as le, faSearch as Ie, faCheck as Oe, faCaretDown as Le, faChevronUp as Re, faChevronDown as Te, faChevronLeft as te, faChevronRight as re, faEllipsisV as Se, faSortAmountUp as Pe, faSortAmountDown as De } from "@fortawesome/free-solid-svg-icons";
6
- import { FontAwesomeIcon as A } from "@fortawesome/react-fontawesome";
7
- import { useFloating as ie, flip as Ee, offset as Me, useClick as _e, useInteractions as de, autoPlacement as Be, arrow as Fe, useHover as $e, useTransitionStyles as He } from "@floating-ui/react";
1
+ import { jsxs as g, jsx as o, Fragment as $ } from "react/jsx-runtime";
2
+ import { clsx as d } from "clsx";
3
+ import { useRef as T, useState as P, useEffect as R, forwardRef as v, useCallback as k, createContext as W, useContext as S, useId as M, useImperativeHandle as we, useMemo as E } from "react";
4
+ import { Link as q, useNavigate as ke, useLocation as ae, NavLink as ve } from "react-router";
5
+ import { faClose as Ne, faEyeSlash as Ce, faEye as Te, faCircleNotch as se, faSearch as Ae, faCheck as Ie, faCaretDown as Oe, faChevronUp as Le, faChevronDown as Re, faChevronLeft as ee, faChevronRight as te, faEllipsisV as Pe, faSortAmountUp as Ee, faSortAmountDown as Se } from "@fortawesome/free-solid-svg-icons";
6
+ import { FontAwesomeIcon as C } from "@fortawesome/react-fontawesome";
7
+ import { useFloating as le, flip as De, offset as Me, useClick as _e, useInteractions as ie, autoPlacement as Fe, arrow as Be, useHover as He, useTransitionStyles as $e } from "@floating-ui/react";
8
8
  import { faClone as je } from "@fortawesome/free-regular-svg-icons";
9
9
  import { createPortal as Ue } from "react-dom";
10
- const er = ({ children: t, summary: r, summaryClasses: e, ...n }) => {
11
- const a = I(null), [o, l] = S(!1);
12
- return T(() => {
13
- const i = a.current, d = () => l(!!(i != null && i.open));
14
- return i == null || i.addEventListener("toggle", d), () => i == null ? void 0 : i.removeEventListener("toggle", d);
15
- }, []), /* @__PURE__ */ b("details", { ref: a, ...n, children: [
16
- /* @__PURE__ */ s("summary", { className: f("focus-ring px-1 -mx-1 rounded-sm", e), children: r }),
17
- o && /* @__PURE__ */ s("div", { className: "mt-3 flex flex-col gap-y-3", children: t })
10
+ const er = ({ children: e, summary: r, summaryClasses: t, ...n }) => {
11
+ const a = T(null), [s, l] = P(!1);
12
+ return R(() => {
13
+ const i = a.current, c = () => l(!!i?.open);
14
+ return i?.addEventListener("toggle", c), () => i?.removeEventListener("toggle", c);
15
+ }, []), /* @__PURE__ */ g("details", { ref: a, ...n, children: [
16
+ /* @__PURE__ */ o("summary", { className: d("focus-ring px-1 -mx-1 rounded-sm", t), children: r }),
17
+ s && /* @__PURE__ */ o("div", { className: "mt-3 flex flex-col gap-y-3", children: e })
18
18
  ] });
19
- }, Ge = N(({ className: t, ...r }, e) => /* @__PURE__ */ s(
19
+ }, Ge = v(({ className: e, ...r }, t) => /* @__PURE__ */ o(
20
20
  "div",
21
21
  {
22
- className: p(
22
+ className: d(
23
23
  "px-4 py-3 rounded-t-md",
24
24
  "bg-lm-primary dark:bg-dm-primary border-b border-lm-border dark:border-dm-border",
25
- t
25
+ e
26
26
  ),
27
27
  ...r,
28
- ref: e
28
+ ref: t
29
29
  }
30
- )), We = N(({ className: t, ...r }, e) => /* @__PURE__ */ s(
30
+ )), Ke = v(({ className: e, ...r }, t) => /* @__PURE__ */ o(
31
31
  "div",
32
32
  {
33
- className: p(
33
+ className: d(
34
34
  "p-4 bg-lm-primary dark:bg-dm-primary first:rounded-t-md",
35
35
  "first:rounded-t-md last:rounded-b-md",
36
- t
36
+ e
37
37
  ),
38
38
  ...r,
39
- ref: e
39
+ ref: t
40
40
  }
41
- )), Ke = N(({ className: t, ...r }, e) => /* @__PURE__ */ s(
41
+ )), We = v(({ className: e, ...r }, t) => /* @__PURE__ */ o(
42
42
  "div",
43
43
  {
44
- className: p(
44
+ className: d(
45
45
  "px-4 py-3 rounded-b-md",
46
46
  "bg-lm-primary dark:bg-dm-primary border-t border-lm-border dark:border-dm-border",
47
- t
47
+ e
48
48
  ),
49
49
  ...r,
50
- ref: e
50
+ ref: t
51
51
  }
52
- )), qe = N(({ className: t, ...r }, e) => /* @__PURE__ */ s(
52
+ )), qe = v(({ className: e, ...r }, t) => /* @__PURE__ */ o(
53
53
  "div",
54
54
  {
55
- className: p(
55
+ className: d(
56
56
  "group/card rounded-md shadow-md",
57
57
  "border border-lm-border dark:border-dm-border bg-lm-primary dark:bg-dm-primary",
58
- t
58
+ e
59
59
  ),
60
60
  ...r,
61
- ref: e
61
+ ref: t
62
62
  }
63
- )), L = Object.assign(qe, { Body: We, Header: Ge, Footer: Ke }), Qe = N(({ bodyClassName: t, children: r, ...e }, n) => {
64
- const { title: a, titleSize: o = "md", ...l } = "title" in e ? e : {
65
- ...e,
63
+ )), O = Object.assign(qe, { Body: Ke, Header: Ge, Footer: We }), Qe = v(({ bodyClassName: e, children: r, ...t }, n) => {
64
+ const { title: a, titleSize: s = "md", ...l } = "title" in t ? t : {
65
+ ...t,
66
66
  title: void 0,
67
67
  titleSize: void 0
68
68
  };
69
- return /* @__PURE__ */ b(L, { ...l, ref: n, children: [
70
- a && /* @__PURE__ */ b(L.Header, { children: [
71
- o === "lg" && /* @__PURE__ */ s("h4", { children: a }),
72
- o === "md" && /* @__PURE__ */ s("h5", { children: a }),
73
- o === "sm" && /* @__PURE__ */ s("h6", { children: a })
69
+ return /* @__PURE__ */ g(O, { ...l, ref: n, children: [
70
+ a && /* @__PURE__ */ g(O.Header, { children: [
71
+ s === "lg" && /* @__PURE__ */ o("h4", { children: a }),
72
+ s === "md" && /* @__PURE__ */ o("h5", { children: a }),
73
+ s === "sm" && /* @__PURE__ */ o("h6", { children: a })
74
74
  ] }),
75
- /* @__PURE__ */ s(L.Body, { className: t, children: r })
75
+ /* @__PURE__ */ o(O.Body, { className: e, children: r })
76
76
  ] });
77
77
  });
78
78
  function Ye({
79
- id: t,
79
+ id: e,
80
80
  items: r,
81
- onSelectItem: e,
81
+ onSelectItem: t,
82
82
  onActiveItemChange: n,
83
83
  renderItem: a,
84
- className: o,
84
+ className: s,
85
85
  noItemsMessage: l = "No items",
86
86
  anchor: i,
87
- "aria-label": d = "Items",
88
- ...c
87
+ "aria-label": c = "Items",
88
+ ...m
89
89
  }) {
90
- const [k, w] = S(0), x = v((g) => {
91
- if (w(g), n) {
92
- const [m, h] = [...r.entries()][g];
93
- n(m, h);
90
+ const [f, w] = P(0), x = k((h) => {
91
+ if (w(h), n) {
92
+ const [u, p] = [...r.entries()][h];
93
+ n(u, p);
94
94
  }
95
95
  }, [r, n]);
96
- return T(() => {
97
- const g = i == null ? void 0 : i.current;
98
- if (!g)
96
+ return R(() => {
97
+ const h = i?.current;
98
+ if (!h)
99
99
  return;
100
- const m = (h) => {
101
- ["Enter", "ArrowUp", "ArrowDown"].includes(h.key) && h.preventDefault(), h.key === "ArrowDown" ? x(Math.min(k + 1, r.size - 1)) : h.key === "ArrowUp" ? x(Math.max(k - 1, 0)) : h.key === "Enter" && e([...r.values()][k]);
100
+ const u = (p) => {
101
+ ["Enter", "ArrowUp", "ArrowDown"].includes(p.key) && p.preventDefault(), p.key === "ArrowDown" ? x(Math.min(f + 1, r.size - 1)) : p.key === "ArrowUp" ? x(Math.max(f - 1, 0)) : p.key === "Enter" && t([...r.values()][f]);
102
102
  };
103
- return g.addEventListener("keydown", m), () => g.removeEventListener("keydown", m);
104
- }, [k, i, x, r, e]), /* @__PURE__ */ b(
105
- L,
103
+ return h.addEventListener("keydown", u), () => h.removeEventListener("keydown", u);
104
+ }, [f, i, x, r, t]), /* @__PURE__ */ g(
105
+ O,
106
106
  {
107
- id: t,
108
- className: p("py-1 flex flex-col", o),
107
+ id: e,
108
+ className: d("py-1 flex flex-col", s),
109
109
  role: "listbox",
110
110
  "aria-orientation": "vertical",
111
- "aria-label": d,
112
- ...c,
111
+ "aria-label": c,
112
+ ...m,
113
113
  children: [
114
- r.size === 0 && /* @__PURE__ */ s("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "px-2 py-1", children: l }),
115
- [...r.entries()].map(([g, m], h) => /* @__PURE__ */ s(
114
+ r.size === 0 && /* @__PURE__ */ o("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "px-2 py-1", children: l }),
115
+ [...r.entries()].map(([h, u], p) => /* @__PURE__ */ o(
116
116
  "button",
117
117
  {
118
- id: `${t}_${g}`,
118
+ id: `${e}_${h}`,
119
119
  type: "button",
120
120
  role: "option",
121
- "aria-selected": h === k,
122
- className: p(
121
+ "aria-selected": p === f,
122
+ className: d(
123
123
  "px-2 py-1 text-left truncate",
124
- { "bg-lm-secondary dark:bg-dm-secondary": h === k }
124
+ { "bg-lm-secondary dark:bg-dm-secondary": p === f }
125
125
  ),
126
126
  tabIndex: -1,
127
- onClick: () => e(m),
128
- onMouseOver: () => x(h),
129
- children: a(m)
127
+ onClick: () => t(u),
128
+ onMouseOver: () => x(p),
129
+ children: a(u)
130
130
  },
131
- g
131
+ h
132
132
  ))
133
133
  ]
134
134
  }
135
135
  );
136
136
  }
137
- const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t, className: r }) => {
138
- const { responsive: e } = E(F);
139
- return /* @__PURE__ */ s(W.Provider, { value: { section: "head" }, children: /* @__PURE__ */ s(
137
+ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e, className: r }) => {
138
+ const { responsive: t } = S(F);
139
+ return /* @__PURE__ */ o(j.Provider, { value: { section: "head" }, children: /* @__PURE__ */ o(
140
140
  "thead",
141
141
  {
142
- className: p(
143
- { "hidden lg:table-header-group": e },
142
+ className: d(
143
+ { "hidden lg:table-header-group": t },
144
144
  r
145
145
  ),
146
- children: t
146
+ children: e
147
147
  }
148
148
  ) });
149
- }, Je = ({ children: t, className: r }) => {
150
- const { responsive: e } = E(F);
151
- return /* @__PURE__ */ s(W.Provider, { value: { section: "body" }, children: /* @__PURE__ */ s(
149
+ }, Je = ({ children: e, className: r }) => {
150
+ const { responsive: t } = S(F);
151
+ return /* @__PURE__ */ o(j.Provider, { value: { section: "body" }, children: /* @__PURE__ */ o(
152
152
  "tbody",
153
153
  {
154
- className: p(
155
- { "lg:table-row-group flex flex-col gap-y-3": e },
154
+ className: d(
155
+ { "lg:table-row-group flex flex-col gap-y-3": t },
156
156
  r
157
157
  ),
158
- children: t
158
+ children: e
159
159
  }
160
160
  ) });
161
- }, Ze = ({ children: t, className: r }) => {
162
- const { responsive: e } = E(F);
163
- return /* @__PURE__ */ s(W.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ s(
161
+ }, Ze = ({ children: e, className: r }) => {
162
+ const { responsive: t } = S(F);
163
+ return /* @__PURE__ */ o(j.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ o(
164
164
  "tfoot",
165
165
  {
166
- className: p(
167
- { "lg:table-row-group flex flex-col gap-y-3 mt-4": e },
166
+ className: d(
167
+ { "lg:table-row-group flex flex-col gap-y-3 mt-4": t },
168
168
  r
169
169
  ),
170
- children: t
170
+ children: e
171
171
  }
172
172
  ) });
173
- }, Ve = ({ children: t, className: r, ...e }) => {
174
- const n = E(W), a = (n == null ? void 0 : n.section) === "body", { responsive: o } = E(F);
175
- return /* @__PURE__ */ s(
173
+ }, Ve = ({ children: e, className: r, ...t }) => {
174
+ const a = S(j)?.section === "body", { responsive: s } = S(F);
175
+ return /* @__PURE__ */ o(
176
176
  "tr",
177
177
  {
178
- className: p(
178
+ className: d(
179
179
  "group",
180
180
  {
181
- "lg:table-row flex flex-col": o,
182
- "lg:border-0 border-y-2 border-lm-border dark:border-dm-border": o,
181
+ "lg:table-row flex flex-col": s,
182
+ "lg:border-0 border-y-2 border-lm-border dark:border-dm-border": s,
183
183
  "hover:bg-lm-primary dark:hover:bg-dm-primary": a,
184
184
  // Use a different hover bg color depending on the table being inside a card or not
185
185
  "group-[&]/card:hover:bg-lm-secondary dark:group-[&]/card:hover:bg-dm-secondary": a
186
186
  },
187
187
  r
188
188
  ),
189
- ...e,
190
- children: t
189
+ ...t,
190
+ children: e
191
191
  }
192
192
  );
193
- }, ze = ({ children: t, className: r, columnName: e, type: n, ...a }) => {
194
- const o = E(W), l = n ?? ((o == null ? void 0 : o.section) !== "body" ? "th" : "td"), { responsive: i, size: d } = E(F);
195
- return /* @__PURE__ */ s(
193
+ }, ze = ({ children: e, className: r, columnName: t, type: n, ...a }) => {
194
+ const s = S(j), l = n ?? (s?.section !== "body" ? "th" : "td"), { responsive: i, size: c } = S(F);
195
+ return /* @__PURE__ */ o(
196
196
  l,
197
197
  {
198
- "data-column": i ? e : void 0,
199
- className: p(
198
+ "data-column": i ? t : void 0,
199
+ className: d(
200
200
  "border-lm-border dark:border-dm-border",
201
201
  {
202
- "p-1": d === "sm",
203
- "p-2": d === "md",
204
- "p-3": d === "lg",
202
+ "p-1": c === "sm",
203
+ "p-2": c === "md",
204
+ "p-3": c === "lg",
205
205
  "border-b-1": !i,
206
206
  "block lg:table-cell not-last:border-b-1 lg:border-b-1": i,
207
207
  "text-left": l === "th",
@@ -211,29 +211,29 @@ const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t,
211
211
  r
212
212
  ),
213
213
  ...a,
214
- children: t
214
+ children: e
215
215
  }
216
216
  );
217
- }, et = ({ header: t, footer: r, children: e, responsive: n = !0, size: a = "md", ...o }) => /* @__PURE__ */ s(F.Provider, { value: { responsive: n, size: a }, children: /* @__PURE__ */ b("table", { className: "w-full", ...o, children: [
218
- /* @__PURE__ */ s(Xe, { children: t }),
219
- /* @__PURE__ */ s(Je, { children: e }),
220
- r && /* @__PURE__ */ s(Ze, { children: r })
221
- ] }) }), tr = Object.assign(et, { Row: Ve, Cell: ze }), ce = N(({
222
- className: t,
217
+ }, et = ({ header: e, footer: r, children: t, responsive: n = !0, size: a = "md", ...s }) => /* @__PURE__ */ o(F.Provider, { value: { responsive: n, size: a }, children: /* @__PURE__ */ g("table", { className: "w-full", ...s, children: [
218
+ /* @__PURE__ */ o(Xe, { children: e }),
219
+ /* @__PURE__ */ o(Je, { children: t }),
220
+ r && /* @__PURE__ */ o(Ze, { children: r })
221
+ ] }) }), tr = Object.assign(et, { Row: Ve, Cell: ze }), de = v(({
222
+ className: e,
223
223
  disabled: r,
224
- variant: e = "primary",
224
+ variant: t = "primary",
225
225
  size: n = "md",
226
226
  inline: a = !1,
227
- solid: o = !1,
227
+ solid: s = !1,
228
228
  type: l = "button",
229
229
  ...i
230
- }, d) => {
231
- const c = "to" in i && typeof i.to == "string", k = c ? q : "button", w = c ? void 0 : l;
232
- return /* @__PURE__ */ s(
233
- k,
230
+ }, c) => {
231
+ const m = "to" in i && typeof i.to == "string", f = m ? q : "button", w = m ? void 0 : l;
232
+ return /* @__PURE__ */ o(
233
+ f,
234
234
  {
235
- ref: d,
236
- className: p(
235
+ ref: c,
236
+ className: d(
237
237
  {
238
238
  "inline-flex": a,
239
239
  flex: !a
@@ -242,9 +242,9 @@ const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t,
242
242
  "border rounded-md no-underline",
243
243
  "transition-colors",
244
244
  {
245
- "focus-ring": e === "primary",
246
- "focus-ring-secondary": e === "secondary",
247
- "focus-ring-danger": e === "danger"
245
+ "focus-ring": t === "primary",
246
+ "focus-ring-secondary": t === "secondary",
247
+ "focus-ring-danger": t === "danger"
248
248
  },
249
249
  {
250
250
  "px-1.5 py-1 text-sm": n === "sm",
@@ -252,125 +252,125 @@ const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t,
252
252
  "px-4 py-2 text-lg": n === "lg"
253
253
  },
254
254
  {
255
- "border-lm-brand dark:border-dm-brand": e === "primary",
256
- "text-lm-brand dark:text-dm-brand": e === "primary" && !o,
257
- "border-zinc-500": e === "secondary",
258
- "text-zinc-500": e === "secondary" && !o,
259
- "border-danger": e === "danger",
260
- "text-danger": e === "danger" && !o
255
+ "border-lm-brand dark:border-dm-brand": t === "primary",
256
+ "text-lm-brand dark:text-dm-brand": t === "primary" && !s,
257
+ "border-zinc-500": t === "secondary",
258
+ "text-zinc-500": t === "secondary" && !s,
259
+ "border-danger": t === "danger",
260
+ "text-danger": t === "danger" && !s
261
261
  },
262
- o && {
262
+ s && {
263
263
  "text-white": !0,
264
- "bg-lm-brand dark:bg-dm-brand": e === "primary",
265
- "highlight:bg-lm-brand-dark dark:highlight:bg-dm-brand-dark": e === "primary",
266
- "highlight:border-lm-brand-dark dark:highlight:border-dm-brand-dark": e === "primary",
267
- "bg-zinc-500": e === "secondary",
268
- "highlight:bg-zinc-600 highlight:border-zinc-600": e === "secondary",
269
- "bg-danger": e === "danger",
270
- "highlight:bg-danger-dark highlight:border-danger-dark": e === "danger"
264
+ "bg-lm-brand dark:bg-dm-brand": t === "primary",
265
+ "highlight:bg-lm-brand-dark dark:highlight:bg-dm-brand-dark": t === "primary",
266
+ "highlight:border-lm-brand-dark dark:highlight:border-dm-brand-dark": t === "primary",
267
+ "bg-zinc-500": t === "secondary",
268
+ "highlight:bg-zinc-600 highlight:border-zinc-600": t === "secondary",
269
+ "bg-danger": t === "danger",
270
+ "highlight:bg-danger-dark highlight:border-danger-dark": t === "danger"
271
271
  },
272
272
  !r && {
273
- "highlight:text-white": !o,
274
- "highlight:bg-lm-brand dark:highlight:bg-dm-brand": e === "primary",
275
- "highlight:bg-zinc-500": e === "secondary",
276
- "highlight:bg-danger": e === "danger"
273
+ "highlight:text-white": !s,
274
+ "highlight:bg-lm-brand dark:highlight:bg-dm-brand": t === "primary",
275
+ "highlight:bg-zinc-500": t === "secondary",
276
+ "highlight:bg-danger": t === "danger"
277
277
  },
278
278
  {
279
279
  "cursor-pointer": !r,
280
280
  "pointer-events-none opacity-65": r
281
281
  },
282
- t
282
+ e
283
283
  ),
284
- disabled: c ? void 0 : r,
285
- "aria-disabled": c ? r : void 0,
284
+ disabled: m ? void 0 : r,
285
+ "aria-disabled": m ? r : void 0,
286
286
  type: w,
287
287
  ...i
288
288
  }
289
289
  );
290
- }), me = N(({ className: t, onChange: r, ...e }, n) => {
291
- const a = v((o) => r == null ? void 0 : r(o.target.checked, o), [r]);
292
- return /* @__PURE__ */ s(
290
+ }), ce = v(({ className: e, onChange: r, ...t }, n) => {
291
+ const a = k((s) => r?.(s.target.checked, s), [r]);
292
+ return /* @__PURE__ */ o(
293
293
  "input",
294
294
  {
295
295
  ref: n,
296
296
  type: "checkbox",
297
- className: f(
297
+ className: d(
298
298
  "appearance-none focus-ring cursor-[inherit]",
299
299
  "border-1 border-lm-input-border dark:border-dm-input-border",
300
300
  "bg-lm-primary dark:bg-dm-primary checked:bg-lm-brand dark:checked:bg-dm-brand bg-no-repeat",
301
301
  // Use different background color when rendered inside a card
302
302
  "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input",
303
- t
303
+ e
304
304
  ),
305
305
  onChange: a,
306
- ...e
306
+ ...t
307
307
  }
308
308
  );
309
- }), rr = N(({ className: t, ...r }, e) => /* @__PURE__ */ s(
310
- me,
309
+ }), rr = v(({ className: e, ...r }, t) => /* @__PURE__ */ o(
310
+ ce,
311
311
  {
312
- ref: e,
313
- className: f("rounded-sm w-4 h-4 checked:bg-(image:--tick) bg-center", t),
312
+ ref: t,
313
+ className: d("rounded-sm w-4 h-4 checked:bg-(image:--tick) bg-center", e),
314
314
  ...r
315
315
  }
316
- )), Q = N(({ onClick: t, className: r, label: e = "Close", size: n = "lg", solid: a }, o) => /* @__PURE__ */ s(
316
+ )), Y = v(({ onClick: e, className: r, label: t = "Close", size: n = "lg", solid: a }, s) => /* @__PURE__ */ o(
317
317
  "button",
318
318
  {
319
- ref: o,
319
+ ref: s,
320
320
  type: "button",
321
- onClick: t,
322
- className: p(
321
+ onClick: e,
322
+ className: d(
323
323
  "rounded-md focus-ring cursor-pointer",
324
324
  {
325
325
  "opacity-50 highlight:opacity-80 transition-opacity": !a
326
326
  },
327
327
  r
328
328
  ),
329
- "aria-label": e,
330
- children: /* @__PURE__ */ s(A, { icon: Ne, size: n === "lg" ? "xl" : n === "md" ? "lg" : void 0 })
329
+ "aria-label": t,
330
+ children: /* @__PURE__ */ o(C, { icon: Ne, size: n === "lg" ? "xl" : n === "md" ? "lg" : void 0 })
331
331
  }
332
- )), J = N(({
333
- borderless: t = !1,
332
+ )), J = v(({
333
+ borderless: e = !1,
334
334
  size: r = "md",
335
- feedback: e,
335
+ feedback: t,
336
336
  variant: n = "default",
337
337
  className: a,
338
- disabled: o,
338
+ disabled: s,
339
339
  ...l
340
- }, i) => /* @__PURE__ */ s(
340
+ }, i) => /* @__PURE__ */ o(
341
341
  "input",
342
342
  {
343
343
  ref: i,
344
- className: p(
344
+ className: d(
345
345
  "outline-none",
346
346
  n === "default" && [
347
347
  "w-full",
348
348
  {
349
- "focus-ring": !e,
350
- "focus-ring-danger": e === "error",
349
+ "focus-ring": !t,
350
+ "focus-ring-danger": t === "error",
351
351
  "px-2 py-1 text-sm": r === "sm",
352
352
  "px-3 py-1.5": r === "md",
353
353
  "px-4 py-2 text-xl": r === "lg",
354
- "rounded-md border": !t,
355
- "border-lm-input-border dark:border-dm-input-border": !t && !e,
356
- "border-danger": !t && e === "error",
357
- "bg-lm-disabled-input dark:bg-dm-disabled-input": o,
358
- "bg-lm-primary dark:bg-dm-primary": !o,
354
+ "rounded-md border": !e,
355
+ "border-lm-input-border dark:border-dm-input-border": !e && !t,
356
+ "border-danger": !e && t === "error",
357
+ "bg-lm-disabled-input dark:bg-dm-disabled-input": s,
358
+ "bg-lm-primary dark:bg-dm-primary": !s,
359
359
  // Use different background color when rendered inside a card
360
- "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !o
360
+ "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !s
361
361
  }
362
362
  ],
363
363
  a
364
364
  ),
365
- disabled: o,
365
+ disabled: s,
366
366
  ...l
367
367
  }
368
- )), Z = ({ required: t, children: r, className: e, ...n }) => /* @__PURE__ */ b("label", { className: f("cursor-pointer", e), ...n, children: [
368
+ )), Z = ({ required: e, children: r, className: t, ...n }) => /* @__PURE__ */ g("label", { className: d("cursor-pointer", t), ...n, children: [
369
369
  r,
370
- t && /* @__PURE__ */ s("span", { className: "text-danger ml-1", "data-testid": "required-indicator", children: "*" })
371
- ] }), V = ({ children: t, helpText: r, error: e, "data-testid": n }) => /* @__PURE__ */ b("div", { className: "flex flex-col gap-1", "data-testid": n, children: [
372
- t,
373
- r && /* @__PURE__ */ s(
370
+ e && /* @__PURE__ */ o("span", { className: "text-danger ml-1", "data-testid": "required-indicator", children: "*" })
371
+ ] }), V = ({ children: e, helpText: r, error: t, "data-testid": n }) => /* @__PURE__ */ g("div", { className: "flex flex-col gap-1", "data-testid": n, children: [
372
+ e,
373
+ r && /* @__PURE__ */ o(
374
374
  "small",
375
375
  {
376
376
  "data-testid": n ? `${n}-help-text` : "help-text",
@@ -378,108 +378,107 @@ const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t,
378
378
  children: r
379
379
  }
380
380
  ),
381
- e && /* @__PURE__ */ s("span", { "data-testid": n ? `${n}-error` : "error", className: "text-danger", children: e })
382
- ] }), nr = N(({ label: t, inputClassName: r, required: e, hiddenRequired: n, error: a, helpText: o, "data-testid": l, ...i }, d) => {
383
- const c = _();
384
- return /* @__PURE__ */ b(V, { error: a, helpText: o, "data-testid": l, children: [
385
- /* @__PURE__ */ s(Z, { htmlFor: c, required: e, children: t }),
386
- /* @__PURE__ */ s(
381
+ t && /* @__PURE__ */ o("span", { "data-testid": n ? `${n}-error` : "error", className: "text-danger", children: t })
382
+ ] }), nr = v(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: a, helpText: s, "data-testid": l, ...i }, c) => {
383
+ const m = M();
384
+ return /* @__PURE__ */ g(V, { error: a, helpText: s, "data-testid": l, children: [
385
+ /* @__PURE__ */ o(Z, { htmlFor: m, required: t, children: e }),
386
+ /* @__PURE__ */ o(
387
387
  J,
388
388
  {
389
- ref: d,
390
- id: c,
389
+ ref: c,
390
+ id: m,
391
391
  className: r,
392
- required: e || n,
392
+ required: t || n,
393
393
  feedback: a ? "error" : void 0,
394
394
  ...i
395
395
  }
396
396
  )
397
397
  ] });
398
- }), tt = N(({ containerClassName: t, className: r, size: e, ...n }, a) => {
399
- const { flag: o, toggle: l, setToFalse: i } = pe(), d = I(null), c = v(({ relatedTarget: k }) => {
400
- var w;
401
- (w = d.current) != null && w.contains(k) || i();
402
- }, [d, i]);
403
- return /* @__PURE__ */ b(
398
+ }), tt = v(({ containerClassName: e, className: r, size: t, ...n }, a) => {
399
+ const { flag: s, toggle: l, setToFalse: i } = ue(), c = T(null), m = k(({ relatedTarget: f }) => {
400
+ c.current?.contains(f) || i();
401
+ }, [c, i]);
402
+ return /* @__PURE__ */ g(
404
403
  "div",
405
404
  {
406
- className: f("group relative", t),
407
- ref: d,
408
- onBlurCapture: c,
405
+ className: d("group relative", e),
406
+ ref: c,
407
+ onBlurCapture: m,
409
408
  children: [
410
- /* @__PURE__ */ s(
409
+ /* @__PURE__ */ o(
411
410
  J,
412
411
  {
413
412
  ref: a,
414
- type: o ? "text" : "password",
415
- className: f(
413
+ type: s ? "text" : "password",
414
+ className: d(
416
415
  {
417
- "pr-10": e !== "sm",
418
- "pr-8": e === "sm"
416
+ "pr-10": t !== "sm",
417
+ "pr-8": t === "sm"
419
418
  },
420
419
  r
421
420
  ),
422
- size: e,
421
+ size: t,
423
422
  "data-testid": "input",
424
423
  ...n
425
424
  }
426
425
  ),
427
- /* @__PURE__ */ s(
426
+ /* @__PURE__ */ o(
428
427
  "button",
429
428
  {
430
429
  type: "button",
431
430
  onClick: l,
432
- title: o ? "Hide password" : "Show password",
433
- "aria-label": o ? "Hide password" : "Show password",
434
- className: f(
431
+ title: s ? "Hide password" : "Show password",
432
+ "aria-label": s ? "Hide password" : "Show password",
433
+ className: d(
435
434
  "absolute top-[50%] translate-y-[-50%] px-1 cursor-pointer",
436
435
  "text-placeholder hover:text-lm-text hover:dark:text-dm-text transition-colors",
437
436
  {
438
- "right-1.5": e !== "sm",
439
- "scale-85 right-1": e === "sm"
437
+ "right-1.5": t !== "sm",
438
+ "scale-85 right-1": t === "sm"
440
439
  }
441
440
  ),
442
441
  tabIndex: -1,
443
- children: /* @__PURE__ */ s(A, { fixedWidth: !0, icon: o ? Ce : Ae })
442
+ children: /* @__PURE__ */ o(C, { icon: s ? Ce : Te })
444
443
  }
445
444
  )
446
445
  ]
447
446
  }
448
447
  );
449
- }), or = N(({ label: t, inputClassName: r, required: e, hiddenRequired: n, error: a, helpText: o, "data-testid": l, ...i }, d) => {
450
- const c = _();
451
- return /* @__PURE__ */ b(V, { error: a, helpText: o, "data-testid": l, children: [
452
- /* @__PURE__ */ s(Z, { htmlFor: c, required: e, children: t }),
453
- /* @__PURE__ */ s(
448
+ }), or = v(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: a, helpText: s, "data-testid": l, ...i }, c) => {
449
+ const m = M();
450
+ return /* @__PURE__ */ g(V, { error: a, helpText: s, "data-testid": l, children: [
451
+ /* @__PURE__ */ o(Z, { htmlFor: m, required: t, children: e }),
452
+ /* @__PURE__ */ o(
454
453
  tt,
455
454
  {
456
- ref: d,
457
- id: c,
455
+ ref: c,
456
+ id: m,
458
457
  className: r,
459
- required: e || n,
458
+ required: t || n,
460
459
  feedback: a ? "error" : void 0,
461
460
  ...i
462
461
  }
463
462
  )
464
463
  ] });
465
- }), rt = N(({
466
- className: t,
464
+ }), rt = v(({
465
+ className: e,
467
466
  size: r = "md",
468
- feedback: e,
467
+ feedback: t,
469
468
  disabled: n,
470
469
  ...a
471
- }, o) => /* @__PURE__ */ s(
470
+ }, s) => /* @__PURE__ */ o(
472
471
  "select",
473
472
  {
474
- ref: o,
475
- className: p(
473
+ ref: s,
474
+ className: d(
476
475
  "w-full rounded-md border appearance-none pr-9",
477
476
  "bg-(image:--chevron-down) bg-no-repeat bg-position-[right_0.75rem_center] bg-size-[16px_12px]",
478
477
  {
479
- "focus-ring": !e,
480
- "focus-ring-danger": e === "error",
481
- "border-lm-input-border dark:border-dm-input-border": !e,
482
- "border-danger": e === "error",
478
+ "focus-ring": !t,
479
+ "focus-ring-danger": t === "error",
480
+ "border-lm-input-border dark:border-dm-input-border": !t,
481
+ "border-danger": t === "error",
483
482
  "pl-2 py-1 text-sm": r === "sm",
484
483
  "pl-3 py-1.5": r === "md",
485
484
  "pl-4 py-2 text-xl": r === "lg",
@@ -487,48 +486,48 @@ const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t,
487
486
  // Apply different background color when rendered inside a card
488
487
  "bg-lm-primary dark:bg-dm-primary group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !n
489
488
  },
490
- t
489
+ e
491
490
  ),
492
491
  disabled: n,
493
492
  ...a
494
493
  }
495
- )), ar = N(({ selectClassName: t, label: r, error: e, helpText: n, required: a, hiddenRequired: o, "data-testid": l, ...i }, d) => {
496
- const c = _();
497
- return /* @__PURE__ */ b(V, { error: e, helpText: n, "data-testid": l, children: [
498
- /* @__PURE__ */ s(Z, { htmlFor: c, required: a, children: r }),
499
- /* @__PURE__ */ s(
494
+ )), ar = v(({ selectClassName: e, label: r, error: t, helpText: n, required: a, hiddenRequired: s, "data-testid": l, ...i }, c) => {
495
+ const m = M();
496
+ return /* @__PURE__ */ g(V, { error: t, helpText: n, "data-testid": l, children: [
497
+ /* @__PURE__ */ o(Z, { htmlFor: m, required: a, children: r }),
498
+ /* @__PURE__ */ o(
500
499
  rt,
501
500
  {
502
- ref: d,
503
- id: c,
504
- className: t,
505
- required: a || o,
506
- feedback: e ? "error" : void 0,
501
+ ref: c,
502
+ id: m,
503
+ className: e,
504
+ required: a || s,
505
+ feedback: t ? "error" : void 0,
507
506
  ...i
508
507
  }
509
508
  )
510
509
  ] });
511
- }), nt = N(({
512
- onChange: t,
510
+ }), nt = v(({
511
+ onChange: e,
513
512
  containerClassName: r,
514
- inputClassName: e,
513
+ inputClassName: t,
515
514
  // Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
516
515
  size: n = "lg",
517
516
  loading: a = !1,
518
- variant: o = "default",
517
+ variant: s = "default",
519
518
  immediate: l = !1,
520
519
  ...i
521
- }, d) => {
522
- const { setTimeout: c, clearCurrentTimeout: k } = ue(500), w = v((x) => {
523
- !x || l ? (k(), t(x)) : c(() => t(x));
524
- }, [k, l, t, c]);
525
- return /* @__PURE__ */ b("div", { className: p("group relative focus-within:z-10", r), children: [
526
- o === "default" && /* @__PURE__ */ s(
527
- A,
520
+ }, c) => {
521
+ const { setTimeout: m, clearCurrentTimeout: f } = me(500), w = k((x) => {
522
+ !x || l ? (f(), e(x)) : m(() => e(x));
523
+ }, [f, l, e, m]);
524
+ return /* @__PURE__ */ g("div", { className: d("group relative focus-within:z-10", r), children: [
525
+ s === "default" && /* @__PURE__ */ o(
526
+ C,
528
527
  {
529
- icon: a ? le : Ie,
528
+ icon: a ? se : Ae,
530
529
  spin: a,
531
- className: p(
530
+ className: d(
532
531
  "absolute top-[50%] translate-y-[-50%] transition-colors",
533
532
  "text-placeholder group-focus-within:text-lm-text dark:group-focus-within:text-dm-text",
534
533
  {
@@ -538,18 +537,18 @@ const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t,
538
537
  )
539
538
  }
540
539
  ),
541
- /* @__PURE__ */ s(
540
+ /* @__PURE__ */ o(
542
541
  J,
543
542
  {
544
- ref: d,
545
- variant: o,
543
+ ref: c,
544
+ variant: s,
546
545
  type: "search",
547
- className: p(
548
- o === "default" && {
546
+ className: d(
547
+ s === "default" && {
549
548
  "pl-9": n !== "sm",
550
549
  "pl-7": n === "sm"
551
550
  },
552
- e
551
+ t
553
552
  ),
554
553
  placeholder: "Search...",
555
554
  onChange: (x) => w(x.target.value),
@@ -560,69 +559,69 @@ const W = X(void 0), F = X({ responsive: !0, size: "md" }), Xe = ({ children: t,
560
559
  ] });
561
560
  });
562
561
  function ot({
563
- searchResults: t,
562
+ searchResults: e,
564
563
  onSearch: r,
565
- onSelectSearchResult: e,
564
+ onSelectSearchResult: t,
566
565
  renderSearchResult: n,
567
566
  size: a = "md",
568
567
  // SearchInput defaults its size to 'lg'. Change it to 'md'
569
- listboxSpan: o = "full",
568
+ listboxSpan: s = "full",
570
569
  onFocus: l,
571
570
  containerClassName: i,
572
- listboxClassName: d,
573
- ...c
574
- }, k) {
575
- const w = _(), [x, g] = S(), m = I(null);
576
- ke(k, () => m.current);
577
- const h = D(
578
- () => t ? x ?? [...t.keys()][0] : void 0,
579
- [x, t]
580
- ), y = v((u) => {
581
- e(u), r(""), m.current.value = "";
582
- }, [r, e, m]);
583
- return /* @__PURE__ */ b(
571
+ listboxClassName: c,
572
+ ...m
573
+ }, f) {
574
+ const w = M(), [x, h] = P(), u = T(null);
575
+ we(f, () => u.current);
576
+ const p = E(
577
+ () => e ? x ?? [...e.keys()][0] : void 0,
578
+ [x, e]
579
+ ), b = k((y) => {
580
+ t(y), r(""), u.current.value = "";
581
+ }, [r, t, u]);
582
+ return /* @__PURE__ */ g(
584
583
  "div",
585
584
  {
586
- className: p("relative", i),
587
- onBlur: (u) => {
588
- u.currentTarget.contains(u.relatedTarget) || r("");
585
+ className: d("relative", i),
586
+ onBlur: (y) => {
587
+ y.currentTarget.contains(y.relatedTarget) || r("");
589
588
  },
590
589
  children: [
591
- /* @__PURE__ */ s(
590
+ /* @__PURE__ */ o(
592
591
  nt,
593
592
  {
594
593
  onChange: r,
595
594
  size: a,
596
- ref: m,
595
+ ref: u,
597
596
  role: "combobox",
598
597
  "aria-autocomplete": "list",
599
- "aria-expanded": !!t,
598
+ "aria-expanded": !!e,
600
599
  "aria-controls": w,
601
- "aria-activedescendant": h ? `${w}_${h}` : void 0,
600
+ "aria-activedescendant": p ? `${w}_${p}` : void 0,
602
601
  autoComplete: "off",
603
602
  autoCorrect: "off",
604
- onFocus: (u) => {
605
- l == null || l(u), r(u.target.value);
603
+ onFocus: (y) => {
604
+ l?.(y), r(y.target.value);
606
605
  },
607
- ...c
606
+ ...m
608
607
  }
609
608
  ),
610
- t && /* @__PURE__ */ s(
609
+ e && /* @__PURE__ */ o(
611
610
  Ye,
612
611
  {
613
612
  id: w,
614
- items: t,
615
- anchor: m,
616
- onSelectItem: y,
617
- onActiveItemChange: g,
613
+ items: e,
614
+ anchor: u,
615
+ onSelectItem: b,
616
+ onActiveItemChange: h,
618
617
  renderItem: n,
619
- className: p(
618
+ className: d(
620
619
  "absolute top-full mt-1 z-10",
621
620
  {
622
- "min-w-60": o === "auto",
623
- "w-full": o === "full"
621
+ "min-w-60": s === "auto",
622
+ "w-full": s === "full"
624
623
  },
625
- d
624
+ c
626
625
  ),
627
626
  "aria-label": "Matching items",
628
627
  noItemsMessage: "No results found matching search"
@@ -632,20 +631,20 @@ function ot({
632
631
  }
633
632
  );
634
633
  }
635
- const at = N(ot), st = ({ name: t, color: r }) => /* @__PURE__ */ b("div", { className: "inline-flex items-center gap-2", children: [
636
- /* @__PURE__ */ s("div", { "aria-hidden": !0, className: "w-4 h-4 rounded-full", style: { backgroundColor: r } }),
637
- t
638
- ] }), lt = ({ tag: t, color: r, size: e, onRemove: n }) => (
634
+ const at = v(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { className: "inline-flex items-center gap-2", children: [
635
+ /* @__PURE__ */ o("div", { "aria-hidden": !0, className: "w-4 h-4 rounded-full", style: { backgroundColor: r } }),
636
+ e
637
+ ] }), lt = ({ tag: e, color: r, size: t, onRemove: n }) => (
639
638
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
640
- /* @__PURE__ */ b(
639
+ /* @__PURE__ */ g(
641
640
  "li",
642
641
  {
643
- className: f(
642
+ className: d(
644
643
  "inline-flex items-center gap-1 font-bold [&]:rounded-md",
645
644
  {
646
- "px-1 text-sm": e === "sm",
647
- "py-0.25 px-1.5": e === "md",
648
- "py-0.5 px-1.5": e === "lg"
645
+ "px-1 text-sm": t === "sm",
646
+ "py-0.25 px-1.5": t === "md",
647
+ "py-0.5 px-1.5": t === "lg"
649
648
  }
650
649
  ),
651
650
  style: {
@@ -654,49 +653,49 @@ const at = N(ot), st = ({ name: t, color: r }) => /* @__PURE__ */ b("div", { cla
654
653
  },
655
654
  onClick: (a) => a.stopPropagation(),
656
655
  children: [
657
- t,
658
- /* @__PURE__ */ s(Q, { label: `Remove ${t}`, solid: !0, size: "sm", onClick: () => n(t) })
656
+ e,
657
+ /* @__PURE__ */ o(Y, { label: `Remove ${e}`, solid: !0, size: "sm", onClick: () => n(e) })
659
658
  ]
660
659
  }
661
660
  )
662
- ), it = /\s+/g, ne = "#99a1af", oe = (t) => t.trim().toLowerCase().replace(it, "-"), sr = ({
663
- tags: t,
661
+ ), it = /\s+/g, re = "#99a1af", ne = (e) => e.trim().toLowerCase().replace(it, "-"), sr = ({
662
+ tags: e,
664
663
  selectedTags: r = [],
665
- onTagsChange: e,
664
+ onTagsChange: t,
666
665
  getColorForTag: n,
667
666
  searchMode: a = "startsWith",
668
- immutable: o = !1,
667
+ immutable: s = !1,
669
668
  size: l = "md",
670
669
  disabled: i,
671
- containerClassName: d,
672
- ...c
670
+ containerClassName: c,
671
+ ...m
673
672
  }) => {
674
- const [k, w] = S(), x = v((y) => {
675
- const u = y.toLowerCase().trim();
676
- if (!u) {
673
+ const [f, w] = P(), x = k((b) => {
674
+ const y = b.toLowerCase().trim();
675
+ if (!y) {
677
676
  w(void 0);
678
677
  return;
679
678
  }
680
- const O = t.filter((C) => {
681
- if (r.includes(C))
679
+ const A = e.filter((N) => {
680
+ if (r.includes(N))
682
681
  return !1;
683
- const M = C.toLowerCase();
684
- return a === "startsWith" ? M.startsWith(u) : M.includes(u);
682
+ const D = N.toLowerCase();
683
+ return a === "startsWith" ? D.startsWith(y) : D.includes(y);
685
684
  }).slice(0, 5);
686
- o || O.push(`Add "${u.split(",").map(oe).join(",")}" tag`), w(new Map(O.map((C) => [C, C])));
687
- }, [o, a, r, t]), g = v((y) => {
688
- const u = y.match(/Add\s+"([^"]+)"\s+tag/), O = ((u == null ? void 0 : u[1]) ?? y).split(",").map(oe);
689
- e == null || e([.../* @__PURE__ */ new Set([...r, ...O])]);
690
- }, [e, r]), m = v(
691
- (y) => e == null ? void 0 : e(r.filter((u) => u !== y)),
692
- [e, r]
693
- ), h = I(null);
685
+ s || A.push(`Add "${y.split(",").map(ne).join(",")}" tag`), w(new Map(A.map((N) => [N, N])));
686
+ }, [s, a, r, e]), h = k((b) => {
687
+ const A = (b.match(/Add\s+"([^"]+)"\s+tag/)?.[1] ?? b).split(",").map(ne);
688
+ t?.([.../* @__PURE__ */ new Set([...r, ...A])]);
689
+ }, [t, r]), u = k(
690
+ (b) => t?.(r.filter((y) => y !== b)),
691
+ [t, r]
692
+ ), p = T(null);
694
693
  return (
695
694
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
696
- /* @__PURE__ */ b(
695
+ /* @__PURE__ */ g(
697
696
  "div",
698
697
  {
699
- className: f(
698
+ className: d(
700
699
  "rounded-md flex flex-wrap gap-1",
701
700
  "border border-lm-input-border dark:border-dm-input-border",
702
701
  "cursor-text focus-within:focus-within-ring",
@@ -709,25 +708,24 @@ const at = N(ot), st = ({ name: t, color: r }) => /* @__PURE__ */ b("div", { cla
709
708
  // Use different background color when rendered inside a card
710
709
  "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !i
711
710
  },
712
- d
711
+ c
713
712
  ),
714
- onClick: (y) => {
715
- var u;
716
- y.target !== h.current && ((u = h.current) == null || u.focus());
713
+ onClick: (b) => {
714
+ b.target !== p.current && p.current?.focus();
717
715
  },
718
716
  children: [
719
- /* @__PURE__ */ s("ul", { className: "m-0 p-0 flex flex-wrap gap-1", children: r.map((y, u) => {
720
- const O = (n == null ? void 0 : n(y)) ?? ne;
721
- return /* @__PURE__ */ s(lt, { tag: y, color: O, onRemove: m, size: l }, `${y}${u}`);
717
+ /* @__PURE__ */ o("ul", { className: "m-0 p-0 flex flex-wrap gap-1", children: r.map((b, y) => {
718
+ const A = n?.(b) ?? re;
719
+ return /* @__PURE__ */ o(lt, { tag: b, color: A, onRemove: u, size: l }, `${b}${y}`);
722
720
  }) }),
723
- /* @__PURE__ */ s(
721
+ /* @__PURE__ */ o(
724
722
  at,
725
723
  {
726
724
  variant: "unstyled",
727
725
  listboxSpan: "auto",
728
726
  containerClassName: "flex items-center",
729
727
  listboxClassName: "whitespace-nowrap",
730
- inputClassName: f(
728
+ inputClassName: d(
731
729
  "no-clear-button",
732
730
  {
733
731
  "px-1 text-sm": l === "sm",
@@ -735,309 +733,303 @@ const at = N(ot), st = ({ name: t, color: r }) => /* @__PURE__ */ b("div", { cla
735
733
  "px-3 text-xl": l === "lg"
736
734
  }
737
735
  ),
738
- searchResults: k,
736
+ searchResults: f,
739
737
  onSearch: x,
740
- onSelectSearchResult: g,
741
- renderSearchResult: (y) => y.match(/Add\s+"([^"]+)"\s+tag/) ? y : /* @__PURE__ */ s(st, { name: y, color: (n == null ? void 0 : n(y)) ?? ne }),
742
- onKeyDown: (y) => {
743
- y.key === "Backspace" && !k && m(r[r.length - 1]);
738
+ onSelectSearchResult: h,
739
+ renderSearchResult: (b) => b.match(/Add\s+"([^"]+)"\s+tag/) ? b : /* @__PURE__ */ o(st, { name: b, color: n?.(b) ?? re }),
740
+ onKeyDown: (b) => {
741
+ b.key === "Backspace" && !f && u(r[r.length - 1]);
744
742
  },
745
743
  size: l,
746
744
  disabled: i,
747
- ref: h,
745
+ ref: p,
748
746
  immediate: !0,
749
- ...c
747
+ ...m
750
748
  }
751
749
  )
752
750
  ]
753
751
  }
754
752
  )
755
753
  );
756
- }, lr = N(({ className: t, ...r }, e) => /* @__PURE__ */ s(
757
- me,
754
+ }, lr = v(({ className: e, ...r }, t) => /* @__PURE__ */ o(
755
+ ce,
758
756
  {
759
- ref: e,
760
- className: f(
757
+ ref: t,
758
+ className: d(
761
759
  "rounded-full w-8 h-4",
762
760
  "bg-(image:--circle-grey-dark) dark:bg-(image:--circle-grey-light) checked:bg-(image:--circle-white)",
763
761
  "focus-visible:not-checked:bg-(image:--circle-blue-light)",
764
762
  "checked:bg-right transition-[background-position]",
765
- t
763
+ e
766
764
  ),
767
765
  ...r
768
766
  }
769
767
  ));
770
- function dt(t, { elementsSelector: r, focusFirstItem: e = !1, vertical: n = !0, horizontal: a = !0 }) {
771
- const o = D(() => {
772
- const d = [];
773
- return n && d.push("ArrowDown"), a && d.push("ArrowRight"), d;
774
- }, [a, n]), l = D(() => {
775
- const d = [];
776
- return n && d.push("ArrowUp"), a && d.push("ArrowLeft"), d;
777
- }, [a, n]), i = D(() => [...o, ...l], [o, l]);
778
- T(() => {
779
- const d = t.current;
780
- if (!d)
768
+ function dt(e, { elementsSelector: r, focusFirstItem: t = !1, vertical: n = !0, horizontal: a = !0 }) {
769
+ const s = E(() => {
770
+ const c = [];
771
+ return n && c.push("ArrowDown"), a && c.push("ArrowRight"), c;
772
+ }, [a, n]), l = E(() => {
773
+ const c = [];
774
+ return n && c.push("ArrowUp"), a && c.push("ArrowLeft"), c;
775
+ }, [a, n]), i = E(() => [...s, ...l], [s, l]);
776
+ R(() => {
777
+ const c = e.current;
778
+ if (!c)
781
779
  return () => {
782
780
  };
783
- const c = new AbortController(), k = () => [...d.querySelectorAll(r)], w = k(), x = Math.max(w.findIndex((g) => g.dataset.selected === "true"), 0);
784
- return w.forEach((g, m) => {
785
- g.tabIndex = m === x ? 0 : -1, e && m === x && g.focus();
786
- }), d.addEventListener("keydown", (g) => {
787
- if (!i.includes(g.key))
781
+ const m = new AbortController(), f = () => [...c.querySelectorAll(r)], w = f(), x = Math.max(w.findIndex((h) => h.dataset.selected === "true"), 0);
782
+ return w.forEach((h, u) => {
783
+ h.tabIndex = u === x ? 0 : -1, t && u === x && h.focus();
784
+ }), c.addEventListener("keydown", (h) => {
785
+ if (!i.includes(h.key))
788
786
  return;
789
- g.preventDefault();
790
- const m = k(), h = m.findIndex((u) => u.tabIndex === 0), y = o.includes(g.key) ? m[h + 1] ?? m[0] : m[h - 1] ?? m[m.length - 1];
791
- m.forEach((u) => {
792
- u.tabIndex = -1;
793
- }), y.tabIndex = 0, y.focus();
794
- }, { signal: c.signal }), () => c.abort();
795
- }, [i, t, r, e, o]);
787
+ h.preventDefault();
788
+ const u = f(), p = u.findIndex((y) => y.tabIndex === 0), b = s.includes(h.key) ? u[p + 1] ?? u[0] : u[p - 1] ?? u[u.length - 1];
789
+ u.forEach((y) => {
790
+ y.tabIndex = -1;
791
+ }), b.tabIndex = 0, b.focus();
792
+ }, { signal: m.signal }), () => m.abort();
793
+ }, [i, e, r, t, s]);
796
794
  }
797
795
  const ir = () => {
798
- const t = we();
799
- return v(() => t(-1), [t]);
796
+ const e = ke();
797
+ return k(() => e(-1), [e]);
800
798
  }, ct = 128;
801
- function mt(t) {
802
- const [r, e, n] = (t.match(/../g) ?? []).map((o) => parseInt(o, 16) || 0);
803
- return Math.round(Math.sqrt(0.299 * r ** 2 + 0.587 * e ** 2 + 0.114 * n ** 2)) >= ct;
799
+ function mt(e) {
800
+ const [r, t, n] = (e.match(/../g) ?? []).map((s) => parseInt(s, 16) || 0);
801
+ return Math.round(Math.sqrt(0.299 * r ** 2 + 0.587 * t ** 2 + 0.114 * n ** 2)) >= ct;
804
802
  }
805
- const dr = ({ text: t, className: r, size: e = "lg", initialCopied: n = !1, navigator_: a = globalThis.navigator, ...o }) => {
806
- const [l, i] = bt({ initialValue: n }), d = v(
807
- () => a.clipboard.writeText(t).then(i),
808
- [a.clipboard, t, i]
803
+ const dr = ({ text: e, className: r, size: t = "lg", initialCopied: n = !1, navigator_: a = globalThis.navigator, ...s }) => {
804
+ const [l, i] = gt({ initialValue: n }), c = k(
805
+ () => a.clipboard.writeText(e).then(i),
806
+ [a.clipboard, e, i]
809
807
  );
810
- return /* @__PURE__ */ s(
808
+ return /* @__PURE__ */ o(
811
809
  "button",
812
810
  {
813
811
  type: "button",
814
- className: f(
812
+ className: d(
815
813
  "focus-ring rounded-sm cursor-pointer",
816
814
  {
817
- "text-md": e === "sm",
818
- "text-lg": e === "md",
819
- "text-xl": e === "lg"
815
+ "text-md": t === "sm",
816
+ "text-lg": t === "md",
817
+ "text-xl": t === "lg"
820
818
  },
821
819
  r
822
820
  ),
823
- "aria-label": `Copy ${t} to clipboard`,
821
+ "aria-label": `Copy ${e} to clipboard`,
824
822
  title: "Copy to clipboard",
825
- onClick: d,
826
- ...o,
827
- children: /* @__PURE__ */ s(A, { icon: l ? Oe : je, fixedWidth: !0 })
823
+ onClick: c,
824
+ ...s,
825
+ children: /* @__PURE__ */ o(C, { icon: l ? Ie : je })
828
826
  }
829
827
  );
830
- }, ut = (t) => {
831
- const r = new URLSearchParams(t), e = {};
828
+ }, ut = (e) => {
829
+ const r = new URLSearchParams(e), t = {};
832
830
  return r.forEach((n, a) => {
833
831
  if (a.endsWith("[]")) {
834
- const o = a.slice(0, -2);
835
- e[o] ?? (e[o] = []), e[o].push(n);
832
+ const s = a.slice(0, -2);
833
+ t[s] ??= [], t[s].push(n);
836
834
  } else
837
- e[a] = n;
838
- }), e;
839
- }, cr = (t) => {
835
+ t[a] = n;
836
+ }), t;
837
+ }, cr = (e) => {
840
838
  const r = new URLSearchParams();
841
- for (const [e, n] of Object.entries(t))
842
- n !== void 0 && (Array.isArray(n) ? n.forEach((a) => r.append(`${e}[]`, `${a}`)) : r.append(e, `${n}`));
839
+ for (const [t, n] of Object.entries(e))
840
+ n !== void 0 && (Array.isArray(n) ? n.forEach((a) => r.append(`${t}[]`, `${a}`)) : r.append(t, `${n}`));
843
841
  return r.toString();
844
842
  }, mr = () => {
845
- const { search: t } = se();
846
- return D(() => ut(t), [t]);
843
+ const { search: e } = ae();
844
+ return E(() => ut(e), [e]);
847
845
  };
848
- function ue(t, r = globalThis.setTimeout, e = globalThis.clearTimeout) {
849
- const n = I(null), a = v(() => {
850
- n.current && e(n.current);
851
- }, [e]), o = v((l, i) => {
846
+ function me(e, r = globalThis.setTimeout, t = globalThis.clearTimeout) {
847
+ const n = T(null), a = k(() => {
848
+ n.current && t(n.current);
849
+ }, [t]), s = k((l, i) => {
852
850
  a(), n.current = r(() => {
853
851
  l(), n.current = null;
854
- }, i ?? t);
855
- }, [a, t, r]);
856
- return T(() => a, [a]), D(
857
- () => ({ setTimeout: o, clearCurrentTimeout: a }),
858
- [a, o]
852
+ }, i ?? e);
853
+ }, [a, e, r]);
854
+ return R(() => a, [a]), E(
855
+ () => ({ setTimeout: s, clearCurrentTimeout: a }),
856
+ [a, s]
859
857
  );
860
858
  }
861
- const pt = 2e3, bt = ({ initialValue: t = !1, delay: r = pt } = {}, e = globalThis.setTimeout, n = globalThis.clearTimeout) => {
862
- const { setTimeout: a } = ue(r, e, n), [o, l] = S(t), i = I(t), d = v(() => {
859
+ const pt = 2e3, gt = ({ initialValue: e = !1, delay: r = pt } = {}, t = globalThis.setTimeout, n = globalThis.clearTimeout) => {
860
+ const { setTimeout: a } = me(r, t, n), [s, l] = P(e), i = T(e), c = k(() => {
863
861
  l(!i.current), a(() => l(i.current));
864
862
  }, [a]);
865
- return [o, d];
863
+ return [s, c];
866
864
  };
867
- function pe(t = !1) {
868
- const [r, e] = S(t), n = v(() => e((l) => !l), []), a = v(() => e(!0), []), o = v(() => e(!1), []);
869
- return { flag: r, toggle: n, setToTrue: a, setToFalse: o };
865
+ function ue(e = !1) {
866
+ const [r, t] = P(e), n = k(() => t((l) => !l), []), a = k(() => t(!0), []), s = k(() => t(!1), []);
867
+ return { flag: r, toggle: n, setToTrue: a, setToFalse: s };
870
868
  }
871
- const gt = ({ className: t, selected: r, disabled: e, ...n }) => {
872
- const a = "to" in n && typeof n.to == "string";
869
+ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ...a }) => {
870
+ const s = "to" in a && typeof a.to == "string", l = s ? q : "button", { onItemClick: i } = S(pe);
873
871
  return (
874
872
  // @ts-expect-error The Tag is inferred from provided props, so they should always match
875
- /* @__PURE__ */ s(
876
- a ? q : "button",
873
+ /* @__PURE__ */ o(
874
+ l,
877
875
  {
878
876
  role: "menuitem",
879
877
  "data-selected": r,
880
- className: f(
878
+ className: d(
881
879
  "flex items-center gap-2",
882
880
  "w-full px-3 py-1.5 focus-ring",
883
881
  // Overwrite link styles in case a Link is being used
884
882
  "no-underline text-inherit",
885
883
  {
886
- "cursor-pointer": !e,
887
- "pointer-events-none opacity-50": e,
888
- "bg-lm-secondary dark:bg-dm-secondary": r && !e,
889
- "highlight:bg-lm-secondary dark:highlight:bg-dm-secondary highlight:z-1 relative": !r && !e
884
+ "cursor-pointer": !t,
885
+ "pointer-events-none opacity-50": t,
886
+ "bg-lm-secondary dark:bg-dm-secondary": r && !t,
887
+ "highlight:bg-lm-secondary dark:highlight:bg-dm-secondary highlight:z-1 relative": !r && !t
890
888
  },
891
- t
889
+ e
892
890
  ),
893
891
  tabIndex: -1,
894
- disabled: a ? void 0 : e,
895
- "aria-disabled": a ? e : void 0,
896
- ...n
892
+ disabled: s ? void 0 : t,
893
+ "aria-disabled": s ? t : void 0,
894
+ type: s ? void 0 : "button",
895
+ onClick: (c) => {
896
+ n?.(c), i?.();
897
+ },
898
+ ...a
897
899
  }
898
900
  )
899
901
  );
900
902
  }, ht = () => (
901
903
  // TODO Use an <hr /> tag once tailwind styles are not set with !important
902
- /* @__PURE__ */ s("div", { role: "separator", "aria-hidden": !0, className: "border-b border-lm-border dark:border-dm-border my-2" })
903
- ), ft = ({ children: t }) => /* @__PURE__ */ s(
904
+ /* @__PURE__ */ o("div", { role: "separator", "aria-hidden": !0, className: "border-b border-lm-border dark:border-dm-border my-2" })
905
+ ), ft = ({ children: e }) => /* @__PURE__ */ o(
904
906
  "div",
905
907
  {
906
908
  role: "heading",
907
909
  "aria-level": 6,
908
910
  "aria-hidden": !0,
909
- className: f(
911
+ className: d(
910
912
  "flex items-center w-full px-3 py-1.5",
911
913
  "text-gray-500 text-sm font-semibold"
912
914
  ),
913
915
  onClick: (r) => r.stopPropagation(),
914
- children: t
916
+ children: e
915
917
  }
916
- ), xt = ({ className: t, onClick: r, ...e }) => (
917
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
918
- /* @__PURE__ */ s(
919
- "div",
920
- {
921
- className: f("px-3 py-1.5", t),
922
- ...e,
923
- onClick: (n) => {
924
- n.stopPropagation(), r == null || r(n);
925
- }
926
- }
927
- )
928
- ), yt = ({
929
- children: t,
918
+ ), xt = ({ className: e, ...r }) => /* @__PURE__ */ o("div", { className: d("px-3 py-1.5", e), ...r }), yt = ({
919
+ children: e,
930
920
  className: r,
931
- focusableElementsSelector: e = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
921
+ focusableElementsSelector: t = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
932
922
  focusFirstItem: n = !1,
933
- ...a
923
+ onItemClick: a,
924
+ ...s
934
925
  }) => {
935
- const o = I(null);
936
- return dt(o, { elementsSelector: e, focusFirstItem: n }), /* @__PURE__ */ s(L, { ref: o, role: "menu", className: f("py-2 whitespace-nowrap", r), ...a, children: t });
937
- }, j = Object.assign(yt, { Item: gt, Separator: ht, Title: ft, Misc: xt }), kt = ({
938
- children: t,
926
+ const l = T(null);
927
+ return dt(l, { elementsSelector: t, focusFirstItem: n }), /* @__PURE__ */ o(O, { ref: l, role: "menu", className: d("py-2 whitespace-nowrap", r), ...s, children: /* @__PURE__ */ o(pe.Provider, { value: { onItemClick: a }, children: e }) });
928
+ }, B = Object.assign(yt, { Item: bt, Separator: ht, Title: ft, Misc: xt }), wt = ({
929
+ children: e,
939
930
  menuAlignment: r = "left",
940
- buttonVariant: e = "button",
931
+ buttonVariant: t = "button",
941
932
  buttonContent: n,
942
933
  buttonClassName: a,
943
- buttonSize: o = "md",
934
+ buttonSize: s = "md",
944
935
  buttonDisabled: l = !1,
945
936
  containerClassName: i,
946
- menuClassName: d,
947
- caretless: c,
948
- buttonLabel: k,
937
+ menuClassName: c,
938
+ caretless: m,
939
+ buttonLabel: f,
949
940
  menuOffset: w = 3
950
941
  }) => {
951
- const [x, g] = S(!1), m = I(null), { refs: h, floatingStyles: y, context: u } = ie({
942
+ const [x, h] = P(!1), u = k(() => h(!1), []), p = T(null), { refs: b, floatingStyles: y, context: A } = le({
952
943
  open: x,
953
- onOpenChange: g,
944
+ onOpenChange: h,
954
945
  placement: r === "right" ? "bottom-end" : "bottom-start",
955
- middleware: [Ee(), Me(w)],
946
+ middleware: [De(), Me(w)],
956
947
  // eslint-disable-next-line react-compiler/react-compiler
957
- elements: { reference: m.current }
958
- }), O = _e(u), { getReferenceProps: C, getFloatingProps: M } = de([
959
- O
960
- ]), $ = _(), H = I(null);
961
- return T(() => {
962
- const P = H.current, z = m.current;
963
- if (!P || !z)
948
+ elements: { reference: p.current }
949
+ }), N = _e(A), { getReferenceProps: D, getFloatingProps: U } = ie([
950
+ N
951
+ ]), G = M(), Q = T(null);
952
+ return R(() => {
953
+ const I = Q.current;
954
+ if (!I || !x)
964
955
  return () => {
965
956
  };
966
- const ee = new AbortController();
957
+ const z = new AbortController();
967
958
  return document.body.addEventListener("click", (ye) => {
968
- ye.composedPath().includes(z) || g(!1);
969
- }, { signal: ee.signal }), () => ee.abort();
970
- }, []), // eslint-disable-next-line jsx-a11y/no-static-element-interactions
971
- /* @__PURE__ */ b(
959
+ ye.composedPath().includes(I) || u();
960
+ }, { signal: z.signal }), () => z.abort();
961
+ }, [u, x]), // eslint-disable-next-line jsx-a11y/no-static-element-interactions
962
+ /* @__PURE__ */ g(
972
963
  "div",
973
964
  {
974
- ref: H,
975
- className: f("relative inline-block", i),
976
- onKeyDown: (P) => {
977
- P.key === "Escape" && g(!1);
965
+ ref: Q,
966
+ className: d("relative inline-block", i),
967
+ onKeyDown: (I) => {
968
+ I.key === "Escape" && u();
978
969
  },
979
- onBlur: (P) => {
980
- P.relatedTarget && !H.current.contains(P.relatedTarget) && g(!1);
970
+ onBlur: (I) => {
971
+ I.relatedTarget && !Q.current.contains(I.relatedTarget) && u();
981
972
  },
982
973
  children: [
983
- /* @__PURE__ */ b(
974
+ /* @__PURE__ */ g(
984
975
  "button",
985
976
  {
986
- ref: m,
987
- ...C(),
977
+ ref: p,
978
+ ...D(),
988
979
  type: "button",
989
980
  "aria-haspopup": !0,
990
981
  "aria-expanded": x,
991
- "aria-controls": $,
992
- "aria-label": k,
982
+ "aria-controls": G,
983
+ "aria-label": f,
993
984
  disabled: l,
994
- className: f(
985
+ className: d(
995
986
  "flex items-center rounded-md focus-ring",
996
987
  {
997
- "justify-between": !c,
988
+ "justify-between": !m,
998
989
  "cursor-pointer": !l,
999
990
  "pointer-events-none opacity-50": l,
1000
991
  // Button variant
1001
- "border border-lm-border dark:border-dm-border": e === "button",
1002
- "bg-lm-primary dark:bg-dm-primary": e === "button",
992
+ "border border-lm-border dark:border-dm-border": t === "button",
993
+ "bg-lm-primary dark:bg-dm-primary": t === "button",
1003
994
  // Use different bg color when inside a card
1004
- "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": e === "button",
995
+ "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": t === "button",
1005
996
  // Link variant
1006
- "text-lm-brand dark:text-dm-brand": e === "link",
1007
- "highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline": e === "link",
997
+ "text-lm-brand dark:text-dm-brand": t === "link",
998
+ "highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline": t === "link",
1008
999
  // Button sizes
1009
- "px-1.5 py-1 text-sm": e !== "text" && o === "sm",
1010
- "px-3 py-1.5": e !== "text" && o === "md",
1011
- "px-4 py-2 text-lg": e !== "text" && o === "lg",
1012
- "gap-x-1.5": o === "sm",
1013
- "gap-x-2": o !== "sm"
1000
+ "px-1.5 py-1 text-sm": t !== "text" && s === "sm",
1001
+ "px-3 py-1.5": t !== "text" && s === "md",
1002
+ "px-4 py-2 text-lg": t !== "text" && s === "lg",
1003
+ "gap-x-1.5": s === "sm",
1004
+ "gap-x-2": s !== "sm"
1014
1005
  },
1015
1006
  a
1016
1007
  ),
1017
- onKeyDown: (P) => {
1018
- P.key === "ArrowDown" && (P.preventDefault(), g(!0));
1008
+ onKeyDown: (I) => {
1009
+ I.key === "ArrowDown" && (I.preventDefault(), h(!0));
1019
1010
  },
1020
1011
  children: [
1021
1012
  n,
1022
- !c && /* @__PURE__ */ s(A, { icon: Le, size: "xs" })
1013
+ !m && /* @__PURE__ */ o(C, { icon: Oe, size: "xs", widthAuto: !0 })
1023
1014
  ]
1024
1015
  }
1025
1016
  ),
1026
- x && /* @__PURE__ */ s(
1017
+ x && /* @__PURE__ */ o(
1027
1018
  "div",
1028
1019
  {
1029
- ref: h.setFloating,
1020
+ ref: b.setFloating,
1030
1021
  style: y,
1031
1022
  className: "min-w-full z-500",
1032
- ...M(),
1033
- children: /* @__PURE__ */ s(
1034
- j,
1023
+ ...U(),
1024
+ children: /* @__PURE__ */ o(
1025
+ B,
1035
1026
  {
1036
- className: d,
1037
- id: $,
1027
+ className: c,
1028
+ id: G,
1038
1029
  focusableElementsSelector: '[role="menuitem"]:not([disabled]):not([aria-disabled]),input:not([disabled]),select:not([disabled])',
1039
1030
  focusFirstItem: !0,
1040
- children: t
1031
+ onItemClick: u,
1032
+ children: e
1041
1033
  }
1042
1034
  )
1043
1035
  }
@@ -1045,36 +1037,36 @@ const gt = ({ className: t, selected: r, disabled: e, ...n }) => {
1045
1037
  ]
1046
1038
  }
1047
1039
  );
1048
- }, R = Object.assign(kt, {
1049
- Item: j.Item,
1050
- Separator: j.Separator,
1051
- Title: j.Title,
1052
- Misc: j.Misc
1053
- }), wt = N(({ className: t, disabled: r, size: e = "md", type: n = "button", ...a }, o) => /* @__PURE__ */ s(
1040
+ }, L = Object.assign(wt, {
1041
+ Item: B.Item,
1042
+ Separator: B.Separator,
1043
+ Title: B.Title,
1044
+ Misc: B.Misc
1045
+ }), kt = v(({ className: e, disabled: r, size: t = "md", type: n = "button", ...a }, s) => /* @__PURE__ */ o(
1054
1046
  "button",
1055
1047
  {
1056
- className: p(
1048
+ className: d(
1057
1049
  "inline-flex rounded-md focus-ring",
1058
1050
  "text-lm-brand dark:text-dm-brand",
1059
1051
  "highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline",
1060
1052
  {
1061
- "px-1.5 py-1 text-sm": e === "sm",
1062
- "px-3 py-1.5": e === "md",
1063
- "px-4 py-2 text-lg": e === "lg",
1053
+ "px-1.5 py-1 text-sm": t === "sm",
1054
+ "px-3 py-1.5": t === "md",
1055
+ "px-4 py-2 text-lg": t === "lg",
1064
1056
  "cursor-pointer": !r,
1065
1057
  "pointer-events-none opacity-65": r
1066
1058
  },
1067
- t
1059
+ e
1068
1060
  ),
1069
1061
  disabled: r,
1070
1062
  type: n,
1071
1063
  ...a,
1072
- ref: o
1064
+ ref: s
1073
1065
  }
1074
- )), vt = ({ className: t, active: r, ...e }) => /* @__PURE__ */ s("li", { role: "menuitem", className: "w-full flex", "data-active": r, children: /* @__PURE__ */ s(
1066
+ )), vt = ({ className: e, active: r, ...t }) => /* @__PURE__ */ o("li", { role: "menuitem", className: "w-full flex", "data-active": r, children: /* @__PURE__ */ o(
1075
1067
  q,
1076
1068
  {
1077
- className: f(
1069
+ className: d(
1078
1070
  "px-2 py-3",
1079
1071
  "max-md:w-full max-md:px-3 max-md:py-2",
1080
1072
  "text-white no-underline highlight:opacity-100 transition-opacity",
@@ -1082,16 +1074,16 @@ const gt = ({ className: t, selected: r, disabled: e, ...n }) => {
1082
1074
  "opacity-60": !r,
1083
1075
  "opacity-100": r
1084
1076
  },
1085
- t
1077
+ e
1086
1078
  ),
1087
- ...e
1079
+ ...t
1088
1080
  }
1089
- ) }), Nt = ({ containerClassName: t, buttonClassName: r, menuClassName: e, active: n, ...a }) => /* @__PURE__ */ s("li", { role: "menuitem", "aria-haspopup": !0, className: "w-full flex", "data-active": n, children: /* @__PURE__ */ s(
1090
- R,
1081
+ ) }), Nt = ({ containerClassName: e, buttonClassName: r, menuClassName: t, active: n, ...a }) => /* @__PURE__ */ o("li", { role: "menuitem", "aria-haspopup": !0, className: "w-full flex", "data-active": n, children: /* @__PURE__ */ o(
1082
+ L,
1091
1083
  {
1092
- containerClassName: f("max-md:w-full", t),
1084
+ containerClassName: d("max-md:w-full", e),
1093
1085
  buttonVariant: "text",
1094
- buttonClassName: f(
1086
+ buttonClassName: d(
1095
1087
  "px-2 py-3",
1096
1088
  "max-md:w-full max-md:px-3 max-md:py-2",
1097
1089
  "text-white highlight:opacity-100 transition-opacity",
@@ -1103,77 +1095,77 @@ const gt = ({ className: t, selected: r, disabled: e, ...n }) => {
1103
1095
  ),
1104
1096
  menuAlignment: "right",
1105
1097
  menuOffset: -3,
1106
- menuClassName: f("mx-2", e),
1098
+ menuClassName: d("mx-2", t),
1107
1099
  ...a
1108
1100
  }
1109
- ) }), Ct = ({ className: t, brand: r, children: e }) => {
1110
- const { flag: n, toggle: a, setToFalse: o } = pe(), l = _(), i = _(), { pathname: d } = se();
1111
- return T(() => o(), [d, o]), /* @__PURE__ */ b(
1101
+ ) }), Ct = ({ className: e, brand: r, children: t }) => {
1102
+ const { flag: n, toggle: a, setToFalse: s } = ue(), l = M(), i = M(), { pathname: c } = ae();
1103
+ return R(() => s(), [c, s]), /* @__PURE__ */ g(
1112
1104
  "nav",
1113
1105
  {
1114
- className: f(
1106
+ className: d(
1115
1107
  "w-full relative",
1116
1108
  "bg-lm-main dark:bg-dm-main",
1117
1109
  "flex max-md:flex-col items-center justify-between",
1118
- t
1110
+ e
1119
1111
  ),
1120
1112
  children: [
1121
- /* @__PURE__ */ b("div", { className: "w-full relative", children: [
1122
- /* @__PURE__ */ s(
1113
+ /* @__PURE__ */ g("div", { className: "w-full relative", children: [
1114
+ /* @__PURE__ */ o(
1123
1115
  "h4",
1124
1116
  {
1125
- className: f(
1117
+ className: d(
1126
1118
  "text-white px-4 py-3",
1127
1119
  "max-md:w-full max-md:flex max-md:flex-col items-center"
1128
1120
  ),
1129
1121
  children: r
1130
1122
  }
1131
1123
  ),
1132
- /* @__PURE__ */ s(
1133
- ce,
1124
+ /* @__PURE__ */ o(
1125
+ de,
1134
1126
  {
1135
1127
  id: i,
1136
1128
  variant: "secondary",
1137
- className: f(
1129
+ className: d(
1138
1130
  "absolute right-0 top-[50%] translate-y-[-50%]",
1139
1131
  "md:hidden mx-2 [&]:px-2",
1140
1132
  "opacity-60 highlight:opacity-100 transition-opacity",
1141
- "[&]:text-inherit [&]:border-white [&]:highlight:bg-transparent"
1133
+ "[&]:text-white [&]:border-white [&]:highlight:bg-transparent"
1142
1134
  ),
1143
1135
  onClick: a,
1144
1136
  "aria-label": `${n ? "Hide" : "Show"} menu`,
1145
1137
  "aria-controls": l,
1146
- children: /* @__PURE__ */ s(A, { icon: n ? Re : Te })
1138
+ children: /* @__PURE__ */ o(C, { icon: n ? Le : Re })
1147
1139
  }
1148
1140
  )
1149
1141
  ] }),
1150
- /* @__PURE__ */ s(
1142
+ /* @__PURE__ */ o(
1151
1143
  "ul",
1152
1144
  {
1153
1145
  id: l,
1154
1146
  "aria-labelledby": i,
1155
1147
  role: "menu",
1156
- className: f(
1148
+ className: d(
1157
1149
  "m-0 p-0",
1158
1150
  "max-md:w-full md:mr-2 max-md:absolute max-md:top-full z-2000",
1159
1151
  "flex max-md:flex-col items-center",
1160
1152
  "bg-lm-main dark:bg-dm-main",
1161
1153
  { "max-md:hidden": !n }
1162
1154
  ),
1163
- children: e
1155
+ children: t
1164
1156
  }
1165
1157
  )
1166
1158
  ]
1167
1159
  }
1168
1160
  );
1169
- }, ur = Object.assign(Ct, { MenuItem: vt, Dropdown: Nt }), be = X(null), At = ({ className: t, to: r, ...e }) => {
1170
- const n = E(be);
1171
- return /* @__PURE__ */ s(
1161
+ }, ur = Object.assign(Ct, { MenuItem: vt, Dropdown: Nt }), ge = W(null), Tt = ({ className: e, to: r, ...t }) => {
1162
+ const n = S(ge);
1163
+ return /* @__PURE__ */ o(
1172
1164
  ve,
1173
1165
  {
1174
1166
  role: "menuitem",
1175
1167
  to: r,
1176
- className: ({ isActive: a }) => p(
1168
+ className: ({ isActive: a }) => d(
1177
1169
  "px-4 pt-2 pb-[calc(0.5rem-3px)] border-b-3",
1178
1170
  "highlight:text-lm-brand dark:highlight:text-dm-brand",
1179
1171
  "font-bold text-center no-underline transition-colors",
@@ -1183,233 +1175,233 @@ const gt = ({ className: t, selected: r, disabled: e, ...n }) => {
1183
1175
  "text-lm-brand dark:text-dm-brand": a,
1184
1176
  "border-b-lm-brand dark:border-b-dm-brand active": a,
1185
1177
  "border-b-transparent text-gray-500": !a,
1186
- "flex-grow": n == null ? void 0 : n.fill
1178
+ "flex-grow": n?.fill
1187
1179
  },
1188
- t
1180
+ e
1189
1181
  ),
1190
- ...e
1182
+ ...t
1191
1183
  }
1192
1184
  );
1193
- }, It = ({ children: t, className: r, fill: e }) => /* @__PURE__ */ s(be.Provider, { value: { fill: e }, children: /* @__PURE__ */ s(L, { role: "menubar", className: p("flex overflow-hidden", r), children: t }) }), pr = Object.assign(It, { Pill: At }), Ot = new Intl.NumberFormat("en-US"), Lt = (t) => Ot.format(Number(t)), ae = 10, br = (t) => Math.ceil(t / ae) * ae, B = 2, K = "...", Rt = (t, r) => Array.from({ length: r - t }, (e, n) => t + n), Tt = (t, r) => {
1194
- const e = Rt(
1195
- Math.max(B, t - B),
1196
- Math.min(r - 1, t + B) + 1
1185
+ }, At = ({ children: e, className: r, fill: t }) => /* @__PURE__ */ o(ge.Provider, { value: { fill: t }, children: /* @__PURE__ */ o(O, { role: "menubar", className: d("flex overflow-hidden", r), children: e }) }), pr = Object.assign(At, { Pill: Tt }), It = new Intl.NumberFormat("en-US"), Ot = (e) => It.format(Number(e)), oe = 10, gr = (e) => Math.ceil(e / oe) * oe, _ = 2, K = "...", Lt = (e, r) => Array.from({ length: r - e }, (t, n) => e + n), Rt = (e, r) => {
1186
+ const t = Lt(
1187
+ Math.max(_, e - _),
1188
+ Math.min(r - 1, e + _) + 1
1197
1189
  );
1198
- return t - B > B && e.unshift(K), t + B < r - 1 && e.push(K), e.unshift(1), e.push(r), e;
1199
- }, U = (t) => t === K, St = (t) => U(t) ? t : Lt(t), Pt = (t, r) => U(t) ? `${t}_${r}` : `${t}`, ge = [
1190
+ return e - _ > _ && t.unshift(K), e + _ < r - 1 && t.push(K), t.unshift(1), t.push(r), t;
1191
+ }, H = (e) => e === K, Pt = (e) => H(e) ? e : Ot(e), Et = (e, r) => H(e) ? `${e}_${r}` : `${e}`, be = [
1200
1192
  "border border-r-0 last:border-r border-lm-border dark:border-dm-border",
1201
1193
  "rounded-none first:rounded-l last:rounded-r"
1202
- ], he = (t = !1) => p(
1203
- ge,
1194
+ ], he = (e = !1) => d(
1195
+ be,
1204
1196
  "px-3 py-2 cursor-pointer no-underline",
1205
1197
  "focus-ring focus-visible:z-1",
1206
- !t && [
1198
+ !e && [
1207
1199
  "text-lm-brand dark:text-dm-brand",
1208
1200
  "bg-lm-primary dark:bg-dm-primary",
1209
1201
  "highlight:bg-lm-secondary dark:highlight:bg-dm-secondary"
1210
1202
  ],
1211
- t && "bg-lm-main dark:bg-dm-main text-white"
1212
- ), Y = ({ children: t }) => /* @__PURE__ */ s("span", { "aria-hidden": !0, className: p(ge, "px-3 py-2 text-gray-400"), children: t }), fe = () => /* @__PURE__ */ s(Y, { children: K });
1213
- function Dt({ children: t, active: r, isEllipsis: e, href: n, ...a }) {
1214
- const o = D(() => he(r), [r]);
1215
- return e ? /* @__PURE__ */ s(fe, {}) : /* @__PURE__ */ s(q, { className: o, to: n, ...a, children: t });
1203
+ e && "bg-lm-main dark:bg-dm-main text-white"
1204
+ ), X = ({ children: e }) => /* @__PURE__ */ o("span", { "aria-hidden": !0, className: d(be, "px-3 py-2 text-gray-400"), children: e }), fe = () => /* @__PURE__ */ o(X, { children: K });
1205
+ function St({ children: e, active: r, isEllipsis: t, href: n, ...a }) {
1206
+ const s = E(() => he(r), [r]);
1207
+ return t ? /* @__PURE__ */ o(fe, {}) : /* @__PURE__ */ o(q, { className: s, to: n, ...a, "data-active": r, children: e });
1216
1208
  }
1217
- function Et({ children: t, active: r, isEllipsis: e, ...n }) {
1218
- const a = D(() => he(r), [r]);
1219
- return e ? /* @__PURE__ */ s(fe, {}) : /* @__PURE__ */ s("button", { type: "button", className: a, ...n, children: t });
1209
+ function Dt({ children: e, active: r, isEllipsis: t, ...n }) {
1210
+ const a = E(() => he(r), [r]);
1211
+ return t ? /* @__PURE__ */ o(fe, {}) : /* @__PURE__ */ o("button", { type: "button", className: a, ...n, "data-active": r, children: e });
1220
1212
  }
1221
- const gr = ({ currentPage: t, pagesCount: r, ...e }) => {
1222
- const n = "urlForPage" in e, a = n ? Dt : Et, o = v(
1223
- (l) => n ? { href: U(l) ? void 0 : e.urlForPage(l) } : { onClick: () => !U(l) && e.onPageChange(l) },
1224
- [n, e]
1213
+ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
1214
+ const n = "urlForPage" in t, a = n ? St : Dt, s = k(
1215
+ (l) => n ? { href: H(l) ? void 0 : t.urlForPage(l) } : { onClick: () => !H(l) && t.onPageChange(l) },
1216
+ [n, t]
1225
1217
  );
1226
- return r < 2 ? null : /* @__PURE__ */ b("div", { className: "select-none flex", "data-testid": "paginator", children: [
1227
- t === 1 ? /* @__PURE__ */ s(Y, { children: /* @__PURE__ */ s(A, { size: "xs", icon: te }) }) : /* @__PURE__ */ s(a, { ...o(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ s(A, { size: "xs", icon: te }) }),
1228
- Tt(t, r).map((l, i) => /* @__PURE__ */ s(
1218
+ return r < 2 ? null : /* @__PURE__ */ g("div", { className: "select-none flex", "data-testid": "paginator", children: [
1219
+ e === 1 ? /* @__PURE__ */ o(X, { children: /* @__PURE__ */ o(C, { size: "xs", icon: ee }) }) : /* @__PURE__ */ o(a, { ...s(Math.max(1, e - 1)), "aria-label": "Previous", children: /* @__PURE__ */ o(C, { size: "xs", icon: ee }) }),
1220
+ Rt(e, r).map((l, i) => /* @__PURE__ */ o(
1229
1221
  a,
1230
1222
  {
1231
- active: l === t,
1232
- isEllipsis: U(l),
1233
- ...o(l),
1234
- children: St(l)
1223
+ active: l === e,
1224
+ isEllipsis: H(l),
1225
+ ...s(l),
1226
+ children: Pt(l)
1235
1227
  },
1236
- Pt(l, i)
1228
+ Et(l, i)
1237
1229
  )),
1238
- t === r ? /* @__PURE__ */ s(Y, { children: /* @__PURE__ */ s(A, { size: "xs", icon: re }) }) : /* @__PURE__ */ s(a, { ...o(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ s(A, { size: "xs", icon: re }) })
1230
+ e === r ? /* @__PURE__ */ o(X, { children: /* @__PURE__ */ o(C, { size: "xs", icon: te }) }) : /* @__PURE__ */ o(a, { ...s(Math.min(r, e + 1)), "aria-label": "Next", children: /* @__PURE__ */ o(C, { size: "xs", icon: te }) })
1239
1231
  ] });
1240
- }, Mt = ({ buttonLabel: t = "Options", buttonSize: r = "md", ...e }) => /* @__PURE__ */ s(
1241
- R,
1232
+ }, Mt = ({ buttonLabel: e = "Options", buttonSize: r = "md", ...t }) => /* @__PURE__ */ o(
1233
+ L,
1242
1234
  {
1243
- buttonContent: /* @__PURE__ */ s(
1244
- A,
1235
+ buttonContent: /* @__PURE__ */ o(
1236
+ C,
1245
1237
  {
1246
- icon: Se,
1247
- className: f({ "px-1": r === "sm" })
1238
+ icon: Pe,
1239
+ widthAuto: !0,
1240
+ className: d({ "px-1": r === "sm" })
1248
1241
  }
1249
1242
  ),
1250
1243
  caretless: !0,
1251
- buttonLabel: t,
1244
+ buttonLabel: e,
1252
1245
  buttonSize: r,
1253
- ...e
1246
+ ...t
1254
1247
  }
1255
1248
  ), hr = Object.assign(Mt, {
1256
- Item: R.Item,
1257
- Separator: R.Separator,
1258
- Title: R.Title,
1259
- Misc: R.Misc
1249
+ Item: L.Item,
1250
+ Separator: L.Separator,
1251
+ Title: L.Title,
1252
+ Misc: L.Misc
1260
1253
  }), _t = ({
1261
- open: t,
1254
+ open: e,
1262
1255
  children: r,
1263
- className: e,
1256
+ className: t,
1264
1257
  onClose: n,
1265
1258
  ...a
1266
1259
  }) => {
1267
- const o = I(null);
1268
- return T(() => {
1269
- var c, k;
1270
- const l = document.body, i = l.style.overflow, d = l.style.paddingRight;
1271
- if (t) {
1272
- const w = window.outerWidth - l.clientWidth, x = l.scrollHeight > l.clientHeight;
1273
- l.style.overflow = "hidden", x && (l.style.paddingRight = `${w}px`), (c = o.current) == null || c.showModal();
1260
+ const s = T(null);
1261
+ return R(() => {
1262
+ const l = document.body, i = l.style.overflow, c = l.style.paddingRight;
1263
+ if (e) {
1264
+ const m = window.outerWidth - l.clientWidth, f = l.scrollHeight > l.clientHeight;
1265
+ l.style.overflow = "hidden", f && (l.style.paddingRight = `${m}px`), s.current?.showModal();
1274
1266
  } else
1275
- (k = o.current) == null || k.close();
1267
+ s.current?.close();
1276
1268
  return () => {
1277
- l.style.overflow = i, l.style.paddingRight = d;
1269
+ l.style.overflow = i, l.style.paddingRight = c;
1278
1270
  };
1279
- }, [t]), Ue(
1280
- /* @__PURE__ */ s(
1271
+ }, [e]), Ue(
1272
+ /* @__PURE__ */ o(
1281
1273
  "dialog",
1282
1274
  {
1283
- ref: o,
1284
- className: p("bg-transparent backdrop:bg-black/50", e),
1275
+ ref: s,
1276
+ className: d("bg-transparent backdrop:bg-black/50", t),
1285
1277
  onCancel: (l) => {
1286
1278
  l.preventDefault(), n();
1287
1279
  },
1288
1280
  ...a,
1289
- children: t && r
1281
+ children: e && r
1290
1282
  }
1291
1283
  ),
1292
1284
  document.body
1293
1285
  );
1294
1286
  }, fr = ({
1295
- open: t,
1287
+ open: e,
1296
1288
  onClose: r,
1297
- variant: e = "default",
1289
+ variant: t = "default",
1298
1290
  title: n,
1299
1291
  children: a,
1300
- className: o,
1292
+ className: s,
1301
1293
  ...l
1302
1294
  }) => {
1303
1295
  const {
1304
1296
  size: i = "md",
1305
- confirmText: d = "Confirm",
1306
- cancelText: c = "Cancel",
1307
- confirmDisabled: k,
1297
+ confirmText: c = "Confirm",
1298
+ cancelText: m = "Cancel",
1299
+ confirmDisabled: f,
1308
1300
  onConfirm: w,
1309
1301
  onClosed: x,
1310
- ...g
1311
- } = "onConfirm" in l ? l : { ...l }, [m, h] = S(t), y = I(null), u = I("cancel"), O = v((C) => {
1312
- C.preventDefault(), C.stopPropagation(), u.current = "confirm", w == null || w();
1302
+ ...h
1303
+ } = "onConfirm" in l ? l : { ...l }, [u, p] = P(e), b = T(null), y = T("cancel"), A = k((N) => {
1304
+ N.preventDefault(), N.stopPropagation(), y.current = "confirm", w?.();
1313
1305
  }, [w]);
1314
- return T(() => {
1315
- if (t) {
1316
- u.current = "cancel", h(!0);
1306
+ return R(() => {
1307
+ if (e) {
1308
+ y.current = "cancel", p(!0);
1317
1309
  return;
1318
1310
  }
1319
- const C = y.current;
1320
- if (C) {
1321
- delete y.current.dataset.open;
1322
- let M = !1;
1323
- const $ = (H) => {
1324
- M || H.target !== C || (M = !0, h(!1), x == null || x(u.current));
1311
+ const N = b.current;
1312
+ if (N) {
1313
+ delete b.current.dataset.open;
1314
+ let D = !1;
1315
+ const U = (G) => {
1316
+ D || G.target !== N || (D = !0, p(!1), x?.(y.current));
1325
1317
  };
1326
- return C.addEventListener("transitionend", $), () => {
1327
- C.removeEventListener("transitionend", $);
1318
+ return N.addEventListener("transitionend", U), () => {
1319
+ N.removeEventListener("transitionend", U);
1328
1320
  };
1329
1321
  }
1330
- }, [x, t]), T(() => {
1331
- const C = y.current;
1332
- m && C && (C.dataset.open = "");
1333
- }, [m]), /* @__PURE__ */ s(
1322
+ }, [x, e]), R(() => {
1323
+ const N = b.current;
1324
+ u && N && (N.dataset.open = "");
1325
+ }, [u]), /* @__PURE__ */ o(
1334
1326
  _t,
1335
1327
  {
1336
- open: m,
1328
+ open: u,
1337
1329
  onClose: r,
1338
- className: p(
1330
+ className: d(
1339
1331
  {
1340
- "flex w-screen h-screen max-w-screen max-h-screen": m,
1341
- "overflow-hidden": e === "cover"
1332
+ "flex w-screen h-screen max-w-screen max-h-screen": u,
1333
+ "overflow-hidden": t === "cover"
1342
1334
  },
1343
- o
1335
+ s
1344
1336
  ),
1345
- ...g,
1346
- children: /* @__PURE__ */ s(
1337
+ ...h,
1338
+ children: /* @__PURE__ */ o(
1347
1339
  "form",
1348
1340
  {
1349
1341
  "data-testid": "transition-container",
1350
- ref: y,
1351
- className: p(
1342
+ ref: b,
1343
+ className: d(
1352
1344
  "w-full m-auto p-4 sm:p-6",
1353
1345
  // CSS transitions are based on the presence of the `data-open` attribute
1354
1346
  "-translate-y-4 data-open:translate-y-0 opacity-0 data-open:opacity-100",
1355
1347
  "transition-[opacity_,_translate] duration-300",
1356
1348
  // Handle modal dimensions for different variants and sizes
1357
- e !== "cover" && {
1349
+ t !== "cover" && {
1358
1350
  "sm:w-sm": i === "sm",
1359
1351
  "md:w-lg": i === "md",
1360
1352
  "md:w-4xl": i === "lg",
1361
1353
  "md:w-6xl": i === "xl"
1362
1354
  },
1363
- { "h-full": e === "cover" }
1355
+ { "h-full": t === "cover" }
1364
1356
  ),
1365
- onSubmit: O,
1366
- children: /* @__PURE__ */ s(L, { className: p(
1357
+ onSubmit: A,
1358
+ children: /* @__PURE__ */ o(O, { className: d(
1367
1359
  "w-full",
1368
- { "h-full relative overflow-auto": e === "cover" }
1369
- ), children: e === "cover" ? /* @__PURE__ */ b(G, { children: [
1370
- /* @__PURE__ */ b(
1360
+ { "h-full relative overflow-auto": t === "cover" }
1361
+ ), children: t === "cover" ? /* @__PURE__ */ g($, { children: [
1362
+ /* @__PURE__ */ g(
1371
1363
  "div",
1372
1364
  {
1373
- className: p(
1365
+ className: d(
1374
1366
  "px-4 py-3 absolute top-0 left-0 right-0 z-3000",
1375
1367
  "flex items-center justify-between",
1376
1368
  "text-white bg-linear-to-b from-black/70 to-black/10",
1377
1369
  "[text-shadow:_0_2px_4px_rgb(0_0_0/_0.8)]"
1378
1370
  ),
1379
1371
  children: [
1380
- /* @__PURE__ */ s("h5", { children: n }),
1381
- /* @__PURE__ */ s(Q, { onClick: r, label: "Close dialog" })
1372
+ /* @__PURE__ */ o("h5", { children: n }),
1373
+ /* @__PURE__ */ o(Y, { onClick: r, label: "Close dialog" })
1382
1374
  ]
1383
1375
  }
1384
1376
  ),
1385
1377
  a
1386
- ] }) : /* @__PURE__ */ b(G, { children: [
1387
- /* @__PURE__ */ b(L.Header, { className: p(
1378
+ ] }) : /* @__PURE__ */ g($, { children: [
1379
+ /* @__PURE__ */ g(O.Header, { className: d(
1388
1380
  "sticky top-0",
1389
1381
  "flex items-center justify-between gap-x-2"
1390
1382
  ), children: [
1391
- /* @__PURE__ */ s("h5", { className: p({ "text-danger": e === "danger" }), children: n }),
1392
- /* @__PURE__ */ s(Q, { onClick: r, label: "Close dialog" })
1383
+ /* @__PURE__ */ o("h5", { className: d({ "text-danger": t === "danger" }), children: n }),
1384
+ /* @__PURE__ */ o(Y, { onClick: r, label: "Close dialog" })
1393
1385
  ] }),
1394
- /* @__PURE__ */ s(L.Body, { children: a }),
1395
- w && /* @__PURE__ */ b(
1396
- L.Footer,
1386
+ /* @__PURE__ */ o(O.Body, { children: a }),
1387
+ w && /* @__PURE__ */ g(
1388
+ O.Footer,
1397
1389
  {
1398
1390
  "data-testid": "footer",
1399
- className: p(
1391
+ className: d(
1400
1392
  "flex justify-end items-center gap-x-2",
1401
1393
  "[&]:px-3 sticky bottom-0"
1402
1394
  ),
1403
1395
  children: [
1404
- /* @__PURE__ */ s(wt, { onClick: r, children: c }),
1405
- /* @__PURE__ */ s(
1406
- ce,
1396
+ /* @__PURE__ */ o(kt, { onClick: r, children: m }),
1397
+ /* @__PURE__ */ o(
1398
+ de,
1407
1399
  {
1408
1400
  solid: !0,
1409
- variant: e === "danger" ? "danger" : "primary",
1410
- disabled: k,
1401
+ variant: t === "danger" ? "danger" : "primary",
1402
+ disabled: f,
1411
1403
  type: "submit",
1412
- children: d
1404
+ children: c
1413
1405
  }
1414
1406
  )
1415
1407
  ]
@@ -1420,225 +1412,216 @@ const gr = ({ currentPage: t, pagesCount: r, ...e }) => {
1420
1412
  )
1421
1413
  }
1422
1414
  );
1423
- }, xr = ({ className: t, children: r, loading: e = !1, variant: n = "default" }) => /* @__PURE__ */ s(Qe, { className: f({ "[&]:border-danger": n === "error" }, t), children: /* @__PURE__ */ b("h3", { className: f("text-center", {
1415
+ }, xr = ({ className: e, children: r, loading: t = !1, variant: n = "default" }) => /* @__PURE__ */ o(Qe, { className: d({ "[&]:border-danger": n === "error" }, e), children: /* @__PURE__ */ g("h3", { className: d("text-center", {
1424
1416
  "text-gray-500 dark:text-gray-400": n === "default",
1425
1417
  "text-danger": n === "error"
1426
1418
  }), children: [
1427
- e && /* @__PURE__ */ b(G, { children: [
1428
- /* @__PURE__ */ s(A, { icon: le, spin: !0 }),
1429
- /* @__PURE__ */ s("span", { className: "ml-2", children: r ?? "Loading..." })
1419
+ t && /* @__PURE__ */ g($, { children: [
1420
+ /* @__PURE__ */ o(C, { icon: se, spin: !0 }),
1421
+ /* @__PURE__ */ o("span", { className: "ml-2", children: r ?? "Loading..." })
1430
1422
  ] }),
1431
- !e && r
1432
- ] }) }), yr = ({ variant: t, className: r, size: e = "md", children: n }) => /* @__PURE__ */ s(
1423
+ !t && r
1424
+ ] }) }), yr = ({ variant: e, className: r, size: t = "md", children: n }) => /* @__PURE__ */ o(
1433
1425
  "div",
1434
1426
  {
1435
- className: f(
1427
+ className: d(
1436
1428
  "rounded-md text-center",
1437
1429
  {
1438
- "p-2": e === "sm",
1439
- "p-4": e === "md",
1440
- "p-6": e === "lg",
1441
- "[&]:text-white": t !== "warning",
1442
- "bg-lm-brand dark:bg-dm-brand": t === "success",
1443
- "bg-danger": t === "error",
1444
- "bg-warning text-black": t === "warning"
1430
+ "p-2": t === "sm",
1431
+ "p-4": t === "md",
1432
+ "p-6": t === "lg",
1433
+ "[&]:text-white": e !== "warning",
1434
+ "bg-lm-brand dark:bg-dm-brand": e === "success",
1435
+ "bg-danger": e === "error",
1436
+ "bg-warning text-black": e === "warning"
1445
1437
  },
1446
1438
  r
1447
1439
  ),
1448
1440
  children: n
1449
1441
  }
1450
- ), kr = ({ placement: t = "auto" } = {}) => {
1451
- const r = I(null), e = (() => {
1452
- const h = [];
1453
- return t === "auto" && h.push(Be()), h.push(Fe({ element: r })), h;
1454
- })(), [n, a] = S(!1), { refs: o, floatingStyles: l, context: i, middlewareData: d } = ie({
1455
- placement: t === "auto" ? void 0 : t,
1442
+ ), wr = ({ placement: e = "auto" } = {}) => {
1443
+ const r = T(null), t = (() => {
1444
+ const p = [];
1445
+ return e === "auto" && p.push(Fe()), p.push(Be({ element: r })), p;
1446
+ })(), [n, a] = P(!1), { refs: s, floatingStyles: l, context: i, middlewareData: c } = le({
1447
+ placement: e === "auto" ? void 0 : e,
1456
1448
  open: n,
1457
1449
  onOpenChange: a,
1458
- middleware: e
1459
- }), c = $e(i, {
1450
+ middleware: t
1451
+ }), m = He(i, {
1460
1452
  delay: { open: 300 },
1461
1453
  move: !0
1462
- }), { getFloatingProps: k, getReferenceProps: w } = de([c]), { isMounted: x, styles: g } = He(i, { duration: 200 }), m = D(() => {
1463
- const h = i.placement.split("-")[0];
1454
+ }), { getFloatingProps: f, getReferenceProps: w } = ie([m]), { isMounted: x, styles: h } = $e(i, { duration: 200 }), u = E(() => {
1455
+ const p = i.placement.split("-")[0];
1464
1456
  return {
1465
1457
  top: "bottom",
1466
1458
  right: "left",
1467
1459
  bottom: "top",
1468
1460
  left: "right"
1469
- }[h] ?? "";
1461
+ }[p] ?? "";
1470
1462
  }, [i.placement]);
1471
1463
  return {
1472
- anchor: { ...w(), ref: o.setReference },
1464
+ anchor: { ...w(), ref: s.setReference },
1473
1465
  tooltip: {
1474
- ...k(),
1475
- refSetter: o.setFloating,
1466
+ ...f(),
1467
+ refSetter: s.setFloating,
1476
1468
  isMounted: x,
1477
- styles: { ...l, ...g },
1478
- arrowPos: d.arrow,
1469
+ styles: { ...l, ...h },
1470
+ arrowPos: c.arrow,
1479
1471
  arrowRef: r,
1480
- arrowSide: m
1472
+ arrowSide: u
1481
1473
  }
1482
1474
  };
1483
- }, wr = ({ children: t, isMounted: r, styles: e, refSetter: n, arrowRef: a, arrowPos: o, arrowSide: l, ...i }) => {
1484
- var d;
1485
- return r && /* @__PURE__ */ s(
1486
- "div",
1487
- {
1488
- role: "tooltip",
1489
- "aria-live": "polite",
1490
- className: f(
1491
- "z-500 max-w-64",
1492
- // Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
1493
- // and it's never closed
1475
+ }, kr = ({ children: e, isMounted: r, styles: t, refSetter: n, arrowRef: a, arrowPos: s, arrowSide: l, ...i }) => r && /* @__PURE__ */ o(
1476
+ "div",
1477
+ {
1478
+ role: "tooltip",
1479
+ "aria-live": "polite",
1480
+ className: d(
1481
+ "z-500 max-w-64",
1482
+ // Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
1483
+ // and it's never closed
1484
+ {
1485
+ "pt-2.5": l === "top",
1486
+ "pb-2.5": l === "bottom",
1487
+ "pr-2.5": l === "right",
1488
+ "pl-2.5": l === "left"
1489
+ }
1490
+ ),
1491
+ ref: n,
1492
+ style: t,
1493
+ ...i,
1494
+ children: /* @__PURE__ */ g("div", { className: "relative px-1.5 py-1 rounded bg-black/90 text-white text-center", children: [
1495
+ /* @__PURE__ */ o("span", { className: "sr-only", children: "Tooltip: " }),
1496
+ e,
1497
+ /* @__PURE__ */ o(
1498
+ "div",
1494
1499
  {
1495
- "pt-2.5": l === "top",
1496
- "pb-2.5": l === "bottom",
1497
- "pr-2.5": l === "right",
1498
- "pl-2.5": l === "left"
1500
+ ref: a,
1501
+ className: d(
1502
+ "absolute",
1503
+ // Render as a triangle
1504
+ "border-l-6 border-r-6 border-b-6 border-l-transparent border-r-transparent border-b-black/90",
1505
+ // Rotate triangle so that it points to the correct direction
1506
+ {
1507
+ "rotate-180": l === "bottom",
1508
+ "rotate-90 mr-[-3px]": l === "right",
1509
+ "rotate-270 ml-[-3px]": l === "left"
1510
+ }
1511
+ ),
1512
+ style: {
1513
+ left: s?.x,
1514
+ top: s?.y,
1515
+ [l]: `${-(a.current?.offsetWidth ?? 0) / 2}px`
1516
+ },
1517
+ "data-testid": "arrow"
1499
1518
  }
1500
- ),
1501
- ref: n,
1502
- style: e,
1503
- ...i,
1504
- children: /* @__PURE__ */ b("div", { className: "relative px-1.5 py-1 rounded bg-black/90 text-white text-center", children: [
1505
- /* @__PURE__ */ s("span", { className: "sr-only", children: "Tooltip: " }),
1506
- t,
1507
- /* @__PURE__ */ s(
1508
- "div",
1509
- {
1510
- ref: a,
1511
- className: f(
1512
- "absolute",
1513
- // Render as a triangle
1514
- "border-l-6 border-r-6 border-b-6 border-l-transparent border-r-transparent border-b-black/90",
1515
- // Rotate triangle so that it points to the correct direction
1516
- {
1517
- "rotate-180": l === "bottom",
1518
- "rotate-90 mr-[-3px]": l === "right",
1519
- "rotate-270 ml-[-3px]": l === "left"
1520
- }
1521
- ),
1522
- style: {
1523
- left: o == null ? void 0 : o.x,
1524
- top: o == null ? void 0 : o.y,
1525
- [l]: `${-(((d = a.current) == null ? void 0 : d.offsetWidth) ?? 0) / 2}px`
1526
- },
1527
- "data-testid": "arrow"
1528
- }
1529
- )
1530
- ] })
1531
- }
1532
- );
1533
- };
1534
- function Bt(t) {
1535
- if (t.currentField !== t.newField)
1519
+ )
1520
+ ] })
1521
+ }
1522
+ );
1523
+ function Ft(e) {
1524
+ if (e.currentField !== e.newField)
1536
1525
  return "ASC";
1537
1526
  const r = {
1538
1527
  ASC: "DESC",
1539
1528
  DESC: void 0
1540
1529
  };
1541
- return t.currentOrderDir ? r[t.currentOrderDir] : "ASC";
1530
+ return e.currentOrderDir ? r[e.currentOrderDir] : "ASC";
1542
1531
  }
1543
- function Ft(t) {
1544
- const r = Bt(t);
1532
+ function Bt(e) {
1533
+ const r = Ft(e);
1545
1534
  return {
1546
- field: r ? t.newField : void 0,
1535
+ field: r ? e.newField : void 0,
1547
1536
  dir: r
1548
1537
  };
1549
1538
  }
1550
- const vr = (t, { field: r, dir: e }) => !r || !e ? t : t.sort((n, a) => {
1551
- const o = e === "ASC" ? 1 : -1, l = e === "ASC" ? -1 : 1;
1552
- return n[r] > a[r] ? o : l;
1553
- }), Nr = (t) => t.dir ? `${t.field}-${t.dir}` : void 0, Cr = (t) => {
1554
- const [r, e] = t.split("-");
1555
- return { field: r, dir: e };
1539
+ const vr = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, a) => {
1540
+ const s = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
1541
+ return n[r] > a[r] ? s : l;
1542
+ }), Nr = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Cr = (e) => {
1543
+ const [r, t] = e.split("-");
1544
+ return { field: r, dir: t };
1556
1545
  };
1557
- function Ar({ items: t, order: r, onChange: e, prefixed: n = !0, buttonVariant: a = "button", ...o }) {
1558
- const l = v((d) => {
1559
- const c = Ft({ currentOrderDir: r.dir, currentField: r.field, newField: d });
1560
- e(c);
1561
- }, [e, r.dir, r.field]), i = a === "button";
1562
- return /* @__PURE__ */ b(
1563
- R,
1546
+ function Tr({ items: e, order: r, onChange: t, prefixed: n = !0, buttonVariant: a = "button", ...s }) {
1547
+ const l = k((c) => {
1548
+ const m = Bt({ currentOrderDir: r.dir, currentField: r.field, newField: c });
1549
+ t(m);
1550
+ }, [t, r.dir, r.field]), i = a === "button";
1551
+ return /* @__PURE__ */ g(
1552
+ L,
1564
1553
  {
1565
- buttonContent: /* @__PURE__ */ b(G, { children: [
1554
+ buttonContent: /* @__PURE__ */ g($, { children: [
1566
1555
  !i && "Order by",
1567
- i && !r.field && /* @__PURE__ */ s("i", { children: "Order by..." }),
1568
- i && r.field && /* @__PURE__ */ b(G, { children: [
1556
+ i && !r.field && /* @__PURE__ */ o("i", { children: "Order by..." }),
1557
+ i && r.field && /* @__PURE__ */ g($, { children: [
1569
1558
  n && "Order by: ",
1570
- t[r.field],
1559
+ e[r.field],
1571
1560
  " - ",
1572
1561
  r.dir ?? "DESC"
1573
1562
  ] })
1574
1563
  ] }),
1575
1564
  buttonVariant: a,
1576
- ...o,
1565
+ ...s,
1577
1566
  children: [
1578
- Object.entries(t).map(([d, c]) => /* @__PURE__ */ b(
1579
- R.Item,
1567
+ Object.entries(e).map(([c, m]) => /* @__PURE__ */ g(
1568
+ L.Item,
1580
1569
  {
1581
- selected: r.field === d,
1582
- onClick: () => l(d),
1570
+ selected: r.field === c,
1571
+ onClick: () => l(c),
1583
1572
  className: "flex items-center justify-between gap-2",
1584
1573
  children: [
1585
- c,
1586
- r.field === d && /* @__PURE__ */ s(A, { icon: r.dir === "ASC" ? Pe : De })
1574
+ m,
1575
+ r.field === c && /* @__PURE__ */ o(C, { icon: r.dir === "ASC" ? Ee : Se })
1587
1576
  ]
1588
1577
  },
1589
- d
1578
+ c
1590
1579
  )),
1591
- /* @__PURE__ */ s(R.Separator, {}),
1592
- /* @__PURE__ */ s(R.Item, { disabled: !r.field, onClick: () => e({}), children: /* @__PURE__ */ s("i", { children: "Clear selection" }) })
1580
+ /* @__PURE__ */ o(L.Separator, {}),
1581
+ /* @__PURE__ */ o(L.Item, { disabled: !r.field, onClick: () => t({}), children: /* @__PURE__ */ o("i", { children: "Clear selection" }) })
1593
1582
  ]
1594
1583
  }
1595
1584
  );
1596
1585
  }
1597
- const $t = "#4696e5", Ht = "rgba(70, 150, 229, 0.4)", jt = "#2078CF", Ut = "rgba(32, 120, 207, 0.4)", Ir = () => xe() ? $t : jt, Or = () => xe() ? Ht : Ut, Lr = "#f77f28", Rr = "rgba(247, 127, 40, 0.4)", Tr = "white", Sr = "#161b22", Gt = (t) => {
1598
- var r;
1599
- return (r = document.querySelector("html")) == null ? void 0 : r.setAttribute("data-theme", t);
1600
- }, xe = () => {
1601
- var t;
1602
- return ((t = document.querySelector("html")) == null ? void 0 : t.getAttribute("data-theme")) === "dark";
1603
- }, Wt = (t = window.matchMedia.bind(window)) => t("(prefers-color-scheme: dark)").matches ? "dark" : "light", Pr = (t) => {
1604
- const [r, e] = S(() => t ?? Wt());
1605
- return T(() => {
1586
+ const Ht = "#4696e5", $t = "rgba(70, 150, 229, 0.4)", jt = "#2078CF", Ut = "rgba(32, 120, 207, 0.4)", Ar = () => xe() ? Ht : jt, Ir = () => xe() ? $t : Ut, Or = "#f77f28", Lr = "rgba(247, 127, 40, 0.4)", Rr = "white", Pr = "#161b22", Gt = (e) => document.querySelector("html")?.setAttribute("data-theme", e), xe = () => document.querySelector("html")?.getAttribute("data-theme") === "dark", Kt = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", Er = (e) => {
1587
+ const [r, t] = P(() => e ?? Kt());
1588
+ return R(() => {
1606
1589
  Gt(r);
1607
- }, [r]), [r, e];
1590
+ }, [r]), [r, t];
1608
1591
  };
1609
1592
  export {
1610
- Ht as BRAND_COLOR_ALPHA_DM,
1593
+ $t as BRAND_COLOR_ALPHA_DM,
1611
1594
  Ut as BRAND_COLOR_ALPHA_LM,
1612
- $t as BRAND_COLOR_DM,
1595
+ Ht as BRAND_COLOR_DM,
1613
1596
  jt as BRAND_COLOR_LM,
1614
1597
  Ct as BaseNavBar,
1615
- ce as Button,
1616
- L as Card,
1598
+ de as Button,
1599
+ O as Card,
1617
1600
  fr as CardModal,
1618
1601
  rr as Checkbox,
1619
- Q as CloseButton,
1602
+ Y as CloseButton,
1620
1603
  dr as CopyToClipboardButton,
1621
1604
  er as Details,
1622
- R as Dropdown,
1605
+ L as Dropdown,
1623
1606
  K as ELLIPSIS,
1624
- Lr as HIGHLIGHTED_COLOR,
1625
- Rr as HIGHLIGHTED_COLOR_ALPHA,
1607
+ Or as HIGHLIGHTED_COLOR,
1608
+ Lr as HIGHLIGHTED_COLOR_ALPHA,
1626
1609
  J as Input,
1627
1610
  Z as Label,
1628
1611
  nr as LabelledInput,
1629
1612
  or as LabelledRevealablePasswordInput,
1630
1613
  ar as LabelledSelect,
1631
- wt as LinkButton,
1614
+ kt as LinkButton,
1632
1615
  Ye as Listbox,
1633
- j as Menu,
1616
+ B as Menu,
1634
1617
  xr as Message,
1635
1618
  _t as ModalDialog,
1636
1619
  ur as NavBar,
1637
1620
  pr as NavPills,
1638
- Ar as OrderingDropdown,
1639
- Sr as PRIMARY_DARK_COLOR,
1640
- Tr as PRIMARY_LIGHT_COLOR,
1641
- gr as Paginator,
1621
+ Tr as OrderingDropdown,
1622
+ Pr as PRIMARY_DARK_COLOR,
1623
+ Rr as PRIMARY_LIGHT_COLOR,
1624
+ br as Paginator,
1642
1625
  yr as Result,
1643
1626
  tt as RevealablePasswordInput,
1644
1627
  hr as RowDropdown,
@@ -1649,32 +1632,32 @@ export {
1649
1632
  tr as Table,
1650
1633
  sr as TagsAutocomplete,
1651
1634
  lr as ToggleSwitch,
1652
- wr as Tooltip,
1653
- Ir as brandColor,
1654
- Or as brandColorAlpha,
1635
+ kr as Tooltip,
1636
+ Ar as brandColor,
1637
+ Ir as brandColorAlpha,
1655
1638
  Gt as changeThemeInMarkup,
1656
- Ft as determineOrder,
1657
- Bt as determineOrderDir,
1658
- Lt as formatNumber,
1659
- Wt as getSystemPreferredTheme,
1639
+ Bt as determineOrder,
1640
+ Ft as determineOrderDir,
1641
+ Ot as formatNumber,
1642
+ Kt as getSystemPreferredTheme,
1660
1643
  xe as isDarkThemeEnabled,
1661
1644
  mt as isLightColor,
1662
- Pt as keyForPage,
1645
+ Et as keyForPage,
1663
1646
  Nr as orderToString,
1664
- U as pageIsEllipsis,
1647
+ H as pageIsEllipsis,
1665
1648
  ut as parseQueryString,
1666
- St as prettifyPageNumber,
1667
- Tt as progressivePagination,
1668
- br as roundTen,
1649
+ Pt as prettifyPageNumber,
1650
+ Rt as progressivePagination,
1651
+ gr as roundTen,
1669
1652
  vr as sortList,
1670
1653
  Cr as stringToOrder,
1671
1654
  cr as stringifyQueryParams,
1672
1655
  dt as useArrowKeyNavigation,
1673
1656
  ir as useGoBack,
1674
1657
  mr as useParsedQuery,
1675
- Pr as useTheme,
1676
- ue as useTimeout,
1677
- bt as useTimeoutToggle,
1678
- pe as useToggle,
1679
- kr as useTooltip
1658
+ Er as useTheme,
1659
+ me as useTimeout,
1660
+ gt as useTimeoutToggle,
1661
+ ue as useToggle,
1662
+ wr as useTooltip
1680
1663
  };