@iblai/iblai-js 2.20.0 → 2.22.0

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.
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useRef, useEffect, useMemo, useCallback, useState, createContext, useContext, forwardRef, createElement as createElement$1, useLayoutEffect, useReducer, useImperativeHandle, isValidElement, Children, PureComponent, cloneElement, Component, Fragment as Fragment$2, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
3
3
  import * as dataLayer from '@iblai/data-layer';
4
- import { useGetLlmsQuery, useCreateSessionIdMutation, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useUserLlmUsageSummary, useUserLlmSpendOverTime, useUserLlmCostByModel, useUserLlmCostByService, useUserLlmRecentActivity, USER_LLM_RECENT_ACTIVITY_PAGE_SIZE, useUserLlmTraceObservations, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useGetVectorDocumentsQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, VERCEL_SPA, useGetCustomDomainsQuery, useGetHostingProjectsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useCreateHostingProjectDomainMutation, useUpdateHostingDomainMutation, useDeleteHostingDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, USER_PROGRESS_DATA_POINTS, useResetTemplateMutation, useSendTestTemplateEmailMutation, useUpdateTemplateMutation, useGetTemplateDetailsQuery, USER_PROGRESS_SUMMARY_TYPE, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetLlmUsageTracesQuery, useGetLlmUsageObservationsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetModelCostsQuery, useGetPerUserCostsQuery, useGetTenantCostQuery, useGetAgentCostQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useGetMentorPublicSettingsQuery, useGetReportsQuery, useCreateReportMutation, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useGetPlatformAuditLogsQuery, PLATFORM_AUDIT_EVENT_TYPES, PLATFORM_AUDIT_ACTION_CODES, useGetMentorMemoriesQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetApplicationStatusQuery, useListOwnApplicationsQuery, useGetApplicationFormQuery, useWithdrawApplicationMutation, useRenewApplicationMutation, useCreateApplicationDraftMutation, useSubmitApplicationMutation, useUpdateApplicationMutation, useUploadApplicationAttachmentMutation, useDeleteApplicationAttachmentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
4
+ import { useGetLlmsQuery, useCreateSessionIdMutation, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerCourseOutlineQuery, getSections, findResumeBlock, flattenOutline, normalizeLearnerCompletionError, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useUserLlmUsageSummary, useUserLlmSpendOverTime, useUserLlmCostByModel, useUserLlmCostByService, useUserLlmRecentActivity, USER_LLM_RECENT_ACTIVITY_PAGE_SIZE, useUserLlmTraceObservations, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useGetVectorDocumentsQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, VERCEL_SPA, useGetCustomDomainsQuery, useGetHostingProjectsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useCreateHostingProjectDomainMutation, useUpdateHostingDomainMutation, useDeleteHostingDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, USER_PROGRESS_DATA_POINTS, useResetTemplateMutation, useSendTestTemplateEmailMutation, useUpdateTemplateMutation, useGetTemplateDetailsQuery, USER_PROGRESS_SUMMARY_TYPE, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetLlmUsageTracesQuery, useGetLlmUsageObservationsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetModelCostsQuery, useGetPerUserCostsQuery, useGetTenantCostQuery, useGetAgentCostQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useGetMentorPublicSettingsQuery, useGetReportsQuery, useCreateReportMutation, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useGetPlatformAuditLogsQuery, PLATFORM_AUDIT_EVENT_TYPES, PLATFORM_AUDIT_ACTION_CODES, useGetMentorMemoriesQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetApplicationStatusQuery, useListOwnApplicationsQuery, useGetApplicationFormQuery, useWithdrawApplicationMutation, useRenewApplicationMutation, useCreateApplicationDraftMutation, useSubmitApplicationMutation, useUpdateApplicationMutation, useUploadApplicationAttachmentMutation, useDeleteApplicationAttachmentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
5
5
  import { useDispatch, useSelector } from 'react-redux';
6
- import { selectSessionId, selectActiveChatMessages, useCachedSessionId, chatActions, LOCAL_STORAGE_KEYS, TimeTracker, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, isPureWatcher, getInitials, useTenantMetadata, useUsername, selectStreaming, isLoggedIn, TOOL_NAME_MAP, WRITE_TODOS_TOOL, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, getVisibleAnalyticsTabs, getUserName as getUserName$2, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, WATCHER_HIDDEN_REPORTS, canViewPlatformAuditLogs, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, selectNumberOfActiveChatMessages, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, chatInputSliceActions, removeFile, WithFormPermissions, MENTOR_VISIBILITY } from '@iblai/web-utils';
6
+ import { selectSessionId, selectActiveChatMessages, useCachedSessionId, chatActions, LOCAL_STORAGE_KEYS, TimeTracker, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, isPureWatcher, getInitials, useTenantMetadata, useUsername, selectStreaming, isLoggedIn, TOOL_NAME_MAP, WRITE_TODOS_TOOL, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, getVisibleAnalyticsTabs, canViewMonetizationAnalytics, getUserName as getUserName$2, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, WATCHER_HIDDEN_REPORTS, canViewPlatformAuditLogs, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, selectNumberOfActiveChatMessages, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, chatInputSliceActions, removeFile, WithFormPermissions, MENTOR_VISIBILITY } from '@iblai/web-utils';
7
7
  import { toast } from 'sonner';
8
8
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
9
9
  import * as ReactDOM from 'react-dom';
@@ -2325,6 +2325,8 @@ var analyticsAnalyticsMonetizationStats$3 = {
2325
2325
  tableHeadPlan: "Plan",
2326
2326
  tableHeadAmount: "Amount",
2327
2327
  tableHeadStatus: "Status",
2328
+ tableHeadUser: "User",
2329
+ tableHeadSubscribed: "Subscribed",
2328
2330
  subscriberCountTotal: "{count} subscriber{plural} total",
2329
2331
  previous: "Previous",
2330
2332
  pageLabel: "Page {page}",
@@ -3916,6 +3918,7 @@ var disclaimersTabLabels$3 = {
3916
3918
  title: "Disclaimers",
3917
3919
  description: "Configure disclaimer settings for your agent."
3918
3920
  },
3921
+ infoBox: "Show your users the fine print. Add notices — like 'This is an AI assistant' or a compliance statement — that appear in the chat so people know what to expect.",
3919
3922
  userAgreement: {
3920
3923
  title: "User Agreement",
3921
3924
  tooltip: "Controls User Agreement",
@@ -3936,7 +3939,8 @@ var disclaimersTabLabels$3 = {
3936
3939
  edit: "Edit",
3937
3940
  save: "Save",
3938
3941
  saving: "Saving...",
3939
- cancel: "Cancel"
3942
+ cancel: "Cancel",
3943
+ viewAgreements: "View Agreements"
3940
3944
  },
3941
3945
  toasts: {
3942
3946
  advisorySuccess: "Agent updated successfully",
@@ -3946,6 +3950,20 @@ var disclaimersTabLabels$3 = {
3946
3950
  userAgreementEnabled: "User agreement enabled successfully",
3947
3951
  userAgreementDisabled: "User agreement disabled successfully",
3948
3952
  toggleError: "Failed to update user agreement"
3953
+ },
3954
+ agreements: {
3955
+ title: "Agreements",
3956
+ dialogDescription: "Users who have accepted this agent's User Agreement.",
3957
+ totalAgreements: "{count} Total Agreements",
3958
+ summaryDescription: "Review the users who have accepted this agent's User Agreement. Each entry shows the user's name, email and when they agreed. Users who haven't accepted yet aren't listed. Search matches the exact username.",
3959
+ searchPlaceholder: "Search by username",
3960
+ searchAriaLabel: "Search agreements by username",
3961
+ columnUser: "User",
3962
+ columnAgreedAt: "Agreed at",
3963
+ empty: "No agreements yet",
3964
+ emptyDescription: "Users who accept the User Agreement will appear here with the time they agreed.",
3965
+ noMatches: "No users match your search",
3966
+ noMatchesDescription: "Search matches the exact username — try the full username."
3949
3967
  }
3950
3968
  };
3951
3969
  var documentSidebar$3 = {
@@ -9630,6 +9648,8 @@ var analyticsAnalyticsMonetizationStats$2 = {
9630
9648
  tableHeadPlan: "Plan",
9631
9649
  tableHeadAmount: "Montant",
9632
9650
  tableHeadStatus: "Statut",
9651
+ tableHeadUser: "Utilisateur",
9652
+ tableHeadSubscribed: "Abonné le",
9633
9653
  subscriberCountTotal: "{count} abonné{plural} au total",
9634
9654
  previous: "Précédent",
9635
9655
  pageLabel: "Page {page}",
@@ -11387,6 +11407,7 @@ var disclaimersTabLabels$2 = {
11387
11407
  title: "Avertissements",
11388
11408
  description: "Configurez les paramètres d'avertissement pour votre agent."
11389
11409
  },
11410
+ infoBox: "Affichez les mentions légales à vos utilisateurs. Ajoutez des avis — comme « Ceci est un assistant IA » ou une déclaration de conformité — qui apparaissent dans la conversation pour que les gens sachent à quoi s'attendre.",
11390
11411
  userAgreement: {
11391
11412
  title: "Accord utilisateur",
11392
11413
  tooltip: "Contrôle l'accord utilisateur",
@@ -11407,7 +11428,8 @@ var disclaimersTabLabels$2 = {
11407
11428
  edit: "Modifier",
11408
11429
  save: "Enregistrer",
11409
11430
  saving: "Enregistrement...",
11410
- cancel: "Annuler"
11431
+ cancel: "Annuler",
11432
+ viewAgreements: "Voir les acceptations"
11411
11433
  },
11412
11434
  toasts: {
11413
11435
  advisorySuccess: "Agent mis à jour avec succès",
@@ -11417,6 +11439,20 @@ var disclaimersTabLabels$2 = {
11417
11439
  userAgreementEnabled: "Accord utilisateur activé avec succès",
11418
11440
  userAgreementDisabled: "Accord utilisateur désactivé avec succès",
11419
11441
  toggleError: "Échec de la mise à jour de l'accord utilisateur"
11442
+ },
11443
+ agreements: {
11444
+ title: "Acceptations",
11445
+ dialogDescription: "Utilisateurs ayant accepté l'Accord utilisateur de cet agent.",
11446
+ totalAgreements: "{count} acceptations au total",
11447
+ summaryDescription: "Consultez les utilisateurs ayant accepté l'Accord utilisateur de cet agent. Chaque entrée indique le nom et l'e-mail de l'utilisateur ainsi que la date de son acceptation. Les utilisateurs qui ne l'ont pas encore accepté n'apparaissent pas. La recherche correspond au nom d'utilisateur exact.",
11448
+ searchPlaceholder: "Rechercher par nom d'utilisateur",
11449
+ searchAriaLabel: "Rechercher les acceptations par nom d'utilisateur",
11450
+ columnUser: "Utilisateur",
11451
+ columnAgreedAt: "Accepté le",
11452
+ empty: "Aucune acceptation pour le moment",
11453
+ emptyDescription: "Les utilisateurs qui acceptent l'Accord utilisateur apparaîtront ici avec l'heure de leur acceptation.",
11454
+ noMatches: "Aucun utilisateur ne correspond à votre recherche",
11455
+ noMatchesDescription: "La recherche correspond au nom d'utilisateur exact : essayez le nom d'utilisateur complet."
11420
11456
  }
11421
11457
  };
11422
11458
  var documentSidebar$2 = {
@@ -16935,6 +16971,8 @@ var analyticsAnalyticsMonetizationStats$1 = {
16935
16971
  tableHeadPlan: "Plan",
16936
16972
  tableHeadAmount: "Monto",
16937
16973
  tableHeadStatus: "Estado",
16974
+ tableHeadUser: "Usuario",
16975
+ tableHeadSubscribed: "Suscrito el",
16938
16976
  subscriberCountTotal: "{count} suscriptor{plural} en total",
16939
16977
  previous: "Anterior",
16940
16978
  pageLabel: "Página {page}",
@@ -18692,6 +18730,7 @@ var disclaimersTabLabels$1 = {
18692
18730
  title: "Avisos legales",
18693
18731
  description: "Configure los ajustes de aviso legal para su agente."
18694
18732
  },
18733
+ infoBox: "Muestra la letra pequeña a tus usuarios. Agrega avisos —como «Este es un asistente de IA» o una declaración de cumplimiento— que aparecen en el chat para que las personas sepan qué esperar.",
18695
18734
  userAgreement: {
18696
18735
  title: "Acuerdo de usuario",
18697
18736
  tooltip: "Controla el acuerdo de usuario",
@@ -18712,7 +18751,8 @@ var disclaimersTabLabels$1 = {
18712
18751
  edit: "Editar",
18713
18752
  save: "Guardar",
18714
18753
  saving: "Guardando...",
18715
- cancel: "Cancelar"
18754
+ cancel: "Cancelar",
18755
+ viewAgreements: "Ver aceptaciones"
18716
18756
  },
18717
18757
  toasts: {
18718
18758
  advisorySuccess: "Agente actualizado correctamente",
@@ -18722,6 +18762,20 @@ var disclaimersTabLabels$1 = {
18722
18762
  userAgreementEnabled: "Acuerdo de usuario habilitado correctamente",
18723
18763
  userAgreementDisabled: "Acuerdo de usuario deshabilitado correctamente",
18724
18764
  toggleError: "Error al actualizar el acuerdo de usuario"
18765
+ },
18766
+ agreements: {
18767
+ title: "Aceptaciones",
18768
+ dialogDescription: "Usuarios que han aceptado el Acuerdo de usuario de este agente.",
18769
+ totalAgreements: "{count} aceptaciones en total",
18770
+ summaryDescription: "Revisa los usuarios que han aceptado el Acuerdo de usuario de este agente. Cada entrada muestra el nombre y el correo electrónico del usuario y cuándo lo aceptó. Los usuarios que aún no lo han aceptado no aparecen. La búsqueda coincide con el nombre de usuario exacto.",
18771
+ searchPlaceholder: "Buscar por nombre de usuario",
18772
+ searchAriaLabel: "Buscar aceptaciones por nombre de usuario",
18773
+ columnUser: "Usuario",
18774
+ columnAgreedAt: "Aceptado el",
18775
+ empty: "Aún no hay aceptaciones",
18776
+ emptyDescription: "Los usuarios que acepten el Acuerdo de usuario aparecerán aquí con la hora en que lo aceptaron.",
18777
+ noMatches: "Ningún usuario coincide con tu búsqueda",
18778
+ noMatchesDescription: "La búsqueda coincide con el nombre de usuario exacto: prueba con el nombre de usuario completo."
18725
18779
  }
18726
18780
  };
18727
18781
  var documentSidebar$1 = {
@@ -24240,6 +24294,8 @@ var analyticsAnalyticsMonetizationStats = {
24240
24294
  tableHeadPlan: "方案",
24241
24295
  tableHeadAmount: "金额",
24242
24296
  tableHeadStatus: "状态",
24297
+ tableHeadUser: "用户",
24298
+ tableHeadSubscribed: "订阅日期",
24243
24299
  subscriberCountTotal: "共 {count} 位订阅者",
24244
24300
  previous: "上一页",
24245
24301
  pageLabel: "第 {page} 页",
@@ -25997,6 +26053,7 @@ var disclaimersTabLabels = {
25997
26053
  title: "免责声明",
25998
26054
  description: "为您的智能体配置免责声明设置。"
25999
26055
  },
26056
+ infoBox: "向用户展示必要的声明。添加提示——例如“这是一个 AI 助手”或合规声明——它们会显示在对话中,让用户知道会得到什么。",
26000
26057
  userAgreement: {
26001
26058
  title: "用户协议",
26002
26059
  tooltip: "控制用户协议",
@@ -26017,7 +26074,8 @@ var disclaimersTabLabels = {
26017
26074
  edit: "编辑",
26018
26075
  save: "保存",
26019
26076
  saving: "保存中……",
26020
- cancel: "取消"
26077
+ cancel: "取消",
26078
+ viewAgreements: "查看同意记录"
26021
26079
  },
26022
26080
  toasts: {
26023
26081
  advisorySuccess: "智能体更新成功",
@@ -26027,6 +26085,20 @@ var disclaimersTabLabels = {
26027
26085
  userAgreementEnabled: "用户协议已成功启用",
26028
26086
  userAgreementDisabled: "用户协议已成功停用",
26029
26087
  toggleError: "更新用户协议失败"
26088
+ },
26089
+ agreements: {
26090
+ title: "同意记录",
26091
+ dialogDescription: "已接受此智能体用户协议的用户。",
26092
+ totalAgreements: "共 {count} 条同意记录",
26093
+ summaryDescription: "查看已接受此智能体用户协议的用户。每条记录显示用户的姓名、邮箱和同意时间。尚未接受的用户不会列出。搜索需与用户名完全匹配。",
26094
+ searchPlaceholder: "按用户名搜索",
26095
+ searchAriaLabel: "按用户名搜索同意记录",
26096
+ columnUser: "用户",
26097
+ columnAgreedAt: "同意时间",
26098
+ empty: "尚无同意记录",
26099
+ emptyDescription: "接受用户协议的用户将与其同意时间一起显示在此处。",
26100
+ noMatches: "没有匹配的用户",
26101
+ noMatchesDescription: "搜索需与用户名完全匹配,请尝试输入完整的用户名。"
26030
26102
  }
26031
26103
  };
26032
26104
  var documentSidebar = {
@@ -145911,7 +145983,205 @@ const EmptyStats = ({ title = 'No data available' }) => {
145911
145983
  return (jsx("div", { className: "flex justify-center items-center h-full", children: jsx("p", { className: "text-gray-500 text-sm", children: title }) }));
145912
145984
  };
145913
145985
 
145914
- const COMPLETED_COLOR = '#ED8936';
145986
+ var COLLAPSIBLE_NAME = "Collapsible";
145987
+ var [createCollapsibleContext] = createContextScope$1(COLLAPSIBLE_NAME);
145988
+ var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
145989
+ var Collapsible$1 = React.forwardRef(
145990
+ (props, forwardedRef) => {
145991
+ const {
145992
+ __scopeCollapsible,
145993
+ open: openProp,
145994
+ defaultOpen,
145995
+ disabled,
145996
+ onOpenChange,
145997
+ ...collapsibleProps
145998
+ } = props;
145999
+ const [open, setOpen] = useControllableState$2({
146000
+ prop: openProp,
146001
+ defaultProp: defaultOpen ?? false,
146002
+ onChange: onOpenChange,
146003
+ caller: COLLAPSIBLE_NAME
146004
+ });
146005
+ return /* @__PURE__ */ jsx(
146006
+ CollapsibleProvider,
146007
+ {
146008
+ scope: __scopeCollapsible,
146009
+ disabled,
146010
+ contentId: useId$1(),
146011
+ open,
146012
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
146013
+ children: /* @__PURE__ */ jsx(
146014
+ Primitive$4.div,
146015
+ {
146016
+ "data-state": getState$3(open),
146017
+ "data-disabled": disabled ? "" : void 0,
146018
+ ...collapsibleProps,
146019
+ ref: forwardedRef
146020
+ }
146021
+ )
146022
+ }
146023
+ );
146024
+ }
146025
+ );
146026
+ Collapsible$1.displayName = COLLAPSIBLE_NAME;
146027
+ var TRIGGER_NAME$3 = "CollapsibleTrigger";
146028
+ var CollapsibleTrigger$1 = React.forwardRef(
146029
+ (props, forwardedRef) => {
146030
+ const { __scopeCollapsible, ...triggerProps } = props;
146031
+ const context = useCollapsibleContext(TRIGGER_NAME$3, __scopeCollapsible);
146032
+ return /* @__PURE__ */ jsx(
146033
+ Primitive$4.button,
146034
+ {
146035
+ type: "button",
146036
+ "aria-controls": context.contentId,
146037
+ "aria-expanded": context.open || false,
146038
+ "data-state": getState$3(context.open),
146039
+ "data-disabled": context.disabled ? "" : void 0,
146040
+ disabled: context.disabled,
146041
+ ...triggerProps,
146042
+ ref: forwardedRef,
146043
+ onClick: composeEventHandlers$2(props.onClick, context.onOpenToggle)
146044
+ }
146045
+ );
146046
+ }
146047
+ );
146048
+ CollapsibleTrigger$1.displayName = TRIGGER_NAME$3;
146049
+ var CONTENT_NAME$4 = "CollapsibleContent";
146050
+ var CollapsibleContent$1 = React.forwardRef(
146051
+ (props, forwardedRef) => {
146052
+ const { forceMount, ...contentProps } = props;
146053
+ const context = useCollapsibleContext(CONTENT_NAME$4, props.__scopeCollapsible);
146054
+ return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
146055
+ }
146056
+ );
146057
+ CollapsibleContent$1.displayName = CONTENT_NAME$4;
146058
+ var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
146059
+ const { __scopeCollapsible, present, children, ...contentProps } = props;
146060
+ const context = useCollapsibleContext(CONTENT_NAME$4, __scopeCollapsible);
146061
+ const [isPresent, setIsPresent] = React.useState(present);
146062
+ const ref = React.useRef(null);
146063
+ const composedRefs = useComposedRefs$1(forwardedRef, ref);
146064
+ const heightRef = React.useRef(0);
146065
+ const height = heightRef.current;
146066
+ const widthRef = React.useRef(0);
146067
+ const width = widthRef.current;
146068
+ const isOpen = context.open || isPresent;
146069
+ const isMountAnimationPreventedRef = React.useRef(isOpen);
146070
+ const originalStylesRef = React.useRef(void 0);
146071
+ React.useEffect(() => {
146072
+ const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
146073
+ return () => cancelAnimationFrame(rAF);
146074
+ }, []);
146075
+ useLayoutEffect2$1(() => {
146076
+ const node = ref.current;
146077
+ if (node) {
146078
+ originalStylesRef.current = originalStylesRef.current || {
146079
+ transitionDuration: node.style.transitionDuration,
146080
+ animationName: node.style.animationName
146081
+ };
146082
+ node.style.transitionDuration = "0s";
146083
+ node.style.animationName = "none";
146084
+ const rect = node.getBoundingClientRect();
146085
+ heightRef.current = rect.height;
146086
+ widthRef.current = rect.width;
146087
+ if (!isMountAnimationPreventedRef.current) {
146088
+ node.style.transitionDuration = originalStylesRef.current.transitionDuration;
146089
+ node.style.animationName = originalStylesRef.current.animationName;
146090
+ }
146091
+ setIsPresent(present);
146092
+ }
146093
+ }, [context.open, present]);
146094
+ return /* @__PURE__ */ jsx(
146095
+ Primitive$4.div,
146096
+ {
146097
+ "data-state": getState$3(context.open),
146098
+ "data-disabled": context.disabled ? "" : void 0,
146099
+ id: context.contentId,
146100
+ hidden: !isOpen,
146101
+ ...contentProps,
146102
+ ref: composedRefs,
146103
+ style: {
146104
+ [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
146105
+ [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
146106
+ ...props.style
146107
+ },
146108
+ children: isOpen && children
146109
+ }
146110
+ );
146111
+ });
146112
+ function getState$3(open) {
146113
+ return open ? "open" : "closed";
146114
+ }
146115
+ var Root$5 = Collapsible$1;
146116
+
146117
+ const Collapsible = Root$5;
146118
+ const CollapsibleTrigger = CollapsibleTrigger$1;
146119
+ const CollapsibleContent = CollapsibleContent$1;
146120
+
146121
+ const BAR_COLOR$1 = 'var(--color-amber-500, #f59e0b)';
146122
+ const ERROR_MESSAGES = {
146123
+ forbidden: 'Completion breakdown is not available for this learner.',
146124
+ not_enrolled: 'This learner is not enrolled in this course.',
146125
+ unavailable: 'Could not load the completion breakdown. Please try again later.',
146126
+ unauthorized: 'Completion breakdown is not available for this learner.',
146127
+ invalid_request: 'Completion breakdown is not available for this course.',
146128
+ unknown: 'Could not load the completion breakdown.',
146129
+ };
146130
+ // Backend values are already rounded to 2 decimals; show whole numbers
146131
+ // unless the value is fractional (e.g. 33.33).
146132
+ const formatPct = (value) => {
146133
+ const pct = value !== null && value !== void 0 ? value : 0;
146134
+ return `${Number.isInteger(pct) ? pct : pct.toFixed(2).replace(/\.?0+$/, '')}%`;
146135
+ };
146136
+ function CompletionBar({ value, label }) {
146137
+ const clamped = Math.min(Math.max(value, 0), 100);
146138
+ return (jsx("span", { className: "block h-1.5 w-full rounded-full bg-gray-200", role: "progressbar", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": clamped, children: jsx("span", { className: "block h-1.5 rounded-full", style: { width: `${clamped}%`, backgroundColor: BAR_COLOR$1 } }) }));
146139
+ }
146140
+ function SubsectionRow({ block }) {
146141
+ return (jsxs("li", { className: "space-y-1 py-2", children: [jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsxs("span", { className: "flex min-w-0 items-center gap-1.5 text-sm text-gray-700", children: [jsx("span", { className: "truncate", children: block.display_name }), block.special_exam_info ? (jsxs("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-gray-100 px-2 py-0.5 text-[11px] text-gray-600", children: [jsx(Clock, { className: "h-3 w-3", "aria-hidden": "true" }), block.special_exam_info.short_description] })) : null] }), jsx("span", { className: "shrink-0 text-xs font-medium text-gray-600", children: formatPct(block.completion_percentage) })] }), jsx(CompletionBar, { value: block.completion_percentage, label: `${block.display_name} completion` })] }));
146142
+ }
146143
+ function SectionRow({ block }) {
146144
+ var _a;
146145
+ const [open, setOpen] = useState(false);
146146
+ const subsections = (_a = block.children) !== null && _a !== void 0 ? _a : [];
146147
+ return (jsx(Collapsible, { open: open, onOpenChange: setOpen, asChild: true, children: jsxs("li", { className: "py-2.5", children: [jsxs(CollapsibleTrigger, { className: "flex w-full items-center gap-2 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 disabled:cursor-default", disabled: subsections.length === 0, children: [jsx(ChevronRight, { className: `h-4 w-4 shrink-0 text-gray-400 transition-transform ${open ? 'rotate-90' : ''} ${subsections.length === 0 ? 'invisible' : ''}`, "aria-hidden": "true" }), jsxs("span", { className: "block min-w-0 flex-1 space-y-1.5", children: [jsxs("span", { className: "flex items-center justify-between gap-3", children: [jsxs("span", { className: "flex min-w-0 items-center gap-1.5 text-sm font-medium text-gray-900", children: [jsx("span", { className: "truncate", children: block.display_name }), block.complete ? (jsx(CircleCheck, { className: "h-4 w-4 shrink-0 text-green-600", "aria-label": "Complete" })) : null] }), jsx("span", { className: "shrink-0 text-sm font-semibold text-gray-700", children: formatPct(block.completion_percentage) })] }), jsx(CompletionBar, { value: block.completion_percentage, label: `${block.display_name} completion` })] })] }), subsections.length > 0 ? (jsx(CollapsibleContent, { children: jsx("ul", { className: "ml-6 mt-1 divide-y divide-gray-100", children: subsections.map((subsection) => (jsx(SubsectionRow, { block: subsection }, subsection.id))) }) })) : null] }) }));
146148
+ }
146149
+ /**
146150
+ * Per-section completion for one learner in one course, from the DM
146151
+ * completion outline. Percentages come from the backend as-is.
146152
+ */
146153
+ function CourseCompletionBreakdown({ username, courseId, tenantKey, skip = false, }) {
146154
+ const { data, error, isLoading, isFetching, refetch } = useGetLearnerCourseOutlineQuery({ username, course_id: courseId, platform_key: tenantKey }, { skip: skip || !username || !courseId || !tenantKey });
146155
+ const sections = useMemo(() => (data ? getSections(data) : []), [data]);
146156
+ const resumePath = useMemo(() => {
146157
+ if (!data)
146158
+ return null;
146159
+ const resume = findResumeBlock(data);
146160
+ if (!resume || resume.id === data.id)
146161
+ return null;
146162
+ const entry = flattenOutline(data).find(({ block }) => block.id === resume.id);
146163
+ // Drop the course name; the modal header already shows it.
146164
+ return entry ? entry.path.slice(1).join(' › ') : null;
146165
+ }, [data]);
146166
+ const normalizedError = normalizeLearnerCompletionError(error);
146167
+ let body;
146168
+ if (isLoading || (isFetching && !data)) {
146169
+ body = jsx("p", { className: "py-4 text-sm text-gray-500", children: "Loading completion breakdown..." });
146170
+ }
146171
+ else if (normalizedError) {
146172
+ body = (jsxs("div", { className: "flex items-center justify-between gap-3 py-2", children: [jsx("p", { className: "text-sm text-gray-500", children: ERROR_MESSAGES[normalizedError.kind] }), normalizedError.retryable ? (jsx(Button$1, { variant: "outline", size: "sm", onClick: () => refetch(), disabled: isFetching, children: "Retry" })) : null] }));
146173
+ }
146174
+ else if (sections.length === 0) {
146175
+ body = jsx("p", { className: "py-2 text-sm text-gray-500", children: "No sections in this course yet." });
146176
+ }
146177
+ else {
146178
+ body = (jsxs(Fragment$1, { children: [resumePath ? (jsxs("p", { className: "text-xs text-gray-500", children: ["Last visited: ", jsx("span", { className: "font-medium text-gray-700", children: resumePath })] })) : null, jsx("ul", { className: "divide-y divide-[oklch(0.922_0_0)]", children: sections.map((section) => (jsx(SectionRow, { block: section.block }, section.id))) })] }));
146179
+ }
146180
+ return (jsxs("section", { className: "space-y-2 rounded-lg border p-4", style: { borderColor: 'oklch(.922 0 0)' }, "aria-labelledby": "completion-breakdown-heading", children: [jsxs("div", { children: [jsx("h4", { id: "completion-breakdown-heading", className: "text-sm font-semibold text-gray-900", children: "Completion breakdown" }), jsx("p", { className: "text-xs text-gray-500", children: "Progress through each section of this course." })] }), body] }));
146181
+ }
146182
+
146183
+ // Theme token (the same one bg-amber-500 resolves to), with Tailwind's default as fallback.
146184
+ const COMPLETED_COLOR = 'var(--color-amber-500, #f59e0b)';
145915
146185
  const REMAINING_COLOR = '#E5E7EB';
145916
146186
  const formatDate$2 = (value) => {
145917
146187
  if (!value)
@@ -146017,7 +146287,7 @@ function EnrolledUserProgressModal({ open, onOpenChange, username, userName, ema
146017
146287
  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);
146018
146288
  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$1, { 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)
146019
146289
  ? 'bg-green-50 text-green-700'
146020
- : 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow$1, { label: "Passed on", children: formatDate$2((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow$1, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow$1, { label: "Enrollment date", children: formatDate$2((_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] }))] }) }));
146290
+ : 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow$1, { label: "Passed on", children: formatDate$2((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow$1, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow$1, { label: "Enrollment date", children: formatDate$2((_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) })] }), !isProgram ? (jsx(CourseCompletionBreakdown, { username: username, courseId: normalizedId, tenantKey: tenantKey, skip: !open })) : null, ((_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] }))] }) }));
146021
146291
  }
146022
146292
  function DetailRow$1({ label, children }) {
146023
146293
  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 })] }));
@@ -146433,20 +146703,20 @@ var MenuPortal = (props) => {
146433
146703
  return /* @__PURE__ */ jsx(PortalProvider$1, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence$1, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$6, { asChild: true, container, children }) }) });
146434
146704
  };
146435
146705
  MenuPortal.displayName = PORTAL_NAME$3;
146436
- var CONTENT_NAME$4 = "MenuContent";
146437
- var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$4);
146706
+ var CONTENT_NAME$3 = "MenuContent";
146707
+ var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$3);
146438
146708
  var MenuContent = React.forwardRef(
146439
146709
  (props, forwardedRef) => {
146440
- const portalContext = usePortalContext$1(CONTENT_NAME$4, props.__scopeMenu);
146710
+ const portalContext = usePortalContext$1(CONTENT_NAME$3, props.__scopeMenu);
146441
146711
  const { forceMount = portalContext.forceMount, ...contentProps } = props;
146442
- const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
146443
- const rootContext = useMenuRootContext(CONTENT_NAME$4, props.__scopeMenu);
146712
+ const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
146713
+ const rootContext = useMenuRootContext(CONTENT_NAME$3, props.__scopeMenu);
146444
146714
  return /* @__PURE__ */ jsx(Collection$1.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence$1, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection$1.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
146445
146715
  }
146446
146716
  );
146447
146717
  var MenuRootContentModal = React.forwardRef(
146448
146718
  (props, forwardedRef) => {
146449
- const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
146719
+ const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
146450
146720
  const ref = React.useRef(null);
146451
146721
  const composedRefs = useComposedRefs$1(forwardedRef, ref);
146452
146722
  React.useEffect(() => {
@@ -146472,7 +146742,7 @@ var MenuRootContentModal = React.forwardRef(
146472
146742
  }
146473
146743
  );
146474
146744
  var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
146475
- const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
146745
+ const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
146476
146746
  return /* @__PURE__ */ jsx(
146477
146747
  MenuContentImpl,
146478
146748
  {
@@ -146504,8 +146774,8 @@ var MenuContentImpl = React.forwardRef(
146504
146774
  disableOutsideScroll,
146505
146775
  ...contentProps
146506
146776
  } = props;
146507
- const context = useMenuContext(CONTENT_NAME$4, __scopeMenu);
146508
- const rootContext = useMenuRootContext(CONTENT_NAME$4, __scopeMenu);
146777
+ const context = useMenuContext(CONTENT_NAME$3, __scopeMenu);
146778
+ const rootContext = useMenuRootContext(CONTENT_NAME$3, __scopeMenu);
146509
146779
  const popperScope = usePopperScope$1(__scopeMenu);
146510
146780
  const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeMenu);
146511
146781
  const getItems = useCollection$1(__scopeMenu);
@@ -146668,7 +146938,7 @@ var MenuContentImpl = React.forwardRef(
146668
146938
  );
146669
146939
  }
146670
146940
  );
146671
- MenuContent.displayName = CONTENT_NAME$4;
146941
+ MenuContent.displayName = CONTENT_NAME$3;
146672
146942
  var GROUP_NAME$2 = "MenuGroup";
146673
146943
  var MenuGroup = React.forwardRef(
146674
146944
  (props, forwardedRef) => {
@@ -147042,10 +147312,10 @@ MenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
147042
147312
  var SUB_CONTENT_NAME$1 = "MenuSubContent";
147043
147313
  var MenuSubContent = React.forwardRef(
147044
147314
  (props, forwardedRef) => {
147045
- const portalContext = usePortalContext$1(CONTENT_NAME$4, props.__scopeMenu);
147315
+ const portalContext = usePortalContext$1(CONTENT_NAME$3, props.__scopeMenu);
147046
147316
  const { forceMount = portalContext.forceMount, ...subContentProps } = props;
147047
- const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
147048
- const rootContext = useMenuRootContext(CONTENT_NAME$4, props.__scopeMenu);
147317
+ const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
147318
+ const rootContext = useMenuRootContext(CONTENT_NAME$3, props.__scopeMenu);
147049
147319
  const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
147050
147320
  const ref = React.useRef(null);
147051
147321
  const composedRefs = useComposedRefs$1(forwardedRef, ref);
@@ -147197,11 +147467,11 @@ var DropdownMenu$1 = (props) => {
147197
147467
  );
147198
147468
  };
147199
147469
  DropdownMenu$1.displayName = DROPDOWN_MENU_NAME;
147200
- var TRIGGER_NAME$3 = "DropdownMenuTrigger";
147470
+ var TRIGGER_NAME$2 = "DropdownMenuTrigger";
147201
147471
  var DropdownMenuTrigger$1 = React.forwardRef(
147202
147472
  (props, forwardedRef) => {
147203
147473
  const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
147204
- const context = useDropdownMenuContext(TRIGGER_NAME$3, __scopeDropdownMenu);
147474
+ const context = useDropdownMenuContext(TRIGGER_NAME$2, __scopeDropdownMenu);
147205
147475
  const menuScope = useMenuScope(__scopeDropdownMenu);
147206
147476
  return /* @__PURE__ */ jsx(Anchor2$1, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
147207
147477
  Primitive$3.button,
@@ -147232,7 +147502,7 @@ var DropdownMenuTrigger$1 = React.forwardRef(
147232
147502
  ) });
147233
147503
  }
147234
147504
  );
147235
- DropdownMenuTrigger$1.displayName = TRIGGER_NAME$3;
147505
+ DropdownMenuTrigger$1.displayName = TRIGGER_NAME$2;
147236
147506
  var PORTAL_NAME$2 = "DropdownMenuPortal";
147237
147507
  var DropdownMenuPortal$1 = (props) => {
147238
147508
  const { __scopeDropdownMenu, ...portalProps } = props;
@@ -147240,11 +147510,11 @@ var DropdownMenuPortal$1 = (props) => {
147240
147510
  return /* @__PURE__ */ jsx(Portal$1, { ...menuScope, ...portalProps });
147241
147511
  };
147242
147512
  DropdownMenuPortal$1.displayName = PORTAL_NAME$2;
147243
- var CONTENT_NAME$3 = "DropdownMenuContent";
147513
+ var CONTENT_NAME$2 = "DropdownMenuContent";
147244
147514
  var DropdownMenuContent$1 = React.forwardRef(
147245
147515
  (props, forwardedRef) => {
147246
147516
  const { __scopeDropdownMenu, ...contentProps } = props;
147247
- const context = useDropdownMenuContext(CONTENT_NAME$3, __scopeDropdownMenu);
147517
+ const context = useDropdownMenuContext(CONTENT_NAME$2, __scopeDropdownMenu);
147248
147518
  const menuScope = useMenuScope(__scopeDropdownMenu);
147249
147519
  const hasInteractedOutsideRef = React.useRef(false);
147250
147520
  return /* @__PURE__ */ jsx(
@@ -147281,7 +147551,7 @@ var DropdownMenuContent$1 = React.forwardRef(
147281
147551
  );
147282
147552
  }
147283
147553
  );
147284
- DropdownMenuContent$1.displayName = CONTENT_NAME$3;
147554
+ DropdownMenuContent$1.displayName = CONTENT_NAME$2;
147285
147555
  var GROUP_NAME$1 = "DropdownMenuGroup";
147286
147556
  var DropdownMenuGroup$1 = React.forwardRef(
147287
147557
  (props, forwardedRef) => {
@@ -149391,7 +149661,7 @@ function PreviousMonthButton(props) {
149391
149661
  * @group Components
149392
149662
  * @see https://daypicker.dev/guides/custom-components
149393
149663
  */
149394
- function Root$5(props) {
149664
+ function Root$4(props) {
149395
149665
  const { rootRef, ...rest } = props;
149396
149666
  return React__default.createElement("div", { ...rest, ref: rootRef });
149397
149667
  }
@@ -149499,7 +149769,7 @@ var components$1 = /*#__PURE__*/Object.freeze({
149499
149769
  NextMonthButton: NextMonthButton,
149500
149770
  Option: Option,
149501
149771
  PreviousMonthButton: PreviousMonthButton,
149502
- Root: Root$5,
149772
+ Root: Root$4,
149503
149773
  Select: Select,
149504
149774
  Week: Week,
149505
149775
  WeekNumber: WeekNumber,
@@ -151569,11 +151839,11 @@ var PopoverAnchor$1 = React.forwardRef(
151569
151839
  }
151570
151840
  );
151571
151841
  PopoverAnchor$1.displayName = ANCHOR_NAME;
151572
- var TRIGGER_NAME$2 = "PopoverTrigger";
151842
+ var TRIGGER_NAME$1 = "PopoverTrigger";
151573
151843
  var PopoverTrigger$1 = React.forwardRef(
151574
151844
  (props, forwardedRef) => {
151575
151845
  const { __scopePopover, ...triggerProps } = props;
151576
- const context = usePopoverContext(TRIGGER_NAME$2, __scopePopover);
151846
+ const context = usePopoverContext(TRIGGER_NAME$1, __scopePopover);
151577
151847
  const popperScope = usePopperScope(__scopePopover);
151578
151848
  const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
151579
151849
  const trigger = /* @__PURE__ */ jsx(
@@ -151583,7 +151853,7 @@ var PopoverTrigger$1 = React.forwardRef(
151583
151853
  "aria-haspopup": "dialog",
151584
151854
  "aria-expanded": context.open,
151585
151855
  "aria-controls": context.contentId,
151586
- "data-state": getState$3(context.open),
151856
+ "data-state": getState$2(context.open),
151587
151857
  ...triggerProps,
151588
151858
  ref: composedTriggerRef,
151589
151859
  onClick: composeEventHandlers$1(props.onClick, context.onOpenToggle)
@@ -151592,7 +151862,7 @@ var PopoverTrigger$1 = React.forwardRef(
151592
151862
  return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor$1, { asChild: true, ...popperScope, children: trigger });
151593
151863
  }
151594
151864
  );
151595
- PopoverTrigger$1.displayName = TRIGGER_NAME$2;
151865
+ PopoverTrigger$1.displayName = TRIGGER_NAME$1;
151596
151866
  var PORTAL_NAME$1 = "PopoverPortal";
151597
151867
  var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME$1, {
151598
151868
  forceMount: void 0
@@ -151603,20 +151873,20 @@ var PopoverPortal = (props) => {
151603
151873
  return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence$1, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$6, { asChild: true, container, children }) }) });
151604
151874
  };
151605
151875
  PopoverPortal.displayName = PORTAL_NAME$1;
151606
- var CONTENT_NAME$2 = "PopoverContent";
151876
+ var CONTENT_NAME$1 = "PopoverContent";
151607
151877
  var PopoverContent$1 = React.forwardRef(
151608
151878
  (props, forwardedRef) => {
151609
- const portalContext = usePortalContext(CONTENT_NAME$2, props.__scopePopover);
151879
+ const portalContext = usePortalContext(CONTENT_NAME$1, props.__scopePopover);
151610
151880
  const { forceMount = portalContext.forceMount, ...contentProps } = props;
151611
- const context = usePopoverContext(CONTENT_NAME$2, props.__scopePopover);
151881
+ const context = usePopoverContext(CONTENT_NAME$1, props.__scopePopover);
151612
151882
  return /* @__PURE__ */ jsx(Presence$1, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
151613
151883
  }
151614
151884
  );
151615
- PopoverContent$1.displayName = CONTENT_NAME$2;
151885
+ PopoverContent$1.displayName = CONTENT_NAME$1;
151616
151886
  var Slot = createSlot("PopoverContent.RemoveScroll");
151617
151887
  var PopoverContentModal = React.forwardRef(
151618
151888
  (props, forwardedRef) => {
151619
- const context = usePopoverContext(CONTENT_NAME$2, props.__scopePopover);
151889
+ const context = usePopoverContext(CONTENT_NAME$1, props.__scopePopover);
151620
151890
  const contentRef = React.useRef(null);
151621
151891
  const composedRefs = useComposedRefs$1(forwardedRef, contentRef);
151622
151892
  const isRightClickOutsideRef = React.useRef(false);
@@ -151656,7 +151926,7 @@ var PopoverContentModal = React.forwardRef(
151656
151926
  );
151657
151927
  var PopoverContentNonModal = React.forwardRef(
151658
151928
  (props, forwardedRef) => {
151659
- const context = usePopoverContext(CONTENT_NAME$2, props.__scopePopover);
151929
+ const context = usePopoverContext(CONTENT_NAME$1, props.__scopePopover);
151660
151930
  const hasInteractedOutsideRef = React.useRef(false);
151661
151931
  const hasPointerDownOutsideRef = React.useRef(false);
151662
151932
  return /* @__PURE__ */ jsx(
@@ -151708,7 +151978,7 @@ var PopoverContentImpl = React.forwardRef(
151708
151978
  onInteractOutside,
151709
151979
  ...contentProps
151710
151980
  } = props;
151711
- const context = usePopoverContext(CONTENT_NAME$2, __scopePopover);
151981
+ const context = usePopoverContext(CONTENT_NAME$1, __scopePopover);
151712
151982
  const popperScope = usePopperScope(__scopePopover);
151713
151983
  useFocusGuards();
151714
151984
  return /* @__PURE__ */ jsx(
@@ -151732,7 +152002,7 @@ var PopoverContentImpl = React.forwardRef(
151732
152002
  children: /* @__PURE__ */ jsx(
151733
152003
  Content$2,
151734
152004
  {
151735
- "data-state": getState$3(context.open),
152005
+ "data-state": getState$2(context.open),
151736
152006
  role: "dialog",
151737
152007
  id: context.contentId,
151738
152008
  ...popperScope,
@@ -151783,7 +152053,7 @@ var PopoverArrow = React.forwardRef(
151783
152053
  }
151784
152054
  );
151785
152055
  PopoverArrow.displayName = ARROW_NAME;
151786
- function getState$3(open) {
152056
+ function getState$2(open) {
151787
152057
  return open ? "open" : "closed";
151788
152058
  }
151789
152059
  var Root2$2 = Popover$1;
@@ -188491,7 +188761,7 @@ var Checkbox$1 = React.forwardRef(
188491
188761
  role: "checkbox",
188492
188762
  "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
188493
188763
  "aria-required": required,
188494
- "data-state": getState$2(checked),
188764
+ "data-state": getState$1(checked),
188495
188765
  "data-disabled": disabled ? "" : void 0,
188496
188766
  disabled,
188497
188767
  value,
@@ -188536,7 +188806,7 @@ var CheckboxIndicator = React.forwardRef(
188536
188806
  return /* @__PURE__ */ jsx(Presence$3, { present: forceMount || isIndeterminate(context.state) || context.state === true, children: /* @__PURE__ */ jsx(
188537
188807
  Primitive$2.span,
188538
188808
  {
188539
- "data-state": getState$2(context.state),
188809
+ "data-state": getState$1(context.state),
188540
188810
  "data-disabled": context.disabled ? "" : void 0,
188541
188811
  ...indicatorProps,
188542
188812
  ref: forwardedRef,
@@ -188602,14 +188872,14 @@ CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
188602
188872
  function isIndeterminate(checked) {
188603
188873
  return checked === "indeterminate";
188604
188874
  }
188605
- function getState$2(checked) {
188875
+ function getState$1(checked) {
188606
188876
  return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
188607
188877
  }
188608
- var Root$4 = Checkbox$1;
188878
+ var Root$3 = Checkbox$1;
188609
188879
  var Indicator$1 = CheckboxIndicator;
188610
188880
 
188611
- 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" }) }) })));
188612
- Checkbox.displayName = Root$4.displayName;
188881
+ const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$3, { 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" }) }) })));
188882
+ Checkbox.displayName = Root$3.displayName;
188613
188883
 
188614
188884
  function CoursesTab({ tenant, currentPage, itemsPerPage, hasManageUsersPermission = false, }) {
188615
188885
  var _a;
@@ -189583,141 +189853,6 @@ function RetrievedDocumentsButton({ sessionId = '', documents, className, label,
189583
189853
  }, "data-testid": "retrieved-documents-button", children: [jsx(FileText, { className: "h-4 w-4 text-blue-600" }), jsx("span", { children: label !== null && label !== void 0 ? label : t('retrievedDocumentsButton.title') })] }), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { className: "flex max-h-[80vh] flex-col gap-0 p-0 sm:max-w-[425px] md:max-w-[600px]", children: [jsx(DialogHeader, { className: "border-b border-gray-200 px-4 py-2", children: jsxs(DialogTitle, { className: "flex items-center gap-2 text-base font-medium text-[#646464]", children: [jsx(FileText, { className: "h-5 w-5 text-blue-600" }), t('retrievedDocumentsButton.title')] }) }), jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", "data-testid": "retrieved-documents-scroll", children: jsx(DocumentSidebar, { isModal: true, sessionId: sessionId, documents: documents }) })] }) })] }));
189584
189854
  }
189585
189855
 
189586
- var COLLAPSIBLE_NAME = "Collapsible";
189587
- var [createCollapsibleContext] = createContextScope$1(COLLAPSIBLE_NAME);
189588
- var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
189589
- var Collapsible$1 = React.forwardRef(
189590
- (props, forwardedRef) => {
189591
- const {
189592
- __scopeCollapsible,
189593
- open: openProp,
189594
- defaultOpen,
189595
- disabled,
189596
- onOpenChange,
189597
- ...collapsibleProps
189598
- } = props;
189599
- const [open, setOpen] = useControllableState$2({
189600
- prop: openProp,
189601
- defaultProp: defaultOpen ?? false,
189602
- onChange: onOpenChange,
189603
- caller: COLLAPSIBLE_NAME
189604
- });
189605
- return /* @__PURE__ */ jsx(
189606
- CollapsibleProvider,
189607
- {
189608
- scope: __scopeCollapsible,
189609
- disabled,
189610
- contentId: useId$1(),
189611
- open,
189612
- onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
189613
- children: /* @__PURE__ */ jsx(
189614
- Primitive$4.div,
189615
- {
189616
- "data-state": getState$1(open),
189617
- "data-disabled": disabled ? "" : void 0,
189618
- ...collapsibleProps,
189619
- ref: forwardedRef
189620
- }
189621
- )
189622
- }
189623
- );
189624
- }
189625
- );
189626
- Collapsible$1.displayName = COLLAPSIBLE_NAME;
189627
- var TRIGGER_NAME$1 = "CollapsibleTrigger";
189628
- var CollapsibleTrigger$1 = React.forwardRef(
189629
- (props, forwardedRef) => {
189630
- const { __scopeCollapsible, ...triggerProps } = props;
189631
- const context = useCollapsibleContext(TRIGGER_NAME$1, __scopeCollapsible);
189632
- return /* @__PURE__ */ jsx(
189633
- Primitive$4.button,
189634
- {
189635
- type: "button",
189636
- "aria-controls": context.contentId,
189637
- "aria-expanded": context.open || false,
189638
- "data-state": getState$1(context.open),
189639
- "data-disabled": context.disabled ? "" : void 0,
189640
- disabled: context.disabled,
189641
- ...triggerProps,
189642
- ref: forwardedRef,
189643
- onClick: composeEventHandlers$2(props.onClick, context.onOpenToggle)
189644
- }
189645
- );
189646
- }
189647
- );
189648
- CollapsibleTrigger$1.displayName = TRIGGER_NAME$1;
189649
- var CONTENT_NAME$1 = "CollapsibleContent";
189650
- var CollapsibleContent$1 = React.forwardRef(
189651
- (props, forwardedRef) => {
189652
- const { forceMount, ...contentProps } = props;
189653
- const context = useCollapsibleContext(CONTENT_NAME$1, props.__scopeCollapsible);
189654
- return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
189655
- }
189656
- );
189657
- CollapsibleContent$1.displayName = CONTENT_NAME$1;
189658
- var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
189659
- const { __scopeCollapsible, present, children, ...contentProps } = props;
189660
- const context = useCollapsibleContext(CONTENT_NAME$1, __scopeCollapsible);
189661
- const [isPresent, setIsPresent] = React.useState(present);
189662
- const ref = React.useRef(null);
189663
- const composedRefs = useComposedRefs$1(forwardedRef, ref);
189664
- const heightRef = React.useRef(0);
189665
- const height = heightRef.current;
189666
- const widthRef = React.useRef(0);
189667
- const width = widthRef.current;
189668
- const isOpen = context.open || isPresent;
189669
- const isMountAnimationPreventedRef = React.useRef(isOpen);
189670
- const originalStylesRef = React.useRef(void 0);
189671
- React.useEffect(() => {
189672
- const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
189673
- return () => cancelAnimationFrame(rAF);
189674
- }, []);
189675
- useLayoutEffect2$1(() => {
189676
- const node = ref.current;
189677
- if (node) {
189678
- originalStylesRef.current = originalStylesRef.current || {
189679
- transitionDuration: node.style.transitionDuration,
189680
- animationName: node.style.animationName
189681
- };
189682
- node.style.transitionDuration = "0s";
189683
- node.style.animationName = "none";
189684
- const rect = node.getBoundingClientRect();
189685
- heightRef.current = rect.height;
189686
- widthRef.current = rect.width;
189687
- if (!isMountAnimationPreventedRef.current) {
189688
- node.style.transitionDuration = originalStylesRef.current.transitionDuration;
189689
- node.style.animationName = originalStylesRef.current.animationName;
189690
- }
189691
- setIsPresent(present);
189692
- }
189693
- }, [context.open, present]);
189694
- return /* @__PURE__ */ jsx(
189695
- Primitive$4.div,
189696
- {
189697
- "data-state": getState$1(context.open),
189698
- "data-disabled": context.disabled ? "" : void 0,
189699
- id: context.contentId,
189700
- hidden: !isOpen,
189701
- ...contentProps,
189702
- ref: composedRefs,
189703
- style: {
189704
- [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
189705
- [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
189706
- ...props.style
189707
- },
189708
- children: isOpen && children
189709
- }
189710
- );
189711
- });
189712
- function getState$1(open) {
189713
- return open ? "open" : "closed";
189714
- }
189715
- var Root$3 = Collapsible$1;
189716
-
189717
- const Collapsible = Root$3;
189718
- const CollapsibleTrigger = CollapsibleTrigger$1;
189719
- const CollapsibleContent = CollapsibleContent$1;
189720
-
189721
189856
  function getFriendlyToolName(toolName) {
189722
189857
  if (TOOL_NAME_MAP === null || TOOL_NAME_MAP === void 0 ? void 0 : TOOL_NAME_MAP[toolName])
189723
189858
  return TOOL_NAME_MAP[toolName];
@@ -228188,7 +228323,9 @@ function NotificationDropdown({ org, userId, className, onViewNotifications, })
228188
228323
  return (jsx(Fragment$1, { children: jsxs(DropdownMenu, { open: notificationsOpen, onOpenChange: setNotificationsOpen, children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", size: "icon", className: `relative ${className}`, "aria-label": t('notificationsNotificationDropdown.bellAriaLabel', {
228189
228324
  count: unreadCount,
228190
228325
  plural: unreadCount === 1 ? '' : 's',
228191
- }), children: [jsx(Bell, { className: "h-6 w-6 text-[#646464]" }), !isNotificationCountLoading && unreadCount > 0 && (jsx("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-xs text-white", children: unreadCount }))] }) }), jsxs(DropdownMenuContent, { align: "end", className: "w-[300px] p-2 z-[9999] border border-gray-100 max-h-[300px] overflow-y-auto", children: [jsxs("div", { className: "px-4 py-3 text-sm font-semibold border-b border-gray-100 flex items-center justify-between", children: [jsx("span", { children: t('notificationsNotificationDropdown.notificationsHeader') }), jsx(Button$1, { variant: "link", size: "sm", className: "text-sm text-blue-600 h-auto p-0", onClick: () => onViewNotifications === null || onViewNotifications === void 0 ? void 0 : onViewNotifications(), children: t('notificationsNotificationDropdown.viewAll') })] }), isLoading && (jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: t('notificationsNotificationDropdown.loading') })), (!isLoading && isError) ||
228326
+ }), children: [jsx(Bell, { className: "h-6 w-6 text-[#646464]" }), !isNotificationCountLoading && unreadCount > 0 && (
228327
+ // Anchored from the left so wider counts (e.g. "99+") grow away from the bell
228328
+ jsx("span", { "aria-hidden": "true", className: "pointer-events-none absolute top-0.5 left-[55%] flex h-5 min-w-5 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-semibold leading-none tabular-nums text-white ring-2 ring-white", children: unreadCount > 99 ? '99+' : unreadCount }))] }) }), jsxs(DropdownMenuContent, { align: "end", className: "w-[300px] p-2 z-[9999] border border-gray-100 max-h-[300px] overflow-y-auto", children: [jsxs("div", { className: "px-3 py-3 text-sm font-semibold border-b border-gray-100 flex items-center justify-between", children: [jsx("span", { children: t('notificationsNotificationDropdown.notificationsHeader') }), jsx(Button$1, { variant: "link", size: "sm", className: "text-sm text-blue-600 h-auto p-0", onClick: () => onViewNotifications === null || onViewNotifications === void 0 ? void 0 : onViewNotifications(), children: t('notificationsNotificationDropdown.viewAll') })] }), isLoading && (jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: t('notificationsNotificationDropdown.loading') })), (!isLoading && isError) ||
228192
228329
  (!isLoading && !isError && filteredNotifications.length === 0) ? (jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: t('notificationsNotificationDropdown.noNewNotifications') })) : (jsxs(Fragment$1, { children: [!isLoading &&
228193
228330
  !isError &&
228194
228331
  filteredNotifications.length > 0 &&
@@ -231968,11 +232105,18 @@ const defaultTabs = [
231968
232105
  label: 'Audit',
231969
232106
  value: 'audit',
231970
232107
  },
231971
- /*{
231972
- label: 'Monetization',
231973
- value: 'monetization',
231974
- },*/
232108
+ {
232109
+ // Opt-in via `enableMonetization`, and then only for a user holding
232110
+ // `can_sell_items` on the tenant — see `canViewMonetizationAnalytics`.
232111
+ label: 'Monetization',
232112
+ value: 'monetization',
232113
+ },
231975
232114
  ];
232115
+ /**
232116
+ * Tab value gated on `enableMonetization` and the selling permission,
232117
+ * whichever `tabs` it comes from.
232118
+ */
232119
+ const MONETIZATION_TAB = 'monetization';
231976
232120
  /**
231977
232121
  * How many results the `dbId` lookup asks for. The query is the agent's own
231978
232122
  * `unique_id`, so the match is normally first; a handful of rows covers a
@@ -231980,7 +232124,7 @@ const defaultTabs = [
231980
232124
  */
231981
232125
  const SCOPE_LOOKUP_LIMIT = 5;
231982
232126
  const className = 'inline-flex h-7 shrink-0 items-center justify-center whitespace-nowrap rounded-[5px] px-2 sm:px-2.5 py-0 text-sm text-gray-500 ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-blue-600 data-[state=active]:font-semibold font-medium data-[state=active]:bg-[#f5f7fb] data-[state=active]:shadow-none cursor-pointer';
231983
- function AnalyticsLayout({ children, currentPath, basePath, onTabChange, tabs = defaultTabs, activeTabClassName = '', beforeDataReports, excludeTabs = [], showPicker = false, tenantKey, scopedMentor, onScopedMentorChange, }) {
232127
+ function AnalyticsLayout({ children, currentPath, basePath, onTabChange, tabs = defaultTabs, activeTabClassName = '', beforeDataReports, excludeTabs = [], showPicker = false, tenantKey, scopedMentor, onScopedMentorChange, enableMonetization = false, }) {
231984
232128
  var _a, _b;
231985
232129
  const { currentTenant } = useCurrentTenant();
231986
232130
  const rbacPermissions = useSelector(selectRbacPermissions);
@@ -232049,10 +232193,18 @@ function AnalyticsLayout({ children, currentPath, basePath, onTabChange, tabs =
232049
232193
  // the caller passed, custom tabs included.
232050
232194
  const isRestricted = isPureWatcher(rbacPermissions, currentTenant);
232051
232195
  const allowedTabs = useMemo(() => getVisibleAnalyticsTabs(rbacPermissions, currentTenant), [rbacPermissions, currentTenant]);
232052
- const canAccessTab = useCallback(
232053
- // Callers may pass custom tab values, so compare as plain strings: anything
232054
- // outside the watcher allow-list stays hidden from a restricted user.
232055
- (tabValue) => !isRestricted || allowedTabs.includes(tabValue), [isRestricted, allowedTabs]);
232196
+ // Monetization is a host opt-in (the tenant's `enable_monetization` flag)
232197
+ // and, on top of that, has its own RBAC action rather than a place in the
232198
+ // watcher allow-list: only a user who may sell on this tenant sees the tab,
232199
+ // admins included — the rule the sidebar and profile Account panel apply.
232200
+ const canViewMonetization = useMemo(() => enableMonetization && canViewMonetizationAnalytics(rbacPermissions, currentTenant), [enableMonetization, rbacPermissions, currentTenant]);
232201
+ const canAccessTab = useCallback((tabValue) => {
232202
+ if (tabValue === MONETIZATION_TAB && !canViewMonetization)
232203
+ return false;
232204
+ // Callers may pass custom tab values, so compare as plain strings: anything
232205
+ // outside the watcher allow-list stays hidden from a restricted user.
232206
+ return !isRestricted || allowedTabs.includes(tabValue);
232207
+ }, [isRestricted, allowedTabs, canViewMonetization]);
232056
232208
  useEffect(() => {
232057
232209
  const mainContentContainer = document.getElementById('main-content-container');
232058
232210
  if (mainContentContainer) {
@@ -232097,18 +232249,20 @@ function AnalyticsLayout({ children, currentPath, basePath, onTabChange, tabs =
232097
232249
  latestPropsRef.current = { onTabChange, excludeTabs };
232098
232250
  });
232099
232251
  // A watcher who deep-links into a restricted tab (e.g. /analytics/users, or
232100
- // the Overview landing page) gets sent to the first tab they may open. It has
232101
- // to skip `excludeTabs`: a host that drops a tab has no route behind it, so
232252
+ // the Overview landing page) gets sent to the first tab they may open, as
232253
+ // does anyone landing on Monetization while the host has it off or without
232254
+ // the selling permission. It has to skip `excludeTabs`: a host that drops a
232255
+ // tab has no route behind it, so
232102
232256
  // redirecting there would 404 (mentorai excludes courses/programs).
232103
232257
  useEffect(() => {
232104
232258
  if (isActiveTabAllowed)
232105
232259
  return;
232106
232260
  const { onTabChange: notify, excludeTabs: excluded } = latestPropsRef.current;
232107
- const fallbackTab = allowedTabs.find((tab) => !excluded.includes(tab));
232261
+ const fallbackTab = allowedTabs.find((tab) => !excluded.includes(tab) && canAccessTab(tab));
232108
232262
  if (fallbackTab === undefined)
232109
232263
  return;
232110
232264
  notify(fallbackTab);
232111
- }, [isActiveTabAllowed, allowedTabs]);
232265
+ }, [isActiveTabAllowed, allowedTabs, canAccessTab]);
232112
232266
  const handleTabClick = (tabValue) => {
232113
232267
  if (!canAccessTab(tabValue))
232114
232268
  return;
@@ -236028,31 +236182,12 @@ const useMonetization = ({ tenantKey }) => {
236028
236182
  itemType: pw.item_type,
236029
236183
  }));
236030
236184
  })();
236031
- const generateResemblingColors = (totalColors) => {
236032
- const baseColorVariations = [
236033
- '#2b7fff',
236034
- '#4d8fff',
236035
- '#6fa0ff',
236036
- '#91b1ff',
236037
- '#b3c2ff',
236038
- '#1a6fee',
236039
- '#0961dd',
236040
- '#0056cc',
236041
- '#004bbb',
236042
- '#0040aa',
236043
- ];
236044
- const colors = [];
236045
- for (let i = 0; i < totalColors && i < baseColorVariations.length; i++) {
236046
- colors.push(baseColorVariations[i]);
236047
- }
236048
- while (colors.length < totalColors) {
236049
- const hue = Math.floor(Math.random() * 360);
236050
- colors.push(`hsl(${hue}, 70%, 50%)`);
236051
- }
236052
- return colors;
236053
- };
236054
- const statusColors = generateResemblingColors(statusDistribution.length);
236055
- const itemTypeColors = generateResemblingColors(itemTypeDistribution.length);
236185
+ // Slices take the shared categorical palette in order, so neighbouring
236186
+ // statuses and item types are told apart by hue rather than by shades of
236187
+ // one blue. Past six slices the palette cycles, as it does on every other
236188
+ // multi-series chart (see chart-palette.ts).
236189
+ const statusColors = statusDistribution.map((_, index) => colorForRank(index));
236190
+ const itemTypeColors = itemTypeDistribution.map((_, index) => colorForRank(index));
236056
236191
  return {
236057
236192
  revenueData,
236058
236193
  isLoadingRevenue,
@@ -236076,6 +236211,15 @@ const useMonetization = ({ tenantKey }) => {
236076
236211
  };
236077
236212
  };
236078
236213
 
236214
+ /** What a cell shows when the row carries nothing for it, as the other tables do. */
236215
+ const EMPTY_CELL = '\u2014';
236216
+ /** The day a subscription started, or a dash when the row has no usable date. */
236217
+ function formatSubscribedOn(iso) {
236218
+ if (!iso)
236219
+ return EMPTY_CELL;
236220
+ const date = new Date(iso);
236221
+ return Number.isNaN(date.getTime()) ? EMPTY_CELL : format$1(date, 'MMM dd, yyyy');
236222
+ }
236079
236223
  function statusBadgeStyle(status) {
236080
236224
  switch (status) {
236081
236225
  case 'active':
@@ -236090,11 +236234,15 @@ function statusBadgeStyle(status) {
236090
236234
  return 'bg-gray-100 text-gray-500 border-gray-200 hover:bg-gray-100';
236091
236235
  }
236092
236236
  }
236093
- function AnalyticsMonetizationStats({ tenantKey }) {
236237
+ function AnalyticsMonetizationStats({ tenantKey, currentSPA, }) {
236094
236238
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
236095
236239
  const t = useT();
236096
236240
  const { revenueData, isLoadingRevenue, paywallsData, isLoadingPaywalls, subscribersData, isLoadingSubscribers, paywallTypeFilter, setPaywallTypeFilter, subscriberStatusFilter, setSubscriberStatusFilter, paywallPage, setPaywallPage, subscriberPage, setSubscriberPage, statusDistribution, itemTypeDistribution, statusColors, itemTypeColors, } = useMonetization({ tenantKey });
236097
- 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: isLoadingRevenue, title: t('analyticsAnalyticsMonetizationStats.totalRevenue'), value: Number((revenueData === null || revenueData === void 0 ? void 0 : revenueData.sales_volume) || 0).toLocaleString(), showDollarSign: true, description: t('analyticsAnalyticsMonetizationStats.totalRevenueDescription') }), jsx(StatCard, { loading: isLoadingRevenue, title: t('analyticsAnalyticsMonetizationStats.totalSales'), value: (_a = revenueData === null || revenueData === void 0 ? void 0 : revenueData.sales_count) !== null && _a !== void 0 ? _a : 0, description: t('analyticsAnalyticsMonetizationStats.totalSalesDescription') }), jsx(StatCard, { loading: isLoadingPaywalls, title: t('analyticsAnalyticsMonetizationStats.activePaywalls'), value: (_b = paywallsData === null || paywallsData === void 0 ? void 0 : paywallsData.count) !== null && _b !== void 0 ? _b : 0, description: t('analyticsAnalyticsMonetizationStats.activePaywallsDescription') }), jsx(StatCard, { loading: isLoadingSubscribers, title: t('analyticsAnalyticsMonetizationStats.totalSubscribers'), value: (_c = subscribersData === null || subscribersData === void 0 ? void 0 : subscribersData.count) !== null && _c !== void 0 ? _c : 0, description: t('analyticsAnalyticsMonetizationStats.totalSubscribersDescription') })] }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(Card$1, { className: "w-full bg-white rounded-lg border border-gray-100 overflow-hidden shadow-sm", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": t('analyticsAnalyticsMonetizationStats.subscriptionStatusChartCardAriaLabel'), children: [jsx("div", { className: "mb-6", children: jsxs("div", { className: "flex items-center gap-1", children: [jsx("h3", { className: "text-base font-medium text-gray-700", children: t('analyticsAnalyticsMonetizationStats.subscribersByStatus') }), jsx(CardInfoIcon, { title: t('analyticsAnalyticsMonetizationStats.subscribersByStatus'), description: t('analyticsAnalyticsMonetizationStats.subscribersByStatusDescription') })] }) }), jsx("div", { className: "w-full", style: { height: '350px' }, children: jsx(ChartContainer, { title: t('analyticsAnalyticsMonetizationStats.subscribersByStatus'), config: {
236241
+ 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: isLoadingRevenue, title: t('analyticsAnalyticsMonetizationStats.totalRevenue'),
236242
+ // Fixed two decimals with no locale grouping, the way every cost
236243
+ // card on the Cost tab reads — `toLocaleString` gave "4 180,5" in a
236244
+ // French browser.
236245
+ value: Number((revenueData === null || revenueData === void 0 ? void 0 : revenueData.sales_volume) || 0).toFixed(2), showDollarSign: true, description: t('analyticsAnalyticsMonetizationStats.totalRevenueDescription') }), jsx(StatCard, { loading: isLoadingRevenue, title: t('analyticsAnalyticsMonetizationStats.totalSales'), value: (_a = revenueData === null || revenueData === void 0 ? void 0 : revenueData.sales_count) !== null && _a !== void 0 ? _a : 0, description: t('analyticsAnalyticsMonetizationStats.totalSalesDescription') }), jsx(StatCard, { loading: isLoadingPaywalls, title: t('analyticsAnalyticsMonetizationStats.activePaywalls'), value: (_b = paywallsData === null || paywallsData === void 0 ? void 0 : paywallsData.count) !== null && _b !== void 0 ? _b : 0, description: t('analyticsAnalyticsMonetizationStats.activePaywallsDescription') }), jsx(StatCard, { loading: isLoadingSubscribers, title: t('analyticsAnalyticsMonetizationStats.totalSubscribers'), value: (_c = subscribersData === null || subscribersData === void 0 ? void 0 : subscribersData.count) !== null && _c !== void 0 ? _c : 0, description: t('analyticsAnalyticsMonetizationStats.totalSubscribersDescription') })] }), jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-5", children: [jsx(Card$1, { className: "w-full bg-white rounded-lg border border-gray-100 overflow-hidden shadow-sm", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": t('analyticsAnalyticsMonetizationStats.subscriptionStatusChartCardAriaLabel'), children: [jsx("div", { className: "mb-6", children: jsxs("div", { className: "flex items-center gap-1", children: [jsx("h3", { className: "text-base font-medium text-gray-700", children: t('analyticsAnalyticsMonetizationStats.subscribersByStatus') }), jsx(CardInfoIcon, { title: t('analyticsAnalyticsMonetizationStats.subscribersByStatus'), description: t('analyticsAnalyticsMonetizationStats.subscribersByStatusDescription') })] }) }), jsx("div", { className: "w-full", style: { height: '350px' }, children: jsx(ChartContainer, { title: t('analyticsAnalyticsMonetizationStats.subscribersByStatus'), config: {
236098
236246
  value: {
236099
236247
  label: t('analyticsAnalyticsMonetizationStats.subscribersLabel'),
236100
236248
  color: '#38A1E5',
@@ -236129,11 +236277,11 @@ function AnalyticsMonetizationStats({ tenantKey }) {
236129
236277
  }), description: t('analyticsAnalyticsMonetizationStats.subscribersTableDescription') })] }), jsxs(Select$1, { value: subscriberStatusFilter, onValueChange: (v) => {
236130
236278
  setSubscriberStatusFilter(v);
236131
236279
  setSubscriberPage(1);
236132
- }, children: [jsx(SelectTrigger, { className: "w-[130px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('analyticsAnalyticsMonetizationStats.filterAll') }), jsx(SelectItem, { value: "active", children: t('analyticsAnalyticsMonetizationStats.filterActive') }), jsx(SelectItem, { value: "trialing", children: t('analyticsAnalyticsMonetizationStats.filterTrialing') }), jsx(SelectItem, { value: "canceled", children: t('analyticsAnalyticsMonetizationStats.filterCanceled') }), jsx(SelectItem, { value: "past_due", children: t('analyticsAnalyticsMonetizationStats.filterPastDue') })] })] })] }) }), jsx("div", { className: "rounded-md overflow-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: "w-[250px]", children: t('analyticsAnalyticsMonetizationStats.tableHeadItem') }), jsx(TableHead, { className: "w-[100px]", children: t('analyticsAnalyticsMonetizationStats.tableHeadType') }), jsx(TableHead, { className: "w-[120px]", children: t('analyticsAnalyticsMonetizationStats.tableHeadPlan') }), jsx(TableHead, { className: "w-[100px]", children: t('analyticsAnalyticsMonetizationStats.tableHeadAmount') }), jsx(TableHead, { className: "text-right", children: t('analyticsAnalyticsMonetizationStats.tableHeadStatus') })] }) }), jsx(TableBody, { children: (_f = subscribersData === null || subscribersData === void 0 ? void 0 : subscribersData.results) === null || _f === void 0 ? void 0 : _f.map((sub, index) => {
236280
+ }, children: [jsx(SelectTrigger, { className: "w-[130px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('analyticsAnalyticsMonetizationStats.filterAll') }), jsx(SelectItem, { value: "active", children: t('analyticsAnalyticsMonetizationStats.filterActive') }), jsx(SelectItem, { value: "trialing", children: t('analyticsAnalyticsMonetizationStats.filterTrialing') }), jsx(SelectItem, { value: "canceled", children: t('analyticsAnalyticsMonetizationStats.filterCanceled') }), jsx(SelectItem, { value: "past_due", children: t('analyticsAnalyticsMonetizationStats.filterPastDue') })] })] })] }) }), jsx("div", { className: "rounded-md overflow-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { className: "table-fixed min-w-[900px]", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "w-[24%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadUser') }), jsx(TableHead, { className: "w-[24%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadItem') }), jsx(TableHead, { className: "w-[10.4%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadType') }), jsx(TableHead, { className: "w-[10.4%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadPlan') }), jsx(TableHead, { className: "w-[10.4%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadAmount') }), jsx(TableHead, { className: "w-[10.4%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadSubscribed') }), jsx(TableHead, { className: "w-[10.4%] text-right", children: t('analyticsAnalyticsMonetizationStats.tableHeadStatus') })] }) }), jsx(TableBody, { children: (_f = subscribersData === null || subscribersData === void 0 ? void 0 : subscribersData.results) === null || _f === void 0 ? void 0 : _f.map((sub, index) => {
236133
236281
  var _a, _b, _c;
236134
- return (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: sub.item_name || sub.item_id }), jsx(TableCell, { children: jsx(Badge, { variant: "secondary", className: "text-xs capitalize", children: sub.item_type }) }), jsx(TableCell, { children: (_a = sub.price) === null || _a === void 0 ? void 0 : _a.name }), jsx(TableCell, { children: sub.status === 'grandfathered' ? null : (jsxs(Fragment$1, { children: ["$", (_b = sub.price) === null || _b === void 0 ? void 0 : _b.amount, ((_c = sub.price) === null || _c === void 0 ? void 0 : _c.interval) && sub.price.interval !== 'one_time'
236282
+ return (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(UserProfileLink, { tenantKey: tenantKey, currentSPA: currentSPA, username: sub.username, display: sub.email || sub.username || EMPTY_CELL }) }), jsx(TableCell, { className: "font-medium truncate", title: sub.item_name || sub.item_id, children: sub.item_name || sub.item_id }), jsx(TableCell, { children: jsx(Badge, { variant: "secondary", className: "text-xs capitalize", children: sub.item_type }) }), jsx(TableCell, { children: (_a = sub.price) === null || _a === void 0 ? void 0 : _a.name }), jsx(TableCell, { className: "whitespace-nowrap", children: sub.status === 'grandfathered' ? null : (jsxs(Fragment$1, { children: ["$", (_b = sub.price) === null || _b === void 0 ? void 0 : _b.amount, ((_c = sub.price) === null || _c === void 0 ? void 0 : _c.interval) && sub.price.interval !== 'one_time'
236135
236283
  ? `/${sub.price.interval}`
236136
- : ''] })) }), jsx(TableCell, { className: "text-right", children: jsx(Badge, { className: statusBadgeStyle(sub.status), children: sub.status }) })] }, sub.unique_id));
236284
+ : ''] })) }), jsx(TableCell, { className: "whitespace-nowrap", children: formatSubscribedOn(sub.created_at) }), jsx(TableCell, { className: "text-right", children: jsx(Badge, { className: statusBadgeStyle(sub.status), children: sub.status }) })] }, sub.unique_id));
236137
236285
  }) })] }) }), (!((_g = subscribersData === null || subscribersData === void 0 ? void 0 : subscribersData.results) === null || _g === void 0 ? void 0 : _g.length) || ((_h = subscribersData === null || subscribersData === void 0 ? void 0 : subscribersData.results) === null || _h === void 0 ? void 0 : _h.length) === 0) && (jsx("div", { className: "h-[60px]", children: jsx(EmptyStats, {}) })), subscribersData &&
236138
236286
  (subscribersData.previous_page !== null || subscribersData.next_page !== null) && (jsxs("div", { className: "flex items-center justify-between py-3", children: [jsx("div", { className: "text-sm text-gray-700", children: t('analyticsAnalyticsMonetizationStats.subscriberCountTotal', {
236139
236287
  count: subscribersData.count,
@@ -236147,9 +236295,9 @@ function AnalyticsMonetizationStats({ tenantKey }) {
236147
236295
  }), description: t('analyticsAnalyticsMonetizationStats.paywallsTableDescription') })] }), jsxs(Select$1, { value: paywallTypeFilter, onValueChange: (v) => {
236148
236296
  setPaywallTypeFilter(v);
236149
236297
  setPaywallPage(1);
236150
- }, children: [jsx(SelectTrigger, { className: "w-[130px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('analyticsAnalyticsMonetizationStats.filterAllTypes') }), jsx(SelectItem, { value: "mentor", children: t('analyticsAnalyticsMonetizationStats.filterAgent') }), jsx(SelectItem, { value: "course", children: t('analyticsAnalyticsMonetizationStats.filterCourse') })] })] })] }) }), jsx("div", { className: "rounded-md overflow-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: "w-[250px]", children: t('analyticsAnalyticsMonetizationStats.tableHeadItem') }), jsx(TableHead, { className: "w-[100px]", children: t('analyticsAnalyticsMonetizationStats.tableHeadType') }), jsx(TableHead, { className: "w-[100px]", children: t('analyticsAnalyticsMonetizationStats.tableHeadPrices') }), jsx(TableHead, { className: "text-right", children: t('analyticsAnalyticsMonetizationStats.tableHeadStatus') })] }) }), jsx(TableBody, { children: (_l = paywallsData === null || paywallsData === void 0 ? void 0 : paywallsData.results) === null || _l === void 0 ? void 0 : _l.map((pw, index) => {
236298
+ }, children: [jsx(SelectTrigger, { className: "w-[130px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('analyticsAnalyticsMonetizationStats.filterAllTypes') }), jsx(SelectItem, { value: "mentor", children: t('analyticsAnalyticsMonetizationStats.filterAgent') }), jsx(SelectItem, { value: "course", children: t('analyticsAnalyticsMonetizationStats.filterCourse') })] })] })] }) }), jsx("div", { className: "rounded-md overflow-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { className: "table-fixed min-w-[640px]", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "w-[40%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadItem') }), jsx(TableHead, { className: "w-[20%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadType') }), jsx(TableHead, { className: "w-[20%]", children: t('analyticsAnalyticsMonetizationStats.tableHeadPrices') }), jsx(TableHead, { className: "w-[20%] text-right", children: t('analyticsAnalyticsMonetizationStats.tableHeadStatus') })] }) }), jsx(TableBody, { children: (_l = paywallsData === null || paywallsData === void 0 ? void 0 : paywallsData.results) === null || _l === void 0 ? void 0 : _l.map((pw, index) => {
236151
236299
  var _a, _b;
236152
- return (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: pw.item_name || pw.item_id }), jsx(TableCell, { children: jsx(Badge, { variant: "secondary", className: "text-xs capitalize", children: pw.item_type }) }), jsx(TableCell, { children: t('analyticsAnalyticsMonetizationStats.activePricesCount', {
236300
+ return (jsxs(TableRow, { className: cn(index % 2 === 0 ? 'bg-gray-50' : '', 'h-[48px]'), style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium truncate", title: pw.item_name || pw.item_id, children: pw.item_name || pw.item_id }), jsx(TableCell, { children: jsx(Badge, { variant: "secondary", className: "text-xs capitalize", children: pw.item_type }) }), jsx(TableCell, { children: t('analyticsAnalyticsMonetizationStats.activePricesCount', {
236153
236301
  count: (_b = (_a = pw.prices) === null || _a === void 0 ? void 0 : _a.filter((p) => p.is_active).length) !== null && _b !== void 0 ? _b : 0,
236154
236302
  }) }), jsx(TableCell, { className: "text-right", children: jsx(Badge, { className: pw.is_enabled
236155
236303
  ? 'bg-blue-100 text-blue-700 border-blue-200 hover:bg-blue-100'