@vertesia/ui 0.78.0-dev-28b447d → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/core/components/Avatar.js +31 -0
- package/lib/esm/core/components/Avatar.js.map +1 -0
- package/lib/esm/core/components/Badge.js +62 -0
- package/lib/esm/core/components/Badge.js.map +1 -0
- package/lib/esm/core/components/Button.js +32 -0
- package/lib/esm/core/components/Button.js.map +1 -0
- package/lib/esm/core/components/Center.js +6 -0
- package/lib/esm/core/components/Center.js.map +1 -0
- package/lib/esm/core/components/ComboBox.js +356 -0
- package/lib/esm/core/components/ComboBox.js.map +1 -0
- package/lib/esm/core/components/ConfirmModal.js +10 -0
- package/lib/esm/core/components/ConfirmModal.js.map +1 -0
- package/lib/esm/core/components/DeleteModal.js +28 -0
- package/lib/esm/core/components/DeleteModal.js.map +1 -0
- package/lib/esm/core/components/Divider.js +6 -0
- package/lib/esm/core/components/Divider.js.map +1 -0
- package/lib/esm/core/components/Dropdown.js +16 -0
- package/lib/esm/core/components/Dropdown.js.map +1 -0
- package/lib/esm/core/components/DropdownList.js +9 -0
- package/lib/esm/core/components/DropdownList.js.map +1 -0
- package/lib/esm/core/components/EmptyCollection.js +7 -0
- package/lib/esm/core/components/EmptyCollection.js.map +1 -0
- package/lib/esm/core/components/FileUpload.js +119 -0
- package/lib/esm/core/components/FileUpload.js.map +1 -0
- package/lib/esm/core/components/FormItem.js +9 -0
- package/lib/esm/core/components/FormItem.js.map +1 -0
- package/lib/esm/core/components/InputList.js +43 -0
- package/lib/esm/core/components/InputList.js.map +1 -0
- package/lib/esm/core/components/Link.js +13 -0
- package/lib/esm/core/components/Link.js.map +1 -0
- package/lib/esm/core/components/MenuList.js +23 -0
- package/lib/esm/core/components/MenuList.js.map +1 -0
- package/lib/esm/core/components/MessageBox.js +66 -0
- package/lib/esm/core/components/MessageBox.js.map +1 -0
- package/lib/esm/core/components/Modal.js +26 -0
- package/lib/esm/core/components/Modal.js.map +1 -0
- package/lib/esm/core/components/NumberInput.js +43 -0
- package/lib/esm/core/components/NumberInput.js.map +1 -0
- package/lib/esm/core/components/Overlay.js +57 -0
- package/lib/esm/core/components/Overlay.js.map +1 -0
- package/lib/esm/core/components/Portal.js +28 -0
- package/lib/esm/core/components/Portal.js.map +1 -0
- package/lib/esm/core/components/RadioGroup.js +34 -0
- package/lib/esm/core/components/RadioGroup.js.map +1 -0
- package/lib/esm/core/components/SelectBox.js +67 -0
- package/lib/esm/core/components/SelectBox.js.map +1 -0
- package/lib/esm/core/components/SelectList.js +52 -0
- package/lib/esm/core/components/SelectList.js.map +1 -0
- package/lib/esm/core/components/SelectStack.js +8 -0
- package/lib/esm/core/components/SelectStack.js.map +1 -0
- package/lib/esm/core/components/SidePanel.js +33 -0
- package/lib/esm/core/components/SidePanel.js.map +1 -0
- package/lib/esm/core/components/Spinner.js +18 -0
- package/lib/esm/core/components/Spinner.js.map +1 -0
- package/lib/esm/core/components/Switch.js +12 -0
- package/lib/esm/core/components/Switch.js.map +1 -0
- package/lib/esm/core/components/Textarea.js +15 -0
- package/lib/esm/core/components/Textarea.js.map +1 -0
- package/lib/esm/core/components/index.js +35 -0
- package/lib/esm/core/components/index.js.map +1 -0
- package/lib/esm/core/components/libs/utils.js +6 -0
- package/lib/esm/core/components/libs/utils.js.map +1 -0
- package/lib/esm/core/components/libs/visuallyHidden.js +16 -0
- package/lib/esm/core/components/libs/visuallyHidden.js.map +1 -0
- package/lib/esm/core/components/popup/Popup.js +60 -0
- package/lib/esm/core/components/popup/Popup.js.map +1 -0
- package/lib/esm/core/components/popup/PopupController.js +149 -0
- package/lib/esm/core/components/popup/PopupController.js.map +1 -0
- package/lib/esm/core/components/popup/index.js +4 -0
- package/lib/esm/core/components/popup/index.js.map +1 -0
- package/lib/esm/core/components/popup/position.js +221 -0
- package/lib/esm/core/components/popup/position.js.map +1 -0
- package/lib/esm/core/components/popup/utils.js +74 -0
- package/lib/esm/core/components/popup/utils.js.map +1 -0
- package/lib/esm/core/components/shadcn/breadcrumb.js +30 -0
- package/lib/esm/core/components/shadcn/breadcrumb.js.map +1 -0
- package/lib/esm/core/components/shadcn/button.js +75 -0
- package/lib/esm/core/components/shadcn/button.js.map +1 -0
- package/lib/esm/core/components/shadcn/calendar.js +13 -0
- package/lib/esm/core/components/shadcn/calendar.js.map +1 -0
- package/lib/esm/core/components/shadcn/card.js +17 -0
- package/lib/esm/core/components/shadcn/card.js.map +1 -0
- package/lib/esm/core/components/shadcn/checkbox.js +9 -0
- package/lib/esm/core/components/shadcn/checkbox.js.map +1 -0
- package/lib/esm/core/components/shadcn/command.js +29 -0
- package/lib/esm/core/components/shadcn/command.js.map +1 -0
- package/lib/esm/core/components/shadcn/dialog.js +60 -0
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js +38 -0
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/animateChangeInHeight.js +23 -0
- package/lib/esm/core/components/shadcn/filters/animateChangeInHeight.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js +129 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js +46 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js +23 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js +28 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js +5 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js +101 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js +24 -0
- package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/TextFilter.js +21 -0
- package/lib/esm/core/components/shadcn/filters/filter/TextFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js +161 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js +88 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filterBar.js +242 -0
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filters.js +57 -0
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/index.js +6 -0
- package/lib/esm/core/components/shadcn/filters/index.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/types.js +10 -0
- package/lib/esm/core/components/shadcn/filters/types.js.map +1 -0
- package/lib/esm/core/components/shadcn/heading.js +17 -0
- package/lib/esm/core/components/shadcn/heading.js.map +1 -0
- package/lib/esm/core/components/shadcn/index.js +23 -0
- package/lib/esm/core/components/shadcn/index.js.map +1 -0
- package/lib/esm/core/components/shadcn/input.js +38 -0
- package/lib/esm/core/components/shadcn/input.js.map +1 -0
- package/lib/esm/core/components/shadcn/label.js +10 -0
- package/lib/esm/core/components/shadcn/label.js.map +1 -0
- package/lib/esm/core/components/shadcn/popover.js +50 -0
- package/lib/esm/core/components/shadcn/popover.js.map +1 -0
- package/lib/esm/core/components/shadcn/resizeable.js +15 -0
- package/lib/esm/core/components/shadcn/resizeable.js.map +1 -0
- package/lib/esm/core/components/shadcn/selectBox.js +128 -0
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/separator.js +8 -0
- package/lib/esm/core/components/shadcn/separator.js.map +1 -0
- package/lib/esm/core/components/shadcn/tabs.js +125 -0
- package/lib/esm/core/components/shadcn/tabs.js.map +1 -0
- package/lib/esm/core/components/shadcn/text.js +30 -0
- package/lib/esm/core/components/shadcn/text.js.map +1 -0
- package/lib/esm/core/components/shadcn/theme/ThemeProvider.js +39 -0
- package/lib/esm/core/components/shadcn/theme/ThemeProvider.js.map +1 -0
- package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js +13 -0
- package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -0
- package/lib/esm/core/components/shadcn/tooltip.js +14 -0
- package/lib/esm/core/components/shadcn/tooltip.js.map +1 -0
- package/lib/esm/core/components/styles.js +10 -0
- package/lib/esm/core/components/styles.js.map +1 -0
- package/lib/esm/core/components/table/index.js +23 -0
- package/lib/esm/core/components/table/index.js.map +1 -0
- package/lib/esm/core/components/tabs/Tabs.js +78 -0
- package/lib/esm/core/components/tabs/Tabs.js.map +1 -0
- package/lib/esm/core/components/tabs/TabsContext.js +7 -0
- package/lib/esm/core/components/tabs/TabsContext.js.map +1 -0
- package/lib/esm/core/components/tabs/index.js +3 -0
- package/lib/esm/core/components/tabs/index.js.map +1 -0
- package/lib/esm/core/components/toast/NotificationPanel.js +43 -0
- package/lib/esm/core/components/toast/NotificationPanel.js.map +1 -0
- package/lib/esm/core/components/toast/ToastContext.js +7 -0
- package/lib/esm/core/components/toast/ToastContext.js.map +1 -0
- package/lib/esm/core/components/toast/ToastProps.js +2 -0
- package/lib/esm/core/components/toast/ToastProps.js.map +1 -0
- package/lib/esm/core/components/toast/ToastProvider.js +13 -0
- package/lib/esm/core/components/toast/ToastProvider.js.map +1 -0
- package/lib/esm/core/components/toast/index.js +3 -0
- package/lib/esm/core/components/toast/index.js.map +1 -0
- package/lib/esm/core/hooks/CompositeState.js +118 -0
- package/lib/esm/core/hooks/CompositeState.js.map +1 -0
- package/lib/esm/core/hooks/PortalContainerProvider.js +42 -0
- package/lib/esm/core/hooks/PortalContainerProvider.js.map +1 -0
- package/lib/esm/core/hooks/SharedState.js +64 -0
- package/lib/esm/core/hooks/SharedState.js.map +1 -0
- package/lib/esm/core/hooks/index.js +15 -0
- package/lib/esm/core/hooks/index.js.map +1 -0
- package/lib/esm/core/hooks/useClickOutside.js +29 -0
- package/lib/esm/core/hooks/useClickOutside.js.map +1 -0
- package/lib/esm/core/hooks/useCopyToClipboard.js +23 -0
- package/lib/esm/core/hooks/useCopyToClipboard.js.map +1 -0
- package/lib/esm/core/hooks/useDarkMode.js +11 -0
- package/lib/esm/core/hooks/useDarkMode.js.map +1 -0
- package/lib/esm/core/hooks/useDebounce.js +14 -0
- package/lib/esm/core/hooks/useDebounce.js.map +1 -0
- package/lib/esm/core/hooks/useEventSource.js +31 -0
- package/lib/esm/core/hooks/useEventSource.js.map +1 -0
- package/lib/esm/core/hooks/useFetch.js +40 -0
- package/lib/esm/core/hooks/useFetch.js.map +1 -0
- package/lib/esm/core/hooks/useFlag.js +13 -0
- package/lib/esm/core/hooks/useFlag.js.map +1 -0
- package/lib/esm/core/hooks/useIntersectionObserver.js +34 -0
- package/lib/esm/core/hooks/useIntersectionObserver.js.map +1 -0
- package/lib/esm/core/hooks/useIsFistRendering.js +14 -0
- package/lib/esm/core/hooks/useIsFistRendering.js.map +1 -0
- package/lib/esm/core/hooks/useSafeLayoutEffect.js +4 -0
- package/lib/esm/core/hooks/useSafeLayoutEffect.js.map +1 -0
- package/lib/esm/core/hooks/useSharedValue.js +21 -0
- package/lib/esm/core/hooks/useSharedValue.js.map +1 -0
- package/lib/esm/core/index.js +4 -0
- package/lib/esm/core/index.js.map +1 -0
- package/lib/esm/core/utils/cn.js +6 -0
- package/lib/esm/core/utils/cn.js.map +1 -0
- package/lib/esm/core/utils/index.js +2 -0
- package/lib/esm/core/utils/index.js.map +1 -0
- package/lib/esm/env/index.js +72 -0
- package/lib/esm/env/index.js.map +1 -0
- package/lib/esm/features/activity-doc/ActivityDoc.js +71 -0
- package/lib/esm/features/activity-doc/ActivityDoc.js.map +1 -0
- package/lib/esm/features/activity-doc/index.js +2 -0
- package/lib/esm/features/activity-doc/index.js.map +1 -0
- package/lib/esm/features/agent/PayloadBuilder.js +241 -0
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -0
- package/lib/esm/features/agent/chat/AnimatedThinkingDots.js +207 -0
- package/lib/esm/features/agent/chat/AnimatedThinkingDots.js.map +1 -0
- package/lib/esm/features/agent/chat/JumpingDots.js +6 -0
- package/lib/esm/features/agent/chat/JumpingDots.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +415 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +130 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +62 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js +29 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +97 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +46 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +364 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js +20 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +62 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js +23 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +52 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +82 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js +13 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +105 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +160 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -0
- package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js +266 -0
- package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js.map +1 -0
- package/lib/esm/features/agent/chat/WaitingMessages.js +60 -0
- package/lib/esm/features/agent/chat/WaitingMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/index.js +5 -0
- package/lib/esm/features/agent/chat/index.js.map +1 -0
- package/lib/esm/features/agent/index.js +3 -0
- package/lib/esm/features/agent/index.js.map +1 -0
- package/lib/esm/features/errors/PanelErrorBoundary.js +11 -0
- package/lib/esm/features/errors/PanelErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/RowErrorBoundary.js +9 -0
- package/lib/esm/features/errors/RowErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/VertesiaErrorBoundary.js +15 -0
- package/lib/esm/features/errors/VertesiaErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/WidgetErrorBoundary.js +11 -0
- package/lib/esm/features/errors/WidgetErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/index.js +5 -0
- package/lib/esm/features/errors/index.js.map +1 -0
- package/lib/esm/features/facets/CollectionsFacetsNav.js +66 -0
- package/lib/esm/features/facets/CollectionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/DocumentsFacetsNav.js +147 -0
- package/lib/esm/features/facets/DocumentsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/EnvironmentFacet.js +39 -0
- package/lib/esm/features/facets/EnvironmentFacet.js.map +1 -0
- package/lib/esm/features/facets/InteractionsFacetsNav.js +82 -0
- package/lib/esm/features/facets/InteractionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/PromptsFacetsNav.js +80 -0
- package/lib/esm/features/facets/PromptsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/RunsFacetsNav.js +157 -0
- package/lib/esm/features/facets/RunsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js +100 -0
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/index.js +15 -0
- package/lib/esm/features/facets/index.js.map +1 -0
- package/lib/esm/features/facets/utils/SearchInterface.js +2 -0
- package/lib/esm/features/facets/utils/SearchInterface.js.map +1 -0
- package/lib/esm/features/facets/utils/StringFacet.js +12 -0
- package/lib/esm/features/facets/utils/StringFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/StringListFacet.js +11 -0
- package/lib/esm/features/facets/utils/StringListFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/TypeFacet.js +42 -0
- package/lib/esm/features/facets/utils/TypeFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VEnvironmentFacet.js +24 -0
- package/lib/esm/features/facets/utils/VEnvironmentFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VInteractionFacet.js +45 -0
- package/lib/esm/features/facets/utils/VInteractionFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VStringFacet.js +20 -0
- package/lib/esm/features/facets/utils/VStringFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VTypeFacet.js +58 -0
- package/lib/esm/features/facets/utils/VTypeFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VUserFacet.js +31 -0
- package/lib/esm/features/facets/utils/VUserFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/utils.js +7 -0
- package/lib/esm/features/facets/utils/utils.js.map +1 -0
- package/lib/esm/features/index.js +11 -0
- package/lib/esm/features/index.js.map +1 -0
- package/lib/esm/features/layout/GenericPageNavHeader.js +11 -0
- package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -0
- package/lib/esm/features/layout/NotFoundView.js +5 -0
- package/lib/esm/features/layout/NotFoundView.js.map +1 -0
- package/lib/esm/features/layout/index.js +3 -0
- package/lib/esm/features/layout/index.js.map +1 -0
- package/lib/esm/features/magic-pdf/DownloadPopover.js +28 -0
- package/lib/esm/features/magic-pdf/DownloadPopover.js.map +1 -0
- package/lib/esm/features/magic-pdf/MagicPdfView.js +67 -0
- package/lib/esm/features/magic-pdf/MagicPdfView.js.map +1 -0
- package/lib/esm/features/magic-pdf/PageSlider.js +70 -0
- package/lib/esm/features/magic-pdf/PageSlider.js.map +1 -0
- package/lib/esm/features/magic-pdf/PdfPageProvider.js +188 -0
- package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +1 -0
- package/lib/esm/features/magic-pdf/TextPageView.js +62 -0
- package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -0
- package/lib/esm/features/magic-pdf/index.js +2 -0
- package/lib/esm/features/magic-pdf/index.js.map +1 -0
- package/lib/esm/features/magic-pdf/types.js +2 -0
- package/lib/esm/features/magic-pdf/types.js.map +1 -0
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js +34 -0
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js.map +1 -0
- package/lib/esm/features/permissions/SecureButton.js +13 -0
- package/lib/esm/features/permissions/SecureButton.js.map +1 -0
- package/lib/esm/features/permissions/SecureSidebarItem.js +14 -0
- package/lib/esm/features/permissions/SecureSidebarItem.js.map +1 -0
- package/lib/esm/features/permissions/UserPermissionsProvider.js +87 -0
- package/lib/esm/features/permissions/UserPermissionsProvider.js.map +1 -0
- package/lib/esm/features/permissions/helpers.js +12 -0
- package/lib/esm/features/permissions/helpers.js.map +1 -0
- package/lib/esm/features/permissions/index.js +5 -0
- package/lib/esm/features/permissions/index.js.map +1 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js +37 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/CollectionsTable.js +64 -0
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -0
- package/lib/esm/features/store/collections/CreateCollection.js +87 -0
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -0
- package/lib/esm/features/store/collections/EditCollectionView.js +175 -0
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/SelectCollection.js +53 -0
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -0
- package/lib/esm/features/store/collections/index.js +6 -0
- package/lib/esm/features/store/collections/index.js.map +1 -0
- package/lib/esm/features/store/index.js +4 -0
- package/lib/esm/features/store/index.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js +147 -0
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentSearchResults.js +177 -0
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentSelectionProvider.js +81 -0
- package/lib/esm/features/store/objects/DocumentSelectionProvider.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentTable.js +278 -0
- package/lib/esm/features/store/objects/DocumentTable.js.map +1 -0
- package/lib/esm/features/store/objects/ExportPropertiesModal.js +31 -0
- package/lib/esm/features/store/objects/ExportPropertiesModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/ContentDispositionButton.js +31 -0
- package/lib/esm/features/store/objects/components/ContentDispositionButton.js.map +1 -0
- package/lib/esm/features/store/objects/components/ContentOverview.js +286 -0
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -0
- package/lib/esm/features/store/objects/components/DocumentIcon.js +31 -0
- package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -0
- package/lib/esm/features/store/objects/components/DocumentInput.js +51 -0
- package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -0
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +171 -0
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +44 -0
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/SelectDocument.js +45 -0
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -0
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js +7 -0
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +90 -0
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -0
- package/lib/esm/features/store/objects/components/index.js +10 -0
- package/lib/esm/features/store/objects/components/index.js.map +1 -0
- package/lib/esm/features/store/objects/components/useDownloadObject.js +21 -0
- package/lib/esm/features/store/objects/components/useDownloadObject.js.map +1 -0
- package/lib/esm/features/store/objects/index.js +11 -0
- package/lib/esm/features/store/objects/index.js.map +1 -0
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +74 -0
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -0
- package/lib/esm/features/store/objects/layout/documentLayout.js +15 -0
- package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -0
- package/lib/esm/features/store/objects/layout/index.js +3 -0
- package/lib/esm/features/store/objects/layout/index.js.map +1 -0
- package/lib/esm/features/store/objects/layout/renderers.js +128 -0
- package/lib/esm/features/store/objects/layout/renderers.js.map +1 -0
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +171 -0
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -0
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +39 -0
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -0
- package/lib/esm/features/store/objects/search/index.js +3 -0
- package/lib/esm/features/store/objects/search/index.js.map +1 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +149 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js +2 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js.map +1 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js +75 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +73 -0
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +53 -0
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js +30 -0
- package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +66 -0
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +106 -0
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +64 -0
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js +72 -0
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/index.js +8 -0
- package/lib/esm/features/store/objects/selection/actions/index.js.map +1 -0
- package/lib/esm/features/store/objects/selection/index.js +5 -0
- package/lib/esm/features/store/objects/selection/index.js.map +1 -0
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +511 -0
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -0
- package/lib/esm/features/store/objects/upload/index.js +4 -0
- package/lib/esm/features/store/objects/upload/index.js.map +1 -0
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +194 -0
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -0
- package/lib/esm/features/store/objects/upload/useUploadHandler.js +230 -0
- package/lib/esm/features/store/objects/upload/useUploadHandler.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js +81 -0
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesTable.js +11 -0
- package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -0
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +26 -0
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +103 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -0
- package/lib/esm/features/store/types/SelectContentType.js +43 -0
- package/lib/esm/features/store/types/SelectContentType.js.map +1 -0
- package/lib/esm/features/store/types/SelectContentTypeModal.js +28 -0
- package/lib/esm/features/store/types/SelectContentTypeModal.js.map +1 -0
- package/lib/esm/features/store/types/TableLayoutEditor.js +78 -0
- package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -0
- package/lib/esm/features/store/types/index.js +9 -0
- package/lib/esm/features/store/types/index.js.map +1 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js +98 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js.map +1 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js +15 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js.map +1 -0
- package/lib/esm/features/store/types/search/index.js +3 -0
- package/lib/esm/features/store/types/search/index.js.map +1 -0
- package/lib/esm/features/user/UserAvatar.js +18 -0
- package/lib/esm/features/user/UserAvatar.js.map +1 -0
- package/lib/esm/features/user/UserInfo.js +119 -0
- package/lib/esm/features/user/UserInfo.js.map +1 -0
- package/lib/esm/features/user/index.js +3 -0
- package/lib/esm/features/user/index.js.map +1 -0
- package/lib/esm/features/utils/index.js +4 -0
- package/lib/esm/features/utils/index.js.map +1 -0
- package/lib/esm/features/utils/mimeType.js +9 -0
- package/lib/esm/features/utils/mimeType.js.map +1 -0
- package/lib/esm/features/utils/rendition.js +67 -0
- package/lib/esm/features/utils/rendition.js.map +1 -0
- package/lib/esm/features/utils/text.js +10 -0
- package/lib/esm/features/utils/text.js.map +1 -0
- package/lib/esm/layout/AppLayout.js +46 -0
- package/lib/esm/layout/AppLayout.js.map +1 -0
- package/lib/esm/layout/FullHeightLayout.js +18 -0
- package/lib/esm/layout/FullHeightLayout.js.map +1 -0
- package/lib/esm/layout/Navbar.js +40 -0
- package/lib/esm/layout/Navbar.js.map +1 -0
- package/lib/esm/layout/Sidebar.js +45 -0
- package/lib/esm/layout/Sidebar.js.map +1 -0
- package/lib/esm/layout/SidebarContext.js +10 -0
- package/lib/esm/layout/SidebarContext.js.map +1 -0
- package/lib/esm/layout/TitleBar.js +5 -0
- package/lib/esm/layout/TitleBar.js.map +1 -0
- package/lib/esm/layout/index.js +7 -0
- package/lib/esm/layout/index.js.map +1 -0
- package/lib/esm/router/FixLinks.js +23 -0
- package/lib/esm/router/FixLinks.js.map +1 -0
- package/lib/esm/router/HistoryNavigator.js +149 -0
- package/lib/esm/router/HistoryNavigator.js.map +1 -0
- package/lib/esm/router/Nav.js +26 -0
- package/lib/esm/router/Nav.js.map +1 -0
- package/lib/esm/router/NestedNavigationContext.js +19 -0
- package/lib/esm/router/NestedNavigationContext.js.map +1 -0
- package/lib/esm/router/NestedRouterProvider.js +44 -0
- package/lib/esm/router/NestedRouterProvider.js.map +1 -0
- package/lib/esm/router/PathMatcher.js +159 -0
- package/lib/esm/router/PathMatcher.js.map +1 -0
- package/lib/esm/router/PathWithParams.js +34 -0
- package/lib/esm/router/PathWithParams.js.map +1 -0
- package/lib/esm/router/Route404.js +18 -0
- package/lib/esm/router/Route404.js.map +1 -0
- package/lib/esm/router/RouteComponent.js +32 -0
- package/lib/esm/router/RouteComponent.js.map +1 -0
- package/lib/esm/router/Router.js +161 -0
- package/lib/esm/router/Router.js.map +1 -0
- package/lib/esm/router/RouterProvider.js +41 -0
- package/lib/esm/router/RouterProvider.js.map +1 -0
- package/lib/esm/router/index.js +11 -0
- package/lib/esm/router/index.js.map +1 -0
- package/lib/esm/router/path.js +140 -0
- package/lib/esm/router/path.js.map +1 -0
- package/lib/esm/session/TypeRegistry.js +24 -0
- package/lib/esm/session/TypeRegistry.js.map +1 -0
- package/lib/esm/session/UserSession.js +191 -0
- package/lib/esm/session/UserSession.js.map +1 -0
- package/lib/esm/session/UserSessionProvider.js +164 -0
- package/lib/esm/session/UserSessionProvider.js.map +1 -0
- package/lib/esm/session/auth/composable.js +162 -0
- package/lib/esm/session/auth/composable.js.map +1 -0
- package/lib/esm/session/auth/firebase.js +158 -0
- package/lib/esm/session/auth/firebase.js.map +1 -0
- package/lib/esm/session/auth/useAuthState.js +46 -0
- package/lib/esm/session/auth/useAuthState.js.map +1 -0
- package/lib/esm/session/auth/useCurrentTenant.js +63 -0
- package/lib/esm/session/auth/useCurrentTenant.js.map +1 -0
- package/lib/esm/session/constants.js +3 -0
- package/lib/esm/session/constants.js.map +1 -0
- package/lib/esm/session/index.js +8 -0
- package/lib/esm/session/index.js.map +1 -0
- package/lib/esm/session/useUXTracking.js +29 -0
- package/lib/esm/session/useUXTracking.js.map +1 -0
- package/lib/esm/shell/SplashScreen.js +26 -0
- package/lib/esm/shell/SplashScreen.js.map +1 -0
- package/lib/esm/shell/VertesiaShell.js +10 -0
- package/lib/esm/shell/VertesiaShell.js.map +1 -0
- package/lib/esm/shell/apps/AppInstallationProvider.js +13 -0
- package/lib/esm/shell/apps/AppInstallationProvider.js.map +1 -0
- package/lib/esm/shell/apps/AppProjectSelector.js +36 -0
- package/lib/esm/shell/apps/AppProjectSelector.js.map +1 -0
- package/lib/esm/shell/apps/StandaloneApp.js +60 -0
- package/lib/esm/shell/apps/StandaloneApp.js.map +1 -0
- package/lib/esm/shell/apps/index.js +4 -0
- package/lib/esm/shell/apps/index.js.map +1 -0
- package/lib/esm/shell/index.js +8 -0
- package/lib/esm/shell/index.js.map +1 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js +84 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js.map +1 -0
- package/lib/esm/shell/login/GitHubSignInButton.js +24 -0
- package/lib/esm/shell/login/GitHubSignInButton.js.map +1 -0
- package/lib/esm/shell/login/GoogleSignInButton.js +25 -0
- package/lib/esm/shell/login/GoogleSignInButton.js.map +1 -0
- package/lib/esm/shell/login/InviteAcceptModal.js +62 -0
- package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js +19 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js.map +1 -0
- package/lib/esm/shell/login/PreviewIcon.js +23 -0
- package/lib/esm/shell/login/PreviewIcon.js.map +1 -0
- package/lib/esm/shell/login/SignInModal.js +9 -0
- package/lib/esm/shell/login/SignInModal.js.map +1 -0
- package/lib/esm/shell/login/SigninScreen.js +64 -0
- package/lib/esm/shell/login/SigninScreen.js.map +1 -0
- package/lib/esm/shell/login/SignupForm.js +91 -0
- package/lib/esm/shell/login/SignupForm.js.map +1 -0
- package/lib/esm/shell/login/TerminalLogin.js +179 -0
- package/lib/esm/shell/login/TerminalLogin.js.map +1 -0
- package/lib/esm/shell/login/UserInfo.js +40 -0
- package/lib/esm/shell/login/UserInfo.js.map +1 -0
- package/lib/esm/shell/login/UserSessionMenu.js +31 -0
- package/lib/esm/shell/login/UserSessionMenu.js.map +1 -0
- package/lib/esm/shell/utils.js +6 -0
- package/lib/esm/shell/utils.js.map +1 -0
- package/lib/esm/widgets/Progress.js +5 -0
- package/lib/esm/widgets/Progress.js.map +1 -0
- package/lib/esm/widgets/SvgIcon.js +36 -0
- package/lib/esm/widgets/SvgIcon.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +103 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js +33 -0
- package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js.map +1 -0
- package/lib/esm/widgets/codemirror/index.js +2 -0
- package/lib/esm/widgets/codemirror/index.js.map +1 -0
- package/lib/esm/widgets/form/Form.js +102 -0
- package/lib/esm/widgets/form/Form.js.map +1 -0
- package/lib/esm/widgets/form/FormContext.js +29 -0
- package/lib/esm/widgets/form/FormContext.js.map +1 -0
- package/lib/esm/widgets/form/ManagedObject.js +283 -0
- package/lib/esm/widgets/form/ManagedObject.js.map +1 -0
- package/lib/esm/widgets/form/fields.js +11 -0
- package/lib/esm/widgets/form/fields.js.map +1 -0
- package/lib/esm/widgets/form/index.js +7 -0
- package/lib/esm/widgets/form/index.js.map +1 -0
- package/lib/esm/widgets/form/inputs.js +36 -0
- package/lib/esm/widgets/form/inputs.js.map +1 -0
- package/lib/esm/widgets/form/schema.js +197 -0
- package/lib/esm/widgets/form/schema.js.map +1 -0
- package/lib/esm/widgets/index.js +12 -0
- package/lib/esm/widgets/index.js.map +1 -0
- package/lib/esm/widgets/json-view/JSONCode.js +157 -0
- package/lib/esm/widgets/json-view/JSONCode.js.map +1 -0
- package/lib/esm/widgets/json-view/JSONDisplay.js +10 -0
- package/lib/esm/widgets/json-view/JSONDisplay.js.map +1 -0
- package/lib/esm/widgets/json-view/JSONView.js +106 -0
- package/lib/esm/widgets/json-view/JSONView.js.map +1 -0
- package/lib/esm/widgets/json-view/index.js +4 -0
- package/lib/esm/widgets/json-view/index.js.map +1 -0
- package/lib/esm/widgets/json-view/types.js +2 -0
- package/lib/esm/widgets/json-view/types.js.map +1 -0
- package/lib/esm/widgets/markdown/MarkdownRenderer.js +24 -0
- package/lib/esm/widgets/markdown/MarkdownRenderer.js.map +1 -0
- package/lib/esm/widgets/markdown/index.js +2 -0
- package/lib/esm/widgets/markdown/index.js.map +1 -0
- package/lib/esm/widgets/popover/Popover.js +73 -0
- package/lib/esm/widgets/popover/Popover.js.map +1 -0
- package/lib/esm/widgets/popover/context.js +7 -0
- package/lib/esm/widgets/popover/context.js.map +1 -0
- package/lib/esm/widgets/popover/index.js +3 -0
- package/lib/esm/widgets/popover/index.js.map +1 -0
- package/lib/esm/widgets/popover/slots.js +22 -0
- package/lib/esm/widgets/popover/slots.js.map +1 -0
- package/lib/esm/widgets/properties/PropertiesView.js +8 -0
- package/lib/esm/widgets/properties/PropertiesView.js.map +1 -0
- package/lib/esm/widgets/properties/index.js +2 -0
- package/lib/esm/widgets/properties/index.js.map +1 -0
- package/lib/esm/widgets/schema-editor/ManagedSchema.js +303 -0
- package/lib/esm/widgets/schema-editor/ManagedSchema.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/Editable.js +110 -0
- package/lib/esm/widgets/schema-editor/editor/Editable.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/EditableSchemaProperty.js +8 -0
- package/lib/esm/widgets/schema-editor/editor/EditableSchemaProperty.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js +81 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js +7 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaContext.js +9 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaContext.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +84 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -0
- package/lib/esm/widgets/schema-editor/index.js +7 -0
- package/lib/esm/widgets/schema-editor/index.js.map +1 -0
- package/lib/esm/widgets/schema-editor/json-schema4-utils.js +188 -0
- package/lib/esm/widgets/schema-editor/json-schema4-utils.js.map +1 -0
- package/lib/esm/widgets/schema-editor/type-signature.js +30 -0
- package/lib/esm/widgets/schema-editor/type-signature.js.map +1 -0
- package/lib/esm/widgets/upload/DropZone.js +162 -0
- package/lib/esm/widgets/upload/DropZone.js.map +1 -0
- package/lib/esm/widgets/upload/UploadResultCategory.js +19 -0
- package/lib/esm/widgets/upload/UploadResultCategory.js.map +1 -0
- package/lib/esm/widgets/upload/UploadSummary.js +30 -0
- package/lib/esm/widgets/upload/UploadSummary.js.map +1 -0
- package/lib/esm/widgets/upload/index.js +4 -0
- package/lib/esm/widgets/upload/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/Attributes/index.js +11 -0
- package/lib/esm/widgets/xml-viewer/components/Attributes/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/CDataTag/index.js +8 -0
- package/lib/esm/widgets/xml-viewer/components/CDataTag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/CollapseIcon/index.js +11 -0
- package/lib/esm/widgets/xml-viewer/components/CollapseIcon/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/CommentTag/index.js +11 -0
- package/lib/esm/widgets/xml-viewer/components/CommentTag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/DeclarationTag/index.js +9 -0
- package/lib/esm/widgets/xml-viewer/components/DeclarationTag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/Elements/index.js +36 -0
- package/lib/esm/widgets/xml-viewer/components/Elements/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/InvalidXml/index.js +5 -0
- package/lib/esm/widgets/xml-viewer/components/InvalidXml/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/Tag/index.js +13 -0
- package/lib/esm/widgets/xml-viewer/components/Tag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/TextElement/index.js +13 -0
- package/lib/esm/widgets/xml-viewer/components/TextElement/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/XMLViewer.js +30 -0
- package/lib/esm/widgets/xml-viewer/components/XMLViewer.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/types.js +2 -0
- package/lib/esm/widgets/xml-viewer/components/types.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/constants/index.js +17 -0
- package/lib/esm/widgets/xml-viewer/constants/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/context/xml-viewer-context.js +10 -0
- package/lib/esm/widgets/xml-viewer/context/xml-viewer-context.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/helpers/index.js +40 -0
- package/lib/esm/widgets/xml-viewer/helpers/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/hooks/useCollapsible.js +22 -0
- package/lib/esm/widgets/xml-viewer/hooks/useCollapsible.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/hooks/useXMLViewer.js +31 -0
- package/lib/esm/widgets/xml-viewer/hooks/useXMLViewer.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/index.js +3 -0
- package/lib/esm/widgets/xml-viewer/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/types/index.js +2 -0
- package/lib/esm/widgets/xml-viewer/types/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/core/components/Avatar.d.ts +16 -0
- package/lib/types/core/components/Avatar.d.ts.map +1 -0
- package/lib/types/core/components/Badge.d.ts +21 -0
- package/lib/types/core/components/Badge.d.ts.map +1 -0
- package/lib/types/core/components/Button.d.ts +14 -0
- package/lib/types/core/components/Button.d.ts.map +1 -0
- package/lib/types/core/components/Center.d.ts +8 -0
- package/lib/types/core/components/Center.d.ts.map +1 -0
- package/lib/types/core/components/ComboBox.d.ts +124 -0
- package/lib/types/core/components/ComboBox.d.ts.map +1 -0
- package/lib/types/core/components/ConfirmModal.d.ts +11 -0
- package/lib/types/core/components/ConfirmModal.d.ts.map +1 -0
- package/lib/types/core/components/DeleteModal.d.ts +11 -0
- package/lib/types/core/components/DeleteModal.d.ts.map +1 -0
- package/lib/types/core/components/Divider.d.ts +6 -0
- package/lib/types/core/components/Divider.d.ts.map +1 -0
- package/lib/types/core/components/Dropdown.d.ts +15 -0
- package/lib/types/core/components/Dropdown.d.ts.map +1 -0
- package/lib/types/core/components/DropdownList.d.ts +13 -0
- package/lib/types/core/components/DropdownList.d.ts.map +1 -0
- package/lib/types/core/components/EmptyCollection.d.ts +9 -0
- package/lib/types/core/components/EmptyCollection.d.ts.map +1 -0
- package/lib/types/core/components/FileUpload.d.ts +29 -0
- package/lib/types/core/components/FileUpload.d.ts.map +1 -0
- package/lib/types/core/components/FormItem.d.ts +13 -0
- package/lib/types/core/components/FormItem.d.ts.map +1 -0
- package/lib/types/core/components/InputList.d.ts +12 -0
- package/lib/types/core/components/InputList.d.ts.map +1 -0
- package/lib/types/core/components/Link.d.ts +7 -0
- package/lib/types/core/components/Link.d.ts.map +1 -0
- package/lib/types/core/components/MenuList.d.ts +14 -0
- package/lib/types/core/components/MenuList.d.ts.map +1 -0
- package/lib/types/core/components/MessageBox.d.ts +36 -0
- package/lib/types/core/components/MessageBox.d.ts.map +1 -0
- package/lib/types/core/components/Modal.d.ts +30 -0
- package/lib/types/core/components/Modal.d.ts.map +1 -0
- package/lib/types/core/components/NumberInput.d.ts +16 -0
- package/lib/types/core/components/NumberInput.d.ts.map +1 -0
- package/lib/types/core/components/Overlay.d.ts +25 -0
- package/lib/types/core/components/Overlay.d.ts.map +1 -0
- package/lib/types/core/components/Portal.d.ts +6 -0
- package/lib/types/core/components/Portal.d.ts.map +1 -0
- package/lib/types/core/components/RadioGroup.d.ts +26 -0
- package/lib/types/core/components/RadioGroup.d.ts.map +1 -0
- package/lib/types/core/components/SelectBox.d.ts +36 -0
- package/lib/types/core/components/SelectBox.d.ts.map +1 -0
- package/lib/types/core/components/SelectList.d.ts +19 -0
- package/lib/types/core/components/SelectList.d.ts.map +1 -0
- package/lib/types/core/components/SelectStack.d.ts +13 -0
- package/lib/types/core/components/SelectStack.d.ts.map +1 -0
- package/lib/types/core/components/SidePanel.d.ts +11 -0
- package/lib/types/core/components/SidePanel.d.ts.map +1 -0
- package/lib/types/core/components/Spinner.d.ts +7 -0
- package/lib/types/core/components/Spinner.d.ts.map +1 -0
- package/lib/types/core/components/Switch.d.ts +11 -0
- package/lib/types/core/components/Switch.d.ts.map +1 -0
- package/lib/types/core/components/Textarea.d.ts +8 -0
- package/lib/types/core/components/Textarea.d.ts.map +1 -0
- package/lib/types/core/components/index.d.ts +39 -0
- package/lib/types/core/components/index.d.ts.map +1 -0
- package/lib/types/core/components/libs/utils.d.ts +3 -0
- package/lib/types/core/components/libs/utils.d.ts.map +1 -0
- package/lib/types/core/components/libs/visuallyHidden.d.ts +7 -0
- package/lib/types/core/components/libs/visuallyHidden.d.ts.map +1 -0
- package/lib/types/core/components/popup/Popup.d.ts +26 -0
- package/lib/types/core/components/popup/Popup.d.ts.map +1 -0
- package/lib/types/core/components/popup/PopupController.d.ts +41 -0
- package/lib/types/core/components/popup/PopupController.d.ts.map +1 -0
- package/lib/types/core/components/popup/index.d.ts +4 -0
- package/lib/types/core/components/popup/index.d.ts.map +1 -0
- package/lib/types/core/components/popup/position.d.ts +59 -0
- package/lib/types/core/components/popup/position.d.ts.map +1 -0
- package/lib/types/core/components/popup/utils.d.ts +30 -0
- package/lib/types/core/components/popup/utils.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/breadcrumb.d.ts +14 -0
- package/lib/types/core/components/shadcn/breadcrumb.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/button.d.ts +27 -0
- package/lib/types/core/components/shadcn/button.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/calendar.d.ts +11 -0
- package/lib/types/core/components/shadcn/calendar.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/card.d.ts +9 -0
- package/lib/types/core/components/shadcn/card.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/checkbox.d.ts +5 -0
- package/lib/types/core/components/shadcn/checkbox.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/command.d.ts +17 -0
- package/lib/types/core/components/shadcn/command.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/dialog.d.ts +36 -0
- package/lib/types/core/components/shadcn/dialog.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +9 -0
- package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/animateChangeInHeight.d.ts +7 -0
- package/lib/types/core/components/shadcn/filters/animateChangeInHeight.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/comboBox/DateCombobox.d.ts +6 -0
- package/lib/types/core/components/shadcn/filters/comboBox/DateCombobox.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/comboBox/SelectCombobox.d.ts +9 -0
- package/lib/types/core/components/shadcn/filters/comboBox/SelectCombobox.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/comboBox/StringListCombobox.d.ts +6 -0
- package/lib/types/core/components/shadcn/filters/comboBox/StringListCombobox.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/comboBox/TextCombobox.d.ts +6 -0
- package/lib/types/core/components/shadcn/filters/comboBox/TextCombobox.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/comboBox/comboBox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/comboBox.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/filter/SelectFilter.d.ts +12 -0
- package/lib/types/core/components/shadcn/filters/filter/SelectFilter.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/filter/StringListFilter.d.ts +11 -0
- package/lib/types/core/components/shadcn/filters/filter/StringListFilter.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/filter/TextFilter.d.ts +13 -0
- package/lib/types/core/components/shadcn/filters/filter/TextFilter.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/filter/dateFilter.d.ts +14 -0
- package/lib/types/core/components/shadcn/filters/filter/dateFilter.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/filter-styles.d.ts +2 -0
- package/lib/types/core/components/shadcn/filters/filter-styles.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts +20 -0
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/filters.d.ts +10 -0
- package/lib/types/core/components/shadcn/filters/filters.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/index.d.ts +6 -0
- package/lib/types/core/components/shadcn/filters/index.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/filters/types.d.ts +35 -0
- package/lib/types/core/components/shadcn/filters/types.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/heading.d.ts +6 -0
- package/lib/types/core/components/shadcn/heading.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/index.d.ts +23 -0
- package/lib/types/core/components/shadcn/index.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/input.d.ts +17 -0
- package/lib/types/core/components/shadcn/input.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/label.d.ts +8 -0
- package/lib/types/core/components/shadcn/label.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/popover.d.ts +17 -0
- package/lib/types/core/components/shadcn/popover.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/resizeable.d.ts +9 -0
- package/lib/types/core/components/shadcn/resizeable.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/selectBox.d.ts +31 -0
- package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/separator.d.ts +5 -0
- package/lib/types/core/components/shadcn/separator.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/tabs.d.ts +31 -0
- package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/text.d.ts +11 -0
- package/lib/types/core/components/shadcn/text.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/theme/ThemeProvider.d.ts +15 -0
- package/lib/types/core/components/shadcn/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/theme/ThemeSwitcher.d.ts +10 -0
- package/lib/types/core/components/shadcn/theme/ThemeSwitcher.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/tooltip.d.ts +20 -0
- package/lib/types/core/components/shadcn/tooltip.d.ts.map +1 -0
- package/lib/types/core/components/styles.d.ts +7 -0
- package/lib/types/core/components/styles.d.ts.map +1 -0
- package/lib/types/core/components/table/index.d.ts +15 -0
- package/lib/types/core/components/table/index.d.ts.map +1 -0
- package/lib/types/core/components/tabs/Tabs.d.ts +25 -0
- package/lib/types/core/components/tabs/Tabs.d.ts.map +1 -0
- package/lib/types/core/components/tabs/TabsContext.d.ts +17 -0
- package/lib/types/core/components/tabs/TabsContext.d.ts.map +1 -0
- package/lib/types/core/components/tabs/index.d.ts +3 -0
- package/lib/types/core/components/tabs/index.d.ts.map +1 -0
- package/lib/types/core/components/toast/NotificationPanel.d.ts +8 -0
- package/lib/types/core/components/toast/NotificationPanel.d.ts.map +1 -0
- package/lib/types/core/components/toast/ToastContext.d.ts +6 -0
- package/lib/types/core/components/toast/ToastContext.d.ts.map +1 -0
- package/lib/types/core/components/toast/ToastProps.d.ts +7 -0
- package/lib/types/core/components/toast/ToastProps.d.ts.map +1 -0
- package/lib/types/core/components/toast/ToastProvider.d.ts +6 -0
- package/lib/types/core/components/toast/ToastProvider.d.ts.map +1 -0
- package/lib/types/core/components/toast/index.d.ts +3 -0
- package/lib/types/core/components/toast/index.d.ts.map +1 -0
- package/lib/types/core/hooks/CompositeState.d.ts +28 -0
- package/lib/types/core/hooks/CompositeState.d.ts.map +1 -0
- package/lib/types/core/hooks/PortalContainerProvider.d.ts +7 -0
- package/lib/types/core/hooks/PortalContainerProvider.d.ts.map +1 -0
- package/lib/types/core/hooks/SharedState.d.ts +10 -0
- package/lib/types/core/hooks/SharedState.d.ts.map +1 -0
- package/lib/types/core/hooks/index.d.ts +15 -0
- package/lib/types/core/hooks/index.d.ts.map +1 -0
- package/lib/types/core/hooks/useClickOutside.d.ts +8 -0
- package/lib/types/core/hooks/useClickOutside.d.ts.map +1 -0
- package/lib/types/core/hooks/useCopyToClipboard.d.ts +5 -0
- package/lib/types/core/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/lib/types/core/hooks/useDarkMode.d.ts +2 -0
- package/lib/types/core/hooks/useDarkMode.d.ts.map +1 -0
- package/lib/types/core/hooks/useDebounce.d.ts +2 -0
- package/lib/types/core/hooks/useDebounce.d.ts.map +1 -0
- package/lib/types/core/hooks/useEventSource.d.ts +2 -0
- package/lib/types/core/hooks/useEventSource.d.ts.map +1 -0
- package/lib/types/core/hooks/useFetch.d.ts +24 -0
- package/lib/types/core/hooks/useFetch.d.ts.map +1 -0
- package/lib/types/core/hooks/useFlag.d.ts +9 -0
- package/lib/types/core/hooks/useFlag.d.ts.map +1 -0
- package/lib/types/core/hooks/useIntersectionObserver.d.ts +14 -0
- package/lib/types/core/hooks/useIntersectionObserver.d.ts.map +1 -0
- package/lib/types/core/hooks/useIsFistRendering.d.ts +2 -0
- package/lib/types/core/hooks/useIsFistRendering.d.ts.map +1 -0
- package/lib/types/core/hooks/useSafeLayoutEffect.d.ts +4 -0
- package/lib/types/core/hooks/useSafeLayoutEffect.d.ts.map +1 -0
- package/lib/types/core/hooks/useSharedValue.d.ts +12 -0
- package/lib/types/core/hooks/useSharedValue.d.ts.map +1 -0
- package/lib/types/core/index.d.ts +4 -0
- package/lib/types/core/index.d.ts.map +1 -0
- package/lib/types/core/utils/cn.d.ts +3 -0
- package/lib/types/core/utils/cn.d.ts.map +1 -0
- package/lib/types/core/utils/index.d.ts +2 -0
- package/lib/types/core/utils/index.d.ts.map +1 -0
- package/lib/types/env/index.d.ts +72 -0
- package/lib/types/env/index.d.ts.map +1 -0
- package/lib/types/features/activity-doc/ActivityDoc.d.ts +14 -0
- package/lib/types/features/activity-doc/ActivityDoc.d.ts.map +1 -0
- package/lib/types/features/activity-doc/index.d.ts +2 -0
- package/lib/types/features/activity-doc/index.d.ts.map +1 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +73 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -0
- package/lib/types/features/agent/chat/AnimatedThinkingDots.d.ts +38 -0
- package/lib/types/features/agent/chat/AnimatedThinkingDots.d.ts.map +1 -0
- package/lib/types/features/agent/chat/JumpingDots.d.ts +7 -0
- package/lib/types/features/agent/chat/JumpingDots.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts +25 -0
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +22 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +19 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.d.ts +11 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts +16 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +13 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +8 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessagesContainer.d.ts +10 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessagesContainer.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts +9 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlideInPanel.d.ts +11 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlideInPanel.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingMessages.d.ts +8 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingMessages.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.d.ts +10 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/StackedMessages.d.ts +8 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/StackedMessages.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts +22 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +25 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -0
- package/lib/types/features/agent/chat/SlidingThinkingIndicator.d.ts +18 -0
- package/lib/types/features/agent/chat/SlidingThinkingIndicator.d.ts.map +1 -0
- package/lib/types/features/agent/chat/WaitingMessages.d.ts +2 -0
- package/lib/types/features/agent/chat/WaitingMessages.d.ts.map +1 -0
- package/lib/types/features/agent/chat/index.d.ts +5 -0
- package/lib/types/features/agent/chat/index.d.ts.map +1 -0
- package/lib/types/features/agent/index.d.ts +3 -0
- package/lib/types/features/agent/index.d.ts.map +1 -0
- package/lib/types/features/errors/PanelErrorBoundary.d.ts +5 -0
- package/lib/types/features/errors/PanelErrorBoundary.d.ts.map +1 -0
- package/lib/types/features/errors/RowErrorBoundary.d.ts +8 -0
- package/lib/types/features/errors/RowErrorBoundary.d.ts.map +1 -0
- package/lib/types/features/errors/VertesiaErrorBoundary.d.ts +12 -0
- package/lib/types/features/errors/VertesiaErrorBoundary.d.ts.map +1 -0
- package/lib/types/features/errors/WidgetErrorBoundary.d.ts +5 -0
- package/lib/types/features/errors/WidgetErrorBoundary.d.ts.map +1 -0
- package/lib/types/features/errors/index.d.ts +5 -0
- package/lib/types/features/errors/index.d.ts.map +1 -0
- package/lib/types/features/facets/CollectionsFacetsNav.d.ts +14 -0
- package/lib/types/features/facets/CollectionsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts +17 -0
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/EnvironmentFacet.d.ts +10 -0
- package/lib/types/features/facets/EnvironmentFacet.d.ts.map +1 -0
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts +13 -0
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/PromptsFacetsNav.d.ts +15 -0
- package/lib/types/features/facets/PromptsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/RunsFacetsNav.d.ts +20 -0
- package/lib/types/features/facets/RunsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts +14 -0
- package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/index.d.ts +15 -0
- package/lib/types/features/facets/index.d.ts.map +1 -0
- package/lib/types/features/facets/utils/SearchInterface.d.ts +9 -0
- package/lib/types/features/facets/utils/SearchInterface.d.ts.map +1 -0
- package/lib/types/features/facets/utils/StringFacet.d.ts +11 -0
- package/lib/types/features/facets/utils/StringFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/StringListFacet.d.ts +11 -0
- package/lib/types/features/facets/utils/StringListFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/TypeFacet.d.ts +16 -0
- package/lib/types/features/facets/utils/TypeFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VEnvironmentFacet.d.ts +12 -0
- package/lib/types/features/facets/utils/VEnvironmentFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VInteractionFacet.d.ts +15 -0
- package/lib/types/features/facets/utils/VInteractionFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VStringFacet.d.ts +21 -0
- package/lib/types/features/facets/utils/VStringFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VTypeFacet.d.ts +11 -0
- package/lib/types/features/facets/utils/VTypeFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VUserFacet.d.ts +11 -0
- package/lib/types/features/facets/utils/VUserFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/utils.d.ts +4 -0
- package/lib/types/features/facets/utils/utils.d.ts.map +1 -0
- package/lib/types/features/index.d.ts +11 -0
- package/lib/types/features/index.d.ts.map +1 -0
- package/lib/types/features/layout/GenericPageNavHeader.d.ts +13 -0
- package/lib/types/features/layout/GenericPageNavHeader.d.ts.map +1 -0
- package/lib/types/features/layout/NotFoundView.d.ts +5 -0
- package/lib/types/features/layout/NotFoundView.d.ts.map +1 -0
- package/lib/types/features/layout/index.d.ts +3 -0
- package/lib/types/features/layout/index.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/DownloadPopover.d.ts +7 -0
- package/lib/types/features/magic-pdf/DownloadPopover.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/MagicPdfView.d.ts +7 -0
- package/lib/types/features/magic-pdf/MagicPdfView.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/PageSlider.d.ts +9 -0
- package/lib/types/features/magic-pdf/PageSlider.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/PdfPageProvider.d.ts +39 -0
- package/lib/types/features/magic-pdf/PdfPageProvider.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/TextPageView.d.ts +8 -0
- package/lib/types/features/magic-pdf/TextPageView.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/index.d.ts +2 -0
- package/lib/types/features/magic-pdf/index.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/types.d.ts +2 -0
- package/lib/types/features/magic-pdf/types.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts +9 -0
- package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts.map +1 -0
- package/lib/types/features/permissions/SecureButton.d.ts +8 -0
- package/lib/types/features/permissions/SecureButton.d.ts.map +1 -0
- package/lib/types/features/permissions/SecureSidebarItem.d.ts +8 -0
- package/lib/types/features/permissions/SecureSidebarItem.d.ts.map +1 -0
- package/lib/types/features/permissions/UserPermissionsProvider.d.ts +21 -0
- package/lib/types/features/permissions/UserPermissionsProvider.d.ts.map +1 -0
- package/lib/types/features/permissions/helpers.d.ts +5 -0
- package/lib/types/features/permissions/helpers.d.ts.map +1 -0
- package/lib/types/features/permissions/index.d.ts +5 -0
- package/lib/types/features/permissions/index.d.ts.map +1 -0
- package/lib/types/features/store/collections/BrowseCollectionView.d.ts +7 -0
- package/lib/types/features/store/collections/BrowseCollectionView.d.ts.map +1 -0
- package/lib/types/features/store/collections/CollectionsTable.d.ts +6 -0
- package/lib/types/features/store/collections/CollectionsTable.d.ts.map +1 -0
- package/lib/types/features/store/collections/CreateCollection.d.ts +13 -0
- package/lib/types/features/store/collections/CreateCollection.d.ts.map +1 -0
- package/lib/types/features/store/collections/EditCollectionView.d.ts +8 -0
- package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -0
- package/lib/types/features/store/collections/SelectCollection.d.ts +17 -0
- package/lib/types/features/store/collections/SelectCollection.d.ts.map +1 -0
- package/lib/types/features/store/collections/index.d.ts +6 -0
- package/lib/types/features/store/collections/index.d.ts.map +1 -0
- package/lib/types/features/store/index.d.ts +4 -0
- package/lib/types/features/store/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/DocumentPreviewPanel.d.ts +8 -0
- package/lib/types/features/store/objects/DocumentPreviewPanel.d.ts.map +1 -0
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts +20 -0
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -0
- package/lib/types/features/store/objects/DocumentSelectionProvider.d.ts +33 -0
- package/lib/types/features/store/objects/DocumentSelectionProvider.d.ts.map +1 -0
- package/lib/types/features/store/objects/DocumentTable.d.ts +21 -0
- package/lib/types/features/store/objects/DocumentTable.d.ts.map +1 -0
- package/lib/types/features/store/objects/ExportPropertiesModal.d.ts +12 -0
- package/lib/types/features/store/objects/ExportPropertiesModal.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/ContentDispositionButton.d.ts +9 -0
- package/lib/types/features/store/objects/components/ContentDispositionButton.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/ContentOverview.d.ts +9 -0
- package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts +16 -0
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/DocumentInput.d.ts +8 -0
- package/lib/types/features/store/objects/components/DocumentInput.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +9 -0
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts +9 -0
- package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/SelectDocument.d.ts +9 -0
- package/lib/types/features/store/objects/components/SelectDocument.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/SelectDocumentModal.d.ts +9 -0
- package/lib/types/features/store/objects/components/SelectDocumentModal.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts +12 -0
- package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/index.d.ts +10 -0
- package/lib/types/features/store/objects/components/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts +4 -0
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts.map +1 -0
- package/lib/types/features/store/objects/index.d.ts +11 -0
- package/lib/types/features/store/objects/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts +17 -0
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts.map +1 -0
- package/lib/types/features/store/objects/layout/documentLayout.d.ts +18 -0
- package/lib/types/features/store/objects/layout/documentLayout.d.ts.map +1 -0
- package/lib/types/features/store/objects/layout/index.d.ts +3 -0
- package/lib/types/features/store/objects/layout/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/layout/renderers.d.ts +3 -0
- package/lib/types/features/store/objects/layout/renderers.d.ts.map +1 -0
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +51 -0
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -0
- package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts +14 -0
- package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts.map +1 -0
- package/lib/types/features/store/objects/search/index.d.ts +3 -0
- package/lib/types/features/store/objects/search/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts +26 -0
- package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/ObjectsActionSpec.d.ts +28 -0
- package/lib/types/features/store/objects/selection/ObjectsActionSpec.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts +5 -0
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/AddToCollectionAction.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/AddToCollectionAction.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/ConfirmAction.d.ts +16 -0
- package/lib/types/features/store/objects/selection/actions/ConfirmAction.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/StartWorkflowComponent.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/StartWorkflowComponent.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/actions/index.d.ts +8 -0
- package/lib/types/features/store/objects/selection/actions/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/selection/index.d.ts +5 -0
- package/lib/types/features/store/objects/selection/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts +38 -0
- package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -0
- package/lib/types/features/store/objects/upload/index.d.ts +4 -0
- package/lib/types/features/store/objects/upload/index.d.ts.map +1 -0
- package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts +30 -0
- package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts.map +1 -0
- package/lib/types/features/store/objects/upload/useUploadHandler.d.ts +50 -0
- package/lib/types/features/store/objects/upload/useUploadHandler.d.ts.map +1 -0
- package/lib/types/features/store/types/ContentObjectTypesSearch.d.ts +6 -0
- package/lib/types/features/store/types/ContentObjectTypesSearch.d.ts.map +1 -0
- package/lib/types/features/store/types/ContentObjectTypesTable.d.ts +8 -0
- package/lib/types/features/store/types/ContentObjectTypesTable.d.ts.map +1 -0
- package/lib/types/features/store/types/CreateOrUpdateTypeModal.d.ts +15 -0
- package/lib/types/features/store/types/CreateOrUpdateTypeModal.d.ts.map +1 -0
- package/lib/types/features/store/types/ObjectSchemaEditor.d.ts +8 -0
- package/lib/types/features/store/types/ObjectSchemaEditor.d.ts.map +1 -0
- package/lib/types/features/store/types/SelectContentType.d.ts +11 -0
- package/lib/types/features/store/types/SelectContentType.d.ts.map +1 -0
- package/lib/types/features/store/types/SelectContentTypeModal.d.ts +33 -0
- package/lib/types/features/store/types/SelectContentTypeModal.d.ts.map +1 -0
- package/lib/types/features/store/types/TableLayoutEditor.d.ts +9 -0
- package/lib/types/features/store/types/TableLayoutEditor.d.ts.map +1 -0
- package/lib/types/features/store/types/index.d.ts +9 -0
- package/lib/types/features/store/types/index.d.ts.map +1 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchContext.d.ts +36 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchProvider.d.ts +11 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchProvider.d.ts.map +1 -0
- package/lib/types/features/store/types/search/index.d.ts +3 -0
- package/lib/types/features/store/types/search/index.d.ts.map +1 -0
- package/lib/types/features/user/UserAvatar.d.ts +9 -0
- package/lib/types/features/user/UserAvatar.d.ts.map +1 -0
- package/lib/types/features/user/UserInfo.d.ts +48 -0
- package/lib/types/features/user/UserInfo.d.ts.map +1 -0
- package/lib/types/features/user/index.d.ts +3 -0
- package/lib/types/features/user/index.d.ts.map +1 -0
- package/lib/types/features/utils/index.d.ts +4 -0
- package/lib/types/features/utils/index.d.ts.map +1 -0
- package/lib/types/features/utils/mimeType.d.ts +5 -0
- package/lib/types/features/utils/mimeType.d.ts.map +1 -0
- package/lib/types/features/utils/rendition.d.ts +4 -0
- package/lib/types/features/utils/rendition.d.ts.map +1 -0
- package/lib/types/features/utils/text.d.ts +3 -0
- package/lib/types/features/utils/text.d.ts.map +1 -0
- package/lib/types/layout/AppLayout.d.ts +13 -0
- package/lib/types/layout/AppLayout.d.ts.map +1 -0
- package/lib/types/layout/FullHeightLayout.d.ts +27 -0
- package/lib/types/layout/FullHeightLayout.d.ts.map +1 -0
- package/lib/types/layout/Navbar.d.ts +33 -0
- package/lib/types/layout/Navbar.d.ts.map +1 -0
- package/lib/types/layout/Sidebar.d.ts +31 -0
- package/lib/types/layout/Sidebar.d.ts.map +1 -0
- package/lib/types/layout/SidebarContext.d.ts +9 -0
- package/lib/types/layout/SidebarContext.d.ts.map +1 -0
- package/lib/types/layout/TitleBar.d.ts +6 -0
- package/lib/types/layout/TitleBar.d.ts.map +1 -0
- package/lib/types/layout/index.d.ts +7 -0
- package/lib/types/layout/index.d.ts.map +1 -0
- package/lib/types/router/FixLinks.d.ts +7 -0
- package/lib/types/router/FixLinks.d.ts.map +1 -0
- package/lib/types/router/HistoryNavigator.d.ts +56 -0
- package/lib/types/router/HistoryNavigator.d.ts.map +1 -0
- package/lib/types/router/Nav.d.ts +29 -0
- package/lib/types/router/Nav.d.ts.map +1 -0
- package/lib/types/router/NestedNavigationContext.d.ts +9 -0
- package/lib/types/router/NestedNavigationContext.d.ts.map +1 -0
- package/lib/types/router/NestedRouterProvider.d.ts +14 -0
- package/lib/types/router/NestedRouterProvider.d.ts.map +1 -0
- package/lib/types/router/PathMatcher.d.ts +36 -0
- package/lib/types/router/PathMatcher.d.ts.map +1 -0
- package/lib/types/router/PathWithParams.d.ts +9 -0
- package/lib/types/router/PathWithParams.d.ts.map +1 -0
- package/lib/types/router/Route404.d.ts +4 -0
- package/lib/types/router/Route404.d.ts.map +1 -0
- package/lib/types/router/RouteComponent.d.ts +6 -0
- package/lib/types/router/RouteComponent.d.ts.map +1 -0
- package/lib/types/router/Router.d.ts +74 -0
- package/lib/types/router/Router.d.ts.map +1 -0
- package/lib/types/router/RouterProvider.d.ts +15 -0
- package/lib/types/router/RouterProvider.d.ts.map +1 -0
- package/lib/types/router/index.d.ts +11 -0
- package/lib/types/router/index.d.ts.map +1 -0
- package/lib/types/router/path.d.ts +8 -0
- package/lib/types/router/path.d.ts.map +1 -0
- package/lib/types/session/TypeRegistry.d.ts +10 -0
- package/lib/types/session/TypeRegistry.d.ts.map +1 -0
- package/lib/types/session/UserSession.d.ts +40 -0
- package/lib/types/session/UserSession.d.ts.map +1 -0
- package/lib/types/session/UserSessionProvider.d.ts +7 -0
- package/lib/types/session/UserSessionProvider.d.ts.map +1 -0
- package/lib/types/session/auth/composable.d.ts +26 -0
- package/lib/types/session/auth/composable.d.ts.map +1 -0
- package/lib/types/session/auth/firebase.d.ts +10 -0
- package/lib/types/session/auth/firebase.d.ts.map +1 -0
- package/lib/types/session/auth/useAuthState.d.ts +10 -0
- package/lib/types/session/auth/useAuthState.d.ts.map +1 -0
- package/lib/types/session/auth/useCurrentTenant.d.ts +15 -0
- package/lib/types/session/auth/useCurrentTenant.d.ts.map +1 -0
- package/lib/types/session/constants.d.ts +3 -0
- package/lib/types/session/constants.d.ts.map +1 -0
- package/lib/types/session/index.d.ts +8 -0
- package/lib/types/session/index.d.ts.map +1 -0
- package/lib/types/session/useUXTracking.d.ts +6 -0
- package/lib/types/session/useUXTracking.d.ts.map +1 -0
- package/lib/types/shell/SplashScreen.d.ts +7 -0
- package/lib/types/shell/SplashScreen.d.ts.map +1 -0
- package/lib/types/shell/VertesiaShell.d.ts +10 -0
- package/lib/types/shell/VertesiaShell.d.ts.map +1 -0
- package/lib/types/shell/apps/AppInstallationProvider.d.ts +12 -0
- package/lib/types/shell/apps/AppInstallationProvider.d.ts.map +1 -0
- package/lib/types/shell/apps/AppProjectSelector.d.ts +12 -0
- package/lib/types/shell/apps/AppProjectSelector.d.ts.map +1 -0
- package/lib/types/shell/apps/StandaloneApp.d.ts +23 -0
- package/lib/types/shell/apps/StandaloneApp.d.ts.map +1 -0
- package/lib/types/shell/apps/index.d.ts +4 -0
- package/lib/types/shell/apps/index.d.ts.map +1 -0
- package/lib/types/shell/index.d.ts +8 -0
- package/lib/types/shell/index.d.ts.map +1 -0
- package/lib/types/shell/login/EnterpriseSigninButton.d.ts +6 -0
- package/lib/types/shell/login/EnterpriseSigninButton.d.ts.map +1 -0
- package/lib/types/shell/login/GitHubSignInButton.d.ts +6 -0
- package/lib/types/shell/login/GitHubSignInButton.d.ts.map +1 -0
- package/lib/types/shell/login/GoogleSignInButton.d.ts +6 -0
- package/lib/types/shell/login/GoogleSignInButton.d.ts.map +1 -0
- package/lib/types/shell/login/InviteAcceptModal.d.ts +2 -0
- package/lib/types/shell/login/InviteAcceptModal.d.ts.map +1 -0
- package/lib/types/shell/login/MicrosoftSigninButton.d.ts +6 -0
- package/lib/types/shell/login/MicrosoftSigninButton.d.ts.map +1 -0
- package/lib/types/shell/login/PreviewIcon.d.ts +6 -0
- package/lib/types/shell/login/PreviewIcon.d.ts.map +1 -0
- package/lib/types/shell/login/SignInModal.d.ts +7 -0
- package/lib/types/shell/login/SignInModal.d.ts.map +1 -0
- package/lib/types/shell/login/SigninScreen.d.ts +9 -0
- package/lib/types/shell/login/SigninScreen.d.ts.map +1 -0
- package/lib/types/shell/login/SignupForm.d.ts +8 -0
- package/lib/types/shell/login/SignupForm.d.ts.map +1 -0
- package/lib/types/shell/login/TerminalLogin.d.ts +2 -0
- package/lib/types/shell/login/TerminalLogin.d.ts.map +1 -0
- package/lib/types/shell/login/UserInfo.d.ts +6 -0
- package/lib/types/shell/login/UserInfo.d.ts.map +1 -0
- package/lib/types/shell/login/UserSessionMenu.d.ts +9 -0
- package/lib/types/shell/login/UserSessionMenu.d.ts.map +1 -0
- package/lib/types/shell/utils.d.ts +2 -0
- package/lib/types/shell/utils.d.ts.map +1 -0
- package/lib/types/widgets/Progress.d.ts +6 -0
- package/lib/types/widgets/Progress.d.ts.map +1 -0
- package/lib/types/widgets/SvgIcon.d.ts +7 -0
- package/lib/types/widgets/SvgIcon.d.ts.map +1 -0
- package/lib/types/widgets/codemirror/CodeMirrorEditor.d.ts +23 -0
- package/lib/types/widgets/codemirror/CodeMirrorEditor.d.ts.map +1 -0
- package/lib/types/widgets/codemirror/CodemirrorStateSingleton.d.ts +15 -0
- package/lib/types/widgets/codemirror/CodemirrorStateSingleton.d.ts.map +1 -0
- package/lib/types/widgets/codemirror/index.d.ts +2 -0
- package/lib/types/widgets/codemirror/index.d.ts.map +1 -0
- package/lib/types/widgets/form/Form.d.ts +21 -0
- package/lib/types/widgets/form/Form.d.ts.map +1 -0
- package/lib/types/widgets/form/FormContext.d.ts +17 -0
- package/lib/types/widgets/form/FormContext.d.ts.map +1 -0
- package/lib/types/widgets/form/ManagedObject.d.ts +82 -0
- package/lib/types/widgets/form/ManagedObject.d.ts.map +1 -0
- package/lib/types/widgets/form/fields.d.ts +16 -0
- package/lib/types/widgets/form/fields.d.ts.map +1 -0
- package/lib/types/widgets/form/index.d.ts +7 -0
- package/lib/types/widgets/form/index.d.ts.map +1 -0
- package/lib/types/widgets/form/inputs.d.ts +8 -0
- package/lib/types/widgets/form/inputs.d.ts.map +1 -0
- package/lib/types/widgets/form/schema.d.ts +47 -0
- package/lib/types/widgets/form/schema.d.ts.map +1 -0
- package/lib/types/widgets/index.d.ts +12 -0
- package/lib/types/widgets/index.d.ts.map +1 -0
- package/lib/types/widgets/json-view/JSONCode.d.ts +22 -0
- package/lib/types/widgets/json-view/JSONCode.d.ts.map +1 -0
- package/lib/types/widgets/json-view/JSONDisplay.d.ts +8 -0
- package/lib/types/widgets/json-view/JSONDisplay.d.ts.map +1 -0
- package/lib/types/widgets/json-view/JSONView.d.ts +7 -0
- package/lib/types/widgets/json-view/JSONView.d.ts.map +1 -0
- package/lib/types/widgets/json-view/index.d.ts +5 -0
- package/lib/types/widgets/json-view/index.d.ts.map +1 -0
- package/lib/types/widgets/json-view/types.d.ts +8 -0
- package/lib/types/widgets/json-view/types.d.ts.map +1 -0
- package/lib/types/widgets/markdown/MarkdownRenderer.d.ts +9 -0
- package/lib/types/widgets/markdown/MarkdownRenderer.d.ts.map +1 -0
- package/lib/types/widgets/markdown/index.d.ts +2 -0
- package/lib/types/widgets/markdown/index.d.ts.map +1 -0
- package/lib/types/widgets/popover/Popover.d.ts +38 -0
- package/lib/types/widgets/popover/Popover.d.ts.map +1 -0
- package/lib/types/widgets/popover/context.d.ts +8 -0
- package/lib/types/widgets/popover/context.d.ts.map +1 -0
- package/lib/types/widgets/popover/index.d.ts +3 -0
- package/lib/types/widgets/popover/index.d.ts.map +1 -0
- package/lib/types/widgets/popover/slots.d.ts +5 -0
- package/lib/types/widgets/popover/slots.d.ts.map +1 -0
- package/lib/types/widgets/properties/PropertiesView.d.ts +11 -0
- package/lib/types/widgets/properties/PropertiesView.d.ts.map +1 -0
- package/lib/types/widgets/properties/index.d.ts +2 -0
- package/lib/types/widgets/properties/index.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/ManagedSchema.d.ts +75 -0
- package/lib/types/widgets/schema-editor/ManagedSchema.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/editor/Editable.d.ts +40 -0
- package/lib/types/widgets/schema-editor/editor/Editable.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/editor/EditableSchemaProperty.d.ts +8 -0
- package/lib/types/widgets/schema-editor/editor/EditableSchemaProperty.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/editor/PropertyEditor.d.ts +5 -0
- package/lib/types/widgets/schema-editor/editor/PropertyEditor.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/editor/PropertyViewer.d.ts +4 -0
- package/lib/types/widgets/schema-editor/editor/PropertyViewer.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/editor/SchemaContext.d.ts +3 -0
- package/lib/types/widgets/schema-editor/editor/SchemaContext.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/editor/SchemaEditor.d.ts +9 -0
- package/lib/types/widgets/schema-editor/editor/SchemaEditor.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/index.d.ts +7 -0
- package/lib/types/widgets/schema-editor/index.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/json-schema4-utils.d.ts +16 -0
- package/lib/types/widgets/schema-editor/json-schema4-utils.d.ts.map +1 -0
- package/lib/types/widgets/schema-editor/type-signature.d.ts +19 -0
- package/lib/types/widgets/schema-editor/type-signature.d.ts.map +1 -0
- package/lib/types/widgets/upload/DropZone.d.ts +41 -0
- package/lib/types/widgets/upload/DropZone.d.ts.map +1 -0
- package/lib/types/widgets/upload/UploadResultCategory.d.ts +26 -0
- package/lib/types/widgets/upload/UploadResultCategory.d.ts.map +1 -0
- package/lib/types/widgets/upload/UploadSummary.d.ts +38 -0
- package/lib/types/widgets/upload/UploadSummary.d.ts.map +1 -0
- package/lib/types/widgets/upload/index.d.ts +4 -0
- package/lib/types/widgets/upload/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/Attributes/index.d.ts +6 -0
- package/lib/types/widgets/xml-viewer/components/Attributes/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/CDataTag/index.d.ts +8 -0
- package/lib/types/widgets/xml-viewer/components/CDataTag/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/CollapseIcon/index.d.ts +5 -0
- package/lib/types/widgets/xml-viewer/components/CollapseIcon/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/CommentTag/index.d.ts +9 -0
- package/lib/types/widgets/xml-viewer/components/CommentTag/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/DeclarationTag/index.d.ts +8 -0
- package/lib/types/widgets/xml-viewer/components/DeclarationTag/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/Elements/index.d.ts +8 -0
- package/lib/types/widgets/xml-viewer/components/Elements/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/InvalidXml/index.d.ts +2 -0
- package/lib/types/widgets/xml-viewer/components/InvalidXml/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/Tag/index.d.ts +13 -0
- package/lib/types/widgets/xml-viewer/components/Tag/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/TextElement/index.d.ts +8 -0
- package/lib/types/widgets/xml-viewer/components/TextElement/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/XMLViewer.d.ts +3 -0
- package/lib/types/widgets/xml-viewer/components/XMLViewer.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/components/types.d.ts +104 -0
- package/lib/types/widgets/xml-viewer/components/types.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/constants/index.d.ts +17 -0
- package/lib/types/widgets/xml-viewer/constants/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/context/xml-viewer-context.d.ts +4 -0
- package/lib/types/widgets/xml-viewer/context/xml-viewer-context.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/helpers/index.d.ts +13 -0
- package/lib/types/widgets/xml-viewer/helpers/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/hooks/useCollapsible.d.ts +15 -0
- package/lib/types/widgets/xml-viewer/hooks/useCollapsible.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/hooks/useXMLViewer.d.ts +10 -0
- package/lib/types/widgets/xml-viewer/hooks/useXMLViewer.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/index.d.ts +3 -0
- package/lib/types/widgets/xml-viewer/index.d.ts.map +1 -0
- package/lib/types/widgets/xml-viewer/types/index.d.ts +16 -0
- package/lib/types/widgets/xml-viewer/types/index.d.ts.map +1 -0
- package/lib/vertesia-ui-core.js +2 -0
- package/lib/vertesia-ui-core.js.map +1 -0
- package/lib/vertesia-ui-env.js +2 -0
- package/lib/vertesia-ui-env.js.map +1 -0
- package/lib/vertesia-ui-features.js +2 -0
- package/lib/vertesia-ui-features.js.map +1 -0
- package/lib/vertesia-ui-layout.js +2 -0
- package/lib/vertesia-ui-layout.js.map +1 -0
- package/lib/vertesia-ui-router.js +2 -0
- package/lib/vertesia-ui-router.js.map +1 -0
- package/lib/vertesia-ui-session.js +2 -0
- package/lib/vertesia-ui-session.js.map +1 -0
- package/lib/vertesia-ui-shell.js +2 -0
- package/lib/vertesia-ui-shell.js.map +1 -0
- package/lib/vertesia-ui-widgets.js +2 -0
- package/lib/vertesia-ui-widgets.js.map +1 -0
- package/package.json +165 -170
- package/src/env/index.ts +1 -2
- package/src/features/store/objects/DocumentSearchResults.tsx +1 -15
- package/src/features/user/UserInfo.tsx +0 -2
- package/src/session/UserSession.ts +0 -1
- package/src/session/UserSessionProvider.tsx +1 -1
- package/src/session/auth/composable.ts +70 -71
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as r}from"react/jsx-runtime";import i from"clsx";import{Transition as t,Dialog as n,TransitionChild as a,DialogPanel as s}from"@headlessui/react";import{Menu as o,Search as c,Dot as d,X as h}from"lucide-react";import{createContext as m,useContext as u,useState as f,useEffect as x,Fragment as g}from"react";import{Button as p,TooltipProvider as v,Tooltip as N,TooltipTrigger as b,TooltipContent as w}from"@vertesia/ui/core";import{Nav as y}from"@vertesia/ui/router";function k({className:l,children:r}){return e("div",{className:i("flex flex-col","h-full","overflow-y-auto","px-2",l),children:r})}k.Fixed=function({heightClass:l,className:r,children:t}){return e("div",{className:i("w-full",l,r),children:t})},k.Body=function({className:l,children:r}){return e("div",{className:i("grow overflow-auto","min-h-0","p-2",l),children:r})},k.VR=function({}){return e("div",{className:"w-[1px] border border-red-200"})},k.HR=function({}){return e("div",{className:"w-full h-1 border-b border-red-200"})};const C=m({isOpen:!1,toggleMobile:()=>{},toggleDesktop:()=>{}});function S(){return u(C)}function z({title:l}){return e("div",{className:"self-center text-lg font-semibold",children:l})}function O({children:r,logo:i,onSearch:t,title:n}){return l("div",{className:"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b px-4 shadow-2xs sm:gap-x-6 sm:px-6 lg:px-8",children:[e(T,{}),e("div",{className:"lg:hidden",children:i}),t&&e(D,{visible:"mobile"}),l("div",{className:"flex flex-1 gap-x-4 self-stretch lg:gap-x-6",children:[e(z,{title:n}),t&&e(F,{onSearch:t}),e("div",{className:"flex items-center gap-x-4 lg:gap-x-6 ml-auto",children:r})]})]})}function F({}){return l("form",{className:"relative flex flex-1",action:"#",method:"GET",children:[e("label",{htmlFor:"search-field",className:"sr-only",children:"Search"}),e(c,{className:"pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-gray-400","aria-hidden":"true"}),e("input",{id:"search-field",className:"block h-full w-full border-0 py-0 pl-8 pr-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm",placeholder:"Search...",type:"search",name:"search"})]})}function T(){const{toggleDesktop:l,toggleMobile:i}=S();return e(r,{children:e(p,{variant:"ghost",size:"icon",onClick:()=>{window.innerWidth<1024?i():l()},className:"p-2 rounded-full transition-colors w-full text-center ",children:e(o,{"aria-hidden":"true",size:24})})})}function D({visible:l}){let r="";return l&&(r="mobile"===l?"lg:hidden":"hidden lg:block"),e("div",{className:`h-6 w-px bg-gray-900/10 dark:bg-slate-900/0.1 ${r}`,"aria-hidden":"true"})}function I({title:r,icon:i,onClick:t}){return l("button",{type:"button",className:"-m-2.5 p-2.5 text-gray-400 dark:text-slate-50 hover:text-gray-500",onClick:t,children:[e("span",{className:"sr-only",children:r}),e(i,{className:"size-6","aria-hidden":"true",title:r})]})}function M({children:l,onClick:r}){return e(p,{onClick:r,children:l})}function E({href:l,onClick:r,children:i}){return e("a",{className:"dark:text-slate-50",href:l,onClick:r,children:i})}function W({children:r,logo:t,className:n}){return l("div",{className:i(n||"bg-indigo-600 dark:bg-indigo-950","flex flex-col h-full"),children:[t&&e("div",{className:"-mx-2 flex h-auto my-4 shrink-0 self-start",children:t}),e("div",{className:"flex-1 min-h-0 overflow-hidden px-2",children:e("nav",{className:"h-full flex flex-col",children:e("ul",{role:"list",className:"flex flex-col gap-y-2 overflow-y-auto h-full",children:r})})})]})}function j({children:i,title:t,action:n,isFooter:a=!1}){const{isOpen:s}=S();let o=s?l(r,{children:[t||"",n]}):e(d,{className:"size-6"});return l("li",{className:a?"mt-auto":"",children:[t&&e("div",{className:"text-xs font-medium h-8 flex items-center gap-x-2 px-2 text-sidebar-foreground/70",children:o}),e("ul",{"data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:i})]})}function L({children:i,text:t}){const{isOpen:n}=S();return n?e(r,{children:i}):e(v,{children:l(N,{children:[e(b,{asChild:!0,children:i}),e(w,{side:"right",children:t})]})})}function P({external:r,className:t,tools:n,children:a,icon:s,href:o,current:c,onClick:d}){const{toggleMobile:h}=S();return e("li",{children:e(y,{onClick:()=>{setTimeout((()=>{h(!1)}),100)},children:e(L,{text:a,children:l("a",{href:o,onClick:e=>{r?(window.open(o,"_blank"),e.preventDefault(),e.stopPropagation()):d&&d(e)},className:i(c?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent","group flex gap-x-3 rounded-md px-2 py-1.5 text-sm items-center h-8",t),children:[s&&e(s,{className:i(c?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent","size-4 shrink-0"),"aria-hidden":"true"}),a,n&&e("div",{className:"flex items-center ml-auto",children:n})]})})})})}function R({sidebarClassName:o,className:c,title:d,children:m,logo:u,navbar:p,sidebar:v,mainNav:N}){null===localStorage.getItem("desktopSidebarOpen")&&localStorage.setItem("desktopSidebarOpen","true");const[b,w]=f(!1),[y,k]=f("true"===localStorage.getItem("desktopSidebarOpen")),[S,z]=f(window.innerWidth>=1024);x((()=>{const e=()=>{z(window.innerWidth>=1024)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const F={isOpen:S?y:b,toggleDesktop:e=>{k(void 0===e?!y:e),localStorage.setItem("desktopSidebarOpen",JSON.stringify(!y))},toggleMobile:e=>{w(void 0===e?!b:e)}};return e(r,{children:e("div",{className:"flex flex-col h-screen overflow-y-hidden",children:l(C.Provider,{value:F,children:[e("div",{className:"w-full",children:N}),l("div",{className:"flex h-full overflow-y-auto w-full",children:[e(t,{show:b,as:g,children:l(n,{as:"div",className:"relative z-50 lg:hidden",onClose:w,children:[e(a,{as:g,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{className:"fixed inset-0 bg-gray-900/80"})}),e("div",{className:"fixed inset-0 flex",children:e(a,{as:g,enter:"transition ease-in-out duration-300 transform",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300 transform",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:l(s,{className:"relative flex w-full max-w-xs flex-1",children:[e(W,{logo:u,className:o,children:v}),e("div",{className:"flex w-16 justify-center pt-5 items-start",children:l("button",{type:"button",className:"-m-2.5 p-2.5",onClick:()=>w(!1),children:[e("span",{className:"sr-only",children:"Close sidebar"}),e(h,{className:"size-6 text-white","aria-hidden":"true"})]})})]})})})]})}),e("div",{className:"hidden lg:block relative transition-all duration-300 "+(y?"w-72":"w-12"),children:e(W,{logo:u,className:o,children:v})}),l("div",{className:"w-full h-full overflow-y-hidden",children:[p?e(O,{title:d,logo:u,children:p}):null,e("main",{className:i("flex-1 h-full w-full relative flex flex-col",c),children:m})]})]})]})})})}export{R as AppLayout,k as FullHeightLayout,T as HamburgerButton,O as Navbar,M as NavbarButton,I as NavbarIconButton,E as NavbarLink,D as NavbarSeparator,W as Sidebar,C as SidebarContext,P as SidebarItem,j as SidebarSection,L as SidebarTooltip,z as TitleBar,S as useSidebarToggle};
|
|
2
|
+
//# sourceMappingURL=vertesia-ui-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertesia-ui-layout.js","sources":["esm/layout/FullHeightLayout.js","esm/layout/SidebarContext.js","esm/layout/TitleBar.js","esm/layout/Navbar.js","esm/layout/Sidebar.js","esm/layout/AppLayout.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nexport function FullHeightLayout({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"flex flex-col\", \"h-full\", \"overflow-y-auto\", \"px-2\", className), children: children }));\n}\nFullHeightLayout.Fixed = function Fixed({ heightClass, className, children }) {\n return (_jsx(\"div\", { className: clsx(\"w-full\", heightClass, className), children: children }));\n};\nFullHeightLayout.Body = function Body({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"grow overflow-auto\", \"min-h-0\", \"p-2\", className), children: children }));\n};\nFullHeightLayout.VR = function VDivider({}) {\n return (_jsx(\"div\", { className: \"w-[1px] border border-red-200\" }));\n};\nFullHeightLayout.HR = function HDivider({}) {\n return (_jsx(\"div\", { className: \"w-full h-1 border-b border-red-200\" }));\n};\n//# sourceMappingURL=FullHeightLayout.js.map","import { createContext, useContext } from \"react\";\nexport const SidebarContext = createContext({\n isOpen: false,\n toggleMobile: () => void 0,\n toggleDesktop: () => void 0,\n});\nexport function useSidebarToggle() {\n return useContext(SidebarContext);\n}\n//# sourceMappingURL=SidebarContext.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nexport function TitleBar({ title }) {\n return _jsx(\"div\", { className: 'self-center text-lg font-semibold', children: title });\n}\n//# sourceMappingURL=TitleBar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Menu, Search } from 'lucide-react';\nimport { Button } from '@vertesia/ui/core';\nimport { useSidebarToggle } from './SidebarContext.js';\nimport { TitleBar } from './TitleBar.js';\nexport function Navbar({ children, logo, onSearch, title }) {\n return (_jsxs(\"div\", { className: \"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b px-4 shadow-2xs sm:gap-x-6 sm:px-6 lg:px-8\", children: [_jsx(HamburgerButton, {}), _jsx(\"div\", { className: \"lg:hidden\", children: logo }), onSearch && _jsx(NavbarSeparator, { visible: 'mobile' }), _jsxs(\"div\", { className: \"flex flex-1 gap-x-4 self-stretch lg:gap-x-6\", children: [_jsx(TitleBar, { title: title }), onSearch && _jsx(SearchBox, { onSearch: onSearch }), _jsx(\"div\", { className: \"flex items-center gap-x-4 lg:gap-x-6 ml-auto\", children: children })] })] }));\n}\nfunction SearchBox({}) {\n return (_jsxs(\"form\", { className: \"relative flex flex-1\", action: \"#\", method: \"GET\", children: [_jsx(\"label\", { htmlFor: \"search-field\", className: \"sr-only\", children: \"Search\" }), _jsx(Search, { className: \"pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-gray-400\", \"aria-hidden\": \"true\" }), _jsx(\"input\", { id: \"search-field\", className: \"block h-full w-full border-0 py-0 pl-8 pr-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm\", placeholder: \"Search...\", type: \"search\", name: \"search\" })] }));\n}\nexport function HamburgerButton() {\n const { toggleDesktop, toggleMobile } = useSidebarToggle();\n const toggle = () => {\n if (window.innerWidth < 1024) {\n toggleMobile();\n }\n else {\n toggleDesktop();\n }\n };\n return (_jsx(_Fragment, { children: _jsx(Button, { variant: 'ghost', size: 'icon', onClick: () => toggle(), className: \"p-2 rounded-full transition-colors w-full text-center \", children: _jsx(Menu, { \"aria-hidden\": \"true\", size: 24 }) }) }));\n}\nexport function NavbarSeparator({ visible }) {\n let visibility = \"\";\n if (visible) {\n visibility = visible === \"mobile\" ? \"lg:hidden\" : \"hidden lg:block\";\n }\n return (_jsx(\"div\", { className: `h-6 w-px bg-gray-900/10 dark:bg-slate-900/0.1 ${visibility}`, \"aria-hidden\": \"true\" }));\n}\nexport function NavbarIconButton({ title, icon: Icon, onClick }) {\n return (_jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5 text-gray-400 dark:text-slate-50 hover:text-gray-500\", onClick: onClick, children: [_jsx(\"span\", { className: \"sr-only\", children: title }), _jsx(Icon, { className: \"size-6\", \"aria-hidden\": \"true\", title: title })] }));\n}\nexport function NavbarButton({ children, onClick }) {\n return (_jsx(Button, { onClick: onClick, children: children }));\n}\nexport function NavbarLink({ href, onClick, children }) {\n return (_jsx(\"a\", { className: \"dark:text-slate-50\", href: href, onClick: onClick, children: children }));\n}\n//# sourceMappingURL=Navbar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nimport { useSidebarToggle } from './SidebarContext';\nimport { Dot } from 'lucide-react';\nimport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@vertesia/ui/core';\nimport { Nav } from \"@vertesia/ui/router\";\nexport function Sidebar({ children, logo, className }) {\n return (_jsxs(\"div\", { className: clsx(className || \"bg-indigo-600 dark:bg-indigo-950\", \"flex flex-col h-full\"), children: [logo &&\n _jsx(\"div\", { className: \"-mx-2 flex h-auto my-4 shrink-0 self-start\", children: logo }), _jsx(\"div\", { className: \"flex-1 min-h-0 overflow-hidden px-2\", children: _jsx(\"nav\", { className: \"h-full flex flex-col\", children: _jsx(\"ul\", { role: \"list\", className: \"flex flex-col gap-y-2 overflow-y-auto h-full\", children: children }) }) })] }));\n}\nexport function SidebarSection({ children, title, action, isFooter = false }) {\n const { isOpen } = useSidebarToggle();\n let header = isOpen ? _jsxs(_Fragment, { children: [title || \"\", action] }) : _jsx(Dot, { className: 'size-6' });\n return (_jsxs(\"li\", { className: isFooter ? 'mt-auto' : '', children: [title && _jsx(\"div\", { className: \"text-xs font-medium h-8 flex items-center gap-x-2 px-2 text-sidebar-foreground/70\", children: header }), _jsx(\"ul\", { \"data-sidebar\": \"menu\", className: \"flex w-full min-w-0 flex-col gap-1\", children: children })] }));\n}\nexport function SidebarTooltip({ children, text }) {\n const { isOpen } = useSidebarToggle();\n return (isOpen ? _jsx(_Fragment, { children: children }) :\n _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { side: 'right', children: text })] }) }));\n}\nexport function SidebarItem({ external, className, tools, children, icon: Icon, href, current, onClick }) {\n const { toggleMobile } = useSidebarToggle();\n const _closeSideBar = () => {\n setTimeout(() => {\n toggleMobile(false);\n }, 100);\n };\n const onClickWrapper = (event) => {\n if (external) {\n window.open(href, '_blank');\n event.preventDefault(); // Prevent default link behavior\n event.stopPropagation(); // Stop the event from propagating\n }\n else if (onClick) {\n onClick(event);\n }\n };\n return (_jsx(\"li\", { children: _jsx(Nav, { onClick: _closeSideBar, children: _jsx(SidebarTooltip, { text: children, children: _jsxs(\"a\", { href: href, onClick: onClickWrapper, className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'group flex gap-x-3 rounded-md px-2 py-1.5 text-sm items-center h-8', className), children: [Icon &&\n _jsx(Icon, { className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'size-4 shrink-0'), \"aria-hidden\": \"true\" }), children, tools && _jsx(\"div\", { className: 'flex items-center ml-auto', children: tools })] }) }) }) }));\n}\n//# sourceMappingURL=Sidebar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react';\nimport { X } from 'lucide-react';\nimport clsx from 'clsx';\nimport { Fragment, useEffect, useState } from 'react';\n// import { FullHeightLayout } from './FullHeightLayout.js'\nimport { Navbar } from './Navbar.js';\nimport { Sidebar } from './Sidebar.js';\nimport { SidebarContext } from './SidebarContext.js';\nexport function AppLayout({ sidebarClassName, className, title, children, logo, navbar, sidebar, mainNav }) {\n if (localStorage.getItem('desktopSidebarOpen') === null) {\n localStorage.setItem('desktopSidebarOpen', 'true');\n }\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const [desktopSidebarOpen, setDesktopSidebarOpen] = useState(localStorage.getItem('desktopSidebarOpen') === 'true');\n const [isLargeScreen, setIsLargeScreen] = useState(window.innerWidth >= 1024);\n useEffect(() => {\n const handleResize = () => {\n setIsLargeScreen(window.innerWidth >= 1024);\n };\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n const sidebarContextValue = {\n isOpen: isLargeScreen ? desktopSidebarOpen : sidebarOpen,\n toggleDesktop: (value) => {\n if (value === undefined) {\n setDesktopSidebarOpen(!desktopSidebarOpen);\n }\n else {\n setDesktopSidebarOpen(value);\n }\n localStorage.setItem('desktopSidebarOpen', JSON.stringify(!desktopSidebarOpen));\n },\n toggleMobile: (value) => {\n if (value === undefined) {\n setSidebarOpen(!sidebarOpen);\n }\n else {\n setSidebarOpen(value);\n }\n },\n };\n return (_jsx(_Fragment, { children: _jsx(\"div\", { className: 'flex flex-col h-screen overflow-y-hidden', children: _jsxs(SidebarContext.Provider, { value: sidebarContextValue, children: [_jsx(\"div\", { className: 'w-full', children: mainNav }), _jsxs(\"div\", { className: 'flex h-full overflow-y-auto w-full', children: [_jsx(Transition, { show: sidebarOpen, as: Fragment, children: _jsxs(Dialog, { as: \"div\", className: \"relative z-50 lg:hidden\", onClose: setSidebarOpen, children: [_jsx(TransitionChild, { as: Fragment, enter: \"transition-opacity ease-linear duration-300\", enterFrom: \"opacity-0\", enterTo: \"opacity-100\", leave: \"transition-opacity ease-linear duration-300\", leaveFrom: \"opacity-100\", leaveTo: \"opacity-0\", children: _jsx(\"div\", { className: \"fixed inset-0 bg-gray-900/80\" }) }), _jsx(\"div\", { className: \"fixed inset-0 flex\", children: _jsx(TransitionChild, { as: Fragment, enter: \"transition ease-in-out duration-300 transform\", enterFrom: \"-translate-x-full\", enterTo: \"translate-x-0\", leave: \"transition ease-in-out duration-300 transform\", leaveFrom: \"translate-x-0\", leaveTo: \"-translate-x-full\", children: _jsxs(DialogPanel, { className: \"relative flex w-full max-w-xs flex-1\", children: [_jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }), _jsx(\"div\", { className: \"flex w-16 justify-center pt-5 items-start\", children: _jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5\", onClick: () => setSidebarOpen(false), children: [_jsx(\"span\", { className: \"sr-only\", children: \"Close sidebar\" }), _jsx(X, { className: \"size-6 text-white\", \"aria-hidden\": \"true\" })] }) })] }) }) })] }) }), _jsx(\"div\", { className: `hidden lg:block relative transition-all duration-300 ${desktopSidebarOpen ? 'w-72' : 'w-12'}`, children: _jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }) }), _jsxs(\"div\", { className: \"w-full h-full overflow-y-hidden\", children: [navbar ? (_jsx(Navbar, { title: title, logo: logo, children: navbar })) : null, _jsx(\"main\", { className: clsx(\"flex-1 h-full w-full relative flex flex-col\", className), children: children })] })] })] }) }) }));\n}\n//# sourceMappingURL=AppLayout.js.map"],"names":["FullHeightLayout","className","children","_jsx","clsx","Fixed","heightClass","Body","VR","HR","SidebarContext","createContext","isOpen","toggleMobile","toggleDesktop","useSidebarToggle","useContext","TitleBar","title","Navbar","logo","onSearch","_jsxs","HamburgerButton","NavbarSeparator","visible","SearchBox","action","method","htmlFor","Search","id","placeholder","type","name","_Fragment","Button","variant","size","onClick","window","innerWidth","Menu","visibility","NavbarIconButton","icon","Icon","NavbarButton","NavbarLink","href","Sidebar","role","SidebarSection","isFooter","header","Dot","SidebarTooltip","text","TooltipProvider","Tooltip","TooltipTrigger","asChild","TooltipContent","side","SidebarItem","external","tools","current","Nav","setTimeout","event","open","preventDefault","stopPropagation","AppLayout","sidebarClassName","navbar","sidebar","mainNav","localStorage","getItem","setItem","sidebarOpen","setSidebarOpen","useState","desktopSidebarOpen","setDesktopSidebarOpen","isLargeScreen","setIsLargeScreen","useEffect","handleResize","addEventListener","removeEventListener","sidebarContextValue","value","undefined","JSON","stringify","Provider","Transition","show","as","Fragment","Dialog","onClose","TransitionChild","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo","DialogPanel","X"],"mappings":"qfAEO,SAASA,GAAiBC,UAAEA,EAAS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KgB,EAAQ,CAAED,MAAOA,EAAOE,KAAMA,EAAMlB,SAAU0E,IAAa,KAAMzE,EAAK,OAAQ,CAAEF,UAAWG,EAAK,8CAA+CH,GAAYC,SAAUA,gBAC9jE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRef as n,useEffect as a,createContext as r,useContext as i,useState as s,useMemo as o}from"react";import{useSafeLayoutEffect as h}from"@vertesia/ui/core";function c(t){return"/"===t||""===t}function l(t,e){return e=t.endsWith("/")&&e.startsWith("/")?t+e.substring(1):t.endsWith("/")||e.startsWith("/")?t+e:t+"/"+e}function u(t){if(""===t)return[];if("/"===t)return[""];let e=0,n=t.length;return t.startsWith("./")?e=2:t.startsWith("/")&&(e=1),t.endsWith("/")&&(n=t.length-1),(e>0||n<t.length?t.substring(e,n):t).split("/")}function d(t){if("string"==typeof t)return u(t);if(Array.isArray(t))return t;throw new Error(`Unsupported path object: ${t}`)}var m=Object.freeze({__proto__:null,getPathSegments:u,isRootPath:c,joinPath:l,toSegments:d});class p{path;params;hash;constructor(t){let e=t.lastIndexOf("#");e>-1?(this.hash=t.substring(e),t=t.substring(0,e)):this.hash="",e=t.indexOf("?"),e>-1?(this.path=t.substring(0,e),this.params=new URLSearchParams(t.substring(e+1))):(this.path=t,this.params=new URLSearchParams)}add(t){for(const[e,n]of Object.entries(t))this.params.set(e,n);return this}toString(){return this.path+"?"+this.params.toString()+this.hash}}const f=Symbol("BASE_PATH");class g{name;type;location;state;_canceled=!1;constructor(t,e,n,a){this.name=t,this.type=e,this.location=n,this.state=a}get isPageLoad(){return"initial"===this.type}get isBackForward(){return"popState"===this.type}get isLinkClick(){return"linkClick"===this.type}get isNavigation(){return"navigate"===this.type}get isCancelable(){return"beforeChange"===this.name}cancel(){if("afterChange"===this.name)throw new Error("Cannot cancel afterChange event");this._canceled=!0}}class w extends g{constructor(t,e,n){super("beforeChange",t,e,n)}}class v extends g{constructor(t,e,n){super("afterChange",t,e,n)}}class P{stickyParams;_popStateListener;_linkNavListener;_listeners=[];constructor(){}addListener(t){this._listeners.push(t)}fireLocationChange(t){for(const e of this._listeners)e(t)}firePageLoad(){this.fireLocationChange(new v("initial",new URL(window.location.href)))}addStickyParams(t){return this.stickyParams?new p(t).add(this.stickyParams).toString():t}navigate(t,e={}){if(e.basePath){let n=e.basePath;n.startsWith("/")||(n="/"+n),t=l(n,t)}t=this.addStickyParams(t),this._navigate(new URL(t,window.location.href),"navigate",e)}_navigate(t,e,n){const a=new w(e,t,n.state);this.fireLocationChange(a),a._canceled||(window.history[n.replace?"replaceState":"pushState"]({from:window.location.href,data:n.state||void 0},"",t.href),this.fireLocationChange(new v(e,t,n.state)))}start(){if("undefined"==typeof window)return;const t=t=>{let e=t.state?"popState":"linkClick";const n=new URL(window.location.href);let a;t.state?(e="popState",a=t.state.data):e="linkClick",this.fireLocationChange(new v(e,n,a))};this._popStateListener=t,this._linkNavListener=t=>{const e=function(t){if(t&&"a"===t.tagName.toLowerCase()){const e=t?.href.trim();if("string"==typeof e&&e.length>0)return new URL(e)}return null}(t.target);if(e&&e.origin===window.location.origin){t.preventDefault();const n=new URL(this.addStickyParams(e.href)),a=t[f]||t.target[f];a&&(n.pathname=l(a,n.pathname)),this._navigate(n,"linkClick",{})}},window.addEventListener("popstate",t),document.body.addEventListener("click",this._linkNavListener)}stop(){this._popStateListener&&window.removeEventListener("popstate",this._popStateListener),this._linkNavListener&&document.body.removeEventListener("click",this._linkNavListener)}}function b({basePath:e,children:r}){const i=n(null);return a((()=>{if(i.current){const t=i.current,n=t=>{"a"===t.target.tagName.toLowerCase()&&(t[f]=e)};return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)}}}),[i.current]),t("div",{ref:i,className:"h-full w-full",children:r})}class L{tree=new S;loadMapping(t){for(const[e,n]of Object.entries(t))this.addSegments(u(e),n)}addPath(t,e){this.addSegments(u(t),e)}addSegments(t,e){let n=this.tree;for(let a=0,r=t.length;a<r;a++){const i=t[a];if(":"===i[0]){let e=n.wildcard;if(e){if(!(e instanceof C))throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard ":" segment will overwrite an existing wildcard segment at path: ${"/"+t.slice(0,a).join("/")}`)}else e=new C(i),n.wildcard=e;n=e}else{if("*"===i){if(n.wildcard)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard "*" segment already exists at path: ${"/"+t.slice(0,a).join("/")}`);if(n.wildcard=new _(i,e),a<r-1)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard segment must be the last segment`);return}{let t=n.children[i];t||(t=new y(i),n.children[i]=t),n=t}}}if(void 0!==n.value)throw new Error(`Failed to index path segments: ${t.join("/")}. A value already exists at path: ${"/"+t.join("/")}`);n.value=e}match(t){const e=d(t);if(0===e.length)return null;const n={};let a,r,i=this.tree;for(const t of e){const e=i.match(t,n);if(!e)return null;i=e}if(!i.value){if(i instanceof k&&i.wildcard instanceof _&&(i=i.wildcard.match("",n),!i.value))throw new Error("Wildcard segment node `*` must have a value");if(!i.value)return null}return n._&&n._.length>0?(a=e.slice(0,-n._.length),r=n._):a=e,{params:n,matchedSegments:a,remainingSegments:r,value:i.value}}}class k{name;value;children={};wildcard;constructor(t,e){this.name=t,this.value=e}match(t,e){let n=this.children[t];if(n)return n;if(this.wildcard){if(this.wildcard instanceof _)return this.wildcard.match(t,e);if(this.wildcard instanceof C)return e[this.wildcard.paramName]=t,this.wildcard;throw new Error("Unknown wildcard segment node type: "+this.wildcard.constructor.name)}return null}}class S extends k{constructor(){super("#root")}}class y extends k{constructor(t,e){super(t,e)}}class C extends k{paramName;constructor(t,e){super(t,e),this.paramName=t.substring(1)}}class _{name;value;constructor(t,e){this.name=t,this.value=e}match(t,e){return e._?t&&e._.push(t):e._=t?[t]:[],this}}class x{index;matcher=new L;constructor(t,e){this.index=e;for(const e of t)this.matcher.addPath(e.path,e)}match(t){const e=c(t)&&this.index;return this.matcher.match(e?this.index:t)}}class R extends x{prompt;observer;navigator=new P;constructor(t,e){super(t),this.navigator.addListener((t=>{if((!(t.isCancelable&&this.prompt&&this.prompt.when)||window.confirm(this.prompt.message))&&(this.observer&&this.observer(t),"afterChange"===t.name)){const n=this.match(t.location.pathname);n&&n.value?e({...n,state:t.state}):e(null)}}))}getTopRouter(){return this}setStickyParams(t){this.navigator.stickyParams=null!=t?t:void 0}withObserver(t){return this.observer=t,this}start(){this.navigator.start(),this.navigator.firePageLoad()}stop(){this.navigator.stop()}navigate(t,e){this.navigator.navigate(t,e)}}class E extends x{parent;basePath;constructor(t,e,n){super(n),this.parent=t,this.basePath=e}getTopRouter(){return this.parent instanceof R?this.parent:this.parent.getTopRouter()}navigate(t,e){let n;if(e?.isBasePathNested??!0){const t=e?.basePath;n=t?l(this.basePath,t):this.basePath}else n=e?.basePath??this.basePath;this.parent.navigate(t,{...e,basePath:n})}}const j=r(void 0);function N(){const t=i(j);if(!t)throw new Error("useRouter must be used within a RouterProvider");return t}function $(){const{navigate:t}=N();return t}function U(t){const{params:e}=N();return t?e[t]:e}function W(){const{location:t}=N();return t}function A(t){const{router:e}=N();a((()=>(e.getTopRouter().prompt=t,()=>{e.getTopRouter().prompt=void 0})),[]),a((()=>{if(t.when){const e=t.when,n=function(t){e&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}}}),[t.when])}function O({children:e,onClick:n}){const a=$();return t("span",{onClick:t=>{const e=t.target.closest("a");e&&e.href&&(t.stopPropagation(),t.preventDefault(),a(e.href),n?.(t))},children:e})}function T({children:e,href:n,className:a,topLevelNav:r}){const{router:i}=N();return t("a",{href:n,className:a,onClick:t=>{t.stopPropagation(),t.preventDefault();(r?i.getTopRouter():i).navigate(n)},children:e})}function z({spinner:e}){const n=N(),a=n.route;if(a.Component){const e=a.Component;return t(e,{...n.params})}if(a.LazyComponent)return t(F,{route:a,spinner:e});throw new Error(`Invalid route for ${a.path}. Either Component or LazyCOmponent must be specified.`)}function F({route:e,spinner:n}){const[r,i]=s(null);return a((()=>{e.LazyComponent().then((t=>{if(!t.default)throw new Error(`Lazy module for ${e.path} does not have a default export`);i((()=>t.default))}))}),[e]),r?t(r,{}):n||null}function D({basePath:e,fixLinks:n=!1,children:a}){const r=N(),i=n?e=>t(b,{basePath:r.matchedRoutePath,children:e}):t=>t;return t(j.Provider,{value:{...r,navigate:(t,n)=>{const a=n?.basePath?l(e,n.basePath):e;return r.navigate(t,{...n,basePath:a})}},children:i(a||t(z,{}))})}function B(){const t=N();return e("div",{children:["Route not found for path ",t.matchedRoutePath]})}function I(){return{params:{},matchedSegments:[],state:null,value:{path:"virtual:404",Component:()=>t(B,{})}}}function H({routes:e,index:n,children:r,fixLinks:i=!1}){const h=N(),[c,l]=s(void 0),u=o((()=>{if("undefined"==typeof window)return null;const t=h.matchedRoutePath,a=new E(h.router,t,e);return a.index=n,a}),[]);a((()=>{if(u){if(h.matchedRoutePath!==u.basePath)return;const t=u.match(h.remainingPath||"/")||I();l(t)}}),[u,h.remainingPath]);const d=i?e=>t(b,{basePath:h.matchedRoutePath,children:e}):t=>t;return c&&t(j.Provider,{value:{...h,router:u,route:c.value,params:c.params,matchedRoutePath:"/"+c.matchedSegments.join("/"),remainingPath:c.remainingSegments?"/"+c.remainingSegments.join("/"):void 0,navigate:(t,e)=>u.navigate(t,e)},children:d(r||t(z,{}))})}function M({routes:e,index:n,onChange:a,children:r}){const[i,c]=s(void 0),l=o((()=>{if("undefined"==typeof window)return null;const t=new R(e,(e=>{null===e&&(e=I()),c({location:window.location,route:e.value,params:e.params,state:e.state,router:t,matchedRoutePath:"/"+e.matchedSegments.join("/"),remainingPath:e.remainingSegments?"/"+e.remainingSegments.join("/"):void 0,navigate:(e,n)=>t.navigate(e,n)})})).withObserver(a);return t.index=n,t}),[]);return h((()=>(l&&l.start(),()=>{l&&l.stop()})),[]),i&&t(j.Provider,{value:i,children:r||t(z,{})})}export{v as AfterLocationChangeEvent,f as BASE_PATH,x as BaseRouter,w as BeforeLocationChangeEvent,b as FixLinks,P as HistoryNavigator,g as LocationChangeEvent,O as Nav,T as NavLink,D as NestedNavigationContext,E as NestedRouter,H as NestedRouterProvider,m as Path,L as PathMatcher,j as ReactRouterContext,z as RouteComponent,R as Router,M as RouterProvider,W as useLocation,$ as useNavigate,A as useNavigationPrompt,U as useParams,N as useRouterContext};
|
|
2
|
+
//# sourceMappingURL=vertesia-ui-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertesia-ui-router.js","sources":["esm/router/path.js","esm/router/PathWithParams.js","esm/router/HistoryNavigator.js","esm/router/FixLinks.js","esm/router/PathMatcher.js","esm/router/Router.js","esm/router/Nav.js","esm/router/RouteComponent.js","esm/router/NestedNavigationContext.js","esm/router/Route404.js","esm/router/NestedRouterProvider.js","esm/router/RouterProvider.js"],"sourcesContent":["export function isRootPath(path) {\n return path === '/' || path === '';\n}\nexport function joinPath(path1, path2) {\n if (path1.endsWith('/') && path2.startsWith('/')) {\n path2 = path1 + path2.substring(1);\n }\n else if (path1.endsWith('/')) {\n path2 = path1 + path2;\n }\n else if (path2.startsWith('/')) {\n path2 = path1 + path2;\n }\n else {\n path2 = path1 + '/' + path2;\n }\n return path2;\n}\nexport function getPathSegments(path) {\n if (path === '') {\n return [];\n }\n if (path === '/') {\n return [''];\n }\n let s = 0, e = path.length;\n if (path.startsWith('./')) {\n s = 2;\n }\n else if (path.startsWith('/')) {\n s = 1;\n }\n if (path.endsWith('/')) {\n e = path.length - 1;\n }\n return (s > 0 || e < path.length ? path.substring(s, e) : path).split('/');\n}\nexport function toSegments(path) {\n if (typeof path === 'string') {\n return getPathSegments(path);\n }\n else if (Array.isArray(path)) {\n return path;\n }\n else {\n throw new Error(`Unsupported path object: ${path}`);\n }\n}\n// export class Path {\n// static parse(path: string, abs = false) {\n// if (abs !== undefined) {\n// abs = path.startsWith('/');\n// }\n// return new Path(getPathSegments(path), abs);\n// }\n// constructor(public segments: string[], public isAbsolute = false) {\n// }\n// getParameters() {\n// const out = [];\n// for (const segment of this.segments) {\n// if (segment[0] === ':') {\n// out.push(segment.substring(1));\n// }\n// }\n// if (this.segments[this.segments.length - 1] === '*') {\n// out.push('_');\n// }\n// return out;\n// }\n// resolveParameters(path: string) {\n// const params: PathMatchParams = {};\n// const resolvedSegments = getPathSegments(path);\n// if (resolvedSegments.length < this.segments.length) {\n// return null;\n// }\n// const segments = this.segments;\n// for (let i = 0, l = segments.length; i < l; i++) {\n// const seg = segments[i];\n// if (seg[0] === ':') {\n// params[seg.substring(1)] = resolvedSegments[i];\n// }\n// }\n// if (resolvedSegments.length - this.segments.length) {\n// params._ = resolvedSegments.slice(this.segments.length);\n// }\n// return params;\n// }\n// match(path: string | string[] | Path) {\n// const segments = toSegments(path);\n// if (segments.length < this.segments.length) {\n// return false;\n// }\n// let params: PathMatchParams | undefined;\n// const mySegments = this.segments;\n// for (let i = 0, l = mySegments.length; i < l; i++) {\n// const segment = mySegments[i];\n// if (segment === ':') {\n// if (!params) params = {};\n// params[segment.substring(1)] = segment;\n// } else if (segment !== segments[i]) {\n// if (i === l - 1 && segment === '*') {\n// if (!params) params = {};\n// params._ = segments.slice(i);\n// return params;\n// }\n// return false;\n// }\n// }\n// return params ? params : false;\n// }\n// join(path: Path | string | string[]) {\n// const segments = toSegments(path);\n// return new Path(this.segments.concat(segments), this.isAbsolute);\n// }\n// getRelativePath(path: Path | string | string[], asAbsolute: boolean = false) {\n// const segments = toSegments(path);\n// const extraSegmentsCount = segments.length - this.segments.length;\n// if (extraSegmentsCount <= 0) {\n// return null;\n// }\n// return new Path(segments.slice(this.segments.length), asAbsolute);\n// }\n// prependSegments(segments: string[]) {\n// this.segments = segments.concat(this.segments);\n// }\n// appendSegments(segments: string[]) {\n// this.segments = this.segments.concat(segments);\n// }\n// toAbsolutePath() {\n// return '/' + this.segments.join('/');\n// }\n// toRelativePath() {\n// return this.segments.join('/');\n// }\n// toString() {\n// const path = this.segments.join('/');\n// return this.isAbsolute ? '/' + path : path;\n// }\n// }\n//# sourceMappingURL=path.js.map","export class PathWithParams {\n path;\n params;\n hash;\n constructor(path) {\n let i = path.lastIndexOf('#');\n if (i > -1) {\n this.hash = path.substring(i);\n path = path.substring(0, i);\n }\n else {\n this.hash = '';\n }\n i = path.indexOf('?');\n if (i > -1) {\n this.path = path.substring(0, i);\n this.params = new URLSearchParams(path.substring(i + 1));\n }\n else {\n this.path = path;\n this.params = new URLSearchParams();\n }\n }\n add(params) {\n for (const [key, value] of Object.entries(params)) {\n this.params.set(key, value);\n }\n return this;\n }\n toString() {\n return this.path + '?' + this.params.toString() + this.hash;\n }\n}\n//# sourceMappingURL=PathWithParams.js.map","import { joinPath } from \"./path\";\nimport { PathWithParams } from \"./PathWithParams\";\nconst BASE_PATH = Symbol('BASE_PATH');\nexport { BASE_PATH };\nexport class LocationChangeEvent {\n name;\n type;\n location;\n state;\n _canceled = false;\n constructor(name, type, location, state) {\n this.name = name;\n this.type = type;\n this.location = location;\n this.state = state;\n }\n get isPageLoad() {\n return this.type === 'initial';\n }\n get isBackForward() {\n return this.type === 'popState';\n }\n get isLinkClick() {\n return this.type === 'linkClick';\n }\n get isNavigation() {\n return this.type === 'navigate';\n }\n get isCancelable() {\n return this.name === 'beforeChange';\n }\n cancel() {\n if (this.name === 'afterChange') {\n throw new Error('Cannot cancel afterChange event');\n }\n this._canceled = true;\n }\n}\nexport class BeforeLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('beforeChange', type, location, state);\n }\n}\nexport class AfterLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('afterChange', type, location, state);\n }\n}\nfunction getElementHrefAsUrl(elem) {\n if (elem && elem.tagName.toLowerCase() === 'a') {\n const href = elem?.href.trim();\n if (typeof href === 'string' && href.length > 0) {\n return new URL(href);\n }\n }\n return null;\n}\nexport class HistoryNavigator {\n // params to preserve in the query string when navigating\n stickyParams;\n _popStateListener;\n _linkNavListener;\n _listeners = [];\n constructor() {\n }\n addListener(listener) {\n this._listeners.push(listener);\n }\n fireLocationChange(event) {\n for (const listener of this._listeners) {\n listener(event);\n }\n }\n /**\n * Should be called when the page is first loaded.\n * It will fire a location change event with type `initial` and the current window.location as the location\n */\n firePageLoad() {\n this.fireLocationChange(new AfterLocationChangeEvent('initial', new URL(window.location.href)));\n }\n addStickyParams(path) {\n if (this.stickyParams) {\n return new PathWithParams(path).add(this.stickyParams).toString();\n }\n return path;\n }\n navigate(to, options = {}) {\n if (options.basePath) {\n let basePath = options.basePath;\n if (!basePath.startsWith('/')) {\n basePath = '/' + basePath;\n }\n to = joinPath(basePath, to);\n }\n to = this.addStickyParams(to);\n this._navigate(new URL(to, window.location.href), 'navigate', options);\n }\n _navigate(to, type, options) {\n const beforeEvent = new BeforeLocationChangeEvent(type, to, options.state);\n this.fireLocationChange(beforeEvent);\n if (beforeEvent._canceled) {\n return;\n }\n window.history[options.replace ? 'replaceState' : 'pushState']({\n from: window.location.href,\n data: options.state || undefined\n }, '', to.href);\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, options.state));\n }\n start() {\n if (typeof window === \"undefined\") {\n return;\n }\n const _popStateListener = (ev) => {\n let type = ev.state ? 'popState' : 'linkClick';\n const to = new URL(window.location.href);\n let state = undefined;\n if (ev.state) {\n type = 'popState';\n state = ev.state.data;\n }\n else {\n type = 'linkClick';\n }\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, state));\n };\n const _linkNavListener = (ev) => {\n const url = getElementHrefAsUrl(ev.target);\n if (url && url.origin === window.location.origin) {\n ev.preventDefault();\n const to = new URL(this.addStickyParams(url.href));\n const basePath = ev[BASE_PATH] || ev.target[BASE_PATH];\n if (basePath) {\n to.pathname = joinPath(basePath, to.pathname);\n }\n this._navigate(to, 'linkClick', {});\n }\n };\n this._popStateListener = _popStateListener;\n this._linkNavListener = _linkNavListener;\n window.addEventListener('popstate', _popStateListener);\n document.body.addEventListener('click', this._linkNavListener);\n }\n stop() {\n this._popStateListener && window.removeEventListener('popstate', this._popStateListener);\n this._linkNavListener && document.body.removeEventListener('click', this._linkNavListener);\n }\n}\n//# sourceMappingURL=HistoryNavigator.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useRef } from \"react\";\nimport { BASE_PATH } from \"./HistoryNavigator\";\nexport function FixLinks({ basePath, children }) {\n const ref = useRef(null);\n useEffect(() => {\n if (ref.current) {\n const divElem = ref.current;\n const listener = (ev) => {\n const elem = ev.target;\n if (elem.tagName.toLowerCase() === 'a') {\n ev[BASE_PATH] = basePath;\n }\n };\n divElem.addEventListener('click', listener);\n return () => {\n divElem.removeEventListener('click', listener);\n };\n }\n }, [ref.current]);\n return (_jsx(\"div\", { ref: ref, className: \"h-full w-full\", children: children }));\n}\n//# sourceMappingURL=FixLinks.js.map","import { getPathSegments, toSegments } from \"./path\";\n/**\n * Path matcher which support :param and *wildcard segments.\n * The wildcard segment is only supported as the last segment\n */\nexport class PathMatcher {\n tree = new RootSegmentNode();\n loadMapping(mapping) {\n for (const [key, value] of Object.entries(mapping)) {\n this.addSegments(getPathSegments(key), value);\n }\n }\n addPath(path, value) {\n this.addSegments(getPathSegments(path), value);\n }\n addSegments(segments, value) {\n let node = this.tree;\n for (let i = 0, l = segments.length; i < l; i++) {\n const segment = segments[i];\n if (segment[0] === ':') {\n let childNode = node.wildcard;\n if (!childNode) {\n childNode = new VariableSegmentNode(segment);\n node.wildcard = childNode;\n }\n else if (!(childNode instanceof VariableSegmentNode)) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \":\" segment will overwrite an existing wildcard segment at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node = childNode;\n }\n else if (segment === '*') {\n if (node.wildcard) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \"*\" segment already exists at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node.wildcard = new WildcardSegmentNode(segment, value);\n if (i < l - 1) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard segment must be the last segment`);\n }\n return;\n }\n else {\n let childNode = node.children[segment];\n if (!childNode) {\n childNode = new LiteralSegmentNode(segment);\n node.children[segment] = childNode;\n } // else // a literal segment already exists\n node = childNode;\n }\n }\n if (node.value !== undefined) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A value already exists at path: ${'/' + segments.join(\"/\")}`);\n }\n node.value = value;\n }\n match(path) {\n const segments = toSegments(path);\n if (segments.length === 0) {\n return null;\n }\n const params = {};\n let node = this.tree;\n for (const segment of segments) {\n const match = node.match(segment, params);\n if (match) {\n node = match;\n }\n else {\n return null;\n }\n }\n if (!node.value) { // not a leaf node (partial match)\n if (node instanceof ParentSegmentNode) {\n if (node.wildcard instanceof WildcardSegmentNode) {\n node = node.wildcard.match('', params);\n if (!node.value) {\n throw new Error(\"Wildcard segment node `*` must have a value\");\n }\n }\n }\n if (!node.value)\n return null; // not a leaf node, neither a trailing wildcard (partial match)\n }\n let matchedSegments, remainingSegments;\n if (params._ && params._.length > 0) {\n matchedSegments = segments.slice(0, -params._.length);\n remainingSegments = params._;\n }\n else {\n matchedSegments = segments;\n }\n return { params, matchedSegments, remainingSegments, value: node.value };\n }\n}\nclass ParentSegmentNode {\n name;\n value;\n children = {};\n wildcard;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n let node = this.children[segment];\n if (node) {\n return node;\n }\n else if (this.wildcard) {\n if (this.wildcard instanceof WildcardSegmentNode) {\n return this.wildcard.match(segment, params);\n }\n else if (this.wildcard instanceof VariableSegmentNode) {\n params[this.wildcard.paramName] = segment;\n return this.wildcard;\n }\n else {\n throw new Error(\"Unknown wildcard segment node type: \" + this.wildcard.constructor.name);\n }\n }\n else {\n return null;\n }\n }\n}\nclass RootSegmentNode extends ParentSegmentNode {\n constructor() {\n super(\"#root\");\n }\n}\nclass LiteralSegmentNode extends ParentSegmentNode {\n constructor(name, value) {\n super(name, value);\n }\n}\nclass VariableSegmentNode extends ParentSegmentNode {\n paramName;\n constructor(name, value) {\n super(name, value);\n this.paramName = name.substring(1);\n }\n}\nclass WildcardSegmentNode {\n name;\n value;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n if (!params._) {\n params._ = segment ? [segment] : [];\n }\n else {\n segment && params._.push(segment);\n }\n return this;\n }\n}\n//# sourceMappingURL=PathMatcher.js.map","import { createContext, useContext, useEffect } from \"react\";\nimport { HistoryNavigator } from \"./HistoryNavigator\";\nimport { PathMatcher } from \"./PathMatcher\";\nimport { isRootPath, joinPath } from \"./path\";\nexport class BaseRouter {\n // the path to use when navigating to the root of the router\n index;\n matcher = new PathMatcher();\n constructor(routes, index) {\n this.index = index;\n for (const route of routes) {\n this.matcher.addPath(route.path, route);\n }\n }\n match(path) {\n const useIndex = isRootPath(path) && this.index;\n return this.matcher.match(useIndex ? this.index : path);\n }\n}\nexport class Router extends BaseRouter {\n prompt;\n observer;\n navigator = new HistoryNavigator();\n constructor(routes, updateState) {\n super(routes);\n this.navigator.addListener((event) => {\n if (event.isCancelable && this.prompt && !!this.prompt.when) {\n if (!window.confirm(this.prompt.message))\n return;\n }\n if (this.observer) {\n this.observer(event);\n }\n // only process afterChange events\n if (event.name === \"afterChange\") {\n const match = this.match(event.location.pathname);\n if (match && match.value) {\n updateState({\n ...match,\n state: event.state,\n });\n }\n else {\n updateState(null);\n }\n }\n });\n }\n getTopRouter() {\n return this;\n }\n /**\n * Subsequent navigations will preserve the given params in the query string.\n * Use null to clear the sticky params.\n * @param params\n */\n setStickyParams(params) {\n this.navigator.stickyParams = params != null ? params : undefined;\n }\n withObserver(observer) {\n this.observer = observer;\n return this;\n }\n start() {\n this.navigator.start();\n // initialize with the current location\n this.navigator.firePageLoad();\n }\n stop() {\n this.navigator.stop();\n }\n navigate(path, options) {\n this.navigator.navigate(path, options);\n }\n}\nexport class NestedRouter extends BaseRouter {\n parent;\n basePath;\n constructor(parent, basePath, routes) {\n super(routes);\n this.parent = parent;\n this.basePath = basePath;\n }\n getTopRouter() {\n if (this.parent instanceof Router) {\n return this.parent;\n }\n else {\n return this.parent.getTopRouter();\n }\n }\n navigate(path, options) {\n // base path is nested by default in a NestedRouter unless explicitly set to false by caller\n const isBasePathNested = options?.isBasePathNested ?? true;\n let basePath;\n if (isBasePathNested) {\n const childBasePath = options?.basePath;\n // e.g. \"/store\" + \"/objects/123\" => \"/store/objects/123\"\n basePath = childBasePath ? joinPath(this.basePath, childBasePath) : this.basePath;\n }\n else {\n // e.g. \"/store\" + \"/studio\" => \"/studio\"\n basePath = options?.basePath ?? this.basePath;\n }\n this.parent.navigate(path, {\n ...options,\n basePath,\n });\n }\n}\nconst ReactRouterContext = createContext(undefined);\nexport { ReactRouterContext };\nexport function useRouterContext() {\n const ctx = useContext(ReactRouterContext);\n if (!ctx) {\n throw new Error(\"useRouter must be used within a RouterProvider\");\n }\n return ctx;\n}\nexport function useNavigate() {\n const { navigate } = useRouterContext();\n return navigate;\n}\nexport function useParams(arg) {\n const { params } = useRouterContext();\n if (arg) {\n return params[arg];\n }\n else {\n return params;\n }\n}\nexport function useLocation() {\n const { location } = useRouterContext();\n return location;\n}\nexport function useNavigationPrompt(prompt) {\n const { router } = useRouterContext();\n useEffect(() => {\n router.getTopRouter().prompt = prompt;\n return () => {\n router.getTopRouter().prompt = undefined;\n };\n }, []);\n useEffect(() => {\n if (prompt.when) {\n const doBlock = prompt.when;\n const listener = function (ev) {\n if (doBlock) {\n ev.preventDefault();\n ev.returnValue = \"\";\n }\n };\n window.addEventListener(\"beforeunload\", listener);\n return () => {\n window.removeEventListener(\"beforeunload\", listener);\n };\n }\n }, [prompt.when]);\n}\n//# sourceMappingURL=Router.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useNavigate, useRouterContext } from \"./Router\";\nexport function Nav({ children, onClick }) {\n const navigate = useNavigate();\n const _onClick = (ev) => {\n const link = ev.target.closest('a');\n if (link && link.href) {\n ev.stopPropagation();\n ev.preventDefault();\n navigate(link.href);\n onClick?.(ev);\n }\n };\n return (_jsx(\"span\", { onClick: _onClick, children: children }));\n}\nexport function NavLink({ children, href, className, topLevelNav }) {\n const { router } = useRouterContext();\n const _onClick = (ev) => {\n ev.stopPropagation();\n ev.preventDefault();\n const actualRouter = topLevelNav ? router.getTopRouter() : router;\n actualRouter.navigate(href);\n };\n return (_jsx(\"a\", { href: href, className: className, onClick: _onClick, children: children }));\n}\n//# sourceMappingURL=Nav.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useState } from \"react\";\nimport { useRouterContext } from \"./Router\";\nexport function RouteComponent({ spinner }) {\n const ctx = useRouterContext();\n const route = ctx.route;\n if (route.Component) {\n const Component = route.Component;\n return _jsx(Component, { ...ctx.params });\n }\n else if (route.LazyComponent) {\n return _jsx(LazyRouteComponent, { route: route, spinner: spinner });\n }\n else {\n throw new Error(`Invalid route for ${route.path}. Either Component or LazyCOmponent must be specified.`);\n }\n}\nfunction LazyRouteComponent({ route, spinner }) {\n const [Component, setComponent] = useState(null);\n useEffect(() => {\n route.LazyComponent().then(module => {\n if (!module.default) {\n throw new Error(`Lazy module for ${route.path} does not have a default export`);\n }\n // we need to wrap the component type in an arrow function\n // otherwise the setState function will execute the function as a state update function\n setComponent(() => module.default);\n });\n }, [route]);\n return Component ? (_jsx(Component, {})) : spinner || null;\n}\n//# sourceMappingURL=RouteComponent.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { FixLinks } from \"./FixLinks\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, useRouterContext } from \"./Router\";\nimport { joinPath } from \"./path\";\nexport function NestedNavigationContext({ basePath, fixLinks = false, children }) {\n const ctx = useRouterContext();\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n navigate: (to, options) => {\n const actualBasePath = options?.basePath ? joinPath(basePath, options.basePath) : basePath;\n return ctx.navigate(to, { ...options, basePath: actualBasePath });\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedNavigationContext.js.map","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouterContext } from \"./Router\";\nexport function Route404Component() {\n const ctx = useRouterContext();\n return _jsxs(\"div\", { children: [\"Route not found for path \", ctx.matchedRoutePath] });\n}\nexport function createRoute404() {\n return {\n params: {},\n matchedSegments: [],\n state: null,\n value: {\n path: 'virtual:404',\n Component: () => _jsx(Route404Component, {})\n }\n };\n}\n//# sourceMappingURL=Route404.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { FixLinks } from \"./FixLinks\";\nimport { createRoute404 } from \"./Route404\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { NestedRouter, ReactRouterContext, useRouterContext } from \"./Router\";\nexport function NestedRouterProvider({ routes, index, children, fixLinks = false }) {\n const ctx = useRouterContext();\n const [nestedRouteMatch, setNestedRouteMatch] = useState(undefined);\n const nestedRouter = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const basePath = ctx.matchedRoutePath;\n const nestedRouter = new NestedRouter(ctx.router, basePath, routes);\n nestedRouter.index = index;\n return nestedRouter;\n }, []);\n useEffect(() => {\n if (nestedRouter) {\n if (ctx.matchedRoutePath !== nestedRouter.basePath) {\n // the change doesn't belong to this nested router\n // it should be handled by the top level router which will change the page or the nested router\n return;\n }\n const route = nestedRouter.match(ctx.remainingPath || '/') || createRoute404();\n setNestedRouteMatch(route);\n }\n }, [nestedRouter, ctx.remainingPath]);\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return nestedRouteMatch && (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n router: nestedRouter,\n route: nestedRouteMatch.value,\n params: nestedRouteMatch.params,\n matchedRoutePath: '/' + nestedRouteMatch.matchedSegments.join('/'),\n remainingPath: nestedRouteMatch.remainingSegments ? '/' + nestedRouteMatch.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return nestedRouter.navigate(to, options);\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedRouterProvider.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useSafeLayoutEffect } from \"@vertesia/ui/core\";\n//import { useSafeLayoutEffect } from \"../core\";\nimport { useMemo, useState } from \"react\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, Router } from \"./Router\";\nimport { createRoute404 } from \"./Route404\";\nexport function RouterProvider({ routes, index, onChange, children }) {\n const [state, setState] = useState(undefined);\n const router = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const router = new Router(routes, (match) => {\n if (match === null) {\n match = createRoute404();\n }\n setState({\n location: window.location,\n route: match.value,\n params: match.params,\n state: match.state,\n router: router,\n matchedRoutePath: '/' + match.matchedSegments.join('/'),\n remainingPath: match.remainingSegments ? '/' + match.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return router.navigate(to, options);\n }\n });\n }).withObserver(onChange);\n router.index = index;\n return router;\n }, []);\n useSafeLayoutEffect(() => {\n router && router.start();\n return () => {\n router && router.stop();\n };\n }, []);\n return state && (_jsx(ReactRouterContext.Provider, { value: state, children: children ? children : _jsx(RouteComponent, {}) }));\n}\n//# sourceMappingURL=RouterProvider.js.map"],"names":["isRootPath","path","joinPath","path1","path2","endsWith","startsWith","substring","getPathSegments","s","e","length","split","toSegments","Array","isArray","Error","PathWithParams","params","hash","constructor","i","lastIndexOf","this","indexOf","URLSearchParams","add","key","value","Object","entries","set","toString","BASE_PATH","Symbol","LocationChangeEvent","name","type","location","state","_canceled","isPageLoad","isBackForward","isLinkClick","isNavigation","isCancelable","cancel","BeforeLocationChangeEvent","super","AfterLocationChangeEvent","HistoryNavigator","stickyParams","_popStateListener","_linkNavListener","_listeners","addListener","listener","push","fireLocationChange","event","firePageLoad","URL","window","href","addStickyParams","navigate","to","options","basePath","_navigate","beforeEvent","history","replace","from","data","undefined","start","ev","url","elem","tagName","toLowerCase","trim","getElementHrefAsUrl","target","origin","preventDefault","pathname","addEventListener","document","body","stop","removeEventListener","FixLinks","children","ref","useRef","useEffect","current","divElem","_jsx","className","PathMatcher","tree","RootSegmentNode","loadMapping","mapping","addSegments","addPath","segments","node","l","segment","childNode","wildcard","VariableSegmentNode","join","slice","WildcardSegmentNode","LiteralSegmentNode","match","matchedSegments","remainingSegments","ParentSegmentNode","_","paramName","BaseRouter","index","matcher","routes","route","useIndex","Router","prompt","observer","navigator","updateState","when","confirm","message","getTopRouter","setStickyParams","withObserver","NestedRouter","parent","isBasePathNested","childBasePath","ReactRouterContext","createContext","useRouterContext","ctx","useContext","useNavigate","useParams","arg","useLocation","useNavigationPrompt","router","doBlock","returnValue","Nav","onClick","link","closest","stopPropagation","NavLink","topLevelNav","RouteComponent","spinner","Component","LazyComponent","LazyRouteComponent","setComponent","useState","then","module","default","NestedNavigationContext","fixLinks","wrapWithFixLinks","matchedRoutePath","Provider","actualBasePath","Route404Component","_jsxs","createRoute404","NestedRouterProvider","nestedRouteMatch","setNestedRouteMatch","nestedRouter","useMemo","remainingPath","RouterProvider","onChange","setState","useSafeLayoutEffect"],"mappings":"sNAAO,SAASA,EAAWC,GACvB,MAAgB,MAATA,GAAyB,KAATA,CAC3B,CACO,SAASC,EAASC,EAAOC,GAa5B,OAXIA,EADAD,EAAME,SAAS,MAAQD,EAAME,WAAW,KAChCH,EAAQC,EAAMG,UAAU,GAE3BJ,EAAME,SAAS,MAGfD,EAAME,WAAW,KAFdH,EAAQC,EAMRD,EAAQ,IAAMC,CAG9B,CACO,SAASI,EAAgBP,GAC5B,GAAa,KAATA,EACA,MAAO,GAEX,GAAa,MAATA,EACA,MAAO,CAAC,IAEZ,IAAIQ,EAAI,EAAGC,EAAIT,EAAKU,OAUpB,OATIV,EAAKK,WAAW,MAChBG,EAAI,EAECR,EA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BAAoB,IAAMiE,EAAiBjE,kBAAkBN,KAAK,UAAOzC,EACzGV,SAAU,CAACC,EAAIC,IACJ0H,EAAa5H,SAASC,EAAIC,IAEtC2B,SAAUqF,EAAiBrF,GAAsBM,EAAKmE,EAAgB,CAAA,KACjF,CCnCO,SAASyB,GAAe/D,OAAEA,EAAMF,MAAEA,EAAKkE,SAAEA,EAAQnG,SAAEA,IACtD,MAAOvD,EAAO2J,GAAYrB,OAASlG,GAC7BkF,EAASiC,GAAQ,KACnB,GAAsB,oBAAXhI,OACP,OAAO,KACX,MAAM+F,EAAS,IAAIzB,EAAOH,GAAST,IACjB,OAAVA,IACAA,EAAQiE,KAEZS,EAAS,CACL5J,SAAUwB,OAAOxB,SACjB4F,MAAOV,EAAM5F,MACbV,OAAQsG,EAAMtG,OACdqB,MAAOiF,EAAMjF,MACbsH,OAAQA,EACRuB,iBAAkB,IAAM5D,EAAMC,gBAAgBL,KAAK,KACnD2E,cAAevE,EAAME,kBAAoB,IAAMF,EAAME,kBAAkBN,KAAK,UAAOzC,EACnFV,SAAU,CAACC,EAAIC,IACJ0F,EAAO5F,SAASC,EAAIC,QAGpC2E,aAAamD,GAEhB,OADApC,EAAO9B,MAAQA,EACR8B,IACR,IAOH,OANAsC,GAAoB,KAChBtC,GAAUA,EAAOjF,QACV,KACHiF,GAAUA,EAAOlE,UAEtB,IACIpD,GAAU6D,EAAK+C,EAAmBkC,SAAU,CAAEzJ,MAAOW,EAAOuD,SAAUA,GAAsBM,EAAKmE,EAAgB,CAAE,IAC9H"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jwtDecode as e}from"jwt-decode";import{Env as t}from"@vertesia/ui/env";import{getAnalytics as o,logEvent as n}from"firebase/analytics";import{initializeApp as r}from"firebase/app";import{getAuth as i,onAuthStateChanged as a}from"firebase/auth";import{useState as s,useEffect as c,createContext as l,useContext as u,useCallback as h}from"react";import{useUserSession as d}from"@vertesia/ui/session";import{VertesiaClient as g}from"@vertesia/client";import{jsx as m}from"react/jsx-runtime";const p="composableai.lastSelectedAccountId",f="composableai.lastSelectedProjectId";let w,v,k=null,b=null,y=null;function S(){if(!k)try{if(!t.firebase)throw new Error("Firebase configuration is not available in the environment");k=r(t.firebase)}catch(e){throw console.error("Failed to initialize Firebase app:",e),new Error("Firebase initialization failed - environment may not be properly initialized")}return k}function T(){return b||(b=o(S())),b}function _(){return y||(y=i(S())),y}async function j(e){if(e)if(t.firebase)try{e&&console.log(`Resolving tenant ID from email: ${e}`);let o=3,n=250;for(;o>0;)try{const o=await fetch("/api/resolve-tenant",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenantEmail:e}),signal:AbortSignal.timeout(5e3)});if(!o)throw new Error("No response received from tenant API");if(!o.ok){try{const e=await o.json();console.error("Failed to resolve tenant ID:",e.error)}catch(e){console.error(`Failed to resolve tenant ID: HTTP ${o.status}`)}if(404===o.status)return void console.warn(`Tenant not found for ${e}`);throw new Error(`HTTP error ${o.status}`)}const n=await o.json();if(n&&n.firebaseTenantId){const e=_();return e.tenantId=n.firebaseTenantId,t.firebase.providerType=n.provider??"oidc",console.log(`Tenant ID set to ${e.tenantId}`),n}return void console.error(`Invalid response format, missing tenantId for ${e}`)}catch(e){if(!(o>1))throw e;console.warn(`Tenant resolution failed, retrying in ${n}ms...`,e),await new Promise((e=>setTimeout(e,n))),n*=2,o--}}catch(e){console.error("Error setting Firebase tenant:",e instanceof Error?e.message:"Unknown error")}else console.log("Firebase configuration is not available in the environment");else console.log("No tenant name or email specified, skipping tenant setup")}async function I(e){const o=_().currentUser;return o?o.getIdToken(e).then((n=>(t.logger.info("Got Firebase token",{vertesia:{user_email:o.email,user_name:o.displayName,user_id:o.uid,refresh:e}}),n))).catch((n=>(t.logger.error("Failed to get Firebase token",{vertesia:{user_email:o.email,user_name:o.displayName,user_id:o.uid,refresh:e,error:n}}),console.error("Failed to get access token",n),null))):(t.logger.warn("No user found"),Promise.resolve(null))}async function F(o,n,r,i){console.log(`Getting/refreshing composable token for account ${n} and project ${r} `),t.logger.info("Getting/refreshing composable token",{vertesia:{account_id:n,project_id:r}});const a=await o();if(!a)throw console.log("No id token found - using cookie auth"),new Error("No id token found");console.log("Fetching composable token from "+t.endpoints.studio),t.logger.info("Fetching composable token from"+t.endpoints.studio,{vertesia:{account_id:n,project_id:r}});const s=new URL(t.endpoints.studio+"/auth/token");n&&s.searchParams.set("accountId",n),r&&s.searchParams.set("projectId",r),i&&s.searchParams.set("ttl",String(i)),console.log(`Getting composable token for account ${n} and project ${r}`),t.logger.info("Getting composable token",{vertesia:{account_id:n,project_id:r}});const c=await fetch(s,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}}).catch((e=>{throw localStorage.removeItem(p),localStorage.removeItem(f),console.error("Failed to get composable token",e),t.logger.error("Failed to get composable token",{vertesia:{account_id:n,project_id:r,error:e}}),new Error("Failed to get composable token")}));if(a&&412===c?.status){console.log("412: auth succeeded but user doesn't exist - signup required",c?.status),t.logger.error("412: auth succeeded but user doesn't exist - signup required",{vertesia:{account_id:n,project_id:r,status:c?.status}});const o=e(a);if(!o?.email)throw t.logger.error("No email found in id token"),new Error("No email found in id token");throw t.logger.error("User not found",{vertesia:{account_id:n,project_id:r,email:o.email}}),new P("User not found",o.email)}if(!c||!c.ok)throw console.error("Failed to get composable token",c),t.logger.error("Failed to get composable token",{vertesia:{account_id:n,project_id:r,status:c?.status}}),new Error("Failed to get composable token");const{token:l}=await c.json().catch((e=>{t.logger.error("Failed to parse composable token",{vertesia:{account_id:n,project_id:r,error:e}}),console.error("Failed to parse composable token",e)}));return l}async function E(e,t,o){return F(I,e,t,o)}async function A(o,n,r,i=!1,a=!1){const s=o??localStorage.getItem(p)??void 0,c=n??localStorage.getItem(f+"-"+s)??void 0;if(!i&&w&&v&&v.exp>Date.now()/1e3+300)return{rawToken:w,token:v,error:!1};if(!a&&_().currentUser?w=await E(s,c):(r||w)&&(w=await F((()=>Promise.resolve(r??w)),s,c)),!w)throw t.logger.error("Cannot acquire a composable token",{vertesia:{account_id:s,project_id:c}}),new Error("Cannot acquire a composable token");if(v=e(w),!v||!v.exp||!w)throw console.error("Invalid composable token",v),t.logger.error("Invalid composable token",{vertesia:{account_id:s,project_id:c}}),new Error("Invalid composable token");return{rawToken:w,token:v,error:!1}}class P extends Error{email;constructor(e,t){super(e),this.name="UserNotFoundError",this.email=t}}function $(){const{user:e}=d(),[t,o]=s(null),[n,r]=s(!0),[i,a]=s(null);return c((()=>{(async()=>{if(!e?.email)return o(null),void r(!1);try{const t=await fetch("/api/resolve-tenant",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenantEmail:e.email})});if(t.ok){const e=await t.json();o(e?{tenantKey:e.name||"unknown",name:e.label||e.name||"Unknown",domain:e.domain||[],firebaseTenantId:e.firebaseTenantId,provider:e.provider,logo:e.logo}:null)}else o(null)}catch(e){console.error("Error loading current tenant:",e),a("Failed to load tenant configuration"),o(null)}finally{r(!1)}})()}),[e?.email]),{currentTenant:t,isLoading:n,error:i}}class U{types;map={};constructor(e){this.types=e,e.sort(((e,t)=>e.name.localeCompare(t.name)));for(const t of e)this.map[t.id]=t}getType(e){return this.map[e]}getTypeLayout(e){const t=this.map[e];return t?t.table_layout:void 0}getTypeName(e){const t=this.map[e];return t?t.name:void 0}}class C{isLoading=!0;client;authError;authToken;typeRegistry;setSession;lastSelectedAccount;lastSelectedProject;onboardingComplete;constructor(e,o){this.client=e||new g({serverUrl:t.endpoints.studio,storeUrl:t.endpoints.zeno}),o&&(this.setSession=o),this.logout=this.logout.bind(this)}get store(){return this.client.store}get user(){return this.authToken}get account(){return this.authToken?.account}get project(){return this.authToken?.project}get accounts(){return this.authToken?.accounts}get authCallback(){return this.rawAuthToken.then((e=>`Bearer ${e}`))}get rawAuthToken(){return A().then((t=>{const o=t?.rawToken;if(!o)throw new Error("No token available");return this.authToken=e(o),o}))}signOut(){this.logout()}getAccount(){return this.authToken?.account}async login(o){return this.authError=void 0,this.isLoading=!1,this.client.withAuthCallback((()=>this.authCallback)),this.authToken=e(o),console.log(`Logging in as ${this.authToken?.name} with account ${this.authToken?.account.name} (${this.authToken?.account.id}, and project ${this.authToken?.project?.name} (${this.authToken?.project?.id})`),localStorage.setItem(p,this.authToken.account.id),localStorage.setItem(f+"-"+this.authToken.account.id,this.authToken.project?.id??""),t.onLogin?.(this.authToken),await Promise.all([this._loadTypes(),this.fetchOnboardingStatus()]),Promise.resolve()}isLoggedIn(){return!!this.authToken}logout(){console.log("Logging out"),this.authToken&&_().signOut(),this.authError=void 0,this.isLoading=!1,this.authToken=void 0,this.typeRegistry=void 0,this.setSession=void 0,this.client.withAuthCallback(void 0)}async switchAccount(e){localStorage.setItem(p,e),this&&(this.account&&this.project?localStorage.setItem(f+"-"+this.account.id,this.project.id):this.account&&localStorage.removeItem(f+"-"+this.account.id)),window.location.replace("/?a="+e)}async switchProject(e){this.account&&localStorage.setItem(f+"-"+this.account.id,e),window.location.replace("/?a="+this.account?.id+"&p="+e)}async _loadTypes(){if(this.project)return this.store.types.list({},{layout:!0}).then((e=>this.typeRegistry=new U(e))).catch((e=>{throw console.error("Failed to fetch object types",e),e}));console.log("No project selected")}async reloadTypes(){return this._loadTypes().then((()=>{this.setSession?.(this.clone())}))}async fetchAccounts(){return this.client.accounts.list().then((e=>{if(!this.authToken)throw new Error("No token available");this.authToken.accounts=e,this.setSession?.(this.clone())})).catch((e=>{throw console.error("Failed to fetch accounts",e),e}))}async fetchOnboardingStatus(){if(this.onboardingComplete)return console.log("Onboarding already completed"),!1;const e=this.onboardingComplete;try{const t=await this.client.account.onboardingProgress();if(this.onboardingComplete=Object.values(t).every((e=>!0===e)),e!==this.onboardingComplete)return!0;this.setSession?.(this.clone())}catch(e){console.error("Error fetching onboarding status:",e),this.onboardingComplete=!1,this.setSession?.(this.clone())}return!1}clone(){const e=new C(this.client);return e.isLoading=this.isLoading,e.authError=this.authError,e.authToken=this.authToken,e.setSession=this.setSession,e.lastSelectedAccount=this.lastSelectedAccount,e.switchAccount=this.switchAccount,e.typeRegistry=this.typeRegistry,e.onboardingComplete=this.onboardingComplete,e}}const N=l(void 0);function L(){const e=u(N);if(!e)throw new Error("useUserSession must be used within a UserSessionProvider");return e}const R="auth_state",D="auth_state_expiry";const O=[".composable.sh",".vertesia.dev","vertesia.app"];function x(){return!!t.isDocker||O.some((e=>window.location.hostname.endsWith(e)))}function G({children:e}){const o=new URLSearchParams(location.hash.substring(1)),n=o.get("token"),r=o.get("state"),[i,l]=s(new C),{generateState:u,verifyState:d,clearState:g}={generateState:h((()=>{const e=crypto.randomUUID(),t=Date.now()+3e5;return sessionStorage.setItem(R,e),sessionStorage.setItem(D,t.toString()),e}),[]),verifyState:h((e=>{if(!e)return"Missing state";const t=sessionStorage.getItem(R),o=parseInt(sessionStorage.getItem(D)||"0");let n;return n=t!==e?`State mismatched (${t} !== ${e})`:Date.now()>o?"State expired":void 0,n}),[]),clearState:h((()=>{sessionStorage.removeItem(R),sessionStorage.removeItem(D)}),[])},w=(e,t)=>{const o=new URL("https://internal-auth.vertesia.app/"),n=new URL(window.location.href);n.hash="",o.searchParams.set("redirect_uri",n.toString()),o.searchParams.set("state",u()),location.replace(o.toString())};return c((()=>{console.log("Auth: starting auth flow"),t.logger.info("Starting auth flow");const e=new URL(window.location.href),o=e.searchParams.get("a")??localStorage.getItem(p)??void 0,s=e.searchParams.get("p")??localStorage.getItem(f+"-"+o)??void 0;if(console.log("Auth: selected account",o),console.log("Auth: selected project",s),t.logger.info("Selected account and project",{vertesia:{account_id:o,project_id:s}}),n&&r){const e=d(r);return e?(console.error(`Auth: invalid state: ${e}`),t.logger.error(`Invalid state: ${e}`,{vertesia:{state:r}}),w()):g(),void A(o,s,n,!1,x()).then((e=>{i.login(e.rawToken).then((()=>{l(i.clone()),window.location.hash=""}))})).catch((e=>{console.error("Failed to fetch user token from studio, redirecting to central auth",e),t.logger.error("Failed to fetch user token from studio, redirecting to central auth",{vertesia:{error:e}}),w()}))}return i.isLoggedIn()||(console.log("Auth: not logged in & no token/state"),t.logger.info("Not logged in & no token/state",{vertesia:{account_id:o,project_id:s}}),x()?(console.log("Auth: on dev domain, redirecting to central auth with selection",o,s),t.logger.info("Redirecting to central auth with selection",{vertesia:{account_id:o,project_id:s}}),w()):(console.log("Auth: not on dev domain"),t.logger.info("Not on dev domain",{vertesia:{account_id:o,project_id:s}}))),a(_(),(async e=>{e?(console.log("Auth: successful login with firebase"),t.logger.info("Successful login with firebase",{vertesia:{account_id:o,project_id:s}}),i.setSession=l,await A(o,s,void 0,!1,x()).then((e=>{i.login(e.rawToken).then((()=>l(i.clone())))})).catch((e=>{console.error("Failed to fetch user token from studio",e),t.logger.error("Failed to fetch user token from studio",{vertesia:{account_id:o,project_id:s,error:e}}),e instanceof P||i.logout(),i.isLoading=!1,i.authError=e,l(i.clone())}))):(console.log("Auth: using anonymous user"),t.logger.info("Using anonymous user",{vertesia:{account_id:o,project_id:s}}),i.client.withAuthCallback(void 0),i.logout(),l(i.clone()))}))}),[]),m(N.Provider,{value:i,children:e})}function z(){return{tagUserSession:async e=>{const t=window.localStorage.getItem("composableSignupData");e?t&&window.localStorage.removeItem("composableSignupData"):console.error("No user found -- skipping tagging")},trackEvent:(e,o)=>{t.isProd||console.debug("track event",e,o),n(T(),e,{...o,debug_mode:!t.isProd})}}}export{p as LastSelectedAccountId_KEY,f as LastSelectedProjectId_KEY,U as TypeRegistry,P as UserNotFoundError,C as UserSession,N as UserSessionContext,G as UserSessionProvider,F as fetchComposableToken,E as fetchComposableTokenFromFirebaseToken,A as getComposableToken,T as getFirebaseAnalytics,S as getFirebaseApp,_ as getFirebaseAuth,I as getFirebaseAuthToken,j as setFirebaseTenant,$ as useCurrentTenant,z as useUXTracking,L as useUserSession};
|
|
2
|
+
//# sourceMappingURL=vertesia-ui-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertesia-ui-session.js","sources":["esm/session/constants.js","esm/session/auth/firebase.js","esm/session/auth/composable.js","esm/session/auth/useCurrentTenant.js","esm/session/TypeRegistry.js","esm/session/UserSession.js","esm/session/auth/useAuthState.js","esm/session/UserSessionProvider.js","esm/session/useUXTracking.js"],"sourcesContent":["export const LastSelectedAccountId_KEY = 'composableai.lastSelectedAccountId';\nexport const LastSelectedProjectId_KEY = 'composableai.lastSelectedProjectId';\n//# sourceMappingURL=constants.js.map","import { Env } from \"@vertesia/ui/env\";\nimport { getAnalytics } from \"firebase/analytics\";\nimport { initializeApp } from \"firebase/app\";\nimport { getAuth } from \"firebase/auth\";\n// Use lazy initialization to avoid accessing Env before it's initialized\nlet _firebaseApp = null;\nlet _analytics = null;\nlet _firebaseAuth = null;\n// Getters that lazily initialize Firebase components when first accessed\nexport function getFirebaseApp() {\n if (!_firebaseApp) {\n try {\n if (!Env.firebase) {\n throw new Error(\"Firebase configuration is not available in the environment\");\n }\n _firebaseApp = initializeApp(Env.firebase);\n }\n catch (error) {\n console.error(\"Failed to initialize Firebase app:\", error);\n throw new Error(\"Firebase initialization failed - environment may not be properly initialized\");\n }\n }\n return _firebaseApp;\n}\nexport function getFirebaseAnalytics() {\n if (!_analytics) {\n _analytics = getAnalytics(getFirebaseApp());\n }\n return _analytics;\n}\nexport function getFirebaseAuth() {\n if (!_firebaseAuth) {\n _firebaseAuth = getAuth(getFirebaseApp());\n }\n return _firebaseAuth;\n}\nexport async function setFirebaseTenant(tenantEmail) {\n if (!tenantEmail) {\n console.log(\"No tenant name or email specified, skipping tenant setup\");\n return;\n }\n if (!Env.firebase) {\n console.log(\"Firebase configuration is not available in the environment\");\n return;\n }\n try {\n if (tenantEmail)\n console.log(`Resolving tenant ID from email: ${tenantEmail}`);\n // Add retry logic with exponential backoff\n let retries = 3;\n let retryDelay = 250; // Start with 250ms delay\n while (retries > 0) {\n try {\n // Call the API endpoint to resolve the tenant ID\n const response = await fetch(\"/api/resolve-tenant\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n tenantEmail: tenantEmail,\n }),\n // Add timeout to prevent hanging requests\n signal: AbortSignal.timeout(5000),\n });\n // Check for network errors\n if (!response) {\n throw new Error(\"No response received from tenant API\");\n }\n // Handle HTTP error responses\n if (!response.ok) {\n // Try to parse the error response\n try {\n const errorData = await response.json();\n console.error(\"Failed to resolve tenant ID:\", errorData.error);\n }\n catch (parseError) {\n console.error(`Failed to resolve tenant ID: HTTP ${response.status}`);\n }\n // If the error is 404 Not Found, no need to retry\n if (response.status === 404) {\n console.warn(`Tenant not found for ${tenantEmail}`);\n return;\n }\n throw new Error(`HTTP error ${response.status}`);\n }\n // Successfully got a response, parse it\n const data = (await response.json());\n if (data && data.firebaseTenantId) {\n const auth = getFirebaseAuth();\n auth.tenantId = data.firebaseTenantId;\n Env.firebase.providerType = data.provider ?? \"oidc\";\n console.log(`Tenant ID set to ${auth.tenantId}`);\n return data;\n }\n else {\n console.error(`Invalid response format, missing tenantId for ${tenantEmail}`);\n return; // No need to retry for invalid response format\n }\n }\n catch (fetchError) {\n // Only retry for network-related errors\n if (retries > 1) {\n console.warn(`Tenant resolution failed, retrying in ${retryDelay}ms...`, fetchError);\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n retryDelay *= 2; // Exponential backoff\n retries--;\n }\n else {\n throw fetchError; // Last retry failed, propagate error\n }\n }\n }\n }\n catch (error) {\n // Final error handler\n console.error(\"Error setting Firebase tenant:\", error instanceof Error ? error.message : \"Unknown error\");\n // Continue without tenant ID - authentication will work without multi-tenancy\n // but the user will access the default tenant\n }\n}\nexport async function getFirebaseAuthToken(refresh) {\n const auth = getFirebaseAuth();\n const user = auth.currentUser;\n if (user) {\n return user\n .getIdToken(refresh)\n .then((token) => {\n Env.logger.info(\"Got Firebase token\", {\n vertesia: {\n user_email: user.email,\n user_name: user.displayName,\n user_id: user.uid,\n refresh: refresh,\n },\n });\n return token;\n })\n .catch((err) => {\n Env.logger.error(\"Failed to get Firebase token\", {\n vertesia: {\n user_email: user.email,\n user_name: user.displayName,\n user_id: user.uid,\n refresh: refresh,\n error: err,\n },\n });\n console.error(\"Failed to get access token\", err);\n return null;\n });\n }\n else {\n Env.logger.warn(\"No user found\");\n return Promise.resolve(null);\n }\n}\n//# sourceMappingURL=firebase.js.map","import { jwtDecode } from \"jwt-decode\";\nimport { Env } from '@vertesia/ui/env';\nimport { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY } from '../constants';\nimport { getFirebaseAuth, getFirebaseAuthToken } from './firebase';\nlet AUTH_TOKEN_RAW;\nlet AUTH_TOKEN;\nexport async function fetchComposableToken(getIdToken, accountId, projectId, ttl) {\n console.log(`Getting/refreshing composable token for account ${accountId} and project ${projectId} `);\n Env.logger.info('Getting/refreshing composable token', {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n },\n });\n const idToken = await getIdToken(); //get from firebase\n if (!idToken) {\n console.log('No id token found - using cookie auth');\n throw new Error('No id token found');\n }\n console.log('Fetching composable token from ' + Env.endpoints.studio);\n Env.logger.info('Fetching composable token from' + Env.endpoints.studio, {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n },\n });\n const url = new URL(Env.endpoints.studio + '/auth/token');\n if (accountId)\n url.searchParams.set('accountId', accountId);\n if (projectId)\n url.searchParams.set('projectId', projectId);\n if (ttl)\n url.searchParams.set('ttl', String(ttl));\n console.log(`Getting composable token for account ${accountId} and project ${projectId}`);\n Env.logger.info('Getting composable token', {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n },\n });\n const res = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`\n }\n }).catch(err => {\n localStorage.removeItem(LastSelectedAccountId_KEY);\n localStorage.removeItem(LastSelectedProjectId_KEY);\n console.error('Failed to get composable token', err);\n Env.logger.error('Failed to get composable token', {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n error: err,\n },\n });\n throw new Error('Failed to get composable token');\n });\n if (idToken && res?.status === 412) {\n console.log(\"412: auth succeeded but user doesn't exist - signup required\", res?.status);\n Env.logger.error(\"412: auth succeeded but user doesn't exist - signup required\", {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n status: res?.status\n },\n });\n const idTokenDecoded = jwtDecode(idToken);\n if (!idTokenDecoded?.email) {\n Env.logger.error('No email found in id token');\n throw new Error('No email found in id token');\n }\n Env.logger.error('User not found', {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n email: idTokenDecoded.email\n }\n });\n throw new UserNotFoundError('User not found', idTokenDecoded.email);\n }\n if (!res || !res.ok) {\n console.error('Failed to get composable token', res);\n Env.logger.error('Failed to get composable token', {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n status: res?.status,\n },\n });\n throw new Error('Failed to get composable token');\n }\n const { token } = await res.json().catch(err => {\n Env.logger.error('Failed to parse composable token', {\n vertesia: {\n account_id: accountId,\n project_id: projectId,\n error: err,\n },\n });\n console.error('Failed to parse composable token', err);\n });\n return token;\n}\n/**\n *\n * @param accountId\n * @param projectId\n * @param ttl time to live for the token in seconds\n * @returns\n */\nexport async function fetchComposableTokenFromFirebaseToken(accountId, projectId, ttl) {\n return fetchComposableToken(getFirebaseAuthToken, accountId, projectId, ttl);\n}\nexport async function getComposableToken(accountId, projectId, initToken, forceRefresh = false, useInternalAuth = false) {\n const selectedAccount = accountId ?? localStorage.getItem(LastSelectedAccountId_KEY) ?? undefined;\n const selectedProject = projectId ?? localStorage.getItem(LastSelectedProjectId_KEY + '-' + selectedAccount) ?? undefined;\n //token is still valid for more than 5 minutes\n if (!forceRefresh && AUTH_TOKEN_RAW && AUTH_TOKEN && AUTH_TOKEN.exp > (Date.now() / 1000 + 300)) {\n return { rawToken: AUTH_TOKEN_RAW, token: AUTH_TOKEN, error: false };\n }\n //token is close to expire, refresh it\n if (!useInternalAuth && getFirebaseAuth().currentUser) {\n //we have a firebase user, get the token from there\n AUTH_TOKEN_RAW = await fetchComposableTokenFromFirebaseToken(selectedAccount, selectedProject);\n }\n else if (initToken || AUTH_TOKEN_RAW) {\n // we have a token already and no firebase user, refresh it\n AUTH_TOKEN_RAW = await fetchComposableToken(() => Promise.resolve(initToken ?? AUTH_TOKEN_RAW), selectedAccount, selectedProject);\n }\n if (!AUTH_TOKEN_RAW) {\n Env.logger.error('Cannot acquire a composable token', {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n throw new Error('Cannot acquire a composable token');\n }\n AUTH_TOKEN = jwtDecode(AUTH_TOKEN_RAW);\n if (!AUTH_TOKEN || !AUTH_TOKEN.exp || !AUTH_TOKEN_RAW) {\n console.error('Invalid composable token', AUTH_TOKEN);\n Env.logger.error('Invalid composable token', {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n throw new Error('Invalid composable token');\n }\n return { rawToken: AUTH_TOKEN_RAW, token: AUTH_TOKEN, error: false };\n}\nexport class UserNotFoundError extends Error {\n email;\n constructor(message, email) {\n super(message);\n this.name = 'UserNotFoundError';\n this.email = email;\n }\n}\n//# sourceMappingURL=composable.js.map","import { useState, useEffect } from 'react';\nimport { useUserSession } from \"@vertesia/ui/session\";\nexport function useCurrentTenant() {\n const { user } = useUserSession();\n const [currentTenant, setCurrentTenant] = useState(null);\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState(null);\n useEffect(() => {\n const loadCurrentTenant = async () => {\n if (!user?.email) {\n setCurrentTenant(null);\n setIsLoading(false);\n return;\n }\n try {\n const response = await fetch('/api/resolve-tenant', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n tenantEmail: user.email\n })\n });\n if (response.ok) {\n const tenantData = await response.json();\n if (tenantData) {\n // Convert the resolved tenant data to our TenantConfig format\n setCurrentTenant({\n tenantKey: tenantData.name || 'unknown',\n name: tenantData.label || tenantData.name || 'Unknown',\n domain: tenantData.domain || [],\n firebaseTenantId: tenantData.firebaseTenantId,\n provider: tenantData.provider,\n logo: tenantData.logo\n });\n }\n else {\n setCurrentTenant(null);\n }\n }\n else {\n setCurrentTenant(null);\n }\n }\n catch (error) {\n console.error('Error loading current tenant:', error);\n setError('Failed to load tenant configuration');\n setCurrentTenant(null);\n }\n finally {\n setIsLoading(false);\n }\n };\n loadCurrentTenant();\n }, [user?.email]);\n return {\n currentTenant,\n isLoading,\n error\n };\n}\n//# sourceMappingURL=useCurrentTenant.js.map","export class TypeRegistry {\n types;\n map = {};\n constructor(types) {\n this.types = types;\n //sort types\n types.sort((a, b) => a.name.localeCompare(b.name));\n for (const type of types) {\n this.map[type.id] = type;\n }\n }\n getType(id) {\n return this.map[id];\n }\n getTypeLayout(id) {\n const type = this.map[id];\n return type ? type.table_layout : undefined;\n }\n getTypeName(id) {\n const type = this.map[id];\n return type ? type.name : undefined;\n }\n}\n//# sourceMappingURL=TypeRegistry.js.map","import { jwtDecode } from 'jwt-decode';\nimport { createContext, useContext } from 'react';\nimport { VertesiaClient } from '@vertesia/client';\nimport { Env } from '@vertesia/ui/env';\nimport { getComposableToken } from './auth/composable';\nimport { getFirebaseAuth } from './auth/firebase';\nimport { TypeRegistry } from './TypeRegistry';\nimport { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY } from './constants';\nexport { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY };\nclass UserSession {\n isLoading = true;\n client;\n authError;\n authToken;\n typeRegistry;\n setSession;\n lastSelectedAccount;\n lastSelectedProject;\n onboardingComplete;\n constructor(client, setSession) {\n if (client) {\n this.client = client;\n }\n else {\n this.client = new VertesiaClient({\n serverUrl: Env.endpoints.studio,\n storeUrl: Env.endpoints.zeno,\n });\n }\n if (setSession) {\n this.setSession = setSession;\n }\n this.logout = this.logout.bind(this);\n }\n get store() {\n return this.client.store;\n }\n get user() {\n return this.authToken;\n }\n get account() {\n return this.authToken?.account;\n }\n get project() {\n return this.authToken?.project;\n }\n get accounts() {\n return this.authToken?.accounts;\n }\n get authCallback() {\n return this.rawAuthToken.then(token => `Bearer ${token}`);\n }\n get rawAuthToken() {\n return getComposableToken().then(res => {\n const token = res?.rawToken;\n if (!token) {\n throw new Error('No token available');\n }\n this.authToken = jwtDecode(token);\n return token;\n });\n }\n signOut() {\n this.logout();\n }\n getAccount() {\n return this.authToken?.account;\n }\n async login(token) {\n this.authError = undefined;\n this.isLoading = false;\n this.client.withAuthCallback(() => this.authCallback);\n this.authToken = jwtDecode(token);\n console.log(`Logging in as ${this.authToken?.name} with account ${this.authToken?.account.name} (${this.authToken?.account.id}, and project ${this.authToken?.project?.name} (${this.authToken?.project?.id})`);\n //store selected account in local storage\n localStorage.setItem(LastSelectedAccountId_KEY, this.authToken.account.id);\n localStorage.setItem(LastSelectedProjectId_KEY + '-' + this.authToken.account.id, this.authToken.project?.id ?? '');\n // notify the host app of the login\n Env.onLogin?.(this.authToken);\n // Independent async calls\n await Promise.all([\n this._loadTypes(),\n this.fetchOnboardingStatus(),\n ]);\n return Promise.resolve();\n }\n isLoggedIn() {\n return !!this.authToken;\n }\n logout() {\n console.log('Logging out');\n if (this.authToken) {\n getFirebaseAuth().signOut();\n }\n this.authError = undefined;\n this.isLoading = false;\n this.authToken = undefined;\n this.typeRegistry = undefined;\n this.setSession = undefined;\n this.client.withAuthCallback(undefined);\n }\n async switchAccount(targetAccountId) {\n localStorage.setItem(LastSelectedAccountId_KEY, targetAccountId);\n if (this) {\n if (this.account && this.project) {\n localStorage.setItem(LastSelectedProjectId_KEY + '-' + this.account.id, this.project.id);\n }\n else if (this.account) {\n localStorage.removeItem(LastSelectedProjectId_KEY + '-' + this.account.id);\n }\n }\n window.location.replace('/?a=' + targetAccountId);\n }\n async switchProject(targetProjectId) {\n if (this.account) {\n localStorage.setItem(LastSelectedProjectId_KEY + '-' + this.account.id, targetProjectId);\n }\n window.location.replace('/?a=' + this.account?.id + '&p=' + targetProjectId);\n }\n async _loadTypes() {\n if (this.project) {\n return this.store.types.list({}, { layout: true }).then(types => this.typeRegistry = new TypeRegistry(types)).catch(err => {\n console.error('Failed to fetch object types', err);\n throw err;\n });\n }\n else {\n console.log('No project selected');\n }\n }\n async reloadTypes() {\n return this._loadTypes().then(() => {\n this.setSession?.(this.clone());\n });\n }\n async fetchAccounts() {\n return this.client.accounts.list().then(accounts => {\n if (!this.authToken) {\n throw new Error('No token available');\n }\n this.authToken.accounts = accounts;\n this.setSession?.(this.clone());\n }).catch(err => {\n console.error('Failed to fetch accounts', err);\n throw err;\n });\n }\n async fetchOnboardingStatus() {\n if (this.onboardingComplete) {\n console.log('Onboarding already completed');\n return false;\n }\n const previousStatus = this.onboardingComplete;\n try {\n const onboarding = await this.client.account.onboardingProgress();\n this.onboardingComplete = Object.values(onboarding).every(value => value === true);\n if (previousStatus !== this.onboardingComplete) {\n return true;\n }\n this.setSession?.(this.clone());\n }\n catch (error) {\n console.error('Error fetching onboarding status:', error);\n this.onboardingComplete = false;\n this.setSession?.(this.clone());\n }\n return false;\n }\n clone() {\n const session = new UserSession(this.client);\n session.isLoading = this.isLoading;\n session.authError = this.authError;\n session.authToken = this.authToken;\n session.setSession = this.setSession;\n session.lastSelectedAccount = this.lastSelectedAccount;\n session.switchAccount = this.switchAccount;\n session.typeRegistry = this.typeRegistry;\n session.onboardingComplete = this.onboardingComplete;\n return session;\n }\n}\nconst UserSessionContext = createContext(undefined);\nexport function useUserSession() {\n const session = useContext(UserSessionContext);\n if (!session) {\n throw new Error('useUserSession must be used within a UserSessionProvider');\n }\n return session;\n}\nexport { UserSession, UserSessionContext };\n//# sourceMappingURL=UserSession.js.map","/**\n * This hook is used to generate and verify state for OAuth2 authorization requests.\n * @returns\n */\nimport { useCallback } from \"react\";\nconst AUTH_STATE_KEY = 'auth_state';\nconst STATE_EXPIRY_KEY = 'auth_state_expiry';\nconst STATE_TTL = 5 * 60 * 1000; // 5 min\nexport function useAuthState() {\n // Generate new state\n const generateState = useCallback(() => {\n const state = crypto.randomUUID();\n const expiryTime = Date.now() + STATE_TTL;\n // Store state and expiry\n sessionStorage.setItem(AUTH_STATE_KEY, state);\n sessionStorage.setItem(STATE_EXPIRY_KEY, expiryTime.toString());\n return state;\n }, []);\n // Verify returned state\n const verifyState = useCallback((returnedState) => {\n if (!returnedState) {\n return 'Missing state';\n }\n const savedState = sessionStorage.getItem(AUTH_STATE_KEY);\n const expiryTime = parseInt(sessionStorage.getItem(STATE_EXPIRY_KEY) || '0');\n let reason;\n // Verify state matches and hasn't expired\n if (savedState !== returnedState) {\n reason = `State mismatched (${savedState} !== ${returnedState})`;\n }\n else if (Date.now() > expiryTime) {\n reason = 'State expired';\n }\n else {\n reason = undefined; // No errors\n }\n return reason;\n }, []);\n // Clear state (useful for cleanup)\n const clearState = useCallback(() => {\n sessionStorage.removeItem(AUTH_STATE_KEY);\n sessionStorage.removeItem(STATE_EXPIRY_KEY);\n }, []);\n return { generateState, verifyState, clearState };\n}\n//# sourceMappingURL=useAuthState.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { onAuthStateChanged } from \"firebase/auth\";\nimport { useEffect, useState } from \"react\";\nimport { UserNotFoundError, getComposableToken } from \"./auth/composable\";\nimport { getFirebaseAuth } from \"./auth/firebase\";\nimport { useAuthState } from \"./auth/useAuthState\";\nimport { Env } from \"@vertesia/ui/env\";\nimport { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY, UserSession, UserSessionContext } from \"./UserSession\";\nconst devDomains = [\".composable.sh\", \".vertesia.dev\", \"vertesia.app\"];\nconst CENTRAL_AUTH_REDIRECT = \"https://internal-auth.vertesia.app/\";\nfunction shouldRedirectToCentralAuth() {\n // Authentication is not supported in Docker environment.\n // See https://github.com/vertesia/studio/wiki/Composable-UI-Hosting-Options\n if (Env.isDocker) {\n return true;\n }\n return devDomains.some((domain) => window.location.hostname.endsWith(domain));\n}\nexport function UserSessionProvider({ children }) {\n const hashParams = new URLSearchParams(location.hash.substring(1));\n const token = hashParams.get(\"token\");\n const state = hashParams.get(\"state\");\n const [session, setSession] = useState(new UserSession());\n const { generateState, verifyState, clearState } = useAuthState();\n const redirectToCentralAuth = (projectId, accountId) => {\n const url = new URL(CENTRAL_AUTH_REDIRECT);\n const currentUrl = new URL(window.location.href);\n currentUrl.hash = \"\";\n if (projectId)\n currentUrl.searchParams.set(\"p\", projectId);\n if (accountId)\n currentUrl.searchParams.set(\"a\", accountId);\n url.searchParams.set(\"redirect_uri\", currentUrl.toString());\n url.searchParams.set(\"state\", generateState());\n location.replace(url.toString());\n };\n useEffect(() => {\n console.log(\"Auth: starting auth flow\");\n Env.logger.info(\"Starting auth flow\");\n const currentUrl = new URL(window.location.href);\n const selectedAccount = currentUrl.searchParams.get(\"a\") ?? localStorage.getItem(LastSelectedAccountId_KEY) ?? undefined;\n const selectedProject = currentUrl.searchParams.get(\"p\") ??\n localStorage.getItem(LastSelectedProjectId_KEY + \"-\" + selectedAccount) ??\n undefined;\n console.log(\"Auth: selected account\", selectedAccount);\n console.log(\"Auth: selected project\", selectedProject);\n Env.logger.info(\"Selected account and project\", {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n if (token && state) {\n const validationError = verifyState(state);\n if (validationError) {\n console.error(`Auth: invalid state: ${validationError}`);\n Env.logger.error(`Invalid state: ${validationError}`, {\n vertesia: {\n state: state,\n },\n });\n redirectToCentralAuth();\n }\n else {\n clearState();\n }\n getComposableToken(selectedAccount, selectedProject, token, false, shouldRedirectToCentralAuth())\n .then((res) => {\n session.login(res.rawToken).then(() => {\n setSession(session.clone());\n //cleanup the hash\n window.location.hash = \"\";\n });\n })\n .catch((err) => {\n console.error(\"Failed to fetch user token from studio, redirecting to central auth\", err);\n Env.logger.error(\"Failed to fetch user token from studio, redirecting to central auth\", {\n vertesia: {\n error: err,\n },\n });\n redirectToCentralAuth();\n });\n return;\n }\n else {\n //if on a dev domain and not logged in, redirect to central auth\n if (!session.isLoggedIn()) {\n console.log(\"Auth: not logged in & no token/state\");\n Env.logger.info(\"Not logged in & no token/state\", {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n if (shouldRedirectToCentralAuth()) {\n console.log(\"Auth: on dev domain, redirecting to central auth with selection\", selectedAccount, selectedProject);\n Env.logger.info(\"Redirecting to central auth with selection\", {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n redirectToCentralAuth();\n }\n else {\n console.log(\"Auth: not on dev domain\");\n Env.logger.info(\"Not on dev domain\", {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n }\n }\n }\n return onAuthStateChanged(getFirebaseAuth(), async (firebaseUser) => {\n if (firebaseUser) {\n console.log(\"Auth: successful login with firebase\");\n Env.logger.info(\"Successful login with firebase\", {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n session.setSession = setSession;\n await getComposableToken(selectedAccount, selectedProject, undefined, false, shouldRedirectToCentralAuth())\n .then((res) => {\n session.login(res.rawToken).then(() => setSession(session.clone()));\n })\n .catch((err) => {\n console.error(\"Failed to fetch user token from studio\", err);\n Env.logger.error(\"Failed to fetch user token from studio\", {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n error: err,\n },\n });\n if (!(err instanceof UserNotFoundError))\n session.logout();\n session.isLoading = false;\n session.authError = err;\n setSession(session.clone());\n });\n }\n else {\n // anonymous user\n console.log(\"Auth: using anonymous user\");\n Env.logger.info(\"Using anonymous user\", {\n vertesia: {\n account_id: selectedAccount,\n project_id: selectedProject,\n },\n });\n session.client.withAuthCallback(undefined);\n session.logout();\n setSession(session.clone());\n }\n });\n }, []);\n return _jsx(UserSessionContext.Provider, { value: session, children: children });\n}\n//# sourceMappingURL=UserSessionProvider.js.map","import { Env } from '@vertesia/ui/env';\nimport { logEvent } from \"firebase/analytics\";\nimport { getFirebaseAnalytics } from \"./auth/firebase\";\nexport function useUXTracking() {\n //identify user in monitoring and UX systems\n const tagUserSession = async (user) => {\n const signupData = window.localStorage.getItem(\"composableSignupData\");\n if (!user) {\n console.error('No user found -- skipping tagging');\n return;\n }\n if (signupData) {\n window.localStorage.removeItem(\"composableSignupData\");\n }\n };\n //send event to analytics and UX systems\n const trackEvent = (eventName, eventProperties) => {\n if (!Env.isProd) {\n console.debug('track event', eventName, eventProperties);\n }\n //GA via firebase\n logEvent(getFirebaseAnalytics(), eventName, { ...eventProperties, debug_mode: !Env.isProd });\n };\n return {\n tagUserSession,\n trackEvent\n };\n}\n//# sourceMappingURL=useUXTracking.js.map"],"names":["LastSelectedAccountId_KEY","LastSelectedProjectId_KEY","AUTH_TOKEN_RAW","AUTH_TOKEN","_firebaseApp","_analytics","_firebaseAuth","getFirebaseApp","Env","firebase","Error","initializeApp","error","console","getFirebaseAnalytics","getAnalytics","getFirebaseAuth","getAuth","async","setFirebaseTenant","tenantEmail","log","retries","retryDelay","response","fetch","method","headers","body","JSON","stringify","signal","AbortSignal","timeout","ok","errorData","json","parseError","status","warn","data","firebaseTenantId","auth","tenantId","providerType","provider","fetchError","Promise","resolve","setTimeout","message","getFirebaseAuthToken","refresh","user","currentUser","getIdToken","then","token","logger","info","vertesia","user_email","email","user_name","displayName","user_id","uid","catch","err","fetchComposableToken","accountId","projectId","ttl","account_id","project_id","idToken","endpoints","studio","url","URL","searchParams","set","String","res","Authorization","localStorage","removeItem","idTokenDecoded","jwtDecode","UserNotFoundError","fetchComposableTokenFromFirebaseToken","getComposableToken","initToken","forceRefresh","useInternalAuth","selectedAccount","getItem","undefined","selectedProject","exp","Date","now","rawToken","constructor","super","this","name","useCurrentTenant","useUserSession","currentTenant","setCurrentTenant","useState","isLoading","setIsLoading","setError","useEffect","tenantData","tenantKey","label","domain","logo","loadCurrentTenant","TypeRegistry","types","map","sort","a","b","localeCompare","type","id","getType","getTypeLayout","table_layout","getTypeName","UserSession","client","authError","authToken","typeRegistry","setSession","lastSelectedAccount","lastSelectedProject","onboardingComplete","VertesiaClient","serverUrl","storeUrl","zeno","logout","bind","store","account","project","accounts","authCallback","rawAuthToken","signOut","getAccount","login","withAuthCallback","setItem","onLogin","all","_loadTypes","fetchOnboardingStatus","isLoggedIn","switchAccount","targetAccountId","window","location","replace","switchProject","targetProjectId","list","layout","reloadTypes","clone","fetchAccounts","previousStatus","onboarding","onboardingProgress","Object","values","every","value","session","UserSessionContext","createContext","useContext","AUTH_STATE_KEY","STATE_EXPIRY_KEY","devDomains","shouldRedirectToCentralAuth","isDocker","some","hostname","endsWith","UserSessionProvider","children","hashParams","URLSearchParams","hash","substring","get","state","generateState","verifyState","clearState","useCallback","crypto","randomUUID","expiryTime","sessionStorage","toString","returnedState","savedState","parseInt","reason","redirectToCentralAuth","currentUrl","href","validationError","onAuthStateChanged","firebaseUser","_jsx","Provider","useUXTracking","tagUserSession","signupData","trackEvent","eventName","eventProperties","isProd","debug","logEvent","debug_mode"],"mappings":"+eAAY,MAACA,EAA4B,qCAC5BC,EAA4B,qCCIzC,ICDIC,EACAC,EDAAC,EAAe,KACfC,EAAa,KACbC,EAAgB,KAEb,SAASC,IACZ,IAAKH,EACD,IACI,IAAKI,EAAIC,SACL,MAAM,IAAIC,MAAM,8DAEpBN,EAAeO,EAAcH,EAAIC,SAC7C,CACQ,MAAOG,GAEH,MADAC,QAAQD,MAAM,qCAAsCA,GAC9C,IAAIF,MAAM,+EAC5B,CAEI,OAAON,CACX,CACO,SAASU,IAIZ,OAHKT,IACDA,EAAaU,EAAaR,MAEvBF,CACX,CACO,SAASW,IAIZ,OAHKV,IACDA,EAAgBW,EAAQV,MAErBD,CACX,CACOY,eAAeC,EAAkBC,GACpC,GAAKA,EAIL,GAAKZ,EAAIC,SAIT,IACQW,GACAP,QAAQQ,IAAI,mCAAmCD,KAEnD,IAAIE,EAAU,EACVC,EAAa,IACjB,KAAOD,EAAU,GACb,IAEI,MAAME,QAAiBC,MAAM,sBAAuB,CAChDC,OAAQ,OACRC,QAAS,CACL,eAAgB,oBAEpBC,KAAMC,KAAKC,UAAU,CACjBV,YAAaA,IAGjBW,OAAQC,YAAYC,QAAQ,OAGhC,IAAKT,EACD,MAAM,IAAId,MAAM,wCAGpB,IAAKc,EAASU,GAAI,CAEd,IACI,MAAMC,QAAkBX,EAASY,OACjCvB,QAAQD,MAAM,+BAAgCuB,EAAUvB,M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BwE,EAAW6C,EAAQT,cAKvBnK,QAAQQ,IAAI,8BACZb,EAAIkD,OAAOC,KAAK,uBAAwB,CACpCC,SAAU,CACNa,WAAYsB,EACZrB,WAAYwB,KAGpBuF,EAAQjD,OAAOuB,sBAAiB9D,GAChCwF,EAAQrC,SACRR,EAAW6C,EAAQT,eAG5B,IACIgD,EAAKtC,EAAmBuC,SAAU,CAAEzC,MAAOC,EAASa,SAAUA,GACzE,CC/JO,SAAS4B,IAoBZ,MAAO,CACHC,eAnBmBjN,MAAOmC,IAC1B,MAAM+K,EAAa5D,OAAOnF,aAAaW,QAAQ,wBAC1C3C,EAID+K,GACA5D,OAAOnF,aAAaC,WAAW,wBAJ/BzE,QAAQD,MAAM,sCAiBlByN,WATe,CAACC,EAAWC,KACtB/N,EAAIgO,QACL3N,QAAQ4N,MAAM,cAAeH,EAAWC,GAG5CG,EAAS5N,IAAwBwN,EAAW,IAAKC,EAAiBI,YAAanO,EAAIgO,UAM3F"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{Button as i,VModal as a,VModalTitle as o,VModalBody as r,useToast as l,Input as c,Spinner as s,SelectStack as d,VSelectBox as m,useSafeLayoutEffect as u,ErrorBox as h,Center as p,useFetch as f,SelectBox as g,Modal as v,ModalTitle as x,ModalBody as y,ModalFooter as b,VTabs as N,VTabsBar as w,VTabsPanel as k,VTooltip as C,Avatar as j,ModeToggle as S,MenuList as P,ToastProvider as z,ThemeProvider as L}from"@vertesia/ui/core";import{useState as I,useEffect as T,Fragment as A,createContext as _,useContext as U}from"react";import{useUserSession as E,useUXTracking as O,setFirebaseTenant as D,getFirebaseAuth as W,UserNotFoundError as q,fetchComposableTokenFromFirebaseToken as M,UserSessionProvider as R,LastSelectedAccountId_KEY as F,LastSelectedProjectId_KEY as Y}from"@vertesia/ui/session";import{Env as G}from"@vertesia/ui/env";import V from"clsx";import{signInWithRedirect as B,OAuthProvider as J,GoogleAuthProvider as H,GithubAuthProvider as $,getAuth as K}from"firebase/auth";import{useLocation as Q}from"@vertesia/ui/router";import{Popover as X}from"@vertesia/ui/widgets";import{getTenantIdFromProject as Z}from"@vertesia/common";import{Check as ee,CopyIcon as te,LockIcon as ne}from"lucide-react";import{UserPermissionProvider as ie}from"@vertesia/ui/features";import{Transition as ae}from"@headlessui/react";function oe(){const n=E(),{client:l,account:c}=n,[s,d]=I(!1),[m,u]=I([]);T((()=>{l.account.listInvites().then((e=>{if(e.length>0){const t=e.filter((e=>e.data.account));if(0===t.length)return void console.log("No valid invites found, closing modal");console.log("Found valid invites",t.length),d(!0),u(t)}else console.log("No invites found, closing modal"),d(!1)})).catch((e=>{console.error("Error fetching invites",e)}))}),[c?.id]);const h=()=>d(!1),p=m.map((a=>a.data.account?e("div",{className:"flex flex-row w-full justify-between border rounded-sm px-2 py-2 ",children:[e("div",{className:"flex flex-col",children:[t("div",{className:"w-full font-semibold",children:a.data.account.name??a.data.account}),a.data.project&&e("div",{className:"w-full text-base",children:["- ",a.data.project.name]}),e("div",{className:"text-xs",children:["Role: ",a.data.role]}),a.data.invited_by&&e("div",{className:"text-xs",children:["by ",a.data.invited_by.name??a.data.invited_by]})]}),e("div",{className:"flex flex-col gap-4",children:[t(i,{size:"xs",onClick:()=>(async e=>{await l.account.acceptInvite(e.id),await n.fetchAccounts();const t=m.filter((t=>t.id!==e.id)).filter((e=>e.data.account));t.length>0?u(t):h()})(a),children:"Accept"})," ",t(i,{size:"xs",variant:"secondary",onClick:()=>(async e=>{await l.account.rejectInvite(e.id);const t=m.filter((t=>t.id!==e.id));u(t),0===t.length&&h()})(a),children:"Reject"})]})]},a.id):(console.warn("Invite has no account data",a),null)));return t("div",{children:e(a,{isOpen:s,onClose:h,children:[t(o,{children:"Review Invites"}),e(r,{children:[t("div",{className:"text-sm pb-4",children:"You have received the following invites to join other accounts. Please review and accept or declined them."}),p]})]})})}function re({redirectTo:a}){const[o,r]=I(!1),{trackEvent:d}=O(),[m,u]=I(""),h=l();return e(n,{children:[t(c,{value:m,onChange:u,placeholder:"Enter your enterprise email",type:"email"}),o?t("div",{className:"w-full flex justify-center",children:t(s,{})}):t(i,{variant:"outline",onClick:async()=>{if(!m)return;/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(m)?(r(!0),D(m).then((e=>{if(!e)return h({title:"Tenant not found",status:"error",duration:5e3}),void r(!1);localStorage.setItem("tenantName",e.name??"");const t=function(e){if(!G.firebase)throw new Error("Firebase configuration is not available in the environment");switch(G.firebase.providerType){case"oidc":default:return new J("oidc.main");case"google":{let t=e||window.location.pathname||"/";"/"!==t[0]&&(t="/"+t);const n=new H;return n.addScope("profile"),n.addScope("email"),n.setCustomParameters({prompt:"select_account",redirect_uri:window.location.origin+t}),n}case"microsoft":return new J("microsoft.com");case"github":return new J("github.com")}}(a);d("enterprise_signin",{firebaseTenantName:e.name}),G.logger.info("Enterprise single sign-in",{vertesia:{email:m,firebaseTenantName:e.name,firebaseTenantId:e.firebaseTenantId}}),B(W(),t),r(!1)}))):h({title:"Invalid email address",status:"error",duration:5e3})},className:"w-full mt-2 py-4 flex rounded-lg hover:shadow-sm transition duration-150 text-center",children:t("span",{className:"text-sm font-semibold",children:"Continue with Enterprise SSO"})})]})}function le({}){return e(i,{variant:"outline",onClick:()=>{localStorage.removeItem("tenantName");let e="https://dengenlabs.firebaseapp.com/__/auth/handler"+window.location.pathname;"/"!==e[0]&&(e="/"+e);const t=new $;t.addScope("profile"),t.addScope("email"),B(W(),t)},className:"w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center mb-2",children:[t("img",{className:"size-6 bg-white rounded-full",src:"https://www.svgrepo.com/show/503359/github.svg",loading:"lazy",alt:"github logo"}),t("span",{className:"text-sm font-semibold",children:"Continue with GitHub"})]})}function ce({redirectTo:n}){return e(i,{variant:"outline",onClick:()=>{localStorage.removeItem("tenantName");let e=n||window.location.pathname||"/";"/"!==e[0]&&(e="/"+e);const t=new H;t.addScope("profile"),t.addScope("email"),t.setCustomParameters({prompt:"select_account",redirect_uri:window.location.origin+e}),B(W(),t)},className:"w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center mb-2",children:[t("img",{className:"size-6",src:"https://www.svgrepo.com/show/475656/google-color.svg",loading:"lazy",alt:"google logo"}),t("span",{className:"text-sm font-semibold",children:"Continue with Google"})]})}function se({redirectTo:n}){return e(i,{variant:"outline",onClick:()=>{localStorage.removeItem("tenantName");let e=n||window.location.pathname||"/";"/"!==e[0]&&(e="/"+e);const t=new J("microsoft.com");t.addScope("profile"),t.addScope("email"),B(W(),t)},className:"w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center",children:[t("img",{className:"size-6",src:"https://learn.microsoft.com/en-us/entra/identity-platform/media/howto-add-branding-in-apps/ms-symbollockup_mssymbol_19.svg",loading:"lazy",alt:"microsoft logo"}),t("span",{className:"text-sm font-semibold",children:"Continue with Microsoft"})]})}const de=[{id:1,label:"1-10 employees"},{id:11,label:"11-100 employees"},{id:101,label:"101-1000 employees"},{id:1001,label:"1001-5000 employees"},{id:5001,label:"5000+ employees"}],me=[{id:"personal",label:"Personal",description:"For personal use, or for a small team."},{id:"company",label:"Company",description:"For a company or organization."}],ue=[{id:"testing",label:"Just Testing or Evaluating LLMs"},{id:"exploring",label:"Actively Exploring LLMs on a Project"},{id:"using",label:"Already Using LLMs in Production"},{id:"migrating",label:"Migrating to different LLMs"},{id:"other",label:"Other"}];function he({onSignup:a,goBack:o}){const[r,l]=I(void 0),[s,u]=I(void 0),[h,p]=I(void 0),[f,g]=I(void 0),[v,x]=I(void 0),[y,b]=I(void 0),[N,w]=I(void 0),k="company"===r;T((()=>{const e=K().currentUser;e?b(e):console.error("No user found")}),[y]);return e("div",{className:"flex flex-col space-y-2",children:[e("div",{className:"prose",children:[e("p",{className:"prose text-sm text-muted pt-4",children:["Welcome to Vertesia, ",y?.displayName," (",y?.email,"). Please tell us a little bit about yourself and you'll be on your way. No credit card is required."]}),N&&t("div",{className:"text-destructive",children:N})]}),t(pe,{label:"Account Type",children:t(d,{options:me,selected:me.find((e=>e.id===r)),onSelect:e=>l(e.id)})}),k&&e(n,{children:[t(pe,{label:"Company Size",children:t(m,{className:"w-full border border-accent bg-muted",value:s,options:de,onChange:u,optionLabel:e=>e?.label,placeholder:"Select Company Size"})}),t(pe,{label:"Company Name",children:t(c,{value:h,onChange:p,type:"text",required:!0})}),t(pe,{label:"Company Website",children:t(c,{value:f,onChange:g,type:"text"})})]}),t(pe,{label:"Project Maturity",children:t(m,{className:"w-full border border-accent bg-muted",options:ue,value:ue.find((e=>e.id===v)),optionLabel:e=>e?.label,placeholder:"Select Project Maturity",onChange:e=>x(e?.id)})}),e("div",{className:"pt-8 flex flex-col",children:[t(i,{variant:"primary",onClick:async()=>{if(!(r?k&&!h?(w("Please enter an organization name"),0):!k||s||(w("Please select a company size"),0):(w("Please select an account type"),0)))return;if(!r)return;const e={accountType:r,companyName:h,companySize:s?.id,companyWebsite:f,maturity:v};window.localStorage.setItem("composableSignupData",JSON.stringify(e));const t=await(K().currentUser?.getIdToken());console.log("Got firebase token",K(),t),t?a(e,t):console.error("No firebase token found")},size:"xl",children:t("span",{className:"text-lg",children:"Sign Up"})}),t(i,{variant:"ghost",size:"xl",className:"mt-4",onClick:o,children:t("span",{className:"",children:"Wrong account, go back"})})]})]})}function pe({label:n,children:i}){return e("div",{className:"flex flex-col space-y-2 pt-4",children:[t("div",{className:"text-sm text-muted",children:n}),i]})}function fe({allowedPrefix:e,isNested:n=!1,lightLogo:i,darkLogo:a}){const[o,r]=I(!1);return u((()=>{e&&r(window.location.href.startsWith(e))}),[]),o?null:t(ge,{isNested:n,lightLogo:i,darkLogo:a})}function ge({isNested:n=!1,lightLogo:i,darkLogo:a}){const{isLoading:o,user:r,authError:l}=E();return o||r?null:t("div",{style:{zIndex:999998},className:(n?"absolute":"fixed")+"overflow-y-auto ",children:e("div",{className:V("flex flex-col items-center justify-center py-14 px-4"),children:[t(ve,{authError:l,lightLogo:i,darkLogo:a}),e("div",{className:"flex gap-x-6 mt-10 justify-center text-muted",children:[t("a",{href:"https://vertesiahq.com/privacy",className:"text-sm",children:"Privacy Policy"}),t("a",{href:"https://vertesiahq.com/terms",className:"text-sm",children:"Terms of Service"})]})]})})}function ve({authError:a,darkLogo:o,lightLogo:r}){const[l,c]=I(void 0),[s,d]=I(!1),{signOut:m}=E(),{trackEvent:u}=O();history.replaceState({},"","/");const h=()=>{c(void 0),d(!0)};T((()=>{a instanceof q&&(console.log("User not found, redirecting to signup"),h())}),[a]);return e(n,{children:[r&&t("img",{src:r,alt:"logo",className:"h-15 block dark:hidden"}),o&&t("img",{src:o,alt:"logo",className:"h-15 hidden dark:block"}),l&&e("div",{className:"my-6",children:["Need to make a change?"," ",t(i,{onClick:h,children:" Go back"})]}),t("div",{className:"flex flex-col space-y-2",children:s&&!localStorage.getItem("tenantName")?t(he,{onSignup:(e,t)=>{console.log("Got Signup data",e),c(e);const n={signupData:e,firebaseToken:t};fetch(G.endpoints.studio+"/auth/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>{console.log("Signup successful",n,e),u("sign_up"),window.location.href="/"}))},goBack:()=>{console.log("Going back, signing out"),c(void 0),d(!1),m()}}):e("div",{className:"flex flex-col",children:[t("div",{className:"my-4",children:t("h2",{className:"text-2xl font-bold text-center",children:"Log in or Sign up"})}),e("div",{className:"max-w-2xl text-center my-2 px-2",children:["First time here? No problem, it's free to try!",t("br",{}),"We'll just ask you a couple of questions next and you'll be on your way."]}),e("div",{className:"flex items-center flex-col",children:[e("div",{className:"py-4 w-70",children:[t(ce,{}),t(le,{}),t(se,{})]}),e("div",{className:"flex items-center flex-row w-70 text-muted",children:[t("hr",{className:"w-full"}),t("div",{className:"px-2 text-xs",children:"OR"}),t("hr",{className:"w-full"})]}),t("div",{className:"py-4 w-70",children:t(re,{})})]}),a&&t("div",{className:"text-center",children:e("div",{className:"",children:["Sorry, we have not been able to sign you in.",t("br",{}),"Please try again or contact",t("a",{className:"text-info mx-1",href:"mailto:support@vertesiahq.com",children:"support@vertesiahq.com"}),"if it persists.",e("pre",{className:"mt-2",children:["Error: ",a.message]})]})})]})})]})}function xe(){const[e,n]=I(),[i,a]=I(),o=function(e){const t=new URLSearchParams(e.search);let n=t.get("redirect_uri");const i=t.get("code");return n&&i?(n=decodeURI(n),n.startsWith("http://127.0.0.1:")||n.startsWith("http://localhost:")?{redirect:n,code:i,profile:t.get("profile")??"default",project:t.get("project")??void 0,account:t.get("account")??void 0}:null):null}(Q()),r=l(),c=async e=>{if(!o)return;if(!e.profile)return void r({title:"Profile is required",description:"Please enter a profile name to save the client authorization",status:"error",duration:2e3});if(!e.account)return void r({title:"Account is required",description:"Please select an account to authorize the client to access the ComposablePrompts servers",status:"error",duration:2e3});if(!e.project)return void r({title:"Project is required",description:"Please select a project to authorize the client to access the ComposablePrompts servers",status:"error",duration:2e3});let t;try{const i=await M(e.account,e.project,86400);i?(t={...e,studio_server_url:G.endpoints.studio,zeno_server_url:G.endpoints.zeno,token:i},await fetch(o.redirect,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n(t)):r({title:"Failed to get composable token",status:"error",duration:5e3})}catch(e){t?(a(e),n(t)):r({title:"Error authorizing client",description:e.message,status:"error",duration:5e3})}},s=o?e?t(be,{payload:e,error:i}):t(ye,{clientInfo:o,onAccept:c}):t(h,{title:"Invalid request",children:"This page should be called by a terminal client to authenticate against the ComposablePrompts servers"});return t("div",{className:"w-full flex flex-col items-center gap-4 mt-24",children:s})}function ye({onAccept:i,clientInfo:a}){const{client:o,user:r}=E(),{data:l,error:c}=f((()=>r?o.projects.list():Promise.resolve([])),[r]);if(c)return t(h,{title:"Error loading projects",children:c.message});const d=G.isLocalDev?"Local Dev":G.isDev?"Staging":"Production";return r&&l?e(n,{children:[e("div",{className:"w-1/3",children:[e("div",{className:"mb-4 text-xl font-semibold text-gray-800",children:["Authorizing client on ",d," environment."]}),e("div",{className:"mb-2 text-md text-gray-800",children:[t("div",{children:"A client app wants authorization to access the composable prompt servers in your name."}),e("div",{children:["The client app code is ",t("b",{children:a.code}),". You can check if the code is correct in the terminal."]})]}),e("div",{className:"mb-2 text-sm text-gray-600",children:[t("div",{children:"You must choose the target account and project for the client to access."}),t("div",{children:"Also, enter a profile name that will be used to save the authorization in your client configuration."})]})]}),t(Ne,{onAccept:i,allProjects:l,data:a})]}):t(s,{size:"lg"})}function be({payload:n,error:a}){const o=l();return e("div",{children:[a?e("div",{children:[e(h,{title:"Failed to send the authorization token to the cli tool",children:['This can happen due to security checks on Safari. The error is "',a.message,'"']}),t("div",{children:"Don't worry, you can still authenticate the cli tool by pasting the authentication token in the terminal. You can close this page."})]}):t("div",{children:"The client is authenticated. You can close this page."}),t(p,{className:"mt-4",children:t(i,{variant:"secondary",onClick:()=>{n&&(navigator.clipboard.writeText(JSON.stringify(n)),o({title:"Authentication Payload copied",description:a?"You can paste the authentication payload in the terminal to authenticate the client.":"You can close the page now.",status:"success",duration:5e3}))},children:"Copy the Authentication Payload"})})]})}function Ne({allProjects:n,data:a,onAccept:o}){const{accounts:r,account:l,project:s}=E(),[d,m]=I((()=>({profile:a.profile,account:a.account??l?.id,project:a.project??s?.id}))),u=n.filter((e=>e.account===d.account));return e("div",{className:"w-1/3",children:[e("div",{className:"mb-4 flex flex-col gap-2",children:[t("span",{className:"font-semibold text-gray-600",children:"Profile Name"}),t(c,{type:"text",value:d.profile,onChange:e=>{m({...d,profile:e})}})]}),e("div",{className:"mb-4 flex flex-col gap-2",children:[t("span",{className:"font-semibold text-gray-600",children:"Account"}),t(we,{value:d.account,onChange:e=>{m({...d,account:e.id,project:void 0})},accounts:r||[]})]}),e("div",{className:"mb-4 flex flex-col gap-2",children:[t("span",{className:"font-semibold text-gray-600",children:"Project"}),t(ke,{value:d.project,onChange:e=>{m({...d,project:e.id})},projects:u})]}),t("div",{className:"pt-2",children:t(i,{size:"xl",onClick:()=>o(d),children:"Authorize Client"})})]})}function we({value:e,accounts:n,onChange:i}){return t(g,{options:n,value:n?.find((t=>t.id===e)),onChange:e=>{i(e)},by:"id",optionLabel:e=>e.name,placeholder:"Select Account"})}function ke({value:e,projects:n,onChange:i}){return t(g,{by:"id",value:n.find((t=>t.id===e)),options:n,optionLabel:e=>e.name,placeholder:"Select Project",onChange:e=>{i(e)}})}function Ce({isOpen:n,onClose:a}){return e(v,{isOpen:n,onClose:a,children:[t(x,{children:"Sign In"}),e(y,{className:"flex justify-center",children:[t(ce,{}),t(le,{}),t(se,{})]}),t(b,{justify:"end",children:t(i,{variant:"ghost",onClick:a,children:"Cancel"})})]})}function je({title:n,value:i}){const[a,o]=I(!1);return e("div",{className:"w-full flex justify-between items-center mb-1",children:[e("div",{className:"flex flex-col w-[calc(100%-3rem)]",children:[t("div",{className:"text-sm px-2 dark:text-slate-200",children:n}),t(C,{description:i,size:"xs",placement:"left",children:e("div",{className:"text-xs truncate text-muted w-full text-left px-2",children:[i," "]})})]}),a?t(ee,{className:"size-4 cursor-pointer text-success"}):t(te,{className:"size-4 cursor-pointer text-gray-400 dark:text-slate-400",onClick:()=>function(e){navigator.clipboard.writeText(e),o(!0),setTimeout((()=>o(!1)),2e3)}(i)})]})}function Se(){const n=E(),{account:i,project:a,client:o,authToken:r}=n,l=new URL(o.baseUrl).hostname,c=new URL(o.store.baseUrl).hostname,s=a?Z(a):"",d=[{name:"user",label:"User",content:e("div",{className:"space-y-1 p-2",children:[t(je,{title:"Organization ID",value:i?.id??"Unknown"}),t(je,{title:"Project ID",value:a?.id??"Unknown"}),t(je,{title:"User ID",value:r?.sub??"Unknown"}),t(je,{title:"Organization Roles",value:r?.account_roles?.join(",")??"Unknown"}),t(je,{title:"Project Roles",value:r?.project_roles?.join(",")??"Unknown"})]})},{name:"environment",label:"Environment",content:e("div",{className:"space-y-1 p-2",children:[t(je,{title:"Tenant ID",value:s}),t(je,{title:"Environment",value:G.type}),t(je,{title:"Server",value:l}),t(je,{title:"Store",value:c}),t(je,{title:"App Version",value:G.version})]})}];return t("div",{className:"w-full",children:e(N,{defaultValue:"user",tabs:d,fullWidth:!0,updateHash:!1,children:[t(w,{}),t(k,{})]})})}function Pe({}){const{user:a,isLoading:o}=E(),[r,l]=I(!1);return o?t(s,{}):a?t("div",{className:"px-3",children:t(ze,{asMenuTrigger:!0})}):e(n,{children:[t(i,{onClick:()=>l(!0),children:"Sign In"}),t(Ce,{isOpen:r,onClose:()=>l(!1)})]})}function ze({className:n,asMenuTrigger:i=!1}){const a=E(),{user:o}=a;return a&&o?e(X,{strategy:"fixed",placement:"bottom-start",zIndex:100,children:[t(X.Trigger,{click:!0,children:t("div",{className:V(n,"flex items-center justify-start",i&&"cursor-pointer"),children:t(j,{size:"sm",color:"bg-amber-500",shape:"circle",name:o?.name})})}),t(X.Content,{className:"w-[280px] mx-2 my-1",children:t("div",{className:"bg-white dark:bg-slate-900 shadow-lg rounded-md ring-1 ring-gray-200 dark:ring-slate-700",children:e("div",{className:"divide-y divide-gray-200 dark:divide-slate-700",children:[e("div",{className:"py-2 pl-2",children:[t("p",{className:"px-4 dark:text-white mb-1",children:o?.name??"Unknown"}),t("p",{className:"px-4 text-xs text-gray-500",children:o?.email??""})]}),t("div",{className:"w-full p-1",children:t(Se,{})}),t("div",{className:"py-2 pl-2",children:t(S,{})}),t("div",{className:"py-2",children:t(P,{children:t(P.Item,{className:"px-2",onClick:()=>a.logout(),children:"Sign out"})})})]})})})]}):null}function Le(e){return!!e&&(e.endsWith("@vertesiahq.com")||e.endsWith("@becomposable.com")||e.endsWith("@composableprompts.com"))}function Ie({icon:e}){const{isLoading:n}=E(),[i,a]=I(!0);return T((()=>{n||a(!1)}),[n]),t(ae,{appear:!0,show:i,as:A,unmount:!0,leave:"transition ease-in duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:t("div",{style:{zIndex:999999},className:"fixed inset-x-0 inset-y-0",children:t("div",{className:"flex w-full h-full items-center justify-center",children:t("div",{className:"animate-[spin_4s_linear_infinite]",children:t("div",{className:"animate-pulse rounded-full bg-transparent",children:e||t(Te,{})})})})})})}function Te(){return e("svg",{className:"w-8 h-8 text-indigo-600",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",children:[t("defs",{children:e("linearGradient",{id:"spinner-gradient",x1:"1",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"1"}),t("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),t("circle",{cx:"25",cy:"25",r:"20",stroke:"url(#spinner-gradient)",strokeWidth:"5",fill:"none",strokeLinecap:"round"})]})}function Ae({children:n,lightLogo:i,darkLogo:a,loadingIcon:o}){return t(z,{children:t(R,{children:e(L,{defaultTheme:"system",storageKey:"vite-ui-theme",children:[t(Ie,{icon:o}),t(fe,{allowedPrefix:"/shared/",lightLogo:i,darkLogo:a}),t(ie,{children:n})]})})})}const _e=_(null);function Ue({installation:e,children:n}){return t(_e.Provider,{value:e,children:n})}function Ee(){return U(_e)}function Oe({app:n,onChange:i,placeholder:a}){const{client:o,project:r}=E(),{data:l,error:c}=f((()=>o.apps.getAppInstallationProjects(n)),[n.id,n.name]);return c?e("span",{className:"text-red-600",children:["Error: failed to fetch projects: ",c.message]}):t(De,{placeholder:a,initialValue:r?.id,projects:l||[],onChange:e=>{i&&!i(e)||(localStorage.setItem(F,e.account),localStorage.setItem(Y+"-"+e.account,e.id),window.location.reload())}})}function De({initialValue:e,projects:n,onChange:i,placeholder:a="Select Project"}){const[o,r]=I();let l=!o&&e?n.find((t=>t.id===e)):o;return t(g,{by:"id",value:l,options:n,optionLabel:e=>e.name,placeholder:a,onChange:e=>{r(e),i(e)}})}function We({name:e,AccessDenied:n=Me,children:i}){return e?t(qe,{name:e,AccessDenied:n,children:i}):t(Re,{})}function qe({name:e,AccessDenied:n=Me,children:i}){const{authToken:a,client:o}=E(),[r,l]=I(null),[c,s]=I("loading");return T((()=>{if(a){a.apps.includes(e)?o.apps.getAppInstallationByName(e).then((t=>{t?(s("loaded"),l(t)):(console.log(`App ${e} not found!`),s("error"))})):s("error")}else s("loading")}),[e,a]),"loading"===c?null:"error"===c?t(n,{name:e}):r?t(Ue,{installation:r,children:i}):void 0}function Me({name:n}){const{project:i}=E();return e(p,{className:"pt-10 flex flex-col items-center text-center text-gray-700",children:[t(ne,{className:"w-10 h-10 mb-4 text-gray-500"}),t("div",{className:"text-xl font-semibold",children:"Access Denied"}),e("div",{className:"mt-2 text-sm text-gray-500",children:["You don't have permission to view the ",t("span",{className:"font-semibold",children:n})," app in project: ",e("span",{className:"font-semibold",children:["«",i?.name,"»"]}),"."]}),t("div",{className:"mt-4",children:t(Oe,{app:{name:n},onChange:e=>{localStorage.setItem(F,e.account),localStorage.setItem(Y+"-"+e.account,e.id),window.location.reload()}})})]})}function Re(){return e(p,{className:"pt-10 flex flex-col items-center text-center text-gray-700",children:[t(ne,{className:"w-10 h-10 mb-4 text-gray-500"}),t("div",{className:"text-xl font-semibold",children:"Application not registered"}),e("div",{className:"mt-2 text-sm text-gray-500",children:["Before starting to code a Vertesia application you must register an application manifest in Vertesia Studio then install it in one or more projects.",t("p",{}),"Then use the created app name as a parameter to ",t("code",{children:'<StandaloneApp name="your-app-name">'})," in the ",t("code",{children:"src/main.tsx"})," file."]})]})}export{_e as AppInstallationContext,Ue as AppInstallationProvider,Oe as AppProjectSelector,oe as InviteAcceptModal,fe as SigninScreen,We as StandaloneApp,qe as StandaloneAppImpl,xe as TerminalLogin,Pe as UserSessionMenu,Ae as VertesiaShell,Le as isVertesiaEmail,Ee as useAppInstallation};
|
|
2
|
+
//# sourceMappingURL=vertesia-ui-shell.js.map
|