@iblai/iblai-js 1.18.0 → 1.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  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, useMemo, createContext, useReducer, useRef, useImperativeHandle, useCallback, useContext, useId as useId$2, useDebugValue, cloneElement, lazy, Suspense, Component as Component$1 } from 'react';
4
- import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetMentorsQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, 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, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, useGetMentorPublicSettingsQuery, useGetChatHistoryFilterQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStarMentorMutation, useUnstarMentorMutation, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
4
+ import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetMentorsQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, 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, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, useGetMentorPublicSettingsQuery, useGetChatHistoryFilterQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStarMentorMutation, useUnstarMentorMutation, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
5
5
  import { getInitials, useTenantMetadata, WithPermissions, useStripeUpgrade, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, selectRbacPermissions, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, ANONYMOUS_USERNAME as ANONYMOUS_USERNAME$2, redirectToAuthSpaJoinTenant, selectActiveTab, useAxdToken, useWelcomeMessage, markdownToPlainText, useCachedSessionId, use402ErrorCheck, selectTokenEnabled, selectToken, useServiceWorker, useUserAgreement, useAdvancedChat, sendMessageToParentWebsite, useMentorTools, useFileDragDrop, eventBus, RemoteEvents, selectEnableChatActionsPopup, advancedTabs, isInIframe, getAuthSpaJoinUrl, addMessage, clearFiles, MENTOR_VISIBILITY } from '@iblai/web-utils';
6
6
  import { useDispatch, useSelector } from 'react-redux';
7
7
  import { toast, Toaster as Toaster$1 } from 'sonner';
@@ -11,10 +11,10 @@ import Link$2 from 'next/link';
11
11
  import * as ReactDOM from 'react-dom';
12
12
  import ReactDOM__default from 'react-dom';
13
13
  import { z as z$3 } from 'zod';
14
- import { MentorVisibilityEnum, TransportEnum, PromptVisibilityEnum } from '@iblai/iblai-api';
15
- import '@reduxjs/toolkit/query';
16
14
  import * as DialogPrimitive from '@radix-ui/react-dialog';
17
15
  import { createDialogScope } from '@radix-ui/react-dialog';
16
+ import { MentorVisibilityEnum, TransportEnum, PromptVisibilityEnum } from '@iblai/iblai-api';
17
+ import '@reduxjs/toolkit/query';
18
18
  import dynamic from 'next/dynamic';
19
19
  import Script from 'next/script';
20
20
  import { useRouter } from 'next/router';
@@ -124170,7 +124170,7 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
124170
124170
  }, children: [jsxs("div", { className: "flex flex-col items-center justify-center py-8 px-6 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [isUserMetadataEdxLoading || isUploadingProfileImage ? (jsx(Skeleton, { className: "h-20 w-20 mb-6 rounded-full", "aria-label": "Loading profile image" })) : (jsxs("button", { type: "button", className: "relative w-20 h-20 mb-6 cursor-pointer group rounded-full focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2", onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false), onClick: handleAvatarClick, "aria-label": "Upload profile picture", children: [jsxs(Avatar, { className: "h-20 w-20", children: [((_b = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _b === void 0 ? void 0 : _b.has_image) ? (jsx(AvatarImage, { src: (_c = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _c === void 0 ? void 0 : _c.image_url_full, alt: "Profile picture", className: "rounded-full object-cover w-full h-full group-hover:opacity-80 transition-opacity" })) : customization.useGravatarPicFallback ? (jsx(Gravatar$1, { className: "w-full h-full rounded-full object-cover group-hover:opacity-80 transition-opacity", email: userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email, size: 80, alt: "Profile picture from Gravatar" })) : (jsx(Fragment$1, {})), jsx(AvatarFallback, { className: cn('bg-blue-800 text-white text-xl rounded-full', customization.useGravatarPicFallback &&
124171
124171
  !((_d = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _d === void 0 ? void 0 : _d.image_url_full)
124172
124172
  ? 'hidden'
124173
- : ''), children: getInitials((userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email) || '') })] }), isHovering && (jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-blue-800 rounded-full border-4 border-white/20", "aria-hidden": "true", children: jsx("span", { className: "text-white text-xs font-medium text-center px-2", children: "Upload" }) })), jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileUpload, className: "hidden", "aria-label": "Choose profile picture to upload", tabIndex: -1 })] })), jsxs("h2", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 text-center mb-4", children: [userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name, customization.showUsernameField && `, ${userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username}`] }), jsxs("div", { className: "flex justify-center space-x-3", children: [jsxs("div", { className: "bg-blue-100 text-blue-700 px-2 py-1 rounded font-medium flex items-center text-sm", children: [jsx(RoleIcon, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), jsx("span", { children: isAdmin ? 'Admin' : 'Student' })] }), customization.showPlatformName && (jsx("div", { className: "bg-gray-100 text-gray-600 px-4 py-2 rounded text-xs font-medium", children: tenant.toUpperCase() }))] })] }), jsx("nav", { className: "flex-1 overflow-y-auto", style: { minHeight: 0 }, "aria-label": "Profile tabs", children: jsx("div", { className: "p-4", children: jsx("div", { className: "flex flex-col space-y-2", role: "tablist", "aria-orientation": "vertical", children: TABS.map((tab) => (jsxs("button", { role: "tab", "aria-selected": activeTab === tab.id, "aria-controls": `${tab.id}-tabpanel`, id: `${tab.id}-tab`, onClick: () => setActiveTab(tab.id), className: `w-full justify-start px-4 py-3 text-left rounded-lg transition-all flex items-center text-base ${activeTab === tab.id
124173
+ : ''), children: getInitials((userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email) || '') })] }), isHovering && (jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-blue-800 rounded-full border-4 border-white/20", "aria-hidden": "true", children: jsx("span", { className: "text-white text-xs font-medium text-center px-2", children: "Upload" }) })), jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileUpload, className: "hidden", "aria-label": "Choose profile picture to upload", tabIndex: -1 })] })), jsxs("h2", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 text-center mb-4", children: [userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name, customization.showUsernameField && `, ${userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username}`] }), jsxs("div", { className: "flex justify-center space-x-3", children: [jsxs("div", { className: "bg-blue-100 text-blue-700 px-2 py-1 rounded font-medium flex items-center text-sm", children: [jsx(RoleIcon, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), jsx("span", { children: isAdmin ? 'Admin' : 'User' })] }), customization.showPlatformName && (jsx("div", { className: "bg-gray-100 text-gray-600 px-4 py-2 rounded text-xs font-medium", children: tenant.toUpperCase() }))] })] }), jsx("nav", { className: "flex-1 overflow-y-auto", style: { minHeight: 0 }, "aria-label": "Profile tabs", children: jsx("div", { className: "p-4", children: jsx("div", { className: "flex flex-col space-y-2", role: "tablist", "aria-orientation": "vertical", children: TABS.map((tab) => (jsxs("button", { role: "tab", "aria-selected": activeTab === tab.id, "aria-controls": `${tab.id}-tabpanel`, id: `${tab.id}-tab`, onClick: () => setActiveTab(tab.id), className: `w-full justify-start px-4 py-3 text-left rounded-lg transition-all flex items-center text-base ${activeTab === tab.id
124174
124174
  ? 'bg-blue-50 text-blue-700 font-medium'
124175
124175
  : 'hover:bg-gray-50 text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100'}`, children: [jsx(tab.renderIcon, { className: "h-5 w-5 mr-3 flex-shrink-0", "aria-hidden": "true" }), jsx("span", { className: "truncate", children: tab.label })] }, tab.id))) }) }) })] }), jsx("nav", { className: "lg:hidden", "aria-label": "Profile tabs mobile", children: jsx("div", { className: "w-full justify-start px-6 py-2 bg-white border-b border-gray-200 rounded-none h-auto overflow-x-auto", children: jsx("div", { className: "flex space-x-2", role: "tablist", "aria-orientation": "horizontal", children: TABS.map((tab) => (jsxs("button", { role: "tab", "aria-selected": activeTab === tab.id, "aria-controls": `${tab.id}-tabpanel`, id: `${tab.id}-tab-mobile`, onClick: () => setActiveTab(tab.id), className: `flex items-center gap-2 px-3 py-2 rounded-lg whitespace-nowrap text-sm transition-all ${activeTab === tab.id
124176
124176
  ? 'bg-blue-50 text-blue-600 font-medium'
@@ -126137,7 +126137,7 @@ function UsersTab({ tenant, onInviteClick }) {
126137
126137
  const userData = isResultsWithPolicies
126138
126138
  ? (users === null || users === void 0 ? void 0 : users.results).data
126139
126139
  : [];
126140
- return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1", children: [jsxs("div", { className: "relative mb-6 max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { type: "text", value: searchQuery, onChange: (event) => setQuerySearch(event.target.value), placeholder: "Search users", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": "Search users" }), searchQuery.length > 0 && (searchQuery !== debouncedSearchQuery || isLoading) && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx("div", { className: "mb-6", children: jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", onClick: onInviteClick, children: "Invite" }) })] }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Name" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Email" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Role" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Policies" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[18%]", children: "Status" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [userData.map((user, index) => (jsxs("tr", { children: [jsx("td", { "aria-label": 'user-management-name-column', className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm whitespace-nowrap overflow-hidden text-ellipsis max-w-0", children: jsx("div", { className: "truncate", children: user.name }) }), jsx("td", { "aria-label": 'user-management-email-column', className: "px-6 py-4 text-gray-600 dark:text-gray-300 text-sm max-w-0", children: jsx("div", { className: "truncate", children: user.email }) }), jsx("td", { className: "px-6 py-4", children: jsxs(Select$1, { value: user.is_admin ? 'admin' : 'student', onValueChange: () => handleUserRoleChange(user), children: [jsx(SelectTrigger, { className: "w-full text-sm", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { className: "text-sm", children: [jsx(SelectItem, { value: "admin", children: "Admin" }), jsx(SelectItem, { value: "student", children: "Student" })] })] }) }), jsx("td", { className: "px-6 py-4", children: jsxs(Popover, { modal: true, open: openPolicyPopover === user.user_id, onOpenChange: (open) => setOpenPolicyPopover(open ? user.user_id : null), children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", role: "combobox", "aria-expanded": openPolicyPopover === user.user_id, "aria-label": `Select policies for ${user.name}`, className: "w-full justify-between text-sm h-9 font-normal", disabled: updatingUserIds.has(user === null || user === void 0 ? void 0 : user.user_id), children: [jsx("span", { className: "truncate", children: user.is_admin
126140
+ return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1", children: [jsxs("div", { className: "relative mb-6 max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { type: "text", value: searchQuery, onChange: (event) => setQuerySearch(event.target.value), placeholder: "Search users", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": "Search users" }), searchQuery.length > 0 && (searchQuery !== debouncedSearchQuery || isLoading) && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx("div", { className: "mb-6", children: jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", onClick: onInviteClick, children: "Invite" }) })] }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Name" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Email" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Role" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Policies" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[18%]", children: "Status" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [userData.map((user, index) => (jsxs("tr", { children: [jsx("td", { "aria-label": 'user-management-name-column', className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm whitespace-nowrap overflow-hidden text-ellipsis max-w-0", children: jsx("div", { className: "truncate", children: user.name }) }), jsx("td", { "aria-label": 'user-management-email-column', className: "px-6 py-4 text-gray-600 dark:text-gray-300 text-sm max-w-0", children: jsx("div", { className: "truncate", children: user.email }) }), jsx("td", { className: "px-6 py-4", children: jsxs(Select$1, { value: user.is_admin ? 'admin' : 'student', onValueChange: () => handleUserRoleChange(user), children: [jsx(SelectTrigger, { className: "w-full text-sm", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { className: "text-sm", children: [jsx(SelectItem, { value: "admin", children: "Admin" }), jsx(SelectItem, { value: "student", children: "User" })] })] }) }), jsx("td", { className: "px-6 py-4", children: jsxs(Popover, { modal: true, open: openPolicyPopover === user.user_id, onOpenChange: (open) => setOpenPolicyPopover(open ? user.user_id : null), children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", role: "combobox", "aria-expanded": openPolicyPopover === user.user_id, "aria-label": `Select policies for ${user.name}`, className: "w-full justify-between text-sm h-9 font-normal", disabled: updatingUserIds.has(user === null || user === void 0 ? void 0 : user.user_id), children: [jsx("span", { className: "truncate", children: user.is_admin
126141
126141
  ? `All (${allowedPolicies.length}) selected`
126142
126142
  : user.policies && user.policies.length > 0
126143
126143
  ? `${user.policies.length} selected`
@@ -126763,6 +126763,37 @@ function GroupsTab({ tenant, isTeam = false, hasInviteUserPermission = false, ha
126763
126763
  }, tenant: tenant, teamId: shareTeamId, teamName: shareTeamName }))] }));
126764
126764
  }
126765
126765
 
126766
+ var U$2=1,Y$2=.9,H$1=.8,J$1=.17,p$2=.1,u$3=.999,$$g=.9999;var k$2=.99,m$3=/[\\\/_+.#"@\[\(\{&]/,B$2=/[\\\/_+.#"@\[\(\{&]/g,K$2=/[\s-]/,X$1=/[\s-]/g;function G$2(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U$2:k$2;var T=`${A},${f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G$2(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U$2:m$3.test(_.charAt(c-1))?(E*=H$1,R=_.slice(A,c-1).match(B$2),R&&A>0&&(E*=Math.pow(u$3,R.length))):K$2.test(_.charAt(c-1))?(E*=Y$2,M=_.slice(A,c-1).match(X$1),M&&A>0&&(E*=Math.pow(u$3,M.length))):(E*=J$1,A>0&&(E*=Math.pow(u$3,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$$g)),(E<p$2&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G$2(_,C,h,P,c+1,f+2,O),N*p$2>E&&(E=N*p$2)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D$2(_){return _.toLowerCase().replace(X$1," ")}function W$1(_,C,h){return _=h&&h.length>0?`${_+" "+h.join(" ")}`:_,G$2(_,C,D$2(_),D$2(C),0,0,{})}
126767
+
126768
+ var N$2='[cmdk-group=""]',Y$1='[cmdk-group-items=""]',be$1='[cmdk-group-heading=""]',le$2='[cmdk-item=""]',ce$1=`${le$2}:not([aria-disabled="true"])`,Z$2="cmdk-item-select",T$4="data-value",Re$1=(r,o,n)=>W$1(r,o,n),ue$1=React.createContext(void 0),K$1=()=>React.useContext(ue$1),de$2=React.createContext(void 0),ee$2=()=>React.useContext(de$2),fe$1=React.createContext(void 0),me$1=React.forwardRef((r,o)=>{let n=L$3(()=>{var e,a;return {search:"",value:(a=(e=r.value)!=null?e:r.defaultValue)!=null?a:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=L$3(()=>new Set),c=L$3(()=>new Map),d=L$3(()=>new Map),f=L$3(()=>new Set),p=pe$1(r),{label:b,children:m,value:R,onValueChange:x,filter:C,shouldFilter:S,loop:A,disablePointerSelection:ge=false,vimBindings:j=true,...O}=r,$=useId$1(),q=useId$1(),_=useId$1(),I=React.useRef(null),v=ke();k$1(()=>{if(R!==void 0){let e=R.trim();n.current.value=e,E.emit();}},[R]),k$1(()=>{v(6,ne);},[]);let E=React.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,a,s)=>{var i,l,g,y;if(!Object.is(n.current[e],a)){if(n.current[e]=a,e==="search")J(),z(),v(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let h=document.getElementById(_);h?h.focus():(i=document.getElementById($))==null||i.focus();}if(v(7,()=>{var h;n.current.selectedItemId=(h=M())==null?void 0:h.id,E.emit();}),s||v(5,ne),((l=p.current)==null?void 0:l.value)!==void 0){let h=a!=null?a:"";(y=(g=p.current).onValueChange)==null||y.call(g,h);return}}E.emit();}},emit:()=>{f.current.forEach(e=>e());}}),[]),U=React.useMemo(()=>({value:(e,a,s)=>{var i;a!==((i=d.current.get(e))==null?void 0:i.value)&&(d.current.set(e,{value:a,keywords:s}),n.current.filtered.items.set(e,te(a,s)),v(2,()=>{z(),E.emit();}));},item:(e,a)=>(u.current.add(e),a&&(c.current.has(a)?c.current.get(a).add(e):c.current.set(a,new Set([e]))),v(3,()=>{J(),z(),n.current.value||W(),E.emit();}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let s=M();v(4,()=>{J(),(s==null?void 0:s.getAttribute("id"))===e&&W(),E.emit();});}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e);}),filter:()=>p.current.shouldFilter,label:b||r["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:$,inputId:_,labelId:q,listInnerRef:I}),[]);function te(e,a){var i,l;let s=(l=(i=p.current)==null?void 0:i.filter)!=null?l:Re$1;return e?s(e,n.current.search,a):0}function z(){if(!n.current.search||p.current.shouldFilter===false)return;let e=n.current.filtered.items,a=[];n.current.filtered.groups.forEach(i=>{let l=c.current.get(i),g=0;l.forEach(y=>{let h=e.get(y);g=Math.max(h,g);}),a.push([i,g]);});let s=I.current;V().sort((i,l)=>{var h,F;let g=i.getAttribute("id"),y=l.getAttribute("id");return ((h=e.get(y))!=null?h:0)-((F=e.get(g))!=null?F:0)}).forEach(i=>{let l=i.closest(Y$1);l?l.appendChild(i.parentElement===l?i:i.closest(`${Y$1} > *`)):s.appendChild(i.parentElement===s?i:i.closest(`${Y$1} > *`));}),a.sort((i,l)=>l[1]-i[1]).forEach(i=>{var g;let l=(g=I.current)==null?void 0:g.querySelector(`${N$2}[${T$4}="${encodeURIComponent(i[0])}"]`);l==null||l.parentElement.appendChild(l);});}function W(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),a=e==null?void 0:e.getAttribute(T$4);E.setState("value",a||void 0);}function J(){var a,s,i,l;if(!n.current.search||p.current.shouldFilter===false){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let g of u.current){let y=(s=(a=d.current.get(g))==null?void 0:a.value)!=null?s:"",h=(l=(i=d.current.get(g))==null?void 0:i.keywords)!=null?l:[],F=te(y,h);n.current.filtered.items.set(g,F),F>0&&e++;}for(let[g,y]of c.current)for(let h of y)if(n.current.filtered.items.get(h)>0){n.current.filtered.groups.add(g);break}n.current.filtered.count=e;}function ne(){var a,s,i;let e=M();e&&(((a=e.parentElement)==null?void 0:a.firstChild)===e&&((i=(s=e.closest(N$2))==null?void 0:s.querySelector(be$1))==null||i.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}));}function M(){var e;return (e=I.current)==null?void 0:e.querySelector(`${le$2}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=I.current)==null?void 0:e.querySelectorAll(ce$1))||[])}function X(e){let s=V()[e];s&&E.setState("value",s.getAttribute(T$4));}function Q(e){var g;let a=M(),s=V(),i=s.findIndex(y=>y===a),l=s[i+e];(g=p.current)!=null&&g.loop&&(l=i+e<0?s[s.length-1]:i+e===s.length?s[0]:s[i+e]),l&&E.setState("value",l.getAttribute(T$4));}function re(e){let a=M(),s=a==null?void 0:a.closest(N$2),i;for(;s&&!i;)s=e>0?we$1(s,N$2):De(s,N$2),i=s==null?void 0:s.querySelector(ce$1);i?E.setState("value",i.getAttribute(T$4)):Q(e);}let oe=()=>X(V().length-1),ie=e=>{e.preventDefault(),e.metaKey?oe():e.altKey?re(1):Q(1);},se=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?re(-1):Q(-1);};return React.createElement(Primitive.div,{ref:o,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var s;(s=O.onKeyDown)==null||s.call(O,e);let a=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||a))switch(e.key){case "n":case "j":{j&&e.ctrlKey&&ie(e);break}case "ArrowDown":{ie(e);break}case "p":case "k":{j&&e.ctrlKey&&se(e);break}case "ArrowUp":{se(e);break}case "Home":{e.preventDefault(),X(0);break}case "End":{e.preventDefault(),oe();break}case "Enter":{e.preventDefault();let i=M();if(i){let l=new Event(Z$2);i.dispatchEvent(l);}}}}},React.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:Te},b),B$1(r,e=>React.createElement(de$2.Provider,{value:E},React.createElement(ue$1.Provider,{value:U},e))))}),he$1=React.forwardRef((r,o)=>{var _,I;let n=useId$1(),u=React.useRef(null),c=React.useContext(fe$1),d=K$1(),f=pe$1(r),p=(I=(_=f.current)==null?void 0:_.forceMount)!=null?I:c==null?void 0:c.forceMount;k$1(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let b=ve$1(n,u,[r.value,r.children,u],r.keywords),m=ee$2(),R=P$1(v=>v.value&&v.value===b.current),x=P$1(v=>p||d.filter()===false?true:v.search?v.filtered.items.get(n)>0:true);React.useEffect(()=>{let v=u.current;if(!(!v||r.disabled))return v.addEventListener(Z$2,C),()=>v.removeEventListener(Z$2,C)},[x,r.onSelect,r.disabled]);function C(){var v,E;S(),(E=(v=f.current).onSelect)==null||E.call(v,b.current);}function S(){m.setState("value",b.current,true);}if(!x)return null;let{disabled:A,value:ge,onSelect:j,forceMount:O,keywords:$,...q}=r;return React.createElement(Primitive.div,{ref:composeRefs$1(u,o),...q,id:n,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!R,"data-disabled":!!A,"data-selected":!!R,onPointerMove:A||d.getDisablePointerSelection()?void 0:S,onClick:A?void 0:C},r.children)}),Ee=React.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=useId$1(),p=React.useRef(null),b=React.useRef(null),m=useId$1(),R=K$1(),x=P$1(S=>c||R.filter()===false?true:S.search?S.filtered.groups.has(f):true);k$1(()=>R.group(f),[]),ve$1(f,p,[r.value,r.heading,b]);let C=React.useMemo(()=>({id:f,forceMount:c}),[c]);return React.createElement(Primitive.div,{ref:composeRefs$1(p,o),...d,"cmdk-group":"",role:"presentation",hidden:x?void 0:true},n&&React.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":true,id:m},n),B$1(r,S=>React.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},React.createElement(fe$1.Provider,{value:C},S))))}),ye$2=React.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=React.useRef(null),d=P$1(f=>!f.search);return !n&&!d?null:React.createElement(Primitive.div,{ref:composeRefs$1(c,o),...u,"cmdk-separator":"",role:"separator"})}),Se=React.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=ee$2(),f=P$1(m=>m.search),p=P$1(m=>m.selectedItemId),b=K$1();return React.useEffect(()=>{r.value!=null&&d.setState("search",r.value);},[r.value]),React.createElement(Primitive.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:false,"aria-autocomplete":"list",role:"combobox","aria-expanded":true,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":p,id:b.inputId,type:"text",value:c?r.value:f,onChange:m=>{c||d.setState("search",m.target.value),n==null||n(m.target.value);}})}),Ce=React.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=React.useRef(null),f=React.useRef(null),p=P$1(m=>m.selectedItemId),b=K$1();return React.useEffect(()=>{if(f.current&&d.current){let m=f.current,R=d.current,x,C=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let S=m.offsetHeight;R.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px");});});return C.observe(m),()=>{cancelAnimationFrame(x),C.unobserve(m);}}},[]),React.createElement(Primitive.div,{ref:composeRefs$1(d,o),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:b.listId},B$1(r,m=>React.createElement("div",{ref:composeRefs$1(f,b.listInnerRef),"cmdk-list-sizer":""},m)))}),xe=React.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return React.createElement(DialogPrimitive.Root,{open:n,onOpenChange:u},React.createElement(DialogPrimitive.Portal,{container:f},React.createElement(DialogPrimitive.Overlay,{"cmdk-overlay":"",className:c}),React.createElement(DialogPrimitive.Content,{"aria-label":r.label,"cmdk-dialog":"",className:d},React.createElement(me$1,{ref:o,...p}))))}),Ie=React.forwardRef((r,o)=>P$1(u=>u.filtered.count===0)?React.createElement(Primitive.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=React.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return React.createElement(Primitive.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},B$1(r,f=>React.createElement("div",{"aria-hidden":true},f)))}),_e=Object.assign(me$1,{List:Ce,Item:he$1,Input:Se,Group:Ee,Separator:ye$2,Dialog:xe,Empty:Ie,Loading:Pe});function we$1(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling;}}function De(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling;}}function pe$1(r){let o=React.useRef(r);return k$1(()=>{o.current=r;}),o}var k$1=typeof window=="undefined"?React.useEffect:React.useLayoutEffect;function L$3(r){let o=React.useRef();return o.current===void 0&&(o.current=r()),o}function P$1(r){let o=ee$2(),n=()=>r(o.snapshot());return React.useSyncExternalStore(o.subscribe,n,n)}function ve$1(r,o,n,u=[]){let c=React.useRef(),d=K$1();return k$1(()=>{var b;let f=(()=>{var m;for(let R of n){if(typeof R=="string")return R.trim();if(typeof R=="object"&&"current"in R)return R.current?(m=R.current.textContent)==null?void 0:m.trim():c.current}})(),p=u.map(m=>m.trim());d.value(r,f,p),(b=o.current)==null||b.setAttribute(T$4,f),c.current=f;}),c}var ke=()=>{let[r,o]=React.useState(),n=L$3(()=>new Map);return k$1(()=>{n.current.forEach(u=>u()),n.current=new Map;},[r]),(u,c)=>{n.current.set(u,c),o({});}};function Me(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function B$1({asChild:r,children:o},n){return r&&React.isValidElement(o)?React.cloneElement(Me(o),{ref:o.ref},n(o.props.children)):n(o)}var Te={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};
126769
+
126770
+ const Command = React.forwardRef(({ className, ...props }, ref) => (jsx(_e, { ref: ref, className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props })));
126771
+ Command.displayName = _e.displayName;
126772
+ const CommandInput = React.forwardRef(({ className, ...props }, ref) => (jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), jsx(_e.Input, { ref: ref, className: cn('placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
126773
+ CommandInput.displayName = _e.Input.displayName;
126774
+ const CommandList = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.List, { ref: ref, className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props })));
126775
+ CommandList.displayName = _e.List.displayName;
126776
+ const CommandEmpty = React.forwardRef((props, ref) => (jsx(_e.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
126777
+ CommandEmpty.displayName = _e.Empty.displayName;
126778
+ const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Group, { ref: ref, className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props })));
126779
+ CommandGroup.displayName = _e.Group.displayName;
126780
+ const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Separator, { ref: ref, className: cn('bg-border -mx-1 h-px', className), ...props })));
126781
+ CommandSeparator.displayName = _e.Separator.displayName;
126782
+ const CommandItem = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Item, { ref: ref, className: cn("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props })));
126783
+ CommandItem.displayName = _e.Item.displayName;
126784
+
126785
+ function ActionsCombobox({ selected, onSelect, }) {
126786
+ const [open, setOpen] = useState(false);
126787
+ const { data: definitions, isLoading, isError } = useGetRbacActionsDefinitionQuery(undefined);
126788
+ const entries = useMemo(() => Object.entries(definitions !== null && definitions !== void 0 ? definitions : {}), [definitions]);
126789
+ return (jsxs("div", { children: [jsxs(Button$1, { type: "button", variant: "outline", role: "combobox", "aria-label": "Search actions", "aria-expanded": open, onClick: () => setOpen((o) => !o), className: "w-full justify-between font-normal text-muted-foreground", children: ["Search actions\u2026", jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }), open && (jsx("div", { className: "mt-2 rounded-md border border-gray-200 dark:border-gray-700", children: jsxs(Command, { filter: (value, search) => (value.toLowerCase().includes(search.toLowerCase()) ? 1 : 0), children: [jsx(CommandInput, { placeholder: "Search actions by key or description\u2026" }), jsxs(CommandList, { children: [isLoading && (jsxs("div", { className: "flex items-center justify-center py-6 text-sm text-muted-foreground", children: [jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin", "aria-hidden": "true" }), "Loading actions\u2026"] })), isError && (jsx("div", { className: "py-6 text-center text-sm text-red-500", children: "Failed to load actions" })), !isLoading && !isError && (jsxs(Fragment$1, { children: [jsx(CommandEmpty, { children: "No actions found." }), jsx(CommandGroup, { children: entries.map(([key, def]) => {
126790
+ const isAdded = selected.includes(key);
126791
+ return (jsxs(CommandItem, { value: `${key} ${def.description}`, onSelect: () => {
126792
+ onSelect(key);
126793
+ setOpen(false);
126794
+ }, className: "flex items-start gap-2", children: [jsx(Check, { className: `mt-0.5 h-4 w-4 shrink-0 ${isAdded ? 'opacity-100' : 'opacity-0'}`, "aria-hidden": "true" }), jsxs("div", { className: "flex flex-col gap-0.5", children: [jsx("span", { className: "font-mono text-xs", children: key }), jsx("span", { className: "text-xs text-muted-foreground", children: def.description })] })] }, key));
126795
+ }) })] }))] })] }) }))] }));
126796
+ }
126766
126797
  function RolesTab({ tenant }) {
126767
126798
  const [page, setPage] = useState(1);
126768
126799
  const [searchQuery, setSearchQuery] = useState('');
@@ -126848,6 +126879,9 @@ function RolesTab({ tenant }) {
126848
126879
  setActionInput('');
126849
126880
  }
126850
126881
  }
126882
+ function addActionKey(key) {
126883
+ setActions((prev) => (prev.includes(key) ? prev : [...prev, key]));
126884
+ }
126851
126885
  function removeAction(action) {
126852
126886
  setActions(actions.filter((a) => a !== action));
126853
126887
  }
@@ -126910,7 +126944,7 @@ function RolesTab({ tenant }) {
126910
126944
  setDeletingRoleId(null);
126911
126945
  }
126912
126946
  }
126913
- return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 mb-6", children: [jsxs("div", { className: "relative max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search roles", "aria-label": "Search roles", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx(Button$1, { onClick: openNew, "aria-label": "New role", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Role" })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && jsx("div", { className: "py-8 text-center text-sm text-red-500", children: "Failed to load roles" }), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Name" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[100px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [roles.map((r) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: r.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(r), disabled: deletingRoleId === r.id, "aria-label": `Edit role ${r.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(r), className: "text-red-600 hover:text-red-700", disabled: deletingRoleId === r.id || r.is_internal, "aria-label": `Delete role ${r.name}`, children: deletingRoleId === r.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), r.is_internal && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot delete internal roles" }) }))] }) })] }) })] }, r.id))), roles.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No roles found" }) }))] })] }) })), !isLoading && !isError && (jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage), totalCount: data === null || data === void 0 ? void 0 : data.count, itemsPerPage: 10, itemLabel: "roles" })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { children: editing ? 'Edit Role' : 'New Role' }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-name", children: "Role Name" }), jsx(Input, { id: "r-name", value: form.name, onChange: (e) => setForm({ ...form, name: e.target.value }), placeholder: "Enter role name", required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-actions", children: "Actions" }), jsxs("div", { className: "space-y-2", children: [actions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: actions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove action ${action}`, children: jsx(X$2, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-actions", value: actionInput, onChange: (e) => setActionInput(e.target.value), onKeyDown: handleActionKeyDown, placeholder: "e.g., Ibl.Mentor/Settings/read, Ibl.Mentor/*/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addAction, disabled: !actionInput.trim(), "aria-label": "Add action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Supports wildcards (e.g., Ibl.Mentor/*/read)" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-data-actions", children: "Data Actions" }), jsxs("div", { className: "space-y-2", children: [dataActions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: dataActions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeDataAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove data action ${action}`, children: jsx(X$2, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-data-actions", value: dataActionInput, onChange: (e) => setDataActionInput(e.target.value), onKeyDown: handleDataActionKeyDown, placeholder: "e.g., Ibl.Mentor/Settings/email/read, Ibl.Core/*/name/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addDataAction, disabled: !dataActionInput.trim(), "aria-label": "Add data action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Field-level access (e.g., Ibl.Mentor/Settings/email/read)" })] })] })] }), jsxs(DialogFooter, { className: "mt-6", children: [jsx(Button$1, { variant: "outline", onClick: () => setIsOpen(false), children: "Cancel" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { onClick: onSubmit, disabled: !!editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: editing ? 'Save Role' : 'Create Role' }) }) }), editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal) && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot edit internal roles" }) }))] }) })] })] }) })] }));
126947
+ return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 mb-6", children: [jsxs("div", { className: "relative max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search roles", "aria-label": "Search roles", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx(Button$1, { onClick: openNew, "aria-label": "New role", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Role" })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && jsx("div", { className: "py-8 text-center text-sm text-red-500", children: "Failed to load roles" }), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Name" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[100px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [roles.map((r) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: r.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(r), disabled: deletingRoleId === r.id, "aria-label": `Edit role ${r.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(r), className: "text-red-600 hover:text-red-700", disabled: deletingRoleId === r.id || r.is_internal, "aria-label": `Delete role ${r.name}`, children: deletingRoleId === r.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), r.is_internal && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot delete internal roles" }) }))] }) })] }) })] }, r.id))), roles.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No roles found" }) }))] })] }) })), !isLoading && !isError && (jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage), totalCount: data === null || data === void 0 ? void 0 : data.count, itemsPerPage: 10, itemLabel: "roles" })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { children: editing ? 'Edit Role' : 'New Role' }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-name", children: "Role Name" }), jsx(Input, { id: "r-name", value: form.name, onChange: (e) => setForm({ ...form, name: e.target.value }), placeholder: "Enter role name", required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-actions", children: "Actions" }), jsxs("div", { className: "space-y-2", children: [actions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: actions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove action ${action}`, children: jsx(X$2, { className: "h-3 w-3" }) })] }, index))) })), jsx(ActionsCombobox, { selected: actions, onSelect: addActionKey }), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-actions", value: actionInput, onChange: (e) => setActionInput(e.target.value), onKeyDown: handleActionKeyDown, placeholder: "Or type a custom action, e.g., Ibl.Mentor/*/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addAction, disabled: !actionInput.trim(), "aria-label": "Add action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Search predefined actions above, or type a custom one. Supports wildcards (e.g., Ibl.Mentor/*/read)" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-data-actions", children: "Data Actions" }), jsxs("div", { className: "space-y-2", children: [dataActions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: dataActions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeDataAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove data action ${action}`, children: jsx(X$2, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-data-actions", value: dataActionInput, onChange: (e) => setDataActionInput(e.target.value), onKeyDown: handleDataActionKeyDown, placeholder: "e.g., Ibl.Mentor/Settings/email/read, Ibl.Core/*/name/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addDataAction, disabled: !dataActionInput.trim(), "aria-label": "Add data action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Field-level access (e.g., Ibl.Mentor/Settings/email/read)" })] })] })] }), jsxs(DialogFooter, { className: "mt-6 gap-1.5", children: [jsx(Button$1, { variant: "outline", onClick: () => setIsOpen(false), children: "Cancel" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, className: "", children: jsx(Button$1, { onClick: onSubmit, disabled: !!editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white w-full", children: editing ? 'Save Role' : 'Create Role' }) }) }), editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal) && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot edit internal roles" }) }))] }) })] })] }) })] }));
126914
126948
  }
126915
126949
 
126916
126950
  function PoliciesTab({ tenant }) {
@@ -127627,7 +127661,7 @@ const TabDescription = ({ icon, title, children }) => {
127627
127661
  return (jsxs("div", { className: "flex gap-3 items-start border rounded-lg p-4 bg-blue-50/60 border-blue-100", children: [jsx("div", { className: "shrink-0 w-9 h-9 rounded-md flex items-center justify-center bg-blue-100 text-blue-600", children: icon }), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("h3", { className: "text-sm font-semibold mb-1 text-blue-900 hidden sm:block", children: title }), jsx("p", { className: `text-sm text-gray-600 leading-relaxed sm:line-clamp-none! ${expanded ? '' : 'line-clamp-2'}`, children: children }), jsx("button", { type: "button", onClick: () => setExpanded((prev) => !prev), className: "mt-1 text-xs font-medium text-blue-700 hover:text-blue-800 sm:hidden", children: expanded ? 'Read less' : 'Read more' })] })] }));
127628
127662
  };
127629
127663
  const Admin = ({ tenant, onInviteClick, hasUserTabPermission = false, hasGroupsTabPermission = false, hasRolesTabPermission = false, hasPoliciesTabPermission = false, hasTeamsTabPermission = false, hasAlertsTabPermission = false, hasInviteUserPermission = false, hasCreateTeamPermission = false, onLoadGroupPermissions, rbacPermissions = {}, enableRbac = false, }) => {
127630
- return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions; Students can optionally be granted limited policies." }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: "Groups", children: "RBAC groups bundle users so a single policy assignment grants permissions to all of them. The same group can be reused across policies." }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: "Roles", children: "An RBAC role is a named bundle of permissions (actions applied to resources in policies)." }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsxs(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: "Policies", children: ["An RBAC policy grants a role's permissions to a set of users or groups on a set of resources. Resources are hierarchical: granting on /platforms/", '{pk}', "/mentors/ covers every mentor, while /platforms/", '{pk}', "/mentors/", '{pk}', "/ scopes to one."] }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: "Teams", children: "A team is a curated set of users that you can share with others \u2014 e.g., grant another user permission to view the team's analytics or send notifications to them." }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: "Alerts", children: "An alert pairs a team of watched users with one or more watchers who get notified when monitored events occur for a watched user. Each watcher subscribes to its own subset of events." }), jsx(AlertsTab, { tenant: tenant })] }))] }) }));
127664
+ return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions; Users can optionally be granted limited policies." }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: "Groups", children: "RBAC groups bundle users so a single policy assignment grants permissions to all of them. The same group can be reused across policies." }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: "Roles", children: "An RBAC role is a named bundle of permissions (actions applied to resources in policies)." }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsxs(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: "Policies", children: ["An RBAC policy grants a role's permissions to a set of users or groups on a set of resources. Resources are hierarchical: granting on /platforms/", '{pk}', "/mentors/ covers every mentor, while /platforms/", '{pk}', "/mentors/", '{pk}', "/ scopes to one."] }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: "Teams", children: "A team is a curated set of users that you can share with others \u2014 e.g., grant another user permission to view the team's analytics or send notifications to them." }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: "Alerts", children: "An alert pairs a team of watched users with one or more watchers who get notified when monitored events occur for a watched user. Each watcher subscribes to its own subset of events." }), jsx(AlertsTab, { tenant: tenant })] }))] }) }));
127631
127665
  };
127632
127666
 
127633
127667
  function DeleteApiModal$1({ isOpen, onClose, apiKey, tenantKey }) {
@@ -131429,10 +131463,11 @@ function daysFromCurrentDate$1(targetDate) {
131429
131463
  const oneDay = 24 * 60 * 60 * 1000; // Number of milliseconds in a day
131430
131464
  const timeDifference = targetDate.getTime() - currentDate.getTime();
131431
131465
  const daysDifference = Math.ceil(timeDifference / oneDay);
131432
- return daysDifference * 24 * 3600;
131466
+ return daysDifference * 24 * 3600; // Number of seconds in a day
131433
131467
  }
131434
131468
  function CreateApiModal$1({ isOpen, onClose, tenantKey, username }) {
131435
131469
  const [apiKey, setApiKey] = React__default.useState(null);
131470
+ const [isCalendarOpen, setIsCalendarOpen] = React__default.useState(false);
131436
131471
  const [createApiKey, { isLoading }] = useCreateApiKeyMutation();
131437
131472
  const form = useForm({
131438
131473
  defaultValues: createApiFormDefaultValues$1,
@@ -131476,9 +131511,12 @@ function CreateApiModal$1({ isOpen, onClose, tenantKey, username }) {
131476
131511
  const isDirty = field.state.meta.isDirty;
131477
131512
  const hasErrorAndIsDirty = hasError && isDirty;
131478
131513
  return (jsxs("div", { className: "space-y-1.5", children: [jsxs(Label, { className: "flex items-center text-sm font-medium text-[#646464]", children: ["API Key Name", jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { placeholder: "API Key Name", value: field.state.value, onChange: (event) => field.handleChange(event.target.value), autoComplete: "off" }), hasErrorAndIsDirty && (jsx("p", { className: "text-red-500 text-xs", children: (_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message }))] }));
131479
- } }), jsx(form.Field, { name: "expiration_date", children: (field) => (jsxs("div", { className: "space-y-1.5", children: [jsx(Label, { className: "flex items-center text-sm font-medium text-[#646464]", children: "Expiration Date" }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { type: "button", variant: "outline", className: cn('w-full pl-3 text-left font-normal', !field.state.value && 'text-muted-foreground'), children: [field.state.value ? (format(field.state.value, 'PPP')) : (jsx("span", { children: "Pick a date" })), jsx(Calendar$1, { className: "ml-auto h-4 w-4 opacity-50" })] }) }), jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: jsx(Calendar, { mode: "single",
131514
+ } }), jsx(form.Field, { name: "expiration_date", children: (field) => (jsxs("div", { className: "space-y-1.5", children: [jsx(Label, { className: "flex items-center text-sm font-medium text-[#646464]", children: "Expiration Date" }), jsxs("div", { children: [jsxs(Button$1, { type: "button", variant: "outline", "aria-haspopup": "dialog", "aria-expanded": isCalendarOpen, onClick: () => setIsCalendarOpen((open) => !open), className: cn('w-full pl-3 text-left font-normal', !field.state.value && 'text-muted-foreground'), children: [field.state.value ? (format(field.state.value, 'PPP')) : (jsx("span", { children: "Pick a date" })), jsx(Calendar$1, { className: "ml-auto h-4 w-4 opacity-50" })] }), isCalendarOpen && (jsx("div", { className: "mt-2 w-auto rounded-md border border-gray-200 dark:border-gray-700", children: jsx(Calendar, { mode: "single",
131480
131515
  // @ts-expect-error - Calendar selected prop expects Date but form field may be null
131481
- selected: field.state.value, onSelect: field.handleChange, disabled: (date) => date && date < new Date() }) })] })] })) }), jsx(DialogFooter, { className: "justify-end", children: jsx(form.Subscribe, { selector: (state) => ({
131516
+ selected: field.state.value, onSelect: (date) => {
131517
+ field.handleChange(date !== null && date !== void 0 ? date : null);
131518
+ setIsCalendarOpen(false);
131519
+ }, disabled: (date) => date && date < new Date() }) }))] })] })) }), jsx(DialogFooter, { className: "justify-end", children: jsx(form.Subscribe, { selector: (state) => ({
131482
131520
  canSubmit: state.canSubmit,
131483
131521
  }), children: ({ canSubmit }) => (jsx(Button$1, { type: "submit", disabled: !canSubmit || isLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoading ? 'Submitting...' : 'Submit' })) }) })] })] }) }), apiKey && jsx(ApiKeyModal$1, { isOpen: true, onClose: () => setApiKey(null), apiKey: apiKey })] }));
131484
131522
  }
@@ -132717,17 +132755,17 @@ const StudentMentorCreationContent = ({ platformKey, }) => {
132717
132755
  dispatch(coreApiSlice.util.updateQueryData('getStudentMentorCreationStatus', { platformKey }, (draft) => {
132718
132756
  draft.allow_students_to_create_mentors = checked;
132719
132757
  }));
132720
- toast.success('Student mentor creation setting updated successfully');
132758
+ toast.success('User mentor creation setting updated successfully');
132721
132759
  }
132722
132760
  catch (error) {
132723
132761
  console.error(JSON.stringify(error));
132724
- toast.error('Failed to update student mentor creation setting');
132762
+ toast.error('Failed to update user mentor creation setting');
132725
132763
  }
132726
132764
  };
132727
132765
  if (isLoadingStudentMentorCreationStatus) {
132728
132766
  return (jsx("div", { className: "rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx("div", { className: "animate-pulse", children: jsxs("div", { className: "flex items-center justify-between", children: [jsx("div", { className: "h-4 bg-gray-200 rounded w-1/3" }), jsx("div", { className: "h-6 w-11 bg-gray-200 rounded" })] }) }) }));
132729
132767
  }
132730
- return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "Student Mentor Creation" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about public registration", className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Allow students to create mentors in the mentor platform" }) })] }) })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Switch, { checked: studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors, onCheckedChange: handleToggleStudentMentorCreation, disabled: isUpdatingStudentMentorCreationStatus, "aria-label": `Student mentor creation ${(studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors) ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingStudentMentorCreationStatus && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })] }));
132768
+ return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "User Mentor Creation" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about public registration", className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Allow users to create mentors in the mentor platform" }) })] }) })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Switch, { checked: studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors, onCheckedChange: handleToggleStudentMentorCreation, disabled: isUpdatingStudentMentorCreationStatus, "aria-label": `User mentor creation ${(studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors) ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingStudentMentorCreationStatus && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })] }));
132731
132769
  };
132732
132770
 
132733
132771
  const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
@@ -169269,7 +169307,7 @@ var ForAll = "∀";
169269
169307
  var Fouriertrf = "ℱ";
169270
169308
  var Fscr = "ℱ";
169271
169309
  var GJcy = "Ѓ";
169272
- var G$2 = ">";
169310
+ var G$1 = ">";
169273
169311
  var GT$1 = ">";
169274
169312
  var Gamma = "Γ";
169275
169313
  var Gammad = "Ϝ";
@@ -169347,7 +169385,7 @@ var Kfr = "𝔎";
169347
169385
  var Kopf = "𝕂";
169348
169386
  var Kscr = "𝒦";
169349
169387
  var LJcy = "Љ";
169350
- var L$3 = "<";
169388
+ var L$2 = "<";
169351
169389
  var LT$1 = "<";
169352
169390
  var Lacute = "Ĺ";
169353
169391
  var Lambda = "Λ";
@@ -169549,7 +169587,7 @@ var Rarrtl = "⤖";
169549
169587
  var Rcaron = "Ř";
169550
169588
  var Rcedil = "Ŗ";
169551
169589
  var Rcy = "Р";
169552
- var Re$1 = "ℜ";
169590
+ var Re = "ℜ";
169553
169591
  var ReverseElement = "∋";
169554
169592
  var ReverseEquilibrium = "⇋";
169555
169593
  var ReverseUpEquilibrium = "⥯";
@@ -170033,7 +170071,7 @@ var dd = "ⅆ";
170033
170071
  var ddagger = "‡";
170034
170072
  var ddarr = "⇊";
170035
170073
  var ddotseq = "⩷";
170036
- var de$2 = "°";
170074
+ var de$1 = "°";
170037
170075
  var deg$1 = "°";
170038
170076
  var delta = "δ";
170039
170077
  var demptyv = "⦱";
@@ -170095,7 +170133,7 @@ var ecirc = "ê";
170095
170133
  var ecolon = "≕";
170096
170134
  var ecy = "э";
170097
170135
  var edot = "ė";
170098
- var ee$2 = "ⅇ";
170136
+ var ee$1 = "ⅇ";
170099
170137
  var efDot = "≒";
170100
170138
  var efr = "𝔢";
170101
170139
  var eg = "⪚";
@@ -170397,7 +170435,7 @@ var ldquor = "„";
170397
170435
  var ldrdhar = "⥧";
170398
170436
  var ldrushar = "⥋";
170399
170437
  var ldsh = "↲";
170400
- var le$2 = "≤";
170438
+ var le$1 = "≤";
170401
170439
  var leftarrow = "←";
170402
170440
  var leftarrowtail = "↢";
170403
170441
  var leftharpoondown = "↽";
@@ -171299,7 +171337,7 @@ var yacute = "ý";
171299
171337
  var yacy = "я";
171300
171338
  var ycirc = "ŷ";
171301
171339
  var ycy = "ы";
171302
- var ye$2 = "¥";
171340
+ var ye$1 = "¥";
171303
171341
  var yen = "¥";
171304
171342
  var yfr = "𝔶";
171305
171343
  var yicy = "ї";
@@ -171490,7 +171528,7 @@ var require$$0 = {
171490
171528
  Fouriertrf: Fouriertrf,
171491
171529
  Fscr: Fscr,
171492
171530
  GJcy: GJcy,
171493
- G: G$2,
171531
+ G: G$1,
171494
171532
  GT: GT$1,
171495
171533
  Gamma: Gamma,
171496
171534
  Gammad: Gammad,
@@ -171568,7 +171606,7 @@ var require$$0 = {
171568
171606
  Kopf: Kopf,
171569
171607
  Kscr: Kscr,
171570
171608
  LJcy: LJcy,
171571
- L: L$3,
171609
+ L: L$2,
171572
171610
  LT: LT$1,
171573
171611
  Lacute: Lacute,
171574
171612
  Lambda: Lambda,
@@ -171771,7 +171809,7 @@ var require$$0 = {
171771
171809
  Rcaron: Rcaron,
171772
171810
  Rcedil: Rcedil,
171773
171811
  Rcy: Rcy,
171774
- Re: Re$1,
171812
+ Re: Re,
171775
171813
  ReverseElement: ReverseElement,
171776
171814
  ReverseEquilibrium: ReverseEquilibrium,
171777
171815
  ReverseUpEquilibrium: ReverseUpEquilibrium,
@@ -172255,7 +172293,7 @@ var require$$0 = {
172255
172293
  ddagger: ddagger,
172256
172294
  ddarr: ddarr,
172257
172295
  ddotseq: ddotseq,
172258
- de: de$2,
172296
+ de: de$1,
172259
172297
  deg: deg$1,
172260
172298
  delta: delta,
172261
172299
  demptyv: demptyv,
@@ -172317,7 +172355,7 @@ var require$$0 = {
172317
172355
  ecolon: ecolon,
172318
172356
  ecy: ecy,
172319
172357
  edot: edot,
172320
- ee: ee$2,
172358
+ ee: ee$1,
172321
172359
  efDot: efDot,
172322
172360
  efr: efr,
172323
172361
  eg: eg,
@@ -172620,7 +172658,7 @@ var require$$0 = {
172620
172658
  ldrdhar: ldrdhar,
172621
172659
  ldrushar: ldrushar,
172622
172660
  ldsh: ldsh,
172623
- le: le$2,
172661
+ le: le$1,
172624
172662
  leftarrow: leftarrow,
172625
172663
  leftarrowtail: leftarrowtail,
172626
172664
  leftharpoondown: leftharpoondown,
@@ -173522,7 +173560,7 @@ var require$$0 = {
173522
173560
  yacy: yacy,
173523
173561
  ycirc: ycirc,
173524
173562
  ycy: ycy,
173525
- ye: ye$2,
173563
+ ye: ye$1,
173526
173564
  yen: yen,
173527
173565
  yfr: yfr,
173528
173566
  yicy: yicy,
@@ -200068,25 +200106,6 @@ function Markdown({ children, className }) {
200068
200106
  const AnalyticsSettingsContext = createContext({});
200069
200107
  AnalyticsSettingsContext.Provider;
200070
200108
 
200071
- var U$2=1,Y$2=.9,H$1=.8,J$1=.17,p$2=.1,u$3=.999,$$g=.9999;var k$2=.99,m$3=/[\\\/_+.#"@\[\(\{&]/,B$2=/[\\\/_+.#"@\[\(\{&]/g,K$2=/[\s-]/,X$1=/[\s-]/g;function G$1(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U$2:k$2;var T=`${A},${f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G$1(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U$2:m$3.test(_.charAt(c-1))?(E*=H$1,R=_.slice(A,c-1).match(B$2),R&&A>0&&(E*=Math.pow(u$3,R.length))):K$2.test(_.charAt(c-1))?(E*=Y$2,M=_.slice(A,c-1).match(X$1),M&&A>0&&(E*=Math.pow(u$3,M.length))):(E*=J$1,A>0&&(E*=Math.pow(u$3,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$$g)),(E<p$2&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G$1(_,C,h,P,c+1,f+2,O),N*p$2>E&&(E=N*p$2)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D$2(_){return _.toLowerCase().replace(X$1," ")}function W$1(_,C,h){return _=h&&h.length>0?`${_+" "+h.join(" ")}`:_,G$1(_,C,D$2(_),D$2(C),0,0,{})}
200072
-
200073
- var N$2='[cmdk-group=""]',Y$1='[cmdk-group-items=""]',be$1='[cmdk-group-heading=""]',le$1='[cmdk-item=""]',ce$1=`${le$1}:not([aria-disabled="true"])`,Z$2="cmdk-item-select",T$4="data-value",Re=(r,o,n)=>W$1(r,o,n),ue$1=React.createContext(void 0),K$1=()=>React.useContext(ue$1),de$1=React.createContext(void 0),ee$1=()=>React.useContext(de$1),fe$1=React.createContext(void 0),me$1=React.forwardRef((r,o)=>{let n=L$2(()=>{var e,a;return {search:"",value:(a=(e=r.value)!=null?e:r.defaultValue)!=null?a:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=L$2(()=>new Set),c=L$2(()=>new Map),d=L$2(()=>new Map),f=L$2(()=>new Set),p=pe$1(r),{label:b,children:m,value:R,onValueChange:x,filter:C,shouldFilter:S,loop:A,disablePointerSelection:ge=false,vimBindings:j=true,...O}=r,$=useId$1(),q=useId$1(),_=useId$1(),I=React.useRef(null),v=ke();k$1(()=>{if(R!==void 0){let e=R.trim();n.current.value=e,E.emit();}},[R]),k$1(()=>{v(6,ne);},[]);let E=React.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,a,s)=>{var i,l,g,y;if(!Object.is(n.current[e],a)){if(n.current[e]=a,e==="search")J(),z(),v(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let h=document.getElementById(_);h?h.focus():(i=document.getElementById($))==null||i.focus();}if(v(7,()=>{var h;n.current.selectedItemId=(h=M())==null?void 0:h.id,E.emit();}),s||v(5,ne),((l=p.current)==null?void 0:l.value)!==void 0){let h=a!=null?a:"";(y=(g=p.current).onValueChange)==null||y.call(g,h);return}}E.emit();}},emit:()=>{f.current.forEach(e=>e());}}),[]),U=React.useMemo(()=>({value:(e,a,s)=>{var i;a!==((i=d.current.get(e))==null?void 0:i.value)&&(d.current.set(e,{value:a,keywords:s}),n.current.filtered.items.set(e,te(a,s)),v(2,()=>{z(),E.emit();}));},item:(e,a)=>(u.current.add(e),a&&(c.current.has(a)?c.current.get(a).add(e):c.current.set(a,new Set([e]))),v(3,()=>{J(),z(),n.current.value||W(),E.emit();}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let s=M();v(4,()=>{J(),(s==null?void 0:s.getAttribute("id"))===e&&W(),E.emit();});}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e);}),filter:()=>p.current.shouldFilter,label:b||r["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:$,inputId:_,labelId:q,listInnerRef:I}),[]);function te(e,a){var i,l;let s=(l=(i=p.current)==null?void 0:i.filter)!=null?l:Re;return e?s(e,n.current.search,a):0}function z(){if(!n.current.search||p.current.shouldFilter===false)return;let e=n.current.filtered.items,a=[];n.current.filtered.groups.forEach(i=>{let l=c.current.get(i),g=0;l.forEach(y=>{let h=e.get(y);g=Math.max(h,g);}),a.push([i,g]);});let s=I.current;V().sort((i,l)=>{var h,F;let g=i.getAttribute("id"),y=l.getAttribute("id");return ((h=e.get(y))!=null?h:0)-((F=e.get(g))!=null?F:0)}).forEach(i=>{let l=i.closest(Y$1);l?l.appendChild(i.parentElement===l?i:i.closest(`${Y$1} > *`)):s.appendChild(i.parentElement===s?i:i.closest(`${Y$1} > *`));}),a.sort((i,l)=>l[1]-i[1]).forEach(i=>{var g;let l=(g=I.current)==null?void 0:g.querySelector(`${N$2}[${T$4}="${encodeURIComponent(i[0])}"]`);l==null||l.parentElement.appendChild(l);});}function W(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),a=e==null?void 0:e.getAttribute(T$4);E.setState("value",a||void 0);}function J(){var a,s,i,l;if(!n.current.search||p.current.shouldFilter===false){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let g of u.current){let y=(s=(a=d.current.get(g))==null?void 0:a.value)!=null?s:"",h=(l=(i=d.current.get(g))==null?void 0:i.keywords)!=null?l:[],F=te(y,h);n.current.filtered.items.set(g,F),F>0&&e++;}for(let[g,y]of c.current)for(let h of y)if(n.current.filtered.items.get(h)>0){n.current.filtered.groups.add(g);break}n.current.filtered.count=e;}function ne(){var a,s,i;let e=M();e&&(((a=e.parentElement)==null?void 0:a.firstChild)===e&&((i=(s=e.closest(N$2))==null?void 0:s.querySelector(be$1))==null||i.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}));}function M(){var e;return (e=I.current)==null?void 0:e.querySelector(`${le$1}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=I.current)==null?void 0:e.querySelectorAll(ce$1))||[])}function X(e){let s=V()[e];s&&E.setState("value",s.getAttribute(T$4));}function Q(e){var g;let a=M(),s=V(),i=s.findIndex(y=>y===a),l=s[i+e];(g=p.current)!=null&&g.loop&&(l=i+e<0?s[s.length-1]:i+e===s.length?s[0]:s[i+e]),l&&E.setState("value",l.getAttribute(T$4));}function re(e){let a=M(),s=a==null?void 0:a.closest(N$2),i;for(;s&&!i;)s=e>0?we$1(s,N$2):De(s,N$2),i=s==null?void 0:s.querySelector(ce$1);i?E.setState("value",i.getAttribute(T$4)):Q(e);}let oe=()=>X(V().length-1),ie=e=>{e.preventDefault(),e.metaKey?oe():e.altKey?re(1):Q(1);},se=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?re(-1):Q(-1);};return React.createElement(Primitive.div,{ref:o,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var s;(s=O.onKeyDown)==null||s.call(O,e);let a=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||a))switch(e.key){case "n":case "j":{j&&e.ctrlKey&&ie(e);break}case "ArrowDown":{ie(e);break}case "p":case "k":{j&&e.ctrlKey&&se(e);break}case "ArrowUp":{se(e);break}case "Home":{e.preventDefault(),X(0);break}case "End":{e.preventDefault(),oe();break}case "Enter":{e.preventDefault();let i=M();if(i){let l=new Event(Z$2);i.dispatchEvent(l);}}}}},React.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:Te},b),B$1(r,e=>React.createElement(de$1.Provider,{value:E},React.createElement(ue$1.Provider,{value:U},e))))}),he$1=React.forwardRef((r,o)=>{var _,I;let n=useId$1(),u=React.useRef(null),c=React.useContext(fe$1),d=K$1(),f=pe$1(r),p=(I=(_=f.current)==null?void 0:_.forceMount)!=null?I:c==null?void 0:c.forceMount;k$1(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let b=ve$1(n,u,[r.value,r.children,u],r.keywords),m=ee$1(),R=P$1(v=>v.value&&v.value===b.current),x=P$1(v=>p||d.filter()===false?true:v.search?v.filtered.items.get(n)>0:true);React.useEffect(()=>{let v=u.current;if(!(!v||r.disabled))return v.addEventListener(Z$2,C),()=>v.removeEventListener(Z$2,C)},[x,r.onSelect,r.disabled]);function C(){var v,E;S(),(E=(v=f.current).onSelect)==null||E.call(v,b.current);}function S(){m.setState("value",b.current,true);}if(!x)return null;let{disabled:A,value:ge,onSelect:j,forceMount:O,keywords:$,...q}=r;return React.createElement(Primitive.div,{ref:composeRefs$1(u,o),...q,id:n,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!R,"data-disabled":!!A,"data-selected":!!R,onPointerMove:A||d.getDisablePointerSelection()?void 0:S,onClick:A?void 0:C},r.children)}),Ee=React.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=useId$1(),p=React.useRef(null),b=React.useRef(null),m=useId$1(),R=K$1(),x=P$1(S=>c||R.filter()===false?true:S.search?S.filtered.groups.has(f):true);k$1(()=>R.group(f),[]),ve$1(f,p,[r.value,r.heading,b]);let C=React.useMemo(()=>({id:f,forceMount:c}),[c]);return React.createElement(Primitive.div,{ref:composeRefs$1(p,o),...d,"cmdk-group":"",role:"presentation",hidden:x?void 0:true},n&&React.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":true,id:m},n),B$1(r,S=>React.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},React.createElement(fe$1.Provider,{value:C},S))))}),ye$1=React.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=React.useRef(null),d=P$1(f=>!f.search);return !n&&!d?null:React.createElement(Primitive.div,{ref:composeRefs$1(c,o),...u,"cmdk-separator":"",role:"separator"})}),Se=React.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=ee$1(),f=P$1(m=>m.search),p=P$1(m=>m.selectedItemId),b=K$1();return React.useEffect(()=>{r.value!=null&&d.setState("search",r.value);},[r.value]),React.createElement(Primitive.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:false,"aria-autocomplete":"list",role:"combobox","aria-expanded":true,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":p,id:b.inputId,type:"text",value:c?r.value:f,onChange:m=>{c||d.setState("search",m.target.value),n==null||n(m.target.value);}})}),Ce=React.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=React.useRef(null),f=React.useRef(null),p=P$1(m=>m.selectedItemId),b=K$1();return React.useEffect(()=>{if(f.current&&d.current){let m=f.current,R=d.current,x,C=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let S=m.offsetHeight;R.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px");});});return C.observe(m),()=>{cancelAnimationFrame(x),C.unobserve(m);}}},[]),React.createElement(Primitive.div,{ref:composeRefs$1(d,o),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:b.listId},B$1(r,m=>React.createElement("div",{ref:composeRefs$1(f,b.listInnerRef),"cmdk-list-sizer":""},m)))}),xe=React.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return React.createElement(DialogPrimitive.Root,{open:n,onOpenChange:u},React.createElement(DialogPrimitive.Portal,{container:f},React.createElement(DialogPrimitive.Overlay,{"cmdk-overlay":"",className:c}),React.createElement(DialogPrimitive.Content,{"aria-label":r.label,"cmdk-dialog":"",className:d},React.createElement(me$1,{ref:o,...p}))))}),Ie=React.forwardRef((r,o)=>P$1(u=>u.filtered.count===0)?React.createElement(Primitive.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=React.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return React.createElement(Primitive.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},B$1(r,f=>React.createElement("div",{"aria-hidden":true},f)))}),_e=Object.assign(me$1,{List:Ce,Item:he$1,Input:Se,Group:Ee,Separator:ye$1,Dialog:xe,Empty:Ie,Loading:Pe});function we$1(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling;}}function De(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling;}}function pe$1(r){let o=React.useRef(r);return k$1(()=>{o.current=r;}),o}var k$1=typeof window=="undefined"?React.useEffect:React.useLayoutEffect;function L$2(r){let o=React.useRef();return o.current===void 0&&(o.current=r()),o}function P$1(r){let o=ee$1(),n=()=>r(o.snapshot());return React.useSyncExternalStore(o.subscribe,n,n)}function ve$1(r,o,n,u=[]){let c=React.useRef(),d=K$1();return k$1(()=>{var b;let f=(()=>{var m;for(let R of n){if(typeof R=="string")return R.trim();if(typeof R=="object"&&"current"in R)return R.current?(m=R.current.textContent)==null?void 0:m.trim():c.current}})(),p=u.map(m=>m.trim());d.value(r,f,p),(b=o.current)==null||b.setAttribute(T$4,f),c.current=f;}),c}var ke=()=>{let[r,o]=React.useState(),n=L$2(()=>new Map);return k$1(()=>{n.current.forEach(u=>u()),n.current=new Map;},[r]),(u,c)=>{n.current.set(u,c),o({});}};function Me(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function B$1({asChild:r,children:o},n){return r&&React.isValidElement(o)?React.cloneElement(Me(o),{ref:o.ref},n(o.props.children)):n(o)}var Te={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};
200074
-
200075
- const Command = React.forwardRef(({ className, ...props }, ref) => (jsx(_e, { ref: ref, className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props })));
200076
- Command.displayName = _e.displayName;
200077
- const CommandInput = React.forwardRef(({ className, ...props }, ref) => (jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), jsx(_e.Input, { ref: ref, className: cn('placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
200078
- CommandInput.displayName = _e.Input.displayName;
200079
- const CommandList = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.List, { ref: ref, className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props })));
200080
- CommandList.displayName = _e.List.displayName;
200081
- const CommandEmpty = React.forwardRef((props, ref) => (jsx(_e.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
200082
- CommandEmpty.displayName = _e.Empty.displayName;
200083
- const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Group, { ref: ref, className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props })));
200084
- CommandGroup.displayName = _e.Group.displayName;
200085
- const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Separator, { ref: ref, className: cn('bg-border -mx-1 h-px', className), ...props })));
200086
- CommandSeparator.displayName = _e.Separator.displayName;
200087
- const CommandItem = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Item, { ref: ref, className: cn("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props })));
200088
- CommandItem.displayName = _e.Item.displayName;
200089
-
200090
200109
  const SkeletonMultiplier = ({ Skeleton, multiplier }) => {
200091
200110
  return (jsx(Fragment$1, { children: Array.from({ length: multiplier }).map((_, index) => (jsx(Skeleton, {}, index))) }));
200092
200111
  };
@@ -205267,7 +205286,7 @@ function Account({ tenant, tenants = [], username, onInviteClick, email, mainPla
205267
205286
  height: '100%',
205268
205287
  }, children: [jsxs("div", { className: "flex flex-col items-center justify-center py-8 px-6 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [organizationLogo ? (jsx("div", { className: "w-auto h-auto max-w-[140px] max-h-[140px] overflow-hidden", children: jsx(Image$4, { src: organizationLogo, alt: "Organization logo", width: 140, height: 140, className: "object-cover w-full h-full group-hover:opacity-80 transition-opacity", onError: () => {
205269
205288
  setOrganizationLogo('');
205270
- } }) })) : (jsx(BriefcaseBusiness, { className: "h-20 w-20 mb-6 text-blue-500" })), jsxs("div", { className: "flex justify-center space-x-3 mt-3", children: [jsxs("div", { className: "bg-blue-100 text-blue-700 px-2 py-1 rounded font-medium flex items-center text-sm", children: [jsx(User, { className: "h-4 w-4 mr-2" }), isAdmin ? 'Admin' : 'Student'] }), showPlatformName && (jsx("div", { className: "bg-gray-100 text-gray-600 px-4 py-2 rounded text-xs font-medium", children: tenant.toUpperCase() }))] })] }), jsx("div", { className: "flex-1 overflow-y-auto", style: { minHeight: 0 }, children: jsx("div", { className: "p-4", children: jsxs("div", { className: "flex flex-col space-y-2", children: [TABS.filter((tab) => {
205289
+ } }) })) : (jsx(BriefcaseBusiness, { className: "h-20 w-20 mb-6 text-blue-500" })), jsxs("div", { className: "flex justify-center space-x-3 mt-3", children: [jsxs("div", { className: "bg-blue-100 text-blue-700 px-2 py-1 rounded font-medium flex items-center text-sm", children: [jsx(User, { className: "h-4 w-4 mr-2" }), isAdmin ? 'Admin' : 'User'] }), showPlatformName && (jsx("div", { className: "bg-gray-100 text-gray-600 px-4 py-2 rounded text-xs font-medium", children: tenant.toUpperCase() }))] })] }), jsx("div", { className: "flex-1 overflow-y-auto", style: { minHeight: 0 }, children: jsx("div", { className: "p-4", children: jsxs("div", { className: "flex flex-col space-y-2", children: [TABS.filter((tab) => {
205271
205290
  if (tab.id === 'management') {
205272
205291
  return hasManagementPermissions;
205273
205292
  }
@@ -209379,7 +209398,7 @@ const AGENT_SETTINGS_TAB_LABELS = {
209379
209398
  triggerPlaceholder: 'Select Who Can View',
209380
209399
  options: {
209381
209400
  administrators: 'Administrators',
209382
- students: 'Students',
209401
+ students: 'Users',
209383
209402
  anyone: 'Anyone',
209384
209403
  },
209385
209404
  },
@@ -242625,28 +242644,28 @@ const readingLevels = [
242625
242644
  {
242626
242645
  label: 'Graduate School',
242627
242646
  position: 0,
242628
- prompt: 'Rewrite this text at the reading level of a graduate school student who has taken a couple of classes in this subject',
242647
+ prompt: 'Rewrite this text at the reading level of someone at graduate school who has taken a couple of classes in this subject',
242629
242648
  },
242630
242649
  {
242631
242650
  label: 'College',
242632
242651
  position: 1,
242633
- prompt: 'Rewrite this text at the reading level of a college student who has taken a couple of classes in this subject',
242652
+ prompt: 'Rewrite this text at the reading level of someone at college who has taken a couple of classes in this subject',
242634
242653
  },
242635
242654
  {
242636
242655
  label: 'High School',
242637
242656
  position: 2,
242638
- prompt: 'Rewrite this text at the reading level of a high school student who has taken a couple of classes in this subject',
242657
+ prompt: 'Rewrite this text at the reading level of someone at high school who has taken a couple of classes in this subject',
242639
242658
  },
242640
242659
  { label: 'Keep current reading level', position: 3, prompt: '' },
242641
242660
  {
242642
242661
  label: 'Middle School',
242643
242662
  position: 4,
242644
- prompt: 'Rewrite this text at the reading level of a middle school student who has taken a couple of classes in this subject',
242663
+ prompt: 'Rewrite this text at the reading level of someone at middle school who has taken a couple of classes in this subject',
242645
242664
  },
242646
242665
  {
242647
242666
  label: 'Kindergarten',
242648
242667
  position: 5,
242649
- prompt: 'Rewrite this text at the reading level of a kindergarten student who has taken a couple of classes in this subject',
242668
+ prompt: 'Rewrite this text at the reading level of someone at kindergarten who has taken a couple of classes in this subject',
242650
242669
  },
242651
242670
  ];
242652
242671
  const polishPrompt = 'Add some final polish to the text. If relevant, add a large title or any section titles. Check grammar and mechanics, make sure everything is consistent and reads well. You can reply that you added some final polish and checked for grammar, but do not mention the prompt.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "1.18.0",
3
+ "version": "1.18.2",
4
4
  "description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
5
5
  "type": "module",
6
6
  "engines": {
@@ -66,10 +66,10 @@
66
66
  "axios": "1.13.6",
67
67
  "dotenv": "16.6.1",
68
68
  "winston": "3.19.0",
69
- "@iblai/data-layer": "1.8.0",
70
69
  "@iblai/mcp": "1.6.0",
71
- "@iblai/web-containers": "1.9.0",
72
- "@iblai/web-utils": "1.10.11"
70
+ "@iblai/web-containers": "1.9.2",
71
+ "@iblai/web-utils": "1.10.12",
72
+ "@iblai/data-layer": "1.8.1"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@radix-ui/react-dialog": "^1.1.7",