@rekayasa/erica-bubble 1.2.6 → 1.2.7

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.mjs CHANGED
@@ -15027,119 +15027,167 @@ function wb({ hasAttachments: e, disabled: t, onFilesSelected: n }) {
15027
15027
  })] });
15028
15028
  }
15029
15029
  //#endregion
15030
+ //#region src/components/PromptSuggestions.tsx
15031
+ function Tb({ suggestions: e, onSelect: t }) {
15032
+ return !e || e.length === 0 ? null : /* @__PURE__ */ C("div", {
15033
+ className: "erica-prompt-suggestions",
15034
+ style: {
15035
+ display: "flex",
15036
+ flexWrap: "wrap",
15037
+ gap: "8px",
15038
+ padding: "8px 4px",
15039
+ marginBottom: "8px",
15040
+ pointerEvents: "auto"
15041
+ },
15042
+ children: e.map((e, n) => /* @__PURE__ */ C("button", {
15043
+ type: "button",
15044
+ className: "erica-prompt-suggestion-pill",
15045
+ onClick: () => t(e),
15046
+ style: {
15047
+ backgroundColor: "#f3f4f6",
15048
+ color: "#1f2937",
15049
+ border: "1px solid #e5e7eb",
15050
+ borderRadius: "16px",
15051
+ padding: "6px 12px",
15052
+ fontSize: "13px",
15053
+ cursor: "pointer",
15054
+ textAlign: "left",
15055
+ transition: "background-color 0.2s ease, border-color 0.2s ease"
15056
+ },
15057
+ children: e
15058
+ }, n))
15059
+ });
15060
+ }
15061
+ //#endregion
15030
15062
  //#region src/components/AgentAwareInput.tsx
15031
- function Tb(e) {
15032
- let t = o(wn), [n, r] = d(!1), i = u(0);
15063
+ var Eb = [
15064
+ "Saya akan melakukan pengadaan 500 unit laptop dengan nilai anggaran sekitar Rp7 miliar. Metode pemilihan penyedia apa yang paling tepat dan mengapa?",
15065
+ "Analisa laporan keuangan vendor NUSANTARA TIGA TEKNOLOGI dan buatkan laporannya",
15066
+ "Bantu analisa data vendor SINAR KERTA NEGARA yg belum terverifikasi, berikan rekomendasi action yg perlu di lakukan",
15067
+ "Berikan 10 data vendor yg belum submit laporan keuangan 2025",
15068
+ "Apakah BLUEHOUSE CAPITAL LTD terdaftar di dalam blacklist worldbank?"
15069
+ ];
15070
+ function Db(e) {
15071
+ let t = o(wn), [n, r] = d(!1), i = u(0), { agent: a } = g(), s = a?.messages || [];
15033
15072
  if (!t) return /* @__PURE__ */ C(p, { ...e });
15034
- let { attachedFiles: a, addFiles: s, removeFile: c, inputValue: l, setInputValue: f, handleSubmit: m, threadId: h } = t, g = bn;
15035
- function _(e) {
15073
+ let { attachedFiles: c, addFiles: l, removeFile: f, inputValue: m, setInputValue: h, handleSubmit: _, threadId: v } = t, y = bn;
15074
+ function b(e) {
15036
15075
  e.preventDefault(), i.current += 1, e.dataTransfer.types.includes("Files") && r(!0);
15037
15076
  }
15038
- function v(e) {
15077
+ function x(e) {
15039
15078
  e.preventDefault(), --i.current, i.current === 0 && r(!1);
15040
15079
  }
15041
- function y(e) {
15080
+ function T(e) {
15042
15081
  e.preventDefault();
15043
15082
  }
15044
- function b(e) {
15083
+ function E(e) {
15045
15084
  e.preventDefault(), i.current = 0, r(!1);
15046
15085
  let t = Array.from(e.dataTransfer.files);
15047
- t.length > 0 && s(t);
15086
+ t.length > 0 && l(t);
15048
15087
  }
15049
- function x() {
15050
- m(l);
15088
+ function D() {
15089
+ _(m);
15051
15090
  }
15052
15091
  return /* @__PURE__ */ C(p, {
15053
15092
  ...e,
15054
- value: l,
15055
- onChange: f,
15056
- onSubmitMessage: m,
15057
- children: ({ sendButton: e, startTranscribeButton: r, cancelTranscribeButton: i, finishTranscribeButton: o, audioRecorder: u, disclaimer: d, mode: p, positioning: m, keyboardHeight: T, containerRef: E, showDisclaimer: D, onCancelTranscribe: O, onFinishTranscribe: ee, onStartTranscribe: te }) => /* @__PURE__ */ w("div", {
15093
+ value: m,
15094
+ onChange: h,
15095
+ onSubmitMessage: _,
15096
+ children: ({ sendButton: e, startTranscribeButton: r, cancelTranscribeButton: i, finishTranscribeButton: a, audioRecorder: o, disclaimer: u, mode: d, positioning: p, keyboardHeight: g, containerRef: O, showDisclaimer: ee, onCancelTranscribe: te, onFinishTranscribe: ne, onStartTranscribe: re }) => /* @__PURE__ */ w("div", {
15058
15097
  "data-copilotkit": !0,
15059
- ref: E,
15060
- className: ["erica-aware-input-shell", m === "absolute" ? "erica-aware-input-absolute" : ""].filter(Boolean).join(" "),
15098
+ ref: O,
15099
+ className: ["erica-aware-input-shell", p === "absolute" ? "erica-aware-input-absolute" : ""].filter(Boolean).join(" "),
15061
15100
  style: {
15062
- transform: T > 0 ? `translateY(-${T}px)` : void 0,
15101
+ transform: g > 0 ? `translateY(-${g}px)` : void 0,
15063
15102
  transition: "transform 0.2s ease-out"
15064
15103
  },
15065
- children: [/* @__PURE__ */ w("div", {
15066
- className: ["erica-aware-input-card", n ? "erica-aware-input-dragging" : ""].filter(Boolean).join(" "),
15067
- onDragEnter: _,
15068
- onDragLeave: v,
15069
- onDragOver: y,
15070
- onDrop: b,
15071
- children: [
15072
- n && /* @__PURE__ */ C("div", {
15073
- className: "erica-aware-input-drop-overlay",
15074
- children: "Drop files to attach"
15075
- }),
15076
- a.length > 0 && /* @__PURE__ */ C("div", {
15077
- className: "erica-attachment-chip-row",
15078
- children: a.map((e) => /* @__PURE__ */ w("span", {
15079
- className: ["erica-attachment-chip", `erica-attachment-chip-${e.status}`].join(" "),
15080
- title: e.errorMessage ?? e.name,
15104
+ children: [
15105
+ s.length === 0 && /* @__PURE__ */ C(Tb, {
15106
+ suggestions: Eb,
15107
+ onSelect: (e) => {
15108
+ console.log("[PromptSuggestions] clicked suggestion:", e), _(e);
15109
+ }
15110
+ }),
15111
+ /* @__PURE__ */ w("div", {
15112
+ className: ["erica-aware-input-card", n ? "erica-aware-input-dragging" : ""].filter(Boolean).join(" "),
15113
+ onDragEnter: b,
15114
+ onDragLeave: x,
15115
+ onDragOver: T,
15116
+ onDrop: E,
15117
+ children: [
15118
+ n && /* @__PURE__ */ C("div", {
15119
+ className: "erica-aware-input-drop-overlay",
15120
+ children: "Drop files to attach"
15121
+ }),
15122
+ c.length > 0 && /* @__PURE__ */ C("div", {
15123
+ className: "erica-attachment-chip-row",
15124
+ children: c.map((e) => /* @__PURE__ */ w("span", {
15125
+ className: ["erica-attachment-chip", `erica-attachment-chip-${e.status}`].join(" "),
15126
+ title: e.errorMessage ?? e.name,
15127
+ children: [
15128
+ e.status === "uploading" && /* @__PURE__ */ C("span", { className: "erica-attachment-chip-spinner" }),
15129
+ /* @__PURE__ */ C("span", {
15130
+ className: "erica-attachment-chip-name",
15131
+ children: e.name
15132
+ }),
15133
+ e.status !== "uploading" && /* @__PURE__ */ C("button", {
15134
+ type: "button",
15135
+ "aria-label": `Remove ${e.name}`,
15136
+ className: "erica-attachment-chip-remove",
15137
+ onClick: () => f(e.id),
15138
+ children: "×"
15139
+ })
15140
+ ]
15141
+ }, e.id))
15142
+ }),
15143
+ t.validationError && /* @__PURE__ */ C("div", {
15144
+ className: "erica-validation-error",
15145
+ style: {
15146
+ color: "#ef4444",
15147
+ fontSize: "12px",
15148
+ padding: "6px 10px",
15149
+ backgroundColor: "#fee2e2",
15150
+ borderRadius: "4px",
15151
+ width: "100%",
15152
+ boxSizing: "border-box"
15153
+ },
15154
+ children: t.validationError
15155
+ }),
15156
+ /* @__PURE__ */ C("div", {
15157
+ className: "erica-aware-input-main",
15158
+ children: d === "transcribe" ? o : /* @__PURE__ */ C(Cb, {
15159
+ value: m,
15160
+ onChange: h,
15161
+ onSubmit: D,
15162
+ agentIdentifier: y,
15163
+ placeholder: "Ketik pertanyaan Anda di sini..."
15164
+ })
15165
+ }),
15166
+ /* @__PURE__ */ w("div", {
15167
+ className: "erica-aware-input-toolbar",
15081
15168
  children: [
15082
- e.status === "uploading" && /* @__PURE__ */ C("span", { className: "erica-attachment-chip-spinner" }),
15083
- /* @__PURE__ */ C("span", {
15084
- className: "erica-attachment-chip-name",
15085
- children: e.name
15169
+ /* @__PURE__ */ C(wb, {
15170
+ hasAttachments: c.length > 0,
15171
+ disabled: !v,
15172
+ onFilesSelected: l
15086
15173
  }),
15087
- e.status !== "uploading" && /* @__PURE__ */ C("button", {
15088
- type: "button",
15089
- "aria-label": `Remove ${e.name}`,
15090
- className: "erica-attachment-chip-remove",
15091
- onClick: () => c(e.id),
15092
- children: "×"
15093
- })
15174
+ /* @__PURE__ */ C("div", { className: "erica-aware-input-spacer" }),
15175
+ d === "transcribe" ? /* @__PURE__ */ w(S, { children: [te && i, ne && a] }) : /* @__PURE__ */ w(S, { children: [re && r, e] })
15094
15176
  ]
15095
- }, e.id))
15096
- }),
15097
- t.validationError && /* @__PURE__ */ C("div", {
15098
- className: "erica-validation-error",
15099
- style: {
15100
- color: "#ef4444",
15101
- fontSize: "12px",
15102
- padding: "6px 10px",
15103
- backgroundColor: "#fee2e2",
15104
- borderRadius: "4px",
15105
- width: "100%",
15106
- boxSizing: "border-box"
15107
- },
15108
- children: t.validationError
15109
- }),
15110
- /* @__PURE__ */ C("div", {
15111
- className: "erica-aware-input-main",
15112
- children: p === "transcribe" ? u : /* @__PURE__ */ C(Cb, {
15113
- value: l,
15114
- onChange: f,
15115
- onSubmit: x,
15116
- agentIdentifier: g,
15117
- placeholder: "Ketik pertanyaan Anda di sini..."
15118
15177
  })
15119
- }),
15120
- /* @__PURE__ */ w("div", {
15121
- className: "erica-aware-input-toolbar",
15122
- children: [
15123
- /* @__PURE__ */ C(wb, {
15124
- hasAttachments: a.length > 0,
15125
- disabled: !h,
15126
- onFilesSelected: s
15127
- }),
15128
- /* @__PURE__ */ C("div", { className: "erica-aware-input-spacer" }),
15129
- p === "transcribe" ? /* @__PURE__ */ w(S, { children: [O && i, ee && o] }) : /* @__PURE__ */ w(S, { children: [te && r, e] })
15130
- ]
15131
- })
15132
- ]
15133
- }), D && d]
15178
+ ]
15179
+ }),
15180
+ ee && u
15181
+ ]
15134
15182
  })
15135
15183
  });
15136
15184
  }
15137
15185
  //#endregion
15138
15186
  //#region src/components/ChatMessageSpinner.tsx
15139
- var Eb = (e) => e.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z])([A-Z][a-z])/g, "$1 $2").replace(/[_-]/g, " ").toLowerCase().trim().replace(/\s+/g, " ");
15140
- function Db() {
15187
+ var Ob = (e) => e.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z])([A-Z][a-z])/g, "$1 $2").replace(/[_-]/g, " ").toLowerCase().trim().replace(/\s+/g, " ");
15188
+ function kb() {
15141
15189
  let e = o(wn), t = "digesting";
15142
- return e?.step && (t = e.step === "ls" ? "listing files" : Eb(e.step)), /* @__PURE__ */ w("div", {
15190
+ return e?.step && (t = e.step === "ls" ? "listing files" : Ob(e.step)), /* @__PURE__ */ w("div", {
15143
15191
  className: "chat-message-spinner-container",
15144
15192
  children: [/* @__PURE__ */ C("div", { className: "chat-message-spinner-icon" }), /* @__PURE__ */ w("div", {
15145
15193
  className: "chat-message-spinner-text",
@@ -15165,7 +15213,7 @@ function Db() {
15165
15213
  }
15166
15214
  //#endregion
15167
15215
  //#region src/components/LoadingMessage.tsx
15168
- function Ob({ message: e }) {
15216
+ function Ab({ message: e }) {
15169
15217
  return /* @__PURE__ */ w("div", {
15170
15218
  className: "loading-message-container",
15171
15219
  children: [/* @__PURE__ */ C("div", { className: "loading-message-spinner" }), /* @__PURE__ */ w("div", {
@@ -15192,17 +15240,17 @@ function Ob({ message: e }) {
15192
15240
  }
15193
15241
  //#endregion
15194
15242
  //#region src/components/EricaChatHeader.tsx
15195
- function kb(e) {
15243
+ function jb(e) {
15196
15244
  if (!e) return "";
15197
15245
  let t = e.split(":");
15198
15246
  return (t.length > 1 ? t.slice(1).join(" ") : e).replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
15199
15247
  }
15200
- function Ab(e) {
15248
+ function Mb(e) {
15201
15249
  if (!e) return "";
15202
15250
  let t = Date.now() - new Date(e).getTime(), n = Math.floor(t / 6e4), r = Math.floor(n / 60), i = Math.floor(r / 24);
15203
15251
  return n < 1 ? "just now" : n < 60 ? `${n}m ago` : r < 24 ? `${r}h ago` : i < 7 ? `${i}d ago` : new Date(e).toLocaleDateString();
15204
15252
  }
15205
- function jb({ onNewChat: e, onThreadSelect: t, isMaximized: n = !1, onToggleMaximize: r }) {
15253
+ function Nb({ onNewChat: e, onThreadSelect: t, isMaximized: n = !1, onToggleMaximize: r }) {
15206
15254
  let [i, a] = d(!1), o = u(null), c = _(), { data: l = [], isLoading: f } = _n();
15207
15255
  s(() => {
15208
15256
  function e(e) {
@@ -15221,7 +15269,7 @@ function jb({ onNewChat: e, onThreadSelect: t, isMaximized: n = !1, onToggleMaxi
15221
15269
  className: "erica-header-title",
15222
15270
  children: ["SPP AI ", /* @__PURE__ */ w("span", {
15223
15271
  className: "erica-header-version",
15224
- children: ["v", "1.2.6"]
15272
+ children: ["v", "1.2.7"]
15225
15273
  })]
15226
15274
  }), /* @__PURE__ */ w("div", {
15227
15275
  className: "erica-header-controls",
@@ -15274,7 +15322,7 @@ function jb({ onNewChat: e, onThreadSelect: t, isMaximized: n = !1, onToggleMaxi
15274
15322
  children: "No conversations yet"
15275
15323
  }),
15276
15324
  !f && l.map((e) => {
15277
- let t = kb(e.agent), n = Ab(e.last_run_at ?? e.created_at);
15325
+ let t = jb(e.agent), n = Mb(e.last_run_at ?? e.created_at);
15278
15326
  return /* @__PURE__ */ C("button", {
15279
15327
  onClick: () => p(e.uid ?? ""),
15280
15328
  className: "erica-thread-item",
@@ -15305,7 +15353,7 @@ function jb({ onNewChat: e, onThreadSelect: t, isMaximized: n = !1, onToggleMaxi
15305
15353
  }
15306
15354
  //#endregion
15307
15355
  //#region src/components/AttachmentItem.tsx
15308
- function Mb({ attachment: e }) {
15356
+ function Pb({ attachment: e }) {
15309
15357
  let [t, n] = d(!1);
15310
15358
  async function r() {
15311
15359
  n(!0);
@@ -15354,7 +15402,7 @@ function Mb({ attachment: e }) {
15354
15402
  }
15355
15403
  //#endregion
15356
15404
  //#region src/components/AttachmentBlock.tsx
15357
- function Nb({ children: e }) {
15405
+ function Fb({ children: e }) {
15358
15406
  let t = String(e).trim(), n = [];
15359
15407
  try {
15360
15408
  n = JSON.parse(t);
@@ -15363,12 +15411,12 @@ function Nb({ children: e }) {
15363
15411
  }
15364
15412
  return n.length === 0 ? null : /* @__PURE__ */ C("div", {
15365
15413
  className: "flex flex-wrap gap-1.5 mt-1.5 py-1",
15366
- children: n.map((e, t) => /* @__PURE__ */ C(Mb, { attachment: e }, t))
15414
+ children: n.map((e, t) => /* @__PURE__ */ C(Pb, { attachment: e }, t))
15367
15415
  });
15368
15416
  }
15369
15417
  //#endregion
15370
15418
  //#region src/components/ChatToggleGreeting.tsx
15371
- function Pb({ message: e = "Hai! Saya SPP AI, siap membantu Anda!", isOpen: t = !1, initialDelay: n = 1e4 }) {
15419
+ function Ib({ message: e = "Hai! Saya SPP AI, siap membantu Anda!", isOpen: t = !1, initialDelay: n = 1e4 }) {
15372
15420
  let [r, i] = d(!1), [a, o] = d(!1);
15373
15421
  return s(() => {
15374
15422
  let e = setTimeout(() => {
@@ -15392,32 +15440,32 @@ function Pb({ message: e = "Hai! Saya SPP AI, siap membantu Anda!", isOpen: t =
15392
15440
  }
15393
15441
  //#endregion
15394
15442
  //#region ../../node_modules/.pnpm/mdast-util-newline-to-break@2.0.0/node_modules/mdast-util-newline-to-break/lib/index.js
15395
- function Fb(e) {
15396
- Ah(e, [/\r?\n|\r/g, Ib]);
15443
+ function Lb(e) {
15444
+ Ah(e, [/\r?\n|\r/g, Rb]);
15397
15445
  }
15398
- function Ib() {
15446
+ function Rb() {
15399
15447
  return { type: "break" };
15400
15448
  }
15401
15449
  //#endregion
15402
15450
  //#region ../../node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js
15403
- function Lb() {
15451
+ function zb() {
15404
15452
  return function(e) {
15405
- Fb(e);
15453
+ Lb(e);
15406
15454
  };
15407
15455
  }
15408
15456
  //#endregion
15409
15457
  //#region src/components/EricaChat.tsx
15410
- var Rb = t.createContext(null);
15411
- function zb() {
15412
- let e = t.useContext(Rb);
15413
- return e ? /* @__PURE__ */ C(jb, {
15458
+ var Bb = t.createContext(null);
15459
+ function Vb() {
15460
+ let e = t.useContext(Bb);
15461
+ return e ? /* @__PURE__ */ C(Nb, {
15414
15462
  onNewChat: e.onNewChat,
15415
15463
  onThreadSelect: e.onThreadSelect,
15416
15464
  isMaximized: e.isMaximized,
15417
15465
  onToggleMaximize: e.toggleMaximize
15418
15466
  }) : null;
15419
15467
  }
15420
- var Bb = () => (e) => {
15468
+ var Hb = () => (e) => {
15421
15469
  let t = (e) => {
15422
15470
  [
15423
15471
  "containerDirective",
@@ -15426,48 +15474,48 @@ var Bb = () => (e) => {
15426
15474
  ].includes(e.type) && e.name === "tool_call_content" && (e.data = e.data || {}, e.data.hName = e.name, e.data.hProperties = e.attributes || {}, e.children = []), e.children && e.children.forEach(t);
15427
15475
  };
15428
15476
  t(e);
15429
- }, Vb = () => (e) => {
15477
+ }, Ub = () => (e) => {
15430
15478
  let t = (e) => {
15431
15479
  e.type === "textDirective" && e.name === "resource" && (e.data = e.data || {}, e.data.hName = "resource", e.data.hProperties = e.attributes || {}), e.children && e.children.forEach(t);
15432
15480
  };
15433
15481
  t(e);
15434
15482
  };
15435
- function Hb({ threadId: e, isLoadingThreadId: n, isLoadingSandbox: r, isSandboxReady: i, isNewThread: a, requiresSandbox: o, isModalOpen: s }) {
15483
+ function Wb({ threadId: e, isLoadingThreadId: n, isLoadingSandbox: r, isSandboxReady: i, isNewThread: a, requiresSandbox: o, isModalOpen: s }) {
15436
15484
  let c = "Halo! Saya asisten AI SPP, ada yang bisa saya bantu?";
15437
- return n ? c = /* @__PURE__ */ C(Ob, { message: "Initializing conversation" }) : o && a && r ? c = /* @__PURE__ */ C(Ob, { message: "Preparing workspace" }) : o && a && !i && (c = /* @__PURE__ */ C(Ob, { message: "Setting up environment" })), /* @__PURE__ */ w("div", {
15438
- className: `erica-chat-container${t.useContext(Rb)?.isMaximized ? " erica-chat-maximized" : ""}`,
15485
+ return n ? c = /* @__PURE__ */ C(Ab, { message: "Initializing conversation" }) : o && a && r ? c = /* @__PURE__ */ C(Ab, { message: "Preparing workspace" }) : o && a && !i && (c = /* @__PURE__ */ C(Ab, { message: "Setting up environment" })), /* @__PURE__ */ w("div", {
15486
+ className: `erica-chat-container${t.useContext(Bb)?.isMaximized ? " erica-chat-maximized" : ""}`,
15439
15487
  children: [
15440
15488
  /* @__PURE__ */ C(hb, {}),
15441
- /* @__PURE__ */ C(Pb, {
15489
+ /* @__PURE__ */ C(Ib, {
15442
15490
  message: "Hai! Saya SPP AI, siap membantu Anda!",
15443
15491
  isOpen: s,
15444
15492
  initialDelay: 1e4
15445
15493
  }),
15446
15494
  /* @__PURE__ */ C(h, {
15447
15495
  welcomeScreen: !0,
15448
- header: zb,
15496
+ header: Vb,
15449
15497
  labels: {
15450
15498
  chatInputPlaceholder: "Ketik pertanyaan Anda di sini...",
15451
15499
  welcomeMessageText: c,
15452
15500
  chatDisclaimerText: "AI dapat membuat kesalahan. Harap verifikasi informasi penting."
15453
15501
  },
15454
15502
  threadId: e,
15455
- input: Tb,
15503
+ input: Db,
15456
15504
  messageView: {
15457
- cursor: Db,
15505
+ cursor: kb,
15458
15506
  userMessage: { messageRenderer: ({ content: e, className: t }) => /* @__PURE__ */ C("div", {
15459
15507
  className: ["cpk:prose cpk:dark:prose-invert cpk:bg-smi cpk:relative cpk:max-w-[80%] cpk:rounded-[18px] cpk:px-4 cpk:py-1.5 cpk:data-[multiline]:py-3 cpk:inline-block", t].filter(Boolean).join(" "),
15460
15508
  children: /* @__PURE__ */ C(Ch, {
15461
15509
  remarkPlugins: [
15462
- Lb,
15510
+ zb,
15463
15511
  Dv,
15464
15512
  Hy,
15465
- Vb
15513
+ Ub
15466
15514
  ],
15467
15515
  components: {
15468
15516
  pre: ({ children: e }) => /* @__PURE__ */ C(S, { children: e }),
15469
15517
  code({ children: e, className: t }) {
15470
- return /language-(\w+)/.exec(t || "")?.[1] === "attachments" ? /* @__PURE__ */ C(Nb, { children: e }) : /* @__PURE__ */ C("code", {
15518
+ return /language-(\w+)/.exec(t || "")?.[1] === "attachments" ? /* @__PURE__ */ C(Fb, { children: e }) : /* @__PURE__ */ C("code", {
15471
15519
  className: t,
15472
15520
  style: {
15473
15521
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
@@ -15493,10 +15541,10 @@ function Hb({ threadId: e, isLoadingThreadId: n, isLoadingSandbox: r, isSandboxR
15493
15541
  toolbarVisible: !1,
15494
15542
  markdownRenderer: ({ content: e }) => !e || e.trim() === "" ? /* @__PURE__ */ C(S, {}) : /* @__PURE__ */ C(Ch, {
15495
15543
  remarkPlugins: [
15496
- Lb,
15544
+ zb,
15497
15545
  Dv,
15498
15546
  Hy,
15499
- Bb
15547
+ Hb
15500
15548
  ],
15501
15549
  components: {
15502
15550
  tool_call_content: ({ children: e, ...t }) => /* @__PURE__ */ C("div", {
@@ -15518,7 +15566,7 @@ function Hb({ threadId: e, isLoadingThreadId: n, isLoadingSandbox: r, isSandboxR
15518
15566
  ]
15519
15567
  });
15520
15568
  }
15521
- function Ub({ runtimeUrl: e, widgetToken: t, requiresSandbox: n = !1 }) {
15569
+ function Gb({ runtimeUrl: e, widgetToken: t, requiresSandbox: n = !1 }) {
15522
15570
  let [r, i] = d(void 0), [o, c] = d(!0), [u, p] = d(!1), [h, g] = d(0), [_, v] = d(!0), [y, b] = d(!1), [x, S] = d(!1);
15523
15571
  console.log("EricaChat Render:", {
15524
15572
  threadId: r,
@@ -15562,7 +15610,7 @@ function Ub({ runtimeUrl: e, widgetToken: t, requiresSandbox: n = !1 }) {
15562
15610
  ee,
15563
15611
  te
15564
15612
  ]);
15565
- return /* @__PURE__ */ C(Rb.Provider, {
15613
+ return /* @__PURE__ */ C(Bb.Provider, {
15566
15614
  value: re,
15567
15615
  children: /* @__PURE__ */ C(f, { children: /* @__PURE__ */ C(m, {
15568
15616
  runtimeUrl: e,
@@ -15573,7 +15621,7 @@ function Ub({ runtimeUrl: e, widgetToken: t, requiresSandbox: n = !1 }) {
15573
15621
  children: /* @__PURE__ */ C(En, {
15574
15622
  threadId: r,
15575
15623
  agentIdentifier: bn,
15576
- children: /* @__PURE__ */ C(Hb, {
15624
+ children: /* @__PURE__ */ C(Wb, {
15577
15625
  threadId: r,
15578
15626
  isLoadingThreadId: E,
15579
15627
  isLoadingSandbox: D,
@@ -15588,24 +15636,24 @@ function Ub({ runtimeUrl: e, widgetToken: t, requiresSandbox: n = !1 }) {
15588
15636
  }
15589
15637
  //#endregion
15590
15638
  //#region src/contexts/AccountContext.tsx
15591
- var Wb = n(void 0);
15592
- function Gb({ accountUid: e, children: t }) {
15593
- return /* @__PURE__ */ C(Wb.Provider, {
15639
+ var Kb = n(void 0);
15640
+ function qb({ accountUid: e, children: t }) {
15641
+ return /* @__PURE__ */ C(Kb.Provider, {
15594
15642
  value: { accountUid: e },
15595
15643
  children: t
15596
15644
  });
15597
15645
  }
15598
15646
  //#endregion
15599
15647
  //#region src/contexts/EricaProvider.tsx
15600
- var Kb = new Ht({ defaultOptions: { queries: {
15648
+ var Jb = new Ht({ defaultOptions: { queries: {
15601
15649
  refetchOnWindowFocus: !1,
15602
15650
  retry: 1,
15603
15651
  staleTime: 3e4
15604
15652
  } } });
15605
- function qb({ accountUid: e, children: t }) {
15653
+ function Yb({ accountUid: e, children: t }) {
15606
15654
  return /* @__PURE__ */ C(Gt, {
15607
- client: Kb,
15608
- children: /* @__PURE__ */ C(Gb, {
15655
+ client: Jb,
15656
+ children: /* @__PURE__ */ C(qb, {
15609
15657
  accountUid: e,
15610
15658
  children: /* @__PURE__ */ C(Xc, { children: t })
15611
15659
  })
@@ -15613,7 +15661,7 @@ function qb({ accountUid: e, children: t }) {
15613
15661
  }
15614
15662
  //#endregion
15615
15663
  //#region src/components/EricaDrawer.tsx
15616
- function Jb() {
15664
+ function Xb() {
15617
15665
  let { isOpen: e, onClose: t, content: n, title: r } = Zc(), [i, a] = d(!1);
15618
15666
  return s(() => {
15619
15667
  e ? setTimeout(() => a(!0), 10) : a(!1);
@@ -15643,6 +15691,6 @@ function Jb() {
15643
15691
  }) : null;
15644
15692
  }
15645
15693
  //#endregion
15646
- export { Xc as ArtifactProvider, Ub as EricaChat, Jb as EricaDrawer, qb as EricaProvider };
15694
+ export { Xc as ArtifactProvider, Gb as EricaChat, Xb as EricaDrawer, Yb as EricaProvider };
15647
15695
 
15648
15696
  //# sourceMappingURL=index.mjs.map