@copilotkit/vue 1.64.1 → 1.64.2-canary.1785346263

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as re, useAttrs as Xe, shallowRef as nt, onMounted as ze, onUnmounted as fn, openBlock as M, createBlock as he, resolveDynamicComponent as ft, mergeProps as fe, unref as Q, createCommentVNode as X, inject as xt, ref as S, watch as U, computed as r, onBeforeUnmount as Fe, h as C, nextTick as gt, getCurrentInstance as ct, createElementBlock as B, normalizeStyle as lt, createElementVNode as F, toDisplayString as ke, triggerRef as ot, provide as At, Fragment as Me, renderSlot as I, toValue as Ve, renderList as Ge, createVNode as ie, withMemo as ha, createSlots as Je, withCtx as G, normalizeProps as J, guardReactiveProps as Y, normalizeClass as ye, createTextVNode as qt, readonly as jt, withModifiers as Ht, Teleport as ba, useSlots as gn, onScopeDispose as Ft, watchEffect as ka } from "vue";
1
+ import { defineComponent as re, useAttrs as Xe, shallowRef as nt, onMounted as ze, onUnmounted as fn, openBlock as $, createBlock as he, resolveDynamicComponent as ft, mergeProps as fe, unref as Q, createCommentVNode as X, inject as xt, ref as S, watch as U, computed as r, onBeforeUnmount as Fe, h as C, nextTick as gt, getCurrentInstance as ct, createElementBlock as B, normalizeStyle as lt, createElementVNode as F, toDisplayString as ke, triggerRef as ot, provide as At, Fragment as Me, renderSlot as I, toValue as Ve, renderList as Ge, createVNode as ie, withMemo as ha, createSlots as Je, withCtx as G, normalizeProps as J, guardReactiveProps as Y, normalizeClass as ye, createTextVNode as qt, readonly as jt, withModifiers as Ht, Teleport as ba, useSlots as gn, onScopeDispose as Ft, watchEffect as ka } from "vue";
2
2
  import { z as ue } from "zod";
3
3
  import { randomUUID as rt, A2UI_DEFAULT_GENERATION_GUIDELINES as ya, A2UI_DEFAULT_DESIGN_GUIDELINES as wa, createLicenseContextValue as Jn, schemaToJsonSchema as xa, DEFAULT_AGENT_ID as st, partialJSONParse as An, matchesAcceptFilter as tn, exceedsMaxSize as Ca, formatFileSize as rn, getModalityFromMimeType as Ta, readFileAsBase64 as Sa, generateVideoThumbnail as Ia, TranscriptionErrorCode as et, getSourceUrl as yt, getDocumentIcon as ln } from "@copilotkit/shared";
4
4
  import { zodToJsonSchema as vn } from "zod-to-json-schema";
@@ -25,7 +25,7 @@ const To = /* @__PURE__ */ re({
25
25
  });
26
26
  }), fn(() => {
27
27
  s = !1;
28
- }), (o, i) => a.value ? (M(), he(ft(a.value), fe({ key: 0 }, Q(t), {
28
+ }), (o, i) => a.value ? ($(), he(ft(a.value), fe({ key: 0 }, Q(t), {
29
29
  ".core": n.core ?? null
30
30
  }), null, 48, [".core"])) : X("", !0);
31
31
  }
@@ -258,14 +258,14 @@ const Fo = re({
258
258
  let h = !0, y = null, A = null, L = null;
259
259
  (async () => {
260
260
  try {
261
- const $ = document.createElement("iframe");
262
- L = $, $.style.width = "100%", $.style.height = "100px", $.style.border = "none", $.style.backgroundColor = "transparent", $.style.display = "block", $.setAttribute(
261
+ const M = document.createElement("iframe");
262
+ L = M, M.style.width = "100%", M.style.height = "100px", M.style.border = "none", M.style.backgroundColor = "transparent", M.style.display = "block", M.setAttribute(
263
263
  "sandbox",
264
264
  "allow-scripts allow-same-origin allow-forms"
265
- );
265
+ ), M.setAttribute("data-testid", "mcp-app-iframe"), M.setAttribute("title", "Interactive MCP application");
266
266
  const j = new Promise((Z) => {
267
267
  A = (V) => {
268
- V.source === $.contentWindow && V.data?.method === "ui/notifications/sandbox-proxy-ready" && (A && (window.removeEventListener("message", A), A = null), Z());
268
+ V.source === M.contentWindow && V.data?.method === "ui/notifications/sandbox-proxy-ready" && (A && (window.removeEventListener("message", A), A = null), Z());
269
269
  }, window.addEventListener("message", A);
270
270
  });
271
271
  if (!h) {
@@ -273,9 +273,9 @@ const Fo = re({
273
273
  return;
274
274
  }
275
275
  const W = c.value?._meta?.ui?.csp?.resourceDomains;
276
- if ($.srcdoc = Io(W), a.value = $, b.appendChild($), await j, !h) return;
276
+ if (M.srcdoc = Io(W), a.value = M, b.appendChild(M), await j, !h) return;
277
277
  y = async (Z) => {
278
- if (Z.source !== $.contentWindow) return;
278
+ if (Z.source !== M.contentWindow) return;
279
279
  const V = Z.data;
280
280
  if (!(!V || typeof V != "object" || V.jsonrpc !== "2.0")) {
281
281
  if ($o(V))
@@ -408,8 +408,8 @@ const Fo = re({
408
408
  u("ui/notifications/sandbox-resource-ready", {
409
409
  html: te
410
410
  });
411
- } catch ($) {
412
- h && (o.value = $ instanceof Error ? $ : new Error(String($)));
411
+ } catch (M) {
412
+ h && (o.value = M instanceof Error ? M : new Error(String(M)));
413
413
  }
414
414
  })(), p(() => {
415
415
  h = !1, A && (window.removeEventListener("message", A), A = null), y && window.removeEventListener("message", y), L && (L.remove(), L = null), a.value = null;
@@ -1738,16 +1738,16 @@ const ks = re({
1738
1738
  },
1739
1739
  setup(e) {
1740
1740
  const n = ps(), t = S(null), a = S(e.content), s = S(e.content), o = S(null), i = S(null), l = S(null), c = S(!1), g = S(!1), T = S(0), d = S(!1), f = S([]), u = r(() => {
1741
- const $ = {};
1741
+ const M = {};
1742
1742
  for (const j of n.value)
1743
- $[j.name] = j.handler;
1744
- return $;
1743
+ M[j.name] = j.handler;
1744
+ return M;
1745
1745
  });
1746
1746
  U(
1747
1747
  () => e.content,
1748
- ($) => {
1749
- if (s.value = $, ms(a.value, $)) {
1750
- o.value !== null && (window.clearTimeout(o.value), o.value = null), a.value = $;
1748
+ (M) => {
1749
+ if (s.value = M, ms(a.value, M)) {
1750
+ o.value !== null && (window.clearTimeout(o.value), o.value = null), a.value = M;
1751
1751
  return;
1752
1752
  }
1753
1753
  o.value === null && (o.value = window.setTimeout(() => {
@@ -1789,8 +1789,8 @@ const ks = re({
1789
1789
  v,
1790
1790
  () => t.value
1791
1791
  ],
1792
- async ([$, j], W, te) => {
1793
- if (!$ || j || !t.value || l.value) return;
1792
+ async ([M, j], W, te) => {
1793
+ if (!M || j || !t.value || l.value) return;
1794
1794
  let Z = !1;
1795
1795
  try {
1796
1796
  const V = await $n();
@@ -1824,26 +1824,26 @@ const ks = re({
1824
1824
  { immediate: !0 }
1825
1825
  ), U(
1826
1826
  [k, v, p, g],
1827
- ([$, j, W, te]) => {
1827
+ ([M, j, W, te]) => {
1828
1828
  if (!l.value || !te) return;
1829
1829
  const Z = [];
1830
1830
  W && Z.push(`<style>${W}</style>`), j && Z.push(j), Z.length && l.value.run(
1831
1831
  `document.head.innerHTML = ${JSON.stringify(Z.join(""))}`
1832
- ), $ && l.value.run(
1833
- `document.body.innerHTML = ${JSON.stringify($)}`
1832
+ ), M && l.value.run(
1833
+ `document.body.innerHTML = ${JSON.stringify(M)}`
1834
1834
  );
1835
1835
  },
1836
1836
  { immediate: !0 }
1837
1837
  ), U(
1838
1838
  [w, p, u, () => t.value],
1839
- async ([$, j, W], te, Z) => {
1840
- if (L(), !$ || !t.value) return;
1839
+ async ([M, j, W], te, Z) => {
1840
+ if (L(), !M || !t.value) return;
1841
1841
  A();
1842
1842
  let V = !1;
1843
1843
  try {
1844
1844
  const H = await $n();
1845
1845
  if (V || !t.value) return;
1846
- const ae = hs($), O = j ? bs(ae, j) : ae, x = H.create(W, {
1846
+ const ae = hs(M), O = j ? bs(ae, j) : ae, x = H.create(W, {
1847
1847
  frameContainer: t.value,
1848
1848
  frameContent: O,
1849
1849
  allowAdditionalAttributes: ""
@@ -1881,17 +1881,17 @@ const ks = re({
1881
1881
  { immediate: !0 }
1882
1882
  ), U(
1883
1883
  () => a.value.jsFunctions,
1884
- ($) => {
1885
- !$ || d.value || (d.value = !0, c.value && i.value ? i.value.run($) : f.value.push($));
1884
+ (M) => {
1885
+ !M || d.value || (d.value = !0, c.value && i.value ? i.value.run(M) : f.value.push(M));
1886
1886
  }
1887
1887
  ), U(
1888
1888
  () => a.value.jsExpressions,
1889
- ($) => {
1890
- if (!$?.length) return;
1889
+ (M) => {
1890
+ if (!M?.length) return;
1891
1891
  const j = T.value;
1892
- if (j >= $.length) return;
1893
- const W = $.slice(j);
1894
- if (T.value = $.length, c.value && i.value)
1892
+ if (j >= M.length) return;
1893
+ const W = M.slice(j);
1894
+ if (T.value = M.length, c.value && i.value)
1895
1895
  for (const te of W)
1896
1896
  i.value.run(te);
1897
1897
  else
@@ -1904,8 +1904,8 @@ const ks = re({
1904
1904
  );
1905
1905
  return U(
1906
1906
  [b, w],
1907
- ([$, j]) => {
1908
- j && A(), $ || A();
1907
+ ([M, j]) => {
1908
+ j && A(), M || A();
1909
1909
  },
1910
1910
  { immediate: !0 }
1911
1911
  ), Fe(() => {
@@ -2139,7 +2139,7 @@ const Cs = { style: {
2139
2139
  );
2140
2140
  }), Fe(() => {
2141
2141
  typeof document > "u" || document.documentElement.style.removeProperty(En);
2142
- }), (d, f) => s.value ? (M(), B("div", {
2142
+ }), (d, f) => s.value ? ($(), B("div", {
2143
2143
  key: 0,
2144
2144
  style: lt(l.value),
2145
2145
  "data-testid": "copilot-license-banner"
@@ -2156,7 +2156,7 @@ const Cs = { style: {
2156
2156
  color: "inherit"
2157
2157
  }
2158
2158
  }, ke(s.value.actionLabel), 9, Ts),
2159
- g.value ? (M(), B("button", {
2159
+ g.value ? ($(), B("button", {
2160
2160
  key: 0,
2161
2161
  style: {
2162
2162
  background: "none",
@@ -2333,7 +2333,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2333
2333
  () => t.renderCustomMessages ?? []
2334
2334
  ), h = S(!1), y = S(!1), A = S(void 0), L = r(
2335
2335
  () => y.value || !!t.openGenerativeUI
2336
- ), D = r(() => !!t.a2ui?.catalog), $ = r(
2336
+ ), D = r(() => !!t.a2ui?.catalog), M = r(
2337
2337
  () => h.value || D.value
2338
2338
  ), j = r(
2339
2339
  () => D.value ? { ...t.properties, a2uiCatalogAvailable: !0 } : t.properties
@@ -2363,7 +2363,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2363
2363
  activityType: fs,
2364
2364
  content: gs,
2365
2365
  render: ys
2366
- }), $.value && z.unshift(
2366
+ }), M.value && z.unshift(
2367
2367
  Do({
2368
2368
  theme: t.a2ui?.theme ?? n,
2369
2369
  catalog: t.a2ui?.catalog,
@@ -2474,8 +2474,8 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2474
2474
  se(), h.value = x.value.a2uiEnabled, y.value = x.value.openGenerativeUIEnabled, A.value = x.value.licenseStatus, E.value = !0;
2475
2475
  });
2476
2476
  const xe = r(() => t.a2ui?.theme), P = r(() => t.a2ui?.catalog), ee = r(() => t.a2ui?.loadingComponent), ne = r(() => t.a2ui?.includeSchema ?? !0);
2477
- Uo(x, () => $.value), cs(x, {
2478
- enabled: () => $.value,
2477
+ Uo(x, () => M.value), cs(x, {
2478
+ enabled: () => M.value,
2479
2479
  catalog: () => t.a2ui?.catalog,
2480
2480
  includeSchema: () => t.a2ui?.includeSchema ?? !0
2481
2481
  });
@@ -2538,26 +2538,26 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2538
2538
  ), De = r(
2539
2539
  () => A.value === "expiring"
2540
2540
  );
2541
- return (z, ve) => (M(), B(Me, null, [
2541
+ return (z, ve) => ($(), B(Me, null, [
2542
2542
  I(z.$slots, "default"),
2543
- a.value ? (M(), he(To, {
2543
+ a.value ? ($(), he(To, {
2544
2544
  key: 0,
2545
2545
  core: x.value,
2546
2546
  "default-anchor": t.inspectorDefaultAnchor
2547
2547
  }, null, 8, ["core", "default-anchor"])) : X("", !0),
2548
- Ie.value ? (M(), he(Vt, {
2548
+ Ie.value ? ($(), he(Vt, {
2549
2549
  key: 1,
2550
2550
  type: "no_license"
2551
2551
  })) : X("", !0),
2552
- Ae.value ? (M(), he(Vt, {
2552
+ Ae.value ? ($(), he(Vt, {
2553
2553
  key: 2,
2554
2554
  type: "expired"
2555
2555
  })) : X("", !0),
2556
- Ee.value ? (M(), he(Vt, {
2556
+ Ee.value ? ($(), he(Vt, {
2557
2557
  key: 3,
2558
2558
  type: "invalid"
2559
2559
  })) : X("", !0),
2560
- De.value ? (M(), he(Vt, {
2560
+ De.value ? ($(), he(Vt, {
2561
2561
  key: 4,
2562
2562
  type: "expiring"
2563
2563
  })) : X("", !0)
@@ -2676,7 +2676,7 @@ const yn = /* @__PURE__ */ re({
2676
2676
  }
2677
2677
  const D = r(
2678
2678
  () => a.value ? a.value.drawerOpen : h.value
2679
- ), $ = r(
2679
+ ), M = r(
2680
2680
  () => a.value ? a.value.setDrawerOpen : A
2681
2681
  ), j = r(
2682
2682
  () => a.value ? a.value.drawerRegistered : y.value > 0
@@ -2686,7 +2686,7 @@ const yn = /* @__PURE__ */ re({
2686
2686
  const V = w.value;
2687
2687
  if (V)
2688
2688
  return (H) => {
2689
- H && Ln() && $.value?.(!1), V(H);
2689
+ H && Ln() && M.value?.(!1), V(H);
2690
2690
  };
2691
2691
  }), Z = r(() => ({
2692
2692
  labels: l.value,
@@ -2696,7 +2696,7 @@ const yn = /* @__PURE__ */ re({
2696
2696
  isModalOpen: v.value,
2697
2697
  setModalOpen: te.value,
2698
2698
  drawerOpen: D.value,
2699
- setDrawerOpen: $.value,
2699
+ setDrawerOpen: M.value,
2700
2700
  drawerRegistered: j.value,
2701
2701
  registerDrawer: W.value,
2702
2702
  setActiveThreadId: p,
@@ -2885,14 +2885,14 @@ const oa = re({
2885
2885
  }
2886
2886
  return f;
2887
2887
  });
2888
- return (f, u) => T.value ? (M(), B("div", {
2888
+ return (f, u) => T.value ? ($(), B("div", {
2889
2889
  key: 0,
2890
2890
  "data-copilotkit": "",
2891
2891
  "data-activity-type": e.activityType,
2892
2892
  "data-message-id": e.message.id
2893
2893
  }, [
2894
- o.value ? (M(), B("div", Bs, " A2UI render error: " + ke(o.value), 1)) : (M(), B("div", js, [
2895
- (M(!0), B(Me, null, Ge(d.value, (m) => (M(), B("div", {
2894
+ o.value ? ($(), B("div", Bs, " A2UI render error: " + ke(o.value), 1)) : ($(), B("div", js, [
2895
+ ($(!0), B(Me, null, Ge(d.value, (m) => ($(), B("div", {
2896
2896
  key: m.surfaceId,
2897
2897
  class: "cpk:flex cpk:w-full cpk:flex-none cpk:flex-col cpk:gap-4",
2898
2898
  "data-surface-id": m.surfaceId
@@ -2977,7 +2977,7 @@ const oa = re({
2977
2977
  );
2978
2978
  return k.find((v) => v.agentId === m) ?? k.find((v) => !v.agentId) ?? k[0] ?? u.find((v) => v.name === "*");
2979
2979
  }
2980
- return (f, u) => (M(!0), B(Me, null, Ge(e.message.toolCalls ?? [], (m) => I(f.$slots, i(m.function.name), fe({
2980
+ return (f, u) => ($(!0), B(Me, null, Ge(e.message.toolCalls ?? [], (m) => I(f.$slots, i(m.function.name), fe({
2981
2981
  key: m.id,
2982
2982
  ref_for: !0
2983
2983
  }, g(m)), () => [
@@ -2988,7 +2988,7 @@ const oa = re({
2988
2988
  c(m.id),
2989
2989
  l(m.id),
2990
2990
  d(m)?.render
2991
- ], () => (M(), he(ft(d(m)?.render), fe({
2991
+ ], () => ($(), he(ft(d(m)?.render), fe({
2992
2992
  key: 0,
2993
2993
  ref_for: !0
2994
2994
  }, T(m)), null, 16)), u, 0) : X("", !0)
@@ -3385,7 +3385,7 @@ const Hs = ["data-message-id"], Ws = { class: "cpk:w-full cpk:bg-transparent cpk
3385
3385
  }
3386
3386
  const D = r(
3387
3387
  () => L(t.message.content)
3388
- ), $ = r(() => D.value.trim().length > 0);
3388
+ ), M = r(() => D.value.trim().length > 0);
3389
3389
  function j(P) {
3390
3390
  const ee = g.value[P];
3391
3391
  return Array.isArray(ee) ? ee.length > 0 : !!ee;
@@ -3393,7 +3393,7 @@ const Hs = ["data-message-id"], Ws = { class: "cpk:w-full cpk:bg-transparent cpk
3393
3393
  const W = r(() => j("onThumbsUp")), te = r(() => j("onThumbsDown")), Z = r(() => j("onReadAloud")), V = r(() => j("onRegenerate")), H = r(
3394
3394
  () => t.messages[t.messages.length - 1]?.id === t.message.id
3395
3395
  ), ae = r(
3396
- () => t.toolbarVisible && $.value && !(t.isRunning && H.value)
3396
+ () => t.toolbarVisible && M.value && !(t.isRunning && H.value)
3397
3397
  );
3398
3398
  function O() {
3399
3399
  c && clearTimeout(c), l.value = !0, c = setTimeout(() => {
@@ -3453,7 +3453,7 @@ const Hs = ["data-message-id"], Ws = { class: "cpk:w-full cpk:bg-transparent cpk
3453
3453
  message: e.message,
3454
3454
  content: D.value
3455
3455
  }, () => [
3456
- $.value ? (M(), he(Q(Xn), {
3456
+ M.value ? ($(), he(Q(Xn), {
3457
3457
  key: 0,
3458
3458
  class: "copilot-chat-assistant-markdown",
3459
3459
  content: D.value,
@@ -3509,10 +3509,10 @@ const Hs = ["data-message-id"], Ws = { class: "cpk:w-full cpk:bg-transparent cpk
3509
3509
  title: o.value.assistantMessageToolbarCopyMessageLabel,
3510
3510
  onClick: x
3511
3511
  }, [
3512
- l.value ? (M(), he(Q(Mt), {
3512
+ l.value ? ($(), he(Q(Mt), {
3513
3513
  key: 0,
3514
3514
  class: "cpk:size-[18px]"
3515
- })) : (M(), he(Q(zt), {
3515
+ })) : ($(), he(Q(zt), {
3516
3516
  key: 1,
3517
3517
  class: "cpk:size-[18px]"
3518
3518
  }))
@@ -3619,7 +3619,7 @@ const Zs = /* @__PURE__ */ re({
3619
3619
  c.value = y;
3620
3620
  const A = y.createMediaStreamSource(h), L = y.createAnalyser();
3621
3621
  L.fftSize = 2048, A.connect(L), l.value = L;
3622
- const D = MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : MediaRecorder.isTypeSupported("audio/mp4") ? "audio/mp4" : "", $ = D ? { mimeType: D } : {}, j = new MediaRecorder(h, $);
3622
+ const D = MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : MediaRecorder.isTypeSupported("audio/mp4") ? "audio/mp4" : "", M = D ? { mimeType: D } : {}, j = new MediaRecorder(h, M);
3623
3623
  o.value = j, T.value = [], j.ondataavailable = (W) => {
3624
3624
  W.data.size > 0 && T.value.push(W.data);
3625
3625
  }, j.start(100), s.value = "recording";
@@ -3699,7 +3699,7 @@ const Zs = /* @__PURE__ */ re({
3699
3699
  start: v,
3700
3700
  stop: w,
3701
3701
  dispose: k
3702
- }), (h, y) => (M(), B("div", fe({
3702
+ }), (h, y) => ($(), B("div", fe({
3703
3703
  "data-copilotkit": "",
3704
3704
  class: "cpk:w-full cpk:px-5 cpk:py-3"
3705
3705
  }, Q(t)), [
@@ -3728,7 +3728,7 @@ const Zs = /* @__PURE__ */ re({
3728
3728
  color: "#b45309",
3729
3729
  textDecoration: "underline"
3730
3730
  };
3731
- return (a, s) => (M(), B("div", {
3731
+ return (a, s) => ($(), B("div", {
3732
3732
  style: n,
3733
3733
  "data-testid": "copilot-inline-feature-warning"
3734
3734
  }, [
@@ -3957,12 +3957,12 @@ function si(e) {
3957
3957
  });
3958
3958
  continue;
3959
3959
  }
3960
- const $ = Ta(D.type), j = rt();
3960
+ const M = Ta(D.type), j = rt();
3961
3961
  g((W) => [
3962
3962
  ...W,
3963
3963
  {
3964
3964
  id: j,
3965
- type: $,
3965
+ type: M,
3966
3966
  source: { type: "data", value: "", mimeType: D.type },
3967
3967
  filename: D.name,
3968
3968
  size: D.size,
@@ -3977,7 +3977,7 @@ function si(e) {
3977
3977
  } else
3978
3978
  W = { type: "data", value: await Sa(D), mimeType: D.type };
3979
3979
  let Z;
3980
- $ === "video" && (Z = await Ia(D)), g(
3980
+ M === "video" && (Z = await Ia(D)), g(
3981
3981
  (V) => V.map(
3982
3982
  (H) => H.id === j ? {
3983
3983
  ...H,
@@ -4033,8 +4033,8 @@ function si(e) {
4033
4033
  if (!b || !s.value?.contains(b)) return;
4034
4034
  const h = o.value?.accept ?? "*/*", A = Array.from(p.clipboardData?.items ?? []).filter((D) => {
4035
4035
  if (D.kind !== "file") return !1;
4036
- const $ = D.getAsFile();
4037
- return $ !== null && tn($, h);
4036
+ const M = D.getAsFile();
4037
+ return M !== null && tn(M, h);
4038
4038
  });
4039
4039
  if (A.length === 0) return;
4040
4040
  p.preventDefault();
@@ -4220,7 +4220,7 @@ function fi({
4220
4220
  const L = f.getBoundingClientRect().height, D = Pn(
4221
4221
  w,
4222
4222
  f
4223
- ), $ = L - D - b, j = Math.max(0, A - $);
4223
+ ), M = L - D - b, j = Math.max(0, A - M);
4224
4224
  u.style.height = `${j}px`;
4225
4225
  }), l.observe(f));
4226
4226
  },
@@ -4268,7 +4268,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4268
4268
  maxHeight: 0,
4269
4269
  paddingLeft: 0,
4270
4270
  paddingRight: 0
4271
- }), L = S(null), D = S(!1), $ = S(null), j = S(null), W = S(!1), te = S(!1);
4271
+ }), L = S(null), D = S(!1), M = S(null), j = S(null), W = S(!1), te = S(!1);
4272
4272
  let Z = null, V = null;
4273
4273
  const H = r(
4274
4274
  () => i?.vnode.props ?? {}
@@ -4573,8 +4573,8 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4573
4573
  0
4574
4574
  );
4575
4575
  if (dt > 0) {
4576
- const vt = $.value ?? document.createElement("canvas");
4577
- $.value || ($.value = vt);
4576
+ const vt = M.value ?? document.createElement("canvas");
4577
+ M.value || (M.value = vt);
4578
4578
  const bt = vt.getContext("2d");
4579
4579
  if (bt) {
4580
4580
  const pt = ut(R);
@@ -4697,7 +4697,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4697
4697
  }, document.addEventListener("mousedown", V);
4698
4698
  }), Fe(() => {
4699
4699
  V && (document.removeEventListener("mousedown", V), V = null), Z?.disconnect(), Z = null, L.value !== null && (cancelAnimationFrame(L.value), L.value = null);
4700
- }), (R, N) => (M(), B("div", fe({
4700
+ }), (R, N) => ($(), B("div", fe({
4701
4701
  "data-copilotkit": "",
4702
4702
  "data-testid": "copilot-chat-input-container",
4703
4703
  class: De.value,
@@ -4770,24 +4770,24 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4770
4770
  ie(Q(vo), { class: "cpk:size-[20px]" })
4771
4771
  ], 8, hi)
4772
4772
  ]),
4773
- y.value && we.value ? (M(), B("div", {
4773
+ y.value && we.value ? ($(), B("div", {
4774
4774
  key: 0,
4775
4775
  ref_key: "addMenuRef",
4776
4776
  ref: u,
4777
4777
  class: "cpk:absolute cpk:bottom-full cpk:left-0 cpk:z-30 cpk:mb-2 cpk:min-w-[220px] cpk:overflow-hidden cpk:rounded-lg cpk:border cpk:border-border cpk:bg-white cpk:shadow-lg cpk:dark:border-[#3a3a3a] cpk:dark:bg-[#1f1f1f]",
4778
4778
  "data-testid": "copilot-chat-input-add-menu"
4779
4779
  }, [
4780
- (M(!0), B(Me, null, Ge(K.value, (le) => (M(), B(Me, {
4780
+ ($(!0), B(Me, null, Ge(K.value, (le) => ($(), B(Me, {
4781
4781
  key: le.key
4782
4782
  }, [
4783
- le.type === "separator" ? (M(), B("div", bi)) : le.type === "label" ? (M(), B("div", {
4783
+ le.type === "separator" ? ($(), B("div", bi)) : le.type === "label" ? ($(), B("div", {
4784
4784
  key: 1,
4785
4785
  class: "cpk:flex cpk:items-center cpk:gap-1 cpk:px-3 cpk:py-1.5 cpk:text-xs cpk:font-semibold cpk:text-muted-foreground",
4786
4786
  style: lt({ paddingLeft: `${12 + le.depth * 12}px` })
4787
4787
  }, [
4788
4788
  F("span", null, ke(le.label), 1),
4789
4789
  ie(Q(mn), { class: "cpk:size-3" })
4790
- ], 4)) : (M(), B("button", {
4790
+ ], 4)) : ($(), B("button", {
4791
4791
  key: 2,
4792
4792
  type: "button",
4793
4793
  role: "menuitem",
@@ -4809,9 +4809,9 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4809
4809
  ref_key: "audioRecorderRef",
4810
4810
  ref: m
4811
4811
  }, null, 512)
4812
- ]) : e.mode === "processing" ? (M(), B("div", yi, [
4812
+ ]) : e.mode === "processing" ? ($(), B("div", yi, [
4813
4813
  ie(Q(Qn), { class: "cpk:size-[26px] cpk:animate-spin cpk:text-muted-foreground" })
4814
- ])) : (M(), B(Me, { key: 2 }, [
4814
+ ])) : ($(), B(Me, { key: 2 }, [
4815
4815
  I(R.$slots, "text-area", {
4816
4816
  value: O.value,
4817
4817
  disabled: e.disabled,
@@ -4842,7 +4842,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4842
4842
  onCompositionend: N[1] || (N[1] = (le) => v.value = !1)
4843
4843
  }, null, 42, wi)
4844
4844
  ]),
4845
- Ne.value ? (M(), B("div", {
4845
+ Ne.value ? ($(), B("div", {
4846
4846
  key: 0,
4847
4847
  ref_key: "slashMenuRef",
4848
4848
  ref: f,
@@ -4852,7 +4852,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4852
4852
  class: "cpk:absolute cpk:bottom-full cpk:left-0 cpk:right-0 cpk:z-30 cpk:mb-2 cpk:max-h-64 cpk:overflow-y-auto cpk:rounded-lg cpk:border cpk:border-border cpk:bg-white cpk:shadow-lg cpk:dark:border-[#3a3a3a] cpk:dark:bg-[#1f1f1f]",
4853
4853
  style: { maxHeight: "200px" }
4854
4854
  }, [
4855
- ce.value.length === 0 ? (M(), B("div", xi, " No commands found ")) : (M(!0), B(Me, { key: 1 }, Ge(ce.value, (le, me) => (M(), B("button", {
4855
+ ce.value.length === 0 ? ($(), B("div", xi, " No commands found ")) : ($(!0), B(Me, { key: 1 }, Ge(ce.value, (le, me) => ($(), B("button", {
4856
4856
  key: `${le.label}-${me}`,
4857
4857
  type: "button",
4858
4858
  role: "option",
@@ -4877,7 +4877,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4877
4877
  _.value ? "cpk:col-start-3 cpk:row-start-2" : "cpk:col-start-3 cpk:row-start-1"
4878
4878
  ])
4879
4879
  }, [
4880
- e.mode === "transcribe" ? (M(), B(Me, { key: 0 }, [
4880
+ e.mode === "transcribe" ? ($(), B(Me, { key: 0 }, [
4881
4881
  be.value ? I(R.$slots, "cancel-transcribe-button", {
4882
4882
  key: 0,
4883
4883
  disabled: e.disabled,
@@ -4912,7 +4912,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4912
4912
  ie(Q(Mt), { class: "cpk:size-[18px]" })
4913
4913
  ], 8, Si)
4914
4914
  ]) : X("", !0)
4915
- ], 64)) : (M(), B(Me, { key: 1 }, [
4915
+ ], 64)) : ($(), B(Me, { key: 1 }, [
4916
4916
  oe.value ? I(R.$slots, "start-transcribe-button", {
4917
4917
  key: 0,
4918
4918
  disabled: e.disabled,
@@ -4944,10 +4944,10 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4944
4944
  class: "cpk:inline-flex cpk:h-9 cpk:w-9 cpk:shrink-0 cpk:items-center cpk:justify-center cpk:rounded-full cpk:bg-black cpk:text-white cpk:transition-colors cpk:hover:opacity-70 cpk:disabled:cursor-not-allowed cpk:disabled:opacity-50 cpk:disabled:bg-[#00000014] cpk:disabled:text-[rgb(13,13,13)] cpk:disabled:hover:opacity-100 cpk:dark:bg-white cpk:dark:text-black cpk:dark:disabled:bg-[#454545] cpk:dark:disabled:text-white",
4945
4945
  onClick: de
4946
4946
  }, [
4947
- se.value && ee.value ? (M(), he(Q(ho), {
4947
+ se.value && ee.value ? ($(), he(Q(ho), {
4948
4948
  key: 0,
4949
4949
  class: "cpk:size-[18px] cpk:fill-current"
4950
- })) : (M(), he(Q(bo), {
4950
+ })) : ($(), he(Q(bo), {
4951
4951
  key: 1,
4952
4952
  class: "cpk:size-[18px]"
4953
4953
  }))
@@ -5089,23 +5089,23 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5089
5089
  return console.error("[CopilotKit] Failed to decode attachment data:", p), null;
5090
5090
  }
5091
5091
  }
5092
- return (v, w) => (M(), B(Me, null, [
5093
- t.attachments.length > 0 ? (M(), B("div", {
5092
+ return (v, w) => ($(), B(Me, null, [
5093
+ t.attachments.length > 0 ? ($(), B("div", {
5094
5094
  key: 0,
5095
5095
  class: ye(["cpk:flex cpk:flex-wrap cpk:gap-2 cpk:p-2", t.className]),
5096
5096
  "data-testid": "copilot-chat-attachment-queue"
5097
5097
  }, [
5098
- (M(!0), B(Me, null, Ge(t.attachments, (p) => (M(), B("div", {
5098
+ ($(!0), B(Me, null, Ge(t.attachments, (p) => ($(), B("div", {
5099
5099
  key: p.id,
5100
5100
  class: ye(["cpk:relative cpk:inline-flex cpk:rounded-lg cpk:overflow-hidden cpk:border cpk:border-border", f(p)]),
5101
5101
  "data-testid": "copilot-chat-attachment-item",
5102
5102
  "data-card-type": p.type
5103
5103
  }, [
5104
- p.status === "uploading" ? (M(), B("div", Ei, [...w[1] || (w[1] = [
5104
+ p.status === "uploading" ? ($(), B("div", Ei, [...w[1] || (w[1] = [
5105
5105
  F("div", { class: "cpk:w-5 cpk:h-5 cpk:border-2 cpk:border-white cpk:border-t-transparent cpk:rounded-full cpk:animate-spin" }, null, -1)
5106
5106
  ])])) : X("", !0),
5107
- p.status === "ready" ? (M(), B(Me, { key: 1 }, [
5108
- p.type === "image" ? (M(), B("button", {
5107
+ p.status === "ready" ? ($(), B(Me, { key: 1 }, [
5108
+ p.type === "image" ? ($(), B("button", {
5109
5109
  key: 0,
5110
5110
  type: "button",
5111
5111
  class: "cpk:w-full cpk:h-full cpk:border-none cpk:bg-transparent cpk:p-0 cpk:cursor-pointer",
@@ -5118,14 +5118,14 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5118
5118
  class: "cpk:w-full cpk:h-full cpk:object-cover",
5119
5119
  "data-testid": "copilot-chat-attachment-image-thumbnail"
5120
5120
  }, null, 8, Oi)
5121
- ], 8, Fi)) : p.type === "video" ? (M(), B("div", Li, [
5122
- p.thumbnail ? (M(), B("img", {
5121
+ ], 8, Fi)) : p.type === "video" ? ($(), B("div", Li, [
5122
+ p.thumbnail ? ($(), B("img", {
5123
5123
  key: 0,
5124
5124
  src: p.thumbnail,
5125
5125
  alt: p.filename || "Video thumbnail",
5126
5126
  class: "cpk:w-full cpk:h-full cpk:object-cover",
5127
5127
  "data-testid": "copilot-chat-attachment-video-thumbnail"
5128
- }, null, 8, Di)) : (M(), B("video", {
5128
+ }, null, 8, Di)) : ($(), B("video", {
5129
5129
  key: 1,
5130
5130
  src: Q(yt)(p.source),
5131
5131
  preload: "metadata",
@@ -5142,7 +5142,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5142
5142
  }, [...w[2] || (w[2] = [
5143
5143
  F("div", { class: "cpk:w-8 cpk:h-8 cpk:rounded-full cpk:bg-black/60 cpk:flex cpk:items-center cpk:justify-center cpk:text-white cpk:text-xs cpk:font-semibold" }, " ▶ ", -1)
5144
5144
  ])], 8, Bi)
5145
- ])) : p.type === "audio" ? (M(), B("div", ji, [
5145
+ ])) : p.type === "audio" ? ($(), B("div", ji, [
5146
5146
  F("audio", {
5147
5147
  src: Q(yt)(p.source),
5148
5148
  controls: "",
@@ -5150,8 +5150,8 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5150
5150
  class: "cpk:w-full cpk:h-8",
5151
5151
  "data-testid": "copilot-chat-attachment-audio-player"
5152
5152
  }, null, 8, Ni),
5153
- p.filename ? (M(), B("span", Vi, ke(p.filename), 1)) : X("", !0)
5154
- ])) : (M(), B("button", {
5153
+ p.filename ? ($(), B("span", Vi, ke(p.filename), 1)) : X("", !0)
5154
+ ])) : ($(), B("button", {
5155
5155
  key: 3,
5156
5156
  type: "button",
5157
5157
  class: ye([
@@ -5164,10 +5164,10 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5164
5164
  F("div", _i, ke(Q(ln)(p.source.mimeType ?? "")), 1),
5165
5165
  F("div", zi, [
5166
5166
  F("span", Hi, ke(p.filename || "Document"), 1),
5167
- p.size != null ? (M(), B("span", Wi, ke(Q(rn)(p.size)), 1)) : X("", !0)
5167
+ p.size != null ? ($(), B("span", Wi, ke(Q(rn)(p.size)), 1)) : X("", !0)
5168
5168
  ])
5169
5169
  ], 10, Pi))
5170
- ], 64)) : (M(), B("div", Ki)),
5170
+ ], 64)) : ($(), B("div", Ki)),
5171
5171
  F("button", {
5172
5172
  type: "button",
5173
5173
  class: "cpk:absolute cpk:bg-black/60 cpk:text-white cpk:border-none cpk:rounded-full cpk:w-5 cpk:h-5 cpk:flex cpk:items-center cpk:justify-center cpk:cursor-pointer cpk:text-[10px] cpk:z-20 cpk:top-1 cpk:right-1",
@@ -5176,8 +5176,8 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5176
5176
  }, " ✕ ", 8, qi)
5177
5177
  ], 10, $i))), 128))
5178
5178
  ], 2)) : X("", !0),
5179
- (M(), he(ba, { to: "body" }, [
5180
- s.value ? (M(), B("div", {
5179
+ ($(), he(ba, { to: "body" }, [
5180
+ s.value ? ($(), B("div", {
5181
5181
  key: 0,
5182
5182
  class: "cpk:fixed cpk:inset-0 cpk:z-[9999] cpk:flex cpk:items-center cpk:justify-center cpk:bg-black/80",
5183
5183
  "data-testid": "copilot-chat-attachment-lightbox",
@@ -5194,35 +5194,35 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5194
5194
  onClick: w[0] || (w[0] = Ht(() => {
5195
5195
  }, ["stop"]))
5196
5196
  }, [
5197
- s.value.type === "image" ? (M(), B("img", {
5197
+ s.value.type === "image" ? ($(), B("img", {
5198
5198
  key: 0,
5199
5199
  src: Q(yt)(s.value.source),
5200
5200
  alt: s.value.filename || "Image attachment",
5201
5201
  class: "cpk:max-w-[90vw] cpk:max-h-[90vh] cpk:object-contain cpk:rounded-lg",
5202
5202
  "data-testid": "copilot-chat-attachment-lightbox-image"
5203
- }, null, 8, Gi)) : s.value.type === "video" ? (M(), B("video", {
5203
+ }, null, 8, Gi)) : s.value.type === "video" ? ($(), B("video", {
5204
5204
  key: 1,
5205
5205
  src: Q(yt)(s.value.source),
5206
5206
  controls: "",
5207
5207
  autoplay: "",
5208
5208
  class: "cpk:max-w-[90vw] cpk:max-h-[90vh] cpk:rounded-lg",
5209
5209
  "data-testid": "copilot-chat-attachment-lightbox-video"
5210
- }, null, 8, Ji)) : s.value.type === "document" ? (M(), B(Me, { key: 2 }, [
5211
- l.value && u(s.value.source.mimeType) && g.value ? (M(), B("iframe", {
5210
+ }, null, 8, Ji)) : s.value.type === "document" ? ($(), B(Me, { key: 2 }, [
5211
+ l.value && u(s.value.source.mimeType) && g.value ? ($(), B("iframe", {
5212
5212
  key: 0,
5213
5213
  src: g.value,
5214
5214
  title: s.value.filename || "PDF preview",
5215
5215
  class: "cpk:w-[90vw] cpk:h-[90vh] cpk:max-w-[1000px] cpk:rounded-lg cpk:bg-white",
5216
5216
  "data-testid": "copilot-chat-attachment-lightbox-document-iframe"
5217
- }, null, 8, Qi)) : l.value && m(s.value.source.mimeType) ? (M(), B("div", Xi, [
5218
- c.value !== null ? (M(), B("pre", Yi, ke(c.value), 1)) : g.value ? (M(), B("iframe", {
5217
+ }, null, 8, Qi)) : l.value && m(s.value.source.mimeType) ? ($(), B("div", Xi, [
5218
+ c.value !== null ? ($(), B("pre", Yi, ke(c.value), 1)) : g.value ? ($(), B("iframe", {
5219
5219
  key: 1,
5220
5220
  src: g.value,
5221
5221
  title: s.value.filename || "Text preview",
5222
5222
  class: "cpk:w-full cpk:h-[80vh] cpk:border-none",
5223
5223
  "data-testid": "copilot-chat-attachment-lightbox-document-iframe"
5224
5224
  }, null, 8, Zi)) : X("", !0)
5225
- ])) : (M(), B("div", er, [
5225
+ ])) : ($(), B("div", er, [
5226
5226
  F("div", tr, ke(Q(ln)(s.value.source.mimeType ?? "")), 1),
5227
5227
  F("div", nr, [
5228
5228
  F("div", ar, ke(s.value.filename || "Document"), 1),
@@ -5291,7 +5291,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5291
5291
  function k() {
5292
5292
  s.value && (g.value = !0, c.value = !c.value);
5293
5293
  }
5294
- return (v, w) => (M(), B("div", {
5294
+ return (v, w) => ($(), B("div", {
5295
5295
  "data-copilotkit": "",
5296
5296
  class: "cpk:my-1",
5297
5297
  "data-message-id": e.message.id
@@ -5338,10 +5338,10 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5338
5338
  onClick: w[0] || (w[0] = (p) => s.value ? k() : void 0)
5339
5339
  }, [
5340
5340
  F("span", rr, ke(m.value), 1),
5341
- i.value && !s.value ? (M(), B("span", lr, [...w[1] || (w[1] = [
5341
+ i.value && !s.value ? ($(), B("span", lr, [...w[1] || (w[1] = [
5342
5342
  F("span", { class: "cpk:w-1.5 cpk:h-1.5 cpk:rounded-full cpk:bg-muted-foreground cpk:animate-pulse" }, null, -1)
5343
5343
  ])])) : X("", !0),
5344
- s.value ? (M(), he(Q(mn), {
5344
+ s.value ? ($(), he(Q(mn), {
5345
5345
  key: 1,
5346
5346
  class: ye(["cpk:size-3.5 cpk:shrink-0 cpk:transition-transform cpk:duration-200", { "cpk:rotate-90": c.value }])
5347
5347
  }, null, 8, ["class"])) : X("", !0)
@@ -5365,10 +5365,10 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5365
5365
  hasContent: s.value,
5366
5366
  content: a.value
5367
5367
  }, () => [
5368
- s.value || i.value ? (M(), B("div", ur, [
5368
+ s.value || i.value ? ($(), B("div", ur, [
5369
5369
  F("div", dr, [
5370
5370
  ie(Q(Xn), { content: a.value }, null, 8, ["content"]),
5371
- i.value && s.value ? (M(), B("span", pr, [...w[2] || (w[2] = [
5371
+ i.value && s.value ? ($(), B("span", pr, [...w[2] || (w[2] = [
5372
5372
  F("span", { class: "cpk:w-2 cpk:h-2 cpk:rounded-full cpk:bg-muted-foreground cpk:animate-pulse-cursor" }, null, -1)
5373
5373
  ])])) : X("", !0)
5374
5374
  ])
@@ -5399,16 +5399,16 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5399
5399
  "cpk:hover:text-[rgb(93,93,93)] cpk:dark:text-[rgb(243,243,243)] cpk:dark:hover:bg-[#303030]",
5400
5400
  "cpk:dark:hover:text-[rgb(243,243,243)] cpk:disabled:pointer-events-none cpk:disabled:opacity-50"
5401
5401
  ].join(" ");
5402
- function d($) {
5403
- return $ ? typeof $ == "string" ? $ : $.map((j) => j && typeof j == "object" && "type" in j && j.type === "text" && typeof j.text == "string" ? j.text : "").filter((j) => j.length > 0).join(`
5402
+ function d(M) {
5403
+ return M ? typeof M == "string" ? M : M.map((j) => j && typeof j == "object" && "type" in j && j.type === "text" && typeof j.text == "string" ? j.text : "").filter((j) => j.length > 0).join(`
5404
5404
  `) : "";
5405
5405
  }
5406
5406
  const f = r(
5407
5407
  () => d(t.message.content)
5408
5408
  ), u = r(() => f.value.includes(`
5409
5409
  `));
5410
- function m($) {
5411
- const j = g.value[$];
5410
+ function m(M) {
5411
+ const j = g.value[M];
5412
5412
  return Array.isArray(j) ? j.length > 0 : !!j;
5413
5413
  }
5414
5414
  const k = r(() => m("onEditMessage")), v = r(
@@ -5425,21 +5425,21 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5425
5425
  if (f.value && !(typeof navigator > "u" || typeof navigator.clipboard?.writeText != "function"))
5426
5426
  try {
5427
5427
  await navigator.clipboard.writeText(f.value), b();
5428
- } catch ($) {
5429
- console.error("Failed to copy to clipboard:", $);
5428
+ } catch (M) {
5429
+ console.error("Failed to copy to clipboard:", M);
5430
5430
  }
5431
5431
  }
5432
5432
  function y() {
5433
5433
  if (!k.value)
5434
5434
  return;
5435
- const $ = { message: t.message };
5436
- a("edit-message", $);
5435
+ const M = { message: t.message };
5436
+ a("edit-message", M);
5437
5437
  }
5438
- function A($) {
5438
+ function A(M) {
5439
5439
  if (!v.value)
5440
5440
  return;
5441
5441
  const j = {
5442
- branchIndex: $,
5442
+ branchIndex: M,
5443
5443
  numberOfBranches: t.numberOfBranches,
5444
5444
  message: t.message
5445
5445
  };
@@ -5453,7 +5453,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5453
5453
  }
5454
5454
  return Fe(() => {
5455
5455
  c && clearTimeout(c);
5456
- }), ($, j) => I($.$slots, "layout", {
5456
+ }), (M, j) => I(M.$slots, "layout", {
5457
5457
  message: e.message,
5458
5458
  content: f.value,
5459
5459
  isMultiline: u.value,
@@ -5474,8 +5474,8 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5474
5474
  "data-testid": "copilot-user-message",
5475
5475
  class: "cpk:flex cpk:flex-col cpk:items-end cpk:group cpk:pt-10",
5476
5476
  "data-message-id": e.message.id
5477
- }, $.$attrs), [
5478
- I($.$slots, "message-renderer", {
5477
+ }, M.$attrs), [
5478
+ I(M.$slots, "message-renderer", {
5479
5479
  message: e.message,
5480
5480
  content: f.value,
5481
5481
  isMultiline: u.value
@@ -5485,15 +5485,15 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5485
5485
  "data-multiline": u.value ? "true" : void 0
5486
5486
  }, ke(f.value), 11, vr)
5487
5487
  ]),
5488
- I($.$slots, "toolbar", {
5488
+ I(M.$slots, "toolbar", {
5489
5489
  message: e.message,
5490
5490
  showBranchNavigation: v.value,
5491
5491
  hasEditAction: k.value
5492
5492
  }, () => [
5493
5493
  F("div", mr, [
5494
5494
  F("div", hr, [
5495
- I($.$slots, "toolbar-items"),
5496
- I($.$slots, "copy-button", {
5495
+ I(M.$slots, "toolbar-items"),
5496
+ I(M.$slots, "copy-button", {
5497
5497
  onCopy: h,
5498
5498
  copied: l.value,
5499
5499
  label: o.value.userMessageToolbarCopyMessageLabel
@@ -5506,16 +5506,16 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5506
5506
  title: o.value.userMessageToolbarCopyMessageLabel,
5507
5507
  onClick: h
5508
5508
  }, [
5509
- l.value ? (M(), he(Q(Mt), {
5509
+ l.value ? ($(), he(Q(Mt), {
5510
5510
  key: 0,
5511
5511
  class: "cpk:size-[18px]"
5512
- })) : (M(), he(Q(zt), {
5512
+ })) : ($(), he(Q(zt), {
5513
5513
  key: 1,
5514
5514
  class: "cpk:size-[18px]"
5515
5515
  }))
5516
5516
  ], 10, br)
5517
5517
  ]),
5518
- k.value ? I($.$slots, "edit-button", {
5518
+ k.value ? I(M.$slots, "edit-button", {
5519
5519
  key: 0,
5520
5520
  onEdit: y,
5521
5521
  label: o.value.userMessageToolbarEditMessageLabel
@@ -5530,7 +5530,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5530
5530
  ie(Q(ko), { class: "cpk:size-[18px]" })
5531
5531
  ], 10, kr)
5532
5532
  ]) : X("", !0),
5533
- v.value ? I($.$slots, "branch-navigation", {
5533
+ v.value ? I(M.$slots, "branch-navigation", {
5534
5534
  key: 1,
5535
5535
  branchIndex: e.branchIndex,
5536
5536
  numberOfBranches: e.numberOfBranches,
@@ -5658,9 +5658,9 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5658
5658
  );
5659
5659
  function m(p) {
5660
5660
  s.value += 0;
5661
- const b = c.value, h = a.value?.threadId ?? "", y = t.value, A = y.getRunIdForMessage(b, h, p.id) ?? y.getRunIdsForThread(b, h).slice(-1)[0], L = A ?? `missing-run-id:${p.id}`, D = g.value ?? y.getAgent(b), $ = A && D ? D.messages.filter(
5661
+ const b = c.value, h = a.value?.threadId ?? "", y = t.value, A = y.getRunIdForMessage(b, h, p.id) ?? y.getRunIdsForThread(b, h).slice(-1)[0], L = A ?? `missing-run-id:${p.id}`, D = g.value ?? y.getAgent(b), M = A && D ? D.messages.filter(
5662
5662
  (H) => y.getRunIdForMessage(b, h, H.id) === A
5663
- ).map((H) => H.id) : [p.id], j = D ? D.messages.findIndex((H) => H.id === p.id) : -1, W = j >= 0 ? j : 0, te = A ? Math.max($.indexOf(p.id), 0) : 0, Z = A ? $.length : 1, V = A ? y.getStateByRun(b, h, A) : void 0;
5663
+ ).map((H) => H.id) : [p.id], j = D ? D.messages.findIndex((H) => H.id === p.id) : -1, W = j >= 0 ? j : 0, te = A ? Math.max(M.indexOf(p.id), 0) : 0, Z = A ? M.length : 1, V = A ? y.getStateByRun(b, h, A) : void 0;
5664
5664
  return {
5665
5665
  runId: L,
5666
5666
  messageIndex: W,
@@ -5678,8 +5678,8 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5678
5678
  return null;
5679
5679
  const y = c.value, L = [...t.value.renderCustomMessages].filter(
5680
5680
  (D) => D.agentId === void 0 || D.agentId === y
5681
- ).sort((D, $) => {
5682
- const j = D.agentId !== void 0, W = $.agentId !== void 0;
5681
+ ).sort((D, M) => {
5682
+ const j = D.agentId !== void 0, W = M.agentId !== void 0;
5683
5683
  return j === W ? 0 : j ? -1 : 1;
5684
5684
  })[0];
5685
5685
  return L?.render ? {
@@ -5696,8 +5696,8 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5696
5696
  const b = c.value, h = [...t.value.renderActivityMessages].filter(
5697
5697
  (A) => A.activityType === p.activityType && (A.agentId === void 0 || A.agentId === b)
5698
5698
  ).sort((A, L) => {
5699
- const D = A.agentId !== void 0, $ = L.agentId !== void 0;
5700
- return D === $ ? 0 : D ? -1 : 1;
5699
+ const D = A.agentId !== void 0, M = L.agentId !== void 0;
5700
+ return D === M ? 0 : D ? -1 : 1;
5701
5701
  })[0];
5702
5702
  if (!h) return null;
5703
5703
  const y = h.content.safeParse(p.content);
@@ -5711,11 +5711,11 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5711
5711
  }
5712
5712
  } : null;
5713
5713
  }
5714
- return (p, b) => (M(), B("div", fe({
5714
+ return (p, b) => ($(), B("div", fe({
5715
5715
  "data-copilotkit": "",
5716
5716
  class: "cpk:flex cpk:flex-col"
5717
5717
  }, p.$attrs), [
5718
- (M(!0), B(Me, null, Ge(d.value, (h) => (M(), B(Me, {
5718
+ ($(!0), B(Me, null, Ge(d.value, (h) => ($(), B(Me, {
5719
5719
  key: h.id
5720
5720
  }, [
5721
5721
  Q(i)["message-before"] ? I(p.$slots, "message-before", {
@@ -5728,7 +5728,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5728
5728
  numberOfMessagesInRun: m(h).numberOfMessagesInRun,
5729
5729
  agentId: m(h).agentId,
5730
5730
  stateSnapshot: m(h).stateSnapshot
5731
- }) : v(h, "before") ? (M(), he(ft(v(h, "before").renderer), fe({
5731
+ }) : v(h, "before") ? ($(), he(ft(v(h, "before").renderer), fe({
5732
5732
  key: 1,
5733
5733
  ref_for: !0
5734
5734
  }, v(h, "before").props), null, 16)) : X("", !0),
@@ -5786,7 +5786,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5786
5786
  message: h,
5787
5787
  agent: g.value
5788
5788
  }, () => [
5789
- w(h) ? (M(), he(ft(w(h).renderer), fe({
5789
+ w(h) ? ($(), he(ft(w(h).renderer), fe({
5790
5790
  key: 0,
5791
5791
  ref_for: !0
5792
5792
  }, w(h).props), null, 16)) : X("", !0)
@@ -5802,7 +5802,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5802
5802
  numberOfMessagesInRun: m(h).numberOfMessagesInRun,
5803
5803
  agentId: m(h).agentId,
5804
5804
  stateSnapshot: m(h).stateSnapshot
5805
- }) : v(h, "after") ? (M(), he(ft(v(h, "after").renderer), fe({
5805
+ }) : v(h, "after") ? ($(), he(ft(v(h, "after").renderer), fe({
5806
5806
  key: 7,
5807
5807
  ref_for: !0
5808
5808
  }, v(h, "after").props), null, 16)) : X("", !0)
@@ -5840,7 +5840,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5840
5840
  },
5841
5841
  setup(e) {
5842
5842
  const n = e, t = r(() => n.isLoading || n.disabled);
5843
- return (a, s) => (M(), B("button", fe({
5843
+ return (a, s) => ($(), B("button", fe({
5844
5844
  "data-copilotkit": "",
5845
5845
  "data-slot": "suggestion-pill",
5846
5846
  "data-testid": "copilot-chat-suggestion-pill",
@@ -5849,14 +5849,14 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5849
5849
  disabled: t.value,
5850
5850
  class: "cpk:group cpk:inline-flex cpk:h-7 cpk:w-fit cpk:items-center cpk:gap-1 cpk:rounded-full cpk:border cpk:border-border/60 cpk:bg-background cpk:px-2.5 cpk:text-[11px] cpk:leading-none cpk:text-foreground cpk:transition-colors cpk:cursor-pointer cpk:hover:bg-accent/60 cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring cpk:focus-visible:ring-offset-2 cpk:focus-visible:ring-offset-background cpk:disabled:cursor-not-allowed cpk:disabled:text-muted-foreground cpk:disabled:hover:bg-background cpk:disabled:hover:text-muted-foreground cpk:pointer-events-auto cpk:sm:h-8 cpk:sm:gap-1.5 cpk:sm:px-3 cpk:sm:text-xs"
5851
5851
  }, a.$attrs), [
5852
- e.isLoading ? (M(), B("span", Ar, [
5852
+ e.isLoading ? ($(), B("span", Ar, [
5853
5853
  ie(Q(Qn), {
5854
5854
  class: "cpk:h-3.5 cpk:w-3.5 cpk:animate-spin cpk:sm:h-4 cpk:sm:w-4",
5855
5855
  "aria-hidden": "true"
5856
5856
  })
5857
- ])) : a.$slots.icon || e.icon ? (M(), B("span", Rr, [
5857
+ ])) : a.$slots.icon || e.icon ? ($(), B("span", Rr, [
5858
5858
  I(a.$slots, "icon", {}, () => [
5859
- (M(), he(ft(e.icon)))
5859
+ ($(), he(ft(e.icon)))
5860
5860
  ])
5861
5861
  ])) : X("", !0),
5862
5862
  F("span", Mr, [
@@ -5900,7 +5900,7 @@ const gi = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5900
5900
  "data-testid": "copilot-chat-suggestion-view",
5901
5901
  class: i.value
5902
5902
  }, l.value), [
5903
- (M(!0), B(Me, null, Ge(e.suggestions, (u, m) => I(d.$slots, "suggestion", {
5903
+ ($(!0), B(Me, null, Ge(e.suggestions, (u, m) => I(d.$slots, "suggestion", {
5904
5904
  key: `${u.title}-${m}`,
5905
5905
  suggestion: u,
5906
5906
  index: m,
@@ -5988,7 +5988,7 @@ const Or = {
5988
5988
  () => !t.isConnecting && !t.isRunning && Array.isArray(t.suggestions) && t.suggestions.length > 0
5989
5989
  ), D = r(
5990
5990
  () => Array.isArray(t.attachments) && t.attachments.length > 0
5991
- ), $ = r(
5991
+ ), M = r(
5992
5992
  () => i?.vnode.props ?? {}
5993
5993
  ), j = r(
5994
5994
  () => Object.keys(l).filter(
@@ -6069,7 +6069,7 @@ const Or = {
6069
6069
  ee();
6070
6070
  }
6071
6071
  function Ie(K) {
6072
- const ce = $.value[K];
6072
+ const ce = M.value[K];
6073
6073
  return Array.isArray(ce) ? ce.length > 0 : !!ce;
6074
6074
  }
6075
6075
  function Ae(K) {
@@ -6121,7 +6121,7 @@ const Or = {
6121
6121
  })), xe(), P();
6122
6122
  }), Fe(() => {
6123
6123
  _?.disconnect(), se?.disconnect(), _ = null, se = null;
6124
- }), (K, ce) => (M(), B("div", fe({
6124
+ }), (K, ce) => ($(), B("div", fe({
6125
6125
  "data-copilotkit": "",
6126
6126
  class: "cpk:@container cpk:relative cpk:h-full",
6127
6127
  "data-testid": "copilot-chat-view"
@@ -6130,7 +6130,7 @@ const Or = {
6130
6130
  onDragleave: Pe,
6131
6131
  onDrop: He
6132
6132
  }), [
6133
- e.dragOver ? (M(), B("div", Or, [...ce[3] || (ce[3] = [
6133
+ e.dragOver ? ($(), B("div", Or, [...ce[3] || (ce[3] = [
6134
6134
  F("span", { class: "cpk:text-sm cpk:font-medium cpk:text-primary/70" }, " Drop files here ", -1)
6135
6135
  ])])) : X("", !0),
6136
6136
  W.value ? I(K.$slots, "welcome-screen", {
@@ -6160,7 +6160,7 @@ const Or = {
6160
6160
  ])
6161
6161
  ]),
6162
6162
  F("div", jr, [
6163
- D.value ? (M(), he(_n, {
6163
+ D.value ? ($(), he(_n, {
6164
6164
  key: 0,
6165
6165
  attachments: e.attachments ?? [],
6166
6166
  "class-name": "cpk:mb-2",
@@ -6192,7 +6192,7 @@ const Or = {
6192
6192
  }, We.value), null, 16, ["model-value", "is-running", "mode", "tools-menu", "keyboard-height"])
6193
6193
  ])
6194
6194
  ]),
6195
- L.value ? (M(), B("div", Nr, [
6195
+ L.value ? ($(), B("div", Nr, [
6196
6196
  I(K.$slots, "suggestion-view", {
6197
6197
  suggestions: e.suggestions,
6198
6198
  loadingIndexes: e.suggestionLoadingIndexes,
@@ -6207,7 +6207,7 @@ const Or = {
6207
6207
  ])) : X("", !0)
6208
6208
  ])
6209
6209
  ])
6210
- ]) : (M(), B(Me, { key: 2 }, [
6210
+ ]) : ($(), B(Me, { key: 2 }, [
6211
6211
  I(K.$slots, "scroll-view", {
6212
6212
  messages: e.messages,
6213
6213
  isRunning: e.isRunning,
@@ -6250,7 +6250,7 @@ const Or = {
6250
6250
  }))
6251
6251
  ]), 1032, ["messages", "is-running"])
6252
6252
  ]),
6253
- L.value ? (M(), B("div", _r, [
6253
+ L.value ? ($(), B("div", _r, [
6254
6254
  I(K.$slots, "suggestion-view", {
6255
6255
  suggestions: e.suggestions,
6256
6256
  loadingIndexes: e.suggestionLoadingIndexes,
@@ -6266,7 +6266,7 @@ const Or = {
6266
6266
  ])) : X("", !0)
6267
6267
  ])
6268
6268
  ], 4),
6269
- p.value ? (M(), B("div", {
6269
+ p.value ? ($(), B("div", {
6270
6270
  key: 0,
6271
6271
  ref_key: "spacerRef",
6272
6272
  ref: T,
@@ -6280,7 +6280,7 @@ const Or = {
6280
6280
  I(K.$slots, "feather", {}, () => [
6281
6281
  ce[4] || (ce[4] = F("div", { "data-testid": "copilot-chat-view-feather" }, null, -1))
6282
6282
  ]),
6283
- E.value ? (M(), B("div", {
6283
+ E.value ? ($(), B("div", {
6284
6284
  key: 0,
6285
6285
  class: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
6286
6286
  style: lt({ bottom: `${f.value + Hr}px` })
@@ -6304,7 +6304,7 @@ const Or = {
6304
6304
  class: "cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-0 cpk:z-20 cpk:pointer-events-none",
6305
6305
  "data-testid": "copilot-input-overlay"
6306
6306
  }, [
6307
- D.value ? (M(), B("div", zr, [
6307
+ D.value ? ($(), B("div", zr, [
6308
6308
  ie(_n, {
6309
6309
  attachments: e.attachments ?? [],
6310
6310
  "class-name": "cpk:px-4",
@@ -6377,7 +6377,7 @@ const Or = {
6377
6377
  () => !!t.threadId || !!i.value?.hasExplicitThreadId
6378
6378
  ), y = S(null), A = r(
6379
6379
  () => h.value && y.value !== b.value
6380
- ), L = na(r(() => t.labels)), D = r(() => L.value), { agent: $ } = xn({
6380
+ ), L = na(r(() => t.labels)), D = r(() => L.value), { agent: M } = xn({
6381
6381
  agentId: w,
6382
6382
  threadId: b,
6383
6383
  throttleMs: r(() => t.throttleMs)
@@ -6415,7 +6415,7 @@ const Or = {
6415
6415
  config: r(() => t.attachments)
6416
6416
  }), be = r(
6417
6417
  () => u.value ? "processing" : T.value
6418
- ), Ie = S(0), Ae = r(() => [...$.value?.messages ?? []]), Ee = r(() => (Ie.value, $.value?.isRunning ?? !1)), De = r(
6418
+ ), Ie = S(0), Ae = r(() => [...M.value?.messages ?? []]), Ee = r(() => (Ie.value, M.value?.isRunning ?? !1)), De = r(
6419
6419
  () => Ee.value && Ae.value.length > 0
6420
6420
  ), z = r(() => {
6421
6421
  for (let q = Ae.value.length - 1; q >= 0; q--) {
@@ -6433,7 +6433,7 @@ const Or = {
6433
6433
  sendNonce: ve.value
6434
6434
  }));
6435
6435
  At(sa, Pe), U(
6436
- () => $.value,
6436
+ () => M.value,
6437
6437
  (q, de, pe) => {
6438
6438
  if (!q) return;
6439
6439
  const Te = q.subscribe({
@@ -6481,7 +6481,7 @@ const Or = {
6481
6481
  [
6482
6482
  m,
6483
6483
  () => l.value,
6484
- () => $.value,
6484
+ () => M.value,
6485
6485
  b,
6486
6486
  h
6487
6487
  ],
@@ -6517,14 +6517,14 @@ const Or = {
6517
6517
  }
6518
6518
  Ze(() => {
6519
6519
  const Ke = v.value;
6520
- !Ke || Ke !== Qe || !(k.value || l.value !== Ke.core || $.value !== Ke.agent || b.value !== Ke.threadId) || (Ke.detached = !0, Ke.abortController.abort(), Ke.agent.detachActiveRun?.(), v.value = null);
6520
+ !Ke || Ke !== Qe || !(k.value || l.value !== Ke.core || M.value !== Ke.agent || b.value !== Ke.threadId) || (Ke.detached = !0, Ke.abortController.abort(), Ke.agent.detachActiveRun?.(), v.value = null);
6521
6521
  });
6522
6522
  },
6523
6523
  { immediate: !0 }
6524
6524
  );
6525
6525
  const He = S(void 0);
6526
6526
  U(
6527
- [b, h, () => $.value],
6527
+ [b, h, () => M.value],
6528
6528
  ([q, de, pe]) => {
6529
6529
  const Te = He.value;
6530
6530
  He.value = q, pe && (de || Te !== void 0 && q !== Te && pe.setMessages([]));
@@ -6543,7 +6543,7 @@ const Or = {
6543
6543
  pe(() => clearTimeout(Te));
6544
6544
  });
6545
6545
  async function $e() {
6546
- const q = $.value;
6546
+ const q = M.value;
6547
6547
  if (q)
6548
6548
  try {
6549
6549
  const de = v.value;
@@ -6559,7 +6559,7 @@ const Or = {
6559
6559
  console.error("[CopilotKit] Cannot send while attachments are uploading");
6560
6560
  return;
6561
6561
  }
6562
- if (a("submit-message", q), !$.value) {
6562
+ if (a("submit-message", q), !M.value) {
6563
6563
  console.error("[CopilotKit] Cannot send message: no agent available");
6564
6564
  return;
6565
6565
  }
@@ -6576,13 +6576,13 @@ const Or = {
6576
6576
  ...Be.metadata
6577
6577
  }
6578
6578
  });
6579
- $.value.addMessage({
6579
+ M.value.addMessage({
6580
6580
  id: rt(),
6581
6581
  role: "user",
6582
6582
  content: Te
6583
6583
  });
6584
6584
  } else
6585
- $.value.addMessage({
6585
+ M.value.addMessage({
6586
6586
  id: rt(),
6587
6587
  role: "user",
6588
6588
  content: q
@@ -6590,14 +6590,14 @@ const Or = {
6590
6590
  d.value = "", await $e();
6591
6591
  }
6592
6592
  async function Ce(q, de) {
6593
- a("select-suggestion", q, de), $.value?.addMessage({
6593
+ a("select-suggestion", q, de), M.value?.addMessage({
6594
6594
  id: rt(),
6595
6595
  role: "user",
6596
6596
  content: q.message
6597
6597
  }), await $e();
6598
6598
  }
6599
6599
  function Re() {
6600
- const q = $.value;
6600
+ const q = M.value;
6601
6601
  if (q)
6602
6602
  try {
6603
6603
  l.value.stopAgent({ agent: q });
@@ -6710,7 +6710,7 @@ const Or = {
6710
6710
  };
6711
6711
  return De.value && (q.onStop = We), O.value && (q.onAddFile = ce, q.attachments = ae.value, q.onRemoveAttachment = ne, q.dragOver = x.value, q.onDragOver = xe, q.onDragLeave = P, q.onDrop = ee), H.value && (q.onStartTranscribe = Ne, q.onCancelTranscribe = Ye, q.onFinishTranscribe = Ct), q;
6712
6712
  });
6713
- return (q, de) => (M(), he(yn, {
6713
+ return (q, de) => ($(), he(yn, {
6714
6714
  "agent-id": w.value,
6715
6715
  "thread-id": b.value,
6716
6716
  "has-explicit-thread-id": h.value,
@@ -6722,7 +6722,7 @@ const Or = {
6722
6722
  ref: _,
6723
6723
  style: { display: "contents" }
6724
6724
  }, [
6725
- Q(O) ? (M(), B("input", {
6725
+ Q(O) ? ($(), B("input", {
6726
6726
  key: 0,
6727
6727
  ref_key: "fileInputRef",
6728
6728
  ref: E,
@@ -6734,11 +6734,11 @@ const Or = {
6734
6734
  Q(se)(pe);
6735
6735
  })
6736
6736
  }, null, 40, Kr)) : X("", !0),
6737
- te.value ? X("", !0) : (M(), he(wn, {
6737
+ te.value ? X("", !0) : ($(), he(wn, {
6738
6738
  key: 1,
6739
6739
  "feature-name": "Chat"
6740
6740
  })),
6741
- f.value ? (M(), B("div", qr, ke(f.value), 1)) : X("", !0),
6741
+ f.value ? ($(), B("div", qr, ke(f.value), 1)) : X("", !0),
6742
6742
  I(q.$slots, "chat-view", J(Y(Ue.value)), () => [
6743
6743
  ie(Yt, fe(Tt.value, {
6744
6744
  messages: Ue.value.messages,
@@ -6789,20 +6789,20 @@ const Or = {
6789
6789
  const n = e, t = S(!1), a = r(() => yt(n.source)), s = r(
6790
6790
  () => n.filename || n.source.mimeType || "Unknown type"
6791
6791
  );
6792
- return (o, i) => n.type === "image" && !t.value ? (M(), B("img", {
6792
+ return (o, i) => n.type === "image" && !t.value ? ($(), B("img", {
6793
6793
  key: 0,
6794
6794
  src: a.value,
6795
6795
  alt: "Image attachment",
6796
6796
  class: ye(["cpk:max-w-full cpk:h-auto cpk:rounded-lg", n.className]),
6797
6797
  "data-testid": "copilot-chat-attachment-renderer-image",
6798
6798
  onError: i[0] || (i[0] = (l) => t.value = !0)
6799
- }, null, 42, Gr)) : n.type === "image" ? (M(), B("div", {
6799
+ }, null, 42, Gr)) : n.type === "image" ? ($(), B("div", {
6800
6800
  key: 1,
6801
6801
  class: ye(["cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:rounded-lg cpk:bg-muted cpk:p-4 cpk:text-sm cpk:text-muted-foreground", n.className]),
6802
6802
  "data-testid": "copilot-chat-attachment-renderer-image-fallback"
6803
6803
  }, [...i[1] || (i[1] = [
6804
6804
  F("span", null, "Failed to load image", -1)
6805
- ])], 2)) : n.type === "audio" ? (M(), B("div", {
6805
+ ])], 2)) : n.type === "audio" ? ($(), B("div", {
6806
6806
  key: 2,
6807
6807
  class: ye(["cpk:flex cpk:flex-col cpk:gap-1", n.className]),
6808
6808
  "data-testid": "copilot-chat-attachment-renderer-audio"
@@ -6813,15 +6813,15 @@ const Or = {
6813
6813
  preload: "metadata",
6814
6814
  class: "cpk:max-w-[300px] cpk:w-full cpk:h-10"
6815
6815
  }, null, 8, Jr),
6816
- n.filename ? (M(), B("span", Qr, ke(n.filename), 1)) : X("", !0)
6817
- ], 2)) : n.type === "video" ? (M(), B("video", {
6816
+ n.filename ? ($(), B("span", Qr, ke(n.filename), 1)) : X("", !0)
6817
+ ], 2)) : n.type === "video" ? ($(), B("video", {
6818
6818
  key: 3,
6819
6819
  src: a.value,
6820
6820
  controls: "",
6821
6821
  preload: "metadata",
6822
6822
  class: ye(["cpk:max-w-[400px] cpk:w-full cpk:rounded-lg", n.className]),
6823
6823
  "data-testid": "copilot-chat-attachment-renderer-video"
6824
- }, null, 10, Xr)) : (M(), B("div", {
6824
+ }, null, 10, Xr)) : ($(), B("div", {
6825
6825
  key: 4,
6826
6826
  class: ye(["cpk:inline-flex cpk:items-center cpk:gap-2 cpk:px-3 cpk:py-2 cpk:border cpk:border-border cpk:rounded-lg cpk:bg-muted", n.className]),
6827
6827
  "data-testid": "copilot-chat-attachment-renderer-document"
@@ -6933,7 +6933,7 @@ function el(e) {
6933
6933
  () => y.value || T.value ? !1 : A.value || m.value
6934
6934
  ), D = r(
6935
6935
  () => y.value ?? T.value ?? k.value
6936
- ), $ = r(() => k.value);
6936
+ ), M = r(() => k.value);
6937
6937
  function j(W) {
6938
6938
  return (...te) => d.value ? Promise.reject(d.value) : W(...te);
6939
6939
  }
@@ -6953,7 +6953,7 @@ function el(e) {
6953
6953
  ),
6954
6954
  isLoading: L,
6955
6955
  error: D,
6956
- listError: $,
6956
+ listError: M,
6957
6957
  fetchMoreError: v,
6958
6958
  hasMoreThreads: w,
6959
6959
  isFetchingMoreThreads: p,
@@ -7064,7 +7064,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7064
7064
  (E) => console.error("CopilotThreadsDrawer: archiveThread failed", E)
7065
7065
  );
7066
7066
  }
7067
- function $(O) {
7067
+ function M(O) {
7068
7068
  const { threadId: x } = O.detail;
7069
7069
  u.unarchiveThread(x).catch(
7070
7070
  (E) => console.error("CopilotThreadsDrawer: unarchiveThread failed", E)
@@ -7099,7 +7099,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7099
7099
  function ae() {
7100
7100
  t.onLicensed?.();
7101
7101
  }
7102
- return (O, x) => v.value ? (M(), he(ft(w.value), {
7102
+ return (O, x) => v.value ? ($(), he(ft(w.value), {
7103
7103
  key: 0,
7104
7104
  ref_key: "elRef",
7105
7105
  ref: p,
@@ -7108,7 +7108,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7108
7108
  onThreadSelected: A,
7109
7109
  onNewThread: L,
7110
7110
  onArchive: D,
7111
- onUnarchive: $,
7111
+ onUnarchive: M,
7112
7112
  onDelete: j,
7113
7113
  onFilterChange: W,
7114
7114
  onCollapseChange: te,
@@ -7119,7 +7119,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7119
7119
  }, {
7120
7120
  default: G(() => [
7121
7121
  I(O.$slots, "default"),
7122
- O.$slots.row ? (M(!0), B(Me, { key: 0 }, Ge(Q(u).threads.value, (E) => (M(), B("div", fe({
7122
+ O.$slots.row ? ($(!0), B(Me, { key: 0 }, Ge(Q(u).threads.value, (E) => ($(), B("div", fe({
7123
7123
  key: E.id
7124
7124
  }, { ref_for: !0 }, { slot: `row:${E.id}` }), [
7125
7125
  I(O.$slots, "row", { thread: E })
@@ -7199,7 +7199,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7199
7199
  m.defaultPrevented || d(!i.value);
7200
7200
  }
7201
7201
  }
7202
- return (m, k) => (M(), B("button", fe({
7202
+ return (m, k) => ($(), B("button", fe({
7203
7203
  "data-copilotkit": "",
7204
7204
  type: e.type,
7205
7205
  "data-slot": "chat-toggle-button",
@@ -7340,7 +7340,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7340
7340
  function f() {
7341
7341
  a.value?.setDrawerOpen?.(!a.value?.drawerOpen);
7342
7342
  }
7343
- return (u, m) => (M(), B("header", fe({
7343
+ return (u, m) => ($(), B("header", fe({
7344
7344
  "data-copilotkit": "",
7345
7345
  "data-slot": "copilot-modal-header",
7346
7346
  class: o.value
@@ -7351,7 +7351,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7351
7351
  }, () => [
7352
7352
  F("div", al, [
7353
7353
  F("div", ol, [
7354
- d.value ? (M(), B("button", {
7354
+ d.value ? ($(), B("button", {
7355
7355
  key: 0,
7356
7356
  type: "button",
7357
7357
  "data-testid": "drawer-launcher",
@@ -7364,7 +7364,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7364
7364
  class: "cpk:h-4 cpk:w-4",
7365
7365
  "aria-hidden": "true"
7366
7366
  })
7367
- ], 8, sl)) : (M(), B("span", il))
7367
+ ], 8, sl)) : ($(), B("span", il))
7368
7368
  ]),
7369
7369
  F("div", rl, [
7370
7370
  I(u.$slots, "title-content", { title: s.value }, () => [
@@ -7465,7 +7465,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7465
7465
  function D(x) {
7466
7466
  a("submit-message", x);
7467
7467
  }
7468
- function $() {
7468
+ function M() {
7469
7469
  a("stop");
7470
7470
  }
7471
7471
  function j(x) {
@@ -7492,7 +7492,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7492
7492
  onInputChange: j,
7493
7493
  onSelectSuggestion: W
7494
7494
  };
7495
- return v.value && (x.onStop = $), h("onAddFile") && (x.onAddFile = te), h("onStartTranscribe") && (x.onStartTranscribe = Z), h("onCancelTranscribe") && (x.onCancelTranscribe = V), h("onFinishTranscribe") && (x.onFinishTranscribe = H), x;
7495
+ return v.value && (x.onStop = M), h("onAddFile") && (x.onAddFile = te), h("onStartTranscribe") && (x.onStartTranscribe = Z), h("onCancelTranscribe") && (x.onCancelTranscribe = V), h("onFinishTranscribe") && (x.onFinishTranscribe = H), x;
7496
7496
  }), O = r(() => ({
7497
7497
  ...s,
7498
7498
  ...ae.value
@@ -7555,7 +7555,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7555
7555
  await gt();
7556
7556
  }), Fe(() => {
7557
7557
  d && clearTimeout(d), f && clearTimeout(f);
7558
- }), (x, E) => (M(), B(Me, null, [
7558
+ }), (x, E) => ($(), B(Me, null, [
7559
7559
  I(x.$slots, "toggle-button", {
7560
7560
  isOpen: u.value,
7561
7561
  toggle: L,
@@ -7564,7 +7564,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7564
7564
  }, () => [
7565
7565
  ie(Tn)
7566
7566
  ]),
7567
- g.value ? (M(), B("div", cl, [
7567
+ g.value ? ($(), B("div", cl, [
7568
7568
  F("div", {
7569
7569
  ref_key: "containerRef",
7570
7570
  ref: c,
@@ -7719,7 +7719,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7719
7719
  ...c.value,
7720
7720
  ...g.value
7721
7721
  }));
7722
- return (d, f) => (M(), he(yn, { "is-modal-default-open": e.defaultOpen }, {
7722
+ return (d, f) => ($(), he(yn, { "is-modal-default-open": e.defaultOpen }, {
7723
7723
  default: G(() => [
7724
7724
  ie(gl, J(Y(T.value)), Je({ _: 2 }, [
7725
7725
  d.$slots.header ? {
@@ -7971,7 +7971,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
7971
7971
  function D() {
7972
7972
  o.value?.setModalOpen?.(!0);
7973
7973
  }
7974
- function $() {
7974
+ function M() {
7975
7975
  o.value?.setModalOpen?.(!d.value);
7976
7976
  }
7977
7977
  function j(E) {
@@ -8021,8 +8021,8 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8021
8021
  }), T.observe(c.value));
8022
8022
  }), Fe(() => {
8023
8023
  T?.disconnect(), T = null;
8024
- }), (E, _) => (M(), B(Me, null, [
8025
- d.value ? (M(), he(ft("style"), { key: 0 }, {
8024
+ }), (E, _) => ($(), B(Me, null, [
8025
+ d.value ? ($(), he(ft("style"), { key: 0 }, {
8026
8026
  default: G(() => [
8027
8027
  qt(ke(p.value), 1)
8028
8028
  ]),
@@ -8030,7 +8030,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8030
8030
  })) : X("", !0),
8031
8031
  I(E.$slots, "toggle-button", {
8032
8032
  isOpen: d.value,
8033
- toggle: $,
8033
+ toggle: M,
8034
8034
  open: D,
8035
8035
  close: L
8036
8036
  }, () => [
@@ -8181,7 +8181,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8181
8181
  };
8182
8182
  return g("onAddFile") && (d.onAddFile = () => a("add-file")), g("onStartTranscribe") && (d.onStartTranscribe = () => a("start-transcribe")), g("onCancelTranscribe") && (d.onCancelTranscribe = () => a("cancel-transcribe")), g("onFinishTranscribe") && (d.onFinishTranscribe = () => a("finish-transcribe")), d;
8183
8183
  });
8184
- return (d, f) => (M(), he(yn, { "is-modal-default-open": e.defaultOpen }, {
8184
+ return (d, f) => ($(), he(yn, { "is-modal-default-open": e.defaultOpen }, {
8185
8185
  default: G(() => [
8186
8186
  ie(Tl, J(Y(c.value)), Je({ _: 2 }, [
8187
8187
  d.$slots.header ? {
@@ -8393,8 +8393,8 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8393
8393
  );
8394
8394
  },
8395
8395
  { immediate: !0 }
8396
- ), (o, i) => (M(), B(Me, null, [
8397
- s.value ? X("", !0) : (M(), he(wn, {
8396
+ ), (o, i) => ($(), B(Me, null, [
8397
+ s.value ? X("", !0) : ($(), he(wn, {
8398
8398
  key: 0,
8399
8399
  "feature-name": "Popup"
8400
8400
  })),
@@ -8409,7 +8409,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8409
8409
  onFinishTranscribe: i[7] || (i[7] = (l) => o.$emit("finish-transcribe"))
8410
8410
  }), {
8411
8411
  "chat-view": G((l) => [
8412
- o.$slots["chat-view"] ? I(o.$slots, "chat-view", J(fe({ key: 0 }, l))) : (M(), he(ua, fe({
8412
+ o.$slots["chat-view"] ? I(o.$slots, "chat-view", J(fe({ key: 0 }, l))) : ($(), he(ua, fe({
8413
8413
  key: 1,
8414
8414
  messages: l.messages,
8415
8415
  "auto-scroll": l.autoScroll,
@@ -8427,7 +8427,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8427
8427
  "on-finish-transcribe-with-audio": l.onFinishTranscribeWithAudio
8428
8428
  }, n(l)), Je({
8429
8429
  "welcome-screen": G((c) => [
8430
- o.$slots["welcome-screen"] ? I(o.$slots, "welcome-screen", J(fe({ key: 0 }, c))) : (M(), he(da, J(fe({ key: 1 }, c)), Je({ _: 2 }, [
8430
+ o.$slots["welcome-screen"] ? I(o.$slots, "welcome-screen", J(fe({ key: 0 }, c))) : ($(), he(da, J(fe({ key: 1 }, c)), Je({ _: 2 }, [
8431
8431
  o.$slots["welcome-message"] ? {
8432
8432
  name: "welcome-message",
8433
8433
  fn: G(() => [
@@ -8537,8 +8537,8 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8537
8537
  );
8538
8538
  },
8539
8539
  { immediate: !0 }
8540
- ), (o, i) => (M(), B(Me, null, [
8541
- s.value ? X("", !0) : (M(), he(wn, {
8540
+ ), (o, i) => ($(), B(Me, null, [
8541
+ s.value ? X("", !0) : ($(), he(wn, {
8542
8542
  key: 0,
8543
8543
  "feature-name": "Sidebar"
8544
8544
  })),
@@ -8553,7 +8553,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8553
8553
  onFinishTranscribe: i[7] || (i[7] = (l) => o.$emit("finish-transcribe"))
8554
8554
  }), {
8555
8555
  "chat-view": G((l) => [
8556
- o.$slots["chat-view"] ? I(o.$slots, "chat-view", J(fe({ key: 0 }, l))) : (M(), he(pa, fe({
8556
+ o.$slots["chat-view"] ? I(o.$slots, "chat-view", J(fe({ key: 0 }, l))) : ($(), he(pa, fe({
8557
8557
  key: 1,
8558
8558
  messages: l.messages,
8559
8559
  "auto-scroll": l.autoScroll,
@@ -8569,7 +8569,7 @@ const zn = "copilot-chat-input-textarea", tl = "copilot-chat-view", ec = /* @__P
8569
8569
  "on-finish-transcribe-with-audio": l.onFinishTranscribeWithAudio
8570
8570
  }, n(l)), Je({
8571
8571
  "welcome-screen": G((c) => [
8572
- o.$slots["welcome-screen"] ? I(o.$slots, "welcome-screen", J(fe({ key: 0 }, c))) : (M(), he(fa, J(fe({ key: 1 }, c)), Je({ _: 2 }, [
8572
+ o.$slots["welcome-screen"] ? I(o.$slots, "welcome-screen", J(fe({ key: 0 }, c))) : ($(), he(fa, J(fe({ key: 1 }, c)), Je({ _: 2 }, [
8573
8573
  o.$slots["welcome-message"] ? {
8574
8574
  name: "welcome-message",
8575
8575
  fn: G(() => [
@@ -9479,4 +9479,4 @@ export {
9479
9479
  nc as y,
9480
9480
  rc as z
9481
9481
  };
9482
- //# sourceMappingURL=use-render-activity-message-CszKQeFs.js.map
9482
+ //# sourceMappingURL=use-render-activity-message-CaArNmtw.js.map