@fencyai/react 0.1.191 → 0.1.192

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.
Files changed (32) hide show
  1. package/dist/agent-task/AgentTaskEventDataSchemas.d.ts +24 -0
  2. package/dist/agent-task/AgentTaskEventDataSchemas.d.ts.map +1 -1
  3. package/dist/agent-task/AgentTaskProgress.d.ts.map +1 -1
  4. package/dist/agent-task/AgentTaskProgressVerbose.d.ts +1 -0
  5. package/dist/agent-task/AgentTaskProgressVerbose.d.ts.map +1 -1
  6. package/dist/agent-task/data-types/MemoryChatGenerateReportAssembling.d.ts +14 -0
  7. package/dist/agent-task/data-types/MemoryChatGenerateReportAssembling.d.ts.map +1 -0
  8. package/dist/agent-task/data-types/MemoryChatGenerateReportCompleted.d.ts +12 -0
  9. package/dist/agent-task/data-types/MemoryChatGenerateReportCompleted.d.ts.map +1 -0
  10. package/dist/agent-task/data-types/MemoryChatGenerateReportExporting.d.ts +14 -0
  11. package/dist/agent-task/data-types/MemoryChatGenerateReportExporting.d.ts.map +1 -0
  12. package/dist/agent-task/data-types/MemoryChatGenerateReportRunCode.d.ts +14 -0
  13. package/dist/agent-task/data-types/MemoryChatGenerateReportRunCode.d.ts.map +1 -0
  14. package/dist/agent-task/data-types/MemoryChatGenerateReportRunCommand.d.ts +14 -0
  15. package/dist/agent-task/data-types/MemoryChatGenerateReportRunCommand.d.ts.map +1 -0
  16. package/dist/agent-task/data-types/MemoryChatGenerateReportSetup.d.ts +14 -0
  17. package/dist/agent-task/data-types/MemoryChatGenerateReportSetup.d.ts.map +1 -0
  18. package/dist/agent-task/data-types/StreamingChatCompletionText.d.ts +6 -0
  19. package/dist/agent-task/data-types/StreamingChatCompletionText.d.ts.map +1 -1
  20. package/dist/agent-task/data-types/StructuredChatCompletionJson.d.ts.map +1 -1
  21. package/dist/agent-task/translations.d.ts +7 -0
  22. package/dist/agent-task/translations.d.ts.map +1 -1
  23. package/dist/assets/index.css +1 -1
  24. package/dist/hooks/useAgentTasks/index.d.ts.map +1 -1
  25. package/dist/index.js +1353 -923
  26. package/dist/types/AgentTask.d.ts +1 -0
  27. package/dist/types/AgentTask.d.ts.map +1 -1
  28. package/dist/types/UseAgentTasks.d.ts +9 -1
  29. package/dist/types/UseAgentTasks.d.ts.map +1 -1
  30. package/dist/types/UseAgentTasksProps.d.ts +17 -0
  31. package/dist/types/UseAgentTasksProps.d.ts.map +1 -1
  32. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
- import { jsxs as f, jsx as o, Fragment as B } from "react/jsx-runtime";
2
- import { createStream as Ie, isStreamTimeoutEvent as Re, isStreamNotFoundEvent as Fe, isAgentTaskProgressItemUpdatedEvent as Ae, createAgentTask as Be } from "@fencyai/js";
3
- import Pe, { createContext as pe, useState as I, useRef as D, useEffect as z, useCallback as O, useContext as ge, useMemo as W } from "react";
1
+ import { jsxs as k, jsx as o, Fragment as P } from "react/jsx-runtime";
2
+ import { createStream as Re, isStreamTimeoutEvent as Fe, isStreamNotFoundEvent as Ae, isAgentTaskProgressItemUpdatedEvent as Be, createAgentTaskFileDownloadLink as De, createAgentTask as Pe, parseAgentTaskFileIdFromFencyFileHref as Le } from "@fencyai/js";
3
+ import ze, { createContext as ge, useState as I, useRef as W, useEffect as L, useCallback as N, useContext as ye, useMemo as z } from "react";
4
4
  import { z as a } from "zod";
5
- import { motion as M, useInView as ze, AnimatePresence as De } from "motion/react";
6
- import Le from "react-markdown";
7
- import { Prism as ye } from "react-syntax-highlighter";
8
- import We from "remark-gfm";
9
- import './assets/index.css';const fe = pe(
5
+ import { motion as v, useInView as We, AnimatePresence as je } from "motion/react";
6
+ import Ne from "react-markdown";
7
+ import { Prism as fe } from "react-syntax-highlighter";
8
+ import Oe from "remark-gfm";
9
+ import './assets/index.css';const ke = ge(
10
10
  void 0
11
11
  );
12
- async function Ne(e, t) {
12
+ async function $e(e, t) {
13
13
  const n = e.getReader();
14
14
  let r;
15
15
  for (; !(r = await n.read()).done; )
16
16
  t(r.value);
17
17
  }
18
- function Oe(e) {
18
+ function Ge(e) {
19
19
  let t, n, r, i = !1;
20
20
  return function(s) {
21
- t === void 0 ? (t = s, n = 0, r = -1) : t = $e(t, s);
22
- const h = t.length;
21
+ t === void 0 ? (t = s, n = 0, r = -1) : t = Ue(t, s);
22
+ const u = t.length;
23
23
  let d = 0;
24
- for (; n < h; ) {
24
+ for (; n < u; ) {
25
25
  i && (t[n] === 10 && (d = ++n), i = !1);
26
- let u = -1;
27
- for (; n < h && u === -1; ++n)
26
+ let m = -1;
27
+ for (; n < u && m === -1; ++n)
28
28
  switch (t[n]) {
29
29
  case 58:
30
30
  r === -1 && (r = n - d);
@@ -32,48 +32,48 @@ function Oe(e) {
32
32
  case 13:
33
33
  i = !0;
34
34
  case 10:
35
- u = n;
35
+ m = n;
36
36
  break;
37
37
  }
38
- if (u === -1)
38
+ if (m === -1)
39
39
  break;
40
- e(t.subarray(d, u), r), d = n, r = -1;
40
+ e(t.subarray(d, m), r), d = n, r = -1;
41
41
  }
42
- d === h ? t = void 0 : d !== 0 && (t = t.subarray(d), n -= d);
42
+ d === u ? t = void 0 : d !== 0 && (t = t.subarray(d), n -= d);
43
43
  };
44
44
  }
45
- function je(e, t, n) {
46
- let r = oe();
45
+ function He(e, t, n) {
46
+ let r = ae();
47
47
  const i = new TextDecoder();
48
- return function(s, h) {
48
+ return function(s, u) {
49
49
  if (s.length === 0)
50
- n == null || n(r), r = oe();
51
- else if (h > 0) {
52
- const d = i.decode(s.subarray(0, h)), u = h + (s[h + 1] === 32 ? 2 : 1), l = i.decode(s.subarray(u));
50
+ n == null || n(r), r = ae();
51
+ else if (u > 0) {
52
+ const d = i.decode(s.subarray(0, u)), m = u + (s[u + 1] === 32 ? 2 : 1), f = i.decode(s.subarray(m));
53
53
  switch (d) {
54
54
  case "data":
55
55
  r.data = r.data ? r.data + `
56
- ` + l : l;
56
+ ` + f : f;
57
57
  break;
58
58
  case "event":
59
- r.event = l;
59
+ r.event = f;
60
60
  break;
61
61
  case "id":
62
- e(r.id = l);
62
+ e(r.id = f);
63
63
  break;
64
64
  case "retry":
65
- const m = parseInt(l, 10);
66
- isNaN(m) || t(r.retry = m);
65
+ const l = parseInt(f, 10);
66
+ isNaN(l) || t(r.retry = l);
67
67
  break;
68
68
  }
69
69
  }
70
70
  };
71
71
  }
72
- function $e(e, t) {
72
+ function Ue(e, t) {
73
73
  const n = new Uint8Array(e.length + t.length);
74
74
  return n.set(e), n.set(t, e.length), n;
75
75
  }
76
- function oe() {
76
+ function ae() {
77
77
  return {
78
78
  data: "",
79
79
  event: "",
@@ -81,7 +81,7 @@ function oe() {
81
81
  retry: void 0
82
82
  };
83
83
  }
84
- var He = function(e, t) {
84
+ var _e = function(e, t) {
85
85
  var n = {};
86
86
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
87
87
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
@@ -89,60 +89,60 @@ var He = function(e, t) {
89
89
  t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
90
90
  return n;
91
91
  };
92
- const H = "text/event-stream", Ue = 1e3, ae = "last-event-id";
93
- function _e(e, t) {
94
- var { signal: n, headers: r, onopen: i, onmessage: c, onclose: s, onerror: h, openWhenHidden: d, fetch: u } = t, l = He(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
95
- return new Promise((m, k) => {
96
- const y = Object.assign({}, r);
97
- y.accept || (y.accept = H);
98
- let g;
92
+ const H = "text/event-stream", qe = 1e3, ie = "last-event-id";
93
+ function Qe(e, t) {
94
+ var { signal: n, headers: r, onopen: i, onmessage: c, onclose: s, onerror: u, openWhenHidden: d, fetch: m } = t, f = _e(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
95
+ return new Promise((l, h) => {
96
+ const b = Object.assign({}, r);
97
+ b.accept || (b.accept = H);
98
+ let y;
99
99
  function p() {
100
- g.abort(), document.hidden || R();
100
+ y.abort(), document.hidden || w();
101
101
  }
102
102
  d || document.addEventListener("visibilitychange", p);
103
- let b = Ue, C = 0;
104
- function v() {
105
- document.removeEventListener("visibilitychange", p), window.clearTimeout(C), g.abort();
103
+ let g = qe, T = 0;
104
+ function E() {
105
+ document.removeEventListener("visibilitychange", p), window.clearTimeout(T), y.abort();
106
106
  }
107
107
  n == null || n.addEventListener("abort", () => {
108
- v(), m();
108
+ E(), l();
109
109
  });
110
- const x = u ?? window.fetch, E = i ?? Ge;
111
- async function R() {
110
+ const D = m ?? window.fetch, C = i ?? Ke;
111
+ async function w() {
112
112
  var A;
113
- g = new AbortController();
113
+ y = new AbortController();
114
114
  try {
115
- const w = await x(e, Object.assign(Object.assign({}, l), { headers: y, signal: g.signal }));
116
- await E(w), await Ne(w.body, Oe(je((P) => {
117
- P ? y[ae] = P : delete y[ae];
118
- }, (P) => {
119
- b = P;
120
- }, c))), s == null || s(), v(), m();
121
- } catch (w) {
122
- if (!g.signal.aborted)
115
+ const B = await D(e, Object.assign(Object.assign({}, f), { headers: b, signal: y.signal }));
116
+ await C(B), await $e(B.body, Ge(He((M) => {
117
+ M ? b[ie] = M : delete b[ie];
118
+ }, (M) => {
119
+ g = M;
120
+ }, c))), s == null || s(), E(), l();
121
+ } catch (B) {
122
+ if (!y.signal.aborted)
123
123
  try {
124
- const P = (A = h == null ? void 0 : h(w)) !== null && A !== void 0 ? A : b;
125
- window.clearTimeout(C), C = window.setTimeout(R, P);
126
- } catch (P) {
127
- v(), k(P);
124
+ const M = (A = u == null ? void 0 : u(B)) !== null && A !== void 0 ? A : g;
125
+ window.clearTimeout(T), T = window.setTimeout(w, M);
126
+ } catch (M) {
127
+ E(), h(M);
128
128
  }
129
129
  }
130
130
  }
131
- R();
131
+ w();
132
132
  });
133
133
  }
134
- function Ge(e) {
134
+ function Ke(e) {
135
135
  const t = e.headers.get("content-type");
136
136
  if (!(t != null && t.startsWith(H)))
137
137
  throw new Error(`Expected content-type to be ${H}, Actual: ${t}`);
138
138
  }
139
- function ie(e) {
139
+ function se(e) {
140
140
  const t = atob(e), n = new Uint8Array(t.length);
141
141
  for (let r = 0; r < t.length; r++)
142
142
  n[r] = t.charCodeAt(r);
143
143
  return new TextDecoder("utf-8").decode(n);
144
144
  }
145
- function qe() {
145
+ function Xe() {
146
146
  return `
147
147
  var connections = new Map();
148
148
 
@@ -288,10 +288,10 @@ self.onmessage = function (e) {
288
288
  };
289
289
  `.trim();
290
290
  }
291
- function se(e) {
291
+ function le(e) {
292
292
  return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown stream error";
293
293
  }
294
- class Qe {
294
+ class Ve {
295
295
  constructor(t) {
296
296
  this.activeConnections = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.worker = null, this.workerBlobUrl = null, this.workerSupported = !1, this.fency = t, this.tryInitWorker();
297
297
  }
@@ -299,7 +299,7 @@ class Qe {
299
299
  try {
300
300
  if (typeof Worker > "u" || typeof Blob > "u" || typeof URL > "u" || typeof URL.createObjectURL != "function" || typeof ReadableStream > "u")
301
301
  return;
302
- const t = qe(), n = new Blob([t], { type: "application/javascript" }), r = URL.createObjectURL(n), i = new Worker(r);
302
+ const t = Xe(), n = new Blob([t], { type: "application/javascript" }), r = URL.createObjectURL(n), i = new Worker(r);
303
303
  i.onmessage = (c) => {
304
304
  this.handleWorkerMessage(c.data);
305
305
  }, i.onerror = (c) => {
@@ -315,7 +315,7 @@ class Qe {
315
315
  switch (n.type) {
316
316
  case "message":
317
317
  if (n.data && n.streamId) {
318
- const r = ie(n.data);
318
+ const r = se(n.data);
319
319
  this.broadcast(r, n.streamId);
320
320
  }
321
321
  break;
@@ -357,7 +357,7 @@ class Qe {
357
357
  async startWorkerStream(t, n, r, i, c) {
358
358
  const s = this.worker;
359
359
  if (!s) return;
360
- const h = (d) => {
360
+ const u = (d) => {
361
361
  i.signal.aborted || (this.activeConnections.delete(t), this.broadcastError(t, d));
362
362
  };
363
363
  try {
@@ -367,31 +367,31 @@ class Qe {
367
367
  signal: i.signal
368
368
  });
369
369
  if (!d.ok) {
370
- d.status >= 400 && d.status < 500 && d.status !== 429 ? h(`Client error ${d.status}`) : h(`HTTP ${d.status}`);
370
+ d.status >= 400 && d.status < 500 && d.status !== 429 ? u(`Client error ${d.status}`) : u(`HTTP ${d.status}`);
371
371
  return;
372
372
  }
373
- const u = d.body;
374
- if (!u) {
375
- h("No response body");
373
+ const m = d.body;
374
+ if (!m) {
375
+ u("No response body");
376
376
  return;
377
377
  }
378
378
  if (!this.activeConnections.has(t)) {
379
- await u.cancel().catch(() => {
379
+ await m.cancel().catch(() => {
380
380
  });
381
381
  return;
382
382
  }
383
383
  try {
384
384
  s.postMessage(
385
- { command: "start", streamId: t, readableStream: u },
386
- [u]
385
+ { command: "start", streamId: t, readableStream: m },
386
+ [m]
387
387
  );
388
388
  } catch {
389
- this.workerSupported = !1, u.cancel().catch(() => {
389
+ this.workerSupported = !1, m.cancel().catch(() => {
390
390
  }), this.activeConnections.delete(t), this.connectStreamOnMainThread(c);
391
391
  }
392
392
  } catch (d) {
393
393
  if (i.signal.aborted) return;
394
- h(se(d));
394
+ u(le(d));
395
395
  }
396
396
  }
397
397
  connectStreamOnMainThread(t) {
@@ -403,7 +403,7 @@ class Qe {
403
403
  "X-Fency-Publishable-Key": this.fency.publishableKey,
404
404
  "X-Fency-Stream-Token": t.stream.token
405
405
  };
406
- _e(i, {
406
+ Qe(i, {
407
407
  headers: c,
408
408
  signal: r.signal,
409
409
  openWhenHidden: !0,
@@ -413,12 +413,12 @@ class Qe {
413
413
  },
414
414
  onmessage: (s) => {
415
415
  if (s.data) {
416
- const h = ie(s.data);
417
- this.broadcast(h, n);
416
+ const u = se(s.data);
417
+ this.broadcast(u, n);
418
418
  }
419
419
  },
420
420
  onerror: (s) => {
421
- throw console.error("EventSource error for stream", n, ":", s), this.activeConnections.delete(n), this.broadcastError(n, se(s)), s;
421
+ throw console.error("EventSource error for stream", n, ":", s), this.activeConnections.delete(n), this.broadcastError(n, le(s)), s;
422
422
  },
423
423
  onclose() {
424
424
  }
@@ -457,95 +457,95 @@ class Qe {
457
457
  this.workerBlobUrl && (URL.revokeObjectURL(this.workerBlobUrl), this.workerBlobUrl = null), this.workerSupported = !1, this.subscribers.clear();
458
458
  }
459
459
  }
460
- const Ke = 48e4, Ve = 3e5, le = (e) => {
460
+ const Ye = 48e4, Je = 3e5, ce = (e) => {
461
461
  const t = Date.now();
462
- return e.filter((n) => t - n.createdAt < Ke);
462
+ return e.filter((n) => t - n.createdAt < Ye);
463
463
  };
464
- function Gt({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
464
+ function ln({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
465
465
  const [r, i] = I(
466
466
  null
467
- ), [c, s] = I(!0), [h, d] = I(null), [u, l] = I([]), m = D(null), k = D(null);
468
- z(() => {
469
- e.then((b) => {
470
- i(b), s(!1);
471
- }).catch((b) => {
472
- d(b), s(!1);
467
+ ), [c, s] = I(!0), [u, d] = I(null), [m, f] = I([]), l = W(null), h = W(null);
468
+ L(() => {
469
+ e.then((g) => {
470
+ i(g), s(!1);
471
+ }).catch((g) => {
472
+ d(g), s(!1);
473
473
  });
474
- }, [e]), z(() => {
475
- r && !k.current && (k.current = new Qe(r));
476
- }, [r]), z(() => {
477
- k.current && k.current.updateStreams(u);
478
- }, [u]), z(() => () => {
479
- var b;
480
- (b = k.current) == null || b.cleanup();
481
- }, []), z(() => {
482
- const b = setInterval(() => {
483
- l((C) => {
484
- const v = le(C);
485
- return v.length !== C.length ? v : C;
474
+ }, [e]), L(() => {
475
+ r && !h.current && (h.current = new Ve(r));
476
+ }, [r]), L(() => {
477
+ h.current && h.current.updateStreams(m);
478
+ }, [m]), L(() => () => {
479
+ var g;
480
+ (g = h.current) == null || g.cleanup();
481
+ }, []), L(() => {
482
+ const g = setInterval(() => {
483
+ f((T) => {
484
+ const E = ce(T);
485
+ return E.length !== T.length ? E : T;
486
486
  });
487
487
  }, 6e4);
488
- return () => clearInterval(b);
488
+ return () => clearInterval(g);
489
489
  }, []);
490
- const y = O(
491
- async (b = Ve) => {
492
- if (m.current)
493
- return m.current;
494
- const C = Date.now(), v = u.length > 0 ? u[u.length - 1] : null;
495
- if (v && C - v.createdAt < b)
496
- return v.stream;
497
- const x = (async () => {
490
+ const b = N(
491
+ async (g = Je) => {
492
+ if (l.current)
493
+ return l.current;
494
+ const T = Date.now(), E = m.length > 0 ? m[m.length - 1] : null;
495
+ if (E && T - E.createdAt < g)
496
+ return E.stream;
497
+ const D = (async () => {
498
498
  if (!r)
499
499
  throw new Error("Fency instance not initialized");
500
- const E = await t(), R = await Ie({
500
+ const C = await t(), w = await Re({
501
501
  pk: r.publishableKey,
502
502
  baseUrl: r.baseUrl,
503
- clientToken: (E == null ? void 0 : E.clientToken) ?? ""
503
+ clientToken: (C == null ? void 0 : C.clientToken) ?? ""
504
504
  });
505
- if (R.type === "success") {
505
+ if (w.type === "success") {
506
506
  const A = {
507
- stream: R.stream,
507
+ stream: w.stream,
508
508
  createdAt: Date.now()
509
509
  };
510
- return l((w) => {
511
- const P = [...w, A];
512
- return le(P);
513
- }), m.current = null, R.stream;
510
+ return f((B) => {
511
+ const M = [...B, A];
512
+ return ce(M);
513
+ }), l.current = null, w.stream;
514
514
  } else
515
- throw m.current = null, new Error("Failed to create stream");
515
+ throw l.current = null, new Error("Failed to create stream");
516
516
  })();
517
- return m.current = x, x;
517
+ return l.current = D, D;
518
518
  },
519
- [r, u]
519
+ [r, m]
520
520
  );
521
- if (h)
522
- return /* @__PURE__ */ f("div", { children: [
521
+ if (u)
522
+ return /* @__PURE__ */ k("div", { children: [
523
523
  "Fency error: ",
524
- h.message
524
+ u.message
525
525
  ] });
526
526
  if (!r)
527
527
  return null;
528
- const g = u.length > 0 ? u[u.length - 1] : null, p = {
528
+ const y = m.length > 0 ? m[m.length - 1] : null, p = {
529
529
  fency: r,
530
530
  loading: c,
531
- error: h,
532
- activeStreams: u,
533
- latestStream: g,
534
- eventManager: k.current,
535
- getOrCreateStream: y
531
+ error: u,
532
+ activeStreams: m,
533
+ latestStream: y,
534
+ eventManager: h.current,
535
+ getOrCreateStream: b
536
536
  };
537
- return /* @__PURE__ */ o(fe.Provider, { value: p, children: n });
537
+ return /* @__PURE__ */ o(ke.Provider, { value: p, children: n });
538
538
  }
539
- function ke() {
540
- const e = ge(fe);
539
+ function be() {
540
+ const e = ye(ke);
541
541
  if (e === void 0)
542
542
  throw new Error("useFencyContext must be used within a FencyProvider");
543
543
  return e;
544
544
  }
545
- const be = a.object({
545
+ const Se = a.object({
546
546
  role: a.enum(["SYSTEM", "USER", "ASSISTANT"]),
547
547
  content: a.string()
548
- }).passthrough(), G = a.object({
548
+ }).passthrough(), q = a.object({
549
549
  memoryId: a.string(),
550
550
  memoryTitle: a.string(),
551
551
  memoryTypeId: a.string(),
@@ -568,61 +568,61 @@ const be = a.object({
568
568
  ])
569
569
  }).passthrough()
570
570
  )
571
- }).passthrough(), X = a.object({
571
+ }).passthrough(), Y = a.object({
572
572
  memoryId: a.string(),
573
573
  memoryTitle: a.string()
574
- }).passthrough(), Xe = a.object({
574
+ }).passthrough(), Ze = a.object({
575
575
  taskType: a.literal("StreamingChatCompletion"),
576
576
  eventType: a.literal("Text"),
577
577
  text: a.string()
578
- }).passthrough(), Ye = a.object({
578
+ }).passthrough(), er = a.object({
579
579
  taskType: a.literal("StreamingChatCompletion"),
580
580
  eventType: a.literal("Completed"),
581
581
  response: a.object({
582
582
  textResponse: a.string(),
583
- messages: a.array(be)
583
+ messages: a.array(Se)
584
584
  }).passthrough()
585
- }).passthrough(), Je = a.object({
585
+ }).passthrough(), rr = a.object({
586
586
  taskType: a.literal("StreamingChatCompletion"),
587
587
  eventType: a.literal("Error"),
588
588
  message: a.string()
589
- }).passthrough(), Ze = a.object({
589
+ }).passthrough(), tr = a.object({
590
590
  taskType: a.literal("StructuredChatCompletion"),
591
591
  eventType: a.literal("Completed"),
592
592
  response: a.object({
593
593
  jsonResponse: a.string(),
594
- messages: a.array(be)
594
+ messages: a.array(Se)
595
595
  }).passthrough()
596
- }).passthrough(), er = a.object({
596
+ }).passthrough(), nr = a.object({
597
597
  taskType: a.literal("StructuredChatCompletion"),
598
598
  eventType: a.literal("Error"),
599
599
  message: a.string()
600
- }).passthrough(), rr = a.object({
600
+ }).passthrough(), or = a.object({
601
601
  taskType: a.literal("MemoryChat"),
602
602
  eventType: a.literal("Text"),
603
603
  text: a.string()
604
- }).passthrough(), tr = a.object({
604
+ }).passthrough(), ar = a.object({
605
605
  taskType: a.literal("MemoryChat"),
606
606
  eventType: a.literal("Thinking")
607
- }).passthrough(), nr = a.object({
607
+ }).passthrough(), ir = a.object({
608
608
  taskType: a.literal("MemoryChat"),
609
609
  eventType: a.literal("Search"),
610
610
  queryDescription: a.string(),
611
- memories: a.array(X).optional()
612
- }).passthrough(), or = a.object({
611
+ memories: a.array(Y).optional()
612
+ }).passthrough(), sr = a.object({
613
613
  taskType: a.literal("MemoryChat"),
614
614
  eventType: a.literal("FindMemories"),
615
615
  titles: a.array(a.string())
616
- }).passthrough(), ar = a.object({
616
+ }).passthrough(), lr = a.object({
617
617
  taskType: a.literal("MemoryChat"),
618
618
  eventType: a.literal("FindMemoriesResult"),
619
- memories: a.array(X)
620
- }).passthrough(), ir = a.enum([
619
+ memories: a.array(Y)
620
+ }).passthrough(), cr = a.enum([
621
621
  "downloading",
622
622
  "downloaded",
623
623
  "analyzing",
624
624
  "summarizing"
625
- ]), sr = a.object({
625
+ ]), dr = a.object({
626
626
  taskType: a.literal("MemoryChat"),
627
627
  eventType: a.literal("ScrapeWebsites"),
628
628
  input: a.object({
@@ -632,12 +632,12 @@ const be = a.object({
632
632
  results: a.array(
633
633
  a.object({
634
634
  url: a.string(),
635
- status: ir.optional(),
635
+ status: cr.optional(),
636
636
  summary: a.string().optional(),
637
637
  error: a.string().optional()
638
638
  }).passthrough()
639
639
  ).optional()
640
- }).passthrough(), lr = a.object({
640
+ }).passthrough(), ur = a.object({
641
641
  taskType: a.literal("MemoryChat"),
642
642
  eventType: a.literal("GoogleSearch"),
643
643
  input: a.object({
@@ -652,18 +652,18 @@ const be = a.object({
652
652
  description: a.string()
653
653
  }).passthrough()
654
654
  ).optional()
655
- }).passthrough(), cr = a.object({
655
+ }).passthrough(), mr = a.object({
656
656
  taskType: a.literal("MemoryChat"),
657
657
  eventType: a.literal("SearchMemoryChunks"),
658
658
  input: a.object({
659
659
  queryDescription: a.string(),
660
- memories: a.array(X).optional()
660
+ memories: a.array(Y).optional()
661
661
  }).passthrough(),
662
- items: a.array(G).optional()
663
- }).passthrough(), dr = a.object({
662
+ items: a.array(q).optional()
663
+ }).passthrough(), pr = a.object({
664
664
  taskType: a.literal("MemoryChat"),
665
665
  eventType: a.literal("FindSources")
666
- }).passthrough(), ur = a.object({
666
+ }).passthrough(), hr = a.object({
667
667
  taskType: a.literal("MemoryChat"),
668
668
  eventType: a.literal("ExploreMemories"),
669
669
  memories: a.array(
@@ -674,11 +674,11 @@ const be = a.object({
674
674
  error: a.string().optional()
675
675
  }).passthrough()
676
676
  )
677
- }).passthrough(), mr = a.object({
677
+ }).passthrough(), gr = a.object({
678
678
  taskType: a.literal("MemoryChat"),
679
679
  eventType: a.literal("ChunkResults"),
680
- items: a.array(G)
681
- }).passthrough(), hr = a.object({
680
+ items: a.array(q)
681
+ }).passthrough(), yr = a.object({
682
682
  taskType: a.literal("MemoryChat"),
683
683
  eventType: a.literal("SourcesResult"),
684
684
  sources: a.array(
@@ -690,7 +690,7 @@ const be = a.object({
690
690
  pageNumbers: a.array(a.number())
691
691
  }).passthrough()
692
692
  )
693
- }).passthrough(), pr = a.object({
693
+ }).passthrough(), fr = a.object({
694
694
  taskType: a.literal("MemoryChat"),
695
695
  eventType: a.literal("Completed"),
696
696
  response: a.object({
@@ -705,11 +705,35 @@ const be = a.object({
705
705
  }).passthrough()
706
706
  )
707
707
  }).passthrough()
708
- }).passthrough(), gr = a.object({
708
+ }).passthrough(), kr = a.object({
709
+ taskType: a.literal("MemoryChat"),
710
+ eventType: a.literal("GenerateReportSetup"),
711
+ userRequest: a.string()
712
+ }).passthrough(), br = a.object({
713
+ taskType: a.literal("MemoryChat"),
714
+ eventType: a.literal("GenerateReportExporting"),
715
+ fileCount: a.number()
716
+ }).passthrough(), Sr = a.object({
717
+ taskType: a.literal("MemoryChat"),
718
+ eventType: a.literal("GenerateReportRunCode"),
719
+ title: a.string()
720
+ }).passthrough(), xr = a.object({
721
+ taskType: a.literal("MemoryChat"),
722
+ eventType: a.literal("GenerateReportRunCommand"),
723
+ title: a.string()
724
+ }).passthrough(), Tr = a.object({
725
+ taskType: a.literal("MemoryChat"),
726
+ eventType: a.literal("GenerateReportAssembling"),
727
+ reportTitle: a.string()
728
+ }).passthrough(), vr = a.object({
729
+ taskType: a.literal("MemoryChat"),
730
+ eventType: a.literal("GenerateReportCompleted"),
731
+ reportTitle: a.string()
732
+ }).passthrough(), Cr = a.object({
709
733
  taskType: a.literal("MemoryChat"),
710
734
  eventType: a.literal("Error"),
711
735
  message: a.string()
712
- }).passthrough(), yr = a.object({
736
+ }).passthrough(), wr = a.object({
713
737
  taskType: a.literal("MemorySearch"),
714
738
  eventType: a.literal("GeneratingQueries"),
715
739
  memoryTypes: a.array(
@@ -721,7 +745,7 @@ const be = a.object({
721
745
  queries: a.array(a.object({ query: a.string() }).passthrough()).optional()
722
746
  }).passthrough()
723
747
  )
724
- }).passthrough(), fr = a.object({
748
+ }).passthrough(), Er = a.object({
725
749
  taskType: a.literal("MemorySearch"),
726
750
  eventType: a.literal("ExploreQueries"),
727
751
  queries: a.array(
@@ -732,12 +756,12 @@ const be = a.object({
732
756
  result: a.object({
733
757
  numberOfChunks: a.number(),
734
758
  highestChunkScore: a.number(),
735
- items: a.array(G)
759
+ items: a.array(q)
736
760
  }).passthrough().optional(),
737
761
  error: a.string().optional()
738
762
  }).passthrough()
739
763
  )
740
- }).passthrough(), kr = a.object({
764
+ }).passthrough(), Mr = a.object({
741
765
  taskType: a.literal("MemorySearch"),
742
766
  eventType: a.literal("SearchMemoryTypes"),
743
767
  memoryTypes: a.array(
@@ -751,21 +775,18 @@ const be = a.object({
751
775
  error: a.string().optional()
752
776
  }).passthrough()
753
777
  )
754
- }).passthrough(), br = a.object({
778
+ }).passthrough(), Ir = a.object({
755
779
  taskType: a.literal("MemorySearch"),
756
780
  eventType: a.literal("Completed"),
757
781
  response: a.object({
758
782
  query: a.string(),
759
- items: a.array(G)
783
+ items: a.array(q)
760
784
  }).passthrough()
761
- }).passthrough(), Sr = a.object({
785
+ }).passthrough(), Rr = a.object({
762
786
  taskType: a.literal("MemorySearch"),
763
787
  eventType: a.literal("Error"),
764
788
  message: a.string()
765
- }).passthrough(), xr = a.union([
766
- Xe,
767
- Ye,
768
- Je,
789
+ }).passthrough(), Fr = a.union([
769
790
  Ze,
770
791
  er,
771
792
  rr,
@@ -773,45 +794,54 @@ const be = a.object({
773
794
  nr,
774
795
  or,
775
796
  ar,
797
+ ir,
776
798
  sr,
777
799
  lr,
778
- cr,
779
800
  dr,
780
801
  ur,
781
802
  mr,
782
- hr,
783
803
  pr,
804
+ hr,
784
805
  gr,
785
806
  yr,
786
- fr,
787
807
  kr,
788
808
  br,
789
- Sr
809
+ Sr,
810
+ xr,
811
+ Tr,
812
+ vr,
813
+ fr,
814
+ Cr,
815
+ wr,
816
+ Er,
817
+ Mr,
818
+ Ir,
819
+ Rr
790
820
  ]);
791
- function Tr(e) {
792
- const t = xr.safeParse(e);
821
+ function Ar(e) {
822
+ const t = Fr.safeParse(e);
793
823
  return t.success ? t.data : (console.warn(
794
824
  "[fency] Dropping unrecognized or malformed agent task event:",
795
825
  t.error.format(),
796
826
  e
797
827
  ), null);
798
828
  }
799
- const vr = (e) => {
829
+ const Br = (e) => {
800
830
  try {
801
831
  const t = JSON.parse(e);
802
- return wr(t);
832
+ return Dr(t);
803
833
  } catch (t) {
804
834
  return console.error("Error parsing message:", t), null;
805
835
  }
806
- }, wr = (e) => Re(e) ? Cr(e) : Fe(e) ? Mr(e) : Ae(e) ? Er(e) : null, Cr = (e) => ({
836
+ }, Dr = (e) => Fe(e) ? Pr(e) : Ae(e) ? Lr(e) : Be(e) ? zr(e) : null, Pr = (e) => ({
807
837
  type: "STREAM_TIMEOUT",
808
838
  streamId: e.streamId,
809
839
  timestamp: e.timestamp
810
- }), Mr = (e) => ({
840
+ }), Lr = (e) => ({
811
841
  type: "STREAM_NOT_FOUND",
812
842
  streamId: e.streamId,
813
843
  timestamp: e.timestamp
814
- }), Er = (e) => {
844
+ }), zr = (e) => {
815
845
  let t;
816
846
  try {
817
847
  t = JSON.parse(e.data);
@@ -821,7 +851,7 @@ const vr = (e) => {
821
851
  r
822
852
  ), null;
823
853
  }
824
- const n = Tr(t);
854
+ const n = Ar(t);
825
855
  return n === null ? null : {
826
856
  type: "AGENT_TASK_PROGRESS_ITEM_UPDATED",
827
857
  streamId: e.streamId,
@@ -831,34 +861,34 @@ const vr = (e) => {
831
861
  createdAt: e.createdAt,
832
862
  data: n
833
863
  };
834
- }, Ir = (e) => {
835
- const t = ke(), [n, r] = I(null), i = D(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
836
- return z(() => {
864
+ }, Wr = (e) => {
865
+ const t = be(), [n, r] = I(null), i = W(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
866
+ return L(() => {
837
867
  if (!t.eventManager) return;
838
868
  const s = {
839
- onMessage: (d, u) => {
840
- var m, k, y;
841
- const l = vr(d);
842
- if (l)
843
- switch (l.type) {
869
+ onMessage: (d, m) => {
870
+ var l, h, b;
871
+ const f = Br(d);
872
+ if (f)
873
+ switch (f.type) {
844
874
  case "STREAM_TIMEOUT":
845
- (m = e == null ? void 0 : e.onStreamTimeout) == null || m.call(e, l);
875
+ (l = e == null ? void 0 : e.onStreamTimeout) == null || l.call(e, f);
846
876
  break;
847
877
  case "STREAM_NOT_FOUND":
848
- (k = e == null ? void 0 : e.onStreamNotFound) == null || k.call(e, l);
878
+ (h = e == null ? void 0 : e.onStreamNotFound) == null || h.call(e, f);
849
879
  break;
850
880
  case "AGENT_TASK_PROGRESS_ITEM_UPDATED":
851
- (y = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || y.call(e, l);
881
+ (b = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || b.call(e, f);
852
882
  break;
853
883
  }
854
884
  },
855
- onError: (d, u) => {
856
- var l;
857
- (l = e == null ? void 0 : e.onStreamError) == null || l.call(e, {
885
+ onError: (d, m) => {
886
+ var f;
887
+ (f = e == null ? void 0 : e.onStreamError) == null || f.call(e, {
858
888
  streamId: d,
859
889
  error: {
860
890
  code: "UnknownError",
861
- message: u ?? "Unknown error in useStream"
891
+ message: m ?? "Unknown error in useStream"
862
892
  }
863
893
  });
864
894
  }
@@ -887,135 +917,165 @@ const vr = (e) => {
887
917
  },
888
918
  stream: n
889
919
  };
890
- }, qt = (e) => {
891
- const t = ke(), [n, r] = I([]), i = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), s = O(
892
- (l, m) => {
893
- r((k) => {
894
- const y = [], g = k.map((p) => {
895
- var C;
896
- if (p.streamId !== l || !p.loading) return p;
897
- const b = (C = p.confirmedData) == null ? void 0 : C.taskId;
898
- return b && y.push(b), { ...p, loading: !1, error: m };
920
+ };
921
+ function jr(e) {
922
+ var t, n;
923
+ if (e && typeof e == "object") {
924
+ const r = (n = (t = e.body) == null ? void 0 : t.error) == null ? void 0 : n.message;
925
+ if (typeof r == "string")
926
+ return r;
927
+ const i = e.message;
928
+ if (typeof i == "string")
929
+ return i;
930
+ }
931
+ return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown error during agent task creation";
932
+ }
933
+ const cn = (e) => {
934
+ const t = be(), [n, r] = I([]), i = W(/* @__PURE__ */ new Set()), c = W(/* @__PURE__ */ new Map()), s = N(
935
+ (l) => {
936
+ if (l)
937
+ return async (h) => {
938
+ const { clientToken: b } = await l(h), y = await De({
939
+ pk: t.fency.publishableKey,
940
+ baseUrl: t.fency.baseUrl,
941
+ clientToken: b,
942
+ agentTaskFileId: h
943
+ });
944
+ if (y.type === "error")
945
+ throw new Error(y.error.message);
946
+ const p = document.createElement("a");
947
+ p.href = y.downloadLink, p.download = "", p.click();
948
+ };
949
+ },
950
+ [t.fency.baseUrl, t.fency.publishableKey]
951
+ ), u = N(
952
+ (l, h) => {
953
+ r((b) => {
954
+ const y = [], p = b.map((g) => {
955
+ var E;
956
+ if (g.streamId !== l || !g.loading) return g;
957
+ const T = (E = g.confirmedData) == null ? void 0 : E.taskId;
958
+ return T && y.push(T), { ...g, loading: !1, error: h };
899
959
  });
900
- for (const p of y) {
901
- i.current.delete(p);
902
- const b = c.current.get(p);
903
- b && (c.current.delete(p), b({ type: "error", error: m }));
960
+ for (const g of y) {
961
+ i.current.delete(g);
962
+ const T = c.current.get(g);
963
+ T && (c.current.delete(g), T({ type: "error", error: h }));
904
964
  }
905
- return g;
965
+ return p;
906
966
  });
907
967
  },
908
968
  []
909
- ), { createStream: h } = Ir({
969
+ ), { createStream: d } = Wr({
910
970
  onAgentTaskProgressItemUpdated: (l) => {
911
971
  var y;
912
972
  if (!i.current.has(l.agentTaskId)) return;
913
- const m = l.data;
914
- if (m.eventType === "Completed" || m.eventType === "Error") {
915
- const g = m.eventType === "Error", p = m.taskType === "MemorySearch" && m.eventType === "Completed" || m.taskType === "StructuredChatCompletion" && m.eventType === "Completed", b = g ? {
973
+ const h = l.data;
974
+ if (h.eventType === "Completed" || h.eventType === "Error") {
975
+ const p = h.eventType === "Error", g = h.taskType === "MemorySearch" && h.eventType === "Completed" || h.taskType === "StructuredChatCompletion" && h.eventType === "Completed", T = p ? {
916
976
  code: "AgentTaskError",
917
- message: "message" in m && typeof m.message == "string" ? m.message : "Agent task failed"
977
+ message: "message" in h && typeof h.message == "string" ? h.message : "Agent task failed"
918
978
  } : null;
919
979
  r(
920
- p ? (v) => v.map((x) => {
921
- var A;
922
- if (((A = x.confirmedData) == null ? void 0 : A.taskId) !== l.agentTaskId)
923
- return x;
924
- const R = x.progressItems.some(
925
- (w) => w.progressItemId === l.progressItemId
926
- ) ? x.progressItems.map(
927
- (w) => w.progressItemId === l.progressItemId ? l : w
928
- ) : [...x.progressItems, l];
980
+ g ? (D) => D.map((C) => {
981
+ var B;
982
+ if (((B = C.confirmedData) == null ? void 0 : B.taskId) !== l.agentTaskId)
983
+ return C;
984
+ const A = C.progressItems.some(
985
+ (M) => M.progressItemId === l.progressItemId
986
+ ) ? C.progressItems.map(
987
+ (M) => M.progressItemId === l.progressItemId ? l : M
988
+ ) : [...C.progressItems, l];
929
989
  return {
930
- ...x,
931
- progressItems: R,
990
+ ...C,
991
+ progressItems: A,
932
992
  loading: !1,
933
- ...b ? { error: b } : {}
993
+ ...T ? { error: T } : {}
934
994
  };
935
- }) : (v) => v.map(
936
- (x) => {
937
- var E;
938
- return ((E = x.confirmedData) == null ? void 0 : E.taskId) === l.agentTaskId ? {
939
- ...x,
995
+ }) : (D) => D.map(
996
+ (C) => {
997
+ var w;
998
+ return ((w = C.confirmedData) == null ? void 0 : w.taskId) === l.agentTaskId ? {
999
+ ...C,
940
1000
  loading: !1,
941
- ...b ? { error: b } : {}
942
- } : x;
1001
+ ...T ? { error: T } : {}
1002
+ } : C;
943
1003
  }
944
1004
  )
945
1005
  );
946
- const C = c.current.get(
1006
+ const E = c.current.get(
947
1007
  l.agentTaskId
948
1008
  );
949
- C && (c.current.delete(l.agentTaskId), g && b ? C({
1009
+ E && (c.current.delete(l.agentTaskId), p && T ? E({
950
1010
  type: "error",
951
- error: b
952
- }) : m.eventType === "Completed" && C({
1011
+ error: T
1012
+ }) : h.eventType === "Completed" && E({
953
1013
  type: "success",
954
1014
  streamId: l.streamId,
955
1015
  agentTaskId: l.agentTaskId,
956
- response: m
1016
+ response: h
957
1017
  }));
958
1018
  return;
959
1019
  }
960
1020
  (y = e.onAgentTaskProgressItemUpdated) == null || y.call(e, l), r(
961
- (g) => g.map((p) => {
962
- var v;
963
- if (((v = p.confirmedData) == null ? void 0 : v.taskId) !== l.agentTaskId)
964
- return p;
965
- const C = p.progressItems.some(
966
- (x) => x.progressItemId === l.progressItemId
967
- ) ? p.progressItems.map(
968
- (x) => x.progressItemId === l.progressItemId ? l : x
969
- ) : [...p.progressItems, l];
970
- return { ...p, progressItems: C };
1021
+ (p) => p.map((g) => {
1022
+ var D;
1023
+ if (((D = g.confirmedData) == null ? void 0 : D.taskId) !== l.agentTaskId)
1024
+ return g;
1025
+ const E = g.progressItems.some(
1026
+ (C) => C.progressItemId === l.progressItemId
1027
+ ) ? g.progressItems.map(
1028
+ (C) => C.progressItemId === l.progressItemId ? l : C
1029
+ ) : [...g.progressItems, l];
1030
+ return { ...g, progressItems: E };
971
1031
  })
972
1032
  );
973
1033
  },
974
1034
  onStreamError: (l) => {
975
- var m;
976
- (m = e == null ? void 0 : e.onStreamError) == null || m.call(e, l), s(l.streamId, l.error);
1035
+ var h;
1036
+ (h = e == null ? void 0 : e.onStreamError) == null || h.call(e, l), u(l.streamId, l.error);
977
1037
  },
978
1038
  onStreamNotFound: (l) => {
979
- var m;
980
- (m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e, l), s(l.streamId, {
1039
+ var h;
1040
+ (h = e == null ? void 0 : e.onStreamNotFound) == null || h.call(e, l), u(l.streamId, {
981
1041
  code: "StreamNotFound",
982
1042
  message: "Stream not found"
983
1043
  });
984
1044
  },
985
1045
  onStreamTimeout: (l) => {
986
- var m;
987
- (m = e == null ? void 0 : e.onStreamTimeout) == null || m.call(e, l), s(l.streamId, {
1046
+ var h;
1047
+ (h = e == null ? void 0 : e.onStreamTimeout) == null || h.call(e, l), u(l.streamId, {
988
1048
  code: "StreamTimeout",
989
1049
  message: "Stream timed out"
990
1050
  });
991
1051
  }
992
- }), d = O(
993
- async (l, m) => {
994
- var p;
995
- const k = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, y = (m == null ? void 0 : m.fetchCreateAgentTaskClientToken) ?? e.fetchCreateAgentTaskClientToken;
1052
+ }), m = N(
1053
+ async (l, h) => {
1054
+ var T;
1055
+ const b = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, y = (h == null ? void 0 : h.fetchCreateAgentTaskClientToken) ?? e.fetchCreateAgentTaskClientToken;
996
1056
  if (y === void 0)
997
1057
  throw new Error(
998
1058
  "fetchCreateAgentTaskClientToken must be provided either in useAgentTasks props or in createAgentTask options"
999
1059
  );
1000
- const g = await h();
1060
+ const p = (h == null ? void 0 : h.fetchAgentTaskFileDownloadClientToken) ?? e.fetchAgentTaskFileDownloadClientToken, g = await d();
1001
1061
  if (g.type === "success") {
1002
- const b = (/* @__PURE__ */ new Date()).toISOString(), C = {
1003
- taskKey: k,
1062
+ const E = (/* @__PURE__ */ new Date()).toISOString(), D = {
1063
+ taskKey: b,
1004
1064
  streamId: g.stream.id,
1005
- triggeredAt: b,
1065
+ triggeredAt: E,
1006
1066
  confirmedData: null,
1007
1067
  error: null,
1008
1068
  params: l,
1009
1069
  progressItems: [],
1010
1070
  loading: !0,
1011
- loadingText: m == null ? void 0 : m.loadingText
1071
+ loadingText: h == null ? void 0 : h.loadingText
1012
1072
  };
1013
- r((v) => [...v, C]), (p = m == null ? void 0 : m.onTaskRegistered) == null || p.call(m, C);
1073
+ r((C) => [...C, D]), (T = h == null ? void 0 : h.onTaskRegistered) == null || T.call(h, D);
1014
1074
  try {
1015
- const { clientToken: v } = await y(), x = await Be({
1075
+ const { clientToken: C } = await y(), w = await Pe({
1016
1076
  pk: t.fency.publishableKey,
1017
1077
  baseUrl: t.fency.baseUrl,
1018
- clientToken: v,
1078
+ clientToken: C,
1019
1079
  streamToken: g.stream.token,
1020
1080
  request: {
1021
1081
  streamingChatCompletionTask: l.type === "StreamingChatCompletion" ? {
@@ -1054,97 +1114,100 @@ const vr = (e) => {
1054
1114
  } : void 0
1055
1115
  }
1056
1116
  });
1057
- if (x.type === "success" && x.agentTask)
1117
+ if (w.type === "success" && w.agentTask)
1058
1118
  return i.current.add(
1059
- x.agentTask.id
1060
- ), r((E) => [
1061
- ...E.filter((R) => R.taskKey !== k),
1119
+ w.agentTask.id
1120
+ ), r((A) => [
1121
+ ...A.filter((B) => B.taskKey !== b),
1062
1122
  {
1063
- taskKey: k,
1123
+ taskKey: b,
1064
1124
  streamId: g.stream.id,
1065
1125
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
1066
- taskId: x.agentTask.id,
1067
- createdAt: x.agentTask.createdAt,
1126
+ taskId: w.agentTask.id,
1127
+ createdAt: w.agentTask.createdAt,
1068
1128
  error: null,
1069
1129
  params: l,
1070
1130
  progressItems: [],
1071
1131
  loading: !0,
1072
- loadingText: m == null ? void 0 : m.loadingText,
1132
+ loadingText: h == null ? void 0 : h.loadingText,
1073
1133
  confirmedData: {
1074
- taskId: x.agentTask.id,
1075
- createdAt: x.agentTask.createdAt
1076
- }
1134
+ taskId: w.agentTask.id,
1135
+ createdAt: w.agentTask.createdAt
1136
+ },
1137
+ downloadFile: s(
1138
+ p
1139
+ )
1077
1140
  }
1078
1141
  ]), await new Promise(
1079
- (E) => {
1142
+ (A) => {
1080
1143
  c.current.set(
1081
- x.agentTask.id,
1082
- E
1144
+ w.agentTask.id,
1145
+ A
1083
1146
  );
1084
1147
  }
1085
1148
  );
1086
- if (x.type === "error")
1087
- return r((E) => [
1088
- ...E.filter((R) => R.taskKey !== k),
1149
+ if (w.type === "error")
1150
+ return r((A) => [
1151
+ ...A.filter((B) => B.taskKey !== b),
1089
1152
  {
1090
- taskKey: k,
1153
+ taskKey: b,
1091
1154
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
1092
1155
  streamId: g.stream.id,
1093
1156
  params: l,
1094
- error: x.error,
1157
+ error: w.error,
1095
1158
  progressItems: [],
1096
1159
  loading: !1,
1097
- loadingText: m == null ? void 0 : m.loadingText,
1160
+ loadingText: h == null ? void 0 : h.loadingText,
1098
1161
  confirmedData: null
1099
1162
  }
1100
1163
  ]), {
1101
1164
  type: "error",
1102
- error: x.error
1165
+ error: w.error
1103
1166
  };
1104
1167
  {
1105
- const E = {
1168
+ const A = {
1106
1169
  message: "No response received",
1107
1170
  code: "UnknownError"
1108
1171
  };
1109
- return r((R) => [
1110
- ...R.filter((A) => A.taskKey !== k),
1172
+ return r((B) => [
1173
+ ...B.filter((M) => M.taskKey !== b),
1111
1174
  {
1112
- taskKey: k,
1175
+ taskKey: b,
1113
1176
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
1114
1177
  streamId: g.stream.id,
1115
- error: E,
1178
+ error: A,
1116
1179
  params: l,
1117
1180
  progressItems: [],
1118
1181
  loading: !1,
1119
- loadingText: m == null ? void 0 : m.loadingText,
1182
+ loadingText: h == null ? void 0 : h.loadingText,
1120
1183
  confirmedData: null
1121
1184
  }
1122
1185
  ]), {
1123
1186
  type: "error",
1124
- error: E
1187
+ error: A
1125
1188
  };
1126
1189
  }
1127
- } catch (v) {
1128
- const x = {
1190
+ } catch (C) {
1191
+ const w = {
1129
1192
  code: "UnknownError",
1130
- message: v instanceof Error ? v.message : "Unknown error during agent task creation"
1193
+ message: jr(C)
1131
1194
  };
1132
- return r((E) => [
1133
- ...E.filter((R) => R.taskKey !== k),
1195
+ return r((A) => [
1196
+ ...A.filter((B) => B.taskKey !== b),
1134
1197
  {
1135
- taskKey: k,
1198
+ taskKey: b,
1136
1199
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
1137
1200
  streamId: g.stream.id,
1138
1201
  params: l,
1139
- error: x,
1202
+ error: w,
1140
1203
  progressItems: [],
1141
1204
  loading: !1,
1142
- loadingText: m == null ? void 0 : m.loadingText,
1205
+ loadingText: h == null ? void 0 : h.loadingText,
1143
1206
  confirmedData: null
1144
1207
  }
1145
1208
  ]), {
1146
1209
  type: "error",
1147
- error: x
1210
+ error: w
1148
1211
  };
1149
1212
  }
1150
1213
  } else
@@ -1152,29 +1215,31 @@ const vr = (e) => {
1152
1215
  },
1153
1216
  [
1154
1217
  t,
1155
- h,
1218
+ s,
1219
+ d,
1156
1220
  e.fetchCreateAgentTaskClientToken,
1157
- s
1221
+ e.fetchAgentTaskFileDownloadClientToken,
1222
+ u
1158
1223
  ]
1159
- ), u = W(() => {
1224
+ ), f = z(() => {
1160
1225
  if (n.length !== 0)
1161
- return [...n].sort((l, m) => new Date(m.triggeredAt).getTime() - new Date(l.triggeredAt).getTime())[0];
1226
+ return [...n].sort((l, h) => new Date(h.triggeredAt).getTime() - new Date(l.triggeredAt).getTime())[0];
1162
1227
  }, [n]);
1163
- return z(() => () => {
1228
+ return L(() => () => {
1164
1229
  i.current.clear(), c.current.clear();
1165
1230
  }, []), {
1166
1231
  agentTasks: n,
1167
- createAgentTask: d,
1168
- latest: u
1232
+ createAgentTask: m,
1233
+ latest: f
1169
1234
  };
1170
1235
  };
1171
- function Rr(e) {
1236
+ function Nr(e) {
1172
1237
  return e.progressItems.map((t, n) => {
1173
1238
  const r = e.progressItems[n + 1], i = r != null;
1174
1239
  let c;
1175
1240
  if (r != null && r.createdAt) {
1176
- const s = new Date(t.createdAt).getTime(), h = new Date(r.createdAt).getTime();
1177
- c = Math.round((h - s) / 1e3);
1241
+ const s = new Date(t.createdAt).getTime(), u = new Date(r.createdAt).getTime();
1242
+ c = Math.round((u - s) / 1e3);
1178
1243
  }
1179
1244
  return {
1180
1245
  item: t,
@@ -1184,7 +1249,7 @@ function Rr(e) {
1184
1249
  };
1185
1250
  });
1186
1251
  }
1187
- const Fr = {
1252
+ const Or = {
1188
1253
  'code[class*="language-"]': {
1189
1254
  color: "#f8f8f2",
1190
1255
  background: "none",
@@ -1335,7 +1400,7 @@ const Fr = {
1335
1400
  italic: {
1336
1401
  fontStyle: "italic"
1337
1402
  }
1338
- }, Ar = {
1403
+ }, $r = {
1339
1404
  'code[class*="language-"]': {
1340
1405
  background: "hsl(230, 1%, 98%)",
1341
1406
  color: "hsl(230, 8%, 24%)",
@@ -1823,7 +1888,7 @@ const Fr = {
1823
1888
  ".prism-previewer-easing.prism-previewer-easing line": {
1824
1889
  stroke: "hsl(230, 8%, 24%)"
1825
1890
  }
1826
- }, Se = {
1891
+ }, xe = {
1827
1892
  textPrimary: "#1f2937",
1828
1893
  textSecondary: "#666",
1829
1894
  textMuted: "#94a3b8",
@@ -1847,7 +1912,7 @@ const Fr = {
1847
1912
  sourcesBadgeBg: "#f5f5f5",
1848
1913
  transparent: "transparent",
1849
1914
  reasoningLine: "#444"
1850
- }, Br = {
1915
+ }, Gr = {
1851
1916
  textPrimary: "#f0f6fc",
1852
1917
  textSecondary: "#9198a1",
1853
1918
  textMuted: "#8b949e",
@@ -1871,69 +1936,131 @@ const Fr = {
1871
1936
  sourcesBadgeBg: "#21262d",
1872
1937
  transparent: "transparent",
1873
1938
  reasoningLine: "#a1a8b0"
1874
- }, xe = pe({
1939
+ }, Te = ge({
1875
1940
  theme: "light",
1876
- colors: Se
1941
+ colors: xe
1877
1942
  });
1878
- function Pr({
1943
+ function Hr({
1879
1944
  theme: e,
1880
1945
  children: t
1881
1946
  }) {
1882
- const n = W(
1947
+ const n = z(
1883
1948
  () => ({
1884
1949
  theme: e,
1885
- colors: e === "dark" ? Br : Se
1950
+ colors: e === "dark" ? Gr : xe
1886
1951
  }),
1887
1952
  [e]
1888
1953
  );
1889
- return /* @__PURE__ */ o(xe.Provider, { value: n, children: t });
1954
+ return /* @__PURE__ */ o(Te.Provider, { value: n, children: t });
1890
1955
  }
1891
- function T() {
1892
- return ge(xe);
1956
+ function x() {
1957
+ return ye(Te);
1893
1958
  }
1894
- function Te(e) {
1895
- return e === "dark" ? Fr : Ar;
1959
+ function ve(e) {
1960
+ return e === "dark" ? Or : $r;
1896
1961
  }
1897
- const ce = ({
1898
- text: e
1962
+ const de = ({
1963
+ text: e,
1964
+ onFileDownload: t
1899
1965
  }) => {
1900
- const { theme: t } = T(), n = Te(t);
1901
- return /* @__PURE__ */ o("div", { style: { paddingBlock: "16px" }, children: /* @__PURE__ */ o(
1902
- M.div,
1903
- {
1904
- className: "fency-markdown-body-raw",
1905
- initial: { opacity: 0, y: -10 },
1906
- animate: { opacity: 1, y: 0 },
1907
- transition: { duration: 0.3, delay: 0 },
1908
- children: /* @__PURE__ */ o(
1909
- Le,
1966
+ const { theme: n } = x(), r = ve(n), [i, c] = I(
1967
+ null
1968
+ ), [s, u] = I(!1), d = N(
1969
+ (f) => {
1970
+ t && (c(null), u(!0), (async () => {
1971
+ try {
1972
+ await t(f);
1973
+ } catch (l) {
1974
+ c(
1975
+ l instanceof Error ? l.message : "Download failed"
1976
+ );
1977
+ } finally {
1978
+ u(!1);
1979
+ }
1980
+ })());
1981
+ },
1982
+ [t]
1983
+ ), m = z(() => ({
1984
+ code(f) {
1985
+ const { children: l, className: h, node: b, ref: y, ...p } = f, g = /language-(\w+)/.exec(h || "");
1986
+ return g ? /* @__PURE__ */ o(
1987
+ fe,
1910
1988
  {
1911
- remarkPlugins: [We],
1912
- components: {
1913
- code(r) {
1914
- const { children: i, className: c, node: s, ref: h, ...d } = r, u = /language-(\w+)/.exec(c || "");
1915
- return u ? (
1916
- // @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
1917
- /* @__PURE__ */ o(
1918
- ye,
1919
- {
1920
- ...d,
1921
- PreTag: "div",
1922
- children: String(i).replace(/\n$/, ""),
1923
- language: u[1],
1924
- style: n
1925
- }
1926
- )
1927
- ) : /* @__PURE__ */ o("code", { ...d, className: c, children: String(i) });
1928
- }
1989
+ ...p,
1990
+ PreTag: "div",
1991
+ children: String(l).replace(/\n$/, ""),
1992
+ language: g[1],
1993
+ style: r
1994
+ }
1995
+ ) : /* @__PURE__ */ o("code", { ...p, className: h, children: String(l) });
1996
+ },
1997
+ a(f) {
1998
+ const { children: l, href: h, ...b } = f, y = h ? Le(h) : null;
1999
+ return y != null ? t ? /* @__PURE__ */ o("span", { className: "fency-file-download-wrap", children: /* @__PURE__ */ o(
2000
+ "button",
2001
+ {
2002
+ type: "button",
2003
+ className: "fency-file-download-button",
2004
+ disabled: s,
2005
+ onClick: () => d(y),
2006
+ children: l
2007
+ }
2008
+ ) }) : /* @__PURE__ */ o("span", { className: "fency-file-download-wrap", children: /* @__PURE__ */ o(
2009
+ "button",
2010
+ {
2011
+ type: "button",
2012
+ className: "fency-file-download-button",
2013
+ disabled: s,
2014
+ onClick: () => {
2015
+ console.error(
2016
+ "[fency] File download link clicked but no onFileDownload handler is configured. Pass fetchAgentTaskFileDownloadClientToken to useAgentTasks."
2017
+ ), c(
2018
+ "File download is not configured. Please provide fetchAgentTaskFileDownloadClientToken."
2019
+ );
1929
2020
  },
1930
- children: e
2021
+ children: l
1931
2022
  }
1932
- )
2023
+ ) }) : /* @__PURE__ */ o(
2024
+ "a",
2025
+ {
2026
+ href: h,
2027
+ target: "_blank",
2028
+ rel: "noopener noreferrer",
2029
+ ...b,
2030
+ children: l
2031
+ }
2032
+ );
1933
2033
  }
1934
- ) });
1935
- }, zr = ({ data: e }) => {
1936
- const { theme: t } = T(), n = Te(t), r = e.response.jsonResponse;
2034
+ }), [s, d, t, r]);
2035
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
2036
+ i ? /* @__PURE__ */ o(
2037
+ "p",
2038
+ {
2039
+ role: "alert",
2040
+ style: { color: "#b91c1c", marginBottom: 8, fontSize: 14 },
2041
+ children: i
2042
+ }
2043
+ ) : null,
2044
+ /* @__PURE__ */ o(
2045
+ v.div,
2046
+ {
2047
+ className: "fency-markdown-body-raw",
2048
+ initial: { opacity: 0, y: -10 },
2049
+ animate: { opacity: 1, y: 0 },
2050
+ transition: { duration: 0.3, delay: 0 },
2051
+ children: /* @__PURE__ */ o(
2052
+ Ne,
2053
+ {
2054
+ remarkPlugins: [Oe],
2055
+ components: m,
2056
+ children: e
2057
+ }
2058
+ )
2059
+ }
2060
+ )
2061
+ ] });
2062
+ }, Ur = ({ data: e }) => {
2063
+ const { theme: t } = x(), n = ve(t), r = e.response.jsonResponse;
1937
2064
  let i;
1938
2065
  try {
1939
2066
  i = JSON.stringify(JSON.parse(r), null, 2);
@@ -1943,15 +2070,15 @@ const ce = ({
1943
2070
  ), i = r;
1944
2071
  }
1945
2072
  return /* @__PURE__ */ o("div", { id: "structured-chat-completion-response", children: /* @__PURE__ */ o(
1946
- M.div,
2073
+ v.div,
1947
2074
  {
1948
2075
  initial: { opacity: 0, y: -10 },
1949
2076
  animate: { opacity: 1, y: 0 },
1950
2077
  transition: { duration: 0.3, delay: 0 },
1951
- children: /* @__PURE__ */ o(ye, { language: "json", style: n, PreTag: "div", children: i })
2078
+ children: /* @__PURE__ */ o(fe, { language: "json", style: n, PreTag: "div", children: i })
1952
2079
  }
1953
2080
  ) });
1954
- }, Dr = {
2081
+ }, _r = {
1955
2082
  en: {
1956
2083
  error: "Error",
1957
2084
  streaming: "Streaming...",
@@ -2027,7 +2154,14 @@ const ce = ({
2027
2154
  scrapeStatusDownloading: "Downloading…",
2028
2155
  scrapeStatusDownloaded: "Downloaded",
2029
2156
  scrapeStatusAnalyzing: "Analyzing document…",
2030
- scrapeStatusSummarizing: "Summarizing…"
2157
+ scrapeStatusSummarizing: "Summarizing…",
2158
+ generateReportSetup: "Setting up report...",
2159
+ generateReportExporting: "Exporting {n} files...",
2160
+ generateReportExportingOne: "Exporting 1 file...",
2161
+ generateReportRunCode: "Running code: {title}",
2162
+ generateReportRunCommand: "Running command: {title}",
2163
+ generateReportAssembling: "Assembling report '{title}'...",
2164
+ generateReportCompleted: "Report '{title}' completed"
2031
2165
  },
2032
2166
  no: {
2033
2167
  error: "Feil",
@@ -2104,11 +2238,18 @@ const ce = ({
2104
2238
  scrapeStatusDownloading: "Laster ned…",
2105
2239
  scrapeStatusDownloaded: "Nedlastet",
2106
2240
  scrapeStatusAnalyzing: "Analyserer dokumentet…",
2107
- scrapeStatusSummarizing: "Oppsummerer…"
2241
+ scrapeStatusSummarizing: "Oppsummerer…",
2242
+ generateReportSetup: "Forbereder rapport...",
2243
+ generateReportExporting: "Eksporterer {n} filer...",
2244
+ generateReportExportingOne: "Eksporterer 1 fil...",
2245
+ generateReportRunCode: "Kjører kode: {title}",
2246
+ generateReportRunCommand: "Kjører kommando: {title}",
2247
+ generateReportAssembling: "Setter sammen rapport '{title}'...",
2248
+ generateReportCompleted: "Rapport '{title}' fullført"
2108
2249
  }
2109
2250
  };
2110
- function Lr(e) {
2111
- return Dr[e];
2251
+ function qr(e) {
2252
+ return _r[e];
2112
2253
  }
2113
2254
  function S(e, t) {
2114
2255
  return Object.entries(t).reduce(
@@ -2116,7 +2257,7 @@ function S(e, t) {
2116
2257
  e
2117
2258
  );
2118
2259
  }
2119
- function Y(e, t) {
2260
+ function J(e, t) {
2120
2261
  const n = e.map((r) => `'${r}'`);
2121
2262
  if (t != null && n.length >= 2) {
2122
2263
  const r = n.pop();
@@ -2124,7 +2265,7 @@ function Y(e, t) {
2124
2265
  }
2125
2266
  return n.join(", ");
2126
2267
  }
2127
- function F({
2268
+ function R({
2128
2269
  text: e,
2129
2270
  duration: t = 2,
2130
2271
  delay: n = 0,
@@ -2132,18 +2273,18 @@ function F({
2132
2273
  repeatDelay: i = 0.5,
2133
2274
  className: c,
2134
2275
  startOnView: s = !1,
2135
- once: h = !1,
2276
+ once: u = !1,
2136
2277
  inViewMargin: d,
2137
- spread: u = 2,
2138
- color: l,
2139
- shimmerColor: m,
2140
- direction: k = "fromBottom"
2278
+ spread: m = 2,
2279
+ color: f,
2280
+ shimmerColor: l,
2281
+ direction: h = "fromBottom"
2141
2282
  }) {
2142
- const { colors: y } = T(), g = l ?? y.shimmerBase, p = m ?? y.shimmerHighlight, b = D(null), C = ze(b, { once: h, margin: d }), v = W(() => e.length * u, [e, u]), x = !s || C, E = k === "fromBottom" ? "100% center" : "-100% center", R = k === "fromBottom" ? "0% center" : "200% center";
2283
+ const { colors: b } = x(), y = f ?? b.shimmerBase, p = l ?? b.shimmerHighlight, g = W(null), T = We(g, { once: u, margin: d }), E = z(() => e.length * m, [e, m]), D = !s || T, C = h === "fromBottom" ? "100% center" : "-100% center", w = h === "fromBottom" ? "0% center" : "200% center";
2143
2284
  return /* @__PURE__ */ o(
2144
- M.span,
2285
+ v.span,
2145
2286
  {
2146
- ref: b,
2287
+ ref: g,
2147
2288
  className: c,
2148
2289
  style: {
2149
2290
  position: "relative",
@@ -2154,18 +2295,18 @@ function F({
2154
2295
  color: "transparent",
2155
2296
  WebkitTextFillColor: "transparent",
2156
2297
  backgroundRepeat: "no-repeat, padding-box",
2157
- "--spread": `${v}px`,
2158
- "--base-color": g,
2298
+ "--spread": `${E}px`,
2299
+ "--base-color": y,
2159
2300
  "--shimmer-color": p,
2160
2301
  "--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
2161
2302
  backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
2162
2303
  },
2163
2304
  initial: {
2164
- backgroundPosition: E,
2305
+ backgroundPosition: C,
2165
2306
  opacity: 0
2166
2307
  },
2167
- animate: x ? {
2168
- backgroundPosition: R,
2308
+ animate: D ? {
2309
+ backgroundPosition: w,
2169
2310
  opacity: 1
2170
2311
  } : {},
2171
2312
  transition: {
@@ -2185,40 +2326,40 @@ function F({
2185
2326
  }
2186
2327
  );
2187
2328
  }
2188
- const q = 5, V = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r, compactBelow: i = !1 }) => {
2189
- const { colors: c } = T(), [s, h] = I(!1), u = (e.memories ?? []).map((v) => v.memoryTitle), l = u.length > 0, m = l && u.length > q, k = m && !s ? u.slice(0, q) : u, y = u.length - q, g = !m || s, p = `${r.searchingFor}'${e.queryDescription}'`, b = l ? `${r.searchingIn}${Y(
2190
- k,
2191
- g ? r.and : void 0
2192
- )}` : "", C = l ? `${p}${b}` : `${r.searchingPrefix}${e.queryDescription}`;
2193
- return /* @__PURE__ */ f(
2329
+ const Q = 5, V = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r, compactBelow: i = !1 }) => {
2330
+ const { colors: c } = x(), [s, u] = I(!1), m = (e.memories ?? []).map((E) => E.memoryTitle), f = m.length > 0, l = f && m.length > Q, h = l && !s ? m.slice(0, Q) : m, b = m.length - Q, y = !l || s, p = `${r.searchingFor}'${e.queryDescription}'`, g = f ? `${r.searchingIn}${J(
2331
+ h,
2332
+ y ? r.and : void 0
2333
+ )}` : "", T = f ? `${p}${g}` : `${r.searchingPrefix}${e.queryDescription}`;
2334
+ return /* @__PURE__ */ k(
2194
2335
  "div",
2195
2336
  {
2196
2337
  style: i ? { paddingTop: "16px", paddingBottom: "2px" } : { paddingBlock: "16px" },
2197
2338
  children: [
2198
2339
  /* @__PURE__ */ o(
2199
- M.div,
2340
+ v.div,
2200
2341
  {
2201
2342
  style: { color: c.textSecondary },
2202
2343
  initial: { opacity: 0, y: -10 },
2203
2344
  animate: { opacity: 1, y: 0 },
2204
2345
  transition: { duration: 0.3, delay: 0 },
2205
- children: t && !n && !m ? /* @__PURE__ */ o(F, { text: C, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ f(B, { children: [
2206
- /* @__PURE__ */ o("span", { style: { color: c.textSecondary }, children: l ? /* @__PURE__ */ f(B, { children: [
2346
+ children: t && !n && !l ? /* @__PURE__ */ o(R, { text: T, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ k(P, { children: [
2347
+ /* @__PURE__ */ o("span", { style: { color: c.textSecondary }, children: f ? /* @__PURE__ */ k(P, { children: [
2207
2348
  r.searchingFor,
2208
- /* @__PURE__ */ f("span", { style: { fontWeight: 600 }, children: [
2349
+ /* @__PURE__ */ k("span", { style: { fontWeight: 600 }, children: [
2209
2350
  "'",
2210
2351
  e.queryDescription,
2211
2352
  "'"
2212
2353
  ] }),
2213
- b
2354
+ g
2214
2355
  ] }) : `${r.searchingPrefix}${e.queryDescription}` }),
2215
- m && !s && /* @__PURE__ */ f(B, { children: [
2356
+ l && !s && /* @__PURE__ */ k(P, { children: [
2216
2357
  " ",
2217
2358
  /* @__PURE__ */ o(
2218
2359
  "button",
2219
2360
  {
2220
2361
  type: "button",
2221
- onClick: () => h(!0),
2362
+ onClick: () => u(!0),
2222
2363
  style: {
2223
2364
  background: "none",
2224
2365
  border: "none",
@@ -2231,18 +2372,18 @@ const q = 5, V = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r, compact
2231
2372
  fontFamily: "inherit"
2232
2373
  },
2233
2374
  children: S(r.moreMemories, {
2234
- n: y
2375
+ n: b
2235
2376
  })
2236
2377
  }
2237
2378
  )
2238
2379
  ] }),
2239
- m && s && /* @__PURE__ */ f(B, { children: [
2380
+ l && s && /* @__PURE__ */ k(P, { children: [
2240
2381
  " ",
2241
2382
  /* @__PURE__ */ o(
2242
2383
  "button",
2243
2384
  {
2244
2385
  type: "button",
2245
- onClick: () => h(!1),
2386
+ onClick: () => u(!1),
2246
2387
  style: {
2247
2388
  background: "none",
2248
2389
  border: "none",
@@ -2276,12 +2417,12 @@ const q = 5, V = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r, compact
2276
2417
  ]
2277
2418
  }
2278
2419
  );
2279
- }, L = ({
2420
+ }, j = ({
2280
2421
  color: e,
2281
2422
  size: t = 24,
2282
2423
  borderWidth: n = 7
2283
2424
  }) => {
2284
- const { colors: r } = T(), i = e ?? r.checkmarkColor, c = t * 0.5;
2425
+ const { colors: r } = x(), i = e ?? r.checkmarkColor, c = t * 0.5;
2285
2426
  return /* @__PURE__ */ o(
2286
2427
  "span",
2287
2428
  {
@@ -2296,16 +2437,16 @@ const q = 5, V = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r, compact
2296
2437
  }
2297
2438
  );
2298
2439
  };
2299
- function Wr(e, t) {
2440
+ function Qr(e, t) {
2300
2441
  const n = Math.min(e.length, t.length);
2301
2442
  for (let r = n; r >= 0; r--)
2302
2443
  if (e.slice(-r) === t.slice(0, r)) return r;
2303
2444
  return 0;
2304
2445
  }
2305
- const Nr = `
2446
+ const Kr = `
2306
2447
 
2307
2448
  `;
2308
- function J(e) {
2449
+ function Z(e) {
2309
2450
  var n, r;
2310
2451
  if (e.length === 0) return "";
2311
2452
  let t = ((n = e[0]) == null ? void 0 : n.content) ?? "";
@@ -2316,12 +2457,12 @@ function J(e) {
2316
2457
  t = c;
2317
2458
  continue;
2318
2459
  }
2319
- const s = Wr(t, c);
2320
- s === 0 ? t += Nr + c : t += c.slice(s);
2460
+ const s = Qr(t, c);
2461
+ s === 0 ? t += Kr + c : t += c.slice(s);
2321
2462
  }
2322
2463
  return t;
2323
2464
  }
2324
- function Z(e, t) {
2465
+ function ee(e, t) {
2325
2466
  if (e.length === 0) return "";
2326
2467
  if (e.length === 1)
2327
2468
  return S(t.memorySearchPagesSingle, {
@@ -2338,30 +2479,30 @@ function Z(e, t) {
2338
2479
  n
2339
2480
  });
2340
2481
  }
2341
- function ee(e) {
2482
+ function re(e) {
2342
2483
  const t = /* @__PURE__ */ new Set();
2343
2484
  for (const n of e)
2344
2485
  for (const r of n.pageNumbers) t.add(r);
2345
2486
  return [...t].sort((n, r) => n - r);
2346
2487
  }
2347
- function re(e) {
2488
+ function te(e) {
2348
2489
  const t = e.memoryTypeName.trim();
2349
2490
  if (t !== "") return t;
2350
2491
  if (e.memoryTypeId !== "") return e.memoryTypeId;
2351
2492
  }
2352
- function ve(e) {
2493
+ function Ce(e) {
2353
2494
  return e.chunks.filter((t) => t.relation === "MATCH").length;
2354
2495
  }
2355
- function Or(e, t) {
2496
+ function Xr(e, t) {
2356
2497
  let n = 0, r = 0;
2357
2498
  for (const s of e)
2358
- n += ve(s), s.matchingChunkScore > r && (r = s.matchingChunkScore);
2499
+ n += Ce(s), s.matchingChunkScore > r && (r = s.matchingChunkScore);
2359
2500
  const i = n === 1 ? t.chunkFound : S(t.chunksFound, { n }), c = S(t.scoreLabel, {
2360
2501
  n: r.toFixed(2)
2361
2502
  });
2362
2503
  return `${i} - ${c}`;
2363
2504
  }
2364
- function jr(e) {
2505
+ function Vr(e) {
2365
2506
  const t = [], n = /* @__PURE__ */ new Map();
2366
2507
  return e.forEach((r, i) => {
2367
2508
  let c = n.get(r.memoryId);
@@ -2377,12 +2518,12 @@ function jr(e) {
2377
2518
  c.items.push({ item: r, flatIndex: i });
2378
2519
  }), t.map((r) => n.get(r));
2379
2520
  }
2380
- function $r({
2521
+ function Yr({
2381
2522
  items: e,
2382
2523
  onSearchResultClick: t,
2383
2524
  t: n
2384
2525
  }) {
2385
- const { colors: r } = T(), [i, c] = I(null), s = !!t;
2526
+ const { colors: r } = x(), [i, c] = I(null), s = !!t;
2386
2527
  return /* @__PURE__ */ o(
2387
2528
  "div",
2388
2529
  {
@@ -2394,25 +2535,25 @@ function $r({
2394
2535
  paddingTop: 8,
2395
2536
  borderTop: `1px solid ${r.borderDivider}`
2396
2537
  },
2397
- children: e.map((h, d) => {
2398
- const u = ee(
2399
- h.chunks
2400
- ), l = [
2401
- re(h),
2538
+ children: e.map((u, d) => {
2539
+ const m = re(
2540
+ u.chunks
2541
+ ), f = [
2542
+ te(u),
2402
2543
  S(n.scoreLabel, {
2403
- n: h.matchingChunkScore.toFixed(2)
2544
+ n: u.matchingChunkScore.toFixed(2)
2404
2545
  }),
2405
- u.length > 0 ? Z(u, n) : n.pagesNotAvailable
2546
+ m.length > 0 ? ee(m, n) : n.pagesNotAvailable
2406
2547
  ].filter(
2407
- (g) => g != null && g !== ""
2408
- ), m = {
2409
- memoryId: h.memoryId,
2410
- memoryTitle: h.memoryTitle,
2411
- memoryTypeId: h.memoryTypeId,
2412
- memoryTypeName: h.memoryTypeName,
2413
- pageNumbers: u
2414
- }, k = `${h.memoryId}-${d}`, y = i === k;
2415
- return /* @__PURE__ */ f(
2548
+ (y) => y != null && y !== ""
2549
+ ), l = {
2550
+ memoryId: u.memoryId,
2551
+ memoryTitle: u.memoryTitle,
2552
+ memoryTypeId: u.memoryTypeId,
2553
+ memoryTypeName: u.memoryTypeName,
2554
+ pageNumbers: m
2555
+ }, h = `${u.memoryId}-${d}`, b = i === h;
2556
+ return /* @__PURE__ */ k(
2416
2557
  "div",
2417
2558
  {
2418
2559
  style: {
@@ -2426,7 +2567,7 @@ function $r({
2426
2567
  minWidth: 0
2427
2568
  },
2428
2569
  children: [
2429
- /* @__PURE__ */ f(
2570
+ /* @__PURE__ */ k(
2430
2571
  "div",
2431
2572
  {
2432
2573
  style: {
@@ -2447,7 +2588,7 @@ function $r({
2447
2588
  whiteSpace: "pre-wrap",
2448
2589
  wordBreak: "break-word"
2449
2590
  },
2450
- children: J(h.chunks)
2591
+ children: Z(u.chunks)
2451
2592
  }
2452
2593
  ),
2453
2594
  /* @__PURE__ */ o(
@@ -2459,23 +2600,23 @@ function $r({
2459
2600
  color: r.textMuted,
2460
2601
  lineHeight: 1.35
2461
2602
  },
2462
- children: l.join(" · ")
2603
+ children: f.join(" · ")
2463
2604
  }
2464
2605
  )
2465
2606
  ]
2466
2607
  }
2467
2608
  ),
2468
- s && /* @__PURE__ */ f(
2609
+ s && /* @__PURE__ */ k(
2469
2610
  "button",
2470
2611
  {
2471
2612
  type: "button",
2472
- "aria-busy": y,
2473
- disabled: y,
2613
+ "aria-busy": b,
2614
+ disabled: b,
2474
2615
  onClick: async () => {
2475
- c(k);
2616
+ c(h);
2476
2617
  try {
2477
2618
  await t(
2478
- m
2619
+ l
2479
2620
  );
2480
2621
  } finally {
2481
2622
  c(null);
@@ -2491,14 +2632,14 @@ function $r({
2491
2632
  background: r.bgChip,
2492
2633
  border: `1px solid ${r.bgChipBorder}`,
2493
2634
  borderRadius: 6,
2494
- cursor: y ? "wait" : "pointer",
2635
+ cursor: b ? "wait" : "pointer",
2495
2636
  fontFamily: "inherit",
2496
2637
  display: "inline-flex",
2497
2638
  alignItems: "center",
2498
2639
  gap: 8
2499
2640
  },
2500
2641
  children: [
2501
- y && /* @__PURE__ */ o(
2642
+ b && /* @__PURE__ */ o(
2502
2643
  "span",
2503
2644
  {
2504
2645
  className: "explore-memory-loader explore-memory-loader--callback",
@@ -2511,22 +2652,22 @@ function $r({
2511
2652
  )
2512
2653
  ]
2513
2654
  },
2514
- k
2655
+ h
2515
2656
  );
2516
2657
  })
2517
2658
  }
2518
2659
  );
2519
2660
  }
2520
- function Hr({
2661
+ function Jr({
2521
2662
  group: e,
2522
2663
  t,
2523
2664
  expanded: n,
2524
2665
  onToggle: r,
2525
2666
  onSearchResultClick: i
2526
2667
  }) {
2527
- const { colors: c } = T(), s = e.items.map((d) => d.item), h = s.some((d) => d.chunks.length > 0);
2528
- return /* @__PURE__ */ f(
2529
- M.div,
2668
+ const { colors: c } = x(), s = e.items.map((d) => d.item), u = s.some((d) => d.chunks.length > 0);
2669
+ return /* @__PURE__ */ k(
2670
+ v.div,
2530
2671
  {
2531
2672
  initial: { opacity: 0 },
2532
2673
  animate: { opacity: 1 },
@@ -2553,10 +2694,10 @@ function Hr({
2553
2694
  width: 32,
2554
2695
  paddingTop: 2
2555
2696
  },
2556
- children: /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 })
2697
+ children: /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 })
2557
2698
  }
2558
2699
  ),
2559
- /* @__PURE__ */ f(
2700
+ /* @__PURE__ */ k(
2560
2701
  "div",
2561
2702
  {
2562
2703
  style: {
@@ -2579,7 +2720,7 @@ function Hr({
2579
2720
  children: e.memoryTitle
2580
2721
  }
2581
2722
  ),
2582
- /* @__PURE__ */ f(
2723
+ /* @__PURE__ */ k(
2583
2724
  "div",
2584
2725
  {
2585
2726
  style: {
@@ -2599,10 +2740,10 @@ function Hr({
2599
2740
  color: c.textSecondary,
2600
2741
  whiteSpace: "nowrap"
2601
2742
  },
2602
- children: Or(s, t)
2743
+ children: Xr(s, t)
2603
2744
  }
2604
2745
  ),
2605
- h && /* @__PURE__ */ o(
2746
+ u && /* @__PURE__ */ o(
2606
2747
  "button",
2607
2748
  {
2608
2749
  type: "button",
@@ -2623,8 +2764,8 @@ function Hr({
2623
2764
  ]
2624
2765
  }
2625
2766
  ),
2626
- n && h && /* @__PURE__ */ o(
2627
- $r,
2767
+ n && u && /* @__PURE__ */ o(
2768
+ Yr,
2628
2769
  {
2629
2770
  items: s,
2630
2771
  onSearchResultClick: i,
@@ -2638,7 +2779,7 @@ function Hr({
2638
2779
  }
2639
2780
  );
2640
2781
  }
2641
- function Ur(e, t) {
2782
+ function Zr(e, t) {
2642
2783
  return e === 1 ? t.chunkFound : S(t.chunksFound, { n: e });
2643
2784
  }
2644
2785
  const we = ({
@@ -2647,18 +2788,18 @@ const we = ({
2647
2788
  t: n,
2648
2789
  compactTop: r = !1
2649
2790
  }) => {
2650
- const { colors: i } = T(), c = e.items, s = c.reduce(
2651
- (p, b) => p + ve(b),
2791
+ const { colors: i } = x(), c = e.items, s = c.reduce(
2792
+ (p, g) => p + Ce(g),
2652
2793
  0
2653
- ), h = new Set(c.map((p) => p.memoryId)).size, [d, u] = I({}), l = O((p) => {
2654
- u((b) => ({
2655
- ...b,
2656
- [p]: !b[p]
2794
+ ), u = new Set(c.map((p) => p.memoryId)).size, [d, m] = I({}), f = N((p) => {
2795
+ m((g) => ({
2796
+ ...g,
2797
+ [p]: !g[p]
2657
2798
  }));
2658
- }, []), m = W(() => jr(c), [c]), k = h === 1 ? n.memoryChatChunkResultsInOneMemory : S(n.memoryChatChunkResultsInMemories, {
2659
- n: h
2660
- }), y = `${Ur(s, n)} ${k}`, g = r ? { paddingBottom: "10px" } : { paddingBlock: "10px" };
2661
- return c.length === 0 ? /* @__PURE__ */ o("div", { style: g, children: /* @__PURE__ */ o(
2799
+ }, []), l = z(() => Vr(c), [c]), h = u === 1 ? n.memoryChatChunkResultsInOneMemory : S(n.memoryChatChunkResultsInMemories, {
2800
+ n: u
2801
+ }), b = `${Zr(s, n)} ${h}`, y = r ? { paddingBottom: "10px" } : { paddingBlock: "10px" };
2802
+ return c.length === 0 ? /* @__PURE__ */ o("div", { style: y, children: /* @__PURE__ */ o(
2662
2803
  "div",
2663
2804
  {
2664
2805
  style: {
@@ -2668,14 +2809,14 @@ const we = ({
2668
2809
  },
2669
2810
  children: n.memorySearchExploreNoResults
2670
2811
  }
2671
- ) }) : /* @__PURE__ */ f("div", { style: g, children: [
2672
- m.map((p) => /* @__PURE__ */ o(
2673
- Hr,
2812
+ ) }) : /* @__PURE__ */ k("div", { style: y, children: [
2813
+ l.map((p) => /* @__PURE__ */ o(
2814
+ Jr,
2674
2815
  {
2675
2816
  group: p,
2676
2817
  t: n,
2677
2818
  expanded: d[p.memoryId] === !0,
2678
- onToggle: () => l(p.memoryId),
2819
+ onToggle: () => f(p.memoryId),
2679
2820
  onSearchResultClick: t
2680
2821
  },
2681
2822
  p.memoryId
@@ -2689,12 +2830,12 @@ const we = ({
2689
2830
  marginTop: "4px",
2690
2831
  fontStyle: "italic"
2691
2832
  },
2692
- children: y
2833
+ children: b
2693
2834
  }
2694
2835
  )
2695
2836
  ] });
2696
2837
  };
2697
- function _r(e) {
2838
+ function et(e) {
2698
2839
  return {
2699
2840
  taskType: "MemoryChat",
2700
2841
  eventType: "Search",
@@ -2702,14 +2843,14 @@ function _r(e) {
2702
2843
  ...e.input.memories !== void 0 && e.input.memories.length > 0 ? { memories: e.input.memories } : {}
2703
2844
  };
2704
2845
  }
2705
- const Gr = ({
2846
+ const rt = ({
2706
2847
  data: e,
2707
2848
  isLatest: t = !1,
2708
2849
  durationSeconds: n,
2709
2850
  t: r,
2710
2851
  onSearchResultClick: i
2711
2852
  }) => {
2712
- const c = _r(e);
2853
+ const c = et(e);
2713
2854
  return e.items === void 0 ? /* @__PURE__ */ o(
2714
2855
  V,
2715
2856
  {
@@ -2718,7 +2859,7 @@ const Gr = ({
2718
2859
  durationSeconds: n,
2719
2860
  t: r
2720
2861
  }
2721
- ) : /* @__PURE__ */ f(B, { children: [
2862
+ ) : /* @__PURE__ */ k(P, { children: [
2722
2863
  /* @__PURE__ */ o(
2723
2864
  V,
2724
2865
  {
@@ -2743,14 +2884,14 @@ const Gr = ({
2743
2884
  }
2744
2885
  )
2745
2886
  ] });
2746
- }, Q = 5, qr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
2747
- const { colors: i } = T(), [c, s] = I(!1), h = e.titles, d = h.length > 0, u = d && h.length > Q, l = u && !c ? h.slice(0, Q) : h, m = h.length - Q, k = !u || c, y = d ? `${r.findingMemoriesIn}${Y(
2748
- l,
2749
- k ? r.and : void 0
2887
+ }, K = 5, tt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
2888
+ const { colors: i } = x(), [c, s] = I(!1), u = e.titles, d = u.length > 0, m = d && u.length > K, f = m && !c ? u.slice(0, K) : u, l = u.length - K, h = !m || c, b = d ? `${r.findingMemoriesIn}${J(
2889
+ f,
2890
+ h ? r.and : void 0
2750
2891
  )}` : r.findingMemories;
2751
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
2892
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
2752
2893
  /* @__PURE__ */ o(
2753
- M.div,
2894
+ v.div,
2754
2895
  {
2755
2896
  style: {
2756
2897
  color: i.textSecondary
@@ -2758,9 +2899,9 @@ const Gr = ({
2758
2899
  initial: { opacity: 0, y: -10 },
2759
2900
  animate: { opacity: 1, y: 0 },
2760
2901
  transition: { duration: 0.3, delay: 0 },
2761
- children: t && !n && !u ? /* @__PURE__ */ o(F, { text: y, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ f(B, { children: [
2762
- /* @__PURE__ */ o("span", { style: { color: i.textSecondary }, children: y }),
2763
- u && !c && /* @__PURE__ */ f(B, { children: [
2902
+ children: t && !n && !m ? /* @__PURE__ */ o(R, { text: b, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ k(P, { children: [
2903
+ /* @__PURE__ */ o("span", { style: { color: i.textSecondary }, children: b }),
2904
+ m && !c && /* @__PURE__ */ k(P, { children: [
2764
2905
  " ",
2765
2906
  /* @__PURE__ */ o(
2766
2907
  "button",
@@ -2779,12 +2920,12 @@ const Gr = ({
2779
2920
  fontFamily: "inherit"
2780
2921
  },
2781
2922
  children: S(r.moreMemories, {
2782
- n: m
2923
+ n: l
2783
2924
  })
2784
2925
  }
2785
2926
  )
2786
2927
  ] }),
2787
- u && c && /* @__PURE__ */ f(B, { children: [
2928
+ m && c && /* @__PURE__ */ k(P, { children: [
2788
2929
  " ",
2789
2930
  /* @__PURE__ */ o(
2790
2931
  "button",
@@ -2822,21 +2963,21 @@ const Gr = ({
2822
2963
  }
2823
2964
  )
2824
2965
  ] });
2825
- }, K = 5, Qr = ({ data: e, t }) => {
2826
- const { colors: n } = T(), [r, i] = I(!1), s = e.memories.map((g) => g.memoryTitle), h = s.length > 0, d = h && s.length > K, u = d && !r ? s.slice(0, K) : s, l = s.length - K, m = !d || r, k = s.length === 1 ? t.memoryFound : t.memoriesFoundPrefix, y = h ? `${k}${Y(
2827
- u,
2828
- m ? t.and : void 0
2966
+ }, X = 5, nt = ({ data: e, t }) => {
2967
+ const { colors: n } = x(), [r, i] = I(!1), s = e.memories.map((y) => y.memoryTitle), u = s.length > 0, d = u && s.length > X, m = d && !r ? s.slice(0, X) : s, f = s.length - X, l = !d || r, h = s.length === 1 ? t.memoryFound : t.memoriesFoundPrefix, b = u ? `${h}${J(
2968
+ m,
2969
+ l ? t.and : void 0
2829
2970
  )}` : t.memoriesFound;
2830
2971
  return /* @__PURE__ */ o("div", { style: { paddingBlock: "16px" }, children: /* @__PURE__ */ o(
2831
- M.div,
2972
+ v.div,
2832
2973
  {
2833
2974
  style: { color: n.textSecondary },
2834
2975
  initial: { opacity: 0, y: -10 },
2835
2976
  animate: { opacity: 1, y: 0 },
2836
2977
  transition: { duration: 0.3, delay: 0 },
2837
- children: /* @__PURE__ */ f(B, { children: [
2838
- /* @__PURE__ */ o("span", { style: { color: n.textSecondary }, children: y }),
2839
- d && !r && /* @__PURE__ */ f(B, { children: [
2978
+ children: /* @__PURE__ */ k(P, { children: [
2979
+ /* @__PURE__ */ o("span", { style: { color: n.textSecondary }, children: b }),
2980
+ d && !r && /* @__PURE__ */ k(P, { children: [
2840
2981
  " ",
2841
2982
  /* @__PURE__ */ o(
2842
2983
  "button",
@@ -2855,12 +2996,12 @@ const Gr = ({
2855
2996
  fontFamily: "inherit"
2856
2997
  },
2857
2998
  children: S(t.moreMemories, {
2858
- n: l
2999
+ n: f
2859
3000
  })
2860
3001
  }
2861
3002
  )
2862
3003
  ] }),
2863
- d && r && /* @__PURE__ */ f(B, { children: [
3004
+ d && r && /* @__PURE__ */ k(P, { children: [
2864
3005
  " ",
2865
3006
  /* @__PURE__ */ o(
2866
3007
  "button",
@@ -2885,11 +3026,11 @@ const Gr = ({
2885
3026
  ] })
2886
3027
  }
2887
3028
  ) });
2888
- }, Kr = ({ isLatest: e = !1, durationSeconds: t, t: n }) => {
2889
- const { colors: r } = T(), i = n.addingSources;
2890
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
3029
+ }, ot = ({ isLatest: e = !1, durationSeconds: t, t: n }) => {
3030
+ const { colors: r } = x(), i = n.addingSources;
3031
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
2891
3032
  /* @__PURE__ */ o(
2892
- M.div,
3033
+ v.div,
2893
3034
  {
2894
3035
  style: {
2895
3036
  display: "flex",
@@ -2900,7 +3041,7 @@ const Gr = ({
2900
3041
  initial: { opacity: 0, y: -10 },
2901
3042
  animate: { opacity: 1, y: 0 },
2902
3043
  transition: { duration: 0.3, delay: 0 },
2903
- children: e && !t ? /* @__PURE__ */ o(F, { text: i, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: r.textSecondary }, children: i })
3044
+ children: e && !t ? /* @__PURE__ */ o(R, { text: i, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: r.textSecondary }, children: i })
2904
3045
  }
2905
3046
  ),
2906
3047
  t !== void 0 && /* @__PURE__ */ o(
@@ -2917,7 +3058,7 @@ const Gr = ({
2917
3058
  )
2918
3059
  ] });
2919
3060
  };
2920
- function Vr(e, t) {
3061
+ function at(e, t) {
2921
3062
  if (e.length === 0) return "";
2922
3063
  if (e.length === 1)
2923
3064
  return S(t.pageSingle, { n: e[0] });
@@ -2929,11 +3070,11 @@ function Vr(e, t) {
2929
3070
  const n = e[e.length - 1], r = e.slice(0, -1).join(", ");
2930
3071
  return S(t.pageMultiple, { list: r, n });
2931
3072
  }
2932
- const Xr = ({ data: e, onSourceClick: t, t: n }) => {
2933
- const { colors: r } = T(), [i, c] = I(null);
2934
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
3073
+ const it = ({ data: e, onSourceClick: t, t: n }) => {
3074
+ const { colors: r } = x(), [i, c] = I(null);
3075
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
2935
3076
  /* @__PURE__ */ o(
2936
- M.div,
3077
+ v.div,
2937
3078
  {
2938
3079
  style: {
2939
3080
  marginBottom: "10px",
@@ -2949,11 +3090,11 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
2949
3090
  children: n.sources
2950
3091
  }
2951
3092
  ),
2952
- /* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: r.textTertiary }, children: n.noSources }) : e.sources.map((s, h) => /* @__PURE__ */ o(
2953
- Yr,
3093
+ /* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: r.textTertiary }, children: n.noSources }) : e.sources.map((s, u) => /* @__PURE__ */ o(
3094
+ st,
2954
3095
  {
2955
3096
  source: s,
2956
- index: h,
3097
+ index: u,
2957
3098
  loadingMemoryId: i,
2958
3099
  setLoadingMemoryId: c,
2959
3100
  onSourceClick: t,
@@ -2962,7 +3103,7 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
2962
3103
  s.memoryId
2963
3104
  )) })
2964
3105
  ] });
2965
- }, Yr = ({
3106
+ }, st = ({
2966
3107
  source: e,
2967
3108
  index: t,
2968
3109
  loadingMemoryId: n,
@@ -2970,15 +3111,15 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
2970
3111
  onSourceClick: i,
2971
3112
  t: c
2972
3113
  }) => {
2973
- const { colors: s } = T(), [h, d] = I(!1), u = !!i, l = n === e.memoryId, m = e.pageNumbers ?? [], k = Vr(m, c);
2974
- return /* @__PURE__ */ f(
2975
- M.div,
3114
+ const { colors: s } = x(), [u, d] = I(!1), m = !!i, f = n === e.memoryId, l = e.pageNumbers ?? [], h = at(l, c);
3115
+ return /* @__PURE__ */ k(
3116
+ v.div,
2976
3117
  {
2977
- "aria-busy": l,
3118
+ "aria-busy": f,
2978
3119
  initial: { opacity: 0, scale: 0.9 },
2979
3120
  animate: { opacity: 1, scale: 1 },
2980
3121
  transition: { duration: 0.25, delay: t * 0.05 },
2981
- onClick: u && !l ? async () => {
3122
+ onClick: m && !f ? async () => {
2982
3123
  r(e.memoryId);
2983
3124
  try {
2984
3125
  await i({
@@ -2986,14 +3127,14 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
2986
3127
  memoryTitle: e.memoryTitle,
2987
3128
  memoryTypeId: e.memoryTypeId,
2988
3129
  memoryTypeName: e.memoryTypeName,
2989
- pageNumbers: [...m]
3130
+ pageNumbers: [...l]
2990
3131
  });
2991
3132
  } finally {
2992
3133
  r(null);
2993
3134
  }
2994
3135
  } : void 0,
2995
- onMouseEnter: u && !l ? () => d(!0) : void 0,
2996
- onMouseLeave: u && !l ? () => d(!1) : void 0,
3136
+ onMouseEnter: m && !f ? () => d(!0) : void 0,
3137
+ onMouseLeave: m && !f ? () => d(!1) : void 0,
2997
3138
  style: {
2998
3139
  display: "inline-flex",
2999
3140
  flexDirection: "column",
@@ -3001,14 +3142,14 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
3001
3142
  padding: "8px 12px",
3002
3143
  borderRadius: "6px",
3003
3144
  border: `1px solid ${s.borderStrong}`,
3004
- backgroundColor: h ? s.sourcesBadgeBg : s.transparent,
3005
- cursor: u && !l ? "pointer" : l ? "wait" : "default",
3145
+ backgroundColor: u ? s.sourcesBadgeBg : s.transparent,
3146
+ cursor: m && !f ? "pointer" : f ? "wait" : "default",
3006
3147
  transition: "background-color 0.15s ease",
3007
3148
  userSelect: "none",
3008
- pointerEvents: l ? "none" : void 0
3149
+ pointerEvents: f ? "none" : void 0
3009
3150
  },
3010
3151
  children: [
3011
- /* @__PURE__ */ f(
3152
+ /* @__PURE__ */ k(
3012
3153
  "span",
3013
3154
  {
3014
3155
  style: {
@@ -3020,7 +3161,7 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
3020
3161
  gap: 8
3021
3162
  },
3022
3163
  children: [
3023
- l && /* @__PURE__ */ o(
3164
+ f && /* @__PURE__ */ o(
3024
3165
  "span",
3025
3166
  {
3026
3167
  className: "explore-memory-loader explore-memory-loader--callback",
@@ -3031,24 +3172,24 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
3031
3172
  ]
3032
3173
  }
3033
3174
  ),
3034
- k && /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: s.textSecondary }, children: k })
3175
+ h && /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: s.textSecondary }, children: h })
3035
3176
  ]
3036
3177
  }
3037
3178
  );
3038
- }, $ = ({
3179
+ }, G = ({
3039
3180
  color: e,
3040
3181
  size: t = 32,
3041
3182
  lineWidth: n = 2
3042
3183
  }) => {
3043
- const { colors: r } = T(), i = e ?? r.xmarkColor, c = t + 1, s = (t - n) / 2, h = (t - c) / 2, d = {
3184
+ const { colors: r } = x(), i = e ?? r.xmarkColor, c = t + 1, s = (t - n) / 2, u = (t - c) / 2, d = {
3044
3185
  position: "absolute",
3045
3186
  left: s,
3046
- top: h,
3187
+ top: u,
3047
3188
  width: n,
3048
3189
  height: c,
3049
3190
  backgroundColor: i
3050
3191
  };
3051
- return /* @__PURE__ */ f(
3192
+ return /* @__PURE__ */ k(
3052
3193
  "span",
3053
3194
  {
3054
3195
  style: {
@@ -3080,26 +3221,26 @@ const Xr = ({ data: e, onSourceClick: t, t: n }) => {
3080
3221
  }
3081
3222
  );
3082
3223
  };
3083
- function Jr({
3224
+ function lt({
3084
3225
  memory: e,
3085
3226
  completed: t
3086
3227
  }) {
3087
- return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 }) : t ? /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
3228
+ return e.error != null ? /* @__PURE__ */ o(G, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 }) : t ? /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
3088
3229
  }
3089
- const de = 80;
3090
- function Zr({
3230
+ const ue = 80;
3231
+ function ct({
3091
3232
  memory: e,
3092
3233
  completed: t,
3093
3234
  t: n
3094
3235
  }) {
3095
- const { colors: r } = T(), [i, c] = I(!1), s = e.result ?? e.error, h = s != null && s.length > de, d = s != null ? i || !h ? s : `${s.slice(0, de)}...` : void 0, u = h, l = e.error != null;
3096
- return /* @__PURE__ */ f(
3097
- M.div,
3236
+ const { colors: r } = x(), [i, c] = I(!1), s = e.result ?? e.error, u = s != null && s.length > ue, d = s != null ? i || !u ? s : `${s.slice(0, ue)}...` : void 0, m = u, f = e.error != null;
3237
+ return /* @__PURE__ */ k(
3238
+ v.div,
3098
3239
  {
3099
3240
  initial: { opacity: 0 },
3100
3241
  animate: { opacity: 1 },
3101
3242
  transition: { duration: 0.25 },
3102
- onClick: u ? () => c((m) => !m) : void 0,
3243
+ onClick: m ? () => c((l) => !l) : void 0,
3103
3244
  style: {
3104
3245
  paddingTop: "12px",
3105
3246
  paddingBottom: "12px",
@@ -3109,7 +3250,7 @@ function Zr({
3109
3250
  alignItems: "center",
3110
3251
  gap: "10px",
3111
3252
  minWidth: 0,
3112
- cursor: u ? "pointer" : "default"
3253
+ cursor: m ? "pointer" : "default"
3113
3254
  },
3114
3255
  children: [
3115
3256
  /* @__PURE__ */ o(
@@ -3122,10 +3263,10 @@ function Zr({
3122
3263
  flexShrink: 0,
3123
3264
  width: 32
3124
3265
  },
3125
- children: /* @__PURE__ */ o(Jr, { memory: e, completed: t })
3266
+ children: /* @__PURE__ */ o(lt, { memory: e, completed: t })
3126
3267
  }
3127
3268
  ),
3128
- /* @__PURE__ */ f(
3269
+ /* @__PURE__ */ k(
3129
3270
  "div",
3130
3271
  {
3131
3272
  style: {
@@ -3147,14 +3288,14 @@ function Zr({
3147
3288
  {
3148
3289
  style: {
3149
3290
  fontSize: 12,
3150
- color: l ? r.textError : r.textSecondary,
3291
+ color: f ? r.textError : r.textSecondary,
3151
3292
  lineHeight: 1.4,
3152
3293
  whiteSpace: i ? "pre-wrap" : void 0
3153
3294
  },
3154
3295
  children: d
3155
3296
  }
3156
3297
  ),
3157
- u && /* @__PURE__ */ o(
3298
+ m && /* @__PURE__ */ o(
3158
3299
  "span",
3159
3300
  {
3160
3301
  style: {
@@ -3172,28 +3313,28 @@ function Zr({
3172
3313
  }
3173
3314
  );
3174
3315
  }
3175
- const et = ({ data: e, completed: t, t: n }) => /* @__PURE__ */ o("div", { style: { paddingTop: "0px", paddingBottom: "10px" }, children: e.memories.map((r) => /* @__PURE__ */ o(
3176
- Zr,
3316
+ const dt = ({ data: e, completed: t, t: n }) => /* @__PURE__ */ o("div", { style: { paddingTop: "0px", paddingBottom: "10px" }, children: e.memories.map((r) => /* @__PURE__ */ o(
3317
+ ct,
3177
3318
  {
3178
3319
  memory: r,
3179
3320
  completed: t,
3180
3321
  t: n
3181
3322
  },
3182
3323
  r.memoryId
3183
- )) }), ue = 80;
3184
- function rt(e) {
3324
+ )) }), me = 80;
3325
+ function ut(e) {
3185
3326
  try {
3186
3327
  return new URL(e).hostname;
3187
3328
  } catch {
3188
3329
  return e;
3189
3330
  }
3190
3331
  }
3191
- function tt({
3332
+ function mt({
3192
3333
  item: e,
3193
3334
  t
3194
3335
  }) {
3195
- const { colors: n } = T(), [r, i] = I(!1), c = e.description ?? "", s = c.length > ue, h = c.length === 0 ? void 0 : r || !s ? c : `${c.slice(0, ue)}...`;
3196
- return /* @__PURE__ */ f(
3336
+ const { colors: n } = x(), [r, i] = I(!1), c = e.description ?? "", s = c.length > me, u = c.length === 0 ? void 0 : r || !s ? c : `${c.slice(0, me)}...`;
3337
+ return /* @__PURE__ */ k(
3197
3338
  "div",
3198
3339
  {
3199
3340
  style: {
@@ -3225,7 +3366,7 @@ function tt({
3225
3366
  children: e.title
3226
3367
  }
3227
3368
  ),
3228
- /* @__PURE__ */ f(
3369
+ /* @__PURE__ */ k(
3229
3370
  "span",
3230
3371
  {
3231
3372
  style: {
@@ -3236,11 +3377,11 @@ function tt({
3236
3377
  children: [
3237
3378
  e.rank,
3238
3379
  ". ",
3239
- rt(e.link)
3380
+ ut(e.link)
3240
3381
  ]
3241
3382
  }
3242
3383
  ),
3243
- h != null && /* @__PURE__ */ f(B, { children: [
3384
+ u != null && /* @__PURE__ */ k(P, { children: [
3244
3385
  /* @__PURE__ */ o(
3245
3386
  "span",
3246
3387
  {
@@ -3253,7 +3394,7 @@ function tt({
3253
3394
  wordBreak: "break-word",
3254
3395
  cursor: s ? "pointer" : "default"
3255
3396
  },
3256
- children: h
3397
+ children: u
3257
3398
  }
3258
3399
  ),
3259
3400
  s && /* @__PURE__ */ o(
@@ -3272,7 +3413,7 @@ function tt({
3272
3413
  }
3273
3414
  );
3274
3415
  }
3275
- function Ce(e, t) {
3416
+ function Ee(e, t) {
3276
3417
  const n = e.input.countryCode, r = e.input.query;
3277
3418
  return n != null && n !== "" ? S(t.googleSearchingForWithCountry, {
3278
3419
  query: r,
@@ -3281,22 +3422,22 @@ function Ce(e, t) {
3281
3422
  query: r
3282
3423
  });
3283
3424
  }
3284
- function nt({
3425
+ function pt({
3285
3426
  data: e,
3286
3427
  isLatest: t,
3287
3428
  durationSeconds: n,
3288
3429
  t: r
3289
3430
  }) {
3290
- const { colors: i } = T(), c = Ce(e, r);
3291
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
3431
+ const { colors: i } = x(), c = Ee(e, r);
3432
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
3292
3433
  /* @__PURE__ */ o(
3293
- M.div,
3434
+ v.div,
3294
3435
  {
3295
3436
  style: { color: i.textSecondary },
3296
3437
  initial: { opacity: 0, y: -10 },
3297
3438
  animate: { opacity: 1, y: 0 },
3298
3439
  transition: { duration: 0.3, delay: 0 },
3299
- children: t && !n ? /* @__PURE__ */ o(F, { text: c, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: i.textSecondary }, children: c })
3440
+ children: t && !n ? /* @__PURE__ */ o(R, { text: c, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: i.textSecondary }, children: c })
3300
3441
  }
3301
3442
  ),
3302
3443
  n !== void 0 && /* @__PURE__ */ o(
@@ -3313,12 +3454,12 @@ function nt({
3313
3454
  )
3314
3455
  ] });
3315
3456
  }
3316
- function ot({
3457
+ function ht({
3317
3458
  data: e,
3318
3459
  t
3319
3460
  }) {
3320
- const { colors: n } = T(), [r, i] = I(!1), c = W(() => [...e.results ?? []].sort((l, m) => l.rank - m.rank), [e.results]), s = c.length, h = s === 1 ? t.googleResultFound : S(t.googleResultsFound, { n: s }), d = Ce(e, t);
3321
- return s === 0 ? /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
3461
+ const { colors: n } = x(), [r, i] = I(!1), c = z(() => [...e.results ?? []].sort((f, l) => f.rank - l.rank), [e.results]), s = c.length, u = s === 1 ? t.googleResultFound : S(t.googleResultsFound, { n: s }), d = Ee(e, t);
3462
+ return s === 0 ? /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
3322
3463
  /* @__PURE__ */ o("span", { style: { color: n.textSecondary }, children: d }),
3323
3464
  /* @__PURE__ */ o(
3324
3465
  "div",
@@ -3331,10 +3472,10 @@ function ot({
3331
3472
  children: t.memorySearchExploreNoResults
3332
3473
  }
3333
3474
  )
3334
- ] }) : /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
3475
+ ] }) : /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
3335
3476
  /* @__PURE__ */ o("span", { style: { color: n.textSecondary }, children: d }),
3336
- /* @__PURE__ */ f(
3337
- M.div,
3477
+ /* @__PURE__ */ k(
3478
+ v.div,
3338
3479
  {
3339
3480
  initial: { opacity: 0 },
3340
3481
  animate: { opacity: 1 },
@@ -3357,14 +3498,14 @@ function ot({
3357
3498
  color: n.textSecondary,
3358
3499
  whiteSpace: "nowrap"
3359
3500
  },
3360
- children: h
3501
+ children: u
3361
3502
  }
3362
3503
  ),
3363
3504
  /* @__PURE__ */ o(
3364
3505
  "button",
3365
3506
  {
3366
3507
  type: "button",
3367
- onClick: () => i((u) => !u),
3508
+ onClick: () => i((m) => !m),
3368
3509
  style: {
3369
3510
  border: "none",
3370
3511
  background: "none",
@@ -3392,37 +3533,37 @@ function ot({
3392
3533
  paddingTop: 8,
3393
3534
  borderTop: `1px solid ${n.borderDivider}`
3394
3535
  },
3395
- children: c.map((u, l) => /* @__PURE__ */ o(
3536
+ children: c.map((m, f) => /* @__PURE__ */ o(
3396
3537
  "div",
3397
3538
  {
3398
3539
  style: {
3399
- paddingTop: l > 0 ? 12 : 0,
3400
- paddingBottom: l < c.length - 1 ? 12 : 0,
3401
- borderBottom: l < c.length - 1 ? `1px solid ${n.border}` : void 0,
3540
+ paddingTop: f > 0 ? 12 : 0,
3541
+ paddingBottom: f < c.length - 1 ? 12 : 0,
3542
+ borderBottom: f < c.length - 1 ? `1px solid ${n.border}` : void 0,
3402
3543
  minWidth: 0
3403
3544
  },
3404
- children: /* @__PURE__ */ o(tt, { item: u, t })
3545
+ children: /* @__PURE__ */ o(mt, { item: m, t })
3405
3546
  },
3406
- `${u.link}-${u.rank}-${l}`
3547
+ `${m.link}-${m.rank}-${f}`
3407
3548
  ))
3408
3549
  }
3409
3550
  )
3410
3551
  ] });
3411
3552
  }
3412
- const at = ({
3553
+ const gt = ({
3413
3554
  data: e,
3414
3555
  isLatest: t = !1,
3415
3556
  durationSeconds: n,
3416
3557
  t: r
3417
3558
  }) => e.results === void 0 ? /* @__PURE__ */ o(
3418
- nt,
3559
+ pt,
3419
3560
  {
3420
3561
  data: e,
3421
3562
  isLatest: t,
3422
3563
  durationSeconds: n,
3423
3564
  t: r
3424
3565
  }
3425
- ) : /* @__PURE__ */ o(ot, { data: e, t: r });
3566
+ ) : /* @__PURE__ */ o(ht, { data: e, t: r });
3426
3567
  function Me(e, t) {
3427
3568
  if (e.error != null)
3428
3569
  return null;
@@ -3439,16 +3580,16 @@ function Me(e, t) {
3439
3580
  return null;
3440
3581
  }
3441
3582
  }
3442
- function it(e) {
3583
+ function yt(e) {
3443
3584
  var t;
3444
3585
  return e.error != null ? !0 : e.status != null ? !1 : (((t = e.summary) == null ? void 0 : t.length) ?? 0) > 0;
3445
3586
  }
3446
- const me = 80, te = 12, ne = 1.4, st = Math.ceil(
3447
- te * ne
3448
- ), lt = Math.ceil(
3449
- 5 * te * ne
3587
+ const pe = 80, ne = 12, oe = 1.4, ft = Math.ceil(
3588
+ ne * oe
3589
+ ), kt = Math.ceil(
3590
+ 5 * ne * oe
3450
3591
  );
3451
- function Ee(e, t = 48) {
3592
+ function Ie(e, t = 48) {
3452
3593
  try {
3453
3594
  const n = new URL(e), r = n.pathname.length > t ? `${n.pathname.slice(0, t)}…` : n.pathname, i = r === "/" ? "" : r;
3454
3595
  return `${n.hostname}${i}${n.search ? "…" : ""}`;
@@ -3456,23 +3597,23 @@ function Ee(e, t = 48) {
3456
3597
  return e.length > 64 ? `${e.slice(0, 64)}…` : e;
3457
3598
  }
3458
3599
  }
3459
- function ct({ item: e }) {
3460
- return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 }) : e.status != null ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 });
3600
+ function bt({ item: e }) {
3601
+ return e.error != null ? /* @__PURE__ */ o(G, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 }) : e.status != null ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 });
3461
3602
  }
3462
- function dt({ item: e }) {
3463
- return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 }) : e.status != null ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
3603
+ function St({ item: e }) {
3604
+ return e.error != null ? /* @__PURE__ */ o(G, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 }) : e.status != null ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
3464
3605
  }
3465
- function ut({
3606
+ function xt({
3466
3607
  item: e,
3467
3608
  t,
3468
3609
  isLatest: n = !1
3469
3610
  }) {
3470
- const { colors: r } = T(), i = e.error ?? e.summary ?? "", c = i.length > 0, s = e.error != null, h = D(null), d = e.summary != null && e.summary !== "", u = Me(e, t), l = s || d || !c && u != null, m = e.error == null && (e.summary == null || e.summary === "");
3471
- return z(() => {
3472
- const k = h.current;
3473
- k != null && c && (k.scrollTop = k.scrollHeight);
3474
- }, [i, c]), /* @__PURE__ */ f(
3475
- M.div,
3611
+ const { colors: r } = x(), i = e.error ?? e.summary ?? "", c = i.length > 0, s = e.error != null, u = W(null), d = e.summary != null && e.summary !== "", m = Me(e, t), f = s || d || !c && m != null, l = e.error == null && (e.summary == null || e.summary === "");
3612
+ return L(() => {
3613
+ const h = u.current;
3614
+ h != null && c && (h.scrollTop = h.scrollHeight);
3615
+ }, [i, c]), /* @__PURE__ */ k(
3616
+ v.div,
3476
3617
  {
3477
3618
  initial: { opacity: 0 },
3478
3619
  animate: { opacity: 1 },
@@ -3480,7 +3621,7 @@ function ut({
3480
3621
  style: {
3481
3622
  display: "flex",
3482
3623
  flexDirection: "row",
3483
- alignItems: m ? "center" : l ? "flex-start" : "center",
3624
+ alignItems: l ? "center" : f ? "flex-start" : "center",
3484
3625
  gap: "10px",
3485
3626
  minWidth: 0
3486
3627
  },
@@ -3494,12 +3635,12 @@ function ut({
3494
3635
  justifyContent: "center",
3495
3636
  flexShrink: 0,
3496
3637
  width: 32,
3497
- ...m || !l ? {} : { paddingTop: 2 }
3638
+ ...l || !f ? {} : { paddingTop: 2 }
3498
3639
  },
3499
- children: /* @__PURE__ */ o(dt, { item: e })
3640
+ children: /* @__PURE__ */ o(St, { item: e })
3500
3641
  }
3501
3642
  ),
3502
- /* @__PURE__ */ f(
3643
+ /* @__PURE__ */ k(
3503
3644
  "div",
3504
3645
  {
3505
3646
  style: {
@@ -3523,16 +3664,16 @@ function ut({
3523
3664
  textDecoration: "none",
3524
3665
  wordBreak: "break-all"
3525
3666
  },
3526
- onMouseEnter: (k) => {
3527
- k.currentTarget.style.textDecoration = "underline";
3667
+ onMouseEnter: (h) => {
3668
+ h.currentTarget.style.textDecoration = "underline";
3528
3669
  },
3529
- onMouseLeave: (k) => {
3530
- k.currentTarget.style.textDecoration = "none";
3670
+ onMouseLeave: (h) => {
3671
+ h.currentTarget.style.textDecoration = "none";
3531
3672
  },
3532
- children: Ee(e.url)
3673
+ children: Ie(e.url)
3533
3674
  }
3534
3675
  ),
3535
- !c && u != null && /* @__PURE__ */ o("div", { style: { fontSize: 12, color: r.textTertiary, minHeight: 18 }, children: n ? /* @__PURE__ */ o(F, { text: u, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: r.textTertiary }, children: u }) }),
3676
+ !c && m != null && /* @__PURE__ */ o("div", { style: { fontSize: 12, color: r.textTertiary, minHeight: 18 }, children: n ? /* @__PURE__ */ o(R, { text: m, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: r.textTertiary }, children: m }) }),
3536
3677
  c && /* @__PURE__ */ o(
3537
3678
  "div",
3538
3679
  {
@@ -3545,15 +3686,15 @@ function ut({
3545
3686
  children: /* @__PURE__ */ o(
3546
3687
  "div",
3547
3688
  {
3548
- ref: h,
3689
+ ref: u,
3549
3690
  style: {
3550
- minHeight: st,
3551
- maxHeight: lt,
3691
+ minHeight: ft,
3692
+ maxHeight: kt,
3552
3693
  height: "auto",
3553
3694
  overflowY: "auto",
3554
3695
  overflowX: "hidden",
3555
- fontSize: te,
3556
- lineHeight: ne,
3696
+ fontSize: ne,
3697
+ lineHeight: oe,
3557
3698
  whiteSpace: "pre-wrap",
3558
3699
  wordBreak: "break-word",
3559
3700
  color: s ? r.textError : r.textTertiary
@@ -3570,13 +3711,13 @@ function ut({
3570
3711
  }
3571
3712
  );
3572
3713
  }
3573
- function mt({
3714
+ function Tt({
3574
3715
  item: e,
3575
3716
  t
3576
3717
  }) {
3577
- const { colors: n } = T(), [r, i] = I(!1), c = e.error ?? e.summary ?? "", s = e.error != null, h = c.length > me, d = c.length === 0 ? void 0 : r || !h ? c : `${c.slice(0, me)}...`, u = Me(e, t), l = e.error == null && (e.summary == null || e.summary === "") && e.status != null;
3578
- return /* @__PURE__ */ f(
3579
- M.div,
3718
+ const { colors: n } = x(), [r, i] = I(!1), c = e.error ?? e.summary ?? "", s = e.error != null, u = c.length > pe, d = c.length === 0 ? void 0 : r || !u ? c : `${c.slice(0, pe)}...`, m = Me(e, t), f = e.error == null && (e.summary == null || e.summary === "") && e.status != null;
3719
+ return /* @__PURE__ */ k(
3720
+ v.div,
3580
3721
  {
3581
3722
  initial: { opacity: 0 },
3582
3723
  animate: { opacity: 1 },
@@ -3584,7 +3725,7 @@ function mt({
3584
3725
  style: {
3585
3726
  display: "flex",
3586
3727
  flexDirection: "row",
3587
- alignItems: l ? "center" : "flex-start",
3728
+ alignItems: f ? "center" : "flex-start",
3588
3729
  gap: "10px",
3589
3730
  minWidth: 0
3590
3731
  },
@@ -3598,12 +3739,12 @@ function mt({
3598
3739
  justifyContent: "center",
3599
3740
  flexShrink: 0,
3600
3741
  width: 32,
3601
- ...l ? {} : { paddingTop: 2 }
3742
+ ...f ? {} : { paddingTop: 2 }
3602
3743
  },
3603
- children: /* @__PURE__ */ o(ct, { item: e })
3744
+ children: /* @__PURE__ */ o(bt, { item: e })
3604
3745
  }
3605
3746
  ),
3606
- /* @__PURE__ */ f(
3747
+ /* @__PURE__ */ k(
3607
3748
  "div",
3608
3749
  {
3609
3750
  style: {
@@ -3627,16 +3768,16 @@ function mt({
3627
3768
  textDecoration: "none",
3628
3769
  wordBreak: "break-all"
3629
3770
  },
3630
- onMouseEnter: (m) => {
3631
- m.currentTarget.style.textDecoration = "underline";
3771
+ onMouseEnter: (l) => {
3772
+ l.currentTarget.style.textDecoration = "underline";
3632
3773
  },
3633
- onMouseLeave: (m) => {
3634
- m.currentTarget.style.textDecoration = "none";
3774
+ onMouseLeave: (l) => {
3775
+ l.currentTarget.style.textDecoration = "none";
3635
3776
  },
3636
- children: Ee(e.url)
3777
+ children: Ie(e.url)
3637
3778
  }
3638
3779
  ),
3639
- d == null && u != null && /* @__PURE__ */ o(
3780
+ d == null && m != null && /* @__PURE__ */ o(
3640
3781
  "span",
3641
3782
  {
3642
3783
  style: {
@@ -3644,26 +3785,26 @@ function mt({
3644
3785
  color: n.textTertiary,
3645
3786
  lineHeight: 1.4
3646
3787
  },
3647
- children: u
3788
+ children: m
3648
3789
  }
3649
3790
  ),
3650
- d != null && /* @__PURE__ */ f(B, { children: [
3791
+ d != null && /* @__PURE__ */ k(P, { children: [
3651
3792
  /* @__PURE__ */ o(
3652
3793
  "span",
3653
3794
  {
3654
- onClick: h ? () => i((m) => !m) : void 0,
3795
+ onClick: u ? () => i((l) => !l) : void 0,
3655
3796
  style: {
3656
3797
  fontSize: 12,
3657
3798
  color: s ? n.textError : n.textSecondary,
3658
3799
  lineHeight: 1.4,
3659
3800
  whiteSpace: r ? "pre-wrap" : void 0,
3660
3801
  wordBreak: "break-word",
3661
- cursor: h ? "pointer" : "default"
3802
+ cursor: u ? "pointer" : "default"
3662
3803
  },
3663
3804
  children: d
3664
3805
  }
3665
3806
  ),
3666
- h && /* @__PURE__ */ o(
3807
+ u && /* @__PURE__ */ o(
3667
3808
  "span",
3668
3809
  {
3669
3810
  style: {
@@ -3710,22 +3851,22 @@ function he(e, t, n) {
3710
3851
  }
3711
3852
  );
3712
3853
  }
3713
- function ht({
3854
+ function vt({
3714
3855
  data: e,
3715
3856
  isLatest: t,
3716
3857
  durationSeconds: n,
3717
3858
  t: r
3718
3859
  }) {
3719
- const { colors: i } = T(), c = e.input.urls, s = e.input.query, h = c.length, d = h === 1 ? S(r.scrapingPage, { query: s }) : S(r.scrapingPages, { n: h, query: s });
3720
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
3860
+ const { colors: i } = x(), c = e.input.urls, s = e.input.query, u = c.length, d = u === 1 ? S(r.scrapingPage, { query: s }) : S(r.scrapingPages, { n: u, query: s });
3861
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
3721
3862
  /* @__PURE__ */ o(
3722
- M.div,
3863
+ v.div,
3723
3864
  {
3724
3865
  style: { color: i.textSecondary },
3725
3866
  initial: { opacity: 0, y: -10 },
3726
3867
  animate: { opacity: 1, y: 0 },
3727
3868
  transition: { duration: 0.3, delay: 0 },
3728
- children: t && !n ? /* @__PURE__ */ o(F, { text: d, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: i.textSecondary }, children: d })
3869
+ children: t && !n ? /* @__PURE__ */ o(R, { text: d, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: i.textSecondary }, children: d })
3729
3870
  }
3730
3871
  ),
3731
3872
  n !== void 0 && /* @__PURE__ */ o(
@@ -3742,18 +3883,18 @@ function ht({
3742
3883
  )
3743
3884
  ] });
3744
3885
  }
3745
- function pt({
3886
+ function Ct({
3746
3887
  data: e,
3747
3888
  isLatest: t = !1,
3748
3889
  t: n
3749
3890
  }) {
3750
- const { colors: r } = T(), [i, c] = I(!1), s = e.results ?? [], { successCount: h, errorCount: d } = W(() => {
3751
- let p = 0, b = 0;
3752
- for (const C of s)
3753
- C.error != null ? b += 1 : p += 1;
3754
- return { successCount: p, errorCount: b };
3755
- }, [s]), u = s.length, l = e.input.query, m = s.length > 0 && s.every((p) => it(p)), k = t && !m ? u === 1 ? S(n.scrapingPage, { query: l }) : S(n.scrapingPages, { n: u, query: l }) : u === 1 ? n.scrapedPage : S(n.scrapedPages, { n: u }), y = S(n.scrapeOkCount, { n: h }), g = d > 0 ? `${k} - ${y}, ${S(n.scrapeFailedCount, { n: d })}` : `${k} - ${y}`;
3756
- return u === 0 ? /* @__PURE__ */ o("div", { style: { paddingBlock: "10px" }, children: /* @__PURE__ */ o(
3891
+ const { colors: r } = x(), [i, c] = I(!1), s = e.results ?? [], { successCount: u, errorCount: d } = z(() => {
3892
+ let p = 0, g = 0;
3893
+ for (const T of s)
3894
+ T.error != null ? g += 1 : p += 1;
3895
+ return { successCount: p, errorCount: g };
3896
+ }, [s]), m = s.length, f = e.input.query, l = s.length > 0 && s.every((p) => yt(p)), h = t && !l ? m === 1 ? S(n.scrapingPage, { query: f }) : S(n.scrapingPages, { n: m, query: f }) : m === 1 ? n.scrapedPage : S(n.scrapedPages, { n: m }), b = S(n.scrapeOkCount, { n: u }), y = d > 0 ? `${h} - ${b}, ${S(n.scrapeFailedCount, { n: d })}` : `${h} - ${b}`;
3897
+ return m === 0 ? /* @__PURE__ */ o("div", { style: { paddingBlock: "10px" }, children: /* @__PURE__ */ o(
3757
3898
  "div",
3758
3899
  {
3759
3900
  style: {
@@ -3763,9 +3904,9 @@ function pt({
3763
3904
  },
3764
3905
  children: n.memorySearchExploreNoResults
3765
3906
  }
3766
- ) }) : t ? /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
3907
+ ) }) : t ? /* @__PURE__ */ k("div", { style: { paddingBlock: "10px" }, children: [
3767
3908
  /* @__PURE__ */ o(
3768
- M.div,
3909
+ v.div,
3769
3910
  {
3770
3911
  initial: { opacity: 0 },
3771
3912
  animate: { opacity: 1 },
@@ -3778,29 +3919,29 @@ function pt({
3778
3919
  gap: "6px 12px",
3779
3920
  minWidth: 0
3780
3921
  },
3781
- children: t && !m ? /* @__PURE__ */ o(F, { text: g, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o(
3922
+ children: t && !l ? /* @__PURE__ */ o(R, { text: y, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o(
3782
3923
  "span",
3783
3924
  {
3784
3925
  style: {
3785
3926
  fontSize: 12,
3786
3927
  color: r.textSecondary
3787
3928
  },
3788
- children: g
3929
+ children: y
3789
3930
  }
3790
3931
  )
3791
3932
  }
3792
3933
  ),
3793
3934
  he(s, r, (p) => /* @__PURE__ */ o(
3794
- ut,
3935
+ xt,
3795
3936
  {
3796
3937
  item: p,
3797
3938
  t: n,
3798
3939
  isLatest: t
3799
3940
  }
3800
3941
  ))
3801
- ] }) : /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
3802
- /* @__PURE__ */ f(
3803
- M.div,
3942
+ ] }) : /* @__PURE__ */ k("div", { style: { paddingBlock: "10px" }, children: [
3943
+ /* @__PURE__ */ k(
3944
+ v.div,
3804
3945
  {
3805
3946
  initial: { opacity: 0 },
3806
3947
  animate: { opacity: 1 },
@@ -3821,7 +3962,7 @@ function pt({
3821
3962
  fontSize: 12,
3822
3963
  color: r.textSecondary
3823
3964
  },
3824
- children: g
3965
+ children: y
3825
3966
  }
3826
3967
  ),
3827
3968
  /* @__PURE__ */ o(
@@ -3845,11 +3986,11 @@ function pt({
3845
3986
  ]
3846
3987
  }
3847
3988
  ),
3848
- i && he(s, r, (p) => /* @__PURE__ */ o(mt, { item: p, t: n }))
3989
+ i && he(s, r, (p) => /* @__PURE__ */ o(Tt, { item: p, t: n }))
3849
3990
  ] });
3850
3991
  }
3851
- const gt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => e.results === void 0 ? /* @__PURE__ */ o(
3852
- ht,
3992
+ const wt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => e.results === void 0 ? /* @__PURE__ */ o(
3993
+ vt,
3853
3994
  {
3854
3995
  data: e,
3855
3996
  isLatest: t,
@@ -3857,17 +3998,17 @@ const gt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => e.result
3857
3998
  t: r
3858
3999
  }
3859
4000
  ) : /* @__PURE__ */ o(
3860
- pt,
4001
+ Ct,
3861
4002
  {
3862
4003
  data: e,
3863
4004
  isLatest: t,
3864
4005
  t: r
3865
4006
  }
3866
- ), yt = (e) => {
3867
- const { colors: t } = T(), { isLatest: n = !1, durationSeconds: r, t: i } = e, c = i.memoryChatThinking;
3868
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
4007
+ ), Et = (e) => {
4008
+ const { colors: t } = x(), { isLatest: n = !1, durationSeconds: r, t: i } = e, c = i.memoryChatThinking;
4009
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
3869
4010
  /* @__PURE__ */ o(
3870
- M.div,
4011
+ v.div,
3871
4012
  {
3872
4013
  style: {
3873
4014
  display: "flex",
@@ -3878,7 +4019,7 @@ const gt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => e.result
3878
4019
  initial: { opacity: 0, y: -10 },
3879
4020
  animate: { opacity: 1, y: 0 },
3880
4021
  transition: { duration: 0.3, delay: 0 },
3881
- children: n && !r ? /* @__PURE__ */ o(F, { text: c, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: t.textSecondary }, children: c })
4022
+ children: n && !r ? /* @__PURE__ */ o(R, { text: c, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: t.textSecondary }, children: c })
3882
4023
  }
3883
4024
  ),
3884
4025
  r !== void 0 && /* @__PURE__ */ o(
@@ -3894,23 +4035,250 @@ const gt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => e.result
3894
4035
  }
3895
4036
  )
3896
4037
  ] });
4038
+ }, Mt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4039
+ const i = `${r.generateReportSetup} '${e.userRequest}'`;
4040
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
4041
+ /* @__PURE__ */ o(
4042
+ v.div,
4043
+ {
4044
+ style: {
4045
+ display: "flex",
4046
+ alignItems: "center",
4047
+ gap: "10px",
4048
+ color: "#666"
4049
+ },
4050
+ initial: { opacity: 0, y: -10 },
4051
+ animate: { opacity: 1, y: 0 },
4052
+ transition: { duration: 0.3, delay: 0 },
4053
+ children: t && !n ? /* @__PURE__ */ o(
4054
+ R,
4055
+ {
4056
+ text: i,
4057
+ duration: 2.5,
4058
+ repeat: !0,
4059
+ color: "#999",
4060
+ shimmerColor: "#000"
4061
+ }
4062
+ ) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: i })
4063
+ }
4064
+ ),
4065
+ n !== void 0 && /* @__PURE__ */ o(
4066
+ "div",
4067
+ {
4068
+ style: {
4069
+ fontSize: "12px",
4070
+ color: "#999",
4071
+ marginTop: "4px",
4072
+ fontStyle: "italic"
4073
+ },
4074
+ children: S(r.tookSeconds, { n })
4075
+ }
4076
+ )
4077
+ ] });
4078
+ }, It = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4079
+ const i = e.fileCount === 1 ? r.generateReportExportingOne : S(r.generateReportExporting, {
4080
+ n: e.fileCount
4081
+ });
4082
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
4083
+ /* @__PURE__ */ o(
4084
+ v.div,
4085
+ {
4086
+ style: {
4087
+ display: "flex",
4088
+ alignItems: "center",
4089
+ gap: "10px",
4090
+ color: "#666"
4091
+ },
4092
+ initial: { opacity: 0, y: -10 },
4093
+ animate: { opacity: 1, y: 0 },
4094
+ transition: { duration: 0.3, delay: 0 },
4095
+ children: t && !n ? /* @__PURE__ */ o(
4096
+ R,
4097
+ {
4098
+ text: i,
4099
+ duration: 2.5,
4100
+ repeat: !0,
4101
+ color: "#999",
4102
+ shimmerColor: "#000"
4103
+ }
4104
+ ) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: i })
4105
+ }
4106
+ ),
4107
+ n !== void 0 && /* @__PURE__ */ o(
4108
+ "div",
4109
+ {
4110
+ style: {
4111
+ fontSize: "12px",
4112
+ color: "#999",
4113
+ marginTop: "4px",
4114
+ fontStyle: "italic"
4115
+ },
4116
+ children: S(r.tookSeconds, { n })
4117
+ }
4118
+ )
4119
+ ] });
4120
+ }, Rt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4121
+ const i = S(r.generateReportRunCode, {
4122
+ title: e.title
4123
+ });
4124
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
4125
+ /* @__PURE__ */ o(
4126
+ v.div,
4127
+ {
4128
+ style: {
4129
+ display: "flex",
4130
+ alignItems: "center",
4131
+ gap: "10px",
4132
+ color: "#666"
4133
+ },
4134
+ initial: { opacity: 0, y: -10 },
4135
+ animate: { opacity: 1, y: 0 },
4136
+ transition: { duration: 0.3, delay: 0 },
4137
+ children: t && !n ? /* @__PURE__ */ o(
4138
+ R,
4139
+ {
4140
+ text: i,
4141
+ duration: 2.5,
4142
+ repeat: !0,
4143
+ color: "#999",
4144
+ shimmerColor: "#000"
4145
+ }
4146
+ ) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: i })
4147
+ }
4148
+ ),
4149
+ n !== void 0 && /* @__PURE__ */ o(
4150
+ "div",
4151
+ {
4152
+ style: {
4153
+ fontSize: "12px",
4154
+ color: "#999",
4155
+ marginTop: "4px",
4156
+ fontStyle: "italic"
4157
+ },
4158
+ children: S(r.tookSeconds, { n })
4159
+ }
4160
+ )
4161
+ ] });
4162
+ }, Ft = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4163
+ const i = S(r.generateReportRunCommand, {
4164
+ title: e.title
4165
+ });
4166
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
4167
+ /* @__PURE__ */ o(
4168
+ v.div,
4169
+ {
4170
+ style: {
4171
+ display: "flex",
4172
+ alignItems: "center",
4173
+ gap: "10px",
4174
+ color: "#666"
4175
+ },
4176
+ initial: { opacity: 0, y: -10 },
4177
+ animate: { opacity: 1, y: 0 },
4178
+ transition: { duration: 0.3, delay: 0 },
4179
+ children: t && !n ? /* @__PURE__ */ o(
4180
+ R,
4181
+ {
4182
+ text: i,
4183
+ duration: 2.5,
4184
+ repeat: !0,
4185
+ color: "#999",
4186
+ shimmerColor: "#000"
4187
+ }
4188
+ ) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: i })
4189
+ }
4190
+ ),
4191
+ n !== void 0 && /* @__PURE__ */ o(
4192
+ "div",
4193
+ {
4194
+ style: {
4195
+ fontSize: "12px",
4196
+ color: "#999",
4197
+ marginTop: "4px",
4198
+ fontStyle: "italic"
4199
+ },
4200
+ children: S(r.tookSeconds, { n })
4201
+ }
4202
+ )
4203
+ ] });
4204
+ }, At = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4205
+ const i = S(r.generateReportAssembling, {
4206
+ title: e.reportTitle
4207
+ });
4208
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
4209
+ /* @__PURE__ */ o(
4210
+ v.div,
4211
+ {
4212
+ style: {
4213
+ display: "flex",
4214
+ alignItems: "center",
4215
+ gap: "10px",
4216
+ color: "#666"
4217
+ },
4218
+ initial: { opacity: 0, y: -10 },
4219
+ animate: { opacity: 1, y: 0 },
4220
+ transition: { duration: 0.3, delay: 0 },
4221
+ children: t && !n ? /* @__PURE__ */ o(
4222
+ R,
4223
+ {
4224
+ text: i,
4225
+ duration: 2.5,
4226
+ repeat: !0,
4227
+ color: "#999",
4228
+ shimmerColor: "#000"
4229
+ }
4230
+ ) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: i })
4231
+ }
4232
+ ),
4233
+ n !== void 0 && /* @__PURE__ */ o(
4234
+ "div",
4235
+ {
4236
+ style: {
4237
+ fontSize: "12px",
4238
+ color: "#999",
4239
+ marginTop: "4px",
4240
+ fontStyle: "italic"
4241
+ },
4242
+ children: S(r.tookSeconds, { n })
4243
+ }
4244
+ )
4245
+ ] });
4246
+ }, Bt = ({ data: e, t }) => {
4247
+ const n = S(t.generateReportCompleted, {
4248
+ title: e.reportTitle
4249
+ });
4250
+ return /* @__PURE__ */ o("div", { style: { paddingBlock: "16px" }, children: /* @__PURE__ */ o(
4251
+ v.div,
4252
+ {
4253
+ style: {
4254
+ display: "flex",
4255
+ alignItems: "center",
4256
+ gap: "10px",
4257
+ color: "#666"
4258
+ },
4259
+ initial: { opacity: 0, y: -10 },
4260
+ animate: { opacity: 1, y: 0 },
4261
+ transition: { duration: 0.3, delay: 0 },
4262
+ children: /* @__PURE__ */ o("span", { style: { color: "#666" }, children: n })
4263
+ }
4264
+ ) });
3897
4265
  };
3898
- function ft({ item: e }) {
3899
- return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
4266
+ function Dt({ item: e }) {
4267
+ return e.error != null ? /* @__PURE__ */ o(G, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
3900
4268
  }
3901
- function kt(e, t) {
4269
+ function Pt(e, t) {
3902
4270
  return S(t.searchingInMemoriesOfType, {
3903
4271
  name: e.memoryTypeName
3904
4272
  });
3905
4273
  }
3906
- function bt({
4274
+ function Lt({
3907
4275
  item: e,
3908
4276
  t,
3909
4277
  showShimmerForPrimary: n
3910
4278
  }) {
3911
- const { colors: r } = T(), i = e.result != null, c = e.error != null, s = kt(e, t);
3912
- return /* @__PURE__ */ f(
3913
- M.div,
4279
+ const { colors: r } = x(), i = e.result != null, c = e.error != null, s = Pt(e, t);
4280
+ return /* @__PURE__ */ k(
4281
+ v.div,
3914
4282
  {
3915
4283
  initial: { opacity: 0 },
3916
4284
  animate: { opacity: 1 },
@@ -3936,10 +4304,10 @@ function bt({
3936
4304
  flexShrink: 0,
3937
4305
  width: 32
3938
4306
  },
3939
- children: /* @__PURE__ */ o(ft, { item: e })
4307
+ children: /* @__PURE__ */ o(Dt, { item: e })
3940
4308
  }
3941
4309
  ),
3942
- /* @__PURE__ */ f(
4310
+ /* @__PURE__ */ k(
3943
4311
  "div",
3944
4312
  {
3945
4313
  style: {
@@ -3950,7 +4318,7 @@ function bt({
3950
4318
  flex: 1
3951
4319
  },
3952
4320
  children: [
3953
- /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: r.textPrimary }, children: !i && !c && n ? /* @__PURE__ */ o(F, { text: s, duration: 2.5, repeat: !0 }) : s }),
4321
+ /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: r.textPrimary }, children: !i && !c && n ? /* @__PURE__ */ o(R, { text: s, duration: 2.5, repeat: !0 }) : s }),
3954
4322
  i && /* @__PURE__ */ o("span", { style: { fontSize: 12, color: r.textSecondary }, children: e.result.numberOfChunks === 1 ? S(
3955
4323
  t.memorySearchTypeResultSummaryOne,
3956
4324
  {
@@ -3975,20 +4343,20 @@ function bt({
3975
4343
  }
3976
4344
  );
3977
4345
  }
3978
- const St = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
3979
- const { colors: i } = T(), c = W(() => {
4346
+ const zt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4347
+ const { colors: i } = x(), c = z(() => {
3980
4348
  let s = -1;
3981
- return e.memoryTypes.forEach((h, d) => {
3982
- h.result == null && h.error == null && (s = d);
4349
+ return e.memoryTypes.forEach((u, d) => {
4350
+ u.result == null && u.error == null && (s = d);
3983
4351
  }), s;
3984
4352
  }, [e.memoryTypes]);
3985
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
3986
- t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(F, { text: r.searchingMemoryTypes, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s, h) => /* @__PURE__ */ o(
3987
- bt,
4353
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "10px" }, children: [
4354
+ t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(R, { text: r.searchingMemoryTypes, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s, u) => /* @__PURE__ */ o(
4355
+ Lt,
3988
4356
  {
3989
4357
  item: s,
3990
4358
  t: r,
3991
- showShimmerForPrimary: h === c && t
4359
+ showShimmerForPrimary: u === c && t
3992
4360
  },
3993
4361
  s.memoryTypeId
3994
4362
  )),
@@ -4005,41 +4373,41 @@ const St = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4005
4373
  }
4006
4374
  )
4007
4375
  ] });
4008
- }, U = 12, _ = 1.45, xt = Math.ceil(
4376
+ }, U = 12, _ = 1.45, Wt = Math.ceil(
4009
4377
  U * _
4010
- ), Tt = Math.ceil(
4378
+ ), jt = Math.ceil(
4011
4379
  5 * U * _
4012
4380
  );
4013
- function j(e) {
4381
+ function $(e) {
4014
4382
  return e.queries != null && e.queries.length > 0;
4015
4383
  }
4016
- function vt(e) {
4384
+ function Nt(e) {
4017
4385
  const t = e.reasoning;
4018
- return (t == null || t === "") && !j(e);
4386
+ return (t == null || t === "") && !$(e);
4019
4387
  }
4020
- function wt(e) {
4021
- if (j(e)) return 3;
4388
+ function Ot(e) {
4389
+ if ($(e)) return 3;
4022
4390
  const t = e.reasoning;
4023
4391
  return t == null || t === "" ? 1 : e.reasoningCompleted === !0 ? 2 : 1;
4024
4392
  }
4025
- function Ct({ phase: e }) {
4026
- return e === 3 ? /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
4393
+ function $t({ phase: e }) {
4394
+ return e === 3 ? /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
4027
4395
  }
4028
- function Mt({
4396
+ function Gt({
4029
4397
  item: e,
4030
4398
  t,
4031
4399
  isActiveRow: n
4032
4400
  }) {
4033
- const { colors: r } = T(), i = vt(e), c = wt(e), s = e.reasoning, h = s != null && s.length > 0, d = D(null), [u, l] = I(!1), m = i && n, k = c === 2 && n && !j(e);
4034
- z(() => {
4401
+ const { colors: r } = x(), i = Nt(e), c = Ot(e), s = e.reasoning, u = s != null && s.length > 0, d = W(null), [m, f] = I(!1), l = i && n, h = c === 2 && n && !$(e);
4402
+ L(() => {
4035
4403
  const p = d.current;
4036
- p != null && c === 1 && h && (p.scrollTop = p.scrollHeight);
4037
- }, [s, c, h]);
4038
- const y = S(t.searchingInMemoriesOfType, {
4404
+ p != null && c === 1 && u && (p.scrollTop = p.scrollHeight);
4405
+ }, [s, c, u]);
4406
+ const b = S(t.searchingInMemoriesOfType, {
4039
4407
  name: e.memoryTypeName
4040
- }), g = !i && c === 3;
4041
- return /* @__PURE__ */ f(
4042
- M.div,
4408
+ }), y = !i && c === 3;
4409
+ return /* @__PURE__ */ k(
4410
+ v.div,
4043
4411
  {
4044
4412
  initial: { opacity: 0 },
4045
4413
  animate: { opacity: 1 },
@@ -4050,7 +4418,7 @@ function Mt({
4050
4418
  borderBottom: `1px solid ${r.border}`,
4051
4419
  display: "flex",
4052
4420
  flexDirection: "row",
4053
- alignItems: g ? "flex-start" : "center",
4421
+ alignItems: y ? "flex-start" : "center",
4054
4422
  gap: "10px",
4055
4423
  minWidth: 0
4056
4424
  },
@@ -4064,12 +4432,12 @@ function Mt({
4064
4432
  justifyContent: "center",
4065
4433
  flexShrink: 0,
4066
4434
  width: 32,
4067
- ...g ? { paddingTop: 2 } : {}
4435
+ ...y ? { paddingTop: 2 } : {}
4068
4436
  },
4069
- children: /* @__PURE__ */ o(Ct, { phase: i ? 1 : c })
4437
+ children: /* @__PURE__ */ o($t, { phase: i ? 1 : c })
4070
4438
  }
4071
4439
  ),
4072
- /* @__PURE__ */ f(
4440
+ /* @__PURE__ */ k(
4073
4441
  "div",
4074
4442
  {
4075
4443
  style: {
@@ -4080,8 +4448,8 @@ function Mt({
4080
4448
  flex: 1
4081
4449
  },
4082
4450
  children: [
4083
- /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: r.textPrimary }, children: m ? /* @__PURE__ */ o(F, { text: y, duration: 2.5, repeat: !0 }) : e.memoryTypeName }),
4084
- c === 1 && h && !j(e) && /* @__PURE__ */ f("div", { style: { minWidth: 0 }, children: [
4451
+ /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: r.textPrimary }, children: l ? /* @__PURE__ */ o(R, { text: b, duration: 2.5, repeat: !0 }) : e.memoryTypeName }),
4452
+ c === 1 && u && !$(e) && /* @__PURE__ */ k("div", { style: { minWidth: 0 }, children: [
4085
4453
  /* @__PURE__ */ o(
4086
4454
  "span",
4087
4455
  {
@@ -4110,8 +4478,8 @@ function Mt({
4110
4478
  ref: d,
4111
4479
  className: "memory-search-generating-reasoning-viewport",
4112
4480
  style: {
4113
- minHeight: xt,
4114
- maxHeight: Tt,
4481
+ minHeight: Wt,
4482
+ maxHeight: jt,
4115
4483
  height: "auto",
4116
4484
  overflowY: "auto",
4117
4485
  overflowX: "hidden",
@@ -4127,16 +4495,16 @@ function Mt({
4127
4495
  }
4128
4496
  )
4129
4497
  ] }),
4130
- c === 2 && k && /* @__PURE__ */ o("div", { style: { fontSize: 12 }, children: /* @__PURE__ */ o(
4131
- F,
4498
+ c === 2 && h && /* @__PURE__ */ o("div", { style: { fontSize: 12 }, children: /* @__PURE__ */ o(
4499
+ R,
4132
4500
  {
4133
4501
  text: t.memorySearchGeneratingQueriesPending,
4134
4502
  duration: 2.5,
4135
4503
  repeat: !0
4136
4504
  }
4137
4505
  ) }),
4138
- c === 3 && /* @__PURE__ */ f(B, { children: [
4139
- /* @__PURE__ */ f("div", { style: { minWidth: 0 }, children: [
4506
+ c === 3 && /* @__PURE__ */ k(P, { children: [
4507
+ /* @__PURE__ */ k("div", { style: { minWidth: 0 }, children: [
4140
4508
  /* @__PURE__ */ o(
4141
4509
  "span",
4142
4510
  {
@@ -4158,7 +4526,7 @@ function Mt({
4158
4526
  flexDirection: "column",
4159
4527
  gap: 6
4160
4528
  },
4161
- children: e.queries.map((p, b) => /* @__PURE__ */ o(
4529
+ children: e.queries.map((p, g) => /* @__PURE__ */ o(
4162
4530
  "div",
4163
4531
  {
4164
4532
  style: {
@@ -4169,17 +4537,17 @@ function Mt({
4169
4537
  },
4170
4538
  children: p.query
4171
4539
  },
4172
- b
4540
+ g
4173
4541
  ))
4174
4542
  }
4175
4543
  )
4176
4544
  ] }),
4177
- h && /* @__PURE__ */ f(B, { children: [
4545
+ u && /* @__PURE__ */ k(P, { children: [
4178
4546
  /* @__PURE__ */ o(
4179
4547
  "button",
4180
4548
  {
4181
4549
  type: "button",
4182
- onClick: () => l((p) => !p),
4550
+ onClick: () => f((p) => !p),
4183
4551
  style: {
4184
4552
  alignSelf: "flex-start",
4185
4553
  border: "none",
@@ -4190,10 +4558,10 @@ function Mt({
4190
4558
  color: r.textSecondary,
4191
4559
  textDecoration: "underline"
4192
4560
  },
4193
- children: u ? t.memorySearchHideReasoning : t.memorySearchViewReasoning
4561
+ children: m ? t.memorySearchHideReasoning : t.memorySearchViewReasoning
4194
4562
  }
4195
4563
  ),
4196
- u && /* @__PURE__ */ o(
4564
+ m && /* @__PURE__ */ o(
4197
4565
  "div",
4198
4566
  {
4199
4567
  style: {
@@ -4218,20 +4586,20 @@ function Mt({
4218
4586
  }
4219
4587
  );
4220
4588
  }
4221
- const Et = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4222
- const { colors: i } = T(), c = W(() => {
4589
+ const Ht = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4590
+ const { colors: i } = x(), c = z(() => {
4223
4591
  let s = -1;
4224
- return e.memoryTypes.forEach((h, d) => {
4225
- j(h) || (s = d);
4592
+ return e.memoryTypes.forEach((u, d) => {
4593
+ $(u) || (s = d);
4226
4594
  }), s;
4227
4595
  }, [e.memoryTypes]);
4228
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
4229
- t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(F, { text: r.memorySearchGeneratingQueries, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s, h) => /* @__PURE__ */ o(
4230
- Mt,
4596
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "10px" }, children: [
4597
+ t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(R, { text: r.memorySearchGeneratingQueries, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s, u) => /* @__PURE__ */ o(
4598
+ Gt,
4231
4599
  {
4232
4600
  item: s,
4233
4601
  t: r,
4234
- isActiveRow: h === c && t
4602
+ isActiveRow: u === c && t
4235
4603
  },
4236
4604
  s.memoryTypeId
4237
4605
  )),
@@ -4249,34 +4617,34 @@ const Et = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
4249
4617
  )
4250
4618
  ] });
4251
4619
  };
4252
- function It(e) {
4253
- return e.some((r) => r.result == null && r.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((r) => r.error != null) ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(L, { size: 15, borderWidth: 2 });
4620
+ function Ut(e) {
4621
+ return e.some((r) => r.result == null && r.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((r) => r.error != null) ? /* @__PURE__ */ o(G, { size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(j, { size: 15, borderWidth: 2 });
4254
4622
  }
4255
- function Rt({
4623
+ function _t({
4256
4624
  item: e,
4257
4625
  t
4258
4626
  }) {
4259
- const { colors: n } = T();
4627
+ const { colors: n } = x();
4260
4628
  if (e.error != null)
4261
4629
  return /* @__PURE__ */ o("span", { style: { fontSize: 12, color: n.textError, whiteSpace: "nowrap" }, children: e.error });
4262
4630
  if (e.result == null)
4263
- return /* @__PURE__ */ o("span", { style: { flexShrink: 0, fontSize: 12 }, children: /* @__PURE__ */ o(F, { text: t.searching, duration: 2.5, repeat: !0 }) });
4631
+ return /* @__PURE__ */ o("span", { style: { flexShrink: 0, fontSize: 12 }, children: /* @__PURE__ */ o(R, { text: t.searching, duration: 2.5, repeat: !0 }) });
4264
4632
  const r = e.result, i = r.numberOfChunks === 1 ? t.chunkFound : S(t.chunksFound, { n: r.numberOfChunks }), c = S(t.scoreLabel, {
4265
4633
  n: r.highestChunkScore.toFixed(2)
4266
4634
  });
4267
- return /* @__PURE__ */ f("span", { style: { fontSize: 12, color: n.textSecondary, whiteSpace: "nowrap" }, children: [
4635
+ return /* @__PURE__ */ k("span", { style: { fontSize: 12, color: n.textSecondary, whiteSpace: "nowrap" }, children: [
4268
4636
  i,
4269
4637
  " · ",
4270
4638
  c
4271
4639
  ] });
4272
4640
  }
4273
- function Ft({
4641
+ function qt({
4274
4642
  items: e,
4275
4643
  queryRow: t,
4276
4644
  onExploreQueryResultClick: n,
4277
4645
  t: r
4278
4646
  }) {
4279
- const { colors: i } = T(), [c, s] = I(null);
4647
+ const { colors: i } = x(), [c, s] = I(null);
4280
4648
  if (e.length === 0)
4281
4649
  return /* @__PURE__ */ o(
4282
4650
  "div",
@@ -4289,7 +4657,7 @@ function Ft({
4289
4657
  children: r.memorySearchExploreNoResults
4290
4658
  }
4291
4659
  );
4292
- const h = !!n;
4660
+ const u = !!n;
4293
4661
  return /* @__PURE__ */ o(
4294
4662
  "div",
4295
4663
  {
@@ -4301,26 +4669,26 @@ function Ft({
4301
4669
  paddingTop: 8,
4302
4670
  borderTop: `1px solid ${i.borderDivider}`
4303
4671
  },
4304
- children: e.map((d, u) => {
4305
- const l = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, m = ee(
4672
+ children: e.map((d, m) => {
4673
+ const f = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, l = re(
4306
4674
  d.chunks
4307
- ), k = [
4308
- re(d),
4675
+ ), h = [
4676
+ te(d),
4309
4677
  S(r.scoreLabel, {
4310
4678
  n: d.matchingChunkScore.toFixed(2)
4311
4679
  }),
4312
- m.length > 0 ? Z(m, r) : r.pagesNotAvailable
4680
+ l.length > 0 ? ee(l, r) : r.pagesNotAvailable
4313
4681
  ].filter(
4314
- (b) => b != null && b !== ""
4315
- ), y = {
4682
+ (g) => g != null && g !== ""
4683
+ ), b = {
4316
4684
  memoryId: d.memoryId,
4317
4685
  memoryTitle: d.memoryTitle,
4318
- pageNumbers: m,
4686
+ pageNumbers: l,
4319
4687
  memoryTypeId: t.memoryTypeId,
4320
4688
  memoryTypeName: t.memoryTypeName,
4321
4689
  query: t.query
4322
- }, g = `${t.query}::${d.memoryId}::${u}`, p = c === g;
4323
- return /* @__PURE__ */ f(
4690
+ }, y = `${t.query}::${d.memoryId}::${m}`, p = c === y;
4691
+ return /* @__PURE__ */ k(
4324
4692
  "div",
4325
4693
  {
4326
4694
  style: {
@@ -4328,13 +4696,13 @@ function Ft({
4328
4696
  flexDirection: "row",
4329
4697
  alignItems: "flex-start",
4330
4698
  gap: "12px",
4331
- paddingTop: u > 0 ? 12 : 0,
4332
- paddingBottom: u < e.length - 1 ? 12 : 0,
4333
- borderBottom: u < e.length - 1 ? `1px solid ${i.border}` : void 0,
4699
+ paddingTop: m > 0 ? 12 : 0,
4700
+ paddingBottom: m < e.length - 1 ? 12 : 0,
4701
+ borderBottom: m < e.length - 1 ? `1px solid ${i.border}` : void 0,
4334
4702
  minWidth: 0
4335
4703
  },
4336
4704
  children: [
4337
- /* @__PURE__ */ f(
4705
+ /* @__PURE__ */ k(
4338
4706
  "div",
4339
4707
  {
4340
4708
  style: {
@@ -4353,7 +4721,7 @@ function Ft({
4353
4721
  fontWeight: 600,
4354
4722
  color: i.textPrimary
4355
4723
  },
4356
- children: l
4724
+ children: f
4357
4725
  }
4358
4726
  ),
4359
4727
  /* @__PURE__ */ o(
@@ -4366,7 +4734,7 @@ function Ft({
4366
4734
  whiteSpace: "pre-wrap",
4367
4735
  wordBreak: "break-word"
4368
4736
  },
4369
- children: J(
4737
+ children: Z(
4370
4738
  d.chunks
4371
4739
  )
4372
4740
  }
@@ -4380,23 +4748,23 @@ function Ft({
4380
4748
  color: i.textMuted,
4381
4749
  lineHeight: 1.35
4382
4750
  },
4383
- children: k.join(" · ")
4751
+ children: h.join(" · ")
4384
4752
  }
4385
4753
  )
4386
4754
  ]
4387
4755
  }
4388
4756
  ),
4389
- h && /* @__PURE__ */ f(
4757
+ u && /* @__PURE__ */ k(
4390
4758
  "button",
4391
4759
  {
4392
4760
  type: "button",
4393
4761
  "aria-busy": p,
4394
4762
  disabled: p,
4395
4763
  onClick: async () => {
4396
- s(g);
4764
+ s(y);
4397
4765
  try {
4398
4766
  await n(
4399
- y
4767
+ b
4400
4768
  );
4401
4769
  } finally {
4402
4770
  s(null);
@@ -4432,13 +4800,13 @@ function Ft({
4432
4800
  )
4433
4801
  ]
4434
4802
  },
4435
- `${d.memoryId}-${u}`
4803
+ `${d.memoryId}-${m}`
4436
4804
  );
4437
4805
  })
4438
4806
  }
4439
4807
  );
4440
4808
  }
4441
- function At(e) {
4809
+ function Qt(e) {
4442
4810
  const t = [], n = /* @__PURE__ */ new Map();
4443
4811
  return e.forEach((r, i) => {
4444
4812
  let c = n.get(r.memoryTypeId);
@@ -4449,7 +4817,7 @@ function At(e) {
4449
4817
  }, n.set(r.memoryTypeId, c)), c.items.push({ item: r, flatIndex: i });
4450
4818
  }), t.map((r) => n.get(r));
4451
4819
  }
4452
- function Bt({
4820
+ function Kt({
4453
4821
  group: e,
4454
4822
  t,
4455
4823
  isLatest: n,
@@ -4457,11 +4825,11 @@ function Bt({
4457
4825
  toggleExpanded: i,
4458
4826
  onExploreQueryResultClick: c
4459
4827
  }) {
4460
- const { colors: s } = T(), h = e.items.map((u) => u.item), d = h.some(
4461
- (u) => u.result == null && u.error == null
4828
+ const { colors: s } = x(), u = e.items.map((m) => m.item), d = u.some(
4829
+ (m) => m.result == null && m.error == null
4462
4830
  );
4463
- return /* @__PURE__ */ f(
4464
- M.div,
4831
+ return /* @__PURE__ */ k(
4832
+ v.div,
4465
4833
  {
4466
4834
  initial: { opacity: 0 },
4467
4835
  animate: { opacity: 1 },
@@ -4488,10 +4856,10 @@ function Bt({
4488
4856
  width: 32,
4489
4857
  ...d ? {} : { paddingTop: 2 }
4490
4858
  },
4491
- children: It(h)
4859
+ children: Ut(u)
4492
4860
  }
4493
4861
  ),
4494
- /* @__PURE__ */ f(
4862
+ /* @__PURE__ */ k(
4495
4863
  "div",
4496
4864
  {
4497
4865
  style: {
@@ -4514,10 +4882,10 @@ function Bt({
4514
4882
  })
4515
4883
  }
4516
4884
  ),
4517
- e.items.map(({ item: u, flatIndex: l }) => {
4518
- var b;
4519
- const m = u.result != null, k = u.error != null, y = n && !m && !k, g = r[l] === !0, p = ((b = u.result) == null ? void 0 : b.items) ?? [];
4520
- return /* @__PURE__ */ f(
4885
+ e.items.map(({ item: m, flatIndex: f }) => {
4886
+ var g;
4887
+ const l = m.result != null, h = m.error != null, b = n && !l && !h, y = r[f] === !0, p = ((g = m.result) == null ? void 0 : g.items) ?? [];
4888
+ return /* @__PURE__ */ k(
4521
4889
  "div",
4522
4890
  {
4523
4891
  style: {
@@ -4527,7 +4895,7 @@ function Bt({
4527
4895
  minWidth: 0
4528
4896
  },
4529
4897
  children: [
4530
- /* @__PURE__ */ f(
4898
+ /* @__PURE__ */ k(
4531
4899
  "div",
4532
4900
  {
4533
4901
  style: {
@@ -4550,17 +4918,17 @@ function Bt({
4550
4918
  flex: "1 1 12rem",
4551
4919
  minWidth: 0
4552
4920
  },
4553
- children: y ? /* @__PURE__ */ o(
4554
- F,
4921
+ children: b ? /* @__PURE__ */ o(
4922
+ R,
4555
4923
  {
4556
- text: u.query,
4924
+ text: m.query,
4557
4925
  duration: 2.5,
4558
4926
  repeat: !0
4559
4927
  }
4560
- ) : u.query
4928
+ ) : m.query
4561
4929
  }
4562
4930
  ),
4563
- /* @__PURE__ */ f(
4931
+ /* @__PURE__ */ k(
4564
4932
  "div",
4565
4933
  {
4566
4934
  style: {
@@ -4571,12 +4939,12 @@ function Bt({
4571
4939
  flexShrink: 0
4572
4940
  },
4573
4941
  children: [
4574
- /* @__PURE__ */ o(Rt, { item: u, t }),
4575
- m && /* @__PURE__ */ o(
4942
+ /* @__PURE__ */ o(_t, { item: m, t }),
4943
+ l && /* @__PURE__ */ o(
4576
4944
  "button",
4577
4945
  {
4578
4946
  type: "button",
4579
- onClick: () => i(l),
4947
+ onClick: () => i(f),
4580
4948
  style: {
4581
4949
  border: "none",
4582
4950
  background: "none",
@@ -4587,7 +4955,7 @@ function Bt({
4587
4955
  textDecoration: "underline",
4588
4956
  fontFamily: "inherit"
4589
4957
  },
4590
- children: g ? t.memorySearchHideExploreResults : t.memorySearchViewExploreResults
4958
+ children: y ? t.memorySearchHideExploreResults : t.memorySearchViewExploreResults
4591
4959
  }
4592
4960
  )
4593
4961
  ]
@@ -4596,18 +4964,18 @@ function Bt({
4596
4964
  ]
4597
4965
  }
4598
4966
  ),
4599
- m && g && /* @__PURE__ */ o(
4600
- Ft,
4967
+ l && y && /* @__PURE__ */ o(
4968
+ qt,
4601
4969
  {
4602
4970
  items: p,
4603
- queryRow: u,
4971
+ queryRow: m,
4604
4972
  onExploreQueryResultClick: c,
4605
4973
  t
4606
4974
  }
4607
4975
  )
4608
4976
  ]
4609
4977
  },
4610
- `${e.memoryTypeId}-${l}-${u.query}`
4978
+ `${e.memoryTypeId}-${f}-${m.query}`
4611
4979
  );
4612
4980
  })
4613
4981
  ]
@@ -4617,43 +4985,43 @@ function Bt({
4617
4985
  }
4618
4986
  );
4619
4987
  }
4620
- const Pt = ({
4988
+ const Xt = ({
4621
4989
  data: e,
4622
4990
  isLatest: t = !1,
4623
4991
  durationSeconds: n,
4624
4992
  onExploreQueryResultClick: r,
4625
4993
  t: i
4626
4994
  }) => {
4627
- const { colors: c } = T(), [s, h] = I(
4995
+ const { colors: c } = x(), [s, u] = I(
4628
4996
  {}
4629
- ), d = O((l) => {
4630
- h((m) => ({
4631
- ...m,
4632
- [l]: !m[l]
4997
+ ), d = N((f) => {
4998
+ u((l) => ({
4999
+ ...l,
5000
+ [f]: !l[f]
4633
5001
  }));
4634
- }, []), u = W(
4635
- () => At(e.queries),
5002
+ }, []), m = z(
5003
+ () => Qt(e.queries),
4636
5004
  [e.queries]
4637
5005
  );
4638
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
5006
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "10px" }, children: [
4639
5007
  t && !n && e.queries.length === 0 ? /* @__PURE__ */ o(
4640
- F,
5008
+ R,
4641
5009
  {
4642
5010
  text: i.memorySearchExploringQueries,
4643
5011
  duration: 2.5,
4644
5012
  repeat: !0
4645
5013
  }
4646
- ) : u.map((l) => /* @__PURE__ */ o(
4647
- Bt,
5014
+ ) : m.map((f) => /* @__PURE__ */ o(
5015
+ Kt,
4648
5016
  {
4649
- group: l,
5017
+ group: f,
4650
5018
  t: i,
4651
5019
  isLatest: t,
4652
5020
  expandedRows: s,
4653
5021
  toggleExpanded: d,
4654
5022
  onExploreQueryResultClick: r
4655
5023
  },
4656
- l.memoryTypeId
5024
+ f.memoryTypeId
4657
5025
  )),
4658
5026
  n !== void 0 && /* @__PURE__ */ o(
4659
5027
  "div",
@@ -4668,11 +5036,11 @@ const Pt = ({
4668
5036
  }
4669
5037
  )
4670
5038
  ] });
4671
- }, zt = ({ data: e, onSearchResultClick: t, t: n }) => {
4672
- const { colors: r } = T(), i = e.response.items, c = !!t, [s, h] = I(null);
4673
- return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
5039
+ }, Vt = ({ data: e, onSearchResultClick: t, t: n }) => {
5040
+ const { colors: r } = x(), i = e.response.items, c = !!t, [s, u] = I(null);
5041
+ return /* @__PURE__ */ k("div", { style: { paddingBlock: "16px" }, children: [
4674
5042
  /* @__PURE__ */ o(
4675
- M.div,
5043
+ v.div,
4676
5044
  {
4677
5045
  style: {
4678
5046
  marginBottom: "12px",
@@ -4694,30 +5062,30 @@ const Pt = ({
4694
5062
  flexDirection: "column",
4695
5063
  gap: 0
4696
5064
  },
4697
- children: i.map((d, u) => {
4698
- const l = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, m = ee(
5065
+ children: i.map((d, m) => {
5066
+ const f = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, l = re(
4699
5067
  d.chunks
4700
- ), k = [
4701
- re(d),
5068
+ ), h = [
5069
+ te(d),
4702
5070
  S(n.scoreLabel, {
4703
5071
  n: d.matchingChunkScore.toFixed(2)
4704
5072
  }),
4705
- m.length > 0 ? Z(m, n) : n.pagesNotAvailable
5073
+ l.length > 0 ? ee(l, n) : n.pagesNotAvailable
4706
5074
  ].filter(
4707
- (b) => b != null && b !== ""
4708
- ), y = {
5075
+ (g) => g != null && g !== ""
5076
+ ), b = {
4709
5077
  memoryId: d.memoryId,
4710
5078
  memoryTitle: d.memoryTitle,
4711
5079
  memoryTypeId: d.memoryTypeId,
4712
5080
  memoryTypeName: d.memoryTypeName,
4713
- pageNumbers: m
4714
- }, g = `${d.memoryId}-${u}`, p = s === g;
4715
- return /* @__PURE__ */ f(
4716
- M.div,
5081
+ pageNumbers: l
5082
+ }, y = `${d.memoryId}-${m}`, p = s === y;
5083
+ return /* @__PURE__ */ k(
5084
+ v.div,
4717
5085
  {
4718
5086
  initial: { opacity: 0 },
4719
5087
  animate: { opacity: 1 },
4720
- transition: { duration: 0.2, delay: u * 0.04 },
5088
+ transition: { duration: 0.2, delay: m * 0.04 },
4721
5089
  style: {
4722
5090
  display: "flex",
4723
5091
  flexDirection: "row",
@@ -4725,11 +5093,11 @@ const Pt = ({
4725
5093
  gap: "12px",
4726
5094
  paddingTop: "12px",
4727
5095
  paddingBottom: "12px",
4728
- borderBottom: u < i.length - 1 ? `1px solid ${r.border}` : void 0,
5096
+ borderBottom: m < i.length - 1 ? `1px solid ${r.border}` : void 0,
4729
5097
  minWidth: 0
4730
5098
  },
4731
5099
  children: [
4732
- /* @__PURE__ */ f(
5100
+ /* @__PURE__ */ k(
4733
5101
  "div",
4734
5102
  {
4735
5103
  style: {
@@ -4748,7 +5116,7 @@ const Pt = ({
4748
5116
  fontWeight: 600,
4749
5117
  color: r.textPrimary
4750
5118
  },
4751
- children: l
5119
+ children: f
4752
5120
  }
4753
5121
  ),
4754
5122
  /* @__PURE__ */ o(
@@ -4761,7 +5129,7 @@ const Pt = ({
4761
5129
  whiteSpace: "pre-wrap",
4762
5130
  wordBreak: "break-word"
4763
5131
  },
4764
- children: J(d.chunks)
5132
+ children: Z(d.chunks)
4765
5133
  }
4766
5134
  ),
4767
5135
  /* @__PURE__ */ o(
@@ -4773,24 +5141,24 @@ const Pt = ({
4773
5141
  color: r.textMuted,
4774
5142
  lineHeight: 1.35
4775
5143
  },
4776
- children: k.join(" · ")
5144
+ children: h.join(" · ")
4777
5145
  }
4778
5146
  )
4779
5147
  ]
4780
5148
  }
4781
5149
  ),
4782
- c && /* @__PURE__ */ f(
5150
+ c && /* @__PURE__ */ k(
4783
5151
  "button",
4784
5152
  {
4785
5153
  type: "button",
4786
5154
  "aria-busy": p,
4787
5155
  disabled: p,
4788
5156
  onClick: async () => {
4789
- h(g);
5157
+ u(y);
4790
5158
  try {
4791
- await t(y);
5159
+ await t(b);
4792
5160
  } finally {
4793
- h(null);
5161
+ u(null);
4794
5162
  }
4795
5163
  },
4796
5164
  style: {
@@ -4823,16 +5191,16 @@ const Pt = ({
4823
5191
  )
4824
5192
  ]
4825
5193
  },
4826
- `${d.memoryId}-${u}`
5194
+ `${d.memoryId}-${m}`
4827
5195
  );
4828
5196
  })
4829
5197
  }
4830
5198
  )
4831
5199
  ] });
4832
- }, N = ({ message: e }) => {
4833
- const { colors: t } = T();
5200
+ }, O = ({ message: e }) => {
5201
+ const { colors: t } = x();
4834
5202
  return /* @__PURE__ */ o("div", { style: { paddingBlock: "16px" }, children: /* @__PURE__ */ o(
4835
- M.div,
5203
+ v.div,
4836
5204
  {
4837
5205
  initial: { opacity: 0, y: -10 },
4838
5206
  animate: { opacity: 1, y: 0 },
@@ -4856,7 +5224,7 @@ const Pt = ({
4856
5224
  }
4857
5225
  ) });
4858
5226
  };
4859
- class Dt extends Pe.Component {
5227
+ class Yt extends ze.Component {
4860
5228
  constructor(t) {
4861
5229
  super(t), this.state = { hasError: !1 };
4862
5230
  }
@@ -4875,7 +5243,7 @@ class Dt extends Pe.Component {
4875
5243
  return this.state.hasError ? null : this.props.children;
4876
5244
  }
4877
5245
  }
4878
- const Lt = ({
5246
+ const Jt = ({
4879
5247
  progressViewItems: e,
4880
5248
  loading: t,
4881
5249
  error: n,
@@ -4883,37 +5251,96 @@ const Lt = ({
4883
5251
  t: i,
4884
5252
  onSourceClick: c,
4885
5253
  onSearchResultClick: s,
4886
- onExploreQueryResultClick: h
5254
+ onExploreQueryResultClick: u,
5255
+ downloadFile: d
4887
5256
  }) => {
4888
- const { theme: d, colors: u } = T(), l = D(null);
4889
- z(() => {
5257
+ const { theme: m, colors: f } = x(), l = W(null);
5258
+ L(() => {
4890
5259
  l.current && (l.current.scrollTop = l.current.scrollHeight);
4891
5260
  }, [e.length]);
4892
- const m = (y) => {
4893
- const g = y.item.data;
4894
- if (g.taskType === "StreamingChatCompletion" && g.eventType === "Text")
4895
- return /* @__PURE__ */ o(ce, { text: g.text });
4896
- if (g.taskType === "StructuredChatCompletion" && g.eventType === "Completed")
4897
- return /* @__PURE__ */ o(zr, { data: g });
4898
- if (g.taskType === "MemoryChat")
4899
- switch (g.eventType) {
5261
+ const h = (y) => {
5262
+ const p = y.item.data;
5263
+ if (p.taskType === "StreamingChatCompletion" && p.eventType === "Text")
5264
+ return /* @__PURE__ */ o(de, { text: p.text });
5265
+ if (p.taskType === "StructuredChatCompletion" && p.eventType === "Completed")
5266
+ return /* @__PURE__ */ o(Ur, { data: p });
5267
+ if (p.taskType === "MemoryChat")
5268
+ switch (p.eventType) {
4900
5269
  case "Text":
4901
- return /* @__PURE__ */ o(ce, { text: g.text });
5270
+ return /* @__PURE__ */ o(
5271
+ de,
5272
+ {
5273
+ text: p.text,
5274
+ onFileDownload: d
5275
+ }
5276
+ );
4902
5277
  case "Thinking":
4903
5278
  return /* @__PURE__ */ o(
4904
- yt,
5279
+ Et,
5280
+ {
5281
+ data: p,
5282
+ isLatest: y.isLatest,
5283
+ durationSeconds: y.durationSeconds,
5284
+ t: i
5285
+ }
5286
+ );
5287
+ case "GenerateReportSetup":
5288
+ return /* @__PURE__ */ o(
5289
+ Mt,
5290
+ {
5291
+ data: p,
5292
+ isLatest: y.isLatest,
5293
+ durationSeconds: y.durationSeconds,
5294
+ t: i
5295
+ }
5296
+ );
5297
+ case "GenerateReportExporting":
5298
+ return /* @__PURE__ */ o(
5299
+ It,
5300
+ {
5301
+ data: p,
5302
+ isLatest: y.isLatest,
5303
+ durationSeconds: y.durationSeconds,
5304
+ t: i
5305
+ }
5306
+ );
5307
+ case "GenerateReportRunCode":
5308
+ return /* @__PURE__ */ o(
5309
+ Rt,
5310
+ {
5311
+ data: p,
5312
+ isLatest: y.isLatest,
5313
+ durationSeconds: y.durationSeconds,
5314
+ t: i
5315
+ }
5316
+ );
5317
+ case "GenerateReportRunCommand":
5318
+ return /* @__PURE__ */ o(
5319
+ Ft,
5320
+ {
5321
+ data: p,
5322
+ isLatest: y.isLatest,
5323
+ durationSeconds: y.durationSeconds,
5324
+ t: i
5325
+ }
5326
+ );
5327
+ case "GenerateReportAssembling":
5328
+ return /* @__PURE__ */ o(
5329
+ At,
4905
5330
  {
4906
- data: g,
5331
+ data: p,
4907
5332
  isLatest: y.isLatest,
4908
5333
  durationSeconds: y.durationSeconds,
4909
5334
  t: i
4910
5335
  }
4911
5336
  );
5337
+ case "GenerateReportCompleted":
5338
+ return /* @__PURE__ */ o(Bt, { data: p, t: i });
4912
5339
  case "FindMemories":
4913
5340
  return /* @__PURE__ */ o(
4914
- qr,
5341
+ tt,
4915
5342
  {
4916
- data: g,
5343
+ data: p,
4917
5344
  isLatest: y.isLatest,
4918
5345
  durationSeconds: y.durationSeconds,
4919
5346
  t: i
@@ -4921,9 +5348,9 @@ const Lt = ({
4921
5348
  );
4922
5349
  case "FindMemoriesResult":
4923
5350
  return /* @__PURE__ */ o(
4924
- Qr,
5351
+ nt,
4925
5352
  {
4926
- data: g,
5353
+ data: p,
4927
5354
  t: i
4928
5355
  }
4929
5356
  );
@@ -4931,7 +5358,7 @@ const Lt = ({
4931
5358
  return /* @__PURE__ */ o(
4932
5359
  V,
4933
5360
  {
4934
- data: g,
5361
+ data: p,
4935
5362
  isLatest: y.isLatest,
4936
5363
  durationSeconds: y.durationSeconds,
4937
5364
  t: i
@@ -4939,9 +5366,9 @@ const Lt = ({
4939
5366
  );
4940
5367
  case "SearchMemoryChunks":
4941
5368
  return /* @__PURE__ */ o(
4942
- Gr,
5369
+ rt,
4943
5370
  {
4944
- data: g,
5371
+ data: p,
4945
5372
  isLatest: y.isLatest,
4946
5373
  durationSeconds: y.durationSeconds,
4947
5374
  t: i,
@@ -4950,9 +5377,9 @@ const Lt = ({
4950
5377
  );
4951
5378
  case "FindSources":
4952
5379
  return /* @__PURE__ */ o(
4953
- Kr,
5380
+ ot,
4954
5381
  {
4955
- data: g,
5382
+ data: p,
4956
5383
  isLatest: y.isLatest,
4957
5384
  durationSeconds: y.durationSeconds,
4958
5385
  t: i
@@ -4960,18 +5387,18 @@ const Lt = ({
4960
5387
  );
4961
5388
  case "SourcesResult":
4962
5389
  return /* @__PURE__ */ o(
4963
- Xr,
5390
+ it,
4964
5391
  {
4965
- data: g,
5392
+ data: p,
4966
5393
  onSourceClick: c,
4967
5394
  t: i
4968
5395
  }
4969
5396
  );
4970
5397
  case "ExploreMemories":
4971
5398
  return /* @__PURE__ */ o(
4972
- et,
5399
+ dt,
4973
5400
  {
4974
- data: g,
5401
+ data: p,
4975
5402
  completed: y.completed,
4976
5403
  isLatest: y.isLatest,
4977
5404
  t: i
@@ -4981,16 +5408,16 @@ const Lt = ({
4981
5408
  return /* @__PURE__ */ o(
4982
5409
  we,
4983
5410
  {
4984
- data: g,
5411
+ data: p,
4985
5412
  onSearchResultClick: s,
4986
5413
  t: i
4987
5414
  }
4988
5415
  );
4989
5416
  case "GoogleSearch":
4990
5417
  return /* @__PURE__ */ o(
4991
- at,
5418
+ gt,
4992
5419
  {
4993
- data: g,
5420
+ data: p,
4994
5421
  isLatest: y.isLatest,
4995
5422
  durationSeconds: y.durationSeconds,
4996
5423
  t: i
@@ -4998,9 +5425,9 @@ const Lt = ({
4998
5425
  );
4999
5426
  case "ScrapeWebsites":
5000
5427
  return /* @__PURE__ */ o(
5001
- gt,
5428
+ wt,
5002
5429
  {
5003
- data: g,
5430
+ data: p,
5004
5431
  isLatest: y.isLatest,
5005
5432
  durationSeconds: y.durationSeconds,
5006
5433
  t: i
@@ -5009,21 +5436,21 @@ const Lt = ({
5009
5436
  case "Completed":
5010
5437
  return null;
5011
5438
  default: {
5012
- const p = g;
5013
- return p.eventType === "Error" && "message" in p ? /* @__PURE__ */ o(N, { message: p.message }) : (console.warn(
5439
+ const g = p;
5440
+ return g.eventType === "Error" && "message" in g ? /* @__PURE__ */ o(O, { message: g.message }) : (console.warn(
5014
5441
  "[fency] Unknown MemoryChat eventType (no UI):",
5015
- p.eventType,
5016
- p
5442
+ g.eventType,
5443
+ g
5017
5444
  ), null);
5018
5445
  }
5019
5446
  }
5020
- if (g.taskType === "MemorySearch")
5021
- switch (g.eventType) {
5447
+ if (p.taskType === "MemorySearch")
5448
+ switch (p.eventType) {
5022
5449
  case "GeneratingQueries":
5023
5450
  return /* @__PURE__ */ o(
5024
- Et,
5451
+ Ht,
5025
5452
  {
5026
- data: g,
5453
+ data: p,
5027
5454
  isLatest: y.isLatest,
5028
5455
  durationSeconds: y.durationSeconds,
5029
5456
  t: i
@@ -5031,20 +5458,20 @@ const Lt = ({
5031
5458
  );
5032
5459
  case "ExploreQueries":
5033
5460
  return /* @__PURE__ */ o(
5034
- Pt,
5461
+ Xt,
5035
5462
  {
5036
- data: g,
5463
+ data: p,
5037
5464
  isLatest: y.isLatest,
5038
5465
  durationSeconds: y.durationSeconds,
5039
- onExploreQueryResultClick: h,
5466
+ onExploreQueryResultClick: u,
5040
5467
  t: i
5041
5468
  }
5042
5469
  );
5043
5470
  case "SearchMemoryTypes":
5044
5471
  return /* @__PURE__ */ o(
5045
- St,
5472
+ zt,
5046
5473
  {
5047
- data: g,
5474
+ data: p,
5048
5475
  isLatest: y.isLatest,
5049
5476
  durationSeconds: y.durationSeconds,
5050
5477
  t: i
@@ -5052,85 +5479,87 @@ const Lt = ({
5052
5479
  );
5053
5480
  case "Completed":
5054
5481
  return /* @__PURE__ */ o(
5055
- zt,
5482
+ Vt,
5056
5483
  {
5057
- data: g,
5484
+ data: p,
5058
5485
  onSearchResultClick: s,
5059
5486
  t: i
5060
5487
  }
5061
5488
  );
5062
5489
  default: {
5063
- const p = g;
5064
- return p.eventType === "Error" && "message" in p ? /* @__PURE__ */ o(N, { message: p.message }) : (console.warn(
5490
+ const g = p;
5491
+ return g.eventType === "Error" && "message" in g ? /* @__PURE__ */ o(O, { message: g.message }) : (console.warn(
5065
5492
  "[fency] Unknown MemorySearch eventType (no UI):",
5066
- p.eventType,
5067
- p
5493
+ g.eventType,
5494
+ g
5068
5495
  ), null);
5069
5496
  }
5070
5497
  }
5071
- return g.taskType === "StreamingChatCompletion" && g.eventType === "Completed" ? null : g.eventType === "Error" && "message" in g ? /* @__PURE__ */ o(N, { message: g.message }) : null;
5498
+ return p.taskType === "StreamingChatCompletion" && p.eventType === "Completed" ? null : p.eventType === "Error" && "message" in p ? /* @__PURE__ */ o(O, { message: p.message }) : null;
5072
5499
  };
5073
5500
  if (e.length === 0)
5074
- return n ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(N, { message: n.message }) }) : t ? /* @__PURE__ */ o("div", { style: { width: "fit-content", paddingBlock: "16px" }, children: /* @__PURE__ */ o(
5075
- F,
5501
+ return n ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(O, { message: n.message }) }) : t ? /* @__PURE__ */ o("div", { style: { width: "fit-content", paddingBlock: "16px" }, children: /* @__PURE__ */ o(
5502
+ R,
5076
5503
  {
5077
5504
  text: r ?? i.processingYourTask,
5078
5505
  duration: 1.5,
5079
5506
  repeat: !0,
5080
5507
  repeatDelay: 0,
5081
- color: u.shimmerBase,
5082
- shimmerColor: u.shimmerHighlight
5508
+ color: f.shimmerBase,
5509
+ shimmerColor: f.shimmerHighlight
5083
5510
  }
5084
5511
  ) }) : null;
5085
- const k = e.filter((y, g) => {
5086
- const p = y.item.data;
5087
- return p.taskType === "MemoryChat" && p.eventType === "ExploreMemories" ? !e.slice(g + 1).some(
5088
- (w) => w.item.data.taskType === "MemoryChat" && w.item.data.eventType === "ExploreMemories"
5089
- ) : p.taskType === "MemorySearch" && p.eventType === "GeneratingQueries" ? !e.slice(g + 1).some(
5090
- (w) => w.item.data.taskType === "MemorySearch" && w.item.data.eventType === "GeneratingQueries"
5091
- ) : p.taskType === "MemorySearch" && p.eventType === "ExploreQueries" ? !e.slice(g + 1).some(
5092
- (w) => w.item.data.taskType === "MemorySearch" && w.item.data.eventType === "ExploreQueries"
5093
- ) : p.taskType === "MemoryChat" && p.eventType === "GoogleSearch" ? !e.slice(g + 1).some(
5094
- (w) => w.item.data.taskType === "MemoryChat" && w.item.data.eventType === "GoogleSearch"
5095
- ) : p.taskType === "MemoryChat" && p.eventType === "Thinking" ? !e.slice(g + 1).some(
5096
- (w) => w.item.data.taskType === "MemoryChat" && w.item.data.eventType === "Thinking"
5097
- ) : p.taskType === "MemoryChat" && p.eventType === "ScrapeWebsites" ? !e.slice(g + 1).some(
5098
- (w) => w.item.data.taskType === "MemoryChat" && w.item.data.eventType === "ScrapeWebsites"
5512
+ const b = e.filter((y, p) => {
5513
+ const g = y.item.data;
5514
+ return g.taskType === "MemoryChat" && g.eventType === "ExploreMemories" ? !e.slice(p + 1).some(
5515
+ (F) => F.item.data.taskType === "MemoryChat" && F.item.data.eventType === "ExploreMemories"
5516
+ ) : g.taskType === "MemorySearch" && g.eventType === "GeneratingQueries" ? !e.slice(p + 1).some(
5517
+ (F) => F.item.data.taskType === "MemorySearch" && F.item.data.eventType === "GeneratingQueries"
5518
+ ) : g.taskType === "MemorySearch" && g.eventType === "ExploreQueries" ? !e.slice(p + 1).some(
5519
+ (F) => F.item.data.taskType === "MemorySearch" && F.item.data.eventType === "ExploreQueries"
5520
+ ) : g.taskType === "MemoryChat" && g.eventType === "GoogleSearch" ? !e.slice(p + 1).some(
5521
+ (F) => F.item.data.taskType === "MemoryChat" && F.item.data.eventType === "GoogleSearch"
5522
+ ) : g.taskType === "MemoryChat" && g.eventType === "Thinking" ? !e.slice(p + 1).some(
5523
+ (F) => F.item.data.taskType === "MemoryChat" && F.item.data.eventType === "Thinking"
5524
+ ) : g.taskType === "MemoryChat" && g.eventType === "GenerateReportExporting" ? !e.slice(p + 1).some(
5525
+ (F) => F.item.data.taskType === "MemoryChat" && F.item.data.eventType === "GenerateReportExporting"
5526
+ ) : g.taskType === "MemoryChat" && g.eventType === "ScrapeWebsites" ? !e.slice(p + 1).some(
5527
+ (F) => F.item.data.taskType === "MemoryChat" && F.item.data.eventType === "ScrapeWebsites"
5099
5528
  ) : !0;
5100
5529
  });
5101
- return /* @__PURE__ */ f(
5530
+ return /* @__PURE__ */ k(
5102
5531
  "div",
5103
5532
  {
5104
5533
  id: "agent-task-progress-verbose",
5105
5534
  ref: l,
5106
- "data-theme": d,
5535
+ "data-theme": m,
5107
5536
  children: [
5108
- /* @__PURE__ */ o(De, { children: k.map((y, g) => /* @__PURE__ */ o(
5109
- M.div,
5537
+ /* @__PURE__ */ o(je, { children: b.map((y, p) => /* @__PURE__ */ o(
5538
+ v.div,
5110
5539
  {
5111
5540
  id: `agent-task-progress-item-${y.item.progressItemId}`,
5112
5541
  initial: { opacity: 0, y: -20 },
5113
5542
  animate: { opacity: 1, y: 0 },
5114
5543
  transition: {
5115
5544
  duration: 0.4,
5116
- delay: g * 0.1,
5545
+ delay: p * 0.1,
5117
5546
  ease: "easeOut"
5118
5547
  },
5119
5548
  children: /* @__PURE__ */ o(
5120
- Dt,
5549
+ Yt,
5121
5550
  {
5122
5551
  progressItemId: y.item.progressItemId,
5123
- children: m(y)
5552
+ children: h(y)
5124
5553
  }
5125
5554
  )
5126
5555
  },
5127
5556
  y.item.progressItemId
5128
5557
  )) }),
5129
- n ? /* @__PURE__ */ o("div", { style: { marginTop: 8 }, children: /* @__PURE__ */ o(N, { message: n.message }) }) : null
5558
+ n ? /* @__PURE__ */ o("div", { style: { marginTop: 8 }, children: /* @__PURE__ */ o(O, { message: n.message }) }) : null
5130
5559
  ]
5131
5560
  }
5132
5561
  );
5133
- }, Qt = ({
5562
+ }, dn = ({
5134
5563
  agentTask: e,
5135
5564
  theme: t = "light",
5136
5565
  language: n,
@@ -5138,9 +5567,9 @@ const Lt = ({
5138
5567
  onSearchResultClick: i,
5139
5568
  onExploreQueryResultClick: c
5140
5569
  }) => {
5141
- const s = Rr(e), h = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : n ?? "en", d = Lr(h);
5142
- return /* @__PURE__ */ o(Pr, { theme: t, children: /* @__PURE__ */ o(
5143
- Lt,
5570
+ const s = Nr(e), u = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : n ?? "en", d = qr(u);
5571
+ return /* @__PURE__ */ o(Hr, { theme: t, children: /* @__PURE__ */ o(
5572
+ Jt,
5144
5573
  {
5145
5574
  progressViewItems: s,
5146
5575
  loading: e.loading,
@@ -5149,21 +5578,22 @@ const Lt = ({
5149
5578
  t: d,
5150
5579
  onSourceClick: r,
5151
5580
  onSearchResultClick: i,
5152
- onExploreQueryResultClick: c
5581
+ onExploreQueryResultClick: c,
5582
+ downloadFile: e.downloadFile
5153
5583
  }
5154
5584
  ) });
5155
5585
  };
5156
5586
  export {
5157
- Qt as AgentTaskProgress,
5158
- Pr as AgentTaskThemeProvider,
5159
- L as Checkmark,
5160
- Gt as FencyProvider,
5161
- zt as MemorySearchCompletedResults,
5162
- Qe as StreamEventManager,
5163
- $ as XMark,
5164
- Br as darkAgentTaskThemeColors,
5165
- Te as getAgentTaskPrismStyle,
5166
- Se as lightAgentTaskThemeColors,
5167
- T as useAgentTaskTheme,
5168
- qt as useAgentTasks
5587
+ dn as AgentTaskProgress,
5588
+ Hr as AgentTaskThemeProvider,
5589
+ j as Checkmark,
5590
+ ln as FencyProvider,
5591
+ Vt as MemorySearchCompletedResults,
5592
+ Ve as StreamEventManager,
5593
+ G as XMark,
5594
+ Gr as darkAgentTaskThemeColors,
5595
+ ve as getAgentTaskPrismStyle,
5596
+ xe as lightAgentTaskThemeColors,
5597
+ x as useAgentTaskTheme,
5598
+ cn as useAgentTasks
5169
5599
  };