easyproctor-hml 2.5.6 → 2.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.js CHANGED
@@ -10175,7 +10175,9 @@ var CameraRecorder = class {
10175
10175
  let { width = 0, height = 0 } = settings;
10176
10176
  const isPortrait = (_d = screen.orientation) == null ? void 0 : _d.type.includes("portrait");
10177
10177
  if (isPortrait && this.isMobileDevice()) {
10178
- [width, height] = [height, width];
10178
+ if (this.videoOptions.width == height && this.videoOptions.height == width) {
10179
+ [width, height] = [height, width];
10180
+ }
10179
10181
  }
10180
10182
  console.log("isPortrait -> ", isPortrait);
10181
10183
  console.log("this.isMobileDevice() -> ", this.isMobileDevice());
@@ -10439,6 +10441,166 @@ var DeviceCheckerUI = class {
10439
10441
  align-items: center;
10440
10442
  margin-bottom: 5px;
10441
10443
  }
10444
+
10445
+ @media (max-width: 768px) {
10446
+ #checkDevices {
10447
+ padding: 10px;
10448
+ align-items: flex-start !important;
10449
+ padding-top: 20px !important;
10450
+ }
10451
+
10452
+ #checkDevices > div {
10453
+ width: 95% !important;
10454
+ max-width: 95% !important;
10455
+ margin: 10px !important;
10456
+ }
10457
+
10458
+ h3 {
10459
+ font-size: 18px !important;
10460
+ padding: 15px 10px !important;
10461
+ }
10462
+
10463
+ .device-checker-header {
10464
+ flex-direction: column !important;
10465
+ align-items: flex-start !important;
10466
+ gap: 10px !important;
10467
+ }
10468
+
10469
+ select {
10470
+ width: 100% !important;
10471
+ max-width: 100% !important;
10472
+ font-size: 14px !important;
10473
+ }
10474
+
10475
+ video {
10476
+ max-width: 100% !important;
10477
+ width: 100% !important;
10478
+ }
10479
+
10480
+ #liveCheckDevices {
10481
+ width: calc(100% - 20px) !important;
10482
+ flex-direction: column !important;
10483
+ align-items: center !important;
10484
+ }
10485
+
10486
+ .device-checker-microphone {
10487
+ padding: 0px 20px !important;
10488
+ flex-direction: column !important;
10489
+ align-items: center !important;
10490
+ }
10491
+
10492
+ p {
10493
+ padding: 0 20px !important;
10494
+ font-size: 14px !important;
10495
+ margin-left: 0 !important;
10496
+ }
10497
+ }
10498
+
10499
+ @media (max-width: 480px) {
10500
+ #checkDevices {
10501
+ padding: 0 !important;
10502
+ }
10503
+
10504
+ #checkDevices > div {
10505
+ width: 100% !important;
10506
+ max-width: 100% !important;
10507
+ margin: 0 !important;
10508
+ border-radius: 0 !important;
10509
+ max-height: 100vh !important;
10510
+ }
10511
+
10512
+ h3 {
10513
+ font-size: 16px !important;
10514
+ padding: 12px 10px !important;
10515
+ }
10516
+
10517
+ .device-checker-header {
10518
+ padding: 0 15px !important;
10519
+ }
10520
+
10521
+ #liveCheckDevices {
10522
+ width: calc(100% - 30px) !important;
10523
+ }
10524
+
10525
+ .device-checker-microphone {
10526
+ padding: 0px 15px !important;
10527
+ }
10528
+
10529
+ p {
10530
+ padding: 0 15px !important;
10531
+ font-size: 13px !important;
10532
+ margin-left: 0 !important;
10533
+ }
10534
+
10535
+ .alert-div {
10536
+ font-size: 12px !important;
10537
+ }
10538
+
10539
+ button {
10540
+ height: 60px !important;
10541
+ font-size: 14px !important;
10542
+ }
10543
+
10544
+ .device-checker-divider {
10545
+ height: 60px !important;
10546
+ }
10547
+ }
10548
+
10549
+ @media (max-height: 700px) {
10550
+ #checkDevices > div {
10551
+ max-height: 95vh !important;
10552
+ overflow-y: auto !important;
10553
+ }
10554
+
10555
+ video {
10556
+ max-height: 30vh !important;
10557
+ }
10558
+
10559
+ h3 {
10560
+ padding: 12px 0px !important;
10561
+ margin-bottom: 10px !important;
10562
+ }
10563
+
10564
+ .device-checker-header {
10565
+ margin-bottom: 10px !important;
10566
+ }
10567
+
10568
+ #liveCheckDevices {
10569
+ padding-bottom: 10px !important;
10570
+ }
10571
+ }
10572
+
10573
+ @media (max-height: 600px) {
10574
+ video {
10575
+ max-height: 25vh !important;
10576
+ }
10577
+
10578
+ h3 {
10579
+ padding: 10px 0px !important;
10580
+ margin-bottom: 8px !important;
10581
+ font-size: 16px !important;
10582
+ }
10583
+
10584
+ .device-checker-header {
10585
+ margin-bottom: 8px !important;
10586
+ }
10587
+
10588
+ #liveCheckDevices {
10589
+ padding-bottom: 8px !important;
10590
+ }
10591
+
10592
+ .alert-div {
10593
+ margin-bottom: 3px !important;
10594
+ }
10595
+
10596
+ button {
10597
+ height: 55px !important;
10598
+ }
10599
+
10600
+ .device-checker-divider {
10601
+ height: 55px !important;
10602
+ }
10603
+ }
10442
10604
 
10443
10605
  .checkmark {
10444
10606
  display: inline-block;
@@ -10542,28 +10704,38 @@ var DeviceCheckerUI = class {
10542
10704
  width: "100%",
10543
10705
  display: "flex",
10544
10706
  alignItems: "center",
10545
- justifyContent: "center"
10707
+ justifyContent: "center",
10708
+ padding: "10px",
10709
+ boxSizing: "border-box",
10710
+ overflowY: "auto"
10546
10711
  };
10547
10712
  this.applyStyles(fullBg, fullBgStyles);
10548
10713
  const modal = document.createElement("div");
10714
+ modal.setAttribute("class", "device-checker-modal");
10549
10715
  const modalStyles = {
10550
10716
  backgroundColor: "#fff",
10551
10717
  zIndex: "1001",
10552
- width: "600px",
10718
+ width: "90%",
10719
+ maxWidth: "600px",
10720
+ minWidth: "320px",
10553
10721
  borderRadius: "10px",
10554
10722
  display: "flex",
10555
10723
  flexDirection: "column",
10556
- alignItems: "center"
10724
+ alignItems: "center",
10725
+ maxHeight: "90vh",
10726
+ overflowY: "auto",
10727
+ overflowX: "hidden",
10728
+ margin: "20px"
10557
10729
  };
10558
10730
  this.applyStyles(modal, modalStyles);
10559
10731
  const h3 = document.createElement("h3");
10560
- h3.innerText = "Para iniciar configure a c\xE2mera e o microfone";
10732
+ h3.innerText = "Checagem de dispositivos";
10561
10733
  const h3Styles = {
10562
10734
  color: "rgba(0, 0, 0, .7)",
10563
10735
  fontWeight: "bold",
10564
- fontSize: "20px",
10736
+ fontSize: "clamp(16px, 4vw, 20px)",
10565
10737
  marginBottom: "15px",
10566
- padding: "20px 0px",
10738
+ padding: "20px 10px",
10567
10739
  borderBottom: "2px solid rgba(0, 0, 0, .1)",
10568
10740
  width: "100%",
10569
10741
  textAlign: "center"
@@ -10571,6 +10743,7 @@ var DeviceCheckerUI = class {
10571
10743
  this.applyStyles(h3, h3Styles);
10572
10744
  modal.appendChild(h3);
10573
10745
  const divCameraHeader = document.createElement("div");
10746
+ divCameraHeader.setAttribute("class", "device-checker-header");
10574
10747
  const h3Camera = document.createElement("h3");
10575
10748
  const selectCamera = document.createElement("select");
10576
10749
  selectCamera.setAttribute("id", "cameraSelect");
@@ -10586,17 +10759,20 @@ var DeviceCheckerUI = class {
10586
10759
  const h3CameraStyles = {
10587
10760
  color: "rgba(0, 0, 0, .75)",
10588
10761
  fontWeight: "bold",
10589
- fontSize: "16px"
10762
+ fontSize: "clamp(14px, 3.5vw, 16px)"
10590
10763
  };
10591
10764
  this.applyStyles(h3Camera, h3CameraStyles);
10765
+ selectCamera.style.width = "100%";
10592
10766
  selectCamera.style.maxWidth = "400px";
10593
10767
  divCameraHeader.appendChild(h3Camera);
10594
10768
  divCameraHeader.appendChild(selectCamera);
10595
10769
  modal.appendChild(divCameraHeader);
10596
10770
  const divCamera = document.createElement("div");
10597
10771
  divCamera.setAttribute("id", "liveCheckDevices");
10772
+ divCamera.setAttribute("class", "device-checker-camera");
10598
10773
  const videoDiv = document.createElement("div");
10599
10774
  const video = document.createElement("video");
10775
+ video.setAttribute("class", "device-checker-video");
10600
10776
  const center = document.createElement("div");
10601
10777
  video.setAttribute("id", "cameraStream");
10602
10778
  video.muted = true;
@@ -10611,6 +10787,8 @@ var DeviceCheckerUI = class {
10611
10787
  this.applyStyles(divCamera, divCameraStyles);
10612
10788
  const videoStyles = {
10613
10789
  width: "20rem",
10790
+ maxWidth: "100%",
10791
+ height: "auto",
10614
10792
  backgroundColor: "#000",
10615
10793
  borderRadius: "10px",
10616
10794
  marginBottom: "15px"
@@ -10710,13 +10888,13 @@ var DeviceCheckerUI = class {
10710
10888
  alertDivSpyCam.appendChild(checkmark_SpyCam);
10711
10889
  alertDivSpyCam.appendChild(SpyCamAlert);
10712
10890
  center.style.transform = "rotateY(180deg)";
10891
+ divCamera.appendChild(center);
10892
+ videoDiv.appendChild(video);
10893
+ divCamera.appendChild(videoDiv);
10713
10894
  center.appendChild(alertDivResolution);
10714
10895
  center.appendChild(alertDivFacePosition);
10715
10896
  center.appendChild(alertDivAmbientVerify);
10716
10897
  center.appendChild(alertDivSpyCam);
10717
- divCamera.appendChild(center);
10718
- videoDiv.appendChild(video);
10719
- divCamera.appendChild(videoDiv);
10720
10898
  const mask = document.createElement("div");
10721
10899
  mask.setAttribute("class", "facial-biometry__mask");
10722
10900
  mask.style.width = "100%";
@@ -10738,6 +10916,7 @@ var DeviceCheckerUI = class {
10738
10916
  videoDiv.appendChild(frame);
10739
10917
  modal.appendChild(divCamera);
10740
10918
  const divMicHeader = document.createElement("div");
10919
+ divMicHeader.setAttribute("class", "device-checker-header");
10741
10920
  const h3Mic = document.createElement("h3");
10742
10921
  const selectMic = document.createElement("select");
10743
10922
  selectMic.setAttribute("id", "micSelect");
@@ -10753,14 +10932,16 @@ var DeviceCheckerUI = class {
10753
10932
  const h3MicStyles = {
10754
10933
  color: "rgba(0, 0, 0, .7)",
10755
10934
  fontWeight: "bold",
10756
- fontSize: "16px"
10935
+ fontSize: "clamp(14px, 3.5vw, 16px)"
10757
10936
  };
10758
10937
  this.applyStyles(h3Mic, h3MicStyles);
10938
+ selectMic.style.width = "100%";
10759
10939
  selectMic.style.maxWidth = "400px";
10760
10940
  divMicHeader.appendChild(h3Mic);
10761
10941
  divMicHeader.appendChild(selectMic);
10762
10942
  modal.appendChild(divMicHeader);
10763
10943
  const divMic = document.createElement("div");
10944
+ divMic.setAttribute("class", "device-checker-microphone");
10764
10945
  const divMicStyles = {
10765
10946
  width: "100%",
10766
10947
  padding: "0px 40px",
@@ -10816,10 +10997,10 @@ var DeviceCheckerUI = class {
10816
10997
  alertDivMicrophone.setAttribute("class", "alert-div");
10817
10998
  alertDivMicrophone.setAttribute("id", "alertDivMicrophone");
10818
10999
  const alertDivMicrophoneStyles = {
10819
- // display: "flex",
10820
- alignItems: "start",
10821
- justifyContent: "end",
10822
- width: "inherit"
11000
+ display: "flex",
11001
+ alignItems: "center",
11002
+ justifyContent: "center",
11003
+ width: "100%"
10823
11004
  };
10824
11005
  this.applyStyles(alertDivMicrophone, alertDivMicrophoneStyles);
10825
11006
  const microphoneAlert = document.createElement("error");
@@ -10839,12 +11020,14 @@ var DeviceCheckerUI = class {
10839
11020
  divMicMeter.appendChild(divMeter);
10840
11021
  divMicMeter.appendChild(divRange);
10841
11022
  const pronunceMic = document.createElement("p");
10842
- pronunceMic.innerText = 'Pronuncie em voz alta: "um, dois, tr\xEAs, quatro".';
11023
+ pronunceMic.setAttribute("class", "device-checker-pronounce");
11024
+ pronunceMic.innerText = 'Pronuncie em voz alta: "Testando...".';
10843
11025
  pronunceMic.style.textAlign = "start";
10844
11026
  const pronunceMicStyles = {
10845
11027
  width: "100%",
10846
11028
  marginLeft: "40px",
10847
- marginBottom: "15px"
11029
+ marginBottom: "15px",
11030
+ fontSize: "clamp(12px, 3vw, 14px)"
10848
11031
  };
10849
11032
  this.applyStyles(pronunceMic, pronunceMicStyles);
10850
11033
  divMic.appendChild(divMicMeter);
@@ -10862,6 +11045,7 @@ var DeviceCheckerUI = class {
10862
11045
  this.applyStyles(divBtn, divBtnStyles);
10863
11046
  const buttonCancel = document.createElement("button");
10864
11047
  buttonCancel.setAttribute("id", "cancelBtn");
11048
+ buttonCancel.setAttribute("class", "device-checker-button");
10865
11049
  buttonCancel.innerText = "Cancelar";
10866
11050
  const buttonCancelStyles = {
10867
11051
  width: "100%",
@@ -10870,12 +11054,15 @@ var DeviceCheckerUI = class {
10870
11054
  border: "none",
10871
11055
  color: "rgba(0, 0, 0, .7)",
10872
11056
  fontWeight: "bold",
11057
+ fontSize: "clamp(14px, 3.5vw, 16px)",
10873
11058
  borderRadius: "10px",
10874
11059
  paddingTop: "5px",
10875
- paddingBottom: "5px"
11060
+ paddingBottom: "5px",
11061
+ cursor: "pointer"
10876
11062
  };
10877
11063
  this.applyStyles(buttonCancel, buttonCancelStyles);
10878
11064
  const divider = document.createElement("span");
11065
+ divider.setAttribute("class", "device-checker-divider");
10879
11066
  const dividerStyles = {
10880
11067
  width: "3px",
10881
11068
  height: "70px",
@@ -10886,6 +11073,7 @@ var DeviceCheckerUI = class {
10886
11073
  const button = document.createElement("button");
10887
11074
  button.innerText = "Continuar";
10888
11075
  button.setAttribute("id", "confirmBtn");
11076
+ button.setAttribute("class", "device-checker-button");
10889
11077
  const buttonStyles = {
10890
11078
  width: "100%",
10891
11079
  height: "70px",
@@ -10893,9 +11081,11 @@ var DeviceCheckerUI = class {
10893
11081
  border: "none",
10894
11082
  color: "rgba(0, 0, 0, .7)",
10895
11083
  fontWeight: "bold",
11084
+ fontSize: "clamp(14px, 3.5vw, 16px)",
10896
11085
  borderRadius: "10px",
10897
11086
  paddingTop: "5px",
10898
- paddingBottom: "5px"
11087
+ paddingBottom: "5px",
11088
+ cursor: "pointer"
10899
11089
  };
10900
11090
  this.applyStyles(button, buttonStyles);
10901
11091
  if (this.options.useSpyScan) {
@@ -11359,9 +11549,26 @@ var _DeviceCheckerService = class _DeviceCheckerService {
11359
11549
  return Promise.reject(error);
11360
11550
  }
11361
11551
  }
11552
+ isMobileDevice() {
11553
+ if ("userAgentData" in navigator) {
11554
+ const navUAData = navigator.userAgentData;
11555
+ const mobile = navUAData.mobile || false;
11556
+ const platform = navUAData.platform || "";
11557
+ return mobile || /Android|iOS/i.test(platform);
11558
+ }
11559
+ return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
11560
+ }
11362
11561
  isUnderResolution() {
11562
+ var _a2;
11363
11563
  const settings = this.cameraRecorder.cameraStream.getVideoTracks()[0].getSettings();
11364
- if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
11564
+ let { width = 0, height = 0 } = settings;
11565
+ const isPortrait = (_a2 = screen.orientation) == null ? void 0 : _a2.type.includes("portrait");
11566
+ if (isPortrait && this.isMobileDevice()) {
11567
+ if (this.videoOptions.width == height && this.videoOptions.height == width) {
11568
+ [width, height] = [height, width];
11569
+ }
11570
+ }
11571
+ if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
11365
11572
  this.allowedResolution = false;
11366
11573
  } else {
11367
11574
  this.allowedResolution = true;