{"version":3,"sources":["../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import {\n  useState,\n  useMemo,\n  useEffect,\n  useRef,\n  MouseEvent,\n  RefObject,\n} from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Activity status types for calendar days\n */\nexport type ActivityStatus = 'near-deadline' | 'overdue' | 'in-deadline';\n\n/**\n * Activity data for a specific day\n */\nexport interface CalendarActivity {\n  id: string;\n  status: ActivityStatus;\n  title?: string;\n}\n\n/**\n * Calendar day data\n */\nexport interface CalendarDay {\n  date: Date;\n  isCurrentMonth: boolean;\n  isToday: boolean;\n  isSelected: boolean;\n  activities?: CalendarActivity[];\n}\n\n/**\n * Calendar variant types\n */\nexport type CalendarVariant = 'navigation' | 'selection';\n\n/**\n * Calendar component props\n */\nexport interface CalendarProps {\n  /** Calendar variant - navigation (compact) or selection (full) */\n  variant?: CalendarVariant;\n  /** Currently selected date */\n  selectedDate?: Date;\n  /** Function called when a date is selected */\n  onDateSelect?: (date: Date) => void;\n  /** Function called when month changes */\n  onMonthChange?: (date: Date) => void;\n  /** Activities data for calendar days */\n  activities?: Record<string, CalendarActivity[]>;\n  /** Show activities indicators */\n  showActivities?: boolean;\n  /**\n   * When true, a subtle overlay + spinner is shown over the grid while the\n   * month header and navigation stay visible and interactive. Lets consumers\n   * refetch a month's activities without hiding/resetting the whole calendar.\n   */\n  loading?: boolean;\n  /** Additional CSS classes */\n  className?: string;\n}\n\n/**\n * Day names abbreviations\n */\nexport const WEEK_DAYS = ['SEG', 'TER', 'QUA', 'QUI', 'SEX', 'SÁB', 'DOM'];\n\n/**\n * Day names single-letter abbreviations\n */\nconst WEEK_DAYS_SHORT = ['S', 'T', 'Q', 'Q', 'S', 'S', 'D'];\n\n/**\n * Month names in Portuguese\n */\nconst MONTH_NAMES = [\n  'Janeiro',\n  'Fevereiro',\n  'Março',\n  'Abril',\n  'Maio',\n  'Junho',\n  'Julho',\n  'Agosto',\n  'Setembro',\n  'Outubro',\n  'Novembro',\n  'Dezembro',\n];\n\n/**\n * Month/Year picker props\n */\ninterface MonthYearPickerProps {\n  monthPickerRef: RefObject<HTMLDivElement | null>;\n  availableYears: number[];\n  currentDate: Date;\n  onYearChange: (year: number) => void;\n  onMonthChange: (month: number, year: number) => void;\n}\n\n/**\n * Month/Year picker component\n */\nconst MonthYearPicker = ({\n  monthPickerRef,\n  availableYears,\n  currentDate,\n  onYearChange,\n  onMonthChange,\n}: MonthYearPickerProps) => (\n  <div\n    ref={monthPickerRef}\n    className=\"absolute top-full left-0 z-50 mt-1 bg-background rounded-lg shadow-lg border border-border-200 p-4 min-w-[280px]\"\n  >\n    <div className=\"mb-4\">\n      <h3 className=\"text-sm font-medium text-text-700 mb-2\">Selecionar Ano</h3>\n      <div className=\"grid grid-cols-4 gap-1 max-h-32 overflow-y-auto\">\n        {availableYears.map((year) => (\n          <button\n            key={year}\n            onClick={() => onYearChange(year)}\n            className={`\n              px-2 py-1 text-xs rounded text-center hover:bg-background-100 transition-colors\n              ${\n                year === currentDate.getFullYear()\n                  ? 'bg-primary-800 text-text font-medium hover:text-text-950'\n                  : 'text-text-700'\n              }\n            `}\n          >\n            {year}\n          </button>\n        ))}\n      </div>\n    </div>\n\n    <div>\n      <h3 className=\"text-sm font-medium text-text-700 mb-2\">Selecionar Mês</h3>\n      <div className=\"grid grid-cols-3 gap-1\">\n        {MONTH_NAMES.map((month, index) => (\n          <button\n            key={month}\n            onClick={() => onMonthChange(index, currentDate.getFullYear())}\n            className={`\n              px-2 py-2 text-xs rounded text-center hover:bg-background-100 transition-colors\n              ${\n                index === currentDate.getMonth()\n                  ? 'bg-primary-800 text-text font-medium hover:text-text-950'\n                  : 'text-text-700'\n              }\n            `}\n          >\n            {month.substring(0, 3)}\n          </button>\n        ))}\n      </div>\n    </div>\n  </div>\n);\n\n/**\n * Helper function to get day styles based on variant and conditions\n */\nconst getDayStyles = (\n  day: CalendarDay,\n  variant: CalendarVariant,\n  showActivities: boolean\n) => {\n  let dayStyle = '';\n  let textStyle: string;\n\n  const dayActivities = day.activities ?? [];\n  const hasActivityIndicator =\n    variant === 'navigation' && showActivities && dayActivities.length > 0;\n\n  if (variant === 'selection' && day.isSelected) {\n    dayStyle = 'bg-primary-800';\n    textStyle = 'text-text';\n  } else if (hasActivityIndicator) {\n    // The activity indicator takes precedence over the \"today\" emphasis so a\n    // deadline that falls on today still shows its colored dot (previously the\n    // isToday branch short-circuited and hid it).\n    const primaryActivity = dayActivities[0];\n    if (primaryActivity.status === 'near-deadline') {\n      dayStyle = 'bg-warning-background border-2 border-warning-400';\n      textStyle = 'text-text-950';\n    } else if (primaryActivity.status === 'in-deadline') {\n      dayStyle = 'bg-success-background border-2 border-success-300';\n      textStyle = 'text-text-950';\n    } else if (primaryActivity.status === 'overdue') {\n      dayStyle = 'bg-error-background border-2 border-error-300';\n      textStyle = 'text-text-950';\n    } else {\n      dayStyle = 'border-2 border-blue-500';\n      textStyle = 'text-blue-500';\n    }\n  } else if (day.isToday) {\n    textStyle = 'text-primary-800';\n  } else {\n    textStyle = 'text-text-950 hover:bg-background-100';\n  }\n\n  return { dayStyle, textStyle };\n};\n\n/**\n * Calendar component for Analytica Ensino platforms\n *\n * A comprehensive calendar component with activity indicators,\n * date selection, and navigation capabilities.\n */\nconst Calendar = ({\n  variant = 'selection',\n  selectedDate,\n  onDateSelect,\n  onMonthChange,\n  activities = {},\n  showActivities = true,\n  loading = false,\n  className = '',\n}: CalendarProps) => {\n  const [currentDate, setCurrentDate] = useState(selectedDate || new Date());\n  const [isMonthPickerOpen, setIsMonthPickerOpen] = useState(false);\n  const monthPickerRef = useRef<HTMLDivElement>(null);\n  const monthPickerContainerRef = useRef<HTMLDivElement>(null);\n\n  // Close month picker when clicking outside\n  useEffect(() => {\n    const handleClickOutside = (event: Event) => {\n      if (\n        monthPickerContainerRef.current &&\n        !monthPickerContainerRef.current.contains(event.target as Node)\n      ) {\n        setIsMonthPickerOpen(false);\n      }\n    };\n\n    if (isMonthPickerOpen) {\n      document.addEventListener('mousedown', handleClickOutside);\n    }\n\n    return () => {\n      document.removeEventListener('mousedown', handleClickOutside);\n    };\n  }, [isMonthPickerOpen]);\n\n  // Get today's date for comparison\n  const today = new Date();\n\n  // Generate available years (current year ± 10 years)\n  const availableYears = useMemo(() => {\n    const currentYear = new Date().getFullYear();\n    const years = [];\n    for (let year = currentYear - 10; year <= currentYear + 10; year++) {\n      years.push(year);\n    }\n    return years;\n  }, []);\n\n  // Calculate calendar data\n  const calendarData = useMemo(() => {\n    const year = currentDate.getFullYear();\n    const month = currentDate.getMonth();\n\n    // First day of the month\n    const firstDay = new Date(year, month, 1);\n\n    // Get the first Monday of the calendar view\n    const startDate = new Date(firstDay);\n    const firstDayOfWeek = (firstDay.getDay() + 6) % 7; // Convert Sunday=0 to Monday=0\n    startDate.setDate(startDate.getDate() - firstDayOfWeek);\n\n    const days: CalendarDay[] = [];\n    const currentCalendarDate = new Date(startDate);\n\n    // Generate 42 days (6 weeks)\n    for (let i = 0; i < 42; i++) {\n      const dateKey = currentCalendarDate.toISOString().split('T')[0];\n      const dayActivities = activities[dateKey] || [];\n\n      days.push({\n        date: new Date(currentCalendarDate),\n        isCurrentMonth: currentCalendarDate.getMonth() === month,\n        isToday:\n          currentCalendarDate.getFullYear() === today.getFullYear() &&\n          currentCalendarDate.getMonth() === today.getMonth() &&\n          currentCalendarDate.getDate() === today.getDate(),\n        isSelected: selectedDate\n          ? currentCalendarDate.getFullYear() === selectedDate.getFullYear() &&\n            currentCalendarDate.getMonth() === selectedDate.getMonth() &&\n            currentCalendarDate.getDate() === selectedDate.getDate()\n          : false,\n        activities: dayActivities,\n      });\n\n      currentCalendarDate.setDate(currentCalendarDate.getDate() + 1);\n    }\n\n    return days;\n  }, [currentDate, selectedDate, activities]);\n\n  // Navigation functions\n  const goToPreviousMonth = () => {\n    const newDate = new Date(currentDate);\n    newDate.setMonth(newDate.getMonth() - 1);\n    setCurrentDate(newDate);\n    onMonthChange?.(newDate);\n  };\n\n  const goToNextMonth = () => {\n    const newDate = new Date(currentDate);\n    newDate.setMonth(newDate.getMonth() + 1);\n    setCurrentDate(newDate);\n    onMonthChange?.(newDate);\n  };\n\n  // Month/Year selection functions\n  const goToMonth = (month: number, year: number) => {\n    const newDate = new Date(year, month, 1);\n    setCurrentDate(newDate);\n    setIsMonthPickerOpen(false);\n    onMonthChange?.(newDate);\n  };\n\n  const handleYearChange = (year: number) => {\n    const newDate = new Date(year, currentDate.getMonth(), 1);\n    setCurrentDate(newDate);\n  };\n\n  const toggleMonthPicker = (event: MouseEvent<HTMLButtonElement>) => {\n    event.stopPropagation();\n    setIsMonthPickerOpen(!isMonthPickerOpen);\n  };\n\n  // Date selection handler\n  const handleDateSelect = (day: CalendarDay) => {\n    onDateSelect?.(day.date);\n  };\n\n  // Subtle loading overlay: fades the grid and shows a spinner while a month's\n  // activities are (re)fetched. The month header/navigation stay above it and\n  // remain interactive. The faded backdrop and the spinner are separate layers\n  // so the spinner keeps full opacity.\n  const loadingOverlay = loading ? (\n    <div\n      className=\"absolute inset-0 z-10 rounded-xl\"\n      role=\"status\"\n      aria-live=\"polite\"\n      aria-busy=\"true\"\n      data-testid=\"calendar-loading\"\n    >\n      <div className=\"absolute inset-0 rounded-xl bg-background opacity-60\" />\n      <div className=\"absolute inset-0 flex items-center justify-center\">\n        <span className=\"sr-only\">Carregando atividades</span>\n        <div className=\"h-8 w-8 animate-spin rounded-full border-2 border-border-200 border-t-primary-800\" />\n      </div>\n    </div>\n  ) : null;\n\n  // Navigation variant (compact)\n  if (variant === 'navigation') {\n    return (\n      <div className={cn('bg-background rounded-xl pt-6 relative', className)}>\n        {loadingOverlay}\n        {/* Compact header — stacks above the loading overlay so month\n            navigation stays clickable while loading. */}\n        <div className=\"flex items-center justify-between mb-4 px-6 relative z-20\">\n          <div className=\"relative\" ref={monthPickerContainerRef}>\n            <button\n              onClick={toggleMonthPicker}\n              className=\"flex items-center group gap-1 rounded transition-colors cursor-pointer\"\n            >\n              <span className=\"text-sm font-medium text-text-600 group-hover:text-primary-950\">\n                {MONTH_NAMES[currentDate.getMonth()]}{' '}\n                {currentDate.getFullYear()}\n              </span>\n              <svg\n                className={`w-4 h-4 text-primary-950 transition-transform ${\n                  isMonthPickerOpen ? 'rotate-180' : ''\n                }`}\n                fill=\"none\"\n                stroke=\"currentColor\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path\n                  strokeLinecap=\"round\"\n                  strokeLinejoin=\"round\"\n                  strokeWidth={2}\n                  d=\"M19 9l-7 7-7-7\"\n                />\n              </svg>\n            </button>\n            {isMonthPickerOpen && (\n              <MonthYearPicker\n                monthPickerRef={monthPickerRef}\n                availableYears={availableYears}\n                currentDate={currentDate}\n                onYearChange={handleYearChange}\n                onMonthChange={goToMonth}\n              />\n            )}\n          </div>\n          <div className=\"flex items-center gap-10\">\n            <button\n              onClick={goToPreviousMonth}\n              className=\"p-1 rounded hover:bg-background-100 transition-colors\"\n              aria-label=\"Mês anterior\"\n            >\n              <svg\n                className=\"w-6 h-6 text-primary-950\"\n                fill=\"none\"\n                stroke=\"currentColor\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path\n                  strokeLinecap=\"round\"\n                  strokeLinejoin=\"round\"\n                  strokeWidth={2}\n                  d=\"M15 19l-7-7 7-7\"\n                />\n              </svg>\n            </button>\n            <button\n              onClick={goToNextMonth}\n              className=\"p-1 rounded hover:bg-background-100 transition-colors\"\n              aria-label=\"Próximo mês\"\n            >\n              <svg\n                className=\"w-6 h-6 text-primary-950\"\n                fill=\"none\"\n                stroke=\"currentColor\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path\n                  strokeLinecap=\"round\"\n                  strokeLinejoin=\"round\"\n                  strokeWidth={2}\n                  d=\"M9 5l7 7-7 7\"\n                />\n              </svg>\n            </button>\n          </div>\n        </div>\n\n        {/* Compact week days */}\n        <div className=\"grid grid-cols-7 gap-1 mb-2 px-3\">\n          {WEEK_DAYS_SHORT.map((day, index) => (\n            <div\n              key={`${day}-${index}`}\n              className=\"h-9 flex items-center justify-center text-xs font-normal text-text-600\"\n            >\n              {day}\n            </div>\n          ))}\n        </div>\n\n        {/* Compact calendar grid */}\n        <div className=\"grid grid-cols-7 gap-1 px-3\">\n          {calendarData.map((day) => {\n            // Não renderizar dias que não pertencem ao mês atual\n            if (!day.isCurrentMonth) {\n              return (\n                <div\n                  key={day.date.getTime()}\n                  className=\"flex items-center justify-center\"\n                >\n                  <div className=\"w-9 h-9\"></div>\n                </div>\n              );\n            }\n\n            const { dayStyle, textStyle } = getDayStyles(\n              day,\n              variant,\n              showActivities\n            );\n\n            let spanClass = '';\n            if (day.isSelected && day.isToday) {\n              spanClass = 'h-6 w-6 rounded-full bg-primary-800 text-text';\n            } else if (day.isSelected) {\n              spanClass = 'h-6 w-6 rounded-full bg-primary-950 text-text';\n            }\n\n            return (\n              <div\n                key={day.date.getTime()}\n                className=\"flex items-center justify-center\"\n              >\n                <button\n                  className={`\n                    w-9 h-9\n                    flex items-center justify-center\n                    text-md font-normal\n                    cursor-pointer\n                    rounded-full\n                    ${dayStyle}\n                    ${textStyle}\n                  `}\n                  onClick={() => handleDateSelect(day)}\n                  aria-label={`${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`}\n                  aria-current={day.isToday ? 'date' : undefined}\n                  tabIndex={0}\n                >\n                  <span className={spanClass}>{day.date.getDate()}</span>\n                </button>\n              </div>\n            );\n          })}\n        </div>\n      </div>\n    );\n  }\n\n  // Selection variant (full)\n  return (\n    <div className={cn('bg-background rounded-xl p-4 relative', className)}>\n      {loadingOverlay}\n      {/* Full header — stacks above the loading overlay so month navigation\n          stays clickable while loading. */}\n      <div className=\"flex items-center justify-between mb-3.5 relative z-20\">\n        <div className=\"relative\" ref={monthPickerContainerRef}>\n          <button\n            onClick={toggleMonthPicker}\n            className=\"flex items-center gap-2 hover:bg-background-100 rounded px-2 py-1 transition-colors\"\n          >\n            <h2 className=\"text-lg font-semibold text-text-950\">\n              {MONTH_NAMES[currentDate.getMonth()]} {currentDate.getFullYear()}\n            </h2>\n            <svg\n              className={`w-4 h-4 text-text-400 transition-transform ${\n                isMonthPickerOpen ? 'rotate-180' : ''\n              }`}\n              fill=\"none\"\n              stroke=\"currentColor\"\n              viewBox=\"0 0 24 24\"\n            >\n              <path\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth={2}\n                d=\"M19 9l-7 7-7-7\"\n              />\n            </svg>\n          </button>\n          {isMonthPickerOpen && (\n            <MonthYearPicker\n              monthPickerRef={monthPickerRef}\n              availableYears={availableYears}\n              currentDate={currentDate}\n              onYearChange={handleYearChange}\n              onMonthChange={goToMonth}\n            />\n          )}\n        </div>\n        <div className=\"flex items-center gap-1\">\n          <button\n            onClick={goToPreviousMonth}\n            className=\"p-1 rounded-md hover:bg-background-100 transition-colors\"\n            aria-label=\"Mês anterior\"\n          >\n            <svg\n              className=\"w-6 h-6 text-primary-950\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              viewBox=\"0 0 24 24\"\n            >\n              <path\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth={2}\n                d=\"M15 19l-7-7 7-7\"\n              />\n            </svg>\n          </button>\n          <button\n            onClick={goToNextMonth}\n            className=\"p-1 rounded-md hover:bg-background-100 transition-colors\"\n            aria-label=\"Próximo mês\"\n          >\n            <svg\n              className=\"w-6 h-6 text-primary-950\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              viewBox=\"0 0 24 24\"\n            >\n              <path\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth={2}\n                d=\"M9 5l7 7-7 7\"\n              />\n            </svg>\n          </button>\n        </div>\n      </div>\n\n      {/* Week days header */}\n      <div className=\"grid grid-cols-7 mb-2\">\n        {WEEK_DAYS.map((day) => (\n          <div\n            key={day}\n            className=\"h-4 flex items-center justify-center text-xs font-semibold text-text-500\"\n          >\n            {day}\n          </div>\n        ))}\n      </div>\n\n      {/* Calendar grid */}\n      <div className=\"grid grid-cols-7\">\n        {calendarData.map((day) => {\n          // Não renderizar dias que não pertencem ao mês atual\n          if (!day.isCurrentMonth) {\n            return (\n              <div\n                key={day.date.getTime()}\n                className=\"flex items-center justify-center\"\n              >\n                <div className=\"w-10 h-10\"></div>\n              </div>\n            );\n          }\n\n          const { dayStyle, textStyle } = getDayStyles(\n            day,\n            variant,\n            showActivities\n          );\n\n          return (\n            <div\n              key={day.date.getTime()}\n              className=\"flex items-center justify-center\"\n            >\n              <button\n                className={`\n                  w-9 h-9\n                  flex items-center justify-center\n                  text-lg font-normal\n                  cursor-pointer\n                  rounded-full\n                  focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1\n                  ${dayStyle}\n                  ${textStyle}\n                `}\n                onClick={() => handleDateSelect(day)}\n                aria-label={`${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`}\n                aria-current={day.isToday ? 'date' : undefined}\n                tabIndex={0}\n              >\n                {day.date.getDate()}\n              </button>\n            </div>\n          );\n        })}\n      </div>\n    </div>\n  );\n};\n\nexport default Calendar;\n"],"mappings":";;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAgHH,SACE,KADF;AAlDG,IAAM,YAAY,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,UAAO,KAAK;AAKzE,IAAM,kBAAkB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAK1D,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAgBA,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,KAAK;AAAA,IACL,WAAU;AAAA,IAEV;AAAA,2BAAC,SAAI,WAAU,QACb;AAAA,4BAAC,QAAG,WA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