react-semaphor 0.1.563 → 0.1.565
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/DATA_APP_SDK.md +3 -3
- package/README.md +2 -2
- package/dist/analytics-protocol/index.js +8 -8
- package/dist/assistant-context/index.js +3 -2
- package/dist/brand-studio/index.js +28 -29
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{assistant-chat-iIp02_77.js → assistant-chat-DNfb5fbF.js} +294 -294
- package/dist/chunks/{bookmark-impact-D4Kl4amw.js → bookmark-impact-CHr7b1J2.js} +2 -2
- package/dist/chunks/bookmark-state-ByODVqee.js +1613 -0
- package/dist/chunks/card-filter-builder-CcEcfaYz.js +4100 -0
- package/dist/chunks/{switch-BW4yXSYs.js → code-editor-DJNOsgJH.js} +463 -442
- package/dist/chunks/{comparison-window-caption-D1EUXzaR.js → comparison-window-caption-CMLb3mut.js} +451 -419
- package/dist/chunks/{dashboard-CmqeP3QZ.js → dashboard-CtIfxycc.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-D3mc6peE.js +4910 -0
- package/dist/chunks/{dashboard-controls-B253nJS-.js → dashboard-controls-BFv0zdws.js} +684 -674
- package/dist/chunks/{dashboard-json-osQuinUZ.js → dashboard-json-CXn_3OYb.js} +4 -4
- package/dist/chunks/{dates-DFY7Gfss.js → dates-DcRxw17S.js} +13 -13
- package/dist/chunks/{edit-dashboard-visual-CMar-NhA.js → edit-dashboard-visual-Y6HatqBd.js} +7704 -10337
- package/dist/chunks/filter-reach-copy-DbggA5B7.js +4673 -0
- package/dist/chunks/{filter-value-text-CPwFkrMz.js → filter-value-text-7zhmth1S.js} +2 -2
- package/dist/chunks/{index-CNGkfUp4.js → index-DDa_rklN.js} +69 -64
- package/dist/chunks/index-RNaTnE3m.js +585 -0
- package/dist/chunks/{layout-grid-BM65viQh.js → layout-grid-0hIlqEtk.js} +1 -1
- package/dist/chunks/{list-filter-BoeLBfL3.js → list-filter-DkgoCeBm.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-hEucouWM.js → matrix-analytical-definition-C9xB_T84.js} +18 -18
- package/dist/chunks/{matrix-card-CCh9JjP1.js → matrix-card-BSUeSXpD.js} +2 -2
- package/dist/chunks/{matrix-member-presentation-DsAUbuoL.js → matrix-member-presentation-DZNgQpUq.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DsLdFdSa.js → matrix-operation-contract-Eb6elidS.js} +1 -1
- package/dist/chunks/{metric-comparison-Bnso1cm1.js → metric-comparison-ChXUFaZu.js} +1 -1
- package/dist/chunks/{palette-p1XSJFgB.js → palette-4vf2BEEg.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-B53jqszr.js → pivot-result-contract-expectations-Ddh1rNz5.js} +4 -4
- package/dist/chunks/{pivot-result-identity-Dq5jm-EC.js → pivot-result-identity-BlbLrqaC.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-l54wJyYE.js → report-preferences-dialog-Db-b04B4.js} +122 -131
- package/dist/chunks/{report-runtime-context-BITkNSDa.js → report-runtime-context-DnA_PiKo.js} +1 -1
- package/dist/chunks/resolve-dashboard-input-context-C18J-YZC.js +21394 -0
- package/dist/chunks/{save-CHV1B1fL.js → save-D6pHmSSP.js} +1 -1
- package/dist/chunks/saved-dashboard-context-DhC_EVus.js +629 -0
- package/dist/chunks/{selection-reducer-Bz5aywT4.js → selection-reducer-OaJ-N5uN.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-C3EQEiD9.js → semaphor-ready-indicator-T6TsiBMT.js} +80879 -80744
- package/dist/chunks/{shelf-drop-preview-context-BODiBlqT.js → shelf-drop-preview-context-CNWL_b0S.js} +407 -407
- package/dist/chunks/{source-entity-resolution-DdDVXFB8.js → source-entity-resolution-DF6GulDn.js} +1 -1
- package/dist/chunks/stored-dashboard-IdmtrNkA.js +5026 -0
- package/dist/chunks/{table-export-sheet-bSXxGn-v.js → table-export-sheet--DUKWk6o.js} +1 -1
- package/dist/chunks/{temporal-input-presentation-sk9gqLi6.js → temporal-input-presentation--2r9BLr0.js} +392 -377
- package/dist/chunks/{token-types-BUK06hU2.js → token-types-C8JymO8s.js} +1 -1
- package/dist/chunks/{upload-BnmuyPqW.js → upload-Cf3wXZT8.js} +1 -1
- package/dist/chunks/{validators-BIM0FE31.js → validators-wtjw0aw6.js} +7 -7
- package/dist/chunks/variable-draft-3xseULxR.js +241 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2226 -1704
- package/dist/data-app-sdk/index.js +4 -4
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.js +174 -167
- package/dist/index.js +190 -188
- package/dist/layouts/index.js +1 -1
- package/dist/pdf-export-policy/index.js +80 -28
- package/dist/pdf-table-layout/index.js +65 -65
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/components/activity/activity-bell.d.ts +5 -1
- package/dist/types/components/activity/activity-types.d.ts +12 -4
- package/dist/types/components/dashboard-variables/data-variables-menu.d.ts +8 -0
- package/dist/types/components/dashboard-variables/variable-editor-host.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +62 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +33 -2
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +4 -2
- package/dist/types/lib/dashboard-variables/data-text.d.ts +33 -0
- package/dist/types/lib/dashboard-variables/types.d.ts +207 -0
- package/dist/types/lib/document/document-edits.d.ts +16 -1
- package/dist/types/lib/document/document-panel-target.d.ts +1 -1
- package/dist/types/lib/document/document-section-query-options.d.ts +29 -0
- package/dist/types/lib/document/document-table-data-policy.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +92 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +6 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +1 -0
- package/dist/types/lib/query-context/use-semantic-execution-payload-for-cards.d.ts +24 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +36 -0
- package/dist/types/lib/text-variables/temporal-input-text.d.ts +28 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +72 -0
- package/dist/types/lib/types/common-types.d.ts +155 -51
- package/dist/types/lib/utils/card-definition.d.ts +2 -2
- package/dist/types/shared/assistant-context/index.d.ts +1 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +51 -1
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +1088 -431
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -1
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +40 -40
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/dashboard-filter-targets.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +7 -4
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +159 -0
- package/dist/types/shared/dashboard-authoring/dashboard-variable-changes.d.ts +61 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +50 -3
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +48 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +87 -13
- package/dist/types/shared/dashboard-authoring/text-card-words/chip-colors.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +90 -8
- package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +31 -3
- package/dist/types/shared/dashboard-authoring/text-card-words/variable-words.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/variable-editability.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/variable-references.d.ts +39 -0
- package/dist/types/shared/format-utils/document-print.d.ts +4 -2
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/pdf-capacity-lines.d.ts +17 -0
- package/dist/types/shared/format-utils/pdf-delivery.d.ts +8 -1
- package/dist/types/shared/format-utils/pdf-export-policy.d.ts +74 -6
- package/dist/types/shared/format-utils/presentation-execution.d.ts +9 -0
- package/package.json +2 -2
- package/src/data-app-sdk/README.md +3 -3
- package/dist/chunks/bookmark-state-CWeoGbrx.js +0 -743
- package/dist/chunks/braces-DzgoQC64.js +0 -23
- package/dist/chunks/dashboard-briefing-launcher-TYlSW77S.js +0 -3828
- package/dist/chunks/filter-reach-copy-CvV7W5dd.js +0 -3965
- package/dist/chunks/global-date-filter-utils-N1kcsOFE.js +0 -16722
- package/dist/chunks/index-CJW5BdWT.js +0 -583
- package/dist/chunks/resolve-dashboard-input-context-DaDrZGuA.js +0 -8214
- package/dist/chunks/saved-dashboard-context-DFYBrE6O.js +0 -564
- package/dist/chunks/use-create-flow-overlay-state-BXY8-Cyz.js +0 -1436
|
@@ -4,27 +4,27 @@ var $r = (e) => {
|
|
|
4
4
|
var Or = (e, t, r) => t.has(e) || $r("Cannot " + r);
|
|
5
5
|
var L = (e, t, r) => (Or(e, t, "read from private field"), r ? r.call(e) : t.get(e)), me = (e, t, r) => t.has(e) ? $r("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), ee = (e, t, r, n) => (Or(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
|
|
6
6
|
import { jsx as p, jsxs as k, Fragment as Le } from "react/jsx-runtime";
|
|
7
|
-
import { useCallback as te, useRef as ie, useMemo as it, useEffect as ke, useState as
|
|
8
|
-
import { u as X,
|
|
9
|
-
import { c as qe, B as
|
|
7
|
+
import { useCallback as te, useRef as ie, useMemo as it, useEffect as ke, useState as D, useLayoutEffect as Ue, useId as As } from "react";
|
|
8
|
+
import { u as X, e6 as Cs, aW as $s, be as Os, Y as zs, e7 as Ms, e8 as Ps, Z as zr, aT as Rs, e9 as Zs, bT as js, b9 as Ds, ea as dr, dm as Fs, eb as Ls, ec as Mt, ed as Cn, ee as Us, bN as Pt, c9 as Mr, ef as $n, $ as Bs, c3 as On, bh as Vs, bY as qs, bM as zn, dQ as Mn, eg as Js, cw as Ws, bn as Ks, eh as Gs, ei as Ys, ej as Hs, c6 as Qs, c7 as Xs, dn as eo, c8 as to, ce as ro, ek as no, bV as Lt, cd as ao, ci as so, bX as Pn, aR as Rn, aU as oo, b8 as xt, aP as Zn, el as io, em as lo, en as co, eo as uo, a6 as jn, ep as po } from "./semaphor-ready-indicator-T6TsiBMT.js";
|
|
9
|
+
import { c as qe, B as Y, X as lt, k as Dn, l as fo, e as mt, L as Be, I as Fn, R as Ln, P as Un, a as Bn, d as Vn } from "./code-editor-DJNOsgJH.js";
|
|
10
10
|
import "./index-CuHybtft.js";
|
|
11
|
-
import "./validators-
|
|
12
|
-
import "./matrix-operation-contract-
|
|
11
|
+
import "./validators-wtjw0aw6.js";
|
|
12
|
+
import "./matrix-operation-contract-Eb6elidS.js";
|
|
13
13
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
14
14
|
import "zod";
|
|
15
15
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as mo } from "../value-format-preferences/index.js";
|
|
16
16
|
import { g as ho, c as B } from "./_commonjsHelpers-DimLPMtv.js";
|
|
17
|
-
import {
|
|
17
|
+
import { ay as go } from "./bookmark-state-ByODVqee.js";
|
|
18
18
|
import { l as bo, m as ct, c as Xt, A as et, d as qn } from "./context-R31TSL5V.js";
|
|
19
|
-
import { p as Pr, a as vo, A as Jn } from "./saved-dashboard-context-
|
|
20
|
-
import {
|
|
21
|
-
import { o as
|
|
22
|
-
import {
|
|
23
|
-
import { w as Io, c as
|
|
19
|
+
import { p as Pr, a as vo, A as Jn } from "./saved-dashboard-context-DhC_EVus.js";
|
|
20
|
+
import { gp as yo, o as xo, g1 as Rr } from "./resolve-dashboard-input-context-C18J-YZC.js";
|
|
21
|
+
import { o as Wn, p as wo } from "./report-preferences-dialog-Db-b04B4.js";
|
|
22
|
+
import { m as _o } from "./stored-dashboard-IdmtrNkA.js";
|
|
23
|
+
import { w as Io, c as Kn } from "./visual-choice-JiJ-_3bi.js";
|
|
24
24
|
import { m as So, v as Gn, t as No, n as ko, k as ve, d as Eo, b as To, l as pr, w as Ao, h as Co, s as er, f as $o, a as Oo } from "./model-change-T1cRkh3m.js";
|
|
25
|
-
import {
|
|
26
|
-
import { L as Fo } from "./list-filter-
|
|
27
|
-
import { L as Ur } from "./layout-grid-
|
|
25
|
+
import { aL as zo, aM as Mo, aN as Po, aO as wt, aP as Ro, aQ as Zr, aR as jr, aS as Dr, aT as Fr, aU as Lr, aV as Zo, ad as jo, ab as Do } from "./temporal-input-presentation--2r9BLr0.js";
|
|
26
|
+
import { L as Fo } from "./list-filter-DkgoCeBm.js";
|
|
27
|
+
import { L as Ur } from "./layout-grid-0hIlqEtk.js";
|
|
28
28
|
function Lo(e, t, r) {
|
|
29
29
|
const n = zo(), a = (r == null ? void 0 : r.locale) ?? n.locale ?? Mo, s = Po(e, t);
|
|
30
30
|
if (isNaN(s))
|
|
@@ -37,7 +37,7 @@ function Lo(e, t, r) {
|
|
|
37
37
|
s > 0 ? (c = wt(t), f = wt(e)) : (c = wt(e), f = wt(t));
|
|
38
38
|
const i = Ro((r == null ? void 0 : r.roundingMethod) ?? "round"), g = f.getTime() - c.getTime(), u = g / Lr, m = Zr(f) - Zr(c), w = (g - m) / Lr, I = r == null ? void 0 : r.unit;
|
|
39
39
|
let E;
|
|
40
|
-
if (I ? E = I : u < 1 ? E = "second" : u < 60 ? E = "minute" : u <
|
|
40
|
+
if (I ? E = I : u < 1 ? E = "second" : u < 60 ? E = "minute" : u < jr ? E = "hour" : w < Dr ? E = "day" : w < Fr ? E = "month" : E = "year", E === "second") {
|
|
41
41
|
const _ = i(g / 1e3);
|
|
42
42
|
return a.formatDistance("xSeconds", _, o);
|
|
43
43
|
} else if (E === "minute") {
|
|
@@ -47,10 +47,10 @@ function Lo(e, t, r) {
|
|
|
47
47
|
const _ = i(u / 60);
|
|
48
48
|
return a.formatDistance("xHours", _, o);
|
|
49
49
|
} else if (E === "day") {
|
|
50
|
-
const _ = i(w /
|
|
50
|
+
const _ = i(w / jr);
|
|
51
51
|
return a.formatDistance("xDays", _, o);
|
|
52
52
|
} else if (E === "month") {
|
|
53
|
-
const _ = i(w /
|
|
53
|
+
const _ = i(w / Dr);
|
|
54
54
|
return _ === 12 && I !== "month" ? a.formatDistance("xYears", 1, o) : a.formatDistance("xMonths", _, o);
|
|
55
55
|
} else {
|
|
56
56
|
const _ = i(w / Fr);
|
|
@@ -112,7 +112,7 @@ const Jo = qe("ListTree", [
|
|
|
112
112
|
* This source code is licensed under the ISC license.
|
|
113
113
|
* See the LICENSE file in the root directory of this source tree.
|
|
114
114
|
*/
|
|
115
|
-
const
|
|
115
|
+
const Wo = qe("PanelLeft", [
|
|
116
116
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
117
117
|
["path", { d: "M9 3v18", key: "fh3hqa" }]
|
|
118
118
|
]);
|
|
@@ -122,7 +122,7 @@ const Ko = qe("PanelLeft", [
|
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
124
|
*/
|
|
125
|
-
const
|
|
125
|
+
const Yn = qe("PanelRight", [
|
|
126
126
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
127
127
|
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
128
128
|
]);
|
|
@@ -132,12 +132,12 @@ const Hn = qe("PanelRight", [
|
|
|
132
132
|
* This source code is licensed under the ISC license.
|
|
133
133
|
* See the LICENSE file in the root directory of this source tree.
|
|
134
134
|
*/
|
|
135
|
-
const
|
|
135
|
+
const Ko = qe("Route", [
|
|
136
136
|
["circle", { cx: "6", cy: "19", r: "3", key: "1kj8tv" }],
|
|
137
137
|
["path", { d: "M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15", key: "1d8sl" }],
|
|
138
138
|
["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }]
|
|
139
139
|
]);
|
|
140
|
-
class
|
|
140
|
+
class Hn extends Error {
|
|
141
141
|
constructor() {
|
|
142
142
|
super("The dashboard is still loading."), this.name = "AssistantContextNotReadyError";
|
|
143
143
|
}
|
|
@@ -150,7 +150,7 @@ function Go(e = "dashboard") {
|
|
|
150
150
|
} : ({ focus: r, snapshot: n, editing: a }) => {
|
|
151
151
|
var I;
|
|
152
152
|
const s = X.getState(), o = (I = s.reportContext) == null ? void 0 : I.calendar;
|
|
153
|
-
if (!o) throw new
|
|
153
|
+
if (!o) throw new Hn();
|
|
154
154
|
const c = a ? a.card.id : r == null ? void 0 : r.cardId, f = c ? (n == null ? void 0 : n.cardId) === c && n.draft === !!a && (!a || n.card === a.card) ? n.snapshot : "pending" : void 0, i = {
|
|
155
155
|
surface: "dashboard",
|
|
156
156
|
dashboard: s.dashboard,
|
|
@@ -193,8 +193,8 @@ function Go(e = "dashboard") {
|
|
|
193
193
|
function Br(e, t) {
|
|
194
194
|
return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
const { canChange: t, canChangeNow: r } =
|
|
196
|
+
function Yo(e) {
|
|
197
|
+
const { canChange: t, canChangeNow: r } = Wn(e.surface === "dashboard"), n = X((i) => {
|
|
198
198
|
var u, m;
|
|
199
199
|
const g = (m = (u = i.dashboard) == null ? void 0 : u.sheets) == null ? void 0 : m.find((w) => w.id === i.selectedSheetId);
|
|
200
200
|
return !!g && !xo(g);
|
|
@@ -204,8 +204,8 @@ function Ho(e) {
|
|
|
204
204
|
var T, O;
|
|
205
205
|
const u = X.getState(), m = (T = u.dashboard) == null ? void 0 : T.id, w = u.selectedSheetId;
|
|
206
206
|
if (!m || !w) throw new at(Ut);
|
|
207
|
-
const I = { title: i.title, type: So[g], ...i.card }, E = !Qo({ ...I, id: "check" }, i, g), _ = { ...I, ...E ? { type: "table" } : {}, id: Rr() }, x = { id: Rr(), cards: [_], activeCardId: _.id }, y = await o(x, { reuseLoaded: !0 }).catch((
|
|
208
|
-
console.warn("Adding the result without refreshed semantic metadata:",
|
|
207
|
+
const I = { title: i.title, type: So[g], ...i.card }, E = !Qo({ ...I, id: "check" }, i, g), _ = { ...I, ...E ? { type: "table" } : {}, id: Rr() }, x = { id: Rr(), cards: [_], activeCardId: _.id }, y = await o(x, { reuseLoaded: !0 }).catch((W) => {
|
|
208
|
+
console.warn("Adding the result without refreshed semantic metadata:", W);
|
|
209
209
|
}), h = structuredClone(X.getState().semanticExecutionPayload);
|
|
210
210
|
zs(h, y);
|
|
211
211
|
const d = Io(
|
|
@@ -214,7 +214,7 @@ function Ho(e) {
|
|
|
214
214
|
), v = d === (_.config ?? {}) ? x : { ...x, cards: [{ ..._, config: d }] }, b = X.getState();
|
|
215
215
|
if (((O = b.dashboard) == null ? void 0 : O.id) !== m || b.selectedSheetId !== w || b.isVisualEditing)
|
|
216
216
|
throw new at(Ut);
|
|
217
|
-
if (!r()) throw new at(
|
|
217
|
+
if (!r()) throw new at(Ho);
|
|
218
218
|
const { actions: N } = b;
|
|
219
219
|
if (N.setIsDashboardEditing(!0), N.addFrame(w, v, { semanticExecutionPayload: y }), !Qn(X.getState().dashboard, v.id))
|
|
220
220
|
throw b.isDashboardEditing || N.setIsDashboardEditing(!1), new at(Ut);
|
|
@@ -223,10 +223,10 @@ function Ho(e) {
|
|
|
223
223
|
[r, o, s]
|
|
224
224
|
), available: t && n && !a };
|
|
225
225
|
}
|
|
226
|
-
const Ut = "The dashboard changed while this was being added. Try again.",
|
|
226
|
+
const Ut = "The dashboard changed while this was being added. Try again.", Ho = "Changes to this dashboard can't be saved here, so the card wasn't added.";
|
|
227
227
|
function Qo(e, t, r) {
|
|
228
228
|
if (r !== "line" && r !== "bar" && r !== "stackedBar") return !0;
|
|
229
|
-
const n =
|
|
229
|
+
const n = Kn(Gn(t), r);
|
|
230
230
|
if (!n.ok) return !1;
|
|
231
231
|
const { x: a, y: s = [], series: o } = n.visual.encodings, c = Ms({ card: e, cardType: e.type, records: t.records }), f = (i, g, u) => JSON.stringify([i, g ?? null, [...u].sort()]);
|
|
232
232
|
return f(c.axisKeys, c.seriesKey, c.valueKeys) === f(a ? [a] : [], o, s);
|
|
@@ -457,7 +457,7 @@ function di(e, t) {
|
|
|
457
457
|
const r = (e.toString().split(".")[1] || "").length, n = (t.toString().split(".")[1] || "").length, a = r > n ? r : n, s = Number.parseInt(e.toFixed(a).replace(".", "")), o = Number.parseInt(t.toFixed(a).replace(".", ""));
|
|
458
458
|
return s % o / 10 ** a;
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function j(e, t, r) {
|
|
461
461
|
Object.defineProperty(e, t, {
|
|
462
462
|
get() {
|
|
463
463
|
{
|
|
@@ -757,18 +757,18 @@ const Si = (e) => (t, r, n, a) => {
|
|
|
757
757
|
error: new e(s.issues.map((o) => Te(o, a, Ee())))
|
|
758
758
|
} : { success: !0, data: s.value };
|
|
759
759
|
}, Ei = /* @__PURE__ */ wa(ya), Ti = /^[cC][^\s-]{8,}$/, Ai = /^[0-9a-z]+$/, Ci = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, $i = /^[0-9a-vA-V]{20}$/, Oi = /^[A-Za-z0-9]{27}$/, zi = /^[a-zA-Z0-9_-]{21}$/, Mi = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Pi = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Jr = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, Ri = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Zi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
760
|
-
function
|
|
760
|
+
function ji() {
|
|
761
761
|
return new RegExp(Zi, "u");
|
|
762
762
|
}
|
|
763
|
-
const
|
|
763
|
+
const Di = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Fi = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, Li = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Ui = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Bi = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, _a = /^[A-Za-z0-9_-]*$/, Vi = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, qi = /^\+(?:[0-9]){6,14}[0-9]$/, Ia = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Ji = /* @__PURE__ */ new RegExp(`^${Ia}$`);
|
|
764
764
|
function Sa(e) {
|
|
765
765
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
766
766
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Wi(e) {
|
|
769
769
|
return new RegExp(`^${Sa(e)}$`);
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Ki(e) {
|
|
772
772
|
const t = Sa({ precision: e.precision }), r = ["Z"];
|
|
773
773
|
e.local && r.push(""), e.offset && r.push("([+-]\\d{2}:\\d{2})");
|
|
774
774
|
const n = `${t}(?:${r.join("|")})`;
|
|
@@ -777,7 +777,7 @@ function Wi(e) {
|
|
|
777
777
|
const Gi = (e) => {
|
|
778
778
|
const t = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*";
|
|
779
779
|
return new RegExp(`^${t}$`);
|
|
780
|
-
},
|
|
780
|
+
}, Yi = /^\d+$/, Hi = /^-?\d+(?:\.\d+)?/i, Qi = /true|false/i, Xi = /null/i, el = /^[^A-Z]*$/, tl = /^[^a-z]*$/, le = /* @__PURE__ */ S("$ZodCheck", (e, t) => {
|
|
781
781
|
var r;
|
|
782
782
|
e._zod ?? (e._zod = {}), e._zod.def = t, (r = e._zod).onattach ?? (r.onattach = []);
|
|
783
783
|
}), Na = {
|
|
@@ -840,7 +840,7 @@ const Gi = (e) => {
|
|
|
840
840
|
const r = (o = t.format) == null ? void 0 : o.includes("int"), n = r ? "int" : "number", [a, s] = hi[t.format];
|
|
841
841
|
e._zod.onattach.push((c) => {
|
|
842
842
|
const f = c._zod.bag;
|
|
843
|
-
f.format = t.format, f.minimum = a, f.maximum = s, r && (f.pattern =
|
|
843
|
+
f.format = t.format, f.minimum = a, f.maximum = s, r && (f.pattern = Yi);
|
|
844
844
|
}), e._zod.check = (c) => {
|
|
845
845
|
const f = c.value;
|
|
846
846
|
if (r) {
|
|
@@ -1211,7 +1211,7 @@ const hl = {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
};
|
|
1213
1213
|
}), xl = /* @__PURE__ */ S("$ZodEmoji", (e, t) => {
|
|
1214
|
-
t.pattern ?? (t.pattern =
|
|
1214
|
+
t.pattern ?? (t.pattern = ji()), V.init(e, t);
|
|
1215
1215
|
}), wl = /* @__PURE__ */ S("$ZodNanoID", (e, t) => {
|
|
1216
1216
|
t.pattern ?? (t.pattern = zi), V.init(e, t);
|
|
1217
1217
|
}), _l = /* @__PURE__ */ S("$ZodCUID", (e, t) => {
|
|
@@ -1225,15 +1225,15 @@ const hl = {
|
|
|
1225
1225
|
}), kl = /* @__PURE__ */ S("$ZodKSUID", (e, t) => {
|
|
1226
1226
|
t.pattern ?? (t.pattern = Oi), V.init(e, t);
|
|
1227
1227
|
}), El = /* @__PURE__ */ S("$ZodISODateTime", (e, t) => {
|
|
1228
|
-
t.pattern ?? (t.pattern =
|
|
1228
|
+
t.pattern ?? (t.pattern = Ki(t)), V.init(e, t);
|
|
1229
1229
|
}), Tl = /* @__PURE__ */ S("$ZodISODate", (e, t) => {
|
|
1230
1230
|
t.pattern ?? (t.pattern = Ji), V.init(e, t);
|
|
1231
1231
|
}), Al = /* @__PURE__ */ S("$ZodISOTime", (e, t) => {
|
|
1232
|
-
t.pattern ?? (t.pattern =
|
|
1232
|
+
t.pattern ?? (t.pattern = Wi(t)), V.init(e, t);
|
|
1233
1233
|
}), Cl = /* @__PURE__ */ S("$ZodISODuration", (e, t) => {
|
|
1234
1234
|
t.pattern ?? (t.pattern = Mi), V.init(e, t);
|
|
1235
1235
|
}), $l = /* @__PURE__ */ S("$ZodIPv4", (e, t) => {
|
|
1236
|
-
t.pattern ?? (t.pattern =
|
|
1236
|
+
t.pattern ?? (t.pattern = Di), V.init(e, t), e._zod.onattach.push((r) => {
|
|
1237
1237
|
const n = r._zod.bag;
|
|
1238
1238
|
n.format = "ipv4";
|
|
1239
1239
|
});
|
|
@@ -1321,10 +1321,10 @@ const Zl = /* @__PURE__ */ S("$ZodBase64URL", (e, t) => {
|
|
|
1321
1321
|
continue: !t.abort
|
|
1322
1322
|
});
|
|
1323
1323
|
};
|
|
1324
|
-
}),
|
|
1324
|
+
}), jl = /* @__PURE__ */ S("$ZodE164", (e, t) => {
|
|
1325
1325
|
t.pattern ?? (t.pattern = qi), V.init(e, t);
|
|
1326
1326
|
});
|
|
1327
|
-
function
|
|
1327
|
+
function Dl(e, t = null) {
|
|
1328
1328
|
try {
|
|
1329
1329
|
const r = e.split(".");
|
|
1330
1330
|
if (r.length !== 3)
|
|
@@ -1340,7 +1340,7 @@ function jl(e, t = null) {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
const Fl = /* @__PURE__ */ S("$ZodJWT", (e, t) => {
|
|
1342
1342
|
V.init(e, t), e._zod.check = (r) => {
|
|
1343
|
-
|
|
1343
|
+
Dl(r.value, t.alg) || r.issues.push({
|
|
1344
1344
|
code: "invalid_format",
|
|
1345
1345
|
format: "jwt",
|
|
1346
1346
|
input: r.value,
|
|
@@ -1349,7 +1349,7 @@ const Fl = /* @__PURE__ */ S("$ZodJWT", (e, t) => {
|
|
|
1349
1349
|
});
|
|
1350
1350
|
};
|
|
1351
1351
|
}), Aa = /* @__PURE__ */ S("$ZodNumber", (e, t) => {
|
|
1352
|
-
U.init(e, t), e._zod.pattern = e._zod.bag.pattern ??
|
|
1352
|
+
U.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Hi, e._zod.parse = (r, n) => {
|
|
1353
1353
|
if (t.coerce)
|
|
1354
1354
|
try {
|
|
1355
1355
|
r.value = Number(r.value);
|
|
@@ -1404,7 +1404,7 @@ const Fl = /* @__PURE__ */ S("$ZodJWT", (e, t) => {
|
|
|
1404
1404
|
inst: e
|
|
1405
1405
|
}), r);
|
|
1406
1406
|
});
|
|
1407
|
-
function
|
|
1407
|
+
function Wr(e, t, r) {
|
|
1408
1408
|
e.issues.length && t.issues.push(...Re(r, e.issues)), t.value[r] = e.value;
|
|
1409
1409
|
}
|
|
1410
1410
|
const Jl = /* @__PURE__ */ S("$ZodArray", (e, t) => {
|
|
@@ -1424,7 +1424,7 @@ const Jl = /* @__PURE__ */ S("$ZodArray", (e, t) => {
|
|
|
1424
1424
|
value: c,
|
|
1425
1425
|
issues: []
|
|
1426
1426
|
}, n);
|
|
1427
|
-
f instanceof Promise ? s.push(f.then((i) =>
|
|
1427
|
+
f instanceof Promise ? s.push(f.then((i) => Wr(i, r, o))) : Wr(f, r, o);
|
|
1428
1428
|
}
|
|
1429
1429
|
return s.length ? Promise.all(s).then(() => r) : r;
|
|
1430
1430
|
};
|
|
@@ -1432,10 +1432,10 @@ const Jl = /* @__PURE__ */ S("$ZodArray", (e, t) => {
|
|
|
1432
1432
|
function It(e, t, r) {
|
|
1433
1433
|
e.issues.length && t.issues.push(...Re(r, e.issues)), t.value[r] = e.value;
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function Kr(e, t, r, n) {
|
|
1436
1436
|
e.issues.length ? n[r] === void 0 ? r in n ? t.value[r] = void 0 : t.value[r] = e.value : t.issues.push(...Re(r, e.issues)) : e.value === void 0 ? r in n && (t.value[r] = void 0) : t.value[r] = e.value;
|
|
1437
1437
|
}
|
|
1438
|
-
const
|
|
1438
|
+
const Wl = /* @__PURE__ */ S("$ZodObject", (e, t) => {
|
|
1439
1439
|
U.init(e, t);
|
|
1440
1440
|
const r = fr(() => {
|
|
1441
1441
|
const u = Object.keys(t.shape);
|
|
@@ -1451,7 +1451,7 @@ const Kl = /* @__PURE__ */ S("$ZodObject", (e, t) => {
|
|
|
1451
1451
|
optionalKeys: new Set(m)
|
|
1452
1452
|
};
|
|
1453
1453
|
});
|
|
1454
|
-
|
|
1454
|
+
j(e._zod, "propValues", () => {
|
|
1455
1455
|
const u = t.shape, m = {};
|
|
1456
1456
|
for (const w in u) {
|
|
1457
1457
|
const I = u[w]._zod;
|
|
@@ -1532,7 +1532,7 @@ const Kl = /* @__PURE__ */ S("$ZodObject", (e, t) => {
|
|
|
1532
1532
|
const h = g.shape;
|
|
1533
1533
|
for (const d of g.keys) {
|
|
1534
1534
|
const v = h[d], b = v._zod.run({ value: w[d], issues: [] }, m), N = v._zod.optin === "optional" && v._zod.optout === "optional";
|
|
1535
|
-
b instanceof Promise ? I.push(b.then((T) => N ?
|
|
1535
|
+
b instanceof Promise ? I.push(b.then((T) => N ? Kr(T, u, d, w) : It(T, u, d))) : N ? Kr(b, u, d, w) : It(b, u, d);
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
if (!i)
|
|
@@ -1568,10 +1568,10 @@ function Gr(e, t, r, n) {
|
|
|
1568
1568
|
}), t;
|
|
1569
1569
|
}
|
|
1570
1570
|
const Ca = /* @__PURE__ */ S("$ZodUnion", (e, t) => {
|
|
1571
|
-
U.init(e, t),
|
|
1571
|
+
U.init(e, t), j(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), j(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), j(e._zod, "values", () => {
|
|
1572
1572
|
if (t.options.every((r) => r._zod.values))
|
|
1573
1573
|
return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
|
|
1574
|
-
}),
|
|
1574
|
+
}), j(e._zod, "pattern", () => {
|
|
1575
1575
|
if (t.options.every((r) => r._zod.pattern)) {
|
|
1576
1576
|
const r = t.options.map((n) => n._zod.pattern);
|
|
1577
1577
|
return new RegExp(`^(${r.map((n) => hr(n.source)).join("|")})$`);
|
|
@@ -1594,10 +1594,10 @@ const Ca = /* @__PURE__ */ S("$ZodUnion", (e, t) => {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
return a ? Promise.all(s).then((o) => Gr(o, r, e, n)) : Gr(s, r, e, n);
|
|
1596
1596
|
};
|
|
1597
|
-
}),
|
|
1597
|
+
}), Kl = /* @__PURE__ */ S("$ZodDiscriminatedUnion", (e, t) => {
|
|
1598
1598
|
Ca.init(e, t);
|
|
1599
1599
|
const r = e._zod.parse;
|
|
1600
|
-
|
|
1600
|
+
j(e._zod, "propValues", () => {
|
|
1601
1601
|
const a = {};
|
|
1602
1602
|
for (const s of t.options) {
|
|
1603
1603
|
const o = s._zod.propValues;
|
|
@@ -1647,7 +1647,7 @@ const Ca = /* @__PURE__ */ S("$ZodUnion", (e, t) => {
|
|
|
1647
1647
|
}), Gl = /* @__PURE__ */ S("$ZodIntersection", (e, t) => {
|
|
1648
1648
|
U.init(e, t), e._zod.parse = (r, n) => {
|
|
1649
1649
|
const a = r.value, s = t.left._zod.run({ value: a, issues: [] }, n), o = t.right._zod.run({ value: a, issues: [] }, n);
|
|
1650
|
-
return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([f, i]) =>
|
|
1650
|
+
return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([f, i]) => Yr(r, f, i)) : Yr(r, s, o);
|
|
1651
1651
|
};
|
|
1652
1652
|
});
|
|
1653
1653
|
function rr(e, t) {
|
|
@@ -1685,7 +1685,7 @@ function rr(e, t) {
|
|
|
1685
1685
|
}
|
|
1686
1686
|
return { valid: !1, mergeErrorPath: [] };
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function Yr(e, t, r) {
|
|
1689
1689
|
if (t.issues.length && e.issues.push(...t.issues), r.issues.length && e.issues.push(...r.issues), ot(e))
|
|
1690
1690
|
return e;
|
|
1691
1691
|
const n = rr(t.value, r.value);
|
|
@@ -1693,7 +1693,7 @@ function Hr(e, t, r) {
|
|
|
1693
1693
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);
|
|
1694
1694
|
return e.value = n.data, e;
|
|
1695
1695
|
}
|
|
1696
|
-
const
|
|
1696
|
+
const Yl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
|
|
1697
1697
|
U.init(e, t), e._zod.parse = (r, n) => {
|
|
1698
1698
|
const a = r.value;
|
|
1699
1699
|
if (!Ct(a))
|
|
@@ -1750,7 +1750,7 @@ const Hl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
return s.length ? Promise.all(s).then(() => r) : r;
|
|
1752
1752
|
};
|
|
1753
|
-
}),
|
|
1753
|
+
}), Hl = /* @__PURE__ */ S("$ZodEnum", (e, t) => {
|
|
1754
1754
|
U.init(e, t);
|
|
1755
1755
|
const r = ha(t.entries);
|
|
1756
1756
|
e._zod.values = new Set(r), e._zod.pattern = new RegExp(`^(${r.filter((n) => fi.has(typeof n)).map((n) => typeof n == "string" ? ht(n) : n.toString()).join("|")})$`), e._zod.parse = (n, a) => {
|
|
@@ -1782,30 +1782,30 @@ const Hl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
|
|
|
1782
1782
|
return r.value = a, r;
|
|
1783
1783
|
};
|
|
1784
1784
|
}), ec = /* @__PURE__ */ S("$ZodOptional", (e, t) => {
|
|
1785
|
-
U.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional",
|
|
1785
|
+
U.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", j(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), j(e._zod, "pattern", () => {
|
|
1786
1786
|
const r = t.innerType._zod.pattern;
|
|
1787
1787
|
return r ? new RegExp(`^(${hr(r.source)})?$`) : void 0;
|
|
1788
1788
|
}), e._zod.parse = (r, n) => t.innerType._zod.optin === "optional" ? t.innerType._zod.run(r, n) : r.value === void 0 ? r : t.innerType._zod.run(r, n);
|
|
1789
1789
|
}), tc = /* @__PURE__ */ S("$ZodNullable", (e, t) => {
|
|
1790
|
-
U.init(e, t),
|
|
1790
|
+
U.init(e, t), j(e._zod, "optin", () => t.innerType._zod.optin), j(e._zod, "optout", () => t.innerType._zod.optout), j(e._zod, "pattern", () => {
|
|
1791
1791
|
const r = t.innerType._zod.pattern;
|
|
1792
1792
|
return r ? new RegExp(`^(${hr(r.source)}|null)$`) : void 0;
|
|
1793
|
-
}),
|
|
1793
|
+
}), j(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (r, n) => r.value === null ? r : t.innerType._zod.run(r, n);
|
|
1794
1794
|
}), rc = /* @__PURE__ */ S("$ZodDefault", (e, t) => {
|
|
1795
|
-
U.init(e, t), e._zod.optin = "optional",
|
|
1795
|
+
U.init(e, t), e._zod.optin = "optional", j(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1796
1796
|
if (r.value === void 0)
|
|
1797
1797
|
return r.value = t.defaultValue, r;
|
|
1798
1798
|
const a = t.innerType._zod.run(r, n);
|
|
1799
|
-
return a instanceof Promise ? a.then((s) =>
|
|
1799
|
+
return a instanceof Promise ? a.then((s) => Hr(s, t)) : Hr(a, t);
|
|
1800
1800
|
};
|
|
1801
1801
|
});
|
|
1802
|
-
function
|
|
1802
|
+
function Hr(e, t) {
|
|
1803
1803
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1804
1804
|
}
|
|
1805
1805
|
const nc = /* @__PURE__ */ S("$ZodPrefault", (e, t) => {
|
|
1806
|
-
U.init(e, t), e._zod.optin = "optional",
|
|
1806
|
+
U.init(e, t), e._zod.optin = "optional", j(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => (r.value === void 0 && (r.value = t.defaultValue), t.innerType._zod.run(r, n));
|
|
1807
1807
|
}), ac = /* @__PURE__ */ S("$ZodNonOptional", (e, t) => {
|
|
1808
|
-
U.init(e, t),
|
|
1808
|
+
U.init(e, t), j(e._zod, "values", () => {
|
|
1809
1809
|
const r = t.innerType._zod.values;
|
|
1810
1810
|
return r ? new Set([...r].filter((n) => n !== void 0)) : void 0;
|
|
1811
1811
|
}), e._zod.parse = (r, n) => {
|
|
@@ -1822,7 +1822,7 @@ function Qr(e, t) {
|
|
|
1822
1822
|
}), e;
|
|
1823
1823
|
}
|
|
1824
1824
|
const sc = /* @__PURE__ */ S("$ZodCatch", (e, t) => {
|
|
1825
|
-
U.init(e, t), e._zod.optin = "optional",
|
|
1825
|
+
U.init(e, t), e._zod.optin = "optional", j(e._zod, "optout", () => t.innerType._zod.optout), j(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1826
1826
|
const a = t.innerType._zod.run(r, n);
|
|
1827
1827
|
return a instanceof Promise ? a.then((s) => (r.value = s.value, s.issues.length && (r.value = t.catchValue({
|
|
1828
1828
|
...r,
|
|
@@ -1839,7 +1839,7 @@ const sc = /* @__PURE__ */ S("$ZodCatch", (e, t) => {
|
|
|
1839
1839
|
}), r.issues = []), r);
|
|
1840
1840
|
};
|
|
1841
1841
|
}), oc = /* @__PURE__ */ S("$ZodPipe", (e, t) => {
|
|
1842
|
-
U.init(e, t),
|
|
1842
|
+
U.init(e, t), j(e._zod, "values", () => t.in._zod.values), j(e._zod, "optin", () => t.in._zod.optin), j(e._zod, "optout", () => t.out._zod.optout), e._zod.parse = (r, n) => {
|
|
1843
1843
|
const a = t.in._zod.run(r, n);
|
|
1844
1844
|
return a instanceof Promise ? a.then((s) => Xr(s, t, n)) : Xr(a, t, n);
|
|
1845
1845
|
};
|
|
@@ -1848,7 +1848,7 @@ function Xr(e, t, r) {
|
|
|
1848
1848
|
return ot(e) ? e : t.out._zod.run({ value: e.value, issues: e.issues }, r);
|
|
1849
1849
|
}
|
|
1850
1850
|
const ic = /* @__PURE__ */ S("$ZodReadonly", (e, t) => {
|
|
1851
|
-
U.init(e, t),
|
|
1851
|
+
U.init(e, t), j(e._zod, "propValues", () => t.innerType._zod.propValues), j(e._zod, "values", () => t.innerType._zod.values), j(e._zod, "optin", () => t.innerType._zod.optin), j(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (r, n) => {
|
|
1852
1852
|
const a = t.innerType._zod.run(r, n);
|
|
1853
1853
|
return a instanceof Promise ? a.then(en) : en(a);
|
|
1854
1854
|
};
|
|
@@ -1857,7 +1857,7 @@ function en(e) {
|
|
|
1857
1857
|
return e.value = Object.freeze(e.value), e;
|
|
1858
1858
|
}
|
|
1859
1859
|
const lc = /* @__PURE__ */ S("$ZodLazy", (e, t) => {
|
|
1860
|
-
U.init(e, t),
|
|
1860
|
+
U.init(e, t), j(e._zod, "innerType", () => t.getter()), j(e._zod, "pattern", () => e._zod.innerType._zod.pattern), j(e._zod, "propValues", () => e._zod.innerType._zod.propValues), j(e._zod, "optin", () => e._zod.innerType._zod.optin), j(e._zod, "optout", () => e._zod.innerType._zod.optout), e._zod.parse = (r, n) => e._zod.innerType._zod.run(r, n);
|
|
1861
1861
|
}), cc = /* @__PURE__ */ S("$ZodCustom", (e, t) => {
|
|
1862
1862
|
le.init(e, t), U.init(e, t), e._zod.parse = (r, n) => r, e._zod.check = (r) => {
|
|
1863
1863
|
const n = r.value, a = t.fn(n);
|
|
@@ -2167,7 +2167,7 @@ function Zc(e, t) {
|
|
|
2167
2167
|
...$(t)
|
|
2168
2168
|
});
|
|
2169
2169
|
}
|
|
2170
|
-
function
|
|
2170
|
+
function jc(e, t) {
|
|
2171
2171
|
return new e({
|
|
2172
2172
|
type: "number",
|
|
2173
2173
|
check: "number_format",
|
|
@@ -2176,7 +2176,7 @@ function Dc(e, t) {
|
|
|
2176
2176
|
...$(t)
|
|
2177
2177
|
});
|
|
2178
2178
|
}
|
|
2179
|
-
function
|
|
2179
|
+
function Dc(e, t) {
|
|
2180
2180
|
return new e({
|
|
2181
2181
|
type: "boolean",
|
|
2182
2182
|
...$(t)
|
|
@@ -2289,7 +2289,7 @@ function Jc(e, t) {
|
|
|
2289
2289
|
includes: e
|
|
2290
2290
|
});
|
|
2291
2291
|
}
|
|
2292
|
-
function
|
|
2292
|
+
function Wc(e, t) {
|
|
2293
2293
|
return new dl({
|
|
2294
2294
|
check: "string_format",
|
|
2295
2295
|
format: "starts_with",
|
|
@@ -2297,7 +2297,7 @@ function Kc(e, t) {
|
|
|
2297
2297
|
prefix: e
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2300
|
+
function Kc(e, t) {
|
|
2301
2301
|
return new pl({
|
|
2302
2302
|
check: "string_format",
|
|
2303
2303
|
format: "ends_with",
|
|
@@ -2314,10 +2314,10 @@ function gt(e) {
|
|
|
2314
2314
|
function Gc(e) {
|
|
2315
2315
|
return gt((t) => t.normalize(e));
|
|
2316
2316
|
}
|
|
2317
|
-
function
|
|
2317
|
+
function Yc() {
|
|
2318
2318
|
return gt((e) => e.trim());
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2320
|
+
function Hc() {
|
|
2321
2321
|
return gt((e) => e.toLowerCase());
|
|
2322
2322
|
}
|
|
2323
2323
|
function Qc() {
|
|
@@ -2910,9 +2910,9 @@ const du = (e, t) => {
|
|
|
2910
2910
|
// enumerable: false,
|
|
2911
2911
|
}
|
|
2912
2912
|
});
|
|
2913
|
-
},
|
|
2913
|
+
}, jt = S("ZodError", du, {
|
|
2914
2914
|
Parent: Error
|
|
2915
|
-
}), pu = /* @__PURE__ */ Si(
|
|
2915
|
+
}), pu = /* @__PURE__ */ Si(jt), fu = /* @__PURE__ */ Ni(jt), mu = /* @__PURE__ */ xa(jt), Ma = /* @__PURE__ */ wa(jt), q = /* @__PURE__ */ S("ZodType", (e, t) => (U.init(e, t), e.def = t, Object.defineProperty(e, "_def", { value: t }), e.check = (...r) => e.clone(
|
|
2916
2916
|
{
|
|
2917
2917
|
...t,
|
|
2918
2918
|
checks: [
|
|
@@ -2921,7 +2921,7 @@ const du = (e, t) => {
|
|
|
2921
2921
|
]
|
|
2922
2922
|
}
|
|
2923
2923
|
// { parent: true }
|
|
2924
|
-
), e.clone = (r, n) => Je(e, r, n), e.brand = () => e, e.register = (r, n) => (r.add(e, n), e), e.parse = (r, n) => pu(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => mu(e, r, n), e.parseAsync = async (r, n) => fu(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => Ma(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(gd(r, n)), e.superRefine = (r) => e.check(bd(r)), e.overwrite = (r) => e.check(gt(r)), e.optional = () => un(e), e.nullable = () => dn(e), e.nullish = () => un(dn(e)), e.nonoptional = (r) => od(e, r), e.array = () =>
|
|
2924
|
+
), e.clone = (r, n) => Je(e, r, n), e.brand = () => e, e.register = (r, n) => (r.add(e, n), e), e.parse = (r, n) => pu(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => mu(e, r, n), e.parseAsync = async (r, n) => fu(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => Ma(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(gd(r, n)), e.superRefine = (r) => e.check(bd(r)), e.overwrite = (r) => e.check(gt(r)), e.optional = () => un(e), e.nullable = () => dn(e), e.nullish = () => un(dn(e)), e.nonoptional = (r) => od(e, r), e.array = () => ja(e), e.or = (r) => La([e, r]), e.and = (r) => Ku(e, r), e.transform = (r) => pn(e, ed(r)), e.default = (r) => nd(e, r), e.prefault = (r) => sd(e, r), e.catch = (r) => ld(e, r), e.pipe = (r) => pn(e, r), e.readonly = () => dd(e), e.describe = (r) => {
|
|
2925
2925
|
const n = e.clone();
|
|
2926
2926
|
return st.add(n, { description: r }), n;
|
|
2927
2927
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2938,7 +2938,7 @@ const du = (e, t) => {
|
|
|
2938
2938
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Pa = /* @__PURE__ */ S("_ZodString", (e, t) => {
|
|
2939
2939
|
br.init(e, t), q.init(e, t);
|
|
2940
2940
|
const r = e._zod.bag;
|
|
2941
|
-
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(Bc(...n)), e.includes = (...n) => e.check(Jc(...n)), e.startsWith = (...n) => e.check(
|
|
2941
|
+
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(Bc(...n)), e.includes = (...n) => e.check(Jc(...n)), e.startsWith = (...n) => e.check(Wc(...n)), e.endsWith = (...n) => e.check(Kc(...n)), e.min = (...n) => e.check($t(...n)), e.max = (...n) => e.check(Oa(...n)), e.length = (...n) => e.check(za(...n)), e.nonempty = (...n) => e.check($t(1, ...n)), e.lowercase = (n) => e.check(Vc(n)), e.uppercase = (n) => e.check(qc(n)), e.trim = () => e.check(Yc()), e.normalize = (...n) => e.check(Gc(...n)), e.toLowerCase = () => e.check(Hc()), e.toUpperCase = () => e.check(Qc());
|
|
2942
2942
|
}), hu = /* @__PURE__ */ S("ZodString", (e, t) => {
|
|
2943
2943
|
br.init(e, t), Pa.init(e, t), e.email = (r) => e.check(pc(bu, r)), e.url = (r) => e.check(bc(vu, r)), e.jwt = (r) => e.check(Oc(zu, r)), e.emoji = (r) => e.check(vc(yu, r)), e.guid = (r) => e.check(rn(ln, r)), e.uuid = (r) => e.check(fc(St, r)), e.uuidv4 = (r) => e.check(mc(St, r)), e.uuidv6 = (r) => e.check(hc(St, r)), e.uuidv7 = (r) => e.check(gc(St, r)), e.nanoid = (r) => e.check(yc(xu, r)), e.guid = (r) => e.check(rn(ln, r)), e.cuid = (r) => e.check(xc(wu, r)), e.cuid2 = (r) => e.check(wc(_u, r)), e.ulid = (r) => e.check(_c(Iu, r)), e.base64 = (r) => e.check(Ac(Cu, r)), e.base64url = (r) => e.check(Cc($u, r)), e.xid = (r) => e.check(Ic(Su, r)), e.ksuid = (r) => e.check(Sc(Nu, r)), e.ipv4 = (r) => e.check(Nc(ku, r)), e.ipv6 = (r) => e.check(kc(Eu, r)), e.cidrv4 = (r) => e.check(Ec(Tu, r)), e.cidrv6 = (r) => e.check(Tc(Au, r)), e.e164 = (r) => e.check($c(Ou, r)), e.datetime = (r) => e.check(au(r)), e.date = (r) => e.check(ou(r)), e.time = (r) => e.check(lu(r)), e.duration = (r) => e.check(uu(r));
|
|
2944
2944
|
});
|
|
@@ -2982,7 +2982,7 @@ const J = /* @__PURE__ */ S("ZodStringFormat", (e, t) => {
|
|
|
2982
2982
|
}), $u = /* @__PURE__ */ S("ZodBase64URL", (e, t) => {
|
|
2983
2983
|
Zl.init(e, t), J.init(e, t);
|
|
2984
2984
|
}), Ou = /* @__PURE__ */ S("ZodE164", (e, t) => {
|
|
2985
|
-
|
|
2985
|
+
jl.init(e, t), J.init(e, t);
|
|
2986
2986
|
}), zu = /* @__PURE__ */ S("ZodJWT", (e, t) => {
|
|
2987
2987
|
Fl.init(e, t), J.init(e, t);
|
|
2988
2988
|
}), Ra = /* @__PURE__ */ S("ZodNumber", (e, t) => {
|
|
@@ -2997,19 +2997,19 @@ const Pu = /* @__PURE__ */ S("ZodNumberFormat", (e, t) => {
|
|
|
2997
2997
|
Ll.init(e, t), Ra.init(e, t);
|
|
2998
2998
|
});
|
|
2999
2999
|
function cn(e) {
|
|
3000
|
-
return
|
|
3000
|
+
return jc(Pu, e);
|
|
3001
3001
|
}
|
|
3002
3002
|
const Ru = /* @__PURE__ */ S("ZodBoolean", (e, t) => {
|
|
3003
3003
|
Ul.init(e, t), q.init(e, t);
|
|
3004
3004
|
});
|
|
3005
3005
|
function Zu(e) {
|
|
3006
|
-
return
|
|
3006
|
+
return Dc(Ru, e);
|
|
3007
3007
|
}
|
|
3008
|
-
const
|
|
3008
|
+
const ju = /* @__PURE__ */ S("ZodNull", (e, t) => {
|
|
3009
3009
|
Bl.init(e, t), q.init(e, t);
|
|
3010
3010
|
});
|
|
3011
|
-
function
|
|
3012
|
-
return Fc(
|
|
3011
|
+
function Du(e) {
|
|
3012
|
+
return Fc(ju, e);
|
|
3013
3013
|
}
|
|
3014
3014
|
const Fu = /* @__PURE__ */ S("ZodUnknown", (e, t) => {
|
|
3015
3015
|
Vl.init(e, t), q.init(e, t);
|
|
@@ -3026,11 +3026,11 @@ function Za(e) {
|
|
|
3026
3026
|
const Uu = /* @__PURE__ */ S("ZodArray", (e, t) => {
|
|
3027
3027
|
Jl.init(e, t), q.init(e, t), e.element = t.element, e.min = (r, n) => e.check($t(r, n)), e.nonempty = (r) => e.check($t(1, r)), e.max = (r, n) => e.check(Oa(r, n)), e.length = (r, n) => e.check(za(r, n)), e.unwrap = () => e.element;
|
|
3028
3028
|
});
|
|
3029
|
-
function
|
|
3029
|
+
function ja(e, t) {
|
|
3030
3030
|
return Xc(Uu, e, t);
|
|
3031
3031
|
}
|
|
3032
|
-
const
|
|
3033
|
-
|
|
3032
|
+
const Da = /* @__PURE__ */ S("ZodObject", (e, t) => {
|
|
3033
|
+
Wl.init(e, t), q.init(e, t), j(e, "shape", () => t.shape), e.keyof = () => Ua(Object.keys(e._zod.def.shape)), e.catchall = (r) => e.clone({ ...e._zod.def, catchall: r }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Ot() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Ot() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Za() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (r) => vi(e, r), e.merge = (r) => yi(e, r), e.pick = (r) => gi(e, r), e.omit = (r) => bi(e, r), e.partial = (...r) => xi(Ba, e, r[0]), e.required = (...r) => wi(Va, e, r[0]);
|
|
3034
3034
|
});
|
|
3035
3035
|
function Bu(e, t) {
|
|
3036
3036
|
const r = {
|
|
@@ -3040,10 +3040,10 @@ function Bu(e, t) {
|
|
|
3040
3040
|
},
|
|
3041
3041
|
...$(t)
|
|
3042
3042
|
};
|
|
3043
|
-
return new
|
|
3043
|
+
return new Da(r);
|
|
3044
3044
|
}
|
|
3045
3045
|
function Vu(e, t) {
|
|
3046
|
-
return new
|
|
3046
|
+
return new Da({
|
|
3047
3047
|
type: "object",
|
|
3048
3048
|
get shape() {
|
|
3049
3049
|
return Rt(this, "shape", { ...e }), this.shape;
|
|
@@ -3063,7 +3063,7 @@ function La(e, t) {
|
|
|
3063
3063
|
});
|
|
3064
3064
|
}
|
|
3065
3065
|
const qu = /* @__PURE__ */ S("ZodDiscriminatedUnion", (e, t) => {
|
|
3066
|
-
Fa.init(e, t),
|
|
3066
|
+
Fa.init(e, t), Kl.init(e, t);
|
|
3067
3067
|
});
|
|
3068
3068
|
function Ju(e, t, r) {
|
|
3069
3069
|
return new qu({
|
|
@@ -3073,20 +3073,20 @@ function Ju(e, t, r) {
|
|
|
3073
3073
|
...$(r)
|
|
3074
3074
|
});
|
|
3075
3075
|
}
|
|
3076
|
-
const
|
|
3076
|
+
const Wu = /* @__PURE__ */ S("ZodIntersection", (e, t) => {
|
|
3077
3077
|
Gl.init(e, t), q.init(e, t);
|
|
3078
3078
|
});
|
|
3079
|
-
function
|
|
3080
|
-
return new
|
|
3079
|
+
function Ku(e, t) {
|
|
3080
|
+
return new Wu({
|
|
3081
3081
|
type: "intersection",
|
|
3082
3082
|
left: e,
|
|
3083
3083
|
right: t
|
|
3084
3084
|
});
|
|
3085
3085
|
}
|
|
3086
3086
|
const Gu = /* @__PURE__ */ S("ZodRecord", (e, t) => {
|
|
3087
|
-
|
|
3087
|
+
Yl.init(e, t), q.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
3088
3088
|
});
|
|
3089
|
-
function
|
|
3089
|
+
function Yu(e, t, r) {
|
|
3090
3090
|
return new Gu({
|
|
3091
3091
|
type: "record",
|
|
3092
3092
|
keyType: e,
|
|
@@ -3095,7 +3095,7 @@ function Hu(e, t, r) {
|
|
|
3095
3095
|
});
|
|
3096
3096
|
}
|
|
3097
3097
|
const nr = /* @__PURE__ */ S("ZodEnum", (e, t) => {
|
|
3098
|
-
|
|
3098
|
+
Hl.init(e, t), q.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
3099
3099
|
const r = new Set(Object.keys(t.entries));
|
|
3100
3100
|
e.extract = (n, a) => {
|
|
3101
3101
|
const s = {};
|
|
@@ -3133,7 +3133,7 @@ function Ua(e, t) {
|
|
|
3133
3133
|
...$(t)
|
|
3134
3134
|
});
|
|
3135
3135
|
}
|
|
3136
|
-
const
|
|
3136
|
+
const Hu = /* @__PURE__ */ S("ZodLiteral", (e, t) => {
|
|
3137
3137
|
Ql.init(e, t), q.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
3138
3138
|
get() {
|
|
3139
3139
|
if (t.values.length > 1)
|
|
@@ -3143,7 +3143,7 @@ const Yu = /* @__PURE__ */ S("ZodLiteral", (e, t) => {
|
|
|
3143
3143
|
});
|
|
3144
3144
|
});
|
|
3145
3145
|
function Qu(e, t) {
|
|
3146
|
-
return new
|
|
3146
|
+
return new Hu({
|
|
3147
3147
|
type: "literal",
|
|
3148
3148
|
values: Array.isArray(e) ? e : [e],
|
|
3149
3149
|
...$(t)
|
|
@@ -3355,14 +3355,14 @@ function xd(e) {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
const T = v.charCodeAt(b);
|
|
3357
3357
|
if (mn(v, b, T)) {
|
|
3358
|
-
const O = v.charCodeAt(b + 5) === ze ? b + 6 : b + 5,
|
|
3358
|
+
const O = v.charCodeAt(b + 5) === ze ? b + 6 : b + 5, W = v.slice(O, N);
|
|
3359
3359
|
if (u === 0 && v.charCodeAt(N + 1) === fn) {
|
|
3360
|
-
t({ id: i, event: m, data:
|
|
3360
|
+
t({ id: i, event: m, data: W }), i = void 0, g = "", m = void 0, b = N + 2, N = v.indexOf(`
|
|
3361
3361
|
`, b);
|
|
3362
3362
|
continue;
|
|
3363
3363
|
}
|
|
3364
|
-
g = u === 0 ?
|
|
3365
|
-
${
|
|
3364
|
+
g = u === 0 ? W : `${g}
|
|
3365
|
+
${W}`, u++;
|
|
3366
3366
|
} else hn(v, b, T) ? m = v.slice(
|
|
3367
3367
|
v.charCodeAt(b + 6) === ze ? b + 7 : b + 6,
|
|
3368
3368
|
N
|
|
@@ -3389,7 +3389,7 @@ ${K}`, u++;
|
|
|
3389
3389
|
}
|
|
3390
3390
|
const T = v.charCodeAt(b);
|
|
3391
3391
|
if (mn(v, b, T)) {
|
|
3392
|
-
const
|
|
3392
|
+
const K = v.charCodeAt(b + 5) === ze ? b + 6 : b + 5, ye = v.slice(K, N);
|
|
3393
3393
|
g = u === 0 ? ye : `${g}
|
|
3394
3394
|
${ye}`, u++;
|
|
3395
3395
|
return;
|
|
@@ -3399,24 +3399,24 @@ ${ye}`, u++;
|
|
|
3399
3399
|
return;
|
|
3400
3400
|
}
|
|
3401
3401
|
if (T === 105 && v.charCodeAt(b + 1) === 100 && v.charCodeAt(b + 2) === 58) {
|
|
3402
|
-
const
|
|
3403
|
-
|
|
3402
|
+
const K = v.slice(v.charCodeAt(b + 3) === ze ? b + 4 : b + 3, N);
|
|
3403
|
+
K.includes("\0") || (i = K);
|
|
3404
3404
|
return;
|
|
3405
3405
|
}
|
|
3406
3406
|
if (T === 58) {
|
|
3407
3407
|
if (a) {
|
|
3408
|
-
const
|
|
3409
|
-
a(
|
|
3408
|
+
const K = v.slice(b, N);
|
|
3409
|
+
a(K.slice(v.charCodeAt(b + 1) === ze ? 2 : 1));
|
|
3410
3410
|
}
|
|
3411
3411
|
return;
|
|
3412
3412
|
}
|
|
3413
|
-
const O = v.slice(b, N),
|
|
3414
|
-
if (
|
|
3413
|
+
const O = v.slice(b, N), W = O.indexOf(":");
|
|
3414
|
+
if (W === -1) {
|
|
3415
3415
|
y(O, "", O);
|
|
3416
3416
|
return;
|
|
3417
3417
|
}
|
|
3418
|
-
const
|
|
3419
|
-
y(
|
|
3418
|
+
const H = O.slice(0, W), We = O.charCodeAt(W + 1) === ze ? 2 : 1, Ke = O.slice(W + We);
|
|
3419
|
+
y(H, Ke, O);
|
|
3420
3420
|
}
|
|
3421
3421
|
function y(v, b, N) {
|
|
3422
3422
|
switch (v) {
|
|
@@ -3684,8 +3684,8 @@ function Zd(e) {
|
|
|
3684
3684
|
enum: Array.from(e.values)
|
|
3685
3685
|
};
|
|
3686
3686
|
}
|
|
3687
|
-
const
|
|
3688
|
-
function
|
|
3687
|
+
const jd = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
3688
|
+
function Dd(e, t) {
|
|
3689
3689
|
const r = [F(e.left._def, {
|
|
3690
3690
|
...t,
|
|
3691
3691
|
currentPath: [
|
|
@@ -3702,7 +3702,7 @@ function jd(e, t) {
|
|
|
3702
3702
|
]
|
|
3703
3703
|
})].filter((a) => !!a), n = [];
|
|
3704
3704
|
return r.forEach((a) => {
|
|
3705
|
-
if (
|
|
3705
|
+
if (jd(a)) n.push(...a.allOf);
|
|
3706
3706
|
else {
|
|
3707
3707
|
let s = a;
|
|
3708
3708
|
if ("additionalProperties" in a && a.additionalProperties === !1) {
|
|
@@ -3720,7 +3720,7 @@ function Fd(e) {
|
|
|
3720
3720
|
const: e.value
|
|
3721
3721
|
};
|
|
3722
3722
|
}
|
|
3723
|
-
let
|
|
3723
|
+
let Wt;
|
|
3724
3724
|
const he = {
|
|
3725
3725
|
/**
|
|
3726
3726
|
* `c` was changed to `[cC]` to replicate /i flag
|
|
@@ -3743,7 +3743,7 @@ const he = {
|
|
|
3743
3743
|
* Fix in Zod:
|
|
3744
3744
|
* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
|
|
3745
3745
|
*/
|
|
3746
|
-
emoji: () => (
|
|
3746
|
+
emoji: () => (Wt === void 0 && (Wt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Wt),
|
|
3747
3747
|
/**
|
|
3748
3748
|
* Unused
|
|
3749
3749
|
*/
|
|
@@ -3763,7 +3763,7 @@ const he = {
|
|
|
3763
3763
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
3764
3764
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
3765
3765
|
};
|
|
3766
|
-
function
|
|
3766
|
+
function Wa(e, t) {
|
|
3767
3767
|
const r = { type: "string" };
|
|
3768
3768
|
if (e.checks) for (const n of e.checks) switch (n.kind) {
|
|
3769
3769
|
case "min":
|
|
@@ -3800,10 +3800,10 @@ function Ka(e, t) {
|
|
|
3800
3800
|
oe(r, he.cuid2, n.message, t);
|
|
3801
3801
|
break;
|
|
3802
3802
|
case "startsWith":
|
|
3803
|
-
oe(r, RegExp(`^${
|
|
3803
|
+
oe(r, RegExp(`^${Kt(n.value, t)}`), n.message, t);
|
|
3804
3804
|
break;
|
|
3805
3805
|
case "endsWith":
|
|
3806
|
-
oe(r, RegExp(`${
|
|
3806
|
+
oe(r, RegExp(`${Kt(n.value, t)}$`), n.message, t);
|
|
3807
3807
|
break;
|
|
3808
3808
|
case "datetime":
|
|
3809
3809
|
ge(r, "date-time", n.message, t);
|
|
@@ -3821,7 +3821,7 @@ function Ka(e, t) {
|
|
|
3821
3821
|
r.minLength = typeof r.minLength == "number" ? Math.max(r.minLength, n.value) : n.value, r.maxLength = typeof r.maxLength == "number" ? Math.min(r.maxLength, n.value) : n.value;
|
|
3822
3822
|
break;
|
|
3823
3823
|
case "includes":
|
|
3824
|
-
oe(r, RegExp(
|
|
3824
|
+
oe(r, RegExp(Kt(n.value, t)), n.message, t);
|
|
3825
3825
|
break;
|
|
3826
3826
|
case "ip":
|
|
3827
3827
|
n.version !== "v6" && ge(r, "ipv4", n.message, t), n.version !== "v4" && ge(r, "ipv6", n.message, t);
|
|
@@ -3858,7 +3858,7 @@ function Ka(e, t) {
|
|
|
3858
3858
|
}
|
|
3859
3859
|
return r;
|
|
3860
3860
|
}
|
|
3861
|
-
function
|
|
3861
|
+
function Kt(e, t) {
|
|
3862
3862
|
return t.patternStrategy === "escape" ? Ud(e) : e;
|
|
3863
3863
|
}
|
|
3864
3864
|
const Ld = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
@@ -3933,7 +3933,7 @@ function vn(e, t) {
|
|
|
3933
3933
|
}
|
|
3934
3934
|
return a;
|
|
3935
3935
|
}
|
|
3936
|
-
function
|
|
3936
|
+
function Ka(e, t) {
|
|
3937
3937
|
var n, a, s, o, c;
|
|
3938
3938
|
const r = {
|
|
3939
3939
|
type: "object",
|
|
@@ -3943,7 +3943,7 @@ function Wa(e, t) {
|
|
|
3943
3943
|
}) ?? t.allowedAdditionalProperties
|
|
3944
3944
|
};
|
|
3945
3945
|
if (((n = e.keyType) == null ? void 0 : n._def.typeName) === "ZodString" && ((a = e.keyType._def.checks) != null && a.length)) {
|
|
3946
|
-
const { type: f, ...i } =
|
|
3946
|
+
const { type: f, ...i } = Wa(e.keyType._def, t);
|
|
3947
3947
|
return {
|
|
3948
3948
|
...r,
|
|
3949
3949
|
propertyNames: i
|
|
@@ -3964,7 +3964,7 @@ function Wa(e, t) {
|
|
|
3964
3964
|
return r;
|
|
3965
3965
|
}
|
|
3966
3966
|
function Bd(e, t) {
|
|
3967
|
-
return t.mapStrategy === "record" ?
|
|
3967
|
+
return t.mapStrategy === "record" ? Ka(e, t) : {
|
|
3968
3968
|
type: "array",
|
|
3969
3969
|
maxItems: 125,
|
|
3970
3970
|
items: {
|
|
@@ -4011,7 +4011,7 @@ const ar = {
|
|
|
4011
4011
|
ZodBoolean: "boolean",
|
|
4012
4012
|
ZodNull: "null"
|
|
4013
4013
|
};
|
|
4014
|
-
function
|
|
4014
|
+
function Wd(e, t) {
|
|
4015
4015
|
const r = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
4016
4016
|
if (r.every((n) => n._def.typeName in ar && (!n._def.checks || !n._def.checks.length))) {
|
|
4017
4017
|
const n = r.reduce((a, s) => {
|
|
@@ -4046,9 +4046,9 @@ function Kd(e, t) {
|
|
|
4046
4046
|
type: "string",
|
|
4047
4047
|
enum: r.reduce((n, a) => [...n, ...a._def.values.filter((s) => !n.includes(s))], [])
|
|
4048
4048
|
};
|
|
4049
|
-
return
|
|
4049
|
+
return Kd(e, t);
|
|
4050
4050
|
}
|
|
4051
|
-
const
|
|
4051
|
+
const Kd = (e, t) => {
|
|
4052
4052
|
const r = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((n, a) => F(n._def, {
|
|
4053
4053
|
...t,
|
|
4054
4054
|
currentPath: [
|
|
@@ -4077,7 +4077,7 @@ function Gd(e, t) {
|
|
|
4077
4077
|
});
|
|
4078
4078
|
return r && { anyOf: [r, { type: "null" }] };
|
|
4079
4079
|
}
|
|
4080
|
-
function
|
|
4080
|
+
function Yd(e) {
|
|
4081
4081
|
const t = { type: "number" };
|
|
4082
4082
|
if (!e.checks) return t;
|
|
4083
4083
|
for (const r of e.checks) switch (r.kind) {
|
|
@@ -4095,7 +4095,7 @@ function Hd(e) {
|
|
|
4095
4095
|
}
|
|
4096
4096
|
return t;
|
|
4097
4097
|
}
|
|
4098
|
-
function
|
|
4098
|
+
function Hd(e, t) {
|
|
4099
4099
|
const r = {
|
|
4100
4100
|
type: "object",
|
|
4101
4101
|
properties: {}
|
|
@@ -4228,11 +4228,11 @@ function op() {
|
|
|
4228
4228
|
const ip = (e, t) => F(e.innerType._def, t), lp = (e, t, r) => {
|
|
4229
4229
|
switch (t) {
|
|
4230
4230
|
case "ZodString":
|
|
4231
|
-
return
|
|
4231
|
+
return Wa(e, r);
|
|
4232
4232
|
case "ZodNumber":
|
|
4233
|
-
return
|
|
4233
|
+
return Yd(e);
|
|
4234
4234
|
case "ZodObject":
|
|
4235
|
-
return
|
|
4235
|
+
return Hd(e, r);
|
|
4236
4236
|
case "ZodBigInt":
|
|
4237
4237
|
return $d(e);
|
|
4238
4238
|
case "ZodBoolean":
|
|
@@ -4247,13 +4247,13 @@ const ip = (e, t) => F(e.innerType._def, t), lp = (e, t, r) => {
|
|
|
4247
4247
|
return Cd(e, r);
|
|
4248
4248
|
case "ZodUnion":
|
|
4249
4249
|
case "ZodDiscriminatedUnion":
|
|
4250
|
-
return
|
|
4250
|
+
return Wd(e, r);
|
|
4251
4251
|
case "ZodIntersection":
|
|
4252
|
-
return
|
|
4252
|
+
return Dd(e, r);
|
|
4253
4253
|
case "ZodTuple":
|
|
4254
4254
|
return ap(e, r);
|
|
4255
4255
|
case "ZodRecord":
|
|
4256
|
-
return
|
|
4256
|
+
return Ka(e, r);
|
|
4257
4257
|
case "ZodLiteral":
|
|
4258
4258
|
return Fd(e);
|
|
4259
4259
|
case "ZodEnum":
|
|
@@ -4400,7 +4400,7 @@ function mp(e) {
|
|
|
4400
4400
|
let t;
|
|
4401
4401
|
return () => (t == null && (t = e()), t);
|
|
4402
4402
|
}
|
|
4403
|
-
function
|
|
4403
|
+
function Dt(e, { validate: t } = {}) {
|
|
4404
4404
|
return {
|
|
4405
4405
|
[sr]: !0,
|
|
4406
4406
|
_type: void 0,
|
|
@@ -4414,14 +4414,14 @@ function hp(e) {
|
|
|
4414
4414
|
return typeof e == "object" && e !== null && sr in e && e[sr] === !0 && "jsonSchema" in e && "validate" in e;
|
|
4415
4415
|
}
|
|
4416
4416
|
function gp(e) {
|
|
4417
|
-
return e == null ?
|
|
4417
|
+
return e == null ? Dt({
|
|
4418
4418
|
type: "object",
|
|
4419
4419
|
properties: {},
|
|
4420
4420
|
additionalProperties: !1
|
|
4421
4421
|
}) : hp(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? Ga(e) : bp(e) : e();
|
|
4422
4422
|
}
|
|
4423
4423
|
function bp(e) {
|
|
4424
|
-
return
|
|
4424
|
+
return Dt(() => {
|
|
4425
4425
|
if (!vp(e)) throw new Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
|
|
4426
4426
|
return yr(e["~standard"].jsonSchema.input({ target: "draft-07" }));
|
|
4427
4427
|
}, { validate: async (t) => {
|
|
@@ -4442,7 +4442,7 @@ function vp(e) {
|
|
|
4442
4442
|
return e["~standard"].jsonSchema != null;
|
|
4443
4443
|
}
|
|
4444
4444
|
function yp(e, t) {
|
|
4445
|
-
return
|
|
4445
|
+
return Dt(() => fp(e, { $refStrategy: "none" }), { validate: async (r) => {
|
|
4446
4446
|
const n = await e.safeParseAsync(r);
|
|
4447
4447
|
return n.success ? {
|
|
4448
4448
|
success: !0,
|
|
@@ -4454,7 +4454,7 @@ function yp(e, t) {
|
|
|
4454
4454
|
} });
|
|
4455
4455
|
}
|
|
4456
4456
|
function xp(e, t) {
|
|
4457
|
-
return
|
|
4457
|
+
return Dt(() => yr(ru(e, {
|
|
4458
4458
|
target: "draft-7",
|
|
4459
4459
|
io: "input",
|
|
4460
4460
|
reused: "inline"
|
|
@@ -4476,7 +4476,7 @@ function Ga(e, t) {
|
|
|
4476
4476
|
return wp(e) ? xp(e) : yp(e);
|
|
4477
4477
|
}
|
|
4478
4478
|
async function yn({ value: e, schema: t, context: r }) {
|
|
4479
|
-
const n = await
|
|
4479
|
+
const n = await Ya({
|
|
4480
4480
|
value: e,
|
|
4481
4481
|
schema: t,
|
|
4482
4482
|
context: r
|
|
@@ -4488,7 +4488,7 @@ async function yn({ value: e, schema: t, context: r }) {
|
|
|
4488
4488
|
});
|
|
4489
4489
|
return n.value;
|
|
4490
4490
|
}
|
|
4491
|
-
async function
|
|
4491
|
+
async function Ya({ value: e, schema: t, context: r }) {
|
|
4492
4492
|
const n = gp(t);
|
|
4493
4493
|
try {
|
|
4494
4494
|
if (n.validate == null) return {
|
|
@@ -4529,7 +4529,7 @@ async function or({ text: e, schema: t }) {
|
|
|
4529
4529
|
success: !0,
|
|
4530
4530
|
value: r,
|
|
4531
4531
|
rawValue: r
|
|
4532
|
-
} : await
|
|
4532
|
+
} : await Ya({
|
|
4533
4533
|
value: r,
|
|
4534
4534
|
schema: t
|
|
4535
4535
|
});
|
|
@@ -4552,15 +4552,15 @@ function _p({ stream: e, schema: t }) {
|
|
|
4552
4552
|
}));
|
|
4553
4553
|
} }));
|
|
4554
4554
|
}
|
|
4555
|
-
async function
|
|
4555
|
+
async function Ye(e) {
|
|
4556
4556
|
return typeof e == "function" && (e = e()), e;
|
|
4557
4557
|
}
|
|
4558
4558
|
new TextDecoder();
|
|
4559
|
-
const
|
|
4559
|
+
const Ha = "AI_InvalidArgumentError", Qa = `vercel.ai.error.${Ha}`, Ip = Symbol.for(Qa);
|
|
4560
4560
|
var Et = class extends re {
|
|
4561
4561
|
constructor({ parameter: e, value: t, message: r }) {
|
|
4562
4562
|
super({
|
|
4563
|
-
name:
|
|
4563
|
+
name: Ha,
|
|
4564
4564
|
message: `Invalid argument for parameter ${e}: ${r}`
|
|
4565
4565
|
}), this[Ip] = !0, this.parameter = e, this.value = t;
|
|
4566
4566
|
}
|
|
@@ -4595,7 +4595,7 @@ function ts(e, t) {
|
|
|
4595
4595
|
return r;
|
|
4596
4596
|
}
|
|
4597
4597
|
const l = {
|
|
4598
|
-
array:
|
|
4598
|
+
array: ja,
|
|
4599
4599
|
boolean: Zu,
|
|
4600
4600
|
custom: hd,
|
|
4601
4601
|
discriminatedUnion: Ju,
|
|
@@ -4605,10 +4605,10 @@ const l = {
|
|
|
4605
4605
|
literal: Qu,
|
|
4606
4606
|
looseObject: Vu,
|
|
4607
4607
|
never: Za,
|
|
4608
|
-
null:
|
|
4608
|
+
null: Du,
|
|
4609
4609
|
number: Mu,
|
|
4610
4610
|
object: Bu,
|
|
4611
|
-
record:
|
|
4611
|
+
record: Yu,
|
|
4612
4612
|
string: gu,
|
|
4613
4613
|
union: La,
|
|
4614
4614
|
unknown: Ot
|
|
@@ -4841,7 +4841,7 @@ l.union([
|
|
|
4841
4841
|
Rp,
|
|
4842
4842
|
Zp
|
|
4843
4843
|
]);
|
|
4844
|
-
function
|
|
4844
|
+
function jp(e) {
|
|
4845
4845
|
const t = ["ROOT"];
|
|
4846
4846
|
let r = -1, n = null, a = 0;
|
|
4847
4847
|
function s(g) {
|
|
@@ -5042,7 +5042,7 @@ function Dp(e) {
|
|
|
5042
5042
|
}
|
|
5043
5043
|
return i;
|
|
5044
5044
|
}
|
|
5045
|
-
async function
|
|
5045
|
+
async function Dp(e) {
|
|
5046
5046
|
if (e === void 0) return {
|
|
5047
5047
|
value: void 0,
|
|
5048
5048
|
state: "undefined-input"
|
|
@@ -5051,7 +5051,7 @@ async function jp(e) {
|
|
|
5051
5051
|
return t.success ? {
|
|
5052
5052
|
value: t.value,
|
|
5053
5053
|
state: "successful-parse"
|
|
5054
|
-
} : (t = await or({ text:
|
|
5054
|
+
} : (t = await or({ text: jp(e) }), t.success ? {
|
|
5055
5055
|
value: t.value,
|
|
5056
5056
|
state: "repaired-parse"
|
|
5057
5057
|
} : {
|
|
@@ -5271,7 +5271,7 @@ const nt = l.record(l.string(), Ve.optional()), Fp = mp(() => Ga(l.union([
|
|
|
5271
5271
|
function Lp(e) {
|
|
5272
5272
|
return e.type.startsWith("data-");
|
|
5273
5273
|
}
|
|
5274
|
-
function
|
|
5274
|
+
function He() {
|
|
5275
5275
|
return /* @__PURE__ */ Object.create(null);
|
|
5276
5276
|
}
|
|
5277
5277
|
function zt(e) {
|
|
@@ -5292,7 +5292,7 @@ function os({ lastMessage: e, messageId: t }) {
|
|
|
5292
5292
|
metadata: void 0,
|
|
5293
5293
|
role: "assistant",
|
|
5294
5294
|
parts: []
|
|
5295
|
-
}, n =
|
|
5295
|
+
}, n = He(), a = r.parts.findLastIndex((o) => o.type === "step-start");
|
|
5296
5296
|
let s = 0;
|
|
5297
5297
|
for (const o of r.parts.slice(a + 1)) {
|
|
5298
5298
|
if (!be(o)) continue;
|
|
@@ -5308,8 +5308,8 @@ function os({ lastMessage: e, messageId: t }) {
|
|
|
5308
5308
|
}
|
|
5309
5309
|
return {
|
|
5310
5310
|
message: r,
|
|
5311
|
-
activeTextParts:
|
|
5312
|
-
activeReasoningParts:
|
|
5311
|
+
activeTextParts: He(),
|
|
5312
|
+
activeReasoningParts: He(),
|
|
5313
5313
|
partialToolCalls: n
|
|
5314
5314
|
};
|
|
5315
5315
|
}
|
|
@@ -5363,8 +5363,8 @@ function Bp({ stream: e, messageMetadataSchema: t, dataPartSchemas: r, runUpdate
|
|
|
5363
5363
|
const O = N.providerMetadata;
|
|
5364
5364
|
if (O != null)
|
|
5365
5365
|
if (d.state === "output-available" || d.state === "output-error") {
|
|
5366
|
-
const
|
|
5367
|
-
|
|
5366
|
+
const W = b;
|
|
5367
|
+
W.resultProviderMetadata = O;
|
|
5368
5368
|
} else b.callProviderMetadata = O;
|
|
5369
5369
|
} else u.message.parts.push({
|
|
5370
5370
|
type: `tool-${d.toolName}`,
|
|
@@ -5389,8 +5389,8 @@ function Bp({ stream: e, messageMetadataSchema: t, dataPartSchemas: r, runUpdate
|
|
|
5389
5389
|
const O = N.providerMetadata;
|
|
5390
5390
|
if (O != null)
|
|
5391
5391
|
if (d.state === "output-available" || d.state === "output-error") {
|
|
5392
|
-
const
|
|
5393
|
-
|
|
5392
|
+
const W = b;
|
|
5393
|
+
W.resultProviderMetadata = O;
|
|
5394
5394
|
} else b.callProviderMetadata = O;
|
|
5395
5395
|
} else u.message.parts.push({
|
|
5396
5396
|
type: "dynamic-tool",
|
|
@@ -5558,7 +5558,7 @@ function Bp({ stream: e, messageMetadataSchema: t, dataPartSchemas: r, runUpdate
|
|
|
5558
5558
|
message: `Received tool-input-delta for missing tool call with ID "${i.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
|
|
5559
5559
|
});
|
|
5560
5560
|
d.text += i.inputTextDelta;
|
|
5561
|
-
const { value: v } = await
|
|
5561
|
+
const { value: v } = await Dp(d.text);
|
|
5562
5562
|
d.dynamic ? y({
|
|
5563
5563
|
toolCallId: i.toolCallId,
|
|
5564
5564
|
toolName: d.toolName,
|
|
@@ -5709,7 +5709,7 @@ function Bp({ stream: e, messageMetadataSchema: t, dataPartSchemas: r, runUpdate
|
|
|
5709
5709
|
break;
|
|
5710
5710
|
case "reset-step": {
|
|
5711
5711
|
const d = w();
|
|
5712
|
-
u.activeTextParts =
|
|
5712
|
+
u.activeTextParts = He(), u.activeReasoningParts = He(), u.partialToolCalls = He(), d.length > 0 && (u.message.parts.splice(u.message.parts.length - d.length, d.length), m());
|
|
5713
5713
|
break;
|
|
5714
5714
|
}
|
|
5715
5715
|
case "start":
|
|
@@ -5897,7 +5897,7 @@ async function xn({ response: e, url: t, fallbackMessage: r }) {
|
|
|
5897
5897
|
responseBody: n
|
|
5898
5898
|
});
|
|
5899
5899
|
}
|
|
5900
|
-
async function
|
|
5900
|
+
async function Wp(e) {
|
|
5901
5901
|
if (e == null) return [];
|
|
5902
5902
|
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new ci({
|
|
5903
5903
|
functionality: "FileList",
|
|
@@ -5919,7 +5919,7 @@ async function Kp(e) {
|
|
|
5919
5919
|
};
|
|
5920
5920
|
}));
|
|
5921
5921
|
}
|
|
5922
|
-
function
|
|
5922
|
+
function Kp(e, t) {
|
|
5923
5923
|
const r = e.search(/[?#]/), n = r === -1 ? e : e.slice(0, r), a = r === -1 ? "" : e.slice(r);
|
|
5924
5924
|
return `${n.endsWith("/") && t.startsWith("/") ? n.slice(0, -1) : n}${t}${a}`;
|
|
5925
5925
|
}
|
|
@@ -5929,7 +5929,7 @@ var Gp = class {
|
|
|
5929
5929
|
}
|
|
5930
5930
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
5931
5931
|
var m;
|
|
5932
|
-
const r = await
|
|
5932
|
+
const r = await Ye(this.body), n = await Ye(this.headers), a = await Ye(this.credentials), s = {
|
|
5933
5933
|
...Ge(n),
|
|
5934
5934
|
...Ge(t.headers)
|
|
5935
5935
|
}, o = await ((m = this.prepareSendMessagesRequest) == null ? void 0 : m.call(this, {
|
|
@@ -5972,7 +5972,7 @@ var Gp = class {
|
|
|
5972
5972
|
}
|
|
5973
5973
|
async reconnectToStream(e) {
|
|
5974
5974
|
var g;
|
|
5975
|
-
const t = await
|
|
5975
|
+
const t = await Ye(this.body), r = await Ye(this.headers), n = await Ye(this.credentials), a = {
|
|
5976
5976
|
...Ge(r),
|
|
5977
5977
|
...Ge(e.headers)
|
|
5978
5978
|
}, s = await ((g = this.prepareReconnectToStreamRequest) == null ? void 0 : g.call(this, {
|
|
@@ -5993,7 +5993,7 @@ var Gp = class {
|
|
|
5993
5993
|
value: e.chatId,
|
|
5994
5994
|
message: 'Chat IDs must not be "." or ".." when using the default reconnect URL.'
|
|
5995
5995
|
});
|
|
5996
|
-
o =
|
|
5996
|
+
o = Kp(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
|
|
5997
5997
|
}
|
|
5998
5998
|
const c = (s == null ? void 0 : s.headers) !== void 0 ? Ge(s.headers) : a, f = (s == null ? void 0 : s.credentials) ?? n, i = await (this.fetch ?? globalThis.fetch)(o, {
|
|
5999
5999
|
method: "GET",
|
|
@@ -6023,7 +6023,7 @@ var Gp = class {
|
|
|
6023
6023
|
r.enqueue(t.value);
|
|
6024
6024
|
} }));
|
|
6025
6025
|
}
|
|
6026
|
-
},
|
|
6026
|
+
}, Yp = class {
|
|
6027
6027
|
constructor({ generateId: e = _d, id: t = e(), transport: r = new wr(), messageMetadataSchema: n, dataPartSchemas: a, state: s, onError: o, onToolCall: c, onFinish: f, onData: i, sendAutomaticallyWhen: g }) {
|
|
6028
6028
|
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new Jp(), this.activeStopCount = 0, this.stopGeneration = 0, this.sendMessage = async (u, m) => {
|
|
6029
6029
|
var I;
|
|
@@ -6053,7 +6053,7 @@ var Gp = class {
|
|
|
6053
6053
|
this.pendingMessagePreparations.add(E);
|
|
6054
6054
|
let _;
|
|
6055
6055
|
try {
|
|
6056
|
-
_ = Array.isArray(u.files) ? u.files : await
|
|
6056
|
+
_ = Array.isArray(u.files) ? u.files : await Wp(u.files);
|
|
6057
6057
|
} finally {
|
|
6058
6058
|
this.pendingMessagePreparations.delete(E);
|
|
6059
6059
|
}
|
|
@@ -6324,9 +6324,9 @@ var Gp = class {
|
|
|
6324
6324
|
});
|
|
6325
6325
|
const T = (O) => this.jobExecutor.run(() => b.abortController.signal.aborted ? Promise.resolve() : O({
|
|
6326
6326
|
state: b.state,
|
|
6327
|
-
write: ({ updateStatus:
|
|
6328
|
-
var
|
|
6329
|
-
b.abortController.signal.aborted || (
|
|
6327
|
+
write: ({ updateStatus: W = !0 } = {}) => {
|
|
6328
|
+
var H;
|
|
6329
|
+
b.abortController.signal.aborted || (W && this.setStatus({ status: "streaming" }), E ? this.state.replaceMessage(m, b.state.message) : b.state.message.id === ((H = this.lastMessage) == null ? void 0 : H.id) ? this.state.replaceMessage(this.state.messages.length - 1, b.state.message) : this.state.pushMessage(b.state.message));
|
|
6330
6330
|
}
|
|
6331
6331
|
}));
|
|
6332
6332
|
if (await Vp({
|
|
@@ -6388,7 +6388,7 @@ var Gp = class {
|
|
|
6388
6388
|
});
|
|
6389
6389
|
}
|
|
6390
6390
|
};
|
|
6391
|
-
function
|
|
6391
|
+
function Hp(e, t) {
|
|
6392
6392
|
if (typeof e != "function")
|
|
6393
6393
|
throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);
|
|
6394
6394
|
let r, n = 0;
|
|
@@ -6400,7 +6400,7 @@ function Yp(e, t) {
|
|
|
6400
6400
|
}, f);
|
|
6401
6401
|
};
|
|
6402
6402
|
}
|
|
6403
|
-
var Qp =
|
|
6403
|
+
var Qp = Hp;
|
|
6404
6404
|
const Xp = /* @__PURE__ */ ho(Qp);
|
|
6405
6405
|
function ef(e, t) {
|
|
6406
6406
|
return t != null ? Xp(e, t) : e;
|
|
@@ -6408,18 +6408,18 @@ function ef(e, t) {
|
|
|
6408
6408
|
function tf(e) {
|
|
6409
6409
|
return Array.isArray(e) ? [...e] : e != null && typeof e == "object" && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null) ? { ...e } : e;
|
|
6410
6410
|
}
|
|
6411
|
-
var ce, Qe, Xe, Ze,
|
|
6411
|
+
var ce, Qe, Xe, Ze, je, De, Ne, pt, ft, Tn, rf = (Tn = class {
|
|
6412
6412
|
constructor(e = []) {
|
|
6413
6413
|
me(this, ce);
|
|
6414
6414
|
me(this, Qe);
|
|
6415
6415
|
me(this, Xe);
|
|
6416
6416
|
me(this, Ze);
|
|
6417
|
-
me(this, De);
|
|
6418
6417
|
me(this, je);
|
|
6418
|
+
me(this, De);
|
|
6419
6419
|
me(this, Ne);
|
|
6420
6420
|
me(this, pt);
|
|
6421
6421
|
me(this, ft);
|
|
6422
|
-
ee(this, Qe, "ready"), ee(this, Xe, void 0), ee(this, Ze, /* @__PURE__ */ new Set()), ee(this,
|
|
6422
|
+
ee(this, Qe, "ready"), ee(this, Xe, void 0), ee(this, Ze, /* @__PURE__ */ new Set()), ee(this, je, /* @__PURE__ */ new Set()), ee(this, De, /* @__PURE__ */ new Set()), this.pushMessage = (t) => {
|
|
6423
6423
|
ee(this, ce, L(this, ce).concat(t)), L(this, Ne).call(this);
|
|
6424
6424
|
}, this.popMessage = () => {
|
|
6425
6425
|
ee(this, ce, L(this, ce).slice(0, -1)), L(this, Ne).call(this);
|
|
@@ -6441,16 +6441,16 @@ var ce, Qe, Xe, Ze, De, je, Ne, pt, ft, Tn, rf = (Tn = class {
|
|
|
6441
6441
|
return L(this, Ze).add(n), () => {
|
|
6442
6442
|
L(this, Ze).delete(n);
|
|
6443
6443
|
};
|
|
6444
|
-
}, this["~registerStatusCallback"] = (t) => (L(this,
|
|
6445
|
-
L(this, De).delete(t);
|
|
6446
|
-
}), this["~registerErrorCallback"] = (t) => (L(this, je).add(t), () => {
|
|
6444
|
+
}, this["~registerStatusCallback"] = (t) => (L(this, je).add(t), () => {
|
|
6447
6445
|
L(this, je).delete(t);
|
|
6446
|
+
}), this["~registerErrorCallback"] = (t) => (L(this, De).add(t), () => {
|
|
6447
|
+
L(this, De).delete(t);
|
|
6448
6448
|
}), ee(this, Ne, () => {
|
|
6449
6449
|
L(this, Ze).forEach((t) => t());
|
|
6450
6450
|
}), ee(this, pt, () => {
|
|
6451
|
-
L(this, De).forEach((t) => t());
|
|
6452
|
-
}), ee(this, ft, () => {
|
|
6453
6451
|
L(this, je).forEach((t) => t());
|
|
6452
|
+
}), ee(this, ft, () => {
|
|
6453
|
+
L(this, De).forEach((t) => t());
|
|
6454
6454
|
}), ee(this, ce, e);
|
|
6455
6455
|
}
|
|
6456
6456
|
get status() {
|
|
@@ -6471,7 +6471,7 @@ var ce, Qe, Xe, Ze, De, je, Ne, pt, ft, Tn, rf = (Tn = class {
|
|
|
6471
6471
|
set messages(e) {
|
|
6472
6472
|
ee(this, ce, [...e]), L(this, Ne).call(this);
|
|
6473
6473
|
}
|
|
6474
|
-
}, ce = new WeakMap(), Qe = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(),
|
|
6474
|
+
}, ce = new WeakMap(), Qe = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), je = new WeakMap(), De = new WeakMap(), Ne = new WeakMap(), pt = new WeakMap(), ft = new WeakMap(), Tn), Fe, An, is = (An = class extends Yp {
|
|
6475
6475
|
constructor({ messages: t, ...r }) {
|
|
6476
6476
|
const n = new rf(t);
|
|
6477
6477
|
super({
|
|
@@ -6549,7 +6549,7 @@ function af({ throttle: e, experimental_throttle: t, resume: r = !1, ...n } = {}
|
|
|
6549
6549
|
u.stop();
|
|
6550
6550
|
};
|
|
6551
6551
|
}, [u, m]);
|
|
6552
|
-
const [w, I] =
|
|
6552
|
+
const [w, I] = D(() => Nt(u));
|
|
6553
6553
|
w.chat !== u && I(Nt(u)), ke(() => {
|
|
6554
6554
|
let h = !0;
|
|
6555
6555
|
const d = () => {
|
|
@@ -6657,7 +6657,7 @@ function hf(e) {
|
|
|
6657
6657
|
Ue(() => {
|
|
6658
6658
|
t.current = e;
|
|
6659
6659
|
});
|
|
6660
|
-
const r = ie(void 0), [n, a] =
|
|
6660
|
+
const r = ie(void 0), [n, a] = D({}), [s, o] = D({}), [c, f] = D({ chatId: "", count: 0 }), [i, g] = D(), [u] = D(() => {
|
|
6661
6661
|
const R = (C, M) => {
|
|
6662
6662
|
C.pendingApplies += M, r.current === C && f({ chatId: C.chat.id, count: C.pendingApplies });
|
|
6663
6663
|
};
|
|
@@ -6699,13 +6699,13 @@ function hf(e) {
|
|
|
6699
6699
|
}).finally(() => R(C, -1));
|
|
6700
6700
|
}
|
|
6701
6701
|
};
|
|
6702
|
-
}), [m, w] =
|
|
6702
|
+
}), [m, w] = D(() => Yt(u));
|
|
6703
6703
|
Ue(() => (r.current = m, () => {
|
|
6704
6704
|
r.current === m && (r.current = void 0);
|
|
6705
6705
|
}), [m]);
|
|
6706
6706
|
const { messages: I, status: E, error: _ } = af({ chat: m.chat });
|
|
6707
6707
|
ke(() => () => void m.chat.stop(), [m]);
|
|
6708
|
-
const [x, y] =
|
|
6708
|
+
const [x, y] = D(), [h, d] = D([]), v = ie(void 0), [b, N] = D(!1);
|
|
6709
6709
|
ke(() => () => {
|
|
6710
6710
|
var R;
|
|
6711
6711
|
return (R = v.current) == null ? void 0 : R.abort();
|
|
@@ -6717,7 +6717,7 @@ function hf(e) {
|
|
|
6717
6717
|
(R, C = []) => {
|
|
6718
6718
|
var fe, ae, $e;
|
|
6719
6719
|
const M = R.trim();
|
|
6720
|
-
if (!M ||
|
|
6720
|
+
if (!M || Ht(m.chat.status) || m.pendingApplies > 0 || v.current) return "not_sent";
|
|
6721
6721
|
let Z;
|
|
6722
6722
|
try {
|
|
6723
6723
|
Z = t.current.readContext();
|
|
@@ -6745,20 +6745,20 @@ function hf(e) {
|
|
|
6745
6745
|
), "sent";
|
|
6746
6746
|
},
|
|
6747
6747
|
[m, h]
|
|
6748
|
-
),
|
|
6748
|
+
), W = te(
|
|
6749
6749
|
(R) => {
|
|
6750
6750
|
var M;
|
|
6751
6751
|
const C = m.chat.messages.find((Z) => Z.id === R && Z.role === "user");
|
|
6752
6752
|
return C ? O(cs(C), ((M = C.metadata) == null ? void 0 : M.taggedFields) ?? []) : "not_sent";
|
|
6753
6753
|
},
|
|
6754
6754
|
[m, O]
|
|
6755
|
-
),
|
|
6755
|
+
), H = te(
|
|
6756
6756
|
(R) => {
|
|
6757
6757
|
const C = X.getState().actions.undoProposal(R);
|
|
6758
6758
|
return C.ok && a((M) => Pe(M, m.chat.id, R, { status: "undone" })), C.ok;
|
|
6759
6759
|
},
|
|
6760
6760
|
[m]
|
|
6761
|
-
),
|
|
6761
|
+
), We = te(
|
|
6762
6762
|
async (R) => {
|
|
6763
6763
|
var pe;
|
|
6764
6764
|
const C = m.chat.id, M = (pe = s[C]) == null ? void 0 : pe[R];
|
|
@@ -6768,13 +6768,13 @@ function hf(e) {
|
|
|
6768
6768
|
o((Q) => Pe(Q, C, R, de));
|
|
6769
6769
|
},
|
|
6770
6770
|
[m, u, s]
|
|
6771
|
-
),
|
|
6771
|
+
), Ke = te(
|
|
6772
6772
|
(R) => {
|
|
6773
6773
|
o((C) => Pe(C, m.chat.id, R, { status: "dismissed" }));
|
|
6774
6774
|
},
|
|
6775
6775
|
[m]
|
|
6776
|
-
),
|
|
6777
|
-
T(), y(void 0), w(
|
|
6776
|
+
), K = te(() => void m.chat.stop(), [m]), ye = te(() => {
|
|
6777
|
+
T(), y(void 0), w(Yt(u)), d([]);
|
|
6778
6778
|
}, [T, u]), Ae = te(
|
|
6779
6779
|
(R, C) => {
|
|
6780
6780
|
C.beside && m.aboutCardId !== R && ye();
|
|
@@ -6789,14 +6789,14 @@ function hf(e) {
|
|
|
6789
6789
|
}, []), xe = te(
|
|
6790
6790
|
async (R) => {
|
|
6791
6791
|
var M;
|
|
6792
|
-
if (R === m.conversationId &&
|
|
6792
|
+
if (R === m.conversationId && Ht(m.chat.status))
|
|
6793
6793
|
return T(), "opened";
|
|
6794
6794
|
(M = v.current) == null || M.abort();
|
|
6795
6795
|
const C = new AbortController();
|
|
6796
6796
|
v.current = C, N(!0), y(void 0);
|
|
6797
6797
|
try {
|
|
6798
6798
|
const Z = await _n(u.connection(), R, C.signal);
|
|
6799
|
-
return C.signal.aborted ? "not_opened" : (w(
|
|
6799
|
+
return C.signal.aborted ? "not_opened" : (w(Yt(u, Z)), d(Z.addedSources), Z.allows && g(Z.allows), "opened");
|
|
6800
6800
|
} catch (Z) {
|
|
6801
6801
|
return C.signal.aborted || y(
|
|
6802
6802
|
Z instanceof tt && Z.code !== "model_unavailable" ? Z.message : ff
|
|
@@ -6814,14 +6814,14 @@ function hf(e) {
|
|
|
6814
6814
|
messages: I,
|
|
6815
6815
|
status: E,
|
|
6816
6816
|
/** Answering, or applying an answer's change to the dashboard. */
|
|
6817
|
-
busy:
|
|
6817
|
+
busy: Ht(E) || c.chatId === m.chat.id && c.count > 0,
|
|
6818
6818
|
/** Where this session's proposals stand on the dashboard; none for a reopened conversation. */
|
|
6819
6819
|
proposalStates: n[m.chat.id] ?? uf,
|
|
6820
|
-
undoProposal:
|
|
6820
|
+
undoProposal: H,
|
|
6821
6821
|
/** Where this session's proposed relationships stand; none for a reopened conversation. */
|
|
6822
6822
|
modelChangeStates: s[m.chat.id] ?? df,
|
|
6823
|
-
addModelChange:
|
|
6824
|
-
dismissModelChange:
|
|
6823
|
+
addModelChange: We,
|
|
6824
|
+
dismissModelChange: Ke,
|
|
6825
6825
|
/** A stored conversation is loading; sending waits. */
|
|
6826
6826
|
loading: b,
|
|
6827
6827
|
addedSources: h,
|
|
@@ -6836,8 +6836,8 @@ function hf(e) {
|
|
|
6836
6836
|
notice: x,
|
|
6837
6837
|
clearNotice: () => y(void 0),
|
|
6838
6838
|
send: O,
|
|
6839
|
-
askAgain:
|
|
6840
|
-
stop:
|
|
6839
|
+
askAgain: W,
|
|
6840
|
+
stop: K,
|
|
6841
6841
|
startNew: ye,
|
|
6842
6842
|
askedAbout: Ae,
|
|
6843
6843
|
open: xe
|
|
@@ -6850,7 +6850,7 @@ function gf(e, t) {
|
|
|
6850
6850
|
if (!(!(r != null && r.id) || r.id !== ((n = e.dashboard) == null ? void 0 : n.id)))
|
|
6851
6851
|
return Xt(r) <= et.openDashboardBytes ? r : void 0;
|
|
6852
6852
|
}
|
|
6853
|
-
function
|
|
6853
|
+
function Yt(e, t) {
|
|
6854
6854
|
const r = {
|
|
6855
6855
|
conversationId: t == null ? void 0 : t.conversationId,
|
|
6856
6856
|
proposals: /* @__PURE__ */ new Map(),
|
|
@@ -6904,7 +6904,7 @@ function bf(e) {
|
|
|
6904
6904
|
];
|
|
6905
6905
|
});
|
|
6906
6906
|
}
|
|
6907
|
-
function
|
|
6907
|
+
function Ht(e) {
|
|
6908
6908
|
return e === "submitted" || e === "streaming";
|
|
6909
6909
|
}
|
|
6910
6910
|
const vf = new Set(Object.values(ct));
|
|
@@ -6912,7 +6912,7 @@ function yf(e) {
|
|
|
6912
6912
|
return e instanceof tt || vf.has(e.message) ? e.message : ct.model_unavailable;
|
|
6913
6913
|
}
|
|
6914
6914
|
function xf(e) {
|
|
6915
|
-
return e instanceof qn ? e.message : e instanceof
|
|
6915
|
+
return e instanceof qn ? e.message : e instanceof Hn ? "The dashboard is still loading. Try again in a moment." : e instanceof Jn ? ct.context_invalid : ct.model_unavailable;
|
|
6916
6916
|
}
|
|
6917
6917
|
function cs(e) {
|
|
6918
6918
|
return ((e == null ? void 0 : e.parts) ?? []).map((t) => t.type === "text" ? t.text : "").join("").trim();
|
|
@@ -6934,7 +6934,7 @@ function Sr() {
|
|
|
6934
6934
|
return Rs() ?? mo;
|
|
6935
6935
|
}
|
|
6936
6936
|
function fs(e, t) {
|
|
6937
|
-
return
|
|
6937
|
+
return Do({
|
|
6938
6938
|
metadata: e,
|
|
6939
6939
|
locale: t.locale,
|
|
6940
6940
|
styles: { dateStyle: t.dateStyle, dateTime: t.dateTime }
|
|
@@ -6947,7 +6947,7 @@ function Nr(e, t, r) {
|
|
|
6947
6947
|
if (e == null) return "";
|
|
6948
6948
|
if (t.temporalBucket && typeof e == "string")
|
|
6949
6949
|
try {
|
|
6950
|
-
return
|
|
6950
|
+
return jo({
|
|
6951
6951
|
value: e,
|
|
6952
6952
|
metadata: t.temporalBucket,
|
|
6953
6953
|
format: fs(t.temporalBucket, r).format
|
|
@@ -7026,7 +7026,7 @@ function kr({
|
|
|
7026
7026
|
testId: r,
|
|
7027
7027
|
chevron: n = !0
|
|
7028
7028
|
}) {
|
|
7029
|
-
const [a, s] =
|
|
7029
|
+
const [a, s] = D(!1);
|
|
7030
7030
|
return /* @__PURE__ */ k("div", { className: "space-y-1.5", "data-testid": r, children: [
|
|
7031
7031
|
/* @__PURE__ */ k(
|
|
7032
7032
|
"button",
|
|
@@ -7036,7 +7036,7 @@ function kr({
|
|
|
7036
7036
|
onClick: () => s((o) => !o),
|
|
7037
7037
|
className: "inline-flex items-center gap-1 text-[11.5px] text-muted-foreground hover:text-foreground",
|
|
7038
7038
|
children: [
|
|
7039
|
-
n ? /* @__PURE__ */ p(
|
|
7039
|
+
n ? /* @__PURE__ */ p(js, { className: B("h-3 w-3 transition-transform", a && "rotate-90") }) : null,
|
|
7040
7040
|
e
|
|
7041
7041
|
]
|
|
7042
7042
|
}
|
|
@@ -7071,7 +7071,7 @@ function Tf({
|
|
|
7071
7071
|
] });
|
|
7072
7072
|
}
|
|
7073
7073
|
function Af(e, t, r) {
|
|
7074
|
-
const [n, a] =
|
|
7074
|
+
const [n, a] = D({ status: "idle" }), s = X(
|
|
7075
7075
|
(c) => n.status === "added" ? Qn(c.dashboard, n.frameId) : !1
|
|
7076
7076
|
);
|
|
7077
7077
|
if (!r || !e.card) return { action: null, note: null };
|
|
@@ -7120,7 +7120,7 @@ function Cf(e, t) {
|
|
|
7120
7120
|
return r.length ? /* @__PURE__ */ p("p", { role: "status", className: "text-[11.5px] text-muted-foreground", children: r.join(" ") }) : null;
|
|
7121
7121
|
}
|
|
7122
7122
|
function $f({ artifact: e, onClose: t }) {
|
|
7123
|
-
const { kind: r, setKind: n, visual: a, chart: s, shown: o } = ms(e, "table"), [c, f] =
|
|
7123
|
+
const { kind: r, setKind: n, visual: a, chart: s, shown: o } = ms(e, "table"), [c, f] = D(), i = it(() => Mf(e.records, c), [e.records, c]);
|
|
7124
7124
|
return /* @__PURE__ */ k(
|
|
7125
7125
|
"section",
|
|
7126
7126
|
{
|
|
@@ -7134,7 +7134,7 @@ function $f({ artifact: e, onClose: t }) {
|
|
|
7134
7134
|
/* @__PURE__ */ k("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
7135
7135
|
/* @__PURE__ */ p(hs, { eligible: e.eligible, kind: r, onChange: n }),
|
|
7136
7136
|
/* @__PURE__ */ p(
|
|
7137
|
-
|
|
7137
|
+
Y,
|
|
7138
7138
|
{
|
|
7139
7139
|
variant: "ghost",
|
|
7140
7140
|
size: "xs",
|
|
@@ -7167,7 +7167,7 @@ function $f({ artifact: e, onClose: t }) {
|
|
|
7167
7167
|
);
|
|
7168
7168
|
}
|
|
7169
7169
|
function ms(e, t) {
|
|
7170
|
-
const [r, n] =
|
|
7170
|
+
const [r, n] = D(t), a = it(() => Of(e, r), [e, r]), s = X(Ds((i) => ({ themeStyle: i.themeStyle, theme: i.theme }))), o = Sr(), c = it(
|
|
7171
7171
|
() => If(e, a, o, s),
|
|
7172
7172
|
[e, a, o, s]
|
|
7173
7173
|
), f = a.kind === "table" || a.kind !== "number" && !c ? "table" : a.kind;
|
|
@@ -7175,12 +7175,12 @@ function ms(e, t) {
|
|
|
7175
7175
|
}
|
|
7176
7176
|
function Of(e, t) {
|
|
7177
7177
|
if (t === e.visual.kind) return e.visual;
|
|
7178
|
-
const r =
|
|
7178
|
+
const r = Kn(Gn(e), t);
|
|
7179
7179
|
return r.ok ? r.visual : { kind: "table", encodings: {} };
|
|
7180
7180
|
}
|
|
7181
7181
|
const zf = {
|
|
7182
7182
|
table: { label: "Table", icon: fo },
|
|
7183
|
-
bar: { label: "Bar chart", icon:
|
|
7183
|
+
bar: { label: "Bar chart", icon: Dn },
|
|
7184
7184
|
stackedBar: { label: "Stacked bar chart", icon: Ls },
|
|
7185
7185
|
line: { label: "Line chart", icon: Fs },
|
|
7186
7186
|
number: { label: "Number", icon: dr }
|
|
@@ -7330,15 +7330,15 @@ function Zf({ trace: e, stages: t }) {
|
|
|
7330
7330
|
e.model
|
|
7331
7331
|
] })
|
|
7332
7332
|
] }),
|
|
7333
|
-
/* @__PURE__ */ p(kr, { label: "Timeline", children: /* @__PURE__ */ p(
|
|
7333
|
+
/* @__PURE__ */ p(kr, { label: "Timeline", children: /* @__PURE__ */ p(Df, { trace: e, stages: t }) })
|
|
7334
7334
|
] });
|
|
7335
7335
|
}
|
|
7336
|
-
const
|
|
7336
|
+
const jf = {
|
|
7337
7337
|
check: "bg-amber-400/80",
|
|
7338
7338
|
model: "bg-primary/70",
|
|
7339
7339
|
step: "bg-muted-foreground/50"
|
|
7340
7340
|
};
|
|
7341
|
-
function
|
|
7341
|
+
function Df({ trace: e, stages: t }) {
|
|
7342
7342
|
const r = new Map(t.map((s) => [s.stageId, s.label])), n = Math.max(e.totalMs, 1), a = e.spans.flatMap(
|
|
7343
7343
|
(s) => s.kind === "model" && s.firstOutputMs !== void 0 ? [s.firstOutputMs] : []
|
|
7344
7344
|
);
|
|
@@ -7348,7 +7348,7 @@ function jf({ trace: e, stages: t }) {
|
|
|
7348
7348
|
/* @__PURE__ */ p("span", { className: "relative h-2 rounded-[2px] bg-muted", children: /* @__PURE__ */ p(
|
|
7349
7349
|
"span",
|
|
7350
7350
|
{
|
|
7351
|
-
className: B("absolute top-0 h-2 rounded-[2px]",
|
|
7351
|
+
className: B("absolute top-0 h-2 rounded-[2px]", jf[s.kind]),
|
|
7352
7352
|
style: {
|
|
7353
7353
|
left: `${s.startMs / n * 100}%`,
|
|
7354
7354
|
width: `${Math.max(s.durationMs / n * 100, 0.8)}%`
|
|
@@ -7428,7 +7428,7 @@ function Lf({
|
|
|
7428
7428
|
options: r,
|
|
7429
7429
|
onPick: n
|
|
7430
7430
|
}) {
|
|
7431
|
-
const [a, s] =
|
|
7431
|
+
const [a, s] = D(() => /* @__PURE__ */ new Set()), o = (f) => s((i) => {
|
|
7432
7432
|
const g = new Set(i);
|
|
7433
7433
|
return g.has(f) ? g.delete(f) : g.add(f), g;
|
|
7434
7434
|
}), c = r.filter((f) => a.has(f.optionId));
|
|
@@ -7479,7 +7479,7 @@ function Lf({
|
|
|
7479
7479
|
/* @__PURE__ */ k("div", { className: "flex items-start justify-between gap-2", children: [
|
|
7480
7480
|
/* @__PURE__ */ p("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ p(xs, { onPick: n }) }),
|
|
7481
7481
|
/* @__PURE__ */ k(
|
|
7482
|
-
|
|
7482
|
+
Y,
|
|
7483
7483
|
{
|
|
7484
7484
|
size: "xs",
|
|
7485
7485
|
className: "mt-0.5 h-7 shrink-0 gap-1 px-2.5",
|
|
@@ -7503,7 +7503,7 @@ function Uf(e) {
|
|
|
7503
7503
|
`);
|
|
7504
7504
|
}
|
|
7505
7505
|
function xs({ onPick: e }) {
|
|
7506
|
-
const [t, r] =
|
|
7506
|
+
const [t, r] = D(), n = ie(null);
|
|
7507
7507
|
if (t === void 0)
|
|
7508
7508
|
return /* @__PURE__ */ k(
|
|
7509
7509
|
"button",
|
|
@@ -7548,7 +7548,7 @@ function xs({ onPick: e }) {
|
|
|
7548
7548
|
className: "h-7 min-w-0 flex-1 bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground"
|
|
7549
7549
|
}
|
|
7550
7550
|
),
|
|
7551
|
-
/* @__PURE__ */ p(
|
|
7551
|
+
/* @__PURE__ */ p(Y, { type: "submit", size: "xs", className: "h-7 w-7 shrink-0 p-0", "aria-label": "Send answer", title: "Send", disabled: !t.trim(), children: /* @__PURE__ */ p(Mt, { className: "h-3.5 w-3.5" }) })
|
|
7552
7552
|
]
|
|
7553
7553
|
}
|
|
7554
7554
|
);
|
|
@@ -7612,7 +7612,7 @@ function qf({
|
|
|
7612
7612
|
onUndo: r,
|
|
7613
7613
|
onAskAgain: n
|
|
7614
7614
|
}) {
|
|
7615
|
-
const a = X((g) => Bs(g, e.proposalId)), s = X((g) => g.isVisualEditing), o =
|
|
7615
|
+
const a = X((g) => Bs(g, e.proposalId)), s = X((g) => g.isVisualEditing), o = Kf(t, a), c = o.kind === "undone" || o.kind === "refused", f = !c && o.kind !== "settled", i = o.kind === "changed_since" ? Vf : o.kind === "undone" ? "Undone." : o.kind === "refused" ? o.message : void 0;
|
|
7616
7616
|
return /* @__PURE__ */ k(
|
|
7617
7617
|
vt,
|
|
7618
7618
|
{
|
|
@@ -7621,7 +7621,7 @@ function qf({
|
|
|
7621
7621
|
testId: "assistant-proposal",
|
|
7622
7622
|
"data-proposal-state": o.kind,
|
|
7623
7623
|
action: o.kind === "undoable" ? /* @__PURE__ */ k(
|
|
7624
|
-
|
|
7624
|
+
Y,
|
|
7625
7625
|
{
|
|
7626
7626
|
variant: "outline",
|
|
7627
7627
|
size: "xs",
|
|
@@ -7644,7 +7644,7 @@ function qf({
|
|
|
7644
7644
|
] }) : null,
|
|
7645
7645
|
children: [
|
|
7646
7646
|
/* @__PURE__ */ p("ul", { className: "space-y-1", children: e.changes.filter((g) => g.sentence).map((g, u) => {
|
|
7647
|
-
const m =
|
|
7647
|
+
const m = Yf(g.op);
|
|
7648
7648
|
return /* @__PURE__ */ k("li", { className: "flex items-start gap-1.5", children: [
|
|
7649
7649
|
/* @__PURE__ */ p(m, { className: "mt-[3px] h-3 w-3 shrink-0 text-muted-foreground" }),
|
|
7650
7650
|
/* @__PURE__ */ p("span", { className: B("min-w-0 flex-1 text-[12px] leading-[1.55]", c ? "text-muted-foreground" : "text-foreground"), children: g.sentence })
|
|
@@ -7656,7 +7656,7 @@ function qf({
|
|
|
7656
7656
|
] }, u)) }) : null,
|
|
7657
7657
|
i ? /* @__PURE__ */ k("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
7658
7658
|
/* @__PURE__ */ p("span", { className: "text-[11.5px] leading-[1.5] text-muted-foreground", children: i }),
|
|
7659
|
-
o.kind === "refused" && n ? /* @__PURE__ */ k(
|
|
7659
|
+
o.kind === "refused" && n ? /* @__PURE__ */ k(Y, { variant: "outline", size: "xs", className: "h-[26px] gap-1 px-2 text-[11.5px]", onClick: n, children: [
|
|
7660
7660
|
/* @__PURE__ */ p(Ln, { className: "h-3 w-3" }),
|
|
7661
7661
|
"Ask again"
|
|
7662
7662
|
] }) : null
|
|
@@ -7671,7 +7671,7 @@ function Jf({ refusal: e }) {
|
|
|
7671
7671
|
/* @__PURE__ */ p("span", { className: "min-w-0", children: e.message })
|
|
7672
7672
|
] }) });
|
|
7673
7673
|
}
|
|
7674
|
-
function
|
|
7674
|
+
function Wf({
|
|
7675
7675
|
change: e,
|
|
7676
7676
|
state: t,
|
|
7677
7677
|
onAdd: r,
|
|
@@ -7719,7 +7719,7 @@ function Kf({
|
|
|
7719
7719
|
] }),
|
|
7720
7720
|
/* @__PURE__ */ k("div", { className: "flex gap-1.5", children: [
|
|
7721
7721
|
/* @__PURE__ */ p(
|
|
7722
|
-
|
|
7722
|
+
Y,
|
|
7723
7723
|
{
|
|
7724
7724
|
size: "xs",
|
|
7725
7725
|
className: "h-[26px] px-2 text-[11.5px]",
|
|
@@ -7729,7 +7729,7 @@ function Kf({
|
|
|
7729
7729
|
}
|
|
7730
7730
|
),
|
|
7731
7731
|
/* @__PURE__ */ p(
|
|
7732
|
-
|
|
7732
|
+
Y,
|
|
7733
7733
|
{
|
|
7734
7734
|
variant: "outline",
|
|
7735
7735
|
size: "xs",
|
|
@@ -7743,7 +7743,7 @@ function Kf({
|
|
|
7743
7743
|
] }) : null,
|
|
7744
7744
|
c ? /* @__PURE__ */ k("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
7745
7745
|
/* @__PURE__ */ p("span", { className: "text-[11.5px] leading-[1.5] text-muted-foreground", children: c }),
|
|
7746
|
-
(s === "added" || s === "refused") && a ? /* @__PURE__ */ k(
|
|
7746
|
+
(s === "added" || s === "refused") && a ? /* @__PURE__ */ k(Y, { variant: "outline", size: "xs", className: "h-[26px] gap-1 px-2 text-[11.5px]", onClick: a, children: [
|
|
7747
7747
|
/* @__PURE__ */ p(Ln, { className: "h-3 w-3" }),
|
|
7748
7748
|
"Ask again"
|
|
7749
7749
|
] }) : null
|
|
@@ -7752,7 +7752,7 @@ function Kf({
|
|
|
7752
7752
|
}
|
|
7753
7753
|
);
|
|
7754
7754
|
}
|
|
7755
|
-
function
|
|
7755
|
+
function Kf(e, t) {
|
|
7756
7756
|
if (!e) return { kind: "settled" };
|
|
7757
7757
|
switch (e.status) {
|
|
7758
7758
|
case "applying":
|
|
@@ -7768,11 +7768,11 @@ function Wf(e, t) {
|
|
|
7768
7768
|
function Gf(e) {
|
|
7769
7769
|
return e.reason === "refused" ? `Not applied: ${e.message}` : e.message;
|
|
7770
7770
|
}
|
|
7771
|
-
function
|
|
7771
|
+
function Yf(e) {
|
|
7772
7772
|
return e.startsWith("filter.") ? Fo : e === "card.add" ? Pt : e === "card.remove" ? zn : Mn;
|
|
7773
7773
|
}
|
|
7774
7774
|
const kn = 4;
|
|
7775
|
-
function
|
|
7775
|
+
function Hf({
|
|
7776
7776
|
messages: e,
|
|
7777
7777
|
status: t,
|
|
7778
7778
|
failure: r,
|
|
@@ -7863,7 +7863,7 @@ function rm({
|
|
|
7863
7863
|
},
|
|
7864
7864
|
h
|
|
7865
7865
|
) : y.type === "data-proposal_refused" ? /* @__PURE__ */ p(Jf, { refusal: y.data }, h) : y.type === "data-model_change" ? /* @__PURE__ */ p(
|
|
7866
|
-
|
|
7866
|
+
Wf,
|
|
7867
7867
|
{
|
|
7868
7868
|
change: y.data,
|
|
7869
7869
|
state: c[y.data.proposalId],
|
|
@@ -7977,19 +7977,19 @@ function dm(e) {
|
|
|
7977
7977
|
return t;
|
|
7978
7978
|
}
|
|
7979
7979
|
const Is = {
|
|
7980
|
-
find:
|
|
7981
|
-
read:
|
|
7982
|
-
analyze:
|
|
7980
|
+
find: Ks,
|
|
7981
|
+
read: Ws,
|
|
7982
|
+
analyze: Dn,
|
|
7983
7983
|
sql: Js,
|
|
7984
7984
|
change: Mn,
|
|
7985
|
-
retry:
|
|
7985
|
+
retry: Ko
|
|
7986
7986
|
};
|
|
7987
7987
|
function pm({ stage: e }) {
|
|
7988
7988
|
if (e.activity) {
|
|
7989
7989
|
const t = Is[e.activity];
|
|
7990
7990
|
return /* @__PURE__ */ p(t, { className: "h-3 w-3", "aria-hidden": "true" });
|
|
7991
7991
|
}
|
|
7992
|
-
return e.state === "done" ? /* @__PURE__ */ p(mt, { className: "h-3 w-3" }) : e.state === "live" ? /* @__PURE__ */ p(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ p(
|
|
7992
|
+
return e.state === "done" ? /* @__PURE__ */ p(mt, { className: "h-3 w-3" }) : e.state === "live" ? /* @__PURE__ */ p(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ p(Hs, { className: "h-3 w-3" });
|
|
7993
7993
|
}
|
|
7994
7994
|
function Ss({ step: e }) {
|
|
7995
7995
|
const t = (e == null ? void 0 : e.label) ?? "Thinking", r = e != null && e.activity ? Is[e.activity] : void 0;
|
|
@@ -8003,7 +8003,7 @@ function mm({ text: e }) {
|
|
|
8003
8003
|
return /* @__PURE__ */ p("div", { className: "break-words text-[13px] leading-[1.6] text-foreground", children: /* @__PURE__ */ p(
|
|
8004
8004
|
Gs,
|
|
8005
8005
|
{
|
|
8006
|
-
remarkPlugins: [
|
|
8006
|
+
remarkPlugins: [Ys],
|
|
8007
8007
|
components: {
|
|
8008
8008
|
p: ({ children: t }) => /* @__PURE__ */ p("p", { className: "mb-2 last:mb-0", children: t }),
|
|
8009
8009
|
ul: ({ children: t }) => /* @__PURE__ */ p("ul", { className: "mb-2 list-disc space-y-1 pl-5 last:mb-0", children: t }),
|
|
@@ -8023,8 +8023,8 @@ function mm({ text: e }) {
|
|
|
8023
8023
|
) });
|
|
8024
8024
|
}
|
|
8025
8025
|
const hm = [
|
|
8026
|
-
{ layout: "docked-right", label: "Dock right", short: "Right", icon:
|
|
8027
|
-
{ layout: "docked-left", label: "Dock left", short: "Left", icon:
|
|
8026
|
+
{ layout: "docked-right", label: "Dock right", short: "Right", icon: Yn },
|
|
8027
|
+
{ layout: "docked-left", label: "Dock left", short: "Left", icon: Wo },
|
|
8028
8028
|
{ layout: "centered", label: "Centered", short: "Center", icon: Bo },
|
|
8029
8029
|
{ layout: "full-page", label: "Full page", short: "Full", icon: no }
|
|
8030
8030
|
];
|
|
@@ -8035,7 +8035,7 @@ function gm({
|
|
|
8035
8035
|
canCopy: n,
|
|
8036
8036
|
onCopy: a
|
|
8037
8037
|
}) {
|
|
8038
|
-
const [s, o] =
|
|
8038
|
+
const [s, o] = D(), c = ie(void 0);
|
|
8039
8039
|
ke(() => () => clearTimeout(c.current), []);
|
|
8040
8040
|
const f = (g) => {
|
|
8041
8041
|
a(g === "tool_calls").then(
|
|
@@ -8052,7 +8052,7 @@ function gm({
|
|
|
8052
8052
|
] }) : null,
|
|
8053
8053
|
/* @__PURE__ */ k(Qs, { children: [
|
|
8054
8054
|
/* @__PURE__ */ p(Xs, { asChild: !0, children: /* @__PURE__ */ p(
|
|
8055
|
-
|
|
8055
|
+
Y,
|
|
8056
8056
|
{
|
|
8057
8057
|
variant: "ghost",
|
|
8058
8058
|
size: "xs",
|
|
@@ -8126,7 +8126,7 @@ function vm({
|
|
|
8126
8126
|
staleTime: 0,
|
|
8127
8127
|
// A failed read says so at once, whichever client the host mounted.
|
|
8128
8128
|
retry: !1
|
|
8129
|
-
}), f = Rn(), [i, g] =
|
|
8129
|
+
}), f = Rn(), [i, g] = D(), [u, m] = D(() => /* @__PURE__ */ new Set()), [w, I] = D(), E = (y = c.data) == null ? void 0 : y.filter((h) => !u.has(h.conversationId)), _ = async (h) => {
|
|
8130
8130
|
g(h);
|
|
8131
8131
|
const d = await n(h);
|
|
8132
8132
|
g((v) => v === h ? void 0 : v), d === "not_opened" && cr(f, lr(e));
|
|
@@ -8227,7 +8227,7 @@ function xm({
|
|
|
8227
8227
|
/* @__PURE__ */ p("span", { className: B("truncate", f && "line-through"), children: c }),
|
|
8228
8228
|
f ? /* @__PURE__ */ p("span", { className: "sr-only", children: "no longer available" }) : null,
|
|
8229
8229
|
/* @__PURE__ */ p(
|
|
8230
|
-
|
|
8230
|
+
Y,
|
|
8231
8231
|
{
|
|
8232
8232
|
type: "button",
|
|
8233
8233
|
variant: "ghost",
|
|
@@ -8251,7 +8251,7 @@ function wm({
|
|
|
8251
8251
|
disabled: n,
|
|
8252
8252
|
onAdd: a
|
|
8253
8253
|
}) {
|
|
8254
|
-
const [s, o] =
|
|
8254
|
+
const [s, o] = D(!1), [c, f] = D(""), i = Ns(e, t, s || r.length > 0), g = new Set(r.map(ve)), u = (i.data ?? []).filter((I) => !g.has(ve(I.source))), m = c.trim().toLowerCase(), w = m ? u.filter((I) => `${I.label} ${I.domainLabel ?? ""}`.toLowerCase().includes(m)) : u;
|
|
8255
8255
|
return /* @__PURE__ */ k(
|
|
8256
8256
|
Un,
|
|
8257
8257
|
{
|
|
@@ -8261,7 +8261,7 @@ function wm({
|
|
|
8261
8261
|
},
|
|
8262
8262
|
children: [
|
|
8263
8263
|
/* @__PURE__ */ p(Bn, { asChild: !0, children: /* @__PURE__ */ p(
|
|
8264
|
-
|
|
8264
|
+
Y,
|
|
8265
8265
|
{
|
|
8266
8266
|
type: "button",
|
|
8267
8267
|
variant: "ghost",
|
|
@@ -8324,7 +8324,7 @@ function _m({ entries: e, onPick: t }) {
|
|
|
8324
8324
|
] }, n)) });
|
|
8325
8325
|
}
|
|
8326
8326
|
function Im(e) {
|
|
8327
|
-
const [t, r] =
|
|
8327
|
+
const [t, r] = D([]), n = e ? t.filter((o) => o.cardId === e).map((o) => o.field) : [], a = n.length >= et.taggedFields, s = (o) => !!e && !a && !n.some((c) => er(c, o));
|
|
8328
8328
|
return {
|
|
8329
8329
|
shown: n,
|
|
8330
8330
|
/** Five are tagged: nothing more can be. */
|
|
@@ -8365,7 +8365,7 @@ function sh({
|
|
|
8365
8365
|
var P;
|
|
8366
8366
|
return s && A.dashboard ? (P = go(A.dashboard, s.cardId)) == null ? void 0 : P.card : void 0;
|
|
8367
8367
|
}
|
|
8368
|
-
), w = Cm(n), I = ie(void 0), [E] =
|
|
8368
|
+
), w = Cm(n), I = ie(void 0), [E] = D(() => Go(t)), [_, x] = D([]), y = te(
|
|
8369
8369
|
(A) => {
|
|
8370
8370
|
I.current = A;
|
|
8371
8371
|
const P = Em(
|
|
@@ -8380,7 +8380,7 @@ function sh({
|
|
|
8380
8380
|
apiServiceUrl: (A = a.tokenProps) == null ? void 0 : A.apiServiceUrl,
|
|
8381
8381
|
accessToken: (P = a.authToken) == null ? void 0 : P.accessToken
|
|
8382
8382
|
};
|
|
8383
|
-
}, v =
|
|
8383
|
+
}, v = Yo({ surface: t }), { canChangeNow: b } = Wn(t === "dashboard"), N = wo(b), T = hf({
|
|
8384
8384
|
canChangeOpenDashboard: b,
|
|
8385
8385
|
applyProposal: N,
|
|
8386
8386
|
readContext: () => E({ focus: e.store.getState().focus, snapshot: I.current, editing: $m(n) }),
|
|
@@ -8392,37 +8392,37 @@ function sh({
|
|
|
8392
8392
|
onFailed: (A) => {
|
|
8393
8393
|
A instanceof tt && A.code === "context_invalid" && cr(h, ls(e.id));
|
|
8394
8394
|
}
|
|
8395
|
-
}), [O,
|
|
8395
|
+
}), [O, W] = D(""), H = ie(null);
|
|
8396
8396
|
ke(() => {
|
|
8397
8397
|
var A;
|
|
8398
|
-
(o || n) && ((A =
|
|
8398
|
+
(o || n) && ((A = H.current) == null || A.focus());
|
|
8399
8399
|
}, [o, c, n]);
|
|
8400
|
-
const
|
|
8400
|
+
const We = ie(T.askedAbout);
|
|
8401
8401
|
Ue(() => {
|
|
8402
|
-
|
|
8402
|
+
We.current = T.askedAbout;
|
|
8403
8403
|
}), ke(() => {
|
|
8404
8404
|
const { focus: A, beside: P } = e.store.getState();
|
|
8405
|
-
A &&
|
|
8405
|
+
A && We.current(A.cardId, { beside: P });
|
|
8406
8406
|
}, [c, e]);
|
|
8407
|
-
const
|
|
8407
|
+
const Ke = (w == null ? void 0 : w.id) ?? (m == null ? void 0 : m.id), K = Im(Ke), ye = Ke ? _ : [], [Ae, Ce] = D(), _e = Ae ? K.available(ye).filter((A) => A.label.toLowerCase().includes(Ae.query.toLowerCase())) : [], xe = Ae && _e.length ? { ...Ae, active: Math.min(Ae.active, _e.length - 1) } : void 0, R = ie(void 0);
|
|
8408
8408
|
Ue(() => {
|
|
8409
8409
|
var A;
|
|
8410
|
-
R.current !== void 0 && ((A =
|
|
8410
|
+
R.current !== void 0 && ((A = H.current) == null || A.setSelectionRange(R.current, R.current), R.current = void 0);
|
|
8411
8411
|
}, [O]);
|
|
8412
8412
|
const C = (A) => {
|
|
8413
|
-
|
|
8414
|
-
const P =
|
|
8415
|
-
se.text !== O && (R.current = se.caret,
|
|
8413
|
+
K.add(A);
|
|
8414
|
+
const P = H.current, se = Sm(O, (P == null ? void 0 : P.selectionStart) ?? O.length);
|
|
8415
|
+
se.text !== O && (R.current = se.caret, W(se.text)), Ce(void 0), P == null || P.focus();
|
|
8416
8416
|
}, M = (A) => {
|
|
8417
|
-
A == null || A.preventDefault(), T.send(O,
|
|
8417
|
+
A == null || A.preventDefault(), T.send(O, K.shown) === "sent" && (W(""), K.clear());
|
|
8418
8418
|
}, Z = (A) => {
|
|
8419
8419
|
var se;
|
|
8420
8420
|
const P = T.send(A) === "sent";
|
|
8421
|
-
return P && ((se =
|
|
8421
|
+
return P && ((se = H.current) == null || se.focus()), P;
|
|
8422
8422
|
}, de = (A) => {
|
|
8423
8423
|
var se;
|
|
8424
8424
|
const P = T.askAgain(A) === "sent";
|
|
8425
|
-
return P && ((se =
|
|
8425
|
+
return P && ((se = H.current) == null || se.focus()), P;
|
|
8426
8426
|
}, pe = (A) => {
|
|
8427
8427
|
if (xe) {
|
|
8428
8428
|
if (A.key === "ArrowDown" || A.key === "ArrowUp") {
|
|
@@ -8440,15 +8440,15 @@ function sh({
|
|
|
8440
8440
|
A.preventDefault(), Ce(void 0);
|
|
8441
8441
|
return;
|
|
8442
8442
|
}
|
|
8443
|
-
if (A.key === "Backspace" && !O &&
|
|
8444
|
-
|
|
8443
|
+
if (A.key === "Backspace" && !O && K.shown.length) {
|
|
8444
|
+
K.remove(K.shown[K.shown.length - 1]);
|
|
8445
8445
|
return;
|
|
8446
8446
|
}
|
|
8447
8447
|
A.key === "Enter" && !A.shiftKey && !A.nativeEvent.isComposing && M(A);
|
|
8448
|
-
}, Q = T.messages.length === 0, [fe, ae] =
|
|
8448
|
+
}, Q = T.messages.length === 0, [fe, ae] = D(), $e = (fe == null ? void 0 : fe.sessionKey) === T.sessionKey ? Am(T.messages, fe.artifactId) : void 0, Ie = (A) => {
|
|
8449
8449
|
ae((P) => ({ sessionKey: T.sessionKey, artifactId: A, opened: ((P == null ? void 0 : P.opened) ?? 0) + 1 })), e.leaveBeside(), i !== "full-page" && e.setLayout("full-page");
|
|
8450
8450
|
}, Oe = g === "full-page", Er = /* @__PURE__ */ p(
|
|
8451
|
-
|
|
8451
|
+
Y,
|
|
8452
8452
|
{
|
|
8453
8453
|
variant: "ghost",
|
|
8454
8454
|
size: "xs",
|
|
@@ -8458,12 +8458,12 @@ function sh({
|
|
|
8458
8458
|
disabled: Q && !T.busy && !T.loading,
|
|
8459
8459
|
onClick: () => {
|
|
8460
8460
|
var A;
|
|
8461
|
-
T.startNew(), (A =
|
|
8461
|
+
T.startNew(), (A = H.current) == null || A.focus();
|
|
8462
8462
|
},
|
|
8463
8463
|
children: /* @__PURE__ */ p(uo, { className: "h-3.5 w-3.5" })
|
|
8464
8464
|
}
|
|
8465
8465
|
), Ft = n ? null : /* @__PURE__ */ p(
|
|
8466
|
-
|
|
8466
|
+
Y,
|
|
8467
8467
|
{
|
|
8468
8468
|
variant: "ghost",
|
|
8469
8469
|
size: "xs",
|
|
@@ -8497,7 +8497,7 @@ function sh({
|
|
|
8497
8497
|
}
|
|
8498
8498
|
),
|
|
8499
8499
|
/* @__PURE__ */ p(
|
|
8500
|
-
|
|
8500
|
+
Y,
|
|
8501
8501
|
{
|
|
8502
8502
|
variant: "ghost",
|
|
8503
8503
|
size: "xs",
|
|
@@ -8521,21 +8521,21 @@ function sh({
|
|
|
8521
8521
|
T.notice ? /* @__PURE__ */ p("p", { role: "alert", className: "text-[12px] leading-[1.5] text-destructive", children: T.notice }) : null,
|
|
8522
8522
|
/* @__PURE__ */ k("form", { onSubmit: M, className: "relative rounded-control border border-input bg-background focus-within:border-ring", children: [
|
|
8523
8523
|
xe ? /* @__PURE__ */ p(Bf, { fields: _e, active: xe.active, onPick: C }) : null,
|
|
8524
|
-
|
|
8524
|
+
K.shown.length ? (
|
|
8525
8525
|
// The tagged fields sit in the question itself, before its words.
|
|
8526
|
-
/* @__PURE__ */ p("div", { className: "flex flex-wrap gap-1 px-2.5 pt-2", "data-testid": "assistant-question-tags", children:
|
|
8526
|
+
/* @__PURE__ */ p("div", { className: "flex flex-wrap gap-1 px-2.5 pt-2", "data-testid": "assistant-question-tags", children: K.shown.map((A) => /* @__PURE__ */ p(ws, { field: A, onRemove: () => K.remove(A) }, `${A.role}:${A.name}:${A.aggregate ?? ""}:${A.granularity ?? ""}`)) })
|
|
8527
8527
|
) : null,
|
|
8528
8528
|
/* @__PURE__ */ p(
|
|
8529
8529
|
"textarea",
|
|
8530
8530
|
{
|
|
8531
|
-
ref:
|
|
8531
|
+
ref: H,
|
|
8532
8532
|
"aria-label": "Message",
|
|
8533
8533
|
placeholder: w ? "Ask about this visual" : m ? "Ask about this card" : n ? "Ask about your data" : "Ask about this dashboard",
|
|
8534
8534
|
value: O,
|
|
8535
8535
|
maxLength: et.messageChars,
|
|
8536
8536
|
rows: 2,
|
|
8537
8537
|
onChange: (A) => {
|
|
8538
|
-
|
|
8538
|
+
W(A.target.value), T.notice && T.clearNotice();
|
|
8539
8539
|
const P = ks(A.target.value, A.target.selectionStart ?? A.target.value.length);
|
|
8540
8540
|
Ce(P === void 0 ? void 0 : { query: P, active: 0 });
|
|
8541
8541
|
},
|
|
@@ -8557,25 +8557,25 @@ function sh({
|
|
|
8557
8557
|
}
|
|
8558
8558
|
),
|
|
8559
8559
|
ye.length ? /* @__PURE__ */ p(
|
|
8560
|
-
|
|
8560
|
+
Y,
|
|
8561
8561
|
{
|
|
8562
8562
|
type: "button",
|
|
8563
8563
|
variant: "ghost",
|
|
8564
8564
|
size: "xs",
|
|
8565
8565
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
8566
8566
|
"aria-label": "Tag a field",
|
|
8567
|
-
title:
|
|
8568
|
-
disabled:
|
|
8567
|
+
title: K.full ? `Up to ${et.taggedFields} fields per question` : "Tag a field",
|
|
8568
|
+
disabled: K.full,
|
|
8569
8569
|
onClick: () => {
|
|
8570
8570
|
var A;
|
|
8571
|
-
Ce((P) => P ? void 0 : { query: "", active: 0 }), (A =
|
|
8571
|
+
Ce((P) => P ? void 0 : { query: "", active: 0 }), (A = H.current) == null || A.focus();
|
|
8572
8572
|
},
|
|
8573
8573
|
children: /* @__PURE__ */ p(io, { className: "h-4 w-4" })
|
|
8574
8574
|
}
|
|
8575
8575
|
) : null
|
|
8576
8576
|
] }),
|
|
8577
8577
|
T.busy ? /* @__PURE__ */ p(
|
|
8578
|
-
|
|
8578
|
+
Y,
|
|
8579
8579
|
{
|
|
8580
8580
|
type: "button",
|
|
8581
8581
|
size: "xs",
|
|
@@ -8587,7 +8587,7 @@ function sh({
|
|
|
8587
8587
|
children: /* @__PURE__ */ p(lo, { className: "h-3 w-3 fill-current" })
|
|
8588
8588
|
}
|
|
8589
8589
|
) : /* @__PURE__ */ p(
|
|
8590
|
-
|
|
8590
|
+
Y,
|
|
8591
8591
|
{
|
|
8592
8592
|
type: "submit",
|
|
8593
8593
|
size: "xs",
|
|
@@ -8613,11 +8613,11 @@ function sh({
|
|
|
8613
8613
|
onOpen: async (A) => {
|
|
8614
8614
|
var se;
|
|
8615
8615
|
const P = await T.open(A);
|
|
8616
|
-
return P === "opened" && ((se =
|
|
8616
|
+
return P === "opened" && ((se = H.current) == null || se.focus()), P;
|
|
8617
8617
|
},
|
|
8618
8618
|
onDeleted: (A) => {
|
|
8619
8619
|
var P;
|
|
8620
|
-
A === T.conversationId && (T.startNew(), (P =
|
|
8620
|
+
A === T.conversationId && (T.startNew(), (P = H.current) == null || P.focus());
|
|
8621
8621
|
},
|
|
8622
8622
|
answeringId: T.busy ? T.conversationId : void 0,
|
|
8623
8623
|
header: /* @__PURE__ */ k("div", { className: "flex h-11 shrink-0 items-center justify-between gap-2 px-3", children: [
|
|
@@ -8653,17 +8653,17 @@ function sh({
|
|
|
8653
8653
|
] }),
|
|
8654
8654
|
/* @__PURE__ */ k("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
8655
8655
|
/* @__PURE__ */ k(
|
|
8656
|
-
|
|
8656
|
+
Y,
|
|
8657
8657
|
{
|
|
8658
8658
|
variant: "ghost",
|
|
8659
8659
|
size: "xs",
|
|
8660
8660
|
className: "h-7 gap-1 px-1.5 text-[11.5px] text-muted-foreground hover:text-foreground",
|
|
8661
8661
|
onClick: () => {
|
|
8662
8662
|
var A;
|
|
8663
|
-
e.leaveBeside(), (A =
|
|
8663
|
+
e.leaveBeside(), (A = H.current) == null || A.focus();
|
|
8664
8664
|
},
|
|
8665
8665
|
children: [
|
|
8666
|
-
/* @__PURE__ */ p(
|
|
8666
|
+
/* @__PURE__ */ p(Yn, { className: "h-3.5 w-3.5" }),
|
|
8667
8667
|
"Open in assistant"
|
|
8668
8668
|
]
|
|
8669
8669
|
}
|
|
@@ -8746,7 +8746,7 @@ function En({
|
|
|
8746
8746
|
}, [e, t, n, r]), null;
|
|
8747
8747
|
}
|
|
8748
8748
|
function Cm(e) {
|
|
8749
|
-
const t = X((n) => n.isVisualEditing), r =
|
|
8749
|
+
const t = X((n) => n.isVisualEditing), r = jn((n) => n.card);
|
|
8750
8750
|
return !e && t ? r : void 0;
|
|
8751
8751
|
}
|
|
8752
8752
|
function $m(e) {
|
|
@@ -8755,7 +8755,7 @@ function $m(e) {
|
|
|
8755
8755
|
}
|
|
8756
8756
|
function Es(e) {
|
|
8757
8757
|
if (e || !X.getState().isVisualEditing) return;
|
|
8758
|
-
const t =
|
|
8758
|
+
const t = jn.getState();
|
|
8759
8759
|
return { card: t.card, mode: t.isDevMode ? "sql" : "visual" };
|
|
8760
8760
|
}
|
|
8761
8761
|
function Om(e) {
|
|
@@ -8784,7 +8784,7 @@ function Mm({
|
|
|
8784
8784
|
onPick: s,
|
|
8785
8785
|
onAskAgain: o
|
|
8786
8786
|
}) {
|
|
8787
|
-
const c = ie(null), [f, i] =
|
|
8787
|
+
const c = ie(null), [f, i] = D(!0), g = ie(void 0), u = ie(r);
|
|
8788
8788
|
Ue(() => {
|
|
8789
8789
|
const E = c.current;
|
|
8790
8790
|
!E || u.current === r || (u.current = r, f ? E.scrollTop = E.scrollHeight : g.current && zm(E, g.current));
|
|
@@ -8810,7 +8810,7 @@ function Mm({
|
|
|
8810
8810
|
i(_.scrollHeight - _.scrollTop - _.clientHeight < 24), g.current = Om(_);
|
|
8811
8811
|
},
|
|
8812
8812
|
children: t ? null : /* @__PURE__ */ p(
|
|
8813
|
-
|
|
8813
|
+
Hf,
|
|
8814
8814
|
{
|
|
8815
8815
|
messages: e.messages,
|
|
8816
8816
|
status: e.status,
|
|
@@ -8829,7 +8829,7 @@ function Mm({
|
|
|
8829
8829
|
}
|
|
8830
8830
|
),
|
|
8831
8831
|
!t && !f ? /* @__PURE__ */ p(
|
|
8832
|
-
|
|
8832
|
+
Y,
|
|
8833
8833
|
{
|
|
8834
8834
|
variant: "outline",
|
|
8835
8835
|
size: "xs",
|