analytica-frontend-lib 1.2.50 → 1.2.51

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.
Files changed (37) hide show
  1. package/dist/ActivityCardQuestionBanks/index.css +12 -0
  2. package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
  3. package/dist/ActivityCardQuestionPreview/index.css +12 -0
  4. package/dist/ActivityCardQuestionPreview/index.css.map +1 -1
  5. package/dist/ActivityDetails/index.css +12 -0
  6. package/dist/ActivityDetails/index.css.map +1 -1
  7. package/dist/ActivityFilters/index.css +12 -0
  8. package/dist/ActivityFilters/index.css.map +1 -1
  9. package/dist/ActivityPreview/index.css +12 -0
  10. package/dist/ActivityPreview/index.css.map +1 -1
  11. package/dist/AlertManager/index.css +12 -0
  12. package/dist/AlertManager/index.css.map +1 -1
  13. package/dist/RecommendedLessonDetails/index.d.ts +2 -1
  14. package/dist/RecommendedLessonDetails/index.d.ts.map +1 -1
  15. package/dist/RecommendedLessonDetails/index.js +2632 -28
  16. package/dist/RecommendedLessonDetails/index.js.map +1 -1
  17. package/dist/RecommendedLessonDetails/index.mjs +2668 -38
  18. package/dist/RecommendedLessonDetails/index.mjs.map +1 -1
  19. package/dist/RecommendedLessonsHistory/index.css +12 -0
  20. package/dist/RecommendedLessonsHistory/index.css.map +1 -1
  21. package/dist/SendActivityModal/SendActivityModal.css +12 -0
  22. package/dist/SendActivityModal/SendActivityModal.css.map +1 -1
  23. package/dist/SendActivityModal/index.css +12 -0
  24. package/dist/SendActivityModal/index.css.map +1 -1
  25. package/dist/TableProvider/index.css +12 -0
  26. package/dist/TableProvider/index.css.map +1 -1
  27. package/dist/index.css +12 -0
  28. package/dist/index.css.map +1 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +300 -18
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +301 -14
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/styles.css +12 -0
  36. package/dist/styles.css.map +1 -1
  37. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
2
- import { useMemo as useMemo2 } from "react";
2
+ import { useMemo as useMemo3 } from "react";
3
3
 
4
4
  // src/utils/utils.ts
5
5
  import { clsx } from "clsx";
@@ -2133,39 +2133,2668 @@ var StudentsTable = ({
2133
2133
  ] }) });
2134
2134
  };
2135
2135
 
2136
- // src/components/RecommendedLessonDetails/types.ts
2137
- var DEFAULT_LABELS = {
2138
- viewLesson: "Ver aula",
2139
- viewPerformance: "Ver desempenho",
2140
- resultsTitle: "Resultados da aula recomendada",
2141
- completedLabel: "CONCLU\xCDDO",
2142
- bestResultLabel: "MELHOR RESULTADO",
2143
- hardestTopicLabel: "MAIOR DIFICULDADE",
2144
- studentColumn: "Aluno",
2145
- statusColumn: "Status",
2146
- completionColumn: "Conclus\xE3o",
2147
- durationColumn: "Dura\xE7\xE3o"
2136
+ // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
2137
+ import { useMemo as useMemo2 } from "react";
2138
+ import {
2139
+ LightbulbFilamentIcon,
2140
+ WarningCircleIcon,
2141
+ UserIcon as UserIcon2,
2142
+ CheckCircleIcon,
2143
+ XCircleIcon
2144
+ } from "@phosphor-icons/react";
2145
+
2146
+ // src/components/Modal/Modal.tsx
2147
+ import { useEffect as useEffect2, useId } from "react";
2148
+ import { X } from "phosphor-react";
2149
+
2150
+ // src/components/Modal/utils/videoUtils.ts
2151
+ var isYouTubeUrl = (url) => {
2152
+ const youtubeRegex = /^(https?:\/\/)?((www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/.+/i;
2153
+ return youtubeRegex.test(url);
2154
+ };
2155
+ var isValidYouTubeHost = (host) => {
2156
+ if (host === "youtu.be") return "youtu.be";
2157
+ const isValidYouTubeCom = host === "youtube.com" || host.endsWith(".youtube.com") && /^(www|m|music)\.youtube\.com$/.test(host);
2158
+ if (isValidYouTubeCom) return "youtube";
2159
+ const isValidNoCookie = host === "youtube-nocookie.com" || host.endsWith(".youtube-nocookie.com") && /^(www|m|music)\.youtube-nocookie\.com$/.test(host);
2160
+ if (isValidNoCookie) return "nocookie";
2161
+ return null;
2162
+ };
2163
+ var extractYoutuBeId = (pathname) => {
2164
+ const firstSeg = pathname.split("/").filter(Boolean)[0];
2165
+ return firstSeg || null;
2166
+ };
2167
+ var extractYouTubeId = (pathname, searchParams) => {
2168
+ const parts = pathname.split("/").filter(Boolean);
2169
+ const [first, second] = parts;
2170
+ if (first === "embed" && second) return second;
2171
+ if (first === "shorts" && second) return second;
2172
+ if (first === "live" && second) return second;
2173
+ const v = searchParams.get("v");
2174
+ if (v) return v;
2175
+ return null;
2176
+ };
2177
+ var getYouTubeVideoId = (url) => {
2178
+ try {
2179
+ const u = new URL(url);
2180
+ const hostType = isValidYouTubeHost(u.hostname.toLowerCase());
2181
+ if (!hostType) return null;
2182
+ if (hostType === "youtu.be") {
2183
+ return extractYoutuBeId(u.pathname);
2184
+ }
2185
+ return extractYouTubeId(u.pathname, u.searchParams);
2186
+ } catch {
2187
+ return null;
2188
+ }
2189
+ };
2190
+ var getYouTubeEmbedUrl = (videoId) => {
2191
+ return `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0&modestbranding=1`;
2148
2192
  };
2149
2193
 
2150
- // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
2194
+ // src/components/Modal/Modal.tsx
2151
2195
  import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
2152
- var RecommendedLessonDetails = ({
2153
- data,
2154
- loading = false,
2155
- error = null,
2156
- onViewLesson,
2157
- onViewStudentPerformance,
2158
- onBreadcrumbClick,
2159
- mapSubjectNameToEnum,
2160
- breadcrumbs,
2161
- labels: customLabels,
2162
- className
2196
+ var SIZE_CLASSES5 = {
2197
+ xs: "max-w-[360px]",
2198
+ sm: "max-w-[420px]",
2199
+ md: "max-w-[510px]",
2200
+ lg: "max-w-[640px]",
2201
+ xl: "max-w-[970px]"
2202
+ };
2203
+ var Modal = ({
2204
+ isOpen,
2205
+ onClose,
2206
+ title,
2207
+ children,
2208
+ size = "md",
2209
+ className = "",
2210
+ closeOnEscape = true,
2211
+ footer,
2212
+ hideCloseButton = false,
2213
+ variant = "default",
2214
+ description,
2215
+ image,
2216
+ imageAlt,
2217
+ actionLink,
2218
+ actionLabel,
2219
+ contentClassName = ""
2163
2220
  }) => {
2164
- const labels = useMemo2(
2221
+ const titleId = useId();
2222
+ useEffect2(() => {
2223
+ if (!isOpen || !closeOnEscape) return;
2224
+ const handleEscape = (event) => {
2225
+ if (event.key === "Escape") {
2226
+ onClose();
2227
+ }
2228
+ };
2229
+ document.addEventListener("keydown", handleEscape);
2230
+ return () => document.removeEventListener("keydown", handleEscape);
2231
+ }, [isOpen, closeOnEscape, onClose]);
2232
+ useEffect2(() => {
2233
+ if (!isOpen) return;
2234
+ const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
2235
+ const originalOverflow = document.body.style.overflow;
2236
+ const originalPaddingRight = document.body.style.paddingRight;
2237
+ document.body.style.overflow = "hidden";
2238
+ if (scrollbarWidth > 0) {
2239
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
2240
+ const overlay = document.createElement("div");
2241
+ overlay.id = "modal-scrollbar-overlay";
2242
+ overlay.style.cssText = `
2243
+ position: fixed;
2244
+ top: 0;
2245
+ right: 0;
2246
+ width: ${scrollbarWidth}px;
2247
+ height: 100vh;
2248
+ background-color: rgb(0 0 0 / 0.6);
2249
+ z-index: 40;
2250
+ pointer-events: none;
2251
+ `;
2252
+ document.body.appendChild(overlay);
2253
+ }
2254
+ return () => {
2255
+ document.body.style.overflow = originalOverflow;
2256
+ document.body.style.paddingRight = originalPaddingRight;
2257
+ const overlay = document.getElementById("modal-scrollbar-overlay");
2258
+ if (overlay) {
2259
+ overlay.remove();
2260
+ }
2261
+ };
2262
+ }, [isOpen]);
2263
+ if (!isOpen) return null;
2264
+ const sizeClasses = SIZE_CLASSES5[size];
2265
+ const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
2266
+ const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
2267
+ const modalClasses = cn(
2268
+ baseClasses,
2269
+ sizeClasses,
2270
+ dialogResetClasses,
2271
+ className
2272
+ );
2273
+ const normalizeUrl = (href) => /^https?:\/\//i.test(href) ? href : `https://${href}`;
2274
+ const handleActionClick = () => {
2275
+ if (actionLink) {
2276
+ window.open(normalizeUrl(actionLink), "_blank", "noopener,noreferrer");
2277
+ }
2278
+ };
2279
+ if (variant === "activity") {
2280
+ return /* @__PURE__ */ jsx22("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ jsxs17(
2281
+ "dialog",
2282
+ {
2283
+ className: modalClasses,
2284
+ "aria-labelledby": titleId,
2285
+ "aria-modal": "true",
2286
+ open: true,
2287
+ children: [
2288
+ /* @__PURE__ */ jsx22("div", { className: "flex justify-end p-6 pb-0", children: !hideCloseButton && /* @__PURE__ */ jsx22(
2289
+ "button",
2290
+ {
2291
+ onClick: onClose,
2292
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
2293
+ "aria-label": "Fechar modal",
2294
+ children: /* @__PURE__ */ jsx22(X, { size: 18 })
2295
+ }
2296
+ ) }),
2297
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-col items-center px-6 pb-6 gap-5", children: [
2298
+ image && /* @__PURE__ */ jsx22("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx22(
2299
+ "img",
2300
+ {
2301
+ src: image,
2302
+ alt: imageAlt ?? "",
2303
+ className: "w-[122px] h-[122px] object-contain"
2304
+ }
2305
+ ) }),
2306
+ /* @__PURE__ */ jsx22(
2307
+ "h2",
2308
+ {
2309
+ id: titleId,
2310
+ className: "text-lg font-semibold text-text-950 text-center",
2311
+ children: title
2312
+ }
2313
+ ),
2314
+ description && /* @__PURE__ */ jsx22("p", { className: "text-sm font-normal text-text-400 text-center max-w-md leading-[21px]", children: description }),
2315
+ actionLink && /* @__PURE__ */ jsxs17("div", { className: "w-full", children: [
2316
+ (() => {
2317
+ const normalized = normalizeUrl(actionLink);
2318
+ const isYT = isYouTubeUrl(normalized);
2319
+ if (!isYT) return null;
2320
+ const id = getYouTubeVideoId(normalized);
2321
+ if (!id) {
2322
+ return /* @__PURE__ */ jsx22(
2323
+ Button_default,
2324
+ {
2325
+ variant: "solid",
2326
+ action: "primary",
2327
+ size: "large",
2328
+ className: "w-full",
2329
+ onClick: handleActionClick,
2330
+ children: actionLabel || "Iniciar Atividade"
2331
+ }
2332
+ );
2333
+ }
2334
+ return /* @__PURE__ */ jsx22(
2335
+ "iframe",
2336
+ {
2337
+ src: getYouTubeEmbedUrl(id),
2338
+ className: "w-full aspect-video rounded-lg",
2339
+ allowFullScreen: true,
2340
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
2341
+ title: "V\xEDdeo YouTube"
2342
+ }
2343
+ );
2344
+ })(),
2345
+ !isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ jsx22(
2346
+ Button_default,
2347
+ {
2348
+ variant: "solid",
2349
+ action: "primary",
2350
+ size: "large",
2351
+ className: "w-full",
2352
+ onClick: handleActionClick,
2353
+ children: actionLabel || "Iniciar Atividade"
2354
+ }
2355
+ )
2356
+ ] })
2357
+ ] })
2358
+ ]
2359
+ }
2360
+ ) });
2361
+ }
2362
+ return /* @__PURE__ */ jsx22("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ jsxs17(
2363
+ "dialog",
2364
+ {
2365
+ className: modalClasses,
2366
+ "aria-labelledby": titleId,
2367
+ "aria-modal": "true",
2368
+ open: true,
2369
+ children: [
2370
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between px-6 py-6", children: [
2371
+ /* @__PURE__ */ jsx22("h2", { id: titleId, className: "text-lg font-semibold text-text-950", children: title }),
2372
+ !hideCloseButton && /* @__PURE__ */ jsx22(
2373
+ "button",
2374
+ {
2375
+ onClick: onClose,
2376
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
2377
+ "aria-label": "Fechar modal",
2378
+ children: /* @__PURE__ */ jsx22(X, { size: 18 })
2379
+ }
2380
+ )
2381
+ ] }),
2382
+ children && /* @__PURE__ */ jsx22("div", { className: cn("px-6 pb-6", contentClassName), children: /* @__PURE__ */ jsx22("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
2383
+ footer && /* @__PURE__ */ jsx22("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
2384
+ ]
2385
+ }
2386
+ ) });
2387
+ };
2388
+ var Modal_default = Modal;
2389
+
2390
+ // src/components/Accordation/Accordation.tsx
2391
+ import {
2392
+ forwardRef as forwardRef4,
2393
+ useId as useId2,
2394
+ useState as useState3,
2395
+ useEffect as useEffect4
2396
+ } from "react";
2397
+
2398
+ // src/components/Card/Card.tsx
2399
+ import {
2400
+ forwardRef as forwardRef3,
2401
+ Fragment as Fragment3,
2402
+ useState as useState2,
2403
+ useRef,
2404
+ useEffect as useEffect3
2405
+ } from "react";
2406
+ import {
2407
+ CaretRight,
2408
+ ChatCircleText,
2409
+ CheckCircle,
2410
+ Clock,
2411
+ DotsThreeVertical,
2412
+ Play,
2413
+ SpeakerHigh,
2414
+ SpeakerLow,
2415
+ SpeakerSimpleX,
2416
+ XCircle
2417
+ } from "phosphor-react";
2418
+
2419
+ // src/components/IconRender/IconRender.tsx
2420
+ import { cloneElement } from "react";
2421
+ import * as PhosphorIcons from "phosphor-react";
2422
+ import { jsx as jsx23 } from "react/jsx-runtime";
2423
+ var IconRender = ({
2424
+ iconName,
2425
+ color = "#000000",
2426
+ size = 24,
2427
+ weight = "regular"
2428
+ }) => {
2429
+ if (typeof iconName === "string") {
2430
+ switch (iconName) {
2431
+ case "Chat_PT":
2432
+ return /* @__PURE__ */ jsx23(ChatPT, { size, color });
2433
+ case "Chat_EN":
2434
+ return /* @__PURE__ */ jsx23(ChatEN, { size, color });
2435
+ case "Chat_ES":
2436
+ return /* @__PURE__ */ jsx23(ChatES, { size, color });
2437
+ default: {
2438
+ const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
2439
+ return /* @__PURE__ */ jsx23(IconComponent, { size, color, weight });
2440
+ }
2441
+ }
2442
+ } else {
2443
+ return cloneElement(iconName, {
2444
+ size,
2445
+ color: "currentColor"
2446
+ });
2447
+ }
2448
+ };
2449
+ var IconRender_default = IconRender;
2450
+
2451
+ // src/components/Card/Card.tsx
2452
+ import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
2453
+ var CARD_BASE_CLASSES = {
2454
+ default: "w-full bg-background border border-border-50 rounded-xl",
2455
+ compact: "w-full bg-background border border-border-50 rounded-lg",
2456
+ minimal: "w-full bg-background border border-border-100 rounded-md"
2457
+ };
2458
+ var CARD_PADDING_CLASSES = {
2459
+ none: "",
2460
+ small: "p-2",
2461
+ medium: "p-4",
2462
+ large: "p-6"
2463
+ };
2464
+ var CARD_MIN_HEIGHT_CLASSES = {
2465
+ none: "",
2466
+ small: "min-h-16",
2467
+ medium: "min-h-20",
2468
+ large: "min-h-24"
2469
+ };
2470
+ var CARD_LAYOUT_CLASSES = {
2471
+ horizontal: "flex flex-row",
2472
+ vertical: "flex flex-col"
2473
+ };
2474
+ var CARD_CURSOR_CLASSES = {
2475
+ default: "",
2476
+ pointer: "cursor-pointer"
2477
+ };
2478
+ var CardBase = forwardRef3(
2479
+ ({
2480
+ children,
2481
+ variant = "default",
2482
+ layout = "horizontal",
2483
+ padding = "medium",
2484
+ minHeight = "medium",
2485
+ cursor = "default",
2486
+ className = "",
2487
+ ...props
2488
+ }, ref) => {
2489
+ const baseClasses = CARD_BASE_CLASSES[variant];
2490
+ const paddingClasses = CARD_PADDING_CLASSES[padding];
2491
+ const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
2492
+ const layoutClasses = CARD_LAYOUT_CLASSES[layout];
2493
+ const cursorClasses = CARD_CURSOR_CLASSES[cursor];
2494
+ return /* @__PURE__ */ jsx24(
2495
+ "div",
2496
+ {
2497
+ ref,
2498
+ className: cn(
2499
+ baseClasses,
2500
+ paddingClasses,
2501
+ minHeightClasses,
2502
+ layoutClasses,
2503
+ cursorClasses,
2504
+ className
2505
+ ),
2506
+ ...props,
2507
+ children
2508
+ }
2509
+ );
2510
+ }
2511
+ );
2512
+ var ACTION_CARD_CLASSES = {
2513
+ warning: "bg-warning-background",
2514
+ success: "bg-success-200",
2515
+ error: "bg-error-100",
2516
+ info: "bg-info-background"
2517
+ };
2518
+ var ACTION_ICON_CLASSES = {
2519
+ warning: "bg-warning-300 text-text",
2520
+ success: "bg-indicator-positive text-text-950",
2521
+ error: "bg-indicator-negative text-text",
2522
+ info: "bg-info-500 text-text"
2523
+ };
2524
+ var ACTION_SUBTITLE_CLASSES = {
2525
+ warning: "text-warning-600",
2526
+ success: "text-success-700",
2527
+ error: "text-error-700",
2528
+ info: "text-info-700"
2529
+ };
2530
+ var ACTION_HEADER_CLASSES = {
2531
+ warning: "text-warning-300",
2532
+ success: "text-success-300",
2533
+ error: "text-error-300",
2534
+ info: "text-info-300"
2535
+ };
2536
+ var CardActivitiesResults = forwardRef3(
2537
+ ({
2538
+ icon,
2539
+ title,
2540
+ subTitle,
2541
+ header,
2542
+ extended = false,
2543
+ action = "success",
2544
+ description,
2545
+ className,
2546
+ ...props
2547
+ }, ref) => {
2548
+ const actionCardClasses = ACTION_CARD_CLASSES[action];
2549
+ const actionIconClasses = ACTION_ICON_CLASSES[action];
2550
+ const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
2551
+ const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
2552
+ return /* @__PURE__ */ jsxs18(
2553
+ "div",
2554
+ {
2555
+ ref,
2556
+ className: cn(
2557
+ "w-full flex flex-col border border-border-50 bg-background rounded-xl",
2558
+ className
2559
+ ),
2560
+ ...props,
2561
+ children: [
2562
+ /* @__PURE__ */ jsxs18(
2563
+ "div",
2564
+ {
2565
+ className: cn(
2566
+ "flex flex-col gap-1 items-center justify-center p-4",
2567
+ actionCardClasses,
2568
+ extended ? "rounded-t-xl" : "rounded-xl"
2569
+ ),
2570
+ children: [
2571
+ /* @__PURE__ */ jsx24(
2572
+ "span",
2573
+ {
2574
+ className: cn(
2575
+ "size-7.5 rounded-full flex items-center justify-center",
2576
+ actionIconClasses
2577
+ ),
2578
+ children: icon
2579
+ }
2580
+ ),
2581
+ /* @__PURE__ */ jsx24(
2582
+ Text_default,
2583
+ {
2584
+ size: "2xs",
2585
+ weight: "medium",
2586
+ className: "text-text-800 uppercase truncate",
2587
+ children: title
2588
+ }
2589
+ ),
2590
+ /* @__PURE__ */ jsx24(
2591
+ "p",
2592
+ {
2593
+ className: cn("text-lg font-bold truncate", actionSubTitleClasses),
2594
+ children: subTitle
2595
+ }
2596
+ )
2597
+ ]
2598
+ }
2599
+ ),
2600
+ extended && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
2601
+ /* @__PURE__ */ jsx24(
2602
+ "p",
2603
+ {
2604
+ className: cn(
2605
+ "text-2xs font-medium uppercase truncate",
2606
+ actionHeaderClasses
2607
+ ),
2608
+ children: header
2609
+ }
2610
+ ),
2611
+ /* @__PURE__ */ jsx24(Badge_default, { size: "large", action: "info", children: description })
2612
+ ] })
2613
+ ]
2614
+ }
2615
+ );
2616
+ }
2617
+ );
2618
+ var CardQuestions = forwardRef3(
2619
+ ({
2620
+ header,
2621
+ state = "undone",
2622
+ className,
2623
+ onClickButton,
2624
+ valueButton,
2625
+ ...props
2626
+ }, ref) => {
2627
+ const isDone = state === "done";
2628
+ const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
2629
+ const buttonLabel = isDone ? "Ver Resultado" : "Responder";
2630
+ return /* @__PURE__ */ jsxs18(
2631
+ CardBase,
2632
+ {
2633
+ ref,
2634
+ layout: "horizontal",
2635
+ padding: "medium",
2636
+ minHeight: "medium",
2637
+ className: cn("justify-between gap-4", className),
2638
+ ...props,
2639
+ children: [
2640
+ /* @__PURE__ */ jsxs18("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
2641
+ /* @__PURE__ */ jsx24("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
2642
+ /* @__PURE__ */ jsx24("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ jsx24(
2643
+ Badge_default,
2644
+ {
2645
+ size: "medium",
2646
+ variant: "solid",
2647
+ action: isDone ? "success" : "error",
2648
+ children: stateLabel
2649
+ }
2650
+ ) })
2651
+ ] }),
2652
+ /* @__PURE__ */ jsx24("span", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx24(
2653
+ Button_default,
2654
+ {
2655
+ size: "extra-small",
2656
+ onClick: () => onClickButton?.(valueButton),
2657
+ className: "min-w-fit",
2658
+ children: buttonLabel
2659
+ }
2660
+ ) })
2661
+ ]
2662
+ }
2663
+ );
2664
+ }
2665
+ );
2666
+ var CardProgress = forwardRef3(
2667
+ ({
2668
+ header,
2669
+ subhead,
2670
+ initialDate,
2671
+ endDate,
2672
+ progress = 0,
2673
+ direction = "horizontal",
2674
+ icon,
2675
+ color = "#B7DFFF",
2676
+ progressVariant = "blue",
2677
+ showDates = true,
2678
+ className,
2679
+ ...props
2680
+ }, ref) => {
2681
+ const isHorizontal = direction === "horizontal";
2682
+ const contentComponent = {
2683
+ horizontal: /* @__PURE__ */ jsxs18(Fragment4, { children: [
2684
+ showDates && /* @__PURE__ */ jsxs18("div", { className: "flex flex-row gap-6 items-center", children: [
2685
+ initialDate && /* @__PURE__ */ jsxs18("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2686
+ /* @__PURE__ */ jsx24("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
2687
+ /* @__PURE__ */ jsx24("p", { className: "text-text-600", children: initialDate })
2688
+ ] }),
2689
+ endDate && /* @__PURE__ */ jsxs18("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2690
+ /* @__PURE__ */ jsx24("p", { className: "text-text-800 font-semibold", children: "Fim" }),
2691
+ /* @__PURE__ */ jsx24("p", { className: "text-text-600", children: endDate })
2692
+ ] })
2693
+ ] }),
2694
+ /* @__PURE__ */ jsxs18("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2695
+ /* @__PURE__ */ jsx24(
2696
+ ProgressBar_default,
2697
+ {
2698
+ size: "small",
2699
+ value: progress,
2700
+ variant: progressVariant,
2701
+ "data-testid": "progress-bar"
2702
+ }
2703
+ ),
2704
+ /* @__PURE__ */ jsxs18(
2705
+ Text_default,
2706
+ {
2707
+ size: "xs",
2708
+ weight: "medium",
2709
+ className: cn(
2710
+ "text-text-950 leading-none tracking-normal text-center flex-none"
2711
+ ),
2712
+ children: [
2713
+ Math.round(progress),
2714
+ "%"
2715
+ ]
2716
+ }
2717
+ )
2718
+ ] })
2719
+ ] }),
2720
+ vertical: /* @__PURE__ */ jsx24("p", { className: "text-sm text-text-800", children: subhead })
2721
+ };
2722
+ return /* @__PURE__ */ jsxs18(
2723
+ CardBase,
2724
+ {
2725
+ ref,
2726
+ layout: isHorizontal ? "horizontal" : "vertical",
2727
+ padding: "none",
2728
+ minHeight: "medium",
2729
+ cursor: "pointer",
2730
+ className: cn(isHorizontal ? "h-20" : "", className),
2731
+ ...props,
2732
+ children: [
2733
+ /* @__PURE__ */ jsx24(
2734
+ "div",
2735
+ {
2736
+ className: cn(
2737
+ "flex justify-center items-center [&>svg]:size-6 text-text-950",
2738
+ isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl",
2739
+ !color.startsWith("#") ? `${color}` : ""
2740
+ ),
2741
+ style: color.startsWith("#") ? { backgroundColor: color } : void 0,
2742
+ "data-testid": "icon-container",
2743
+ children: icon
2744
+ }
2745
+ ),
2746
+ /* @__PURE__ */ jsxs18(
2747
+ "div",
2748
+ {
2749
+ className: cn(
2750
+ "p-4 flex flex-col justify-between w-full h-full",
2751
+ !isHorizontal && "gap-4"
2752
+ ),
2753
+ children: [
2754
+ /* @__PURE__ */ jsx24(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
2755
+ contentComponent[direction]
2756
+ ]
2757
+ }
2758
+ )
2759
+ ]
2760
+ }
2761
+ );
2762
+ }
2763
+ );
2764
+ var CardTopic = forwardRef3(
2765
+ ({
2766
+ header,
2767
+ subHead,
2768
+ progress,
2769
+ showPercentage = false,
2770
+ progressVariant = "blue",
2771
+ className = "",
2772
+ ...props
2773
+ }, ref) => {
2774
+ return /* @__PURE__ */ jsxs18(
2775
+ CardBase,
2776
+ {
2777
+ ref,
2778
+ layout: "vertical",
2779
+ padding: "small",
2780
+ minHeight: "medium",
2781
+ cursor: "pointer",
2782
+ className: cn("justify-center gap-2 py-2 px-4", className),
2783
+ ...props,
2784
+ children: [
2785
+ subHead && /* @__PURE__ */ jsx24("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ jsxs18(Fragment3, { children: [
2786
+ /* @__PURE__ */ jsx24("p", { children: text }),
2787
+ index < subHead.length - 1 && /* @__PURE__ */ jsx24("p", { children: "\u2022" })
2788
+ ] }, `${text} - ${index}`)) }),
2789
+ /* @__PURE__ */ jsx24("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
2790
+ /* @__PURE__ */ jsxs18("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2791
+ /* @__PURE__ */ jsx24(
2792
+ ProgressBar_default,
2793
+ {
2794
+ size: "small",
2795
+ value: progress,
2796
+ variant: progressVariant,
2797
+ "data-testid": "progress-bar"
2798
+ }
2799
+ ),
2800
+ showPercentage && /* @__PURE__ */ jsxs18(
2801
+ Text_default,
2802
+ {
2803
+ size: "xs",
2804
+ weight: "medium",
2805
+ className: cn(
2806
+ "text-text-950 leading-none tracking-normal text-center flex-none"
2807
+ ),
2808
+ children: [
2809
+ Math.round(progress),
2810
+ "%"
2811
+ ]
2812
+ }
2813
+ )
2814
+ ] })
2815
+ ]
2816
+ }
2817
+ );
2818
+ }
2819
+ );
2820
+ var CardPerformance = forwardRef3(
2821
+ ({
2822
+ header,
2823
+ progress,
2824
+ description = "Sem dados ainda! Voc\xEA ainda n\xE3o fez um question\xE1rio neste assunto.",
2825
+ actionVariant = "button",
2826
+ progressVariant = "blue",
2827
+ labelProgress = "",
2828
+ className = "",
2829
+ onClickButton,
2830
+ valueButton,
2831
+ ...props
2832
+ }, ref) => {
2833
+ const hasProgress = progress !== void 0;
2834
+ return /* @__PURE__ */ jsxs18(
2835
+ CardBase,
2836
+ {
2837
+ ref,
2838
+ layout: "horizontal",
2839
+ padding: "medium",
2840
+ minHeight: "none",
2841
+ className: cn(
2842
+ actionVariant == "caret" ? "cursor-pointer" : "",
2843
+ className
2844
+ ),
2845
+ onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
2846
+ ...props,
2847
+ children: [
2848
+ /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col justify-between gap-2", children: [
2849
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-row justify-between items-center gap-2", children: [
2850
+ /* @__PURE__ */ jsx24("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
2851
+ actionVariant === "button" && /* @__PURE__ */ jsx24(
2852
+ Button_default,
2853
+ {
2854
+ variant: "outline",
2855
+ size: "extra-small",
2856
+ onClick: () => onClickButton?.(valueButton),
2857
+ className: "min-w-fit flex-shrink-0",
2858
+ children: "Ver Aula"
2859
+ }
2860
+ )
2861
+ ] }),
2862
+ /* @__PURE__ */ jsx24("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ jsx24(
2863
+ ProgressBar_default,
2864
+ {
2865
+ value: progress,
2866
+ label: `${progress}% ${labelProgress}`,
2867
+ variant: progressVariant
2868
+ }
2869
+ ) : /* @__PURE__ */ jsx24("p", { className: "text-xs text-text-600 truncate", children: description }) })
2870
+ ] }),
2871
+ actionVariant == "caret" && /* @__PURE__ */ jsx24(
2872
+ CaretRight,
2873
+ {
2874
+ className: "size-4.5 text-text-800 cursor-pointer",
2875
+ "data-testid": "caret-icon"
2876
+ }
2877
+ )
2878
+ ]
2879
+ }
2880
+ );
2881
+ }
2882
+ );
2883
+ var CardResults = forwardRef3(
2884
+ ({
2885
+ header,
2886
+ correct_answers,
2887
+ incorrect_answers,
2888
+ icon,
2889
+ direction = "col",
2890
+ color = "#B7DFFF",
2891
+ className,
2892
+ ...props
2893
+ }, ref) => {
2894
+ const isRow = direction == "row";
2895
+ return /* @__PURE__ */ jsxs18(
2896
+ CardBase,
2897
+ {
2898
+ ref,
2899
+ layout: "horizontal",
2900
+ padding: "none",
2901
+ minHeight: "medium",
2902
+ className: cn("items-stretch cursor-pointer pr-4", className),
2903
+ ...props,
2904
+ children: [
2905
+ /* @__PURE__ */ jsx24(
2906
+ "div",
2907
+ {
2908
+ className: cn(
2909
+ "flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 min-h-full rounded-l-xl"
2910
+ ),
2911
+ style: {
2912
+ backgroundColor: color
2913
+ },
2914
+ children: /* @__PURE__ */ jsx24(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
2915
+ }
2916
+ ),
2917
+ /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-row justify-between items-center", children: [
2918
+ /* @__PURE__ */ jsxs18(
2919
+ "div",
2920
+ {
2921
+ className: cn(
2922
+ "p-4 flex flex-wrap justify-between w-full h-full",
2923
+ isRow ? "flex-row items-center gap-2" : "flex-col"
2924
+ ),
2925
+ children: [
2926
+ /* @__PURE__ */ jsx24("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
2927
+ /* @__PURE__ */ jsxs18("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
2928
+ /* @__PURE__ */ jsxs18(
2929
+ Badge_default,
2930
+ {
2931
+ action: "success",
2932
+ variant: "solid",
2933
+ size: "large",
2934
+ iconLeft: /* @__PURE__ */ jsx24(CheckCircle, {}),
2935
+ children: [
2936
+ correct_answers,
2937
+ " Corretas"
2938
+ ]
2939
+ }
2940
+ ),
2941
+ /* @__PURE__ */ jsxs18(
2942
+ Badge_default,
2943
+ {
2944
+ action: "error",
2945
+ variant: "solid",
2946
+ size: "large",
2947
+ iconLeft: /* @__PURE__ */ jsx24(XCircle, {}),
2948
+ children: [
2949
+ incorrect_answers,
2950
+ " Incorretas"
2951
+ ]
2952
+ }
2953
+ )
2954
+ ] })
2955
+ ]
2956
+ }
2957
+ ),
2958
+ /* @__PURE__ */ jsx24(CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
2959
+ ] })
2960
+ ]
2961
+ }
2962
+ );
2963
+ }
2964
+ );
2965
+ var CardStatus = forwardRef3(
2966
+ ({ header, className, status, label, ...props }, ref) => {
2967
+ const getLabelBadge = (status2) => {
2968
+ switch (status2) {
2969
+ case "correct":
2970
+ return "Correta";
2971
+ case "incorrect":
2972
+ return "Incorreta";
2973
+ case "unanswered":
2974
+ return "Em branco";
2975
+ case "pending":
2976
+ return "Avalia\xE7\xE3o pendente";
2977
+ default:
2978
+ return "Em branco";
2979
+ }
2980
+ };
2981
+ const getIconBadge = (status2) => {
2982
+ switch (status2) {
2983
+ case "correct":
2984
+ return /* @__PURE__ */ jsx24(CheckCircle, {});
2985
+ case "incorrect":
2986
+ return /* @__PURE__ */ jsx24(XCircle, {});
2987
+ case "pending":
2988
+ return /* @__PURE__ */ jsx24(Clock, {});
2989
+ default:
2990
+ return /* @__PURE__ */ jsx24(XCircle, {});
2991
+ }
2992
+ };
2993
+ const getActionBadge = (status2) => {
2994
+ switch (status2) {
2995
+ case "correct":
2996
+ return "success";
2997
+ case "incorrect":
2998
+ return "error";
2999
+ case "pending":
3000
+ return "info";
3001
+ default:
3002
+ return "info";
3003
+ }
3004
+ };
3005
+ return /* @__PURE__ */ jsx24(
3006
+ CardBase,
3007
+ {
3008
+ ref,
3009
+ layout: "horizontal",
3010
+ padding: "medium",
3011
+ minHeight: "medium",
3012
+ className: cn("items-center cursor-pointer", className),
3013
+ ...props,
3014
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
3015
+ /* @__PURE__ */ jsx24("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
3016
+ /* @__PURE__ */ jsxs18("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
3017
+ status && /* @__PURE__ */ jsx24(
3018
+ Badge_default,
3019
+ {
3020
+ action: getActionBadge(status),
3021
+ variant: "solid",
3022
+ size: "medium",
3023
+ iconLeft: getIconBadge(status),
3024
+ children: getLabelBadge(status)
3025
+ }
3026
+ ),
3027
+ label && /* @__PURE__ */ jsx24("p", { className: "text-sm text-text-800", children: label })
3028
+ ] }),
3029
+ /* @__PURE__ */ jsx24(CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
3030
+ ] })
3031
+ }
3032
+ );
3033
+ }
3034
+ );
3035
+ var CardSettings = forwardRef3(
3036
+ ({ header, className, icon, ...props }, ref) => {
3037
+ return /* @__PURE__ */ jsxs18(
3038
+ CardBase,
3039
+ {
3040
+ ref,
3041
+ layout: "horizontal",
3042
+ padding: "small",
3043
+ minHeight: "none",
3044
+ className: cn(
3045
+ "border-none items-center gap-2 text-text-700",
3046
+ className
3047
+ ),
3048
+ ...props,
3049
+ children: [
3050
+ /* @__PURE__ */ jsx24("span", { className: "[&>svg]:size-6", children: icon }),
3051
+ /* @__PURE__ */ jsx24("p", { className: "w-full text-sm truncate", children: header }),
3052
+ /* @__PURE__ */ jsx24(CaretRight, { size: 24, className: "cursor-pointer" })
3053
+ ]
3054
+ }
3055
+ );
3056
+ }
3057
+ );
3058
+ var CardSupport = forwardRef3(
3059
+ ({ header, className, direction = "col", children, ...props }, ref) => {
3060
+ return /* @__PURE__ */ jsxs18(
3061
+ CardBase,
3062
+ {
3063
+ ref,
3064
+ layout: "horizontal",
3065
+ padding: "medium",
3066
+ minHeight: "none",
3067
+ className: cn(
3068
+ "border-none items-center gap-2 text-text-700",
3069
+ className
3070
+ ),
3071
+ ...props,
3072
+ children: [
3073
+ /* @__PURE__ */ jsxs18(
3074
+ "div",
3075
+ {
3076
+ className: cn(
3077
+ "w-full flex",
3078
+ direction == "col" ? "flex-col" : "flex-row items-center"
3079
+ ),
3080
+ children: [
3081
+ /* @__PURE__ */ jsx24("span", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx24("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
3082
+ /* @__PURE__ */ jsx24("span", { className: "flex flex-row gap-1", children })
3083
+ ]
3084
+ }
3085
+ ),
3086
+ /* @__PURE__ */ jsx24(CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
3087
+ ]
3088
+ }
3089
+ );
3090
+ }
3091
+ );
3092
+ var CardForum = forwardRef3(
3093
+ ({
3094
+ title,
3095
+ content,
3096
+ comments,
3097
+ onClickComments,
3098
+ valueComments,
3099
+ onClickProfile,
3100
+ valueProfile,
3101
+ className = "",
3102
+ date,
3103
+ hour,
3104
+ ...props
3105
+ }, ref) => {
3106
+ return /* @__PURE__ */ jsxs18(
3107
+ CardBase,
3108
+ {
3109
+ ref,
3110
+ layout: "horizontal",
3111
+ padding: "medium",
3112
+ minHeight: "none",
3113
+ variant: "minimal",
3114
+ className: cn("w-auto h-auto gap-3", className),
3115
+ ...props,
3116
+ children: [
3117
+ /* @__PURE__ */ jsx24(
3118
+ "button",
3119
+ {
3120
+ type: "button",
3121
+ "aria-label": "Ver perfil",
3122
+ onClick: () => onClickProfile?.(valueProfile),
3123
+ className: "min-w-8 h-8 rounded-full bg-background-950"
3124
+ }
3125
+ ),
3126
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
3127
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
3128
+ /* @__PURE__ */ jsx24("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
3129
+ /* @__PURE__ */ jsxs18("p", { className: "text-xs text-text-600", children: [
3130
+ "\u2022 ",
3131
+ date,
3132
+ " \u2022 ",
3133
+ hour
3134
+ ] })
3135
+ ] }),
3136
+ /* @__PURE__ */ jsx24("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
3137
+ /* @__PURE__ */ jsxs18(
3138
+ "button",
3139
+ {
3140
+ type: "button",
3141
+ "aria-label": "Ver coment\xE1rios",
3142
+ onClick: () => onClickComments?.(valueComments),
3143
+ className: "text-text-600 flex flex-row gap-2 items-center",
3144
+ children: [
3145
+ /* @__PURE__ */ jsx24(ChatCircleText, { "aria-hidden": "true", size: 16 }),
3146
+ /* @__PURE__ */ jsxs18("p", { className: "text-xs", children: [
3147
+ comments,
3148
+ " respostas"
3149
+ ] })
3150
+ ]
3151
+ }
3152
+ )
3153
+ ] })
3154
+ ]
3155
+ }
3156
+ );
3157
+ }
3158
+ );
3159
+ var CardAudio = forwardRef3(
3160
+ ({
3161
+ src,
3162
+ title,
3163
+ onPlay,
3164
+ onPause,
3165
+ onEnded,
3166
+ onAudioTimeUpdate,
3167
+ loop = false,
3168
+ preload = "metadata",
3169
+ tracks,
3170
+ className,
3171
+ ...props
3172
+ }, ref) => {
3173
+ const [isPlaying, setIsPlaying] = useState2(false);
3174
+ const [currentTime, setCurrentTime] = useState2(0);
3175
+ const [duration, setDuration] = useState2(0);
3176
+ const [volume, setVolume] = useState2(1);
3177
+ const [showVolumeControl, setShowVolumeControl] = useState2(false);
3178
+ const [showSpeedMenu, setShowSpeedMenu] = useState2(false);
3179
+ const [playbackRate, setPlaybackRate] = useState2(1);
3180
+ const audioRef = useRef(null);
3181
+ const volumeControlRef = useRef(null);
3182
+ const speedMenuRef = useRef(null);
3183
+ const formatTime = (time) => {
3184
+ const minutes = Math.floor(time / 60);
3185
+ const seconds = Math.floor(time % 60);
3186
+ return `${minutes}:${seconds.toString().padStart(2, "0")}`;
3187
+ };
3188
+ const handlePlayPause = () => {
3189
+ if (isPlaying) {
3190
+ audioRef.current?.pause();
3191
+ setIsPlaying(false);
3192
+ onPause?.();
3193
+ } else {
3194
+ audioRef.current?.play();
3195
+ setIsPlaying(true);
3196
+ onPlay?.();
3197
+ }
3198
+ };
3199
+ const handleTimeUpdate = () => {
3200
+ const current = audioRef.current?.currentTime ?? 0;
3201
+ const total = audioRef.current?.duration ?? 0;
3202
+ setCurrentTime(current);
3203
+ setDuration(total);
3204
+ onAudioTimeUpdate?.(current, total);
3205
+ };
3206
+ const handleLoadedMetadata = () => {
3207
+ setDuration(audioRef.current?.duration ?? 0);
3208
+ };
3209
+ const handleEnded = () => {
3210
+ setIsPlaying(false);
3211
+ setCurrentTime(0);
3212
+ onEnded?.();
3213
+ };
3214
+ const handleProgressClick = (e) => {
3215
+ const rect = e.currentTarget.getBoundingClientRect();
3216
+ const clickX = e.clientX - rect.left;
3217
+ const width = rect.width;
3218
+ const percentage = clickX / width;
3219
+ const newTime = percentage * duration;
3220
+ if (audioRef.current) {
3221
+ audioRef.current.currentTime = newTime;
3222
+ }
3223
+ setCurrentTime(newTime);
3224
+ };
3225
+ const handleVolumeChange = (e) => {
3226
+ const newVolume = parseFloat(e.target.value);
3227
+ setVolume(newVolume);
3228
+ if (audioRef.current) {
3229
+ audioRef.current.volume = newVolume;
3230
+ }
3231
+ };
3232
+ const toggleVolumeControl = () => {
3233
+ setShowVolumeControl(!showVolumeControl);
3234
+ setShowSpeedMenu(false);
3235
+ };
3236
+ const toggleSpeedMenu = () => {
3237
+ setShowSpeedMenu(!showSpeedMenu);
3238
+ setShowVolumeControl(false);
3239
+ };
3240
+ const handleSpeedChange = (speed) => {
3241
+ setPlaybackRate(speed);
3242
+ if (audioRef.current) {
3243
+ audioRef.current.playbackRate = speed;
3244
+ }
3245
+ setShowSpeedMenu(false);
3246
+ };
3247
+ const getVolumeIcon = () => {
3248
+ if (volume === 0) {
3249
+ return /* @__PURE__ */ jsx24(SpeakerSimpleX, { size: 24 });
3250
+ }
3251
+ if (volume < 0.5) {
3252
+ return /* @__PURE__ */ jsx24(SpeakerLow, { size: 24 });
3253
+ }
3254
+ return /* @__PURE__ */ jsx24(SpeakerHigh, { size: 24 });
3255
+ };
3256
+ useEffect3(() => {
3257
+ const handleClickOutside = (event) => {
3258
+ if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
3259
+ setShowVolumeControl(false);
3260
+ }
3261
+ if (speedMenuRef.current && !speedMenuRef.current.contains(event.target)) {
3262
+ setShowSpeedMenu(false);
3263
+ }
3264
+ };
3265
+ document.addEventListener("mousedown", handleClickOutside);
3266
+ return () => {
3267
+ document.removeEventListener("mousedown", handleClickOutside);
3268
+ };
3269
+ }, []);
3270
+ return /* @__PURE__ */ jsxs18(
3271
+ CardBase,
3272
+ {
3273
+ ref,
3274
+ layout: "horizontal",
3275
+ padding: "medium",
3276
+ minHeight: "none",
3277
+ className: cn(
3278
+ "flex flex-row w-auto h-14 items-center gap-2",
3279
+ className
3280
+ ),
3281
+ ...props,
3282
+ children: [
3283
+ /* @__PURE__ */ jsx24(
3284
+ "audio",
3285
+ {
3286
+ ref: audioRef,
3287
+ src,
3288
+ loop,
3289
+ preload,
3290
+ onTimeUpdate: handleTimeUpdate,
3291
+ onLoadedMetadata: handleLoadedMetadata,
3292
+ onEnded: handleEnded,
3293
+ "data-testid": "audio-element",
3294
+ "aria-label": title,
3295
+ children: tracks ? tracks.map((track) => /* @__PURE__ */ jsx24(
3296
+ "track",
3297
+ {
3298
+ kind: track.kind,
3299
+ src: track.src,
3300
+ srcLang: track.srcLang,
3301
+ label: track.label,
3302
+ default: track.default
3303
+ },
3304
+ track.src
3305
+ )) : /* @__PURE__ */ jsx24(
3306
+ "track",
3307
+ {
3308
+ kind: "captions",
3309
+ src: "data:text/vtt;base64,",
3310
+ srcLang: "pt",
3311
+ label: "Sem legendas dispon\xEDveis"
3312
+ }
3313
+ )
3314
+ }
3315
+ ),
3316
+ /* @__PURE__ */ jsx24(
3317
+ "button",
3318
+ {
3319
+ type: "button",
3320
+ onClick: handlePlayPause,
3321
+ disabled: !src,
3322
+ className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
3323
+ "aria-label": isPlaying ? "Pausar" : "Reproduzir",
3324
+ children: isPlaying ? /* @__PURE__ */ jsx24("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsxs18("div", { className: "flex gap-0.5", children: [
3325
+ /* @__PURE__ */ jsx24("div", { className: "w-1 h-4 bg-current rounded-sm" }),
3326
+ /* @__PURE__ */ jsx24("div", { className: "w-1 h-4 bg-current rounded-sm" })
3327
+ ] }) }) : /* @__PURE__ */ jsx24(Play, { size: 24 })
3328
+ }
3329
+ ),
3330
+ /* @__PURE__ */ jsx24("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
3331
+ /* @__PURE__ */ jsx24("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ jsx24(
3332
+ "button",
3333
+ {
3334
+ type: "button",
3335
+ className: "w-full h-2 bg-border-100 rounded-full cursor-pointer",
3336
+ onClick: handleProgressClick,
3337
+ onKeyDown: (e) => {
3338
+ if (e.key === "Enter" || e.key === " ") {
3339
+ e.preventDefault();
3340
+ handleProgressClick(
3341
+ e
3342
+ );
3343
+ }
3344
+ },
3345
+ "aria-label": "Barra de progresso do \xE1udio",
3346
+ children: /* @__PURE__ */ jsx24(
3347
+ "div",
3348
+ {
3349
+ className: "h-full bg-primary-600 rounded-full transition-all duration-100",
3350
+ style: {
3351
+ width: duration > 0 ? `${currentTime / duration * 100}%` : "0%"
3352
+ }
3353
+ }
3354
+ )
3355
+ }
3356
+ ) }),
3357
+ /* @__PURE__ */ jsx24("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
3358
+ /* @__PURE__ */ jsxs18("div", { className: "relative h-6", ref: volumeControlRef, children: [
3359
+ /* @__PURE__ */ jsx24(
3360
+ "button",
3361
+ {
3362
+ type: "button",
3363
+ onClick: toggleVolumeControl,
3364
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
3365
+ "aria-label": "Controle de volume",
3366
+ children: /* @__PURE__ */ jsx24("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
3367
+ }
3368
+ ),
3369
+ showVolumeControl && /* @__PURE__ */ jsx24(
3370
+ "button",
3371
+ {
3372
+ type: "button",
3373
+ className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
3374
+ onKeyDown: (e) => {
3375
+ if (e.key === "Escape") {
3376
+ setShowVolumeControl(false);
3377
+ }
3378
+ },
3379
+ children: /* @__PURE__ */ jsx24(
3380
+ "input",
3381
+ {
3382
+ type: "range",
3383
+ min: "0",
3384
+ max: "1",
3385
+ step: "0.1",
3386
+ value: volume,
3387
+ onChange: handleVolumeChange,
3388
+ onKeyDown: (e) => {
3389
+ if (e.key === "ArrowUp" || e.key === "ArrowRight") {
3390
+ e.preventDefault();
3391
+ const newVolume = Math.min(
3392
+ 1,
3393
+ Math.round((volume + 0.1) * 10) / 10
3394
+ );
3395
+ setVolume(newVolume);
3396
+ if (audioRef.current) audioRef.current.volume = newVolume;
3397
+ } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
3398
+ e.preventDefault();
3399
+ const newVolume = Math.max(
3400
+ 0,
3401
+ Math.round((volume - 0.1) * 10) / 10
3402
+ );
3403
+ setVolume(newVolume);
3404
+ if (audioRef.current) audioRef.current.volume = newVolume;
3405
+ }
3406
+ },
3407
+ className: "w-20 h-2 bg-border-100 rounded-lg appearance-none cursor-pointer",
3408
+ style: {
3409
+ background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${volume * 100}%, #e5e7eb ${volume * 100}%, #e5e7eb 100%)`
3410
+ },
3411
+ "aria-label": "Volume",
3412
+ "aria-valuenow": Math.round(volume * 100),
3413
+ "aria-valuemin": 0,
3414
+ "aria-valuemax": 100
3415
+ }
3416
+ )
3417
+ }
3418
+ )
3419
+ ] }),
3420
+ /* @__PURE__ */ jsxs18("div", { className: "relative h-6", ref: speedMenuRef, children: [
3421
+ /* @__PURE__ */ jsx24(
3422
+ "button",
3423
+ {
3424
+ type: "button",
3425
+ onClick: toggleSpeedMenu,
3426
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
3427
+ "aria-label": "Op\xE7\xF5es de velocidade",
3428
+ children: /* @__PURE__ */ jsx24(DotsThreeVertical, { size: 24 })
3429
+ }
3430
+ ),
3431
+ showSpeedMenu && /* @__PURE__ */ jsx24("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__ */ jsx24("div", { className: "flex flex-col gap-1", children: [
3432
+ { speed: 1, label: "1x" },
3433
+ { speed: 1.5, label: "1.5x" },
3434
+ { speed: 2, label: "2x" }
3435
+ ].map(({ speed, label }) => /* @__PURE__ */ jsx24(
3436
+ "button",
3437
+ {
3438
+ type: "button",
3439
+ onClick: () => handleSpeedChange(speed),
3440
+ className: cn(
3441
+ "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
3442
+ playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
3443
+ ),
3444
+ children: label
3445
+ },
3446
+ speed
3447
+ )) }) })
3448
+ ] })
3449
+ ]
3450
+ }
3451
+ );
3452
+ }
3453
+ );
3454
+ var SIMULADO_BACKGROUND_CLASSES = {
3455
+ enem: "bg-exam-1",
3456
+ prova: "bg-exam-2",
3457
+ simuladao: "bg-exam-3",
3458
+ vestibular: "bg-exam-4"
3459
+ };
3460
+ var CardSimulado = forwardRef3(
3461
+ ({ title, duration, info, backgroundColor, className, ...props }, ref) => {
3462
+ const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
3463
+ return /* @__PURE__ */ jsx24(
3464
+ CardBase,
3465
+ {
3466
+ ref,
3467
+ layout: "horizontal",
3468
+ padding: "medium",
3469
+ minHeight: "none",
3470
+ cursor: "pointer",
3471
+ className: cn(
3472
+ `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200`,
3473
+ className
3474
+ ),
3475
+ ...props,
3476
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between items-center w-full gap-4", children: [
3477
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
3478
+ /* @__PURE__ */ jsx24(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
3479
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-4 text-text-700", children: [
3480
+ duration && /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1", children: [
3481
+ /* @__PURE__ */ jsx24(Clock, { size: 16, className: "flex-shrink-0" }),
3482
+ /* @__PURE__ */ jsx24(Text_default, { size: "sm", children: duration })
3483
+ ] }),
3484
+ /* @__PURE__ */ jsx24(Text_default, { size: "sm", className: "truncate", children: info })
3485
+ ] })
3486
+ ] }),
3487
+ /* @__PURE__ */ jsx24(
3488
+ CaretRight,
3489
+ {
3490
+ size: 24,
3491
+ className: "text-text-800 flex-shrink-0",
3492
+ "data-testid": "caret-icon"
3493
+ }
3494
+ )
3495
+ ] })
3496
+ }
3497
+ );
3498
+ }
3499
+ );
3500
+ var CardTest = forwardRef3(
3501
+ ({
3502
+ title,
3503
+ duration,
3504
+ questionsCount,
3505
+ additionalInfo,
3506
+ selected = false,
3507
+ onSelect,
3508
+ className = "",
3509
+ ...props
3510
+ }, ref) => {
3511
+ const handleClick = () => {
3512
+ if (onSelect) {
3513
+ onSelect(!selected);
3514
+ }
3515
+ };
3516
+ const handleKeyDown = (event) => {
3517
+ if ((event.key === "Enter" || event.key === " ") && onSelect) {
3518
+ event.preventDefault();
3519
+ onSelect(!selected);
3520
+ }
3521
+ };
3522
+ const isSelectable = !!onSelect;
3523
+ const getQuestionsText = (count) => {
3524
+ const singular = count === 1 ? "quest\xE3o" : "quest\xF5es";
3525
+ return `${count} ${singular}`;
3526
+ };
3527
+ const displayInfo = questionsCount ? getQuestionsText(questionsCount) : additionalInfo || "";
3528
+ const baseClasses = "flex flex-row items-center p-4 gap-2 w-full max-w-full bg-background shadow-soft-shadow-1 rounded-xl isolate border-0 text-left";
3529
+ const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
3530
+ const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
3531
+ if (isSelectable) {
3532
+ return /* @__PURE__ */ jsx24(
3533
+ "button",
3534
+ {
3535
+ ref,
3536
+ type: "button",
3537
+ className: cn(
3538
+ `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim()
3539
+ ),
3540
+ onClick: handleClick,
3541
+ onKeyDown: handleKeyDown,
3542
+ "aria-pressed": selected,
3543
+ ...props,
3544
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3545
+ /* @__PURE__ */ jsx24(
3546
+ Text_default,
3547
+ {
3548
+ size: "md",
3549
+ weight: "bold",
3550
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3551
+ children: title
3552
+ }
3553
+ ),
3554
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3555
+ duration && /* @__PURE__ */ jsxs18("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3556
+ /* @__PURE__ */ jsx24(Clock, { size: 16, className: "text-text-700" }),
3557
+ /* @__PURE__ */ jsx24(
3558
+ Text_default,
3559
+ {
3560
+ size: "sm",
3561
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
3562
+ children: duration
3563
+ }
3564
+ )
3565
+ ] }),
3566
+ /* @__PURE__ */ jsx24(
3567
+ Text_default,
3568
+ {
3569
+ size: "sm",
3570
+ className: "text-text-700 leading-[21px] flex-grow truncate",
3571
+ children: displayInfo
3572
+ }
3573
+ )
3574
+ ] })
3575
+ ] })
3576
+ }
3577
+ );
3578
+ }
3579
+ return /* @__PURE__ */ jsx24(
3580
+ "div",
3581
+ {
3582
+ ref,
3583
+ className: cn(`${baseClasses} ${className}`.trim()),
3584
+ ...props,
3585
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3586
+ /* @__PURE__ */ jsx24(
3587
+ Text_default,
3588
+ {
3589
+ size: "md",
3590
+ weight: "bold",
3591
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3592
+ children: title
3593
+ }
3594
+ ),
3595
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3596
+ duration && /* @__PURE__ */ jsxs18("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3597
+ /* @__PURE__ */ jsx24(Clock, { size: 16, className: "text-text-700" }),
3598
+ /* @__PURE__ */ jsx24(
3599
+ Text_default,
3600
+ {
3601
+ size: "sm",
3602
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
3603
+ children: duration
3604
+ }
3605
+ )
3606
+ ] }),
3607
+ /* @__PURE__ */ jsx24(
3608
+ Text_default,
3609
+ {
3610
+ size: "sm",
3611
+ className: "text-text-700 leading-[21px] flex-grow truncate min-w-0",
3612
+ children: displayInfo
3613
+ }
3614
+ )
3615
+ ] })
3616
+ ] })
3617
+ }
3618
+ );
3619
+ }
3620
+ );
3621
+ var SIMULATION_TYPE_STYLES = {
3622
+ enem: {
3623
+ background: "bg-exam-1",
3624
+ badge: "exam1",
3625
+ text: "Enem"
3626
+ },
3627
+ prova: {
3628
+ background: "bg-exam-2",
3629
+ badge: "exam2",
3630
+ text: "Prova"
3631
+ },
3632
+ simulado: {
3633
+ background: "bg-exam-3",
3634
+ badge: "exam3",
3635
+ text: "Simulad\xE3o"
3636
+ },
3637
+ vestibular: {
3638
+ background: "bg-exam-4",
3639
+ badge: "exam4",
3640
+ text: "Vestibular"
3641
+ }
3642
+ };
3643
+ var CardSimulationHistory = forwardRef3(({ data, onSimulationClick, className, ...props }, ref) => {
3644
+ return /* @__PURE__ */ jsx24(
3645
+ "div",
3646
+ {
3647
+ ref,
3648
+ className: cn("w-full max-w-[992px] h-auto", className),
3649
+ ...props,
3650
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-0", children: [
3651
+ data.map((section, sectionIndex) => /* @__PURE__ */ jsx24("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs18(
3652
+ "div",
3653
+ {
3654
+ className: cn(
3655
+ "flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-background",
3656
+ sectionIndex === 0 ? "rounded-t-3xl" : ""
3657
+ ),
3658
+ children: [
3659
+ /* @__PURE__ */ jsx24(
3660
+ Text_default,
3661
+ {
3662
+ size: "xs",
3663
+ weight: "bold",
3664
+ className: "text-text-800 w-11 flex-shrink-0",
3665
+ children: section.date
3666
+ }
3667
+ ),
3668
+ /* @__PURE__ */ jsx24("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
3669
+ const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
3670
+ return /* @__PURE__ */ jsx24(
3671
+ CardBase,
3672
+ {
3673
+ layout: "horizontal",
3674
+ padding: "medium",
3675
+ minHeight: "none",
3676
+ cursor: "pointer",
3677
+ className: cn(
3678
+ `${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
3679
+ transition-shadow duration-200 h-auto min-h-[61px]`
3680
+ ),
3681
+ onClick: () => onSimulationClick?.(simulation),
3682
+ children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between items-center w-full gap-2", children: [
3683
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
3684
+ /* @__PURE__ */ jsx24(
3685
+ Text_default,
3686
+ {
3687
+ size: "lg",
3688
+ weight: "bold",
3689
+ className: "text-text-950 truncate",
3690
+ children: simulation.title
3691
+ }
3692
+ ),
3693
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
3694
+ /* @__PURE__ */ jsx24(
3695
+ Badge_default,
3696
+ {
3697
+ variant: "examsOutlined",
3698
+ action: typeStyles.badge,
3699
+ size: "medium",
3700
+ children: typeStyles.text
3701
+ }
3702
+ ),
3703
+ /* @__PURE__ */ jsx24(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
3704
+ ] })
3705
+ ] }),
3706
+ /* @__PURE__ */ jsx24(
3707
+ CaretRight,
3708
+ {
3709
+ size: 24,
3710
+ className: "text-text-800 flex-shrink-0",
3711
+ "data-testid": "caret-icon"
3712
+ }
3713
+ )
3714
+ ] })
3715
+ },
3716
+ simulation.id
3717
+ );
3718
+ }) })
3719
+ ]
3720
+ }
3721
+ ) }, section.date)),
3722
+ data.length > 0 && /* @__PURE__ */ jsx24("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
3723
+ ] })
3724
+ }
3725
+ );
3726
+ });
3727
+
3728
+ // src/components/Accordation/Accordation.tsx
3729
+ import { CaretRight as CaretRight2 } from "phosphor-react";
3730
+ import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
3731
+ var CardAccordation = forwardRef4(
3732
+ ({
3733
+ trigger,
3734
+ children,
3735
+ className,
3736
+ defaultExpanded = false,
3737
+ expanded: controlledExpanded,
3738
+ onToggleExpanded,
3739
+ value,
3740
+ disabled = false,
3741
+ triggerClassName,
3742
+ contentClassName,
3743
+ ...props
3744
+ }, ref) => {
3745
+ const [internalExpanded, setInternalExpanded] = useState3(defaultExpanded);
3746
+ const generatedId = useId2();
3747
+ const contentId = value ? `accordion-content-${value}` : generatedId;
3748
+ const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
3749
+ const isControlled = controlledExpanded !== void 0;
3750
+ const isExpanded = isControlled ? controlledExpanded : internalExpanded;
3751
+ useEffect4(() => {
3752
+ if (isControlled) {
3753
+ setInternalExpanded(controlledExpanded);
3754
+ }
3755
+ }, [isControlled, controlledExpanded]);
3756
+ const handleToggle = () => {
3757
+ if (disabled) return;
3758
+ const newExpanded = !isExpanded;
3759
+ if (!isControlled) {
3760
+ setInternalExpanded(newExpanded);
3761
+ }
3762
+ onToggleExpanded?.(newExpanded);
3763
+ };
3764
+ const handleKeyDown = (event) => {
3765
+ if (disabled) return;
3766
+ if (event.key === "Enter" || event.key === " ") {
3767
+ event.preventDefault();
3768
+ handleToggle();
3769
+ }
3770
+ };
3771
+ return /* @__PURE__ */ jsxs19(
3772
+ CardBase,
3773
+ {
3774
+ ref,
3775
+ layout: "vertical",
3776
+ padding: "none",
3777
+ minHeight: "none",
3778
+ className: cn("overflow-hidden", className),
3779
+ ...props,
3780
+ children: [
3781
+ /* @__PURE__ */ jsxs19(
3782
+ "button",
3783
+ {
3784
+ id: headerId,
3785
+ type: "button",
3786
+ onClick: handleToggle,
3787
+ onKeyDown: handleKeyDown,
3788
+ disabled,
3789
+ className: cn(
3790
+ "w-full cursor-pointer not-aria-expanded:rounded-xl aria-expanded:rounded-t-xl flex items-center justify-between gap-3 text-left transition-colors duration-200 focus:outline-none focus:border-2 focus:border-primary-950 focus:ring-inset px-2",
3791
+ disabled && "cursor-not-allowed text-text-400",
3792
+ triggerClassName
3793
+ ),
3794
+ "aria-expanded": isExpanded,
3795
+ "aria-controls": contentId,
3796
+ "aria-disabled": disabled,
3797
+ "data-value": value,
3798
+ children: [
3799
+ trigger,
3800
+ /* @__PURE__ */ jsx25(
3801
+ CaretRight2,
3802
+ {
3803
+ size: 20,
3804
+ className: cn(
3805
+ "transition-transform duration-200 flex-shrink-0",
3806
+ disabled ? "text-gray-400" : "text-text-700",
3807
+ isExpanded ? "rotate-90" : "rotate-0"
3808
+ ),
3809
+ "data-testid": "accordion-caret"
3810
+ }
3811
+ )
3812
+ ]
3813
+ }
3814
+ ),
3815
+ /* @__PURE__ */ jsx25(
3816
+ "section",
3817
+ {
3818
+ id: contentId,
3819
+ "aria-labelledby": headerId,
3820
+ "aria-hidden": !isExpanded,
3821
+ className: cn(
3822
+ "transition-all duration-300 ease-in-out overflow-hidden",
3823
+ isExpanded ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
3824
+ ),
3825
+ "data-testid": "accordion-content",
3826
+ "data-value": value,
3827
+ children: /* @__PURE__ */ jsx25("div", { className: cn("p-4 pt-0", contentClassName), children })
3828
+ }
3829
+ )
3830
+ ]
3831
+ }
3832
+ );
3833
+ }
3834
+ );
3835
+ CardAccordation.displayName = "CardAccordation";
3836
+
3837
+ // src/components/Alternative/Alternative.tsx
3838
+ import { CheckCircle as CheckCircle2, XCircle as XCircle2 } from "phosphor-react";
3839
+
3840
+ // src/components/Radio/Radio.tsx
3841
+ import {
3842
+ forwardRef as forwardRef5,
3843
+ useState as useState4,
3844
+ useId as useId3,
3845
+ useEffect as useEffect5,
3846
+ useRef as useRef2,
3847
+ Children as Children2,
3848
+ cloneElement as cloneElement2,
3849
+ isValidElement as isValidElement2
3850
+ } from "react";
3851
+ import { create, useStore } from "zustand";
3852
+ import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
3853
+ var SIZE_CLASSES6 = {
3854
+ small: {
3855
+ radio: "w-5 h-5",
3856
+ textSize: "sm",
3857
+ spacing: "gap-1.5",
3858
+ borderWidth: "border-2",
3859
+ dotSize: "w-2.5 h-2.5",
3860
+ labelHeight: "h-5"
3861
+ },
3862
+ medium: {
3863
+ radio: "w-6 h-6",
3864
+ textSize: "md",
3865
+ spacing: "gap-2",
3866
+ borderWidth: "border-2",
3867
+ dotSize: "w-3 h-3",
3868
+ labelHeight: "h-6"
3869
+ },
3870
+ large: {
3871
+ radio: "w-7 h-7",
3872
+ textSize: "lg",
3873
+ spacing: "gap-2",
3874
+ borderWidth: "border-2",
3875
+ dotSize: "w-3.5 h-3.5",
3876
+ labelHeight: "h-7"
3877
+ },
3878
+ extraLarge: {
3879
+ radio: "w-8 h-8",
3880
+ textSize: "xl",
3881
+ spacing: "gap-3",
3882
+ borderWidth: "border-2",
3883
+ dotSize: "w-4 h-4",
3884
+ labelHeight: "h-8"
3885
+ }
3886
+ };
3887
+ var BASE_RADIO_CLASSES = "rounded-full border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
3888
+ var STATE_CLASSES = {
3889
+ default: {
3890
+ unchecked: "border-border-400 bg-background hover:border-border-500",
3891
+ checked: "border-primary-950 bg-background hover:border-primary-800"
3892
+ },
3893
+ hovered: {
3894
+ unchecked: "border-border-500 bg-background",
3895
+ checked: "border-info-700 bg-background"
3896
+ },
3897
+ focused: {
3898
+ unchecked: "border-border-400 bg-background",
3899
+ checked: "border-primary-950 bg-background"
3900
+ },
3901
+ invalid: {
3902
+ unchecked: "border-border-400 bg-background",
3903
+ checked: "border-primary-950 bg-background"
3904
+ },
3905
+ disabled: {
3906
+ unchecked: "border-border-400 bg-background cursor-not-allowed",
3907
+ checked: "border-primary-950 bg-background cursor-not-allowed"
3908
+ }
3909
+ };
3910
+ var DOT_CLASSES = {
3911
+ default: "bg-primary-950",
3912
+ hovered: "bg-info-700",
3913
+ focused: "bg-primary-950",
3914
+ invalid: "bg-primary-950",
3915
+ disabled: "bg-primary-950"
3916
+ };
3917
+ var Radio = forwardRef5(
3918
+ ({
3919
+ label,
3920
+ size = "medium",
3921
+ state = "default",
3922
+ errorMessage,
3923
+ helperText,
3924
+ className = "",
3925
+ labelClassName = "",
3926
+ checked: checkedProp,
3927
+ defaultChecked = false,
3928
+ disabled,
3929
+ id,
3930
+ name,
3931
+ value,
3932
+ onChange,
3933
+ ...props
3934
+ }, ref) => {
3935
+ const generatedId = useId3();
3936
+ const inputId = id ?? `radio-${generatedId}`;
3937
+ const inputRef = useRef2(null);
3938
+ const [internalChecked, setInternalChecked] = useState4(defaultChecked);
3939
+ const isControlled = checkedProp !== void 0;
3940
+ const checked = isControlled ? checkedProp : internalChecked;
3941
+ const handleChange = (event) => {
3942
+ const newChecked = event.target.checked;
3943
+ if (!isControlled) {
3944
+ setInternalChecked(newChecked);
3945
+ }
3946
+ if (event.target) {
3947
+ event.target.blur();
3948
+ }
3949
+ onChange?.(event);
3950
+ };
3951
+ const currentState = disabled ? "disabled" : state;
3952
+ const sizeClasses = SIZE_CLASSES6[size];
3953
+ const actualRadioSize = sizeClasses.radio;
3954
+ const actualDotSize = sizeClasses.dotSize;
3955
+ const radioVariant = checked ? "checked" : "unchecked";
3956
+ const stylingClasses = STATE_CLASSES[currentState][radioVariant];
3957
+ const getBorderWidth = () => {
3958
+ if (currentState === "focused") {
3959
+ return "border-2";
3960
+ }
3961
+ return sizeClasses.borderWidth;
3962
+ };
3963
+ const borderWidthClass = getBorderWidth();
3964
+ const radioClasses = cn(
3965
+ BASE_RADIO_CLASSES,
3966
+ actualRadioSize,
3967
+ borderWidthClass,
3968
+ stylingClasses,
3969
+ className
3970
+ );
3971
+ const dotClasses = cn(
3972
+ actualDotSize,
3973
+ "rounded-full",
3974
+ DOT_CLASSES[currentState],
3975
+ "transition-all duration-200"
3976
+ );
3977
+ const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
3978
+ const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
3979
+ const getTextColor = () => {
3980
+ if (currentState === "disabled") {
3981
+ return checked ? "text-text-900" : "text-text-600";
3982
+ }
3983
+ if (currentState === "focused") {
3984
+ return "text-text-900";
3985
+ }
3986
+ return checked ? "text-text-900" : "text-text-600";
3987
+ };
3988
+ const getCursorClass = () => {
3989
+ return currentState === "disabled" ? "cursor-not-allowed" : "cursor-pointer";
3990
+ };
3991
+ return /* @__PURE__ */ jsxs20("div", { className: "flex flex-col", children: [
3992
+ /* @__PURE__ */ jsxs20(
3993
+ "div",
3994
+ {
3995
+ className: cn(
3996
+ "flex flex-row items-center",
3997
+ isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
3998
+ disabled ? "opacity-40" : ""
3999
+ ),
4000
+ children: [
4001
+ /* @__PURE__ */ jsx26(
4002
+ "input",
4003
+ {
4004
+ ref: (node) => {
4005
+ inputRef.current = node;
4006
+ if (typeof ref === "function") ref(node);
4007
+ else if (ref) ref.current = node;
4008
+ },
4009
+ type: "radio",
4010
+ id: inputId,
4011
+ checked,
4012
+ disabled,
4013
+ name,
4014
+ value,
4015
+ onChange: handleChange,
4016
+ className: "sr-only",
4017
+ style: {
4018
+ position: "absolute",
4019
+ left: "-9999px",
4020
+ visibility: "hidden"
4021
+ },
4022
+ ...props
4023
+ }
4024
+ ),
4025
+ /* @__PURE__ */ jsx26(
4026
+ "button",
4027
+ {
4028
+ type: "button",
4029
+ className: radioClasses,
4030
+ disabled,
4031
+ "aria-pressed": checked,
4032
+ onClick: (e) => {
4033
+ e.preventDefault();
4034
+ if (!disabled) {
4035
+ if (inputRef.current) {
4036
+ inputRef.current.click();
4037
+ inputRef.current.blur();
4038
+ }
4039
+ }
4040
+ },
4041
+ onKeyDown: (e) => {
4042
+ if ((e.key === "Enter" || e.key === " ") && !disabled) {
4043
+ e.preventDefault();
4044
+ if (inputRef.current) {
4045
+ inputRef.current.click();
4046
+ inputRef.current.blur();
4047
+ }
4048
+ }
4049
+ },
4050
+ children: checked && /* @__PURE__ */ jsx26("div", { className: dotClasses })
4051
+ }
4052
+ ),
4053
+ label && /* @__PURE__ */ jsx26(
4054
+ "div",
4055
+ {
4056
+ className: cn(
4057
+ "flex flex-row items-center",
4058
+ sizeClasses.labelHeight,
4059
+ "flex-1 min-w-0"
4060
+ ),
4061
+ children: /* @__PURE__ */ jsx26(
4062
+ Text_default,
4063
+ {
4064
+ as: "label",
4065
+ htmlFor: inputId,
4066
+ size: sizeClasses.textSize,
4067
+ weight: "normal",
4068
+ className: cn(
4069
+ getCursorClass(),
4070
+ "select-none leading-normal flex items-center font-roboto truncate",
4071
+ labelClassName
4072
+ ),
4073
+ color: getTextColor(),
4074
+ children: label
4075
+ }
4076
+ )
4077
+ }
4078
+ )
4079
+ ]
4080
+ }
4081
+ ),
4082
+ errorMessage && /* @__PURE__ */ jsx26(
4083
+ Text_default,
4084
+ {
4085
+ size: "sm",
4086
+ weight: "normal",
4087
+ className: "mt-1.5 truncate",
4088
+ color: "text-error-600",
4089
+ children: errorMessage
4090
+ }
4091
+ ),
4092
+ helperText && !errorMessage && /* @__PURE__ */ jsx26(
4093
+ Text_default,
4094
+ {
4095
+ size: "sm",
4096
+ weight: "normal",
4097
+ className: "mt-1.5 truncate",
4098
+ color: "text-text-500",
4099
+ children: helperText
4100
+ }
4101
+ )
4102
+ ] });
4103
+ }
4104
+ );
4105
+ Radio.displayName = "Radio";
4106
+ var createRadioGroupStore = (name, defaultValue, disabled, onValueChange) => create((set, get) => ({
4107
+ value: defaultValue,
4108
+ setValue: (value) => {
4109
+ if (!get().disabled) {
4110
+ set({ value });
4111
+ get().onValueChange?.(value);
4112
+ }
4113
+ },
4114
+ onValueChange,
4115
+ disabled,
4116
+ name
4117
+ }));
4118
+ var useRadioGroupStore = (externalStore) => {
4119
+ if (!externalStore) {
4120
+ throw new Error("RadioGroupItem must be used within a RadioGroup");
4121
+ }
4122
+ return externalStore;
4123
+ };
4124
+ var injectStore = (children, store) => Children2.map(children, (child) => {
4125
+ if (!isValidElement2(child)) return child;
4126
+ const typedChild = child;
4127
+ const shouldInject = typedChild.type === RadioGroupItem;
4128
+ return cloneElement2(typedChild, {
4129
+ ...shouldInject ? { store } : {},
4130
+ ...typedChild.props.children ? { children: injectStore(typedChild.props.children, store) } : {}
4131
+ });
4132
+ });
4133
+ var RadioGroup = forwardRef5(
4134
+ ({
4135
+ value: propValue,
4136
+ defaultValue = "",
4137
+ onValueChange,
4138
+ name: propName,
4139
+ disabled = false,
4140
+ className = "",
4141
+ children,
4142
+ ...props
4143
+ }, ref) => {
4144
+ const generatedId = useId3();
4145
+ const name = propName || `radio-group-${generatedId}`;
4146
+ const storeRef = useRef2(null);
4147
+ storeRef.current ??= createRadioGroupStore(
4148
+ name,
4149
+ defaultValue,
4150
+ disabled,
4151
+ onValueChange
4152
+ );
4153
+ const store = storeRef.current;
4154
+ const { setValue } = useStore(store, (s) => s);
4155
+ useEffect5(() => {
4156
+ const currentValue = store.getState().value;
4157
+ if (currentValue && onValueChange) {
4158
+ onValueChange(currentValue);
4159
+ }
4160
+ }, []);
4161
+ useEffect5(() => {
4162
+ if (propValue !== void 0) {
4163
+ setValue(propValue);
4164
+ }
4165
+ }, [propValue, setValue]);
4166
+ useEffect5(() => {
4167
+ store.setState({ disabled });
4168
+ }, [disabled, store]);
4169
+ return /* @__PURE__ */ jsx26(
4170
+ "div",
4171
+ {
4172
+ ref,
4173
+ className,
4174
+ role: "radiogroup",
4175
+ "aria-label": name,
4176
+ ...props,
4177
+ children: injectStore(children, store)
4178
+ }
4179
+ );
4180
+ }
4181
+ );
4182
+ RadioGroup.displayName = "RadioGroup";
4183
+ var RadioGroupItem = forwardRef5(
4184
+ ({
4185
+ value,
4186
+ store: externalStore,
4187
+ disabled: itemDisabled,
4188
+ size = "medium",
4189
+ state = "default",
4190
+ className = "",
4191
+ id,
4192
+ ...props
4193
+ }, ref) => {
4194
+ const store = useRadioGroupStore(externalStore);
4195
+ const {
4196
+ value: groupValue,
4197
+ setValue,
4198
+ disabled: groupDisabled,
4199
+ name
4200
+ } = useStore(store);
4201
+ const generatedId = useId3();
4202
+ const inputId = id ?? `radio-item-${generatedId}`;
4203
+ const isChecked = groupValue === value;
4204
+ const isDisabled = groupDisabled || itemDisabled;
4205
+ const currentState = isDisabled ? "disabled" : state;
4206
+ return /* @__PURE__ */ jsx26(
4207
+ Radio,
4208
+ {
4209
+ ref,
4210
+ id: inputId,
4211
+ name,
4212
+ value,
4213
+ checked: isChecked,
4214
+ disabled: isDisabled,
4215
+ size,
4216
+ state: currentState,
4217
+ className,
4218
+ onChange: (e) => {
4219
+ if (e.target.checked && !isDisabled) {
4220
+ setValue(value);
4221
+ }
4222
+ },
4223
+ ...props
4224
+ }
4225
+ );
4226
+ }
4227
+ );
4228
+ RadioGroupItem.displayName = "RadioGroupItem";
4229
+
4230
+ // src/components/Alternative/Alternative.tsx
4231
+ import { forwardRef as forwardRef6, useId as useId4, useState as useState5 } from "react";
4232
+ import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
4233
+ var AlternativesList = ({
4234
+ alternatives,
4235
+ name,
4236
+ defaultValue,
4237
+ value,
4238
+ onValueChange,
4239
+ disabled = false,
4240
+ layout = "default",
4241
+ className = "",
4242
+ mode = "interactive",
4243
+ selectedValue
4244
+ }) => {
4245
+ const uniqueId = useId4();
4246
+ const groupName = name || `alternatives-${uniqueId}`;
4247
+ const [actualValue, setActualValue] = useState5(value);
4248
+ const isReadonly = mode === "readonly";
4249
+ const getStatusStyles = (status, isReadonly2) => {
4250
+ const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
4251
+ switch (status) {
4252
+ case "correct":
4253
+ return "bg-success-background border-success-300";
4254
+ case "incorrect":
4255
+ return "bg-error-background border-error-300";
4256
+ default:
4257
+ return `bg-background border-border-100 ${hoverClass}`;
4258
+ }
4259
+ };
4260
+ const getStatusBadge = (status) => {
4261
+ switch (status) {
4262
+ case "correct":
4263
+ return /* @__PURE__ */ jsx27(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx27(CheckCircle2, {}), children: "Resposta correta" });
4264
+ case "incorrect":
4265
+ return /* @__PURE__ */ jsx27(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx27(XCircle2, {}), children: "Resposta incorreta" });
4266
+ default:
4267
+ return null;
4268
+ }
4269
+ };
4270
+ const getLayoutClasses = () => {
4271
+ switch (layout) {
4272
+ case "compact":
4273
+ return "gap-2";
4274
+ case "detailed":
4275
+ return "gap-4";
4276
+ default:
4277
+ return "gap-3.5";
4278
+ }
4279
+ };
4280
+ const renderReadonlyAlternative = (alternative) => {
4281
+ const alternativeId = alternative.value;
4282
+ const isUserSelected = selectedValue === alternative.value;
4283
+ const isCorrectAnswer = alternative.status === "correct";
4284
+ let displayStatus = void 0;
4285
+ if (isUserSelected && !isCorrectAnswer) {
4286
+ displayStatus = "incorrect";
4287
+ } else if (isCorrectAnswer) {
4288
+ displayStatus = "correct";
4289
+ }
4290
+ const statusStyles = getStatusStyles(displayStatus, true);
4291
+ const statusBadge = getStatusBadge(displayStatus);
4292
+ const renderRadio = () => {
4293
+ 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"}`;
4294
+ const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
4295
+ return /* @__PURE__ */ jsx27("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ jsx27("div", { className: dotClasses }) });
4296
+ };
4297
+ if (layout === "detailed") {
4298
+ return /* @__PURE__ */ jsx27(
4299
+ "div",
4300
+ {
4301
+ className: cn(
4302
+ "border-2 rounded-lg p-4 w-full",
4303
+ statusStyles,
4304
+ alternative.disabled ? "opacity-50" : ""
4305
+ ),
4306
+ children: /* @__PURE__ */ jsxs21("div", { className: "flex items-start justify-between gap-3", children: [
4307
+ /* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-3 flex-1", children: [
4308
+ /* @__PURE__ */ jsx27("div", { className: "mt-1", children: renderRadio() }),
4309
+ /* @__PURE__ */ jsxs21("div", { className: "flex-1", children: [
4310
+ /* @__PURE__ */ jsx27(
4311
+ "p",
4312
+ {
4313
+ className: cn(
4314
+ "block font-medium",
4315
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
4316
+ ),
4317
+ children: alternative.label
4318
+ }
4319
+ ),
4320
+ alternative.description && /* @__PURE__ */ jsx27("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
4321
+ ] })
4322
+ ] }),
4323
+ statusBadge && /* @__PURE__ */ jsx27("div", { className: "flex-shrink-0", children: statusBadge })
4324
+ ] })
4325
+ },
4326
+ alternativeId
4327
+ );
4328
+ }
4329
+ return /* @__PURE__ */ jsxs21(
4330
+ "div",
4331
+ {
4332
+ className: cn(
4333
+ "flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
4334
+ statusStyles,
4335
+ alternative.disabled ? "opacity-50" : ""
4336
+ ),
4337
+ children: [
4338
+ /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 flex-1", children: [
4339
+ renderRadio(),
4340
+ /* @__PURE__ */ jsx27(
4341
+ "span",
4342
+ {
4343
+ className: cn(
4344
+ "flex-1",
4345
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
4346
+ ),
4347
+ children: alternative.label
4348
+ }
4349
+ )
4350
+ ] }),
4351
+ statusBadge && /* @__PURE__ */ jsx27("div", { className: "flex-shrink-0", children: statusBadge })
4352
+ ]
4353
+ },
4354
+ alternativeId
4355
+ );
4356
+ };
4357
+ if (isReadonly) {
4358
+ return /* @__PURE__ */ jsx27(
4359
+ "div",
4360
+ {
4361
+ className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
4362
+ children: alternatives.map(
4363
+ (alternative) => renderReadonlyAlternative(alternative)
4364
+ )
4365
+ }
4366
+ );
4367
+ }
4368
+ return /* @__PURE__ */ jsx27(
4369
+ RadioGroup,
4370
+ {
4371
+ name: groupName,
4372
+ defaultValue,
4373
+ value,
4374
+ onValueChange: (value2) => {
4375
+ setActualValue(value2);
4376
+ onValueChange?.(value2);
4377
+ },
4378
+ disabled,
4379
+ className: cn("flex flex-col", getLayoutClasses(), className),
4380
+ children: alternatives.map((alternative, index) => {
4381
+ const alternativeId = alternative.value || `alt-${index}`;
4382
+ const statusStyles = getStatusStyles(alternative.status, false);
4383
+ const statusBadge = getStatusBadge(alternative.status);
4384
+ if (layout === "detailed") {
4385
+ return /* @__PURE__ */ jsx27(
4386
+ "div",
4387
+ {
4388
+ className: cn(
4389
+ "border-2 rounded-lg p-4 transition-all",
4390
+ statusStyles,
4391
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
4392
+ ),
4393
+ children: /* @__PURE__ */ jsxs21("div", { className: "flex items-start justify-between gap-3", children: [
4394
+ /* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-3 flex-1", children: [
4395
+ /* @__PURE__ */ jsx27(
4396
+ RadioGroupItem,
4397
+ {
4398
+ value: alternative.value,
4399
+ id: alternativeId,
4400
+ disabled: alternative.disabled,
4401
+ className: "mt-1"
4402
+ }
4403
+ ),
4404
+ /* @__PURE__ */ jsxs21("div", { className: "flex-1", children: [
4405
+ /* @__PURE__ */ jsx27(
4406
+ "label",
4407
+ {
4408
+ htmlFor: alternativeId,
4409
+ className: cn(
4410
+ "block font-medium",
4411
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
4412
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
4413
+ ),
4414
+ children: alternative.label
4415
+ }
4416
+ ),
4417
+ alternative.description && /* @__PURE__ */ jsx27("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
4418
+ ] })
4419
+ ] }),
4420
+ statusBadge && /* @__PURE__ */ jsx27("div", { className: "flex-shrink-0", children: statusBadge })
4421
+ ] })
4422
+ },
4423
+ alternativeId
4424
+ );
4425
+ }
4426
+ return /* @__PURE__ */ jsxs21(
4427
+ "div",
4428
+ {
4429
+ className: cn(
4430
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
4431
+ statusStyles,
4432
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
4433
+ ),
4434
+ children: [
4435
+ /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 flex-1", children: [
4436
+ /* @__PURE__ */ jsx27(
4437
+ RadioGroupItem,
4438
+ {
4439
+ value: alternative.value,
4440
+ id: alternativeId,
4441
+ disabled: alternative.disabled
4442
+ }
4443
+ ),
4444
+ /* @__PURE__ */ jsx27(
4445
+ "label",
4446
+ {
4447
+ htmlFor: alternativeId,
4448
+ className: cn(
4449
+ "flex-1",
4450
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
4451
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
4452
+ ),
4453
+ children: alternative.label
4454
+ }
4455
+ )
4456
+ ] }),
4457
+ statusBadge && /* @__PURE__ */ jsx27("div", { className: "flex-shrink-0", children: statusBadge })
4458
+ ]
4459
+ },
4460
+ alternativeId
4461
+ );
4462
+ })
4463
+ }
4464
+ );
4465
+ };
4466
+ var HeaderAlternative = forwardRef6(
4467
+ ({ className, title, subTitle, content, ...props }, ref) => {
4468
+ return /* @__PURE__ */ jsxs21(
4469
+ "div",
4470
+ {
4471
+ ref,
4472
+ className: cn(
4473
+ "bg-background p-4 flex flex-col gap-4 rounded-xl",
4474
+ className
4475
+ ),
4476
+ ...props,
4477
+ children: [
4478
+ /* @__PURE__ */ jsxs21("span", { className: "flex flex-col", children: [
4479
+ /* @__PURE__ */ jsx27("p", { className: "text-text-950 font-bold text-lg", children: title }),
4480
+ /* @__PURE__ */ jsx27("p", { className: "text-text-700 text-sm ", children: subTitle })
4481
+ ] }),
4482
+ /* @__PURE__ */ jsx27("p", { className: "text-text-950 text-md", children: content })
4483
+ ]
4484
+ }
4485
+ );
4486
+ }
4487
+ );
4488
+
4489
+ // src/components/RecommendedLessonDetails/types.ts
4490
+ var DEFAULT_LABELS = {
4491
+ viewLesson: "Ver aula",
4492
+ viewPerformance: "Ver desempenho",
4493
+ resultsTitle: "Resultados da aula recomendada",
4494
+ completedLabel: "CONCLU\xCDDO",
4495
+ bestResultLabel: "MELHOR RESULTADO",
4496
+ hardestTopicLabel: "MAIOR DIFICULDADE",
4497
+ studentColumn: "Aluno",
4498
+ statusColumn: "Status",
4499
+ completionColumn: "Conclus\xE3o",
4500
+ durationColumn: "Dura\xE7\xE3o"
4501
+ };
4502
+ var DEFAULT_PERFORMANCE_LABELS = {
4503
+ title: "Desempenho",
4504
+ correctAnswersLabel: "N\xB0 DE QUEST\xD5ES CORRETAS",
4505
+ incorrectAnswersLabel: "N\xB0 DE QUEST\xD5ES INCORRETAS",
4506
+ bestResultLabel: "MELHOR RESULTADO",
4507
+ hardestTopicLabel: "MAIOR DIFICULDADE",
4508
+ lessonsTitle: "Aulas"
4509
+ };
4510
+
4511
+ // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
4512
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
4513
+ var PerformanceCard = ({
4514
+ icon,
4515
+ label,
4516
+ value,
4517
+ secondaryLabel,
4518
+ secondaryValue,
4519
+ variant
4520
+ }) => {
4521
+ const headerBgColor = {
4522
+ success: "bg-success-200",
4523
+ error: "bg-error-100"
4524
+ }[variant];
4525
+ const valueColor = {
4526
+ success: "text-success-700",
4527
+ error: "text-error-700"
4528
+ }[variant];
4529
+ const iconBgColor = {
4530
+ success: "bg-warning-300",
4531
+ error: "bg-error-300"
4532
+ }[variant];
4533
+ const secondaryLabelColor = {
4534
+ success: "text-success-600",
4535
+ error: "text-error-600"
4536
+ }[variant];
4537
+ return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col rounded-xl border border-border-50 bg-background overflow-hidden", children: [
4538
+ /* @__PURE__ */ jsxs22(
4539
+ "div",
4540
+ {
4541
+ className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
4542
+ children: [
4543
+ /* @__PURE__ */ jsx28(
4544
+ Text_default,
4545
+ {
4546
+ as: "span",
4547
+ className: `size-8 rounded-full flex items-center justify-center ${iconBgColor}`,
4548
+ children: icon
4549
+ }
4550
+ ),
4551
+ /* @__PURE__ */ jsx28(
4552
+ Text_default,
4553
+ {
4554
+ size: "2xs",
4555
+ weight: "medium",
4556
+ className: "text-text-800 uppercase text-center leading-none",
4557
+ children: label
4558
+ }
4559
+ ),
4560
+ /* @__PURE__ */ jsx28(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
4561
+ ]
4562
+ }
4563
+ ),
4564
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
4565
+ /* @__PURE__ */ jsx28(
4566
+ Text_default,
4567
+ {
4568
+ size: "2xs",
4569
+ weight: "medium",
4570
+ className: `${secondaryLabelColor} uppercase text-center`,
4571
+ children: secondaryLabel
4572
+ }
4573
+ ),
4574
+ /* @__PURE__ */ jsx28(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
4575
+ ] })
4576
+ ] });
4577
+ };
4578
+ var getAlternativeStatus = (isCorrect, isSelected) => {
4579
+ if (isCorrect) {
4580
+ return "correct";
4581
+ }
4582
+ if (isSelected) {
4583
+ return "incorrect";
4584
+ }
4585
+ return void 0;
4586
+ };
4587
+ var mapAlternatives = (question) => {
4588
+ return question.alternatives.map((alt) => ({
4589
+ value: alt.id,
4590
+ label: alt.text,
4591
+ status: getAlternativeStatus(alt.isCorrect, alt.isSelected)
4592
+ }));
4593
+ };
4594
+ var getSelectedValue = (question) => {
4595
+ const selected = question.alternatives.find((alt) => alt.isSelected);
4596
+ return selected?.id;
4597
+ };
4598
+ var QuestionAccordionItem = ({
4599
+ question,
4600
+ index
4601
+ }) => /* @__PURE__ */ jsx28(
4602
+ CardAccordation,
4603
+ {
4604
+ value: question.id,
4605
+ className: "bg-background rounded-xl border border-border-50",
4606
+ triggerClassName: "py-5 px-5",
4607
+ contentClassName: "px-5 pb-5",
4608
+ trigger: /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between flex-1", children: [
4609
+ /* @__PURE__ */ jsxs22(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: [
4610
+ "Quest\xE3o ",
4611
+ index + 1
4612
+ ] }),
4613
+ /* @__PURE__ */ jsx28(
4614
+ Badge_default,
4615
+ {
4616
+ size: "small",
4617
+ action: question.isCorrect ? "success" : "error",
4618
+ variant: "solid",
4619
+ iconLeft: question.isCorrect ? /* @__PURE__ */ jsx28(CheckCircleIcon, {}) : /* @__PURE__ */ jsx28(XCircleIcon, {}),
4620
+ children: question.isCorrect ? "Correta" : "Incorreta"
4621
+ }
4622
+ )
4623
+ ] }),
4624
+ children: /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3", children: [
4625
+ /* @__PURE__ */ jsx28(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
4626
+ /* @__PURE__ */ jsx28(
4627
+ CardAccordation,
4628
+ {
4629
+ value: `${question.id}-alternatives`,
4630
+ className: "bg-background rounded-lg border border-border-50",
4631
+ triggerClassName: "py-5 px-5",
4632
+ contentClassName: "px-5 py-5",
4633
+ trigger: /* @__PURE__ */ jsx28(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
4634
+ children: /* @__PURE__ */ jsx28(
4635
+ AlternativesList,
4636
+ {
4637
+ mode: "readonly",
4638
+ alternatives: mapAlternatives(question),
4639
+ selectedValue: getSelectedValue(question),
4640
+ layout: "default"
4641
+ }
4642
+ )
4643
+ }
4644
+ )
4645
+ ] })
4646
+ }
4647
+ );
4648
+ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx28(
4649
+ CardAccordation,
4650
+ {
4651
+ value: lesson.id,
4652
+ className: "bg-background rounded-xl border border-border-50",
4653
+ triggerClassName: "py-5 px-5",
4654
+ contentClassName: "px-5 pb-5",
4655
+ trigger: /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1 flex-1", children: [
4656
+ /* @__PURE__ */ jsx28(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
4657
+ /* @__PURE__ */ jsx28(
4658
+ ProgressBar_default,
4659
+ {
4660
+ value: lesson.progress,
4661
+ variant: "blue",
4662
+ size: "medium",
4663
+ showPercentage: true,
4664
+ layout: "default"
4665
+ }
4666
+ )
4667
+ ] }),
4668
+ children: /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ jsx28(
4669
+ QuestionAccordionItem,
4670
+ {
4671
+ question,
4672
+ index
4673
+ },
4674
+ question.id
4675
+ )) })
4676
+ }
4677
+ );
4678
+ var LoadingSkeleton2 = () => /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 animate-pulse", children: [
4679
+ /* @__PURE__ */ jsx28("div", { className: "h-6 bg-background-200 rounded w-48" }),
4680
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-3", children: [
4681
+ /* @__PURE__ */ jsx28("div", { className: "h-44 bg-background-200 rounded-xl" }),
4682
+ /* @__PURE__ */ jsx28("div", { className: "h-44 bg-background-200 rounded-xl" })
4683
+ ] })
4684
+ ] });
4685
+ var PerformanceContent = ({
4686
+ data,
4687
+ labels
4688
+ }) => /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-5", children: [
4689
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2", children: [
4690
+ /* @__PURE__ */ jsx28(
4691
+ Text_default,
4692
+ {
4693
+ as: "span",
4694
+ className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
4695
+ children: /* @__PURE__ */ jsx28(UserIcon2, { size: 16, className: "text-text-500" })
4696
+ }
4697
+ ),
4698
+ /* @__PURE__ */ jsx28(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
4699
+ ] }),
4700
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-3", children: [
4701
+ /* @__PURE__ */ jsx28(
4702
+ PerformanceCard,
4703
+ {
4704
+ icon: /* @__PURE__ */ jsx28(
4705
+ LightbulbFilamentIcon,
4706
+ {
4707
+ size: 18,
4708
+ weight: "fill",
4709
+ className: "text-white"
4710
+ }
4711
+ ),
4712
+ label: labels.correctAnswersLabel,
4713
+ value: data.correctAnswers,
4714
+ secondaryLabel: labels.bestResultLabel,
4715
+ secondaryValue: data.bestResult,
4716
+ variant: "success"
4717
+ }
4718
+ ),
4719
+ /* @__PURE__ */ jsx28(
4720
+ PerformanceCard,
4721
+ {
4722
+ icon: /* @__PURE__ */ jsx28(
4723
+ WarningCircleIcon,
4724
+ {
4725
+ size: 18,
4726
+ weight: "fill",
4727
+ className: "text-error-700"
4728
+ }
4729
+ ),
4730
+ label: labels.incorrectAnswersLabel,
4731
+ value: data.incorrectAnswers,
4732
+ secondaryLabel: labels.hardestTopicLabel,
4733
+ secondaryValue: data.hardestTopic,
4734
+ variant: "error"
4735
+ }
4736
+ )
4737
+ ] }),
4738
+ data.lessons.length > 0 && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3", children: [
4739
+ /* @__PURE__ */ jsx28(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
4740
+ /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ jsx28(LessonAccordionItem, { lesson }, lesson.id)) })
4741
+ ] })
4742
+ ] });
4743
+ var renderModalContent = (loading, data, labels) => {
4744
+ if (loading) {
4745
+ return /* @__PURE__ */ jsx28(LoadingSkeleton2, {});
4746
+ }
4747
+ if (data) {
4748
+ return /* @__PURE__ */ jsx28(PerformanceContent, { data, labels });
4749
+ }
4750
+ return null;
4751
+ };
4752
+ var StudentPerformanceModal = ({
4753
+ isOpen,
4754
+ onClose,
4755
+ data,
4756
+ loading = false,
4757
+ labels: customLabels
4758
+ }) => {
4759
+ const labels = useMemo2(
4760
+ () => ({ ...DEFAULT_PERFORMANCE_LABELS, ...customLabels }),
4761
+ [customLabels]
4762
+ );
4763
+ if (!data && !loading) {
4764
+ return null;
4765
+ }
4766
+ return /* @__PURE__ */ jsx28(
4767
+ Modal_default,
4768
+ {
4769
+ isOpen,
4770
+ onClose,
4771
+ title: labels.title,
4772
+ size: "lg",
4773
+ contentClassName: "max-h-[70vh] overflow-y-auto",
4774
+ children: renderModalContent(loading, data, labels)
4775
+ }
4776
+ );
4777
+ };
4778
+
4779
+ // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
4780
+ import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
4781
+ var RecommendedLessonDetails = ({
4782
+ data,
4783
+ loading = false,
4784
+ error = null,
4785
+ onViewLesson,
4786
+ onViewStudentPerformance,
4787
+ onBreadcrumbClick,
4788
+ mapSubjectNameToEnum,
4789
+ breadcrumbs,
4790
+ labels: customLabels,
4791
+ className
4792
+ }) => {
4793
+ const labels = useMemo3(
2165
4794
  () => ({ ...DEFAULT_LABELS, ...customLabels }),
2166
4795
  [customLabels]
2167
4796
  );
2168
- const defaultBreadcrumbs = useMemo2(
4797
+ const defaultBreadcrumbs = useMemo3(
2169
4798
  () => [
2170
4799
  { label: "Aulas recomendadas", path: "/aulas-recomendadas" },
2171
4800
  { label: data?.goal.title || "Detalhes" }
@@ -2173,7 +4802,7 @@ var RecommendedLessonDetails = ({
2173
4802
  [data?.goal.title]
2174
4803
  );
2175
4804
  const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
2176
- const displayStudents = useMemo2(() => {
4805
+ const displayStudents = useMemo3(() => {
2177
4806
  if (!data?.details.students) return [];
2178
4807
  const deadline = data?.goal.finalDate;
2179
4808
  return data.details.students.map(
@@ -2181,17 +4810,17 @@ var RecommendedLessonDetails = ({
2181
4810
  );
2182
4811
  }, [data?.details.students, data?.goal.finalDate]);
2183
4812
  if (loading) {
2184
- return /* @__PURE__ */ jsx22(
4813
+ return /* @__PURE__ */ jsx29(
2185
4814
  "div",
2186
4815
  {
2187
4816
  className: cn("flex flex-col gap-6", className),
2188
4817
  "data-testid": "lesson-details-loading",
2189
- children: /* @__PURE__ */ jsx22(LoadingSkeleton, {})
4818
+ children: /* @__PURE__ */ jsx29(LoadingSkeleton, {})
2190
4819
  }
2191
4820
  );
2192
4821
  }
2193
4822
  if (error) {
2194
- return /* @__PURE__ */ jsx22(
4823
+ return /* @__PURE__ */ jsx29(
2195
4824
  "div",
2196
4825
  {
2197
4826
  className: cn(
@@ -2199,21 +4828,21 @@ var RecommendedLessonDetails = ({
2199
4828
  className
2200
4829
  ),
2201
4830
  "data-testid": "lesson-details-error",
2202
- children: /* @__PURE__ */ jsx22(Text_default, { size: "md", className: "text-error-700", children: error })
4831
+ children: /* @__PURE__ */ jsx29(Text_default, { size: "md", className: "text-error-700", children: error })
2203
4832
  }
2204
4833
  );
2205
4834
  }
2206
4835
  if (!data) {
2207
4836
  return null;
2208
4837
  }
2209
- return /* @__PURE__ */ jsxs17(
4838
+ return /* @__PURE__ */ jsxs23(
2210
4839
  "div",
2211
4840
  {
2212
4841
  className: cn("flex flex-col gap-6", className),
2213
4842
  "data-testid": "recommended-lesson-details",
2214
4843
  children: [
2215
- /* @__PURE__ */ jsx22(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
2216
- /* @__PURE__ */ jsx22(
4844
+ /* @__PURE__ */ jsx29(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
4845
+ /* @__PURE__ */ jsx29(
2217
4846
  LessonHeader,
2218
4847
  {
2219
4848
  data,
@@ -2222,8 +4851,8 @@ var RecommendedLessonDetails = ({
2222
4851
  viewLessonLabel: labels.viewLesson
2223
4852
  }
2224
4853
  ),
2225
- /* @__PURE__ */ jsx22(ResultsSection, { data, labels }),
2226
- /* @__PURE__ */ jsx22(
4854
+ /* @__PURE__ */ jsx29(ResultsSection, { data, labels }),
4855
+ /* @__PURE__ */ jsx29(
2227
4856
  StudentsTable,
2228
4857
  {
2229
4858
  students: displayStudents,
@@ -2237,6 +4866,7 @@ var RecommendedLessonDetails = ({
2237
4866
  };
2238
4867
  var RecommendedLessonDetails_default = RecommendedLessonDetails;
2239
4868
  export {
2240
- RecommendedLessonDetails_default as RecommendedLessonDetails
4869
+ RecommendedLessonDetails_default as RecommendedLessonDetails,
4870
+ StudentPerformanceModal
2241
4871
  };
2242
4872
  //# sourceMappingURL=index.mjs.map