@iblai/iblai-js 1.20.7 → 1.20.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.
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import React__default, { useRef, useEffect, useState, useCallback, useLayoutEffect, forwardRef, createElement as createElement$1, useMemo, createContext, useReducer, useImperativeHandle, useContext, useId as useId$2, useDebugValue, isValidElement, Children, PureComponent, cloneElement, Component, lazy, Suspense } from 'react';
3
3
  import { useDispatch, useSelector } from 'react-redux';
4
4
  import { selectSessionId, selectActiveChatMessages, useCachedSessionId, chatActions, LOCAL_STORAGE_KEYS, TimeTracker, getInitials, useTenantMetadata, WithPermissions, useStripeUpgrade, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, selectRbacPermissions, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, WithFormPermissions, MENTOR_VISIBILITY } from '@iblai/web-utils';
5
- import { useGetTenantChatPrivacyConfigQuery, useGetChatPrivacyEffectiveQuery, useCreateSessionIdMutation, useUpdateSessionDisableChathistoryMutation, chatPrivacyApiSlice, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, ChatPrivacyModeEnum, useGetUserChatPrivacySettingsQuery, useUpdateUserChatPrivacySettingsMutation, CHAT_PRIVACY_MODES, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useUpdateTenantChatPrivacyConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetReportsQuery, useCreateReportMutation, useGetMentorPublicSettingsQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
5
+ import { useGetTenantChatPrivacyConfigQuery, useGetChatPrivacyEffectiveQuery, useCreateSessionIdMutation, useUpdateSessionDisableChathistoryMutation, chatPrivacyApiSlice, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, ChatPrivacyModeEnum, useGetUserChatPrivacySettingsQuery, useUpdateUserChatPrivacySettingsMutation, CHAT_PRIVACY_MODES, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useUpdateTenantChatPrivacyConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetReportsQuery, useCreateReportMutation, useGetMentorPublicSettingsQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetLearnerDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
6
6
  import { toast } from 'sonner';
7
7
  import { jsx, Fragment as Fragment$1, jsxs } from 'react/jsx-runtime';
8
8
  import * as ReactDOM from 'react-dom';
@@ -57778,138 +57778,13 @@ AvatarImageNoBorder.displayName = "AvatarImageNoBorder";
57778
57778
  const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (jsx(Fallback, { ref: ref, className: cn("bg-muted flex h-full w-full items-center justify-center rounded-full", className), ...props })));
57779
57779
  AvatarFallback.displayName = Fallback.displayName;
57780
57780
 
57781
- function useStateMachine$2(initialState, machine) {
57782
- return React.useReducer((state, event) => {
57783
- const nextState = machine[state][event];
57784
- return nextState ?? state;
57785
- }, initialState);
57786
- }
57787
-
57788
- // src/presence.tsx
57789
- var Presence$2 = (props) => {
57790
- const { present, children } = props;
57791
- const presence = usePresence$2(present);
57792
- const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
57793
- const ref = useComposedRefs$1(presence.ref, getElementRef$3(child));
57794
- const forceMount = typeof children === "function";
57795
- return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
57796
- };
57797
- Presence$2.displayName = "Presence";
57798
- function usePresence$2(present) {
57799
- const [node, setNode] = React.useState();
57800
- const stylesRef = React.useRef(null);
57801
- const prevPresentRef = React.useRef(present);
57802
- const prevAnimationNameRef = React.useRef("none");
57803
- const initialState = present ? "mounted" : "unmounted";
57804
- const [state, send] = useStateMachine$2(initialState, {
57805
- mounted: {
57806
- UNMOUNT: "unmounted",
57807
- ANIMATION_OUT: "unmountSuspended"
57808
- },
57809
- unmountSuspended: {
57810
- MOUNT: "mounted",
57811
- ANIMATION_END: "unmounted"
57812
- },
57813
- unmounted: {
57814
- MOUNT: "mounted"
57815
- }
57816
- });
57817
- React.useEffect(() => {
57818
- const currentAnimationName = getAnimationName$2(stylesRef.current);
57819
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
57820
- }, [state]);
57821
- useLayoutEffect2$1(() => {
57822
- const styles = stylesRef.current;
57823
- const wasPresent = prevPresentRef.current;
57824
- const hasPresentChanged = wasPresent !== present;
57825
- if (hasPresentChanged) {
57826
- const prevAnimationName = prevAnimationNameRef.current;
57827
- const currentAnimationName = getAnimationName$2(styles);
57828
- if (present) {
57829
- send("MOUNT");
57830
- } else if (currentAnimationName === "none" || styles?.display === "none") {
57831
- send("UNMOUNT");
57832
- } else {
57833
- const isAnimating = prevAnimationName !== currentAnimationName;
57834
- if (wasPresent && isAnimating) {
57835
- send("ANIMATION_OUT");
57836
- } else {
57837
- send("UNMOUNT");
57838
- }
57839
- }
57840
- prevPresentRef.current = present;
57841
- }
57842
- }, [present, send]);
57843
- useLayoutEffect2$1(() => {
57844
- if (node) {
57845
- let timeoutId;
57846
- const ownerWindow = node.ownerDocument.defaultView ?? window;
57847
- const handleAnimationEnd = (event) => {
57848
- const currentAnimationName = getAnimationName$2(stylesRef.current);
57849
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
57850
- if (event.target === node && isCurrentAnimation) {
57851
- send("ANIMATION_END");
57852
- if (!prevPresentRef.current) {
57853
- const currentFillMode = node.style.animationFillMode;
57854
- node.style.animationFillMode = "forwards";
57855
- timeoutId = ownerWindow.setTimeout(() => {
57856
- if (node.style.animationFillMode === "forwards") {
57857
- node.style.animationFillMode = currentFillMode;
57858
- }
57859
- });
57860
- }
57861
- }
57862
- };
57863
- const handleAnimationStart = (event) => {
57864
- if (event.target === node) {
57865
- prevAnimationNameRef.current = getAnimationName$2(stylesRef.current);
57866
- }
57867
- };
57868
- node.addEventListener("animationstart", handleAnimationStart);
57869
- node.addEventListener("animationcancel", handleAnimationEnd);
57870
- node.addEventListener("animationend", handleAnimationEnd);
57871
- return () => {
57872
- ownerWindow.clearTimeout(timeoutId);
57873
- node.removeEventListener("animationstart", handleAnimationStart);
57874
- node.removeEventListener("animationcancel", handleAnimationEnd);
57875
- node.removeEventListener("animationend", handleAnimationEnd);
57876
- };
57877
- } else {
57878
- send("ANIMATION_END");
57879
- }
57880
- }, [node, send]);
57881
- return {
57882
- isPresent: ["mounted", "unmountSuspended"].includes(state),
57883
- ref: React.useCallback((node2) => {
57884
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
57885
- setNode(node2);
57886
- }, [])
57887
- };
57888
- }
57889
- function getAnimationName$2(styles) {
57890
- return styles?.animationName || "none";
57891
- }
57892
- function getElementRef$3(element) {
57893
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
57894
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
57895
- if (mayWarn) {
57896
- return element.ref;
57897
- }
57898
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
57899
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
57900
- if (mayWarn) {
57901
- return element.props.ref;
57902
- }
57903
- return element.props.ref || element.ref;
57904
- }
57905
-
57906
- var CHECKBOX_NAME = "Checkbox";
57907
- var [createCheckboxContext, createCheckboxScope] = createContextScope$1(CHECKBOX_NAME);
57908
- var [CheckboxProvider, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
57909
- var Checkbox$1 = React.forwardRef(
57781
+ var SWITCH_NAME = "Switch";
57782
+ var [createSwitchContext, createSwitchScope] = createContextScope$1(SWITCH_NAME);
57783
+ var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
57784
+ var Switch$1 = React.forwardRef(
57910
57785
  (props, forwardedRef) => {
57911
57786
  const {
57912
- __scopeCheckbox,
57787
+ __scopeSwitch,
57913
57788
  name,
57914
57789
  checked: checkedProp,
57915
57790
  defaultChecked,
@@ -57918,7 +57793,7 @@ var Checkbox$1 = React.forwardRef(
57918
57793
  value = "on",
57919
57794
  onCheckedChange,
57920
57795
  form,
57921
- ...checkboxProps
57796
+ ...switchProps
57922
57797
  } = props;
57923
57798
  const [button, setButton] = React.useState(null);
57924
57799
  const composedRefs = useComposedRefs$1(forwardedRef, (node) => setButton(node));
@@ -57928,36 +57803,24 @@ var Checkbox$1 = React.forwardRef(
57928
57803
  prop: checkedProp,
57929
57804
  defaultProp: defaultChecked ?? false,
57930
57805
  onChange: onCheckedChange,
57931
- caller: CHECKBOX_NAME
57806
+ caller: SWITCH_NAME
57932
57807
  });
57933
- const initialCheckedStateRef = React.useRef(checked);
57934
- React.useEffect(() => {
57935
- const form2 = button?.form;
57936
- if (form2) {
57937
- const reset = () => setChecked(initialCheckedStateRef.current);
57938
- form2.addEventListener("reset", reset);
57939
- return () => form2.removeEventListener("reset", reset);
57940
- }
57941
- }, [button, setChecked]);
57942
- return /* @__PURE__ */ jsxs(CheckboxProvider, { scope: __scopeCheckbox, state: checked, disabled, children: [
57808
+ return /* @__PURE__ */ jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
57943
57809
  /* @__PURE__ */ jsx(
57944
- Primitive$2.button,
57810
+ Primitive$3.button,
57945
57811
  {
57946
57812
  type: "button",
57947
- role: "checkbox",
57948
- "aria-checked": isIndeterminate$1(checked) ? "mixed" : checked,
57813
+ role: "switch",
57814
+ "aria-checked": checked,
57949
57815
  "aria-required": required,
57950
57816
  "data-state": getState$3(checked),
57951
57817
  "data-disabled": disabled ? "" : void 0,
57952
57818
  disabled,
57953
57819
  value,
57954
- ...checkboxProps,
57820
+ ...switchProps,
57955
57821
  ref: composedRefs,
57956
- onKeyDown: composeEventHandlers$2(props.onKeyDown, (event) => {
57957
- if (event.key === "Enter") event.preventDefault();
57958
- }),
57959
- onClick: composeEventHandlers$2(props.onClick, (event) => {
57960
- setChecked((prevChecked) => isIndeterminate$1(prevChecked) ? true : !prevChecked);
57822
+ onClick: composeEventHandlers$1(props.onClick, (event) => {
57823
+ setChecked((prevChecked) => !prevChecked);
57961
57824
  if (isFormControl) {
57962
57825
  hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
57963
57826
  if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
@@ -57966,7 +57829,7 @@ var Checkbox$1 = React.forwardRef(
57966
57829
  }
57967
57830
  ),
57968
57831
  isFormControl && /* @__PURE__ */ jsx(
57969
- CheckboxBubbleInput,
57832
+ SwitchBubbleInput,
57970
57833
  {
57971
57834
  control: button,
57972
57835
  bubbles: !hasConsumerStoppedPropagationRef.current,
@@ -57976,40 +57839,37 @@ var Checkbox$1 = React.forwardRef(
57976
57839
  required,
57977
57840
  disabled,
57978
57841
  form,
57979
- style: { transform: "translateX(-100%)" },
57980
- defaultChecked: isIndeterminate$1(defaultChecked) ? false : defaultChecked
57842
+ style: { transform: "translateX(-100%)" }
57981
57843
  }
57982
57844
  )
57983
57845
  ] });
57984
57846
  }
57985
57847
  );
57986
- Checkbox$1.displayName = CHECKBOX_NAME;
57987
- var INDICATOR_NAME$3 = "CheckboxIndicator";
57988
- var CheckboxIndicator = React.forwardRef(
57848
+ Switch$1.displayName = SWITCH_NAME;
57849
+ var THUMB_NAME = "SwitchThumb";
57850
+ var SwitchThumb = React.forwardRef(
57989
57851
  (props, forwardedRef) => {
57990
- const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
57991
- const context = useCheckboxContext(INDICATOR_NAME$3, __scopeCheckbox);
57992
- return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || isIndeterminate$1(context.state) || context.state === true, children: /* @__PURE__ */ jsx(
57993
- Primitive$2.span,
57852
+ const { __scopeSwitch, ...thumbProps } = props;
57853
+ const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
57854
+ return /* @__PURE__ */ jsx(
57855
+ Primitive$3.span,
57994
57856
  {
57995
- "data-state": getState$3(context.state),
57857
+ "data-state": getState$3(context.checked),
57996
57858
  "data-disabled": context.disabled ? "" : void 0,
57997
- ...indicatorProps,
57998
- ref: forwardedRef,
57999
- style: { pointerEvents: "none", ...props.style }
57859
+ ...thumbProps,
57860
+ ref: forwardedRef
58000
57861
  }
58001
- ) });
57862
+ );
58002
57863
  }
58003
57864
  );
58004
- CheckboxIndicator.displayName = INDICATOR_NAME$3;
58005
- var BUBBLE_INPUT_NAME$1 = "CheckboxBubbleInput";
58006
- var CheckboxBubbleInput = React.forwardRef(
57865
+ SwitchThumb.displayName = THUMB_NAME;
57866
+ var BUBBLE_INPUT_NAME$1 = "SwitchBubbleInput";
57867
+ var SwitchBubbleInput = React.forwardRef(
58007
57868
  ({
58008
- __scopeCheckbox,
57869
+ __scopeSwitch,
58009
57870
  control,
58010
57871
  checked,
58011
57872
  bubbles = true,
58012
- defaultChecked,
58013
57873
  ...props
58014
57874
  }, forwardedRef) => {
58015
57875
  const ref = React.useRef(null);
@@ -58027,18 +57887,16 @@ var CheckboxBubbleInput = React.forwardRef(
58027
57887
  const setChecked = descriptor.set;
58028
57888
  if (prevChecked !== checked && setChecked) {
58029
57889
  const event = new Event("click", { bubbles });
58030
- input.indeterminate = isIndeterminate$1(checked);
58031
- setChecked.call(input, isIndeterminate$1(checked) ? false : checked);
57890
+ setChecked.call(input, checked);
58032
57891
  input.dispatchEvent(event);
58033
57892
  }
58034
57893
  }, [prevChecked, checked, bubbles]);
58035
- const defaultCheckedRef = React.useRef(isIndeterminate$1(checked) ? false : checked);
58036
57894
  return /* @__PURE__ */ jsx(
58037
- Primitive$2.input,
57895
+ "input",
58038
57896
  {
58039
57897
  type: "checkbox",
58040
57898
  "aria-hidden": true,
58041
- defaultChecked: defaultChecked ?? defaultCheckedRef.current,
57899
+ defaultChecked: checked,
58042
57900
  ...props,
58043
57901
  tabIndex: -1,
58044
57902
  ref: composedRefs,
@@ -58054,18 +57912,15 @@ var CheckboxBubbleInput = React.forwardRef(
58054
57912
  );
58055
57913
  }
58056
57914
  );
58057
- CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
58058
- function isIndeterminate$1(checked) {
58059
- return checked === "indeterminate";
58060
- }
57915
+ SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
58061
57916
  function getState$3(checked) {
58062
- return isIndeterminate$1(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
57917
+ return checked ? "checked" : "unchecked";
58063
57918
  }
58064
- var Root$a = Checkbox$1;
58065
- var Indicator$2 = CheckboxIndicator;
57919
+ var Root$a = Switch$1;
57920
+ var Thumb = SwitchThumb;
58066
57921
 
58067
- const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$a, { ref: ref, className: cn("peer border-primary focus-visible:ring-ring h-4 w-4 shrink-0 rounded-sm border shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=checked]:text-white", className), ...props, children: jsx(Indicator$2, { className: cn("flex items-center justify-center text-current"), children: jsx(Check, { className: "h-4 w-4" }) }) })));
58068
- Checkbox.displayName = Root$a.displayName;
57922
+ const Switch = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$a, { className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: jsx(Thumb, { className: cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") }) })));
57923
+ Switch.displayName = Root$a.displayName;
58069
57924
 
58070
57925
  const __storeToDerived = /* @__PURE__ */ new WeakMap();
58071
57926
  const __derivedToStore = /* @__PURE__ */ new WeakMap();
@@ -63171,6 +63026,131 @@ var Portal$3 = React.forwardRef((props, forwardedRef) => {
63171
63026
  });
63172
63027
  Portal$3.displayName = PORTAL_NAME$5;
63173
63028
 
63029
+ function useStateMachine$2(initialState, machine) {
63030
+ return React.useReducer((state, event) => {
63031
+ const nextState = machine[state][event];
63032
+ return nextState ?? state;
63033
+ }, initialState);
63034
+ }
63035
+
63036
+ // src/presence.tsx
63037
+ var Presence$2 = (props) => {
63038
+ const { present, children } = props;
63039
+ const presence = usePresence$2(present);
63040
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
63041
+ const ref = useComposedRefs$1(presence.ref, getElementRef$3(child));
63042
+ const forceMount = typeof children === "function";
63043
+ return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
63044
+ };
63045
+ Presence$2.displayName = "Presence";
63046
+ function usePresence$2(present) {
63047
+ const [node, setNode] = React.useState();
63048
+ const stylesRef = React.useRef(null);
63049
+ const prevPresentRef = React.useRef(present);
63050
+ const prevAnimationNameRef = React.useRef("none");
63051
+ const initialState = present ? "mounted" : "unmounted";
63052
+ const [state, send] = useStateMachine$2(initialState, {
63053
+ mounted: {
63054
+ UNMOUNT: "unmounted",
63055
+ ANIMATION_OUT: "unmountSuspended"
63056
+ },
63057
+ unmountSuspended: {
63058
+ MOUNT: "mounted",
63059
+ ANIMATION_END: "unmounted"
63060
+ },
63061
+ unmounted: {
63062
+ MOUNT: "mounted"
63063
+ }
63064
+ });
63065
+ React.useEffect(() => {
63066
+ const currentAnimationName = getAnimationName$2(stylesRef.current);
63067
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
63068
+ }, [state]);
63069
+ useLayoutEffect2$1(() => {
63070
+ const styles = stylesRef.current;
63071
+ const wasPresent = prevPresentRef.current;
63072
+ const hasPresentChanged = wasPresent !== present;
63073
+ if (hasPresentChanged) {
63074
+ const prevAnimationName = prevAnimationNameRef.current;
63075
+ const currentAnimationName = getAnimationName$2(styles);
63076
+ if (present) {
63077
+ send("MOUNT");
63078
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
63079
+ send("UNMOUNT");
63080
+ } else {
63081
+ const isAnimating = prevAnimationName !== currentAnimationName;
63082
+ if (wasPresent && isAnimating) {
63083
+ send("ANIMATION_OUT");
63084
+ } else {
63085
+ send("UNMOUNT");
63086
+ }
63087
+ }
63088
+ prevPresentRef.current = present;
63089
+ }
63090
+ }, [present, send]);
63091
+ useLayoutEffect2$1(() => {
63092
+ if (node) {
63093
+ let timeoutId;
63094
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
63095
+ const handleAnimationEnd = (event) => {
63096
+ const currentAnimationName = getAnimationName$2(stylesRef.current);
63097
+ const isCurrentAnimation = currentAnimationName.includes(event.animationName);
63098
+ if (event.target === node && isCurrentAnimation) {
63099
+ send("ANIMATION_END");
63100
+ if (!prevPresentRef.current) {
63101
+ const currentFillMode = node.style.animationFillMode;
63102
+ node.style.animationFillMode = "forwards";
63103
+ timeoutId = ownerWindow.setTimeout(() => {
63104
+ if (node.style.animationFillMode === "forwards") {
63105
+ node.style.animationFillMode = currentFillMode;
63106
+ }
63107
+ });
63108
+ }
63109
+ }
63110
+ };
63111
+ const handleAnimationStart = (event) => {
63112
+ if (event.target === node) {
63113
+ prevAnimationNameRef.current = getAnimationName$2(stylesRef.current);
63114
+ }
63115
+ };
63116
+ node.addEventListener("animationstart", handleAnimationStart);
63117
+ node.addEventListener("animationcancel", handleAnimationEnd);
63118
+ node.addEventListener("animationend", handleAnimationEnd);
63119
+ return () => {
63120
+ ownerWindow.clearTimeout(timeoutId);
63121
+ node.removeEventListener("animationstart", handleAnimationStart);
63122
+ node.removeEventListener("animationcancel", handleAnimationEnd);
63123
+ node.removeEventListener("animationend", handleAnimationEnd);
63124
+ };
63125
+ } else {
63126
+ send("ANIMATION_END");
63127
+ }
63128
+ }, [node, send]);
63129
+ return {
63130
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
63131
+ ref: React.useCallback((node2) => {
63132
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
63133
+ setNode(node2);
63134
+ }, [])
63135
+ };
63136
+ }
63137
+ function getAnimationName$2(styles) {
63138
+ return styles?.animationName || "none";
63139
+ }
63140
+ function getElementRef$3(element) {
63141
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
63142
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
63143
+ if (mayWarn) {
63144
+ return element.ref;
63145
+ }
63146
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
63147
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
63148
+ if (mayWarn) {
63149
+ return element.props.ref;
63150
+ }
63151
+ return element.props.ref || element.ref;
63152
+ }
63153
+
63174
63154
  // src/visually-hidden.tsx
63175
63155
  var VISUALLY_HIDDEN_STYLES = Object.freeze({
63176
63156
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
@@ -63689,150 +63669,6 @@ function TooltipContent({ className, sideOffset = 0, children, ...props }) {
63689
63669
  return (jsx(Portal$2, { children: jsxs(Content2$4, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", className), ...props, children: [children, jsx(Arrow2$1, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })] }) }));
63690
63670
  }
63691
63671
 
63692
- var SWITCH_NAME = "Switch";
63693
- var [createSwitchContext, createSwitchScope] = createContextScope$1(SWITCH_NAME);
63694
- var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
63695
- var Switch$1 = React.forwardRef(
63696
- (props, forwardedRef) => {
63697
- const {
63698
- __scopeSwitch,
63699
- name,
63700
- checked: checkedProp,
63701
- defaultChecked,
63702
- required,
63703
- disabled,
63704
- value = "on",
63705
- onCheckedChange,
63706
- form,
63707
- ...switchProps
63708
- } = props;
63709
- const [button, setButton] = React.useState(null);
63710
- const composedRefs = useComposedRefs$1(forwardedRef, (node) => setButton(node));
63711
- const hasConsumerStoppedPropagationRef = React.useRef(false);
63712
- const isFormControl = button ? form || !!button.closest("form") : true;
63713
- const [checked, setChecked] = useControllableState$1({
63714
- prop: checkedProp,
63715
- defaultProp: defaultChecked ?? false,
63716
- onChange: onCheckedChange,
63717
- caller: SWITCH_NAME
63718
- });
63719
- return /* @__PURE__ */ jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
63720
- /* @__PURE__ */ jsx(
63721
- Primitive$3.button,
63722
- {
63723
- type: "button",
63724
- role: "switch",
63725
- "aria-checked": checked,
63726
- "aria-required": required,
63727
- "data-state": getState$2(checked),
63728
- "data-disabled": disabled ? "" : void 0,
63729
- disabled,
63730
- value,
63731
- ...switchProps,
63732
- ref: composedRefs,
63733
- onClick: composeEventHandlers$1(props.onClick, (event) => {
63734
- setChecked((prevChecked) => !prevChecked);
63735
- if (isFormControl) {
63736
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
63737
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
63738
- }
63739
- })
63740
- }
63741
- ),
63742
- isFormControl && /* @__PURE__ */ jsx(
63743
- SwitchBubbleInput,
63744
- {
63745
- control: button,
63746
- bubbles: !hasConsumerStoppedPropagationRef.current,
63747
- name,
63748
- value,
63749
- checked,
63750
- required,
63751
- disabled,
63752
- form,
63753
- style: { transform: "translateX(-100%)" }
63754
- }
63755
- )
63756
- ] });
63757
- }
63758
- );
63759
- Switch$1.displayName = SWITCH_NAME;
63760
- var THUMB_NAME = "SwitchThumb";
63761
- var SwitchThumb = React.forwardRef(
63762
- (props, forwardedRef) => {
63763
- const { __scopeSwitch, ...thumbProps } = props;
63764
- const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
63765
- return /* @__PURE__ */ jsx(
63766
- Primitive$3.span,
63767
- {
63768
- "data-state": getState$2(context.checked),
63769
- "data-disabled": context.disabled ? "" : void 0,
63770
- ...thumbProps,
63771
- ref: forwardedRef
63772
- }
63773
- );
63774
- }
63775
- );
63776
- SwitchThumb.displayName = THUMB_NAME;
63777
- var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
63778
- var SwitchBubbleInput = React.forwardRef(
63779
- ({
63780
- __scopeSwitch,
63781
- control,
63782
- checked,
63783
- bubbles = true,
63784
- ...props
63785
- }, forwardedRef) => {
63786
- const ref = React.useRef(null);
63787
- const composedRefs = useComposedRefs$1(ref, forwardedRef);
63788
- const prevChecked = usePrevious$1(checked);
63789
- const controlSize = useSize$1(control);
63790
- React.useEffect(() => {
63791
- const input = ref.current;
63792
- if (!input) return;
63793
- const inputProto = window.HTMLInputElement.prototype;
63794
- const descriptor = Object.getOwnPropertyDescriptor(
63795
- inputProto,
63796
- "checked"
63797
- );
63798
- const setChecked = descriptor.set;
63799
- if (prevChecked !== checked && setChecked) {
63800
- const event = new Event("click", { bubbles });
63801
- setChecked.call(input, checked);
63802
- input.dispatchEvent(event);
63803
- }
63804
- }, [prevChecked, checked, bubbles]);
63805
- return /* @__PURE__ */ jsx(
63806
- "input",
63807
- {
63808
- type: "checkbox",
63809
- "aria-hidden": true,
63810
- defaultChecked: checked,
63811
- ...props,
63812
- tabIndex: -1,
63813
- ref: composedRefs,
63814
- style: {
63815
- ...props.style,
63816
- ...controlSize,
63817
- position: "absolute",
63818
- pointerEvents: "none",
63819
- opacity: 0,
63820
- margin: 0
63821
- }
63822
- }
63823
- );
63824
- }
63825
- );
63826
- SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
63827
- function getState$2(checked) {
63828
- return checked ? "checked" : "unchecked";
63829
- }
63830
- var Root$7 = Switch$1;
63831
- var Thumb = SwitchThumb;
63832
-
63833
- const Switch = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$7, { className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: jsx(Thumb, { className: cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") }) })));
63834
- Switch.displayName = Root$7.displayName;
63835
-
63836
63672
  // packages/react/context/src/createContext.tsx
63837
63673
  function createContextScope(scopeName, createContextScopeDeps = []) {
63838
63674
  let defaultContexts = [];
@@ -64076,11 +63912,11 @@ var Progress$1 = React.forwardRef(
64076
63912
  }
64077
63913
  );
64078
63914
  Progress$1.displayName = PROGRESS_NAME;
64079
- var INDICATOR_NAME$2 = "ProgressIndicator";
63915
+ var INDICATOR_NAME$3 = "ProgressIndicator";
64080
63916
  var ProgressIndicator = React.forwardRef(
64081
63917
  (props, forwardedRef) => {
64082
63918
  const { __scopeProgress, ...indicatorProps } = props;
64083
- const context = useProgressContext(INDICATOR_NAME$2, __scopeProgress);
63919
+ const context = useProgressContext(INDICATOR_NAME$3, __scopeProgress);
64084
63920
  return /* @__PURE__ */ jsx(
64085
63921
  Primitive$1.div,
64086
63922
  {
@@ -64093,7 +63929,7 @@ var ProgressIndicator = React.forwardRef(
64093
63929
  );
64094
63930
  }
64095
63931
  );
64096
- ProgressIndicator.displayName = INDICATOR_NAME$2;
63932
+ ProgressIndicator.displayName = INDICATOR_NAME$3;
64097
63933
  function defaultGetValueLabel(value, max) {
64098
63934
  return `${Math.round(value / max * 100)}%`;
64099
63935
  }
@@ -64120,11 +63956,11 @@ function getInvalidValueError(propValue, componentName) {
64120
63956
 
64121
63957
  Defaulting to \`null\`.`;
64122
63958
  }
64123
- var Root$6 = Progress$1;
64124
- var Indicator$1 = ProgressIndicator;
63959
+ var Root$7 = Progress$1;
63960
+ var Indicator$2 = ProgressIndicator;
64125
63961
 
64126
- const Progress = React.forwardRef(({ className, value, ...props }, ref) => (jsx(Root$6, { ref: ref, className: cn('bg-secondary relative h-4 w-full overflow-hidden rounded-full', className), ...props, children: jsx(Indicator$1, { className: "bg-primary h-full w-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
64127
- Progress.displayName = Root$6.displayName;
63962
+ const Progress = React.forwardRef(({ className, value, ...props }, ref) => (jsx(Root$7, { ref: ref, className: cn('bg-secondary relative h-4 w-full overflow-hidden rounded-full', className), ...props, children: jsx(Indicator$2, { className: "bg-primary h-full w-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
63963
+ Progress.displayName = Root$7.displayName;
64128
63964
 
64129
63965
  var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
64130
63966
  // @__NO_SIDE_EFFECTS__
@@ -64996,11 +64832,11 @@ var Label$3 = React.forwardRef((props, forwardedRef) => {
64996
64832
  );
64997
64833
  });
64998
64834
  Label$3.displayName = NAME$2;
64999
- var Root$5 = Label$3;
64835
+ var Root$6 = Label$3;
65000
64836
 
65001
64837
  const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
65002
- const Label$2 = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$5, { ref: ref, className: cn(labelVariants(), className), ...props })));
65003
- Label$2.displayName = Root$5.displayName;
64838
+ const Label$2 = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$6, { ref: ref, className: cn(labelVariants(), className), ...props })));
64839
+ Label$2.displayName = Root$6.displayName;
65004
64840
 
65005
64841
  var dayjs_min = {exports: {}};
65006
64842
 
@@ -88202,10 +88038,10 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
88202
88038
  })] }), (customization.showLeaderboardDisplayCheckbox ||
88203
88039
  customization.showMentorAIDisplayCheckbox) && (jsxs("div", { className: "grid grid-cols-2 gap-6 pt-4", children: [customization.showMentorAIDisplayCheckbox && (jsx("div", { className: "space-y-2", children: jsxs("div", { className: "flex items-center space-x-2", children: [basicForm.Field({
88204
88040
  name: 'displayMentor',
88205
- children: (field) => (jsx(Checkbox, { onCheckedChange: (checked) => field.handleChange(checked), checked: field.state.value, disabled: basicForm.state.isSubmitting || isUserMetadataLoading, id: "display-mentor" })),
88206
- }), jsx("label", { htmlFor: "display-mentor", className: "text-sm leading-none font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Display Mentor AI" })] }) })), customization.showLeaderboardDisplayCheckbox && (jsx("div", { className: "space-y-2", children: jsxs("div", { className: "flex items-center space-x-2", children: [basicForm.Field({
88041
+ children: (field) => (jsx(Switch, { className: "data-[state=checked]:bg-blue-600", onCheckedChange: (checked) => field.handleChange(checked), checked: field.state.value, disabled: basicForm.state.isSubmitting || isUserMetadataLoading, id: "display-mentor" })),
88042
+ }), jsx("label", { htmlFor: "display-mentor", className: "text-sm leading-none font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Display Agent Sidebar" })] }) })), customization.showLeaderboardDisplayCheckbox && (jsx("div", { className: "space-y-2", children: jsxs("div", { className: "flex items-center space-x-2", children: [basicForm.Field({
88207
88043
  name: 'displayLeaderBoard',
88208
- children: (field) => (jsx(Checkbox, { onCheckedChange: (checked) => field.handleChange(checked), checked: field.state.value, disabled: basicForm.state.isSubmitting || isUserMetadataLoading, id: "display-leaderboard" })),
88044
+ children: (field) => (jsx(Switch, { className: "data-[state=checked]:bg-blue-600", onCheckedChange: (checked) => field.handleChange(checked), checked: field.state.value, disabled: basicForm.state.isSubmitting || isUserMetadataLoading, id: "display-leaderboard" })),
88209
88045
  }), jsx("label", { htmlFor: "display-leaderboard", className: "text-sm leading-none font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Display Leaderboard" })] }) }))] }))] }) })), activeTab === 'social' && (jsx("div", { className: "max-w-2xl space-y-6", children: jsxs("form", { className: "space-y-6", onSubmit: (formEvent) => {
88210
88046
  formEvent.preventDefault();
88211
88047
  formEvent.stopPropagation();
@@ -88460,7 +88296,7 @@ function focusFirst$2(candidates, preventScroll = false) {
88460
88296
  function wrapArray$2(array, startIndex) {
88461
88297
  return array.map((_, index) => array[(startIndex + index) % array.length]);
88462
88298
  }
88463
- var Root$4 = RovingFocusGroup$1;
88299
+ var Root$5 = RovingFocusGroup$1;
88464
88300
  var Item$2 = RovingFocusGroupItem$1;
88465
88301
 
88466
88302
  function useStateMachine$1(initialState, machine) {
@@ -88643,7 +88479,7 @@ var TabsList$1 = React.forwardRef(
88643
88479
  const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
88644
88480
  const rovingFocusGroupScope = useRovingFocusGroupScope$2(__scopeTabs);
88645
88481
  return /* @__PURE__ */ jsx(
88646
- Root$4,
88482
+ Root$5,
88647
88483
  {
88648
88484
  asChild: true,
88649
88485
  ...rovingFocusGroupScope,
@@ -89097,6 +88933,170 @@ function UsersTab$1({ tenant, currentPage, itemsPerPage, onInviteSuccess }) {
89097
88933
  jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-12 text-center", children: jsxs("div", { className: "flex flex-col items-center justify-center text-gray-500", children: [jsx(Mail, { className: "h-12 w-12 mb-3 text-gray-300", "aria-hidden": "true" }), jsx("p", { className: "text-sm font-medium", children: "No invitations yet" }), jsx("p", { className: "text-xs mt-1", children: "Start by inviting users above or uploading a CSV file" })] }) }) })) : (currentUsers.map((user) => (jsxs("tr", { className: "hover:bg-gray-50 transition-colors duration-150", children: [jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: jsxs("div", { className: "flex items-center truncate max-w-[200px] sm:max-w-full", children: [jsx("div", { className: "flex-shrink-0 h-8 w-8", children: jsx("div", { className: "h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center", children: jsx(Mail, { className: "h-4 w-4 text-blue-600", "aria-hidden": "true" }) }) }), jsx("div", { className: "ml-3", children: jsx("div", { className: "text-sm font-medium text-gray-900", children: user.email || 'No email' }) })] }) }), jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: jsxs("span", { className: `inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${getStatusColor(user.active, user.expired)}`, children: [user.active && !user.expired && (jsx(Clock, { className: "h-3 w-3 mr-1 text-blue-500", "aria-hidden": "true" })), !user.active && !user.expired && (jsx(CircleCheck, { className: "h-3 w-3 mr-1 text-green-700", "aria-hidden": "true" })), user.expired && (jsx(CircleX, { className: "h-3 w-3 mr-1 text-gray-500", "aria-hidden": "true" })), getStatusText(user.active, user.expired)] }) })] }, user.id)))) })] }) }) }) }) }), isCSVEditorOpen && (jsx(CSVEditor, { csvData: parsedCSVData, onSave: handleCSVEditorSave, onCancel: handleCSVEditorCancel }))] }));
89098
88934
  }
89099
88935
 
88936
+ var CHECKBOX_NAME = "Checkbox";
88937
+ var [createCheckboxContext, createCheckboxScope] = createContextScope$1(CHECKBOX_NAME);
88938
+ var [CheckboxProvider, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
88939
+ var Checkbox$1 = React.forwardRef(
88940
+ (props, forwardedRef) => {
88941
+ const {
88942
+ __scopeCheckbox,
88943
+ name,
88944
+ checked: checkedProp,
88945
+ defaultChecked,
88946
+ required,
88947
+ disabled,
88948
+ value = "on",
88949
+ onCheckedChange,
88950
+ form,
88951
+ ...checkboxProps
88952
+ } = props;
88953
+ const [button, setButton] = React.useState(null);
88954
+ const composedRefs = useComposedRefs$1(forwardedRef, (node) => setButton(node));
88955
+ const hasConsumerStoppedPropagationRef = React.useRef(false);
88956
+ const isFormControl = button ? form || !!button.closest("form") : true;
88957
+ const [checked, setChecked] = useControllableState$1({
88958
+ prop: checkedProp,
88959
+ defaultProp: defaultChecked ?? false,
88960
+ onChange: onCheckedChange,
88961
+ caller: CHECKBOX_NAME
88962
+ });
88963
+ const initialCheckedStateRef = React.useRef(checked);
88964
+ React.useEffect(() => {
88965
+ const form2 = button?.form;
88966
+ if (form2) {
88967
+ const reset = () => setChecked(initialCheckedStateRef.current);
88968
+ form2.addEventListener("reset", reset);
88969
+ return () => form2.removeEventListener("reset", reset);
88970
+ }
88971
+ }, [button, setChecked]);
88972
+ return /* @__PURE__ */ jsxs(CheckboxProvider, { scope: __scopeCheckbox, state: checked, disabled, children: [
88973
+ /* @__PURE__ */ jsx(
88974
+ Primitive$2.button,
88975
+ {
88976
+ type: "button",
88977
+ role: "checkbox",
88978
+ "aria-checked": isIndeterminate$1(checked) ? "mixed" : checked,
88979
+ "aria-required": required,
88980
+ "data-state": getState$2(checked),
88981
+ "data-disabled": disabled ? "" : void 0,
88982
+ disabled,
88983
+ value,
88984
+ ...checkboxProps,
88985
+ ref: composedRefs,
88986
+ onKeyDown: composeEventHandlers$2(props.onKeyDown, (event) => {
88987
+ if (event.key === "Enter") event.preventDefault();
88988
+ }),
88989
+ onClick: composeEventHandlers$2(props.onClick, (event) => {
88990
+ setChecked((prevChecked) => isIndeterminate$1(prevChecked) ? true : !prevChecked);
88991
+ if (isFormControl) {
88992
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
88993
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
88994
+ }
88995
+ })
88996
+ }
88997
+ ),
88998
+ isFormControl && /* @__PURE__ */ jsx(
88999
+ CheckboxBubbleInput,
89000
+ {
89001
+ control: button,
89002
+ bubbles: !hasConsumerStoppedPropagationRef.current,
89003
+ name,
89004
+ value,
89005
+ checked,
89006
+ required,
89007
+ disabled,
89008
+ form,
89009
+ style: { transform: "translateX(-100%)" },
89010
+ defaultChecked: isIndeterminate$1(defaultChecked) ? false : defaultChecked
89011
+ }
89012
+ )
89013
+ ] });
89014
+ }
89015
+ );
89016
+ Checkbox$1.displayName = CHECKBOX_NAME;
89017
+ var INDICATOR_NAME$2 = "CheckboxIndicator";
89018
+ var CheckboxIndicator = React.forwardRef(
89019
+ (props, forwardedRef) => {
89020
+ const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
89021
+ const context = useCheckboxContext(INDICATOR_NAME$2, __scopeCheckbox);
89022
+ return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || isIndeterminate$1(context.state) || context.state === true, children: /* @__PURE__ */ jsx(
89023
+ Primitive$2.span,
89024
+ {
89025
+ "data-state": getState$2(context.state),
89026
+ "data-disabled": context.disabled ? "" : void 0,
89027
+ ...indicatorProps,
89028
+ ref: forwardedRef,
89029
+ style: { pointerEvents: "none", ...props.style }
89030
+ }
89031
+ ) });
89032
+ }
89033
+ );
89034
+ CheckboxIndicator.displayName = INDICATOR_NAME$2;
89035
+ var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
89036
+ var CheckboxBubbleInput = React.forwardRef(
89037
+ ({
89038
+ __scopeCheckbox,
89039
+ control,
89040
+ checked,
89041
+ bubbles = true,
89042
+ defaultChecked,
89043
+ ...props
89044
+ }, forwardedRef) => {
89045
+ const ref = React.useRef(null);
89046
+ const composedRefs = useComposedRefs$1(ref, forwardedRef);
89047
+ const prevChecked = usePrevious$1(checked);
89048
+ const controlSize = useSize$1(control);
89049
+ React.useEffect(() => {
89050
+ const input = ref.current;
89051
+ if (!input) return;
89052
+ const inputProto = window.HTMLInputElement.prototype;
89053
+ const descriptor = Object.getOwnPropertyDescriptor(
89054
+ inputProto,
89055
+ "checked"
89056
+ );
89057
+ const setChecked = descriptor.set;
89058
+ if (prevChecked !== checked && setChecked) {
89059
+ const event = new Event("click", { bubbles });
89060
+ input.indeterminate = isIndeterminate$1(checked);
89061
+ setChecked.call(input, isIndeterminate$1(checked) ? false : checked);
89062
+ input.dispatchEvent(event);
89063
+ }
89064
+ }, [prevChecked, checked, bubbles]);
89065
+ const defaultCheckedRef = React.useRef(isIndeterminate$1(checked) ? false : checked);
89066
+ return /* @__PURE__ */ jsx(
89067
+ Primitive$2.input,
89068
+ {
89069
+ type: "checkbox",
89070
+ "aria-hidden": true,
89071
+ defaultChecked: defaultChecked ?? defaultCheckedRef.current,
89072
+ ...props,
89073
+ tabIndex: -1,
89074
+ ref: composedRefs,
89075
+ style: {
89076
+ ...props.style,
89077
+ ...controlSize,
89078
+ position: "absolute",
89079
+ pointerEvents: "none",
89080
+ opacity: 0,
89081
+ margin: 0
89082
+ }
89083
+ }
89084
+ );
89085
+ }
89086
+ );
89087
+ CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
89088
+ function isIndeterminate$1(checked) {
89089
+ return checked === "indeterminate";
89090
+ }
89091
+ function getState$2(checked) {
89092
+ return isIndeterminate$1(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
89093
+ }
89094
+ var Root$4 = Checkbox$1;
89095
+ var Indicator$1 = CheckboxIndicator;
89096
+
89097
+ const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$4, { ref: ref, className: cn("peer border-primary focus-visible:ring-ring h-4 w-4 shrink-0 rounded-sm border shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=checked]:text-white", className), ...props, children: jsx(Indicator$1, { className: cn("flex items-center justify-center text-current"), children: jsx(Check, { className: "h-4 w-4" }) }) })));
89098
+ Checkbox.displayName = Root$4.displayName;
89099
+
89100
89100
  function CoursesTab({ tenant, currentPage, itemsPerPage, hasManageUsersPermission = false, }) {
89101
89101
  var _a;
89102
89102
  const [inviteSent, setInviteSent] = useState(false);
@@ -127570,7 +127570,7 @@ var MenuContentImpl = React.forwardRef(
127570
127570
  onInteractOutside,
127571
127571
  onDismiss,
127572
127572
  children: /* @__PURE__ */ jsx(
127573
- Root$4,
127573
+ Root$5,
127574
127574
  {
127575
127575
  asChild: true,
127576
127576
  ...rovingFocusGroupScope,
@@ -157681,6 +157681,10 @@ const EmptyStats = ({ title = 'No data available' }) => {
157681
157681
  return (jsx("div", { className: "flex justify-center items-center h-full", children: jsx("p", { className: "text-gray-500 text-sm", children: title }) }));
157682
157682
  };
157683
157683
 
157684
+ const ChartLoading = ({ title = 'Loading...' }) => {
157685
+ return (jsx("div", { className: "flex justify-center items-center h-full", children: jsx("p", { className: "text-gray-500 text-sm", children: title }) }));
157686
+ };
157687
+
157684
157688
  // Utility function to format date to YYYY-MM-DD
157685
157689
  const formatDateToYYYYMMDD$6 = (date) => {
157686
157690
  if (!date)
@@ -157791,8 +157795,8 @@ const formatDateToShortFormat$2 = (dateString, isToday = false) => {
157791
157795
  function AnalyticsOverview({ tenantKey, mentorId, selectedMentorId, usergroupIds, }) {
157792
157796
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
157793
157797
  const currentMentorId = selectedMentorId || mentorId;
157794
- const { messageStat, topicStat, conversationStat, sessionStats, isLoadingAllStats, isLoadingUsersStats, setSessionStatsDateFilter, usersStats, sessionStatsDateFilter, topicsDetailsStats, setTopicsDetailsStatsDateFilter, topicsDetailsStatsDateFilter, activeUsersStats, setUsersStatsDateFilter, usersStatsDateFilter, } = useOverview({ tenantKey, mentorId: currentMentorId, usergroupIds });
157795
- return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoadingAllStats, title: "Messages", value: messageStat.stat, percentage: messageStat.percentage }), jsx(StatCard, { loading: isLoadingUsersStats, title: "Active Users", value: (usersStats === null || usersStats === void 0 ? void 0 : usersStats.count) || 0, percentage: (usersStats === null || usersStats === void 0 ? void 0 : usersStats.percentage_change) || 0 }), jsx(StatCard, { loading: isLoadingAllStats, title: "Topics", value: topicStat.stat, percentage: topicStat.percentage }), jsx(StatCard, { loading: isLoadingAllStats, title: "Conversations", value: conversationStat.stat, percentage: conversationStat.percentage })] }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(ChartCardWrapper, { title: "Sessions", label: "Sessions", setOutsideFilters: setSessionStatsDateFilter, filters: sessionStatsDateFilter, children: ((_a = sessionStats === null || sessionStats === void 0 ? void 0 : sessionStats.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = sessionStats === null || sessionStats === void 0 ? void 0 : sessionStats.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(LineChart, { data: ((_c = sessionStats === null || sessionStats === void 0 ? void 0 : sessionStats.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
157798
+ const { messageStat, topicStat, conversationStat, sessionStats, isLoadingAllStats, isLoadingUsersStats, isLoadingSessionStats, isLoadingTopicsDetailsStats, isLoadingActiveUsersStats, setSessionStatsDateFilter, usersStats, sessionStatsDateFilter, topicsDetailsStats, setTopicsDetailsStatsDateFilter, topicsDetailsStatsDateFilter, activeUsersStats, setUsersStatsDateFilter, usersStatsDateFilter, } = useOverview({ tenantKey, mentorId: currentMentorId, usergroupIds });
157799
+ return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoadingAllStats, title: "Messages", value: messageStat.stat, percentage: messageStat.percentage }), jsx(StatCard, { loading: isLoadingUsersStats, title: "Active Users", value: (usersStats === null || usersStats === void 0 ? void 0 : usersStats.count) || 0, percentage: (usersStats === null || usersStats === void 0 ? void 0 : usersStats.percentage_change) || 0 }), jsx(StatCard, { loading: isLoadingAllStats, title: "Topics", value: topicStat.stat, percentage: topicStat.percentage }), jsx(StatCard, { loading: isLoadingAllStats, title: "Conversations", value: conversationStat.stat, percentage: conversationStat.percentage })] }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(ChartCardWrapper, { title: "Sessions", label: "Sessions", setOutsideFilters: setSessionStatsDateFilter, filters: sessionStatsDateFilter, children: isLoadingSessionStats ? (jsx(ChartLoading, {})) : ((_a = sessionStats === null || sessionStats === void 0 ? void 0 : sessionStats.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = sessionStats === null || sessionStats === void 0 ? void 0 : sessionStats.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(LineChart, { data: ((_c = sessionStats === null || sessionStats === void 0 ? void 0 : sessionStats.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
157796
157800
  date: formatDateToShortFormat$2(point.date, sessionStatsDateFilter.activeFilter === 'today'),
157797
157801
  value: point.value,
157798
157802
  }))) || [], margin: { top: 5, right: 5, left: 0, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#f0f0f0", vertical: false }), jsx(XAxis, { dataKey: "date", tick: { fontSize: 8, textAnchor: 'end' }, angle: -45, interval: Math.floor(Number((_d = sessionStats === null || sessionStats === void 0 ? void 0 : sessionStats.points) === null || _d === void 0 ? void 0 : _d.length) / 31) || 0 }), jsx(YAxis, { tick: { fontSize: 10 }, width: 30, allowDecimals: false }), jsx(Tooltip, { content: ({ active, payload, label }) => {
@@ -157806,7 +157810,7 @@ function AnalyticsOverview({ tenantKey, mentorId, selectedMentorId, usergroupIds
157806
157810
  stroke: '#38A1E5',
157807
157811
  strokeWidth: 2,
157808
157812
  fill: 'white',
157809
- } })] })) : (jsx(EmptyStats, {})) }), jsx(ChartCardWrapper, { title: "Topics", label: "Topics", filters: topicsDetailsStatsDateFilter, setOutsideFilters: setTopicsDetailsStatsDateFilter, children: ((_e = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _e === void 0 ? void 0 : _e.length) && ((_f = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _f === void 0 ? void 0 : _f.length) > 0 ? (jsxs(BarChart, { data: (_g = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _g === void 0 ? void 0 : _g.map((result) => ({
157813
+ } })] })) : (jsx(EmptyStats, {})) }), jsx(ChartCardWrapper, { title: "Topics", label: "Topics", filters: topicsDetailsStatsDateFilter, setOutsideFilters: setTopicsDetailsStatsDateFilter, children: isLoadingTopicsDetailsStats ? (jsx(ChartLoading, {})) : ((_e = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _e === void 0 ? void 0 : _e.length) && ((_f = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _f === void 0 ? void 0 : _f.length) > 0 ? (jsxs(BarChart, { data: (_g = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _g === void 0 ? void 0 : _g.map((result) => ({
157810
157814
  topic: result.name,
157811
157815
  value: result.messages,
157812
157816
  })), layout: "vertical", margin: { top: 5, right: 30, left: 20, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3", horizontal: true, vertical: false }), jsx(XAxis, { type: "number", tick: { fontSize: 10 }, domain: [0, 'dataMax'], allowDecimals: false }), jsx(YAxis, { dataKey: "topic", type: "category", tick: { fontSize: 10 }, interval: 0, width: 80 }), jsx(Tooltip, { content: ({ active, payload, label }) => {
@@ -157815,7 +157819,7 @@ function AnalyticsOverview({ tenantKey, mentorId, selectedMentorId, usergroupIds
157815
157819
  return null;
157816
157820
  const data = (_a = payload[0]) === null || _a === void 0 ? void 0 : _a.payload;
157817
157821
  return (jsxs("div", { className: "bg-background border border-border rounded-md p-3 shadow-lg z-50", role: "tooltip", "aria-label": `Topic details for ${label}`, tabIndex: -1, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("div", { className: "font-medium text-foreground mb-2 text-base", children: label }), jsx("div", { className: "space-y-2 text-sm", children: jsxs("div", { className: "flex justify-between items-center", children: [jsx("span", { className: "text-muted-foreground", children: "Messages:" }), jsx("span", { className: "font-medium text-foreground", children: (_b = data === null || data === void 0 ? void 0 : data.value) === null || _b === void 0 ? void 0 : _b.toLocaleString() })] }) })] }));
157818
- }, cursor: { fill: 'rgba(0, 0, 0, 0.05)' }, wrapperStyle: { outline: 'none' } }), jsx(Bar, { dataKey: "value", fill: "#38A1E5", barSize: 20, radius: [0, 4, 4, 0] })] })) : (jsx(EmptyStats, {})) })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Active Users", label: "Active Users", filters: usersStatsDateFilter, setOutsideFilters: setUsersStatsDateFilter, children: ((_h = activeUsersStats === null || activeUsersStats === void 0 ? void 0 : activeUsersStats.points) === null || _h === void 0 ? void 0 : _h.length) && ((_j = activeUsersStats === null || activeUsersStats === void 0 ? void 0 : activeUsersStats.points) === null || _j === void 0 ? void 0 : _j.length) > 0 ? (jsxs(BarChart, { data: (_k = activeUsersStats === null || activeUsersStats === void 0 ? void 0 : activeUsersStats.points) === null || _k === void 0 ? void 0 : _k.map((point) => ({
157822
+ }, cursor: { fill: 'rgba(0, 0, 0, 0.05)' }, wrapperStyle: { outline: 'none' } }), jsx(Bar, { dataKey: "value", fill: "#38A1E5", barSize: 20, radius: [0, 4, 4, 0] })] })) : (jsx(EmptyStats, {})) })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Active Users", label: "Active Users", filters: usersStatsDateFilter, setOutsideFilters: setUsersStatsDateFilter, children: isLoadingActiveUsersStats ? (jsx(ChartLoading, {})) : ((_h = activeUsersStats === null || activeUsersStats === void 0 ? void 0 : activeUsersStats.points) === null || _h === void 0 ? void 0 : _h.length) && ((_j = activeUsersStats === null || activeUsersStats === void 0 ? void 0 : activeUsersStats.points) === null || _j === void 0 ? void 0 : _j.length) > 0 ? (jsxs(BarChart, { data: (_k = activeUsersStats === null || activeUsersStats === void 0 ? void 0 : activeUsersStats.points) === null || _k === void 0 ? void 0 : _k.map((point) => ({
157819
157823
  date: formatDateToShortFormat$2(point.date, usersStatsDateFilter.activeFilter === 'today'),
157820
157824
  value: point.value,
157821
157825
  })), margin: { top: 5, right: 5, left: 0, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3" }), jsx(XAxis, { dataKey: "date", tick: { fontSize: 8, textAnchor: 'end' }, angle: -45, interval: Math.floor(Number((_l = activeUsersStats === null || activeUsersStats === void 0 ? void 0 : activeUsersStats.points) === null || _l === void 0 ? void 0 : _l.length) / 90) || 0 }), jsx(YAxis, { width: 30, domain: [0, 'dataMax'], allowDecimals: false }), jsx(Tooltip, { content: ({ active, payload, label }) => {
@@ -158124,8 +158128,8 @@ const formatRelativeTime$1 = (dateString) => {
158124
158128
  function AnalyticsUsersStats({ tenantKey, mentorId, selectedMentorId, usergroupIds, }) {
158125
158129
  var _a, _b, _c, _d, _e, _f, _g, _h;
158126
158130
  const currentMentorId = selectedMentorId || mentorId;
158127
- const { registeredUsers, isLoadingRegisteredUsers, activeUsers, setActiveUsersStatsDateFilter, activeUsersStatsDateFilter, accessTimeHeatmap, isLoadingAccessTimeHeatmap, setAccessTimeHeatmapDateFilter, accessTimeHeatmapDateFilter, userDetailsStats, isLoadingUserDetailsStats, setUserDetailsStatsDateFilter, userDetailsStatsDateFilter, setUserDetailsStatsPage, userDetailsStatsSearch, handleSearchInputChange, currentlyActiveUsers, isLoadingCurrentlyActiveUsers, activeUsers30D, isLoadingActiveUsers30D, } = useUsers({ tenantKey, mentorId: currentMentorId, usergroupIds });
158128
- return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { title: "Users logged in right now", value: (currentlyActiveUsers === null || currentlyActiveUsers === void 0 ? void 0 : currentlyActiveUsers.count) || 0, loading: isLoadingCurrentlyActiveUsers }), jsx(StatCard, { title: "Users logged in past 30 days", value: (activeUsers30D === null || activeUsers30D === void 0 ? void 0 : activeUsers30D.count) || 0, loading: isLoadingActiveUsers30D }), jsx(StatCard, { title: "Total registered users", value: (registeredUsers === null || registeredUsers === void 0 ? void 0 : registeredUsers.count) || 0, loading: isLoadingRegisteredUsers })] }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(ChartCardWrapper, { title: "Active Users", label: "Active Users", filters: activeUsersStatsDateFilter, setOutsideFilters: setActiveUsersStatsDateFilter, children: ((_a = activeUsers === null || activeUsers === void 0 ? void 0 : activeUsers.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = activeUsers === null || activeUsers === void 0 ? void 0 : activeUsers.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(BarChart, { data: (_c = activeUsers === null || activeUsers === void 0 ? void 0 : activeUsers.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
158131
+ const { registeredUsers, isLoadingRegisteredUsers, activeUsers, isLoadingActiveUsers, setActiveUsersStatsDateFilter, activeUsersStatsDateFilter, accessTimeHeatmap, isLoadingAccessTimeHeatmap, setAccessTimeHeatmapDateFilter, accessTimeHeatmapDateFilter, userDetailsStats, isLoadingUserDetailsStats, setUserDetailsStatsDateFilter, userDetailsStatsDateFilter, setUserDetailsStatsPage, userDetailsStatsSearch, handleSearchInputChange, currentlyActiveUsers, isLoadingCurrentlyActiveUsers, activeUsers30D, isLoadingActiveUsers30D, } = useUsers({ tenantKey, mentorId: currentMentorId, usergroupIds });
158132
+ return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { title: "Users logged in right now", value: (currentlyActiveUsers === null || currentlyActiveUsers === void 0 ? void 0 : currentlyActiveUsers.count) || 0, loading: isLoadingCurrentlyActiveUsers }), jsx(StatCard, { title: "Users logged in past 30 days", value: (activeUsers30D === null || activeUsers30D === void 0 ? void 0 : activeUsers30D.count) || 0, loading: isLoadingActiveUsers30D }), jsx(StatCard, { title: "Total registered users", value: (registeredUsers === null || registeredUsers === void 0 ? void 0 : registeredUsers.count) || 0, loading: isLoadingRegisteredUsers })] }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(ChartCardWrapper, { title: "Active Users", label: "Active Users", filters: activeUsersStatsDateFilter, setOutsideFilters: setActiveUsersStatsDateFilter, children: isLoadingActiveUsers ? (jsx(ChartLoading, {})) : ((_a = activeUsers === null || activeUsers === void 0 ? void 0 : activeUsers.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = activeUsers === null || activeUsers === void 0 ? void 0 : activeUsers.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(BarChart, { data: (_c = activeUsers === null || activeUsers === void 0 ? void 0 : activeUsers.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
158129
158133
  date: formatDateToShortFormat$2(point.date, activeUsersStatsDateFilter.activeFilter === 'today'),
158130
158134
  value: point.value,
158131
158135
  })), margin: { top: 5, right: 5, left: 0, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3" }), jsx(XAxis, { dataKey: "date", tick: { fontSize: 8, textAnchor: 'end' }, angle: -45, interval: Math.floor(Number((_d = activeUsers === null || activeUsers === void 0 ? void 0 : activeUsers.points) === null || _d === void 0 ? void 0 : _d.length) / 31) || 0 }), jsx(YAxis, { width: 30, domain: [0, 'dataMax'], allowDecimals: false }), jsx(Tooltip, { content: ({ active, payload, label }) => {
@@ -158229,9 +158233,9 @@ const useTopics = ({ tenantKey, mentorId, usergroupIds, }) => {
158229
158233
  function AnalyticsTopicsStats({ tenantKey, mentorId, selectedMentorId, usergroupIds, }) {
158230
158234
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
158231
158235
  const currentMentorId = selectedMentorId || mentorId;
158232
- const { topicsStats, isLoadingTopicsStats, conversationsStats, conversationsStatsDateFilter, setConversationsStatsDateFilter, averageRatingStats, averageRatingDateFilter, setAverageRatingDateFilter, topicsDetailsStats, topicsDetailsDateFilter, setTopicsDetailsDateFilter, } = useTopics({ tenantKey, mentorId: currentMentorId, usergroupIds });
158236
+ const { topicsStats, isLoadingTopicsStats, conversationsStats, isLoadingConversationsStats, conversationsStatsDateFilter, setConversationsStatsDateFilter, averageRatingStats, averageRatingDateFilter, setAverageRatingDateFilter, topicsDetailsStats, isLoadingTopicsDetailsStats, topicsDetailsDateFilter, setTopicsDetailsDateFilter, } = useTopics({ tenantKey, mentorId: currentMentorId, usergroupIds });
158233
158237
  const averageRatingDisplayed = ((_a = averageRatingStats === null || averageRatingStats === void 0 ? void 0 : averageRatingStats.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = averageRatingStats === null || averageRatingStats === void 0 ? void 0 : averageRatingStats.points) === null || _b === void 0 ? void 0 : _b.length) > 0;
158234
- return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { title: "Topics", value: ((_c = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.topics) === null || _c === void 0 ? void 0 : _c.this_month) || 0, loading: isLoadingTopicsStats, percentage: ((_d = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.topics) === null || _d === void 0 ? void 0 : _d.percentage_change) || 0 }), jsx(StatCard, { title: "Conversations", value: ((_e = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.conversations) === null || _e === void 0 ? void 0 : _e.this_month) || 0, loading: isLoadingTopicsStats, percentage: ((_f = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.conversations) === null || _f === void 0 ? void 0 : _f.percentage_change) || 0 }), jsx(StatCard, { title: "Messages", value: ((_g = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.messages) === null || _g === void 0 ? void 0 : _g.this_month) || 0, loading: isLoadingTopicsStats, percentage: ((_h = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.messages) === null || _h === void 0 ? void 0 : _h.percentage_change) || 0 })] }), jsxs("div", { className: cn('grid grid-cols-1 lg:grid-cols-2 gap-5', !averageRatingDisplayed ? 'lg:grid-cols-1' : ''), children: [jsx(ChartCardWrapper, { title: "Conversations", label: "Conversations", filters: conversationsStatsDateFilter, setOutsideFilters: setConversationsStatsDateFilter, children: ((_j = conversationsStats === null || conversationsStats === void 0 ? void 0 : conversationsStats.points) === null || _j === void 0 ? void 0 : _j.length) && ((_k = conversationsStats === null || conversationsStats === void 0 ? void 0 : conversationsStats.points) === null || _k === void 0 ? void 0 : _k.length) > 0 ? (jsxs(LineChart, { data: (_l = conversationsStats === null || conversationsStats === void 0 ? void 0 : conversationsStats.points) === null || _l === void 0 ? void 0 : _l.map((point) => ({
158238
+ return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { title: "Topics", value: ((_c = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.topics) === null || _c === void 0 ? void 0 : _c.this_month) || 0, loading: isLoadingTopicsStats, percentage: ((_d = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.topics) === null || _d === void 0 ? void 0 : _d.percentage_change) || 0 }), jsx(StatCard, { title: "Conversations", value: ((_e = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.conversations) === null || _e === void 0 ? void 0 : _e.this_month) || 0, loading: isLoadingTopicsStats, percentage: ((_f = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.conversations) === null || _f === void 0 ? void 0 : _f.percentage_change) || 0 }), jsx(StatCard, { title: "Messages", value: ((_g = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.messages) === null || _g === void 0 ? void 0 : _g.this_month) || 0, loading: isLoadingTopicsStats, percentage: ((_h = topicsStats === null || topicsStats === void 0 ? void 0 : topicsStats.messages) === null || _h === void 0 ? void 0 : _h.percentage_change) || 0 })] }), jsxs("div", { className: cn('grid grid-cols-1 lg:grid-cols-2 gap-5', !averageRatingDisplayed ? 'lg:grid-cols-1' : ''), children: [jsx(ChartCardWrapper, { title: "Conversations", label: "Conversations", filters: conversationsStatsDateFilter, setOutsideFilters: setConversationsStatsDateFilter, children: isLoadingConversationsStats ? (jsx(ChartLoading, {})) : ((_j = conversationsStats === null || conversationsStats === void 0 ? void 0 : conversationsStats.points) === null || _j === void 0 ? void 0 : _j.length) && ((_k = conversationsStats === null || conversationsStats === void 0 ? void 0 : conversationsStats.points) === null || _k === void 0 ? void 0 : _k.length) > 0 ? (jsxs(LineChart, { data: (_l = conversationsStats === null || conversationsStats === void 0 ? void 0 : conversationsStats.points) === null || _l === void 0 ? void 0 : _l.map((point) => ({
158235
158239
  date: formatDateToShortFormat$2(point.date, conversationsStatsDateFilter.activeFilter === 'today'),
158236
158240
  value: point.value,
158237
158241
  })), margin: { top: 5, right: 5, left: 0, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#f0f0f0", vertical: false }), jsx(XAxis, { dataKey: "date", tick: { fontSize: 8, textAnchor: 'end' }, angle: -45, interval: Math.floor(Number((_m = conversationsStats === null || conversationsStats === void 0 ? void 0 : conversationsStats.points) === null || _m === void 0 ? void 0 : _m.length) / 31) || 0 }), jsx(YAxis, { tick: { fontSize: 10 }, width: 30, allowDecimals: false }), jsx(Tooltip, { content: ({ active, payload, label }) => {
@@ -158259,7 +158263,7 @@ function AnalyticsTopicsStats({ tenantKey, mentorId, selectedMentorId, usergroup
158259
158263
  stroke: '#38A1E5',
158260
158264
  strokeWidth: 2,
158261
158265
  fill: 'white',
158262
- } })] })) : (jsx(EmptyStats, {})) })) : null] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Topics Details", label: "Messages", filters: topicsDetailsDateFilter, setOutsideFilters: setTopicsDetailsDateFilter, children: ((_s = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _s === void 0 ? void 0 : _s.length) && ((_t = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _t === void 0 ? void 0 : _t.length) > 0 ? (jsxs(BarChart, { data: (_u = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _u === void 0 ? void 0 : _u.map((result) => ({
158266
+ } })] })) : (jsx(EmptyStats, {})) })) : null] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Topics Details", label: "Messages", filters: topicsDetailsDateFilter, setOutsideFilters: setTopicsDetailsDateFilter, children: isLoadingTopicsDetailsStats ? (jsx(ChartLoading, {})) : ((_s = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _s === void 0 ? void 0 : _s.length) && ((_t = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _t === void 0 ? void 0 : _t.length) > 0 ? (jsxs(BarChart, { data: (_u = topicsDetailsStats === null || topicsDetailsStats === void 0 ? void 0 : topicsDetailsStats.results) === null || _u === void 0 ? void 0 : _u.map((result) => ({
158263
158267
  topic: result.name,
158264
158268
  value: result.messages,
158265
158269
  })), layout: "vertical", margin: { top: 5, right: 30, left: 20, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3", horizontal: true, vertical: false }), jsx(XAxis, { type: "number", tick: { fontSize: 10 }, allowDecimals: false, domain: [0, 'dataMax'] }), jsx(YAxis, { dataKey: "topic", type: "category", tick: { fontSize: 10 }, interval: 0, width: 120 }), jsx(Tooltip, { content: ({ active, payload, label }) => {
@@ -158438,9 +158442,9 @@ const useFinancial = ({ tenantKey, mentorId, usergroupIds, }) => {
158438
158442
  };
158439
158443
 
158440
158444
  function AnalyticsFinancialStats({ tenantKey, mentorId, selectedMentorId, usergroupIds, }) {
158441
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
158445
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
158442
158446
  const currentMentorId = selectedMentorId || mentorId;
158443
- const { weeklyCostData, isLoadingWeeklyCostData, monthlyCostData, isLoadingMonthlyCostData, totalCostData, isLoadingTotalCostData, detailedCostPerDayData, detailedCostPerDayFilters, setDetailedCostPerDayFilters, detailedCostPerProviderData, detailedCostPerProviderFilters, setDetailedCostPerProviderFilters, detailedCostPerUserData, detailedCostPerUserFilters, setDetailedCostPerUserFilters, costPerUserPage, setCostPerUserPage, costPerUserLimit, providerColors, detailedLLMCostData, detailedLLMCostFilters, setDetailedLLMCostFilters, } = useFinancial({ tenantKey, mentorId: currentMentorId, usergroupIds });
158447
+ const { weeklyCostData, isLoadingWeeklyCostData, monthlyCostData, isLoadingMonthlyCostData, totalCostData, isLoadingTotalCostData, detailedCostPerDayData, isLoadingDetailedCostPerDayData, detailedCostPerDayFilters, setDetailedCostPerDayFilters, detailedCostPerProviderData, isLoadingDetailedCostPerProviderData, detailedCostPerProviderFilters, setDetailedCostPerProviderFilters, detailedCostPerUserData, isLoadingDetailedCostPerUserData, detailedCostPerUserFilters, setDetailedCostPerUserFilters, costPerUserPage, setCostPerUserPage, costPerUserLimit, providerColors, detailedLLMCostData, isLoadingDetailedLLMCostData, detailedLLMCostFilters, setDetailedLLMCostFilters, } = useFinancial({ tenantKey, mentorId: currentMentorId, usergroupIds });
158444
158448
  // Pagination handlers
158445
158449
  const handleFirstPage = () => {
158446
158450
  setCostPerUserPage(1);
@@ -158495,7 +158499,7 @@ function AnalyticsFinancialStats({ tenantKey, mentorId, selectedMentorId, usergr
158495
158499
  }
158496
158500
  return pages;
158497
158501
  };
158498
- return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoadingWeeklyCostData, title: "Weekly Costs", value: Number((weeklyCostData === null || weeklyCostData === void 0 ? void 0 : weeklyCostData.value) || 0).toFixed(2), percentage: (weeklyCostData === null || weeklyCostData === void 0 ? void 0 : weeklyCostData.percentage_change) || 0, showDollarSign: true }), jsx(StatCard, { loading: isLoadingMonthlyCostData, title: "Monthly Costs", value: Number((monthlyCostData === null || monthlyCostData === void 0 ? void 0 : monthlyCostData.value) || 0).toFixed(2), percentage: (monthlyCostData === null || monthlyCostData === void 0 ? void 0 : monthlyCostData.percentage_change) || 0, showDollarSign: true }), jsx(StatCard, { loading: isLoadingTotalCostData, title: "Total Costs", value: Number((totalCostData === null || totalCostData === void 0 ? void 0 : totalCostData.value) || 0).toFixed(2), percentage: totalCostData === null || totalCostData === void 0 ? void 0 : totalCostData.percentage_change, showDollarSign: true })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Cost per Day", label: "Cost per Day", filters: detailedCostPerDayFilters, setOutsideFilters: setDetailedCostPerDayFilters, children: ((_a = detailedCostPerDayData === null || detailedCostPerDayData === void 0 ? void 0 : detailedCostPerDayData.overtime) === null || _a === void 0 ? void 0 : _a.length) &&
158502
+ return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoadingWeeklyCostData, title: "Weekly Costs", value: Number((weeklyCostData === null || weeklyCostData === void 0 ? void 0 : weeklyCostData.value) || 0).toFixed(2), percentage: (weeklyCostData === null || weeklyCostData === void 0 ? void 0 : weeklyCostData.percentage_change) || 0, showDollarSign: true }), jsx(StatCard, { loading: isLoadingMonthlyCostData, title: "Monthly Costs", value: Number((monthlyCostData === null || monthlyCostData === void 0 ? void 0 : monthlyCostData.value) || 0).toFixed(2), percentage: (monthlyCostData === null || monthlyCostData === void 0 ? void 0 : monthlyCostData.percentage_change) || 0, showDollarSign: true }), jsx(StatCard, { loading: isLoadingTotalCostData, title: "Total Costs", value: Number((totalCostData === null || totalCostData === void 0 ? void 0 : totalCostData.value) || 0).toFixed(2), percentage: totalCostData === null || totalCostData === void 0 ? void 0 : totalCostData.percentage_change, showDollarSign: true })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Cost per Day", label: "Cost per Day", filters: detailedCostPerDayFilters, setOutsideFilters: setDetailedCostPerDayFilters, children: isLoadingDetailedCostPerDayData ? (jsx(ChartLoading, {})) : ((_a = detailedCostPerDayData === null || detailedCostPerDayData === void 0 ? void 0 : detailedCostPerDayData.overtime) === null || _a === void 0 ? void 0 : _a.length) &&
158499
158503
  ((_b = detailedCostPerDayData === null || detailedCostPerDayData === void 0 ? void 0 : detailedCostPerDayData.overtime) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(BarChart, { data: detailedCostPerDayData.overtime.map((item) => ({
158500
158504
  date: formatDateToShortFormat$2(item.date, detailedCostPerDayFilters.activeFilter === 'today'),
158501
158505
  value: item.value,
@@ -158505,10 +158509,11 @@ function AnalyticsFinancialStats({ tenantKey, mentorId, selectedMentorId, usergr
158505
158509
  return null;
158506
158510
  const data = (_a = payload[0]) === null || _a === void 0 ? void 0 : _a.payload;
158507
158511
  return (jsxs("div", { className: "bg-background border border-border rounded-md p-3 shadow-lg z-50", style: { borderColor: 'oklch(.922 0 0)' }, role: "tooltip", "aria-label": `Cost details for ${label}`, tabIndex: -1, children: [jsx("div", { className: "font-medium text-foreground mb-2 text-base", children: label }), jsx("div", { className: "space-y-2 text-sm", children: jsxs("div", { className: "flex justify-between items-center", children: [jsx("span", { className: "text-muted-foreground", children: "Cost:" }), jsxs("span", { className: "font-medium text-foreground", children: ["$", (Number(data === null || data === void 0 ? void 0 : data.value) || 0).toFixed(3)] })] }) })] }));
158508
- }, cursor: { fill: 'rgba(0, 0, 0, 0.05)' }, wrapperStyle: { outline: 'none' } }), jsx(Bar, { dataKey: "value", fill: "#38A1E5", radius: [5, 5, 5, 5], barSize: 30 })] })) : (jsx(EmptyStats, {})) }) }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(ChartCardWrapper, { title: "Cost by Provider", label: "Cost by Provider", filters: detailedCostPerProviderFilters, setOutsideFilters: setDetailedCostPerProviderFilters, children: jsxs(PieChart, { children: [jsx(Pie, { data: (_d = detailedCostPerProviderData === null || detailedCostPerProviderData === void 0 ? void 0 : detailedCostPerProviderData.rows) === null || _d === void 0 ? void 0 : _d.map((item) => ({
158512
+ }, cursor: { fill: 'rgba(0, 0, 0, 0.05)' }, wrapperStyle: { outline: 'none' } }), jsx(Bar, { dataKey: "value", fill: "#38A1E5", radius: [5, 5, 5, 5], barSize: 30 })] })) : (jsx(EmptyStats, {})) }) }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(ChartCardWrapper, { title: "Cost by Provider", label: "Cost by Provider", filters: detailedCostPerProviderFilters, setOutsideFilters: setDetailedCostPerProviderFilters, children: isLoadingDetailedCostPerProviderData ? (jsx(ChartLoading, {})) : ((_d = detailedCostPerProviderData === null || detailedCostPerProviderData === void 0 ? void 0 : detailedCostPerProviderData.rows) === null || _d === void 0 ? void 0 : _d.length) &&
158513
+ ((_e = detailedCostPerProviderData === null || detailedCostPerProviderData === void 0 ? void 0 : detailedCostPerProviderData.rows) === null || _e === void 0 ? void 0 : _e.length) > 0 ? (jsxs(PieChart, { children: [jsx(Pie, { data: (_f = detailedCostPerProviderData === null || detailedCostPerProviderData === void 0 ? void 0 : detailedCostPerProviderData.rows) === null || _f === void 0 ? void 0 : _f.map((item) => ({
158509
158514
  name: item.provider,
158510
158515
  value: item.total_cost,
158511
- })), cx: "50%", cy: "50%", innerRadius: 60, outerRadius: 80, paddingAngle: 1, dataKey: "value", label: false, startAngle: 90, endAngle: -270, children: (_e = detailedCostPerProviderData === null || detailedCostPerProviderData === void 0 ? void 0 : detailedCostPerProviderData.rows) === null || _e === void 0 ? void 0 : _e.map((_, index) => {
158516
+ })), cx: "50%", cy: "50%", innerRadius: 60, outerRadius: 80, paddingAngle: 1, dataKey: "value", label: false, startAngle: 90, endAngle: -270, children: (_g = detailedCostPerProviderData === null || detailedCostPerProviderData === void 0 ? void 0 : detailedCostPerProviderData.rows) === null || _g === void 0 ? void 0 : _g.map((_, index) => {
158512
158517
  var _a;
158513
158518
  return (jsx(Cell, { fill: (_a = providerColors[index]) !== null && _a !== void 0 ? _a : '#38A1E5', strokeWidth: 0, style: { transition: 'all 0.3s' } }, `cell-${index}`));
158514
158519
  }) }), jsx(Legend, { verticalAlign: "bottom", height: 36, iconType: "circle", iconSize: 10, wrapperStyle: { paddingTop: '0px' }, fontSize: 13 }), jsx(Tooltip, { content: ({ active, payload, label }) => {
@@ -158517,17 +158522,18 @@ function AnalyticsFinancialStats({ tenantKey, mentorId, selectedMentorId, usergr
158517
158522
  return null;
158518
158523
  const data = (_a = payload[0]) === null || _a === void 0 ? void 0 : _a.payload;
158519
158524
  return (jsxs("div", { className: "bg-background border border-border rounded-md p-3 shadow-lg z-[99999999]", style: { borderColor: 'oklch(.922 0 0)' }, role: "tooltip", "aria-label": `Provider cost details for ${label}`, tabIndex: -1, children: [jsx("div", { className: "font-medium text-foreground mb-2 text-base", children: label }), jsx("div", { className: "space-y-2 text-sm", children: jsxs("div", { className: "flex justify-between items-center", children: [jsxs("span", { className: "text-muted-foreground", children: [data === null || data === void 0 ? void 0 : data.name, ":"] }), jsxs("span", { className: "font-medium text-foreground", children: ["$", (_b = data === null || data === void 0 ? void 0 : data.value) === null || _b === void 0 ? void 0 : _b.toFixed(2)] })] }) })] }));
158520
- }, wrapperStyle: { outline: 'none' } })] }) }), jsx(ChartCardWrapper, { title: "Cost by LLM", label: "Cost by LLM", filters: detailedLLMCostFilters, setOutsideFilters: setDetailedLLMCostFilters, children: ((_f = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _f === void 0 ? void 0 : _f.length) && ((_g = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (jsxs(BarChart, { data: (_h = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _h === void 0 ? void 0 : _h.map((item) => ({
158525
+ }, wrapperStyle: { outline: 'none' } })] })) : (jsx(EmptyStats, {})) }), jsx(ChartCardWrapper, { title: "Cost by LLM", label: "Cost by LLM", filters: detailedLLMCostFilters, setOutsideFilters: setDetailedLLMCostFilters, children: isLoadingDetailedLLMCostData ? (jsx(ChartLoading, {})) : ((_h = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _h === void 0 ? void 0 : _h.length) && ((_j = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _j === void 0 ? void 0 : _j.length) > 0 ? (jsxs(BarChart, { data: (_k = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _k === void 0 ? void 0 : _k.map((item) => ({
158521
158526
  name: item.llm_model,
158522
158527
  value: item.total_cost,
158523
- })), margin: { top: 5, right: 5, left: 20, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#f0f0f0" }), jsx(XAxis, { dataKey: "name", tick: { fontSize: 9, textAnchor: 'end' }, angle: -45, height: 50, interval: Math.floor(Number((_j = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _j === void 0 ? void 0 : _j.length) / 31) || 0 }), jsx(YAxis, { tick: { fontSize: 10 }, width: 30, tickFormatter: (value) => `$${value.toFixed(3)}` }), jsx(Tooltip, { content: ({ active, payload, label }) => {
158528
+ })), margin: { top: 5, right: 5, left: 20, bottom: 5 }, children: [jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#f0f0f0" }), jsx(XAxis, { dataKey: "name", tick: { fontSize: 9, textAnchor: 'end' }, angle: -45, height: 50, interval: Math.floor(Number((_l = detailedLLMCostData === null || detailedLLMCostData === void 0 ? void 0 : detailedLLMCostData.rows) === null || _l === void 0 ? void 0 : _l.length) / 31) || 0 }), jsx(YAxis, { tick: { fontSize: 10 }, width: 30, tickFormatter: (value) => `$${value.toFixed(3)}` }), jsx(Tooltip, { content: ({ active, payload, label }) => {
158524
158529
  var _a, _b;
158525
158530
  if (!active || !(payload === null || payload === void 0 ? void 0 : payload.length))
158526
158531
  return null;
158527
158532
  const data = (_a = payload[0]) === null || _a === void 0 ? void 0 : _a.payload;
158528
158533
  return (jsxs("div", { className: "bg-background border border-border rounded-md p-3 shadow-lg z-50", style: { borderColor: 'oklch(.922 0 0)' }, role: "tooltip", "aria-label": `LLM cost details for ${label}`, tabIndex: -1, children: [jsx("div", { className: "font-medium text-foreground mb-2 text-base", children: label }), jsx("div", { className: "space-y-2 text-sm", children: jsxs("div", { className: "flex justify-between items-center", children: [jsx("span", { className: "text-muted-foreground", children: "Total Cost:" }), jsxs("span", { className: "font-medium text-foreground", children: ["$", (_b = data === null || data === void 0 ? void 0 : data.value) === null || _b === void 0 ? void 0 : _b.toFixed(3)] })] }) })] }));
158529
- }, cursor: { fill: 'rgba(0, 0, 0, 0.05)' }, wrapperStyle: { outline: 'none' } }), jsx(Bar, { dataKey: "value", fill: "#38A1E5", radius: [5, 5, 5, 5], barSize: 25 })] })) : (jsx(EmptyStats, {})) })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Cost per User", label: "Cost per User", filters: detailedCostPerUserFilters, setOutsideFilters: setDetailedCostPerUserFilters, overflowAuto: true, height: "450px", children: jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "rounded-md", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "w-[250px]", children: "User Email" }), jsx(TableHead, { className: "w-[120px]", children: "Total Cost" }), jsx(TableHead, { children: "Sessions" }), jsx(TableHead, { className: "text-right", children: "Last Active" })] }) }), jsx(TableBody, { children: (_k = detailedCostPerUserData === null || detailedCostPerUserData === void 0 ? void 0 : detailedCostPerUserData.rows) === null || _k === void 0 ? void 0 : _k.map((user, index) => (jsxs(TableRow, { className: cn(index % 2 === 0 ? 'bg-gray-50' : '', 'h-[48px]'), style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: jsx("div", { className: "flex items-center", children: (user === null || user === void 0 ? void 0 : user.email) || (user === null || user === void 0 ? void 0 : user.username) || 'Anonymous' }) }), jsxs(TableCell, { className: "font-medium", children: ["$", Number(user.total_cost || 0).toFixed(2)] }), jsx(TableCell, { children: user.sessions }), jsx(TableCell, { className: "text-right", children: user.last_active ? formatRelativeTime$2(user.last_active) : '-' })] }, index))) })] }) }), (!((_l = detailedCostPerUserData === null || detailedCostPerUserData === void 0 ? void 0 : detailedCostPerUserData.rows) === null || _l === void 0 ? void 0 : _l.length) ||
158530
- ((_m = detailedCostPerUserData === null || detailedCostPerUserData === void 0 ? void 0 : detailedCostPerUserData.rows) === null || _m === void 0 ? void 0 : _m.length) === 0) && (jsx("div", { className: "h-[60px]", children: jsx(EmptyStats, {}) })), detailedCostPerUserData && detailedCostPerUserData.total_pages > 1 && (jsxs("div", { className: "flex items-center justify-between py-3", children: [jsxs("div", { className: "text-sm text-gray-700", children: ["Showing ", (costPerUserPage - 1) * costPerUserLimit + 1, " to", ' ', Math.min(costPerUserPage * costPerUserLimit, detailedCostPerUserData.total_records), ' ', "of ", detailedCostPerUserData.total_records, " results"] }), jsxs("div", { className: "flex items-center space-x-2", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handleFirstPage, disabled: costPerUserPage === 1, children: [jsx("span", { className: "sr-only", children: "Go to first page" }), jsx(ChevronsLeft, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handlePreviousPage, disabled: costPerUserPage === 1, children: [jsx("span", { className: "sr-only", children: "Go to previous page" }), jsx(ChevronLeft, { className: "h-4 w-4" })] }), generatePageNumbers().map((page, index) => (jsx(React__default.Fragment, { children: page === '...' ? (jsx("span", { className: "px-2 text-gray-500", children: "..." })) : (jsx(Button$1, { variant: costPerUserPage === page ? 'default' : 'outline', size: "sm", className: `h-8 p-3 !w-auto !inline-flex ${costPerUserPage === page ? 'bg-blue-50 text-blue-600' : 'bg-transparent'}`, onClick: () => setCostPerUserPage(page), children: page })) }, index))), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handleNextPage, disabled: costPerUserPage === detailedCostPerUserData.total_pages, children: [jsx("span", { className: "sr-only", children: "Go to next page" }), jsx(ChevronRight, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handleLastPage, disabled: costPerUserPage === detailedCostPerUserData.total_pages, children: [jsx("span", { className: "sr-only", children: "Go to last page" }), jsx(ChevronsRight, { className: "h-4 w-4" })] })] })] }))] }) }) })] }));
158534
+ }, cursor: { fill: 'rgba(0, 0, 0, 0.05)' }, wrapperStyle: { outline: 'none' } }), jsx(Bar, { dataKey: "value", fill: "#38A1E5", radius: [5, 5, 5, 5], barSize: 25 })] })) : (jsx(EmptyStats, {})) })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Cost per User", label: "Cost per User", filters: detailedCostPerUserFilters, setOutsideFilters: setDetailedCostPerUserFilters, overflowAuto: true, height: "450px", children: jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "rounded-md", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "w-[250px]", children: "User Email" }), jsx(TableHead, { className: "w-[120px]", children: "Total Cost" }), jsx(TableHead, { children: "Sessions" }), jsx(TableHead, { className: "text-right", children: "Last Active" })] }) }), jsx(TableBody, { children: (_m = detailedCostPerUserData === null || detailedCostPerUserData === void 0 ? void 0 : detailedCostPerUserData.rows) === null || _m === void 0 ? void 0 : _m.map((user, index) => (jsxs(TableRow, { className: cn(index % 2 === 0 ? 'bg-gray-50' : '', 'h-[48px]'), style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: jsx("div", { className: "flex items-center", children: (user === null || user === void 0 ? void 0 : user.email) || (user === null || user === void 0 ? void 0 : user.username) || 'Anonymous' }) }), jsxs(TableCell, { className: "font-medium", children: ["$", Number(user.total_cost || 0).toFixed(2)] }), jsx(TableCell, { children: user.sessions }), jsx(TableCell, { className: "text-right", children: user.last_active ? formatRelativeTime$2(user.last_active) : '-' })] }, index))) })] }) }), isLoadingDetailedCostPerUserData && (jsx("div", { className: "h-[60px]", children: jsx(ChartLoading, {}) })), !isLoadingDetailedCostPerUserData &&
158535
+ (!((_o = detailedCostPerUserData === null || detailedCostPerUserData === void 0 ? void 0 : detailedCostPerUserData.rows) === null || _o === void 0 ? void 0 : _o.length) ||
158536
+ ((_p = detailedCostPerUserData === null || detailedCostPerUserData === void 0 ? void 0 : detailedCostPerUserData.rows) === null || _p === void 0 ? void 0 : _p.length) === 0) && (jsx("div", { className: "h-[60px]", children: jsx(EmptyStats, {}) })), detailedCostPerUserData && detailedCostPerUserData.total_pages > 1 && (jsxs("div", { className: "flex items-center justify-between py-3", children: [jsxs("div", { className: "text-sm text-gray-700", children: ["Showing ", (costPerUserPage - 1) * costPerUserLimit + 1, " to", ' ', Math.min(costPerUserPage * costPerUserLimit, detailedCostPerUserData.total_records), ' ', "of ", detailedCostPerUserData.total_records, " results"] }), jsxs("div", { className: "flex items-center space-x-2", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handleFirstPage, disabled: costPerUserPage === 1, children: [jsx("span", { className: "sr-only", children: "Go to first page" }), jsx(ChevronsLeft, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handlePreviousPage, disabled: costPerUserPage === 1, children: [jsx("span", { className: "sr-only", children: "Go to previous page" }), jsx(ChevronLeft, { className: "h-4 w-4" })] }), generatePageNumbers().map((page, index) => (jsx(React__default.Fragment, { children: page === '...' ? (jsx("span", { className: "px-2 text-gray-500", children: "..." })) : (jsx(Button$1, { variant: costPerUserPage === page ? 'default' : 'outline', size: "sm", className: `h-8 p-3 !w-auto !inline-flex ${costPerUserPage === page ? 'bg-blue-50 text-blue-600' : 'bg-transparent'}`, onClick: () => setCostPerUserPage(page), children: page })) }, index))), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handleNextPage, disabled: costPerUserPage === detailedCostPerUserData.total_pages, children: [jsx("span", { className: "sr-only", children: "Go to next page" }), jsx(ChevronRight, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 p-2 !w-auto !inline-flex bg-transparent", onClick: handleLastPage, disabled: costPerUserPage === detailedCostPerUserData.total_pages, children: [jsx("span", { className: "sr-only", children: "Go to last page" }), jsx(ChevronsRight, { className: "h-4 w-4" })] })] })] }))] }) }) })] }));
158531
158537
  }
158532
158538
 
158533
158539
  const useTranscripts = ({ tenantKey, mentorId, usergroupIds, }) => {
@@ -194219,6 +194225,11 @@ const useCourses = ({ tenantKey, mentorId, courseId, }) => {
194219
194225
  const [coursesListSearch, setCoursesListSearch] = useState('');
194220
194226
  const [debouncedSearch, setDebouncedSearch] = useState('');
194221
194227
  const isInitialMount = React__default.useRef(true);
194228
+ const [courseEnrollmentsPage, setCourseEnrollmentsPage] = useState(1);
194229
+ const [courseEnrollmentsLimit] = useState(20);
194230
+ const [courseEnrollmentsSearch, setCourseEnrollmentsSearch] = useState('');
194231
+ const [debouncedCourseEnrollmentsSearch, setDebouncedCourseEnrollmentsSearch] = useState('');
194232
+ const isInitialMountCourseEnrollments = React__default.useRef(true);
194222
194233
  // Debounce search input
194223
194234
  useEffect(() => {
194224
194235
  // Skip debounce on initial mount
@@ -194232,9 +194243,24 @@ const useCourses = ({ tenantKey, mentorId, courseId, }) => {
194232
194243
  }, 300);
194233
194244
  return () => clearTimeout(timer);
194234
194245
  }, [coursesListSearch]);
194246
+ // Debounce course enrollments search input
194247
+ useEffect(() => {
194248
+ if (isInitialMountCourseEnrollments.current) {
194249
+ isInitialMountCourseEnrollments.current = false;
194250
+ return;
194251
+ }
194252
+ const timer = setTimeout(() => {
194253
+ setDebouncedCourseEnrollmentsSearch(courseEnrollmentsSearch);
194254
+ setCourseEnrollmentsPage(1);
194255
+ }, 300);
194256
+ return () => clearTimeout(timer);
194257
+ }, [courseEnrollmentsSearch]);
194235
194258
  const handleSearchInputChange = (e) => {
194236
194259
  setCoursesListSearch(e.target.value);
194237
194260
  };
194261
+ const handleCourseEnrollmentsSearchInputChange = (e) => {
194262
+ setCourseEnrollmentsSearch(e.target.value);
194263
+ };
194238
194264
  // Prepare params for content analytics query (courses list and stats)
194239
194265
  const contentAnalyticsParams = useMemo(() => {
194240
194266
  var _a, _b;
@@ -194271,11 +194297,20 @@ const useCourses = ({ tenantKey, mentorId, courseId, }) => {
194271
194297
  include_overtime: true,
194272
194298
  platform_key: tenantKey,
194273
194299
  mentor_unique_id: mentorId,
194274
- limit: 20,
194275
- page: 1,
194300
+ limit: courseEnrollmentsLimit,
194301
+ page: courseEnrollmentsPage,
194302
+ ...(debouncedCourseEnrollmentsSearch && { search: debouncedCourseEnrollmentsSearch }),
194276
194303
  }
194277
194304
  : null;
194278
- }, [courseId, timeSpentStatsDateFilter, tenantKey, mentorId]);
194305
+ }, [
194306
+ courseId,
194307
+ timeSpentStatsDateFilter,
194308
+ tenantKey,
194309
+ mentorId,
194310
+ courseEnrollmentsLimit,
194311
+ courseEnrollmentsPage,
194312
+ debouncedCourseEnrollmentsSearch,
194313
+ ]);
194279
194314
  // Query for courses list and summary
194280
194315
  const { data: contentAnalyticsData, isLoading: isLoadingContentAnalytics, isFetching: isFetchingContentAnalytics, } = useGetContentAnalyticsQuery(contentAnalyticsParams);
194281
194316
  // Query for course details (only when courseId is provided)
@@ -194360,11 +194395,13 @@ const useCourses = ({ tenantKey, mentorId, courseId, }) => {
194360
194395
  }
194361
194396
  return {
194362
194397
  enrollments: courseDetailsData.learners.map((learner) => ({
194398
+ username: learner.username,
194363
194399
  name: learner.name,
194364
194400
  email: learner.email,
194365
194401
  time_spent: 0, // This might need to be calculated or come from another field
194366
194402
  progress: learner.completion_percentage || 0,
194367
194403
  grade: learner.rating || 'N/A',
194404
+ enrollment_date: learner.enrollment_date,
194368
194405
  last_active_on: learner.last_activity,
194369
194406
  })),
194370
194407
  total: courseDetailsData.pagination.count,
@@ -194391,6 +194428,12 @@ const useCourses = ({ tenantKey, mentorId, courseId, }) => {
194391
194428
  coursesListSearch,
194392
194429
  handleSearchInputChange,
194393
194430
  coursesPagination: contentAnalyticsData === null || contentAnalyticsData === void 0 ? void 0 : contentAnalyticsData.pagination,
194431
+ courseInfo: courseDetailsData === null || courseDetailsData === void 0 ? void 0 : courseDetailsData.content_info,
194432
+ courseEnrollmentsPage,
194433
+ setCourseEnrollmentsPage,
194434
+ courseEnrollmentsSearch,
194435
+ handleCourseEnrollmentsSearchInputChange,
194436
+ courseEnrollmentsPagination: courseDetailsData === null || courseDetailsData === void 0 ? void 0 : courseDetailsData.pagination,
194394
194437
  };
194395
194438
  };
194396
194439
 
@@ -194426,7 +194469,7 @@ function AnalyticsCourses({ tenantKey, mentorId, selectedMentorId, basePath = ''
194426
194469
  const handleCourseClick = (courseId) => {
194427
194470
  router.push(`${basePath}/courses/${courseId}`);
194428
194471
  };
194429
- return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Courses", value: courseStats.active_courses, percentage: courseStats.active_courses_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Courses", value: courseStats.total_courses, percentage: courseStats.total_courses_percentage }), jsx(StatCard, { loading: isLoading, title: "Enrollments", value: courseStats.enrollments, percentage: courseStats.enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Learners", value: courseStats.total_learners })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Course Overtime", label: "Time Spent", filters: enrollmentStatsDateFilter, setOutsideFilters: setEnrollmentStatsDateFilter, children: ((_a = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(LineChart, { data: ((_c = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
194472
+ return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Courses", value: courseStats.active_courses, percentage: courseStats.active_courses_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Courses", value: courseStats.total_courses, percentage: courseStats.total_courses_percentage }), jsx(StatCard, { loading: isLoading, title: "Enrollments", value: courseStats.enrollments, percentage: courseStats.enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Learners", value: courseStats.total_learners })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Course Overtime", label: "Time Spent", filters: enrollmentStatsDateFilter, setOutsideFilters: setEnrollmentStatsDateFilter, children: isLoading ? (jsx(ChartLoading, {})) : ((_a = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(LineChart, { data: ((_c = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
194430
194473
  date: formatDateToShortFormat$1(point.date, enrollmentStatsDateFilter.activeFilter === 'today'),
194431
194474
  value: formatSecondsToHours$1(point.value),
194432
194475
  rawSeconds: point.value,
@@ -194465,8 +194508,120 @@ function AnalyticsCourses({ tenantKey, mentorId, selectedMentorId, basePath = ''
194465
194508
  }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setCoursesListPage(coursesPagination.current_page + 1), disabled: coursesPagination.current_page === coursesPagination.total_pages, "aria-label": "Go to next page", children: [jsx("span", { className: "sr-only", children: "Go to next page" }), jsx(ChevronRight, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setCoursesListPage(coursesPagination.total_pages), disabled: coursesPagination.current_page === coursesPagination.total_pages, "aria-label": "Go to last page", children: [jsx("span", { className: "sr-only", children: "Go to last page" }), jsx(ChevronsRight, { className: "h-4 w-4" })] })] }))] })) : (jsx(EmptyStats, { title: "No courses available" }))] })] }) }) })] }));
194466
194509
  }
194467
194510
 
194511
+ const COMPLETED_COLOR = '#ED8936';
194512
+ const REMAINING_COLOR = '#E5E7EB';
194513
+ const formatDate = (value) => {
194514
+ if (!value)
194515
+ return '—';
194516
+ const date = new Date(value);
194517
+ if (Number.isNaN(date.getTime()))
194518
+ return '—';
194519
+ return date.toLocaleDateString();
194520
+ };
194521
+ const normalizeContentId = (id) => {
194522
+ if (!id)
194523
+ return '';
194524
+ try {
194525
+ return decodeURIComponent(id);
194526
+ }
194527
+ catch (_a) {
194528
+ return id;
194529
+ }
194530
+ };
194531
+ const fractionToPct = (fraction) => Math.round((fraction !== null && fraction !== void 0 ? fraction : 0) * 100);
194532
+ const getPassingPct = (gradeRange) => {
194533
+ if (!gradeRange)
194534
+ return 0;
194535
+ if (typeof gradeRange.Pass === 'number')
194536
+ return Math.round(gradeRange.Pass * 100);
194537
+ const cutoffs = Object.values(gradeRange).filter((value) => typeof value === 'number' && value > 0);
194538
+ return cutoffs.length ? Math.round(Math.min(...cutoffs) * 100) : 0;
194539
+ };
194540
+ const buildGradeSummary = (edx) => {
194541
+ var _a, _b, _c, _d, _e, _f;
194542
+ const policies = (_b = (_a = edx.grading_policy) === null || _a === void 0 ? void 0 : _a.assignment_policies) !== null && _b !== void 0 ? _b : [];
194543
+ const sections = (_c = edx.section_scores) !== null && _c !== void 0 ? _c : [];
194544
+ const scoresByType = new Map();
194545
+ for (const section of sections) {
194546
+ for (const subsection of (_d = section.subsections) !== null && _d !== void 0 ? _d : []) {
194547
+ if (subsection.has_graded_assignment && subsection.format) {
194548
+ const list = (_e = scoresByType.get(subsection.format)) !== null && _e !== void 0 ? _e : [];
194549
+ list.push((_f = subsection.percent_graded) !== null && _f !== void 0 ? _f : 0);
194550
+ scoresByType.set(subsection.format, list);
194551
+ }
194552
+ }
194553
+ }
194554
+ const footnotes = [];
194555
+ const rows = policies.map((policy) => {
194556
+ var _a;
194557
+ let scores = (_a = scoresByType.get(policy.type)) !== null && _a !== void 0 ? _a : [];
194558
+ if (policy.num_droppable > 0 && scores.length > 0) {
194559
+ scores = [...scores].sort((a, b) => a - b).slice(policy.num_droppable);
194560
+ }
194561
+ const gradeFraction = scores.length
194562
+ ? scores.reduce((sum, value) => sum + value, 0) / scores.length
194563
+ : 0;
194564
+ let footnote;
194565
+ if (policy.num_droppable > 0) {
194566
+ footnotes.push(`The lowest ${policy.num_droppable} ${policy.type} scores are dropped.`);
194567
+ footnote = footnotes.length;
194568
+ }
194569
+ return {
194570
+ type: policy.type,
194571
+ weightPct: Math.round(policy.weight * 100),
194572
+ gradePct: Math.round(gradeFraction * 100),
194573
+ weightedGradePct: Math.round(gradeFraction * policy.weight * 100),
194574
+ footnote,
194575
+ };
194576
+ });
194577
+ return { rows, footnotes };
194578
+ };
194579
+ function GradeBar({ currentPct, passingPct }) {
194580
+ const clampedCurrent = Math.min(Math.max(currentPct, 0), 100);
194581
+ const clampedPassing = Math.min(Math.max(passingPct, 0), 100);
194582
+ return (jsxs("div", { className: "pt-7 pb-4", children: [jsxs("div", { className: "relative", children: [jsx("div", { className: "absolute -top-7 -translate-x-1/2", style: { left: `${clampedCurrent}%` }, children: jsxs("span", { className: "whitespace-nowrap rounded border border-amber-300 bg-amber-50 px-1.5 py-0.5 text-xs font-semibold text-gray-700", children: [currentPct, "%"] }) }), jsxs("div", { className: "relative h-2 rounded-full bg-gray-200", children: [jsx("div", { className: "absolute left-0 top-0 h-2 rounded-full bg-amber-500", style: { width: `${clampedCurrent}%` } }), jsx("div", { className: "absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white bg-amber-500", style: { left: `${clampedPassing}%` } })] }), jsx("div", { className: "absolute top-3 -translate-x-1/2", style: { left: `${clampedPassing}%` }, children: jsxs("span", { className: "whitespace-nowrap rounded bg-amber-500 px-1.5 py-0.5 text-xs font-semibold text-white", children: [passingPct, "%"] }) })] }), jsxs("div", { className: "mt-10 flex justify-between text-xs text-gray-500", children: [jsx("span", { children: "Current grade" }), jsx("span", { children: "Passing grade" })] })] }));
194583
+ }
194584
+ function EnrolledUserProgressModal({ open, onOpenChange, username, userName, email, contentId, contentName, tenantKey, metric = 'course', }) {
194585
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
194586
+ const isProgram = metric === 'program';
194587
+ const normalizedId = normalizeContentId(contentId);
194588
+ const { data, isLoading, isFetching } = useGetLearnerDetailsQuery({
194589
+ username,
194590
+ platform_key: tenantKey,
194591
+ metrics: isProgram ? 'programs,time_spent' : 'courses,time_spent',
194592
+ include_edx_progress: true,
194593
+ ...(isProgram ? { program_id: normalizedId } : { course_id: normalizedId }),
194594
+ }, { skip: !open || !username });
194595
+ const item = useMemo(() => {
194596
+ var _a, _b, _c, _d;
194597
+ if (isProgram) {
194598
+ return (_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.programs) === null || _b === void 0 ? void 0 : _b.find((program) => normalizeContentId(program.program_id) === normalizedId);
194599
+ }
194600
+ return (_d = (_c = data === null || data === void 0 ? void 0 : data.data) === null || _c === void 0 ? void 0 : _c.courses) === null || _d === void 0 ? void 0 : _d.find((course) => normalizeContentId(course.course_id) === normalizedId);
194601
+ }, [(_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.courses, (_b = data === null || data === void 0 ? void 0 : data.data) === null || _b === void 0 ? void 0 : _b.programs, isProgram, normalizedId]);
194602
+ const gradeSummary = useMemo(() => {
194603
+ const edx = item === null || item === void 0 ? void 0 : item.edx_progress;
194604
+ return (edx === null || edx === void 0 ? void 0 : edx.grading_policy) ? buildGradeSummary(edx) : null;
194605
+ }, [item]);
194606
+ const loading = isLoading || isFetching;
194607
+ const resolvedName = (item === null || item === void 0 ? void 0 : item.name) || contentName;
194608
+ const percentage = Math.round((_d = (_c = item === null || item === void 0 ? void 0 : item.completion) === null || _c === void 0 ? void 0 : _c.completion_percentage) !== null && _d !== void 0 ? _d : 0);
194609
+ const pieData = [
194610
+ { name: 'Completed', value: percentage },
194611
+ { name: 'Remaining', value: Math.max(0, 100 - percentage) },
194612
+ ];
194613
+ const currentGradePct = fractionToPct((_f = (_e = item === null || item === void 0 ? void 0 : item.edx_progress) === null || _e === void 0 ? void 0 : _e.course_grade) === null || _f === void 0 ? void 0 : _f.percent);
194614
+ const passingPct = getPassingPct((_h = (_g = item === null || item === void 0 ? void 0 : item.edx_progress) === null || _g === void 0 ? void 0 : _g.grading_policy) === null || _h === void 0 ? void 0 : _h.grade_range);
194615
+ return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsxs(DialogContent, { className: "max-w-2xl max-h-[85vh] overflow-y-auto", "aria-label": "Enrolled user progress", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: userName || username || 'Learner progress' }), jsxs(DialogDescription, { children: [email ? `${email} · ` : '', resolvedName || (isProgram ? 'Program progress' : 'Course progress')] })] }), loading ? (jsx("div", { className: "flex items-center justify-center py-12", children: jsx("div", { className: "text-sm text-gray-500", children: "Loading..." }) })) : !item ? (jsx(EmptyStats, { title: "No progress data available" })) : (jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "relative mx-auto", style: { width: 220, height: 220 }, children: [jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsx(PieChart, { children: jsxs(Pie, { data: pieData, dataKey: "value", cx: "50%", cy: "50%", innerRadius: 75, outerRadius: 100, startAngle: 90, endAngle: -270, stroke: "none", isAnimationActive: false, children: [jsx(Cell, { fill: COMPLETED_COLOR }), jsx(Cell, { fill: REMAINING_COLOR })] }) }) }), jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none", children: [jsxs("span", { className: "text-3xl font-bold text-gray-700", children: [percentage, "%"] }), jsx("span", { className: "text-sm text-gray-500", children: "completed" })] })] }), jsxs("div", { className: "divide-y divide-[oklch(0.922_0_0)]", children: [jsx(DetailRow, { label: "Status", children: jsx("span", { className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${((_j = item.completion) === null || _j === void 0 ? void 0 : _j.passed)
194616
+ ? 'bg-green-50 text-green-700'
194617
+ : 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow, { label: "Passed on", children: formatDate((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow, { label: "Enrollment date", children: formatDate((_o = (_m = item.enrollment) === null || _m === void 0 ? void 0 : _m.started) !== null && _o !== void 0 ? _o : (_p = item.enrollment) === null || _p === void 0 ? void 0 : _p.created) })] }), ((_s = (_r = (_q = item.edx_progress) === null || _q === void 0 ? void 0 : _q.grading_policy) === null || _r === void 0 ? void 0 : _r.assignment_policies) === null || _s === void 0 ? void 0 : _s.length) ? (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "rounded-lg border p-4", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grades" }), jsx("p", { className: "text-xs text-gray-500", children: "This represents the weighted grade against the grade needed to pass this course." }), jsx(GradeBar, { currentPct: currentGradePct, passingPct: passingPct })] }), jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-4 py-3", children: [jsx(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), jsxs("span", { className: "text-sm font-medium text-gray-800", children: ["A weighted grade of ", passingPct, "% is required to pass in this course"] })] }), jsxs("div", { className: "rounded-lg border p-4 space-y-3", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grade summary" }), jsx("div", { className: "overflow-x-auto", children: jsxs("table", { className: "w-full border-collapse text-sm", children: [jsx("thead", { children: jsxs("tr", { className: "bg-amber-50 text-[11px] uppercase tracking-wide text-gray-600", children: [jsx("th", { className: "px-3 py-2 text-left font-medium", children: "Assignment type" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weight" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Grade" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weighted grade" })] }) }), jsxs("tbody", { children: [gradeSummary === null || gradeSummary === void 0 ? void 0 : gradeSummary.rows.map((row, index) => (jsxs("tr", { className: index % 2 === 0 ? '' : 'bg-gray-50', children: [jsxs("td", { className: "px-3 py-2 text-gray-800", children: [row.type, row.footnote ? (jsx("sup", { className: "ml-0.5 text-amber-500", children: row.footnote })) : null] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.weightPct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.gradePct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right font-semibold text-amber-600", children: [row.weightedGradePct, "%"] })] }, row.type))), jsxs("tr", { className: "border-l-2 border-amber-400 bg-amber-50", children: [jsx("td", { className: "px-3 py-2 font-medium text-gray-800", colSpan: 3, children: "Current weighted grade summary" }), jsxs("td", { className: "px-3 py-2 text-right font-bold text-amber-600", children: [currentGradePct, "%"] })] })] })] }) }), gradeSummary && gradeSummary.footnotes.length > 0 ? (jsx("div", { className: "space-y-1", children: gradeSummary.footnotes.map((note, index) => (jsxs("p", { className: "text-xs text-gray-500", children: [jsx("sup", { className: "text-amber-500", children: index + 1 }), " ", note] }, note))) })) : null] })] })) : null] }))] }) }));
194618
+ }
194619
+ function DetailRow({ label, children }) {
194620
+ return (jsxs("div", { className: "flex items-center justify-between gap-4 py-2", children: [jsx("span", { className: "text-sm text-gray-500", children: label }), jsx("span", { className: "text-sm font-medium text-gray-900 text-right", children: children })] }));
194621
+ }
194622
+
194468
194623
  // Utility function to format time spent (in minutes) to readable format
194469
- const formatTimeSpent$1 = (minutes) => {
194624
+ const formatTimeSpent = (minutes) => {
194470
194625
  if (minutes < 60) {
194471
194626
  return `${minutes}m`;
194472
194627
  }
@@ -194475,16 +194630,47 @@ const formatTimeSpent$1 = (minutes) => {
194475
194630
  return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
194476
194631
  };
194477
194632
  function AnalyticsCourseDetail({ tenantKey, mentorId, selectedMentorId, courseId, courseName, onBack, }) {
194478
- var _a;
194633
+ var _a, _b;
194479
194634
  const currentMentorId = selectedMentorId || mentorId;
194480
- const { courseDetailStats, isLoading, courseEnrollments } = useCourses({
194635
+ const { courseDetailStats, isLoading, courseEnrollments, courseEnrollmentsSearch, handleCourseEnrollmentsSearchInputChange, setCourseEnrollmentsPage, courseEnrollmentsPagination, courseInfo, } = useCourses({
194481
194636
  tenantKey,
194482
194637
  mentorId: currentMentorId,
194483
194638
  courseId,
194484
194639
  });
194485
- return (jsxs("div", { className: "space-y-8", children: [onBack && (jsxs(Button$1, { variant: "ghost", onClick: onBack, className: "mb-4", "aria-label": "Go back to courses list", children: [jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Back to Courses"] })), courseName && (jsx("div", { className: "mb-4", children: jsx("h2", { className: "text-2xl font-semibold text-gray-900", children: courseName }) })), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Enrollments", value: courseDetailStats.active_enrollments, percentage: courseDetailStats.active_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Completed Enrollments", value: courseDetailStats.completed_enrollments, percentage: courseDetailStats.completed_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Time Spent", value: formatTimeSpent$1(courseDetailStats.time_spent), percentage: courseDetailStats.time_spent_percentage })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(Card, { className: "w-full bg-white shadow-xs", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Course enrollments table", children: [jsx("h3", { className: "text-base font-medium text-gray-700 mb-4", children: "Enrolled Users" }), ((_a = courseEnrollments === null || courseEnrollments === void 0 ? void 0 : courseEnrollments.enrollments) === null || _a === void 0 ? void 0 : _a.length) && courseEnrollments.enrollments.length > 0 ? (jsx("div", { className: "rounded-md overflow-x-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Time Spent" }), jsx(TableHead, { className: "text-right", children: "Progress" }), jsx(TableHead, { className: "text-right", children: "Grade" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: courseEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { className: `h-[48px] ${index % 2 === 0 ? 'bg-gray-50' : ''}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: formatTimeSpent$1(enrollment.time_spent) }), jsxs(TableCell, { className: "text-right", children: [enrollment.progress, "%"] }), jsx(TableCell, { className: "text-right", children: typeof enrollment.grade === 'number'
194486
- ? enrollment.grade.toFixed(1)
194487
- : enrollment.grade }), jsx(TableCell, { className: "text-right", children: new Date(enrollment.last_active_on).toLocaleDateString() })] }, index))) })] }) })) : (jsx(EmptyStats, { title: "No enrollments available" }))] }) }) })] }));
194640
+ const [selectedEnrollment, setSelectedEnrollment] = useState(null);
194641
+ const resolvedCourseName = courseName || (courseInfo === null || courseInfo === void 0 ? void 0 : courseInfo.name);
194642
+ return (jsxs("div", { className: "space-y-8", children: [(onBack || resolvedCourseName) && (jsxs("div", { className: "mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-4", children: [jsx("div", { className: "flex flex-1 justify-start", children: onBack && (jsxs(Button$1, { variant: "ghost", onClick: onBack, "aria-label": "Go back to courses list", children: [jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Back to Courses"] })) }), resolvedCourseName && (jsx("h2", { className: "flex-1 truncate text-left text-2xl font-medium text-gray-700 sm:text-center", children: resolvedCourseName })), jsx("div", { className: "hidden flex-1 sm:block" })] })), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Enrollments", value: courseDetailStats.active_enrollments, percentage: courseDetailStats.active_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Completed Enrollments", value: courseDetailStats.completed_enrollments, percentage: courseDetailStats.completed_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Time Spent", value: formatTimeSpent(courseDetailStats.time_spent), percentage: courseDetailStats.time_spent_percentage })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(Card, { className: "w-full bg-white shadow-xs", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Course enrollments table", children: [jsx("h3", { className: "text-base font-medium text-gray-700 mb-4", children: "Enrolled Users" }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "relative flex-1 w-full", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { id: "search-enrolled-user", type: "text", placeholder: "Search by name or email...", value: courseEnrollmentsSearch, onChange: handleCourseEnrollmentsSearchInputChange, className: "pl-9 border-gray-300 focus:bg-transparent focus:color-transparent h-11", "aria-label": "Search enrolled users" })] }), isLoading ? (jsx("div", { className: "flex items-center justify-center py-8", children: jsx("div", { className: "text-sm text-gray-500", children: "Loading..." }) })) : ((_a = courseEnrollments === null || courseEnrollments === void 0 ? void 0 : courseEnrollments.enrollments) === null || _a === void 0 ? void 0 : _a.length) &&
194643
+ courseEnrollments.enrollments.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "rounded-md overflow-x-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Enrollment Date" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: courseEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { className: `cursor-pointer hover:bg-muted/50 h-[48px] ${index % 2 === 0 ? 'bg-gray-50' : ''}`, onClick: () => setSelectedEnrollment(enrollment), role: "button", tabIndex: 0, onKeyDown: (e) => {
194644
+ if (e.key === 'Enter' || e.key === ' ') {
194645
+ e.preventDefault();
194646
+ setSelectedEnrollment(enrollment);
194647
+ }
194648
+ }, "aria-label": `View course progress for ${enrollment.name}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: enrollment.enrollment_date
194649
+ ? new Date(enrollment.enrollment_date).toLocaleDateString()
194650
+ : '—' }), jsx(TableCell, { className: "text-right", children: enrollment.last_active_on
194651
+ ? new Date(enrollment.last_active_on).toLocaleDateString()
194652
+ : '—' })] }, index))) })] }) }), courseEnrollmentsPagination && courseEnrollmentsPagination.total_pages > 1 && (jsxs("div", { className: "flex items-center justify-center space-x-2 py-4", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setCourseEnrollmentsPage(1), disabled: courseEnrollmentsPagination.current_page === 1, "aria-label": "Go to first page", children: [jsx("span", { className: "sr-only", children: "Go to first page" }), jsx(ChevronsLeft, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setCourseEnrollmentsPage(courseEnrollmentsPagination.current_page - 1), disabled: courseEnrollmentsPagination.current_page === 1, "aria-label": "Go to previous page", children: [jsx("span", { className: "sr-only", children: "Go to previous page" }), jsx(ChevronLeft, { className: "h-4 w-4" })] }), Array.from({ length: courseEnrollmentsPagination.total_pages }, (_, i) => i + 1)
194653
+ .filter((page) => {
194654
+ const current = courseEnrollmentsPagination.current_page;
194655
+ const total = courseEnrollmentsPagination.total_pages;
194656
+ return (page === 1 ||
194657
+ page === total ||
194658
+ (page >= current - 1 && page <= current + 1));
194659
+ })
194660
+ .map((page, index, array) => {
194661
+ const prevPage = array[index - 1];
194662
+ const showEllipsis = prevPage && page - prevPage > 1;
194663
+ return (jsxs(React__default.Fragment, { children: [showEllipsis && jsx("span", { className: "px-2 text-gray-500", children: "..." }), jsx(Button$1, { variant: "outline", size: "sm", className: `h-8 w-8 p-3 !w-auto !inline-flex ${page === courseEnrollmentsPagination.current_page
194664
+ ? 'bg-blue-50 text-blue-600'
194665
+ : 'bg-transparent'}`, onClick: () => setCourseEnrollmentsPage(page), "aria-label": `Go to page ${page}`, "aria-current": page === courseEnrollmentsPagination.current_page
194666
+ ? 'page'
194667
+ : undefined, children: page })] }, page));
194668
+ }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setCourseEnrollmentsPage(courseEnrollmentsPagination.current_page + 1), disabled: courseEnrollmentsPagination.current_page ===
194669
+ courseEnrollmentsPagination.total_pages, "aria-label": "Go to next page", children: [jsx("span", { className: "sr-only", children: "Go to next page" }), jsx(ChevronRight, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setCourseEnrollmentsPage(courseEnrollmentsPagination.total_pages), disabled: courseEnrollmentsPagination.current_page ===
194670
+ courseEnrollmentsPagination.total_pages, "aria-label": "Go to last page", children: [jsx("span", { className: "sr-only", children: "Go to last page" }), jsx(ChevronsRight, { className: "h-4 w-4" })] })] }))] })) : (jsx(EmptyStats, { title: "No enrollments available" }))] })] }) }) }), jsx(EnrolledUserProgressModal, { open: !!selectedEnrollment, onOpenChange: (isOpen) => {
194671
+ if (!isOpen)
194672
+ setSelectedEnrollment(null);
194673
+ }, username: (_b = selectedEnrollment === null || selectedEnrollment === void 0 ? void 0 : selectedEnrollment.username) !== null && _b !== void 0 ? _b : '', userName: selectedEnrollment === null || selectedEnrollment === void 0 ? void 0 : selectedEnrollment.name, email: selectedEnrollment === null || selectedEnrollment === void 0 ? void 0 : selectedEnrollment.email, contentId: courseId, contentName: resolvedCourseName, metric: "course", tenantKey: tenantKey })] }));
194488
194674
  }
194489
194675
 
194490
194676
  // Utility function to format date to YYYY-MM-DD
@@ -194507,6 +194693,11 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
194507
194693
  const [programsListSearch, setProgramsListSearch] = useState('');
194508
194694
  const [debouncedSearch, setDebouncedSearch] = useState('');
194509
194695
  const isInitialMount = React__default.useRef(true);
194696
+ const [programEnrollmentsPage, setProgramEnrollmentsPage] = useState(1);
194697
+ const [programEnrollmentsLimit] = useState(20);
194698
+ const [programEnrollmentsSearch, setProgramEnrollmentsSearch] = useState('');
194699
+ const [debouncedProgramEnrollmentsSearch, setDebouncedProgramEnrollmentsSearch] = useState('');
194700
+ const isInitialMountProgramEnrollments = React__default.useRef(true);
194510
194701
  // Debounce search input
194511
194702
  useEffect(() => {
194512
194703
  // Skip debounce on initial mount
@@ -194520,9 +194711,24 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
194520
194711
  }, 300);
194521
194712
  return () => clearTimeout(timer);
194522
194713
  }, [programsListSearch]);
194714
+ // Debounce program enrollments search input
194715
+ useEffect(() => {
194716
+ if (isInitialMountProgramEnrollments.current) {
194717
+ isInitialMountProgramEnrollments.current = false;
194718
+ return;
194719
+ }
194720
+ const timer = setTimeout(() => {
194721
+ setDebouncedProgramEnrollmentsSearch(programEnrollmentsSearch);
194722
+ setProgramEnrollmentsPage(1);
194723
+ }, 300);
194724
+ return () => clearTimeout(timer);
194725
+ }, [programEnrollmentsSearch]);
194523
194726
  const handleSearchInputChange = (e) => {
194524
194727
  setProgramsListSearch(e.target.value);
194525
194728
  };
194729
+ const handleProgramEnrollmentsSearchInputChange = (e) => {
194730
+ setProgramEnrollmentsSearch(e.target.value);
194731
+ };
194526
194732
  // Prepare params for content analytics query (programs list and stats)
194527
194733
  const contentAnalyticsParams = useMemo(() => {
194528
194734
  var _a, _b;
@@ -194559,11 +194765,22 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
194559
194765
  include_overtime: true,
194560
194766
  platform_key: tenantKey,
194561
194767
  mentor_unique_id: mentorId,
194562
- limit: 20,
194563
- page: 1,
194768
+ limit: programEnrollmentsLimit,
194769
+ page: programEnrollmentsPage,
194770
+ ...(debouncedProgramEnrollmentsSearch && {
194771
+ search: debouncedProgramEnrollmentsSearch,
194772
+ }),
194564
194773
  }
194565
194774
  : null;
194566
- }, [programId, timeSpentStatsDateFilter, tenantKey, mentorId]);
194775
+ }, [
194776
+ programId,
194777
+ timeSpentStatsDateFilter,
194778
+ tenantKey,
194779
+ mentorId,
194780
+ programEnrollmentsLimit,
194781
+ programEnrollmentsPage,
194782
+ debouncedProgramEnrollmentsSearch,
194783
+ ]);
194567
194784
  // Query for programs list and summary
194568
194785
  const { data: contentAnalyticsData, isLoading: isLoadingContentAnalytics, isFetching: isFetchingContentAnalytics, } = useGetContentAnalyticsQuery(contentAnalyticsParams);
194569
194786
  // Query for program details (only when programId is provided)
@@ -194617,15 +194834,15 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
194617
194834
  const programDetailStats = useMemo(() => {
194618
194835
  if (!programDetailsData) {
194619
194836
  return {
194620
- active_users: 0,
194621
194837
  enrollments: 0,
194622
- time_spent: 0,
194838
+ active_enrollments: 0,
194839
+ completed_enrollments: 0,
194623
194840
  };
194624
194841
  }
194625
194842
  return {
194626
- active_users: programDetailsData.summary.totals.active_users || 0,
194627
- enrollments: programDetailsData.summary.totals.total_enrollments || 0,
194628
- time_spent: programDetailsData.summary.totals.total_time_spent || 0,
194843
+ enrollments: programDetailsData.summary.totals.enrollments || 0,
194844
+ active_enrollments: programDetailsData.summary.totals.active_enrollments || 0,
194845
+ completed_enrollments: programDetailsData.summary.totals.completed_enrollments || 0,
194629
194846
  };
194630
194847
  }, [programDetailsData]);
194631
194848
  // Map time spent overtime data
@@ -194648,11 +194865,13 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
194648
194865
  }
194649
194866
  return {
194650
194867
  enrollments: programDetailsData.learners.map((learner) => ({
194868
+ username: learner.username,
194651
194869
  name: learner.name,
194652
194870
  email: learner.email,
194653
194871
  time_spent: 0, // This might need to be calculated or come from another field
194654
194872
  progress: learner.completion_percentage || 0,
194655
194873
  grade: learner.rating || 'N/A',
194874
+ enrollment_date: learner.enrollment_date,
194656
194875
  last_active_on: learner.last_activity,
194657
194876
  })),
194658
194877
  total: programDetailsData.pagination.count,
@@ -194679,6 +194898,12 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
194679
194898
  programsListSearch,
194680
194899
  handleSearchInputChange,
194681
194900
  programsPagination: contentAnalyticsData === null || contentAnalyticsData === void 0 ? void 0 : contentAnalyticsData.pagination,
194901
+ programInfo: programDetailsData === null || programDetailsData === void 0 ? void 0 : programDetailsData.content_info,
194902
+ programEnrollmentsPage,
194903
+ setProgramEnrollmentsPage,
194904
+ programEnrollmentsSearch,
194905
+ handleProgramEnrollmentsSearchInputChange,
194906
+ programEnrollmentsPagination: programDetailsData === null || programDetailsData === void 0 ? void 0 : programDetailsData.pagination,
194682
194907
  };
194683
194908
  };
194684
194909
 
@@ -194714,7 +194939,7 @@ function AnalyticsPrograms({ tenantKey, mentorId, selectedMentorId, basePath = '
194714
194939
  const handleProgramClick = (programId) => {
194715
194940
  router.push(`${basePath}/programs/${programId}`);
194716
194941
  };
194717
- return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Programs", value: programStats.active_programs, percentage: programStats.active_programs_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Programs", value: programStats.total_programs, percentage: programStats.total_programs_percentage }), jsx(StatCard, { loading: isLoading, title: "Enrollments", value: programStats.enrollments, percentage: programStats.enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Learners", value: programStats.total_learners })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Program Overtime", label: "Time Spent", filters: enrollmentStatsDateFilter, setOutsideFilters: setEnrollmentStatsDateFilter, children: ((_a = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(LineChart, { data: ((_c = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
194942
+ return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Programs", value: programStats.active_programs, percentage: programStats.active_programs_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Programs", value: programStats.total_programs, percentage: programStats.total_programs_percentage }), jsx(StatCard, { loading: isLoading, title: "Enrollments", value: programStats.enrollments, percentage: programStats.enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Total Learners", value: programStats.total_learners })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(ChartCardWrapper, { title: "Program Overtime", label: "Time Spent", filters: enrollmentStatsDateFilter, setOutsideFilters: setEnrollmentStatsDateFilter, children: isLoading ? (jsx(ChartLoading, {})) : ((_a = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _a === void 0 ? void 0 : _a.length) && ((_b = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxs(LineChart, { data: ((_c = enrollmentStats === null || enrollmentStats === void 0 ? void 0 : enrollmentStats.points) === null || _c === void 0 ? void 0 : _c.map((point) => ({
194718
194943
  date: formatDateToShortFormat(point.date, enrollmentStatsDateFilter.activeFilter === 'today'),
194719
194944
  value: formatSecondsToHours(point.value),
194720
194945
  rawSeconds: point.value,
@@ -194753,27 +194978,48 @@ function AnalyticsPrograms({ tenantKey, mentorId, selectedMentorId, basePath = '
194753
194978
  }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setProgramsListPage(programsPagination.current_page + 1), disabled: programsPagination.current_page === programsPagination.total_pages, "aria-label": "Go to next page", children: [jsx("span", { className: "sr-only", children: "Go to next page" }), jsx(ChevronRight, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setProgramsListPage(programsPagination.total_pages), disabled: programsPagination.current_page === programsPagination.total_pages, "aria-label": "Go to last page", children: [jsx("span", { className: "sr-only", children: "Go to last page" }), jsx(ChevronsRight, { className: "h-4 w-4" })] })] }))] })) : (jsx(EmptyStats, { title: "No programs available" }))] })] }) }) })] }));
194754
194979
  }
194755
194980
 
194756
- // Utility function to format time spent (in minutes) to readable format
194757
- const formatTimeSpent = (minutes) => {
194758
- if (minutes < 60) {
194759
- return `${minutes}m`;
194760
- }
194761
- const hours = Math.floor(minutes / 60);
194762
- const mins = minutes % 60;
194763
- return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
194764
- };
194765
194981
  function AnalyticsProgramDetail({ tenantKey, mentorId, selectedMentorId, programId, programName, onBack, }) {
194766
- var _a;
194982
+ var _a, _b;
194767
194983
  const currentMentorId = selectedMentorId || mentorId;
194768
- const { programDetailStats, isLoading, programEnrollments } = usePrograms({
194984
+ const { programDetailStats, isLoading, programEnrollments, programEnrollmentsSearch, handleProgramEnrollmentsSearchInputChange, setProgramEnrollmentsPage, programEnrollmentsPagination, programInfo, } = usePrograms({
194769
194985
  tenantKey,
194770
194986
  mentorId: currentMentorId,
194771
194987
  programId,
194772
194988
  });
194773
- return (jsxs("div", { className: "space-y-8", children: [onBack && (jsxs(Button$1, { variant: "ghost", onClick: onBack, className: "mb-4", "aria-label": "Go back to programs list", children: [jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Back to Programs"] })), programName && (jsx("div", { className: "mb-4", children: jsx("h2", { className: "text-2xl font-semibold text-gray-900", children: programName }) })), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Users", value: programDetailStats.active_users, percentage: programDetailStats.active_users_percentage }), jsx(StatCard, { loading: isLoading, title: "Enrollments", value: programDetailStats.enrollments, percentage: programDetailStats.enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Time Spent", value: formatTimeSpent(programDetailStats.time_spent) })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(Card, { className: "w-full bg-white shadow-xs", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Program enrollments table", children: [jsx("h3", { className: "text-base font-medium text-gray-700 mb-4", children: "Enrolled Users" }), ((_a = programEnrollments === null || programEnrollments === void 0 ? void 0 : programEnrollments.enrollments) === null || _a === void 0 ? void 0 : _a.length) &&
194774
- programEnrollments.enrollments.length > 0 ? (jsx("div", { className: "rounded-md overflow-x-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Time Spent" }), jsx(TableHead, { className: "text-right", children: "Progress" }), jsx(TableHead, { className: "text-right", children: "Grade" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: programEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { className: `h-[48px] ${index % 2 === 0 ? 'bg-gray-50' : ''}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: formatTimeSpent(enrollment.time_spent) }), jsxs(TableCell, { className: "text-right", children: [enrollment.progress, "%"] }), jsx(TableCell, { className: "text-right", children: typeof enrollment.grade === 'number'
194775
- ? enrollment.grade.toFixed(1)
194776
- : enrollment.grade }), jsx(TableCell, { className: "text-right", children: new Date(enrollment.last_active_on).toLocaleDateString() })] }, index))) })] }) })) : (jsx(EmptyStats, { title: "No enrollments available" }))] }) }) })] }));
194989
+ const [selectedEnrollment, setSelectedEnrollment] = useState(null);
194990
+ const resolvedProgramName = programName || (programInfo === null || programInfo === void 0 ? void 0 : programInfo.name);
194991
+ return (jsxs("div", { className: "space-y-8", children: [(onBack || resolvedProgramName) && (jsxs("div", { className: "mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-4", children: [jsx("div", { className: "flex flex-1 justify-start", children: onBack && (jsxs(Button$1, { variant: "ghost", onClick: onBack, "aria-label": "Go back to programs list", children: [jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Back to Programs"] })) }), resolvedProgramName && (jsx("h2", { className: "flex-1 truncate text-left text-2xl font-medium text-gray-700 sm:text-center", children: resolvedProgramName })), jsx("div", { className: "hidden flex-1 sm:block" })] })), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Total Enrollments", value: programDetailStats.enrollments, percentage: programDetailStats.enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Active Enrollments", value: programDetailStats.active_enrollments, percentage: programDetailStats.active_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Completed Enrollments", value: programDetailStats.completed_enrollments, percentage: programDetailStats.completed_enrollments_percentage })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(Card, { className: "w-full bg-white shadow-xs", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Program enrollments table", children: [jsx("h3", { className: "text-base font-medium text-gray-700 mb-4", children: "Enrolled Users" }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "relative flex-1 w-full", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { id: "search-enrolled-user", type: "text", placeholder: "Search by name or email...", value: programEnrollmentsSearch, onChange: handleProgramEnrollmentsSearchInputChange, className: "pl-9 border-gray-300 focus:bg-transparent focus:color-transparent h-11", "aria-label": "Search enrolled users" })] }), isLoading ? (jsx("div", { className: "flex items-center justify-center py-8", children: jsx("div", { className: "text-sm text-gray-500", children: "Loading..." }) })) : ((_a = programEnrollments === null || programEnrollments === void 0 ? void 0 : programEnrollments.enrollments) === null || _a === void 0 ? void 0 : _a.length) &&
194992
+ programEnrollments.enrollments.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "rounded-md overflow-x-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Enrollment Date" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: programEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { className: `cursor-pointer hover:bg-muted/50 h-[48px] ${index % 2 === 0 ? 'bg-gray-50' : ''}`, onClick: () => setSelectedEnrollment(enrollment), role: "button", tabIndex: 0, onKeyDown: (e) => {
194993
+ if (e.key === 'Enter' || e.key === ' ') {
194994
+ e.preventDefault();
194995
+ setSelectedEnrollment(enrollment);
194996
+ }
194997
+ }, "aria-label": `View program progress for ${enrollment.name}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: enrollment.enrollment_date
194998
+ ? new Date(enrollment.enrollment_date).toLocaleDateString()
194999
+ : '—' }), jsx(TableCell, { className: "text-right", children: enrollment.last_active_on
195000
+ ? new Date(enrollment.last_active_on).toLocaleDateString()
195001
+ : '—' })] }, index))) })] }) }), programEnrollmentsPagination && programEnrollmentsPagination.total_pages > 1 && (jsxs("div", { className: "flex items-center justify-center space-x-2 py-4", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setProgramEnrollmentsPage(1), disabled: programEnrollmentsPagination.current_page === 1, "aria-label": "Go to first page", children: [jsx("span", { className: "sr-only", children: "Go to first page" }), jsx(ChevronsLeft, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setProgramEnrollmentsPage(programEnrollmentsPagination.current_page - 1), disabled: programEnrollmentsPagination.current_page === 1, "aria-label": "Go to previous page", children: [jsx("span", { className: "sr-only", children: "Go to previous page" }), jsx(ChevronLeft, { className: "h-4 w-4" })] }), Array.from({ length: programEnrollmentsPagination.total_pages }, (_, i) => i + 1)
195002
+ .filter((page) => {
195003
+ const current = programEnrollmentsPagination.current_page;
195004
+ const total = programEnrollmentsPagination.total_pages;
195005
+ return (page === 1 ||
195006
+ page === total ||
195007
+ (page >= current - 1 && page <= current + 1));
195008
+ })
195009
+ .map((page, index, array) => {
195010
+ const prevPage = array[index - 1];
195011
+ const showEllipsis = prevPage && page - prevPage > 1;
195012
+ return (jsxs(React__default.Fragment, { children: [showEllipsis && jsx("span", { className: "px-2 text-gray-500", children: "..." }), jsx(Button$1, { variant: "outline", size: "sm", className: `h-8 w-8 p-3 !w-auto !inline-flex ${page === programEnrollmentsPagination.current_page
195013
+ ? 'bg-blue-50 text-blue-600'
195014
+ : 'bg-transparent'}`, onClick: () => setProgramEnrollmentsPage(page), "aria-label": `Go to page ${page}`, "aria-current": page === programEnrollmentsPagination.current_page
195015
+ ? 'page'
195016
+ : undefined, children: page })] }, page));
195017
+ }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setProgramEnrollmentsPage(programEnrollmentsPagination.current_page + 1), disabled: programEnrollmentsPagination.current_page ===
195018
+ programEnrollmentsPagination.total_pages, "aria-label": "Go to next page", children: [jsx("span", { className: "sr-only", children: "Go to next page" }), jsx(ChevronRight, { className: "h-4 w-4" })] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-2 !w-auto !inline-flex bg-transparent", onClick: () => setProgramEnrollmentsPage(programEnrollmentsPagination.total_pages), disabled: programEnrollmentsPagination.current_page ===
195019
+ programEnrollmentsPagination.total_pages, "aria-label": "Go to last page", children: [jsx("span", { className: "sr-only", children: "Go to last page" }), jsx(ChevronsRight, { className: "h-4 w-4" })] })] }))] })) : (jsx(EmptyStats, { title: "No enrollments available" }))] })] }) }) }), jsx(EnrolledUserProgressModal, { open: !!selectedEnrollment, onOpenChange: (isOpen) => {
195020
+ if (!isOpen)
195021
+ setSelectedEnrollment(null);
195022
+ }, username: (_b = selectedEnrollment === null || selectedEnrollment === void 0 ? void 0 : selectedEnrollment.username) !== null && _b !== void 0 ? _b : '', userName: selectedEnrollment === null || selectedEnrollment === void 0 ? void 0 : selectedEnrollment.name, email: selectedEnrollment === null || selectedEnrollment === void 0 ? void 0 : selectedEnrollment.email, contentId: programId, contentName: resolvedProgramName, metric: "program", tenantKey: tenantKey })] }));
194777
195023
  }
194778
195024
 
194779
195025
  const AnalyticsSettingsContext = createContext({});
@@ -204173,5 +204419,5 @@ var trainOrDeleteModal = /*#__PURE__*/Object.freeze({
204173
204419
  TrainOrDeleteModal: TrainOrDeleteModal
204174
204420
  });
204175
204421
 
204176
- export { ACCESS_COURSE_LABEL, AccessTimeHeatmap, AccessiblePaginate, AddMentorToProjectModal, AddSkillDialog, Admin, AdvancedTab, AgentConfigPrompts, AgentSkills, AlertsTab, AnalyticsAuditLogStats, AnalyticsCourseDetail, AnalyticsCourses, AnalyticsFinancialStats, AnalyticsLayout, AnalyticsMonetizationStats, AnalyticsOverview, AnalyticsProgramDetail, AnalyticsPrograms, AnalyticsReportDownload, AnalyticsReports, AnalyticsSettingsProvider, AnalyticsTopicsStats, AnalyticsTranscriptsStats, AnalyticsUsersStats, AppleRestrictionModal, BUY_NOW_LABEL, BillingTab, CREATE_AGENT_LABELS, CategorizedDropdownMenu, ChartCardWrapper, ChartFiltersProvider, ChatContext, ChatPrivacyToggle, ChatProvider, CompanyDialog, ConnectorManagementDialog, CopyButtonIcon, CourseAccessGuard, CourseCardSkeleton, CourseContentLoading, CourseOutline, CourseOutlineContext, CourseOutlineDrawer, CreateAgentForm, CreateAgentModal, CreateProjectModal, CreateWorkflowModal, CredentialBox, CredentialMiniBoxSkeleton, CreditBalance, CustomDateRangePicker, CustomTooltip, DEFAULT_SYSTEM_CONTROL_REQUIRED_SIZE_GB, DefaultEmptyBox, DeleteProjectModal, DeleteWorkflowModal, DiscoverContentCard, DiscoverFacetsFilter, DiscoverFilterDrawer, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ENROLL_NOW_COURSE_STARTING_SOON_LABEL, ENROLL_NOW_LABEL, EditAlertDialog, EducationBox, EducationDialog, EducationTab, EdxIframeContext, EmptyStats, ExperienceBox, ExperienceDialog, ExperienceTab, FacetFilterContext, Footer, GHOST_OS_REPO_URL, GHOST_OS_TAURI_COMMANDS, GHOST_OS_TAURI_EVENTS, GroupsFilterDropdown, INVITATION_ONLY_LABEL, InstitutionDialog, IntegrationsTab, InviteUserContent, InviteUserDialog, InvitedUsersDialog, LOCAL_MODELS, Loader, LocalLLMTab, LocalModelsContent, LoginButton, MACOS_PERMISSIONS_COMMANDS, Markdown, MinimumMentorAlert, MonetizationTab, NotificationDisplay, NotificationDropdown, ONBOARDING_SECTORS, OnboardingShell, OnboardingWizard, PaywallModal, Profile, ProfileTimeChart, ProgressDots, ProjectActionButtons, ProjectFilesModal, ProjectInstructionsModal, ProjectLandingPage, ProjectMentorsList, ProjectsPage, REQUEST_ACCESS_COURSE_STARTING_SOON_LABEL, REQUEST_ACCESS_LABEL, RenameProjectModal, ResumeBox, ResumeTab, RichTextEditor, SandboxConfig, SearchableMultiSelect, SendNotificationDialog, SignupButton, SkeletonActivityStatBox, SkeletonAddSkillsLoading, SkeletonCreatePathwaySearchList, SkeletonDiscoverFilterBox, SkeletonEducationBox, SkeletonMultiplier, SkeletonPathwayBox, SkeletonProfileInfoCard, SkeletonSkillBox, SkillBox, SkillDetailModal, SkillLeaderboardChart, SkillsBox, Spinner, StatCard, StepHeader, SystemControlContent, SystemControlTab, TAURI_COMMANDS, TAURI_EVENTS, TenantSwitcher, TimeFilter, TimeTrackingProvider, TimedExam, ToolDialogs, TopBanner, UpgradePackageModal, UserAvatar, Version, WorkflowSidebar, addBookmarksTab, findLastResumeBlock, findSequentialParent, flattenVerticalBlocks, getFirstAvailableUnit, getLocalLLMModel, getLocalLLMToolSupport, getNextUnitIframe, getOrg, getParentBlockById, getParentsInfosFromSublessonId, getPreviousUnitIframe, getRandomCourseImage, getSectorById, getTenant, getUnitToIframe, getUserId, getUserName, inBrowserPrint, inIframe, initialGhostOsInstallState, initialModelDownloadState, isLocalLLMEnabled, isSystemControlEnabled, isTauriApp, components as markdownComponents, modelSupportsSystemControl, onboardingPrimaryButtonClass, onboardingSecondaryButtonClass, resolveCreateAgentLabels, sanitizeCss, setLocalLLMEnabled, setLocalLLMModel, setLocalLLMToolSupport, setSystemControlEnabled, smallestSystemControlModel, useAnalyticsSettings, useAuditLog, useCatalogSearch, useChartFilters, useChatPrivacy, useChatState, useCourseDetail, useCourseMetadata, useCourses, useDiscover, useEdxIframe, useFinancial, useGhostOs, useIframeMessageHandler, useLocalStorage, useModelDownload, useMonetization, useOverview, useProfileActivityStats, useProfileCredentials, useProfilePathways, useProfilePrograms, useProfileSkills, useProfileTimeSpent, usePrograms, useReports, useTauri, useTimeTracking, useTopics, useTranscripts, useUserCourses, useUserMetadata, useUsers };
204422
+ export { ACCESS_COURSE_LABEL, AccessTimeHeatmap, AccessiblePaginate, AddMentorToProjectModal, AddSkillDialog, Admin, AdvancedTab, AgentConfigPrompts, AgentSkills, AlertsTab, AnalyticsAuditLogStats, AnalyticsCourseDetail, AnalyticsCourses, AnalyticsFinancialStats, AnalyticsLayout, AnalyticsMonetizationStats, AnalyticsOverview, AnalyticsProgramDetail, AnalyticsPrograms, AnalyticsReportDownload, AnalyticsReports, AnalyticsSettingsProvider, AnalyticsTopicsStats, AnalyticsTranscriptsStats, AnalyticsUsersStats, AppleRestrictionModal, BUY_NOW_LABEL, BillingTab, CREATE_AGENT_LABELS, CategorizedDropdownMenu, ChartCardWrapper, ChartFiltersProvider, ChartLoading, ChatContext, ChatPrivacyToggle, ChatProvider, CompanyDialog, ConnectorManagementDialog, CopyButtonIcon, CourseAccessGuard, CourseCardSkeleton, CourseContentLoading, CourseOutline, CourseOutlineContext, CourseOutlineDrawer, CreateAgentForm, CreateAgentModal, CreateProjectModal, CreateWorkflowModal, CredentialBox, CredentialMiniBoxSkeleton, CreditBalance, CustomDateRangePicker, CustomTooltip, DEFAULT_SYSTEM_CONTROL_REQUIRED_SIZE_GB, DefaultEmptyBox, DeleteProjectModal, DeleteWorkflowModal, DiscoverContentCard, DiscoverFacetsFilter, DiscoverFilterDrawer, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ENROLL_NOW_COURSE_STARTING_SOON_LABEL, ENROLL_NOW_LABEL, EditAlertDialog, EducationBox, EducationDialog, EducationTab, EdxIframeContext, EmptyStats, ExperienceBox, ExperienceDialog, ExperienceTab, FacetFilterContext, Footer, GHOST_OS_REPO_URL, GHOST_OS_TAURI_COMMANDS, GHOST_OS_TAURI_EVENTS, GroupsFilterDropdown, INVITATION_ONLY_LABEL, InstitutionDialog, IntegrationsTab, InviteUserContent, InviteUserDialog, InvitedUsersDialog, LOCAL_MODELS, Loader, LocalLLMTab, LocalModelsContent, LoginButton, MACOS_PERMISSIONS_COMMANDS, Markdown, MinimumMentorAlert, MonetizationTab, NotificationDisplay, NotificationDropdown, ONBOARDING_SECTORS, OnboardingShell, OnboardingWizard, PaywallModal, Profile, ProfileTimeChart, ProgressDots, ProjectActionButtons, ProjectFilesModal, ProjectInstructionsModal, ProjectLandingPage, ProjectMentorsList, ProjectsPage, REQUEST_ACCESS_COURSE_STARTING_SOON_LABEL, REQUEST_ACCESS_LABEL, RenameProjectModal, ResumeBox, ResumeTab, RichTextEditor, SandboxConfig, SearchableMultiSelect, SendNotificationDialog, SignupButton, SkeletonActivityStatBox, SkeletonAddSkillsLoading, SkeletonCreatePathwaySearchList, SkeletonDiscoverFilterBox, SkeletonEducationBox, SkeletonMultiplier, SkeletonPathwayBox, SkeletonProfileInfoCard, SkeletonSkillBox, SkillBox, SkillDetailModal, SkillLeaderboardChart, SkillsBox, Spinner, StatCard, StepHeader, SystemControlContent, SystemControlTab, TAURI_COMMANDS, TAURI_EVENTS, TenantSwitcher, TimeFilter, TimeTrackingProvider, TimedExam, ToolDialogs, TopBanner, UpgradePackageModal, UserAvatar, Version, WorkflowSidebar, addBookmarksTab, findLastResumeBlock, findSequentialParent, flattenVerticalBlocks, getFirstAvailableUnit, getLocalLLMModel, getLocalLLMToolSupport, getNextUnitIframe, getOrg, getParentBlockById, getParentsInfosFromSublessonId, getPreviousUnitIframe, getRandomCourseImage, getSectorById, getTenant, getUnitToIframe, getUserId, getUserName, inBrowserPrint, inIframe, initialGhostOsInstallState, initialModelDownloadState, isLocalLLMEnabled, isSystemControlEnabled, isTauriApp, components as markdownComponents, modelSupportsSystemControl, onboardingPrimaryButtonClass, onboardingSecondaryButtonClass, resolveCreateAgentLabels, sanitizeCss, setLocalLLMEnabled, setLocalLLMModel, setLocalLLMToolSupport, setSystemControlEnabled, smallestSystemControlModel, useAnalyticsSettings, useAuditLog, useCatalogSearch, useChartFilters, useChatPrivacy, useChatState, useCourseDetail, useCourseMetadata, useCourses, useDiscover, useEdxIframe, useFinancial, useGhostOs, useIframeMessageHandler, useLocalStorage, useModelDownload, useMonetization, useOverview, useProfileActivityStats, useProfileCredentials, useProfilePathways, useProfilePrograms, useProfileSkills, useProfileTimeSpent, usePrograms, useReports, useTauri, useTimeTracking, useTopics, useTranscripts, useUserCourses, useUserMetadata, useUsers };
204177
204423
  //# sourceMappingURL=index.esm.js.map