analytica-frontend-lib 1.1.5 → 1.1.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/dist/Auth/AuthProvider/index.js +12 -0
- package/dist/Auth/AuthProvider/index.js.map +1 -1
- package/dist/Auth/AuthProvider/index.mjs +12 -0
- package/dist/Auth/AuthProvider/index.mjs.map +1 -1
- package/dist/Auth/ProtectedRoute/index.js +12 -0
- package/dist/Auth/ProtectedRoute/index.js.map +1 -1
- package/dist/Auth/ProtectedRoute/index.mjs +12 -0
- package/dist/Auth/ProtectedRoute/index.mjs.map +1 -1
- package/dist/Auth/PublicRoute/index.js +12 -0
- package/dist/Auth/PublicRoute/index.js.map +1 -1
- package/dist/Auth/PublicRoute/index.mjs +12 -0
- package/dist/Auth/PublicRoute/index.mjs.map +1 -1
- package/dist/Auth/getRootDomain/index.js +12 -0
- package/dist/Auth/getRootDomain/index.js.map +1 -1
- package/dist/Auth/getRootDomain/index.mjs +12 -0
- package/dist/Auth/getRootDomain/index.mjs.map +1 -1
- package/dist/Auth/index.d.mts +15 -1
- package/dist/Auth/index.d.ts +15 -1
- package/dist/Auth/index.js +12 -0
- package/dist/Auth/index.js.map +1 -1
- package/dist/Auth/index.mjs +12 -0
- package/dist/Auth/index.mjs.map +1 -1
- package/dist/Auth/useAuth/index.js +12 -0
- package/dist/Auth/useAuth/index.js.map +1 -1
- package/dist/Auth/useAuth/index.mjs +12 -0
- package/dist/Auth/useAuth/index.mjs.map +1 -1
- package/dist/Auth/useAuthGuard/index.js +12 -0
- package/dist/Auth/useAuthGuard/index.js.map +1 -1
- package/dist/Auth/useAuthGuard/index.mjs +12 -0
- package/dist/Auth/useAuthGuard/index.mjs.map +1 -1
- package/dist/Auth/useRouteAuth/index.js +12 -0
- package/dist/Auth/useRouteAuth/index.js.map +1 -1
- package/dist/Auth/useRouteAuth/index.mjs +12 -0
- package/dist/Auth/useRouteAuth/index.mjs.map +1 -1
- package/dist/Auth/withAuth/index.js +12 -0
- package/dist/Auth/withAuth/index.js.map +1 -1
- package/dist/Auth/withAuth/index.mjs +12 -0
- package/dist/Auth/withAuth/index.mjs.map +1 -1
- package/dist/Quiz/index.d.mts +1 -2
- package/dist/Quiz/index.d.ts +1 -2
- package/dist/Quiz/index.js +31 -5
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +31 -5
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +2 -0
- package/dist/Quiz/useQuizStore/index.d.ts +2 -0
- package/dist/Quiz/useQuizStore/index.js +2 -0
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +2 -0
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/VideoPlayer/index.d.mts +41 -0
- package/dist/VideoPlayer/index.d.ts +41 -0
- package/dist/VideoPlayer/index.js +562 -0
- package/dist/VideoPlayer/index.js.map +1 -0
- package/dist/VideoPlayer/index.mjs +550 -0
- package/dist/VideoPlayer/index.mjs.map +1 -0
- package/dist/index.css +124 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +691 -226
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +684 -211
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +124 -0
- package/dist/styles.css.map +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -4656,7 +4656,7 @@ var CardAudio = forwardRef12(
|
|
|
4656
4656
|
const [volume, setVolume] = useState8(1);
|
|
4657
4657
|
const [showVolumeControl, setShowVolumeControl] = useState8(false);
|
|
4658
4658
|
const audioRef = useRef6(null);
|
|
4659
|
-
const
|
|
4659
|
+
const formatTime2 = (time) => {
|
|
4660
4660
|
const minutes = Math.floor(time / 60);
|
|
4661
4661
|
const seconds = Math.floor(time % 60);
|
|
4662
4662
|
return `${minutes}:${seconds.toString().padStart(2, "0")}`;
|
|
@@ -4774,7 +4774,7 @@ var CardAudio = forwardRef12(
|
|
|
4774
4774
|
] }) }) : /* @__PURE__ */ jsx26(Play, { size: 24 })
|
|
4775
4775
|
}
|
|
4776
4776
|
),
|
|
4777
|
-
/* @__PURE__ */ jsx26("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children:
|
|
4777
|
+
/* @__PURE__ */ jsx26("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
|
|
4778
4778
|
/* @__PURE__ */ jsx26("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ jsx26(
|
|
4779
4779
|
"button",
|
|
4780
4780
|
{
|
|
@@ -4801,7 +4801,7 @@ var CardAudio = forwardRef12(
|
|
|
4801
4801
|
)
|
|
4802
4802
|
}
|
|
4803
4803
|
) }),
|
|
4804
|
-
/* @__PURE__ */ jsx26("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children:
|
|
4804
|
+
/* @__PURE__ */ jsx26("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
|
|
4805
4805
|
/* @__PURE__ */ jsxs20("div", { className: "relative", children: [
|
|
4806
4806
|
/* @__PURE__ */ jsx26(
|
|
4807
4807
|
"button",
|
|
@@ -6771,17 +6771,451 @@ var NotFound = ({
|
|
|
6771
6771
|
};
|
|
6772
6772
|
var NotFound_default = NotFound;
|
|
6773
6773
|
|
|
6774
|
+
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
6775
|
+
import { useRef as useRef9, useState as useState13, useEffect as useEffect11, useCallback } from "react";
|
|
6776
|
+
import {
|
|
6777
|
+
Play as Play2,
|
|
6778
|
+
Pause,
|
|
6779
|
+
SpeakerHigh as SpeakerHigh2,
|
|
6780
|
+
SpeakerSlash,
|
|
6781
|
+
ArrowsOutSimple,
|
|
6782
|
+
ArrowsInSimple,
|
|
6783
|
+
ClosedCaptioning,
|
|
6784
|
+
DotsThreeVertical as DotsThreeVertical2
|
|
6785
|
+
} from "phosphor-react";
|
|
6786
|
+
import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6787
|
+
var formatTime = (seconds) => {
|
|
6788
|
+
if (!seconds || isNaN(seconds)) return "0:00";
|
|
6789
|
+
const mins = Math.floor(seconds / 60);
|
|
6790
|
+
const secs = Math.floor(seconds % 60);
|
|
6791
|
+
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
6792
|
+
};
|
|
6793
|
+
var VideoPlayer = ({
|
|
6794
|
+
src,
|
|
6795
|
+
poster,
|
|
6796
|
+
subtitles,
|
|
6797
|
+
title,
|
|
6798
|
+
subtitle: subtitleText,
|
|
6799
|
+
initialTime = 0,
|
|
6800
|
+
onTimeUpdate,
|
|
6801
|
+
onProgress,
|
|
6802
|
+
onVideoComplete,
|
|
6803
|
+
className,
|
|
6804
|
+
autoSave = true,
|
|
6805
|
+
storageKey = "video-progress"
|
|
6806
|
+
}) => {
|
|
6807
|
+
const videoRef = useRef9(null);
|
|
6808
|
+
const [isPlaying, setIsPlaying] = useState13(false);
|
|
6809
|
+
const [currentTime, setCurrentTime] = useState13(0);
|
|
6810
|
+
const [duration, setDuration] = useState13(0);
|
|
6811
|
+
const [isMuted, setIsMuted] = useState13(false);
|
|
6812
|
+
const [volume, setVolume] = useState13(1);
|
|
6813
|
+
const [isFullscreen, setIsFullscreen] = useState13(false);
|
|
6814
|
+
const [showControls, setShowControls] = useState13(true);
|
|
6815
|
+
const [hasCompleted, setHasCompleted] = useState13(false);
|
|
6816
|
+
const [showCaptions, setShowCaptions] = useState13(false);
|
|
6817
|
+
const [playbackRate, setPlaybackRate] = useState13(1);
|
|
6818
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState13(false);
|
|
6819
|
+
const lastSaveTimeRef = useRef9(0);
|
|
6820
|
+
const trackRef = useRef9(null);
|
|
6821
|
+
useEffect11(() => {
|
|
6822
|
+
if (videoRef.current) {
|
|
6823
|
+
videoRef.current.volume = volume;
|
|
6824
|
+
videoRef.current.muted = isMuted;
|
|
6825
|
+
}
|
|
6826
|
+
}, [volume, isMuted]);
|
|
6827
|
+
useEffect11(() => {
|
|
6828
|
+
if (!autoSave || !storageKey) return;
|
|
6829
|
+
const raw = localStorage.getItem(`${storageKey}-${src}`);
|
|
6830
|
+
const saved = raw !== null ? Number(raw) : NaN;
|
|
6831
|
+
const hasValidSaved = Number.isFinite(saved) && saved >= 0;
|
|
6832
|
+
const hasValidInitial = Number.isFinite(initialTime) && initialTime >= 0;
|
|
6833
|
+
let start;
|
|
6834
|
+
if (hasValidInitial) {
|
|
6835
|
+
start = initialTime;
|
|
6836
|
+
} else if (hasValidSaved) {
|
|
6837
|
+
start = saved;
|
|
6838
|
+
} else {
|
|
6839
|
+
start = void 0;
|
|
6840
|
+
}
|
|
6841
|
+
if (start !== void 0 && videoRef.current) {
|
|
6842
|
+
videoRef.current.currentTime = start;
|
|
6843
|
+
setCurrentTime(start);
|
|
6844
|
+
}
|
|
6845
|
+
}, [src, storageKey, autoSave, initialTime]);
|
|
6846
|
+
const saveProgress = useCallback(() => {
|
|
6847
|
+
if (!autoSave || !storageKey) return;
|
|
6848
|
+
const now = Date.now();
|
|
6849
|
+
if (now - lastSaveTimeRef.current > 5e3) {
|
|
6850
|
+
localStorage.setItem(`${storageKey}-${src}`, currentTime.toString());
|
|
6851
|
+
lastSaveTimeRef.current = now;
|
|
6852
|
+
}
|
|
6853
|
+
}, [autoSave, storageKey, src, currentTime]);
|
|
6854
|
+
const togglePlayPause = useCallback(() => {
|
|
6855
|
+
if (videoRef.current) {
|
|
6856
|
+
if (isPlaying) {
|
|
6857
|
+
videoRef.current.pause();
|
|
6858
|
+
} else {
|
|
6859
|
+
videoRef.current.play();
|
|
6860
|
+
}
|
|
6861
|
+
setIsPlaying(!isPlaying);
|
|
6862
|
+
}
|
|
6863
|
+
}, [isPlaying]);
|
|
6864
|
+
const handleVolumeChange = useCallback(
|
|
6865
|
+
(newVolume) => {
|
|
6866
|
+
if (videoRef.current) {
|
|
6867
|
+
const volumeValue = newVolume / 100;
|
|
6868
|
+
videoRef.current.volume = volumeValue;
|
|
6869
|
+
setVolume(volumeValue);
|
|
6870
|
+
if (volumeValue === 0) {
|
|
6871
|
+
videoRef.current.muted = true;
|
|
6872
|
+
setIsMuted(true);
|
|
6873
|
+
} else if (isMuted) {
|
|
6874
|
+
videoRef.current.muted = false;
|
|
6875
|
+
setIsMuted(false);
|
|
6876
|
+
}
|
|
6877
|
+
}
|
|
6878
|
+
},
|
|
6879
|
+
[isMuted]
|
|
6880
|
+
);
|
|
6881
|
+
const toggleMute = useCallback(() => {
|
|
6882
|
+
if (videoRef.current) {
|
|
6883
|
+
if (isMuted) {
|
|
6884
|
+
const restoreVolume = volume > 0 ? volume : 0.5;
|
|
6885
|
+
videoRef.current.volume = restoreVolume;
|
|
6886
|
+
videoRef.current.muted = false;
|
|
6887
|
+
setVolume(restoreVolume);
|
|
6888
|
+
setIsMuted(false);
|
|
6889
|
+
} else {
|
|
6890
|
+
videoRef.current.muted = true;
|
|
6891
|
+
setIsMuted(true);
|
|
6892
|
+
}
|
|
6893
|
+
}
|
|
6894
|
+
}, [isMuted, volume]);
|
|
6895
|
+
const toggleFullscreen = useCallback(() => {
|
|
6896
|
+
const container = videoRef.current?.parentElement;
|
|
6897
|
+
if (!container) return;
|
|
6898
|
+
if (!isFullscreen) {
|
|
6899
|
+
if (container.requestFullscreen) {
|
|
6900
|
+
container.requestFullscreen();
|
|
6901
|
+
}
|
|
6902
|
+
} else if (document.exitFullscreen) {
|
|
6903
|
+
document.exitFullscreen();
|
|
6904
|
+
}
|
|
6905
|
+
setIsFullscreen(!isFullscreen);
|
|
6906
|
+
}, [isFullscreen]);
|
|
6907
|
+
const handleSpeedChange = useCallback((speed) => {
|
|
6908
|
+
if (videoRef.current) {
|
|
6909
|
+
videoRef.current.playbackRate = speed;
|
|
6910
|
+
setPlaybackRate(speed);
|
|
6911
|
+
setShowSpeedMenu(false);
|
|
6912
|
+
}
|
|
6913
|
+
}, []);
|
|
6914
|
+
const toggleSpeedMenu = useCallback(() => {
|
|
6915
|
+
setShowSpeedMenu(!showSpeedMenu);
|
|
6916
|
+
}, [showSpeedMenu]);
|
|
6917
|
+
const toggleCaptions = useCallback(() => {
|
|
6918
|
+
if (!trackRef.current?.track) return;
|
|
6919
|
+
const newShowCaptions = !showCaptions;
|
|
6920
|
+
setShowCaptions(newShowCaptions);
|
|
6921
|
+
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
6922
|
+
}, [showCaptions]);
|
|
6923
|
+
const handleTimeUpdate = useCallback(() => {
|
|
6924
|
+
if (videoRef.current) {
|
|
6925
|
+
const current = videoRef.current.currentTime;
|
|
6926
|
+
setCurrentTime(current);
|
|
6927
|
+
saveProgress();
|
|
6928
|
+
onTimeUpdate?.(current);
|
|
6929
|
+
if (duration > 0) {
|
|
6930
|
+
const progressPercent = current / duration * 100;
|
|
6931
|
+
onProgress?.(progressPercent);
|
|
6932
|
+
if (progressPercent >= 95 && !hasCompleted) {
|
|
6933
|
+
setHasCompleted(true);
|
|
6934
|
+
onVideoComplete?.();
|
|
6935
|
+
}
|
|
6936
|
+
}
|
|
6937
|
+
}
|
|
6938
|
+
}, [
|
|
6939
|
+
duration,
|
|
6940
|
+
saveProgress,
|
|
6941
|
+
onTimeUpdate,
|
|
6942
|
+
onProgress,
|
|
6943
|
+
onVideoComplete,
|
|
6944
|
+
hasCompleted
|
|
6945
|
+
]);
|
|
6946
|
+
const handleLoadedMetadata = useCallback(() => {
|
|
6947
|
+
if (videoRef.current) {
|
|
6948
|
+
setDuration(videoRef.current.duration);
|
|
6949
|
+
}
|
|
6950
|
+
}, []);
|
|
6951
|
+
useEffect11(() => {
|
|
6952
|
+
const handleVisibilityChange = () => {
|
|
6953
|
+
if (document.hidden && isPlaying && videoRef.current) {
|
|
6954
|
+
videoRef.current.pause();
|
|
6955
|
+
setIsPlaying(false);
|
|
6956
|
+
}
|
|
6957
|
+
};
|
|
6958
|
+
const handleBlur = () => {
|
|
6959
|
+
if (isPlaying && videoRef.current) {
|
|
6960
|
+
videoRef.current.pause();
|
|
6961
|
+
setIsPlaying(false);
|
|
6962
|
+
}
|
|
6963
|
+
};
|
|
6964
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
6965
|
+
window.addEventListener("blur", handleBlur);
|
|
6966
|
+
return () => {
|
|
6967
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
6968
|
+
window.removeEventListener("blur", handleBlur);
|
|
6969
|
+
};
|
|
6970
|
+
}, [isPlaying]);
|
|
6971
|
+
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
6972
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("flex flex-col", className), children: [
|
|
6973
|
+
(title || subtitleText) && /* @__PURE__ */ jsx36("div", { className: "bg-subject-1 rounded-t-xl px-8 py-4 flex items-end justify-between min-h-20", children: /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-1", children: [
|
|
6974
|
+
title && /* @__PURE__ */ jsx36(
|
|
6975
|
+
Text_default,
|
|
6976
|
+
{
|
|
6977
|
+
as: "h2",
|
|
6978
|
+
size: "lg",
|
|
6979
|
+
weight: "bold",
|
|
6980
|
+
color: "text-text-900",
|
|
6981
|
+
className: "leading-5 tracking-wide",
|
|
6982
|
+
children: title
|
|
6983
|
+
}
|
|
6984
|
+
),
|
|
6985
|
+
subtitleText && /* @__PURE__ */ jsx36(
|
|
6986
|
+
Text_default,
|
|
6987
|
+
{
|
|
6988
|
+
as: "p",
|
|
6989
|
+
size: "sm",
|
|
6990
|
+
weight: "normal",
|
|
6991
|
+
color: "text-text-600",
|
|
6992
|
+
className: "leading-5",
|
|
6993
|
+
children: subtitleText
|
|
6994
|
+
}
|
|
6995
|
+
)
|
|
6996
|
+
] }) }),
|
|
6997
|
+
/* @__PURE__ */ jsxs30(
|
|
6998
|
+
"div",
|
|
6999
|
+
{
|
|
7000
|
+
className: cn(
|
|
7001
|
+
"relative w-full bg-background overflow-hidden group",
|
|
7002
|
+
title || subtitleText ? "rounded-b-xl" : "rounded-xl"
|
|
7003
|
+
),
|
|
7004
|
+
children: [
|
|
7005
|
+
/* @__PURE__ */ jsx36(
|
|
7006
|
+
"video",
|
|
7007
|
+
{
|
|
7008
|
+
ref: videoRef,
|
|
7009
|
+
src,
|
|
7010
|
+
poster,
|
|
7011
|
+
className: "w-full h-full object-contain",
|
|
7012
|
+
controlsList: "nodownload",
|
|
7013
|
+
onTimeUpdate: handleTimeUpdate,
|
|
7014
|
+
onLoadedMetadata: handleLoadedMetadata,
|
|
7015
|
+
onClick: togglePlayPause,
|
|
7016
|
+
onKeyDown: (e) => {
|
|
7017
|
+
if (e.key) {
|
|
7018
|
+
setShowControls(true);
|
|
7019
|
+
}
|
|
7020
|
+
if (e.key === " " || e.key === "Enter") {
|
|
7021
|
+
e.preventDefault();
|
|
7022
|
+
togglePlayPause();
|
|
7023
|
+
}
|
|
7024
|
+
if (e.key === "ArrowLeft" && videoRef.current) {
|
|
7025
|
+
e.preventDefault();
|
|
7026
|
+
videoRef.current.currentTime -= 10;
|
|
7027
|
+
}
|
|
7028
|
+
if (e.key === "ArrowRight" && videoRef.current) {
|
|
7029
|
+
e.preventDefault();
|
|
7030
|
+
videoRef.current.currentTime += 10;
|
|
7031
|
+
}
|
|
7032
|
+
if (e.key === "ArrowUp") {
|
|
7033
|
+
e.preventDefault();
|
|
7034
|
+
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
7035
|
+
}
|
|
7036
|
+
if (e.key === "ArrowDown") {
|
|
7037
|
+
e.preventDefault();
|
|
7038
|
+
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
7039
|
+
}
|
|
7040
|
+
if (e.key === "m" || e.key === "M") {
|
|
7041
|
+
e.preventDefault();
|
|
7042
|
+
toggleMute();
|
|
7043
|
+
}
|
|
7044
|
+
if (e.key === "f" || e.key === "F") {
|
|
7045
|
+
e.preventDefault();
|
|
7046
|
+
toggleFullscreen();
|
|
7047
|
+
}
|
|
7048
|
+
},
|
|
7049
|
+
tabIndex: 0,
|
|
7050
|
+
"aria-label": title ? `Video: ${title}` : "Video player",
|
|
7051
|
+
children: /* @__PURE__ */ jsx36(
|
|
7052
|
+
"track",
|
|
7053
|
+
{
|
|
7054
|
+
ref: trackRef,
|
|
7055
|
+
kind: "captions",
|
|
7056
|
+
src: subtitles || "data:text/vtt;charset=utf-8,WEBVTT%0A%0ANOTE%20No%20captions%20available",
|
|
7057
|
+
srcLang: "en",
|
|
7058
|
+
label: subtitles ? "Subtitles" : "No captions available",
|
|
7059
|
+
default: false
|
|
7060
|
+
}
|
|
7061
|
+
)
|
|
7062
|
+
}
|
|
7063
|
+
),
|
|
7064
|
+
!isPlaying && /* @__PURE__ */ jsx36("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity", children: /* @__PURE__ */ jsx36(
|
|
7065
|
+
IconButton_default,
|
|
7066
|
+
{
|
|
7067
|
+
icon: /* @__PURE__ */ jsx36(Play2, { size: 32, weight: "regular", className: "ml-1" }),
|
|
7068
|
+
onClick: togglePlayPause,
|
|
7069
|
+
"aria-label": "Play video",
|
|
7070
|
+
className: "!bg-transparent !text-white !w-auto !h-auto hover:!bg-transparent hover:!text-gray-200"
|
|
7071
|
+
}
|
|
7072
|
+
) }),
|
|
7073
|
+
/* @__PURE__ */ jsx36(
|
|
7074
|
+
"div",
|
|
7075
|
+
{
|
|
7076
|
+
className: cn(
|
|
7077
|
+
"absolute top-0 left-0 right-0 p-4 bg-gradient-to-b from-black/70 to-transparent transition-opacity",
|
|
7078
|
+
!isPlaying || showControls ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
|
7079
|
+
),
|
|
7080
|
+
children: /* @__PURE__ */ jsx36("div", { className: "ml-auto block", children: /* @__PURE__ */ jsx36(
|
|
7081
|
+
IconButton_default,
|
|
7082
|
+
{
|
|
7083
|
+
icon: isFullscreen ? /* @__PURE__ */ jsx36(ArrowsInSimple, { size: 24 }) : /* @__PURE__ */ jsx36(ArrowsOutSimple, { size: 24 }),
|
|
7084
|
+
onClick: toggleFullscreen,
|
|
7085
|
+
"aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
7086
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7087
|
+
}
|
|
7088
|
+
) })
|
|
7089
|
+
}
|
|
7090
|
+
),
|
|
7091
|
+
/* @__PURE__ */ jsxs30(
|
|
7092
|
+
"div",
|
|
7093
|
+
{
|
|
7094
|
+
className: cn(
|
|
7095
|
+
"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/90 to-transparent transition-opacity",
|
|
7096
|
+
!isPlaying || showControls ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
|
7097
|
+
),
|
|
7098
|
+
children: [
|
|
7099
|
+
/* @__PURE__ */ jsx36("div", { className: "px-4 pb-2", children: /* @__PURE__ */ jsx36(
|
|
7100
|
+
"input",
|
|
7101
|
+
{
|
|
7102
|
+
type: "range",
|
|
7103
|
+
min: 0,
|
|
7104
|
+
max: duration || 100,
|
|
7105
|
+
value: currentTime,
|
|
7106
|
+
onChange: (e) => {
|
|
7107
|
+
const newTime = parseFloat(e.target.value);
|
|
7108
|
+
if (videoRef.current) {
|
|
7109
|
+
videoRef.current.currentTime = newTime;
|
|
7110
|
+
}
|
|
7111
|
+
},
|
|
7112
|
+
className: "w-full h-1 bg-neutral-600 rounded-full appearance-none cursor-pointer slider:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
7113
|
+
"aria-label": "Video progress",
|
|
7114
|
+
style: {
|
|
7115
|
+
background: `linear-gradient(to right, #2271C4 ${progressPercentage}%, #D5D4D4 ${progressPercentage}%)`
|
|
7116
|
+
}
|
|
7117
|
+
}
|
|
7118
|
+
) }),
|
|
7119
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between px-4 pb-4", children: [
|
|
7120
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-4", children: [
|
|
7121
|
+
/* @__PURE__ */ jsx36(
|
|
7122
|
+
IconButton_default,
|
|
7123
|
+
{
|
|
7124
|
+
icon: isPlaying ? /* @__PURE__ */ jsx36(Pause, { size: 24 }) : /* @__PURE__ */ jsx36(Play2, { size: 24 }),
|
|
7125
|
+
onClick: togglePlayPause,
|
|
7126
|
+
"aria-label": isPlaying ? "Pause" : "Play",
|
|
7127
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7128
|
+
}
|
|
7129
|
+
),
|
|
7130
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
7131
|
+
/* @__PURE__ */ jsx36(
|
|
7132
|
+
IconButton_default,
|
|
7133
|
+
{
|
|
7134
|
+
icon: isMuted ? /* @__PURE__ */ jsx36(SpeakerSlash, { size: 24 }) : /* @__PURE__ */ jsx36(SpeakerHigh2, { size: 24 }),
|
|
7135
|
+
onClick: toggleMute,
|
|
7136
|
+
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
7137
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7138
|
+
}
|
|
7139
|
+
),
|
|
7140
|
+
/* @__PURE__ */ jsx36(
|
|
7141
|
+
"input",
|
|
7142
|
+
{
|
|
7143
|
+
type: "range",
|
|
7144
|
+
min: 0,
|
|
7145
|
+
max: 100,
|
|
7146
|
+
value: Math.round(volume * 100),
|
|
7147
|
+
onChange: (e) => handleVolumeChange(parseInt(e.target.value)),
|
|
7148
|
+
className: "w-20 h-1 bg-neutral-600 rounded-full appearance-none cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
7149
|
+
"aria-label": "Volume control",
|
|
7150
|
+
style: {
|
|
7151
|
+
background: `linear-gradient(to right, #2271C4 ${volume * 100}%, #D5D4D4 ${volume * 100}%)`
|
|
7152
|
+
}
|
|
7153
|
+
}
|
|
7154
|
+
)
|
|
7155
|
+
] }),
|
|
7156
|
+
subtitles && /* @__PURE__ */ jsx36(
|
|
7157
|
+
IconButton_default,
|
|
7158
|
+
{
|
|
7159
|
+
icon: /* @__PURE__ */ jsx36(ClosedCaptioning, { size: 24 }),
|
|
7160
|
+
onClick: toggleCaptions,
|
|
7161
|
+
"aria-label": showCaptions ? "Hide captions" : "Show captions",
|
|
7162
|
+
className: cn(
|
|
7163
|
+
"!bg-transparent hover:!bg-white/20",
|
|
7164
|
+
showCaptions ? "!text-primary-400" : "!text-white"
|
|
7165
|
+
)
|
|
7166
|
+
}
|
|
7167
|
+
),
|
|
7168
|
+
/* @__PURE__ */ jsxs30(Text_default, { size: "sm", weight: "medium", color: "text-white", children: [
|
|
7169
|
+
formatTime(currentTime),
|
|
7170
|
+
" / ",
|
|
7171
|
+
formatTime(duration)
|
|
7172
|
+
] })
|
|
7173
|
+
] }),
|
|
7174
|
+
/* @__PURE__ */ jsx36("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsxs30("div", { className: "relative", children: [
|
|
7175
|
+
/* @__PURE__ */ jsx36(
|
|
7176
|
+
IconButton_default,
|
|
7177
|
+
{
|
|
7178
|
+
icon: /* @__PURE__ */ jsx36(DotsThreeVertical2, { size: 24 }),
|
|
7179
|
+
onClick: toggleSpeedMenu,
|
|
7180
|
+
"aria-label": "Playback speed",
|
|
7181
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7182
|
+
}
|
|
7183
|
+
),
|
|
7184
|
+
showSpeedMenu && /* @__PURE__ */ jsx36("div", { className: "absolute bottom-12 right-0 bg-black/90 rounded-lg p-2 min-w-20", children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ jsxs30(
|
|
7185
|
+
"button",
|
|
7186
|
+
{
|
|
7187
|
+
onClick: () => handleSpeedChange(speed),
|
|
7188
|
+
className: `block w-full text-left px-3 py-1 text-sm rounded hover:bg-white/20 transition-colors ${playbackRate === speed ? "text-primary-400" : "text-white"}`,
|
|
7189
|
+
children: [
|
|
7190
|
+
speed,
|
|
7191
|
+
"x"
|
|
7192
|
+
]
|
|
7193
|
+
},
|
|
7194
|
+
speed
|
|
7195
|
+
)) })
|
|
7196
|
+
] }) })
|
|
7197
|
+
] })
|
|
7198
|
+
]
|
|
7199
|
+
}
|
|
7200
|
+
)
|
|
7201
|
+
]
|
|
7202
|
+
}
|
|
7203
|
+
)
|
|
7204
|
+
] });
|
|
7205
|
+
};
|
|
7206
|
+
var VideoPlayer_default = VideoPlayer;
|
|
7207
|
+
|
|
6774
7208
|
// src/components/Auth/Auth.tsx
|
|
6775
7209
|
import {
|
|
6776
7210
|
createContext,
|
|
6777
7211
|
useContext,
|
|
6778
|
-
useEffect as
|
|
6779
|
-
useState as
|
|
6780
|
-
useCallback,
|
|
7212
|
+
useEffect as useEffect12,
|
|
7213
|
+
useState as useState14,
|
|
7214
|
+
useCallback as useCallback2,
|
|
6781
7215
|
useMemo as useMemo4
|
|
6782
7216
|
} from "react";
|
|
6783
7217
|
import { useLocation, Navigate } from "react-router-dom";
|
|
6784
|
-
import { Fragment as Fragment7, jsx as
|
|
7218
|
+
import { Fragment as Fragment7, jsx as jsx37 } from "react/jsx-runtime";
|
|
6785
7219
|
var AuthContext = createContext(void 0);
|
|
6786
7220
|
var AuthProvider = ({
|
|
6787
7221
|
children,
|
|
@@ -6792,12 +7226,12 @@ var AuthProvider = ({
|
|
|
6792
7226
|
getSessionFn,
|
|
6793
7227
|
getTokensFn
|
|
6794
7228
|
}) => {
|
|
6795
|
-
const [authState, setAuthState] =
|
|
7229
|
+
const [authState, setAuthState] = useState14({
|
|
6796
7230
|
isAuthenticated: false,
|
|
6797
7231
|
isLoading: true,
|
|
6798
7232
|
...initialAuthState
|
|
6799
7233
|
});
|
|
6800
|
-
const checkAuth =
|
|
7234
|
+
const checkAuth = useCallback2(async () => {
|
|
6801
7235
|
try {
|
|
6802
7236
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
6803
7237
|
if (!checkAuthFn) {
|
|
@@ -6828,7 +7262,7 @@ var AuthProvider = ({
|
|
|
6828
7262
|
return false;
|
|
6829
7263
|
}
|
|
6830
7264
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
6831
|
-
const signOut =
|
|
7265
|
+
const signOut = useCallback2(() => {
|
|
6832
7266
|
if (signOutFn) {
|
|
6833
7267
|
signOutFn();
|
|
6834
7268
|
}
|
|
@@ -6840,7 +7274,7 @@ var AuthProvider = ({
|
|
|
6840
7274
|
tokens: void 0
|
|
6841
7275
|
}));
|
|
6842
7276
|
}, [signOutFn]);
|
|
6843
|
-
|
|
7277
|
+
useEffect12(() => {
|
|
6844
7278
|
checkAuth();
|
|
6845
7279
|
}, [checkAuth]);
|
|
6846
7280
|
const contextValue = useMemo4(
|
|
@@ -6851,7 +7285,7 @@ var AuthProvider = ({
|
|
|
6851
7285
|
}),
|
|
6852
7286
|
[authState, checkAuth, signOut]
|
|
6853
7287
|
);
|
|
6854
|
-
return /* @__PURE__ */
|
|
7288
|
+
return /* @__PURE__ */ jsx37(AuthContext.Provider, { value: contextValue, children });
|
|
6855
7289
|
};
|
|
6856
7290
|
var useAuth = () => {
|
|
6857
7291
|
const context = useContext(AuthContext);
|
|
@@ -6867,9 +7301,9 @@ var ProtectedRoute = ({
|
|
|
6867
7301
|
additionalCheck
|
|
6868
7302
|
}) => {
|
|
6869
7303
|
const { isAuthenticated, isLoading, ...authState } = useAuth();
|
|
6870
|
-
const defaultLoadingComponent = /* @__PURE__ */
|
|
7304
|
+
const defaultLoadingComponent = /* @__PURE__ */ jsx37("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx37("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
6871
7305
|
if (isLoading) {
|
|
6872
|
-
return /* @__PURE__ */
|
|
7306
|
+
return /* @__PURE__ */ jsx37(Fragment7, { children: loadingComponent || defaultLoadingComponent });
|
|
6873
7307
|
}
|
|
6874
7308
|
if (!isAuthenticated) {
|
|
6875
7309
|
if (typeof window !== "undefined") {
|
|
@@ -6880,12 +7314,12 @@ var ProtectedRoute = ({
|
|
|
6880
7314
|
return null;
|
|
6881
7315
|
}
|
|
6882
7316
|
}
|
|
6883
|
-
return /* @__PURE__ */
|
|
7317
|
+
return /* @__PURE__ */ jsx37(Navigate, { to: redirectTo, replace: true });
|
|
6884
7318
|
}
|
|
6885
7319
|
if (additionalCheck && !additionalCheck({ isAuthenticated, isLoading, ...authState })) {
|
|
6886
|
-
return /* @__PURE__ */
|
|
7320
|
+
return /* @__PURE__ */ jsx37(Navigate, { to: redirectTo, replace: true });
|
|
6887
7321
|
}
|
|
6888
|
-
return /* @__PURE__ */
|
|
7322
|
+
return /* @__PURE__ */ jsx37(Fragment7, { children });
|
|
6889
7323
|
};
|
|
6890
7324
|
var PublicRoute = ({
|
|
6891
7325
|
children,
|
|
@@ -6895,15 +7329,15 @@ var PublicRoute = ({
|
|
|
6895
7329
|
}) => {
|
|
6896
7330
|
const { isAuthenticated, isLoading } = useAuth();
|
|
6897
7331
|
if (checkAuthBeforeRender && isLoading) {
|
|
6898
|
-
return /* @__PURE__ */
|
|
7332
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx37("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
6899
7333
|
}
|
|
6900
7334
|
if (isAuthenticated && redirectIfAuthenticated) {
|
|
6901
|
-
return /* @__PURE__ */
|
|
7335
|
+
return /* @__PURE__ */ jsx37(Navigate, { to: redirectTo, replace: true });
|
|
6902
7336
|
}
|
|
6903
|
-
return /* @__PURE__ */
|
|
7337
|
+
return /* @__PURE__ */ jsx37(Fragment7, { children });
|
|
6904
7338
|
};
|
|
6905
7339
|
var withAuth = (Component, options = {}) => {
|
|
6906
|
-
return (props) => /* @__PURE__ */
|
|
7340
|
+
return (props) => /* @__PURE__ */ jsx37(ProtectedRoute, { ...options, children: /* @__PURE__ */ jsx37(Component, { ...props }) });
|
|
6907
7341
|
};
|
|
6908
7342
|
var useAuthGuard = (options = {}) => {
|
|
6909
7343
|
const authState = useAuth();
|
|
@@ -6918,7 +7352,7 @@ var useAuthGuard = (options = {}) => {
|
|
|
6918
7352
|
var useRouteAuth = (fallbackPath = "/") => {
|
|
6919
7353
|
const { isAuthenticated, isLoading } = useAuth();
|
|
6920
7354
|
const location = useLocation();
|
|
6921
|
-
const redirectToLogin = () => /* @__PURE__ */
|
|
7355
|
+
const redirectToLogin = () => /* @__PURE__ */ jsx37(Navigate, { to: fallbackPath, state: { from: location }, replace: true });
|
|
6922
7356
|
return {
|
|
6923
7357
|
isAuthenticated,
|
|
6924
7358
|
isLoading,
|
|
@@ -6931,7 +7365,19 @@ var getRootDomain = () => {
|
|
|
6931
7365
|
if (hostname === "localhost") {
|
|
6932
7366
|
return `${protocol}//${hostname}${portStr}`;
|
|
6933
7367
|
}
|
|
7368
|
+
const isIPv4 = /^\d{1,3}(?:\.\d{1,3}){3}$/.test(hostname);
|
|
7369
|
+
const isIPv6 = hostname.includes(":");
|
|
7370
|
+
if (isIPv4 || isIPv6) {
|
|
7371
|
+
return `${protocol}//${hostname}${portStr}`;
|
|
7372
|
+
}
|
|
6934
7373
|
const parts = hostname.split(".");
|
|
7374
|
+
if (parts.length >= 3 && parts[parts.length - 2] === "com" && parts[parts.length - 1] === "br") {
|
|
7375
|
+
if (parts.length === 3) {
|
|
7376
|
+
return `${protocol}//${hostname}${portStr}`;
|
|
7377
|
+
}
|
|
7378
|
+
const base = parts.slice(-3).join(".");
|
|
7379
|
+
return `${protocol}//${base}${portStr}`;
|
|
7380
|
+
}
|
|
6935
7381
|
if (parts.length > 2) {
|
|
6936
7382
|
const base = parts.slice(-2).join(".");
|
|
6937
7383
|
return `${protocol}//${base}${portStr}`;
|
|
@@ -6982,7 +7428,7 @@ function createZustandAuthAdapter(useAuthStore) {
|
|
|
6982
7428
|
}
|
|
6983
7429
|
|
|
6984
7430
|
// src/components/Auth/useUrlAuthentication.ts
|
|
6985
|
-
import { useEffect as
|
|
7431
|
+
import { useEffect as useEffect13 } from "react";
|
|
6986
7432
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
6987
7433
|
var getAuthParams = (location, extractParams) => {
|
|
6988
7434
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -7030,7 +7476,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
7030
7476
|
};
|
|
7031
7477
|
function useUrlAuthentication(options) {
|
|
7032
7478
|
const location = useLocation2();
|
|
7033
|
-
|
|
7479
|
+
useEffect13(() => {
|
|
7034
7480
|
const handleAuthentication = async () => {
|
|
7035
7481
|
const authParams = getAuthParams(location, options.extractParams);
|
|
7036
7482
|
if (!hasValidAuthParams(authParams)) {
|
|
@@ -7092,12 +7538,12 @@ import {
|
|
|
7092
7538
|
} from "phosphor-react";
|
|
7093
7539
|
import {
|
|
7094
7540
|
forwardRef as forwardRef19,
|
|
7095
|
-
useEffect as
|
|
7541
|
+
useEffect as useEffect14,
|
|
7096
7542
|
useMemo as useMemo6,
|
|
7097
7543
|
useId as useId10,
|
|
7098
|
-
useState as
|
|
7099
|
-
useCallback as
|
|
7100
|
-
useRef as
|
|
7544
|
+
useState as useState15,
|
|
7545
|
+
useCallback as useCallback3,
|
|
7546
|
+
useRef as useRef10
|
|
7101
7547
|
} from "react";
|
|
7102
7548
|
|
|
7103
7549
|
// src/components/Quiz/useQuizStore.ts
|
|
@@ -7134,6 +7580,7 @@ var useQuizStore = create7()(
|
|
|
7134
7580
|
isStarted: false,
|
|
7135
7581
|
isFinished: false,
|
|
7136
7582
|
userId: "",
|
|
7583
|
+
variant: "default",
|
|
7137
7584
|
// Setters
|
|
7138
7585
|
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
7139
7586
|
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
@@ -7141,6 +7588,7 @@ var useQuizStore = create7()(
|
|
|
7141
7588
|
setUserId: (userId) => set({ userId }),
|
|
7142
7589
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
7143
7590
|
getUserId: () => get().userId,
|
|
7591
|
+
setVariant: (variant) => set({ variant }),
|
|
7144
7592
|
// Navigation
|
|
7145
7593
|
goToNextQuestion: () => {
|
|
7146
7594
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -7596,13 +8044,13 @@ var simulated_result_default = "./simulated-result-QN5HCUY5.png";
|
|
|
7596
8044
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
7597
8045
|
|
|
7598
8046
|
// src/components/Quiz/Quiz.tsx
|
|
7599
|
-
import { Fragment as Fragment8, jsx as
|
|
8047
|
+
import { Fragment as Fragment8, jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7600
8048
|
var getStatusBadge = (status) => {
|
|
7601
8049
|
switch (status) {
|
|
7602
8050
|
case "correct":
|
|
7603
|
-
return /* @__PURE__ */
|
|
8051
|
+
return /* @__PURE__ */ jsx38(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx38(CheckCircle6, {}), children: "Resposta correta" });
|
|
7604
8052
|
case "incorrect":
|
|
7605
|
-
return /* @__PURE__ */
|
|
8053
|
+
return /* @__PURE__ */ jsx38(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx38(XCircle5, {}), children: "Resposta incorreta" });
|
|
7606
8054
|
default:
|
|
7607
8055
|
return null;
|
|
7608
8056
|
}
|
|
@@ -7615,8 +8063,12 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
7615
8063
|
return "bg-error-background border-error-300";
|
|
7616
8064
|
}
|
|
7617
8065
|
};
|
|
7618
|
-
var Quiz = forwardRef19(({ children, className, ...props }, ref) => {
|
|
7619
|
-
|
|
8066
|
+
var Quiz = forwardRef19(({ children, className, variant = "default", ...props }, ref) => {
|
|
8067
|
+
const { setVariant } = useQuizStore();
|
|
8068
|
+
useEffect14(() => {
|
|
8069
|
+
setVariant(variant);
|
|
8070
|
+
}, [variant, setVariant]);
|
|
8071
|
+
return /* @__PURE__ */ jsx38(
|
|
7620
8072
|
"div",
|
|
7621
8073
|
{
|
|
7622
8074
|
ref,
|
|
@@ -7633,8 +8085,8 @@ var QuizHeaderResult = forwardRef19(
|
|
|
7633
8085
|
({ className, ...props }, ref) => {
|
|
7634
8086
|
const { getAllCurrentAnswer } = useQuizStore();
|
|
7635
8087
|
const usersAnswer = getAllCurrentAnswer();
|
|
7636
|
-
const [isCorrect, setIsCorrect] =
|
|
7637
|
-
|
|
8088
|
+
const [isCorrect, setIsCorrect] = useState15(false);
|
|
8089
|
+
useEffect14(() => {
|
|
7638
8090
|
if (usersAnswer) {
|
|
7639
8091
|
setIsCorrect(
|
|
7640
8092
|
usersAnswer.length > 0 ? usersAnswer.map(
|
|
@@ -7643,7 +8095,7 @@ var QuizHeaderResult = forwardRef19(
|
|
|
7643
8095
|
);
|
|
7644
8096
|
}
|
|
7645
8097
|
}, [usersAnswer]);
|
|
7646
|
-
return /* @__PURE__ */
|
|
8098
|
+
return /* @__PURE__ */ jsxs31(
|
|
7647
8099
|
"div",
|
|
7648
8100
|
{
|
|
7649
8101
|
ref,
|
|
@@ -7654,8 +8106,8 @@ var QuizHeaderResult = forwardRef19(
|
|
|
7654
8106
|
),
|
|
7655
8107
|
...props,
|
|
7656
8108
|
children: [
|
|
7657
|
-
/* @__PURE__ */
|
|
7658
|
-
/* @__PURE__ */
|
|
8109
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
8110
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-700 text-md", children: isCorrect ? "\u{1F389} Parab\xE9ns!!" : "N\xE3o foi dessa vez..." })
|
|
7659
8111
|
]
|
|
7660
8112
|
}
|
|
7661
8113
|
);
|
|
@@ -7668,12 +8120,12 @@ var QuizTitle = forwardRef19(
|
|
|
7668
8120
|
getTotalQuestions,
|
|
7669
8121
|
getQuizTitle,
|
|
7670
8122
|
timeElapsed,
|
|
7671
|
-
formatTime,
|
|
8123
|
+
formatTime: formatTime2,
|
|
7672
8124
|
isStarted
|
|
7673
8125
|
} = useQuizStore();
|
|
7674
8126
|
const totalQuestions = getTotalQuestions();
|
|
7675
8127
|
const quizTitle = getQuizTitle();
|
|
7676
|
-
return /* @__PURE__ */
|
|
8128
|
+
return /* @__PURE__ */ jsxs31(
|
|
7677
8129
|
"div",
|
|
7678
8130
|
{
|
|
7679
8131
|
ref,
|
|
@@ -7683,11 +8135,11 @@ var QuizTitle = forwardRef19(
|
|
|
7683
8135
|
),
|
|
7684
8136
|
...props,
|
|
7685
8137
|
children: [
|
|
7686
|
-
/* @__PURE__ */
|
|
7687
|
-
/* @__PURE__ */
|
|
7688
|
-
/* @__PURE__ */
|
|
8138
|
+
/* @__PURE__ */ jsxs31("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
8139
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
8140
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
7689
8141
|
] }),
|
|
7690
|
-
/* @__PURE__ */
|
|
8142
|
+
/* @__PURE__ */ jsx38("span", { className: "absolute right-2", children: /* @__PURE__ */ jsx38(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx38(Clock2, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
7691
8143
|
]
|
|
7692
8144
|
}
|
|
7693
8145
|
);
|
|
@@ -7695,13 +8147,13 @@ var QuizTitle = forwardRef19(
|
|
|
7695
8147
|
);
|
|
7696
8148
|
var QuizSubTitle = forwardRef19(
|
|
7697
8149
|
({ subTitle, ...props }, ref) => {
|
|
7698
|
-
return /* @__PURE__ */
|
|
8150
|
+
return /* @__PURE__ */ jsx38("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ jsx38("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
7699
8151
|
}
|
|
7700
8152
|
);
|
|
7701
8153
|
var QuizHeader = () => {
|
|
7702
8154
|
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
7703
8155
|
const currentQuestion = getCurrentQuestion();
|
|
7704
|
-
return /* @__PURE__ */
|
|
8156
|
+
return /* @__PURE__ */ jsx38(
|
|
7705
8157
|
HeaderAlternative,
|
|
7706
8158
|
{
|
|
7707
8159
|
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
@@ -7711,7 +8163,7 @@ var QuizHeader = () => {
|
|
|
7711
8163
|
);
|
|
7712
8164
|
};
|
|
7713
8165
|
var QuizContainer = forwardRef19(({ children, className, ...props }, ref) => {
|
|
7714
|
-
return /* @__PURE__ */
|
|
8166
|
+
return /* @__PURE__ */ jsx38(
|
|
7715
8167
|
"div",
|
|
7716
8168
|
{
|
|
7717
8169
|
ref,
|
|
@@ -7724,8 +8176,8 @@ var QuizContainer = forwardRef19(({ children, className, ...props }, ref) => {
|
|
|
7724
8176
|
}
|
|
7725
8177
|
);
|
|
7726
8178
|
});
|
|
7727
|
-
var QuizContent = forwardRef19(({
|
|
7728
|
-
const { getCurrentQuestion } = useQuizStore();
|
|
8179
|
+
var QuizContent = forwardRef19(({ paddingBottom }) => {
|
|
8180
|
+
const { getCurrentQuestion, variant } = useQuizStore();
|
|
7729
8181
|
const currentQuestion = getCurrentQuestion();
|
|
7730
8182
|
const questionComponents = {
|
|
7731
8183
|
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
@@ -7737,7 +8189,7 @@ var QuizContent = forwardRef19(({ variant, paddingBottom }) => {
|
|
|
7737
8189
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
7738
8190
|
};
|
|
7739
8191
|
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.type] : null;
|
|
7740
|
-
return QuestionComponent ? /* @__PURE__ */
|
|
8192
|
+
return QuestionComponent ? /* @__PURE__ */ jsx38(QuestionComponent, { variant, paddingBottom }) : null;
|
|
7741
8193
|
});
|
|
7742
8194
|
var QuizAlternative = ({
|
|
7743
8195
|
variant = "default",
|
|
@@ -7765,10 +8217,10 @@ var QuizAlternative = ({
|
|
|
7765
8217
|
};
|
|
7766
8218
|
});
|
|
7767
8219
|
if (!alternatives)
|
|
7768
|
-
return /* @__PURE__ */
|
|
7769
|
-
return /* @__PURE__ */
|
|
7770
|
-
/* @__PURE__ */
|
|
7771
|
-
/* @__PURE__ */
|
|
8220
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
8221
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8222
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8223
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx38("div", { className: "space-y-4", children: /* @__PURE__ */ jsx38(
|
|
7772
8224
|
AlternativesList,
|
|
7773
8225
|
{
|
|
7774
8226
|
mode: variant === "default" ? "interactive" : "readonly",
|
|
@@ -7794,8 +8246,8 @@ var QuizMultipleChoice = ({
|
|
|
7794
8246
|
const { getCurrentQuestion, selectMultipleAnswer, getAllCurrentAnswer } = useQuizStore();
|
|
7795
8247
|
const currentQuestion = getCurrentQuestion();
|
|
7796
8248
|
const allCurrentAnswers = getAllCurrentAnswer();
|
|
7797
|
-
const prevSelectedValuesRef =
|
|
7798
|
-
const prevQuestionIdRef =
|
|
8249
|
+
const prevSelectedValuesRef = useRef10([]);
|
|
8250
|
+
const prevQuestionIdRef = useRef10("");
|
|
7799
8251
|
const allCurrentAnswerIds = useMemo6(() => {
|
|
7800
8252
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
7801
8253
|
}, [allCurrentAnswers]);
|
|
@@ -7817,7 +8269,7 @@ var QuizMultipleChoice = ({
|
|
|
7817
8269
|
}
|
|
7818
8270
|
return prevSelectedValuesRef.current;
|
|
7819
8271
|
}, [selectedValues, currentQuestion?.id]);
|
|
7820
|
-
const handleSelectedValues =
|
|
8272
|
+
const handleSelectedValues = useCallback3(
|
|
7821
8273
|
(values) => {
|
|
7822
8274
|
if (currentQuestion) {
|
|
7823
8275
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -7846,10 +8298,10 @@ var QuizMultipleChoice = ({
|
|
|
7846
8298
|
};
|
|
7847
8299
|
});
|
|
7848
8300
|
if (!choices)
|
|
7849
|
-
return /* @__PURE__ */
|
|
7850
|
-
return /* @__PURE__ */
|
|
7851
|
-
/* @__PURE__ */
|
|
7852
|
-
/* @__PURE__ */
|
|
8301
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
8302
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8303
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8304
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx38("div", { className: "space-y-4", children: /* @__PURE__ */ jsx38(
|
|
7853
8305
|
MultipleChoiceList,
|
|
7854
8306
|
{
|
|
7855
8307
|
choices,
|
|
@@ -7869,13 +8321,13 @@ var QuizDissertative = ({
|
|
|
7869
8321
|
const { getCurrentQuestion, getCurrentAnswer, selectDissertativeAnswer } = useQuizStore();
|
|
7870
8322
|
const currentQuestion = getCurrentQuestion();
|
|
7871
8323
|
const currentAnswer = getCurrentAnswer();
|
|
7872
|
-
const textareaRef =
|
|
8324
|
+
const textareaRef = useRef10(null);
|
|
7873
8325
|
const handleAnswerChange = (value) => {
|
|
7874
8326
|
if (currentQuestion) {
|
|
7875
8327
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
7876
8328
|
}
|
|
7877
8329
|
};
|
|
7878
|
-
const adjustTextareaHeight =
|
|
8330
|
+
const adjustTextareaHeight = useCallback3(() => {
|
|
7879
8331
|
if (textareaRef.current) {
|
|
7880
8332
|
textareaRef.current.style.height = "auto";
|
|
7881
8333
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -7885,15 +8337,15 @@ var QuizDissertative = ({
|
|
|
7885
8337
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
7886
8338
|
}
|
|
7887
8339
|
}, []);
|
|
7888
|
-
|
|
8340
|
+
useEffect14(() => {
|
|
7889
8341
|
adjustTextareaHeight();
|
|
7890
8342
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
7891
8343
|
if (!currentQuestion) {
|
|
7892
|
-
return /* @__PURE__ */
|
|
8344
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-4", children: /* @__PURE__ */ jsx38("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
7893
8345
|
}
|
|
7894
|
-
return /* @__PURE__ */
|
|
7895
|
-
/* @__PURE__ */
|
|
7896
|
-
/* @__PURE__ */
|
|
8346
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8347
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Resposta" }),
|
|
8348
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ jsx38("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ jsx38("div", { className: "space-y-4", children: /* @__PURE__ */ jsx38(
|
|
7897
8349
|
TextArea_default,
|
|
7898
8350
|
{
|
|
7899
8351
|
ref: textareaRef,
|
|
@@ -7903,10 +8355,10 @@ var QuizDissertative = ({
|
|
|
7903
8355
|
rows: 4,
|
|
7904
8356
|
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
7905
8357
|
}
|
|
7906
|
-
) }) : /* @__PURE__ */
|
|
7907
|
-
variant === "result" && currentAnswer?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */
|
|
7908
|
-
/* @__PURE__ */
|
|
7909
|
-
/* @__PURE__ */
|
|
8358
|
+
) }) : /* @__PURE__ */ jsx38("div", { className: "space-y-4", children: /* @__PURE__ */ jsx38("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentAnswer?.answer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
8359
|
+
variant === "result" && currentAnswer?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8360
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
8361
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx38("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Mauris euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim." }) })
|
|
7910
8362
|
] })
|
|
7911
8363
|
] });
|
|
7912
8364
|
};
|
|
@@ -7934,16 +8386,16 @@ var QuizTrueOrFalse = ({
|
|
|
7934
8386
|
];
|
|
7935
8387
|
const getLetterByIndex = (index) => String.fromCharCode(97 + index);
|
|
7936
8388
|
const isDefaultVariant = variant == "default";
|
|
7937
|
-
return /* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
7939
|
-
/* @__PURE__ */
|
|
8389
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8390
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8391
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx38("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
7940
8392
|
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
7941
|
-
return /* @__PURE__ */
|
|
8393
|
+
return /* @__PURE__ */ jsxs31(
|
|
7942
8394
|
"section",
|
|
7943
8395
|
{
|
|
7944
8396
|
className: "flex flex-col gap-2",
|
|
7945
8397
|
children: [
|
|
7946
|
-
/* @__PURE__ */
|
|
8398
|
+
/* @__PURE__ */ jsxs31(
|
|
7947
8399
|
"div",
|
|
7948
8400
|
{
|
|
7949
8401
|
className: cn(
|
|
@@ -7951,20 +8403,20 @@ var QuizTrueOrFalse = ({
|
|
|
7951
8403
|
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
7952
8404
|
),
|
|
7953
8405
|
children: [
|
|
7954
|
-
/* @__PURE__ */
|
|
7955
|
-
isDefaultVariant ? /* @__PURE__ */
|
|
7956
|
-
/* @__PURE__ */
|
|
7957
|
-
/* @__PURE__ */
|
|
7958
|
-
/* @__PURE__ */
|
|
7959
|
-
/* @__PURE__ */
|
|
8406
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
8407
|
+
isDefaultVariant ? /* @__PURE__ */ jsxs31(Select_default, { size: "medium", children: [
|
|
8408
|
+
/* @__PURE__ */ jsx38(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ jsx38(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
8409
|
+
/* @__PURE__ */ jsxs31(SelectContent, { children: [
|
|
8410
|
+
/* @__PURE__ */ jsx38(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
8411
|
+
/* @__PURE__ */ jsx38(SelectItem, { value: "F", children: "Falso" })
|
|
7960
8412
|
] })
|
|
7961
|
-
] }) : /* @__PURE__ */
|
|
8413
|
+
] }) : /* @__PURE__ */ jsx38("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
7962
8414
|
]
|
|
7963
8415
|
}
|
|
7964
8416
|
),
|
|
7965
|
-
!isDefaultVariant && /* @__PURE__ */
|
|
7966
|
-
/* @__PURE__ */
|
|
7967
|
-
!option.isCorrect && /* @__PURE__ */
|
|
8417
|
+
!isDefaultVariant && /* @__PURE__ */ jsxs31("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
8418
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
8419
|
+
!option.isCorrect && /* @__PURE__ */ jsx38("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
7968
8420
|
] })
|
|
7969
8421
|
]
|
|
7970
8422
|
},
|
|
@@ -8027,7 +8479,7 @@ var QuizConnectDots = ({
|
|
|
8027
8479
|
isCorrect: false
|
|
8028
8480
|
}
|
|
8029
8481
|
];
|
|
8030
|
-
const [userAnswers, setUserAnswers] =
|
|
8482
|
+
const [userAnswers, setUserAnswers] = useState15(() => {
|
|
8031
8483
|
if (variant === "result") {
|
|
8032
8484
|
return mockUserAnswers;
|
|
8033
8485
|
}
|
|
@@ -8056,13 +8508,13 @@ var QuizConnectDots = ({
|
|
|
8056
8508
|
const assignedDots = new Set(
|
|
8057
8509
|
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
8058
8510
|
);
|
|
8059
|
-
return /* @__PURE__ */
|
|
8060
|
-
/* @__PURE__ */
|
|
8061
|
-
/* @__PURE__ */
|
|
8511
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8512
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8513
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx38("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
8062
8514
|
const answer = userAnswers[index];
|
|
8063
8515
|
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
8064
|
-
return /* @__PURE__ */
|
|
8065
|
-
/* @__PURE__ */
|
|
8516
|
+
return /* @__PURE__ */ jsxs31("section", { className: "flex flex-col gap-2", children: [
|
|
8517
|
+
/* @__PURE__ */ jsxs31(
|
|
8066
8518
|
"div",
|
|
8067
8519
|
{
|
|
8068
8520
|
className: cn(
|
|
@@ -8070,30 +8522,30 @@ var QuizConnectDots = ({
|
|
|
8070
8522
|
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
8071
8523
|
),
|
|
8072
8524
|
children: [
|
|
8073
|
-
/* @__PURE__ */
|
|
8074
|
-
isDefaultVariant ? /* @__PURE__ */
|
|
8525
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
8526
|
+
isDefaultVariant ? /* @__PURE__ */ jsxs31(
|
|
8075
8527
|
Select_default,
|
|
8076
8528
|
{
|
|
8077
8529
|
size: "medium",
|
|
8078
8530
|
value: answer.dotOption || void 0,
|
|
8079
8531
|
onValueChange: (value) => handleSelectDot(index, value),
|
|
8080
8532
|
children: [
|
|
8081
|
-
/* @__PURE__ */
|
|
8082
|
-
/* @__PURE__ */
|
|
8533
|
+
/* @__PURE__ */ jsx38(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ jsx38(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
8534
|
+
/* @__PURE__ */ jsx38(SelectContent, { children: dotsOptions.filter(
|
|
8083
8535
|
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
8084
|
-
).map((dot) => /* @__PURE__ */
|
|
8536
|
+
).map((dot) => /* @__PURE__ */ jsx38(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
8085
8537
|
]
|
|
8086
8538
|
}
|
|
8087
|
-
) : /* @__PURE__ */
|
|
8539
|
+
) : /* @__PURE__ */ jsx38("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
8088
8540
|
]
|
|
8089
8541
|
}
|
|
8090
8542
|
),
|
|
8091
|
-
!isDefaultVariant && /* @__PURE__ */
|
|
8092
|
-
/* @__PURE__ */
|
|
8543
|
+
!isDefaultVariant && /* @__PURE__ */ jsxs31("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
8544
|
+
/* @__PURE__ */ jsxs31("p", { className: "text-text-800 text-2xs", children: [
|
|
8093
8545
|
"Resposta selecionada: ",
|
|
8094
8546
|
answer.dotOption || "Nenhuma"
|
|
8095
8547
|
] }),
|
|
8096
|
-
!answer.isCorrect && /* @__PURE__ */
|
|
8548
|
+
!answer.isCorrect && /* @__PURE__ */ jsxs31("p", { className: "text-text-800 text-2xs", children: [
|
|
8097
8549
|
"Resposta correta: ",
|
|
8098
8550
|
answer.correctOption
|
|
8099
8551
|
] })
|
|
@@ -8148,7 +8600,7 @@ var QuizFill = ({
|
|
|
8148
8600
|
isCorrect: true
|
|
8149
8601
|
}
|
|
8150
8602
|
];
|
|
8151
|
-
const [answers, setAnswers] =
|
|
8603
|
+
const [answers, setAnswers] = useState15({});
|
|
8152
8604
|
const baseId = useId10();
|
|
8153
8605
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
8154
8606
|
const usedOptions = Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value);
|
|
@@ -8162,18 +8614,18 @@ var QuizFill = ({
|
|
|
8162
8614
|
const mockAnswer = mockUserAnswers.find(
|
|
8163
8615
|
(answer) => answer.selectId === selectId
|
|
8164
8616
|
);
|
|
8165
|
-
return /* @__PURE__ */
|
|
8617
|
+
return /* @__PURE__ */ jsx38("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
8166
8618
|
};
|
|
8167
8619
|
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
8168
|
-
return /* @__PURE__ */
|
|
8620
|
+
return /* @__PURE__ */ jsxs31(
|
|
8169
8621
|
Select_default,
|
|
8170
8622
|
{
|
|
8171
8623
|
value: selectedValue,
|
|
8172
8624
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
8173
8625
|
className: "inline-flex mb-2.5",
|
|
8174
8626
|
children: [
|
|
8175
|
-
/* @__PURE__ */
|
|
8176
|
-
/* @__PURE__ */
|
|
8627
|
+
/* @__PURE__ */ jsx38(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-white border-gray-300", children: /* @__PURE__ */ jsx38(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
8628
|
+
/* @__PURE__ */ jsx38(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ jsx38(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
8177
8629
|
]
|
|
8178
8630
|
},
|
|
8179
8631
|
`${selectId}-${startIndex}`
|
|
@@ -8185,8 +8637,8 @@ var QuizFill = ({
|
|
|
8185
8637
|
);
|
|
8186
8638
|
if (!mockAnswer) return null;
|
|
8187
8639
|
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
8188
|
-
const icon = mockAnswer.isCorrect ? /* @__PURE__ */
|
|
8189
|
-
return /* @__PURE__ */
|
|
8640
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ jsx38(CheckCircle6, {}) : /* @__PURE__ */ jsx38(XCircle5, {});
|
|
8641
|
+
return /* @__PURE__ */ jsx38(
|
|
8190
8642
|
Badge_default,
|
|
8191
8643
|
{
|
|
8192
8644
|
variant: "solid",
|
|
@@ -8194,7 +8646,7 @@ var QuizFill = ({
|
|
|
8194
8646
|
iconRight: icon,
|
|
8195
8647
|
size: "large",
|
|
8196
8648
|
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
8197
|
-
children: /* @__PURE__ */
|
|
8649
|
+
children: /* @__PURE__ */ jsx38("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
8198
8650
|
},
|
|
8199
8651
|
selectId
|
|
8200
8652
|
);
|
|
@@ -8250,25 +8702,25 @@ var QuizFill = ({
|
|
|
8250
8702
|
}
|
|
8251
8703
|
return elements;
|
|
8252
8704
|
};
|
|
8253
|
-
return /* @__PURE__ */
|
|
8254
|
-
/* @__PURE__ */
|
|
8255
|
-
/* @__PURE__ */
|
|
8705
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8706
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8707
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ jsx38("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ jsx38(
|
|
8256
8708
|
"div",
|
|
8257
8709
|
{
|
|
8258
8710
|
className: cn(
|
|
8259
8711
|
"text-lg text-text-900 leading-8 h-auto",
|
|
8260
8712
|
variant != "result" && paddingBottom
|
|
8261
8713
|
),
|
|
8262
|
-
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */
|
|
8714
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ jsx38("span", { children: element.element }, element.id))
|
|
8263
8715
|
}
|
|
8264
8716
|
) }) }),
|
|
8265
|
-
variant === "result" && /* @__PURE__ */
|
|
8266
|
-
/* @__PURE__ */
|
|
8267
|
-
/* @__PURE__ */
|
|
8717
|
+
variant === "result" && /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8718
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Resultado" }),
|
|
8719
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ jsx38("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ jsx38(
|
|
8268
8720
|
"div",
|
|
8269
8721
|
{
|
|
8270
8722
|
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
8271
|
-
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */
|
|
8723
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ jsx38("span", { children: element.element }, element.id))
|
|
8272
8724
|
}
|
|
8273
8725
|
) }) })
|
|
8274
8726
|
] })
|
|
@@ -8288,7 +8740,7 @@ var QuizImageQuestion = ({
|
|
|
8288
8740
|
};
|
|
8289
8741
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
8290
8742
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
8291
|
-
const [clickPositionRelative, setClickPositionRelative] =
|
|
8743
|
+
const [clickPositionRelative, setClickPositionRelative] = useState15(variant == "result" ? mockUserAnswerRelative : null);
|
|
8292
8744
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
8293
8745
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
8294
8746
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -8324,36 +8776,36 @@ var QuizImageQuestion = ({
|
|
|
8324
8776
|
}
|
|
8325
8777
|
return "bg-success-600/70 border-white";
|
|
8326
8778
|
};
|
|
8327
|
-
return /* @__PURE__ */
|
|
8328
|
-
/* @__PURE__ */
|
|
8329
|
-
/* @__PURE__ */
|
|
8779
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
8780
|
+
/* @__PURE__ */ jsx38(QuizSubTitle, { subTitle: "Clique na \xE1rea correta" }),
|
|
8781
|
+
/* @__PURE__ */ jsx38(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsxs31(
|
|
8330
8782
|
"div",
|
|
8331
8783
|
{
|
|
8332
8784
|
"data-testid": "quiz-image-container",
|
|
8333
8785
|
className: "space-y-6 p-3 relative inline-block",
|
|
8334
8786
|
children: [
|
|
8335
|
-
variant == "result" && /* @__PURE__ */
|
|
8787
|
+
variant == "result" && /* @__PURE__ */ jsxs31(
|
|
8336
8788
|
"div",
|
|
8337
8789
|
{
|
|
8338
8790
|
"data-testid": "quiz-legend",
|
|
8339
8791
|
className: "flex items-center gap-4 text-xs",
|
|
8340
8792
|
children: [
|
|
8341
|
-
/* @__PURE__ */
|
|
8342
|
-
/* @__PURE__ */
|
|
8343
|
-
/* @__PURE__ */
|
|
8793
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
8794
|
+
/* @__PURE__ */ jsx38("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
8795
|
+
/* @__PURE__ */ jsx38("span", { className: "text-text-600 font-medium text-sm", children: "\xC1rea correta" })
|
|
8344
8796
|
] }),
|
|
8345
|
-
/* @__PURE__ */
|
|
8346
|
-
/* @__PURE__ */
|
|
8347
|
-
/* @__PURE__ */
|
|
8797
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
8798
|
+
/* @__PURE__ */ jsx38("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
8799
|
+
/* @__PURE__ */ jsx38("span", { className: "text-text-600 font-medium text-sm", children: "Resposta correta" })
|
|
8348
8800
|
] }),
|
|
8349
|
-
/* @__PURE__ */
|
|
8350
|
-
/* @__PURE__ */
|
|
8351
|
-
/* @__PURE__ */
|
|
8801
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
8802
|
+
/* @__PURE__ */ jsx38("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
8803
|
+
/* @__PURE__ */ jsx38("span", { className: "text-text-600 font-medium text-sm", children: "Resposta incorreta" })
|
|
8352
8804
|
] })
|
|
8353
8805
|
]
|
|
8354
8806
|
}
|
|
8355
8807
|
),
|
|
8356
|
-
/* @__PURE__ */
|
|
8808
|
+
/* @__PURE__ */ jsxs31(
|
|
8357
8809
|
"button",
|
|
8358
8810
|
{
|
|
8359
8811
|
"data-testid": "quiz-image-button",
|
|
@@ -8368,7 +8820,7 @@ var QuizImageQuestion = ({
|
|
|
8368
8820
|
},
|
|
8369
8821
|
"aria-label": "\xC1rea da imagem interativa",
|
|
8370
8822
|
children: [
|
|
8371
|
-
/* @__PURE__ */
|
|
8823
|
+
/* @__PURE__ */ jsx38(
|
|
8372
8824
|
"img",
|
|
8373
8825
|
{
|
|
8374
8826
|
"data-testid": "quiz-image",
|
|
@@ -8377,7 +8829,7 @@ var QuizImageQuestion = ({
|
|
|
8377
8829
|
className: "w-full h-auto rounded-md"
|
|
8378
8830
|
}
|
|
8379
8831
|
),
|
|
8380
|
-
variant === "result" && /* @__PURE__ */
|
|
8832
|
+
variant === "result" && /* @__PURE__ */ jsx38(
|
|
8381
8833
|
"div",
|
|
8382
8834
|
{
|
|
8383
8835
|
"data-testid": "quiz-correct-circle",
|
|
@@ -8392,7 +8844,7 @@ var QuizImageQuestion = ({
|
|
|
8392
8844
|
}
|
|
8393
8845
|
}
|
|
8394
8846
|
),
|
|
8395
|
-
clickPositionRelative && /* @__PURE__ */
|
|
8847
|
+
clickPositionRelative && /* @__PURE__ */ jsx38(
|
|
8396
8848
|
"div",
|
|
8397
8849
|
{
|
|
8398
8850
|
"data-testid": "quiz-user-circle",
|
|
@@ -8460,16 +8912,16 @@ var QuizQuestionList = ({
|
|
|
8460
8912
|
return "Em branco";
|
|
8461
8913
|
}
|
|
8462
8914
|
};
|
|
8463
|
-
return /* @__PURE__ */
|
|
8464
|
-
([subjectId, questions]) => /* @__PURE__ */
|
|
8465
|
-
/* @__PURE__ */
|
|
8466
|
-
/* @__PURE__ */
|
|
8467
|
-
/* @__PURE__ */
|
|
8915
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-6 px-4", children: Object.entries(filteredGroupedQuestions).map(
|
|
8916
|
+
([subjectId, questions]) => /* @__PURE__ */ jsxs31("section", { className: "flex flex-col gap-2", children: [
|
|
8917
|
+
/* @__PURE__ */ jsxs31("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
8918
|
+
/* @__PURE__ */ jsx38("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ jsx38(BookOpen, { size: 17, className: "text-white" }) }),
|
|
8919
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-800 font-bold text-lg", children: subjectId })
|
|
8468
8920
|
] }),
|
|
8469
|
-
/* @__PURE__ */
|
|
8921
|
+
/* @__PURE__ */ jsx38("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
8470
8922
|
const status = getQuestionStatus(question.id);
|
|
8471
8923
|
const questionNumber = getQuestionIndex(question.id);
|
|
8472
|
-
return /* @__PURE__ */
|
|
8924
|
+
return /* @__PURE__ */ jsx38(
|
|
8473
8925
|
CardStatus,
|
|
8474
8926
|
{
|
|
8475
8927
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -8491,7 +8943,6 @@ var QuizFooter = forwardRef19(
|
|
|
8491
8943
|
onGoToSimulated,
|
|
8492
8944
|
onDetailResult,
|
|
8493
8945
|
handleFinishSimulated,
|
|
8494
|
-
variant = "default",
|
|
8495
8946
|
...props
|
|
8496
8947
|
}, ref) => {
|
|
8497
8948
|
const {
|
|
@@ -8505,6 +8956,7 @@ var QuizFooter = forwardRef19(
|
|
|
8505
8956
|
skipQuestion,
|
|
8506
8957
|
getCurrentQuestion,
|
|
8507
8958
|
getQuestionStatusFromUserAnswers,
|
|
8959
|
+
variant,
|
|
8508
8960
|
getActiveQuiz
|
|
8509
8961
|
} = useQuizStore();
|
|
8510
8962
|
const totalQuestions = getTotalQuestions();
|
|
@@ -8513,10 +8965,11 @@ var QuizFooter = forwardRef19(
|
|
|
8513
8965
|
const currentAnswer = getCurrentAnswer();
|
|
8514
8966
|
const currentQuestion = getCurrentQuestion();
|
|
8515
8967
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
8516
|
-
const [alertDialogOpen, setAlertDialogOpen] =
|
|
8517
|
-
const [modalResultOpen, setModalResultOpen] =
|
|
8518
|
-
const [modalNavigateOpen, setModalNavigateOpen] =
|
|
8519
|
-
const [
|
|
8968
|
+
const [alertDialogOpen, setAlertDialogOpen] = useState15(false);
|
|
8969
|
+
const [modalResultOpen, setModalResultOpen] = useState15(false);
|
|
8970
|
+
const [modalNavigateOpen, setModalNavigateOpen] = useState15(false);
|
|
8971
|
+
const [modalResolutionOpen, setModalResolutionOpen] = useState15(false);
|
|
8972
|
+
const [filterType, setFilterType] = useState15("all");
|
|
8520
8973
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
8521
8974
|
const userAnswers = getUserAnswers();
|
|
8522
8975
|
const allQuestions = getTotalQuestions();
|
|
@@ -8548,8 +9001,8 @@ var QuizFooter = forwardRef19(
|
|
|
8548
9001
|
setAlertDialogOpen(false);
|
|
8549
9002
|
}
|
|
8550
9003
|
};
|
|
8551
|
-
return /* @__PURE__ */
|
|
8552
|
-
/* @__PURE__ */
|
|
9004
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
9005
|
+
/* @__PURE__ */ jsx38(
|
|
8553
9006
|
"footer",
|
|
8554
9007
|
{
|
|
8555
9008
|
ref,
|
|
@@ -8558,17 +9011,17 @@ var QuizFooter = forwardRef19(
|
|
|
8558
9011
|
className
|
|
8559
9012
|
),
|
|
8560
9013
|
...props,
|
|
8561
|
-
children: variant === "default" ? /* @__PURE__ */
|
|
8562
|
-
/* @__PURE__ */
|
|
8563
|
-
/* @__PURE__ */
|
|
9014
|
+
children: variant === "default" ? /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
9015
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-1", children: [
|
|
9016
|
+
/* @__PURE__ */ jsx38(
|
|
8564
9017
|
IconButton_default,
|
|
8565
9018
|
{
|
|
8566
|
-
icon: /* @__PURE__ */
|
|
9019
|
+
icon: /* @__PURE__ */ jsx38(SquaresFour, { size: 24, className: "text-text-950" }),
|
|
8567
9020
|
size: "md",
|
|
8568
9021
|
onClick: () => setModalNavigateOpen(true)
|
|
8569
9022
|
}
|
|
8570
9023
|
),
|
|
8571
|
-
isFirstQuestion ? /* @__PURE__ */
|
|
9024
|
+
isFirstQuestion ? /* @__PURE__ */ jsx38(
|
|
8572
9025
|
Button_default,
|
|
8573
9026
|
{
|
|
8574
9027
|
variant: "outline",
|
|
@@ -8579,13 +9032,13 @@ var QuizFooter = forwardRef19(
|
|
|
8579
9032
|
},
|
|
8580
9033
|
children: "Pular"
|
|
8581
9034
|
}
|
|
8582
|
-
) : /* @__PURE__ */
|
|
9035
|
+
) : /* @__PURE__ */ jsx38(
|
|
8583
9036
|
Button_default,
|
|
8584
9037
|
{
|
|
8585
9038
|
size: "medium",
|
|
8586
9039
|
variant: "link",
|
|
8587
9040
|
action: "primary",
|
|
8588
|
-
iconLeft: /* @__PURE__ */
|
|
9041
|
+
iconLeft: /* @__PURE__ */ jsx38(CaretLeft3, { size: 18 }),
|
|
8589
9042
|
onClick: () => {
|
|
8590
9043
|
goToPreviousQuestion();
|
|
8591
9044
|
},
|
|
@@ -8593,7 +9046,7 @@ var QuizFooter = forwardRef19(
|
|
|
8593
9046
|
}
|
|
8594
9047
|
)
|
|
8595
9048
|
] }),
|
|
8596
|
-
!isFirstQuestion && /* @__PURE__ */
|
|
9049
|
+
!isFirstQuestion && /* @__PURE__ */ jsx38(
|
|
8597
9050
|
Button_default,
|
|
8598
9051
|
{
|
|
8599
9052
|
size: "small",
|
|
@@ -8606,7 +9059,7 @@ var QuizFooter = forwardRef19(
|
|
|
8606
9059
|
children: "Pular"
|
|
8607
9060
|
}
|
|
8608
9061
|
),
|
|
8609
|
-
isLastQuestion ? /* @__PURE__ */
|
|
9062
|
+
isLastQuestion ? /* @__PURE__ */ jsx38(
|
|
8610
9063
|
Button_default,
|
|
8611
9064
|
{
|
|
8612
9065
|
size: "medium",
|
|
@@ -8616,13 +9069,13 @@ var QuizFooter = forwardRef19(
|
|
|
8616
9069
|
onClick: handleFinishQuiz,
|
|
8617
9070
|
children: "Finalizar"
|
|
8618
9071
|
}
|
|
8619
|
-
) : /* @__PURE__ */
|
|
9072
|
+
) : /* @__PURE__ */ jsx38(
|
|
8620
9073
|
Button_default,
|
|
8621
9074
|
{
|
|
8622
9075
|
size: "medium",
|
|
8623
9076
|
variant: "link",
|
|
8624
9077
|
action: "primary",
|
|
8625
|
-
iconRight: /* @__PURE__ */
|
|
9078
|
+
iconRight: /* @__PURE__ */ jsx38(CaretRight4, { size: 18 }),
|
|
8626
9079
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
8627
9080
|
onClick: () => {
|
|
8628
9081
|
goToNextQuestion();
|
|
@@ -8630,10 +9083,19 @@ var QuizFooter = forwardRef19(
|
|
|
8630
9083
|
children: "Avan\xE7ar"
|
|
8631
9084
|
}
|
|
8632
9085
|
)
|
|
8633
|
-
] }) : /* @__PURE__ */
|
|
9086
|
+
] }) : /* @__PURE__ */ jsx38("div", { className: "flex flex-row items-center justify-end w-full", children: /* @__PURE__ */ jsx38(
|
|
9087
|
+
Button_default,
|
|
9088
|
+
{
|
|
9089
|
+
variant: "solid",
|
|
9090
|
+
action: "primary",
|
|
9091
|
+
size: "medium",
|
|
9092
|
+
onClick: () => setModalResolutionOpen(true),
|
|
9093
|
+
children: "Ver Resolu\xE7\xE3o"
|
|
9094
|
+
}
|
|
9095
|
+
) })
|
|
8634
9096
|
}
|
|
8635
9097
|
),
|
|
8636
|
-
/* @__PURE__ */
|
|
9098
|
+
/* @__PURE__ */ jsx38(
|
|
8637
9099
|
AlertDialog,
|
|
8638
9100
|
{
|
|
8639
9101
|
isOpen: alertDialogOpen,
|
|
@@ -8645,7 +9107,7 @@ var QuizFooter = forwardRef19(
|
|
|
8645
9107
|
onSubmit: handleAlertSubmit
|
|
8646
9108
|
}
|
|
8647
9109
|
),
|
|
8648
|
-
/* @__PURE__ */
|
|
9110
|
+
/* @__PURE__ */ jsx38(
|
|
8649
9111
|
Modal_default,
|
|
8650
9112
|
{
|
|
8651
9113
|
isOpen: modalResultOpen,
|
|
@@ -8655,8 +9117,8 @@ var QuizFooter = forwardRef19(
|
|
|
8655
9117
|
closeOnEscape: false,
|
|
8656
9118
|
hideCloseButton: true,
|
|
8657
9119
|
size: "md",
|
|
8658
|
-
children: /* @__PURE__ */
|
|
8659
|
-
/* @__PURE__ */
|
|
9120
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
9121
|
+
/* @__PURE__ */ jsx38(
|
|
8660
9122
|
"img",
|
|
8661
9123
|
{
|
|
8662
9124
|
src: simulated_result_default,
|
|
@@ -8664,9 +9126,9 @@ var QuizFooter = forwardRef19(
|
|
|
8664
9126
|
className: "w-[282px] h-auto object-cover"
|
|
8665
9127
|
}
|
|
8666
9128
|
),
|
|
8667
|
-
/* @__PURE__ */
|
|
8668
|
-
/* @__PURE__ */
|
|
8669
|
-
/* @__PURE__ */
|
|
9129
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
9130
|
+
/* @__PURE__ */ jsx38("h2", { className: "text-text-950 font-bold text-lg", children: "Voc\xEA concluiu o simulado!" }),
|
|
9131
|
+
/* @__PURE__ */ jsxs31("p", { className: "text-text-500 font-sm", children: [
|
|
8670
9132
|
"Voc\xEA acertou",
|
|
8671
9133
|
" ",
|
|
8672
9134
|
(() => {
|
|
@@ -8688,8 +9150,8 @@ var QuizFooter = forwardRef19(
|
|
|
8688
9150
|
" quest\xF5es."
|
|
8689
9151
|
] })
|
|
8690
9152
|
] }),
|
|
8691
|
-
/* @__PURE__ */
|
|
8692
|
-
/* @__PURE__ */
|
|
9153
|
+
/* @__PURE__ */ jsxs31("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
9154
|
+
/* @__PURE__ */ jsx38(
|
|
8693
9155
|
Button_default,
|
|
8694
9156
|
{
|
|
8695
9157
|
variant: "outline",
|
|
@@ -8699,31 +9161,31 @@ var QuizFooter = forwardRef19(
|
|
|
8699
9161
|
children: "Ir para simulados"
|
|
8700
9162
|
}
|
|
8701
9163
|
),
|
|
8702
|
-
/* @__PURE__ */
|
|
9164
|
+
/* @__PURE__ */ jsx38(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
8703
9165
|
] })
|
|
8704
9166
|
] })
|
|
8705
9167
|
}
|
|
8706
9168
|
),
|
|
8707
|
-
/* @__PURE__ */
|
|
9169
|
+
/* @__PURE__ */ jsx38(
|
|
8708
9170
|
Modal_default,
|
|
8709
9171
|
{
|
|
8710
9172
|
isOpen: modalNavigateOpen,
|
|
8711
9173
|
onClose: () => setModalNavigateOpen(false),
|
|
8712
9174
|
title: "Quest\xF5es",
|
|
8713
9175
|
size: "lg",
|
|
8714
|
-
children: /* @__PURE__ */
|
|
8715
|
-
/* @__PURE__ */
|
|
8716
|
-
/* @__PURE__ */
|
|
8717
|
-
/* @__PURE__ */
|
|
8718
|
-
/* @__PURE__ */
|
|
8719
|
-
/* @__PURE__ */
|
|
8720
|
-
/* @__PURE__ */
|
|
8721
|
-
/* @__PURE__ */
|
|
8722
|
-
/* @__PURE__ */
|
|
9176
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col w-full h-full", children: [
|
|
9177
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200", children: [
|
|
9178
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
9179
|
+
/* @__PURE__ */ jsx38("span", { className: "max-w-[266px]", children: /* @__PURE__ */ jsxs31(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
9180
|
+
/* @__PURE__ */ jsx38(SelectTrigger, { variant: "rounded", className: "max-w-[266px]", children: /* @__PURE__ */ jsx38(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" }) }),
|
|
9181
|
+
/* @__PURE__ */ jsxs31(SelectContent, { children: [
|
|
9182
|
+
/* @__PURE__ */ jsx38(SelectItem, { value: "all", children: "Todas" }),
|
|
9183
|
+
/* @__PURE__ */ jsx38(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
9184
|
+
/* @__PURE__ */ jsx38(SelectItem, { value: "answered", children: "Respondidas" })
|
|
8723
9185
|
] })
|
|
8724
9186
|
] }) })
|
|
8725
9187
|
] }),
|
|
8726
|
-
/* @__PURE__ */
|
|
9188
|
+
/* @__PURE__ */ jsx38("div", { className: "flex flex-col gap-2 not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] overflow-y-auto", children: /* @__PURE__ */ jsx38(
|
|
8727
9189
|
QuizQuestionList,
|
|
8728
9190
|
{
|
|
8729
9191
|
filterType,
|
|
@@ -8732,21 +9194,31 @@ var QuizFooter = forwardRef19(
|
|
|
8732
9194
|
) })
|
|
8733
9195
|
] })
|
|
8734
9196
|
}
|
|
9197
|
+
),
|
|
9198
|
+
/* @__PURE__ */ jsx38(
|
|
9199
|
+
Modal_default,
|
|
9200
|
+
{
|
|
9201
|
+
isOpen: modalResolutionOpen,
|
|
9202
|
+
onClose: () => setModalResolutionOpen(false),
|
|
9203
|
+
title: "Resolu\xE7\xE3o",
|
|
9204
|
+
size: "lg",
|
|
9205
|
+
children: currentQuestion?.answerKey
|
|
9206
|
+
}
|
|
8735
9207
|
)
|
|
8736
9208
|
] });
|
|
8737
9209
|
}
|
|
8738
9210
|
);
|
|
8739
9211
|
var QuizResultHeaderTitle = forwardRef19(({ className, ...props }, ref) => {
|
|
8740
9212
|
const { bySimulated } = useQuizStore();
|
|
8741
|
-
return /* @__PURE__ */
|
|
9213
|
+
return /* @__PURE__ */ jsxs31(
|
|
8742
9214
|
"div",
|
|
8743
9215
|
{
|
|
8744
9216
|
ref,
|
|
8745
9217
|
className: cn("flex flex-row pt-4 justify-between", className),
|
|
8746
9218
|
...props,
|
|
8747
9219
|
children: [
|
|
8748
|
-
/* @__PURE__ */
|
|
8749
|
-
bySimulated && /* @__PURE__ */
|
|
9220
|
+
/* @__PURE__ */ jsx38("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
9221
|
+
bySimulated && /* @__PURE__ */ jsx38(Badge_default, { variant: "solid", action: "info", children: bySimulated.category })
|
|
8750
9222
|
]
|
|
8751
9223
|
}
|
|
8752
9224
|
);
|
|
@@ -8754,7 +9226,7 @@ var QuizResultHeaderTitle = forwardRef19(({ className, ...props }, ref) => {
|
|
|
8754
9226
|
var QuizResultTitle = forwardRef19(({ className, ...props }, ref) => {
|
|
8755
9227
|
const { getQuizTitle } = useQuizStore();
|
|
8756
9228
|
const quizTitle = getQuizTitle();
|
|
8757
|
-
return /* @__PURE__ */
|
|
9229
|
+
return /* @__PURE__ */ jsx38(
|
|
8758
9230
|
"p",
|
|
8759
9231
|
{
|
|
8760
9232
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -8769,7 +9241,7 @@ var QuizResultPerformance = forwardRef19(
|
|
|
8769
9241
|
const {
|
|
8770
9242
|
getTotalQuestions,
|
|
8771
9243
|
timeElapsed,
|
|
8772
|
-
formatTime,
|
|
9244
|
+
formatTime: formatTime2,
|
|
8773
9245
|
bySimulated,
|
|
8774
9246
|
byActivity,
|
|
8775
9247
|
byQuestionary,
|
|
@@ -8810,15 +9282,15 @@ var QuizResultPerformance = forwardRef19(
|
|
|
8810
9282
|
});
|
|
8811
9283
|
}
|
|
8812
9284
|
const percentage = totalQuestions > 0 ? Math.round(correctAnswers / totalQuestions * 100) : 0;
|
|
8813
|
-
return /* @__PURE__ */
|
|
9285
|
+
return /* @__PURE__ */ jsxs31(
|
|
8814
9286
|
"div",
|
|
8815
9287
|
{
|
|
8816
9288
|
className: "flex flex-row gap-6 p-6 rounded-xl bg-background justify-between",
|
|
8817
9289
|
ref,
|
|
8818
9290
|
...props,
|
|
8819
9291
|
children: [
|
|
8820
|
-
/* @__PURE__ */
|
|
8821
|
-
/* @__PURE__ */
|
|
9292
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative", children: [
|
|
9293
|
+
/* @__PURE__ */ jsx38(
|
|
8822
9294
|
ProgressCircle_default,
|
|
8823
9295
|
{
|
|
8824
9296
|
size: "medium",
|
|
@@ -8828,21 +9300,21 @@ var QuizResultPerformance = forwardRef19(
|
|
|
8828
9300
|
label: ""
|
|
8829
9301
|
}
|
|
8830
9302
|
),
|
|
8831
|
-
/* @__PURE__ */
|
|
8832
|
-
/* @__PURE__ */
|
|
8833
|
-
/* @__PURE__ */
|
|
8834
|
-
/* @__PURE__ */
|
|
9303
|
+
/* @__PURE__ */ jsxs31("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
9304
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
9305
|
+
/* @__PURE__ */ jsx38(Clock2, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
9306
|
+
/* @__PURE__ */ jsx38("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(timeElapsed) })
|
|
8835
9307
|
] }),
|
|
8836
|
-
/* @__PURE__ */
|
|
9308
|
+
/* @__PURE__ */ jsxs31("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
8837
9309
|
correctAnswers,
|
|
8838
9310
|
" de ",
|
|
8839
9311
|
totalQuestions
|
|
8840
9312
|
] }),
|
|
8841
|
-
/* @__PURE__ */
|
|
9313
|
+
/* @__PURE__ */ jsx38("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
8842
9314
|
] })
|
|
8843
9315
|
] }),
|
|
8844
|
-
/* @__PURE__ */
|
|
8845
|
-
/* @__PURE__ */
|
|
9316
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
9317
|
+
/* @__PURE__ */ jsx38(
|
|
8846
9318
|
ProgressBar_default,
|
|
8847
9319
|
{
|
|
8848
9320
|
className: "w-full",
|
|
@@ -8856,7 +9328,7 @@ var QuizResultPerformance = forwardRef19(
|
|
|
8856
9328
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
8857
9329
|
}
|
|
8858
9330
|
),
|
|
8859
|
-
/* @__PURE__ */
|
|
9331
|
+
/* @__PURE__ */ jsx38(
|
|
8860
9332
|
ProgressBar_default,
|
|
8861
9333
|
{
|
|
8862
9334
|
className: "w-full",
|
|
@@ -8870,7 +9342,7 @@ var QuizResultPerformance = forwardRef19(
|
|
|
8870
9342
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
8871
9343
|
}
|
|
8872
9344
|
),
|
|
8873
|
-
/* @__PURE__ */
|
|
9345
|
+
/* @__PURE__ */ jsx38(
|
|
8874
9346
|
ProgressBar_default,
|
|
8875
9347
|
{
|
|
8876
9348
|
className: "w-full",
|
|
@@ -8919,9 +9391,9 @@ var QuizListResult = forwardRef19(({ className, onSubjectClick, ...props }, ref)
|
|
|
8919
9391
|
};
|
|
8920
9392
|
}
|
|
8921
9393
|
);
|
|
8922
|
-
return /* @__PURE__ */
|
|
8923
|
-
/* @__PURE__ */
|
|
8924
|
-
/* @__PURE__ */
|
|
9394
|
+
return /* @__PURE__ */ jsxs31("section", { ref, className, ...props, children: [
|
|
9395
|
+
/* @__PURE__ */ jsx38("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
9396
|
+
/* @__PURE__ */ jsx38("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ jsx38("li", { children: /* @__PURE__ */ jsx38(
|
|
8925
9397
|
CardResults,
|
|
8926
9398
|
{
|
|
8927
9399
|
onClick: () => onSubjectClick?.(subject.subject),
|
|
@@ -8929,7 +9401,7 @@ var QuizListResult = forwardRef19(({ className, onSubjectClick, ...props }, ref)
|
|
|
8929
9401
|
header: subject.subject,
|
|
8930
9402
|
correct_answers: subject.correct,
|
|
8931
9403
|
incorrect_answers: subject.incorrect,
|
|
8932
|
-
icon: /* @__PURE__ */
|
|
9404
|
+
icon: /* @__PURE__ */ jsx38(Book, { size: 20 }),
|
|
8933
9405
|
direction: "row"
|
|
8934
9406
|
}
|
|
8935
9407
|
) }, subject.subject)) })
|
|
@@ -8946,13 +9418,13 @@ var QuizListResultByMateria = ({
|
|
|
8946
9418
|
} = useQuizStore();
|
|
8947
9419
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
8948
9420
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
8949
|
-
return /* @__PURE__ */
|
|
8950
|
-
/* @__PURE__ */
|
|
8951
|
-
/* @__PURE__ */
|
|
8952
|
-
/* @__PURE__ */
|
|
8953
|
-
/* @__PURE__ */
|
|
9421
|
+
return /* @__PURE__ */ jsxs31("div", { className: "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6", children: [
|
|
9422
|
+
/* @__PURE__ */ jsx38("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ jsx38("p", { className: "text-text-950 font-bold text-2xl", children: subject }) }),
|
|
9423
|
+
/* @__PURE__ */ jsxs31("section", { className: "flex flex-col ", children: [
|
|
9424
|
+
/* @__PURE__ */ jsx38("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
9425
|
+
/* @__PURE__ */ jsx38("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => {
|
|
8954
9426
|
const questionIndex = getQuestionIndex(question.id);
|
|
8955
|
-
return /* @__PURE__ */
|
|
9427
|
+
return /* @__PURE__ */ jsx38("li", { children: /* @__PURE__ */ jsx38(
|
|
8956
9428
|
CardStatus,
|
|
8957
9429
|
{
|
|
8958
9430
|
className: "max-w-full",
|
|
@@ -9064,6 +9536,7 @@ export {
|
|
|
9064
9536
|
TextArea_default as TextArea,
|
|
9065
9537
|
Toast_default as Toast,
|
|
9066
9538
|
Toaster_default as Toaster,
|
|
9539
|
+
VideoPlayer_default as VideoPlayer,
|
|
9067
9540
|
createZustandAuthAdapter,
|
|
9068
9541
|
getRootDomain,
|
|
9069
9542
|
getStatusBadge,
|