analytica-frontend-lib 1.5.76 → 1.5.78
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/ActivitiesHistory/index.js +6 -6
- package/dist/ActivitiesHistory/index.mjs +5 -5
- package/dist/ActivityCardQuestionBanks/index.js +6 -6
- package/dist/ActivityCardQuestionBanks/index.mjs +5 -5
- package/dist/ActivityCardQuestionPreview/index.js +6 -6
- package/dist/ActivityCardQuestionPreview/index.mjs +5 -5
- package/dist/ActivityCreate/index.js +6 -6
- package/dist/ActivityCreate/index.mjs +5 -5
- package/dist/ActivityDetails/index.js +6 -6
- package/dist/ActivityDetails/index.mjs +5 -5
- package/dist/ActivityFilters/index.js +6 -6
- package/dist/ActivityFilters/index.mjs +5 -5
- package/dist/ActivityPageLayout/index.js +6 -6
- package/dist/ActivityPageLayout/index.mjs +5 -5
- package/dist/ActivityPreview/index.js +6 -6
- package/dist/ActivityPreview/index.mjs +5 -5
- package/dist/AlertManager/index.js +6 -6
- package/dist/AlertManager/index.mjs +5 -5
- package/dist/CheckBoxGroup/index.js +6 -6
- package/dist/CheckBoxGroup/index.mjs +5 -5
- package/dist/ExamDetailsLayout/ExamDetailsPage/index.js +6 -6
- package/dist/ExamDetailsLayout/ExamDetailsPage/index.mjs +5 -5
- package/dist/ExamPageLayout/index.js +6 -6
- package/dist/ExamPageLayout/index.mjs +5 -5
- package/dist/ModuleProtectedRoute/index.js +3 -3
- package/dist/ModuleProtectedRoute/index.mjs +2 -2
- package/dist/PrintableUsersTable/index.js +6 -6
- package/dist/PrintableUsersTable/index.mjs +5 -5
- package/dist/RecommendedLessonCreate/index.js +6 -6
- package/dist/RecommendedLessonCreate/index.mjs +5 -5
- package/dist/RecommendedLessonsHistory/index.js +6 -6
- package/dist/RecommendedLessonsHistory/index.mjs +5 -5
- package/dist/SendActivityModal/SendActivityModal.d.ts +1 -1
- package/dist/SendActivityModal/SendActivityModal.d.ts.map +1 -1
- package/dist/SendActivityModal/SendActivityModal.js +6 -6
- package/dist/SendActivityModal/SendActivityModal.mjs +5 -5
- package/dist/SendActivityModal/hooks/useSendActivityModal.js +1 -1
- package/dist/SendActivityModal/hooks/useSendActivityModal.mjs +1 -1
- package/dist/SendActivityModal/index.js +6 -6
- package/dist/SendActivityModal/index.mjs +5 -5
- package/dist/SendActivityModal/types.d.ts +6 -0
- package/dist/SendActivityModal/types.d.ts.map +1 -1
- package/dist/SendActivityModal/types.js +2 -2
- package/dist/SendActivityModal/types.mjs +1 -1
- package/dist/SendActivityModal/validation.js +1 -1
- package/dist/SendActivityModal/validation.mjs +1 -1
- package/dist/SendLessonModal/index.d.ts +1 -1
- package/dist/SendLessonModal/index.d.ts.map +1 -1
- package/dist/SendLessonModal/index.js +6 -6
- package/dist/SendLessonModal/index.mjs +5 -5
- package/dist/SimulatedPerformance/SimulatedPerformanceView/index.js +6 -6
- package/dist/SimulatedPerformance/SimulatedPerformanceView/index.mjs +5 -5
- package/dist/SimulationsPage/index.js +6 -6
- package/dist/SimulationsPage/index.mjs +5 -5
- package/dist/TableProvider/index.js +6 -6
- package/dist/TableProvider/index.mjs +5 -5
- package/dist/TypeSelector/index.js +3 -3
- package/dist/TypeSelector/index.mjs +2 -2
- package/dist/UnifiedDraftModelPage/index.js +6 -6
- package/dist/UnifiedDraftModelPage/index.mjs +5 -5
- package/dist/UnifiedHistoryPage/index.js +6 -6
- package/dist/UnifiedHistoryPage/index.mjs +5 -5
- package/dist/{chunk-BRTWWTU3.js → chunk-3BKXXQXP.js} +3 -3
- package/dist/{chunk-BRTWWTU3.js.map → chunk-3BKXXQXP.js.map} +1 -1
- package/dist/{chunk-NCVAMXYV.mjs → chunk-6PH3QFMW.mjs} +8 -2
- package/dist/chunk-6PH3QFMW.mjs.map +1 -0
- package/dist/{chunk-5JF47R7V.mjs → chunk-BYHXD3DU.mjs} +2 -2
- package/dist/{chunk-T4UIREXS.js → chunk-IT5VCURL.js} +396 -381
- package/dist/chunk-IT5VCURL.js.map +1 -0
- package/dist/{chunk-VUGO7VUR.js → chunk-KFF223EV.js} +1 -1
- package/dist/{chunk-VUGO7VUR.js.map → chunk-KFF223EV.js.map} +1 -1
- package/dist/{chunk-Y457NXR3.js → chunk-PJIV7QPK.js} +8 -2
- package/dist/chunk-PJIV7QPK.js.map +1 -0
- package/dist/{chunk-6EWQZUPA.mjs → chunk-PKH5SHBS.mjs} +2 -2
- package/dist/{chunk-LJDMRQIG.js → chunk-QFIPNJ46.js} +3 -3
- package/dist/{chunk-LJDMRQIG.js.map → chunk-QFIPNJ46.js.map} +1 -1
- package/dist/{chunk-42I5KRYG.mjs → chunk-TCTKQUSW.mjs} +21 -6
- package/dist/chunk-TCTKQUSW.mjs.map +1 -0
- package/dist/{chunk-GMYYB6A2.mjs → chunk-UI6YZ56K.mjs} +1 -1
- package/dist/{chunk-GMYYB6A2.mjs.map → chunk-UI6YZ56K.mjs.map} +1 -1
- package/dist/components/SendLessonModal/types.d.ts +6 -0
- package/dist/components/SendLessonModal/types.d.ts.map +1 -1
- package/dist/components/shared/SendModalBase/components/RecipientStep.d.ts +7 -0
- package/dist/components/shared/SendModalBase/components/RecipientStep.d.ts.map +1 -1
- package/dist/hooks/useAppContent/index.js +6 -6
- package/dist/hooks/useAppContent/index.mjs +5 -5
- package/dist/hooks/useModules/index.d.ts +3 -0
- package/dist/hooks/useModules/index.d.ts.map +1 -1
- package/dist/hooks/useModules/index.js +2 -2
- package/dist/hooks/useModules/index.mjs +1 -1
- package/dist/hooks/useModules.d.ts +3 -0
- package/dist/hooks/useModules.d.ts.map +1 -1
- package/dist/hooks/useSendActivity/index.js +1 -1
- package/dist/hooks/useSendActivity/index.mjs +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +5 -5
- package/dist/types/modulesConfig.d.ts +6 -0
- package/dist/types/modulesConfig.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-42I5KRYG.mjs.map +0 -1
- package/dist/chunk-NCVAMXYV.mjs.map +0 -1
- package/dist/chunk-T4UIREXS.js.map +0 -1
- package/dist/chunk-Y457NXR3.js.map +0 -1
- /package/dist/{chunk-5JF47R7V.mjs.map → chunk-BYHXD3DU.mjs.map} +0 -0
- /package/dist/{chunk-6EWQZUPA.mjs.map → chunk-PKH5SHBS.mjs.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedDraftModelPage
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-TCTKQUSW.mjs";
|
|
4
4
|
import "../chunk-5C62S5CH.mjs";
|
|
5
5
|
import "../chunk-5RHEY4U2.mjs";
|
|
6
6
|
import "../chunk-GVGQ7EUU.mjs";
|
|
@@ -30,7 +30,7 @@ import "../chunk-GZN7FRHZ.mjs";
|
|
|
30
30
|
import "../chunk-XHQ3UYXG.mjs";
|
|
31
31
|
import "../chunk-DP2FWRSQ.mjs";
|
|
32
32
|
import "../chunk-UJ2EXX45.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-BYHXD3DU.mjs";
|
|
34
34
|
import "../chunk-J2RPOBBI.mjs";
|
|
35
35
|
import "../chunk-VAESYCAF.mjs";
|
|
36
36
|
import "../chunk-P7FCUXDE.mjs";
|
|
@@ -51,8 +51,8 @@ import "../chunk-P5GVODR2.mjs";
|
|
|
51
51
|
import "../chunk-ND6SV3O2.mjs";
|
|
52
52
|
import "../chunk-QMI5GUNH.mjs";
|
|
53
53
|
import "../chunk-3RR6WIPO.mjs";
|
|
54
|
-
import "../chunk-
|
|
55
|
-
import "../chunk-
|
|
54
|
+
import "../chunk-PKH5SHBS.mjs";
|
|
55
|
+
import "../chunk-6PH3QFMW.mjs";
|
|
56
56
|
import "../chunk-ER2TQ5MG.mjs";
|
|
57
57
|
import "../chunk-A5UC667P.mjs";
|
|
58
58
|
import "../chunk-OXN6TIBM.mjs";
|
|
@@ -120,7 +120,7 @@ import "../chunk-TKYLGX3U.mjs";
|
|
|
120
120
|
import "../chunk-SV4IEAB4.mjs";
|
|
121
121
|
import "../chunk-PITPPLP2.mjs";
|
|
122
122
|
import "../chunk-4ZXYH4IW.mjs";
|
|
123
|
-
import "../chunk-
|
|
123
|
+
import "../chunk-UI6YZ56K.mjs";
|
|
124
124
|
import "../chunk-L2AMPFWU.mjs";
|
|
125
125
|
import "../chunk-LWXIPEIY.mjs";
|
|
126
126
|
import "../chunk-S6C2Q522.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIT5VCURLjs = require('../chunk-IT5VCURL.js');
|
|
4
4
|
require('../chunk-JD5ZVYX7.js');
|
|
5
5
|
require('../chunk-3JMB2O6D.js');
|
|
6
6
|
require('../chunk-PPRJH3XL.js');
|
|
@@ -30,7 +30,7 @@ require('../chunk-VG6CKFHN.js');
|
|
|
30
30
|
require('../chunk-IALYXAFQ.js');
|
|
31
31
|
require('../chunk-FVU7P5YQ.js');
|
|
32
32
|
require('../chunk-MML2FKOP.js');
|
|
33
|
-
require('../chunk-
|
|
33
|
+
require('../chunk-3BKXXQXP.js');
|
|
34
34
|
require('../chunk-ORBLY3HS.js');
|
|
35
35
|
require('../chunk-5YPVOXOZ.js');
|
|
36
36
|
require('../chunk-4DQBBXY3.js');
|
|
@@ -51,8 +51,8 @@ require('../chunk-AAP4D5O3.js');
|
|
|
51
51
|
require('../chunk-JNZKUPO5.js');
|
|
52
52
|
require('../chunk-FTGRYIZ5.js');
|
|
53
53
|
require('../chunk-V5PIDBHE.js');
|
|
54
|
-
require('../chunk-
|
|
55
|
-
require('../chunk-
|
|
54
|
+
require('../chunk-QFIPNJ46.js');
|
|
55
|
+
require('../chunk-PJIV7QPK.js');
|
|
56
56
|
require('../chunk-CRGEI3IQ.js');
|
|
57
57
|
require('../chunk-CQA4NUH5.js');
|
|
58
58
|
require('../chunk-XKS3EF2B.js');
|
|
@@ -120,7 +120,7 @@ require('../chunk-7DUIXRBU.js');
|
|
|
120
120
|
require('../chunk-TKFBC3P6.js');
|
|
121
121
|
require('../chunk-LFBSDEQE.js');
|
|
122
122
|
require('../chunk-Y7W7MHPX.js');
|
|
123
|
-
require('../chunk-
|
|
123
|
+
require('../chunk-KFF223EV.js');
|
|
124
124
|
require('../chunk-TBRQXPPO.js');
|
|
125
125
|
require('../chunk-HCNV4LNJ.js');
|
|
126
126
|
require('../chunk-B4EFRRXH.js');
|
|
@@ -241,5 +241,5 @@ require('../chunk-ZBMYDEWS.js');
|
|
|
241
241
|
require('../chunk-YQ3JVMVB.js');
|
|
242
242
|
|
|
243
243
|
|
|
244
|
-
exports.UnifiedHistoryPage =
|
|
244
|
+
exports.UnifiedHistoryPage = _chunkIT5VCURLjs.UnifiedHistoryPage;
|
|
245
245
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedHistoryPage
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-TCTKQUSW.mjs";
|
|
4
4
|
import "../chunk-5C62S5CH.mjs";
|
|
5
5
|
import "../chunk-5RHEY4U2.mjs";
|
|
6
6
|
import "../chunk-GVGQ7EUU.mjs";
|
|
@@ -30,7 +30,7 @@ import "../chunk-GZN7FRHZ.mjs";
|
|
|
30
30
|
import "../chunk-XHQ3UYXG.mjs";
|
|
31
31
|
import "../chunk-DP2FWRSQ.mjs";
|
|
32
32
|
import "../chunk-UJ2EXX45.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-BYHXD3DU.mjs";
|
|
34
34
|
import "../chunk-J2RPOBBI.mjs";
|
|
35
35
|
import "../chunk-VAESYCAF.mjs";
|
|
36
36
|
import "../chunk-P7FCUXDE.mjs";
|
|
@@ -51,8 +51,8 @@ import "../chunk-P5GVODR2.mjs";
|
|
|
51
51
|
import "../chunk-ND6SV3O2.mjs";
|
|
52
52
|
import "../chunk-QMI5GUNH.mjs";
|
|
53
53
|
import "../chunk-3RR6WIPO.mjs";
|
|
54
|
-
import "../chunk-
|
|
55
|
-
import "../chunk-
|
|
54
|
+
import "../chunk-PKH5SHBS.mjs";
|
|
55
|
+
import "../chunk-6PH3QFMW.mjs";
|
|
56
56
|
import "../chunk-ER2TQ5MG.mjs";
|
|
57
57
|
import "../chunk-A5UC667P.mjs";
|
|
58
58
|
import "../chunk-OXN6TIBM.mjs";
|
|
@@ -120,7 +120,7 @@ import "../chunk-TKYLGX3U.mjs";
|
|
|
120
120
|
import "../chunk-SV4IEAB4.mjs";
|
|
121
121
|
import "../chunk-PITPPLP2.mjs";
|
|
122
122
|
import "../chunk-4ZXYH4IW.mjs";
|
|
123
|
-
import "../chunk-
|
|
123
|
+
import "../chunk-UI6YZ56K.mjs";
|
|
124
124
|
import "../chunk-L2AMPFWU.mjs";
|
|
125
125
|
import "../chunk-LWXIPEIY.mjs";
|
|
126
126
|
import "../chunk-S6C2Q522.mjs";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk5YPVOXOZjs = require('./chunk-5YPVOXOZ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkPJIV7QPKjs = require('./chunk-PJIV7QPK.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -23,7 +23,7 @@ var TypeSelector = ({
|
|
|
23
23
|
allowedCategories: allowedCategoriesProp
|
|
24
24
|
}) => {
|
|
25
25
|
const navigate = _reactrouterdom.useNavigate.call(void 0, );
|
|
26
|
-
const { hasExams } =
|
|
26
|
+
const { hasExams } = _chunkPJIV7QPKjs.useModules.call(void 0, );
|
|
27
27
|
const allowedCategories = _react.useMemo.call(void 0, () => {
|
|
28
28
|
if (allowedCategoriesProp) {
|
|
29
29
|
return allowedCategoriesProp;
|
|
@@ -61,4 +61,4 @@ var TypeSelector_default = TypeSelector;
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
exports.TypeSelector = TypeSelector; exports.TypeSelector_default = TypeSelector_default;
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-3BKXXQXP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/analytica-frontend-lib/analytica-frontend-lib/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/analytica-frontend-lib/analytica-frontend-lib/dist/chunk-3BKXXQXP.js","../src/components/TypeSelector/TypeSelector.tsx"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACA;ACdA,8BAAqC;AACrC,kDAA4B;AAoFtB,+CAAA;AA7CC,IAAM,aAAA,EAAe,CAAC;AAAA,EAC3B,KAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA,EAAmB;AACrB,CAAA,EAAA,GAAyB;AACvB,EAAA,MAAM,SAAA,EAAW,yCAAA,CAAY;AAC7B,EAAA,MAAM,EAAE,SAAS,EAAA,EAAI,yCAAA,CAAW;AAGhC,EAAA,MAAM,kBAAA,EAAoB,4BAAA,CAAQ,EAAA,GAAM;AAEtC,IAAA,GAAA,CAAI,qBAAA,EAAuB;AACzB,MAAA,OAAO,qBAAA;AAAA,IACT;AAGA,IAAA,MAAM,WAAA,EAAyC;AAAA,MAAA;AAAA,IAE/C,CAAA;AACA,IAAA,GAAA,CAAI,QAAA,EAAU;AACZ,MAAA,UAAA,CAAW,IAAA,CAAA,mBAA+B,CAAA;AAAA,IAC5C;AAEA,IAAA,GAAA,CAAI,MAAA,CAAO,UAAA,EAAY;AACrB,MAAA,UAAA,CAAW,IAAA,CAAK,YAAY,CAAA;AAAA,IAC9B;AACA,IAAA,OAAO,UAAA;AAAA,EACT,CAAA,EAAG,CAAC,QAAA,EAAU,qBAAA,EAAuB,MAAM,CAAC,CAAA;AAE5C,EAAA,MAAM,iBAAA,EAAmB,gCAAA;AAAA,IACvB,CAAC,OAAA,EAAA,GAAoB;AACnB,MAAA,GAAA,CAAI,QAAA,IAAY,KAAA,EAAO,MAAA;AAEvB,MAAA,MAAM,WAAA,EAAa,MAAA,CAAO,OAAmC,CAAA;AAC7D,MAAA,GAAA,CAAI,CAAC,UAAA,EAAY,MAAA;AACjB,MAAA,MAAM,QAAA,EAAU,yCAAA,UAAqB,CAAA;AACrC,MAAA,QAAA,CAAS,CAAA,EAAA;AACX,IAAA;AACQ,IAAA;AACV,EAAA;AAEM,EAAA;AASJ,EAAA;AACE,oBAAA;AAGA,oBAAA;AACF,EAAA;AAEJ;AAEO;AD1CS;AACA;AACA;AACA;AACA","file":"/home/runner/work/analytica-frontend-lib/analytica-frontend-lib/dist/chunk-3BKXXQXP.js","sourcesContent":[null,"import { useCallback, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport Select, {\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from '../Select/Select';\nimport {\n type ExtendedActivityCategory,\n type ActivityCategoryConfig,\n type ActiveTab,\n getTabPath,\n} from './TypeSelector.types';\nimport { useModules } from '../../hooks/useModules';\nimport { ExamActivityCategory } from '../../types/examDrafts';\n\n/**\n * Props for the TypeSelector component\n */\nexport interface TypeSelectorProps {\n /** Current activity type selected */\n value: ExtendedActivityCategory;\n /** Current active tab (to preserve when switching types) */\n currentTab: ActiveTab;\n /** Configuration for activity types (routes and labels) */\n config: ActivityCategoryConfig;\n /**\n * Optional filter to include only specific categories.\n * If not provided, automatically calculated based on hasExams flag from useModules.\n * Only use this prop for special cases where you need to override the default behavior.\n */\n allowedCategories?: ExtendedActivityCategory[];\n}\n\n/**\n * Type selector dropdown for switching between Atividades, Provas and\n * Presenciais. Navigates to the corresponding route while preserving the\n * current tab.\n */\nexport const TypeSelector = ({\n value,\n currentTab,\n config,\n allowedCategories: allowedCategoriesProp,\n}: TypeSelectorProps) => {\n const navigate = useNavigate();\n const { hasExams } = useModules();\n\n // Calculate allowed categories based on exams module\n const allowedCategories = useMemo(() => {\n // If prop is explicitly provided, use it\n if (allowedCategoriesProp) {\n return allowedCategoriesProp;\n }\n\n // Otherwise, calculate based on hasExams flag\n const categories: ExtendedActivityCategory[] = [\n ExamActivityCategory.ATIVIDADE,\n ];\n if (hasExams) {\n categories.push(ExamActivityCategory.PROVA);\n }\n // Optional categories are opt-in: the app enables them by passing routes.\n if (config.PRESENCIAL) {\n categories.push('PRESENCIAL');\n }\n return categories;\n }, [hasExams, allowedCategoriesProp, config]);\n\n const handleTypeChange = useCallback(\n (newType: string) => {\n if (newType === value) return;\n\n const typeConfig = config[newType as ExtendedActivityCategory];\n if (!typeConfig) return;\n const tabPath = getTabPath(currentTab);\n navigate(`${typeConfig.routes.base}${tabPath}`);\n },\n [value, currentTab, navigate, config]\n );\n\n const selectItems = allowedCategories\n .filter((category) => !!config[category])\n .map((category) => (\n <SelectItem key={category} value={category}>\n {config[category]!.labels.selectorLabel}\n </SelectItem>\n ));\n\n return (\n <Select value={value} onValueChange={handleTypeChange} size=\"small\">\n <SelectTrigger className=\"w-[160px] h-8 bg-background\" variant=\"outlined\">\n <SelectValue placeholder=\"Tipo\" />\n </SelectTrigger>\n <SelectContent>{selectItems}</SelectContent>\n </Select>\n );\n};\n\nexport default TypeSelector;\n"]}
|
|
@@ -7,12 +7,14 @@ import { create } from "zustand";
|
|
|
7
7
|
import { createJSONStorage, persist } from "zustand/middleware";
|
|
8
8
|
|
|
9
9
|
// src/types/modulesConfig.ts
|
|
10
|
+
var DEFAULT_PROVA_QUESTIONS = 10;
|
|
10
11
|
var DEFAULT_SIMULATIONS = {
|
|
11
12
|
enabled: true,
|
|
12
13
|
enem: "ENABLED",
|
|
13
14
|
prova: "ENABLED",
|
|
14
15
|
simuladao: "ENABLED",
|
|
15
|
-
vestibular: "ENABLED"
|
|
16
|
+
vestibular: "ENABLED",
|
|
17
|
+
provaQuestions: DEFAULT_PROVA_QUESTIONS
|
|
16
18
|
};
|
|
17
19
|
var DEFAULT_EXAMS = true;
|
|
18
20
|
var DEFAULT_PERFORMANCE_GRAPHS = {
|
|
@@ -312,6 +314,10 @@ var useModules = () => {
|
|
|
312
314
|
// Simulations
|
|
313
315
|
hasSimulations: simulations.enabled,
|
|
314
316
|
simulations,
|
|
317
|
+
// Number of questions a generated PROVA has. Anything that is not a
|
|
318
|
+
// positive integer (unset, blank from the backoffice form) reads as the
|
|
319
|
+
// default 10 — mirrors `resolveProvaQuestionsQuantity` on the backend.
|
|
320
|
+
provaQuestions: Number.isInteger(simulations.provaQuestions) && simulations.provaQuestions > 0 ? simulations.provaQuestions : DEFAULT_PROVA_QUESTIONS,
|
|
315
321
|
// Performance graphs
|
|
316
322
|
hasPerformanceAulas: performanceGraphs.aulas ?? true,
|
|
317
323
|
hasPerformanceAcessos: performanceGraphs.acessos ?? true,
|
|
@@ -346,4 +352,4 @@ export {
|
|
|
346
352
|
useModulesStore,
|
|
347
353
|
useModules
|
|
348
354
|
};
|
|
349
|
-
//# sourceMappingURL=chunk-
|
|
355
|
+
//# sourceMappingURL=chunk-6PH3QFMW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/store/modulesStore.ts","../src/types/modulesConfig.ts","../src/hooks/useModules.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { createJSONStorage, persist } from 'zustand/middleware';\nimport { KEYS } from '../utils/keys';\nimport { useAuthStore } from './authStore';\nimport type { AxiosInstance } from 'axios';\nimport {\n type ModulesConfig,\n DEFAULT_MODULES,\n mergeModulesConfig,\n} from '../types/modulesConfig';\n\n/**\n * Default modules configuration - all enabled\n */\nconst defaultModules = DEFAULT_MODULES;\n\n/**\n * Interface defining the modules state\n */\nexport interface ActivePlan {\n code: string;\n name: string;\n}\n\nexport interface ModulesState {\n modules: ModulesConfig;\n loading: boolean;\n ownerInstitutionId: string | null;\n ownerProfileType: string | null;\n /**\n * Commercial plan the modules came from, or `null` when they came from the\n * institution (every non-B2C tenant) or when nothing has been fetched yet.\n */\n plan: ActivePlan | null;\n\n /**\n * Fetch modules configuration from the API\n * @param institutionId - The institution UUID\n * @param api - Axios instance for API calls\n * @param profileType - Optional profile type (STUDENT, TEACHER, UNIT_MANAGER, etc.)\n */\n fetchModules: (\n institutionId: string,\n api: AxiosInstance,\n profileType?: string\n ) => Promise<void>;\n clearModules: () => void;\n}\n\n/**\n * API response structure for modules feature flag\n */\ninterface ModulesFeatureFlagResponse {\n data: {\n featureFlags: {\n institutionId: string;\n page: string;\n profileType?: string | null;\n version: Partial<ModulesConfig>;\n isDefault?: boolean;\n isProfileSpecific?: boolean;\n };\n } | null;\n}\n\n/**\n * API response of `GET /me/modules` — the authenticated, per-user answer.\n */\ninterface MyModulesResponse {\n data: {\n modules: Partial<ModulesConfig>;\n plan: ActivePlan | null;\n } | null;\n}\n\n/**\n * What a fetch attempt produced. `plan` is only ever non-null for a B2C tenant.\n */\ninterface FetchedModules {\n version: Partial<ModulesConfig>;\n plan: ActivePlan | null;\n}\n\n// Guard against stale async responses\nlet latestRequestId = 0;\n\n// Retry configuration\nconst MAX_RETRIES = 3;\nconst INITIAL_RETRY_DELAY = 1000; // 1 second\n\n/**\n * Delay helper for retry backoff\n */\nconst delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\n/**\n * Read a key from localStorage, tolerating environments where access is\n * denied. Reading `localStorage` throws `SecurityError` (DOMException 18) in\n * privacy mode, with blocked cookies, or in sandboxed/cross-origin iframes;\n * treat that as \"no cached value\" instead of letting it crash app boot.\n */\nconst readLocalStorage = (key: string): string | null => {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n};\n\n/**\n * Check if modules are already cached in localStorage for the given profile\n */\nconst hasCachedModules = (profileType?: string): boolean => {\n const cached = readLocalStorage(KEYS.MODULES_STORAGE);\n if (!cached) return false;\n\n try {\n const parsed = JSON.parse(cached);\n // Check both institution and profile match\n const hasInstitution = Boolean(parsed.state?.ownerInstitutionId);\n const profileMatches =\n !profileType || parsed.state?.ownerProfileType === profileType;\n return hasInstitution && profileMatches;\n } catch {\n return false;\n }\n};\n\n/**\n * Check if this request has been superseded by a newer one\n */\nconst isStaleRequest = (requestId: number): boolean =>\n requestId !== latestRequestId;\n\n/**\n * Run `attempt` with exponential backoff, aborting as soon as a newer request\n * supersedes this one. Returns null when every attempt failed.\n */\nconst withRetry = async <T>(\n requestId: number,\n attemptFn: () => Promise<T>,\n maxRetries: number = MAX_RETRIES\n): Promise<T | null> => {\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n if (attempt > 0) {\n await delay(INITIAL_RETRY_DELAY * Math.pow(2, attempt - 1));\n }\n\n if (isStaleRequest(requestId)) return null;\n\n try {\n const result = await attemptFn();\n\n if (isStaleRequest(requestId)) return null;\n\n return result;\n } catch {\n // Continue to next retry attempt\n }\n }\n\n return null;\n};\n\n/**\n * Whether there is a session whose token the API instance can send.\n *\n * `/me/modules` is authenticated; without a token it would only ever answer 401,\n * so the public per-institution endpoint stays the pre-login path.\n */\nconst hasSession = (): boolean =>\n Boolean(useAuthStore.getState().tokens?.token);\n\n/**\n * Fetch the effective modules of the authenticated user.\n *\n * This is the only call that knows about commercial plans: in a B2C institution\n * it answers with the active plan's modules, and outside B2C it answers with the\n * institution's modules unchanged — which is why it replaces the public endpoint\n * for every product, not just the B2C one.\n */\nconst fetchMyModules = async (\n api: AxiosInstance,\n requestId: number\n): Promise<FetchedModules | null> =>\n withRetry(requestId, async () => {\n const response = await api.get<MyModulesResponse>('/me/modules');\n\n return {\n version: response.data?.data?.modules ?? {},\n plan: response.data?.data?.plan ?? null,\n };\n });\n\n/**\n * Fetch the institution's MODULES feature flag — the anonymous answer.\n *\n * Used before login, and as the fallback when `/me/modules` cannot be reached,\n * so a failure there degrades to the previous behaviour instead of an empty app.\n */\nconst fetchInstitutionModules = async (\n institutionId: string,\n api: AxiosInstance,\n requestId: number,\n profileType?: string,\n maxRetries: number = MAX_RETRIES\n): Promise<FetchedModules | null> =>\n withRetry(\n requestId,\n async () => {\n // Use the new profile-specific endpoint if profileType is provided\n const endpoint = profileType\n ? `/featureFlags/institution/${institutionId}/page/MODULES/profile/${profileType}`\n : `/featureFlags/institution/${institutionId}/page/MODULES`;\n\n const response = await api.get<ModulesFeatureFlagResponse>(endpoint);\n\n return {\n version: response.data?.data?.featureFlags?.version ?? {},\n plan: null,\n };\n },\n maxRetries\n );\n\n/**\n * Zustand store for managing modules visibility with persistence\n * Works with all frontends (student, professor, gestor)\n * Supports profile-specific feature flags\n */\nexport const useModulesStore = create<ModulesState>()(\n persist(\n (set) => ({\n modules: defaultModules,\n loading: false,\n ownerInstitutionId: null,\n ownerProfileType: null,\n plan: null,\n\n /**\n * Fetch the modules configuration from the API.\n *\n * Picks the endpoint by session, not by tenant: with a session it asks\n * `/me/modules`, which resolves the commercial plan when the institution is\n * B2C and returns the institution's own modules otherwise. Without a session\n * — the login screen — it falls back to the public per-institution flag.\n * Branching on \"is this tenant B2C?\" instead would leave the authenticated\n * path unexercised everywhere else, so it would rot.\n *\n * Caching is stale-while-revalidate. A cached value is served immediately and\n * still revalidated in the background whenever there is a session, because\n * modules can now change server-side (a plan upgrade) with nothing on the\n * client to signal it — no cache key the client builds can detect that. The\n * background pass deliberately leaves `loading` alone: `ModuleProtectedRoute`\n * renders nothing while loading, so raising it on a warm boot would blank\n * every gated route for the length of a request.\n *\n * @param institutionId - The institution UUID\n * @param api - Axios instance for API calls\n * @param profileType - Optional profile type (STUDENT, TEACHER, etc.)\n */\n fetchModules: async (\n institutionId: string,\n api: AxiosInstance,\n profileType?: string\n ): Promise<void> => {\n const authenticated = hasSession();\n const cached = hasCachedModules(profileType);\n\n // Nothing to revalidate before login: the public flag is the only answer\n // available, and it is what the cache already holds.\n if (cached && !authenticated) return;\n\n const requestId = ++latestRequestId;\n\n if (!cached) {\n set({ loading: true });\n }\n\n const result = authenticated\n ? ((await fetchMyModules(api, requestId)) ??\n // Degrade to the previous behaviour rather than to an empty app when\n // the authenticated call cannot be reached — but with a single attempt.\n // The retries belong to `/me/modules`, which is the call that gives the\n // right answer; spending a second full backoff cycle here would double\n // the time gated routes stay blank, and `ModuleProtectedRoute` renders\n // nothing while `loading`. If the authenticated call is simply absent,\n // one request settles it; if the network is down, repeating it is waste.\n (await fetchInstitutionModules(\n institutionId,\n api,\n requestId,\n profileType,\n 0\n )))\n : await fetchInstitutionModules(\n institutionId,\n api,\n requestId,\n profileType\n );\n\n if (isStaleRequest(requestId)) return;\n\n if (result === null) {\n console.warn('[modulesStore] Failed to fetch modules after retries');\n // Keep whatever is already cached; only a cold start falls back to the\n // permissive defaults, which is the pre-existing behaviour.\n set(\n cached\n ? { loading: false }\n : { modules: defaultModules, loading: false }\n );\n return;\n }\n\n set({\n modules: mergeModulesConfig(result.version),\n plan: result.plan,\n ownerInstitutionId: institutionId,\n ownerProfileType: profileType ?? null,\n loading: false,\n });\n },\n\n /**\n * Clear modules data (useful when user/institution/profile changes)\n * Also invalidates any in-flight requests to prevent stale data overwriting cleared state\n */\n clearModules: (): void => {\n latestRequestId++;\n set({\n modules: defaultModules,\n loading: false,\n ownerInstitutionId: null,\n ownerProfileType: null,\n plan: null,\n });\n },\n }),\n {\n name: KEYS.MODULES_STORAGE,\n storage: createJSONStorage(() => localStorage),\n partialize: (state) => ({\n modules: state.modules,\n ownerInstitutionId: state.ownerInstitutionId,\n ownerProfileType: state.ownerProfileType,\n plan: state.plan,\n }),\n onRehydrateStorage: () => (rehydrated) => {\n if (!rehydrated) return;\n\n // Merge with defaultModules to ensure new fields have proper defaults\n // when loading old localStorage data that may be missing new fields\n const mergedModules = mergeModulesConfig(rehydrated.modules);\n useModulesStore.setState({ modules: mergedModules });\n\n const currentInstitutionId =\n useAuthStore.getState().sessionInfo?.institutionId ?? null;\n // Use sessionInfo.profileName to match what useAppContent passes to fetchModules\n const currentProfile =\n (useAuthStore.getState().sessionInfo as { profileName?: string })\n ?.profileName ?? null;\n\n // Clear if institution or profile changed\n if (\n (rehydrated.ownerInstitutionId &&\n rehydrated.ownerInstitutionId !== currentInstitutionId) ||\n (rehydrated.ownerProfileType &&\n rehydrated.ownerProfileType !== currentProfile)\n ) {\n useModulesStore.getState().clearModules();\n }\n },\n }\n )\n);\n\n// Clear modules whenever institution or profile changes (same-tab user switch)\n// Only clear when institution/profile actually CHANGES (not on initial hydration)\n// Use sessionInfo.profileName to match what useAppContent passes to fetchModules\nlet lastInstitutionId: string | null =\n useAuthStore.getState().sessionInfo?.institutionId ?? null;\nlet lastProfileType: string | null =\n (useAuthStore.getState().sessionInfo as { profileName?: string })\n ?.profileName ?? null;\n\nuseAuthStore.subscribe((state) => {\n const nextInstitutionId = state.sessionInfo?.institutionId ?? null;\n const nextProfileType =\n (state.sessionInfo as { profileName?: string })?.profileName ?? null;\n\n if (\n nextInstitutionId !== lastInstitutionId ||\n nextProfileType !== lastProfileType\n ) {\n // Only clear modules if there was a previous value (actual change, not initial load)\n // NOTE: Don't set ownerInstitutionId/ownerProfileType here - let fetchModules set them\n // after a successful fetch. Setting them here would cause hasCachedModules to return\n // true even though we only have DEFAULT_MODULES, skipping the necessary fetch.\n if (lastInstitutionId !== null || lastProfileType !== null) {\n useModulesStore.getState().clearModules();\n }\n lastInstitutionId = nextInstitutionId;\n lastProfileType = nextProfileType;\n }\n});\n","/**\n * Visibility state of a single module/feature.\n * - ENABLED: shown and functional\n * - COMING_SOON: shown but disabled, with an \"Em breve\" badge\n * - HIDDEN: not shown at all\n */\nexport type FeatureVisibility = 'ENABLED' | 'COMING_SOON' | 'HIDDEN';\n\n/**\n * Per-institution configuration of the Simulados module.\n * `enabled` is the master toggle (gates the whole module/menu); the remaining\n * keys map 1:1 to each simulado type's `backgroundColor` (the card catalog).\n */\nexport interface SimulationsConfig {\n enabled: boolean;\n enem: FeatureVisibility;\n prova: FeatureVisibility;\n simuladao: FeatureVisibility;\n vestibular: FeatureVisibility;\n /**\n * How many questions a PROVA is generated with. Configuration, not\n * visibility — an institution that leaves it unset keeps the default 10.\n */\n provaQuestions: number;\n}\n\n/**\n * Configuration for Performance screen graphs\n */\nexport interface PerformanceGraphsConfig {\n aulas: boolean; // Lessons graph\n acessos: boolean; // Access graph\n simulados: boolean; // Simulations graph\n atividades: boolean; // Activities graph\n questoes: boolean; // Questions graph\n ranking: boolean; // Ranking graph\n}\n\n/**\n * Configuration for Reports\n */\nexport interface ReportsConfig {\n simulatedReports: boolean; // Simulados Enem (existing)\n simulatedGenericReports: boolean; // Simulados (new version)\n activitiesReports: boolean;\n questionnairesReports: boolean; // Questionários\n lessonsReports: boolean;\n essayReports: boolean;\n}\n\n/**\n * Score display options for simulations\n */\nexport interface SimulatedScoreConfig {\n tri: boolean;\n absoluto: boolean;\n}\n\n/**\n * Default simulados configuration - module on, all types enabled\n */\nexport const DEFAULT_PROVA_QUESTIONS = 10;\n\nexport const DEFAULT_SIMULATIONS: SimulationsConfig = {\n enabled: true,\n enem: 'ENABLED',\n prova: 'ENABLED',\n simuladao: 'ENABLED',\n vestibular: 'ENABLED',\n provaQuestions: DEFAULT_PROVA_QUESTIONS,\n};\n\n/**\n * Default exams configuration\n */\nexport const DEFAULT_EXAMS: boolean = true;\n\n/**\n * Default performance graphs configuration\n */\nexport const DEFAULT_PERFORMANCE_GRAPHS: PerformanceGraphsConfig = {\n aulas: true,\n acessos: true,\n simulados: true,\n atividades: true,\n questoes: true,\n ranking: true,\n};\n\n/**\n * Default reports configuration\n */\nexport const DEFAULT_REPORTS: ReportsConfig = {\n simulatedReports: true,\n simulatedGenericReports: false, // New reports default to disabled\n activitiesReports: true,\n questionnairesReports: false, // New reports default to disabled\n lessonsReports: true,\n essayReports: true,\n};\n\n/**\n * Default simulated score configuration\n */\nexport const DEFAULT_SIMULATED_SCORE: SimulatedScoreConfig = {\n tri: true,\n absoluto: true,\n};\n\n/**\n * Utility type that recursively makes all properties optional.\n * Used for API payloads and test data where only a subset of fields are provided.\n */\nexport type DeepPartial<T> = T extends object\n ? { [P in keyof T]?: DeepPartial<T[P]> }\n : T;\n\n/**\n * Complete modules configuration interface\n * All modules that can be controlled via feature flags\n */\nexport interface ModulesConfig {\n // Core modules\n simulator: boolean;\n essay: boolean;\n forum: boolean;\n support: boolean;\n chat: boolean;\n recommendedLessons: boolean;\n activities: boolean;\n questionBanks: boolean;\n comparator: boolean;\n performance: boolean;\n dashboard: boolean;\n lessons: boolean;\n\n /**\n * Printed kits — an entitlement of the top commercial plan, with no screen of\n * its own yet. Unlike every other key it defaults to `false`: it is granted by\n * a plan, never inherited from a permissive institution default.\n */\n printedKits: boolean;\n\n // Tutorial menu link (off by default; also needs a non-empty tutorialUrl)\n tutorial: boolean;\n tutorialUrl: string;\n\n /**\n * Reading-fluency mode (opt-in per institution, off by default).\n * When `true`, the platform switches to the reading-fluency-only experience:\n * the professor app hides the navigation menu and exposes only the\n * \"Teste de fluência\" page. Consumed via `useModules().hasReadingFluency`.\n */\n readingFluency: boolean;\n\n // Nested configurations\n exams: boolean;\n simulations: SimulationsConfig;\n performanceGraphs: PerformanceGraphsConfig;\n reports: ReportsConfig;\n simulatedScore: SimulatedScoreConfig;\n\n // Legacy flat fields (for backwards compatibility)\n simulatedReports: boolean;\n simulatedGenericReports: boolean;\n activitiesReports: boolean;\n questionnairesReports: boolean;\n lessonsReports: boolean;\n essayReports: boolean;\n simulatedScoreTri: boolean;\n simulatedScoreAbsoluto: boolean;\n}\n\n/**\n * Default modules configuration - all enabled (permissive default pattern)\n */\nexport const DEFAULT_MODULES: ModulesConfig = {\n // Core modules\n simulator: true,\n essay: true,\n forum: true,\n support: true,\n chat: true,\n recommendedLessons: true,\n activities: true,\n questionBanks: true,\n comparator: true,\n performance: true,\n dashboard: true,\n lessons: true,\n\n // Granted by a commercial plan only — see the interface\n printedKits: false,\n\n // Tutorial off by default (opt-in per institution, requires a url)\n tutorial: false,\n tutorialUrl: '',\n\n // Reading-fluency mode off by default (opt-in per institution)\n readingFluency: false,\n\n // Nested configurations\n exams: DEFAULT_EXAMS,\n simulations: DEFAULT_SIMULATIONS,\n performanceGraphs: DEFAULT_PERFORMANCE_GRAPHS,\n reports: DEFAULT_REPORTS,\n simulatedScore: DEFAULT_SIMULATED_SCORE,\n\n // Legacy flat fields (for backwards compatibility)\n simulatedReports: true,\n simulatedGenericReports: false,\n activitiesReports: true,\n questionnairesReports: false,\n lessonsReports: true,\n essayReports: true,\n simulatedScoreTri: true,\n simulatedScoreAbsoluto: true,\n};\n\n/**\n * Deep merge a partial config onto defaults.\n * Handles nested objects (simulations, performanceGraphs, reports, simulatedScore).\n */\nexport const mergeModulesConfig = (\n version?: DeepPartial<ModulesConfig> | null\n): ModulesConfig => {\n const v = version ?? {};\n return {\n ...DEFAULT_MODULES,\n ...v,\n // exams is now a simple boolean, use default if not provided\n exams: v.exams ?? DEFAULT_EXAMS,\n simulations: { ...DEFAULT_SIMULATIONS, ...v.simulations },\n performanceGraphs: {\n ...DEFAULT_PERFORMANCE_GRAPHS,\n ...v.performanceGraphs,\n },\n reports: { ...DEFAULT_REPORTS, ...v.reports },\n simulatedScore: { ...DEFAULT_SIMULATED_SCORE, ...v.simulatedScore },\n };\n};\n","import { useModulesStore } from '../store/modulesStore';\nimport {\n DEFAULT_SIMULATIONS,\n DEFAULT_PROVA_QUESTIONS,\n DEFAULT_PERFORMANCE_GRAPHS,\n DEFAULT_REPORTS,\n DEFAULT_SIMULATED_SCORE,\n type ModulesConfig,\n type SimulationsConfig,\n type PerformanceGraphsConfig,\n type ReportsConfig,\n type SimulatedScoreConfig,\n} from '../types/modulesConfig';\n\nexport interface UseModulesReturn {\n modules: ModulesConfig;\n loading: boolean;\n\n // Core modules\n hasSimulator: boolean;\n hasEssay: boolean;\n hasForum: boolean;\n hasSupport: boolean;\n hasChat: boolean;\n hasRecommendedLessons: boolean;\n hasActivities: boolean;\n hasQuestionBanks: boolean;\n hasComparator: boolean;\n hasPerformance: boolean;\n hasDashboard: boolean;\n hasLessons: boolean;\n\n /** Printed kits: granted by a commercial plan, so it defaults to false. */\n hasPrintedKits: boolean;\n\n // Tutorial menu link (true only when enabled AND tutorialUrl is non-empty)\n hasTutorial: boolean;\n tutorialUrl: string;\n\n // Reading-fluency mode (institution-wide; switches the app to the\n // fluency-only experience). Off by default.\n hasReadingFluency: boolean;\n\n // Exams\n hasExams: boolean;\n\n // Simulations\n /** Whether the Simulados module is enabled (master toggle). */\n hasSimulations: boolean;\n /** How many questions a generated PROVA has (default 10). */\n provaQuestions: number;\n simulations: SimulationsConfig;\n\n // Performance graphs\n hasPerformanceAulas: boolean;\n hasPerformanceAcessos: boolean;\n hasPerformanceSimulados: boolean;\n hasPerformanceAtividades: boolean;\n hasPerformanceQuestoes: boolean;\n hasPerformanceRanking: boolean;\n performanceGraphs: PerformanceGraphsConfig;\n\n // Reports\n hasSimulatedReports: boolean;\n hasSimulatedGenericReports: boolean;\n hasActivitiesReports: boolean;\n hasQuestionnairesReports: boolean;\n hasLessonsReports: boolean;\n hasEssayReports: boolean;\n reports: ReportsConfig;\n\n // Score types\n hasSimulatedScoreTri: boolean;\n hasSimulatedScoreAbsoluto: boolean;\n simulatedScore: SimulatedScoreConfig;\n}\n\n/**\n * Hook to access modules configuration\n * Provides both the raw modules object and convenience boolean helpers\n *\n * @returns {UseModulesReturn} Modules state with helper properties\n *\n * @example\n * ```tsx\n * const {\n * hasEssay,\n * hasForum,\n * hasSupport,\n * hasSimulator,\n * hasPerformanceAulas,\n * hasExams,\n * } = useModules();\n *\n * return (\n * <>\n * {hasEssay && <EssayMenuItem />}\n * {hasForum && <ForumMenuItem />}\n * {hasPerformanceAulas && <AulasGraph />}\n * </>\n * );\n * ```\n */\nexport const useModules = (): UseModulesReturn => {\n const { modules, loading } = useModulesStore();\n\n // Defensive fallbacks for nested objects - handles older persisted state\n const simulations = modules.simulations ?? DEFAULT_SIMULATIONS;\n const performanceGraphs =\n modules.performanceGraphs ?? DEFAULT_PERFORMANCE_GRAPHS;\n const reports = modules.reports ?? DEFAULT_REPORTS;\n const simulatedScore = modules.simulatedScore ?? DEFAULT_SIMULATED_SCORE;\n const tutorialUrl = (modules.tutorialUrl ?? '').trim();\n\n return {\n modules,\n loading,\n\n // Core modules\n hasSimulator: modules.simulator ?? true,\n hasEssay: modules.essay ?? true,\n hasForum: modules.forum ?? true,\n hasSupport: modules.support ?? true,\n hasChat: modules.chat ?? true,\n hasRecommendedLessons: modules.recommendedLessons ?? true,\n hasActivities: modules.activities ?? true,\n hasQuestionBanks: modules.questionBanks ?? true,\n hasComparator: modules.comparator ?? true,\n hasPerformance: modules.performance ?? true,\n hasDashboard: modules.dashboard ?? true,\n hasLessons: modules.lessons ?? true,\n\n // Not `?? true`: this one is only ever granted, never inherited.\n hasPrintedKits: modules.printedKits ?? false,\n\n // Tutorial: only show the menu link when enabled AND a url is configured\n hasTutorial: (modules.tutorial ?? false) && tutorialUrl.length > 0,\n tutorialUrl,\n\n // Reading-fluency mode (opt-in per institution, defaults off)\n hasReadingFluency: modules.readingFluency ?? false,\n\n // Exams (simple boolean, with backwards compatibility for old object format)\n hasExams:\n typeof modules.exams === 'object'\n ? ((modules.exams as { enabled?: boolean }).enabled ?? true)\n : (modules.exams ?? true),\n\n // Simulations\n hasSimulations: simulations.enabled,\n simulations,\n // Number of questions a generated PROVA has. Anything that is not a\n // positive integer (unset, blank from the backoffice form) reads as the\n // default 10 — mirrors `resolveProvaQuestionsQuantity` on the backend.\n provaQuestions:\n Number.isInteger(simulations.provaQuestions) &&\n simulations.provaQuestions > 0\n ? simulations.provaQuestions\n : DEFAULT_PROVA_QUESTIONS,\n\n // Performance graphs\n hasPerformanceAulas: performanceGraphs.aulas ?? true,\n hasPerformanceAcessos: performanceGraphs.acessos ?? true,\n hasPerformanceSimulados: performanceGraphs.simulados ?? true,\n hasPerformanceAtividades: performanceGraphs.atividades ?? true,\n hasPerformanceQuestoes: performanceGraphs.questoes ?? true,\n hasPerformanceRanking: performanceGraphs.ranking ?? true,\n performanceGraphs,\n\n // Reports (support both nested and flat for backwards compatibility)\n hasSimulatedReports:\n reports.simulatedReports ?? modules.simulatedReports ?? true,\n hasSimulatedGenericReports:\n reports.simulatedGenericReports ??\n modules.simulatedGenericReports ??\n false,\n hasActivitiesReports:\n reports.activitiesReports ?? modules.activitiesReports ?? true,\n hasQuestionnairesReports:\n reports.questionnairesReports ?? modules.questionnairesReports ?? false,\n hasLessonsReports: reports.lessonsReports ?? modules.lessonsReports ?? true,\n hasEssayReports: reports.essayReports ?? true,\n reports,\n\n // Score types (support both nested and flat for backwards compatibility)\n hasSimulatedScoreTri:\n simulatedScore.tri ?? modules.simulatedScoreTri ?? false,\n hasSimulatedScoreAbsoluto:\n simulatedScore.absoluto ?? modules.simulatedScoreAbsoluto ?? false,\n simulatedScore,\n };\n};\n"],"mappings":";;;;;AAAA,SAAS,cAAc;AACvB,SAAS,mBAAmB,eAAe;;;AC4DpC,IAAM,0BAA0B;AAEhC,IAAM,sBAAyC;AAAA,EACpD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,gBAAgB;AAClB;AAKO,IAAM,gBAAyB;AAK/B,IAAM,6BAAsD;AAAA,EACjE,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AACX;AAKO,IAAM,kBAAiC;AAAA,EAC5C,kBAAkB;AAAA,EAClB,yBAAyB;AAAA;AAAA,EACzB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA;AAAA,EACvB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAKO,IAAM,0BAAgD;AAAA,EAC3D,KAAK;AAAA,EACL,UAAU;AACZ;AAqEO,IAAM,kBAAiC;AAAA;AAAA,EAE5C,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,SAAS;A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,qBAAqB;AAAA,IAC5D,0BACE,QAAQ,yBAAyB,QAAQ,yBAAyB;AAAA,IACpE,mBAAmB,QAAQ,kBAAkB,QAAQ,kBAAkB;AAAA,IACvE,iBAAiB,QAAQ,gBAAgB;AAAA,IACzC;AAAA;AAAA,IAGA,sBACE,eAAe,OAAO,QAAQ,qBAAqB;AAAA,IACrD,2BACE,eAAe,YAAY,QAAQ,0BAA0B;AAAA,IAC/D;AAAA,EACF;AACF;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-VAESYCAF.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useModules
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6PH3QFMW.mjs";
|
|
7
7
|
import {
|
|
8
8
|
SelectContent,
|
|
9
9
|
SelectItem,
|
|
@@ -61,4 +61,4 @@ export {
|
|
|
61
61
|
TypeSelector,
|
|
62
62
|
TypeSelector_default
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-BYHXD3DU.mjs.map
|