@apple-pie/slice 0.1.31 → 0.1.32

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 (288) hide show
  1. package/README.md +35 -284
  2. package/dist/cjs/chunks/{AudioBubble-k7qS53g6.js → AudioBubble-Dh2IlYW0.js} +2 -2
  3. package/dist/cjs/chunks/{Avatar-hP8GuwvD.js → Avatar-WcBAu25_.js} +1 -1
  4. package/dist/cjs/chunks/{AvatarGroup-DMy34q7_.js → AvatarGroup-eUkVdeTf.js} +1 -1
  5. package/dist/cjs/chunks/{Badge-D2TbyfJS.js → Badge-4tBynWZe.js} +1 -1
  6. package/dist/cjs/chunks/{Button-CTsHZBEB.js → Button-QJ5lsSAz.js} +1 -1
  7. package/dist/cjs/chunks/{ButtonBar-BRb1PTmw.js → ButtonBar-DcpvT1vD.js} +1 -1
  8. package/dist/cjs/chunks/{Camera-CKv087kr.js → Camera-iDyPLq9h.js} +3 -3
  9. package/dist/cjs/chunks/{CheckBox-VRIL1FHh.js → CheckBox-CmZJd8u2.js} +1 -1
  10. package/dist/cjs/chunks/{Chip-Dr3vKvRY.js → Chip-Bd1bSYeC.js} +1 -1
  11. package/dist/cjs/chunks/{DivInput-Ci0gaCWL.js → DivInput-BY9pQ6ty.js} +1 -1
  12. package/dist/cjs/chunks/{Dot-C0MvSJOl.js → Dot-BeWDLajy.js} +1 -1
  13. package/dist/cjs/chunks/{DrggablePanel-DflouLUs.js → DrggablePanel-DzY5wTco.js} +2 -2
  14. package/dist/cjs/chunks/{DropDown-BS1H62yj.js → DropDown-Cn_nX8u7.js} +1 -1
  15. package/dist/cjs/chunks/{ErrorSummary-B3tof7ir.js → ErrorSummary-D-0uVwyV.js} +2 -2
  16. package/dist/cjs/chunks/{FileIcon-Te8MaqTs.js → FileIcon-JfY2AYqG.js} +2 -2
  17. package/dist/cjs/chunks/{FileList-CDcfKIV6.js → FileList-Dc1nfpR2.js} +1 -1
  18. package/dist/cjs/chunks/{FlexDiv-wO8IY0Zf.js → FlexDiv-B5Pi0-aJ.js} +1 -1
  19. package/dist/cjs/chunks/{Grouper-DyGkzdvz.js → Grouper-DKZkTlow.js} +2 -2
  20. package/dist/cjs/chunks/{Icon-BFZ_5Qv3.js → Icon-BVYVJp9J.js} +2 -2
  21. package/dist/cjs/chunks/{IconButton-CgsuJIuF.js → IconButton-CP1Wsvsx.js} +1 -1
  22. package/dist/cjs/chunks/{IndexedDB-Dgwal8na.js → IndexedDB-CeiVT55Z.js} +1 -1
  23. package/dist/cjs/chunks/{Label-BuyhcJbF.js → Label-DIs1rOey.js} +1 -1
  24. package/dist/cjs/chunks/Level-3yxetsco.js +58 -0
  25. package/dist/cjs/chunks/{MdStreamBuffer-CbG_VeRI.js → MdStreamBuffer-BudWFoNw.js} +38 -16
  26. package/dist/cjs/chunks/{Modal-ByRyv3wy.js → Modal-CjpQdoOe.js} +34 -8
  27. package/dist/cjs/chunks/{ModalController-xjflFsjF.js → ModalController-Cp2PXOOS.js} +1 -1
  28. package/dist/cjs/chunks/{Overlay-FooE9M_s.js → Overlay-DRpHYZek.js} +1 -1
  29. package/dist/cjs/chunks/{Pager-B-cuwffo.js → Pager-ChnTKwml.js} +1 -1
  30. package/dist/cjs/chunks/{ProgressIndicator-ByZ_aYAZ.js → ProgressIndicator-CFiAU-aF.js} +2 -2
  31. package/dist/cjs/chunks/{PromptInput--grtHPvy.js → PromptInput-BFWR0TaP.js} +2 -2
  32. package/dist/cjs/chunks/{RadioButton-DP2X1dA_.js → RadioButton-Bi-FP41j.js} +1 -1
  33. package/dist/cjs/chunks/{RadioButtonList-COGNW5y3.js → RadioButtonList-JHPKMCoX.js} +1 -1
  34. package/dist/cjs/chunks/{Slider-G1a8UKef.js → Slider-D97ws1Cl.js} +1 -1
  35. package/dist/cjs/chunks/{Spacer-CsRCleXv.js → Spacer-DvI2M1wZ.js} +1 -1
  36. package/dist/cjs/chunks/{Switch-OBVHKn_D.js → Switch-DDSSprb7.js} +1 -1
  37. package/dist/cjs/chunks/{TabBar-C1HkBaxE.js → TabBar-TllSeSzb.js} +2 -2
  38. package/dist/cjs/chunks/{TextArea-BEmNI_HZ.js → TextArea-DjZRDixt.js} +1 -1
  39. package/dist/cjs/chunks/{TextField-D9_COA9H.js → TextField-CKA3K0AN.js} +3 -3
  40. package/dist/cjs/chunks/{Tip-2W0u_oQN.js → Tip-BdGXN-TQ.js} +1 -1
  41. package/dist/cjs/chunks/{Toast-B9jX6ioq.js → Toast-COrDS_50.js} +5 -5
  42. package/dist/cjs/chunks/{ToggleButton-C_Gu5dYR.js → ToggleButton-hoOMzBZc.js} +1 -1
  43. package/dist/cjs/chunks/{UploadArea-ENFAf4tE.js → UploadArea-ClG8ZgRZ.js} +1 -1
  44. package/dist/cjs/chunks/{WSConnection-CZ22tcLz.js → WSConnection-Brxc2hEv.js} +1 -1
  45. package/dist/cjs/chunks/WebRTCConnection-eWP4lueC.js +252 -0
  46. package/dist/cjs/chunks/{localDBStore-Ca73jeFf.js → localDBStore-SS_r0C6F.js} +1 -1
  47. package/dist/cjs/chunks/{microphoneStore-lxYIvhN8.js → microphoneStore-DM_8bhFr.js} +27 -4
  48. package/dist/cjs/chunks/{misc-DZAbObFp.js → misc-4xyXRU2K.js} +1 -1
  49. package/dist/cjs/chunks/{sseStore-Bq7sVvyA.js → sseStore-Ag-UnuQq.js} +2 -2
  50. package/dist/cjs/chunks/{uploads-worker-CD-annza.js → uploads-worker-CI-SZptI.js} +1 -1
  51. package/dist/cjs/chunks/{uploadsStore-CUeB10zx.js → uploadsStore-DR2hc4ct.js} +2 -2
  52. package/dist/cjs/chunks/{volumeStore-roYTyKJ2.js → volumeStore-DtTHf-9_.js} +5 -4
  53. package/dist/cjs/chunks/webRTCStore-DWWn7k-0.js +55 -0
  54. package/dist/cjs/chunks/{windowStore-BdJv-RF0.js → windowStore-BUo9Du_e.js} +1 -1
  55. package/dist/cjs/components/AudioBubble/index.js +4 -4
  56. package/dist/cjs/components/Avatar/index.js +3 -3
  57. package/dist/cjs/components/AvatarGroup/index.js +3 -3
  58. package/dist/cjs/components/Badge/index.js +2 -2
  59. package/dist/cjs/components/Button/index.js +7 -7
  60. package/dist/cjs/components/ButtonBar/index.js +3 -3
  61. package/dist/cjs/components/Camera/index.js +5 -5
  62. package/dist/cjs/components/CheckBox/index.js +3 -3
  63. package/dist/cjs/components/Chip/index.js +4 -4
  64. package/dist/cjs/components/DivInput/index.js +3 -3
  65. package/dist/cjs/components/Dot/index.js +2 -2
  66. package/dist/cjs/components/DraggablePanel/index.js +3 -3
  67. package/dist/cjs/components/DropDown/index.js +3 -3
  68. package/dist/cjs/components/ErrorSummary/index.js +3 -3
  69. package/dist/cjs/components/FileIcon/index.js +3 -3
  70. package/dist/cjs/components/FileList/index.js +4 -4
  71. package/dist/cjs/components/FlexDiv/index.js +2 -2
  72. package/dist/cjs/components/Grouper/index.js +4 -4
  73. package/dist/cjs/components/Icon/index.js +3 -3
  74. package/dist/cjs/components/IconButton/index.js +6 -6
  75. package/dist/cjs/components/Label/index.js +3 -3
  76. package/dist/cjs/components/Level/index.js +7 -0
  77. package/dist/cjs/components/Modal/index.js +7 -7
  78. package/dist/cjs/components/ModalController/index.js +3 -3
  79. package/dist/cjs/components/Overlay/index.js +2 -2
  80. package/dist/cjs/components/Pager/index.js +3 -3
  81. package/dist/cjs/components/Progress/index.js +3 -3
  82. package/dist/cjs/components/PromptInput/index.js +7 -7
  83. package/dist/cjs/components/RadioButton/index.js +3 -3
  84. package/dist/cjs/components/RadioButtonList/index.js +4 -4
  85. package/dist/cjs/components/Slider/index.js +4 -4
  86. package/dist/cjs/components/Spacer/index.js +2 -2
  87. package/dist/cjs/components/Switch/index.js +2 -2
  88. package/dist/cjs/components/TabBar/index.js +5 -5
  89. package/dist/cjs/components/TextArea/index.js +7 -7
  90. package/dist/cjs/components/Textfield/index.js +7 -7
  91. package/dist/cjs/components/Tip/index.js +3 -3
  92. package/dist/cjs/components/Toast/index.js +4 -4
  93. package/dist/cjs/components/ToggleButton/index.js +7 -7
  94. package/dist/cjs/components/UploadArea/index.js +5 -5
  95. package/dist/cjs/hooks/useAudioRecorder.js +1 -1
  96. package/dist/cjs/hooks/useBindWebRTC.js +60 -0
  97. package/dist/cjs/hooks/useLocalStore.js +3 -3
  98. package/dist/cjs/hooks/useMdStreamBuffer.js +55 -30
  99. package/dist/cjs/hooks/useMicrophone.js +1 -1
  100. package/dist/cjs/hooks/useTrackRenders.js +2 -2
  101. package/dist/cjs/hooks.js +7 -4
  102. package/dist/cjs/index.js +19 -17
  103. package/dist/cjs/providers/ThemeProvider.js +5 -4
  104. package/dist/cjs/providers/themeServer.js +15 -9
  105. package/dist/cjs/stores/LocalDB.js +3 -3
  106. package/dist/cjs/stores/SSE.js +2 -2
  107. package/dist/cjs/stores/WS.js +2 -2
  108. package/dist/cjs/stores/WebRTC.js +9 -0
  109. package/dist/cjs/stores/microphone.js +5 -4
  110. package/dist/cjs/stores/modal.js +1 -1
  111. package/dist/cjs/stores/tip.js +1 -1
  112. package/dist/cjs/stores/toast.js +1 -1
  113. package/dist/cjs/stores/uploads.js +2 -2
  114. package/dist/cjs/stores/volume.js +2 -2
  115. package/dist/cjs/stores/window.js +2 -2
  116. package/dist/cjs/stores.js +18 -13
  117. package/dist/cjs/utils/index.js +4 -3
  118. package/dist/cjs/utils/objects/index.js +4 -3
  119. package/dist/cjs/workers/uploads/uploads.js +2 -2
  120. package/dist/esm/chunks/{AudioBubble-DfrxyTX_.mjs → AudioBubble-cYlxxQ7c.mjs} +3 -3
  121. package/dist/esm/chunks/{Avatar-pA41Pcyl.mjs → Avatar-D84wF2os.mjs} +2 -2
  122. package/dist/esm/chunks/{AvatarGroup-CZBtWjnj.mjs → AvatarGroup-DiwfbRxH.mjs} +2 -2
  123. package/dist/esm/chunks/{Badge-pLwG0zm7.mjs → Badge-DuUb5-80.mjs} +1 -1
  124. package/dist/esm/chunks/{Button-BJoMLZIs.mjs → Button-BIgwWrPJ.mjs} +6 -6
  125. package/dist/esm/chunks/{ButtonBar-BO2RUJ8R.mjs → ButtonBar-vNvnvw7u.mjs} +3 -3
  126. package/dist/esm/chunks/{Camera-4MNA52HG.mjs → Camera-BMwkTJPq.mjs} +5 -5
  127. package/dist/esm/chunks/{CheckBox-7KAsvZld.mjs → CheckBox-Cpoxy8w_.mjs} +3 -3
  128. package/dist/esm/chunks/{Chip-BuGvCLLU.mjs → Chip-BayNVv7N.mjs} +4 -4
  129. package/dist/esm/chunks/{DivInput-D0YzSWjJ.mjs → DivInput-CWRUxy1y.mjs} +2 -2
  130. package/dist/esm/chunks/{Dot-h26m47Z-.mjs → Dot-v_kcIWV2.mjs} +1 -1
  131. package/dist/esm/chunks/{DrggablePanel-Bh6HLPMX.mjs → DrggablePanel-yEeGeE1w.mjs} +2 -2
  132. package/dist/esm/chunks/{DropDown-NgMYjjXn.mjs → DropDown-QQhwAg_J.mjs} +3 -3
  133. package/dist/esm/chunks/{ErrorSummary-nNm9qymE.mjs → ErrorSummary-DzIZMIll.mjs} +2 -2
  134. package/dist/esm/chunks/{FileIcon-BqyV1wut.mjs → FileIcon-6UlkbKzk.mjs} +2 -2
  135. package/dist/esm/chunks/{FileList-C1tOvoc0.mjs → FileList-vMiGJByw.mjs} +5 -5
  136. package/dist/esm/chunks/{FlexDiv-CkK-DAyg.mjs → FlexDiv-B1m7aY04.mjs} +1 -1
  137. package/dist/esm/chunks/{Grouper-CyrOkuu2.mjs → Grouper-BDrAnfDF.mjs} +3 -3
  138. package/dist/esm/chunks/{Icon-DjW0Krm8.mjs → Icon-D4A6_c4x.mjs} +2 -2
  139. package/dist/esm/chunks/{IconButton-DdLhTUl0.mjs → IconButton-B_W-aOsB.mjs} +5 -5
  140. package/dist/esm/chunks/{IndexedDB-DVoDikoA.mjs → IndexedDB-CTqfKmp1.mjs} +1 -1
  141. package/dist/esm/chunks/{Label-DhmJ_Sln.mjs → Label-I75yz3gq.mjs} +2 -2
  142. package/dist/esm/chunks/Level-DgczkKBr.mjs +63 -0
  143. package/dist/esm/chunks/{MdStreamBuffer-4AJH8WaN.mjs → MdStreamBuffer-CoQWQwRL.mjs} +38 -16
  144. package/dist/esm/chunks/{Modal-FztrJsQo.mjs → Modal-CwwyijaO.mjs} +39 -13
  145. package/dist/esm/chunks/{ModalController-C1BnM5Dz.mjs → ModalController-IyB9lDRa.mjs} +2 -2
  146. package/dist/esm/chunks/{Overlay-Dsy55Bxm.mjs → Overlay-C-yori3-.mjs} +1 -1
  147. package/dist/esm/chunks/{Pager-BqSdwL0L.mjs → Pager-BEtfyKtq.mjs} +2 -2
  148. package/dist/esm/chunks/{ProgressIndicator-BnqZFATV.mjs → ProgressIndicator-BV0ginXb.mjs} +2 -2
  149. package/dist/esm/chunks/{PromptInput-CRkcPXJu.mjs → PromptInput-Cn5fRYap.mjs} +3 -3
  150. package/dist/esm/chunks/{RadioButton-DXq3yniV.mjs → RadioButton-DWlg6ldv.mjs} +3 -3
  151. package/dist/esm/chunks/{RadioButtonList-BgOskHCP.mjs → RadioButtonList-D9FdlhPL.mjs} +3 -3
  152. package/dist/esm/chunks/{Slider-DPOy9uNI.mjs → Slider-B2WZkZSg.mjs} +3 -3
  153. package/dist/esm/chunks/{Spacer-BJd_D0Fn.mjs → Spacer-7Oj0SlD0.mjs} +1 -1
  154. package/dist/esm/chunks/{Switch-DHqlyizo.mjs → Switch-DRhnznnO.mjs} +1 -1
  155. package/dist/esm/chunks/{TabBar-RBXExqMK.mjs → TabBar-D6VR71ye.mjs} +5 -5
  156. package/dist/esm/chunks/{TextArea-CIlx_P26.mjs → TextArea-CkB5rJjI.mjs} +2 -2
  157. package/dist/esm/chunks/{TextField-CX72ybwH.mjs → TextField-BIXmkjEz.mjs} +5 -5
  158. package/dist/esm/chunks/{Tip-COBSyEjm.mjs → Tip-CTdrwLky.mjs} +2 -2
  159. package/dist/esm/chunks/{Toast-BTm3HxDD.mjs → Toast-8bUziIgh.mjs} +6 -6
  160. package/dist/esm/chunks/{ToggleButton-DujsCKF3.mjs → ToggleButton-BOFITa8_.mjs} +2 -2
  161. package/dist/esm/chunks/{UploadArea-D--Nt8Ed.mjs → UploadArea-DE2ccDVx.mjs} +4 -4
  162. package/dist/esm/chunks/{WSConnection-BMXcuW3f.mjs → WSConnection-CHudrD62.mjs} +1 -1
  163. package/dist/esm/chunks/WebRTCConnection-DQbNa7Z9.mjs +252 -0
  164. package/dist/esm/chunks/{localDBStore-36E3160Z.mjs → localDBStore-CaYiqITY.mjs} +2 -2
  165. package/dist/esm/chunks/{microphoneStore-Cexu82zH.mjs → microphoneStore-COEGtgyX.mjs} +26 -3
  166. package/dist/esm/chunks/{misc-CTGTuM2J.mjs → misc-2MIIqzsX.mjs} +1 -1
  167. package/dist/esm/chunks/{sseStore-Dow4NXkZ.mjs → sseStore-nW9CMec_.mjs} +2 -2
  168. package/dist/esm/chunks/{tslib.es6-BX2F90pK.mjs → tslib.es6-C81Qhn1z.mjs} +1 -1
  169. package/dist/esm/chunks/{uploads-worker-Dhyp4ot3.mjs → uploads-worker-CMomtRvm.mjs} +1 -1
  170. package/dist/esm/chunks/{uploadsStore-DT4lFybE.mjs → uploadsStore-CsfpSOTS.mjs} +1 -1
  171. package/dist/esm/chunks/{volumeStore-RAxdmQ60.mjs → volumeStore-TSYPqbHx.mjs} +5 -4
  172. package/dist/esm/chunks/webRTCStore-CVCDJzj5.mjs +57 -0
  173. package/dist/esm/chunks/{windowStore-C4AZexIa.mjs → windowStore-BvejIR82.mjs} +1 -1
  174. package/dist/esm/components/AudioBubble/index.mjs +4 -4
  175. package/dist/esm/components/Avatar/index.mjs +3 -3
  176. package/dist/esm/components/AvatarGroup/index.mjs +4 -4
  177. package/dist/esm/components/Badge/index.mjs +2 -2
  178. package/dist/esm/components/Button/index.mjs +8 -8
  179. package/dist/esm/components/ButtonBar/index.mjs +4 -4
  180. package/dist/esm/components/Camera/index.mjs +6 -6
  181. package/dist/esm/components/CheckBox/index.mjs +4 -4
  182. package/dist/esm/components/Chip/index.mjs +5 -5
  183. package/dist/esm/components/DivInput/index.mjs +3 -3
  184. package/dist/esm/components/Dot/index.mjs +2 -2
  185. package/dist/esm/components/DraggablePanel/index.mjs +3 -3
  186. package/dist/esm/components/DropDown/index.mjs +4 -4
  187. package/dist/esm/components/ErrorSummary/index.mjs +3 -3
  188. package/dist/esm/components/FileIcon/index.mjs +3 -3
  189. package/dist/esm/components/FileList/index.mjs +6 -6
  190. package/dist/esm/components/FlexDiv/index.mjs +2 -2
  191. package/dist/esm/components/Grouper/index.mjs +5 -5
  192. package/dist/esm/components/Icon/index.mjs +4 -4
  193. package/dist/esm/components/IconButton/index.mjs +7 -7
  194. package/dist/esm/components/Label/index.mjs +3 -3
  195. package/dist/esm/components/Level/index.mjs +11 -0
  196. package/dist/esm/components/Modal/index.mjs +10 -10
  197. package/dist/esm/components/ModalController/index.mjs +4 -4
  198. package/dist/esm/components/Overlay/index.mjs +2 -2
  199. package/dist/esm/components/Pager/index.mjs +3 -3
  200. package/dist/esm/components/Progress/index.mjs +4 -4
  201. package/dist/esm/components/PromptInput/index.mjs +11 -11
  202. package/dist/esm/components/RadioButton/index.mjs +4 -4
  203. package/dist/esm/components/RadioButtonList/index.mjs +5 -5
  204. package/dist/esm/components/Slider/index.mjs +4 -4
  205. package/dist/esm/components/Spacer/index.mjs +2 -2
  206. package/dist/esm/components/Switch/index.mjs +2 -2
  207. package/dist/esm/components/TabBar/index.mjs +8 -8
  208. package/dist/esm/components/TextArea/index.mjs +9 -9
  209. package/dist/esm/components/Textfield/index.mjs +10 -10
  210. package/dist/esm/components/Tip/index.mjs +3 -3
  211. package/dist/esm/components/Toast/index.mjs +5 -5
  212. package/dist/esm/components/ToggleButton/index.mjs +9 -9
  213. package/dist/esm/components/UploadArea/index.mjs +7 -7
  214. package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
  215. package/dist/esm/hooks/useBindWebRTC.mjs +72 -0
  216. package/dist/esm/hooks/useLocalStore.mjs +3 -3
  217. package/dist/esm/hooks/useMdStreamBuffer.mjs +56 -28
  218. package/dist/esm/hooks/useMicrophone.mjs +1 -1
  219. package/dist/esm/hooks/useTrackRenders.mjs +2 -2
  220. package/dist/esm/hooks.mjs +14 -2
  221. package/dist/esm/index.mjs +62 -50
  222. package/dist/esm/providers/ThemeProvider.mjs +6 -5
  223. package/dist/esm/providers/themeServer.mjs +11 -6
  224. package/dist/esm/stores/LocalDB.mjs +3 -3
  225. package/dist/esm/stores/SSE.mjs +3 -3
  226. package/dist/esm/stores/WS.mjs +2 -2
  227. package/dist/esm/stores/WebRTC.mjs +7 -0
  228. package/dist/esm/stores/microphone.mjs +2 -2
  229. package/dist/esm/stores/modal.mjs +1 -1
  230. package/dist/esm/stores/tip.mjs +1 -1
  231. package/dist/esm/stores/toast.mjs +1 -1
  232. package/dist/esm/stores/uploads.mjs +3 -3
  233. package/dist/esm/stores/volume.mjs +2 -2
  234. package/dist/esm/stores/window.mjs +2 -2
  235. package/dist/esm/stores.mjs +17 -13
  236. package/dist/esm/utils/index.mjs +11 -9
  237. package/dist/esm/utils/objects/index.mjs +8 -6
  238. package/dist/esm/workers/uploads/uploads.mjs +2 -2
  239. package/dist/styles.css +51 -11
  240. package/dist/types/components/Level/Level.d.ts +5 -0
  241. package/dist/types/components/Level/_types.d.ts +21 -0
  242. package/dist/types/components/Level/index.d.ts +2 -0
  243. package/dist/types/components/Modal/_types.d.ts +3 -0
  244. package/dist/types/components/Toast/_types.d.ts +1 -0
  245. package/dist/types/hooks/index.d.ts +2 -0
  246. package/dist/types/hooks/useBindWebRTC/index.d.ts +1 -0
  247. package/dist/types/hooks/useBindWebRTC/useBindWebRTC.d.ts +15 -0
  248. package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -1
  249. package/dist/types/hooks/useMdStreamBuffer/useMdStreamBuffer.d.ts +6 -1
  250. package/dist/types/index.d.ts +3 -1
  251. package/dist/types/providers/ThemeProvider.d.ts +1 -0
  252. package/dist/types/providers/themeServer.d.ts +7 -3
  253. package/dist/types/stores/WebRTC/_types.d.ts +16 -0
  254. package/dist/types/stores/WebRTC/index.d.ts +2 -0
  255. package/dist/types/stores/WebRTC/webRTCStore.d.ts +21 -0
  256. package/dist/types/stores/index.d.ts +1 -0
  257. package/dist/types/stores/microphone/index.d.ts +1 -1
  258. package/dist/types/stores/microphone/microphoneStore.d.ts +14 -1
  259. package/dist/types/stores/toast/_types.d.ts +1 -0
  260. package/dist/types/stores/volume/_types.d.ts +3 -1
  261. package/dist/types/stores/volume/volumeStore.d.ts +6 -2
  262. package/dist/types/utils/functions/files.d.ts +1 -1
  263. package/dist/types/utils/index.d.ts +2 -2
  264. package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.d.ts +10 -0
  265. package/dist/types/utils/objects/MDStreamBuffer/_types.d.ts +2 -0
  266. package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.d.ts +37 -3
  267. package/dist/types/utils/objects/WebRTCConnection/_types.d.ts +13 -4
  268. package/dist/types/utils/objects/index.d.ts +2 -0
  269. package/package.json +1 -1
  270. /package/dist/cjs/chunks/{SSEConnection-ACoOeeTO.js → SSEConnection-DfjLAlOG.js} +0 -0
  271. /package/dist/cjs/chunks/{_types-k-3V1fz_.js → _types-DMyBIF8s.js} +0 -0
  272. /package/dist/cjs/chunks/{audioVisualizer-MOSbvvnZ.js → audioVisualizer-BxPvUj4h.js} +0 -0
  273. /package/dist/cjs/chunks/{colors-B0_3srZN.js → colors-4n0sNFRA.js} +0 -0
  274. /package/dist/cjs/chunks/{debounce-CaoYvh12.js → debounce-_IK-La-Z.js} +0 -0
  275. /package/dist/cjs/chunks/{modalStore-D4bOjuWd.js → modalStore-CFsfK3ba.js} +0 -0
  276. /package/dist/cjs/chunks/{sharedTypes-CthHPjrO.js → sharedTypes-C0ZHzH_T.js} +0 -0
  277. /package/dist/cjs/chunks/{tipStore-CPB7RHKY.js → tipStore-dqD9-c30.js} +0 -0
  278. /package/dist/cjs/chunks/{toastStore-6eHe6esp.js → toastStore-BN1N7WXv.js} +0 -0
  279. /package/dist/cjs/chunks/{tslib.es6-CzpRaW14.js → tslib.es6-DsF7Wv4Y.js} +0 -0
  280. /package/dist/esm/chunks/{SSEConnection-qNnkZUOe.mjs → SSEConnection-iFKOV9Uo.mjs} +0 -0
  281. /package/dist/esm/chunks/{_types-CEStVWlB.mjs → _types-DrNviSG6.mjs} +0 -0
  282. /package/dist/esm/chunks/{audioVisualizer-BUNbarKP.mjs → audioVisualizer-BsmpLZyK.mjs} +0 -0
  283. /package/dist/esm/chunks/{colors-D-qeA9gU.mjs → colors-BAATtfbL.mjs} +0 -0
  284. /package/dist/esm/chunks/{debounce-D5b6tZ5a.mjs → debounce-CYBH5qXQ.mjs} +0 -0
  285. /package/dist/esm/chunks/{modalStore-Crg_QmSJ.mjs → modalStore-DmaeMv7z.mjs} +0 -0
  286. /package/dist/esm/chunks/{sharedTypes-U5H1I85x.mjs → sharedTypes-CyrInj1b.mjs} +0 -0
  287. /package/dist/esm/chunks/{tipStore-pvswaezx.mjs → tipStore-B_MUZfr2.mjs} +0 -0
  288. /package/dist/esm/chunks/{toastStore-80oOTYsj.mjs → toastStore-DAprlBVj.mjs} +0 -0
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+
3
+ var tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js");
4
+
5
+ exports.WebRTCConnection = class {
6
+ /**
7
+ * Report whether the peer connection is currently connected
8
+ */
9
+ get connected() {
10
+ return "connected" === this.peerConnection.connectionState;
11
+ }
12
+ /**
13
+ * Report whether the connection currently has an audio path attached
14
+ */ get audioConnected() {
15
+ var _a, _b;
16
+ const hasLocalAudioTrack = "live" === (null === (_b = null === (_a = this.RTCSenderAudioSender) || void 0 === _a ? void 0 : _a.track) || void 0 === _b ? void 0 : _b.readyState), hasRemoteAudioTrack = this.RTCReceiverAudioTracks.size > 0;
17
+ return Boolean(hasLocalAudioTrack || hasRemoteAudioTrack);
18
+ }
19
+ /**
20
+ * Report whether the connection currently has a video path attached
21
+ */ get videoConnected() {
22
+ var _a, _b;
23
+ const hasLocalVideoTrack = "live" === (null === (_a = this.RTCSenderVideoTrack) || void 0 === _a ? void 0 : _a.readyState) || "live" === (null === (_b = this.RTCScreenShareTrack) || void 0 === _b ? void 0 : _b.readyState), hasRemoteVideoTrack = this.RTCReceiverVideoTracks.size > 0;
24
+ return Boolean(hasLocalVideoTrack || hasRemoteVideoTrack);
25
+ }
26
+ /**
27
+ * Report whether any data channel is currently open
28
+ */ get dataConnected() {
29
+ return this.RTCDataChannels.some(channel => "open" === channel.readyState);
30
+ }
31
+ /**
32
+ * Create the base instance
33
+ */ constructor(rtcConnectionInfo) {
34
+ var _a, _b, _c, _d, _e, _f, _g;
35
+ if (this.RTCSenderAudioTrack = null, this.RTCSenderVideoTrack = null, this.RTCSenderAudioSender = null,
36
+ this.RTCSenderAudioStream = new MediaStream, this.RTCScreenShareTrack = null, this.RTCScreenShareSender = null,
37
+ this.RTCReceiverAudioStream = new MediaStream, this.RTCReceiverVideoTracks = new Map,
38
+ this.RTCReceiverAudioTracks = new Map, this.RTCDataChannels = [], this.connectionUrl = "",
39
+ this.connectionOffer = null, this.autoPlayAudio = !0, this.iceTimer = null, !globalThis.document) throw new Error("RTC needs a valid browser environment");
40
+ if (this.connectionUrl = null !== (_a = rtcConnectionInfo.connectionUrl) && void 0 !== _a ? _a : "",
41
+ this.peerConnection = new RTCPeerConnection, this.RTCSenderAudioTrack = null !== (_d = null !== (_c = null === (_b = rtcConnectionInfo.micStream) || void 0 === _b ? void 0 : _b.getAudioTracks()[0]) && void 0 !== _c ? _c : rtcConnectionInfo.micTrack) && void 0 !== _d ? _d : null,
42
+ !this.RTCSenderAudioTrack) throw new Error("WebRTCConnection requires a microphone stream or track");
43
+ this.RTCSenderVideoTrack = rtcConnectionInfo.videoTrack, this.audioElement = null !== (_e = rtcConnectionInfo.audioElement) && void 0 !== _e ? _e : document.createElement("audio"),
44
+ this.autoPlayAudio = null === (_f = rtcConnectionInfo.autoPlayAudio) || void 0 === _f || _f;
45
+ const channels = null !== (_g = rtcConnectionInfo.dataChannels) && void 0 !== _g ? _g : [];
46
+ this.onRemoteVideoStream = rtcConnectionInfo.onRemoteVideoStream, this.onRemoteAudioStream = rtcConnectionInfo.onRemoteAudioStream,
47
+ this.onDataChannelEvent = rtcConnectionInfo.onDataChannelEvent, this.setupIncomingAudioStream(),
48
+ "number" == typeof rtcConnectionInfo.volume && this.setVolume(rtcConnectionInfo.volume),
49
+ this.setupOutgoingMediaStream(), this.setupDataChannels(channels), this.setupDataChannelEventListeners(),
50
+ this.peerConnection.ontrack = this.onTrack.bind(this);
51
+ }
52
+ /**
53
+ * Initialize the RTC connection
54
+ */ initialize(offerOptions, bearerToken) {
55
+ return tslib_es6.__awaiter(this, void 0, void 0, function*() {
56
+ this.offerOptions = offerOptions, this.bearerToken = bearerToken, yield this.negotiate();
57
+ });
58
+ }
59
+ /**
60
+ * Start an optional screen share stream and renegotiate if already connected
61
+ */ startScreenShare() {
62
+ return tslib_es6.__awaiter(this, void 0, void 0, function*() {
63
+ var _a, _b;
64
+ if (!(null === (_b = null === (_a = globalThis.navigator) || void 0 === _a ? void 0 : _a.mediaDevices) || void 0 === _b ? void 0 : _b.getDisplayMedia)) throw new Error("Screen share is not supported in this browser");
65
+ if (this.RTCScreenShareSender) return;
66
+ const screenTrack = (yield navigator.mediaDevices.getDisplayMedia({
67
+ video: !0,
68
+ audio: !1
69
+ })).getVideoTracks()[0];
70
+ if (!screenTrack) throw new Error("No screen share video track was provided");
71
+ const screenShareStream = new MediaStream([ screenTrack ]);
72
+ this.RTCScreenShareTrack = screenTrack, this.RTCScreenShareSender = this.peerConnection.addTrack(screenTrack, screenShareStream),
73
+ screenTrack.addEventListener("ended", () => {
74
+ this.stopScreenShare(!1);
75
+ }), this.peerConnection.remoteDescription && (yield this.negotiate());
76
+ });
77
+ }
78
+ /**
79
+ * Stop the optional screen share stream and renegotiate if already connected
80
+ */ stopScreenShare() {
81
+ return tslib_es6.__awaiter(this, arguments, void 0, function*(stopTrack = !0) {
82
+ this.RTCScreenShareSender && (this.peerConnection.removeTrack(this.RTCScreenShareSender),
83
+ this.RTCScreenShareSender = null), stopTrack && this.RTCScreenShareTrack && this.RTCScreenShareTrack.stop(),
84
+ this.RTCScreenShareTrack = null, this.peerConnection.remoteDescription && (yield this.negotiate());
85
+ });
86
+ }
87
+ /**
88
+ * Create an offer, wait for ICE gathering, POST SDP, and apply the answer
89
+ */ negotiate() {
90
+ return tslib_es6.__awaiter(this, void 0, void 0, function*() {
91
+ var _a;
92
+ if (!this.peerConnection) throw new Error("Peer connection not initialized");
93
+ if (!this.connectionUrl) throw new Error("Peer connection url not provided");
94
+ this.connectionOffer = yield this.peerConnection.createOffer(this.offerOptions),
95
+ yield this.peerConnection.setLocalDescription(this.connectionOffer), yield this.waitForIceGathering();
96
+ const headers = {
97
+ "Content-Type": "application/sdp"
98
+ };
99
+ this.bearerToken && "" !== this.bearerToken && (headers.Authorization = `Bearer ${this.bearerToken}`);
100
+ const sdpResponse = yield fetch(this.connectionUrl, {
101
+ method: "POST",
102
+ body: null === (_a = this.connectionOffer) || void 0 === _a ? void 0 : _a.sdp,
103
+ headers: headers
104
+ });
105
+ if (!sdpResponse.ok) throw new Error(`Failed to send connection offer to ${this.connectionUrl}. Status: ${sdpResponse.status} ${sdpResponse.statusText}`);
106
+ const sdpReply = {
107
+ type: "answer",
108
+ sdp: yield sdpResponse.text()
109
+ };
110
+ yield this.peerConnection.setRemoteDescription(sdpReply);
111
+ });
112
+ }
113
+ /**
114
+ * Send a JSON-serializable payload over a named data channel
115
+ */ sendMessage(channelName, data) {
116
+ const channel = this.RTCDataChannels.find(dataChannel => dataChannel.label === channelName);
117
+ if (!channel) throw new Error(`Data channel "${channelName}" not found`);
118
+ if ("open" !== channel.readyState) throw new Error(`Data channel "${channelName}" is not open. Current state: ${channel.readyState}`);
119
+ channel.send(JSON.stringify(data));
120
+ }
121
+ /**
122
+ * Mute or unmute all incoming audio playback
123
+ */ muteAllAudio(muted) {
124
+ this.audioElement.muted = muted;
125
+ }
126
+ /**
127
+ * Mute or unmute a specific incoming audio track
128
+ */ muteAudioTrack(trackId, muted) {
129
+ const track = this.RTCReceiverAudioTracks.get(trackId);
130
+ if (!track) throw new Error(`Audio track "${trackId}" not found`);
131
+ track.enabled = !muted;
132
+ }
133
+ /**
134
+ * Set the playback volume for the incoming audio element
135
+ */ setVolume(volume) {
136
+ this.audioElement.volume = Math.max(0, Math.min(1, volume));
137
+ }
138
+ /**
139
+ * Replace the outgoing audio source with the first track from a stream
140
+ */ setOutgoingAudioStream(stream) {
141
+ return tslib_es6.__awaiter(this, void 0, void 0, function*() {
142
+ var _a;
143
+ yield this.replaceAudioTrack(null !== (_a = null == stream ? void 0 : stream.getAudioTracks()[0]) && void 0 !== _a ? _a : null);
144
+ });
145
+ }
146
+ /**
147
+ * Replace the outgoing audio track without rebuilding the peer connection
148
+ */ replaceAudioTrack(track) {
149
+ return tslib_es6.__awaiter(this, void 0, void 0, function*() {
150
+ this.RTCSenderAudioTrack = track, this.syncSenderAudioStream(track), this.RTCSenderAudioSender ? yield this.RTCSenderAudioSender.replaceTrack(track) : track && (this.RTCSenderAudioSender = this.peerConnection.addTrack(track, this.RTCSenderAudioStream),
151
+ this.peerConnection.remoteDescription && (yield this.negotiate()));
152
+ });
153
+ }
154
+ /**
155
+ * Close the peer connection and release local media bindings
156
+ */ close() {
157
+ this.iceTimer && (clearTimeout(this.iceTimer), this.iceTimer = null), this.RTCScreenShareSender && (this.peerConnection.removeTrack(this.RTCScreenShareSender),
158
+ this.RTCScreenShareSender = null), this.RTCSenderAudioSender && (this.peerConnection.removeTrack(this.RTCSenderAudioSender),
159
+ this.RTCSenderAudioSender = null), this.RTCScreenShareTrack = null, this.RTCSenderAudioTrack = null,
160
+ this.audioElement.srcObject = null, this.peerConnection.close();
161
+ }
162
+ /**
163
+ * Create an audio source node from the unified incoming audio stream
164
+ */ createIncomingAudioSource(audioContext) {
165
+ return audioContext.createMediaStreamSource(this.RTCReceiverAudioStream);
166
+ }
167
+ /**
168
+ * Handle track events adding them to the unified audio and video streams
169
+ */ onTrack(event) {
170
+ var _a, _b;
171
+ if (event.streams[0]) {
172
+ if ("video" === event.track.kind) {
173
+ const stream = event.streams[0], id = stream.id;
174
+ this.RTCReceiverVideoTracks.has(id) || (this.RTCReceiverVideoTracks.set(id, stream),
175
+ null === (_a = this.onRemoteVideoStream) || void 0 === _a || _a.call(this, this.RTCReceiverVideoTracks));
176
+ }
177
+ if ("audio" === event.track.kind) {
178
+ const id = event.track.id;
179
+ this.RTCReceiverAudioTracks.has(id) || (this.RTCReceiverAudioStream.addTrack(event.track),
180
+ this.RTCReceiverAudioTracks.set(id, event.track), null === (_b = this.onRemoteAudioStream) || void 0 === _b || _b.call(this, new Map([ [ this.RTCReceiverAudioStream.id, this.RTCReceiverAudioStream ] ])));
181
+ }
182
+ }
183
+ }
184
+ /**
185
+ * Create a local audio element and set its source to the rtc incoming media stream
186
+ */ setupIncomingAudioStream() {
187
+ this.audioElement.autoplay = this.autoPlayAudio, this.audioElement.srcObject = this.RTCReceiverAudioStream;
188
+ }
189
+ /**
190
+ * Set up a local stream with mic and video tracks and add to peer connection
191
+ */ setupOutgoingMediaStream() {
192
+ if (this.RTCSenderAudioTrack && (this.syncSenderAudioStream(this.RTCSenderAudioTrack),
193
+ this.RTCSenderAudioSender = this.peerConnection.addTrack(this.RTCSenderAudioTrack, this.RTCSenderAudioStream)),
194
+ this.RTCSenderVideoTrack) {
195
+ const senderStream = new MediaStream([ this.RTCSenderVideoTrack ]);
196
+ this.peerConnection.addTrack(this.RTCSenderVideoTrack, senderStream);
197
+ }
198
+ }
199
+ /**
200
+ * Keep the sender stream aligned to the current local audio track
201
+ */ syncSenderAudioStream(track) {
202
+ for (const currentTrack of this.RTCSenderAudioStream.getAudioTracks()) this.RTCSenderAudioStream.removeTrack(currentTrack);
203
+ track && this.RTCSenderAudioStream.addTrack(track);
204
+ }
205
+ /**
206
+ * Setup data channels
207
+ */ setupDataChannels(channels) {
208
+ const channelsArray = Array.isArray(channels) ? channels : [ channels ];
209
+ if (channelsArray.length > 0) for (const channel of channelsArray) {
210
+ const dataChannel = this.peerConnection.createDataChannel(channel);
211
+ this.RTCDataChannels.push(dataChannel);
212
+ }
213
+ }
214
+ /**
215
+ * Add listeners for data events and push through callback
216
+ */ setupDataChannelEventListeners() {
217
+ for (const channel of this.RTCDataChannels) {
218
+ const channelName = channel.label;
219
+ channel.addEventListener("message", event => {
220
+ var _a;
221
+ null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "message", event);
222
+ }), channel.addEventListener("open", event => {
223
+ var _a;
224
+ null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "open", event);
225
+ }), channel.addEventListener("close", event => {
226
+ var _a;
227
+ null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "close", event);
228
+ }), channel.addEventListener("error", event => {
229
+ var _a;
230
+ null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "error", event);
231
+ });
232
+ }
233
+ }
234
+ /**
235
+ * Wait for the ICE gathering to be complete
236
+ */ waitForIceGathering() {
237
+ return tslib_es6.__awaiter(this, void 0, void 0, function*() {
238
+ if ("complete" !== this.peerConnection.iceGatheringState) return new Promise((resolve, reject) => {
239
+ const handleStateChange = () => {
240
+ "complete" === this.peerConnection.iceGatheringState && (this.iceTimer && clearTimeout(this.iceTimer),
241
+ this.iceTimer = null, this.peerConnection.removeEventListener("icegatheringstatechange", handleStateChange),
242
+ resolve());
243
+ };
244
+ this.peerConnection.addEventListener("icegatheringstatechange", handleStateChange),
245
+ this.iceTimer = setTimeout(() => {
246
+ this.peerConnection.removeEventListener("icegatheringstatechange", handleStateChange),
247
+ this.iceTimer = null, reject(new Error("ICE gathering timed out"));
248
+ }, 5e3);
249
+ });
250
+ });
251
+ }
252
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var tslib_es6 = require("./tslib.es6-CzpRaW14.js"), React = require("react"), zustand = require("zustand"), shallow = require("zustand/react/shallow"), IndexedDB = require("./IndexedDB-Dgwal8na.js");
3
+ var tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js"), React = require("react"), zustand = require("zustand"), shallow = require("zustand/react/shallow"), IndexedDB = require("./IndexedDB-CeiVT55Z.js");
4
4
 
5
5
  function isValidIDBKey(key) {
6
6
  return "string" == typeof key || "number" == typeof key || key instanceof Date || key instanceof ArrayBuffer || (Array.isArray(key) ? key.every(entry => isValidIDBKey(entry)) : ArrayBuffer.isView(key));
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  "use strict";
3
3
 
4
- var tslib_es6 = require("./tslib.es6-CzpRaW14.js"), React = require("react"), zustand = require("zustand");
4
+ var tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js"), React = require("react"), zustand = require("zustand");
5
5
 
6
6
  const emptyMicStreamRef = {
7
7
  current: null
@@ -95,11 +95,34 @@ function createBoundActions(microphone, clearState) {
95
95
 
96
96
  /**
97
97
  * Bind the value of useMicrophone hook to the useMicrophoneStore. Use this to update the store with a new mic object.
98
- */ const microphoneActions = useMicrophoneStore.getState().actions;
98
+ */ const microphoneActions = {
99
+ sync: microphone => useMicrophoneStore.getState().actions.sync(microphone),
100
+ clear: () => useMicrophoneStore.getState().actions.clear(),
101
+ requestMicrophone: () => useMicrophoneStore.getState().actions.requestMicrophone(),
102
+ stopMicrophone: () => useMicrophoneStore.getState().actions.stopMicrophone(),
103
+ muteMic: () => useMicrophoneStore.getState().actions.muteMic(),
104
+ unmuteMic: () => useMicrophoneStore.getState().actions.unmuteMic(),
105
+ toggleMute: () => useMicrophoneStore.getState().actions.toggleMute(),
106
+ setInputVolume: volume => useMicrophoneStore.getState().actions.setInputVolume(volume),
107
+ refreshMicrophones: () => useMicrophoneStore.getState().actions.refreshMicrophones(),
108
+ setMicrophone: deviceId => useMicrophoneStore.getState().actions.setMicrophone(deviceId)
109
+ };
99
110
 
100
- exports.getMicrophoneState = () => useMicrophoneStore.getState(), exports.microphoneActions = microphoneActions,
111
+ exports.getCurrentMicDeviceLabel = () => {
112
+ var _a, _b, _c;
113
+ const state = useMicrophoneStore.getState(), liveTrackLabel = null === (_a = state.micTrack.current) || void 0 === _a ? void 0 : _a.label;
114
+ if (liveTrackLabel) return liveTrackLabel;
115
+ const currentDeviceId = state.currentDeviceId;
116
+ return currentDeviceId && null !== (_c = null === (_b = state.microphones.find(device => device.deviceId === currentDeviceId)) || void 0 === _b ? void 0 : _b.label) && void 0 !== _c ? _c : null;
117
+ }, exports.getMicrophoneState = () => useMicrophoneStore.getState(), exports.microphoneActions = microphoneActions,
101
118
  exports.useCurrentMicDeviceId = () => useMicrophoneStore(state => state.currentDeviceId),
102
- exports.useMicActive = () => useMicrophoneStore(state => state.isActive), exports.useMicError = () => useMicrophoneStore(state => state.error),
119
+ exports.useCurrentMicDeviceLabel = () => useMicrophoneStore(state => {
120
+ var _a, _b, _c;
121
+ const liveTrackLabel = null === (_a = state.micTrack.current) || void 0 === _a ? void 0 : _a.label;
122
+ if (liveTrackLabel) return liveTrackLabel;
123
+ const currentDeviceId = state.currentDeviceId;
124
+ return currentDeviceId && null !== (_c = null === (_b = state.microphones.find(device => device.deviceId === currentDeviceId)) || void 0 === _b ? void 0 : _b.label) && void 0 !== _c ? _c : null;
125
+ }), exports.useMicActive = () => useMicrophoneStore(state => state.isActive), exports.useMicError = () => useMicrophoneStore(state => state.error),
103
126
  exports.useMicInputVolume = () => useMicrophoneStore(state => state.inputVolume),
104
127
  exports.useMicMuted = () => useMicrophoneStore(state => state.muted), exports.useMicOptions = () => useMicrophoneStore(state => state.micOptions),
105
128
  exports.useMicRequesting = () => useMicrophoneStore(state => state.isRequesting),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var tslib_es6 = require("./tslib.es6-CzpRaW14.js");
3
+ var tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js");
4
4
 
5
5
  /**
6
6
  * Remove scripts, invisible characters, and optional HTML tags from a string.
@@ -2,9 +2,9 @@
2
2
 
3
3
  var zustand = require("zustand");
4
4
 
5
- require("./tslib.es6-CzpRaW14.js");
5
+ require("./tslib.es6-DsF7Wv4Y.js");
6
6
 
7
- var SSEConnection = require("./SSEConnection-ACoOeeTO.js");
7
+ var SSEConnection = require("./SSEConnection-DfjLAlOG.js");
8
8
 
9
9
  const useSSEStore = zustand.create((set, get) => ({
10
10
  connections: [],
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var FileUploadStatus, UploadError, WorkerStatus, tslib_es6 = require("./tslib.es6-CzpRaW14.js");
3
+ var FileUploadStatus, UploadError, WorkerStatus, tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js");
4
4
 
5
5
  !function(FileUploadStatus) {
6
6
  FileUploadStatus.queued = "pending", FileUploadStatus.uploading = "uploading", FileUploadStatus.completed = "completed",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var zustand = require("zustand"), uploadsWorker$1 = require("./uploads-worker-CD-annza.js"), _documentCurrentScript = "undefined" != typeof document ? document.currentScript : null;
3
+ var zustand = require("zustand"), uploadsWorker$1 = require("./uploads-worker-CI-SZptI.js"), _documentCurrentScript = "undefined" != typeof document ? document.currentScript : null;
4
4
 
5
5
  let uploadsWorker = null;
6
6
 
@@ -64,7 +64,7 @@ function handleWorkerMessage(event) {
64
64
  const uploadsActions = useUploadsStore.getState().actions;
65
65
 
66
66
  exports.createUploadsWorker = function(workerUrl) {
67
- return new Worker(null != workerUrl ? workerUrl : new URL("../../workers/uploads/uploads.ts", "undefined" == typeof document ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && "SCRIPT" === _documentCurrentScript.tagName.toUpperCase() && _documentCurrentScript.src || new URL("chunks/uploadsStore-CUeB10zx.js", document.baseURI).href), {
67
+ return new Worker(null != workerUrl ? workerUrl : new URL("../../workers/uploads/uploads.ts", "undefined" == typeof document ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && "SCRIPT" === _documentCurrentScript.tagName.toUpperCase() && _documentCurrentScript.src || new URL("chunks/uploadsStore-DR2hc4ct.js", document.baseURI).href), {
68
68
  type: "module"
69
69
  });
70
70
  }, exports.getUploads = () => useUploadsStore.getState().uploads, exports.getUploadsError = () => useUploadsStore.getState().error,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var tslib_es6 = require("./tslib.es6-CzpRaW14.js");
3
+ var tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js");
4
4
 
5
5
  const useVolumeStore = require("zustand").create((set, get) => ({
6
6
  volume: 1,
@@ -26,12 +26,13 @@ const useVolumeStore = require("zustand").create((set, get) => ({
26
26
  feedbackElement: null
27
27
  });
28
28
  },
29
- setVolume: volume => {
30
- const currentVolume = get().muted ? 0 : volume, attachedMedia = get().elements, newStored = volume > 0 ? volume : get().storedVolume;
29
+ setVolume: (volume, options) => {
30
+ var _a;
31
+ const muted = get().muted, currentVolume = muted ? 0 : volume, attachedMedia = get().elements, feedbackElement = get().feedbackElement, newStored = volume > 0 ? volume : get().storedVolume;
31
32
  attachedMedia.size > 0 && adjustMediaVolume(attachedMedia, currentVolume), set({
32
33
  volume: currentVolume,
33
34
  storedVolume: newStored
34
- });
35
+ }), muted || null !== (_a = null == options ? void 0 : options.playFeedback) && void 0 !== _a && !_a || playFeedbackSound(feedbackElement, currentVolume);
35
36
  },
36
37
  playFeedback: volume => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
37
38
  if (get().muted) return;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ var tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js"), zustand = require("zustand"), WebRTCConnection = require("./WebRTCConnection-eWP4lueC.js");
4
+
5
+ const useWebRTCStore = zustand.create((set, get) => ({
6
+ connections: [],
7
+ actions: {
8
+ addConnection: (name, options) => {
9
+ const existingConnection = get().connections.find(c => c.name === name);
10
+ null == existingConnection || existingConnection.connection.close();
11
+ const connection = new WebRTCConnection.WebRTCConnection(options), nextConnection = {
12
+ name: name,
13
+ connection: connection
14
+ };
15
+ return set(state => ({
16
+ connections: [ ...state.connections.filter(connection => connection.name !== name), nextConnection ]
17
+ })), nextConnection;
18
+ },
19
+ initializeConnection: (name, offerOptions, bearerToken) => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
20
+ var _a;
21
+ const connection = null === (_a = get().connections.find(c => c.name === name)) || void 0 === _a ? void 0 : _a.connection;
22
+ connection && (yield connection.initialize(offerOptions, bearerToken));
23
+ }),
24
+ removeConnection: name => {
25
+ const existingConnection = get().connections.find(c => c.name === name);
26
+ existingConnection && (existingConnection.connection.close(), set(state => ({
27
+ connections: state.connections.filter(connection => connection.name !== name)
28
+ })));
29
+ },
30
+ setMicStream: (name, stream) => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
31
+ var _a;
32
+ const connection = null === (_a = get().connections.find(c => c.name === name)) || void 0 === _a ? void 0 : _a.connection;
33
+ connection && (yield connection.setOutgoingAudioStream(stream));
34
+ }),
35
+ setVolume: (name, volume) => {
36
+ var _a;
37
+ const connection = null === (_a = get().connections.find(c => c.name === name)) || void 0 === _a ? void 0 : _a.connection;
38
+ connection && connection.setVolume(volume);
39
+ }
40
+ }
41
+ })), useWebRTCActions = useWebRTCStore.getState().actions;
42
+
43
+ exports.getWebRTCConnections = function(name) {
44
+ var _a;
45
+ const connections = useWebRTCStore.getState().connections;
46
+ return name ? null !== (_a = connections.find(connection => connection.name === name)) && void 0 !== _a ? _a : null : connections;
47
+ }, exports.useWebRTC = () => useWebRTCStore(state => state.actions), exports.useWebRTCActions = useWebRTCActions,
48
+ exports.useWebRTCConnected = name => useWebRTCStore(state => {
49
+ var _a, _b;
50
+ return name ? null !== (_b = null === (_a = state.connections.find(entry => entry.name === name)) || void 0 === _a ? void 0 : _a.connection.connected) && void 0 !== _b && _b : state.connections.some(entry => entry.connection.connected);
51
+ }), exports.useWebRTCConnection = name => useWebRTCStore(state => {
52
+ var _a;
53
+ return null !== (_a = state.connections.find(connection => connection.name === name)) && void 0 !== _a ? _a : null;
54
+ }), exports.useWebRTCConnections = () => useWebRTCStore(state => state.connections),
55
+ exports.useWebRTCStore = useWebRTCStore;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var FormFactor, tslib_es6 = require("./tslib.es6-CzpRaW14.js"), zustand = require("zustand");
3
+ var FormFactor, tslib_es6 = require("./tslib.es6-DsF7Wv4Y.js"), zustand = require("zustand");
4
4
 
5
5
  /**
6
6
  * Form factor names
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var AudioBubble = require("../../chunks/AudioBubble-k7qS53g6.js");
3
+ var AudioBubble = require("../../chunks/AudioBubble-Dh2IlYW0.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("react"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("react"),
6
6
  require("../../hooks/useTheme.js"), require("../../providers/ThemeProvider.js"),
7
7
  require("../../theme/themes.js"), require("../../theme/colors.js"), require("../../theme/corners.js"),
8
8
  require("../../theme/elevations.js"), require("../../theme/motion.js"), require("../../theme/type.js"),
9
- require("../../hooks/useObserveTheme.js"), require("../../chunks/colors-B0_3srZN.js"),
10
- require("../../chunks/audioVisualizer-MOSbvvnZ.js"), require("../../hooks/useWindow.js"),
9
+ require("../../hooks/useObserveTheme.js"), require("../../chunks/colors-4n0sNFRA.js"),
10
+ require("../../chunks/audioVisualizer-BxPvUj4h.js"), require("../../hooks/useWindow.js"),
11
11
  exports.AudioBubble = AudioBubble.AudioBubble;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var Avatar = require("../../chunks/Avatar-hP8GuwvD.js");
3
+ var Avatar = require("../../chunks/Avatar-WcBAu25_.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("react"),
6
- require("../../chunks/misc-DZAbObFp.js"), exports.Avatar = Avatar.Avatar;
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("react"),
6
+ require("../../chunks/misc-4xyXRU2K.js"), exports.Avatar = Avatar.Avatar;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- var AvatarGroup = require("../../chunks/AvatarGroup-DMy34q7_.js");
3
+ var AvatarGroup = require("../../chunks/AvatarGroup-eUkVdeTf.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("react"),
6
- require("../../chunks/Avatar-hP8GuwvD.js"), require("../../chunks/misc-DZAbObFp.js"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("react"),
6
+ require("../../chunks/Avatar-WcBAu25_.js"), require("../../chunks/misc-4xyXRU2K.js"),
7
7
  exports.AvatarGroup = AvatarGroup.AvatarGroup;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var Badge = require("../../chunks/Badge-D2TbyfJS.js");
3
+ var Badge = require("../../chunks/Badge-4tBynWZe.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("react"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("react"),
6
6
  exports.Badge = Badge.Badge;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var Button = require("../../chunks/Button-CTsHZBEB.js");
3
+ var Button = require("../../chunks/Button-QJ5lsSAz.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("motion/react"),
6
- require("react"), require("../../chunks/Badge-D2TbyfJS.js"), require("../../chunks/Dot-C0MvSJOl.js"),
7
- require("../../chunks/Icon-BFZ_5Qv3.js"), require("../../hooks/useTheme.js"), require("../../providers/ThemeProvider.js"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("motion/react"),
6
+ require("react"), require("../../chunks/Badge-4tBynWZe.js"), require("../../chunks/Dot-BeWDLajy.js"),
7
+ require("../../chunks/Icon-BVYVJp9J.js"), require("../../hooks/useTheme.js"), require("../../providers/ThemeProvider.js"),
8
8
  require("../../theme/themes.js"), require("../../theme/colors.js"), require("../../theme/corners.js"),
9
9
  require("../../theme/elevations.js"), require("../../theme/motion.js"), require("../../theme/type.js"),
10
- require("../../hooks/useObserveTheme.js"), require("../../chunks/misc-DZAbObFp.js"),
11
- require("../../hooks/useWindow.js"), require("../../chunks/ProgressIndicator-ByZ_aYAZ.js"),
12
- require("../../chunks/sharedTypes-CthHPjrO.js"), exports.Button = Button.Button;
10
+ require("../../hooks/useObserveTheme.js"), require("../../chunks/misc-4xyXRU2K.js"),
11
+ require("../../hooks/useWindow.js"), require("../../chunks/ProgressIndicator-CFiAU-aF.js"),
12
+ require("../../chunks/sharedTypes-C0ZHzH_T.js"), exports.Button = Button.Button;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var ButtonBar = require("../../chunks/ButtonBar-BRb1PTmw.js");
3
+ var ButtonBar = require("../../chunks/ButtonBar-DcpvT1vD.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("react"),
6
- require("../../chunks/misc-DZAbObFp.js"), require("../../chunks/Icon-BFZ_5Qv3.js"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("react"),
6
+ require("../../chunks/misc-4xyXRU2K.js"), require("../../chunks/Icon-BVYVJp9J.js"),
7
7
  require("../../hooks/useTheme.js"), require("../../providers/ThemeProvider.js"),
8
8
  require("../../theme/themes.js"), require("../../theme/colors.js"), require("../../theme/corners.js"),
9
9
  require("../../theme/elevations.js"), require("../../theme/motion.js"), require("../../theme/type.js"),
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var Camera = require("../../chunks/Camera-CKv087kr.js");
3
+ var Camera = require("../../chunks/Camera-iDyPLq9h.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("react"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("react"),
6
6
  require("../../hooks/useTheme.js"), require("../../providers/ThemeProvider.js"),
7
7
  require("../../theme/themes.js"), require("../../theme/colors.js"), require("../../theme/corners.js"),
8
8
  require("../../theme/elevations.js"), require("../../theme/motion.js"), require("../../theme/type.js"),
9
- require("../../hooks/useObserveTheme.js"), require("../../chunks/misc-DZAbObFp.js"),
10
- require("../../chunks/colors-B0_3srZN.js"), require("../../hooks/useWindow.js"),
11
- require("../../chunks/Avatar-hP8GuwvD.js"), require("../../chunks/Icon-BFZ_5Qv3.js"),
9
+ require("../../hooks/useObserveTheme.js"), require("../../chunks/misc-4xyXRU2K.js"),
10
+ require("../../chunks/colors-4n0sNFRA.js"), require("../../hooks/useWindow.js"),
11
+ require("../../chunks/Avatar-WcBAu25_.js"), require("../../chunks/Icon-BVYVJp9J.js"),
12
12
  exports.Camera = Camera.Camera;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var CheckBox = require("../../chunks/CheckBox-VRIL1FHh.js");
3
+ var CheckBox = require("../../chunks/CheckBox-CmZJd8u2.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("motion/react"),
6
- require("react"), require("../../chunks/misc-DZAbObFp.js"), require("../../chunks/Icon-BFZ_5Qv3.js"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("motion/react"),
6
+ require("react"), require("../../chunks/misc-4xyXRU2K.js"), require("../../chunks/Icon-BVYVJp9J.js"),
7
7
  require("../../hooks/useTheme.js"), require("../../providers/ThemeProvider.js"),
8
8
  require("../../theme/themes.js"), require("../../theme/colors.js"), require("../../theme/corners.js"),
9
9
  require("../../theme/elevations.js"), require("../../theme/motion.js"), require("../../theme/type.js"),
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var Chip = require("../../chunks/Chip-Dr3vKvRY.js");
3
+ var Chip = require("../../chunks/Chip-Bd1bSYeC.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("react"),
6
- require("../../chunks/misc-DZAbObFp.js"), require("../../chunks/Icon-BFZ_5Qv3.js"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("react"),
6
+ require("../../chunks/misc-4xyXRU2K.js"), require("../../chunks/Icon-BVYVJp9J.js"),
7
7
  require("../../hooks/useTheme.js"), require("../../providers/ThemeProvider.js"),
8
8
  require("../../theme/themes.js"), require("../../theme/colors.js"), require("../../theme/corners.js"),
9
9
  require("../../theme/elevations.js"), require("../../theme/motion.js"), require("../../theme/type.js"),
10
10
  require("../../hooks/useObserveTheme.js"), require("../../hooks/useWindow.js"),
11
- require("../../chunks/sharedTypes-CthHPjrO.js"), exports.Chip = Chip.Chip;
11
+ require("../../chunks/sharedTypes-C0ZHzH_T.js"), exports.Chip = Chip.Chip;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var DivInput = require("../../chunks/DivInput-Ci0gaCWL.js");
3
+ var DivInput = require("../../chunks/DivInput-BY9pQ6ty.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("motion/react"),
6
- require("react"), require("../../chunks/misc-DZAbObFp.js"), exports.DivInput = DivInput.DivInput;
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("motion/react"),
6
+ require("react"), require("../../chunks/misc-4xyXRU2K.js"), exports.DivInput = DivInput.DivInput;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var Dot = require("../../chunks/Dot-C0MvSJOl.js");
3
+ var Dot = require("../../chunks/Dot-BeWDLajy.js");
4
4
 
5
- require("../../chunks/tslib.es6-CzpRaW14.js"), require("react/jsx-runtime"), require("motion/react"),
5
+ require("../../chunks/tslib.es6-DsF7Wv4Y.js"), require("react/jsx-runtime"), require("motion/react"),
6
6
  require("react"), exports.Dot = Dot.Dot;