{"version":3,"file":"header-ItyqXdXL.js","sources":["../../src/common/layout/header/profile-menu/profile-menu.tsx","../../src/assets/svg/pengguin-logo-mobile.svg","../../src/assets/svg/ispeak-mobile-dark.svg","../../src/features/notifications/components/notifications/notifications.tsx","../../src/common/layout/header/header.tsx"],"sourcesContent":["import React from 'react'\nimport {\n Divider,\n MenuItem,\n Typography,\n Stack,\n ListItemIcon,\n Box,\n IconButton,\n Avatar,\n Menu,\n Link,\n Button,\n} from '@common/components'\nimport { UserOverviewContainer, ExpandableMenuItem } from './profile-menu.styles'\nimport {\n useAppDispatch,\n useAppSelector,\n useMediaQuery,\n useToggle,\n useTranslation,\n} from '@common/hooks'\nimport {\n DarkModeIcon,\n LogoutIcon,\n MenuIcon,\n PersonIcon,\n WbSunnyIcon,\n LanguageIcon,\n} from '@common/icons'\nimport personIcon from '@assets/svg/person-uno.svg'\nimport duoPersonIcon from '@assets/svg/duo-person-icon.svg'\nimport feedbackIcon from '@assets/svg/feedback-icon.svg'\nimport rulerIcon from '@assets/svg/ruler-icon.svg'\nimport { handleGravatar } from '@common/utils/gravatar'\nimport {\n BIO_ROUTE,\n DASHBOARD_ROUTE,\n FEEDBACK_ROUTE,\n LOGIN_ROUTE,\n MAIN_ROUTE,\n MY_CLASSROOMS_ROUTE,\n NOTES_ROUTE,\n PERSONAL_ROUTE,\n PRICING_ROUTE,\n QUIZ_VOCAB_ROUTE,\n} from '@common/constants/routes'\nimport { AnimatePresence, motion, useAnimation } from 'motion/react'\nimport { RouterLink, useLocation, useNavigate } from '@lib/router'\nimport { useTheme } from '@features/theme/theme.hooks'\nimport { NavLinkButton, navlinks } from '../header'\nimport useToggleMenu from '@common/hooks/use-toggle-menu'\nimport { logout } from '@features/auth/auth-actions'\nimport { useToast } from '@features/toast/hooks'\nimport { useUser } from '@features/auth/hooks'\nimport { modeType, setThemeMode } from '@features/theme/theme.slice'\nimport { usePaymentGetCreditsQuery } from '@app/services/auto-generated/payment'\nimport { languages } from '@common/constants/languages'\nimport { isUNSW } from '../../../../utils/unswUtils'\nimport { creditsSystem } from '@config/features-flags'\n\nconst ProfileMenu = (props) => {\n const { t, i18n } = useTranslation('common')\n const navigate = useNavigate()\n const dispatch = useAppDispatch()\n const matches = useMediaQuery(990)\n const { user, isStudent } = useUser()\n const { mode, isDark } = useTheme()\n const { pathname } = useLocation()\n const selectedTheme = useAppSelector((state) => state.theme)\n const { anchorEl, open, handleClick, handleClose: handleCloseMenu } = useToggleMenu()\n const [selectedLanguage, setSelectedLanguage] = React.useState(languages[0])\n const {\n open: openLanguageMenu,\n handleToggle: handleToggleLanguageMenu,\n handleClose: handleCloseLanguageMenu,\n } = useToggle(false)\n const {\n open: openThemeMenu,\n handleToggle: handleToggleThemeMenu,\n handleClose: handleCloseThemeMenu,\n } = useToggle(false)\n const handleClose = () => {\n handleCloseMenu()\n handleCloseLanguageMenu()\n handleCloseThemeMenu()\n }\n const { data } = usePaymentGetCreditsQuery(undefined, { skip: !creditsSystem })\n\n const hanldeChangeLanguage = (code: string) => {\n i18n.changeLanguage(code)\n setSelectedLanguage(languages.find((lang) => lang.code === code))\n }\n\n const handleChangeThemeMode = (mode: modeType) => {\n dispatch(setThemeMode(mode))\n }\n\n const handleLogoutClick = () => {\n dispatch(logout())\n handleClose()\n navigate(isUNSW() ? LOGIN_ROUTE : MAIN_ROUTE)\n }\n\n const toast = useToast()\n const handleToast = () => {\n toast('This feature is not available at the moment', 'warning')\n }\n\n const themeOptions = [\n {\n value: 'light',\n label: t('header.menu.lightTheme', 'Light theme'),\n },\n {\n value: 'dark',\n label: t('header.menu.darkTheme', 'Dark theme'),\n },\n {\n value: 'browser',\n label: t('header.menu.deviceTheme', 'Device theme'),\n },\n ]\n\n return (\n <>\n