@cuadra-ai/uikit 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SimpleThread.d.ts.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +139 -136
- package/dist/index.mjs.map +1 -1
- package/dist/uikit.css +1 -1
- package/dist/widget/cuadra-uikit.css +1 -1
- package/dist/widget/cuadra-uikit.umd.js +15 -15
- package/dist/widget/cuadra-uikit.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Ut = Object.defineProperty;
|
|
2
2
|
var Bt = (e, r, t) => r in e ? Ut(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
3
|
var le = (e, r, t) => Bt(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
-
import { jsx as d,
|
|
5
|
-
import $e, { forwardRef as rt, createElement as Ne, useMemo as
|
|
4
|
+
import { jsx as d, jsxs as T, Fragment as W } from "react/jsx-runtime";
|
|
5
|
+
import $e, { forwardRef as rt, createElement as Ne, useMemo as U, useState as N, useEffect as L, useCallback as J, memo as Wt, useRef as nt, createContext as Ht } from "react";
|
|
6
6
|
import { createPortal as Oe } from "react-dom";
|
|
7
7
|
import { useThreadListItem as at, RuntimeAdapterProvider as qt, useLocalRuntime as it, AssistantRuntimeProvider as ot, unstable_useRemoteThreadListRuntime as Kt, useThreadRuntime as Vt, ThreadPrimitive as te, ComposerPrimitive as ke, useAssistantApi as Gt, MessagePrimitive as se, ThreadListPrimitive as xe, useThread as Zt, ThreadListItemPrimitive as we } from "@assistant-ui/react";
|
|
8
8
|
import { unstable_memoizeMarkdownComponents as Jt, useIsMarkdownCodeBlock as Qt, MarkdownTextPrimitive as Xt } from "@assistant-ui/react-markdown";
|
|
@@ -533,10 +533,10 @@ function Ar({
|
|
|
533
533
|
onThreadIdUpdate: b,
|
|
534
534
|
onChatsLoaded: h
|
|
535
535
|
}) {
|
|
536
|
-
const k =
|
|
536
|
+
const k = U(
|
|
537
537
|
() => new ct(r, t || void 0, n),
|
|
538
538
|
[r, t, n]
|
|
539
|
-
), [g, x] =
|
|
539
|
+
), [g, x] = N(o || null);
|
|
540
540
|
L(() => {
|
|
541
541
|
o && x(o);
|
|
542
542
|
}, [o]);
|
|
@@ -550,7 +550,7 @@ function Ar({
|
|
|
550
550
|
b?.(v, C);
|
|
551
551
|
},
|
|
552
552
|
[b]
|
|
553
|
-
), A =
|
|
553
|
+
), A = U(() => st(k, {
|
|
554
554
|
modelId: g || void 0,
|
|
555
555
|
// Pass undefined if not set (backend resolves it)
|
|
556
556
|
systemPrompt: l,
|
|
@@ -581,12 +581,8 @@ function Ir({
|
|
|
581
581
|
modelAdapter: e,
|
|
582
582
|
children: r
|
|
583
583
|
}) {
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
n(!0);
|
|
587
|
-
}, []);
|
|
588
|
-
const i = it(e);
|
|
589
|
-
return t ? /* @__PURE__ */ d(ot, { runtime: i, children: r }) : /* @__PURE__ */ d(U, { children: r });
|
|
584
|
+
const t = it(e);
|
|
585
|
+
return /* @__PURE__ */ d(ot, { runtime: t, children: r });
|
|
590
586
|
}
|
|
591
587
|
function Nr({
|
|
592
588
|
client: e,
|
|
@@ -597,14 +593,14 @@ function Nr({
|
|
|
597
593
|
onError: o,
|
|
598
594
|
children: a
|
|
599
595
|
}) {
|
|
600
|
-
const u =
|
|
596
|
+
const u = U(() => Tr(e, (b, h) => {
|
|
601
597
|
i?.(b, h);
|
|
602
598
|
}), [e, i]), l = J(
|
|
603
599
|
(b, h) => {
|
|
604
600
|
u.updateRemoteId && u.updateRemoteId(b, h), i?.(b, h);
|
|
605
601
|
},
|
|
606
602
|
[u, i]
|
|
607
|
-
), c =
|
|
603
|
+
), c = U(() => ({
|
|
608
604
|
...u,
|
|
609
605
|
async list() {
|
|
610
606
|
const b = await u.list();
|
|
@@ -614,7 +610,7 @@ function Nr({
|
|
|
614
610
|
L(() => {
|
|
615
611
|
window.__cuadraThreadListAdapter = c, window.__cuadraThreadListRuntime = null;
|
|
616
612
|
}, [c]);
|
|
617
|
-
const f =
|
|
613
|
+
const f = U(() => st(e, {
|
|
618
614
|
...r,
|
|
619
615
|
onThreadIdUpdate: l
|
|
620
616
|
}), [e, r, l]), s = J(() => it(f), [f]), p = Kt({
|
|
@@ -648,7 +644,7 @@ function Z(e) {
|
|
|
648
644
|
function M(e) {
|
|
649
645
|
return e !== null && (e < 0 || e === 32);
|
|
650
646
|
}
|
|
651
|
-
function
|
|
647
|
+
function _(e) {
|
|
652
648
|
return e === -2 || e === -1 || e === 32;
|
|
653
649
|
}
|
|
654
650
|
const he = me(/\p{P}|\p{S}/u), H = me(/\s/);
|
|
@@ -680,7 +676,7 @@ const pe = (
|
|
|
680
676
|
*/
|
|
681
677
|
(function(e) {
|
|
682
678
|
if (e == null)
|
|
683
|
-
return
|
|
679
|
+
return Fr;
|
|
684
680
|
if (typeof e == "function")
|
|
685
681
|
return ge(e);
|
|
686
682
|
if (typeof e == "object")
|
|
@@ -737,7 +733,7 @@ function Pr(e) {
|
|
|
737
733
|
function ge(e) {
|
|
738
734
|
return r;
|
|
739
735
|
function r(t, n, i) {
|
|
740
|
-
return !!(
|
|
736
|
+
return !!(Rr(t) && e.call(
|
|
741
737
|
this,
|
|
742
738
|
t,
|
|
743
739
|
typeof n == "number" ? n : void 0,
|
|
@@ -745,13 +741,13 @@ function ge(e) {
|
|
|
745
741
|
));
|
|
746
742
|
}
|
|
747
743
|
}
|
|
748
|
-
function
|
|
744
|
+
function Fr() {
|
|
749
745
|
return !0;
|
|
750
746
|
}
|
|
751
|
-
function
|
|
747
|
+
function Rr(e) {
|
|
752
748
|
return e !== null && typeof e == "object" && "type" in e;
|
|
753
749
|
}
|
|
754
|
-
const dt = [],
|
|
750
|
+
const dt = [], Er = !0, Se = !1, _r = "skip";
|
|
755
751
|
function ft(e, r, t, n) {
|
|
756
752
|
let i;
|
|
757
753
|
typeof r == "function" && typeof t != "function" ? (n = t, t = r) : i = r;
|
|
@@ -784,7 +780,7 @@ function ft(e, r, t, n) {
|
|
|
784
780
|
/** @type {UnistParent} */
|
|
785
781
|
l
|
|
786
782
|
);
|
|
787
|
-
if (x.children && b[0] !==
|
|
783
|
+
if (x.children && b[0] !== _r)
|
|
788
784
|
for (k = (n ? x.children.length : -1) + a, g = f.concat(x); k > -1 && k < x.children.length; ) {
|
|
789
785
|
const w = x.children[k];
|
|
790
786
|
if (h = u(w, k, g)(), h[0] === Se)
|
|
@@ -797,7 +793,7 @@ function ft(e, r, t, n) {
|
|
|
797
793
|
}
|
|
798
794
|
}
|
|
799
795
|
function zr(e) {
|
|
800
|
-
return Array.isArray(e) ? e : typeof e == "number" ? [
|
|
796
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [Er, e] : e == null ? dt : [e];
|
|
801
797
|
}
|
|
802
798
|
function jr(e, r, t) {
|
|
803
799
|
const i = pe((t || {}).ignore || []), o = $r(r);
|
|
@@ -1404,7 +1400,7 @@ function bt(e, r, t, n) {
|
|
|
1404
1400
|
function Pn(e, r, t) {
|
|
1405
1401
|
return t.options.emphasis || "*";
|
|
1406
1402
|
}
|
|
1407
|
-
function
|
|
1403
|
+
function Fn(e, r, t, n) {
|
|
1408
1404
|
let i, o, a;
|
|
1409
1405
|
typeof r == "function" && typeof t != "function" ? (o = void 0, a = r, i = t) : (o = r, a = t, i = n), ft(e, o, u, i);
|
|
1410
1406
|
function u(l, c) {
|
|
@@ -1412,13 +1408,13 @@ function Rn(e, r, t, n) {
|
|
|
1412
1408
|
return a(l, s, f);
|
|
1413
1409
|
}
|
|
1414
1410
|
}
|
|
1415
|
-
const
|
|
1411
|
+
const Rn = {};
|
|
1416
1412
|
function kt(e, r) {
|
|
1417
|
-
const t =
|
|
1413
|
+
const t = Rn, n = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
|
|
1418
1414
|
return xt(e, n, i);
|
|
1419
1415
|
}
|
|
1420
1416
|
function xt(e, r, t) {
|
|
1421
|
-
if (
|
|
1417
|
+
if (En(e)) {
|
|
1422
1418
|
if ("value" in e)
|
|
1423
1419
|
return e.type === "html" && !t ? "" : e.value;
|
|
1424
1420
|
if (r && "alt" in e && e.alt)
|
|
@@ -1435,19 +1431,19 @@ function Ve(e, r, t) {
|
|
|
1435
1431
|
n[i] = xt(e[i], r, t);
|
|
1436
1432
|
return n.join("");
|
|
1437
1433
|
}
|
|
1438
|
-
function
|
|
1434
|
+
function En(e) {
|
|
1439
1435
|
return !!(e && typeof e == "object");
|
|
1440
1436
|
}
|
|
1441
|
-
function
|
|
1437
|
+
function _n(e, r) {
|
|
1442
1438
|
let t = !1;
|
|
1443
|
-
return
|
|
1439
|
+
return Fn(e, function(n) {
|
|
1444
1440
|
if ("value" in n && /\r?\n|\r/.test(n.value) || n.type === "break")
|
|
1445
1441
|
return t = !0, Se;
|
|
1446
1442
|
}), !!((!e.depth || e.depth < 3) && kt(e) && (r.options.setext || t));
|
|
1447
1443
|
}
|
|
1448
1444
|
function zn(e, r, t, n) {
|
|
1449
1445
|
const i = Math.max(Math.min(6, e.depth || 1), 1), o = t.createTracker(n);
|
|
1450
|
-
if (
|
|
1446
|
+
if (_n(e, t)) {
|
|
1451
1447
|
const f = t.enter("headingSetext"), s = t.enter("phrasing"), p = t.containerPhrasing(e, {
|
|
1452
1448
|
...o.current(),
|
|
1453
1449
|
before: `
|
|
@@ -2087,41 +2083,41 @@ const xa = {
|
|
|
2087
2083
|
}, wa = {
|
|
2088
2084
|
tokenize: La,
|
|
2089
2085
|
partial: !0
|
|
2090
|
-
},
|
|
2086
|
+
}, Ft = {
|
|
2091
2087
|
name: "wwwAutolink",
|
|
2092
2088
|
tokenize: va,
|
|
2093
|
-
previous:
|
|
2094
|
-
},
|
|
2089
|
+
previous: Et
|
|
2090
|
+
}, Rt = {
|
|
2095
2091
|
name: "protocolAutolink",
|
|
2096
2092
|
tokenize: Ta,
|
|
2097
|
-
previous:
|
|
2093
|
+
previous: _t
|
|
2098
2094
|
}, $ = {
|
|
2099
2095
|
name: "emailAutolink",
|
|
2100
2096
|
tokenize: Ca,
|
|
2101
2097
|
previous: zt
|
|
2102
|
-
},
|
|
2098
|
+
}, F = {};
|
|
2103
2099
|
function ya() {
|
|
2104
2100
|
return {
|
|
2105
|
-
text:
|
|
2101
|
+
text: F
|
|
2106
2102
|
};
|
|
2107
2103
|
}
|
|
2108
|
-
let
|
|
2109
|
-
for (;
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2104
|
+
let B = 48;
|
|
2105
|
+
for (; B < 123; )
|
|
2106
|
+
F[B] = $, B++, B === 58 ? B = 65 : B === 91 && (B = 97);
|
|
2107
|
+
F[43] = $;
|
|
2108
|
+
F[45] = $;
|
|
2109
|
+
F[46] = $;
|
|
2110
|
+
F[95] = $;
|
|
2111
|
+
F[72] = [$, Rt];
|
|
2112
|
+
F[104] = [$, Rt];
|
|
2113
|
+
F[87] = [$, Ft];
|
|
2114
|
+
F[119] = [$, Ft];
|
|
2119
2115
|
function Ca(e, r, t) {
|
|
2120
2116
|
const n = this;
|
|
2121
2117
|
let i, o;
|
|
2122
2118
|
return a;
|
|
2123
2119
|
function a(s) {
|
|
2124
|
-
return !Le(s) || !zt.call(n, n.previous) ||
|
|
2120
|
+
return !Le(s) || !zt.call(n, n.previous) || Fe(n.events) ? t(s) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(s));
|
|
2125
2121
|
}
|
|
2126
2122
|
function u(s) {
|
|
2127
2123
|
return Le(s) ? (e.consume(s), u) : s === 64 ? (e.consume(s), l) : t(s);
|
|
@@ -2140,7 +2136,7 @@ function va(e, r, t) {
|
|
|
2140
2136
|
const n = this;
|
|
2141
2137
|
return i;
|
|
2142
2138
|
function i(a) {
|
|
2143
|
-
return a !== 87 && a !== 119 || !
|
|
2139
|
+
return a !== 87 && a !== 119 || !Et.call(n, n.previous) || Fe(n.events) ? t(a) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(xa, e.attempt(Mt, e.attempt(Dt, o), t), t)(a));
|
|
2144
2140
|
}
|
|
2145
2141
|
function o(a) {
|
|
2146
2142
|
return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), r(a);
|
|
@@ -2151,7 +2147,7 @@ function Ta(e, r, t) {
|
|
|
2151
2147
|
let i = "", o = !1;
|
|
2152
2148
|
return a;
|
|
2153
2149
|
function a(s) {
|
|
2154
|
-
return (s === 72 || s === 104) &&
|
|
2150
|
+
return (s === 72 || s === 104) && _t.call(n, n.previous) && !Fe(n.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(s), e.consume(s), u) : t(s);
|
|
2155
2151
|
}
|
|
2156
2152
|
function u(s) {
|
|
2157
2153
|
if (re(s) && i.length < 5)
|
|
@@ -2234,10 +2230,10 @@ function La(e, r, t) {
|
|
|
2234
2230
|
return Me(o) ? t(o) : r(o);
|
|
2235
2231
|
}
|
|
2236
2232
|
}
|
|
2237
|
-
function
|
|
2233
|
+
function Et(e) {
|
|
2238
2234
|
return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || M(e);
|
|
2239
2235
|
}
|
|
2240
|
-
function
|
|
2236
|
+
function _t(e) {
|
|
2241
2237
|
return !re(e);
|
|
2242
2238
|
}
|
|
2243
2239
|
function zt(e) {
|
|
@@ -2246,7 +2242,7 @@ function zt(e) {
|
|
|
2246
2242
|
function Le(e) {
|
|
2247
2243
|
return e === 43 || e === 45 || e === 46 || e === 95 || Me(e);
|
|
2248
2244
|
}
|
|
2249
|
-
function
|
|
2245
|
+
function Fe(e) {
|
|
2250
2246
|
let r = e.length, t = !1;
|
|
2251
2247
|
for (; r--; ) {
|
|
2252
2248
|
const n = e[r][1];
|
|
@@ -2275,10 +2271,10 @@ function z(e, r, t, n) {
|
|
|
2275
2271
|
let o = 0;
|
|
2276
2272
|
return a;
|
|
2277
2273
|
function a(l) {
|
|
2278
|
-
return
|
|
2274
|
+
return _(l) ? (e.enter(t), u(l)) : r(l);
|
|
2279
2275
|
}
|
|
2280
2276
|
function u(l) {
|
|
2281
|
-
return
|
|
2277
|
+
return _(l) && o++ < i ? (e.consume(l), u) : (e.exit(t), r(l));
|
|
2282
2278
|
}
|
|
2283
2279
|
}
|
|
2284
2280
|
const Da = {
|
|
@@ -2288,17 +2284,17 @@ const Da = {
|
|
|
2288
2284
|
function Pa(e, r, t) {
|
|
2289
2285
|
return n;
|
|
2290
2286
|
function n(o) {
|
|
2291
|
-
return
|
|
2287
|
+
return _(o) ? z(e, i, "linePrefix")(o) : i(o);
|
|
2292
2288
|
}
|
|
2293
2289
|
function i(o) {
|
|
2294
2290
|
return o === null || Z(o) ? r(o) : t(o);
|
|
2295
2291
|
}
|
|
2296
2292
|
}
|
|
2297
|
-
const
|
|
2293
|
+
const Fa = {
|
|
2298
2294
|
tokenize: Ua,
|
|
2299
2295
|
partial: !0
|
|
2300
2296
|
};
|
|
2301
|
-
function
|
|
2297
|
+
function Ra() {
|
|
2302
2298
|
return {
|
|
2303
2299
|
document: {
|
|
2304
2300
|
91: {
|
|
@@ -2318,13 +2314,13 @@ function Ea() {
|
|
|
2318
2314
|
93: {
|
|
2319
2315
|
name: "gfmPotentialFootnoteCall",
|
|
2320
2316
|
add: "after",
|
|
2321
|
-
tokenize:
|
|
2322
|
-
resolveTo:
|
|
2317
|
+
tokenize: Ea,
|
|
2318
|
+
resolveTo: _a
|
|
2323
2319
|
}
|
|
2324
2320
|
}
|
|
2325
2321
|
};
|
|
2326
2322
|
}
|
|
2327
|
-
function
|
|
2323
|
+
function Ea(e, r, t) {
|
|
2328
2324
|
const n = this;
|
|
2329
2325
|
let i = n.events.length;
|
|
2330
2326
|
const o = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
|
|
@@ -2349,7 +2345,7 @@ function _a(e, r, t) {
|
|
|
2349
2345
|
return c.codePointAt(0) !== 94 || !o.includes(c.slice(1)) ? t(l) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), r(l));
|
|
2350
2346
|
}
|
|
2351
2347
|
}
|
|
2352
|
-
function
|
|
2348
|
+
function _a(e, r) {
|
|
2353
2349
|
let t = e.length;
|
|
2354
2350
|
for (; t--; )
|
|
2355
2351
|
if (e[t][1].type === "labelImage" && e[t][0] === "enter") {
|
|
@@ -2466,7 +2462,7 @@ function ja(e, r, t) {
|
|
|
2466
2462
|
}
|
|
2467
2463
|
}
|
|
2468
2464
|
function $a(e, r, t) {
|
|
2469
|
-
return e.check(Da, r, e.attempt(
|
|
2465
|
+
return e.check(Da, r, e.attempt(Fa, r, t));
|
|
2470
2466
|
}
|
|
2471
2467
|
function Oa(e) {
|
|
2472
2468
|
e.exit("gfmFootnoteDefinition");
|
|
@@ -2661,7 +2657,7 @@ function Va(e, r, t) {
|
|
|
2661
2657
|
return m === 124 || (a = !0, o += 1), f(m);
|
|
2662
2658
|
}
|
|
2663
2659
|
function f(m) {
|
|
2664
|
-
return m === null ? t(m) : Z(m) ? o > 1 ? (o = 0, n.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), b) : t(m) :
|
|
2660
|
+
return m === null ? t(m) : Z(m) ? o > 1 ? (o = 0, n.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), b) : t(m) : _(m) ? z(e, f, "whitespace")(m) : (o += 1, a && (a = !1, i += 1), m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), a = !0, f) : (e.enter("data"), s(m)));
|
|
2665
2661
|
}
|
|
2666
2662
|
function s(m) {
|
|
2667
2663
|
return m === null || m === 124 || M(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : s);
|
|
@@ -2670,13 +2666,13 @@ function Va(e, r, t) {
|
|
|
2670
2666
|
return m === 92 || m === 124 ? (e.consume(m), s) : s(m);
|
|
2671
2667
|
}
|
|
2672
2668
|
function b(m) {
|
|
2673
|
-
return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(m) : (e.enter("tableDelimiterRow"), a = !1,
|
|
2669
|
+
return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(m) : (e.enter("tableDelimiterRow"), a = !1, _(m) ? z(e, h, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : h(m));
|
|
2674
2670
|
}
|
|
2675
2671
|
function h(m) {
|
|
2676
2672
|
return m === 45 || m === 58 ? g(m) : m === 124 ? (a = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), k) : v(m);
|
|
2677
2673
|
}
|
|
2678
2674
|
function k(m) {
|
|
2679
|
-
return
|
|
2675
|
+
return _(m) ? z(e, g, "whitespace")(m) : g(m);
|
|
2680
2676
|
}
|
|
2681
2677
|
function g(m) {
|
|
2682
2678
|
return m === 58 ? (o += 1, a = !0, e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), x) : m === 45 ? (o += 1, x(m)) : m === null || Z(m) ? A(m) : v(m);
|
|
@@ -2688,7 +2684,7 @@ function Va(e, r, t) {
|
|
|
2688
2684
|
return m === 45 ? (e.consume(m), w) : m === 58 ? (a = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), y) : (e.exit("tableDelimiterFiller"), y(m));
|
|
2689
2685
|
}
|
|
2690
2686
|
function y(m) {
|
|
2691
|
-
return
|
|
2687
|
+
return _(m) ? z(e, A, "whitespace")(m) : A(m);
|
|
2692
2688
|
}
|
|
2693
2689
|
function A(m) {
|
|
2694
2690
|
return m === 124 ? h(m) : m === null || Z(m) ? !a || i !== o ? v(m) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(m)) : v(m);
|
|
@@ -2700,13 +2696,13 @@ function Va(e, r, t) {
|
|
|
2700
2696
|
return e.enter("tableRow"), D(m);
|
|
2701
2697
|
}
|
|
2702
2698
|
function D(m) {
|
|
2703
|
-
return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), D) : m === null || Z(m) ? (e.exit("tableRow"), r(m)) :
|
|
2699
|
+
return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), D) : m === null || Z(m) ? (e.exit("tableRow"), r(m)) : _(m) ? z(e, D, "whitespace")(m) : (e.enter("data"), R(m));
|
|
2704
2700
|
}
|
|
2705
|
-
function
|
|
2706
|
-
return m === null || m === 124 || M(m) ? (e.exit("data"), D(m)) : (e.consume(m), m === 92 ? q :
|
|
2701
|
+
function R(m) {
|
|
2702
|
+
return m === null || m === 124 || M(m) ? (e.exit("data"), D(m)) : (e.consume(m), m === 92 ? q : R);
|
|
2707
2703
|
}
|
|
2708
2704
|
function q(m) {
|
|
2709
|
-
return m === 92 || m === 124 ? (e.consume(m),
|
|
2705
|
+
return m === 92 || m === 124 ? (e.consume(m), R) : R(m);
|
|
2710
2706
|
}
|
|
2711
2707
|
}
|
|
2712
2708
|
function Ga(e, r) {
|
|
@@ -2795,7 +2791,7 @@ function Qa(e, r, t) {
|
|
|
2795
2791
|
return l === 93 ? (e.enter("taskListCheckMarker"), e.consume(l), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(l);
|
|
2796
2792
|
}
|
|
2797
2793
|
function u(l) {
|
|
2798
|
-
return Z(l) ? r(l) :
|
|
2794
|
+
return Z(l) ? r(l) : _(l) ? e.check({
|
|
2799
2795
|
tokenize: Xa
|
|
2800
2796
|
}, r, t)(l) : t(l);
|
|
2801
2797
|
}
|
|
@@ -2809,7 +2805,7 @@ function Xa(e, r, t) {
|
|
|
2809
2805
|
function Ya(e) {
|
|
2810
2806
|
return ga([
|
|
2811
2807
|
ya(),
|
|
2812
|
-
|
|
2808
|
+
Ra(),
|
|
2813
2809
|
Ba(e),
|
|
2814
2810
|
Ka(),
|
|
2815
2811
|
Ja()
|
|
@@ -2823,7 +2819,7 @@ function ti(e) {
|
|
|
2823
2819
|
), t = e || ei, n = r.data(), i = n.micromarkExtensions || (n.micromarkExtensions = []), o = n.fromMarkdownExtensions || (n.fromMarkdownExtensions = []), a = n.toMarkdownExtensions || (n.toMarkdownExtensions = []);
|
|
2824
2820
|
i.push(Ya(t)), o.push(ma()), a.push(pa(t));
|
|
2825
2821
|
}
|
|
2826
|
-
function
|
|
2822
|
+
function I(...e) {
|
|
2827
2823
|
return e.filter(Boolean).join(" ");
|
|
2828
2824
|
}
|
|
2829
2825
|
const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
@@ -2856,7 +2852,7 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2856
2852
|
}, ai = ({
|
|
2857
2853
|
copiedDuration: e = 3e3
|
|
2858
2854
|
} = {}) => {
|
|
2859
|
-
const [r, t] =
|
|
2855
|
+
const [r, t] = N(!1);
|
|
2860
2856
|
return { isCopied: r, copyToClipboard: (i) => {
|
|
2861
2857
|
i && navigator.clipboard.writeText(i).then(() => {
|
|
2862
2858
|
t(!0), setTimeout(() => t(!1), e);
|
|
@@ -2866,14 +2862,14 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2866
2862
|
h1: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2867
2863
|
"h1",
|
|
2868
2864
|
{
|
|
2869
|
-
className:
|
|
2865
|
+
className: I("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
|
|
2870
2866
|
...r
|
|
2871
2867
|
}
|
|
2872
2868
|
),
|
|
2873
2869
|
h2: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2874
2870
|
"h2",
|
|
2875
2871
|
{
|
|
2876
|
-
className:
|
|
2872
|
+
className: I(
|
|
2877
2873
|
"cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
|
|
2878
2874
|
e
|
|
2879
2875
|
),
|
|
@@ -2883,7 +2879,7 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2883
2879
|
h3: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2884
2880
|
"h3",
|
|
2885
2881
|
{
|
|
2886
|
-
className:
|
|
2882
|
+
className: I(
|
|
2887
2883
|
"cuadra-mb-3 cuadra-mt-5 cuadra-scroll-m-20 cuadra-text-lg cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
|
|
2888
2884
|
e
|
|
2889
2885
|
),
|
|
@@ -2893,38 +2889,38 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2893
2889
|
h4: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2894
2890
|
"h4",
|
|
2895
2891
|
{
|
|
2896
|
-
className:
|
|
2892
|
+
className: I(
|
|
2897
2893
|
"cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
|
|
2898
2894
|
e
|
|
2899
2895
|
),
|
|
2900
2896
|
...r
|
|
2901
2897
|
}
|
|
2902
2898
|
),
|
|
2903
|
-
h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className:
|
|
2904
|
-
h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className:
|
|
2905
|
-
p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className:
|
|
2899
|
+
h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className: I("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
|
|
2900
|
+
h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className: I("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
|
|
2901
|
+
p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className: I("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
|
|
2906
2902
|
a: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2907
2903
|
"a",
|
|
2908
2904
|
{
|
|
2909
|
-
className:
|
|
2905
|
+
className: I("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
|
|
2910
2906
|
...r
|
|
2911
2907
|
}
|
|
2912
2908
|
),
|
|
2913
|
-
blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className:
|
|
2914
|
-
ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className:
|
|
2915
|
-
ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className:
|
|
2916
|
-
hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className:
|
|
2909
|
+
blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className: I("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
|
|
2910
|
+
ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className: I("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
|
|
2911
|
+
ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className: I("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
|
|
2912
|
+
hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className: I("cuadra-my-5 cuadra-border-b", e), ...r }),
|
|
2917
2913
|
table: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2918
2914
|
"table",
|
|
2919
2915
|
{
|
|
2920
|
-
className:
|
|
2916
|
+
className: I("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
|
|
2921
2917
|
...r
|
|
2922
2918
|
}
|
|
2923
2919
|
),
|
|
2924
2920
|
th: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2925
2921
|
"th",
|
|
2926
2922
|
{
|
|
2927
|
-
className:
|
|
2923
|
+
className: I(
|
|
2928
2924
|
"cuadra-bg-muted cuadra-px-4 cuadra-py-2 cuadra-text-left cuadra-font-normal first:cuadra-rounded-tl-lg last:cuadra-rounded-tr-lg [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
|
|
2929
2925
|
e
|
|
2930
2926
|
),
|
|
@@ -2934,7 +2930,7 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2934
2930
|
td: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2935
2931
|
"td",
|
|
2936
2932
|
{
|
|
2937
|
-
className:
|
|
2933
|
+
className: I(
|
|
2938
2934
|
"cuadra-border-b cuadra-border-l cuadra-px-4 cuadra-py-2 cuadra-text-left last:cuadra-border-r [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
|
|
2939
2935
|
e
|
|
2940
2936
|
),
|
|
@@ -2944,18 +2940,18 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2944
2940
|
tr: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2945
2941
|
"tr",
|
|
2946
2942
|
{
|
|
2947
|
-
className:
|
|
2943
|
+
className: I(
|
|
2948
2944
|
"cuadra-m-0 cuadra-border-b cuadra-p-0 first:cuadra-border-t [&:last-child>td:first-child]:cuadra-rounded-bl-lg [&:last-child>td:last-child]:cuadra-rounded-br-lg",
|
|
2949
2945
|
e
|
|
2950
2946
|
),
|
|
2951
2947
|
...r
|
|
2952
2948
|
}
|
|
2953
2949
|
),
|
|
2954
|
-
sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className:
|
|
2950
|
+
sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className: I("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
|
|
2955
2951
|
pre: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2956
2952
|
"pre",
|
|
2957
2953
|
{
|
|
2958
|
-
className:
|
|
2954
|
+
className: I(
|
|
2959
2955
|
"cuadra-overflow-x-auto cuadra-rounded-b-lg !cuadra-rounded-t-none cuadra-bg-muted cuadra-p-4 cuadra-text-foreground font-brand",
|
|
2960
2956
|
e
|
|
2961
2957
|
),
|
|
@@ -2967,7 +2963,7 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2967
2963
|
return /* @__PURE__ */ d(
|
|
2968
2964
|
"code",
|
|
2969
2965
|
{
|
|
2970
|
-
className:
|
|
2966
|
+
className: I(!n && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
|
|
2971
2967
|
...t
|
|
2972
2968
|
}
|
|
2973
2969
|
);
|
|
@@ -2981,7 +2977,7 @@ const ri = ({ content: e }) => /* @__PURE__ */ d(
|
|
|
2981
2977
|
"Composing answer…"
|
|
2982
2978
|
];
|
|
2983
2979
|
function oi({ active: e }) {
|
|
2984
|
-
const [r, t] =
|
|
2980
|
+
const [r, t] = N(0);
|
|
2985
2981
|
return L(() => {
|
|
2986
2982
|
if (!e) {
|
|
2987
2983
|
t(0);
|
|
@@ -3003,7 +2999,7 @@ function Ye({
|
|
|
3003
2999
|
suggestions: n,
|
|
3004
3000
|
inputPlaceholder: i = "Type your message..."
|
|
3005
3001
|
} = {}) {
|
|
3006
|
-
const o = Vt(), [a, u] =
|
|
3002
|
+
const o = Vt(), [a, u] = N(!1), [l, c] = N(null), [f, s] = N(!1);
|
|
3007
3003
|
return L(() => {
|
|
3008
3004
|
if (!o) {
|
|
3009
3005
|
u(!1);
|
|
@@ -3046,7 +3042,7 @@ function Ye({
|
|
|
3046
3042
|
children: a ? /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
|
|
3047
3043
|
/* @__PURE__ */ d(ut, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
|
|
3048
3044
|
/* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-muted-foreground font-brand", children: "Loading messages..." })
|
|
3049
|
-
] }) }) : /* @__PURE__ */ T(
|
|
3045
|
+
] }) }) : /* @__PURE__ */ T(W, { children: [
|
|
3050
3046
|
/* @__PURE__ */ d(te.Empty, { children: /* @__PURE__ */ d(
|
|
3051
3047
|
li,
|
|
3052
3048
|
{
|
|
@@ -3078,8 +3074,8 @@ function Ye({
|
|
|
3078
3074
|
{
|
|
3079
3075
|
rows: 3,
|
|
3080
3076
|
placeholder: i,
|
|
3081
|
-
className: "cuadra-flex cuadra-min-h-[80px] cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-
|
|
3082
|
-
style: { paddingRight: "2.5rem", fontSize: "1rem" }
|
|
3077
|
+
className: "cuadra-flex cuadra-min-h-[80px] cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-border cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-base placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-resize-none cuadra-pr-10 font-brand",
|
|
3078
|
+
style: { paddingRight: "2.5rem", fontSize: "1rem", borderWidth: "1px" }
|
|
3083
3079
|
}
|
|
3084
3080
|
)
|
|
3085
3081
|
}
|
|
@@ -3087,8 +3083,14 @@ function Ye({
|
|
|
3087
3083
|
/* @__PURE__ */ d(ke.Send, { asChild: !0, children: /* @__PURE__ */ d(
|
|
3088
3084
|
"button",
|
|
3089
3085
|
{
|
|
3090
|
-
className: "!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-
|
|
3091
|
-
style: {
|
|
3086
|
+
className: "!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-rounded-md cuadra-shadow-sm hover:cuadra-opacity-90 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed cuadra-flex cuadra-items-center cuadra-justify-center",
|
|
3087
|
+
style: {
|
|
3088
|
+
position: "absolute",
|
|
3089
|
+
bottom: "0.5rem",
|
|
3090
|
+
right: "0.5rem",
|
|
3091
|
+
backgroundColor: "var(--primary)",
|
|
3092
|
+
color: "hsl(var(--primary-foreground))"
|
|
3093
|
+
},
|
|
3092
3094
|
"aria-label": "Send message",
|
|
3093
3095
|
type: "button",
|
|
3094
3096
|
children: /* @__PURE__ */ d(ir, { className: "cuadra-h-4 cuadra-w-4" })
|
|
@@ -3126,7 +3128,7 @@ function ui() {
|
|
|
3126
3128
|
return /* @__PURE__ */ d(se.Root, { className: "cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2", children: /* @__PURE__ */ d(
|
|
3127
3129
|
"div",
|
|
3128
3130
|
{
|
|
3129
|
-
className: "cuadra-bg-muted cuadra-text-foreground cuadra-col-start-2 cuadra-row-start-2 cuadra-max-w-[calc(42rem*0.8)] cuadra-break-words cuadra-rounded-3xl cuadra-px-5 cuadra-py-2.5 font-brand",
|
|
3131
|
+
className: "cuadra-bg-muted cuadra-text-foreground cuadra-col-start-2 cuadra-row-start-2 cuadra-max-w-[calc(42rem*0.8)] cuadra-break-words cuadra-rounded-3xl cuadra-border cuadra-border-border cuadra-px-5 cuadra-py-2.5 font-brand",
|
|
3130
3132
|
style: {
|
|
3131
3133
|
maxWidth: "calc(42rem * 0.8)",
|
|
3132
3134
|
borderRadius: "1.5rem",
|
|
@@ -3136,7 +3138,8 @@ function ui() {
|
|
|
3136
3138
|
paddingRight: "1.25rem",
|
|
3137
3139
|
paddingTop: "0.625rem",
|
|
3138
3140
|
paddingBottom: "0.625rem",
|
|
3139
|
-
wordBreak: "break-word"
|
|
3141
|
+
wordBreak: "break-word",
|
|
3142
|
+
borderWidth: "1px"
|
|
3140
3143
|
},
|
|
3141
3144
|
children: /* @__PURE__ */ d(
|
|
3142
3145
|
se.Parts,
|
|
@@ -3171,7 +3174,7 @@ function ci() {
|
|
|
3171
3174
|
) });
|
|
3172
3175
|
}
|
|
3173
3176
|
function si({ onThreadSelect: e }) {
|
|
3174
|
-
const r = at(), t = Zt((g) => g.threadId), [n, i] =
|
|
3177
|
+
const r = at(), t = Zt((g) => g.threadId), [n, i] = N(null), o = r?.id === t, a = n === r?.id, [u, l] = N(!1), [c, f] = N(r?.title || ""), [s, p] = N(!1), [b, h] = N(!1), k = async () => {
|
|
3175
3178
|
if (!r?.remoteId || !c || c === r.title) {
|
|
3176
3179
|
l(!1);
|
|
3177
3180
|
return;
|
|
@@ -3214,7 +3217,7 @@ function si({ onThreadSelect: e }) {
|
|
|
3214
3217
|
autoFocus: !0,
|
|
3215
3218
|
onClick: (g) => g.stopPropagation()
|
|
3216
3219
|
}
|
|
3217
|
-
) : /* @__PURE__ */ T(
|
|
3220
|
+
) : /* @__PURE__ */ T(W, { children: [
|
|
3218
3221
|
/* @__PURE__ */ d("span", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-truncate font-brand", children: (r.title?.length || 0) > 60 ? `${r.title?.slice(0, 60)}…` : r.title || "Chat" }),
|
|
3219
3222
|
r.updatedAt && /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand", children: new Date(r.updatedAt).toLocaleDateString() })
|
|
3220
3223
|
] }) }),
|
|
@@ -3230,7 +3233,7 @@ function si({ onThreadSelect: e }) {
|
|
|
3230
3233
|
children: /* @__PURE__ */ d(pr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
|
|
3231
3234
|
}
|
|
3232
3235
|
),
|
|
3233
|
-
s && /* @__PURE__ */ T(
|
|
3236
|
+
s && /* @__PURE__ */ T(W, { children: [
|
|
3234
3237
|
/* @__PURE__ */ d(
|
|
3235
3238
|
"div",
|
|
3236
3239
|
{
|
|
@@ -3248,7 +3251,7 @@ function si({ onThreadSelect: e }) {
|
|
|
3248
3251
|
disabled: b,
|
|
3249
3252
|
children: "Save"
|
|
3250
3253
|
}
|
|
3251
|
-
) : /* @__PURE__ */ T(
|
|
3254
|
+
) : /* @__PURE__ */ T(W, { children: [
|
|
3252
3255
|
/* @__PURE__ */ d(
|
|
3253
3256
|
"button",
|
|
3254
3257
|
{
|
|
@@ -3319,7 +3322,7 @@ const di = `
|
|
|
3319
3322
|
style: o,
|
|
3320
3323
|
contentStyle: a,
|
|
3321
3324
|
rotating: u = !1
|
|
3322
|
-
}) => /* @__PURE__ */ T(
|
|
3325
|
+
}) => /* @__PURE__ */ T(W, { children: [
|
|
3323
3326
|
/* @__PURE__ */ d("style", { children: di }),
|
|
3324
3327
|
/* @__PURE__ */ T(
|
|
3325
3328
|
"div",
|
|
@@ -3336,13 +3339,13 @@ const di = `
|
|
|
3336
3339
|
top: "-100%",
|
|
3337
3340
|
width: "300%",
|
|
3338
3341
|
height: "300%",
|
|
3339
|
-
backgroundImage: "conic-gradient(#
|
|
3342
|
+
backgroundImage: "conic-gradient(#F4633A, #FF7A4D, #FF8C5C, #F4633A, #FF7A4D, #FF8C5C)",
|
|
3340
3343
|
backgroundRepeat: "no-repeat",
|
|
3341
3344
|
backgroundSize: "cover",
|
|
3342
3345
|
backgroundPosition: "center",
|
|
3343
3346
|
animation: "rotate 4s linear infinite"
|
|
3344
3347
|
} : {
|
|
3345
|
-
backgroundImage: "linear-gradient(to right, #
|
|
3348
|
+
backgroundImage: "linear-gradient(to right, #F4633A, #FF7A4D, #FF8C5C, #F4633A)",
|
|
3346
3349
|
backgroundSize: "cover",
|
|
3347
3350
|
backgroundPosition: "center",
|
|
3348
3351
|
backgroundRepeat: "no-repeat",
|
|
@@ -3375,7 +3378,7 @@ const di = `
|
|
|
3375
3378
|
return a || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
3376
3379
|
}
|
|
3377
3380
|
return r;
|
|
3378
|
-
}, [n, i] =
|
|
3381
|
+
}, [n, i] = N(t);
|
|
3379
3382
|
return L(() => {
|
|
3380
3383
|
r !== "system" && i(r);
|
|
3381
3384
|
}, [r]), L(() => {
|
|
@@ -3411,7 +3414,7 @@ const di = `
|
|
|
3411
3414
|
onMobileMenuClick: l,
|
|
3412
3415
|
showMobileMenuButton: c = !1
|
|
3413
3416
|
}) => {
|
|
3414
|
-
const [f, s] =
|
|
3417
|
+
const [f, s] = N(!1), p = nt(null);
|
|
3415
3418
|
L(() => {
|
|
3416
3419
|
const h = (k) => {
|
|
3417
3420
|
p.current && !p.current.contains(k.target) && s(!1);
|
|
@@ -3535,21 +3538,21 @@ const pi = ({ config: e }) => {
|
|
|
3535
3538
|
onChatCreated: y,
|
|
3536
3539
|
onUserMessage: A,
|
|
3537
3540
|
onThreadIdUpdate: v
|
|
3538
|
-
} = e, [C, D] =
|
|
3539
|
-
() => new ct(
|
|
3540
|
-
[
|
|
3541
|
-
), [P, ie] =
|
|
3541
|
+
} = e, [C, D] = N(!1), R = t || r || "", q = !!t, m = U(
|
|
3542
|
+
() => new ct(R, n || void 0, q),
|
|
3543
|
+
[R, n, q]
|
|
3544
|
+
), [P, ie] = N(null), [O, Q] = N(!1), [X, Re] = N(null), [$t, Ee] = N(!1);
|
|
3542
3545
|
L(() => {
|
|
3543
|
-
i === "multiChat" &&
|
|
3546
|
+
i === "multiChat" && Ee(!0);
|
|
3544
3547
|
}, [i]);
|
|
3545
3548
|
const K = J(async () => {
|
|
3546
3549
|
if (o === "selector") {
|
|
3547
|
-
Q(!0),
|
|
3550
|
+
Q(!0), Re(null);
|
|
3548
3551
|
try {
|
|
3549
3552
|
const S = await m.listModels();
|
|
3550
3553
|
ie(S);
|
|
3551
3554
|
} catch (S) {
|
|
3552
|
-
|
|
3555
|
+
Re(S instanceof Error ? S : new Error("Failed to load models"));
|
|
3553
3556
|
} finally {
|
|
3554
3557
|
Q(!1);
|
|
3555
3558
|
}
|
|
@@ -3560,12 +3563,12 @@ const pi = ({ config: e }) => {
|
|
|
3560
3563
|
}, [o, K]), L(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = K), () => {
|
|
3561
3564
|
typeof window < "u" && delete window.__cuadraUIKitRefetchModels;
|
|
3562
3565
|
}), [K]);
|
|
3563
|
-
const [
|
|
3566
|
+
const [E, _e] = N(
|
|
3564
3567
|
o === "fixed" && a || null
|
|
3565
|
-
), ze = nt(
|
|
3568
|
+
), ze = nt(E), Y = J(
|
|
3566
3569
|
(S) => {
|
|
3567
3570
|
const ee = ze.current;
|
|
3568
|
-
|
|
3571
|
+
_e(S), ze.current = S, u?.(S), ee !== null && ee !== S && i === "multiChat" && setTimeout(() => {
|
|
3569
3572
|
const V = window.__cuadraThreadListRuntime;
|
|
3570
3573
|
if (V?.threads?.switchToNewThread)
|
|
3571
3574
|
try {
|
|
@@ -3587,37 +3590,37 @@ const pi = ({ config: e }) => {
|
|
|
3587
3590
|
[u, i]
|
|
3588
3591
|
);
|
|
3589
3592
|
L(() => {
|
|
3590
|
-
if (o === "selector" && P?.items && P.items.length > 0 && !
|
|
3593
|
+
if (o === "selector" && P?.items && P.items.length > 0 && !E) {
|
|
3591
3594
|
const S = P.items[0];
|
|
3592
3595
|
if (S?.id) {
|
|
3593
3596
|
const ee = S.id;
|
|
3594
|
-
|
|
3597
|
+
_e(ee), u?.(ee);
|
|
3595
3598
|
}
|
|
3596
3599
|
}
|
|
3597
|
-
}, [o, P?.items,
|
|
3598
|
-
const Ot = o === "fixed" ? !!a : !!
|
|
3600
|
+
}, [o, P?.items, E, u]);
|
|
3601
|
+
const Ot = o === "fixed" ? !!a : !!E, oe = U(
|
|
3599
3602
|
() => (P?.items || []).filter((S) => S?.id && S?.displayName).map((S) => ({ id: S.id, name: S.displayName })),
|
|
3600
3603
|
[P]
|
|
3601
|
-
), be =
|
|
3604
|
+
), be = U(
|
|
3602
3605
|
() => ({
|
|
3603
|
-
currentModelId:
|
|
3606
|
+
currentModelId: E || "",
|
|
3604
3607
|
models: oe,
|
|
3605
3608
|
modelsLoading: O,
|
|
3606
3609
|
modelsError: X,
|
|
3607
3610
|
onModelChange: Y,
|
|
3608
3611
|
refetchModels: K
|
|
3609
3612
|
}),
|
|
3610
|
-
[
|
|
3613
|
+
[E, oe, O, X, Y, K]
|
|
3611
3614
|
);
|
|
3612
3615
|
return o === "selector" && O || i === "multiChat" && $t ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d(ut, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : o === "selector" && !Ot && X ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-destructive font-brand", children: "Failed to load models" }) }) }) }) }) : /* @__PURE__ */ d("div", { className: "cuadra-uikit cuadra-h-full cuadra-w-full", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(
|
|
3613
3616
|
Ar,
|
|
3614
3617
|
{
|
|
3615
|
-
baseUrl: q ?
|
|
3618
|
+
baseUrl: q ? R : r || R,
|
|
3616
3619
|
sessionToken: n,
|
|
3617
3620
|
isProxyMode: q,
|
|
3618
3621
|
mode: i,
|
|
3619
3622
|
modelMode: o,
|
|
3620
|
-
modelId:
|
|
3623
|
+
modelId: E || a || void 0,
|
|
3621
3624
|
onModelChange: Y,
|
|
3622
3625
|
ephemeral: l,
|
|
3623
3626
|
systemPrompt: c,
|
|
@@ -3627,7 +3630,7 @@ const pi = ({ config: e }) => {
|
|
|
3627
3630
|
onUserMessage: A,
|
|
3628
3631
|
onThreadIdUpdate: v,
|
|
3629
3632
|
onChatsLoaded: () => {
|
|
3630
|
-
i === "multiChat" &&
|
|
3633
|
+
i === "multiChat" && Ee(!1);
|
|
3631
3634
|
},
|
|
3632
3635
|
children: /* @__PURE__ */ d(
|
|
3633
3636
|
Ae,
|
|
@@ -3637,7 +3640,7 @@ const pi = ({ config: e }) => {
|
|
|
3637
3640
|
className: `cuadra-h-full ${e.containerClass || ""}`,
|
|
3638
3641
|
borderSizePx: 4,
|
|
3639
3642
|
style: { height: "100%" },
|
|
3640
|
-
children: /* @__PURE__ */ d("div", { className: "cuadra-h-full cuadra-flex cuadra-relative", style: { height: "100%" }, children: i === "multiChat" ? /* @__PURE__ */ T(
|
|
3643
|
+
children: /* @__PURE__ */ d("div", { className: "cuadra-h-full cuadra-flex cuadra-relative", style: { height: "100%" }, children: i === "multiChat" ? /* @__PURE__ */ T(W, { children: [
|
|
3641
3644
|
C && typeof document < "u" && Oe(
|
|
3642
3645
|
/* @__PURE__ */ d(
|
|
3643
3646
|
"div",
|
|
@@ -3648,7 +3651,7 @@ const pi = ({ config: e }) => {
|
|
|
3648
3651
|
),
|
|
3649
3652
|
document.body
|
|
3650
3653
|
),
|
|
3651
|
-
typeof document < "u" && /* @__PURE__ */ T(
|
|
3654
|
+
typeof document < "u" && /* @__PURE__ */ T(W, { children: [
|
|
3652
3655
|
/* @__PURE__ */ d(
|
|
3653
3656
|
"div",
|
|
3654
3657
|
{
|
|
@@ -3673,7 +3676,7 @@ const pi = ({ config: e }) => {
|
|
|
3673
3676
|
o === "selector" && /* @__PURE__ */ d(
|
|
3674
3677
|
tt,
|
|
3675
3678
|
{
|
|
3676
|
-
currentModel:
|
|
3679
|
+
currentModel: E || "",
|
|
3677
3680
|
models: oe,
|
|
3678
3681
|
modelsLoading: O,
|
|
3679
3682
|
modelsError: X,
|
|
@@ -3699,7 +3702,7 @@ const pi = ({ config: e }) => {
|
|
|
3699
3702
|
o === "selector" && /* @__PURE__ */ d(
|
|
3700
3703
|
tt,
|
|
3701
3704
|
{
|
|
3702
|
-
currentModel:
|
|
3705
|
+
currentModel: E || "",
|
|
3703
3706
|
models: oe,
|
|
3704
3707
|
modelsLoading: O,
|
|
3705
3708
|
modelsError: X,
|