@fencyai/react 0.1.173 → 0.1.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,74 +1,74 @@
1
- import { jsxs as h, jsx as o, Fragment as E } from "react/jsx-runtime";
2
- import { createStream as ce, isStreamTimeoutEvent as de, isStreamNotFoundEvent as me, isAgentTaskProgressItemUpdatedEvent as ue, createAgentTask as ye } from "@fencyai/js";
3
- import { createContext as ge, useState as I, useRef as F, useEffect as A, useCallback as O, useContext as he, useMemo as B } from "react";
4
- import { motion as C, useInView as pe, AnimatePresence as fe } from "motion/react";
5
- import Se from "react-markdown";
6
- import { Prism as oe } from "react-syntax-highlighter";
7
- import xe from "remark-gfm";
8
- import './assets/index.css';const ie = ge(
1
+ import { jsxs as y, jsx as o, Fragment as E } from "react/jsx-runtime";
2
+ import { createStream as ue, isStreamTimeoutEvent as me, isStreamNotFoundEvent as pe, isAgentTaskProgressItemUpdatedEvent as ye, createAgentTask as ge } from "@fencyai/js";
3
+ import { createContext as he, useState as I, useRef as A, useEffect as F, useCallback as z, useContext as fe, useMemo as P } from "react";
4
+ import { motion as C, useInView as Se, AnimatePresence as xe } from "motion/react";
5
+ import ke from "react-markdown";
6
+ import { Prism as ae } from "react-syntax-highlighter";
7
+ import be from "remark-gfm";
8
+ import './assets/index.css';const se = he(
9
9
  void 0
10
10
  );
11
- async function ke(e, r) {
11
+ async function ve(e, r) {
12
12
  const t = e.getReader();
13
13
  let n;
14
14
  for (; !(n = await t.read()).done; )
15
15
  r(n.value);
16
16
  }
17
- function be(e) {
17
+ function Te(e) {
18
18
  let r, t, n, i = !1;
19
19
  return function(a) {
20
- r === void 0 ? (r = a, t = 0, n = -1) : r = Te(r, a);
21
- const c = r.length;
22
- let u = 0;
23
- for (; t < c; ) {
24
- i && (r[t] === 10 && (u = ++t), i = !1);
25
- let y = -1;
26
- for (; t < c && y === -1; ++t)
20
+ r === void 0 ? (r = a, t = 0, n = -1) : r = Ce(r, a);
21
+ const s = r.length;
22
+ let m = 0;
23
+ for (; t < s; ) {
24
+ i && (r[t] === 10 && (m = ++t), i = !1);
25
+ let p = -1;
26
+ for (; t < s && p === -1; ++t)
27
27
  switch (r[t]) {
28
28
  case 58:
29
- n === -1 && (n = t - u);
29
+ n === -1 && (n = t - m);
30
30
  break;
31
31
  case 13:
32
32
  i = !0;
33
33
  case 10:
34
- y = t;
34
+ p = t;
35
35
  break;
36
36
  }
37
- if (y === -1)
37
+ if (p === -1)
38
38
  break;
39
- e(r.subarray(u, y), n), u = t, n = -1;
39
+ e(r.subarray(m, p), n), m = t, n = -1;
40
40
  }
41
- u === c ? r = void 0 : u !== 0 && (r = r.subarray(u), t -= u);
41
+ m === s ? r = void 0 : m !== 0 && (r = r.subarray(m), t -= m);
42
42
  };
43
43
  }
44
- function ve(e, r, t) {
44
+ function we(e, r, t) {
45
45
  let n = J();
46
46
  const i = new TextDecoder();
47
- return function(a, c) {
47
+ return function(a, s) {
48
48
  if (a.length === 0)
49
49
  t == null || t(n), n = J();
50
- else if (c > 0) {
51
- const u = i.decode(a.subarray(0, c)), y = c + (a[c + 1] === 32 ? 2 : 1), s = i.decode(a.subarray(y));
52
- switch (u) {
50
+ else if (s > 0) {
51
+ const m = i.decode(a.subarray(0, s)), p = s + (a[s + 1] === 32 ? 2 : 1), c = i.decode(a.subarray(p));
52
+ switch (m) {
53
53
  case "data":
54
54
  n.data = n.data ? n.data + `
55
- ` + s : s;
55
+ ` + c : c;
56
56
  break;
57
57
  case "event":
58
- n.event = s;
58
+ n.event = c;
59
59
  break;
60
60
  case "id":
61
- e(n.id = s);
61
+ e(n.id = c);
62
62
  break;
63
63
  case "retry":
64
- const d = parseInt(s, 10);
64
+ const d = parseInt(c, 10);
65
65
  isNaN(d) || r(n.retry = d);
66
66
  break;
67
67
  }
68
68
  }
69
69
  };
70
70
  }
71
- function Te(e, r) {
71
+ function Ce(e, r) {
72
72
  const t = new Uint8Array(e.length + r.length);
73
73
  return t.set(e), t.set(r, e.length), t;
74
74
  }
@@ -80,7 +80,7 @@ function J() {
80
80
  retry: void 0
81
81
  };
82
82
  }
83
- var we = function(e, r) {
83
+ var Ie = function(e, r) {
84
84
  var t = {};
85
85
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
86
86
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
@@ -88,52 +88,52 @@ var we = function(e, r) {
88
88
  r.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (t[n[i]] = e[n[i]]);
89
89
  return t;
90
90
  };
91
- const z = "text/event-stream", Ie = 1e3, Y = "last-event-id";
92
- function Ce(e, r) {
93
- var { signal: t, headers: n, onopen: i, onmessage: l, onclose: a, onerror: c, openWhenHidden: u, fetch: y } = r, s = we(r, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
94
- return new Promise((d, m) => {
91
+ const O = "text/event-stream", Ee = 1e3, Y = "last-event-id";
92
+ function Me(e, r) {
93
+ var { signal: t, headers: n, onopen: i, onmessage: l, onclose: a, onerror: s, openWhenHidden: m, fetch: p } = r, c = Ie(r, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
94
+ return new Promise((d, u) => {
95
95
  const g = Object.assign({}, n);
96
- g.accept || (g.accept = z);
97
- let p;
96
+ g.accept || (g.accept = O);
97
+ let h;
98
98
  function f() {
99
- p.abort(), document.hidden || T();
99
+ h.abort(), document.hidden || x();
100
100
  }
101
- u || document.addEventListener("visibilitychange", f);
102
- let x = Ie, k = 0;
103
- function b() {
104
- document.removeEventListener("visibilitychange", f), window.clearTimeout(k), p.abort();
101
+ m || document.addEventListener("visibilitychange", f);
102
+ let k = Ee, b = 0;
103
+ function v() {
104
+ document.removeEventListener("visibilitychange", f), window.clearTimeout(b), h.abort();
105
105
  }
106
106
  t == null || t.addEventListener("abort", () => {
107
- b(), d();
107
+ v(), d();
108
108
  });
109
- const S = y ?? window.fetch, w = i ?? Ee;
110
- async function T() {
111
- var L;
112
- p = new AbortController();
109
+ const T = p ?? window.fetch, w = i ?? Re;
110
+ async function x() {
111
+ var D;
112
+ h = new AbortController();
113
113
  try {
114
- const P = await S(e, Object.assign(Object.assign({}, s), { headers: g, signal: p.signal }));
115
- await w(P), await ke(P.body, be(ve((R) => {
114
+ const W = await T(e, Object.assign(Object.assign({}, c), { headers: g, signal: h.signal }));
115
+ await w(W), await ve(W.body, Te(we((R) => {
116
116
  R ? g[Y] = R : delete g[Y];
117
117
  }, (R) => {
118
- x = R;
119
- }, l))), a == null || a(), b(), d();
120
- } catch (P) {
121
- if (!p.signal.aborted)
118
+ k = R;
119
+ }, l))), a == null || a(), v(), d();
120
+ } catch (W) {
121
+ if (!h.signal.aborted)
122
122
  try {
123
- const R = (L = c == null ? void 0 : c(P)) !== null && L !== void 0 ? L : x;
124
- window.clearTimeout(k), k = window.setTimeout(T, R);
123
+ const R = (D = s == null ? void 0 : s(W)) !== null && D !== void 0 ? D : k;
124
+ window.clearTimeout(b), b = window.setTimeout(x, R);
125
125
  } catch (R) {
126
- b(), m(R);
126
+ v(), u(R);
127
127
  }
128
128
  }
129
129
  }
130
- T();
130
+ x();
131
131
  });
132
132
  }
133
- function Ee(e) {
133
+ function Re(e) {
134
134
  const r = e.headers.get("content-type");
135
- if (!(r != null && r.startsWith(z)))
136
- throw new Error(`Expected content-type to be ${z}, Actual: ${r}`);
135
+ if (!(r != null && r.startsWith(O)))
136
+ throw new Error(`Expected content-type to be ${O}, Actual: ${r}`);
137
137
  }
138
138
  function Z(e) {
139
139
  const r = atob(e), t = new Uint8Array(r.length);
@@ -141,7 +141,7 @@ function Z(e) {
141
141
  t[n] = r.charCodeAt(n);
142
142
  return new TextDecoder("utf-8").decode(t);
143
143
  }
144
- function Me() {
144
+ function Fe() {
145
145
  return `
146
146
  var connections = new Map();
147
147
 
@@ -290,7 +290,7 @@ self.onmessage = function (e) {
290
290
  function ee(e) {
291
291
  return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown stream error";
292
292
  }
293
- class Re {
293
+ class Ae {
294
294
  constructor(r) {
295
295
  this.activeConnections = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.worker = null, this.workerBlobUrl = null, this.workerSupported = !1, this.fency = r, this.tryInitWorker();
296
296
  }
@@ -298,7 +298,7 @@ class Re {
298
298
  try {
299
299
  if (typeof Worker > "u" || typeof Blob > "u" || typeof URL > "u" || typeof URL.createObjectURL != "function" || typeof ReadableStream > "u")
300
300
  return;
301
- const r = Me(), t = new Blob([r], { type: "application/javascript" }), n = URL.createObjectURL(t), i = new Worker(n);
301
+ const r = Fe(), t = new Blob([r], { type: "application/javascript" }), n = URL.createObjectURL(t), i = new Worker(n);
302
302
  i.onmessage = (l) => {
303
303
  this.handleWorkerMessage(l.data);
304
304
  }, i.onerror = (l) => {
@@ -342,7 +342,7 @@ class Re {
342
342
  }
343
343
  connectStreamInWorker(r) {
344
344
  const t = r.stream.id, n = `${this.fency.baseUrl}/sse/streams/${t}`, i = new AbortController(), l = {
345
- accept: z,
345
+ accept: O,
346
346
  "X-Fency-Publishable-Key": this.fency.publishableKey,
347
347
  "X-Fency-Stream-Token": r.stream.token
348
348
  };
@@ -356,36 +356,36 @@ class Re {
356
356
  async startWorkerStream(r, t, n, i) {
357
357
  const l = this.worker;
358
358
  if (!l) return;
359
- const a = (c) => {
360
- i.signal.aborted || (this.activeConnections.delete(r), this.broadcastError(r, c));
359
+ const a = (s) => {
360
+ i.signal.aborted || (this.activeConnections.delete(r), this.broadcastError(r, s));
361
361
  };
362
362
  try {
363
- const c = await fetch(t, {
363
+ const s = await fetch(t, {
364
364
  method: "GET",
365
365
  headers: n,
366
366
  signal: i.signal
367
367
  });
368
- if (!c.ok) {
369
- c.status >= 400 && c.status < 500 && c.status !== 429 ? a(`Client error ${c.status}`) : a(`HTTP ${c.status}`);
368
+ if (!s.ok) {
369
+ s.status >= 400 && s.status < 500 && s.status !== 429 ? a(`Client error ${s.status}`) : a(`HTTP ${s.status}`);
370
370
  return;
371
371
  }
372
- const u = c.body;
373
- if (!u) {
372
+ const m = s.body;
373
+ if (!m) {
374
374
  a("No response body");
375
375
  return;
376
376
  }
377
377
  if (!this.activeConnections.has(r)) {
378
- await u.cancel().catch(() => {
378
+ await m.cancel().catch(() => {
379
379
  });
380
380
  return;
381
381
  }
382
382
  l.postMessage(
383
- { command: "start", streamId: r, readableStream: u },
384
- [u]
383
+ { command: "start", streamId: r, readableStream: m },
384
+ [m]
385
385
  );
386
- } catch (c) {
386
+ } catch (s) {
387
387
  if (i.signal.aborted) return;
388
- a(ee(c));
388
+ a(ee(s));
389
389
  }
390
390
  }
391
391
  connectStreamOnMainThread(r) {
@@ -397,7 +397,7 @@ class Re {
397
397
  "X-Fency-Publishable-Key": this.fency.publishableKey,
398
398
  "X-Fency-Stream-Token": r.stream.token
399
399
  };
400
- Ce(i, {
400
+ Me(i, {
401
401
  headers: l,
402
402
  signal: n.signal,
403
403
  openWhenHidden: !0,
@@ -407,8 +407,8 @@ class Re {
407
407
  },
408
408
  onmessage: (a) => {
409
409
  if (a.data) {
410
- const c = Z(a.data);
411
- this.broadcast(c, t);
410
+ const s = Z(a.data);
411
+ this.broadcast(s, t);
412
412
  }
413
413
  },
414
414
  onerror: (a) => {
@@ -451,99 +451,99 @@ class Re {
451
451
  this.workerBlobUrl && (URL.revokeObjectURL(this.workerBlobUrl), this.workerBlobUrl = null), this.workerSupported = !1, this.subscribers.clear();
452
452
  }
453
453
  }
454
- const Ae = 48e4, Fe = 3e5, re = (e) => {
454
+ const Le = 48e4, Pe = 3e5, re = (e) => {
455
455
  const r = Date.now();
456
- return e.filter((t) => r - t.createdAt < Ae);
456
+ return e.filter((t) => r - t.createdAt < Le);
457
457
  };
458
- function Lr({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
458
+ function Ur({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
459
459
  const [n, i] = I(
460
460
  null
461
- ), [l, a] = I(!0), [c, u] = I(null), [y, s] = I([]), d = F(null), m = F(null);
462
- A(() => {
463
- e.then((x) => {
464
- i(x), a(!1);
465
- }).catch((x) => {
466
- u(x), a(!1);
461
+ ), [l, a] = I(!0), [s, m] = I(null), [p, c] = I([]), d = A(null), u = A(null);
462
+ F(() => {
463
+ e.then((k) => {
464
+ i(k), a(!1);
465
+ }).catch((k) => {
466
+ m(k), a(!1);
467
467
  });
468
- }, [e]), A(() => {
469
- n && !m.current && (m.current = new Re(n));
470
- }, [n]), A(() => {
471
- m.current && m.current.updateStreams(y);
472
- }, [y]), A(() => () => {
473
- var x;
474
- (x = m.current) == null || x.cleanup();
475
- }, []), A(() => {
476
- const x = setInterval(() => {
477
- s((k) => {
478
- const b = re(k);
479
- return b.length !== k.length ? b : k;
468
+ }, [e]), F(() => {
469
+ n && !u.current && (u.current = new Ae(n));
470
+ }, [n]), F(() => {
471
+ u.current && u.current.updateStreams(p);
472
+ }, [p]), F(() => () => {
473
+ var k;
474
+ (k = u.current) == null || k.cleanup();
475
+ }, []), F(() => {
476
+ const k = setInterval(() => {
477
+ c((b) => {
478
+ const v = re(b);
479
+ return v.length !== b.length ? v : b;
480
480
  });
481
481
  }, 6e4);
482
- return () => clearInterval(x);
482
+ return () => clearInterval(k);
483
483
  }, []);
484
- const g = O(
485
- async (x = Fe) => {
484
+ const g = z(
485
+ async (k = Pe) => {
486
486
  if (d.current)
487
487
  return d.current;
488
- const k = Date.now(), b = y.length > 0 ? y[y.length - 1] : null;
489
- if (b && k - b.createdAt < x)
490
- return b.stream;
491
- const S = (async () => {
488
+ const b = Date.now(), v = p.length > 0 ? p[p.length - 1] : null;
489
+ if (v && b - v.createdAt < k)
490
+ return v.stream;
491
+ const T = (async () => {
492
492
  if (!n)
493
493
  throw new Error("Fency instance not initialized");
494
- const w = await r(), T = await ce({
494
+ const w = await r(), x = await ue({
495
495
  pk: n.publishableKey,
496
496
  baseUrl: n.baseUrl,
497
497
  clientToken: (w == null ? void 0 : w.clientToken) ?? ""
498
498
  });
499
- if (T.type === "success") {
500
- const L = {
501
- stream: T.stream,
499
+ if (x.type === "success") {
500
+ const D = {
501
+ stream: x.stream,
502
502
  createdAt: Date.now()
503
503
  };
504
- return s((P) => {
505
- const R = [...P, L];
504
+ return c((W) => {
505
+ const R = [...W, D];
506
506
  return re(R);
507
- }), d.current = null, T.stream;
507
+ }), d.current = null, x.stream;
508
508
  } else
509
509
  throw d.current = null, new Error("Failed to create stream");
510
510
  })();
511
- return d.current = S, S;
511
+ return d.current = T, T;
512
512
  },
513
- [n, y]
513
+ [n, p]
514
514
  );
515
- if (c)
516
- return /* @__PURE__ */ h("div", { children: [
515
+ if (s)
516
+ return /* @__PURE__ */ y("div", { children: [
517
517
  "Fency error: ",
518
- c.message
518
+ s.message
519
519
  ] });
520
520
  if (!n)
521
521
  return null;
522
- const p = y.length > 0 ? y[y.length - 1] : null, f = {
522
+ const h = p.length > 0 ? p[p.length - 1] : null, f = {
523
523
  fency: n,
524
524
  loading: l,
525
- error: c,
526
- activeStreams: y,
527
- latestStream: p,
528
- eventManager: m.current,
525
+ error: s,
526
+ activeStreams: p,
527
+ latestStream: h,
528
+ eventManager: u.current,
529
529
  getOrCreateStream: g
530
530
  };
531
- return /* @__PURE__ */ o(ie.Provider, { value: f, children: t });
531
+ return /* @__PURE__ */ o(se.Provider, { value: f, children: t });
532
532
  }
533
- function ae() {
534
- const e = he(ie);
533
+ function le() {
534
+ const e = fe(se);
535
535
  if (e === void 0)
536
536
  throw new Error("useFencyContext must be used within a FencyProvider");
537
537
  return e;
538
538
  }
539
- const Le = (e) => {
539
+ const De = (e) => {
540
540
  try {
541
541
  const r = JSON.parse(e);
542
- return Pe(r);
542
+ return We(r);
543
543
  } catch (r) {
544
544
  return console.error("Error parsing message:", r), null;
545
545
  }
546
- }, Pe = (e) => de(e) ? De(e) : me(e) ? Be(e) : ue(e) ? Oe(e) : null, De = (e) => ({
546
+ }, We = (e) => me(e) ? ze(e) : pe(e) ? Be(e) : ye(e) ? Oe(e) : null, ze = (e) => ({
547
547
  type: "STREAM_TIMEOUT",
548
548
  streamId: e.streamId,
549
549
  timestamp: e.timestamp
@@ -559,34 +559,34 @@ const Le = (e) => {
559
559
  timestamp: e.timestamp,
560
560
  createdAt: e.createdAt,
561
561
  data: JSON.parse(e.data)
562
- }), We = (e) => {
563
- const r = ae(), [t, n] = I(null), i = F(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
564
- return A(() => {
562
+ }), $e = (e) => {
563
+ const r = le(), [t, n] = I(null), i = A(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
564
+ return F(() => {
565
565
  if (!r.eventManager) return;
566
566
  const a = {
567
- onMessage: (u, y) => {
568
- var d, m, g;
569
- const s = Le(u);
570
- if (s)
571
- switch (s.type) {
567
+ onMessage: (m, p) => {
568
+ var d, u, g;
569
+ const c = De(m);
570
+ if (c)
571
+ switch (c.type) {
572
572
  case "STREAM_TIMEOUT":
573
- (d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e, s);
573
+ (d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e, c);
574
574
  break;
575
575
  case "STREAM_NOT_FOUND":
576
- (m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e, s);
576
+ (u = e == null ? void 0 : e.onStreamNotFound) == null || u.call(e, c);
577
577
  break;
578
578
  case "AGENT_TASK_PROGRESS_ITEM_UPDATED":
579
- (g = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || g.call(e, s);
579
+ (g = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || g.call(e, c);
580
580
  break;
581
581
  }
582
582
  },
583
- onError: (u, y) => {
584
- var s;
585
- (s = e == null ? void 0 : e.onStreamError) == null || s.call(e, {
586
- streamId: u,
583
+ onError: (m, p) => {
584
+ var c;
585
+ (c = e == null ? void 0 : e.onStreamError) == null || c.call(e, {
586
+ streamId: m,
587
587
  error: {
588
588
  code: "UnknownError",
589
- message: y ?? "Unknown error in useStream"
589
+ message: p ?? "Unknown error in useStream"
590
590
  }
591
591
  });
592
592
  }
@@ -615,200 +615,200 @@ const Le = (e) => {
615
615
  },
616
616
  stream: t
617
617
  };
618
- }, Pr = (e) => {
619
- const r = ae(), [t, n] = I([]), i = F(/* @__PURE__ */ new Set()), l = F(/* @__PURE__ */ new Map()), a = O(
620
- (s, d) => {
621
- n((m) => {
622
- const g = [], p = m.map((f) => {
623
- var k;
624
- if (f.streamId !== s || !f.loading) return f;
625
- const x = (k = f.confirmedData) == null ? void 0 : k.taskId;
626
- return x && g.push(x), { ...f, loading: !1, error: d };
618
+ }, _r = (e) => {
619
+ const r = le(), [t, n] = I([]), i = A(/* @__PURE__ */ new Set()), l = A(/* @__PURE__ */ new Map()), a = z(
620
+ (c, d) => {
621
+ n((u) => {
622
+ const g = [], h = u.map((f) => {
623
+ var b;
624
+ if (f.streamId !== c || !f.loading) return f;
625
+ const k = (b = f.confirmedData) == null ? void 0 : b.taskId;
626
+ return k && g.push(k), { ...f, loading: !1, error: d };
627
627
  });
628
628
  for (const f of g) {
629
629
  i.current.delete(f);
630
- const x = l.current.get(f);
631
- x && (l.current.delete(f), x({ type: "error", error: d }));
630
+ const k = l.current.get(f);
631
+ k && (l.current.delete(f), k({ type: "error", error: d }));
632
632
  }
633
- return p;
633
+ return h;
634
634
  });
635
635
  },
636
636
  []
637
- ), { createStream: c } = We({
638
- onAgentTaskProgressItemUpdated: (s) => {
637
+ ), { createStream: s } = $e({
638
+ onAgentTaskProgressItemUpdated: (c) => {
639
639
  var g;
640
- if (!i.current.has(s.agentTaskId)) return;
641
- const d = s.data;
640
+ if (!i.current.has(c.agentTaskId)) return;
641
+ const d = c.data;
642
642
  if (d.taskType === "StreamingChatCompletion" && d.eventType === "Completed" || d.taskType === "StructuredChatCompletion" && d.eventType === "Completed" || d.taskType === "MemoryChat" && d.eventType === "Completed" || d.taskType === "MemorySearch" && d.eventType === "Completed") {
643
- const p = d.taskType === "MemorySearch" && d.eventType === "Completed" || d.taskType === "StructuredChatCompletion" && d.eventType === "Completed";
643
+ const h = d.taskType === "MemorySearch" && d.eventType === "Completed" || d.taskType === "StructuredChatCompletion" && d.eventType === "Completed";
644
644
  n(
645
- p ? (x) => x.map((k) => {
645
+ h ? (k) => k.map((b) => {
646
646
  var w;
647
- if (((w = k.confirmedData) == null ? void 0 : w.taskId) !== s.agentTaskId)
648
- return k;
649
- const S = k.progressItems.some(
650
- (T) => T.progressItemId === s.progressItemId
651
- ) ? k.progressItems.map(
652
- (T) => T.progressItemId === s.progressItemId ? s : T
653
- ) : [...k.progressItems, s];
647
+ if (((w = b.confirmedData) == null ? void 0 : w.taskId) !== c.agentTaskId)
648
+ return b;
649
+ const T = b.progressItems.some(
650
+ (x) => x.progressItemId === c.progressItemId
651
+ ) ? b.progressItems.map(
652
+ (x) => x.progressItemId === c.progressItemId ? c : x
653
+ ) : [...b.progressItems, c];
654
654
  return {
655
- ...k,
656
- progressItems: S,
655
+ ...b,
656
+ progressItems: T,
657
657
  loading: !1
658
658
  };
659
- }) : (x) => x.map(
660
- (k) => {
661
- var b;
662
- return ((b = k.confirmedData) == null ? void 0 : b.taskId) === s.agentTaskId ? { ...k, loading: !1 } : k;
659
+ }) : (k) => k.map(
660
+ (b) => {
661
+ var v;
662
+ return ((v = b.confirmedData) == null ? void 0 : v.taskId) === c.agentTaskId ? { ...b, loading: !1 } : b;
663
663
  }
664
664
  )
665
665
  );
666
666
  const f = l.current.get(
667
- s.agentTaskId
667
+ c.agentTaskId
668
668
  );
669
- f && (l.current.delete(s.agentTaskId), f({
669
+ f && (l.current.delete(c.agentTaskId), f({
670
670
  type: "success",
671
- streamId: s.streamId,
672
- agentTaskId: s.agentTaskId,
671
+ streamId: c.streamId,
672
+ agentTaskId: c.agentTaskId,
673
673
  response: d
674
674
  }));
675
675
  return;
676
676
  }
677
- (g = e.onAgentTaskProgressItemUpdated) == null || g.call(e, s), n(
678
- (p) => p.map((f) => {
679
- var b;
680
- if (((b = f.confirmedData) == null ? void 0 : b.taskId) !== s.agentTaskId)
677
+ (g = e.onAgentTaskProgressItemUpdated) == null || g.call(e, c), n(
678
+ (h) => h.map((f) => {
679
+ var v;
680
+ if (((v = f.confirmedData) == null ? void 0 : v.taskId) !== c.agentTaskId)
681
681
  return f;
682
- const k = f.progressItems.some(
683
- (S) => S.progressItemId === s.progressItemId
682
+ const b = f.progressItems.some(
683
+ (T) => T.progressItemId === c.progressItemId
684
684
  ) ? f.progressItems.map(
685
- (S) => S.progressItemId === s.progressItemId ? s : S
686
- ) : [...f.progressItems, s];
687
- return { ...f, progressItems: k };
685
+ (T) => T.progressItemId === c.progressItemId ? c : T
686
+ ) : [...f.progressItems, c];
687
+ return { ...f, progressItems: b };
688
688
  })
689
689
  );
690
690
  },
691
- onStreamError: (s) => {
691
+ onStreamError: (c) => {
692
692
  var d;
693
- (d = e == null ? void 0 : e.onStreamError) == null || d.call(e, s), a(s.streamId, s.error);
693
+ (d = e == null ? void 0 : e.onStreamError) == null || d.call(e, c), a(c.streamId, c.error);
694
694
  },
695
- onStreamNotFound: (s) => {
695
+ onStreamNotFound: (c) => {
696
696
  var d;
697
- (d = e == null ? void 0 : e.onStreamNotFound) == null || d.call(e, s), a(s.streamId, {
697
+ (d = e == null ? void 0 : e.onStreamNotFound) == null || d.call(e, c), a(c.streamId, {
698
698
  code: "StreamNotFound",
699
699
  message: "Stream not found"
700
700
  });
701
701
  },
702
- onStreamTimeout: (s) => {
702
+ onStreamTimeout: (c) => {
703
703
  var d;
704
- (d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e, s), a(s.streamId, {
704
+ (d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e, c), a(c.streamId, {
705
705
  code: "StreamTimeout",
706
706
  message: "Stream timed out"
707
707
  });
708
708
  }
709
- }), u = O(
710
- async (s, d) => {
709
+ }), m = z(
710
+ async (c, d) => {
711
711
  var f;
712
- const m = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, g = (d == null ? void 0 : d.fetchCreateAgentTaskClientToken) ?? e.fetchCreateAgentTaskClientToken;
712
+ const u = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, g = (d == null ? void 0 : d.fetchCreateAgentTaskClientToken) ?? e.fetchCreateAgentTaskClientToken;
713
713
  if (g === void 0)
714
714
  throw new Error(
715
715
  "fetchCreateAgentTaskClientToken must be provided either in useAgentTasks props or in createAgentTask options"
716
716
  );
717
- const p = await c();
718
- if (p.type === "success") {
719
- const x = (/* @__PURE__ */ new Date()).toISOString(), k = {
720
- taskKey: m,
721
- streamId: p.stream.id,
722
- triggeredAt: x,
717
+ const h = await s();
718
+ if (h.type === "success") {
719
+ const k = (/* @__PURE__ */ new Date()).toISOString(), b = {
720
+ taskKey: u,
721
+ streamId: h.stream.id,
722
+ triggeredAt: k,
723
723
  confirmedData: null,
724
724
  error: null,
725
- params: s,
725
+ params: c,
726
726
  progressItems: [],
727
727
  loading: !0,
728
728
  loadingText: d == null ? void 0 : d.loadingText
729
729
  };
730
- n((b) => [...b, k]), (f = d == null ? void 0 : d.onTaskRegistered) == null || f.call(d, k);
730
+ n((v) => [...v, b]), (f = d == null ? void 0 : d.onTaskRegistered) == null || f.call(d, b);
731
731
  try {
732
- const { clientToken: b } = await g(), S = await ye({
732
+ const { clientToken: v } = await g(), T = await ge({
733
733
  pk: r.fency.publishableKey,
734
734
  baseUrl: r.fency.baseUrl,
735
- clientToken: b,
736
- streamToken: p.stream.token,
735
+ clientToken: v,
736
+ streamToken: h.stream.token,
737
737
  request: {
738
- streamingChatCompletionTask: s.type === "StreamingChatCompletion" ? {
739
- messages: s.messages,
740
- model: s.model,
741
- ...s.temperature !== void 0 ? {
742
- temperature: s.temperature
738
+ streamingChatCompletionTask: c.type === "StreamingChatCompletion" ? {
739
+ messages: c.messages,
740
+ model: c.model,
741
+ ...c.temperature !== void 0 ? {
742
+ temperature: c.temperature
743
743
  } : {},
744
- ...s.topP !== void 0 ? { topP: s.topP } : {}
744
+ ...c.topP !== void 0 ? { topP: c.topP } : {}
745
745
  } : void 0,
746
- structuredChatCompletionTask: s.type === "StructuredChatCompletion" ? {
747
- messages: s.messages,
748
- jsonSchema: s.jsonSchema,
749
- model: s.model,
750
- ...s.temperature !== void 0 ? {
751
- temperature: s.temperature
746
+ structuredChatCompletionTask: c.type === "StructuredChatCompletion" ? {
747
+ messages: c.messages,
748
+ jsonSchema: c.jsonSchema,
749
+ model: c.model,
750
+ ...c.temperature !== void 0 ? {
751
+ temperature: c.temperature
752
752
  } : {},
753
- ...s.topP !== void 0 ? { topP: s.topP } : {}
753
+ ...c.topP !== void 0 ? { topP: c.topP } : {}
754
754
  } : void 0,
755
- memoryChatTask: s.type === "MemoryChat" ? {
756
- messages: s.messages,
757
- model: s.model,
758
- language: s.language ?? "en",
759
- chunkLimit: s.chunkLimit ?? 10,
760
- memoryScanLimit: s.memoryScanLimit ?? 3
755
+ memoryChatTask: c.type === "MemoryChat" ? {
756
+ messages: c.messages,
757
+ model: c.model,
758
+ language: c.language ?? "en",
759
+ chunkLimit: c.chunkLimit ?? 10,
760
+ memoryScanLimit: c.memoryScanLimit ?? 3
761
761
  } : void 0,
762
- memorySearchTask: s.type === "MemorySearch" ? {
763
- query: s.query,
764
- model: s.model,
765
- language: s.language ?? "en",
766
- chunkLimit: s.chunkLimit ?? 10,
767
- contextExpansion: s.contextExpansion,
768
- ...s.queryExpansion != null ? {
769
- queryExpansion: s.queryExpansion
762
+ memorySearchTask: c.type === "MemorySearch" ? {
763
+ query: c.query,
764
+ model: c.model,
765
+ language: c.language ?? "en",
766
+ chunkLimit: c.chunkLimit ?? 10,
767
+ contextExpansion: c.contextExpansion,
768
+ ...c.queryExpansion != null ? {
769
+ queryExpansion: c.queryExpansion
770
770
  } : {}
771
771
  } : void 0
772
772
  }
773
773
  });
774
- if (S.type === "success" && S.agentTask)
774
+ if (T.type === "success" && T.agentTask)
775
775
  return i.current.add(
776
- S.agentTask.id
776
+ T.agentTask.id
777
777
  ), n((w) => [
778
- ...w.filter((T) => T.taskKey !== m),
778
+ ...w.filter((x) => x.taskKey !== u),
779
779
  {
780
- taskKey: m,
781
- streamId: p.stream.id,
780
+ taskKey: u,
781
+ streamId: h.stream.id,
782
782
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
783
- taskId: S.agentTask.id,
784
- createdAt: S.agentTask.createdAt,
783
+ taskId: T.agentTask.id,
784
+ createdAt: T.agentTask.createdAt,
785
785
  error: null,
786
- params: s,
786
+ params: c,
787
787
  progressItems: [],
788
788
  loading: !0,
789
789
  loadingText: d == null ? void 0 : d.loadingText,
790
790
  confirmedData: {
791
- taskId: S.agentTask.id,
792
- createdAt: S.agentTask.createdAt
791
+ taskId: T.agentTask.id,
792
+ createdAt: T.agentTask.createdAt
793
793
  }
794
794
  }
795
795
  ]), await new Promise(
796
796
  (w) => {
797
797
  l.current.set(
798
- S.agentTask.id,
798
+ T.agentTask.id,
799
799
  w
800
800
  );
801
801
  }
802
802
  );
803
- if (S.type === "error")
803
+ if (T.type === "error")
804
804
  return n((w) => [
805
- ...w.filter((T) => T.taskKey !== m),
805
+ ...w.filter((x) => x.taskKey !== u),
806
806
  {
807
- taskKey: m,
807
+ taskKey: u,
808
808
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
809
- streamId: p.stream.id,
810
- params: s,
811
- error: S.error,
809
+ streamId: h.stream.id,
810
+ params: c,
811
+ error: T.error,
812
812
  progressItems: [],
813
813
  loading: !1,
814
814
  loadingText: d == null ? void 0 : d.loadingText,
@@ -816,21 +816,21 @@ const Le = (e) => {
816
816
  }
817
817
  ]), {
818
818
  type: "error",
819
- error: S.error
819
+ error: T.error
820
820
  };
821
821
  {
822
822
  const w = {
823
823
  message: "No response received",
824
824
  code: "UnknownError"
825
825
  };
826
- return n((T) => [
827
- ...T.filter((L) => L.taskKey !== m),
826
+ return n((x) => [
827
+ ...x.filter((D) => D.taskKey !== u),
828
828
  {
829
- taskKey: m,
829
+ taskKey: u,
830
830
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
831
- streamId: p.stream.id,
831
+ streamId: h.stream.id,
832
832
  error: w,
833
- params: s,
833
+ params: c,
834
834
  progressItems: [],
835
835
  loading: !1,
836
836
  loadingText: d == null ? void 0 : d.loadingText,
@@ -841,19 +841,19 @@ const Le = (e) => {
841
841
  error: w
842
842
  };
843
843
  }
844
- } catch (b) {
845
- const S = {
844
+ } catch (v) {
845
+ const T = {
846
846
  code: "UnknownError",
847
- message: b instanceof Error ? b.message : "Unknown error during agent task creation"
847
+ message: v instanceof Error ? v.message : "Unknown error during agent task creation"
848
848
  };
849
849
  return n((w) => [
850
- ...w.filter((T) => T.taskKey !== m),
850
+ ...w.filter((x) => x.taskKey !== u),
851
851
  {
852
- taskKey: m,
852
+ taskKey: u,
853
853
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
854
- streamId: p.stream.id,
855
- params: s,
856
- error: S,
854
+ streamId: h.stream.id,
855
+ params: c,
856
+ error: T,
857
857
  progressItems: [],
858
858
  loading: !1,
859
859
  loadingText: d == null ? void 0 : d.loadingText,
@@ -861,37 +861,37 @@ const Le = (e) => {
861
861
  }
862
862
  ]), {
863
863
  type: "error",
864
- error: S
864
+ error: T
865
865
  };
866
866
  }
867
867
  } else
868
- return console.error(p.error), p;
868
+ return console.error(h.error), h;
869
869
  },
870
870
  [
871
871
  r,
872
- c,
872
+ s,
873
873
  e.fetchCreateAgentTaskClientToken,
874
874
  a
875
875
  ]
876
- ), y = B(() => {
876
+ ), p = P(() => {
877
877
  if (t.length !== 0)
878
- return [...t].sort((s, d) => new Date(d.triggeredAt).getTime() - new Date(s.triggeredAt).getTime())[0];
878
+ return [...t].sort((c, d) => new Date(d.triggeredAt).getTime() - new Date(c.triggeredAt).getTime())[0];
879
879
  }, [t]);
880
- return A(() => () => {
880
+ return F(() => () => {
881
881
  i.current.clear(), l.current.clear();
882
882
  }, []), {
883
883
  agentTasks: t,
884
- createAgentTask: u,
885
- latest: y
884
+ createAgentTask: m,
885
+ latest: p
886
886
  };
887
887
  };
888
- function ze(e) {
888
+ function Ne(e) {
889
889
  return e.progressItems.map((r, t) => {
890
890
  const n = e.progressItems[t + 1], i = n != null;
891
891
  let l;
892
892
  if (n != null && n.createdAt) {
893
- const a = new Date(r.createdAt).getTime(), c = new Date(n.createdAt).getTime();
894
- l = Math.round((c - a) / 1e3);
893
+ const a = new Date(r.createdAt).getTime(), s = new Date(n.createdAt).getTime();
894
+ l = Math.round((s - a) / 1e3);
895
895
  }
896
896
  return {
897
897
  item: r,
@@ -901,7 +901,7 @@ function ze(e) {
901
901
  };
902
902
  });
903
903
  }
904
- const se = {
904
+ const ce = {
905
905
  'code[class*="language-"]': {
906
906
  color: "#f8f8f2",
907
907
  background: "none",
@@ -1062,22 +1062,22 @@ const se = {
1062
1062
  animate: { opacity: 1, y: 0 },
1063
1063
  transition: { duration: 0.3, delay: 0 },
1064
1064
  children: /* @__PURE__ */ o(
1065
- Se,
1065
+ ke,
1066
1066
  {
1067
- remarkPlugins: [xe],
1067
+ remarkPlugins: [be],
1068
1068
  components: {
1069
1069
  code(r) {
1070
- const { children: t, className: n, node: i, ref: l, ...a } = r, c = /language-(\w+)/.exec(n || "");
1071
- return c ? (
1070
+ const { children: t, className: n, node: i, ref: l, ...a } = r, s = /language-(\w+)/.exec(n || "");
1071
+ return s ? (
1072
1072
  // @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
1073
1073
  /* @__PURE__ */ o(
1074
- oe,
1074
+ ae,
1075
1075
  {
1076
1076
  ...a,
1077
1077
  PreTag: "div",
1078
1078
  children: String(t).replace(/\n$/, ""),
1079
- language: c[1],
1080
- style: se
1079
+ language: s[1],
1080
+ style: ce
1081
1081
  }
1082
1082
  )
1083
1083
  ) : /* @__PURE__ */ o("code", { ...a, className: n, children: String(t) });
@@ -1087,7 +1087,7 @@ const se = {
1087
1087
  }
1088
1088
  )
1089
1089
  }
1090
- ) }), Ne = ({ data: e }) => {
1090
+ ) }), He = ({ data: e }) => {
1091
1091
  const r = JSON.stringify(
1092
1092
  JSON.parse(e.response.jsonResponse),
1093
1093
  null,
@@ -1099,10 +1099,10 @@ const se = {
1099
1099
  initial: { opacity: 0, y: -10 },
1100
1100
  animate: { opacity: 1, y: 0 },
1101
1101
  transition: { duration: 0.3, delay: 0 },
1102
- children: /* @__PURE__ */ o(oe, { language: "json", style: se, PreTag: "div", children: r })
1102
+ children: /* @__PURE__ */ o(ae, { language: "json", style: ce, PreTag: "div", children: r })
1103
1103
  }
1104
1104
  ) });
1105
- }, $e = {
1105
+ }, Ge = {
1106
1106
  en: {
1107
1107
  error: "Error",
1108
1108
  streaming: "Streaming...",
@@ -1162,7 +1162,18 @@ const se = {
1162
1162
  memorySearchHideExploreResults: "Hide results",
1163
1163
  memorySearchExploreNoResults: "No results found",
1164
1164
  memoryChatChunkResultsInMemories: "in {n} memories",
1165
- memoryChatChunkResultsInOneMemory: "in 1 memory"
1165
+ memoryChatChunkResultsInOneMemory: "in 1 memory",
1166
+ googleSearchingFor: "Searching Google for '{query}'",
1167
+ googleSearchingForWithCountry: "Searching Google ({country}) for '{query}'",
1168
+ googleResultsFound: "{n} Google results found",
1169
+ googleResultFound: "1 Google result found",
1170
+ scrapingPages: "Scraping {n} pages for '{query}'",
1171
+ scrapingPage: "Scraping 1 page for '{query}'",
1172
+ scrapedPages: "Scraped {n} pages",
1173
+ scrapedPage: "Scraped 1 page",
1174
+ scrapeFailedSuffix: " — {n} failed",
1175
+ scrapeOkCount: "{n} ok",
1176
+ scrapeFailedCount: "{n} failed"
1166
1177
  },
1167
1178
  no: {
1168
1179
  error: "Feil",
@@ -1223,19 +1234,30 @@ const se = {
1223
1234
  memorySearchHideExploreResults: "Skjul resultater",
1224
1235
  memorySearchExploreNoResults: "Ingen resultater funnet",
1225
1236
  memoryChatChunkResultsInMemories: "i {n} minner",
1226
- memoryChatChunkResultsInOneMemory: "i 1 minne"
1237
+ memoryChatChunkResultsInOneMemory: "i 1 minne",
1238
+ googleSearchingFor: "Søker på Google etter '{query}'",
1239
+ googleSearchingForWithCountry: "Søker på Google ({country}) etter '{query}'",
1240
+ googleResultsFound: "{n} Google-resultater funnet",
1241
+ googleResultFound: "1 Google-resultat funnet",
1242
+ scrapingPages: "Skraper {n} sider for '{query}'",
1243
+ scrapingPage: "Skraper 1 side for '{query}'",
1244
+ scrapedPages: "Skrapet {n} sider",
1245
+ scrapedPage: "Skrapet 1 side",
1246
+ scrapeFailedSuffix: " — {n} feilet",
1247
+ scrapeOkCount: "{n} ok",
1248
+ scrapeFailedCount: "{n} feilet"
1227
1249
  }
1228
1250
  };
1229
- function He(e) {
1230
- return $e[e];
1251
+ function Ue(e) {
1252
+ return Ge[e];
1231
1253
  }
1232
- function v(e, r) {
1254
+ function S(e, r) {
1233
1255
  return Object.entries(r).reduce(
1234
1256
  (t, [n, i]) => t.replace(`{${n}}`, String(i)),
1235
1257
  e
1236
1258
  );
1237
1259
  }
1238
- function G(e, r) {
1260
+ function q(e, r) {
1239
1261
  const t = e.map((n) => `'${n}'`);
1240
1262
  if (r != null && t.length >= 2) {
1241
1263
  const n = t.pop();
@@ -1251,14 +1273,14 @@ function M({
1251
1273
  repeatDelay: i = 0.5,
1252
1274
  className: l,
1253
1275
  startOnView: a = !1,
1254
- once: c = !1,
1255
- inViewMargin: u,
1256
- spread: y = 2,
1257
- color: s = "#999",
1276
+ once: s = !1,
1277
+ inViewMargin: m,
1278
+ spread: p = 2,
1279
+ color: c = "#999",
1258
1280
  shimmerColor: d = "#000",
1259
- direction: m = "fromBottom"
1281
+ direction: u = "fromBottom"
1260
1282
  }) {
1261
- const g = F(null), p = pe(g, { once: c, margin: u }), f = B(() => e.length * y, [e, y]), x = !a || p, k = m === "fromBottom" ? "100% center" : "-100% center", b = m === "fromBottom" ? "0% center" : "200% center";
1283
+ const g = A(null), h = Se(g, { once: s, margin: m }), f = P(() => e.length * p, [e, p]), k = !a || h, b = u === "fromBottom" ? "100% center" : "-100% center", v = u === "fromBottom" ? "0% center" : "200% center";
1262
1284
  return /* @__PURE__ */ o(
1263
1285
  C.span,
1264
1286
  {
@@ -1274,17 +1296,17 @@ function M({
1274
1296
  WebkitTextFillColor: "transparent",
1275
1297
  backgroundRepeat: "no-repeat, padding-box",
1276
1298
  "--spread": `${f}px`,
1277
- "--base-color": s,
1299
+ "--base-color": c,
1278
1300
  "--shimmer-color": d,
1279
1301
  "--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
1280
1302
  backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
1281
1303
  },
1282
1304
  initial: {
1283
- backgroundPosition: k,
1305
+ backgroundPosition: b,
1284
1306
  opacity: 0
1285
1307
  },
1286
- animate: x ? {
1287
- backgroundPosition: b,
1308
+ animate: k ? {
1309
+ backgroundPosition: v,
1288
1310
  opacity: 1
1289
1311
  } : {},
1290
1312
  transition: {
@@ -1304,12 +1326,12 @@ function M({
1304
1326
  }
1305
1327
  );
1306
1328
  }
1307
- const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1308
- const [i, l] = I(!1), c = (e.memories ?? []).map((x) => x.memoryTitle), u = c.length > 0, y = u && c.length > H, s = y && !i ? c.slice(0, H) : c, d = c.length - H, m = !y || i, g = `${n.searchingFor}'${e.queryDescription}'`, p = u ? `${n.searchingIn}${G(
1309
- s,
1310
- m ? n.and : void 0
1311
- )}` : "", f = u ? `${g}${p}` : `${n.searchingPrefix}${e.queryDescription}`;
1312
- return /* @__PURE__ */ h("div", { style: { padding: "16px" }, children: [
1329
+ const G = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1330
+ const [i, l] = I(!1), s = (e.memories ?? []).map((k) => k.memoryTitle), m = s.length > 0, p = m && s.length > G, c = p && !i ? s.slice(0, G) : s, d = s.length - G, u = !p || i, g = `${n.searchingFor}'${e.queryDescription}'`, h = m ? `${n.searchingIn}${q(
1331
+ c,
1332
+ u ? n.and : void 0
1333
+ )}` : "", f = m ? `${g}${h}` : `${n.searchingPrefix}${e.queryDescription}`;
1334
+ return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
1313
1335
  /* @__PURE__ */ o(
1314
1336
  C.div,
1315
1337
  {
@@ -1317,7 +1339,7 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1317
1339
  initial: { opacity: 0, y: -10 },
1318
1340
  animate: { opacity: 1, y: 0 },
1319
1341
  transition: { duration: 0.3, delay: 0 },
1320
- children: r && !t && !y ? /* @__PURE__ */ o(
1342
+ children: r && !t && !p ? /* @__PURE__ */ o(
1321
1343
  M,
1322
1344
  {
1323
1345
  text: f,
@@ -1326,17 +1348,17 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1326
1348
  color: "#999",
1327
1349
  shimmerColor: "#000"
1328
1350
  }
1329
- ) : /* @__PURE__ */ h(E, { children: [
1330
- /* @__PURE__ */ o("span", { style: { color: "#666" }, children: u ? /* @__PURE__ */ h(E, { children: [
1351
+ ) : /* @__PURE__ */ y(E, { children: [
1352
+ /* @__PURE__ */ o("span", { style: { color: "#666" }, children: m ? /* @__PURE__ */ y(E, { children: [
1331
1353
  n.searchingFor,
1332
- /* @__PURE__ */ h("span", { style: { fontWeight: 600 }, children: [
1354
+ /* @__PURE__ */ y("span", { style: { fontWeight: 600 }, children: [
1333
1355
  "'",
1334
1356
  e.queryDescription,
1335
1357
  "'"
1336
1358
  ] }),
1337
- p
1359
+ h
1338
1360
  ] }) : `${n.searchingPrefix}${e.queryDescription}` }),
1339
- y && !i && /* @__PURE__ */ h(E, { children: [
1361
+ p && !i && /* @__PURE__ */ y(E, { children: [
1340
1362
  " ",
1341
1363
  /* @__PURE__ */ o(
1342
1364
  "button",
@@ -1354,13 +1376,13 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1354
1376
  textDecoration: "underline",
1355
1377
  fontFamily: "inherit"
1356
1378
  },
1357
- children: v(n.moreMemories, {
1379
+ children: S(n.moreMemories, {
1358
1380
  n: d
1359
1381
  })
1360
1382
  }
1361
1383
  )
1362
1384
  ] }),
1363
- y && i && /* @__PURE__ */ h(E, { children: [
1385
+ p && i && /* @__PURE__ */ y(E, { children: [
1364
1386
  " ",
1365
1387
  /* @__PURE__ */ o(
1366
1388
  "button",
@@ -1394,16 +1416,16 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1394
1416
  marginTop: "4px",
1395
1417
  fontStyle: "italic"
1396
1418
  },
1397
- children: v(n.tookSeconds, { n: t })
1419
+ children: S(n.tookSeconds, { n: t })
1398
1420
  }
1399
1421
  )
1400
1422
  ] });
1401
- }, U = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1402
- const [i, l] = I(!1), a = e.titles, c = a.length > 0, u = c && a.length > U, y = u && !i ? a.slice(0, U) : a, s = a.length - U, d = !u || i, m = c ? `${n.findingMemoriesIn}${G(
1403
- y,
1423
+ }, U = 5, je = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1424
+ const [i, l] = I(!1), a = e.titles, s = a.length > 0, m = s && a.length > U, p = m && !i ? a.slice(0, U) : a, c = a.length - U, d = !m || i, u = s ? `${n.findingMemoriesIn}${q(
1425
+ p,
1404
1426
  d ? n.and : void 0
1405
1427
  )}` : n.findingMemories;
1406
- return /* @__PURE__ */ h("div", { style: { padding: "16px" }, children: [
1428
+ return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
1407
1429
  /* @__PURE__ */ o(
1408
1430
  C.div,
1409
1431
  {
@@ -1413,18 +1435,18 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1413
1435
  initial: { opacity: 0, y: -10 },
1414
1436
  animate: { opacity: 1, y: 0 },
1415
1437
  transition: { duration: 0.3, delay: 0 },
1416
- children: r && !t && !u ? /* @__PURE__ */ o(
1438
+ children: r && !t && !m ? /* @__PURE__ */ o(
1417
1439
  M,
1418
1440
  {
1419
- text: m,
1441
+ text: u,
1420
1442
  duration: 2.5,
1421
1443
  repeat: !0,
1422
1444
  color: "#999",
1423
1445
  shimmerColor: "#000"
1424
1446
  }
1425
- ) : /* @__PURE__ */ h(E, { children: [
1426
- /* @__PURE__ */ o("span", { style: { color: "#666" }, children: m }),
1427
- u && !i && /* @__PURE__ */ h(E, { children: [
1447
+ ) : /* @__PURE__ */ y(E, { children: [
1448
+ /* @__PURE__ */ o("span", { style: { color: "#666" }, children: u }),
1449
+ m && !i && /* @__PURE__ */ y(E, { children: [
1428
1450
  " ",
1429
1451
  /* @__PURE__ */ o(
1430
1452
  "button",
@@ -1442,13 +1464,13 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1442
1464
  textDecoration: "underline",
1443
1465
  fontFamily: "inherit"
1444
1466
  },
1445
- children: v(n.moreMemories, {
1446
- n: s
1467
+ children: S(n.moreMemories, {
1468
+ n: c
1447
1469
  })
1448
1470
  }
1449
1471
  )
1450
1472
  ] }),
1451
- u && i && /* @__PURE__ */ h(E, { children: [
1473
+ m && i && /* @__PURE__ */ y(E, { children: [
1452
1474
  " ",
1453
1475
  /* @__PURE__ */ o(
1454
1476
  "button",
@@ -1482,14 +1504,14 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1482
1504
  marginTop: "4px",
1483
1505
  fontStyle: "italic"
1484
1506
  },
1485
- children: v(n.tookSeconds, { n: t })
1507
+ children: S(n.tookSeconds, { n: t })
1486
1508
  }
1487
1509
  )
1488
1510
  ] });
1489
- }, _ = 5, je = ({ data: e, t: r }) => {
1490
- const [t, n] = I(!1), l = e.memories.map((g) => g.memoryTitle), a = l.length > 0, c = a && l.length > _, u = c && !t ? l.slice(0, _) : l, y = l.length - _, s = !c || t, d = l.length === 1 ? r.memoryFound : r.memoriesFoundPrefix, m = a ? `${d}${G(
1491
- u,
1492
- s ? r.and : void 0
1511
+ }, _ = 5, qe = ({ data: e, t: r }) => {
1512
+ const [t, n] = I(!1), l = e.memories.map((g) => g.memoryTitle), a = l.length > 0, s = a && l.length > _, m = s && !t ? l.slice(0, _) : l, p = l.length - _, c = !s || t, d = l.length === 1 ? r.memoryFound : r.memoriesFoundPrefix, u = a ? `${d}${q(
1513
+ m,
1514
+ c ? r.and : void 0
1493
1515
  )}` : r.memoriesFound;
1494
1516
  return /* @__PURE__ */ o("div", { style: { padding: "16px" }, children: /* @__PURE__ */ o(
1495
1517
  C.div,
@@ -1498,9 +1520,9 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1498
1520
  initial: { opacity: 0, y: -10 },
1499
1521
  animate: { opacity: 1, y: 0 },
1500
1522
  transition: { duration: 0.3, delay: 0 },
1501
- children: /* @__PURE__ */ h(E, { children: [
1502
- /* @__PURE__ */ o("span", { style: { color: "#666" }, children: m }),
1503
- c && !t && /* @__PURE__ */ h(E, { children: [
1523
+ children: /* @__PURE__ */ y(E, { children: [
1524
+ /* @__PURE__ */ o("span", { style: { color: "#666" }, children: u }),
1525
+ s && !t && /* @__PURE__ */ y(E, { children: [
1504
1526
  " ",
1505
1527
  /* @__PURE__ */ o(
1506
1528
  "button",
@@ -1518,13 +1540,13 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1518
1540
  textDecoration: "underline",
1519
1541
  fontFamily: "inherit"
1520
1542
  },
1521
- children: v(r.moreMemories, {
1522
- n: y
1543
+ children: S(r.moreMemories, {
1544
+ n: p
1523
1545
  })
1524
1546
  }
1525
1547
  )
1526
1548
  ] }),
1527
- c && t && /* @__PURE__ */ h(E, { children: [
1549
+ s && t && /* @__PURE__ */ y(E, { children: [
1528
1550
  " ",
1529
1551
  /* @__PURE__ */ o(
1530
1552
  "button",
@@ -1549,9 +1571,9 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1549
1571
  ] })
1550
1572
  }
1551
1573
  ) });
1552
- }, Ge = ({ isLatest: e = !1, durationSeconds: r, t }) => {
1574
+ }, Qe = ({ isLatest: e = !1, durationSeconds: r, t }) => {
1553
1575
  const n = t.addingSources;
1554
- return /* @__PURE__ */ h("div", { style: { padding: "16px" }, children: [
1576
+ return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
1555
1577
  /* @__PURE__ */ o(
1556
1578
  C.div,
1557
1579
  {
@@ -1585,26 +1607,26 @@ const H = 5, Ue = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
1585
1607
  marginTop: "4px",
1586
1608
  fontStyle: "italic"
1587
1609
  },
1588
- children: v(t.tookSeconds, { n: r })
1610
+ children: S(t.tookSeconds, { n: r })
1589
1611
  }
1590
1612
  )
1591
1613
  ] });
1592
1614
  };
1593
- function Qe(e, r) {
1615
+ function Ke(e, r) {
1594
1616
  if (e.length === 0) return "";
1595
1617
  if (e.length === 1)
1596
- return v(r.pageSingle, { n: e[0] });
1618
+ return S(r.pageSingle, { n: e[0] });
1597
1619
  if (e.length === 2)
1598
- return v(r.pageTwo, {
1620
+ return S(r.pageTwo, {
1599
1621
  a: e[0],
1600
1622
  b: e[1]
1601
1623
  });
1602
1624
  const t = e[e.length - 1], n = e.slice(0, -1).join(", ");
1603
- return v(r.pageMultiple, { list: n, n: t });
1625
+ return S(r.pageMultiple, { list: n, n: t });
1604
1626
  }
1605
- const qe = ({ data: e, onSourceClick: r, t }) => {
1627
+ const Ve = ({ data: e, onSourceClick: r, t }) => {
1606
1628
  const [n, i] = I(null);
1607
- return /* @__PURE__ */ h("div", { style: { padding: "16px" }, children: [
1629
+ return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
1608
1630
  /* @__PURE__ */ o(
1609
1631
  C.div,
1610
1632
  {
@@ -1623,7 +1645,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1623
1645
  }
1624
1646
  ),
1625
1647
  /* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: "#888" }, children: t.noSources }) : e.sources.map((l, a) => /* @__PURE__ */ o(
1626
- Ke,
1648
+ Xe,
1627
1649
  {
1628
1650
  source: l,
1629
1651
  index: a,
@@ -1635,7 +1657,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1635
1657
  l.memoryId
1636
1658
  )) })
1637
1659
  ] });
1638
- }, Ke = ({
1660
+ }, Xe = ({
1639
1661
  source: e,
1640
1662
  index: r,
1641
1663
  loadingMemoryId: t,
@@ -1643,15 +1665,15 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1643
1665
  onSourceClick: i,
1644
1666
  t: l
1645
1667
  }) => {
1646
- const [a, c] = I(!1), u = !!i, y = t === e.memoryId, s = e.pageNumbers ?? [], d = Qe(s, l);
1647
- return /* @__PURE__ */ h(
1668
+ const [a, s] = I(!1), m = !!i, p = t === e.memoryId, c = e.pageNumbers ?? [], d = Ke(c, l);
1669
+ return /* @__PURE__ */ y(
1648
1670
  C.div,
1649
1671
  {
1650
- "aria-busy": y,
1672
+ "aria-busy": p,
1651
1673
  initial: { opacity: 0, scale: 0.9 },
1652
1674
  animate: { opacity: 1, scale: 1 },
1653
1675
  transition: { duration: 0.25, delay: r * 0.05 },
1654
- onClick: u && !y ? async () => {
1676
+ onClick: m && !p ? async () => {
1655
1677
  n(e.memoryId);
1656
1678
  try {
1657
1679
  await i({
@@ -1659,14 +1681,14 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1659
1681
  memoryTitle: e.memoryTitle,
1660
1682
  memoryTypeId: e.memoryTypeId,
1661
1683
  memoryTypeName: e.memoryTypeName,
1662
- pageNumbers: [...s]
1684
+ pageNumbers: [...c]
1663
1685
  });
1664
1686
  } finally {
1665
1687
  n(null);
1666
1688
  }
1667
1689
  } : void 0,
1668
- onMouseEnter: u && !y ? () => c(!0) : void 0,
1669
- onMouseLeave: u && !y ? () => c(!1) : void 0,
1690
+ onMouseEnter: m && !p ? () => s(!0) : void 0,
1691
+ onMouseLeave: m && !p ? () => s(!1) : void 0,
1670
1692
  style: {
1671
1693
  display: "inline-flex",
1672
1694
  flexDirection: "column",
@@ -1675,13 +1697,13 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1675
1697
  borderRadius: "6px",
1676
1698
  border: "1px solid #e0e0e0",
1677
1699
  backgroundColor: a ? "#f5f5f5" : "transparent",
1678
- cursor: u && !y ? "pointer" : y ? "wait" : "default",
1700
+ cursor: m && !p ? "pointer" : p ? "wait" : "default",
1679
1701
  transition: "background-color 0.15s ease",
1680
1702
  userSelect: "none",
1681
- pointerEvents: y ? "none" : void 0
1703
+ pointerEvents: p ? "none" : void 0
1682
1704
  },
1683
1705
  children: [
1684
- /* @__PURE__ */ h(
1706
+ /* @__PURE__ */ y(
1685
1707
  "span",
1686
1708
  {
1687
1709
  style: {
@@ -1693,7 +1715,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1693
1715
  gap: 8
1694
1716
  },
1695
1717
  children: [
1696
- y && /* @__PURE__ */ o(
1718
+ p && /* @__PURE__ */ o(
1697
1719
  "span",
1698
1720
  {
1699
1721
  className: "explore-memory-loader explore-memory-loader--callback",
@@ -1708,7 +1730,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1708
1730
  ]
1709
1731
  }
1710
1732
  );
1711
- }, D = ({
1733
+ }, L = ({
1712
1734
  color: e = "#78b13f",
1713
1735
  size: r = 24,
1714
1736
  borderWidth: t = 7
@@ -1727,7 +1749,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1727
1749
  }
1728
1750
  }
1729
1751
  );
1730
- }, Q = ({
1752
+ }, H = ({
1731
1753
  color: e = "#333",
1732
1754
  size: r = 32,
1733
1755
  lineWidth: t = 2
@@ -1740,7 +1762,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1740
1762
  height: n,
1741
1763
  backgroundColor: e
1742
1764
  };
1743
- return /* @__PURE__ */ h(
1765
+ return /* @__PURE__ */ y(
1744
1766
  "span",
1745
1767
  {
1746
1768
  style: {
@@ -1772,26 +1794,26 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
1772
1794
  }
1773
1795
  );
1774
1796
  };
1775
- function Ve({
1797
+ function Je({
1776
1798
  memory: e,
1777
1799
  completed: r
1778
1800
  }) {
1779
- return e.error != null ? /* @__PURE__ */ o(Q, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(D, { color: "#999", size: 15, borderWidth: 2 }) : r ? /* @__PURE__ */ o(D, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
1801
+ return e.error != null ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : r ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
1780
1802
  }
1781
1803
  const te = 80;
1782
- function Xe({
1804
+ function Ye({
1783
1805
  memory: e,
1784
1806
  completed: r,
1785
1807
  t
1786
1808
  }) {
1787
- const [n, i] = I(!1), l = e.result ?? e.error, a = l != null && l.length > te, c = l != null ? n || !a ? l : `${l.slice(0, te)}...` : void 0, u = a, y = e.error != null;
1788
- return /* @__PURE__ */ h(
1809
+ const [n, i] = I(!1), l = e.result ?? e.error, a = l != null && l.length > te, s = l != null ? n || !a ? l : `${l.slice(0, te)}...` : void 0, m = a, p = e.error != null;
1810
+ return /* @__PURE__ */ y(
1789
1811
  C.div,
1790
1812
  {
1791
1813
  initial: { opacity: 0 },
1792
1814
  animate: { opacity: 1 },
1793
1815
  transition: { duration: 0.25 },
1794
- onClick: u ? () => i((s) => !s) : void 0,
1816
+ onClick: m ? () => i((c) => !c) : void 0,
1795
1817
  style: {
1796
1818
  paddingTop: "12px",
1797
1819
  paddingBottom: "12px",
@@ -1801,7 +1823,7 @@ function Xe({
1801
1823
  alignItems: "center",
1802
1824
  gap: "10px",
1803
1825
  minWidth: 0,
1804
- cursor: u ? "pointer" : "default"
1826
+ cursor: m ? "pointer" : "default"
1805
1827
  },
1806
1828
  children: [
1807
1829
  /* @__PURE__ */ o(
@@ -1814,10 +1836,10 @@ function Xe({
1814
1836
  flexShrink: 0,
1815
1837
  width: 32
1816
1838
  },
1817
- children: /* @__PURE__ */ o(Ve, { memory: e, completed: r })
1839
+ children: /* @__PURE__ */ o(Je, { memory: e, completed: r })
1818
1840
  }
1819
1841
  ),
1820
- /* @__PURE__ */ h(
1842
+ /* @__PURE__ */ y(
1821
1843
  "div",
1822
1844
  {
1823
1845
  style: {
@@ -1834,19 +1856,19 @@ function Xe({
1834
1856
  children: e.memoryTitle
1835
1857
  }
1836
1858
  ),
1837
- c != null && /* @__PURE__ */ o(
1859
+ s != null && /* @__PURE__ */ o(
1838
1860
  "span",
1839
1861
  {
1840
1862
  style: {
1841
1863
  fontSize: 12,
1842
- color: y ? "#c62828" : "#666",
1864
+ color: p ? "#c62828" : "#666",
1843
1865
  lineHeight: 1.4,
1844
1866
  whiteSpace: n ? "pre-wrap" : void 0
1845
1867
  },
1846
- children: c
1868
+ children: s
1847
1869
  }
1848
1870
  ),
1849
- u && /* @__PURE__ */ o(
1871
+ m && /* @__PURE__ */ o(
1850
1872
  "span",
1851
1873
  {
1852
1874
  style: {
@@ -1864,8 +1886,8 @@ function Xe({
1864
1886
  }
1865
1887
  );
1866
1888
  }
1867
- const Je = ({ data: e, completed: r, t }) => /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: e.memories.map((n) => /* @__PURE__ */ o(
1868
- Xe,
1889
+ const Ze = ({ data: e, completed: r, t }) => /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: e.memories.map((n) => /* @__PURE__ */ o(
1890
+ Ye,
1869
1891
  {
1870
1892
  memory: n,
1871
1893
  completed: r,
@@ -1873,16 +1895,16 @@ const Je = ({ data: e, completed: r, t }) => /* @__PURE__ */ o("div", { style: {
1873
1895
  },
1874
1896
  n.memoryId
1875
1897
  )) });
1876
- function Ye(e, r) {
1898
+ function er(e, r) {
1877
1899
  const t = Math.min(e.length, r.length);
1878
1900
  for (let n = t; n >= 0; n--)
1879
1901
  if (e.slice(-n) === r.slice(0, n)) return n;
1880
1902
  return 0;
1881
1903
  }
1882
- const Ze = `
1904
+ const rr = `
1883
1905
 
1884
1906
  `;
1885
- function q(e) {
1907
+ function Q(e) {
1886
1908
  var t, n;
1887
1909
  if (e.length === 0) return "";
1888
1910
  let r = ((t = e[0]) == null ? void 0 : t.content) ?? "";
@@ -1893,24 +1915,24 @@ function q(e) {
1893
1915
  r = l;
1894
1916
  continue;
1895
1917
  }
1896
- const a = Ye(r, l);
1897
- a === 0 ? r += Ze + l : r += l.slice(a);
1918
+ const a = er(r, l);
1919
+ a === 0 ? r += rr + l : r += l.slice(a);
1898
1920
  }
1899
1921
  return r;
1900
1922
  }
1901
1923
  function K(e, r) {
1902
1924
  if (e.length === 0) return "";
1903
1925
  if (e.length === 1)
1904
- return v(r.memorySearchPagesSingle, {
1926
+ return S(r.memorySearchPagesSingle, {
1905
1927
  n: e[0]
1906
1928
  });
1907
1929
  if (e.length === 2)
1908
- return v(r.memorySearchPagesTwo, {
1930
+ return S(r.memorySearchPagesTwo, {
1909
1931
  a: e[0],
1910
1932
  b: e[1]
1911
1933
  });
1912
1934
  const t = e[e.length - 1], n = e.slice(0, -1).join(", ");
1913
- return v(r.memorySearchPagesMultiple, {
1935
+ return S(r.memorySearchPagesMultiple, {
1914
1936
  list: n,
1915
1937
  n: t
1916
1938
  });
@@ -1926,19 +1948,19 @@ function X(e) {
1926
1948
  if (r !== "") return r;
1927
1949
  if (e.memoryTypeId !== "") return e.memoryTypeId;
1928
1950
  }
1929
- function le(e) {
1951
+ function de(e) {
1930
1952
  return e.chunks.filter((r) => r.relation === "MATCH").length;
1931
1953
  }
1932
- function er(e, r) {
1954
+ function nr(e, r) {
1933
1955
  let t = 0, n = 0;
1934
1956
  for (const a of e)
1935
- t += le(a), a.matchingChunkScore > n && (n = a.matchingChunkScore);
1936
- const i = t === 1 ? r.chunkFound : v(r.chunksFound, { n: t }), l = v(r.scoreLabel, {
1957
+ t += de(a), a.matchingChunkScore > n && (n = a.matchingChunkScore);
1958
+ const i = t === 1 ? r.chunkFound : S(r.chunksFound, { n: t }), l = S(r.scoreLabel, {
1937
1959
  n: n.toFixed(2)
1938
1960
  });
1939
1961
  return `${i} - ${l}`;
1940
1962
  }
1941
- function rr(e) {
1963
+ function tr(e) {
1942
1964
  const r = [], t = /* @__PURE__ */ new Map();
1943
1965
  return e.forEach((n, i) => {
1944
1966
  let l = t.get(n.memoryId);
@@ -1954,7 +1976,7 @@ function rr(e) {
1954
1976
  l.items.push({ item: n, flatIndex: i });
1955
1977
  }), r.map((n) => t.get(n));
1956
1978
  }
1957
- function nr({
1979
+ function or({
1958
1980
  items: e,
1959
1981
  onSearchResultClick: r,
1960
1982
  t
@@ -1971,25 +1993,25 @@ function nr({
1971
1993
  paddingTop: 8,
1972
1994
  borderTop: "1px solid #f0f0f0"
1973
1995
  },
1974
- children: e.map((a, c) => {
1975
- const u = V(
1996
+ children: e.map((a, s) => {
1997
+ const m = V(
1976
1998
  a.chunks
1977
- ), y = [
1999
+ ), p = [
1978
2000
  X(a),
1979
- v(t.scoreLabel, {
2001
+ S(t.scoreLabel, {
1980
2002
  n: a.matchingChunkScore.toFixed(2)
1981
2003
  }),
1982
- u.length > 0 ? K(u, t) : t.pagesNotAvailable
2004
+ m.length > 0 ? K(m, t) : t.pagesNotAvailable
1983
2005
  ].filter(
1984
2006
  (g) => g != null && g !== ""
1985
- ), s = {
2007
+ ), c = {
1986
2008
  memoryId: a.memoryId,
1987
2009
  memoryTitle: a.memoryTitle,
1988
2010
  memoryTypeId: a.memoryTypeId,
1989
2011
  memoryTypeName: a.memoryTypeName,
1990
- pageNumbers: u
1991
- }, d = `${a.memoryId}-${c}`, m = n === d;
1992
- return /* @__PURE__ */ h(
2012
+ pageNumbers: m
2013
+ }, d = `${a.memoryId}-${s}`, u = n === d;
2014
+ return /* @__PURE__ */ y(
1993
2015
  "div",
1994
2016
  {
1995
2017
  style: {
@@ -1997,13 +2019,13 @@ function nr({
1997
2019
  flexDirection: "row",
1998
2020
  alignItems: "flex-start",
1999
2021
  gap: "12px",
2000
- paddingTop: c > 0 ? 12 : 0,
2001
- paddingBottom: c < e.length - 1 ? 12 : 0,
2002
- borderBottom: c < e.length - 1 ? "1px solid #eee" : void 0,
2022
+ paddingTop: s > 0 ? 12 : 0,
2023
+ paddingBottom: s < e.length - 1 ? 12 : 0,
2024
+ borderBottom: s < e.length - 1 ? "1px solid #eee" : void 0,
2003
2025
  minWidth: 0
2004
2026
  },
2005
2027
  children: [
2006
- /* @__PURE__ */ h(
2028
+ /* @__PURE__ */ y(
2007
2029
  "div",
2008
2030
  {
2009
2031
  style: {
@@ -2024,7 +2046,7 @@ function nr({
2024
2046
  whiteSpace: "pre-wrap",
2025
2047
  wordBreak: "break-word"
2026
2048
  },
2027
- children: q(a.chunks)
2049
+ children: Q(a.chunks)
2028
2050
  }
2029
2051
  ),
2030
2052
  /* @__PURE__ */ o(
@@ -2036,23 +2058,23 @@ function nr({
2036
2058
  color: "#94a3b8",
2037
2059
  lineHeight: 1.35
2038
2060
  },
2039
- children: y.join(" · ")
2061
+ children: p.join(" · ")
2040
2062
  }
2041
2063
  )
2042
2064
  ]
2043
2065
  }
2044
2066
  ),
2045
- l && /* @__PURE__ */ h(
2067
+ l && /* @__PURE__ */ y(
2046
2068
  "button",
2047
2069
  {
2048
2070
  type: "button",
2049
- "aria-busy": m,
2050
- disabled: m,
2071
+ "aria-busy": u,
2072
+ disabled: u,
2051
2073
  onClick: async () => {
2052
2074
  i(d);
2053
2075
  try {
2054
2076
  await r(
2055
- s
2077
+ c
2056
2078
  );
2057
2079
  } finally {
2058
2080
  i(null);
@@ -2068,14 +2090,14 @@ function nr({
2068
2090
  background: "#eff6ff",
2069
2091
  border: "1px solid #bfdbfe",
2070
2092
  borderRadius: 6,
2071
- cursor: m ? "wait" : "pointer",
2093
+ cursor: u ? "wait" : "pointer",
2072
2094
  fontFamily: "inherit",
2073
2095
  display: "inline-flex",
2074
2096
  alignItems: "center",
2075
2097
  gap: 8
2076
2098
  },
2077
2099
  children: [
2078
- m && /* @__PURE__ */ o(
2100
+ u && /* @__PURE__ */ o(
2079
2101
  "span",
2080
2102
  {
2081
2103
  className: "explore-memory-loader explore-memory-loader--callback",
@@ -2094,15 +2116,15 @@ function nr({
2094
2116
  }
2095
2117
  );
2096
2118
  }
2097
- function tr({
2119
+ function ir({
2098
2120
  group: e,
2099
2121
  t: r,
2100
2122
  expanded: t,
2101
2123
  onToggle: n,
2102
2124
  onSearchResultClick: i
2103
2125
  }) {
2104
- const l = e.items.map((c) => c.item), a = l.some((c) => c.chunks.length > 0);
2105
- return /* @__PURE__ */ h(
2126
+ const l = e.items.map((s) => s.item), a = l.some((s) => s.chunks.length > 0);
2127
+ return /* @__PURE__ */ y(
2106
2128
  C.div,
2107
2129
  {
2108
2130
  initial: { opacity: 0 },
@@ -2130,10 +2152,10 @@ function tr({
2130
2152
  width: 32,
2131
2153
  paddingTop: 2
2132
2154
  },
2133
- children: /* @__PURE__ */ o(D, { color: "#999", size: 15, borderWidth: 2 })
2155
+ children: /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 })
2134
2156
  }
2135
2157
  ),
2136
- /* @__PURE__ */ h(
2158
+ /* @__PURE__ */ y(
2137
2159
  "div",
2138
2160
  {
2139
2161
  style: {
@@ -2156,7 +2178,7 @@ function tr({
2156
2178
  children: e.memoryTitle
2157
2179
  }
2158
2180
  ),
2159
- /* @__PURE__ */ h(
2181
+ /* @__PURE__ */ y(
2160
2182
  "div",
2161
2183
  {
2162
2184
  style: {
@@ -2176,7 +2198,7 @@ function tr({
2176
2198
  color: "#666",
2177
2199
  whiteSpace: "nowrap"
2178
2200
  },
2179
- children: er(l, r)
2201
+ children: nr(l, r)
2180
2202
  }
2181
2203
  ),
2182
2204
  a && /* @__PURE__ */ o(
@@ -2201,7 +2223,7 @@ function tr({
2201
2223
  }
2202
2224
  ),
2203
2225
  t && a && /* @__PURE__ */ o(
2204
- nr,
2226
+ or,
2205
2227
  {
2206
2228
  items: l,
2207
2229
  onSearchResultClick: i,
@@ -2215,25 +2237,25 @@ function tr({
2215
2237
  }
2216
2238
  );
2217
2239
  }
2218
- function or(e, r) {
2219
- return e === 1 ? r.chunkFound : v(r.chunksFound, { n: e });
2240
+ function ar(e, r) {
2241
+ return e === 1 ? r.chunkFound : S(r.chunksFound, { n: e });
2220
2242
  }
2221
- const ir = ({
2243
+ const sr = ({
2222
2244
  data: e,
2223
2245
  onSearchResultClick: r,
2224
2246
  t
2225
2247
  }) => {
2226
2248
  const n = e.items, i = n.reduce(
2227
- (m, g) => m + le(g),
2249
+ (u, g) => u + de(g),
2228
2250
  0
2229
- ), l = new Set(n.map((m) => m.memoryId)).size, [a, c] = I({}), u = O((m) => {
2230
- c((g) => ({
2251
+ ), l = new Set(n.map((u) => u.memoryId)).size, [a, s] = I({}), m = z((u) => {
2252
+ s((g) => ({
2231
2253
  ...g,
2232
- [m]: !g[m]
2254
+ [u]: !g[u]
2233
2255
  }));
2234
- }, []), y = B(() => rr(n), [n]), s = l === 1 ? t.memoryChatChunkResultsInOneMemory : v(t.memoryChatChunkResultsInMemories, {
2256
+ }, []), p = P(() => tr(n), [n]), c = l === 1 ? t.memoryChatChunkResultsInOneMemory : S(t.memoryChatChunkResultsInMemories, {
2235
2257
  n: l
2236
- }), d = `${or(i, t)} ${s}`;
2258
+ }), d = `${ar(i, t)} ${c}`;
2237
2259
  return n.length === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
2238
2260
  "div",
2239
2261
  {
@@ -2244,17 +2266,17 @@ const ir = ({
2244
2266
  },
2245
2267
  children: t.memorySearchExploreNoResults
2246
2268
  }
2247
- ) }) : /* @__PURE__ */ h("div", { style: { padding: "10px" }, children: [
2248
- y.map((m) => /* @__PURE__ */ o(
2249
- tr,
2269
+ ) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
2270
+ p.map((u) => /* @__PURE__ */ o(
2271
+ ir,
2250
2272
  {
2251
- group: m,
2273
+ group: u,
2252
2274
  t,
2253
- expanded: a[m.memoryId] === !0,
2254
- onToggle: () => u(m.memoryId),
2275
+ expanded: a[u.memoryId] === !0,
2276
+ onToggle: () => m(u.memoryId),
2255
2277
  onSearchResultClick: r
2256
2278
  },
2257
- m.memoryId
2279
+ u.memoryId
2258
2280
  )),
2259
2281
  /* @__PURE__ */ o(
2260
2282
  "div",
@@ -2269,22 +2291,496 @@ const ir = ({
2269
2291
  }
2270
2292
  )
2271
2293
  ] });
2294
+ }, lr = ({
2295
+ data: e,
2296
+ isLatest: r = !1,
2297
+ durationSeconds: t,
2298
+ t: n
2299
+ }) => {
2300
+ const i = e.countryCode != null && e.countryCode !== "" ? S(n.googleSearchingForWithCountry, {
2301
+ query: e.query,
2302
+ country: e.countryCode
2303
+ }) : S(n.googleSearchingFor, {
2304
+ query: e.query
2305
+ });
2306
+ return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
2307
+ /* @__PURE__ */ o(
2308
+ C.div,
2309
+ {
2310
+ style: { color: "#666" },
2311
+ initial: { opacity: 0, y: -10 },
2312
+ animate: { opacity: 1, y: 0 },
2313
+ transition: { duration: 0.3, delay: 0 },
2314
+ children: r && !t ? /* @__PURE__ */ o(
2315
+ M,
2316
+ {
2317
+ text: i,
2318
+ duration: 2.5,
2319
+ repeat: !0,
2320
+ color: "#999",
2321
+ shimmerColor: "#000"
2322
+ }
2323
+ ) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: i })
2324
+ }
2325
+ ),
2326
+ t !== void 0 && /* @__PURE__ */ o(
2327
+ "div",
2328
+ {
2329
+ style: {
2330
+ fontSize: "12px",
2331
+ color: "#999",
2332
+ marginTop: "4px",
2333
+ fontStyle: "italic"
2334
+ },
2335
+ children: S(n.tookSeconds, { n: t })
2336
+ }
2337
+ )
2338
+ ] });
2339
+ }, oe = 80;
2340
+ function cr(e) {
2341
+ try {
2342
+ return new URL(e).hostname;
2343
+ } catch {
2344
+ return e;
2345
+ }
2346
+ }
2347
+ function dr({
2348
+ item: e,
2349
+ t: r
2350
+ }) {
2351
+ const [t, n] = I(!1), i = e.description ?? "", l = i.length > oe, a = i.length === 0 ? void 0 : t || !l ? i : `${i.slice(0, oe)}...`;
2352
+ return /* @__PURE__ */ y(
2353
+ "div",
2354
+ {
2355
+ style: {
2356
+ display: "flex",
2357
+ flexDirection: "column",
2358
+ gap: "6px",
2359
+ minWidth: 0
2360
+ },
2361
+ children: [
2362
+ /* @__PURE__ */ o(
2363
+ "a",
2364
+ {
2365
+ href: e.link,
2366
+ target: "_blank",
2367
+ rel: "noopener noreferrer",
2368
+ style: {
2369
+ fontSize: 13,
2370
+ fontWeight: 600,
2371
+ color: "#1f2937",
2372
+ textDecoration: "none",
2373
+ wordBreak: "break-word"
2374
+ },
2375
+ onMouseEnter: (s) => {
2376
+ s.currentTarget.style.color = "#2563eb";
2377
+ },
2378
+ onMouseLeave: (s) => {
2379
+ s.currentTarget.style.color = "#1f2937";
2380
+ },
2381
+ children: e.title
2382
+ }
2383
+ ),
2384
+ /* @__PURE__ */ y(
2385
+ "span",
2386
+ {
2387
+ style: {
2388
+ fontSize: 11,
2389
+ color: "#94a3b8",
2390
+ lineHeight: 1.35
2391
+ },
2392
+ children: [
2393
+ e.rank,
2394
+ ". ",
2395
+ cr(e.link)
2396
+ ]
2397
+ }
2398
+ ),
2399
+ a != null && /* @__PURE__ */ y(E, { children: [
2400
+ /* @__PURE__ */ o(
2401
+ "span",
2402
+ {
2403
+ onClick: l ? () => n((s) => !s) : void 0,
2404
+ style: {
2405
+ fontSize: 13,
2406
+ color: "#666",
2407
+ lineHeight: 1.5,
2408
+ whiteSpace: t ? "pre-wrap" : void 0,
2409
+ wordBreak: "break-word",
2410
+ cursor: l ? "pointer" : "default"
2411
+ },
2412
+ children: a
2413
+ }
2414
+ ),
2415
+ l && /* @__PURE__ */ o(
2416
+ "span",
2417
+ {
2418
+ style: {
2419
+ fontSize: 11,
2420
+ color: "#999",
2421
+ marginTop: 2
2422
+ },
2423
+ children: t ? r.clickToCollapse : r.clickToExpand
2424
+ }
2425
+ )
2426
+ ] })
2427
+ ]
2428
+ }
2429
+ );
2430
+ }
2431
+ const ur = ({ data: e, t: r }) => {
2432
+ const [t, n] = I(!1), i = P(
2433
+ () => [...e.items].sort((s, m) => s.rank - m.rank),
2434
+ [e.items]
2435
+ ), l = i.length, a = l === 1 ? r.googleResultFound : S(r.googleResultsFound, { n: l });
2436
+ return l === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
2437
+ "div",
2438
+ {
2439
+ style: {
2440
+ fontSize: 12,
2441
+ color: "#94a3b8",
2442
+ paddingTop: 4
2443
+ },
2444
+ children: r.memorySearchExploreNoResults
2445
+ }
2446
+ ) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
2447
+ /* @__PURE__ */ y(
2448
+ C.div,
2449
+ {
2450
+ initial: { opacity: 0 },
2451
+ animate: { opacity: 1 },
2452
+ transition: { duration: 0.25 },
2453
+ style: {
2454
+ display: "flex",
2455
+ flexDirection: "row",
2456
+ flexWrap: "wrap",
2457
+ alignItems: "baseline",
2458
+ gap: "6px 12px",
2459
+ minWidth: 0
2460
+ },
2461
+ children: [
2462
+ /* @__PURE__ */ o(
2463
+ "span",
2464
+ {
2465
+ style: {
2466
+ fontSize: 12,
2467
+ color: "#666",
2468
+ whiteSpace: "nowrap"
2469
+ },
2470
+ children: a
2471
+ }
2472
+ ),
2473
+ /* @__PURE__ */ o(
2474
+ "button",
2475
+ {
2476
+ type: "button",
2477
+ onClick: () => n((s) => !s),
2478
+ style: {
2479
+ border: "none",
2480
+ background: "none",
2481
+ padding: 0,
2482
+ cursor: "pointer",
2483
+ fontSize: 12,
2484
+ color: "#666",
2485
+ textDecoration: "underline",
2486
+ fontFamily: "inherit"
2487
+ },
2488
+ children: t ? r.memorySearchHideExploreResults : r.memorySearchViewExploreResults
2489
+ }
2490
+ )
2491
+ ]
2492
+ }
2493
+ ),
2494
+ t && /* @__PURE__ */ o(
2495
+ "div",
2496
+ {
2497
+ style: {
2498
+ display: "flex",
2499
+ flexDirection: "column",
2500
+ gap: 0,
2501
+ marginTop: 8,
2502
+ paddingTop: 8,
2503
+ borderTop: "1px solid #f0f0f0"
2504
+ },
2505
+ children: i.map((s, m) => /* @__PURE__ */ o(
2506
+ "div",
2507
+ {
2508
+ style: {
2509
+ paddingTop: m > 0 ? 12 : 0,
2510
+ paddingBottom: m < i.length - 1 ? 12 : 0,
2511
+ borderBottom: m < i.length - 1 ? "1px solid #eee" : void 0,
2512
+ minWidth: 0
2513
+ },
2514
+ children: /* @__PURE__ */ o(dr, { item: s, t: r })
2515
+ },
2516
+ `${s.link}-${s.rank}-${m}`
2517
+ ))
2518
+ }
2519
+ )
2520
+ ] });
2521
+ }, mr = ({
2522
+ data: e,
2523
+ isLatest: r = !1,
2524
+ durationSeconds: t,
2525
+ t: n
2526
+ }) => {
2527
+ const i = e.urls.length, l = i === 1 ? S(n.scrapingPage, { query: e.query }) : S(n.scrapingPages, { n: i, query: e.query });
2528
+ return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
2529
+ /* @__PURE__ */ o(
2530
+ C.div,
2531
+ {
2532
+ style: { color: "#666" },
2533
+ initial: { opacity: 0, y: -10 },
2534
+ animate: { opacity: 1, y: 0 },
2535
+ transition: { duration: 0.3, delay: 0 },
2536
+ children: r && !t ? /* @__PURE__ */ o(
2537
+ M,
2538
+ {
2539
+ text: l,
2540
+ duration: 2.5,
2541
+ repeat: !0,
2542
+ color: "#999",
2543
+ shimmerColor: "#000"
2544
+ }
2545
+ ) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: l })
2546
+ }
2547
+ ),
2548
+ t !== void 0 && /* @__PURE__ */ o(
2549
+ "div",
2550
+ {
2551
+ style: {
2552
+ fontSize: "12px",
2553
+ color: "#999",
2554
+ marginTop: "4px",
2555
+ fontStyle: "italic"
2556
+ },
2557
+ children: S(n.tookSeconds, { n: t })
2558
+ }
2559
+ )
2560
+ ] });
2561
+ }, ie = 80;
2562
+ function pr(e, r = 48) {
2563
+ try {
2564
+ const t = new URL(e), n = t.pathname.length > r ? `${t.pathname.slice(0, r)}…` : t.pathname, i = n === "/" ? "" : n;
2565
+ return `${t.hostname}${i}${t.search ? "…" : ""}`;
2566
+ } catch {
2567
+ return e.length > 64 ? `${e.slice(0, 64)}…` : e;
2568
+ }
2569
+ }
2570
+ function yr({ item: e }) {
2571
+ return e.error != null ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 });
2572
+ }
2573
+ function gr({
2574
+ item: e,
2575
+ t: r
2576
+ }) {
2577
+ const [t, n] = I(!1), i = e.error ?? e.summary ?? "", l = e.error != null, a = i.length > ie, s = i.length === 0 ? void 0 : t || !a ? i : `${i.slice(0, ie)}...`;
2578
+ return /* @__PURE__ */ y(
2579
+ C.div,
2580
+ {
2581
+ initial: { opacity: 0 },
2582
+ animate: { opacity: 1 },
2583
+ transition: { duration: 0.25 },
2584
+ style: {
2585
+ display: "flex",
2586
+ flexDirection: "row",
2587
+ alignItems: "flex-start",
2588
+ gap: "10px",
2589
+ minWidth: 0
2590
+ },
2591
+ children: [
2592
+ /* @__PURE__ */ o(
2593
+ "div",
2594
+ {
2595
+ style: {
2596
+ display: "flex",
2597
+ alignItems: "center",
2598
+ justifyContent: "center",
2599
+ flexShrink: 0,
2600
+ width: 32,
2601
+ paddingTop: 2
2602
+ },
2603
+ children: /* @__PURE__ */ o(yr, { item: e })
2604
+ }
2605
+ ),
2606
+ /* @__PURE__ */ y(
2607
+ "div",
2608
+ {
2609
+ style: {
2610
+ display: "flex",
2611
+ flexDirection: "column",
2612
+ gap: "4px",
2613
+ minWidth: 0,
2614
+ flex: 1
2615
+ },
2616
+ children: [
2617
+ /* @__PURE__ */ o(
2618
+ "a",
2619
+ {
2620
+ href: e.url,
2621
+ target: "_blank",
2622
+ rel: "noopener noreferrer",
2623
+ style: {
2624
+ fontSize: 13,
2625
+ fontWeight: 500,
2626
+ color: "#2563eb",
2627
+ textDecoration: "none",
2628
+ wordBreak: "break-all"
2629
+ },
2630
+ onMouseEnter: (m) => {
2631
+ m.currentTarget.style.textDecoration = "underline";
2632
+ },
2633
+ onMouseLeave: (m) => {
2634
+ m.currentTarget.style.textDecoration = "none";
2635
+ },
2636
+ children: pr(e.url)
2637
+ }
2638
+ ),
2639
+ s != null && /* @__PURE__ */ y(E, { children: [
2640
+ /* @__PURE__ */ o(
2641
+ "span",
2642
+ {
2643
+ onClick: a ? () => n((m) => !m) : void 0,
2644
+ style: {
2645
+ fontSize: 12,
2646
+ color: l ? "#c62828" : "#666",
2647
+ lineHeight: 1.4,
2648
+ whiteSpace: t ? "pre-wrap" : void 0,
2649
+ wordBreak: "break-word",
2650
+ cursor: a ? "pointer" : "default"
2651
+ },
2652
+ children: s
2653
+ }
2654
+ ),
2655
+ a && /* @__PURE__ */ o(
2656
+ "span",
2657
+ {
2658
+ style: {
2659
+ fontSize: 11,
2660
+ color: "#999",
2661
+ marginTop: 2
2662
+ },
2663
+ children: t ? r.clickToCollapse : r.clickToExpand
2664
+ }
2665
+ )
2666
+ ] })
2667
+ ]
2668
+ }
2669
+ )
2670
+ ]
2671
+ }
2672
+ );
2673
+ }
2674
+ const hr = ({
2675
+ data: e,
2676
+ t: r
2677
+ }) => {
2678
+ const [t, n] = I(!1), i = e.items, { successCount: l, errorCount: a } = P(() => {
2679
+ let d = 0, u = 0;
2680
+ for (const g of i)
2681
+ g.error != null ? u += 1 : d += 1;
2682
+ return { successCount: d, errorCount: u };
2683
+ }, [i]), s = i.length, m = s === 1 ? r.scrapedPage : S(r.scrapedPages, { n: s }), p = S(r.scrapeOkCount, { n: l }), c = a > 0 ? `${m} - ${p}, ${S(r.scrapeFailedCount, { n: a })}` : `${m} - ${p}`;
2684
+ return s === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
2685
+ "div",
2686
+ {
2687
+ style: {
2688
+ fontSize: 12,
2689
+ color: "#94a3b8",
2690
+ paddingTop: 4
2691
+ },
2692
+ children: r.memorySearchExploreNoResults
2693
+ }
2694
+ ) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
2695
+ /* @__PURE__ */ y(
2696
+ C.div,
2697
+ {
2698
+ initial: { opacity: 0 },
2699
+ animate: { opacity: 1 },
2700
+ transition: { duration: 0.25 },
2701
+ style: {
2702
+ display: "flex",
2703
+ flexDirection: "row",
2704
+ flexWrap: "wrap",
2705
+ alignItems: "baseline",
2706
+ gap: "6px 12px",
2707
+ minWidth: 0
2708
+ },
2709
+ children: [
2710
+ /* @__PURE__ */ o(
2711
+ "span",
2712
+ {
2713
+ style: {
2714
+ fontSize: 12,
2715
+ color: "#666"
2716
+ },
2717
+ children: c
2718
+ }
2719
+ ),
2720
+ /* @__PURE__ */ o(
2721
+ "button",
2722
+ {
2723
+ type: "button",
2724
+ onClick: () => n((d) => !d),
2725
+ style: {
2726
+ border: "none",
2727
+ background: "none",
2728
+ padding: 0,
2729
+ cursor: "pointer",
2730
+ fontSize: 12,
2731
+ color: "#666",
2732
+ textDecoration: "underline",
2733
+ fontFamily: "inherit"
2734
+ },
2735
+ children: t ? r.memorySearchHideExploreResults : r.memorySearchViewExploreResults
2736
+ }
2737
+ )
2738
+ ]
2739
+ }
2740
+ ),
2741
+ t && /* @__PURE__ */ o(
2742
+ "div",
2743
+ {
2744
+ style: {
2745
+ display: "flex",
2746
+ flexDirection: "column",
2747
+ gap: 0,
2748
+ marginTop: 8,
2749
+ paddingTop: 8,
2750
+ borderTop: "1px solid #f0f0f0"
2751
+ },
2752
+ children: i.map((d, u) => /* @__PURE__ */ o(
2753
+ "div",
2754
+ {
2755
+ style: {
2756
+ paddingTop: u > 0 ? 12 : 0,
2757
+ paddingBottom: u < i.length - 1 ? 12 : 0,
2758
+ borderBottom: u < i.length - 1 ? "1px solid #eee" : void 0,
2759
+ minWidth: 0
2760
+ },
2761
+ children: /* @__PURE__ */ o(gr, { item: d, t: r })
2762
+ },
2763
+ `${d.url}-${u}`
2764
+ ))
2765
+ }
2766
+ )
2767
+ ] });
2272
2768
  };
2273
- function ar({ item: e }) {
2274
- return e.error != null ? /* @__PURE__ */ o(Q, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(D, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
2769
+ function fr({ item: e }) {
2770
+ return e.error != null ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
2275
2771
  }
2276
- function sr(e, r) {
2277
- return v(r.searchingInMemoriesOfType, {
2772
+ function Sr(e, r) {
2773
+ return S(r.searchingInMemoriesOfType, {
2278
2774
  name: e.memoryTypeName
2279
2775
  });
2280
2776
  }
2281
- function lr({
2777
+ function xr({
2282
2778
  item: e,
2283
2779
  t: r,
2284
2780
  showShimmerForPrimary: t
2285
2781
  }) {
2286
- const n = e.result != null, i = e.error != null, l = sr(e, r);
2287
- return /* @__PURE__ */ h(
2782
+ const n = e.result != null, i = e.error != null, l = Sr(e, r);
2783
+ return /* @__PURE__ */ y(
2288
2784
  C.div,
2289
2785
  {
2290
2786
  initial: { opacity: 0 },
@@ -2311,10 +2807,10 @@ function lr({
2311
2807
  flexShrink: 0,
2312
2808
  width: 32
2313
2809
  },
2314
- children: /* @__PURE__ */ o(ar, { item: e })
2810
+ children: /* @__PURE__ */ o(fr, { item: e })
2315
2811
  }
2316
2812
  ),
2317
- /* @__PURE__ */ h(
2813
+ /* @__PURE__ */ y(
2318
2814
  "div",
2319
2815
  {
2320
2816
  style: {
@@ -2335,14 +2831,14 @@ function lr({
2335
2831
  shimmerColor: "#000"
2336
2832
  }
2337
2833
  ) : l }),
2338
- n && /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#666" }, children: e.result.numberOfChunks === 1 ? v(
2834
+ n && /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#666" }, children: e.result.numberOfChunks === 1 ? S(
2339
2835
  r.memorySearchTypeResultSummaryOne,
2340
2836
  {
2341
2837
  score: e.result.highestChunkScore.toFixed(
2342
2838
  2
2343
2839
  )
2344
2840
  }
2345
- ) : v(
2841
+ ) : S(
2346
2842
  r.memorySearchTypeResultSummary,
2347
2843
  {
2348
2844
  count: e.result.numberOfChunks,
@@ -2359,14 +2855,14 @@ function lr({
2359
2855
  }
2360
2856
  );
2361
2857
  }
2362
- const cr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
2363
- const i = B(() => {
2858
+ const kr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
2859
+ const i = P(() => {
2364
2860
  let l = -1;
2365
- return e.memoryTypes.forEach((a, c) => {
2366
- a.result == null && a.error == null && (l = c);
2861
+ return e.memoryTypes.forEach((a, s) => {
2862
+ a.result == null && a.error == null && (l = s);
2367
2863
  }), l;
2368
2864
  }, [e.memoryTypes]);
2369
- return /* @__PURE__ */ h("div", { style: { padding: "10px" }, children: [
2865
+ return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
2370
2866
  r && !t && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(
2371
2867
  M,
2372
2868
  {
@@ -2377,7 +2873,7 @@ const cr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
2377
2873
  shimmerColor: "#000"
2378
2874
  }
2379
2875
  ) : e.memoryTypes.map((l, a) => /* @__PURE__ */ o(
2380
- lr,
2876
+ xr,
2381
2877
  {
2382
2878
  item: l,
2383
2879
  t: n,
@@ -2394,44 +2890,44 @@ const cr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
2394
2890
  marginTop: "4px",
2395
2891
  fontStyle: "italic"
2396
2892
  },
2397
- children: v(n.tookSeconds, { n: t })
2893
+ children: S(n.tookSeconds, { n: t })
2398
2894
  }
2399
2895
  )
2400
2896
  ] });
2401
- }, N = 12, $ = 1.45, dr = Math.ceil(
2402
- N * $
2403
- ), mr = Math.ceil(
2404
- 5 * N * $
2897
+ }, $ = 12, N = 1.45, br = Math.ceil(
2898
+ $ * N
2899
+ ), vr = Math.ceil(
2900
+ 5 * $ * N
2405
2901
  );
2406
- function W(e) {
2902
+ function B(e) {
2407
2903
  return e.queries != null && e.queries.length > 0;
2408
2904
  }
2409
- function ur(e) {
2905
+ function Tr(e) {
2410
2906
  const r = e.reasoning;
2411
- return (r == null || r === "") && !W(e);
2907
+ return (r == null || r === "") && !B(e);
2412
2908
  }
2413
- function yr(e) {
2414
- if (W(e)) return 3;
2909
+ function wr(e) {
2910
+ if (B(e)) return 3;
2415
2911
  const r = e.reasoning;
2416
2912
  return r == null || r === "" ? 1 : e.reasoningCompleted === !0 ? 2 : 1;
2417
2913
  }
2418
- function gr({ phase: e }) {
2419
- return e === 3 ? /* @__PURE__ */ o(D, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
2914
+ function Cr({ phase: e }) {
2915
+ return e === 3 ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
2420
2916
  }
2421
- function hr({
2917
+ function Ir({
2422
2918
  item: e,
2423
2919
  t: r,
2424
2920
  isActiveRow: t
2425
2921
  }) {
2426
- const n = ur(e), i = yr(e), l = e.reasoning, a = l != null && l.length > 0, c = F(null), [u, y] = I(!1), s = n && t, d = i === 2 && t && !W(e);
2427
- A(() => {
2428
- const p = c.current;
2429
- p != null && i === 1 && a && (p.scrollTop = p.scrollHeight);
2922
+ const n = Tr(e), i = wr(e), l = e.reasoning, a = l != null && l.length > 0, s = A(null), [m, p] = I(!1), c = n && t, d = i === 2 && t && !B(e);
2923
+ F(() => {
2924
+ const h = s.current;
2925
+ h != null && i === 1 && a && (h.scrollTop = h.scrollHeight);
2430
2926
  }, [l, i, a]);
2431
- const m = v(r.searchingInMemoriesOfType, {
2927
+ const u = S(r.searchingInMemoriesOfType, {
2432
2928
  name: e.memoryTypeName
2433
2929
  }), g = !n && i === 3;
2434
- return /* @__PURE__ */ h(
2930
+ return /* @__PURE__ */ y(
2435
2931
  C.div,
2436
2932
  {
2437
2933
  initial: { opacity: 0 },
@@ -2459,10 +2955,10 @@ function hr({
2459
2955
  width: 32,
2460
2956
  ...g ? { paddingTop: 2 } : {}
2461
2957
  },
2462
- children: /* @__PURE__ */ o(gr, { phase: n ? 1 : i })
2958
+ children: /* @__PURE__ */ o(Cr, { phase: n ? 1 : i })
2463
2959
  }
2464
2960
  ),
2465
- /* @__PURE__ */ h(
2961
+ /* @__PURE__ */ y(
2466
2962
  "div",
2467
2963
  {
2468
2964
  style: {
@@ -2473,17 +2969,17 @@ function hr({
2473
2969
  flex: 1
2474
2970
  },
2475
2971
  children: [
2476
- /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: s ? /* @__PURE__ */ o(
2972
+ /* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: c ? /* @__PURE__ */ o(
2477
2973
  M,
2478
2974
  {
2479
- text: m,
2975
+ text: u,
2480
2976
  duration: 2.5,
2481
2977
  repeat: !0,
2482
2978
  color: "#999",
2483
2979
  shimmerColor: "#000"
2484
2980
  }
2485
2981
  ) : e.memoryTypeName }),
2486
- i === 1 && a && !W(e) && /* @__PURE__ */ h("div", { style: { minWidth: 0 }, children: [
2982
+ i === 1 && a && !B(e) && /* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
2487
2983
  /* @__PURE__ */ o(
2488
2984
  "span",
2489
2985
  {
@@ -2509,16 +3005,16 @@ function hr({
2509
3005
  children: /* @__PURE__ */ o(
2510
3006
  "div",
2511
3007
  {
2512
- ref: c,
3008
+ ref: s,
2513
3009
  className: "memory-search-generating-reasoning-viewport",
2514
3010
  style: {
2515
- minHeight: dr,
2516
- maxHeight: mr,
3011
+ minHeight: br,
3012
+ maxHeight: vr,
2517
3013
  height: "auto",
2518
3014
  overflowY: "auto",
2519
3015
  overflowX: "hidden",
2520
- fontSize: N,
2521
- lineHeight: $,
3016
+ fontSize: $,
3017
+ lineHeight: N,
2522
3018
  whiteSpace: "pre-wrap",
2523
3019
  wordBreak: "break-word",
2524
3020
  color: "#888"
@@ -2539,8 +3035,8 @@ function hr({
2539
3035
  shimmerColor: "#000"
2540
3036
  }
2541
3037
  ) }),
2542
- i === 3 && /* @__PURE__ */ h(E, { children: [
2543
- /* @__PURE__ */ h("div", { style: { minWidth: 0 }, children: [
3038
+ i === 3 && /* @__PURE__ */ y(E, { children: [
3039
+ /* @__PURE__ */ y("div", { style: { minWidth: 0 }, children: [
2544
3040
  /* @__PURE__ */ o(
2545
3041
  "span",
2546
3042
  {
@@ -2562,7 +3058,7 @@ function hr({
2562
3058
  flexDirection: "column",
2563
3059
  gap: 6
2564
3060
  },
2565
- children: e.queries.map((p, f) => /* @__PURE__ */ o(
3061
+ children: e.queries.map((h, f) => /* @__PURE__ */ o(
2566
3062
  "div",
2567
3063
  {
2568
3064
  style: {
@@ -2571,19 +3067,19 @@ function hr({
2571
3067
  lineHeight: 1.5,
2572
3068
  wordBreak: "break-word"
2573
3069
  },
2574
- children: p.query
3070
+ children: h.query
2575
3071
  },
2576
3072
  f
2577
3073
  ))
2578
3074
  }
2579
3075
  )
2580
3076
  ] }),
2581
- a && /* @__PURE__ */ h(E, { children: [
3077
+ a && /* @__PURE__ */ y(E, { children: [
2582
3078
  /* @__PURE__ */ o(
2583
3079
  "button",
2584
3080
  {
2585
3081
  type: "button",
2586
- onClick: () => y((p) => !p),
3082
+ onClick: () => p((h) => !h),
2587
3083
  style: {
2588
3084
  alignSelf: "flex-start",
2589
3085
  border: "none",
@@ -2594,15 +3090,15 @@ function hr({
2594
3090
  color: "#666",
2595
3091
  textDecoration: "underline"
2596
3092
  },
2597
- children: u ? r.memorySearchHideReasoning : r.memorySearchViewReasoning
3093
+ children: m ? r.memorySearchHideReasoning : r.memorySearchViewReasoning
2598
3094
  }
2599
3095
  ),
2600
- u && /* @__PURE__ */ o(
3096
+ m && /* @__PURE__ */ o(
2601
3097
  "div",
2602
3098
  {
2603
3099
  style: {
2604
- fontSize: N,
2605
- lineHeight: $,
3100
+ fontSize: $,
3101
+ lineHeight: N,
2606
3102
  whiteSpace: "pre-wrap",
2607
3103
  wordBreak: "break-word",
2608
3104
  color: "#888",
@@ -2622,14 +3118,14 @@ function hr({
2622
3118
  }
2623
3119
  );
2624
3120
  }
2625
- const pr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
2626
- const i = B(() => {
3121
+ const Er = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
3122
+ const i = P(() => {
2627
3123
  let l = -1;
2628
- return e.memoryTypes.forEach((a, c) => {
2629
- W(a) || (l = c);
3124
+ return e.memoryTypes.forEach((a, s) => {
3125
+ B(a) || (l = s);
2630
3126
  }), l;
2631
3127
  }, [e.memoryTypes]);
2632
- return /* @__PURE__ */ h("div", { style: { padding: "10px" }, children: [
3128
+ return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
2633
3129
  r && !t && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(
2634
3130
  M,
2635
3131
  {
@@ -2640,7 +3136,7 @@ const pr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
2640
3136
  shimmerColor: "#000"
2641
3137
  }
2642
3138
  ) : e.memoryTypes.map((l, a) => /* @__PURE__ */ o(
2643
- hr,
3139
+ Ir,
2644
3140
  {
2645
3141
  item: l,
2646
3142
  t: n,
@@ -2657,15 +3153,15 @@ const pr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
2657
3153
  marginTop: "4px",
2658
3154
  fontStyle: "italic"
2659
3155
  },
2660
- children: v(n.tookSeconds, { n: t })
3156
+ children: S(n.tookSeconds, { n: t })
2661
3157
  }
2662
3158
  )
2663
3159
  ] });
2664
3160
  };
2665
- function fr(e) {
2666
- return e.some((n) => n.result == null && n.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((n) => n.error != null) ? /* @__PURE__ */ o(Q, { color: "#c62828", size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(D, { color: "#999", size: 15, borderWidth: 2 });
3161
+ function Mr(e) {
3162
+ return e.some((n) => n.result == null && n.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((n) => n.error != null) ? /* @__PURE__ */ o(H, { color: "#c62828", size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 });
2667
3163
  }
2668
- function Sr(e, r) {
3164
+ function Rr(e, r) {
2669
3165
  if (e.error != null)
2670
3166
  return /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#c62828", whiteSpace: "nowrap" }, children: e.error });
2671
3167
  if (e.result == null)
@@ -2679,16 +3175,16 @@ function Sr(e, r) {
2679
3175
  shimmerColor: "#000"
2680
3176
  }
2681
3177
  ) });
2682
- const t = e.result, n = t.numberOfChunks === 1 ? r.chunkFound : v(r.chunksFound, { n: t.numberOfChunks }), i = v(r.scoreLabel, {
3178
+ const t = e.result, n = t.numberOfChunks === 1 ? r.chunkFound : S(r.chunksFound, { n: t.numberOfChunks }), i = S(r.scoreLabel, {
2683
3179
  n: t.highestChunkScore.toFixed(2)
2684
3180
  });
2685
- return /* @__PURE__ */ h("span", { style: { fontSize: 12, color: "#666", whiteSpace: "nowrap" }, children: [
3181
+ return /* @__PURE__ */ y("span", { style: { fontSize: 12, color: "#666", whiteSpace: "nowrap" }, children: [
2686
3182
  n,
2687
3183
  " · ",
2688
3184
  i
2689
3185
  ] });
2690
3186
  }
2691
- function xr({
3187
+ function Fr({
2692
3188
  items: e,
2693
3189
  queryRow: r,
2694
3190
  onExploreQueryResultClick: t,
@@ -2719,26 +3215,26 @@ function xr({
2719
3215
  paddingTop: 8,
2720
3216
  borderTop: "1px solid #f0f0f0"
2721
3217
  },
2722
- children: e.map((c, u) => {
2723
- const y = c.memoryTitle !== "" ? c.memoryTitle : c.memoryId, s = V(
2724
- c.chunks
3218
+ children: e.map((s, m) => {
3219
+ const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c = V(
3220
+ s.chunks
2725
3221
  ), d = [
2726
- X(c),
2727
- v(n.scoreLabel, {
2728
- n: c.matchingChunkScore.toFixed(2)
3222
+ X(s),
3223
+ S(n.scoreLabel, {
3224
+ n: s.matchingChunkScore.toFixed(2)
2729
3225
  }),
2730
- s.length > 0 ? K(s, n) : n.pagesNotAvailable
3226
+ c.length > 0 ? K(c, n) : n.pagesNotAvailable
2731
3227
  ].filter(
2732
3228
  (f) => f != null && f !== ""
2733
- ), m = {
2734
- memoryId: c.memoryId,
2735
- memoryTitle: c.memoryTitle,
2736
- pageNumbers: s,
3229
+ ), u = {
3230
+ memoryId: s.memoryId,
3231
+ memoryTitle: s.memoryTitle,
3232
+ pageNumbers: c,
2737
3233
  memoryTypeId: r.memoryTypeId,
2738
3234
  memoryTypeName: r.memoryTypeName,
2739
3235
  query: r.query
2740
- }, g = `${r.query}::${c.memoryId}::${u}`, p = i === g;
2741
- return /* @__PURE__ */ h(
3236
+ }, g = `${r.query}::${s.memoryId}::${m}`, h = i === g;
3237
+ return /* @__PURE__ */ y(
2742
3238
  "div",
2743
3239
  {
2744
3240
  style: {
@@ -2746,13 +3242,13 @@ function xr({
2746
3242
  flexDirection: "row",
2747
3243
  alignItems: "flex-start",
2748
3244
  gap: "12px",
2749
- paddingTop: u > 0 ? 12 : 0,
2750
- paddingBottom: u < e.length - 1 ? 12 : 0,
2751
- borderBottom: u < e.length - 1 ? "1px solid #eee" : void 0,
3245
+ paddingTop: m > 0 ? 12 : 0,
3246
+ paddingBottom: m < e.length - 1 ? 12 : 0,
3247
+ borderBottom: m < e.length - 1 ? "1px solid #eee" : void 0,
2752
3248
  minWidth: 0
2753
3249
  },
2754
3250
  children: [
2755
- /* @__PURE__ */ h(
3251
+ /* @__PURE__ */ y(
2756
3252
  "div",
2757
3253
  {
2758
3254
  style: {
@@ -2771,7 +3267,7 @@ function xr({
2771
3267
  fontWeight: 600,
2772
3268
  color: "#333"
2773
3269
  },
2774
- children: y
3270
+ children: p
2775
3271
  }
2776
3272
  ),
2777
3273
  /* @__PURE__ */ o(
@@ -2784,8 +3280,8 @@ function xr({
2784
3280
  whiteSpace: "pre-wrap",
2785
3281
  wordBreak: "break-word"
2786
3282
  },
2787
- children: q(
2788
- c.chunks
3283
+ children: Q(
3284
+ s.chunks
2789
3285
  )
2790
3286
  }
2791
3287
  ),
@@ -2804,17 +3300,17 @@ function xr({
2804
3300
  ]
2805
3301
  }
2806
3302
  ),
2807
- a && /* @__PURE__ */ h(
3303
+ a && /* @__PURE__ */ y(
2808
3304
  "button",
2809
3305
  {
2810
3306
  type: "button",
2811
- "aria-busy": p,
2812
- disabled: p,
3307
+ "aria-busy": h,
3308
+ disabled: h,
2813
3309
  onClick: async () => {
2814
3310
  l(g);
2815
3311
  try {
2816
3312
  await t(
2817
- m
3313
+ u
2818
3314
  );
2819
3315
  } finally {
2820
3316
  l(null);
@@ -2830,14 +3326,14 @@ function xr({
2830
3326
  background: "#eff6ff",
2831
3327
  border: "1px solid #bfdbfe",
2832
3328
  borderRadius: 6,
2833
- cursor: p ? "wait" : "pointer",
3329
+ cursor: h ? "wait" : "pointer",
2834
3330
  fontFamily: "inherit",
2835
3331
  display: "inline-flex",
2836
3332
  alignItems: "center",
2837
3333
  gap: 8
2838
3334
  },
2839
3335
  children: [
2840
- p && /* @__PURE__ */ o(
3336
+ h && /* @__PURE__ */ o(
2841
3337
  "span",
2842
3338
  {
2843
3339
  className: "explore-memory-loader explore-memory-loader--callback",
@@ -2850,13 +3346,13 @@ function xr({
2850
3346
  )
2851
3347
  ]
2852
3348
  },
2853
- `${c.memoryId}-${u}`
3349
+ `${s.memoryId}-${m}`
2854
3350
  );
2855
3351
  })
2856
3352
  }
2857
3353
  );
2858
3354
  }
2859
- function kr(e) {
3355
+ function Ar(e) {
2860
3356
  const r = [], t = /* @__PURE__ */ new Map();
2861
3357
  return e.forEach((n, i) => {
2862
3358
  let l = t.get(n.memoryTypeId);
@@ -2867,7 +3363,7 @@ function kr(e) {
2867
3363
  }, t.set(n.memoryTypeId, l)), l.items.push({ item: n, flatIndex: i });
2868
3364
  }), r.map((n) => t.get(n));
2869
3365
  }
2870
- function br({
3366
+ function Lr({
2871
3367
  group: e,
2872
3368
  t: r,
2873
3369
  isLatest: t,
@@ -2875,10 +3371,10 @@ function br({
2875
3371
  toggleExpanded: i,
2876
3372
  onExploreQueryResultClick: l
2877
3373
  }) {
2878
- const a = e.items.map((u) => u.item), c = a.some(
2879
- (u) => u.result == null && u.error == null
3374
+ const a = e.items.map((m) => m.item), s = a.some(
3375
+ (m) => m.result == null && m.error == null
2880
3376
  );
2881
- return /* @__PURE__ */ h(
3377
+ return /* @__PURE__ */ y(
2882
3378
  C.div,
2883
3379
  {
2884
3380
  initial: { opacity: 0 },
@@ -2890,7 +3386,7 @@ function br({
2890
3386
  borderBottom: "1px solid #eee",
2891
3387
  display: "flex",
2892
3388
  flexDirection: "row",
2893
- alignItems: c ? "center" : "flex-start",
3389
+ alignItems: s ? "center" : "flex-start",
2894
3390
  gap: "10px",
2895
3391
  minWidth: 0
2896
3392
  },
@@ -2904,12 +3400,12 @@ function br({
2904
3400
  justifyContent: "center",
2905
3401
  flexShrink: 0,
2906
3402
  width: 32,
2907
- ...c ? {} : { paddingTop: 2 }
3403
+ ...s ? {} : { paddingTop: 2 }
2908
3404
  },
2909
- children: fr(a)
3405
+ children: Mr(a)
2910
3406
  }
2911
3407
  ),
2912
- /* @__PURE__ */ h(
3408
+ /* @__PURE__ */ y(
2913
3409
  "div",
2914
3410
  {
2915
3411
  style: {
@@ -2927,15 +3423,15 @@ function br({
2927
3423
  fontSize: 12,
2928
3424
  color: "#888"
2929
3425
  },
2930
- children: v(r.memorySearchExploreQueryTypeLabel, {
3426
+ children: S(r.memorySearchExploreQueryTypeLabel, {
2931
3427
  name: e.memoryTypeName
2932
3428
  })
2933
3429
  }
2934
3430
  ),
2935
- e.items.map(({ item: u, flatIndex: y }) => {
3431
+ e.items.map(({ item: m, flatIndex: p }) => {
2936
3432
  var f;
2937
- const s = u.result != null, d = u.error != null, m = t && !s && !d, g = n[y] === !0, p = ((f = u.result) == null ? void 0 : f.items) ?? [];
2938
- return /* @__PURE__ */ h(
3433
+ const c = m.result != null, d = m.error != null, u = t && !c && !d, g = n[p] === !0, h = ((f = m.result) == null ? void 0 : f.items) ?? [];
3434
+ return /* @__PURE__ */ y(
2939
3435
  "div",
2940
3436
  {
2941
3437
  style: {
@@ -2945,7 +3441,7 @@ function br({
2945
3441
  minWidth: 0
2946
3442
  },
2947
3443
  children: [
2948
- /* @__PURE__ */ h(
3444
+ /* @__PURE__ */ y(
2949
3445
  "div",
2950
3446
  {
2951
3447
  style: {
@@ -2968,19 +3464,19 @@ function br({
2968
3464
  flex: "1 1 12rem",
2969
3465
  minWidth: 0
2970
3466
  },
2971
- children: m ? /* @__PURE__ */ o(
3467
+ children: u ? /* @__PURE__ */ o(
2972
3468
  M,
2973
3469
  {
2974
- text: u.query,
3470
+ text: m.query,
2975
3471
  duration: 2.5,
2976
3472
  repeat: !0,
2977
3473
  color: "#999",
2978
3474
  shimmerColor: "#000"
2979
3475
  }
2980
- ) : u.query
3476
+ ) : m.query
2981
3477
  }
2982
3478
  ),
2983
- /* @__PURE__ */ h(
3479
+ /* @__PURE__ */ y(
2984
3480
  "div",
2985
3481
  {
2986
3482
  style: {
@@ -2991,12 +3487,12 @@ function br({
2991
3487
  flexShrink: 0
2992
3488
  },
2993
3489
  children: [
2994
- Sr(u, r),
2995
- s && /* @__PURE__ */ o(
3490
+ Rr(m, r),
3491
+ c && /* @__PURE__ */ o(
2996
3492
  "button",
2997
3493
  {
2998
3494
  type: "button",
2999
- onClick: () => i(y),
3495
+ onClick: () => i(p),
3000
3496
  style: {
3001
3497
  border: "none",
3002
3498
  background: "none",
@@ -3016,18 +3512,18 @@ function br({
3016
3512
  ]
3017
3513
  }
3018
3514
  ),
3019
- s && g && /* @__PURE__ */ o(
3020
- xr,
3515
+ c && g && /* @__PURE__ */ o(
3516
+ Fr,
3021
3517
  {
3022
- items: p,
3023
- queryRow: u,
3518
+ items: h,
3519
+ queryRow: m,
3024
3520
  onExploreQueryResultClick: l,
3025
3521
  t: r
3026
3522
  }
3027
3523
  )
3028
3524
  ]
3029
3525
  },
3030
- `${e.memoryTypeId}-${y}-${u.query}`
3526
+ `${e.memoryTypeId}-${p}-${m.query}`
3031
3527
  );
3032
3528
  })
3033
3529
  ]
@@ -3037,7 +3533,7 @@ function br({
3037
3533
  }
3038
3534
  );
3039
3535
  }
3040
- const vr = ({
3536
+ const Pr = ({
3041
3537
  data: e,
3042
3538
  isLatest: r = !1,
3043
3539
  durationSeconds: t,
@@ -3046,16 +3542,16 @@ const vr = ({
3046
3542
  }) => {
3047
3543
  const [l, a] = I(
3048
3544
  {}
3049
- ), c = O((y) => {
3050
- a((s) => ({
3051
- ...s,
3052
- [y]: !s[y]
3545
+ ), s = z((p) => {
3546
+ a((c) => ({
3547
+ ...c,
3548
+ [p]: !c[p]
3053
3549
  }));
3054
- }, []), u = B(
3055
- () => kr(e.queries),
3550
+ }, []), m = P(
3551
+ () => Ar(e.queries),
3056
3552
  [e.queries]
3057
3553
  );
3058
- return /* @__PURE__ */ h("div", { style: { padding: "10px" }, children: [
3554
+ return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
3059
3555
  r && !t && e.queries.length === 0 ? /* @__PURE__ */ o(
3060
3556
  M,
3061
3557
  {
@@ -3065,17 +3561,17 @@ const vr = ({
3065
3561
  color: "#999",
3066
3562
  shimmerColor: "#000"
3067
3563
  }
3068
- ) : u.map((y) => /* @__PURE__ */ o(
3069
- br,
3564
+ ) : m.map((p) => /* @__PURE__ */ o(
3565
+ Lr,
3070
3566
  {
3071
- group: y,
3567
+ group: p,
3072
3568
  t: i,
3073
3569
  isLatest: r,
3074
3570
  expandedRows: l,
3075
- toggleExpanded: c,
3571
+ toggleExpanded: s,
3076
3572
  onExploreQueryResultClick: n
3077
3573
  },
3078
- y.memoryTypeId
3574
+ p.memoryTypeId
3079
3575
  )),
3080
3576
  t !== void 0 && /* @__PURE__ */ o(
3081
3577
  "div",
@@ -3086,13 +3582,13 @@ const vr = ({
3086
3582
  marginTop: "4px",
3087
3583
  fontStyle: "italic"
3088
3584
  },
3089
- children: v(i.tookSeconds, { n: t })
3585
+ children: S(i.tookSeconds, { n: t })
3090
3586
  }
3091
3587
  )
3092
3588
  ] });
3093
- }, Tr = ({ data: e, onSearchResultClick: r, t }) => {
3589
+ }, Dr = ({ data: e, onSearchResultClick: r, t }) => {
3094
3590
  const n = e.response.items, i = !!r, [l, a] = I(null);
3095
- return /* @__PURE__ */ h("div", { style: { padding: "16px" }, children: [
3591
+ return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
3096
3592
  /* @__PURE__ */ o(
3097
3593
  C.div,
3098
3594
  {
@@ -3116,30 +3612,30 @@ const vr = ({
3116
3612
  flexDirection: "column",
3117
3613
  gap: 0
3118
3614
  },
3119
- children: n.map((c, u) => {
3120
- const y = c.memoryTitle !== "" ? c.memoryTitle : c.memoryId, s = V(
3121
- c.chunks
3615
+ children: n.map((s, m) => {
3616
+ const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c = V(
3617
+ s.chunks
3122
3618
  ), d = [
3123
- X(c),
3124
- v(t.scoreLabel, {
3125
- n: c.matchingChunkScore.toFixed(2)
3619
+ X(s),
3620
+ S(t.scoreLabel, {
3621
+ n: s.matchingChunkScore.toFixed(2)
3126
3622
  }),
3127
- s.length > 0 ? K(s, t) : t.pagesNotAvailable
3623
+ c.length > 0 ? K(c, t) : t.pagesNotAvailable
3128
3624
  ].filter(
3129
3625
  (f) => f != null && f !== ""
3130
- ), m = {
3131
- memoryId: c.memoryId,
3132
- memoryTitle: c.memoryTitle,
3133
- memoryTypeId: c.memoryTypeId,
3134
- memoryTypeName: c.memoryTypeName,
3135
- pageNumbers: s
3136
- }, g = `${c.memoryId}-${u}`, p = l === g;
3137
- return /* @__PURE__ */ h(
3626
+ ), u = {
3627
+ memoryId: s.memoryId,
3628
+ memoryTitle: s.memoryTitle,
3629
+ memoryTypeId: s.memoryTypeId,
3630
+ memoryTypeName: s.memoryTypeName,
3631
+ pageNumbers: c
3632
+ }, g = `${s.memoryId}-${m}`, h = l === g;
3633
+ return /* @__PURE__ */ y(
3138
3634
  C.div,
3139
3635
  {
3140
3636
  initial: { opacity: 0 },
3141
3637
  animate: { opacity: 1 },
3142
- transition: { duration: 0.2, delay: u * 0.04 },
3638
+ transition: { duration: 0.2, delay: m * 0.04 },
3143
3639
  style: {
3144
3640
  display: "flex",
3145
3641
  flexDirection: "row",
@@ -3147,11 +3643,11 @@ const vr = ({
3147
3643
  gap: "12px",
3148
3644
  paddingTop: "12px",
3149
3645
  paddingBottom: "12px",
3150
- borderBottom: u < n.length - 1 ? "1px solid #eee" : void 0,
3646
+ borderBottom: m < n.length - 1 ? "1px solid #eee" : void 0,
3151
3647
  minWidth: 0
3152
3648
  },
3153
3649
  children: [
3154
- /* @__PURE__ */ h(
3650
+ /* @__PURE__ */ y(
3155
3651
  "div",
3156
3652
  {
3157
3653
  style: {
@@ -3170,7 +3666,7 @@ const vr = ({
3170
3666
  fontWeight: 600,
3171
3667
  color: "#333"
3172
3668
  },
3173
- children: y
3669
+ children: p
3174
3670
  }
3175
3671
  ),
3176
3672
  /* @__PURE__ */ o(
@@ -3183,7 +3679,7 @@ const vr = ({
3183
3679
  whiteSpace: "pre-wrap",
3184
3680
  wordBreak: "break-word"
3185
3681
  },
3186
- children: q(c.chunks)
3682
+ children: Q(s.chunks)
3187
3683
  }
3188
3684
  ),
3189
3685
  /* @__PURE__ */ o(
@@ -3201,16 +3697,16 @@ const vr = ({
3201
3697
  ]
3202
3698
  }
3203
3699
  ),
3204
- i && /* @__PURE__ */ h(
3700
+ i && /* @__PURE__ */ y(
3205
3701
  "button",
3206
3702
  {
3207
3703
  type: "button",
3208
- "aria-busy": p,
3209
- disabled: p,
3704
+ "aria-busy": h,
3705
+ disabled: h,
3210
3706
  onClick: async () => {
3211
3707
  a(g);
3212
3708
  try {
3213
- await r(m);
3709
+ await r(u);
3214
3710
  } finally {
3215
3711
  a(null);
3216
3712
  }
@@ -3225,14 +3721,14 @@ const vr = ({
3225
3721
  background: "#eff6ff",
3226
3722
  border: "1px solid #bfdbfe",
3227
3723
  borderRadius: 6,
3228
- cursor: p ? "wait" : "pointer",
3724
+ cursor: h ? "wait" : "pointer",
3229
3725
  fontFamily: "inherit",
3230
3726
  display: "inline-flex",
3231
3727
  alignItems: "center",
3232
3728
  gap: 8
3233
3729
  },
3234
3730
  children: [
3235
- p && /* @__PURE__ */ o(
3731
+ h && /* @__PURE__ */ o(
3236
3732
  "span",
3237
3733
  {
3238
3734
  className: "explore-memory-loader explore-memory-loader--callback",
@@ -3245,7 +3741,7 @@ const vr = ({
3245
3741
  )
3246
3742
  ]
3247
3743
  },
3248
- `${c.memoryId}-${u}`
3744
+ `${s.memoryId}-${m}`
3249
3745
  );
3250
3746
  })
3251
3747
  }
@@ -3274,7 +3770,7 @@ const vr = ({
3274
3770
  }
3275
3771
  )
3276
3772
  }
3277
- ) }), wr = ({
3773
+ ) }), Wr = ({
3278
3774
  progressViewItems: e,
3279
3775
  loading: r,
3280
3776
  error: t,
@@ -3282,27 +3778,27 @@ const vr = ({
3282
3778
  t: i,
3283
3779
  onSourceClick: l,
3284
3780
  onSearchResultClick: a,
3285
- onExploreQueryResultClick: c
3781
+ onExploreQueryResultClick: s
3286
3782
  }) => {
3287
- const u = F(null);
3288
- A(() => {
3289
- u.current && (u.current.scrollTop = u.current.scrollHeight);
3783
+ const m = A(null);
3784
+ F(() => {
3785
+ m.current && (m.current.scrollTop = m.current.scrollHeight);
3290
3786
  }, [e.length]);
3291
- const y = (d) => {
3292
- const m = d.item.data;
3293
- if (m.taskType === "StreamingChatCompletion" && m.eventType === "Text")
3294
- return /* @__PURE__ */ o(ne, { text: m.text });
3295
- if (m.taskType === "StructuredChatCompletion" && m.eventType === "Completed")
3296
- return /* @__PURE__ */ o(Ne, { data: m });
3297
- if (m.taskType === "MemoryChat")
3298
- switch (m.eventType) {
3787
+ const p = (d) => {
3788
+ const u = d.item.data;
3789
+ if (u.taskType === "StreamingChatCompletion" && u.eventType === "Text")
3790
+ return /* @__PURE__ */ o(ne, { text: u.text });
3791
+ if (u.taskType === "StructuredChatCompletion" && u.eventType === "Completed")
3792
+ return /* @__PURE__ */ o(He, { data: u });
3793
+ if (u.taskType === "MemoryChat")
3794
+ switch (u.eventType) {
3299
3795
  case "Text":
3300
- return /* @__PURE__ */ o(ne, { text: m.text });
3796
+ return /* @__PURE__ */ o(ne, { text: u.text });
3301
3797
  case "FindMemories":
3302
3798
  return /* @__PURE__ */ o(
3303
- _e,
3799
+ je,
3304
3800
  {
3305
- data: m,
3801
+ data: u,
3306
3802
  isLatest: d.isLatest,
3307
3803
  durationSeconds: d.durationSeconds,
3308
3804
  t: i
@@ -3310,17 +3806,17 @@ const vr = ({
3310
3806
  );
3311
3807
  case "FindMemoriesResult":
3312
3808
  return /* @__PURE__ */ o(
3313
- je,
3809
+ qe,
3314
3810
  {
3315
- data: m,
3811
+ data: u,
3316
3812
  t: i
3317
3813
  }
3318
3814
  );
3319
3815
  case "Search":
3320
3816
  return /* @__PURE__ */ o(
3321
- Ue,
3817
+ _e,
3322
3818
  {
3323
- data: m,
3819
+ data: u,
3324
3820
  isLatest: d.isLatest,
3325
3821
  durationSeconds: d.durationSeconds,
3326
3822
  t: i
@@ -3328,9 +3824,9 @@ const vr = ({
3328
3824
  );
3329
3825
  case "FindSources":
3330
3826
  return /* @__PURE__ */ o(
3331
- Ge,
3827
+ Qe,
3332
3828
  {
3333
- data: m,
3829
+ data: u,
3334
3830
  isLatest: d.isLatest,
3335
3831
  durationSeconds: d.durationSeconds,
3336
3832
  t: i
@@ -3338,18 +3834,18 @@ const vr = ({
3338
3834
  );
3339
3835
  case "SourcesResult":
3340
3836
  return /* @__PURE__ */ o(
3341
- qe,
3837
+ Ve,
3342
3838
  {
3343
- data: m,
3839
+ data: u,
3344
3840
  onSourceClick: l,
3345
3841
  t: i
3346
3842
  }
3347
3843
  );
3348
3844
  case "ExploreMemories":
3349
3845
  return /* @__PURE__ */ o(
3350
- Je,
3846
+ Ze,
3351
3847
  {
3352
- data: m,
3848
+ data: u,
3353
3849
  completed: d.completed,
3354
3850
  isLatest: d.isLatest,
3355
3851
  t: i
@@ -3357,23 +3853,47 @@ const vr = ({
3357
3853
  );
3358
3854
  case "ChunkResults":
3359
3855
  return /* @__PURE__ */ o(
3360
- ir,
3856
+ sr,
3361
3857
  {
3362
- data: m,
3858
+ data: u,
3363
3859
  onSearchResultClick: a,
3364
3860
  t: i
3365
3861
  }
3366
3862
  );
3863
+ case "GoogleSearch":
3864
+ return /* @__PURE__ */ o(
3865
+ lr,
3866
+ {
3867
+ data: u,
3868
+ isLatest: d.isLatest,
3869
+ durationSeconds: d.durationSeconds,
3870
+ t: i
3871
+ }
3872
+ );
3873
+ case "GoogleSearchResult":
3874
+ return /* @__PURE__ */ o(ur, { data: u, t: i });
3875
+ case "Scrape":
3876
+ return /* @__PURE__ */ o(
3877
+ mr,
3878
+ {
3879
+ data: u,
3880
+ isLatest: d.isLatest,
3881
+ durationSeconds: d.durationSeconds,
3882
+ t: i
3883
+ }
3884
+ );
3885
+ case "ScrapeResult":
3886
+ return /* @__PURE__ */ o(hr, { data: u, t: i });
3367
3887
  case "Completed":
3368
3888
  return null;
3369
3889
  }
3370
- if (m.taskType === "MemorySearch")
3371
- switch (m.eventType) {
3890
+ if (u.taskType === "MemorySearch")
3891
+ switch (u.eventType) {
3372
3892
  case "GeneratingQueries":
3373
3893
  return /* @__PURE__ */ o(
3374
- pr,
3894
+ Er,
3375
3895
  {
3376
- data: m,
3896
+ data: u,
3377
3897
  isLatest: d.isLatest,
3378
3898
  durationSeconds: d.durationSeconds,
3379
3899
  t: i
@@ -3381,20 +3901,20 @@ const vr = ({
3381
3901
  );
3382
3902
  case "ExploreQueries":
3383
3903
  return /* @__PURE__ */ o(
3384
- vr,
3904
+ Pr,
3385
3905
  {
3386
- data: m,
3906
+ data: u,
3387
3907
  isLatest: d.isLatest,
3388
3908
  durationSeconds: d.durationSeconds,
3389
- onExploreQueryResultClick: c,
3909
+ onExploreQueryResultClick: s,
3390
3910
  t: i
3391
3911
  }
3392
3912
  );
3393
3913
  case "SearchMemoryTypes":
3394
3914
  return /* @__PURE__ */ o(
3395
- cr,
3915
+ kr,
3396
3916
  {
3397
- data: m,
3917
+ data: u,
3398
3918
  isLatest: d.isLatest,
3399
3919
  durationSeconds: d.durationSeconds,
3400
3920
  t: i
@@ -3402,15 +3922,15 @@ const vr = ({
3402
3922
  );
3403
3923
  case "Completed":
3404
3924
  return /* @__PURE__ */ o(
3405
- Tr,
3925
+ Dr,
3406
3926
  {
3407
- data: m,
3927
+ data: u,
3408
3928
  onSearchResultClick: a,
3409
3929
  t: i
3410
3930
  }
3411
3931
  );
3412
3932
  }
3413
- return m.taskType === "StreamingChatCompletion" && m.eventType === "Completed" ? null : m.eventType === "Error" && "message" in m ? /* @__PURE__ */ o(j, { message: m.message }) : null;
3933
+ return u.taskType === "StreamingChatCompletion" && u.eventType === "Completed" ? null : u.eventType === "Error" && "message" in u ? /* @__PURE__ */ o(j, { message: u.message }) : null;
3414
3934
  };
3415
3935
  if (e.length === 0)
3416
3936
  return t ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(j, { message: t.message }) }) : r ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(
@@ -3424,20 +3944,24 @@ const vr = ({
3424
3944
  shimmerColor: "#000"
3425
3945
  }
3426
3946
  ) }) : null;
3427
- const s = e.filter((d, m) => {
3947
+ const c = e.filter((d, u) => {
3428
3948
  const g = d.item.data;
3429
- return g.taskType === "MemoryChat" && g.eventType === "ExploreMemories" ? !e.slice(m + 1).some(
3430
- (S) => S.item.data.taskType === "MemoryChat" && S.item.data.eventType === "ExploreMemories"
3431
- ) : g.taskType === "MemorySearch" && g.eventType === "GeneratingQueries" ? !e.slice(m + 1).some(
3432
- (S) => S.item.data.taskType === "MemorySearch" && S.item.data.eventType === "GeneratingQueries"
3433
- ) : g.taskType === "MemorySearch" && g.eventType === "ExploreQueries" ? !e.slice(m + 1).some(
3434
- (S) => S.item.data.taskType === "MemorySearch" && S.item.data.eventType === "ExploreQueries"
3435
- ) : g.taskType === "MemoryChat" && g.eventType === "ChunkResults" ? !e.slice(m + 1).some(
3436
- (S) => S.item.data.taskType === "MemoryChat" && S.item.data.eventType === "ChunkResults"
3949
+ return g.taskType === "MemoryChat" && g.eventType === "ExploreMemories" ? !e.slice(u + 1).some(
3950
+ (x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "ExploreMemories"
3951
+ ) : g.taskType === "MemorySearch" && g.eventType === "GeneratingQueries" ? !e.slice(u + 1).some(
3952
+ (x) => x.item.data.taskType === "MemorySearch" && x.item.data.eventType === "GeneratingQueries"
3953
+ ) : g.taskType === "MemorySearch" && g.eventType === "ExploreQueries" ? !e.slice(u + 1).some(
3954
+ (x) => x.item.data.taskType === "MemorySearch" && x.item.data.eventType === "ExploreQueries"
3955
+ ) : g.taskType === "MemoryChat" && g.eventType === "ChunkResults" ? !e.slice(u + 1).some(
3956
+ (x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "ChunkResults"
3957
+ ) : g.taskType === "MemoryChat" && g.eventType === "GoogleSearch" ? !e.slice(u + 1).some(
3958
+ (x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "GoogleSearch"
3959
+ ) : g.taskType === "MemoryChat" && g.eventType === "Scrape" ? !e.slice(u + 1).some(
3960
+ (x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "Scrape"
3437
3961
  ) : !0;
3438
3962
  });
3439
- return /* @__PURE__ */ h("div", { id: "agent-task-progress-verbose", ref: u, children: [
3440
- /* @__PURE__ */ o(fe, { children: s.map((d, m) => /* @__PURE__ */ o(
3963
+ return /* @__PURE__ */ y("div", { id: "agent-task-progress-verbose", ref: m, children: [
3964
+ /* @__PURE__ */ o(xe, { children: c.map((d, u) => /* @__PURE__ */ o(
3441
3965
  C.div,
3442
3966
  {
3443
3967
  id: `agent-task-progress-item-${d.item.progressItemId}`,
@@ -3445,31 +3969,31 @@ const vr = ({
3445
3969
  animate: { opacity: 1, y: 0 },
3446
3970
  transition: {
3447
3971
  duration: 0.4,
3448
- delay: m * 0.1,
3972
+ delay: u * 0.1,
3449
3973
  ease: "easeOut"
3450
3974
  },
3451
- children: y(d)
3975
+ children: p(d)
3452
3976
  },
3453
3977
  d.item.progressItemId
3454
3978
  )) }),
3455
3979
  t ? /* @__PURE__ */ o("div", { style: { marginTop: 8 }, children: /* @__PURE__ */ o(j, { message: t.message }) }) : null
3456
3980
  ] });
3457
- }, Dr = ({
3981
+ }, jr = ({
3458
3982
  agentTask: e,
3459
3983
  language: r,
3460
3984
  onSourceClick: t,
3461
3985
  onSearchResultClick: n,
3462
3986
  onExploreQueryResultClick: i
3463
3987
  }) => {
3464
- const l = ze(e), a = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : r ?? "en", c = He(a);
3988
+ const l = Ne(e), a = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : r ?? "en", s = Ue(a);
3465
3989
  return /* @__PURE__ */ o(
3466
- wr,
3990
+ Wr,
3467
3991
  {
3468
3992
  progressViewItems: l,
3469
3993
  loading: e.loading,
3470
3994
  error: e.error,
3471
3995
  loadingText: e.loadingText,
3472
- t: c,
3996
+ t: s,
3473
3997
  onSourceClick: t,
3474
3998
  onSearchResultClick: n,
3475
3999
  onExploreQueryResultClick: i
@@ -3477,11 +4001,11 @@ const vr = ({
3477
4001
  );
3478
4002
  };
3479
4003
  export {
3480
- Dr as AgentTaskProgress,
3481
- D as Checkmark,
3482
- Lr as FencyProvider,
3483
- Tr as MemorySearchCompletedResults,
3484
- Re as StreamEventManager,
3485
- Q as XMark,
3486
- Pr as useAgentTasks
4004
+ jr as AgentTaskProgress,
4005
+ L as Checkmark,
4006
+ Ur as FencyProvider,
4007
+ Dr as MemorySearchCompletedResults,
4008
+ Ae as StreamEventManager,
4009
+ H as XMark,
4010
+ _r as useAgentTasks
3487
4011
  };