analytica-frontend-lib 1.2.11 → 1.2.12
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/CheckBox/index.d.mts +1 -1
- package/dist/CheckBox/index.d.ts +1 -1
- package/dist/Radio/index.d.mts +2 -2
- package/dist/Radio/index.d.ts +2 -2
- package/dist/Search/index.d.mts +1 -1
- package/dist/Search/index.d.ts +1 -1
- package/dist/Table/index.d.mts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +116 -3
- package/dist/index.d.ts +116 -3
- package/dist/index.js +1057 -788
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +978 -711
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -0
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __export(src_exports, {
|
|
|
64
64
|
DropdownMenuItem: () => DropdownMenuItem,
|
|
65
65
|
DropdownMenuSeparator: () => DropdownMenuSeparator,
|
|
66
66
|
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
67
|
+
FilterModal: () => FilterModal,
|
|
67
68
|
IconButton: () => IconButton_default,
|
|
68
69
|
IconRender: () => IconRender_default,
|
|
69
70
|
IconRoundedButton: () => IconRoundedButton_default,
|
|
@@ -180,6 +181,7 @@ __export(src_exports, {
|
|
|
180
181
|
useMobile: () => useMobile,
|
|
181
182
|
useQuizStore: () => useQuizStore,
|
|
182
183
|
useRouteAuth: () => useRouteAuth,
|
|
184
|
+
useTableFilter: () => useTableFilter,
|
|
183
185
|
useTableSort: () => useTableSort,
|
|
184
186
|
useTheme: () => useTheme,
|
|
185
187
|
useThemeStore: () => useThemeStore,
|
|
@@ -1322,7 +1324,7 @@ var CheckboxGroup = ({
|
|
|
1322
1324
|
return depCat?.selectedIds && depCat.selectedIds.length > 0;
|
|
1323
1325
|
});
|
|
1324
1326
|
if (!isEnabled) {
|
|
1325
|
-
return [{ itens:
|
|
1327
|
+
return [{ itens: [] }];
|
|
1326
1328
|
}
|
|
1327
1329
|
const filters = category.filteredBy || [];
|
|
1328
1330
|
if (filters.length === 0) {
|
|
@@ -1437,9 +1439,10 @@ var CheckboxGroup = ({
|
|
|
1437
1439
|
const formattedItems = getFormattedItems(categoryKey);
|
|
1438
1440
|
const filteredItems = formattedItems.flatMap((group) => group.itens || []);
|
|
1439
1441
|
const filteredItemIds = filteredItems.map((item) => item.id);
|
|
1440
|
-
const
|
|
1442
|
+
const selectedFilteredCount = filteredItemIds.filter(
|
|
1441
1443
|
(itemId) => category.selectedIds?.includes(itemId)
|
|
1442
|
-
);
|
|
1444
|
+
).length;
|
|
1445
|
+
const allFilteredSelected = selectedFilteredCount === filteredItemIds.length;
|
|
1443
1446
|
const newSelection = allFilteredSelected ? category.selectedIds?.filter((id) => !filteredItemIds.includes(id)) || [] : [
|
|
1444
1447
|
...category.selectedIds || [],
|
|
1445
1448
|
...filteredItemIds.filter(
|
|
@@ -1477,24 +1480,27 @@ var CheckboxGroup = ({
|
|
|
1477
1480
|
}
|
|
1478
1481
|
onCategoriesChange(updatedCategories);
|
|
1479
1482
|
};
|
|
1480
|
-
const renderCheckboxItem = (item, categoryKey) =>
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1483
|
+
const renderCheckboxItem = (item, categoryKey) => {
|
|
1484
|
+
const uniqueId = `${categoryKey}-${item.id}`;
|
|
1485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-3 px-2", children: [
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1487
|
+
CheckBox_default,
|
|
1488
|
+
{
|
|
1489
|
+
id: uniqueId,
|
|
1490
|
+
checked: isCheckBoxIsSelected(categoryKey, item.id),
|
|
1491
|
+
onChange: () => toggleItem(categoryKey, item.id)
|
|
1492
|
+
}
|
|
1493
|
+
),
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1495
|
+
"label",
|
|
1496
|
+
{
|
|
1497
|
+
htmlFor: uniqueId,
|
|
1498
|
+
className: "text-sm text-text-950 cursor-pointer select-none",
|
|
1499
|
+
children: item.name
|
|
1500
|
+
}
|
|
1501
|
+
)
|
|
1502
|
+
] }, item.id);
|
|
1503
|
+
};
|
|
1498
1504
|
const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1499
1505
|
"div",
|
|
1500
1506
|
{
|
|
@@ -1566,13 +1572,38 @@ var CheckboxGroup = ({
|
|
|
1566
1572
|
openAccordion !== category.key && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Divider_default, {})
|
|
1567
1573
|
] }, category.key);
|
|
1568
1574
|
};
|
|
1575
|
+
(0, import_react7.useEffect)(() => {
|
|
1576
|
+
if (!openAccordion) return;
|
|
1577
|
+
const category = categories.find((c) => c.key === openAccordion);
|
|
1578
|
+
if (!category) return;
|
|
1579
|
+
const isEnabled = !category.dependsOn || category.dependsOn.every((depKey) => {
|
|
1580
|
+
const depCat = categories.find((c) => c.key === depKey);
|
|
1581
|
+
return depCat?.selectedIds && depCat.selectedIds.length > 0;
|
|
1582
|
+
});
|
|
1583
|
+
if (!isEnabled) {
|
|
1584
|
+
setTimeout(() => {
|
|
1585
|
+
setOpenAccordion("");
|
|
1586
|
+
}, 0);
|
|
1587
|
+
}
|
|
1588
|
+
}, [categories, openAccordion]);
|
|
1569
1589
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1570
1590
|
AccordionGroup,
|
|
1571
1591
|
{
|
|
1572
1592
|
type: "single",
|
|
1593
|
+
collapsible: true,
|
|
1573
1594
|
value: openAccordion,
|
|
1574
1595
|
onValueChange: (value) => {
|
|
1575
1596
|
if (typeof value === "string") {
|
|
1597
|
+
if (value) {
|
|
1598
|
+
const category = categories.find((c) => c.key === value);
|
|
1599
|
+
const isEnabled = !category?.dependsOn || category.dependsOn.every((depKey) => {
|
|
1600
|
+
const depCat = categories.find((c) => c.key === depKey);
|
|
1601
|
+
return depCat?.selectedIds && depCat.selectedIds.length > 0;
|
|
1602
|
+
});
|
|
1603
|
+
if (!isEnabled) {
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1576
1607
|
setOpenAccordion(value);
|
|
1577
1608
|
}
|
|
1578
1609
|
},
|
|
@@ -6893,11 +6924,247 @@ var TableCaption = (0, import_react23.forwardRef)(({ className, ...props }, ref)
|
|
|
6893
6924
|
TableCaption.displayName = "TableCaption";
|
|
6894
6925
|
var Table_default = Table;
|
|
6895
6926
|
|
|
6927
|
+
// src/components/Filter/FilterModal.tsx
|
|
6928
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6929
|
+
var FilterModal = ({
|
|
6930
|
+
isOpen,
|
|
6931
|
+
onClose,
|
|
6932
|
+
filterConfigs,
|
|
6933
|
+
onFiltersChange,
|
|
6934
|
+
onApply,
|
|
6935
|
+
onClear,
|
|
6936
|
+
title = "Filtros",
|
|
6937
|
+
size = "md",
|
|
6938
|
+
applyLabel = "Aplicar",
|
|
6939
|
+
clearLabel = "Limpar filtros"
|
|
6940
|
+
}) => {
|
|
6941
|
+
const handleCategoryChange = (configIndex, updatedCategories) => {
|
|
6942
|
+
const newConfigs = [...filterConfigs];
|
|
6943
|
+
newConfigs[configIndex] = {
|
|
6944
|
+
...newConfigs[configIndex],
|
|
6945
|
+
categories: updatedCategories
|
|
6946
|
+
};
|
|
6947
|
+
onFiltersChange(newConfigs);
|
|
6948
|
+
};
|
|
6949
|
+
const handleApply = () => {
|
|
6950
|
+
onApply();
|
|
6951
|
+
onClose();
|
|
6952
|
+
};
|
|
6953
|
+
const handleClear = () => {
|
|
6954
|
+
onClear();
|
|
6955
|
+
};
|
|
6956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6957
|
+
Modal_default,
|
|
6958
|
+
{
|
|
6959
|
+
isOpen,
|
|
6960
|
+
onClose,
|
|
6961
|
+
title,
|
|
6962
|
+
size,
|
|
6963
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex gap-3 justify-end w-full", children: [
|
|
6964
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button_default, { variant: "outline", onClick: handleClear, children: clearLabel }),
|
|
6965
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button_default, { onClick: handleApply, children: applyLabel })
|
|
6966
|
+
] }),
|
|
6967
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-col gap-6", children: filterConfigs.map((config, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
6968
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2 text-text-400 text-sm font-medium uppercase", children: [
|
|
6969
|
+
config.key === "academic" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6970
|
+
"svg",
|
|
6971
|
+
{
|
|
6972
|
+
width: "16",
|
|
6973
|
+
height: "16",
|
|
6974
|
+
viewBox: "0 0 16 16",
|
|
6975
|
+
fill: "none",
|
|
6976
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6977
|
+
className: "text-text-400",
|
|
6978
|
+
children: [
|
|
6979
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6980
|
+
"path",
|
|
6981
|
+
{
|
|
6982
|
+
d: "M8 2L2 5.33333L8 8.66667L14 5.33333L8 2Z",
|
|
6983
|
+
stroke: "currentColor",
|
|
6984
|
+
strokeWidth: "1.5",
|
|
6985
|
+
strokeLinecap: "round",
|
|
6986
|
+
strokeLinejoin: "round"
|
|
6987
|
+
}
|
|
6988
|
+
),
|
|
6989
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6990
|
+
"path",
|
|
6991
|
+
{
|
|
6992
|
+
d: "M2 10.6667L8 14L14 10.6667",
|
|
6993
|
+
stroke: "currentColor",
|
|
6994
|
+
strokeWidth: "1.5",
|
|
6995
|
+
strokeLinecap: "round",
|
|
6996
|
+
strokeLinejoin: "round"
|
|
6997
|
+
}
|
|
6998
|
+
),
|
|
6999
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7000
|
+
"path",
|
|
7001
|
+
{
|
|
7002
|
+
d: "M2 8L8 11.3333L14 8",
|
|
7003
|
+
stroke: "currentColor",
|
|
7004
|
+
strokeWidth: "1.5",
|
|
7005
|
+
strokeLinecap: "round",
|
|
7006
|
+
strokeLinejoin: "round"
|
|
7007
|
+
}
|
|
7008
|
+
)
|
|
7009
|
+
]
|
|
7010
|
+
}
|
|
7011
|
+
),
|
|
7012
|
+
config.key === "content" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
7013
|
+
"svg",
|
|
7014
|
+
{
|
|
7015
|
+
width: "16",
|
|
7016
|
+
height: "16",
|
|
7017
|
+
viewBox: "0 0 16 16",
|
|
7018
|
+
fill: "none",
|
|
7019
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7020
|
+
className: "text-text-400",
|
|
7021
|
+
children: [
|
|
7022
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7023
|
+
"path",
|
|
7024
|
+
{
|
|
7025
|
+
d: "M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z",
|
|
7026
|
+
stroke: "currentColor",
|
|
7027
|
+
strokeWidth: "1.5",
|
|
7028
|
+
strokeLinecap: "round",
|
|
7029
|
+
strokeLinejoin: "round"
|
|
7030
|
+
}
|
|
7031
|
+
),
|
|
7032
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7033
|
+
"path",
|
|
7034
|
+
{
|
|
7035
|
+
d: "M2 6H14",
|
|
7036
|
+
stroke: "currentColor",
|
|
7037
|
+
strokeWidth: "1.5",
|
|
7038
|
+
strokeLinecap: "round",
|
|
7039
|
+
strokeLinejoin: "round"
|
|
7040
|
+
}
|
|
7041
|
+
),
|
|
7042
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7043
|
+
"path",
|
|
7044
|
+
{
|
|
7045
|
+
d: "M6 2V14",
|
|
7046
|
+
stroke: "currentColor",
|
|
7047
|
+
strokeWidth: "1.5",
|
|
7048
|
+
strokeLinecap: "round",
|
|
7049
|
+
strokeLinejoin: "round"
|
|
7050
|
+
}
|
|
7051
|
+
)
|
|
7052
|
+
]
|
|
7053
|
+
}
|
|
7054
|
+
),
|
|
7055
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: config.label })
|
|
7056
|
+
] }),
|
|
7057
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7058
|
+
CheckboxGroup,
|
|
7059
|
+
{
|
|
7060
|
+
categories: config.categories,
|
|
7061
|
+
onCategoriesChange: (updatedCategories) => handleCategoryChange(index, updatedCategories)
|
|
7062
|
+
}
|
|
7063
|
+
)
|
|
7064
|
+
] }, config.key)) })
|
|
7065
|
+
}
|
|
7066
|
+
);
|
|
7067
|
+
};
|
|
7068
|
+
|
|
7069
|
+
// src/components/Filter/useTableFilter.ts
|
|
7070
|
+
var import_react24 = require("react");
|
|
7071
|
+
var useTableFilter = (initialConfigs, options = {}) => {
|
|
7072
|
+
const { syncWithUrl = false } = options;
|
|
7073
|
+
const getInitialState = (0, import_react24.useCallback)(() => {
|
|
7074
|
+
if (!syncWithUrl || globalThis.window === void 0) {
|
|
7075
|
+
return initialConfigs;
|
|
7076
|
+
}
|
|
7077
|
+
const params = new URLSearchParams(globalThis.window.location.search);
|
|
7078
|
+
const configsWithUrlState = initialConfigs.map((config) => ({
|
|
7079
|
+
...config,
|
|
7080
|
+
categories: config.categories.map((category) => {
|
|
7081
|
+
const urlValue = params.get(`filter_${category.key}`);
|
|
7082
|
+
const selectedIds = urlValue ? urlValue.split(",").filter(Boolean) : [];
|
|
7083
|
+
return {
|
|
7084
|
+
...category,
|
|
7085
|
+
selectedIds
|
|
7086
|
+
};
|
|
7087
|
+
})
|
|
7088
|
+
}));
|
|
7089
|
+
return configsWithUrlState;
|
|
7090
|
+
}, [initialConfigs, syncWithUrl]);
|
|
7091
|
+
const [filterConfigs, setFilterConfigs] = (0, import_react24.useState)(getInitialState);
|
|
7092
|
+
const activeFilters = {};
|
|
7093
|
+
let hasActiveFilters = false;
|
|
7094
|
+
for (const config of filterConfigs) {
|
|
7095
|
+
for (const category of config.categories) {
|
|
7096
|
+
if (category.selectedIds && category.selectedIds.length > 0) {
|
|
7097
|
+
activeFilters[category.key] = category.selectedIds;
|
|
7098
|
+
hasActiveFilters = true;
|
|
7099
|
+
}
|
|
7100
|
+
}
|
|
7101
|
+
}
|
|
7102
|
+
const updateFilters = (0, import_react24.useCallback)((configs) => {
|
|
7103
|
+
setFilterConfigs(configs);
|
|
7104
|
+
}, []);
|
|
7105
|
+
const applyFilters = (0, import_react24.useCallback)(() => {
|
|
7106
|
+
if (!syncWithUrl || globalThis.window === void 0) {
|
|
7107
|
+
return;
|
|
7108
|
+
}
|
|
7109
|
+
const url = new URL(globalThis.window.location.href);
|
|
7110
|
+
const params = url.searchParams;
|
|
7111
|
+
for (const config of filterConfigs) {
|
|
7112
|
+
for (const category of config.categories) {
|
|
7113
|
+
const paramKey = `filter_${category.key}`;
|
|
7114
|
+
if (category.selectedIds && category.selectedIds.length > 0) {
|
|
7115
|
+
params.set(paramKey, category.selectedIds.join(","));
|
|
7116
|
+
} else {
|
|
7117
|
+
params.delete(paramKey);
|
|
7118
|
+
}
|
|
7119
|
+
}
|
|
7120
|
+
}
|
|
7121
|
+
globalThis.window.history.replaceState({}, "", url.toString());
|
|
7122
|
+
}, [filterConfigs, syncWithUrl]);
|
|
7123
|
+
const clearFilters = (0, import_react24.useCallback)(() => {
|
|
7124
|
+
const clearedConfigs = filterConfigs.map((config) => ({
|
|
7125
|
+
...config,
|
|
7126
|
+
categories: config.categories.map((category) => ({
|
|
7127
|
+
...category,
|
|
7128
|
+
selectedIds: []
|
|
7129
|
+
}))
|
|
7130
|
+
}));
|
|
7131
|
+
setFilterConfigs(clearedConfigs);
|
|
7132
|
+
if (syncWithUrl && globalThis.window !== void 0) {
|
|
7133
|
+
const url = new URL(globalThis.window.location.href);
|
|
7134
|
+
const params = url.searchParams;
|
|
7135
|
+
for (const config of filterConfigs) {
|
|
7136
|
+
for (const category of config.categories) {
|
|
7137
|
+
params.delete(`filter_${category.key}`);
|
|
7138
|
+
}
|
|
7139
|
+
}
|
|
7140
|
+
globalThis.window.history.replaceState({}, "", url.toString());
|
|
7141
|
+
}
|
|
7142
|
+
}, [filterConfigs, syncWithUrl]);
|
|
7143
|
+
(0, import_react24.useEffect)(() => {
|
|
7144
|
+
if (!syncWithUrl || globalThis.window === void 0) {
|
|
7145
|
+
return;
|
|
7146
|
+
}
|
|
7147
|
+
const handlePopState = () => {
|
|
7148
|
+
setFilterConfigs(getInitialState());
|
|
7149
|
+
};
|
|
7150
|
+
globalThis.window.addEventListener("popstate", handlePopState);
|
|
7151
|
+
return () => globalThis.window.removeEventListener("popstate", handlePopState);
|
|
7152
|
+
}, [syncWithUrl, getInitialState]);
|
|
7153
|
+
return {
|
|
7154
|
+
filterConfigs,
|
|
7155
|
+
activeFilters,
|
|
7156
|
+
hasActiveFilters,
|
|
7157
|
+
updateFilters,
|
|
7158
|
+
applyFilters,
|
|
7159
|
+
clearFilters
|
|
7160
|
+
};
|
|
7161
|
+
};
|
|
7162
|
+
|
|
6896
7163
|
// src/components/Select/Select.tsx
|
|
6897
7164
|
var import_zustand7 = require("zustand");
|
|
6898
|
-
var
|
|
7165
|
+
var import_react25 = require("react");
|
|
6899
7166
|
var import_phosphor_react17 = require("phosphor-react");
|
|
6900
|
-
var
|
|
7167
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6901
7168
|
var VARIANT_CLASSES4 = {
|
|
6902
7169
|
outlined: "border-2 rounded-lg focus:border-primary-950",
|
|
6903
7170
|
underlined: "border-b-2 focus:border-primary-950",
|
|
@@ -6955,13 +7222,13 @@ function getLabelAsNode(children) {
|
|
|
6955
7222
|
if (typeof children === "string" || typeof children === "number") {
|
|
6956
7223
|
return children;
|
|
6957
7224
|
}
|
|
6958
|
-
const flattened =
|
|
7225
|
+
const flattened = import_react25.Children.toArray(children);
|
|
6959
7226
|
if (flattened.length === 1) return flattened[0];
|
|
6960
|
-
return /* @__PURE__ */ (0,
|
|
7227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: flattened });
|
|
6961
7228
|
}
|
|
6962
7229
|
var injectStore4 = (children, store, size, selectId) => {
|
|
6963
|
-
return
|
|
6964
|
-
if ((0,
|
|
7230
|
+
return import_react25.Children.map(children, (child) => {
|
|
7231
|
+
if ((0, import_react25.isValidElement)(child)) {
|
|
6965
7232
|
const typedChild = child;
|
|
6966
7233
|
const newProps = {
|
|
6967
7234
|
store
|
|
@@ -6978,7 +7245,7 @@ var injectStore4 = (children, store, size, selectId) => {
|
|
|
6978
7245
|
selectId
|
|
6979
7246
|
);
|
|
6980
7247
|
}
|
|
6981
|
-
return (0,
|
|
7248
|
+
return (0, import_react25.cloneElement)(typedChild, newProps);
|
|
6982
7249
|
}
|
|
6983
7250
|
return child;
|
|
6984
7251
|
});
|
|
@@ -6995,18 +7262,18 @@ var Select = ({
|
|
|
6995
7262
|
errorMessage,
|
|
6996
7263
|
id
|
|
6997
7264
|
}) => {
|
|
6998
|
-
const storeRef = (0,
|
|
7265
|
+
const storeRef = (0, import_react25.useRef)(null);
|
|
6999
7266
|
storeRef.current ??= createSelectStore(onValueChange);
|
|
7000
7267
|
const store = storeRef.current;
|
|
7001
|
-
const selectRef = (0,
|
|
7268
|
+
const selectRef = (0, import_react25.useRef)(null);
|
|
7002
7269
|
const { open, setOpen, setValue, selectedLabel } = (0, import_zustand7.useStore)(store, (s) => s);
|
|
7003
|
-
const generatedId = (0,
|
|
7270
|
+
const generatedId = (0, import_react25.useId)();
|
|
7004
7271
|
const selectId = id ?? `select-${generatedId}`;
|
|
7005
7272
|
const findLabelForValue = (children2, targetValue) => {
|
|
7006
7273
|
let found = null;
|
|
7007
7274
|
const search = (nodes) => {
|
|
7008
|
-
|
|
7009
|
-
if (!(0,
|
|
7275
|
+
import_react25.Children.forEach(nodes, (child) => {
|
|
7276
|
+
if (!(0, import_react25.isValidElement)(child)) return;
|
|
7010
7277
|
const typedChild = child;
|
|
7011
7278
|
if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
|
|
7012
7279
|
if (typeof typedChild.props.children === "string")
|
|
@@ -7019,13 +7286,13 @@ var Select = ({
|
|
|
7019
7286
|
search(children2);
|
|
7020
7287
|
return found;
|
|
7021
7288
|
};
|
|
7022
|
-
(0,
|
|
7289
|
+
(0, import_react25.useEffect)(() => {
|
|
7023
7290
|
if (!selectedLabel && defaultValue) {
|
|
7024
7291
|
const label2 = findLabelForValue(children, defaultValue);
|
|
7025
7292
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
7026
7293
|
}
|
|
7027
7294
|
}, [children, defaultValue, selectedLabel]);
|
|
7028
|
-
(0,
|
|
7295
|
+
(0, import_react25.useEffect)(() => {
|
|
7029
7296
|
const handleClickOutside = (event) => {
|
|
7030
7297
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
7031
7298
|
setOpen(false);
|
|
@@ -7060,7 +7327,7 @@ var Select = ({
|
|
|
7060
7327
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
7061
7328
|
};
|
|
7062
7329
|
}, [open]);
|
|
7063
|
-
(0,
|
|
7330
|
+
(0, import_react25.useEffect)(() => {
|
|
7064
7331
|
if (propValue) {
|
|
7065
7332
|
setValue(propValue);
|
|
7066
7333
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -7068,8 +7335,8 @@ var Select = ({
|
|
|
7068
7335
|
}
|
|
7069
7336
|
}, [propValue]);
|
|
7070
7337
|
const sizeClasses = SIZE_CLASSES12[size];
|
|
7071
|
-
return /* @__PURE__ */ (0,
|
|
7072
|
-
label && /* @__PURE__ */ (0,
|
|
7338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cn("w-full", className), children: [
|
|
7339
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7073
7340
|
"label",
|
|
7074
7341
|
{
|
|
7075
7342
|
htmlFor: selectId,
|
|
@@ -7077,11 +7344,11 @@ var Select = ({
|
|
|
7077
7344
|
children: label
|
|
7078
7345
|
}
|
|
7079
7346
|
),
|
|
7080
|
-
/* @__PURE__ */ (0,
|
|
7081
|
-
(helperText || errorMessage) && /* @__PURE__ */ (0,
|
|
7082
|
-
helperText && /* @__PURE__ */ (0,
|
|
7083
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7347
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn("relative w-full"), ref: selectRef, children: injectStore4(children, store, size, selectId) }),
|
|
7348
|
+
(helperText || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
|
|
7349
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
|
|
7350
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
7351
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_phosphor_react17.WarningCircle, { size: 16 }),
|
|
7085
7352
|
" ",
|
|
7086
7353
|
errorMessage
|
|
7087
7354
|
] })
|
|
@@ -7095,9 +7362,9 @@ var SelectValue = ({
|
|
|
7095
7362
|
const store = useSelectStore(externalStore);
|
|
7096
7363
|
const selectedLabel = (0, import_zustand7.useStore)(store, (s) => s.selectedLabel);
|
|
7097
7364
|
const value = (0, import_zustand7.useStore)(store, (s) => s.value);
|
|
7098
|
-
return /* @__PURE__ */ (0,
|
|
7365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
|
|
7099
7366
|
};
|
|
7100
|
-
var SelectTrigger = (0,
|
|
7367
|
+
var SelectTrigger = (0, import_react25.forwardRef)(
|
|
7101
7368
|
({
|
|
7102
7369
|
className,
|
|
7103
7370
|
invalid = false,
|
|
@@ -7114,7 +7381,7 @@ var SelectTrigger = (0, import_react24.forwardRef)(
|
|
|
7114
7381
|
const variantClasses = VARIANT_CLASSES4[variant];
|
|
7115
7382
|
const heightClasses = HEIGHT_CLASSES[size];
|
|
7116
7383
|
const paddingClasses = PADDING_CLASSES[size];
|
|
7117
|
-
return /* @__PURE__ */ (0,
|
|
7384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7118
7385
|
"button",
|
|
7119
7386
|
{
|
|
7120
7387
|
ref,
|
|
@@ -7136,7 +7403,7 @@ var SelectTrigger = (0, import_react24.forwardRef)(
|
|
|
7136
7403
|
...props,
|
|
7137
7404
|
children: [
|
|
7138
7405
|
props.children,
|
|
7139
|
-
/* @__PURE__ */ (0,
|
|
7406
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7140
7407
|
import_phosphor_react17.CaretDown,
|
|
7141
7408
|
{
|
|
7142
7409
|
className: cn(
|
|
@@ -7151,7 +7418,7 @@ var SelectTrigger = (0, import_react24.forwardRef)(
|
|
|
7151
7418
|
}
|
|
7152
7419
|
);
|
|
7153
7420
|
SelectTrigger.displayName = "SelectTrigger";
|
|
7154
|
-
var SelectContent = (0,
|
|
7421
|
+
var SelectContent = (0, import_react25.forwardRef)(
|
|
7155
7422
|
({
|
|
7156
7423
|
children,
|
|
7157
7424
|
className,
|
|
@@ -7164,7 +7431,7 @@ var SelectContent = (0, import_react24.forwardRef)(
|
|
|
7164
7431
|
const open = (0, import_zustand7.useStore)(store, (s) => s.open);
|
|
7165
7432
|
if (!open) return null;
|
|
7166
7433
|
const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
7167
|
-
return /* @__PURE__ */ (0,
|
|
7434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7168
7435
|
"div",
|
|
7169
7436
|
{
|
|
7170
7437
|
role: "menu",
|
|
@@ -7181,7 +7448,7 @@ var SelectContent = (0, import_react24.forwardRef)(
|
|
|
7181
7448
|
}
|
|
7182
7449
|
);
|
|
7183
7450
|
SelectContent.displayName = "SelectContent";
|
|
7184
|
-
var SelectItem = (0,
|
|
7451
|
+
var SelectItem = (0, import_react25.forwardRef)(
|
|
7185
7452
|
({
|
|
7186
7453
|
className,
|
|
7187
7454
|
children,
|
|
@@ -7208,7 +7475,7 @@ var SelectItem = (0, import_react24.forwardRef)(
|
|
|
7208
7475
|
}
|
|
7209
7476
|
props.onClick?.(e);
|
|
7210
7477
|
};
|
|
7211
|
-
return /* @__PURE__ */ (0,
|
|
7478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7212
7479
|
"div",
|
|
7213
7480
|
{
|
|
7214
7481
|
role: "menuitem",
|
|
@@ -7228,7 +7495,7 @@ var SelectItem = (0, import_react24.forwardRef)(
|
|
|
7228
7495
|
tabIndex: disabled ? -1 : 0,
|
|
7229
7496
|
...props,
|
|
7230
7497
|
children: [
|
|
7231
|
-
/* @__PURE__ */ (0,
|
|
7498
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_phosphor_react17.Check, { className: "" }) }),
|
|
7232
7499
|
children
|
|
7233
7500
|
]
|
|
7234
7501
|
}
|
|
@@ -7240,9 +7507,9 @@ var Select_default = Select;
|
|
|
7240
7507
|
|
|
7241
7508
|
// src/components/Menu/Menu.tsx
|
|
7242
7509
|
var import_zustand8 = require("zustand");
|
|
7243
|
-
var
|
|
7510
|
+
var import_react26 = require("react");
|
|
7244
7511
|
var import_phosphor_react18 = require("phosphor-react");
|
|
7245
|
-
var
|
|
7512
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7246
7513
|
var createMenuStore = (onValueChange) => (0, import_zustand8.create)((set) => ({
|
|
7247
7514
|
value: "",
|
|
7248
7515
|
setValue: (value) => {
|
|
@@ -7261,7 +7528,7 @@ var VARIANT_CLASSES5 = {
|
|
|
7261
7528
|
"menu-overflow": "",
|
|
7262
7529
|
breadcrumb: "bg-transparent shadow-none !px-0"
|
|
7263
7530
|
};
|
|
7264
|
-
var Menu = (0,
|
|
7531
|
+
var Menu = (0, import_react26.forwardRef)(
|
|
7265
7532
|
({
|
|
7266
7533
|
className,
|
|
7267
7534
|
children,
|
|
@@ -7271,16 +7538,16 @@ var Menu = (0, import_react25.forwardRef)(
|
|
|
7271
7538
|
onValueChange,
|
|
7272
7539
|
...props
|
|
7273
7540
|
}, ref) => {
|
|
7274
|
-
const storeRef = (0,
|
|
7541
|
+
const storeRef = (0, import_react26.useRef)(null);
|
|
7275
7542
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
7276
7543
|
const store = storeRef.current;
|
|
7277
7544
|
const { setValue } = (0, import_zustand8.useStore)(store, (s) => s);
|
|
7278
|
-
(0,
|
|
7545
|
+
(0, import_react26.useEffect)(() => {
|
|
7279
7546
|
setValue(propValue ?? defaultValue);
|
|
7280
7547
|
}, [defaultValue, propValue, setValue]);
|
|
7281
7548
|
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";
|
|
7282
7549
|
const variantClasses = VARIANT_CLASSES5[variant];
|
|
7283
|
-
return /* @__PURE__ */ (0,
|
|
7550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7284
7551
|
"div",
|
|
7285
7552
|
{
|
|
7286
7553
|
ref,
|
|
@@ -7296,11 +7563,11 @@ var Menu = (0, import_react25.forwardRef)(
|
|
|
7296
7563
|
}
|
|
7297
7564
|
);
|
|
7298
7565
|
Menu.displayName = "Menu";
|
|
7299
|
-
var MenuContent = (0,
|
|
7566
|
+
var MenuContent = (0, import_react26.forwardRef)(
|
|
7300
7567
|
({ className, children, variant = "menu", ...props }, ref) => {
|
|
7301
7568
|
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
7302
7569
|
const variantClasses = variant === "menu2" || variant === "menu-overflow" ? "overflow-x-auto scroll-smooth" : "";
|
|
7303
|
-
return /* @__PURE__ */ (0,
|
|
7570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7304
7571
|
"ul",
|
|
7305
7572
|
{
|
|
7306
7573
|
ref,
|
|
@@ -7318,7 +7585,7 @@ var MenuContent = (0, import_react25.forwardRef)(
|
|
|
7318
7585
|
}
|
|
7319
7586
|
);
|
|
7320
7587
|
MenuContent.displayName = "MenuContent";
|
|
7321
|
-
var MenuItem = (0,
|
|
7588
|
+
var MenuItem = (0, import_react26.forwardRef)(
|
|
7322
7589
|
({
|
|
7323
7590
|
className,
|
|
7324
7591
|
children,
|
|
@@ -7352,7 +7619,7 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7352
7619
|
...props
|
|
7353
7620
|
};
|
|
7354
7621
|
const variants = {
|
|
7355
|
-
menu: /* @__PURE__ */ (0,
|
|
7622
|
+
menu: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7356
7623
|
"li",
|
|
7357
7624
|
{
|
|
7358
7625
|
"data-variant": "menu",
|
|
@@ -7367,7 +7634,7 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7367
7634
|
children
|
|
7368
7635
|
}
|
|
7369
7636
|
),
|
|
7370
|
-
menu2: /* @__PURE__ */ (0,
|
|
7637
|
+
menu2: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7371
7638
|
"li",
|
|
7372
7639
|
{
|
|
7373
7640
|
"data-variant": "menu2",
|
|
@@ -7378,7 +7645,7 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7378
7645
|
`,
|
|
7379
7646
|
...commonProps,
|
|
7380
7647
|
children: [
|
|
7381
|
-
/* @__PURE__ */ (0,
|
|
7648
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7382
7649
|
"span",
|
|
7383
7650
|
{
|
|
7384
7651
|
className: cn(
|
|
@@ -7388,11 +7655,11 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7388
7655
|
children
|
|
7389
7656
|
}
|
|
7390
7657
|
),
|
|
7391
|
-
selectedValue === value && /* @__PURE__ */ (0,
|
|
7658
|
+
selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
7392
7659
|
]
|
|
7393
7660
|
}
|
|
7394
7661
|
),
|
|
7395
|
-
"menu-overflow": /* @__PURE__ */ (0,
|
|
7662
|
+
"menu-overflow": /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7396
7663
|
"li",
|
|
7397
7664
|
{
|
|
7398
7665
|
"data-variant": "menu-overflow",
|
|
@@ -7403,7 +7670,7 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7403
7670
|
`,
|
|
7404
7671
|
...commonProps,
|
|
7405
7672
|
children: [
|
|
7406
|
-
/* @__PURE__ */ (0,
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7407
7674
|
"span",
|
|
7408
7675
|
{
|
|
7409
7676
|
className: cn(
|
|
@@ -7413,11 +7680,11 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7413
7680
|
children
|
|
7414
7681
|
}
|
|
7415
7682
|
),
|
|
7416
|
-
selectedValue === value && /* @__PURE__ */ (0,
|
|
7683
|
+
selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
7417
7684
|
]
|
|
7418
7685
|
}
|
|
7419
7686
|
),
|
|
7420
|
-
breadcrumb: /* @__PURE__ */ (0,
|
|
7687
|
+
breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7421
7688
|
"li",
|
|
7422
7689
|
{
|
|
7423
7690
|
"data-variant": "breadcrumb",
|
|
@@ -7429,7 +7696,7 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7429
7696
|
`,
|
|
7430
7697
|
...commonProps,
|
|
7431
7698
|
children: [
|
|
7432
|
-
/* @__PURE__ */ (0,
|
|
7699
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7433
7700
|
"span",
|
|
7434
7701
|
{
|
|
7435
7702
|
className: cn(
|
|
@@ -7439,7 +7706,7 @@ var MenuItem = (0, import_react25.forwardRef)(
|
|
|
7439
7706
|
children
|
|
7440
7707
|
}
|
|
7441
7708
|
),
|
|
7442
|
-
separator && /* @__PURE__ */ (0,
|
|
7709
|
+
separator && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7443
7710
|
import_phosphor_react18.CaretRight,
|
|
7444
7711
|
{
|
|
7445
7712
|
size: 16,
|
|
@@ -7476,10 +7743,10 @@ var MenuOverflow = ({
|
|
|
7476
7743
|
onValueChange,
|
|
7477
7744
|
...props
|
|
7478
7745
|
}) => {
|
|
7479
|
-
const containerRef = (0,
|
|
7480
|
-
const [showLeftArrow, setShowLeftArrow] = (0,
|
|
7481
|
-
const [showRightArrow, setShowRightArrow] = (0,
|
|
7482
|
-
(0,
|
|
7746
|
+
const containerRef = (0, import_react26.useRef)(null);
|
|
7747
|
+
const [showLeftArrow, setShowLeftArrow] = (0, import_react26.useState)(false);
|
|
7748
|
+
const [showRightArrow, setShowRightArrow] = (0, import_react26.useState)(false);
|
|
7749
|
+
(0, import_react26.useEffect)(() => {
|
|
7483
7750
|
const checkScroll = () => internalCheckScroll(
|
|
7484
7751
|
containerRef.current,
|
|
7485
7752
|
setShowLeftArrow,
|
|
@@ -7494,25 +7761,25 @@ var MenuOverflow = ({
|
|
|
7494
7761
|
window.removeEventListener("resize", checkScroll);
|
|
7495
7762
|
};
|
|
7496
7763
|
}, []);
|
|
7497
|
-
return /* @__PURE__ */ (0,
|
|
7764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7498
7765
|
"div",
|
|
7499
7766
|
{
|
|
7500
7767
|
"data-testid": "menu-overflow-wrapper",
|
|
7501
7768
|
className: cn("relative w-full overflow-hidden", className),
|
|
7502
7769
|
children: [
|
|
7503
|
-
showLeftArrow && /* @__PURE__ */ (0,
|
|
7770
|
+
showLeftArrow && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7504
7771
|
"button",
|
|
7505
7772
|
{
|
|
7506
7773
|
onClick: () => internalScroll(containerRef.current, "left"),
|
|
7507
7774
|
className: "absolute left-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
7508
7775
|
"data-testid": "scroll-left-button",
|
|
7509
7776
|
children: [
|
|
7510
|
-
/* @__PURE__ */ (0,
|
|
7511
|
-
/* @__PURE__ */ (0,
|
|
7777
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react18.CaretLeft, { size: 16 }),
|
|
7778
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "sr-only", children: "Scroll left" })
|
|
7512
7779
|
]
|
|
7513
7780
|
}
|
|
7514
7781
|
),
|
|
7515
|
-
/* @__PURE__ */ (0,
|
|
7782
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7516
7783
|
Menu,
|
|
7517
7784
|
{
|
|
7518
7785
|
defaultValue,
|
|
@@ -7520,18 +7787,18 @@ var MenuOverflow = ({
|
|
|
7520
7787
|
value,
|
|
7521
7788
|
variant: "menu2",
|
|
7522
7789
|
...props,
|
|
7523
|
-
children: /* @__PURE__ */ (0,
|
|
7790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(MenuContent, { ref: containerRef, variant: "menu2", children })
|
|
7524
7791
|
}
|
|
7525
7792
|
),
|
|
7526
|
-
showRightArrow && /* @__PURE__ */ (0,
|
|
7793
|
+
showRightArrow && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7527
7794
|
"button",
|
|
7528
7795
|
{
|
|
7529
7796
|
onClick: () => internalScroll(containerRef.current, "right"),
|
|
7530
7797
|
className: "absolute right-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
7531
7798
|
"data-testid": "scroll-right-button",
|
|
7532
7799
|
children: [
|
|
7533
|
-
/* @__PURE__ */ (0,
|
|
7534
|
-
/* @__PURE__ */ (0,
|
|
7800
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react18.CaretRight, { size: 16 }),
|
|
7801
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "sr-only", children: "Scroll right" })
|
|
7535
7802
|
]
|
|
7536
7803
|
}
|
|
7537
7804
|
)
|
|
@@ -7539,11 +7806,11 @@ var MenuOverflow = ({
|
|
|
7539
7806
|
}
|
|
7540
7807
|
);
|
|
7541
7808
|
};
|
|
7542
|
-
var injectStore5 = (children, store) =>
|
|
7543
|
-
if (!(0,
|
|
7809
|
+
var injectStore5 = (children, store) => import_react26.Children.map(children, (child) => {
|
|
7810
|
+
if (!(0, import_react26.isValidElement)(child)) return child;
|
|
7544
7811
|
const typedChild = child;
|
|
7545
7812
|
const shouldInject = typedChild.type === MenuItem;
|
|
7546
|
-
return (0,
|
|
7813
|
+
return (0, import_react26.cloneElement)(typedChild, {
|
|
7547
7814
|
...shouldInject ? { store } : {},
|
|
7548
7815
|
...typedChild.props.children ? { children: injectStore5(typedChild.props.children, store) } : {}
|
|
7549
7816
|
});
|
|
@@ -7551,13 +7818,13 @@ var injectStore5 = (children, store) => import_react25.Children.map(children, (c
|
|
|
7551
7818
|
var Menu_default = Menu;
|
|
7552
7819
|
|
|
7553
7820
|
// src/components/Card/Card.tsx
|
|
7554
|
-
var
|
|
7821
|
+
var import_react28 = require("react");
|
|
7555
7822
|
var import_phosphor_react19 = require("phosphor-react");
|
|
7556
7823
|
|
|
7557
7824
|
// src/components/IconRender/IconRender.tsx
|
|
7558
|
-
var
|
|
7825
|
+
var import_react27 = require("react");
|
|
7559
7826
|
var PhosphorIcons = __toESM(require("phosphor-react"));
|
|
7560
|
-
var
|
|
7827
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7561
7828
|
var IconRender = ({
|
|
7562
7829
|
iconName,
|
|
7563
7830
|
color = "#000000",
|
|
@@ -7567,18 +7834,18 @@ var IconRender = ({
|
|
|
7567
7834
|
if (typeof iconName === "string") {
|
|
7568
7835
|
switch (iconName) {
|
|
7569
7836
|
case "Chat_PT":
|
|
7570
|
-
return /* @__PURE__ */ (0,
|
|
7837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChatPT, { size, color });
|
|
7571
7838
|
case "Chat_EN":
|
|
7572
|
-
return /* @__PURE__ */ (0,
|
|
7839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChatEN, { size, color });
|
|
7573
7840
|
case "Chat_ES":
|
|
7574
|
-
return /* @__PURE__ */ (0,
|
|
7841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChatES, { size, color });
|
|
7575
7842
|
default: {
|
|
7576
7843
|
const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
|
|
7577
|
-
return /* @__PURE__ */ (0,
|
|
7844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(IconComponent, { size, color, weight });
|
|
7578
7845
|
}
|
|
7579
7846
|
}
|
|
7580
7847
|
} else {
|
|
7581
|
-
return (0,
|
|
7848
|
+
return (0, import_react27.cloneElement)(iconName, {
|
|
7582
7849
|
size,
|
|
7583
7850
|
color: "currentColor"
|
|
7584
7851
|
});
|
|
@@ -7587,7 +7854,7 @@ var IconRender = ({
|
|
|
7587
7854
|
var IconRender_default = IconRender;
|
|
7588
7855
|
|
|
7589
7856
|
// src/components/Card/Card.tsx
|
|
7590
|
-
var
|
|
7857
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7591
7858
|
var CARD_BASE_CLASSES = {
|
|
7592
7859
|
default: "w-full bg-background border border-border-50 rounded-xl",
|
|
7593
7860
|
compact: "w-full bg-background border border-border-50 rounded-lg",
|
|
@@ -7613,7 +7880,7 @@ var CARD_CURSOR_CLASSES = {
|
|
|
7613
7880
|
default: "",
|
|
7614
7881
|
pointer: "cursor-pointer"
|
|
7615
7882
|
};
|
|
7616
|
-
var CardBase = (0,
|
|
7883
|
+
var CardBase = (0, import_react28.forwardRef)(
|
|
7617
7884
|
({
|
|
7618
7885
|
children,
|
|
7619
7886
|
variant = "default",
|
|
@@ -7629,7 +7896,7 @@ var CardBase = (0, import_react27.forwardRef)(
|
|
|
7629
7896
|
const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
|
|
7630
7897
|
const layoutClasses = CARD_LAYOUT_CLASSES[layout];
|
|
7631
7898
|
const cursorClasses = CARD_CURSOR_CLASSES[cursor];
|
|
7632
|
-
return /* @__PURE__ */ (0,
|
|
7899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7633
7900
|
"div",
|
|
7634
7901
|
{
|
|
7635
7902
|
ref,
|
|
@@ -7671,7 +7938,7 @@ var ACTION_HEADER_CLASSES = {
|
|
|
7671
7938
|
error: "text-error-300",
|
|
7672
7939
|
info: "text-info-300"
|
|
7673
7940
|
};
|
|
7674
|
-
var CardActivitiesResults = (0,
|
|
7941
|
+
var CardActivitiesResults = (0, import_react28.forwardRef)(
|
|
7675
7942
|
({
|
|
7676
7943
|
icon,
|
|
7677
7944
|
title,
|
|
@@ -7687,7 +7954,7 @@ var CardActivitiesResults = (0, import_react27.forwardRef)(
|
|
|
7687
7954
|
const actionIconClasses = ACTION_ICON_CLASSES[action];
|
|
7688
7955
|
const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
|
|
7689
7956
|
const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
|
|
7690
|
-
return /* @__PURE__ */ (0,
|
|
7957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7691
7958
|
"div",
|
|
7692
7959
|
{
|
|
7693
7960
|
ref,
|
|
@@ -7697,7 +7964,7 @@ var CardActivitiesResults = (0, import_react27.forwardRef)(
|
|
|
7697
7964
|
),
|
|
7698
7965
|
...props,
|
|
7699
7966
|
children: [
|
|
7700
|
-
/* @__PURE__ */ (0,
|
|
7967
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7701
7968
|
"div",
|
|
7702
7969
|
{
|
|
7703
7970
|
className: cn(
|
|
@@ -7706,7 +7973,7 @@ var CardActivitiesResults = (0, import_react27.forwardRef)(
|
|
|
7706
7973
|
extended ? "rounded-t-xl" : "rounded-xl"
|
|
7707
7974
|
),
|
|
7708
7975
|
children: [
|
|
7709
|
-
/* @__PURE__ */ (0,
|
|
7976
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7710
7977
|
"span",
|
|
7711
7978
|
{
|
|
7712
7979
|
className: cn(
|
|
@@ -7716,7 +7983,7 @@ var CardActivitiesResults = (0, import_react27.forwardRef)(
|
|
|
7716
7983
|
children: icon
|
|
7717
7984
|
}
|
|
7718
7985
|
),
|
|
7719
|
-
/* @__PURE__ */ (0,
|
|
7986
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7720
7987
|
Text_default,
|
|
7721
7988
|
{
|
|
7722
7989
|
size: "2xs",
|
|
@@ -7725,7 +7992,7 @@ var CardActivitiesResults = (0, import_react27.forwardRef)(
|
|
|
7725
7992
|
children: title
|
|
7726
7993
|
}
|
|
7727
7994
|
),
|
|
7728
|
-
/* @__PURE__ */ (0,
|
|
7995
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7729
7996
|
"p",
|
|
7730
7997
|
{
|
|
7731
7998
|
className: cn("text-lg font-bold truncate", actionSubTitleClasses),
|
|
@@ -7735,8 +8002,8 @@ var CardActivitiesResults = (0, import_react27.forwardRef)(
|
|
|
7735
8002
|
]
|
|
7736
8003
|
}
|
|
7737
8004
|
),
|
|
7738
|
-
extended && /* @__PURE__ */ (0,
|
|
7739
|
-
/* @__PURE__ */ (0,
|
|
8005
|
+
extended && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
|
|
8006
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7740
8007
|
"p",
|
|
7741
8008
|
{
|
|
7742
8009
|
className: cn(
|
|
@@ -7746,14 +8013,14 @@ var CardActivitiesResults = (0, import_react27.forwardRef)(
|
|
|
7746
8013
|
children: header
|
|
7747
8014
|
}
|
|
7748
8015
|
),
|
|
7749
|
-
/* @__PURE__ */ (0,
|
|
8016
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Badge_default, { size: "large", action: "info", children: description })
|
|
7750
8017
|
] })
|
|
7751
8018
|
]
|
|
7752
8019
|
}
|
|
7753
8020
|
);
|
|
7754
8021
|
}
|
|
7755
8022
|
);
|
|
7756
|
-
var CardQuestions = (0,
|
|
8023
|
+
var CardQuestions = (0, import_react28.forwardRef)(
|
|
7757
8024
|
({
|
|
7758
8025
|
header,
|
|
7759
8026
|
state = "undone",
|
|
@@ -7765,7 +8032,7 @@ var CardQuestions = (0, import_react27.forwardRef)(
|
|
|
7765
8032
|
const isDone = state === "done";
|
|
7766
8033
|
const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
|
|
7767
8034
|
const buttonLabel = isDone ? "Ver Resultado" : "Responder";
|
|
7768
|
-
return /* @__PURE__ */ (0,
|
|
8035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7769
8036
|
CardBase,
|
|
7770
8037
|
{
|
|
7771
8038
|
ref,
|
|
@@ -7775,9 +8042,9 @@ var CardQuestions = (0, import_react27.forwardRef)(
|
|
|
7775
8042
|
className: cn("justify-between gap-4", className),
|
|
7776
8043
|
...props,
|
|
7777
8044
|
children: [
|
|
7778
|
-
/* @__PURE__ */ (0,
|
|
7779
|
-
/* @__PURE__ */ (0,
|
|
7780
|
-
/* @__PURE__ */ (0,
|
|
8045
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
8046
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
|
|
8047
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7781
8048
|
Badge_default,
|
|
7782
8049
|
{
|
|
7783
8050
|
size: "medium",
|
|
@@ -7787,7 +8054,7 @@ var CardQuestions = (0, import_react27.forwardRef)(
|
|
|
7787
8054
|
}
|
|
7788
8055
|
) })
|
|
7789
8056
|
] }),
|
|
7790
|
-
/* @__PURE__ */ (0,
|
|
8057
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7791
8058
|
Button_default,
|
|
7792
8059
|
{
|
|
7793
8060
|
size: "extra-small",
|
|
@@ -7801,7 +8068,7 @@ var CardQuestions = (0, import_react27.forwardRef)(
|
|
|
7801
8068
|
);
|
|
7802
8069
|
}
|
|
7803
8070
|
);
|
|
7804
|
-
var CardProgress = (0,
|
|
8071
|
+
var CardProgress = (0, import_react28.forwardRef)(
|
|
7805
8072
|
({
|
|
7806
8073
|
header,
|
|
7807
8074
|
subhead,
|
|
@@ -7818,19 +8085,19 @@ var CardProgress = (0, import_react27.forwardRef)(
|
|
|
7818
8085
|
}, ref) => {
|
|
7819
8086
|
const isHorizontal = direction === "horizontal";
|
|
7820
8087
|
const contentComponent = {
|
|
7821
|
-
horizontal: /* @__PURE__ */ (0,
|
|
7822
|
-
showDates && /* @__PURE__ */ (0,
|
|
7823
|
-
initialDate && /* @__PURE__ */ (0,
|
|
7824
|
-
/* @__PURE__ */ (0,
|
|
7825
|
-
/* @__PURE__ */ (0,
|
|
8088
|
+
horizontal: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
8089
|
+
showDates && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
|
|
8090
|
+
initialDate && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
8091
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
|
|
8092
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-text-600", children: initialDate })
|
|
7826
8093
|
] }),
|
|
7827
|
-
endDate && /* @__PURE__ */ (0,
|
|
7828
|
-
/* @__PURE__ */ (0,
|
|
7829
|
-
/* @__PURE__ */ (0,
|
|
8094
|
+
endDate && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
8095
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-text-600", children: endDate })
|
|
7830
8097
|
] })
|
|
7831
8098
|
] }),
|
|
7832
|
-
/* @__PURE__ */ (0,
|
|
7833
|
-
/* @__PURE__ */ (0,
|
|
8099
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
8100
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7834
8101
|
ProgressBar_default,
|
|
7835
8102
|
{
|
|
7836
8103
|
size: "small",
|
|
@@ -7839,7 +8106,7 @@ var CardProgress = (0, import_react27.forwardRef)(
|
|
|
7839
8106
|
"data-testid": "progress-bar"
|
|
7840
8107
|
}
|
|
7841
8108
|
),
|
|
7842
|
-
/* @__PURE__ */ (0,
|
|
8109
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7843
8110
|
Text_default,
|
|
7844
8111
|
{
|
|
7845
8112
|
size: "xs",
|
|
@@ -7855,9 +8122,9 @@ var CardProgress = (0, import_react27.forwardRef)(
|
|
|
7855
8122
|
)
|
|
7856
8123
|
] })
|
|
7857
8124
|
] }),
|
|
7858
|
-
vertical: /* @__PURE__ */ (0,
|
|
8125
|
+
vertical: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm text-text-800", children: subhead })
|
|
7859
8126
|
};
|
|
7860
|
-
return /* @__PURE__ */ (0,
|
|
8127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7861
8128
|
CardBase,
|
|
7862
8129
|
{
|
|
7863
8130
|
ref,
|
|
@@ -7868,7 +8135,7 @@ var CardProgress = (0, import_react27.forwardRef)(
|
|
|
7868
8135
|
className: cn(isHorizontal ? "h-20" : "", className),
|
|
7869
8136
|
...props,
|
|
7870
8137
|
children: [
|
|
7871
|
-
/* @__PURE__ */ (0,
|
|
8138
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7872
8139
|
"div",
|
|
7873
8140
|
{
|
|
7874
8141
|
className: cn(
|
|
@@ -7881,7 +8148,7 @@ var CardProgress = (0, import_react27.forwardRef)(
|
|
|
7881
8148
|
children: icon
|
|
7882
8149
|
}
|
|
7883
8150
|
),
|
|
7884
|
-
/* @__PURE__ */ (0,
|
|
8151
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7885
8152
|
"div",
|
|
7886
8153
|
{
|
|
7887
8154
|
className: cn(
|
|
@@ -7889,7 +8156,7 @@ var CardProgress = (0, import_react27.forwardRef)(
|
|
|
7889
8156
|
!isHorizontal && "gap-4"
|
|
7890
8157
|
),
|
|
7891
8158
|
children: [
|
|
7892
|
-
/* @__PURE__ */ (0,
|
|
8159
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
|
|
7893
8160
|
contentComponent[direction]
|
|
7894
8161
|
]
|
|
7895
8162
|
}
|
|
@@ -7899,7 +8166,7 @@ var CardProgress = (0, import_react27.forwardRef)(
|
|
|
7899
8166
|
);
|
|
7900
8167
|
}
|
|
7901
8168
|
);
|
|
7902
|
-
var CardTopic = (0,
|
|
8169
|
+
var CardTopic = (0, import_react28.forwardRef)(
|
|
7903
8170
|
({
|
|
7904
8171
|
header,
|
|
7905
8172
|
subHead,
|
|
@@ -7909,7 +8176,7 @@ var CardTopic = (0, import_react27.forwardRef)(
|
|
|
7909
8176
|
className = "",
|
|
7910
8177
|
...props
|
|
7911
8178
|
}, ref) => {
|
|
7912
|
-
return /* @__PURE__ */ (0,
|
|
8179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7913
8180
|
CardBase,
|
|
7914
8181
|
{
|
|
7915
8182
|
ref,
|
|
@@ -7920,13 +8187,13 @@ var CardTopic = (0, import_react27.forwardRef)(
|
|
|
7920
8187
|
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
7921
8188
|
...props,
|
|
7922
8189
|
children: [
|
|
7923
|
-
subHead && /* @__PURE__ */ (0,
|
|
7924
|
-
/* @__PURE__ */ (0,
|
|
7925
|
-
index < subHead.length - 1 && /* @__PURE__ */ (0,
|
|
8190
|
+
subHead && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react28.Fragment, { children: [
|
|
8191
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: text }),
|
|
8192
|
+
index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: "\u2022" })
|
|
7926
8193
|
] }, `${text} - ${index}`)) }),
|
|
7927
|
-
/* @__PURE__ */ (0,
|
|
7928
|
-
/* @__PURE__ */ (0,
|
|
7929
|
-
/* @__PURE__ */ (0,
|
|
8194
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
|
|
8195
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
8196
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7930
8197
|
ProgressBar_default,
|
|
7931
8198
|
{
|
|
7932
8199
|
size: "small",
|
|
@@ -7935,7 +8202,7 @@ var CardTopic = (0, import_react27.forwardRef)(
|
|
|
7935
8202
|
"data-testid": "progress-bar"
|
|
7936
8203
|
}
|
|
7937
8204
|
),
|
|
7938
|
-
showPercentage && /* @__PURE__ */ (0,
|
|
8205
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7939
8206
|
Text_default,
|
|
7940
8207
|
{
|
|
7941
8208
|
size: "xs",
|
|
@@ -7955,7 +8222,7 @@ var CardTopic = (0, import_react27.forwardRef)(
|
|
|
7955
8222
|
);
|
|
7956
8223
|
}
|
|
7957
8224
|
);
|
|
7958
|
-
var CardPerformance = (0,
|
|
8225
|
+
var CardPerformance = (0, import_react28.forwardRef)(
|
|
7959
8226
|
({
|
|
7960
8227
|
header,
|
|
7961
8228
|
progress,
|
|
@@ -7969,7 +8236,7 @@ var CardPerformance = (0, import_react27.forwardRef)(
|
|
|
7969
8236
|
...props
|
|
7970
8237
|
}, ref) => {
|
|
7971
8238
|
const hasProgress = progress !== void 0;
|
|
7972
|
-
return /* @__PURE__ */ (0,
|
|
8239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7973
8240
|
CardBase,
|
|
7974
8241
|
{
|
|
7975
8242
|
ref,
|
|
@@ -7983,10 +8250,10 @@ var CardPerformance = (0, import_react27.forwardRef)(
|
|
|
7983
8250
|
onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
|
|
7984
8251
|
...props,
|
|
7985
8252
|
children: [
|
|
7986
|
-
/* @__PURE__ */ (0,
|
|
7987
|
-
/* @__PURE__ */ (0,
|
|
7988
|
-
/* @__PURE__ */ (0,
|
|
7989
|
-
actionVariant === "button" && /* @__PURE__ */ (0,
|
|
8253
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
|
|
8254
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-row justify-between items-center gap-2", children: [
|
|
8255
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
8256
|
+
actionVariant === "button" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7990
8257
|
Button_default,
|
|
7991
8258
|
{
|
|
7992
8259
|
variant: "outline",
|
|
@@ -7997,16 +8264,16 @@ var CardPerformance = (0, import_react27.forwardRef)(
|
|
|
7997
8264
|
}
|
|
7998
8265
|
)
|
|
7999
8266
|
] }),
|
|
8000
|
-
/* @__PURE__ */ (0,
|
|
8267
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8001
8268
|
ProgressBar_default,
|
|
8002
8269
|
{
|
|
8003
8270
|
value: progress,
|
|
8004
8271
|
label: `${progress}% ${labelProgress}`,
|
|
8005
8272
|
variant: progressVariant
|
|
8006
8273
|
}
|
|
8007
|
-
) : /* @__PURE__ */ (0,
|
|
8274
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-xs text-text-600 truncate", children: description }) })
|
|
8008
8275
|
] }),
|
|
8009
|
-
actionVariant == "caret" && /* @__PURE__ */ (0,
|
|
8276
|
+
actionVariant == "caret" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8010
8277
|
import_phosphor_react19.CaretRight,
|
|
8011
8278
|
{
|
|
8012
8279
|
className: "size-4.5 text-text-800 cursor-pointer",
|
|
@@ -8018,7 +8285,7 @@ var CardPerformance = (0, import_react27.forwardRef)(
|
|
|
8018
8285
|
);
|
|
8019
8286
|
}
|
|
8020
8287
|
);
|
|
8021
|
-
var CardResults = (0,
|
|
8288
|
+
var CardResults = (0, import_react28.forwardRef)(
|
|
8022
8289
|
({
|
|
8023
8290
|
header,
|
|
8024
8291
|
correct_answers,
|
|
@@ -8030,7 +8297,7 @@ var CardResults = (0, import_react27.forwardRef)(
|
|
|
8030
8297
|
...props
|
|
8031
8298
|
}, ref) => {
|
|
8032
8299
|
const isRow = direction == "row";
|
|
8033
|
-
return /* @__PURE__ */ (0,
|
|
8300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8034
8301
|
CardBase,
|
|
8035
8302
|
{
|
|
8036
8303
|
ref,
|
|
@@ -8040,7 +8307,7 @@ var CardResults = (0, import_react27.forwardRef)(
|
|
|
8040
8307
|
className: cn("items-stretch cursor-pointer pr-4", className),
|
|
8041
8308
|
...props,
|
|
8042
8309
|
children: [
|
|
8043
|
-
/* @__PURE__ */ (0,
|
|
8310
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8044
8311
|
"div",
|
|
8045
8312
|
{
|
|
8046
8313
|
className: cn(
|
|
@@ -8049,11 +8316,11 @@ var CardResults = (0, import_react27.forwardRef)(
|
|
|
8049
8316
|
style: {
|
|
8050
8317
|
backgroundColor: color
|
|
8051
8318
|
},
|
|
8052
|
-
children: /* @__PURE__ */ (0,
|
|
8319
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
|
|
8053
8320
|
}
|
|
8054
8321
|
),
|
|
8055
|
-
/* @__PURE__ */ (0,
|
|
8056
|
-
/* @__PURE__ */ (0,
|
|
8322
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "w-full flex flex-row justify-between items-center", children: [
|
|
8323
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8057
8324
|
"div",
|
|
8058
8325
|
{
|
|
8059
8326
|
className: cn(
|
|
@@ -8061,28 +8328,28 @@ var CardResults = (0, import_react27.forwardRef)(
|
|
|
8061
8328
|
isRow ? "flex-row items-center gap-2" : "flex-col"
|
|
8062
8329
|
),
|
|
8063
8330
|
children: [
|
|
8064
|
-
/* @__PURE__ */ (0,
|
|
8065
|
-
/* @__PURE__ */ (0,
|
|
8066
|
-
/* @__PURE__ */ (0,
|
|
8331
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
|
|
8332
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
|
|
8333
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8067
8334
|
Badge_default,
|
|
8068
8335
|
{
|
|
8069
8336
|
action: "success",
|
|
8070
8337
|
variant: "solid",
|
|
8071
8338
|
size: "large",
|
|
8072
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
8339
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.CheckCircle, {}),
|
|
8073
8340
|
children: [
|
|
8074
8341
|
correct_answers,
|
|
8075
8342
|
" Corretas"
|
|
8076
8343
|
]
|
|
8077
8344
|
}
|
|
8078
8345
|
),
|
|
8079
|
-
/* @__PURE__ */ (0,
|
|
8346
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8080
8347
|
Badge_default,
|
|
8081
8348
|
{
|
|
8082
8349
|
action: "error",
|
|
8083
8350
|
variant: "solid",
|
|
8084
8351
|
size: "large",
|
|
8085
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
8352
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.XCircle, {}),
|
|
8086
8353
|
children: [
|
|
8087
8354
|
incorrect_answers,
|
|
8088
8355
|
" Incorretas"
|
|
@@ -8093,14 +8360,14 @@ var CardResults = (0, import_react27.forwardRef)(
|
|
|
8093
8360
|
]
|
|
8094
8361
|
}
|
|
8095
8362
|
),
|
|
8096
|
-
/* @__PURE__ */ (0,
|
|
8363
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
|
|
8097
8364
|
] })
|
|
8098
8365
|
]
|
|
8099
8366
|
}
|
|
8100
8367
|
);
|
|
8101
8368
|
}
|
|
8102
8369
|
);
|
|
8103
|
-
var CardStatus = (0,
|
|
8370
|
+
var CardStatus = (0, import_react28.forwardRef)(
|
|
8104
8371
|
({ header, className, status, label, ...props }, ref) => {
|
|
8105
8372
|
const getLabelBadge = (status2) => {
|
|
8106
8373
|
switch (status2) {
|
|
@@ -8119,13 +8386,13 @@ var CardStatus = (0, import_react27.forwardRef)(
|
|
|
8119
8386
|
const getIconBadge = (status2) => {
|
|
8120
8387
|
switch (status2) {
|
|
8121
8388
|
case "correct":
|
|
8122
|
-
return /* @__PURE__ */ (0,
|
|
8389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.CheckCircle, {});
|
|
8123
8390
|
case "incorrect":
|
|
8124
|
-
return /* @__PURE__ */ (0,
|
|
8391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.XCircle, {});
|
|
8125
8392
|
case "pending":
|
|
8126
|
-
return /* @__PURE__ */ (0,
|
|
8393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.Clock, {});
|
|
8127
8394
|
default:
|
|
8128
|
-
return /* @__PURE__ */ (0,
|
|
8395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.XCircle, {});
|
|
8129
8396
|
}
|
|
8130
8397
|
};
|
|
8131
8398
|
const getActionBadge = (status2) => {
|
|
@@ -8140,7 +8407,7 @@ var CardStatus = (0, import_react27.forwardRef)(
|
|
|
8140
8407
|
return "info";
|
|
8141
8408
|
}
|
|
8142
8409
|
};
|
|
8143
|
-
return /* @__PURE__ */ (0,
|
|
8410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8144
8411
|
CardBase,
|
|
8145
8412
|
{
|
|
8146
8413
|
ref,
|
|
@@ -8149,10 +8416,10 @@ var CardStatus = (0, import_react27.forwardRef)(
|
|
|
8149
8416
|
minHeight: "medium",
|
|
8150
8417
|
className: cn("items-center cursor-pointer", className),
|
|
8151
8418
|
...props,
|
|
8152
|
-
children: /* @__PURE__ */ (0,
|
|
8153
|
-
/* @__PURE__ */ (0,
|
|
8154
|
-
/* @__PURE__ */ (0,
|
|
8155
|
-
status && /* @__PURE__ */ (0,
|
|
8419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
8420
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
8421
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
|
|
8422
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8156
8423
|
Badge_default,
|
|
8157
8424
|
{
|
|
8158
8425
|
action: getActionBadge(status),
|
|
@@ -8162,17 +8429,17 @@ var CardStatus = (0, import_react27.forwardRef)(
|
|
|
8162
8429
|
children: getLabelBadge(status)
|
|
8163
8430
|
}
|
|
8164
8431
|
),
|
|
8165
|
-
label && /* @__PURE__ */ (0,
|
|
8432
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm text-text-800", children: label })
|
|
8166
8433
|
] }),
|
|
8167
|
-
/* @__PURE__ */ (0,
|
|
8434
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
|
|
8168
8435
|
] })
|
|
8169
8436
|
}
|
|
8170
8437
|
);
|
|
8171
8438
|
}
|
|
8172
8439
|
);
|
|
8173
|
-
var CardSettings = (0,
|
|
8440
|
+
var CardSettings = (0, import_react28.forwardRef)(
|
|
8174
8441
|
({ header, className, icon, ...props }, ref) => {
|
|
8175
|
-
return /* @__PURE__ */ (0,
|
|
8442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8176
8443
|
CardBase,
|
|
8177
8444
|
{
|
|
8178
8445
|
ref,
|
|
@@ -8185,17 +8452,17 @@ var CardSettings = (0, import_react27.forwardRef)(
|
|
|
8185
8452
|
),
|
|
8186
8453
|
...props,
|
|
8187
8454
|
children: [
|
|
8188
|
-
/* @__PURE__ */ (0,
|
|
8189
|
-
/* @__PURE__ */ (0,
|
|
8190
|
-
/* @__PURE__ */ (0,
|
|
8455
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
|
|
8456
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "w-full text-sm truncate", children: header }),
|
|
8457
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.CaretRight, { size: 24, className: "cursor-pointer" })
|
|
8191
8458
|
]
|
|
8192
8459
|
}
|
|
8193
8460
|
);
|
|
8194
8461
|
}
|
|
8195
8462
|
);
|
|
8196
|
-
var CardSupport = (0,
|
|
8463
|
+
var CardSupport = (0, import_react28.forwardRef)(
|
|
8197
8464
|
({ header, className, direction = "col", children, ...props }, ref) => {
|
|
8198
|
-
return /* @__PURE__ */ (0,
|
|
8465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8199
8466
|
CardBase,
|
|
8200
8467
|
{
|
|
8201
8468
|
ref,
|
|
@@ -8208,7 +8475,7 @@ var CardSupport = (0, import_react27.forwardRef)(
|
|
|
8208
8475
|
),
|
|
8209
8476
|
...props,
|
|
8210
8477
|
children: [
|
|
8211
|
-
/* @__PURE__ */ (0,
|
|
8478
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8212
8479
|
"div",
|
|
8213
8480
|
{
|
|
8214
8481
|
className: cn(
|
|
@@ -8216,18 +8483,18 @@ var CardSupport = (0, import_react27.forwardRef)(
|
|
|
8216
8483
|
direction == "col" ? "flex-col" : "flex-row items-center"
|
|
8217
8484
|
),
|
|
8218
8485
|
children: [
|
|
8219
|
-
/* @__PURE__ */ (0,
|
|
8220
|
-
/* @__PURE__ */ (0,
|
|
8486
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
|
|
8487
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex flex-row gap-1", children })
|
|
8221
8488
|
]
|
|
8222
8489
|
}
|
|
8223
8490
|
),
|
|
8224
|
-
/* @__PURE__ */ (0,
|
|
8491
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
|
|
8225
8492
|
]
|
|
8226
8493
|
}
|
|
8227
8494
|
);
|
|
8228
8495
|
}
|
|
8229
8496
|
);
|
|
8230
|
-
var CardForum = (0,
|
|
8497
|
+
var CardForum = (0, import_react28.forwardRef)(
|
|
8231
8498
|
({
|
|
8232
8499
|
title,
|
|
8233
8500
|
content,
|
|
@@ -8241,7 +8508,7 @@ var CardForum = (0, import_react27.forwardRef)(
|
|
|
8241
8508
|
hour,
|
|
8242
8509
|
...props
|
|
8243
8510
|
}, ref) => {
|
|
8244
|
-
return /* @__PURE__ */ (0,
|
|
8511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8245
8512
|
CardBase,
|
|
8246
8513
|
{
|
|
8247
8514
|
ref,
|
|
@@ -8252,7 +8519,7 @@ var CardForum = (0, import_react27.forwardRef)(
|
|
|
8252
8519
|
className: cn("w-auto h-auto gap-3", className),
|
|
8253
8520
|
...props,
|
|
8254
8521
|
children: [
|
|
8255
|
-
/* @__PURE__ */ (0,
|
|
8522
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8256
8523
|
"button",
|
|
8257
8524
|
{
|
|
8258
8525
|
type: "button",
|
|
@@ -8261,18 +8528,18 @@ var CardForum = (0, import_react27.forwardRef)(
|
|
|
8261
8528
|
className: "min-w-8 h-8 rounded-full bg-background-950"
|
|
8262
8529
|
}
|
|
8263
8530
|
),
|
|
8264
|
-
/* @__PURE__ */ (0,
|
|
8265
|
-
/* @__PURE__ */ (0,
|
|
8266
|
-
/* @__PURE__ */ (0,
|
|
8267
|
-
/* @__PURE__ */ (0,
|
|
8531
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
8532
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
|
|
8533
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "text-xs text-text-600", children: [
|
|
8268
8535
|
"\u2022 ",
|
|
8269
8536
|
date,
|
|
8270
8537
|
" \u2022 ",
|
|
8271
8538
|
hour
|
|
8272
8539
|
] })
|
|
8273
8540
|
] }),
|
|
8274
|
-
/* @__PURE__ */ (0,
|
|
8275
|
-
/* @__PURE__ */ (0,
|
|
8541
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
|
|
8542
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8276
8543
|
"button",
|
|
8277
8544
|
{
|
|
8278
8545
|
type: "button",
|
|
@@ -8280,8 +8547,8 @@ var CardForum = (0, import_react27.forwardRef)(
|
|
|
8280
8547
|
onClick: () => onClickComments?.(valueComments),
|
|
8281
8548
|
className: "text-text-600 flex flex-row gap-2 items-center",
|
|
8282
8549
|
children: [
|
|
8283
|
-
/* @__PURE__ */ (0,
|
|
8284
|
-
/* @__PURE__ */ (0,
|
|
8550
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.ChatCircleText, { "aria-hidden": "true", size: 16 }),
|
|
8551
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "text-xs", children: [
|
|
8285
8552
|
comments,
|
|
8286
8553
|
" respostas"
|
|
8287
8554
|
] })
|
|
@@ -8294,7 +8561,7 @@ var CardForum = (0, import_react27.forwardRef)(
|
|
|
8294
8561
|
);
|
|
8295
8562
|
}
|
|
8296
8563
|
);
|
|
8297
|
-
var CardAudio = (0,
|
|
8564
|
+
var CardAudio = (0, import_react28.forwardRef)(
|
|
8298
8565
|
({
|
|
8299
8566
|
src,
|
|
8300
8567
|
title,
|
|
@@ -8308,16 +8575,16 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8308
8575
|
className,
|
|
8309
8576
|
...props
|
|
8310
8577
|
}, ref) => {
|
|
8311
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
8312
|
-
const [currentTime, setCurrentTime] = (0,
|
|
8313
|
-
const [duration, setDuration] = (0,
|
|
8314
|
-
const [volume, setVolume] = (0,
|
|
8315
|
-
const [showVolumeControl, setShowVolumeControl] = (0,
|
|
8316
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
8317
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
8318
|
-
const audioRef = (0,
|
|
8319
|
-
const volumeControlRef = (0,
|
|
8320
|
-
const speedMenuRef = (0,
|
|
8578
|
+
const [isPlaying, setIsPlaying] = (0, import_react28.useState)(false);
|
|
8579
|
+
const [currentTime, setCurrentTime] = (0, import_react28.useState)(0);
|
|
8580
|
+
const [duration, setDuration] = (0, import_react28.useState)(0);
|
|
8581
|
+
const [volume, setVolume] = (0, import_react28.useState)(1);
|
|
8582
|
+
const [showVolumeControl, setShowVolumeControl] = (0, import_react28.useState)(false);
|
|
8583
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react28.useState)(false);
|
|
8584
|
+
const [playbackRate, setPlaybackRate] = (0, import_react28.useState)(1);
|
|
8585
|
+
const audioRef = (0, import_react28.useRef)(null);
|
|
8586
|
+
const volumeControlRef = (0, import_react28.useRef)(null);
|
|
8587
|
+
const speedMenuRef = (0, import_react28.useRef)(null);
|
|
8321
8588
|
const formatTime2 = (time) => {
|
|
8322
8589
|
const minutes = Math.floor(time / 60);
|
|
8323
8590
|
const seconds = Math.floor(time % 60);
|
|
@@ -8384,14 +8651,14 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8384
8651
|
};
|
|
8385
8652
|
const getVolumeIcon = () => {
|
|
8386
8653
|
if (volume === 0) {
|
|
8387
|
-
return /* @__PURE__ */ (0,
|
|
8654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.SpeakerSimpleX, { size: 24 });
|
|
8388
8655
|
}
|
|
8389
8656
|
if (volume < 0.5) {
|
|
8390
|
-
return /* @__PURE__ */ (0,
|
|
8657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.SpeakerLow, { size: 24 });
|
|
8391
8658
|
}
|
|
8392
|
-
return /* @__PURE__ */ (0,
|
|
8659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.SpeakerHigh, { size: 24 });
|
|
8393
8660
|
};
|
|
8394
|
-
(0,
|
|
8661
|
+
(0, import_react28.useEffect)(() => {
|
|
8395
8662
|
const handleClickOutside = (event) => {
|
|
8396
8663
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
8397
8664
|
setShowVolumeControl(false);
|
|
@@ -8405,7 +8672,7 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8405
8672
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
8406
8673
|
};
|
|
8407
8674
|
}, []);
|
|
8408
|
-
return /* @__PURE__ */ (0,
|
|
8675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8409
8676
|
CardBase,
|
|
8410
8677
|
{
|
|
8411
8678
|
ref,
|
|
@@ -8418,7 +8685,7 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8418
8685
|
),
|
|
8419
8686
|
...props,
|
|
8420
8687
|
children: [
|
|
8421
|
-
/* @__PURE__ */ (0,
|
|
8688
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8422
8689
|
"audio",
|
|
8423
8690
|
{
|
|
8424
8691
|
ref: audioRef,
|
|
@@ -8430,7 +8697,7 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8430
8697
|
onEnded: handleEnded,
|
|
8431
8698
|
"data-testid": "audio-element",
|
|
8432
8699
|
"aria-label": title,
|
|
8433
|
-
children: tracks ? tracks.map((track) => /* @__PURE__ */ (0,
|
|
8700
|
+
children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8434
8701
|
"track",
|
|
8435
8702
|
{
|
|
8436
8703
|
kind: track.kind,
|
|
@@ -8440,7 +8707,7 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8440
8707
|
default: track.default
|
|
8441
8708
|
},
|
|
8442
8709
|
track.src
|
|
8443
|
-
)) : /* @__PURE__ */ (0,
|
|
8710
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8444
8711
|
"track",
|
|
8445
8712
|
{
|
|
8446
8713
|
kind: "captions",
|
|
@@ -8451,7 +8718,7 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8451
8718
|
)
|
|
8452
8719
|
}
|
|
8453
8720
|
),
|
|
8454
|
-
/* @__PURE__ */ (0,
|
|
8721
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8455
8722
|
"button",
|
|
8456
8723
|
{
|
|
8457
8724
|
type: "button",
|
|
@@ -8459,14 +8726,14 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8459
8726
|
disabled: !src,
|
|
8460
8727
|
className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
|
|
8461
8728
|
"aria-label": isPlaying ? "Pausar" : "Reproduzir",
|
|
8462
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
8463
|
-
/* @__PURE__ */ (0,
|
|
8464
|
-
/* @__PURE__ */ (0,
|
|
8465
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
8729
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex gap-0.5", children: [
|
|
8730
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
|
|
8731
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
|
|
8732
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.Play, { size: 24 })
|
|
8466
8733
|
}
|
|
8467
8734
|
),
|
|
8468
|
-
/* @__PURE__ */ (0,
|
|
8469
|
-
/* @__PURE__ */ (0,
|
|
8735
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
|
|
8736
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8470
8737
|
"button",
|
|
8471
8738
|
{
|
|
8472
8739
|
type: "button",
|
|
@@ -8481,7 +8748,7 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8481
8748
|
}
|
|
8482
8749
|
},
|
|
8483
8750
|
"aria-label": "Barra de progresso do \xE1udio",
|
|
8484
|
-
children: /* @__PURE__ */ (0,
|
|
8751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8485
8752
|
"div",
|
|
8486
8753
|
{
|
|
8487
8754
|
className: "h-full bg-primary-600 rounded-full transition-all duration-100",
|
|
@@ -8492,19 +8759,19 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8492
8759
|
)
|
|
8493
8760
|
}
|
|
8494
8761
|
) }),
|
|
8495
|
-
/* @__PURE__ */ (0,
|
|
8496
|
-
/* @__PURE__ */ (0,
|
|
8497
|
-
/* @__PURE__ */ (0,
|
|
8762
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
|
|
8763
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative h-6", ref: volumeControlRef, children: [
|
|
8764
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8498
8765
|
"button",
|
|
8499
8766
|
{
|
|
8500
8767
|
type: "button",
|
|
8501
8768
|
onClick: toggleVolumeControl,
|
|
8502
8769
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
8503
8770
|
"aria-label": "Controle de volume",
|
|
8504
|
-
children: /* @__PURE__ */ (0,
|
|
8771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
|
|
8505
8772
|
}
|
|
8506
8773
|
),
|
|
8507
|
-
showVolumeControl && /* @__PURE__ */ (0,
|
|
8774
|
+
showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8508
8775
|
"button",
|
|
8509
8776
|
{
|
|
8510
8777
|
type: "button",
|
|
@@ -8514,7 +8781,7 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8514
8781
|
setShowVolumeControl(false);
|
|
8515
8782
|
}
|
|
8516
8783
|
},
|
|
8517
|
-
children: /* @__PURE__ */ (0,
|
|
8784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8518
8785
|
"input",
|
|
8519
8786
|
{
|
|
8520
8787
|
type: "range",
|
|
@@ -8555,22 +8822,22 @@ var CardAudio = (0, import_react27.forwardRef)(
|
|
|
8555
8822
|
}
|
|
8556
8823
|
)
|
|
8557
8824
|
] }),
|
|
8558
|
-
/* @__PURE__ */ (0,
|
|
8559
|
-
/* @__PURE__ */ (0,
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative h-6", ref: speedMenuRef, children: [
|
|
8826
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8560
8827
|
"button",
|
|
8561
8828
|
{
|
|
8562
8829
|
type: "button",
|
|
8563
8830
|
onClick: toggleSpeedMenu,
|
|
8564
8831
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
8565
8832
|
"aria-label": "Op\xE7\xF5es de velocidade",
|
|
8566
|
-
children: /* @__PURE__ */ (0,
|
|
8833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.DotsThreeVertical, { size: 24 })
|
|
8567
8834
|
}
|
|
8568
8835
|
),
|
|
8569
|
-
showSpeedMenu && /* @__PURE__ */ (0,
|
|
8836
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex flex-col gap-1", children: [
|
|
8570
8837
|
{ speed: 1, label: "1x" },
|
|
8571
8838
|
{ speed: 1.5, label: "1.5x" },
|
|
8572
8839
|
{ speed: 2, label: "2x" }
|
|
8573
|
-
].map(({ speed, label }) => /* @__PURE__ */ (0,
|
|
8840
|
+
].map(({ speed, label }) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8574
8841
|
"button",
|
|
8575
8842
|
{
|
|
8576
8843
|
type: "button",
|
|
@@ -8595,10 +8862,10 @@ var SIMULADO_BACKGROUND_CLASSES = {
|
|
|
8595
8862
|
simuladao: "bg-exam-3",
|
|
8596
8863
|
vestibular: "bg-exam-4"
|
|
8597
8864
|
};
|
|
8598
|
-
var CardSimulado = (0,
|
|
8865
|
+
var CardSimulado = (0, import_react28.forwardRef)(
|
|
8599
8866
|
({ title, duration, info, backgroundColor, className, ...props }, ref) => {
|
|
8600
8867
|
const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
|
|
8601
|
-
return /* @__PURE__ */ (0,
|
|
8868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8602
8869
|
CardBase,
|
|
8603
8870
|
{
|
|
8604
8871
|
ref,
|
|
@@ -8611,18 +8878,18 @@ var CardSimulado = (0, import_react27.forwardRef)(
|
|
|
8611
8878
|
className
|
|
8612
8879
|
),
|
|
8613
8880
|
...props,
|
|
8614
|
-
children: /* @__PURE__ */ (0,
|
|
8615
|
-
/* @__PURE__ */ (0,
|
|
8616
|
-
/* @__PURE__ */ (0,
|
|
8617
|
-
/* @__PURE__ */ (0,
|
|
8618
|
-
duration && /* @__PURE__ */ (0,
|
|
8619
|
-
/* @__PURE__ */ (0,
|
|
8620
|
-
/* @__PURE__ */ (0,
|
|
8881
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
|
|
8882
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
8883
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
|
|
8884
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-4 text-text-700", children: [
|
|
8885
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
8886
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.Clock, { size: 16, className: "flex-shrink-0" }),
|
|
8887
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text_default, { size: "sm", children: duration })
|
|
8621
8888
|
] }),
|
|
8622
|
-
/* @__PURE__ */ (0,
|
|
8889
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text_default, { size: "sm", className: "truncate", children: info })
|
|
8623
8890
|
] })
|
|
8624
8891
|
] }),
|
|
8625
|
-
/* @__PURE__ */ (0,
|
|
8892
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8626
8893
|
import_phosphor_react19.CaretRight,
|
|
8627
8894
|
{
|
|
8628
8895
|
size: 24,
|
|
@@ -8635,7 +8902,7 @@ var CardSimulado = (0, import_react27.forwardRef)(
|
|
|
8635
8902
|
);
|
|
8636
8903
|
}
|
|
8637
8904
|
);
|
|
8638
|
-
var CardTest = (0,
|
|
8905
|
+
var CardTest = (0, import_react28.forwardRef)(
|
|
8639
8906
|
({
|
|
8640
8907
|
title,
|
|
8641
8908
|
duration,
|
|
@@ -8667,7 +8934,7 @@ var CardTest = (0, import_react27.forwardRef)(
|
|
|
8667
8934
|
const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
|
|
8668
8935
|
const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
|
|
8669
8936
|
if (isSelectable) {
|
|
8670
|
-
return /* @__PURE__ */ (0,
|
|
8937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8671
8938
|
"button",
|
|
8672
8939
|
{
|
|
8673
8940
|
ref,
|
|
@@ -8679,8 +8946,8 @@ var CardTest = (0, import_react27.forwardRef)(
|
|
|
8679
8946
|
onKeyDown: handleKeyDown,
|
|
8680
8947
|
"aria-pressed": selected,
|
|
8681
8948
|
...props,
|
|
8682
|
-
children: /* @__PURE__ */ (0,
|
|
8683
|
-
/* @__PURE__ */ (0,
|
|
8949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
8950
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8684
8951
|
Text_default,
|
|
8685
8952
|
{
|
|
8686
8953
|
size: "md",
|
|
@@ -8689,10 +8956,10 @@ var CardTest = (0, import_react27.forwardRef)(
|
|
|
8689
8956
|
children: title
|
|
8690
8957
|
}
|
|
8691
8958
|
),
|
|
8692
|
-
/* @__PURE__ */ (0,
|
|
8693
|
-
duration && /* @__PURE__ */ (0,
|
|
8694
|
-
/* @__PURE__ */ (0,
|
|
8695
|
-
/* @__PURE__ */ (0,
|
|
8959
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
8960
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
8961
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.Clock, { size: 16, className: "text-text-700" }),
|
|
8962
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8696
8963
|
Text_default,
|
|
8697
8964
|
{
|
|
8698
8965
|
size: "sm",
|
|
@@ -8701,7 +8968,7 @@ var CardTest = (0, import_react27.forwardRef)(
|
|
|
8701
8968
|
}
|
|
8702
8969
|
)
|
|
8703
8970
|
] }),
|
|
8704
|
-
/* @__PURE__ */ (0,
|
|
8971
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8705
8972
|
Text_default,
|
|
8706
8973
|
{
|
|
8707
8974
|
size: "sm",
|
|
@@ -8714,14 +8981,14 @@ var CardTest = (0, import_react27.forwardRef)(
|
|
|
8714
8981
|
}
|
|
8715
8982
|
);
|
|
8716
8983
|
}
|
|
8717
|
-
return /* @__PURE__ */ (0,
|
|
8984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8718
8985
|
"div",
|
|
8719
8986
|
{
|
|
8720
8987
|
ref,
|
|
8721
8988
|
className: cn(`${baseClasses} ${className}`.trim()),
|
|
8722
8989
|
...props,
|
|
8723
|
-
children: /* @__PURE__ */ (0,
|
|
8724
|
-
/* @__PURE__ */ (0,
|
|
8990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
8991
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8725
8992
|
Text_default,
|
|
8726
8993
|
{
|
|
8727
8994
|
size: "md",
|
|
@@ -8730,10 +8997,10 @@ var CardTest = (0, import_react27.forwardRef)(
|
|
|
8730
8997
|
children: title
|
|
8731
8998
|
}
|
|
8732
8999
|
),
|
|
8733
|
-
/* @__PURE__ */ (0,
|
|
8734
|
-
duration && /* @__PURE__ */ (0,
|
|
8735
|
-
/* @__PURE__ */ (0,
|
|
8736
|
-
/* @__PURE__ */ (0,
|
|
9000
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
9001
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
9002
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_phosphor_react19.Clock, { size: 16, className: "text-text-700" }),
|
|
9003
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8737
9004
|
Text_default,
|
|
8738
9005
|
{
|
|
8739
9006
|
size: "sm",
|
|
@@ -8742,7 +9009,7 @@ var CardTest = (0, import_react27.forwardRef)(
|
|
|
8742
9009
|
}
|
|
8743
9010
|
)
|
|
8744
9011
|
] }),
|
|
8745
|
-
/* @__PURE__ */ (0,
|
|
9012
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8746
9013
|
Text_default,
|
|
8747
9014
|
{
|
|
8748
9015
|
size: "sm",
|
|
@@ -8778,15 +9045,15 @@ var SIMULATION_TYPE_STYLES = {
|
|
|
8778
9045
|
text: "Vestibular"
|
|
8779
9046
|
}
|
|
8780
9047
|
};
|
|
8781
|
-
var CardSimulationHistory = (0,
|
|
8782
|
-
return /* @__PURE__ */ (0,
|
|
9048
|
+
var CardSimulationHistory = (0, import_react28.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
|
|
9049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8783
9050
|
"div",
|
|
8784
9051
|
{
|
|
8785
9052
|
ref,
|
|
8786
9053
|
className: cn("w-full max-w-[992px] h-auto", className),
|
|
8787
9054
|
...props,
|
|
8788
|
-
children: /* @__PURE__ */ (0,
|
|
8789
|
-
data.map((section, sectionIndex) => /* @__PURE__ */ (0,
|
|
9055
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
9056
|
+
data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8790
9057
|
"div",
|
|
8791
9058
|
{
|
|
8792
9059
|
className: cn(
|
|
@@ -8794,7 +9061,7 @@ var CardSimulationHistory = (0, import_react27.forwardRef)(({ data, onSimulation
|
|
|
8794
9061
|
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
8795
9062
|
),
|
|
8796
9063
|
children: [
|
|
8797
|
-
/* @__PURE__ */ (0,
|
|
9064
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8798
9065
|
Text_default,
|
|
8799
9066
|
{
|
|
8800
9067
|
size: "xs",
|
|
@@ -8803,9 +9070,9 @@ var CardSimulationHistory = (0, import_react27.forwardRef)(({ data, onSimulation
|
|
|
8803
9070
|
children: section.date
|
|
8804
9071
|
}
|
|
8805
9072
|
),
|
|
8806
|
-
/* @__PURE__ */ (0,
|
|
9073
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
|
|
8807
9074
|
const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
|
|
8808
|
-
return /* @__PURE__ */ (0,
|
|
9075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8809
9076
|
CardBase,
|
|
8810
9077
|
{
|
|
8811
9078
|
layout: "horizontal",
|
|
@@ -8817,9 +9084,9 @@ var CardSimulationHistory = (0, import_react27.forwardRef)(({ data, onSimulation
|
|
|
8817
9084
|
transition-shadow duration-200 h-auto min-h-[61px]`
|
|
8818
9085
|
),
|
|
8819
9086
|
onClick: () => onSimulationClick?.(simulation),
|
|
8820
|
-
children: /* @__PURE__ */ (0,
|
|
8821
|
-
/* @__PURE__ */ (0,
|
|
8822
|
-
/* @__PURE__ */ (0,
|
|
9087
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
9088
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
|
|
9089
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8823
9090
|
Text_default,
|
|
8824
9091
|
{
|
|
8825
9092
|
size: "lg",
|
|
@@ -8828,8 +9095,8 @@ var CardSimulationHistory = (0, import_react27.forwardRef)(({ data, onSimulation
|
|
|
8828
9095
|
children: simulation.title
|
|
8829
9096
|
}
|
|
8830
9097
|
),
|
|
8831
|
-
/* @__PURE__ */ (0,
|
|
8832
|
-
/* @__PURE__ */ (0,
|
|
9098
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9099
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8833
9100
|
Badge_default,
|
|
8834
9101
|
{
|
|
8835
9102
|
variant: "examsOutlined",
|
|
@@ -8838,10 +9105,10 @@ var CardSimulationHistory = (0, import_react27.forwardRef)(({ data, onSimulation
|
|
|
8838
9105
|
children: typeStyles.text
|
|
8839
9106
|
}
|
|
8840
9107
|
),
|
|
8841
|
-
/* @__PURE__ */ (0,
|
|
9108
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
|
|
8842
9109
|
] })
|
|
8843
9110
|
] }),
|
|
8844
|
-
/* @__PURE__ */ (0,
|
|
9111
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8845
9112
|
import_phosphor_react19.CaretRight,
|
|
8846
9113
|
{
|
|
8847
9114
|
size: 24,
|
|
@@ -8857,7 +9124,7 @@ var CardSimulationHistory = (0, import_react27.forwardRef)(({ data, onSimulation
|
|
|
8857
9124
|
]
|
|
8858
9125
|
}
|
|
8859
9126
|
) }, section.date)),
|
|
8860
|
-
data.length > 0 && /* @__PURE__ */ (0,
|
|
9127
|
+
data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
|
|
8861
9128
|
] })
|
|
8862
9129
|
}
|
|
8863
9130
|
);
|
|
@@ -8865,7 +9132,7 @@ var CardSimulationHistory = (0, import_react27.forwardRef)(({ data, onSimulation
|
|
|
8865
9132
|
|
|
8866
9133
|
// src/components/StatisticsCard/StatisticsCard.tsx
|
|
8867
9134
|
var import_phosphor_react20 = require("phosphor-react");
|
|
8868
|
-
var
|
|
9135
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
8869
9136
|
var VARIANT_STYLES = {
|
|
8870
9137
|
high: "bg-success-background",
|
|
8871
9138
|
medium: "bg-warning-background",
|
|
@@ -8879,12 +9146,12 @@ var VALUE_TEXT_COLORS = {
|
|
|
8879
9146
|
total: "text-info-700"
|
|
8880
9147
|
};
|
|
8881
9148
|
var StatCard = ({ item, showPlaceholder = false }) => {
|
|
8882
|
-
return /* @__PURE__ */ (0,
|
|
9149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
8883
9150
|
"div",
|
|
8884
9151
|
{
|
|
8885
9152
|
className: `rounded-xl py-[17px] px-6 min-h-[105px] flex flex-col justify-center items-start gap-1 ${VARIANT_STYLES[item.variant]}`,
|
|
8886
9153
|
children: [
|
|
8887
|
-
/* @__PURE__ */ (0,
|
|
9154
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8888
9155
|
Text_default,
|
|
8889
9156
|
{
|
|
8890
9157
|
size: "4xl",
|
|
@@ -8893,7 +9160,7 @@ var StatCard = ({ item, showPlaceholder = false }) => {
|
|
|
8893
9160
|
children: showPlaceholder ? "-" : item.value
|
|
8894
9161
|
}
|
|
8895
9162
|
),
|
|
8896
|
-
/* @__PURE__ */ (0,
|
|
9163
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8897
9164
|
Text_default,
|
|
8898
9165
|
{
|
|
8899
9166
|
size: "xs",
|
|
@@ -8928,13 +9195,13 @@ var StatisticsCard = ({
|
|
|
8928
9195
|
}) => {
|
|
8929
9196
|
const hasData = data && data.length > 0;
|
|
8930
9197
|
const gridColumnsClass = hasData ? getGridColumnsClass(data.length) : "";
|
|
8931
|
-
return /* @__PURE__ */ (0,
|
|
9198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
8932
9199
|
"div",
|
|
8933
9200
|
{
|
|
8934
9201
|
className: `bg-background rounded-xl p-4 h-auto lg:h-[185px] flex flex-col gap-2 ${className}`,
|
|
8935
9202
|
children: [
|
|
8936
|
-
/* @__PURE__ */ (0,
|
|
8937
|
-
/* @__PURE__ */ (0,
|
|
9203
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-row justify-between items-center gap-4", children: [
|
|
9204
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8938
9205
|
Text_default,
|
|
8939
9206
|
{
|
|
8940
9207
|
as: "h3",
|
|
@@ -8945,22 +9212,22 @@ var StatisticsCard = ({
|
|
|
8945
9212
|
children: title
|
|
8946
9213
|
}
|
|
8947
9214
|
),
|
|
8948
|
-
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */ (0,
|
|
9215
|
+
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "w-[120px] min-w-[90px] sm:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
8949
9216
|
Select_default,
|
|
8950
9217
|
{
|
|
8951
9218
|
value: selectedDropdownValue,
|
|
8952
9219
|
onValueChange: onDropdownChange,
|
|
8953
9220
|
size: "medium",
|
|
8954
9221
|
children: [
|
|
8955
|
-
/* @__PURE__ */ (0,
|
|
9222
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8956
9223
|
SelectTrigger,
|
|
8957
9224
|
{
|
|
8958
9225
|
className: "border border-border-300 rounded [&>span]:whitespace-nowrap [&>span]:overflow-hidden [&>span]:text-ellipsis",
|
|
8959
9226
|
"aria-label": dropdownAriaLabel,
|
|
8960
|
-
children: /* @__PURE__ */ (0,
|
|
9227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectValue, { placeholder: selectPlaceholder })
|
|
8961
9228
|
}
|
|
8962
9229
|
),
|
|
8963
|
-
/* @__PURE__ */ (0,
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectContent, { className: "min-w-[120px]", children: dropdownOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8964
9231
|
SelectItem,
|
|
8965
9232
|
{
|
|
8966
9233
|
value: option.value,
|
|
@@ -8973,11 +9240,11 @@ var StatisticsCard = ({
|
|
|
8973
9240
|
}
|
|
8974
9241
|
) })
|
|
8975
9242
|
] }),
|
|
8976
|
-
hasData ? /* @__PURE__ */ (0,
|
|
9243
|
+
hasData ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8977
9244
|
"div",
|
|
8978
9245
|
{
|
|
8979
9246
|
className: `grid grid-cols-1 sm:grid-cols-2 gap-[13px] ${gridColumnsClass}`,
|
|
8980
|
-
children: data.map((item, index) => /* @__PURE__ */ (0,
|
|
9247
|
+
children: data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8981
9248
|
StatCard,
|
|
8982
9249
|
{
|
|
8983
9250
|
item,
|
|
@@ -8986,8 +9253,8 @@ var StatisticsCard = ({
|
|
|
8986
9253
|
`${item.variant}-${item.label}-${index}`
|
|
8987
9254
|
))
|
|
8988
9255
|
}
|
|
8989
|
-
) : /* @__PURE__ */ (0,
|
|
8990
|
-
/* @__PURE__ */ (0,
|
|
9256
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "border border-dashed border-border-300 rounded-lg p-6 min-h-[105px] flex flex-col items-center justify-center gap-2", children: [
|
|
9257
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8991
9258
|
Text_default,
|
|
8992
9259
|
{
|
|
8993
9260
|
size: "sm",
|
|
@@ -8996,14 +9263,14 @@ var StatisticsCard = ({
|
|
|
8996
9263
|
children: emptyStateMessage
|
|
8997
9264
|
}
|
|
8998
9265
|
),
|
|
8999
|
-
onEmptyStateButtonClick && /* @__PURE__ */ (0,
|
|
9266
|
+
onEmptyStateButtonClick && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9000
9267
|
Button_default,
|
|
9001
9268
|
{
|
|
9002
9269
|
variant: "outline",
|
|
9003
9270
|
action: "primary",
|
|
9004
9271
|
size: "small",
|
|
9005
9272
|
onClick: onEmptyStateButtonClick,
|
|
9006
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
9273
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_phosphor_react20.Plus, { size: 16, weight: "bold" }),
|
|
9007
9274
|
children: emptyStateButtonText
|
|
9008
9275
|
}
|
|
9009
9276
|
)
|
|
@@ -9014,7 +9281,7 @@ var StatisticsCard = ({
|
|
|
9014
9281
|
};
|
|
9015
9282
|
|
|
9016
9283
|
// src/components/NotFound/NotFound.tsx
|
|
9017
|
-
var
|
|
9284
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
9018
9285
|
var NotFound = ({
|
|
9019
9286
|
title,
|
|
9020
9287
|
description,
|
|
@@ -9057,22 +9324,22 @@ var NotFound = ({
|
|
|
9057
9324
|
const errorTitle = title || getDefaultTitle();
|
|
9058
9325
|
const errorDescription = description || getDefaultDescription();
|
|
9059
9326
|
const errorCode = getErrorCode();
|
|
9060
|
-
return /* @__PURE__ */ (0,
|
|
9327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9061
9328
|
"div",
|
|
9062
9329
|
{
|
|
9063
9330
|
className: cn(
|
|
9064
9331
|
"flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4",
|
|
9065
9332
|
className
|
|
9066
9333
|
),
|
|
9067
|
-
children: /* @__PURE__ */ (0,
|
|
9334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9068
9335
|
"main",
|
|
9069
9336
|
{
|
|
9070
9337
|
role: "main",
|
|
9071
9338
|
"aria-labelledby": "error-title",
|
|
9072
9339
|
"aria-describedby": "error-description",
|
|
9073
9340
|
className: "flex flex-col items-center text-center max-w-md space-y-6",
|
|
9074
|
-
children: /* @__PURE__ */ (0,
|
|
9075
|
-
/* @__PURE__ */ (0,
|
|
9341
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { "aria-label": `Erro ${errorCode}`, children: [
|
|
9342
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9076
9343
|
"div",
|
|
9077
9344
|
{
|
|
9078
9345
|
className: "text-8xl font-bold text-primary-300 select-none",
|
|
@@ -9080,8 +9347,8 @@ var NotFound = ({
|
|
|
9080
9347
|
children: errorCode
|
|
9081
9348
|
}
|
|
9082
9349
|
),
|
|
9083
|
-
/* @__PURE__ */ (0,
|
|
9084
|
-
/* @__PURE__ */ (0,
|
|
9350
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "space-y-2", children: [
|
|
9351
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9085
9352
|
Text_default,
|
|
9086
9353
|
{
|
|
9087
9354
|
size: "xl",
|
|
@@ -9092,9 +9359,9 @@ var NotFound = ({
|
|
|
9092
9359
|
children: errorTitle
|
|
9093
9360
|
}
|
|
9094
9361
|
),
|
|
9095
|
-
/* @__PURE__ */ (0,
|
|
9362
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Text_default, { size: "md", className: "text-text-600", id: "error-description", children: errorDescription })
|
|
9096
9363
|
] }),
|
|
9097
|
-
onButtonClick && /* @__PURE__ */ (0,
|
|
9364
|
+
onButtonClick && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("nav", { "aria-label": "Navega\xE7\xE3o de erro", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9098
9365
|
Button_default,
|
|
9099
9366
|
{
|
|
9100
9367
|
onClick: handleButtonClick,
|
|
@@ -9115,12 +9382,12 @@ var NotFound = ({
|
|
|
9115
9382
|
var NotFound_default = NotFound;
|
|
9116
9383
|
|
|
9117
9384
|
// src/components/NoSearchResult/NoSearchResult.tsx
|
|
9118
|
-
var
|
|
9385
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
9119
9386
|
var NoSearchResult = ({ image, title, description }) => {
|
|
9120
9387
|
const displayTitle = title || "Nenhum resultado encontrado";
|
|
9121
9388
|
const displayDescription = description || "N\xE3o encontramos nenhum resultado com esse nome. Tente revisar a busca ou usar outra palavra-chave.";
|
|
9122
|
-
return /* @__PURE__ */ (0,
|
|
9123
|
-
/* @__PURE__ */ (0,
|
|
9389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-row justify-center items-center gap-8 w-full max-w-4xl min-h-96", children: [
|
|
9390
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "w-72 h-72 flex-shrink-0 relative", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9124
9391
|
"img",
|
|
9125
9392
|
{
|
|
9126
9393
|
src: image,
|
|
@@ -9128,8 +9395,8 @@ var NoSearchResult = ({ image, title, description }) => {
|
|
|
9128
9395
|
className: "w-full h-full object-contain"
|
|
9129
9396
|
}
|
|
9130
9397
|
) }),
|
|
9131
|
-
/* @__PURE__ */ (0,
|
|
9132
|
-
/* @__PURE__ */ (0,
|
|
9398
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col items-start w-full max-w-md", children: [
|
|
9399
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex flex-row justify-between items-end px-6 pt-6 pb-4 w-full rounded-t-xl", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9133
9400
|
Text_default,
|
|
9134
9401
|
{
|
|
9135
9402
|
as: "h2",
|
|
@@ -9137,21 +9404,21 @@ var NoSearchResult = ({ image, title, description }) => {
|
|
|
9137
9404
|
children: displayTitle
|
|
9138
9405
|
}
|
|
9139
9406
|
) }),
|
|
9140
|
-
/* @__PURE__ */ (0,
|
|
9407
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex flex-row justify-center items-center px-6 gap-2 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Text_default, { className: "text-text-600 font-normal text-lg leading-relaxed w-full text-justify", children: displayDescription }) })
|
|
9141
9408
|
] })
|
|
9142
9409
|
] });
|
|
9143
9410
|
};
|
|
9144
9411
|
var NoSearchResult_default = NoSearchResult;
|
|
9145
9412
|
|
|
9146
9413
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
9147
|
-
var
|
|
9414
|
+
var import_react30 = require("react");
|
|
9148
9415
|
var import_react_dom = require("react-dom");
|
|
9149
9416
|
var import_phosphor_react22 = require("phosphor-react");
|
|
9150
9417
|
|
|
9151
9418
|
// src/components/DownloadButton/DownloadButton.tsx
|
|
9152
|
-
var
|
|
9419
|
+
var import_react29 = require("react");
|
|
9153
9420
|
var import_phosphor_react21 = require("phosphor-react");
|
|
9154
|
-
var
|
|
9421
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
9155
9422
|
var getMimeType = (url) => {
|
|
9156
9423
|
const extension = getFileExtension(url);
|
|
9157
9424
|
const mimeTypes = {
|
|
@@ -9226,13 +9493,13 @@ var DownloadButton = ({
|
|
|
9226
9493
|
lessonTitle = "aula",
|
|
9227
9494
|
disabled = false
|
|
9228
9495
|
}) => {
|
|
9229
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
9230
|
-
const isValidUrl = (0,
|
|
9496
|
+
const [isDownloading, setIsDownloading] = (0, import_react29.useState)(false);
|
|
9497
|
+
const isValidUrl = (0, import_react29.useCallback)((url) => {
|
|
9231
9498
|
return Boolean(
|
|
9232
9499
|
url && url.trim() !== "" && url !== "undefined" && url !== "null"
|
|
9233
9500
|
);
|
|
9234
9501
|
}, []);
|
|
9235
|
-
const getAvailableContent = (0,
|
|
9502
|
+
const getAvailableContent = (0, import_react29.useCallback)(() => {
|
|
9236
9503
|
const downloads = [];
|
|
9237
9504
|
if (isValidUrl(content.urlDoc)) {
|
|
9238
9505
|
downloads.push({
|
|
@@ -9267,7 +9534,7 @@ var DownloadButton = ({
|
|
|
9267
9534
|
}
|
|
9268
9535
|
return downloads;
|
|
9269
9536
|
}, [content, isValidUrl]);
|
|
9270
|
-
const handleDownload = (0,
|
|
9537
|
+
const handleDownload = (0, import_react29.useCallback)(async () => {
|
|
9271
9538
|
if (disabled || isDownloading) return;
|
|
9272
9539
|
const availableContent = getAvailableContent();
|
|
9273
9540
|
if (availableContent.length === 0) {
|
|
@@ -9308,10 +9575,10 @@ var DownloadButton = ({
|
|
|
9308
9575
|
if (!hasContent) {
|
|
9309
9576
|
return null;
|
|
9310
9577
|
}
|
|
9311
|
-
return /* @__PURE__ */ (0,
|
|
9578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: cn("flex items-center", className), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9312
9579
|
IconButton_default,
|
|
9313
9580
|
{
|
|
9314
|
-
icon: /* @__PURE__ */ (0,
|
|
9581
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_phosphor_react21.DownloadSimple, { size: 24 }),
|
|
9315
9582
|
onClick: handleDownload,
|
|
9316
9583
|
disabled: disabled || isDownloading,
|
|
9317
9584
|
"aria-label": (() => {
|
|
@@ -9332,7 +9599,7 @@ var DownloadButton = ({
|
|
|
9332
9599
|
var DownloadButton_default = DownloadButton;
|
|
9333
9600
|
|
|
9334
9601
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
9335
|
-
var
|
|
9602
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
9336
9603
|
var CONTROLS_HIDE_TIMEOUT = 3e3;
|
|
9337
9604
|
var LEAVE_HIDE_TIMEOUT = 1e3;
|
|
9338
9605
|
var INIT_DELAY = 100;
|
|
@@ -9348,7 +9615,7 @@ var ProgressBar2 = ({
|
|
|
9348
9615
|
progressPercentage,
|
|
9349
9616
|
onSeek,
|
|
9350
9617
|
className = "px-4 pb-2"
|
|
9351
|
-
}) => /* @__PURE__ */ (0,
|
|
9618
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9352
9619
|
"input",
|
|
9353
9620
|
{
|
|
9354
9621
|
type: "range",
|
|
@@ -9370,17 +9637,17 @@ var VolumeControls = ({
|
|
|
9370
9637
|
onToggleMute,
|
|
9371
9638
|
iconSize = 24,
|
|
9372
9639
|
showSlider = true
|
|
9373
|
-
}) => /* @__PURE__ */ (0,
|
|
9374
|
-
/* @__PURE__ */ (0,
|
|
9640
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9641
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9375
9642
|
IconButton_default,
|
|
9376
9643
|
{
|
|
9377
|
-
icon: isMuted ? /* @__PURE__ */ (0,
|
|
9644
|
+
icon: isMuted ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.SpeakerSlash, { size: iconSize }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.SpeakerHigh, { size: iconSize }),
|
|
9378
9645
|
onClick: onToggleMute,
|
|
9379
9646
|
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
9380
9647
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
9381
9648
|
}
|
|
9382
9649
|
),
|
|
9383
|
-
showSlider && /* @__PURE__ */ (0,
|
|
9650
|
+
showSlider && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9384
9651
|
"input",
|
|
9385
9652
|
{
|
|
9386
9653
|
type: "range",
|
|
@@ -9405,9 +9672,9 @@ var SpeedMenu = ({
|
|
|
9405
9672
|
iconSize = 24,
|
|
9406
9673
|
isTinyMobile = false
|
|
9407
9674
|
}) => {
|
|
9408
|
-
const buttonRef = (0,
|
|
9409
|
-
const speedMenuContainerRef = (0,
|
|
9410
|
-
const speedMenuRef = (0,
|
|
9675
|
+
const buttonRef = (0, import_react30.useRef)(null);
|
|
9676
|
+
const speedMenuContainerRef = (0, import_react30.useRef)(null);
|
|
9677
|
+
const speedMenuRef = (0, import_react30.useRef)(null);
|
|
9411
9678
|
const getMenuPosition = () => {
|
|
9412
9679
|
if (!buttonRef.current) return { top: 0, left: 0 };
|
|
9413
9680
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
@@ -9421,7 +9688,7 @@ var SpeedMenu = ({
|
|
|
9421
9688
|
};
|
|
9422
9689
|
};
|
|
9423
9690
|
const position = getMenuPosition();
|
|
9424
|
-
(0,
|
|
9691
|
+
(0, import_react30.useEffect)(() => {
|
|
9425
9692
|
const handleClickOutside = (event) => {
|
|
9426
9693
|
const target = event.target;
|
|
9427
9694
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -9437,7 +9704,7 @@ var SpeedMenu = ({
|
|
|
9437
9704
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
9438
9705
|
};
|
|
9439
9706
|
}, [showSpeedMenu, onToggleMenu]);
|
|
9440
|
-
const menuContent = /* @__PURE__ */ (0,
|
|
9707
|
+
const menuContent = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9441
9708
|
"div",
|
|
9442
9709
|
{
|
|
9443
9710
|
ref: speedMenuRef,
|
|
@@ -9448,7 +9715,7 @@ var SpeedMenu = ({
|
|
|
9448
9715
|
top: `${position.top}px`,
|
|
9449
9716
|
left: `${position.left}px`
|
|
9450
9717
|
},
|
|
9451
|
-
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0,
|
|
9718
|
+
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
9452
9719
|
"button",
|
|
9453
9720
|
{
|
|
9454
9721
|
role: "menuitemradio",
|
|
@@ -9465,12 +9732,12 @@ var SpeedMenu = ({
|
|
|
9465
9732
|
}
|
|
9466
9733
|
);
|
|
9467
9734
|
const portalContent = showSpeedMenu && globalThis.window !== void 0 && globalThis.document !== void 0 && !!globalThis.document?.body ? (0, import_react_dom.createPortal)(menuContent, globalThis.document.body) : null;
|
|
9468
|
-
return /* @__PURE__ */ (0,
|
|
9469
|
-
/* @__PURE__ */ (0,
|
|
9735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "relative", ref: speedMenuContainerRef, children: [
|
|
9736
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9470
9737
|
IconButton_default,
|
|
9471
9738
|
{
|
|
9472
9739
|
ref: buttonRef,
|
|
9473
|
-
icon: /* @__PURE__ */ (0,
|
|
9740
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.DotsThreeVertical, { size: iconSize }),
|
|
9474
9741
|
onClick: onToggleMenu,
|
|
9475
9742
|
"aria-label": "Playback speed",
|
|
9476
9743
|
"aria-haspopup": "menu",
|
|
@@ -9500,28 +9767,28 @@ var VideoPlayer = ({
|
|
|
9500
9767
|
onDownloadComplete,
|
|
9501
9768
|
onDownloadError
|
|
9502
9769
|
}) => {
|
|
9503
|
-
const videoRef = (0,
|
|
9770
|
+
const videoRef = (0, import_react30.useRef)(null);
|
|
9504
9771
|
const { isUltraSmallMobile, isTinyMobile } = useMobile();
|
|
9505
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
9506
|
-
const [currentTime, setCurrentTime] = (0,
|
|
9507
|
-
const [duration, setDuration] = (0,
|
|
9508
|
-
const [isMuted, setIsMuted] = (0,
|
|
9509
|
-
const [volume, setVolume] = (0,
|
|
9510
|
-
const [isFullscreen, setIsFullscreen] = (0,
|
|
9511
|
-
const [showControls, setShowControls] = (0,
|
|
9512
|
-
const [hasCompleted, setHasCompleted] = (0,
|
|
9513
|
-
const [showCaptions, setShowCaptions] = (0,
|
|
9514
|
-
const [subtitlesValidation, setSubtitlesValidation] = (0,
|
|
9515
|
-
(0,
|
|
9772
|
+
const [isPlaying, setIsPlaying] = (0, import_react30.useState)(false);
|
|
9773
|
+
const [currentTime, setCurrentTime] = (0, import_react30.useState)(0);
|
|
9774
|
+
const [duration, setDuration] = (0, import_react30.useState)(0);
|
|
9775
|
+
const [isMuted, setIsMuted] = (0, import_react30.useState)(false);
|
|
9776
|
+
const [volume, setVolume] = (0, import_react30.useState)(1);
|
|
9777
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react30.useState)(false);
|
|
9778
|
+
const [showControls, setShowControls] = (0, import_react30.useState)(true);
|
|
9779
|
+
const [hasCompleted, setHasCompleted] = (0, import_react30.useState)(false);
|
|
9780
|
+
const [showCaptions, setShowCaptions] = (0, import_react30.useState)(false);
|
|
9781
|
+
const [subtitlesValidation, setSubtitlesValidation] = (0, import_react30.useState)("idle");
|
|
9782
|
+
(0, import_react30.useEffect)(() => {
|
|
9516
9783
|
setHasCompleted(false);
|
|
9517
9784
|
}, [src]);
|
|
9518
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
9519
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
9520
|
-
const lastSaveTimeRef = (0,
|
|
9521
|
-
const trackRef = (0,
|
|
9522
|
-
const controlsTimeoutRef = (0,
|
|
9523
|
-
const lastMousePositionRef = (0,
|
|
9524
|
-
const isUserInteracting = (0,
|
|
9785
|
+
const [playbackRate, setPlaybackRate] = (0, import_react30.useState)(1);
|
|
9786
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react30.useState)(false);
|
|
9787
|
+
const lastSaveTimeRef = (0, import_react30.useRef)(0);
|
|
9788
|
+
const trackRef = (0, import_react30.useRef)(null);
|
|
9789
|
+
const controlsTimeoutRef = (0, import_react30.useRef)(null);
|
|
9790
|
+
const lastMousePositionRef = (0, import_react30.useRef)({ x: 0, y: 0 });
|
|
9791
|
+
const isUserInteracting = (0, import_react30.useCallback)(() => {
|
|
9525
9792
|
if (showSpeedMenu) {
|
|
9526
9793
|
return true;
|
|
9527
9794
|
}
|
|
@@ -9538,13 +9805,13 @@ var VideoPlayer = ({
|
|
|
9538
9805
|
}
|
|
9539
9806
|
return false;
|
|
9540
9807
|
}, [showSpeedMenu]);
|
|
9541
|
-
const clearControlsTimeout = (0,
|
|
9808
|
+
const clearControlsTimeout = (0, import_react30.useCallback)(() => {
|
|
9542
9809
|
if (controlsTimeoutRef.current) {
|
|
9543
9810
|
clearTimeout(controlsTimeoutRef.current);
|
|
9544
9811
|
controlsTimeoutRef.current = null;
|
|
9545
9812
|
}
|
|
9546
9813
|
}, []);
|
|
9547
|
-
const showControlsWithTimer = (0,
|
|
9814
|
+
const showControlsWithTimer = (0, import_react30.useCallback)(() => {
|
|
9548
9815
|
setShowControls(true);
|
|
9549
9816
|
clearControlsTimeout();
|
|
9550
9817
|
if (isFullscreen) {
|
|
@@ -9559,7 +9826,7 @@ var VideoPlayer = ({
|
|
|
9559
9826
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
9560
9827
|
}
|
|
9561
9828
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
9562
|
-
const handleMouseMove = (0,
|
|
9829
|
+
const handleMouseMove = (0, import_react30.useCallback)(
|
|
9563
9830
|
(event) => {
|
|
9564
9831
|
const currentX = event.clientX;
|
|
9565
9832
|
const currentY = event.clientY;
|
|
@@ -9572,10 +9839,10 @@ var VideoPlayer = ({
|
|
|
9572
9839
|
},
|
|
9573
9840
|
[showControlsWithTimer]
|
|
9574
9841
|
);
|
|
9575
|
-
const handleMouseEnter = (0,
|
|
9842
|
+
const handleMouseEnter = (0, import_react30.useCallback)(() => {
|
|
9576
9843
|
showControlsWithTimer();
|
|
9577
9844
|
}, [showControlsWithTimer]);
|
|
9578
|
-
const handleMouseLeave = (0,
|
|
9845
|
+
const handleMouseLeave = (0, import_react30.useCallback)(() => {
|
|
9579
9846
|
const userInteracting = isUserInteracting();
|
|
9580
9847
|
clearControlsTimeout();
|
|
9581
9848
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -9584,13 +9851,13 @@ var VideoPlayer = ({
|
|
|
9584
9851
|
}, LEAVE_HIDE_TIMEOUT);
|
|
9585
9852
|
}
|
|
9586
9853
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
9587
|
-
(0,
|
|
9854
|
+
(0, import_react30.useEffect)(() => {
|
|
9588
9855
|
if (videoRef.current) {
|
|
9589
9856
|
videoRef.current.volume = volume;
|
|
9590
9857
|
videoRef.current.muted = isMuted;
|
|
9591
9858
|
}
|
|
9592
9859
|
}, [volume, isMuted]);
|
|
9593
|
-
(0,
|
|
9860
|
+
(0, import_react30.useEffect)(() => {
|
|
9594
9861
|
const video = videoRef.current;
|
|
9595
9862
|
if (!video) return;
|
|
9596
9863
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -9605,13 +9872,13 @@ var VideoPlayer = ({
|
|
|
9605
9872
|
video.removeEventListener("ended", onEnded);
|
|
9606
9873
|
};
|
|
9607
9874
|
}, []);
|
|
9608
|
-
(0,
|
|
9875
|
+
(0, import_react30.useEffect)(() => {
|
|
9609
9876
|
const video = videoRef.current;
|
|
9610
9877
|
if (!video) return;
|
|
9611
9878
|
video.setAttribute("playsinline", "");
|
|
9612
9879
|
video.setAttribute("webkit-playsinline", "");
|
|
9613
9880
|
}, []);
|
|
9614
|
-
(0,
|
|
9881
|
+
(0, import_react30.useEffect)(() => {
|
|
9615
9882
|
if (isPlaying) {
|
|
9616
9883
|
showControlsWithTimer();
|
|
9617
9884
|
} else {
|
|
@@ -9623,7 +9890,7 @@ var VideoPlayer = ({
|
|
|
9623
9890
|
}
|
|
9624
9891
|
}
|
|
9625
9892
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
9626
|
-
(0,
|
|
9893
|
+
(0, import_react30.useEffect)(() => {
|
|
9627
9894
|
const video = videoRef.current;
|
|
9628
9895
|
if (!video) return;
|
|
9629
9896
|
const handleFullscreenChange = () => {
|
|
@@ -9658,7 +9925,7 @@ var VideoPlayer = ({
|
|
|
9658
9925
|
);
|
|
9659
9926
|
};
|
|
9660
9927
|
}, [showControlsWithTimer]);
|
|
9661
|
-
(0,
|
|
9928
|
+
(0, import_react30.useEffect)(() => {
|
|
9662
9929
|
const init = () => {
|
|
9663
9930
|
if (!isFullscreen) {
|
|
9664
9931
|
showControlsWithTimer();
|
|
@@ -9680,7 +9947,7 @@ var VideoPlayer = ({
|
|
|
9680
9947
|
};
|
|
9681
9948
|
}
|
|
9682
9949
|
}, []);
|
|
9683
|
-
const getInitialTime = (0,
|
|
9950
|
+
const getInitialTime = (0, import_react30.useCallback)(() => {
|
|
9684
9951
|
if (!autoSave || !storageKey) {
|
|
9685
9952
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
9686
9953
|
}
|
|
@@ -9693,14 +9960,14 @@ var VideoPlayer = ({
|
|
|
9693
9960
|
if (hasValidSaved) return saved;
|
|
9694
9961
|
return void 0;
|
|
9695
9962
|
}, [autoSave, storageKey, src, initialTime]);
|
|
9696
|
-
(0,
|
|
9963
|
+
(0, import_react30.useEffect)(() => {
|
|
9697
9964
|
const start = getInitialTime();
|
|
9698
9965
|
if (start !== void 0 && videoRef.current) {
|
|
9699
9966
|
videoRef.current.currentTime = start;
|
|
9700
9967
|
setCurrentTime(start);
|
|
9701
9968
|
}
|
|
9702
9969
|
}, [getInitialTime]);
|
|
9703
|
-
const saveProgress = (0,
|
|
9970
|
+
const saveProgress = (0, import_react30.useCallback)(
|
|
9704
9971
|
(time) => {
|
|
9705
9972
|
if (!autoSave || !storageKey) return;
|
|
9706
9973
|
const now = Date.now();
|
|
@@ -9711,7 +9978,7 @@ var VideoPlayer = ({
|
|
|
9711
9978
|
},
|
|
9712
9979
|
[autoSave, storageKey, src]
|
|
9713
9980
|
);
|
|
9714
|
-
const togglePlayPause = (0,
|
|
9981
|
+
const togglePlayPause = (0, import_react30.useCallback)(async () => {
|
|
9715
9982
|
const video = videoRef.current;
|
|
9716
9983
|
if (!video) return;
|
|
9717
9984
|
if (!video.paused) {
|
|
@@ -9723,7 +9990,7 @@ var VideoPlayer = ({
|
|
|
9723
9990
|
} catch {
|
|
9724
9991
|
}
|
|
9725
9992
|
}, []);
|
|
9726
|
-
const handleVolumeChange = (0,
|
|
9993
|
+
const handleVolumeChange = (0, import_react30.useCallback)(
|
|
9727
9994
|
(newVolume) => {
|
|
9728
9995
|
const video = videoRef.current;
|
|
9729
9996
|
if (!video) return;
|
|
@@ -9742,7 +10009,7 @@ var VideoPlayer = ({
|
|
|
9742
10009
|
},
|
|
9743
10010
|
[isMuted]
|
|
9744
10011
|
);
|
|
9745
|
-
const toggleMute = (0,
|
|
10012
|
+
const toggleMute = (0, import_react30.useCallback)(() => {
|
|
9746
10013
|
const video = videoRef.current;
|
|
9747
10014
|
if (!video) return;
|
|
9748
10015
|
if (isMuted) {
|
|
@@ -9756,20 +10023,20 @@ var VideoPlayer = ({
|
|
|
9756
10023
|
setIsMuted(true);
|
|
9757
10024
|
}
|
|
9758
10025
|
}, [isMuted, volume]);
|
|
9759
|
-
const handleSeek = (0,
|
|
10026
|
+
const handleSeek = (0, import_react30.useCallback)((newTime) => {
|
|
9760
10027
|
const video = videoRef.current;
|
|
9761
10028
|
if (video) {
|
|
9762
10029
|
video.currentTime = newTime;
|
|
9763
10030
|
}
|
|
9764
10031
|
}, []);
|
|
9765
|
-
const isSafariIOS = (0,
|
|
10032
|
+
const isSafariIOS = (0, import_react30.useCallback)(() => {
|
|
9766
10033
|
const ua = navigator.userAgent;
|
|
9767
10034
|
const isIOS = /iPad|iPhone|iPod/.test(ua);
|
|
9768
10035
|
const isWebKit = /WebKit/.test(ua);
|
|
9769
10036
|
const isNotChrome = !/CriOS|Chrome/.test(ua);
|
|
9770
10037
|
return isIOS && isWebKit && isNotChrome;
|
|
9771
10038
|
}, []);
|
|
9772
|
-
const toggleFullscreen = (0,
|
|
10039
|
+
const toggleFullscreen = (0, import_react30.useCallback)(() => {
|
|
9773
10040
|
const video = videoRef.current;
|
|
9774
10041
|
const container = video?.parentElement;
|
|
9775
10042
|
if (!video || !container) return;
|
|
@@ -9786,24 +10053,24 @@ var VideoPlayer = ({
|
|
|
9786
10053
|
document.exitFullscreen();
|
|
9787
10054
|
}
|
|
9788
10055
|
}, [isFullscreen, isSafariIOS]);
|
|
9789
|
-
const handleSpeedChange = (0,
|
|
10056
|
+
const handleSpeedChange = (0, import_react30.useCallback)((speed) => {
|
|
9790
10057
|
if (videoRef.current) {
|
|
9791
10058
|
videoRef.current.playbackRate = speed;
|
|
9792
10059
|
setPlaybackRate(speed);
|
|
9793
10060
|
setShowSpeedMenu(false);
|
|
9794
10061
|
}
|
|
9795
10062
|
}, []);
|
|
9796
|
-
const toggleSpeedMenu = (0,
|
|
10063
|
+
const toggleSpeedMenu = (0, import_react30.useCallback)(() => {
|
|
9797
10064
|
setShowSpeedMenu(!showSpeedMenu);
|
|
9798
10065
|
}, [showSpeedMenu]);
|
|
9799
|
-
const toggleCaptions = (0,
|
|
10066
|
+
const toggleCaptions = (0, import_react30.useCallback)(() => {
|
|
9800
10067
|
if (!trackRef.current?.track || !subtitles || subtitlesValidation !== "valid")
|
|
9801
10068
|
return;
|
|
9802
10069
|
const newShowCaptions = !showCaptions;
|
|
9803
10070
|
setShowCaptions(newShowCaptions);
|
|
9804
10071
|
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
9805
10072
|
}, [showCaptions, subtitles, subtitlesValidation]);
|
|
9806
|
-
const checkVideoCompletion = (0,
|
|
10073
|
+
const checkVideoCompletion = (0, import_react30.useCallback)(
|
|
9807
10074
|
(progressPercent) => {
|
|
9808
10075
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
9809
10076
|
setHasCompleted(true);
|
|
@@ -9812,7 +10079,7 @@ var VideoPlayer = ({
|
|
|
9812
10079
|
},
|
|
9813
10080
|
[hasCompleted, onVideoComplete]
|
|
9814
10081
|
);
|
|
9815
|
-
const handleTimeUpdate = (0,
|
|
10082
|
+
const handleTimeUpdate = (0, import_react30.useCallback)(() => {
|
|
9816
10083
|
const video = videoRef.current;
|
|
9817
10084
|
if (!video) return;
|
|
9818
10085
|
const current = video.currentTime;
|
|
@@ -9825,12 +10092,12 @@ var VideoPlayer = ({
|
|
|
9825
10092
|
checkVideoCompletion(progressPercent);
|
|
9826
10093
|
}
|
|
9827
10094
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
9828
|
-
const handleLoadedMetadata = (0,
|
|
10095
|
+
const handleLoadedMetadata = (0, import_react30.useCallback)(() => {
|
|
9829
10096
|
if (videoRef.current) {
|
|
9830
10097
|
setDuration(videoRef.current.duration);
|
|
9831
10098
|
}
|
|
9832
10099
|
}, []);
|
|
9833
|
-
(0,
|
|
10100
|
+
(0, import_react30.useEffect)(() => {
|
|
9834
10101
|
const controller = new AbortController();
|
|
9835
10102
|
const validateSubtitles = async () => {
|
|
9836
10103
|
if (!subtitles) {
|
|
@@ -9877,12 +10144,12 @@ var VideoPlayer = ({
|
|
|
9877
10144
|
controller.abort();
|
|
9878
10145
|
};
|
|
9879
10146
|
}, [subtitles]);
|
|
9880
|
-
(0,
|
|
10147
|
+
(0, import_react30.useEffect)(() => {
|
|
9881
10148
|
if (trackRef.current?.track) {
|
|
9882
10149
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
9883
10150
|
}
|
|
9884
10151
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
9885
|
-
(0,
|
|
10152
|
+
(0, import_react30.useEffect)(() => {
|
|
9886
10153
|
const handleVisibilityChange = () => {
|
|
9887
10154
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
9888
10155
|
videoRef.current.pause();
|
|
@@ -9904,54 +10171,54 @@ var VideoPlayer = ({
|
|
|
9904
10171
|
};
|
|
9905
10172
|
}, [isPlaying, clearControlsTimeout]);
|
|
9906
10173
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
9907
|
-
const getIconSize2 = (0,
|
|
10174
|
+
const getIconSize2 = (0, import_react30.useCallback)(() => {
|
|
9908
10175
|
if (isTinyMobile) return 18;
|
|
9909
10176
|
if (isUltraSmallMobile) return 20;
|
|
9910
10177
|
return 24;
|
|
9911
10178
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
9912
|
-
const getControlsPadding = (0,
|
|
10179
|
+
const getControlsPadding = (0, import_react30.useCallback)(() => {
|
|
9913
10180
|
if (isTinyMobile) return "px-2 pb-2 pt-1";
|
|
9914
10181
|
if (isUltraSmallMobile) return "px-3 pb-3 pt-1";
|
|
9915
10182
|
return "px-4 pb-4";
|
|
9916
10183
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
9917
|
-
const getControlsGap = (0,
|
|
10184
|
+
const getControlsGap = (0, import_react30.useCallback)(() => {
|
|
9918
10185
|
if (isTinyMobile) return "gap-1";
|
|
9919
10186
|
if (isUltraSmallMobile) return "gap-2";
|
|
9920
10187
|
return "gap-4";
|
|
9921
10188
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
9922
|
-
const getProgressBarPadding = (0,
|
|
10189
|
+
const getProgressBarPadding = (0, import_react30.useCallback)(() => {
|
|
9923
10190
|
if (isTinyMobile) return "px-2 pb-1";
|
|
9924
10191
|
if (isUltraSmallMobile) return "px-3 pb-1";
|
|
9925
10192
|
return "px-4 pb-2";
|
|
9926
10193
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
9927
|
-
const getCenterPlayButtonPosition = (0,
|
|
10194
|
+
const getCenterPlayButtonPosition = (0, import_react30.useCallback)(() => {
|
|
9928
10195
|
if (isTinyMobile) return "items-center justify-center -translate-y-12";
|
|
9929
10196
|
if (isUltraSmallMobile) return "items-center justify-center -translate-y-8";
|
|
9930
10197
|
return "items-center justify-center";
|
|
9931
10198
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
9932
|
-
const getTopControlsOpacity = (0,
|
|
10199
|
+
const getTopControlsOpacity = (0, import_react30.useCallback)(() => {
|
|
9933
10200
|
return showControls ? "opacity-100" : "opacity-0";
|
|
9934
10201
|
}, [showControls]);
|
|
9935
|
-
const getBottomControlsOpacity = (0,
|
|
10202
|
+
const getBottomControlsOpacity = (0, import_react30.useCallback)(() => {
|
|
9936
10203
|
return showControls ? "opacity-100" : "opacity-0";
|
|
9937
10204
|
}, [showControls]);
|
|
9938
|
-
const seekBackward = (0,
|
|
10205
|
+
const seekBackward = (0, import_react30.useCallback)(() => {
|
|
9939
10206
|
if (videoRef.current) {
|
|
9940
10207
|
videoRef.current.currentTime -= 10;
|
|
9941
10208
|
}
|
|
9942
10209
|
}, []);
|
|
9943
|
-
const seekForward = (0,
|
|
10210
|
+
const seekForward = (0, import_react30.useCallback)(() => {
|
|
9944
10211
|
if (videoRef.current) {
|
|
9945
10212
|
videoRef.current.currentTime += 10;
|
|
9946
10213
|
}
|
|
9947
10214
|
}, []);
|
|
9948
|
-
const increaseVolume = (0,
|
|
10215
|
+
const increaseVolume = (0, import_react30.useCallback)(() => {
|
|
9949
10216
|
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
9950
10217
|
}, [handleVolumeChange, volume]);
|
|
9951
|
-
const decreaseVolume = (0,
|
|
10218
|
+
const decreaseVolume = (0, import_react30.useCallback)(() => {
|
|
9952
10219
|
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
9953
10220
|
}, [handleVolumeChange, volume]);
|
|
9954
|
-
const handleVideoKeyDown = (0,
|
|
10221
|
+
const handleVideoKeyDown = (0, import_react30.useCallback)(
|
|
9955
10222
|
(e) => {
|
|
9956
10223
|
if (!e.key) return;
|
|
9957
10224
|
e.stopPropagation();
|
|
@@ -9986,10 +10253,10 @@ var VideoPlayer = ({
|
|
|
9986
10253
|
]
|
|
9987
10254
|
);
|
|
9988
10255
|
const groupedSubTitleValid = subtitles && subtitlesValidation === "valid";
|
|
9989
|
-
return /* @__PURE__ */ (0,
|
|
9990
|
-
(title || subtitleText) && /* @__PURE__ */ (0,
|
|
9991
|
-
/* @__PURE__ */ (0,
|
|
9992
|
-
title && /* @__PURE__ */ (0,
|
|
10256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex flex-col", className), children: [
|
|
10257
|
+
(title || subtitleText) && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "bg-subject-1 px-8 py-4 flex items-end justify-between min-h-20", children: [
|
|
10258
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
10259
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9993
10260
|
Text_default,
|
|
9994
10261
|
{
|
|
9995
10262
|
as: "h2",
|
|
@@ -10000,7 +10267,7 @@ var VideoPlayer = ({
|
|
|
10000
10267
|
children: title
|
|
10001
10268
|
}
|
|
10002
10269
|
),
|
|
10003
|
-
subtitleText && /* @__PURE__ */ (0,
|
|
10270
|
+
subtitleText && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10004
10271
|
Text_default,
|
|
10005
10272
|
{
|
|
10006
10273
|
as: "p",
|
|
@@ -10012,7 +10279,7 @@ var VideoPlayer = ({
|
|
|
10012
10279
|
}
|
|
10013
10280
|
)
|
|
10014
10281
|
] }),
|
|
10015
|
-
showDownloadButton && downloadContent && /* @__PURE__ */ (0,
|
|
10282
|
+
showDownloadButton && downloadContent && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10016
10283
|
DownloadButton_default,
|
|
10017
10284
|
{
|
|
10018
10285
|
content: downloadContent,
|
|
@@ -10024,7 +10291,7 @@ var VideoPlayer = ({
|
|
|
10024
10291
|
}
|
|
10025
10292
|
)
|
|
10026
10293
|
] }),
|
|
10027
|
-
/* @__PURE__ */ (0,
|
|
10294
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
10028
10295
|
"section",
|
|
10029
10296
|
{
|
|
10030
10297
|
className: cn(
|
|
@@ -10039,7 +10306,7 @@ var VideoPlayer = ({
|
|
|
10039
10306
|
onTouchStart: handleMouseEnter,
|
|
10040
10307
|
onMouseLeave: handleMouseLeave,
|
|
10041
10308
|
children: [
|
|
10042
|
-
/* @__PURE__ */ (0,
|
|
10309
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10043
10310
|
"video",
|
|
10044
10311
|
{
|
|
10045
10312
|
ref: videoRef,
|
|
@@ -10054,7 +10321,7 @@ var VideoPlayer = ({
|
|
|
10054
10321
|
onKeyDown: handleVideoKeyDown,
|
|
10055
10322
|
tabIndex: 0,
|
|
10056
10323
|
"aria-label": title ? `Video: ${title}` : "Video player",
|
|
10057
|
-
children: /* @__PURE__ */ (0,
|
|
10324
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10058
10325
|
"track",
|
|
10059
10326
|
{
|
|
10060
10327
|
ref: trackRef,
|
|
@@ -10067,17 +10334,17 @@ var VideoPlayer = ({
|
|
|
10067
10334
|
)
|
|
10068
10335
|
}
|
|
10069
10336
|
),
|
|
10070
|
-
!isPlaying && /* @__PURE__ */ (0,
|
|
10337
|
+
!isPlaying && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10071
10338
|
"div",
|
|
10072
10339
|
{
|
|
10073
10340
|
className: cn(
|
|
10074
10341
|
"absolute inset-0 flex bg-black/30 transition-opacity",
|
|
10075
10342
|
getCenterPlayButtonPosition()
|
|
10076
10343
|
),
|
|
10077
|
-
children: /* @__PURE__ */ (0,
|
|
10344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10078
10345
|
IconButton_default,
|
|
10079
10346
|
{
|
|
10080
|
-
icon: /* @__PURE__ */ (0,
|
|
10347
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.Play, { size: 32, weight: "regular", className: "ml-1" }),
|
|
10081
10348
|
onClick: togglePlayPause,
|
|
10082
10349
|
"aria-label": "Play video",
|
|
10083
10350
|
className: "!bg-transparent !text-white !w-auto !h-auto hover:!bg-transparent hover:!text-gray-200"
|
|
@@ -10085,17 +10352,17 @@ var VideoPlayer = ({
|
|
|
10085
10352
|
)
|
|
10086
10353
|
}
|
|
10087
10354
|
),
|
|
10088
|
-
/* @__PURE__ */ (0,
|
|
10355
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10089
10356
|
"div",
|
|
10090
10357
|
{
|
|
10091
10358
|
className: cn(
|
|
10092
10359
|
"absolute top-0 left-0 right-0 p-4 bg-gradient-to-b from-black/70 to-transparent transition-opacity",
|
|
10093
10360
|
getTopControlsOpacity()
|
|
10094
10361
|
),
|
|
10095
|
-
children: /* @__PURE__ */ (0,
|
|
10362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10096
10363
|
IconButton_default,
|
|
10097
10364
|
{
|
|
10098
|
-
icon: isFullscreen ? /* @__PURE__ */ (0,
|
|
10365
|
+
icon: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.ArrowsInSimple, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.ArrowsOutSimple, { size: 24 }),
|
|
10099
10366
|
onClick: toggleFullscreen,
|
|
10100
10367
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
10101
10368
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
@@ -10103,7 +10370,7 @@ var VideoPlayer = ({
|
|
|
10103
10370
|
) })
|
|
10104
10371
|
}
|
|
10105
10372
|
),
|
|
10106
|
-
/* @__PURE__ */ (0,
|
|
10373
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
10107
10374
|
"div",
|
|
10108
10375
|
{
|
|
10109
10376
|
className: cn(
|
|
@@ -10111,7 +10378,7 @@ var VideoPlayer = ({
|
|
|
10111
10378
|
getBottomControlsOpacity()
|
|
10112
10379
|
),
|
|
10113
10380
|
children: [
|
|
10114
|
-
/* @__PURE__ */ (0,
|
|
10381
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10115
10382
|
ProgressBar2,
|
|
10116
10383
|
{
|
|
10117
10384
|
currentTime,
|
|
@@ -10121,7 +10388,7 @@ var VideoPlayer = ({
|
|
|
10121
10388
|
className: getProgressBarPadding()
|
|
10122
10389
|
}
|
|
10123
10390
|
),
|
|
10124
|
-
/* @__PURE__ */ (0,
|
|
10391
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
10125
10392
|
"div",
|
|
10126
10393
|
{
|
|
10127
10394
|
className: cn(
|
|
@@ -10129,17 +10396,17 @@ var VideoPlayer = ({
|
|
|
10129
10396
|
getControlsPadding()
|
|
10130
10397
|
),
|
|
10131
10398
|
children: [
|
|
10132
|
-
/* @__PURE__ */ (0,
|
|
10133
|
-
/* @__PURE__ */ (0,
|
|
10399
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex items-center", getControlsGap()), children: [
|
|
10400
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10134
10401
|
IconButton_default,
|
|
10135
10402
|
{
|
|
10136
|
-
icon: isPlaying ? /* @__PURE__ */ (0,
|
|
10403
|
+
icon: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.Pause, { size: getIconSize2() }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.Play, { size: getIconSize2() }),
|
|
10137
10404
|
onClick: togglePlayPause,
|
|
10138
10405
|
"aria-label": isPlaying ? "Pause" : "Play",
|
|
10139
10406
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
10140
10407
|
}
|
|
10141
10408
|
),
|
|
10142
|
-
/* @__PURE__ */ (0,
|
|
10409
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10143
10410
|
VolumeControls,
|
|
10144
10411
|
{
|
|
10145
10412
|
volume,
|
|
@@ -10150,10 +10417,10 @@ var VideoPlayer = ({
|
|
|
10150
10417
|
showSlider: !isUltraSmallMobile
|
|
10151
10418
|
}
|
|
10152
10419
|
),
|
|
10153
|
-
groupedSubTitleValid && /* @__PURE__ */ (0,
|
|
10420
|
+
groupedSubTitleValid && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10154
10421
|
IconButton_default,
|
|
10155
10422
|
{
|
|
10156
|
-
icon: /* @__PURE__ */ (0,
|
|
10423
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react22.ClosedCaptioning, { size: getIconSize2() }),
|
|
10157
10424
|
onClick: toggleCaptions,
|
|
10158
10425
|
"aria-label": showCaptions ? "Hide captions" : "Show captions",
|
|
10159
10426
|
className: cn(
|
|
@@ -10162,13 +10429,13 @@ var VideoPlayer = ({
|
|
|
10162
10429
|
)
|
|
10163
10430
|
}
|
|
10164
10431
|
),
|
|
10165
|
-
/* @__PURE__ */ (0,
|
|
10432
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Text_default, { size: "sm", weight: "medium", color: "text-white", children: [
|
|
10166
10433
|
formatTime(currentTime),
|
|
10167
10434
|
" / ",
|
|
10168
10435
|
formatTime(duration)
|
|
10169
10436
|
] })
|
|
10170
10437
|
] }),
|
|
10171
|
-
/* @__PURE__ */ (0,
|
|
10438
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10172
10439
|
SpeedMenu,
|
|
10173
10440
|
{
|
|
10174
10441
|
showSpeedMenu,
|
|
@@ -10194,9 +10461,9 @@ var VideoPlayer = ({
|
|
|
10194
10461
|
var VideoPlayer_default = VideoPlayer;
|
|
10195
10462
|
|
|
10196
10463
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
10197
|
-
var
|
|
10464
|
+
var import_react31 = require("react");
|
|
10198
10465
|
var import_phosphor_react23 = require("phosphor-react");
|
|
10199
|
-
var
|
|
10466
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
10200
10467
|
var IMAGE_WIDTH = 225;
|
|
10201
10468
|
var IMAGE_HEIGHT = 90;
|
|
10202
10469
|
var Whiteboard = ({
|
|
@@ -10207,8 +10474,8 @@ var Whiteboard = ({
|
|
|
10207
10474
|
imagesPerRow = 2,
|
|
10208
10475
|
...rest
|
|
10209
10476
|
}) => {
|
|
10210
|
-
const [imageErrors, setImageErrors] = (0,
|
|
10211
|
-
const handleDownload = (0,
|
|
10477
|
+
const [imageErrors, setImageErrors] = (0, import_react31.useState)(/* @__PURE__ */ new Set());
|
|
10478
|
+
const handleDownload = (0, import_react31.useCallback)(
|
|
10212
10479
|
(image) => {
|
|
10213
10480
|
if (onDownload) {
|
|
10214
10481
|
onDownload(image);
|
|
@@ -10225,7 +10492,7 @@ var Whiteboard = ({
|
|
|
10225
10492
|
},
|
|
10226
10493
|
[onDownload]
|
|
10227
10494
|
);
|
|
10228
|
-
const handleImageError = (0,
|
|
10495
|
+
const handleImageError = (0, import_react31.useCallback)((imageId) => {
|
|
10229
10496
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
10230
10497
|
}, []);
|
|
10231
10498
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -10234,7 +10501,7 @@ var Whiteboard = ({
|
|
|
10234
10501
|
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
10235
10502
|
}[imagesPerRow];
|
|
10236
10503
|
if (!images || images.length === 0) {
|
|
10237
|
-
return /* @__PURE__ */ (0,
|
|
10504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10238
10505
|
"div",
|
|
10239
10506
|
{
|
|
10240
10507
|
className: cn(
|
|
@@ -10242,11 +10509,11 @@ var Whiteboard = ({
|
|
|
10242
10509
|
className
|
|
10243
10510
|
),
|
|
10244
10511
|
...rest,
|
|
10245
|
-
children: /* @__PURE__ */ (0,
|
|
10512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-gray-400 text-sm", children: "Nenhuma imagem dispon\xEDvel" })
|
|
10246
10513
|
}
|
|
10247
10514
|
);
|
|
10248
10515
|
}
|
|
10249
|
-
return /* @__PURE__ */ (0,
|
|
10516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10250
10517
|
"div",
|
|
10251
10518
|
{
|
|
10252
10519
|
className: cn(
|
|
@@ -10254,7 +10521,7 @@ var Whiteboard = ({
|
|
|
10254
10521
|
className
|
|
10255
10522
|
),
|
|
10256
10523
|
...rest,
|
|
10257
|
-
children: /* @__PURE__ */ (0,
|
|
10524
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: cn("grid gap-4", gridColsClass), children: images.map((image) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
10258
10525
|
"div",
|
|
10259
10526
|
{
|
|
10260
10527
|
className: "relative group overflow-hidden bg-gray-100 rounded-lg",
|
|
@@ -10262,7 +10529,7 @@ var Whiteboard = ({
|
|
|
10262
10529
|
width: `${IMAGE_WIDTH}px`
|
|
10263
10530
|
},
|
|
10264
10531
|
children: [
|
|
10265
|
-
/* @__PURE__ */ (0,
|
|
10532
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10266
10533
|
"div",
|
|
10267
10534
|
{
|
|
10268
10535
|
className: "relative",
|
|
@@ -10270,8 +10537,8 @@ var Whiteboard = ({
|
|
|
10270
10537
|
width: `${IMAGE_WIDTH}px`,
|
|
10271
10538
|
height: `${IMAGE_HEIGHT}px`
|
|
10272
10539
|
},
|
|
10273
|
-
children: imageErrors.has(image.id) ? /* @__PURE__ */ (0,
|
|
10274
|
-
/* @__PURE__ */ (0,
|
|
10540
|
+
children: imageErrors.has(image.id) ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-gray-500 text-sm text-center px-2", children: "Imagem indispon\xEDvel" }) }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
10541
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10275
10542
|
"img",
|
|
10276
10543
|
{
|
|
10277
10544
|
src: image.imageUrl,
|
|
@@ -10281,18 +10548,18 @@ var Whiteboard = ({
|
|
|
10281
10548
|
onError: () => handleImageError(image.id)
|
|
10282
10549
|
}
|
|
10283
10550
|
),
|
|
10284
|
-
/* @__PURE__ */ (0,
|
|
10551
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-black/20 to-transparent" })
|
|
10285
10552
|
] })
|
|
10286
10553
|
}
|
|
10287
10554
|
),
|
|
10288
|
-
showDownload && /* @__PURE__ */ (0,
|
|
10555
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10289
10556
|
"button",
|
|
10290
10557
|
{
|
|
10291
10558
|
type: "button",
|
|
10292
10559
|
onClick: () => handleDownload(image),
|
|
10293
10560
|
className: "cursor-pointer absolute bottom-3 right-3 flex items-center justify-center bg-black/20 backdrop-blur-sm rounded hover:bg-black/30 transition-colors duration-200 group/button w-6 h-6",
|
|
10294
10561
|
"aria-label": `Download ${image.title || "imagem"}`,
|
|
10295
|
-
children: /* @__PURE__ */ (0,
|
|
10562
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10296
10563
|
import_phosphor_react23.ArrowsOut,
|
|
10297
10564
|
{
|
|
10298
10565
|
size: 24,
|
|
@@ -10312,10 +10579,10 @@ var Whiteboard = ({
|
|
|
10312
10579
|
var Whiteboard_default = Whiteboard;
|
|
10313
10580
|
|
|
10314
10581
|
// src/components/Auth/Auth.tsx
|
|
10315
|
-
var
|
|
10582
|
+
var import_react32 = require("react");
|
|
10316
10583
|
var import_react_router_dom = require("react-router-dom");
|
|
10317
|
-
var
|
|
10318
|
-
var AuthContext = (0,
|
|
10584
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
10585
|
+
var AuthContext = (0, import_react32.createContext)(void 0);
|
|
10319
10586
|
var AuthProvider = ({
|
|
10320
10587
|
children,
|
|
10321
10588
|
checkAuthFn,
|
|
@@ -10325,12 +10592,12 @@ var AuthProvider = ({
|
|
|
10325
10592
|
getSessionFn,
|
|
10326
10593
|
getTokensFn
|
|
10327
10594
|
}) => {
|
|
10328
|
-
const [authState, setAuthState] = (0,
|
|
10595
|
+
const [authState, setAuthState] = (0, import_react32.useState)({
|
|
10329
10596
|
isAuthenticated: false,
|
|
10330
10597
|
isLoading: true,
|
|
10331
10598
|
...initialAuthState
|
|
10332
10599
|
});
|
|
10333
|
-
const checkAuth = (0,
|
|
10600
|
+
const checkAuth = (0, import_react32.useCallback)(async () => {
|
|
10334
10601
|
try {
|
|
10335
10602
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
10336
10603
|
if (!checkAuthFn) {
|
|
@@ -10361,7 +10628,7 @@ var AuthProvider = ({
|
|
|
10361
10628
|
return false;
|
|
10362
10629
|
}
|
|
10363
10630
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
10364
|
-
const signOut = (0,
|
|
10631
|
+
const signOut = (0, import_react32.useCallback)(() => {
|
|
10365
10632
|
if (signOutFn) {
|
|
10366
10633
|
signOutFn();
|
|
10367
10634
|
}
|
|
@@ -10373,10 +10640,10 @@ var AuthProvider = ({
|
|
|
10373
10640
|
tokens: void 0
|
|
10374
10641
|
}));
|
|
10375
10642
|
}, [signOutFn]);
|
|
10376
|
-
(0,
|
|
10643
|
+
(0, import_react32.useEffect)(() => {
|
|
10377
10644
|
checkAuth();
|
|
10378
10645
|
}, [checkAuth]);
|
|
10379
|
-
const contextValue = (0,
|
|
10646
|
+
const contextValue = (0, import_react32.useMemo)(
|
|
10380
10647
|
() => ({
|
|
10381
10648
|
...authState,
|
|
10382
10649
|
checkAuth,
|
|
@@ -10384,10 +10651,10 @@ var AuthProvider = ({
|
|
|
10384
10651
|
}),
|
|
10385
10652
|
[authState, checkAuth, signOut]
|
|
10386
10653
|
);
|
|
10387
|
-
return /* @__PURE__ */ (0,
|
|
10654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AuthContext.Provider, { value: contextValue, children });
|
|
10388
10655
|
};
|
|
10389
10656
|
var useAuth = () => {
|
|
10390
|
-
const context = (0,
|
|
10657
|
+
const context = (0, import_react32.useContext)(AuthContext);
|
|
10391
10658
|
if (context === void 0) {
|
|
10392
10659
|
throw new Error("useAuth deve ser usado dentro de um AuthProvider");
|
|
10393
10660
|
}
|
|
@@ -10400,9 +10667,9 @@ var ProtectedRoute = ({
|
|
|
10400
10667
|
additionalCheck
|
|
10401
10668
|
}) => {
|
|
10402
10669
|
const { isAuthenticated, isLoading, ...authState } = useAuth();
|
|
10403
|
-
const defaultLoadingComponent = /* @__PURE__ */ (0,
|
|
10670
|
+
const defaultLoadingComponent = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
10404
10671
|
if (isLoading) {
|
|
10405
|
-
return /* @__PURE__ */ (0,
|
|
10672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: loadingComponent || defaultLoadingComponent });
|
|
10406
10673
|
}
|
|
10407
10674
|
if (!isAuthenticated) {
|
|
10408
10675
|
if (typeof window !== "undefined") {
|
|
@@ -10413,12 +10680,12 @@ var ProtectedRoute = ({
|
|
|
10413
10680
|
return null;
|
|
10414
10681
|
}
|
|
10415
10682
|
}
|
|
10416
|
-
return /* @__PURE__ */ (0,
|
|
10683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
10417
10684
|
}
|
|
10418
10685
|
if (additionalCheck && !additionalCheck({ isAuthenticated, isLoading, ...authState })) {
|
|
10419
|
-
return /* @__PURE__ */ (0,
|
|
10686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
10420
10687
|
}
|
|
10421
|
-
return /* @__PURE__ */ (0,
|
|
10688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children });
|
|
10422
10689
|
};
|
|
10423
10690
|
var PublicRoute = ({
|
|
10424
10691
|
children,
|
|
@@ -10428,15 +10695,15 @@ var PublicRoute = ({
|
|
|
10428
10695
|
}) => {
|
|
10429
10696
|
const { isAuthenticated, isLoading } = useAuth();
|
|
10430
10697
|
if (checkAuthBeforeRender && isLoading) {
|
|
10431
|
-
return /* @__PURE__ */ (0,
|
|
10698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
10432
10699
|
}
|
|
10433
10700
|
if (isAuthenticated && redirectIfAuthenticated) {
|
|
10434
|
-
return /* @__PURE__ */ (0,
|
|
10701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
10435
10702
|
}
|
|
10436
|
-
return /* @__PURE__ */ (0,
|
|
10703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children });
|
|
10437
10704
|
};
|
|
10438
10705
|
var withAuth = (Component, options = {}) => {
|
|
10439
|
-
return (props) => /* @__PURE__ */ (0,
|
|
10706
|
+
return (props) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ProtectedRoute, { ...options, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Component, { ...props }) });
|
|
10440
10707
|
};
|
|
10441
10708
|
var useAuthGuard = (options = {}) => {
|
|
10442
10709
|
const authState = useAuth();
|
|
@@ -10451,7 +10718,7 @@ var useAuthGuard = (options = {}) => {
|
|
|
10451
10718
|
var useRouteAuth = (fallbackPath = "/") => {
|
|
10452
10719
|
const { isAuthenticated, isLoading } = useAuth();
|
|
10453
10720
|
const location = (0, import_react_router_dom.useLocation)();
|
|
10454
|
-
const redirectToLogin = () => /* @__PURE__ */ (0,
|
|
10721
|
+
const redirectToLogin = () => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_router_dom.Navigate, { to: fallbackPath, state: { from: location }, replace: true });
|
|
10455
10722
|
return {
|
|
10456
10723
|
isAuthenticated,
|
|
10457
10724
|
isLoading,
|
|
@@ -10485,10 +10752,10 @@ var getRootDomain = () => {
|
|
|
10485
10752
|
};
|
|
10486
10753
|
|
|
10487
10754
|
// src/components/Accordation/Accordation.tsx
|
|
10488
|
-
var
|
|
10755
|
+
var import_react33 = require("react");
|
|
10489
10756
|
var import_phosphor_react24 = require("phosphor-react");
|
|
10490
|
-
var
|
|
10491
|
-
var CardAccordation = (0,
|
|
10757
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
10758
|
+
var CardAccordation = (0, import_react33.forwardRef)(
|
|
10492
10759
|
({
|
|
10493
10760
|
trigger,
|
|
10494
10761
|
children,
|
|
@@ -10500,13 +10767,13 @@ var CardAccordation = (0, import_react32.forwardRef)(
|
|
|
10500
10767
|
disabled = false,
|
|
10501
10768
|
...props
|
|
10502
10769
|
}, ref) => {
|
|
10503
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
10504
|
-
const generatedId = (0,
|
|
10770
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react33.useState)(defaultExpanded);
|
|
10771
|
+
const generatedId = (0, import_react33.useId)();
|
|
10505
10772
|
const contentId = value ? `accordion-content-${value}` : generatedId;
|
|
10506
10773
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
10507
10774
|
const isControlled = controlledExpanded !== void 0;
|
|
10508
10775
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
10509
|
-
(0,
|
|
10776
|
+
(0, import_react33.useEffect)(() => {
|
|
10510
10777
|
if (isControlled) {
|
|
10511
10778
|
setInternalExpanded(controlledExpanded);
|
|
10512
10779
|
}
|
|
@@ -10526,7 +10793,7 @@ var CardAccordation = (0, import_react32.forwardRef)(
|
|
|
10526
10793
|
handleToggle();
|
|
10527
10794
|
}
|
|
10528
10795
|
};
|
|
10529
|
-
return /* @__PURE__ */ (0,
|
|
10796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
10530
10797
|
CardBase,
|
|
10531
10798
|
{
|
|
10532
10799
|
ref,
|
|
@@ -10536,7 +10803,7 @@ var CardAccordation = (0, import_react32.forwardRef)(
|
|
|
10536
10803
|
className: cn("overflow-hidden", className),
|
|
10537
10804
|
...props,
|
|
10538
10805
|
children: [
|
|
10539
|
-
/* @__PURE__ */ (0,
|
|
10806
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
10540
10807
|
"button",
|
|
10541
10808
|
{
|
|
10542
10809
|
id: headerId,
|
|
@@ -10554,7 +10821,7 @@ var CardAccordation = (0, import_react32.forwardRef)(
|
|
|
10554
10821
|
"data-value": value,
|
|
10555
10822
|
children: [
|
|
10556
10823
|
trigger,
|
|
10557
|
-
/* @__PURE__ */ (0,
|
|
10824
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
10558
10825
|
import_phosphor_react24.CaretRight,
|
|
10559
10826
|
{
|
|
10560
10827
|
size: 20,
|
|
@@ -10569,7 +10836,7 @@ var CardAccordation = (0, import_react32.forwardRef)(
|
|
|
10569
10836
|
]
|
|
10570
10837
|
}
|
|
10571
10838
|
),
|
|
10572
|
-
/* @__PURE__ */ (0,
|
|
10839
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
10573
10840
|
"section",
|
|
10574
10841
|
{
|
|
10575
10842
|
id: contentId,
|
|
@@ -10581,7 +10848,7 @@ var CardAccordation = (0, import_react32.forwardRef)(
|
|
|
10581
10848
|
),
|
|
10582
10849
|
"data-testid": "accordion-content",
|
|
10583
10850
|
"data-value": value,
|
|
10584
|
-
children: /* @__PURE__ */ (0,
|
|
10851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "p-4 pt-0", children })
|
|
10585
10852
|
}
|
|
10586
10853
|
)
|
|
10587
10854
|
]
|
|
@@ -10592,9 +10859,9 @@ var CardAccordation = (0, import_react32.forwardRef)(
|
|
|
10592
10859
|
CardAccordation.displayName = "CardAccordation";
|
|
10593
10860
|
|
|
10594
10861
|
// src/components/Accordation/AccordionGroup.tsx
|
|
10595
|
-
var
|
|
10862
|
+
var import_react34 = require("react");
|
|
10596
10863
|
var import_zustand9 = require("zustand");
|
|
10597
|
-
var
|
|
10864
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
10598
10865
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
10599
10866
|
return (0, import_zustand9.create)((set, get) => ({
|
|
10600
10867
|
type,
|
|
@@ -10612,8 +10879,8 @@ function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
|
10612
10879
|
}));
|
|
10613
10880
|
}
|
|
10614
10881
|
var injectStore6 = (children, store, indexRef, onItemToggle) => {
|
|
10615
|
-
return
|
|
10616
|
-
if (!(0,
|
|
10882
|
+
return import_react34.Children.map(children, (child) => {
|
|
10883
|
+
if (!(0, import_react34.isValidElement)(child)) {
|
|
10617
10884
|
return child;
|
|
10618
10885
|
}
|
|
10619
10886
|
const typedChild = child;
|
|
@@ -10640,16 +10907,16 @@ var injectStore6 = (children, store, indexRef, onItemToggle) => {
|
|
|
10640
10907
|
if (displayName === "CardAccordation") {
|
|
10641
10908
|
newProps.children = processedChildren;
|
|
10642
10909
|
} else if (processedChildren !== typedChild.props.children) {
|
|
10643
|
-
return (0,
|
|
10910
|
+
return (0, import_react34.cloneElement)(typedChild, { children: processedChildren });
|
|
10644
10911
|
}
|
|
10645
10912
|
}
|
|
10646
10913
|
if (Object.keys(newProps).length > 0) {
|
|
10647
|
-
return (0,
|
|
10914
|
+
return (0, import_react34.cloneElement)(typedChild, newProps);
|
|
10648
10915
|
}
|
|
10649
10916
|
return child;
|
|
10650
10917
|
});
|
|
10651
10918
|
};
|
|
10652
|
-
var AccordionGroup = (0,
|
|
10919
|
+
var AccordionGroup = (0, import_react34.forwardRef)(
|
|
10653
10920
|
({
|
|
10654
10921
|
type = "single",
|
|
10655
10922
|
defaultValue,
|
|
@@ -10660,12 +10927,12 @@ var AccordionGroup = (0, import_react33.forwardRef)(
|
|
|
10660
10927
|
className,
|
|
10661
10928
|
...props
|
|
10662
10929
|
}, ref) => {
|
|
10663
|
-
const [internalValue, setInternalValue] = (0,
|
|
10930
|
+
const [internalValue, setInternalValue] = (0, import_react34.useState)(
|
|
10664
10931
|
defaultValue || (type === "single" ? "" : [])
|
|
10665
10932
|
);
|
|
10666
10933
|
const isControlled = controlledValue !== void 0;
|
|
10667
10934
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
10668
|
-
const storeRef = (0,
|
|
10935
|
+
const storeRef = (0, import_react34.useRef)(null);
|
|
10669
10936
|
if (storeRef.current) {
|
|
10670
10937
|
storeRef.current.setState((prev) => {
|
|
10671
10938
|
const nextState = {};
|
|
@@ -10685,10 +10952,10 @@ var AccordionGroup = (0, import_react33.forwardRef)(
|
|
|
10685
10952
|
);
|
|
10686
10953
|
}
|
|
10687
10954
|
const store = storeRef.current;
|
|
10688
|
-
(0,
|
|
10955
|
+
(0, import_react34.useEffect)(() => {
|
|
10689
10956
|
store.setState({ value: currentValue });
|
|
10690
10957
|
}, [currentValue, store]);
|
|
10691
|
-
(0,
|
|
10958
|
+
(0, import_react34.useEffect)(() => {
|
|
10692
10959
|
if (!isControlled) {
|
|
10693
10960
|
setInternalValue((prev) => {
|
|
10694
10961
|
if (type === "single") {
|
|
@@ -10734,15 +11001,15 @@ var AccordionGroup = (0, import_react33.forwardRef)(
|
|
|
10734
11001
|
indexRef,
|
|
10735
11002
|
handleItemToggle
|
|
10736
11003
|
);
|
|
10737
|
-
return /* @__PURE__ */ (0,
|
|
11004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ref, className, ...props, children: enhancedChildren });
|
|
10738
11005
|
}
|
|
10739
11006
|
);
|
|
10740
11007
|
AccordionGroup.displayName = "AccordionGroup";
|
|
10741
11008
|
|
|
10742
11009
|
// src/components/Alternative/Alternative.tsx
|
|
10743
11010
|
var import_phosphor_react25 = require("phosphor-react");
|
|
10744
|
-
var
|
|
10745
|
-
var
|
|
11011
|
+
var import_react35 = require("react");
|
|
11012
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
10746
11013
|
var AlternativesList = ({
|
|
10747
11014
|
alternatives,
|
|
10748
11015
|
name,
|
|
@@ -10755,9 +11022,9 @@ var AlternativesList = ({
|
|
|
10755
11022
|
mode = "interactive",
|
|
10756
11023
|
selectedValue
|
|
10757
11024
|
}) => {
|
|
10758
|
-
const uniqueId = (0,
|
|
11025
|
+
const uniqueId = (0, import_react35.useId)();
|
|
10759
11026
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
10760
|
-
const [actualValue, setActualValue] = (0,
|
|
11027
|
+
const [actualValue, setActualValue] = (0, import_react35.useState)(value);
|
|
10761
11028
|
const isReadonly = mode === "readonly";
|
|
10762
11029
|
const getStatusStyles2 = (status, isReadonly2) => {
|
|
10763
11030
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
@@ -10773,9 +11040,9 @@ var AlternativesList = ({
|
|
|
10773
11040
|
const getStatusBadge2 = (status) => {
|
|
10774
11041
|
switch (status) {
|
|
10775
11042
|
case "correct":
|
|
10776
|
-
return /* @__PURE__ */ (0,
|
|
11043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_phosphor_react25.CheckCircle, {}), children: "Resposta correta" });
|
|
10777
11044
|
case "incorrect":
|
|
10778
|
-
return /* @__PURE__ */ (0,
|
|
11045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_phosphor_react25.XCircle, {}), children: "Resposta incorreta" });
|
|
10779
11046
|
default:
|
|
10780
11047
|
return null;
|
|
10781
11048
|
}
|
|
@@ -10805,10 +11072,10 @@ var AlternativesList = ({
|
|
|
10805
11072
|
const renderRadio = () => {
|
|
10806
11073
|
const radioClasses = `w-6 h-6 rounded-full border-2 cursor-default transition-all duration-200 flex items-center justify-center ${isUserSelected ? "border-primary-950 bg-background" : "border-border-400 bg-background"}`;
|
|
10807
11074
|
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
10808
|
-
return /* @__PURE__ */ (0,
|
|
11075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: dotClasses }) });
|
|
10809
11076
|
};
|
|
10810
11077
|
if (layout === "detailed") {
|
|
10811
|
-
return /* @__PURE__ */ (0,
|
|
11078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10812
11079
|
"div",
|
|
10813
11080
|
{
|
|
10814
11081
|
className: cn(
|
|
@@ -10816,11 +11083,11 @@ var AlternativesList = ({
|
|
|
10816
11083
|
statusStyles,
|
|
10817
11084
|
alternative.disabled ? "opacity-50" : ""
|
|
10818
11085
|
),
|
|
10819
|
-
children: /* @__PURE__ */ (0,
|
|
10820
|
-
/* @__PURE__ */ (0,
|
|
10821
|
-
/* @__PURE__ */ (0,
|
|
10822
|
-
/* @__PURE__ */ (0,
|
|
10823
|
-
/* @__PURE__ */ (0,
|
|
11086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
11087
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
11088
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mt-1", children: renderRadio() }),
|
|
11089
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex-1", children: [
|
|
11090
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10824
11091
|
"p",
|
|
10825
11092
|
{
|
|
10826
11093
|
className: cn(
|
|
@@ -10830,16 +11097,16 @@ var AlternativesList = ({
|
|
|
10830
11097
|
children: alternative.label
|
|
10831
11098
|
}
|
|
10832
11099
|
),
|
|
10833
|
-
alternative.description && /* @__PURE__ */ (0,
|
|
11100
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
10834
11101
|
] })
|
|
10835
11102
|
] }),
|
|
10836
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
11103
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
10837
11104
|
] })
|
|
10838
11105
|
},
|
|
10839
11106
|
alternativeId
|
|
10840
11107
|
);
|
|
10841
11108
|
}
|
|
10842
|
-
return /* @__PURE__ */ (0,
|
|
11109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
10843
11110
|
"div",
|
|
10844
11111
|
{
|
|
10845
11112
|
className: cn(
|
|
@@ -10848,9 +11115,9 @@ var AlternativesList = ({
|
|
|
10848
11115
|
alternative.disabled ? "opacity-50" : ""
|
|
10849
11116
|
),
|
|
10850
11117
|
children: [
|
|
10851
|
-
/* @__PURE__ */ (0,
|
|
11118
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
10852
11119
|
renderRadio(),
|
|
10853
|
-
/* @__PURE__ */ (0,
|
|
11120
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10854
11121
|
"span",
|
|
10855
11122
|
{
|
|
10856
11123
|
className: cn(
|
|
@@ -10861,14 +11128,14 @@ var AlternativesList = ({
|
|
|
10861
11128
|
}
|
|
10862
11129
|
)
|
|
10863
11130
|
] }),
|
|
10864
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
11131
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
10865
11132
|
]
|
|
10866
11133
|
},
|
|
10867
11134
|
alternativeId
|
|
10868
11135
|
);
|
|
10869
11136
|
};
|
|
10870
11137
|
if (isReadonly) {
|
|
10871
|
-
return /* @__PURE__ */ (0,
|
|
11138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10872
11139
|
"div",
|
|
10873
11140
|
{
|
|
10874
11141
|
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
@@ -10878,7 +11145,7 @@ var AlternativesList = ({
|
|
|
10878
11145
|
}
|
|
10879
11146
|
);
|
|
10880
11147
|
}
|
|
10881
|
-
return /* @__PURE__ */ (0,
|
|
11148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10882
11149
|
RadioGroup,
|
|
10883
11150
|
{
|
|
10884
11151
|
name: groupName,
|
|
@@ -10895,7 +11162,7 @@ var AlternativesList = ({
|
|
|
10895
11162
|
const statusStyles = getStatusStyles2(alternative.status, false);
|
|
10896
11163
|
const statusBadge = getStatusBadge2(alternative.status);
|
|
10897
11164
|
if (layout === "detailed") {
|
|
10898
|
-
return /* @__PURE__ */ (0,
|
|
11165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10899
11166
|
"div",
|
|
10900
11167
|
{
|
|
10901
11168
|
className: cn(
|
|
@@ -10903,9 +11170,9 @@ var AlternativesList = ({
|
|
|
10903
11170
|
statusStyles,
|
|
10904
11171
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
10905
11172
|
),
|
|
10906
|
-
children: /* @__PURE__ */ (0,
|
|
10907
|
-
/* @__PURE__ */ (0,
|
|
10908
|
-
/* @__PURE__ */ (0,
|
|
11173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
11174
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
11175
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10909
11176
|
RadioGroupItem,
|
|
10910
11177
|
{
|
|
10911
11178
|
value: alternative.value,
|
|
@@ -10914,8 +11181,8 @@ var AlternativesList = ({
|
|
|
10914
11181
|
className: "mt-1"
|
|
10915
11182
|
}
|
|
10916
11183
|
),
|
|
10917
|
-
/* @__PURE__ */ (0,
|
|
10918
|
-
/* @__PURE__ */ (0,
|
|
11184
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex-1", children: [
|
|
11185
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10919
11186
|
"label",
|
|
10920
11187
|
{
|
|
10921
11188
|
htmlFor: alternativeId,
|
|
@@ -10927,16 +11194,16 @@ var AlternativesList = ({
|
|
|
10927
11194
|
children: alternative.label
|
|
10928
11195
|
}
|
|
10929
11196
|
),
|
|
10930
|
-
alternative.description && /* @__PURE__ */ (0,
|
|
11197
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
10931
11198
|
] })
|
|
10932
11199
|
] }),
|
|
10933
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
11200
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
10934
11201
|
] })
|
|
10935
11202
|
},
|
|
10936
11203
|
alternativeId
|
|
10937
11204
|
);
|
|
10938
11205
|
}
|
|
10939
|
-
return /* @__PURE__ */ (0,
|
|
11206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
10940
11207
|
"div",
|
|
10941
11208
|
{
|
|
10942
11209
|
className: cn(
|
|
@@ -10945,8 +11212,8 @@ var AlternativesList = ({
|
|
|
10945
11212
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
10946
11213
|
),
|
|
10947
11214
|
children: [
|
|
10948
|
-
/* @__PURE__ */ (0,
|
|
10949
|
-
/* @__PURE__ */ (0,
|
|
11215
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
11216
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10950
11217
|
RadioGroupItem,
|
|
10951
11218
|
{
|
|
10952
11219
|
value: alternative.value,
|
|
@@ -10954,7 +11221,7 @@ var AlternativesList = ({
|
|
|
10954
11221
|
disabled: alternative.disabled
|
|
10955
11222
|
}
|
|
10956
11223
|
),
|
|
10957
|
-
/* @__PURE__ */ (0,
|
|
11224
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10958
11225
|
"label",
|
|
10959
11226
|
{
|
|
10960
11227
|
htmlFor: alternativeId,
|
|
@@ -10967,7 +11234,7 @@ var AlternativesList = ({
|
|
|
10967
11234
|
}
|
|
10968
11235
|
)
|
|
10969
11236
|
] }),
|
|
10970
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
11237
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
10971
11238
|
]
|
|
10972
11239
|
},
|
|
10973
11240
|
alternativeId
|
|
@@ -10976,9 +11243,9 @@ var AlternativesList = ({
|
|
|
10976
11243
|
}
|
|
10977
11244
|
);
|
|
10978
11245
|
};
|
|
10979
|
-
var HeaderAlternative = (0,
|
|
11246
|
+
var HeaderAlternative = (0, import_react35.forwardRef)(
|
|
10980
11247
|
({ className, title, subTitle, content, ...props }, ref) => {
|
|
10981
|
-
return /* @__PURE__ */ (0,
|
|
11248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
10982
11249
|
"div",
|
|
10983
11250
|
{
|
|
10984
11251
|
ref,
|
|
@@ -10988,11 +11255,11 @@ var HeaderAlternative = (0, import_react34.forwardRef)(
|
|
|
10988
11255
|
),
|
|
10989
11256
|
...props,
|
|
10990
11257
|
children: [
|
|
10991
|
-
/* @__PURE__ */ (0,
|
|
10992
|
-
/* @__PURE__ */ (0,
|
|
10993
|
-
/* @__PURE__ */ (0,
|
|
11258
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "flex flex-col", children: [
|
|
11259
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
|
|
11260
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
|
|
10994
11261
|
] }),
|
|
10995
|
-
/* @__PURE__ */ (0,
|
|
11262
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-text-950 text-md", children: content })
|
|
10996
11263
|
]
|
|
10997
11264
|
}
|
|
10998
11265
|
);
|
|
@@ -11042,7 +11309,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
11042
11309
|
}
|
|
11043
11310
|
|
|
11044
11311
|
// src/components/Auth/useUrlAuthentication.ts
|
|
11045
|
-
var
|
|
11312
|
+
var import_react36 = require("react");
|
|
11046
11313
|
var import_react_router_dom2 = require("react-router-dom");
|
|
11047
11314
|
var getAuthParams = (location, extractParams) => {
|
|
11048
11315
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -11090,8 +11357,8 @@ var handleUserData = (responseData, setUser) => {
|
|
|
11090
11357
|
};
|
|
11091
11358
|
function useUrlAuthentication(options) {
|
|
11092
11359
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
11093
|
-
const processedRef = (0,
|
|
11094
|
-
(0,
|
|
11360
|
+
const processedRef = (0, import_react36.useRef)(false);
|
|
11361
|
+
(0, import_react36.useEffect)(() => {
|
|
11095
11362
|
const handleAuthentication = async () => {
|
|
11096
11363
|
if (processedRef.current) {
|
|
11097
11364
|
return;
|
|
@@ -11162,9 +11429,9 @@ function useUrlAuthentication(options) {
|
|
|
11162
11429
|
}
|
|
11163
11430
|
|
|
11164
11431
|
// src/components/Auth/useApiConfig.ts
|
|
11165
|
-
var
|
|
11432
|
+
var import_react37 = require("react");
|
|
11166
11433
|
function useApiConfig(api) {
|
|
11167
|
-
return (0,
|
|
11434
|
+
return (0, import_react37.useMemo)(
|
|
11168
11435
|
() => ({
|
|
11169
11436
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
11170
11437
|
}),
|
|
@@ -11174,7 +11441,7 @@ function useApiConfig(api) {
|
|
|
11174
11441
|
|
|
11175
11442
|
// src/components/Quiz/Quiz.tsx
|
|
11176
11443
|
var import_phosphor_react28 = require("phosphor-react");
|
|
11177
|
-
var
|
|
11444
|
+
var import_react40 = require("react");
|
|
11178
11445
|
|
|
11179
11446
|
// src/components/Quiz/useQuizStore.ts
|
|
11180
11447
|
var import_zustand10 = require("zustand");
|
|
@@ -11784,12 +12051,12 @@ var useQuizStore = (0, import_zustand10.create)()(
|
|
|
11784
12051
|
);
|
|
11785
12052
|
|
|
11786
12053
|
// src/components/Quiz/QuizContent.tsx
|
|
11787
|
-
var
|
|
12054
|
+
var import_react39 = require("react");
|
|
11788
12055
|
|
|
11789
12056
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
11790
|
-
var
|
|
12057
|
+
var import_react38 = require("react");
|
|
11791
12058
|
var import_phosphor_react26 = require("phosphor-react");
|
|
11792
|
-
var
|
|
12059
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
11793
12060
|
var MultipleChoiceList = ({
|
|
11794
12061
|
disabled = false,
|
|
11795
12062
|
className = "",
|
|
@@ -11799,16 +12066,16 @@ var MultipleChoiceList = ({
|
|
|
11799
12066
|
onHandleSelectedValues,
|
|
11800
12067
|
mode = "interactive"
|
|
11801
12068
|
}) => {
|
|
11802
|
-
const [actualValue, setActualValue] = (0,
|
|
11803
|
-
(0,
|
|
12069
|
+
const [actualValue, setActualValue] = (0, import_react38.useState)(selectedValues);
|
|
12070
|
+
(0, import_react38.useEffect)(() => {
|
|
11804
12071
|
setActualValue(selectedValues);
|
|
11805
12072
|
}, [selectedValues]);
|
|
11806
12073
|
const getStatusBadge2 = (status) => {
|
|
11807
12074
|
switch (status) {
|
|
11808
12075
|
case "correct":
|
|
11809
|
-
return /* @__PURE__ */ (0,
|
|
12076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_phosphor_react26.CheckCircle, {}), children: "Resposta correta" });
|
|
11810
12077
|
case "incorrect":
|
|
11811
|
-
return /* @__PURE__ */ (0,
|
|
12078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_phosphor_react26.XCircle, {}), children: "Resposta incorreta" });
|
|
11812
12079
|
default:
|
|
11813
12080
|
return null;
|
|
11814
12081
|
}
|
|
@@ -11829,14 +12096,14 @@ var MultipleChoiceList = ({
|
|
|
11829
12096
|
isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
|
|
11830
12097
|
isDisabled && "opacity-40 cursor-not-allowed"
|
|
11831
12098
|
);
|
|
11832
|
-
return /* @__PURE__ */ (0,
|
|
12099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_phosphor_react26.Check, { size: 16, weight: "bold" }) });
|
|
11833
12100
|
};
|
|
11834
12101
|
if (mode === "readonly") {
|
|
11835
|
-
return /* @__PURE__ */ (0,
|
|
12102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
11836
12103
|
const isSelected = actualValue?.includes(choice.value) || false;
|
|
11837
12104
|
const statusStyles = getStatusStyles2(choice.status);
|
|
11838
12105
|
const statusBadge = getStatusBadge2(choice.status);
|
|
11839
|
-
return /* @__PURE__ */ (0,
|
|
12106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
11840
12107
|
"div",
|
|
11841
12108
|
{
|
|
11842
12109
|
className: cn(
|
|
@@ -11845,9 +12112,9 @@ var MultipleChoiceList = ({
|
|
|
11845
12112
|
choice.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
11846
12113
|
),
|
|
11847
12114
|
children: [
|
|
11848
|
-
/* @__PURE__ */ (0,
|
|
12115
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
11849
12116
|
renderVisualCheckbox(isSelected, choice.disabled || disabled),
|
|
11850
|
-
/* @__PURE__ */ (0,
|
|
12117
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11851
12118
|
"span",
|
|
11852
12119
|
{
|
|
11853
12120
|
className: cn(
|
|
@@ -11859,14 +12126,14 @@ var MultipleChoiceList = ({
|
|
|
11859
12126
|
}
|
|
11860
12127
|
)
|
|
11861
12128
|
] }),
|
|
11862
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
12129
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
11863
12130
|
]
|
|
11864
12131
|
},
|
|
11865
12132
|
`readonly-${choice.value}-${i}`
|
|
11866
12133
|
);
|
|
11867
12134
|
}) });
|
|
11868
12135
|
}
|
|
11869
|
-
return /* @__PURE__ */ (0,
|
|
12136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11870
12137
|
"div",
|
|
11871
12138
|
{
|
|
11872
12139
|
className: cn(
|
|
@@ -11874,7 +12141,7 @@ var MultipleChoiceList = ({
|
|
|
11874
12141
|
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
11875
12142
|
className
|
|
11876
12143
|
),
|
|
11877
|
-
children: /* @__PURE__ */ (0,
|
|
12144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11878
12145
|
CheckboxList_default,
|
|
11879
12146
|
{
|
|
11880
12147
|
name,
|
|
@@ -11884,12 +12151,12 @@ var MultipleChoiceList = ({
|
|
|
11884
12151
|
onHandleSelectedValues?.(v);
|
|
11885
12152
|
},
|
|
11886
12153
|
disabled,
|
|
11887
|
-
children: choices.map((choice, i) => /* @__PURE__ */ (0,
|
|
12154
|
+
children: choices.map((choice, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
11888
12155
|
"div",
|
|
11889
12156
|
{
|
|
11890
12157
|
className: "flex flex-row gap-2 items-center",
|
|
11891
12158
|
children: [
|
|
11892
|
-
/* @__PURE__ */ (0,
|
|
12159
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11893
12160
|
CheckboxListItem,
|
|
11894
12161
|
{
|
|
11895
12162
|
value: choice.value,
|
|
@@ -11897,7 +12164,7 @@ var MultipleChoiceList = ({
|
|
|
11897
12164
|
disabled: choice.disabled || disabled
|
|
11898
12165
|
}
|
|
11899
12166
|
),
|
|
11900
|
-
/* @__PURE__ */ (0,
|
|
12167
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11901
12168
|
"label",
|
|
11902
12169
|
{
|
|
11903
12170
|
htmlFor: `interactive-${choice.value}-${i}`,
|
|
@@ -11926,13 +12193,13 @@ var import_phosphor_react27 = require("phosphor-react");
|
|
|
11926
12193
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
11927
12194
|
|
|
11928
12195
|
// src/components/Quiz/QuizContent.tsx
|
|
11929
|
-
var
|
|
12196
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
11930
12197
|
var getStatusBadge = (status) => {
|
|
11931
12198
|
switch (status) {
|
|
11932
12199
|
case "correct":
|
|
11933
|
-
return /* @__PURE__ */ (0,
|
|
12200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_phosphor_react27.CheckCircle, {}), children: "Resposta correta" });
|
|
11934
12201
|
case "incorrect":
|
|
11935
|
-
return /* @__PURE__ */ (0,
|
|
12202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_phosphor_react27.XCircle, {}), children: "Resposta incorreta" });
|
|
11936
12203
|
default:
|
|
11937
12204
|
return null;
|
|
11938
12205
|
}
|
|
@@ -11945,13 +12212,13 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
11945
12212
|
return "bg-error-background border-error-300";
|
|
11946
12213
|
}
|
|
11947
12214
|
};
|
|
11948
|
-
var QuizSubTitle = (0,
|
|
12215
|
+
var QuizSubTitle = (0, import_react39.forwardRef)(
|
|
11949
12216
|
({ subTitle, ...props }, ref) => {
|
|
11950
|
-
return /* @__PURE__ */ (0,
|
|
12217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
11951
12218
|
}
|
|
11952
12219
|
);
|
|
11953
|
-
var QuizContainer = (0,
|
|
11954
|
-
return /* @__PURE__ */ (0,
|
|
12220
|
+
var QuizContainer = (0, import_react39.forwardRef)(({ children, className, ...props }, ref) => {
|
|
12221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
11955
12222
|
"div",
|
|
11956
12223
|
{
|
|
11957
12224
|
ref,
|
|
@@ -12004,10 +12271,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
12004
12271
|
};
|
|
12005
12272
|
});
|
|
12006
12273
|
if (!alternatives)
|
|
12007
|
-
return /* @__PURE__ */ (0,
|
|
12008
|
-
return /* @__PURE__ */ (0,
|
|
12009
|
-
/* @__PURE__ */ (0,
|
|
12010
|
-
/* @__PURE__ */ (0,
|
|
12274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
12275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12276
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
12277
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12011
12278
|
AlternativesList,
|
|
12012
12279
|
{
|
|
12013
12280
|
mode: variant === "default" ? "interactive" : "readonly",
|
|
@@ -12039,15 +12306,15 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
12039
12306
|
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
12040
12307
|
currentQuestion?.id || ""
|
|
12041
12308
|
);
|
|
12042
|
-
const prevSelectedValuesRef = (0,
|
|
12043
|
-
const prevQuestionIdRef = (0,
|
|
12044
|
-
const allCurrentAnswerIds = (0,
|
|
12309
|
+
const prevSelectedValuesRef = (0, import_react39.useRef)([]);
|
|
12310
|
+
const prevQuestionIdRef = (0, import_react39.useRef)("");
|
|
12311
|
+
const allCurrentAnswerIds = (0, import_react39.useMemo)(() => {
|
|
12045
12312
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
12046
12313
|
}, [allCurrentAnswers]);
|
|
12047
|
-
const selectedValues = (0,
|
|
12314
|
+
const selectedValues = (0, import_react39.useMemo)(() => {
|
|
12048
12315
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
12049
12316
|
}, [allCurrentAnswerIds]);
|
|
12050
|
-
const stableSelectedValues = (0,
|
|
12317
|
+
const stableSelectedValues = (0, import_react39.useMemo)(() => {
|
|
12051
12318
|
const currentQuestionId = currentQuestion?.id || "";
|
|
12052
12319
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
12053
12320
|
if (hasQuestionChanged) {
|
|
@@ -12071,7 +12338,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
12071
12338
|
variant,
|
|
12072
12339
|
currentQuestionResult?.selectedOptions
|
|
12073
12340
|
]);
|
|
12074
|
-
const handleSelectedValues = (0,
|
|
12341
|
+
const handleSelectedValues = (0, import_react39.useCallback)(
|
|
12075
12342
|
(values) => {
|
|
12076
12343
|
if (currentQuestion) {
|
|
12077
12344
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -12079,7 +12346,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
12079
12346
|
},
|
|
12080
12347
|
[currentQuestion, selectMultipleAnswer]
|
|
12081
12348
|
);
|
|
12082
|
-
const questionKey = (0,
|
|
12349
|
+
const questionKey = (0, import_react39.useMemo)(
|
|
12083
12350
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
12084
12351
|
[currentQuestion?.id]
|
|
12085
12352
|
);
|
|
@@ -12110,10 +12377,10 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
12110
12377
|
};
|
|
12111
12378
|
});
|
|
12112
12379
|
if (!choices)
|
|
12113
|
-
return /* @__PURE__ */ (0,
|
|
12114
|
-
return /* @__PURE__ */ (0,
|
|
12115
|
-
/* @__PURE__ */ (0,
|
|
12116
|
-
/* @__PURE__ */ (0,
|
|
12380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
12381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12382
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
12383
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12117
12384
|
MultipleChoiceList,
|
|
12118
12385
|
{
|
|
12119
12386
|
choices,
|
|
@@ -12140,14 +12407,14 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
12140
12407
|
currentQuestion?.id || ""
|
|
12141
12408
|
);
|
|
12142
12409
|
const currentAnswer = getCurrentAnswer();
|
|
12143
|
-
const textareaRef = (0,
|
|
12410
|
+
const textareaRef = (0, import_react39.useRef)(null);
|
|
12144
12411
|
const charLimit = getDissertativeCharLimit();
|
|
12145
12412
|
const handleAnswerChange = (value) => {
|
|
12146
12413
|
if (currentQuestion) {
|
|
12147
12414
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
12148
12415
|
}
|
|
12149
12416
|
};
|
|
12150
|
-
const adjustTextareaHeight = (0,
|
|
12417
|
+
const adjustTextareaHeight = (0, import_react39.useCallback)(() => {
|
|
12151
12418
|
if (textareaRef.current) {
|
|
12152
12419
|
textareaRef.current.style.height = "auto";
|
|
12153
12420
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -12157,16 +12424,16 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
12157
12424
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
12158
12425
|
}
|
|
12159
12426
|
}, []);
|
|
12160
|
-
(0,
|
|
12427
|
+
(0, import_react39.useEffect)(() => {
|
|
12161
12428
|
adjustTextareaHeight();
|
|
12162
12429
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
12163
12430
|
if (!currentQuestion) {
|
|
12164
|
-
return /* @__PURE__ */ (0,
|
|
12431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
12165
12432
|
}
|
|
12166
12433
|
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
12167
|
-
return /* @__PURE__ */ (0,
|
|
12168
|
-
/* @__PURE__ */ (0,
|
|
12169
|
-
/* @__PURE__ */ (0,
|
|
12434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12435
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Resposta" }),
|
|
12436
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12170
12437
|
TextArea_default,
|
|
12171
12438
|
{
|
|
12172
12439
|
ref: textareaRef,
|
|
@@ -12178,10 +12445,10 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
12178
12445
|
maxLength: charLimit,
|
|
12179
12446
|
showCharacterCount: !!charLimit
|
|
12180
12447
|
}
|
|
12181
|
-
) }) : /* @__PURE__ */ (0,
|
|
12182
|
-
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0,
|
|
12183
|
-
/* @__PURE__ */ (0,
|
|
12184
|
-
/* @__PURE__ */ (0,
|
|
12448
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
12449
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12450
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
12451
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentQuestionResult?.teacherFeedback }) })
|
|
12185
12452
|
] })
|
|
12186
12453
|
] });
|
|
12187
12454
|
};
|
|
@@ -12207,16 +12474,16 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
12207
12474
|
];
|
|
12208
12475
|
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
12209
12476
|
const isDefaultVariant = variant === "default";
|
|
12210
|
-
return /* @__PURE__ */ (0,
|
|
12211
|
-
/* @__PURE__ */ (0,
|
|
12212
|
-
/* @__PURE__ */ (0,
|
|
12477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12478
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
12479
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
12213
12480
|
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
12214
|
-
return /* @__PURE__ */ (0,
|
|
12481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12215
12482
|
"section",
|
|
12216
12483
|
{
|
|
12217
12484
|
className: "flex flex-col gap-2",
|
|
12218
12485
|
children: [
|
|
12219
|
-
/* @__PURE__ */ (0,
|
|
12486
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12220
12487
|
"div",
|
|
12221
12488
|
{
|
|
12222
12489
|
className: cn(
|
|
@@ -12224,20 +12491,20 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
12224
12491
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
12225
12492
|
),
|
|
12226
12493
|
children: [
|
|
12227
|
-
/* @__PURE__ */ (0,
|
|
12228
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
12229
|
-
/* @__PURE__ */ (0,
|
|
12230
|
-
/* @__PURE__ */ (0,
|
|
12231
|
-
/* @__PURE__ */ (0,
|
|
12232
|
-
/* @__PURE__ */ (0,
|
|
12494
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
12495
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Select_default, { size: "medium", children: [
|
|
12496
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
12497
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
|
|
12498
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
12499
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "F", children: "Falso" })
|
|
12233
12500
|
] })
|
|
12234
|
-
] }) : /* @__PURE__ */ (0,
|
|
12501
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
12235
12502
|
]
|
|
12236
12503
|
}
|
|
12237
12504
|
),
|
|
12238
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
12239
|
-
/* @__PURE__ */ (0,
|
|
12240
|
-
!option.isCorrect && /* @__PURE__ */ (0,
|
|
12505
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
12506
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
12507
|
+
!option.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
12241
12508
|
] })
|
|
12242
12509
|
]
|
|
12243
12510
|
},
|
|
@@ -12298,7 +12565,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
12298
12565
|
isCorrect: false
|
|
12299
12566
|
}
|
|
12300
12567
|
];
|
|
12301
|
-
const [userAnswers, setUserAnswers] = (0,
|
|
12568
|
+
const [userAnswers, setUserAnswers] = (0, import_react39.useState)(() => {
|
|
12302
12569
|
if (variant === "result") {
|
|
12303
12570
|
return mockUserAnswers;
|
|
12304
12571
|
}
|
|
@@ -12327,13 +12594,13 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
12327
12594
|
const assignedDots = new Set(
|
|
12328
12595
|
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
12329
12596
|
);
|
|
12330
|
-
return /* @__PURE__ */ (0,
|
|
12331
|
-
/* @__PURE__ */ (0,
|
|
12332
|
-
/* @__PURE__ */ (0,
|
|
12597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12598
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
12599
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
12333
12600
|
const answer = userAnswers[index];
|
|
12334
12601
|
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
12335
|
-
return /* @__PURE__ */ (0,
|
|
12336
|
-
/* @__PURE__ */ (0,
|
|
12602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
12603
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12337
12604
|
"div",
|
|
12338
12605
|
{
|
|
12339
12606
|
className: cn(
|
|
@@ -12341,30 +12608,30 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
12341
12608
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
12342
12609
|
),
|
|
12343
12610
|
children: [
|
|
12344
|
-
/* @__PURE__ */ (0,
|
|
12345
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
12611
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
12612
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12346
12613
|
Select_default,
|
|
12347
12614
|
{
|
|
12348
12615
|
size: "medium",
|
|
12349
12616
|
value: answer.dotOption || void 0,
|
|
12350
12617
|
onValueChange: (value) => handleSelectDot(index, value),
|
|
12351
12618
|
children: [
|
|
12352
|
-
/* @__PURE__ */ (0,
|
|
12353
|
-
/* @__PURE__ */ (0,
|
|
12619
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
12620
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectContent, { children: dotsOptions.filter(
|
|
12354
12621
|
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
12355
|
-
).map((dot) => /* @__PURE__ */ (0,
|
|
12622
|
+
).map((dot) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
12356
12623
|
]
|
|
12357
12624
|
}
|
|
12358
|
-
) : /* @__PURE__ */ (0,
|
|
12625
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
12359
12626
|
]
|
|
12360
12627
|
}
|
|
12361
12628
|
),
|
|
12362
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
12363
|
-
/* @__PURE__ */ (0,
|
|
12629
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
12630
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
12364
12631
|
"Resposta selecionada: ",
|
|
12365
12632
|
answer.dotOption || "Nenhuma"
|
|
12366
12633
|
] }),
|
|
12367
|
-
!answer.isCorrect && /* @__PURE__ */ (0,
|
|
12634
|
+
!answer.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
12368
12635
|
"Resposta correta: ",
|
|
12369
12636
|
answer.correctOption
|
|
12370
12637
|
] })
|
|
@@ -12417,8 +12684,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
12417
12684
|
isCorrect: true
|
|
12418
12685
|
}
|
|
12419
12686
|
];
|
|
12420
|
-
const [answers, setAnswers] = (0,
|
|
12421
|
-
const baseId = (0,
|
|
12687
|
+
const [answers, setAnswers] = (0, import_react39.useState)({});
|
|
12688
|
+
const baseId = (0, import_react39.useId)();
|
|
12422
12689
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
12423
12690
|
const usedOptions = new Set(
|
|
12424
12691
|
Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value)
|
|
@@ -12433,18 +12700,18 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
12433
12700
|
const mockAnswer = mockUserAnswers.find(
|
|
12434
12701
|
(answer) => answer.selectId === selectId
|
|
12435
12702
|
);
|
|
12436
|
-
return /* @__PURE__ */ (0,
|
|
12703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
12437
12704
|
};
|
|
12438
12705
|
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
12439
|
-
return /* @__PURE__ */ (0,
|
|
12706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12440
12707
|
Select_default,
|
|
12441
12708
|
{
|
|
12442
12709
|
value: selectedValue,
|
|
12443
12710
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
12444
12711
|
className: "inline-flex mb-2.5",
|
|
12445
12712
|
children: [
|
|
12446
|
-
/* @__PURE__ */ (0,
|
|
12447
|
-
/* @__PURE__ */ (0,
|
|
12713
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-background border-gray-300", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
12714
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
12448
12715
|
]
|
|
12449
12716
|
},
|
|
12450
12717
|
`${selectId}-${startIndex}`
|
|
@@ -12456,8 +12723,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
12456
12723
|
);
|
|
12457
12724
|
if (!mockAnswer) return null;
|
|
12458
12725
|
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
12459
|
-
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0,
|
|
12460
|
-
return /* @__PURE__ */ (0,
|
|
12726
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_phosphor_react27.CheckCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_phosphor_react27.XCircle, {});
|
|
12727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12461
12728
|
Badge_default,
|
|
12462
12729
|
{
|
|
12463
12730
|
variant: "solid",
|
|
@@ -12465,7 +12732,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
12465
12732
|
iconRight: icon,
|
|
12466
12733
|
size: "large",
|
|
12467
12734
|
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
12468
|
-
children: /* @__PURE__ */ (0,
|
|
12735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
12469
12736
|
},
|
|
12470
12737
|
selectId
|
|
12471
12738
|
);
|
|
@@ -12521,25 +12788,25 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
12521
12788
|
}
|
|
12522
12789
|
return elements;
|
|
12523
12790
|
};
|
|
12524
|
-
return /* @__PURE__ */ (0,
|
|
12525
|
-
/* @__PURE__ */ (0,
|
|
12526
|
-
/* @__PURE__ */ (0,
|
|
12791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12792
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
12793
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12527
12794
|
"div",
|
|
12528
12795
|
{
|
|
12529
12796
|
className: cn(
|
|
12530
12797
|
"text-lg text-text-900 leading-8 h-auto",
|
|
12531
12798
|
variant != "result" && paddingBottom
|
|
12532
12799
|
),
|
|
12533
|
-
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0,
|
|
12800
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: element.element }, element.id))
|
|
12534
12801
|
}
|
|
12535
12802
|
) }) }),
|
|
12536
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
12537
|
-
/* @__PURE__ */ (0,
|
|
12538
|
-
/* @__PURE__ */ (0,
|
|
12803
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12804
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Resultado" }),
|
|
12805
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12539
12806
|
"div",
|
|
12540
12807
|
{
|
|
12541
12808
|
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
12542
|
-
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0,
|
|
12809
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: element.element }, element.id))
|
|
12543
12810
|
}
|
|
12544
12811
|
) }) })
|
|
12545
12812
|
] })
|
|
@@ -12557,7 +12824,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
12557
12824
|
};
|
|
12558
12825
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
12559
12826
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
12560
|
-
const [clickPositionRelative, setClickPositionRelative] = (0,
|
|
12827
|
+
const [clickPositionRelative, setClickPositionRelative] = (0, import_react39.useState)(variant == "result" ? mockUserAnswerRelative : null);
|
|
12561
12828
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
12562
12829
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
12563
12830
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -12593,36 +12860,36 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
12593
12860
|
}
|
|
12594
12861
|
return "bg-success-600/70 border-white";
|
|
12595
12862
|
};
|
|
12596
|
-
return /* @__PURE__ */ (0,
|
|
12597
|
-
/* @__PURE__ */ (0,
|
|
12598
|
-
/* @__PURE__ */ (0,
|
|
12863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
12864
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizSubTitle, { subTitle: "Clique na \xE1rea correta" }),
|
|
12865
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12599
12866
|
"div",
|
|
12600
12867
|
{
|
|
12601
12868
|
"data-testid": "quiz-image-container",
|
|
12602
12869
|
className: "space-y-6 p-3 relative inline-block",
|
|
12603
12870
|
children: [
|
|
12604
|
-
variant == "result" && /* @__PURE__ */ (0,
|
|
12871
|
+
variant == "result" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12605
12872
|
"div",
|
|
12606
12873
|
{
|
|
12607
12874
|
"data-testid": "quiz-legend",
|
|
12608
12875
|
className: "flex items-center gap-4 text-xs",
|
|
12609
12876
|
children: [
|
|
12610
|
-
/* @__PURE__ */ (0,
|
|
12611
|
-
/* @__PURE__ */ (0,
|
|
12612
|
-
/* @__PURE__ */ (0,
|
|
12877
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12878
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
12879
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "\xC1rea correta" })
|
|
12613
12880
|
] }),
|
|
12614
|
-
/* @__PURE__ */ (0,
|
|
12615
|
-
/* @__PURE__ */ (0,
|
|
12616
|
-
/* @__PURE__ */ (0,
|
|
12881
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12882
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
12883
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta correta" })
|
|
12617
12884
|
] }),
|
|
12618
|
-
/* @__PURE__ */ (0,
|
|
12619
|
-
/* @__PURE__ */ (0,
|
|
12620
|
-
/* @__PURE__ */ (0,
|
|
12885
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12886
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
12887
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta incorreta" })
|
|
12621
12888
|
] })
|
|
12622
12889
|
]
|
|
12623
12890
|
}
|
|
12624
12891
|
),
|
|
12625
|
-
/* @__PURE__ */ (0,
|
|
12892
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12626
12893
|
"button",
|
|
12627
12894
|
{
|
|
12628
12895
|
"data-testid": "quiz-image-button",
|
|
@@ -12637,7 +12904,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
12637
12904
|
},
|
|
12638
12905
|
"aria-label": "\xC1rea da imagem interativa",
|
|
12639
12906
|
children: [
|
|
12640
|
-
/* @__PURE__ */ (0,
|
|
12907
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12641
12908
|
"img",
|
|
12642
12909
|
{
|
|
12643
12910
|
"data-testid": "quiz-image",
|
|
@@ -12646,7 +12913,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
12646
12913
|
className: "w-full h-auto rounded-md"
|
|
12647
12914
|
}
|
|
12648
12915
|
),
|
|
12649
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
12916
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12650
12917
|
"div",
|
|
12651
12918
|
{
|
|
12652
12919
|
"data-testid": "quiz-correct-circle",
|
|
@@ -12661,7 +12928,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
12661
12928
|
}
|
|
12662
12929
|
}
|
|
12663
12930
|
),
|
|
12664
|
-
clickPositionRelative && /* @__PURE__ */ (0,
|
|
12931
|
+
clickPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12665
12932
|
"div",
|
|
12666
12933
|
{
|
|
12667
12934
|
"data-testid": "quiz-user-circle",
|
|
@@ -12686,7 +12953,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
12686
12953
|
};
|
|
12687
12954
|
|
|
12688
12955
|
// src/components/Quiz/Quiz.tsx
|
|
12689
|
-
var
|
|
12956
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
12690
12957
|
var getQuizTypeConfig = (type) => {
|
|
12691
12958
|
const QUIZ_TYPE_CONFIG = {
|
|
12692
12959
|
["SIMULADO" /* SIMULADO */]: {
|
|
@@ -12723,14 +12990,14 @@ var getFinishConfirmationText = (type) => {
|
|
|
12723
12990
|
const config = getQuizTypeConfig(type);
|
|
12724
12991
|
return `Tem certeza que deseja finalizar ${config.article} ${config.label.toLowerCase()}?`;
|
|
12725
12992
|
};
|
|
12726
|
-
var Quiz = (0,
|
|
12993
|
+
var Quiz = (0, import_react40.forwardRef)(({ children, className, variant = "default", ...props }, ref) => {
|
|
12727
12994
|
const { setVariant } = useQuizStore();
|
|
12728
|
-
(0,
|
|
12995
|
+
(0, import_react40.useEffect)(() => {
|
|
12729
12996
|
setVariant(variant);
|
|
12730
12997
|
}, [variant, setVariant]);
|
|
12731
|
-
return /* @__PURE__ */ (0,
|
|
12998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
12732
12999
|
});
|
|
12733
|
-
var QuizTitle = (0,
|
|
13000
|
+
var QuizTitle = (0, import_react40.forwardRef)(({ className, onBack, ...props }, ref) => {
|
|
12734
13001
|
const {
|
|
12735
13002
|
quiz,
|
|
12736
13003
|
currentQuestionIndex,
|
|
@@ -12740,7 +13007,7 @@ var QuizTitle = (0, import_react39.forwardRef)(({ className, onBack, ...props },
|
|
|
12740
13007
|
formatTime: formatTime2,
|
|
12741
13008
|
isStarted
|
|
12742
13009
|
} = useQuizStore();
|
|
12743
|
-
const [showExitConfirmation, setShowExitConfirmation] = (0,
|
|
13010
|
+
const [showExitConfirmation, setShowExitConfirmation] = (0, import_react40.useState)(false);
|
|
12744
13011
|
const totalQuestions = getTotalQuestions();
|
|
12745
13012
|
const quizTitle = getQuizTitle();
|
|
12746
13013
|
const handleBackClick = () => {
|
|
@@ -12764,8 +13031,8 @@ var QuizTitle = (0, import_react39.forwardRef)(({ className, onBack, ...props },
|
|
|
12764
13031
|
const handleCancelExit = () => {
|
|
12765
13032
|
setShowExitConfirmation(false);
|
|
12766
13033
|
};
|
|
12767
|
-
return /* @__PURE__ */ (0,
|
|
12768
|
-
/* @__PURE__ */ (0,
|
|
13034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
13035
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
12769
13036
|
"div",
|
|
12770
13037
|
{
|
|
12771
13038
|
ref,
|
|
@@ -12775,24 +13042,24 @@ var QuizTitle = (0, import_react39.forwardRef)(({ className, onBack, ...props },
|
|
|
12775
13042
|
),
|
|
12776
13043
|
...props,
|
|
12777
13044
|
children: [
|
|
12778
|
-
/* @__PURE__ */ (0,
|
|
13045
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12779
13046
|
IconButton_default,
|
|
12780
13047
|
{
|
|
12781
|
-
icon: /* @__PURE__ */ (0,
|
|
13048
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react28.CaretLeft, { size: 24 }),
|
|
12782
13049
|
size: "md",
|
|
12783
13050
|
"aria-label": "Voltar",
|
|
12784
13051
|
onClick: handleBackClick
|
|
12785
13052
|
}
|
|
12786
13053
|
),
|
|
12787
|
-
/* @__PURE__ */ (0,
|
|
12788
|
-
/* @__PURE__ */ (0,
|
|
12789
|
-
/* @__PURE__ */ (0,
|
|
13054
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
13055
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
13056
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
12790
13057
|
] }),
|
|
12791
|
-
/* @__PURE__ */ (0,
|
|
13058
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react28.Clock, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
12792
13059
|
]
|
|
12793
13060
|
}
|
|
12794
13061
|
),
|
|
12795
|
-
/* @__PURE__ */ (0,
|
|
13062
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12796
13063
|
AlertDialog,
|
|
12797
13064
|
{
|
|
12798
13065
|
isOpen: showExitConfirmation,
|
|
@@ -12812,7 +13079,7 @@ var QuizHeader = () => {
|
|
|
12812
13079
|
const currentQuestion = getCurrentQuestion();
|
|
12813
13080
|
let currentId = currentQuestion && "questionId" in currentQuestion ? currentQuestion.questionId : currentQuestion?.id;
|
|
12814
13081
|
const questionIndex = getQuestionIndex(currentId);
|
|
12815
|
-
return /* @__PURE__ */ (0,
|
|
13082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12816
13083
|
HeaderAlternative,
|
|
12817
13084
|
{
|
|
12818
13085
|
title: currentQuestion ? `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}` : "Quest\xE3o",
|
|
@@ -12834,7 +13101,7 @@ var QuizContent = ({ paddingBottom }) => {
|
|
|
12834
13101
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
12835
13102
|
};
|
|
12836
13103
|
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
12837
|
-
return QuestionComponent ? /* @__PURE__ */ (0,
|
|
13104
|
+
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(QuestionComponent, { paddingBottom }) : null;
|
|
12838
13105
|
};
|
|
12839
13106
|
var QuizQuestionList = ({
|
|
12840
13107
|
filterType = "all",
|
|
@@ -12881,18 +13148,18 @@ var QuizQuestionList = ({
|
|
|
12881
13148
|
return "Em branco";
|
|
12882
13149
|
}
|
|
12883
13150
|
};
|
|
12884
|
-
return /* @__PURE__ */ (0,
|
|
12885
|
-
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ (0,
|
|
13151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "space-y-6 px-4 h-full", children: [
|
|
13152
|
+
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-lg", children: "Nenhum resultado" }) }),
|
|
12886
13153
|
Object.entries(filteredGroupedQuestions).map(
|
|
12887
|
-
([subjectId, questions]) => /* @__PURE__ */ (0,
|
|
12888
|
-
/* @__PURE__ */ (0,
|
|
12889
|
-
/* @__PURE__ */ (0,
|
|
12890
|
-
/* @__PURE__ */ (0,
|
|
13154
|
+
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
13155
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
13156
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react28.BookOpen, { size: 17, className: "text-white" }) }),
|
|
13157
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
12891
13158
|
] }),
|
|
12892
|
-
/* @__PURE__ */ (0,
|
|
13159
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
12893
13160
|
const status = getQuestionStatus(question.id);
|
|
12894
13161
|
const questionNumber = getQuestionIndex(question.id);
|
|
12895
|
-
return /* @__PURE__ */ (0,
|
|
13162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12896
13163
|
CardStatus,
|
|
12897
13164
|
{
|
|
12898
13165
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -12909,7 +13176,7 @@ var QuizQuestionList = ({
|
|
|
12909
13176
|
)
|
|
12910
13177
|
] });
|
|
12911
13178
|
};
|
|
12912
|
-
var QuizFooter = (0,
|
|
13179
|
+
var QuizFooter = (0, import_react40.forwardRef)(
|
|
12913
13180
|
({
|
|
12914
13181
|
className,
|
|
12915
13182
|
onGoToSimulated,
|
|
@@ -12943,8 +13210,8 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
12943
13210
|
const currentAnswer = getCurrentAnswer();
|
|
12944
13211
|
const currentQuestion = getCurrentQuestion();
|
|
12945
13212
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
12946
|
-
const [activeModal, setActiveModal] = (0,
|
|
12947
|
-
const [filterType, setFilterType] = (0,
|
|
13213
|
+
const [activeModal, setActiveModal] = (0, import_react40.useState)(null);
|
|
13214
|
+
const [filterType, setFilterType] = (0, import_react40.useState)("all");
|
|
12948
13215
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
12949
13216
|
const closeModal = () => setActiveModal(null);
|
|
12950
13217
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -12999,8 +13266,8 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
12999
13266
|
return;
|
|
13000
13267
|
}
|
|
13001
13268
|
};
|
|
13002
|
-
return /* @__PURE__ */ (0,
|
|
13003
|
-
/* @__PURE__ */ (0,
|
|
13269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
13270
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13004
13271
|
"footer",
|
|
13005
13272
|
{
|
|
13006
13273
|
ref,
|
|
@@ -13009,17 +13276,17 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13009
13276
|
className
|
|
13010
13277
|
),
|
|
13011
13278
|
...props,
|
|
13012
|
-
children: variant === "default" ? /* @__PURE__ */ (0,
|
|
13013
|
-
/* @__PURE__ */ (0,
|
|
13014
|
-
/* @__PURE__ */ (0,
|
|
13279
|
+
children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
13280
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
|
|
13281
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13015
13282
|
IconButton_default,
|
|
13016
13283
|
{
|
|
13017
|
-
icon: /* @__PURE__ */ (0,
|
|
13284
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react28.SquaresFour, { size: 24, className: "text-text-950" }),
|
|
13018
13285
|
size: "md",
|
|
13019
13286
|
onClick: () => openModal("modalNavigate")
|
|
13020
13287
|
}
|
|
13021
13288
|
),
|
|
13022
|
-
isFirstQuestion ? /* @__PURE__ */ (0,
|
|
13289
|
+
isFirstQuestion ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13023
13290
|
Button_default,
|
|
13024
13291
|
{
|
|
13025
13292
|
variant: "outline",
|
|
@@ -13030,13 +13297,13 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13030
13297
|
},
|
|
13031
13298
|
children: "Pular"
|
|
13032
13299
|
}
|
|
13033
|
-
) : /* @__PURE__ */ (0,
|
|
13300
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13034
13301
|
Button_default,
|
|
13035
13302
|
{
|
|
13036
13303
|
size: "medium",
|
|
13037
13304
|
variant: "link",
|
|
13038
13305
|
action: "primary",
|
|
13039
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
13306
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react28.CaretLeft, { size: 18 }),
|
|
13040
13307
|
onClick: () => {
|
|
13041
13308
|
goToPreviousQuestion();
|
|
13042
13309
|
},
|
|
@@ -13044,7 +13311,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13044
13311
|
}
|
|
13045
13312
|
)
|
|
13046
13313
|
] }),
|
|
13047
|
-
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ (0,
|
|
13314
|
+
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13048
13315
|
Button_default,
|
|
13049
13316
|
{
|
|
13050
13317
|
size: "small",
|
|
@@ -13057,7 +13324,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13057
13324
|
children: "Pular"
|
|
13058
13325
|
}
|
|
13059
13326
|
),
|
|
13060
|
-
isLastQuestion ? /* @__PURE__ */ (0,
|
|
13327
|
+
isLastQuestion ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13061
13328
|
Button_default,
|
|
13062
13329
|
{
|
|
13063
13330
|
size: "medium",
|
|
@@ -13066,13 +13333,13 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13066
13333
|
onClick: handleFinishQuiz,
|
|
13067
13334
|
children: "Finalizar"
|
|
13068
13335
|
}
|
|
13069
|
-
) : /* @__PURE__ */ (0,
|
|
13336
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13070
13337
|
Button_default,
|
|
13071
13338
|
{
|
|
13072
13339
|
size: "medium",
|
|
13073
13340
|
variant: "link",
|
|
13074
13341
|
action: "primary",
|
|
13075
|
-
iconRight: /* @__PURE__ */ (0,
|
|
13342
|
+
iconRight: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react28.CaretRight, { size: 18 }),
|
|
13076
13343
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
13077
13344
|
onClick: () => {
|
|
13078
13345
|
goToNextQuestion();
|
|
@@ -13080,7 +13347,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13080
13347
|
children: "Avan\xE7ar"
|
|
13081
13348
|
}
|
|
13082
13349
|
)
|
|
13083
|
-
] }) : /* @__PURE__ */ (0,
|
|
13350
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex flex-row items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13084
13351
|
Button_default,
|
|
13085
13352
|
{
|
|
13086
13353
|
variant: "link",
|
|
@@ -13092,7 +13359,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13092
13359
|
) })
|
|
13093
13360
|
}
|
|
13094
13361
|
),
|
|
13095
|
-
/* @__PURE__ */ (0,
|
|
13362
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13096
13363
|
AlertDialog,
|
|
13097
13364
|
{
|
|
13098
13365
|
isOpen: isModalOpen("alertDialog"),
|
|
@@ -13104,7 +13371,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13104
13371
|
onSubmit: handleAlertSubmit
|
|
13105
13372
|
}
|
|
13106
13373
|
),
|
|
13107
|
-
/* @__PURE__ */ (0,
|
|
13374
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13108
13375
|
Modal_default,
|
|
13109
13376
|
{
|
|
13110
13377
|
isOpen: isModalOpen("modalResult"),
|
|
@@ -13113,11 +13380,11 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13113
13380
|
closeOnEscape: false,
|
|
13114
13381
|
hideCloseButton: true,
|
|
13115
13382
|
size: "md",
|
|
13116
|
-
children: /* @__PURE__ */ (0,
|
|
13117
|
-
resultImageComponent ? /* @__PURE__ */ (0,
|
|
13118
|
-
/* @__PURE__ */ (0,
|
|
13119
|
-
/* @__PURE__ */ (0,
|
|
13120
|
-
/* @__PURE__ */ (0,
|
|
13383
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
13384
|
+
resultImageComponent ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
13385
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
13386
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: getCompletionTitle(quizType) }),
|
|
13387
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("p", { className: "text-text-500 font-sm", children: [
|
|
13121
13388
|
"Voc\xEA acertou ",
|
|
13122
13389
|
correctAnswers ?? "--",
|
|
13123
13390
|
" de ",
|
|
@@ -13126,8 +13393,8 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13126
13393
|
"quest\xF5es."
|
|
13127
13394
|
] })
|
|
13128
13395
|
] }),
|
|
13129
|
-
/* @__PURE__ */ (0,
|
|
13130
|
-
/* @__PURE__ */ (0,
|
|
13396
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
13397
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13131
13398
|
Button_default,
|
|
13132
13399
|
{
|
|
13133
13400
|
variant: "outline",
|
|
@@ -13137,38 +13404,38 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13137
13404
|
children: quizTypeLabel === "Question\xE1rio" ? "Ir para aulas" : `Ir para ${quizTypeLabel.toLocaleLowerCase()}s`
|
|
13138
13405
|
}
|
|
13139
13406
|
),
|
|
13140
|
-
/* @__PURE__ */ (0,
|
|
13407
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
13141
13408
|
] })
|
|
13142
13409
|
] })
|
|
13143
13410
|
}
|
|
13144
13411
|
),
|
|
13145
|
-
/* @__PURE__ */ (0,
|
|
13412
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13146
13413
|
Modal_default,
|
|
13147
13414
|
{
|
|
13148
13415
|
isOpen: isModalOpen("modalNavigate"),
|
|
13149
13416
|
onClose: closeModal,
|
|
13150
13417
|
title: "Quest\xF5es",
|
|
13151
13418
|
size: "lg",
|
|
13152
|
-
children: /* @__PURE__ */ (0,
|
|
13153
|
-
/* @__PURE__ */ (0,
|
|
13154
|
-
/* @__PURE__ */ (0,
|
|
13155
|
-
/* @__PURE__ */ (0,
|
|
13156
|
-
/* @__PURE__ */ (0,
|
|
13419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [
|
|
13420
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200 flex-shrink-0", children: [
|
|
13421
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
13422
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
13423
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13157
13424
|
SelectTrigger,
|
|
13158
13425
|
{
|
|
13159
13426
|
variant: "rounded",
|
|
13160
13427
|
className: "max-w-[266px] min-w-[160px]",
|
|
13161
|
-
children: /* @__PURE__ */ (0,
|
|
13428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" })
|
|
13162
13429
|
}
|
|
13163
13430
|
),
|
|
13164
|
-
/* @__PURE__ */ (0,
|
|
13165
|
-
/* @__PURE__ */ (0,
|
|
13166
|
-
/* @__PURE__ */ (0,
|
|
13167
|
-
/* @__PURE__ */ (0,
|
|
13431
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(SelectContent, { children: [
|
|
13432
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SelectItem, { value: "all", children: "Todas" }),
|
|
13433
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
13434
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SelectItem, { value: "answered", children: "Respondidas" })
|
|
13168
13435
|
] })
|
|
13169
13436
|
] }) })
|
|
13170
13437
|
] }),
|
|
13171
|
-
/* @__PURE__ */ (0,
|
|
13438
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13172
13439
|
QuizQuestionList,
|
|
13173
13440
|
{
|
|
13174
13441
|
filterType,
|
|
@@ -13178,7 +13445,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13178
13445
|
] })
|
|
13179
13446
|
}
|
|
13180
13447
|
),
|
|
13181
|
-
/* @__PURE__ */ (0,
|
|
13448
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13182
13449
|
Modal_default,
|
|
13183
13450
|
{
|
|
13184
13451
|
isOpen: isModalOpen("modalResolution"),
|
|
@@ -13188,7 +13455,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13188
13455
|
children: currentQuestion?.solutionExplanation
|
|
13189
13456
|
}
|
|
13190
13457
|
),
|
|
13191
|
-
/* @__PURE__ */ (0,
|
|
13458
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13192
13459
|
Modal_default,
|
|
13193
13460
|
{
|
|
13194
13461
|
isOpen: isModalOpen("modalQuestionnaireAllCorrect"),
|
|
@@ -13197,17 +13464,17 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13197
13464
|
closeOnEscape: false,
|
|
13198
13465
|
hideCloseButton: true,
|
|
13199
13466
|
size: "md",
|
|
13200
|
-
children: /* @__PURE__ */ (0,
|
|
13201
|
-
resultImageComponent ? /* @__PURE__ */ (0,
|
|
13202
|
-
/* @__PURE__ */ (0,
|
|
13203
|
-
/* @__PURE__ */ (0,
|
|
13204
|
-
/* @__PURE__ */ (0,
|
|
13467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
13468
|
+
resultImageComponent ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
13469
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
13470
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F389} Parab\xE9ns!" }),
|
|
13471
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-500 font-sm", children: "Voc\xEA concluiu o m\xF3dulo Movimento Uniforme." })
|
|
13205
13472
|
] }),
|
|
13206
|
-
/* @__PURE__ */ (0,
|
|
13473
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button_default, { className: "w-full", onClick: onGoToNextModule, children: "Pr\xF3ximo m\xF3dulo" }) })
|
|
13207
13474
|
] })
|
|
13208
13475
|
}
|
|
13209
13476
|
),
|
|
13210
|
-
/* @__PURE__ */ (0,
|
|
13477
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13211
13478
|
Modal_default,
|
|
13212
13479
|
{
|
|
13213
13480
|
isOpen: isModalOpen("modalQuestionnaireAllIncorrect"),
|
|
@@ -13216,16 +13483,16 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13216
13483
|
closeOnEscape: false,
|
|
13217
13484
|
hideCloseButton: true,
|
|
13218
13485
|
size: "md",
|
|
13219
|
-
children: /* @__PURE__ */ (0,
|
|
13220
|
-
resultIncorrectImageComponent ? /* @__PURE__ */ (0,
|
|
13221
|
-
/* @__PURE__ */ (0,
|
|
13222
|
-
/* @__PURE__ */ (0,
|
|
13223
|
-
/* @__PURE__ */ (0,
|
|
13224
|
-
/* @__PURE__ */ (0,
|
|
13225
|
-
/* @__PURE__ */ (0,
|
|
13486
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
13487
|
+
resultIncorrectImageComponent ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-[282px] h-auto", children: resultIncorrectImageComponent }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
13488
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
13489
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F615} N\xE3o foi dessa vez..." }),
|
|
13490
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-500 font-sm", children: "Voc\xEA tirou 0 no question\xE1rio, mas n\xE3o se preocupe! Isso \xE9 apenas uma oportunidade de aprendizado." }),
|
|
13491
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-500 font-sm", children: "Que tal tentar novamente para melhorar sua nota? Estamos aqui para te ajudar a entender o conte\xFAdo e evoluir." }),
|
|
13492
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text-500 font-sm", children: "Clique em Repetir Question\xE1rio e mostre do que voc\xEA \xE9 capaz! \u{1F4AA}" })
|
|
13226
13493
|
] }),
|
|
13227
|
-
/* @__PURE__ */ (0,
|
|
13228
|
-
/* @__PURE__ */ (0,
|
|
13494
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-row justify-center items-center gap-2 w-full", children: [
|
|
13495
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13229
13496
|
Button_default,
|
|
13230
13497
|
{
|
|
13231
13498
|
type: "button",
|
|
@@ -13239,7 +13506,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13239
13506
|
children: "Tentar depois"
|
|
13240
13507
|
}
|
|
13241
13508
|
),
|
|
13242
|
-
/* @__PURE__ */ (0,
|
|
13509
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13243
13510
|
Button_default,
|
|
13244
13511
|
{
|
|
13245
13512
|
variant: "outline",
|
|
@@ -13249,7 +13516,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13249
13516
|
children: "Detalhar resultado"
|
|
13250
13517
|
}
|
|
13251
13518
|
),
|
|
13252
|
-
/* @__PURE__ */ (0,
|
|
13519
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13253
13520
|
Button_default,
|
|
13254
13521
|
{
|
|
13255
13522
|
className: "w-auto",
|
|
@@ -13262,7 +13529,7 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13262
13529
|
] })
|
|
13263
13530
|
}
|
|
13264
13531
|
),
|
|
13265
|
-
/* @__PURE__ */ (0,
|
|
13532
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13266
13533
|
AlertDialog,
|
|
13267
13534
|
{
|
|
13268
13535
|
isOpen: isModalOpen("alertDialogTryLater"),
|
|
@@ -13286,37 +13553,37 @@ var QuizFooter = (0, import_react39.forwardRef)(
|
|
|
13286
13553
|
);
|
|
13287
13554
|
|
|
13288
13555
|
// src/components/Quiz/QuizResult.tsx
|
|
13289
|
-
var
|
|
13556
|
+
var import_react41 = require("react");
|
|
13290
13557
|
var import_phosphor_react29 = require("phosphor-react");
|
|
13291
|
-
var
|
|
13558
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13292
13559
|
var QuizBadge = ({
|
|
13293
13560
|
subtype
|
|
13294
13561
|
}) => {
|
|
13295
13562
|
switch (subtype) {
|
|
13296
13563
|
case "PROVA" /* PROVA */:
|
|
13297
|
-
return /* @__PURE__ */ (0,
|
|
13564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Badge_default, { variant: "examsOutlined", action: "exam2", "data-testid": "quiz-badge", children: "Prova" });
|
|
13298
13565
|
case "ENEM_PROVA_1" /* ENEM_PROVA_1 */:
|
|
13299
13566
|
case "ENEM_PROVA_2" /* ENEM_PROVA_2 */:
|
|
13300
|
-
return /* @__PURE__ */ (0,
|
|
13567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Badge_default, { variant: "examsOutlined", action: "exam1", "data-testid": "quiz-badge", children: "Enem" });
|
|
13301
13568
|
case "VESTIBULAR" /* VESTIBULAR */:
|
|
13302
|
-
return /* @__PURE__ */ (0,
|
|
13569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Badge_default, { variant: "examsOutlined", action: "exam4", "data-testid": "quiz-badge", children: "Vestibular" });
|
|
13303
13570
|
case "SIMULADO" /* SIMULADO */:
|
|
13304
13571
|
case "SIMULADAO" /* SIMULADAO */:
|
|
13305
13572
|
case void 0:
|
|
13306
|
-
return /* @__PURE__ */ (0,
|
|
13573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Badge_default, { variant: "examsOutlined", action: "exam3", "data-testid": "quiz-badge", children: "Simulad\xE3o" });
|
|
13307
13574
|
default:
|
|
13308
|
-
return /* @__PURE__ */ (0,
|
|
13575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Badge_default, { variant: "solid", action: "info", "data-testid": "quiz-badge", children: subtype });
|
|
13309
13576
|
}
|
|
13310
13577
|
};
|
|
13311
|
-
var QuizHeaderResult = (0,
|
|
13578
|
+
var QuizHeaderResult = (0, import_react41.forwardRef)(
|
|
13312
13579
|
({ className, ...props }, ref) => {
|
|
13313
13580
|
const {
|
|
13314
13581
|
getQuestionResultByQuestionId,
|
|
13315
13582
|
getCurrentQuestion,
|
|
13316
13583
|
questionsResult
|
|
13317
13584
|
} = useQuizStore();
|
|
13318
|
-
const [status, setStatus] = (0,
|
|
13319
|
-
(0,
|
|
13585
|
+
const [status, setStatus] = (0, import_react41.useState)(void 0);
|
|
13586
|
+
(0, import_react41.useEffect)(() => {
|
|
13320
13587
|
const cq = getCurrentQuestion();
|
|
13321
13588
|
if (!cq) {
|
|
13322
13589
|
setStatus(void 0);
|
|
@@ -13362,7 +13629,7 @@ var QuizHeaderResult = (0, import_react40.forwardRef)(
|
|
|
13362
13629
|
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
13363
13630
|
}
|
|
13364
13631
|
};
|
|
13365
|
-
return /* @__PURE__ */ (0,
|
|
13632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13366
13633
|
"div",
|
|
13367
13634
|
{
|
|
13368
13635
|
ref,
|
|
@@ -13373,16 +13640,16 @@ var QuizHeaderResult = (0, import_react40.forwardRef)(
|
|
|
13373
13640
|
),
|
|
13374
13641
|
...props,
|
|
13375
13642
|
children: [
|
|
13376
|
-
/* @__PURE__ */ (0,
|
|
13377
|
-
/* @__PURE__ */ (0,
|
|
13643
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
13644
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-text-700 text-md", children: getLabelByAnswersStatus() })
|
|
13378
13645
|
]
|
|
13379
13646
|
}
|
|
13380
13647
|
);
|
|
13381
13648
|
}
|
|
13382
13649
|
);
|
|
13383
|
-
var QuizResultHeaderTitle = (0,
|
|
13650
|
+
var QuizResultHeaderTitle = (0, import_react41.forwardRef)(({ className, showBadge = true, onRepeat, canRetry, ...props }, ref) => {
|
|
13384
13651
|
const { quiz } = useQuizStore();
|
|
13385
|
-
return /* @__PURE__ */ (0,
|
|
13652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13386
13653
|
"div",
|
|
13387
13654
|
{
|
|
13388
13655
|
ref,
|
|
@@ -13392,9 +13659,9 @@ var QuizResultHeaderTitle = (0, import_react40.forwardRef)(({ className, showBad
|
|
|
13392
13659
|
),
|
|
13393
13660
|
...props,
|
|
13394
13661
|
children: [
|
|
13395
|
-
/* @__PURE__ */ (0,
|
|
13396
|
-
/* @__PURE__ */ (0,
|
|
13397
|
-
canRetry && onRepeat && /* @__PURE__ */ (0,
|
|
13662
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
13663
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex flex-row gap-3 items-center", children: [
|
|
13664
|
+
canRetry && onRepeat && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13398
13665
|
Button_default,
|
|
13399
13666
|
{
|
|
13400
13667
|
variant: "solid",
|
|
@@ -13404,16 +13671,16 @@ var QuizResultHeaderTitle = (0, import_react40.forwardRef)(({ className, showBad
|
|
|
13404
13671
|
children: "Repetir question\xE1rio"
|
|
13405
13672
|
}
|
|
13406
13673
|
),
|
|
13407
|
-
showBadge && /* @__PURE__ */ (0,
|
|
13674
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(QuizBadge, { subtype: quiz?.subtype || void 0 })
|
|
13408
13675
|
] })
|
|
13409
13676
|
]
|
|
13410
13677
|
}
|
|
13411
13678
|
);
|
|
13412
13679
|
});
|
|
13413
|
-
var QuizResultTitle = (0,
|
|
13680
|
+
var QuizResultTitle = (0, import_react41.forwardRef)(({ className, ...props }, ref) => {
|
|
13414
13681
|
const { getQuizTitle } = useQuizStore();
|
|
13415
13682
|
const quizTitle = getQuizTitle();
|
|
13416
|
-
return /* @__PURE__ */ (0,
|
|
13683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13417
13684
|
"p",
|
|
13418
13685
|
{
|
|
13419
13686
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -13454,7 +13721,7 @@ var calculateAnswerStatistics = (answers) => {
|
|
|
13454
13721
|
}
|
|
13455
13722
|
return stats;
|
|
13456
13723
|
};
|
|
13457
|
-
var QuizResultPerformance = (0,
|
|
13724
|
+
var QuizResultPerformance = (0, import_react41.forwardRef)(({ showDetails = true, ...props }, ref) => {
|
|
13458
13725
|
const {
|
|
13459
13726
|
getTotalQuestions,
|
|
13460
13727
|
formatTime: formatTime2,
|
|
@@ -13474,7 +13741,7 @@ var QuizResultPerformance = (0, import_react40.forwardRef)(({ showDetails = true
|
|
|
13474
13741
|
};
|
|
13475
13742
|
const percentage = totalQuestions > 0 ? Math.round(stats.correctAnswers / totalQuestions * 100) : 0;
|
|
13476
13743
|
const classesJustifyBetween = showDetails ? "justify-between" : "justify-center";
|
|
13477
|
-
return /* @__PURE__ */ (0,
|
|
13744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13478
13745
|
"div",
|
|
13479
13746
|
{
|
|
13480
13747
|
className: cn(
|
|
@@ -13484,8 +13751,8 @@ var QuizResultPerformance = (0, import_react40.forwardRef)(({ showDetails = true
|
|
|
13484
13751
|
ref,
|
|
13485
13752
|
...props,
|
|
13486
13753
|
children: [
|
|
13487
|
-
/* @__PURE__ */ (0,
|
|
13488
|
-
/* @__PURE__ */ (0,
|
|
13754
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "relative", children: [
|
|
13755
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13489
13756
|
ProgressCircle_default,
|
|
13490
13757
|
{
|
|
13491
13758
|
size: "medium",
|
|
@@ -13495,24 +13762,24 @@ var QuizResultPerformance = (0, import_react40.forwardRef)(({ showDetails = true
|
|
|
13495
13762
|
label: ""
|
|
13496
13763
|
}
|
|
13497
13764
|
),
|
|
13498
|
-
/* @__PURE__ */ (0,
|
|
13499
|
-
showDetails && /* @__PURE__ */ (0,
|
|
13500
|
-
/* @__PURE__ */ (0,
|
|
13501
|
-
/* @__PURE__ */ (0,
|
|
13765
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
13766
|
+
showDetails && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
13767
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_phosphor_react29.Clock, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
13768
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(
|
|
13502
13769
|
(getQuestionResultStatistics()?.timeSpent ?? 0) * 60
|
|
13503
13770
|
) })
|
|
13504
13771
|
] }),
|
|
13505
|
-
/* @__PURE__ */ (0,
|
|
13772
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
13506
13773
|
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
13507
13774
|
" de",
|
|
13508
13775
|
" ",
|
|
13509
13776
|
totalQuestions
|
|
13510
13777
|
] }),
|
|
13511
|
-
/* @__PURE__ */ (0,
|
|
13778
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
13512
13779
|
] })
|
|
13513
13780
|
] }),
|
|
13514
|
-
showDetails && /* @__PURE__ */ (0,
|
|
13515
|
-
/* @__PURE__ */ (0,
|
|
13781
|
+
showDetails && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
13782
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13516
13783
|
ProgressBar_default,
|
|
13517
13784
|
{
|
|
13518
13785
|
className: "w-full",
|
|
@@ -13526,7 +13793,7 @@ var QuizResultPerformance = (0, import_react40.forwardRef)(({ showDetails = true
|
|
|
13526
13793
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
13527
13794
|
}
|
|
13528
13795
|
),
|
|
13529
|
-
/* @__PURE__ */ (0,
|
|
13796
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13530
13797
|
ProgressBar_default,
|
|
13531
13798
|
{
|
|
13532
13799
|
className: "w-full",
|
|
@@ -13540,7 +13807,7 @@ var QuizResultPerformance = (0, import_react40.forwardRef)(({ showDetails = true
|
|
|
13540
13807
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
13541
13808
|
}
|
|
13542
13809
|
),
|
|
13543
|
-
/* @__PURE__ */ (0,
|
|
13810
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13544
13811
|
ProgressBar_default,
|
|
13545
13812
|
{
|
|
13546
13813
|
className: "w-full",
|
|
@@ -13559,7 +13826,7 @@ var QuizResultPerformance = (0, import_react40.forwardRef)(({ showDetails = true
|
|
|
13559
13826
|
}
|
|
13560
13827
|
);
|
|
13561
13828
|
});
|
|
13562
|
-
var QuizListResult = (0,
|
|
13829
|
+
var QuizListResult = (0, import_react41.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
13563
13830
|
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
13564
13831
|
const { isDark } = useTheme();
|
|
13565
13832
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
@@ -13587,9 +13854,9 @@ var QuizListResult = (0, import_react40.forwardRef)(({ className, onSubjectClick
|
|
|
13587
13854
|
};
|
|
13588
13855
|
}
|
|
13589
13856
|
);
|
|
13590
|
-
return /* @__PURE__ */ (0,
|
|
13591
|
-
/* @__PURE__ */ (0,
|
|
13592
|
-
/* @__PURE__ */ (0,
|
|
13857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { ref, className, ...props, children: [
|
|
13858
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
13859
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13593
13860
|
CardResults,
|
|
13594
13861
|
{
|
|
13595
13862
|
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
@@ -13613,16 +13880,16 @@ var QuizListResultByMateria = ({
|
|
|
13613
13880
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
13614
13881
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
13615
13882
|
const formattedQuestions = subject == "all" ? Object.values(groupedQuestions).flat() : answeredQuestions;
|
|
13616
|
-
return /* @__PURE__ */ (0,
|
|
13617
|
-
/* @__PURE__ */ (0,
|
|
13618
|
-
/* @__PURE__ */ (0,
|
|
13619
|
-
/* @__PURE__ */ (0,
|
|
13620
|
-
/* @__PURE__ */ (0,
|
|
13883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex flex-col", children: [
|
|
13884
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: subjectName || formattedQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name || "Sem mat\xE9ria" }) }),
|
|
13885
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { className: "flex flex-col ", children: [
|
|
13886
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
13887
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: formattedQuestions.map((question) => {
|
|
13621
13888
|
const questionIndex = getQuestionIndex(
|
|
13622
13889
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13623
13890
|
question.questionId ?? question.id
|
|
13624
13891
|
);
|
|
13625
|
-
return /* @__PURE__ */ (0,
|
|
13892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13626
13893
|
CardStatus,
|
|
13627
13894
|
{
|
|
13628
13895
|
className: "max-w-full",
|
|
@@ -13648,7 +13915,7 @@ var QuizListResultByMateria = ({
|
|
|
13648
13915
|
|
|
13649
13916
|
// src/components/BreadcrumbMenu/BreadcrumbMenu.tsx
|
|
13650
13917
|
var import_react_router_dom3 = require("react-router-dom");
|
|
13651
|
-
var
|
|
13918
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13652
13919
|
var BreadcrumbMenu = ({
|
|
13653
13920
|
breadcrumbs,
|
|
13654
13921
|
onBreadcrumbClick,
|
|
@@ -13661,17 +13928,17 @@ var BreadcrumbMenu = ({
|
|
|
13661
13928
|
}
|
|
13662
13929
|
navigate(breadcrumb.url);
|
|
13663
13930
|
};
|
|
13664
|
-
return /* @__PURE__ */ (0,
|
|
13931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13665
13932
|
Menu,
|
|
13666
13933
|
{
|
|
13667
13934
|
value: `breadcrumb-${breadcrumbs.length - 1}`,
|
|
13668
13935
|
defaultValue: "breadcrumb-0",
|
|
13669
13936
|
variant: "breadcrumb",
|
|
13670
13937
|
className,
|
|
13671
|
-
children: /* @__PURE__ */ (0,
|
|
13938
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(MenuContent, { className: "w-full flex flex-row flex-wrap gap-2 !px-0", children: breadcrumbs.map((breadcrumb, index) => {
|
|
13672
13939
|
const isLast = index === breadcrumbs.length - 1;
|
|
13673
13940
|
const hasSeparator = !isLast;
|
|
13674
|
-
return /* @__PURE__ */ (0,
|
|
13941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13675
13942
|
MenuItem,
|
|
13676
13943
|
{
|
|
13677
13944
|
variant: "breadcrumb",
|
|
@@ -13689,7 +13956,7 @@ var BreadcrumbMenu = ({
|
|
|
13689
13956
|
};
|
|
13690
13957
|
|
|
13691
13958
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
13692
|
-
var
|
|
13959
|
+
var import_react42 = require("react");
|
|
13693
13960
|
|
|
13694
13961
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
13695
13962
|
var import_zustand11 = require("zustand");
|
|
@@ -13818,7 +14085,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
13818
14085
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
13819
14086
|
);
|
|
13820
14087
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
13821
|
-
(0,
|
|
14088
|
+
(0, import_react42.useEffect)(() => {
|
|
13822
14089
|
const newBreadcrumbs = [root];
|
|
13823
14090
|
const previousIds = [];
|
|
13824
14091
|
for (const level of levels) {
|
|
@@ -13850,11 +14117,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
13850
14117
|
};
|
|
13851
14118
|
|
|
13852
14119
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
13853
|
-
var
|
|
14120
|
+
var import_react43 = require("react");
|
|
13854
14121
|
var import_react_router_dom4 = require("react-router-dom");
|
|
13855
14122
|
var useUrlParams = (config) => {
|
|
13856
14123
|
const location = (0, import_react_router_dom4.useLocation)();
|
|
13857
|
-
return (0,
|
|
14124
|
+
return (0, import_react43.useMemo)(() => {
|
|
13858
14125
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
13859
14126
|
const params = {};
|
|
13860
14127
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -13865,15 +14132,15 @@ var useUrlParams = (config) => {
|
|
|
13865
14132
|
};
|
|
13866
14133
|
|
|
13867
14134
|
// src/hooks/useAppInitialization.ts
|
|
13868
|
-
var
|
|
14135
|
+
var import_react45 = require("react");
|
|
13869
14136
|
|
|
13870
14137
|
// src/hooks/useInstitution.ts
|
|
13871
|
-
var
|
|
14138
|
+
var import_react44 = require("react");
|
|
13872
14139
|
function useInstitutionId() {
|
|
13873
|
-
const [institutionId, setInstitutionId] = (0,
|
|
14140
|
+
const [institutionId, setInstitutionId] = (0, import_react44.useState)(() => {
|
|
13874
14141
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
13875
14142
|
});
|
|
13876
|
-
(0,
|
|
14143
|
+
(0, import_react44.useEffect)(() => {
|
|
13877
14144
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
13878
14145
|
if (!metaTag) return;
|
|
13879
14146
|
const observer = new MutationObserver(() => {
|
|
@@ -14040,7 +14307,7 @@ var useAuthStore = (0, import_zustand13.create)()(
|
|
|
14040
14307
|
function useAppInitialization() {
|
|
14041
14308
|
const getInstitutionId = useInstitutionId();
|
|
14042
14309
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
14043
|
-
const authFunctions = (0,
|
|
14310
|
+
const authFunctions = (0, import_react45.useMemo)(
|
|
14044
14311
|
() => ({
|
|
14045
14312
|
checkAuth: async () => {
|
|
14046
14313
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -14077,7 +14344,7 @@ function useAppInitialization() {
|
|
|
14077
14344
|
}
|
|
14078
14345
|
|
|
14079
14346
|
// src/hooks/useAppContent.ts
|
|
14080
|
-
var
|
|
14347
|
+
var import_react46 = require("react");
|
|
14081
14348
|
var import_react_router_dom5 = require("react-router-dom");
|
|
14082
14349
|
function useAppContent(config) {
|
|
14083
14350
|
const navigate = (0, import_react_router_dom5.useNavigate)();
|
|
@@ -14103,20 +14370,20 @@ function useAppContent(config) {
|
|
|
14103
14370
|
navigate("/painel");
|
|
14104
14371
|
}
|
|
14105
14372
|
};
|
|
14106
|
-
const handleSetSelectedProfile = (0,
|
|
14373
|
+
const handleSetSelectedProfile = (0, import_react46.useCallback)(
|
|
14107
14374
|
(profile) => {
|
|
14108
14375
|
setSelectedProfile(profile);
|
|
14109
14376
|
},
|
|
14110
14377
|
[setSelectedProfile]
|
|
14111
14378
|
);
|
|
14112
|
-
const handleClearParamsFromURL = (0,
|
|
14379
|
+
const handleClearParamsFromURL = (0, import_react46.useCallback)(() => {
|
|
14113
14380
|
if (onClearParamsFromURL) {
|
|
14114
14381
|
onClearParamsFromURL();
|
|
14115
14382
|
} else {
|
|
14116
14383
|
globalThis.location.replace("/painel");
|
|
14117
14384
|
}
|
|
14118
14385
|
}, [onClearParamsFromURL]);
|
|
14119
|
-
const handleError = (0,
|
|
14386
|
+
const handleError = (0, import_react46.useCallback)(
|
|
14120
14387
|
(error) => {
|
|
14121
14388
|
if (onError) {
|
|
14122
14389
|
onError(error);
|
|
@@ -14127,7 +14394,7 @@ function useAppContent(config) {
|
|
|
14127
14394
|
},
|
|
14128
14395
|
[navigate, onError]
|
|
14129
14396
|
);
|
|
14130
|
-
const urlAuthConfig = (0,
|
|
14397
|
+
const urlAuthConfig = (0, import_react46.useMemo)(
|
|
14131
14398
|
() => ({
|
|
14132
14399
|
setTokens,
|
|
14133
14400
|
setSessionInfo,
|
|
@@ -14153,10 +14420,10 @@ function useAppContent(config) {
|
|
|
14153
14420
|
);
|
|
14154
14421
|
useUrlAuthentication(urlAuthConfig);
|
|
14155
14422
|
const { sessionInfo } = useAuth();
|
|
14156
|
-
const institutionIdToUse = (0,
|
|
14423
|
+
const institutionIdToUse = (0, import_react46.useMemo)(() => {
|
|
14157
14424
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
14158
14425
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
14159
|
-
(0,
|
|
14426
|
+
(0, import_react46.useEffect)(() => {
|
|
14160
14427
|
if (institutionIdToUse && !initialized) {
|
|
14161
14428
|
initialize(institutionIdToUse);
|
|
14162
14429
|
}
|
|
@@ -14203,6 +14470,7 @@ function useAppContent(config) {
|
|
|
14203
14470
|
DropdownMenuItem,
|
|
14204
14471
|
DropdownMenuSeparator,
|
|
14205
14472
|
DropdownMenuTrigger,
|
|
14473
|
+
FilterModal,
|
|
14206
14474
|
IconButton,
|
|
14207
14475
|
IconRender,
|
|
14208
14476
|
IconRoundedButton,
|
|
@@ -14319,6 +14587,7 @@ function useAppContent(config) {
|
|
|
14319
14587
|
useMobile,
|
|
14320
14588
|
useQuizStore,
|
|
14321
14589
|
useRouteAuth,
|
|
14590
|
+
useTableFilter,
|
|
14322
14591
|
useTableSort,
|
|
14323
14592
|
useTheme,
|
|
14324
14593
|
useThemeStore,
|