analytica-frontend-lib 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -6504,21 +6504,30 @@ var createNotificationsHook = (apiClient) => {
6504
6504
  };
6505
6505
 
6506
6506
  // src/components/Table/Table.tsx
6507
- import { forwardRef as forwardRef14 } from "react";
6507
+ import {
6508
+ forwardRef as forwardRef14,
6509
+ useState as useState13,
6510
+ useMemo as useMemo5,
6511
+ useEffect as useEffect13
6512
+ } from "react";
6513
+ import { CaretUp, CaretDown } from "phosphor-react";
6508
6514
  import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
6509
6515
  var Table = forwardRef14(
6510
6516
  ({ variant = "default", className, children, ...props }, ref) => /* @__PURE__ */ jsx39(
6511
6517
  "div",
6512
6518
  {
6513
6519
  className: cn(
6514
- "relative w-full overflow-hidden",
6520
+ "relative w-full overflow-x-auto",
6515
6521
  variant === "default" && "border border-border-200 rounded-xl"
6516
6522
  ),
6517
6523
  children: /* @__PURE__ */ jsxs28(
6518
6524
  "table",
6519
6525
  {
6520
6526
  ref,
6521
- className: cn("w-full caption-bottom text-sm", className),
6527
+ className: cn(
6528
+ "analytica-table w-full caption-bottom text-sm border-separate border-spacing-0",
6529
+ className
6530
+ ),
6522
6531
  ...props,
6523
6532
  children: [
6524
6533
  /* @__PURE__ */ jsx39("caption", { className: "sr-only", children: "My Table" }),
@@ -6540,15 +6549,11 @@ var TableHeader = forwardRef14(({ className, ...props }, ref) => /* @__PURE__ */
6540
6549
  ));
6541
6550
  TableHeader.displayName = "TableHeader";
6542
6551
  var TableBody = forwardRef14(
6543
- ({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ jsx39(
6552
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
6544
6553
  "tbody",
6545
6554
  {
6546
6555
  ref,
6547
- className: cn(
6548
- "[&_tr:last-child]:border-0",
6549
- variant === "default" && "border-t border-border-200",
6550
- className
6551
- ),
6556
+ className: cn("[&_tr:last-child]:border-border-200", className),
6552
6557
  ...props
6553
6558
  }
6554
6559
  )
@@ -6571,7 +6576,7 @@ var TableFooter = forwardRef14(
6571
6576
  TableFooter.displayName = "TableFooter";
6572
6577
  var VARIANT_STATES_ROW = {
6573
6578
  default: {
6574
- default: "border-b border-border-200",
6579
+ default: "border border-border-200",
6575
6580
  borderless: ""
6576
6581
  },
6577
6582
  selected: {
@@ -6588,7 +6593,13 @@ var VARIANT_STATES_ROW = {
6588
6593
  }
6589
6594
  };
6590
6595
  var TableRow = forwardRef14(
6591
- ({ variant = "default", state = "default", className, ...props }, ref) => {
6596
+ ({
6597
+ variant = "default",
6598
+ state = "default",
6599
+ clickable = false,
6600
+ className,
6601
+ ...props
6602
+ }, ref) => {
6592
6603
  return /* @__PURE__ */ jsx39(
6593
6604
  "tr",
6594
6605
  {
@@ -6596,6 +6607,7 @@ var TableRow = forwardRef14(
6596
6607
  className: cn(
6597
6608
  "transition-colors",
6598
6609
  state !== "disabled" ? "hover:bg-muted/50" : "",
6610
+ clickable && state !== "disabled" ? "cursor-pointer" : "",
6599
6611
  VARIANT_STATES_ROW[state][variant],
6600
6612
  className
6601
6613
  ),
@@ -6606,24 +6618,49 @@ var TableRow = forwardRef14(
6606
6618
  }
6607
6619
  );
6608
6620
  TableRow.displayName = "TableRow";
6609
- var TableHead = forwardRef14(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
6610
- "th",
6611
- {
6612
- ref,
6613
- className: cn(
6614
- "h-10 px-6 py-3.5 bg-muted/50 text-left align-middle font-bold text-text-800 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
6615
- className
6616
- ),
6621
+ var TableHead = forwardRef14(
6622
+ ({
6623
+ className,
6624
+ sortable = true,
6625
+ sortDirection = null,
6626
+ onSort,
6627
+ children,
6617
6628
  ...props
6629
+ }, ref) => {
6630
+ const handleClick = () => {
6631
+ if (sortable && onSort) {
6632
+ onSort();
6633
+ }
6634
+ };
6635
+ return /* @__PURE__ */ jsx39(
6636
+ "th",
6637
+ {
6638
+ ref,
6639
+ className: cn(
6640
+ "h-10 px-6 py-3.5 text-left align-middle font-bold text-base text-text-800 tracking-[0.2px] leading-none [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] whitespace-nowrap",
6641
+ sortable && "cursor-pointer select-none hover:bg-muted/30",
6642
+ className
6643
+ ),
6644
+ onClick: handleClick,
6645
+ ...props,
6646
+ children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
6647
+ children,
6648
+ sortable && /* @__PURE__ */ jsxs28("div", { className: "flex flex-col", children: [
6649
+ sortDirection === "asc" && /* @__PURE__ */ jsx39(CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
6650
+ sortDirection === "desc" && /* @__PURE__ */ jsx39(CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
6651
+ ] })
6652
+ ] })
6653
+ }
6654
+ );
6618
6655
  }
6619
- ));
6656
+ );
6620
6657
  TableHead.displayName = "TableHead";
6621
6658
  var TableCell = forwardRef14(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
6622
6659
  "td",
6623
6660
  {
6624
6661
  ref,
6625
6662
  className: cn(
6626
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-md text-text-800 px-6 py-3.5",
6663
+ "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-base font-normal text-text-800 leading-[150%] tracking-normal px-6 py-3.5 whitespace-nowrap",
6627
6664
  className
6628
6665
  ),
6629
6666
  ...props
@@ -6647,7 +6684,7 @@ var Table_default = Table;
6647
6684
  // src/components/Select/Select.tsx
6648
6685
  import { create as create7, useStore as useStore4 } from "zustand";
6649
6686
  import {
6650
- useEffect as useEffect13,
6687
+ useEffect as useEffect14,
6651
6688
  useRef as useRef8,
6652
6689
  forwardRef as forwardRef15,
6653
6690
  isValidElement as isValidElement4,
@@ -6655,7 +6692,7 @@ import {
6655
6692
  cloneElement as cloneElement4,
6656
6693
  useId as useId8
6657
6694
  } from "react";
6658
- import { CaretDown, Check as Check4, WarningCircle as WarningCircle5 } from "phosphor-react";
6695
+ import { CaretDown as CaretDown2, Check as Check4, WarningCircle as WarningCircle5 } from "phosphor-react";
6659
6696
  import { Fragment as Fragment6, jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
6660
6697
  var VARIANT_CLASSES4 = {
6661
6698
  outlined: "border-2 rounded-lg focus:border-primary-950",
@@ -6778,13 +6815,13 @@ var Select = ({
6778
6815
  search(children2);
6779
6816
  return found;
6780
6817
  };
6781
- useEffect13(() => {
6818
+ useEffect14(() => {
6782
6819
  if (!selectedLabel && defaultValue) {
6783
6820
  const label2 = findLabelForValue(children, defaultValue);
6784
6821
  if (label2) store.setState({ selectedLabel: label2 });
6785
6822
  }
6786
6823
  }, [children, defaultValue, selectedLabel]);
6787
- useEffect13(() => {
6824
+ useEffect14(() => {
6788
6825
  const handleClickOutside = (event) => {
6789
6826
  if (selectRef.current && !selectRef.current.contains(event.target)) {
6790
6827
  setOpen(false);
@@ -6819,7 +6856,7 @@ var Select = ({
6819
6856
  document.removeEventListener("keydown", handleArrowKeys);
6820
6857
  };
6821
6858
  }, [open]);
6822
- useEffect13(() => {
6859
+ useEffect14(() => {
6823
6860
  if (propValue) {
6824
6861
  setValue(propValue);
6825
6862
  const label2 = findLabelForValue(children, propValue);
@@ -6896,7 +6933,7 @@ var SelectTrigger = forwardRef15(
6896
6933
  children: [
6897
6934
  props.children,
6898
6935
  /* @__PURE__ */ jsx40(
6899
- CaretDown,
6936
+ CaretDown2,
6900
6937
  {
6901
6938
  className: cn(
6902
6939
  "h-[1em] w-[1em] opacity-50 transition-transform",
@@ -7000,13 +7037,13 @@ var Select_default = Select;
7000
7037
  // src/components/Menu/Menu.tsx
7001
7038
  import { create as create8, useStore as useStore5 } from "zustand";
7002
7039
  import {
7003
- useEffect as useEffect14,
7040
+ useEffect as useEffect15,
7004
7041
  useRef as useRef9,
7005
7042
  forwardRef as forwardRef16,
7006
7043
  isValidElement as isValidElement5,
7007
7044
  Children as Children5,
7008
7045
  cloneElement as cloneElement5,
7009
- useState as useState13
7046
+ useState as useState14
7010
7047
  } from "react";
7011
7048
  import { CaretLeft, CaretRight as CaretRight2 } from "phosphor-react";
7012
7049
  import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
@@ -7042,7 +7079,7 @@ var Menu = forwardRef16(
7042
7079
  storeRef.current ??= createMenuStore(onValueChange);
7043
7080
  const store = storeRef.current;
7044
7081
  const { setValue } = useStore5(store, (s) => s);
7045
- useEffect14(() => {
7082
+ useEffect15(() => {
7046
7083
  setValue(propValue ?? defaultValue);
7047
7084
  }, [defaultValue, propValue, setValue]);
7048
7085
  const baseClasses = variant === "menu-overflow" ? "w-fit py-2 flex flex-row items-center justify-center" : "w-full py-2 flex flex-row items-center justify-center";
@@ -7244,9 +7281,9 @@ var MenuOverflow = ({
7244
7281
  ...props
7245
7282
  }) => {
7246
7283
  const containerRef = useRef9(null);
7247
- const [showLeftArrow, setShowLeftArrow] = useState13(false);
7248
- const [showRightArrow, setShowRightArrow] = useState13(false);
7249
- useEffect14(() => {
7284
+ const [showLeftArrow, setShowLeftArrow] = useState14(false);
7285
+ const [showRightArrow, setShowRightArrow] = useState14(false);
7286
+ useEffect15(() => {
7250
7287
  const checkScroll = () => internalCheckScroll(
7251
7288
  containerRef.current,
7252
7289
  setShowLeftArrow,
@@ -7321,9 +7358,9 @@ var Menu_default = Menu;
7321
7358
  import {
7322
7359
  forwardRef as forwardRef17,
7323
7360
  Fragment as Fragment7,
7324
- useState as useState14,
7361
+ useState as useState15,
7325
7362
  useRef as useRef10,
7326
- useEffect as useEffect15
7363
+ useEffect as useEffect16
7327
7364
  } from "react";
7328
7365
  import {
7329
7366
  CaretRight as CaretRight3,
@@ -8092,13 +8129,13 @@ var CardAudio = forwardRef17(
8092
8129
  className,
8093
8130
  ...props
8094
8131
  }, ref) => {
8095
- const [isPlaying, setIsPlaying] = useState14(false);
8096
- const [currentTime, setCurrentTime] = useState14(0);
8097
- const [duration, setDuration] = useState14(0);
8098
- const [volume, setVolume] = useState14(1);
8099
- const [showVolumeControl, setShowVolumeControl] = useState14(false);
8100
- const [showSpeedMenu, setShowSpeedMenu] = useState14(false);
8101
- const [playbackRate, setPlaybackRate] = useState14(1);
8132
+ const [isPlaying, setIsPlaying] = useState15(false);
8133
+ const [currentTime, setCurrentTime] = useState15(0);
8134
+ const [duration, setDuration] = useState15(0);
8135
+ const [volume, setVolume] = useState15(1);
8136
+ const [showVolumeControl, setShowVolumeControl] = useState15(false);
8137
+ const [showSpeedMenu, setShowSpeedMenu] = useState15(false);
8138
+ const [playbackRate, setPlaybackRate] = useState15(1);
8102
8139
  const audioRef = useRef10(null);
8103
8140
  const volumeControlRef = useRef10(null);
8104
8141
  const speedMenuRef = useRef10(null);
@@ -8175,7 +8212,7 @@ var CardAudio = forwardRef17(
8175
8212
  }
8176
8213
  return /* @__PURE__ */ jsx43(SpeakerHigh, { size: 24 });
8177
8214
  };
8178
- useEffect15(() => {
8215
+ useEffect16(() => {
8179
8216
  const handleClickOutside = (event) => {
8180
8217
  if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
8181
8218
  setShowVolumeControl(false);
@@ -8901,8 +8938,8 @@ var NotFound_default = NotFound;
8901
8938
  // src/components/VideoPlayer/VideoPlayer.tsx
8902
8939
  import {
8903
8940
  useRef as useRef11,
8904
- useState as useState16,
8905
- useEffect as useEffect16,
8941
+ useState as useState17,
8942
+ useEffect as useEffect17,
8906
8943
  useCallback as useCallback3
8907
8944
  } from "react";
8908
8945
  import { createPortal } from "react-dom";
@@ -8918,7 +8955,7 @@ import {
8918
8955
  } from "phosphor-react";
8919
8956
 
8920
8957
  // src/components/DownloadButton/DownloadButton.tsx
8921
- import { useCallback as useCallback2, useState as useState15 } from "react";
8958
+ import { useCallback as useCallback2, useState as useState16 } from "react";
8922
8959
  import { DownloadSimple } from "phosphor-react";
8923
8960
  import { jsx as jsx46 } from "react/jsx-runtime";
8924
8961
  var getMimeType = (url) => {
@@ -8995,7 +9032,7 @@ var DownloadButton = ({
8995
9032
  lessonTitle = "aula",
8996
9033
  disabled = false
8997
9034
  }) => {
8998
- const [isDownloading, setIsDownloading] = useState15(false);
9035
+ const [isDownloading, setIsDownloading] = useState16(false);
8999
9036
  const isValidUrl = useCallback2((url) => {
9000
9037
  return Boolean(
9001
9038
  url && url.trim() !== "" && url !== "undefined" && url !== "null"
@@ -9190,7 +9227,7 @@ var SpeedMenu = ({
9190
9227
  };
9191
9228
  };
9192
9229
  const position = getMenuPosition();
9193
- useEffect16(() => {
9230
+ useEffect17(() => {
9194
9231
  const handleClickOutside = (event) => {
9195
9232
  const target = event.target;
9196
9233
  const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
@@ -9271,21 +9308,21 @@ var VideoPlayer = ({
9271
9308
  }) => {
9272
9309
  const videoRef = useRef11(null);
9273
9310
  const { isUltraSmallMobile, isTinyMobile } = useMobile();
9274
- const [isPlaying, setIsPlaying] = useState16(false);
9275
- const [currentTime, setCurrentTime] = useState16(0);
9276
- const [duration, setDuration] = useState16(0);
9277
- const [isMuted, setIsMuted] = useState16(false);
9278
- const [volume, setVolume] = useState16(1);
9279
- const [isFullscreen, setIsFullscreen] = useState16(false);
9280
- const [showControls, setShowControls] = useState16(true);
9281
- const [hasCompleted, setHasCompleted] = useState16(false);
9282
- const [showCaptions, setShowCaptions] = useState16(false);
9283
- const [subtitlesValidation, setSubtitlesValidation] = useState16("idle");
9284
- useEffect16(() => {
9311
+ const [isPlaying, setIsPlaying] = useState17(false);
9312
+ const [currentTime, setCurrentTime] = useState17(0);
9313
+ const [duration, setDuration] = useState17(0);
9314
+ const [isMuted, setIsMuted] = useState17(false);
9315
+ const [volume, setVolume] = useState17(1);
9316
+ const [isFullscreen, setIsFullscreen] = useState17(false);
9317
+ const [showControls, setShowControls] = useState17(true);
9318
+ const [hasCompleted, setHasCompleted] = useState17(false);
9319
+ const [showCaptions, setShowCaptions] = useState17(false);
9320
+ const [subtitlesValidation, setSubtitlesValidation] = useState17("idle");
9321
+ useEffect17(() => {
9285
9322
  setHasCompleted(false);
9286
9323
  }, [src]);
9287
- const [playbackRate, setPlaybackRate] = useState16(1);
9288
- const [showSpeedMenu, setShowSpeedMenu] = useState16(false);
9324
+ const [playbackRate, setPlaybackRate] = useState17(1);
9325
+ const [showSpeedMenu, setShowSpeedMenu] = useState17(false);
9289
9326
  const lastSaveTimeRef = useRef11(0);
9290
9327
  const trackRef = useRef11(null);
9291
9328
  const controlsTimeoutRef = useRef11(null);
@@ -9353,13 +9390,13 @@ var VideoPlayer = ({
9353
9390
  }, LEAVE_HIDE_TIMEOUT);
9354
9391
  }
9355
9392
  }, [isFullscreen, clearControlsTimeout, isUserInteracting]);
9356
- useEffect16(() => {
9393
+ useEffect17(() => {
9357
9394
  if (videoRef.current) {
9358
9395
  videoRef.current.volume = volume;
9359
9396
  videoRef.current.muted = isMuted;
9360
9397
  }
9361
9398
  }, [volume, isMuted]);
9362
- useEffect16(() => {
9399
+ useEffect17(() => {
9363
9400
  const video = videoRef.current;
9364
9401
  if (!video) return;
9365
9402
  const onPlay = () => setIsPlaying(true);
@@ -9374,13 +9411,13 @@ var VideoPlayer = ({
9374
9411
  video.removeEventListener("ended", onEnded);
9375
9412
  };
9376
9413
  }, []);
9377
- useEffect16(() => {
9414
+ useEffect17(() => {
9378
9415
  const video = videoRef.current;
9379
9416
  if (!video) return;
9380
9417
  video.setAttribute("playsinline", "");
9381
9418
  video.setAttribute("webkit-playsinline", "");
9382
9419
  }, []);
9383
- useEffect16(() => {
9420
+ useEffect17(() => {
9384
9421
  if (isPlaying) {
9385
9422
  showControlsWithTimer();
9386
9423
  } else {
@@ -9392,7 +9429,7 @@ var VideoPlayer = ({
9392
9429
  }
9393
9430
  }
9394
9431
  }, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
9395
- useEffect16(() => {
9432
+ useEffect17(() => {
9396
9433
  const video = videoRef.current;
9397
9434
  if (!video) return;
9398
9435
  const handleFullscreenChange = () => {
@@ -9427,7 +9464,7 @@ var VideoPlayer = ({
9427
9464
  );
9428
9465
  };
9429
9466
  }, [showControlsWithTimer]);
9430
- useEffect16(() => {
9467
+ useEffect17(() => {
9431
9468
  const init = () => {
9432
9469
  if (!isFullscreen) {
9433
9470
  showControlsWithTimer();
@@ -9462,7 +9499,7 @@ var VideoPlayer = ({
9462
9499
  if (hasValidSaved) return saved;
9463
9500
  return void 0;
9464
9501
  }, [autoSave, storageKey, src, initialTime]);
9465
- useEffect16(() => {
9502
+ useEffect17(() => {
9466
9503
  const start = getInitialTime();
9467
9504
  if (start !== void 0 && videoRef.current) {
9468
9505
  videoRef.current.currentTime = start;
@@ -9599,7 +9636,7 @@ var VideoPlayer = ({
9599
9636
  setDuration(videoRef.current.duration);
9600
9637
  }
9601
9638
  }, []);
9602
- useEffect16(() => {
9639
+ useEffect17(() => {
9603
9640
  const controller = new AbortController();
9604
9641
  const validateSubtitles = async () => {
9605
9642
  if (!subtitles) {
@@ -9646,12 +9683,12 @@ var VideoPlayer = ({
9646
9683
  controller.abort();
9647
9684
  };
9648
9685
  }, [subtitles]);
9649
- useEffect16(() => {
9686
+ useEffect17(() => {
9650
9687
  if (trackRef.current?.track) {
9651
9688
  trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
9652
9689
  }
9653
9690
  }, [subtitles, showCaptions, subtitlesValidation]);
9654
- useEffect16(() => {
9691
+ useEffect17(() => {
9655
9692
  const handleVisibilityChange = () => {
9656
9693
  if (document.hidden && isPlaying && videoRef.current) {
9657
9694
  videoRef.current.pause();
@@ -9963,7 +10000,7 @@ var VideoPlayer = ({
9963
10000
  var VideoPlayer_default = VideoPlayer;
9964
10001
 
9965
10002
  // src/components/Whiteboard/Whiteboard.tsx
9966
- import { useCallback as useCallback4, useState as useState17 } from "react";
10003
+ import { useCallback as useCallback4, useState as useState18 } from "react";
9967
10004
  import { ArrowsOut } from "phosphor-react";
9968
10005
  import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
9969
10006
  var IMAGE_WIDTH = 225;
@@ -9976,7 +10013,7 @@ var Whiteboard = ({
9976
10013
  imagesPerRow = 2,
9977
10014
  ...rest
9978
10015
  }) => {
9979
- const [imageErrors, setImageErrors] = useState17(/* @__PURE__ */ new Set());
10016
+ const [imageErrors, setImageErrors] = useState18(/* @__PURE__ */ new Set());
9980
10017
  const handleDownload = useCallback4(
9981
10018
  (image) => {
9982
10019
  if (onDownload) {
@@ -10084,10 +10121,10 @@ var Whiteboard_default = Whiteboard;
10084
10121
  import {
10085
10122
  createContext,
10086
10123
  useContext,
10087
- useEffect as useEffect17,
10088
- useState as useState18,
10124
+ useEffect as useEffect18,
10125
+ useState as useState19,
10089
10126
  useCallback as useCallback5,
10090
- useMemo as useMemo5
10127
+ useMemo as useMemo6
10091
10128
  } from "react";
10092
10129
  import { useLocation, Navigate } from "react-router-dom";
10093
10130
  import { Fragment as Fragment10, jsx as jsx49 } from "react/jsx-runtime";
@@ -10101,7 +10138,7 @@ var AuthProvider = ({
10101
10138
  getSessionFn,
10102
10139
  getTokensFn
10103
10140
  }) => {
10104
- const [authState, setAuthState] = useState18({
10141
+ const [authState, setAuthState] = useState19({
10105
10142
  isAuthenticated: false,
10106
10143
  isLoading: true,
10107
10144
  ...initialAuthState
@@ -10149,10 +10186,10 @@ var AuthProvider = ({
10149
10186
  tokens: void 0
10150
10187
  }));
10151
10188
  }, [signOutFn]);
10152
- useEffect17(() => {
10189
+ useEffect18(() => {
10153
10190
  checkAuth();
10154
10191
  }, [checkAuth]);
10155
- const contextValue = useMemo5(
10192
+ const contextValue = useMemo6(
10156
10193
  () => ({
10157
10194
  ...authState,
10158
10195
  checkAuth,
@@ -10264,8 +10301,8 @@ var getRootDomain = () => {
10264
10301
  import {
10265
10302
  forwardRef as forwardRef18,
10266
10303
  useId as useId9,
10267
- useState as useState19,
10268
- useEffect as useEffect18
10304
+ useState as useState20,
10305
+ useEffect as useEffect19
10269
10306
  } from "react";
10270
10307
  import { CaretRight as CaretRight4 } from "phosphor-react";
10271
10308
  import { jsx as jsx50, jsxs as jsxs36 } from "react/jsx-runtime";
@@ -10281,13 +10318,13 @@ var CardAccordation = forwardRef18(
10281
10318
  disabled = false,
10282
10319
  ...props
10283
10320
  }, ref) => {
10284
- const [internalExpanded, setInternalExpanded] = useState19(defaultExpanded);
10321
+ const [internalExpanded, setInternalExpanded] = useState20(defaultExpanded);
10285
10322
  const generatedId = useId9();
10286
10323
  const contentId = value ? `accordion-content-${value}` : generatedId;
10287
10324
  const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
10288
10325
  const isControlled = controlledExpanded !== void 0;
10289
10326
  const isExpanded = isControlled ? controlledExpanded : internalExpanded;
10290
- useEffect18(() => {
10327
+ useEffect19(() => {
10291
10328
  if (isControlled) {
10292
10329
  setInternalExpanded(controlledExpanded);
10293
10330
  }
@@ -10378,9 +10415,9 @@ import {
10378
10415
  cloneElement as cloneElement7,
10379
10416
  forwardRef as forwardRef19,
10380
10417
  isValidElement as isValidElement6,
10381
- useEffect as useEffect19,
10418
+ useEffect as useEffect20,
10382
10419
  useRef as useRef12,
10383
- useState as useState20
10420
+ useState as useState21
10384
10421
  } from "react";
10385
10422
  import { create as create9 } from "zustand";
10386
10423
  import { jsx as jsx51 } from "react/jsx-runtime";
@@ -10449,7 +10486,7 @@ var AccordionGroup = forwardRef19(
10449
10486
  className,
10450
10487
  ...props
10451
10488
  }, ref) => {
10452
- const [internalValue, setInternalValue] = useState20(
10489
+ const [internalValue, setInternalValue] = useState21(
10453
10490
  defaultValue || (type === "single" ? "" : [])
10454
10491
  );
10455
10492
  const isControlled = controlledValue !== void 0;
@@ -10474,10 +10511,10 @@ var AccordionGroup = forwardRef19(
10474
10511
  );
10475
10512
  }
10476
10513
  const store = storeRef.current;
10477
- useEffect19(() => {
10514
+ useEffect20(() => {
10478
10515
  store.setState({ value: currentValue });
10479
10516
  }, [currentValue, store]);
10480
- useEffect19(() => {
10517
+ useEffect20(() => {
10481
10518
  if (!isControlled) {
10482
10519
  setInternalValue((prev) => {
10483
10520
  if (type === "single") {
@@ -10530,7 +10567,7 @@ AccordionGroup.displayName = "AccordionGroup";
10530
10567
 
10531
10568
  // src/components/Alternative/Alternative.tsx
10532
10569
  import { CheckCircle as CheckCircle4, XCircle as XCircle3 } from "phosphor-react";
10533
- import { forwardRef as forwardRef20, useId as useId10, useState as useState21 } from "react";
10570
+ import { forwardRef as forwardRef20, useId as useId10, useState as useState22 } from "react";
10534
10571
  import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
10535
10572
  var AlternativesList = ({
10536
10573
  alternatives,
@@ -10546,7 +10583,7 @@ var AlternativesList = ({
10546
10583
  }) => {
10547
10584
  const uniqueId = useId10();
10548
10585
  const groupName = name || `alternatives-${uniqueId}`;
10549
- const [actualValue, setActualValue] = useState21(value);
10586
+ const [actualValue, setActualValue] = useState22(value);
10550
10587
  const isReadonly = mode === "readonly";
10551
10588
  const getStatusStyles2 = (status, isReadonly2) => {
10552
10589
  const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
@@ -10831,7 +10868,7 @@ function createZustandAuthAdapter(useAuthStore2) {
10831
10868
  }
10832
10869
 
10833
10870
  // src/components/Auth/useUrlAuthentication.ts
10834
- import { useEffect as useEffect20, useRef as useRef13 } from "react";
10871
+ import { useEffect as useEffect21, useRef as useRef13 } from "react";
10835
10872
  import { useLocation as useLocation2 } from "react-router-dom";
10836
10873
  var getAuthParams = (location, extractParams) => {
10837
10874
  const searchParams = new URLSearchParams(location.search);
@@ -10880,7 +10917,7 @@ var handleUserData = (responseData, setUser) => {
10880
10917
  function useUrlAuthentication(options) {
10881
10918
  const location = useLocation2();
10882
10919
  const processedRef = useRef13(false);
10883
- useEffect20(() => {
10920
+ useEffect21(() => {
10884
10921
  const handleAuthentication = async () => {
10885
10922
  if (processedRef.current) {
10886
10923
  return;
@@ -10951,9 +10988,9 @@ function useUrlAuthentication(options) {
10951
10988
  }
10952
10989
 
10953
10990
  // src/components/Auth/useApiConfig.ts
10954
- import { useMemo as useMemo6 } from "react";
10991
+ import { useMemo as useMemo7 } from "react";
10955
10992
  function useApiConfig(api) {
10956
- return useMemo6(
10993
+ return useMemo7(
10957
10994
  () => ({
10958
10995
  get: (endpoint, config) => api.get(endpoint, config)
10959
10996
  }),
@@ -10971,8 +11008,8 @@ import {
10971
11008
  } from "phosphor-react";
10972
11009
  import {
10973
11010
  forwardRef as forwardRef22,
10974
- useEffect as useEffect23,
10975
- useState as useState24
11011
+ useEffect as useEffect24,
11012
+ useState as useState25
10976
11013
  } from "react";
10977
11014
 
10978
11015
  // src/components/Quiz/useQuizStore.ts
@@ -11578,15 +11615,15 @@ var useQuizStore = create10()(
11578
11615
  import {
11579
11616
  forwardRef as forwardRef21,
11580
11617
  useCallback as useCallback6,
11581
- useEffect as useEffect22,
11618
+ useEffect as useEffect23,
11582
11619
  useId as useId11,
11583
- useMemo as useMemo7,
11620
+ useMemo as useMemo8,
11584
11621
  useRef as useRef14,
11585
- useState as useState23
11622
+ useState as useState24
11586
11623
  } from "react";
11587
11624
 
11588
11625
  // src/components/MultipleChoice/MultipleChoice.tsx
11589
- import { useEffect as useEffect21, useState as useState22 } from "react";
11626
+ import { useEffect as useEffect22, useState as useState23 } from "react";
11590
11627
  import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
11591
11628
  import { jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
11592
11629
  var MultipleChoiceList = ({
@@ -11598,8 +11635,8 @@ var MultipleChoiceList = ({
11598
11635
  onHandleSelectedValues,
11599
11636
  mode = "interactive"
11600
11637
  }) => {
11601
- const [actualValue, setActualValue] = useState22(selectedValues);
11602
- useEffect21(() => {
11638
+ const [actualValue, setActualValue] = useState23(selectedValues);
11639
+ useEffect22(() => {
11603
11640
  setActualValue(selectedValues);
11604
11641
  }, [selectedValues]);
11605
11642
  const getStatusBadge2 = (status) => {
@@ -11840,13 +11877,13 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
11840
11877
  );
11841
11878
  const prevSelectedValuesRef = useRef14([]);
11842
11879
  const prevQuestionIdRef = useRef14("");
11843
- const allCurrentAnswerIds = useMemo7(() => {
11880
+ const allCurrentAnswerIds = useMemo8(() => {
11844
11881
  return allCurrentAnswers?.map((answer) => answer.optionId) || [];
11845
11882
  }, [allCurrentAnswers]);
11846
- const selectedValues = useMemo7(() => {
11883
+ const selectedValues = useMemo8(() => {
11847
11884
  return allCurrentAnswerIds?.filter((id) => id !== null) || [];
11848
11885
  }, [allCurrentAnswerIds]);
11849
- const stableSelectedValues = useMemo7(() => {
11886
+ const stableSelectedValues = useMemo8(() => {
11850
11887
  const currentQuestionId = currentQuestion?.id || "";
11851
11888
  const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
11852
11889
  if (hasQuestionChanged) {
@@ -11878,7 +11915,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
11878
11915
  },
11879
11916
  [currentQuestion, selectMultipleAnswer]
11880
11917
  );
11881
- const questionKey = useMemo7(
11918
+ const questionKey = useMemo8(
11882
11919
  () => `question-${currentQuestion?.id || "1"}`,
11883
11920
  [currentQuestion?.id]
11884
11921
  );
@@ -11954,7 +11991,7 @@ var QuizDissertative = ({ paddingBottom }) => {
11954
11991
  textareaRef.current.style.height = `${newHeight}px`;
11955
11992
  }
11956
11993
  }, []);
11957
- useEffect22(() => {
11994
+ useEffect23(() => {
11958
11995
  adjustTextareaHeight();
11959
11996
  }, [currentAnswer, adjustTextareaHeight]);
11960
11997
  if (!currentQuestion) {
@@ -12093,7 +12130,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
12093
12130
  isCorrect: false
12094
12131
  }
12095
12132
  ];
12096
- const [userAnswers, setUserAnswers] = useState23(() => {
12133
+ const [userAnswers, setUserAnswers] = useState24(() => {
12097
12134
  if (variant === "result") {
12098
12135
  return mockUserAnswers;
12099
12136
  }
@@ -12212,7 +12249,7 @@ var QuizFill = ({ paddingBottom }) => {
12212
12249
  isCorrect: true
12213
12250
  }
12214
12251
  ];
12215
- const [answers, setAnswers] = useState23({});
12252
+ const [answers, setAnswers] = useState24({});
12216
12253
  const baseId = useId11();
12217
12254
  const getAvailableOptionsForSelect = (selectId) => {
12218
12255
  const usedOptions = new Set(
@@ -12352,7 +12389,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
12352
12389
  };
12353
12390
  const correctRadiusRelative = calculateCorrectRadiusRelative();
12354
12391
  const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
12355
- const [clickPositionRelative, setClickPositionRelative] = useState23(variant == "result" ? mockUserAnswerRelative : null);
12392
+ const [clickPositionRelative, setClickPositionRelative] = useState24(variant == "result" ? mockUserAnswerRelative : null);
12356
12393
  const convertToRelativeCoordinates = (x, y, rect) => {
12357
12394
  const safeWidth = Math.max(rect.width, 1e-3);
12358
12395
  const safeHeight = Math.max(rect.height, 1e-3);
@@ -12520,7 +12557,7 @@ var getFinishConfirmationText = (type) => {
12520
12557
  };
12521
12558
  var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
12522
12559
  const { setVariant } = useQuizStore();
12523
- useEffect23(() => {
12560
+ useEffect24(() => {
12524
12561
  setVariant(variant);
12525
12562
  }, [variant, setVariant]);
12526
12563
  return /* @__PURE__ */ jsx55("div", { ref, className: cn("flex flex-col", className), ...props, children });
@@ -12535,7 +12572,7 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
12535
12572
  formatTime: formatTime2,
12536
12573
  isStarted
12537
12574
  } = useQuizStore();
12538
- const [showExitConfirmation, setShowExitConfirmation] = useState24(false);
12575
+ const [showExitConfirmation, setShowExitConfirmation] = useState25(false);
12539
12576
  const totalQuestions = getTotalQuestions();
12540
12577
  const quizTitle = getQuizTitle();
12541
12578
  const handleBackClick = () => {
@@ -12603,12 +12640,14 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
12603
12640
  ] });
12604
12641
  });
12605
12642
  var QuizHeader = () => {
12606
- const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
12643
+ const { getCurrentQuestion, getQuestionIndex } = useQuizStore();
12607
12644
  const currentQuestion = getCurrentQuestion();
12645
+ let currentId = currentQuestion && "questionId" in currentQuestion ? currentQuestion.questionId : currentQuestion?.id;
12646
+ const questionIndex = getQuestionIndex(currentId);
12608
12647
  return /* @__PURE__ */ jsx55(
12609
12648
  HeaderAlternative,
12610
12649
  {
12611
- title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
12650
+ title: currentQuestion ? `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}` : "Quest\xE3o",
12612
12651
  subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topic?.name ?? "",
12613
12652
  content: currentQuestion?.statement ?? ""
12614
12653
  }
@@ -12736,8 +12775,8 @@ var QuizFooter = forwardRef22(
12736
12775
  const currentAnswer = getCurrentAnswer();
12737
12776
  const currentQuestion = getCurrentQuestion();
12738
12777
  const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
12739
- const [activeModal, setActiveModal] = useState24(null);
12740
- const [filterType, setFilterType] = useState24("all");
12778
+ const [activeModal, setActiveModal] = useState25(null);
12779
+ const [filterType, setFilterType] = useState25("all");
12741
12780
  const openModal = (modalName) => setActiveModal(modalName);
12742
12781
  const closeModal = () => setActiveModal(null);
12743
12782
  const isModalOpen = (modalName) => activeModal === modalName;
@@ -13079,7 +13118,7 @@ var QuizFooter = forwardRef22(
13079
13118
  );
13080
13119
 
13081
13120
  // src/components/Quiz/QuizResult.tsx
13082
- import { forwardRef as forwardRef23, useEffect as useEffect24, useState as useState25 } from "react";
13121
+ import { forwardRef as forwardRef23, useEffect as useEffect25, useState as useState26 } from "react";
13083
13122
  import { Clock as Clock3 } from "phosphor-react";
13084
13123
  import { jsx as jsx56, jsxs as jsxs41 } from "react/jsx-runtime";
13085
13124
  var QuizBadge = ({
@@ -13108,8 +13147,8 @@ var QuizHeaderResult = forwardRef23(
13108
13147
  getCurrentQuestion,
13109
13148
  questionsResult
13110
13149
  } = useQuizStore();
13111
- const [status, setStatus] = useState25(void 0);
13112
- useEffect24(() => {
13150
+ const [status, setStatus] = useState26(void 0);
13151
+ useEffect25(() => {
13113
13152
  const cq = getCurrentQuestion();
13114
13153
  if (!cq) {
13115
13154
  setStatus(void 0);
@@ -13482,7 +13521,7 @@ var BreadcrumbMenu = ({
13482
13521
  };
13483
13522
 
13484
13523
  // src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
13485
- import { useEffect as useEffect25 } from "react";
13524
+ import { useEffect as useEffect26 } from "react";
13486
13525
 
13487
13526
  // src/components/BreadcrumbMenu/breadcrumbStore.ts
13488
13527
  import { create as create11 } from "zustand";
@@ -13611,7 +13650,7 @@ var useBreadcrumbBuilder = (config) => {
13611
13650
  (level) => isBreadcrumbWithData(level) ? level.data : null
13612
13651
  );
13613
13652
  const levelUrlIds = levels.map((level) => level.urlId);
13614
- useEffect25(() => {
13653
+ useEffect26(() => {
13615
13654
  const newBreadcrumbs = [root];
13616
13655
  const previousIds = [];
13617
13656
  for (const level of levels) {
@@ -13643,11 +13682,11 @@ var useBreadcrumbBuilder = (config) => {
13643
13682
  };
13644
13683
 
13645
13684
  // src/components/BreadcrumbMenu/useUrlParams.ts
13646
- import { useMemo as useMemo8 } from "react";
13685
+ import { useMemo as useMemo9 } from "react";
13647
13686
  import { useLocation as useLocation3 } from "react-router-dom";
13648
13687
  var useUrlParams = (config) => {
13649
13688
  const location = useLocation3();
13650
- return useMemo8(() => {
13689
+ return useMemo9(() => {
13651
13690
  const segments = location.pathname.split("/").filter(Boolean);
13652
13691
  const params = {};
13653
13692
  for (const [key, index] of Object.entries(config)) {
@@ -13658,15 +13697,15 @@ var useUrlParams = (config) => {
13658
13697
  };
13659
13698
 
13660
13699
  // src/hooks/useAppInitialization.ts
13661
- import { useMemo as useMemo9 } from "react";
13700
+ import { useMemo as useMemo10 } from "react";
13662
13701
 
13663
13702
  // src/hooks/useInstitution.ts
13664
- import { useEffect as useEffect26, useState as useState26 } from "react";
13703
+ import { useEffect as useEffect27, useState as useState27 } from "react";
13665
13704
  function useInstitutionId() {
13666
- const [institutionId, setInstitutionId] = useState26(() => {
13705
+ const [institutionId, setInstitutionId] = useState27(() => {
13667
13706
  return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
13668
13707
  });
13669
- useEffect26(() => {
13708
+ useEffect27(() => {
13670
13709
  const metaTag = document.querySelector('meta[name="institution-id"]');
13671
13710
  if (!metaTag) return;
13672
13711
  const observer = new MutationObserver(() => {
@@ -13833,7 +13872,7 @@ var useAuthStore = create13()(
13833
13872
  function useAppInitialization() {
13834
13873
  const getInstitutionId = useInstitutionId();
13835
13874
  const { initialize, initialized, institutionId } = useAppStore();
13836
- const authFunctions = useMemo9(
13875
+ const authFunctions = useMemo10(
13837
13876
  () => ({
13838
13877
  checkAuth: async () => {
13839
13878
  const { sessionInfo, tokens } = useAuthStore.getState();
@@ -13870,7 +13909,7 @@ function useAppInitialization() {
13870
13909
  }
13871
13910
 
13872
13911
  // src/hooks/useAppContent.ts
13873
- import { useCallback as useCallback7, useEffect as useEffect27, useMemo as useMemo10 } from "react";
13912
+ import { useCallback as useCallback7, useEffect as useEffect28, useMemo as useMemo11 } from "react";
13874
13913
  import { useNavigate as useNavigate2 } from "react-router-dom";
13875
13914
  function useAppContent(config) {
13876
13915
  const navigate = useNavigate2();
@@ -13920,7 +13959,7 @@ function useAppContent(config) {
13920
13959
  },
13921
13960
  [navigate, onError]
13922
13961
  );
13923
- const urlAuthConfig = useMemo10(
13962
+ const urlAuthConfig = useMemo11(
13924
13963
  () => ({
13925
13964
  setTokens,
13926
13965
  setSessionInfo,
@@ -13946,10 +13985,10 @@ function useAppContent(config) {
13946
13985
  );
13947
13986
  useUrlAuthentication(urlAuthConfig);
13948
13987
  const { sessionInfo } = useAuth();
13949
- const institutionIdToUse = useMemo10(() => {
13988
+ const institutionIdToUse = useMemo11(() => {
13950
13989
  return sessionInfo?.institutionId || getInstitutionId;
13951
13990
  }, [sessionInfo?.institutionId, getInstitutionId]);
13952
- useEffect27(() => {
13991
+ useEffect28(() => {
13953
13992
  if (institutionIdToUse && !initialized) {
13954
13993
  initialize(institutionIdToUse);
13955
13994
  }