@snapcall/stream-ui 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ import {v4 as $3Sbms$v4} from "uuid";
9
9
  import {WebSocketTransport as $3Sbms$WebSocketTransport, Peer as $3Sbms$Peer} from "protoo-client";
10
10
  import {Device as $3Sbms$Device} from "mediasoup-client";
11
11
  import {setTag as $3Sbms$setTag, addBreadcrumb as $3Sbms$addBreadcrumb, captureException as $3Sbms$captureException} from "@sentry/browser";
12
+ import {Producer as $3Sbms$Producer} from "mediasoup-client/lib/Producer";
12
13
  import {toCanvas as $3Sbms$toCanvas} from "qrcode";
13
14
 
14
15
 
@@ -509,6 +510,7 @@ const $15ddac3121cc3a5d$export$4a210166cc9cb64b = async (src)=>{
509
510
 
510
511
 
511
512
 
513
+
512
514
  const $c31e3fb4360572af$export$818d60b2e626da0c = {
513
515
  WEBRTC_FAILED: "WRTC1",
514
516
  WEBRTC_RECOVER_ERROR: "WRTC2",
@@ -523,7 +525,8 @@ const $c31e3fb4360572af$export$d21ffcc5eb136bfa = {
523
525
  },
524
526
  height: {
525
527
  ideal: 240
526
- }
528
+ },
529
+ qualityIndex: 3
527
530
  },
528
531
  vga: {
529
532
  width: {
@@ -531,7 +534,8 @@ const $c31e3fb4360572af$export$d21ffcc5eb136bfa = {
531
534
  },
532
535
  height: {
533
536
  ideal: 480
534
- }
537
+ },
538
+ qualityIndex: 2
535
539
  },
536
540
  hd: {
537
541
  width: {
@@ -539,7 +543,8 @@ const $c31e3fb4360572af$export$d21ffcc5eb136bfa = {
539
543
  },
540
544
  height: {
541
545
  ideal: 720
542
- }
546
+ },
547
+ qualityIndex: 1
543
548
  }
544
549
  };
545
550
  const $c31e3fb4360572af$var$WEBCAM_SIMULCAST_ENCODINGS = [
@@ -566,19 +571,12 @@ const $c31e3fb4360572af$var$SCREEN_SHARING_SIMULCAST_ENCODINGS = [
566
571
  maxBitrate: 6000000
567
572
  },
568
573
  ];
569
- const $c31e3fb4360572af$var$fetchAgentInfo = async ({ apiKey: apiKey , email: email })=>{
570
- const apiURL = "https://api.snapcall.io/v2";
571
- const agent = await fetch(`${apiURL}/agents/${email}`, {
572
- method: "get",
573
- headers: {
574
- Authorization: `Bearer ${apiKey}`
575
- }
576
- }).then((response)=>{
577
- if (response.ok) return response.json();
578
- throw new Error("Invalid agent info");
579
- });
580
- return agent;
581
- };
574
+ class $c31e3fb4360572af$var$SnapcallEvent extends CustomEvent {
575
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor
576
+ constructor(name, data){
577
+ super(name, data);
578
+ }
579
+ }
582
580
  const $c31e3fb4360572af$var$StreamerEventTargetType = EventTarget;
583
581
  class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$StreamerEventTargetType {
584
582
  pendingDeviceRequest = {};
@@ -587,14 +585,19 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
587
585
  constructor(){
588
586
  super();
589
587
  navigator.mediaDevices.addEventListener("devicechange", ()=>this.onDeviceChange());
590
- this.iceServers = [
591
- {
592
- urls: "turns:t.snapcall.io:443?transport=tcp,turns:t-2.snapcall.io:443?transport=tcp"?.split(",") || [],
593
- username: "test",
594
- credential: "test",
595
- credentialType: "password"
596
- },
597
- ];
588
+ this.config = {
589
+ apiUrl: String("https://api.snapcall.io/v2"),
590
+ streamerServer: String("wss://g.snapcall.io/stream"),
591
+ streamerApi: String("https://g.snapcall.io/stream"),
592
+ iceServers: [
593
+ {
594
+ urls: "turns:t.snapcall.io:443?transport=tcp,turns:t2.snapcall.io:443?transport=tcp"?.split(",") || [],
595
+ username: "test",
596
+ credential: "test",
597
+ credentialType: "password"
598
+ },
599
+ ]
600
+ };
598
601
  this.peers = new Map();
599
602
  this.consumers = new Map();
600
603
  this.webcams = new Map();
@@ -615,6 +618,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
615
618
  this.screenshareProducer = null;
616
619
  this.customMessages = new Map();
617
620
  this.audioRenderers = {};
621
+ this.profile = {};
618
622
  }
619
623
  getState() {
620
624
  const peers = [];
@@ -640,14 +644,14 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
640
644
  });
641
645
  peers.push({
642
646
  peerId: key,
643
- displayName: peer.displayName,
647
+ profile: peer.profile,
644
648
  deviceState: deviceState
645
649
  });
646
650
  });
647
651
  return {
648
652
  roomId: this.roomId,
649
653
  peerId: this.peerId,
650
- displayName: this.displayName,
654
+ profile: this.profile,
651
655
  callId: undefined,
652
656
  deviceState: this.getDevicesState(),
653
657
  peers: peers
@@ -655,9 +659,10 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
655
659
  }
656
660
  onStartSpeak() {
657
661
  if (this.micProducer && !this.micProducer.paused) {
658
- const event = new CustomEvent("localStartSpeak", {
662
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("localStartSpeak", {
659
663
  cancelable: true,
660
- bubbles: true
664
+ bubbles: true,
665
+ detail: {}
661
666
  });
662
667
  this.dispatchEvent(event);
663
668
  this.protoo.notify("startSpeak");
@@ -665,13 +670,15 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
665
670
  }
666
671
  onStopSpeak() {
667
672
  if (this.micProducer && !this.micProducer.paused) {
668
- const event = new CustomEvent("localStopSpeak");
673
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("localStopSpeak", {
674
+ detail: {}
675
+ });
669
676
  this.dispatchEvent(event);
670
677
  this.protoo.notify("stopSpeak");
671
678
  }
672
679
  }
673
680
  onCriticalError(code) {
674
- const event = new CustomEvent("criticalError", {
681
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("criticalError", {
675
682
  detail: {
676
683
  code: code
677
684
  }
@@ -679,7 +686,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
679
686
  this.dispatchEvent(event);
680
687
  }
681
688
  async generateToken(bid) {
682
- const url = "https://g.snapcall.io/stream";
689
+ const url = this.config.streamerApi;
683
690
  const { token: token } = await fetch(`${url}/stream`, {
684
691
  method: "post",
685
692
  headers: {
@@ -698,7 +705,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
698
705
  if (!this.peerId) this.peerId = (0, $3Sbms$v4)();
699
706
  let url;
700
707
  try {
701
- const { instanceId: instanceId } = await fetch(`${"https://g.snapcall.io/stream"}/instance/${this.roomId}`, {
708
+ const { instanceId: instanceId } = await fetch(`${this.config.streamerApi}/instance/${this.roomId}`, {
702
709
  method: "get",
703
710
  headers: {
704
711
  "Content-Type": "application/json"
@@ -707,9 +714,11 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
707
714
  if (response.ok) return response.json();
708
715
  throw new Error("Invalid room ID");
709
716
  });
710
- url = `${"wss://g.snapcall.io/stream"}/${instanceId}/?roomId=${room}&peerId=${this.peerId}`;
717
+ url = `${this.config.streamerServer}/${instanceId}/?roomId=${room}&peerId=${this.peerId}`;
711
718
  } catch (roomError) {
712
- const event = new CustomEvent("invalidRoom");
719
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("invalidRoom", {
720
+ detail: {}
721
+ });
713
722
  this.dispatchEvent(event);
714
723
  }
715
724
  if (!url) throw new Error("Invalid socket URL");
@@ -735,17 +744,18 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
735
744
  this.protoo.on("notification", async (notification)=>{
736
745
  console.log("notification", notification);
737
746
  if (notification.method === "newPeer") {
738
- const { id: id , displayName: displayName } = notification.data;
747
+ const { id: id , profile: profile } = notification.data;
739
748
  this.peers.set(id, {
740
749
  id: id,
741
750
  peerId: id,
742
- displayName: displayName,
751
+ profile: profile,
743
752
  producersData: []
744
753
  });
745
- const event = new CustomEvent("newPeer", {
754
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("newPeer", {
746
755
  detail: {
747
756
  peerId: id,
748
- displayName: displayName
757
+ displayName: profile.name,
758
+ profile: profile
749
759
  }
750
760
  });
751
761
  this.dispatchEvent(event);
@@ -765,7 +775,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
765
775
  consumerId: consumer.id
766
776
  });
767
777
  });
768
- const event = new CustomEvent("peerClosed", {
778
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("peerClosed", {
769
779
  detail: {
770
780
  peerId: peerId
771
781
  }
@@ -778,39 +788,60 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
778
788
  });
779
789
  } else if (notification.method === "displayName") {
780
790
  const { peerId: peerId , displayName: displayName } = notification.data;
781
- const event = new CustomEvent("displayName", {
791
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("displayName", {
792
+ detail: {
793
+ peerId: peerId,
794
+ displayName: displayName,
795
+ profile: {}
796
+ }
797
+ });
798
+ this.dispatchEvent(event);
799
+ } else if (notification.method === "profile") {
800
+ const { peerId: peerId , profile: profile } = notification.data;
801
+ const event = new CustomEvent("profileUpdate", {
782
802
  detail: {
783
803
  peerId: peerId,
784
- displayName: displayName
804
+ profile: profile
785
805
  }
786
806
  });
787
807
  this.dispatchEvent(event);
788
808
  } else if (notification.method === "requestDevice") {
789
809
  this.pendingDeviceRequest[notification.data.requestId] = notification.data;
790
- const event = new CustomEvent("requestDevice", {
810
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("requestDevice", {
791
811
  detail: notification.data
792
812
  });
793
813
  this.dispatchEvent(event);
794
814
  } else if (notification.method === "startSpeak") ;
795
815
  else if (notification.method === "stopSpeak") ;
796
816
  else if (notification.method === "producerPaused" || notification.method === "producerResumed") {
817
+ const { peerId: peerId , producerId: producerId , deviceType: deviceType } = notification.data;
797
818
  if (notification.data?.deviceType === "microphone") {
798
- const { peerId: peerId , producerId: producerId } = notification.data;
799
819
  const microphoneData = this.peers.get(peerId)?.producersData.find((ele)=>producerId === ele.producerId);
800
820
  if (microphoneData) microphoneData.paused = notification.method === "producerPaused" ? true : false;
801
821
  }
802
- const event = new CustomEvent(notification.method, {
803
- detail: notification.data
822
+ let id = producerId;
823
+ for (let [, value] of Array.from(this.consumers.entries()))if (value.mediaSoupConsumer.producerId === producerId) {
824
+ id = value.mediaSoupConsumer.id;
825
+ break;
826
+ }
827
+ const eventName = notification.method === "producerPaused" ? "mediaPause" : "mediaResume";
828
+ const event = new $c31e3fb4360572af$var$SnapcallEvent(eventName, {
829
+ detail: {
830
+ mediaId: id,
831
+ peerId: peerId,
832
+ deviceType: deviceType,
833
+ paused: notification.method === "producerPaused"
834
+ }
804
835
  });
805
836
  this.dispatchEvent(event);
806
837
  } else if (notification.method === "requestDeviceResult") {
807
- const event = new CustomEvent(notification.method, {
838
+ const event = new $c31e3fb4360572af$var$SnapcallEvent(notification.method, {
808
839
  detail: notification.data
809
840
  });
810
841
  this.dispatchEvent(event);
811
842
  } else if (notification.method === "terminateRoom") {
812
843
  this.release();
813
- const event = new CustomEvent(notification.method, {
844
+ const event = new $c31e3fb4360572af$var$SnapcallEvent(notification.method, {
814
845
  detail: notification.data
815
846
  });
816
847
  this.dispatchEvent(event);
@@ -835,7 +866,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
835
866
  const sortedChunks = message.chunks.sort((a, b)=>a.index - b.index);
836
867
  const mergedChunks = sortedChunks.reduce((originalMessage, chunk)=>originalMessage + chunk.data, "");
837
868
  const parsedEvent = JSON.parse(mergedChunks);
838
- const event = new CustomEvent("customMessage", {
869
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("customMessage", {
839
870
  detail: {
840
871
  ...notification.data,
841
872
  event: parsedEvent
@@ -894,7 +925,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
894
925
  role: "auto"
895
926
  },
896
927
  sctpParameters: transportInfo.sctpParameters,
897
- iceServers: this.iceServers,
928
+ iceServers: this.config.iceServers,
898
929
  proprietaryConstraints: {
899
930
  optional: [
900
931
  {
@@ -1001,11 +1032,11 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1001
1032
  }
1002
1033
  // now we join
1003
1034
  if (this.joinOptions.apiKey && this.joinOptions.email) try {
1004
- const agentInfo = await $c31e3fb4360572af$var$fetchAgentInfo({
1035
+ const agentInfo = await this.fetchAgentInfo({
1005
1036
  apiKey: this.joinOptions.apiKey,
1006
1037
  email: this.joinOptions.email
1007
1038
  });
1008
- if (agentInfo) this.dispatchEvent(new CustomEvent("agentIdentity", {
1039
+ if (agentInfo) this.dispatchEvent(new $c31e3fb4360572af$var$SnapcallEvent("agentIdentity", {
1009
1040
  detail: {
1010
1041
  success: true,
1011
1042
  email: this.joinOptions.email
@@ -1013,7 +1044,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1013
1044
  }));
1014
1045
  } catch (agentInfoError) {
1015
1046
  console.warn(agentInfoError);
1016
- this.dispatchEvent(new CustomEvent("agentIdentity", {
1047
+ this.dispatchEvent(new $c31e3fb4360572af$var$SnapcallEvent("agentIdentity", {
1017
1048
  detail: {
1018
1049
  success: false
1019
1050
  }
@@ -1031,7 +1062,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1031
1062
  },
1032
1063
  ]));
1033
1064
  const callId = await this.getCallId();
1034
- this.dispatchEvent(new CustomEvent("enterRoom", {
1065
+ this.dispatchEvent(new $c31e3fb4360572af$var$SnapcallEvent("enterRoom", {
1035
1066
  detail: {
1036
1067
  peerId: this.peerId,
1037
1068
  peers: peers.map((peer)=>{
@@ -1045,6 +1076,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1045
1076
  }));
1046
1077
  console.log("peers", peers);
1047
1078
  if (this.joinOptions.displayName) await this.setDisplayName(this.joinOptions.displayName);
1079
+ if (this.joinOptions.profile) await this.setProfile(this.joinOptions.profile);
1048
1080
  // Consume Peers
1049
1081
  peers.forEach((peer)=>{
1050
1082
  this.consumePeer({
@@ -1085,7 +1117,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1085
1117
  const producerId = this.micProducer?.id;
1086
1118
  this.micProducer?.close();
1087
1119
  this.micProducer = undefined;
1088
- const event = new CustomEvent("microphoneMute");
1120
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("microphoneMute", {
1121
+ detail: {}
1122
+ });
1089
1123
  this.dispatchEvent(event);
1090
1124
  await this.protoo.request("closeProducer", {
1091
1125
  producerId: producerId
@@ -1093,7 +1127,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1093
1127
  }
1094
1128
  async onDeviceChange() {
1095
1129
  console.log("detecting device change");
1096
- const deviceListChangeEvent = new CustomEvent("devicesListChange");
1130
+ const deviceListChangeEvent = new $c31e3fb4360572af$var$SnapcallEvent("devicesListChange", {
1131
+ detail: {}
1132
+ });
1097
1133
  this.dispatchEvent(deviceListChangeEvent);
1098
1134
  if (!this.protoo.closed && this.micProducer) {
1099
1135
  const lists = await navigator.mediaDevices.enumerateDevices();
@@ -1120,7 +1156,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1120
1156
  }
1121
1157
  console.log("detecting audio input change");
1122
1158
  if (!this.audioInputDefaultDevice || this.audioInputDefaultDevice.label !== defaultDevice.label) {
1123
- const event = new CustomEvent("defaultAudioDeviceChange", {
1159
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("defaultAudioDeviceChange", {
1124
1160
  detail: defaultDevice
1125
1161
  });
1126
1162
  this.audioInputDefaultDevice = defaultDevice;
@@ -1167,7 +1203,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1167
1203
  });
1168
1204
  this.micProducer = micProducer;
1169
1205
  this.muted = false;
1170
- const event = new CustomEvent("microphoneEnabled");
1206
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("microphoneEnabled", {
1207
+ detail: {}
1208
+ });
1171
1209
  this.dispatchEvent(event);
1172
1210
  }
1173
1211
  }
@@ -1179,7 +1217,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1179
1217
  producerId: this.micProducer?.id
1180
1218
  });
1181
1219
  this.muted = true;
1182
- const event = new CustomEvent("microphoneMute");
1220
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("microphoneMute", {
1221
+ detail: {}
1222
+ });
1183
1223
  this.dispatchEvent(event);
1184
1224
  }
1185
1225
  }
@@ -1191,7 +1231,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1191
1231
  producerId: this.micProducer.id
1192
1232
  });
1193
1233
  this.muted = false;
1194
- const event = new CustomEvent("microphoneUnmute");
1234
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("microphoneUnmute", {
1235
+ detail: {}
1236
+ });
1195
1237
  this.dispatchEvent(event);
1196
1238
  }
1197
1239
  }
@@ -1229,10 +1271,12 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1229
1271
  }
1230
1272
  endCall() {
1231
1273
  this.release();
1232
- const event = new CustomEvent("leaveRoom");
1274
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("leaveRoom", {
1275
+ detail: {}
1276
+ });
1233
1277
  this.dispatchEvent(event);
1234
1278
  const deprecatedEvent = new CustomEvent("snapcallEvent_callEnd");
1235
- this.dispatchEvent(deprecatedEvent);
1279
+ window.dispatchEvent(deprecatedEvent);
1236
1280
  }
1237
1281
  terminateRoom() {
1238
1282
  this.protoo.request("terminateRoom");
@@ -1246,7 +1290,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1246
1290
  }
1247
1291
  if (this.webcams.size === 0) this.webcam.device = null;
1248
1292
  else if (!this.webcam.device) this.webcam.device = this.webcams.values().next().value;
1249
- const event = new CustomEvent("webcamsUpdate", {
1293
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("webcamsUpdate", {
1250
1294
  detail: {
1251
1295
  numberOfAvailableWebcams: this.webcams.size
1252
1296
  }
@@ -1303,7 +1347,16 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1303
1347
  });
1304
1348
  }
1305
1349
  }
1306
- scaleVideo() {
1350
+ scaleVideoMediasConstraintsParameter(scale) {
1351
+ let videoResolution = $c31e3fb4360572af$export$d21ffcc5eb136bfa["hd"];
1352
+ if (scale === 2) videoResolution = $c31e3fb4360572af$export$d21ffcc5eb136bfa["vga"];
1353
+ else if (scale > 2) videoResolution = $c31e3fb4360572af$export$d21ffcc5eb136bfa["qvga"];
1354
+ if (!this.webcam.resolution || $c31e3fb4360572af$export$d21ffcc5eb136bfa[this.webcam.resolution].qualityIndex >= videoResolution.qualityIndex) {
1355
+ console.log(`scaling video by ${scale}`, videoResolution);
1356
+ this.webcamProducer?.track?.applyConstraints(videoResolution);
1357
+ }
1358
+ }
1359
+ scaleVideoEncodingsParameter() {
1307
1360
  try {
1308
1361
  let videoCount = 0;
1309
1362
  this.consumers.forEach((consumer)=>{
@@ -1319,10 +1372,12 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1319
1372
  if (videoCount >= 9) scale = {
1320
1373
  scaleResolutionDownBy: 4
1321
1374
  };
1375
+ if (!(0, $3Sbms$Producer).prototype.setRtpEncodingParameters) return this.scaleVideoMediasConstraintsParameter(scale.scaleResolutionDownBy);
1322
1376
  if (this.webcamProducer && !this.webcamProducer.closed) {
1323
1377
  console.log(`scaling video by ${scale.scaleResolutionDownBy}`);
1324
1378
  this.webcamProducer?.setRtpEncodingParameters?.(scale).catch((err)=>{
1325
1379
  console.error("scaleResolutionDownBy not supported", err);
1380
+ this.scaleVideoMediasConstraintsParameter(scale.scaleResolutionDownBy);
1326
1381
  });
1327
1382
  }
1328
1383
  } catch (error) {
@@ -1365,7 +1420,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1365
1420
  min: capabilities?.zoom?.min || 0,
1366
1421
  max: capabilities?.zoom?.max || 0
1367
1422
  };
1368
- const event = new CustomEvent("localVideoChange", {
1423
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("localVideoChange", {
1369
1424
  detail: {
1370
1425
  camera: this.getCurrentWebcam()
1371
1426
  }
@@ -1407,14 +1462,14 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1407
1462
  deviceType: deviceType
1408
1463
  }
1409
1464
  });
1410
- this.scaleVideo();
1465
+ this.scaleVideoEncodingsParameter();
1411
1466
  this.webcamProducer.on("transportclose", ()=>{
1412
1467
  this.webcamProducer = null;
1413
1468
  });
1414
1469
  this.webcamProducer.on("trackended", ()=>{
1415
1470
  this.disableVideo().catch(()=>{});
1416
1471
  });
1417
- const event = new CustomEvent("localVideoAvailable", {
1472
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("localVideoAvailable", {
1418
1473
  detail: {
1419
1474
  camera: this.getCurrentWebcam()
1420
1475
  }
@@ -1455,7 +1510,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1455
1510
  producerId: this.webcamProducer.id
1456
1511
  });
1457
1512
  this.webcamProducer = null;
1458
- const event = new CustomEvent("localVideoUnavailable");
1513
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("localVideoUnavailable", {
1514
+ detail: {}
1515
+ });
1459
1516
  this.dispatchEvent(event);
1460
1517
  }
1461
1518
  async enableScreenshare() {
@@ -1498,7 +1555,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1498
1555
  this.screenshareProducer.on("trackended", ()=>{
1499
1556
  this.disableScreenshare().catch(()=>{});
1500
1557
  });
1501
- const event = new CustomEvent("screenshareEnabled");
1558
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("screenshareEnabled", {
1559
+ detail: {}
1560
+ });
1502
1561
  this.dispatchEvent(event);
1503
1562
  }
1504
1563
  async disableScreenshare() {
@@ -1509,7 +1568,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1509
1568
  });
1510
1569
  this.screenshareProducer = null;
1511
1570
  }
1512
- const event = new CustomEvent("screenshareDisabled");
1571
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("screenshareDisabled", {
1572
+ detail: {}
1573
+ });
1513
1574
  this.dispatchEvent(event);
1514
1575
  }
1515
1576
  onConsumerClose({ consumerId: consumerId }) {
@@ -1522,19 +1583,21 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1522
1583
  });
1523
1584
  consumer.mediaSoupConsumer.close();
1524
1585
  this.consumers.delete(consumerId);
1525
- this.scaleVideo();
1526
- const event = new CustomEvent("consumerClose", {
1586
+ this.scaleVideoEncodingsParameter();
1587
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("mediaStop", {
1527
1588
  detail: {
1528
- peerId: consumer.mediaSoupConsumer.appData.peerId,
1529
- deviceType: consumer.deviceType
1589
+ mediaId: consumerId,
1590
+ peerId: String(consumer.mediaSoupConsumer.appData.peerId),
1591
+ deviceType: consumer.deviceType,
1592
+ paused: false
1530
1593
  }
1531
1594
  });
1532
1595
  if (consumer.deviceType === "microphone") this.deleteAudioRenderer(consumerId);
1533
1596
  this.dispatchEvent(event);
1534
1597
  }
1535
1598
  }
1536
- requestVideo({ consumerId: consumerId , element: element }) {
1537
- const consumer = this.consumers.get(consumerId);
1599
+ requestVideo({ mediaId: mediaId , element: element }) {
1600
+ const consumer = this.consumers.get(mediaId);
1538
1601
  if (consumer) {
1539
1602
  const mediaStream = new MediaStream();
1540
1603
  mediaStream.onremovetrack = ()=>console.log("Remove Track");
@@ -1616,11 +1679,11 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1616
1679
  mediaSoupConsumer: consumer,
1617
1680
  deviceType: deviceType
1618
1681
  });
1619
- this.scaleVideo();
1620
- const event = new CustomEvent("newConsumer", {
1682
+ this.scaleVideoEncodingsParameter();
1683
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("mediaStart", {
1621
1684
  detail: {
1622
1685
  peerId: peerId,
1623
- consumerId: consumer.id,
1686
+ mediaId: consumer.id,
1624
1687
  deviceType: deviceType,
1625
1688
  paused: paused
1626
1689
  }
@@ -1643,13 +1706,27 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1643
1706
  }
1644
1707
  }
1645
1708
  async setDisplayName(displayName) {
1646
- this.displayName = displayName;
1647
- await this.protoo.request("setDisplayName", {
1648
- displayName: displayName
1709
+ await this.setProfile({
1710
+ name: displayName
1649
1711
  });
1650
- const event = new CustomEvent("selfDisplayName", {
1712
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("selfDisplayName", {
1651
1713
  detail: {
1652
- displayName: displayName
1714
+ peerId: this.peerId,
1715
+ displayName: this.profile?.name,
1716
+ profile: this.profile
1717
+ }
1718
+ });
1719
+ this.dispatchEvent(event);
1720
+ }
1721
+ async setProfile(profile) {
1722
+ const newProfile = await this.protoo.request("setProfile", profile);
1723
+ this.profile = {
1724
+ ...newProfile
1725
+ };
1726
+ const event = new $c31e3fb4360572af$var$SnapcallEvent("selfProfileUpdate", {
1727
+ detail: {
1728
+ peerId: this.peerId,
1729
+ profile: this.profile
1653
1730
  }
1654
1731
  });
1655
1732
  this.dispatchEvent(event);
@@ -1742,16 +1819,13 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1742
1819
  getCurrentWebcam() {
1743
1820
  return this.webcam;
1744
1821
  }
1745
- getWebcamsList() {
1746
- return this.webcams;
1747
- }
1748
1822
  async setWebcamResolution(resolution) {
1749
1823
  if (this.webcam.device) await this.switchWebcam({
1750
1824
  resolution: resolution
1751
1825
  });
1752
1826
  else {
1753
1827
  this.webcam.resolution = resolution;
1754
- const e = new CustomEvent("localVideoChange", {
1828
+ const e = new $c31e3fb4360572af$var$SnapcallEvent("localVideoChange", {
1755
1829
  detail: {
1756
1830
  camera: this.getCurrentWebcam()
1757
1831
  }
@@ -1788,6 +1862,25 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1788
1862
  });
1789
1863
  return data;
1790
1864
  }
1865
+ async fetchAgentInfo({ apiKey: apiKey , email: email }) {
1866
+ const apiURL = this.config.apiUrl;
1867
+ const agent = await fetch(`${apiURL}/agents/${email}`, {
1868
+ method: "get",
1869
+ headers: {
1870
+ Authorization: `Bearer ${apiKey}`
1871
+ }
1872
+ }).then((response)=>{
1873
+ if (response.ok) return response.json();
1874
+ throw new Error("Invalid agent info");
1875
+ });
1876
+ return agent;
1877
+ }
1878
+ setConfig(config) {
1879
+ this.config = {
1880
+ ...this.config,
1881
+ ...config
1882
+ };
1883
+ }
1791
1884
  }
1792
1885
 
1793
1886
 
@@ -1811,7 +1904,7 @@ let $2884da8a64948e35$export$96a9662a3eda31f6;
1811
1904
  StreamsReducerActionTypes1[StreamsReducerActionTypes1["UNMUTE"] = 5] = "UNMUTE";
1812
1905
  StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_HIGHLIGHTED_TILE"] = 6] = "SET_HIGHLIGHTED_TILE";
1813
1906
  StreamsReducerActionTypes1[StreamsReducerActionTypes1["UNSET_HIGHLIGHTED_TILE"] = 7] = "UNSET_HIGHLIGHTED_TILE";
1814
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAM_DISPLAY_NAME"] = 8] = "SET_STREAM_DISPLAY_NAME";
1907
+ StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAM_PROFILE"] = 8] = "SET_STREAM_PROFILE";
1815
1908
  StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAM_SPEAKING"] = 9] = "SET_STREAM_SPEAKING";
1816
1909
  })($2884da8a64948e35$export$96a9662a3eda31f6 || ($2884da8a64948e35$export$96a9662a3eda31f6 = {}));
1817
1910
  const $2884da8a64948e35$export$7fc21eab2c971c9c = {
@@ -1843,7 +1936,7 @@ const $2884da8a64948e35$export$43fc78ab8758f39 = (state, action)=>{
1843
1936
  };
1844
1937
  case $2884da8a64948e35$export$96a9662a3eda31f6.DEVICE_UPDATE:
1845
1938
  {
1846
- const { streamId: streamId , consumerId: consumerId , device: device , available: available , paused: paused } = action.payload;
1939
+ const { streamId: streamId , mediaId: mediaId , device: device , available: available , paused: paused } = action.payload;
1847
1940
  return {
1848
1941
  ...state,
1849
1942
  streams: state.streams.map((stream)=>{
@@ -1852,7 +1945,7 @@ const $2884da8a64948e35$export$43fc78ab8758f39 = (state, action)=>{
1852
1945
  if (device === "microphone") muted = paused;
1853
1946
  return {
1854
1947
  ...stream,
1855
- [device]: available ? consumerId : null,
1948
+ [device]: available ? mediaId : null,
1856
1949
  muted: muted
1857
1950
  };
1858
1951
  }
@@ -1892,13 +1985,13 @@ const $2884da8a64948e35$export$43fc78ab8758f39 = (state, action)=>{
1892
1985
  ...state,
1893
1986
  highlightedTile: null
1894
1987
  };
1895
- case $2884da8a64948e35$export$96a9662a3eda31f6.SET_STREAM_DISPLAY_NAME:
1988
+ case $2884da8a64948e35$export$96a9662a3eda31f6.SET_STREAM_PROFILE:
1896
1989
  return {
1897
1990
  ...state,
1898
1991
  streams: state.streams.map((stream)=>{
1899
1992
  if (stream.id === action.payload.streamId) return {
1900
1993
  ...stream,
1901
- displayName: action.payload.displayName
1994
+ profile: action.payload.profile
1902
1995
  };
1903
1996
  return stream;
1904
1997
  })
@@ -3170,13 +3263,23 @@ const $7ec04c1818c68245$export$f6525863ef5a71a9 = (0, $3Sbms$styledcomponents).d
3170
3263
  align-items: center;
3171
3264
  width: 14px;
3172
3265
  height: 14px;
3173
- padding: 3px 4px;
3174
3266
  box-sizing: border-box;
3175
3267
  background-color: #2d2d2d;
3176
3268
  border-radius: 50px;
3177
3269
  font-size: 9px;
3178
3270
  font-weight: 700;
3179
3271
  line-height: 8px;
3272
+
3273
+ svg {
3274
+ width: 8px;
3275
+ height: 8px;
3276
+ }
3277
+ `;
3278
+ const $7ec04c1818c68245$export$a7a74ab5cffd1455 = (0, $3Sbms$styledcomponents).img`
3279
+ width: 100%;
3280
+ height: 100%;
3281
+ border-radius: inherit;
3282
+ object-fit: cover;
3180
3283
  `;
3181
3284
  const $7ec04c1818c68245$export$f217faec90120a0c = (0, $3Sbms$styledcomponents).div`
3182
3285
  display: flex;
@@ -3255,11 +3358,6 @@ const $7ec04c1818c68245$export$a2930b41faa750f4 = (0, $3Sbms$styledcomponents).s
3255
3358
  line-height: 20px;
3256
3359
  color: #fff;
3257
3360
  `;
3258
- const $7ec04c1818c68245$export$2d75367b6e042d67 = (0, $3Sbms$styledcomponents).img`
3259
- width: inherit;
3260
- height: inherit;
3261
- border-radius: inherit;
3262
- `;
3263
3361
  const $7ec04c1818c68245$export$26fe7ec9351ff761 = (0, $3Sbms$styledcomponents).img`
3264
3362
  border: 2px solid #fff;
3265
3363
  border-radius: 8px;
@@ -3500,6 +3598,17 @@ const $6efc75079651494a$export$500c3c5544c37412 = (0, $3Sbms$styledcomponents)((
3500
3598
  font-weight: 700;
3501
3599
  line-height: 13px;
3502
3600
  `;
3601
+ const $6efc75079651494a$export$88248b9be937544a = (0, $3Sbms$styledcomponents).div`
3602
+ display: flex;
3603
+ align-items: center;
3604
+ font-size: 18px;
3605
+ line-height: 15px;
3606
+
3607
+ svg {
3608
+ width: 12px;
3609
+ height: 12px;
3610
+ }
3611
+ `;
3503
3612
 
3504
3613
 
3505
3614
 
@@ -3518,7 +3627,7 @@ const $a53a1c6f62ad0fcc$var$StreamTile = ({ stream: stream , width: width = 0 ,
3518
3627
  const { highlightedTile: highlightedTile } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
3519
3628
  const isSharingScreen = highlightedTile?.type === "screenshare" && highlightedTile.peerId === selfPeerId;
3520
3629
  const microphoneActive = stream.microphone && !stream.muted;
3521
- const showRequestDevice = !requestingDevice && hover && !highlightedTile && (!microphoneActive || !stream.webcam);
3630
+ const showRequestDevice = !requestingDevice && hover && !highlightedTile && (!microphoneActive || !stream.webcam || !isSharingScreen);
3522
3631
  const tileWidth = `${width}px`;
3523
3632
  const tileHeight = `${height}px`;
3524
3633
  const videoMaxHeight = "100%";
@@ -3540,7 +3649,7 @@ const $a53a1c6f62ad0fcc$var$StreamTile = ({ stream: stream , width: width = 0 ,
3540
3649
  (0, $3Sbms$useEffect)(()=>{
3541
3650
  if (!videoElementRef.current) throw new Error("videoElementRef not available");
3542
3651
  if (stream.webcam && videoElementRef.current) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).requestVideo({
3543
- consumerId: stream.webcam,
3652
+ mediaId: stream.webcam,
3544
3653
  element: videoElementRef.current
3545
3654
  });
3546
3655
  else if (!stream.webcam) videoElementRef.current.srcObject = null;
@@ -3571,7 +3680,7 @@ const $a53a1c6f62ad0fcc$var$StreamTile = ({ stream: stream , width: width = 0 ,
3571
3680
  setRequestingDevice(null);
3572
3681
  if (result !== true) {
3573
3682
  let message = "Your request has been declined.";
3574
- if (stream.displayName) message = `${stream.displayName} has declined your request.`;
3683
+ if (stream.profile.name) message = `${stream.profile.name} has declined your request.`;
3575
3684
  (0, $3Sbms$reacthottoast)(message, {
3576
3685
  className: "error"
3577
3686
  });
@@ -3584,7 +3693,7 @@ const $a53a1c6f62ad0fcc$var$StreamTile = ({ stream: stream , width: width = 0 ,
3584
3693
  };
3585
3694
  }, [
3586
3695
  stream.id,
3587
- stream.displayName
3696
+ stream.profile
3588
3697
  ]);
3589
3698
  (0, $3Sbms$useEffect)(()=>{
3590
3699
  const onCustomMessage = async (event)=>{
@@ -3597,8 +3706,7 @@ const $a53a1c6f62ad0fcc$var$StreamTile = ({ stream: stream , width: width = 0 ,
3597
3706
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("customMessage", onCustomMessage);
3598
3707
  };
3599
3708
  }, [
3600
- stream.id,
3601
- stream.displayName
3709
+ stream.id
3602
3710
  ]);
3603
3711
  return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $7ec04c1818c68245$export$798352b46783b18d), {
3604
3712
  onMouseEnter: onMouseEnter,
@@ -3678,24 +3786,25 @@ const $a53a1c6f62ad0fcc$var$StreamTile = ({ stream: stream , width: width = 0 ,
3678
3786
  ]
3679
3787
  }),
3680
3788
  !requestingDevice && !showRequestDevice && !stream.webcam && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$f217faec90120a0c), {
3681
- children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $7ec04c1818c68245$export$6ddfb572d7b6d164), {
3682
- children: [
3683
- stream.displayName && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a2930b41faa750f4), {
3684
- children: stream.displayName.slice(0, 1).toUpperCase()
3685
- }),
3686
- !stream.displayName && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {})
3687
- ]
3789
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$6ddfb572d7b6d164), {
3790
+ children: stream.profile.image ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a7a74ab5cffd1455), {
3791
+ src: stream.profile.image
3792
+ }) : stream.profile.name ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a2930b41faa750f4), {
3793
+ children: stream.profile.name.slice(0, 1).toUpperCase()
3794
+ }) : /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {})
3688
3795
  })
3689
3796
  }),
3690
3797
  !showRequestDevice && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $7ec04c1818c68245$export$a878cdfb933a1421), {
3691
3798
  children: [
3692
3799
  /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$f6525863ef5a71a9), {
3693
- children: stream.displayName ? /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
3694
- children: stream.displayName.slice(0, 1).toUpperCase()
3800
+ children: stream.profile.image ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a7a74ab5cffd1455), {
3801
+ src: stream.profile.image
3802
+ }) : stream.profile.name ? /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
3803
+ children: stream.profile.name.slice(0, 1).toUpperCase()
3695
3804
  }) : /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {})
3696
3805
  }),
3697
3806
  /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$b430fec6b171ceb5), {
3698
- children: stream.displayName || "User"
3807
+ children: stream.profile.name || "User"
3699
3808
  })
3700
3809
  ]
3701
3810
  })
@@ -3768,10 +3877,10 @@ const $21c8ac858b8a352e$var$AudioTile = ({ stream: stream })=>{
3768
3877
  children: [
3769
3878
  /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $76e24981612b551d$export$235e35bd03f702fb), {
3770
3879
  children: [
3771
- stream.displayName && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a2930b41faa750f4), {
3772
- children: stream.displayName.slice(0, 1).toUpperCase()
3880
+ stream.profile.name && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a2930b41faa750f4), {
3881
+ children: stream.profile.name.slice(0, 1).toUpperCase()
3773
3882
  }),
3774
- !stream.displayName && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {}),
3883
+ !stream.profile.name && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {}),
3775
3884
  /*#__PURE__*/ (0, $3Sbms$jsx)((0, $76e24981612b551d$export$95156eef6a2de99c), {
3776
3885
  children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6043ae1b48c5aa97$export$2e2bcd8739ae039), {
3777
3886
  redSlash: !isMicrophoneActive
@@ -3780,7 +3889,7 @@ const $21c8ac858b8a352e$var$AudioTile = ({ stream: stream })=>{
3780
3889
  ]
3781
3890
  }),
3782
3891
  /*#__PURE__*/ (0, $3Sbms$jsx)((0, $76e24981612b551d$export$a87ec69641e9884), {
3783
- children: stream.displayName
3892
+ children: stream.profile.name
3784
3893
  })
3785
3894
  ]
3786
3895
  });
@@ -3818,7 +3927,7 @@ const $57ab7b9a012d9acd$var$Cross = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
3818
3927
  fill: "none",
3819
3928
  xmlns: "http://www.w3.org/2000/svg",
3820
3929
  children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
3821
- d: "M7.21 7.21a.714.714 0 0 1 1.011 0l3.78 3.78 3.778-3.78a.716.716 0 0 1 1.012 1.011l-3.781 3.78 3.78 3.778a.716.716 0 0 1-.779 1.167.716.716 0 0 1-.232-.155L12 13.01l-3.779 3.78a.716.716 0 0 1-1.011-1.01L10.99 12 7.21 8.221a.714.714 0 0 1 0-1.011Z",
3930
+ d: "m13.41 12 6.3-6.29a1.004 1.004 0 0 0-1.42-1.42L12 10.59l-6.29-6.3a1.004 1.004 0 1 0-1.42 1.42l6.3 6.29-6.3 6.29a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l6.29-6.3 6.29 6.3a1.001 1.001 0 0 0 1.639-.325 1 1 0 0 0-.22-1.095L13.41 12Z",
3822
3931
  fill: "#fff"
3823
3932
  })
3824
3933
  });
@@ -3961,7 +4070,7 @@ const $7c705c3f08c6d4ca$var$DeviceRequest = ({ device: device , requesterId: req
3961
4070
  }),
3962
4071
  /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $6efc75079651494a$export$517ec31e58d61d2e), {
3963
4072
  children: [
3964
- requesterStream?.displayName || "Someone",
4073
+ requesterStream?.profile?.name || "Someone",
3965
4074
  " would like you to share your",
3966
4075
  " ",
3967
4076
  $7c705c3f08c6d4ca$var$deviceNames[device]
@@ -4163,7 +4272,7 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
4163
4272
  const videoElementRef = (0, $3Sbms$useRef)(null);
4164
4273
  const videoMediaProviderRef = (0, $3Sbms$useRef)(null);
4165
4274
  const SelfTileRef = (0, $3Sbms$useRef)(null);
4166
- const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , selfDisplayName: selfDisplayName , muted: muted , streaming: streaming , orientation: orientation , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
4275
+ const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
4167
4276
  const { streams: streams } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
4168
4277
  const [containerWidth, containerHeight] = (0, $af23c74942bdcae7$export$2b86bedf890eab8)(videosContainerRef.current);
4169
4278
  const isAlone = streams.length < 1;
@@ -4215,7 +4324,7 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
4215
4324
  const base64Image = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
4216
4325
  setSnapshotImage(base64Image);
4217
4326
  try {
4218
- const { objectUrl: objectUrl } = await fetch(`${"https://apistream.snapcall.io"}/uploadSnapshot`, {
4327
+ const { objectUrl: objectUrl } = await fetch(`${options.streamApiURL}/uploadSnapshot`, {
4219
4328
  method: "POST",
4220
4329
  body: JSON.stringify({
4221
4330
  file: base64Image
@@ -4226,7 +4335,7 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
4226
4335
  imageSrc: objectUrl
4227
4336
  });
4228
4337
  let notificationMessage = "Snapshot sent to users.";
4229
- if (streams.length === 1) notificationMessage = `Snapshot sent to ${streams[0].displayName || "user"}.`;
4338
+ if (streams.length === 1) notificationMessage = `Snapshot sent to ${streams[0].profile.name || "user"}.`;
4230
4339
  (0, $a5146f9062d7bf28$export$3a57e165650c636f)(notificationMessage, {
4231
4340
  icon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6efc75079651494a$export$26fe7ec9351ff761), {
4232
4341
  src: base64Image
@@ -4246,7 +4355,6 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
4246
4355
  if (SelfTileRef.current) (0, $d02c24b66b4606fd$export$ab7d69e250642927)({
4247
4356
  element: SelfTileRef.current
4248
4357
  });
4249
- if (deviceType === "screen") return;
4250
4358
  setDeviceRequest({
4251
4359
  device: deviceType,
4252
4360
  requesterId: peerId
@@ -4344,10 +4452,10 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
4344
4452
  !streaming && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$f217faec90120a0c), {
4345
4453
  children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $7ec04c1818c68245$export$6ddfb572d7b6d164), {
4346
4454
  children: [
4347
- selfDisplayName && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a2930b41faa750f4), {
4348
- children: selfDisplayName.slice(0, 1).toUpperCase()
4455
+ profile.name && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a2930b41faa750f4), {
4456
+ children: profile.name.slice(0, 1).toUpperCase()
4349
4457
  }),
4350
- !selfDisplayName && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {})
4458
+ !profile.name && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {})
4351
4459
  ]
4352
4460
  })
4353
4461
  }),
@@ -4379,12 +4487,14 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
4379
4487
  onClick: onSnapshotClick,
4380
4488
  children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $e1d1366624f88f6d$export$c58e349a67ffa055), {})
4381
4489
  }),
4382
- zoomAvailable && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $6efc75079651494a$export$e07ea3386b3cb3d9), {
4490
+ zoomAvailable && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6efc75079651494a$export$e07ea3386b3cb3d9), {
4383
4491
  onClick: onZoomClick,
4384
- children: [
4385
- zoom ? "2" : "1",
4386
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57ab7b9a012d9acd$export$2e2bcd8739ae039), {})
4387
- ]
4492
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $6efc75079651494a$export$88248b9be937544a), {
4493
+ children: [
4494
+ zoom ? "2" : "1",
4495
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57ab7b9a012d9acd$export$2e2bcd8739ae039), {})
4496
+ ]
4497
+ })
4388
4498
  }),
4389
4499
  /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
4390
4500
  style: {
@@ -4469,12 +4579,12 @@ const $306a53f44040492f$var$ScreenshareTile = (tile)=>{
4469
4579
  const videoElementRef = (0, $3Sbms$useRef)(null);
4470
4580
  const isSelf = tile.peerId === selfPeerId;
4471
4581
  (0, $3Sbms$useEffect)(()=>{
4472
- if (tile.data.consumerId && videoElementRef.current) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).requestVideo({
4473
- consumerId: tile.data.consumerId,
4582
+ if (tile.data.mediaId && videoElementRef.current) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).requestVideo({
4583
+ mediaId: tile.data.mediaId,
4474
4584
  element: videoElementRef.current
4475
4585
  });
4476
4586
  }, [
4477
- tile.data.consumerId
4587
+ tile.data.mediaId
4478
4588
  ]);
4479
4589
  (0, $3Sbms$useEffect)(()=>{
4480
4590
  if (isSelf && videoElementRef.current) {
@@ -4852,12 +4962,20 @@ const $ab48431cd035ee30$export$a06f1c675e846f6f = (0, $3Sbms$styledcomponents).d
4852
4962
  justify-content: center;
4853
4963
  `;
4854
4964
  const $ab48431cd035ee30$export$f9985cea9f8ad92f = (0, $3Sbms$styledcomponents).button`
4965
+ display: flex;
4966
+ justify-content: center;
4967
+ align-items: center;
4855
4968
  width: 36px;
4856
4969
  height: 36px;
4857
4970
  padding: 7px;
4858
4971
  background: rgba(28, 32, 36, 0.5);
4859
4972
  border: none;
4860
4973
  border-radius: 50px;
4974
+
4975
+ svg {
4976
+ width: 17px;
4977
+ height: 17px;
4978
+ }
4861
4979
  `;
4862
4980
  const $ab48431cd035ee30$export$26fe7ec9351ff761 = (0, $3Sbms$styledcomponents).img`
4863
4981
  border: 2px solid #fff;
@@ -4987,8 +5105,8 @@ const $288d5802b3a8deca$var$ScreenshareEvents = ()=>{
4987
5105
  const { dispatch: dispatch , highlightedTile: highlightedTile } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
4988
5106
  (0, $3Sbms$useEffect)(()=>{
4989
5107
  const onRemoteScreensharingUpdate = (event)=>{
4990
- const { peerId: peerId , consumerId: consumerId , deviceType: deviceType } = event.detail;
4991
- const available = event.type === "newConsumer";
5108
+ const { peerId: peerId , mediaId: mediaId , deviceType: deviceType } = event.detail;
5109
+ const available = event.type === "mediaStart";
4992
5110
  if (deviceType === "screen" && available) dispatch({
4993
5111
  type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).SET_HIGHLIGHTED_TILE,
4994
5112
  payload: {
@@ -4996,7 +5114,7 @@ const $288d5802b3a8deca$var$ScreenshareEvents = ()=>{
4996
5114
  peerId: peerId,
4997
5115
  isGlobal: true,
4998
5116
  data: {
4999
- consumerId: consumerId
5117
+ mediaId: mediaId
5000
5118
  }
5001
5119
  }
5002
5120
  });
@@ -5021,13 +5139,13 @@ const $288d5802b3a8deca$var$ScreenshareEvents = ()=>{
5021
5139
  type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).UNSET_HIGHLIGHTED_TILE
5022
5140
  });
5023
5141
  };
5024
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("newConsumer", onRemoteScreensharingUpdate);
5025
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("consumerClose", onRemoteScreensharingUpdate);
5142
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("mediaStart", onRemoteScreensharingUpdate);
5143
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("mediaStop", onRemoteScreensharingUpdate);
5026
5144
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("screenshareEnabled", onScreensharingUpdate);
5027
5145
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("screenshareDisabled", onScreensharingUpdate);
5028
5146
  return ()=>{
5029
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("newConsumer", onRemoteScreensharingUpdate);
5030
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("consumerClose", onRemoteScreensharingUpdate);
5147
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("mediaStart", onRemoteScreensharingUpdate);
5148
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("mediaStop", onRemoteScreensharingUpdate);
5031
5149
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("screenshareEnabled", onScreensharingUpdate);
5032
5150
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("screenshareDisabled", onScreensharingUpdate);
5033
5151
  };
@@ -5099,15 +5217,15 @@ const $75c30c42d3b87293$var$SnapshotEvents = ()=>{
5099
5217
  if (type === "snapshot") {
5100
5218
  const sender = streams.find((stream)=>stream.id === peerId);
5101
5219
  if (sender) {
5102
- const statusIcon = sender.displayName ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $ab48431cd035ee30$export$49ac927a2aaad85), {
5103
- children: sender.displayName.slice(0, 1).toUpperCase()
5220
+ const statusIcon = sender.profile.name ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $ab48431cd035ee30$export$49ac927a2aaad85), {
5221
+ children: sender.profile.name.slice(0, 1).toUpperCase()
5104
5222
  }) : /*#__PURE__*/ (0, $3Sbms$jsx)((0, $ab48431cd035ee30$export$49ac927a2aaad85), {
5105
5223
  children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {})
5106
5224
  });
5107
5225
  const createdAtDate = new Date();
5108
5226
  const notificationStatus = {
5109
5227
  text: "From",
5110
- boldText: sender.displayName || "User",
5228
+ boldText: sender.profile.name || "User",
5111
5229
  icon: statusIcon
5112
5230
  };
5113
5231
  (0, $a5146f9062d7bf28$export$3a57e165650c636f)("Snapshot shared.", {
@@ -5153,8 +5271,8 @@ const $75c30c42d3b87293$var$SnapshotEvents = ()=>{
5153
5271
  border: "2px solid #fff"
5154
5272
  },
5155
5273
  statusText: notificationStatus.boldText,
5156
- statusIconLetter: sender.displayName ? sender.displayName.slice(0, 1).toUpperCase() : undefined,
5157
- statusIconUser: sender.displayName ? false : true
5274
+ statusIconLetter: sender.profile.name ? sender.profile.name.slice(0, 1).toUpperCase() : undefined,
5275
+ statusIconUser: sender.profile.name ? false : true
5158
5276
  });
5159
5277
  }
5160
5278
  }
@@ -5345,7 +5463,7 @@ var $b8963bf62cf5b984$export$2e2bcd8739ae039 = $b8963bf62cf5b984$var$tooltip;
5345
5463
 
5346
5464
 
5347
5465
  const $cdab47bb8796991e$var$Video = ()=>{
5348
- const { selfPeerId: selfPeerId , videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , options: options , muted: selfMuted , selfDisplayName: selfDisplayName , orientation: orientation , userInteractionTriggered: userInteractionTriggered , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
5466
+ const { selfPeerId: selfPeerId , videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , options: options , muted: selfMuted , profile: profile1 , orientation: orientation , userInteractionTriggered: userInteractionTriggered , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
5349
5467
  const [tileSize, setTileSize] = (0, $3Sbms$useState)({
5350
5468
  width: 0,
5351
5469
  height: 0
@@ -5395,32 +5513,32 @@ const $cdab47bb8796991e$var$Video = ()=>{
5395
5513
  ]);
5396
5514
  (0, $3Sbms$useEffect)(()=>{
5397
5515
  const onNewPeer = (event)=>{
5398
- const { peerId: peerId , displayName: displayName } = event.detail;
5516
+ const { peerId: peerId , profile: profile } = event.detail;
5399
5517
  dispatch({
5400
5518
  type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).ADD_STREAM,
5401
5519
  payload: {
5402
5520
  id: peerId,
5403
- displayName: displayName
5521
+ profile: profile
5404
5522
  }
5405
5523
  });
5406
5524
  };
5407
- const onConsumerUpdate = (event)=>{
5408
- const { peerId: peerId , consumerId: consumerId , deviceType: deviceType , paused: paused } = event.detail;
5409
- const available = event.type === "newConsumer";
5525
+ const onMediaEvent = (event)=>{
5526
+ const { peerId: peerId , mediaId: mediaId , deviceType: deviceType , paused: paused } = event.detail;
5527
+ const available = event.type === "mediaStart";
5410
5528
  if (deviceType !== "screen") dispatch({
5411
5529
  type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).DEVICE_UPDATE,
5412
5530
  payload: {
5413
5531
  streamId: peerId,
5414
- consumerId: consumerId,
5532
+ mediaId: mediaId,
5415
5533
  device: deviceType,
5416
5534
  available: available,
5417
5535
  paused: paused
5418
5536
  }
5419
5537
  });
5420
5538
  };
5421
- const onProducerUpdate = (event)=>{
5539
+ const onMediaStateChange = (event)=>{
5422
5540
  const { peerId: peerId , deviceType: deviceType } = event.detail;
5423
- const isPaused = event.type === "producerPaused";
5541
+ const isPaused = event.type === "mediaPause";
5424
5542
  if (deviceType === "microphone" && isPaused) dispatch({
5425
5543
  type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).MUTE,
5426
5544
  payload: {
@@ -5438,7 +5556,7 @@ const $cdab47bb8796991e$var$Video = ()=>{
5438
5556
  const { peers: peers } = event.detail;
5439
5557
  const roomStreams = peers.map((peer)=>({
5440
5558
  id: peer.peerId,
5441
- displayName: peer.displayName
5559
+ profile: peer.profile
5442
5560
  }));
5443
5561
  dispatch({
5444
5562
  type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).SET_STREAMS,
@@ -5454,13 +5572,13 @@ const $cdab47bb8796991e$var$Video = ()=>{
5454
5572
  }
5455
5573
  });
5456
5574
  };
5457
- const onDisplayName = (event)=>{
5458
- const { peerId: peerId , displayName: displayName } = event.detail;
5575
+ const onProfileUpdate = (event)=>{
5576
+ const { peerId: peerId , profile: profile } = event.detail;
5459
5577
  dispatch({
5460
- type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).SET_STREAM_DISPLAY_NAME,
5578
+ type: (0, $2884da8a64948e35$export$96a9662a3eda31f6).SET_STREAM_PROFILE,
5461
5579
  payload: {
5462
5580
  streamId: peerId,
5463
- displayName: displayName
5581
+ profile: profile
5464
5582
  }
5465
5583
  });
5466
5584
  };
@@ -5478,22 +5596,22 @@ const $cdab47bb8796991e$var$Video = ()=>{
5478
5596
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("enterRoom", onEnterRoom);
5479
5597
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("newPeer", onNewPeer);
5480
5598
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("peerClosed", onPeerClosed);
5481
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("newConsumer", onConsumerUpdate);
5482
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("consumerClose", onConsumerUpdate);
5483
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("producerPaused", onProducerUpdate);
5484
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("producerResumed", onProducerUpdate);
5485
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("displayName", onDisplayName);
5599
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("mediaStart", onMediaEvent);
5600
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("mediaStop", onMediaEvent);
5601
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("mediaPause", onMediaStateChange);
5602
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("mediaResume", onMediaStateChange);
5603
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("profileUpdate", onProfileUpdate);
5486
5604
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("peerStartSpeak", onPeerSpeakingUpdate);
5487
5605
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("peerStopSpeak", onPeerSpeakingUpdate);
5488
5606
  return ()=>{
5489
5607
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("enterRoom", onEnterRoom);
5490
5608
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("newPeer", onNewPeer);
5491
5609
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("peerClosed", onPeerClosed);
5492
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("newConsumer", onConsumerUpdate);
5493
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("consumerClose", onConsumerUpdate);
5494
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("producerPaused", onProducerUpdate);
5495
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("producerResumed", onProducerUpdate);
5496
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("displayName", onDisplayName);
5610
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("mediaStart", onMediaEvent);
5611
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("mediaStop", onMediaEvent);
5612
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("mediaPause", onMediaStateChange);
5613
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("mediaResume", onMediaStateChange);
5614
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("profileUpdate", onProfileUpdate);
5497
5615
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("peerStartSpeak", onPeerSpeakingUpdate);
5498
5616
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("peerStopSpeak", onPeerSpeakingUpdate);
5499
5617
  };
@@ -5523,7 +5641,7 @@ const $cdab47bb8796991e$var$Video = ()=>{
5523
5641
  stream: {
5524
5642
  id: String(selfPeerId),
5525
5643
  muted: selfMuted,
5526
- displayName: selfDisplayName
5644
+ profile: profile1
5527
5645
  }
5528
5646
  }),
5529
5647
  streams.map((stream)=>{
@@ -6068,7 +6186,7 @@ const $8d3d0e80c56cde5c$export$51760c3b0f5567d2 = (0, $3Sbms$styledcomponents).p
6068
6186
  const $5b80b81d7b095f89$var$QuickConnect = ()=>{
6069
6187
  const QuickConnectContainerRef = (0, $3Sbms$useRef)(null);
6070
6188
  const QuickConnectRef = (0, $3Sbms$useRef)(null);
6071
- const { selfPeerId: selfPeerId , selfDisplayName: selfDisplayName , isQuickConnectPopupVisible: isQuickConnectPopupVisible , setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , options: options , orientation: orientation , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
6189
+ const { selfPeerId: selfPeerId , profile: profile , isQuickConnectPopupVisible: isQuickConnectPopupVisible , setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , options: options , orientation: orientation , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
6072
6190
  (0, $e1413aacdaa5a03e$export$71b2224f1ce5e08e)(QuickConnectContainerRef, ()=>{
6073
6191
  if (isQuickConnectPopupVisible) setIsQuickConnectPopupVisible(false);
6074
6192
  });
@@ -6084,13 +6202,13 @@ const $5b80b81d7b095f89$var$QuickConnect = ()=>{
6084
6202
  url.searchParams.set("microphone-enabled", "0");
6085
6203
  url.searchParams.set("camera-enabled", "1");
6086
6204
  url.searchParams.set("quick-connect", selfPeerId);
6087
- if (selfDisplayName) url.searchParams.set("name", selfDisplayName);
6205
+ if (profile.name) url.searchParams.set("name", profile.name);
6088
6206
  }
6089
6207
  return url.href;
6090
6208
  }, [
6091
6209
  options.sharedURL,
6092
6210
  selfPeerId,
6093
- selfDisplayName
6211
+ profile.name
6094
6212
  ]);
6095
6213
  const onQuickConnectPopupCloseClick = ()=>setIsQuickConnectPopupVisible(false);
6096
6214
  (0, $3Sbms$useEffect)(()=>{
@@ -6119,8 +6237,12 @@ const $5b80b81d7b095f89$var$QuickConnect = ()=>{
6119
6237
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).sendCustomMessage(quickConnectParam, {
6120
6238
  type: "quick_connect_close"
6121
6239
  });
6122
- if (quickConnectNameParam) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setDisplayName(`${quickConnectNameParam} (mobile)`);
6123
- else (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setDisplayName("Mobile");
6240
+ if (quickConnectNameParam) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setProfile({
6241
+ name: `${quickConnectNameParam} (mobile)`
6242
+ });
6243
+ else (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setProfile({
6244
+ name: "Mobile"
6245
+ });
6124
6246
  }
6125
6247
  }
6126
6248
  }, [
@@ -6333,8 +6455,10 @@ const $658749b7ab14b607$export$db1aade9877208c7 = (0, $3Sbms$styledcomponents).b
6333
6455
  border-radius: 10px;
6334
6456
  justify-content: space-between;
6335
6457
  align-items: center;
6336
- padding: 16px 18px;
6458
+ padding: 15px;
6337
6459
  font-size: 14px;
6460
+ font-weight: 600;
6461
+ line-height: 20px;
6338
6462
  color: ${(props)=>props.theme.settingsTextColor};
6339
6463
 
6340
6464
  span {
@@ -6479,39 +6603,48 @@ var $1694791461215de9$export$2e2bcd8739ae039 = $1694791461215de9$var$LanguageSub
6479
6603
 
6480
6604
 
6481
6605
 
6606
+
6607
+
6482
6608
  const $b7a5d5760b390f40$var$AudioSubMenu = ({ back: back })=>{
6483
- const [micDevices, setMicDevices] = (0, $3Sbms$useState)([]);
6484
- const [currentMic, setCurrentMic] = (0, $3Sbms$useState)(null);
6485
- const [speakerDevices, setSpeakerDevices] = (0, $3Sbms$useState)([]);
6486
- const [currentSpeaker, setCurrentSpeaker] = (0, $3Sbms$useState)(null);
6487
- const canChangeSpeakers = speakerDevices.length > 0 && "setSinkId" in HTMLAudioElement.prototype;
6488
- const listDevices = ()=>(0, $c9e496369b59be7a$export$2f377c2162fd02b2).listAudioDevices().then((devices)=>{
6489
- const speakers = devices.filter((device)=>device.kind === "audiooutput" && device.label);
6490
- const mics = devices.filter((device)=>device.kind === "audioinput" && device.label);
6491
- setMicDevices(mics);
6492
- setSpeakerDevices(speakers);
6493
- // For chrome
6494
- const speaker = speakers.find((device)=>device.deviceId === "default");
6495
- const mic = mics.find((device)=>device.deviceId === "default");
6496
- setCurrentMic(mic || null);
6497
- setCurrentSpeaker(speaker || null);
6498
- });
6499
- const onMicClick = (0, $3Sbms$useCallback)(async (mic)=>{
6609
+ const [audioDevices, setAudioDevices] = (0, $3Sbms$useState)([]);
6610
+ const [currentMic, setCurrentMic] = (0, $3Sbms$useState)();
6611
+ const [currentSpeaker, setCurrentSpeaker] = (0, $3Sbms$useState)();
6612
+ const microphoneDevices = audioDevices.filter((device)=>device.kind === "audioinput");
6613
+ const speakerDevices = audioDevices.filter((device)=>device.kind === "audiooutput");
6614
+ const isMicrophoneAccessBlocked = microphoneDevices.length && audioDevices.every((device)=>device.deviceId === "");
6615
+ const canChangeSpeakers = "setSinkId" in HTMLAudioElement.prototype;
6616
+ const listDevices = async ()=>{
6617
+ const audioDevicesList = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).listAudioDevices();
6618
+ setAudioDevices(audioDevicesList);
6619
+ const speaker = audioDevicesList.find((device)=>device.kind === "audiooutput" && device.deviceId === "default");
6620
+ const mic = audioDevicesList.find((device)=>device.kind === "audioinput" && device.deviceId === "default");
6621
+ setCurrentMic(mic);
6622
+ setCurrentSpeaker(speaker);
6623
+ };
6624
+ const onMicClick = async (mic)=>{
6500
6625
  if (currentMic?.deviceId === mic.deviceId) return;
6501
6626
  await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).switchMicrophone(mic.deviceId);
6502
6627
  setCurrentMic(mic);
6503
- (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${mic.label}`);
6504
- }, [
6505
- currentMic
6506
- ]);
6507
- const onSpeakerClick = (0, $3Sbms$useCallback)((speaker)=>{
6628
+ (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${mic.label}`, {
6629
+ duration: 3000,
6630
+ icon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6043ae1b48c5aa97$export$2e2bcd8739ae039), {}),
6631
+ messageStyle: {
6632
+ fontWeight: 600
6633
+ }
6634
+ });
6635
+ };
6636
+ const onSpeakerClick = (speaker)=>{
6508
6637
  if (currentSpeaker?.deviceId === speaker.deviceId) return;
6509
6638
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setAudioSink(speaker.deviceId);
6510
6639
  setCurrentSpeaker(speaker);
6511
- (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${speaker.label}`);
6512
- }, [
6513
- currentSpeaker
6514
- ]);
6640
+ (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${speaker.label}`, {
6641
+ duration: 3000,
6642
+ icon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $c45f2504881e174b$export$2e2bcd8739ae039), {}),
6643
+ messageStyle: {
6644
+ fontWeight: 600
6645
+ }
6646
+ });
6647
+ };
6515
6648
  (0, $3Sbms$useEffect)(()=>{
6516
6649
  listDevices();
6517
6650
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("devicesListChange", listDevices);
@@ -6532,61 +6665,64 @@ const $b7a5d5760b390f40$var$AudioSubMenu = ({ back: back })=>{
6532
6665
  })
6533
6666
  ]
6534
6667
  }),
6535
- /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$b286f91cddfedb5a), {
6536
- children: [
6537
- /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6538
- children: [
6539
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6540
- children: "Microphone"
6541
- }),
6542
- canChangeSpeakers && micDevices.map((mic)=>{
6543
- const checked = mic.deviceId === currentMic?.deviceId;
6544
- return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6545
- onClick: ()=>onMicClick(mic),
6546
- children: [
6547
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6548
- children: mic.label
6549
- }),
6550
- /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6551
- children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6552
- })
6553
- ]
6554
- }, mic.deviceId);
6555
- }),
6556
- !canChangeSpeakers && micDevices.length < 1 && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$87d6be27a51dc3c4), {
6557
- children: [
6558
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$30ccd51431e4a7b0), {
6559
- children: "Microphone is blocked."
6560
- }),
6561
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$73afb47ae3e10bf1), {
6562
- children: "Please accept microphone sharing before accessing these options."
6563
- })
6564
- ]
6565
- })
6566
- ]
6567
- }),
6568
- canChangeSpeakers && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6668
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$b286f91cddfedb5a), {
6669
+ children: isMicrophoneAccessBlocked ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6670
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$87d6be27a51dc3c4), {
6569
6671
  children: [
6570
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6571
- children: "Speakers"
6672
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$30ccd51431e4a7b0), {
6673
+ children: "Microphone is blocked."
6572
6674
  }),
6573
- speakerDevices.map((speaker)=>{
6574
- const checked = speaker.deviceId === currentSpeaker?.deviceId;
6575
- return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6576
- onClick: ()=>onSpeakerClick(speaker),
6577
- children: [
6578
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6579
- children: speaker.label
6580
- }),
6581
- /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6582
- children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6583
- })
6584
- ]
6585
- }, speaker.deviceId);
6675
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$73afb47ae3e10bf1), {
6676
+ children: "Please accept microphone sharing before accessing these options."
6586
6677
  })
6587
6678
  ]
6588
6679
  })
6589
- ]
6680
+ }) : /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
6681
+ children: [
6682
+ /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6683
+ children: [
6684
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6685
+ children: "Microphone"
6686
+ }),
6687
+ microphoneDevices.map((microphone)=>{
6688
+ const checked = microphone.deviceId === currentMic?.deviceId;
6689
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6690
+ onClick: ()=>onMicClick(microphone),
6691
+ children: [
6692
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6693
+ children: microphone.label
6694
+ }),
6695
+ /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6696
+ children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6697
+ })
6698
+ ]
6699
+ }, microphone.deviceId);
6700
+ })
6701
+ ]
6702
+ }),
6703
+ canChangeSpeakers && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6704
+ children: [
6705
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6706
+ children: "Speakers"
6707
+ }),
6708
+ speakerDevices.map((speaker)=>{
6709
+ const checked = speaker.deviceId === currentSpeaker?.deviceId;
6710
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6711
+ onClick: ()=>onSpeakerClick(speaker),
6712
+ children: [
6713
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6714
+ children: speaker.label
6715
+ }),
6716
+ /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6717
+ children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6718
+ })
6719
+ ]
6720
+ }, speaker.deviceId);
6721
+ })
6722
+ ]
6723
+ })
6724
+ ]
6725
+ })
6590
6726
  })
6591
6727
  ]
6592
6728
  });
@@ -6602,6 +6738,7 @@ var $b7a5d5760b390f40$export$2e2bcd8739ae039 = $b7a5d5760b390f40$var$AudioSubMen
6602
6738
 
6603
6739
 
6604
6740
 
6741
+
6605
6742
  const $57896f163f7e1230$var$resolutions = Object.keys((0, $c31e3fb4360572af$export$d21ffcc5eb136bfa)).map((key)=>{
6606
6743
  const constraints = (0, $c31e3fb4360572af$export$d21ffcc5eb136bfa);
6607
6744
  switch(constraints[key].height.ideal){
@@ -6617,7 +6754,7 @@ const $57896f163f7e1230$var$resolutions = Object.keys((0, $c31e3fb4360572af$expo
6617
6754
  };
6618
6755
  case 720:
6619
6756
  return {
6620
- name: "Hight definition (720p)",
6757
+ name: "High definition (720p)",
6621
6758
  key: key
6622
6759
  };
6623
6760
  default:
@@ -6628,36 +6765,34 @@ const $57896f163f7e1230$var$resolutions = Object.keys((0, $c31e3fb4360572af$expo
6628
6765
  }
6629
6766
  }).filter((def)=>def.name !== "");
6630
6767
  const $57896f163f7e1230$var$VideoSubMenu = ({ back: back })=>{
6631
- const [cameraDevices, setCameraDevices] = (0, $3Sbms$useState)(Array.from((0, $c9e496369b59be7a$export$2f377c2162fd02b2).getWebcamsList().values()).filter((device)=>device.deviceId));
6768
+ const [cameraDevices, setCameraDevices] = (0, $3Sbms$useState)([]);
6632
6769
  const [currentCamera, setCurrentCamera] = (0, $3Sbms$useState)((0, $c9e496369b59be7a$export$2f377c2162fd02b2).getCurrentWebcam());
6770
+ const isCameraAccessBlocked = cameraDevices.length && cameraDevices.every((device)=>device.deviceId === "");
6633
6771
  const listDevices = async ()=>{
6634
- const devices = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).listVideoDevices();
6635
- const authorisedCameras = devices.filter((device)=>device.deviceId);
6636
- if (authorisedCameras.length > 0) setCameraDevices(authorisedCameras);
6772
+ const videoDevices = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).listVideoDevices();
6773
+ setCameraDevices(videoDevices);
6637
6774
  };
6638
6775
  const onCameraClick = async (camera)=>{
6639
6776
  if (currentCamera.device?.deviceId === camera.deviceId) return;
6640
- if (currentCamera.device) {
6641
- await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).switchWebcam({
6642
- device: camera
6643
- });
6644
- (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${camera.label}`, {
6645
- duration: 3000
6646
- });
6647
- } else {
6648
- await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableVideo({
6649
- device: camera,
6650
- resolution: currentCamera.resolution
6651
- });
6652
- (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${camera.label}`, {
6653
- duration: 3000
6654
- });
6655
- }
6777
+ if (currentCamera.device) await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).switchWebcam({
6778
+ device: camera
6779
+ });
6780
+ else await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableVideo({
6781
+ device: camera,
6782
+ resolution: currentCamera.resolution
6783
+ });
6784
+ (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${camera.label}`, {
6785
+ duration: 3000,
6786
+ icon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $04e57b1f07a8e9f4$export$2e2bcd8739ae039), {}),
6787
+ messageStyle: {
6788
+ fontWeight: 600
6789
+ }
6790
+ });
6656
6791
  };
6657
6792
  const onSendResolutionClick = async (resolution)=>{
6658
6793
  if (currentCamera.resolution === resolution.key) return;
6659
6794
  await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setWebcamResolution(resolution.key);
6660
- (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Using ${resolution.name} resolution`, {
6795
+ (0, $a5146f9062d7bf28$export$3a57e165650c636f)(resolution.name, {
6661
6796
  duration: 3000
6662
6797
  });
6663
6798
  };
@@ -6692,61 +6827,64 @@ const $57896f163f7e1230$var$VideoSubMenu = ({ back: back })=>{
6692
6827
  })
6693
6828
  ]
6694
6829
  }),
6695
- /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$b286f91cddfedb5a), {
6696
- children: [
6697
- /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6698
- children: [
6699
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6700
- children: "Camera"
6701
- }),
6702
- cameraDevices.map((camera)=>{
6703
- const checked = camera.deviceId === currentCamera.device?.deviceId;
6704
- return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6705
- onClick: ()=>onCameraClick(camera),
6706
- children: [
6707
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6708
- children: camera.label
6709
- }),
6710
- /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6711
- children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6712
- })
6713
- ]
6714
- }, camera.deviceId);
6715
- }),
6716
- cameraDevices.length < 1 && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$87d6be27a51dc3c4), {
6717
- children: [
6718
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$30ccd51431e4a7b0), {
6719
- children: "Camera is blocked."
6720
- }),
6721
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$73afb47ae3e10bf1), {
6722
- children: "Please accept camera sharing before accessing these options."
6723
- })
6724
- ]
6725
- })
6726
- ]
6727
- }),
6728
- /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6830
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$b286f91cddfedb5a), {
6831
+ children: isCameraAccessBlocked ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6832
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$87d6be27a51dc3c4), {
6729
6833
  children: [
6730
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6731
- children: "Send Resolution (maximum)"
6834
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$30ccd51431e4a7b0), {
6835
+ children: "Camera is blocked."
6732
6836
  }),
6733
- $57896f163f7e1230$var$resolutions.map((resolution)=>{
6734
- const checked = resolution.key === currentCamera.resolution;
6735
- return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6736
- onClick: ()=>onSendResolutionClick(resolution),
6737
- children: [
6738
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6739
- children: resolution.name
6740
- }),
6741
- /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6742
- children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6743
- })
6744
- ]
6745
- }, resolution.key);
6837
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$73afb47ae3e10bf1), {
6838
+ children: "Please accept camera sharing before accessing these options."
6746
6839
  })
6747
6840
  ]
6748
6841
  })
6749
- ]
6842
+ }) : /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
6843
+ children: [
6844
+ /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6845
+ children: [
6846
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6847
+ children: "Camera"
6848
+ }),
6849
+ cameraDevices.map((camera)=>{
6850
+ const checked = camera.deviceId === currentCamera.device?.deviceId;
6851
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6852
+ onClick: ()=>onCameraClick(camera),
6853
+ children: [
6854
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6855
+ children: camera.label
6856
+ }),
6857
+ /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6858
+ children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6859
+ })
6860
+ ]
6861
+ }, camera.deviceId);
6862
+ })
6863
+ ]
6864
+ }),
6865
+ /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$38050e761cbb2b1d), {
6866
+ children: [
6867
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$5caf84ac7a22e7b5), {
6868
+ children: "Send Resolution (maximum)"
6869
+ }),
6870
+ $57896f163f7e1230$var$resolutions.map((resolution)=>{
6871
+ const checked = resolution.key === currentCamera.resolution;
6872
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $658749b7ab14b607$export$db1aade9877208c7), {
6873
+ onClick: ()=>onSendResolutionClick(resolution),
6874
+ children: [
6875
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $658749b7ab14b607$export$f132d77f01dce0a3), {
6876
+ children: resolution.name
6877
+ }),
6878
+ /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
6879
+ children: checked && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {})
6880
+ })
6881
+ ]
6882
+ }, resolution.key);
6883
+ })
6884
+ ]
6885
+ })
6886
+ ]
6887
+ })
6750
6888
  })
6751
6889
  ]
6752
6890
  });
@@ -6961,7 +7099,8 @@ const $d677836e2f373a45$export$11781939bbc73f8b = (0, $3Sbms$styledcomponents).d
6961
7099
  }
6962
7100
 
6963
7101
  svg {
6964
- height: 13px;
7102
+ width: 20px;
7103
+ height: 21px;
6965
7104
  }
6966
7105
  `;
6967
7106
  const $d677836e2f373a45$export$7ae684a6a708b51d = (0, $3Sbms$styledcomponents).button`
@@ -6976,8 +7115,8 @@ const $d677836e2f373a45$export$7ae684a6a708b51d = (0, $3Sbms$styledcomponents).b
6976
7115
  padding: 0;
6977
7116
 
6978
7117
  svg {
6979
- height: 10px;
6980
- width: 10px;
7118
+ height: 15px;
7119
+ width: 15px;
6981
7120
 
6982
7121
  path {
6983
7122
  fill: #000;
@@ -7248,7 +7387,8 @@ const $554f3984e3212196$export$7563f0d47f114601 = (0, $3Sbms$styledcomponents).d
7248
7387
  }
7249
7388
 
7250
7389
  svg {
7251
- height: 13px;
7390
+ width: 20px;
7391
+ height: 20px;
7252
7392
  }
7253
7393
  `;
7254
7394
  const $554f3984e3212196$export$fcade06574a60ff0 = (0, $3Sbms$styledcomponents).button`
@@ -7263,8 +7403,8 @@ const $554f3984e3212196$export$fcade06574a60ff0 = (0, $3Sbms$styledcomponents).b
7263
7403
  padding: 0;
7264
7404
 
7265
7405
  svg {
7266
- height: 10px;
7267
- width: 10px;
7406
+ width: 15px;
7407
+ height: 15px;
7268
7408
 
7269
7409
  path {
7270
7410
  fill: #000;
@@ -7406,7 +7546,7 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
7406
7546
  if (type === $98933bbc579a3e66$export$a1eac7fdbc2db4af) $98933bbc579a3e66$var$sendLinkNotification(data);
7407
7547
  else if (type === "paypal_invoice") {
7408
7548
  const sender = streams.find((stream)=>stream.id === event.detail.peerId);
7409
- $98933bbc579a3e66$var$sendPaypalInvoiceNotification(sender?.displayName, data.url);
7549
+ $98933bbc579a3e66$var$sendPaypalInvoiceNotification(sender?.profile?.name, data.url);
7410
7550
  }
7411
7551
  }, [
7412
7552
  streams
@@ -7439,7 +7579,7 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
7439
7579
  data: data
7440
7580
  });
7441
7581
  }
7442
- if (streams.length < 2) (0, $3Sbms$reacthottoast)(`Link sent to ${streams[0]?.displayName || "User"}`);
7582
+ if (streams.length < 2) (0, $3Sbms$reacthottoast)(`Link sent to ${streams[0]?.profile?.name || "User"}`);
7443
7583
  else (0, $3Sbms$reacthottoast)("Link sent to users");
7444
7584
  setIsLinksharePopupVisible(false);
7445
7585
  } catch (err) {
@@ -7996,6 +8136,80 @@ var $d6008ea114507578$export$2e2bcd8739ae039 = $d6008ea114507578$var$SvgDefiniti
7996
8136
 
7997
8137
 
7998
8138
 
8139
+
8140
+
8141
+ const $fdbe2be8571dfcd7$export$8bac64dfa46a096a = (0, $3Sbms$styledcomponents).div`
8142
+ display: flex;
8143
+ justify-content: center;
8144
+ align-items: center;
8145
+ position: absolute;
8146
+ width: 100%;
8147
+ height: 100%;
8148
+ background-color: rgba(0, 0, 0, 0.75);
8149
+ z-index: 999;
8150
+ `;
8151
+ const $fdbe2be8571dfcd7$export$f2f6e48f0181f95d = (0, $3Sbms$styledcomponents).div`
8152
+ display: flex;
8153
+ flex-direction: column;
8154
+ align-items: flex-start;
8155
+ background-color: #fff;
8156
+ padding: 20px;
8157
+ max-width: 300px;
8158
+ border-radius: 10px;
8159
+ box-sizing: border-box;
8160
+ `;
8161
+ const $fdbe2be8571dfcd7$export$b834616c6081368f = (0, $3Sbms$styledcomponents).h2`
8162
+ font-size: 16px;
8163
+ font-weight: 700;
8164
+ color: #242324;
8165
+ margin: 0 0 10px 0;
8166
+ `;
8167
+ const $fdbe2be8571dfcd7$export$12ed2ca69ff6905b = (0, $3Sbms$styledcomponents).p`
8168
+ font-size: 12px;
8169
+ font-weight: 500;
8170
+ color: #2d2d2d;
8171
+ margin: 0 0 15px 0;
8172
+ `;
8173
+ const $fdbe2be8571dfcd7$export$d39b0d24481757e7 = (0, $3Sbms$styledcomponents).button`
8174
+ align-self: flex-end;
8175
+ color: #242324;
8176
+ background-color: transparent;
8177
+ border: 2px solid #242324;
8178
+ border-radius: 50px;
8179
+ padding: 8px 18px;
8180
+ box-sizing: border-box;
8181
+ font-size: 14px;
8182
+ font-weight: 700;
8183
+ line-height: 16px;
8184
+
8185
+ &:hover {
8186
+ color: #fff;
8187
+ background-color: #242324;
8188
+ }
8189
+ `;
8190
+
8191
+
8192
+ const $6aca0f707e80bf63$var$BlockedDevicesPopup = ({ close: close })=>{
8193
+ return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $fdbe2be8571dfcd7$export$8bac64dfa46a096a), {
8194
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $fdbe2be8571dfcd7$export$f2f6e48f0181f95d), {
8195
+ children: [
8196
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $fdbe2be8571dfcd7$export$b834616c6081368f), {
8197
+ children: "Camera and microphone are blocked"
8198
+ }),
8199
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $fdbe2be8571dfcd7$export$12ed2ca69ff6905b), {
8200
+ children: "SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser's address bar."
8201
+ }),
8202
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $fdbe2be8571dfcd7$export$d39b0d24481757e7), {
8203
+ onClick: close,
8204
+ children: "Dismiss"
8205
+ })
8206
+ ]
8207
+ })
8208
+ });
8209
+ };
8210
+ var $6aca0f707e80bf63$export$2e2bcd8739ae039 = $6aca0f707e80bf63$var$BlockedDevicesPopup;
8211
+
8212
+
7999
8213
  // https://github.com/video-dev/can-autoplay
8000
8214
  const $15a01b611391c1e7$var$audioSource = new Blob([
8001
8215
  new Uint8Array([
@@ -8307,6 +8521,7 @@ const $4fb4815baa04b470$export$914ddf2021ea8ee6 = (0, $3Sbms$styledcomponents).d
8307
8521
 
8308
8522
 
8309
8523
 
8524
+
8310
8525
  const $26ed036cbc17809a$var$currentTheme = (0, $52580db2e49cdd90$export$3bfd0d5209a8006a)();
8311
8526
  const $26ed036cbc17809a$var$currentLanguage = (0, $1694791461215de9$export$604ba5624273df44)();
8312
8527
  let $26ed036cbc17809a$var$timestampCriticalError = -1;
@@ -8322,13 +8537,14 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
8322
8537
  const [isLinksharePopupVisible, setIsLinksharePopupVisible] = (0, $3Sbms$useState)(false);
8323
8538
  const [theme, setTheme] = (0, $3Sbms$useState)($26ed036cbc17809a$var$currentTheme);
8324
8539
  const [language, setLanguage] = (0, $3Sbms$useState)($26ed036cbc17809a$var$currentLanguage);
8325
- const [selfDisplayName, setSelfDisplayName] = (0, $3Sbms$useState)("");
8540
+ const [profile1, setProfile] = (0, $3Sbms$useState)({});
8326
8541
  const [muted, setMuted] = (0, $3Sbms$useState)(true);
8327
8542
  const [streaming, setStreaming] = (0, $3Sbms$useState)(false);
8328
8543
  const [screensharing, setScreensharing] = (0, $3Sbms$useState)(false);
8329
8544
  const [isAgent, setIsAgent] = (0, $3Sbms$useState)(false);
8330
8545
  const [userInteractionTriggered, setUserInteractionTriggered] = (0, $3Sbms$useState)(false);
8331
8546
  const [containerWidth, containerHeight] = (0, $af23c74942bdcae7$export$2b86bedf890eab8)(streamUIContainerRef.current);
8547
+ const [isBlockedDevicesPopupOpen, setBlockedDevicesPopupOpen] = (0, $3Sbms$useState)(false);
8332
8548
  const orientation = containerWidth > containerHeight ? "landscape" : "portrait";
8333
8549
  const styledTheme = theme === "dark" ? (0, $52580db2e49cdd90$export$3e936a8db52a10a0) : (0, $52580db2e49cdd90$export$f30cb9bc4f736419);
8334
8550
  const onEnterRoom = async (event)=>{
@@ -8338,6 +8554,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
8338
8554
  await (0, $15a01b611391c1e7$export$494039379563c94d)();
8339
8555
  setUserInteractionTriggered(true);
8340
8556
  } catch (userInteractionError) {
8557
+ setBlockedDevicesPopupOpen(true);
8341
8558
  console.error("User interaction trigger failed", userInteractionError);
8342
8559
  }
8343
8560
  };
@@ -8355,11 +8572,17 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
8355
8572
  };
8356
8573
  const onDefaultAudioDeviceChange = (event)=>{
8357
8574
  const micro = event.detail.label;
8358
- (0, $3Sbms$reacthottoast)(`Connected to: ${micro}`);
8575
+ (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${micro}`, {
8576
+ duration: 3000,
8577
+ icon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6043ae1b48c5aa97$export$2e2bcd8739ae039), {}),
8578
+ messageStyle: {
8579
+ fontWeight: 600
8580
+ }
8581
+ });
8359
8582
  };
8360
- const onSelfDisplayNameUpdate = (event)=>{
8361
- const { displayName: displayName } = event.detail;
8362
- setSelfDisplayName(displayName);
8583
+ const onSelfProfileUpdate = (event)=>{
8584
+ const { profile: profile } = event.detail;
8585
+ setProfile(profile);
8363
8586
  };
8364
8587
  const onCallEnd = ()=>{
8365
8588
  (0, $15a01b611391c1e7$export$716eeec86fd18da7)();
@@ -8427,7 +8650,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
8427
8650
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneMute", onMicrophoneUpdate);
8428
8651
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneUnmute", onMicrophoneUpdate);
8429
8652
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("defaultAudioDeviceChange", onDefaultAudioDeviceChange);
8430
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("selfDisplayName", onSelfDisplayNameUpdate);
8653
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("selfProfileUpdate", onSelfProfileUpdate);
8431
8654
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("terminateRoom", onCallTerminated);
8432
8655
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("leaveRoom", onCallEnd);
8433
8656
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("invalidRoom", onInvalidRoom);
@@ -8443,7 +8666,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
8443
8666
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("microphoneMute", onMicrophoneUpdate);
8444
8667
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("microphoneUnmute", onMicrophoneUpdate);
8445
8668
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("defaultAudioDeviceChange", onDefaultAudioDeviceChange);
8446
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("selfDisplayName", onSelfDisplayNameUpdate);
8669
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("selfProfileUpdate", onSelfProfileUpdate);
8447
8670
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("terminateRoom", onCallTerminated);
8448
8671
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("leaveRoom", onCallEnd);
8449
8672
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("invalidRoom", onInvalidRoom);
@@ -8472,7 +8695,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
8472
8695
  language: language,
8473
8696
  setLanguage: setLanguage,
8474
8697
  options: options,
8475
- selfDisplayName: selfDisplayName,
8698
+ profile: profile1,
8476
8699
  muted: muted,
8477
8700
  streaming: streaming,
8478
8701
  screensharing: screensharing,
@@ -8490,6 +8713,12 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
8490
8713
  children: [
8491
8714
  /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3a42b2ef7646d035$export$2e2bcd8739ae039), {}),
8492
8715
  /*#__PURE__*/ (0, $3Sbms$jsx)((0, $805d92fa41e6e1b0$export$2e2bcd8739ae039), {}),
8716
+ isBlockedDevicesPopupOpen && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6aca0f707e80bf63$export$2e2bcd8739ae039), {
8717
+ close: ()=>{
8718
+ setUserInteractionTriggered(true);
8719
+ setBlockedDevicesPopupOpen(false);
8720
+ }
8721
+ }),
8493
8722
  streamState === "streaming" && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$Fragment), {
8494
8723
  children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $cce9fd41d8a55a18$export$74636703cfe1eecf), {
8495
8724
  children: [
@@ -8529,7 +8758,8 @@ const $24075a5d702d64b3$var$defaultOptions = {
8529
8758
  screenshare: {
8530
8759
  available: true
8531
8760
  }
8532
- }
8761
+ },
8762
+ streamApiURL: String("https://apistream.snapcall.io")
8533
8763
  };
8534
8764
  const $24075a5d702d64b3$export$3f94917203ab7078 = {
8535
8765
  init: ({ element: element , ...options })=>{
@@ -8554,7 +8784,9 @@ const $24075a5d702d64b3$export$3f94917203ab7078 = {
8554
8784
  generateToken: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).generateToken.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
8555
8785
  addEventListener: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
8556
8786
  dispatchEvent: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).dispatchEvent.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
8557
- getState: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).getState.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2))
8787
+ getState: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).getState.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
8788
+ setProfile: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setProfile.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
8789
+ /* Should not be documented */ setConfig: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).setConfig.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2))
8558
8790
  };
8559
8791
  window.streamUI = $24075a5d702d64b3$export$3f94917203ab7078;
8560
8792
  // Backward compatibility