@iblai/iblai-js 2.21.0 → 2.23.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.
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useState, useEffect, forwardRef, createElement as createElement$3, useLayoutEffect, createContext, useContext, useMemo, useReducer, useRef, useImperativeHandle, useCallback, isValidElement, Children, PureComponent, cloneElement, Component as Component$1, Fragment as Fragment$2, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
|
|
4
4
|
import * as dataLayer from '@iblai/data-layer';
|
|
5
|
-
import { 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, useStarMentorMutation, useUnstarMentorMutation, 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, useGetLlmsQuery, 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, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useGetDisclaimerAgreementsQuery, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
|
|
5
|
+
import { 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, useStarMentorMutation, useUnstarMentorMutation, 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, useGetLlmsQuery, 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, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useGetDisclaimerAgreementsQuery, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
|
|
6
6
|
import { removeAuthItem, setAuthItem, isTauriEmbeddedLLMHost, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, isPureWatcher, getInitials, useTenantMetadata, useUsername, selectStreaming, isLoggedIn, TOOL_NAME_MAP, WRITE_TODOS_TOOL, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, pickWritableFields, ANONYMOUS_USERNAME as ANONYMOUS_USERNAME$3, redirectToAuthSpaJoinTenant, selectActiveTab, useAxdToken, useWelcomeMessage, markdownToPlainText, useCachedSessionId, use402ErrorCheck, use401TokenRefresh, selectTokenEnabled, selectToken, useServiceWorker, useUserAgreement, useAdvancedChat, sendMessageToParentWebsite, useMentorTools, useFileDragDrop, eventBus, RemoteEvents, selectEnableChatActionsPopup, advancedTabs, isInIframe, getAuthSpaJoinUrl, addMessage, clearFiles, MENTOR_VISIBILITY } from '@iblai/web-utils';
|
|
7
7
|
import { useDispatch, useSelector } from 'react-redux';
|
|
8
8
|
import { toast } from 'sonner';
|
|
@@ -96896,6 +96896,8 @@ var analyticsAnalyticsMonetizationStats$3 = {
|
|
|
96896
96896
|
tableHeadPlan: "Plan",
|
|
96897
96897
|
tableHeadAmount: "Amount",
|
|
96898
96898
|
tableHeadStatus: "Status",
|
|
96899
|
+
tableHeadUser: "User",
|
|
96900
|
+
tableHeadSubscribed: "Subscribed",
|
|
96899
96901
|
subscriberCountTotal: "{count} subscriber{plural} total",
|
|
96900
96902
|
previous: "Previous",
|
|
96901
96903
|
pageLabel: "Page {page}",
|
|
@@ -98405,7 +98407,9 @@ var datasetsTabAddResourceModal$3 = {
|
|
|
98405
98407
|
title: "Add Resources",
|
|
98406
98408
|
description: "Add knowledge to help your agent provide more relevant insights. Others with edit access can reuse these sources for more topics.",
|
|
98407
98409
|
googleDrivePickerError: "Google Drive Picker Error",
|
|
98408
|
-
forceClosePicker: "Force Close Picker"
|
|
98410
|
+
forceClosePicker: "Force Close Picker",
|
|
98411
|
+
notConfigured: "Not configured for this tenant",
|
|
98412
|
+
scrollRegionAriaLabel: "Resource types"
|
|
98409
98413
|
};
|
|
98410
98414
|
var datasetsTabDatasetItem$3 = {
|
|
98411
98415
|
scheduleRetrain: "Schedule retrain",
|
|
@@ -100323,7 +100327,11 @@ var resourceModalGithubFileUploadModal$3 = {
|
|
|
100323
100327
|
errorAddingDocument: "Error adding training document",
|
|
100324
100328
|
githubRepoUrlPlaceholder: "Github Repo URL",
|
|
100325
100329
|
selectBranchPlaceholder: "Select Branch",
|
|
100326
|
-
submit: "Submit"
|
|
100330
|
+
submit: "Submit",
|
|
100331
|
+
description: "Add a GitHub repository and pick a branch to train your agent on.",
|
|
100332
|
+
scrollRegionAriaLabel: "Repository details",
|
|
100333
|
+
repoUrlLabel: "Repository URL",
|
|
100334
|
+
branchLabel: "Branch"
|
|
100327
100335
|
};
|
|
100328
100336
|
var resourceModalLocalFileUploadModal$3 = {
|
|
100329
100337
|
fileNotFound: "File not found",
|
|
@@ -100337,7 +100345,9 @@ var resourceModalLocalFileUploadModal$3 = {
|
|
|
100337
100345
|
descriptionOptional: "Description (optional)",
|
|
100338
100346
|
descriptionPlaceholder: "Add a description for this image...",
|
|
100339
100347
|
submitting: "Submitting",
|
|
100340
|
-
submit: "Submit"
|
|
100348
|
+
submit: "Submit",
|
|
100349
|
+
description: "Upload a file to train your agent on its contents.",
|
|
100350
|
+
scrollRegionAriaLabel: "File upload"
|
|
100341
100351
|
};
|
|
100342
100352
|
var resourceModalUrlUploadModal$3 = {
|
|
100343
100353
|
urlPlaceholder: "URL",
|
|
@@ -100346,11 +100356,15 @@ var resourceModalUrlUploadModal$3 = {
|
|
|
100346
100356
|
invalidYoutubeUrl: "Invalid YouTube URL",
|
|
100347
100357
|
invalidBlackboardUrl: "Invalid Blackboard URL",
|
|
100348
100358
|
invalidUrl: "Invalid URL",
|
|
100349
|
-
submit: "Submit"
|
|
100359
|
+
submit: "Submit",
|
|
100360
|
+
description: "Add a link to train your agent on its content.",
|
|
100361
|
+
scrollRegionAriaLabel: "Link details",
|
|
100362
|
+
urlLabel: "URL"
|
|
100350
100363
|
};
|
|
100351
100364
|
var resourceModalWebsiteCrawlModal$3 = {
|
|
100352
|
-
title: "Web Crawler Configuration",
|
|
100353
100365
|
description: "Configure your web crawler settings and URL patterns",
|
|
100366
|
+
infoBox: "Crawl a website and train your agent on its pages. Set how deep to follow links, how many pages to fetch, and which URLs to include.",
|
|
100367
|
+
scrollRegionAriaLabel: "Web crawler settings",
|
|
100354
100368
|
formAriaLabel: "Web crawler configuration form",
|
|
100355
100369
|
urlRequired: "URL is required",
|
|
100356
100370
|
invalidUrl: "Invalid URL",
|
|
@@ -100365,6 +100379,9 @@ var resourceModalWebsiteCrawlModal$3 = {
|
|
|
100365
100379
|
selectPatternTypeAriaLabel: "Select pattern type",
|
|
100366
100380
|
globPattern: "Glob Pattern",
|
|
100367
100381
|
regularExpression: "Regular Expression",
|
|
100382
|
+
userAgentLabel: "User-Agent (optional)",
|
|
100383
|
+
userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
|
|
100384
|
+
userAgentHelpText: "Optional. Overrides the default crawler User-Agent for every request. Leave blank to use the default.",
|
|
100368
100385
|
crawlerMatchPatternsLabel: "Crawler Match Patterns",
|
|
100369
100386
|
globPlaceholder: "https://example.com/",
|
|
100370
100387
|
regexPlaceholder: "(http|https)://www.example.com/(.*)",
|
|
@@ -104217,6 +104234,8 @@ var analyticsAnalyticsMonetizationStats$2 = {
|
|
|
104217
104234
|
tableHeadPlan: "Plan",
|
|
104218
104235
|
tableHeadAmount: "Montant",
|
|
104219
104236
|
tableHeadStatus: "Statut",
|
|
104237
|
+
tableHeadUser: "Utilisateur",
|
|
104238
|
+
tableHeadSubscribed: "Abonné le",
|
|
104220
104239
|
subscriberCountTotal: "{count} abonné{plural} au total",
|
|
104221
104240
|
previous: "Précédent",
|
|
104222
104241
|
pageLabel: "Page {page}",
|
|
@@ -105892,7 +105911,9 @@ var datasetsTabAddResourceModal$2 = {
|
|
|
105892
105911
|
title: "Ajouter des ressources",
|
|
105893
105912
|
description: "Ajoutez des connaissances pour aider votre agent à fournir des informations plus pertinentes. Les autres utilisateurs avec accès en modification peuvent réutiliser ces sources pour d'autres sujets.",
|
|
105894
105913
|
googleDrivePickerError: "Erreur du sélecteur Google Drive",
|
|
105895
|
-
forceClosePicker: "Forcer la fermeture du sélecteur"
|
|
105914
|
+
forceClosePicker: "Forcer la fermeture du sélecteur",
|
|
105915
|
+
notConfigured: "Non configuré pour ce locataire",
|
|
105916
|
+
scrollRegionAriaLabel: "Types de ressources"
|
|
105896
105917
|
};
|
|
105897
105918
|
var datasetsTabDatasetItem$2 = {
|
|
105898
105919
|
scheduleRetrain: "Planifier le réentraînement",
|
|
@@ -107810,7 +107831,11 @@ var resourceModalGithubFileUploadModal$2 = {
|
|
|
107810
107831
|
errorAddingDocument: "Erreur lors de l'ajout du document d'entraînement",
|
|
107811
107832
|
githubRepoUrlPlaceholder: "URL du dépôt GitHub",
|
|
107812
107833
|
selectBranchPlaceholder: "Sélectionner une branche",
|
|
107813
|
-
submit: "Soumettre"
|
|
107834
|
+
submit: "Soumettre",
|
|
107835
|
+
description: "Ajoutez un dépôt GitHub et choisissez une branche pour entraîner votre agent.",
|
|
107836
|
+
scrollRegionAriaLabel: "Détails du dépôt",
|
|
107837
|
+
repoUrlLabel: "URL du dépôt",
|
|
107838
|
+
branchLabel: "Branche"
|
|
107814
107839
|
};
|
|
107815
107840
|
var resourceModalLocalFileUploadModal$2 = {
|
|
107816
107841
|
fileNotFound: "Fichier introuvable",
|
|
@@ -107824,7 +107849,9 @@ var resourceModalLocalFileUploadModal$2 = {
|
|
|
107824
107849
|
descriptionOptional: "Description (facultative)",
|
|
107825
107850
|
descriptionPlaceholder: "Ajoutez une description pour cette image...",
|
|
107826
107851
|
submitting: "Envoi en cours",
|
|
107827
|
-
submit: "Soumettre"
|
|
107852
|
+
submit: "Soumettre",
|
|
107853
|
+
description: "Importez un fichier pour entraîner votre agent sur son contenu.",
|
|
107854
|
+
scrollRegionAriaLabel: "Import de fichier"
|
|
107828
107855
|
};
|
|
107829
107856
|
var resourceModalUrlUploadModal$2 = {
|
|
107830
107857
|
urlPlaceholder: "URL",
|
|
@@ -107833,11 +107860,15 @@ var resourceModalUrlUploadModal$2 = {
|
|
|
107833
107860
|
invalidYoutubeUrl: "URL YouTube invalide",
|
|
107834
107861
|
invalidBlackboardUrl: "URL Blackboard invalide",
|
|
107835
107862
|
invalidUrl: "URL invalide",
|
|
107836
|
-
submit: "Soumettre"
|
|
107863
|
+
submit: "Soumettre",
|
|
107864
|
+
description: "Ajoutez un lien pour entraîner votre agent sur son contenu.",
|
|
107865
|
+
scrollRegionAriaLabel: "Détails du lien",
|
|
107866
|
+
urlLabel: "URL"
|
|
107837
107867
|
};
|
|
107838
107868
|
var resourceModalWebsiteCrawlModal$2 = {
|
|
107839
|
-
title: "Configuration du robot d'exploration web",
|
|
107840
107869
|
description: "Configurez les paramètres et les modèles d'URL de votre robot d'exploration web",
|
|
107870
|
+
infoBox: "Explorez un site web et entraînez votre agent sur ses pages. Définissez la profondeur des liens, le nombre de pages à récupérer et les URL à inclure.",
|
|
107871
|
+
scrollRegionAriaLabel: "Paramètres du robot d'exploration",
|
|
107841
107872
|
formAriaLabel: "Formulaire de configuration du robot d'exploration web",
|
|
107842
107873
|
urlRequired: "L'URL est requise",
|
|
107843
107874
|
invalidUrl: "URL invalide",
|
|
@@ -107852,6 +107883,9 @@ var resourceModalWebsiteCrawlModal$2 = {
|
|
|
107852
107883
|
selectPatternTypeAriaLabel: "Sélectionner le type de modèle",
|
|
107853
107884
|
globPattern: "Modèle Glob",
|
|
107854
107885
|
regularExpression: "Expression régulière",
|
|
107886
|
+
userAgentLabel: "User-Agent (facultatif)",
|
|
107887
|
+
userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
|
|
107888
|
+
userAgentHelpText: "Facultatif. Remplace le User-Agent par défaut du robot d'exploration pour chaque requête. Laissez vide pour utiliser celui par défaut.",
|
|
107855
107889
|
crawlerMatchPatternsLabel: "Modèles de correspondance du robot",
|
|
107856
107890
|
globPlaceholder: "https://example.com/",
|
|
107857
107891
|
regexPlaceholder: "(http|https)://www.example.com/(.*)",
|
|
@@ -111538,6 +111572,8 @@ var analyticsAnalyticsMonetizationStats$1 = {
|
|
|
111538
111572
|
tableHeadPlan: "Plan",
|
|
111539
111573
|
tableHeadAmount: "Monto",
|
|
111540
111574
|
tableHeadStatus: "Estado",
|
|
111575
|
+
tableHeadUser: "Usuario",
|
|
111576
|
+
tableHeadSubscribed: "Suscrito el",
|
|
111541
111577
|
subscriberCountTotal: "{count} suscriptor{plural} en total",
|
|
111542
111578
|
previous: "Anterior",
|
|
111543
111579
|
pageLabel: "Página {page}",
|
|
@@ -113213,7 +113249,9 @@ var datasetsTabAddResourceModal$1 = {
|
|
|
113213
113249
|
title: "Agregar recursos",
|
|
113214
113250
|
description: "Agregue conocimiento para ayudar a su agente a proporcionar información más relevante. Otros usuarios con acceso de edición pueden reutilizar estas fuentes para más temas.",
|
|
113215
113251
|
googleDrivePickerError: "Error del selector de Google Drive",
|
|
113216
|
-
forceClosePicker: "Forzar cierre del selector"
|
|
113252
|
+
forceClosePicker: "Forzar cierre del selector",
|
|
113253
|
+
notConfigured: "No configurado para este inquilino",
|
|
113254
|
+
scrollRegionAriaLabel: "Tipos de recursos"
|
|
113217
113255
|
};
|
|
113218
113256
|
var datasetsTabDatasetItem$1 = {
|
|
113219
113257
|
scheduleRetrain: "Programar reentrenamiento",
|
|
@@ -115131,7 +115169,11 @@ var resourceModalGithubFileUploadModal$1 = {
|
|
|
115131
115169
|
errorAddingDocument: "Error al agregar el documento de entrenamiento",
|
|
115132
115170
|
githubRepoUrlPlaceholder: "URL del repositorio de GitHub",
|
|
115133
115171
|
selectBranchPlaceholder: "Seleccionar rama",
|
|
115134
|
-
submit: "Enviar"
|
|
115172
|
+
submit: "Enviar",
|
|
115173
|
+
description: "Agrega un repositorio de GitHub y elige una rama para entrenar a tu agente.",
|
|
115174
|
+
scrollRegionAriaLabel: "Detalles del repositorio",
|
|
115175
|
+
repoUrlLabel: "URL del repositorio",
|
|
115176
|
+
branchLabel: "Rama"
|
|
115135
115177
|
};
|
|
115136
115178
|
var resourceModalLocalFileUploadModal$1 = {
|
|
115137
115179
|
fileNotFound: "Archivo no encontrado",
|
|
@@ -115145,7 +115187,9 @@ var resourceModalLocalFileUploadModal$1 = {
|
|
|
115145
115187
|
descriptionOptional: "Descripción (opcional)",
|
|
115146
115188
|
descriptionPlaceholder: "Añade una descripción para esta imagen...",
|
|
115147
115189
|
submitting: "Enviando",
|
|
115148
|
-
submit: "Enviar"
|
|
115190
|
+
submit: "Enviar",
|
|
115191
|
+
description: "Sube un archivo para entrenar a tu agente con su contenido.",
|
|
115192
|
+
scrollRegionAriaLabel: "Carga de archivo"
|
|
115149
115193
|
};
|
|
115150
115194
|
var resourceModalUrlUploadModal$1 = {
|
|
115151
115195
|
urlPlaceholder: "URL",
|
|
@@ -115154,11 +115198,15 @@ var resourceModalUrlUploadModal$1 = {
|
|
|
115154
115198
|
invalidYoutubeUrl: "URL de YouTube no válida",
|
|
115155
115199
|
invalidBlackboardUrl: "URL de Blackboard no válida",
|
|
115156
115200
|
invalidUrl: "URL no válida",
|
|
115157
|
-
submit: "Enviar"
|
|
115201
|
+
submit: "Enviar",
|
|
115202
|
+
description: "Agrega un enlace para entrenar a tu agente con su contenido.",
|
|
115203
|
+
scrollRegionAriaLabel: "Detalles del enlace",
|
|
115204
|
+
urlLabel: "URL"
|
|
115158
115205
|
};
|
|
115159
115206
|
var resourceModalWebsiteCrawlModal$1 = {
|
|
115160
|
-
title: "Configuración del rastreador web",
|
|
115161
115207
|
description: "Configure los ajustes de su rastreador web y los patrones de URL",
|
|
115208
|
+
infoBox: "Rastrea un sitio web y entrena a tu agente con sus páginas. Define la profundidad de los enlaces, cuántas páginas obtener y qué URL incluir.",
|
|
115209
|
+
scrollRegionAriaLabel: "Configuración del rastreador web",
|
|
115162
115210
|
formAriaLabel: "Formulario de configuración del rastreador web",
|
|
115163
115211
|
urlRequired: "La URL es obligatoria",
|
|
115164
115212
|
invalidUrl: "URL no válida",
|
|
@@ -115173,6 +115221,9 @@ var resourceModalWebsiteCrawlModal$1 = {
|
|
|
115173
115221
|
selectPatternTypeAriaLabel: "Seleccionar tipo de patrón",
|
|
115174
115222
|
globPattern: "Patrón Glob",
|
|
115175
115223
|
regularExpression: "Expresión regular",
|
|
115224
|
+
userAgentLabel: "User-Agent (opcional)",
|
|
115225
|
+
userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
|
|
115226
|
+
userAgentHelpText: "Opcional. Sustituye el User-Agent predeterminado del rastreador en cada solicitud. Déjalo en blanco para usar el predeterminado.",
|
|
115176
115227
|
crawlerMatchPatternsLabel: "Patrones de coincidencia del rastreador",
|
|
115177
115228
|
globPlaceholder: "https://example.com/",
|
|
115178
115229
|
regexPlaceholder: "(http|https)://www.example.com/(.*)",
|
|
@@ -118859,6 +118910,8 @@ var analyticsAnalyticsMonetizationStats = {
|
|
|
118859
118910
|
tableHeadPlan: "方案",
|
|
118860
118911
|
tableHeadAmount: "金额",
|
|
118861
118912
|
tableHeadStatus: "状态",
|
|
118913
|
+
tableHeadUser: "用户",
|
|
118914
|
+
tableHeadSubscribed: "订阅日期",
|
|
118862
118915
|
subscriberCountTotal: "共 {count} 位订阅者",
|
|
118863
118916
|
previous: "上一页",
|
|
118864
118917
|
pageLabel: "第 {page} 页",
|
|
@@ -120534,7 +120587,9 @@ var datasetsTabAddResourceModal = {
|
|
|
120534
120587
|
title: "添加资源",
|
|
120535
120588
|
description: "添加知识以帮助您的代理提供更相关的见解。其他具有编辑权限的用户可以为更多主题重复使用这些来源。",
|
|
120536
120589
|
googleDrivePickerError: "Google Drive 选择器错误",
|
|
120537
|
-
forceClosePicker: "强制关闭选择器"
|
|
120590
|
+
forceClosePicker: "强制关闭选择器",
|
|
120591
|
+
notConfigured: "未为此租户配置",
|
|
120592
|
+
scrollRegionAriaLabel: "资源类型"
|
|
120538
120593
|
};
|
|
120539
120594
|
var datasetsTabDatasetItem = {
|
|
120540
120595
|
scheduleRetrain: "安排重新训练",
|
|
@@ -122452,7 +122507,11 @@ var resourceModalGithubFileUploadModal = {
|
|
|
122452
122507
|
errorAddingDocument: "添加训练文档时出错",
|
|
122453
122508
|
githubRepoUrlPlaceholder: "GitHub 仓库 URL",
|
|
122454
122509
|
selectBranchPlaceholder: "选择分支",
|
|
122455
|
-
submit: "提交"
|
|
122510
|
+
submit: "提交",
|
|
122511
|
+
description: "添加 GitHub 仓库并选择分支来训练您的智能体。",
|
|
122512
|
+
scrollRegionAriaLabel: "仓库详情",
|
|
122513
|
+
repoUrlLabel: "仓库 URL",
|
|
122514
|
+
branchLabel: "分支"
|
|
122456
122515
|
};
|
|
122457
122516
|
var resourceModalLocalFileUploadModal = {
|
|
122458
122517
|
fileNotFound: "未找到文件",
|
|
@@ -122466,7 +122525,9 @@ var resourceModalLocalFileUploadModal = {
|
|
|
122466
122525
|
descriptionOptional: "描述(可选)",
|
|
122467
122526
|
descriptionPlaceholder: "为此图片添加描述...",
|
|
122468
122527
|
submitting: "提交中",
|
|
122469
|
-
submit: "提交"
|
|
122528
|
+
submit: "提交",
|
|
122529
|
+
description: "上传文件,用其内容训练您的智能体。",
|
|
122530
|
+
scrollRegionAriaLabel: "文件上传"
|
|
122470
122531
|
};
|
|
122471
122532
|
var resourceModalUrlUploadModal = {
|
|
122472
122533
|
urlPlaceholder: "URL",
|
|
@@ -122475,11 +122536,15 @@ var resourceModalUrlUploadModal = {
|
|
|
122475
122536
|
invalidYoutubeUrl: "无效的 YouTube URL",
|
|
122476
122537
|
invalidBlackboardUrl: "无效的 Blackboard URL",
|
|
122477
122538
|
invalidUrl: "无效的 URL",
|
|
122478
|
-
submit: "提交"
|
|
122539
|
+
submit: "提交",
|
|
122540
|
+
description: "添加链接,用其内容训练您的智能体。",
|
|
122541
|
+
scrollRegionAriaLabel: "链接详情",
|
|
122542
|
+
urlLabel: "URL"
|
|
122479
122543
|
};
|
|
122480
122544
|
var resourceModalWebsiteCrawlModal = {
|
|
122481
|
-
title: "网络爬虫配置",
|
|
122482
122545
|
description: "配置您的网络爬虫设置和 URL 模式",
|
|
122546
|
+
infoBox: "抓取网站并用其页面训练您的智能体。设置链接跟踪深度、抓取页面数量以及要包含的网址。",
|
|
122547
|
+
scrollRegionAriaLabel: "网络爬虫设置",
|
|
122483
122548
|
formAriaLabel: "网络爬虫配置表单",
|
|
122484
122549
|
urlRequired: "URL 为必填项",
|
|
122485
122550
|
invalidUrl: "无效的 URL",
|
|
@@ -122494,6 +122559,9 @@ var resourceModalWebsiteCrawlModal = {
|
|
|
122494
122559
|
selectPatternTypeAriaLabel: "选择模式类型",
|
|
122495
122560
|
globPattern: "Glob 模式",
|
|
122496
122561
|
regularExpression: "正则表达式",
|
|
122562
|
+
userAgentLabel: "User-Agent(可选)",
|
|
122563
|
+
userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
|
|
122564
|
+
userAgentHelpText: "可选。为每个请求覆盖默认的抓取工具 User-Agent。留空则使用默认值。",
|
|
122497
122565
|
crawlerMatchPatternsLabel: "爬虫匹配模式",
|
|
122498
122566
|
globPlaceholder: "https://example.com/",
|
|
122499
122567
|
regexPlaceholder: "(http|https)://www.example.com/(.*)",
|
|
@@ -179340,7 +179408,205 @@ const EmptyStats = ({ title = 'No data available' }) => {
|
|
|
179340
179408
|
return (jsx("div", { className: "flex justify-center items-center h-full", children: jsx("p", { className: "text-gray-500 text-sm", children: title }) }));
|
|
179341
179409
|
};
|
|
179342
179410
|
|
|
179343
|
-
|
|
179411
|
+
var COLLAPSIBLE_NAME = "Collapsible";
|
|
179412
|
+
var [createCollapsibleContext] = createContextScope$1(COLLAPSIBLE_NAME);
|
|
179413
|
+
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
179414
|
+
var Collapsible$1 = React.forwardRef(
|
|
179415
|
+
(props, forwardedRef) => {
|
|
179416
|
+
const {
|
|
179417
|
+
__scopeCollapsible,
|
|
179418
|
+
open: openProp,
|
|
179419
|
+
defaultOpen,
|
|
179420
|
+
disabled,
|
|
179421
|
+
onOpenChange,
|
|
179422
|
+
...collapsibleProps
|
|
179423
|
+
} = props;
|
|
179424
|
+
const [open, setOpen] = useControllableState$1({
|
|
179425
|
+
prop: openProp,
|
|
179426
|
+
defaultProp: defaultOpen ?? false,
|
|
179427
|
+
onChange: onOpenChange,
|
|
179428
|
+
caller: COLLAPSIBLE_NAME
|
|
179429
|
+
});
|
|
179430
|
+
return /* @__PURE__ */ jsx(
|
|
179431
|
+
CollapsibleProvider,
|
|
179432
|
+
{
|
|
179433
|
+
scope: __scopeCollapsible,
|
|
179434
|
+
disabled,
|
|
179435
|
+
contentId: useId$1(),
|
|
179436
|
+
open,
|
|
179437
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
179438
|
+
children: /* @__PURE__ */ jsx(
|
|
179439
|
+
Primitive$2.div,
|
|
179440
|
+
{
|
|
179441
|
+
"data-state": getState$3(open),
|
|
179442
|
+
"data-disabled": disabled ? "" : void 0,
|
|
179443
|
+
...collapsibleProps,
|
|
179444
|
+
ref: forwardedRef
|
|
179445
|
+
}
|
|
179446
|
+
)
|
|
179447
|
+
}
|
|
179448
|
+
);
|
|
179449
|
+
}
|
|
179450
|
+
);
|
|
179451
|
+
Collapsible$1.displayName = COLLAPSIBLE_NAME;
|
|
179452
|
+
var TRIGGER_NAME$3 = "CollapsibleTrigger";
|
|
179453
|
+
var CollapsibleTrigger$1 = React.forwardRef(
|
|
179454
|
+
(props, forwardedRef) => {
|
|
179455
|
+
const { __scopeCollapsible, ...triggerProps } = props;
|
|
179456
|
+
const context = useCollapsibleContext(TRIGGER_NAME$3, __scopeCollapsible);
|
|
179457
|
+
return /* @__PURE__ */ jsx(
|
|
179458
|
+
Primitive$2.button,
|
|
179459
|
+
{
|
|
179460
|
+
type: "button",
|
|
179461
|
+
"aria-controls": context.contentId,
|
|
179462
|
+
"aria-expanded": context.open || false,
|
|
179463
|
+
"data-state": getState$3(context.open),
|
|
179464
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
179465
|
+
disabled: context.disabled,
|
|
179466
|
+
...triggerProps,
|
|
179467
|
+
ref: forwardedRef,
|
|
179468
|
+
onClick: composeEventHandlers$1(props.onClick, context.onOpenToggle)
|
|
179469
|
+
}
|
|
179470
|
+
);
|
|
179471
|
+
}
|
|
179472
|
+
);
|
|
179473
|
+
CollapsibleTrigger$1.displayName = TRIGGER_NAME$3;
|
|
179474
|
+
var CONTENT_NAME$4 = "CollapsibleContent";
|
|
179475
|
+
var CollapsibleContent$1 = React.forwardRef(
|
|
179476
|
+
(props, forwardedRef) => {
|
|
179477
|
+
const { forceMount, ...contentProps } = props;
|
|
179478
|
+
const context = useCollapsibleContext(CONTENT_NAME$4, props.__scopeCollapsible);
|
|
179479
|
+
return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
|
|
179480
|
+
}
|
|
179481
|
+
);
|
|
179482
|
+
CollapsibleContent$1.displayName = CONTENT_NAME$4;
|
|
179483
|
+
var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
|
|
179484
|
+
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
179485
|
+
const context = useCollapsibleContext(CONTENT_NAME$4, __scopeCollapsible);
|
|
179486
|
+
const [isPresent, setIsPresent] = React.useState(present);
|
|
179487
|
+
const ref = React.useRef(null);
|
|
179488
|
+
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
179489
|
+
const heightRef = React.useRef(0);
|
|
179490
|
+
const height = heightRef.current;
|
|
179491
|
+
const widthRef = React.useRef(0);
|
|
179492
|
+
const width = widthRef.current;
|
|
179493
|
+
const isOpen = context.open || isPresent;
|
|
179494
|
+
const isMountAnimationPreventedRef = React.useRef(isOpen);
|
|
179495
|
+
const originalStylesRef = React.useRef(void 0);
|
|
179496
|
+
React.useEffect(() => {
|
|
179497
|
+
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
179498
|
+
return () => cancelAnimationFrame(rAF);
|
|
179499
|
+
}, []);
|
|
179500
|
+
useLayoutEffect2$1(() => {
|
|
179501
|
+
const node = ref.current;
|
|
179502
|
+
if (node) {
|
|
179503
|
+
originalStylesRef.current = originalStylesRef.current || {
|
|
179504
|
+
transitionDuration: node.style.transitionDuration,
|
|
179505
|
+
animationName: node.style.animationName
|
|
179506
|
+
};
|
|
179507
|
+
node.style.transitionDuration = "0s";
|
|
179508
|
+
node.style.animationName = "none";
|
|
179509
|
+
const rect = node.getBoundingClientRect();
|
|
179510
|
+
heightRef.current = rect.height;
|
|
179511
|
+
widthRef.current = rect.width;
|
|
179512
|
+
if (!isMountAnimationPreventedRef.current) {
|
|
179513
|
+
node.style.transitionDuration = originalStylesRef.current.transitionDuration;
|
|
179514
|
+
node.style.animationName = originalStylesRef.current.animationName;
|
|
179515
|
+
}
|
|
179516
|
+
setIsPresent(present);
|
|
179517
|
+
}
|
|
179518
|
+
}, [context.open, present]);
|
|
179519
|
+
return /* @__PURE__ */ jsx(
|
|
179520
|
+
Primitive$2.div,
|
|
179521
|
+
{
|
|
179522
|
+
"data-state": getState$3(context.open),
|
|
179523
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
179524
|
+
id: context.contentId,
|
|
179525
|
+
hidden: !isOpen,
|
|
179526
|
+
...contentProps,
|
|
179527
|
+
ref: composedRefs,
|
|
179528
|
+
style: {
|
|
179529
|
+
[`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
|
|
179530
|
+
[`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
|
|
179531
|
+
...props.style
|
|
179532
|
+
},
|
|
179533
|
+
children: isOpen && children
|
|
179534
|
+
}
|
|
179535
|
+
);
|
|
179536
|
+
});
|
|
179537
|
+
function getState$3(open) {
|
|
179538
|
+
return open ? "open" : "closed";
|
|
179539
|
+
}
|
|
179540
|
+
var Root$7 = Collapsible$1;
|
|
179541
|
+
|
|
179542
|
+
const Collapsible = Root$7;
|
|
179543
|
+
const CollapsibleTrigger = CollapsibleTrigger$1;
|
|
179544
|
+
const CollapsibleContent = CollapsibleContent$1;
|
|
179545
|
+
|
|
179546
|
+
const BAR_COLOR$1 = 'var(--color-amber-500, #f59e0b)';
|
|
179547
|
+
const ERROR_MESSAGES = {
|
|
179548
|
+
forbidden: 'Completion breakdown is not available for this learner.',
|
|
179549
|
+
not_enrolled: 'This learner is not enrolled in this course.',
|
|
179550
|
+
unavailable: 'Could not load the completion breakdown. Please try again later.',
|
|
179551
|
+
unauthorized: 'Completion breakdown is not available for this learner.',
|
|
179552
|
+
invalid_request: 'Completion breakdown is not available for this course.',
|
|
179553
|
+
unknown: 'Could not load the completion breakdown.',
|
|
179554
|
+
};
|
|
179555
|
+
// Backend values are already rounded to 2 decimals; show whole numbers
|
|
179556
|
+
// unless the value is fractional (e.g. 33.33).
|
|
179557
|
+
const formatPct = (value) => {
|
|
179558
|
+
const pct = value !== null && value !== void 0 ? value : 0;
|
|
179559
|
+
return `${Number.isInteger(pct) ? pct : pct.toFixed(2).replace(/\.?0+$/, '')}%`;
|
|
179560
|
+
};
|
|
179561
|
+
function CompletionBar({ value, label }) {
|
|
179562
|
+
const clamped = Math.min(Math.max(value, 0), 100);
|
|
179563
|
+
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 } }) }));
|
|
179564
|
+
}
|
|
179565
|
+
function SubsectionRow({ block }) {
|
|
179566
|
+
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` })] }));
|
|
179567
|
+
}
|
|
179568
|
+
function SectionRow({ block }) {
|
|
179569
|
+
var _a;
|
|
179570
|
+
const [open, setOpen] = useState(false);
|
|
179571
|
+
const subsections = (_a = block.children) !== null && _a !== void 0 ? _a : [];
|
|
179572
|
+
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] }) }));
|
|
179573
|
+
}
|
|
179574
|
+
/**
|
|
179575
|
+
* Per-section completion for one learner in one course, from the DM
|
|
179576
|
+
* completion outline. Percentages come from the backend as-is.
|
|
179577
|
+
*/
|
|
179578
|
+
function CourseCompletionBreakdown({ username, courseId, tenantKey, skip = false, }) {
|
|
179579
|
+
const { data, error, isLoading, isFetching, refetch } = useGetLearnerCourseOutlineQuery({ username, course_id: courseId, platform_key: tenantKey }, { skip: skip || !username || !courseId || !tenantKey });
|
|
179580
|
+
const sections = useMemo(() => (data ? getSections(data) : []), [data]);
|
|
179581
|
+
const resumePath = useMemo(() => {
|
|
179582
|
+
if (!data)
|
|
179583
|
+
return null;
|
|
179584
|
+
const resume = findResumeBlock(data);
|
|
179585
|
+
if (!resume || resume.id === data.id)
|
|
179586
|
+
return null;
|
|
179587
|
+
const entry = flattenOutline(data).find(({ block }) => block.id === resume.id);
|
|
179588
|
+
// Drop the course name; the modal header already shows it.
|
|
179589
|
+
return entry ? entry.path.slice(1).join(' › ') : null;
|
|
179590
|
+
}, [data]);
|
|
179591
|
+
const normalizedError = normalizeLearnerCompletionError(error);
|
|
179592
|
+
let body;
|
|
179593
|
+
if (isLoading || (isFetching && !data)) {
|
|
179594
|
+
body = jsx("p", { className: "py-4 text-sm text-gray-500", children: "Loading completion breakdown..." });
|
|
179595
|
+
}
|
|
179596
|
+
else if (normalizedError) {
|
|
179597
|
+
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] }));
|
|
179598
|
+
}
|
|
179599
|
+
else if (sections.length === 0) {
|
|
179600
|
+
body = jsx("p", { className: "py-2 text-sm text-gray-500", children: "No sections in this course yet." });
|
|
179601
|
+
}
|
|
179602
|
+
else {
|
|
179603
|
+
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))) })] }));
|
|
179604
|
+
}
|
|
179605
|
+
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] }));
|
|
179606
|
+
}
|
|
179607
|
+
|
|
179608
|
+
// Theme token (the same one bg-amber-500 resolves to), with Tailwind's default as fallback.
|
|
179609
|
+
const COMPLETED_COLOR = 'var(--color-amber-500, #f59e0b)';
|
|
179344
179610
|
const REMAINING_COLOR = '#E5E7EB';
|
|
179345
179611
|
const formatDate$1 = (value) => {
|
|
179346
179612
|
if (!value)
|
|
@@ -179446,7 +179712,7 @@ function EnrolledUserProgressModal({ open, onOpenChange, username, userName, ema
|
|
|
179446
179712
|
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);
|
|
179447
179713
|
return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsxs(DialogContent, { className: "max-w-2xl max-h-[85vh] overflow-y-auto", "aria-label": "Enrolled user progress", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: userName || username || 'Learner progress' }), jsxs(DialogDescription, { children: [email ? `${email} · ` : '', resolvedName || (isProgram ? 'Program progress' : 'Course progress')] })] }), loading ? (jsx("div", { className: "flex items-center justify-center py-12", children: jsx("div", { className: "text-sm text-gray-500", children: "Loading..." }) })) : !item ? (jsx(EmptyStats, { title: "No progress data available" })) : (jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "relative mx-auto", style: { width: 220, height: 220 }, children: [jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsx(PieChart, { children: jsxs(Pie, { data: pieData, dataKey: "value", cx: "50%", cy: "50%", innerRadius: 75, outerRadius: 100, startAngle: 90, endAngle: -270, stroke: "none", isAnimationActive: false, children: [jsx(Cell, { fill: COMPLETED_COLOR }), jsx(Cell, { fill: REMAINING_COLOR })] }) }) }), jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none", children: [jsxs("span", { className: "text-3xl font-bold text-gray-700", children: [percentage, "%"] }), jsx("span", { className: "text-sm text-gray-500", children: "completed" })] })] }), jsxs("div", { className: "divide-y divide-[oklch(0.922_0_0)]", children: [jsx(DetailRow, { label: "Status", children: jsx("span", { className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${((_j = item.completion) === null || _j === void 0 ? void 0 : _j.passed)
|
|
179448
179714
|
? 'bg-green-50 text-green-700'
|
|
179449
|
-
: 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow, { label: "Passed on", children: formatDate$1((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow, { label: "Enrollment date", children: formatDate$1((_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] }))] }) }));
|
|
179715
|
+
: 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow, { label: "Passed on", children: formatDate$1((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow, { label: "Enrollment date", children: formatDate$1((_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] }))] }) }));
|
|
179450
179716
|
}
|
|
179451
179717
|
function DetailRow({ label, children }) {
|
|
179452
179718
|
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 })] }));
|
|
@@ -181751,7 +182017,7 @@ function PreviousMonthButton(props) {
|
|
|
181751
182017
|
* @group Components
|
|
181752
182018
|
* @see https://daypicker.dev/guides/custom-components
|
|
181753
182019
|
*/
|
|
181754
|
-
function Root$
|
|
182020
|
+
function Root$6(props) {
|
|
181755
182021
|
const { rootRef, ...rest } = props;
|
|
181756
182022
|
return React__default.createElement("div", { ...rest, ref: rootRef });
|
|
181757
182023
|
}
|
|
@@ -181859,7 +182125,7 @@ var components$1 = /*#__PURE__*/Object.freeze({
|
|
|
181859
182125
|
NextMonthButton: NextMonthButton,
|
|
181860
182126
|
Option: Option,
|
|
181861
182127
|
PreviousMonthButton: PreviousMonthButton,
|
|
181862
|
-
Root: Root$
|
|
182128
|
+
Root: Root$6,
|
|
181863
182129
|
Select: Select,
|
|
181864
182130
|
Week: Week,
|
|
181865
182131
|
WeekNumber: WeekNumber,
|
|
@@ -183929,11 +184195,11 @@ var PopoverAnchor$1 = React.forwardRef(
|
|
|
183929
184195
|
}
|
|
183930
184196
|
);
|
|
183931
184197
|
PopoverAnchor$1.displayName = ANCHOR_NAME$1;
|
|
183932
|
-
var TRIGGER_NAME$
|
|
184198
|
+
var TRIGGER_NAME$2 = "PopoverTrigger";
|
|
183933
184199
|
var PopoverTrigger$1 = React.forwardRef(
|
|
183934
184200
|
(props, forwardedRef) => {
|
|
183935
184201
|
const { __scopePopover, ...triggerProps } = props;
|
|
183936
|
-
const context = usePopoverContext(TRIGGER_NAME$
|
|
184202
|
+
const context = usePopoverContext(TRIGGER_NAME$2, __scopePopover);
|
|
183937
184203
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
183938
184204
|
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
183939
184205
|
const trigger = /* @__PURE__ */ jsx(
|
|
@@ -183943,7 +184209,7 @@ var PopoverTrigger$1 = React.forwardRef(
|
|
|
183943
184209
|
"aria-haspopup": "dialog",
|
|
183944
184210
|
"aria-expanded": context.open,
|
|
183945
184211
|
"aria-controls": context.contentId,
|
|
183946
|
-
"data-state": getState$
|
|
184212
|
+
"data-state": getState$2(context.open),
|
|
183947
184213
|
...triggerProps,
|
|
183948
184214
|
ref: composedTriggerRef,
|
|
183949
184215
|
onClick: composeEventHandlers$2(props.onClick, context.onOpenToggle)
|
|
@@ -183952,7 +184218,7 @@ var PopoverTrigger$1 = React.forwardRef(
|
|
|
183952
184218
|
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor$3, { asChild: true, ...popperScope, children: trigger });
|
|
183953
184219
|
}
|
|
183954
184220
|
);
|
|
183955
|
-
PopoverTrigger$1.displayName = TRIGGER_NAME$
|
|
184221
|
+
PopoverTrigger$1.displayName = TRIGGER_NAME$2;
|
|
183956
184222
|
var PORTAL_NAME$2 = "PopoverPortal";
|
|
183957
184223
|
var [PortalProvider$1, usePortalContext$1] = createPopoverContext(PORTAL_NAME$2, {
|
|
183958
184224
|
forceMount: void 0
|
|
@@ -183963,20 +184229,20 @@ var PopoverPortal = (props) => {
|
|
|
183963
184229
|
return /* @__PURE__ */ jsx(PortalProvider$1, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence$3, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$7, { asChild: true, container, children }) }) });
|
|
183964
184230
|
};
|
|
183965
184231
|
PopoverPortal.displayName = PORTAL_NAME$2;
|
|
183966
|
-
var CONTENT_NAME$
|
|
184232
|
+
var CONTENT_NAME$3 = "PopoverContent";
|
|
183967
184233
|
var PopoverContent$1 = React.forwardRef(
|
|
183968
184234
|
(props, forwardedRef) => {
|
|
183969
|
-
const portalContext = usePortalContext$1(CONTENT_NAME$
|
|
184235
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$3, props.__scopePopover);
|
|
183970
184236
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
183971
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
184237
|
+
const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
|
|
183972
184238
|
return /* @__PURE__ */ jsx(Presence$3, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
183973
184239
|
}
|
|
183974
184240
|
);
|
|
183975
|
-
PopoverContent$1.displayName = CONTENT_NAME$
|
|
184241
|
+
PopoverContent$1.displayName = CONTENT_NAME$3;
|
|
183976
184242
|
var Slot = createSlot$1("PopoverContent.RemoveScroll");
|
|
183977
184243
|
var PopoverContentModal = React.forwardRef(
|
|
183978
184244
|
(props, forwardedRef) => {
|
|
183979
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
184245
|
+
const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
|
|
183980
184246
|
const contentRef = React.useRef(null);
|
|
183981
184247
|
const composedRefs = useComposedRefs$1(forwardedRef, contentRef);
|
|
183982
184248
|
const isRightClickOutsideRef = React.useRef(false);
|
|
@@ -184016,7 +184282,7 @@ var PopoverContentModal = React.forwardRef(
|
|
|
184016
184282
|
);
|
|
184017
184283
|
var PopoverContentNonModal = React.forwardRef(
|
|
184018
184284
|
(props, forwardedRef) => {
|
|
184019
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
184285
|
+
const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
|
|
184020
184286
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
184021
184287
|
const hasPointerDownOutsideRef = React.useRef(false);
|
|
184022
184288
|
return /* @__PURE__ */ jsx(
|
|
@@ -184068,7 +184334,7 @@ var PopoverContentImpl = React.forwardRef(
|
|
|
184068
184334
|
onInteractOutside,
|
|
184069
184335
|
...contentProps
|
|
184070
184336
|
} = props;
|
|
184071
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
184337
|
+
const context = usePopoverContext(CONTENT_NAME$3, __scopePopover);
|
|
184072
184338
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
184073
184339
|
useFocusGuards();
|
|
184074
184340
|
return /* @__PURE__ */ jsx(
|
|
@@ -184092,7 +184358,7 @@ var PopoverContentImpl = React.forwardRef(
|
|
|
184092
184358
|
children: /* @__PURE__ */ jsx(
|
|
184093
184359
|
Content$3,
|
|
184094
184360
|
{
|
|
184095
|
-
"data-state": getState$
|
|
184361
|
+
"data-state": getState$2(context.open),
|
|
184096
184362
|
role: "dialog",
|
|
184097
184363
|
id: context.contentId,
|
|
184098
184364
|
...popperScope,
|
|
@@ -184143,7 +184409,7 @@ var PopoverArrow = React.forwardRef(
|
|
|
184143
184409
|
}
|
|
184144
184410
|
);
|
|
184145
184411
|
PopoverArrow.displayName = ARROW_NAME$2;
|
|
184146
|
-
function getState$
|
|
184412
|
+
function getState$2(open) {
|
|
184147
184413
|
return open ? "open" : "closed";
|
|
184148
184414
|
}
|
|
184149
184415
|
var Root2$4 = Popover$1;
|
|
@@ -220897,7 +221163,7 @@ var Checkbox$1 = React.forwardRef(
|
|
|
220897
221163
|
role: "checkbox",
|
|
220898
221164
|
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
220899
221165
|
"aria-required": required,
|
|
220900
|
-
"data-state": getState$
|
|
221166
|
+
"data-state": getState$1(checked),
|
|
220901
221167
|
"data-disabled": disabled ? "" : void 0,
|
|
220902
221168
|
disabled,
|
|
220903
221169
|
value,
|
|
@@ -220942,7 +221208,7 @@ var CheckboxIndicator = React.forwardRef(
|
|
|
220942
221208
|
return /* @__PURE__ */ jsx(Presence$1, { present: forceMount || isIndeterminate(context.state) || context.state === true, children: /* @__PURE__ */ jsx(
|
|
220943
221209
|
Primitive$3.span,
|
|
220944
221210
|
{
|
|
220945
|
-
"data-state": getState$
|
|
221211
|
+
"data-state": getState$1(context.state),
|
|
220946
221212
|
"data-disabled": context.disabled ? "" : void 0,
|
|
220947
221213
|
...indicatorProps,
|
|
220948
221214
|
ref: forwardedRef,
|
|
@@ -221008,14 +221274,14 @@ CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
|
221008
221274
|
function isIndeterminate(checked) {
|
|
221009
221275
|
return checked === "indeterminate";
|
|
221010
221276
|
}
|
|
221011
|
-
function getState$
|
|
221277
|
+
function getState$1(checked) {
|
|
221012
221278
|
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
221013
221279
|
}
|
|
221014
|
-
var Root$
|
|
221280
|
+
var Root$5 = Checkbox$1;
|
|
221015
221281
|
var Indicator$1 = CheckboxIndicator;
|
|
221016
221282
|
|
|
221017
|
-
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$
|
|
221018
|
-
Checkbox.displayName = Root$
|
|
221283
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$5, { 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" }) }) })));
|
|
221284
|
+
Checkbox.displayName = Root$5.displayName;
|
|
221019
221285
|
|
|
221020
221286
|
function CoursesTab({ tenant, currentPage, itemsPerPage, hasManageUsersPermission = false, }) {
|
|
221021
221287
|
var _a;
|
|
@@ -221989,141 +222255,6 @@ function RetrievedDocumentsButton({ sessionId = '', documents, className, label,
|
|
|
221989
222255
|
}, "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 }) })] }) })] }));
|
|
221990
222256
|
}
|
|
221991
222257
|
|
|
221992
|
-
var COLLAPSIBLE_NAME = "Collapsible";
|
|
221993
|
-
var [createCollapsibleContext] = createContextScope$1(COLLAPSIBLE_NAME);
|
|
221994
|
-
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
221995
|
-
var Collapsible$1 = React.forwardRef(
|
|
221996
|
-
(props, forwardedRef) => {
|
|
221997
|
-
const {
|
|
221998
|
-
__scopeCollapsible,
|
|
221999
|
-
open: openProp,
|
|
222000
|
-
defaultOpen,
|
|
222001
|
-
disabled,
|
|
222002
|
-
onOpenChange,
|
|
222003
|
-
...collapsibleProps
|
|
222004
|
-
} = props;
|
|
222005
|
-
const [open, setOpen] = useControllableState$1({
|
|
222006
|
-
prop: openProp,
|
|
222007
|
-
defaultProp: defaultOpen ?? false,
|
|
222008
|
-
onChange: onOpenChange,
|
|
222009
|
-
caller: COLLAPSIBLE_NAME
|
|
222010
|
-
});
|
|
222011
|
-
return /* @__PURE__ */ jsx(
|
|
222012
|
-
CollapsibleProvider,
|
|
222013
|
-
{
|
|
222014
|
-
scope: __scopeCollapsible,
|
|
222015
|
-
disabled,
|
|
222016
|
-
contentId: useId$1(),
|
|
222017
|
-
open,
|
|
222018
|
-
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
222019
|
-
children: /* @__PURE__ */ jsx(
|
|
222020
|
-
Primitive$2.div,
|
|
222021
|
-
{
|
|
222022
|
-
"data-state": getState$1(open),
|
|
222023
|
-
"data-disabled": disabled ? "" : void 0,
|
|
222024
|
-
...collapsibleProps,
|
|
222025
|
-
ref: forwardedRef
|
|
222026
|
-
}
|
|
222027
|
-
)
|
|
222028
|
-
}
|
|
222029
|
-
);
|
|
222030
|
-
}
|
|
222031
|
-
);
|
|
222032
|
-
Collapsible$1.displayName = COLLAPSIBLE_NAME;
|
|
222033
|
-
var TRIGGER_NAME$2 = "CollapsibleTrigger";
|
|
222034
|
-
var CollapsibleTrigger$1 = React.forwardRef(
|
|
222035
|
-
(props, forwardedRef) => {
|
|
222036
|
-
const { __scopeCollapsible, ...triggerProps } = props;
|
|
222037
|
-
const context = useCollapsibleContext(TRIGGER_NAME$2, __scopeCollapsible);
|
|
222038
|
-
return /* @__PURE__ */ jsx(
|
|
222039
|
-
Primitive$2.button,
|
|
222040
|
-
{
|
|
222041
|
-
type: "button",
|
|
222042
|
-
"aria-controls": context.contentId,
|
|
222043
|
-
"aria-expanded": context.open || false,
|
|
222044
|
-
"data-state": getState$1(context.open),
|
|
222045
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
222046
|
-
disabled: context.disabled,
|
|
222047
|
-
...triggerProps,
|
|
222048
|
-
ref: forwardedRef,
|
|
222049
|
-
onClick: composeEventHandlers$1(props.onClick, context.onOpenToggle)
|
|
222050
|
-
}
|
|
222051
|
-
);
|
|
222052
|
-
}
|
|
222053
|
-
);
|
|
222054
|
-
CollapsibleTrigger$1.displayName = TRIGGER_NAME$2;
|
|
222055
|
-
var CONTENT_NAME$3 = "CollapsibleContent";
|
|
222056
|
-
var CollapsibleContent$1 = React.forwardRef(
|
|
222057
|
-
(props, forwardedRef) => {
|
|
222058
|
-
const { forceMount, ...contentProps } = props;
|
|
222059
|
-
const context = useCollapsibleContext(CONTENT_NAME$3, props.__scopeCollapsible);
|
|
222060
|
-
return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
|
|
222061
|
-
}
|
|
222062
|
-
);
|
|
222063
|
-
CollapsibleContent$1.displayName = CONTENT_NAME$3;
|
|
222064
|
-
var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
|
|
222065
|
-
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
222066
|
-
const context = useCollapsibleContext(CONTENT_NAME$3, __scopeCollapsible);
|
|
222067
|
-
const [isPresent, setIsPresent] = React.useState(present);
|
|
222068
|
-
const ref = React.useRef(null);
|
|
222069
|
-
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
222070
|
-
const heightRef = React.useRef(0);
|
|
222071
|
-
const height = heightRef.current;
|
|
222072
|
-
const widthRef = React.useRef(0);
|
|
222073
|
-
const width = widthRef.current;
|
|
222074
|
-
const isOpen = context.open || isPresent;
|
|
222075
|
-
const isMountAnimationPreventedRef = React.useRef(isOpen);
|
|
222076
|
-
const originalStylesRef = React.useRef(void 0);
|
|
222077
|
-
React.useEffect(() => {
|
|
222078
|
-
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
222079
|
-
return () => cancelAnimationFrame(rAF);
|
|
222080
|
-
}, []);
|
|
222081
|
-
useLayoutEffect2$1(() => {
|
|
222082
|
-
const node = ref.current;
|
|
222083
|
-
if (node) {
|
|
222084
|
-
originalStylesRef.current = originalStylesRef.current || {
|
|
222085
|
-
transitionDuration: node.style.transitionDuration,
|
|
222086
|
-
animationName: node.style.animationName
|
|
222087
|
-
};
|
|
222088
|
-
node.style.transitionDuration = "0s";
|
|
222089
|
-
node.style.animationName = "none";
|
|
222090
|
-
const rect = node.getBoundingClientRect();
|
|
222091
|
-
heightRef.current = rect.height;
|
|
222092
|
-
widthRef.current = rect.width;
|
|
222093
|
-
if (!isMountAnimationPreventedRef.current) {
|
|
222094
|
-
node.style.transitionDuration = originalStylesRef.current.transitionDuration;
|
|
222095
|
-
node.style.animationName = originalStylesRef.current.animationName;
|
|
222096
|
-
}
|
|
222097
|
-
setIsPresent(present);
|
|
222098
|
-
}
|
|
222099
|
-
}, [context.open, present]);
|
|
222100
|
-
return /* @__PURE__ */ jsx(
|
|
222101
|
-
Primitive$2.div,
|
|
222102
|
-
{
|
|
222103
|
-
"data-state": getState$1(context.open),
|
|
222104
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
222105
|
-
id: context.contentId,
|
|
222106
|
-
hidden: !isOpen,
|
|
222107
|
-
...contentProps,
|
|
222108
|
-
ref: composedRefs,
|
|
222109
|
-
style: {
|
|
222110
|
-
[`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
|
|
222111
|
-
[`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
|
|
222112
|
-
...props.style
|
|
222113
|
-
},
|
|
222114
|
-
children: isOpen && children
|
|
222115
|
-
}
|
|
222116
|
-
);
|
|
222117
|
-
});
|
|
222118
|
-
function getState$1(open) {
|
|
222119
|
-
return open ? "open" : "closed";
|
|
222120
|
-
}
|
|
222121
|
-
var Root$5 = Collapsible$1;
|
|
222122
|
-
|
|
222123
|
-
const Collapsible = Root$5;
|
|
222124
|
-
const CollapsibleTrigger = CollapsibleTrigger$1;
|
|
222125
|
-
const CollapsibleContent = CollapsibleContent$1;
|
|
222126
|
-
|
|
222127
222258
|
function getFriendlyToolName(toolName) {
|
|
222128
222259
|
if (TOOL_NAME_MAP === null || TOOL_NAME_MAP === void 0 ? void 0 : TOOL_NAME_MAP[toolName])
|
|
222129
222260
|
return TOOL_NAME_MAP[toolName];
|
|
@@ -265007,7 +265138,7 @@ const ProjectFilesModal$1 = lazy(() => Promise.resolve().then(function () { retu
|
|
|
265007
265138
|
const AddMentorToProjectModal$1 = lazy(() => Promise.resolve().then(function () { return addMentorToProjectModal; }).then((mod) => ({
|
|
265008
265139
|
default: mod.AddMentorToProjectModal,
|
|
265009
265140
|
})));
|
|
265010
|
-
function ProjectLandingPage({ project, sessionId, onSubmit, onScreenSharingClick, isScreenSharingModalOpen, onPhoneCallClick, stopGenerating, tenantKey, username, enableSafetyDisclaimer, enableWebBrowsing, isStreaming, updateSessionTools, setSessionTools, activeTools, screenSharing, deepResearch, studyMode, imageGeneration, codeInterpreter, promptsIsEnabled, isPreviewMode, setMessage, mentorId, mentorUniqueId, projectId, googleSlidesIsEnabled, googleDocumentIsEnabled, artifactsEnabled, userIsStudent, isPublicRoute, navigateToProject, showExploreMentors = false, }) {
|
|
265141
|
+
function ProjectLandingPage({ project, sessionId, onSubmit, onScreenSharingClick, isScreenSharingModalOpen, onPhoneCallClick, stopGenerating, tenantKey, username, enableSafetyDisclaimer, enableWebBrowsing, isStreaming, updateSessionTools, setSessionTools, activeTools, screenSharing, deepResearch, studyMode, imageGeneration, codeInterpreter, promptsIsEnabled, isPreviewMode, setMessage, mentorId, mentorUniqueId, projectId, googleSlidesIsEnabled, googleDocumentIsEnabled, artifactsEnabled, userIsStudent, isPublicRoute, navigateToProject, showExploreMentors = false, disabledResourceTypes, maxUploadSizeMb, dropboxExtensions, }) {
|
|
265011
265142
|
var _a;
|
|
265012
265143
|
const [isInstructionsModalOpen, setIsInstructionsModalOpen] = useState(false);
|
|
265013
265144
|
const [isFilesModalOpen, setIsFilesModalOpen] = useState(false);
|
|
@@ -265020,7 +265151,7 @@ function ProjectLandingPage({ project, sessionId, onSubmit, onScreenSharingClick
|
|
|
265020
265151
|
name: mentor.name,
|
|
265021
265152
|
avatar: mentor.profile_image,
|
|
265022
265153
|
description: mentor.description,
|
|
265023
|
-
})), onAddMentorClick: () => setIsAddMentorModalOpen(true), showTitle: true, tenantKey: tenantKey, mentorId: mentorId, projectId: projectId, username: username, navigateToProject: navigateToProject }))] })] })] }), isInstructionsModalOpen && (jsx(Suspense, { fallback: null, children: jsx(ProjectInstructionsModal$1, { isOpen: isInstructionsModalOpen, onClose: () => setIsInstructionsModalOpen(false), tenantKey: tenantKey, projectId: projectId, username: username }) })), isFilesModalOpen && (jsx(Suspense, { fallback: null, children: jsx(ProjectFilesModal$1, { isOpen: isFilesModalOpen, onClose: () => setIsFilesModalOpen(false), tenantKey: tenantKey, mentorId: mentorId, username: username }) })), isAddMentorModalOpen && (jsx(Suspense, { fallback: null, children: jsx(AddMentorToProjectModal$1, { isOpen: isAddMentorModalOpen, onClose: () => setIsAddMentorModalOpen(false), projectName: project.name, tenantKey: tenantKey, projectId: projectId, username: username, isPublicRoute: isPublicRoute }) }))] }));
|
|
265154
|
+
})), onAddMentorClick: () => setIsAddMentorModalOpen(true), showTitle: true, tenantKey: tenantKey, mentorId: mentorId, projectId: projectId, username: username, navigateToProject: navigateToProject }))] })] })] }), isInstructionsModalOpen && (jsx(Suspense, { fallback: null, children: jsx(ProjectInstructionsModal$1, { isOpen: isInstructionsModalOpen, onClose: () => setIsInstructionsModalOpen(false), tenantKey: tenantKey, projectId: projectId, username: username }) })), isFilesModalOpen && (jsx(Suspense, { fallback: null, children: jsx(ProjectFilesModal$1, { isOpen: isFilesModalOpen, onClose: () => setIsFilesModalOpen(false), tenantKey: tenantKey, mentorId: mentorId, username: username, disabledResourceTypes: disabledResourceTypes, maxUploadSizeMb: maxUploadSizeMb, dropboxExtensions: dropboxExtensions }) })), isAddMentorModalOpen && (jsx(Suspense, { fallback: null, children: jsx(AddMentorToProjectModal$1, { isOpen: isAddMentorModalOpen, onClose: () => setIsAddMentorModalOpen(false), projectName: project.name, tenantKey: tenantKey, projectId: projectId, username: username, isPublicRoute: isPublicRoute }) }))] }));
|
|
265024
265155
|
}
|
|
265025
265156
|
|
|
265026
265157
|
function MinimumMentorAlert({ open, onOpenChange }) {
|
|
@@ -265293,8 +265424,9 @@ const TrainOrDeleteModal$1 = dynamic(() => Promise.resolve().then(function () {
|
|
|
265293
265424
|
*/
|
|
265294
265425
|
function isCrawlableDocType(documentType) {
|
|
265295
265426
|
const docType = documentType === null || documentType === void 0 ? void 0 : documentType.toLowerCase();
|
|
265296
|
-
// Uploaded documents
|
|
265297
|
-
|
|
265427
|
+
// Uploaded documents: generic local files ('file') plus the local resource
|
|
265428
|
+
// types that send their own fileType as the document type.
|
|
265429
|
+
const uploadedFileTypes = ['file', 'image', 'audio', 'video', 'zip'];
|
|
265298
265430
|
if (uploadedFileTypes.some((type) => docType === null || docType === void 0 ? void 0 : docType.includes(type))) {
|
|
265299
265431
|
return false;
|
|
265300
265432
|
}
|
|
@@ -265305,6 +265437,12 @@ function isCrawlableDocType(documentType) {
|
|
|
265305
265437
|
}
|
|
265306
265438
|
return true;
|
|
265307
265439
|
}
|
|
265440
|
+
/**
|
|
265441
|
+
* The crawler User-Agent override only applies to web crawler documents.
|
|
265442
|
+
*/
|
|
265443
|
+
function isWebCrawlerDocType(documentType) {
|
|
265444
|
+
return !!(documentType === null || documentType === void 0 ? void 0 : documentType.toLowerCase().includes('webcrawler'));
|
|
265445
|
+
}
|
|
265308
265446
|
function DatasetItem({ dataset, onSelect, isSelected, labels }) {
|
|
265309
265447
|
var _a, _b, _c, _d, _e;
|
|
265310
265448
|
const t = useT();
|
|
@@ -265381,7 +265519,7 @@ function DatasetItem({ dataset, onSelect, isSelected, labels }) {
|
|
|
265381
265519
|
}
|
|
265382
265520
|
}, className: "text-gray-500 hover:text-gray-700", disabled: isEditTrainingDocumentLoading || disabled, children: dataset.access === 'private' ? (jsxs(Fragment$1, { children: [jsx(EyeOff, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: t('datasetsTabDatasetItem.makePublic') })] })) : (jsxs(Fragment$1, { children: [jsx(Eye, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: t('datasetsTabDatasetItem.makePrivate') })] })) })) }) }), jsx(TableCell$1, { className: "p-3 whitespace-nowrap", children: jsx(WithFormPermissions, { name: "is_trained",
|
|
265383
265521
|
// @ts-ignore
|
|
265384
|
-
permissions: (_e = dataset === null || dataset === void 0 ? void 0 : dataset.permissions) === null || _e === void 0 ? void 0 : _e.field, children: ({ disabled }) => (jsx(TrainingStatusSwitch, { is_trained: dataset.is_trained, url: dataset.url, disabled: disabled, training_status: dataset.training_status, handleEditTrainingDocument: handleEditTrainingDocument, onUntrainSuccess: () => setIsDeleteDatasetModalOpen(true), onTrainRequest: () => setIsTrainOrDeleteModalOpen(true) })) }) })] }, dataset.id), isDeleteDatasetModalOpen && (jsx(DeleteDatasetModal$1, { isOpen: isDeleteDatasetModalOpen, onClose: () => setIsDeleteDatasetModalOpen(false), dataset: dataset, labels: labels })), isRetrainScheduleModalOpen && (jsx(RetrainScheduleModal$1, { isOpen: isRetrainScheduleModalOpen, onClose: () => setIsRetrainScheduleModalOpen(false), dataset: dataset, labels: labels })), isTrainOrDeleteModalOpen && (jsx(TrainOrDeleteModal$1, { isOpen: isTrainOrDeleteModalOpen, onClose: () => setIsTrainOrDeleteModalOpen(false), onTrain: handleTrainDataset, onDelete: handleDeleteFromTrainModal, showUserAgentField:
|
|
265522
|
+
permissions: (_e = dataset === null || dataset === void 0 ? void 0 : dataset.permissions) === null || _e === void 0 ? void 0 : _e.field, children: ({ disabled }) => (jsx(TrainingStatusSwitch, { is_trained: dataset.is_trained, url: dataset.url, disabled: disabled, training_status: dataset.training_status, handleEditTrainingDocument: handleEditTrainingDocument, onUntrainSuccess: () => setIsDeleteDatasetModalOpen(true), onTrainRequest: () => setIsTrainOrDeleteModalOpen(true) })) }) })] }, dataset.id), isDeleteDatasetModalOpen && (jsx(DeleteDatasetModal$1, { isOpen: isDeleteDatasetModalOpen, onClose: () => setIsDeleteDatasetModalOpen(false), dataset: dataset, labels: labels })), isRetrainScheduleModalOpen && (jsx(RetrainScheduleModal$1, { isOpen: isRetrainScheduleModalOpen, onClose: () => setIsRetrainScheduleModalOpen(false), dataset: dataset, labels: labels })), isTrainOrDeleteModalOpen && (jsx(TrainOrDeleteModal$1, { isOpen: isTrainOrDeleteModalOpen, onClose: () => setIsTrainOrDeleteModalOpen(false), onTrain: handleTrainDataset, onDelete: handleDeleteFromTrainModal, showUserAgentField: isWebCrawlerDocType(dataset.document_type), isLoading: isEditTrainingDocumentLoading, labels: labels }))] }));
|
|
265385
265523
|
}
|
|
265386
265524
|
function TrainingStatusSwitch({ is_trained, url, training_status, disabled, handleEditTrainingDocument, onUntrainSuccess, onTrainRequest, }) {
|
|
265387
265525
|
const t = useT();
|
|
@@ -265648,6 +265786,15 @@ const resourceTypes = [
|
|
|
265648
265786
|
accept: 'text/plain',
|
|
265649
265787
|
icon: (jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { width: "24", height: "24", rx: "4", fill: "url(#paint0_linear_text)" }), jsx("path", { d: "M7 7H17V9H13V17H11V9H7V7Z", fill: "white" }), jsx("defs", { children: jsxs("linearGradient", { id: "paint0_linear_text", x1: "0", y1: "0", x2: "24", y2: "24", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "#4F46E5" }), jsx("stop", { offset: "1", stopColor: "#06B6D4" })] }) })] })),
|
|
265650
265788
|
},
|
|
265789
|
+
{
|
|
265790
|
+
id: 'markdown',
|
|
265791
|
+
name: 'Markdown',
|
|
265792
|
+
bgColor: 'bg-blue-100',
|
|
265793
|
+
isActive: true,
|
|
265794
|
+
type: 'local',
|
|
265795
|
+
accept: 'text/markdown,.md,.markdown',
|
|
265796
|
+
icon: (jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [jsx("rect", { width: "24", height: "24", rx: "4", fill: "#1F2937" }), jsx("path", { d: "M4 16V8h2l2 3 2-3h2v8H9.5v-4.6L8 13.7l-1.5-2.3V16H4Zm11.5 0L13 13h1.75V8h1.5v5H18l-2.5 3Z", fill: "white" })] })),
|
|
265797
|
+
},
|
|
265651
265798
|
{
|
|
265652
265799
|
id: 'audio',
|
|
265653
265800
|
name: 'Audio',
|
|
@@ -265709,6 +265856,26 @@ const resourceTypes = [
|
|
|
265709
265856
|
},
|
|
265710
265857
|
];
|
|
265711
265858
|
|
|
265859
|
+
/**
|
|
265860
|
+
* Shared chrome for the Add Resources picker and every per-type resource
|
|
265861
|
+
* dialog, mirroring the Datasets tab: a fixed header (title + description bar
|
|
265862
|
+
* with a divider), a body that scrolls on its own (`ResourceDialogBody`), and
|
|
265863
|
+
* an optional fixed footer (`ResourceDialogFooter`).
|
|
265864
|
+
*/
|
|
265865
|
+
function ResourceDialogContent({ title, description, className, children, }) {
|
|
265866
|
+
return (jsxs(DialogContent, { className: cn('flex max-h-[80vh] w-full max-w-lg flex-col gap-0 overflow-hidden p-0', className), children: [jsxs(DialogHeader, { className: "flex-shrink-0 space-y-1 border-b border-gray-200 bg-white px-4 pt-4 pr-10 pb-3 text-left", children: [jsx(DialogTitle, { className: "text-muted-foreground text-base", children: title }), jsx(DialogDescription, { className: "text-xs text-gray-600", children: description })] }), children] }));
|
|
265867
|
+
}
|
|
265868
|
+
/** The only scrolling part of a resource dialog; focusable so keyboard users can scroll it. */
|
|
265869
|
+
function ResourceDialogBody({ label, children }) {
|
|
265870
|
+
return (jsx("div", { className: "min-h-0 flex-1 space-y-4 overflow-x-hidden overflow-y-auto p-4", tabIndex: 0, role: "region", "aria-label": label, children: children }));
|
|
265871
|
+
}
|
|
265872
|
+
/** Actions pinned below the scroll region so they stay visible. */
|
|
265873
|
+
function ResourceDialogFooter({ children }) {
|
|
265874
|
+
return (jsx("div", { className: "flex flex-shrink-0 justify-end border-t border-gray-200 bg-white px-4 py-3", children: children }));
|
|
265875
|
+
}
|
|
265876
|
+
/** Submit button styling shared by every resource dialog footer. */
|
|
265877
|
+
const RESOURCE_SUBMIT_BUTTON_CLASS = 'bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-sm text-white hover:text-white hover:opacity-90';
|
|
265878
|
+
|
|
265712
265879
|
/**
|
|
265713
265880
|
* Spend-cap blocks (HTTP 429) carry the machine code in `error`/`error_code`
|
|
265714
265881
|
* and a friendly, learner-safe sentence in `message`. Detection keys on
|
|
@@ -265803,7 +265970,7 @@ function GithubFileUploadModal() {
|
|
|
265803
265970
|
const { branches, error, isLoading } = useGithubRepoDetails(debouncedGithubUrl, tenantKey);
|
|
265804
265971
|
const isLoadingDisabled = !githubUrl || isLoading || isAddTrainingDocumentLoading;
|
|
265805
265972
|
const isDisabled = isLoadingDisabled || !branch;
|
|
265806
|
-
return (jsxs("div", { className: "
|
|
265973
|
+
return (jsxs(Fragment$1, { children: [jsxs(ResourceDialogBody, { label: t('resourceModalGithubFileUploadModal.scrollRegionAriaLabel'), children: [jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: "github-repo-url", children: t('resourceModalGithubFileUploadModal.repoUrlLabel') }), jsx(Input, { id: "github-repo-url", type: "url", placeholder: t('resourceModalGithubFileUploadModal.githubRepoUrlPlaceholder'), value: githubUrl, onChange: (e) => setGithubUrl(e.target.value), autoComplete: "url", disabled: isAddTrainingDocumentLoading, "aria-describedby": error ? 'github-repo-url-error' : undefined, "aria-invalid": !!error }), error ? (jsx("p", { id: "github-repo-url-error", className: "text-destructive -mt-1 text-xs", role: "alert", children: error })) : null] }), jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: "github-branch", children: t('resourceModalGithubFileUploadModal.branchLabel') }), jsxs(Select$1, { value: branch, onValueChange: (value) => setBranch(value), disabled: isLoadingDisabled, children: [jsx(SelectTrigger, { id: "github-branch", className: "w-full", children: jsx(SelectValue, { placeholder: t('resourceModalGithubFileUploadModal.selectBranchPlaceholder') }) }), jsx(SelectContent, { children: branches.map((b) => (jsx(SelectItem, { value: b, children: b }, b))) })] })] })] }), jsx(ResourceDialogFooter, { children: jsx(Button$1, { onClick: handleSubmit, disabled: isDisabled, className: RESOURCE_SUBMIT_BUTTON_CLASS, children: t('resourceModalGithubFileUploadModal.submit') }) })] }));
|
|
265807
265974
|
}
|
|
265808
265975
|
|
|
265809
265976
|
/**
|
|
@@ -265923,18 +266090,18 @@ function LocalFileUploadModal({ resource, maxFileSizeMB = DEFAULT_MAX_FILE_SIZE_
|
|
|
265923
266090
|
handleUploadFile();
|
|
265924
266091
|
}
|
|
265925
266092
|
};
|
|
265926
|
-
return (jsxs(
|
|
265927
|
-
|
|
265928
|
-
|
|
265929
|
-
|
|
265930
|
-
|
|
265931
|
-
|
|
265932
|
-
|
|
265933
|
-
|
|
265934
|
-
|
|
265935
|
-
|
|
265936
|
-
|
|
265937
|
-
|
|
266093
|
+
return (jsxs(Fragment$1, { children: [jsx(ResourceDialogBody, { label: t('resourceModalLocalFileUploadModal.scrollRegionAriaLabel'), children: jsxs("div", { className: `w-full border-2 border-dashed ${isDraggingFile
|
|
266094
|
+
? 'border-blue-400 bg-blue-50/50 backdrop-blur-sm'
|
|
266095
|
+
: 'border-gray-300 bg-gray-50'} flex flex-col items-center justify-center rounded-lg p-8 transition-all duration-200 ${!isDraggingFile && 'hover:bg-gray-100'}`, onDragOver: handleDragOver, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [jsx("div", { className: "mb-4 rounded-full bg-blue-100 p-3", children: jsx(Upload, { className: "h-8 w-8 text-blue-600" }) }), jsx("h3", { className: "mb-1 text-lg font-medium text-gray-700", children: t('resourceModalLocalFileUploadModal.dragAndDrop') }), jsx("p", { className: "mb-4 text-sm text-gray-500", children: t('resourceModalLocalFileUploadModal.or') }), jsxs("label", { htmlFor: "file-upload", className: "cursor-pointer", children: [jsx("div", { className: "rounded-md bg-gradient-to-r from-blue-600 to-blue-400 px-4 py-2 font-medium text-white transition-colors hover:opacity-90", children: t('resourceModalLocalFileUploadModal.browseFiles') }), jsx("input", { id: "file-upload", type: "file", accept: resource.accept, className: "hidden", ref: fileInputRef, onChange: handleFileChange })] }), jsx("p", { className: "mt-4 text-xs text-gray-500", children: t('resourceModalLocalFileUploadModal.maximumFileSize', {
|
|
266096
|
+
value: maxFileSize.value,
|
|
266097
|
+
unit: maxFileSize.unit,
|
|
266098
|
+
}) }), file && (jsxs(Fragment$1, { children: [jsx("div", { className: "mt-4 flex w-full items-center rounded-md border border-gray-200 bg-white p-3", children: jsxs("div", { className: "flex w-full items-center", children: [jsx("div", { className: "mr-3 flex-shrink-0 rounded-md bg-blue-100 p-2", children: jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2Z", fill: "#4285F4" }), jsx("path", { d: "M14 2V8H20L14 2Z", fill: "#A1C2FA" })] }) }), jsxs("div", { className: "isolate z-50 min-w-0 flex-1 overflow-hidden", children: [jsx("p", { className: "truncate text-sm font-medium", children: file.name }), jsxs("p", { className: "text-xs text-gray-500", children: [convertFromBytes(file.size).value, " ", convertFromBytes(file.size).unit] })] }), jsx("button", { onClick: () => {
|
|
266099
|
+
setFile(null);
|
|
266100
|
+
setDescription('');
|
|
266101
|
+
if (fileInputRef.current) {
|
|
266102
|
+
fileInputRef.current.value = '';
|
|
266103
|
+
}
|
|
266104
|
+
}, className: "ml-2 flex-shrink-0 rounded-full p-1 transition-colors hover:bg-gray-100", children: jsx(X$2, { className: "h-4 w-4 text-gray-500" }) })] }) }), isImageFile(file) && (jsxs("div", { className: "mt-3 grid w-full gap-2", children: [jsx(Label$1, { htmlFor: "image-description", children: t('resourceModalLocalFileUploadModal.descriptionOptional') }), jsx(Textarea, { id: "image-description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: t('resourceModalLocalFileUploadModal.descriptionPlaceholder'), className: "resize-none", rows: 3 })] }))] }))] }) }), jsx(ResourceDialogFooter, { children: jsx(Button$1, { onClick: handleSubmit, disabled: !file || isDisabled, className: RESOURCE_SUBMIT_BUTTON_CLASS, children: isAddTrainingDocumentLoading ? (jsxs(Fragment$1, { children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }), ' ', t('resourceModalLocalFileUploadModal.submitting')] })) : (jsx(Fragment$1, { children: t('resourceModalLocalFileUploadModal.submit') })) }) })] }));
|
|
265938
266105
|
}
|
|
265939
266106
|
|
|
265940
266107
|
function UrlUploadModal({ resource }) {
|
|
@@ -266003,9 +266170,7 @@ function UrlUploadModal({ resource }) {
|
|
|
266003
266170
|
handleSubmitUrl();
|
|
266004
266171
|
}
|
|
266005
266172
|
};
|
|
266006
|
-
return (jsxs("div", { className: "
|
|
266007
|
-
? 'bg-gradient-to-r from-blue-600 to-blue-400 text-white'
|
|
266008
|
-
: 'bg-gray-100 text-gray-500'), children: t('resourceModalUrlUploadModal.submit') }) })] }));
|
|
266173
|
+
return (jsxs(Fragment$1, { children: [jsx(ResourceDialogBody, { label: t('resourceModalUrlUploadModal.scrollRegionAriaLabel'), children: jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: "resource-url", children: t('resourceModalUrlUploadModal.urlLabel') }), jsx(Input, { id: "resource-url", type: "url", placeholder: t('resourceModalUrlUploadModal.urlPlaceholder'), value: url, onChange: handleUrlChange, autoComplete: "url" })] }) }), jsx(ResourceDialogFooter, { children: jsx(Button$1, { onClick: handleSubmit, disabled: !url || isDisabled, className: RESOURCE_SUBMIT_BUTTON_CLASS, children: t('resourceModalUrlUploadModal.submit') }) })] }));
|
|
266009
266174
|
}
|
|
266010
266175
|
|
|
266011
266176
|
function useWebsiteCrawlerResource(resource) {
|
|
@@ -266030,9 +266195,11 @@ function useWebsiteCrawlerResource(resource) {
|
|
|
266030
266195
|
crawler_match_patterns: [],
|
|
266031
266196
|
crawler_pattern_type: 'glob',
|
|
266032
266197
|
temp_crawler_match_patterns: '',
|
|
266198
|
+
crawler_user_agent: '',
|
|
266033
266199
|
},
|
|
266034
266200
|
onSubmit: async ({ value }) => {
|
|
266035
266201
|
try {
|
|
266202
|
+
const crawlerUserAgent = value.crawler_user_agent.trim();
|
|
266036
266203
|
await addTrainingDocument({
|
|
266037
266204
|
org: tenantKey,
|
|
266038
266205
|
formData: {
|
|
@@ -266044,6 +266211,11 @@ function useWebsiteCrawlerResource(resource) {
|
|
|
266044
266211
|
crawler_match_patterns: crawlerMatchPatterns,
|
|
266045
266212
|
//@ts-expect-error crawler_pattern_type may not be on the typed args but is accepted by the API
|
|
266046
266213
|
crawler_pattern_type: value.crawler_pattern_type,
|
|
266214
|
+
// Per-document User-Agent override; sent only when set so the
|
|
266215
|
+
// backend default applies otherwise.
|
|
266216
|
+
...(crawlerUserAgent
|
|
266217
|
+
? { crawler_extra_headers: { 'User-Agent': crawlerUserAgent } }
|
|
266218
|
+
: {}),
|
|
266047
266219
|
},
|
|
266048
266220
|
userId: username !== null && username !== void 0 ? username : '',
|
|
266049
266221
|
}).unwrap();
|
|
@@ -266070,30 +266242,30 @@ function useWebsiteCrawlerResource(resource) {
|
|
|
266070
266242
|
function WebsiteCrawlModal({ resource }) {
|
|
266071
266243
|
const t = useT();
|
|
266072
266244
|
const { form, handleCheckUrlIsValid, crawlerMatchPatterns, setCrawlerMatchPatterns } = useWebsiteCrawlerResource(resource);
|
|
266073
|
-
return (jsxs(
|
|
266074
|
-
|
|
266075
|
-
|
|
266076
|
-
|
|
266077
|
-
|
|
266245
|
+
return (jsxs("form", { className: "flex min-h-0 flex-1 flex-col", onSubmit: (e) => {
|
|
266246
|
+
e.preventDefault();
|
|
266247
|
+
e.stopPropagation();
|
|
266248
|
+
form.handleSubmit();
|
|
266249
|
+
}, "aria-label": t('resourceModalWebsiteCrawlModal.formAriaLabel'), children: [jsxs(ResourceDialogBody, { label: t('resourceModalWebsiteCrawlModal.scrollRegionAriaLabel'), children: [jsx("div", { className: "rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", children: t('resourceModalWebsiteCrawlModal.infoBox') }), jsxs(Fragment$1, { children: [jsx(form.Field, { name: "url", validators: {
|
|
266078
266250
|
onChange: ({ value }) => (!value && t('resourceModalWebsiteCrawlModal.urlRequired')) ||
|
|
266079
266251
|
(!handleCheckUrlIsValid(value) && t('resourceModalWebsiteCrawlModal.invalidUrl')),
|
|
266080
266252
|
}, children: (field) => {
|
|
266081
266253
|
var _a, _b, _c;
|
|
266082
|
-
return (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: field.name, children: t('resourceModalWebsiteCrawlModal.urlLabel') }), jsx(Input, { id: field.name, type: "url", value: field.state.value, onChange: (e) => field.handleChange(e.target.value), placeholder: t('resourceModalWebsiteCrawlModal.urlPlaceholder'), "aria-describedby": ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) ? `${field.name}-error` : undefined, "aria-invalid": !!((_b = field.state.meta.errors) === null || _b === void 0 ? void 0 : _b.length), "aria-required": "true" }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: `${field.name}-error`, className: "text-destructive
|
|
266254
|
+
return (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: field.name, children: t('resourceModalWebsiteCrawlModal.urlLabel') }), jsx(Input, { id: field.name, type: "url", value: field.state.value, onChange: (e) => field.handleChange(e.target.value), placeholder: t('resourceModalWebsiteCrawlModal.urlPlaceholder'), "aria-describedby": ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) ? `${field.name}-error` : undefined, "aria-invalid": !!((_b = field.state.meta.errors) === null || _b === void 0 ? void 0 : _b.length), "aria-required": "true" }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: `${field.name}-error`, className: "text-destructive -mt-1 text-xs", role: "alert", children: field.state.meta.errors })) : null] }));
|
|
266083
266255
|
} }), jsxs("div", { className: "grid grid-cols-2 gap-4", children: [jsx(form.Field, { name: "crawler_max_depth", validators: {
|
|
266084
266256
|
onChange: ({ value }) => (!value && t('resourceModalWebsiteCrawlModal.fieldRequired')) ||
|
|
266085
266257
|
(value < 1 && t('resourceModalWebsiteCrawlModal.mustBeGreaterThanZero')) ||
|
|
266086
266258
|
(value > 10000 && t('resourceModalWebsiteCrawlModal.mustBeLessThan10000')),
|
|
266087
266259
|
}, children: (field) => {
|
|
266088
266260
|
var _a, _b, _c;
|
|
266089
|
-
return (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: field.name, children: t('resourceModalWebsiteCrawlModal.maxCrawlDepthLabel') }), jsx(Input, { id: field.name, type: "number", min: "1", max: "10000", value: field.state.value, onChange: (e) => field.handleChange(Number.parseInt(e.target.value)), "aria-describedby": ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) ? `${field.name}-error` : undefined, "aria-invalid": !!((_b = field.state.meta.errors) === null || _b === void 0 ? void 0 : _b.length), "aria-required": "true" }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: `${field.name}-error`, className: "text-destructive
|
|
266261
|
+
return (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: field.name, children: t('resourceModalWebsiteCrawlModal.maxCrawlDepthLabel') }), jsx(Input, { id: field.name, type: "number", min: "1", max: "10000", value: field.state.value, onChange: (e) => field.handleChange(Number.parseInt(e.target.value)), "aria-describedby": ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) ? `${field.name}-error` : undefined, "aria-invalid": !!((_b = field.state.meta.errors) === null || _b === void 0 ? void 0 : _b.length), "aria-required": "true" }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: `${field.name}-error`, className: "text-destructive -mt-1 text-xs", role: "alert", children: field.state.meta.errors })) : null] }));
|
|
266090
266262
|
} }), jsx(form.Field, { name: "crawler_max_pages_limit", validators: {
|
|
266091
266263
|
onChange: ({ value }) => (!value && t('resourceModalWebsiteCrawlModal.fieldRequired')) ||
|
|
266092
266264
|
(value < 1 && t('resourceModalWebsiteCrawlModal.mustBeGreaterThanZero')),
|
|
266093
266265
|
}, children: (field) => {
|
|
266094
266266
|
var _a, _b, _c;
|
|
266095
|
-
return (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: field.name, children: t('resourceModalWebsiteCrawlModal.maxPagesLimitLabel') }), jsx(Input, { id: field.name, type: "number", min: "1", value: field.state.value, onChange: (e) => field.handleChange(Number.parseInt(e.target.value)), "aria-describedby": ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) ? `${field.name}-error` : undefined, "aria-invalid": !!((_b = field.state.meta.errors) === null || _b === void 0 ? void 0 : _b.length), "aria-required": "true" }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: `${field.name}-error`, className: "text-destructive
|
|
266096
|
-
} })] }), jsx(form.Field, { name: "crawler_pattern_type", children: (field) => (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: "pattern-type", children: t('resourceModalWebsiteCrawlModal.patternTypeLabel') }), jsxs(Select$1, { value: field.state.value, onValueChange: (value) => field.handleChange(value), children: [jsx(SelectTrigger, { id: "pattern-type", "aria-label": t('resourceModalWebsiteCrawlModal.selectPatternTypeAriaLabel'), children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "glob", children: t('resourceModalWebsiteCrawlModal.globPattern') }), jsx(SelectItem, { value: "regex", children: t('resourceModalWebsiteCrawlModal.regularExpression') })] })] })] })) }), jsx(form.Subscribe, { selector: (state) => [
|
|
266267
|
+
return (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: field.name, children: t('resourceModalWebsiteCrawlModal.maxPagesLimitLabel') }), jsx(Input, { id: field.name, type: "number", min: "1", value: field.state.value, onChange: (e) => field.handleChange(Number.parseInt(e.target.value)), "aria-describedby": ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) ? `${field.name}-error` : undefined, "aria-invalid": !!((_b = field.state.meta.errors) === null || _b === void 0 ? void 0 : _b.length), "aria-required": "true" }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: `${field.name}-error`, className: "text-destructive -mt-1 text-xs", role: "alert", children: field.state.meta.errors })) : null] }));
|
|
266268
|
+
} })] }), jsx(form.Field, { name: "crawler_pattern_type", children: (field) => (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: "pattern-type", children: t('resourceModalWebsiteCrawlModal.patternTypeLabel') }), jsxs(Select$1, { value: field.state.value, onValueChange: (value) => field.handleChange(value), children: [jsx(SelectTrigger, { id: "pattern-type", "aria-label": t('resourceModalWebsiteCrawlModal.selectPatternTypeAriaLabel'), children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "glob", children: t('resourceModalWebsiteCrawlModal.globPattern') }), jsx(SelectItem, { value: "regex", children: t('resourceModalWebsiteCrawlModal.regularExpression') })] })] })] })) }), jsx(form.Field, { name: "crawler_user_agent", children: (field) => (jsxs("div", { className: "grid gap-2", children: [jsx(Label$1, { htmlFor: field.name, children: t('resourceModalWebsiteCrawlModal.userAgentLabel') }), jsx(Input, { id: field.name, type: "text", value: field.state.value, onChange: (e) => field.handleChange(e.target.value), placeholder: t('resourceModalWebsiteCrawlModal.userAgentPlaceholder'), "aria-describedby": "user-agent-help" }), jsx("p", { id: "user-agent-help", className: "text-muted-foreground -mt-1 text-xs", children: t('resourceModalWebsiteCrawlModal.userAgentHelpText') })] })) }), jsx(form.Subscribe, { selector: (state) => [
|
|
266097
266269
|
state.values.temp_crawler_match_patterns,
|
|
266098
266270
|
state.values.crawler_pattern_type,
|
|
266099
266271
|
], children: ([tempCrawlerMatchPatterns, crawlerPatternType]) => (jsx(form.Field, { name: "temp_crawler_match_patterns", validators: {
|
|
@@ -266124,14 +266296,24 @@ function WebsiteCrawlModal({ resource }) {
|
|
|
266124
266296
|
]);
|
|
266125
266297
|
field.handleChange('');
|
|
266126
266298
|
}
|
|
266127
|
-
}, disabled: !String(tempCrawlerMatchPatterns).trim(), size: "sm", "aria-label": t('resourceModalWebsiteCrawlModal.addPatternAriaLabel'), children: jsx(Plus, { className: "h-4 w-4" }) })] }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: "pattern-error", className: "text-destructive
|
|
266128
|
-
} })) }), jsx(form.Subscribe, { selector: (state) => [state.isSubmitting], children: ([isSubmitting]) => (jsxs(
|
|
266129
|
-
|
|
266130
|
-
|
|
266131
|
-
}
|
|
266132
|
-
|
|
266133
|
-
|
|
266134
|
-
|
|
266299
|
+
}, disabled: !String(tempCrawlerMatchPatterns).trim(), size: "sm", "aria-label": t('resourceModalWebsiteCrawlModal.addPatternAriaLabel'), children: jsx(Plus, { className: "h-4 w-4" }) })] }), ((_c = field.state.meta.errors) === null || _c === void 0 ? void 0 : _c.length) ? (jsx("p", { id: "pattern-error", className: "text-destructive -mt-1 text-xs", role: "alert", children: field.state.meta.errors })) : null, jsx("p", { id: "pattern-help", className: "text-muted-foreground -mt-1 text-xs", children: t('resourceModalWebsiteCrawlModal.patternHelpText') }), jsx("div", { className: "bg-muted/50 flex min-h-[2rem] flex-wrap gap-2 rounded-md border p-2", role: "list", "aria-label": t('resourceModalWebsiteCrawlModal.addedPatternsAriaLabel'), children: crawlerMatchPatterns.length === 0 ? (jsx("span", { className: "text-muted-foreground text-xs", children: t('resourceModalWebsiteCrawlModal.noPatternsAdded') })) : (crawlerMatchPatterns.map((pattern, index) => (jsxs(Badge, { variant: "secondary", className: "flex items-center gap-1", children: [jsx("span", { className: "text-xs", children: pattern }), jsx("button", { type: "button", onClick: () => setCrawlerMatchPatterns(crawlerMatchPatterns.filter((p) => p !== pattern)), className: "hover:bg-destructive/20 ml-1 rounded-full p-0.5", "aria-label": t('resourceModalWebsiteCrawlModal.removePatternAriaLabel', { pattern }), children: jsx(X$2, { className: "h-3 w-3" }) })] }, index)))) })] })] }));
|
|
266300
|
+
} })) })] })] }), jsx(form.Subscribe, { selector: (state) => [state.isSubmitting], children: ([isSubmitting]) => (jsxs(ResourceDialogFooter, { children: [jsx(Button$1, { type: "submit", className: RESOURCE_SUBMIT_BUTTON_CLASS, disabled: isSubmitting, "aria-describedby": isSubmitting ? 'submitting-status' : undefined, children: isSubmitting
|
|
266301
|
+
? t('resourceModalWebsiteCrawlModal.submitting')
|
|
266302
|
+
: t('resourceModalWebsiteCrawlModal.submit') }), isSubmitting && (jsx("div", { id: "submitting-status", className: "sr-only", role: "status", "aria-live": "polite", children: t('resourceModalWebsiteCrawlModal.formBeingSubmitted') }))] })) })] }));
|
|
266303
|
+
}
|
|
266304
|
+
|
|
266305
|
+
// `link` types open a cloud picker instead of this dialog; it maps to the
|
|
266306
|
+
// generic Add Resources copy only to keep the record total.
|
|
266307
|
+
const DESCRIPTION_KEYS = {
|
|
266308
|
+
github: 'resourceModalGithubFileUploadModal.description',
|
|
266309
|
+
local: 'resourceModalLocalFileUploadModal.description',
|
|
266310
|
+
url: 'resourceModalUrlUploadModal.description',
|
|
266311
|
+
webcrawler: 'resourceModalWebsiteCrawlModal.description',
|
|
266312
|
+
link: 'datasetsTabAddResourceModal.description',
|
|
266313
|
+
};
|
|
266314
|
+
function ResourceModal({ resource, isOpen, onClose, maxFileSizeMB }) {
|
|
266315
|
+
const t = useT();
|
|
266316
|
+
return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(ResourceDialogContent, { title: resource.name, description: t(DESCRIPTION_KEYS[resource.type]), children: [resource.type === 'github' && jsx(GithubFileUploadModal, {}), resource.type === 'local' && (jsx(LocalFileUploadModal, { resource: resource, maxFileSizeMB: maxFileSizeMB })), resource.type === 'webcrawler' && jsx(WebsiteCrawlModal, { resource: resource }), resource.type === 'url' && jsx(UrlUploadModal, { resource: resource })] }) }));
|
|
266135
266317
|
}
|
|
266136
266318
|
|
|
266137
266319
|
var bundle = {exports: {}};
|
|
@@ -266144,6 +266326,8 @@ var bundle = {exports: {}};
|
|
|
266144
266326
|
var bundleExports = bundle.exports;
|
|
266145
266327
|
var GoogleDrivePicker = /*@__PURE__*/getDefaultExportFromCjs(bundleExports);
|
|
266146
266328
|
|
|
266329
|
+
/** Least-privilege scope: only files the user picks/creates via the picker. */
|
|
266330
|
+
const GOOGLE_DRIVE_SCOPES = ['https://www.googleapis.com/auth/drive.file'];
|
|
266147
266331
|
const useGoogleDrivePicker = ({ tenantKey, mentorId }) => {
|
|
266148
266332
|
const [authToken, setAuthToken] = React__default.useState(null);
|
|
266149
266333
|
const [driveFiles, setDriveFiles] = React__default.useState([]);
|
|
@@ -266218,10 +266402,7 @@ const useGoogleDrivePicker = ({ tenantKey, mentorId }) => {
|
|
|
266218
266402
|
refresh_token: 'test-refresh token',
|
|
266219
266403
|
client_id: credentials.client_id,
|
|
266220
266404
|
token: authToken === null || authToken === void 0 ? void 0 : authToken.access_token,
|
|
266221
|
-
scopes:
|
|
266222
|
-
'https://www.googleapis.com/auth/drive.metadata.readonly',
|
|
266223
|
-
'https://www.googleapis.com/auth/drive.readonly',
|
|
266224
|
-
],
|
|
266405
|
+
scopes: GOOGLE_DRIVE_SCOPES,
|
|
266225
266406
|
token_type: authToken === null || authToken === void 0 ? void 0 : authToken.token_type,
|
|
266226
266407
|
expiry_date: new Date(Date.now() + ((authToken === null || authToken === void 0 ? void 0 : authToken.expires_in) || 0) * 1000).toISOString(),
|
|
266227
266408
|
},
|
|
@@ -266315,10 +266496,7 @@ const useGoogleDrivePicker = ({ tenantKey, mentorId }) => {
|
|
|
266315
266496
|
openPicker({
|
|
266316
266497
|
clientId: credentials.client_id,
|
|
266317
266498
|
developerKey: credentials.developer_key,
|
|
266318
|
-
customScopes:
|
|
266319
|
-
'https://www.googleapis.com/auth/drive.metadata.readonly',
|
|
266320
|
-
'https://www.googleapis.com/auth/drive.readonly',
|
|
266321
|
-
],
|
|
266499
|
+
customScopes: GOOGLE_DRIVE_SCOPES,
|
|
266322
266500
|
// @ts-expect-error - token accepts null to force fresh auth per google-drive-picker API
|
|
266323
266501
|
token: null, // Always start with null token to force fresh auth
|
|
266324
266502
|
showUploadView: true,
|
|
@@ -266406,6 +266584,8 @@ const useGoogleDrivePicker = ({ tenantKey, mentorId }) => {
|
|
|
266406
266584
|
forceClosePickerModal,
|
|
266407
266585
|
pickerError,
|
|
266408
266586
|
resetPickerState,
|
|
266587
|
+
credentialsLoaded: credentialLoaded,
|
|
266588
|
+
isConfigured: Boolean(credentials.client_id),
|
|
266409
266589
|
};
|
|
266410
266590
|
};
|
|
266411
266591
|
|
|
@@ -266476,6 +266656,7 @@ function ieOnEnd (script, cb) {
|
|
|
266476
266656
|
|
|
266477
266657
|
var loadScript = /*@__PURE__*/getDefaultExportFromCjs(loadScript$1);
|
|
266478
266658
|
|
|
266659
|
+
/** Default file types offered by the Dropbox chooser. Hosts override via `extensions`. */
|
|
266479
266660
|
const DROPBOX_EXTENSIONS = [
|
|
266480
266661
|
'.pdf',
|
|
266481
266662
|
'.doc',
|
|
@@ -266487,6 +266668,12 @@ const DROPBOX_EXTENSIONS = [
|
|
|
266487
266668
|
'.xlsx',
|
|
266488
266669
|
'.ppt',
|
|
266489
266670
|
'.pptx',
|
|
266671
|
+
'.png',
|
|
266672
|
+
'.jpeg',
|
|
266673
|
+
'.jpg',
|
|
266674
|
+
'.mp3',
|
|
266675
|
+
'.wav',
|
|
266676
|
+
'.m4a',
|
|
266490
266677
|
];
|
|
266491
266678
|
const DROPBOX_SDK_URL = 'https://www.dropbox.com/static/api/2/dropins.js';
|
|
266492
266679
|
const SCRIPT_ID = 'dropboxjs';
|
|
@@ -266495,6 +266682,7 @@ const useDropboxPicker = ({ tenantKey, mentorId, cancel = () => { }, linkType =
|
|
|
266495
266682
|
const [dropboxReady, setDropboxReady] = useState(false);
|
|
266496
266683
|
const [openChooser, setOpenChooser] = useState(false);
|
|
266497
266684
|
const [appKey, setAppKey] = useState(null);
|
|
266685
|
+
const [credentialsLoaded, setCredentialsLoaded] = useState(false);
|
|
266498
266686
|
// Use RTK Query hooks
|
|
266499
266687
|
const [getCredentials] = useLazyGetCredentialsQuery();
|
|
266500
266688
|
const [addTrainingDocument] = useAddTrainingDocumentMutation();
|
|
@@ -266517,6 +266705,7 @@ const useDropboxPicker = ({ tenantKey, mentorId, cancel = () => { }, linkType =
|
|
|
266517
266705
|
catch (error) {
|
|
266518
266706
|
console.error(JSON.stringify({ tenant: tenantKey, error }));
|
|
266519
266707
|
}
|
|
266708
|
+
setCredentialsLoaded(true);
|
|
266520
266709
|
}
|
|
266521
266710
|
};
|
|
266522
266711
|
handleFetchAppKey();
|
|
@@ -266614,6 +266803,8 @@ const useDropboxPicker = ({ tenantKey, mentorId, cancel = () => { }, linkType =
|
|
|
266614
266803
|
openChooser: onChoose,
|
|
266615
266804
|
dropboxReady,
|
|
266616
266805
|
appKey,
|
|
266806
|
+
credentialsLoaded,
|
|
266807
|
+
isConfigured: Boolean(appKey),
|
|
266617
266808
|
};
|
|
266618
266809
|
};
|
|
266619
266810
|
|
|
@@ -266623,6 +266814,7 @@ const useOneDrivePicker = ({ tenantKey, mentorId }) => {
|
|
|
266623
266814
|
const [onedriveAppId, setOnedriveAppId] = useState(null);
|
|
266624
266815
|
const [fullDomain, setFullDomain] = useState(null);
|
|
266625
266816
|
const [isSDKLoaded, setIsSDKLoaded] = useState(false);
|
|
266817
|
+
const [credentialsLoaded, setCredentialsLoaded] = useState(false);
|
|
266626
266818
|
// Use RTK Query hooks
|
|
266627
266819
|
const [getCredentials] = useLazyGetCredentialsQuery();
|
|
266628
266820
|
const [addTrainingDocument] = useAddTrainingDocumentMutation();
|
|
@@ -266737,6 +266929,7 @@ const useOneDrivePicker = ({ tenantKey, mentorId }) => {
|
|
|
266737
266929
|
catch (error) {
|
|
266738
266930
|
console.error(JSON.stringify({ tenant: tenantKey, error }));
|
|
266739
266931
|
}
|
|
266932
|
+
setCredentialsLoaded(true);
|
|
266740
266933
|
}
|
|
266741
266934
|
};
|
|
266742
266935
|
handleFetchAppId();
|
|
@@ -266829,46 +267022,81 @@ const useOneDrivePicker = ({ tenantKey, mentorId }) => {
|
|
|
266829
267022
|
pickOneDriveFile,
|
|
266830
267023
|
onedriveAppId,
|
|
266831
267024
|
isSDKLoaded,
|
|
267025
|
+
credentialsLoaded,
|
|
267026
|
+
isConfigured: Boolean(onedriveAppId),
|
|
266832
267027
|
};
|
|
266833
267028
|
};
|
|
266834
267029
|
|
|
266835
|
-
function AddResourceModal({ isOpen, onClose, disabledDatasets = [], }) {
|
|
267030
|
+
function AddResourceModal({ isOpen, onClose, disabledDatasets = [], maxFileSizeMB, dropboxExtensions, }) {
|
|
266836
267031
|
const t = useT();
|
|
266837
267032
|
const { tenantKey, mentorId } = useAgentSettings();
|
|
266838
267033
|
const [selectedResource, setSelectedResource] = React__default.useState(null);
|
|
266839
|
-
const
|
|
267034
|
+
const dropbox = useDropboxPicker({
|
|
266840
267035
|
autoShow: false,
|
|
266841
267036
|
tenantKey,
|
|
266842
267037
|
mentorId,
|
|
267038
|
+
extensions: dropboxExtensions,
|
|
266843
267039
|
});
|
|
266844
|
-
const { handlePickerOpen, loadGoogleApiScript, isPickerLoaded, forceClosePickerModal, pickerError, } = useGoogleDrivePicker({ tenantKey, mentorId });
|
|
266845
|
-
const
|
|
266846
|
-
|
|
266847
|
-
|
|
266848
|
-
|
|
266849
|
-
|
|
266850
|
-
|
|
266851
|
-
|
|
266852
|
-
|
|
266853
|
-
|
|
266854
|
-
|
|
266855
|
-
|
|
266856
|
-
|
|
266857
|
-
|
|
266858
|
-
|
|
266859
|
-
|
|
266860
|
-
|
|
266861
|
-
|
|
266862
|
-
|
|
266863
|
-
|
|
266864
|
-
|
|
266865
|
-
|
|
267040
|
+
const { handlePickerOpen, loadGoogleApiScript, isPickerLoaded, forceClosePickerModal, pickerError, credentialsLoaded: googleCredentialsLoaded, isConfigured: googleIsConfigured, } = useGoogleDrivePicker({ tenantKey, mentorId });
|
|
267041
|
+
const oneDrive = useOneDrivePicker({ tenantKey, mentorId });
|
|
267042
|
+
// A cloud provider only works once the tenant has OAuth credentials for it
|
|
267043
|
+
// (GET .../integration-credential/?name=<provider>). Without them the SDK is
|
|
267044
|
+
// handed an empty client id and the click does nothing at all — no popup, no
|
|
267045
|
+
// error — which reads as a broken button. Disable and say why instead.
|
|
267046
|
+
// `loaded` gates on the lookup having finished so the buttons are not
|
|
267047
|
+
// disabled during the in-flight fetch.
|
|
267048
|
+
const cloudProviders = {
|
|
267049
|
+
'google-drive': {
|
|
267050
|
+
loaded: googleCredentialsLoaded,
|
|
267051
|
+
configured: googleIsConfigured,
|
|
267052
|
+
},
|
|
267053
|
+
onedrive: {
|
|
267054
|
+
loaded: oneDrive.credentialsLoaded,
|
|
267055
|
+
configured: oneDrive.isConfigured,
|
|
267056
|
+
},
|
|
267057
|
+
dropbox: {
|
|
267058
|
+
loaded: dropbox.credentialsLoaded,
|
|
267059
|
+
configured: dropbox.isConfigured,
|
|
267060
|
+
},
|
|
267061
|
+
};
|
|
267062
|
+
return (jsxs(Fragment$1, { children: [jsx(Script, { src: "https://apis.google.com/js/api.js", onLoad: loadGoogleApiScript, strategy: "lazyOnload" }), jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsx(ResourceDialogContent, { title: t('datasetsTabAddResourceModal.title'), description: t('datasetsTabAddResourceModal.description'), className: "sm:max-w-[800px]", children: jsxs(ResourceDialogBody, { label: t('datasetsTabAddResourceModal.scrollRegionAriaLabel'), children: [pickerError && (jsx("div", { className: "rounded-lg border border-red-200 bg-red-50 p-4", children: jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { children: [jsx("h4", { className: "text-sm font-medium text-red-800", children: t('datasetsTabAddResourceModal.googleDrivePickerError') }), jsx("p", { className: "mt-1 text-sm text-red-600", children: pickerError })] }), jsx("button", { onClick: forceClosePickerModal, className: "ml-4 rounded bg-red-100 px-3 py-1 text-sm font-medium text-red-800 hover:bg-red-200", children: t('datasetsTabAddResourceModal.forceClosePicker') })] }) })), jsx("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: resourceTypes.map((resource) => {
|
|
267063
|
+
const cloudProvider = cloudProviders[resource.id];
|
|
267064
|
+
const notConfigured = cloudProvider
|
|
267065
|
+
? cloudProvider.loaded && !cloudProvider.configured
|
|
267066
|
+
: false;
|
|
267067
|
+
const isDisabled = !resource.isActive ||
|
|
267068
|
+
disabledDatasets.includes(resource.id.toLowerCase()) ||
|
|
267069
|
+
notConfigured;
|
|
267070
|
+
return (jsxs("button", { title: notConfigured ? t('datasetsTabAddResourceModal.notConfigured') : undefined, className: cn('flex items-center rounded-lg border p-4 transition-colors duration-200 hover:bg-gray-50', !isDisabled ? 'cursor-pointer' : 'cursor-not-allowed opacity-50'), onClick: () => {
|
|
267071
|
+
if (resource.type !== 'link') {
|
|
267072
|
+
setSelectedResource(resource);
|
|
267073
|
+
return;
|
|
267074
|
+
}
|
|
267075
|
+
if (resource.name === 'Google Drive') {
|
|
267076
|
+
if (isPickerLoaded) {
|
|
267077
|
+
handlePickerOpen();
|
|
266866
267078
|
}
|
|
266867
|
-
|
|
266868
|
-
|
|
266869
|
-
|
|
267079
|
+
else {
|
|
267080
|
+
// Show loading state or toast
|
|
267081
|
+
console.log('Google Picker is still loading...');
|
|
266870
267082
|
}
|
|
266871
|
-
|
|
267083
|
+
return;
|
|
267084
|
+
}
|
|
267085
|
+
if (resource.name === 'Dropbox') {
|
|
267086
|
+
dropbox.openChooser();
|
|
267087
|
+
return;
|
|
267088
|
+
}
|
|
267089
|
+
if (resource.name === 'Microsoft OneDrive') {
|
|
267090
|
+
oneDrive.pickOneDriveFile();
|
|
267091
|
+
return;
|
|
267092
|
+
}
|
|
267093
|
+
}, disabled: isDisabled, children: [jsx("div", { className: "mr-3 flex h-10 w-10 items-center justify-center rounded-md bg-blue-100", children: resource.icon }), jsxs("span", { className: "flex flex-col items-start text-left", children: [jsx("span", { className: "text-gray-700", children: resource.name }), notConfigured && (
|
|
267094
|
+
// aria-hidden: the same text is already the button's
|
|
267095
|
+
// `title`, so exposing it here too would append it to
|
|
267096
|
+
// the accessible name ("Dropbox Not configured for
|
|
267097
|
+
// this tenant") and break name-based lookups.
|
|
267098
|
+
jsx("span", { "aria-hidden": "true", className: "text-xs text-gray-500", children: t('datasetsTabAddResourceModal.notConfigured') }))] })] }, resource.id));
|
|
267099
|
+
}) })] }) }) }), selectedResource && (jsx(ResourceModal, { resource: selectedResource, isOpen: !!selectedResource, onClose: () => setSelectedResource(null), maxFileSizeMB: maxFileSizeMB }))] }));
|
|
266872
267100
|
}
|
|
266873
267101
|
|
|
266874
267102
|
// DatasetItemList requires a full labels object; without it the empty-state
|
|
@@ -266880,7 +267108,7 @@ const PROJECT_FILES_DATASET_LABELS = resolveDatasetsTabLabels({
|
|
|
266880
267108
|
function ProjectFilesModal(props) {
|
|
266881
267109
|
return (jsx(AgentSettingsProvider, { tenantKey: props.tenantKey, mentorId: props.mentorId, username: props.username, enableRBAC: false, children: jsx(ProjectFilesModalInner, { ...props }) }));
|
|
266882
267110
|
}
|
|
266883
|
-
function ProjectFilesModalInner({ isOpen, onClose }) {
|
|
267111
|
+
function ProjectFilesModalInner({ isOpen, onClose, disabledResourceTypes, maxUploadSizeMb, dropboxExtensions, }) {
|
|
266884
267112
|
var _a;
|
|
266885
267113
|
const t = useT();
|
|
266886
267114
|
const [showAddResourceModal, setShowAddResourceModal] = React__default.useState(false);
|
|
@@ -266895,7 +267123,7 @@ function ProjectFilesModalInner({ isOpen, onClose }) {
|
|
|
266895
267123
|
// @ts-expect-error - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
|
|
266896
267124
|
, {
|
|
266897
267125
|
// @ts-expect-error - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
|
|
266898
|
-
datasets: (_a = datasets === null || datasets === void 0 ? void 0 : datasets.results) !== null && _a !== void 0 ? _a : [], labels: PROJECT_FILES_DATASET_LABELS })] })) }) }) }), jsx(IblPagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: handlePageChange, disabled: isDatasetsFetching || isDatasetsLoading }), jsx(AddResourceModal, { isOpen: showAddResourceModal, onClose: () => closeAddResourceModal(), keepParentOpen: true }), isModalOpen && FreeTrialDialog && (jsx(FreeTrialDialog, { isOpen: isModalOpen, onClose: closeModal }))] }) })] }) }) }));
|
|
267126
|
+
datasets: (_a = datasets === null || datasets === void 0 ? void 0 : datasets.results) !== null && _a !== void 0 ? _a : [], labels: PROJECT_FILES_DATASET_LABELS })] })) }) }) }), jsx(IblPagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: handlePageChange, disabled: isDatasetsFetching || isDatasetsLoading }), jsx(AddResourceModal, { isOpen: showAddResourceModal, onClose: () => closeAddResourceModal(), keepParentOpen: true, disabledDatasets: disabledResourceTypes, maxFileSizeMB: maxUploadSizeMb, dropboxExtensions: dropboxExtensions }), isModalOpen && FreeTrialDialog && (jsx(FreeTrialDialog, { isOpen: isModalOpen, onClose: closeModal }))] }) })] }) }) }));
|
|
266899
267127
|
}
|
|
266900
267128
|
|
|
266901
267129
|
var projectFilesModal = /*#__PURE__*/Object.freeze({
|
|
@@ -280028,11 +280256,12 @@ function AgentHumanSupportTab({ PaginationComponent = IblPagination, labels: lab
|
|
|
280028
280256
|
: labels.list.untitled }) }), jsx("div", { className: "mx-auto w-full max-w-full overflow-x-hidden", children: selectedTicket && renderTicketDetail(selectedTicket) })] }) })] }));
|
|
280029
280257
|
}
|
|
280030
280258
|
|
|
280031
|
-
function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId, AddResourceModal, PaginationComponent, page, search, onPageChange, onSearchChange, }) {
|
|
280259
|
+
function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId, AddResourceModal: AddResourceModal$1, PaginationComponent, page, search, onPageChange, onSearchChange, disabledResourceTypes, maxUploadSizeMb, dropboxExtensions, }) {
|
|
280032
280260
|
var _a;
|
|
280033
280261
|
const { tenantKey, mentorId, username, rbacPermissions, executeGatedAction } = useAgentSettings();
|
|
280034
280262
|
const t = useT();
|
|
280035
280263
|
const labels = React__default.useMemo(() => resolveDatasetsTabLabels(labelsOverride, t), [labelsOverride, t]);
|
|
280264
|
+
const Pagination = PaginationComponent !== null && PaginationComponent !== void 0 ? PaginationComponent : IblPagination;
|
|
280036
280265
|
const [showAddResourceModal, setShowAddResourceModal] = React__default.useState(false);
|
|
280037
280266
|
const openAddResourceModal = () => setShowAddResourceModal(true);
|
|
280038
280267
|
const closeAddResourceModal = () => setShowAddResourceModal(false);
|
|
@@ -280074,7 +280303,7 @@ function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId,
|
|
|
280074
280303
|
// @ts-ignore - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
|
|
280075
280304
|
, {
|
|
280076
280305
|
// @ts-ignore - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
|
|
280077
|
-
datasets: (_a = datasets === null || datasets === void 0 ? void 0 : datasets.results) !== null && _a !== void 0 ? _a : [], onSelect: onSelect, selectedDatasetId: selectedDatasetId, labels: labels })] })) }) }) }),
|
|
280306
|
+
datasets: (_a = datasets === null || datasets === void 0 ? void 0 : datasets.results) !== null && _a !== void 0 ? _a : [], onSelect: onSelect, selectedDatasetId: selectedDatasetId, labels: labels })] })) }) }) }), jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: handlePageChange, disabled: isDatasetsFetching || isDatasetsLoading }), AddResourceModal$1 ? (jsx(AddResourceModal$1, { isOpen: showAddResourceModal, onClose: () => closeAddResourceModal(), keepParentOpen: true })) : (jsx(AddResourceModal, { isOpen: showAddResourceModal, onClose: () => closeAddResourceModal(), keepParentOpen: true, disabledDatasets: disabledResourceTypes, maxFileSizeMB: maxUploadSizeMb, dropboxExtensions: dropboxExtensions }))] })] })] }));
|
|
280078
280307
|
}
|
|
280079
280308
|
|
|
280080
280309
|
/**
|