@pipecat-ai/client-react 0.4.1 → 1.0.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.
@@ -1,9 +1,9 @@
1
1
  import {jsx as $h9lXz$jsx, Fragment as $h9lXz$Fragment} from "react/jsx-runtime";
2
- import {RTVIEvent as $h9lXz$RTVIEvent} from "@pipecat-ai/client-js";
2
+ import {RTVIEvent as $h9lXz$RTVIEvent, setAboutClient as $h9lXz$setAboutClient} from "@pipecat-ai/client-js";
3
3
  import $h9lXz$react, {useRef as $h9lXz$useRef, useEffect as $h9lXz$useEffect, useCallback as $h9lXz$useCallback, useContext as $h9lXz$useContext, createContext as $h9lXz$createContext, useState as $h9lXz$useState, forwardRef as $h9lXz$forwardRef} from "react";
4
- import {createStore as $h9lXz$createStore, atom as $h9lXz$atom, useAtomValue as $h9lXz$useAtomValue, useAtom as $h9lXz$useAtom} from "jotai";
5
- import {Provider as $h9lXz$Provider} from "jotai/react";
4
+ import {atom as $h9lXz$atom, useAtomValue as $h9lXz$useAtomValue, createStore as $h9lXz$createStore, useAtom as $h9lXz$useAtom} from "jotai";
6
5
  import {atomFamily as $h9lXz$atomFamily, useAtomCallback as $h9lXz$useAtomCallback} from "jotai/utils";
6
+ import {Provider as $h9lXz$Provider} from "jotai/react";
7
7
 
8
8
  /**
9
9
  * Copyright (c) 2024, Daily.
@@ -17,6 +17,9 @@ import {atomFamily as $h9lXz$atomFamily, useAtomCallback as $h9lXz$useAtomCallba
17
17
  *
18
18
  * SPDX-License-Identifier: BSD-2-Clause
19
19
  */
20
+
21
+
22
+
20
23
  /**
21
24
  * Copyright (c) 2024, Daily.
22
25
  *
@@ -26,81 +29,132 @@ import {atomFamily as $h9lXz$atomFamily, useAtomCallback as $h9lXz$useAtomCallba
26
29
 
27
30
 
28
31
 
29
- const $f3f7d4263dc13c6a$var$defaultStore = (0, $h9lXz$createStore)();
30
- const $f3f7d4263dc13c6a$export$8d2b07cbee622e7c = /*#__PURE__*/ (0, $h9lXz$createContext)({});
31
- const $f3f7d4263dc13c6a$export$4a4ae2d5dc96782 = ({ children: children, client: client, jotaiStore: jotaiStore = $f3f7d4263dc13c6a$var$defaultStore })=>{
32
+
33
+ var $ad20387e24e513d4$exports = {};
34
+ $ad20387e24e513d4$exports = JSON.parse("{\"name\":\"@pipecat-ai/client-react\",\"version\":\"1.0.0\",\"license\":\"BSD-2-Clause\",\"main\":\"dist/index.js\",\"module\":\"dist/index.module.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.ts\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/pipecat-ai/pipecat-client-web.git\"},\"files\":[\"dist\",\"package.json\",\"README.md\"],\"scripts\":{\"build\":\"parcel build --no-cache\",\"dev\":\"parcel watch\",\"lint\":\"eslint . --report-unused-disable-directives --max-warnings 0 --ignore-pattern 'dist/'\"},\"devDependencies\":{\"@pipecat-ai/client-js\":\"*\",\"@types/react\":\"^18.3.3\",\"@types/react-dom\":\"^18.3.0\",\"@typescript-eslint/eslint-plugin\":\"^8.32.0\",\"eslint\":\"^9.11.1\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-plugin-react-hooks\":\"^5.2.0\",\"eslint-plugin-simple-import-sort\":\"^12.1.1\",\"parcel\":\"^2.12.0\",\"react\":\"^18.3.1\",\"react-dom\":\"^18.3.1\",\"typescript\":\"^5.2.2\"},\"peerDependencies\":{\"@pipecat-ai/client-js\":\"*\",\"react\":\">=18\",\"react-dom\":\">=18\"},\"dependencies\":{\"jotai\":\"^2.9.0\"}}");
35
+
36
+
37
+
38
+ const $33f16f27e37c90bc$export$fe23d0ef95286467 = /*#__PURE__*/ (0, $h9lXz$createContext)({
39
+ on: ()=>{},
40
+ off: ()=>{}
41
+ });
42
+
43
+
44
+ const $d2e362c5a07ee3c5$var$defaultStore = (0, $h9lXz$createStore)();
45
+ const $d2e362c5a07ee3c5$export$67f6d73bc6cd7bb1 = /*#__PURE__*/ (0, $h9lXz$createContext)({});
46
+ const $d2e362c5a07ee3c5$export$bb43666ced7a20d0 = ({ children: children, client: client, jotaiStore: jotaiStore = $d2e362c5a07ee3c5$var$defaultStore })=>{
47
+ (0, $h9lXz$useEffect)(()=>{
48
+ (0, $h9lXz$setAboutClient)({
49
+ library: (0, $ad20387e24e513d4$exports.name),
50
+ library_version: (0, $ad20387e24e513d4$exports.version)
51
+ });
52
+ }, []);
53
+ const eventHandlersMap = (0, $h9lXz$useRef)({});
54
+ (0, $h9lXz$useEffect)(()=>{
55
+ if (!client) return;
56
+ const allEvents = Object.values((0, $h9lXz$RTVIEvent)).filter((value)=>isNaN(Number(value)));
57
+ const allHandlers = {};
58
+ allEvents.forEach((event)=>{
59
+ const handler = (...payload)=>{
60
+ const handlers = eventHandlersMap.current[event];
61
+ if (!handlers) return;
62
+ handlers.forEach((h)=>{
63
+ h(...payload);
64
+ });
65
+ };
66
+ allHandlers[event] = handler;
67
+ client.on(event, handler);
68
+ });
69
+ return ()=>{
70
+ allEvents.forEach((event)=>{
71
+ client.off(event, allHandlers[event]);
72
+ });
73
+ };
74
+ }, [
75
+ client
76
+ ]);
77
+ const on = (0, $h9lXz$useCallback)((event, handler)=>{
78
+ if (!eventHandlersMap.current[event]) eventHandlersMap.current[event] = new Set();
79
+ eventHandlersMap.current[event].add(handler);
80
+ }, []);
81
+ const off = (0, $h9lXz$useCallback)((event, handler)=>{
82
+ eventHandlersMap.current[event]?.delete(handler);
83
+ }, []);
32
84
  return (0, $h9lXz$jsx)((0, $h9lXz$Provider), {
33
85
  store: jotaiStore,
34
- children: (0, $h9lXz$jsx)($f3f7d4263dc13c6a$export$8d2b07cbee622e7c.Provider, {
86
+ children: (0, $h9lXz$jsx)($d2e362c5a07ee3c5$export$67f6d73bc6cd7bb1.Provider, {
35
87
  value: {
36
88
  client: client
37
89
  },
38
- children: children
90
+ children: (0, $h9lXz$jsx)((0, $33f16f27e37c90bc$export$fe23d0ef95286467).Provider, {
91
+ value: {
92
+ on: on,
93
+ off: off
94
+ },
95
+ children: children
96
+ })
39
97
  })
40
98
  });
41
99
  };
42
- $f3f7d4263dc13c6a$export$4a4ae2d5dc96782.displayName = "RTVIClientProvider";
100
+ $d2e362c5a07ee3c5$export$bb43666ced7a20d0.displayName = "PipecatClientProvider";
43
101
 
44
102
 
45
- const $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba = ()=>{
46
- const { client: client } = (0, $h9lXz$useContext)((0, $f3f7d4263dc13c6a$export$8d2b07cbee622e7c));
103
+ const $034a56e7ee1b7bed$export$777fa8498be78705 = ()=>{
104
+ const { client: client } = (0, $h9lXz$useContext)((0, $d2e362c5a07ee3c5$export$67f6d73bc6cd7bb1));
47
105
  return client;
48
106
  };
49
107
 
50
108
 
109
+ /**
110
+ * Copyright (c) 2024, Daily.
111
+ *
112
+ * SPDX-License-Identifier: BSD-2-Clause
113
+ */
114
+
51
115
  const $824ea64b5f757259$export$33a6ac53b8f02625 = (event, handler)=>{
52
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
116
+ const { on: on, off: off } = (0, $h9lXz$useContext)((0, $33f16f27e37c90bc$export$fe23d0ef95286467));
53
117
  (0, $h9lXz$useEffect)(()=>{
54
- if (!client) return;
55
- client.on(event, handler);
118
+ on(event, handler);
56
119
  return ()=>{
57
- client.off(event, handler);
120
+ off(event, handler);
58
121
  };
59
122
  }, [
60
123
  event,
61
124
  handler,
62
- client
125
+ on,
126
+ off
63
127
  ]);
64
128
  };
65
129
 
66
130
 
67
- /**
68
- * Copyright (c) 2024, Daily.
69
- *
70
- * SPDX-License-Identifier: BSD-2-Clause
71
- */
72
-
73
-
74
-
75
-
76
-
77
- const $194c75143b7a1fa0$var$localAudioTrackAtom = (0, $h9lXz$atom)(null);
78
- const $194c75143b7a1fa0$var$localVideoTrackAtom = (0, $h9lXz$atom)(null);
79
- const $194c75143b7a1fa0$var$localScreenAudioTrackAtom = (0, $h9lXz$atom)(null);
80
- const $194c75143b7a1fa0$var$localScreenVideoTrackAtom = (0, $h9lXz$atom)(null);
81
- const $194c75143b7a1fa0$var$botAudioTrackAtom = (0, $h9lXz$atom)(null);
82
- const $194c75143b7a1fa0$var$botVideoTrackAtom = (0, $h9lXz$atom)(null);
83
- const $194c75143b7a1fa0$var$trackAtom = (0, $h9lXz$atomFamily)(({ local: local, trackType: trackType })=>{
131
+ const $4b4b9099cdb5b776$var$localAudioTrackAtom = (0, $h9lXz$atom)(null);
132
+ const $4b4b9099cdb5b776$var$localVideoTrackAtom = (0, $h9lXz$atom)(null);
133
+ const $4b4b9099cdb5b776$var$localScreenAudioTrackAtom = (0, $h9lXz$atom)(null);
134
+ const $4b4b9099cdb5b776$var$localScreenVideoTrackAtom = (0, $h9lXz$atom)(null);
135
+ const $4b4b9099cdb5b776$var$botAudioTrackAtom = (0, $h9lXz$atom)(null);
136
+ const $4b4b9099cdb5b776$var$botVideoTrackAtom = (0, $h9lXz$atom)(null);
137
+ const $4b4b9099cdb5b776$var$trackAtom = (0, $h9lXz$atomFamily)(({ local: local, trackType: trackType })=>{
84
138
  if (local) switch(trackType){
85
139
  case "audio":
86
- return $194c75143b7a1fa0$var$localAudioTrackAtom;
140
+ return $4b4b9099cdb5b776$var$localAudioTrackAtom;
87
141
  case "screenAudio":
88
- return $194c75143b7a1fa0$var$localScreenAudioTrackAtom;
142
+ return $4b4b9099cdb5b776$var$localScreenAudioTrackAtom;
89
143
  case "screenVideo":
90
- return $194c75143b7a1fa0$var$localScreenVideoTrackAtom;
144
+ return $4b4b9099cdb5b776$var$localScreenVideoTrackAtom;
91
145
  case "video":
92
- return $194c75143b7a1fa0$var$localVideoTrackAtom;
146
+ return $4b4b9099cdb5b776$var$localVideoTrackAtom;
93
147
  }
94
- return trackType === "audio" ? $194c75143b7a1fa0$var$botAudioTrackAtom : $194c75143b7a1fa0$var$botVideoTrackAtom;
148
+ return trackType === "audio" ? $4b4b9099cdb5b776$var$botAudioTrackAtom : $4b4b9099cdb5b776$var$botVideoTrackAtom;
95
149
  });
96
- const $194c75143b7a1fa0$export$7c03381e0d26a6c3 = (trackType, participantType)=>{
97
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
98
- const track = (0, $h9lXz$useAtomValue)($194c75143b7a1fa0$var$trackAtom({
150
+ const $4b4b9099cdb5b776$export$9813dcd2d0c26814 = (trackType, participantType)=>{
151
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
152
+ const track = (0, $h9lXz$useAtomValue)($4b4b9099cdb5b776$var$trackAtom({
99
153
  local: participantType === "local",
100
154
  trackType: trackType
101
155
  }));
102
156
  const updateTrack = (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((get, set, track, trackType, local)=>{
103
- const atom = $194c75143b7a1fa0$var$trackAtom({
157
+ const atom = $4b4b9099cdb5b776$var$trackAtom({
104
158
  local: local,
105
159
  trackType: trackType
106
160
  });
@@ -135,9 +189,10 @@ const $194c75143b7a1fa0$export$7c03381e0d26a6c3 = (trackType, participantType)=>
135
189
  };
136
190
 
137
191
 
138
- const $f8b885726fc652c0$export$ba1245f7cbf3ae02 = ()=>{
192
+
193
+ const $f209aa7ddb77dcb2$export$b52250cb73ff4de1 = ()=>{
139
194
  const botAudioRef = (0, $h9lXz$useRef)(null);
140
- const botAudioTrack = (0, $194c75143b7a1fa0$export$7c03381e0d26a6c3)("audio", "bot");
195
+ const botAudioTrack = (0, $4b4b9099cdb5b776$export$9813dcd2d0c26814)("audio", "bot");
141
196
  (0, $h9lXz$useEffect)(()=>{
142
197
  if (!botAudioRef.current || !botAudioTrack) return;
143
198
  if (botAudioRef.current.srcObject) {
@@ -162,7 +217,7 @@ const $f8b885726fc652c0$export$ba1245f7cbf3ae02 = ()=>{
162
217
  })
163
218
  });
164
219
  };
165
- $f8b885726fc652c0$export$ba1245f7cbf3ae02.displayName = "RTVIClientAudio";
220
+ $f209aa7ddb77dcb2$export$b52250cb73ff4de1.displayName = "PipecatClientAudio";
166
221
 
167
222
 
168
223
 
@@ -176,18 +231,18 @@ $f8b885726fc652c0$export$ba1245f7cbf3ae02.displayName = "RTVIClientAudio";
176
231
  */
177
232
 
178
233
 
179
- const $8376ffbc1b1f3c97$var$transportStateAtom = (0, $h9lXz$atom)("disconnected");
180
- const $8376ffbc1b1f3c97$export$599fa01283bd4ece = ()=>{
181
- const [transportState, setTransportState] = (0, $h9lXz$useAtom)($8376ffbc1b1f3c97$var$transportStateAtom);
234
+ const $33f3729bbe9f09df$var$transportStateAtom = (0, $h9lXz$atom)("disconnected");
235
+ const $33f3729bbe9f09df$export$30aee278309a867b = ()=>{
236
+ const [transportState, setTransportState] = (0, $h9lXz$useAtom)($33f3729bbe9f09df$var$transportStateAtom);
182
237
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).TransportStateChanged, setTransportState);
183
238
  return transportState;
184
239
  };
185
240
 
186
241
 
187
- const $7662c16ae3a8c331$export$46099a7ec2fe8ac5 = ()=>{
188
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
242
+ const $e76ee2f021b54325$export$3ea2601427f0430f = ()=>{
243
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
189
244
  const [isCamEnabled, setIsCamEnabled] = (0, $h9lXz$useState)(client?.isCamEnabled ?? false);
190
- const transportState = (0, $8376ffbc1b1f3c97$export$599fa01283bd4ece)();
245
+ const transportState = (0, $33f3729bbe9f09df$export$30aee278309a867b)();
191
246
  // Sync component state with client state initially
192
247
  (0, $h9lXz$useEffect)(()=>{
193
248
  if (!client || transportState !== "initialized" || typeof client.isCamEnabled !== "boolean") return;
@@ -209,8 +264,8 @@ const $7662c16ae3a8c331$export$46099a7ec2fe8ac5 = ()=>{
209
264
  };
210
265
 
211
266
 
212
- const $379da083c72543d5$export$156c26e16246ae3e = ({ onCamEnabledChanged: onCamEnabledChanged, disabled: disabled = false, children: children })=>{
213
- const { isCamEnabled: isCamEnabled, enableCam: enableCam } = (0, $7662c16ae3a8c331$export$46099a7ec2fe8ac5)();
267
+ const $7cb2ce2c4cbfb401$export$dc9a029eeca8213f = ({ onCamEnabledChanged: onCamEnabledChanged, disabled: disabled = false, children: children })=>{
268
+ const { isCamEnabled: isCamEnabled, enableCam: enableCam } = (0, $e76ee2f021b54325$export$3ea2601427f0430f)();
214
269
  const handleToggleCam = (0, $h9lXz$useCallback)(()=>{
215
270
  if (disabled) return;
216
271
  const newEnabledState = !isCamEnabled;
@@ -230,7 +285,7 @@ const $379da083c72543d5$export$156c26e16246ae3e = ({ onCamEnabledChanged: onCamE
230
285
  })
231
286
  });
232
287
  };
233
- var $379da083c72543d5$export$2e2bcd8739ae039 = $379da083c72543d5$export$156c26e16246ae3e;
288
+ var $7cb2ce2c4cbfb401$export$2e2bcd8739ae039 = $7cb2ce2c4cbfb401$export$dc9a029eeca8213f;
234
289
 
235
290
 
236
291
 
@@ -238,10 +293,10 @@ var $379da083c72543d5$export$2e2bcd8739ae039 = $379da083c72543d5$export$156c26e1
238
293
 
239
294
 
240
295
 
241
- const $e6f5302cf8392476$export$805915964ad7bc25 = ()=>{
242
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
296
+ const $5905c001b0dc8d25$export$388e706586309ef0 = ()=>{
297
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
243
298
  const [isMicEnabled, setIsMicEnabled] = (0, $h9lXz$useState)(client?.isMicEnabled ?? false);
244
- const transportState = (0, $8376ffbc1b1f3c97$export$599fa01283bd4ece)();
299
+ const transportState = (0, $33f3729bbe9f09df$export$30aee278309a867b)();
245
300
  // Sync component state with client state initially
246
301
  (0, $h9lXz$useEffect)(()=>{
247
302
  if (!client || transportState !== "initialized" || typeof client.isMicEnabled !== "boolean") return;
@@ -263,8 +318,8 @@ const $e6f5302cf8392476$export$805915964ad7bc25 = ()=>{
263
318
  };
264
319
 
265
320
 
266
- const $5bebec90a95fc7e5$export$bf1c2c9ca877628d = ({ onMicEnabledChanged: onMicEnabledChanged, disabled: disabled = false, children: children })=>{
267
- const { enableMic: enableMic, isMicEnabled: isMicEnabled } = (0, $e6f5302cf8392476$export$805915964ad7bc25)();
321
+ const $2984fdfc31bad375$export$bc8133b69ff660a2 = ({ onMicEnabledChanged: onMicEnabledChanged, disabled: disabled = false, children: children })=>{
322
+ const { enableMic: enableMic, isMicEnabled: isMicEnabled } = (0, $5905c001b0dc8d25$export$388e706586309ef0)();
268
323
  const handleToggleMic = (0, $h9lXz$useCallback)(()=>{
269
324
  if (disabled) return;
270
325
  const newEnabledState = !isMicEnabled;
@@ -284,7 +339,7 @@ const $5bebec90a95fc7e5$export$bf1c2c9ca877628d = ({ onMicEnabledChanged: onMicE
284
339
  })
285
340
  });
286
341
  };
287
- var $5bebec90a95fc7e5$export$2e2bcd8739ae039 = $5bebec90a95fc7e5$export$bf1c2c9ca877628d;
342
+ var $2984fdfc31bad375$export$2e2bcd8739ae039 = $2984fdfc31bad375$export$bc8133b69ff660a2;
288
343
 
289
344
 
290
345
 
@@ -314,8 +369,8 @@ var $9098519210cf34e2$export$2e2bcd8739ae039 = $9098519210cf34e2$var$useMergedRe
314
369
 
315
370
 
316
371
 
317
- const $b76d887910983811$export$d090a384943608eb = /*#__PURE__*/ (0, $h9lXz$forwardRef)(function VoiceClientVideo({ participant: participant = "local", fit: fit = "contain", mirror: mirror, onResize: onResize, style: style = {}, trackType: trackType = "video", ...props }, ref) {
318
- const videoTrack = (0, $194c75143b7a1fa0$export$7c03381e0d26a6c3)(trackType, participant);
372
+ const $6a65deb8615a2ad7$export$85974db6d0cc43b3 = /*#__PURE__*/ (0, $h9lXz$forwardRef)(function VoiceClientVideo({ participant: participant = "local", fit: fit = "contain", mirror: mirror, onResize: onResize, style: style = {}, trackType: trackType = "video", ...props }, ref) {
373
+ const videoTrack = (0, $4b4b9099cdb5b776$export$9813dcd2d0c26814)(trackType, participant);
319
374
  const videoEl = (0, $h9lXz$useRef)(null);
320
375
  const videoRef = (0, $9098519210cf34e2$export$2e2bcd8739ae039)(videoEl, ref);
321
376
  /**
@@ -427,8 +482,7 @@ const $b76d887910983811$export$d090a384943608eb = /*#__PURE__*/ (0, $h9lXz$forwa
427
482
  ...props
428
483
  });
429
484
  });
430
- $b76d887910983811$export$d090a384943608eb.displayName = "RTVIClientVideo";
431
-
485
+ $6a65deb8615a2ad7$export$85974db6d0cc43b3.displayName = "PipecatClientVideo";
432
486
 
433
487
 
434
488
 
@@ -439,31 +493,31 @@ $b76d887910983811$export$d090a384943608eb.displayName = "RTVIClientVideo";
439
493
 
440
494
 
441
495
 
442
- const $c7d06534b21735c2$var$availableMicsAtom = (0, $h9lXz$atom)([]);
443
- const $c7d06534b21735c2$var$availableCamsAtom = (0, $h9lXz$atom)([]);
444
- const $c7d06534b21735c2$var$availableSpeakersAtom = (0, $h9lXz$atom)([]);
445
- const $c7d06534b21735c2$var$selectedMicAtom = (0, $h9lXz$atom)({});
446
- const $c7d06534b21735c2$var$selectedCamAtom = (0, $h9lXz$atom)({});
447
- const $c7d06534b21735c2$var$selectedSpeakerAtom = (0, $h9lXz$atom)({});
448
- const $c7d06534b21735c2$export$652c54907b83a48d = ()=>{
449
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
450
- const availableCams = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$availableCamsAtom);
451
- const availableMics = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$availableMicsAtom);
452
- const availableSpeakers = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$availableSpeakersAtom);
453
- const selectedCam = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$selectedCamAtom);
454
- const selectedMic = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$selectedMicAtom);
455
- const selectedSpeaker = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$selectedSpeakerAtom);
496
+ const $f934f1f8b10aaf19$var$availableMicsAtom = (0, $h9lXz$atom)([]);
497
+ const $f934f1f8b10aaf19$var$availableCamsAtom = (0, $h9lXz$atom)([]);
498
+ const $f934f1f8b10aaf19$var$availableSpeakersAtom = (0, $h9lXz$atom)([]);
499
+ const $f934f1f8b10aaf19$var$selectedMicAtom = (0, $h9lXz$atom)({});
500
+ const $f934f1f8b10aaf19$var$selectedCamAtom = (0, $h9lXz$atom)({});
501
+ const $f934f1f8b10aaf19$var$selectedSpeakerAtom = (0, $h9lXz$atom)({});
502
+ const $f934f1f8b10aaf19$export$642bc4d2d2a376f1 = ()=>{
503
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
504
+ const availableCams = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$availableCamsAtom);
505
+ const availableMics = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$availableMicsAtom);
506
+ const availableSpeakers = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$availableSpeakersAtom);
507
+ const selectedCam = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$selectedCamAtom);
508
+ const selectedMic = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$selectedMicAtom);
509
+ const selectedSpeaker = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$selectedSpeakerAtom);
456
510
  const initDevices = (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)(async (_get, set)=>{
457
511
  if (!client) return;
458
512
  const availableCams = await client.getAllCams();
459
513
  const availableMics = await client.getAllMics();
460
514
  const availableSpeakers = await client.getAllSpeakers();
461
- set($c7d06534b21735c2$var$availableCamsAtom, availableCams);
462
- set($c7d06534b21735c2$var$availableMicsAtom, availableMics);
463
- set($c7d06534b21735c2$var$availableSpeakersAtom, availableSpeakers);
464
- set($c7d06534b21735c2$var$selectedCamAtom, client.selectedCam);
465
- set($c7d06534b21735c2$var$selectedMicAtom, client.selectedMic);
466
- set($c7d06534b21735c2$var$selectedSpeakerAtom, client.selectedSpeaker);
515
+ set($f934f1f8b10aaf19$var$availableCamsAtom, availableCams);
516
+ set($f934f1f8b10aaf19$var$availableMicsAtom, availableMics);
517
+ set($f934f1f8b10aaf19$var$availableSpeakersAtom, availableSpeakers);
518
+ set($f934f1f8b10aaf19$var$selectedCamAtom, client.selectedCam);
519
+ set($f934f1f8b10aaf19$var$selectedMicAtom, client.selectedMic);
520
+ set($f934f1f8b10aaf19$var$selectedSpeakerAtom, client.selectedSpeaker);
467
521
  }, [
468
522
  client
469
523
  ]));
@@ -473,22 +527,22 @@ const $c7d06534b21735c2$export$652c54907b83a48d = ()=>{
473
527
  initDevices
474
528
  ]);
475
529
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).AvailableCamsUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, cams)=>{
476
- set($c7d06534b21735c2$var$availableCamsAtom, cams);
530
+ set($f934f1f8b10aaf19$var$availableCamsAtom, cams);
477
531
  }, [])));
478
532
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).AvailableMicsUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, mics)=>{
479
- set($c7d06534b21735c2$var$availableMicsAtom, mics);
533
+ set($f934f1f8b10aaf19$var$availableMicsAtom, mics);
480
534
  }, [])));
481
535
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).AvailableSpeakersUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, speakers)=>{
482
- set($c7d06534b21735c2$var$availableSpeakersAtom, speakers);
536
+ set($f934f1f8b10aaf19$var$availableSpeakersAtom, speakers);
483
537
  }, [])));
484
538
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).CamUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, cam)=>{
485
- set($c7d06534b21735c2$var$selectedCamAtom, cam);
539
+ set($f934f1f8b10aaf19$var$selectedCamAtom, cam);
486
540
  }, [])));
487
541
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).MicUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, mic)=>{
488
- set($c7d06534b21735c2$var$selectedMicAtom, mic);
542
+ set($f934f1f8b10aaf19$var$selectedMicAtom, mic);
489
543
  }, [])));
490
544
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).SpeakerUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, speaker)=>{
491
- set($c7d06534b21735c2$var$selectedSpeakerAtom, speaker);
545
+ set($f934f1f8b10aaf19$var$selectedSpeakerAtom, speaker);
492
546
  }, [])));
493
547
  const updateCam = (0, $h9lXz$useCallback)((id)=>{
494
548
  client?.updateCam(id);
@@ -525,9 +579,10 @@ const $c7d06534b21735c2$export$652c54907b83a48d = ()=>{
525
579
 
526
580
 
527
581
 
582
+
528
583
  const $993a744193844a95$export$59bf27bd43679db6 = /*#__PURE__*/ (0, $h9lXz$react).memo(({ backgroundColor: backgroundColor = "transparent", barColor: barColor = "black", barCount: barCount = 5, barGap: barGap = 12, barLineCap: barLineCap = "round", barMaxHeight: barMaxHeight = 120, barOrigin: barOrigin = "center", barWidth: barWidth = 30, participantType: participantType })=>{
529
584
  const canvasRef = (0, $h9lXz$useRef)(null);
530
- const track = (0, $194c75143b7a1fa0$export$7c03381e0d26a6c3)("audio", participantType);
585
+ const track = (0, $4b4b9099cdb5b776$export$9813dcd2d0c26814)("audio", participantType);
531
586
  (0, $h9lXz$useEffect)(()=>{
532
587
  if (!canvasRef.current) return;
533
588
  const canvasWidth = barCount * barWidth + (barCount - 1) * barGap;
@@ -704,5 +759,5 @@ $993a744193844a95$export$59bf27bd43679db6.displayName = "VoiceVisualizer";
704
759
 
705
760
 
706
761
 
707
- export {$f8b885726fc652c0$export$ba1245f7cbf3ae02 as RTVIClientAudio, $379da083c72543d5$export$156c26e16246ae3e as RTVIClientCamToggle, $5bebec90a95fc7e5$export$bf1c2c9ca877628d as RTVIClientMicToggle, $f3f7d4263dc13c6a$export$4a4ae2d5dc96782 as RTVIClientProvider, $b76d887910983811$export$d090a384943608eb as RTVIClientVideo, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba as useRTVIClient, $7662c16ae3a8c331$export$46099a7ec2fe8ac5 as useRTVIClientCamControl, $824ea64b5f757259$export$33a6ac53b8f02625 as useRTVIClientEvent, $c7d06534b21735c2$export$652c54907b83a48d as useRTVIClientMediaDevices, $194c75143b7a1fa0$export$7c03381e0d26a6c3 as useRTVIClientMediaTrack, $e6f5302cf8392476$export$805915964ad7bc25 as useRTVIClientMicControl, $8376ffbc1b1f3c97$export$599fa01283bd4ece as useRTVIClientTransportState, $993a744193844a95$export$59bf27bd43679db6 as VoiceVisualizer};
762
+ export {$f209aa7ddb77dcb2$export$b52250cb73ff4de1 as PipecatClientAudio, $7cb2ce2c4cbfb401$export$dc9a029eeca8213f as PipecatClientCamToggle, $2984fdfc31bad375$export$bc8133b69ff660a2 as PipecatClientMicToggle, $d2e362c5a07ee3c5$export$bb43666ced7a20d0 as PipecatClientProvider, $6a65deb8615a2ad7$export$85974db6d0cc43b3 as PipecatClientVideo, $034a56e7ee1b7bed$export$777fa8498be78705 as usePipecatClient, $e76ee2f021b54325$export$3ea2601427f0430f as usePipecatClientCamControl, $f934f1f8b10aaf19$export$642bc4d2d2a376f1 as usePipecatClientMediaDevices, $4b4b9099cdb5b776$export$9813dcd2d0c26814 as usePipecatClientMediaTrack, $5905c001b0dc8d25$export$388e706586309ef0 as usePipecatClientMicControl, $33f3729bbe9f09df$export$30aee278309a867b as usePipecatClientTransportState, $824ea64b5f757259$export$33a6ac53b8f02625 as useRTVIClientEvent, $993a744193844a95$export$59bf27bd43679db6 as VoiceVisualizer};
708
763
  //# sourceMappingURL=index.module.js.map