react-semaphor 0.1.570 → 0.1.572
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/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{assistant-chat-B-Ddyy8b.js → assistant-chat-DF1-q82n.js} +182 -182
- package/dist/chunks/{bookmark-impact-DCYD-6Fr.js → bookmark-impact-fdj8fY9i.js} +2 -2
- package/dist/chunks/{bookmark-state-CflS88gq.js → bookmark-state-BEl_G9vr.js} +54 -54
- package/dist/chunks/{brand-B4BdpAB_.js → brand-BoUV0iHF.js} +1 -1
- package/dist/chunks/{card-filter-builder-0VvKmRst.js → card-filter-builder-BFT21WI-.js} +3 -3
- package/dist/chunks/{dashboard-briefing-launcher-B-quOOOQ.js → dashboard-briefing-launcher-DDXzTYuA.js} +873 -906
- package/dist/chunks/{dashboard-controls-Caodx80b.js → dashboard-controls-BwKQEoGp.js} +103 -103
- package/dist/chunks/{dashboard-DxGIr1vZ.js → dashboard-jUhZ7T4f.js} +1 -1
- package/dist/chunks/{dashboard-json-Ct-AGDHF.js → dashboard-json-B3fR1_Oc.js} +1 -1
- package/dist/chunks/{dates-B9mL8BHE.js → dates-DKkSDWHe.js} +5 -5
- package/dist/chunks/{edit-Bpdh_P_a.js → edit-9df1zOWe.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-DeDTuYB5.js → edit-dashboard-visual-DGZABdS-.js} +8 -8
- package/dist/chunks/{filter-reach-copy-BSY33ro5.js → filter-reach-copy-CWHV7GSb.js} +1195 -1261
- package/dist/chunks/{index-y3HUzRNk.js → index-CeeY4wjE.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-Yvhv3WX2.js → report-preferences-dialog-R3EGbxfu.js} +725 -801
- package/dist/chunks/{resolve-dashboard-input-context-Lkbwycwe.js → resolve-dashboard-input-context-CBQF3obr.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DC_TEd6y.js → saved-dashboard-context-_-7LKeK1.js} +3 -3
- package/dist/chunks/{semaphor-ready-indicator-ByFvqHEO.js → semaphor-ready-indicator-CEbA4CFb.js} +19866 -19758
- package/dist/chunks/{shelf-drop-preview-context-CjoVaK6J.js → shelf-drop-preview-context-UqUUVSJq.js} +259 -259
- package/dist/chunks/{stored-dashboard-C0hekXiI.js → stored-dashboard-Bk3iCXtp.js} +131 -131
- package/dist/chunks/{variable-draft-9-huI1h4.js → variable-draft-ggS3X7FG.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1919 -1853
- package/dist/index.js +147 -147
- package/dist/surfboard/index.js +2 -2
- package/dist/types/index.js +1 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +1 -1
- package/dist/types/lib/types/common-types.d.ts +0 -50
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +1 -2
- package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +6 -5
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +1 -2
- package/package.json +1 -1
|
@@ -2,24 +2,24 @@ var Zt = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var Jt = (e, t, a) => t.has(e) || Zt("Cannot " + a);
|
|
5
|
-
var
|
|
5
|
+
var j = (e, t, a) => (Jt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), ne = (e, t, a) => t.has(e) ? Zt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), Z = (e, t, a, r) => (Jt(e, t, "write to private field"), r ? r.call(e, a) : t.set(e, a), a);
|
|
6
6
|
import { jsx as d, jsxs as b, Fragment as Me } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback as K, useRef as X, useMemo as Ze, useEffect as ye, useState as $, useLayoutEffect as ke, useId as Zr } from "react";
|
|
8
|
-
import { u as J,
|
|
9
|
-
import { c as Re, B as
|
|
8
|
+
import { u as J, di as Jr, b3 as Kr, bn as Wr, a5 as Hr, dj as Gr, dk as Yr, a6 as Kt, b0 as Qr, dl as Xr, c0 as es, dm as ts, dn as _t, dp as as, dq as rs, dr as it, ds as Na, dt as ss, bW as lt, ci as Wt, du as Sa, a8 as ns, cc as Aa, bq as os, c5 as is, bV as Ca, dv as Ea, dw as ls, cF as ds, bw as cs, dx as us, dy as ps, dz as ms, cf as fs, cg as hs, dA as gs, ch as ys, cn as bs, dB as vs, c2 as ut, cm as xs, cr as ws, c4 as Ta, a_ as Ma, b1 as Is, bh as et, aY as ka, dC as Ns, dD as Ss, dE as As, dF as Cs, af as _a, dG as Es } from "./semaphor-ready-indicator-CEbA4CFb.js";
|
|
9
|
+
import { c as Re, B as U, X as Je, p as Oa, q as Ts, j as Ge, L as _e, I as Ra, R as Pa, e as Da, f as $a, h as Fa } from "./style-sheet-parts-C7qGZuH1.js";
|
|
10
10
|
import { g as Ms, c as L } from "./pickers-DkqmtnTL.js";
|
|
11
11
|
import "./validators-B8fpdinG.js";
|
|
12
12
|
import "./matrix-operation-contract-DCVinw1o.js";
|
|
13
13
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
14
14
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as ks } from "../value-format-preferences/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import { l as Os, m as Ke, c as wt, A as
|
|
17
|
-
import { p as Ht, a as Rs, A as La } from "./saved-dashboard-context-
|
|
18
|
-
import { fH as Ps, o as Ds, fI as Gt } from "./resolve-dashboard-input-context-
|
|
19
|
-
import {
|
|
20
|
-
import { m as
|
|
21
|
-
import { w as
|
|
22
|
-
import { m as Ls, v as
|
|
15
|
+
import { J as _s } from "./bookmark-state-BEl_G9vr.js";
|
|
16
|
+
import { l as Os, m as Ke, c as wt, A as ze, d as ja } from "./context-R31TSL5V.js";
|
|
17
|
+
import { p as Ht, a as Rs, A as La } from "./saved-dashboard-context-_-7LKeK1.js";
|
|
18
|
+
import { fH as Ps, o as Ds, fI as Gt } from "./resolve-dashboard-input-context-CBQF3obr.js";
|
|
19
|
+
import { u as Ba, i as $s } from "./report-preferences-dialog-R3EGbxfu.js";
|
|
20
|
+
import { m as Fs } from "./stored-dashboard-Bk3iCXtp.js";
|
|
21
|
+
import { w as js, c as za } from "./visual-choice-JiJ-_3bi.js";
|
|
22
|
+
import { m as Ls, v as Ua, t as Bs, n as zs, k as de, d as Us, b as qs, l as Ot, w as Vs, h as Zs, s as It, f as Js, a as Ks } from "./model-change-T1cRkh3m.js";
|
|
23
23
|
import { safeParseAsync as Ws, lazy as Hs, unknown as Gs, union as Ys, string as Qs, record as Xs, object as en, number as tn, null as an, never as rn, looseObject as sn, literal as nn, instanceof as on, enum as ln, discriminatedUnion as dn, custom as cn, boolean as un, array as pn } from "zod/v4";
|
|
24
24
|
import { toJSONSchema as mn } from "zod/v4/core";
|
|
25
25
|
import { aI as fn, aJ as hn, aK as gn, aL as tt, aM as yn, aN as Yt, aO as Qt, aP as Xt, aQ as ea, aR as ta, aS as bn, ad as vn, ab as xn } from "./temporal-input-presentation-CqbJjIuu.js";
|
|
@@ -208,7 +208,7 @@ function _n(e) {
|
|
|
208
208
|
console.warn("Adding the result without refreshed semantic metadata:", B);
|
|
209
209
|
}), v = structuredClone(J.getState().semanticExecutionPayload);
|
|
210
210
|
Hr(v, A);
|
|
211
|
-
const u =
|
|
211
|
+
const u = js(
|
|
212
212
|
E.config ?? {},
|
|
213
213
|
Pn(E, w, v, l)
|
|
214
214
|
), y = u === (E.config ?? {}) ? k : { ...k, cards: [{ ...E, config: u }] }, h = J.getState();
|
|
@@ -226,7 +226,7 @@ function _n(e) {
|
|
|
226
226
|
const pt = "The dashboard changed while this was being added. Try again.", On = "Changes to this dashboard can't be saved here, so the card wasn't added.";
|
|
227
227
|
function Rn(e, t, a) {
|
|
228
228
|
if (a !== "line" && a !== "bar" && a !== "stackedBar") return !0;
|
|
229
|
-
const r = Ua(
|
|
229
|
+
const r = za(Ua(t), a);
|
|
230
230
|
if (!r.ok) return !1;
|
|
231
231
|
const { x: s, y: l = [], series: i } = r.visual.encodings, p = Gr({ card: e, cardType: e.type, records: t.records }), g = (o, f, c) => JSON.stringify([o, f ?? null, [...c].sort()]);
|
|
232
232
|
return g(p.axisKeys, p.seriesKey, p.valueKeys) === g(s ? [s] : [], i, l);
|
|
@@ -245,7 +245,7 @@ function Za(e, t) {
|
|
|
245
245
|
}
|
|
246
246
|
function Pn(e, t, a, r) {
|
|
247
247
|
var i;
|
|
248
|
-
const s = Yr(J.getState()), l =
|
|
248
|
+
const s = Yr(J.getState()), l = Fs({
|
|
249
249
|
...s,
|
|
250
250
|
cardId: e.id,
|
|
251
251
|
cardOverride: e,
|
|
@@ -285,7 +285,7 @@ var W = class Ka extends Error {
|
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
287
|
const Wa = "AI_APICallError", Ha = `vercel.ai.error.${Wa}`, $n = Symbol.for(Ha);
|
|
288
|
-
var
|
|
288
|
+
var Fn = class extends W {
|
|
289
289
|
constructor({ message: e, url: t, requestBodyValues: a, statusCode: r, responseHeaders: s, responseBody: l, cause: i, isRetryable: p = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: g }) {
|
|
290
290
|
super({
|
|
291
291
|
name: Wa,
|
|
@@ -297,13 +297,13 @@ var jn = class extends W {
|
|
|
297
297
|
return W.hasMarker(e, Ha);
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
|
-
const Ga = "AI_EmptyResponseBodyError", Ya = `vercel.ai.error.${Ga}`,
|
|
300
|
+
const Ga = "AI_EmptyResponseBodyError", Ya = `vercel.ai.error.${Ga}`, jn = Symbol.for(Ya);
|
|
301
301
|
var sa = class extends W {
|
|
302
302
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
303
303
|
super({
|
|
304
304
|
name: Ga,
|
|
305
305
|
message: e
|
|
306
|
-
}), this[
|
|
306
|
+
}), this[jn] = !0;
|
|
307
307
|
}
|
|
308
308
|
static isInstance(e) {
|
|
309
309
|
return W.hasMarker(e, Ya);
|
|
@@ -325,7 +325,7 @@ var Bn = class extends W {
|
|
|
325
325
|
return W.hasMarker(t, er);
|
|
326
326
|
}
|
|
327
327
|
};
|
|
328
|
-
const tr = "AI_JSONParseError", ar = `vercel.ai.error.${tr}`,
|
|
328
|
+
const tr = "AI_JSONParseError", ar = `vercel.ai.error.${tr}`, zn = Symbol.for(ar);
|
|
329
329
|
var na = class extends W {
|
|
330
330
|
constructor({ text: e, cause: t }) {
|
|
331
331
|
super({
|
|
@@ -333,13 +333,13 @@ var na = class extends W {
|
|
|
333
333
|
message: `JSON parsing failed: Text: ${e}.
|
|
334
334
|
Error message: ${Qa(t)}`,
|
|
335
335
|
cause: t
|
|
336
|
-
}), this[
|
|
336
|
+
}), this[zn] = !0, this.text = e;
|
|
337
337
|
}
|
|
338
338
|
static isInstance(e) {
|
|
339
339
|
return W.hasMarker(e, ar);
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
-
const rr = "AI_TypeValidationError", sr = `vercel.ai.error.${rr}`,
|
|
342
|
+
const rr = "AI_TypeValidationError", sr = `vercel.ai.error.${rr}`, Un = Symbol.for(sr);
|
|
343
343
|
var nt = class Nt extends W {
|
|
344
344
|
constructor({ value: t, cause: a, context: r }) {
|
|
345
345
|
let s = "Type validation failed";
|
|
@@ -353,7 +353,7 @@ var nt = class Nt extends W {
|
|
|
353
353
|
message: `${s}: Value: ${JSON.stringify(t)}.
|
|
354
354
|
Error message: ${Qa(a)}`,
|
|
355
355
|
cause: a
|
|
356
|
-
}), this[
|
|
356
|
+
}), this[Un] = !0, this.value = t, this.context = r;
|
|
357
357
|
}
|
|
358
358
|
static isInstance(t) {
|
|
359
359
|
return W.hasMarker(t, sr);
|
|
@@ -480,7 +480,7 @@ ${B}`, c++;
|
|
|
480
480
|
}
|
|
481
481
|
const I = y.charCodeAt(h);
|
|
482
482
|
if (ia(y, h, I)) {
|
|
483
|
-
const
|
|
483
|
+
const z = y.charCodeAt(h + 5) === Ie ? h + 6 : h + 5, ce = y.slice(z, x);
|
|
484
484
|
f = c === 0 ? ce : `${f}
|
|
485
485
|
${ce}`, c++;
|
|
486
486
|
return;
|
|
@@ -490,14 +490,14 @@ ${ce}`, c++;
|
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
if (I === 105 && y.charCodeAt(h + 1) === 100 && y.charCodeAt(h + 2) === 58) {
|
|
493
|
-
const
|
|
494
|
-
|
|
493
|
+
const z = y.slice(y.charCodeAt(h + 3) === Ie ? h + 4 : h + 3, x);
|
|
494
|
+
z.includes("\0") || (o = z);
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
497
|
if (I === 58) {
|
|
498
498
|
if (s) {
|
|
499
|
-
const
|
|
500
|
-
s(
|
|
499
|
+
const z = y.slice(h, x);
|
|
500
|
+
s(z.slice(y.charCodeAt(h + 1) === Ie ? 2 : 1));
|
|
501
501
|
}
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
@@ -697,7 +697,7 @@ function te() {
|
|
|
697
697
|
function ao(e, t) {
|
|
698
698
|
var r, s, l;
|
|
699
699
|
const a = { type: "array" };
|
|
700
|
-
return (r = e.type) != null && r._def && ((l = (s = e.type) == null ? void 0 : s._def) == null ? void 0 : l.typeName) !== "ZodAny" && (a.items =
|
|
700
|
+
return (r = e.type) != null && r._def && ((l = (s = e.type) == null ? void 0 : s._def) == null ? void 0 : l.typeName) !== "ZodAny" && (a.items = F(e.type._def, {
|
|
701
701
|
...t,
|
|
702
702
|
currentPath: [...t.currentPath, "items"]
|
|
703
703
|
})), e.minLength && (a.minItems = e.minLength.value), e.maxLength && (a.maxItems = e.maxLength.value), e.exactLength && (a.minItems = e.exactLength.value, a.maxItems = e.exactLength.value), a;
|
|
@@ -724,9 +724,9 @@ function so() {
|
|
|
724
724
|
return { type: "boolean" };
|
|
725
725
|
}
|
|
726
726
|
function ir(e, t) {
|
|
727
|
-
return
|
|
727
|
+
return F(e.type._def, t);
|
|
728
728
|
}
|
|
729
|
-
const no = (e, t) =>
|
|
729
|
+
const no = (e, t) => F(e.innerType._def, t);
|
|
730
730
|
function lr(e, t, a) {
|
|
731
731
|
const r = a ?? t.dateStrategy;
|
|
732
732
|
if (Array.isArray(r)) return { anyOf: r.map((s) => lr(e, t, s)) };
|
|
@@ -762,12 +762,12 @@ const oo = (e) => {
|
|
|
762
762
|
};
|
|
763
763
|
function io(e, t) {
|
|
764
764
|
return {
|
|
765
|
-
...
|
|
765
|
+
...F(e.innerType._def, t),
|
|
766
766
|
default: e.defaultValue()
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
769
|
function lo(e, t) {
|
|
770
|
-
return t.effectStrategy === "input" ?
|
|
770
|
+
return t.effectStrategy === "input" ? F(e.schema._def, t) : te();
|
|
771
771
|
}
|
|
772
772
|
function co(e) {
|
|
773
773
|
return {
|
|
@@ -777,14 +777,14 @@ function co(e) {
|
|
|
777
777
|
}
|
|
778
778
|
const uo = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
779
779
|
function po(e, t) {
|
|
780
|
-
const a = [
|
|
780
|
+
const a = [F(e.left._def, {
|
|
781
781
|
...t,
|
|
782
782
|
currentPath: [
|
|
783
783
|
...t.currentPath,
|
|
784
784
|
"allOf",
|
|
785
785
|
"0"
|
|
786
786
|
]
|
|
787
|
-
}),
|
|
787
|
+
}), F(e.right._def, {
|
|
788
788
|
...t,
|
|
789
789
|
currentPath: [
|
|
790
790
|
...t.currentPath,
|
|
@@ -1028,7 +1028,7 @@ function cr(e, t) {
|
|
|
1028
1028
|
var r, s, l, i, p;
|
|
1029
1029
|
const a = {
|
|
1030
1030
|
type: "object",
|
|
1031
|
-
additionalProperties:
|
|
1031
|
+
additionalProperties: F(e.valueType._def, {
|
|
1032
1032
|
...t,
|
|
1033
1033
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
1034
1034
|
}) ?? t.allowedAdditionalProperties
|
|
@@ -1060,7 +1060,7 @@ function go(e, t) {
|
|
|
1060
1060
|
maxItems: 125,
|
|
1061
1061
|
items: {
|
|
1062
1062
|
type: "array",
|
|
1063
|
-
items: [
|
|
1063
|
+
items: [F(e.keyType._def, {
|
|
1064
1064
|
...t,
|
|
1065
1065
|
currentPath: [
|
|
1066
1066
|
...t.currentPath,
|
|
@@ -1068,7 +1068,7 @@ function go(e, t) {
|
|
|
1068
1068
|
"items",
|
|
1069
1069
|
"0"
|
|
1070
1070
|
]
|
|
1071
|
-
}) || te(),
|
|
1071
|
+
}) || te(), F(e.valueType._def, {
|
|
1072
1072
|
...t,
|
|
1073
1073
|
currentPath: [
|
|
1074
1074
|
...t.currentPath,
|
|
@@ -1140,7 +1140,7 @@ function xo(e, t) {
|
|
|
1140
1140
|
return wo(e, t);
|
|
1141
1141
|
}
|
|
1142
1142
|
const wo = (e, t) => {
|
|
1143
|
-
const a = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((r, s) =>
|
|
1143
|
+
const a = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((r, s) => F(r._def, {
|
|
1144
1144
|
...t,
|
|
1145
1145
|
currentPath: [
|
|
1146
1146
|
...t.currentPath,
|
|
@@ -1158,7 +1158,7 @@ function Io(e, t) {
|
|
|
1158
1158
|
"ZodBoolean",
|
|
1159
1159
|
"ZodNull"
|
|
1160
1160
|
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [St[e.innerType._def.typeName], "null"] };
|
|
1161
|
-
const a =
|
|
1161
|
+
const a = F(e.innerType._def, {
|
|
1162
1162
|
...t,
|
|
1163
1163
|
currentPath: [
|
|
1164
1164
|
...t.currentPath,
|
|
@@ -1194,7 +1194,7 @@ function So(e, t) {
|
|
|
1194
1194
|
for (const i in s) {
|
|
1195
1195
|
let p = s[i];
|
|
1196
1196
|
if (p === void 0 || p._def === void 0) continue;
|
|
1197
|
-
const g = Co(p), o =
|
|
1197
|
+
const g = Co(p), o = F(p._def, {
|
|
1198
1198
|
...t,
|
|
1199
1199
|
currentPath: [
|
|
1200
1200
|
...t.currentPath,
|
|
@@ -1214,7 +1214,7 @@ function So(e, t) {
|
|
|
1214
1214
|
return l !== void 0 && (a.additionalProperties = l), a;
|
|
1215
1215
|
}
|
|
1216
1216
|
function Ao(e, t) {
|
|
1217
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
1217
|
+
if (e.catchall._def.typeName !== "ZodNever") return F(e.catchall._def, {
|
|
1218
1218
|
...t,
|
|
1219
1219
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
1220
1220
|
});
|
|
@@ -1236,8 +1236,8 @@ function Co(e) {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
const Eo = (e, t) => {
|
|
1238
1238
|
var r;
|
|
1239
|
-
if (t.currentPath.toString() === ((r = t.propertyPath) == null ? void 0 : r.toString())) return
|
|
1240
|
-
const a =
|
|
1239
|
+
if (t.currentPath.toString() === ((r = t.propertyPath) == null ? void 0 : r.toString())) return F(e.innerType._def, t);
|
|
1240
|
+
const a = F(e.innerType._def, {
|
|
1241
1241
|
...t,
|
|
1242
1242
|
currentPath: [
|
|
1243
1243
|
...t.currentPath,
|
|
@@ -1247,9 +1247,9 @@ const Eo = (e, t) => {
|
|
|
1247
1247
|
});
|
|
1248
1248
|
return a ? { anyOf: [{ not: te() }, a] } : te();
|
|
1249
1249
|
}, To = (e, t) => {
|
|
1250
|
-
if (t.pipeStrategy === "input") return
|
|
1251
|
-
if (t.pipeStrategy === "output") return
|
|
1252
|
-
const a =
|
|
1250
|
+
if (t.pipeStrategy === "input") return F(e.in._def, t);
|
|
1251
|
+
if (t.pipeStrategy === "output") return F(e.out._def, t);
|
|
1252
|
+
const a = F(e.in._def, {
|
|
1253
1253
|
...t,
|
|
1254
1254
|
currentPath: [
|
|
1255
1255
|
...t.currentPath,
|
|
@@ -1257,7 +1257,7 @@ const Eo = (e, t) => {
|
|
|
1257
1257
|
"0"
|
|
1258
1258
|
]
|
|
1259
1259
|
});
|
|
1260
|
-
return { allOf: [a,
|
|
1260
|
+
return { allOf: [a, F(e.out._def, {
|
|
1261
1261
|
...t,
|
|
1262
1262
|
currentPath: [
|
|
1263
1263
|
...t.currentPath,
|
|
@@ -1267,13 +1267,13 @@ const Eo = (e, t) => {
|
|
|
1267
1267
|
})].filter((r) => r !== void 0) };
|
|
1268
1268
|
};
|
|
1269
1269
|
function Mo(e, t) {
|
|
1270
|
-
return
|
|
1270
|
+
return F(e.type._def, t);
|
|
1271
1271
|
}
|
|
1272
1272
|
function ko(e, t) {
|
|
1273
1273
|
const a = {
|
|
1274
1274
|
type: "array",
|
|
1275
1275
|
uniqueItems: !0,
|
|
1276
|
-
items:
|
|
1276
|
+
items: F(e.valueType._def, {
|
|
1277
1277
|
...t,
|
|
1278
1278
|
currentPath: [...t.currentPath, "items"]
|
|
1279
1279
|
})
|
|
@@ -1284,7 +1284,7 @@ function _o(e, t) {
|
|
|
1284
1284
|
return e.rest ? {
|
|
1285
1285
|
type: "array",
|
|
1286
1286
|
minItems: e.items.length,
|
|
1287
|
-
items: e.items.map((a, r) =>
|
|
1287
|
+
items: e.items.map((a, r) => F(a._def, {
|
|
1288
1288
|
...t,
|
|
1289
1289
|
currentPath: [
|
|
1290
1290
|
...t.currentPath,
|
|
@@ -1292,7 +1292,7 @@ function _o(e, t) {
|
|
|
1292
1292
|
`${r}`
|
|
1293
1293
|
]
|
|
1294
1294
|
})).reduce((a, r) => r === void 0 ? a : [...a, r], []),
|
|
1295
|
-
additionalItems:
|
|
1295
|
+
additionalItems: F(e.rest._def, {
|
|
1296
1296
|
...t,
|
|
1297
1297
|
currentPath: [...t.currentPath, "additionalItems"]
|
|
1298
1298
|
})
|
|
@@ -1300,7 +1300,7 @@ function _o(e, t) {
|
|
|
1300
1300
|
type: "array",
|
|
1301
1301
|
minItems: e.items.length,
|
|
1302
1302
|
maxItems: e.items.length,
|
|
1303
|
-
items: e.items.map((a, r) =>
|
|
1303
|
+
items: e.items.map((a, r) => F(a._def, {
|
|
1304
1304
|
...t,
|
|
1305
1305
|
currentPath: [
|
|
1306
1306
|
...t.currentPath,
|
|
@@ -1316,7 +1316,7 @@ function Oo() {
|
|
|
1316
1316
|
function Ro() {
|
|
1317
1317
|
return te();
|
|
1318
1318
|
}
|
|
1319
|
-
const Po = (e, t) =>
|
|
1319
|
+
const Po = (e, t) => F(e.innerType._def, t), Do = (e, t, a) => {
|
|
1320
1320
|
switch (t) {
|
|
1321
1321
|
case "ZodString":
|
|
1322
1322
|
return dr(e, a);
|
|
@@ -1395,7 +1395,7 @@ const Po = (e, t) => j(e.innerType._def, t), Do = (e, t, a) => {
|
|
|
1395
1395
|
for (; a < e.length && a < t.length && e[a] === t[a]; a++) ;
|
|
1396
1396
|
return [(e.length - a).toString(), ...t.slice(a)].join("/");
|
|
1397
1397
|
};
|
|
1398
|
-
function
|
|
1398
|
+
function F(e, t, a = !1) {
|
|
1399
1399
|
var p;
|
|
1400
1400
|
const r = t.seen.get(e);
|
|
1401
1401
|
if (t.override) {
|
|
@@ -1403,7 +1403,7 @@ function j(e, t, a = !1) {
|
|
|
1403
1403
|
if (g !== eo) return g;
|
|
1404
1404
|
}
|
|
1405
1405
|
if (r && !a) {
|
|
1406
|
-
const g =
|
|
1406
|
+
const g = Fo(r, t);
|
|
1407
1407
|
if (g !== void 0) return g;
|
|
1408
1408
|
}
|
|
1409
1409
|
const s = {
|
|
@@ -1412,14 +1412,14 @@ function j(e, t, a = !1) {
|
|
|
1412
1412
|
jsonSchema: void 0
|
|
1413
1413
|
};
|
|
1414
1414
|
t.seen.set(e, s);
|
|
1415
|
-
const l = Do(e, e.typeName, t), i = typeof l == "function" ?
|
|
1416
|
-
if (i &&
|
|
1415
|
+
const l = Do(e, e.typeName, t), i = typeof l == "function" ? F(l(), t) : l;
|
|
1416
|
+
if (i && jo(e, t, i), t.postProcess) {
|
|
1417
1417
|
const g = t.postProcess(i, e, t);
|
|
1418
1418
|
return s.jsonSchema = i, g;
|
|
1419
1419
|
}
|
|
1420
1420
|
return s.jsonSchema = i, i;
|
|
1421
1421
|
}
|
|
1422
|
-
const
|
|
1422
|
+
const Fo = (e, t) => {
|
|
1423
1423
|
switch (t.$refStrategy) {
|
|
1424
1424
|
case "root":
|
|
1425
1425
|
return { $ref: e.path.join("/") };
|
|
@@ -1429,7 +1429,7 @@ const jo = (e, t) => {
|
|
|
1429
1429
|
case "seen":
|
|
1430
1430
|
return e.path.length < t.currentPath.length && e.path.every((a, r) => t.currentPath[r] === a) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), te()) : t.$refStrategy === "seen" ? te() : void 0;
|
|
1431
1431
|
}
|
|
1432
|
-
},
|
|
1432
|
+
}, jo = (e, t, a) => (e.description && (a.description = e.description), a), Lo = (e) => {
|
|
1433
1433
|
const t = to(e), a = t.name !== void 0 ? [
|
|
1434
1434
|
...t.basePath,
|
|
1435
1435
|
t.definitionPath,
|
|
@@ -1453,7 +1453,7 @@ const jo = (e, t) => {
|
|
|
1453
1453
|
const a = Lo(t);
|
|
1454
1454
|
let r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((g, [o, f]) => ({
|
|
1455
1455
|
...g,
|
|
1456
|
-
[o]:
|
|
1456
|
+
[o]: F(f._def, {
|
|
1457
1457
|
...a,
|
|
1458
1458
|
currentPath: [
|
|
1459
1459
|
...a.basePath,
|
|
@@ -1462,7 +1462,7 @@ const jo = (e, t) => {
|
|
|
1462
1462
|
]
|
|
1463
1463
|
}, !0) ?? te()
|
|
1464
1464
|
}), {}) : void 0;
|
|
1465
|
-
const s = typeof t == "string" ? t : (t == null ? void 0 : t.nameStrategy) === "title" || t == null ? void 0 : t.name, l =
|
|
1465
|
+
const s = typeof t == "string" ? t : (t == null ? void 0 : t.nameStrategy) === "title" || t == null ? void 0 : t.name, l = F(e._def, s === void 0 ? a : {
|
|
1466
1466
|
...a,
|
|
1467
1467
|
currentPath: [
|
|
1468
1468
|
...a.basePath,
|
|
@@ -1487,7 +1487,7 @@ const jo = (e, t) => {
|
|
|
1487
1487
|
};
|
|
1488
1488
|
return p.$schema = "http://json-schema.org/draft-07/schema#", p;
|
|
1489
1489
|
}, At = Symbol.for("vercel.ai.schema");
|
|
1490
|
-
function
|
|
1490
|
+
function zo(e) {
|
|
1491
1491
|
let t;
|
|
1492
1492
|
return () => (t == null && (t = e()), t);
|
|
1493
1493
|
}
|
|
@@ -1501,7 +1501,7 @@ function dt(e, { validate: t } = {}) {
|
|
|
1501
1501
|
validate: t
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1504
|
+
function Uo(e) {
|
|
1505
1505
|
return typeof e == "object" && e !== null && At in e && e[At] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1506
1506
|
}
|
|
1507
1507
|
function qo(e) {
|
|
@@ -1509,7 +1509,7 @@ function qo(e) {
|
|
|
1509
1509
|
type: "object",
|
|
1510
1510
|
properties: {},
|
|
1511
1511
|
additionalProperties: !1
|
|
1512
|
-
}) :
|
|
1512
|
+
}) : Uo(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? ur(e) : Vo(e) : e();
|
|
1513
1513
|
}
|
|
1514
1514
|
function Vo(e) {
|
|
1515
1515
|
return dt(() => {
|
|
@@ -1643,7 +1643,7 @@ function Ho({ stream: e, schema: t }) {
|
|
|
1643
1643
|
}));
|
|
1644
1644
|
} }));
|
|
1645
1645
|
}
|
|
1646
|
-
async function
|
|
1646
|
+
async function Fe(e) {
|
|
1647
1647
|
return typeof e == "function" && (e = e()), e;
|
|
1648
1648
|
}
|
|
1649
1649
|
new TextDecoder();
|
|
@@ -2176,7 +2176,7 @@ H({
|
|
|
2176
2176
|
});
|
|
2177
2177
|
}
|
|
2178
2178
|
});
|
|
2179
|
-
const qe = n.record(n.string(), Oe.optional()), mi =
|
|
2179
|
+
const qe = n.record(n.string(), Oe.optional()), mi = zo(() => ur(n.union([
|
|
2180
2180
|
n.looseObject({
|
|
2181
2181
|
type: n.literal("text-start"),
|
|
2182
2182
|
id: n.string(),
|
|
@@ -2362,7 +2362,7 @@ const qe = n.record(n.string(), Oe.optional()), mi = Uo(() => ur(n.union([
|
|
|
2362
2362
|
function fi(e) {
|
|
2363
2363
|
return e.type.startsWith("data-");
|
|
2364
2364
|
}
|
|
2365
|
-
function
|
|
2365
|
+
function je() {
|
|
2366
2366
|
return /* @__PURE__ */ Object.create(null);
|
|
2367
2367
|
}
|
|
2368
2368
|
function ot(e) {
|
|
@@ -2383,7 +2383,7 @@ function Ir({ lastMessage: e, messageId: t }) {
|
|
|
2383
2383
|
metadata: void 0,
|
|
2384
2384
|
role: "assistant",
|
|
2385
2385
|
parts: []
|
|
2386
|
-
}, r =
|
|
2386
|
+
}, r = je(), s = a.parts.findLastIndex((i) => i.type === "step-start");
|
|
2387
2387
|
let l = 0;
|
|
2388
2388
|
for (const i of a.parts.slice(s + 1)) {
|
|
2389
2389
|
if (!le(i)) continue;
|
|
@@ -2399,8 +2399,8 @@ function Ir({ lastMessage: e, messageId: t }) {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
return {
|
|
2401
2401
|
message: a,
|
|
2402
|
-
activeTextParts:
|
|
2403
|
-
activeReasoningParts:
|
|
2402
|
+
activeTextParts: je(),
|
|
2403
|
+
activeReasoningParts: je(),
|
|
2404
2404
|
partialToolCalls: r
|
|
2405
2405
|
};
|
|
2406
2406
|
}
|
|
@@ -2800,7 +2800,7 @@ function gi({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2800
2800
|
break;
|
|
2801
2801
|
case "reset-step": {
|
|
2802
2802
|
const u = w();
|
|
2803
|
-
c.activeTextParts =
|
|
2803
|
+
c.activeTextParts = je(), c.activeReasoningParts = je(), c.partialToolCalls = je(), u.length > 0 && (c.message.parts.splice(c.message.parts.length - u.length, u.length), m());
|
|
2804
2804
|
break;
|
|
2805
2805
|
}
|
|
2806
2806
|
case "start":
|
|
@@ -2980,7 +2980,7 @@ H({
|
|
|
2980
2980
|
});
|
|
2981
2981
|
async function ma({ response: e, url: t, fallbackMessage: a }) {
|
|
2982
2982
|
const r = await e.text();
|
|
2983
|
-
return new
|
|
2983
|
+
return new Fn({
|
|
2984
2984
|
message: r || a,
|
|
2985
2985
|
url: t,
|
|
2986
2986
|
requestBodyValues: void 0,
|
|
@@ -3020,7 +3020,7 @@ var Ii = class {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
3022
3022
|
var m;
|
|
3023
|
-
const a = await
|
|
3023
|
+
const a = await Fe(this.body), r = await Fe(this.headers), s = await Fe(this.credentials), l = {
|
|
3024
3024
|
...$e(r),
|
|
3025
3025
|
...$e(t.headers)
|
|
3026
3026
|
}, i = await ((m = this.prepareSendMessagesRequest) == null ? void 0 : m.call(this, {
|
|
@@ -3063,7 +3063,7 @@ var Ii = class {
|
|
|
3063
3063
|
}
|
|
3064
3064
|
async reconnectToStream(e) {
|
|
3065
3065
|
var f;
|
|
3066
|
-
const t = await
|
|
3066
|
+
const t = await Fe(this.body), a = await Fe(this.headers), r = await Fe(this.credentials), s = {
|
|
3067
3067
|
...$e(a),
|
|
3068
3068
|
...$e(e.headers)
|
|
3069
3069
|
}, l = await ((f = this.prepareReconnectToStreamRequest) == null ? void 0 : f.call(this, {
|
|
@@ -3511,15 +3511,15 @@ var ee, Le, Be, Ae, Ce, Ee, ge, We, He, wa, Mi = (wa = class {
|
|
|
3511
3511
|
ne(this, We);
|
|
3512
3512
|
ne(this, He);
|
|
3513
3513
|
Z(this, Le, "ready"), Z(this, Be, void 0), Z(this, Ae, /* @__PURE__ */ new Set()), Z(this, Ce, /* @__PURE__ */ new Set()), Z(this, Ee, /* @__PURE__ */ new Set()), this.pushMessage = (t) => {
|
|
3514
|
-
Z(this, ee,
|
|
3514
|
+
Z(this, ee, j(this, ee).concat(t)), j(this, ge).call(this);
|
|
3515
3515
|
}, this.popMessage = () => {
|
|
3516
|
-
Z(this, ee,
|
|
3516
|
+
Z(this, ee, j(this, ee).slice(0, -1)), j(this, ge).call(this);
|
|
3517
3517
|
}, this.replaceMessage = (t, a) => {
|
|
3518
3518
|
Z(this, ee, [
|
|
3519
|
-
...
|
|
3519
|
+
...j(this, ee).slice(0, t),
|
|
3520
3520
|
this.snapshot(a),
|
|
3521
|
-
...
|
|
3522
|
-
]),
|
|
3521
|
+
...j(this, ee).slice(t + 1)
|
|
3522
|
+
]), j(this, ge).call(this);
|
|
3523
3523
|
}, this.snapshot = (t) => {
|
|
3524
3524
|
if (t == null || typeof t != "object" || !("parts" in t) || !Array.isArray(t.parts)) return t;
|
|
3525
3525
|
const a = t, r = {
|
|
@@ -3529,38 +3529,38 @@ var ee, Le, Be, Ae, Ce, Ee, ge, We, He, wa, Mi = (wa = class {
|
|
|
3529
3529
|
return "metadata" in a && (r.metadata = Ti(a.metadata)), r;
|
|
3530
3530
|
}, this["~registerMessagesCallback"] = (t, a) => {
|
|
3531
3531
|
const r = a ? Ei(t, a) : t;
|
|
3532
|
-
return
|
|
3533
|
-
|
|
3532
|
+
return j(this, Ae).add(r), () => {
|
|
3533
|
+
j(this, Ae).delete(r);
|
|
3534
3534
|
};
|
|
3535
|
-
}, this["~registerStatusCallback"] = (t) => (
|
|
3536
|
-
|
|
3537
|
-
}), this["~registerErrorCallback"] = (t) => (
|
|
3538
|
-
|
|
3535
|
+
}, this["~registerStatusCallback"] = (t) => (j(this, Ce).add(t), () => {
|
|
3536
|
+
j(this, Ce).delete(t);
|
|
3537
|
+
}), this["~registerErrorCallback"] = (t) => (j(this, Ee).add(t), () => {
|
|
3538
|
+
j(this, Ee).delete(t);
|
|
3539
3539
|
}), Z(this, ge, () => {
|
|
3540
|
-
|
|
3540
|
+
j(this, Ae).forEach((t) => t());
|
|
3541
3541
|
}), Z(this, We, () => {
|
|
3542
|
-
|
|
3542
|
+
j(this, Ce).forEach((t) => t());
|
|
3543
3543
|
}), Z(this, He, () => {
|
|
3544
|
-
|
|
3544
|
+
j(this, Ee).forEach((t) => t());
|
|
3545
3545
|
}), Z(this, ee, e);
|
|
3546
3546
|
}
|
|
3547
3547
|
get status() {
|
|
3548
|
-
return
|
|
3548
|
+
return j(this, Le);
|
|
3549
3549
|
}
|
|
3550
3550
|
set status(e) {
|
|
3551
|
-
Z(this, Le, e),
|
|
3551
|
+
Z(this, Le, e), j(this, We).call(this);
|
|
3552
3552
|
}
|
|
3553
3553
|
get error() {
|
|
3554
|
-
return
|
|
3554
|
+
return j(this, Be);
|
|
3555
3555
|
}
|
|
3556
3556
|
set error(e) {
|
|
3557
|
-
Z(this, Be, e),
|
|
3557
|
+
Z(this, Be, e), j(this, He).call(this);
|
|
3558
3558
|
}
|
|
3559
3559
|
get messages() {
|
|
3560
|
-
return
|
|
3560
|
+
return j(this, ee);
|
|
3561
3561
|
}
|
|
3562
3562
|
set messages(e) {
|
|
3563
|
-
Z(this, ee, [...e]),
|
|
3563
|
+
Z(this, ee, [...e]), j(this, ge).call(this);
|
|
3564
3564
|
}
|
|
3565
3565
|
}, ee = new WeakMap(), Le = new WeakMap(), Be = new WeakMap(), Ae = new WeakMap(), Ce = new WeakMap(), Ee = new WeakMap(), ge = new WeakMap(), We = new WeakMap(), He = new WeakMap(), wa), Te, Ia, Nr = (Ia = class extends Ni {
|
|
3566
3566
|
constructor({ messages: t, ...a }) {
|
|
@@ -3570,7 +3570,7 @@ var ee, Le, Be, Ae, Ce, Ee, ge, We, He, wa, Mi = (wa = class {
|
|
|
3570
3570
|
state: r
|
|
3571
3571
|
});
|
|
3572
3572
|
ne(this, Te);
|
|
3573
|
-
this["~registerMessagesCallback"] = (s, l) =>
|
|
3573
|
+
this["~registerMessagesCallback"] = (s, l) => j(this, Te)["~registerMessagesCallback"](s, l), this["~registerStatusCallback"] = (s) => j(this, Te)["~registerStatusCallback"](s), this["~registerErrorCallback"] = (s) => j(this, Te)["~registerErrorCallback"](s), Z(this, Te, r);
|
|
3574
3574
|
}
|
|
3575
3575
|
}, Te = new WeakMap(), Ia);
|
|
3576
3576
|
const yt = /* @__PURE__ */ new WeakMap();
|
|
@@ -3683,7 +3683,7 @@ function _i({ throttle: e, experimental_throttle: t, resume: a = !1, ...r } = {}
|
|
|
3683
3683
|
addToolApprovalResponse: c.addToolApprovalResponse
|
|
3684
3684
|
};
|
|
3685
3685
|
}
|
|
3686
|
-
class
|
|
3686
|
+
class Ue extends Error {
|
|
3687
3687
|
constructor(t, a = {}) {
|
|
3688
3688
|
super(Os(t, a)), this.code = t, this.name = "AssistantTurnRefusedError";
|
|
3689
3689
|
}
|
|
@@ -3693,7 +3693,7 @@ const $t = async (e, t) => {
|
|
|
3693
3693
|
if (a.ok) return a;
|
|
3694
3694
|
const r = await a.json().catch(() => {
|
|
3695
3695
|
}), s = typeof (r == null ? void 0 : r.code) == "string" && r.code in Ke ? r.code : a.status === 401 || a.status === 403 ? "assistant_unavailable" : "model_unavailable", l = r == null ? void 0 : r.dailyLimit;
|
|
3696
|
-
throw new
|
|
3696
|
+
throw new Ue(
|
|
3697
3697
|
s,
|
|
3698
3698
|
Number.isInteger(l) && l > 0 ? { dailyLimit: l } : {}
|
|
3699
3699
|
);
|
|
@@ -3702,14 +3702,14 @@ async function Mt(e, t) {
|
|
|
3702
3702
|
await e.cancelQueries({ queryKey: t }), await e.invalidateQueries({ queryKey: t });
|
|
3703
3703
|
}
|
|
3704
3704
|
async function Oi(e, t) {
|
|
3705
|
-
return (await
|
|
3705
|
+
return (await Ft(e, "sources", t)).sources;
|
|
3706
3706
|
}
|
|
3707
3707
|
async function Ri(e, t) {
|
|
3708
|
-
return (await
|
|
3708
|
+
return (await Ft(e, "conversations", t)).conversations;
|
|
3709
3709
|
}
|
|
3710
3710
|
function ha(e, t, a, r = {}) {
|
|
3711
3711
|
const s = r.toolCalls ? "?include=toolCalls" : "";
|
|
3712
|
-
return
|
|
3712
|
+
return Ft(e, `conversations/${encodeURIComponent(t)}${s}`, a);
|
|
3713
3713
|
}
|
|
3714
3714
|
async function Pi(e, t) {
|
|
3715
3715
|
try {
|
|
@@ -3718,7 +3718,7 @@ async function Pi(e, t) {
|
|
|
3718
3718
|
headers: { Authorization: `Bearer ${e.accessToken}` }
|
|
3719
3719
|
});
|
|
3720
3720
|
} catch (a) {
|
|
3721
|
-
if (a instanceof
|
|
3721
|
+
if (a instanceof Ue && a.code === "conversation_not_found") return;
|
|
3722
3722
|
throw a;
|
|
3723
3723
|
}
|
|
3724
3724
|
}
|
|
@@ -3732,18 +3732,18 @@ async function Di(e, t) {
|
|
|
3732
3732
|
});
|
|
3733
3733
|
return { ok: !1, ...typeof (r == null ? void 0 : r.code) == "string" ? { code: r.code } : {} };
|
|
3734
3734
|
}
|
|
3735
|
-
async function
|
|
3735
|
+
async function Ft(e, t, a) {
|
|
3736
3736
|
return await (await $t(`${e.apiServiceUrl}/v1/assistant/${t}`, {
|
|
3737
3737
|
headers: { Authorization: `Bearer ${e.accessToken}` },
|
|
3738
3738
|
...a ? { signal: a } : {}
|
|
3739
3739
|
})).json();
|
|
3740
3740
|
}
|
|
3741
|
-
const $i = {},
|
|
3741
|
+
const $i = {}, Fi = {}, ji = "something went wrong while applying it.";
|
|
3742
3742
|
function Se(e, t, a, r) {
|
|
3743
3743
|
return { ...e, [t]: { ...e[t], [a]: r } };
|
|
3744
3744
|
}
|
|
3745
3745
|
const Li = "Could not open this conversation. Try again.", Bi = "A field you tagged is no longer on this card. Remove it and ask again.";
|
|
3746
|
-
function
|
|
3746
|
+
function zi(e) {
|
|
3747
3747
|
const t = X(e);
|
|
3748
3748
|
ke(() => {
|
|
3749
3749
|
t.current = e;
|
|
@@ -3782,7 +3782,7 @@ function Ui(e) {
|
|
|
3782
3782
|
{ stillWanted: () => a.current === T }
|
|
3783
3783
|
) : se;
|
|
3784
3784
|
} catch (fe) {
|
|
3785
|
-
console.warn("The change could not be applied:", fe), G = { ok: !1, reason: "refused", message:
|
|
3785
|
+
console.warn("The change could not be applied:", fe), G = { ok: !1, reason: "refused", message: ji };
|
|
3786
3786
|
}
|
|
3787
3787
|
if (G.ok && T.appliedAfter.set(O.proposalId, G.after), !G.ok && G.reason === "dropped") return;
|
|
3788
3788
|
const xe = G.ok ? { status: "applied" } : { status: "refused", reason: G.reason, message: G.message };
|
|
@@ -3824,12 +3824,12 @@ function Ui(e) {
|
|
|
3824
3824
|
...D.cardReplay ?? {},
|
|
3825
3825
|
...T.length ? { taggedFields: T } : {}
|
|
3826
3826
|
};
|
|
3827
|
-
if (wt({ ...ae, message: O }) >
|
|
3828
|
-
return A(new
|
|
3827
|
+
if (wt({ ...ae, message: O }) > ze.requestBytes)
|
|
3828
|
+
return A(new ja(wt(ae)).message), "not_sent";
|
|
3829
3829
|
A(void 0);
|
|
3830
3830
|
const re = (se = D.context.selectedCard) == null ? void 0 : se.id;
|
|
3831
3831
|
re && (m.aboutCardId = re);
|
|
3832
|
-
const V =
|
|
3832
|
+
const V = Ui(D.context, ((xe = (G = t.current).canChangeOpenDashboard) == null ? void 0 : xe.call(G)) ?? !1);
|
|
3833
3833
|
return m.answerBase = V, m.proposals.clear(), m.appliedAfter.clear(), m.chat.sendMessage(
|
|
3834
3834
|
{ text: O, ...T.length ? { metadata: { taggedFields: T } } : {} },
|
|
3835
3835
|
{ body: V ? { ...ae, openDashboard: V } : ae }
|
|
@@ -3855,7 +3855,7 @@ function Ui(e) {
|
|
|
3855
3855
|
const T = m.chat.id, O = (re = l[T]) == null ? void 0 : re[P];
|
|
3856
3856
|
if ((O == null ? void 0 : O.status) !== "offered") return;
|
|
3857
3857
|
i((V) => Se(V, T, P, { status: "adding" }));
|
|
3858
|
-
const D = await Di(c.connection(), P).catch((V) => (console.warn("The relationship could not be added:", V), { ok: !1, code: void 0 })), ae = D.ok ? { status: "added" } : { status: "refused", message:
|
|
3858
|
+
const D = await Di(c.connection(), P).catch((V) => (console.warn("The relationship could not be added:", V), { ok: !1, code: void 0 })), ae = D.ok ? { status: "added" } : { status: "refused", message: zs(D.code) };
|
|
3859
3859
|
i((V) => Se(V, T, P, ae));
|
|
3860
3860
|
},
|
|
3861
3861
|
[m, c, l]
|
|
@@ -3864,7 +3864,7 @@ function Ui(e) {
|
|
|
3864
3864
|
i((T) => Se(T, m.chat.id, P, { status: "dismissed" }));
|
|
3865
3865
|
},
|
|
3866
3866
|
[m]
|
|
3867
|
-
),
|
|
3867
|
+
), z = K(() => void m.chat.stop(), [m]), ce = K(() => {
|
|
3868
3868
|
I(), A(void 0), w(bt(c)), u([]);
|
|
3869
3869
|
}, [I, c]), be = K(
|
|
3870
3870
|
(P, T) => {
|
|
@@ -3890,7 +3890,7 @@ function Ui(e) {
|
|
|
3890
3890
|
return T.signal.aborted ? "not_opened" : (w(bt(c, D)), u(D.addedSources), D.allows && f(D.allows), "opened");
|
|
3891
3891
|
} catch (D) {
|
|
3892
3892
|
return T.signal.aborted || A(
|
|
3893
|
-
D instanceof
|
|
3893
|
+
D instanceof Ue && D.code !== "model_unavailable" ? D.message : Li
|
|
3894
3894
|
), "not_opened";
|
|
3895
3895
|
} finally {
|
|
3896
3896
|
y.current === T && (y.current = void 0, x(!1));
|
|
@@ -3910,7 +3910,7 @@ function Ui(e) {
|
|
|
3910
3910
|
proposalStates: r[m.chat.id] ?? $i,
|
|
3911
3911
|
undoProposal: q,
|
|
3912
3912
|
/** Where this session's proposed relationships stand; none for a reopened conversation. */
|
|
3913
|
-
modelChangeStates: l[m.chat.id] ??
|
|
3913
|
+
modelChangeStates: l[m.chat.id] ?? Fi,
|
|
3914
3914
|
addModelChange: Pe,
|
|
3915
3915
|
dismissModelChange: De,
|
|
3916
3916
|
/** A stored conversation is loading; sending waits. */
|
|
@@ -3928,18 +3928,18 @@ function Ui(e) {
|
|
|
3928
3928
|
clearNotice: () => A(void 0),
|
|
3929
3929
|
send: M,
|
|
3930
3930
|
askAgain: B,
|
|
3931
|
-
stop:
|
|
3931
|
+
stop: z,
|
|
3932
3932
|
startNew: ce,
|
|
3933
3933
|
askedAbout: be,
|
|
3934
3934
|
open: ue
|
|
3935
3935
|
};
|
|
3936
3936
|
}
|
|
3937
|
-
function
|
|
3937
|
+
function Ui(e, t) {
|
|
3938
3938
|
var r;
|
|
3939
3939
|
if (!t || e.surface !== "dashboard") return;
|
|
3940
3940
|
const a = J.getState().dashboard;
|
|
3941
3941
|
if (!(!(a != null && a.id) || a.id !== ((r = e.dashboard) == null ? void 0 : r.id)))
|
|
3942
|
-
return wt(a) <=
|
|
3942
|
+
return wt(a) <= ze.openDashboardBytes ? a : void 0;
|
|
3943
3943
|
}
|
|
3944
3944
|
function bt(e, t) {
|
|
3945
3945
|
const a = {
|
|
@@ -3983,7 +3983,7 @@ function bt(e, t) {
|
|
|
3983
3983
|
function qi(e) {
|
|
3984
3984
|
return e.turns.flatMap((t) => {
|
|
3985
3985
|
var s;
|
|
3986
|
-
const a =
|
|
3986
|
+
const a = Us(t.outcome), r = [...t.parts, ...a ? [a] : []].map(qs);
|
|
3987
3987
|
return [
|
|
3988
3988
|
{
|
|
3989
3989
|
id: `${t.turnId}-question`,
|
|
@@ -4000,10 +4000,10 @@ function vt(e) {
|
|
|
4000
4000
|
}
|
|
4001
4001
|
const Vi = new Set(Object.values(Ke));
|
|
4002
4002
|
function Zi(e) {
|
|
4003
|
-
return e instanceof
|
|
4003
|
+
return e instanceof Ue || Vi.has(e.message) ? e.message : Ke.model_unavailable;
|
|
4004
4004
|
}
|
|
4005
4005
|
function Ji(e) {
|
|
4006
|
-
return e instanceof
|
|
4006
|
+
return e instanceof ja ? e.message : e instanceof Va ? "The dashboard is still loading. Try again in a moment." : e instanceof La ? Ke.context_invalid : Ke.model_unavailable;
|
|
4007
4007
|
}
|
|
4008
4008
|
function Ar(e) {
|
|
4009
4009
|
return ((e == null ? void 0 : e.parts) ?? []).map((t) => t.type === "text" ? t.text : "").join("").trim();
|
|
@@ -4021,7 +4021,7 @@ function Er({ children: e, className: t }) {
|
|
|
4021
4021
|
function Tr({ children: e, className: t }) {
|
|
4022
4022
|
return /* @__PURE__ */ d("td", { className: L("border-b border-border/60 px-2 py-1.5 align-top", t), children: e });
|
|
4023
4023
|
}
|
|
4024
|
-
function
|
|
4024
|
+
function jt() {
|
|
4025
4025
|
return Qr() ?? ks;
|
|
4026
4026
|
}
|
|
4027
4027
|
function Mr(e, t) {
|
|
@@ -4225,7 +4225,7 @@ function rl({ artifact: e, onClose: t }) {
|
|
|
4225
4225
|
/* @__PURE__ */ b("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
4226
4226
|
/* @__PURE__ */ d(_r, { eligible: e.eligible, kind: a, onChange: r }),
|
|
4227
4227
|
/* @__PURE__ */ d(
|
|
4228
|
-
|
|
4228
|
+
U,
|
|
4229
4229
|
{
|
|
4230
4230
|
variant: "ghost",
|
|
4231
4231
|
size: "xs",
|
|
@@ -4258,7 +4258,7 @@ function rl({ artifact: e, onClose: t }) {
|
|
|
4258
4258
|
);
|
|
4259
4259
|
}
|
|
4260
4260
|
function kr(e, t) {
|
|
4261
|
-
const [a, r] = $(t), s = Ze(() => sl(e, a), [e, a]), l = ts(), i =
|
|
4261
|
+
const [a, r] = $(t), s = Ze(() => sl(e, a), [e, a]), l = ts(), i = jt(), p = Ze(
|
|
4262
4262
|
() => Hi(e, s, i, l),
|
|
4263
4263
|
[e, s, i, l]
|
|
4264
4264
|
), g = s.kind === "table" || s.kind !== "number" && !p ? "table" : s.kind;
|
|
@@ -4266,7 +4266,7 @@ function kr(e, t) {
|
|
|
4266
4266
|
}
|
|
4267
4267
|
function sl(e, t) {
|
|
4268
4268
|
if (t === e.visual.kind) return e.visual;
|
|
4269
|
-
const a = Ua(
|
|
4269
|
+
const a = za(Ua(e), t);
|
|
4270
4270
|
return a.ok ? a.visual : { kind: "table", encodings: {} };
|
|
4271
4271
|
}
|
|
4272
4272
|
const nl = {
|
|
@@ -4306,7 +4306,7 @@ function Or({ cfg: e, className: t }) {
|
|
|
4306
4306
|
}
|
|
4307
4307
|
function Rr({ artifact: e, visual: t }) {
|
|
4308
4308
|
var s;
|
|
4309
|
-
const a =
|
|
4309
|
+
const a = jt(), r = e.columns.find((l) => {
|
|
4310
4310
|
var i;
|
|
4311
4311
|
return l.key === ((i = t.encodings.y) == null ? void 0 : i[0]);
|
|
4312
4312
|
});
|
|
@@ -4322,7 +4322,7 @@ function Pr({
|
|
|
4322
4322
|
onSort: r,
|
|
4323
4323
|
className: s
|
|
4324
4324
|
}) {
|
|
4325
|
-
const l =
|
|
4325
|
+
const l = jt();
|
|
4326
4326
|
return /* @__PURE__ */ b(Cr, { className: s, children: [
|
|
4327
4327
|
/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((i) => /* @__PURE__ */ d(Er, { className: L(ga(i) && "text-right"), children: r ? /* @__PURE__ */ b(
|
|
4328
4328
|
"button",
|
|
@@ -4570,7 +4570,7 @@ function ml({
|
|
|
4570
4570
|
/* @__PURE__ */ b("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4571
4571
|
/* @__PURE__ */ d("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ d($r, { onPick: r }) }),
|
|
4572
4572
|
/* @__PURE__ */ b(
|
|
4573
|
-
|
|
4573
|
+
U,
|
|
4574
4574
|
{
|
|
4575
4575
|
size: "xs",
|
|
4576
4576
|
className: "mt-0.5 h-7 shrink-0 gap-1 px-2.5",
|
|
@@ -4630,7 +4630,7 @@ function $r({ onPick: e }) {
|
|
|
4630
4630
|
autoFocus: !0,
|
|
4631
4631
|
"aria-label": "Something else",
|
|
4632
4632
|
value: t,
|
|
4633
|
-
maxLength:
|
|
4633
|
+
maxLength: ze.messageChars,
|
|
4634
4634
|
onChange: (l) => a(l.target.value),
|
|
4635
4635
|
onKeyDown: (l) => {
|
|
4636
4636
|
l.key === "Escape" && (l.preventDefault(), s());
|
|
@@ -4639,12 +4639,12 @@ function $r({ onPick: e }) {
|
|
|
4639
4639
|
className: "h-7 min-w-0 flex-1 bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground"
|
|
4640
4640
|
}
|
|
4641
4641
|
),
|
|
4642
|
-
/* @__PURE__ */ d(
|
|
4642
|
+
/* @__PURE__ */ d(U, { type: "submit", size: "xs", className: "h-7 w-7 shrink-0 p-0", "aria-label": "Send answer", title: "Send", disabled: !t.trim(), children: /* @__PURE__ */ d(it, { className: "h-3.5 w-3.5" }) })
|
|
4643
4643
|
]
|
|
4644
4644
|
}
|
|
4645
4645
|
);
|
|
4646
4646
|
}
|
|
4647
|
-
function
|
|
4647
|
+
function Fr({ field: e, onRemove: t }) {
|
|
4648
4648
|
const a = e.role === "measure" ? _t : Sa;
|
|
4649
4649
|
return /* @__PURE__ */ b(
|
|
4650
4650
|
"span",
|
|
@@ -4712,7 +4712,7 @@ function yl({
|
|
|
4712
4712
|
testId: "assistant-proposal",
|
|
4713
4713
|
"data-proposal-state": i.kind,
|
|
4714
4714
|
action: i.kind === "undoable" ? /* @__PURE__ */ b(
|
|
4715
|
-
|
|
4715
|
+
U,
|
|
4716
4716
|
{
|
|
4717
4717
|
variant: "outline",
|
|
4718
4718
|
size: "xs",
|
|
@@ -4747,7 +4747,7 @@ function yl({
|
|
|
4747
4747
|
] }, c)) }) : null,
|
|
4748
4748
|
o ? /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
4749
4749
|
/* @__PURE__ */ d("span", { className: "text-[11.5px] leading-[1.5] text-muted-foreground", children: o }),
|
|
4750
|
-
i.kind === "refused" && r ? /* @__PURE__ */ b(
|
|
4750
|
+
i.kind === "refused" && r ? /* @__PURE__ */ b(U, { variant: "outline", size: "xs", className: "h-[26px] gap-1 px-2 text-[11.5px]", onClick: r, children: [
|
|
4751
4751
|
/* @__PURE__ */ d(Pa, { className: "h-3 w-3" }),
|
|
4752
4752
|
"Ask again"
|
|
4753
4753
|
] }) : null
|
|
@@ -4810,7 +4810,7 @@ function vl({
|
|
|
4810
4810
|
] }),
|
|
4811
4811
|
/* @__PURE__ */ b("div", { className: "flex gap-1.5", children: [
|
|
4812
4812
|
/* @__PURE__ */ d(
|
|
4813
|
-
|
|
4813
|
+
U,
|
|
4814
4814
|
{
|
|
4815
4815
|
size: "xs",
|
|
4816
4816
|
className: "h-[26px] px-2 text-[11.5px]",
|
|
@@ -4820,7 +4820,7 @@ function vl({
|
|
|
4820
4820
|
}
|
|
4821
4821
|
),
|
|
4822
4822
|
/* @__PURE__ */ d(
|
|
4823
|
-
|
|
4823
|
+
U,
|
|
4824
4824
|
{
|
|
4825
4825
|
variant: "outline",
|
|
4826
4826
|
size: "xs",
|
|
@@ -4834,7 +4834,7 @@ function vl({
|
|
|
4834
4834
|
] }) : null,
|
|
4835
4835
|
p ? /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
4836
4836
|
/* @__PURE__ */ d("span", { className: "text-[11.5px] leading-[1.5] text-muted-foreground", children: p }),
|
|
4837
|
-
(l === "added" || l === "refused") && s ? /* @__PURE__ */ b(
|
|
4837
|
+
(l === "added" || l === "refused") && s ? /* @__PURE__ */ b(U, { variant: "outline", size: "xs", className: "h-[26px] gap-1 px-2 text-[11.5px]", onClick: s, children: [
|
|
4838
4838
|
/* @__PURE__ */ d(Pa, { className: "h-3 w-3" }),
|
|
4839
4839
|
"Ask again"
|
|
4840
4840
|
] }) : null
|
|
@@ -4913,7 +4913,7 @@ function El({ message: e }) {
|
|
|
4913
4913
|
var r;
|
|
4914
4914
|
const t = Cl(e), a = ((r = e.metadata) == null ? void 0 : r.taggedFields) ?? [];
|
|
4915
4915
|
return /* @__PURE__ */ d("div", { className: "flex justify-end", "data-message-id": e.id, children: /* @__PURE__ */ b("div", { className: "max-w-[88%] whitespace-pre-wrap break-words rounded-card bg-muted px-2.5 py-1.5 text-[13px] leading-[1.55] text-foreground", children: [
|
|
4916
|
-
a.map((s) => /* @__PURE__ */ d("span", { className: "mr-1", children: /* @__PURE__ */ d(
|
|
4916
|
+
a.map((s) => /* @__PURE__ */ d("span", { className: "mr-1", children: /* @__PURE__ */ d(Fr, { field: s }) }, `${s.role}:${s.name}:${s.aggregate ?? ""}:${s.granularity ?? ""}`)),
|
|
4917
4917
|
t
|
|
4918
4918
|
] }) });
|
|
4919
4919
|
}
|
|
@@ -4996,19 +4996,19 @@ function Rl({ items: e, notes: t }) {
|
|
|
4996
4996
|
/* @__PURE__ */ b("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "What this answer used", children: [
|
|
4997
4997
|
r.map((l, i) => /* @__PURE__ */ d(Pl, { children: l }, i)),
|
|
4998
4998
|
s.length ? /* @__PURE__ */ b(Da, { children: [
|
|
4999
|
-
/* @__PURE__ */ d($a, { asChild: !0, children: /* @__PURE__ */ b("button", { type: "button", "aria-label": `${s.length} more`, className:
|
|
4999
|
+
/* @__PURE__ */ d($a, { asChild: !0, children: /* @__PURE__ */ b("button", { type: "button", "aria-label": `${s.length} more`, className: jr, children: [
|
|
5000
5000
|
"+",
|
|
5001
5001
|
s.length
|
|
5002
5002
|
] }) }),
|
|
5003
|
-
/* @__PURE__ */ d(
|
|
5003
|
+
/* @__PURE__ */ d(Fa, { align: "start", className: "w-auto max-w-[280px] p-2", children: /* @__PURE__ */ d("ul", { className: "space-y-1 text-[12px] text-foreground", children: s.map((l, i) => /* @__PURE__ */ d("li", { className: "break-words", children: l }, i)) }) })
|
|
5004
5004
|
] }) : null
|
|
5005
5005
|
] }),
|
|
5006
5006
|
t.map((l, i) => /* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: l }, i))
|
|
5007
5007
|
] });
|
|
5008
5008
|
}
|
|
5009
|
-
const
|
|
5009
|
+
const jr = "inline-flex h-5 min-w-0 max-w-full items-center truncate whitespace-nowrap rounded-control border border-border bg-muted/50 px-1.5 text-[11px] text-muted-foreground";
|
|
5010
5010
|
function Pl({ children: e }) {
|
|
5011
|
-
return /* @__PURE__ */ d("span", { className:
|
|
5011
|
+
return /* @__PURE__ */ d("span", { className: jr, title: e, children: e });
|
|
5012
5012
|
}
|
|
5013
5013
|
function Dl(e) {
|
|
5014
5014
|
switch (e.kind) {
|
|
@@ -5031,7 +5031,7 @@ function $l({
|
|
|
5031
5031
|
using: t,
|
|
5032
5032
|
trace: a
|
|
5033
5033
|
}) {
|
|
5034
|
-
const r =
|
|
5034
|
+
const r = Fl(e), s = e.length ? `${e.length} ${e.length === 1 ? "step" : "steps"}` : "Details";
|
|
5035
5035
|
return /* @__PURE__ */ d(
|
|
5036
5036
|
Bt,
|
|
5037
5037
|
{
|
|
@@ -5045,7 +5045,7 @@ function $l({
|
|
|
5045
5045
|
r.length ? /* @__PURE__ */ d("ul", { className: "space-y-1", "aria-label": "Steps", children: r.map(({ stage: l, ids: i }) => (
|
|
5046
5046
|
// Top-aligned: the icon sits on the first line when a label wraps.
|
|
5047
5047
|
/* @__PURE__ */ b("li", { className: "flex items-start gap-1.5 text-[12px] leading-[1.5] text-muted-foreground", children: [
|
|
5048
|
-
/* @__PURE__ */ d("span", { className: "mt-[3px] shrink-0", children: /* @__PURE__ */ d(
|
|
5048
|
+
/* @__PURE__ */ d("span", { className: "mt-[3px] shrink-0", children: /* @__PURE__ */ d(jl, { stage: l }) }),
|
|
5049
5049
|
/* @__PURE__ */ b("span", { className: L("min-w-0 flex-1", l.state === "skipped" && "line-through opacity-70"), children: [
|
|
5050
5050
|
l.label,
|
|
5051
5051
|
i.length > 1 ? ` (${i.length})` : ""
|
|
@@ -5059,7 +5059,7 @@ function $l({
|
|
|
5059
5059
|
}
|
|
5060
5060
|
);
|
|
5061
5061
|
}
|
|
5062
|
-
function
|
|
5062
|
+
function Fl(e) {
|
|
5063
5063
|
const t = [];
|
|
5064
5064
|
for (const a of e) {
|
|
5065
5065
|
const r = t.at(-1);
|
|
@@ -5075,7 +5075,7 @@ const Lr = {
|
|
|
5075
5075
|
change: Ea,
|
|
5076
5076
|
retry: Mn
|
|
5077
5077
|
};
|
|
5078
|
-
function
|
|
5078
|
+
function jl({ stage: e }) {
|
|
5079
5079
|
if (e.activity) {
|
|
5080
5080
|
const t = Lr[e.activity];
|
|
5081
5081
|
return /* @__PURE__ */ d(t, { className: "h-3 w-3", "aria-hidden": "true" });
|
|
@@ -5113,13 +5113,13 @@ function Bl({ text: e }) {
|
|
|
5113
5113
|
}
|
|
5114
5114
|
) });
|
|
5115
5115
|
}
|
|
5116
|
-
const
|
|
5116
|
+
const zl = [
|
|
5117
5117
|
{ layout: "docked-right", label: "Dock right", short: "Right", icon: qa },
|
|
5118
5118
|
{ layout: "docked-left", label: "Dock left", short: "Left", icon: Tn },
|
|
5119
5119
|
{ layout: "centered", label: "Centered", short: "Center", icon: Sn },
|
|
5120
5120
|
{ layout: "full-page", label: "Full page", short: "Full", icon: vs }
|
|
5121
5121
|
];
|
|
5122
|
-
function
|
|
5122
|
+
function Ul({
|
|
5123
5123
|
layout: e,
|
|
5124
5124
|
onLayout: t,
|
|
5125
5125
|
allows: a,
|
|
@@ -5143,7 +5143,7 @@ function zl({
|
|
|
5143
5143
|
] }) : null,
|
|
5144
5144
|
/* @__PURE__ */ b(fs, { children: [
|
|
5145
5145
|
/* @__PURE__ */ d(hs, { asChild: !0, children: /* @__PURE__ */ d(
|
|
5146
|
-
|
|
5146
|
+
U,
|
|
5147
5147
|
{
|
|
5148
5148
|
variant: "ghost",
|
|
5149
5149
|
size: "xs",
|
|
@@ -5156,7 +5156,7 @@ function zl({
|
|
|
5156
5156
|
/* @__PURE__ */ b(ys, { align: "end", className: "w-64", children: [
|
|
5157
5157
|
e && t ? /* @__PURE__ */ b(Me, { children: [
|
|
5158
5158
|
/* @__PURE__ */ d(bs, { className: "text-[11px] font-medium text-muted-foreground", children: "Layout" }),
|
|
5159
|
-
/* @__PURE__ */ d("div", { className: "grid grid-cols-4 gap-1 px-1 pb-1", role: "group", "aria-label": "Layout", children:
|
|
5159
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-4 gap-1 px-1 pb-1", role: "group", "aria-label": "Layout", children: zl.map((f) => {
|
|
5160
5160
|
const c = f.layout === e;
|
|
5161
5161
|
return /* @__PURE__ */ b(
|
|
5162
5162
|
ut,
|
|
@@ -5230,7 +5230,7 @@ function Vl({
|
|
|
5230
5230
|
const h = new Set(y);
|
|
5231
5231
|
return h.delete(v), h;
|
|
5232
5232
|
}), C(
|
|
5233
|
-
u instanceof
|
|
5233
|
+
u instanceof Ue && u.code === "turn_in_progress" ? "That conversation is still answering. Delete it when it finishes." : "Could not delete that conversation."
|
|
5234
5234
|
);
|
|
5235
5235
|
}
|
|
5236
5236
|
};
|
|
@@ -5286,7 +5286,7 @@ function Vl({
|
|
|
5286
5286
|
] });
|
|
5287
5287
|
}
|
|
5288
5288
|
const Zl = 8;
|
|
5289
|
-
function
|
|
5289
|
+
function zr(e, t, a) {
|
|
5290
5290
|
return Ta({
|
|
5291
5291
|
queryKey: Sr(e),
|
|
5292
5292
|
queryFn: ({ signal: r }) => Oi(t(), r),
|
|
@@ -5301,7 +5301,7 @@ function Jl({
|
|
|
5301
5301
|
added: a,
|
|
5302
5302
|
onRemove: r
|
|
5303
5303
|
}) {
|
|
5304
|
-
const s =
|
|
5304
|
+
const s = zr(e, t, !1);
|
|
5305
5305
|
if (a.length === 0) return null;
|
|
5306
5306
|
const l = s.data ? new Set(s.data.map((i) => de(i.source))) : void 0;
|
|
5307
5307
|
return /* @__PURE__ */ d("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-testid": "assistant-sources", children: a.map((i) => {
|
|
@@ -5318,7 +5318,7 @@ function Jl({
|
|
|
5318
5318
|
/* @__PURE__ */ d("span", { className: L("truncate", g && "line-through"), children: p }),
|
|
5319
5319
|
g ? /* @__PURE__ */ d("span", { className: "sr-only", children: "no longer available" }) : null,
|
|
5320
5320
|
/* @__PURE__ */ d(
|
|
5321
|
-
|
|
5321
|
+
U,
|
|
5322
5322
|
{
|
|
5323
5323
|
type: "button",
|
|
5324
5324
|
variant: "ghost",
|
|
@@ -5342,7 +5342,7 @@ function Kl({
|
|
|
5342
5342
|
disabled: r,
|
|
5343
5343
|
onAdd: s
|
|
5344
5344
|
}) {
|
|
5345
|
-
const [l, i] = $(!1), [p, g] = $(""), o =
|
|
5345
|
+
const [l, i] = $(!1), [p, g] = $(""), o = zr(e, t, l || a.length > 0), f = new Set(a.map(de)), c = (o.data ?? []).filter((C) => !f.has(de(C.source))), m = p.trim().toLowerCase(), w = m ? c.filter((C) => `${C.label} ${C.domainLabel ?? ""}`.toLowerCase().includes(m)) : c;
|
|
5346
5346
|
return /* @__PURE__ */ b(
|
|
5347
5347
|
Da,
|
|
5348
5348
|
{
|
|
@@ -5352,7 +5352,7 @@ function Kl({
|
|
|
5352
5352
|
},
|
|
5353
5353
|
children: [
|
|
5354
5354
|
/* @__PURE__ */ d($a, { asChild: !0, children: /* @__PURE__ */ d(
|
|
5355
|
-
|
|
5355
|
+
U,
|
|
5356
5356
|
{
|
|
5357
5357
|
type: "button",
|
|
5358
5358
|
variant: "ghost",
|
|
@@ -5364,7 +5364,7 @@ function Kl({
|
|
|
5364
5364
|
children: /* @__PURE__ */ d(lt, { className: "h-4 w-4" })
|
|
5365
5365
|
}
|
|
5366
5366
|
) }),
|
|
5367
|
-
/* @__PURE__ */ d(
|
|
5367
|
+
/* @__PURE__ */ d(Fa, { align: "start", className: "w-72 p-1.5", children: o.isPending ? /* @__PURE__ */ b("p", { className: "flex items-center gap-1.5 px-1.5 py-1 text-[12px] text-muted-foreground", role: "status", children: [
|
|
5368
5368
|
/* @__PURE__ */ d(_e, { className: "h-3 w-3 animate-spin" }),
|
|
5369
5369
|
"Loading"
|
|
5370
5370
|
] }) : o.isError ? /* @__PURE__ */ d("p", { className: "px-1.5 py-1 text-[12px] text-muted-foreground", children: "Could not load sources." }) : c.length === 0 ? /* @__PURE__ */ d("p", { className: "px-1.5 py-1 text-[12px] text-muted-foreground", children: "Nothing more to add." }) : /* @__PURE__ */ b(Me, { children: [
|
|
@@ -5415,7 +5415,7 @@ function Wl({ entries: e, onPick: t }) {
|
|
|
5415
5415
|
] }, r)) });
|
|
5416
5416
|
}
|
|
5417
5417
|
function Hl(e) {
|
|
5418
|
-
const [t, a] = $([]), r = e ? t.filter((i) => i.cardId === e).map((i) => i.field) : [], s = r.length >=
|
|
5418
|
+
const [t, a] = $([]), r = e ? t.filter((i) => i.cardId === e).map((i) => i.field) : [], s = r.length >= ze.taggedFields, l = (i) => !!e && !s && !r.some((p) => It(p, i));
|
|
5419
5419
|
return {
|
|
5420
5420
|
shown: r,
|
|
5421
5421
|
/** Five are tagged: nothing more can be. */
|
|
@@ -5434,12 +5434,12 @@ function Hl(e) {
|
|
|
5434
5434
|
}
|
|
5435
5435
|
};
|
|
5436
5436
|
}
|
|
5437
|
-
function
|
|
5437
|
+
function Ur(e, t) {
|
|
5438
5438
|
const a = /(?:^|\s)@([^\s@]*)$/.exec(e.slice(0, t));
|
|
5439
5439
|
return a ? a[1] : void 0;
|
|
5440
5440
|
}
|
|
5441
5441
|
function Gl(e, t) {
|
|
5442
|
-
const a =
|
|
5442
|
+
const a = Ur(e, t);
|
|
5443
5443
|
if (a === void 0) return { text: e, caret: t };
|
|
5444
5444
|
const r = t - a.length - 1;
|
|
5445
5445
|
return { text: e.slice(0, r) + e.slice(t), caret: r };
|
|
@@ -5471,7 +5471,7 @@ function _d({
|
|
|
5471
5471
|
apiServiceUrl: (S = s.tokenProps) == null ? void 0 : S.apiServiceUrl,
|
|
5472
5472
|
accessToken: (R = s.authToken) == null ? void 0 : R.accessToken
|
|
5473
5473
|
};
|
|
5474
|
-
}, y = _n({ surface: t }), { canChangeNow: h } = Ba(t === "dashboard"), x = $s(h), I =
|
|
5474
|
+
}, y = _n({ surface: t }), { canChangeNow: h } = Ba(t === "dashboard"), x = $s(h), I = zi({
|
|
5475
5475
|
canChangeOpenDashboard: h,
|
|
5476
5476
|
applyProposal: x,
|
|
5477
5477
|
readContext: () => N({ focus: e.store.getState().focus, snapshot: C.current, editing: rd(r) }),
|
|
@@ -5481,7 +5481,7 @@ function _d({
|
|
|
5481
5481
|
// A refused context may name an added source the caller can no longer add:
|
|
5482
5482
|
// reading the catalog again marks it (D3c-10).
|
|
5483
5483
|
onFailed: (S) => {
|
|
5484
|
-
S instanceof
|
|
5484
|
+
S instanceof Ue && S.code === "context_invalid" && Mt(v, Sr(e.id));
|
|
5485
5485
|
}
|
|
5486
5486
|
}), [M, B] = $(""), q = X(null);
|
|
5487
5487
|
ye(() => {
|
|
@@ -5495,17 +5495,17 @@ function _d({
|
|
|
5495
5495
|
const { focus: S, beside: R } = e.store.getState();
|
|
5496
5496
|
S && Pe.current(S.cardId, { beside: R });
|
|
5497
5497
|
}, [p, e]);
|
|
5498
|
-
const De = (w == null ? void 0 : w.id) ?? (m == null ? void 0 : m.id),
|
|
5498
|
+
const De = (w == null ? void 0 : w.id) ?? (m == null ? void 0 : m.id), z = Hl(De), ce = De ? E : [], [be, ve] = $(), me = be ? z.available(ce).filter((S) => S.label.toLowerCase().includes(be.query.toLowerCase())) : [], ue = be && me.length ? { ...be, active: Math.min(be.active, me.length - 1) } : void 0, P = X(void 0);
|
|
5499
5499
|
ke(() => {
|
|
5500
5500
|
var S;
|
|
5501
5501
|
P.current !== void 0 && ((S = q.current) == null || S.setSelectionRange(P.current, P.current), P.current = void 0);
|
|
5502
5502
|
}, [M]);
|
|
5503
5503
|
const T = (S) => {
|
|
5504
|
-
|
|
5504
|
+
z.add(S);
|
|
5505
5505
|
const R = q.current, Y = Gl(M, (R == null ? void 0 : R.selectionStart) ?? M.length);
|
|
5506
5506
|
Y.text !== M && (P.current = Y.caret, B(Y.text)), ve(void 0), R == null || R.focus();
|
|
5507
5507
|
}, O = (S) => {
|
|
5508
|
-
S == null || S.preventDefault(), I.send(M,
|
|
5508
|
+
S == null || S.preventDefault(), I.send(M, z.shown) === "sent" && (B(""), z.clear());
|
|
5509
5509
|
}, D = (S) => {
|
|
5510
5510
|
var Y;
|
|
5511
5511
|
const R = I.send(S) === "sent";
|
|
@@ -5531,15 +5531,15 @@ function _d({
|
|
|
5531
5531
|
S.preventDefault(), ve(void 0);
|
|
5532
5532
|
return;
|
|
5533
5533
|
}
|
|
5534
|
-
if (S.key === "Backspace" && !M &&
|
|
5535
|
-
|
|
5534
|
+
if (S.key === "Backspace" && !M && z.shown.length) {
|
|
5535
|
+
z.remove(z.shown[z.shown.length - 1]);
|
|
5536
5536
|
return;
|
|
5537
5537
|
}
|
|
5538
5538
|
S.key === "Enter" && !S.shiftKey && !S.nativeEvent.isComposing && O(S);
|
|
5539
5539
|
}, V = I.messages.length === 0, [se, G] = $(), xe = (se == null ? void 0 : se.sessionKey) === I.sessionKey ? td(I.messages, se.artifactId) : void 0, fe = (S) => {
|
|
5540
5540
|
G((R) => ({ sessionKey: I.sessionKey, artifactId: S, opened: ((R == null ? void 0 : R.opened) ?? 0) + 1 })), e.leaveBeside(), o !== "full-page" && e.setLayout("full-page");
|
|
5541
|
-
}, we = f === "full-page",
|
|
5542
|
-
|
|
5541
|
+
}, we = f === "full-page", zt = /* @__PURE__ */ d(
|
|
5542
|
+
U,
|
|
5543
5543
|
{
|
|
5544
5544
|
variant: "ghost",
|
|
5545
5545
|
size: "xs",
|
|
@@ -5554,7 +5554,7 @@ function _d({
|
|
|
5554
5554
|
children: /* @__PURE__ */ d(Cs, { className: "h-3.5 w-3.5" })
|
|
5555
5555
|
}
|
|
5556
5556
|
), ct = r ? null : /* @__PURE__ */ d(
|
|
5557
|
-
|
|
5557
|
+
U,
|
|
5558
5558
|
{
|
|
5559
5559
|
variant: "ghost",
|
|
5560
5560
|
size: "xs",
|
|
@@ -5564,8 +5564,8 @@ function _d({
|
|
|
5564
5564
|
onClick: e.close,
|
|
5565
5565
|
children: /* @__PURE__ */ d(Je, { className: "h-3.5 w-3.5" })
|
|
5566
5566
|
}
|
|
5567
|
-
),
|
|
5568
|
-
|
|
5567
|
+
), Ut = /* @__PURE__ */ d(
|
|
5568
|
+
Ul,
|
|
5569
5569
|
{
|
|
5570
5570
|
...r ? {} : { layout: o, onLayout: e.setLayout },
|
|
5571
5571
|
allows: I.allows,
|
|
@@ -5588,7 +5588,7 @@ function _d({
|
|
|
5588
5588
|
}
|
|
5589
5589
|
),
|
|
5590
5590
|
/* @__PURE__ */ d(
|
|
5591
|
-
|
|
5591
|
+
U,
|
|
5592
5592
|
{
|
|
5593
5593
|
variant: "ghost",
|
|
5594
5594
|
size: "xs",
|
|
@@ -5612,9 +5612,9 @@ function _d({
|
|
|
5612
5612
|
I.notice ? /* @__PURE__ */ d("p", { role: "alert", className: "text-[12px] leading-[1.5] text-destructive", children: I.notice }) : null,
|
|
5613
5613
|
/* @__PURE__ */ b("form", { onSubmit: O, className: "relative rounded-control border border-input bg-background focus-within:border-ring", children: [
|
|
5614
5614
|
ue ? /* @__PURE__ */ d(hl, { fields: me, active: ue.active, onPick: T }) : null,
|
|
5615
|
-
|
|
5615
|
+
z.shown.length ? (
|
|
5616
5616
|
// The tagged fields sit in the question itself, before its words.
|
|
5617
|
-
/* @__PURE__ */ d("div", { className: "flex flex-wrap gap-1 px-2.5 pt-2", "data-testid": "assistant-question-tags", children:
|
|
5617
|
+
/* @__PURE__ */ d("div", { className: "flex flex-wrap gap-1 px-2.5 pt-2", "data-testid": "assistant-question-tags", children: z.shown.map((S) => /* @__PURE__ */ d(Fr, { field: S, onRemove: () => z.remove(S) }, `${S.role}:${S.name}:${S.aggregate ?? ""}:${S.granularity ?? ""}`)) })
|
|
5618
5618
|
) : null,
|
|
5619
5619
|
/* @__PURE__ */ d(
|
|
5620
5620
|
"textarea",
|
|
@@ -5623,11 +5623,11 @@ function _d({
|
|
|
5623
5623
|
"aria-label": "Message",
|
|
5624
5624
|
placeholder: w ? "Ask about this visual" : m ? "Ask about this card" : r ? "Ask about your data" : "Ask about this dashboard",
|
|
5625
5625
|
value: M,
|
|
5626
|
-
maxLength:
|
|
5626
|
+
maxLength: ze.messageChars,
|
|
5627
5627
|
rows: 2,
|
|
5628
5628
|
onChange: (S) => {
|
|
5629
5629
|
B(S.target.value), I.notice && I.clearNotice();
|
|
5630
|
-
const R =
|
|
5630
|
+
const R = Ur(S.target.value, S.target.selectionStart ?? S.target.value.length);
|
|
5631
5631
|
ve(R === void 0 ? void 0 : { query: R, active: 0 });
|
|
5632
5632
|
},
|
|
5633
5633
|
onKeyDown: re,
|
|
@@ -5648,15 +5648,15 @@ function _d({
|
|
|
5648
5648
|
}
|
|
5649
5649
|
),
|
|
5650
5650
|
ce.length ? /* @__PURE__ */ d(
|
|
5651
|
-
|
|
5651
|
+
U,
|
|
5652
5652
|
{
|
|
5653
5653
|
type: "button",
|
|
5654
5654
|
variant: "ghost",
|
|
5655
5655
|
size: "xs",
|
|
5656
5656
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
5657
5657
|
"aria-label": "Tag a field",
|
|
5658
|
-
title:
|
|
5659
|
-
disabled:
|
|
5658
|
+
title: z.full ? `Up to ${ze.taggedFields} fields per question` : "Tag a field",
|
|
5659
|
+
disabled: z.full,
|
|
5660
5660
|
onClick: () => {
|
|
5661
5661
|
var S;
|
|
5662
5662
|
ve((R) => R ? void 0 : { query: "", active: 0 }), (S = q.current) == null || S.focus();
|
|
@@ -5666,7 +5666,7 @@ function _d({
|
|
|
5666
5666
|
) : null
|
|
5667
5667
|
] }),
|
|
5668
5668
|
I.busy ? /* @__PURE__ */ d(
|
|
5669
|
-
|
|
5669
|
+
U,
|
|
5670
5670
|
{
|
|
5671
5671
|
type: "button",
|
|
5672
5672
|
size: "xs",
|
|
@@ -5678,7 +5678,7 @@ function _d({
|
|
|
5678
5678
|
children: /* @__PURE__ */ d(Ss, { className: "h-3 w-3 fill-current" })
|
|
5679
5679
|
}
|
|
5680
5680
|
) : /* @__PURE__ */ d(
|
|
5681
|
-
|
|
5681
|
+
U,
|
|
5682
5682
|
{
|
|
5683
5683
|
type: "submit",
|
|
5684
5684
|
size: "xs",
|
|
@@ -5713,7 +5713,7 @@ function _d({
|
|
|
5713
5713
|
answeringId: I.busy ? I.conversationId : void 0,
|
|
5714
5714
|
header: /* @__PURE__ */ b("div", { className: "flex h-11 shrink-0 items-center justify-between gap-2 px-3", children: [
|
|
5715
5715
|
/* @__PURE__ */ d("h2", { className: "truncate text-[13px] font-semibold text-foreground", children: e.assistantName }),
|
|
5716
|
-
|
|
5716
|
+
zt
|
|
5717
5717
|
] })
|
|
5718
5718
|
}
|
|
5719
5719
|
) : null,
|
|
@@ -5721,7 +5721,7 @@ function _d({
|
|
|
5721
5721
|
we ? (
|
|
5722
5722
|
// No header bar: More (layouts, copy, SQL) and Close sit at the page's top right.
|
|
5723
5723
|
/* @__PURE__ */ b("div", { className: "absolute right-3 top-2 z-10 flex items-center gap-0.5", children: [
|
|
5724
|
-
|
|
5724
|
+
Ut,
|
|
5725
5725
|
ct
|
|
5726
5726
|
] })
|
|
5727
5727
|
) : null,
|
|
@@ -5744,7 +5744,7 @@ function _d({
|
|
|
5744
5744
|
] }),
|
|
5745
5745
|
/* @__PURE__ */ b("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
5746
5746
|
/* @__PURE__ */ b(
|
|
5747
|
-
|
|
5747
|
+
U,
|
|
5748
5748
|
{
|
|
5749
5749
|
variant: "ghost",
|
|
5750
5750
|
size: "xs",
|
|
@@ -5765,8 +5765,8 @@ function _d({
|
|
|
5765
5765
|
) : we ? null : /* @__PURE__ */ b("header", { className: "flex h-11 shrink-0 items-center justify-between gap-2 px-3", children: [
|
|
5766
5766
|
/* @__PURE__ */ d("h2", { className: "truncate text-[13px] font-semibold text-foreground", children: e.assistantName }),
|
|
5767
5767
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-0.5", children: [
|
|
5768
|
-
Ut,
|
|
5769
5768
|
zt,
|
|
5769
|
+
Ut,
|
|
5770
5770
|
ct
|
|
5771
5771
|
] })
|
|
5772
5772
|
] }),
|
|
@@ -5920,7 +5920,7 @@ function od({
|
|
|
5920
5920
|
}
|
|
5921
5921
|
),
|
|
5922
5922
|
!t && !g ? /* @__PURE__ */ d(
|
|
5923
|
-
|
|
5923
|
+
U,
|
|
5924
5924
|
{
|
|
5925
5925
|
variant: "outline",
|
|
5926
5926
|
size: "xs",
|