livevoice-sdk-react-native 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +13 -0
  3. package/android/build.gradle +135 -0
  4. package/android/generated/java/io/livevoice/react/NativeLiveVoiceSdkSpec.java +182 -0
  5. package/android/generated/jni/CMakeLists.txt +36 -0
  6. package/android/generated/jni/RNLiveVoiceSpec-generated.cpp +229 -0
  7. package/android/generated/jni/RNLiveVoiceSpec.h +31 -0
  8. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI-generated.cpp +238 -0
  9. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +389 -0
  10. package/android/gradle.properties +7 -0
  11. package/android/src/main/AndroidManifest.xml +3 -0
  12. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +293 -0
  13. package/android/src/main/java/io/livevoice/react/LiveVoiceSdkReactNativePackage.kt +45 -0
  14. package/android/src/main/java/io/livevoice/react/Mappings.kt +54 -0
  15. package/android/src/main/java/io/livevoice/react/NativeModels.kt +77 -0
  16. package/ios/LiveVoiceSdkReactNative.h +21 -0
  17. package/ios/LivevoiceSdkReactNative.mm +234 -0
  18. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec-generated.mm +285 -0
  19. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec.h +100 -0
  20. package/ios/generated/RNLiveVoiceSpecJSI-generated.cpp +238 -0
  21. package/ios/generated/RNLiveVoiceSpecJSI.h +389 -0
  22. package/lib/commonjs/components/AudioOutputSwitchView.js +140 -0
  23. package/lib/commonjs/components/AudioOutputSwitchView.js.map +1 -0
  24. package/lib/commonjs/components/BrandingView.js +78 -0
  25. package/lib/commonjs/components/BrandingView.js.map +1 -0
  26. package/lib/commonjs/components/ChannelView.js +117 -0
  27. package/lib/commonjs/components/ChannelView.js.map +1 -0
  28. package/lib/commonjs/components/ErrorView.js +88 -0
  29. package/lib/commonjs/components/ErrorView.js.map +1 -0
  30. package/lib/commonjs/components/LiveVoiceView.js +95 -0
  31. package/lib/commonjs/components/LiveVoiceView.js.map +1 -0
  32. package/lib/commonjs/components/PlayButtonView.js +161 -0
  33. package/lib/commonjs/components/PlayButtonView.js.map +1 -0
  34. package/lib/commonjs/components/ReconnectingView.js +109 -0
  35. package/lib/commonjs/components/ReconnectingView.js.map +1 -0
  36. package/lib/commonjs/components/WarningView.js +58 -0
  37. package/lib/commonjs/components/WarningView.js.map +1 -0
  38. package/lib/commonjs/components/index.js +94 -0
  39. package/lib/commonjs/components/index.js.map +1 -0
  40. package/lib/commonjs/icons/branding.png +0 -0
  41. package/lib/commonjs/icons/cpu.png +0 -0
  42. package/lib/commonjs/icons/headphones.png +0 -0
  43. package/lib/commonjs/icons/mic.png +0 -0
  44. package/lib/commonjs/icons/pause.png +0 -0
  45. package/lib/commonjs/icons/play.png +0 -0
  46. package/lib/commonjs/icons/speaker.png +0 -0
  47. package/lib/commonjs/index.js +310 -0
  48. package/lib/commonjs/index.js.map +1 -0
  49. package/lib/commonjs/specs/NativeLiveVoiceSdk.js +19 -0
  50. package/lib/commonjs/specs/NativeLiveVoiceSdk.js.map +1 -0
  51. package/lib/commonjs/util/Colors.js +30 -0
  52. package/lib/commonjs/util/Colors.js.map +1 -0
  53. package/lib/commonjs/util/ForegroundServiceConfig.js +33 -0
  54. package/lib/commonjs/util/ForegroundServiceConfig.js.map +1 -0
  55. package/lib/commonjs/util/PlayingState.js +24 -0
  56. package/lib/commonjs/util/PlayingState.js.map +1 -0
  57. package/lib/commonjs/util/Translations.js +47 -0
  58. package/lib/commonjs/util/Translations.js.map +1 -0
  59. package/lib/commonjs/util/UIState.js +6 -0
  60. package/lib/commonjs/util/UIState.js.map +1 -0
  61. package/lib/module/components/AudioOutputSwitchView.js +134 -0
  62. package/lib/module/components/AudioOutputSwitchView.js.map +1 -0
  63. package/lib/module/components/BrandingView.js +72 -0
  64. package/lib/module/components/BrandingView.js.map +1 -0
  65. package/lib/module/components/ChannelView.js +110 -0
  66. package/lib/module/components/ChannelView.js.map +1 -0
  67. package/lib/module/components/ErrorView.js +82 -0
  68. package/lib/module/components/ErrorView.js.map +1 -0
  69. package/lib/module/components/LiveVoiceView.js +90 -0
  70. package/lib/module/components/LiveVoiceView.js.map +1 -0
  71. package/lib/module/components/PlayButtonView.js +156 -0
  72. package/lib/module/components/PlayButtonView.js.map +1 -0
  73. package/lib/module/components/ReconnectingView.js +103 -0
  74. package/lib/module/components/ReconnectingView.js.map +1 -0
  75. package/lib/module/components/WarningView.js +52 -0
  76. package/lib/module/components/WarningView.js.map +1 -0
  77. package/lib/module/components/index.js +22 -0
  78. package/lib/module/components/index.js.map +1 -0
  79. package/lib/module/icons/branding.png +0 -0
  80. package/lib/module/icons/cpu.png +0 -0
  81. package/lib/module/icons/headphones.png +0 -0
  82. package/lib/module/icons/mic.png +0 -0
  83. package/lib/module/icons/pause.png +0 -0
  84. package/lib/module/icons/play.png +0 -0
  85. package/lib/module/icons/speaker.png +0 -0
  86. package/lib/module/index.js +215 -0
  87. package/lib/module/index.js.map +1 -0
  88. package/lib/module/specs/NativeLiveVoiceSdk.js +16 -0
  89. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -0
  90. package/lib/module/util/Colors.js +26 -0
  91. package/lib/module/util/Colors.js.map +1 -0
  92. package/lib/module/util/ForegroundServiceConfig.js +28 -0
  93. package/lib/module/util/ForegroundServiceConfig.js.map +1 -0
  94. package/lib/module/util/PlayingState.js +21 -0
  95. package/lib/module/util/PlayingState.js.map +1 -0
  96. package/lib/module/util/Translations.js +41 -0
  97. package/lib/module/util/Translations.js.map +1 -0
  98. package/lib/module/util/UIState.js +4 -0
  99. package/lib/module/util/UIState.js.map +1 -0
  100. package/lib/typescript/commonjs/package.json +1 -0
  101. package/lib/typescript/commonjs/src/components/AudioOutputSwitchView.d.ts +6 -0
  102. package/lib/typescript/commonjs/src/components/AudioOutputSwitchView.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/src/components/BrandingView.d.ts +6 -0
  104. package/lib/typescript/commonjs/src/components/BrandingView.d.ts.map +1 -0
  105. package/lib/typescript/commonjs/src/components/ChannelView.d.ts +13 -0
  106. package/lib/typescript/commonjs/src/components/ChannelView.d.ts.map +1 -0
  107. package/lib/typescript/commonjs/src/components/ErrorView.d.ts +9 -0
  108. package/lib/typescript/commonjs/src/components/ErrorView.d.ts.map +1 -0
  109. package/lib/typescript/commonjs/src/components/LiveVoiceView.d.ts +6 -0
  110. package/lib/typescript/commonjs/src/components/LiveVoiceView.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts +146 -0
  112. package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/src/components/ReconnectingView.d.ts +9 -0
  114. package/lib/typescript/commonjs/src/components/ReconnectingView.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/components/WarningView.d.ts +8 -0
  116. package/lib/typescript/commonjs/src/components/WarningView.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/src/components/index.d.ts +9 -0
  118. package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -0
  119. package/lib/typescript/commonjs/src/index.d.ts +129 -0
  120. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts +47 -0
  122. package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/src/util/Colors.d.ts +13 -0
  124. package/lib/typescript/commonjs/src/util/Colors.d.ts.map +1 -0
  125. package/lib/typescript/commonjs/src/util/ForegroundServiceConfig.d.ts +12 -0
  126. package/lib/typescript/commonjs/src/util/ForegroundServiceConfig.d.ts.map +1 -0
  127. package/lib/typescript/commonjs/src/util/PlayingState.d.ts +7 -0
  128. package/lib/typescript/commonjs/src/util/PlayingState.d.ts.map +1 -0
  129. package/lib/typescript/commonjs/src/util/Translations.d.ts +22 -0
  130. package/lib/typescript/commonjs/src/util/Translations.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/src/util/UIState.d.ts +45 -0
  132. package/lib/typescript/commonjs/src/util/UIState.d.ts.map +1 -0
  133. package/lib/typescript/module/package.json +1 -0
  134. package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts +6 -0
  135. package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts.map +1 -0
  136. package/lib/typescript/module/src/components/BrandingView.d.ts +6 -0
  137. package/lib/typescript/module/src/components/BrandingView.d.ts.map +1 -0
  138. package/lib/typescript/module/src/components/ChannelView.d.ts +13 -0
  139. package/lib/typescript/module/src/components/ChannelView.d.ts.map +1 -0
  140. package/lib/typescript/module/src/components/ErrorView.d.ts +9 -0
  141. package/lib/typescript/module/src/components/ErrorView.d.ts.map +1 -0
  142. package/lib/typescript/module/src/components/LiveVoiceView.d.ts +6 -0
  143. package/lib/typescript/module/src/components/LiveVoiceView.d.ts.map +1 -0
  144. package/lib/typescript/module/src/components/PlayButtonView.d.ts +146 -0
  145. package/lib/typescript/module/src/components/PlayButtonView.d.ts.map +1 -0
  146. package/lib/typescript/module/src/components/ReconnectingView.d.ts +9 -0
  147. package/lib/typescript/module/src/components/ReconnectingView.d.ts.map +1 -0
  148. package/lib/typescript/module/src/components/WarningView.d.ts +8 -0
  149. package/lib/typescript/module/src/components/WarningView.d.ts.map +1 -0
  150. package/lib/typescript/module/src/components/index.d.ts +9 -0
  151. package/lib/typescript/module/src/components/index.d.ts.map +1 -0
  152. package/lib/typescript/module/src/index.d.ts +129 -0
  153. package/lib/typescript/module/src/index.d.ts.map +1 -0
  154. package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts +47 -0
  155. package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -0
  156. package/lib/typescript/module/src/util/Colors.d.ts +13 -0
  157. package/lib/typescript/module/src/util/Colors.d.ts.map +1 -0
  158. package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts +12 -0
  159. package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts.map +1 -0
  160. package/lib/typescript/module/src/util/PlayingState.d.ts +7 -0
  161. package/lib/typescript/module/src/util/PlayingState.d.ts.map +1 -0
  162. package/lib/typescript/module/src/util/Translations.d.ts +22 -0
  163. package/lib/typescript/module/src/util/Translations.d.ts.map +1 -0
  164. package/lib/typescript/module/src/util/UIState.d.ts +45 -0
  165. package/lib/typescript/module/src/util/UIState.d.ts.map +1 -0
  166. package/livevoice-sdk-react-native.podspec +58 -0
  167. package/package.json +207 -0
  168. package/react-native.config.js +12 -0
  169. package/src/components/AudioOutputSwitchView.tsx +145 -0
  170. package/src/components/BrandingView.tsx +66 -0
  171. package/src/components/ChannelView.tsx +99 -0
  172. package/src/components/ErrorView.tsx +89 -0
  173. package/src/components/LiveVoiceView.tsx +120 -0
  174. package/src/components/PlayButtonView.tsx +181 -0
  175. package/src/components/ReconnectingView.tsx +133 -0
  176. package/src/components/WarningView.tsx +60 -0
  177. package/src/components/index.tsx +19 -0
  178. package/src/icons/branding.png +0 -0
  179. package/src/icons/cpu.png +0 -0
  180. package/src/icons/headphones.png +0 -0
  181. package/src/icons/mic.png +0 -0
  182. package/src/icons/pause.png +0 -0
  183. package/src/icons/play.png +0 -0
  184. package/src/icons/speaker.png +0 -0
  185. package/src/index.tsx +221 -0
  186. package/src/specs/NativeLiveVoiceSdk.ts +75 -0
  187. package/src/util/Colors.ts +27 -0
  188. package/src/util/ForegroundServiceConfig.tsx +32 -0
  189. package/src/util/PlayingState.ts +18 -0
  190. package/src/util/Translations.ts +39 -0
  191. package/src/util/UIState.ts +65 -0
@@ -0,0 +1,310 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ initialize: true,
8
+ joinEvent: true,
9
+ leaveEvent: true,
10
+ reconnect: true,
11
+ getCurrentClaims: true,
12
+ getCurrentUiState: true,
13
+ getCurrentSubtitleConfiguration: true,
14
+ getCurrentSubtitles: true,
15
+ getCurrentAudioState: true,
16
+ setLiveVoiceUseSpeaker: true,
17
+ startChannel: true,
18
+ stopChannel: true,
19
+ startSubtitles: true,
20
+ stopSubtitles: true,
21
+ onAudioOutputChanged: true,
22
+ onUiStateChanged: true,
23
+ onAvailableSubtitleConfigsChanged: true,
24
+ onSubtitlesChanged: true
25
+ };
26
+ exports.getCurrentAudioState = getCurrentAudioState;
27
+ exports.getCurrentClaims = getCurrentClaims;
28
+ exports.getCurrentSubtitleConfiguration = getCurrentSubtitleConfiguration;
29
+ exports.getCurrentSubtitles = getCurrentSubtitles;
30
+ exports.getCurrentUiState = getCurrentUiState;
31
+ exports.initialize = initialize;
32
+ exports.joinEvent = joinEvent;
33
+ exports.leaveEvent = leaveEvent;
34
+ exports.onAudioOutputChanged = onAudioOutputChanged;
35
+ exports.onAvailableSubtitleConfigsChanged = onAvailableSubtitleConfigsChanged;
36
+ exports.onSubtitlesChanged = onSubtitlesChanged;
37
+ exports.onUiStateChanged = onUiStateChanged;
38
+ exports.reconnect = reconnect;
39
+ exports.setLiveVoiceUseSpeaker = setLiveVoiceUseSpeaker;
40
+ exports.startChannel = startChannel;
41
+ exports.startSubtitles = startSubtitles;
42
+ exports.stopChannel = stopChannel;
43
+ exports.stopSubtitles = stopSubtitles;
44
+ var _NativeLiveVoiceSdk = _interopRequireDefault(require("./specs/NativeLiveVoiceSdk.js"));
45
+ var _ForegroundServiceConfig = require("./util/ForegroundServiceConfig.js");
46
+ Object.keys(_ForegroundServiceConfig).forEach(function (key) {
47
+ if (key === "default" || key === "__esModule") return;
48
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
49
+ if (key in exports && exports[key] === _ForegroundServiceConfig[key]) return;
50
+ Object.defineProperty(exports, key, {
51
+ enumerable: true,
52
+ get: function () {
53
+ return _ForegroundServiceConfig[key];
54
+ }
55
+ });
56
+ });
57
+ var _index = require("./components/index.js");
58
+ Object.keys(_index).forEach(function (key) {
59
+ if (key === "default" || key === "__esModule") return;
60
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
61
+ if (key in exports && exports[key] === _index[key]) return;
62
+ Object.defineProperty(exports, key, {
63
+ enumerable: true,
64
+ get: function () {
65
+ return _index[key];
66
+ }
67
+ });
68
+ });
69
+ var _Translations = require("./util/Translations.js");
70
+ Object.keys(_Translations).forEach(function (key) {
71
+ if (key === "default" || key === "__esModule") return;
72
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
73
+ if (key in exports && exports[key] === _Translations[key]) return;
74
+ Object.defineProperty(exports, key, {
75
+ enumerable: true,
76
+ get: function () {
77
+ return _Translations[key];
78
+ }
79
+ });
80
+ });
81
+ var _UIState = require("./util/UIState.js");
82
+ Object.keys(_UIState).forEach(function (key) {
83
+ if (key === "default" || key === "__esModule") return;
84
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
85
+ if (key in exports && exports[key] === _UIState[key]) return;
86
+ Object.defineProperty(exports, key, {
87
+ enumerable: true,
88
+ get: function () {
89
+ return _UIState[key];
90
+ }
91
+ });
92
+ });
93
+ var _PlayingState = require("./util/PlayingState.js");
94
+ Object.keys(_PlayingState).forEach(function (key) {
95
+ if (key === "default" || key === "__esModule") return;
96
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
97
+ if (key in exports && exports[key] === _PlayingState[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _PlayingState[key];
102
+ }
103
+ });
104
+ });
105
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
106
+ /*
107
+ * This source file is part of the LiveVoice SDK project
108
+ *
109
+ * Copyright (c) LiveVoice GmbH
110
+ * Licensed under the MIT license
111
+ *
112
+ * See LICENSE for license information
113
+ *
114
+ * SPDX-License-Identifier: MIT
115
+ */
116
+
117
+ /**
118
+ * Initialize the LiveVoice SDK.
119
+ *
120
+ * @param {ForegroundServiceConfig} [androidServiceConfig=serviceDisabled] - Pass the service config on Android.
121
+ */
122
+ function initialize(androidServiceConfig = _ForegroundServiceConfig.serviceDisabled) {
123
+ let serviceTypeAsString;
124
+ switch (androidServiceConfig.type) {
125
+ case 'Disabled':
126
+ serviceTypeAsString = null;
127
+ break;
128
+ case 'Enabled':
129
+ if (androidServiceConfig.message == null) serviceTypeAsString = 'LV_NOTIFICATION_DEFAULT_MESSAGE';else serviceTypeAsString = androidServiceConfig.message;
130
+ break;
131
+ }
132
+
133
+ // Interface cannot take default-parameter, so we need to wrap it here
134
+ _NativeLiveVoiceSdk.default.initialize(serviceTypeAsString);
135
+ }
136
+
137
+ /**
138
+ * Join an event.
139
+ *
140
+ * @abstract By joining an event you can display the event's channels.
141
+ *
142
+ * @param {string} joinCode - The listener code of your event. You can find it on the event page of the admin web-interface by clicking on 'Share with your audience'.
143
+ * @param {string | null} password - The optional password to join the event. If a password has been set for listeners in your event, it can be found in the 'Access' tab of the event page of the admin web-interface.
144
+ * @param {string} apiKey - Your API key. You can find your API key in the account page when logged in on the website.
145
+ */
146
+ function joinEvent(joinCode, password, apiKey) {
147
+ return _NativeLiveVoiceSdk.default.joinEvent(joinCode, password, apiKey);
148
+ }
149
+
150
+ /**
151
+ * Leave the current event.
152
+ *
153
+ * @abstract You can explicitly leave an event to tear down any network connections the SDK uses when you no longer display any channels.
154
+ */
155
+ function leaveEvent() {
156
+ return _NativeLiveVoiceSdk.default.leaveEvent();
157
+ }
158
+
159
+ /**
160
+ * Reconnect when a connection error occurred.
161
+ *
162
+ * @abstract Call this method to try to reconnect when a connection error has occurred.
163
+ */
164
+ function reconnect() {
165
+ return _NativeLiveVoiceSdk.default.reconnect();
166
+ }
167
+
168
+ /**
169
+ * Get the claims for the current event.
170
+ *
171
+ * @abstract The claims determine the authorized features for an API key. Claims are available, once an event has been joined.
172
+ * @returns {Claims | null} The authorization claims, or `nil` if not yet joined
173
+ */
174
+ function getCurrentClaims() {
175
+ const claims = _NativeLiveVoiceSdk.default.getCurrentClaims();
176
+ if (claims == null) return null;
177
+ return JSON.parse(claims);
178
+ }
179
+
180
+ /**
181
+ * Get the current state of the LiveVoice SDK.
182
+ *
183
+ * @abstract You should only need to call this method to get an initial value. Use {@link onUiStateChanged}
184
+ ` to be updated about the view state.
185
+ * @returns {UiState} The current view state
186
+ */
187
+ function getCurrentUiState() {
188
+ return JSON.parse(_NativeLiveVoiceSdk.default.getCurrentUiState());
189
+ }
190
+
191
+ /**
192
+ * Get the current available subtitle configurations LiveVoice SDK.
193
+ *
194
+ * @abstract You should only need to call this method to get an initial value. Use {@link onAvailableSubtitleConfigsChanged}
195
+ ` to be updated when the available subtitle configurations change.
196
+ * @returns {AvailableSubtitleConfigs} The current available subtitle configuration
197
+ */
198
+ function getCurrentSubtitleConfiguration() {
199
+ return JSON.parse(_NativeLiveVoiceSdk.default.getCurrentAvailableSubtitleConfigs());
200
+ }
201
+
202
+ /**
203
+ * Get the current subtitle elemens LiveVoice SDK.
204
+ *
205
+ * @abstract You should only need to call this method to get an initial value. Use {@link onSubtitlesChanged}
206
+ ` to be updated when the new subtitles are added.
207
+ * @returns {[String]} The current subtitles
208
+ */
209
+ function getCurrentSubtitles() {
210
+ return JSON.parse(_NativeLiveVoiceSdk.default.getCurrentSubtitles());
211
+ }
212
+
213
+ /**
214
+ * Get the current state of the audio output.
215
+ *
216
+ * @abstract You should only need to call this method to get an initial value. Use {@link onAudioOutputChanged}
217
+ ` to be updated about the audio state.
218
+ * @returns {boolean} `true` for the speaker and `false` for the receiver.
219
+ */
220
+ function getCurrentAudioState() {
221
+ return _NativeLiveVoiceSdk.default.getCurrentAudioState();
222
+ }
223
+
224
+ /**
225
+ * Set the audio output.
226
+ * @param {boolean} value - Set to `true` to use the speaker, and `false` to use the receiver.
227
+ */
228
+ function setLiveVoiceUseSpeaker(value) {
229
+ return _NativeLiveVoiceSdk.default.setLiveVoiceUseSpeaker(value);
230
+ }
231
+
232
+ /**
233
+ * Start playing a channel.
234
+ * @abstract You can find the channel ID for a channel in the admin web-interface at the bottom when tapping *Edit Channel*.
235
+ * @param {number} [id] - The channel ID.
236
+ */
237
+ function startChannel(id) {
238
+ return _NativeLiveVoiceSdk.default.startChannel(id);
239
+ }
240
+
241
+ /**
242
+ * Stop playing the currently playing channel.
243
+ */
244
+ function stopChannel() {
245
+ return _NativeLiveVoiceSdk.default.stopChannel();
246
+ }
247
+
248
+ /**
249
+ * Start receiving subtitles.
250
+ * @abstract The SDK can receive a single stream of subtitle fragments at a time.
251
+ * You can stop receiving subtitles using {@link stopSubtitles()}.
252
+ * Whenever you call this method, any previous subtitle streams are stopped automatically and you receive the subtitles for the requested channel and language instead.
253
+ *
254
+ * Note: You have to make sure that subtitles for the given channel and language are enabled in the web-interface. You can use the {@link onAvailableSubtitleConfigsChanged} handler to check if subtitles are available for a given channel in a given language.
255
+ *
256
+ * @param {number | null} channelId - The channel to receive subtitles for. Set to `null` to always receive subtitles for the currently playing channel.
257
+ * @param {string | null} language - The language code for the translation, or `null` to request the transcript.
258
+ */
259
+ function startSubtitles(channelId, language) {
260
+ const nativeSafeId = channelId == null ? -1 : channelId;
261
+ _NativeLiveVoiceSdk.default.startSubtitles(nativeSafeId, language);
262
+ }
263
+
264
+ /**
265
+ * Stop receiving subtitles.
266
+ */
267
+ function stopSubtitles() {
268
+ return _NativeLiveVoiceSdk.default.stopSubtitles();
269
+ }
270
+
271
+ // Event handlers
272
+
273
+ /**
274
+ * Handle changes of the audio output.
275
+ */
276
+ function onAudioOutputChanged(handler) {
277
+ _NativeLiveVoiceSdk.default.onAudioOutputChanged(data => {
278
+ handler(data);
279
+ });
280
+ }
281
+
282
+ /**
283
+ * Handle changes of the UI state.
284
+ */
285
+ function onUiStateChanged(handler) {
286
+ _NativeLiveVoiceSdk.default.onUiStateChanged(data => {
287
+ handler(JSON.parse(data));
288
+ });
289
+ }
290
+
291
+ /**
292
+ * Handle changes of the available subtitles.
293
+ */
294
+ function onAvailableSubtitleConfigsChanged(handler) {
295
+ _NativeLiveVoiceSdk.default.onAvailableSubtitleConfigsChanged(data => {
296
+ const mapOfSubtitles = JSON.parse(data);
297
+ handler(mapOfSubtitles);
298
+ });
299
+ }
300
+
301
+ /**
302
+ * Handle changes of the available subtitles.
303
+ */
304
+ function onSubtitlesChanged(handler) {
305
+ _NativeLiveVoiceSdk.default.onSubtitlesChanged(data => {
306
+ const mapOfSubtitles = JSON.parse(data);
307
+ handler(mapOfSubtitles);
308
+ });
309
+ }
310
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeLiveVoiceSdk","_interopRequireDefault","require","_ForegroundServiceConfig","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index","_Translations","_UIState","_PlayingState","e","__esModule","default","initialize","androidServiceConfig","serviceDisabled","serviceTypeAsString","type","message","LiveVoiceSdkReactNative","joinEvent","joinCode","password","apiKey","leaveEvent","reconnect","getCurrentClaims","claims","JSON","parse","getCurrentUiState","getCurrentSubtitleConfiguration","getCurrentAvailableSubtitleConfigs","getCurrentSubtitles","getCurrentAudioState","setLiveVoiceUseSpeaker","value","startChannel","id","stopChannel","startSubtitles","channelId","language","nativeSafeId","stopSubtitles","onAudioOutputChanged","handler","data","onUiStateChanged","onAvailableSubtitleConfigsChanged","mapOfSubtitles","onSubtitlesChanged"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,wBAAA,GAAAD,OAAA;AAOAE,MAAA,CAAAC,IAAA,CAAAF,wBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;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CAAiCA,CAACH,OAAgD,EAAQ;EACtG3B,2BAAuB,CAAC8B,iCAAiC,CAAEF,IAAY,IAAK;IACxE,MAAMG,cAAwC,GAAGtB,IAAI,CAACC,KAAK,CAACkB,IAAI,CAAC;IACjED,OAAO,CAACI,cAAc,CAAC;EAC3B,CAAC,CAAC;AACN;;AAEA;AACA;AACA;AACO,SAASC,kBAAkBA,CAACL,OAAgC,EAAQ;EACvE3B,2BAAuB,CAACgC,kBAAkB,CAAEJ,IAAY,IAAK;IACzD,MAAMG,cAAwB,GAAGtB,IAAI,CAACC,KAAK,CAACkB,IAAI,CAAC;IACjDD,OAAO,CAACI,cAAc,CAAC;EAC3B,CAAC,CAAC;AACN","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ /*
9
+ * This source file is part of the LiveVoice SDK project
10
+ *
11
+ * Copyright (c) LiveVoice GmbH
12
+ * Licensed under the MIT license
13
+ *
14
+ * See LICENSE for license information
15
+ *
16
+ * SPDX-License-Identifier: MIT
17
+ */
18
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('LiveVoiceModule');
19
+ //# sourceMappingURL=NativeLiveVoiceSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeLiveVoiceSdk.ts"],"mappings":";;;;;;AAYA,IAAAA,YAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GA0EeC,gCAAmB,CAACC,YAAY,CAAO,iBAAiB,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.COLORS = void 0;
7
+ /*
8
+ * This source file is part of the LiveVoice SDK project
9
+ *
10
+ * Copyright (c) LiveVoice GmbH
11
+ * Licensed under the MIT license
12
+ *
13
+ * See LICENSE for license information
14
+ *
15
+ * SPDX-License-Identifier: MIT
16
+ */
17
+
18
+ const COLORS = exports.COLORS = {
19
+ primary: '#F1521B',
20
+ primaryOutline: 'rgba(241, 82, 27, 0.2)',
21
+ bg: '#F5F5F5',
22
+ bgDark: '#1E1F23',
23
+ cardBg: '#fff',
24
+ cardBgDark: '#212429',
25
+ white: '#fff',
26
+ black: '#191919',
27
+ gray: '#808080',
28
+ 'gray-300': '#E0E0E0'
29
+ };
30
+ //# sourceMappingURL=Colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["COLORS","exports","primary","primaryOutline","bg","bgDark","cardBg","cardBgDark","white","black","gray"],"sourceRoot":"../../../src","sources":["util/Colors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,OAAO,EAAE,SAAS;EAClBC,cAAc,EAAE,wBAAwB;EAExCC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EAEjBC,MAAM,EAAE,MAAM;EACdC,UAAU,EAAE,SAAS;EAErBC,KAAK,EAAE,MAAM;EACbC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,SAAS;EAEf,UAAU,EAAE;AACd,CAAC","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.serviceEnabledWithMessage = exports.serviceEnabledWithDefaultMessage = exports.serviceDisabled = void 0;
7
+ /*
8
+ * This source file is part of the LiveVoice SDK project
9
+ *
10
+ * Copyright (c) LiveVoice GmbH
11
+ * Licensed under the MIT license
12
+ *
13
+ * See LICENSE for license information
14
+ *
15
+ * SPDX-License-Identifier: MIT
16
+ */
17
+
18
+ // Define the union type and interfaces
19
+
20
+ // Named exports for the constants and function
21
+ const serviceDisabled = exports.serviceDisabled = {
22
+ type: 'Disabled'
23
+ };
24
+ const serviceEnabledWithDefaultMessage = exports.serviceEnabledWithDefaultMessage = {
25
+ type: 'Enabled',
26
+ message: 'LV_NOTIFICATION_DEFAULT_MESSAGE'
27
+ };
28
+ const serviceEnabledWithMessage = message => ({
29
+ type: 'Enabled',
30
+ message
31
+ });
32
+ exports.serviceEnabledWithMessage = serviceEnabledWithMessage;
33
+ //# sourceMappingURL=ForegroundServiceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["serviceDisabled","exports","type","serviceEnabledWithDefaultMessage","message","serviceEnabledWithMessage"],"sourceRoot":"../../../src","sources":["util/ForegroundServiceConfig.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAYA;AACO,MAAMA,eAAyB,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAAEE,IAAI,EAAE;AAAW,CAAC;AAEtD,MAAMC,gCAAyC,GAAAF,OAAA,CAAAE,gCAAA,GAAG;EAAED,IAAI,EAAE,SAAS;EAAEE,OAAO,EAAE;AAAkC,CAAC;AAEjH,MAAMC,yBAAyB,GAAID,OAAsB,KAAe;EAC7EF,IAAI,EAAE,SAAS;EACfE;AACF,CAAC,CAAC;AAACH,OAAA,CAAAI,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PlayingState = void 0;
7
+ /*
8
+ * This source file is part of the LiveVoice SDK project
9
+ *
10
+ * Copyright (c) LiveVoice GmbH
11
+ * Licensed under the MIT license
12
+ *
13
+ * See LICENSE for license information
14
+ *
15
+ * SPDX-License-Identifier: MIT
16
+ */
17
+ let PlayingState = exports.PlayingState = /*#__PURE__*/function (PlayingState) {
18
+ PlayingState["STOPPED"] = "STOPPED";
19
+ PlayingState["TRANSITIONING"] = "TRANSITIONING";
20
+ PlayingState["PLAYING"] = "PLAYING";
21
+ return PlayingState;
22
+ }({});
23
+ ;
24
+ //# sourceMappingURL=PlayingState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PlayingState","exports"],"sourceRoot":"../../../src","sources":["util/PlayingState.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,IAWYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAIvB","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Translations = void 0;
7
+ var _NativeLiveVoiceSdk = _interopRequireDefault(require("../specs/NativeLiveVoiceSdk.js"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /*
10
+ * This source file is part of the LiveVoice SDK project
11
+ *
12
+ * Copyright (c) LiveVoice GmbH
13
+ * Licensed under the MIT license
14
+ *
15
+ * See LICENSE for license information
16
+ *
17
+ * SPDX-License-Identifier: MIT
18
+ */
19
+
20
+ /**
21
+ * @fileoverview Translated strings for the React Native SDK.
22
+ * These methods will return a translated string for the current locale.
23
+ * German, English, and Spanish are supported at this time.
24
+ */
25
+
26
+ const Translations = exports.Translations = {
27
+ channelStatusOffline: () => _NativeLiveVoiceSdk.default.channelStatusOffline(),
28
+ noChannels: () => _NativeLiveVoiceSdk.default.noChannels(),
29
+ isAiChannelStatusMessage: () => _NativeLiveVoiceSdk.default.isAiChannelStatusMessage(),
30
+ sdkNoMatchingChannels: () => _NativeLiveVoiceSdk.default.sdkNoMatchingChannels(),
31
+ errorScreenRetrying: () => _NativeLiveVoiceSdk.default.errorScreenRetrying(),
32
+ errorScreenRetryingIn: seconds => _NativeLiveVoiceSdk.default.errorScreenRetryingIn(seconds),
33
+ sdkErrorGeneric: () => _NativeLiveVoiceSdk.default.sdkErrorGeneric(),
34
+ sdkErrorInactive: () => _NativeLiveVoiceSdk.default.sdkErrorInactive(),
35
+ sdkErrorInvalidApiKey: () => _NativeLiveVoiceSdk.default.sdkErrorInvalidApiKey(),
36
+ sdkErrorListenerLimitReached: () => _NativeLiveVoiceSdk.default.sdkErrorListenerLimitReached(),
37
+ sdkErrorNoNetwork: () => _NativeLiveVoiceSdk.default.sdkErrorNoNetwork(),
38
+ sdkErrorNotFound: () => _NativeLiveVoiceSdk.default.sdkErrorNotFound(),
39
+ sdkErrorRequestFailed: errorCode => _NativeLiveVoiceSdk.default.sdkErrorRequestFailed(errorCode),
40
+ sdkErrorWrongPassword: () => _NativeLiveVoiceSdk.default.sdkErrorWrongPassword(),
41
+ errorRetryNowButton: () => _NativeLiveVoiceSdk.default.errorRetryNowButton(),
42
+ streamingByTitle: () => _NativeLiveVoiceSdk.default.streamingByTitle(),
43
+ accessibilityChannelPlay: () => _NativeLiveVoiceSdk.default.accessibilityChannelPlay(),
44
+ accessibilityChannelStatusMuted: () => _NativeLiveVoiceSdk.default.accessibilityChannelStatusMuted(),
45
+ accessibilityChannelStop: () => _NativeLiveVoiceSdk.default.accessibilityChannelStop()
46
+ };
47
+ //# sourceMappingURL=Translations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeLiveVoiceSdk","_interopRequireDefault","require","e","__esModule","default","Translations","exports","channelStatusOffline","LiveVoiceSdkReactNative","noChannels","isAiChannelStatusMessage","sdkNoMatchingChannels","errorScreenRetrying","errorScreenRetryingIn","seconds","sdkErrorGeneric","sdkErrorInactive","sdkErrorInvalidApiKey","sdkErrorListenerLimitReached","sdkErrorNoNetwork","sdkErrorNotFound","sdkErrorRequestFailed","errorCode","sdkErrorWrongPassword","errorRetryNowButton","streamingByTitle","accessibilityChannelPlay","accessibilityChannelStatusMuted","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,SAAiB,IAAad,2BAAuB,CAACa,qBAAqB,CAACC,SAAS,CAAC;EAC9GC,qBAAqB,EAAEA,CAAA,KAAcf,2BAAuB,CAACe,qBAAqB,CAAC,CAAC;EACpFC,mBAAmB,EAAEA,CAAA,KAAchB,2BAAuB,CAACgB,mBAAmB,CAAC,CAAC;EAChFC,gBAAgB,EAAEA,CAAA,KAAcjB,2BAAuB,CAACiB,gBAAgB,CAAC,CAAC;EAC1EC,wBAAwB,EAAEA,CAAA,KAAclB,2BAAuB,CAACkB,wBAAwB,CAAC,CAAC;EAC1FC,+BAA+B,EAAEA,CAAA,KAAcnB,2BAAuB,CAACmB,+BAA+B,CAAC,CAAC;EACxGC,wBAAwB,EAAEA,CAAA,KAAcpB,2BAAuB,CAACoB,wBAAwB,CAAC;AAC3F,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=UIState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["util/UIState.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * This source file is part of the LiveVoice SDK project
5
+ *
6
+ * Copyright (c) LiveVoice GmbH
7
+ * Licensed under the MIT license
8
+ *
9
+ * See LICENSE for license information
10
+ *
11
+ * SPDX-License-Identifier: MIT
12
+ */
13
+
14
+ import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from 'livevoice-sdk-react-native';
15
+ import React, { useState, useRef, useEffect } from 'react';
16
+ import { View, TouchableOpacity, StyleSheet, Animated, Easing, Image, useColorScheme } from 'react-native';
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
+ export const AudioOutputSwitchView = props => {
19
+ const [isSpeaker, setIsSpeaker] = useState(() => getCurrentAudioState());
20
+ useEffect(() => {
21
+ onAudioOutputChanged(value => {
22
+ console.log('State changed: ' + value);
23
+ setIsSpeaker(value);
24
+ });
25
+ }, []);
26
+ const isDarkMode = props.isDarkMode != undefined ? props.isDarkMode : useColorScheme() === 'dark';
27
+ const animation = useRef(new Animated.Value(isSpeaker ? 1 : 0)).current;
28
+ useEffect(() => {
29
+ Animated.timing(animation, {
30
+ toValue: isSpeaker ? 1 : 0,
31
+ //start with correct position depending on isSpeaker state
32
+ duration: 100,
33
+ easing: Easing.out(Easing.circle),
34
+ useNativeDriver: false
35
+ }).start();
36
+ }, [isSpeaker]);
37
+ const togglePosition = animation.interpolate({
38
+ inputRange: [0, 1],
39
+ outputRange: [2, 60] // Adjust these values based on your design
40
+ });
41
+ const iconColor = isDarkMode ? '#fff' : '#191919';
42
+ return /*#__PURE__*/_jsxs(TouchableOpacity, {
43
+ activeOpacity: 1,
44
+ onPress: () => {
45
+ console.log('Clicked: with current' + isSpeaker);
46
+ setLiveVoiceUseSpeaker(!isSpeaker);
47
+ },
48
+ style: [styles.container, isDarkMode ? styles.darkMode : styles.lightMode],
49
+ children: [/*#__PURE__*/_jsxs(View, {
50
+ style: styles.iconContainer,
51
+ children: [/*#__PURE__*/_jsx(Image, {
52
+ source: require('../icons/headphones.png'),
53
+ style: {
54
+ tintColor: iconColor,
55
+ width: 20,
56
+ height: 20,
57
+ resizeMode: 'contain'
58
+ }
59
+ }), /*#__PURE__*/_jsx(Image, {
60
+ source: require('../icons/speaker.png'),
61
+ style: {
62
+ tintColor: iconColor,
63
+ width: 20,
64
+ height: 20,
65
+ resizeMode: 'contain'
66
+ }
67
+ })]
68
+ }), /*#__PURE__*/_jsx(Animated.View, {
69
+ style: [styles.toggle, isDarkMode ? styles.toggleBackgroundDark : styles.toggleBackgroundLight, {
70
+ transform: [{
71
+ translateX: togglePosition
72
+ }]
73
+ }],
74
+ children: isSpeaker ? /*#__PURE__*/_jsx(Image, {
75
+ source: require('../icons/speaker.png'),
76
+ style: {
77
+ tintColor: iconColor,
78
+ width: 20,
79
+ height: 20,
80
+ resizeMode: 'contain'
81
+ }
82
+ }) : /*#__PURE__*/_jsx(Image, {
83
+ source: require('../icons/headphones.png'),
84
+ style: {
85
+ tintColor: iconColor,
86
+ width: 20,
87
+ height: 20,
88
+ resizeMode: 'contain'
89
+ }
90
+ })
91
+ })]
92
+ });
93
+ };
94
+ const styles = StyleSheet.create({
95
+ container: {
96
+ width: 120,
97
+ height: 40,
98
+ borderRadius: 20,
99
+ flexDirection: 'row',
100
+ alignItems: 'center',
101
+ justifyContent: 'space-between',
102
+ paddingHorizontal: 16,
103
+ position: 'relative'
104
+ },
105
+ darkMode: {
106
+ backgroundColor: '#393F45'
107
+ },
108
+ lightMode: {
109
+ backgroundColor: '#E7E7E7'
110
+ },
111
+ iconContainer: {
112
+ flexDirection: 'row',
113
+ alignItems: 'center',
114
+ justifyContent: 'space-between',
115
+ width: '100%',
116
+ paddingHorizontal: 7
117
+ },
118
+ toggle: {
119
+ width: 58,
120
+ height: 36,
121
+ borderRadius: 18,
122
+ position: 'absolute',
123
+ flex: 1,
124
+ alignItems: 'center',
125
+ justifyContent: 'center'
126
+ },
127
+ toggleBackgroundDark: {
128
+ backgroundColor: '#212529'
129
+ },
130
+ toggleBackgroundLight: {
131
+ backgroundColor: '#fff'
132
+ }
133
+ });
134
+ //# sourceMappingURL=AudioOutputSwitchView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getCurrentAudioState","onAudioOutputChanged","setLiveVoiceUseSpeaker","React","useState","useRef","useEffect","View","TouchableOpacity","StyleSheet","Animated","Easing","Image","useColorScheme","jsx","_jsx","jsxs","_jsxs","AudioOutputSwitchView","props","isSpeaker","setIsSpeaker","value","console","log","isDarkMode","undefined","animation","Value","current","timing","toValue","duration","easing","out","circle","useNativeDriver","start","togglePosition","interpolate","inputRange","outputRange","iconColor","activeOpacity","onPress","style","styles","container","darkMode","lightMode","children","iconContainer","source","require","tintColor","width","height","resizeMode","toggle","toggleBackgroundDark","toggleBackgroundLight","transform","translateX","create","borderRadius","flexDirection","alignItems","justifyContent","paddingHorizontal","position","backgroundColor","flex"],"sourceRoot":"../../../src","sources":["components/AudioOutputSwitchView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,EAAEC,oBAAoB,EAAEC,sBAAsB,QAAQ,4BAA4B;AAC/G,OAAOC,KAAK,IAAIC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAS,OAAO;AAC3D,SACEC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,QAAQ,EACRC,MAAM,EACNC,KAAK,EACLC,cAAc,QACT,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMtB,OAAO,MAAMC,qBAAuD,GAAIC,KAAK,IAAK;EAChF,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGjB,QAAQ,CAAW,MAAOJ,oBAAoB,CAAC,CAAG,CAAC;EACrFM,SAAS,CACP,MAAM;IACJL,oBAAoB,CAAEqB,KAAc,IAAK;MACvCC,OAAO,CAACC,GAAG,CAAC,iBAAiB,GAAGF,KAAK,CAAC;MACtCD,YAAY,CAACC,KAAK,CAAC;IACrB,CAAC,CAAC;EACJ,CAAC,EACD,EACF,CAAC;EAED,MAAMG,UAAU,GAAGN,KAAK,CAACM,UAAU,IAAIC,SAAS,GAAGP,KAAK,CAACM,UAAU,GAAGZ,cAAc,CAAC,CAAC,KAAK,MAAM;EACjG,MAAMc,SAAS,GAAGtB,MAAM,CAAC,IAAIK,QAAQ,CAACkB,KAAK,CAACR,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAACS,OAAO;EAEvEvB,SAAS,CAAC,MAAM;IACdI,QAAQ,CAACoB,MAAM,CAACH,SAAS,EAAE;MACzBI,OAAO,EAAEX,SAAS,GAAG,CAAC,GAAG,CAAC;MAAE;MAC5BY,QAAQ,EAAE,GAAG;MACbC,MAAM,EAAEtB,MAAM,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