@fusioni/client-sdk 1.1.25 → 1.1.26

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.
@@ -490,7 +490,7 @@ var Fusioni = (function () {
490
490
  attachedImages: 'Images',
491
491
  attachedVideos: 'Videos',
492
492
  messages: {
493
- loading: 'Working on it...',
493
+ loading: 'Thinking...',
494
494
  error: 'Oops! Something went wrong. Please try again later.',
495
495
  delete: 'Delete message',
496
496
  deleteConfirm: {
@@ -595,7 +595,7 @@ var Fusioni = (function () {
595
595
  attachedImages: 'Εικόνες',
596
596
  attachedVideos: 'Βίντεο',
597
597
  messages: {
598
- loading: 'Εργάζομαι...',
598
+ loading: 'Thinking...',
599
599
  error: 'Ουπς! Κάτι πήγε στραβά. Παρακαλώ δοκιμάστε ξανά αργότερα.',
600
600
  delete: 'Διαγραφή μηνύματος',
601
601
  deleteConfirm: {
@@ -4546,7 +4546,7 @@ var Fusioni = (function () {
4546
4546
  mergeConfig
4547
4547
  } = axios;
4548
4548
 
4549
- /** Decode SSE `event.data` (plain text or JSON with a `data` field), matching fusioni-web chat usage. */
4549
+ /** Decode SSE `event.data` (plain text, JSON with `data`, or chat stream `{ conversation_id, message }`). */
4550
4550
  function normalizeSsePayload(raw) {
4551
4551
  const s = raw?.trim() ?? '';
4552
4552
  if (!s) {
@@ -4554,18 +4554,33 @@ var Fusioni = (function () {
4554
4554
  }
4555
4555
  try {
4556
4556
  const parsed = JSON.parse(s);
4557
- if (parsed !== null && typeof parsed === 'object' && 'data' in parsed) {
4558
- const inner = parsed.data;
4559
- if (inner === undefined || inner === null) {
4560
- return null;
4561
- }
4562
- if (typeof inner === 'string') {
4563
- return inner;
4557
+ if (parsed !== null && typeof parsed === 'object') {
4558
+ if ('data' in parsed) {
4559
+ const inner = parsed.data;
4560
+ if (inner === undefined || inner === null) {
4561
+ return null;
4562
+ }
4563
+ if (typeof inner === 'string') {
4564
+ return inner;
4565
+ }
4566
+ if (typeof inner === 'number' || typeof inner === 'boolean') {
4567
+ return String(inner);
4568
+ }
4569
+ return JSON.stringify(inner);
4564
4570
  }
4565
- if (typeof inner === 'number' || typeof inner === 'boolean') {
4566
- return String(inner);
4571
+ if ('message' in parsed) {
4572
+ const message = parsed.message;
4573
+ if (message === undefined || message === null) {
4574
+ return null;
4575
+ }
4576
+ if (typeof message === 'string') {
4577
+ return message;
4578
+ }
4579
+ if (typeof message === 'number' || typeof message === 'boolean') {
4580
+ return String(message);
4581
+ }
4582
+ return JSON.stringify(message);
4567
4583
  }
4568
- return JSON.stringify(inner);
4569
4584
  }
4570
4585
  }
4571
4586
  catch {
@@ -7432,7 +7447,7 @@ var Fusioni = (function () {
7432
7447
  const Fusioni = {
7433
7448
  init,
7434
7449
  mount,
7435
- version: "1.1.24",
7450
+ version: "1.1.25",
7436
7451
  };
7437
7452
  if (typeof window !== 'undefined') {
7438
7453
  window.Fusioni = Fusioni;