@versini/sassysaint 5.3.9 → 5.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,29 @@
1
- import { jsxs as v, Fragment as $, jsx as i } from "react/jsx-runtime";
2
- import { AppContext as U, TagsContext as G, rn as V, ACTION_SET_TAGS as oe, b as Te, j as _e, R as j, isLastMessageFromRole as ne, CANCEL as Ne, CLEAR as we, ACTION_RESET as ie, ACTION_TOGGLE_TAG as se, ROLE_ASSISTANT as C, ROLE_INTERNAL as P, ROLE_USER as H, ROLE_SYSTEM as Ee, ROLE_HIDDEN as Ce, DEFAULT_AI_ENGINE as L, STATS_SEPARATOR as q, ACTION_MODEL as de, ACTION_MESSAGE as B, ACTION_RESET_TAGS as le, TYPE_QUESTION as Ie, SEND as Se, ACTION_STREAMING as ce, ERROR_MESSAGE as Re, getMessageContaintWrapperClass as Be, MessagesContainerHeader as Ae, ACTION_SEARCH as Me, ACTION_SORT as Le, ACTION_RESTORE as Oe, ACTION_ENGINE as ge, HistoryContext as $e, d as Ue, AppFooter as Ve, LOCAL_STORAGE_PREFIX as J, LOCAL_STORAGE_SEARCH as ze, LOCAL_STORAGE_SORT as De } from "./index.BiQ5lu6V.js";
3
- import { serviceCall as ue, SERVICE_TYPES as me, restCall as je, we as He, E as Q, f as Ge } from "./index.DbhB3Iku.js";
4
- import S, { useContext as A, useState as M, useRef as I, useEffect as _, lazy as Pe, Suspense as X, useReducer as z } from "react";
1
+ import { jsx as i, jsxs as v, Fragment as O } from "react/jsx-runtime";
2
+ import { g as _e, AppContext as $, TagsContext as j, rn as U, ACTION_SET_TAGS as oe, b as Ne, j as we, R as ne, isLastMessageFromRole as ie, O as Ee, TOOLBOX as Y, ACTION_RESET as se, ACTION_TOGGLE_TAG as de, ROLE_ASSISTANT as I, ROLE_INTERNAL as G, ROLE_USER as H, ROLE_SYSTEM as Ie, ROLE_HIDDEN as Ce, DEFAULT_AI_ENGINE as M, STATS_SEPARATOR as q, ACTION_MODEL as le, ACTION_MESSAGE as S, ACTION_RESET_TAGS as ce, TYPE_QUESTION as Se, SEND as Re, ACTION_STREAMING as ge, ERROR_MESSAGE as Be, getMessageContaintWrapperClass as Ae, MessagesContainerHeader as Me, ACTION_SEARCH as Le, ACTION_SORT as Oe, ACTION_RESTORE as $e, ACTION_ENGINE as ue, HistoryContext as Ue, d as ze, AppFooter as Ve, LOCAL_STORAGE_PREFIX as X, LOCAL_STORAGE_SEARCH as De, LOCAL_STORAGE_SORT as He } from "./index.BpfSkOWt.js";
3
+ import { serviceCall as me, SERVICE_TYPES as he, n as je, restCall as Ge, we as Pe, E as J, f as We } from "./index.DkEEvxgQ.js";
4
+ import C, { useContext as R, useState as A, useRef as B, useEffect as _, lazy as Fe, Suspense as Q, useReducer as V } from "react";
5
5
  import l from "clsx";
6
- function Fe(e) {
6
+ const Ke = ({
7
+ className: e,
8
+ viewBox: t,
9
+ spacing: r,
10
+ title: a,
11
+ monotone: n,
12
+ ...o
13
+ }) => /* @__PURE__ */ i(
14
+ _e,
15
+ {
16
+ defaultViewBox: "0 0 384 512",
17
+ defaultClassName: "size-5",
18
+ viewBox: t,
19
+ className: e,
20
+ spacing: r,
21
+ title: a || "Close",
22
+ ...o,
23
+ children: /* @__PURE__ */ i("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z" })
24
+ }
25
+ );
26
+ function Ye(e) {
7
27
  const t = e.toLowerCase().split("+").map((o) => o.trim()), r = {
8
28
  alt: t.includes("alt"),
9
29
  ctrl: t.includes("ctrl"),
@@ -16,119 +36,121 @@ function Fe(e) {
16
36
  key: n
17
37
  };
18
38
  }
19
- function We(e, t) {
20
- const { alt: r, ctrl: a, meta: n, mod: o, shift: c, key: s } = e, { altKey: p, ctrlKey: g, metaKey: h, shiftKey: b, key: u } = t;
21
- if (r !== p)
39
+ function qe(e, t) {
40
+ const { alt: r, ctrl: a, meta: n, mod: o, shift: c, key: d } = e, { altKey: m, ctrlKey: g, metaKey: p, shiftKey: u, key: b } = t;
41
+ if (r !== m)
22
42
  return !1;
23
43
  if (o) {
24
- if (!g && !h)
44
+ if (!g && !p)
25
45
  return !1;
26
- } else if (a !== g || n !== h)
46
+ } else if (a !== g || n !== p)
27
47
  return !1;
28
- return c !== b ? !1 : !!(s && (u.toLowerCase() === s.toLowerCase() || t.code.replace("Key", "").toLowerCase() === s.toLowerCase()));
48
+ return c !== u ? !1 : !!(d && (b.toLowerCase() === d.toLowerCase() || t.code.replace("Key", "").toLowerCase() === d.toLowerCase()));
29
49
  }
30
- function Ke(e) {
31
- return (t) => We(Fe(e), t);
50
+ function Xe(e) {
51
+ return (t) => qe(Ye(e), t);
32
52
  }
33
- function Ye(e) {
53
+ function Je(e) {
34
54
  return (t) => {
35
55
  const r = "nativeEvent" in t ? t.nativeEvent : t;
36
56
  e.forEach(([a, n, o = { preventDefault: !0 }]) => {
37
- Ke(a)(r) && (o.preventDefault && t.preventDefault(), n(r));
57
+ Xe(a)(r) && (o.preventDefault && t.preventDefault(), n(r));
38
58
  });
39
59
  };
40
60
  }
41
61
  const f = [];
42
62
  for (let e = 0; e < 256; ++e)
43
63
  f.push((e + 256).toString(16).slice(1));
44
- function qe(e, t = 0) {
64
+ function Qe(e, t = 0) {
45
65
  return (f[e[t + 0]] + f[e[t + 1]] + f[e[t + 2]] + f[e[t + 3]] + "-" + f[e[t + 4]] + f[e[t + 5]] + "-" + f[e[t + 6]] + f[e[t + 7]] + "-" + f[e[t + 8]] + f[e[t + 9]] + "-" + f[e[t + 10]] + f[e[t + 11]] + f[e[t + 12]] + f[e[t + 13]] + f[e[t + 14]] + f[e[t + 15]]).toLowerCase();
46
66
  }
47
67
  let D;
48
- const Je = new Uint8Array(16);
49
- function Qe() {
68
+ const Ze = new Uint8Array(16);
69
+ function et() {
50
70
  if (!D) {
51
71
  if (typeof crypto > "u" || !crypto.getRandomValues)
52
72
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
53
73
  D = crypto.getRandomValues.bind(crypto);
54
74
  }
55
- return D(Je);
75
+ return D(Ze);
56
76
  }
57
- const Xe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Z = { randomUUID: Xe };
58
- function F(e, t, r) {
77
+ const tt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Z = { randomUUID: tt };
78
+ function P(e, t, r) {
59
79
  if (Z.randomUUID && !t && !e)
60
80
  return Z.randomUUID();
61
81
  e = e || {};
62
- const a = e.random || (e.rng || Qe)();
63
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, qe(a);
82
+ const a = e.random || (e.rng || et)();
83
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Qe(a);
64
84
  }
65
- const Ze = () => {
66
- const { dispatch: e, state: t } = A(U), { dispatch: r, state: a } = A(G), { getAccessToken: n, user: o } = V(), [c, s] = M({
85
+ const rt = () => {
86
+ const { dispatch: e, state: t } = R($), { dispatch: r, state: a } = R(j), { getAccessToken: n, user: o } = U(), [c, d] = A({
67
87
  loaded: !1
68
- }), p = "mt-2 flex justify-center rounded-md", g = I(null), h = I(!1), b = (d) => {
69
- d.preventDefault(), e({
70
- type: ie
88
+ }), m = "mt-2 flex justify-center rounded-md", g = B(null), p = B(!1), u = (s) => {
89
+ s.preventDefault(), e({
90
+ type: se
71
91
  });
72
92
  };
73
93
  _(() => {
74
- (t == null ? void 0 : t.streaming) === !0 && !h.current && g.current && (h.current = !0, g.current.focus()), (t == null ? void 0 : t.streaming) === !1 && (h.current = !1);
94
+ var s;
95
+ (t == null ? void 0 : t.streaming) === !0 && !p.current && g.current && (p.current = !0, g.current.focus()), (t == null ? void 0 : t.streaming) === !1 && (p.current = !1, (s = g.current) == null || s.blur());
75
96
  }, [t]);
76
- const u = (d, m) => {
77
- d.preventDefault(), r({
78
- type: se,
97
+ const b = (s, h) => {
98
+ s.preventDefault(), r({
99
+ type: de,
79
100
  payload: {
80
- tag: m
101
+ tag: h
81
102
  }
82
103
  });
83
104
  };
84
105
  return _(() => {
85
106
  if (!o) {
86
- s({
107
+ d({
87
108
  loaded: !1
88
109
  });
89
110
  return;
90
111
  }
91
112
  c.loaded || (async () => {
92
113
  try {
93
- const d = await ue({
114
+ const s = await me({
94
115
  accessToken: await n(),
95
- type: me.GET_USER_PREFERENCES,
116
+ type: he.GET_USER_PREFERENCES,
96
117
  params: {
97
118
  user: o.username
98
119
  }
99
120
  });
100
- d.status === 200 && (r({
121
+ s.status === 200 && (r({
101
122
  type: oe,
102
123
  payload: {
103
- tags: d.data.tags || []
124
+ tags: s.data.tags || []
104
125
  }
105
- }), s({
126
+ }), d({
106
127
  loaded: !0
107
128
  }));
108
129
  } catch {
109
130
  }
110
131
  })();
111
- }, [o]), /* @__PURE__ */ v($, { children: [
112
- /* @__PURE__ */ i(Te, { alignHorizontal: "center", columnGap: 2, children: c && c.loaded && a.tags && a.tags.map((d) => d.enabled && d.label && d.content && /* @__PURE__ */ i(_e, { children: /* @__PURE__ */ i("div", { className: p, children: /* @__PURE__ */ i(
113
- j,
132
+ }, [o]), /* @__PURE__ */ v(O, { children: [
133
+ /* @__PURE__ */ i(Ne, { alignHorizontal: "center", columnGap: 2, children: c && c.loaded && a.tags && a.tags.map((s) => s.enabled && s.label && s.content && /* @__PURE__ */ i(we, { children: /* @__PURE__ */ i("div", { className: m, children: /* @__PURE__ */ i(
134
+ ne,
114
135
  {
115
136
  noBorder: !0,
116
137
  mode: "dark",
117
138
  focusMode: "light",
118
139
  size: "small",
119
- onClick: (m) => u(m, d.content),
120
- children: d.label
140
+ onClick: (h) => b(h, s.content),
141
+ children: s.label
121
142
  }
122
- ) }) }, `tag-button-${d.slot}`)) }),
123
- ne(C, t) && /* @__PURE__ */ i("div", { className: p, children: /* @__PURE__ */ i(
124
- j,
143
+ ) }) }, `tag-button-${s.slot}`)) }),
144
+ ie(I, t) && /* @__PURE__ */ i("div", { className: m, children: /* @__PURE__ */ i(
145
+ Ee,
125
146
  {
126
147
  noBorder: !0,
127
148
  mode: "dark",
128
149
  focusMode: "light",
129
150
  ref: g,
130
- onClick: b,
131
- children: t != null && t.streaming ? Ne : we
151
+ onClick: u,
152
+ labelRight: t != null && t.streaming ? Y.ACTION_WHILE_STREAMING.content : Y.ACTION_WHILE_NOT_STREAMING.content,
153
+ children: t != null && t.streaming ? /* @__PURE__ */ i(Ke, { className: "size-4" }) : /* @__PURE__ */ i(je, { className: "size-4" })
132
154
  }
133
155
  ) })
134
156
  ] });
@@ -146,7 +168,7 @@ try {
146
168
  });
147
169
  } catch {
148
170
  }
149
- const et = "av-bubble", ee = "av-button", tt = (e) => {
171
+ const at = "av-bubble", ee = "av-button", ot = (e) => {
150
172
  let t = "";
151
173
  if (typeof e == "number" || typeof e == "string")
152
174
  t = "m-" + e;
@@ -155,26 +177,26 @@ const et = "av-bubble", ee = "av-button", tt = (e) => {
155
177
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
156
178
  }
157
179
  return t;
158
- }, W = "icon", rt = "button", at = "link", ot = ({
180
+ }, W = "icon", nt = "button", it = "link", st = ({
159
181
  type: e,
160
182
  size: t,
161
183
  labelRight: r,
162
184
  labelLeft: a,
163
185
  align: n
164
186
  }) => {
165
- const o = "text-sm font-medium max-h-8 py-0", c = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
187
+ const o = "text-sm font-medium max-h-8 py-0", c = "text-base font-medium max-h-9 py-1", d = "text-lg font-medium max-h-12 py-2";
166
188
  switch (e) {
167
- case rt:
189
+ case nt:
168
190
  return l("px-4", {
169
191
  [o]: t === "small",
170
192
  [c]: t === "medium",
171
- [s]: t === "large"
193
+ [d]: t === "large"
172
194
  });
173
- case at:
195
+ case it:
174
196
  return l("px-4 text-center", {
175
197
  [o]: t === "small",
176
198
  [c]: t === "medium",
177
- [s]: t === "large"
199
+ [d]: t === "large"
178
200
  });
179
201
  case W:
180
202
  return l("inline-flex items-center", {
@@ -189,7 +211,7 @@ const et = "av-bubble", ee = "av-button", tt = (e) => {
189
211
  "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
190
212
  });
191
213
  }
192
- }, nt = ({
214
+ }, dt = ({
193
215
  mode: e,
194
216
  noBackground: t,
195
217
  noTruncate: r,
@@ -221,7 +243,7 @@ const et = "av-bubble", ee = "av-button", tt = (e) => {
221
243
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
222
244
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
223
245
  });
224
- }, it = ({
246
+ }, lt = ({
225
247
  mode: e,
226
248
  disabled: t,
227
249
  variant: r
@@ -249,7 +271,7 @@ const et = "av-bubble", ee = "av-button", tt = (e) => {
249
271
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
250
272
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
251
273
  });
252
- }, st = ({
274
+ }, ct = ({
253
275
  mode: e,
254
276
  disabled: t,
255
277
  variant: r
@@ -277,7 +299,7 @@ const et = "av-bubble", ee = "av-button", tt = (e) => {
277
299
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
278
300
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
279
301
  });
280
- }, dt = ({
302
+ }, gt = ({
281
303
  mode: e,
282
304
  noBorder: t,
283
305
  variant: r
@@ -305,12 +327,12 @@ const et = "av-bubble", ee = "av-button", tt = (e) => {
305
327
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
306
328
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
307
329
  });
308
- }, lt = ({ focusMode: e }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
330
+ }, ut = ({ focusMode: e }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
309
331
  "focus:outline-focus-dark": e === "dark",
310
332
  "focus:outline-focus-light": e === "light",
311
333
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
312
334
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
313
- }), he = ({
335
+ }), pe = ({
314
336
  type: e,
315
337
  className: t,
316
338
  raw: r,
@@ -318,47 +340,47 @@ const et = "av-bubble", ee = "av-button", tt = (e) => {
318
340
  focusMode: n,
319
341
  disabled: o,
320
342
  fullWidth: c,
321
- size: s,
322
- noBorder: p,
343
+ size: d,
344
+ noBorder: m,
323
345
  labelRight: g,
324
- labelLeft: h,
325
- spacing: b,
326
- noBackground: u,
327
- variant: d,
328
- noTruncate: m,
346
+ labelLeft: p,
347
+ spacing: u,
348
+ noBackground: b,
349
+ variant: s,
350
+ noTruncate: h,
329
351
  align: y
330
- }) => (d || (d = "primary"), r ? l(ee, t) : l(
352
+ }) => (s || (s = "primary"), r ? l(ee, t) : l(
331
353
  ee,
332
354
  t,
333
- tt(b),
334
- nt({ mode: a, variant: d, noBackground: u, noTruncate: m }),
335
- ot({ type: e, size: s, labelRight: g, labelLeft: h, align: y }),
336
- dt({ mode: a, variant: d, noBorder: p }),
337
- lt({ focusMode: n }),
338
- it({ mode: a, variant: d, disabled: o }),
339
- st({ mode: a, variant: d, disabled: o }),
355
+ ot(u),
356
+ dt({ mode: a, variant: s, noBackground: b, noTruncate: h }),
357
+ st({ type: e, size: d, labelRight: g, labelLeft: p, align: y }),
358
+ gt({ mode: a, variant: s, noBorder: m }),
359
+ ut({ focusMode: n }),
360
+ lt({ mode: a, variant: s, disabled: o }),
361
+ ct({ mode: a, variant: s, disabled: o }),
340
362
  {
341
363
  "w-full": c,
342
364
  "disabled:cursor-not-allowed disabled:opacity-50": o
343
365
  }
344
- )), ct = (e, t, r) => {
366
+ )), mt = (e, t, r) => {
345
367
  var a;
346
368
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
347
- }, K = S.forwardRef((e, t) => {
369
+ }, F = C.forwardRef((e, t) => {
348
370
  const { onClick: r, noInternalClick: a = !1, ...n } = e;
349
371
  return /* @__PURE__ */ i(
350
372
  "button",
351
373
  {
352
374
  ref: t,
353
375
  onClick: (o) => {
354
- ct(o, a, r);
376
+ mt(o, a, r);
355
377
  },
356
378
  ...n
357
379
  }
358
380
  );
359
381
  });
360
- K.displayName = "BaseButton";
361
- const pe = S.forwardRef(
382
+ F.displayName = "BaseButton";
383
+ const be = C.forwardRef(
362
384
  ({
363
385
  children: e,
364
386
  disabled: t = !1,
@@ -367,58 +389,58 @@ const pe = S.forwardRef(
367
389
  fullWidth: n = !1,
368
390
  className: o,
369
391
  type: c = "button",
370
- raw: s = !1,
371
- noBorder: p = !1,
392
+ raw: d = !1,
393
+ noBorder: m = !1,
372
394
  "aria-label": g,
373
- label: h,
374
- size: b = "medium",
375
- labelRight: u,
376
- labelLeft: d,
377
- spacing: m,
395
+ label: p,
396
+ size: u = "medium",
397
+ labelRight: b,
398
+ labelLeft: s,
399
+ spacing: h,
378
400
  noBackground: y = !1,
379
401
  align: N = "center",
380
402
  ...w
381
- }, E) => {
382
- const k = he({
403
+ }, k) => {
404
+ const x = pe({
383
405
  type: W,
384
406
  mode: r,
385
407
  focusMode: a,
386
408
  fullWidth: n,
387
409
  disabled: t,
388
- raw: s,
410
+ raw: d,
389
411
  className: o,
390
- noBorder: p,
391
- size: b,
392
- labelRight: u,
393
- labelLeft: d,
394
- spacing: m,
412
+ noBorder: m,
413
+ size: u,
414
+ labelRight: b,
415
+ labelLeft: s,
416
+ spacing: h,
395
417
  noBackground: y,
396
418
  align: N
397
- }), x = l({
398
- "text-copy-accent-dark": r === "light" && !s,
399
- "text-copy-light": r === "dark" && !s,
400
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
401
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !s
419
+ }), E = l({
420
+ "text-copy-accent-dark": r === "light" && !d,
421
+ "text-copy-light": r === "dark" && !d,
422
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !d,
423
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !d
402
424
  });
403
425
  return /* @__PURE__ */ v(
404
- K,
426
+ F,
405
427
  {
406
- ref: E,
407
- className: k,
428
+ ref: k,
429
+ className: x,
408
430
  disabled: t,
409
431
  type: c,
410
- "aria-label": g || h,
432
+ "aria-label": g || p,
411
433
  ...w,
412
434
  children: [
413
- d && /* @__PURE__ */ i("span", { className: "pr-2", children: d }),
414
- /* @__PURE__ */ i("div", { className: x, children: e }),
415
- u && /* @__PURE__ */ i("span", { className: "pl-2", children: u })
435
+ s && /* @__PURE__ */ i("span", { className: "pr-2", children: s }),
436
+ /* @__PURE__ */ i("div", { className: E, children: e }),
437
+ b && /* @__PURE__ */ i("span", { className: "pl-2", children: b })
416
438
  ]
417
439
  }
418
440
  );
419
441
  }
420
442
  );
421
- pe.displayName = "ButtonIcon";
443
+ be.displayName = "ButtonIcon";
422
444
  /*!
423
445
  @versini/ui-button v1.1.11
424
446
  © 2024 gizmette.com
@@ -432,7 +454,7 @@ try {
432
454
  });
433
455
  } catch {
434
456
  }
435
- const gt = S.forwardRef(
457
+ const ht = C.forwardRef(
436
458
  ({
437
459
  children: e,
438
460
  disabled: t = !1,
@@ -441,40 +463,40 @@ const gt = S.forwardRef(
441
463
  fullWidth: n = !1,
442
464
  className: o,
443
465
  type: c = "button",
444
- raw: s = !1,
445
- noBorder: p = !1,
466
+ raw: d = !1,
467
+ noBorder: m = !1,
446
468
  "aria-label": g,
447
- label: h,
448
- size: b = "medium",
449
- labelRight: u,
450
- labelLeft: d,
451
- spacing: m,
469
+ label: p,
470
+ size: u = "medium",
471
+ labelRight: b,
472
+ labelLeft: s,
473
+ spacing: h,
452
474
  noBackground: y = !1,
453
475
  align: N = "center",
454
476
  active: w = !1,
455
- ...E
456
- }, k) => {
457
- const x = he({
477
+ ...k
478
+ }, x) => {
479
+ const E = pe({
458
480
  type: W,
459
481
  mode: r,
460
482
  focusMode: a,
461
483
  fullWidth: n,
462
484
  disabled: t,
463
- raw: s,
485
+ raw: d,
464
486
  className: o,
465
- noBorder: p,
466
- size: b,
467
- labelRight: u,
468
- labelLeft: d,
469
- spacing: m,
487
+ noBorder: m,
488
+ size: u,
489
+ labelRight: b,
490
+ labelLeft: s,
491
+ spacing: h,
470
492
  noBackground: y,
471
493
  align: N
472
- }), R = l({
473
- "text-copy-accent-dark": r === "light" && !s,
474
- "text-copy-light": r === "dark" && !s,
475
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
476
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !s
477
- }), T = w ? l(
494
+ }), T = l({
495
+ "text-copy-accent-dark": r === "light" && !d,
496
+ "text-copy-light": r === "dark" && !d,
497
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !d,
498
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !d
499
+ }), z = w ? l(
478
500
  "relative",
479
501
  "focus-within:static",
480
502
  "focus-within:after:border-transparent",
@@ -491,26 +513,26 @@ const gt = S.forwardRef(
491
513
  "after:border-table-light dark:after:border-table-dark": r === "alt-system"
492
514
  }
493
515
  ) : "";
494
- return /* @__PURE__ */ i("div", { className: T, children: /* @__PURE__ */ v(
495
- K,
516
+ return /* @__PURE__ */ i("div", { className: z, children: /* @__PURE__ */ v(
517
+ F,
496
518
  {
497
- ref: k,
498
- className: x,
519
+ ref: x,
520
+ className: E,
499
521
  disabled: t,
500
522
  type: c,
501
- "aria-label": g || h,
502
- ...E,
523
+ "aria-label": g || p,
524
+ ...k,
503
525
  children: [
504
- d && /* @__PURE__ */ i("span", { className: "pr-2", children: d }),
505
- /* @__PURE__ */ i("div", { className: R, children: e }),
506
- u && /* @__PURE__ */ i("span", { className: "pl-2", children: u })
526
+ s && /* @__PURE__ */ i("span", { className: "pr-2", children: s }),
527
+ /* @__PURE__ */ i("div", { className: T, children: e }),
528
+ b && /* @__PURE__ */ i("span", { className: "pl-2", children: b })
507
529
  ]
508
530
  }
509
531
  ) });
510
532
  }
511
533
  );
512
- gt.displayName = "ButtonSort";
513
- const ut = (e) => {
534
+ ht.displayName = "ButtonSort";
535
+ const pt = (e) => {
514
536
  let t = "";
515
537
  if (typeof e == "number" || typeof e == "string")
516
538
  t = "m-" + e;
@@ -519,7 +541,7 @@ const ut = (e) => {
519
541
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
520
542
  }
521
543
  return t;
522
- }, be = ({
544
+ }, fe = ({
523
545
  children: e,
524
546
  fill: t,
525
547
  viewBox: r,
@@ -527,30 +549,30 @@ const ut = (e) => {
527
549
  defaultViewBox: n,
528
550
  defaultClassName: o,
529
551
  spacing: c,
530
- title: s,
531
- semantic: p = !1,
552
+ title: d,
553
+ semantic: m = !1,
532
554
  ...g
533
555
  }) => {
534
- const h = ut(c), b = l(
535
- h,
556
+ const p = pt(c), u = l(
557
+ p,
536
558
  a || o
537
559
  );
538
- return /* @__PURE__ */ v($, { children: [
560
+ return /* @__PURE__ */ v(O, { children: [
539
561
  /* @__PURE__ */ i(
540
562
  "svg",
541
563
  {
542
564
  xmlns: "http://www.w3.org/2000/svg",
543
- className: b,
565
+ className: u,
544
566
  viewBox: r || n,
545
567
  fill: t || "currentColor",
546
568
  role: "img",
547
- "aria-hidden": !p,
569
+ "aria-hidden": !m,
548
570
  focusable: !1,
549
571
  ...g,
550
572
  children: e
551
573
  }
552
574
  ),
553
- s && p && /* @__PURE__ */ i("span", { className: "sr-only", children: s })
575
+ d && m && /* @__PURE__ */ i("span", { className: "sr-only", children: d })
554
576
  ] });
555
577
  };
556
578
  /*!
@@ -566,7 +588,7 @@ try {
566
588
  });
567
589
  } catch {
568
590
  }
569
- const mt = ({
591
+ const bt = ({
570
592
  className: e,
571
593
  viewBox: t,
572
594
  spacing: r,
@@ -574,7 +596,7 @@ const mt = ({
574
596
  monotone: n,
575
597
  ...o
576
598
  }) => /* @__PURE__ */ v(
577
- be,
599
+ fe,
578
600
  {
579
601
  defaultViewBox: "0 0 448 512",
580
602
  defaultClassName: "size-5",
@@ -594,7 +616,7 @@ const mt = ({
594
616
  /* @__PURE__ */ i("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
595
617
  ]
596
618
  }
597
- ), ht = ({
619
+ ), ft = ({
598
620
  className: e,
599
621
  viewBox: t,
600
622
  spacing: r,
@@ -602,7 +624,7 @@ const mt = ({
602
624
  monotone: n,
603
625
  ...o
604
626
  }) => /* @__PURE__ */ i(
605
- be,
627
+ fe,
606
628
  {
607
629
  defaultViewBox: "0 0 512 512",
608
630
  defaultClassName: "size-5",
@@ -627,7 +649,7 @@ try {
627
649
  });
628
650
  } catch {
629
651
  }
630
- const pt = (e) => {
652
+ const yt = (e) => {
631
653
  let t = "";
632
654
  if (typeof e == "number" || typeof e == "string")
633
655
  t = "m-" + e;
@@ -636,36 +658,36 @@ const pt = (e) => {
636
658
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
637
659
  }
638
660
  return t;
639
- }, bt = () => "p-4 sm:max-w-md md:max-w-2xl", ft = ({ kind: e }) => l({
661
+ }, vt = () => "p-4 sm:max-w-md md:max-w-2xl", kt = ({ kind: e }) => l({
640
662
  "bg-surface-lighter dark:bg-surface-dark": e === "left",
641
663
  "bg-surface-accent": e === "right"
642
- }), yt = ({ kind: e }) => l(
664
+ }), xt = ({ kind: e }) => l(
643
665
  "prose prose-dark dark:prose-lighter prose-p:my-3 prose-blockquote:my-3 prose-ol:my-3 prose-ul:my-3 prose-ul:prose-li:marker:text-black",
644
666
  {
645
667
  "text-copy-lighter": e === "right"
646
668
  }
647
- ), vt = ({ kind: e }) => l("rounded-b-xl", {
669
+ ), Tt = ({ kind: e }) => l("rounded-b-xl", {
648
670
  "rounded-tr-xl": e === "left",
649
671
  "rounded-tl-xl": e === "right"
650
- }), kt = ({
672
+ }), _t = ({
651
673
  kind: e,
652
674
  className: t,
653
675
  spacing: r
654
676
  }) => {
655
677
  const a = l(
656
678
  t,
657
- et,
679
+ at,
658
680
  "flex items-start",
659
- pt(r),
681
+ yt(r),
660
682
  {
661
683
  "flex-row-reverse": e === "right"
662
684
  }
663
685
  ), n = l(
664
686
  "flex flex-col empty:hidden",
665
- bt(),
666
- yt({ kind: e }),
667
- ft({ kind: e }),
668
- vt({ kind: e })
687
+ vt(),
688
+ xt({ kind: e }),
689
+ kt({ kind: e }),
690
+ Tt({ kind: e })
669
691
  ), o = "pr-2 pt-1 text-end text-xs text-copy-light", c = l("flex flex-col-reverse gap-2 sm:flex-row", {
670
692
  "ml-2": e === "left",
671
693
  "mr-2": e === "right"
@@ -676,7 +698,7 @@ const pt = (e) => {
676
698
  footer: o,
677
699
  copyButton: c
678
700
  };
679
- }, xt = ({
701
+ }, Nt = ({
680
702
  children: e,
681
703
  kind: t = "left",
682
704
  className: r,
@@ -684,45 +706,45 @@ const pt = (e) => {
684
706
  rawFooter: n,
685
707
  copyToClipboard: o,
686
708
  copyToClipboardFocusMode: c = "system",
687
- copyToClipboardMode: s = "system",
688
- spacing: p
709
+ copyToClipboardMode: d = "system",
710
+ spacing: m
689
711
  }) => {
690
- const [g, h] = M(!1), b = kt({ kind: t, className: r, spacing: p }), u = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), d = () => {
691
- h(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
712
+ const [g, p] = A(!1), u = _t({ kind: t, className: r, spacing: m }), b = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), s = () => {
713
+ p(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
692
714
  };
693
715
  return _(() => {
694
- let m;
695
- return g && (m = window.setTimeout(() => {
696
- h(!1);
716
+ let h;
717
+ return g && (h = window.setTimeout(() => {
718
+ p(!1);
697
719
  }, 3e3)), () => {
698
- clearTimeout(m);
720
+ clearTimeout(h);
699
721
  };
700
- }, [g]), /* @__PURE__ */ v("div", { className: b.wrapper, children: [
722
+ }, [g]), /* @__PURE__ */ v("div", { className: u.wrapper, children: [
701
723
  /* @__PURE__ */ v("div", { children: [
702
- /* @__PURE__ */ i("div", { className: b.main, children: e }),
703
- a && Object.keys(a).map((m) => a[m] ? /* @__PURE__ */ i("div", { className: "prose-p:m-0", children: /* @__PURE__ */ v("p", { className: b.footer, children: [
704
- m,
724
+ /* @__PURE__ */ i("div", { className: u.main, children: e }),
725
+ a && Object.keys(a).map((h) => a[h] ? /* @__PURE__ */ i("div", { className: "prose-p:m-0", children: /* @__PURE__ */ v("p", { className: u.footer, children: [
726
+ h,
705
727
  ": ",
706
- a[m]
707
- ] }) }, `-${m}`) : null),
728
+ a[h]
729
+ ] }) }, `-${h}`) : null),
708
730
  n && n
709
731
  ] }),
710
- u && /* @__PURE__ */ i("div", { className: b.copyButton, children: /* @__PURE__ */ i(
711
- pe,
732
+ b && /* @__PURE__ */ i("div", { className: u.copyButton, children: /* @__PURE__ */ i(
733
+ be,
712
734
  {
713
735
  noBorder: !0,
714
736
  noBackground: !0,
715
737
  size: "small",
716
- mode: s,
738
+ mode: d,
717
739
  focusMode: c,
718
740
  label: g ? "Copied to clipboard" : "Copy to clipboard",
719
- onClick: d,
741
+ onClick: s,
720
742
  disabled: g,
721
- children: g ? /* @__PURE__ */ i(mt, { className: "size-3" }) : /* @__PURE__ */ i(ht, { className: "size-3" })
743
+ children: g ? /* @__PURE__ */ i(bt, { className: "size-3" }) : /* @__PURE__ */ i(ft, { className: "size-3" })
722
744
  }
723
745
  ) })
724
746
  ] });
725
- }, te = "av-button", Tt = (e) => {
747
+ }, te = "av-button", wt = (e) => {
726
748
  let t = "";
727
749
  if (typeof e == "number" || typeof e == "string")
728
750
  t = "m-" + e;
@@ -731,28 +753,28 @@ const pt = (e) => {
731
753
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
732
754
  }
733
755
  return t;
734
- }, fe = "icon", ye = "button", _t = "link", Nt = ({
756
+ }, ye = "icon", ve = "button", Et = "link", It = ({
735
757
  type: e,
736
758
  size: t,
737
759
  labelRight: r,
738
760
  labelLeft: a,
739
761
  align: n
740
762
  }) => {
741
- const o = "text-sm font-medium max-h-8 py-0", c = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
763
+ const o = "text-sm font-medium max-h-8 py-0", c = "text-base font-medium max-h-9 py-1", d = "text-lg font-medium max-h-12 py-2";
742
764
  switch (e) {
743
- case ye:
765
+ case ve:
744
766
  return l("px-4", {
745
767
  [o]: t === "small",
746
768
  [c]: t === "medium",
747
- [s]: t === "large"
769
+ [d]: t === "large"
748
770
  });
749
- case _t:
771
+ case Et:
750
772
  return l("px-4 text-center", {
751
773
  [o]: t === "small",
752
774
  [c]: t === "medium",
753
- [s]: t === "large"
775
+ [d]: t === "large"
754
776
  });
755
- case fe:
777
+ case ye:
756
778
  return l("inline-flex items-center", {
757
779
  "justify-center": n === "center",
758
780
  "justify-start": n === "left",
@@ -765,7 +787,7 @@ const pt = (e) => {
765
787
  "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
766
788
  });
767
789
  }
768
- }, wt = ({
790
+ }, Ct = ({
769
791
  mode: e,
770
792
  noBackground: t,
771
793
  noTruncate: r,
@@ -797,7 +819,7 @@ const pt = (e) => {
797
819
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
798
820
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
799
821
  });
800
- }, Et = ({
822
+ }, St = ({
801
823
  mode: e,
802
824
  disabled: t,
803
825
  variant: r
@@ -825,7 +847,7 @@ const pt = (e) => {
825
847
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
826
848
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
827
849
  });
828
- }, Ct = ({
850
+ }, Rt = ({
829
851
  mode: e,
830
852
  disabled: t,
831
853
  variant: r
@@ -853,7 +875,7 @@ const pt = (e) => {
853
875
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
854
876
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
855
877
  });
856
- }, It = ({
878
+ }, Bt = ({
857
879
  mode: e,
858
880
  noBorder: t,
859
881
  variant: r
@@ -881,12 +903,12 @@ const pt = (e) => {
881
903
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
882
904
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
883
905
  });
884
- }, St = ({ focusMode: e }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
906
+ }, At = ({ focusMode: e }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
885
907
  "focus:outline-focus-dark": e === "dark",
886
908
  "focus:outline-focus-light": e === "light",
887
909
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
888
910
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
889
- }), ve = ({
911
+ }), ke = ({
890
912
  type: e,
891
913
  className: t,
892
914
  raw: r,
@@ -894,47 +916,47 @@ const pt = (e) => {
894
916
  focusMode: n,
895
917
  disabled: o,
896
918
  fullWidth: c,
897
- size: s,
898
- noBorder: p,
919
+ size: d,
920
+ noBorder: m,
899
921
  labelRight: g,
900
- labelLeft: h,
901
- spacing: b,
902
- noBackground: u,
903
- variant: d,
904
- noTruncate: m,
922
+ labelLeft: p,
923
+ spacing: u,
924
+ noBackground: b,
925
+ variant: s,
926
+ noTruncate: h,
905
927
  align: y
906
- }) => (d || (d = "primary"), r ? l(te, t) : l(
928
+ }) => (s || (s = "primary"), r ? l(te, t) : l(
907
929
  te,
908
930
  t,
909
- Tt(b),
910
- wt({ mode: a, variant: d, noBackground: u, noTruncate: m }),
911
- Nt({ type: e, size: s, labelRight: g, labelLeft: h, align: y }),
912
- It({ mode: a, variant: d, noBorder: p }),
913
- St({ focusMode: n }),
914
- Et({ mode: a, variant: d, disabled: o }),
915
- Ct({ mode: a, variant: d, disabled: o }),
931
+ wt(u),
932
+ Ct({ mode: a, variant: s, noBackground: b, noTruncate: h }),
933
+ It({ type: e, size: d, labelRight: g, labelLeft: p, align: y }),
934
+ Bt({ mode: a, variant: s, noBorder: m }),
935
+ At({ focusMode: n }),
936
+ St({ mode: a, variant: s, disabled: o }),
937
+ Rt({ mode: a, variant: s, disabled: o }),
916
938
  {
917
939
  "w-full": c,
918
940
  "disabled:cursor-not-allowed disabled:opacity-50": o
919
941
  }
920
- )), Rt = (e, t, r) => {
942
+ )), Mt = (e, t, r) => {
921
943
  var a;
922
944
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
923
- }, Y = S.forwardRef((e, t) => {
945
+ }, K = C.forwardRef((e, t) => {
924
946
  const { onClick: r, noInternalClick: a = !1, ...n } = e;
925
947
  return /* @__PURE__ */ i(
926
948
  "button",
927
949
  {
928
950
  ref: t,
929
951
  onClick: (o) => {
930
- Rt(o, a, r);
952
+ Mt(o, a, r);
931
953
  },
932
954
  ...n
933
955
  }
934
956
  );
935
957
  });
936
- Y.displayName = "BaseButton";
937
- const ke = S.forwardRef(
958
+ K.displayName = "BaseButton";
959
+ const xe = C.forwardRef(
938
960
  ({
939
961
  children: e,
940
962
  disabled: t = !1,
@@ -943,40 +965,40 @@ const ke = S.forwardRef(
943
965
  fullWidth: n = !1,
944
966
  className: o,
945
967
  size: c = "medium",
946
- raw: s = !1,
947
- noBorder: p = !1,
968
+ raw: d = !1,
969
+ noBorder: m = !1,
948
970
  spacing: g,
949
- variant: h = "primary",
950
- noTruncate: b = !1,
951
- ...u
952
- }, d) => {
953
- const m = ve({
954
- type: ye,
971
+ variant: p = "primary",
972
+ noTruncate: u = !1,
973
+ ...b
974
+ }, s) => {
975
+ const h = ke({
976
+ type: ve,
955
977
  mode: r,
956
978
  focusMode: a,
957
979
  fullWidth: n,
958
980
  disabled: t,
959
- raw: s,
981
+ raw: d,
960
982
  className: o,
961
983
  size: c,
962
- noBorder: p,
984
+ noBorder: m,
963
985
  spacing: g,
964
- variant: h,
965
- noTruncate: b
986
+ variant: p,
987
+ noTruncate: u
966
988
  });
967
989
  return /* @__PURE__ */ i(
968
- Y,
990
+ K,
969
991
  {
970
- ref: d,
971
- className: m,
992
+ ref: s,
993
+ className: h,
972
994
  disabled: t,
973
- ...u,
995
+ ...b,
974
996
  children: e
975
997
  }
976
998
  );
977
999
  }
978
1000
  );
979
- ke.displayName = "Button";
1001
+ xe.displayName = "Button";
980
1002
  /*!
981
1003
  @versini/ui-button v1.1.11
982
1004
  © 2024 gizmette.com
@@ -990,7 +1012,7 @@ try {
990
1012
  });
991
1013
  } catch {
992
1014
  }
993
- const Bt = S.forwardRef(
1015
+ const Lt = C.forwardRef(
994
1016
  ({
995
1017
  children: e,
996
1018
  disabled: t = !1,
@@ -999,40 +1021,40 @@ const Bt = S.forwardRef(
999
1021
  fullWidth: n = !1,
1000
1022
  className: o,
1001
1023
  type: c = "button",
1002
- raw: s = !1,
1003
- noBorder: p = !1,
1024
+ raw: d = !1,
1025
+ noBorder: m = !1,
1004
1026
  "aria-label": g,
1005
- label: h,
1006
- size: b = "medium",
1007
- labelRight: u,
1008
- labelLeft: d,
1009
- spacing: m,
1027
+ label: p,
1028
+ size: u = "medium",
1029
+ labelRight: b,
1030
+ labelLeft: s,
1031
+ spacing: h,
1010
1032
  noBackground: y = !1,
1011
1033
  align: N = "center",
1012
1034
  active: w = !1,
1013
- ...E
1014
- }, k) => {
1015
- const x = ve({
1016
- type: fe,
1035
+ ...k
1036
+ }, x) => {
1037
+ const E = ke({
1038
+ type: ye,
1017
1039
  mode: r,
1018
1040
  focusMode: a,
1019
1041
  fullWidth: n,
1020
1042
  disabled: t,
1021
- raw: s,
1043
+ raw: d,
1022
1044
  className: o,
1023
- noBorder: p,
1024
- size: b,
1025
- labelRight: u,
1026
- labelLeft: d,
1027
- spacing: m,
1045
+ noBorder: m,
1046
+ size: u,
1047
+ labelRight: b,
1048
+ labelLeft: s,
1049
+ spacing: h,
1028
1050
  noBackground: y,
1029
1051
  align: N
1030
- }), R = l({
1031
- "text-copy-accent-dark": r === "light" && !s,
1032
- "text-copy-light": r === "dark" && !s,
1033
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
1034
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !s
1035
- }), T = w ? l(
1052
+ }), T = l({
1053
+ "text-copy-accent-dark": r === "light" && !d,
1054
+ "text-copy-light": r === "dark" && !d,
1055
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !d,
1056
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !d
1057
+ }), z = w ? l(
1036
1058
  "relative",
1037
1059
  "focus-within:static",
1038
1060
  "focus-within:after:border-transparent",
@@ -1049,28 +1071,28 @@ const Bt = S.forwardRef(
1049
1071
  "after:border-table-light dark:after:border-table-dark": r === "alt-system"
1050
1072
  }
1051
1073
  ) : "";
1052
- return /* @__PURE__ */ i("div", { className: T, children: /* @__PURE__ */ v(
1053
- Y,
1074
+ return /* @__PURE__ */ i("div", { className: z, children: /* @__PURE__ */ v(
1075
+ K,
1054
1076
  {
1055
- ref: k,
1056
- className: x,
1077
+ ref: x,
1078
+ className: E,
1057
1079
  disabled: t,
1058
1080
  type: c,
1059
- "aria-label": g || h,
1060
- ...E,
1081
+ "aria-label": g || p,
1082
+ ...k,
1061
1083
  children: [
1062
- d && /* @__PURE__ */ i("span", { className: "pr-2", children: d }),
1063
- /* @__PURE__ */ i("div", { className: R, children: e }),
1064
- u && /* @__PURE__ */ i("span", { className: "pl-2", children: u })
1084
+ s && /* @__PURE__ */ i("span", { className: "pr-2", children: s }),
1085
+ /* @__PURE__ */ i("div", { className: T, children: e }),
1086
+ b && /* @__PURE__ */ i("span", { className: "pl-2", children: b })
1065
1087
  ]
1066
1088
  }
1067
1089
  ) });
1068
1090
  }
1069
1091
  );
1070
- Bt.displayName = "ButtonSort";
1071
- const At = 200, Mt = ({
1092
+ Lt.displayName = "ButtonSort";
1093
+ const Ot = 200, $t = ({
1072
1094
  string: e,
1073
- idealLength: t = At
1095
+ idealLength: t = Ot
1074
1096
  }) => {
1075
1097
  if (e.length <= t)
1076
1098
  return { string: e, isTruncated: !1 };
@@ -1081,30 +1103,30 @@ const At = 200, Mt = ({
1081
1103
  string: e.slice(0, t + r),
1082
1104
  isTruncated: !0
1083
1105
  };
1084
- }, Lt = ({
1106
+ }, Ut = ({
1085
1107
  children: e,
1086
1108
  length: t = 200,
1087
1109
  mode: r = "system",
1088
1110
  focusMode: a = "system"
1089
1111
  }) => {
1090
- const [n, o] = M(!1);
1112
+ const [n, o] = A(!1);
1091
1113
  if (typeof e != "string")
1092
1114
  return e;
1093
- const { string: c, isTruncated: s } = Mt({
1115
+ const { string: c, isTruncated: d } = $t({
1094
1116
  string: e,
1095
1117
  idealLength: t
1096
1118
  });
1097
1119
  return /* @__PURE__ */ v("span", { children: [
1098
1120
  n ? e : c,
1099
- s && /* @__PURE__ */ i(
1100
- ke,
1121
+ d && /* @__PURE__ */ i(
1122
+ xe,
1101
1123
  {
1102
1124
  mode: r,
1103
1125
  focusMode: a,
1104
1126
  spacing: { l: 2 },
1105
1127
  size: "small",
1106
- onClick: (p) => {
1107
- p.preventDefault(), o(!n);
1128
+ onClick: (m) => {
1129
+ m.preventDefault(), o(!n);
1108
1130
  },
1109
1131
  children: n ? "less..." : "more..."
1110
1132
  }
@@ -1124,17 +1146,17 @@ try {
1124
1146
  });
1125
1147
  } catch {
1126
1148
  }
1127
- const re = Pe(
1149
+ const re = Fe(
1128
1150
  () => import(
1129
1151
  /* webpackChunkName: "LazyMessageAssistant" */
1130
- "./LazyMessageAssistant.Bq--JTre.js"
1152
+ "./LazyMessageAssistant.KzZAMNJh.js"
1131
1153
  ).then((e) => e.LazyMessageAssistant)
1132
- ), Ot = () => {
1133
- const { state: e } = A(U);
1134
- return /* @__PURE__ */ v($, { children: [
1154
+ ), zt = () => {
1155
+ const { state: e } = R($);
1156
+ return /* @__PURE__ */ v(O, { children: [
1135
1157
  e && e.messages.length > 0 && e.messages.map((t, r) => {
1136
1158
  const { role: a, content: n, name: o, processingTime: c } = t.message;
1137
- return (a === C || a === P) && n ? /* @__PURE__ */ i(X, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(
1159
+ return (a === I || a === G) && n ? /* @__PURE__ */ i(Q, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(
1138
1160
  re,
1139
1161
  {
1140
1162
  name: o,
@@ -1142,117 +1164,117 @@ const re = Pe(
1142
1164
  children: n
1143
1165
  }
1144
1166
  ) }, `${r}-${a}`) : a === H && n ? /* @__PURE__ */ i(
1145
- xt,
1167
+ Nt,
1146
1168
  {
1147
1169
  kind: "right",
1148
1170
  copyToClipboard: n,
1149
1171
  copyToClipboardFocusMode: "light",
1150
- children: /* @__PURE__ */ i(Lt, { mode: "light", focusMode: "light", children: n })
1172
+ children: /* @__PURE__ */ i(Ut, { mode: "light", focusMode: "light", children: n })
1151
1173
  },
1152
1174
  `${r}-${a}`
1153
1175
  ) : null;
1154
1176
  }),
1155
- ne(H, e) && /* @__PURE__ */ i(X, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(re, { loading: !0 }) })
1177
+ ie(H, e) && /* @__PURE__ */ i(Q, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(re, { loading: !0 }) })
1156
1178
  ] });
1157
- }, O = (e, t) => {
1179
+ }, L = (e, t) => {
1158
1180
  e({
1159
- type: ce,
1181
+ type: ge,
1160
1182
  payload: {
1161
1183
  streaming: t
1162
1184
  }
1163
1185
  });
1164
1186
  }, ae = (e) => {
1165
- O(e, !1), e({
1166
- type: B,
1187
+ L(e, !1), e({
1188
+ type: S,
1167
1189
  payload: {
1168
1190
  message: {
1169
- role: P,
1170
- content: Re
1191
+ role: G,
1192
+ content: Be
1171
1193
  }
1172
1194
  }
1173
1195
  });
1174
- }, $t = () => {
1175
- const { state: e, dispatch: t } = A(U), { state: r, dispatch: a } = A(G), [n, o] = M(""), { getAccessToken: c, user: s } = V(), p = I(!1), g = I(null), h = I(
1196
+ }, Vt = () => {
1197
+ const { state: e, dispatch: t } = R($), { state: r, dispatch: a } = R(j), [n, o] = A(""), { getAccessToken: c, user: d } = U(), m = B(null), g = B(
1176
1198
  null
1177
1199
  );
1178
1200
  _(() => {
1179
1201
  (async () => {
1180
- var d;
1202
+ var b;
1181
1203
  if (!e || e.messages.length === 0) {
1182
- (d = h == null ? void 0 : h.current) == null || d.cancel();
1204
+ (b = g == null ? void 0 : g.current) == null || b.cancel();
1183
1205
  return;
1184
1206
  }
1185
1207
  const u = e.messages[e.messages.length - 1];
1186
- if (!(e.messages.length === 0 || u.message.role === C || u.message.role === Ee || u.message.role === P || u.message.role === Ce))
1208
+ if (!(e.messages.length === 0 || u.message.role === I || u.message.role === Ie || u.message.role === G || u.message.role === Ce))
1187
1209
  try {
1188
- const m = await je({
1210
+ const s = await Ge({
1189
1211
  accessToken: await c(),
1190
1212
  name: "generate",
1191
1213
  data: {
1192
1214
  messages: e.messages,
1193
- model: e.engine || L,
1194
- user: (s == null ? void 0 : s.username) || "",
1215
+ model: e.engine || M,
1216
+ user: (d == null ? void 0 : d.username) || "",
1195
1217
  id: e.id,
1196
1218
  usage: e.usage
1197
1219
  }
1198
1220
  });
1199
- if (m && m.ok) {
1200
- const y = F();
1201
- h.current = m.body.getReader();
1202
- const N = new TextDecoder();
1221
+ if (s && s.ok) {
1222
+ const h = P();
1223
+ g.current = s.body.getReader();
1224
+ const y = new TextDecoder();
1203
1225
  for (; ; ) {
1204
- O(t, !0);
1205
- const { done: w, value: E } = await h.current.read();
1206
- if (w) {
1207
- O(t, !1);
1226
+ L(t, !0);
1227
+ const { done: N, value: w } = await g.current.read();
1228
+ if (N) {
1229
+ L(t, !1);
1208
1230
  break;
1209
1231
  }
1210
- const k = N.decode(E, { stream: !0 }), x = k.indexOf(q);
1232
+ const k = y.decode(w, { stream: !0 }), x = k.indexOf(q);
1211
1233
  if (x !== -1) {
1212
- const R = k.substring(0, x), T = JSON.parse(
1234
+ const E = k.substring(0, x), T = JSON.parse(
1213
1235
  k.substring(x + q.length)
1214
1236
  );
1215
1237
  t({
1216
- type: de,
1238
+ type: le,
1217
1239
  payload: {
1218
1240
  model: T.model,
1219
1241
  usage: T.usage
1220
1242
  }
1221
1243
  }), t({
1222
- type: B,
1244
+ type: S,
1223
1245
  payload: {
1224
1246
  message: {
1225
- content: R,
1226
- role: C,
1227
- messageId: y,
1247
+ content: E,
1248
+ role: I,
1249
+ messageId: h,
1228
1250
  processingTime: T.processingTime,
1229
1251
  name: T.name
1230
1252
  }
1231
1253
  }
1232
- }), O(t, !1);
1254
+ }), L(t, !1);
1233
1255
  break;
1234
1256
  } else
1235
1257
  t({
1236
- type: B,
1258
+ type: S,
1237
1259
  payload: {
1238
1260
  message: {
1239
1261
  content: k,
1240
- role: C,
1241
- messageId: y
1262
+ role: I,
1263
+ messageId: h
1242
1264
  }
1243
1265
  }
1244
1266
  });
1245
1267
  }
1246
1268
  } else
1247
1269
  ae(t);
1248
- } catch (m) {
1249
- console.error(m), ae(t);
1270
+ } catch (s) {
1271
+ console.error(s), ae(t);
1250
1272
  }
1251
1273
  })();
1252
1274
  }, [e == null ? void 0 : e.messages]);
1253
- const b = async (u) => {
1275
+ const p = async (u) => {
1254
1276
  u.preventDefault(), t({
1255
- type: B,
1277
+ type: S,
1256
1278
  payload: {
1257
1279
  message: {
1258
1280
  role: H,
@@ -1262,67 +1284,67 @@ const re = Pe(
1262
1284
  }), o("");
1263
1285
  };
1264
1286
  return _(() => {
1265
- (e == null ? void 0 : e.streaming) === !1 && !p.current && g.current && (p.current = !0, g.current.focus()), (e == null ? void 0 : e.streaming) === !0 && p.current === !0 && (p.current = !1);
1266
- }, [e]), _(() => {
1267
- r.tag !== "" && (o(r.tag), g.current && g.current.focus(), a({
1268
- type: le
1287
+ r.tag !== "" && (o(r.tag), m.current && m.current.focus(), a({
1288
+ type: ce
1269
1289
  }));
1270
- }, [r, a]), /* @__PURE__ */ i("form", { className: "mt-2", onSubmit: b, children: /* @__PURE__ */ i(
1271
- He,
1290
+ }, [r, a]), _(() => {
1291
+ e && e.usage === 0 && e.messages.length === 0 && m.current && m.current.focus();
1292
+ }, [e]), /* @__PURE__ */ i("form", { className: "mt-2", onSubmit: p, children: /* @__PURE__ */ i(
1293
+ Pe,
1272
1294
  {
1273
1295
  mode: "dark",
1274
1296
  focusMode: "light",
1275
- ref: g,
1297
+ ref: m,
1276
1298
  name: "chat-input",
1277
- label: Ie,
1299
+ label: Se,
1278
1300
  helperText: "Press ENTER to add a new line",
1279
1301
  helperTextOnFocus: !0,
1280
1302
  required: !0,
1281
1303
  value: n,
1282
1304
  onChange: (u) => o(u.target.value),
1283
- onKeyDown: Ye([["mod+Enter", b]]),
1305
+ onKeyDown: Je([["mod+Enter", p]]),
1284
1306
  rightElement: /* @__PURE__ */ i(
1285
- j,
1307
+ ne,
1286
1308
  {
1287
1309
  disabled: e == null ? void 0 : e.streaming,
1288
1310
  noBorder: !0,
1289
1311
  type: "submit",
1290
1312
  mode: "light",
1291
1313
  focusMode: "light",
1292
- children: Se
1314
+ children: Re
1293
1315
  }
1294
1316
  )
1295
1317
  }
1296
1318
  ) });
1297
- }, Ut = () => {
1298
- const { isAuthenticated: e } = V(), t = Be(e);
1299
- return /* @__PURE__ */ v($, { children: [
1319
+ }, Dt = () => {
1320
+ const { isAuthenticated: e } = U(), t = Ae(e);
1321
+ return /* @__PURE__ */ v(O, { children: [
1300
1322
  /* @__PURE__ */ v("div", { className: t, children: [
1301
- /* @__PURE__ */ i(Ae, {}),
1302
- /* @__PURE__ */ i(Ot, {})
1323
+ /* @__PURE__ */ i(Me, {}),
1324
+ /* @__PURE__ */ i(zt, {})
1303
1325
  ] }),
1304
- /* @__PURE__ */ i(Ze, {}),
1305
- /* @__PURE__ */ i($t, {})
1326
+ /* @__PURE__ */ i(rt, {}),
1327
+ /* @__PURE__ */ i(Vt, {})
1306
1328
  ] });
1307
- }, Vt = (e, t) => (t == null ? void 0 : t.type) === se ? {
1329
+ }, Ht = (e, t) => (t == null ? void 0 : t.type) === de ? {
1308
1330
  tags: e.tags,
1309
1331
  tag: t.payload.tag
1310
- } : (t == null ? void 0 : t.type) === le ? {
1332
+ } : (t == null ? void 0 : t.type) === ce ? {
1311
1333
  tags: e.tags,
1312
1334
  tag: ""
1313
1335
  } : (t == null ? void 0 : t.type) === oe ? {
1314
1336
  tags: t.payload.tags,
1315
1337
  tag: ""
1316
- } : e, zt = (e, t) => (t == null ? void 0 : t.type) === Me ? {
1338
+ } : e, jt = (e, t) => (t == null ? void 0 : t.type) === Le ? {
1317
1339
  searchString: t.payload.searchString,
1318
1340
  sortedCell: e.sortedCell,
1319
1341
  sortDirection: e.sortDirection
1320
- } : (t == null ? void 0 : t.type) === Le ? {
1342
+ } : (t == null ? void 0 : t.type) === Oe ? {
1321
1343
  searchString: e.searchString,
1322
1344
  sortedCell: t.payload.sortedCell,
1323
1345
  sortDirection: t.payload.sortDirection
1324
- } : e, Dt = (e, t) => {
1325
- if ((t == null ? void 0 : t.type) === Oe) {
1346
+ } : e, Gt = (e, t) => {
1347
+ if ((t == null ? void 0 : t.type) === $e) {
1326
1348
  const r = t.payload.messages.map((a) => ({
1327
1349
  message: {
1328
1350
  role: a.role,
@@ -1341,29 +1363,29 @@ const re = Pe(
1341
1363
  tags: e.tags
1342
1364
  };
1343
1365
  }
1344
- if ((t == null ? void 0 : t.type) === B) {
1366
+ if ((t == null ? void 0 : t.type) === S) {
1345
1367
  const r = t.payload.message.role, a = t.payload.message.content, n = t.payload.message.name, o = t.payload.message.processingTime, c = t.payload.message.messageId;
1346
1368
  if (r !== "") {
1347
- const s = {
1369
+ const d = {
1348
1370
  role: r,
1349
1371
  content: a,
1350
1372
  name: n,
1351
1373
  processingTime: o,
1352
1374
  messageId: c
1353
1375
  };
1354
- if (r === C) {
1355
- const p = e.messages.findIndex(
1376
+ if (r === I) {
1377
+ const m = e.messages.findIndex(
1356
1378
  (g) => g.message.messageId === c
1357
1379
  );
1358
- if (p !== -1) {
1359
- const g = e.messages.map((h, b) => b === p ? {
1380
+ if (m !== -1) {
1381
+ const g = e.messages.map((p, u) => u === m ? {
1360
1382
  message: {
1361
- ...h.message,
1362
- content: `${h.message.content}${a}`,
1383
+ ...p.message,
1384
+ content: `${p.message.content}${a}`,
1363
1385
  processingTime: o,
1364
1386
  name: n
1365
1387
  }
1366
- } : h);
1388
+ } : p);
1367
1389
  return {
1368
1390
  id: e.id,
1369
1391
  model: e.model,
@@ -1385,21 +1407,21 @@ const re = Pe(
1385
1407
  messages: [
1386
1408
  ...e.messages,
1387
1409
  {
1388
- message: s
1410
+ message: d
1389
1411
  }
1390
1412
  ]
1391
1413
  };
1392
1414
  }
1393
1415
  }
1394
- return (t == null ? void 0 : t.type) === ie ? {
1395
- id: F(),
1416
+ return (t == null ? void 0 : t.type) === se ? {
1417
+ id: P(),
1396
1418
  model: e.model,
1397
1419
  engine: e.engine,
1398
1420
  usage: 0,
1399
1421
  messages: [],
1400
1422
  isComponent: e.isComponent,
1401
1423
  tags: e.tags
1402
- } : (t == null ? void 0 : t.type) === de ? {
1424
+ } : (t == null ? void 0 : t.type) === le ? {
1403
1425
  id: e.id,
1404
1426
  model: t.payload.model,
1405
1427
  engine: e.engine,
@@ -1407,91 +1429,91 @@ const re = Pe(
1407
1429
  usage: t.payload.usage,
1408
1430
  messages: e.messages,
1409
1431
  isComponent: e.isComponent
1410
- } : (t == null ? void 0 : t.type) === ge ? {
1432
+ } : (t == null ? void 0 : t.type) === ue ? {
1411
1433
  ...e,
1412
1434
  engine: t.payload.engine
1413
- } : (t == null ? void 0 : t.type) === ce ? {
1435
+ } : (t == null ? void 0 : t.type) === ge ? {
1414
1436
  ...e,
1415
1437
  streaming: t.payload.streaming
1416
1438
  } : e;
1417
1439
  };
1418
- function xe({ isComponent: e = !1 }) {
1419
- const t = I(!1), { getAccessToken: r, user: a } = V(), [n] = Q({
1420
- key: J + ze,
1440
+ function Te({ isComponent: e = !1 }) {
1441
+ const t = B(!1), { getAccessToken: r, user: a } = U(), [n] = J({
1442
+ key: X + De,
1421
1443
  initialValue: ""
1422
- }), [o] = Q({
1423
- key: J + De,
1424
- initialValue: Ge.ASC
1425
- }), [c, s] = z(Dt, {
1426
- id: F(),
1427
- model: L,
1428
- engine: L,
1444
+ }), [o] = J({
1445
+ key: X + He,
1446
+ initialValue: We.ASC
1447
+ }), [c, d] = V(Gt, {
1448
+ id: P(),
1449
+ model: M,
1450
+ engine: M,
1429
1451
  usage: 0,
1430
1452
  messages: [],
1431
1453
  tags: [],
1432
1454
  isComponent: e
1433
- }), [p, g] = z(zt, {
1455
+ }), [m, g] = V(jt, {
1434
1456
  searchString: n,
1435
1457
  sortedCell: "timestamp",
1436
1458
  sortDirection: o
1437
- }), [h, b] = z(Vt, {
1459
+ }), [p, u] = V(Ht, {
1438
1460
  tag: ""
1439
- }), [u, d] = M({
1461
+ }), [b, s] = A({
1440
1462
  version: "",
1441
1463
  models: [],
1442
1464
  plugins: [],
1443
- engine: L,
1465
+ engine: M,
1444
1466
  engines: []
1445
1467
  });
1446
1468
  return _(() => {
1447
- u.version !== "" || t.current || (async () => {
1469
+ b.version !== "" || t.current || (async () => {
1448
1470
  try {
1449
1471
  t.current = !0;
1450
- const m = await ue({
1472
+ const h = await me({
1451
1473
  accessToken: await r(),
1452
- type: me.ABOUT,
1474
+ type: he.ABOUT,
1453
1475
  params: {
1454
1476
  user: a == null ? void 0 : a.username
1455
1477
  }
1456
1478
  });
1457
- t.current = !1, m.status === 200 && (d(m.data), s({
1458
- type: ge,
1479
+ t.current = !1, h.status === 200 && (s(h.data), d({
1480
+ type: ue,
1459
1481
  payload: {
1460
- engine: m.data.engine
1482
+ engine: h.data.engine
1461
1483
  }
1462
1484
  }));
1463
1485
  } catch {
1464
1486
  }
1465
1487
  })();
1466
- }, [u, r, a]), _(() => {
1467
- var m;
1468
- (m = document.getElementById("logo")) == null || m.classList.add("fadeOut"), setTimeout(() => {
1488
+ }, [b, r, a]), _(() => {
1489
+ var h;
1490
+ (h = document.getElementById("logo")) == null || h.classList.add("fadeOut"), setTimeout(() => {
1469
1491
  var y;
1470
1492
  (y = document.getElementById("root")) == null || y.classList.replace("app-hidden", "fadeIn");
1471
1493
  }, 500);
1472
- }), /* @__PURE__ */ i(U.Provider, { value: { state: c, dispatch: s, serverStats: u }, children: /* @__PURE__ */ i(
1473
- $e.Provider,
1494
+ }), /* @__PURE__ */ i($.Provider, { value: { state: c, dispatch: d, serverStats: b }, children: /* @__PURE__ */ i(
1495
+ Ue.Provider,
1474
1496
  {
1475
1497
  value: {
1476
- state: p,
1498
+ state: m,
1477
1499
  dispatch: g
1478
1500
  },
1479
1501
  children: /* @__PURE__ */ v(
1480
- G.Provider,
1502
+ j.Provider,
1481
1503
  {
1482
- value: { state: h, dispatch: b },
1504
+ value: { state: p, dispatch: u },
1483
1505
  children: [
1484
- /* @__PURE__ */ i(Ue, { children: /* @__PURE__ */ i(Ut, {}) }),
1485
- /* @__PURE__ */ i(Ve, { serverStats: u })
1506
+ /* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(Dt, {}) }),
1507
+ /* @__PURE__ */ i(Ve, { serverStats: b })
1486
1508
  ]
1487
1509
  }
1488
1510
  )
1489
1511
  }
1490
1512
  ) });
1491
1513
  }
1492
- xe.displayName = "App";
1493
- const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: xe }, Symbol.toStringTag, { value: "Module" }));
1514
+ Te.displayName = "App";
1515
+ const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Te }, Symbol.toStringTag, { value: "Module" }));
1494
1516
  export {
1495
- Wt as App,
1496
- xt as le
1517
+ qt as App,
1518
+ Nt as le
1497
1519
  };