@cuekit-ai/react 1.4.0 → 1.5.0

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.mjs CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  setWebRTCCallbacks,
38
38
  setWebRTCConfig,
39
39
  validateDynamicElements
40
- } from "./chunk-VQ6DNY3R.mjs";
40
+ } from "./chunk-MHLYAXXW.mjs";
41
41
 
42
42
  // node_modules/inline-style-parser/index.js
43
43
  var require_inline_style_parser = __commonJS({
@@ -389,7 +389,7 @@ var require_core = __commonJS({
389
389
  root4.CryptoJS = factory();
390
390
  }
391
391
  })(exports, function() {
392
- var CryptoJS = CryptoJS || function(Math2, undefined2) {
392
+ var CryptoJS = CryptoJS || (function(Math2, undefined2) {
393
393
  var crypto;
394
394
  if (typeof window !== "undefined" && window.crypto) {
395
395
  crypto = window.crypto;
@@ -429,7 +429,7 @@ var require_core = __commonJS({
429
429
  }
430
430
  throw new Error("Native crypto module could not be used to get secure random number.");
431
431
  };
432
- var create2 = Object.create || /* @__PURE__ */ function() {
432
+ var create2 = Object.create || /* @__PURE__ */ (function() {
433
433
  function F2() {
434
434
  }
435
435
  return function(obj) {
@@ -439,10 +439,10 @@ var require_core = __commonJS({
439
439
  F2.prototype = null;
440
440
  return subtype;
441
441
  };
442
- }();
442
+ })();
443
443
  var C = {};
444
444
  var C_lib = C.lib = {};
445
- var Base = C_lib.Base = /* @__PURE__ */ function() {
445
+ var Base = C_lib.Base = /* @__PURE__ */ (function() {
446
446
  return {
447
447
  /**
448
448
  * Creates a new object that inherits from this object.
@@ -541,7 +541,7 @@ var require_core = __commonJS({
541
541
  return this.init.prototype.extend(this);
542
542
  }
543
543
  };
544
- }();
544
+ })();
545
545
  var WordArray = C_lib.WordArray = Base.extend({
546
546
  /**
547
547
  * Initializes a newly created word array.
@@ -979,7 +979,7 @@ var require_core = __commonJS({
979
979
  });
980
980
  var C_algo = C.algo = {};
981
981
  return C;
982
- }(Math);
982
+ })(Math);
983
983
  return CryptoJS;
984
984
  });
985
985
  }
@@ -1285,7 +1285,7 @@ var CuekitProvider = ({
1285
1285
  };
1286
1286
  }, [navigationHandler]);
1287
1287
  useEffect(() => {
1288
- import("./webrtc-service-3TOBGQF7.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
1288
+ import("./webrtc-service-AUWJ6AHB.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
1289
1289
  setWebRTCCallbacks2({
1290
1290
  onNavigationCommand: (command) => {
1291
1291
  if (command.data.actionType === "navigate" && command.data.routeName) {
@@ -1374,7 +1374,7 @@ var CuekitProvider = ({
1374
1374
  };
1375
1375
 
1376
1376
  // src/components/mic-button.tsx
1377
- import React11, { useState as useState10, useEffect as useEffect10, useCallback as useCallback5, useRef as useRef7 } from "react";
1377
+ import React11, { useState as useState10, useEffect as useEffect9, useCallback as useCallback5, useRef as useRef7 } from "react";
1378
1378
 
1379
1379
  // src/hooks/use-cuekit.ts
1380
1380
  import { useState as useState3, useCallback as useCallback2, useRef as useRef2 } from "react";
@@ -1513,6 +1513,7 @@ var useCuekit = (options) => {
1513
1513
  }, []);
1514
1514
  const [micState, setMicState] = useState3("idle");
1515
1515
  const [status, setStatus] = useState3("");
1516
+ const [muteState, setMuteState] = useState3({ isMuted: false, canMute: false });
1516
1517
  const handleNavigationCommand = (event) => {
1517
1518
  console.log(`\u2B07\uFE0F Received event from backend: ${event.type}`, event);
1518
1519
  switch (event.type) {
@@ -1577,6 +1578,22 @@ var useCuekit = (options) => {
1577
1578
  }
1578
1579
  break;
1579
1580
  }
1581
+ case "chat": {
1582
+ const chatData = event.data;
1583
+ console.log("\u{1F4AC} Chat message received:", chatData);
1584
+ if (chatData.message && chatData.sender === "ai") {
1585
+ const newMessage = {
1586
+ id: `ai-${Date.now()}`,
1587
+ role: "ai",
1588
+ text: chatData.message,
1589
+ isFinal: true,
1590
+ timestamp: new Date(chatData.timestamp || Date.now()).toISOString()
1591
+ };
1592
+ setMessages((prev) => [...prev, newMessage]);
1593
+ setMicState("listening");
1594
+ }
1595
+ break;
1596
+ }
1580
1597
  case "request_runtime_data": {
1581
1598
  console.log("\u{1F9E0} Requesting runtime data");
1582
1599
  sendRuntimeData();
@@ -1609,17 +1626,21 @@ var useCuekit = (options) => {
1609
1626
  switch (state) {
1610
1627
  case "connecting":
1611
1628
  setStatus("Connecting...");
1629
+ setMuteState((prev) => ({ ...prev, canMute: false }));
1612
1630
  break;
1613
1631
  case "connected":
1614
1632
  setStatus("");
1615
1633
  setMicState("listening");
1634
+ setMuteState((prev) => ({ ...prev, canMute: true }));
1616
1635
  break;
1617
1636
  case "disconnected":
1618
1637
  setStatus("Disconnected");
1619
1638
  setMicState("idle");
1639
+ setMuteState({ isMuted: false, canMute: false });
1620
1640
  break;
1621
1641
  case "reconnecting":
1622
1642
  setStatus("Reconnecting...");
1643
+ setMuteState((prev) => ({ ...prev, canMute: false }));
1623
1644
  break;
1624
1645
  default:
1625
1646
  break;
@@ -1641,7 +1662,88 @@ var useCuekit = (options) => {
1641
1662
  await webrtc.disconnect();
1642
1663
  clearMessages();
1643
1664
  setMicState("idle");
1665
+ setMuteState({ isMuted: false, canMute: false });
1644
1666
  }, [webrtc, clearMessages]);
1667
+ const toggleMute = useCallback2(async () => {
1668
+ if (!webrtc.isConnected) return;
1669
+ try {
1670
+ const room = webrtc.room;
1671
+ if (!room) return;
1672
+ const localParticipant = room.localParticipant;
1673
+ const audioTrack = localParticipant.getTrackPublication(Track.Source.Microphone)?.track;
1674
+ if (audioTrack) {
1675
+ if (muteState.isMuted) {
1676
+ await audioTrack.unmute();
1677
+ setMuteState((prev) => ({ ...prev, isMuted: false }));
1678
+ } else {
1679
+ await audioTrack.mute();
1680
+ setMuteState((prev) => ({ ...prev, isMuted: true }));
1681
+ }
1682
+ }
1683
+ } catch (error) {
1684
+ console.error("Failed to toggle mute:", error);
1685
+ }
1686
+ }, [webrtc, muteState.isMuted]);
1687
+ const setMute = useCallback2(
1688
+ async (muted) => {
1689
+ if (!webrtc.isConnected) return;
1690
+ try {
1691
+ const room = webrtc.room;
1692
+ if (!room) return;
1693
+ const localParticipant = room.localParticipant;
1694
+ const audioTrack = localParticipant.getTrackPublication(Track.Source.Microphone)?.track;
1695
+ if (audioTrack) {
1696
+ if (muted && !muteState.isMuted) {
1697
+ await audioTrack.mute();
1698
+ setMuteState((prev) => ({ ...prev, isMuted: true }));
1699
+ } else if (!muted && muteState.isMuted) {
1700
+ await audioTrack.unmute();
1701
+ setMuteState((prev) => ({ ...prev, isMuted: false }));
1702
+ }
1703
+ }
1704
+ } catch (error) {
1705
+ console.error("Failed to set mute:", error);
1706
+ }
1707
+ },
1708
+ [webrtc, muteState.isMuted]
1709
+ );
1710
+ const sendChatMessage = useCallback2(
1711
+ async (message) => {
1712
+ if (!webrtc.isConnected) {
1713
+ console.warn("Cannot send chat message: not connected to LiveKit");
1714
+ return;
1715
+ }
1716
+ try {
1717
+ const room = webrtc.room;
1718
+ if (!room) return;
1719
+ const payload = {
1720
+ type: "chat",
1721
+ message,
1722
+ timestamp: Date.now(),
1723
+ sender: "user"
1724
+ };
1725
+ console.log("\u{1F4E4} Sending chat message via LiveKit:", payload);
1726
+ const encoder = new TextEncoder();
1727
+ const encodedData = encoder.encode(JSON.stringify(payload));
1728
+ await room.localParticipant.publishData(encodedData, {
1729
+ reliable: true
1730
+ });
1731
+ const newMessage = {
1732
+ id: `user-${Date.now()}`,
1733
+ role: "user",
1734
+ text: message,
1735
+ isFinal: true,
1736
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1737
+ };
1738
+ setMessages((prev) => [...prev, newMessage]);
1739
+ setMicState("thinking");
1740
+ } catch (error) {
1741
+ console.error("Failed to send chat message:", error);
1742
+ throw error;
1743
+ }
1744
+ },
1745
+ [webrtc]
1746
+ );
1645
1747
  return {
1646
1748
  ...webrtc,
1647
1749
  messages,
@@ -1650,12 +1752,16 @@ var useCuekit = (options) => {
1650
1752
  status,
1651
1753
  setStatus,
1652
1754
  connect,
1653
- disconnect
1755
+ disconnect,
1756
+ muteState,
1757
+ toggleMute,
1758
+ setMute,
1759
+ sendChatMessage
1654
1760
  };
1655
1761
  };
1656
1762
 
1657
1763
  // src/components/chat-popup.tsx
1658
- import React6, { useState as useState5, useEffect as useEffect5, useRef as useRef3 } from "react";
1764
+ import React8, { useState as useState5, useEffect as useEffect4, useRef as useRef3 } from "react";
1659
1765
 
1660
1766
  // node_modules/devlop/lib/default.js
1661
1767
  function ok() {
@@ -3530,7 +3636,7 @@ var urlAttributes = {
3530
3636
 
3531
3637
  // node_modules/react-markdown/lib/index.js
3532
3638
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3533
- import { useEffect as useEffect4, useState as useState4 } from "react";
3639
+ import { useEffect as useEffect3, useState as useState4 } from "react";
3534
3640
 
3535
3641
  // node_modules/mdast-util-to-string/lib/index.js
3536
3642
  var emptyOptions2 = {};
@@ -9252,7 +9358,7 @@ var convert = (
9252
9358
  * @param {Test} [test]
9253
9359
  * @returns {Check}
9254
9360
  */
9255
- function(test) {
9361
+ (function(test) {
9256
9362
  if (test === null || test === void 0) {
9257
9363
  return ok2;
9258
9364
  }
@@ -9266,7 +9372,7 @@ var convert = (
9266
9372
  return typeFactory(test);
9267
9373
  }
9268
9374
  throw new Error("Expected function, string, or object as test");
9269
- }
9375
+ })
9270
9376
  );
9271
9377
  function anyFactory(tests) {
9272
9378
  const checks2 = [];
@@ -10446,7 +10552,7 @@ var CallableInstance = (
10446
10552
  * @param {string | symbol} property
10447
10553
  * @returns {(...parameters: Array<unknown>) => unknown}
10448
10554
  */
10449
- function(property) {
10555
+ (function(property) {
10450
10556
  const self2 = this;
10451
10557
  const constr = self2.constructor;
10452
10558
  const proto = (
@@ -10461,7 +10567,7 @@ var CallableInstance = (
10461
10567
  };
10462
10568
  Object.setPrototypeOf(apply, proto);
10463
10569
  return apply;
10464
- }
10570
+ })
10465
10571
  );
10466
10572
 
10467
10573
  // node_modules/unified/lib/index.js
@@ -14399,6 +14505,59 @@ var PhoneOffIcon = ({ width = 24, height = 24, className, ...props }) => {
14399
14505
  };
14400
14506
  var phone_off_default = PhoneOffIcon;
14401
14507
 
14508
+ // src/components/svgs/mic-off.tsx
14509
+ import React6 from "react";
14510
+ var MicOffIcon = ({ style, className }) => {
14511
+ return /* @__PURE__ */ React6.createElement(
14512
+ "svg",
14513
+ {
14514
+ xmlns: "http://www.w3.org/2000/svg",
14515
+ width: "24",
14516
+ height: "24",
14517
+ viewBox: "0 0 24 24",
14518
+ fill: "none",
14519
+ stroke: "currentColor",
14520
+ strokeWidth: "2",
14521
+ strokeLinecap: "round",
14522
+ strokeLinejoin: "round",
14523
+ className: `lucide lucide-mic-off-icon lucide-mic-off ${className || ""}`,
14524
+ style
14525
+ },
14526
+ /* @__PURE__ */ React6.createElement("path", { d: "M12 19v3" }),
14527
+ /* @__PURE__ */ React6.createElement("path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33" }),
14528
+ /* @__PURE__ */ React6.createElement("path", { d: "M16.95 16.95A7 7 0 0 1 5 12v-2" }),
14529
+ /* @__PURE__ */ React6.createElement("path", { d: "M18.89 13.23A7 7 0 0 0 19 12v-2" }),
14530
+ /* @__PURE__ */ React6.createElement("path", { d: "m2 2 20 20" }),
14531
+ /* @__PURE__ */ React6.createElement("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
14532
+ );
14533
+ };
14534
+ var mic_off_default = MicOffIcon;
14535
+
14536
+ // src/components/svgs/mic.tsx
14537
+ import React7 from "react";
14538
+ var MicIcon = ({ width = 24, height = 24, className, ...props }) => {
14539
+ return /* @__PURE__ */ React7.createElement(
14540
+ "svg",
14541
+ {
14542
+ xmlns: "http://www.w3.org/2000/svg",
14543
+ width,
14544
+ height,
14545
+ viewBox: "0 0 24 24",
14546
+ fill: "none",
14547
+ stroke: "currentColor",
14548
+ strokeWidth: "2",
14549
+ strokeLinecap: "round",
14550
+ strokeLinejoin: "round",
14551
+ className,
14552
+ ...props
14553
+ },
14554
+ /* @__PURE__ */ React7.createElement("path", { d: "M12 19v3" }),
14555
+ /* @__PURE__ */ React7.createElement("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
14556
+ /* @__PURE__ */ React7.createElement("rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" })
14557
+ );
14558
+ };
14559
+ var mic_default = MicIcon;
14560
+
14402
14561
  // src/components/chat-popup.tsx
14403
14562
  var ChatPopup = ({
14404
14563
  isOpen,
@@ -14415,7 +14574,9 @@ var ChatPopup = ({
14415
14574
  currentTheme = "dark",
14416
14575
  onThemeToggle,
14417
14576
  status,
14418
- anchor
14577
+ anchor,
14578
+ muteState,
14579
+ onToggleMute
14419
14580
  }) => {
14420
14581
  const [inputText, setInputText] = useState5("");
14421
14582
  const [isSending, setIsSending] = useState5(false);
@@ -14423,7 +14584,7 @@ var ChatPopup = ({
14423
14584
  const scrollToBottom = () => {
14424
14585
  messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
14425
14586
  };
14426
- useEffect5(() => {
14587
+ useEffect4(() => {
14427
14588
  console.log("\u{1F4EC} ChatPopup received messages:", JSON.stringify(messages, null, 2));
14428
14589
  scrollToBottom();
14429
14590
  }, [messages]);
@@ -14485,7 +14646,7 @@ var ChatPopup = ({
14485
14646
  }
14486
14647
  };
14487
14648
  const positionStyle = getPositionStyle();
14488
- return /* @__PURE__ */ React6.createElement(
14649
+ return /* @__PURE__ */ React8.createElement(
14489
14650
  "div",
14490
14651
  {
14491
14652
  "data-cuekit-ignore": true,
@@ -14508,7 +14669,7 @@ var ChatPopup = ({
14508
14669
  ...positionStyle
14509
14670
  }
14510
14671
  },
14511
- /* @__PURE__ */ React6.createElement(
14672
+ /* @__PURE__ */ React8.createElement(
14512
14673
  "div",
14513
14674
  {
14514
14675
  style: {
@@ -14519,14 +14680,14 @@ var ChatPopup = ({
14519
14680
  justifyContent: "space-between"
14520
14681
  }
14521
14682
  },
14522
- /* @__PURE__ */ React6.createElement("div", { style: { display: "flex", alignItems: "center", gap: 0 } }, /* @__PURE__ */ React6.createElement(
14683
+ /* @__PURE__ */ React8.createElement("div", { style: { display: "flex", alignItems: "center", gap: 0 } }, /* @__PURE__ */ React8.createElement(
14523
14684
  "img",
14524
14685
  {
14525
14686
  src: "https://dashboard.cuekit.ai/_next/image?url=%2Fimages%2Fcuekit-logo-2.png&w=256&q=100",
14526
14687
  alt: "Cuekit AI",
14527
14688
  style: { width: 58, objectFit: "cover" }
14528
14689
  }
14529
- ), /* @__PURE__ */ React6.createElement(
14690
+ ), /* @__PURE__ */ React8.createElement(
14530
14691
  "div",
14531
14692
  {
14532
14693
  style: {
@@ -14537,7 +14698,7 @@ var ChatPopup = ({
14537
14698
  justifyContent: "center"
14538
14699
  }
14539
14700
  },
14540
- /* @__PURE__ */ React6.createElement(
14701
+ /* @__PURE__ */ React8.createElement(
14541
14702
  "span",
14542
14703
  {
14543
14704
  style: {
@@ -14552,9 +14713,9 @@ var ChatPopup = ({
14552
14713
  WebkitTextFillColor: "transparent"
14553
14714
  }
14554
14715
  },
14555
- "Cuekit.ai"
14716
+ "ansyr.ai"
14556
14717
  ),
14557
- /* @__PURE__ */ React6.createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 } }, /* @__PURE__ */ React6.createElement(
14718
+ /* @__PURE__ */ React8.createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 } }, /* @__PURE__ */ React8.createElement(
14558
14719
  "div",
14559
14720
  {
14560
14721
  style: {
@@ -14570,7 +14731,7 @@ var ChatPopup = ({
14570
14731
  fontWeight: "500"
14571
14732
  }
14572
14733
  },
14573
- /* @__PURE__ */ React6.createElement(
14734
+ /* @__PURE__ */ React8.createElement(
14574
14735
  "span",
14575
14736
  {
14576
14737
  style: {
@@ -14581,8 +14742,8 @@ var ChatPopup = ({
14581
14742
  )
14582
14743
  ))
14583
14744
  )),
14584
- /* @__PURE__ */ React6.createElement("div", { style: { minWidth: 100, textAlign: "center" } }),
14585
- /* @__PURE__ */ React6.createElement(
14745
+ /* @__PURE__ */ React8.createElement("div", { style: { minWidth: 100, textAlign: "center" } }),
14746
+ /* @__PURE__ */ React8.createElement(
14586
14747
  "div",
14587
14748
  {
14588
14749
  style: {
@@ -14594,7 +14755,7 @@ var ChatPopup = ({
14594
14755
  top: 16
14595
14756
  }
14596
14757
  },
14597
- onThemeToggle && /* @__PURE__ */ React6.createElement(
14758
+ onThemeToggle && /* @__PURE__ */ React8.createElement(
14598
14759
  "button",
14599
14760
  {
14600
14761
  onClick: () => {
@@ -14624,7 +14785,7 @@ var ChatPopup = ({
14624
14785
  "aria-label": "Toggle theme",
14625
14786
  title: `Switch to ${currentTheme === "dark" ? "light" : "dark"} mode`
14626
14787
  },
14627
- currentTheme === "dark" ? /* @__PURE__ */ React6.createElement(
14788
+ currentTheme === "dark" ? /* @__PURE__ */ React8.createElement(
14628
14789
  sun_default,
14629
14790
  {
14630
14791
  style: {
@@ -14634,7 +14795,7 @@ var ChatPopup = ({
14634
14795
  animation: "themeToggleEnter 0.3s ease-in-out"
14635
14796
  }
14636
14797
  }
14637
- ) : /* @__PURE__ */ React6.createElement(
14798
+ ) : /* @__PURE__ */ React8.createElement(
14638
14799
  moon_default,
14639
14800
  {
14640
14801
  style: {
@@ -14646,7 +14807,7 @@ var ChatPopup = ({
14646
14807
  }
14647
14808
  )
14648
14809
  ),
14649
- /* @__PURE__ */ React6.createElement(
14810
+ /* @__PURE__ */ React8.createElement(
14650
14811
  "button",
14651
14812
  {
14652
14813
  onClick: onMinimize,
@@ -14673,11 +14834,11 @@ var ChatPopup = ({
14673
14834
  "aria-label": "Minimize",
14674
14835
  title: "Minimize chat"
14675
14836
  },
14676
- /* @__PURE__ */ React6.createElement(close_default, { style: { width: 16, height: 16, color: "hsl(var(--voice-text-muted))" } })
14837
+ /* @__PURE__ */ React8.createElement(close_default, { style: { width: 16, height: 16, color: "hsl(var(--voice-text-muted))" } })
14677
14838
  )
14678
14839
  )
14679
14840
  ),
14680
- /* @__PURE__ */ React6.createElement(
14841
+ /* @__PURE__ */ React8.createElement(
14681
14842
  "div",
14682
14843
  {
14683
14844
  style: {
@@ -14690,7 +14851,7 @@ var ChatPopup = ({
14690
14851
  color: "hsl(var(--voice-text))"
14691
14852
  }
14692
14853
  },
14693
- messages.length === 0 ? /* @__PURE__ */ React6.createElement(
14854
+ messages.length === 0 ? /* @__PURE__ */ React8.createElement(
14694
14855
  "div",
14695
14856
  {
14696
14857
  style: {
@@ -14700,7 +14861,7 @@ var ChatPopup = ({
14700
14861
  }
14701
14862
  },
14702
14863
  "Start a conversation with CueKit AI"
14703
- ) : messages.map((message, index2) => /* @__PURE__ */ React6.createElement(
14864
+ ) : messages.map((message, index2) => /* @__PURE__ */ React8.createElement(
14704
14865
  "div",
14705
14866
  {
14706
14867
  key: index2,
@@ -14714,7 +14875,7 @@ var ChatPopup = ({
14714
14875
  justifyContent: message.sender === "user" ? "flex-end" : "flex-start"
14715
14876
  }
14716
14877
  },
14717
- message.sender === "assistant" && /* @__PURE__ */ React6.createElement(
14878
+ message.sender === "assistant" && /* @__PURE__ */ React8.createElement(
14718
14879
  "div",
14719
14880
  {
14720
14881
  style: {
@@ -14729,7 +14890,7 @@ var ChatPopup = ({
14729
14890
  overflow: "hidden"
14730
14891
  }
14731
14892
  },
14732
- /* @__PURE__ */ React6.createElement(
14893
+ /* @__PURE__ */ React8.createElement(
14733
14894
  "img",
14734
14895
  {
14735
14896
  src: "https://dashboard.cuekit.ai/_next/image?url=%2Fimages%2Fcuekit-logo-2.png&w=256&q=100",
@@ -14743,7 +14904,7 @@ var ChatPopup = ({
14743
14904
  }
14744
14905
  )
14745
14906
  ),
14746
- /* @__PURE__ */ React6.createElement(
14907
+ /* @__PURE__ */ React8.createElement(
14747
14908
  "div",
14748
14909
  {
14749
14910
  style: {
@@ -14754,7 +14915,7 @@ var ChatPopup = ({
14754
14915
  flex: 1
14755
14916
  }
14756
14917
  },
14757
- /* @__PURE__ */ React6.createElement(
14918
+ /* @__PURE__ */ React8.createElement(
14758
14919
  "div",
14759
14920
  {
14760
14921
  style: {
@@ -14772,12 +14933,12 @@ var ChatPopup = ({
14772
14933
  marginLeft: message.sender === "user" ? "auto" : 0
14773
14934
  }
14774
14935
  },
14775
- /* @__PURE__ */ React6.createElement("div", null, /* @__PURE__ */ React6.createElement(
14936
+ /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement(
14776
14937
  Markdown,
14777
14938
  {
14778
14939
  remarkPlugins: [remarkGfm],
14779
14940
  components: {
14780
- p: ({ children }) => /* @__PURE__ */ React6.createElement(
14941
+ p: ({ children }) => /* @__PURE__ */ React8.createElement(
14781
14942
  "p",
14782
14943
  {
14783
14944
  style: {
@@ -14788,7 +14949,7 @@ var ChatPopup = ({
14788
14949
  },
14789
14950
  children
14790
14951
  ),
14791
- h1: ({ children }) => /* @__PURE__ */ React6.createElement(
14952
+ h1: ({ children }) => /* @__PURE__ */ React8.createElement(
14792
14953
  "h1",
14793
14954
  {
14794
14955
  style: {
@@ -14800,7 +14961,7 @@ var ChatPopup = ({
14800
14961
  },
14801
14962
  children
14802
14963
  ),
14803
- h2: ({ children }) => /* @__PURE__ */ React6.createElement(
14964
+ h2: ({ children }) => /* @__PURE__ */ React8.createElement(
14804
14965
  "h2",
14805
14966
  {
14806
14967
  style: {
@@ -14812,7 +14973,7 @@ var ChatPopup = ({
14812
14973
  },
14813
14974
  children
14814
14975
  ),
14815
- h3: ({ children }) => /* @__PURE__ */ React6.createElement(
14976
+ h3: ({ children }) => /* @__PURE__ */ React8.createElement(
14816
14977
  "h3",
14817
14978
  {
14818
14979
  style: {
@@ -14824,7 +14985,7 @@ var ChatPopup = ({
14824
14985
  },
14825
14986
  children
14826
14987
  ),
14827
- ul: ({ children }) => /* @__PURE__ */ React6.createElement(
14988
+ ul: ({ children }) => /* @__PURE__ */ React8.createElement(
14828
14989
  "ul",
14829
14990
  {
14830
14991
  style: {
@@ -14836,7 +14997,7 @@ var ChatPopup = ({
14836
14997
  },
14837
14998
  children
14838
14999
  ),
14839
- ol: ({ children }) => /* @__PURE__ */ React6.createElement(
15000
+ ol: ({ children }) => /* @__PURE__ */ React8.createElement(
14840
15001
  "ol",
14841
15002
  {
14842
15003
  style: {
@@ -14848,7 +15009,7 @@ var ChatPopup = ({
14848
15009
  },
14849
15010
  children
14850
15011
  ),
14851
- li: ({ children }) => /* @__PURE__ */ React6.createElement(
15012
+ li: ({ children }) => /* @__PURE__ */ React8.createElement(
14852
15013
  "li",
14853
15014
  {
14854
15015
  style: {
@@ -14859,7 +15020,7 @@ var ChatPopup = ({
14859
15020
  },
14860
15021
  children
14861
15022
  ),
14862
- strong: ({ children }) => /* @__PURE__ */ React6.createElement(
15023
+ strong: ({ children }) => /* @__PURE__ */ React8.createElement(
14863
15024
  "strong",
14864
15025
  {
14865
15026
  style: {
@@ -14870,7 +15031,7 @@ var ChatPopup = ({
14870
15031
  },
14871
15032
  children
14872
15033
  ),
14873
- em: ({ children }) => /* @__PURE__ */ React6.createElement(
15034
+ em: ({ children }) => /* @__PURE__ */ React8.createElement(
14874
15035
  "em",
14875
15036
  {
14876
15037
  style: {
@@ -14881,7 +15042,7 @@ var ChatPopup = ({
14881
15042
  },
14882
15043
  children
14883
15044
  ),
14884
- code: ({ children }) => /* @__PURE__ */ React6.createElement(
15045
+ code: ({ children }) => /* @__PURE__ */ React8.createElement(
14885
15046
  "code",
14886
15047
  {
14887
15048
  style: {
@@ -14894,7 +15055,7 @@ var ChatPopup = ({
14894
15055
  },
14895
15056
  children
14896
15057
  ),
14897
- pre: ({ children }) => /* @__PURE__ */ React6.createElement(
15058
+ pre: ({ children }) => /* @__PURE__ */ React8.createElement(
14898
15059
  "pre",
14899
15060
  {
14900
15061
  style: {
@@ -14909,7 +15070,7 @@ var ChatPopup = ({
14909
15070
  },
14910
15071
  children
14911
15072
  ),
14912
- blockquote: ({ children }) => /* @__PURE__ */ React6.createElement(
15073
+ blockquote: ({ children }) => /* @__PURE__ */ React8.createElement(
14913
15074
  "blockquote",
14914
15075
  {
14915
15076
  style: {
@@ -14928,7 +15089,7 @@ var ChatPopup = ({
14928
15089
  message.text
14929
15090
  ))
14930
15091
  ),
14931
- message.sender === "user" && /* @__PURE__ */ React6.createElement(
15092
+ message.sender === "user" && /* @__PURE__ */ React8.createElement(
14932
15093
  "div",
14933
15094
  {
14934
15095
  style: {
@@ -14949,9 +15110,9 @@ var ChatPopup = ({
14949
15110
  )
14950
15111
  )
14951
15112
  )),
14952
- /* @__PURE__ */ React6.createElement("div", { ref: messagesEndRef })
15113
+ /* @__PURE__ */ React8.createElement("div", { ref: messagesEndRef })
14953
15114
  ),
14954
- /* @__PURE__ */ React6.createElement(
15115
+ /* @__PURE__ */ React8.createElement(
14955
15116
  "div",
14956
15117
  {
14957
15118
  style: {
@@ -14960,7 +15121,7 @@ var ChatPopup = ({
14960
15121
  background: "hsl(var(--voice-bg))"
14961
15122
  }
14962
15123
  },
14963
- /* @__PURE__ */ React6.createElement(
15124
+ /* @__PURE__ */ React8.createElement(
14964
15125
  "form",
14965
15126
  {
14966
15127
  onSubmit: (e2) => {
@@ -14969,7 +15130,7 @@ var ChatPopup = ({
14969
15130
  },
14970
15131
  style: { display: "flex", alignItems: "center", gap: 8, margin: 0 }
14971
15132
  },
14972
- /* @__PURE__ */ React6.createElement(
15133
+ /* @__PURE__ */ React8.createElement(
14973
15134
  "input",
14974
15135
  {
14975
15136
  type: "text",
@@ -14996,7 +15157,47 @@ var ChatPopup = ({
14996
15157
  }
14997
15158
  }
14998
15159
  ),
14999
- isConnected && onEndCall && /* @__PURE__ */ React6.createElement(
15160
+ muteState?.canMute && onToggleMute && /* @__PURE__ */ React8.createElement(
15161
+ "button",
15162
+ {
15163
+ onClick: onToggleMute,
15164
+ style: {
15165
+ padding: "10px 12px",
15166
+ borderRadius: 8,
15167
+ border: "1px solid hsl(var(--voice-accent))",
15168
+ background: "hsl(var(--voice-accent))",
15169
+ fontSize: 12,
15170
+ fontWeight: 700,
15171
+ display: "flex",
15172
+ alignItems: "center",
15173
+ justifyContent: "center",
15174
+ cursor: "pointer",
15175
+ transition: "all 0.3s ease"
15176
+ },
15177
+ "aria-label": muteState.isMuted ? "Unmute microphone" : "Mute microphone",
15178
+ title: muteState.isMuted ? "Unmute microphone" : "Mute microphone"
15179
+ },
15180
+ muteState.isMuted ? /* @__PURE__ */ React8.createElement(
15181
+ mic_default,
15182
+ {
15183
+ style: {
15184
+ width: 16,
15185
+ height: 16,
15186
+ color: "hsl(var(--voice-user-text))"
15187
+ }
15188
+ }
15189
+ ) : /* @__PURE__ */ React8.createElement(
15190
+ mic_off_default,
15191
+ {
15192
+ style: {
15193
+ width: 16,
15194
+ height: 16,
15195
+ color: "hsl(var(--voice-user-text))"
15196
+ }
15197
+ }
15198
+ )
15199
+ ),
15200
+ isConnected && onEndCall && /* @__PURE__ */ React8.createElement(
15000
15201
  "button",
15001
15202
  {
15002
15203
  type: "submit",
@@ -15015,7 +15216,7 @@ var ChatPopup = ({
15015
15216
  cursor: "pointer"
15016
15217
  }
15017
15218
  },
15018
- /* @__PURE__ */ React6.createElement(phone_off_default, { style: { width: 16, height: 16 } })
15219
+ /* @__PURE__ */ React8.createElement(phone_off_default, { style: { width: 16, height: 16 } })
15019
15220
  )
15020
15221
  )
15021
15222
  )
@@ -15023,7 +15224,7 @@ var ChatPopup = ({
15023
15224
  };
15024
15225
 
15025
15226
  // src/components/border-glow.tsx
15026
- import React7 from "react";
15227
+ import React9 from "react";
15027
15228
  var BorderGlow = ({ isActive }) => {
15028
15229
  if (!isActive) return null;
15029
15230
  const styles = {
@@ -15150,7 +15351,7 @@ var BorderGlow = ({ isActive }) => {
15150
15351
  opacity: 0.6
15151
15352
  }
15152
15353
  };
15153
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("style", null, `
15354
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("style", null, `
15154
15355
  @keyframes borderPulse {
15155
15356
  0%, 100% {
15156
15357
  opacity: 1;
@@ -15159,12 +15360,12 @@ var BorderGlow = ({ isActive }) => {
15159
15360
  opacity: 0.5;
15160
15361
  }
15161
15362
  }
15162
- `), /* @__PURE__ */ React7.createElement("div", { style: styles.container }, /* @__PURE__ */ React7.createElement("div", { style: styles.rightBorder1 }), /* @__PURE__ */ React7.createElement("div", { style: styles.rightBorder2 }), /* @__PURE__ */ React7.createElement("div", { style: styles.rightBorder3 }), /* @__PURE__ */ React7.createElement("div", { style: styles.leftBorder1 }), /* @__PURE__ */ React7.createElement("div", { style: styles.leftBorder2 }), /* @__PURE__ */ React7.createElement("div", { style: styles.leftBorder3 }), /* @__PURE__ */ React7.createElement("div", { style: styles.cornerTopLeft }), /* @__PURE__ */ React7.createElement("div", { style: styles.cornerTopRight }), /* @__PURE__ */ React7.createElement("div", { style: styles.cornerBottomRight }), /* @__PURE__ */ React7.createElement("div", { style: styles.cornerBottomLeft })));
15363
+ `), /* @__PURE__ */ React9.createElement("div", { style: styles.container }, /* @__PURE__ */ React9.createElement("div", { style: styles.rightBorder1 }), /* @__PURE__ */ React9.createElement("div", { style: styles.rightBorder2 }), /* @__PURE__ */ React9.createElement("div", { style: styles.rightBorder3 }), /* @__PURE__ */ React9.createElement("div", { style: styles.leftBorder1 }), /* @__PURE__ */ React9.createElement("div", { style: styles.leftBorder2 }), /* @__PURE__ */ React9.createElement("div", { style: styles.leftBorder3 }), /* @__PURE__ */ React9.createElement("div", { style: styles.cornerTopLeft }), /* @__PURE__ */ React9.createElement("div", { style: styles.cornerTopRight }), /* @__PURE__ */ React9.createElement("div", { style: styles.cornerBottomRight }), /* @__PURE__ */ React9.createElement("div", { style: styles.cornerBottomLeft })));
15163
15364
  };
15164
15365
  var border_glow_default = BorderGlow;
15165
15366
 
15166
15367
  // src/components/voice-intensity-visualizer.tsx
15167
- import React8, { useEffect as useEffect9, useState as useState9 } from "react";
15368
+ import React10, { useEffect as useEffect8, useState as useState9 } from "react";
15168
15369
 
15169
15370
  // node_modules/@livekit/components-react/dist/hooks-C2Bp5v2q.mjs
15170
15371
  import * as r from "react";
@@ -15179,7 +15380,7 @@ var Me = { exports: {} };
15179
15380
  var Or = Me.exports;
15180
15381
  var kt;
15181
15382
  function kr() {
15182
- return kt || (kt = 1, function(e2) {
15383
+ return kt || (kt = 1, (function(e2) {
15183
15384
  (function(t, n) {
15184
15385
  e2.exports ? e2.exports = n() : t.log = n();
15185
15386
  })(Or, function() {
@@ -15323,7 +15524,7 @@ function kr() {
15323
15524
  return o;
15324
15525
  }, s.default = s, s;
15325
15526
  });
15326
- }(Me)), Me.exports;
15527
+ })(Me)), Me.exports;
15327
15528
  }
15328
15529
  var _r = kr();
15329
15530
  var Lr = /* @__PURE__ */ Ar(_r);
@@ -15546,7 +15747,7 @@ function Ue(e2, t) {
15546
15747
  0 <= n && e2.splice(n, 1);
15547
15748
  }
15548
15749
  }
15549
- var Oe = function() {
15750
+ var Oe = (function() {
15550
15751
  function e2(t) {
15551
15752
  this.initialTeardown = t, this.closed = false, this._parentage = null, this._finalizers = null;
15552
15753
  }
@@ -15630,11 +15831,11 @@ var Oe = function() {
15630
15831
  }, e2.prototype.remove = function(t) {
15631
15832
  var n = this._finalizers;
15632
15833
  n && Ue(n, t), t instanceof e2 && t._removeParent(this);
15633
- }, e2.EMPTY = function() {
15834
+ }, e2.EMPTY = (function() {
15634
15835
  var t = new e2();
15635
15836
  return t.closed = true, t;
15636
- }(), e2;
15637
- }();
15837
+ })(), e2;
15838
+ })();
15638
15839
  var an = Oe.EMPTY;
15639
15840
  function cn(e2) {
15640
15841
  return e2 instanceof Oe || e2 && "closed" in e2 && P(e2.remove) && P(e2.add) && P(e2.unsubscribe);
@@ -15666,7 +15867,7 @@ function je() {
15666
15867
  function Re(e2) {
15667
15868
  e2();
15668
15869
  }
15669
- var gt = function(e2) {
15870
+ var gt = (function(e2) {
15670
15871
  te(t, e2);
15671
15872
  function t(n) {
15672
15873
  var r2 = e2.call(this) || this;
@@ -15697,8 +15898,8 @@ var gt = function(e2) {
15697
15898
  this.unsubscribe();
15698
15899
  }
15699
15900
  }, t;
15700
- }(Oe);
15701
- var Nr = function() {
15901
+ })(Oe);
15902
+ var Nr = (function() {
15702
15903
  function e2(t) {
15703
15904
  this.partialObserver = t;
15704
15905
  }
@@ -15729,8 +15930,8 @@ var Nr = function() {
15729
15930
  Le(n);
15730
15931
  }
15731
15932
  }, e2;
15732
- }();
15733
- var Ce = function(e2) {
15933
+ })();
15934
+ var Ce = (function(e2) {
15734
15935
  te(t, e2);
15735
15936
  function t(n, r2, i2) {
15736
15937
  var o = e2.call(this) || this, s;
@@ -15741,7 +15942,7 @@ var Ce = function(e2) {
15741
15942
  } : s = n, o.destination = new Nr(s), o;
15742
15943
  }
15743
15944
  return t;
15744
- }(gt);
15945
+ })(gt);
15745
15946
  function Le(e2) {
15746
15947
  un(e2);
15747
15948
  }
@@ -15754,9 +15955,9 @@ var Ur = {
15754
15955
  error: Fr,
15755
15956
  complete: je
15756
15957
  };
15757
- var bt = function() {
15958
+ var bt = (function() {
15758
15959
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
15759
- }();
15960
+ })();
15760
15961
  function Ge(e2) {
15761
15962
  return e2;
15762
15963
  }
@@ -15767,7 +15968,7 @@ function jr(e2) {
15767
15968
  }, n);
15768
15969
  };
15769
15970
  }
15770
- var k = function() {
15971
+ var k = (function() {
15771
15972
  function e2(t) {
15772
15973
  t && (this._subscribe = t);
15773
15974
  }
@@ -15826,7 +16027,7 @@ var k = function() {
15826
16027
  }, e2.create = function(t) {
15827
16028
  return new e2(t);
15828
16029
  }, e2;
15829
- }();
16030
+ })();
15830
16031
  function Lt(e2) {
15831
16032
  var t;
15832
16033
  return (t = e2 ?? Dr.Promise) !== null && t !== void 0 ? t : Promise;
@@ -15856,7 +16057,7 @@ function j(e2) {
15856
16057
  function F(e2, t, n, r2, i2) {
15857
16058
  return new Hr(e2, t, n, r2, i2);
15858
16059
  }
15859
- var Hr = function(e2) {
16060
+ var Hr = (function(e2) {
15860
16061
  te(t, e2);
15861
16062
  function t(n, r2, i2, o, s, a) {
15862
16063
  var c = e2.call(this, n) || this;
@@ -15891,13 +16092,13 @@ var Hr = function(e2) {
15891
16092
  e2.prototype.unsubscribe.call(this), !r2 && ((n = this.onFinalize) === null || n === void 0 || n.call(this));
15892
16093
  }
15893
16094
  }, t;
15894
- }(gt);
16095
+ })(gt);
15895
16096
  var zr = mt(function(e2) {
15896
16097
  return function() {
15897
16098
  e2(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
15898
16099
  };
15899
16100
  });
15900
- var ee = function(e2) {
16101
+ var ee = (function(e2) {
15901
16102
  te(t, e2);
15902
16103
  function t() {
15903
16104
  var n = e2.call(this) || this;
@@ -15976,8 +16177,8 @@ var ee = function(e2) {
15976
16177
  }, t.create = function(n, r2) {
15977
16178
  return new It(n, r2);
15978
16179
  }, t;
15979
- }(k);
15980
- var It = function(e2) {
16180
+ })(k);
16181
+ var It = (function(e2) {
15981
16182
  te(t, e2);
15982
16183
  function t(n, r2) {
15983
16184
  var i2 = e2.call(this) || this;
@@ -15996,8 +16197,8 @@ var It = function(e2) {
15996
16197
  var r2, i2;
15997
16198
  return (i2 = (r2 = this.source) === null || r2 === void 0 ? void 0 : r2.subscribe(n)) !== null && i2 !== void 0 ? i2 : an;
15998
16199
  }, t;
15999
- }(ee);
16000
- var ln = function(e2) {
16200
+ })(ee);
16201
+ var ln = (function(e2) {
16001
16202
  te(t, e2);
16002
16203
  function t(n) {
16003
16204
  var r2 = e2.call(this) || this;
@@ -16020,13 +16221,13 @@ var ln = function(e2) {
16020
16221
  }, t.prototype.next = function(n) {
16021
16222
  e2.prototype.next.call(this, this._value = n);
16022
16223
  }, t;
16023
- }(ee);
16224
+ })(ee);
16024
16225
  var Yr = {
16025
16226
  now: function() {
16026
16227
  return Date.now();
16027
16228
  }
16028
16229
  };
16029
- var qr = function(e2) {
16230
+ var qr = (function(e2) {
16030
16231
  te(t, e2);
16031
16232
  function t(n, r2) {
16032
16233
  return e2.call(this) || this;
@@ -16034,7 +16235,7 @@ var qr = function(e2) {
16034
16235
  return t.prototype.schedule = function(n, r2) {
16035
16236
  return this;
16036
16237
  }, t;
16037
- }(Oe);
16238
+ })(Oe);
16038
16239
  var Mt = {
16039
16240
  setInterval: function(e2, t) {
16040
16241
  for (var n = [], r2 = 2; r2 < arguments.length; r2++)
@@ -16046,7 +16247,7 @@ var Mt = {
16046
16247
  },
16047
16248
  delegate: void 0
16048
16249
  };
16049
- var Kr = function(e2) {
16250
+ var Kr = (function(e2) {
16050
16251
  te(t, e2);
16051
16252
  function t(n, r2) {
16052
16253
  var i2 = e2.call(this, n, r2) || this;
@@ -16088,16 +16289,16 @@ var Kr = function(e2) {
16088
16289
  this.work = this.state = this.scheduler = null, this.pending = false, Ue(o, this), r2 != null && (this.id = this.recycleAsyncId(i2, r2, null)), this.delay = null, e2.prototype.unsubscribe.call(this);
16089
16290
  }
16090
16291
  }, t;
16091
- }(qr);
16092
- var Rt = function() {
16292
+ })(qr);
16293
+ var Rt = (function() {
16093
16294
  function e2(t, n) {
16094
16295
  n === void 0 && (n = e2.now), this.schedulerActionCtor = t, this.now = n;
16095
16296
  }
16096
16297
  return e2.prototype.schedule = function(t, n, r2) {
16097
16298
  return n === void 0 && (n = 0), new this.schedulerActionCtor(this, t).schedule(r2, n);
16098
16299
  }, e2.now = Yr.now, e2;
16099
- }();
16100
- var Gr = function(e2) {
16300
+ })();
16301
+ var Gr = (function(e2) {
16101
16302
  te(t, e2);
16102
16303
  function t(n, r2) {
16103
16304
  r2 === void 0 && (r2 = Rt.now);
@@ -16122,7 +16323,7 @@ var Gr = function(e2) {
16122
16323
  throw i2;
16123
16324
  }
16124
16325
  }, t;
16125
- }(Rt);
16326
+ })(Rt);
16126
16327
  var Qr = new Gr(Kr);
16127
16328
  function Jr(e2) {
16128
16329
  return e2 && P(e2.schedule);
@@ -16981,7 +17182,7 @@ var Xt = /* @__PURE__ */ e.forwardRef(
16981
17182
  // src/components/voice-intensity-visualizer.tsx
16982
17183
  var VoiceIntensityWithRoom = (props) => {
16983
17184
  const [room, setRoom] = useState9(null);
16984
- useEffect9(() => {
17185
+ useEffect8(() => {
16985
17186
  if (props.isActive) {
16986
17187
  const currentRoom = getRoom();
16987
17188
  if (currentRoom) {
@@ -16994,7 +17195,7 @@ var VoiceIntensityWithRoom = (props) => {
16994
17195
  if (!room) {
16995
17196
  return null;
16996
17197
  }
16997
- return /* @__PURE__ */ React8.createElement(Wn.Provider, { value: room }, /* @__PURE__ */ React8.createElement(VoiceIntensityBars, { ...props }));
17198
+ return /* @__PURE__ */ React10.createElement(Wn.Provider, { value: room }, /* @__PURE__ */ React10.createElement(VoiceIntensityBars, { ...props }));
16998
17199
  };
16999
17200
  var VoiceIntensityBars = ({
17000
17201
  isActive,
@@ -17037,7 +17238,7 @@ var VoiceIntensityBars = ({
17037
17238
  if (!trackRef) {
17038
17239
  return null;
17039
17240
  }
17040
- return /* @__PURE__ */ React8.createElement(
17241
+ return /* @__PURE__ */ React10.createElement(
17041
17242
  "div",
17042
17243
  {
17043
17244
  className: `voice-intensity-visualizer ${className}`,
@@ -17054,7 +17255,7 @@ var VoiceIntensityBars = ({
17054
17255
  pointerEvents: "none"
17055
17256
  }
17056
17257
  },
17057
- /* @__PURE__ */ React8.createElement(
17258
+ /* @__PURE__ */ React10.createElement(
17058
17259
  Xt,
17059
17260
  {
17060
17261
  barCount,
@@ -17068,60 +17269,12 @@ var VoiceIntensityBars = ({
17068
17269
  gap: "0.25rem"
17069
17270
  }
17070
17271
  },
17071
- /* @__PURE__ */ React8.createElement("span", { className: "cuekit-voice-intensity-bar" })
17272
+ /* @__PURE__ */ React10.createElement("span", { className: "cuekit-voice-intensity-bar" })
17072
17273
  )
17073
17274
  );
17074
17275
  };
17075
17276
  var VoiceIntensityVisualizer = VoiceIntensityWithRoom;
17076
17277
 
17077
- // src/components/svgs/mic.tsx
17078
- import React9 from "react";
17079
- var MicIcon = ({ width = 24, height = 24, className, ...props }) => {
17080
- return /* @__PURE__ */ React9.createElement(
17081
- "svg",
17082
- {
17083
- xmlns: "http://www.w3.org/2000/svg",
17084
- width,
17085
- height,
17086
- viewBox: "0 0 24 24",
17087
- fill: "none",
17088
- stroke: "currentColor",
17089
- strokeWidth: "2",
17090
- strokeLinecap: "round",
17091
- strokeLinejoin: "round",
17092
- className,
17093
- ...props
17094
- },
17095
- /* @__PURE__ */ React9.createElement("path", { d: "M12 19v3" }),
17096
- /* @__PURE__ */ React9.createElement("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
17097
- /* @__PURE__ */ React9.createElement("rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" })
17098
- );
17099
- };
17100
- var mic_default = MicIcon;
17101
-
17102
- // src/components/svgs/loader.tsx
17103
- import React10 from "react";
17104
- var LoaderIcon = ({ width = 24, height = 24, className, ...props }) => {
17105
- return /* @__PURE__ */ React10.createElement(
17106
- "svg",
17107
- {
17108
- xmlns: "http://www.w3.org/2000/svg",
17109
- width: "24",
17110
- height: "24",
17111
- viewBox: "0 0 24 24",
17112
- fill: "none",
17113
- stroke: "currentColor",
17114
- strokeWidth: "2",
17115
- strokeLinecap: "round",
17116
- strokeLinejoin: "round",
17117
- className,
17118
- ...props
17119
- },
17120
- /* @__PURE__ */ React10.createElement("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
17121
- );
17122
- };
17123
- var loader_default = LoaderIcon;
17124
-
17125
17278
  // src/components/mic-button.tsx
17126
17279
  var chatState = {
17127
17280
  isOpen: false,
@@ -17156,7 +17309,7 @@ var MicButton = ({
17156
17309
  const [currentTheme, setCurrentTheme] = useState10("dark");
17157
17310
  const [isChatOpen, setIsChatOpen] = useState10(chatState.isOpen);
17158
17311
  const [isChatMinimized, setIsChatMinimized] = useState10(chatState.isMinimized);
17159
- useEffect10(() => {
17312
+ useEffect9(() => {
17160
17313
  chatState.isOpen = isChatOpen;
17161
17314
  chatState.isMinimized = isChatMinimized;
17162
17315
  }, [isChatOpen, isChatMinimized]);
@@ -17172,12 +17325,16 @@ var MicButton = ({
17172
17325
  connect: voiceConnect,
17173
17326
  disconnect: voiceDisconnect,
17174
17327
  sendUserCommand: sendUserCommand2,
17328
+ sendChatMessage,
17175
17329
  messages: messageManagerMessages,
17176
17330
  micState,
17177
17331
  setMicState,
17178
17332
  status,
17179
17333
  setStatus,
17180
- participants
17334
+ participants,
17335
+ muteState,
17336
+ toggleMute,
17337
+ setMute
17181
17338
  } = useCuekit({
17182
17339
  // Don't override navigation command - let the provider handle it
17183
17340
  onConnectionStateChange: (state) => {
@@ -17190,7 +17347,7 @@ var MicButton = ({
17190
17347
  onAISpeechEnd: (trackId) => handleAISpeech(false, trackId),
17191
17348
  appId
17192
17349
  });
17193
- useEffect10(() => {
17350
+ useEffect9(() => {
17194
17351
  const checkTheme = () => {
17195
17352
  if (typeof document !== "undefined") {
17196
17353
  let newTheme;
@@ -17258,7 +17415,7 @@ var MicButton = ({
17258
17415
  },
17259
17416
  [status, micState, isConnected]
17260
17417
  );
17261
- useEffect10(() => {
17418
+ useEffect9(() => {
17262
17419
  if (audioContainerRef.current) {
17263
17420
  setAudioContainer(audioContainerRef);
17264
17421
  }
@@ -17285,17 +17442,17 @@ var MicButton = ({
17285
17442
  }
17286
17443
  return isConnected2 ? "Ready" : "Connecting...";
17287
17444
  };
17288
- useEffect10(() => {
17445
+ useEffect9(() => {
17289
17446
  if (isConnected) {
17290
17447
  } else {
17291
17448
  }
17292
17449
  }, [isConnected]);
17293
- useEffect10(() => {
17450
+ useEffect9(() => {
17294
17451
  if (isConnected && !isChatOpen) {
17295
17452
  openChat();
17296
17453
  }
17297
17454
  }, [isConnected, isChatOpen, openChat]);
17298
- useEffect10(() => {
17455
+ useEffect9(() => {
17299
17456
  if (messageManagerMessages.length > 0 && !isChatOpen) {
17300
17457
  openChat();
17301
17458
  }
@@ -17324,7 +17481,9 @@ var MicButton = ({
17324
17481
  apiKey,
17325
17482
  appId,
17326
17483
  openChat,
17327
- showBorderGlow
17484
+ showBorderGlow,
17485
+ sendChatMessage,
17486
+ isChatOpen
17328
17487
  ]);
17329
17488
  const handleSendText = async (textToSend) => {
17330
17489
  setMicState("thinking");
@@ -17334,13 +17493,14 @@ var MicButton = ({
17334
17493
  }
17335
17494
  if (isConnected) {
17336
17495
  try {
17337
- await sendUserCommand2(textToSend);
17496
+ await sendChatMessage(textToSend);
17338
17497
  setMicState("replying");
17339
17498
  setTimeout(() => {
17340
17499
  setMicState("listening");
17341
17500
  if (showBorderGlow) setShowBodyGlow(true);
17342
17501
  }, 1e3);
17343
17502
  } catch (error) {
17503
+ console.error("Failed to send chat message:", error);
17344
17504
  } finally {
17345
17505
  setMicState("listening");
17346
17506
  if (showBorderGlow) setShowBodyGlow(true);
@@ -17367,8 +17527,11 @@ var MicButton = ({
17367
17527
  filter: "drop-shadow(0 10px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1))",
17368
17528
  ...imageStyle
17369
17529
  };
17370
- const animatedImageStyle = micState === "thinking" ? { ...baseImageStyle, animation: "spin 1s linear infinite" } : micState === "replying" ? { ...baseImageStyle, animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite" } : baseImageStyle;
17371
- return /* @__PURE__ */ React11.createElement("img", { src: imageSource, alt: "Voice Assistant", style: animatedImageStyle });
17530
+ if (micState === "idle") {
17531
+ return /* @__PURE__ */ React11.createElement("img", { src: imageSource, alt: "Voice Assistant", style: baseImageStyle });
17532
+ } else {
17533
+ return /* @__PURE__ */ React11.createElement(VoiceIntensityWrapper, { active: true, buttonSize });
17534
+ }
17372
17535
  }
17373
17536
  const iconStyle = {
17374
17537
  width: `100%`,
@@ -17376,15 +17539,10 @@ var MicButton = ({
17376
17539
  color: "white",
17377
17540
  filter: "drop-shadow(0 10px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1))"
17378
17541
  };
17379
- switch (micState) {
17380
- case "thinking":
17381
- return /* @__PURE__ */ React11.createElement(loader_default, { style: { ...iconStyle, animation: "spin 1s linear infinite" } });
17382
- case "replying":
17383
- return /* @__PURE__ */ React11.createElement(VoiceIntensityWrapper, { active: true, buttonSize });
17384
- case "listening":
17385
- return /* @__PURE__ */ React11.createElement(VoiceIntensityWrapper, { active: true, buttonSize });
17386
- default:
17387
- return /* @__PURE__ */ React11.createElement(mic_default, { style: iconStyle });
17542
+ if (micState === "idle") {
17543
+ return /* @__PURE__ */ React11.createElement(mic_default, { style: iconStyle });
17544
+ } else {
17545
+ return /* @__PURE__ */ React11.createElement(VoiceIntensityWrapper, { active: true, buttonSize });
17388
17546
  }
17389
17547
  };
17390
17548
  const getPositionStyle = () => {
@@ -17452,7 +17610,6 @@ var MicButton = ({
17452
17610
  case "thinking":
17453
17611
  baseStyle.transform = "scale(1.05)";
17454
17612
  baseStyle.boxShadow = "0 20px 25px -5px rgba(196, 132, 252, 0.4)";
17455
- baseStyle.animation = "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite";
17456
17613
  break;
17457
17614
  case "replying":
17458
17615
  baseStyle.transform = "scale(1.05)";
@@ -17529,7 +17686,9 @@ var MicButton = ({
17529
17686
  currentTheme,
17530
17687
  onThemeToggle: setCurrentTheme,
17531
17688
  status: getUserFriendlyStatus(micState, isConnected ?? false),
17532
- anchor: { position: screenPosition, bottom: bottomSpace, size: buttonSize }
17689
+ anchor: { position: screenPosition, bottom: bottomSpace, size: buttonSize },
17690
+ muteState,
17691
+ onToggleMute: toggleMute
17533
17692
  }
17534
17693
  ), isChatOpen && isChatMinimized && /* @__PURE__ */ React11.createElement(
17535
17694
  "button",