@chaibuilder/pages 0.16.1 → 0.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/{2AITGKQY-CD9A6oc6.cjs → 2AITGKQY-8xBkB8Pv.cjs} +1 -1
  2. package/dist/{2AITGKQY-Z1XcJ6Q7.js → 2AITGKQY-DI5Po2Nc.js} +2 -2
  3. package/dist/{NCMVHL6D-CkpM-3og.cjs → NCMVHL6D-B4xqJIpr.cjs} +1 -1
  4. package/dist/{NCMVHL6D-DoK0XoIo.js → NCMVHL6D-kHUQxG8D.js} +2 -2
  5. package/dist/{ZDWCUMSJ-D32swpGV.cjs → ZDWCUMSJ-CjlhoCfQ.cjs} +1 -1
  6. package/dist/{ZDWCUMSJ-hGXNxbOK.js → ZDWCUMSJ-DRgY2Er1.js} +1 -1
  7. package/dist/{add-new-language-page-BZPoqdX-.js → add-new-language-page-DSB8ohdj.js} +2 -2
  8. package/dist/{add-new-language-page-D65TpIwK.cjs → add-new-language-page-noBKABVx.cjs} +1 -1
  9. package/dist/{add-new-page-DK25Y0zS.js → add-new-page-BYkFbQvH.js} +1 -1
  10. package/dist/{add-new-page-CQ0aj4RJ.cjs → add-new-page-CByS9KqS.cjs} +1 -1
  11. package/dist/ai-panel-content-BBnzp4fO.cjs +1 -0
  12. package/dist/ai-panel-content-DET3HjIR.js +54 -0
  13. package/dist/ai-panel-default-lang-BYfcAA8u.js +178 -0
  14. package/dist/ai-panel-default-lang-D-RS6z5I.cjs +1 -0
  15. package/dist/ai-panel-other-lang-BoD4FsoG.cjs +1 -0
  16. package/dist/{ai-panel-other-lang-CCyiE6ha.js → ai-panel-other-lang-TVjNYPRK.js} +76 -71
  17. package/dist/{ai-panel-quick-prompts-DeS7L1f0.cjs → ai-panel-quick-prompts-BGBdrdP7.cjs} +1 -1
  18. package/dist/{ai-panel-quick-prompts-Ds0Ndz7g.js → ai-panel-quick-prompts-BPrA9nvg.js} +1 -1
  19. package/dist/ai-prompt-input-DB1FpA_q.cjs +1 -0
  20. package/dist/ai-prompt-input-qegCvwnu.js +222 -0
  21. package/dist/{ai-translation-prompt-BiJ5B_an.js → ai-translation-prompt--HB1UAhC.js} +1 -1
  22. package/dist/{ai-translation-prompt-BUFjo_om.cjs → ai-translation-prompt-Bj-AM4xK.cjs} +1 -1
  23. package/dist/{delete-page-B95T2Prd.js → delete-page-C7xfkDN5.js} +1 -1
  24. package/dist/{delete-page-BSop1jNg.cjs → delete-page-DJLNpUxo.cjs} +1 -1
  25. package/dist/{digital-asset-manager-Bn58WzM6.cjs → digital-asset-manager-BblMbig0.cjs} +1 -1
  26. package/dist/{digital-asset-manager-BQNSwfKs.js → digital-asset-manager-INrgGoC0.js} +1 -1
  27. package/dist/{duplicate-page-CrzzObAj.js → duplicate-page-B8k4yZxa.js} +2 -2
  28. package/dist/{duplicate-page-BLxkSiug.cjs → duplicate-page-C9XewuHN.cjs} +1 -1
  29. package/dist/{dynamic-page-selector-D6wQnNfH.js → dynamic-page-selector-C7Vos5-l.js} +1 -1
  30. package/dist/{dynamic-page-selector-D8UZ63LW.cjs → dynamic-page-selector-CYYnEngT.cjs} +1 -1
  31. package/dist/index-CyHmr87X.cjs +5 -0
  32. package/dist/{index-yhKyIbgs.js → index-DRQI9rlW.js} +461 -452
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/{json-diff-viewer-ISJS7lHK.js → json-diff-viewer-8vUwU0Sk.js} +1 -1
  36. package/dist/{json-diff-viewer-ZeJ3Rp2y.cjs → json-diff-viewer-DVskWjAL.cjs} +1 -1
  37. package/dist/{lang-panel-Bj11IL7k.js → lang-panel-B8SeKnwN.js} +2 -2
  38. package/dist/{lang-panel-DqN_J3vz.cjs → lang-panel-BeyCHr4u.cjs} +1 -1
  39. package/dist/{mark-as-template-CmCCMaQg.js → mark-as-template-CpNHtyfB.js} +1 -1
  40. package/dist/{mark-as-template-CcwAAdrd.cjs → mark-as-template-DTEF_hyN.cjs} +1 -1
  41. package/dist/{no-language-page-content-Cme-zo4R.js → no-language-page-content-BPiFDGJr.js} +1 -1
  42. package/dist/{no-language-page-content-BXm1k1Aa.cjs → no-language-page-content-DnAP2ICP.cjs} +1 -1
  43. package/dist/{page-creator-ByhjXyHP.cjs → page-creator-BawPgFIv.cjs} +1 -1
  44. package/dist/{page-creator-Zbv4d4H8.js → page-creator-BiDN-rLc.js} +2 -2
  45. package/dist/{page-lock-request-DDQJb8IA.js → page-lock-request-BVYclE6H.js} +1 -1
  46. package/dist/{page-lock-request-Cln-EE6Z.cjs → page-lock-request-wIw-W5qT.cjs} +1 -1
  47. package/dist/{page-locked-by-dialog-Csn56a3n.js → page-locked-by-dialog-CuHvd48D.js} +1 -1
  48. package/dist/{page-locked-by-dialog-BIXYITEu.cjs → page-locked-by-dialog-jZDY0omZ.cjs} +1 -1
  49. package/dist/{page-manager-new-BJaTBpih.cjs → page-manager-new-BmZlPcpL.cjs} +1 -1
  50. package/dist/{page-manager-new-BrRxZDfT.js → page-manager-new-kMwd9hkH.js} +2 -2
  51. package/dist/{page-manager-search-and-filter-_Hvk3bU3.js → page-manager-search-and-filter-BU-1wFbM.js} +1 -1
  52. package/dist/{page-manager-search-and-filter-Bk3PUjha.cjs → page-manager-search-and-filter-DMauRN5Y.cjs} +1 -1
  53. package/dist/{page-revisions-content-C_Ha3tFu.cjs → page-revisions-content-BH0Xy_k9.cjs} +1 -1
  54. package/dist/{page-revisions-content-B6fRCBX_.js → page-revisions-content-c32By7XR.js} +2 -2
  55. package/dist/{prompt-helper-DgI1lgGV.cjs → prompt-helper-BLBZjr5q.cjs} +1 -1
  56. package/dist/{prompt-helper-Csgu8Rfb.js → prompt-helper-Bh7WyDYo.js} +1 -1
  57. package/dist/{publish-pages-content-DQDNxwHD.cjs → publish-pages-content-B5UqPZy0.cjs} +1 -1
  58. package/dist/{publish-pages-content-CFEIxKQD.js → publish-pages-content-BB6l92oG.js} +2 -2
  59. package/dist/{save-to-lib-Bl22umTa.cjs → save-to-lib-DM1MzZTb.cjs} +1 -1
  60. package/dist/{save-to-lib-YyYkF6c6.js → save-to-lib-NvQZll63.js} +1 -1
  61. package/dist/{seo-panel-BZlMea1L.js → seo-panel-BsMBb5Ep.js} +1 -1
  62. package/dist/{seo-panel-BhxikAkG.cjs → seo-panel-C20m5SFc.cjs} +1 -1
  63. package/dist/server.cjs +8 -8
  64. package/dist/server.d.ts +1 -0
  65. package/dist/server.js +141 -141
  66. package/dist/{shared-json-ld-E4Ckwlbr.js → shared-json-ld-BVqIgANo.js} +1 -1
  67. package/dist/{shared-json-ld-BfkH76U3.cjs → shared-json-ld-CfWO90c0.cjs} +1 -1
  68. package/dist/{slug-input--VmQG0S1.cjs → slug-input-BewLv-d8.cjs} +1 -1
  69. package/dist/{slug-input-CKKkqGj4.js → slug-input-RCGUFL2T.js} +1 -1
  70. package/dist/{theme-panel-footer-CagxEZEO.cjs → theme-panel-footer-8oSQtfZ5.cjs} +1 -1
  71. package/dist/{theme-panel-footer-2ERfMsET.js → theme-panel-footer-BJB36k8A.js} +1 -1
  72. package/dist/{unmark-as-template-BJ5CTNAe.js → unmark-as-template-CGZ0CCI2.js} +1 -1
  73. package/dist/{unmark-as-template-CeWpo9wD.cjs → unmark-as-template-DLNmyum3.cjs} +1 -1
  74. package/dist/{unpublish-page-DmZSVxFj.cjs → unpublish-page-B_xQPGsZ.cjs} +1 -1
  75. package/dist/{unpublish-page-DvOWVBIf.js → unpublish-page-CEtpcrvc.js} +1 -1
  76. package/dist/{web-preview-DTkIggV7.js → web-preview-CCGkTRU3.js} +1 -1
  77. package/dist/{web-preview-DlSKpPUZ.cjs → web-preview-Cifi0bwK.cjs} +1 -1
  78. package/package.json +12 -12
  79. package/dist/ai-panel-content-BSGJqnTM.cjs +0 -1
  80. package/dist/ai-panel-content-DYRZnMgV.js +0 -52
  81. package/dist/ai-panel-default-lang-BOZrL5Xe.cjs +0 -1
  82. package/dist/ai-panel-default-lang-DZUqC79y.js +0 -173
  83. package/dist/ai-panel-other-lang-CNtlT5dM.cjs +0 -1
  84. package/dist/ai-prompt-input-Ch_PLEPN.js +0 -133
  85. package/dist/ai-prompt-input-Zg6lN1Lo.cjs +0 -1
  86. package/dist/index-W0r4o5Ro.cjs +0 -5
package/dist/server.js CHANGED
@@ -396,10 +396,10 @@ function xi(e) {
396
396
  function m(w) {
397
397
  const v = s ? w.replace(/^\xEF\xBB\xBF/, "") : w, [l, g] = ki(`${o}${v}`);
398
398
  for (const y of l)
399
- _(y);
399
+ b(y);
400
400
  o = g, s = !1;
401
401
  }
402
- function _(w) {
402
+ function b(w) {
403
403
  if (w === "") {
404
404
  p();
405
405
  return;
@@ -411,12 +411,12 @@ function xi(e) {
411
411
  const v = w.indexOf(":");
412
412
  if (v !== -1) {
413
413
  const l = w.slice(0, v), g = w[v + 1] === " " ? 2 : 1, y = w.slice(v + g);
414
- b(l, y, w);
414
+ _(l, y, w);
415
415
  return;
416
416
  }
417
- b(w, "", w);
417
+ _(w, "", w);
418
418
  }
419
- function b(w, v, l) {
419
+ function _(w, v, l) {
420
420
  switch (w) {
421
421
  case "event":
422
422
  c = v;
@@ -458,7 +458,7 @@ function xi(e) {
458
458
  }), i = void 0, u = "", c = "";
459
459
  }
460
460
  function f(w = {}) {
461
- o && w.consume && _(o), s = !0, i = void 0, u = "", c = "", o = "";
461
+ o && w.consume && b(o), s = !0, i = void 0, u = "", c = "", o = "";
462
462
  }
463
463
  return { feed: m, reset: f };
464
464
  }
@@ -1226,23 +1226,23 @@ const Pu = {
1226
1226
  else {
1227
1227
  const o = (s, i, u) => {
1228
1228
  let c = ot(s), m;
1229
- for (const _ of i) {
1230
- if (_._zod.def.when) {
1231
- if (!_._zod.def.when(s))
1229
+ for (const b of i) {
1230
+ if (b._zod.def.when) {
1231
+ if (!b._zod.def.when(s))
1232
1232
  continue;
1233
1233
  } else if (c)
1234
1234
  continue;
1235
- const b = s.issues.length, p = _._zod.check(s);
1235
+ const _ = s.issues.length, p = b._zod.check(s);
1236
1236
  if (p instanceof Promise && (u == null ? void 0 : u.async) === !1)
1237
1237
  throw new ut();
1238
1238
  if (m || p instanceof Promise)
1239
1239
  m = (m ?? Promise.resolve()).then(async () => {
1240
- await p, s.issues.length !== b && (c || (c = ot(s, b)));
1240
+ await p, s.issues.length !== _ && (c || (c = ot(s, _)));
1241
1241
  });
1242
1242
  else {
1243
- if (s.issues.length === b)
1243
+ if (s.issues.length === _)
1244
1244
  continue;
1245
- c || (c = ot(s, b));
1245
+ c || (c = ot(s, _));
1246
1246
  }
1247
1247
  }
1248
1248
  return m ? m.then(() => s) : s;
@@ -1571,45 +1571,45 @@ function xt(e, t, r, n) {
1571
1571
  const pc = /* @__PURE__ */ h("$ZodObject", (e, t) => {
1572
1572
  Z.init(e, t);
1573
1573
  const r = Dr(() => {
1574
- const _ = Object.keys(t.shape);
1575
- for (const p of _)
1574
+ const b = Object.keys(t.shape);
1575
+ for (const p of b)
1576
1576
  if (!t.shape[p]._zod.traits.has("$ZodType"))
1577
1577
  throw new Error(`Invalid element at key "${p}": expected a Zod schema`);
1578
- const b = Ci(t.shape);
1578
+ const _ = Ci(t.shape);
1579
1579
  return {
1580
1580
  shape: t.shape,
1581
- keys: _,
1582
- keySet: new Set(_),
1583
- numKeys: _.length,
1584
- optionalKeys: new Set(b)
1581
+ keys: b,
1582
+ keySet: new Set(b),
1583
+ numKeys: b.length,
1584
+ optionalKeys: new Set(_)
1585
1585
  };
1586
1586
  });
1587
1587
  C(e._zod, "propValues", () => {
1588
- const _ = t.shape, b = {};
1589
- for (const p in _) {
1590
- const f = _[p]._zod;
1588
+ const b = t.shape, _ = {};
1589
+ for (const p in b) {
1590
+ const f = b[p]._zod;
1591
1591
  if (f.values) {
1592
- b[p] ?? (b[p] = /* @__PURE__ */ new Set());
1592
+ _[p] ?? (_[p] = /* @__PURE__ */ new Set());
1593
1593
  for (const w of f.values)
1594
- b[p].add(w);
1594
+ _[p].add(w);
1595
1595
  }
1596
1596
  }
1597
- return b;
1597
+ return _;
1598
1598
  });
1599
- const n = (_) => {
1600
- const b = new Cu(["shape", "payload", "ctx"]), p = r.value, f = (g) => {
1599
+ const n = (b) => {
1600
+ const _ = new Cu(["shape", "payload", "ctx"]), p = r.value, f = (g) => {
1601
1601
  const y = wn(g);
1602
1602
  return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
1603
1603
  };
1604
- b.write("const input = payload.value;");
1604
+ _.write("const input = payload.value;");
1605
1605
  const w = /* @__PURE__ */ Object.create(null);
1606
1606
  let v = 0;
1607
1607
  for (const g of p.keys)
1608
1608
  w[g] = `key_${v++}`;
1609
- b.write("const newResult = {}");
1609
+ _.write("const newResult = {}");
1610
1610
  for (const g of p.keys) {
1611
1611
  const y = w[g], d = wn(g);
1612
- b.write(`const ${y} = ${f(g)};`), b.write(`
1612
+ _.write(`const ${y} = ${f(g)};`), _.write(`
1613
1613
  if (${y}.issues.length) {
1614
1614
  payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
1615
1615
  ...iss,
@@ -1626,36 +1626,36 @@ const pc = /* @__PURE__ */ h("$ZodObject", (e, t) => {
1626
1626
  }
1627
1627
  `);
1628
1628
  }
1629
- b.write("payload.value = newResult;"), b.write("return payload;");
1630
- const l = b.compile();
1631
- return (g, y) => l(_, g, y);
1629
+ _.write("payload.value = newResult;"), _.write("return payload;");
1630
+ const l = _.compile();
1631
+ return (g, y) => l(b, g, y);
1632
1632
  };
1633
1633
  let a;
1634
1634
  const o = zt, s = !Xa.jitless, u = s && Ni.value, c = t.catchall;
1635
1635
  let m;
1636
- e._zod.parse = (_, b) => {
1636
+ e._zod.parse = (b, _) => {
1637
1637
  m ?? (m = r.value);
1638
- const p = _.value;
1638
+ const p = b.value;
1639
1639
  if (!o(p))
1640
- return _.issues.push({
1640
+ return b.issues.push({
1641
1641
  expected: "object",
1642
1642
  code: "invalid_type",
1643
1643
  input: p,
1644
1644
  inst: e
1645
- }), _;
1645
+ }), b;
1646
1646
  const f = [];
1647
- if (s && u && (b == null ? void 0 : b.async) === !1 && b.jitless !== !0)
1648
- a || (a = n(t.shape)), _ = a(_, b);
1647
+ if (s && u && (_ == null ? void 0 : _.async) === !1 && _.jitless !== !0)
1648
+ a || (a = n(t.shape)), b = a(b, _);
1649
1649
  else {
1650
- _.value = {};
1650
+ b.value = {};
1651
1651
  const y = m.shape;
1652
1652
  for (const d of m.keys) {
1653
- const I = y[d]._zod.run({ value: p[d], issues: [] }, b);
1654
- I instanceof Promise ? f.push(I.then((x) => xt(x, _, d, p))) : xt(I, _, d, p);
1653
+ const I = y[d]._zod.run({ value: p[d], issues: [] }, _);
1654
+ I instanceof Promise ? f.push(I.then((x) => xt(x, b, d, p))) : xt(I, b, d, p);
1655
1655
  }
1656
1656
  }
1657
1657
  if (!c)
1658
- return f.length ? Promise.all(f).then(() => _) : _;
1658
+ return f.length ? Promise.all(f).then(() => b) : b;
1659
1659
  const w = [], v = m.keySet, l = c._zod, g = l.def.type;
1660
1660
  for (const y of Object.keys(p)) {
1661
1661
  if (v.has(y))
@@ -1664,15 +1664,15 @@ const pc = /* @__PURE__ */ h("$ZodObject", (e, t) => {
1664
1664
  w.push(y);
1665
1665
  continue;
1666
1666
  }
1667
- const d = l.run({ value: p[y], issues: [] }, b);
1668
- d instanceof Promise ? f.push(d.then((S) => xt(S, _, y, p))) : xt(d, _, y, p);
1667
+ const d = l.run({ value: p[y], issues: [] }, _);
1668
+ d instanceof Promise ? f.push(d.then((S) => xt(S, b, y, p))) : xt(d, b, y, p);
1669
1669
  }
1670
- return w.length && _.issues.push({
1670
+ return w.length && b.issues.push({
1671
1671
  code: "unrecognized_keys",
1672
1672
  keys: w,
1673
1673
  input: p,
1674
1674
  inst: e
1675
- }), f.length ? Promise.all(f).then(() => _) : _;
1675
+ }), f.length ? Promise.all(f).then(() => b) : b;
1676
1676
  };
1677
1677
  });
1678
1678
  function En(e, t, r, n) {
@@ -2519,7 +2519,7 @@ class zn {
2519
2519
  }), this.io = (t == null ? void 0 : t.io) ?? "output", this.seen = /* @__PURE__ */ new Map();
2520
2520
  }
2521
2521
  process(t, r = { path: [], schemaPath: [] }) {
2522
- var _, b, p;
2522
+ var b, _, p;
2523
2523
  var n;
2524
2524
  const a = t._zod.def, o = {
2525
2525
  guid: "uuid",
@@ -2533,7 +2533,7 @@ class zn {
2533
2533
  return s.count++, r.schemaPath.includes(t) && (s.cycle = r.path), s.schema;
2534
2534
  const i = { schema: {}, count: 1, cycle: void 0, path: r.path };
2535
2535
  this.seen.set(t, i);
2536
- const u = (b = (_ = t._zod).toJSONSchema) == null ? void 0 : b.call(_);
2536
+ const u = (_ = (b = t._zod).toJSONSchema) == null ? void 0 : _.call(b);
2537
2537
  if (u)
2538
2538
  i.schema = u;
2539
2539
  else {
@@ -2813,7 +2813,7 @@ class zn {
2813
2813
  return c && Object.assign(i.schema, c), this.io === "input" && G(t) && (delete i.schema.examples, delete i.schema.default), this.io === "input" && i.schema._prefault && ((n = i.schema).default ?? (n.default = i.schema._prefault)), delete i.schema._prefault, this.seen.get(t).schema;
2814
2814
  }
2815
2815
  emit(t, r) {
2816
- var m, _, b, p, f, w;
2816
+ var m, b, _, p, f, w;
2817
2817
  const n = {
2818
2818
  cycles: (r == null ? void 0 : r.cycles) ?? "ref",
2819
2819
  reused: (r == null ? void 0 : r.reused) ?? "inline",
@@ -2862,13 +2862,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2862
2862
  continue;
2863
2863
  }
2864
2864
  if (n.external) {
2865
- const y = (_ = n.external.registry.get(v[0])) == null ? void 0 : _.id;
2865
+ const y = (b = n.external.registry.get(v[0])) == null ? void 0 : b.id;
2866
2866
  if (t !== v[0] && y) {
2867
2867
  s(v);
2868
2868
  continue;
2869
2869
  }
2870
2870
  }
2871
- if ((b = this.metadataRegistry.get(v[0])) == null ? void 0 : b.id) {
2871
+ if ((_ = this.metadataRegistry.get(v[0])) == null ? void 0 : _.id) {
2872
2872
  s(v);
2873
2873
  continue;
2874
2874
  }
@@ -4809,18 +4809,18 @@ var Pp = (e, t) => {
4809
4809
  var r;
4810
4810
  const n = Mp(t);
4811
4811
  let a = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce(
4812
- (c, [m, _]) => {
4813
- var b;
4812
+ (c, [m, b]) => {
4813
+ var _;
4814
4814
  return {
4815
4815
  ...c,
4816
- [m]: (b = $(
4817
- _._def,
4816
+ [m]: (_ = $(
4817
+ b._def,
4818
4818
  {
4819
4819
  ...n,
4820
4820
  currentPath: [...n.basePath, n.definitionPath, m]
4821
4821
  },
4822
4822
  !0
4823
- )) != null ? b : te()
4823
+ )) != null ? _ : te()
4824
4824
  };
4825
4825
  },
4826
4826
  {}
@@ -4949,13 +4949,13 @@ var hr, Gn;
4949
4949
  function Jp() {
4950
4950
  if (Gn) return hr;
4951
4951
  Gn = 1;
4952
- var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (m, _) => {
4953
- for (var b in _)
4954
- e(m, b, { get: _[b], enumerable: !0 });
4955
- }, o = (m, _, b, p) => {
4956
- if (typeof _ == "object" || typeof _ == "function")
4957
- for (let f of r(_))
4958
- !n.call(m, f) && f !== b && e(m, f, { get: () => _[f], enumerable: !(p = t(_, f)) || p.enumerable });
4952
+ var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (m, b) => {
4953
+ for (var _ in b)
4954
+ e(m, _, { get: b[_], enumerable: !0 });
4955
+ }, o = (m, b, _, p) => {
4956
+ if (typeof b == "object" || typeof b == "function")
4957
+ for (let f of r(b))
4958
+ !n.call(m, f) && f !== _ && e(m, f, { get: () => b[f], enumerable: !(p = t(b, f)) || p.enumerable });
4959
4959
  return m;
4960
4960
  }, s = (m) => o(e({}, "__esModule", { value: !0 }), m), i = {};
4961
4961
  a(i, {
@@ -4964,8 +4964,8 @@ function Jp() {
4964
4964
  }), hr = s(i);
4965
4965
  const u = Symbol.for("@vercel/request-context");
4966
4966
  function c() {
4967
- var _, b;
4968
- return ((b = (_ = globalThis[u]) == null ? void 0 : _.get) == null ? void 0 : b.call(_)) ?? {};
4967
+ var b, _;
4968
+ return ((_ = (b = globalThis[u]) == null ? void 0 : b.get) == null ? void 0 : _.call(b)) ?? {};
4969
4969
  }
4970
4970
  return hr;
4971
4971
  }
@@ -4973,15 +4973,15 @@ var gr, qn;
4973
4973
  function Hp() {
4974
4974
  if (qn) return gr;
4975
4975
  qn = 1;
4976
- var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (_, b) => {
4977
- for (var p in b)
4978
- e(_, p, { get: b[p], enumerable: !0 });
4979
- }, o = (_, b, p, f) => {
4980
- if (typeof b == "object" || typeof b == "function")
4981
- for (let w of r(b))
4982
- !n.call(_, w) && w !== p && e(_, w, { get: () => b[w], enumerable: !(f = t(b, w)) || f.enumerable });
4983
- return _;
4984
- }, s = (_) => o(e({}, "__esModule", { value: !0 }), _), i = {};
4976
+ var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (b, _) => {
4977
+ for (var p in _)
4978
+ e(b, p, { get: _[p], enumerable: !0 });
4979
+ }, o = (b, _, p, f) => {
4980
+ if (typeof _ == "object" || typeof _ == "function")
4981
+ for (let w of r(_))
4982
+ !n.call(b, w) && w !== p && e(b, w, { get: () => _[w], enumerable: !(f = t(_, w)) || f.enumerable });
4983
+ return b;
4984
+ }, s = (b) => o(e({}, "__esModule", { value: !0 }), b), i = {};
4985
4985
  a(i, {
4986
4986
  getContext: () => u.getContext,
4987
4987
  getVercelOidcToken: () => c,
@@ -5555,7 +5555,7 @@ function yf(e = {}) {
5555
5555
  headers: u,
5556
5556
  fetch: e.fetch,
5557
5557
  o11yHeaders: c()
5558
- }), _ = async () => {
5558
+ }), b = async () => {
5559
5559
  var f, w, v;
5560
5560
  const l = (v = (w = (f = e._internal) == null ? void 0 : f.currentDate) == null ? void 0 : w.call(f).getTime()) != null ? v : Date.now();
5561
5561
  return (!n || l - s > o) && (s = l, n = new ha({
@@ -5568,7 +5568,7 @@ function yf(e = {}) {
5568
5568
  await ft(await u())
5569
5569
  );
5570
5570
  })), a ? Promise.resolve(a) : n;
5571
- }, b = async () => new ha({
5571
+ }, _ = async () => new ha({
5572
5572
  baseURL: i,
5573
5573
  headers: u,
5574
5574
  fetch: e.fetch
@@ -5584,7 +5584,7 @@ function yf(e = {}) {
5584
5584
  );
5585
5585
  return m(f);
5586
5586
  };
5587
- return p.getAvailableModels = _, p.getCredits = b, p.imageModel = (f) => {
5587
+ return p.getAvailableModels = b, p.getCredits = _, p.imageModel = (f) => {
5588
5588
  throw new Si({ modelId: f, modelType: "imageModel" });
5589
5589
  }, p.languageModel = m, p.textEmbeddingModel = (f) => new ff(f, {
5590
5590
  provider: "gateway",
@@ -5796,12 +5796,12 @@ var Of = function(e, t) {
5796
5796
  typeof o == "number" && (o = {
5797
5797
  logLevel: o
5798
5798
  });
5799
- var m = gt("diag"), _ = Af((i = o.logLevel) !== null && i !== void 0 ? i : ee.INFO, a);
5799
+ var m = gt("diag"), b = Af((i = o.logLevel) !== null && i !== void 0 ? i : ee.INFO, a);
5800
5800
  if (m && !o.suppressOverrideMessage) {
5801
- var b = (u = new Error().stack) !== null && u !== void 0 ? u : "<failed to generate stacktrace>";
5802
- m.warn("Current logger will be overwritten from " + b), _.warn("Current logger will overwrite one already registered from " + b);
5801
+ var _ = (u = new Error().stack) !== null && u !== void 0 ? u : "<failed to generate stacktrace>";
5802
+ m.warn("Current logger will be overwritten from " + _), b.warn("Current logger will overwrite one already registered from " + _);
5803
5803
  }
5804
- return Hr("diag", _, r, !0);
5804
+ return Hr("diag", b, r, !0);
5805
5805
  };
5806
5806
  r.setLogger = n, r.disable = function() {
5807
5807
  Yr(Rf, r);
@@ -7833,8 +7833,8 @@ function vh(e) {
7833
7833
  break;
7834
7834
  }
7835
7835
  case "INSIDE_LITERAL": {
7836
- const _ = e.substring(n, u + 1);
7837
- !"false".startsWith(_) && !"true".startsWith(_) && !"null".startsWith(_) ? (t.pop(), t[t.length - 1] === "INSIDE_OBJECT_AFTER_VALUE" ? o(c, u) : t[t.length - 1] === "INSIDE_ARRAY_AFTER_VALUE" && s(c, u)) : r = u;
7836
+ const b = e.substring(n, u + 1);
7837
+ !"false".startsWith(b) && !"true".startsWith(b) && !"null".startsWith(b) ? (t.pop(), t[t.length - 1] === "INSIDE_OBJECT_AFTER_VALUE" ? o(c, u) : t[t.length - 1] === "INSIDE_ARRAY_AFTER_VALUE" && s(c, u)) : r = u;
7838
7838
  break;
7839
7839
  }
7840
7840
  }
@@ -7909,7 +7909,7 @@ function _h({
7909
7909
  new TransformStream({
7910
7910
  async transform(i, u) {
7911
7911
  await n(async ({ state: c, write: m }) => {
7912
- var _, b, p, f;
7912
+ var b, _, p, f;
7913
7913
  function w(d) {
7914
7914
  const I = c.message.parts.filter(Sr).find(
7915
7915
  (x) => x.toolCallId === d
@@ -7989,12 +7989,12 @@ function _h({
7989
7989
  }
7990
7990
  case "text-delta": {
7991
7991
  const d = c.activeTextParts[i.id];
7992
- d.text += i.delta, d.providerMetadata = (_ = i.providerMetadata) != null ? _ : d.providerMetadata, m();
7992
+ d.text += i.delta, d.providerMetadata = (b = i.providerMetadata) != null ? b : d.providerMetadata, m();
7993
7993
  break;
7994
7994
  }
7995
7995
  case "text-end": {
7996
7996
  const d = c.activeTextParts[i.id];
7997
- d.state = "done", d.providerMetadata = (b = i.providerMetadata) != null ? b : d.providerMetadata, delete c.activeTextParts[i.id], m();
7997
+ d.state = "done", d.providerMetadata = (_ = i.providerMetadata) != null ? _ : d.providerMetadata, delete c.activeTextParts[i.id], m();
7998
7998
  break;
7999
7999
  }
8000
8000
  case "reasoning-start": {
@@ -8238,12 +8238,12 @@ function bh({
8238
8238
  let s = !1;
8239
8239
  const i = a.pipeThrough(
8240
8240
  new TransformStream({
8241
- transform(b, p) {
8242
- if (b.type === "start") {
8243
- const f = b;
8241
+ transform(_, p) {
8242
+ if (_.type === "start") {
8243
+ const f = _;
8244
8244
  f.messageId == null && e != null && (f.messageId = e);
8245
8245
  }
8246
- b.type === "abort" && (s = !0), p.enqueue(b);
8246
+ _.type === "abort" && (s = !0), p.enqueue(_);
8247
8247
  }
8248
8248
  })
8249
8249
  );
@@ -8253,22 +8253,22 @@ function bh({
8253
8253
  lastMessage: o ? structuredClone(o) : void 0,
8254
8254
  messageId: e ?? ""
8255
8255
  // will be overridden by the stream
8256
- }), c = async (b) => {
8257
- await b({ state: u, write: () => {
8256
+ }), c = async (_) => {
8257
+ await _({ state: u, write: () => {
8258
8258
  } });
8259
8259
  };
8260
8260
  let m = !1;
8261
- const _ = async () => {
8261
+ const b = async () => {
8262
8262
  if (m || !r)
8263
8263
  return;
8264
8264
  m = !0;
8265
- const b = u.message.id === (o == null ? void 0 : o.id);
8265
+ const _ = u.message.id === (o == null ? void 0 : o.id);
8266
8266
  await r({
8267
8267
  isAborted: s,
8268
- isContinuation: b,
8268
+ isContinuation: _,
8269
8269
  responseMessage: u.message,
8270
8270
  messages: [
8271
- ...b ? t.slice(0, -1) : t,
8271
+ ..._ ? t.slice(0, -1) : t,
8272
8272
  u.message
8273
8273
  ]
8274
8274
  });
@@ -8279,15 +8279,15 @@ function bh({
8279
8279
  onError: n
8280
8280
  }).pipeThrough(
8281
8281
  new TransformStream({
8282
- transform(b, p) {
8283
- p.enqueue(b);
8282
+ transform(_, p) {
8283
+ p.enqueue(_);
8284
8284
  },
8285
8285
  // @ts-expect-error cancel is still new and missing from types https://developer.mozilla.org/en-US/docs/Web/API/TransformStream#browser_compatibility
8286
8286
  async cancel() {
8287
- await _();
8287
+ await b();
8288
8288
  },
8289
8289
  async flush() {
8290
- await _();
8290
+ await b();
8291
8291
  }
8292
8292
  })
8293
8293
  );
@@ -8477,10 +8477,10 @@ function Ih({
8477
8477
  start(l) {
8478
8478
  c = l;
8479
8479
  }
8480
- }), _ = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map();
8480
+ }), b = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map();
8481
8481
  let p = !1, f;
8482
8482
  function w() {
8483
- p && _.size === 0 && (f != null && c.enqueue(f), c.close());
8483
+ p && b.size === 0 && (f != null && c.enqueue(f), c.close());
8484
8484
  }
8485
8485
  const v = new TransformStream({
8486
8486
  async transform(l, g) {
@@ -8543,7 +8543,7 @@ function Ih({
8543
8543
  break;
8544
8544
  }
8545
8545
  const S = e[d.toolName];
8546
- if (b.set(d.toolCallId, d.input), S.onInputAvailable != null && await S.onInputAvailable({
8546
+ if (_.set(d.toolCallId, d.input), S.onInputAvailable != null && await S.onInputAvailable({
8547
8547
  input: d.input,
8548
8548
  toolCallId: d.toolCallId,
8549
8549
  messages: o,
@@ -8551,7 +8551,7 @@ function Ih({
8551
8551
  experimental_context: u
8552
8552
  }), S.execute != null && d.providerExecuted !== !0) {
8553
8553
  const I = Pd();
8554
- _.add(I), Zr({
8554
+ b.add(I), Zr({
8555
8555
  name: "ai.toolCall",
8556
8556
  attributes: Ve({
8557
8557
  telemetry: n,
@@ -8595,10 +8595,10 @@ function Ih({
8595
8595
  ...d,
8596
8596
  type: "tool-error",
8597
8597
  error: J
8598
- }), _.delete(I), w();
8598
+ }), b.delete(I), w();
8599
8599
  return;
8600
8600
  }
8601
- _.delete(I), w();
8601
+ b.delete(I), w();
8602
8602
  try {
8603
8603
  x.setAttributes(
8604
8604
  Ve({
@@ -8626,14 +8626,14 @@ function Ih({
8626
8626
  type: "tool-error",
8627
8627
  toolCallId: l.toolCallId,
8628
8628
  toolName: d,
8629
- input: b.get(l.toolCallId),
8629
+ input: _.get(l.toolCallId),
8630
8630
  providerExecuted: l.providerExecuted,
8631
8631
  error: l.result
8632
8632
  }) : g.enqueue({
8633
8633
  type: "tool-result",
8634
8634
  toolCallId: l.toolCallId,
8635
8635
  toolName: d,
8636
- input: b.get(l.toolCallId),
8636
+ input: _.get(l.toolCallId),
8637
8637
  output: l.result,
8638
8638
  providerExecuted: l.providerExecuted
8639
8639
  });
@@ -8691,8 +8691,8 @@ function kh({
8691
8691
  headers: u,
8692
8692
  stopWhen: c = lh(1),
8693
8693
  experimental_output: m,
8694
- experimental_telemetry: _,
8695
- prepareStep: b,
8694
+ experimental_telemetry: b,
8695
+ prepareStep: _,
8696
8696
  providerOptions: p,
8697
8697
  experimental_activeTools: f,
8698
8698
  activeTools: w = f,
@@ -8717,7 +8717,7 @@ function kh({
8717
8717
  }) {
8718
8718
  return new Oh({
8719
8719
  model: $s(e),
8720
- telemetry: _,
8720
+ telemetry: b,
8721
8721
  headers: u,
8722
8722
  settings: Ye,
8723
8723
  maxRetries: s,
@@ -8733,7 +8733,7 @@ function kh({
8733
8733
  stopConditions: wa(c),
8734
8734
  output: m,
8735
8735
  providerOptions: p,
8736
- prepareStep: b,
8736
+ prepareStep: _,
8737
8737
  includeRawChunks: y,
8738
8738
  onChunk: d,
8739
8739
  onError: S,
@@ -8810,8 +8810,8 @@ var Oh = class {
8810
8810
  messages: u,
8811
8811
  tools: c,
8812
8812
  toolChoice: m,
8813
- transforms: _,
8814
- activeTools: b,
8813
+ transforms: b,
8814
+ activeTools: _,
8815
8815
  repairToolCall: p,
8816
8816
  stopConditions: f,
8817
8817
  output: w,
@@ -9020,7 +9020,7 @@ var Oh = class {
9020
9020
  return We.stream.cancel(F);
9021
9021
  }
9022
9022
  });
9023
- for (const F of _)
9023
+ for (const F of b)
9024
9024
  tr = tr.pipeThrough(
9025
9025
  F({
9026
9026
  tools: c,
@@ -9088,7 +9088,7 @@ var Oh = class {
9088
9088
  }), { toolChoice: nr, tools: ar } = Um({
9089
9089
  tools: c,
9090
9090
  toolChoice: (Xe = de == null ? void 0 : de.toolChoice) != null ? Xe : m,
9091
- activeTools: (nn = de == null ? void 0 : de.activeTools) != null ? nn : b
9091
+ activeTools: (nn = de == null ? void 0 : de.activeTools) != null ? nn : _
9092
9092
  }), {
9093
9093
  result: { stream: Xs, response: un, request: cn },
9094
9094
  doStreamSpan: De,
@@ -9549,11 +9549,11 @@ var Oh = class {
9549
9549
  const c = t != null ? hh({
9550
9550
  originalMessages: e,
9551
9551
  responseMessageId: t
9552
- }) : void 0, m = {}, _ = (p) => {
9552
+ }) : void 0, m = {}, b = (p) => {
9553
9553
  var f, w;
9554
9554
  const v = m[p];
9555
9555
  return ((w = (f = this.tools) == null ? void 0 : f[v]) == null ? void 0 : w.type) === "dynamic" ? !0 : void 0;
9556
- }, b = this.fullStream.pipeThrough(
9556
+ }, _ = this.fullStream.pipeThrough(
9557
9557
  new TransformStream({
9558
9558
  transform: async (p, f) => {
9559
9559
  const w = n == null ? void 0 : n({ part: p }), v = p.type;
@@ -9635,7 +9635,7 @@ var Oh = class {
9635
9635
  }
9636
9636
  case "tool-input-start": {
9637
9637
  m[p.id] = p.toolName;
9638
- const l = _(p.id);
9638
+ const l = b(p.id);
9639
9639
  f.enqueue({
9640
9640
  type: "tool-input-start",
9641
9641
  toolCallId: p.id,
@@ -9655,7 +9655,7 @@ var Oh = class {
9655
9655
  }
9656
9656
  case "tool-call": {
9657
9657
  m[p.toolCallId] = p.toolName;
9658
- const l = _(p.toolCallId);
9658
+ const l = b(p.toolCallId);
9659
9659
  p.invalid ? f.enqueue({
9660
9660
  type: "tool-input-error",
9661
9661
  toolCallId: p.toolCallId,
@@ -9677,7 +9677,7 @@ var Oh = class {
9677
9677
  break;
9678
9678
  }
9679
9679
  case "tool-result": {
9680
- const l = _(p.toolCallId);
9680
+ const l = b(p.toolCallId);
9681
9681
  f.enqueue({
9682
9682
  type: "tool-output-available",
9683
9683
  toolCallId: p.toolCallId,
@@ -9689,7 +9689,7 @@ var Oh = class {
9689
9689
  break;
9690
9690
  }
9691
9691
  case "tool-error": {
9692
- const l = _(p.toolCallId);
9692
+ const l = b(p.toolCallId);
9693
9693
  f.enqueue({
9694
9694
  type: "tool-output-error",
9695
9695
  toolCallId: p.toolCallId,
@@ -9751,7 +9751,7 @@ var Oh = class {
9751
9751
  );
9752
9752
  return Ot(
9753
9753
  bh({
9754
- stream: b,
9754
+ stream: _,
9755
9755
  messageId: c ?? (t == null ? void 0 : t()),
9756
9756
  originalMessages: e,
9757
9757
  onFinish: r,
@@ -10016,15 +10016,15 @@ class Jh {
10016
10016
  this.options = t, this.model = (t == null ? void 0 : t.model) ?? this.model;
10017
10017
  }
10018
10018
  async handleRequest(t, r) {
10019
- var m, _;
10020
- const { messages: n, image: a, initiator: o = null } = t, s = n.filter((b) => b.role !== "system"), i = s[s.length - 1], u = a ? [
10021
- ...s.slice(0, -1),
10019
+ var _, p;
10020
+ const { messages: n, image: a, initiator: o = null, model: s } = t, i = s || this.model, u = n.filter((f) => f.role !== "system"), c = u[u.length - 1], m = a ? [
10021
+ ...u.slice(0, -1),
10022
10022
  {
10023
10023
  role: "user",
10024
10024
  content: [
10025
10025
  {
10026
10026
  type: "text",
10027
- text: i.content
10027
+ text: c.content
10028
10028
  },
10029
10029
  {
10030
10030
  type: "image",
@@ -10034,12 +10034,12 @@ class Jh {
10034
10034
  }
10035
10035
  ] : n;
10036
10036
  kh({
10037
- model: this.model,
10037
+ model: i,
10038
10038
  system: ci(o),
10039
- messages: u,
10039
+ messages: m,
10040
10040
  temperature: this.temperature,
10041
- onFinish: ((m = this.options) == null ? void 0 : m.onFinish) ?? mn,
10042
- onError: ((_ = this.options) == null ? void 0 : _.onError) ?? mn
10041
+ onFinish: ((_ = this.options) == null ? void 0 : _.onFinish) ?? mn,
10042
+ onError: ((p = this.options) == null ? void 0 : p.onError) ?? mn
10043
10043
  }).pipeTextStreamToResponse(r);
10044
10044
  }
10045
10045
  isConfigured() {
@@ -10211,7 +10211,7 @@ class ng {
10211
10211
  return this.draftMode;
10212
10212
  }
10213
10213
  async handle(t, r, n) {
10214
- var o, s, i, u, c, m, _, b, p, f, w, v;
10214
+ var o, s, i, u, c, m, b, _, p, f, w, v;
10215
10215
  switch (t.action) {
10216
10216
  // Media
10217
10217
  case "UPLOAD_ASSET":
@@ -10236,9 +10236,9 @@ class ng {
10236
10236
  case "REFRESH_TOKEN":
10237
10237
  return (m = this.chaiUsers) == null ? void 0 : m.refreshToken(t.data);
10238
10238
  case "LOGIN":
10239
- return (_ = this.chaiUsers) == null ? void 0 : _.login(t.data);
10239
+ return (b = this.chaiUsers) == null ? void 0 : b.login(t.data);
10240
10240
  case "LOGOUT":
10241
- return (b = this.chaiUsers) == null ? void 0 : b.logout();
10241
+ return (_ = this.chaiUsers) == null ? void 0 : _.logout();
10242
10242
  case "CHECK_USER_STATUS":
10243
10243
  return (p = this.chaiUsers) == null ? void 0 : p.isUserActive(r);
10244
10244
  case "GET_ROLE_AND_PERMISSIONS":
@@ -10400,15 +10400,15 @@ class ng {
10400
10400
  pageProps: n,
10401
10401
  lang: a
10402
10402
  }) {
10403
- var _;
10403
+ var b;
10404
10404
  const o = this.isDraftMode(), s = xe(r), i = t.filter(
10405
- (b) => b._type === "Repeater" && (b == null ? void 0 : b.repeaterItems.includes("{{#"))
10405
+ (_) => _._type === "Repeater" && (_ == null ? void 0 : _.repeaterItems.includes("{{#"))
10406
10406
  );
10407
10407
  let u = {};
10408
10408
  if (i.length > 0) {
10409
- const b = i.map((f) => ({ collectionId: f.repeaterItems.replace("{{#", "").replace("}}", ""), block: f }));
10409
+ const _ = i.map((f) => ({ collectionId: f.repeaterItems.replace("{{#", "").replace("}}", ""), block: f }));
10410
10410
  u = (await Promise.all(
10411
- b.map(async ({ collectionId: f, block: w }) => {
10411
+ _.map(async ({ collectionId: f, block: w }) => {
10412
10412
  const v = yn(f);
10413
10413
  try {
10414
10414
  const l = await (v == null ? void 0 : v.fetch({
@@ -10433,7 +10433,7 @@ class ng {
10433
10433
  }
10434
10434
  const [c, m] = await Promise.all([
10435
10435
  this.getGlobalData(a),
10436
- ((_ = s == null ? void 0 : s.dataProvider) == null ? void 0 : _.call(s, {
10436
+ ((b = s == null ? void 0 : s.dataProvider) == null ? void 0 : b.call(s, {
10437
10437
  lang: a,
10438
10438
  draft: o,
10439
10439
  inBuilder: !1,