analytica-frontend-lib 1.2.18 → 1.2.21
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/AlertManager/index.css +10 -0
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/AlertManager/index.d.mts +2 -1
- package/dist/AlertManager/index.d.ts +2 -1
- package/dist/AlertManager/index.js +49 -5
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +49 -5
- package/dist/AlertManager/index.mjs.map +1 -1
- package/dist/AlertManagerView/index.d.mts +2 -1
- package/dist/AlertManagerView/index.d.ts +2 -1
- package/dist/CheckBoxGroup-9n5C0OH4.d.mts +24 -0
- package/dist/CheckBoxGroup-9n5C0OH4.d.ts +24 -0
- package/dist/DropdownMenu/index.d.mts +7 -1
- package/dist/DropdownMenu/index.d.ts +7 -1
- package/dist/DropdownMenu/index.js +51 -5
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +50 -5
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +49 -5
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +49 -5
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/Radio/index.d.mts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Search/index.js +49 -5
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +49 -5
- package/dist/Search/index.mjs.map +1 -1
- package/dist/TableProvider/index.css +19143 -0
- package/dist/TableProvider/index.css.map +1 -0
- package/dist/TableProvider/index.d.mts +4 -0
- package/dist/TableProvider/index.d.ts +4 -0
- package/dist/TableProvider/index.js +5365 -0
- package/dist/TableProvider/index.js.map +1 -0
- package/dist/TableProvider/index.mjs +5387 -0
- package/dist/TableProvider/index.mjs.map +1 -0
- package/dist/TableProvider-CDcL1tDj.d.mts +192 -0
- package/dist/TableProvider-D4Ak7ofz.d.ts +192 -0
- package/dist/index.css +10 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +7 -44
- package/dist/index.d.ts +7 -44
- package/dist/index.js +1120 -785
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1038 -705
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +10 -0
- package/dist/styles.css.map +1 -1
- package/dist/{types-BXzeefgf.d.mts → types-DqZRjqxh.d.ts} +2 -23
- package/dist/{types-BXzeefgf.d.ts → types-pd3QVhSu.d.mts} +2 -23
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -87,6 +87,7 @@ __export(src_exports, {
|
|
|
87
87
|
NotificationEntityType: () => NotificationEntityType,
|
|
88
88
|
ProfileMenuFooter: () => ProfileMenuFooter,
|
|
89
89
|
ProfileMenuHeader: () => ProfileMenuHeader,
|
|
90
|
+
ProfileMenuInfo: () => ProfileMenuInfo,
|
|
90
91
|
ProfileMenuSection: () => ProfileMenuSection,
|
|
91
92
|
ProfileMenuTrigger: () => ProfileMenuTrigger,
|
|
92
93
|
ProfileToggleTheme: () => ProfileToggleTheme,
|
|
@@ -147,6 +148,7 @@ __export(src_exports, {
|
|
|
147
148
|
TableHead: () => TableHead,
|
|
148
149
|
TableHeader: () => TableHeader,
|
|
149
150
|
TablePagination: () => TablePagination_default,
|
|
151
|
+
TableProvider: () => TableProvider_default,
|
|
150
152
|
TableRow: () => TableRow,
|
|
151
153
|
Text: () => Text_default,
|
|
152
154
|
TextArea: () => TextArea_default,
|
|
@@ -4632,10 +4634,13 @@ var ProfileMenuHeader = (0, import_react19.forwardRef)(({ className, name, email
|
|
|
4632
4634
|
{
|
|
4633
4635
|
ref,
|
|
4634
4636
|
"data-component": "ProfileMenuHeader",
|
|
4635
|
-
className: cn(
|
|
4637
|
+
className: cn(
|
|
4638
|
+
"flex flex-row gap-4 items-center min-w-[280px]",
|
|
4639
|
+
className
|
|
4640
|
+
),
|
|
4636
4641
|
...props,
|
|
4637
4642
|
children: [
|
|
4638
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden", children: photoUrl ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4643
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0", children: photoUrl ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4639
4644
|
"img",
|
|
4640
4645
|
{
|
|
4641
4646
|
src: photoUrl,
|
|
@@ -4643,15 +4648,56 @@ var ProfileMenuHeader = (0, import_react19.forwardRef)(({ className, name, email
|
|
|
4643
4648
|
className: "w-full h-full object-cover"
|
|
4644
4649
|
}
|
|
4645
4650
|
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_phosphor_react15.User, { size: 34, className: "text-primary-800" }) }),
|
|
4646
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col ", children: [
|
|
4647
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4648
|
-
|
|
4651
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col min-w-0", children: [
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4653
|
+
Text_default,
|
|
4654
|
+
{
|
|
4655
|
+
size: "xl",
|
|
4656
|
+
weight: "bold",
|
|
4657
|
+
color: "text-text-950",
|
|
4658
|
+
className: "truncate",
|
|
4659
|
+
children: name
|
|
4660
|
+
}
|
|
4661
|
+
),
|
|
4662
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", className: "truncate", children: email })
|
|
4649
4663
|
] })
|
|
4650
4664
|
]
|
|
4651
4665
|
}
|
|
4652
4666
|
);
|
|
4653
4667
|
});
|
|
4654
4668
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
4669
|
+
var ProfileMenuInfo = (0, import_react19.forwardRef)(
|
|
4670
|
+
({
|
|
4671
|
+
className,
|
|
4672
|
+
schoolName,
|
|
4673
|
+
classYearName,
|
|
4674
|
+
schoolYearName,
|
|
4675
|
+
store: _store,
|
|
4676
|
+
...props
|
|
4677
|
+
}, ref) => {
|
|
4678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4679
|
+
"div",
|
|
4680
|
+
{
|
|
4681
|
+
ref,
|
|
4682
|
+
"data-component": "ProfileMenuInfo",
|
|
4683
|
+
className: cn("flex flex-row gap-4 items-center", className),
|
|
4684
|
+
...props,
|
|
4685
|
+
children: [
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "w-16 h-16" }),
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col ", children: [
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolName }),
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "flex flex-row items-center gap-2", children: [
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", children: classYearName }),
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-text-600 text-xs align-middle", children: "\u25CF" }),
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolYearName })
|
|
4693
|
+
] })
|
|
4694
|
+
] })
|
|
4695
|
+
]
|
|
4696
|
+
}
|
|
4697
|
+
);
|
|
4698
|
+
}
|
|
4699
|
+
);
|
|
4700
|
+
ProfileMenuInfo.displayName = "ProfileMenuInfo";
|
|
4655
4701
|
var ProfileToggleTheme = ({
|
|
4656
4702
|
store: externalStore,
|
|
4657
4703
|
...props
|
|
@@ -8295,11 +8341,298 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8295
8341
|
};
|
|
8296
8342
|
};
|
|
8297
8343
|
|
|
8298
|
-
// src/components/
|
|
8299
|
-
var import_zustand8 = require("zustand");
|
|
8344
|
+
// src/components/TableProvider/TableProvider.tsx
|
|
8300
8345
|
var import_react29 = require("react");
|
|
8301
8346
|
var import_phosphor_react21 = require("phosphor-react");
|
|
8302
8347
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
8348
|
+
function TableProvider({
|
|
8349
|
+
data,
|
|
8350
|
+
headers,
|
|
8351
|
+
loading = false,
|
|
8352
|
+
variant = "default",
|
|
8353
|
+
enableSearch = false,
|
|
8354
|
+
enableFilters = false,
|
|
8355
|
+
enableTableSort = false,
|
|
8356
|
+
enablePagination = false,
|
|
8357
|
+
enableRowClick = false,
|
|
8358
|
+
initialFilters = [],
|
|
8359
|
+
paginationConfig = {},
|
|
8360
|
+
searchPlaceholder = "Buscar...",
|
|
8361
|
+
noSearchResultImage,
|
|
8362
|
+
rowKey,
|
|
8363
|
+
onParamsChange,
|
|
8364
|
+
onRowClick,
|
|
8365
|
+
children
|
|
8366
|
+
}) {
|
|
8367
|
+
const [searchQuery, setSearchQuery] = (0, import_react29.useState)("");
|
|
8368
|
+
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
8369
|
+
const sortResult = enableTableSort ? sortResultRaw : {
|
|
8370
|
+
sortedData: data,
|
|
8371
|
+
sortColumn: null,
|
|
8372
|
+
sortDirection: null,
|
|
8373
|
+
handleSort: () => {
|
|
8374
|
+
}
|
|
8375
|
+
};
|
|
8376
|
+
const { sortedData, sortColumn, sortDirection, handleSort } = sortResult;
|
|
8377
|
+
const filterResultRaw = useTableFilter(initialFilters, { syncWithUrl: true });
|
|
8378
|
+
const disabledFilterResult = (0, import_react29.useMemo)(
|
|
8379
|
+
() => ({
|
|
8380
|
+
filterConfigs: [],
|
|
8381
|
+
activeFilters: {},
|
|
8382
|
+
hasActiveFilters: false,
|
|
8383
|
+
updateFilters: () => {
|
|
8384
|
+
},
|
|
8385
|
+
applyFilters: () => {
|
|
8386
|
+
},
|
|
8387
|
+
clearFilters: () => {
|
|
8388
|
+
}
|
|
8389
|
+
}),
|
|
8390
|
+
[]
|
|
8391
|
+
);
|
|
8392
|
+
const filterResult = enableFilters ? filterResultRaw : disabledFilterResult;
|
|
8393
|
+
const {
|
|
8394
|
+
filterConfigs,
|
|
8395
|
+
activeFilters,
|
|
8396
|
+
hasActiveFilters,
|
|
8397
|
+
updateFilters,
|
|
8398
|
+
applyFilters,
|
|
8399
|
+
clearFilters
|
|
8400
|
+
} = filterResult;
|
|
8401
|
+
const {
|
|
8402
|
+
defaultItemsPerPage = 10,
|
|
8403
|
+
itemsPerPageOptions = [10, 20, 50, 100],
|
|
8404
|
+
itemLabel = "itens",
|
|
8405
|
+
totalItems,
|
|
8406
|
+
totalPages
|
|
8407
|
+
} = paginationConfig;
|
|
8408
|
+
const [currentPage, setCurrentPage] = (0, import_react29.useState)(1);
|
|
8409
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react29.useState)(defaultItemsPerPage);
|
|
8410
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = (0, import_react29.useState)(false);
|
|
8411
|
+
const combinedParams = (0, import_react29.useMemo)(() => {
|
|
8412
|
+
const params = {
|
|
8413
|
+
page: currentPage,
|
|
8414
|
+
limit: itemsPerPage
|
|
8415
|
+
};
|
|
8416
|
+
if (enableSearch && searchQuery) {
|
|
8417
|
+
params.search = searchQuery;
|
|
8418
|
+
}
|
|
8419
|
+
if (enableFilters) {
|
|
8420
|
+
Object.assign(params, activeFilters);
|
|
8421
|
+
}
|
|
8422
|
+
if (enableTableSort && sortColumn && sortDirection) {
|
|
8423
|
+
params.sortBy = sortColumn;
|
|
8424
|
+
params.sortOrder = sortDirection;
|
|
8425
|
+
}
|
|
8426
|
+
return params;
|
|
8427
|
+
}, [
|
|
8428
|
+
currentPage,
|
|
8429
|
+
itemsPerPage,
|
|
8430
|
+
searchQuery,
|
|
8431
|
+
activeFilters,
|
|
8432
|
+
sortColumn,
|
|
8433
|
+
sortDirection,
|
|
8434
|
+
enableSearch,
|
|
8435
|
+
enableFilters,
|
|
8436
|
+
enableTableSort
|
|
8437
|
+
]);
|
|
8438
|
+
(0, import_react29.useEffect)(() => {
|
|
8439
|
+
onParamsChange?.(combinedParams);
|
|
8440
|
+
}, [combinedParams]);
|
|
8441
|
+
const handleSearchChange = (0, import_react29.useCallback)((value) => {
|
|
8442
|
+
setSearchQuery(value);
|
|
8443
|
+
setCurrentPage(1);
|
|
8444
|
+
}, []);
|
|
8445
|
+
const handleFilterApply = (0, import_react29.useCallback)(() => {
|
|
8446
|
+
applyFilters();
|
|
8447
|
+
setIsFilterModalOpen(false);
|
|
8448
|
+
setCurrentPage(1);
|
|
8449
|
+
}, [applyFilters]);
|
|
8450
|
+
const handlePageChange = (0, import_react29.useCallback)((page) => {
|
|
8451
|
+
setCurrentPage(page);
|
|
8452
|
+
}, []);
|
|
8453
|
+
const handleItemsPerPageChange = (0, import_react29.useCallback)((items) => {
|
|
8454
|
+
setItemsPerPage(items);
|
|
8455
|
+
setCurrentPage(1);
|
|
8456
|
+
}, []);
|
|
8457
|
+
const handleRowClickInternal = (0, import_react29.useCallback)(
|
|
8458
|
+
(row, index) => {
|
|
8459
|
+
if (enableRowClick && onRowClick) {
|
|
8460
|
+
onRowClick(row, index);
|
|
8461
|
+
}
|
|
8462
|
+
},
|
|
8463
|
+
[enableRowClick, onRowClick]
|
|
8464
|
+
);
|
|
8465
|
+
const useInternalPagination = (0, import_react29.useMemo)(
|
|
8466
|
+
() => enablePagination && !onParamsChange && totalItems === void 0 && totalPages === void 0,
|
|
8467
|
+
[enablePagination, onParamsChange, totalItems, totalPages]
|
|
8468
|
+
);
|
|
8469
|
+
const calculatedTotalPages = totalPages ?? Math.ceil(
|
|
8470
|
+
(totalItems ?? (useInternalPagination ? sortedData.length : data.length)) / itemsPerPage
|
|
8471
|
+
);
|
|
8472
|
+
const calculatedTotalItems = totalItems ?? (useInternalPagination ? sortedData.length : data.length);
|
|
8473
|
+
const displayData = (0, import_react29.useMemo)(() => {
|
|
8474
|
+
if (!useInternalPagination) {
|
|
8475
|
+
return sortedData;
|
|
8476
|
+
}
|
|
8477
|
+
const start = (currentPage - 1) * itemsPerPage;
|
|
8478
|
+
return sortedData.slice(start, start + itemsPerPage);
|
|
8479
|
+
}, [useInternalPagination, sortedData, currentPage, itemsPerPage]);
|
|
8480
|
+
const isEmpty = sortedData.length === 0;
|
|
8481
|
+
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
8482
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8483
|
+
Button_default,
|
|
8484
|
+
{
|
|
8485
|
+
variant: "outline",
|
|
8486
|
+
size: "medium",
|
|
8487
|
+
onClick: () => setIsFilterModalOpen(true),
|
|
8488
|
+
children: [
|
|
8489
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_phosphor_react21.Funnel, { size: 20 }),
|
|
8490
|
+
"Filtros",
|
|
8491
|
+
hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
|
|
8492
|
+
]
|
|
8493
|
+
}
|
|
8494
|
+
),
|
|
8495
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8496
|
+
Search_default,
|
|
8497
|
+
{
|
|
8498
|
+
value: searchQuery,
|
|
8499
|
+
onSearch: handleSearchChange,
|
|
8500
|
+
onClear: () => handleSearchChange(""),
|
|
8501
|
+
options: [],
|
|
8502
|
+
placeholder: searchPlaceholder
|
|
8503
|
+
}
|
|
8504
|
+
) })
|
|
8505
|
+
] });
|
|
8506
|
+
const table = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8507
|
+
Table_default,
|
|
8508
|
+
{
|
|
8509
|
+
variant,
|
|
8510
|
+
searchTerm: enableSearch ? searchQuery : void 0,
|
|
8511
|
+
noSearchResultImage,
|
|
8512
|
+
children: [
|
|
8513
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8514
|
+
TableRow,
|
|
8515
|
+
{
|
|
8516
|
+
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
8517
|
+
children: headers.map((header, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8518
|
+
TableHead,
|
|
8519
|
+
{
|
|
8520
|
+
sortable: enableTableSort && header.sortable,
|
|
8521
|
+
sortDirection: enableTableSort && sortColumn === header.key ? sortDirection : null,
|
|
8522
|
+
onSort: () => enableTableSort && header.sortable && handleSort(header.key),
|
|
8523
|
+
className: header.className,
|
|
8524
|
+
style: header.width ? { width: header.width } : void 0,
|
|
8525
|
+
children: header.label
|
|
8526
|
+
},
|
|
8527
|
+
`header-${header.key}-${index}`
|
|
8528
|
+
))
|
|
8529
|
+
}
|
|
8530
|
+
) }),
|
|
8531
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
|
|
8532
|
+
const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
|
|
8533
|
+
const rowKeyValue = rowKey ? (() => {
|
|
8534
|
+
const keyValue = row[rowKey];
|
|
8535
|
+
if (keyValue === null || keyValue === void 0) {
|
|
8536
|
+
return `row-${effectiveIndex}`;
|
|
8537
|
+
}
|
|
8538
|
+
if (typeof keyValue === "object") {
|
|
8539
|
+
return JSON.stringify(keyValue);
|
|
8540
|
+
}
|
|
8541
|
+
return String(keyValue);
|
|
8542
|
+
})() : `row-${effectiveIndex}`;
|
|
8543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8544
|
+
TableRow,
|
|
8545
|
+
{
|
|
8546
|
+
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
8547
|
+
clickable: enableRowClick,
|
|
8548
|
+
onClick: () => handleRowClickInternal(row, effectiveIndex),
|
|
8549
|
+
children: headers.map((header, cellIndex) => {
|
|
8550
|
+
const value = row[header.key];
|
|
8551
|
+
let defaultContent = "";
|
|
8552
|
+
if (value !== null && value !== void 0) {
|
|
8553
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
8554
|
+
defaultContent = String(value);
|
|
8555
|
+
} else if (typeof value === "object") {
|
|
8556
|
+
defaultContent = JSON.stringify(value);
|
|
8557
|
+
} else if (typeof value === "function") {
|
|
8558
|
+
defaultContent = "[Function]";
|
|
8559
|
+
} else if (typeof value === "symbol") {
|
|
8560
|
+
defaultContent = String(value);
|
|
8561
|
+
}
|
|
8562
|
+
}
|
|
8563
|
+
const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
|
|
8564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8565
|
+
TableCell,
|
|
8566
|
+
{
|
|
8567
|
+
className: header.className,
|
|
8568
|
+
style: {
|
|
8569
|
+
textAlign: header.align
|
|
8570
|
+
},
|
|
8571
|
+
children: content
|
|
8572
|
+
},
|
|
8573
|
+
`cell-${effectiveIndex}-${cellIndex}`
|
|
8574
|
+
);
|
|
8575
|
+
})
|
|
8576
|
+
},
|
|
8577
|
+
rowKeyValue
|
|
8578
|
+
);
|
|
8579
|
+
}) })
|
|
8580
|
+
]
|
|
8581
|
+
}
|
|
8582
|
+
) });
|
|
8583
|
+
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8584
|
+
TablePagination_default,
|
|
8585
|
+
{
|
|
8586
|
+
currentPage,
|
|
8587
|
+
totalPages: calculatedTotalPages,
|
|
8588
|
+
totalItems: calculatedTotalItems,
|
|
8589
|
+
itemsPerPage,
|
|
8590
|
+
itemsPerPageOptions,
|
|
8591
|
+
onPageChange: handlePageChange,
|
|
8592
|
+
onItemsPerPageChange: handleItemsPerPageChange,
|
|
8593
|
+
itemLabel
|
|
8594
|
+
}
|
|
8595
|
+
) });
|
|
8596
|
+
if (children) {
|
|
8597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
8598
|
+
children({ controls, table, pagination }),
|
|
8599
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8600
|
+
FilterModal,
|
|
8601
|
+
{
|
|
8602
|
+
isOpen: isFilterModalOpen,
|
|
8603
|
+
onClose: () => setIsFilterModalOpen(false),
|
|
8604
|
+
filterConfigs,
|
|
8605
|
+
onFiltersChange: updateFilters,
|
|
8606
|
+
onApply: handleFilterApply,
|
|
8607
|
+
onClear: clearFilters
|
|
8608
|
+
}
|
|
8609
|
+
)
|
|
8610
|
+
] });
|
|
8611
|
+
}
|
|
8612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "w-full space-y-4", children: [
|
|
8613
|
+
controls,
|
|
8614
|
+
table,
|
|
8615
|
+
pagination,
|
|
8616
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8617
|
+
FilterModal,
|
|
8618
|
+
{
|
|
8619
|
+
isOpen: isFilterModalOpen,
|
|
8620
|
+
onClose: () => setIsFilterModalOpen(false),
|
|
8621
|
+
filterConfigs,
|
|
8622
|
+
onFiltersChange: updateFilters,
|
|
8623
|
+
onApply: handleFilterApply,
|
|
8624
|
+
onClear: clearFilters
|
|
8625
|
+
}
|
|
8626
|
+
)
|
|
8627
|
+
] });
|
|
8628
|
+
}
|
|
8629
|
+
var TableProvider_default = TableProvider;
|
|
8630
|
+
|
|
8631
|
+
// src/components/Select/Select.tsx
|
|
8632
|
+
var import_zustand8 = require("zustand");
|
|
8633
|
+
var import_react30 = require("react");
|
|
8634
|
+
var import_phosphor_react22 = require("phosphor-react");
|
|
8635
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
8303
8636
|
var VARIANT_CLASSES4 = {
|
|
8304
8637
|
outlined: "border-2 rounded-lg focus:border-primary-950",
|
|
8305
8638
|
underlined: "border-b-2 focus:border-primary-950",
|
|
@@ -8357,13 +8690,13 @@ function getLabelAsNode(children) {
|
|
|
8357
8690
|
if (typeof children === "string" || typeof children === "number") {
|
|
8358
8691
|
return children;
|
|
8359
8692
|
}
|
|
8360
|
-
const flattened =
|
|
8693
|
+
const flattened = import_react30.Children.toArray(children);
|
|
8361
8694
|
if (flattened.length === 1) return flattened[0];
|
|
8362
|
-
return /* @__PURE__ */ (0,
|
|
8695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: flattened });
|
|
8363
8696
|
}
|
|
8364
8697
|
var injectStore4 = (children, store, size, selectId) => {
|
|
8365
|
-
return
|
|
8366
|
-
if ((0,
|
|
8698
|
+
return import_react30.Children.map(children, (child) => {
|
|
8699
|
+
if ((0, import_react30.isValidElement)(child)) {
|
|
8367
8700
|
const typedChild = child;
|
|
8368
8701
|
const newProps = {
|
|
8369
8702
|
store
|
|
@@ -8380,7 +8713,7 @@ var injectStore4 = (children, store, size, selectId) => {
|
|
|
8380
8713
|
selectId
|
|
8381
8714
|
);
|
|
8382
8715
|
}
|
|
8383
|
-
return (0,
|
|
8716
|
+
return (0, import_react30.cloneElement)(typedChild, newProps);
|
|
8384
8717
|
}
|
|
8385
8718
|
return child;
|
|
8386
8719
|
});
|
|
@@ -8397,18 +8730,18 @@ var Select = ({
|
|
|
8397
8730
|
errorMessage,
|
|
8398
8731
|
id
|
|
8399
8732
|
}) => {
|
|
8400
|
-
const storeRef = (0,
|
|
8733
|
+
const storeRef = (0, import_react30.useRef)(null);
|
|
8401
8734
|
storeRef.current ??= createSelectStore(onValueChange);
|
|
8402
8735
|
const store = storeRef.current;
|
|
8403
|
-
const selectRef = (0,
|
|
8736
|
+
const selectRef = (0, import_react30.useRef)(null);
|
|
8404
8737
|
const { open, setOpen, setValue, selectedLabel } = (0, import_zustand8.useStore)(store, (s) => s);
|
|
8405
|
-
const generatedId = (0,
|
|
8738
|
+
const generatedId = (0, import_react30.useId)();
|
|
8406
8739
|
const selectId = id ?? `select-${generatedId}`;
|
|
8407
8740
|
const findLabelForValue = (children2, targetValue) => {
|
|
8408
8741
|
let found = null;
|
|
8409
8742
|
const search = (nodes) => {
|
|
8410
|
-
|
|
8411
|
-
if (!(0,
|
|
8743
|
+
import_react30.Children.forEach(nodes, (child) => {
|
|
8744
|
+
if (!(0, import_react30.isValidElement)(child)) return;
|
|
8412
8745
|
const typedChild = child;
|
|
8413
8746
|
if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
|
|
8414
8747
|
if (typeof typedChild.props.children === "string")
|
|
@@ -8421,13 +8754,13 @@ var Select = ({
|
|
|
8421
8754
|
search(children2);
|
|
8422
8755
|
return found;
|
|
8423
8756
|
};
|
|
8424
|
-
(0,
|
|
8757
|
+
(0, import_react30.useEffect)(() => {
|
|
8425
8758
|
if (!selectedLabel && defaultValue) {
|
|
8426
8759
|
const label2 = findLabelForValue(children, defaultValue);
|
|
8427
8760
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
8428
8761
|
}
|
|
8429
8762
|
}, [children, defaultValue, selectedLabel]);
|
|
8430
|
-
(0,
|
|
8763
|
+
(0, import_react30.useEffect)(() => {
|
|
8431
8764
|
const handleClickOutside = (event) => {
|
|
8432
8765
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
8433
8766
|
setOpen(false);
|
|
@@ -8462,7 +8795,7 @@ var Select = ({
|
|
|
8462
8795
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
8463
8796
|
};
|
|
8464
8797
|
}, [open]);
|
|
8465
|
-
(0,
|
|
8798
|
+
(0, import_react30.useEffect)(() => {
|
|
8466
8799
|
if (propValue) {
|
|
8467
8800
|
setValue(propValue);
|
|
8468
8801
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -8470,8 +8803,8 @@ var Select = ({
|
|
|
8470
8803
|
}
|
|
8471
8804
|
}, [propValue]);
|
|
8472
8805
|
const sizeClasses = SIZE_CLASSES12[size];
|
|
8473
|
-
return /* @__PURE__ */ (0,
|
|
8474
|
-
label && /* @__PURE__ */ (0,
|
|
8806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("w-full", className), children: [
|
|
8807
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8475
8808
|
"label",
|
|
8476
8809
|
{
|
|
8477
8810
|
htmlFor: selectId,
|
|
@@ -8479,11 +8812,11 @@ var Select = ({
|
|
|
8479
8812
|
children: label
|
|
8480
8813
|
}
|
|
8481
8814
|
),
|
|
8482
|
-
/* @__PURE__ */ (0,
|
|
8483
|
-
(helperText || errorMessage) && /* @__PURE__ */ (0,
|
|
8484
|
-
helperText && /* @__PURE__ */ (0,
|
|
8485
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
8486
|
-
/* @__PURE__ */ (0,
|
|
8815
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: cn("relative w-full"), ref: selectRef, children: injectStore4(children, store, size, selectId) }),
|
|
8816
|
+
(helperText || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
|
|
8817
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
|
|
8818
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
8819
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_phosphor_react22.WarningCircle, { size: 16 }),
|
|
8487
8820
|
" ",
|
|
8488
8821
|
errorMessage
|
|
8489
8822
|
] })
|
|
@@ -8497,9 +8830,9 @@ var SelectValue = ({
|
|
|
8497
8830
|
const store = useSelectStore(externalStore);
|
|
8498
8831
|
const selectedLabel = (0, import_zustand8.useStore)(store, (s) => s.selectedLabel);
|
|
8499
8832
|
const value = (0, import_zustand8.useStore)(store, (s) => s.value);
|
|
8500
|
-
return /* @__PURE__ */ (0,
|
|
8833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
|
|
8501
8834
|
};
|
|
8502
|
-
var SelectTrigger = (0,
|
|
8835
|
+
var SelectTrigger = (0, import_react30.forwardRef)(
|
|
8503
8836
|
({
|
|
8504
8837
|
className,
|
|
8505
8838
|
invalid = false,
|
|
@@ -8516,7 +8849,7 @@ var SelectTrigger = (0, import_react29.forwardRef)(
|
|
|
8516
8849
|
const variantClasses = VARIANT_CLASSES4[variant];
|
|
8517
8850
|
const heightClasses = HEIGHT_CLASSES[size];
|
|
8518
8851
|
const paddingClasses = PADDING_CLASSES[size];
|
|
8519
|
-
return /* @__PURE__ */ (0,
|
|
8852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
8520
8853
|
"button",
|
|
8521
8854
|
{
|
|
8522
8855
|
ref,
|
|
@@ -8538,8 +8871,8 @@ var SelectTrigger = (0, import_react29.forwardRef)(
|
|
|
8538
8871
|
...props,
|
|
8539
8872
|
children: [
|
|
8540
8873
|
props.children,
|
|
8541
|
-
/* @__PURE__ */ (0,
|
|
8542
|
-
|
|
8874
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8875
|
+
import_phosphor_react22.CaretDown,
|
|
8543
8876
|
{
|
|
8544
8877
|
className: cn(
|
|
8545
8878
|
"h-[1em] w-[1em] opacity-50 transition-transform",
|
|
@@ -8553,7 +8886,7 @@ var SelectTrigger = (0, import_react29.forwardRef)(
|
|
|
8553
8886
|
}
|
|
8554
8887
|
);
|
|
8555
8888
|
SelectTrigger.displayName = "SelectTrigger";
|
|
8556
|
-
var SelectContent = (0,
|
|
8889
|
+
var SelectContent = (0, import_react30.forwardRef)(
|
|
8557
8890
|
({
|
|
8558
8891
|
children,
|
|
8559
8892
|
className,
|
|
@@ -8566,7 +8899,7 @@ var SelectContent = (0, import_react29.forwardRef)(
|
|
|
8566
8899
|
const open = (0, import_zustand8.useStore)(store, (s) => s.open);
|
|
8567
8900
|
if (!open) return null;
|
|
8568
8901
|
const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
8569
|
-
return /* @__PURE__ */ (0,
|
|
8902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8570
8903
|
"div",
|
|
8571
8904
|
{
|
|
8572
8905
|
role: "menu",
|
|
@@ -8583,7 +8916,7 @@ var SelectContent = (0, import_react29.forwardRef)(
|
|
|
8583
8916
|
}
|
|
8584
8917
|
);
|
|
8585
8918
|
SelectContent.displayName = "SelectContent";
|
|
8586
|
-
var SelectItem = (0,
|
|
8919
|
+
var SelectItem = (0, import_react30.forwardRef)(
|
|
8587
8920
|
({
|
|
8588
8921
|
className,
|
|
8589
8922
|
children,
|
|
@@ -8610,7 +8943,7 @@ var SelectItem = (0, import_react29.forwardRef)(
|
|
|
8610
8943
|
}
|
|
8611
8944
|
props.onClick?.(e);
|
|
8612
8945
|
};
|
|
8613
|
-
return /* @__PURE__ */ (0,
|
|
8946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
8614
8947
|
"div",
|
|
8615
8948
|
{
|
|
8616
8949
|
role: "menuitem",
|
|
@@ -8630,7 +8963,7 @@ var SelectItem = (0, import_react29.forwardRef)(
|
|
|
8630
8963
|
tabIndex: disabled ? -1 : 0,
|
|
8631
8964
|
...props,
|
|
8632
8965
|
children: [
|
|
8633
|
-
/* @__PURE__ */ (0,
|
|
8966
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_phosphor_react22.Check, { className: "" }) }),
|
|
8634
8967
|
children
|
|
8635
8968
|
]
|
|
8636
8969
|
}
|
|
@@ -8642,9 +8975,9 @@ var Select_default = Select;
|
|
|
8642
8975
|
|
|
8643
8976
|
// src/components/Menu/Menu.tsx
|
|
8644
8977
|
var import_zustand9 = require("zustand");
|
|
8645
|
-
var
|
|
8646
|
-
var
|
|
8647
|
-
var
|
|
8978
|
+
var import_react31 = require("react");
|
|
8979
|
+
var import_phosphor_react23 = require("phosphor-react");
|
|
8980
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
8648
8981
|
var createMenuStore = (onValueChange) => (0, import_zustand9.create)((set) => ({
|
|
8649
8982
|
value: "",
|
|
8650
8983
|
setValue: (value) => {
|
|
@@ -8663,7 +8996,7 @@ var VARIANT_CLASSES5 = {
|
|
|
8663
8996
|
"menu-overflow": "",
|
|
8664
8997
|
breadcrumb: "bg-transparent shadow-none !px-0"
|
|
8665
8998
|
};
|
|
8666
|
-
var Menu = (0,
|
|
8999
|
+
var Menu = (0, import_react31.forwardRef)(
|
|
8667
9000
|
({
|
|
8668
9001
|
className,
|
|
8669
9002
|
children,
|
|
@@ -8673,16 +9006,16 @@ var Menu = (0, import_react30.forwardRef)(
|
|
|
8673
9006
|
onValueChange,
|
|
8674
9007
|
...props
|
|
8675
9008
|
}, ref) => {
|
|
8676
|
-
const storeRef = (0,
|
|
9009
|
+
const storeRef = (0, import_react31.useRef)(null);
|
|
8677
9010
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
8678
9011
|
const store = storeRef.current;
|
|
8679
9012
|
const { setValue } = (0, import_zustand9.useStore)(store, (s) => s);
|
|
8680
|
-
(0,
|
|
9013
|
+
(0, import_react31.useEffect)(() => {
|
|
8681
9014
|
setValue(propValue ?? defaultValue);
|
|
8682
9015
|
}, [defaultValue, propValue, setValue]);
|
|
8683
9016
|
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";
|
|
8684
9017
|
const variantClasses = VARIANT_CLASSES5[variant];
|
|
8685
|
-
return /* @__PURE__ */ (0,
|
|
9018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8686
9019
|
"div",
|
|
8687
9020
|
{
|
|
8688
9021
|
ref,
|
|
@@ -8698,11 +9031,11 @@ var Menu = (0, import_react30.forwardRef)(
|
|
|
8698
9031
|
}
|
|
8699
9032
|
);
|
|
8700
9033
|
Menu.displayName = "Menu";
|
|
8701
|
-
var MenuContent = (0,
|
|
9034
|
+
var MenuContent = (0, import_react31.forwardRef)(
|
|
8702
9035
|
({ className, children, variant = "menu", ...props }, ref) => {
|
|
8703
9036
|
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
8704
9037
|
const variantClasses = variant === "menu2" || variant === "menu-overflow" ? "overflow-x-auto scroll-smooth" : "";
|
|
8705
|
-
return /* @__PURE__ */ (0,
|
|
9038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8706
9039
|
"ul",
|
|
8707
9040
|
{
|
|
8708
9041
|
ref,
|
|
@@ -8720,7 +9053,7 @@ var MenuContent = (0, import_react30.forwardRef)(
|
|
|
8720
9053
|
}
|
|
8721
9054
|
);
|
|
8722
9055
|
MenuContent.displayName = "MenuContent";
|
|
8723
|
-
var MenuItem = (0,
|
|
9056
|
+
var MenuItem = (0, import_react31.forwardRef)(
|
|
8724
9057
|
({
|
|
8725
9058
|
className,
|
|
8726
9059
|
children,
|
|
@@ -8754,7 +9087,7 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8754
9087
|
...props
|
|
8755
9088
|
};
|
|
8756
9089
|
const variants = {
|
|
8757
|
-
menu: /* @__PURE__ */ (0,
|
|
9090
|
+
menu: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8758
9091
|
"li",
|
|
8759
9092
|
{
|
|
8760
9093
|
"data-variant": "menu",
|
|
@@ -8769,7 +9102,7 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8769
9102
|
children
|
|
8770
9103
|
}
|
|
8771
9104
|
),
|
|
8772
|
-
menu2: /* @__PURE__ */ (0,
|
|
9105
|
+
menu2: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8773
9106
|
"li",
|
|
8774
9107
|
{
|
|
8775
9108
|
"data-variant": "menu2",
|
|
@@ -8780,7 +9113,7 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8780
9113
|
`,
|
|
8781
9114
|
...commonProps,
|
|
8782
9115
|
children: [
|
|
8783
|
-
/* @__PURE__ */ (0,
|
|
9116
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8784
9117
|
"span",
|
|
8785
9118
|
{
|
|
8786
9119
|
className: cn(
|
|
@@ -8790,11 +9123,11 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8790
9123
|
children
|
|
8791
9124
|
}
|
|
8792
9125
|
),
|
|
8793
|
-
selectedValue === value && /* @__PURE__ */ (0,
|
|
9126
|
+
selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
8794
9127
|
]
|
|
8795
9128
|
}
|
|
8796
9129
|
),
|
|
8797
|
-
"menu-overflow": /* @__PURE__ */ (0,
|
|
9130
|
+
"menu-overflow": /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8798
9131
|
"li",
|
|
8799
9132
|
{
|
|
8800
9133
|
"data-variant": "menu-overflow",
|
|
@@ -8805,7 +9138,7 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8805
9138
|
`,
|
|
8806
9139
|
...commonProps,
|
|
8807
9140
|
children: [
|
|
8808
|
-
/* @__PURE__ */ (0,
|
|
9141
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8809
9142
|
"span",
|
|
8810
9143
|
{
|
|
8811
9144
|
className: cn(
|
|
@@ -8815,11 +9148,11 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8815
9148
|
children
|
|
8816
9149
|
}
|
|
8817
9150
|
),
|
|
8818
|
-
selectedValue === value && /* @__PURE__ */ (0,
|
|
9151
|
+
selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
8819
9152
|
]
|
|
8820
9153
|
}
|
|
8821
9154
|
),
|
|
8822
|
-
breadcrumb: /* @__PURE__ */ (0,
|
|
9155
|
+
breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8823
9156
|
"li",
|
|
8824
9157
|
{
|
|
8825
9158
|
"data-variant": "breadcrumb",
|
|
@@ -8831,7 +9164,7 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8831
9164
|
`,
|
|
8832
9165
|
...commonProps,
|
|
8833
9166
|
children: [
|
|
8834
|
-
/* @__PURE__ */ (0,
|
|
9167
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8835
9168
|
"span",
|
|
8836
9169
|
{
|
|
8837
9170
|
className: cn(
|
|
@@ -8841,8 +9174,8 @@ var MenuItem = (0, import_react30.forwardRef)(
|
|
|
8841
9174
|
children
|
|
8842
9175
|
}
|
|
8843
9176
|
),
|
|
8844
|
-
separator && /* @__PURE__ */ (0,
|
|
8845
|
-
|
|
9177
|
+
separator && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9178
|
+
import_phosphor_react23.CaretRight,
|
|
8846
9179
|
{
|
|
8847
9180
|
size: 16,
|
|
8848
9181
|
className: "text-text-600",
|
|
@@ -8878,10 +9211,10 @@ var MenuOverflow = ({
|
|
|
8878
9211
|
onValueChange,
|
|
8879
9212
|
...props
|
|
8880
9213
|
}) => {
|
|
8881
|
-
const containerRef = (0,
|
|
8882
|
-
const [showLeftArrow, setShowLeftArrow] = (0,
|
|
8883
|
-
const [showRightArrow, setShowRightArrow] = (0,
|
|
8884
|
-
(0,
|
|
9214
|
+
const containerRef = (0, import_react31.useRef)(null);
|
|
9215
|
+
const [showLeftArrow, setShowLeftArrow] = (0, import_react31.useState)(false);
|
|
9216
|
+
const [showRightArrow, setShowRightArrow] = (0, import_react31.useState)(false);
|
|
9217
|
+
(0, import_react31.useEffect)(() => {
|
|
8885
9218
|
const checkScroll = () => internalCheckScroll(
|
|
8886
9219
|
containerRef.current,
|
|
8887
9220
|
setShowLeftArrow,
|
|
@@ -8896,25 +9229,25 @@ var MenuOverflow = ({
|
|
|
8896
9229
|
window.removeEventListener("resize", checkScroll);
|
|
8897
9230
|
};
|
|
8898
9231
|
}, []);
|
|
8899
|
-
return /* @__PURE__ */ (0,
|
|
9232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8900
9233
|
"div",
|
|
8901
9234
|
{
|
|
8902
9235
|
"data-testid": "menu-overflow-wrapper",
|
|
8903
9236
|
className: cn("relative w-full overflow-hidden", className),
|
|
8904
9237
|
children: [
|
|
8905
|
-
showLeftArrow && /* @__PURE__ */ (0,
|
|
9238
|
+
showLeftArrow && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8906
9239
|
"button",
|
|
8907
9240
|
{
|
|
8908
9241
|
onClick: () => internalScroll(containerRef.current, "left"),
|
|
8909
9242
|
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",
|
|
8910
9243
|
"data-testid": "scroll-left-button",
|
|
8911
9244
|
children: [
|
|
8912
|
-
/* @__PURE__ */ (0,
|
|
8913
|
-
/* @__PURE__ */ (0,
|
|
9245
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_phosphor_react23.CaretLeft, { size: 16 }),
|
|
9246
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "sr-only", children: "Scroll left" })
|
|
8914
9247
|
]
|
|
8915
9248
|
}
|
|
8916
9249
|
),
|
|
8917
|
-
/* @__PURE__ */ (0,
|
|
9250
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8918
9251
|
Menu,
|
|
8919
9252
|
{
|
|
8920
9253
|
defaultValue,
|
|
@@ -8922,18 +9255,18 @@ var MenuOverflow = ({
|
|
|
8922
9255
|
value,
|
|
8923
9256
|
variant: "menu2",
|
|
8924
9257
|
...props,
|
|
8925
|
-
children: /* @__PURE__ */ (0,
|
|
9258
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(MenuContent, { ref: containerRef, variant: "menu2", children })
|
|
8926
9259
|
}
|
|
8927
9260
|
),
|
|
8928
|
-
showRightArrow && /* @__PURE__ */ (0,
|
|
9261
|
+
showRightArrow && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8929
9262
|
"button",
|
|
8930
9263
|
{
|
|
8931
9264
|
onClick: () => internalScroll(containerRef.current, "right"),
|
|
8932
9265
|
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",
|
|
8933
9266
|
"data-testid": "scroll-right-button",
|
|
8934
9267
|
children: [
|
|
8935
|
-
/* @__PURE__ */ (0,
|
|
8936
|
-
/* @__PURE__ */ (0,
|
|
9268
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_phosphor_react23.CaretRight, { size: 16 }),
|
|
9269
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "sr-only", children: "Scroll right" })
|
|
8937
9270
|
]
|
|
8938
9271
|
}
|
|
8939
9272
|
)
|
|
@@ -8941,11 +9274,11 @@ var MenuOverflow = ({
|
|
|
8941
9274
|
}
|
|
8942
9275
|
);
|
|
8943
9276
|
};
|
|
8944
|
-
var injectStore5 = (children, store) =>
|
|
8945
|
-
if (!(0,
|
|
9277
|
+
var injectStore5 = (children, store) => import_react31.Children.map(children, (child) => {
|
|
9278
|
+
if (!(0, import_react31.isValidElement)(child)) return child;
|
|
8946
9279
|
const typedChild = child;
|
|
8947
9280
|
const shouldInject = typedChild.type === MenuItem;
|
|
8948
|
-
return (0,
|
|
9281
|
+
return (0, import_react31.cloneElement)(typedChild, {
|
|
8949
9282
|
...shouldInject ? { store } : {},
|
|
8950
9283
|
...typedChild.props.children ? { children: injectStore5(typedChild.props.children, store) } : {}
|
|
8951
9284
|
});
|
|
@@ -8953,13 +9286,13 @@ var injectStore5 = (children, store) => import_react30.Children.map(children, (c
|
|
|
8953
9286
|
var Menu_default = Menu;
|
|
8954
9287
|
|
|
8955
9288
|
// src/components/Card/Card.tsx
|
|
8956
|
-
var
|
|
8957
|
-
var
|
|
9289
|
+
var import_react33 = require("react");
|
|
9290
|
+
var import_phosphor_react24 = require("phosphor-react");
|
|
8958
9291
|
|
|
8959
9292
|
// src/components/IconRender/IconRender.tsx
|
|
8960
|
-
var
|
|
9293
|
+
var import_react32 = require("react");
|
|
8961
9294
|
var PhosphorIcons = __toESM(require("phosphor-react"));
|
|
8962
|
-
var
|
|
9295
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8963
9296
|
var IconRender = ({
|
|
8964
9297
|
iconName,
|
|
8965
9298
|
color = "#000000",
|
|
@@ -8969,18 +9302,18 @@ var IconRender = ({
|
|
|
8969
9302
|
if (typeof iconName === "string") {
|
|
8970
9303
|
switch (iconName) {
|
|
8971
9304
|
case "Chat_PT":
|
|
8972
|
-
return /* @__PURE__ */ (0,
|
|
9305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChatPT, { size, color });
|
|
8973
9306
|
case "Chat_EN":
|
|
8974
|
-
return /* @__PURE__ */ (0,
|
|
9307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChatEN, { size, color });
|
|
8975
9308
|
case "Chat_ES":
|
|
8976
|
-
return /* @__PURE__ */ (0,
|
|
9309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChatES, { size, color });
|
|
8977
9310
|
default: {
|
|
8978
9311
|
const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
|
|
8979
|
-
return /* @__PURE__ */ (0,
|
|
9312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IconComponent, { size, color, weight });
|
|
8980
9313
|
}
|
|
8981
9314
|
}
|
|
8982
9315
|
} else {
|
|
8983
|
-
return (0,
|
|
9316
|
+
return (0, import_react32.cloneElement)(iconName, {
|
|
8984
9317
|
size,
|
|
8985
9318
|
color: "currentColor"
|
|
8986
9319
|
});
|
|
@@ -8989,7 +9322,7 @@ var IconRender = ({
|
|
|
8989
9322
|
var IconRender_default = IconRender;
|
|
8990
9323
|
|
|
8991
9324
|
// src/components/Card/Card.tsx
|
|
8992
|
-
var
|
|
9325
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
8993
9326
|
var CARD_BASE_CLASSES = {
|
|
8994
9327
|
default: "w-full bg-background border border-border-50 rounded-xl",
|
|
8995
9328
|
compact: "w-full bg-background border border-border-50 rounded-lg",
|
|
@@ -9015,7 +9348,7 @@ var CARD_CURSOR_CLASSES = {
|
|
|
9015
9348
|
default: "",
|
|
9016
9349
|
pointer: "cursor-pointer"
|
|
9017
9350
|
};
|
|
9018
|
-
var CardBase = (0,
|
|
9351
|
+
var CardBase = (0, import_react33.forwardRef)(
|
|
9019
9352
|
({
|
|
9020
9353
|
children,
|
|
9021
9354
|
variant = "default",
|
|
@@ -9031,7 +9364,7 @@ var CardBase = (0, import_react32.forwardRef)(
|
|
|
9031
9364
|
const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
|
|
9032
9365
|
const layoutClasses = CARD_LAYOUT_CLASSES[layout];
|
|
9033
9366
|
const cursorClasses = CARD_CURSOR_CLASSES[cursor];
|
|
9034
|
-
return /* @__PURE__ */ (0,
|
|
9367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9035
9368
|
"div",
|
|
9036
9369
|
{
|
|
9037
9370
|
ref,
|
|
@@ -9073,7 +9406,7 @@ var ACTION_HEADER_CLASSES = {
|
|
|
9073
9406
|
error: "text-error-300",
|
|
9074
9407
|
info: "text-info-300"
|
|
9075
9408
|
};
|
|
9076
|
-
var CardActivitiesResults = (0,
|
|
9409
|
+
var CardActivitiesResults = (0, import_react33.forwardRef)(
|
|
9077
9410
|
({
|
|
9078
9411
|
icon,
|
|
9079
9412
|
title,
|
|
@@ -9089,7 +9422,7 @@ var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
|
9089
9422
|
const actionIconClasses = ACTION_ICON_CLASSES[action];
|
|
9090
9423
|
const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
|
|
9091
9424
|
const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
|
|
9092
|
-
return /* @__PURE__ */ (0,
|
|
9425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9093
9426
|
"div",
|
|
9094
9427
|
{
|
|
9095
9428
|
ref,
|
|
@@ -9099,7 +9432,7 @@ var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
|
9099
9432
|
),
|
|
9100
9433
|
...props,
|
|
9101
9434
|
children: [
|
|
9102
|
-
/* @__PURE__ */ (0,
|
|
9435
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9103
9436
|
"div",
|
|
9104
9437
|
{
|
|
9105
9438
|
className: cn(
|
|
@@ -9108,7 +9441,7 @@ var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
|
9108
9441
|
extended ? "rounded-t-xl" : "rounded-xl"
|
|
9109
9442
|
),
|
|
9110
9443
|
children: [
|
|
9111
|
-
/* @__PURE__ */ (0,
|
|
9444
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9112
9445
|
"span",
|
|
9113
9446
|
{
|
|
9114
9447
|
className: cn(
|
|
@@ -9118,7 +9451,7 @@ var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
|
9118
9451
|
children: icon
|
|
9119
9452
|
}
|
|
9120
9453
|
),
|
|
9121
|
-
/* @__PURE__ */ (0,
|
|
9454
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9122
9455
|
Text_default,
|
|
9123
9456
|
{
|
|
9124
9457
|
size: "2xs",
|
|
@@ -9127,7 +9460,7 @@ var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
|
9127
9460
|
children: title
|
|
9128
9461
|
}
|
|
9129
9462
|
),
|
|
9130
|
-
/* @__PURE__ */ (0,
|
|
9463
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9131
9464
|
"p",
|
|
9132
9465
|
{
|
|
9133
9466
|
className: cn("text-lg font-bold truncate", actionSubTitleClasses),
|
|
@@ -9137,8 +9470,8 @@ var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
|
9137
9470
|
]
|
|
9138
9471
|
}
|
|
9139
9472
|
),
|
|
9140
|
-
extended && /* @__PURE__ */ (0,
|
|
9141
|
-
/* @__PURE__ */ (0,
|
|
9473
|
+
extended && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
|
|
9474
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9142
9475
|
"p",
|
|
9143
9476
|
{
|
|
9144
9477
|
className: cn(
|
|
@@ -9148,14 +9481,14 @@ var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
|
9148
9481
|
children: header
|
|
9149
9482
|
}
|
|
9150
9483
|
),
|
|
9151
|
-
/* @__PURE__ */ (0,
|
|
9484
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Badge_default, { size: "large", action: "info", children: description })
|
|
9152
9485
|
] })
|
|
9153
9486
|
]
|
|
9154
9487
|
}
|
|
9155
9488
|
);
|
|
9156
9489
|
}
|
|
9157
9490
|
);
|
|
9158
|
-
var CardQuestions = (0,
|
|
9491
|
+
var CardQuestions = (0, import_react33.forwardRef)(
|
|
9159
9492
|
({
|
|
9160
9493
|
header,
|
|
9161
9494
|
state = "undone",
|
|
@@ -9167,7 +9500,7 @@ var CardQuestions = (0, import_react32.forwardRef)(
|
|
|
9167
9500
|
const isDone = state === "done";
|
|
9168
9501
|
const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
|
|
9169
9502
|
const buttonLabel = isDone ? "Ver Resultado" : "Responder";
|
|
9170
|
-
return /* @__PURE__ */ (0,
|
|
9503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9171
9504
|
CardBase,
|
|
9172
9505
|
{
|
|
9173
9506
|
ref,
|
|
@@ -9177,9 +9510,9 @@ var CardQuestions = (0, import_react32.forwardRef)(
|
|
|
9177
9510
|
className: cn("justify-between gap-4", className),
|
|
9178
9511
|
...props,
|
|
9179
9512
|
children: [
|
|
9180
|
-
/* @__PURE__ */ (0,
|
|
9181
|
-
/* @__PURE__ */ (0,
|
|
9182
|
-
/* @__PURE__ */ (0,
|
|
9513
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
9514
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
|
|
9515
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9183
9516
|
Badge_default,
|
|
9184
9517
|
{
|
|
9185
9518
|
size: "medium",
|
|
@@ -9189,7 +9522,7 @@ var CardQuestions = (0, import_react32.forwardRef)(
|
|
|
9189
9522
|
}
|
|
9190
9523
|
) })
|
|
9191
9524
|
] }),
|
|
9192
|
-
/* @__PURE__ */ (0,
|
|
9525
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9193
9526
|
Button_default,
|
|
9194
9527
|
{
|
|
9195
9528
|
size: "extra-small",
|
|
@@ -9203,7 +9536,7 @@ var CardQuestions = (0, import_react32.forwardRef)(
|
|
|
9203
9536
|
);
|
|
9204
9537
|
}
|
|
9205
9538
|
);
|
|
9206
|
-
var CardProgress = (0,
|
|
9539
|
+
var CardProgress = (0, import_react33.forwardRef)(
|
|
9207
9540
|
({
|
|
9208
9541
|
header,
|
|
9209
9542
|
subhead,
|
|
@@ -9220,19 +9553,19 @@ var CardProgress = (0, import_react32.forwardRef)(
|
|
|
9220
9553
|
}, ref) => {
|
|
9221
9554
|
const isHorizontal = direction === "horizontal";
|
|
9222
9555
|
const contentComponent = {
|
|
9223
|
-
horizontal: /* @__PURE__ */ (0,
|
|
9224
|
-
showDates && /* @__PURE__ */ (0,
|
|
9225
|
-
initialDate && /* @__PURE__ */ (0,
|
|
9226
|
-
/* @__PURE__ */ (0,
|
|
9227
|
-
/* @__PURE__ */ (0,
|
|
9556
|
+
horizontal: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
9557
|
+
showDates && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
|
|
9558
|
+
initialDate && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
9559
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
|
|
9560
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-text-600", children: initialDate })
|
|
9228
9561
|
] }),
|
|
9229
|
-
endDate && /* @__PURE__ */ (0,
|
|
9230
|
-
/* @__PURE__ */ (0,
|
|
9231
|
-
/* @__PURE__ */ (0,
|
|
9562
|
+
endDate && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
9563
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
|
|
9564
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-text-600", children: endDate })
|
|
9232
9565
|
] })
|
|
9233
9566
|
] }),
|
|
9234
|
-
/* @__PURE__ */ (0,
|
|
9235
|
-
/* @__PURE__ */ (0,
|
|
9567
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
9568
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9236
9569
|
ProgressBar_default,
|
|
9237
9570
|
{
|
|
9238
9571
|
size: "small",
|
|
@@ -9241,7 +9574,7 @@ var CardProgress = (0, import_react32.forwardRef)(
|
|
|
9241
9574
|
"data-testid": "progress-bar"
|
|
9242
9575
|
}
|
|
9243
9576
|
),
|
|
9244
|
-
/* @__PURE__ */ (0,
|
|
9577
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9245
9578
|
Text_default,
|
|
9246
9579
|
{
|
|
9247
9580
|
size: "xs",
|
|
@@ -9257,9 +9590,9 @@ var CardProgress = (0, import_react32.forwardRef)(
|
|
|
9257
9590
|
)
|
|
9258
9591
|
] })
|
|
9259
9592
|
] }),
|
|
9260
|
-
vertical: /* @__PURE__ */ (0,
|
|
9593
|
+
vertical: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm text-text-800", children: subhead })
|
|
9261
9594
|
};
|
|
9262
|
-
return /* @__PURE__ */ (0,
|
|
9595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9263
9596
|
CardBase,
|
|
9264
9597
|
{
|
|
9265
9598
|
ref,
|
|
@@ -9270,7 +9603,7 @@ var CardProgress = (0, import_react32.forwardRef)(
|
|
|
9270
9603
|
className: cn(isHorizontal ? "h-20" : "", className),
|
|
9271
9604
|
...props,
|
|
9272
9605
|
children: [
|
|
9273
|
-
/* @__PURE__ */ (0,
|
|
9606
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9274
9607
|
"div",
|
|
9275
9608
|
{
|
|
9276
9609
|
className: cn(
|
|
@@ -9283,7 +9616,7 @@ var CardProgress = (0, import_react32.forwardRef)(
|
|
|
9283
9616
|
children: icon
|
|
9284
9617
|
}
|
|
9285
9618
|
),
|
|
9286
|
-
/* @__PURE__ */ (0,
|
|
9619
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9287
9620
|
"div",
|
|
9288
9621
|
{
|
|
9289
9622
|
className: cn(
|
|
@@ -9291,7 +9624,7 @@ var CardProgress = (0, import_react32.forwardRef)(
|
|
|
9291
9624
|
!isHorizontal && "gap-4"
|
|
9292
9625
|
),
|
|
9293
9626
|
children: [
|
|
9294
|
-
/* @__PURE__ */ (0,
|
|
9627
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
|
|
9295
9628
|
contentComponent[direction]
|
|
9296
9629
|
]
|
|
9297
9630
|
}
|
|
@@ -9301,7 +9634,7 @@ var CardProgress = (0, import_react32.forwardRef)(
|
|
|
9301
9634
|
);
|
|
9302
9635
|
}
|
|
9303
9636
|
);
|
|
9304
|
-
var CardTopic = (0,
|
|
9637
|
+
var CardTopic = (0, import_react33.forwardRef)(
|
|
9305
9638
|
({
|
|
9306
9639
|
header,
|
|
9307
9640
|
subHead,
|
|
@@ -9311,7 +9644,7 @@ var CardTopic = (0, import_react32.forwardRef)(
|
|
|
9311
9644
|
className = "",
|
|
9312
9645
|
...props
|
|
9313
9646
|
}, ref) => {
|
|
9314
|
-
return /* @__PURE__ */ (0,
|
|
9647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9315
9648
|
CardBase,
|
|
9316
9649
|
{
|
|
9317
9650
|
ref,
|
|
@@ -9322,13 +9655,13 @@ var CardTopic = (0, import_react32.forwardRef)(
|
|
|
9322
9655
|
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
9323
9656
|
...props,
|
|
9324
9657
|
children: [
|
|
9325
|
-
subHead && /* @__PURE__ */ (0,
|
|
9326
|
-
/* @__PURE__ */ (0,
|
|
9327
|
-
index < subHead.length - 1 && /* @__PURE__ */ (0,
|
|
9658
|
+
subHead && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react33.Fragment, { children: [
|
|
9659
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: text }),
|
|
9660
|
+
index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: "\u2022" })
|
|
9328
9661
|
] }, `${text} - ${index}`)) }),
|
|
9329
|
-
/* @__PURE__ */ (0,
|
|
9330
|
-
/* @__PURE__ */ (0,
|
|
9331
|
-
/* @__PURE__ */ (0,
|
|
9662
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
|
|
9663
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
9664
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9332
9665
|
ProgressBar_default,
|
|
9333
9666
|
{
|
|
9334
9667
|
size: "small",
|
|
@@ -9337,7 +9670,7 @@ var CardTopic = (0, import_react32.forwardRef)(
|
|
|
9337
9670
|
"data-testid": "progress-bar"
|
|
9338
9671
|
}
|
|
9339
9672
|
),
|
|
9340
|
-
showPercentage && /* @__PURE__ */ (0,
|
|
9673
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9341
9674
|
Text_default,
|
|
9342
9675
|
{
|
|
9343
9676
|
size: "xs",
|
|
@@ -9357,7 +9690,7 @@ var CardTopic = (0, import_react32.forwardRef)(
|
|
|
9357
9690
|
);
|
|
9358
9691
|
}
|
|
9359
9692
|
);
|
|
9360
|
-
var CardPerformance = (0,
|
|
9693
|
+
var CardPerformance = (0, import_react33.forwardRef)(
|
|
9361
9694
|
({
|
|
9362
9695
|
header,
|
|
9363
9696
|
progress,
|
|
@@ -9371,7 +9704,7 @@ var CardPerformance = (0, import_react32.forwardRef)(
|
|
|
9371
9704
|
...props
|
|
9372
9705
|
}, ref) => {
|
|
9373
9706
|
const hasProgress = progress !== void 0;
|
|
9374
|
-
return /* @__PURE__ */ (0,
|
|
9707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9375
9708
|
CardBase,
|
|
9376
9709
|
{
|
|
9377
9710
|
ref,
|
|
@@ -9385,10 +9718,10 @@ var CardPerformance = (0, import_react32.forwardRef)(
|
|
|
9385
9718
|
onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
|
|
9386
9719
|
...props,
|
|
9387
9720
|
children: [
|
|
9388
|
-
/* @__PURE__ */ (0,
|
|
9389
|
-
/* @__PURE__ */ (0,
|
|
9390
|
-
/* @__PURE__ */ (0,
|
|
9391
|
-
actionVariant === "button" && /* @__PURE__ */ (0,
|
|
9721
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
|
|
9722
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row justify-between items-center gap-2", children: [
|
|
9723
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
9724
|
+
actionVariant === "button" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9392
9725
|
Button_default,
|
|
9393
9726
|
{
|
|
9394
9727
|
variant: "outline",
|
|
@@ -9399,17 +9732,17 @@ var CardPerformance = (0, import_react32.forwardRef)(
|
|
|
9399
9732
|
}
|
|
9400
9733
|
)
|
|
9401
9734
|
] }),
|
|
9402
|
-
/* @__PURE__ */ (0,
|
|
9735
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9403
9736
|
ProgressBar_default,
|
|
9404
9737
|
{
|
|
9405
9738
|
value: progress,
|
|
9406
9739
|
label: `${progress}% ${labelProgress}`,
|
|
9407
9740
|
variant: progressVariant
|
|
9408
9741
|
}
|
|
9409
|
-
) : /* @__PURE__ */ (0,
|
|
9742
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs text-text-600 truncate", children: description }) })
|
|
9410
9743
|
] }),
|
|
9411
|
-
actionVariant == "caret" && /* @__PURE__ */ (0,
|
|
9412
|
-
|
|
9744
|
+
actionVariant == "caret" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9745
|
+
import_phosphor_react24.CaretRight,
|
|
9413
9746
|
{
|
|
9414
9747
|
className: "size-4.5 text-text-800 cursor-pointer",
|
|
9415
9748
|
"data-testid": "caret-icon"
|
|
@@ -9420,7 +9753,7 @@ var CardPerformance = (0, import_react32.forwardRef)(
|
|
|
9420
9753
|
);
|
|
9421
9754
|
}
|
|
9422
9755
|
);
|
|
9423
|
-
var CardResults = (0,
|
|
9756
|
+
var CardResults = (0, import_react33.forwardRef)(
|
|
9424
9757
|
({
|
|
9425
9758
|
header,
|
|
9426
9759
|
correct_answers,
|
|
@@ -9432,7 +9765,7 @@ var CardResults = (0, import_react32.forwardRef)(
|
|
|
9432
9765
|
...props
|
|
9433
9766
|
}, ref) => {
|
|
9434
9767
|
const isRow = direction == "row";
|
|
9435
|
-
return /* @__PURE__ */ (0,
|
|
9768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9436
9769
|
CardBase,
|
|
9437
9770
|
{
|
|
9438
9771
|
ref,
|
|
@@ -9442,7 +9775,7 @@ var CardResults = (0, import_react32.forwardRef)(
|
|
|
9442
9775
|
className: cn("items-stretch cursor-pointer pr-4", className),
|
|
9443
9776
|
...props,
|
|
9444
9777
|
children: [
|
|
9445
|
-
/* @__PURE__ */ (0,
|
|
9778
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9446
9779
|
"div",
|
|
9447
9780
|
{
|
|
9448
9781
|
className: cn(
|
|
@@ -9451,11 +9784,11 @@ var CardResults = (0, import_react32.forwardRef)(
|
|
|
9451
9784
|
style: {
|
|
9452
9785
|
backgroundColor: color
|
|
9453
9786
|
},
|
|
9454
|
-
children: /* @__PURE__ */ (0,
|
|
9787
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
|
|
9455
9788
|
}
|
|
9456
9789
|
),
|
|
9457
|
-
/* @__PURE__ */ (0,
|
|
9458
|
-
/* @__PURE__ */ (0,
|
|
9790
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "w-full flex flex-row justify-between items-center", children: [
|
|
9791
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9459
9792
|
"div",
|
|
9460
9793
|
{
|
|
9461
9794
|
className: cn(
|
|
@@ -9463,28 +9796,28 @@ var CardResults = (0, import_react32.forwardRef)(
|
|
|
9463
9796
|
isRow ? "flex-row items-center gap-2" : "flex-col"
|
|
9464
9797
|
),
|
|
9465
9798
|
children: [
|
|
9466
|
-
/* @__PURE__ */ (0,
|
|
9467
|
-
/* @__PURE__ */ (0,
|
|
9468
|
-
/* @__PURE__ */ (0,
|
|
9799
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
|
|
9800
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
|
|
9801
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9469
9802
|
Badge_default,
|
|
9470
9803
|
{
|
|
9471
9804
|
action: "success",
|
|
9472
9805
|
variant: "solid",
|
|
9473
9806
|
size: "large",
|
|
9474
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
9807
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.CheckCircle, {}),
|
|
9475
9808
|
children: [
|
|
9476
9809
|
correct_answers,
|
|
9477
9810
|
" Corretas"
|
|
9478
9811
|
]
|
|
9479
9812
|
}
|
|
9480
9813
|
),
|
|
9481
|
-
/* @__PURE__ */ (0,
|
|
9814
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9482
9815
|
Badge_default,
|
|
9483
9816
|
{
|
|
9484
9817
|
action: "error",
|
|
9485
9818
|
variant: "solid",
|
|
9486
9819
|
size: "large",
|
|
9487
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
9820
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.XCircle, {}),
|
|
9488
9821
|
children: [
|
|
9489
9822
|
incorrect_answers,
|
|
9490
9823
|
" Incorretas"
|
|
@@ -9495,14 +9828,14 @@ var CardResults = (0, import_react32.forwardRef)(
|
|
|
9495
9828
|
]
|
|
9496
9829
|
}
|
|
9497
9830
|
),
|
|
9498
|
-
/* @__PURE__ */ (0,
|
|
9831
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
|
|
9499
9832
|
] })
|
|
9500
9833
|
]
|
|
9501
9834
|
}
|
|
9502
9835
|
);
|
|
9503
9836
|
}
|
|
9504
9837
|
);
|
|
9505
|
-
var CardStatus = (0,
|
|
9838
|
+
var CardStatus = (0, import_react33.forwardRef)(
|
|
9506
9839
|
({ header, className, status, label, ...props }, ref) => {
|
|
9507
9840
|
const getLabelBadge = (status2) => {
|
|
9508
9841
|
switch (status2) {
|
|
@@ -9521,13 +9854,13 @@ var CardStatus = (0, import_react32.forwardRef)(
|
|
|
9521
9854
|
const getIconBadge = (status2) => {
|
|
9522
9855
|
switch (status2) {
|
|
9523
9856
|
case "correct":
|
|
9524
|
-
return /* @__PURE__ */ (0,
|
|
9857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.CheckCircle, {});
|
|
9525
9858
|
case "incorrect":
|
|
9526
|
-
return /* @__PURE__ */ (0,
|
|
9859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.XCircle, {});
|
|
9527
9860
|
case "pending":
|
|
9528
|
-
return /* @__PURE__ */ (0,
|
|
9861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.Clock, {});
|
|
9529
9862
|
default:
|
|
9530
|
-
return /* @__PURE__ */ (0,
|
|
9863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.XCircle, {});
|
|
9531
9864
|
}
|
|
9532
9865
|
};
|
|
9533
9866
|
const getActionBadge = (status2) => {
|
|
@@ -9542,7 +9875,7 @@ var CardStatus = (0, import_react32.forwardRef)(
|
|
|
9542
9875
|
return "info";
|
|
9543
9876
|
}
|
|
9544
9877
|
};
|
|
9545
|
-
return /* @__PURE__ */ (0,
|
|
9878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9546
9879
|
CardBase,
|
|
9547
9880
|
{
|
|
9548
9881
|
ref,
|
|
@@ -9551,10 +9884,10 @@ var CardStatus = (0, import_react32.forwardRef)(
|
|
|
9551
9884
|
minHeight: "medium",
|
|
9552
9885
|
className: cn("items-center cursor-pointer", className),
|
|
9553
9886
|
...props,
|
|
9554
|
-
children: /* @__PURE__ */ (0,
|
|
9555
|
-
/* @__PURE__ */ (0,
|
|
9556
|
-
/* @__PURE__ */ (0,
|
|
9557
|
-
status && /* @__PURE__ */ (0,
|
|
9887
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
9888
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
9889
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
|
|
9890
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9558
9891
|
Badge_default,
|
|
9559
9892
|
{
|
|
9560
9893
|
action: getActionBadge(status),
|
|
@@ -9564,17 +9897,17 @@ var CardStatus = (0, import_react32.forwardRef)(
|
|
|
9564
9897
|
children: getLabelBadge(status)
|
|
9565
9898
|
}
|
|
9566
9899
|
),
|
|
9567
|
-
label && /* @__PURE__ */ (0,
|
|
9900
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm text-text-800", children: label })
|
|
9568
9901
|
] }),
|
|
9569
|
-
/* @__PURE__ */ (0,
|
|
9902
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
|
|
9570
9903
|
] })
|
|
9571
9904
|
}
|
|
9572
9905
|
);
|
|
9573
9906
|
}
|
|
9574
9907
|
);
|
|
9575
|
-
var CardSettings = (0,
|
|
9908
|
+
var CardSettings = (0, import_react33.forwardRef)(
|
|
9576
9909
|
({ header, className, icon, ...props }, ref) => {
|
|
9577
|
-
return /* @__PURE__ */ (0,
|
|
9910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9578
9911
|
CardBase,
|
|
9579
9912
|
{
|
|
9580
9913
|
ref,
|
|
@@ -9587,17 +9920,17 @@ var CardSettings = (0, import_react32.forwardRef)(
|
|
|
9587
9920
|
),
|
|
9588
9921
|
...props,
|
|
9589
9922
|
children: [
|
|
9590
|
-
/* @__PURE__ */ (0,
|
|
9591
|
-
/* @__PURE__ */ (0,
|
|
9592
|
-
/* @__PURE__ */ (0,
|
|
9923
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
|
|
9924
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "w-full text-sm truncate", children: header }),
|
|
9925
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.CaretRight, { size: 24, className: "cursor-pointer" })
|
|
9593
9926
|
]
|
|
9594
9927
|
}
|
|
9595
9928
|
);
|
|
9596
9929
|
}
|
|
9597
9930
|
);
|
|
9598
|
-
var CardSupport = (0,
|
|
9931
|
+
var CardSupport = (0, import_react33.forwardRef)(
|
|
9599
9932
|
({ header, className, direction = "col", children, ...props }, ref) => {
|
|
9600
|
-
return /* @__PURE__ */ (0,
|
|
9933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9601
9934
|
CardBase,
|
|
9602
9935
|
{
|
|
9603
9936
|
ref,
|
|
@@ -9610,7 +9943,7 @@ var CardSupport = (0, import_react32.forwardRef)(
|
|
|
9610
9943
|
),
|
|
9611
9944
|
...props,
|
|
9612
9945
|
children: [
|
|
9613
|
-
/* @__PURE__ */ (0,
|
|
9946
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9614
9947
|
"div",
|
|
9615
9948
|
{
|
|
9616
9949
|
className: cn(
|
|
@@ -9618,18 +9951,18 @@ var CardSupport = (0, import_react32.forwardRef)(
|
|
|
9618
9951
|
direction == "col" ? "flex-col" : "flex-row items-center"
|
|
9619
9952
|
),
|
|
9620
9953
|
children: [
|
|
9621
|
-
/* @__PURE__ */ (0,
|
|
9622
|
-
/* @__PURE__ */ (0,
|
|
9954
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
|
|
9955
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex flex-row gap-1", children })
|
|
9623
9956
|
]
|
|
9624
9957
|
}
|
|
9625
9958
|
),
|
|
9626
|
-
/* @__PURE__ */ (0,
|
|
9959
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
|
|
9627
9960
|
]
|
|
9628
9961
|
}
|
|
9629
9962
|
);
|
|
9630
9963
|
}
|
|
9631
9964
|
);
|
|
9632
|
-
var CardForum = (0,
|
|
9965
|
+
var CardForum = (0, import_react33.forwardRef)(
|
|
9633
9966
|
({
|
|
9634
9967
|
title,
|
|
9635
9968
|
content,
|
|
@@ -9643,7 +9976,7 @@ var CardForum = (0, import_react32.forwardRef)(
|
|
|
9643
9976
|
hour,
|
|
9644
9977
|
...props
|
|
9645
9978
|
}, ref) => {
|
|
9646
|
-
return /* @__PURE__ */ (0,
|
|
9979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9647
9980
|
CardBase,
|
|
9648
9981
|
{
|
|
9649
9982
|
ref,
|
|
@@ -9654,7 +9987,7 @@ var CardForum = (0, import_react32.forwardRef)(
|
|
|
9654
9987
|
className: cn("w-auto h-auto gap-3", className),
|
|
9655
9988
|
...props,
|
|
9656
9989
|
children: [
|
|
9657
|
-
/* @__PURE__ */ (0,
|
|
9990
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9658
9991
|
"button",
|
|
9659
9992
|
{
|
|
9660
9993
|
type: "button",
|
|
@@ -9663,18 +9996,18 @@ var CardForum = (0, import_react32.forwardRef)(
|
|
|
9663
9996
|
className: "min-w-8 h-8 rounded-full bg-background-950"
|
|
9664
9997
|
}
|
|
9665
9998
|
),
|
|
9666
|
-
/* @__PURE__ */ (0,
|
|
9667
|
-
/* @__PURE__ */ (0,
|
|
9668
|
-
/* @__PURE__ */ (0,
|
|
9669
|
-
/* @__PURE__ */ (0,
|
|
9999
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
10000
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
|
|
10001
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
|
|
10002
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { className: "text-xs text-text-600", children: [
|
|
9670
10003
|
"\u2022 ",
|
|
9671
10004
|
date,
|
|
9672
10005
|
" \u2022 ",
|
|
9673
10006
|
hour
|
|
9674
10007
|
] })
|
|
9675
10008
|
] }),
|
|
9676
|
-
/* @__PURE__ */ (0,
|
|
9677
|
-
/* @__PURE__ */ (0,
|
|
10009
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
|
|
10010
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9678
10011
|
"button",
|
|
9679
10012
|
{
|
|
9680
10013
|
type: "button",
|
|
@@ -9682,8 +10015,8 @@ var CardForum = (0, import_react32.forwardRef)(
|
|
|
9682
10015
|
onClick: () => onClickComments?.(valueComments),
|
|
9683
10016
|
className: "text-text-600 flex flex-row gap-2 items-center",
|
|
9684
10017
|
children: [
|
|
9685
|
-
/* @__PURE__ */ (0,
|
|
9686
|
-
/* @__PURE__ */ (0,
|
|
10018
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.ChatCircleText, { "aria-hidden": "true", size: 16 }),
|
|
10019
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { className: "text-xs", children: [
|
|
9687
10020
|
comments,
|
|
9688
10021
|
" respostas"
|
|
9689
10022
|
] })
|
|
@@ -9696,7 +10029,7 @@ var CardForum = (0, import_react32.forwardRef)(
|
|
|
9696
10029
|
);
|
|
9697
10030
|
}
|
|
9698
10031
|
);
|
|
9699
|
-
var CardAudio = (0,
|
|
10032
|
+
var CardAudio = (0, import_react33.forwardRef)(
|
|
9700
10033
|
({
|
|
9701
10034
|
src,
|
|
9702
10035
|
title,
|
|
@@ -9710,16 +10043,16 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9710
10043
|
className,
|
|
9711
10044
|
...props
|
|
9712
10045
|
}, ref) => {
|
|
9713
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
9714
|
-
const [currentTime, setCurrentTime] = (0,
|
|
9715
|
-
const [duration, setDuration] = (0,
|
|
9716
|
-
const [volume, setVolume] = (0,
|
|
9717
|
-
const [showVolumeControl, setShowVolumeControl] = (0,
|
|
9718
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
9719
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
9720
|
-
const audioRef = (0,
|
|
9721
|
-
const volumeControlRef = (0,
|
|
9722
|
-
const speedMenuRef = (0,
|
|
10046
|
+
const [isPlaying, setIsPlaying] = (0, import_react33.useState)(false);
|
|
10047
|
+
const [currentTime, setCurrentTime] = (0, import_react33.useState)(0);
|
|
10048
|
+
const [duration, setDuration] = (0, import_react33.useState)(0);
|
|
10049
|
+
const [volume, setVolume] = (0, import_react33.useState)(1);
|
|
10050
|
+
const [showVolumeControl, setShowVolumeControl] = (0, import_react33.useState)(false);
|
|
10051
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react33.useState)(false);
|
|
10052
|
+
const [playbackRate, setPlaybackRate] = (0, import_react33.useState)(1);
|
|
10053
|
+
const audioRef = (0, import_react33.useRef)(null);
|
|
10054
|
+
const volumeControlRef = (0, import_react33.useRef)(null);
|
|
10055
|
+
const speedMenuRef = (0, import_react33.useRef)(null);
|
|
9723
10056
|
const formatTime2 = (time) => {
|
|
9724
10057
|
const minutes = Math.floor(time / 60);
|
|
9725
10058
|
const seconds = Math.floor(time % 60);
|
|
@@ -9786,14 +10119,14 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9786
10119
|
};
|
|
9787
10120
|
const getVolumeIcon = () => {
|
|
9788
10121
|
if (volume === 0) {
|
|
9789
|
-
return /* @__PURE__ */ (0,
|
|
10122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.SpeakerSimpleX, { size: 24 });
|
|
9790
10123
|
}
|
|
9791
10124
|
if (volume < 0.5) {
|
|
9792
|
-
return /* @__PURE__ */ (0,
|
|
10125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.SpeakerLow, { size: 24 });
|
|
9793
10126
|
}
|
|
9794
|
-
return /* @__PURE__ */ (0,
|
|
10127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.SpeakerHigh, { size: 24 });
|
|
9795
10128
|
};
|
|
9796
|
-
(0,
|
|
10129
|
+
(0, import_react33.useEffect)(() => {
|
|
9797
10130
|
const handleClickOutside = (event) => {
|
|
9798
10131
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
9799
10132
|
setShowVolumeControl(false);
|
|
@@ -9807,7 +10140,7 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9807
10140
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
9808
10141
|
};
|
|
9809
10142
|
}, []);
|
|
9810
|
-
return /* @__PURE__ */ (0,
|
|
10143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9811
10144
|
CardBase,
|
|
9812
10145
|
{
|
|
9813
10146
|
ref,
|
|
@@ -9820,7 +10153,7 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9820
10153
|
),
|
|
9821
10154
|
...props,
|
|
9822
10155
|
children: [
|
|
9823
|
-
/* @__PURE__ */ (0,
|
|
10156
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9824
10157
|
"audio",
|
|
9825
10158
|
{
|
|
9826
10159
|
ref: audioRef,
|
|
@@ -9832,7 +10165,7 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9832
10165
|
onEnded: handleEnded,
|
|
9833
10166
|
"data-testid": "audio-element",
|
|
9834
10167
|
"aria-label": title,
|
|
9835
|
-
children: tracks ? tracks.map((track) => /* @__PURE__ */ (0,
|
|
10168
|
+
children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9836
10169
|
"track",
|
|
9837
10170
|
{
|
|
9838
10171
|
kind: track.kind,
|
|
@@ -9842,7 +10175,7 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9842
10175
|
default: track.default
|
|
9843
10176
|
},
|
|
9844
10177
|
track.src
|
|
9845
|
-
)) : /* @__PURE__ */ (0,
|
|
10178
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9846
10179
|
"track",
|
|
9847
10180
|
{
|
|
9848
10181
|
kind: "captions",
|
|
@@ -9853,7 +10186,7 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9853
10186
|
)
|
|
9854
10187
|
}
|
|
9855
10188
|
),
|
|
9856
|
-
/* @__PURE__ */ (0,
|
|
10189
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9857
10190
|
"button",
|
|
9858
10191
|
{
|
|
9859
10192
|
type: "button",
|
|
@@ -9861,14 +10194,14 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9861
10194
|
disabled: !src,
|
|
9862
10195
|
className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
|
|
9863
10196
|
"aria-label": isPlaying ? "Pausar" : "Reproduzir",
|
|
9864
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
9865
|
-
/* @__PURE__ */ (0,
|
|
9866
|
-
/* @__PURE__ */ (0,
|
|
9867
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
10197
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex gap-0.5", children: [
|
|
10198
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
|
|
10199
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
|
|
10200
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.Play, { size: 24 })
|
|
9868
10201
|
}
|
|
9869
10202
|
),
|
|
9870
|
-
/* @__PURE__ */ (0,
|
|
9871
|
-
/* @__PURE__ */ (0,
|
|
10203
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
|
|
10204
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9872
10205
|
"button",
|
|
9873
10206
|
{
|
|
9874
10207
|
type: "button",
|
|
@@ -9883,7 +10216,7 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9883
10216
|
}
|
|
9884
10217
|
},
|
|
9885
10218
|
"aria-label": "Barra de progresso do \xE1udio",
|
|
9886
|
-
children: /* @__PURE__ */ (0,
|
|
10219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9887
10220
|
"div",
|
|
9888
10221
|
{
|
|
9889
10222
|
className: "h-full bg-primary-600 rounded-full transition-all duration-100",
|
|
@@ -9894,19 +10227,19 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9894
10227
|
)
|
|
9895
10228
|
}
|
|
9896
10229
|
) }),
|
|
9897
|
-
/* @__PURE__ */ (0,
|
|
9898
|
-
/* @__PURE__ */ (0,
|
|
9899
|
-
/* @__PURE__ */ (0,
|
|
10230
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
|
|
10231
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "relative h-6", ref: volumeControlRef, children: [
|
|
10232
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9900
10233
|
"button",
|
|
9901
10234
|
{
|
|
9902
10235
|
type: "button",
|
|
9903
10236
|
onClick: toggleVolumeControl,
|
|
9904
10237
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
9905
10238
|
"aria-label": "Controle de volume",
|
|
9906
|
-
children: /* @__PURE__ */ (0,
|
|
10239
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
|
|
9907
10240
|
}
|
|
9908
10241
|
),
|
|
9909
|
-
showVolumeControl && /* @__PURE__ */ (0,
|
|
10242
|
+
showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9910
10243
|
"button",
|
|
9911
10244
|
{
|
|
9912
10245
|
type: "button",
|
|
@@ -9916,7 +10249,7 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9916
10249
|
setShowVolumeControl(false);
|
|
9917
10250
|
}
|
|
9918
10251
|
},
|
|
9919
|
-
children: /* @__PURE__ */ (0,
|
|
10252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9920
10253
|
"input",
|
|
9921
10254
|
{
|
|
9922
10255
|
type: "range",
|
|
@@ -9957,22 +10290,22 @@ var CardAudio = (0, import_react32.forwardRef)(
|
|
|
9957
10290
|
}
|
|
9958
10291
|
)
|
|
9959
10292
|
] }),
|
|
9960
|
-
/* @__PURE__ */ (0,
|
|
9961
|
-
/* @__PURE__ */ (0,
|
|
10293
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "relative h-6", ref: speedMenuRef, children: [
|
|
10294
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9962
10295
|
"button",
|
|
9963
10296
|
{
|
|
9964
10297
|
type: "button",
|
|
9965
10298
|
onClick: toggleSpeedMenu,
|
|
9966
10299
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
9967
10300
|
"aria-label": "Op\xE7\xF5es de velocidade",
|
|
9968
|
-
children: /* @__PURE__ */ (0,
|
|
10301
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.DotsThreeVertical, { size: 24 })
|
|
9969
10302
|
}
|
|
9970
10303
|
),
|
|
9971
|
-
showSpeedMenu && /* @__PURE__ */ (0,
|
|
10304
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime53.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_runtime53.jsx)("div", { className: "flex flex-col gap-1", children: [
|
|
9972
10305
|
{ speed: 1, label: "1x" },
|
|
9973
10306
|
{ speed: 1.5, label: "1.5x" },
|
|
9974
10307
|
{ speed: 2, label: "2x" }
|
|
9975
|
-
].map(({ speed, label }) => /* @__PURE__ */ (0,
|
|
10308
|
+
].map(({ speed, label }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9976
10309
|
"button",
|
|
9977
10310
|
{
|
|
9978
10311
|
type: "button",
|
|
@@ -9997,10 +10330,10 @@ var SIMULADO_BACKGROUND_CLASSES = {
|
|
|
9997
10330
|
simuladao: "bg-exam-3",
|
|
9998
10331
|
vestibular: "bg-exam-4"
|
|
9999
10332
|
};
|
|
10000
|
-
var CardSimulado = (0,
|
|
10333
|
+
var CardSimulado = (0, import_react33.forwardRef)(
|
|
10001
10334
|
({ title, duration, info, backgroundColor, className, ...props }, ref) => {
|
|
10002
10335
|
const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
|
|
10003
|
-
return /* @__PURE__ */ (0,
|
|
10336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10004
10337
|
CardBase,
|
|
10005
10338
|
{
|
|
10006
10339
|
ref,
|
|
@@ -10013,19 +10346,19 @@ var CardSimulado = (0, import_react32.forwardRef)(
|
|
|
10013
10346
|
className
|
|
10014
10347
|
),
|
|
10015
10348
|
...props,
|
|
10016
|
-
children: /* @__PURE__ */ (0,
|
|
10017
|
-
/* @__PURE__ */ (0,
|
|
10018
|
-
/* @__PURE__ */ (0,
|
|
10019
|
-
/* @__PURE__ */ (0,
|
|
10020
|
-
duration && /* @__PURE__ */ (0,
|
|
10021
|
-
/* @__PURE__ */ (0,
|
|
10022
|
-
/* @__PURE__ */ (0,
|
|
10349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
|
|
10350
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
10351
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
|
|
10352
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-4 text-text-700", children: [
|
|
10353
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
10354
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.Clock, { size: 16, className: "flex-shrink-0" }),
|
|
10355
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text_default, { size: "sm", children: duration })
|
|
10023
10356
|
] }),
|
|
10024
|
-
/* @__PURE__ */ (0,
|
|
10357
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text_default, { size: "sm", className: "truncate", children: info })
|
|
10025
10358
|
] })
|
|
10026
10359
|
] }),
|
|
10027
|
-
/* @__PURE__ */ (0,
|
|
10028
|
-
|
|
10360
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10361
|
+
import_phosphor_react24.CaretRight,
|
|
10029
10362
|
{
|
|
10030
10363
|
size: 24,
|
|
10031
10364
|
className: "text-text-800 flex-shrink-0",
|
|
@@ -10037,7 +10370,7 @@ var CardSimulado = (0, import_react32.forwardRef)(
|
|
|
10037
10370
|
);
|
|
10038
10371
|
}
|
|
10039
10372
|
);
|
|
10040
|
-
var CardTest = (0,
|
|
10373
|
+
var CardTest = (0, import_react33.forwardRef)(
|
|
10041
10374
|
({
|
|
10042
10375
|
title,
|
|
10043
10376
|
duration,
|
|
@@ -10069,7 +10402,7 @@ var CardTest = (0, import_react32.forwardRef)(
|
|
|
10069
10402
|
const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
|
|
10070
10403
|
const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
|
|
10071
10404
|
if (isSelectable) {
|
|
10072
|
-
return /* @__PURE__ */ (0,
|
|
10405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10073
10406
|
"button",
|
|
10074
10407
|
{
|
|
10075
10408
|
ref,
|
|
@@ -10081,8 +10414,8 @@ var CardTest = (0, import_react32.forwardRef)(
|
|
|
10081
10414
|
onKeyDown: handleKeyDown,
|
|
10082
10415
|
"aria-pressed": selected,
|
|
10083
10416
|
...props,
|
|
10084
|
-
children: /* @__PURE__ */ (0,
|
|
10085
|
-
/* @__PURE__ */ (0,
|
|
10417
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
10418
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10086
10419
|
Text_default,
|
|
10087
10420
|
{
|
|
10088
10421
|
size: "md",
|
|
@@ -10091,10 +10424,10 @@ var CardTest = (0, import_react32.forwardRef)(
|
|
|
10091
10424
|
children: title
|
|
10092
10425
|
}
|
|
10093
10426
|
),
|
|
10094
|
-
/* @__PURE__ */ (0,
|
|
10095
|
-
duration && /* @__PURE__ */ (0,
|
|
10096
|
-
/* @__PURE__ */ (0,
|
|
10097
|
-
/* @__PURE__ */ (0,
|
|
10427
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
10428
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
10429
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.Clock, { size: 16, className: "text-text-700" }),
|
|
10430
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10098
10431
|
Text_default,
|
|
10099
10432
|
{
|
|
10100
10433
|
size: "sm",
|
|
@@ -10103,7 +10436,7 @@ var CardTest = (0, import_react32.forwardRef)(
|
|
|
10103
10436
|
}
|
|
10104
10437
|
)
|
|
10105
10438
|
] }),
|
|
10106
|
-
/* @__PURE__ */ (0,
|
|
10439
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10107
10440
|
Text_default,
|
|
10108
10441
|
{
|
|
10109
10442
|
size: "sm",
|
|
@@ -10116,14 +10449,14 @@ var CardTest = (0, import_react32.forwardRef)(
|
|
|
10116
10449
|
}
|
|
10117
10450
|
);
|
|
10118
10451
|
}
|
|
10119
|
-
return /* @__PURE__ */ (0,
|
|
10452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10120
10453
|
"div",
|
|
10121
10454
|
{
|
|
10122
10455
|
ref,
|
|
10123
10456
|
className: cn(`${baseClasses} ${className}`.trim()),
|
|
10124
10457
|
...props,
|
|
10125
|
-
children: /* @__PURE__ */ (0,
|
|
10126
|
-
/* @__PURE__ */ (0,
|
|
10458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
10459
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10127
10460
|
Text_default,
|
|
10128
10461
|
{
|
|
10129
10462
|
size: "md",
|
|
@@ -10132,10 +10465,10 @@ var CardTest = (0, import_react32.forwardRef)(
|
|
|
10132
10465
|
children: title
|
|
10133
10466
|
}
|
|
10134
10467
|
),
|
|
10135
|
-
/* @__PURE__ */ (0,
|
|
10136
|
-
duration && /* @__PURE__ */ (0,
|
|
10137
|
-
/* @__PURE__ */ (0,
|
|
10138
|
-
/* @__PURE__ */ (0,
|
|
10468
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
10469
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
10470
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_phosphor_react24.Clock, { size: 16, className: "text-text-700" }),
|
|
10471
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10139
10472
|
Text_default,
|
|
10140
10473
|
{
|
|
10141
10474
|
size: "sm",
|
|
@@ -10144,7 +10477,7 @@ var CardTest = (0, import_react32.forwardRef)(
|
|
|
10144
10477
|
}
|
|
10145
10478
|
)
|
|
10146
10479
|
] }),
|
|
10147
|
-
/* @__PURE__ */ (0,
|
|
10480
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10148
10481
|
Text_default,
|
|
10149
10482
|
{
|
|
10150
10483
|
size: "sm",
|
|
@@ -10180,15 +10513,15 @@ var SIMULATION_TYPE_STYLES = {
|
|
|
10180
10513
|
text: "Vestibular"
|
|
10181
10514
|
}
|
|
10182
10515
|
};
|
|
10183
|
-
var CardSimulationHistory = (0,
|
|
10184
|
-
return /* @__PURE__ */ (0,
|
|
10516
|
+
var CardSimulationHistory = (0, import_react33.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
|
|
10517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10185
10518
|
"div",
|
|
10186
10519
|
{
|
|
10187
10520
|
ref,
|
|
10188
10521
|
className: cn("w-full max-w-[992px] h-auto", className),
|
|
10189
10522
|
...props,
|
|
10190
|
-
children: /* @__PURE__ */ (0,
|
|
10191
|
-
data.map((section, sectionIndex) => /* @__PURE__ */ (0,
|
|
10523
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
10524
|
+
data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
10192
10525
|
"div",
|
|
10193
10526
|
{
|
|
10194
10527
|
className: cn(
|
|
@@ -10196,7 +10529,7 @@ var CardSimulationHistory = (0, import_react32.forwardRef)(({ data, onSimulation
|
|
|
10196
10529
|
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
10197
10530
|
),
|
|
10198
10531
|
children: [
|
|
10199
|
-
/* @__PURE__ */ (0,
|
|
10532
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10200
10533
|
Text_default,
|
|
10201
10534
|
{
|
|
10202
10535
|
size: "xs",
|
|
@@ -10205,9 +10538,9 @@ var CardSimulationHistory = (0, import_react32.forwardRef)(({ data, onSimulation
|
|
|
10205
10538
|
children: section.date
|
|
10206
10539
|
}
|
|
10207
10540
|
),
|
|
10208
|
-
/* @__PURE__ */ (0,
|
|
10541
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
|
|
10209
10542
|
const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
|
|
10210
|
-
return /* @__PURE__ */ (0,
|
|
10543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10211
10544
|
CardBase,
|
|
10212
10545
|
{
|
|
10213
10546
|
layout: "horizontal",
|
|
@@ -10219,9 +10552,9 @@ var CardSimulationHistory = (0, import_react32.forwardRef)(({ data, onSimulation
|
|
|
10219
10552
|
transition-shadow duration-200 h-auto min-h-[61px]`
|
|
10220
10553
|
),
|
|
10221
10554
|
onClick: () => onSimulationClick?.(simulation),
|
|
10222
|
-
children: /* @__PURE__ */ (0,
|
|
10223
|
-
/* @__PURE__ */ (0,
|
|
10224
|
-
/* @__PURE__ */ (0,
|
|
10555
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
10556
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
|
|
10557
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10225
10558
|
Text_default,
|
|
10226
10559
|
{
|
|
10227
10560
|
size: "lg",
|
|
@@ -10230,8 +10563,8 @@ var CardSimulationHistory = (0, import_react32.forwardRef)(({ data, onSimulation
|
|
|
10230
10563
|
children: simulation.title
|
|
10231
10564
|
}
|
|
10232
10565
|
),
|
|
10233
|
-
/* @__PURE__ */ (0,
|
|
10234
|
-
/* @__PURE__ */ (0,
|
|
10566
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10567
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10235
10568
|
Badge_default,
|
|
10236
10569
|
{
|
|
10237
10570
|
variant: "examsOutlined",
|
|
@@ -10240,11 +10573,11 @@ var CardSimulationHistory = (0, import_react32.forwardRef)(({ data, onSimulation
|
|
|
10240
10573
|
children: typeStyles.text
|
|
10241
10574
|
}
|
|
10242
10575
|
),
|
|
10243
|
-
/* @__PURE__ */ (0,
|
|
10576
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
|
|
10244
10577
|
] })
|
|
10245
10578
|
] }),
|
|
10246
|
-
/* @__PURE__ */ (0,
|
|
10247
|
-
|
|
10579
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
10580
|
+
import_phosphor_react24.CaretRight,
|
|
10248
10581
|
{
|
|
10249
10582
|
size: 24,
|
|
10250
10583
|
className: "text-text-800 flex-shrink-0",
|
|
@@ -10259,15 +10592,15 @@ var CardSimulationHistory = (0, import_react32.forwardRef)(({ data, onSimulation
|
|
|
10259
10592
|
]
|
|
10260
10593
|
}
|
|
10261
10594
|
) }, section.date)),
|
|
10262
|
-
data.length > 0 && /* @__PURE__ */ (0,
|
|
10595
|
+
data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
|
|
10263
10596
|
] })
|
|
10264
10597
|
}
|
|
10265
10598
|
);
|
|
10266
10599
|
});
|
|
10267
10600
|
|
|
10268
10601
|
// src/components/StatisticsCard/StatisticsCard.tsx
|
|
10269
|
-
var
|
|
10270
|
-
var
|
|
10602
|
+
var import_phosphor_react25 = require("phosphor-react");
|
|
10603
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
10271
10604
|
var VARIANT_STYLES = {
|
|
10272
10605
|
high: "bg-success-background",
|
|
10273
10606
|
medium: "bg-warning-background",
|
|
@@ -10281,12 +10614,12 @@ var VALUE_TEXT_COLORS = {
|
|
|
10281
10614
|
total: "text-info-700"
|
|
10282
10615
|
};
|
|
10283
10616
|
var StatCard = ({ item, showPlaceholder = false }) => {
|
|
10284
|
-
return /* @__PURE__ */ (0,
|
|
10617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
10285
10618
|
"div",
|
|
10286
10619
|
{
|
|
10287
10620
|
className: `rounded-xl py-[17px] px-6 min-h-[105px] flex flex-col justify-center items-start gap-1 ${VARIANT_STYLES[item.variant]}`,
|
|
10288
10621
|
children: [
|
|
10289
|
-
/* @__PURE__ */ (0,
|
|
10622
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10290
10623
|
Text_default,
|
|
10291
10624
|
{
|
|
10292
10625
|
size: "4xl",
|
|
@@ -10295,7 +10628,7 @@ var StatCard = ({ item, showPlaceholder = false }) => {
|
|
|
10295
10628
|
children: showPlaceholder ? "-" : item.value
|
|
10296
10629
|
}
|
|
10297
10630
|
),
|
|
10298
|
-
/* @__PURE__ */ (0,
|
|
10631
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10299
10632
|
Text_default,
|
|
10300
10633
|
{
|
|
10301
10634
|
size: "xs",
|
|
@@ -10330,13 +10663,13 @@ var StatisticsCard = ({
|
|
|
10330
10663
|
}) => {
|
|
10331
10664
|
const hasData = data && data.length > 0;
|
|
10332
10665
|
const gridColumnsClass = hasData ? getGridColumnsClass(data.length) : "";
|
|
10333
|
-
return /* @__PURE__ */ (0,
|
|
10666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
10334
10667
|
"div",
|
|
10335
10668
|
{
|
|
10336
10669
|
className: `bg-background rounded-xl p-4 h-auto lg:h-[185px] flex flex-col gap-2 ${className}`,
|
|
10337
10670
|
children: [
|
|
10338
|
-
/* @__PURE__ */ (0,
|
|
10339
|
-
/* @__PURE__ */ (0,
|
|
10671
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-row justify-between items-center gap-4", children: [
|
|
10672
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10340
10673
|
Text_default,
|
|
10341
10674
|
{
|
|
10342
10675
|
as: "h3",
|
|
@@ -10347,22 +10680,22 @@ var StatisticsCard = ({
|
|
|
10347
10680
|
children: title
|
|
10348
10681
|
}
|
|
10349
10682
|
),
|
|
10350
|
-
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */ (0,
|
|
10683
|
+
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "w-[120px] min-w-[90px] sm:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
10351
10684
|
Select_default,
|
|
10352
10685
|
{
|
|
10353
10686
|
value: selectedDropdownValue,
|
|
10354
10687
|
onValueChange: onDropdownChange,
|
|
10355
10688
|
size: "medium",
|
|
10356
10689
|
children: [
|
|
10357
|
-
/* @__PURE__ */ (0,
|
|
10690
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10358
10691
|
SelectTrigger,
|
|
10359
10692
|
{
|
|
10360
10693
|
className: "border border-border-300 rounded [&>span]:whitespace-nowrap [&>span]:overflow-hidden [&>span]:text-ellipsis",
|
|
10361
10694
|
"aria-label": dropdownAriaLabel,
|
|
10362
|
-
children: /* @__PURE__ */ (0,
|
|
10695
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder: selectPlaceholder })
|
|
10363
10696
|
}
|
|
10364
10697
|
),
|
|
10365
|
-
/* @__PURE__ */ (0,
|
|
10698
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectContent, { className: "min-w-[120px]", children: dropdownOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10366
10699
|
SelectItem,
|
|
10367
10700
|
{
|
|
10368
10701
|
value: option.value,
|
|
@@ -10375,11 +10708,11 @@ var StatisticsCard = ({
|
|
|
10375
10708
|
}
|
|
10376
10709
|
) })
|
|
10377
10710
|
] }),
|
|
10378
|
-
hasData ? /* @__PURE__ */ (0,
|
|
10711
|
+
hasData ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10379
10712
|
"div",
|
|
10380
10713
|
{
|
|
10381
10714
|
className: `grid grid-cols-1 sm:grid-cols-2 gap-[13px] ${gridColumnsClass}`,
|
|
10382
|
-
children: data.map((item, index) => /* @__PURE__ */ (0,
|
|
10715
|
+
children: data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10383
10716
|
StatCard,
|
|
10384
10717
|
{
|
|
10385
10718
|
item,
|
|
@@ -10388,8 +10721,8 @@ var StatisticsCard = ({
|
|
|
10388
10721
|
`${item.variant}-${item.label}-${index}`
|
|
10389
10722
|
))
|
|
10390
10723
|
}
|
|
10391
|
-
) : /* @__PURE__ */ (0,
|
|
10392
|
-
/* @__PURE__ */ (0,
|
|
10724
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime54.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: [
|
|
10725
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10393
10726
|
Text_default,
|
|
10394
10727
|
{
|
|
10395
10728
|
size: "sm",
|
|
@@ -10398,14 +10731,14 @@ var StatisticsCard = ({
|
|
|
10398
10731
|
children: emptyStateMessage
|
|
10399
10732
|
}
|
|
10400
10733
|
),
|
|
10401
|
-
onEmptyStateButtonClick && /* @__PURE__ */ (0,
|
|
10734
|
+
onEmptyStateButtonClick && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
10402
10735
|
Button_default,
|
|
10403
10736
|
{
|
|
10404
10737
|
variant: "outline",
|
|
10405
10738
|
action: "primary",
|
|
10406
10739
|
size: "small",
|
|
10407
10740
|
onClick: onEmptyStateButtonClick,
|
|
10408
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
10741
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_phosphor_react25.Plus, { size: 16, weight: "bold" }),
|
|
10409
10742
|
children: emptyStateButtonText
|
|
10410
10743
|
}
|
|
10411
10744
|
)
|
|
@@ -10416,7 +10749,7 @@ var StatisticsCard = ({
|
|
|
10416
10749
|
};
|
|
10417
10750
|
|
|
10418
10751
|
// src/components/NotFound/NotFound.tsx
|
|
10419
|
-
var
|
|
10752
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
10420
10753
|
var NotFound = ({
|
|
10421
10754
|
title,
|
|
10422
10755
|
description,
|
|
@@ -10459,22 +10792,22 @@ var NotFound = ({
|
|
|
10459
10792
|
const errorTitle = title || getDefaultTitle();
|
|
10460
10793
|
const errorDescription = description || getDefaultDescription();
|
|
10461
10794
|
const errorCode = getErrorCode();
|
|
10462
|
-
return /* @__PURE__ */ (0,
|
|
10795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10463
10796
|
"div",
|
|
10464
10797
|
{
|
|
10465
10798
|
className: cn(
|
|
10466
10799
|
"flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4",
|
|
10467
10800
|
className
|
|
10468
10801
|
),
|
|
10469
|
-
children: /* @__PURE__ */ (0,
|
|
10802
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10470
10803
|
"main",
|
|
10471
10804
|
{
|
|
10472
10805
|
role: "main",
|
|
10473
10806
|
"aria-labelledby": "error-title",
|
|
10474
10807
|
"aria-describedby": "error-description",
|
|
10475
10808
|
className: "flex flex-col items-center text-center max-w-md space-y-6",
|
|
10476
|
-
children: /* @__PURE__ */ (0,
|
|
10477
|
-
/* @__PURE__ */ (0,
|
|
10809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { "aria-label": `Erro ${errorCode}`, children: [
|
|
10810
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10478
10811
|
"div",
|
|
10479
10812
|
{
|
|
10480
10813
|
className: "text-8xl font-bold text-primary-300 select-none",
|
|
@@ -10482,8 +10815,8 @@ var NotFound = ({
|
|
|
10482
10815
|
children: errorCode
|
|
10483
10816
|
}
|
|
10484
10817
|
),
|
|
10485
|
-
/* @__PURE__ */ (0,
|
|
10486
|
-
/* @__PURE__ */ (0,
|
|
10818
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { className: "space-y-2", children: [
|
|
10819
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10487
10820
|
Text_default,
|
|
10488
10821
|
{
|
|
10489
10822
|
size: "xl",
|
|
@@ -10494,9 +10827,9 @@ var NotFound = ({
|
|
|
10494
10827
|
children: errorTitle
|
|
10495
10828
|
}
|
|
10496
10829
|
),
|
|
10497
|
-
/* @__PURE__ */ (0,
|
|
10830
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Text_default, { size: "md", className: "text-text-600", id: "error-description", children: errorDescription })
|
|
10498
10831
|
] }),
|
|
10499
|
-
onButtonClick && /* @__PURE__ */ (0,
|
|
10832
|
+
onButtonClick && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("nav", { "aria-label": "Navega\xE7\xE3o de erro", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
10500
10833
|
Button_default,
|
|
10501
10834
|
{
|
|
10502
10835
|
onClick: handleButtonClick,
|
|
@@ -10517,14 +10850,14 @@ var NotFound = ({
|
|
|
10517
10850
|
var NotFound_default = NotFound;
|
|
10518
10851
|
|
|
10519
10852
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
10520
|
-
var
|
|
10853
|
+
var import_react35 = require("react");
|
|
10521
10854
|
var import_react_dom = require("react-dom");
|
|
10522
|
-
var
|
|
10855
|
+
var import_phosphor_react27 = require("phosphor-react");
|
|
10523
10856
|
|
|
10524
10857
|
// src/components/DownloadButton/DownloadButton.tsx
|
|
10525
|
-
var
|
|
10526
|
-
var
|
|
10527
|
-
var
|
|
10858
|
+
var import_react34 = require("react");
|
|
10859
|
+
var import_phosphor_react26 = require("phosphor-react");
|
|
10860
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
10528
10861
|
var getMimeType = (url) => {
|
|
10529
10862
|
const extension = getFileExtension(url);
|
|
10530
10863
|
const mimeTypes = {
|
|
@@ -10599,13 +10932,13 @@ var DownloadButton = ({
|
|
|
10599
10932
|
lessonTitle = "aula",
|
|
10600
10933
|
disabled = false
|
|
10601
10934
|
}) => {
|
|
10602
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
10603
|
-
const isValidUrl = (0,
|
|
10935
|
+
const [isDownloading, setIsDownloading] = (0, import_react34.useState)(false);
|
|
10936
|
+
const isValidUrl = (0, import_react34.useCallback)((url) => {
|
|
10604
10937
|
return Boolean(
|
|
10605
10938
|
url && url.trim() !== "" && url !== "undefined" && url !== "null"
|
|
10606
10939
|
);
|
|
10607
10940
|
}, []);
|
|
10608
|
-
const getAvailableContent = (0,
|
|
10941
|
+
const getAvailableContent = (0, import_react34.useCallback)(() => {
|
|
10609
10942
|
const downloads = [];
|
|
10610
10943
|
if (isValidUrl(content.urlDoc)) {
|
|
10611
10944
|
downloads.push({
|
|
@@ -10640,7 +10973,7 @@ var DownloadButton = ({
|
|
|
10640
10973
|
}
|
|
10641
10974
|
return downloads;
|
|
10642
10975
|
}, [content, isValidUrl]);
|
|
10643
|
-
const handleDownload = (0,
|
|
10976
|
+
const handleDownload = (0, import_react34.useCallback)(async () => {
|
|
10644
10977
|
if (disabled || isDownloading) return;
|
|
10645
10978
|
const availableContent = getAvailableContent();
|
|
10646
10979
|
if (availableContent.length === 0) {
|
|
@@ -10681,10 +11014,10 @@ var DownloadButton = ({
|
|
|
10681
11014
|
if (!hasContent) {
|
|
10682
11015
|
return null;
|
|
10683
11016
|
}
|
|
10684
|
-
return /* @__PURE__ */ (0,
|
|
11017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: cn("flex items-center", className), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10685
11018
|
IconButton_default,
|
|
10686
11019
|
{
|
|
10687
|
-
icon: /* @__PURE__ */ (0,
|
|
11020
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_phosphor_react26.DownloadSimple, { size: 24 }),
|
|
10688
11021
|
onClick: handleDownload,
|
|
10689
11022
|
disabled: disabled || isDownloading,
|
|
10690
11023
|
"aria-label": (() => {
|
|
@@ -10705,7 +11038,7 @@ var DownloadButton = ({
|
|
|
10705
11038
|
var DownloadButton_default = DownloadButton;
|
|
10706
11039
|
|
|
10707
11040
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
10708
|
-
var
|
|
11041
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
10709
11042
|
var CONTROLS_HIDE_TIMEOUT = 3e3;
|
|
10710
11043
|
var LEAVE_HIDE_TIMEOUT = 1e3;
|
|
10711
11044
|
var INIT_DELAY = 100;
|
|
@@ -10721,7 +11054,7 @@ var ProgressBar2 = ({
|
|
|
10721
11054
|
progressPercentage,
|
|
10722
11055
|
onSeek,
|
|
10723
11056
|
className = "px-4 pb-2"
|
|
10724
|
-
}) => /* @__PURE__ */ (0,
|
|
11057
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10725
11058
|
"input",
|
|
10726
11059
|
{
|
|
10727
11060
|
type: "range",
|
|
@@ -10743,17 +11076,17 @@ var VolumeControls = ({
|
|
|
10743
11076
|
onToggleMute,
|
|
10744
11077
|
iconSize = 24,
|
|
10745
11078
|
showSlider = true
|
|
10746
|
-
}) => /* @__PURE__ */ (0,
|
|
10747
|
-
/* @__PURE__ */ (0,
|
|
11079
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11080
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10748
11081
|
IconButton_default,
|
|
10749
11082
|
{
|
|
10750
|
-
icon: isMuted ? /* @__PURE__ */ (0,
|
|
11083
|
+
icon: isMuted ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.SpeakerSlash, { size: iconSize }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.SpeakerHigh, { size: iconSize }),
|
|
10751
11084
|
onClick: onToggleMute,
|
|
10752
11085
|
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
10753
11086
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
10754
11087
|
}
|
|
10755
11088
|
),
|
|
10756
|
-
showSlider && /* @__PURE__ */ (0,
|
|
11089
|
+
showSlider && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10757
11090
|
"input",
|
|
10758
11091
|
{
|
|
10759
11092
|
type: "range",
|
|
@@ -10778,9 +11111,9 @@ var SpeedMenu = ({
|
|
|
10778
11111
|
iconSize = 24,
|
|
10779
11112
|
isTinyMobile = false
|
|
10780
11113
|
}) => {
|
|
10781
|
-
const buttonRef = (0,
|
|
10782
|
-
const speedMenuContainerRef = (0,
|
|
10783
|
-
const speedMenuRef = (0,
|
|
11114
|
+
const buttonRef = (0, import_react35.useRef)(null);
|
|
11115
|
+
const speedMenuContainerRef = (0, import_react35.useRef)(null);
|
|
11116
|
+
const speedMenuRef = (0, import_react35.useRef)(null);
|
|
10784
11117
|
const getMenuPosition = () => {
|
|
10785
11118
|
if (!buttonRef.current) return { top: 0, left: 0 };
|
|
10786
11119
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
@@ -10794,7 +11127,7 @@ var SpeedMenu = ({
|
|
|
10794
11127
|
};
|
|
10795
11128
|
};
|
|
10796
11129
|
const position = getMenuPosition();
|
|
10797
|
-
(0,
|
|
11130
|
+
(0, import_react35.useEffect)(() => {
|
|
10798
11131
|
const handleClickOutside = (event) => {
|
|
10799
11132
|
const target = event.target;
|
|
10800
11133
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -10810,7 +11143,7 @@ var SpeedMenu = ({
|
|
|
10810
11143
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
10811
11144
|
};
|
|
10812
11145
|
}, [showSpeedMenu, onToggleMenu]);
|
|
10813
|
-
const menuContent = /* @__PURE__ */ (0,
|
|
11146
|
+
const menuContent = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10814
11147
|
"div",
|
|
10815
11148
|
{
|
|
10816
11149
|
ref: speedMenuRef,
|
|
@@ -10821,7 +11154,7 @@ var SpeedMenu = ({
|
|
|
10821
11154
|
top: `${position.top}px`,
|
|
10822
11155
|
left: `${position.left}px`
|
|
10823
11156
|
},
|
|
10824
|
-
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0,
|
|
11157
|
+
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
10825
11158
|
"button",
|
|
10826
11159
|
{
|
|
10827
11160
|
role: "menuitemradio",
|
|
@@ -10838,12 +11171,12 @@ var SpeedMenu = ({
|
|
|
10838
11171
|
}
|
|
10839
11172
|
);
|
|
10840
11173
|
const portalContent = showSpeedMenu && globalThis.window !== void 0 && globalThis.document !== void 0 && !!globalThis.document?.body ? (0, import_react_dom.createPortal)(menuContent, globalThis.document.body) : null;
|
|
10841
|
-
return /* @__PURE__ */ (0,
|
|
10842
|
-
/* @__PURE__ */ (0,
|
|
11174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "relative", ref: speedMenuContainerRef, children: [
|
|
11175
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10843
11176
|
IconButton_default,
|
|
10844
11177
|
{
|
|
10845
11178
|
ref: buttonRef,
|
|
10846
|
-
icon: /* @__PURE__ */ (0,
|
|
11179
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.DotsThreeVertical, { size: iconSize }),
|
|
10847
11180
|
onClick: onToggleMenu,
|
|
10848
11181
|
"aria-label": "Playback speed",
|
|
10849
11182
|
"aria-haspopup": "menu",
|
|
@@ -10873,28 +11206,28 @@ var VideoPlayer = ({
|
|
|
10873
11206
|
onDownloadComplete,
|
|
10874
11207
|
onDownloadError
|
|
10875
11208
|
}) => {
|
|
10876
|
-
const videoRef = (0,
|
|
11209
|
+
const videoRef = (0, import_react35.useRef)(null);
|
|
10877
11210
|
const { isUltraSmallMobile, isTinyMobile } = useMobile();
|
|
10878
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
10879
|
-
const [currentTime, setCurrentTime] = (0,
|
|
10880
|
-
const [duration, setDuration] = (0,
|
|
10881
|
-
const [isMuted, setIsMuted] = (0,
|
|
10882
|
-
const [volume, setVolume] = (0,
|
|
10883
|
-
const [isFullscreen, setIsFullscreen] = (0,
|
|
10884
|
-
const [showControls, setShowControls] = (0,
|
|
10885
|
-
const [hasCompleted, setHasCompleted] = (0,
|
|
10886
|
-
const [showCaptions, setShowCaptions] = (0,
|
|
10887
|
-
const [subtitlesValidation, setSubtitlesValidation] = (0,
|
|
10888
|
-
(0,
|
|
11211
|
+
const [isPlaying, setIsPlaying] = (0, import_react35.useState)(false);
|
|
11212
|
+
const [currentTime, setCurrentTime] = (0, import_react35.useState)(0);
|
|
11213
|
+
const [duration, setDuration] = (0, import_react35.useState)(0);
|
|
11214
|
+
const [isMuted, setIsMuted] = (0, import_react35.useState)(false);
|
|
11215
|
+
const [volume, setVolume] = (0, import_react35.useState)(1);
|
|
11216
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react35.useState)(false);
|
|
11217
|
+
const [showControls, setShowControls] = (0, import_react35.useState)(true);
|
|
11218
|
+
const [hasCompleted, setHasCompleted] = (0, import_react35.useState)(false);
|
|
11219
|
+
const [showCaptions, setShowCaptions] = (0, import_react35.useState)(false);
|
|
11220
|
+
const [subtitlesValidation, setSubtitlesValidation] = (0, import_react35.useState)("idle");
|
|
11221
|
+
(0, import_react35.useEffect)(() => {
|
|
10889
11222
|
setHasCompleted(false);
|
|
10890
11223
|
}, [src]);
|
|
10891
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
10892
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
10893
|
-
const lastSaveTimeRef = (0,
|
|
10894
|
-
const trackRef = (0,
|
|
10895
|
-
const controlsTimeoutRef = (0,
|
|
10896
|
-
const lastMousePositionRef = (0,
|
|
10897
|
-
const isUserInteracting = (0,
|
|
11224
|
+
const [playbackRate, setPlaybackRate] = (0, import_react35.useState)(1);
|
|
11225
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react35.useState)(false);
|
|
11226
|
+
const lastSaveTimeRef = (0, import_react35.useRef)(0);
|
|
11227
|
+
const trackRef = (0, import_react35.useRef)(null);
|
|
11228
|
+
const controlsTimeoutRef = (0, import_react35.useRef)(null);
|
|
11229
|
+
const lastMousePositionRef = (0, import_react35.useRef)({ x: 0, y: 0 });
|
|
11230
|
+
const isUserInteracting = (0, import_react35.useCallback)(() => {
|
|
10898
11231
|
if (showSpeedMenu) {
|
|
10899
11232
|
return true;
|
|
10900
11233
|
}
|
|
@@ -10911,13 +11244,13 @@ var VideoPlayer = ({
|
|
|
10911
11244
|
}
|
|
10912
11245
|
return false;
|
|
10913
11246
|
}, [showSpeedMenu]);
|
|
10914
|
-
const clearControlsTimeout = (0,
|
|
11247
|
+
const clearControlsTimeout = (0, import_react35.useCallback)(() => {
|
|
10915
11248
|
if (controlsTimeoutRef.current) {
|
|
10916
11249
|
clearTimeout(controlsTimeoutRef.current);
|
|
10917
11250
|
controlsTimeoutRef.current = null;
|
|
10918
11251
|
}
|
|
10919
11252
|
}, []);
|
|
10920
|
-
const showControlsWithTimer = (0,
|
|
11253
|
+
const showControlsWithTimer = (0, import_react35.useCallback)(() => {
|
|
10921
11254
|
setShowControls(true);
|
|
10922
11255
|
clearControlsTimeout();
|
|
10923
11256
|
if (isFullscreen) {
|
|
@@ -10932,7 +11265,7 @@ var VideoPlayer = ({
|
|
|
10932
11265
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
10933
11266
|
}
|
|
10934
11267
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
10935
|
-
const handleMouseMove = (0,
|
|
11268
|
+
const handleMouseMove = (0, import_react35.useCallback)(
|
|
10936
11269
|
(event) => {
|
|
10937
11270
|
const currentX = event.clientX;
|
|
10938
11271
|
const currentY = event.clientY;
|
|
@@ -10945,10 +11278,10 @@ var VideoPlayer = ({
|
|
|
10945
11278
|
},
|
|
10946
11279
|
[showControlsWithTimer]
|
|
10947
11280
|
);
|
|
10948
|
-
const handleMouseEnter = (0,
|
|
11281
|
+
const handleMouseEnter = (0, import_react35.useCallback)(() => {
|
|
10949
11282
|
showControlsWithTimer();
|
|
10950
11283
|
}, [showControlsWithTimer]);
|
|
10951
|
-
const handleMouseLeave = (0,
|
|
11284
|
+
const handleMouseLeave = (0, import_react35.useCallback)(() => {
|
|
10952
11285
|
const userInteracting = isUserInteracting();
|
|
10953
11286
|
clearControlsTimeout();
|
|
10954
11287
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -10957,13 +11290,13 @@ var VideoPlayer = ({
|
|
|
10957
11290
|
}, LEAVE_HIDE_TIMEOUT);
|
|
10958
11291
|
}
|
|
10959
11292
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
10960
|
-
(0,
|
|
11293
|
+
(0, import_react35.useEffect)(() => {
|
|
10961
11294
|
if (videoRef.current) {
|
|
10962
11295
|
videoRef.current.volume = volume;
|
|
10963
11296
|
videoRef.current.muted = isMuted;
|
|
10964
11297
|
}
|
|
10965
11298
|
}, [volume, isMuted]);
|
|
10966
|
-
(0,
|
|
11299
|
+
(0, import_react35.useEffect)(() => {
|
|
10967
11300
|
const video = videoRef.current;
|
|
10968
11301
|
if (!video) return;
|
|
10969
11302
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -10978,13 +11311,13 @@ var VideoPlayer = ({
|
|
|
10978
11311
|
video.removeEventListener("ended", onEnded);
|
|
10979
11312
|
};
|
|
10980
11313
|
}, []);
|
|
10981
|
-
(0,
|
|
11314
|
+
(0, import_react35.useEffect)(() => {
|
|
10982
11315
|
const video = videoRef.current;
|
|
10983
11316
|
if (!video) return;
|
|
10984
11317
|
video.setAttribute("playsinline", "");
|
|
10985
11318
|
video.setAttribute("webkit-playsinline", "");
|
|
10986
11319
|
}, []);
|
|
10987
|
-
(0,
|
|
11320
|
+
(0, import_react35.useEffect)(() => {
|
|
10988
11321
|
if (isPlaying) {
|
|
10989
11322
|
showControlsWithTimer();
|
|
10990
11323
|
} else {
|
|
@@ -10996,7 +11329,7 @@ var VideoPlayer = ({
|
|
|
10996
11329
|
}
|
|
10997
11330
|
}
|
|
10998
11331
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
10999
|
-
(0,
|
|
11332
|
+
(0, import_react35.useEffect)(() => {
|
|
11000
11333
|
const video = videoRef.current;
|
|
11001
11334
|
if (!video) return;
|
|
11002
11335
|
const handleFullscreenChange = () => {
|
|
@@ -11031,7 +11364,7 @@ var VideoPlayer = ({
|
|
|
11031
11364
|
);
|
|
11032
11365
|
};
|
|
11033
11366
|
}, [showControlsWithTimer]);
|
|
11034
|
-
(0,
|
|
11367
|
+
(0, import_react35.useEffect)(() => {
|
|
11035
11368
|
const init = () => {
|
|
11036
11369
|
if (!isFullscreen) {
|
|
11037
11370
|
showControlsWithTimer();
|
|
@@ -11053,7 +11386,7 @@ var VideoPlayer = ({
|
|
|
11053
11386
|
};
|
|
11054
11387
|
}
|
|
11055
11388
|
}, []);
|
|
11056
|
-
const getInitialTime = (0,
|
|
11389
|
+
const getInitialTime = (0, import_react35.useCallback)(() => {
|
|
11057
11390
|
if (!autoSave || !storageKey) {
|
|
11058
11391
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
11059
11392
|
}
|
|
@@ -11066,14 +11399,14 @@ var VideoPlayer = ({
|
|
|
11066
11399
|
if (hasValidSaved) return saved;
|
|
11067
11400
|
return void 0;
|
|
11068
11401
|
}, [autoSave, storageKey, src, initialTime]);
|
|
11069
|
-
(0,
|
|
11402
|
+
(0, import_react35.useEffect)(() => {
|
|
11070
11403
|
const start = getInitialTime();
|
|
11071
11404
|
if (start !== void 0 && videoRef.current) {
|
|
11072
11405
|
videoRef.current.currentTime = start;
|
|
11073
11406
|
setCurrentTime(start);
|
|
11074
11407
|
}
|
|
11075
11408
|
}, [getInitialTime]);
|
|
11076
|
-
const saveProgress = (0,
|
|
11409
|
+
const saveProgress = (0, import_react35.useCallback)(
|
|
11077
11410
|
(time) => {
|
|
11078
11411
|
if (!autoSave || !storageKey) return;
|
|
11079
11412
|
const now = Date.now();
|
|
@@ -11084,7 +11417,7 @@ var VideoPlayer = ({
|
|
|
11084
11417
|
},
|
|
11085
11418
|
[autoSave, storageKey, src]
|
|
11086
11419
|
);
|
|
11087
|
-
const togglePlayPause = (0,
|
|
11420
|
+
const togglePlayPause = (0, import_react35.useCallback)(async () => {
|
|
11088
11421
|
const video = videoRef.current;
|
|
11089
11422
|
if (!video) return;
|
|
11090
11423
|
if (!video.paused) {
|
|
@@ -11096,7 +11429,7 @@ var VideoPlayer = ({
|
|
|
11096
11429
|
} catch {
|
|
11097
11430
|
}
|
|
11098
11431
|
}, []);
|
|
11099
|
-
const handleVolumeChange = (0,
|
|
11432
|
+
const handleVolumeChange = (0, import_react35.useCallback)(
|
|
11100
11433
|
(newVolume) => {
|
|
11101
11434
|
const video = videoRef.current;
|
|
11102
11435
|
if (!video) return;
|
|
@@ -11115,7 +11448,7 @@ var VideoPlayer = ({
|
|
|
11115
11448
|
},
|
|
11116
11449
|
[isMuted]
|
|
11117
11450
|
);
|
|
11118
|
-
const toggleMute = (0,
|
|
11451
|
+
const toggleMute = (0, import_react35.useCallback)(() => {
|
|
11119
11452
|
const video = videoRef.current;
|
|
11120
11453
|
if (!video) return;
|
|
11121
11454
|
if (isMuted) {
|
|
@@ -11129,20 +11462,20 @@ var VideoPlayer = ({
|
|
|
11129
11462
|
setIsMuted(true);
|
|
11130
11463
|
}
|
|
11131
11464
|
}, [isMuted, volume]);
|
|
11132
|
-
const handleSeek = (0,
|
|
11465
|
+
const handleSeek = (0, import_react35.useCallback)((newTime) => {
|
|
11133
11466
|
const video = videoRef.current;
|
|
11134
11467
|
if (video) {
|
|
11135
11468
|
video.currentTime = newTime;
|
|
11136
11469
|
}
|
|
11137
11470
|
}, []);
|
|
11138
|
-
const isSafariIOS = (0,
|
|
11471
|
+
const isSafariIOS = (0, import_react35.useCallback)(() => {
|
|
11139
11472
|
const ua = navigator.userAgent;
|
|
11140
11473
|
const isIOS = /iPad|iPhone|iPod/.test(ua);
|
|
11141
11474
|
const isWebKit = /WebKit/.test(ua);
|
|
11142
11475
|
const isNotChrome = !/CriOS|Chrome/.test(ua);
|
|
11143
11476
|
return isIOS && isWebKit && isNotChrome;
|
|
11144
11477
|
}, []);
|
|
11145
|
-
const toggleFullscreen = (0,
|
|
11478
|
+
const toggleFullscreen = (0, import_react35.useCallback)(() => {
|
|
11146
11479
|
const video = videoRef.current;
|
|
11147
11480
|
const container = video?.parentElement;
|
|
11148
11481
|
if (!video || !container) return;
|
|
@@ -11159,24 +11492,24 @@ var VideoPlayer = ({
|
|
|
11159
11492
|
document.exitFullscreen();
|
|
11160
11493
|
}
|
|
11161
11494
|
}, [isFullscreen, isSafariIOS]);
|
|
11162
|
-
const handleSpeedChange = (0,
|
|
11495
|
+
const handleSpeedChange = (0, import_react35.useCallback)((speed) => {
|
|
11163
11496
|
if (videoRef.current) {
|
|
11164
11497
|
videoRef.current.playbackRate = speed;
|
|
11165
11498
|
setPlaybackRate(speed);
|
|
11166
11499
|
setShowSpeedMenu(false);
|
|
11167
11500
|
}
|
|
11168
11501
|
}, []);
|
|
11169
|
-
const toggleSpeedMenu = (0,
|
|
11502
|
+
const toggleSpeedMenu = (0, import_react35.useCallback)(() => {
|
|
11170
11503
|
setShowSpeedMenu(!showSpeedMenu);
|
|
11171
11504
|
}, [showSpeedMenu]);
|
|
11172
|
-
const toggleCaptions = (0,
|
|
11505
|
+
const toggleCaptions = (0, import_react35.useCallback)(() => {
|
|
11173
11506
|
if (!trackRef.current?.track || !subtitles || subtitlesValidation !== "valid")
|
|
11174
11507
|
return;
|
|
11175
11508
|
const newShowCaptions = !showCaptions;
|
|
11176
11509
|
setShowCaptions(newShowCaptions);
|
|
11177
11510
|
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
11178
11511
|
}, [showCaptions, subtitles, subtitlesValidation]);
|
|
11179
|
-
const checkVideoCompletion = (0,
|
|
11512
|
+
const checkVideoCompletion = (0, import_react35.useCallback)(
|
|
11180
11513
|
(progressPercent) => {
|
|
11181
11514
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
11182
11515
|
setHasCompleted(true);
|
|
@@ -11185,7 +11518,7 @@ var VideoPlayer = ({
|
|
|
11185
11518
|
},
|
|
11186
11519
|
[hasCompleted, onVideoComplete]
|
|
11187
11520
|
);
|
|
11188
|
-
const handleTimeUpdate = (0,
|
|
11521
|
+
const handleTimeUpdate = (0, import_react35.useCallback)(() => {
|
|
11189
11522
|
const video = videoRef.current;
|
|
11190
11523
|
if (!video) return;
|
|
11191
11524
|
const current = video.currentTime;
|
|
@@ -11198,12 +11531,12 @@ var VideoPlayer = ({
|
|
|
11198
11531
|
checkVideoCompletion(progressPercent);
|
|
11199
11532
|
}
|
|
11200
11533
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
11201
|
-
const handleLoadedMetadata = (0,
|
|
11534
|
+
const handleLoadedMetadata = (0, import_react35.useCallback)(() => {
|
|
11202
11535
|
if (videoRef.current) {
|
|
11203
11536
|
setDuration(videoRef.current.duration);
|
|
11204
11537
|
}
|
|
11205
11538
|
}, []);
|
|
11206
|
-
(0,
|
|
11539
|
+
(0, import_react35.useEffect)(() => {
|
|
11207
11540
|
const controller = new AbortController();
|
|
11208
11541
|
const validateSubtitles = async () => {
|
|
11209
11542
|
if (!subtitles) {
|
|
@@ -11250,12 +11583,12 @@ var VideoPlayer = ({
|
|
|
11250
11583
|
controller.abort();
|
|
11251
11584
|
};
|
|
11252
11585
|
}, [subtitles]);
|
|
11253
|
-
(0,
|
|
11586
|
+
(0, import_react35.useEffect)(() => {
|
|
11254
11587
|
if (trackRef.current?.track) {
|
|
11255
11588
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
11256
11589
|
}
|
|
11257
11590
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
11258
|
-
(0,
|
|
11591
|
+
(0, import_react35.useEffect)(() => {
|
|
11259
11592
|
const handleVisibilityChange = () => {
|
|
11260
11593
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
11261
11594
|
videoRef.current.pause();
|
|
@@ -11277,54 +11610,54 @@ var VideoPlayer = ({
|
|
|
11277
11610
|
};
|
|
11278
11611
|
}, [isPlaying, clearControlsTimeout]);
|
|
11279
11612
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
11280
|
-
const getIconSize2 = (0,
|
|
11613
|
+
const getIconSize2 = (0, import_react35.useCallback)(() => {
|
|
11281
11614
|
if (isTinyMobile) return 18;
|
|
11282
11615
|
if (isUltraSmallMobile) return 20;
|
|
11283
11616
|
return 24;
|
|
11284
11617
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11285
|
-
const getControlsPadding = (0,
|
|
11618
|
+
const getControlsPadding = (0, import_react35.useCallback)(() => {
|
|
11286
11619
|
if (isTinyMobile) return "px-2 pb-2 pt-1";
|
|
11287
11620
|
if (isUltraSmallMobile) return "px-3 pb-3 pt-1";
|
|
11288
11621
|
return "px-4 pb-4";
|
|
11289
11622
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11290
|
-
const getControlsGap = (0,
|
|
11623
|
+
const getControlsGap = (0, import_react35.useCallback)(() => {
|
|
11291
11624
|
if (isTinyMobile) return "gap-1";
|
|
11292
11625
|
if (isUltraSmallMobile) return "gap-2";
|
|
11293
11626
|
return "gap-4";
|
|
11294
11627
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11295
|
-
const getProgressBarPadding = (0,
|
|
11628
|
+
const getProgressBarPadding = (0, import_react35.useCallback)(() => {
|
|
11296
11629
|
if (isTinyMobile) return "px-2 pb-1";
|
|
11297
11630
|
if (isUltraSmallMobile) return "px-3 pb-1";
|
|
11298
11631
|
return "px-4 pb-2";
|
|
11299
11632
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11300
|
-
const getCenterPlayButtonPosition = (0,
|
|
11633
|
+
const getCenterPlayButtonPosition = (0, import_react35.useCallback)(() => {
|
|
11301
11634
|
if (isTinyMobile) return "items-center justify-center -translate-y-12";
|
|
11302
11635
|
if (isUltraSmallMobile) return "items-center justify-center -translate-y-8";
|
|
11303
11636
|
return "items-center justify-center";
|
|
11304
11637
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11305
|
-
const getTopControlsOpacity = (0,
|
|
11638
|
+
const getTopControlsOpacity = (0, import_react35.useCallback)(() => {
|
|
11306
11639
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11307
11640
|
}, [showControls]);
|
|
11308
|
-
const getBottomControlsOpacity = (0,
|
|
11641
|
+
const getBottomControlsOpacity = (0, import_react35.useCallback)(() => {
|
|
11309
11642
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11310
11643
|
}, [showControls]);
|
|
11311
|
-
const seekBackward = (0,
|
|
11644
|
+
const seekBackward = (0, import_react35.useCallback)(() => {
|
|
11312
11645
|
if (videoRef.current) {
|
|
11313
11646
|
videoRef.current.currentTime -= 10;
|
|
11314
11647
|
}
|
|
11315
11648
|
}, []);
|
|
11316
|
-
const seekForward = (0,
|
|
11649
|
+
const seekForward = (0, import_react35.useCallback)(() => {
|
|
11317
11650
|
if (videoRef.current) {
|
|
11318
11651
|
videoRef.current.currentTime += 10;
|
|
11319
11652
|
}
|
|
11320
11653
|
}, []);
|
|
11321
|
-
const increaseVolume = (0,
|
|
11654
|
+
const increaseVolume = (0, import_react35.useCallback)(() => {
|
|
11322
11655
|
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
11323
11656
|
}, [handleVolumeChange, volume]);
|
|
11324
|
-
const decreaseVolume = (0,
|
|
11657
|
+
const decreaseVolume = (0, import_react35.useCallback)(() => {
|
|
11325
11658
|
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
11326
11659
|
}, [handleVolumeChange, volume]);
|
|
11327
|
-
const handleVideoKeyDown = (0,
|
|
11660
|
+
const handleVideoKeyDown = (0, import_react35.useCallback)(
|
|
11328
11661
|
(e) => {
|
|
11329
11662
|
if (!e.key) return;
|
|
11330
11663
|
e.stopPropagation();
|
|
@@ -11359,10 +11692,10 @@ var VideoPlayer = ({
|
|
|
11359
11692
|
]
|
|
11360
11693
|
);
|
|
11361
11694
|
const groupedSubTitleValid = subtitles && subtitlesValidation === "valid";
|
|
11362
|
-
return /* @__PURE__ */ (0,
|
|
11363
|
-
(title || subtitleText) && /* @__PURE__ */ (0,
|
|
11364
|
-
/* @__PURE__ */ (0,
|
|
11365
|
-
title && /* @__PURE__ */ (0,
|
|
11695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn("flex flex-col", className), children: [
|
|
11696
|
+
(title || subtitleText) && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "bg-subject-1 px-8 py-4 flex items-end justify-between min-h-20", children: [
|
|
11697
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11698
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11366
11699
|
Text_default,
|
|
11367
11700
|
{
|
|
11368
11701
|
as: "h2",
|
|
@@ -11373,7 +11706,7 @@ var VideoPlayer = ({
|
|
|
11373
11706
|
children: title
|
|
11374
11707
|
}
|
|
11375
11708
|
),
|
|
11376
|
-
subtitleText && /* @__PURE__ */ (0,
|
|
11709
|
+
subtitleText && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11377
11710
|
Text_default,
|
|
11378
11711
|
{
|
|
11379
11712
|
as: "p",
|
|
@@ -11385,7 +11718,7 @@ var VideoPlayer = ({
|
|
|
11385
11718
|
}
|
|
11386
11719
|
)
|
|
11387
11720
|
] }),
|
|
11388
|
-
showDownloadButton && downloadContent && /* @__PURE__ */ (0,
|
|
11721
|
+
showDownloadButton && downloadContent && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11389
11722
|
DownloadButton_default,
|
|
11390
11723
|
{
|
|
11391
11724
|
content: downloadContent,
|
|
@@ -11397,7 +11730,7 @@ var VideoPlayer = ({
|
|
|
11397
11730
|
}
|
|
11398
11731
|
)
|
|
11399
11732
|
] }),
|
|
11400
|
-
/* @__PURE__ */ (0,
|
|
11733
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
11401
11734
|
"section",
|
|
11402
11735
|
{
|
|
11403
11736
|
className: cn(
|
|
@@ -11412,7 +11745,7 @@ var VideoPlayer = ({
|
|
|
11412
11745
|
onTouchStart: handleMouseEnter,
|
|
11413
11746
|
onMouseLeave: handleMouseLeave,
|
|
11414
11747
|
children: [
|
|
11415
|
-
/* @__PURE__ */ (0,
|
|
11748
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11416
11749
|
"video",
|
|
11417
11750
|
{
|
|
11418
11751
|
ref: videoRef,
|
|
@@ -11427,7 +11760,7 @@ var VideoPlayer = ({
|
|
|
11427
11760
|
onKeyDown: handleVideoKeyDown,
|
|
11428
11761
|
tabIndex: 0,
|
|
11429
11762
|
"aria-label": title ? `Video: ${title}` : "Video player",
|
|
11430
|
-
children: /* @__PURE__ */ (0,
|
|
11763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11431
11764
|
"track",
|
|
11432
11765
|
{
|
|
11433
11766
|
ref: trackRef,
|
|
@@ -11440,17 +11773,17 @@ var VideoPlayer = ({
|
|
|
11440
11773
|
)
|
|
11441
11774
|
}
|
|
11442
11775
|
),
|
|
11443
|
-
!isPlaying && /* @__PURE__ */ (0,
|
|
11776
|
+
!isPlaying && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11444
11777
|
"div",
|
|
11445
11778
|
{
|
|
11446
11779
|
className: cn(
|
|
11447
11780
|
"absolute inset-0 flex bg-black/30 transition-opacity",
|
|
11448
11781
|
getCenterPlayButtonPosition()
|
|
11449
11782
|
),
|
|
11450
|
-
children: /* @__PURE__ */ (0,
|
|
11783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11451
11784
|
IconButton_default,
|
|
11452
11785
|
{
|
|
11453
|
-
icon: /* @__PURE__ */ (0,
|
|
11786
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.Play, { size: 32, weight: "regular", className: "ml-1" }),
|
|
11454
11787
|
onClick: togglePlayPause,
|
|
11455
11788
|
"aria-label": "Play video",
|
|
11456
11789
|
className: "!bg-transparent !text-white !w-auto !h-auto hover:!bg-transparent hover:!text-gray-200"
|
|
@@ -11458,17 +11791,17 @@ var VideoPlayer = ({
|
|
|
11458
11791
|
)
|
|
11459
11792
|
}
|
|
11460
11793
|
),
|
|
11461
|
-
/* @__PURE__ */ (0,
|
|
11794
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11462
11795
|
"div",
|
|
11463
11796
|
{
|
|
11464
11797
|
className: cn(
|
|
11465
11798
|
"absolute top-0 left-0 right-0 p-4 bg-gradient-to-b from-black/70 to-transparent transition-opacity",
|
|
11466
11799
|
getTopControlsOpacity()
|
|
11467
11800
|
),
|
|
11468
|
-
children: /* @__PURE__ */ (0,
|
|
11801
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11469
11802
|
IconButton_default,
|
|
11470
11803
|
{
|
|
11471
|
-
icon: isFullscreen ? /* @__PURE__ */ (0,
|
|
11804
|
+
icon: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.ArrowsInSimple, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.ArrowsOutSimple, { size: 24 }),
|
|
11472
11805
|
onClick: toggleFullscreen,
|
|
11473
11806
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
11474
11807
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
@@ -11476,7 +11809,7 @@ var VideoPlayer = ({
|
|
|
11476
11809
|
) })
|
|
11477
11810
|
}
|
|
11478
11811
|
),
|
|
11479
|
-
/* @__PURE__ */ (0,
|
|
11812
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
11480
11813
|
"div",
|
|
11481
11814
|
{
|
|
11482
11815
|
className: cn(
|
|
@@ -11484,7 +11817,7 @@ var VideoPlayer = ({
|
|
|
11484
11817
|
getBottomControlsOpacity()
|
|
11485
11818
|
),
|
|
11486
11819
|
children: [
|
|
11487
|
-
/* @__PURE__ */ (0,
|
|
11820
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11488
11821
|
ProgressBar2,
|
|
11489
11822
|
{
|
|
11490
11823
|
currentTime,
|
|
@@ -11494,7 +11827,7 @@ var VideoPlayer = ({
|
|
|
11494
11827
|
className: getProgressBarPadding()
|
|
11495
11828
|
}
|
|
11496
11829
|
),
|
|
11497
|
-
/* @__PURE__ */ (0,
|
|
11830
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
11498
11831
|
"div",
|
|
11499
11832
|
{
|
|
11500
11833
|
className: cn(
|
|
@@ -11502,17 +11835,17 @@ var VideoPlayer = ({
|
|
|
11502
11835
|
getControlsPadding()
|
|
11503
11836
|
),
|
|
11504
11837
|
children: [
|
|
11505
|
-
/* @__PURE__ */ (0,
|
|
11506
|
-
/* @__PURE__ */ (0,
|
|
11838
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn("flex items-center", getControlsGap()), children: [
|
|
11839
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11507
11840
|
IconButton_default,
|
|
11508
11841
|
{
|
|
11509
|
-
icon: isPlaying ? /* @__PURE__ */ (0,
|
|
11842
|
+
icon: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.Pause, { size: getIconSize2() }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.Play, { size: getIconSize2() }),
|
|
11510
11843
|
onClick: togglePlayPause,
|
|
11511
11844
|
"aria-label": isPlaying ? "Pause" : "Play",
|
|
11512
11845
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
11513
11846
|
}
|
|
11514
11847
|
),
|
|
11515
|
-
/* @__PURE__ */ (0,
|
|
11848
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11516
11849
|
VolumeControls,
|
|
11517
11850
|
{
|
|
11518
11851
|
volume,
|
|
@@ -11523,10 +11856,10 @@ var VideoPlayer = ({
|
|
|
11523
11856
|
showSlider: !isUltraSmallMobile
|
|
11524
11857
|
}
|
|
11525
11858
|
),
|
|
11526
|
-
groupedSubTitleValid && /* @__PURE__ */ (0,
|
|
11859
|
+
groupedSubTitleValid && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11527
11860
|
IconButton_default,
|
|
11528
11861
|
{
|
|
11529
|
-
icon: /* @__PURE__ */ (0,
|
|
11862
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_phosphor_react27.ClosedCaptioning, { size: getIconSize2() }),
|
|
11530
11863
|
onClick: toggleCaptions,
|
|
11531
11864
|
"aria-label": showCaptions ? "Hide captions" : "Show captions",
|
|
11532
11865
|
className: cn(
|
|
@@ -11535,13 +11868,13 @@ var VideoPlayer = ({
|
|
|
11535
11868
|
)
|
|
11536
11869
|
}
|
|
11537
11870
|
),
|
|
11538
|
-
/* @__PURE__ */ (0,
|
|
11871
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text_default, { size: "sm", weight: "medium", color: "text-white", children: [
|
|
11539
11872
|
formatTime(currentTime),
|
|
11540
11873
|
" / ",
|
|
11541
11874
|
formatTime(duration)
|
|
11542
11875
|
] })
|
|
11543
11876
|
] }),
|
|
11544
|
-
/* @__PURE__ */ (0,
|
|
11877
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11545
11878
|
SpeedMenu,
|
|
11546
11879
|
{
|
|
11547
11880
|
showSpeedMenu,
|
|
@@ -11567,9 +11900,9 @@ var VideoPlayer = ({
|
|
|
11567
11900
|
var VideoPlayer_default = VideoPlayer;
|
|
11568
11901
|
|
|
11569
11902
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
11570
|
-
var
|
|
11571
|
-
var
|
|
11572
|
-
var
|
|
11903
|
+
var import_react36 = require("react");
|
|
11904
|
+
var import_phosphor_react28 = require("phosphor-react");
|
|
11905
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
11573
11906
|
var IMAGE_WIDTH = 225;
|
|
11574
11907
|
var IMAGE_HEIGHT = 90;
|
|
11575
11908
|
var Whiteboard = ({
|
|
@@ -11580,8 +11913,8 @@ var Whiteboard = ({
|
|
|
11580
11913
|
imagesPerRow = 2,
|
|
11581
11914
|
...rest
|
|
11582
11915
|
}) => {
|
|
11583
|
-
const [imageErrors, setImageErrors] = (0,
|
|
11584
|
-
const handleDownload = (0,
|
|
11916
|
+
const [imageErrors, setImageErrors] = (0, import_react36.useState)(/* @__PURE__ */ new Set());
|
|
11917
|
+
const handleDownload = (0, import_react36.useCallback)(
|
|
11585
11918
|
(image) => {
|
|
11586
11919
|
if (onDownload) {
|
|
11587
11920
|
onDownload(image);
|
|
@@ -11598,7 +11931,7 @@ var Whiteboard = ({
|
|
|
11598
11931
|
},
|
|
11599
11932
|
[onDownload]
|
|
11600
11933
|
);
|
|
11601
|
-
const handleImageError = (0,
|
|
11934
|
+
const handleImageError = (0, import_react36.useCallback)((imageId) => {
|
|
11602
11935
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
11603
11936
|
}, []);
|
|
11604
11937
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -11607,7 +11940,7 @@ var Whiteboard = ({
|
|
|
11607
11940
|
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
11608
11941
|
}[imagesPerRow];
|
|
11609
11942
|
if (!images || images.length === 0) {
|
|
11610
|
-
return /* @__PURE__ */ (0,
|
|
11943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11611
11944
|
"div",
|
|
11612
11945
|
{
|
|
11613
11946
|
className: cn(
|
|
@@ -11615,11 +11948,11 @@ var Whiteboard = ({
|
|
|
11615
11948
|
className
|
|
11616
11949
|
),
|
|
11617
11950
|
...rest,
|
|
11618
|
-
children: /* @__PURE__ */ (0,
|
|
11951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-gray-400 text-sm", children: "Nenhuma imagem dispon\xEDvel" })
|
|
11619
11952
|
}
|
|
11620
11953
|
);
|
|
11621
11954
|
}
|
|
11622
|
-
return /* @__PURE__ */ (0,
|
|
11955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11623
11956
|
"div",
|
|
11624
11957
|
{
|
|
11625
11958
|
className: cn(
|
|
@@ -11627,7 +11960,7 @@ var Whiteboard = ({
|
|
|
11627
11960
|
className
|
|
11628
11961
|
),
|
|
11629
11962
|
...rest,
|
|
11630
|
-
children: /* @__PURE__ */ (0,
|
|
11963
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: cn("grid gap-4", gridColsClass), children: images.map((image) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
11631
11964
|
"div",
|
|
11632
11965
|
{
|
|
11633
11966
|
className: "relative group overflow-hidden bg-gray-100 rounded-lg",
|
|
@@ -11635,7 +11968,7 @@ var Whiteboard = ({
|
|
|
11635
11968
|
width: `${IMAGE_WIDTH}px`
|
|
11636
11969
|
},
|
|
11637
11970
|
children: [
|
|
11638
|
-
/* @__PURE__ */ (0,
|
|
11971
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11639
11972
|
"div",
|
|
11640
11973
|
{
|
|
11641
11974
|
className: "relative",
|
|
@@ -11643,8 +11976,8 @@ var Whiteboard = ({
|
|
|
11643
11976
|
width: `${IMAGE_WIDTH}px`,
|
|
11644
11977
|
height: `${IMAGE_HEIGHT}px`
|
|
11645
11978
|
},
|
|
11646
|
-
children: imageErrors.has(image.id) ? /* @__PURE__ */ (0,
|
|
11647
|
-
/* @__PURE__ */ (0,
|
|
11979
|
+
children: imageErrors.has(image.id) ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-gray-500 text-sm text-center px-2", children: "Imagem indispon\xEDvel" }) }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
11980
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11648
11981
|
"img",
|
|
11649
11982
|
{
|
|
11650
11983
|
src: image.imageUrl,
|
|
@@ -11654,19 +11987,19 @@ var Whiteboard = ({
|
|
|
11654
11987
|
onError: () => handleImageError(image.id)
|
|
11655
11988
|
}
|
|
11656
11989
|
),
|
|
11657
|
-
/* @__PURE__ */ (0,
|
|
11990
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-black/20 to-transparent" })
|
|
11658
11991
|
] })
|
|
11659
11992
|
}
|
|
11660
11993
|
),
|
|
11661
|
-
showDownload && /* @__PURE__ */ (0,
|
|
11994
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11662
11995
|
"button",
|
|
11663
11996
|
{
|
|
11664
11997
|
type: "button",
|
|
11665
11998
|
onClick: () => handleDownload(image),
|
|
11666
11999
|
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",
|
|
11667
12000
|
"aria-label": `Download ${image.title || "imagem"}`,
|
|
11668
|
-
children: /* @__PURE__ */ (0,
|
|
11669
|
-
|
|
12001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
12002
|
+
import_phosphor_react28.ArrowsOut,
|
|
11670
12003
|
{
|
|
11671
12004
|
size: 24,
|
|
11672
12005
|
weight: "regular",
|
|
@@ -11685,10 +12018,10 @@ var Whiteboard = ({
|
|
|
11685
12018
|
var Whiteboard_default = Whiteboard;
|
|
11686
12019
|
|
|
11687
12020
|
// src/components/Auth/Auth.tsx
|
|
11688
|
-
var
|
|
12021
|
+
var import_react37 = require("react");
|
|
11689
12022
|
var import_react_router_dom = require("react-router-dom");
|
|
11690
|
-
var
|
|
11691
|
-
var AuthContext = (0,
|
|
12023
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
12024
|
+
var AuthContext = (0, import_react37.createContext)(void 0);
|
|
11692
12025
|
var AuthProvider = ({
|
|
11693
12026
|
children,
|
|
11694
12027
|
checkAuthFn,
|
|
@@ -11698,12 +12031,12 @@ var AuthProvider = ({
|
|
|
11698
12031
|
getSessionFn,
|
|
11699
12032
|
getTokensFn
|
|
11700
12033
|
}) => {
|
|
11701
|
-
const [authState, setAuthState] = (0,
|
|
12034
|
+
const [authState, setAuthState] = (0, import_react37.useState)({
|
|
11702
12035
|
isAuthenticated: false,
|
|
11703
12036
|
isLoading: true,
|
|
11704
12037
|
...initialAuthState
|
|
11705
12038
|
});
|
|
11706
|
-
const checkAuth = (0,
|
|
12039
|
+
const checkAuth = (0, import_react37.useCallback)(async () => {
|
|
11707
12040
|
try {
|
|
11708
12041
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
11709
12042
|
if (!checkAuthFn) {
|
|
@@ -11734,7 +12067,7 @@ var AuthProvider = ({
|
|
|
11734
12067
|
return false;
|
|
11735
12068
|
}
|
|
11736
12069
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
11737
|
-
const signOut = (0,
|
|
12070
|
+
const signOut = (0, import_react37.useCallback)(() => {
|
|
11738
12071
|
if (signOutFn) {
|
|
11739
12072
|
signOutFn();
|
|
11740
12073
|
}
|
|
@@ -11746,10 +12079,10 @@ var AuthProvider = ({
|
|
|
11746
12079
|
tokens: void 0
|
|
11747
12080
|
}));
|
|
11748
12081
|
}, [signOutFn]);
|
|
11749
|
-
(0,
|
|
12082
|
+
(0, import_react37.useEffect)(() => {
|
|
11750
12083
|
checkAuth();
|
|
11751
12084
|
}, [checkAuth]);
|
|
11752
|
-
const contextValue = (0,
|
|
12085
|
+
const contextValue = (0, import_react37.useMemo)(
|
|
11753
12086
|
() => ({
|
|
11754
12087
|
...authState,
|
|
11755
12088
|
checkAuth,
|
|
@@ -11757,10 +12090,10 @@ var AuthProvider = ({
|
|
|
11757
12090
|
}),
|
|
11758
12091
|
[authState, checkAuth, signOut]
|
|
11759
12092
|
);
|
|
11760
|
-
return /* @__PURE__ */ (0,
|
|
12093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(AuthContext.Provider, { value: contextValue, children });
|
|
11761
12094
|
};
|
|
11762
12095
|
var useAuth = () => {
|
|
11763
|
-
const context = (0,
|
|
12096
|
+
const context = (0, import_react37.useContext)(AuthContext);
|
|
11764
12097
|
if (context === void 0) {
|
|
11765
12098
|
throw new Error("useAuth deve ser usado dentro de um AuthProvider");
|
|
11766
12099
|
}
|
|
@@ -11773,9 +12106,9 @@ var ProtectedRoute = ({
|
|
|
11773
12106
|
additionalCheck
|
|
11774
12107
|
}) => {
|
|
11775
12108
|
const { isAuthenticated, isLoading, ...authState } = useAuth();
|
|
11776
|
-
const defaultLoadingComponent = /* @__PURE__ */ (0,
|
|
12109
|
+
const defaultLoadingComponent = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
11777
12110
|
if (isLoading) {
|
|
11778
|
-
return /* @__PURE__ */ (0,
|
|
12111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children: loadingComponent || defaultLoadingComponent });
|
|
11779
12112
|
}
|
|
11780
12113
|
if (!isAuthenticated) {
|
|
11781
12114
|
if (typeof window !== "undefined") {
|
|
@@ -11786,12 +12119,12 @@ var ProtectedRoute = ({
|
|
|
11786
12119
|
return null;
|
|
11787
12120
|
}
|
|
11788
12121
|
}
|
|
11789
|
-
return /* @__PURE__ */ (0,
|
|
12122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
11790
12123
|
}
|
|
11791
12124
|
if (additionalCheck && !additionalCheck({ isAuthenticated, isLoading, ...authState })) {
|
|
11792
|
-
return /* @__PURE__ */ (0,
|
|
12125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
11793
12126
|
}
|
|
11794
|
-
return /* @__PURE__ */ (0,
|
|
12127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children });
|
|
11795
12128
|
};
|
|
11796
12129
|
var PublicRoute = ({
|
|
11797
12130
|
children,
|
|
@@ -11801,15 +12134,15 @@ var PublicRoute = ({
|
|
|
11801
12134
|
}) => {
|
|
11802
12135
|
const { isAuthenticated, isLoading } = useAuth();
|
|
11803
12136
|
if (checkAuthBeforeRender && isLoading) {
|
|
11804
|
-
return /* @__PURE__ */ (0,
|
|
12137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
11805
12138
|
}
|
|
11806
12139
|
if (isAuthenticated && redirectIfAuthenticated) {
|
|
11807
|
-
return /* @__PURE__ */ (0,
|
|
12140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
11808
12141
|
}
|
|
11809
|
-
return /* @__PURE__ */ (0,
|
|
12142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children });
|
|
11810
12143
|
};
|
|
11811
12144
|
var withAuth = (Component, options = {}) => {
|
|
11812
|
-
return (props) => /* @__PURE__ */ (0,
|
|
12145
|
+
return (props) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ProtectedRoute, { ...options, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Component, { ...props }) });
|
|
11813
12146
|
};
|
|
11814
12147
|
var useAuthGuard = (options = {}) => {
|
|
11815
12148
|
const authState = useAuth();
|
|
@@ -11824,7 +12157,7 @@ var useAuthGuard = (options = {}) => {
|
|
|
11824
12157
|
var useRouteAuth = (fallbackPath = "/") => {
|
|
11825
12158
|
const { isAuthenticated, isLoading } = useAuth();
|
|
11826
12159
|
const location = (0, import_react_router_dom.useLocation)();
|
|
11827
|
-
const redirectToLogin = () => /* @__PURE__ */ (0,
|
|
12160
|
+
const redirectToLogin = () => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_router_dom.Navigate, { to: fallbackPath, state: { from: location }, replace: true });
|
|
11828
12161
|
return {
|
|
11829
12162
|
isAuthenticated,
|
|
11830
12163
|
isLoading,
|
|
@@ -11858,10 +12191,10 @@ var getRootDomain = () => {
|
|
|
11858
12191
|
};
|
|
11859
12192
|
|
|
11860
12193
|
// src/components/Accordation/Accordation.tsx
|
|
11861
|
-
var
|
|
11862
|
-
var
|
|
11863
|
-
var
|
|
11864
|
-
var CardAccordation = (0,
|
|
12194
|
+
var import_react38 = require("react");
|
|
12195
|
+
var import_phosphor_react29 = require("phosphor-react");
|
|
12196
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
12197
|
+
var CardAccordation = (0, import_react38.forwardRef)(
|
|
11865
12198
|
({
|
|
11866
12199
|
trigger,
|
|
11867
12200
|
children,
|
|
@@ -11873,13 +12206,13 @@ var CardAccordation = (0, import_react37.forwardRef)(
|
|
|
11873
12206
|
disabled = false,
|
|
11874
12207
|
...props
|
|
11875
12208
|
}, ref) => {
|
|
11876
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
11877
|
-
const generatedId = (0,
|
|
12209
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react38.useState)(defaultExpanded);
|
|
12210
|
+
const generatedId = (0, import_react38.useId)();
|
|
11878
12211
|
const contentId = value ? `accordion-content-${value}` : generatedId;
|
|
11879
12212
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
11880
12213
|
const isControlled = controlledExpanded !== void 0;
|
|
11881
12214
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
11882
|
-
(0,
|
|
12215
|
+
(0, import_react38.useEffect)(() => {
|
|
11883
12216
|
if (isControlled) {
|
|
11884
12217
|
setInternalExpanded(controlledExpanded);
|
|
11885
12218
|
}
|
|
@@ -11899,7 +12232,7 @@ var CardAccordation = (0, import_react37.forwardRef)(
|
|
|
11899
12232
|
handleToggle();
|
|
11900
12233
|
}
|
|
11901
12234
|
};
|
|
11902
|
-
return /* @__PURE__ */ (0,
|
|
12235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
11903
12236
|
CardBase,
|
|
11904
12237
|
{
|
|
11905
12238
|
ref,
|
|
@@ -11909,7 +12242,7 @@ var CardAccordation = (0, import_react37.forwardRef)(
|
|
|
11909
12242
|
className: cn("overflow-hidden", className),
|
|
11910
12243
|
...props,
|
|
11911
12244
|
children: [
|
|
11912
|
-
/* @__PURE__ */ (0,
|
|
12245
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
11913
12246
|
"button",
|
|
11914
12247
|
{
|
|
11915
12248
|
id: headerId,
|
|
@@ -11927,8 +12260,8 @@ var CardAccordation = (0, import_react37.forwardRef)(
|
|
|
11927
12260
|
"data-value": value,
|
|
11928
12261
|
children: [
|
|
11929
12262
|
trigger,
|
|
11930
|
-
/* @__PURE__ */ (0,
|
|
11931
|
-
|
|
12263
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12264
|
+
import_phosphor_react29.CaretRight,
|
|
11932
12265
|
{
|
|
11933
12266
|
size: 20,
|
|
11934
12267
|
className: cn(
|
|
@@ -11942,7 +12275,7 @@ var CardAccordation = (0, import_react37.forwardRef)(
|
|
|
11942
12275
|
]
|
|
11943
12276
|
}
|
|
11944
12277
|
),
|
|
11945
|
-
/* @__PURE__ */ (0,
|
|
12278
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
11946
12279
|
"section",
|
|
11947
12280
|
{
|
|
11948
12281
|
id: contentId,
|
|
@@ -11954,7 +12287,7 @@ var CardAccordation = (0, import_react37.forwardRef)(
|
|
|
11954
12287
|
),
|
|
11955
12288
|
"data-testid": "accordion-content",
|
|
11956
12289
|
"data-value": value,
|
|
11957
|
-
children: /* @__PURE__ */ (0,
|
|
12290
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "p-4 pt-0", children })
|
|
11958
12291
|
}
|
|
11959
12292
|
)
|
|
11960
12293
|
]
|
|
@@ -11965,9 +12298,9 @@ var CardAccordation = (0, import_react37.forwardRef)(
|
|
|
11965
12298
|
CardAccordation.displayName = "CardAccordation";
|
|
11966
12299
|
|
|
11967
12300
|
// src/components/Accordation/AccordionGroup.tsx
|
|
11968
|
-
var
|
|
12301
|
+
var import_react39 = require("react");
|
|
11969
12302
|
var import_zustand10 = require("zustand");
|
|
11970
|
-
var
|
|
12303
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
11971
12304
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
11972
12305
|
return (0, import_zustand10.create)((set, get) => ({
|
|
11973
12306
|
type,
|
|
@@ -11985,8 +12318,8 @@ function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
|
11985
12318
|
}));
|
|
11986
12319
|
}
|
|
11987
12320
|
var injectStore6 = (children, store, indexRef, onItemToggle) => {
|
|
11988
|
-
return
|
|
11989
|
-
if (!(0,
|
|
12321
|
+
return import_react39.Children.map(children, (child) => {
|
|
12322
|
+
if (!(0, import_react39.isValidElement)(child)) {
|
|
11990
12323
|
return child;
|
|
11991
12324
|
}
|
|
11992
12325
|
const typedChild = child;
|
|
@@ -12013,16 +12346,16 @@ var injectStore6 = (children, store, indexRef, onItemToggle) => {
|
|
|
12013
12346
|
if (displayName === "CardAccordation") {
|
|
12014
12347
|
newProps.children = processedChildren;
|
|
12015
12348
|
} else if (processedChildren !== typedChild.props.children) {
|
|
12016
|
-
return (0,
|
|
12349
|
+
return (0, import_react39.cloneElement)(typedChild, { children: processedChildren });
|
|
12017
12350
|
}
|
|
12018
12351
|
}
|
|
12019
12352
|
if (Object.keys(newProps).length > 0) {
|
|
12020
|
-
return (0,
|
|
12353
|
+
return (0, import_react39.cloneElement)(typedChild, newProps);
|
|
12021
12354
|
}
|
|
12022
12355
|
return child;
|
|
12023
12356
|
});
|
|
12024
12357
|
};
|
|
12025
|
-
var AccordionGroup = (0,
|
|
12358
|
+
var AccordionGroup = (0, import_react39.forwardRef)(
|
|
12026
12359
|
({
|
|
12027
12360
|
type = "single",
|
|
12028
12361
|
defaultValue,
|
|
@@ -12033,12 +12366,12 @@ var AccordionGroup = (0, import_react38.forwardRef)(
|
|
|
12033
12366
|
className,
|
|
12034
12367
|
...props
|
|
12035
12368
|
}, ref) => {
|
|
12036
|
-
const [internalValue, setInternalValue] = (0,
|
|
12369
|
+
const [internalValue, setInternalValue] = (0, import_react39.useState)(
|
|
12037
12370
|
defaultValue || (type === "single" ? "" : [])
|
|
12038
12371
|
);
|
|
12039
12372
|
const isControlled = controlledValue !== void 0;
|
|
12040
12373
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
12041
|
-
const storeRef = (0,
|
|
12374
|
+
const storeRef = (0, import_react39.useRef)(null);
|
|
12042
12375
|
if (storeRef.current) {
|
|
12043
12376
|
storeRef.current.setState((prev) => {
|
|
12044
12377
|
const nextState = {};
|
|
@@ -12058,10 +12391,10 @@ var AccordionGroup = (0, import_react38.forwardRef)(
|
|
|
12058
12391
|
);
|
|
12059
12392
|
}
|
|
12060
12393
|
const store = storeRef.current;
|
|
12061
|
-
(0,
|
|
12394
|
+
(0, import_react39.useEffect)(() => {
|
|
12062
12395
|
store.setState({ value: currentValue });
|
|
12063
12396
|
}, [currentValue, store]);
|
|
12064
|
-
(0,
|
|
12397
|
+
(0, import_react39.useEffect)(() => {
|
|
12065
12398
|
if (!isControlled) {
|
|
12066
12399
|
setInternalValue((prev) => {
|
|
12067
12400
|
if (type === "single") {
|
|
@@ -12107,15 +12440,15 @@ var AccordionGroup = (0, import_react38.forwardRef)(
|
|
|
12107
12440
|
indexRef,
|
|
12108
12441
|
handleItemToggle
|
|
12109
12442
|
);
|
|
12110
|
-
return /* @__PURE__ */ (0,
|
|
12443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { ref, className, ...props, children: enhancedChildren });
|
|
12111
12444
|
}
|
|
12112
12445
|
);
|
|
12113
12446
|
AccordionGroup.displayName = "AccordionGroup";
|
|
12114
12447
|
|
|
12115
12448
|
// src/components/Alternative/Alternative.tsx
|
|
12116
|
-
var
|
|
12117
|
-
var
|
|
12118
|
-
var
|
|
12449
|
+
var import_phosphor_react30 = require("phosphor-react");
|
|
12450
|
+
var import_react40 = require("react");
|
|
12451
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
12119
12452
|
var AlternativesList = ({
|
|
12120
12453
|
alternatives,
|
|
12121
12454
|
name,
|
|
@@ -12128,9 +12461,9 @@ var AlternativesList = ({
|
|
|
12128
12461
|
mode = "interactive",
|
|
12129
12462
|
selectedValue
|
|
12130
12463
|
}) => {
|
|
12131
|
-
const uniqueId = (0,
|
|
12464
|
+
const uniqueId = (0, import_react40.useId)();
|
|
12132
12465
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
12133
|
-
const [actualValue, setActualValue] = (0,
|
|
12466
|
+
const [actualValue, setActualValue] = (0, import_react40.useState)(value);
|
|
12134
12467
|
const isReadonly = mode === "readonly";
|
|
12135
12468
|
const getStatusStyles2 = (status, isReadonly2) => {
|
|
12136
12469
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
@@ -12146,9 +12479,9 @@ var AlternativesList = ({
|
|
|
12146
12479
|
const getStatusBadge2 = (status) => {
|
|
12147
12480
|
switch (status) {
|
|
12148
12481
|
case "correct":
|
|
12149
|
-
return /* @__PURE__ */ (0,
|
|
12482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_phosphor_react30.CheckCircle, {}), children: "Resposta correta" });
|
|
12150
12483
|
case "incorrect":
|
|
12151
|
-
return /* @__PURE__ */ (0,
|
|
12484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_phosphor_react30.XCircle, {}), children: "Resposta incorreta" });
|
|
12152
12485
|
default:
|
|
12153
12486
|
return null;
|
|
12154
12487
|
}
|
|
@@ -12178,10 +12511,10 @@ var AlternativesList = ({
|
|
|
12178
12511
|
const renderRadio = () => {
|
|
12179
12512
|
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"}`;
|
|
12180
12513
|
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
12181
|
-
return /* @__PURE__ */ (0,
|
|
12514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: dotClasses }) });
|
|
12182
12515
|
};
|
|
12183
12516
|
if (layout === "detailed") {
|
|
12184
|
-
return /* @__PURE__ */ (0,
|
|
12517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12185
12518
|
"div",
|
|
12186
12519
|
{
|
|
12187
12520
|
className: cn(
|
|
@@ -12189,11 +12522,11 @@ var AlternativesList = ({
|
|
|
12189
12522
|
statusStyles,
|
|
12190
12523
|
alternative.disabled ? "opacity-50" : ""
|
|
12191
12524
|
),
|
|
12192
|
-
children: /* @__PURE__ */ (0,
|
|
12193
|
-
/* @__PURE__ */ (0,
|
|
12194
|
-
/* @__PURE__ */ (0,
|
|
12195
|
-
/* @__PURE__ */ (0,
|
|
12196
|
-
/* @__PURE__ */ (0,
|
|
12525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
12526
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
12527
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "mt-1", children: renderRadio() }),
|
|
12528
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-1", children: [
|
|
12529
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12197
12530
|
"p",
|
|
12198
12531
|
{
|
|
12199
12532
|
className: cn(
|
|
@@ -12203,16 +12536,16 @@ var AlternativesList = ({
|
|
|
12203
12536
|
children: alternative.label
|
|
12204
12537
|
}
|
|
12205
12538
|
),
|
|
12206
|
-
alternative.description && /* @__PURE__ */ (0,
|
|
12539
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
12207
12540
|
] })
|
|
12208
12541
|
] }),
|
|
12209
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
12542
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12210
12543
|
] })
|
|
12211
12544
|
},
|
|
12212
12545
|
alternativeId
|
|
12213
12546
|
);
|
|
12214
12547
|
}
|
|
12215
|
-
return /* @__PURE__ */ (0,
|
|
12548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
12216
12549
|
"div",
|
|
12217
12550
|
{
|
|
12218
12551
|
className: cn(
|
|
@@ -12221,9 +12554,9 @@ var AlternativesList = ({
|
|
|
12221
12554
|
alternative.disabled ? "opacity-50" : ""
|
|
12222
12555
|
),
|
|
12223
12556
|
children: [
|
|
12224
|
-
/* @__PURE__ */ (0,
|
|
12557
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
12225
12558
|
renderRadio(),
|
|
12226
|
-
/* @__PURE__ */ (0,
|
|
12559
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12227
12560
|
"span",
|
|
12228
12561
|
{
|
|
12229
12562
|
className: cn(
|
|
@@ -12234,14 +12567,14 @@ var AlternativesList = ({
|
|
|
12234
12567
|
}
|
|
12235
12568
|
)
|
|
12236
12569
|
] }),
|
|
12237
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
12570
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12238
12571
|
]
|
|
12239
12572
|
},
|
|
12240
12573
|
alternativeId
|
|
12241
12574
|
);
|
|
12242
12575
|
};
|
|
12243
12576
|
if (isReadonly) {
|
|
12244
|
-
return /* @__PURE__ */ (0,
|
|
12577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12245
12578
|
"div",
|
|
12246
12579
|
{
|
|
12247
12580
|
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
@@ -12251,7 +12584,7 @@ var AlternativesList = ({
|
|
|
12251
12584
|
}
|
|
12252
12585
|
);
|
|
12253
12586
|
}
|
|
12254
|
-
return /* @__PURE__ */ (0,
|
|
12587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12255
12588
|
RadioGroup,
|
|
12256
12589
|
{
|
|
12257
12590
|
name: groupName,
|
|
@@ -12268,7 +12601,7 @@ var AlternativesList = ({
|
|
|
12268
12601
|
const statusStyles = getStatusStyles2(alternative.status, false);
|
|
12269
12602
|
const statusBadge = getStatusBadge2(alternative.status);
|
|
12270
12603
|
if (layout === "detailed") {
|
|
12271
|
-
return /* @__PURE__ */ (0,
|
|
12604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12272
12605
|
"div",
|
|
12273
12606
|
{
|
|
12274
12607
|
className: cn(
|
|
@@ -12276,9 +12609,9 @@ var AlternativesList = ({
|
|
|
12276
12609
|
statusStyles,
|
|
12277
12610
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
12278
12611
|
),
|
|
12279
|
-
children: /* @__PURE__ */ (0,
|
|
12280
|
-
/* @__PURE__ */ (0,
|
|
12281
|
-
/* @__PURE__ */ (0,
|
|
12612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
12613
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
12614
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12282
12615
|
RadioGroupItem,
|
|
12283
12616
|
{
|
|
12284
12617
|
value: alternative.value,
|
|
@@ -12287,8 +12620,8 @@ var AlternativesList = ({
|
|
|
12287
12620
|
className: "mt-1"
|
|
12288
12621
|
}
|
|
12289
12622
|
),
|
|
12290
|
-
/* @__PURE__ */ (0,
|
|
12291
|
-
/* @__PURE__ */ (0,
|
|
12623
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-1", children: [
|
|
12624
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12292
12625
|
"label",
|
|
12293
12626
|
{
|
|
12294
12627
|
htmlFor: alternativeId,
|
|
@@ -12300,16 +12633,16 @@ var AlternativesList = ({
|
|
|
12300
12633
|
children: alternative.label
|
|
12301
12634
|
}
|
|
12302
12635
|
),
|
|
12303
|
-
alternative.description && /* @__PURE__ */ (0,
|
|
12636
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
12304
12637
|
] })
|
|
12305
12638
|
] }),
|
|
12306
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
12639
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12307
12640
|
] })
|
|
12308
12641
|
},
|
|
12309
12642
|
alternativeId
|
|
12310
12643
|
);
|
|
12311
12644
|
}
|
|
12312
|
-
return /* @__PURE__ */ (0,
|
|
12645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
12313
12646
|
"div",
|
|
12314
12647
|
{
|
|
12315
12648
|
className: cn(
|
|
@@ -12318,8 +12651,8 @@ var AlternativesList = ({
|
|
|
12318
12651
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
12319
12652
|
),
|
|
12320
12653
|
children: [
|
|
12321
|
-
/* @__PURE__ */ (0,
|
|
12322
|
-
/* @__PURE__ */ (0,
|
|
12654
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
12655
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12323
12656
|
RadioGroupItem,
|
|
12324
12657
|
{
|
|
12325
12658
|
value: alternative.value,
|
|
@@ -12327,7 +12660,7 @@ var AlternativesList = ({
|
|
|
12327
12660
|
disabled: alternative.disabled
|
|
12328
12661
|
}
|
|
12329
12662
|
),
|
|
12330
|
-
/* @__PURE__ */ (0,
|
|
12663
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12331
12664
|
"label",
|
|
12332
12665
|
{
|
|
12333
12666
|
htmlFor: alternativeId,
|
|
@@ -12340,7 +12673,7 @@ var AlternativesList = ({
|
|
|
12340
12673
|
}
|
|
12341
12674
|
)
|
|
12342
12675
|
] }),
|
|
12343
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
12676
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12344
12677
|
]
|
|
12345
12678
|
},
|
|
12346
12679
|
alternativeId
|
|
@@ -12349,9 +12682,9 @@ var AlternativesList = ({
|
|
|
12349
12682
|
}
|
|
12350
12683
|
);
|
|
12351
12684
|
};
|
|
12352
|
-
var HeaderAlternative = (0,
|
|
12685
|
+
var HeaderAlternative = (0, import_react40.forwardRef)(
|
|
12353
12686
|
({ className, title, subTitle, content, ...props }, ref) => {
|
|
12354
|
-
return /* @__PURE__ */ (0,
|
|
12687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
12355
12688
|
"div",
|
|
12356
12689
|
{
|
|
12357
12690
|
ref,
|
|
@@ -12361,11 +12694,11 @@ var HeaderAlternative = (0, import_react39.forwardRef)(
|
|
|
12361
12694
|
),
|
|
12362
12695
|
...props,
|
|
12363
12696
|
children: [
|
|
12364
|
-
/* @__PURE__ */ (0,
|
|
12365
|
-
/* @__PURE__ */ (0,
|
|
12366
|
-
/* @__PURE__ */ (0,
|
|
12697
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { className: "flex flex-col", children: [
|
|
12698
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
|
|
12699
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
|
|
12367
12700
|
] }),
|
|
12368
|
-
/* @__PURE__ */ (0,
|
|
12701
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-text-950 text-md", children: content })
|
|
12369
12702
|
]
|
|
12370
12703
|
}
|
|
12371
12704
|
);
|
|
@@ -12415,7 +12748,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
12415
12748
|
}
|
|
12416
12749
|
|
|
12417
12750
|
// src/components/Auth/useUrlAuthentication.ts
|
|
12418
|
-
var
|
|
12751
|
+
var import_react41 = require("react");
|
|
12419
12752
|
var import_react_router_dom2 = require("react-router-dom");
|
|
12420
12753
|
var getAuthParams = (location, extractParams) => {
|
|
12421
12754
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -12463,8 +12796,8 @@ var handleUserData = (responseData, setUser) => {
|
|
|
12463
12796
|
};
|
|
12464
12797
|
function useUrlAuthentication(options) {
|
|
12465
12798
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
12466
|
-
const processedRef = (0,
|
|
12467
|
-
(0,
|
|
12799
|
+
const processedRef = (0, import_react41.useRef)(false);
|
|
12800
|
+
(0, import_react41.useEffect)(() => {
|
|
12468
12801
|
const handleAuthentication = async () => {
|
|
12469
12802
|
if (processedRef.current) {
|
|
12470
12803
|
return;
|
|
@@ -12535,9 +12868,9 @@ function useUrlAuthentication(options) {
|
|
|
12535
12868
|
}
|
|
12536
12869
|
|
|
12537
12870
|
// src/components/Auth/useApiConfig.ts
|
|
12538
|
-
var
|
|
12871
|
+
var import_react42 = require("react");
|
|
12539
12872
|
function useApiConfig(api) {
|
|
12540
|
-
return (0,
|
|
12873
|
+
return (0, import_react42.useMemo)(
|
|
12541
12874
|
() => ({
|
|
12542
12875
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
12543
12876
|
}),
|
|
@@ -12546,8 +12879,8 @@ function useApiConfig(api) {
|
|
|
12546
12879
|
}
|
|
12547
12880
|
|
|
12548
12881
|
// src/components/Quiz/Quiz.tsx
|
|
12549
|
-
var
|
|
12550
|
-
var
|
|
12882
|
+
var import_phosphor_react33 = require("phosphor-react");
|
|
12883
|
+
var import_react45 = require("react");
|
|
12551
12884
|
|
|
12552
12885
|
// src/components/Quiz/useQuizStore.ts
|
|
12553
12886
|
var import_zustand11 = require("zustand");
|
|
@@ -13157,12 +13490,12 @@ var useQuizStore = (0, import_zustand11.create)()(
|
|
|
13157
13490
|
);
|
|
13158
13491
|
|
|
13159
13492
|
// src/components/Quiz/QuizContent.tsx
|
|
13160
|
-
var
|
|
13493
|
+
var import_react44 = require("react");
|
|
13161
13494
|
|
|
13162
13495
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
13163
|
-
var
|
|
13164
|
-
var
|
|
13165
|
-
var
|
|
13496
|
+
var import_react43 = require("react");
|
|
13497
|
+
var import_phosphor_react31 = require("phosphor-react");
|
|
13498
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13166
13499
|
var MultipleChoiceList = ({
|
|
13167
13500
|
disabled = false,
|
|
13168
13501
|
className = "",
|
|
@@ -13172,16 +13505,16 @@ var MultipleChoiceList = ({
|
|
|
13172
13505
|
onHandleSelectedValues,
|
|
13173
13506
|
mode = "interactive"
|
|
13174
13507
|
}) => {
|
|
13175
|
-
const [actualValue, setActualValue] = (0,
|
|
13176
|
-
(0,
|
|
13508
|
+
const [actualValue, setActualValue] = (0, import_react43.useState)(selectedValues);
|
|
13509
|
+
(0, import_react43.useEffect)(() => {
|
|
13177
13510
|
setActualValue(selectedValues);
|
|
13178
13511
|
}, [selectedValues]);
|
|
13179
13512
|
const getStatusBadge2 = (status) => {
|
|
13180
13513
|
switch (status) {
|
|
13181
13514
|
case "correct":
|
|
13182
|
-
return /* @__PURE__ */ (0,
|
|
13515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_phosphor_react31.CheckCircle, {}), children: "Resposta correta" });
|
|
13183
13516
|
case "incorrect":
|
|
13184
|
-
return /* @__PURE__ */ (0,
|
|
13517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_phosphor_react31.XCircle, {}), children: "Resposta incorreta" });
|
|
13185
13518
|
default:
|
|
13186
13519
|
return null;
|
|
13187
13520
|
}
|
|
@@ -13202,14 +13535,14 @@ var MultipleChoiceList = ({
|
|
|
13202
13535
|
isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
|
|
13203
13536
|
isDisabled && "opacity-40 cursor-not-allowed"
|
|
13204
13537
|
);
|
|
13205
|
-
return /* @__PURE__ */ (0,
|
|
13538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_phosphor_react31.Check, { size: 16, weight: "bold" }) });
|
|
13206
13539
|
};
|
|
13207
13540
|
if (mode === "readonly") {
|
|
13208
|
-
return /* @__PURE__ */ (0,
|
|
13541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
13209
13542
|
const isSelected = actualValue?.includes(choice.value) || false;
|
|
13210
13543
|
const statusStyles = getStatusStyles2(choice.status);
|
|
13211
13544
|
const statusBadge = getStatusBadge2(choice.status);
|
|
13212
|
-
return /* @__PURE__ */ (0,
|
|
13545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
13213
13546
|
"div",
|
|
13214
13547
|
{
|
|
13215
13548
|
className: cn(
|
|
@@ -13218,9 +13551,9 @@ var MultipleChoiceList = ({
|
|
|
13218
13551
|
choice.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
13219
13552
|
),
|
|
13220
13553
|
children: [
|
|
13221
|
-
/* @__PURE__ */ (0,
|
|
13554
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
13222
13555
|
renderVisualCheckbox(isSelected, choice.disabled || disabled),
|
|
13223
|
-
/* @__PURE__ */ (0,
|
|
13556
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13224
13557
|
"span",
|
|
13225
13558
|
{
|
|
13226
13559
|
className: cn(
|
|
@@ -13232,14 +13565,14 @@ var MultipleChoiceList = ({
|
|
|
13232
13565
|
}
|
|
13233
13566
|
)
|
|
13234
13567
|
] }),
|
|
13235
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
13568
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
13236
13569
|
]
|
|
13237
13570
|
},
|
|
13238
13571
|
`readonly-${choice.value}-${i}`
|
|
13239
13572
|
);
|
|
13240
13573
|
}) });
|
|
13241
13574
|
}
|
|
13242
|
-
return /* @__PURE__ */ (0,
|
|
13575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13243
13576
|
"div",
|
|
13244
13577
|
{
|
|
13245
13578
|
className: cn(
|
|
@@ -13247,7 +13580,7 @@ var MultipleChoiceList = ({
|
|
|
13247
13580
|
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
13248
13581
|
className
|
|
13249
13582
|
),
|
|
13250
|
-
children: /* @__PURE__ */ (0,
|
|
13583
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13251
13584
|
CheckboxList_default,
|
|
13252
13585
|
{
|
|
13253
13586
|
name,
|
|
@@ -13257,12 +13590,12 @@ var MultipleChoiceList = ({
|
|
|
13257
13590
|
onHandleSelectedValues?.(v);
|
|
13258
13591
|
},
|
|
13259
13592
|
disabled,
|
|
13260
|
-
children: choices.map((choice, i) => /* @__PURE__ */ (0,
|
|
13593
|
+
children: choices.map((choice, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
13261
13594
|
"div",
|
|
13262
13595
|
{
|
|
13263
13596
|
className: "flex flex-row gap-2 items-center",
|
|
13264
13597
|
children: [
|
|
13265
|
-
/* @__PURE__ */ (0,
|
|
13598
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13266
13599
|
CheckboxListItem,
|
|
13267
13600
|
{
|
|
13268
13601
|
value: choice.value,
|
|
@@ -13270,7 +13603,7 @@ var MultipleChoiceList = ({
|
|
|
13270
13603
|
disabled: choice.disabled || disabled
|
|
13271
13604
|
}
|
|
13272
13605
|
),
|
|
13273
|
-
/* @__PURE__ */ (0,
|
|
13606
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13274
13607
|
"label",
|
|
13275
13608
|
{
|
|
13276
13609
|
htmlFor: `interactive-${choice.value}-${i}`,
|
|
@@ -13293,19 +13626,19 @@ var MultipleChoiceList = ({
|
|
|
13293
13626
|
};
|
|
13294
13627
|
|
|
13295
13628
|
// src/components/Quiz/QuizContent.tsx
|
|
13296
|
-
var
|
|
13629
|
+
var import_phosphor_react32 = require("phosphor-react");
|
|
13297
13630
|
|
|
13298
13631
|
// src/assets/img/mock-image-question.png
|
|
13299
13632
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
13300
13633
|
|
|
13301
13634
|
// src/components/Quiz/QuizContent.tsx
|
|
13302
|
-
var
|
|
13635
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
13303
13636
|
var getStatusBadge = (status) => {
|
|
13304
13637
|
switch (status) {
|
|
13305
13638
|
case "correct":
|
|
13306
|
-
return /* @__PURE__ */ (0,
|
|
13639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_phosphor_react32.CheckCircle, {}), children: "Resposta correta" });
|
|
13307
13640
|
case "incorrect":
|
|
13308
|
-
return /* @__PURE__ */ (0,
|
|
13641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_phosphor_react32.XCircle, {}), children: "Resposta incorreta" });
|
|
13309
13642
|
default:
|
|
13310
13643
|
return null;
|
|
13311
13644
|
}
|
|
@@ -13318,13 +13651,13 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
13318
13651
|
return "bg-error-background border-error-300";
|
|
13319
13652
|
}
|
|
13320
13653
|
};
|
|
13321
|
-
var QuizSubTitle = (0,
|
|
13654
|
+
var QuizSubTitle = (0, import_react44.forwardRef)(
|
|
13322
13655
|
({ subTitle, ...props }, ref) => {
|
|
13323
|
-
return /* @__PURE__ */ (0,
|
|
13656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
13324
13657
|
}
|
|
13325
13658
|
);
|
|
13326
|
-
var QuizContainer = (0,
|
|
13327
|
-
return /* @__PURE__ */ (0,
|
|
13659
|
+
var QuizContainer = (0, import_react44.forwardRef)(({ children, className, ...props }, ref) => {
|
|
13660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13328
13661
|
"div",
|
|
13329
13662
|
{
|
|
13330
13663
|
ref,
|
|
@@ -13377,10 +13710,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
13377
13710
|
};
|
|
13378
13711
|
});
|
|
13379
13712
|
if (!alternatives)
|
|
13380
|
-
return /* @__PURE__ */ (0,
|
|
13381
|
-
return /* @__PURE__ */ (0,
|
|
13382
|
-
/* @__PURE__ */ (0,
|
|
13383
|
-
/* @__PURE__ */ (0,
|
|
13713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
13714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
13715
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13716
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13384
13717
|
AlternativesList,
|
|
13385
13718
|
{
|
|
13386
13719
|
mode: variant === "default" ? "interactive" : "readonly",
|
|
@@ -13412,15 +13745,15 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13412
13745
|
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
13413
13746
|
currentQuestion?.id || ""
|
|
13414
13747
|
);
|
|
13415
|
-
const prevSelectedValuesRef = (0,
|
|
13416
|
-
const prevQuestionIdRef = (0,
|
|
13417
|
-
const allCurrentAnswerIds = (0,
|
|
13748
|
+
const prevSelectedValuesRef = (0, import_react44.useRef)([]);
|
|
13749
|
+
const prevQuestionIdRef = (0, import_react44.useRef)("");
|
|
13750
|
+
const allCurrentAnswerIds = (0, import_react44.useMemo)(() => {
|
|
13418
13751
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
13419
13752
|
}, [allCurrentAnswers]);
|
|
13420
|
-
const selectedValues = (0,
|
|
13753
|
+
const selectedValues = (0, import_react44.useMemo)(() => {
|
|
13421
13754
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
13422
13755
|
}, [allCurrentAnswerIds]);
|
|
13423
|
-
const stableSelectedValues = (0,
|
|
13756
|
+
const stableSelectedValues = (0, import_react44.useMemo)(() => {
|
|
13424
13757
|
const currentQuestionId = currentQuestion?.id || "";
|
|
13425
13758
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
13426
13759
|
if (hasQuestionChanged) {
|
|
@@ -13444,7 +13777,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13444
13777
|
variant,
|
|
13445
13778
|
currentQuestionResult?.selectedOptions
|
|
13446
13779
|
]);
|
|
13447
|
-
const handleSelectedValues = (0,
|
|
13780
|
+
const handleSelectedValues = (0, import_react44.useCallback)(
|
|
13448
13781
|
(values) => {
|
|
13449
13782
|
if (currentQuestion) {
|
|
13450
13783
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -13452,7 +13785,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13452
13785
|
},
|
|
13453
13786
|
[currentQuestion, selectMultipleAnswer]
|
|
13454
13787
|
);
|
|
13455
|
-
const questionKey = (0,
|
|
13788
|
+
const questionKey = (0, import_react44.useMemo)(
|
|
13456
13789
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
13457
13790
|
[currentQuestion?.id]
|
|
13458
13791
|
);
|
|
@@ -13483,10 +13816,10 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13483
13816
|
};
|
|
13484
13817
|
});
|
|
13485
13818
|
if (!choices)
|
|
13486
|
-
return /* @__PURE__ */ (0,
|
|
13487
|
-
return /* @__PURE__ */ (0,
|
|
13488
|
-
/* @__PURE__ */ (0,
|
|
13489
|
-
/* @__PURE__ */ (0,
|
|
13819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
13820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
13821
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13822
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13490
13823
|
MultipleChoiceList,
|
|
13491
13824
|
{
|
|
13492
13825
|
choices,
|
|
@@ -13513,14 +13846,14 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13513
13846
|
currentQuestion?.id || ""
|
|
13514
13847
|
);
|
|
13515
13848
|
const currentAnswer = getCurrentAnswer();
|
|
13516
|
-
const textareaRef = (0,
|
|
13849
|
+
const textareaRef = (0, import_react44.useRef)(null);
|
|
13517
13850
|
const charLimit = getDissertativeCharLimit();
|
|
13518
13851
|
const handleAnswerChange = (value) => {
|
|
13519
13852
|
if (currentQuestion) {
|
|
13520
13853
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
13521
13854
|
}
|
|
13522
13855
|
};
|
|
13523
|
-
const adjustTextareaHeight = (0,
|
|
13856
|
+
const adjustTextareaHeight = (0, import_react44.useCallback)(() => {
|
|
13524
13857
|
if (textareaRef.current) {
|
|
13525
13858
|
textareaRef.current.style.height = "auto";
|
|
13526
13859
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -13530,16 +13863,16 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13530
13863
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
13531
13864
|
}
|
|
13532
13865
|
}, []);
|
|
13533
|
-
(0,
|
|
13866
|
+
(0, import_react44.useEffect)(() => {
|
|
13534
13867
|
adjustTextareaHeight();
|
|
13535
13868
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
13536
13869
|
if (!currentQuestion) {
|
|
13537
|
-
return /* @__PURE__ */ (0,
|
|
13870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
13538
13871
|
}
|
|
13539
13872
|
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
13540
|
-
return /* @__PURE__ */ (0,
|
|
13541
|
-
/* @__PURE__ */ (0,
|
|
13542
|
-
/* @__PURE__ */ (0,
|
|
13873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
13874
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Resposta" }),
|
|
13875
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13543
13876
|
TextArea_default,
|
|
13544
13877
|
{
|
|
13545
13878
|
ref: textareaRef,
|
|
@@ -13551,10 +13884,10 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13551
13884
|
maxLength: charLimit,
|
|
13552
13885
|
showCharacterCount: !!charLimit
|
|
13553
13886
|
}
|
|
13554
|
-
) }) : /* @__PURE__ */ (0,
|
|
13555
|
-
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0,
|
|
13556
|
-
/* @__PURE__ */ (0,
|
|
13557
|
-
/* @__PURE__ */ (0,
|
|
13887
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
13888
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
13889
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
13890
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentQuestionResult?.teacherFeedback }) })
|
|
13558
13891
|
] })
|
|
13559
13892
|
] });
|
|
13560
13893
|
};
|
|
@@ -13580,16 +13913,16 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
13580
13913
|
];
|
|
13581
13914
|
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
13582
13915
|
const isDefaultVariant = variant === "default";
|
|
13583
|
-
return /* @__PURE__ */ (0,
|
|
13584
|
-
/* @__PURE__ */ (0,
|
|
13585
|
-
/* @__PURE__ */ (0,
|
|
13916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
13917
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13918
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
13586
13919
|
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
13587
|
-
return /* @__PURE__ */ (0,
|
|
13920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13588
13921
|
"section",
|
|
13589
13922
|
{
|
|
13590
13923
|
className: "flex flex-col gap-2",
|
|
13591
13924
|
children: [
|
|
13592
|
-
/* @__PURE__ */ (0,
|
|
13925
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13593
13926
|
"div",
|
|
13594
13927
|
{
|
|
13595
13928
|
className: cn(
|
|
@@ -13597,20 +13930,20 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
13597
13930
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
13598
13931
|
),
|
|
13599
13932
|
children: [
|
|
13600
|
-
/* @__PURE__ */ (0,
|
|
13601
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
13602
|
-
/* @__PURE__ */ (0,
|
|
13603
|
-
/* @__PURE__ */ (0,
|
|
13604
|
-
/* @__PURE__ */ (0,
|
|
13605
|
-
/* @__PURE__ */ (0,
|
|
13933
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
13934
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Select_default, { size: "medium", children: [
|
|
13935
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
13936
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(SelectContent, { children: [
|
|
13937
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
13938
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectItem, { value: "F", children: "Falso" })
|
|
13606
13939
|
] })
|
|
13607
|
-
] }) : /* @__PURE__ */ (0,
|
|
13940
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
13608
13941
|
]
|
|
13609
13942
|
}
|
|
13610
13943
|
),
|
|
13611
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
13612
|
-
/* @__PURE__ */ (0,
|
|
13613
|
-
!option.isCorrect && /* @__PURE__ */ (0,
|
|
13944
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
13945
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
13946
|
+
!option.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
13614
13947
|
] })
|
|
13615
13948
|
]
|
|
13616
13949
|
},
|
|
@@ -13671,7 +14004,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13671
14004
|
isCorrect: false
|
|
13672
14005
|
}
|
|
13673
14006
|
];
|
|
13674
|
-
const [userAnswers, setUserAnswers] = (0,
|
|
14007
|
+
const [userAnswers, setUserAnswers] = (0, import_react44.useState)(() => {
|
|
13675
14008
|
if (variant === "result") {
|
|
13676
14009
|
return mockUserAnswers;
|
|
13677
14010
|
}
|
|
@@ -13700,13 +14033,13 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13700
14033
|
const assignedDots = new Set(
|
|
13701
14034
|
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
13702
14035
|
);
|
|
13703
|
-
return /* @__PURE__ */ (0,
|
|
13704
|
-
/* @__PURE__ */ (0,
|
|
13705
|
-
/* @__PURE__ */ (0,
|
|
14036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
14037
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
14038
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
13706
14039
|
const answer = userAnswers[index];
|
|
13707
14040
|
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
13708
|
-
return /* @__PURE__ */ (0,
|
|
13709
|
-
/* @__PURE__ */ (0,
|
|
14041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
14042
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13710
14043
|
"div",
|
|
13711
14044
|
{
|
|
13712
14045
|
className: cn(
|
|
@@ -13714,30 +14047,30 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13714
14047
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
13715
14048
|
),
|
|
13716
14049
|
children: [
|
|
13717
|
-
/* @__PURE__ */ (0,
|
|
13718
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
14050
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
14051
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13719
14052
|
Select_default,
|
|
13720
14053
|
{
|
|
13721
14054
|
size: "medium",
|
|
13722
14055
|
value: answer.dotOption || void 0,
|
|
13723
14056
|
onValueChange: (value) => handleSelectDot(index, value),
|
|
13724
14057
|
children: [
|
|
13725
|
-
/* @__PURE__ */ (0,
|
|
13726
|
-
/* @__PURE__ */ (0,
|
|
14058
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
14059
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectContent, { children: dotsOptions.filter(
|
|
13727
14060
|
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
13728
|
-
).map((dot) => /* @__PURE__ */ (0,
|
|
14061
|
+
).map((dot) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
13729
14062
|
]
|
|
13730
14063
|
}
|
|
13731
|
-
) : /* @__PURE__ */ (0,
|
|
14064
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
13732
14065
|
]
|
|
13733
14066
|
}
|
|
13734
14067
|
),
|
|
13735
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
13736
|
-
/* @__PURE__ */ (0,
|
|
14068
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
14069
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
13737
14070
|
"Resposta selecionada: ",
|
|
13738
14071
|
answer.dotOption || "Nenhuma"
|
|
13739
14072
|
] }),
|
|
13740
|
-
!answer.isCorrect && /* @__PURE__ */ (0,
|
|
14073
|
+
!answer.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
13741
14074
|
"Resposta correta: ",
|
|
13742
14075
|
answer.correctOption
|
|
13743
14076
|
] })
|
|
@@ -13790,8 +14123,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13790
14123
|
isCorrect: true
|
|
13791
14124
|
}
|
|
13792
14125
|
];
|
|
13793
|
-
const [answers, setAnswers] = (0,
|
|
13794
|
-
const baseId = (0,
|
|
14126
|
+
const [answers, setAnswers] = (0, import_react44.useState)({});
|
|
14127
|
+
const baseId = (0, import_react44.useId)();
|
|
13795
14128
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
13796
14129
|
const usedOptions = new Set(
|
|
13797
14130
|
Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value)
|
|
@@ -13806,18 +14139,18 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13806
14139
|
const mockAnswer = mockUserAnswers.find(
|
|
13807
14140
|
(answer) => answer.selectId === selectId
|
|
13808
14141
|
);
|
|
13809
|
-
return /* @__PURE__ */ (0,
|
|
14142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
13810
14143
|
};
|
|
13811
14144
|
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
13812
|
-
return /* @__PURE__ */ (0,
|
|
14145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13813
14146
|
Select_default,
|
|
13814
14147
|
{
|
|
13815
14148
|
value: selectedValue,
|
|
13816
14149
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
13817
14150
|
className: "inline-flex mb-2.5",
|
|
13818
14151
|
children: [
|
|
13819
|
-
/* @__PURE__ */ (0,
|
|
13820
|
-
/* @__PURE__ */ (0,
|
|
14152
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-background border-gray-300", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
14153
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
13821
14154
|
]
|
|
13822
14155
|
},
|
|
13823
14156
|
`${selectId}-${startIndex}`
|
|
@@ -13829,8 +14162,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13829
14162
|
);
|
|
13830
14163
|
if (!mockAnswer) return null;
|
|
13831
14164
|
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
13832
|
-
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0,
|
|
13833
|
-
return /* @__PURE__ */ (0,
|
|
14165
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_phosphor_react32.CheckCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_phosphor_react32.XCircle, {});
|
|
14166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13834
14167
|
Badge_default,
|
|
13835
14168
|
{
|
|
13836
14169
|
variant: "solid",
|
|
@@ -13838,7 +14171,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13838
14171
|
iconRight: icon,
|
|
13839
14172
|
size: "large",
|
|
13840
14173
|
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
13841
|
-
children: /* @__PURE__ */ (0,
|
|
14174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
13842
14175
|
},
|
|
13843
14176
|
selectId
|
|
13844
14177
|
);
|
|
@@ -13894,25 +14227,25 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13894
14227
|
}
|
|
13895
14228
|
return elements;
|
|
13896
14229
|
};
|
|
13897
|
-
return /* @__PURE__ */ (0,
|
|
13898
|
-
/* @__PURE__ */ (0,
|
|
13899
|
-
/* @__PURE__ */ (0,
|
|
14230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
14231
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
14232
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13900
14233
|
"div",
|
|
13901
14234
|
{
|
|
13902
14235
|
className: cn(
|
|
13903
14236
|
"text-lg text-text-900 leading-8 h-auto",
|
|
13904
14237
|
variant != "result" && paddingBottom
|
|
13905
14238
|
),
|
|
13906
|
-
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0,
|
|
14239
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: element.element }, element.id))
|
|
13907
14240
|
}
|
|
13908
14241
|
) }) }),
|
|
13909
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
13910
|
-
/* @__PURE__ */ (0,
|
|
13911
|
-
/* @__PURE__ */ (0,
|
|
14242
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
14243
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Resultado" }),
|
|
14244
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
13912
14245
|
"div",
|
|
13913
14246
|
{
|
|
13914
14247
|
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
13915
|
-
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0,
|
|
14248
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: element.element }, element.id))
|
|
13916
14249
|
}
|
|
13917
14250
|
) }) })
|
|
13918
14251
|
] })
|
|
@@ -13930,7 +14263,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13930
14263
|
};
|
|
13931
14264
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
13932
14265
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
13933
|
-
const [clickPositionRelative, setClickPositionRelative] = (0,
|
|
14266
|
+
const [clickPositionRelative, setClickPositionRelative] = (0, import_react44.useState)(variant == "result" ? mockUserAnswerRelative : null);
|
|
13934
14267
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
13935
14268
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
13936
14269
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -13966,36 +14299,36 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13966
14299
|
}
|
|
13967
14300
|
return "bg-success-600/70 border-white";
|
|
13968
14301
|
};
|
|
13969
|
-
return /* @__PURE__ */ (0,
|
|
13970
|
-
/* @__PURE__ */ (0,
|
|
13971
|
-
/* @__PURE__ */ (0,
|
|
14302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
14303
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizSubTitle, { subTitle: "Clique na \xE1rea correta" }),
|
|
14304
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13972
14305
|
"div",
|
|
13973
14306
|
{
|
|
13974
14307
|
"data-testid": "quiz-image-container",
|
|
13975
14308
|
className: "space-y-6 p-3 relative inline-block",
|
|
13976
14309
|
children: [
|
|
13977
|
-
variant == "result" && /* @__PURE__ */ (0,
|
|
14310
|
+
variant == "result" && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13978
14311
|
"div",
|
|
13979
14312
|
{
|
|
13980
14313
|
"data-testid": "quiz-legend",
|
|
13981
14314
|
className: "flex items-center gap-4 text-xs",
|
|
13982
14315
|
children: [
|
|
13983
|
-
/* @__PURE__ */ (0,
|
|
13984
|
-
/* @__PURE__ */ (0,
|
|
13985
|
-
/* @__PURE__ */ (0,
|
|
14316
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
14317
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
14318
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "\xC1rea correta" })
|
|
13986
14319
|
] }),
|
|
13987
|
-
/* @__PURE__ */ (0,
|
|
13988
|
-
/* @__PURE__ */ (0,
|
|
13989
|
-
/* @__PURE__ */ (0,
|
|
14320
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
14321
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
14322
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta correta" })
|
|
13990
14323
|
] }),
|
|
13991
|
-
/* @__PURE__ */ (0,
|
|
13992
|
-
/* @__PURE__ */ (0,
|
|
13993
|
-
/* @__PURE__ */ (0,
|
|
14324
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
14325
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
14326
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta incorreta" })
|
|
13994
14327
|
] })
|
|
13995
14328
|
]
|
|
13996
14329
|
}
|
|
13997
14330
|
),
|
|
13998
|
-
/* @__PURE__ */ (0,
|
|
14331
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
13999
14332
|
"button",
|
|
14000
14333
|
{
|
|
14001
14334
|
"data-testid": "quiz-image-button",
|
|
@@ -14010,7 +14343,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14010
14343
|
},
|
|
14011
14344
|
"aria-label": "\xC1rea da imagem interativa",
|
|
14012
14345
|
children: [
|
|
14013
|
-
/* @__PURE__ */ (0,
|
|
14346
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14014
14347
|
"img",
|
|
14015
14348
|
{
|
|
14016
14349
|
"data-testid": "quiz-image",
|
|
@@ -14019,7 +14352,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14019
14352
|
className: "w-full h-auto rounded-md"
|
|
14020
14353
|
}
|
|
14021
14354
|
),
|
|
14022
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
14355
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14023
14356
|
"div",
|
|
14024
14357
|
{
|
|
14025
14358
|
"data-testid": "quiz-correct-circle",
|
|
@@ -14034,7 +14367,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14034
14367
|
}
|
|
14035
14368
|
}
|
|
14036
14369
|
),
|
|
14037
|
-
clickPositionRelative && /* @__PURE__ */ (0,
|
|
14370
|
+
clickPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14038
14371
|
"div",
|
|
14039
14372
|
{
|
|
14040
14373
|
"data-testid": "quiz-user-circle",
|
|
@@ -14059,7 +14392,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14059
14392
|
};
|
|
14060
14393
|
|
|
14061
14394
|
// src/components/Quiz/Quiz.tsx
|
|
14062
|
-
var
|
|
14395
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14063
14396
|
var getQuizTypeConfig = (type) => {
|
|
14064
14397
|
const QUIZ_TYPE_CONFIG = {
|
|
14065
14398
|
["SIMULADO" /* SIMULADO */]: {
|
|
@@ -14096,14 +14429,14 @@ var getFinishConfirmationText = (type) => {
|
|
|
14096
14429
|
const config = getQuizTypeConfig(type);
|
|
14097
14430
|
return `Tem certeza que deseja finalizar ${config.article} ${config.label.toLowerCase()}?`;
|
|
14098
14431
|
};
|
|
14099
|
-
var Quiz = (0,
|
|
14432
|
+
var Quiz = (0, import_react45.forwardRef)(({ children, className, variant = "default", ...props }, ref) => {
|
|
14100
14433
|
const { setVariant } = useQuizStore();
|
|
14101
|
-
(0,
|
|
14434
|
+
(0, import_react45.useEffect)(() => {
|
|
14102
14435
|
setVariant(variant);
|
|
14103
14436
|
}, [variant, setVariant]);
|
|
14104
|
-
return /* @__PURE__ */ (0,
|
|
14437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
14105
14438
|
});
|
|
14106
|
-
var QuizTitle = (0,
|
|
14439
|
+
var QuizTitle = (0, import_react45.forwardRef)(({ className, onBack, ...props }, ref) => {
|
|
14107
14440
|
const {
|
|
14108
14441
|
quiz,
|
|
14109
14442
|
currentQuestionIndex,
|
|
@@ -14113,7 +14446,7 @@ var QuizTitle = (0, import_react44.forwardRef)(({ className, onBack, ...props },
|
|
|
14113
14446
|
formatTime: formatTime2,
|
|
14114
14447
|
isStarted
|
|
14115
14448
|
} = useQuizStore();
|
|
14116
|
-
const [showExitConfirmation, setShowExitConfirmation] = (0,
|
|
14449
|
+
const [showExitConfirmation, setShowExitConfirmation] = (0, import_react45.useState)(false);
|
|
14117
14450
|
const totalQuestions = getTotalQuestions();
|
|
14118
14451
|
const quizTitle = getQuizTitle();
|
|
14119
14452
|
const handleBackClick = () => {
|
|
@@ -14137,8 +14470,8 @@ var QuizTitle = (0, import_react44.forwardRef)(({ className, onBack, ...props },
|
|
|
14137
14470
|
const handleCancelExit = () => {
|
|
14138
14471
|
setShowExitConfirmation(false);
|
|
14139
14472
|
};
|
|
14140
|
-
return /* @__PURE__ */ (0,
|
|
14141
|
-
/* @__PURE__ */ (0,
|
|
14473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
14474
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
14142
14475
|
"div",
|
|
14143
14476
|
{
|
|
14144
14477
|
ref,
|
|
@@ -14148,24 +14481,24 @@ var QuizTitle = (0, import_react44.forwardRef)(({ className, onBack, ...props },
|
|
|
14148
14481
|
),
|
|
14149
14482
|
...props,
|
|
14150
14483
|
children: [
|
|
14151
|
-
/* @__PURE__ */ (0,
|
|
14484
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14152
14485
|
IconButton_default,
|
|
14153
14486
|
{
|
|
14154
|
-
icon: /* @__PURE__ */ (0,
|
|
14487
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_phosphor_react33.CaretLeft, { size: 24 }),
|
|
14155
14488
|
size: "md",
|
|
14156
14489
|
"aria-label": "Voltar",
|
|
14157
14490
|
onClick: handleBackClick
|
|
14158
14491
|
}
|
|
14159
14492
|
),
|
|
14160
|
-
/* @__PURE__ */ (0,
|
|
14161
|
-
/* @__PURE__ */ (0,
|
|
14162
|
-
/* @__PURE__ */ (0,
|
|
14493
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
14494
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
14495
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
14163
14496
|
] }),
|
|
14164
|
-
/* @__PURE__ */ (0,
|
|
14497
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_phosphor_react33.Clock, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
14165
14498
|
]
|
|
14166
14499
|
}
|
|
14167
14500
|
),
|
|
14168
|
-
/* @__PURE__ */ (0,
|
|
14501
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14169
14502
|
AlertDialog,
|
|
14170
14503
|
{
|
|
14171
14504
|
isOpen: showExitConfirmation,
|
|
@@ -14185,7 +14518,7 @@ var QuizHeader = () => {
|
|
|
14185
14518
|
const currentQuestion = getCurrentQuestion();
|
|
14186
14519
|
let currentId = currentQuestion && "questionId" in currentQuestion ? currentQuestion.questionId : currentQuestion?.id;
|
|
14187
14520
|
const questionIndex = getQuestionIndex(currentId);
|
|
14188
|
-
return /* @__PURE__ */ (0,
|
|
14521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14189
14522
|
HeaderAlternative,
|
|
14190
14523
|
{
|
|
14191
14524
|
title: currentQuestion ? `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}` : "Quest\xE3o",
|
|
@@ -14207,7 +14540,7 @@ var QuizContent = ({ paddingBottom }) => {
|
|
|
14207
14540
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
14208
14541
|
};
|
|
14209
14542
|
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
14210
|
-
return QuestionComponent ? /* @__PURE__ */ (0,
|
|
14543
|
+
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(QuestionComponent, { paddingBottom }) : null;
|
|
14211
14544
|
};
|
|
14212
14545
|
var QuizQuestionList = ({
|
|
14213
14546
|
filterType = "all",
|
|
@@ -14254,18 +14587,18 @@ var QuizQuestionList = ({
|
|
|
14254
14587
|
return "Em branco";
|
|
14255
14588
|
}
|
|
14256
14589
|
};
|
|
14257
|
-
return /* @__PURE__ */ (0,
|
|
14258
|
-
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ (0,
|
|
14590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "space-y-6 px-4 h-full", children: [
|
|
14591
|
+
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-lg", children: "Nenhum resultado" }) }),
|
|
14259
14592
|
Object.entries(filteredGroupedQuestions).map(
|
|
14260
|
-
([subjectId, questions]) => /* @__PURE__ */ (0,
|
|
14261
|
-
/* @__PURE__ */ (0,
|
|
14262
|
-
/* @__PURE__ */ (0,
|
|
14263
|
-
/* @__PURE__ */ (0,
|
|
14593
|
+
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
14594
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
14595
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_phosphor_react33.BookOpen, { size: 17, className: "text-white" }) }),
|
|
14596
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
14264
14597
|
] }),
|
|
14265
|
-
/* @__PURE__ */ (0,
|
|
14598
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
14266
14599
|
const status = getQuestionStatus(question.id);
|
|
14267
14600
|
const questionNumber = getQuestionIndex(question.id);
|
|
14268
|
-
return /* @__PURE__ */ (0,
|
|
14601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14269
14602
|
CardStatus,
|
|
14270
14603
|
{
|
|
14271
14604
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -14282,7 +14615,7 @@ var QuizQuestionList = ({
|
|
|
14282
14615
|
)
|
|
14283
14616
|
] });
|
|
14284
14617
|
};
|
|
14285
|
-
var QuizFooter = (0,
|
|
14618
|
+
var QuizFooter = (0, import_react45.forwardRef)(
|
|
14286
14619
|
({
|
|
14287
14620
|
className,
|
|
14288
14621
|
onGoToSimulated,
|
|
@@ -14316,8 +14649,8 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14316
14649
|
const currentAnswer = getCurrentAnswer();
|
|
14317
14650
|
const currentQuestion = getCurrentQuestion();
|
|
14318
14651
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
14319
|
-
const [activeModal, setActiveModal] = (0,
|
|
14320
|
-
const [filterType, setFilterType] = (0,
|
|
14652
|
+
const [activeModal, setActiveModal] = (0, import_react45.useState)(null);
|
|
14653
|
+
const [filterType, setFilterType] = (0, import_react45.useState)("all");
|
|
14321
14654
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
14322
14655
|
const closeModal = () => setActiveModal(null);
|
|
14323
14656
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -14372,8 +14705,8 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14372
14705
|
return;
|
|
14373
14706
|
}
|
|
14374
14707
|
};
|
|
14375
|
-
return /* @__PURE__ */ (0,
|
|
14376
|
-
/* @__PURE__ */ (0,
|
|
14708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
14709
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14377
14710
|
"footer",
|
|
14378
14711
|
{
|
|
14379
14712
|
ref,
|
|
@@ -14382,17 +14715,17 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14382
14715
|
className
|
|
14383
14716
|
),
|
|
14384
14717
|
...props,
|
|
14385
|
-
children: variant === "default" ? /* @__PURE__ */ (0,
|
|
14386
|
-
/* @__PURE__ */ (0,
|
|
14387
|
-
/* @__PURE__ */ (0,
|
|
14718
|
+
children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
14719
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
|
|
14720
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14388
14721
|
IconButton_default,
|
|
14389
14722
|
{
|
|
14390
|
-
icon: /* @__PURE__ */ (0,
|
|
14723
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_phosphor_react33.SquaresFour, { size: 24, className: "text-text-950" }),
|
|
14391
14724
|
size: "md",
|
|
14392
14725
|
onClick: () => openModal("modalNavigate")
|
|
14393
14726
|
}
|
|
14394
14727
|
),
|
|
14395
|
-
isFirstQuestion ? /* @__PURE__ */ (0,
|
|
14728
|
+
isFirstQuestion ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14396
14729
|
Button_default,
|
|
14397
14730
|
{
|
|
14398
14731
|
variant: "outline",
|
|
@@ -14403,13 +14736,13 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14403
14736
|
},
|
|
14404
14737
|
children: "Pular"
|
|
14405
14738
|
}
|
|
14406
|
-
) : /* @__PURE__ */ (0,
|
|
14739
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14407
14740
|
Button_default,
|
|
14408
14741
|
{
|
|
14409
14742
|
size: "medium",
|
|
14410
14743
|
variant: "link",
|
|
14411
14744
|
action: "primary",
|
|
14412
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
14745
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_phosphor_react33.CaretLeft, { size: 18 }),
|
|
14413
14746
|
onClick: () => {
|
|
14414
14747
|
goToPreviousQuestion();
|
|
14415
14748
|
},
|
|
@@ -14417,7 +14750,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14417
14750
|
}
|
|
14418
14751
|
)
|
|
14419
14752
|
] }),
|
|
14420
|
-
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ (0,
|
|
14753
|
+
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14421
14754
|
Button_default,
|
|
14422
14755
|
{
|
|
14423
14756
|
size: "small",
|
|
@@ -14430,7 +14763,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14430
14763
|
children: "Pular"
|
|
14431
14764
|
}
|
|
14432
14765
|
),
|
|
14433
|
-
isLastQuestion ? /* @__PURE__ */ (0,
|
|
14766
|
+
isLastQuestion ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14434
14767
|
Button_default,
|
|
14435
14768
|
{
|
|
14436
14769
|
size: "medium",
|
|
@@ -14439,13 +14772,13 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14439
14772
|
onClick: handleFinishQuiz,
|
|
14440
14773
|
children: "Finalizar"
|
|
14441
14774
|
}
|
|
14442
|
-
) : /* @__PURE__ */ (0,
|
|
14775
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14443
14776
|
Button_default,
|
|
14444
14777
|
{
|
|
14445
14778
|
size: "medium",
|
|
14446
14779
|
variant: "link",
|
|
14447
14780
|
action: "primary",
|
|
14448
|
-
iconRight: /* @__PURE__ */ (0,
|
|
14781
|
+
iconRight: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_phosphor_react33.CaretRight, { size: 18 }),
|
|
14449
14782
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
14450
14783
|
onClick: () => {
|
|
14451
14784
|
goToNextQuestion();
|
|
@@ -14453,7 +14786,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14453
14786
|
children: "Avan\xE7ar"
|
|
14454
14787
|
}
|
|
14455
14788
|
)
|
|
14456
|
-
] }) : /* @__PURE__ */ (0,
|
|
14789
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-row items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14457
14790
|
Button_default,
|
|
14458
14791
|
{
|
|
14459
14792
|
variant: "link",
|
|
@@ -14465,7 +14798,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14465
14798
|
) })
|
|
14466
14799
|
}
|
|
14467
14800
|
),
|
|
14468
|
-
/* @__PURE__ */ (0,
|
|
14801
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14469
14802
|
AlertDialog,
|
|
14470
14803
|
{
|
|
14471
14804
|
isOpen: isModalOpen("alertDialog"),
|
|
@@ -14477,7 +14810,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14477
14810
|
onSubmit: handleAlertSubmit
|
|
14478
14811
|
}
|
|
14479
14812
|
),
|
|
14480
|
-
/* @__PURE__ */ (0,
|
|
14813
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14481
14814
|
Modal_default,
|
|
14482
14815
|
{
|
|
14483
14816
|
isOpen: isModalOpen("modalResult"),
|
|
@@ -14486,11 +14819,11 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14486
14819
|
closeOnEscape: false,
|
|
14487
14820
|
hideCloseButton: true,
|
|
14488
14821
|
size: "md",
|
|
14489
|
-
children: /* @__PURE__ */ (0,
|
|
14490
|
-
resultImageComponent ? /* @__PURE__ */ (0,
|
|
14491
|
-
/* @__PURE__ */ (0,
|
|
14492
|
-
/* @__PURE__ */ (0,
|
|
14493
|
-
/* @__PURE__ */ (0,
|
|
14822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14823
|
+
resultImageComponent ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14824
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14825
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: getCompletionTitle(quizType) }),
|
|
14826
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("p", { className: "text-text-500 font-sm", children: [
|
|
14494
14827
|
"Voc\xEA acertou ",
|
|
14495
14828
|
correctAnswers ?? "--",
|
|
14496
14829
|
" de ",
|
|
@@ -14499,8 +14832,8 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14499
14832
|
"quest\xF5es."
|
|
14500
14833
|
] })
|
|
14501
14834
|
] }),
|
|
14502
|
-
/* @__PURE__ */ (0,
|
|
14503
|
-
/* @__PURE__ */ (0,
|
|
14835
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
14836
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14504
14837
|
Button_default,
|
|
14505
14838
|
{
|
|
14506
14839
|
variant: "outline",
|
|
@@ -14510,38 +14843,38 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14510
14843
|
children: quizTypeLabel === "Question\xE1rio" ? "Ir para aulas" : `Ir para ${quizTypeLabel.toLocaleLowerCase()}s`
|
|
14511
14844
|
}
|
|
14512
14845
|
),
|
|
14513
|
-
/* @__PURE__ */ (0,
|
|
14846
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
14514
14847
|
] })
|
|
14515
14848
|
] })
|
|
14516
14849
|
}
|
|
14517
14850
|
),
|
|
14518
|
-
/* @__PURE__ */ (0,
|
|
14851
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14519
14852
|
Modal_default,
|
|
14520
14853
|
{
|
|
14521
14854
|
isOpen: isModalOpen("modalNavigate"),
|
|
14522
14855
|
onClose: closeModal,
|
|
14523
14856
|
title: "Quest\xF5es",
|
|
14524
14857
|
size: "lg",
|
|
14525
|
-
children: /* @__PURE__ */ (0,
|
|
14526
|
-
/* @__PURE__ */ (0,
|
|
14527
|
-
/* @__PURE__ */ (0,
|
|
14528
|
-
/* @__PURE__ */ (0,
|
|
14529
|
-
/* @__PURE__ */ (0,
|
|
14858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [
|
|
14859
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.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: [
|
|
14860
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
14861
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
14862
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14530
14863
|
SelectTrigger,
|
|
14531
14864
|
{
|
|
14532
14865
|
variant: "rounded",
|
|
14533
14866
|
className: "max-w-[266px] min-w-[160px]",
|
|
14534
|
-
children: /* @__PURE__ */ (0,
|
|
14867
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" })
|
|
14535
14868
|
}
|
|
14536
14869
|
),
|
|
14537
|
-
/* @__PURE__ */ (0,
|
|
14538
|
-
/* @__PURE__ */ (0,
|
|
14539
|
-
/* @__PURE__ */ (0,
|
|
14540
|
-
/* @__PURE__ */ (0,
|
|
14870
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(SelectContent, { children: [
|
|
14871
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SelectItem, { value: "all", children: "Todas" }),
|
|
14872
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
14873
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SelectItem, { value: "answered", children: "Respondidas" })
|
|
14541
14874
|
] })
|
|
14542
14875
|
] }) })
|
|
14543
14876
|
] }),
|
|
14544
|
-
/* @__PURE__ */ (0,
|
|
14877
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14545
14878
|
QuizQuestionList,
|
|
14546
14879
|
{
|
|
14547
14880
|
filterType,
|
|
@@ -14551,7 +14884,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14551
14884
|
] })
|
|
14552
14885
|
}
|
|
14553
14886
|
),
|
|
14554
|
-
/* @__PURE__ */ (0,
|
|
14887
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14555
14888
|
Modal_default,
|
|
14556
14889
|
{
|
|
14557
14890
|
isOpen: isModalOpen("modalResolution"),
|
|
@@ -14561,7 +14894,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14561
14894
|
children: currentQuestion?.solutionExplanation
|
|
14562
14895
|
}
|
|
14563
14896
|
),
|
|
14564
|
-
/* @__PURE__ */ (0,
|
|
14897
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14565
14898
|
Modal_default,
|
|
14566
14899
|
{
|
|
14567
14900
|
isOpen: isModalOpen("modalQuestionnaireAllCorrect"),
|
|
@@ -14570,17 +14903,17 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14570
14903
|
closeOnEscape: false,
|
|
14571
14904
|
hideCloseButton: true,
|
|
14572
14905
|
size: "md",
|
|
14573
|
-
children: /* @__PURE__ */ (0,
|
|
14574
|
-
resultImageComponent ? /* @__PURE__ */ (0,
|
|
14575
|
-
/* @__PURE__ */ (0,
|
|
14576
|
-
/* @__PURE__ */ (0,
|
|
14577
|
-
/* @__PURE__ */ (0,
|
|
14906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14907
|
+
resultImageComponent ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14908
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14909
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F389} Parab\xE9ns!" }),
|
|
14910
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-text-500 font-sm", children: "Voc\xEA concluiu o m\xF3dulo Movimento Uniforme." })
|
|
14578
14911
|
] }),
|
|
14579
|
-
/* @__PURE__ */ (0,
|
|
14912
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Button_default, { className: "w-full", onClick: onGoToNextModule, children: "Pr\xF3ximo m\xF3dulo" }) })
|
|
14580
14913
|
] })
|
|
14581
14914
|
}
|
|
14582
14915
|
),
|
|
14583
|
-
/* @__PURE__ */ (0,
|
|
14916
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14584
14917
|
Modal_default,
|
|
14585
14918
|
{
|
|
14586
14919
|
isOpen: isModalOpen("modalQuestionnaireAllIncorrect"),
|
|
@@ -14589,16 +14922,16 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14589
14922
|
closeOnEscape: false,
|
|
14590
14923
|
hideCloseButton: true,
|
|
14591
14924
|
size: "md",
|
|
14592
|
-
children: /* @__PURE__ */ (0,
|
|
14593
|
-
resultIncorrectImageComponent ? /* @__PURE__ */ (0,
|
|
14594
|
-
/* @__PURE__ */ (0,
|
|
14595
|
-
/* @__PURE__ */ (0,
|
|
14596
|
-
/* @__PURE__ */ (0,
|
|
14597
|
-
/* @__PURE__ */ (0,
|
|
14598
|
-
/* @__PURE__ */ (0,
|
|
14925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14926
|
+
resultIncorrectImageComponent ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-[282px] h-auto", children: resultIncorrectImageComponent }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14927
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14928
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F615} N\xE3o foi dessa vez..." }),
|
|
14929
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.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." }),
|
|
14930
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.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." }),
|
|
14931
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "text-text-500 font-sm", children: "Clique em Repetir Question\xE1rio e mostre do que voc\xEA \xE9 capaz! \u{1F4AA}" })
|
|
14599
14932
|
] }),
|
|
14600
|
-
/* @__PURE__ */ (0,
|
|
14601
|
-
/* @__PURE__ */ (0,
|
|
14933
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-row justify-center items-center gap-2 w-full", children: [
|
|
14934
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14602
14935
|
Button_default,
|
|
14603
14936
|
{
|
|
14604
14937
|
type: "button",
|
|
@@ -14612,7 +14945,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14612
14945
|
children: "Tentar depois"
|
|
14613
14946
|
}
|
|
14614
14947
|
),
|
|
14615
|
-
/* @__PURE__ */ (0,
|
|
14948
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14616
14949
|
Button_default,
|
|
14617
14950
|
{
|
|
14618
14951
|
variant: "outline",
|
|
@@ -14622,7 +14955,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14622
14955
|
children: "Detalhar resultado"
|
|
14623
14956
|
}
|
|
14624
14957
|
),
|
|
14625
|
-
/* @__PURE__ */ (0,
|
|
14958
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14626
14959
|
Button_default,
|
|
14627
14960
|
{
|
|
14628
14961
|
className: "w-auto",
|
|
@@ -14635,7 +14968,7 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14635
14968
|
] })
|
|
14636
14969
|
}
|
|
14637
14970
|
),
|
|
14638
|
-
/* @__PURE__ */ (0,
|
|
14971
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14639
14972
|
AlertDialog,
|
|
14640
14973
|
{
|
|
14641
14974
|
isOpen: isModalOpen("alertDialogTryLater"),
|
|
@@ -14659,37 +14992,37 @@ var QuizFooter = (0, import_react44.forwardRef)(
|
|
|
14659
14992
|
);
|
|
14660
14993
|
|
|
14661
14994
|
// src/components/Quiz/QuizResult.tsx
|
|
14662
|
-
var
|
|
14663
|
-
var
|
|
14664
|
-
var
|
|
14995
|
+
var import_react46 = require("react");
|
|
14996
|
+
var import_phosphor_react34 = require("phosphor-react");
|
|
14997
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14665
14998
|
var QuizBadge = ({
|
|
14666
14999
|
subtype
|
|
14667
15000
|
}) => {
|
|
14668
15001
|
switch (subtype) {
|
|
14669
15002
|
case "PROVA" /* PROVA */:
|
|
14670
|
-
return /* @__PURE__ */ (0,
|
|
15003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Badge_default, { variant: "examsOutlined", action: "exam2", "data-testid": "quiz-badge", children: "Prova" });
|
|
14671
15004
|
case "ENEM_PROVA_1" /* ENEM_PROVA_1 */:
|
|
14672
15005
|
case "ENEM_PROVA_2" /* ENEM_PROVA_2 */:
|
|
14673
|
-
return /* @__PURE__ */ (0,
|
|
15006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Badge_default, { variant: "examsOutlined", action: "exam1", "data-testid": "quiz-badge", children: "Enem" });
|
|
14674
15007
|
case "VESTIBULAR" /* VESTIBULAR */:
|
|
14675
|
-
return /* @__PURE__ */ (0,
|
|
15008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Badge_default, { variant: "examsOutlined", action: "exam4", "data-testid": "quiz-badge", children: "Vestibular" });
|
|
14676
15009
|
case "SIMULADO" /* SIMULADO */:
|
|
14677
15010
|
case "SIMULADAO" /* SIMULADAO */:
|
|
14678
15011
|
case void 0:
|
|
14679
|
-
return /* @__PURE__ */ (0,
|
|
15012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Badge_default, { variant: "examsOutlined", action: "exam3", "data-testid": "quiz-badge", children: "Simulad\xE3o" });
|
|
14680
15013
|
default:
|
|
14681
|
-
return /* @__PURE__ */ (0,
|
|
15014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Badge_default, { variant: "solid", action: "info", "data-testid": "quiz-badge", children: subtype });
|
|
14682
15015
|
}
|
|
14683
15016
|
};
|
|
14684
|
-
var QuizHeaderResult = (0,
|
|
15017
|
+
var QuizHeaderResult = (0, import_react46.forwardRef)(
|
|
14685
15018
|
({ className, ...props }, ref) => {
|
|
14686
15019
|
const {
|
|
14687
15020
|
getQuestionResultByQuestionId,
|
|
14688
15021
|
getCurrentQuestion,
|
|
14689
15022
|
questionsResult
|
|
14690
15023
|
} = useQuizStore();
|
|
14691
|
-
const [status, setStatus] = (0,
|
|
14692
|
-
(0,
|
|
15024
|
+
const [status, setStatus] = (0, import_react46.useState)(void 0);
|
|
15025
|
+
(0, import_react46.useEffect)(() => {
|
|
14693
15026
|
const cq = getCurrentQuestion();
|
|
14694
15027
|
if (!cq) {
|
|
14695
15028
|
setStatus(void 0);
|
|
@@ -14735,7 +15068,7 @@ var QuizHeaderResult = (0, import_react45.forwardRef)(
|
|
|
14735
15068
|
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
14736
15069
|
}
|
|
14737
15070
|
};
|
|
14738
|
-
return /* @__PURE__ */ (0,
|
|
15071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
14739
15072
|
"div",
|
|
14740
15073
|
{
|
|
14741
15074
|
ref,
|
|
@@ -14746,16 +15079,16 @@ var QuizHeaderResult = (0, import_react45.forwardRef)(
|
|
|
14746
15079
|
),
|
|
14747
15080
|
...props,
|
|
14748
15081
|
children: [
|
|
14749
|
-
/* @__PURE__ */ (0,
|
|
14750
|
-
/* @__PURE__ */ (0,
|
|
15082
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
15083
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-text-700 text-md", children: getLabelByAnswersStatus() })
|
|
14751
15084
|
]
|
|
14752
15085
|
}
|
|
14753
15086
|
);
|
|
14754
15087
|
}
|
|
14755
15088
|
);
|
|
14756
|
-
var QuizResultHeaderTitle = (0,
|
|
15089
|
+
var QuizResultHeaderTitle = (0, import_react46.forwardRef)(({ className, showBadge = true, onRepeat, canRetry, ...props }, ref) => {
|
|
14757
15090
|
const { quiz } = useQuizStore();
|
|
14758
|
-
return /* @__PURE__ */ (0,
|
|
15091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
14759
15092
|
"div",
|
|
14760
15093
|
{
|
|
14761
15094
|
ref,
|
|
@@ -14765,9 +15098,9 @@ var QuizResultHeaderTitle = (0, import_react45.forwardRef)(({ className, showBad
|
|
|
14765
15098
|
),
|
|
14766
15099
|
...props,
|
|
14767
15100
|
children: [
|
|
14768
|
-
/* @__PURE__ */ (0,
|
|
14769
|
-
/* @__PURE__ */ (0,
|
|
14770
|
-
canRetry && onRepeat && /* @__PURE__ */ (0,
|
|
15101
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
15102
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-row gap-3 items-center", children: [
|
|
15103
|
+
canRetry && onRepeat && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14771
15104
|
Button_default,
|
|
14772
15105
|
{
|
|
14773
15106
|
variant: "solid",
|
|
@@ -14777,16 +15110,16 @@ var QuizResultHeaderTitle = (0, import_react45.forwardRef)(({ className, showBad
|
|
|
14777
15110
|
children: "Repetir question\xE1rio"
|
|
14778
15111
|
}
|
|
14779
15112
|
),
|
|
14780
|
-
showBadge && /* @__PURE__ */ (0,
|
|
15113
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(QuizBadge, { subtype: quiz?.subtype || void 0 })
|
|
14781
15114
|
] })
|
|
14782
15115
|
]
|
|
14783
15116
|
}
|
|
14784
15117
|
);
|
|
14785
15118
|
});
|
|
14786
|
-
var QuizResultTitle = (0,
|
|
15119
|
+
var QuizResultTitle = (0, import_react46.forwardRef)(({ className, ...props }, ref) => {
|
|
14787
15120
|
const { getQuizTitle } = useQuizStore();
|
|
14788
15121
|
const quizTitle = getQuizTitle();
|
|
14789
|
-
return /* @__PURE__ */ (0,
|
|
15122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14790
15123
|
"p",
|
|
14791
15124
|
{
|
|
14792
15125
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -14827,7 +15160,7 @@ var calculateAnswerStatistics = (answers) => {
|
|
|
14827
15160
|
}
|
|
14828
15161
|
return stats;
|
|
14829
15162
|
};
|
|
14830
|
-
var QuizResultPerformance = (0,
|
|
15163
|
+
var QuizResultPerformance = (0, import_react46.forwardRef)(({ showDetails = true, ...props }, ref) => {
|
|
14831
15164
|
const {
|
|
14832
15165
|
getTotalQuestions,
|
|
14833
15166
|
formatTime: formatTime2,
|
|
@@ -14847,7 +15180,7 @@ var QuizResultPerformance = (0, import_react45.forwardRef)(({ showDetails = true
|
|
|
14847
15180
|
};
|
|
14848
15181
|
const percentage = totalQuestions > 0 ? Math.round(stats.correctAnswers / totalQuestions * 100) : 0;
|
|
14849
15182
|
const classesJustifyBetween = showDetails ? "justify-between" : "justify-center";
|
|
14850
|
-
return /* @__PURE__ */ (0,
|
|
15183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
14851
15184
|
"div",
|
|
14852
15185
|
{
|
|
14853
15186
|
className: cn(
|
|
@@ -14857,8 +15190,8 @@ var QuizResultPerformance = (0, import_react45.forwardRef)(({ showDetails = true
|
|
|
14857
15190
|
ref,
|
|
14858
15191
|
...props,
|
|
14859
15192
|
children: [
|
|
14860
|
-
/* @__PURE__ */ (0,
|
|
14861
|
-
/* @__PURE__ */ (0,
|
|
15193
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative", children: [
|
|
15194
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14862
15195
|
ProgressCircle_default,
|
|
14863
15196
|
{
|
|
14864
15197
|
size: "medium",
|
|
@@ -14868,24 +15201,24 @@ var QuizResultPerformance = (0, import_react45.forwardRef)(({ showDetails = true
|
|
|
14868
15201
|
label: ""
|
|
14869
15202
|
}
|
|
14870
15203
|
),
|
|
14871
|
-
/* @__PURE__ */ (0,
|
|
14872
|
-
showDetails && /* @__PURE__ */ (0,
|
|
14873
|
-
/* @__PURE__ */ (0,
|
|
14874
|
-
/* @__PURE__ */ (0,
|
|
15204
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
15205
|
+
showDetails && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
15206
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_phosphor_react34.Clock, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
15207
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(
|
|
14875
15208
|
(getQuestionResultStatistics()?.timeSpent ?? 0) * 60
|
|
14876
15209
|
) })
|
|
14877
15210
|
] }),
|
|
14878
|
-
/* @__PURE__ */ (0,
|
|
15211
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
14879
15212
|
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
14880
15213
|
" de",
|
|
14881
15214
|
" ",
|
|
14882
15215
|
totalQuestions
|
|
14883
15216
|
] }),
|
|
14884
|
-
/* @__PURE__ */ (0,
|
|
15217
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
14885
15218
|
] })
|
|
14886
15219
|
] }),
|
|
14887
|
-
showDetails && /* @__PURE__ */ (0,
|
|
14888
|
-
/* @__PURE__ */ (0,
|
|
15220
|
+
showDetails && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
15221
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14889
15222
|
ProgressBar_default,
|
|
14890
15223
|
{
|
|
14891
15224
|
className: "w-full",
|
|
@@ -14899,7 +15232,7 @@ var QuizResultPerformance = (0, import_react45.forwardRef)(({ showDetails = true
|
|
|
14899
15232
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
14900
15233
|
}
|
|
14901
15234
|
),
|
|
14902
|
-
/* @__PURE__ */ (0,
|
|
15235
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14903
15236
|
ProgressBar_default,
|
|
14904
15237
|
{
|
|
14905
15238
|
className: "w-full",
|
|
@@ -14913,7 +15246,7 @@ var QuizResultPerformance = (0, import_react45.forwardRef)(({ showDetails = true
|
|
|
14913
15246
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
14914
15247
|
}
|
|
14915
15248
|
),
|
|
14916
|
-
/* @__PURE__ */ (0,
|
|
15249
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14917
15250
|
ProgressBar_default,
|
|
14918
15251
|
{
|
|
14919
15252
|
className: "w-full",
|
|
@@ -14932,7 +15265,7 @@ var QuizResultPerformance = (0, import_react45.forwardRef)(({ showDetails = true
|
|
|
14932
15265
|
}
|
|
14933
15266
|
);
|
|
14934
15267
|
});
|
|
14935
|
-
var QuizListResult = (0,
|
|
15268
|
+
var QuizListResult = (0, import_react46.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
14936
15269
|
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
14937
15270
|
const { isDark } = useTheme();
|
|
14938
15271
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
@@ -14960,9 +15293,9 @@ var QuizListResult = (0, import_react45.forwardRef)(({ className, onSubjectClick
|
|
|
14960
15293
|
};
|
|
14961
15294
|
}
|
|
14962
15295
|
);
|
|
14963
|
-
return /* @__PURE__ */ (0,
|
|
14964
|
-
/* @__PURE__ */ (0,
|
|
14965
|
-
/* @__PURE__ */ (0,
|
|
15296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("section", { ref, className, ...props, children: [
|
|
15297
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
15298
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14966
15299
|
CardResults,
|
|
14967
15300
|
{
|
|
14968
15301
|
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
@@ -14986,16 +15319,16 @@ var QuizListResultByMateria = ({
|
|
|
14986
15319
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
14987
15320
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
14988
15321
|
const formattedQuestions = subject == "all" ? Object.values(groupedQuestions).flat() : answeredQuestions;
|
|
14989
|
-
return /* @__PURE__ */ (0,
|
|
14990
|
-
/* @__PURE__ */ (0,
|
|
14991
|
-
/* @__PURE__ */ (0,
|
|
14992
|
-
/* @__PURE__ */ (0,
|
|
14993
|
-
/* @__PURE__ */ (0,
|
|
15322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col", children: [
|
|
15323
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: subjectName || formattedQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name || "Sem mat\xE9ria" }) }),
|
|
15324
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("section", { className: "flex flex-col ", children: [
|
|
15325
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
15326
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: formattedQuestions.map((question) => {
|
|
14994
15327
|
const questionIndex = getQuestionIndex(
|
|
14995
15328
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14996
15329
|
question.questionId ?? question.id
|
|
14997
15330
|
);
|
|
14998
|
-
return /* @__PURE__ */ (0,
|
|
15331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14999
15332
|
CardStatus,
|
|
15000
15333
|
{
|
|
15001
15334
|
className: "max-w-full",
|
|
@@ -15021,7 +15354,7 @@ var QuizListResultByMateria = ({
|
|
|
15021
15354
|
|
|
15022
15355
|
// src/components/BreadcrumbMenu/BreadcrumbMenu.tsx
|
|
15023
15356
|
var import_react_router_dom3 = require("react-router-dom");
|
|
15024
|
-
var
|
|
15357
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
15025
15358
|
var BreadcrumbMenu = ({
|
|
15026
15359
|
breadcrumbs,
|
|
15027
15360
|
onBreadcrumbClick,
|
|
@@ -15034,17 +15367,17 @@ var BreadcrumbMenu = ({
|
|
|
15034
15367
|
}
|
|
15035
15368
|
navigate(breadcrumb.url);
|
|
15036
15369
|
};
|
|
15037
|
-
return /* @__PURE__ */ (0,
|
|
15370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15038
15371
|
Menu,
|
|
15039
15372
|
{
|
|
15040
15373
|
value: `breadcrumb-${breadcrumbs.length - 1}`,
|
|
15041
15374
|
defaultValue: "breadcrumb-0",
|
|
15042
15375
|
variant: "breadcrumb",
|
|
15043
15376
|
className,
|
|
15044
|
-
children: /* @__PURE__ */ (0,
|
|
15377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(MenuContent, { className: "w-full flex flex-row flex-wrap gap-2 !px-0", children: breadcrumbs.map((breadcrumb, index) => {
|
|
15045
15378
|
const isLast = index === breadcrumbs.length - 1;
|
|
15046
15379
|
const hasSeparator = !isLast;
|
|
15047
|
-
return /* @__PURE__ */ (0,
|
|
15380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15048
15381
|
MenuItem,
|
|
15049
15382
|
{
|
|
15050
15383
|
variant: "breadcrumb",
|
|
@@ -15062,7 +15395,7 @@ var BreadcrumbMenu = ({
|
|
|
15062
15395
|
};
|
|
15063
15396
|
|
|
15064
15397
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
15065
|
-
var
|
|
15398
|
+
var import_react47 = require("react");
|
|
15066
15399
|
|
|
15067
15400
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
15068
15401
|
var import_zustand12 = require("zustand");
|
|
@@ -15191,7 +15524,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15191
15524
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
15192
15525
|
);
|
|
15193
15526
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
15194
|
-
(0,
|
|
15527
|
+
(0, import_react47.useEffect)(() => {
|
|
15195
15528
|
const newBreadcrumbs = [root];
|
|
15196
15529
|
const previousIds = [];
|
|
15197
15530
|
for (const level of levels) {
|
|
@@ -15223,11 +15556,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15223
15556
|
};
|
|
15224
15557
|
|
|
15225
15558
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
15226
|
-
var
|
|
15559
|
+
var import_react48 = require("react");
|
|
15227
15560
|
var import_react_router_dom4 = require("react-router-dom");
|
|
15228
15561
|
var useUrlParams = (config) => {
|
|
15229
15562
|
const location = (0, import_react_router_dom4.useLocation)();
|
|
15230
|
-
return (0,
|
|
15563
|
+
return (0, import_react48.useMemo)(() => {
|
|
15231
15564
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
15232
15565
|
const params = {};
|
|
15233
15566
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -15238,15 +15571,15 @@ var useUrlParams = (config) => {
|
|
|
15238
15571
|
};
|
|
15239
15572
|
|
|
15240
15573
|
// src/hooks/useAppInitialization.ts
|
|
15241
|
-
var
|
|
15574
|
+
var import_react50 = require("react");
|
|
15242
15575
|
|
|
15243
15576
|
// src/hooks/useInstitution.ts
|
|
15244
|
-
var
|
|
15577
|
+
var import_react49 = require("react");
|
|
15245
15578
|
function useInstitutionId() {
|
|
15246
|
-
const [institutionId, setInstitutionId] = (0,
|
|
15579
|
+
const [institutionId, setInstitutionId] = (0, import_react49.useState)(() => {
|
|
15247
15580
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
15248
15581
|
});
|
|
15249
|
-
(0,
|
|
15582
|
+
(0, import_react49.useEffect)(() => {
|
|
15250
15583
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
15251
15584
|
if (!metaTag) return;
|
|
15252
15585
|
const observer = new MutationObserver(() => {
|
|
@@ -15413,7 +15746,7 @@ var useAuthStore = (0, import_zustand14.create)()(
|
|
|
15413
15746
|
function useAppInitialization() {
|
|
15414
15747
|
const getInstitutionId = useInstitutionId();
|
|
15415
15748
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
15416
|
-
const authFunctions = (0,
|
|
15749
|
+
const authFunctions = (0, import_react50.useMemo)(
|
|
15417
15750
|
() => ({
|
|
15418
15751
|
checkAuth: async () => {
|
|
15419
15752
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -15450,7 +15783,7 @@ function useAppInitialization() {
|
|
|
15450
15783
|
}
|
|
15451
15784
|
|
|
15452
15785
|
// src/hooks/useAppContent.ts
|
|
15453
|
-
var
|
|
15786
|
+
var import_react51 = require("react");
|
|
15454
15787
|
var import_react_router_dom5 = require("react-router-dom");
|
|
15455
15788
|
function useAppContent(config) {
|
|
15456
15789
|
const navigate = (0, import_react_router_dom5.useNavigate)();
|
|
@@ -15476,20 +15809,20 @@ function useAppContent(config) {
|
|
|
15476
15809
|
navigate("/painel");
|
|
15477
15810
|
}
|
|
15478
15811
|
};
|
|
15479
|
-
const handleSetSelectedProfile = (0,
|
|
15812
|
+
const handleSetSelectedProfile = (0, import_react51.useCallback)(
|
|
15480
15813
|
(profile) => {
|
|
15481
15814
|
setSelectedProfile(profile);
|
|
15482
15815
|
},
|
|
15483
15816
|
[setSelectedProfile]
|
|
15484
15817
|
);
|
|
15485
|
-
const handleClearParamsFromURL = (0,
|
|
15818
|
+
const handleClearParamsFromURL = (0, import_react51.useCallback)(() => {
|
|
15486
15819
|
if (onClearParamsFromURL) {
|
|
15487
15820
|
onClearParamsFromURL();
|
|
15488
15821
|
} else {
|
|
15489
15822
|
globalThis.location.replace("/painel");
|
|
15490
15823
|
}
|
|
15491
15824
|
}, [onClearParamsFromURL]);
|
|
15492
|
-
const handleError = (0,
|
|
15825
|
+
const handleError = (0, import_react51.useCallback)(
|
|
15493
15826
|
(error) => {
|
|
15494
15827
|
if (onError) {
|
|
15495
15828
|
onError(error);
|
|
@@ -15500,7 +15833,7 @@ function useAppContent(config) {
|
|
|
15500
15833
|
},
|
|
15501
15834
|
[navigate, onError]
|
|
15502
15835
|
);
|
|
15503
|
-
const urlAuthConfig = (0,
|
|
15836
|
+
const urlAuthConfig = (0, import_react51.useMemo)(
|
|
15504
15837
|
() => ({
|
|
15505
15838
|
setTokens,
|
|
15506
15839
|
setSessionInfo,
|
|
@@ -15526,10 +15859,10 @@ function useAppContent(config) {
|
|
|
15526
15859
|
);
|
|
15527
15860
|
useUrlAuthentication(urlAuthConfig);
|
|
15528
15861
|
const { sessionInfo } = useAuth();
|
|
15529
|
-
const institutionIdToUse = (0,
|
|
15862
|
+
const institutionIdToUse = (0, import_react51.useMemo)(() => {
|
|
15530
15863
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
15531
15864
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
15532
|
-
(0,
|
|
15865
|
+
(0, import_react51.useEffect)(() => {
|
|
15533
15866
|
if (institutionIdToUse && !initialized) {
|
|
15534
15867
|
initialize(institutionIdToUse);
|
|
15535
15868
|
}
|
|
@@ -15599,6 +15932,7 @@ function useAppContent(config) {
|
|
|
15599
15932
|
NotificationEntityType,
|
|
15600
15933
|
ProfileMenuFooter,
|
|
15601
15934
|
ProfileMenuHeader,
|
|
15935
|
+
ProfileMenuInfo,
|
|
15602
15936
|
ProfileMenuSection,
|
|
15603
15937
|
ProfileMenuTrigger,
|
|
15604
15938
|
ProfileToggleTheme,
|
|
@@ -15659,6 +15993,7 @@ function useAppContent(config) {
|
|
|
15659
15993
|
TableHead,
|
|
15660
15994
|
TableHeader,
|
|
15661
15995
|
TablePagination,
|
|
15996
|
+
TableProvider,
|
|
15662
15997
|
TableRow,
|
|
15663
15998
|
Text,
|
|
15664
15999
|
TextArea,
|