@voxket-ai/voxket-live 1.0.152 → 1.0.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Yg = Object.defineProperty;
2
2
  var Zg = (e, t, n) => t in e ? Yg(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var at = (e, t, n) => Zg(e, typeof t != "symbol" ? t + "" : t, n);
3
+ var ot = (e, t, n) => Zg(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as P from "react";
5
5
  import Fe, { createContext as Tn, useRef as tn, useLayoutEffect as Xg, useEffect as Ct, useId as Ha, useContext as _t, useInsertionEffect as Cf, useMemo as Zt, useCallback as qe, Children as Qg, isValidElement as Jg, useState as we, Fragment as Tf, createElement as eb, forwardRef as tb, Component as nb } from "react";
6
6
  import { jsx as m, Fragment as Nn, jsxs as A } from "react/jsx-runtime";
@@ -195,7 +195,7 @@ function Qf(e, t) {
195
195
  s[Li[C]].cancel(E);
196
196
  }, state: i, steps: s };
197
197
  }
198
- const { schedule: st, cancel: $n, state: It, steps: is } = /* @__PURE__ */ Qf(typeof requestAnimationFrame < "u" ? requestAnimationFrame : nn, !0);
198
+ const { schedule: at, cancel: $n, state: It, steps: is } = /* @__PURE__ */ Qf(typeof requestAnimationFrame < "u" ? requestAnimationFrame : nn, !0);
199
199
  let ro;
200
200
  function Mb() {
201
201
  ro = void 0;
@@ -397,7 +397,7 @@ function sh(e, t, n) {
397
397
  const ty = (e) => {
398
398
  const t = ({ timestamp: n }) => e(n);
399
399
  return {
400
- start: (n = !0) => st.update(t, n),
400
+ start: (n = !0) => at.update(t, n),
401
401
  stop: () => $n(t),
402
402
  /**
403
403
  * If we're processing this frame we can use the
@@ -980,7 +980,7 @@ class ul {
980
980
  this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...t], this.onComplete = n, this.name = r, this.motionValue = i, this.element = o, this.isAsync = s;
981
981
  }
982
982
  scheduleResolve() {
983
- this.state = "scheduled", this.isAsync ? (tr.add(this), fa || (fa = !0, st.read(dh), st.resolveKeyframes(uh))) : (this.readKeyframes(), this.complete());
983
+ this.state = "scheduled", this.isAsync ? (tr.add(this), fa || (fa = !0, at.read(dh), at.resolveKeyframes(uh))) : (this.readKeyframes(), this.complete());
984
984
  }
985
985
  readKeyframes() {
986
986
  const { unresolvedKeyframes: t, name: n, element: r, motionValue: i } = this;
@@ -1628,7 +1628,7 @@ class a0 {
1628
1628
  this.events[t] || (this.events[t] = new Xa());
1629
1629
  const r = this.events[t].add(n);
1630
1630
  return t === "change" ? () => {
1631
- r(), st.read(() => {
1631
+ r(), at.read(() => {
1632
1632
  this.events.change.getSize() || this.stop();
1633
1633
  });
1634
1634
  } : r;
@@ -2656,7 +2656,7 @@ class sx {
2656
2656
  this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
2657
2657
  }, this.renderScheduledAt = 0, this.scheduleRender = () => {
2658
2658
  const f = Ut.now();
2659
- this.renderScheduledAt < f && (this.renderScheduledAt = f, st.render(this.render, !1, !0));
2659
+ this.renderScheduledAt < f && (this.renderScheduledAt = f, at.render(this.render, !1, !0));
2660
2660
  };
2661
2661
  const { latestValues: l, renderState: c } = s;
2662
2662
  this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = t, this.props = n, this.presenceContext = r, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!o, this.isControllingVariants = Oo(n), this.isVariantNode = Mh(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
@@ -2692,7 +2692,7 @@ class sx {
2692
2692
  const r = $r.has(t);
2693
2693
  r && this.onBindTransform && this.onBindTransform();
2694
2694
  const i = n.on("change", (s) => {
2695
- this.latestValues[t] = s, this.props.onUpdate && st.preRender(this.notifyUpdate), r && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
2695
+ this.latestValues[t] = s, this.props.onUpdate && at.preRender(this.notifyUpdate), r && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
2696
2696
  });
2697
2697
  let o;
2698
2698
  window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, t, n)), this.valueSubscriptions.set(t, () => {
@@ -3047,7 +3047,7 @@ const Sl = (e, t, n, r = {}, i, o) => (s) => {
3047
3047
  if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (ma(u), u.delay === 0 && (d = !0)), (_n.instantAnimations || _n.skipAnimations) && (d = !0, ma(u), u.delay = 0), u.allowFlatten = !a.type && !a.ease, d && !o && t.get() !== void 0) {
3048
3048
  const f = bx(u.keyframes, a);
3049
3049
  if (f !== void 0) {
3050
- st.update(() => {
3050
+ at.update(() => {
3051
3051
  u.onUpdate(f), u.onComplete();
3052
3052
  });
3053
3053
  return;
@@ -3077,7 +3077,7 @@ function Xh(e, t, { delay: n = 0, transitionOverride: r, type: i } = {}) {
3077
3077
  if (window.MotionHandoffAnimation) {
3078
3078
  const y = Zh(e);
3079
3079
  if (y) {
3080
- const k = window.MotionHandoffAnimation(y, u, st);
3080
+ const k = window.MotionHandoffAnimation(y, u, at);
3081
3081
  k !== null && (h.startTime = k, p = !0);
3082
3082
  }
3083
3083
  }
@@ -3086,7 +3086,7 @@ function Xh(e, t, { delay: n = 0, transitionOverride: r, type: i } = {}) {
3086
3086
  x && l.push(x);
3087
3087
  }
3088
3088
  return s && Promise.all(l).then(() => {
3089
- st.update(() => {
3089
+ at.update(() => {
3090
3090
  s && px(e, s);
3091
3091
  });
3092
3092
  }), l;
@@ -3416,7 +3416,7 @@ class ip {
3416
3416
  const { onStart: y, onMove: k } = this.handlers;
3417
3417
  h || (y && y(this.lastMoveEvent, f), this.startEvent = this.lastMoveEvent), k && k(this.lastMoveEvent, f);
3418
3418
  }, this.handlePointerMove = (f, h) => {
3419
- this.lastMoveEvent = f, this.lastMoveEventInfo = fs(h, this.transformPagePoint), st.update(this.updatePoint, !0);
3419
+ this.lastMoveEvent = f, this.lastMoveEventInfo = fs(h, this.transformPagePoint), at.update(this.updatePoint, !0);
3420
3420
  }, this.handlePointerUp = (f, h) => {
3421
3421
  this.end();
3422
3422
  const { onEnd: g, onSessionEnd: p, resumeAnimation: x } = this.handlers;
@@ -3553,7 +3553,7 @@ class ew {
3553
3553
  }
3554
3554
  }
3555
3555
  this.originPoint[y] = k;
3556
- }), p && st.postRender(() => p(d, f)), va(this.visualElement, "transform");
3556
+ }), p && at.postRender(() => p(d, f)), va(this.visualElement, "transform");
3557
3557
  const { animationState: x } = this.visualElement;
3558
3558
  x && x.setActive("whileDrag", !0);
3559
3559
  }, a = (d, f) => {
@@ -3596,7 +3596,7 @@ class ew {
3596
3596
  const { velocity: s } = i;
3597
3597
  this.startAnimation(s);
3598
3598
  const { onDragEnd: a } = this.getProps();
3599
- a && st.postRender(() => a(r, i));
3599
+ a && at.postRender(() => a(r, i));
3600
3600
  }
3601
3601
  /**
3602
3602
  * @internal
@@ -3739,7 +3739,7 @@ class ew {
3739
3739
  const { dragConstraints: l } = this.getProps();
3740
3740
  kr(l) && l.current && (this.constraints = this.resolveRefConstraints());
3741
3741
  }, { projection: i } = this.visualElement, o = i.addEventListener("measure", r);
3742
- i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), st.read(r);
3742
+ i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), at.read(r);
3743
3743
  const s = bi(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
3744
3744
  this.isDragging && c && (Qt((u) => {
3745
3745
  const d = this.getAxisMotionValue(u);
@@ -3783,7 +3783,7 @@ class nw extends Hn {
3783
3783
  }
3784
3784
  }
3785
3785
  const uu = (e) => (t, n) => {
3786
- e && st.postRender(() => e(t, n));
3786
+ e && at.postRender(() => e(t, n));
3787
3787
  };
3788
3788
  class rw extends Hn {
3789
3789
  constructor() {
@@ -3802,7 +3802,7 @@ class rw extends Hn {
3802
3802
  onStart: uu(n),
3803
3803
  onMove: r,
3804
3804
  onEnd: (o, s) => {
3805
- delete this.session, i && st.postRender(() => i(o, s));
3805
+ delete this.session, i && at.postRender(() => i(o, s));
3806
3806
  }
3807
3807
  };
3808
3808
  }
@@ -3872,7 +3872,7 @@ class ow extends nb {
3872
3872
  }
3873
3873
  getSnapshotBeforeUpdate(t) {
3874
3874
  const { layoutDependency: n, visualElement: r, drag: i, isPresent: o } = this.props, { projection: s } = r;
3875
- return s && (s.isPresent = o, ps = !0, i || t.layoutDependency !== n || n === void 0 || t.isPresent !== o ? s.willUpdate() : this.safeToRemove(), t.isPresent !== o && (o ? s.promote() : s.relegate() || st.postRender(() => {
3875
+ return s && (s.isPresent = o, ps = !0, i || t.layoutDependency !== n || n === void 0 || t.isPresent !== o ? s.willUpdate() : this.safeToRemove(), t.isPresent !== o && (o ? s.promote() : s.relegate() || at.postRender(() => {
3876
3876
  const a = s.getStack();
3877
3877
  (!a || !a.members.length) && this.safeToRemove();
3878
3878
  }))), null;
@@ -3939,7 +3939,7 @@ function uw(e, t) {
3939
3939
  const o = i - n;
3940
3940
  o >= t && ($n(r), e(o - t));
3941
3941
  };
3942
- return st.setup(r, !0), () => $n(r);
3942
+ return at.setup(r, !0), () => $n(r);
3943
3943
  }
3944
3944
  const ap = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], dw = ap.length, fu = (e) => typeof e == "string" ? parseFloat(e) : e, hu = (e) => typeof e == "number" || xe.test(e);
3945
3945
  function fw(e, t, n, r, i, o) {
@@ -4088,7 +4088,7 @@ function dp(e) {
4088
4088
  const n = Zh(t);
4089
4089
  if (window.MotionHasOptimisedAnimation(n, "transform")) {
4090
4090
  const { layout: i, layoutId: o } = e.options;
4091
- window.MotionCancelOptimisedAnimation(n, "transform", st, !(i || o));
4091
+ window.MotionCancelOptimisedAnimation(n, "transform", at, !(i || o));
4092
4092
  }
4093
4093
  const { parent: r } = e;
4094
4094
  r && !r.hasCheckedOptimisedAppear && dp(r);
@@ -4126,7 +4126,7 @@ function fp({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
4126
4126
  if (c && !c.current && c.mount(s), this.root.nodes.add(this), this.parent && this.parent.children.add(this), this.root.hasTreeAnimated && (l || a) && (this.isLayoutDirty = !0), e) {
4127
4127
  let u, d = 0;
4128
4128
  const f = () => this.root.updateBlockedByResize = !1;
4129
- st.read(() => {
4129
+ at.read(() => {
4130
4130
  d = window.innerWidth;
4131
4131
  }), e(s, () => {
4132
4132
  const h = window.innerWidth;
@@ -4216,10 +4216,10 @@ function fp({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
4216
4216
  this.nodes.forEach(Tw), this.sharedNodes.forEach(Iw);
4217
4217
  }
4218
4218
  scheduleUpdateProjection() {
4219
- this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, st.preRender(this.updateProjection, !1, !0));
4219
+ this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, at.preRender(this.updateProjection, !1, !0));
4220
4220
  }
4221
4221
  scheduleCheckAfterUnmount() {
4222
- st.postRender(() => {
4222
+ at.postRender(() => {
4223
4223
  this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
4224
4224
  });
4225
4225
  }
@@ -4410,7 +4410,7 @@ function fp({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
4410
4410
  }
4411
4411
  startAnimation(s) {
4412
4412
  var a, l, c;
4413
- this.notifyListeners("animationStart"), (a = this.currentAnimation) == null || a.stop(), (c = (l = this.resumingFrom) == null ? void 0 : l.currentAnimation) == null || c.stop(), this.pendingAnimation && ($n(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = st.update(() => {
4413
+ this.notifyListeners("animationStart"), (a = this.currentAnimation) == null || a.stop(), (c = (l = this.resumingFrom) == null ? void 0 : l.currentAnimation) == null || c.stop(), this.pendingAnimation && ($n(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = at.update(() => {
4414
4414
  so.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = Mr(0)), this.currentAnimation = aw(this.motionValue, [0, 1e3], {
4415
4415
  ...s,
4416
4416
  velocity: 0,
@@ -4698,7 +4698,7 @@ function Ou(e, t, n) {
4698
4698
  const { props: r } = e;
4699
4699
  e.animationState && r.whileHover && e.animationState.setActive("whileHover", n === "Start");
4700
4700
  const i = "onHover" + n, o = r[i];
4701
- o && st.postRender(() => o(t, Si(t)));
4701
+ o && at.postRender(() => o(t, Si(t)));
4702
4702
  }
4703
4703
  class Vw extends Hn {
4704
4704
  mount() {
@@ -4736,7 +4736,7 @@ function Pu(e, t, n) {
4736
4736
  return;
4737
4737
  e.animationState && r.whileTap && e.animationState.setActive("whileTap", n === "Start");
4738
4738
  const i = "onTap" + (n === "End" ? "" : n), o = r[i];
4739
- o && st.postRender(() => o(t, Si(t)));
4739
+ o && at.postRender(() => o(t, Si(t)));
4740
4740
  }
4741
4741
  class Uw extends Hn {
4742
4742
  mount() {
@@ -8274,7 +8274,7 @@ const Kv = {
8274
8274
  vox: Yv,
8275
8275
  midnight: Zv
8276
8276
  };
8277
- function Tt(e) {
8277
+ function Rt(e) {
8278
8278
  return Vu[e] || Vu.vox;
8279
8279
  }
8280
8280
  function zu({ timeout: e }) {
@@ -8458,7 +8458,7 @@ function Jv({
8458
8458
  onEndChat: i,
8459
8459
  attachmentsEnabled: o = !0
8460
8460
  }) {
8461
- const [s, a] = P.useState(""), [l, c] = P.useState(!1), u = P.useRef(null), d = P.useRef(null), [f, h] = P.useState(!1), g = Tt(r);
8461
+ const [s, a] = P.useState(""), [l, c] = P.useState(!1), u = P.useRef(null), d = P.useRef(null), [f, h] = P.useState(!1), g = Rt(r);
8462
8462
  P.useEffect(() => {
8463
8463
  const v = () => {
8464
8464
  const _ = navigator.userAgent.toLowerCase(), N = ["android", "iphone", "ipad", "mobile", "tablet"].some((R) => _.includes(R)), O = "ontouchstart" in window || navigator.maxTouchPoints > 0, b = window.innerWidth <= 768;
@@ -8644,7 +8644,7 @@ function nE(e) {
8644
8644
  return parseFloat((e / Math.pow(t, r)).toFixed(2)) + " " + n[r];
8645
8645
  }
8646
8646
  function rE({ message: e, theme: t, isOwn: n }) {
8647
- const r = Tt(t), i = e.metadata, o = (i == null ? void 0 : i.fileName) || "Unknown file", s = (i == null ? void 0 : i.fileSize) || 0, a = (i == null ? void 0 : i.mimeType) || "application/octet-stream", l = i == null ? void 0 : i.downloading, c = i == null ? void 0 : i.uploading, u = (i == null ? void 0 : i.downloadProgress) || 0, d = (i == null ? void 0 : i.uploadProgress) || 0, f = i == null ? void 0 : i.downloadUrl, h = i == null ? void 0 : i.file, g = tE(a), p = l || c, x = l ? u : d, y = l ? "Downloading..." : c ? "Uploading..." : "Complete", [k, E] = P.useState(null);
8647
+ const r = Rt(t), i = e.metadata, o = (i == null ? void 0 : i.fileName) || "Unknown file", s = (i == null ? void 0 : i.fileSize) || 0, a = (i == null ? void 0 : i.mimeType) || "application/octet-stream", l = i == null ? void 0 : i.downloading, c = i == null ? void 0 : i.uploading, u = (i == null ? void 0 : i.downloadProgress) || 0, d = (i == null ? void 0 : i.uploadProgress) || 0, f = i == null ? void 0 : i.downloadUrl, h = i == null ? void 0 : i.file, g = tE(a), p = l || c, x = l ? u : d, y = l ? "Downloading..." : c ? "Uploading..." : "Complete", [k, E] = P.useState(null);
8648
8648
  P.useEffect(() => {
8649
8649
  if (f)
8650
8650
  E(f);
@@ -12899,7 +12899,7 @@ function XS(e) {
12899
12899
  image: o(ve),
12900
12900
  label: s,
12901
12901
  link: o(ke),
12902
- listItem: o(Nt),
12902
+ listItem: o(Tt),
12903
12903
  listItemValue: f,
12904
12904
  listOrdered: o(ut, d),
12905
12905
  listUnordered: o(ut),
@@ -13019,16 +13019,16 @@ function XS(e) {
13019
13019
  function i(z, Q, ye) {
13020
13020
  let Te = Q - 1, De = -1, Ot = !1, re, $e, Ze, Xe;
13021
13021
  for (; ++Te <= ye; ) {
13022
- const At = z[Te];
13023
- switch (At[1].type) {
13022
+ const Nt = z[Te];
13023
+ switch (Nt[1].type) {
13024
13024
  case "listUnordered":
13025
13025
  case "listOrdered":
13026
13026
  case "blockQuote": {
13027
- At[0] === "enter" ? De++ : De--, Xe = void 0;
13027
+ Nt[0] === "enter" ? De++ : De--, Xe = void 0;
13028
13028
  break;
13029
13029
  }
13030
13030
  case "lineEndingBlank": {
13031
- At[0] === "enter" && (re && !Xe && !De && !Ze && (Ze = Te), Xe = void 0);
13031
+ Nt[0] === "enter" && (re && !Xe && !De && !Ze && (Ze = Te), Xe = void 0);
13032
13032
  break;
13033
13033
  }
13034
13034
  case "linePrefix":
@@ -13040,7 +13040,7 @@ function XS(e) {
13040
13040
  default:
13041
13041
  Xe = void 0;
13042
13042
  }
13043
- if (!De && At[0] === "enter" && At[1].type === "listItemPrefix" || De === -1 && At[0] === "exit" && (At[1].type === "listUnordered" || At[1].type === "listOrdered")) {
13043
+ if (!De && Nt[0] === "enter" && Nt[1].type === "listItemPrefix" || De === -1 && Nt[0] === "exit" && (Nt[1].type === "listUnordered" || Nt[1].type === "listOrdered")) {
13044
13044
  if (re) {
13045
13045
  let Mn = Te;
13046
13046
  for ($e = void 0; Mn--; ) {
@@ -13050,17 +13050,17 @@ function XS(e) {
13050
13050
  $e && (z[$e][1].type = "lineEndingBlank", Ot = !0), jt[1].type = "lineEnding", $e = Mn;
13051
13051
  } else if (!(jt[1].type === "linePrefix" || jt[1].type === "blockQuotePrefix" || jt[1].type === "blockQuotePrefixWhitespace" || jt[1].type === "blockQuoteMarker" || jt[1].type === "listItemIndent")) break;
13052
13052
  }
13053
- Ze && (!$e || Ze < $e) && (re._spread = !0), re.end = Object.assign({}, $e ? z[$e][1].start : At[1].end), z.splice($e || Te, 0, ["exit", re, At[2]]), Te++, ye++;
13053
+ Ze && (!$e || Ze < $e) && (re._spread = !0), re.end = Object.assign({}, $e ? z[$e][1].start : Nt[1].end), z.splice($e || Te, 0, ["exit", re, Nt[2]]), Te++, ye++;
13054
13054
  }
13055
- if (At[1].type === "listItemPrefix") {
13055
+ if (Nt[1].type === "listItemPrefix") {
13056
13056
  const Mn = {
13057
13057
  type: "listItem",
13058
13058
  _spread: !1,
13059
- start: Object.assign({}, At[1].start),
13059
+ start: Object.assign({}, Nt[1].start),
13060
13060
  // @ts-expect-error: we’ll add `end` in a second.
13061
13061
  end: void 0
13062
13062
  };
13063
- re = Mn, z.splice(Te, 0, ["enter", Mn, At[2]]), Te++, ye++, Ze = void 0, Xe = !0;
13063
+ re = Mn, z.splice(Te, 0, ["enter", Mn, Nt[2]]), Te++, ye++, Ze = void 0, Xe = !0;
13064
13064
  }
13065
13065
  }
13066
13066
  }
@@ -13349,7 +13349,7 @@ function XS(e) {
13349
13349
  children: []
13350
13350
  };
13351
13351
  }
13352
- function Nt(z) {
13352
+ function Tt(z) {
13353
13353
  return {
13354
13354
  type: "listItem",
13355
13355
  spread: z._spread,
@@ -30885,11 +30885,11 @@ function fA() {
30885
30885
  function pt(mt, he) {
30886
30886
  G && (he = he.map((ue) => ue.toLowerCase())), he.forEach(function(ue) {
30887
30887
  const Se = ue.split("|");
30888
- _e[Se[0]] = [mt, Nt(Se[0], Se[1])];
30888
+ _e[Se[0]] = [mt, Tt(Se[0], Se[1])];
30889
30889
  });
30890
30890
  }
30891
30891
  }
30892
- function Nt(T, G) {
30892
+ function Tt(T, G) {
30893
30893
  return G ? Number(G) : Ye(T) ? 0 : 1;
30894
30894
  }
30895
30895
  function Ye(T) {
@@ -30959,8 +30959,8 @@ function fA() {
30959
30959
  const Se = this.matcherRe.exec(ue);
30960
30960
  if (!Se)
30961
30961
  return null;
30962
- const Rt = Se.findIndex((Wr, Qo) => Qo > 0 && Wr !== void 0), xt = this.matchIndexes[Rt];
30963
- return Se.splice(0, Rt), Object.assign(Se, xt);
30962
+ const At = Se.findIndex((Wr, Qo) => Qo > 0 && Wr !== void 0), xt = this.matchIndexes[At];
30963
+ return Se.splice(0, At), Object.assign(Se, xt);
30964
30964
  }
30965
30965
  }
30966
30966
  class _e {
@@ -30971,7 +30971,7 @@ function fA() {
30971
30971
  getMatcher(ue) {
30972
30972
  if (this.multiRegexes[ue]) return this.multiRegexes[ue];
30973
30973
  const Se = new ie();
30974
- return this.rules.slice(ue).forEach(([Rt, xt]) => Se.addRule(Rt, xt)), Se.compile(), this.multiRegexes[ue] = Se, Se;
30974
+ return this.rules.slice(ue).forEach(([At, xt]) => Se.addRule(At, xt)), Se.compile(), this.multiRegexes[ue] = Se, Se;
30975
30975
  }
30976
30976
  resumingScanAtSamePosition() {
30977
30977
  return this.regexIndex !== 0;
@@ -30987,12 +30987,12 @@ function fA() {
30987
30987
  exec(ue) {
30988
30988
  const Se = this.getMatcher(this.regexIndex);
30989
30989
  Se.lastIndex = this.lastIndex;
30990
- let Rt = Se.exec(ue);
30991
- if (this.resumingScanAtSamePosition() && !(Rt && Rt.index === this.lastIndex)) {
30990
+ let At = Se.exec(ue);
30991
+ if (this.resumingScanAtSamePosition() && !(At && At.index === this.lastIndex)) {
30992
30992
  const xt = this.getMatcher(0);
30993
- xt.lastIndex = this.lastIndex + 1, Rt = xt.exec(ue);
30993
+ xt.lastIndex = this.lastIndex + 1, At = xt.exec(ue);
30994
30994
  }
30995
- return Rt && (this.regexIndex += Rt.position + 1, this.regexIndex === this.count && this.considerAll()), Rt;
30995
+ return At && (this.regexIndex += At.position + 1, this.regexIndex === this.count && this.considerAll()), At;
30996
30996
  }
30997
30997
  }
30998
30998
  function pt(he) {
@@ -31020,8 +31020,8 @@ function fA() {
31020
31020
  // default to 1 relevance if not specified
31021
31021
  oe
31022
31022
  ].forEach((xt) => xt(he, ue)), he.isCompiled = !0;
31023
- let Rt = null;
31024
- return typeof he.keywords == "object" && he.keywords.$pattern && (he.keywords = Object.assign({}, he.keywords), Rt = he.keywords.$pattern, delete he.keywords.$pattern), Rt = Rt || /\w+/, he.keywords && (he.keywords = ut(he.keywords, T.case_insensitive)), Se.keywordPatternRe = G(Rt, !0), ue && (he.begin || (he.begin = /\B|\b/), Se.beginRe = G(Se.begin), !he.end && !he.endsWithParent && (he.end = /\B|\b/), he.end && (Se.endRe = G(Se.end)), Se.terminatorEnd = d(Se.end) || "", he.endsWithParent && ue.terminatorEnd && (Se.terminatorEnd += (he.end ? "|" : "") + ue.terminatorEnd)), he.illegal && (Se.illegalRe = G(
31023
+ let At = null;
31024
+ return typeof he.keywords == "object" && he.keywords.$pattern && (he.keywords = Object.assign({}, he.keywords), At = he.keywords.$pattern, delete he.keywords.$pattern), At = At || /\w+/, he.keywords && (he.keywords = ut(he.keywords, T.case_insensitive)), Se.keywordPatternRe = G(At, !0), ue && (he.begin || (he.begin = /\B|\b/), Se.beginRe = G(Se.begin), !he.end && !he.endsWithParent && (he.end = /\B|\b/), he.end && (Se.endRe = G(Se.end)), Se.terminatorEnd = d(Se.end) || "", he.endsWithParent && ue.terminatorEnd && (Se.terminatorEnd += (he.end ? "|" : "") + ue.terminatorEnd)), he.illegal && (Se.illegalRe = G(
31025
31025
  /** @type {RegExp | string} */
31026
31026
  he.illegal
31027
31027
  )), he.contains || (he.contains = []), he.contains = [].concat(...he.contains.map(function(xt) {
@@ -31049,7 +31049,7 @@ function fA() {
31049
31049
  return r(T, { variants: null }, G);
31050
31050
  })), T.cachedVariants ? T.cachedVariants : Ze(T) ? r(T, { starts: T.starts ? r(T.starts) : null }) : Object.isFrozen(T) ? r(T) : T;
31051
31051
  }
31052
- var At = "11.11.1";
31052
+ var Nt = "11.11.1";
31053
31053
  class Mn extends Error {
31054
31054
  constructor(G, ie) {
31055
31055
  super(G), this.name = "HTMLInjectionError", this.html = ie;
@@ -31074,7 +31074,7 @@ function fA() {
31074
31074
  function Se(J) {
31075
31075
  return ue.noHighlightRe.test(J);
31076
31076
  }
31077
- function Rt(J) {
31077
+ function At(J) {
31078
31078
  let me = J.className + " ";
31079
31079
  me += J.parentNode ? J.parentNode.className : "";
31080
31080
  const Pe = ue.languageDetectRe.exec(me);
@@ -31325,7 +31325,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), kt = J, nt = me), Pe
31325
31325
  }
31326
31326
  function es(J) {
31327
31327
  let me = null;
31328
- const Pe = Rt(J);
31328
+ const Pe = At(J);
31329
31329
  if (Se(Pe)) return;
31330
31330
  if (Ii(
31331
31331
  "before:highlightElement",
@@ -31454,7 +31454,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), kt = J, nt = me), Pe
31454
31454
  pt = !1;
31455
31455
  }, T.safeMode = function() {
31456
31456
  pt = !0;
31457
- }, T.versionString = At, T.regex = {
31457
+ }, T.versionString = Nt, T.regex = {
31458
31458
  concat: p,
31459
31459
  lookahead: f,
31460
31460
  either: y,
@@ -31712,7 +31712,7 @@ function wA(e) {
31712
31712
  }
31713
31713
  function vA({ message: e, theme: t, isOwn: n, isStreaming: r = !1 }) {
31714
31714
  var c, u;
31715
- const i = Tt(t), o = e.sender.name ? e.sender.name.split(" ").map((d) => d[0]).join("").toUpperCase().slice(0, 2) : "U", s = P.useMemo(() => {
31715
+ const i = Rt(t), o = e.sender.name ? e.sender.name.split(" ").map((d) => d[0]).join("").toUpperCase().slice(0, 2) : "U", s = P.useMemo(() => {
31716
31716
  var d, f;
31717
31717
  return ((d = e == null ? void 0 : e.metadata) == null ? void 0 : d.format) === "markdown" || ((f = e == null ? void 0 : e.metadata) == null ? void 0 : f.markdown) === !0 || sE(e.content);
31718
31718
  }, [e.content, e.metadata]), a = P.useMemo(() => s ? aE(e.content) : e.content, [e.content, s]), l = P.useMemo(() => iE(t), [t]);
@@ -31762,7 +31762,7 @@ function vA({ message: e, theme: t, isOwn: n, isStreaming: r = !1 }) {
31762
31762
  ] }) });
31763
31763
  }
31764
31764
  function EA({ theme: e }) {
31765
- const t = Tt(e);
31765
+ const t = Rt(e);
31766
31766
  return /* @__PURE__ */ m("div", { className: "flex w-full justify-start mb-4 px-1", children: /* @__PURE__ */ A("div", { className: "relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0", children: [
31767
31767
  /* @__PURE__ */ m(
31768
31768
  "div",
@@ -31947,7 +31947,7 @@ function Yl({
31947
31947
  smartScrollToBottom: O,
31948
31948
  handleScroll: b,
31949
31949
  scrollToBottom: R
31950
- } = AA(), { isMobile: I, isFullscreen: $, setIsFullscreen: F } = RA(), [q, ne] = P.useState(/* @__PURE__ */ new Set()), [ee, V] = P.useState([]), D = Tt(t);
31950
+ } = AA(), { isMobile: I, isFullscreen: $, setIsFullscreen: F } = RA(), [q, ne] = P.useState(/* @__PURE__ */ new Set()), [ee, V] = P.useState([]), D = Rt(t);
31951
31951
  P.useEffect(() => ($ && I && (document.body.style.overflow = "hidden", document.body.style.position = "fixed", document.body.style.width = "100%", document.body.style.height = "100%", document.documentElement.requestFullscreen && document.documentElement.requestFullscreen().catch(console.log)), () => {
31952
31952
  $ && I && (document.body.style.overflow = "unset", document.body.style.position = "unset", document.body.style.width = "unset", document.body.style.height = "unset", document.fullscreenElement && document.exitFullscreen().catch(console.log));
31953
31953
  }), [$, I]);
@@ -32028,8 +32028,8 @@ function Yl({
32028
32028
  const ke = le.content.length * 35 + 1e3;
32029
32029
  setTimeout(() => {
32030
32030
  p((ut) => {
32031
- const Nt = new Set(ut);
32032
- return Nt.delete(le.id), Nt;
32031
+ const Tt = new Set(ut);
32032
+ return Tt.delete(le.id), Tt;
32033
32033
  });
32034
32034
  }, ke);
32035
32035
  }
@@ -32075,8 +32075,8 @@ function Yl({
32075
32075
  if (console.log("ChatView: RPC interaction completed:", oe), v(null), x.length > 0 && (console.log("ChatView: Processing", x.length, "queued messages"), f((be) => {
32076
32076
  const ve = [...be];
32077
32077
  return x.forEach((ke) => {
32078
- var Nt;
32079
- if (!ve.some((Ye) => Ye.id === ke.id) && (console.log("ChatView: Adding queued message:", ke.id), ve.push(ke), ke.sender.type === "agent" && (p((Ye) => new Set(Ye).add(ke.id)), !((Nt = ke.metadata) != null && Nt.streaming)))) {
32078
+ var Tt;
32079
+ if (!ve.some((Ye) => Ye.id === ke.id) && (console.log("ChatView: Adding queued message:", ke.id), ve.push(ke), ke.sender.type === "agent" && (p((Ye) => new Set(Ye).add(ke.id)), !((Tt = ke.metadata) != null && Tt.streaming)))) {
32080
32080
  const Ye = ke.content.length * 35 + 1e3;
32081
32081
  setTimeout(() => {
32082
32082
  p((dt) => {
@@ -32094,7 +32094,7 @@ function Yl({
32094
32094
  const ke = [...ve].reverse().findIndex((dt) => dt.sender.type === "participant");
32095
32095
  let ut = ve.length;
32096
32096
  ke !== -1 && (ut = ve.length - ke);
32097
- const Nt = {
32097
+ const Tt = {
32098
32098
  id: `success_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
32099
32099
  content: "",
32100
32100
  timestamp: /* @__PURE__ */ new Date(),
@@ -32108,9 +32108,9 @@ function Yl({
32108
32108
  view: be || /* @__PURE__ */ m(kA, {})
32109
32109
  }
32110
32110
  };
32111
- e && typeof e.addChatMessage == "function" && e.addChatMessage(Nt);
32111
+ e && typeof e.addChatMessage == "function" && e.addChatMessage(Tt);
32112
32112
  const Ye = [...ve];
32113
- return Ye.splice(ut, 0, Nt), Ye;
32113
+ return Ye.splice(ut, 0, Tt), Ye;
32114
32114
  });
32115
32115
  }
32116
32116
  }, Ee = async (oe) => {
@@ -32155,8 +32155,8 @@ function Yl({
32155
32155
  console.log("ChatView: RPC interaction dismissed:", oe), console.log("ChatView: Current interaction before dismiss:", C == null ? void 0 : C.methodName), v(null), x.length > 0 && (console.log("ChatView: Processing", x.length, "queued messages after dismissal"), f((be) => {
32156
32156
  const ve = [...be];
32157
32157
  return x.forEach((ke) => {
32158
- var Nt;
32159
- if (!ve.some((Ye) => Ye.id === ke.id) && (ve.push(ke), ke.sender.type === "agent" && (p((Ye) => new Set(Ye).add(ke.id)), !((Nt = ke.metadata) != null && Nt.streaming)))) {
32158
+ var Tt;
32159
+ if (!ve.some((Ye) => Ye.id === ke.id) && (ve.push(ke), ke.sender.type === "agent" && (p((Ye) => new Set(Ye).add(ke.id)), !((Tt = ke.metadata) != null && Tt.streaming)))) {
32160
32160
  const Ye = ke.content.length * 35 + 1e3;
32161
32161
  setTimeout(() => {
32162
32162
  p((dt) => {
@@ -32485,7 +32485,7 @@ const Qm = Fe.forwardRef(({
32485
32485
  Z.disconnect(), window.removeEventListener("resize", H);
32486
32486
  };
32487
32487
  }, []), Xv();
32488
- const { agent: { isActive: O = !1 } = {} } = o ? _l(o) : { agent: { isActive: !1 } }, b = ao(o, "microphone"), R = Tt(i), I = Fe.useMemo(() => o != null && o.getCurrentSession ? !!o.getCurrentSession() : !1, [o]), $ = Fe.useMemo(() => o != null && o.getIsAgentConnected && o.getIsAgentConnected() || h, [o, h]), F = O || $;
32488
+ const { agent: { isActive: O = !1 } = {} } = o ? _l(o) : { agent: { isActive: !1 } }, b = ao(o, "microphone"), R = Rt(i), I = Fe.useMemo(() => o != null && o.getCurrentSession ? !!o.getCurrentSession() : !1, [o]), $ = Fe.useMemo(() => o != null && o.getIsAgentConnected && o.getIsAgentConnected() || h, [o, h]), F = O || $;
32489
32489
  Fe.useEffect(() => {
32490
32490
  F && y && k(!1);
32491
32491
  }, [F, y]), Fe.useEffect(() => {
@@ -32635,7 +32635,7 @@ function MA({
32635
32635
  disabled: a
32636
32636
  }) {
32637
32637
  var c, u, d, f, h;
32638
- const l = Tt(r);
32638
+ const l = Rt(r);
32639
32639
  return /* @__PURE__ */ A("div", { className: et(
32640
32640
  "flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",
32641
32641
  r === "light" ? "bg-white/95 border-gray-200" : "bg-gray-900/90 border-gray-700"
@@ -32690,7 +32690,7 @@ function IA({
32690
32690
  userVideoEnabled: g = !0,
32691
32691
  screenshareEnabled: p = !0
32692
32692
  }) {
32693
- const x = Tt(o);
32693
+ const x = Rt(o);
32694
32694
  return /* @__PURE__ */ A("div", { className: et(
32695
32695
  "flex items-center justify-center gap-3 px-3 py-2 w-full backdrop-blur-xl border-t",
32696
32696
  o === "light" ? "bg-white/95 border-gray-200" : "bg-gray-900/90 border-gray-700"
@@ -32749,7 +32749,7 @@ function IA({
32749
32749
  }
32750
32750
  function Hd({ trackRef: e, participant: t, isLocal: n = !1, className: r = "", theme: i }) {
32751
32751
  var l;
32752
- const o = Tt(i), s = (t == null ? void 0 : t.name) || (t == null ? void 0 : t.identity) || (n ? "You" : "Participant"), a = (e == null ? void 0 : e.publication) && !e.publication.isMuted;
32752
+ const o = Rt(i), s = (t == null ? void 0 : t.name) || (t == null ? void 0 : t.identity) || (n ? "You" : "Participant"), a = (e == null ? void 0 : e.publication) && !e.publication.isMuted;
32753
32753
  return /* @__PURE__ */ A("div", { className: `relative rounded-lg overflow-hidden ${o.video.tile} ${r}`, children: [
32754
32754
  a ? /* @__PURE__ */ m(
32755
32755
  Ao,
@@ -32771,7 +32771,7 @@ function OA({
32771
32771
  onEndCall: o
32772
32772
  }) {
32773
32773
  var j;
32774
- const s = Tt(t), [a, l] = P.useState(!1), [c, u] = P.useState(!1), d = P.useMemo(() => {
32774
+ const s = Rt(t), [a, l] = P.useState(!1), [c, u] = P.useState(!1), d = P.useMemo(() => {
32775
32775
  const H = e.getCurrentAgentInfo();
32776
32776
  return Tl(H);
32777
32777
  }, [e]), { userVideoEnabled: f, agentAvatarEnabled: h, screenshareEnabled: g } = P.useMemo(
@@ -35962,10 +35962,10 @@ function PM(e, t) {
35962
35962
  });
35963
35963
  }
35964
35964
  const DM = 0.2, LM = 0.14, FM = 0.12;
35965
- function ot(...e) {
35965
+ function st(...e) {
35966
35966
  return [`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${DM})`, `${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${LM})`, `${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${FM})`].join(",");
35967
35967
  }
35968
- const BM = ["none", ot(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), ot(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), ot(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), ot(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), ot(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), ot(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), ot(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), ot(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), ot(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), ot(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), ot(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), ot(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), ot(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), ot(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), ot(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), ot(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), ot(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), ot(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), ot(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), ot(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), ot(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), ot(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), ot(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), ot(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)], $M = {
35968
+ const BM = ["none", st(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), st(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), st(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), st(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), st(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), st(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), st(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), st(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), st(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), st(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), st(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), st(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), st(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), st(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), st(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), st(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), st(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), st(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), st(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), st(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), st(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), st(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), st(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), st(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)], $M = {
35969
35969
  // This is the most common easing curve.
35970
35970
  easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
35971
35971
  // Objects enter the screen at full velocity from off-screen and
@@ -36664,7 +36664,7 @@ const gg = ic(/* @__PURE__ */ m("path", {
36664
36664
  d: "M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"
36665
36665
  }), "Videocam");
36666
36666
  function no({ onClick: e, disabled: t, theme: n }) {
36667
- const r = Tt(n);
36667
+ const r = Rt(n);
36668
36668
  return /* @__PURE__ */ m(
36669
36669
  "button",
36670
36670
  {
@@ -36678,7 +36678,7 @@ function no({ onClick: e, disabled: t, theme: n }) {
36678
36678
  );
36679
36679
  }
36680
36680
  function Xs({ onClick: e, disabled: t, theme: n }) {
36681
- const r = Tt(n);
36681
+ const r = Rt(n);
36682
36682
  return /* @__PURE__ */ m(
36683
36683
  "button",
36684
36684
  {
@@ -36692,7 +36692,7 @@ function Xs({ onClick: e, disabled: t, theme: n }) {
36692
36692
  );
36693
36693
  }
36694
36694
  function Qs({ onClick: e, disabled: t, theme: n }) {
36695
- const r = Tt(n);
36695
+ const r = Rt(n);
36696
36696
  return /* @__PURE__ */ m(
36697
36697
  "button",
36698
36698
  {
@@ -36706,7 +36706,7 @@ function Qs({ onClick: e, disabled: t, theme: n }) {
36706
36706
  );
36707
36707
  }
36708
36708
  function fI({ prompts: e, theme: t }) {
36709
- const n = Tt(t), [r, i] = we(0);
36709
+ const n = Rt(t), [r, i] = we(0);
36710
36710
  return Ct(() => {
36711
36711
  const o = setInterval(() => {
36712
36712
  i((s) => (s + 1) % e.length);
@@ -36727,7 +36727,7 @@ function fI({ prompts: e, theme: t }) {
36727
36727
  )) });
36728
36728
  }
36729
36729
  function hI({ statusMessage: e, theme: t }) {
36730
- const n = Tt(t);
36730
+ const n = Rt(t);
36731
36731
  return /* @__PURE__ */ A("div", { className: "z-10 flex items-center space-x-2 mt-2 pb-2", children: [
36732
36732
  /* @__PURE__ */ m("div", { className: n.statusIndicator }),
36733
36733
  /* @__PURE__ */ m("span", { className: `text-xs ${n.text.muted}`, children: e })
@@ -36751,7 +36751,7 @@ const xg = Fe.forwardRef(({
36751
36751
  theme: l = "vox",
36752
36752
  modalities: c = ["voice", "chat", "video"]
36753
36753
  }, u) => {
36754
- const d = Tt(l), f = c.includes("voice"), h = c.includes("chat"), g = c.includes("video"), p = [f, h, g].filter(Boolean).length;
36754
+ const d = Rt(l), f = c.includes("voice"), h = c.includes("chat"), g = c.includes("video"), p = [f, h, g].filter(Boolean).length;
36755
36755
  return /* @__PURE__ */ A("div", { className: "flex p-8 flex-col items-center h-full justify-center w-full relative", "aria-disabled": e, style: { background: "transparent" }, children: [
36756
36756
  /* @__PURE__ */ A("div", { className: "mt-1 relative flex items-center justify-center mb-8 w-full", style: { minHeight: "120px" }, children: [
36757
36757
  /* @__PURE__ */ A("div", { className: "absolute inset-0 flex items-center justify-center", children: [
@@ -36832,7 +36832,53 @@ class wg extends P.Component {
36832
36832
  return this.props.children;
36833
36833
  }
36834
36834
  }
36835
- function pI({
36835
+ const pI = ({
36836
+ onClick: e,
36837
+ position: t = "bottom-right",
36838
+ size: n = 64,
36839
+ className: r = "",
36840
+ style: i,
36841
+ ariaLabel: o = "Open Voxket",
36842
+ logoScale: s = 0.95
36843
+ }) => {
36844
+ const a = {
36845
+ "top-left": "top-4 left-4",
36846
+ "top-right": "top-4 right-4",
36847
+ "bottom-left": "bottom-4 left-4",
36848
+ "bottom-right": "bottom-4 right-4"
36849
+ }, l = {
36850
+ width: n,
36851
+ height: n,
36852
+ ...i
36853
+ };
36854
+ return /* @__PURE__ */ m(
36855
+ Ae.button,
36856
+ {
36857
+ type: "button",
36858
+ onClick: e,
36859
+ "aria-label": o,
36860
+ className: `fixed z-50 rounded-full bg-black shadow-xl flex items-center justify-center overflow-hidden focus:outline-none focus:ring-2 focus:ring-white/40 ${a[t]} ${r}`,
36861
+ style: l,
36862
+ initial: { scale: 0.9, opacity: 0 },
36863
+ animate: { scale: 1, opacity: 1 },
36864
+ exit: { scale: 0.9, opacity: 0 },
36865
+ whileHover: { scale: 1.05 },
36866
+ whileTap: { scale: 0.95 },
36867
+ "data-position": t,
36868
+ children: /* @__PURE__ */ m(
36869
+ "img",
36870
+ {
36871
+ src: "/logo.png",
36872
+ alt: "Voxket",
36873
+ className: "object-contain select-none pointer-events-none",
36874
+ style: { width: `${Math.max(0, Math.min(1, s)) * 100}%`, height: `${Math.max(0, Math.min(1, s)) * 100}%` },
36875
+ draggable: !1
36876
+ }
36877
+ )
36878
+ }
36879
+ );
36880
+ };
36881
+ function mI({
36836
36882
  room: e,
36837
36883
  onSessionEnd: t,
36838
36884
  onSessionStart: n,
@@ -36930,7 +36976,7 @@ function pI({
36930
36976
  }
36931
36977
  class vg {
36932
36978
  constructor() {
36933
- at(this, "listeners", {});
36979
+ ot(this, "listeners", {});
36934
36980
  }
36935
36981
  /**
36936
36982
  * Add an event listener
@@ -36990,11 +37036,11 @@ class vg {
36990
37036
  return Object.keys(this.listeners);
36991
37037
  }
36992
37038
  }
36993
- class mI {
37039
+ class gI {
36994
37040
  constructor(t) {
36995
- at(this, "plugins", /* @__PURE__ */ new Map());
36996
- at(this, "installedPlugins", /* @__PURE__ */ new Set());
36997
- at(this, "context");
37041
+ ot(this, "plugins", /* @__PURE__ */ new Map());
37042
+ ot(this, "installedPlugins", /* @__PURE__ */ new Set());
37043
+ ot(this, "context");
36998
37044
  this.context = {
36999
37045
  client: t,
37000
37046
  emit: t.emit.bind(t),
@@ -37263,13 +37309,13 @@ function Rn() {
37263
37309
  throw new Error("useVoxket must be used within a VoxketProvider");
37264
37310
  return e;
37265
37311
  }
37266
- class gI extends vg {
37312
+ class bI extends vg {
37267
37313
  constructor(n) {
37268
37314
  super();
37269
- at(this, "room", null);
37270
- at(this, "registeredMethods", /* @__PURE__ */ new Map());
37271
- at(this, "activeInteractions", /* @__PURE__ */ new Map());
37272
- at(this, "currentInteraction", null);
37315
+ ot(this, "room", null);
37316
+ ot(this, "registeredMethods", /* @__PURE__ */ new Map());
37317
+ ot(this, "activeInteractions", /* @__PURE__ */ new Map());
37318
+ ot(this, "currentInteraction", null);
37273
37319
  n && this.setRoom(n);
37274
37320
  }
37275
37321
  /**
@@ -37450,29 +37496,30 @@ class Ge extends Error {
37450
37496
  }
37451
37497
  const Ln = /* @__PURE__ */ new WeakSet(), ea = /* @__PURE__ */ new WeakSet();
37452
37498
  class oc extends vg {
37453
- // Track agent state
37454
37499
  constructor(n) {
37455
37500
  super();
37456
- at(this, "config");
37457
- at(this, "room", null);
37458
- at(this, "pluginManager");
37459
- at(this, "rpcManager");
37460
- at(this, "isConnected", !1);
37461
- at(this, "currentSession", null);
37462
- at(this, "connectionState", br.Disconnected);
37463
- at(this, "renderedComponents", /* @__PURE__ */ new Map());
37464
- at(this, "textStreamHandlersRegistered", !1);
37501
+ ot(this, "config");
37502
+ ot(this, "room", null);
37503
+ ot(this, "pluginManager");
37504
+ ot(this, "rpcManager");
37505
+ ot(this, "isConnected", !1);
37506
+ ot(this, "currentSession", null);
37507
+ ot(this, "connectionState", br.Disconnected);
37508
+ ot(this, "renderedComponents", /* @__PURE__ */ new Map());
37509
+ ot(this, "textStreamHandlersRegistered", !1);
37465
37510
  // Track if handlers are already registered
37466
- at(this, "currentAgentInfo", null);
37511
+ ot(this, "currentAgentInfo", null);
37467
37512
  // Store current agent information
37468
- at(this, "chatMessages", []);
37513
+ ot(this, "chatMessages", []);
37469
37514
  // Store chat messages for persistence across UI changes
37470
37515
  // Track active transcriptions to prevent duplicates within time windows
37471
- at(this, "activeTranscriptions", /* @__PURE__ */ new Map());
37472
- at(this, "isAgentConnected", !1);
37516
+ ot(this, "activeTranscriptions", /* @__PURE__ */ new Map());
37517
+ ot(this, "isAgentConnected", !1);
37473
37518
  // Track if agent is actually connected and responding
37474
- at(this, "agentState", "idle");
37475
- this.config = n, this.pluginManager = new mI(this), this.rpcManager = new gI(), this.setupEventListeners(), this.initializeClient();
37519
+ ot(this, "agentState", "idle");
37520
+ // Track agent state
37521
+ ot(this, "_eventEmitters", /* @__PURE__ */ new Map());
37522
+ this.config = n, this.pluginManager = new gI(this), this.rpcManager = new bI(), this.setupEventListeners(), this.initializeClient();
37476
37523
  }
37477
37524
  setupEventListeners() {
37478
37525
  this.on("connection.connected", () => {
@@ -37854,7 +37901,15 @@ class oc extends vg {
37854
37901
  var o;
37855
37902
  try {
37856
37903
  const s = await r.readAll(), a = ((o = r.info) == null ? void 0 : o.topic) || "unknown";
37857
- console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`, s), this.emit("text.stream.unhandled", { topic: a, data: s, participantInfo: i });
37904
+ if (this._eventEmitters.has(a)) {
37905
+ const l = this._eventEmitters.get(a);
37906
+ try {
37907
+ l(s), console.log(`📝 VoxketClient: Processed custom topic '${a}' via event emitter`);
37908
+ } catch (c) {
37909
+ console.error(`VoxketClient: Error in custom handler for topic '${a}':`, c);
37910
+ }
37911
+ } else
37912
+ console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`, s), this.emit("text.stream.unhandled", { topic: a, data: s, participantInfo: i });
37858
37913
  } catch (s) {
37859
37914
  console.error("VoxketClient: Failed to process unhandled text stream:", s);
37860
37915
  }
@@ -38826,19 +38881,32 @@ class oc extends vg {
38826
38881
  registerEventEmitter(n, r) {
38827
38882
  if (!this.room)
38828
38883
  throw new Error("Room not available");
38884
+ this._eventEmitters.set(n, r), console.log(`📝 VoxketClient: Stored handler for topic '${n}' in event emitters map`);
38829
38885
  try {
38830
38886
  this.room.registerTextStreamHandler(n, async (i) => {
38831
38887
  try {
38832
38888
  const o = await i.readAll();
38833
- r(o);
38889
+ console.log(`📝 VoxketClient: Direct handler called for topic '${n}'`), r(o);
38834
38890
  } catch (o) {
38835
38891
  console.error(`Error processing event for topic '${n}':`, o);
38836
38892
  }
38837
- });
38893
+ }), console.log(`📝 VoxketClient: Successfully registered direct handler for topic '${n}'`);
38838
38894
  } catch (i) {
38839
- console.warn(`VoxketClient: Handler for topic '${n}' may already be registered:`, i);
38895
+ console.warn(`VoxketClient: Direct handler registration failed for topic '${n}':`, i), console.log(`📝 VoxketClient: Wildcard handler will process topic '${n}' instead`);
38840
38896
  }
38841
38897
  }
38898
+ /**
38899
+ * Get the list of registered custom event emitters (for debugging)
38900
+ */
38901
+ getRegisteredEventEmitters() {
38902
+ return Array.from(this._eventEmitters.keys());
38903
+ }
38904
+ /**
38905
+ * Check if a custom event emitter is registered for a topic
38906
+ */
38907
+ hasEventEmitter(n) {
38908
+ return this._eventEmitters.has(n);
38909
+ }
38842
38910
  /**
38843
38911
  * Convert markdown text to plain text by removing common markdown formatting
38844
38912
  * @param markdownText The markdown text to convert
@@ -38850,13 +38918,13 @@ class oc extends vg {
38850
38918
  return r = r.replace(/\*\*(.*?)\*\*/g, "$1"), r = r.replace(/__(.*?)__/g, "$1"), r = r.replace(/\*(.*?)\*/g, "$1"), r = r.replace(/_(.*?)_/g, "$1"), r = r.replace(/~~(.*?)~~/g, "$1"), r = r.replace(/`([^`]+)`/g, "$1"), r = r.replace(/```[\s\S]*?```/g, ""), r = r.replace(/^#{1,6}\s+/gm, ""), r = r.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1"), r.trim();
38851
38919
  }
38852
38920
  }
38853
- const bI = Ae.create(Qm), yI = Ae.create(Yl), xI = Ae.create(OA), wI = Ae.create(xg);
38854
- function vI({
38921
+ const yI = Ae.create(Qm), xI = Ae.create(Yl), wI = Ae.create(OA), vI = Ae.create(xg);
38922
+ function EI({
38855
38923
  theme: e,
38856
38924
  mode: t,
38857
38925
  loadingText: n
38858
38926
  }) {
38859
- const r = Tt(e), i = () => {
38927
+ const r = Rt(e), i = () => {
38860
38928
  switch (t) {
38861
38929
  case "voice":
38862
38930
  return n || "Connecting to voice agent...";
@@ -38880,34 +38948,7 @@ function vI({
38880
38948
  ] })
38881
38949
  ] });
38882
38950
  }
38883
- const EI = Ae.create(vI);
38884
- function kI({
38885
- onClick: e,
38886
- text: t = "Open Chat",
38887
- position: n = "bottom-right",
38888
- theme: r
38889
- }) {
38890
- const i = {
38891
- "top-left": "top-4 left-4",
38892
- "top-right": "top-4 right-4",
38893
- "bottom-left": "bottom-4 left-4",
38894
- "bottom-right": "bottom-4 right-4"
38895
- }, o = Tt(r);
38896
- return /* @__PURE__ */ m(
38897
- Ae.button,
38898
- {
38899
- onClick: e,
38900
- className: `voxket-popup-trigger fixed ${i[n]} z-50 px-4 py-2 rounded-full shadow-lg ${o.popupTrigger} transition-all duration-200 hover:scale-105`,
38901
- initial: { scale: 0, opacity: 0 },
38902
- animate: { scale: 1, opacity: 1 },
38903
- exit: { scale: 0, opacity: 0 },
38904
- whileHover: { scale: 1.05 },
38905
- whileTap: { scale: 0.95 },
38906
- "data-position": n,
38907
- children: t
38908
- }
38909
- );
38910
- }
38951
+ const kI = Ae.create(EI);
38911
38952
  function kf({
38912
38953
  children: e,
38913
38954
  theme: t,
@@ -38916,7 +38957,7 @@ function kf({
38916
38957
  popupPosition: i = "bottom-right",
38917
38958
  onExpand: o
38918
38959
  }) {
38919
- const s = Tt(t);
38960
+ const s = Rt(t);
38920
38961
  return n === "fullscreen" ? /* @__PURE__ */ m(
38921
38962
  "div",
38922
38963
  {
@@ -39164,12 +39205,12 @@ function SI(e) {
39164
39205
  isConnected: le.state === "connected",
39165
39206
  sessionId: W == null ? void 0 : W.id
39166
39207
  });
39167
- }, $e = (Ze, Xe, At) => {
39208
+ }, $e = (Ze, Xe, Nt) => {
39168
39209
  console.log("🎵 Widget: Track subscribed:", {
39169
39210
  trackKind: Ze.kind,
39170
39211
  trackSource: Ze.source,
39171
- participantSid: At.sid,
39172
- participantIdentity: At.identity,
39212
+ participantSid: Nt.sid,
39213
+ participantIdentity: Nt.identity,
39173
39214
  sessionId: W == null ? void 0 : W.id
39174
39215
  });
39175
39216
  };
@@ -39182,7 +39223,7 @@ function SI(e) {
39182
39223
  }, [te, B, D]), P.useEffect(() => {
39183
39224
  (te === "voice" || te === "video" || te === "chat") && !W && !D && !B && K && !K.connected && (console.log("🔄 Auto-correcting: Found orphaned mode without session, returning to welcome"), ae("welcome"), Y(!1));
39184
39225
  }, [te, W, D, B, K]);
39185
- const { sessionMetrics: oe, sessionLogs: be, logEvent: ve } = pI({
39226
+ const { sessionMetrics: oe, sessionLogs: be, logEvent: ve } = mI({
39186
39227
  room: le,
39187
39228
  onSessionStart: k,
39188
39229
  onSessionEnd: E,
@@ -39261,7 +39302,7 @@ function SI(e) {
39261
39302
  } catch (re) {
39262
39303
  console.error("❌ Failed to start chat session:", re), Y(!1), w(!1), ae("welcome");
39263
39304
  }
39264
- }, Nt = async () => {
39305
+ }, Tt = async () => {
39265
39306
  try {
39266
39307
  if (!K) {
39267
39308
  console.error("❌ VoxketClient not available"), V(new Error("VoxketClient not initialized")), ne(!0);
@@ -39315,15 +39356,7 @@ function SI(e) {
39315
39356
  }, [K, I]);
39316
39357
  let z = te === "video" ? "w-[32rem]" : "w-96", Q = te === "video" ? "h-[30rem]" : "h-[25rem]", ye = {};
39317
39358
  if (d && (d.startsWith("w-") ? z = d : (ye.width = d, z = "")), f && (f.startsWith("h-") ? Q = f : (ye.height = f, Q = "")), N === "popup" && !Oe)
39318
- return console.log("🟡 Showing popup trigger button"), /* @__PURE__ */ m(
39319
- kI,
39320
- {
39321
- onClick: dt,
39322
- text: b,
39323
- position: O,
39324
- theme: y
39325
- }
39326
- );
39359
+ return console.log("🟡 Showing popup trigger button"), /* @__PURE__ */ m(pI, { onClick: dt, position: O, ariaLabel: b });
39327
39360
  if (q || !K) {
39328
39361
  const re = (ee == null ? void 0 : ee.message) || "VoxketWidget encountered an error. Please check your configuration.";
39329
39362
  return /* @__PURE__ */ m("div", { className: `voxket-widget-root theme-${y} flex items-center justify-center p-8 ${u || ""}`, style: {
@@ -39357,7 +39390,7 @@ function SI(e) {
39357
39390
  N === "widget" ? (Te += ` flex min-h-fit ${z} ${Q} ${u}`, De = { ...De, ...ye }) : (Te = `${u || ""}`, De = {});
39358
39391
  const Ot = /* @__PURE__ */ m("div", { className: "h-full w-full flex flex-col overflow-hidden relative z-10", children: /* @__PURE__ */ A(Ir, { mode: "wait", children: [
39359
39392
  te === "welcome" && !B && /* @__PURE__ */ m(
39360
- wI,
39393
+ vI,
39361
39394
  {
39362
39395
  agentId: S,
39363
39396
  participantName: H || "",
@@ -39365,7 +39398,7 @@ function SI(e) {
39365
39398
  onParticipantNameChange: Z,
39366
39399
  onStartCall: ke,
39367
39400
  onStartChat: ut,
39368
- onStartVideo: Nt,
39401
+ onStartVideo: Tt,
39369
39402
  disabled: D || B,
39370
39403
  prompts: s,
39371
39404
  statusMessage: a,
@@ -39381,7 +39414,7 @@ function SI(e) {
39381
39414
  "welcome"
39382
39415
  ),
39383
39416
  B && (te === "voice" || te === "chat" || te === "video") && /* @__PURE__ */ m(
39384
- EI,
39417
+ kI,
39385
39418
  {
39386
39419
  theme: y,
39387
39420
  mode: te,
@@ -39397,7 +39430,7 @@ function SI(e) {
39397
39430
  /* @__PURE__ */ m(xc, {}, `audio-${(W == null ? void 0 : W.id) || "no-session"}`),
39398
39431
  /* @__PURE__ */ m(wc, { label: "Start Audio" }, `start-audio-${(W == null ? void 0 : W.id) || "no-session"}`),
39399
39432
  /* @__PURE__ */ m(
39400
- bI,
39433
+ yI,
39401
39434
  {
39402
39435
  loadingText: h,
39403
39436
  participantName: H || "User",
@@ -39419,7 +39452,7 @@ function SI(e) {
39419
39452
  )
39420
39453
  ] }),
39421
39454
  te === "chat" && !B && D && K && /* @__PURE__ */ m(
39422
- yI,
39455
+ xI,
39423
39456
  {
39424
39457
  client: K,
39425
39458
  theme: y,
@@ -39441,7 +39474,7 @@ function SI(e) {
39441
39474
  /* @__PURE__ */ m(xc, {}, `audio-video-${(W == null ? void 0 : W.id) || "no-session"}`),
39442
39475
  /* @__PURE__ */ m(wc, { label: "Start Audio" }, `start-audio-video-${(W == null ? void 0 : W.id) || "no-session"}`),
39443
39476
  /* @__PURE__ */ m(
39444
- xI,
39477
+ wI,
39445
39478
  {
39446
39479
  client: K,
39447
39480
  theme: y,
@@ -40900,20 +40933,20 @@ function CO({
40900
40933
  ] });
40901
40934
  }
40902
40935
  const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i }) => {
40903
- const [o, s] = P.useState(null), [a, l] = P.useState(!0), [c, u] = P.useState(!1), [d] = P.useState(Date.now());
40936
+ const [o, s] = P.useState(null), [a, l] = P.useState(!0), [c, u] = P.useState(!1), [d] = P.useState(Date.now()), [f, h] = P.useState("pending");
40904
40937
  P.useEffect(() => {
40905
40938
  (async () => {
40906
40939
  try {
40907
- if (l(!0), console.log("📋 AssignmentView: Loading assignment data..."), console.log("📋 AssignmentView: Received data from RPC:", n), n && typeof n == "object") {
40908
- const x = {
40940
+ if (l(!0), n && typeof n == "object") {
40941
+ const k = {
40909
40942
  title: n.title || "Untitled Assignment",
40910
40943
  description: n.description || "No description provided",
40911
40944
  estimated_time_of_completion: n.estimated_time_of_completion || "Unknown"
40912
40945
  };
40913
- s(x), console.log("📋 AssignmentView: Assignment loaded from RPC data:", x);
40946
+ s(k), console.log("📋 AssignmentView: Assignment loaded from RPC data:", k);
40914
40947
  }
40915
- } catch (x) {
40916
- console.error("📋 AssignmentView: Error loading assignment:", x), s({
40948
+ } catch (k) {
40949
+ console.error("📋 AssignmentView: Error loading assignment:", k), s({
40917
40950
  title: "Assignment Loading Error",
40918
40951
  description: "There was an error loading the assignment details. Please try again.",
40919
40952
  estimated_time_of_completion: "Unknown"
@@ -40923,44 +40956,38 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
40923
40956
  }
40924
40957
  })();
40925
40958
  }, [n, t]);
40926
- const f = ({ message: p, assignment: x }) => {
40927
- const y = p.toLowerCase().includes("declined"), k = y ? "bg-red-50 border-red-200" : "bg-green-50 border-green-200", E = y ? "text-red-700" : "text-green-700", C = y ? "❌" : "🎉";
40928
- return /* @__PURE__ */ A("div", { className: `max-w-sm mx-auto ${k} border rounded-lg shadow p-3 flex flex-col items-center`, children: [
40929
- /* @__PURE__ */ m("div", { className: "text-2xl mb-2", children: C }),
40930
- /* @__PURE__ */ m("div", { className: `${E} font-semibold text-sm mb-1`, children: p }),
40931
- /* @__PURE__ */ m("div", { className: "text-xs text-gray-600 text-center mb-1", children: x.title }),
40959
+ const g = ({ message: y, assignment: k }) => {
40960
+ const E = y.toLowerCase().includes("declined"), C = E ? "bg-red-50 border-red-200" : "bg-green-50 border-green-200", v = E ? "text-red-700" : "text-green-700", _ = E ? "❌" : "🎉";
40961
+ return /* @__PURE__ */ A("div", { className: `max-w-sm mx-auto ${C} border rounded-lg shadow p-3 flex flex-col items-center`, children: [
40962
+ /* @__PURE__ */ m("div", { className: "text-2xl mb-2", children: _ }),
40963
+ /* @__PURE__ */ m("div", { className: `${v} font-semibold text-sm mb-1`, children: y }),
40964
+ /* @__PURE__ */ m("div", { className: "text-xs text-gray-600 text-center mb-1", children: k.title }),
40932
40965
  /* @__PURE__ */ m("div", { className: "text-xs text-gray-500", children: "Thank you for your response!" })
40933
40966
  ] });
40934
- }, h = async () => {
40967
+ }, p = async () => {
40935
40968
  if (!(!o || !e)) {
40936
40969
  u(!0);
40937
40970
  try {
40938
- const p = {
40971
+ const y = {
40939
40972
  message: "accepted"
40940
40973
  };
40941
- console.log("📋 AssignmentView: Assignment accepted:", p), e.didSuccess(
40942
- p,
40943
- /* @__PURE__ */ m(f, { message: "Assignment accepted!", assignment: o })
40944
- );
40945
- } catch (p) {
40946
- console.error("📋 AssignmentView: Error accepting assignment:", p), e.didFail({ error: "Failed to accept assignment" });
40974
+ console.log("📋 AssignmentView: Assignment accepted:", y), e.didSuccess(y), h("accepted");
40975
+ } catch (y) {
40976
+ console.error("📋 AssignmentView: Error accepting assignment:", y), e.didFail({ error: "Failed to accept assignment" }), h("error");
40947
40977
  } finally {
40948
40978
  u(!1);
40949
40979
  }
40950
40980
  }
40951
- }, g = async () => {
40981
+ }, x = async () => {
40952
40982
  if (!(!o || !e)) {
40953
40983
  u(!0);
40954
40984
  try {
40955
- const p = {
40985
+ const y = {
40956
40986
  message: "declined"
40957
40987
  };
40958
- console.log("📋 AssignmentView: Assignment declined:", p), e.didSuccess(
40959
- p,
40960
- /* @__PURE__ */ m(f, { message: "Assignment declined", assignment: o })
40961
- );
40962
- } catch (p) {
40963
- console.error("📋 AssignmentView: Error declining assignment:", p), e.didFail({ error: "Failed to decline assignment" });
40988
+ console.log("📋 AssignmentView: Assignment declined:", y), e.didSuccess(y), h("declined");
40989
+ } catch (y) {
40990
+ console.error("📋 AssignmentView: Error declining assignment:", y), e.didFail({ error: "Failed to decline assignment" }), h("error");
40964
40991
  } finally {
40965
40992
  u(!1);
40966
40993
  }
@@ -40969,7 +40996,13 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
40969
40996
  return a ? /* @__PURE__ */ m("div", { className: "max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3", children: /* @__PURE__ */ A("div", { className: "flex items-center justify-center py-4", children: [
40970
40997
  /* @__PURE__ */ m("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }),
40971
40998
  /* @__PURE__ */ m("span", { className: "ml-2 text-xs text-gray-600", children: "Loading assignment..." })
40972
- ] }) }) : o ? /* @__PURE__ */ A("div", { className: "max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden", children: [
40999
+ ] }) }) : o ? f === "accepted" || f === "declined" || f === "error" ? /* @__PURE__ */ m(
41000
+ g,
41001
+ {
41002
+ message: f === "accepted" ? "Assignment accepted!" : f === "declined" ? "Assignment declined" : "Assignment error occurred",
41003
+ assignment: o
41004
+ }
41005
+ ) : /* @__PURE__ */ A("div", { className: "max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden", children: [
40973
41006
  /* @__PURE__ */ m("div", { className: "bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3", children: /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ m("h3", { className: "text-xs font-semibold text-white truncate", children: o.title }) }) }),
40974
41007
  /* @__PURE__ */ A("div", { className: "p-3 text-black", children: [
40975
41008
  /* @__PURE__ */ m("div", { className: "bg-gray-50 rounded p-2 mb-3", children: /* @__PURE__ */ m("p", { className: "text-xs text-black leading-snug", children: o.description }) }),
@@ -40984,7 +41017,7 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
40984
41017
  /* @__PURE__ */ m(
40985
41018
  "button",
40986
41019
  {
40987
- onClick: h,
41020
+ onClick: p,
40988
41021
  disabled: c,
40989
41022
  className: "flex-1 bg-green-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
40990
41023
  children: c ? /* @__PURE__ */ A("span", { className: "flex items-center justify-center", children: [
@@ -40996,7 +41029,7 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
40996
41029
  /* @__PURE__ */ m(
40997
41030
  "button",
40998
41031
  {
40999
- onClick: g,
41032
+ onClick: x,
41000
41033
  disabled: c,
41001
41034
  className: "flex-1 bg-red-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
41002
41035
  children: "Decline"
@@ -41325,9 +41358,10 @@ const NO = {
41325
41358
  });
41326
41359
  export {
41327
41360
  QI as AssignmentView,
41361
+ pI as CommonPopupTrigger,
41328
41362
  RI as CompoundProvider,
41329
41363
  bo as InteractiveComponent,
41330
- mI as PluginManager,
41364
+ gI as PluginManager,
41331
41365
  TO as RpcExamples,
41332
41366
  xO as SessionContainer,
41333
41367
  Tg as SessionContent,
@@ -41370,7 +41404,7 @@ export {
41370
41404
  pO as metricsPlugin,
41371
41405
  EO as useComponentTheme,
41372
41406
  Xo as useCompoundContext,
41373
- pI as useSessionLogging,
41407
+ mI as useSessionLogging,
41374
41408
  FI as useTheme,
41375
41409
  Rn as useVoxket,
41376
41410
  TI as useVoxketCamera,