@viswa-test/test-citation 0.0.240 → 0.0.241
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/README.md +218 -0
- package/dist/cjs/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
- package/dist/cjs/features/ChatCitation/components/ChatCitation.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/cjs/features/IngestionStatus/useIngestionStatus.js +1 -1
- package/dist/cjs/features/InstantLearningCitation/SlashLoader.js +2 -0
- package/dist/cjs/features/InstantLearningCitation/SlashLoader.js.map +1 -0
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +2 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +2 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +2 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +2 -0
- package/dist/cjs/features/RequirementAI/components/segment/DeleteSegmentsDialog.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js +2 -0
- package/dist/cjs/features/RequirementAI/components/segment/EditSegmentDialog.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
- package/dist/cjs/features/RequirementAI/components/story-screen/CompletionPanel.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
- package/dist/cjs/hooks/useOnDemandCitationFetch.js +2 -0
- package/dist/cjs/hooks/useOnDemandCitationFetch.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/service/apicache.service.js +2 -0
- package/dist/cjs/service/apicache.service.js.map +1 -0
- package/dist/cjs/service/onDemandApi.js +2 -0
- package/dist/cjs/service/onDemandApi.js.map +1 -0
- package/dist/cjs/types/onDemandApi.types.js +2 -0
- package/dist/cjs/types/onDemandApi.types.js.map +1 -0
- package/dist/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
- package/dist/features/ChatCitation/components/ChatCitation.js +1 -1
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/features/IngestionStatus/useIngestionStatus.js +1 -1
- package/dist/features/InstantLearningCitation/SlashLoader.js +2 -0
- package/dist/features/InstantLearningCitation/SlashLoader.js.map +1 -0
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js +2 -0
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.module.css.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +2 -0
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +1 -0
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +2 -0
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +1 -0
- package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js +2 -0
- package/dist/features/RequirementAI/components/ai-reasoning/pdfCitation.module.css.js.map +1 -0
- package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +2 -0
- package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +1 -0
- package/dist/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.js +1 -1
- package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js +2 -0
- package/dist/features/RequirementAI/components/segment/DeleteSegmentsDialog.js.map +1 -0
- package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js +2 -0
- package/dist/features/RequirementAI/components/segment/EditSegmentDialog.js.map +1 -0
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js +2 -0
- package/dist/features/RequirementAI/components/segment/deleteSegmentDialog.module.css.js.map +1 -0
- package/dist/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/features/RequirementAI/components/story-screen/CompletionPanel.js +1 -1
- package/dist/features/RequirementAI/components/story-screen/CompletionPanel.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
- package/dist/hooks/useOnDemandCitationFetch.js +2 -0
- package/dist/hooks/useOnDemandCitationFetch.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/service/apicache.service.js +2 -0
- package/dist/service/apicache.service.js.map +1 -0
- package/dist/service/onDemandApi.js +2 -0
- package/dist/service/onDemandApi.js.map +1 -0
- package/dist/types/onDemandApi.types.js +2 -0
- package/dist/types/onDemandApi.types.js.map +1 -0
- package/dist/types/src/DeviationSummaryTest.d.ts.map +1 -1
- package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/constants/deviationData.d.ts +887 -0
- package/dist/types/src/constants/deviationData.d.ts.map +1 -0
- package/dist/types/src/constants/treeData.d.ts +732 -0
- package/dist/types/src/constants/treeData.d.ts.map +1 -0
- package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts +1 -0
- package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts.map +1 -1
- package/dist/types/src/features/ChatCitation/types/citations.types.d.ts +3 -0
- package/dist/types/src/features/ChatCitation/types/citations.types.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +1277 -6887
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +0 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
- package/dist/types/src/features/IngestionStatus/useIngestionStatus.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearningCitation/InstantLearningCitationTest.d.ts +2 -0
- package/dist/types/src/features/InstantLearningCitation/InstantLearningCitationTest.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearningCitation/types/Types.d.ts +2 -0
- package/dist/types/src/features/InstantLearningCitation/types/Types.d.ts.map +1 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +128 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +1 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +13 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +13 -6
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +7 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts +8 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts +13 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts +17 -13
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +15 -3
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +21 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.d.ts +11 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.d.ts +25 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts +3 -2
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.d.ts +31 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/chat-citation/ChatCitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/DeleteSegmentsDialog.d.ts +13 -0
- package/dist/types/src/features/RequirementAI/components/segment/DeleteSegmentsDialog.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/segment/EditSegmentDialog.d.ts +12 -0
- package/dist/types/src/features/RequirementAI/components/segment/EditSegmentDialog.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +8 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +5 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/story-screen/CompletionPanel.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/story-screen/CompletionPanel.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts +18 -1
- package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +32 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +8 -0
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
- package/dist/types/src/hooks/useOnDemandCitationFetch.d.ts +11 -0
- package/dist/types/src/hooks/useOnDemandCitationFetch.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnDemandCitationFetchTest.d.ts +4 -0
- package/dist/types/src/hooks/useOnDemandCitationFetchTest.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/methodsToExpose.d.ts +1 -1
- package/dist/types/src/service/ProjectService.d.ts +2 -2
- package/dist/types/src/service/SavedDataSetService.d.ts +3 -3
- package/dist/types/src/service/apicache.service.d.ts +43 -0
- package/dist/types/src/service/apicache.service.d.ts.map +1 -0
- package/dist/types/src/service/onDemandApi.d.ts +27 -0
- package/dist/types/src/service/onDemandApi.d.ts.map +1 -0
- package/dist/types/src/types/onDemandApi.types.d.ts +58 -0
- package/dist/types/src/types/onDemandApi.types.d.ts.map +1 -0
- package/dist/types/src/types/useOnDemandCitationFetch.types.d.ts +70 -0
- package/dist/types/src/types/useOnDemandCitationFetch.types.d.ts.map +1 -0
- package/package.json +14 -3
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/types/src/CitationAccordionTest.d.ts +0 -1
- package/dist/types/src/CitationAccordionTest.d.ts.map +0 -1
- package/dist/types/src/MockDeviationSummary.d.ts +0 -1
- package/dist/types/src/MockDeviationSummary.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
- [MarkdownWithImageCitation](#markdownwithimagecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/MarkdownWithImageCitation/README.md)
|
|
24
24
|
- [ScannedDocCitation](#scanneddoccitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ScannedDocCitation/README.md)
|
|
25
25
|
- [InstantLearningCitationComponent](#instantlearningcitationcomponent)
|
|
26
|
+
- [CitationOrchestratorComponent](#citationorchestratorcomponent)
|
|
26
27
|
- [Other Components](#other-components)
|
|
27
28
|
- [Bookemon](#bookemon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/Bookemon/BookemonReadme.md)
|
|
28
29
|
- [DatagestMon](#datagestmon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/DatagestMon/README.md)
|
|
@@ -2715,6 +2716,223 @@ import SplitterCitationsComponent from '@e-llm-studio/citation/SplitterCitations
|
|
|
2715
2716
|
|
|
2716
2717
|
---
|
|
2717
2718
|
|
|
2719
|
+
## CitationOrchestratorComponent
|
|
2720
|
+
|
|
2721
|
+
### Overview
|
|
2722
|
+
|
|
2723
|
+
`CitationOrchestratorComponent` is the top-level citation dispatcher for the `@e-llm-studio/citation` library. It receives a citation link `href` (with URL search params like `citationNumber` and `citationType`) plus an array of citation data objects, resolves the correct citation by number, and renders the appropriate citation component based on the `citation_type` field — all in a single `<a>`-like element you drop into a markdown renderer.
|
|
2724
|
+
|
|
2725
|
+
It handles **seven citation types** out of the box:
|
|
2726
|
+
|
|
2727
|
+
| `citation_type` | Renders |
|
|
2728
|
+
|---|---|
|
|
2729
|
+
| `scanned_doc_citation` | `ScannedDocCitation` (image pages + highlight boxes) |
|
|
2730
|
+
| `IL` | `InstantLearningCitationWrapper` (expandable Instant Learning pill) |
|
|
2731
|
+
| `chat_citation` | `ChatCitationRenderer` (summarized / detailed chat panels + optional rule book) |
|
|
2732
|
+
| `gpt_citation` | `NonWebReasoningComponent` (GPT / Gemini reasoning card) |
|
|
2733
|
+
| `web_citation` | `WebCitationWithImageContent` or plain `<a>` |
|
|
2734
|
+
| `image_citation` | `ImageCitationContent` |
|
|
2735
|
+
| `document_citation` / `book_citation_doc` / `book_citation_pdf` | `FileCitationContent` |
|
|
2736
|
+
|
|
2737
|
+
While streaming, every citation renders a compact spinner via `SlashLoader` instead of its full UI.
|
|
2738
|
+
|
|
2739
|
+
### Features
|
|
2740
|
+
|
|
2741
|
+
- **Single entry point** — one component dispatches to all citation types; no per-type switch logic needed in the consumer
|
|
2742
|
+
- **URL-driven resolution** — `citationNumber` and `decisionStrength` are read from `href` query params
|
|
2743
|
+
- **Streaming-safe** — shows an inline `SlashLoader` spinner while the parent is still generating text
|
|
2744
|
+
- **Validation with clear errors** — throws descriptive errors for missing required fields; unknown types render nothing and log an error silently
|
|
2745
|
+
- **Full `ChatCitationConfig` passthrough** — granular control over layout, panels, relevance score, tab defaults, and styles for `chat_citation`
|
|
2746
|
+
- **Zero opinion on styling** — all visual customization lives in the leaf components or `chatCitationConfig`
|
|
2747
|
+
|
|
2748
|
+
### Usage
|
|
2749
|
+
|
|
2750
|
+
The component is typically wired into a Markdown renderer as the custom `<a>` component:
|
|
2751
|
+
|
|
2752
|
+
```tsx
|
|
2753
|
+
import CitationOrchestratorComponent from '@e-llm-studio/citation/CitationOrchestratorComponent';
|
|
2754
|
+
|
|
2755
|
+
// Inside your markdown renderer config
|
|
2756
|
+
const renderers = {
|
|
2757
|
+
a: ({ href, children }) => (
|
|
2758
|
+
<CitationOrchestratorComponent
|
|
2759
|
+
href={href}
|
|
2760
|
+
citations={citations}
|
|
2761
|
+
>
|
|
2762
|
+
{children}
|
|
2763
|
+
</CitationOrchestratorComponent>
|
|
2764
|
+
),
|
|
2765
|
+
};
|
|
2766
|
+
```
|
|
2767
|
+
|
|
2768
|
+
The citation link in the markdown source looks like:
|
|
2769
|
+
|
|
2770
|
+
```
|
|
2771
|
+
[L3](doc_id=learnings_doc?citationNumber=1&citation_type=IL&citationSource=L3&decisionStrength=100%)
|
|
2772
|
+
```
|
|
2773
|
+
|
|
2774
|
+
### Props
|
|
2775
|
+
|
|
2776
|
+
| Prop | Type | Required | Description |
|
|
2777
|
+
|---|---|---|---|
|
|
2778
|
+
| `href` | `string` | Yes | Citation link URL. Must contain `citationNumber` as a query param. `decisionStrength` is also read from here for `IL` citations. |
|
|
2779
|
+
| `citations` | `CitationItem[]` | Yes | Array of citation objects. Each item must have a `customMetaData` object with at least `citation_type` and `citation_number`. |
|
|
2780
|
+
| `children` | `React.ReactNode` | No | Link text passed from the markdown renderer. Used as the display label for `IL`, `web_citation`, and `image_citation`. |
|
|
2781
|
+
| `isStreaming` | `boolean` | No | When `true`, renders an inline spinner instead of the resolved citation. |
|
|
2782
|
+
| `onCitationToggle` | `(keys: string[], adId: string, isOpen: boolean) => void` | No | Callback forwarded to `InstantLearningCitationWrapper` for toggle state tracking. |
|
|
2783
|
+
| `chatCitationConfig` | `ChatCitationConfig` | No | Full layout + style configuration for `chat_citation` type. See `ChatCitationConfig` below. |
|
|
2784
|
+
|
|
2785
|
+
### `CitationItem` shape
|
|
2786
|
+
|
|
2787
|
+
```ts
|
|
2788
|
+
interface CitationItem {
|
|
2789
|
+
customMetaData: {
|
|
2790
|
+
citation_type: string; // dispatcher key
|
|
2791
|
+
citation_number?: number | string;
|
|
2792
|
+
|
|
2793
|
+
// scanned_doc_citation
|
|
2794
|
+
gs_url?: string;
|
|
2795
|
+
highlighted_coordinates?: { xmin: number; ymin: number; xmax: number; ymax: number }[];
|
|
2796
|
+
value?: any[]; // pre-built page array (overrides gs_url path)
|
|
2797
|
+
|
|
2798
|
+
// IL
|
|
2799
|
+
il_learning?: any;
|
|
2800
|
+
link_text?: string;
|
|
2801
|
+
citation_source?: string;
|
|
2802
|
+
decision_strength?: string;
|
|
2803
|
+
|
|
2804
|
+
// chat_citation
|
|
2805
|
+
chat_data?: ChatCitationDataItem[];
|
|
2806
|
+
rule_book_content?: string;
|
|
2807
|
+
rule_book_highlights?: string[];
|
|
2808
|
+
relevance_score?: number;
|
|
2809
|
+
|
|
2810
|
+
// gpt_citation
|
|
2811
|
+
data_sources?: string[];
|
|
2812
|
+
training_data_title?: string[];
|
|
2813
|
+
paraphrase?: string[];
|
|
2814
|
+
|
|
2815
|
+
// web_citation
|
|
2816
|
+
link?: string;
|
|
2817
|
+
screenshot_url?: string;
|
|
2818
|
+
|
|
2819
|
+
// image_citation / document citations
|
|
2820
|
+
gs_util_path?: string;
|
|
2821
|
+
signed_url?: string;
|
|
2822
|
+
|
|
2823
|
+
[key: string]: any;
|
|
2824
|
+
};
|
|
2825
|
+
}
|
|
2826
|
+
```
|
|
2827
|
+
|
|
2828
|
+
### `ChatCitationConfig` prop
|
|
2829
|
+
|
|
2830
|
+
Use this to fully control the `chat_citation` rendering without modifying the component:
|
|
2831
|
+
|
|
2832
|
+
```ts
|
|
2833
|
+
interface ChatCitationConfig {
|
|
2834
|
+
showRootContainer?: boolean;
|
|
2835
|
+
rootContainer?: {
|
|
2836
|
+
title?: string;
|
|
2837
|
+
relevanceTitle?: string;
|
|
2838
|
+
icon?: React.ReactNode;
|
|
2839
|
+
slotStyles?: { title?: CSSProperties; relevanceScore?: CSSProperties; container?: CSSProperties };
|
|
2840
|
+
};
|
|
2841
|
+
chatContainer?: {
|
|
2842
|
+
title?: string;
|
|
2843
|
+
chatIcon?: React.ReactNode;
|
|
2844
|
+
highlightColor?: string;
|
|
2845
|
+
summarizedTab?: { chip?: { isActive?: boolean; show?: boolean; styles?: CSSProperties }; view?: { slotStyles?: any } };
|
|
2846
|
+
detailedTab?: { chip?: { isActive?: boolean; onClick?: () => void; styles?: CSSProperties }; view?: any };
|
|
2847
|
+
slotStyles?: { title?: CSSProperties; chatDataContainer?: CSSProperties; outerContainer?: CSSProperties; container?: CSSProperties };
|
|
2848
|
+
additionalSecondaryActions?: React.ReactNode[];
|
|
2849
|
+
};
|
|
2850
|
+
ruleBookContainer?: {
|
|
2851
|
+
title?: string;
|
|
2852
|
+
ruleBookIcon?: React.ReactNode;
|
|
2853
|
+
slotStyles?: { title?: CSSProperties; dataContainer?: CSSProperties; outerContainer?: CSSProperties };
|
|
2854
|
+
additionalSecondaryActions?: React.ReactNode[];
|
|
2855
|
+
};
|
|
2856
|
+
reversePanels?: boolean;
|
|
2857
|
+
isRenderedCustomComponent?: boolean;
|
|
2858
|
+
modalContainerStyle?: CSSProperties;
|
|
2859
|
+
additionalData?: {
|
|
2860
|
+
RuleBookContainerRatio?: number | string;
|
|
2861
|
+
RuleBookDetailedViewVerticallyStacked?: boolean;
|
|
2862
|
+
RuleBookContainerHeight?: number | string;
|
|
2863
|
+
};
|
|
2864
|
+
closePreview?: () => void;
|
|
2865
|
+
selectedIdFromReason?: string | null;
|
|
2866
|
+
}
|
|
2867
|
+
```
|
|
2868
|
+
|
|
2869
|
+
### Examples
|
|
2870
|
+
|
|
2871
|
+
#### Scanned document with highlight boxes
|
|
2872
|
+
|
|
2873
|
+
```tsx
|
|
2874
|
+
const citations = [{
|
|
2875
|
+
customMetaData: {
|
|
2876
|
+
citation_type: 'scanned_doc_citation',
|
|
2877
|
+
citation_number: 1,
|
|
2878
|
+
gs_url: 'https://storage.example.com/doc-page.png',
|
|
2879
|
+
highlighted_coordinates: [{ xmin: 100, ymin: 200, xmax: 400, ymax: 250 }],
|
|
2880
|
+
}
|
|
2881
|
+
}];
|
|
2882
|
+
|
|
2883
|
+
<CitationOrchestratorComponent href="?citationNumber=1" citations={citations} />
|
|
2884
|
+
```
|
|
2885
|
+
|
|
2886
|
+
#### Chat citation with rule book
|
|
2887
|
+
|
|
2888
|
+
```tsx
|
|
2889
|
+
const citations = [{
|
|
2890
|
+
customMetaData: {
|
|
2891
|
+
citation_type: 'chat_citation',
|
|
2892
|
+
citation_number: 2,
|
|
2893
|
+
relevance_score: 87,
|
|
2894
|
+
chat_data: [
|
|
2895
|
+
{ role: 'user', message: 'What is the refund policy?', userName: 'Alice', timeStamp: '2024-01-01T10:00:00Z', highlighted_text: '' },
|
|
2896
|
+
{ role: 'assistant', message: 'Refunds are processed within 5 business days.', userName: 'Assistant', timeStamp: '2024-01-01T10:00:05Z', highlighted_text: 'Refunds are processed within 5 business days.' },
|
|
2897
|
+
],
|
|
2898
|
+
rule_book_content: '**Section 4.2** – Refunds must be requested within 30 days of purchase.',
|
|
2899
|
+
rule_book_highlights: ['Refunds must be requested within 30 days'],
|
|
2900
|
+
}
|
|
2901
|
+
}];
|
|
2902
|
+
|
|
2903
|
+
<CitationOrchestratorComponent
|
|
2904
|
+
href="?citationNumber=2"
|
|
2905
|
+
citations={citations}
|
|
2906
|
+
chatCitationConfig={{
|
|
2907
|
+
showRootContainer: true,
|
|
2908
|
+
chatContainer: { summarizedTab: { chip: { isActive: true, show: true } } },
|
|
2909
|
+
}}
|
|
2910
|
+
/>
|
|
2911
|
+
```
|
|
2912
|
+
|
|
2913
|
+
#### Streaming placeholder
|
|
2914
|
+
|
|
2915
|
+
```tsx
|
|
2916
|
+
<CitationOrchestratorComponent
|
|
2917
|
+
href="?citationNumber=3&citation_type=IL"
|
|
2918
|
+
citations={citations}
|
|
2919
|
+
isStreaming={true}
|
|
2920
|
+
>
|
|
2921
|
+
[3]
|
|
2922
|
+
</CitationOrchestratorComponent>
|
|
2923
|
+
```
|
|
2924
|
+
|
|
2925
|
+
Renders: `[3] ⠋` (spinner) until `isStreaming` becomes `false`.
|
|
2926
|
+
|
|
2927
|
+
### Behavior notes
|
|
2928
|
+
|
|
2929
|
+
- Returns `null` silently when `citationNumber` is missing from `href` or no matching citation is found in the `citations` array.
|
|
2930
|
+
- Unknown `citation_type` values also return `null` (with a `console.error`).
|
|
2931
|
+
- For `web_citation` without a `screenshot_url`, the component falls back to a plain `<a>` tag.
|
|
2932
|
+
- `chat_citation` defaults: summarized tab active, detailed tab inactive. Override via `chatCitationConfig.chatContainer.summarizedTab` / `detailedTab`.
|
|
2933
|
+
|
|
2934
|
+
---
|
|
2935
|
+
|
|
2718
2936
|
## Common Use Cases
|
|
2719
2937
|
|
|
2720
2938
|
### RAG (Retrieval Augmented Generation) Applications
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),o=require("./components/ChatCitation.js"),i=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("./components/InViewNavigation.js"),d=require("./components/DetailedView.js"),s=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(require("@mui/icons-material/CloseOutlined"));exports.default=function(g){var p,x,m,y,_,w,C,k,j,S,q,A,D,T,R,I,V,F,z,P,B,E,H,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,oe,ie,ne,te,re,de,se=g.rootContainer,ae=g.chatContainer,ue=void 0===ae?{chatData:[]}:ae,ve=g.ruleBookContainer,ce=g.renderer,he=g.additionalData,fe=g.tableComponent,ge=g.closePreview,be=g.isRenderedCustomComponent,pe=void 0!==be&&be,xe=g.showRootContainer,me=void 0===xe||xe,ye=g.reversePanels,_e=void 0!==ye&&ye,we=u.useState(0),Ce=we[0],ke=we[1],je=u.useState(0),Se=je[0],qe=je[1],Ae=u.useState(0),De=Ae[0],Te=Ae[1],Re=u.useState(0),Ie=Re[0],Ve=Re[1],Fe=u.useRef(null),ze=u.useRef(null),Pe=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),ce)},[ce]),Be=u.useMemo(function(){return!!((null==fe?void 0:fe.rows)&&Object.keys(fe.rows).length>0)},[fe]),Ee=u.useMemo(function(){var e;return null!==(e=null==he?void 0:he.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==he?void 0:he.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==ve?void 0:ve.show)&&Fe.current){var o=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(ke((null==o?void 0:o.length)||0),qe(0),o&&o.length>0)(i=o[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}if((null==ue?void 0:ue.show)&&(null==ze?void 0:ze.current)){var i,n=null===(l=ze.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Te((null==n?void 0:n.length)||0),Ve(0),n&&n.length>0)(i=n[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}},[null==ue?void 0:ue.show,null==ve?void 0:ve.show,null==ve?void 0:ve.data,null==ue?void 0:ue.chatData]);var He=u.useCallback(function(){var e;if(Se+1<Ce){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[Se].style.backgroundColor="#ffffb8";var o=Se+1;qe(o);var i=l[o];i.style.backgroundColor="#ffff5c",null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Se,Ce]),Me=u.useCallback(function(){var e;if(!(Se-1<0)){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[Se].style.backgroundColor="#ffffb8";var o=Se-1,i=l[o];i.style.backgroundColor="#ffff5c",qe(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Se]),Ne=u.useCallback(function(){var e;if(Ie+1<De){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ie].style.backgroundColor="#ffffb8";var o=Ie+1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Ie,De]),We=u.useCallback(function(){var e;if(!(Ie-1<0)){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Ie].style.backgroundColor="#ffffb8";var o=Ie-1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Ie]),Ye=i.getColorCode((null==se?void 0:se.relevanceScore)||0),Oe=u.useMemo(function(){var o,i=l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Ye.border,backgroundColor:Ye.background,color:Ye.text},null===(o=null==se?void 0:se.slotStyles)||void 0===o?void 0:o.relevanceScore)},{children:[(null==se?void 0:se.relevanceTitle)||"Decision Strength",":"," ",(null==se?void 0:se.relevanceScore)||0,"%"]}),"relevance-score"),n=l.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:ge},{children:l.jsx(b.default,{})}),"close-preview");return pe&&!(null==he?void 0:he.isExpanded)?[i,n]:[i]},[pe,Ye.background,Ye.border,Ye.text,null==se?void 0:se.relevanceScore,null===(p=null==se?void 0:se.slotStyles)||void 0===p?void 0:p.relevanceScore,null==se?void 0:se.relevanceTitle]),Ke=u.useMemo(function(){return[Ce>0&&l.jsx(r.default,{currentItemNumber:Se+1,totalItems:Ce,disableNext:Se+1>=Ce,onNext:He,onPrevious:Me,disablePrevious:Se<=0},"rulebook-nav")]},[Se,He,Me,Ce]),Qe=u.useMemo(function(){return(null==he?void 0:he.RuleBookContainerHeight)?he.RuleBookContainerHeight:!(!Ee||(null==he?void 0:he.isExpanded))&&"600px"},[null==he?void 0:he.RuleBookContainerHeight,Ee]),Ue=u.useMemo(function(){var e,o;return[(null===(o=null===(e=null==ue?void 0:ue.detailedTab)||void 0===e?void 0:e.chip)||void 0===o?void 0:o.isActive)&&De>0&&l.jsx(r.default,{currentItemNumber:Ie+1,totalItems:De,onNext:Ne,onPrevious:We,disableNext:Ie+1>=De,disablePrevious:Ie<=0},"chat-nav")]},[null===(m=null===(x=null==ue?void 0:ue.detailedTab)||void 0===x?void 0:x.chip)||void 0===m?void 0:m.isActive,Ie,Ne,We,De]),Ge=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:_e?Ee?"column-reverse":"row-reverse":Ee?"column":"row",gap:[(null==ue?void 0:ue.chatData)&&ue.chatData.length>0&&(ue.show||void 0===ue.show),(null==ve?void 0:ve.data)&&(ve.show||void 0===ve.show),Be].filter(Boolean).length>1?"12px":"0",height:Qe||"100%",minHeight:0},null===(y=null==se?void 0:se.slotStyles)||void 0===y?void 0:y.container)},{children:[Be&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(_=null==ue?void 0:ue.slotStyles)||void 0===_?void 0:_.outerContainer)},{children:l.jsx(o.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==he?void 0:he.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==fe?void 0:fe.rows)&&l.jsx(f.BigQueryTable,{rows:fe.rows,columns:fe.columns||[]})}))}))})),(null==ve?void 0:ve.data)&&(ve.show||void 0===ve.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(w=null==ve?void 0:ve.slotStyles)||void 0===w?void 0:w.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(C=null==ve?void 0:ve.title)&&void 0!==C?C:"Rule book",icon:null==ve?void 0:ve.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(k=null==ve?void 0:ve.slotStyles)||void 0===k?void 0:k.title)},secondaryActions:(null==ve?void 0:ve.secondaryActions)?ve.secondaryActions(Ke):Ke},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(j=null==ve?void 0:ve.slotStyles)||void 0===j?void 0:j.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Fe},{children:l.jsx(a.default,{data:ve.data,renderers:null!==(S=null==ve?void 0:ve.renderer)&&void 0!==S?S:Pe})}))}))}))})),(null==ue?void 0:ue.chatData)&&ue.chatData.length>0&&(ue.show||void 0===ue.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(q=null==ue?void 0:ue.slotStyles)||void 0===q?void 0:q.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(A=null==ue?void 0:ue.title)&&void 0!==A?A:"Chat",icon:null==ue?void 0:ue.chatIcon,containerStyles:null===(D=null==ue?void 0:ue.slotStyles)||void 0===D?void 0:D.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(T=null==ue?void 0:ue.slotStyles)||void 0===T?void 0:T.title)},primaryActions:[((null===(I=null===(R=null==ue?void 0:ue.summarizedTab)||void 0===R?void 0:R.chip)||void 0===I?void 0:I.show)||void 0===(null===(F=null===(V=null==ue?void 0:ue.summarizedTab)||void 0===V?void 0:V.chip)||void 0===F?void 0:F.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(z=null==ue?void 0:ue.summarizedTab)||void 0===z?void 0:z.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(P=null==ue?void 0:ue.detailedTab)||void 0===P?void 0:P.chip))],secondaryActions:ue.secondaryActions?null==ue?void 0:ue.secondaryActions(Ue):Ue},{children:l.jsxs("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(B=null==ue?void 0:ue.slotStyles)||void 0===B?void 0:B.chatDataContainer)},{children:[(null===(H=null===(E=null==ue?void 0:ue.detailedTab)||void 0===E?void 0:E.chip)||void 0===H?void 0:H.isActive)&&l.jsx("div",e.__assign({ref:ze,style:{position:(null==he?void 0:he.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(M=ue.chatData)&&void 0!==M?M:[],assistantChatProps:e.__assign(e.__assign({},null===(W=null===(N=null==ue?void 0:ue.detailedTab)||void 0===N?void 0:N.view)||void 0===W?void 0:W.assistantChatProps),{renderers:null!==(K=null===(O=null===(Y=null==ue?void 0:ue.detailedTab)||void 0===Y?void 0:Y.detailedViewRenderer)||void 0===O?void 0:O.assistantText)&&void 0!==K?K:Pe}),userChatItemProps:e.__assign(e.__assign({},null===(U=null===(Q=null==ue?void 0:ue.detailedTab)||void 0===Q?void 0:Q.view)||void 0===U?void 0:U.userChatItemProps),{renderers:null!==(L=null===(J=null===(G=null==ue?void 0:ue.detailedTab)||void 0===G?void 0:G.detailedViewRenderer)||void 0===J?void 0:J.userText)&&void 0!==L?L:Pe})})})),(null===(Z=null===(X=null==ue?void 0:ue.summarizedTab)||void 0===X?void 0:X.chip)||void 0===Z?void 0:Z.show)&&(null===(ee=null===($=null==ue?void 0:ue.summarizedTab)||void 0===$?void 0:$.chip)||void 0===ee?void 0:ee.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(le=ue.chatData)&&void 0!==le?le:[]},null===(oe=null==ue?void 0:ue.summarizedTab)||void 0===oe?void 0:oe.view,{renderer:null!==(ne=null===(ie=null==ue?void 0:ue.summarizedTab)||void 0===ie?void 0:ie.summarizedViewRenderer)&&void 0!==ne?ne:Pe}))]}))}))}))]}));return me?l.jsx(o.default,e.__assign({title:null==se?void 0:se.title,slotStyles:{title:null===(te=null==se?void 0:se.slotStyles)||void 0===te?void 0:te.title},containerStyles:null===(re=null==se?void 0:se.slotStyles)||void 0===re?void 0:re.container,icon:null!==(de=null==se?void 0:se.icon)&&void 0!==de?de:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==se?void 0:se.secondaryActions)?se.secondaryActions(Oe):Oe},{children:Ge})):Ge};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("./components/ChatCitation.js"),o=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("./components/InViewNavigation.js"),d=require("./components/DetailedView.js"),s=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=g(require("@mui/icons-material/CloseOutlined")),b=function(e,l,i){if(void 0===i&&(i="smooth"),l){for(var o=e.parentElement;o;){var n=window.getComputedStyle(o).overflowY;if(("auto"===n||"scroll"===n)&&o.scrollHeight>o.clientHeight)break;if(o===l){o=null;break}o=o.parentElement}var t=null!=o?o:l,r=e.getBoundingClientRect(),d=t.getBoundingClientRect(),s=t.scrollTop+r.top-d.top-(t.clientHeight-r.height)/2;t.scrollTo({top:Math.max(0,s),behavior:i})}};exports.default=function(g){var x,m,y,_,C,w,S,j,k,q,A,T,D,R,F,z,B,E,I,P,H,V,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,ie,oe,ne,te,re,de,se,ae,ue,ve,ce=g.rootContainer,he=g.chatContainer,fe=void 0===he?{chatData:[]}:he,ge=g.ruleBookContainer,pe=g.renderer,be=g.additionalData,xe=g.tableComponent,me=g.closePreview,ye=g.isRenderedCustomComponent,_e=void 0!==ye&&ye,Ce=g.showRootContainer,we=void 0===Ce||Ce,Se=g.reversePanels,je=void 0!==Se&&Se,ke=u.useState(0),qe=ke[0],Ae=ke[1],Te=u.useState(0),De=Te[0],Re=Te[1],Fe=u.useState(0),ze=Fe[0],Be=Fe[1],Ee=u.useState(0),Ie=Ee[0],Pe=Ee[1],He=u.useRef(null),Ve=u.useRef(null),Me=u.useRef(null),Ne=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),pe)},[pe]),We=u.useMemo(function(){return!!((null==xe?void 0:xe.rows)&&Object.keys(xe.rows).length>0)},[xe]),Ye=u.useMemo(function(){var e;return null!==(e=null==be?void 0:be.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==be?void 0:be.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==ge?void 0:ge.show)&&He.current){var i=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(Ae((null==i?void 0:i.length)||0),Re(0),i&&i.length>0){var o=i[0];o.style.backgroundColor="#ffff5c",b(o,He.current)}}if((null==fe?void 0:fe.show)&&(null==Ve?void 0:Ve.current)){var n=null===(l=Ve.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Be((null==n?void 0:n.length)||0),Pe(0),n&&n.length>0){var t=n[0];t.style.backgroundColor="#ffff5c";var r=requestAnimationFrame(function(){b(t,Me.current)});return function(){return cancelAnimationFrame(r)}}}},[null==fe?void 0:fe.show,null==ge?void 0:ge.show,null==ge?void 0:ge.data,null==fe?void 0:fe.chatData]);var Oe=u.useCallback(function(){var e;if(De+1<qe){var l=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[De].style.backgroundColor="#ffffb8";var i=De+1;Re(i);var o=l[i];o.style.backgroundColor="#ffff5c",b(o,He.current)}},[De,qe]),Ke=u.useCallback(function(){var e;if(!(De-1<0)){var l=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[De].style.backgroundColor="#ffffb8";var i=De-1,o=l[i];o.style.backgroundColor="#ffff5c",Re(i),b(o,He.current)}}},[De]),Qe=u.useCallback(function(){var e;if(Ie+1<ze){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ie].style.backgroundColor="#ffffb8";var i=Ie+1,o=l[i];o.style.backgroundColor="#ffff5c",Pe(i),b(o,Me.current)}},[Ie,ze]),Ue=u.useCallback(function(){var e;if(!(Ie-1<0)){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Ie].style.backgroundColor="#ffffb8";var i=Ie-1,o=l[i];o.style.backgroundColor="#ffff5c",Pe(i),b(o,Me.current)}}},[Ie]),Ge=o.getColorCode((null==ce?void 0:ce.relevanceScore)||0),Je=u.useMemo(function(){var i,o=l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Ge.border,backgroundColor:Ge.background,color:Ge.text},null===(i=null==ce?void 0:ce.slotStyles)||void 0===i?void 0:i.relevanceScore)},{children:[(null==ce?void 0:ce.relevanceTitle)||"Decision Strength",":"," ",(null==ce?void 0:ce.relevanceScore)||0,"%"]}),"relevance-score"),n=l.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:me},{children:l.jsx(p.default,{})}),"close-preview");return _e&&!(null==be?void 0:be.isExpanded)?[o,n]:[o]},[_e,Ge.background,Ge.border,Ge.text,null==ce?void 0:ce.relevanceScore,null===(x=null==ce?void 0:ce.slotStyles)||void 0===x?void 0:x.relevanceScore,null==ce?void 0:ce.relevanceTitle]),Le=u.useMemo(function(){return[qe>0&&l.jsx(r.default,{currentItemNumber:De+1,totalItems:qe,disableNext:De+1>=qe,onNext:Oe,onPrevious:Ke,disablePrevious:De<=0},"rulebook-nav")]},[De,Oe,Ke,qe]),Xe=u.useMemo(function(){return(null==be?void 0:be.RuleBookContainerHeight)?be.RuleBookContainerHeight:!(!Ye||(null==be?void 0:be.isExpanded))&&"600px"},[null==be?void 0:be.RuleBookContainerHeight,Ye]),Ze=u.useMemo(function(){var e,i;return[(null===(i=null===(e=null==fe?void 0:fe.detailedTab)||void 0===e?void 0:e.chip)||void 0===i?void 0:i.isActive)&&ze>0&&l.jsx(r.default,{currentItemNumber:Ie+1,totalItems:ze,onNext:Qe,onPrevious:Ue,disableNext:Ie+1>=ze,disablePrevious:Ie<=0},"chat-nav")]},[null===(y=null===(m=null==fe?void 0:fe.detailedTab)||void 0===m?void 0:m.chip)||void 0===y?void 0:y.isActive,Ie,Qe,Ue,ze]),$e=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:je?Ye?"column-reverse":"row-reverse":Ye?"column":"row",gap:[(null==fe?void 0:fe.chatData)&&fe.chatData.length>0&&(fe.show||void 0===fe.show),(null==ge?void 0:ge.data)&&(ge.show||void 0===ge.show),We].filter(Boolean).length>1?"12px":"0",height:Xe||"100%",minHeight:0},null===(_=null==ce?void 0:ce.slotStyles)||void 0===_?void 0:_.container)},{children:[We&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(C=null==fe?void 0:fe.slotStyles)||void 0===C?void 0:C.outerContainer)},{children:l.jsx(i.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==be?void 0:be.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==xe?void 0:xe.rows)&&l.jsx(f.BigQueryTable,{rows:xe.rows,columns:xe.columns||[]})}))}))})),(null==ge?void 0:ge.data)&&(ge.show||void 0===ge.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(w=null==ge?void 0:ge.slotStyles)||void 0===w?void 0:w.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(S=null==ge?void 0:ge.title)&&void 0!==S?S:"Rule book",icon:null==ge?void 0:ge.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(j=null==ge?void 0:ge.slotStyles)||void 0===j?void 0:j.title),body:null===(k=null==ge?void 0:ge.slotStyles)||void 0===k?void 0:k.body},secondaryActions:(null==ge?void 0:ge.secondaryActions)?ge.secondaryActions(Le):Le},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(q=null==ge?void 0:ge.slotStyles)||void 0===q?void 0:q.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:He},{children:l.jsx(a.default,{data:ge.data,renderers:null!==(A=null==ge?void 0:ge.renderer)&&void 0!==A?A:Ne})}))}))}))})),(null==fe?void 0:fe.chatData)&&fe.chatData.length>0&&(fe.show||void 0===fe.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(T=null==fe?void 0:fe.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(D=null==fe?void 0:fe.title)&&void 0!==D?D:"Chat",icon:null==fe?void 0:fe.chatIcon,containerStyles:null===(R=null==fe?void 0:fe.slotStyles)||void 0===R?void 0:R.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(F=null==fe?void 0:fe.slotStyles)||void 0===F?void 0:F.title),body:null===(z=null==fe?void 0:fe.slotStyles)||void 0===z?void 0:z.body},primaryActions:[((null===(E=null===(B=null==fe?void 0:fe.summarizedTab)||void 0===B?void 0:B.chip)||void 0===E?void 0:E.show)||void 0===(null===(P=null===(I=null==fe?void 0:fe.summarizedTab)||void 0===I?void 0:I.chip)||void 0===P?void 0:P.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(H=null==fe?void 0:fe.summarizedTab)||void 0===H?void 0:H.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(V=null==fe?void 0:fe.detailedTab)||void 0===V?void 0:V.chip))],secondaryActions:fe.secondaryActions?null==fe?void 0:fe.secondaryActions(Ze):Ze},{children:l.jsxs("div",e.__assign({ref:Me,style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(M=null==fe?void 0:fe.slotStyles)||void 0===M?void 0:M.chatDataContainer)},{children:[(null===(W=null===(N=null==fe?void 0:fe.detailedTab)||void 0===N?void 0:N.chip)||void 0===W?void 0:W.isActive)&&l.jsx("div",e.__assign({ref:Ve,style:{position:(null==be?void 0:be.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(Y=fe.chatData)&&void 0!==Y?Y:[],assistantChatProps:e.__assign(e.__assign({},null===(K=null===(O=null==fe?void 0:fe.detailedTab)||void 0===O?void 0:O.view)||void 0===K?void 0:K.assistantChatProps),{renderers:null!==(G=null===(U=null===(Q=null==fe?void 0:fe.detailedTab)||void 0===Q?void 0:Q.detailedViewRenderer)||void 0===U?void 0:U.assistantText)&&void 0!==G?G:Ne}),userChatItemProps:e.__assign(e.__assign({},null===(L=null===(J=null==fe?void 0:fe.detailedTab)||void 0===J?void 0:J.view)||void 0===L?void 0:L.userChatItemProps),{renderers:null!==($=null===(Z=null===(X=null==fe?void 0:fe.detailedTab)||void 0===X?void 0:X.detailedViewRenderer)||void 0===Z?void 0:Z.userText)&&void 0!==$?$:Ne})})})),(null===(le=null===(ee=null==fe?void 0:fe.summarizedTab)||void 0===ee?void 0:ee.chip)||void 0===le?void 0:le.show)&&(null===(oe=null===(ie=null==fe?void 0:fe.summarizedTab)||void 0===ie?void 0:ie.chip)||void 0===oe?void 0:oe.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(ne=fe.chatData)&&void 0!==ne?ne:[]},null===(te=null==fe?void 0:fe.summarizedTab)||void 0===te?void 0:te.view,{renderer:null!==(de=null===(re=null==fe?void 0:fe.summarizedTab)||void 0===re?void 0:re.summarizedViewRenderer)&&void 0!==de?de:Ne}))]}))}))}))]}));return we?l.jsx(i.default,e.__assign({title:null==ce?void 0:ce.title,slotStyles:{title:null===(se=null==ce?void 0:ce.slotStyles)||void 0===se?void 0:se.title,body:null===(ae=null==ce?void 0:ce.slotStyles)||void 0===ae?void 0:ae.body},containerStyles:null===(ue=null==ce?void 0:ce.slotStyles)||void 0===ue?void 0:ue.container,icon:null!==(ve=null==ce?void 0:ce.icon)&&void 0!==ve?ve:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==ce?void 0:ce.secondaryActions)?ce.secondaryActions(Je):Je},{children:$e})):$e};
|
|
2
2
|
//# sourceMappingURL=InternalChatCitationRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};exports.default=function(s){var t=s.title,o=void 0===t?"User Chat":t,l=s.icon,r=s.slotStyles,a=s.primaryActions,d=s.secondaryActions,c=s.children,_=s.containerStyles;return e.jsxs("div",i.__assign({style:i.__assign(i.__assign({},n.container),_)},{children:[e.jsxs("div",i.__assign({style:i.__assign(i.__assign({},n.headerRow),{overflowX:"auto",minHeight:"2.18rem",overflowY:"hidden",scrollbarWidth:"thin"})},{children:[e.jsxs("div",i.__assign({style:n.leftRow},{children:[e.jsxs("div",i.__assign({style:n.iconTitleRow},{children:[e.jsx("span",{children:l}),e.jsx("span",i.__assign({style:i.__assign(i.__assign({},n.titleText),null==r?void 0:r.title)},{children:o}))]})),e.jsx("div",i.__assign({style:n.actionsRow},{children:null==a?void 0:a.filter(function(i){return void 0!==i}).map(function(i,n){return e.jsx("span",{children:i},n)})}))]})),e.jsx("div",i.__assign({style:i.__assign(i.__assign({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==d?void 0:d.filter(function(i){return void 0!==i}).map(function(i,n){return e.jsx("span",{children:i},n)})}))]})),e.jsx("div",i.__assign({style:i.__assign(i.__assign({},n.body),null==r?void 0:r.body),id:"body"},{children:c}))]}))};
|
|
2
2
|
//# sourceMappingURL=ChatCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),i=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("./ScrollLockToggle.js"),d=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(o),p=u.default.memo(function(o){var c,p,x,g=o.section,f=o.idx,v=s.useCompareContext(),h=v.maintainRelativeOrder;v.existingSections;var m=v.proposedSections,b=v.connectedSections,S=v.expandedSections,B=v.displayConfig,j=v.treeData;v.deviationNumberRegistry;var _=v.getSectionCompareStyle;v.getBadgeRef;var y=v.getSectionRowRef,R=v.sectionRightRefs,I=v.rhsBadgeRefs,w=v.openMoreFunctionsPopup,C=v.handleOpenSummaryPopup,N=v.handleCloseSummaryPopup,k=v.toggleSection;v.showDeviationBadges,v.renderSubSectionAccordion,v.isProposingFix,v.proposingFixNodeId,v.isRedlineFlow;var q=v.isSideBySide,T=v.activeSideBySideSection,P=v.scrollSyncLocked,D=v.toggleScrollSyncLocked,z=v.summaryPopupAnchorEl;v.deviationNodeIdToView,v.deviationTargetParentId;var F=v.showDeviationNavigation;v.showOpenNodeRef,v.resolvedMarkdownStyles;var L=v.unifiedNumbering,M=g,O=!1,A=null,E=-1;if(h){E=m.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(M.selfIndex))&&e.selfIndex>=0});var V=m.findIndex(function(e,n){var o;return b.has(n)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(M.selfIndex))});(O=-1!==V)&&(A=_(V,"left"))}else(O=b.has(f))&&(A=_(f,"right"));var W=h&&-1!==E?_(E,"left"):_(f,"right"),K=h?-1!==E||!(null===(c=M.refIndexes)||void 0===c?void 0:c.length)&&m.some(function(e){return e.id&&e.id===M.id}):Boolean(m[f]),X=h?M.selfIndex<0||!K:!m[f],Y=u.default.useMemo(function(){var e=L.rightNums.get(M.id);return h&&M.id?d.getRhsMappedSectionNumber({section:M,proposedSections:m,leftNums:L.leftNums,fallbackNumber:e}):e},[h,m,M.id,M.selfIndex,L]),G=null===(p=I.current[f])||void 0===p?void 0:p.current,H=O||q&&(T===f||T===E)||!!z&&z===G;return n.jsx(i.Box,e.__assign({ref:y(f),sx:{mb:1,width:"100%"}},{children:n.jsx(i.Box,e.__assign({ref:R.current[f],sx:e.__assign({width:"100%",display:"flex"},O&&A&&{borderRadius:"6px",outline:"2px solid ".concat(A.badgeBorder),outlineOffset:"1px"})},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(r.default,{section:g,idx:f,columnKey:"right",colRef:y("right-accordion-".concat(f)),mb:0,parentNodeId:(null===(x=null==j?void 0:j.input_index_map)||void 0===x?void 0:x[1])||"",isExpanded:h?!!S["right-".concat(f)]:!!S[String(f)],onToggle:function(){N(),k(f,"right")},navigation:g.id?F[g.id]:null}),h&&W&&n.jsx(i.Box,e.__assign({ref:I.current[f],"data-section-id":M.id,onClick:function(e){var n,o,i;if(X){var t=B.enableDeviationSchemaBackwardCompatibility?null!==(n=M.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=M.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;C(e,String(f),X,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:X?"4px":"0px",fontSize:"11px",bgcolor:W.badgeBg,color:W.badgeText,border:"1px solid ".concat(W.badgeBorder),borderRadius:X?"12px":"10px",px:X?1.2:1,py:.3,fontWeight:X?600:700,cursor:X?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:X?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:X?n.jsxs(n.Fragment,{children:[n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){var n,o,i;e.stopPropagation();var t=B.enableDeviationSchemaBackwardCompatibility?null!==(n=M.evaluationResult)&&void 0!==n?n:null:null!==(i=null===(o=M.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==i?i:null;C(e,String(f),X,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(W.badgeBorder),"&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[null!=Y&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(W.badgeBorder)}},{children:Y})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!B.isLoading||null!=M.evaluationResult&&void 0!==M.evaluationResult?W.label?"".concat(W.label):"100% Deviation":n.jsx(a.default,{color:W.badgeText})}))]})),n.jsxs(i.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var n=h?m.find(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(M.selfIndex)})||{title:"",content:""}:m[f]||{title:"",content:""};w(e,n,X,M,f,W)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(W.badgeBorder,"22")}}},{children:[n.jsx(t.EllipsisVertical,{size:11,color:W.badgeText}),H&&n.jsx(l.default,{locked:P,onToggle:D,color:W.badgeText,borderColor:W.badgeBorder,size:11})]}))]}):n.jsx(n.Fragment,{children:n.jsx(i.Box,e.__assign({component:"span",sx:{px:.2}},{children:null!=Y?Y:""}))})}))]}))}))}),"right-row-".concat(f))});exports.default=p;
|
|
2
2
|
//# sourceMappingURL=RHSSectionRow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=new Set(["DONE","COMPLETED","FAILED"])
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=new Set(["DONE","COMPLETED","FAILED"]);var n=new Map;function r(e,t,r){t.listeners.delete(r),0===t.listeners.size&&n.get(e)===t&&(clearInterval(t.keepAliveInterval),t.ws.readyState!==WebSocket.OPEN&&t.ws.readyState!==WebSocket.CONNECTING||t.ws.close(),n.delete(e))}exports.useIngestionWebSocket=function(s,a){var o=e.useState(null),i=o[0],c=o[1],l=e.useState(!1),u=l[0],f=l[1],v=e.useState(null),d=v[0],S=v[1],p=e.useRef(null),E=e.useRef(null),g=e.useRef(s);e.useEffect(function(){g.current=s},[s]);var k=e.useCallback(function(){var e=g.current;e&&p.current&&E.current&&r(e,p.current,E.current),p.current=null,E.current=null,f(!1)},[]);return e.useEffect(function(){if(s){S(null);var e=function(e,r){if(!r||"string"!=typeof r||!r.trim())return console.error("useIngestionWebSocket: wsBaseUrl is missing or invalid; skipping connection."),null;var s=n.get(e);if(s&&s.ws.readyState!==WebSocket.CLOSED)return s;var a=new WebSocket("".concat(r.trim(),"/").concat(e)),o={ws:a,listeners:new Set,lastData:null,keepAliveInterval:setInterval(function(){a.readyState===WebSocket.OPEN&&a.send(JSON.stringify({type:"ping"}))},5e3)};return a.onmessage=function(r){var s;try{s=JSON.parse(r.data)}catch(e){return void o.listeners.forEach(function(e){return e(null,"Failed to parse WebSocket message")})}if(function(e){if(!e||"object"!=typeof e)return!1;var t=e;return"string"==typeof t.ingestionStatus&&"string"==typeof t.ingestionId}(s)){var i=s;o.lastData=i,o.listeners.forEach(function(e){return e(i,null)}),t.has(i.ingestionStatus.toUpperCase())&&(clearInterval(o.keepAliveInterval),a.close(),n.delete(e))}else o.listeners.forEach(function(e){return e(null,"Received malformed WebSocket payload")})},a.onerror=function(){o.listeners.forEach(function(e){return e(null,"WebSocket connection error")})},a.onclose=function(){clearInterval(o.keepAliveInterval),n.get(e)===o&&n.delete(e)},n.set(e,o),o}(s,a);if(!e)return S("Missing or invalid WebSocket base URL"),void f(!1);e.lastData&&c(e.lastData),f(e.ws.readyState===WebSocket.OPEN);var o=function(e,t){t?S(t):c(e)};e.listeners.add(o),p.current=e,E.current=o;var i=function(){return f(!0)},l=function(){return f(!1)};return e.ws.addEventListener("open",i),e.ws.addEventListener("close",l),function(){e.ws.removeEventListener("open",i),e.ws.removeEventListener("close",l),r(s,e,o),p.current=null,E.current=null}}},[s,a]),{data:i,connected:u,error:d,disconnect:k}};
|
|
2
2
|
//# sourceMappingURL=useIngestionStatus.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime");exports.default=function(t){var n=t.speed,o=void 0===n?200:n,s=t.color,a=void 0===s?"#5928ED":s,i=t.size,l=void 0===i?"1.2rem":i;return r.jsxs("span",e.__assign({style:{display:"inline-block",fontFamily:"monospace",color:a,fontSize:l,animation:"slashRotate ".concat(o,"ms linear infinite"),transformOrigin:"center center"}},{children:["/",r.jsx("style",{children:"\n @keyframes slashRotate {\n 0% { transform: rotate(0deg); }\n 25% { transform: rotate(90deg); }\n 50% { transform: rotate(180deg); }\n 75% { transform: rotate(270deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]}))};
|
|
2
|
+
//# sourceMappingURL=SlashLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlashLoader.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),i=require("react/jsx-runtime"),a=require("lucide-react"),e=require("dayjs"),n=require("../ScannedDocCitation/ScannedDocCitation.js"),o=require("../InstantLearningCitation/InstantLearningCitationComponent.js"),l=require("../InstantLearningCitation/SlashLoader.js"),r=require("../CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),u=require("../RequirementAiCitations/ImageCitation/ImageCitationContent.js"),s=require("../RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),c=require("../ChatCitation/ChatCitationRenderer.js");function d(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var v=d(e),m=function(t,i,a){if(!t)throw new Error("[CitationOrchestratorComponent] ".concat(i,': missing required field "').concat(a,'" in customMetaData'))},g=function(t,i){if(!Object.values(t).some(Boolean))throw new Error("[CitationOrchestratorComponent] ".concat(i,': missing one of "').concat(Object.keys(t).join('", "'),'" in customMetaData'))};exports.default=function(e){var d,_,h,C,D,f,p,M,x,b,j,I,w,S,q,R,k,y,T,P,L,U,O,z,A,E,F,W,B,G,X,H,N,$,J,K,Q,V,Y,Z,tt,it,at=e.href,et=e.citations,nt=e.children,ot=e.isStreaming,lt=e.onCitationToggle,rt=e.chatCitationConfig;if(ot)return i.jsxs("span",t.__assign({style:{display:"inline-flex",alignItems:"center",gap:"0.25rem",fontWeight:500,color:"#6D28D9"}},{children:[i.jsx("span",{children:nt}),i.jsx(l.default,{})]}));try{var ut=new URL(at,"http://example.com"),st=ut.searchParams.get("citationNumber"),ct=ut.searchParams.get("decisionStrength");if(!st)return null;var dt=(null==et?void 0:et.find(function(t){var i;return String(null===(i=null==t?void 0:t.customMetaData)||void 0===i?void 0:i.citation_number)===st}))||null;if(!dt)return null;var vt=(null===(d=null==dt?void 0:dt.customMetaData)||void 0===d?void 0:d.citation_type)||((null===(_=dt.customMetaData)||void 0===_?void 0:_.type)||"").replace(/s$/,"");if("scanned_doc_citation"===vt){var mt=null==dt?void 0:dt.customMetaData.value;if(null==mt?void 0:mt.length)return i.jsx(n.default,{pages:mt,subHeadingText:dt.customMetaData.artifact_title});m(null===(h=null==dt?void 0:dt.customMetaData)||void 0===h?void 0:h.gs_url,"scanned_doc_citation","gs_url");var gt=[null===(C=null==dt?void 0:dt.customMetaData)||void 0===C?void 0:C.gs_url],_t=(null!==(D=dt.customMetaData.highlighted_coordinates)&&void 0!==D?D:[]).map(function(t,i){return{pageIndex:i,bboxes:[t]}});return i.jsx(n.default,{images:gt,highlights:_t})}if("IL"===vt){m(dt.customMetaData.il_learning,"IL","il_learning");var ht=nt||(null===(f=dt.customMetaData)||void 0===f?void 0:f.link_text)||(null===(p=dt.customMetaData)||void 0===p?void 0:p.citation_source)||String(null!==(M=dt.customMetaData.citation_number)&&void 0!==M?M:1);return i.jsx(o.default,{citation:dt,linkTitle:ht,onCitationToggle:null!=lt?lt:function(){},decisionStrengthFromUrl:ct||(null===(x=dt.customMetaData)||void 0===x?void 0:x.decision_strength)||""})}if("chat_citation"===vt){var Ct=null!=rt?rt:{},Dt=null===(I=null!==(j=null===(b=null==dt?void 0:dt.customMetaData)||void 0===b?void 0:b.chat_data)&&void 0!==j?j:[])||void 0===I?void 0:I.map(function(i){return t.__assign(t.__assign({},i),{timeStamp:v.default(i.timeStamp)})}),ft=!!(null===(w=null==dt?void 0:dt.customMetaData)||void 0===w?void 0:w.rule_book_content);return i.jsx(c.default,{showRootContainer:null===(S=Ct.showRootContainer)||void 0===S||S,reversePanels:Ct.reversePanels,isRenderedCustomComponent:Ct.isRenderedCustomComponent,modalContainerStyle:Ct.modalContainerStyle,additionalData:Ct.additionalData,closePreview:Ct.closePreview,selectedIdFromReason:null!==(q=Ct.selectedIdFromReason)&&void 0!==q?q:void 0,rootContainer:t.__assign(t.__assign({},Ct.rootContainer),{relevanceScore:dt.customMetaData.relevance_score}),chatContainer:t.__assign(t.__assign({},Ct.chatContainer),{chatData:Dt,summarizedTab:null!==(k=null===(R=Ct.chatContainer)||void 0===R?void 0:R.summarizedTab)&&void 0!==k?k:{chip:{isActive:!0,show:!0}},detailedTab:null!==(T=null===(y=Ct.chatContainer)||void 0===y?void 0:y.detailedTab)&&void 0!==T?T:{chip:{isActive:!1}}}),ruleBookContainer:ft?t.__assign(t.__assign({},Ct.ruleBookContainer),{data:{content:dt.customMetaData.rule_book_content,highlighted_texts:null!==(P=dt.customMetaData.rule_book_highlights)&&void 0!==P?P:[]}}):void 0})}if("gpt_citation"===vt){var pt=null===(L=dt.customMetaData)||void 0===L?void 0:L.value,Mt=null!==(U=null==pt?void 0:pt.text)&&void 0!==U?U:null===(z=null===(O=dt.customMetaData)||void 0===O?void 0:O.data_sources)||void 0===z?void 0:z[0],xt=null!==(A=null==pt?void 0:pt.label)&&void 0!==A?A:null===(F=null===(E=dt.customMetaData)||void 0===E?void 0:E.training_data_title)||void 0===F?void 0:F[0],bt=null!==(W=null==pt?void 0:pt.paraphrase)&&void 0!==W?W:null===(G=null===(B=dt.customMetaData)||void 0===B?void 0:B.paraphrase)||void 0===G?void 0:G[0];return g({data_sources:Mt,training_data_title:xt},"gpt_citation"),i.jsx(r.default,{item:{text:"",dataSource:Mt,trainingDataTitle:xt,paraphrase:bt},headerTitle:"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:a.ChevronDown,ChevronUpIcon:a.ChevronUp,MaximizeIcon:a.Maximize2,CloseIcon:a.X}})}if("web_citation"===vt){!function(t,i,a){m(t,i,a);try{new URL(t)}catch(e){throw new Error("[CitationOrchestratorComponent] ".concat(i,': "').concat(a,'" is not a valid URL: "').concat(t,'"'))}}(null===(X=dt.customMetaData)||void 0===X?void 0:X.link,"web_citation","link");var jt=dt.customMetaData.link,It=nt||(null===(H=dt.customMetaData)||void 0===H?void 0:H.citation_source)||jt;return(null===(N=dt.customMetaData)||void 0===N?void 0:N.screenshot_url)?i.jsx(s.default,{url:jt,label:It,gsUtilPath:null===($=dt.customMetaData)||void 0===$?void 0:$.gs_util_path,signedUrl:null===(J=dt.customMetaData)||void 0===J?void 0:J.screenshot_url,relevanceScore:null===(K=dt.customMetaData)||void 0===K?void 0:K.relevance_score,visitIcon:a.ExternalLink,PreviewDialogCloseIcon:a.X}):i.jsx("a",t.__assign({href:jt,target:"_blank",rel:"noreferrer"},{children:It}))}if("image_citation"===vt)return g({gs_util_path:null===(Q=dt.customMetaData)||void 0===Q?void 0:Q.gs_util_path,signed_url:null===(V=dt.customMetaData)||void 0===V?void 0:V.signed_url},"image_citation"),i.jsx(u.default,{citationTitle:nt||(null===(Y=dt.customMetaData)||void 0===Y?void 0:Y.citation_source),gsUtilPath:null===(Z=dt.customMetaData)||void 0===Z?void 0:Z.gs_util_path,signedUrl:null===(tt=dt.customMetaData)||void 0===tt?void 0:tt.signed_url,relevanceScore:null===(it=dt.customMetaData)||void 0===it?void 0:it.relevance_score})}catch(t){return console.error(t),null}return null};
|
|
2
|
+
//# sourceMappingURL=ParentCitationComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParentCitationComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Editor/constants/editorConfig.js"),n=require("./Editor/Editor.js"),a=require("../../store/ref.context.js"),o=require("@lexical/html"),l=require("turndown"),s=require("turndown-plugin-gfm"),i=require("../UnsavedChangesPopup/UnsavedChangesPopup.js"),c=require("../../../../utils/tagHelper.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=new(u(l).default)({headingStyle:"atx",codeBlockStyle:"fenced"}),p=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");d.keep(["ins","del","mark"]),d.addRule("ai-reasoning-link-passthrough",{filter:e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r},replacement:(e,t)=>{const r=t,n=r.getAttribute("href")||"",a=r.textContent||"";return`<a href="${o=n,p(o).replace(/"/g,""")}">${p(a)}</a>`;var o}}),d.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),d.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),d.use(s.tables);const h=e=>(e||"").replace(/\r\n/g,"\n").trim(),g=t.forwardRef(({type:l,value:s,handleUpdateState:u,onBlur:p,placeholder:g,minHeight:f,height:m,mode:E,doNotShowBorderInViewMode:v,onEditBlocked:S,onSaveUnsavedChanges:A,onDiscardUnsavedChanges:$,isSavingUnsavedChanges:y=!1},b)=>{const w=t.useRef(null),[x,C]=t.useState({type:l,value:s}),[q,N]=t.useState(0),[R,T]=t.useState(!1),_=t.useRef(s),B=t.useRef(s),j=t.useRef(Boolean(s)),{contentRef:I,setContentRef:L}=a.useRefStore();t.useEffect(()=>{C(e=>({...e,value:s})),_.current=s,B.current=s,j.current=Boolean(s),T(!1)},[s]),t.useImperativeHandle(b,()=>({requestClose:()=>!("edit"===E&&h(_.current)!==h(B.current))||(T(!0),!1)}),[E]);return t.useEffect(()=>{const e=()=>{I&&I.current&&N(I.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[I]),e.jsxs("div",{style:{position:"relative",width:"100%",height:m,minHeight:f},children:[R&&e.jsx(i.UnsavedChangesPopup,{isSaving:y,onSave:async()=>{await(null==A?void 0:A()),_.current=B.current,T(!1)},onDiscard:()=>{B.current=_.current,null==$||$(),T(!1)}}),e.jsx(n.default,{minHeight:f,height:m,placeholder:g||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=o.$generateHtmlFromNodes(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,"")),e.removeAttribute("class"),e.textContent=e.textContent||""})(e)});const n=["upt","manual","ins","del","preserved"];function a(e,t){const r=e.cloneNode(!0),o=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${o.size}%%`;o.set(n,a(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);o.forEach((e,t)=>{l=l.replace(t,e)});const s=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),i=e.tagName.toLowerCase();return s?`<${i} ${s}>${l}</${i}>`:`<${i}>${l}</${i}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const l=[];r.querySelectorAll("invisible").forEach((e,t)=>{l.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const s=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{s.push(a(e,d)),e.replaceWith(r.createTextNode(`%%REVIEW_${s.length-1}%%`))})});const i=[];r.querySelectorAll("table").forEach((e,t)=>{i.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let p=d.turndown(r.body.innerHTML);for(let e=s.length-1;e>=0;e--)p=p.replace(`%%REVIEW\\_${e}%%`,` ${s[e]} `);l.forEach((e,t)=>{p=p.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),i.forEach((e,t)=>{p=p.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),p=p.replace(/\*{4}([^*]+)\*{4}/g,"**$1**"),p=p.replace(/\s+class="PlaygroundEditorTheme__[^"]*"/g,""),p=p.replace(/<span\s+style="white-space:\s*pre-wrap;?">([\s\S]*?)<\/span>/g,"$1"),p=p.replace(/\s+style="white-space:\s*pre-wrap;?"/g,""),p=p.replace(/<b>\s*<strong>([\s\S]*?)<\/strong>\s*<\/b>/g,"<strong>$1</strong>");["upt","manual","del","ins","preserved"].forEach(e=>{p=c.mergeTagAcrossParagraphs(p,e)}),p=c.unescapeTagIds(p,["manual","upt"]),j.current&&(_.current=p,j.current=!1),B.current=p,((e,t)=>{u(e,t)})("prompt",p)})},toolbarConfig:r.DEFAULT_TOOLBAR_CONFIG,editorRef:w,mode:E,initialString:{type:x.type,value:x.value},dynamicHeight:q,onBlur:p,doNotShowBorderInViewMode:v||!1,onEditBlocked:S})]})});g.displayName="RichTextEditor",exports.default=g;
|
|
2
2
|
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("lucide-react"),a=require("./ClinicalTrialSection.module.css.js");exports.default=({title:s,note:n="This content is provided by the scientific team and not generated from uploaded documents.",fields:t,value:i,readonly:d=!0,isSaving:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("lucide-react"),a=require("./ClinicalTrialSection.module.css.js");exports.default=({title:s,note:n="This content is provided by the scientific team and not generated from uploaded documents.",fields:t,value:i,readonly:d=!0,isSaving:r=!1,styles:u,onChange:o,onSave:c,onCancel:m})=>{const v=(e,l)=>{d||null==o||o({...i,[e]:l})},y=t.find(e=>"summary"===e.key),x=t.filter(e=>"summary"!==e.key),f=t.some(e=>{var l;return(null!==(l=i[e.key])&&void 0!==l?l:"").trim().length>0});return e.jsxs("div",{className:a.default.container,style:null==u?void 0:u.container,children:[e.jsxs("div",{className:a.default.noteContainer,style:null==u?void 0:u.noteContainer,children:[e.jsx(l.Info,{size:18,className:a.default.noteIcon,style:null==u?void 0:u.noteIcon}),e.jsxs("span",{className:a.default.noteText,style:null==u?void 0:u.noteText,children:[e.jsx("strong",{children:"Note:"})," ",n]})]}),d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default.fieldsRow,style:null==u?void 0:u.fieldsRow,children:x.map(l=>e.jsxs("div",{className:a.default.field,style:null==u?void 0:u.field,children:[e.jsx("label",{className:a.default.label,style:null==u?void 0:u.label,children:l.label}),e.jsx("div",{className:a.default.readonlyValue,style:null==u?void 0:u.readonlyValue,children:i[l.key]||"-"})]},l.key))}),y&&e.jsxs("div",{className:a.default.field,style:null==u?void 0:u.field,children:[e.jsx("label",{className:a.default.label,style:null==u?void 0:u.label,children:y.label}),e.jsx("div",{className:a.default.readonlySummary,style:null==u?void 0:u.readonlySummary,children:i.summary||"-"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default.fieldsRow,style:null==u?void 0:u.fieldsRow,children:x.map(l=>{var s;return e.jsxs("div",{className:a.default.field,style:null==u?void 0:u.field,children:[e.jsx("label",{className:a.default.label,style:null==u?void 0:u.label,children:l.label}),"select"===l.type?e.jsxs("select",{className:a.default.input,style:null==u?void 0:u.input,value:i[l.key]||"",onChange:e=>v(l.key,e.target.value),children:[e.jsxs("option",{value:"",children:["Select ",l.label]}),null===(s=l.options)||void 0===s?void 0:s.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))]}):e.jsx("input",{className:a.default.input,style:null==u?void 0:u.input,placeholder:l.placeholder,value:i[l.key]||"",onChange:e=>v(l.key,e.target.value)})]},l.key)})}),y&&e.jsx("div",{className:a.default.summaryContainer,style:null==u?void 0:u.summaryContainer,children:e.jsx("textarea",{className:a.default.summaryTextarea,style:null==u?void 0:u.summaryTextarea,placeholder:(null==y?void 0:y.placeholder)||"Add section summary here",value:i.summary||"",onChange:e=>v("summary",e.target.value)})}),e.jsxs("div",{className:a.default.actionBar,style:null==u?void 0:u.actionBar,children:[e.jsxs("button",{type:"button",className:a.default.cancelButton,style:null==u?void 0:u.cancelButton,onClick:m,children:[e.jsx(l.X,{size:18}),e.jsx("span",{children:"Cancel"})]}),e.jsx("button",{type:"button",className:a.default.saveButton,style:null==u?void 0:u.saveButton,onClick:c,disabled:r||!f,children:r?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:18,className:a.default.spinner,style:null==u?void 0:u.spinner}),e.jsx("span",{children:"Saving..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Save,{size:18}),e.jsx("span",{children:"Save"})]})})]})]})]})};
|
|
2
2
|
//# sourceMappingURL=ClinicalTrialSection.js.map
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/ClinicalTrialSection.module.css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode(".ClinicalTrialSection-module_container__oXyDo{display:flex;flex-direction:column;gap:20px;padding:20px;width:100%}.ClinicalTrialSection-module_noteContainer__fjKfZ{align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;display:flex;gap:8px;padding:12px 16px}.ClinicalTrialSection-module_noteIcon__uO955{color:#6b7280;flex-shrink:0}.ClinicalTrialSection-module_noteText__ZNtmw{color:#4b5563;font-size:14px;line-height:20px}.ClinicalTrialSection-module_fieldsRow__S5DzE{display:flex;gap:24px;width:100%}.ClinicalTrialSection-module_field__KuTr6{display:flex;flex:1;flex-direction:column}.ClinicalTrialSection-module_label__xPB0g{color:#111827;font-size:14px;font-weight:600;line-height:20px;margin-bottom:8px}.ClinicalTrialSection-module_input__nGvpX{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;height:48px;outline:none;padding:0 16px;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_input__nGvpX::placeholder{color:#9ca3af}.ClinicalTrialSection-module_input__nGvpX:focus{border-color:#3b82f6}.ClinicalTrialSection-module_summaryContainer__kdXAi{width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;line-height:20px;min-height:150px;outline:none;padding:16px;resize:vertical;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd::placeholder{color:#9ca3af}.ClinicalTrialSection-module_summaryTextarea__QbEXd:focus{border-color:#3b82f6}.ClinicalTrialSection-module_actionBar__V8LoA{align-items:center;display:flex;gap:24px;justify-content:flex-end;margin-top:20px}.ClinicalTrialSection-module_cancelButton__GsyN4{align-items:center;background:#0000;border:none;color:#ef4444;cursor:pointer;display:flex;font-size:16px;font-weight:500;gap:6px}.ClinicalTrialSection-module_cancelButton__GsyN4:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo{align-items:center;background:#0000;border:none;color:#4f46e5;cursor:pointer;display:flex;font-size:16px;font-weight:600;gap:6px}.ClinicalTrialSection-module_saveButton__P5AIo:hover{opacity:.8}.ClinicalTrialSection-module_readonlyValue__31toE{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;display:flex;font-size:14px;line-height:20px;min-height:48px;padding:0 16px}.ClinicalTrialSection-module_readonlySummary__WF5q6{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;font-size:14px;line-height:22px;min-height:150px;padding:16px;white-space:pre-wrap;word-break:break-word}.ClinicalTrialSection-module_spinner__AL39r{animation:ClinicalTrialSection-module_spin__kH9hF 1s linear infinite}@keyframes ClinicalTrialSection-module_spin__kH9hF{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"ClinicalTrialSection-module_container__oXyDo",noteContainer:"ClinicalTrialSection-module_noteContainer__fjKfZ",noteIcon:"ClinicalTrialSection-module_noteIcon__uO955",noteText:"ClinicalTrialSection-module_noteText__ZNtmw",fieldsRow:"ClinicalTrialSection-module_fieldsRow__S5DzE",field:"ClinicalTrialSection-module_field__KuTr6",label:"ClinicalTrialSection-module_label__xPB0g",input:"ClinicalTrialSection-module_input__nGvpX",summaryContainer:"ClinicalTrialSection-module_summaryContainer__kdXAi",summaryTextarea:"ClinicalTrialSection-module_summaryTextarea__QbEXd",actionBar:"ClinicalTrialSection-module_actionBar__V8LoA",cancelButton:"ClinicalTrialSection-module_cancelButton__GsyN4",saveButton:"ClinicalTrialSection-module_saveButton__P5AIo",readonlyValue:"ClinicalTrialSection-module_readonlyValue__31toE",readonlySummary:"ClinicalTrialSection-module_readonlySummary__WF5q6",spinner:"ClinicalTrialSection-module_spinner__AL39r",spin:"ClinicalTrialSection-module_spin__kH9hF"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const i=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;i&&e.setAttribute("nonce",i),e.appendChild(document.createTextNode(".ClinicalTrialSection-module_container__oXyDo{display:flex;flex-direction:column;gap:20px;padding:20px;width:100%}.ClinicalTrialSection-module_noteContainer__fjKfZ{align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;display:flex;gap:8px;padding:12px 16px}.ClinicalTrialSection-module_noteIcon__uO955{color:#6b7280;flex-shrink:0}.ClinicalTrialSection-module_noteText__ZNtmw{color:#4b5563;font-size:14px;line-height:20px}.ClinicalTrialSection-module_fieldsRow__S5DzE{display:flex;gap:24px;width:100%}.ClinicalTrialSection-module_field__KuTr6{display:flex;flex:1;flex-direction:column}.ClinicalTrialSection-module_label__xPB0g{color:#111827;font-size:14px;font-weight:600;line-height:20px;margin-bottom:8px}.ClinicalTrialSection-module_input__nGvpX{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;height:48px;outline:none;padding:0 16px;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_input__nGvpX::placeholder{color:#9ca3af}.ClinicalTrialSection-module_input__nGvpX:focus{border-color:#3b82f6}.ClinicalTrialSection-module_summaryContainer__kdXAi{width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd{background:#fff;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;color:#111827;font-size:14px;line-height:20px;min-height:150px;outline:none;padding:16px;resize:vertical;transition:border-color .2s ease;width:100%}.ClinicalTrialSection-module_summaryTextarea__QbEXd::placeholder{color:#9ca3af}.ClinicalTrialSection-module_summaryTextarea__QbEXd:focus{border-color:#3b82f6}.ClinicalTrialSection-module_actionBar__V8LoA{align-items:center;display:flex;gap:24px;justify-content:flex-end;margin-top:20px}.ClinicalTrialSection-module_cancelButton__GsyN4{align-items:center;background:#0000;border:none;color:#ef4444;cursor:pointer;display:flex;font-size:16px;font-weight:500;gap:6px}.ClinicalTrialSection-module_cancelButton__GsyN4:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo{align-items:center;background:#0000;border:none;color:#4f46e5;cursor:pointer;display:flex;font-size:16px;font-weight:600;gap:6px}.ClinicalTrialSection-module_saveButton__P5AIo:hover{opacity:.8}.ClinicalTrialSection-module_saveButton__P5AIo:disabled{color:#9ca3af;cursor:not-allowed;opacity:.6;pointer-events:none}.ClinicalTrialSection-module_saveButton__P5AIo:disabled:hover{opacity:.6}.ClinicalTrialSection-module_readonlyValue__31toE{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;display:flex;font-size:14px;line-height:20px;min-height:48px;padding:0 16px}.ClinicalTrialSection-module_readonlySummary__WF5q6{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;color:#111827;font-size:14px;line-height:22px;min-height:150px;padding:16px;white-space:pre-wrap;word-break:break-word}.ClinicalTrialSection-module_spinner__AL39r{animation:ClinicalTrialSection-module_spin__kH9hF 1s linear infinite}@keyframes ClinicalTrialSection-module_spin__kH9hF{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"ClinicalTrialSection-module_container__oXyDo",noteContainer:"ClinicalTrialSection-module_noteContainer__fjKfZ",noteIcon:"ClinicalTrialSection-module_noteIcon__uO955",noteText:"ClinicalTrialSection-module_noteText__ZNtmw",fieldsRow:"ClinicalTrialSection-module_fieldsRow__S5DzE",field:"ClinicalTrialSection-module_field__KuTr6",label:"ClinicalTrialSection-module_label__xPB0g",input:"ClinicalTrialSection-module_input__nGvpX",summaryContainer:"ClinicalTrialSection-module_summaryContainer__kdXAi",summaryTextarea:"ClinicalTrialSection-module_summaryTextarea__QbEXd",actionBar:"ClinicalTrialSection-module_actionBar__V8LoA",cancelButton:"ClinicalTrialSection-module_cancelButton__GsyN4",saveButton:"ClinicalTrialSection-module_saveButton__P5AIo",readonlyValue:"ClinicalTrialSection-module_readonlyValue__31toE",readonlySummary:"ClinicalTrialSection-module_readonlySummary__WF5q6",spinner:"ClinicalTrialSection-module_spinner__AL39r",spin:"ClinicalTrialSection-module_spin__kH9hF"};
|
|
2
2
|
//# sourceMappingURL=ClinicalTrialSection.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("react"),n=require("./ResizableSplitPane.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("react"),n=require("./ResizableSplitPane.js"),o=require("../icons/PdfViewerIcons.js"),t=require("@e-llm-studio/citation");const r=({href:i,metaData:o,citationTitle:r,isFullscreen:d})=>{var a,s,u,c,p,v;const h=l.useMemo(()=>{var e;return null===(e=(Array.isArray(null==o?void 0:o.citations)?o.citations:[]).find(e=>`pdf_citation$${e.id}`===i))||void 0===e?void 0:e.data},[i,null==o?void 0:o.citations]);if(!h)return null;const g=(null===(a=null==o?void 0:o.docData)||void 0===a?void 0:a.documents)||{},x=(null===(s=null==o?void 0:o.docData)||void 0===s?void 0:s.input_index_map)||{},f=null==x?void 0:x[0],m=null==x?void 0:x[1],y=f?g[f]:null,j=m?g[m]:null,b=f?h[f]:null,C=m?h[m]:null;if(["Contract","clause"].includes(r)){const i=b?e.jsx(t.PdfViewer,{pdfName:null==y?void 0:y.title,pdfUrl:null==y?void 0:y.signed_url,highlightText:[null!==(u=null==b?void 0:b.highlighted_text)&&void 0!==u?u:""],highlightPages:{1:null===(c=null==b?void 0:b.custom_metadata)||void 0===c?void 0:c.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1}):null,l=C?e.jsx(t.PdfViewer,{pdfName:null==j?void 0:j.title,pdfUrl:null==j?void 0:j.signed_url,jumpToPageValue:1,highlightText:[null!==(p=null==C?void 0:C.highlighted_text)&&void 0!==p?p:""],highlightPages:{1:null===(v=null==C?void 0:C.custom_metadata)||void 0===v?void 0:v.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1}):null;return b||C?e.jsx("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:e.jsx(n.default,{leftComponent:i,rightComponent:l,isFullscreen:d})}):e.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return e.jsx("div",{children:"No Citation Found. Please try again later"})};exports.default=({href:n,children:t,metaData:d,chevronUpComponent:a=null,chevronDownComponent:s=null,customStyle:u={},defaultState:c=!1})=>{var p,v,h;const[g,x]=l.useState(c),[f,m]=l.useState(!1),y="string"==typeof t&&(null===(p=null==t?void 0:t.split("\n"))||void 0===p?void 0:p.length)>1?t.split("\n").join(" "):t,j="string"==typeof t?t:t[0],b=null!=a?a:(l=>{var n,o;return e.jsx(i.ChevronUp,{size:null!==(n=null==l?void 0:l.fontSize)&&void 0!==n?n:16,color:null!==(o=null==l?void 0:l.color)&&void 0!==o?o:"rgb(214, 51, 132)"})})(null!==(v=null==u?void 0:u.arrow)&&void 0!==v?v:{}),C=null!=s?s:(l=>{var n,o;return e.jsx(i.ChevronDown,{size:null!==(n=null==l?void 0:l.fontSize)&&void 0!==n?n:16,color:null!==(o=null==l?void 0:l.color)&&void 0!==o?o:"rgb(214, 51, 132)"})})(null!==(h=null==u?void 0:u.arrow)&&void 0!==h?h:{}),_=l.useMemo(()=>(Array.isArray(null==d?void 0:d.citations)?d.citations:[]).some(e=>`pdf_citation$${e.id}`===n),[n,null==d?void 0:d.citations]);return["contract","clause"].includes(j)&&_?e.jsxs("span",{style:{display:"inline",...u.relativeWrapper||{}},children:[e.jsx("div",{style:{display:"inline",marginTop:0,...u.citationButtonWrapper||{}},children:e.jsxs("button",{type:"button",onClick:()=>x(e=>!e),style:{display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal",...u.citationButton||{}},children:[e.jsx("span",{children:y}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:g?b:C})]})}),g&&e.jsxs("div",{style:f?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"},children:[e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0},children:e.jsx("button",{onClick:()=>{m(e=>!e)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"},children:f?e.jsx(o.DefaultFullScreenCloseIcon,{}):e.jsx(o.DefaultFullScreenIcon,{})})}),e.jsx("div",{style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"},children:e.jsx(r,{href:n,children:t,metaData:d,citationTitle:j,isFullscreen:f})})]})]}):null};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),i=require("../Popups/PopupDefaults.js"),t=require("react-markdown"),c=require("rehype-raw"),n=require("./CitationComponent.module.css.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),i=require("../Popups/PopupDefaults.js"),t=require("react-markdown"),c=require("rehype-raw"),n=require("./CitationComponent.module.css.js"),s=require("lucide-react"),l=require("../icons/cognitiveBrain.svg.js"),d=require("../icons/aiMagic.svg.js"),r=require("./CitationAnchor.js"),o=require("../../ai-reasoning/AiReasonMarkdownWrapper.js"),u=require("../../../../../service/redlineService.js"),m=require("../../RequirementAIWrapper/RequirementAIWrapper.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=x(a),f=x(t),j=x(c);const h=({text:a,item:i})=>e.jsx(f.default,{rehypePlugins:[j.default],components:{ol:({children:a})=>e.jsx("ol",{className:n.default["md-ol"],children:a}),ul:({children:a})=>e.jsx("ul",{className:n.default["md-ul"],children:a}),li:({children:a})=>e.jsx("li",{className:n.default["md-li"],children:a}),a:({node:a,href:t,children:c})=>e.jsx(r.default,{href:t,children:c,metaData:{citations:i.citations,docData:i.docData}})},children:a.replace(/<br\s*\/?>/gi,"\n")}),_=({text:a,markdownStyles:i,citationStyles:t,customIcons:c})=>e.jsx(o.AiReasonMarkdownWrapper,{message:a.replace(/<br\s*\/?>/gi,"\n"),customStyles:i,citationStyles:t,customIcons:c});var v=a.memo(function({item:t,title:c="Cognitive Decisioning AI",relevanceScore:r=0,showRelevanceScore:o=!0,reason:x="No reasoning provided.",impact:f="No Impact provided.",explaination:j="No explaination provided.",gap:v="None",onClose:N=()=>{},onActionTrigger:y,showResolveBtns:b=!1,sections:g,leftIcon:I,scoreIcon:C,className:k,customStyles:A={},markdownStyles:R,citationStyles:S,customIcons:q,actions:w,disableAllActions:H=!1,actionBtnDisabledStyle:B={},onBackClick:D,isImpactNeeded:T=!0,cognitiveTitle:$="Cognitive Integrity",labels:M={},chatHistory:L,openInFullscreenOnClick:P=!1,redlineId:E,aiReasonId:F}){const U=a.useMemo(()=>{const e=Number(r);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[r]),W=a.useMemo(()=>{const e=M&&M.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a})(v)?e:v},[v]),G=M&&M.impact||"Impact",O=M&&M.explanation||"Explaination",z=M&&M.decisionFactors||"Decision Making Factors",J=M&&M.gaps||"Gaps in Decision",K=M&&M.accept||"Accept",Q=M&&M.reject||"Reject",V=M&&M.backAriaLabel||"Go back",{redlineDcoumentId:X,redlineConfig:Y,updateRedlineDataParent:Z}=m.useRequirementAI(),ee=async e=>{var a,i;null==y||y({status:"loading",action:e,metadata:{redlineId:E,aiReasonId:F}});try{const{updated_reqai:t}=await u.resolveRedline({documentId:X,userEmail:null==Y?void 0:Y.userEmail,userName:null==Y?void 0:Y.userName,redlineId:null!=E?E:"",action:e,baseApiUrl:null==Y?void 0:Y.baseApiUrl,redlineConfigId:null!==(a=null==Y?void 0:Y.redlineConfigId)&&void 0!==a?a:""},null!==(i=null==Y?void 0:Y.token)&&void 0!==i?i:"");await(null==Z?void 0:Z(t)),null==y||y({status:"success",action:e,metadata:{redlineId:E,aiReasonId:F}})}catch(a){null==y||y({status:"failed",action:e,metadata:{redlineId:E,aiReasonId:F}})}},ae=w||[{id:"reject",label:Q,onClick:()=>ee("reject"),className:n.default["btn-reject"]},{id:"accept",label:K,onClick:()=>ee("accept"),className:n.default["btn-accept"]}],ie=L&&L.length>0;return e.jsxs("div",{className:`${n.default["cite-acc"]} ${k||""}`,style:{...i.default.CitationAccordionDefaults.container,...null==A?void 0:A.container},children:[D&&e.jsxs("div",{className:n.default["cite-acc__backHeader"],children:[e.jsx("button",{type:"button",className:n.default["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),D&&D()},"aria-label":V,children:"‹"}),e.jsx("span",{className:n.default["cite-acc__backTitle"],children:$})]}),e.jsx("div",{className:n.default["cite-body"],children:g&&g.length>0?g.map(a=>!1===a.show?null:e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],style:{...i.default.CitationAccordionDefaults.innerHeader,...null==A?void 0:A.innerHeader},children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:a.title})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),N&&N()},children:e.jsx(s.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...i.default.CitationAccordionDefaults.innerBody,...null==A?void 0:A.innerBody},children:"string"==typeof a.content?e.jsx(h,{text:a.content,item:a.item||t||{}}):a.content})]},a.id||a.title)):e.jsxs(e.Fragment,{children:[T&&e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsxs("div",{className:n.default["cite-acc__innerHeader"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:G})})}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),N&&N()},children:e.jsx(s.ChevronUp,{})})]}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(h,{text:f||"",item:t||{}})})]}),j&&"No explaination provided."!==j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:O})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:e.jsx(h,{text:j||"",item:{}})})]}),e.jsx("div",{style:{borderTop:"1px solid #e5e7eb",margin:"12px 0"}}),b&&e.jsx("div",{className:n.default["cite-acc__btn-container"],children:ae.map(a=>{const i=H||a.disabled;return e.jsx("button",{className:a.className,onClick:i?void 0:a.onClick,disabled:i,style:{...a.style,...i?{opacity:.5,cursor:"not-allowed",...B,...a.disabledStyle}:{}},children:a.label},a.id)})})]}),e.jsxs("div",{className:n.default["cite-acc__header"],children:[e.jsxs("div",{className:n.default["cite-acc__headerLeft"],children:[e.jsx("span",{className:n.default["cite-acc__titleIcon"],children:I?"function"==typeof I?p.default.createElement(I):I:e.jsx(l.ReactComponent,{})}),e.jsx("div",{className:n.default["cite-acc__title"],children:c})]}),e.jsx("div",{className:n.default["cite-acc__headerRight"],children:o&&e.jsxs("span",{className:n.default["cite-acc__scoreBadge"],children:[C?"function"==typeof C?p.default.createElement(C):C:e.jsx(d.ReactComponent,{}),e.jsxs("span",{className:n.default["cite-acc__scoreText"],children:[U,"%"]})]})})]}),e.jsxs("div",{className:n.default["cite-acc__explain-body"],children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:z})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:ie?e.jsx(_,{text:x||"",markdownStyles:R,citationStyles:S,customIcons:q}):e.jsx(h,{text:x||"",item:t||{}})})]}),e.jsxs("div",{className:`${n.default["cite-acc__explain-body"]} ${n.default["cite-acc__explain-body_border"]}`,children:[e.jsx("div",{className:n.default["cite-acc__innerHeader"],children:e.jsx("div",{className:n.default["cite-acc__innerHeaderLeft"],children:e.jsx("div",{children:e.jsx("div",{className:n.default["cite-acc__innerTitle"],children:J})})})}),e.jsx("div",{className:`${n.default["cite-acc__innerBody"]} text-sm text-gray-600`,children:ie?e.jsx(_,{text:W||"",markdownStyles:R,citationStyles:S,customIcons:q}):e.jsx(h,{text:W||"",item:t||{}})})]})]})})]})},(e,a)=>e.disableAllActions===a.disableAllActions&&(e.redlineId===a.redlineId&&(e.aiReasonId===a.aiReasonId&&(e.relevanceScore===a.relevanceScore&&(e.reason===a.reason&&(e.impact===a.impact&&(e.explaination===a.explaination&&e.gap===a.gap)))))));exports.default=v;
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|