teodor-new-chat-ui 4.3.463 → 4.3.464

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.esm.js CHANGED
@@ -395,14 +395,14 @@ function xx() {
395
395
  }
396
396
  return null;
397
397
  }
398
- var N = Object.assign, Y = 0, q, F, P, k, V, X, j;
398
+ var N = Object.assign, Y = 0, q, F, P, k, U, X, j;
399
399
  function A() {
400
400
  }
401
401
  A.__reactDisabledLog = !0;
402
402
  function B() {
403
403
  {
404
404
  if (Y === 0) {
405
- q = console.log, F = console.info, P = console.warn, k = console.error, V = console.group, X = console.groupCollapsed, j = console.groupEnd;
405
+ q = console.log, F = console.info, P = console.warn, k = console.error, U = console.group, X = console.groupCollapsed, j = console.groupEnd;
406
406
  var I = {
407
407
  configurable: !0,
408
408
  enumerable: !0,
@@ -444,7 +444,7 @@ function xx() {
444
444
  value: k
445
445
  }),
446
446
  group: N({}, I, {
447
- value: V
447
+ value: U
448
448
  }),
449
449
  groupCollapsed: N({}, I, {
450
450
  value: X
@@ -457,18 +457,18 @@ function xx() {
457
457
  Y < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
458
458
  }
459
459
  }
460
- var ne = b.ReactCurrentDispatcher, U;
460
+ var ne = b.ReactCurrentDispatcher, W;
461
461
  function D(I, ee, de) {
462
462
  {
463
- if (U === void 0)
463
+ if (W === void 0)
464
464
  try {
465
465
  throw Error();
466
466
  } catch (Xe) {
467
467
  var ke = Xe.stack.trim().match(/\n( *(at )?)/);
468
- U = ke && ke[1] || "";
468
+ W = ke && ke[1] || "";
469
469
  }
470
470
  return `
471
- ` + U + I;
471
+ ` + W + I;
472
472
  }
473
473
  }
474
474
  var J = !1, Q;
@@ -1147,7 +1147,7 @@ const Zx = (e) => {
1147
1147
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
1148
1148
  typeof setImmediate == "function",
1149
1149
  qt(Zn.postMessage)
1150
- ), tv = typeof queueMicrotask < "u" ? queueMicrotask.bind(Zn) : typeof process < "u" && process.nextTick || qu, nv = (e) => e != null && qt(e[js]), W = {
1150
+ ), tv = typeof queueMicrotask < "u" ? queueMicrotask.bind(Zn) : typeof process < "u" && process.nextTick || qu, nv = (e) => e != null && qt(e[js]), V = {
1151
1151
  isArray: Dr,
1152
1152
  isArrayBuffer: Hu,
1153
1153
  isBuffer: bo,
@@ -1210,7 +1210,7 @@ const Zx = (e) => {
1210
1210
  function Pe(e, t, n, r, o) {
1211
1211
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
1212
1212
  }
1213
- W.inherits(Pe, Error, {
1213
+ V.inherits(Pe, Error, {
1214
1214
  toJSON: function() {
1215
1215
  return {
1216
1216
  // Standard
@@ -1225,7 +1225,7 @@ W.inherits(Pe, Error, {
1225
1225
  columnNumber: this.columnNumber,
1226
1226
  stack: this.stack,
1227
1227
  // Axios
1228
- config: W.toJSONObject(this.config),
1228
+ config: V.toJSONObject(this.config),
1229
1229
  code: this.code,
1230
1230
  status: this.status
1231
1231
  };
@@ -1253,7 +1253,7 @@ Object.defineProperties(Pe, Yu);
1253
1253
  Object.defineProperty(Gu, "isAxiosError", { value: !0 });
1254
1254
  Pe.from = (e, t, n, r, o, s) => {
1255
1255
  const a = Object.create(Gu);
1256
- W.toFlatObject(e, a, function(d) {
1256
+ V.toFlatObject(e, a, function(d) {
1257
1257
  return d !== Error.prototype;
1258
1258
  }, (c) => c !== "isAxiosError");
1259
1259
  const i = e && e.message ? e.message : "Error", l = t == null && e ? e.code : t;
@@ -1261,10 +1261,10 @@ Pe.from = (e, t, n, r, o, s) => {
1261
1261
  };
1262
1262
  const rv = null;
1263
1263
  function qa(e) {
1264
- return W.isPlainObject(e) || W.isArray(e);
1264
+ return V.isPlainObject(e) || V.isArray(e);
1265
1265
  }
1266
1266
  function Xu(e) {
1267
- return W.endsWith(e, "[]") ? e.slice(0, -2) : e;
1267
+ return V.endsWith(e, "[]") ? e.slice(0, -2) : e;
1268
1268
  }
1269
1269
  function Jl(e, t, n) {
1270
1270
  return e ? e.concat(t).map(function(o, s) {
@@ -1272,42 +1272,42 @@ function Jl(e, t, n) {
1272
1272
  }).join(n ? "." : "") : t;
1273
1273
  }
1274
1274
  function ov(e) {
1275
- return W.isArray(e) && !e.some(qa);
1275
+ return V.isArray(e) && !e.some(qa);
1276
1276
  }
1277
- const sv = W.toFlatObject(W, {}, null, function(t) {
1277
+ const sv = V.toFlatObject(V, {}, null, function(t) {
1278
1278
  return /^is[A-Z]/.test(t);
1279
1279
  });
1280
1280
  function Ms(e, t, n) {
1281
- if (!W.isObject(e))
1281
+ if (!V.isObject(e))
1282
1282
  throw new TypeError("target must be an object");
1283
- t = t || new FormData(), n = W.toFlatObject(n, {
1283
+ t = t || new FormData(), n = V.toFlatObject(n, {
1284
1284
  metaTokens: !0,
1285
1285
  dots: !1,
1286
1286
  indexes: !1
1287
1287
  }, !1, function(g, x) {
1288
- return !W.isUndefined(x[g]);
1288
+ return !V.isUndefined(x[g]);
1289
1289
  });
1290
- const r = n.metaTokens, o = n.visitor || d, s = n.dots, a = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && W.isSpecCompliantForm(t);
1291
- if (!W.isFunction(o))
1290
+ const r = n.metaTokens, o = n.visitor || d, s = n.dots, a = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && V.isSpecCompliantForm(t);
1291
+ if (!V.isFunction(o))
1292
1292
  throw new TypeError("visitor must be a function");
1293
1293
  function c(v) {
1294
1294
  if (v === null) return "";
1295
- if (W.isDate(v))
1295
+ if (V.isDate(v))
1296
1296
  return v.toISOString();
1297
- if (W.isBoolean(v))
1297
+ if (V.isBoolean(v))
1298
1298
  return v.toString();
1299
- if (!l && W.isBlob(v))
1299
+ if (!l && V.isBlob(v))
1300
1300
  throw new Pe("Blob is not supported. Use a Buffer instead.");
1301
- return W.isArrayBuffer(v) || W.isTypedArray(v) ? l && typeof Blob == "function" ? new Blob([v]) : Buffer.from(v) : v;
1301
+ return V.isArrayBuffer(v) || V.isTypedArray(v) ? l && typeof Blob == "function" ? new Blob([v]) : Buffer.from(v) : v;
1302
1302
  }
1303
1303
  function d(v, g, x) {
1304
1304
  let b = v;
1305
1305
  if (v && !x && typeof v == "object") {
1306
- if (W.endsWith(g, "{}"))
1306
+ if (V.endsWith(g, "{}"))
1307
1307
  g = r ? g : g.slice(0, -2), v = JSON.stringify(v);
1308
- else if (W.isArray(v) && ov(v) || (W.isFileList(v) || W.endsWith(g, "[]")) && (b = W.toArray(v)))
1308
+ else if (V.isArray(v) && ov(v) || (V.isFileList(v) || V.endsWith(g, "[]")) && (b = V.toArray(v)))
1309
1309
  return g = Xu(g), b.forEach(function(y, C) {
1310
- !(W.isUndefined(y) || y === null) && t.append(
1310
+ !(V.isUndefined(y) || y === null) && t.append(
1311
1311
  // eslint-disable-next-line no-nested-ternary
1312
1312
  a === !0 ? Jl([g], C, s) : a === null ? g : g + "[]",
1313
1313
  c(y)
@@ -1322,21 +1322,21 @@ function Ms(e, t, n) {
1322
1322
  isVisitable: qa
1323
1323
  });
1324
1324
  function f(v, g) {
1325
- if (!W.isUndefined(v)) {
1325
+ if (!V.isUndefined(v)) {
1326
1326
  if (p.indexOf(v) !== -1)
1327
1327
  throw Error("Circular reference detected in " + g.join("."));
1328
- p.push(v), W.forEach(v, function(b, w) {
1329
- (!(W.isUndefined(b) || b === null) && o.call(
1328
+ p.push(v), V.forEach(v, function(b, w) {
1329
+ (!(V.isUndefined(b) || b === null) && o.call(
1330
1330
  t,
1331
1331
  b,
1332
- W.isString(w) ? w.trim() : w,
1332
+ V.isString(w) ? w.trim() : w,
1333
1333
  g,
1334
1334
  m
1335
1335
  )) === !0 && f(b, g ? g.concat(w) : [w]);
1336
1336
  }), p.pop();
1337
1337
  }
1338
1338
  }
1339
- if (!W.isObject(e))
1339
+ if (!V.isObject(e))
1340
1340
  throw new TypeError("data must be an object");
1341
1341
  return f(e), t;
1342
1342
  }
@@ -1376,12 +1376,12 @@ function Zu(e, t, n) {
1376
1376
  if (!t)
1377
1377
  return e;
1378
1378
  const r = n && n.encode || av;
1379
- W.isFunction(n) && (n = {
1379
+ V.isFunction(n) && (n = {
1380
1380
  serialize: n
1381
1381
  });
1382
1382
  const o = n && n.serialize;
1383
1383
  let s;
1384
- if (o ? s = o(t, n) : s = W.isURLSearchParams(t) ? t.toString() : new Ai(t, n).toString(r), s) {
1384
+ if (o ? s = o(t, n) : s = V.isURLSearchParams(t) ? t.toString() : new Ai(t, n).toString(r), s) {
1385
1385
  const a = e.indexOf("#");
1386
1386
  a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
1387
1387
  }
@@ -1436,7 +1436,7 @@ class Ql {
1436
1436
  * @returns {void}
1437
1437
  */
1438
1438
  forEach(t) {
1439
- W.forEach(this.handlers, function(r) {
1439
+ V.forEach(this.handlers, function(r) {
1440
1440
  r !== null && t(r);
1441
1441
  });
1442
1442
  }
@@ -1468,13 +1468,13 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", pv
1468
1468
  function mv(e, t) {
1469
1469
  return Ms(e, new Lt.classes.URLSearchParams(), {
1470
1470
  visitor: function(n, r, o, s) {
1471
- return Lt.isNode && W.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1471
+ return Lt.isNode && V.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1472
1472
  },
1473
1473
  ...t
1474
1474
  });
1475
1475
  }
1476
1476
  function gv(e) {
1477
- return W.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1477
+ return V.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1478
1478
  }
1479
1479
  function xv(e) {
1480
1480
  const t = {}, n = Object.keys(e);
@@ -1490,20 +1490,20 @@ function ed(e) {
1490
1490
  let a = n[s++];
1491
1491
  if (a === "__proto__") return !0;
1492
1492
  const i = Number.isFinite(+a), l = s >= n.length;
1493
- return a = !a && W.isArray(o) ? o.length : a, l ? (W.hasOwnProp(o, a) ? o[a] = [o[a], r] : o[a] = r, !i) : ((!o[a] || !W.isObject(o[a])) && (o[a] = []), t(n, r, o[a], s) && W.isArray(o[a]) && (o[a] = xv(o[a])), !i);
1493
+ return a = !a && V.isArray(o) ? o.length : a, l ? (V.hasOwnProp(o, a) ? o[a] = [o[a], r] : o[a] = r, !i) : ((!o[a] || !V.isObject(o[a])) && (o[a] = []), t(n, r, o[a], s) && V.isArray(o[a]) && (o[a] = xv(o[a])), !i);
1494
1494
  }
1495
- if (W.isFormData(e) && W.isFunction(e.entries)) {
1495
+ if (V.isFormData(e) && V.isFunction(e.entries)) {
1496
1496
  const n = {};
1497
- return W.forEachEntry(e, (r, o) => {
1497
+ return V.forEachEntry(e, (r, o) => {
1498
1498
  t(gv(r), o, n, 0);
1499
1499
  }), n;
1500
1500
  }
1501
1501
  return null;
1502
1502
  }
1503
1503
  function vv(e, t, n) {
1504
- if (W.isString(e))
1504
+ if (V.isString(e))
1505
1505
  try {
1506
- return (t || JSON.parse)(e), W.trim(e);
1506
+ return (t || JSON.parse)(e), V.trim(e);
1507
1507
  } catch (r) {
1508
1508
  if (r.name !== "SyntaxError")
1509
1509
  throw r;
@@ -1514,20 +1514,20 @@ const To = {
1514
1514
  transitional: Qu,
1515
1515
  adapter: ["xhr", "http", "fetch"],
1516
1516
  transformRequest: [function(t, n) {
1517
- const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = W.isObject(t);
1518
- if (s && W.isHTMLForm(t) && (t = new FormData(t)), W.isFormData(t))
1517
+ const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = V.isObject(t);
1518
+ if (s && V.isHTMLForm(t) && (t = new FormData(t)), V.isFormData(t))
1519
1519
  return o ? JSON.stringify(ed(t)) : t;
1520
- if (W.isArrayBuffer(t) || W.isBuffer(t) || W.isStream(t) || W.isFile(t) || W.isBlob(t) || W.isReadableStream(t))
1520
+ if (V.isArrayBuffer(t) || V.isBuffer(t) || V.isStream(t) || V.isFile(t) || V.isBlob(t) || V.isReadableStream(t))
1521
1521
  return t;
1522
- if (W.isArrayBufferView(t))
1522
+ if (V.isArrayBufferView(t))
1523
1523
  return t.buffer;
1524
- if (W.isURLSearchParams(t))
1524
+ if (V.isURLSearchParams(t))
1525
1525
  return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
1526
1526
  let i;
1527
1527
  if (s) {
1528
1528
  if (r.indexOf("application/x-www-form-urlencoded") > -1)
1529
1529
  return mv(t, this.formSerializer).toString();
1530
- if ((i = W.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1530
+ if ((i = V.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1531
1531
  const l = this.env && this.env.FormData;
1532
1532
  return Ms(
1533
1533
  i ? { "files[]": t } : t,
@@ -1540,9 +1540,9 @@ const To = {
1540
1540
  }],
1541
1541
  transformResponse: [function(t) {
1542
1542
  const n = this.transitional || To.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
1543
- if (W.isResponse(t) || W.isReadableStream(t))
1543
+ if (V.isResponse(t) || V.isReadableStream(t))
1544
1544
  return t;
1545
- if (t && W.isString(t) && (r && !this.responseType || o)) {
1545
+ if (t && V.isString(t) && (r && !this.responseType || o)) {
1546
1546
  const a = !(n && n.silentJSONParsing) && o;
1547
1547
  try {
1548
1548
  return JSON.parse(t, this.parseReviver);
@@ -1576,10 +1576,10 @@ const To = {
1576
1576
  }
1577
1577
  }
1578
1578
  };
1579
- W.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1579
+ V.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1580
1580
  To.headers[e] = {};
1581
1581
  });
1582
- const wv = W.toObjectSet([
1582
+ const wv = V.toObjectSet([
1583
1583
  "age",
1584
1584
  "authorization",
1585
1585
  "content-length",
@@ -1609,7 +1609,7 @@ function qr(e) {
1609
1609
  return e && String(e).trim().toLowerCase();
1610
1610
  }
1611
1611
  function Zo(e) {
1612
- return e === !1 || e == null ? e : W.isArray(e) ? e.map(Zo) : String(e);
1612
+ return e === !1 || e == null ? e : V.isArray(e) ? e.map(Zo) : String(e);
1613
1613
  }
1614
1614
  function yv(e) {
1615
1615
  const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
@@ -1620,12 +1620,12 @@ function yv(e) {
1620
1620
  }
1621
1621
  const Sv = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
1622
1622
  function wa(e, t, n, r, o) {
1623
- if (W.isFunction(r))
1623
+ if (V.isFunction(r))
1624
1624
  return r.call(this, t, n);
1625
- if (o && (t = n), !!W.isString(t)) {
1626
- if (W.isString(r))
1625
+ if (o && (t = n), !!V.isString(t)) {
1626
+ if (V.isString(r))
1627
1627
  return t.indexOf(r) !== -1;
1628
- if (W.isRegExp(r))
1628
+ if (V.isRegExp(r))
1629
1629
  return r.test(t);
1630
1630
  }
1631
1631
  }
@@ -1633,7 +1633,7 @@ function Tv(e) {
1633
1633
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
1634
1634
  }
1635
1635
  function Cv(e, t) {
1636
- const n = W.toCamelCase(" " + t);
1636
+ const n = V.toCamelCase(" " + t);
1637
1637
  ["get", "set", "has"].forEach((r) => {
1638
1638
  Object.defineProperty(e, r + n, {
1639
1639
  value: function(o, s, a) {
@@ -1653,20 +1653,20 @@ let Gt = class {
1653
1653
  const d = qr(l);
1654
1654
  if (!d)
1655
1655
  throw new Error("header name must be a non-empty string");
1656
- const p = W.findKey(o, d);
1656
+ const p = V.findKey(o, d);
1657
1657
  (!p || o[p] === void 0 || c === !0 || c === void 0 && o[p] !== !1) && (o[p || l] = Zo(i));
1658
1658
  }
1659
- const a = (i, l) => W.forEach(i, (c, d) => s(c, d, l));
1660
- if (W.isPlainObject(t) || t instanceof this.constructor)
1659
+ const a = (i, l) => V.forEach(i, (c, d) => s(c, d, l));
1660
+ if (V.isPlainObject(t) || t instanceof this.constructor)
1661
1661
  a(t, n);
1662
- else if (W.isString(t) && (t = t.trim()) && !Sv(t))
1662
+ else if (V.isString(t) && (t = t.trim()) && !Sv(t))
1663
1663
  a(bv(t), n);
1664
- else if (W.isObject(t) && W.isIterable(t)) {
1664
+ else if (V.isObject(t) && V.isIterable(t)) {
1665
1665
  let i = {}, l, c;
1666
1666
  for (const d of t) {
1667
- if (!W.isArray(d))
1667
+ if (!V.isArray(d))
1668
1668
  throw TypeError("Object iterator must return a key-value pair");
1669
- i[c = d[0]] = (l = i[c]) ? W.isArray(l) ? [...l, d[1]] : [l, d[1]] : d[1];
1669
+ i[c = d[0]] = (l = i[c]) ? V.isArray(l) ? [...l, d[1]] : [l, d[1]] : d[1];
1670
1670
  }
1671
1671
  a(i, n);
1672
1672
  } else
@@ -1675,16 +1675,16 @@ let Gt = class {
1675
1675
  }
1676
1676
  get(t, n) {
1677
1677
  if (t = qr(t), t) {
1678
- const r = W.findKey(this, t);
1678
+ const r = V.findKey(this, t);
1679
1679
  if (r) {
1680
1680
  const o = this[r];
1681
1681
  if (!n)
1682
1682
  return o;
1683
1683
  if (n === !0)
1684
1684
  return yv(o);
1685
- if (W.isFunction(n))
1685
+ if (V.isFunction(n))
1686
1686
  return n.call(this, o, r);
1687
- if (W.isRegExp(n))
1687
+ if (V.isRegExp(n))
1688
1688
  return n.exec(o);
1689
1689
  throw new TypeError("parser must be boolean|regexp|function");
1690
1690
  }
@@ -1692,7 +1692,7 @@ let Gt = class {
1692
1692
  }
1693
1693
  has(t, n) {
1694
1694
  if (t = qr(t), t) {
1695
- const r = W.findKey(this, t);
1695
+ const r = V.findKey(this, t);
1696
1696
  return !!(r && this[r] !== void 0 && (!n || wa(this, this[r], r, n)));
1697
1697
  }
1698
1698
  return !1;
@@ -1702,11 +1702,11 @@ let Gt = class {
1702
1702
  let o = !1;
1703
1703
  function s(a) {
1704
1704
  if (a = qr(a), a) {
1705
- const i = W.findKey(r, a);
1705
+ const i = V.findKey(r, a);
1706
1706
  i && (!n || wa(r, r[i], i, n)) && (delete r[i], o = !0);
1707
1707
  }
1708
1708
  }
1709
- return W.isArray(t) ? t.forEach(s) : s(t), o;
1709
+ return V.isArray(t) ? t.forEach(s) : s(t), o;
1710
1710
  }
1711
1711
  clear(t) {
1712
1712
  const n = Object.keys(this);
@@ -1719,8 +1719,8 @@ let Gt = class {
1719
1719
  }
1720
1720
  normalize(t) {
1721
1721
  const n = this, r = {};
1722
- return W.forEach(this, (o, s) => {
1723
- const a = W.findKey(r, s);
1722
+ return V.forEach(this, (o, s) => {
1723
+ const a = V.findKey(r, s);
1724
1724
  if (a) {
1725
1725
  n[a] = Zo(o), delete n[s];
1726
1726
  return;
@@ -1734,8 +1734,8 @@ let Gt = class {
1734
1734
  }
1735
1735
  toJSON(t) {
1736
1736
  const n = /* @__PURE__ */ Object.create(null);
1737
- return W.forEach(this, (r, o) => {
1738
- r != null && r !== !1 && (n[o] = t && W.isArray(r) ? r.join(", ") : r);
1737
+ return V.forEach(this, (r, o) => {
1738
+ r != null && r !== !1 && (n[o] = t && V.isArray(r) ? r.join(", ") : r);
1739
1739
  }), n;
1740
1740
  }
1741
1741
  [Symbol.iterator]() {
@@ -1766,11 +1766,11 @@ let Gt = class {
1766
1766
  const i = qr(a);
1767
1767
  r[i] || (Cv(o, a), r[i] = !0);
1768
1768
  }
1769
- return W.isArray(t) ? t.forEach(s) : s(t), this;
1769
+ return V.isArray(t) ? t.forEach(s) : s(t), this;
1770
1770
  }
1771
1771
  };
1772
1772
  Gt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1773
- W.reduceDescriptors(Gt.prototype, ({ value: e }, t) => {
1773
+ V.reduceDescriptors(Gt.prototype, ({ value: e }, t) => {
1774
1774
  let n = t[0].toUpperCase() + t.slice(1);
1775
1775
  return {
1776
1776
  get: () => e,
@@ -1779,11 +1779,11 @@ W.reduceDescriptors(Gt.prototype, ({ value: e }, t) => {
1779
1779
  }
1780
1780
  };
1781
1781
  });
1782
- W.freezeMethods(Gt);
1782
+ V.freezeMethods(Gt);
1783
1783
  function ba(e, t) {
1784
1784
  const n = this || To, r = t || n, o = Gt.from(r.headers);
1785
1785
  let s = r.data;
1786
- return W.forEach(e, function(i) {
1786
+ return V.forEach(e, function(i) {
1787
1787
  s = i.call(n, s, o.normalize(), t ? t.status : void 0);
1788
1788
  }), o.normalize(), s;
1789
1789
  }
@@ -1793,7 +1793,7 @@ function td(e) {
1793
1793
  function Lr(e, t, n) {
1794
1794
  Pe.call(this, e ?? "canceled", Pe.ERR_CANCELED, t, n), this.name = "CanceledError";
1795
1795
  }
1796
- W.inherits(Lr, Pe, {
1796
+ V.inherits(Lr, Pe, {
1797
1797
  __CANCEL__: !0
1798
1798
  });
1799
1799
  function nd(e, t, n) {
@@ -1864,7 +1864,7 @@ const ds = (e, t, n = 3) => {
1864
1864
  total: e,
1865
1865
  loaded: r
1866
1866
  }), t[1]];
1867
- }, nc = (e) => (...t) => W.asap(() => e(...t)), Iv = Lt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, Lt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1867
+ }, nc = (e) => (...t) => V.asap(() => e(...t)), Iv = Lt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, Lt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1868
1868
  new URL(Lt.origin),
1869
1869
  Lt.navigator && /(msie|trident)/i.test(Lt.navigator.userAgent)
1870
1870
  ) : () => !0, Nv = Lt.hasStandardBrowserEnv ? (
@@ -1872,7 +1872,7 @@ const ds = (e, t, n = 3) => {
1872
1872
  {
1873
1873
  write(e, t, n, r, o, s) {
1874
1874
  const a = [e + "=" + encodeURIComponent(t)];
1875
- W.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), W.isString(r) && a.push("path=" + r), W.isString(o) && a.push("domain=" + o), s === !0 && a.push("secure"), document.cookie = a.join("; ");
1875
+ V.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), V.isString(r) && a.push("path=" + r), V.isString(o) && a.push("domain=" + o), s === !0 && a.push("secure"), document.cookie = a.join("; ");
1876
1876
  },
1877
1877
  read(e) {
1878
1878
  const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
@@ -1909,21 +1909,21 @@ function ar(e, t) {
1909
1909
  t = t || {};
1910
1910
  const n = {};
1911
1911
  function r(c, d, p, m) {
1912
- return W.isPlainObject(c) && W.isPlainObject(d) ? W.merge.call({ caseless: m }, c, d) : W.isPlainObject(d) ? W.merge({}, d) : W.isArray(d) ? d.slice() : d;
1912
+ return V.isPlainObject(c) && V.isPlainObject(d) ? V.merge.call({ caseless: m }, c, d) : V.isPlainObject(d) ? V.merge({}, d) : V.isArray(d) ? d.slice() : d;
1913
1913
  }
1914
1914
  function o(c, d, p, m) {
1915
- if (W.isUndefined(d)) {
1916
- if (!W.isUndefined(c))
1915
+ if (V.isUndefined(d)) {
1916
+ if (!V.isUndefined(c))
1917
1917
  return r(void 0, c, p, m);
1918
1918
  } else return r(c, d, p, m);
1919
1919
  }
1920
1920
  function s(c, d) {
1921
- if (!W.isUndefined(d))
1921
+ if (!V.isUndefined(d))
1922
1922
  return r(void 0, d);
1923
1923
  }
1924
1924
  function a(c, d) {
1925
- if (W.isUndefined(d)) {
1926
- if (!W.isUndefined(c))
1925
+ if (V.isUndefined(d)) {
1926
+ if (!V.isUndefined(c))
1927
1927
  return r(void 0, c);
1928
1928
  } else return r(void 0, d);
1929
1929
  }
@@ -1964,9 +1964,9 @@ function ar(e, t) {
1964
1964
  validateStatus: i,
1965
1965
  headers: (c, d, p) => o(rc(c), rc(d), p, !0)
1966
1966
  };
1967
- return W.forEach(Object.keys({ ...e, ...t }), function(d) {
1967
+ return V.forEach(Object.keys({ ...e, ...t }), function(d) {
1968
1968
  const p = l[d] || o, m = p(e[d], t[d], d);
1969
- W.isUndefined(m) && p !== i || (n[d] = m);
1969
+ V.isUndefined(m) && p !== i || (n[d] = m);
1970
1970
  }), n;
1971
1971
  }
1972
1972
  const od = (e) => {
@@ -1975,17 +1975,17 @@ const od = (e) => {
1975
1975
  if (t.headers = a = Gt.from(a), t.url = Zu(rd(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), i && a.set(
1976
1976
  "Authorization",
1977
1977
  "Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
1978
- ), W.isFormData(n)) {
1978
+ ), V.isFormData(n)) {
1979
1979
  if (Lt.hasStandardBrowserEnv || Lt.hasStandardBrowserWebWorkerEnv)
1980
1980
  a.setContentType(void 0);
1981
- else if (W.isFunction(n.getHeaders)) {
1981
+ else if (V.isFunction(n.getHeaders)) {
1982
1982
  const l = n.getHeaders(), c = ["content-type", "content-length"];
1983
1983
  Object.entries(l).forEach(([d, p]) => {
1984
1984
  c.includes(d.toLowerCase()) && a.set(d, p);
1985
1985
  });
1986
1986
  }
1987
1987
  }
1988
- if (Lt.hasStandardBrowserEnv && (r && W.isFunction(r) && (r = r(t)), r || r !== !1 && Iv(t.url))) {
1988
+ if (Lt.hasStandardBrowserEnv && (r && V.isFunction(r) && (r = r(t)), r || r !== !1 && Iv(t.url))) {
1989
1989
  const l = o && s && Nv.read(s);
1990
1990
  l && a.set(o, l);
1991
1991
  }
@@ -2036,9 +2036,9 @@ const od = (e) => {
2036
2036
  e,
2037
2037
  x
2038
2038
  )), x = null;
2039
- }, s === void 0 && a.setContentType(null), "setRequestHeader" in x && W.forEach(a.toJSON(), function(C, S) {
2039
+ }, s === void 0 && a.setContentType(null), "setRequestHeader" in x && V.forEach(a.toJSON(), function(C, S) {
2040
2040
  x.setRequestHeader(S, C);
2041
- }), W.isUndefined(o.withCredentials) || (x.withCredentials = !!o.withCredentials), i && i !== "json" && (x.responseType = o.responseType), c && ([m, v] = ds(c, !0), x.addEventListener("progress", m)), l && x.upload && ([p, f] = ds(l), x.upload.addEventListener("progress", p), x.upload.addEventListener("loadend", f)), (o.cancelToken || o.signal) && (d = (y) => {
2041
+ }), V.isUndefined(o.withCredentials) || (x.withCredentials = !!o.withCredentials), i && i !== "json" && (x.responseType = o.responseType), c && ([m, v] = ds(c, !0), x.addEventListener("progress", m)), l && x.upload && ([p, f] = ds(l), x.upload.addEventListener("progress", p), x.upload.addEventListener("loadend", f)), (o.cancelToken || o.signal) && (d = (y) => {
2042
2042
  x && (r(!y || y.type ? new Lr(null, e, x) : y), x.abort(), x = null);
2043
2043
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
2044
2044
  const w = Ev(o.url);
@@ -2069,7 +2069,7 @@ const od = (e) => {
2069
2069
  };
2070
2070
  e.forEach((c) => c.addEventListener("abort", s));
2071
2071
  const { signal: l } = r;
2072
- return l.unsubscribe = () => W.asap(i), l;
2072
+ return l.unsubscribe = () => V.asap(i), l;
2073
2073
  }
2074
2074
  }, Ov = function* (e, t) {
2075
2075
  let n = e.byteLength;
@@ -2128,20 +2128,20 @@ const od = (e) => {
2128
2128
  }, {
2129
2129
  highWaterMark: 2
2130
2130
  });
2131
- }, sc = 64 * 1024, { isFunction: $o } = W, $v = (({ Request: e, Response: t }) => ({
2131
+ }, sc = 64 * 1024, { isFunction: $o } = V, $v = (({ Request: e, Response: t }) => ({
2132
2132
  Request: e,
2133
2133
  Response: t
2134
- }))(W.global), {
2134
+ }))(V.global), {
2135
2135
  ReadableStream: ac,
2136
2136
  TextEncoder: ic
2137
- } = W.global, lc = (e, ...t) => {
2137
+ } = V.global, lc = (e, ...t) => {
2138
2138
  try {
2139
2139
  return !!e(...t);
2140
2140
  } catch {
2141
2141
  return !1;
2142
2142
  }
2143
2143
  }, Fv = (e) => {
2144
- e = W.merge.call({
2144
+ e = V.merge.call({
2145
2145
  skipUndefined: !0
2146
2146
  }, $v, e);
2147
2147
  const { fetch: t, Request: n, Response: r } = e, o = t ? $o(t) : typeof fetch == "function", s = $o(n), a = $o(r);
@@ -2157,7 +2157,7 @@ const od = (e) => {
2157
2157
  }
2158
2158
  }).headers.has("Content-Type");
2159
2159
  return v && !g;
2160
- }), d = a && i && lc(() => W.isReadableStream(new r("").body)), p = {
2160
+ }), d = a && i && lc(() => V.isReadableStream(new r("").body)), p = {
2161
2161
  stream: d && ((v) => v.body)
2162
2162
  };
2163
2163
  o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((v) => {
@@ -2171,19 +2171,19 @@ const od = (e) => {
2171
2171
  const m = async (v) => {
2172
2172
  if (v == null)
2173
2173
  return 0;
2174
- if (W.isBlob(v))
2174
+ if (V.isBlob(v))
2175
2175
  return v.size;
2176
- if (W.isSpecCompliantForm(v))
2176
+ if (V.isSpecCompliantForm(v))
2177
2177
  return (await new n(Lt.origin, {
2178
2178
  method: "POST",
2179
2179
  body: v
2180
2180
  }).arrayBuffer()).byteLength;
2181
- if (W.isArrayBufferView(v) || W.isArrayBuffer(v))
2181
+ if (V.isArrayBufferView(v) || V.isArrayBuffer(v))
2182
2182
  return v.byteLength;
2183
- if (W.isURLSearchParams(v) && (v = v + ""), W.isString(v))
2183
+ if (V.isURLSearchParams(v) && (v = v + ""), V.isString(v))
2184
2184
  return (await l(v)).byteLength;
2185
2185
  }, f = async (v, g) => {
2186
- const x = W.toFiniteNumber(v.getContentLength());
2186
+ const x = V.toFiniteNumber(v.getContentLength());
2187
2187
  return x ?? m(g);
2188
2188
  };
2189
2189
  return async (v) => {
@@ -2214,7 +2214,7 @@ const od = (e) => {
2214
2214
  body: b,
2215
2215
  duplex: "half"
2216
2216
  }), j;
2217
- if (W.isFormData(b) && (j = X.headers.get("content-type")) && R.setContentType(j), X.body) {
2217
+ if (V.isFormData(b) && (j = X.headers.get("content-type")) && R.setContentType(j), X.body) {
2218
2218
  const [A, B] = tc(
2219
2219
  Y,
2220
2220
  ds(nc(T))
@@ -2222,7 +2222,7 @@ const od = (e) => {
2222
2222
  b = oc(X.body, sc, A, B);
2223
2223
  }
2224
2224
  }
2225
- W.isString(_) || (_ = _ ? "include" : "omit");
2225
+ V.isString(_) || (_ = _ ? "include" : "omit");
2226
2226
  const q = s && "credentials" in n.prototype, F = {
2227
2227
  ...O,
2228
2228
  signal: K,
@@ -2240,7 +2240,7 @@ const od = (e) => {
2240
2240
  ["status", "statusText", "headers"].forEach(($) => {
2241
2241
  X[$] = P[$];
2242
2242
  });
2243
- const j = W.toFiniteNumber(P.headers.get("content-length")), [A, B] = S && tc(
2243
+ const j = V.toFiniteNumber(P.headers.get("content-length")), [A, B] = S && tc(
2244
2244
  j,
2245
2245
  ds(nc(S), !0)
2246
2246
  ) || [];
@@ -2252,10 +2252,10 @@ const od = (e) => {
2252
2252
  );
2253
2253
  }
2254
2254
  E = E || "text";
2255
- let V = await p[W.findKey(p, E) || "text"](P, v);
2255
+ let U = await p[V.findKey(p, E) || "text"](P, v);
2256
2256
  return !k && N && N(), await new Promise((X, j) => {
2257
2257
  nd(X, j, {
2258
- data: V,
2258
+ data: U,
2259
2259
  headers: Gt.from(P.headers),
2260
2260
  status: P.status,
2261
2261
  statusText: P.statusText,
@@ -2292,7 +2292,7 @@ const Ya = {
2292
2292
  get: sd
2293
2293
  }
2294
2294
  };
2295
- W.forEach(Ya, (e, t) => {
2295
+ V.forEach(Ya, (e, t) => {
2296
2296
  if (e) {
2297
2297
  try {
2298
2298
  Object.defineProperty(e, "name", { value: t });
@@ -2301,9 +2301,9 @@ W.forEach(Ya, (e, t) => {
2301
2301
  Object.defineProperty(e, "adapterName", { value: t });
2302
2302
  }
2303
2303
  });
2304
- const cc = (e) => `- ${e}`, zv = (e) => W.isFunction(e) || e === null || e === !1, ad = {
2304
+ const cc = (e) => `- ${e}`, zv = (e) => V.isFunction(e) || e === null || e === !1, ad = {
2305
2305
  getAdapter: (e, t) => {
2306
- e = W.isArray(e) ? e : [e];
2306
+ e = V.isArray(e) ? e : [e];
2307
2307
  const { length: n } = e;
2308
2308
  let r, o;
2309
2309
  const s = {};
@@ -2312,7 +2312,7 @@ const cc = (e) => `- ${e}`, zv = (e) => W.isFunction(e) || e === null || e === !
2312
2312
  let i;
2313
2313
  if (o = r, !zv(r) && (o = Ya[(i = String(r)).toLowerCase()], o === void 0))
2314
2314
  throw new Pe(`Unknown adapter '${i}'`);
2315
- if (o && (W.isFunction(o) || (o = o.get(t))))
2315
+ if (o && (V.isFunction(o) || (o = o.get(t))))
2316
2316
  break;
2317
2317
  s[i || "#" + a] = o;
2318
2318
  }
@@ -2442,7 +2442,7 @@ let nr = class {
2442
2442
  silentJSONParsing: wn.transitional(wn.boolean),
2443
2443
  forcedJSONParsing: wn.transitional(wn.boolean),
2444
2444
  clarifyTimeoutError: wn.transitional(wn.boolean)
2445
- }, !1), o != null && (W.isFunction(o) ? n.paramsSerializer = {
2445
+ }, !1), o != null && (V.isFunction(o) ? n.paramsSerializer = {
2446
2446
  serialize: o
2447
2447
  } : Qo.assertOptions(o, {
2448
2448
  encode: wn.function,
@@ -2451,11 +2451,11 @@ let nr = class {
2451
2451
  baseUrl: wn.spelling("baseURL"),
2452
2452
  withXsrfToken: wn.spelling("withXSRFToken")
2453
2453
  }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2454
- let a = s && W.merge(
2454
+ let a = s && V.merge(
2455
2455
  s.common,
2456
2456
  s[n.method]
2457
2457
  );
2458
- s && W.forEach(
2458
+ s && V.forEach(
2459
2459
  ["delete", "get", "head", "post", "put", "patch", "common"],
2460
2460
  (v) => {
2461
2461
  delete s[v];
@@ -2503,7 +2503,7 @@ let nr = class {
2503
2503
  return Zu(n, t.params, t.paramsSerializer);
2504
2504
  }
2505
2505
  };
2506
- W.forEach(["delete", "get", "head", "options"], function(t) {
2506
+ V.forEach(["delete", "get", "head", "options"], function(t) {
2507
2507
  nr.prototype[t] = function(n, r) {
2508
2508
  return this.request(ar(r || {}, {
2509
2509
  method: t,
@@ -2512,7 +2512,7 @@ W.forEach(["delete", "get", "head", "options"], function(t) {
2512
2512
  }));
2513
2513
  };
2514
2514
  });
2515
- W.forEach(["post", "put", "patch"], function(t) {
2515
+ V.forEach(["post", "put", "patch"], function(t) {
2516
2516
  function n(r) {
2517
2517
  return function(s, a, i) {
2518
2518
  return this.request(ar(i || {}, {
@@ -2606,7 +2606,7 @@ function Wv(e) {
2606
2606
  };
2607
2607
  }
2608
2608
  function Vv(e) {
2609
- return W.isObject(e) && e.isAxiosError === !0;
2609
+ return V.isObject(e) && e.isAxiosError === !0;
2610
2610
  }
2611
2611
  const Xa = {
2612
2612
  Continue: 100,
@@ -2678,7 +2678,7 @@ Object.entries(Xa).forEach(([e, t]) => {
2678
2678
  });
2679
2679
  function cd(e) {
2680
2680
  const t = new nr(e), n = Bu(nr.prototype.request, t);
2681
- return W.extend(n, nr.prototype, t, { allOwnKeys: !0 }), W.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2681
+ return V.extend(n, nr.prototype, t, { allOwnKeys: !0 }), V.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2682
2682
  return cd(ar(e, o));
2683
2683
  }, n;
2684
2684
  }
@@ -2698,7 +2698,7 @@ wt.spread = Wv;
2698
2698
  wt.isAxiosError = Vv;
2699
2699
  wt.mergeConfig = ar;
2700
2700
  wt.AxiosHeaders = Gt;
2701
- wt.formToJSON = (e) => ed(W.isHTMLForm(e) ? new FormData(e) : e);
2701
+ wt.formToJSON = (e) => ed(V.isHTMLForm(e) ? new FormData(e) : e);
2702
2702
  wt.getAdapter = ad.getAdapter;
2703
2703
  wt.HttpStatusCode = Xa;
2704
2704
  wt.default = wt;
@@ -3072,12 +3072,15 @@ function aw(e = {}) {
3072
3072
  lastText: ""
3073
3073
  };
3074
3074
  }, []), Y = me(() => {
3075
- var P, k;
3075
+ var U;
3076
3076
  console.debug("[use-chat] stop() invoked - aborting stream");
3077
- const F = (P = R.current) == null ? void 0 : P.threadId;
3078
- F && Mn.cancelRun(F).catch((V) => {
3079
- console.warn("[use-chat] cancel run failed:", V);
3080
- }), (k = S.current) == null || k.abort(), S.current = null, R.current = null, l(!1), w(!1), E.current = 0, x(0);
3077
+ const F = (U = R.current) == null ? void 0 : U.threadId, P = () => {
3078
+ var X;
3079
+ (X = S.current) == null || X.abort(), S.current = null, R.current = null, l(!1), w(!1), E.current = 0, x(0);
3080
+ };
3081
+ (F ? Mn.cancelRun(F).catch((X) => {
3082
+ console.warn("[use-chat] cancel run failed:", X);
3083
+ }) : Promise.resolve()).finally(P);
3081
3084
  }, []), q = me(
3082
3085
  (F, P, k) => {
3083
3086
  S.current && (S.current.abort(), S.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && m(""), v(null), _.current = null, O.current = null, L.current = null, C(null), K.current = {
@@ -3085,14 +3088,14 @@ function aw(e = {}) {
3085
3088
  lastSeq: null,
3086
3089
  lastText: ""
3087
3090
  };
3088
- const V = new AbortController();
3089
- S.current = V;
3091
+ const U = new AbortController();
3092
+ S.current = U;
3090
3093
  let X = null, j = null, A = !1;
3091
3094
  return R.current = {
3092
3095
  threadId: F.threadId ?? null,
3093
3096
  headers: {}
3094
3097
  }, (async () => {
3095
- var $, ne, U, D, J, Q, Z, z, ae, se, ge, ye, Ce, Ne, Ee, at, bt, Rt;
3098
+ var $, ne, W, D, J, Q, Z, z, ae, se, ge, ye, Ce, Ne, Ee, at, bt, Rt;
3096
3099
  const B = (qe) => {
3097
3100
  var He;
3098
3101
  try {
@@ -3115,7 +3118,7 @@ function aw(e = {}) {
3115
3118
  let G = null;
3116
3119
  try {
3117
3120
  const ze = (ne = window.localStorage) == null ? void 0 : ne.getItem("chat-settings");
3118
- ze && (G = ((U = JSON.parse(ze)) == null ? void 0 : U.apiKey) || null);
3121
+ ze && (G = ((W = JSON.parse(ze)) == null ? void 0 : W.apiKey) || null);
3119
3122
  } catch {
3120
3123
  }
3121
3124
  const ue = Ke || Mt || G || null;
@@ -3147,7 +3150,7 @@ function aw(e = {}) {
3147
3150
  method: "POST",
3148
3151
  headers: Oe,
3149
3152
  body: JSON.stringify(F),
3150
- signal: V.signal,
3153
+ signal: U.signal,
3151
3154
  credentials: a
3152
3155
  });
3153
3156
  if (R.current && (R.current.headers = Ge), !We.ok || !We.body) {
@@ -3179,7 +3182,7 @@ function aw(e = {}) {
3179
3182
  var je;
3180
3183
  if (Date.now() - Pt > 18e5) {
3181
3184
  const Ke = "Stream idle timeout";
3182
- d(Ke), X = "error", j = Ke, V.abort(), (je = k == null ? void 0 : k.onError) == null || je.call(k, Ke);
3185
+ d(Ke), X = "error", j = Ke, U.abort(), (je = k == null ? void 0 : k.onError) == null || je.call(k, Ke);
3183
3186
  }
3184
3187
  }, 5e3), gt = 1024 * 1024;
3185
3188
  try {
@@ -3295,12 +3298,12 @@ function aw(e = {}) {
3295
3298
  } catch (nn) {
3296
3299
  console.warn("[use-chat] onAuthError handler failed", nn);
3297
3300
  }
3298
- V.abort();
3301
+ U.abort();
3299
3302
  }
3300
3303
  }
3301
3304
  }
3302
3305
  }
3303
- It(), X === null && !V.signal.aborted && (X = "complete");
3306
+ It(), X === null && !U.signal.aborted && (X = "complete");
3304
3307
  } catch (je) {
3305
3308
  if (je.name === "AbortError")
3306
3309
  X = X ?? "aborted";
@@ -3325,7 +3328,7 @@ function aw(e = {}) {
3325
3328
  X = "error", j = He, d(He), (at = k == null ? void 0 : k.onError) == null || at.call(k, He), A || ((bt = k == null ? void 0 : k.onConnectionError) == null || bt.call(k, He), A = !0);
3326
3329
  }
3327
3330
  } finally {
3328
- const qe = E.current, He = _.current, Ge = O.current, Oe = L.current, We = X ?? (V.signal.aborted ? "aborted" : j ? "error" : "complete");
3331
+ const qe = E.current, He = _.current, Ge = O.current, Oe = L.current, We = X ?? (U.signal.aborted ? "aborted" : j ? "error" : "complete");
3329
3332
  try {
3330
3333
  (Rt = k == null ? void 0 : k.onClosed) == null || Rt.call(k, {
3331
3334
  reason: We,
@@ -3340,7 +3343,7 @@ function aw(e = {}) {
3340
3343
  }
3341
3344
  l(!1), w(!1), S.current = null, E.current = 0, x(0), R.current = null;
3342
3345
  }
3343
- })(), { close: () => V.abort() };
3346
+ })(), { close: () => U.abort() };
3344
3347
  },
3345
3348
  [t, n, r, e.autoAppendAssistant]
3346
3349
  );
@@ -3451,8 +3454,8 @@ function cw({
3451
3454
  const k = await e.createThread(P);
3452
3455
  return l(k.threadId), await R(), k.threadId;
3453
3456
  } catch (k) {
3454
- const V = String(k);
3455
- return n == null || n(V), null;
3457
+ const U = String(k);
3458
+ return n == null || n(U), null;
3456
3459
  }
3457
3460
  },
3458
3461
  [e, n, R]
@@ -3460,8 +3463,8 @@ function cw({
3460
3463
  async (P) => {
3461
3464
  const k = s;
3462
3465
  a((X) => X.filter((j) => j.threadId !== P));
3463
- const V = new AbortController();
3464
- E.current.set(P, V);
3466
+ const U = new AbortController();
3467
+ E.current.set(P, U);
3465
3468
  try {
3466
3469
  await e.deleteThread(P), T.current === P && (l(null), o == null || o());
3467
3470
  } catch (X) {
@@ -3477,8 +3480,8 @@ function cw({
3477
3480
  async (P, k) => {
3478
3481
  try {
3479
3482
  await e.updateThread(P, k), await R();
3480
- } catch (V) {
3481
- n == null || n(String(V));
3483
+ } catch (U) {
3484
+ n == null || n(String(U));
3482
3485
  }
3483
3486
  },
3484
3487
  [e, n, R]
@@ -3487,8 +3490,8 @@ function cw({
3487
3490
  S(!0), y("Sharing thread…");
3488
3491
  try {
3489
3492
  await e.shareThread(P, k), await _(), y("Shared successfully");
3490
- } catch (V) {
3491
- const X = lw(V);
3493
+ } catch (U) {
3494
+ const X = lw(U);
3492
3495
  throw n == null || n(X), y(`Failed to share: ${X}`), new Error(X);
3493
3496
  } finally {
3494
3497
  S(!1);
@@ -3499,9 +3502,9 @@ function cw({
3499
3502
  async (P, k) => {
3500
3503
  try {
3501
3504
  await e.unshareThread(P, k), await _();
3502
- } catch (V) {
3503
- const X = String(V);
3504
- throw n == null || n(X), V;
3505
+ } catch (U) {
3506
+ const X = String(U);
3507
+ throw n == null || n(X), U;
3505
3508
  }
3506
3509
  },
3507
3510
  [e, n, _]
@@ -3525,15 +3528,15 @@ function cw({
3525
3528
  updatedAt: P.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3526
3529
  messageCount: P.messageCount ?? 1
3527
3530
  };
3528
- a((V) => {
3531
+ a((U) => {
3529
3532
  let X = !1;
3530
- const j = V.map((A) => A.threadId === k.threadId ? (X = !0, console.debug("[useThreadsState] thread_info: updating existing thread", k.threadId), {
3533
+ const j = U.map((A) => A.threadId === k.threadId ? (X = !0, console.debug("[useThreadsState] thread_info: updating existing thread", k.threadId), {
3531
3534
  ...A,
3532
3535
  title: k.title ?? A.title,
3533
3536
  updatedAt: k.updatedAt ?? A.updatedAt,
3534
3537
  messageCount: k.messageCount ?? A.messageCount
3535
3538
  }) : A);
3536
- return X ? j : (console.debug("[useThreadsState] thread_info: adding thread to list", k.threadId), [k, ...V]);
3539
+ return X ? j : (console.debug("[useThreadsState] thread_info: adding thread to list", k.threadId), [k, ...U]);
3537
3540
  });
3538
3541
  }, []), F = me(() => y(null), []);
3539
3542
  return {
@@ -4106,7 +4109,7 @@ function Rw({
4106
4109
  Qe(() => {
4107
4110
  H.current = o;
4108
4111
  }, [o]);
4109
- const V = me(
4112
+ const U = me(
4110
4113
  async (Z) => {
4111
4114
  var ae, se;
4112
4115
  if (!Z.threadId) return;
@@ -4131,7 +4134,7 @@ function Rw({
4131
4134
  const ae = `${Z}:${z ?? "latest"}`, se = k.current.get(ae);
4132
4135
  if (se)
4133
4136
  return se;
4134
- const ge = V({
4137
+ const ge = U({
4135
4138
  threadId: Z,
4136
4139
  setLoading: T,
4137
4140
  onStart: () => K(null),
@@ -4162,7 +4165,7 @@ function Rw({
4162
4165
  }
4163
4166
  return H.current === Z && (P.current = ae), ge;
4164
4167
  },
4165
- [e, t, V]
4168
+ [e, t, U]
4166
4169
  ), j = me(
4167
4170
  async (Z, z) => {
4168
4171
  F.current = Z;
@@ -4195,7 +4198,7 @@ function Rw({
4195
4198
  ), ne = me(
4196
4199
  async (Z, z) => {
4197
4200
  const ae = H.current;
4198
- await V({
4201
+ await U({
4199
4202
  threadId: ae,
4200
4203
  setLoading: O,
4201
4204
  action: async (se) => {
@@ -4225,8 +4228,8 @@ function Rw({
4225
4228
  }).catch(() => {
4226
4229
  });
4227
4230
  },
4228
- [e, t, V]
4229
- ), U = me(
4231
+ [e, t, U]
4232
+ ), W = me(
4230
4233
  (Z, z) => {
4231
4234
  t(d(), {
4232
4235
  checkpointId: Z ?? null,
@@ -4238,7 +4241,7 @@ function Rw({
4238
4241
  H.current && await j(H.current);
4239
4242
  }, [j]), J = me(async () => {
4240
4243
  const Z = H.current;
4241
- !Z || !y || await V({
4244
+ !Z || !y || await U({
4242
4245
  threadId: Z,
4243
4246
  setLoading: R,
4244
4247
  action: async (z) => {
@@ -4256,7 +4259,7 @@ function Rw({
4256
4259
  }
4257
4260
  }).catch(() => {
4258
4261
  });
4259
- }, [e, y, r, n, V]);
4262
+ }, [e, y, r, n, U]);
4260
4263
  Qe(() => {
4261
4264
  if (!l || !o || S || c)
4262
4265
  return;
@@ -4304,7 +4307,7 @@ function Rw({
4304
4307
  loadThread: j,
4305
4308
  navigateToCheckpoint: ne,
4306
4309
  loadOlderMessages: J,
4307
- setCurrentCheckpointId: U,
4310
+ setCurrentCheckpointId: W,
4308
4311
  returnToLatest: D,
4309
4312
  handleStateHistoryEvent: $,
4310
4313
  markSkipNextLoad: A,
@@ -4378,7 +4381,7 @@ function Nw({
4378
4381
  const k = me(
4379
4382
  (B) => q(() => B),
4380
4383
  []
4381
- ), V = me(
4384
+ ), U = me(
4382
4385
  (B) => P(() => B),
4383
4386
  []
4384
4387
  ), X = Ue(() => ({ assemblingMessageId: c.assemblingId ?? null }), [c.assemblingId]), j = Ue(
@@ -4445,9 +4448,9 @@ function Nw({
4445
4448
  ), A = Ue(
4446
4449
  () => ({
4447
4450
  registerClearThread: k,
4448
- registerRespondToInterrupt: V
4451
+ registerRespondToInterrupt: U
4449
4452
  }),
4450
- [k, V]
4453
+ [k, U]
4451
4454
  );
4452
4455
  return /* @__PURE__ */ u.jsx(bd.Provider, { value: A, children: /* @__PURE__ */ u.jsx(wd.Provider, { value: j, children: e }) });
4453
4456
  }
@@ -4578,11 +4581,11 @@ function Mw({
4578
4581
  }, [g]);
4579
4582
  const H = me(
4580
4583
  async (F, P, k) => {
4581
- const V = f.current;
4582
- if (!V)
4584
+ const U = f.current;
4585
+ if (!U)
4583
4586
  throw new Error("No active thread to handle interrupt");
4584
4587
  const X = P ? k ?? !0 : !1, j = K.current, A = {
4585
- threadId: V,
4588
+ threadId: U,
4586
4589
  checkpointId: j.id ?? void 0,
4587
4590
  checkpointNs: j.namespace ?? void 0,
4588
4591
  command: { kind: "resume", value: X }
@@ -4608,7 +4611,7 @@ function Mw({
4608
4611
  const Y = me(
4609
4612
  async (F, P) => {
4610
4613
  let k = f.current;
4611
- const V = (F == null ? void 0 : F.text) ?? "", X = (F == null ? void 0 : F.attachments) ?? [], j = (V == null ? void 0 : V.trim()) ?? "", A = { ...(F == null ? void 0 : F.payload) ?? {} }, B = Array.isArray(A.messages) ? A.messages : void 0;
4614
+ const U = (F == null ? void 0 : F.text) ?? "", X = (F == null ? void 0 : F.attachments) ?? [], j = (U == null ? void 0 : U.trim()) ?? "", A = { ...(F == null ? void 0 : F.payload) ?? {} }, B = Array.isArray(A.messages) ? A.messages : void 0;
4612
4615
  B && delete A.messages;
4613
4616
  const $ = !!(B && B.length);
4614
4617
  if (!k && !j && X.length === 0 && !$) return;
@@ -4616,8 +4619,8 @@ function Mw({
4616
4619
  const Ne = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), Ee = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")).join("").slice(0, 16);
4617
4620
  k = `${Ne}${Ee}`, w(k), m(k);
4618
4621
  }
4619
- const { contentParts: ne, filesInfo: U } = await tw(X), D = [...ne];
4620
- j && D.push({ type: "text", text: V });
4622
+ const { contentParts: ne, filesInfo: W } = await tw(X), D = [...ne];
4623
+ j && D.push({ type: "text", text: U });
4621
4624
  const J = P == null ? void 0 : P.originalMessageId, Q = !!(P != null && P.edit && J), Z = !$ && D.length > 0;
4622
4625
  let z = null;
4623
4626
  Z && (z = {
@@ -4628,7 +4631,7 @@ function Mw({
4628
4631
  }, Q ? S(z, J) : S(z));
4629
4632
  const ae = $ ? B : z ? [z] : [], se = {
4630
4633
  ...A,
4631
- ...U.length ? { files_info: U } : {}
4634
+ ...W.length ? { files_info: W } : {}
4632
4635
  };
4633
4636
  ae.length ? se.messages = ae : "messages" in se || (se.messages = []);
4634
4637
  let ge = (P == null ? void 0 : P.checkpointId) ?? g.id ?? void 0, ye = (P == null ? void 0 : P.checkpointNs) ?? g.namespace ?? void 0;
@@ -5739,7 +5742,7 @@ const Rb = (e) => ({
5739
5742
  k === "y";
5740
5743
  }
5741
5744
  return !0;
5742
- }).map((P) => [P.placement, P.overflows.filter((k) => k > 0).reduce((k, V) => k + V, 0)]).sort((P, k) => P[1] - k[1])[0]) == null ? void 0 : H[0];
5745
+ }).map((P) => [P.placement, P.overflows.filter((k) => k > 0).reduce((k, U) => k + U, 0)]).sort((P, k) => P[1] - k[1])[0]) == null ? void 0 : H[0];
5743
5746
  F && (q = F);
5744
5747
  break;
5745
5748
  }
@@ -6580,7 +6583,7 @@ function gy(e) {
6580
6583
  middleware: m
6581
6584
  };
6582
6585
  L.current && (P.platform = L.current), py(T.current, E.current, P).then((k) => {
6583
- const V = {
6586
+ const U = {
6584
6587
  ...k,
6585
6588
  // The floating element's position may be recomputed while it's closed
6586
6589
  // but still mounted (such as when transitioning out). To ensure
@@ -6588,8 +6591,8 @@ function gy(e) {
6588
6591
  // setting it to `true` when `open === false` (must be specified).
6589
6592
  isPositioned: K.current !== !1
6590
6593
  };
6591
- N.current && !gs(R.current, V) && (R.current = V, vo.flushSync(() => {
6592
- p(V);
6594
+ N.current && !gs(R.current, U) && (R.current = U, vo.flushSync(() => {
6595
+ p(U);
6593
6596
  }));
6594
6597
  });
6595
6598
  }, [m, t, n, L, K]);
@@ -6625,17 +6628,17 @@ function gy(e) {
6625
6628
  };
6626
6629
  if (!q.floating)
6627
6630
  return P;
6628
- const k = zc(q.floating, d.x), V = zc(q.floating, d.y);
6631
+ const k = zc(q.floating, d.x), U = zc(q.floating, d.y);
6629
6632
  return i ? {
6630
6633
  ...P,
6631
- transform: "translate(" + k + "px, " + V + "px)",
6634
+ transform: "translate(" + k + "px, " + U + "px)",
6632
6635
  ...zd(q.floating) >= 1.5 && {
6633
6636
  willChange: "transform"
6634
6637
  }
6635
6638
  } : {
6636
6639
  position: n,
6637
6640
  left: k,
6638
- top: V
6641
+ top: U
6639
6642
  };
6640
6643
  }, [n, i, q.floating, d.x, d.y]);
6641
6644
  return h.useMemo(() => ({
@@ -6745,7 +6748,7 @@ var qd = "PopperAnchor", Gd = h.forwardRef(
6745
6748
  Gd.displayName = qd;
6746
6749
  var qi = "PopperContent", [Iy, Ny] = Wd(qi), Yd = h.forwardRef(
6747
6750
  (e, t) => {
6748
- var U, D, J, Q, Z, z;
6751
+ var W, D, J, Q, Z, z;
6749
6752
  const {
6750
6753
  __scopePopper: n,
6751
6754
  side: r = "bottom",
@@ -6796,11 +6799,11 @@ var qi = "PopperContent", [Iy, Ny] = Wd(qi), Yd = h.forwardRef(
6796
6799
  _y({ arrowWidth: E, arrowHeight: R }),
6797
6800
  m && Ty({ strategy: "referenceHidden", ...H })
6798
6801
  ]
6799
- }), [k, V] = Zd(q), X = vt(v);
6802
+ }), [k, U] = Zd(q), X = vt(v);
6800
6803
  At(() => {
6801
6804
  F && (X == null || X());
6802
6805
  }, [F, X]);
6803
- const j = (U = P.arrow) == null ? void 0 : U.x, A = (D = P.arrow) == null ? void 0 : D.y, B = ((J = P.arrow) == null ? void 0 : J.centerOffset) !== 0, [$, ne] = h.useState();
6806
+ const j = (W = P.arrow) == null ? void 0 : W.x, A = (D = P.arrow) == null ? void 0 : D.y, B = ((J = P.arrow) == null ? void 0 : J.centerOffset) !== 0, [$, ne] = h.useState();
6804
6807
  return At(() => {
6805
6808
  b && ne(window.getComputedStyle(b).zIndex);
6806
6809
  }, [b]), /* @__PURE__ */ u.jsx(
@@ -6840,7 +6843,7 @@ var qi = "PopperContent", [Iy, Ny] = Wd(qi), Yd = h.forwardRef(
6840
6843
  ve.div,
6841
6844
  {
6842
6845
  "data-side": k,
6843
- "data-align": V,
6846
+ "data-align": U,
6844
6847
  ...g,
6845
6848
  ref: y,
6846
6849
  style: {
@@ -7798,11 +7801,11 @@ var an = "MenuContent", [W0, tl] = pr(an), bf = h.forwardRef(
7798
7801
  disableOutsideScroll: v,
7799
7802
  ...g
7800
7803
  } = e, x = hr(an, n), b = Ao(an, n), w = qs(n), y = gf(n), C = $0(n), [S, T] = h.useState(null), E = h.useRef(null), R = Be(t, E, x.onContentChange), _ = h.useRef(0), O = h.useRef(""), L = h.useRef(0), K = h.useRef(null), H = h.useRef("right"), N = h.useRef(0), Y = v ? Ks : h.Fragment, q = v ? { as: q0, allowPinchZoom: !0 } : void 0, F = (k) => {
7801
- var U, D;
7802
- const V = O.current + k, X = C().filter((J) => !J.disabled), j = document.activeElement, A = (U = X.find((J) => J.ref.current === j)) == null ? void 0 : U.textValue, B = X.map((J) => J.textValue), $ = sS(B, V, A), ne = (D = X.find((J) => J.textValue === $)) == null ? void 0 : D.ref.current;
7804
+ var W, D;
7805
+ const U = O.current + k, X = C().filter((J) => !J.disabled), j = document.activeElement, A = (W = X.find((J) => J.ref.current === j)) == null ? void 0 : W.textValue, B = X.map((J) => J.textValue), $ = sS(B, U, A), ne = (D = X.find((J) => J.textValue === $)) == null ? void 0 : D.ref.current;
7803
7806
  (function J(Q) {
7804
7807
  O.current = Q, window.clearTimeout(_.current), Q !== "" && (_.current = window.setTimeout(() => J(""), 1e3));
7805
- })(V), ne && setTimeout(() => ne.focus());
7808
+ })(U), ne && setTimeout(() => ne.focus());
7806
7809
  };
7807
7810
  h.useEffect(() => () => window.clearTimeout(_.current), []), Fi();
7808
7811
  const P = h.useCallback((k) => {
@@ -7822,8 +7825,8 @@ var an = "MenuContent", [W0, tl] = pr(an), bf = h.forwardRef(
7822
7825
  ),
7823
7826
  onItemLeave: h.useCallback(
7824
7827
  (k) => {
7825
- var V;
7826
- P(k) || ((V = E.current) == null || V.focus(), T(null));
7828
+ var U;
7829
+ P(k) || ((U = E.current) == null || U.focus(), T(null));
7827
7830
  },
7828
7831
  [P]
7829
7832
  ),
@@ -7843,8 +7846,8 @@ var an = "MenuContent", [W0, tl] = pr(an), bf = h.forwardRef(
7843
7846
  asChild: !0,
7844
7847
  trapped: o,
7845
7848
  onMountAutoFocus: le(s, (k) => {
7846
- var V;
7847
- k.preventDefault(), (V = E.current) == null || V.focus({ preventScroll: !0 });
7849
+ var U;
7850
+ k.preventDefault(), (U = E.current) == null || U.focus({ preventScroll: !0 });
7848
7851
  }),
7849
7852
  onUnmountAutoFocus: a,
7850
7853
  children: /* @__PURE__ */ u.jsx(
@@ -7889,7 +7892,7 @@ var an = "MenuContent", [W0, tl] = pr(an), bf = h.forwardRef(
7889
7892
  const B = E.current;
7890
7893
  if (k.target !== B || !O0.includes(k.key)) return;
7891
7894
  k.preventDefault();
7892
- const ne = C().filter((U) => !U.disabled).map((U) => U.ref.current);
7895
+ const ne = C().filter((W) => !W.disabled).map((W) => W.ref.current);
7893
7896
  hf.includes(k.key) && ne.reverse(), rS(ne);
7894
7897
  }),
7895
7898
  onBlur: le(e.onBlur, (k) => {
@@ -7898,8 +7901,8 @@ var an = "MenuContent", [W0, tl] = pr(an), bf = h.forwardRef(
7898
7901
  onPointerMove: le(
7899
7902
  e.onPointerMove,
7900
7903
  co((k) => {
7901
- const V = k.target, X = N.current !== k.clientX;
7902
- if (k.currentTarget.contains(V) && X) {
7904
+ const U = k.target, X = N.current !== k.clientX;
7905
+ if (k.currentTarget.contains(U) && X) {
7903
7906
  const j = k.clientX > N.current ? "right" : "left";
7904
7907
  H.current = j, N.current = k.clientX;
7905
7908
  }
@@ -8615,7 +8618,7 @@ function XS({
8615
8618
  id: $,
8616
8619
  shouldClear: !0
8617
8620
  }, S(() => {
8618
- var ne, U, D;
8621
+ var ne, W, D;
8619
8622
  try {
8620
8623
  const J = l(B);
8621
8624
  J && typeof J.then == "function" ? J.then(() => {
@@ -8624,7 +8627,7 @@ function XS({
8624
8627
  }).catch(() => {
8625
8628
  var Q;
8626
8629
  ((Q = R.current) == null ? void 0 : Q.id) === $ && (R.current = null);
8627
- }) : (((ne = R.current) == null ? void 0 : ne.id) === $ && R.current.shouldClear && (x || (w(""), T.current && (T.current.style.height = "auto"), i == null || i(""))), ((U = R.current) == null ? void 0 : U.id) === $ && (R.current = null));
8630
+ }) : (((ne = R.current) == null ? void 0 : ne.id) === $ && R.current.shouldClear && (x || (w(""), T.current && (T.current.style.height = "auto"), i == null || i(""))), ((W = R.current) == null ? void 0 : W.id) === $ && (R.current = null));
8628
8631
  } catch {
8629
8632
  ((D = R.current) == null ? void 0 : D.id) === $ && (R.current = null);
8630
8633
  }
@@ -9737,9 +9740,9 @@ const jo = Je(
9737
9740
  H,
9738
9741
  N
9739
9742
  ]) => {
9740
- const Y = Sp(C), { align: q, behavior: F, offset: P } = Y, k = E - 1, V = bp(Y, S, k);
9741
- let X = ho(V, S.offsetTree, K) + _;
9742
- q === "end" ? (X += H + mn(S.sizeTree, V)[1] - T + N, V === k && (X += O)) : q === "center" ? X += (H + mn(S.sizeTree, V)[1] - T + N) / 2 : X -= R, P && (X += P);
9743
+ const Y = Sp(C), { align: q, behavior: F, offset: P } = Y, k = E - 1, U = bp(Y, S, k);
9744
+ let X = ho(U, S.offsetTree, K) + _;
9745
+ q === "end" ? (X += H + mn(S.sizeTree, U)[1] - T + N, U === k && (X += O)) : q === "center" ? X += (H + mn(S.sizeTree, U)[1] - T + N) / 2 : X -= R, P && (X += P);
9743
9746
  const j = (A) => {
9744
9747
  y(), A ? (L("retrying to scroll to", { location: C }, Yt.DEBUG), Me(f, C)) : (Me(v, !0), L("list did not change, scroll successful", {}, Yt.DEBUG));
9745
9748
  };
@@ -9754,7 +9757,7 @@ const jo = Je(
9754
9757
  x = fn(te(t, CT(150)), j);
9755
9758
  return b = setTimeout(() => {
9756
9759
  y();
9757
- }, 1200), Me(l, !0), L("scrolling from index to", { behavior: F, index: V, top: X }, Yt.DEBUG), { behavior: F, top: X };
9760
+ }, 1200), Me(l, !0), L("scrolling from index to", { behavior: F, index: U, top: X }, Yt.DEBUG), { behavior: F, top: X };
9758
9761
  }
9759
9762
  )
9760
9763
  ),
@@ -10181,28 +10184,28 @@ const gr = Je(
10181
10184
  q,
10182
10185
  H
10183
10186
  );
10184
- const V = [];
10187
+ const U = [];
10185
10188
  if (K.length > 0) {
10186
10189
  const $ = K[0], ne = K[K.length - 1];
10187
- let U = 0;
10190
+ let W = 0;
10188
10191
  for (const D of Qs(P, $, ne)) {
10189
10192
  const J = D.value, Q = Math.max(D.start, $), Z = Math.min(D.end, ne);
10190
10193
  for (let z = Q; z <= Z; z++)
10191
- V.push({ data: Y == null ? void 0 : Y[z], index: z, offset: U, size: J }), U += J;
10194
+ U.push({ data: Y == null ? void 0 : Y[z], index: z, offset: W, size: J }), W += J;
10192
10195
  }
10193
10196
  }
10194
10197
  if (!L)
10195
- return as([], V, R, N, q, H);
10198
+ return as([], U, R, N, q, H);
10196
10199
  const X = K.length > 0 ? K[K.length - 1] + 1 : 0, j = gT(F, T, E, X);
10197
10200
  if (j.length === 0)
10198
10201
  return null;
10199
10202
  const A = R - 1, B = Zs([], ($) => {
10200
10203
  for (const ne of j) {
10201
- const U = ne.value;
10202
- let D = U.offset, J = ne.start;
10203
- const Q = U.size;
10204
- if (U.offset < T) {
10205
- J += Math.floor((T - U.offset + N) / (Q + N));
10204
+ const W = ne.value;
10205
+ let D = W.offset, J = ne.start;
10206
+ const Q = W.size;
10207
+ if (W.offset < T) {
10208
+ J += Math.floor((T - W.offset + N) / (Q + N));
10206
10209
  const z = J - ne.start;
10207
10210
  D += z * Q + z * N;
10208
10211
  }
@@ -10212,7 +10215,7 @@ const gr = Je(
10212
10215
  $.push({ data: Y == null ? void 0 : Y[z], index: z, offset: D, size: Q }), D += Q + N;
10213
10216
  }
10214
10217
  });
10215
- return as(B, V, R, N, q, H);
10218
+ return as(B, U, R, N, q, H);
10216
10219
  }
10217
10220
  ),
10218
10221
  //@ts-expect-error filter needs to be fixed
@@ -11374,7 +11377,7 @@ const fC = /* @__PURE__ */ Je(
11374
11377
  { customScrollParent: x, useWindowScroll: b, windowScrollContainerState: w, windowScrollTo: y, windowViewportRect: C },
11375
11378
  S
11376
11379
  ]) => {
11377
- const T = oe(0), E = oe(0), R = oe(iu), _ = oe({ height: 0, width: 0 }), O = oe({ height: 0, width: 0 }), L = Ve(), K = Ve(), H = oe(0), N = oe(null), Y = oe({ column: 0, row: 0 }), q = Ve(), F = Ve(), P = oe(!1), k = oe(0), V = oe(!0), X = oe(!1), j = oe(!1);
11380
+ const T = oe(0), E = oe(0), R = oe(iu), _ = oe({ height: 0, width: 0 }), O = oe({ height: 0, width: 0 }), L = Ve(), K = Ve(), H = oe(0), N = oe(null), Y = oe({ column: 0, row: 0 }), q = Ve(), F = Ve(), P = oe(!1), k = oe(0), U = oe(!0), X = oe(!1), j = oe(!1);
11378
11381
  et(
11379
11382
  te(
11380
11383
  v,
@@ -11382,18 +11385,18 @@ const fC = /* @__PURE__ */ Je(
11382
11385
  Ie(([D, J]) => !!J)
11383
11386
  ),
11384
11387
  () => {
11385
- Me(V, !1);
11388
+ Me(U, !1);
11386
11389
  }
11387
11390
  ), et(
11388
11391
  te(
11389
- yt(v, V, O, _, k, X),
11392
+ yt(v, U, O, _, k, X),
11390
11393
  Ie(([D, J, Q, Z, , z]) => D && !J && Q.height !== 0 && Z.height !== 0 && !z)
11391
11394
  ),
11392
11395
  ([, , , , D]) => {
11393
11396
  Me(X, !0), pl(1, () => {
11394
11397
  Me(L, D);
11395
11398
  }), fn(te(c), () => {
11396
- Me(t, [0, 0]), Me(V, !0);
11399
+ Me(t, [0, 0]), Me(U, !0);
11397
11400
  });
11398
11401
  }
11399
11402
  ), we(
@@ -11447,7 +11450,7 @@ const fC = /* @__PURE__ */ Je(
11447
11450
  Re(N),
11448
11451
  Re(E),
11449
11452
  Re(P),
11450
- Re(V),
11453
+ Re(U),
11451
11454
  Re(k)
11452
11455
  ),
11453
11456
  Ie(([, , , , , , , D]) => !D),
@@ -11554,7 +11557,7 @@ const fC = /* @__PURE__ */ Je(
11554
11557
  ),
11555
11558
  l
11556
11559
  );
11557
- const U = Ft(
11560
+ const W = Ft(
11558
11561
  te(
11559
11562
  R,
11560
11563
  pe((D) => D.offsetBottom + D.bottom)
@@ -11598,7 +11601,7 @@ const fC = /* @__PURE__ */ Je(
11598
11601
  gridState: R,
11599
11602
  horizontalDirection: j,
11600
11603
  initialTopMostItemIndex: k,
11601
- totalListHeight: U,
11604
+ totalListHeight: W,
11602
11605
  ...m,
11603
11606
  endReached: B,
11604
11607
  propsReady: g,
@@ -14604,12 +14607,12 @@ function wE({
14604
14607
  A.push($);
14605
14608
  }
14606
14609
  return A;
14607
- }, [N, m]), V = m ? k : N, X = me(({ part: A, i: B }) => {
14610
+ }, [N, m]), U = m ? k : N, X = me(({ part: A, i: B }) => {
14608
14611
  if (A.type === "text") {
14609
14612
  if (m)
14610
14613
  return null;
14611
- const $ = A.text ?? "", ne = $.trim(), U = Mi(ne);
14612
- return U && y !== "tool" ? /* @__PURE__ */ u.jsx(wh, { data: U }, B) : y === "user" && C && ne.length > S ? /* @__PURE__ */ u.jsx(
14614
+ const $ = A.text ?? "", ne = $.trim(), W = Mi(ne);
14615
+ return W && y !== "tool" ? /* @__PURE__ */ u.jsx(wh, { data: W }, B) : y === "user" && C && ne.length > S ? /* @__PURE__ */ u.jsx(
14613
14616
  pE,
14614
14617
  {
14615
14618
  text: ne,
@@ -14639,7 +14642,7 @@ function wE({
14639
14642
  "a",
14640
14643
  {
14641
14644
  href: $.url,
14642
- onClick: (U) => v(U, $, B),
14645
+ onClick: (W) => v(W, $, B),
14643
14646
  className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
14644
14647
  dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
14645
14648
  children: [
@@ -14656,7 +14659,7 @@ function wE({
14656
14659
  if (A.type === "interrupt") {
14657
14660
  const $ = A, ne = ts(
14658
14661
  ($ == null ? void 0 : $.id) ?? ($ == null ? void 0 : $.interrupt_id)
14659
- ), U = !!(_ && ne && ne === _), D = U ? O ?? ($ == null ? void 0 : $.value) : $ == null ? void 0 : $.value, J = ne ? { ...$, id: ne, interrupt_id: ne } : $;
14662
+ ), W = !!(_ && ne && ne === _), D = W ? O ?? ($ == null ? void 0 : $.value) : $ == null ? void 0 : $.value, J = ne ? { ...$, id: ne, interrupt_id: ne } : $;
14660
14663
  return /* @__PURE__ */ u.jsx(
14661
14664
  cE,
14662
14665
  {
@@ -14664,7 +14667,7 @@ function wE({
14664
14667
  onApprove: x,
14665
14668
  onReject: b,
14666
14669
  disabled: w,
14667
- isActive: U,
14670
+ isActive: W,
14668
14671
  payload: D
14669
14672
  },
14670
14673
  B
@@ -14702,7 +14705,7 @@ function wE({
14702
14705
  e.id
14703
14706
  ) : null;
14704
14707
  if (!f) {
14705
- const A = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: V.map((B, $) => m && yE(B) ? P ? /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: P }, `streaming-md-${$}`) : null : /* @__PURE__ */ u.jsx(X, { part: B, i: $ }, $)) });
14708
+ const A = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: U.map((B, $) => m && yE(B) ? P ? /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: P }, `streaming-md-${$}`) : null : /* @__PURE__ */ u.jsx(X, { part: B, i: $ }, $)) });
14706
14709
  return d ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
14707
14710
  A,
14708
14711
  /* @__PURE__ */ u.jsx(fE, { className: L })
@@ -14939,14 +14942,14 @@ const jl = Og(function({
14939
14942
  onSelectCheckpoint: _,
14940
14943
  attemptMetas: O = []
14941
14944
  }) {
14942
- const [L, K] = fe(!1), [H, N] = fe("preview"), [Y, q] = fe(!1), { currentThreadId: F } = Eo(), { respondToInterrupt: P } = Ls(), k = l === "phone" || l === "half-screen", V = t.role, X = V === "tool", j = Ue(() => t.role === "default_message" ? t : null, [t]), A = !!j, B = !(r && V !== "user"), {
14945
+ const [L, K] = fe(!1), [H, N] = fe("preview"), [Y, q] = fe(!1), { currentThreadId: F } = Eo(), { respondToInterrupt: P } = Ls(), k = l === "phone" || l === "half-screen", U = t.role, X = U === "tool", j = Ue(() => t.role === "default_message" ? t : null, [t]), A = !!j, B = !(r && U !== "user"), {
14943
14946
  uploadingFiles: $,
14944
14947
  handleFileClick: ne,
14945
- fileViewerOpen: U,
14948
+ fileViewerOpen: W,
14946
14949
  currentFileInfo: D,
14947
14950
  closeFileViewer: J
14948
14951
  } = mE({ allowFileOpen: B, currentThreadId: F }), Q = Ue(() => {
14949
- switch (V) {
14952
+ switch (U) {
14950
14953
  case "user":
14951
14954
  return "text-[hsl(var(--chat-bubble-user-text))]";
14952
14955
  case "assistant":
@@ -14958,7 +14961,7 @@ const jl = Og(function({
14958
14961
  default:
14959
14962
  return "text-[hsl(var(--chat-bubble-ai-text))]";
14960
14963
  }
14961
- }, [V]), Z = gE(t, j), {
14964
+ }, [U]), Z = gE(t, j), {
14962
14965
  contentParts: z,
14963
14966
  imageParts: ae,
14964
14967
  fileParts: se,
@@ -15003,7 +15006,7 @@ const jl = Og(function({
15003
15006
  N((G) => G === "expanded" ? "preview" : "expanded");
15004
15007
  }, []), ht = me(() => {
15005
15008
  const ue = re(k ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Q);
15006
- switch (V) {
15009
+ switch (U) {
15007
15010
  case "user":
15008
15011
  return /* @__PURE__ */ u.jsx(Yg, { className: ue });
15009
15012
  case "assistant":
@@ -15013,9 +15016,9 @@ const jl = Og(function({
15013
15016
  default:
15014
15017
  return /* @__PURE__ */ u.jsx(va, { className: ue });
15015
15018
  }
15016
- }, [k, Q, V]), jt = me(() => {
15019
+ }, [k, Q, U]), jt = me(() => {
15017
15020
  const G = "group relative mb-4 flex w-full";
15018
- switch (V) {
15021
+ switch (U) {
15019
15022
  case "user":
15020
15023
  return re(G, "justify-end");
15021
15024
  case "assistant":
@@ -15025,7 +15028,7 @@ const jl = Og(function({
15025
15028
  default:
15026
15029
  return G;
15027
15030
  }
15028
- }, [V]), st = me(() => {
15031
+ }, [U]), st = me(() => {
15029
15032
  const G = re(
15030
15033
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
15031
15034
  k && "px-3 py-2 text-sm"
@@ -15037,7 +15040,7 @@ const jl = Og(function({
15037
15040
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
15038
15041
  "border border-border/60 dark:border-border/40 shadow-sm"
15039
15042
  );
15040
- switch (V) {
15043
+ switch (U) {
15041
15044
  case "user":
15042
15045
  return re(
15043
15046
  G,
@@ -15064,7 +15067,7 @@ const jl = Og(function({
15064
15067
  "border border-border/60 dark:border-border/40"
15065
15068
  );
15066
15069
  }
15067
- }, [k, A, V]), _t = me(async (G) => {
15070
+ }, [k, A, U]), _t = me(async (G) => {
15068
15071
  if (C)
15069
15072
  return;
15070
15073
  const ue = ts(
@@ -15120,7 +15123,7 @@ const jl = Og(function({
15120
15123
  handleInterruptApprove: _t,
15121
15124
  handleInterruptReject: St,
15122
15125
  disableInterruptActions: C,
15123
- messageRole: V,
15126
+ messageRole: U,
15124
15127
  truncateUserMessages: c,
15125
15128
  userMessagePreviewLength: d,
15126
15129
  isUserExpanded: Y,
@@ -15130,7 +15133,7 @@ const jl = Og(function({
15130
15133
  activeInterruptValue: qe,
15131
15134
  iconForeground: Q
15132
15135
  }
15133
- ), It = Ue(() => j ? "Assistant" : mw(t), [j, t]), Tt = ht(), Pt = V === "user" && (E ?? 1) > 1 && typeof _ == "function", Ut = (O == null ? void 0 : O.length) ?? 0, gt = Ut > 0 && R < Ut - 1 ? O[R + 1] : void 0, je = Ut > 0 && R > 0 ? O[R - 1] : void 0, Ke = me(() => {
15136
+ ), It = Ue(() => j ? "Assistant" : mw(t), [j, t]), Tt = ht(), Pt = U === "user" && (E ?? 1) > 1 && typeof _ == "function", Ut = (O == null ? void 0 : O.length) ?? 0, gt = Ut > 0 && R < Ut - 1 ? O[R + 1] : void 0, je = Ut > 0 && R > 0 ? O[R - 1] : void 0, Ke = me(() => {
15134
15137
  !gt || !_ || _(gt.id, void 0, !!gt.isLatestAttempt);
15135
15138
  }, [gt, _]), Mt = me(() => {
15136
15139
  !je || !_ || _(je.id, void 0, !!je.isLatestAttempt);
@@ -15163,7 +15166,7 @@ const jl = Og(function({
15163
15166
  isCompactLayout: k,
15164
15167
  showActions: s,
15165
15168
  isEditing: o,
15166
- messageRole: V,
15169
+ messageRole: U,
15167
15170
  toolViewMode: H,
15168
15171
  toolMeta: Ce,
15169
15172
  onToggleToolView: We,
@@ -15209,7 +15212,7 @@ const jl = Og(function({
15209
15212
  children: /* @__PURE__ */ u.jsx(Mu, { className: re(L ? "text-success" : "text-current", k ? "h-3 w-3" : "h-4 w-4") })
15210
15213
  }
15211
15214
  ),
15212
- V === "user" && x && /* @__PURE__ */ u.jsx(
15215
+ U === "user" && x && /* @__PURE__ */ u.jsx(
15213
15216
  nt,
15214
15217
  {
15215
15218
  variant: "ghost",
@@ -15219,7 +15222,7 @@ const jl = Og(function({
15219
15222
  children: /* @__PURE__ */ u.jsx(Ou, { className: re("text-current", k ? "h-3 w-3" : "h-4 w-4") })
15220
15223
  }
15221
15224
  ),
15222
- V === "assistant" && b && /* @__PURE__ */ u.jsx(
15225
+ U === "assistant" && b && /* @__PURE__ */ u.jsx(
15223
15226
  nt,
15224
15227
  {
15225
15228
  variant: "ghost",
@@ -15236,7 +15239,7 @@ const jl = Og(function({
15236
15239
  D && /* @__PURE__ */ u.jsx(
15237
15240
  BC,
15238
15241
  {
15239
- isOpen: U,
15242
+ isOpen: W,
15240
15243
  onClose: J,
15241
15244
  fileId: D.id,
15242
15245
  fileName: D.name,
@@ -15295,7 +15298,7 @@ const Th = M.forwardRef(({
15295
15298
  }, K) => {
15296
15299
  const H = Le(null), N = Le(null), Y = Le(!1), q = Le(!1), [F, P] = fe(!0), k = Ue(() => w ? e.some((z) => z.role === "default_message" ? !1 : Array.isArray(z == null ? void 0 : z.content) && z.content.some(
15297
15300
  (ae) => ae && ae.type === "interrupt" && (ae.id ?? ae.interrupt_id) === w.id
15298
- )) : !1, [w, e]), V = Ue(() => {
15301
+ )) : !1, [w, e]), U = Ue(() => {
15299
15302
  if (!w || k)
15300
15303
  return null;
15301
15304
  const z = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
@@ -15318,7 +15321,7 @@ const Th = M.forwardRef(({
15318
15321
  }
15319
15322
  ]
15320
15323
  };
15321
- }, [w, k]), X = Ue(() => V ? [...e, V] : e, [e, V]), j = Ue(() => {
15324
+ }, [w, k]), X = Ue(() => U ? [...e, U] : e, [e, U]), j = Ue(() => {
15322
15325
  const z = n && X.some((se) => se.id === n);
15323
15326
  return O && (t || L) && !z && X.length > 0 ? [
15324
15327
  ...X,
@@ -15344,7 +15347,7 @@ const Th = M.forwardRef(({
15344
15347
  }
15345
15348
  }
15346
15349
  };
15347
- }, [i]), ne = Ue(() => !v || g ? !1 : F ? "auto" : !1, [F, v, g]), U = Ue(() => {
15350
+ }, [i]), ne = Ue(() => !v || g ? !1 : F ? "auto" : !1, [F, v, g]), W = Ue(() => {
15348
15351
  if (typeof f != "string") return null;
15349
15352
  const z = f.trim();
15350
15353
  return !z || A && A.length > 0 ? null : {
@@ -15353,10 +15356,10 @@ const Th = M.forwardRef(({
15353
15356
  content: z,
15354
15357
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
15355
15358
  };
15356
- }, [f, A]), D = ["flex h-full flex-col md:flex-row", p].filter(Boolean).join(" "), J = () => U ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
15359
+ }, [f, A]), D = ["flex h-full flex-col md:flex-row", p].filter(Boolean).join(" "), J = () => W ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
15357
15360
  jl,
15358
15361
  {
15359
- message: U,
15362
+ message: W,
15360
15363
  messageIndex: 0,
15361
15364
  isStreamingMessage: !1,
15362
15365
  showActions: !1,
@@ -15488,11 +15491,11 @@ function ro({
15488
15491
  interrupt: O,
15489
15492
  metadata: L,
15490
15493
  checkpointIndex: K
15491
- } = Ls(), { isStreaming: H, error: N, connectionState: Y, submit: q, stop: F } = Ow(), P = w ?? b ?? null, k = (R == null ? void 0 : R.id) ?? null, V = (R == null ? void 0 : R.namespace) ?? null, X = (L == null ? void 0 : L.assemblingMessageId) ?? null, j = O, [A, B] = fe(!1), [$, ne] = fe(!1);
15494
+ } = Ls(), { isStreaming: H, error: N, connectionState: Y, submit: q, stop: F } = Ow(), P = w ?? b ?? null, k = (R == null ? void 0 : R.id) ?? null, U = (R == null ? void 0 : R.namespace) ?? null, X = (L == null ? void 0 : L.assemblingMessageId) ?? null, j = O, [A, B] = fe(!1), [$, ne] = fe(!1);
15492
15495
  Qe(() => {
15493
15496
  j || B(!1);
15494
15497
  }, [j]);
15495
- const U = me(() => {
15498
+ const W = me(() => {
15496
15499
  B(!0);
15497
15500
  }, []), D = me(() => {
15498
15501
  B(!1);
@@ -15550,7 +15553,7 @@ function ro({
15550
15553
  const ce = ie.trim();
15551
15554
  if (!(!ce && Ne.length === 0))
15552
15555
  try {
15553
- const Te = Q ? (se == null ? void 0 : se.checkpointId) ?? k ?? void 0 : k ?? void 0, De = Q ? (se == null ? void 0 : se.checkpointNs) ?? V ?? void 0 : V ?? void 0;
15556
+ const Te = Q ? (se == null ? void 0 : se.checkpointId) ?? k ?? void 0 : k ?? void 0, De = Q ? (se == null ? void 0 : se.checkpointNs) ?? U ?? void 0 : U ?? void 0;
15554
15557
  await q(
15555
15558
  {
15556
15559
  text: ce || "",
@@ -15602,12 +15605,12 @@ function ro({
15602
15605
  { text: it, payload: p },
15603
15606
  {
15604
15607
  checkpointId: k ?? void 0,
15605
- checkpointNs: V ?? void 0,
15608
+ checkpointNs: U ?? void 0,
15606
15609
  edit: !0,
15607
15610
  originalMessageId: ce.id
15608
15611
  }
15609
15612
  );
15610
- }, [y, q, k, V, p]), ut = (ie) => {
15613
+ }, [y, q, k, U, p]), ut = (ie) => {
15611
15614
  const ce = Array.from(ie.target.files || []);
15612
15615
  Ee((Te) => [...Te, ...ce]), ie.target.value = "";
15613
15616
  }, nn = (ie) => {
@@ -15624,7 +15627,7 @@ function ro({
15624
15627
  { attachments: [ce], payload: p },
15625
15628
  {
15626
15629
  checkpointId: k ?? void 0,
15627
- checkpointNs: V ?? void 0
15630
+ checkpointNs: U ?? void 0
15628
15631
  }
15629
15632
  );
15630
15633
  const Te = `Uploaded ${ce.name} - processing through chat stream`;
@@ -15704,7 +15707,7 @@ function ro({
15704
15707
  isNavigatingCheckpoint: Ke,
15705
15708
  activeInterrupt: j,
15706
15709
  disableInterruptActions: A,
15707
- onInterruptActionStart: U,
15710
+ onInterruptActionStart: W,
15708
15711
  onInterruptActionEnd: D,
15709
15712
  showToolMessages: d,
15710
15713
  checkpointIndex: K,
@@ -15884,7 +15887,7 @@ var Xr = '[cmdk-group=""]', Ua = '[cmdk-group-items=""]', ME = '[cmdk-group-head
15884
15887
  T(6, H);
15885
15888
  }, []);
15886
15889
  let E = h.useMemo(() => ({ subscribe: (j) => (a.current.add(j), () => a.current.delete(j)), snapshot: () => n.current, setState: (j, A, B) => {
15887
- var $, ne, U, D;
15890
+ var $, ne, W, D;
15888
15891
  if (!Object.is(n.current[j], A)) {
15889
15892
  if (n.current[j] = A, j === "search") K(), O(), T(1, L);
15890
15893
  else if (j === "value") {
@@ -15897,7 +15900,7 @@ var Xr = '[cmdk-group=""]', Ua = '[cmdk-group-items=""]', ME = '[cmdk-group-head
15897
15900
  n.current.selectedItemId = (J = N()) == null ? void 0 : J.id, E.emit();
15898
15901
  }), B || T(5, H), ((ne = i.current) == null ? void 0 : ne.value) !== void 0) {
15899
15902
  let J = A ?? "";
15900
- (D = (U = i.current).onValueChange) == null || D.call(U, J);
15903
+ (D = (W = i.current).onValueChange) == null || D.call(W, J);
15901
15904
  return;
15902
15905
  }
15903
15906
  }
@@ -15930,24 +15933,24 @@ var Xr = '[cmdk-group=""]', Ua = '[cmdk-group-items=""]', ME = '[cmdk-group-head
15930
15933
  if (!n.current.search || i.current.shouldFilter === !1) return;
15931
15934
  let j = n.current.filtered.items, A = [];
15932
15935
  n.current.filtered.groups.forEach(($) => {
15933
- let ne = o.current.get($), U = 0;
15936
+ let ne = o.current.get($), W = 0;
15934
15937
  ne.forEach((D) => {
15935
15938
  let J = j.get(D);
15936
- U = Math.max(J, U);
15937
- }), A.push([$, U]);
15939
+ W = Math.max(J, W);
15940
+ }), A.push([$, W]);
15938
15941
  });
15939
15942
  let B = S.current;
15940
15943
  Y().sort(($, ne) => {
15941
- var U, D;
15944
+ var W, D;
15942
15945
  let J = $.getAttribute("id"), Q = ne.getAttribute("id");
15943
- return ((U = j.get(Q)) != null ? U : 0) - ((D = j.get(J)) != null ? D : 0);
15946
+ return ((W = j.get(Q)) != null ? W : 0) - ((D = j.get(J)) != null ? D : 0);
15944
15947
  }).forEach(($) => {
15945
15948
  let ne = $.closest(Ua);
15946
15949
  ne ? ne.appendChild($.parentElement === ne ? $ : $.closest(`${Ua} > *`)) : B.appendChild($.parentElement === B ? $ : $.closest(`${Ua} > *`));
15947
15950
  }), A.sort(($, ne) => ne[1] - $[1]).forEach(($) => {
15948
15951
  var ne;
15949
- let U = (ne = S.current) == null ? void 0 : ne.querySelector(`${Xr}[${Sr}="${encodeURIComponent($[0])}"]`);
15950
- U == null || U.parentElement.appendChild(U);
15952
+ let W = (ne = S.current) == null ? void 0 : ne.querySelector(`${Xr}[${Sr}="${encodeURIComponent($[0])}"]`);
15953
+ W == null || W.parentElement.appendChild(W);
15951
15954
  });
15952
15955
  }
15953
15956
  function L() {
@@ -15962,12 +15965,12 @@ var Xr = '[cmdk-group=""]', Ua = '[cmdk-group-items=""]', ME = '[cmdk-group-head
15962
15965
  }
15963
15966
  n.current.filtered.groups = /* @__PURE__ */ new Set();
15964
15967
  let ne = 0;
15965
- for (let U of r.current) {
15966
- let D = (A = (j = s.current.get(U)) == null ? void 0 : j.value) != null ? A : "", J = ($ = (B = s.current.get(U)) == null ? void 0 : B.keywords) != null ? $ : [], Q = _(D, J);
15967
- n.current.filtered.items.set(U, Q), Q > 0 && ne++;
15968
+ for (let W of r.current) {
15969
+ let D = (A = (j = s.current.get(W)) == null ? void 0 : j.value) != null ? A : "", J = ($ = (B = s.current.get(W)) == null ? void 0 : B.keywords) != null ? $ : [], Q = _(D, J);
15970
+ n.current.filtered.items.set(W, Q), Q > 0 && ne++;
15968
15971
  }
15969
- for (let [U, D] of o.current) for (let J of D) if (n.current.filtered.items.get(J) > 0) {
15970
- n.current.filtered.groups.add(U);
15972
+ for (let [W, D] of o.current) for (let J of D) if (n.current.filtered.items.get(J) > 0) {
15973
+ n.current.filtered.groups.add(W);
15971
15974
  break;
15972
15975
  }
15973
15976
  n.current.filtered.count = ne;
@@ -15991,15 +15994,15 @@ var Xr = '[cmdk-group=""]', Ua = '[cmdk-group-items=""]', ME = '[cmdk-group-head
15991
15994
  }
15992
15995
  function F(j) {
15993
15996
  var A;
15994
- let B = N(), $ = Y(), ne = $.findIndex((D) => D === B), U = $[ne + j];
15995
- (A = i.current) != null && A.loop && (U = ne + j < 0 ? $[$.length - 1] : ne + j === $.length ? $[0] : $[ne + j]), U && E.setState("value", U.getAttribute(Sr));
15997
+ let B = N(), $ = Y(), ne = $.findIndex((D) => D === B), W = $[ne + j];
15998
+ (A = i.current) != null && A.loop && (W = ne + j < 0 ? $[$.length - 1] : ne + j === $.length ? $[0] : $[ne + j]), W && E.setState("value", W.getAttribute(Sr));
15996
15999
  }
15997
16000
  function P(j) {
15998
16001
  let A = N(), B = A == null ? void 0 : A.closest(Xr), $;
15999
16002
  for (; B && !$; ) B = j > 0 ? WE(B, Xr) : VE(B, Xr), $ = B == null ? void 0 : B.querySelector(Cu);
16000
16003
  $ ? E.setState("value", $.getAttribute(Sr)) : F(j);
16001
16004
  }
16002
- let k = () => q(Y().length - 1), V = (j) => {
16005
+ let k = () => q(Y().length - 1), U = (j) => {
16003
16006
  j.preventDefault(), j.metaKey ? k() : j.altKey ? P(1) : F(1);
16004
16007
  }, X = (j) => {
16005
16008
  j.preventDefault(), j.metaKey ? q(0) : j.altKey ? P(-1) : F(-1);
@@ -16011,11 +16014,11 @@ var Xr = '[cmdk-group=""]', Ua = '[cmdk-group-items=""]', ME = '[cmdk-group-head
16011
16014
  if (!(j.defaultPrevented || B)) switch (j.key) {
16012
16015
  case "n":
16013
16016
  case "j": {
16014
- x && j.ctrlKey && V(j);
16017
+ x && j.ctrlKey && U(j);
16015
16018
  break;
16016
16019
  }
16017
16020
  case "ArrowDown": {
16018
- V(j);
16021
+ U(j);
16019
16022
  break;
16020
16023
  }
16021
16024
  case "p":
@@ -16974,7 +16977,7 @@ function mi({
16974
16977
  shareInFlight: L,
16975
16978
  shareStatus: K,
16976
16979
  clearShareStatus: H
16977
- } = Eo(), { createThread: N, deleteThread: Y, renameThread: q, shareThread: F } = O, { loadThread: P } = Ls(), k = a ?? T, [V, X] = fe(Array.isArray(C) ? C : []), j = Le(V.length > 0), A = Le(null), B = Le(0), [$, ne] = fe(null), [U, D] = fe(""), [J, Q] = fe(!1), [Z, z] = fe(!1), [ae, se] = fe(null), [ge, ye] = fe(""), Ce = v && v.length > 0 ? v : gk, Ne = mk({ defaultView: m }), Ee = g ?? Ne, at = p ?? Ee.view, bt = me(
16980
+ } = Eo(), { createThread: N, deleteThread: Y, renameThread: q, shareThread: F } = O, { loadThread: P } = Ls(), k = a ?? T, [U, X] = fe(Array.isArray(C) ? C : []), j = Le(U.length > 0), A = Le(null), B = Le(0), [$, ne] = fe(null), [W, D] = fe(""), [J, Q] = fe(!1), [Z, z] = fe(!1), [ae, se] = fe(null), [ge, ye] = fe(""), Ce = v && v.length > 0 ? v : gk, Ne = mk({ defaultView: m }), Ee = g ?? Ne, at = p ?? Ee.view, bt = me(
16978
16981
  (G) => {
16979
16982
  p || Ee.setView(G), f == null || f(G);
16980
16983
  },
@@ -16996,7 +16999,7 @@ function mi({
16996
16999
  ), Oe = Ue(() => {
16997
17000
  const G = b ?? [], ue = ge.trim().toLowerCase();
16998
17001
  return ue ? y ? G.filter((ze) => y(ze, ue)) : G.filter((ze) => `${ze.label} ${ze.secondaryLabel ?? ""}`.toLowerCase().includes(ue)) : G;
16999
- }, [b, ge, y]), We = at === "shared", ht = We ? S : V, jt = We ? _ : R, st = We ? "No shared conversations yet" : "No conversations yet", _t = (G) => {
17002
+ }, [b, ge, y]), We = at === "shared", ht = We ? S : U, jt = We ? _ : R, st = We ? "No shared conversations yet" : "No conversations yet", _t = (G) => {
17000
17003
  const ue = G.sharedAt ? ` • ${je(G.sharedAt)}` : "";
17001
17004
  return `Shared by ${G.sharedByUserId}${ue}`;
17002
17005
  }, St = (G) => "sharedByUserId" in G;
@@ -17021,7 +17024,7 @@ function mi({
17021
17024
  }), () => {
17022
17025
  ue !== null && cancelAnimationFrame(ue), ze !== null && cancelAnimationFrame(ze);
17023
17026
  };
17024
- }, [V]);
17027
+ }, [U]);
17025
17028
  const mt = async (G) => {
17026
17029
  try {
17027
17030
  E(G), await P(G), i == null || i(G), l == null || l(G);
@@ -17053,9 +17056,9 @@ function mi({
17053
17056
  }, Pt = (G, ue) => {
17054
17057
  ue.stopPropagation(), ne(G.threadId), D(G.title || `Thread ${G.threadId.slice(0, 8)}`);
17055
17058
  }, Ut = async (G) => {
17056
- if (U.trim())
17059
+ if (W.trim())
17057
17060
  try {
17058
- await q(G, U.trim()), ne(null), D("");
17061
+ await q(G, W.trim()), ne(null), D("");
17059
17062
  } catch (ue) {
17060
17063
  console.error("Failed to update title:", ue);
17061
17064
  }
@@ -17143,7 +17146,7 @@ function mi({
17143
17146
  thread: G,
17144
17147
  isActive: k === G.threadId,
17145
17148
  editingThreadId: $,
17146
- editingTitle: U,
17149
+ editingTitle: W,
17147
17150
  onSelect: mt,
17148
17151
  onStartEditing: Pt,
17149
17152
  onEditingTitleChange: (ue) => D(ue),
@@ -17669,16 +17672,16 @@ var dn = 10, [pm, qn] = Wr(fr), jk = "SelectContentImpl", _k = Ir("SelectContent
17669
17672
  avoidCollisions: x,
17670
17673
  //
17671
17674
  ...b
17672
- } = e, w = Kn(fr, n), [y, C] = h.useState(null), [S, T] = h.useState(null), E = Be(t, (U) => C(U)), [R, _] = h.useState(null), [O, L] = h.useState(
17675
+ } = e, w = Kn(fr, n), [y, C] = h.useState(null), [S, T] = h.useState(null), E = Be(t, (W) => C(W)), [R, _] = h.useState(null), [O, L] = h.useState(
17673
17676
  null
17674
17677
  ), K = ca(n), [H, N] = h.useState(!1), Y = h.useRef(!1);
17675
17678
  h.useEffect(() => {
17676
17679
  if (y) return Zi(y);
17677
17680
  }, [y]), Fi();
17678
17681
  const q = h.useCallback(
17679
- (U) => {
17682
+ (W) => {
17680
17683
  const [D, ...J] = K().map((z) => z.ref.current), [Q] = J.slice(-1), Z = document.activeElement;
17681
- for (const z of U)
17684
+ for (const z of W)
17682
17685
  if (z === Z || (z == null || z.scrollIntoView({ block: "nearest" }), z === D && S && (S.scrollTop = 0), z === Q && S && (S.scrollTop = S.scrollHeight), z == null || z.focus(), document.activeElement !== Z)) return;
17683
17686
  },
17684
17687
  [K, S]
@@ -17692,39 +17695,39 @@ var dn = 10, [pm, qn] = Wr(fr), jk = "SelectContentImpl", _k = Ir("SelectContent
17692
17695
  const { onOpenChange: P, triggerPointerDownPosRef: k } = w;
17693
17696
  h.useEffect(() => {
17694
17697
  if (y) {
17695
- let U = { x: 0, y: 0 };
17698
+ let W = { x: 0, y: 0 };
17696
17699
  const D = (Q) => {
17697
17700
  var Z, z;
17698
- U = {
17701
+ W = {
17699
17702
  x: Math.abs(Math.round(Q.pageX) - (((Z = k.current) == null ? void 0 : Z.x) ?? 0)),
17700
17703
  y: Math.abs(Math.round(Q.pageY) - (((z = k.current) == null ? void 0 : z.y) ?? 0))
17701
17704
  };
17702
17705
  }, J = (Q) => {
17703
- U.x <= 10 && U.y <= 10 ? Q.preventDefault() : y.contains(Q.target) || P(!1), document.removeEventListener("pointermove", D), k.current = null;
17706
+ W.x <= 10 && W.y <= 10 ? Q.preventDefault() : y.contains(Q.target) || P(!1), document.removeEventListener("pointermove", D), k.current = null;
17704
17707
  };
17705
17708
  return k.current !== null && (document.addEventListener("pointermove", D), document.addEventListener("pointerup", J, { capture: !0, once: !0 })), () => {
17706
17709
  document.removeEventListener("pointermove", D), document.removeEventListener("pointerup", J, { capture: !0 });
17707
17710
  };
17708
17711
  }
17709
17712
  }, [y, P, k]), h.useEffect(() => {
17710
- const U = () => P(!1);
17711
- return window.addEventListener("blur", U), window.addEventListener("resize", U), () => {
17712
- window.removeEventListener("blur", U), window.removeEventListener("resize", U);
17713
+ const W = () => P(!1);
17714
+ return window.addEventListener("blur", W), window.addEventListener("resize", W), () => {
17715
+ window.removeEventListener("blur", W), window.removeEventListener("resize", W);
17713
17716
  };
17714
17717
  }, [P]);
17715
- const [V, X] = jm((U) => {
17716
- const D = K().filter((Z) => !Z.disabled), J = D.find((Z) => Z.ref.current === document.activeElement), Q = _m(D, U, J);
17718
+ const [U, X] = jm((W) => {
17719
+ const D = K().filter((Z) => !Z.disabled), J = D.find((Z) => Z.ref.current === document.activeElement), Q = _m(D, W, J);
17717
17720
  Q && setTimeout(() => Q.ref.current.focus());
17718
17721
  }), j = h.useCallback(
17719
- (U, D, J) => {
17722
+ (W, D, J) => {
17720
17723
  const Q = !Y.current && !J;
17721
- (w.value !== void 0 && w.value === D || Q) && (_(U), Q && (Y.current = !0));
17724
+ (w.value !== void 0 && w.value === D || Q) && (_(W), Q && (Y.current = !0));
17722
17725
  },
17723
17726
  [w.value]
17724
17727
  ), A = h.useCallback(() => y == null ? void 0 : y.focus(), [y]), B = h.useCallback(
17725
- (U, D, J) => {
17728
+ (W, D, J) => {
17726
17729
  const Q = !Y.current && !J;
17727
- (w.value !== void 0 && w.value === D || Q) && L(U);
17730
+ (w.value !== void 0 && w.value === D || Q) && L(W);
17728
17731
  },
17729
17732
  [w.value]
17730
17733
  ), $ = r === "popper" ? gi : mm, ne = $ === gi ? {
@@ -17754,18 +17757,18 @@ var dn = 10, [pm, qn] = Wr(fr), jk = "SelectContentImpl", _k = Ir("SelectContent
17754
17757
  selectedItemText: O,
17755
17758
  position: r,
17756
17759
  isPositioned: H,
17757
- searchRef: V,
17760
+ searchRef: U,
17758
17761
  children: /* @__PURE__ */ u.jsx(Ks, { as: _k, allowPinchZoom: !0, children: /* @__PURE__ */ u.jsx(
17759
17762
  Bs,
17760
17763
  {
17761
17764
  asChild: !0,
17762
17765
  trapped: w.open,
17763
- onMountAutoFocus: (U) => {
17764
- U.preventDefault();
17766
+ onMountAutoFocus: (W) => {
17767
+ W.preventDefault();
17765
17768
  },
17766
- onUnmountAutoFocus: le(o, (U) => {
17769
+ onUnmountAutoFocus: le(o, (W) => {
17767
17770
  var D;
17768
- (D = w.trigger) == null || D.focus({ preventScroll: !0 }), U.preventDefault();
17771
+ (D = w.trigger) == null || D.focus({ preventScroll: !0 }), W.preventDefault();
17769
17772
  }),
17770
17773
  children: /* @__PURE__ */ u.jsx(
17771
17774
  $r,
@@ -17774,7 +17777,7 @@ var dn = 10, [pm, qn] = Wr(fr), jk = "SelectContentImpl", _k = Ir("SelectContent
17774
17777
  disableOutsidePointerEvents: !0,
17775
17778
  onEscapeKeyDown: s,
17776
17779
  onPointerDownOutside: a,
17777
- onFocusOutside: (U) => U.preventDefault(),
17780
+ onFocusOutside: (W) => W.preventDefault(),
17778
17781
  onDismiss: () => w.onOpenChange(!1),
17779
17782
  children: /* @__PURE__ */ u.jsx(
17780
17783
  $,
@@ -17783,7 +17786,7 @@ var dn = 10, [pm, qn] = Wr(fr), jk = "SelectContentImpl", _k = Ir("SelectContent
17783
17786
  id: w.contentId,
17784
17787
  "data-state": w.open ? "open" : "closed",
17785
17788
  dir: w.dir,
17786
- onContextMenu: (U) => U.preventDefault(),
17789
+ onContextMenu: (W) => W.preventDefault(),
17787
17790
  ...b,
17788
17791
  ...ne,
17789
17792
  onPlaced: () => N(!0),
@@ -17796,15 +17799,15 @@ var dn = 10, [pm, qn] = Wr(fr), jk = "SelectContentImpl", _k = Ir("SelectContent
17796
17799
  outline: "none",
17797
17800
  ...b.style
17798
17801
  },
17799
- onKeyDown: le(b.onKeyDown, (U) => {
17800
- const D = U.ctrlKey || U.altKey || U.metaKey;
17801
- if (U.key === "Tab" && U.preventDefault(), !D && U.key.length === 1 && X(U.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(U.key)) {
17802
+ onKeyDown: le(b.onKeyDown, (W) => {
17803
+ const D = W.ctrlKey || W.altKey || W.metaKey;
17804
+ if (W.key === "Tab" && W.preventDefault(), !D && W.key.length === 1 && X(W.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(W.key)) {
17802
17805
  let Q = K().filter((Z) => !Z.disabled).map((Z) => Z.ref.current);
17803
- if (["ArrowUp", "End"].includes(U.key) && (Q = Q.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(U.key)) {
17804
- const Z = U.target, z = Q.indexOf(Z);
17806
+ if (["ArrowUp", "End"].includes(W.key) && (Q = Q.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(W.key)) {
17807
+ const Z = W.target, z = Q.indexOf(Z);
17805
17808
  Q = Q.slice(z + 1);
17806
17809
  }
17807
- setTimeout(() => q(Q)), U.preventDefault();
17810
+ setTimeout(() => q(Q)), W.preventDefault();
17808
17811
  }
17809
17812
  })
17810
17813
  }
@@ -17840,7 +17843,7 @@ var Pk = "SelectItemAlignedPosition", mm = h.forwardRef((e, t) => {
17840
17843
  ]);
17841
17844
  i.style.minWidth = se + "px", i.style.right = Ce + "px";
17842
17845
  }
17843
- const L = m(), K = window.innerHeight - dn * 2, H = g.scrollHeight, N = window.getComputedStyle(c), Y = parseInt(N.borderTopWidth, 10), q = parseInt(N.paddingTop, 10), F = parseInt(N.borderBottomWidth, 10), P = parseInt(N.paddingBottom, 10), k = Y + q + H + P + F, V = Math.min(x.offsetHeight * 5, k), X = window.getComputedStyle(g), j = parseInt(X.paddingTop, 10), A = parseInt(X.paddingBottom, 10), B = E.top + E.height / 2 - dn, $ = K - B, ne = x.offsetHeight / 2, U = x.offsetTop + ne, D = Y + q + U, J = k - D;
17846
+ const L = m(), K = window.innerHeight - dn * 2, H = g.scrollHeight, N = window.getComputedStyle(c), Y = parseInt(N.borderTopWidth, 10), q = parseInt(N.paddingTop, 10), F = parseInt(N.borderBottomWidth, 10), P = parseInt(N.paddingBottom, 10), k = Y + q + H + P + F, U = Math.min(x.offsetHeight * 5, k), X = window.getComputedStyle(g), j = parseInt(X.paddingTop, 10), A = parseInt(X.paddingBottom, 10), B = E.top + E.height / 2 - dn, $ = K - B, ne = x.offsetHeight / 2, W = x.offsetTop + ne, D = Y + q + W, J = k - D;
17844
17847
  if (D <= B) {
17845
17848
  const Z = L.length > 0 && x === L[L.length - 1].ref.current;
17846
17849
  i.style.bottom = "0px";
@@ -17860,7 +17863,7 @@ var Pk = "SelectItemAlignedPosition", mm = h.forwardRef((e, t) => {
17860
17863
  ) + J;
17861
17864
  i.style.height = ae + "px", g.scrollTop = D - B + g.offsetTop;
17862
17865
  }
17863
- i.style.margin = `${dn}px 0`, i.style.minHeight = V + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => f.current = !0);
17866
+ i.style.margin = `${dn}px 0`, i.style.minHeight = U + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => f.current = !0);
17864
17867
  }
17865
17868
  }, [
17866
17869
  m,
@@ -19220,7 +19223,7 @@ var [KR, qR] = sg(Lo, {
19220
19223
  }),
19221
19224
  onPointerMove: le(e.onPointerMove, (N) => {
19222
19225
  if (!y.current) return;
19223
- const Y = N.clientX - y.current.x, q = N.clientY - y.current.y, F = !!C.current, P = ["left", "right"].includes(g.swipeDirection), k = ["left", "up"].includes(g.swipeDirection) ? Math.min : Math.max, V = P ? k(0, Y) : 0, X = P ? 0 : k(0, q), j = N.pointerType === "touch" ? 10 : 2, A = { x: V, y: X }, B = { originalEvent: N, delta: A };
19226
+ const Y = N.clientX - y.current.x, q = N.clientY - y.current.y, F = !!C.current, P = ["left", "right"].includes(g.swipeDirection), k = ["left", "up"].includes(g.swipeDirection) ? Math.min : Math.max, U = P ? k(0, Y) : 0, X = P ? 0 : k(0, q), j = N.pointerType === "touch" ? 10 : 2, A = { x: U, y: X }, B = { originalEvent: N, delta: A };
19224
19227
  F ? (C.current = A, Go(UR, p, B, {
19225
19228
  discrete: !1
19226
19229
  })) : Iu(A, g.swipeDirection, j) ? (C.current = A, Go(HR, d, B, {
@@ -19578,7 +19581,7 @@ function _I(e) {
19578
19581
  }
19579
19582
  var PI = (e) => {
19580
19583
  var t, n, r, o, s, a, i, l, c, d, p;
19581
- let { invert: m, toast: f, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: y, toasts: C, expanded: S, removeToast: T, defaultRichColors: E, closeButton: R, style: _, cancelButtonStyle: O, actionButtonStyle: L, className: K = "", descriptionClassName: H = "", duration: N, position: Y, gap: q, loadingIcon: F, expandByDefault: P, classNames: k, icons: V, closeButtonAriaLabel: X = "Close toast", pauseWhenPageIsHidden: j } = e, [A, B] = M.useState(null), [$, ne] = M.useState(null), [U, D] = M.useState(!1), [J, Q] = M.useState(!1), [Z, z] = M.useState(!1), [ae, se] = M.useState(!1), [ge, ye] = M.useState(!1), [Ce, Ne] = M.useState(0), [Ee, at] = M.useState(0), bt = M.useRef(f.duration || N || Nu), Rt = M.useRef(null), qe = M.useRef(null), He = y === 0, Ge = y + 1 <= b, Oe = f.type, We = f.dismissible !== !1, ht = f.className || "", jt = f.descriptionClassName || "", st = M.useMemo(() => w.findIndex((xe) => xe.toastId === f.id) || 0, [w, f.id]), _t = M.useMemo(() => {
19584
+ let { invert: m, toast: f, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: y, toasts: C, expanded: S, removeToast: T, defaultRichColors: E, closeButton: R, style: _, cancelButtonStyle: O, actionButtonStyle: L, className: K = "", descriptionClassName: H = "", duration: N, position: Y, gap: q, loadingIcon: F, expandByDefault: P, classNames: k, icons: U, closeButtonAriaLabel: X = "Close toast", pauseWhenPageIsHidden: j } = e, [A, B] = M.useState(null), [$, ne] = M.useState(null), [W, D] = M.useState(!1), [J, Q] = M.useState(!1), [Z, z] = M.useState(!1), [ae, se] = M.useState(!1), [ge, ye] = M.useState(!1), [Ce, Ne] = M.useState(0), [Ee, at] = M.useState(0), bt = M.useRef(f.duration || N || Nu), Rt = M.useRef(null), qe = M.useRef(null), He = y === 0, Ge = y + 1 <= b, Oe = f.type, We = f.dismissible !== !1, ht = f.className || "", jt = f.descriptionClassName || "", st = M.useMemo(() => w.findIndex((xe) => xe.toastId === f.id) || 0, [w, f.id]), _t = M.useMemo(() => {
19582
19585
  var xe;
19583
19586
  return (xe = f.closeButton) != null ? xe : R;
19584
19587
  }, [f.closeButton, R]), St = M.useMemo(() => f.duration || N || Nu, [f.duration, N]), mt = M.useRef(0), It = M.useRef(0), Tt = M.useRef(0), Pt = M.useRef(null), [Ut, gt] = Y.split("-"), je = M.useMemo(() => w.reduce((xe, $e, Ye) => Ye >= st ? xe : xe + $e.height, 0), [w, st]), Ke = xI(), Mt = f.invert || m, G = Oe === "loading";
@@ -19593,12 +19596,12 @@ var PI = (e) => {
19593
19596
  return at($e), x((Ye) => [{ toastId: f.id, height: $e, position: f.position }, ...Ye]), () => x((Ye) => Ye.filter((Ct) => Ct.toastId !== f.id));
19594
19597
  }
19595
19598
  }, [x, f.id]), M.useLayoutEffect(() => {
19596
- if (!U) return;
19599
+ if (!W) return;
19597
19600
  let xe = qe.current, $e = xe.style.height;
19598
19601
  xe.style.height = "auto";
19599
19602
  let Ye = xe.getBoundingClientRect().height;
19600
19603
  xe.style.height = $e, at(Ye), x((Ct) => Ct.find((Et) => Et.toastId === f.id) ? Ct.map((Et) => Et.toastId === f.id ? { ...Et, height: Ye } : Et) : [{ toastId: f.id, height: Ye, position: f.position }, ...Ct]);
19601
- }, [U, f.title, f.description, x, f.id]);
19604
+ }, [W, f.title, f.description, x, f.id]);
19602
19605
  let ue = M.useCallback(() => {
19603
19606
  Q(!0), Ne(It.current), x((xe) => xe.filter(($e) => $e.toastId !== f.id)), setTimeout(() => {
19604
19607
  T(f);
@@ -19622,9 +19625,9 @@ var PI = (e) => {
19622
19625
  }, [ue, f.delete]);
19623
19626
  function ze() {
19624
19627
  var xe, $e, Ye;
19625
- return V != null && V.loading ? M.createElement("div", { className: un(k == null ? void 0 : k.loader, (xe = f == null ? void 0 : f.classNames) == null ? void 0 : xe.loader, "sonner-loader"), "data-visible": Oe === "loading" }, V.loading) : F ? M.createElement("div", { className: un(k == null ? void 0 : k.loader, ($e = f == null ? void 0 : f.classNames) == null ? void 0 : $e.loader, "sonner-loader"), "data-visible": Oe === "loading" }, F) : M.createElement(dI, { className: un(k == null ? void 0 : k.loader, (Ye = f == null ? void 0 : f.classNames) == null ? void 0 : Ye.loader), visible: Oe === "loading" });
19628
+ return U != null && U.loading ? M.createElement("div", { className: un(k == null ? void 0 : k.loader, (xe = f == null ? void 0 : f.classNames) == null ? void 0 : xe.loader, "sonner-loader"), "data-visible": Oe === "loading" }, U.loading) : F ? M.createElement("div", { className: un(k == null ? void 0 : k.loader, ($e = f == null ? void 0 : f.classNames) == null ? void 0 : $e.loader, "sonner-loader"), "data-visible": Oe === "loading" }, F) : M.createElement(dI, { className: un(k == null ? void 0 : k.loader, (Ye = f == null ? void 0 : f.classNames) == null ? void 0 : Ye.loader), visible: Oe === "loading" });
19626
19629
  }
19627
- return M.createElement("li", { tabIndex: 0, ref: qe, className: un(K, ht, k == null ? void 0 : k.toast, (t = f == null ? void 0 : f.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Oe], (n = f == null ? void 0 : f.classNames) == null ? void 0 : n[Oe]), "data-sonner-toast": "", "data-rich-colors": (r = f.richColors) != null ? r : E, "data-styled": !(f.jsx || f.unstyled || v), "data-mounted": U, "data-promise": !!f.promise, "data-swiped": ge, "data-removed": J, "data-visible": Ge, "data-y-position": Ut, "data-x-position": gt, "data-index": y, "data-front": He, "data-swiping": Z, "data-dismissible": We, "data-type": Oe, "data-invert": Mt, "data-swipe-out": ae, "data-swipe-direction": $, "data-expanded": !!(S || P && U), style: { "--index": y, "--toasts-before": y, "--z-index": C.length - y, "--offset": `${J ? Ce : It.current}px`, "--initial-height": P ? "auto" : `${Ee}px`, ..._, ...f.style }, onDragEnd: () => {
19630
+ return M.createElement("li", { tabIndex: 0, ref: qe, className: un(K, ht, k == null ? void 0 : k.toast, (t = f == null ? void 0 : f.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Oe], (n = f == null ? void 0 : f.classNames) == null ? void 0 : n[Oe]), "data-sonner-toast": "", "data-rich-colors": (r = f.richColors) != null ? r : E, "data-styled": !(f.jsx || f.unstyled || v), "data-mounted": W, "data-promise": !!f.promise, "data-swiped": ge, "data-removed": J, "data-visible": Ge, "data-y-position": Ut, "data-x-position": gt, "data-index": y, "data-front": He, "data-swiping": Z, "data-dismissible": We, "data-type": Oe, "data-invert": Mt, "data-swipe-out": ae, "data-swipe-direction": $, "data-expanded": !!(S || P && W), style: { "--index": y, "--toasts-before": y, "--z-index": C.length - y, "--offset": `${J ? Ce : It.current}px`, "--initial-height": P ? "auto" : `${Ee}px`, ..._, ...f.style }, onDragEnd: () => {
19628
19631
  z(!1), B(null), Pt.current = null;
19629
19632
  }, onPointerDown: (xe) => {
19630
19633
  G || !We || (Rt.current = /* @__PURE__ */ new Date(), Ne(It.current), xe.target.setPointerCapture(xe.pointerId), xe.target.tagName !== "BUTTON" && (z(!0), Pt.current = { x: xe.clientX, y: xe.clientY }));
@@ -19649,7 +19652,7 @@ var PI = (e) => {
19649
19652
  } : () => {
19650
19653
  var xe;
19651
19654
  ue(), (xe = f.onDismiss) == null || xe.call(f, f);
19652
- }, className: un(k == null ? void 0 : k.closeButton, (o = f == null ? void 0 : f.classNames) == null ? void 0 : o.closeButton) }, (s = V == null ? void 0 : V.close) != null ? s : gI) : null, f.jsx || xa(f.title) ? f.jsx ? f.jsx : typeof f.title == "function" ? f.title() : f.title : M.createElement(M.Fragment, null, Oe || f.icon || f.promise ? M.createElement("div", { "data-icon": "", className: un(k == null ? void 0 : k.icon, (a = f == null ? void 0 : f.classNames) == null ? void 0 : a.icon) }, f.promise || f.type === "loading" && !f.icon ? f.icon || ze() : null, f.type !== "loading" ? f.icon || (V == null ? void 0 : V[Oe]) || cI(Oe) : null) : null, M.createElement("div", { "data-content": "", className: un(k == null ? void 0 : k.content, (i = f == null ? void 0 : f.classNames) == null ? void 0 : i.content) }, M.createElement("div", { "data-title": "", className: un(k == null ? void 0 : k.title, (l = f == null ? void 0 : f.classNames) == null ? void 0 : l.title) }, typeof f.title == "function" ? f.title() : f.title), f.description ? M.createElement("div", { "data-description": "", className: un(H, jt, k == null ? void 0 : k.description, (c = f == null ? void 0 : f.classNames) == null ? void 0 : c.description) }, typeof f.description == "function" ? f.description() : f.description) : null), xa(f.cancel) ? f.cancel : f.cancel && Yo(f.cancel) ? M.createElement("button", { "data-button": !0, "data-cancel": !0, style: f.cancelButtonStyle || O, onClick: (xe) => {
19655
+ }, className: un(k == null ? void 0 : k.closeButton, (o = f == null ? void 0 : f.classNames) == null ? void 0 : o.closeButton) }, (s = U == null ? void 0 : U.close) != null ? s : gI) : null, f.jsx || xa(f.title) ? f.jsx ? f.jsx : typeof f.title == "function" ? f.title() : f.title : M.createElement(M.Fragment, null, Oe || f.icon || f.promise ? M.createElement("div", { "data-icon": "", className: un(k == null ? void 0 : k.icon, (a = f == null ? void 0 : f.classNames) == null ? void 0 : a.icon) }, f.promise || f.type === "loading" && !f.icon ? f.icon || ze() : null, f.type !== "loading" ? f.icon || (U == null ? void 0 : U[Oe]) || cI(Oe) : null) : null, M.createElement("div", { "data-content": "", className: un(k == null ? void 0 : k.content, (i = f == null ? void 0 : f.classNames) == null ? void 0 : i.content) }, M.createElement("div", { "data-title": "", className: un(k == null ? void 0 : k.title, (l = f == null ? void 0 : f.classNames) == null ? void 0 : l.title) }, typeof f.title == "function" ? f.title() : f.title), f.description ? M.createElement("div", { "data-description": "", className: un(H, jt, k == null ? void 0 : k.description, (c = f == null ? void 0 : f.classNames) == null ? void 0 : c.description) }, typeof f.description == "function" ? f.description() : f.description) : null), xa(f.cancel) ? f.cancel : f.cancel && Yo(f.cancel) ? M.createElement("button", { "data-button": !0, "data-cancel": !0, style: f.cancelButtonStyle || O, onClick: (xe) => {
19653
19656
  var $e, Ye;
19654
19657
  Yo(f.cancel) && We && ((Ye = ($e = f.cancel).onClick) == null || Ye.call($e, xe), ue());
19655
19658
  }, className: un(k == null ? void 0 : k.cancelButton, (d = f == null ? void 0 : f.classNames) == null ? void 0 : d.cancelButton) }, f.cancel.label) : null, xa(f.action) ? f.action : f.action && Yo(f.action) ? M.createElement("button", { "data-button": !0, "data-action": !0, style: f.actionButtonStyle || L, onClick: (xe) => {
@@ -19677,7 +19680,7 @@ function MI(e, t) {
19677
19680
  }), n;
19678
19681
  }
19679
19682
  var OI = Lg(function(e, t) {
19680
- let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: s, closeButton: a, className: i, offset: l, mobileOffset: c, theme: d = "light", richColors: p, duration: m, style: f, visibleToasts: v = EI, toastOptions: g, dir: x = Au(), gap: b = NI, loadingIcon: w, icons: y, containerAriaLabel: C = "Notifications", pauseWhenPageIsHidden: S } = e, [T, E] = M.useState([]), R = M.useMemo(() => Array.from(new Set([r].concat(T.filter((j) => j.position).map((j) => j.position)))), [T, r]), [_, O] = M.useState([]), [L, K] = M.useState(!1), [H, N] = M.useState(!1), [Y, q] = M.useState(d !== "system" ? d : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), F = M.useRef(null), P = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), k = M.useRef(null), V = M.useRef(!1), X = M.useCallback((j) => {
19683
+ let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: s, closeButton: a, className: i, offset: l, mobileOffset: c, theme: d = "light", richColors: p, duration: m, style: f, visibleToasts: v = EI, toastOptions: g, dir: x = Au(), gap: b = NI, loadingIcon: w, icons: y, containerAriaLabel: C = "Notifications", pauseWhenPageIsHidden: S } = e, [T, E] = M.useState([]), R = M.useMemo(() => Array.from(new Set([r].concat(T.filter((j) => j.position).map((j) => j.position)))), [T, r]), [_, O] = M.useState([]), [L, K] = M.useState(!1), [H, N] = M.useState(!1), [Y, q] = M.useState(d !== "system" ? d : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), F = M.useRef(null), P = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), k = M.useRef(null), U = M.useRef(!1), X = M.useCallback((j) => {
19681
19684
  E((A) => {
19682
19685
  var B;
19683
19686
  return (B = A.find(($) => $.id === j.id)) != null && B.delete || Kt.dismiss(j.id), A.filter(({ id: $ }) => $ !== j.id);
@@ -19726,22 +19729,22 @@ var OI = Lg(function(e, t) {
19726
19729
  return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
19727
19730
  }, [o]), M.useEffect(() => {
19728
19731
  if (F.current) return () => {
19729
- k.current && (k.current.focus({ preventScroll: !0 }), k.current = null, V.current = !1);
19732
+ k.current && (k.current.focus({ preventScroll: !0 }), k.current = null, U.current = !1);
19730
19733
  };
19731
19734
  }, [F.current]), M.createElement("section", { ref: t, "aria-label": `${C} ${P}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: !0 }, R.map((j, A) => {
19732
19735
  var B;
19733
19736
  let [$, ne] = j.split("-");
19734
- return T.length ? M.createElement("ol", { key: j, dir: x === "auto" ? Au() : x, tabIndex: -1, ref: F, className: i, "data-sonner-toaster": !0, "data-theme": Y, "data-y-position": $, "data-lifted": L && T.length > 1 && !s, "data-x-position": ne, style: { "--front-toast-height": `${((B = _[0]) == null ? void 0 : B.height) || 0}px`, "--width": `${II}px`, "--gap": `${b}px`, ...f, ...MI(l, c) }, onBlur: (U) => {
19735
- V.current && !U.currentTarget.contains(U.relatedTarget) && (V.current = !1, k.current && (k.current.focus({ preventScroll: !0 }), k.current = null));
19736
- }, onFocus: (U) => {
19737
- U.target instanceof HTMLElement && U.target.dataset.dismissible === "false" || V.current || (V.current = !0, k.current = U.relatedTarget);
19737
+ return T.length ? M.createElement("ol", { key: j, dir: x === "auto" ? Au() : x, tabIndex: -1, ref: F, className: i, "data-sonner-toaster": !0, "data-theme": Y, "data-y-position": $, "data-lifted": L && T.length > 1 && !s, "data-x-position": ne, style: { "--front-toast-height": `${((B = _[0]) == null ? void 0 : B.height) || 0}px`, "--width": `${II}px`, "--gap": `${b}px`, ...f, ...MI(l, c) }, onBlur: (W) => {
19738
+ U.current && !W.currentTarget.contains(W.relatedTarget) && (U.current = !1, k.current && (k.current.focus({ preventScroll: !0 }), k.current = null));
19739
+ }, onFocus: (W) => {
19740
+ W.target instanceof HTMLElement && W.target.dataset.dismissible === "false" || U.current || (U.current = !0, k.current = W.relatedTarget);
19738
19741
  }, onMouseEnter: () => K(!0), onMouseMove: () => K(!0), onMouseLeave: () => {
19739
19742
  H || K(!1);
19740
- }, onDragEnd: () => K(!1), onPointerDown: (U) => {
19741
- U.target instanceof HTMLElement && U.target.dataset.dismissible === "false" || N(!0);
19742
- }, onPointerUp: () => N(!1) }, T.filter((U) => !U.position && A === 0 || U.position === j).map((U, D) => {
19743
+ }, onDragEnd: () => K(!1), onPointerDown: (W) => {
19744
+ W.target instanceof HTMLElement && W.target.dataset.dismissible === "false" || N(!0);
19745
+ }, onPointerUp: () => N(!1) }, T.filter((W) => !W.position && A === 0 || W.position === j).map((W, D) => {
19743
19746
  var J, Q;
19744
- return M.createElement(PI, { key: U.id, icons: y, index: D, toast: U, defaultRichColors: p, duration: (J = g == null ? void 0 : g.duration) != null ? J : m, className: g == null ? void 0 : g.className, descriptionClassName: g == null ? void 0 : g.descriptionClassName, invert: n, visibleToasts: v, closeButton: (Q = g == null ? void 0 : g.closeButton) != null ? Q : a, interacting: H, position: j, style: g == null ? void 0 : g.style, unstyled: g == null ? void 0 : g.unstyled, classNames: g == null ? void 0 : g.classNames, cancelButtonStyle: g == null ? void 0 : g.cancelButtonStyle, actionButtonStyle: g == null ? void 0 : g.actionButtonStyle, removeToast: X, toasts: T.filter((Z) => Z.position == U.position), heights: _.filter((Z) => Z.position == U.position), setHeights: O, expandByDefault: s, gap: b, loadingIcon: w, expanded: L, pauseWhenPageIsHidden: S, swipeDirections: e.swipeDirections });
19747
+ return M.createElement(PI, { key: W.id, icons: y, index: D, toast: W, defaultRichColors: p, duration: (J = g == null ? void 0 : g.duration) != null ? J : m, className: g == null ? void 0 : g.className, descriptionClassName: g == null ? void 0 : g.descriptionClassName, invert: n, visibleToasts: v, closeButton: (Q = g == null ? void 0 : g.closeButton) != null ? Q : a, interacting: H, position: j, style: g == null ? void 0 : g.style, unstyled: g == null ? void 0 : g.unstyled, classNames: g == null ? void 0 : g.classNames, cancelButtonStyle: g == null ? void 0 : g.cancelButtonStyle, actionButtonStyle: g == null ? void 0 : g.actionButtonStyle, removeToast: X, toasts: T.filter((Z) => Z.position == W.position), heights: _.filter((Z) => Z.position == W.position), setHeights: O, expandByDefault: s, gap: b, loadingIcon: w, expanded: L, pauseWhenPageIsHidden: S, swipeDirections: e.swipeDirections });
19745
19748
  })) : null;
19746
19749
  }));
19747
19750
  });