@versini/sassysaint 5.5.2 → 5.5.4

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