analytica-frontend-lib 1.2.7 → 1.2.9
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/Table/index.d.mts +51 -3
- package/dist/Table/index.d.ts +51 -3
- package/dist/Table/index.js +125 -22
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +129 -22
- package/dist/Table/index.mjs.map +1 -1
- package/dist/index.css +55 -16
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +189 -86
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +237 -130
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +55 -16
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6504,21 +6504,99 @@ var createNotificationsHook = (apiClient) => {
|
|
|
6504
6504
|
};
|
|
6505
6505
|
|
|
6506
6506
|
// src/components/Table/Table.tsx
|
|
6507
|
-
import {
|
|
6507
|
+
import {
|
|
6508
|
+
forwardRef as forwardRef14,
|
|
6509
|
+
useState as useState13,
|
|
6510
|
+
useMemo as useMemo5,
|
|
6511
|
+
useEffect as useEffect13
|
|
6512
|
+
} from "react";
|
|
6513
|
+
import { CaretUp, CaretDown } from "phosphor-react";
|
|
6508
6514
|
import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6515
|
+
function useTableSort(data, options = {}) {
|
|
6516
|
+
const { syncWithUrl = false } = options;
|
|
6517
|
+
const getInitialState = () => {
|
|
6518
|
+
if (!syncWithUrl || globalThis.window === void 0) {
|
|
6519
|
+
return { column: null, direction: null };
|
|
6520
|
+
}
|
|
6521
|
+
const params = new URLSearchParams(globalThis.location.search);
|
|
6522
|
+
const sortBy = params.get("sortBy");
|
|
6523
|
+
const sort = params.get("sort");
|
|
6524
|
+
if (sortBy && sort && (sort === "ASC" || sort === "DESC")) {
|
|
6525
|
+
return {
|
|
6526
|
+
column: sortBy,
|
|
6527
|
+
direction: sort.toLowerCase()
|
|
6528
|
+
};
|
|
6529
|
+
}
|
|
6530
|
+
return { column: null, direction: null };
|
|
6531
|
+
};
|
|
6532
|
+
const initialState = getInitialState();
|
|
6533
|
+
const [sortColumn, setSortColumn] = useState13(
|
|
6534
|
+
initialState.column
|
|
6535
|
+
);
|
|
6536
|
+
const [sortDirection, setSortDirection] = useState13(
|
|
6537
|
+
initialState.direction
|
|
6538
|
+
);
|
|
6539
|
+
useEffect13(() => {
|
|
6540
|
+
if (!syncWithUrl || globalThis.window === void 0) return;
|
|
6541
|
+
const url = new URL(globalThis.location.href);
|
|
6542
|
+
const params = url.searchParams;
|
|
6543
|
+
if (sortColumn && sortDirection) {
|
|
6544
|
+
params.set("sortBy", sortColumn);
|
|
6545
|
+
params.set("sort", sortDirection.toUpperCase());
|
|
6546
|
+
} else {
|
|
6547
|
+
params.delete("sortBy");
|
|
6548
|
+
params.delete("sort");
|
|
6549
|
+
}
|
|
6550
|
+
globalThis.history.replaceState({}, "", url.toString());
|
|
6551
|
+
}, [sortColumn, sortDirection, syncWithUrl]);
|
|
6552
|
+
const handleSort = (column) => {
|
|
6553
|
+
if (sortColumn === column) {
|
|
6554
|
+
if (sortDirection === "asc") {
|
|
6555
|
+
setSortDirection("desc");
|
|
6556
|
+
} else if (sortDirection === "desc") {
|
|
6557
|
+
setSortColumn(null);
|
|
6558
|
+
setSortDirection(null);
|
|
6559
|
+
}
|
|
6560
|
+
} else {
|
|
6561
|
+
setSortColumn(column);
|
|
6562
|
+
setSortDirection("asc");
|
|
6563
|
+
}
|
|
6564
|
+
};
|
|
6565
|
+
const sortedData = useMemo5(() => {
|
|
6566
|
+
if (!sortColumn || !sortDirection) {
|
|
6567
|
+
return data;
|
|
6568
|
+
}
|
|
6569
|
+
return [...data].sort((a, b) => {
|
|
6570
|
+
const aValue = a[sortColumn];
|
|
6571
|
+
const bValue = b[sortColumn];
|
|
6572
|
+
if (typeof aValue === "string" && typeof bValue === "string") {
|
|
6573
|
+
const comparison = aValue.localeCompare(bValue);
|
|
6574
|
+
return sortDirection === "asc" ? comparison : -comparison;
|
|
6575
|
+
}
|
|
6576
|
+
if (typeof aValue === "number" && typeof bValue === "number") {
|
|
6577
|
+
return sortDirection === "asc" ? aValue - bValue : bValue - aValue;
|
|
6578
|
+
}
|
|
6579
|
+
return 0;
|
|
6580
|
+
});
|
|
6581
|
+
}, [data, sortColumn, sortDirection]);
|
|
6582
|
+
return { sortedData, sortColumn, sortDirection, handleSort };
|
|
6583
|
+
}
|
|
6509
6584
|
var Table = forwardRef14(
|
|
6510
6585
|
({ variant = "default", className, children, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6511
6586
|
"div",
|
|
6512
6587
|
{
|
|
6513
6588
|
className: cn(
|
|
6514
|
-
"relative w-full overflow-
|
|
6589
|
+
"relative w-full overflow-x-auto",
|
|
6515
6590
|
variant === "default" && "border border-border-200 rounded-xl"
|
|
6516
6591
|
),
|
|
6517
6592
|
children: /* @__PURE__ */ jsxs28(
|
|
6518
6593
|
"table",
|
|
6519
6594
|
{
|
|
6520
6595
|
ref,
|
|
6521
|
-
className: cn(
|
|
6596
|
+
className: cn(
|
|
6597
|
+
"analytica-table w-full caption-bottom text-sm border-separate border-spacing-0",
|
|
6598
|
+
className
|
|
6599
|
+
),
|
|
6522
6600
|
...props,
|
|
6523
6601
|
children: [
|
|
6524
6602
|
/* @__PURE__ */ jsx39("caption", { className: "sr-only", children: "My Table" }),
|
|
@@ -6540,15 +6618,11 @@ var TableHeader = forwardRef14(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
6540
6618
|
));
|
|
6541
6619
|
TableHeader.displayName = "TableHeader";
|
|
6542
6620
|
var TableBody = forwardRef14(
|
|
6543
|
-
({
|
|
6621
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6544
6622
|
"tbody",
|
|
6545
6623
|
{
|
|
6546
6624
|
ref,
|
|
6547
|
-
className: cn(
|
|
6548
|
-
"[&_tr:last-child]:border-0",
|
|
6549
|
-
variant === "default" && "border-t border-border-200",
|
|
6550
|
-
className
|
|
6551
|
-
),
|
|
6625
|
+
className: cn("[&_tr:last-child]:border-border-200", className),
|
|
6552
6626
|
...props
|
|
6553
6627
|
}
|
|
6554
6628
|
)
|
|
@@ -6571,7 +6645,7 @@ var TableFooter = forwardRef14(
|
|
|
6571
6645
|
TableFooter.displayName = "TableFooter";
|
|
6572
6646
|
var VARIANT_STATES_ROW = {
|
|
6573
6647
|
default: {
|
|
6574
|
-
default: "border
|
|
6648
|
+
default: "border border-border-200",
|
|
6575
6649
|
borderless: ""
|
|
6576
6650
|
},
|
|
6577
6651
|
selected: {
|
|
@@ -6588,7 +6662,13 @@ var VARIANT_STATES_ROW = {
|
|
|
6588
6662
|
}
|
|
6589
6663
|
};
|
|
6590
6664
|
var TableRow = forwardRef14(
|
|
6591
|
-
({
|
|
6665
|
+
({
|
|
6666
|
+
variant = "default",
|
|
6667
|
+
state = "default",
|
|
6668
|
+
clickable = false,
|
|
6669
|
+
className,
|
|
6670
|
+
...props
|
|
6671
|
+
}, ref) => {
|
|
6592
6672
|
return /* @__PURE__ */ jsx39(
|
|
6593
6673
|
"tr",
|
|
6594
6674
|
{
|
|
@@ -6596,6 +6676,7 @@ var TableRow = forwardRef14(
|
|
|
6596
6676
|
className: cn(
|
|
6597
6677
|
"transition-colors",
|
|
6598
6678
|
state !== "disabled" ? "hover:bg-muted/50" : "",
|
|
6679
|
+
clickable && state !== "disabled" ? "cursor-pointer" : "",
|
|
6599
6680
|
VARIANT_STATES_ROW[state][variant],
|
|
6600
6681
|
className
|
|
6601
6682
|
),
|
|
@@ -6606,24 +6687,49 @@ var TableRow = forwardRef14(
|
|
|
6606
6687
|
}
|
|
6607
6688
|
);
|
|
6608
6689
|
TableRow.displayName = "TableRow";
|
|
6609
|
-
var TableHead = forwardRef14(
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
),
|
|
6690
|
+
var TableHead = forwardRef14(
|
|
6691
|
+
({
|
|
6692
|
+
className,
|
|
6693
|
+
sortable = true,
|
|
6694
|
+
sortDirection = null,
|
|
6695
|
+
onSort,
|
|
6696
|
+
children,
|
|
6617
6697
|
...props
|
|
6698
|
+
}, ref) => {
|
|
6699
|
+
const handleClick = () => {
|
|
6700
|
+
if (sortable && onSort) {
|
|
6701
|
+
onSort();
|
|
6702
|
+
}
|
|
6703
|
+
};
|
|
6704
|
+
return /* @__PURE__ */ jsx39(
|
|
6705
|
+
"th",
|
|
6706
|
+
{
|
|
6707
|
+
ref,
|
|
6708
|
+
className: cn(
|
|
6709
|
+
"h-10 px-6 py-3.5 text-left align-middle font-bold text-base text-text-800 tracking-[0.2px] leading-none [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] whitespace-nowrap",
|
|
6710
|
+
sortable && "cursor-pointer select-none hover:bg-muted/30",
|
|
6711
|
+
className
|
|
6712
|
+
),
|
|
6713
|
+
onClick: handleClick,
|
|
6714
|
+
...props,
|
|
6715
|
+
children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
|
|
6716
|
+
children,
|
|
6717
|
+
sortable && /* @__PURE__ */ jsxs28("div", { className: "flex flex-col", children: [
|
|
6718
|
+
sortDirection === "asc" && /* @__PURE__ */ jsx39(CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
|
|
6719
|
+
sortDirection === "desc" && /* @__PURE__ */ jsx39(CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
|
|
6720
|
+
] })
|
|
6721
|
+
] })
|
|
6722
|
+
}
|
|
6723
|
+
);
|
|
6618
6724
|
}
|
|
6619
|
-
)
|
|
6725
|
+
);
|
|
6620
6726
|
TableHead.displayName = "TableHead";
|
|
6621
6727
|
var TableCell = forwardRef14(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6622
6728
|
"td",
|
|
6623
6729
|
{
|
|
6624
6730
|
ref,
|
|
6625
6731
|
className: cn(
|
|
6626
|
-
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-
|
|
6732
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-base font-normal text-text-800 leading-[150%] tracking-normal px-6 py-3.5 whitespace-nowrap",
|
|
6627
6733
|
className
|
|
6628
6734
|
),
|
|
6629
6735
|
...props
|
|
@@ -6647,7 +6753,7 @@ var Table_default = Table;
|
|
|
6647
6753
|
// src/components/Select/Select.tsx
|
|
6648
6754
|
import { create as create7, useStore as useStore4 } from "zustand";
|
|
6649
6755
|
import {
|
|
6650
|
-
useEffect as
|
|
6756
|
+
useEffect as useEffect14,
|
|
6651
6757
|
useRef as useRef8,
|
|
6652
6758
|
forwardRef as forwardRef15,
|
|
6653
6759
|
isValidElement as isValidElement4,
|
|
@@ -6655,7 +6761,7 @@ import {
|
|
|
6655
6761
|
cloneElement as cloneElement4,
|
|
6656
6762
|
useId as useId8
|
|
6657
6763
|
} from "react";
|
|
6658
|
-
import { CaretDown, Check as Check4, WarningCircle as WarningCircle5 } from "phosphor-react";
|
|
6764
|
+
import { CaretDown as CaretDown2, Check as Check4, WarningCircle as WarningCircle5 } from "phosphor-react";
|
|
6659
6765
|
import { Fragment as Fragment6, jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6660
6766
|
var VARIANT_CLASSES4 = {
|
|
6661
6767
|
outlined: "border-2 rounded-lg focus:border-primary-950",
|
|
@@ -6778,13 +6884,13 @@ var Select = ({
|
|
|
6778
6884
|
search(children2);
|
|
6779
6885
|
return found;
|
|
6780
6886
|
};
|
|
6781
|
-
|
|
6887
|
+
useEffect14(() => {
|
|
6782
6888
|
if (!selectedLabel && defaultValue) {
|
|
6783
6889
|
const label2 = findLabelForValue(children, defaultValue);
|
|
6784
6890
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
6785
6891
|
}
|
|
6786
6892
|
}, [children, defaultValue, selectedLabel]);
|
|
6787
|
-
|
|
6893
|
+
useEffect14(() => {
|
|
6788
6894
|
const handleClickOutside = (event) => {
|
|
6789
6895
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
6790
6896
|
setOpen(false);
|
|
@@ -6819,7 +6925,7 @@ var Select = ({
|
|
|
6819
6925
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
6820
6926
|
};
|
|
6821
6927
|
}, [open]);
|
|
6822
|
-
|
|
6928
|
+
useEffect14(() => {
|
|
6823
6929
|
if (propValue) {
|
|
6824
6930
|
setValue(propValue);
|
|
6825
6931
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -6896,7 +7002,7 @@ var SelectTrigger = forwardRef15(
|
|
|
6896
7002
|
children: [
|
|
6897
7003
|
props.children,
|
|
6898
7004
|
/* @__PURE__ */ jsx40(
|
|
6899
|
-
|
|
7005
|
+
CaretDown2,
|
|
6900
7006
|
{
|
|
6901
7007
|
className: cn(
|
|
6902
7008
|
"h-[1em] w-[1em] opacity-50 transition-transform",
|
|
@@ -7000,13 +7106,13 @@ var Select_default = Select;
|
|
|
7000
7106
|
// src/components/Menu/Menu.tsx
|
|
7001
7107
|
import { create as create8, useStore as useStore5 } from "zustand";
|
|
7002
7108
|
import {
|
|
7003
|
-
useEffect as
|
|
7109
|
+
useEffect as useEffect15,
|
|
7004
7110
|
useRef as useRef9,
|
|
7005
7111
|
forwardRef as forwardRef16,
|
|
7006
7112
|
isValidElement as isValidElement5,
|
|
7007
7113
|
Children as Children5,
|
|
7008
7114
|
cloneElement as cloneElement5,
|
|
7009
|
-
useState as
|
|
7115
|
+
useState as useState14
|
|
7010
7116
|
} from "react";
|
|
7011
7117
|
import { CaretLeft, CaretRight as CaretRight2 } from "phosphor-react";
|
|
7012
7118
|
import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
@@ -7042,7 +7148,7 @@ var Menu = forwardRef16(
|
|
|
7042
7148
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
7043
7149
|
const store = storeRef.current;
|
|
7044
7150
|
const { setValue } = useStore5(store, (s) => s);
|
|
7045
|
-
|
|
7151
|
+
useEffect15(() => {
|
|
7046
7152
|
setValue(propValue ?? defaultValue);
|
|
7047
7153
|
}, [defaultValue, propValue, setValue]);
|
|
7048
7154
|
const baseClasses = variant === "menu-overflow" ? "w-fit py-2 flex flex-row items-center justify-center" : "w-full py-2 flex flex-row items-center justify-center";
|
|
@@ -7244,9 +7350,9 @@ var MenuOverflow = ({
|
|
|
7244
7350
|
...props
|
|
7245
7351
|
}) => {
|
|
7246
7352
|
const containerRef = useRef9(null);
|
|
7247
|
-
const [showLeftArrow, setShowLeftArrow] =
|
|
7248
|
-
const [showRightArrow, setShowRightArrow] =
|
|
7249
|
-
|
|
7353
|
+
const [showLeftArrow, setShowLeftArrow] = useState14(false);
|
|
7354
|
+
const [showRightArrow, setShowRightArrow] = useState14(false);
|
|
7355
|
+
useEffect15(() => {
|
|
7250
7356
|
const checkScroll = () => internalCheckScroll(
|
|
7251
7357
|
containerRef.current,
|
|
7252
7358
|
setShowLeftArrow,
|
|
@@ -7321,9 +7427,9 @@ var Menu_default = Menu;
|
|
|
7321
7427
|
import {
|
|
7322
7428
|
forwardRef as forwardRef17,
|
|
7323
7429
|
Fragment as Fragment7,
|
|
7324
|
-
useState as
|
|
7430
|
+
useState as useState15,
|
|
7325
7431
|
useRef as useRef10,
|
|
7326
|
-
useEffect as
|
|
7432
|
+
useEffect as useEffect16
|
|
7327
7433
|
} from "react";
|
|
7328
7434
|
import {
|
|
7329
7435
|
CaretRight as CaretRight3,
|
|
@@ -8092,13 +8198,13 @@ var CardAudio = forwardRef17(
|
|
|
8092
8198
|
className,
|
|
8093
8199
|
...props
|
|
8094
8200
|
}, ref) => {
|
|
8095
|
-
const [isPlaying, setIsPlaying] =
|
|
8096
|
-
const [currentTime, setCurrentTime] =
|
|
8097
|
-
const [duration, setDuration] =
|
|
8098
|
-
const [volume, setVolume] =
|
|
8099
|
-
const [showVolumeControl, setShowVolumeControl] =
|
|
8100
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
8101
|
-
const [playbackRate, setPlaybackRate] =
|
|
8201
|
+
const [isPlaying, setIsPlaying] = useState15(false);
|
|
8202
|
+
const [currentTime, setCurrentTime] = useState15(0);
|
|
8203
|
+
const [duration, setDuration] = useState15(0);
|
|
8204
|
+
const [volume, setVolume] = useState15(1);
|
|
8205
|
+
const [showVolumeControl, setShowVolumeControl] = useState15(false);
|
|
8206
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState15(false);
|
|
8207
|
+
const [playbackRate, setPlaybackRate] = useState15(1);
|
|
8102
8208
|
const audioRef = useRef10(null);
|
|
8103
8209
|
const volumeControlRef = useRef10(null);
|
|
8104
8210
|
const speedMenuRef = useRef10(null);
|
|
@@ -8175,7 +8281,7 @@ var CardAudio = forwardRef17(
|
|
|
8175
8281
|
}
|
|
8176
8282
|
return /* @__PURE__ */ jsx43(SpeakerHigh, { size: 24 });
|
|
8177
8283
|
};
|
|
8178
|
-
|
|
8284
|
+
useEffect16(() => {
|
|
8179
8285
|
const handleClickOutside = (event) => {
|
|
8180
8286
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
8181
8287
|
setShowVolumeControl(false);
|
|
@@ -8901,8 +9007,8 @@ var NotFound_default = NotFound;
|
|
|
8901
9007
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
8902
9008
|
import {
|
|
8903
9009
|
useRef as useRef11,
|
|
8904
|
-
useState as
|
|
8905
|
-
useEffect as
|
|
9010
|
+
useState as useState17,
|
|
9011
|
+
useEffect as useEffect17,
|
|
8906
9012
|
useCallback as useCallback3
|
|
8907
9013
|
} from "react";
|
|
8908
9014
|
import { createPortal } from "react-dom";
|
|
@@ -8918,7 +9024,7 @@ import {
|
|
|
8918
9024
|
} from "phosphor-react";
|
|
8919
9025
|
|
|
8920
9026
|
// src/components/DownloadButton/DownloadButton.tsx
|
|
8921
|
-
import { useCallback as useCallback2, useState as
|
|
9027
|
+
import { useCallback as useCallback2, useState as useState16 } from "react";
|
|
8922
9028
|
import { DownloadSimple } from "phosphor-react";
|
|
8923
9029
|
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
8924
9030
|
var getMimeType = (url) => {
|
|
@@ -8995,7 +9101,7 @@ var DownloadButton = ({
|
|
|
8995
9101
|
lessonTitle = "aula",
|
|
8996
9102
|
disabled = false
|
|
8997
9103
|
}) => {
|
|
8998
|
-
const [isDownloading, setIsDownloading] =
|
|
9104
|
+
const [isDownloading, setIsDownloading] = useState16(false);
|
|
8999
9105
|
const isValidUrl = useCallback2((url) => {
|
|
9000
9106
|
return Boolean(
|
|
9001
9107
|
url && url.trim() !== "" && url !== "undefined" && url !== "null"
|
|
@@ -9190,7 +9296,7 @@ var SpeedMenu = ({
|
|
|
9190
9296
|
};
|
|
9191
9297
|
};
|
|
9192
9298
|
const position = getMenuPosition();
|
|
9193
|
-
|
|
9299
|
+
useEffect17(() => {
|
|
9194
9300
|
const handleClickOutside = (event) => {
|
|
9195
9301
|
const target = event.target;
|
|
9196
9302
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -9271,21 +9377,21 @@ var VideoPlayer = ({
|
|
|
9271
9377
|
}) => {
|
|
9272
9378
|
const videoRef = useRef11(null);
|
|
9273
9379
|
const { isUltraSmallMobile, isTinyMobile } = useMobile();
|
|
9274
|
-
const [isPlaying, setIsPlaying] =
|
|
9275
|
-
const [currentTime, setCurrentTime] =
|
|
9276
|
-
const [duration, setDuration] =
|
|
9277
|
-
const [isMuted, setIsMuted] =
|
|
9278
|
-
const [volume, setVolume] =
|
|
9279
|
-
const [isFullscreen, setIsFullscreen] =
|
|
9280
|
-
const [showControls, setShowControls] =
|
|
9281
|
-
const [hasCompleted, setHasCompleted] =
|
|
9282
|
-
const [showCaptions, setShowCaptions] =
|
|
9283
|
-
const [subtitlesValidation, setSubtitlesValidation] =
|
|
9284
|
-
|
|
9380
|
+
const [isPlaying, setIsPlaying] = useState17(false);
|
|
9381
|
+
const [currentTime, setCurrentTime] = useState17(0);
|
|
9382
|
+
const [duration, setDuration] = useState17(0);
|
|
9383
|
+
const [isMuted, setIsMuted] = useState17(false);
|
|
9384
|
+
const [volume, setVolume] = useState17(1);
|
|
9385
|
+
const [isFullscreen, setIsFullscreen] = useState17(false);
|
|
9386
|
+
const [showControls, setShowControls] = useState17(true);
|
|
9387
|
+
const [hasCompleted, setHasCompleted] = useState17(false);
|
|
9388
|
+
const [showCaptions, setShowCaptions] = useState17(false);
|
|
9389
|
+
const [subtitlesValidation, setSubtitlesValidation] = useState17("idle");
|
|
9390
|
+
useEffect17(() => {
|
|
9285
9391
|
setHasCompleted(false);
|
|
9286
9392
|
}, [src]);
|
|
9287
|
-
const [playbackRate, setPlaybackRate] =
|
|
9288
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
9393
|
+
const [playbackRate, setPlaybackRate] = useState17(1);
|
|
9394
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState17(false);
|
|
9289
9395
|
const lastSaveTimeRef = useRef11(0);
|
|
9290
9396
|
const trackRef = useRef11(null);
|
|
9291
9397
|
const controlsTimeoutRef = useRef11(null);
|
|
@@ -9353,13 +9459,13 @@ var VideoPlayer = ({
|
|
|
9353
9459
|
}, LEAVE_HIDE_TIMEOUT);
|
|
9354
9460
|
}
|
|
9355
9461
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
9356
|
-
|
|
9462
|
+
useEffect17(() => {
|
|
9357
9463
|
if (videoRef.current) {
|
|
9358
9464
|
videoRef.current.volume = volume;
|
|
9359
9465
|
videoRef.current.muted = isMuted;
|
|
9360
9466
|
}
|
|
9361
9467
|
}, [volume, isMuted]);
|
|
9362
|
-
|
|
9468
|
+
useEffect17(() => {
|
|
9363
9469
|
const video = videoRef.current;
|
|
9364
9470
|
if (!video) return;
|
|
9365
9471
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -9374,13 +9480,13 @@ var VideoPlayer = ({
|
|
|
9374
9480
|
video.removeEventListener("ended", onEnded);
|
|
9375
9481
|
};
|
|
9376
9482
|
}, []);
|
|
9377
|
-
|
|
9483
|
+
useEffect17(() => {
|
|
9378
9484
|
const video = videoRef.current;
|
|
9379
9485
|
if (!video) return;
|
|
9380
9486
|
video.setAttribute("playsinline", "");
|
|
9381
9487
|
video.setAttribute("webkit-playsinline", "");
|
|
9382
9488
|
}, []);
|
|
9383
|
-
|
|
9489
|
+
useEffect17(() => {
|
|
9384
9490
|
if (isPlaying) {
|
|
9385
9491
|
showControlsWithTimer();
|
|
9386
9492
|
} else {
|
|
@@ -9392,7 +9498,7 @@ var VideoPlayer = ({
|
|
|
9392
9498
|
}
|
|
9393
9499
|
}
|
|
9394
9500
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
9395
|
-
|
|
9501
|
+
useEffect17(() => {
|
|
9396
9502
|
const video = videoRef.current;
|
|
9397
9503
|
if (!video) return;
|
|
9398
9504
|
const handleFullscreenChange = () => {
|
|
@@ -9427,7 +9533,7 @@ var VideoPlayer = ({
|
|
|
9427
9533
|
);
|
|
9428
9534
|
};
|
|
9429
9535
|
}, [showControlsWithTimer]);
|
|
9430
|
-
|
|
9536
|
+
useEffect17(() => {
|
|
9431
9537
|
const init = () => {
|
|
9432
9538
|
if (!isFullscreen) {
|
|
9433
9539
|
showControlsWithTimer();
|
|
@@ -9462,7 +9568,7 @@ var VideoPlayer = ({
|
|
|
9462
9568
|
if (hasValidSaved) return saved;
|
|
9463
9569
|
return void 0;
|
|
9464
9570
|
}, [autoSave, storageKey, src, initialTime]);
|
|
9465
|
-
|
|
9571
|
+
useEffect17(() => {
|
|
9466
9572
|
const start = getInitialTime();
|
|
9467
9573
|
if (start !== void 0 && videoRef.current) {
|
|
9468
9574
|
videoRef.current.currentTime = start;
|
|
@@ -9599,7 +9705,7 @@ var VideoPlayer = ({
|
|
|
9599
9705
|
setDuration(videoRef.current.duration);
|
|
9600
9706
|
}
|
|
9601
9707
|
}, []);
|
|
9602
|
-
|
|
9708
|
+
useEffect17(() => {
|
|
9603
9709
|
const controller = new AbortController();
|
|
9604
9710
|
const validateSubtitles = async () => {
|
|
9605
9711
|
if (!subtitles) {
|
|
@@ -9646,12 +9752,12 @@ var VideoPlayer = ({
|
|
|
9646
9752
|
controller.abort();
|
|
9647
9753
|
};
|
|
9648
9754
|
}, [subtitles]);
|
|
9649
|
-
|
|
9755
|
+
useEffect17(() => {
|
|
9650
9756
|
if (trackRef.current?.track) {
|
|
9651
9757
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
9652
9758
|
}
|
|
9653
9759
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
9654
|
-
|
|
9760
|
+
useEffect17(() => {
|
|
9655
9761
|
const handleVisibilityChange = () => {
|
|
9656
9762
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
9657
9763
|
videoRef.current.pause();
|
|
@@ -9963,7 +10069,7 @@ var VideoPlayer = ({
|
|
|
9963
10069
|
var VideoPlayer_default = VideoPlayer;
|
|
9964
10070
|
|
|
9965
10071
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
9966
|
-
import { useCallback as useCallback4, useState as
|
|
10072
|
+
import { useCallback as useCallback4, useState as useState18 } from "react";
|
|
9967
10073
|
import { ArrowsOut } from "phosphor-react";
|
|
9968
10074
|
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9969
10075
|
var IMAGE_WIDTH = 225;
|
|
@@ -9976,7 +10082,7 @@ var Whiteboard = ({
|
|
|
9976
10082
|
imagesPerRow = 2,
|
|
9977
10083
|
...rest
|
|
9978
10084
|
}) => {
|
|
9979
|
-
const [imageErrors, setImageErrors] =
|
|
10085
|
+
const [imageErrors, setImageErrors] = useState18(/* @__PURE__ */ new Set());
|
|
9980
10086
|
const handleDownload = useCallback4(
|
|
9981
10087
|
(image) => {
|
|
9982
10088
|
if (onDownload) {
|
|
@@ -10084,10 +10190,10 @@ var Whiteboard_default = Whiteboard;
|
|
|
10084
10190
|
import {
|
|
10085
10191
|
createContext,
|
|
10086
10192
|
useContext,
|
|
10087
|
-
useEffect as
|
|
10088
|
-
useState as
|
|
10193
|
+
useEffect as useEffect18,
|
|
10194
|
+
useState as useState19,
|
|
10089
10195
|
useCallback as useCallback5,
|
|
10090
|
-
useMemo as
|
|
10196
|
+
useMemo as useMemo6
|
|
10091
10197
|
} from "react";
|
|
10092
10198
|
import { useLocation, Navigate } from "react-router-dom";
|
|
10093
10199
|
import { Fragment as Fragment10, jsx as jsx49 } from "react/jsx-runtime";
|
|
@@ -10101,7 +10207,7 @@ var AuthProvider = ({
|
|
|
10101
10207
|
getSessionFn,
|
|
10102
10208
|
getTokensFn
|
|
10103
10209
|
}) => {
|
|
10104
|
-
const [authState, setAuthState] =
|
|
10210
|
+
const [authState, setAuthState] = useState19({
|
|
10105
10211
|
isAuthenticated: false,
|
|
10106
10212
|
isLoading: true,
|
|
10107
10213
|
...initialAuthState
|
|
@@ -10149,10 +10255,10 @@ var AuthProvider = ({
|
|
|
10149
10255
|
tokens: void 0
|
|
10150
10256
|
}));
|
|
10151
10257
|
}, [signOutFn]);
|
|
10152
|
-
|
|
10258
|
+
useEffect18(() => {
|
|
10153
10259
|
checkAuth();
|
|
10154
10260
|
}, [checkAuth]);
|
|
10155
|
-
const contextValue =
|
|
10261
|
+
const contextValue = useMemo6(
|
|
10156
10262
|
() => ({
|
|
10157
10263
|
...authState,
|
|
10158
10264
|
checkAuth,
|
|
@@ -10264,8 +10370,8 @@ var getRootDomain = () => {
|
|
|
10264
10370
|
import {
|
|
10265
10371
|
forwardRef as forwardRef18,
|
|
10266
10372
|
useId as useId9,
|
|
10267
|
-
useState as
|
|
10268
|
-
useEffect as
|
|
10373
|
+
useState as useState20,
|
|
10374
|
+
useEffect as useEffect19
|
|
10269
10375
|
} from "react";
|
|
10270
10376
|
import { CaretRight as CaretRight4 } from "phosphor-react";
|
|
10271
10377
|
import { jsx as jsx50, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
@@ -10281,13 +10387,13 @@ var CardAccordation = forwardRef18(
|
|
|
10281
10387
|
disabled = false,
|
|
10282
10388
|
...props
|
|
10283
10389
|
}, ref) => {
|
|
10284
|
-
const [internalExpanded, setInternalExpanded] =
|
|
10390
|
+
const [internalExpanded, setInternalExpanded] = useState20(defaultExpanded);
|
|
10285
10391
|
const generatedId = useId9();
|
|
10286
10392
|
const contentId = value ? `accordion-content-${value}` : generatedId;
|
|
10287
10393
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
10288
10394
|
const isControlled = controlledExpanded !== void 0;
|
|
10289
10395
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
10290
|
-
|
|
10396
|
+
useEffect19(() => {
|
|
10291
10397
|
if (isControlled) {
|
|
10292
10398
|
setInternalExpanded(controlledExpanded);
|
|
10293
10399
|
}
|
|
@@ -10378,9 +10484,9 @@ import {
|
|
|
10378
10484
|
cloneElement as cloneElement7,
|
|
10379
10485
|
forwardRef as forwardRef19,
|
|
10380
10486
|
isValidElement as isValidElement6,
|
|
10381
|
-
useEffect as
|
|
10487
|
+
useEffect as useEffect20,
|
|
10382
10488
|
useRef as useRef12,
|
|
10383
|
-
useState as
|
|
10489
|
+
useState as useState21
|
|
10384
10490
|
} from "react";
|
|
10385
10491
|
import { create as create9 } from "zustand";
|
|
10386
10492
|
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
@@ -10449,7 +10555,7 @@ var AccordionGroup = forwardRef19(
|
|
|
10449
10555
|
className,
|
|
10450
10556
|
...props
|
|
10451
10557
|
}, ref) => {
|
|
10452
|
-
const [internalValue, setInternalValue] =
|
|
10558
|
+
const [internalValue, setInternalValue] = useState21(
|
|
10453
10559
|
defaultValue || (type === "single" ? "" : [])
|
|
10454
10560
|
);
|
|
10455
10561
|
const isControlled = controlledValue !== void 0;
|
|
@@ -10474,10 +10580,10 @@ var AccordionGroup = forwardRef19(
|
|
|
10474
10580
|
);
|
|
10475
10581
|
}
|
|
10476
10582
|
const store = storeRef.current;
|
|
10477
|
-
|
|
10583
|
+
useEffect20(() => {
|
|
10478
10584
|
store.setState({ value: currentValue });
|
|
10479
10585
|
}, [currentValue, store]);
|
|
10480
|
-
|
|
10586
|
+
useEffect20(() => {
|
|
10481
10587
|
if (!isControlled) {
|
|
10482
10588
|
setInternalValue((prev) => {
|
|
10483
10589
|
if (type === "single") {
|
|
@@ -10530,7 +10636,7 @@ AccordionGroup.displayName = "AccordionGroup";
|
|
|
10530
10636
|
|
|
10531
10637
|
// src/components/Alternative/Alternative.tsx
|
|
10532
10638
|
import { CheckCircle as CheckCircle4, XCircle as XCircle3 } from "phosphor-react";
|
|
10533
|
-
import { forwardRef as forwardRef20, useId as useId10, useState as
|
|
10639
|
+
import { forwardRef as forwardRef20, useId as useId10, useState as useState22 } from "react";
|
|
10534
10640
|
import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10535
10641
|
var AlternativesList = ({
|
|
10536
10642
|
alternatives,
|
|
@@ -10546,7 +10652,7 @@ var AlternativesList = ({
|
|
|
10546
10652
|
}) => {
|
|
10547
10653
|
const uniqueId = useId10();
|
|
10548
10654
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
10549
|
-
const [actualValue, setActualValue] =
|
|
10655
|
+
const [actualValue, setActualValue] = useState22(value);
|
|
10550
10656
|
const isReadonly = mode === "readonly";
|
|
10551
10657
|
const getStatusStyles2 = (status, isReadonly2) => {
|
|
10552
10658
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
@@ -10831,7 +10937,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
10831
10937
|
}
|
|
10832
10938
|
|
|
10833
10939
|
// src/components/Auth/useUrlAuthentication.ts
|
|
10834
|
-
import { useEffect as
|
|
10940
|
+
import { useEffect as useEffect21, useRef as useRef13 } from "react";
|
|
10835
10941
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
10836
10942
|
var getAuthParams = (location, extractParams) => {
|
|
10837
10943
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -10880,7 +10986,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
10880
10986
|
function useUrlAuthentication(options) {
|
|
10881
10987
|
const location = useLocation2();
|
|
10882
10988
|
const processedRef = useRef13(false);
|
|
10883
|
-
|
|
10989
|
+
useEffect21(() => {
|
|
10884
10990
|
const handleAuthentication = async () => {
|
|
10885
10991
|
if (processedRef.current) {
|
|
10886
10992
|
return;
|
|
@@ -10951,9 +11057,9 @@ function useUrlAuthentication(options) {
|
|
|
10951
11057
|
}
|
|
10952
11058
|
|
|
10953
11059
|
// src/components/Auth/useApiConfig.ts
|
|
10954
|
-
import { useMemo as
|
|
11060
|
+
import { useMemo as useMemo7 } from "react";
|
|
10955
11061
|
function useApiConfig(api) {
|
|
10956
|
-
return
|
|
11062
|
+
return useMemo7(
|
|
10957
11063
|
() => ({
|
|
10958
11064
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
10959
11065
|
}),
|
|
@@ -10971,8 +11077,8 @@ import {
|
|
|
10971
11077
|
} from "phosphor-react";
|
|
10972
11078
|
import {
|
|
10973
11079
|
forwardRef as forwardRef22,
|
|
10974
|
-
useEffect as
|
|
10975
|
-
useState as
|
|
11080
|
+
useEffect as useEffect24,
|
|
11081
|
+
useState as useState25
|
|
10976
11082
|
} from "react";
|
|
10977
11083
|
|
|
10978
11084
|
// src/components/Quiz/useQuizStore.ts
|
|
@@ -11578,15 +11684,15 @@ var useQuizStore = create10()(
|
|
|
11578
11684
|
import {
|
|
11579
11685
|
forwardRef as forwardRef21,
|
|
11580
11686
|
useCallback as useCallback6,
|
|
11581
|
-
useEffect as
|
|
11687
|
+
useEffect as useEffect23,
|
|
11582
11688
|
useId as useId11,
|
|
11583
|
-
useMemo as
|
|
11689
|
+
useMemo as useMemo8,
|
|
11584
11690
|
useRef as useRef14,
|
|
11585
|
-
useState as
|
|
11691
|
+
useState as useState24
|
|
11586
11692
|
} from "react";
|
|
11587
11693
|
|
|
11588
11694
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
11589
|
-
import { useEffect as
|
|
11695
|
+
import { useEffect as useEffect22, useState as useState23 } from "react";
|
|
11590
11696
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
|
|
11591
11697
|
import { jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
11592
11698
|
var MultipleChoiceList = ({
|
|
@@ -11598,8 +11704,8 @@ var MultipleChoiceList = ({
|
|
|
11598
11704
|
onHandleSelectedValues,
|
|
11599
11705
|
mode = "interactive"
|
|
11600
11706
|
}) => {
|
|
11601
|
-
const [actualValue, setActualValue] =
|
|
11602
|
-
|
|
11707
|
+
const [actualValue, setActualValue] = useState23(selectedValues);
|
|
11708
|
+
useEffect22(() => {
|
|
11603
11709
|
setActualValue(selectedValues);
|
|
11604
11710
|
}, [selectedValues]);
|
|
11605
11711
|
const getStatusBadge2 = (status) => {
|
|
@@ -11840,13 +11946,13 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
11840
11946
|
);
|
|
11841
11947
|
const prevSelectedValuesRef = useRef14([]);
|
|
11842
11948
|
const prevQuestionIdRef = useRef14("");
|
|
11843
|
-
const allCurrentAnswerIds =
|
|
11949
|
+
const allCurrentAnswerIds = useMemo8(() => {
|
|
11844
11950
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
11845
11951
|
}, [allCurrentAnswers]);
|
|
11846
|
-
const selectedValues =
|
|
11952
|
+
const selectedValues = useMemo8(() => {
|
|
11847
11953
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
11848
11954
|
}, [allCurrentAnswerIds]);
|
|
11849
|
-
const stableSelectedValues =
|
|
11955
|
+
const stableSelectedValues = useMemo8(() => {
|
|
11850
11956
|
const currentQuestionId = currentQuestion?.id || "";
|
|
11851
11957
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
11852
11958
|
if (hasQuestionChanged) {
|
|
@@ -11878,7 +11984,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
11878
11984
|
},
|
|
11879
11985
|
[currentQuestion, selectMultipleAnswer]
|
|
11880
11986
|
);
|
|
11881
|
-
const questionKey =
|
|
11987
|
+
const questionKey = useMemo8(
|
|
11882
11988
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
11883
11989
|
[currentQuestion?.id]
|
|
11884
11990
|
);
|
|
@@ -11954,7 +12060,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
11954
12060
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
11955
12061
|
}
|
|
11956
12062
|
}, []);
|
|
11957
|
-
|
|
12063
|
+
useEffect23(() => {
|
|
11958
12064
|
adjustTextareaHeight();
|
|
11959
12065
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
11960
12066
|
if (!currentQuestion) {
|
|
@@ -12093,7 +12199,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
12093
12199
|
isCorrect: false
|
|
12094
12200
|
}
|
|
12095
12201
|
];
|
|
12096
|
-
const [userAnswers, setUserAnswers] =
|
|
12202
|
+
const [userAnswers, setUserAnswers] = useState24(() => {
|
|
12097
12203
|
if (variant === "result") {
|
|
12098
12204
|
return mockUserAnswers;
|
|
12099
12205
|
}
|
|
@@ -12212,7 +12318,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
12212
12318
|
isCorrect: true
|
|
12213
12319
|
}
|
|
12214
12320
|
];
|
|
12215
|
-
const [answers, setAnswers] =
|
|
12321
|
+
const [answers, setAnswers] = useState24({});
|
|
12216
12322
|
const baseId = useId11();
|
|
12217
12323
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
12218
12324
|
const usedOptions = new Set(
|
|
@@ -12352,7 +12458,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
12352
12458
|
};
|
|
12353
12459
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
12354
12460
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
12355
|
-
const [clickPositionRelative, setClickPositionRelative] =
|
|
12461
|
+
const [clickPositionRelative, setClickPositionRelative] = useState24(variant == "result" ? mockUserAnswerRelative : null);
|
|
12356
12462
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
12357
12463
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
12358
12464
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -12520,7 +12626,7 @@ var getFinishConfirmationText = (type) => {
|
|
|
12520
12626
|
};
|
|
12521
12627
|
var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
|
|
12522
12628
|
const { setVariant } = useQuizStore();
|
|
12523
|
-
|
|
12629
|
+
useEffect24(() => {
|
|
12524
12630
|
setVariant(variant);
|
|
12525
12631
|
}, [variant, setVariant]);
|
|
12526
12632
|
return /* @__PURE__ */ jsx55("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
@@ -12535,7 +12641,7 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
12535
12641
|
formatTime: formatTime2,
|
|
12536
12642
|
isStarted
|
|
12537
12643
|
} = useQuizStore();
|
|
12538
|
-
const [showExitConfirmation, setShowExitConfirmation] =
|
|
12644
|
+
const [showExitConfirmation, setShowExitConfirmation] = useState25(false);
|
|
12539
12645
|
const totalQuestions = getTotalQuestions();
|
|
12540
12646
|
const quizTitle = getQuizTitle();
|
|
12541
12647
|
const handleBackClick = () => {
|
|
@@ -12738,8 +12844,8 @@ var QuizFooter = forwardRef22(
|
|
|
12738
12844
|
const currentAnswer = getCurrentAnswer();
|
|
12739
12845
|
const currentQuestion = getCurrentQuestion();
|
|
12740
12846
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
12741
|
-
const [activeModal, setActiveModal] =
|
|
12742
|
-
const [filterType, setFilterType] =
|
|
12847
|
+
const [activeModal, setActiveModal] = useState25(null);
|
|
12848
|
+
const [filterType, setFilterType] = useState25("all");
|
|
12743
12849
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
12744
12850
|
const closeModal = () => setActiveModal(null);
|
|
12745
12851
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -13081,7 +13187,7 @@ var QuizFooter = forwardRef22(
|
|
|
13081
13187
|
);
|
|
13082
13188
|
|
|
13083
13189
|
// src/components/Quiz/QuizResult.tsx
|
|
13084
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
13190
|
+
import { forwardRef as forwardRef23, useEffect as useEffect25, useState as useState26 } from "react";
|
|
13085
13191
|
import { Clock as Clock3 } from "phosphor-react";
|
|
13086
13192
|
import { jsx as jsx56, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13087
13193
|
var QuizBadge = ({
|
|
@@ -13110,8 +13216,8 @@ var QuizHeaderResult = forwardRef23(
|
|
|
13110
13216
|
getCurrentQuestion,
|
|
13111
13217
|
questionsResult
|
|
13112
13218
|
} = useQuizStore();
|
|
13113
|
-
const [status, setStatus] =
|
|
13114
|
-
|
|
13219
|
+
const [status, setStatus] = useState26(void 0);
|
|
13220
|
+
useEffect25(() => {
|
|
13115
13221
|
const cq = getCurrentQuestion();
|
|
13116
13222
|
if (!cq) {
|
|
13117
13223
|
setStatus(void 0);
|
|
@@ -13484,7 +13590,7 @@ var BreadcrumbMenu = ({
|
|
|
13484
13590
|
};
|
|
13485
13591
|
|
|
13486
13592
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
13487
|
-
import { useEffect as
|
|
13593
|
+
import { useEffect as useEffect26 } from "react";
|
|
13488
13594
|
|
|
13489
13595
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
13490
13596
|
import { create as create11 } from "zustand";
|
|
@@ -13613,7 +13719,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
13613
13719
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
13614
13720
|
);
|
|
13615
13721
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
13616
|
-
|
|
13722
|
+
useEffect26(() => {
|
|
13617
13723
|
const newBreadcrumbs = [root];
|
|
13618
13724
|
const previousIds = [];
|
|
13619
13725
|
for (const level of levels) {
|
|
@@ -13645,11 +13751,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
13645
13751
|
};
|
|
13646
13752
|
|
|
13647
13753
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
13648
|
-
import { useMemo as
|
|
13754
|
+
import { useMemo as useMemo9 } from "react";
|
|
13649
13755
|
import { useLocation as useLocation3 } from "react-router-dom";
|
|
13650
13756
|
var useUrlParams = (config) => {
|
|
13651
13757
|
const location = useLocation3();
|
|
13652
|
-
return
|
|
13758
|
+
return useMemo9(() => {
|
|
13653
13759
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
13654
13760
|
const params = {};
|
|
13655
13761
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -13660,15 +13766,15 @@ var useUrlParams = (config) => {
|
|
|
13660
13766
|
};
|
|
13661
13767
|
|
|
13662
13768
|
// src/hooks/useAppInitialization.ts
|
|
13663
|
-
import { useMemo as
|
|
13769
|
+
import { useMemo as useMemo10 } from "react";
|
|
13664
13770
|
|
|
13665
13771
|
// src/hooks/useInstitution.ts
|
|
13666
|
-
import { useEffect as
|
|
13772
|
+
import { useEffect as useEffect27, useState as useState27 } from "react";
|
|
13667
13773
|
function useInstitutionId() {
|
|
13668
|
-
const [institutionId, setInstitutionId] =
|
|
13774
|
+
const [institutionId, setInstitutionId] = useState27(() => {
|
|
13669
13775
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
13670
13776
|
});
|
|
13671
|
-
|
|
13777
|
+
useEffect27(() => {
|
|
13672
13778
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
13673
13779
|
if (!metaTag) return;
|
|
13674
13780
|
const observer = new MutationObserver(() => {
|
|
@@ -13835,7 +13941,7 @@ var useAuthStore = create13()(
|
|
|
13835
13941
|
function useAppInitialization() {
|
|
13836
13942
|
const getInstitutionId = useInstitutionId();
|
|
13837
13943
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
13838
|
-
const authFunctions =
|
|
13944
|
+
const authFunctions = useMemo10(
|
|
13839
13945
|
() => ({
|
|
13840
13946
|
checkAuth: async () => {
|
|
13841
13947
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -13872,7 +13978,7 @@ function useAppInitialization() {
|
|
|
13872
13978
|
}
|
|
13873
13979
|
|
|
13874
13980
|
// src/hooks/useAppContent.ts
|
|
13875
|
-
import { useCallback as useCallback7, useEffect as
|
|
13981
|
+
import { useCallback as useCallback7, useEffect as useEffect28, useMemo as useMemo11 } from "react";
|
|
13876
13982
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
13877
13983
|
function useAppContent(config) {
|
|
13878
13984
|
const navigate = useNavigate2();
|
|
@@ -13922,7 +14028,7 @@ function useAppContent(config) {
|
|
|
13922
14028
|
},
|
|
13923
14029
|
[navigate, onError]
|
|
13924
14030
|
);
|
|
13925
|
-
const urlAuthConfig =
|
|
14031
|
+
const urlAuthConfig = useMemo11(
|
|
13926
14032
|
() => ({
|
|
13927
14033
|
setTokens,
|
|
13928
14034
|
setSessionInfo,
|
|
@@ -13948,10 +14054,10 @@ function useAppContent(config) {
|
|
|
13948
14054
|
);
|
|
13949
14055
|
useUrlAuthentication(urlAuthConfig);
|
|
13950
14056
|
const { sessionInfo } = useAuth();
|
|
13951
|
-
const institutionIdToUse =
|
|
14057
|
+
const institutionIdToUse = useMemo11(() => {
|
|
13952
14058
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
13953
14059
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
13954
|
-
|
|
14060
|
+
useEffect28(() => {
|
|
13955
14061
|
if (institutionIdToUse && !initialized) {
|
|
13956
14062
|
initialize(institutionIdToUse);
|
|
13957
14063
|
}
|
|
@@ -14112,6 +14218,7 @@ export {
|
|
|
14112
14218
|
useMobile,
|
|
14113
14219
|
useQuizStore,
|
|
14114
14220
|
useRouteAuth,
|
|
14221
|
+
useTableSort,
|
|
14115
14222
|
useTheme,
|
|
14116
14223
|
useThemeStore,
|
|
14117
14224
|
ToastStore_default as useToastStore,
|