@viswa-test/test-citation 0.0.381 → 0.0.383
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/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js +2 -0
- package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CompareContext.js +1 -1
- package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
- package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js +2 -0
- package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
- package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
- package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
- 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 +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.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/UserStoryCard/cws/CwsEvent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.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/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
- 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/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/UserStoryWithCitation.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/helper.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/service/redlineService.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/features/CognitiveCompare/CitationRendererInner.js +2 -0
- package/dist/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/CompareContext.js +1 -1
- package/dist/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
- package/dist/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
- package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
- package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/href.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
- package/dist/features/CognitiveCompare/onDemandCitations/response.js +2 -0
- package/dist/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
- package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
- package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
- package/dist/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
- package/dist/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
- package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
- package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
- 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 +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.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/UserStoryCard/cws/CwsEvent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.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/citations/file-citation/FileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
- package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
- package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
- 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/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/UserStoryWithCitation.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/features/RequirementAI/utils/helpers.js +1 -1
- package/dist/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
- package/dist/features/SegmentReviewComponents/BoundaryCard.js +1 -1
- package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
- package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
- package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/features/SegmentReviewComponents/helper.js +1 -1
- package/dist/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
- package/dist/index.js +1 -1
- package/dist/service/redlineService.js +1 -1
- package/dist/types/src/CognitiveCompareTest.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/features/CognitiveCompare/CitationAnchor.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +8 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts +13 -0
- package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +12 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +12 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +9 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +3028 -891
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +14 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts +2 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts +10 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts +16 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts +7 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts +4 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts +134 -0
- package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts +2 -0
- package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +2 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +11 -0
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts +2 -0
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts +0 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +39 -29
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts +10 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts +17 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts +23 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts +3 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts.map +1 -0
- 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 +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +84 -5439
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +2 -2
- 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 +19 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +7 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +15 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts +3 -2
- 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.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts +12 -0
- package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +3 -2
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +3 -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 +2 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +2 -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/hooks/useStreamContentHandler.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +3 -0
- 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 +2 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/utils/helpers.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/proccess-stream.utils.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts +0 -6
- package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts +4 -2
- package/dist/types/src/features/SegmentReviewComponents/helper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts +1 -3
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +1 -2
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -1
- package/dist/types/src/service/redlineService.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
- package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
- package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js +0 -2
- package/dist/cjs/features/SegmentReviewComponents/reviewScore.js.map +0 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
- package/dist/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
- package/dist/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
- package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
- package/dist/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
- package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/infoAlert.js +0 -2
- package/dist/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
- package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
- package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
- package/dist/features/SegmentReviewComponents/reviewScore.js +0 -2
- package/dist/features/SegmentReviewComponents/reviewScore.js.map +0 -1
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts +0 -23
- package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts.map +0 -1
- package/dist/types/src/Background.d.ts +0 -7
- package/dist/types/src/Background.d.ts.map +0 -1
- package/dist/types/src/RedlineApprovalCardTest.d.ts +0 -1
- package/dist/types/src/RedlineApprovalCardTest.d.ts.map +0 -1
- package/dist/types/src/RedlineEditorTest2.d.ts +0 -3
- package/dist/types/src/RedlineEditorTest2.d.ts.map +0 -1
- package/dist/types/src/commonConstants.d.ts +0 -31103
- package/dist/types/src/commonConstants.d.ts.map +0 -1
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts +0 -2
- package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts.map +0 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +0 -128
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +0 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +0 -13
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts +0 -59
- package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts +0 -19
- package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts +0 -3
- package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts +0 -77
- package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts +0 -47
- package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts +0 -15
- package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts +0 -3
- package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts.map +0 -1
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts +0 -36
- package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts +0 -28
- package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts +0 -2
- package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts +0 -4
- package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts.map +0 -1
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts +0 -2
- package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ChevronRight"),r=require("@mui/icons-material/Close"),o=require("@mui/icons-material/ExpandMore"),a=require("@mui/material/Box"),s=require("@mui/material/Button"),l=require("@mui/material/ButtonBase"),d=require("@mui/material/Divider"),u=require("@mui/material/IconButton"),c=require("@mui/material/Paper"),x=require("@mui/material/Radio"),g=require("@mui/material/Stack"),f=require("@mui/material/TextField"),p=require("@mui/material/Typography"),h=require("./RevertSummaryNotice.js"),m=require("./CognitiveIcon.js"),_=require("./CognitiveScoreBadge.js"),b=require("../../assests/icons/InfoAlert.js");function E(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v,C=E(n),j=E(r),F=E(o),y=E(a),S=E(s),w=E(l),R=E(d),A=E(u),M=E(c),B=E(x),I=E(g),T=E(f),z=E(p),W=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)},k="MERGE_ADJACENT";exports.BoundaryReviewActionEnum=void 0,(v=exports.BoundaryReviewActionEnum||(exports.BoundaryReviewActionEnum={})).KEEP="KEEP",v.SPLIT_HERE="SPLIT_HERE",v.MERGE_NEXT="MERGE_NEXT",v.MERGE_PREV="MERGE_PREV",v.MERGE_PREVIOUS="MERGE_PREVIOUS",v.SET_RANGE="SET_RANGE";var P=function(e){return Object.values(exports.BoundaryReviewActionEnum).includes(e)},N=function(i,t,n,r){if(!t||!i)return[];var o=t.additional_decisions,a=Array.isArray(o)?o:o?Object.values(o).flat():[],s=Array.from(new Set(e.__spreadArray(e.__spreadArray([],t.allowed_decisions,!0),a,!0)));return s.flatMap(function(e){var t=i.focus_page,o=s.find(function(e){return e.toLowerCase().includes("merge")}),a=null!=t&&null!=n&&null!=r&&t===n&&t===r,l=null!=t&&null!=n&&t===n,d=null!=t&&null!=r&&(t===r||t===r+1),u=l||d||!(null!=t&&(!(null!=n&&null!=r)||t>n&&t<r));switch(e){case exports.BoundaryReviewActionEnum.SET_RANGE:return[];case"KEEP":return[{id:e,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:e,title:"Split to a separate document",description:u?"A valid page inside the document is required to split it.":t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary.",disabled:u}];case"MERGE_PREV":case"MERGE_NEXT":case"MERGE_PREVIOUS":return e!==o?[]:a?[{id:k,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]:l?[{id:exports.BoundaryReviewActionEnum.MERGE_PREVIOUS,title:"Merge with previous document",description:"Combine this document with the previous document."}]:d?[{id:exports.BoundaryReviewActionEnum.MERGE_NEXT,title:"Merge with next document",description:"Combine this document with the next document."}]:[{id:k,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]}return[]})};exports.createBoundaryCardOptions=N,exports.default=function(n){var r=n.headerName,o=void 0===r?"Boundary Check":r,a=n.title,s=n.pageNo,l=n.content,d=n.revertSummary,u=n.cognitiveScore,c=n.config,x=n.metadata,g=n.previousSegmentTitle,f=n.nextSegmentTitle,p=n.selectedIndex,E=n.defaultSelectedIndex,v=void 0===E?null:E,G=n.defaultStartPage,D=n.defaultEndPage,q=n.onSelectionChange,H=n.onConfirm,O=n.onActionConfirm,V=n.onCognitiveClick,L=n.onAdjustManually,U=n.onClose,X=n.confirmLabel,K=void 0===X?"Confirm":X,$=n.manualPrompt,J=void 0===$?"Didn't find the right option?":$,Y=n.manualActionLabel,Q=void 0===Y?"Adjust Manually":Y,Z=n.cognitiveLabel,ee=void 0===Z?"Cognitive Integrity":Z,ie=n.showAdjustManually,te=void 0===ie||ie,ne=n.showCognitiveIntegrity,re=void 0===ne||ne,oe=n.showCloseButton,ae=void 0===oe||oe,se=n.confirmDisabled,le=void 0!==se&&se,de=n.width,ue=void 0===de?260:de,ce=n.maxWidth,xe=void 0===ce?260:ce,ge=n.className,fe=n.styles,pe=n.reviewAction,he=n.totalPages;console.log("LOG: Total pages",he);var me=t.useMemo(function(){return(null!=c?c:x?N(x,pe,G,D):[]).filter(function(e){return e.id!==exports.BoundaryReviewActionEnum.SET_RANGE})},[c,D,G,x,pe]),_e=t.useState(v),be=_e[0],Ee=_e[1],ve=t.useState(null==G?"":String(G)),Ce=ve[0],je=ve[1],Fe=t.useState(null==D?"":String(D)),ye=Fe[0],Se=Fe[1],we=t.useState(!1),Re=we[0],Ae=we[1],Me=t.useState(!1),Be=Me[0],Ie=Me[1],Te=t.useState(null),ze=Te[0],We=Te[1],ke=t.useState(!1),Pe=ke[0],Ne=ke[1],Ge=void 0===p?be:p,De=null==Ge?void 0:me[Ge],qe=(null==De?void 0:De.id)===k,He=null!=g,Oe=null!=f,Ve=function(e){return!0===e.disabled||e.id===exports.BoundaryReviewActionEnum.MERGE_PREV&&!He||e.id===exports.BoundaryReviewActionEnum.MERGE_PREVIOUS&&!He||e.id===exports.BoundaryReviewActionEnum.MERGE_NEXT&&!Oe||e.id===k&&!He&&!Oe},Le=Number(Ce),Ue=Number(ye),Xe=Ce.trim().length>0&&ye.trim().length>0&&Number.isInteger(Le)&&Number.isInteger(Ue)&&Le>0&&Ue>0,Ke=null!=he&&Le>he,$e=null!=he&&Ue>he,Je=Ce.trim().length>0&&ye.trim().length>0&&Number.isInteger(Le)&&Number.isInteger(Ue)&&Le>Ue,Ye=Xe&&Le<=Ue&&!Ke&&!$e,Qe=Ye&&Le===G&&Ue===D,Ze=le||!De||Ve(De)||qe&&null==ze||!H&&!O;return i.jsx(M.default,e.__assign({className:ge,elevation:4,sx:W({width:ue,maxWidth:xe,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==fe?void 0:fe.root)},{children:i.jsxs(I.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==fe?void 0:fe.header},{children:[i.jsx(b.default,{color:"error",height:16,width:16}),i.jsx(z.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:o})),ae&&i.jsx(A.default,e.__assign({size:"small",onClick:U,disabled:!U,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(j.default,{sx:{fontSize:17}})}))]})),i.jsxs(y.default,{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=s&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:s})),i.jsx(R.default,{sx:{my:.625}}),null!=d?i.jsx(h.default,{children:d}):null!=l&&i.jsx(z.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:l}))]}),i.jsxs(I.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[me.map(function(t,n){var r=Ge===n,o=Ve(t);return i.jsxs(M.default,e.__assign({variant:"outlined",sx:W({borderColor:r?"#1976d2":"divider",borderRadius:2,bgcolor:o?"#F8FAFC":"background.paper",overflow:"hidden"},null==fe?void 0:fe.option)},{children:[i.jsxs(w.default,e.__assign({role:"radio","aria-checked":r,disabled:le||o,onClick:function(){return function(e,i){le||Ve(i)||(void 0===p&&Ee(e),i.id!==k&&We(null),Re&&(Ae(!1),Ie(!1)),null==q||q(e,i))}(n,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(B.default,{checked:r,disabled:le||o,tabIndex:-1,size:"small",sx:{p:.25,mr:.5,"&.Mui-disabled":{color:"#CBD5E1"}}}),i.jsxs(y.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(z.default,e.__assign({sx:{color:o?"#94A3B8":"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:o?"#94A3B8":"text.secondary",fontSize:11}},{children:t.description}))]}))]})),r&&t.id===k&&i.jsx(I.default,e.__assign({direction:"row",spacing:.75,sx:W({px:.75,pb:.75},null==fe?void 0:fe.adjacentSelector)},{children:[{direction:"previous",title:null!=g?g:"No Previous document",caption:"← Merge into Previous",available:He},{direction:"next",title:null!=f?f:"No Next document",caption:"Merge into Next →",available:Oe}].map(function(t){var n=ze===t.direction;return i.jsxs(I.default,e.__assign({sx:{flex:1,minWidth:0}},{children:[i.jsx(w.default,e.__assign({disabled:le||!t.available,onClick:function(){return We(t.direction)},"aria-pressed":n,sx:{width:"100%",minWidth:0,minHeight:46,alignItems:"flex-start",justifyContent:"flex-start",p:.625,border:"1px solid",borderColor:n?"#7F56D9":"#D0D5DD",borderRadius:1.5,bgcolor:n?"#E0E7FF":"background.paper",color:n?"#7F56D9":t.available?"text.primary":"#98A2B3",textAlign:"left","&.Mui-disabled":{color:"#98A2B3",bgcolor:"#F8FAFC"}}},{children:i.jsx(z.default,e.__assign({sx:{color:"inherit",fontSize:11,fontWeight:500,lineHeight:1.25,overflowWrap:"anywhere"}},{children:t.title}))})),i.jsx(z.default,e.__assign({sx:{mt:.5,color:n?"#5925DC":"text.secondary",fontSize:9.5,lineHeight:1.2,whiteSpace:"nowrap",textAlign:"next"===t.direction?"right":"left"}},{children:t.caption}))]}),t.direction)})}))]}),t.id)}),qe&&null!=ze&&i.jsxs(I.default,e.__assign({direction:"row",alignItems:"flex-start",spacing:.625,sx:W({p:.75,border:"1px solid #FCA5A5",borderRadius:1.5,bgcolor:"#FEF2F2"},null==fe?void 0:fe.impactWarning)},{children:[i.jsx(b.default,{color:"error",height:14,width:14,sx:{mt:.125}}),i.jsxs(z.default,e.__assign({sx:{color:"#DC2626",fontSize:10.5,lineHeight:1.4}},{children:["This will impact the ",ze," document. Its content and page range will change."]}))]})),i.jsx(S.default,e.__assign({variant:"contained",fullWidth:!0,disabled:Ze,onClick:function(){if(!Ze&&null!=Ge&&De){var i=qe?"previous"===ze?exports.BoundaryReviewActionEnum.MERGE_PREVIOUS:exports.BoundaryReviewActionEnum.MERGE_NEXT:De.id,t=qe?e.__assign(e.__assign({},De),{id:i}):De,n={selectedIndex:Ge,option:t,metadata:x};null==H||H(Ge,t,n),O&&P(i)&&O(i,n)}},sx:W({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==fe?void 0:fe.confirmButton)},{children:K}))]})),te&&i.jsxs(I.default,e.__assign({spacing:.625,sx:null==fe?void 0:fe.manualSection},{children:[i.jsxs(w.default,e.__assign({disabled:le,onClick:function(){var e=!Re;Ae(e),Ie(!1),e&&(void 0===p&&Ee(null),null==L||L())},"aria-expanded":Re,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[i.jsx(y.default,{children:i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12,fontWeight:600}},{children:J}))}),i.jsx(F.default,{sx:{color:"text.secondary",fontSize:16,transform:Re?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),Re&&!Be&&i.jsxs(y.default,e.__assign({sx:{pt:.5,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[i.jsxs(y.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[i.jsx(z.default,e.__assign({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Starts"})),i.jsx(z.default,e.__assign({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Ends"}))]})),i.jsxs(y.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[i.jsxs(y.default,{children:[i.jsx(T.default,{size:"small",type:"text",value:Ce,disabled:le,error:Ke||Je,onChange:function(e){var i=e.target.value;/^\d*$/.test(i)&&je(i)},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:Ke||Je?"#EF4444":"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:Ke||Je?"#EF4444":"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:Ke||Je?"#EF4444":"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"}}}),Ke&&i.jsxs(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:["Must be ≤ ",he," (total pages)"]})),Je&&!Ke&&i.jsx(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:"Must be ≤ end page"}))]}),i.jsxs(y.default,{children:[i.jsx(T.default,{size:"small",type:"text",value:ye,disabled:le,error:$e||Je,onChange:function(e){var i=e.target.value;/^\d*$/.test(i)&&Se(i)},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:$e||Je?"#EF4444":"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:$e||Je?"#EF4444":"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:$e||Je?"#EF4444":"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"}}}),$e&&i.jsxs(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:["Must be ≤ ",he," (total pages)"]})),Je&&!$e&&i.jsx(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:"Must be ≥ start page"}))]})]})),i.jsx(y.default,{children:i.jsx(S.default,e.__assign({onClick:function(){Ye&&(Qe?Ne(!0):Ie(!0))},disabled:le||!Ye||Qe,sx:{height:"30px",padding:"0 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"1px solid #8E80F3",borderRadius:"6px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"12px",fontWeight:600,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":!Ye||Qe?{}:{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"},"&:active":!Ye||Qe?{}:{transform:"translateY(1px)"},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))}),Qe&&Pe&&i.jsx(y.default,e.__assign({sx:{backgroundColor:"#FEF3C7",border:"1px solid #FBBF24",borderRadius:"6px",padding:"8px 10px",marginTop:"4px"}},{children:i.jsx(z.default,e.__assign({sx:{fontSize:"10px",color:"#B45309",fontWeight:500,lineHeight:1.4}},{children:"Please change the boundary to change the document boundary as no changes will be applied."}))})),i.jsx(y.default,{sx:{width:"100%",height:"1px",marginTop:"8px",backgroundColor:"#EEF0F2",border:"0"}})]})),Re&&Be&&i.jsxs(I.default,e.__assign({spacing:.75,sx:W({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==fe?void 0:fe.manualConfirmation)},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(b.default,{color:"warning",height:14,width:14}),i.jsx(z.default,e.__assign({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),i.jsxs(z.default,e.__assign({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Le,"-",Ue," will become part of ",a,", including pages from other documents in this range."]})),i.jsxs(I.default,e.__assign({direction:"row",spacing:.75},{children:[i.jsx(S.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:function(){return Ie(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),i.jsx(S.default,e.__assign({variant:"contained",fullWidth:!0,disabled:le||!H||!Ye||Qe,onClick:function(){if(Ye&&!Qe&&H){var e={id:exports.BoundaryReviewActionEnum.SET_RANGE,title:Q};H(-1,e,{selectedIndex:-1,option:e,startPage:Le,endPage:Ue,metadata:x})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),i.jsx(I.default,e.__assign({spacing:.625,sx:null==fe?void 0:fe.footer},{children:re&&i.jsxs(i.Fragment,{children:[i.jsx(R.default,{}),i.jsxs(w.default,e.__assign({onClick:V,disabled:!V,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:V?"pointer":"not-allowed"}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(m.default,{sx:{color:"text.secondary"}}),i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:ee}))]})),i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(_.default,{score:u}),i.jsx(C.default,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))},exports.isBoundaryReviewAction=P;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ChevronRight"),r=require("@mui/icons-material/Close"),o=require("@mui/icons-material/ExpandMore"),a=require("@mui/material/Box"),s=require("@mui/material/Button"),l=require("@mui/material/ButtonBase"),d=require("@mui/material/Divider"),u=require("@mui/material/IconButton"),c=require("@mui/material/Paper"),x=require("@mui/material/Radio"),g=require("@mui/material/Stack"),f=require("@mui/material/TextField"),p=require("@mui/material/Typography"),h=require("./RevertSummaryNotice.js"),m=require("./CognitiveIcon.js"),_=require("./CognitiveScoreBadge.js"),b=require("../../assests/icons/InfoAlert.js");function E(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v,C=E(n),j=E(r),F=E(o),y=E(a),S=E(s),w=E(l),R=E(d),A=E(u),M=E(c),B=E(x),I=E(g),T=E(f),z=E(p),W=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)},k="MERGE_ADJACENT";exports.BoundaryReviewActionEnum=void 0,(v=exports.BoundaryReviewActionEnum||(exports.BoundaryReviewActionEnum={})).KEEP="KEEP",v.SPLIT_HERE="SPLIT_HERE",v.MERGE_NEXT="MERGE_NEXT",v.MERGE_PREV="MERGE_PREV",v.MERGE_PREVIOUS="MERGE_PREVIOUS",v.SET_RANGE="SET_RANGE";var P=function(e){return Object.values(exports.BoundaryReviewActionEnum).includes(e)},N=function(i,t,n,r){if(!t||!i)return[];var o=t.additional_decisions,a=Array.isArray(o)?o:o?Object.values(o).flat():[],s=Array.from(new Set(e.__spreadArray(e.__spreadArray([],t.allowed_decisions,!0),a,!0)));return s.flatMap(function(e){var t=i.focus_page,o=s.find(function(e){return e.toLowerCase().includes("merge")}),a=null!=t&&null!=n&&null!=r&&t===n&&t===r,l=null!=t&&null!=n&&t===n,d=null!=t&&null!=r&&(t===r||t===r+1),u=l||d||!(null!=t&&(!(null!=n&&null!=r)||t>n&&t<r));switch(e){case exports.BoundaryReviewActionEnum.SET_RANGE:return[];case"KEEP":return[{id:e,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:e,title:"Split to a separate document",description:u?"A valid page inside the document is required to split it.":t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary.",disabled:u}];case"MERGE_PREV":case"MERGE_NEXT":case"MERGE_PREVIOUS":return e!==o?[]:a?[{id:k,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]:l?[{id:exports.BoundaryReviewActionEnum.MERGE_PREVIOUS,title:"Merge with previous document",description:"Combine this document with the previous document."}]:d?[{id:exports.BoundaryReviewActionEnum.MERGE_NEXT,title:"Merge with next document",description:"Combine this document with the next document."}]:[{id:k,title:"Merge with an adjacent document",description:"Choose to merge with the previous or next document."}]}return[]})};exports.createBoundaryCardOptions=N,exports.default=function(n){var r=n.headerName,o=void 0===r?"Boundary Check":r,a=n.title,s=n.pageNo,l=n.content,d=n.revertSummary,u=n.cognitiveScore,c=n.config,x=n.metadata,g=n.previousSegmentTitle,f=n.nextSegmentTitle,p=n.selectedIndex,E=n.defaultSelectedIndex,v=void 0===E?null:E,G=n.defaultStartPage,D=n.defaultEndPage,q=n.onSelectionChange,H=n.onConfirm,O=n.onActionConfirm,V=n.onCognitiveClick,L=n.onAdjustManually,U=n.onClose,X=n.confirmLabel,K=void 0===X?"Confirm":X,$=n.manualPrompt,J=void 0===$?"Didn't find the right option?":$,Y=n.manualActionLabel,Q=void 0===Y?"Adjust Manually":Y,Z=n.cognitiveLabel,ee=void 0===Z?"Cognitive Integrity":Z,ie=n.showAdjustManually,te=void 0===ie||ie,ne=n.showCognitiveIntegrity,re=void 0===ne||ne,oe=n.showCloseButton,ae=void 0===oe||oe,se=n.confirmDisabled,le=void 0!==se&&se,de=n.width,ue=void 0===de?260:de,ce=n.maxWidth,xe=void 0===ce?260:ce,ge=n.className,fe=n.styles,pe=n.reviewAction,he=n.totalPages;console.log("LOG: Total pages",he);var me=t.useMemo(function(){return(null!=c?c:x?N(x,pe,G,D):[]).filter(function(e){return e.id!==exports.BoundaryReviewActionEnum.SET_RANGE})},[c,D,G,x,pe]),_e=t.useState(v),be=_e[0],Ee=_e[1],ve=t.useState(null==G?"":String(G)),Ce=ve[0],je=ve[1],Fe=t.useState(null==D?"":String(D)),ye=Fe[0],Se=Fe[1],we=t.useState(!1),Re=we[0],Ae=we[1],Me=t.useState(!1),Be=Me[0],Ie=Me[1],Te=t.useState(null),ze=Te[0],We=Te[1],ke=t.useState(!1),Pe=ke[0],Ne=ke[1],Ge=void 0===p?be:p,De=null==Ge?void 0:me[Ge],qe=(null==De?void 0:De.id)===k,He=null!=g,Oe=null!=f,Ve=function(e){return!0===e.disabled||e.id===exports.BoundaryReviewActionEnum.MERGE_PREV&&!He||e.id===exports.BoundaryReviewActionEnum.MERGE_PREVIOUS&&!He||e.id===exports.BoundaryReviewActionEnum.MERGE_NEXT&&!Oe||e.id===k&&!He&&!Oe},Le=Number(Ce),Ue=Number(ye),Xe=Ce.trim().length>0&&ye.trim().length>0&&Number.isInteger(Le)&&Number.isInteger(Ue)&&Le>0&&Ue>0,Ke=null!=he&&Le>he,$e=null!=he&&Ue>he,Je=Ce.trim().length>0&&ye.trim().length>0&&Number.isInteger(Le)&&Number.isInteger(Ue)&&Le>Ue,Ye=Xe&&Le<=Ue&&!Ke&&!$e,Qe=Ye&&Le===G&&Ue===D,Ze=le||!De||Ve(De)||qe&&null==ze||!H&&!O;return i.jsx(M.default,e.__assign({className:ge,elevation:4,sx:W({width:ue,maxWidth:xe,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==fe?void 0:fe.root)},{children:i.jsxs(I.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==fe?void 0:fe.header},{children:[i.jsx(b.default,{color:"error",height:16,width:16}),i.jsx(z.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:o})),ae&&i.jsx(A.default,e.__assign({size:"small",onClick:U,disabled:!U,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(j.default,{sx:{fontSize:17}})}))]})),i.jsxs(y.default,{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=s&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:s})),i.jsx(R.default,{sx:{my:.625}}),null!=d?i.jsx(h.default,{children:d}):null!=l&&i.jsx(z.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:l}))]}),i.jsxs(I.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[me.map(function(t,n){var r=Ge===n,o=Ve(t);return i.jsxs(M.default,e.__assign({variant:"outlined",sx:W({borderColor:r?"#1976d2":"divider",borderRadius:2,bgcolor:o?"#F8FAFC":"background.paper",overflow:"hidden"},null==fe?void 0:fe.option)},{children:[i.jsxs(w.default,e.__assign({role:"radio","aria-checked":r,disabled:le||o,onClick:function(){return function(e,i){le||Ve(i)||(void 0===p&&Ee(e),i.id!==k&&We(null),Re&&(Ae(!1),Ie(!1)),null==q||q(e,i))}(n,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(B.default,{checked:r,disabled:le||o,tabIndex:-1,size:"small",sx:{p:.25,mr:.5,"&.Mui-disabled":{color:"#CBD5E1"}}}),i.jsxs(y.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(z.default,e.__assign({sx:{color:o?"#94A3B8":"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:o?"#94A3B8":"text.secondary",fontSize:11}},{children:t.description}))]}))]})),r&&t.id===k&&i.jsx(I.default,e.__assign({direction:"row",spacing:.75,sx:W({px:.75,pb:.75},null==fe?void 0:fe.adjacentSelector)},{children:[{direction:"previous",title:null!=g?g:"No Previous document",caption:"← Merge into Previous",available:He},{direction:"next",title:null!=f?f:"No Next document",caption:"Merge into Next →",available:Oe}].map(function(t){var n=ze===t.direction;return i.jsxs(I.default,e.__assign({sx:{flex:1,minWidth:0}},{children:[i.jsx(w.default,e.__assign({disabled:le||!t.available,onClick:function(){return We(t.direction)},"aria-pressed":n,sx:{width:"100%",minWidth:0,minHeight:46,alignItems:"flex-start",justifyContent:"flex-start",p:.625,border:"1px solid",borderColor:n?"#7F56D9":"#D0D5DD",borderRadius:1.5,bgcolor:n?"#E0E7FF":"background.paper",color:n?"#7F56D9":t.available?"text.primary":"#98A2B3",textAlign:"left","&.Mui-disabled":{color:"#98A2B3",bgcolor:"#F8FAFC"}}},{children:i.jsx(z.default,e.__assign({sx:{color:"inherit",fontSize:11,fontWeight:500,lineHeight:1.25,overflowWrap:"anywhere"}},{children:t.title}))})),i.jsx(z.default,e.__assign({sx:{mt:.5,color:n?"#5925DC":"text.secondary",fontSize:9.5,lineHeight:1.2,whiteSpace:"nowrap",textAlign:"next"===t.direction?"right":"left"}},{children:t.caption}))]}),t.direction)})}))]}),t.id)}),qe&&null!=ze&&i.jsxs(I.default,e.__assign({direction:"row",alignItems:"flex-start",spacing:.625,sx:W({p:.75,border:"1px solid #FCA5A5",borderRadius:1.5,bgcolor:"#FEF2F2"},null==fe?void 0:fe.impactWarning)},{children:[i.jsx(b.default,{color:"error",height:14,width:14,sx:{mt:.125}}),i.jsxs(z.default,e.__assign({sx:{color:"#DC2626",fontSize:10.5,lineHeight:1.4}},{children:["This will impact the ",ze," document. Its content and page range will change."]}))]})),i.jsx(S.default,e.__assign({variant:"contained",fullWidth:!0,disabled:Ze,onClick:function(){if(!Ze&&null!=Ge&&De){var i=qe?"previous"===ze?exports.BoundaryReviewActionEnum.MERGE_PREVIOUS:exports.BoundaryReviewActionEnum.MERGE_NEXT:De.id,t=qe?e.__assign(e.__assign({},De),{id:i}):De,n={selectedIndex:Ge,option:t,metadata:x};null==H||H(Ge,t,n),O&&P(i)&&O(i,n)}},sx:W({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==fe?void 0:fe.confirmButton)},{children:K}))]})),te&&i.jsxs(I.default,e.__assign({spacing:.625,sx:null==fe?void 0:fe.manualSection},{children:[i.jsxs(w.default,e.__assign({disabled:le,onClick:function(){var e=!Re;Ae(e),Ie(!1),e&&(void 0===p&&Ee(null),null==L||L())},"aria-expanded":Re,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[i.jsx(y.default,{children:i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12,fontWeight:600}},{children:J}))}),i.jsx(F.default,{sx:{color:"text.secondary",fontSize:16,transform:Re?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),Re&&!Be&&i.jsxs(y.default,e.__assign({sx:{pt:.5,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[i.jsxs(y.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[i.jsx(z.default,e.__assign({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Starts"})),i.jsx(z.default,e.__assign({sx:{fontSize:"10.5px",fontWeight:400,lineHeight:"14px",color:"#57697E",margin:0}},{children:"Ends"}))]})),i.jsxs(y.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"8px",mb:"4px"}},{children:[i.jsxs(y.default,{children:[i.jsx(T.default,{size:"small",type:"text",value:Ce,disabled:le,error:Ke||Je,onChange:function(e){var i=e.target.value;/^\d*$/.test(i)&&je(i)},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:Ke||Je?"#EF4444":"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:Ke||Je?"#EF4444":"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:Ke||Je?"#EF4444":"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"}}}),Ke&&i.jsxs(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:["Must be ≤ ",he," (total pages)"]})),Je&&!Ke&&i.jsx(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:"Must be ≤ end page"}))]}),i.jsxs(y.default,{children:[i.jsx(T.default,{size:"small",type:"text",value:ye,disabled:le,error:$e||Je,onChange:function(e){var i=e.target.value;/^\d*$/.test(i)&&Se(i)},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiOutlinedInput-root":{height:"30px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:$e||Je?"#EF4444":"#C3CFDC",borderWidth:"1px",borderRadius:"6px"},"&:hover fieldset":{borderColor:$e||Je?"#EF4444":"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:$e||Je?"#EF4444":"#9488F6",borderWidth:"1px"}},"& .MuiOutlinedInput-input":{fontSize:"12px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 10px",height:"30px"}}}),$e&&i.jsxs(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:["Must be ≤ ",he," (total pages)"]})),Je&&!$e&&i.jsx(z.default,e.__assign({sx:{fontSize:"10px",color:"#EF4444",marginTop:"2px",fontWeight:500}},{children:"Must be ≥ start page"}))]})]})),i.jsx(y.default,{children:i.jsx(S.default,e.__assign({onClick:function(){Ye&&(Qe?Ne(!0):Ie(!0))},disabled:le||!Ye,sx:{height:"30px",padding:"0 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"1px solid #8E80F3",borderRadius:"6px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"12px",fontWeight:600,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Ye?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Ye?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))}),Qe&&Pe&&i.jsx(y.default,e.__assign({sx:{backgroundColor:"#FEF3C7",border:"1px solid #FBBF24",borderRadius:"6px",padding:"8px 10px",marginTop:"4px"}},{children:i.jsx(z.default,e.__assign({sx:{fontSize:"10px",color:"#B45309",fontWeight:500,lineHeight:1.4}},{children:"Please change the boundary to change the document boundary as no changes will be applied."}))})),i.jsx(y.default,{sx:{width:"100%",height:"1px",marginTop:"8px",backgroundColor:"#EEF0F2",border:"0"}})]})),Re&&Be&&i.jsxs(I.default,e.__assign({spacing:.75,sx:W({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==fe?void 0:fe.manualConfirmation)},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(b.default,{color:"warning",height:14,width:14}),i.jsx(z.default,e.__assign({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),i.jsxs(z.default,e.__assign({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Le,"-",Ue," will become part of ",a,", including pages from other documents in this range."]})),i.jsxs(I.default,e.__assign({direction:"row",spacing:.75},{children:[i.jsx(S.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:function(){return Ie(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),i.jsx(S.default,e.__assign({variant:"contained",fullWidth:!0,disabled:le||!H,onClick:function(){if(Ye&&H){var e={id:exports.BoundaryReviewActionEnum.SET_RANGE,title:Q};H(-1,e,{selectedIndex:-1,option:e,startPage:Le,endPage:Ue,metadata:x})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),i.jsx(I.default,e.__assign({spacing:.625,sx:null==fe?void 0:fe.footer},{children:re&&i.jsxs(i.Fragment,{children:[i.jsx(R.default,{}),i.jsxs(w.default,e.__assign({onClick:V,disabled:!V,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:V?"pointer":"not-allowed"}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(m.default,{sx:{color:"text.secondary"}}),i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:ee}))]})),i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(_.default,{score:u}),i.jsx(C.default,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))},exports.isBoundaryReviewAction=P;
|
|
2
2
|
//# sourceMappingURL=BoundaryCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(require("@mui/material/Box"));exports.default=function(t){var o=t.score;if(null==o||"string"==typeof o&&""===o.trim())return null;var i="number"==typeof o?"".concat(o,"%"):o;return r.jsx(n.default,e.__assign({component:"span",sx:{px:.625,py:0,border:"1.5px solid",borderColor:"secondary.main",borderRadius:10,color:"secondary.main",fontSize:11,lineHeight:1.25}},{children:i}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveScoreBadge.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("@mui/icons-material/ArrowForward"),t=require("@mui/material/Box"),o=require("@mui/material/Button"),l=require("@mui/material/Paper"),a=require("@mui/material/Stack"),n=require("@mui/material/Typography"),s=require("lucide-react");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(i),c=d(t),x=d(o),g=d(l),h=d(a),f=d(n);exports.default=function(i){var t=i.title,o=i.description,l=i.onReview,a=i.reviewLabel,n=void 0===a?"Review":a;return r.jsx(g.default,e.__assign({elevation:0,role:"status",sx:{width:"100%",px:1.5,py:1.5,border:"1.5px solid #86EFAC",borderRadius:2,bgcolor:"#F0FDF4",boxSizing:"border-box"}},{children:r.jsxs(h.default,e.__assign({alignItems:"center",spacing:1.5,sx:{textAlign:"center"}},{children:[r.jsx(c.default,e.__assign({sx:{display:"grid",placeItems:"center",width:58,height:58,border:"8px solid rgba(255, 255, 255, 0.9)",borderRadius:"50%",bgcolor:"#DCFCE7",color:"#0A9B49"}},{children:r.jsx(s.CheckCircleIcon,{height:36,width:36})})),r.jsxs(c.default,{children:[r.jsx(f.default,e.__assign({sx:{color:"#166534",fontSize:15,fontWeight:600,lineHeight:1.4}},{children:t})),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("@mui/icons-material/ArrowForward"),t=require("@mui/material/Box"),o=require("@mui/material/Button"),l=require("@mui/material/Paper"),a=require("@mui/material/Stack"),n=require("@mui/material/Typography"),s=require("lucide-react");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(i),c=d(t),x=d(o),g=d(l),h=d(a),f=d(n);exports.default=function(i){var t=i.title,o=i.description,l=i.onReview,a=i.reviewLabel,n=void 0===a?"Review":a;return r.jsx(g.default,e.__assign({elevation:0,role:"status",sx:{width:"100%",px:1.5,py:1.5,border:"1.5px solid #86EFAC",borderRadius:2,bgcolor:"#F0FDF4",boxSizing:"border-box"}},{children:r.jsxs(h.default,e.__assign({alignItems:"center",spacing:1.5,sx:{textAlign:"center"}},{children:[r.jsx(c.default,e.__assign({sx:{display:"grid",placeItems:"center",width:58,height:58,border:"8px solid rgba(255, 255, 255, 0.9)",borderRadius:"50%",bgcolor:"#DCFCE7",color:"#0A9B49"}},{children:r.jsx(s.CheckCircleIcon,{height:36,width:36})})),r.jsxs(c.default,{children:[r.jsx(f.default,e.__assign({sx:{color:"#166534",fontSize:15,fontWeight:600,lineHeight:1.4}},{children:t})),r.jsx(f.default,e.__assign({sx:{mt:.75,color:"#07883F",fontSize:14,lineHeight:1.55}},{children:o}))]}),r.jsx(x.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:l,endIcon:r.jsx(u.default,{}),sx:{minHeight:42,border:"1.5px solid #CBD5E1",borderRadius:2,bgcolor:"#FFFFFF",color:"#475569",fontSize:16,fontWeight:700,textTransform:"none","&:hover":{borderColor:"#94A3B8",bgcolor:"#FFFFFF"}}},{children:n}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=RevertSuccessCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n,t=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),o=require("@react-pdf-viewer/core"),a=require("../PdfViewer/PdfViewer.js"),l=require("./BoundaryCard.js"),u=require("./CardWrapper.js"),s=require("./CognitiveIntegrity.js"),d=require("./LabelCheck.js"),c=require("./PageCheck.js"),g=require("./PageTypeChoiceCheck.js"),v=require("./reviewStepAdapters.js"),m=require("lucide-react"),p=require("@mui/material"),f=require("./ReviewedCard.js"),h=require("./ReviewedBoundaryActions.js"),_=require("./RevertCard.js"),w=require("./RevertSuccessCard.js"),y=require("./helper.js"),b=require("./ChartBreakoutCircle.js"),x=require("./reviewScore.js"),S=260;exports.SegmentPdfSpecialZoomLevel=void 0,(n=exports.SegmentPdfSpecialZoomLevel||(exports.SegmentPdfSpecialZoomLevel={})).ActualSize="ActualSize",n.PageFit="PageFit",n.PageWidth="PageWidth";var R=((e={})[exports.SegmentPdfSpecialZoomLevel.ActualSize]=o.SpecialZoomLevel.ActualSize,e[exports.SegmentPdfSpecialZoomLevel.PageFit]=o.SpecialZoomLevel.PageFit,e[exports.SegmentPdfSpecialZoomLevel.PageWidth]=o.SpecialZoomLevel.PageWidth,e),E=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};exports.default=function(e){var n,C,k,P,A,M,I,j,N,B,T,L,F,q,W,K,z,G,O,D,V,H,U,Z,X,Y,J,$,Q,ee,ne,te,ie,re,oe,ae,le=this,ue=e.pdfUrl,se=e.pdfName,de=e.segments,ce=e.totalPages,ge=e.styles,ve=e.pdfViewerProps,me=e.specialZoomLevel,pe=e.showBadges,fe=void 0===pe||pe,he=e.sortByConfidence,_e=void 0===he?"low":he,we=e.filterByConfidence,ye=void 0===we?"all":we,be=e.showBadgeNavigation,xe=void 0===be||be,Se=e.autoSelectReviewOnPageChange,Re=void 0!==Se&&Se,Ee=e.autoAdvanceAfterConfirm,Ce=void 0===Ee||Ee,ke=e.autoAdvanceScoreBand,Pe=e.badgePreloadPages,Ae=void 0===Pe?8:Pe,Me=e.badgeOffsetTop,Ie=void 0===Me?20:Me,je=e.badgeOffsetRight,Ne=void 0===je?68:je,Be=e.badgeOffsetLeft,Te=void 0===Be?0:Be,Le=e.initialReviewId,Fe=e.manualPrompt,qe=e.heightBuffer,We=e.onBoundaryAction,Ke=e.onLabelAction,ze=e.onPageAction,Ge=e.onPageTypeRevert,Oe=e.onRevert,De=e.onActiveReviewChange,Ve=e.onCurrentPageChange,He=e.onActionError,Ue=e.disableAllActions,Ze=void 0!==Ue&&Ue,Xe=e.disablePdfAnnotations,Ye=void 0!==Xe&&Xe,Je=e.disablePdfTextLayer,$e=void 0===Je||Je,Qe=e.disableTitleCheckUntilBoundaryCheckCompleted,en=void 0!==Qe&&Qe,nn=e.onAdjustManually,tn=e.onCognitiveClick,rn=e.className,on=e.style,an=e.viewerStyle,ln=e.railStyle,un=e.redirectionData,sn=e.onBadgeSelected;console.log("LOG: TOTAL PAGE IN PARENT",ce);var dn=r.useMemo(function(){return v.extractSegmentReviewData(de)},[de]),cn=dn.boundaryReviews,gn=dn.labelReviews,vn=dn.pageReviews,mn=r.useState(function(){return new Map}),pn=mn[0],fn=mn[1],hn=r.useState(function(){return new Set}),_n=hn[0],wn=hn[1],yn=r.useMemo(function(){var e=new Map,n=1;return de.forEach(function(t,i){var r=v.getSegmentReviewKey(t,i);e.has(r)||(e.set(r,n),n+=1)}),e},[de]),bn=r.useMemo(function(){return new Set(gn.map(function(e){return v.getSegmentReviewKey(e.segment)}))},[gn]),xn=r.useMemo(function(){return y.getPendingMergeImpactedSegmentKeys(de)},[de]);r.useEffect(function(){fn(function(e){var n=!1,t=new Map(e);return e.forEach(function(e,i){var r=de.find(function(e){return v.getSegmentReviewKey(e)===i});r&&!y.hasPolledStructuralAction(r,e)||(t.delete(i),n=!0)}),n?t:e})},[de]),r.useEffect(function(){wn(function(e){var n=!1,t=new Set(e);return e.forEach(function(e){pn.has(e)||(t.delete(e),n=!0)}),n?t:e})},[pn]);var Sn=r.useMemo(function(){return y.getOptimisticMergeImpactedSegmentKeys(de,pn,_n)},[_n,pn,de]),Rn=r.useRef(null),En=r.useMemo(function(){return t.__spreadArray(t.__spreadArray(t.__spreadArray([],cn.filter(function(e){return!xn.has(v.getSegmentReviewKey(e.segment))&&!Sn.has(v.getSegmentReviewKey(e.segment))&&!y.shouldHideStructuralBoundaryReview(e.review_step,e.segment,bn.has(v.getSegmentReviewKey(e.segment)),pn.get(v.getSegmentReviewKey(e.segment)))}).map(function(e){var n;return t.__assign(t.__assign({},e),{kind:"boundary",pageNumber:null!==(n=e.metadata.focus_page)&&void 0!==n?n:e.segment.start_page})}),!0),gn.filter(function(e){return!xn.has(v.getSegmentReviewKey(e.segment))&&!Sn.has(v.getSegmentReviewKey(e.segment))}).map(function(e){return t.__assign(t.__assign({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0),vn.filter(function(e){return!xn.has(v.getSegmentReviewKey(e.segment))&&!Sn.has(v.getSegmentReviewKey(e.segment))}).map(function(e){var n;return t.__assign(t.__assign({},e),{kind:"page",pageNumber:null!==(n=e.metadata.page_num)&&void 0!==n?n:e.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=yn.get(v.getSegmentReviewKey(e.segment)))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=yn.get(v.getSegmentReviewKey(n.segment)))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-o||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[cn,gn,vn,Sn,pn,xn,yn,bn]),Cn=r.useMemo(function(){return de.map(function(e){var n,i;return t.__assign(t.__assign({},e),{title:(null===(n=e.label)||void 0===n?void 0:n.trim())||e.title,page_count:null!==(i=e.page_count)&&void 0!==i?i:e.end_page-e.start_page+1})})},[de]),kn=r.useState(1),Pn=kn[0],An=kn[1],Mn=r.useState(null!=Le?Le:null),In=Mn[0],jn=Mn[1],Nn=r.useState(null!=Le?Le:null),Bn=Nn[0],Tn=Nn[1],Ln=r.useState(!1),Fn=Ln[0],qn=Ln[1],Wn=r.useState(null),Kn=Wn[0],zn=Wn[1],Gn=r.useState(null),On=Gn[0],Dn=Gn[1],Vn=r.useState(function(){return new Set}),Hn=Vn[0],Un=Vn[1],Zn=r.useState(null),Xn=Zn[0],Yn=Zn[1],Jn=r.useState(null),$n=Jn[0],Qn=Jn[1],et=r.useState(null),nt=et[0],tt=et[1],it=r.useState(!1),rt=it[0],ot=it[1],at=r.useRef(0),lt=r.useRef(null),ut=r.useRef(null),st=r.useRef(new Map),dt=r.useRef(null),ct=r.useRef(null),gt=r.useRef(null),vt=r.useState(S),mt=vt[0],pt=vt[1],ft=null!==(C=null===(n=null==ge?void 0:ge.aside)||void 0===n?void 0:n.width)&&void 0!==C?C:"40%",ht="min(".concat("number"==typeof ft?"".concat(ft,"px"):ft,", ").concat(S,"px, 100%)");r.useEffect(function(){Un(function(e){if(0===e.size)return e;var n=new Set(e),t=!1;return En.forEach(function(e){var i;null!=(null===(i=e.review_step.review)||void 0===i?void 0:i.action)&&n.has(e.id)&&(n.delete(e.id),t=!0)}),t?n:e})},[En]),r.useEffect(function(){var e=Rn.current;if(e&&fe){var n=function(){var n=e.getBoundingClientRect().width;n>0&&pt(n)};n();var t="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==t||t.observe(e),function(){return null==t?void 0:t.disconnect()}}},[fe]);var _t=r.useMemo(function(){var e=new Set;return En.forEach(function(n){var t;null!=(null===(t=n.review_step.review)||void 0===t?void 0:t.action)&&e.add(n.id)}),e},[En]),wt=r.useMemo(function(){var e;return null!==(e=En.find(function(e){return e.id===In}))&&void 0!==e?e:null},[In,En]),yt=r.useMemo(function(){return!(!en||"label"!==(null==wt?void 0:wt.kind))&&cn.some(function(e){if(v.getSegmentReviewKey(e.segment)!==v.getSegmentReviewKey(wt.segment)||_t.has(e.id))return!1;var n=y.getResolvedScore(e.review_step.score,e.review_step.confidence);return null==n||n<85})},[wt,cn,en,_t]),bt=null==wt?-1:de.findIndex(function(e){return v.getSegmentReviewKey(e)===v.getSegmentReviewKey(wt.segment)}),xt=bt>0?de[bt-1]:void 0,St=bt>=0?de[bt+1]:void 0,Rt=(null===(k=null==xt?void 0:xt.label)||void 0===k?void 0:k.trim())||(null==xt?void 0:xt.title),Et=(null===(P=null==St?void 0:St.label)||void 0===P?void 0:P.trim())||(null==St?void 0:St.title),Ct=y.getConfidenceColors(null==wt?void 0:wt.review_step.score,null==wt?void 0:wt.review_step.confidence,null===(A=null==wt?void 0:wt.segment.confidence)||void 0===A?void 0:A.awaiting_llm),kt=(null===(M=null==wt?void 0:wt.review_step.reasons)||void 0===M?void 0:M.length)?wt.review_step.reasons:null!==(j=null===(I=null==wt?void 0:wt.segment.confidence)||void 0===I?void 0:I.reasons)&&void 0!==j?j:[],Pt=Boolean(kt.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(N=null==wt?void 0:wt.review_step.reason)||void 0===N?void 0:N.trim())||(null===(B=null==wt?void 0:wt.review_step.gap)||void 0===B?void 0:B.trim())),At=null==wt?null:"boundary"===wt.kind?y.getBoundaryReviewActionBadgeLabel(wt.review_step,wt.segment,pn.get(null!==(T=wt.segment.stable_key)&&void 0!==T?T:"")):y.getTitleReviewActionBadgeLabel(wt.review_step,wt.segment,pn.get(null!==(L=wt.segment.stable_key)&&void 0!==L?L:"")),Mt="label"===(null==wt?void 0:wt.kind)?[At,wt.review_step.human_action_enum,null===(F=wt.review_step.review)||void 0===F?void 0:F.action,null===(q=wt.review_step.human_resolution)||void 0===q?void 0:q.action]:[],It="label"===(null==wt?void 0:wt.kind)&&Mt.some(function(e){var n,t=null!==(n=null==e?void 0:e.trim().toUpperCase())&&void 0!==n?n:"";return t.includes("MERGE")||t.includes("SPLIT")}),jt=null!=wt&&En.some(function(e){return"boundary"===e.kind&&v.getSegmentReviewKey(e.segment)===v.getSegmentReviewKey(wt.segment)}),Nt=It&&!jt,Bt=("boundary"===(null==wt?void 0:wt.kind)||Nt)&&null!=wt?function(){var e,n,i,r,o,a;if("boundary"===wt.kind)return wt;var l=cn.find(function(e){return v.getSegmentReviewKey(e.segment)===v.getSegmentReviewKey(wt.segment)});return l?t.__assign(t.__assign({},l),{kind:"boundary",pageNumber:null!==(e=l.metadata.focus_page)&&void 0!==e?e:l.segment.start_page}):t.__assign(t.__assign({},wt),{kind:"boundary",pageNumber:null!==(i=null===(n=wt.segment.review_action)||void 0===n?void 0:n.focus_page)&&void 0!==i?i:wt.segment.start_page,metadata:{focus_page:null!==(o=null===(r=wt.segment.review_action)||void 0===r?void 0:r.focus_page)&&void 0!==o?o:null,boundary_margin:null!==(a=wt.segment.boundary_margin)&&void 0!==a?a:null,user_actions:[]}})}():void 0,Tt=null==wt?"":(null===(W=wt.segment.label)||void 0===W?void 0:W.trim())||wt.segment.title,Lt=null==wt?void 0:wt.review_step.revert,Ft=null==wt?void 0:wt.segment.revert,qt=function(e){return null==e?void 0:e.trim().toLowerCase()},Wt=null==wt||null===(z=t.__spreadArray([],null!==(K=wt.segment.review_steps)&&void 0!==K?K:[],!0).reverse().find(function(e){var n,t,i=null===(n=e.type)||void 0===n?void 0:n.trim().toLowerCase();return("page_boundary"===i||"page boundary review"===i)&&"boundary"===qt(null===(t=e.revert)||void 0===t?void 0:t.type)}))||void 0===z?void 0:z.revert,Kt=null!==(G=null!=Lt?Lt:null==wt?void 0:wt.segment.revert)&&void 0!==G?G:Wt,zt=null==Kt?void 0:Kt.decision.trim().toUpperCase();null!=At||(null==zt?void 0:zt.includes("SPLIT"))||null==zt||zt.includes("MERGE");var Gt="label"===(null==wt?void 0:wt.kind)&&"SET_RANGE"===(null===(O=null==Wt?void 0:Wt.decision)||void 0===O?void 0:O.trim().toUpperCase())&&Wt.current_segment_ids.length!==Wt.previous_state.length,Ot="Merged"===At||"Split"===At||Gt,Dt=null==wt?void 0:Ot?"boundary"===qt(null==Wt?void 0:Wt.type)?Wt:"boundary"===qt(null==Ft?void 0:Ft.type)?Ft:"boundary"===qt(null==Lt?void 0:Lt.type)?Lt:void 0:"label"===wt.kind?"label"===qt(null==Lt?void 0:Lt.type)?Lt:void 0:"boundary"===wt.kind?"boundary"===qt(null==Lt?void 0:Lt.type)?Lt:"boundary"===qt(null==Wt?void 0:Wt.type)?Wt:"boundary"===qt(null==Ft?void 0:Ft.type)?Ft:void 0:void 0,Vt=Ot&&(null==Dt?void 0:Dt.operation_id)?de.flatMap(function(e){var n;return null!==(n=e.review_steps)&&void 0!==n?n:[]}).find(function(e){var n,t,i,r,o,a,l,u=null===(n=e.type)||void 0===n?void 0:n.trim().toLowerCase();return("page_boundary"===u||"page boundary review"===u)&&((null!==(o=null!==(i=null===(t=e.human_resolution)||void 0===t?void 0:t.operation_id)&&void 0!==i?i:null===(r=e.revert)||void 0===r?void 0:r.operation_id)&&void 0!==o?o:e.operation_id)===Dt.operation_id&&Boolean(null===(l=null===(a=e.human_resolution)||void 0===a?void 0:a.change_summary)||void 0===l?void 0:l.trim()))}):void 0,Ht=(null===(D=null==Dt?void 0:Dt.summary)||void 0===D?void 0:D.trim())||null,Ut=Ot?(null===(H=null===(V=null==Vt?void 0:Vt.human_resolution)||void 0===V?void 0:V.change_summary)||void 0===H?void 0:H.trim())||(null===(U=null==Dt?void 0:Dt.summary)||void 0===U?void 0:U.trim())||"":(null===(Y=null===(X=null===(Z=null==wt?void 0:wt.review_step)||void 0===Z?void 0:Z.human_resolution)||void 0===X?void 0:X.change_summary)||void 0===Y?void 0:Y.trim())||(null===($=null===(J=null==wt?void 0:wt.review_step)||void 0===J?void 0:J.summary)||void 0===$?void 0:$.trim())||"",Zt=wt&&Dt?{currentSegment:{title:Tt,startPage:wt.segment.start_page,endPage:wt.segment.end_page},previousSegments:(null!==(Q=Dt.previous_state)&&void 0!==Q?Q:[]).flatMap(function(e){var n,t=null===e.label?"Untitled document":null===(n=e.label)||void 0===n?void 0:n.trim();return t?[{title:t,startPage:e.start_page,endPage:e.end_page}]:[]})}:null,Xt="page"===(null==wt?void 0:wt.kind)&&null!==(ee=wt.metadata.classification_id)&&void 0!==ee?ee:null,Yt="page"===(null==wt?void 0:wt.kind)?Boolean(Ge&&Xt):Boolean((null==Dt?void 0:Dt.operation_id)&&(null==Dt?void 0:Dt.type)&&!1!==(null==Dt?void 0:Dt.revertable)),Jt=Boolean(Zt&&Yt&&("page"!==(null==wt?void 0:wt.kind)||Xt)),$t=r.useCallback(function(e,n){at.current+=1,lt.current={requestId:at.current,pageNumber:e,reviewId:n},Dn({pageNumber:e,requestId:at.current})},[]),Qt=r.useCallback(function(e){var n,t;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(null==sn||sn({reviewId:e.id,segment_id:null!==(t=e.segment.segment_id)&&void 0!==t?t:null,reviewStepIndex:e.reviewStepIndex,kind:e.kind,pageNumber:e.pageNumber,metadata:e.metadata}),Qn(null),tt(null),jn(e.id),Tn(e.id),qn(!1),zn(null),$t(e.pageNumber,e.id),null==De||De(e.id,e.segment))},[De,sn,$t]);r.useEffect(function(){if(nt){var e=requestAnimationFrame(function(){return ot(!0)}),n=window.setTimeout(function(){ot(!1)},3500),t=window.setTimeout(function(){tt(null)},4e3);return function(){cancelAnimationFrame(e),window.clearTimeout(n),window.clearTimeout(t)}}},[nt]),r.useEffect(function(){var e,n,t,i;if(un){if("pageGroup"===un.type){var r=null!==(e=un.pages)&&void 0!==e?e:[],o=null!==(n=un.pageIndex)&&void 0!==n?n:0,a=r[o];if(null==a)return;return ei(),Qn({pages:r,index:o,label:null!==(t=un.groupLabel)&&void 0!==t?t:""}),at.current+=1,void Dn({pageNumber:a,requestId:at.current})}if(Qn(null),un.reviewId){var l=En.find(function(e){return e.id===un.reviewId&&(!un.type||e.kind===un.type)});if(l)return void Qt(l)}if(un.classificationId){var u=En.find(function(e){var n;return"page"===e.kind&&(e.metadata.classification_id===un.classificationId||(null===(n=e.metadata.type_choices)||void 0===n?void 0:n.some(function(e){return e.classification_id===un.classificationId})))&&(!un.segmentId||e.segment.segment_id===un.segmentId)&&(!un.type||e.kind===un.type)});if(u)return void Qt(u)}if(un.pageNumber&&un.type){var s=Number(un.pageNumber);if(Number.isInteger(s)&&!(s<1)){var d=null===(i=un.pageType)||void 0===i?void 0:i.trim().toLowerCase(),c=En.find(function(e){var n,t="page"===e.kind?e.pageNumber:e.segment.start_page,i="page"!==e.kind||!d||e.metadata.page_type===d||(null===(n=e.metadata.type_choices)||void 0===n?void 0:n.some(function(e){return e.page_type===d}));return(!un.segmentId||e.segment.segment_id===un.segmentId)&&t===s&&e.kind===un.type&&i});c?Qt(c):"page"===un.type&&(ei(),at.current+=1,Dn({pageNumber:s,requestId:at.current}))}}}},[un,Qt,En]);var ei=r.useCallback(function(){lt.current=null,qn(!1),jn(null),zn(null),null==De||De(null,null)},[De]),ni=r.useCallback(function(e){var n;ot(!1),tt(null);var t=null!==(n=En.find(function(n){return!_t.has(n.id)&&"boundary"===n.kind&&n.segment.start_page===e.startPage&&n.segment.end_page===e.endPage}))&&void 0!==n?n:En.find(function(n){return!_t.has(n.id)&&n.segment.start_page<=e.startPage&&n.segment.end_page>=e.startPage});t?Qt(t):(ei(),at.current+=1,Dn({pageNumber:e.startPage,requestId:at.current}))},[ei,_t,En,Qt]),ti=r.useCallback(function(e,n){var t,i=x.getReviewScoreBand(e.review_step.score),r=null==ke||i===ke,o=Hn.has(e.id)&&y.isReviewStepResolutionCurrent(e.review_step,e.segment);return e.id!==n&&r&&!0!==(null===(t=e.segment.confidence)||void 0===t?void 0:t.awaiting_llm)&&!y.isReviewStepResolved(e.review_step,e.segment)&&!o},[ke,Hn]),ii=r.useCallback(function(e){var n;if(Ce){var t=En.findIndex(function(n){return n.id===e}),i=null!==(n=En.find(function(n,i){return i>t&&ti(n,e)}))&&void 0!==n?n:En.find(function(n){return ti(n,e)});i?requestAnimationFrame(function(){return Qt(i)}):ei()}else ei()},[Ce,ei,ti,En,Qt]),ri=r.useCallback(function(e,n){return t.__awaiter(le,void 0,void 0,function(){var i,r,o,a,l,u,s,d,g,v;return t.__generator(this,function(m){switch(m.label){case 0:if(Ze||!ze||0===n.length)return[2];if(2!==(i=null!==(v=e.metadata.type_choices)&&void 0!==v?v:[]).length)return[2];r=new Set(n),o=E(e),a=t.__spreadArray([],i,!0).sort(function(e,n){var t=r.has(e.page_type);return t===r.has(n.page_type)?0:t?-1:1}),Yn(e.id),m.label=1;case 1:m.trys.push([1,6,7,8]),l=0,u=a,m.label=2;case 2:return l<u.length?(s=u[l],d=r.has(s.page_type)?c.PageCheckActionEnum.YES:c.PageCheckActionEnum.NO,[4,ze(d,{action:d,pageType:s.page_type,metadata:{user_actions:[c.PageCheckActionEnum.YES,c.PageCheckActionEnum.NO],page_num:e.metadata.page_num,page_type:s.page_type,classification_id:s.classification_id}},o)]):[3,5];case 3:m.sent(),m.label=4;case 4:return l++,[3,2];case 5:return Un(function(n){var t=new Set(n);return t.add(e.id),t}),ii(e.id),[3,8];case 6:return g=m.sent(),null==He||He(g,o),[3,8];case 7:return Yn(null),[7];case 8:return[2]}})})},[Ze,He,ze,ii]),oi=r.useCallback(function(e,n,i){return t.__awaiter(le,void 0,void 0,function(){var r,o,a,u,s,d,c,g,m,p;return t.__generator(this,function(t){switch(t.label){case 0:if(Ze)return[2];if("boundary"===e.kind&&!We)return[2];if("label"===e.kind&&!Ke)return[2];if("page"===e.kind&&!ze)return[2];r=E(e),a=i,u=(o=n)===l.BoundaryReviewActionEnum.SET_RANGE?function(){var n=a.startPage,t=a.endPage;if(null==n||null==t)return null;var i=n<e.segment.start_page||t>e.segment.end_page,r=n>e.segment.start_page||t<e.segment.end_page;return i&&!r?n<e.segment.start_page?l.BoundaryReviewActionEnum.MERGE_PREV:l.BoundaryReviewActionEnum.MERGE_NEXT:r?l.BoundaryReviewActionEnum.SPLIT_HERE:null}():o,s="boundary"===e.kind&&null!=We&&Ce&&(u===l.BoundaryReviewActionEnum.SPLIT_HERE||u===l.BoundaryReviewActionEnum.MERGE_NEXT||u===l.BoundaryReviewActionEnum.MERGE_PREV||u===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),d=s?de.findIndex(function(n){return v.getSegmentReviewKey(n)===v.getSegmentReviewKey(e.segment)}):-1,s&&d>=0&&u&&(ut.current={action:u,originalSegmentIndex:d,segmentSignature:JSON.stringify(de.map(function(e,n){var t;return{key:v.getSegmentReviewKey(e,n),startPage:e.start_page,endPage:e.end_page,version:null!==(t=e.version)&&void 0!==t?t:null}})),ready:!1}),Yn(e.id),t.label=1;case 1:return t.trys.push([1,8,9,10]),"boundary"!==e.kind?[3,3]:[4,null==We?void 0:We(n,i,r)];case 2:return t.sent(),[3,7];case 3:return"label"!==e.kind?[3,5]:[4,null==Ke?void 0:Ke(n,i,r)];case 4:return t.sent(),[3,7];case 5:return"page"!==e.kind?[3,7]:[4,null==ze?void 0:ze(n,i,r)];case 6:t.sent(),t.label=7;case 7:return Un(function(n){var t=new Set(n);return t.add(e.id),t}),c="boundary"===e.kind&&(u===l.BoundaryReviewActionEnum.MERGE_NEXT||u===l.BoundaryReviewActionEnum.MERGE_PREV||u===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),("boundary"===e.kind&&u===l.BoundaryReviewActionEnum.SPLIT_HERE||c)&&u&&(g=v.getSegmentReviewKey(e.segment),wn(function(e){var n=new Set(e);return o===l.BoundaryReviewActionEnum.SET_RANGE?n.add(g):n.delete(g),n}),fn(function(e){var n=new Map(e);return n.set(g,u),n})),ut.current?(ut.current.ready=!0,c&&(m=En.find(function(n){return"label"===n.kind&&v.getSegmentReviewKey(n.segment)===v.getSegmentReviewKey(e.segment)}))&&requestAnimationFrame(function(){return Qt(m)})):ii(e.id),[3,10];case 8:return p=t.sent(),s&&(ut.current=null),null==He||He(p,r),[3,10];case 9:return Yn(null),[7];case 10:return[2]}})})},[Ce,Ze,He,We,Ke,ze,Ge,En,de,Qt,ii]);r.useEffect(function(){var e=ut.current;if(null==e?void 0:e.ready){var n=JSON.stringify(de.map(function(e,n){var t;return{key:v.getSegmentReviewKey(e,n),startPage:e.start_page,endPage:e.end_page,version:null!==(t=e.version)&&void 0!==t?t:null}}));if(n!==e.segmentSignature){var t=e.action===l.BoundaryReviewActionEnum.SPLIT_HERE?e.originalSegmentIndex+1:e.action===l.BoundaryReviewActionEnum.MERGE_PREV||e.action===l.BoundaryReviewActionEnum.MERGE_PREVIOUS?Math.max(0,e.originalSegmentIndex-1):e.originalSegmentIndex,i=new Map(de.map(function(e,n){return[v.getSegmentReviewKey(e,n),n]})),r=En.find(function(e){var n=i.get(v.getSegmentReviewKey(e.segment));return null!=n&&n>=t&&ti(e)});if(!r)return ut.current=null,void ei();requestAnimationFrame(function(){ut.current=null,Qt(r)})}}},[ei,ti,En,de,Qt]),r.useEffect(function(){ut.current||In&&!En.some(function(e){return e.id===In})&&ei()},[In,ei,En]),r.useEffect(function(){if(Re&&!ut.current){var e=En.find(function(e){return e.pageNumber===Pn});e&&e.id!==In&&Qt(e)}},[In,Re,Pn,Qt,En]),r.useEffect(function(){ut.current||In&&!En.some(function(e){var n;return e.id===In&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&ei()},[In,ei,En]);var ai=r.useMemo(function(){var e=En.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===ye)return e;var n=["low","medium","high"].filter(function(e){return e!==_e}),i=t.__spreadArray([_e],n,!0),r=new Map(i.map(function(e,n){return[e,n]}));return e.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,a,l,u=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),s=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==u?i.length:null!==(a=r.get(u))&&void 0!==a?a:i.length)-(null==s?i.length:null!==(l=r.get(s))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[ye,_e,En]),li=ai.findIndex(function(e){return e.id===Bn}),ui=r.useState(null),si=ui[0],di=ui[1],ci=r.useState(null),gi=ci[0],vi=ci[1],mi=r.useRef(!1),pi=r.useCallback(function(e){var n=ai[e];n&&Qt(n)},[ai,Qt]);r.useCallback(function(e){if(!(!$n||e<0||e>=$n.pages.length)){var n=$n.pages[e];null!=n&&(ei(),Qn(function(n){return null==n?n:t.__assign(t.__assign({},n),{index:e})}),at.current+=1,Dn({pageNumber:n,requestId:at.current}))}},[$n,ei]),r.useEffect(function(){Bn&&!ai.some(function(e){return e.id===Bn})&&Tn(null)},[ai,Bn]),r.useEffect(function(){mi.current=!1,vi(null),di(li>=0?String(li+1):null)},[li,ai.length]),r.useEffect(function(){if(mi.current&&null!=si){var e=window.setTimeout(function(){var e=Number(si.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<ai.length&&(mi.current=!1,pi(n))},300);return function(){return window.clearTimeout(e)}}},[pi,si,ai.length]);var fi=r.useMemo(function(){var e=new Map;En.forEach(function(n){var t,i=null!==(t=e.get(v.getSegmentReviewKey(n.segment)))&&void 0!==t?t:[];i.push(n),e.set(v.getSegmentReviewKey(n.segment),i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=yn.get(t))&&void 0!==i?i:1;e.sort(function(e,n){return e.reviewStepIndex-n.reviewStepIndex}).forEach(function(e,t){n.set(e.id,"".concat(r).concat(function(e){for(var n=e+1,t="";n>0;)n-=1,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}(t)))})}),n},[En,yn]),hi=r.useMemo(function(){var e=new Map;En.forEach(function(n){var t,i=null!==(t=e.get(n.pageNumber))&&void 0!==t?t:[];i.push(n),e.set(n.pageNumber,i)});var n=new Map;return e.forEach(function(e){e.forEach(function(e,t){return n.set(e.id,t)})}),n},[En]),_i=r.useCallback(function(e){return{startPage:Math.max(0,e.startPage-Ae),endPage:Math.min(e.numPages-1,e.endPage+Ae)}},[Ae]),wi=r.useCallback(function(){var e,n=ct.current,t=gt.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),o=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();En.forEach(function(e){var n,r=st.current.get(e.id);if(r){var a=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(a){var l=a.getBoundingClientRect(),u=null!==(n=hi.get(e.id))&&void 0!==n?n:0,s=l.top+Ie+40*u,d=s+(r.offsetHeight||32),c=s>=o.top&&d<=o.bottom;r.style.top="".concat(s-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}});var a=dt.current;if(a){var l=null==$n?void 0:$n.pages[$n.index],u=null==l?null:t.querySelector('[data-testid="core__page-layer-'.concat(l-1,'"]'));if($n&&u){var s=u.getBoundingClientRect().top+Ie,d=s+(a.offsetHeight||25),c=s>=o.top&&d<=o.bottom;a.style.top="".concat(s-i.top,"px"),a.style.visibility=c?"visible":"hidden"}else a.style.visibility="hidden"}if(In&&null==lt.current){var g=st.current.get(In);g&&"hidden"!==g.style.visibility&&zn(function(e){return e===g?e:g})}}},[$n,In,Ie,hi,En]),yi=r.useCallback(function(e){var n=lt.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(lt.current=null,wi(),requestAnimationFrame(function(){if(null==lt.current){var e=st.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&zn(e)}}))},[wi]);return r.useEffect(function(){var e=gt.current;if(e&&fe){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,wi()}))};e.addEventListener("scroll",t,!0),window.addEventListener("resize",t);var i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});var r="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==r||r.observe(e),t(),function(){null!=n&&cancelAnimationFrame(n),e.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t),i.disconnect(),null==r||r.disconnect()}}},[fe,wi]),i.jsxs("div",t.__assign({ref:ct,className:rn,style:t.__assign(t.__assign({},on),{display:"block",position:"relative",width:"100%",height:"100%",minWidth:0,overflowX:"auto",overflowY:"hidden"})},{children:[i.jsxs("div",t.__assign({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,width:"100%",minWidth:700,height:"100%"}},{children:[i.jsx("div",t.__assign({ref:gt,style:t.__assign(t.__assign({},an),{flex:"1 1 auto",width:fe?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:i.jsx(a.default,t.__assign({highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1,showRotateButton:!0},ve,{defaultScale:void 0===me?null!==(ne=null==ve?void 0:ve.defaultScale)&&void 0!==ne?ne:o.SpecialZoomLevel.PageFit:R[me],disablePdfAnnotations:Ye,disablePdfTextLayer:$e,pdfUrl:ue,pdfName:se,segments:Cn,navigationRequest:On,onNavigationSettled:yi,setRenderRange:_i,onCurrentPageChange:function(e){An(e),null==lt.current&&wt&&wt.pageNumber!==e&&ei(),null==Ve||Ve(e)}}))})),fe&&i.jsxs("aside",t.__assign({"aria-label":"Page review badges",ref:Rn,style:t.__assign(t.__assign({},ln),{position:"relative",width:ht,maxWidth:S,flex:"0 1 ".concat(ht),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[$n&&i.jsx("span",t.__assign({ref:dt,style:{position:"absolute",top:0,left:10,visibility:"hidden",zIndex:2,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,minHeight:25,padding:"2px 8px",border:"1px solid #E2E8F0",borderRadius:16,backgroundColor:"#F8FAFC",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)",font:"inherit"}},{children:i.jsxs(p.Typography,t.__assign({fontFamily:"Inter",sx:{fontSize:11,fontWeight:500,color:"#475569",whiteSpace:"nowrap"}},{children:[$n.label||"Pages"," Pg: ",$n.index+1]}))})),xe&&ai.length>0&&!$n&&i.jsxs("nav",t.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:Ne||"auto",left:Te||"auto",zIndex:2,display:"flex",alignItems:"center",gap:7,width:128,minHeight:40,padding:"4px 6px",border:"1px solid #CBD5E1",borderRadius:6,backgroundColor:"#FFFFFF",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.06)",font:"inherit"}},{children:[i.jsx(p.Tooltip,t.__assign({title:"out-of-range"===gi?"Please enter valid number present in the range":"Please enter valid numbers",open:null!=gi,placement:"top",arrow:!0},{children:i.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=si?si:"-",min:0,max:ai.length,"aria-label":"Review badge number","aria-invalid":null!=gi,onFocus:function(){null==si&&di("")},onBlur:function(){vi(null);var e=Number(si);(null==si||""===si||!Number.isInteger(e)||e<1||e>ai.length)&&(mi.current=!1,di(li>=0?String(li+1):null))},onChange:function(e){var n=e.target.value;if(/^\d*$/.test(n)){var t=Number(n),i=""!==n&&(t<1||t>ai.length);vi(i?"out-of-range":null),mi.current=!0,di(n)}else vi("invalid-number")},style:{width:30,height:28,padding:0,border:"1px solid ".concat(gi?"#DC2626":"#A5B4FC"),borderRadius:3,color:"#4F46E5",backgroundColor:"#FFFFFF",textAlign:"center",font:"inherit",fontSize:15,outline:"none"}})})),i.jsxs("span",t.__assign({"aria-label":"".concat(ai.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",ai.length]})),["previous","next"].map(function(e){var n="previous"===e,r=li+(n?-1:1),o=r<0||r>=ai.length;return i.jsx("button",t.__assign({type:"button","aria-label":"".concat(n?"Previous":"Next"," review badge"),disabled:o,onClick:function(){return pi(r)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:o?"#C7D2FE":"#4F46E5",cursor:o?"default":"pointer"}},{children:i.jsx("svg",t.__assign({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:i.jsx("path",{d:n?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),e)})]})),!$n&&En.map(function(e){var n,r,o=In===e.id,a=null!==(n=fi.get(e.id))&&void 0!==n?n:"1A",l=e.review_step.score,u=e.review_step.confidence,s=y.formatScore(l,u),d="boundary"===e.kind?y.getBoundaryReviewActionBadgeLabel(e.review_step,e.segment,pn.get(v.getSegmentReviewKey(e.segment))):"label"===e.kind?y.getTitleReviewActionBadgeLabel(e.review_step,e.segment,pn.get(v.getSegmentReviewKey(e.segment))):null,c=null!=d?d:"N/A"===s?s:"".concat(s,"%"),g=!0===(null===(r=e.segment.confidence)||void 0===r?void 0:r.awaiting_llm),f=y.getConfidenceColors(l,u,g),h=_t.has(e.id),_=g;return i.jsx(p.Tooltip,t.__assign({title:g?"data is being processed":"",arrow:!0},{children:i.jsx("span",t.__assign({ref:function(n){n?st.current.set(e.id,n):st.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:_?"not-allowed":"pointer"}},{children:i.jsx("button",t.__assign({disabled:_,type:"button","aria-pressed":o,"aria-label":g?"".concat(e.review_step.type," · Page ").concat(e.pageNumber," · Data is being processed"):"".concat(e.review_step.type," · Page ").concat(e.pageNumber),onClick:function(){return Qt(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:d?h&&!g?115:90:h&&!g?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(h&&!g?"#E2E8F0":f.border),borderRadius:16,backgroundColor:h&&!g?"#F8FAFC":f.background,color:h&&!g?"#475569":f.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:h&&!g?i.jsxs(p.Typography,t.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),i.jsxs("span",t.__assign({style:{display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:c}))]})),i.jsxs("span",t.__assign({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:i.jsx(m.CircleCheck,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]})):i.jsxs(p.Typography,t.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),i.jsxs("span",t.__assign({style:{display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:f.divider,strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:c}))]}))]}))}))}))}),e.id)})]}))]})),wt&&Kn&&i.jsxs(u.default,t.__assign({anchorElement:Kn,placement:"bottom-start",offset:{top:8},width:Math.min(mt,S),maxWidth:S,heightBuffer:null!=qe?qe:25},{children:[Fn&&i.jsx(s.default,{width:"100%",maxWidth:"100%",score:wt.review_step.score,reasons:kt,reason:wt.review_step.reason,gap:wt.review_step.gap,onBack:function(){return qn(!1)},onClose:ei}),i.jsx("div",t.__assign({style:{display:Fn?"none":"block"}},{children:_t.has(wt.id)?i.jsx(f.default,{width:"100%",maxWidth:"100%",headerName:"page"===wt.kind?"Page format approved":"Split"===At?"Split approved":"Merged"===At?"Merge approved":"User approved",headerIcon:"page"===wt.kind?i.jsx(m.Check,{size:18,strokeWidth:2}):"Merged"===At?i.jsx(m.GitMerge,{size:18,strokeWidth:2}):"Split"===At?i.jsx(b.default,{width:18,height:18}):i.jsx(m.CircleCheck,{size:18,strokeWidth:2}),title:Tt,pageNo:"Page ".concat(wt.segment.start_page,"-").concat(wt.segment.end_page),summary:Jt&&Zt?i.jsx(_.default,{icon:i.jsx(m.CircleCheck,{size:14,strokeWidth:2}),title:Tt,pageRange:"Page ".concat(wt.segment.start_page,"-").concat(wt.segment.end_page),description:null!=Ut?Ut:null,revertData:Zt,confirmDisabled:"page"===wt.kind?!Yt:null==Oe||!Yt,showDocumentHeader:!1,onRevert:function(){if("page"===wt.kind){if(!Ge||!Xt){var e=new Error("SegmentReviewPdfWrapper requires onPageTypeRevert and a classification id to revert a page-type decision.");return null==He||He(e,E(wt)),Promise.reject(e)}return Ge({classification_id:Xt,human_verdict:"No"},E(wt))}if(!Oe)throw new Error("SegmentReviewPdfWrapper requires onRevert to handle a revert confirmation.");if(!Dt)throw new Error("There is no valid revert operation for this review.");var n=Ot?"boundary":"label"===wt.kind?"label":"boundary"===wt.kind?"boundary":null,t=qt(Dt.type);if(n&&t!==n)throw new Error("Cannot use ".concat(null!=t?t:"unknown"," revert metadata for this review. Expected ").concat(n,"."));return Oe(Dt,E(wt))},onRevertError:function(e){null==He||He(e,E(wt))},onRevertComplete:function(e){var n,t,i,r,o,a;Un(function(){return new Set}),"page"!==wt.kind&&(wn(function(){return new Set}),fn(function(){return new Map})),wt.id;var l=null!==(n=Zt.previousSegments[0])&&void 0!==n?n:Zt.currentSegment,u=null==Kn?void 0:Kn.getBoundingClientRect(),s=null===(t=gt.current)||void 0===t?void 0:t.getBoundingClientRect(),d=Math.min(S,Math.max(220,mt)),c=null!==(i=null==u?void 0:u.left)&&void 0!==i?i:(null!==(r=null==s?void 0:s.right)&&void 0!==r?r:window.innerWidth-d-8)+8,g=Math.max(8,Math.min(c,window.innerWidth-d-8)),v=null==(null==u?void 0:u.bottom)?Math.max(8,null!==(o=null==s?void 0:s.top)&&void 0!==o?o:8):u.bottom+8;Un(function(){return new Set}),"page"!==wt.kind&&(ut.current=null),ot(!1),tt({title:"Split"===At?"Split reverted":"Merged"===At?"Merge reverted":"Approval reverted",description:(null===(a=null==e?void 0:e.message)||void 0===a?void 0:a.trim())||null,segment:l,position:{top:v,left:g,width:d}}),ei()}},wt.id):void 0,additionalActions:Bt?i.jsx(h.default,{metadata:Bt.metadata,reviewAction:null!==(te=wt.segment.review_action)&&void 0!==te?te:void 0,startPage:wt.segment.start_page,endPage:wt.segment.end_page,title:Tt,previousSegmentTitle:Rt,nextSegmentTitle:Et,disabled:Ze||!We||Xn===wt.id,onConfirm:function(e,n){oi(Bt,e,n)}}):void 0,cognitiveScore:wt.review_step.score,styles:{root:{borderColor:"#16A34A"},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:"#16A34A"}}},onCognitiveClick:Pt?function(){qn(!0),null==tn||tn(E(wt))}:void 0,onClose:ei}):"boundary"===wt.kind?i.jsx(l.default,{width:"100%",maxWidth:"100%",totalPages:ce,title:wt.segment.label||wt.segment.title,pageNo:"Page ".concat(wt.pageNumber),content:null!==(ie=wt.review_step.question)&&void 0!==ie?ie:null,revertSummary:Ht,cognitiveScore:wt.review_step.score,metadata:wt.metadata,reviewAction:null!==(re=wt.segment.review_action)&&void 0!==re?re:void 0,previousSegmentTitle:Rt,nextSegmentTitle:Et,manualPrompt:null!=Fe?Fe:"Set a custom boundary",defaultStartPage:wt.segment.start_page,defaultEndPage:wt.segment.end_page,styles:{root:{borderColor:Ct.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Ct.text}}},confirmDisabled:Ze||!We||Xn===wt.id,onConfirm:function(e,n,t){t&&l.isBoundaryReviewAction(n.id)&&oi(wt,n.id,t)},onAdjustManually:function(){return null==nn?void 0:nn(E(wt))},onCognitiveClick:Pt?function(){qn(!0),null==tn||tn(E(wt))}:void 0,onClose:ei},wt.id):"label"===wt.kind?i.jsx(d.default,{width:"100%",maxWidth:"100%",title:wt.metadata.current_label||wt.segment.label||wt.segment.title,pageNo:"Pages ".concat(wt.segment.start_page,"-").concat(wt.segment.end_page),content:null!==(oe=wt.review_step.question)&&void 0!==oe?oe:null,revertSummary:Ht,cognitiveScore:wt.review_step.score,metadata:wt.metadata,styles:{root:{borderColor:Ct.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Ct.text}}},confirmDisabled:Ze||!Ke||Xn===wt.id,confirmationBlocked:yt,confirmationWarning:yt?"Please confirm the boundary before confirming the title.":void 0,onActionConfirm:function(e,n){oi(wt,e,n)},onAdjustManually:function(){return null==nn?void 0:nn(E(wt))},onCognitiveClick:Pt?function(){qn(!0),null==tn||tn(E(wt))}:void 0,onClose:ei},wt.id):2===(null===(ae=wt.metadata.type_choices)||void 0===ae?void 0:ae.length)?i.jsx(g.default,{width:"100%",maxWidth:"100%",title:wt.segment.label||wt.segment.title,pageNo:"Page ".concat(wt.pageNumber),content:wt.review_step.reason,choices:wt.metadata.type_choices,cognitiveScore:wt.review_step.score,styles:{root:{borderColor:Ct.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Ct.text}}},confirmDisabled:Ze||!ze||Xn===wt.id,onConfirm:function(e){ri(wt,e)},onCognitiveClick:Pt?function(){qn(!0),null==tn||tn(E(wt))}:void 0,onClose:ei},wt.id):i.jsx(c.default,{width:"100%",maxWidth:"100%",title:wt.segment.label||wt.segment.title,pageNo:"Page ".concat(wt.pageNumber),content:wt.review_step.reason,cognitiveScore:wt.review_step.score,pageType:wt.metadata.page_type,metadata:wt.metadata,styles:{root:{borderColor:Ct.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Ct.text}}},confirmDisabled:Ze||!ze||Xn===wt.id,onActionConfirm:function(e,n){oi(wt,e,n)},onCognitiveClick:Pt?function(){qn(!0),null==tn||tn(E(wt))}:void 0,onClose:ei},wt.id)}))]})),nt&&i.jsx(p.Portal,{children:i.jsx(p.Box,t.__assign({"aria-live":"polite",sx:{position:"fixed",top:nt.position.top,left:nt.position.left,zIndex:1600,width:nt.position.width,maxWidth:"calc(100vw - 16px)",opacity:rt?1:0,transform:rt?"translateY(0)":"translateY(-6px)",transition:"opacity 500ms ease, transform 500ms ease",filter:"drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18))",pointerEvents:rt?"auto":"none"}},{children:i.jsx(w.default,{title:nt.title,description:nt.description,onReview:function(){return ni(nt.segment)}})}))})]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n,t=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),o=require("@react-pdf-viewer/core"),a=require("../PdfViewer/PdfViewer.js"),l=require("./BoundaryCard.js"),u=require("./CardWrapper.js"),d=require("./CognitiveIntegrity.js"),s=require("./LabelCheck.js"),g=require("./PageCheck.js"),c=require("./reviewStepAdapters.js"),v=require("lucide-react"),m=require("@mui/material"),p=require("./ReviewedCard.js"),f=require("./ReviewedBoundaryActions.js"),w=require("./RevertCard.js"),_=require("./RevertSuccessCard.js"),h=require("./helper.js"),y=require("./ChartBreakoutCircle.js"),b=260;exports.SegmentPdfSpecialZoomLevel=void 0,(n=exports.SegmentPdfSpecialZoomLevel||(exports.SegmentPdfSpecialZoomLevel={})).ActualSize="ActualSize",n.PageFit="PageFit",n.PageWidth="PageWidth";var S=((e={})[exports.SegmentPdfSpecialZoomLevel.ActualSize]=o.SpecialZoomLevel.ActualSize,e[exports.SegmentPdfSpecialZoomLevel.PageFit]=o.SpecialZoomLevel.PageFit,e[exports.SegmentPdfSpecialZoomLevel.PageWidth]=o.SpecialZoomLevel.PageWidth,e),x=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};exports.default=function(e){var n,R,E,C,P,k,A,M,I,j,B,N,L,T,F,q,K,W,z,G,O,D,V,H,U,Z,X,Y,J,Q,$,ee,ne,te,ie=this,re=e.pdfUrl,oe=e.pdfName,ae=e.segments,le=e.totalPages,ue=e.styles,de=e.pdfViewerProps,se=e.specialZoomLevel,ge=e.showBadges,ce=void 0===ge||ge,ve=e.sortByConfidence,me=void 0===ve?"low":ve,pe=e.filterByConfidence,fe=void 0===pe?"all":pe,we=e.showBadgeNavigation,_e=void 0===we||we,he=e.autoSelectReviewOnPageChange,ye=void 0!==he&&he,be=e.autoAdvanceAfterConfirm,Se=void 0===be||be,xe=e.autoAdvanceScoreBand,Re=e.badgePreloadPages,Ee=void 0===Re?8:Re,Ce=e.badgeOffsetTop,Pe=void 0===Ce?20:Ce,ke=e.badgeOffsetRight,Ae=void 0===ke?68:ke,Me=e.badgeOffsetLeft,Ie=void 0===Me?0:Me,je=e.initialReviewId,Be=e.manualPrompt,Ne=e.heightBuffer,Le=e.onBoundaryAction,Te=e.onLabelAction,Fe=e.onPageAction,qe=e.onPageTypeRevert,Ke=e.onRevert,We=e.onActiveReviewChange,ze=e.onCurrentPageChange,Ge=e.onActionError,Oe=e.disableAllActions,De=void 0!==Oe&&Oe,Ve=e.disablePdfAnnotations,He=void 0!==Ve&&Ve,Ue=e.disablePdfTextLayer,Ze=void 0===Ue||Ue,Xe=e.disableTitleCheckUntilBoundaryCheckCompleted,Ye=void 0!==Xe&&Xe,Je=e.onAdjustManually,Qe=e.onCognitiveClick,$e=e.className,en=e.style,nn=e.viewerStyle,tn=e.railStyle,rn=e.redirectionData,on=e.onBadgeSelected;console.log("LOG: TOTAL PAGE IN PARENT",le);var an=r.useMemo(function(){return c.extractSegmentReviewData(ae)},[ae]),ln=an.boundaryReviews,un=an.labelReviews,dn=an.pageReviews,sn=r.useState(function(){return new Map}),gn=sn[0],cn=sn[1],vn=r.useState(function(){return new Set}),mn=vn[0],pn=vn[1],fn=r.useMemo(function(){var e=new Map,n=1;return ae.forEach(function(t,i){var r=c.getSegmentReviewKey(t,i);e.has(r)||(e.set(r,n),n+=1)}),e},[ae]),wn=r.useMemo(function(){return new Set(un.map(function(e){return c.getSegmentReviewKey(e.segment)}))},[un]),_n=r.useMemo(function(){return h.getPendingMergeImpactedSegmentKeys(ae)},[ae]);r.useEffect(function(){cn(function(e){var n=!1,t=new Map(e);return e.forEach(function(e,i){var r=ae.find(function(e){return c.getSegmentReviewKey(e)===i});r&&!h.hasPolledStructuralAction(r,e)||(t.delete(i),n=!0)}),n?t:e})},[ae]),r.useEffect(function(){pn(function(e){var n=!1,t=new Set(e);return e.forEach(function(e){gn.has(e)||(t.delete(e),n=!0)}),n?t:e})},[gn]);var hn=r.useMemo(function(){return h.getOptimisticMergeImpactedSegmentKeys(ae,gn,mn)},[mn,gn,ae]),yn=r.useRef(null),bn=r.useMemo(function(){return t.__spreadArray(t.__spreadArray(t.__spreadArray([],ln.filter(function(e){return!_n.has(c.getSegmentReviewKey(e.segment))&&!hn.has(c.getSegmentReviewKey(e.segment))&&!h.shouldHideStructuralBoundaryReview(e.review_step,e.segment,wn.has(c.getSegmentReviewKey(e.segment)),gn.get(c.getSegmentReviewKey(e.segment)))}).map(function(e){var n;return t.__assign(t.__assign({},e),{kind:"boundary",pageNumber:null!==(n=e.metadata.focus_page)&&void 0!==n?n:e.segment.start_page})}),!0),un.filter(function(e){return!_n.has(c.getSegmentReviewKey(e.segment))&&!hn.has(c.getSegmentReviewKey(e.segment))}).map(function(e){return t.__assign(t.__assign({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0),dn.filter(function(e){return!_n.has(c.getSegmentReviewKey(e.segment))&&!hn.has(c.getSegmentReviewKey(e.segment))}).map(function(e){var n;return t.__assign(t.__assign({},e),{kind:"page",pageNumber:null!==(n=e.metadata.page_num)&&void 0!==n?n:e.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=fn.get(c.getSegmentReviewKey(e.segment)))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=fn.get(c.getSegmentReviewKey(n.segment)))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-o||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[ln,un,dn,hn,gn,_n,fn,wn]),Sn=r.useMemo(function(){return ae.map(function(e){var n,i;return t.__assign(t.__assign({},e),{title:(null===(n=e.label)||void 0===n?void 0:n.trim())||e.title,page_count:null!==(i=e.page_count)&&void 0!==i?i:e.end_page-e.start_page+1})})},[ae]),xn=r.useState(1),Rn=xn[0],En=xn[1],Cn=r.useState(null!=je?je:null),Pn=Cn[0],kn=Cn[1],An=r.useState(null!=je?je:null),Mn=An[0],In=An[1],jn=r.useState(!1),Bn=jn[0],Nn=jn[1],Ln=r.useState(null),Tn=Ln[0],Fn=Ln[1],qn=r.useState(null),Kn=qn[0],Wn=qn[1],zn=r.useState(function(){return new Set}),Gn=zn[0],On=zn[1],Dn=r.useState(null),Vn=Dn[0],Hn=Dn[1],Un=r.useState(null),Zn=Un[0],Xn=Un[1],Yn=r.useState(null),Jn=Yn[0],Qn=Yn[1],$n=r.useState(!1),et=$n[0],nt=$n[1],tt=r.useRef(0),it=r.useRef(null),rt=r.useRef(null),ot=r.useRef(new Map),at=r.useRef(null),lt=r.useRef(null),ut=r.useRef(null),dt=r.useState(b),st=dt[0],gt=dt[1],ct=null!==(R=null===(n=null==ue?void 0:ue.aside)||void 0===n?void 0:n.width)&&void 0!==R?R:"40%",vt="min(".concat("number"==typeof ct?"".concat(ct,"px"):ct,", ").concat(b,"px, 100%)");r.useEffect(function(){On(function(e){if(0===e.size)return e;var n=new Set(e),t=!1;return bn.forEach(function(e){var i;null!=(null===(i=e.review_step.review)||void 0===i?void 0:i.action)&&n.has(e.id)&&(n.delete(e.id),t=!0)}),t?n:e})},[bn]),r.useEffect(function(){var e=yn.current;if(e&&ce){var n=function(){var n=e.getBoundingClientRect().width;n>0&>(n)};n();var t="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==t||t.observe(e),function(){return null==t?void 0:t.disconnect()}}},[ce]);var mt=r.useMemo(function(){var e=new Set;return bn.forEach(function(n){var t;null!=(null===(t=n.review_step.review)||void 0===t?void 0:t.action)&&e.add(n.id)}),e},[bn]),pt=r.useMemo(function(){var e;return null!==(e=bn.find(function(e){return e.id===Pn}))&&void 0!==e?e:null},[Pn,bn]),ft=r.useMemo(function(){return!(!Ye||"label"!==(null==pt?void 0:pt.kind))&&ln.some(function(e){if(c.getSegmentReviewKey(e.segment)!==c.getSegmentReviewKey(pt.segment)||mt.has(e.id))return!1;var n=h.getResolvedScore(e.review_step.score,e.review_step.confidence);return null==n||n<85})},[pt,ln,Ye,mt]),wt=null==pt?-1:ae.findIndex(function(e){return c.getSegmentReviewKey(e)===c.getSegmentReviewKey(pt.segment)}),_t=wt>0?ae[wt-1]:void 0,ht=wt>=0?ae[wt+1]:void 0,yt=(null===(E=null==_t?void 0:_t.label)||void 0===E?void 0:E.trim())||(null==_t?void 0:_t.title),bt=(null===(C=null==ht?void 0:ht.label)||void 0===C?void 0:C.trim())||(null==ht?void 0:ht.title),St=h.getConfidenceColors(null==pt?void 0:pt.review_step.score,null==pt?void 0:pt.review_step.confidence,null===(P=null==pt?void 0:pt.segment.confidence)||void 0===P?void 0:P.awaiting_llm),xt=(null===(k=null==pt?void 0:pt.review_step.reasons)||void 0===k?void 0:k.length)?pt.review_step.reasons:null!==(M=null===(A=null==pt?void 0:pt.segment.confidence)||void 0===A?void 0:A.reasons)&&void 0!==M?M:[],Rt=Boolean(xt.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(I=null==pt?void 0:pt.review_step.reason)||void 0===I?void 0:I.trim())||(null===(j=null==pt?void 0:pt.review_step.gap)||void 0===j?void 0:j.trim())),Et=null==pt?null:"boundary"===pt.kind?h.getBoundaryReviewActionBadgeLabel(pt.review_step,pt.segment,gn.get(null!==(B=pt.segment.stable_key)&&void 0!==B?B:"")):h.getTitleReviewActionBadgeLabel(pt.review_step,pt.segment,gn.get(null!==(N=pt.segment.stable_key)&&void 0!==N?N:"")),Ct="label"===(null==pt?void 0:pt.kind)?[Et,pt.review_step.human_action_enum,null===(L=pt.review_step.review)||void 0===L?void 0:L.action,null===(T=pt.review_step.human_resolution)||void 0===T?void 0:T.action]:[],Pt="label"===(null==pt?void 0:pt.kind)&&Ct.some(function(e){var n,t=null!==(n=null==e?void 0:e.trim().toUpperCase())&&void 0!==n?n:"";return t.includes("MERGE")||t.includes("SPLIT")}),kt=null!=pt&&bn.some(function(e){return"boundary"===e.kind&&c.getSegmentReviewKey(e.segment)===c.getSegmentReviewKey(pt.segment)}),At=Pt&&!kt,Mt=("boundary"===(null==pt?void 0:pt.kind)||At)&&null!=pt?function(){var e,n,i,r,o,a;if("boundary"===pt.kind)return pt;var l=ln.find(function(e){return c.getSegmentReviewKey(e.segment)===c.getSegmentReviewKey(pt.segment)});return l?t.__assign(t.__assign({},l),{kind:"boundary",pageNumber:null!==(e=l.metadata.focus_page)&&void 0!==e?e:l.segment.start_page}):t.__assign(t.__assign({},pt),{kind:"boundary",pageNumber:null!==(i=null===(n=pt.segment.review_action)||void 0===n?void 0:n.focus_page)&&void 0!==i?i:pt.segment.start_page,metadata:{focus_page:null!==(o=null===(r=pt.segment.review_action)||void 0===r?void 0:r.focus_page)&&void 0!==o?o:null,boundary_margin:null!==(a=pt.segment.boundary_margin)&&void 0!==a?a:null,user_actions:[]}})}():void 0,It=null==pt?"":(null===(F=pt.segment.label)||void 0===F?void 0:F.trim())||pt.segment.title,jt=null==pt?void 0:pt.review_step.revert,Bt=null==pt?void 0:pt.segment.revert,Nt=function(e){return null==e?void 0:e.trim().toLowerCase()},Lt=null==pt||null===(K=t.__spreadArray([],null!==(q=pt.segment.review_steps)&&void 0!==q?q:[],!0).reverse().find(function(e){var n,t,i=null===(n=e.type)||void 0===n?void 0:n.trim().toLowerCase();return("page_boundary"===i||"page boundary review"===i)&&"boundary"===Nt(null===(t=e.revert)||void 0===t?void 0:t.type)}))||void 0===K?void 0:K.revert,Tt=null!==(W=null!=jt?jt:null==pt?void 0:pt.segment.revert)&&void 0!==W?W:Lt,Ft=null==Tt?void 0:Tt.decision.trim().toUpperCase(),qt=null!=Et?Et:(null==Ft?void 0:Ft.includes("SPLIT"))?"Split":(null==Ft?void 0:Ft.includes("MERGE"))?"Merged":null,Kt="label"===(null==pt?void 0:pt.kind)&&"SET_RANGE"===(null===(z=null==Lt?void 0:Lt.decision)||void 0===z?void 0:z.trim().toUpperCase())&&Lt.current_segment_ids.length!==Lt.previous_state.length,Wt="Merged"===Et||"Split"===Et||Kt,zt=null==pt?void 0:Wt?"boundary"===Nt(null==Lt?void 0:Lt.type)?Lt:"boundary"===Nt(null==Bt?void 0:Bt.type)?Bt:"boundary"===Nt(null==jt?void 0:jt.type)?jt:void 0:"label"===pt.kind?"label"===Nt(null==jt?void 0:jt.type)?jt:void 0:"boundary"===pt.kind?"boundary"===Nt(null==jt?void 0:jt.type)?jt:"boundary"===Nt(null==Lt?void 0:Lt.type)?Lt:"boundary"===Nt(null==Bt?void 0:Bt.type)?Bt:void 0:void 0,Gt=Wt&&(null==zt?void 0:zt.operation_id)?ae.flatMap(function(e){var n;return null!==(n=e.review_steps)&&void 0!==n?n:[]}).find(function(e){var n,t,i,r,o,a,l,u=null===(n=e.type)||void 0===n?void 0:n.trim().toLowerCase();return("page_boundary"===u||"page boundary review"===u)&&((null!==(o=null!==(i=null===(t=e.human_resolution)||void 0===t?void 0:t.operation_id)&&void 0!==i?i:null===(r=e.revert)||void 0===r?void 0:r.operation_id)&&void 0!==o?o:e.operation_id)===zt.operation_id&&Boolean(null===(l=null===(a=e.human_resolution)||void 0===a?void 0:a.change_summary)||void 0===l?void 0:l.trim()))}):void 0,Ot=(null===(G=null==zt?void 0:zt.summary)||void 0===G?void 0:G.trim())||null,Dt=Wt?(null===(D=null===(O=null==Gt?void 0:Gt.human_resolution)||void 0===O?void 0:O.change_summary)||void 0===D?void 0:D.trim())||(null===(V=null==zt?void 0:zt.summary)||void 0===V?void 0:V.trim())||"":(null===(Z=null===(U=null===(H=null==pt?void 0:pt.review_step)||void 0===H?void 0:H.human_resolution)||void 0===U?void 0:U.change_summary)||void 0===Z?void 0:Z.trim())||(null===(Y=null===(X=null==pt?void 0:pt.review_step)||void 0===X?void 0:X.summary)||void 0===Y?void 0:Y.trim())||"",Vt=null==pt?null:zt?{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:zt.previous_state.map(function(e){var n,t;return{title:(null===(n=e.label)||void 0===n?void 0:n.trim())||(null===(t=e.title)||void 0===t?void 0:t.trim())||"Untitled document",startPage:e.start_page,endPage:e.end_page}})}:"Split"===qt?{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page}]}:"Merged"===qt?{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:[{title:"Advice of Award",startPage:1,endPage:25},{title:"Request for proposal (RFP)",startPage:26,endPage:76}]}:{currentSegment:{title:It,startPage:pt.segment.start_page,endPage:pt.segment.end_page},previousSegments:[]},Ht="page"===(null==pt?void 0:pt.kind)&&null!==(J=pt.metadata.classification_id)&&void 0!==J?J:null,Ut="page"===(null==pt?void 0:pt.kind)?Boolean(qe&&Ht):Boolean((null==zt?void 0:zt.operation_id)&&(null==zt?void 0:zt.type)&&!1!==(null==zt?void 0:zt.revertable));Boolean(Vt&&Ut&&("page"!==(null==pt?void 0:pt.kind)||Ht));var Zt=r.useCallback(function(e,n){tt.current+=1,it.current={requestId:tt.current,pageNumber:e,reviewId:n},Wn({pageNumber:e,requestId:tt.current})},[]),Xt=r.useCallback(function(e){var n,t;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(null==on||on({reviewId:e.id,segment_id:null!==(t=e.segment.segment_id)&&void 0!==t?t:null,reviewStepIndex:e.reviewStepIndex,kind:e.kind,pageNumber:e.pageNumber,metadata:e.metadata}),Xn(null),Qn(null),kn(e.id),In(e.id),Nn(!1),Fn(null),Zt(e.pageNumber,e.id),null==We||We(e.id,e.segment))},[We,on,Zt]);r.useEffect(function(){if(Jn){var e=requestAnimationFrame(function(){return nt(!0)}),n=window.setTimeout(function(){nt(!1)},3500),t=window.setTimeout(function(){Qn(null)},4e3);return function(){cancelAnimationFrame(e),window.clearTimeout(n),window.clearTimeout(t)}}},[Jn]),r.useEffect(function(){var e,n,t,i;if(rn){if("pageGroup"===rn.type){var r=null!==(e=rn.pages)&&void 0!==e?e:[],o=null!==(n=rn.pageIndex)&&void 0!==n?n:0,a=r[o];if(null==a)return;return Yt(),Xn({pages:r,index:o,label:null!==(t=rn.groupLabel)&&void 0!==t?t:""}),tt.current+=1,void Wn({pageNumber:a,requestId:tt.current})}if(Xn(null),rn.reviewId){var l=bn.find(function(e){return e.id===rn.reviewId&&(!rn.type||e.kind===rn.type)});if(l)return void Xt(l)}if(rn.classificationId){var u=bn.find(function(e){return!("page"!==e.kind||e.metadata.classification_id!==rn.classificationId||rn.segmentId&&e.segment.segment_id!==rn.segmentId||rn.type&&e.kind!==rn.type)});if(u)return void Xt(u)}if(rn.pageNumber&&rn.type){var d=Number(rn.pageNumber);if(Number.isInteger(d)&&!(d<1)){var s=null===(i=rn.pageType)||void 0===i?void 0:i.trim().toLowerCase(),g=bn.find(function(e){var n="page"===e.kind?e.pageNumber:e.segment.start_page,t="page"!==e.kind||!s||e.metadata.page_type===s;return(!rn.segmentId||e.segment.segment_id===rn.segmentId)&&n===d&&e.kind===rn.type&&t});g?Xt(g):"page"===rn.type&&(Yt(),tt.current+=1,Wn({pageNumber:d,requestId:tt.current}))}}}},[rn,Xt,bn]);var Yt=r.useCallback(function(){it.current=null,Nn(!1),kn(null),Fn(null),null==We||We(null,null)},[We]),Jt=r.useCallback(function(e){var n;nt(!1),Qn(null);var t=null!==(n=bn.find(function(n){return!mt.has(n.id)&&"boundary"===n.kind&&n.segment.start_page===e.startPage&&n.segment.end_page===e.endPage}))&&void 0!==n?n:bn.find(function(n){return!mt.has(n.id)&&n.segment.start_page<=e.startPage&&n.segment.end_page>=e.startPage});t?Xt(t):(Yt(),tt.current+=1,Wn({pageNumber:e.startPage,requestId:tt.current}))},[Yt,mt,bn,Xt]),Qt=r.useCallback(function(e,n){var t,i=h.getReviewScoreBand(e.review_step.score),r=null==xe||i===xe,o=Gn.has(e.id)&&h.isReviewStepResolutionCurrent(e.review_step,e.segment);return e.id!==n&&r&&!0!==(null===(t=e.segment.confidence)||void 0===t?void 0:t.awaiting_llm)&&!h.isReviewStepResolved(e.review_step,e.segment)&&!o},[xe,Gn]),$t=r.useCallback(function(e){var n;if(Se){var t=bn.findIndex(function(n){return n.id===e}),i=null!==(n=bn.find(function(n,i){return i>t&&Qt(n,e)}))&&void 0!==n?n:bn.find(function(n){return Qt(n,e)});i?requestAnimationFrame(function(){return Xt(i)}):Yt()}else Yt()},[Se,Yt,Qt,bn,Xt]),ei=r.useCallback(function(e,n,i){return t.__awaiter(ie,void 0,void 0,function(){var r,o,a,u,d,s,g,v,m,p;return t.__generator(this,function(t){switch(t.label){case 0:if(De)return[2];if("boundary"===e.kind&&!Le)return[2];if("label"===e.kind&&!Te)return[2];if("page"===e.kind&&!Fe)return[2];r=x(e),a=i,u=(o=n)===l.BoundaryReviewActionEnum.SET_RANGE?function(){var n=a.startPage,t=a.endPage;if(null==n||null==t)return null;var i=n<e.segment.start_page||t>e.segment.end_page,r=n>e.segment.start_page||t<e.segment.end_page;return i&&!r?n<e.segment.start_page?l.BoundaryReviewActionEnum.MERGE_PREV:l.BoundaryReviewActionEnum.MERGE_NEXT:r?l.BoundaryReviewActionEnum.SPLIT_HERE:null}():o,d="boundary"===e.kind&&null!=Le&&Se&&(u===l.BoundaryReviewActionEnum.SPLIT_HERE||u===l.BoundaryReviewActionEnum.MERGE_NEXT||u===l.BoundaryReviewActionEnum.MERGE_PREV||u===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),s=d?ae.findIndex(function(n){return c.getSegmentReviewKey(n)===c.getSegmentReviewKey(e.segment)}):-1,d&&s>=0&&u&&(rt.current={action:u,originalSegmentIndex:s,segmentSignature:JSON.stringify(ae.map(function(e,n){var t;return{key:c.getSegmentReviewKey(e,n),startPage:e.start_page,endPage:e.end_page,version:null!==(t=e.version)&&void 0!==t?t:null}})),ready:!1}),Hn(e.id),t.label=1;case 1:return t.trys.push([1,8,9,10]),"boundary"!==e.kind?[3,3]:[4,null==Le?void 0:Le(n,i,r)];case 2:return t.sent(),[3,7];case 3:return"label"!==e.kind?[3,5]:[4,null==Te?void 0:Te(n,i,r)];case 4:return t.sent(),[3,7];case 5:return"page"!==e.kind?[3,7]:[4,null==Fe?void 0:Fe(n,i,r)];case 6:t.sent(),t.label=7;case 7:return On(function(n){var t=new Set(n);return t.add(e.id),t}),g="boundary"===e.kind&&(u===l.BoundaryReviewActionEnum.MERGE_NEXT||u===l.BoundaryReviewActionEnum.MERGE_PREV||u===l.BoundaryReviewActionEnum.MERGE_PREVIOUS),("boundary"===e.kind&&u===l.BoundaryReviewActionEnum.SPLIT_HERE||g)&&u&&(v=c.getSegmentReviewKey(e.segment),pn(function(e){var n=new Set(e);return o===l.BoundaryReviewActionEnum.SET_RANGE?n.add(v):n.delete(v),n}),cn(function(e){var n=new Map(e);return n.set(v,u),n})),rt.current?(rt.current.ready=!0,g&&(m=bn.find(function(n){return"label"===n.kind&&c.getSegmentReviewKey(n.segment)===c.getSegmentReviewKey(e.segment)}))&&requestAnimationFrame(function(){return Xt(m)})):$t(e.id),[3,10];case 8:return p=t.sent(),d&&(rt.current=null),null==Ge||Ge(p,r),[3,10];case 9:return Hn(null),[7];case 10:return[2]}})})},[Se,De,Ge,Le,Te,Fe,qe,bn,ae,Xt,$t]);r.useEffect(function(){var e=rt.current;if(null==e?void 0:e.ready){var n=JSON.stringify(ae.map(function(e,n){var t;return{key:c.getSegmentReviewKey(e,n),startPage:e.start_page,endPage:e.end_page,version:null!==(t=e.version)&&void 0!==t?t:null}}));if(n!==e.segmentSignature){var t=e.action===l.BoundaryReviewActionEnum.SPLIT_HERE?e.originalSegmentIndex+1:e.action===l.BoundaryReviewActionEnum.MERGE_PREV||e.action===l.BoundaryReviewActionEnum.MERGE_PREVIOUS?Math.max(0,e.originalSegmentIndex-1):e.originalSegmentIndex,i=new Map(ae.map(function(e,n){return[c.getSegmentReviewKey(e,n),n]})),r=bn.find(function(e){var n=i.get(c.getSegmentReviewKey(e.segment));return null!=n&&n>=t&&Qt(e)});if(!r)return rt.current=null,void Yt();requestAnimationFrame(function(){rt.current=null,Xt(r)})}}},[Yt,Qt,bn,ae,Xt]),r.useEffect(function(){rt.current||Pn&&!bn.some(function(e){return e.id===Pn})&&Yt()},[Pn,Yt,bn]),r.useEffect(function(){if(ye&&!rt.current){var e=bn.find(function(e){return e.pageNumber===Rn});e&&e.id!==Pn&&Xt(e)}},[Pn,ye,Rn,Xt,bn]),r.useEffect(function(){rt.current||Pn&&!bn.some(function(e){var n;return e.id===Pn&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&Yt()},[Pn,Yt,bn]);var ni=r.useMemo(function(){var e=bn.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===fe)return e;var n=["low","medium","high"].filter(function(e){return e!==me}),i=t.__spreadArray([me],n,!0),r=new Map(i.map(function(e,n){return[e,n]}));return e.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,a,l,u=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),d=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==u?i.length:null!==(a=r.get(u))&&void 0!==a?a:i.length)-(null==d?i.length:null!==(l=r.get(d))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[fe,me,bn]),ti=ni.findIndex(function(e){return e.id===Mn}),ii=r.useState(null),ri=ii[0],oi=ii[1],ai=r.useRef(!1),li=r.useCallback(function(e){var n=ni[e];n&&Xt(n)},[ni,Xt]);r.useCallback(function(e){if(!(!Zn||e<0||e>=Zn.pages.length)){var n=Zn.pages[e];null!=n&&(Yt(),Xn(function(n){return null==n?n:t.__assign(t.__assign({},n),{index:e})}),tt.current+=1,Wn({pageNumber:n,requestId:tt.current}))}},[Zn,Yt]),r.useEffect(function(){Mn&&!ni.some(function(e){return e.id===Mn})&&In(null)},[ni,Mn]),r.useEffect(function(){ai.current=!1,oi(ti>=0?String(ti+1):null)},[ti,ni.length]),r.useEffect(function(){if(ai.current&&null!=ri){var e=window.setTimeout(function(){var e=Number(ri.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<ni.length&&(ai.current=!1,li(n))},300);return function(){return window.clearTimeout(e)}}},[li,ri,ni.length]);var ui=r.useMemo(function(){var e=new Map;bn.forEach(function(n){var t,i=null!==(t=e.get(c.getSegmentReviewKey(n.segment)))&&void 0!==t?t:[];i.push(n),e.set(c.getSegmentReviewKey(n.segment),i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=fn.get(t))&&void 0!==i?i:1;e.sort(function(e,n){return e.reviewStepIndex-n.reviewStepIndex}).forEach(function(e,t){n.set(e.id,"".concat(r).concat(function(e){for(var n=e+1,t="";n>0;)n-=1,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}(t)))})}),n},[bn,fn]),di=r.useMemo(function(){var e=new Map;bn.forEach(function(n){var t,i=null!==(t=e.get(n.pageNumber))&&void 0!==t?t:[];i.push(n),e.set(n.pageNumber,i)});var n=new Map;return e.forEach(function(e){e.forEach(function(e,t){return n.set(e.id,t)})}),n},[bn]),si=r.useCallback(function(e){return{startPage:Math.max(0,e.startPage-Ee),endPage:Math.min(e.numPages-1,e.endPage+Ee)}},[Ee]),gi=r.useCallback(function(){var e,n=lt.current,t=ut.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),o=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();bn.forEach(function(e){var n,r=ot.current.get(e.id);if(r){var a=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(a){var l=a.getBoundingClientRect(),u=null!==(n=di.get(e.id))&&void 0!==n?n:0,d=l.top+Pe+40*u,s=d+(r.offsetHeight||32),g=d>=o.top&&s<=o.bottom;r.style.top="".concat(d-i.top,"px"),r.style.visibility=g?"visible":"hidden"}else r.style.visibility="hidden"}});var a=at.current;if(a){var l=null==Zn?void 0:Zn.pages[Zn.index],u=null==l?null:t.querySelector('[data-testid="core__page-layer-'.concat(l-1,'"]'));if(Zn&&u){var d=u.getBoundingClientRect().top+Pe,s=d+(a.offsetHeight||25),g=d>=o.top&&s<=o.bottom;a.style.top="".concat(d-i.top,"px"),a.style.visibility=g?"visible":"hidden"}else a.style.visibility="hidden"}if(Pn&&null==it.current){var c=ot.current.get(Pn);c&&"hidden"!==c.style.visibility&&Fn(function(e){return e===c?e:c})}}},[Zn,Pn,Pe,di,bn]),ci=r.useCallback(function(e){var n=it.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(it.current=null,gi(),requestAnimationFrame(function(){if(null==it.current){var e=ot.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Fn(e)}}))},[gi]);return r.useEffect(function(){var e=ut.current;if(e&&ce){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,gi()}))};e.addEventListener("scroll",t,!0),window.addEventListener("resize",t);var i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});var r="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==r||r.observe(e),t(),function(){null!=n&&cancelAnimationFrame(n),e.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t),i.disconnect(),null==r||r.disconnect()}}},[ce,gi]),i.jsxs("div",t.__assign({ref:lt,className:$e,style:t.__assign(t.__assign({},en),{display:"block",position:"relative",width:"100%",height:"100%",minWidth:0,overflowX:"auto",overflowY:"hidden"})},{children:[i.jsxs("div",t.__assign({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,width:"100%",minWidth:700,height:"100%"}},{children:[i.jsx("div",t.__assign({ref:ut,style:t.__assign(t.__assign({},nn),{flex:"1 1 auto",width:ce?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:i.jsx(a.default,t.__assign({highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1,showRotateButton:!0},de,{defaultScale:void 0===se?null!==(Q=null==de?void 0:de.defaultScale)&&void 0!==Q?Q:o.SpecialZoomLevel.PageFit:S[se],disablePdfAnnotations:He,disablePdfTextLayer:Ze,pdfUrl:re,pdfName:oe,segments:Sn,navigationRequest:Kn,onNavigationSettled:ci,setRenderRange:si,onCurrentPageChange:function(e){En(e),null==it.current&&pt&&pt.pageNumber!==e&&Yt(),null==ze||ze(e)}}))})),ce&&i.jsxs("aside",t.__assign({"aria-label":"Page review badges",ref:yn,style:t.__assign(t.__assign({},tn),{position:"relative",width:vt,maxWidth:b,flex:"0 1 ".concat(vt),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[Zn&&i.jsx("span",t.__assign({ref:at,style:{position:"absolute",top:0,left:10,visibility:"hidden",zIndex:2,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,minHeight:25,padding:"2px 8px",border:"1px solid #E2E8F0",borderRadius:16,backgroundColor:"#F8FAFC",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)",font:"inherit"}},{children:i.jsxs(m.Typography,t.__assign({fontFamily:"Inter",sx:{fontSize:11,fontWeight:500,color:"#475569",whiteSpace:"nowrap"}},{children:[Zn.label||"Pages"," Pg: ",Zn.index+1]}))})),_e&&ni.length>0&&!Zn&&i.jsxs("nav",t.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:Ae||"auto",left:Ie||"auto",zIndex:2,display:"flex",alignItems:"center",gap:7,width:128,minHeight:40,padding:"4px 6px",border:"1px solid #CBD5E1",borderRadius:6,backgroundColor:"#FFFFFF",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.06)",font:"inherit"}},{children:[i.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=ri?ri:"-","aria-label":"Review badge number",onChange:function(e){ai.current=!0,oi(e.target.value)},style:{width:30,height:28,padding:0,border:"1px solid #A5B4FC",borderRadius:3,color:"#4F46E5",backgroundColor:"#FFFFFF",textAlign:"center",font:"inherit",fontSize:15,outline:"none"}}),i.jsxs("span",t.__assign({"aria-label":"".concat(ni.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",ni.length]})),["previous","next"].map(function(e){var n="previous"===e,r=ti+(n?-1:1),o=r<0||r>=ni.length;return i.jsx("button",t.__assign({type:"button","aria-label":"".concat(n?"Previous":"Next"," review badge"),disabled:o,onClick:function(){return li(r)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:o?"#C7D2FE":"#4F46E5",cursor:o?"default":"pointer"}},{children:i.jsx("svg",t.__assign({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:i.jsx("path",{d:n?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),e)})]})),!Zn&&bn.map(function(e){var n,r,o=Pn===e.id,a=null!==(n=ui.get(e.id))&&void 0!==n?n:"1A",l=e.review_step.score,u=e.review_step.confidence,d=h.formatScore(l,u),s="boundary"===e.kind?h.getBoundaryReviewActionBadgeLabel(e.review_step,e.segment,gn.get(c.getSegmentReviewKey(e.segment))):"label"===e.kind?h.getTitleReviewActionBadgeLabel(e.review_step,e.segment,gn.get(c.getSegmentReviewKey(e.segment))):null,g=null!=s?s:"N/A"===d?d:"".concat(d,"%"),p=!0===(null===(r=e.segment.confidence)||void 0===r?void 0:r.awaiting_llm),f=h.getConfidenceColors(l,u,p),w=mt.has(e.id),_=p;return i.jsx(m.Tooltip,t.__assign({title:p?"data is being processed":"",arrow:!0},{children:i.jsx("span",t.__assign({ref:function(n){n?ot.current.set(e.id,n):ot.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:_?"not-allowed":"pointer"}},{children:i.jsx("button",t.__assign({disabled:_,type:"button","aria-pressed":o,"aria-label":p?"".concat(e.review_step.type," · Page ").concat(e.pageNumber," · Data is being processed"):"".concat(e.review_step.type," · Page ").concat(e.pageNumber),onClick:function(){return Xt(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:s?w&&!p?115:90:w&&!p?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(w&&!p?"#E2E8F0":f.border),borderRadius:16,backgroundColor:w&&!p?"#F8FAFC":f.background,color:w&&!p?"#475569":f.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:w&&!p?i.jsxs(m.Typography,t.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),i.jsxs("span",t.__assign({style:{display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]})),i.jsxs("span",t.__assign({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:i.jsx(v.CircleCheck,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]})):i.jsxs(m.Typography,t.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),i.jsxs("span",t.__assign({style:{display:"flex",alignItems:"center"}},{children:[i.jsx("svg",t.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i.jsx("path",{d:"M0.399902 0V14",stroke:f.divider,strokeWidth:"0.8"})})),i.jsx("span",t.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:g}))]}))]}))}))}))}),e.id)})]}))]})),pt&&Tn&&i.jsxs(u.default,t.__assign({anchorElement:Tn,placement:"bottom-start",offset:{top:8},width:Math.min(st,b),maxWidth:b,heightBuffer:null!=Ne?Ne:25},{children:[Bn&&i.jsx(d.default,{width:"100%",maxWidth:"100%",score:pt.review_step.score,reasons:xt,reason:pt.review_step.reason,gap:pt.review_step.gap,onBack:function(){return Nn(!1)},onClose:Yt}),i.jsx("div",t.__assign({style:{display:Bn?"none":"block"}},{children:mt.has(pt.id)?i.jsx(p.default,{width:"100%",maxWidth:"100%",headerName:"page"===pt.kind?"Page format approved":"Split"===Et?"Split approved":"Merged"===Et?"Merge approved":"User approved",headerIcon:"page"===pt.kind?i.jsx(v.Check,{size:18,strokeWidth:2}):"Merged"===Et?i.jsx(v.GitMerge,{size:18,strokeWidth:2}):"Split"===Et?i.jsx(y.default,{width:18,height:18}):i.jsx(v.CircleCheck,{size:18,strokeWidth:2}),title:It,pageNo:"Page ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page),summary:Vt?i.jsx(w.default,{icon:i.jsx(v.CircleCheck,{size:14,strokeWidth:2}),title:It,pageRange:"Page ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page),description:null!=Dt?Dt:null,revertData:Vt,confirmDisabled:"page"===pt.kind?!Ut:null==Ke||!Ut,showDocumentHeader:!1,onRevert:function(){if("page"===pt.kind){if(!qe||!Ht){var e=new Error("SegmentReviewPdfWrapper requires onPageTypeRevert and a classification id to revert a page-type decision.");return null==Ge||Ge(e,x(pt)),Promise.reject(e)}return qe({classification_id:Ht,human_verdict:"No"},x(pt))}if(!Ke)throw new Error("SegmentReviewPdfWrapper requires onRevert to handle a revert confirmation.");if(!zt)throw new Error("There is no valid revert operation for this review.");var n=Wt?"boundary":"label"===pt.kind?"label":"boundary"===pt.kind?"boundary":null,t=Nt(zt.type);if(n&&t!==n)throw new Error("Cannot use ".concat(null!=t?t:"unknown"," revert metadata for this review. Expected ").concat(n,"."));return Ke(zt,x(pt))},onRevertError:function(e){null==Ge||Ge(e,x(pt))},onRevertComplete:function(e){var n,t,i,r,o,a;On(function(){return new Set}),"page"!==pt.kind&&(pn(function(){return new Set}),cn(function(){return new Map})),pt.id;var l=null!==(n=Vt.previousSegments[0])&&void 0!==n?n:Vt.currentSegment,u=null==Tn?void 0:Tn.getBoundingClientRect(),d=null===(t=ut.current)||void 0===t?void 0:t.getBoundingClientRect(),s=Math.min(b,Math.max(220,st)),g=null!==(i=null==u?void 0:u.left)&&void 0!==i?i:(null!==(r=null==d?void 0:d.right)&&void 0!==r?r:window.innerWidth-s-8)+8,c=Math.max(8,Math.min(g,window.innerWidth-s-8)),v=null==(null==u?void 0:u.bottom)?Math.max(8,null!==(o=null==d?void 0:d.top)&&void 0!==o?o:8):u.bottom+8;On(function(){return new Set}),"page"!==pt.kind&&(rt.current=null),nt(!1),Qn({title:"Split"===Et?"Split reverted":"Merged"===Et?"Merge reverted":"Approval reverted",description:(null===(a=null==e?void 0:e.message)||void 0===a?void 0:a.trim())||("Split"===Et?"Pages ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page," are now part of “Advice of Award” again. Review the boundary and title to confirm the document."):"Merged"===Et?"The documents have been separated again. Review their boundaries and titles to confirm them.":"“".concat(It,"” is pending review again. Review the boundary and title to confirm the document.")),segment:l,position:{top:v,left:c,width:s}}),Yt()}},pt.id):void 0,additionalActions:Mt?i.jsx(f.default,{metadata:Mt.metadata,reviewAction:null!==($=pt.segment.review_action)&&void 0!==$?$:void 0,startPage:pt.segment.start_page,endPage:pt.segment.end_page,title:It,previousSegmentTitle:yt,nextSegmentTitle:bt,disabled:De||!Le||Vn===pt.id,onConfirm:function(e,n){ei(Mt,e,n)}}):void 0,cognitiveScore:pt.review_step.score,styles:{root:{borderColor:"#16A34A"},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:"#16A34A"}}},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt}):"boundary"===pt.kind?i.jsx(l.default,{width:"100%",maxWidth:"100%",totalPages:le,title:pt.segment.label||pt.segment.title,pageNo:"Page ".concat(pt.pageNumber),content:null!==(ee=pt.review_step.question)&&void 0!==ee?ee:null,revertSummary:Ot,cognitiveScore:pt.review_step.score,metadata:pt.metadata,reviewAction:null!==(ne=pt.segment.review_action)&&void 0!==ne?ne:void 0,previousSegmentTitle:yt,nextSegmentTitle:bt,manualPrompt:null!=Be?Be:"Set a custom boundary",defaultStartPage:pt.segment.start_page,defaultEndPage:pt.segment.end_page,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:De||!Le||Vn===pt.id,onConfirm:function(e,n,t){t&&l.isBoundaryReviewAction(n.id)&&ei(pt,n.id,t)},onAdjustManually:function(){return null==Je?void 0:Je(x(pt))},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt},pt.id):"label"===pt.kind?i.jsx(s.default,{width:"100%",maxWidth:"100%",title:pt.metadata.current_label||pt.segment.label||pt.segment.title,pageNo:"Pages ".concat(pt.segment.start_page,"-").concat(pt.segment.end_page),content:null!==(te=pt.review_step.question)&&void 0!==te?te:null,revertSummary:Ot,cognitiveScore:pt.review_step.score,metadata:pt.metadata,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:De||!Te||Vn===pt.id,confirmationBlocked:ft,confirmationWarning:ft?"Please confirm the boundary before confirming the title.":void 0,onActionConfirm:function(e,n){ei(pt,e,n)},onAdjustManually:function(){return null==Je?void 0:Je(x(pt))},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt},pt.id):i.jsx(g.default,{width:"100%",maxWidth:"100%",title:pt.segment.label||pt.segment.title,pageNo:"Page ".concat(pt.pageNumber),content:pt.review_step.reason,cognitiveScore:pt.review_step.score,pageType:pt.metadata.page_type,metadata:pt.metadata,styles:{root:{borderColor:St.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:St.text}}},confirmDisabled:De||!Fe||Vn===pt.id,onActionConfirm:function(e,n){ei(pt,e,n)},onCognitiveClick:Rt?function(){Nn(!0),null==Qe||Qe(x(pt))}:void 0,onClose:Yt},pt.id)}))]})),Jn&&i.jsx(m.Portal,{children:i.jsx(m.Box,t.__assign({"aria-live":"polite",sx:{position:"fixed",top:Jn.position.top,left:Jn.position.left,zIndex:1600,width:Jn.position.width,maxWidth:"calc(100vw - 16px)",opacity:et?1:0,transform:et?"translateY(0)":"translateY(-6px)",transition:"opacity 500ms ease, transform 500ms ease",filter:"drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18))",pointerEvents:et?"auto":"none"}},{children:i.jsx(_.default,{title:Jn.title,description:Jn.description,onReview:function(){return Jt(Jn.segment)}})}))})]}))};
|
|
2
2
|
//# sourceMappingURL=SegmentReviewPdfWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("./reviewStepAdapters.js"),n=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("./reviewStepAdapters.js"),n=function(e){if(null==e)return null;if("number"==typeof e)return Number.isFinite(e)?e:null;var r=e.trim();if(!r)return null;var n=Number.parseFloat(r);return Number.isFinite(n)?n:null},t=function(e){switch(null==e?void 0:e.trim().toLowerCase()){case"low":return 40;case"medium":return 70;case"high":return 95;default:return null}},i=function(e,r){var i;return null!==(i=n(e))&&void 0!==i?i:t(r)},u=function(e){var r=n(e);return null==r?null:r<=40?"low":r<=70?"medium":"high"},o=function(e){switch(null==e?void 0:e.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"Split";case"MERGE":case"MERGE_NEXT":case"MERGE_PREV":case"MERGE_PREVIOUS":return"Merged";default:return null}},l=function(e){var r,n,t,i;if(![e.human_action_enum,null===(r=e.human_resolution)||void 0===r?void 0:r.action,null===(n=e.review)||void 0===n?void 0:n.action].some(function(e){return"SET_RANGE"===(null==e?void 0:e.trim().toUpperCase())}))return null;var u=null===(t=e.human_resolution)||void 0===t?void 0:t.before,o=null===(i=e.human_resolution)||void 0===i?void 0:i.after;if(null==(null==u?void 0:u.start_page)||null==u.end_page||null==(null==o?void 0:o.start_page)||null==o.end_page)return null;var l=o.start_page<u.start_page||o.end_page>u.end_page,a=o.start_page>u.start_page||o.end_page<u.end_page;if(l&&!a)return"Merged";if(a&&!l)return"Split";var d=u.end_page-u.start_page+1,v=o.end_page-o.start_page+1;return v>d?"Merged":v<d?"Split":null},a=function(e){switch(null==e?void 0:e.trim().toUpperCase()){case"SPLIT":case"SPLIT_HERE":return"SPLIT_HERE";case"MERGE_NEXT":return"MERGE_NEXT";case"MERGE_PREV":case"MERGE_PREVIOUS":return"MERGE_PREV";case"SET_RANGE":return"SET_RANGE";default:return null}},d=function(e){var r,n=null===(r=e.type)||void 0===r?void 0:r.trim().toLowerCase();return"page_boundary"===n||"page boundary review"===n},v=function(r){var n,t,i,u=(null!==(n=r.review_steps)&&void 0!==n?n:[]).filter(d);return null!==(i=null!==(t=e.__spreadArray([],u,!0).reverse().find(function(e){return null!=o(e.human_action_enum)}))&&void 0!==t?t:e.__spreadArray([],u,!0).reverse().find(c))&&void 0!==i?i:u[u.length-1]},s=function(e){var r,n,t,i,u;return null!==(i=null!==(n=null!==(r=l(e))&&void 0!==r?r:o(e.human_action_enum))&&void 0!==n?n:o(null===(t=e.human_resolution)||void 0===t?void 0:t.action))&&void 0!==i?i:o(null===(u=e.review)||void 0===u?void 0:u.action)},_=function(e,r){var n,t=e.type.trim().toLowerCase();if(!("label"===t||"label review"===t))return!0;var i=null===(n=e.human_resolution)||void 0===n?void 0:n.segment_version,u=r.version;return null==i||null==u||i===u},c=function(e){var r,n,t,i;return null!=o(e.human_action_enum)||null!=o(null===(r=e.human_resolution)||void 0===r?void 0:r.action)||null!=o(null===(n=e.review)||void 0===n?void 0:n.action)||!0===(null===(i=null===(t=e.metadata)||void 0===t?void 0:t.performed_actions)||void 0===i?void 0:i.some(function(e){return null!=o(e.action)}))},p=function(r){var n,t,i,u,d,s,_=v(r);if(!_)return null;var c=a(null===(n=_.human_resolution)||void 0===n?void 0:n.action),p=null===(t=_.human_resolution)||void 0===t?void 0:t.after,g=(null==p?void 0:p.start_page)===r.start_page&&(null==p?void 0:p.end_page)===r.end_page,f=l(_);if(f)return g?f:null;if("SPLIT_HERE"===c)return g?null:"Split";if("MERGE_NEXT"===c||"MERGE_PREV"===c)return g?"Merged":null;var m=function(e,r){var n,t,i,u=e.revert,o=r.revert,l="boundary"===(null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.trim().toLowerCase())?u:"boundary"===(null===(t=null==o?void 0:o.type)||void 0===t?void 0:t.trim().toLowerCase())?o:null;if(!l)return null;var a=null===(i=l.decision)||void 0===i?void 0:i.trim().toUpperCase();if(null==a?void 0:a.includes("SPLIT"))return"Split";if(null==a?void 0:a.includes("MERGE"))return"Merged";if("SET_RANGE"===a){if(l.current_segment_ids.length>l.previous_state.length)return"Split";if(l.current_segment_ids.length<l.previous_state.length)return"Merged"}return null}(_,r);if(m)return m;var E=o(_.human_action_enum);if(E)return E;var R=o(null===(i=_.review)||void 0===i?void 0:i.action);if(R)return R;var h=e.__spreadArray([],null!==(u=r.human_action_log)&&void 0!==u?u:[],!0).filter(function(e){return null!=o(e.action)}).sort(function(e,r){var n,t;return r.human_revision-e.human_revision||(null===(n=r.performed_at)||void 0===n?void 0:n.localeCompare(null!==(t=e.performed_at)&&void 0!==t?t:""))})[0];if(!h)return null;var S=o(h.action),w=(null===(d=h.after)||void 0===d?void 0:d.start_page)===r.start_page&&(null===(s=h.after)||void 0===s?void 0:s.end_page)===r.end_page;return"Split"===S?w?null:S:w?S:null},g=function(e,r){return null!=o(r)||null!=p(e)},f=function(e,r){var n,t,i,u,l,d,s=a(r),_=v(e),c=null!==(i=null!==(n=a(null==_?void 0:_.human_action_enum))&&void 0!==n?n:a(null===(t=null==_?void 0:_.human_resolution)||void 0===t?void 0:t.action))&&void 0!==i?i:a(null===(u=null==_?void 0:_.review)||void 0===u?void 0:u.action),g=o(r),f=null===(l=null==_?void 0:_.human_resolution)||void 0===l?void 0:l.after,m="SPLIT_HERE"===s&&null!=(null===(d=null==_?void 0:_.human_resolution)||void 0===d?void 0:d.action)&&(null==f?void 0:f.start_page)===e.start_page&&(null==f?void 0:f.end_page)===e.end_page;return null!=s&&c===s&&null!=g&&(m||p(e)===g)};exports.formatScore=function(e,r){var n=i(e,r);return null==n?"N/A":Number.isInteger(n)?String(n):n.toFixed(2).replace(/\.?0+$/,"")},exports.getBoundaryReviewActionBadgeLabel=function(e,r,n){var t,i;return null!==(i=null!==(t=o(n))&&void 0!==t?t:s(e))&&void 0!==i?i:p(r)},exports.getConfidenceColors=function(e,r,n){var t={border:"#E5E7EB",cardBorder:"#374151",background:"#F9FAFB",text:"#374151",divider:"#D1D5DB"};if(n)return t;switch(u(e)){case"low":return{border:"#FECACA",cardBorder:"#B91C1C",background:"#FEF2F2",text:"#B91C1C",divider:"#FCA5A5"};case"medium":return{border:"#d9cda2",cardBorder:"#997800",background:"#fff1bf",text:"#997800",divider:"#e6b400"};case"high":return{border:"#16A34A",cardBorder:"#4F9E6C",background:"#F0FDF4",text:"#4F9E6C",divider:"#00A43C"}}return t},exports.getFallbackScore=t,exports.getHumanActionBadgeLabel=o,exports.getNumericScore=n,exports.getOptimisticMergeImpactedSegmentKeys=function(n,t,i){void 0===i&&(i=new Set);var u=e.__spreadArray([],n,!0).sort(function(e,r){return e.start_page-r.start_page||e.end_page-r.end_page}),o=new Set;return t.forEach(function(e,n){if(!i.has(n)){var l=u.findIndex(function(e){return r.getSegmentReviewKey(e)===n});if(!(l<0)){var d=u[l];if(!f(d,e)){var v=a(e),s=u["MERGE_PREV"===v?l-1:"MERGE_NEXT"===v?l+1:-1];if(s){var _=r.getSegmentReviewKey(s);g(s,t.get(_))||o.add(_)}}}}}),o},exports.getPendingMergeImpactedSegmentKeys=function(n){var t=e.__spreadArray([],n,!0).sort(function(e,r){return e.start_page-r.start_page||e.end_page-r.end_page}),i=new Set;return t.forEach(function(e,n){var u,o=(null!==(u=e.review_steps)&&void 0!==u?u:[]).find(function(r){var n,t,i;if(!d(r))return!1;var u=a(r.human_action_enum),o=a(null===(n=r.human_resolution)||void 0===n?void 0:n.action),l=null===(t=r.human_resolution)||void 0===t?void 0:t.before,v=null===(i=r.human_resolution)||void 0===i?void 0:i.after,s=null!=(null==l?void 0:l.start_page)&&null!=l.end_page&&null!=(null==v?void 0:v.start_page)&&null!=v.end_page&&(l.start_page!==v.start_page||l.end_page!==v.end_page),_=(null==v?void 0:v.start_page)===e.start_page&&(null==v?void 0:v.end_page)===e.end_page;return("MERGE_NEXT"===u||"MERGE_PREV"===u)&&!(o===u&&s&&_)});if(o){var l=a(o.human_action_enum),v=t["MERGE_PREV"===l?n-1:n+1];v&&!g(v)&&i.add(r.getSegmentReviewKey(v))}}),i},exports.getResolvedScore=i,exports.getReviewScoreBand=u,exports.getReviewStepActionBadgeLabel=s,exports.getStructuralResultBadgeLabel=p,exports.getTitleReviewActionBadgeLabel=function(e,r,n){var t=o(n);if(t)return t;var i=s(e);return i||p(r)},exports.hasPolledStructuralAction=f,exports.hasStructuralBoundaryAction=c,exports.isReviewStepResolutionCurrent=_,exports.isReviewStepResolved=function(e,r){var n,t,i;if(!_(e,r))return!1;if(null!=(null===(n=e.review)||void 0===n?void 0:n.action))return!0;var u=null===(i=null===(t=e.human_resolution)||void 0===t?void 0:t.state)||void 0===i?void 0:i.trim().toLowerCase();return"resolved_by_human"===u||"approved"===u||"confirmed"===u},exports.shouldHideStructuralBoundaryReview=function(e,r,n,t){var i=o(t);if("Merged"===i)return n;if("Split"===i)return!0;if(function(e,r){var n,t,i;if("affected"!==(null===(n=r.sensitivity)||void 0===n?void 0:n.trim().toLowerCase()))return!1;var u=null!==(t=e.revert)&&void 0!==t?t:r.revert;if(!u)return!1;var o=null===(i=u.decision)||void 0===i?void 0:i.trim().toUpperCase();return u.current_segment_ids.length>u.previous_state.length&&("SET_RANGE"===o||"SPLIT"===o||"SPLIT_HERE"===o)}(e,r))return!0;var u=s(e);if("Split"===u)return!0;var l=p(r);return"Split"===l||"Merged"===u&&("Merged"!==l||n)};
|
|
2
2
|
//# sourceMappingURL=helper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./BoundaryCard.js"),n=require("./LabelCheck.js"),a=require("./PageCheck.js"),i=function(e){return"object"==typeof e&&null!==e?e:{}},t=function(e){return"string"==typeof e?e:null},o=function(e){return"number"==typeof e&&Number.isFinite(e)?e:null},r=function(e){return Array.isArray(e)?e.filter(function(e){return"string"==typeof e}):[]},l=function(e){var n="string"==typeof e?e.trim().toLowerCase():"";return"table"===n||"drawing"===n?n:null},u=function(e,n){return void 0===n&&(n=0),e.stable_key||e.segment_id||"".concat(e.start_page,"-").concat(e.end_page,"-").concat(n)},c=function(e){var a=i(e);return{current_label:t(a.current_label),custom_label:t(a.custom_label),group_id:t(a.group_id),user_actions:r(a.user_actions).filter(n.isLabelReviewAction)}},s=function(e){var n=i(e);return{page_type:l(n.page_type),page_num:o(n.page_num),classification_id:t(n.classification_id),user_actions:r(n.user_actions).filter(a.isPageCheckAction)}};exports.extractSegmentReviewData=function(n){var t=[],d=[],v=[];return n.forEach(function(n,p){var _,f,g=u(n,p),m=null!==(_=n.review_steps)&&void 0!==_?_:[];m.forEach(function(a,l){var u,p,_=(u=a.type,"page_boundary"===(p=u.trim().toLowerCase())||"page boundary review"===p?"boundary":"label"===p||"label review"===p?"label":"page"===p?"page":null);if("boundary"===_){var f=function(n){var a=i(n);return{focus_page:o(a.focus_page),boundary_margin:o(a.boundary_margin),user_actions:r(a.user_actions).filter(e.isBoundaryReviewAction)}}(a.metadata);t.push({id:"".concat(g,":boundary:").concat(l),reviewStepIndex:l,segment:n,review_step:a,metadata:f})}"label"===_&&d.push({id:"".concat(g,":label:").concat(l),reviewStepIndex:l,segment:n,review_step:a,metadata:c(a.metadata)}),"page"===_&&v.push({id:"".concat(g,":page:").concat(l),reviewStepIndex:l,segment:n,review_step:a,metadata:s(a.metadata)})});var y=0;null===(f=n.page_classifications)||void 0===f||f.forEach(function(e,i){var t,o,r=null!==(t=e.page_num)&&void 0!==t?t:null,u=null!==(o=e.questions)&&void 0!==o?o:[];(u.length>0?u:e.severity?[e]:[]).forEach(function(t,o){var u,c,d,p;if(l(t.page_type)){var _=function(e,n,i,t){var o,r,u,c,s,d,v,p,_,f,g,m,y,b,w,h=l(e.page_type),C=null===(r=null===(o=e.human_action)||void 0===o?void 0:o.verdict)||void 0===r?void 0:r.trim().toUpperCase(),x=C&&a.isPageCheckAction(C)?C:null,S="drawing"===h?"an engineering drawing":h?"a ".concat(h):null;return{type:"page",confirmed:i,title:"Page Type Check",summary:(null==t?void 0:t.trim())||(x&&null!=n&&S?"Page ".concat(n," was confirmed as ").concat("YES"===x?S:"not ".concat(S),"."):void 0),format:"pdf",confidence:null!==(c=null===(u=e.machine_classification)||void 0===u?void 0:u.confidence)&&void 0!==c?c:null,decided_by:null!==(d=null===(s=e.machine_classification)||void 0===s?void 0:s.decisioning_method)&&void 0!==d?d:null,human_action_enum:null,reason:h?"We're not fully confident about the type of this page. Is this page a ".concat(h,"?"):null,reasons:null!==(v=e.reasons)&&void 0!==v?v:[],score:null!==(f=null!==(p=e.score)&&void 0!==p?p:null===(_=e.machine_classification)||void 0===_?void 0:_.score)&&void 0!==f?f:null,review:null==x?null:{action:x,reviewed_by:null!==(m=null===(g=e.human_action)||void 0===g?void 0:g.reviewed_by)&&void 0!==m?m:"",reviewed_at:null!==(b=null===(y=e.human_action)||void 0===y?void 0:y.reviewed_at)&&void 0!==b?b:""},metadata:{page_type:h,page_num:n,classification_id:null!==(w=e.id)&&void 0!==w?w:null,user_actions:["YES","NO"]}}}(t,r,null!==(c=null!==(u=t.confirmed)&&void 0!==u?u:e.confirmed)&&void 0!==c?c:null,null!==(d=e.summary)&&void 0!==d?d:null);v.push({id:"".concat(g,":page-classification:").concat(null!==(p=t.id)&&void 0!==p?p:"".concat(i,"-").concat(o)),reviewStepIndex:m.length+y,segment:n,review_step:_,metadata:s(_.metadata)}),y+=1}})})}),{boundaryReviews:t,labelReviews:d,pageReviews:v}},exports.getSegmentReviewKey=u;
|
|
2
2
|
//# sourceMappingURL=reviewStepAdapters.js.map
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),r=require("./features/Bookemon/Bookemon.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),r=require("./features/Bookemon/Bookemon.js"),o=require("./features/PdfEditorCitation/PdfEditorCitation.js"),a=require("./features/CitationRenderer/CitationRenderer.js"),n=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),u=require("./features/PaginatedTable/PaginatedTable.js"),C=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),p=require("./features/ChatCitation/ChatCitationRenderer.js"),l=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),d=require("./features/PdfViewer/PdfViewer.js"),f=require("./features/SegmentReviewComponents/BoundaryCard.js");require("tslib"),require("react/jsx-runtime"),require("react"),require("@mui/material/Box"),require("@mui/material/Popper"),require("@mui/material/SvgIcon");var m=require("./features/SegmentReviewComponents/CognitiveIntegrity.js"),x=require("./features/SegmentReviewComponents/LabelCheck.js"),c=require("./features/SegmentReviewComponents/PageCheck.js"),g=require("./features/SegmentReviewComponents/reviewStepAdapters.js"),q=require("./features/SegmentReviewComponents/RevertCard.js"),j=require("./features/SegmentReviewComponents/RevertSuccessCard.js"),R=require("./features/SegmentReviewComponents/SegmentReviewPdfWrapper.js"),S=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),w=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),v=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),P=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),I=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),b=require("./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js"),D=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),A=require("./features/TableCitation/TableCitationContent.js"),T=require("./features/ReviewPanel/ReviewPanel.js"),h=require("./features/CitationViewer/CitationsViewer.js"),k=require("./features/ExcelCitation/ExcelCitations.js"),B=require("./features/ScannedDocCitation/ScannedDocCitation.js"),W=require("./features/ChatDrawer/ChatDrawer.js"),y=require("./features/ChatDrawer/constants/ChatDrawer.js"),E=require("./features/SplitterCitations/SplitterCitationsComponent.js"),V=require("./features/DualCitation/SourceBQDataCompnent.js"),G=require("./features/CognitiveCompare/CognitiveCompare.js"),L=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),F=require("./features/TextualGuidelines/TextualGuideLinesComponent.js"),U=require("./features/RulebookCitations/RuleBookCitationWrapper.js"),O=require("./features/IngestionStatus/IngestionStatusComponent.js"),_=require("./features/ManageRemainders/ManageReminders.js"),M=require("./features/PromptemonBlockViewer/PromptemonBlockViewer.js"),N=require("./features/PromptemonViewer/PromptemonViewer.js"),H=require("./features/SPBAnalysisPanel/Spbanalysispanel.js"),Q=require("./features/GptWebCitation/GptWebCitation.js"),z=require("./hooks/useOnDemandCitationFetch.js"),X=require("./features/InstantLearningCitation/InstantLearningCitationComponent.js"),Y=require("./features/BPACitationRenderer/BPACitationRenderer.js"),Z=require("./features/GptWebCitation/utils/citationData.utils.js"),J=require("./features/GptWebCitation/types.js"),K=require("./features/PromptCitation/PromptCitation.js"),$=require("./features/PromptCitation/CitationDependencyGraph.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=r.default,exports.PdfCitation=o.PdfEditorCitation,exports.CitationRenderer=a.default,exports.MarkdownRenderer=n.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=u.default,exports.InternalgptReasoningComponent=C.default,exports.NonWebReasoningComponent=C.default,exports.ChatCitation=p.default,exports.CognitiveDecisioningCard=l.default,exports.PdfViewer=d.default,exports.createBoundaryCardOptions=f.createBoundaryCardOptions,exports.isBoundaryReviewAction=f.isBoundaryReviewAction,exports.CognitiveIntegrity=m.default,exports.createLabelCheckOptions=x.createLabelCheckOptions,exports.isLabelReviewAction=x.isLabelReviewAction,exports.PageCheck=c.default,exports.isPageCheckAction=c.isPageCheckAction,exports.extractSegmentReviewData=g.extractSegmentReviewData,exports.RevertCard=q.default,exports.RevertSuccessCard=j.default,Object.defineProperty(exports,"SegmentPdfSpecialZoomLevel",{enumerable:!0,get:function(){return R.SegmentPdfSpecialZoomLevel}}),exports.SegmentReviewPdfWrapper=R.default,exports.FaqCitation=S.default,exports.ImageCitationContent=w.default,exports.VideoCitationContent=v.default,exports.FileCitationContent=P.default,exports.WebCitationWithImageContent=I.default,exports.MarkdownWithImageCitation=b.default,exports.AiReasoningCitation=D.default,exports.TableCitationContent=A.default,exports.ReviewPanel=T.ReviewPanel,exports.CitationsViewer=h.default,exports.ExcelCitation=k.default,exports.ScannedDocCitation=B.default,exports.ChatDrawer=W.default,exports.FILE_INGESTION_STATUS=y.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=y.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=y.TRUNCATE_THRESHOLD,exports.SplitterCitationsComponent=E.default,exports.SourcesBQCitation=V.SourcesBQCitation,exports.findSourceCitation=V.findSourceCitation,exports.parseSourcesBQHref=V.parseSourcesBQHref,exports.CognitiveCompare=G.default,exports.CognitiveInternalgptCoreComponent=L.default,exports.TextualGuideLinesComponent=F.default,exports.RuleBookCitationWrapper=U.default,exports.IngestionStatusChip=O.IngestionStatusChip,exports.IngestionStatusComponent=O.IngestionStatusComponent,exports.ManageReminders=_.ManageReminders,exports.PromptemonBlockViewer=M.default,exports.PromptemonViewer=N.default,exports.SPBAnalysisPanel=H.default,exports.GptWebCitation=Q.default,exports.useOnDemandCitationFetch=z.useOnDemandCitationFetch,exports.InstantLearningCitationWrapper=X.default,exports.BPACitationRenderer=Y.default,exports.extractLearnedFromUrl=Z.extractLearnedFromUrl,exports.extractRelevanceScoreFromContent=Z.extractRelevanceScoreFromContent,exports.extractTopicFromContent=Z.extractTopicFromContent,exports.getWebCitationImageUrl=Z.getWebCitationImageUrl,exports.mapCitationDataToDisplay=Z.mapCitationDataToDisplay,exports.resolveSkeletonVisitUrl=Z.resolveSkeletonVisitUrl,exports.sanitizeExternalUrl=Z.sanitizeExternalUrl,Object.defineProperty(exports,"CitationType",{enumerable:!0,get:function(){return J.CitationType}}),exports.allowsGptCitationView=J.allowsGptCitationView,exports.allowsWebCitationView=J.allowsWebCitationView,exports.showsCitationViewToggle=J.showsCitationViewToggle,exports.PromptCitation=K.default,exports.CitationDependencyGraph=$.default;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("axios"));exports.createRedlineDocument=async(e,
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("axios"));exports.createRedlineDocument=async(e,t)=>{try{console.log("[createRedlineDocument] Request:",e);const{data:o}=await n.default.post(`${e.baseApiUrl}/redlining/create`,{user_name:e.userName,user_email:e.userEmail,redline_config_id:e.redlineConfigId,changelog_config_id:e.changelogConfigId,artifact_id:e.artifactId,input_data:e.inputData,document_metadata:{comparison_id:e.comparisonId}},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return console.log("[createRedlineDocument] Response:",o),o}catch(e){console.log("[createRedlineDocument] Error:",e)}return null},exports.fetchRedlineDocumentSection=async(e,t)=>{if(!(e.documentId&&"string"==typeof e.documentId&&e.documentId.trim()&&e.sectionId&&"string"==typeof e.sectionId&&e.sectionId.trim()&&e.baseApiUrl&&"string"==typeof e.baseApiUrl&&e.baseApiUrl.trim()&&e.redlineConfigId&&"string"==typeof e.redlineConfigId&&e.redlineConfigId.trim()))return console.error("[fetchRedlineDocumentSection] Invalid or missing payload parameters"),null;try{console.log("[fetchRedlineDocumentSection] Request:",e);const{data:o}=await n.default.get(`${e.baseApiUrl}/redlining/segment/${e.documentId}/${e.sectionId}?redline_config_id=${e.redlineConfigId}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return console.log("[fetchRedlineDocumentSection] Response:",o),o}catch(e){console.log("[fetchRedlineDocumentSection] Error:",e)}return null},exports.getRedlineDocumentId=async e=>{try{console.log("[getRedlineDocumentId] Request:",e);const{data:t}=await n.default.get(`${e.baseApiUrl}/book-finder-mode/get_comparison/${e.comparisonId}`);return console.log("[getRedlineDocumentId] Response:",t),t}catch(e){console.log("[getRedlineDocumentId] Error:",e)}return null},exports.resolveRedline=async(e,t)=>{try{console.log("[resolveRedline] Request:",e);const{data:o}=await n.default.post(`${e.baseApiUrl}/redlining/resolve`,{document_id:e.documentId,user_name:e.userName,user_email:e.userEmail,redline_id:e.redlineId,action:e.action,redline_config_id:e.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return console.log("[resolveRedline] Response:",o),o}catch(e){console.log("[resolveRedline] Error:",e)}return null},exports.updateRedlineDocument=async(e,t)=>{try{console.log("[updateRedlineDocument] Request:",e);const{data:o}=await n.default.put(`${e.baseApiUrl}/redlining/update-manual`,{document_id:e.documentId,segment_id:e.sectionId,user_name:e.userName,user_email:e.userEmail,new_plain_content:e.updatedContent,redline_config_id:e.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return console.log("[updateRedlineDocument] Response:",o),o}catch(e){console.log("[updateRedlineDocument] Error:",e)}return null};
|
|
2
2
|
//# sourceMappingURL=redlineService.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i,__awaiter as n,__generator as t}from"tslib";import{jsxs as o,jsx as e,Fragment as l}from"react/jsx-runtime";import{Globe as r,ChevronUp as a,ChevronDown as d,Maximize2 as u,X as c,ExternalLink as s}from"lucide-react";import{useState as v,useEffect as p,useMemo as m,useRef as h}from"react";import g from"./ResizableSplitPane.js";import f from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as b,DefaultFullScreenIcon as x}from"../../assests/svg/PdfViewerIcons.js";import _ from"react-markdown";import y from"rehype-raw";import{Dialog as w,Box as C}from"@mui/material";import{SHARED_MARKDOWN_STYLES as F}from"./CognitiveCompareConfig.js";import"react-dom";import{useCompareContext as D}from"./CompareContext.js";import{processGuidelinesMarkdown as P}from"./Guidelines/utils/processGuidelinesMarkdown.js";import T from"../GptWebCitation/GptWebCitation.js";import{CitationType as S}from"../GptWebCitation/types.js";import"./MoreFunctionsPopup.js";import"./components/SubSectionAccordion.js";import"./components/LHSSectionRow.js";import"./components/RHSSectionRow.js";var k=function(i){var n,t,o;return(null===(o=null===(t=null===(n=(null==i?void 0:i.extraMetaData)||i)||void 0===n?void 0:n.aiReasoningCitation)||void 0===t?void 0:t.gpt_citation)||void 0===o?void 0:o[0])||null},N="https://dev-proposals-ai.techo.camp/utility/ca-workflow-composer-agent/get_citation",j="sai.siddhartha@techolution.com",I="672e32f7a0e8fe2e8e50bcba",R="TNV Sai Siddhartha",G="90vh",U="calc(".concat(G," - 120px)"),E=function(){var i;return"function"==typeof(null===(i=globalThis.crypto)||void 0===i?void 0:i.randomUUID)?globalThis.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var n=Math.floor(16*Math.random());return("x"===i?n:n%4+8).toString(16)})},M=function(i,n){var t=function(i){var n;return(null==i?void 0:i.payloadCitationId)||(null===(n=null==i?void 0:i.extraMetaData)||void 0===n?void 0:n.payloadCitationId)||""}(i)||n||E();return function(i,n){i&&"object"==typeof i&&(i.payloadCitationId=n,i.extraMetaData&&"object"==typeof i.extraMetaData&&(i.extraMetaData.payloadCitationId=n))}(i,t),t},A=function(o){var l,r=o.metaData,g=o.isFullscreen,f=void 0!==g&&g,b=D().gptWebCitationConfig,x=m(function(){return function(i){return{endpoint:(null==i?void 0:i.endpoint)||N,userEmail:(null==i?void 0:i.userEmail)||j,userId:(null==i?void 0:i.userId)||I,userName:(null==i?void 0:i.userName)||R,headers:null==i?void 0:i.headers}}(b)},[b]),_=null==r?void 0:r.webGpt,y=h(null);y.current||(y.current=E());var w=m(function(){return function(i,n,t){var o,e,l=k(i),r=(null==l?void 0:l.customMetaData)||{},a=(null==r?void 0:r.value)||{},d=(null==i?void 0:i.webSearchAnswer)||{},u=(null==i?void 0:i.extraMetaData)||i||{};return{userEmail:(null==i?void 0:i.userEmail)||(null==d?void 0:d.userEmail)||(null==n?void 0:n.userEmail)||"",userId:(null==i?void 0:i.userId)||(null==d?void 0:d.userId)||(null==n?void 0:n.userId)||"",userName:(null==i?void 0:i.userName)||(null==d?void 0:d.userName)||(null==n?void 0:n.userName)||"",citationId:M(i,t),citationUrl:(null==a?void 0:a.citationUrl)||(null==d?void 0:d.citationUrl)||"",content:(null==u?void 0:u.Reasoning)||(null==d?void 0:d.enhanced_content)||"",citationType:(null==a?void 0:a.citationType)||"web",citatioNumber:null!==(e=null!==(o=null==r?void 0:r.citation_number)&&void 0!==o?o:null==l?void 0:l.citation_number)&&void 0!==e?e:Number((null==i?void 0:i.reasoningId)||0)}}(_,x,y.current||void 0)},[_,x]),C=m(function(){return k(_)},[_]),F=(null===(l=null==C?void 0:C.customMetaData)||void 0===l?void 0:l.value)||{},P=(null==_?void 0:_.extraMetaData)||_||{},G=v(),A=G[0],H=G[1],W=v("pending"),z=W[0],O=W[1],V=v(!0),B=V[0],L=V[1];p(function(){var o=!0;return n(void 0,void 0,void 0,function(){var n,e,l,r;return t(this,function(t){switch(t.label){case 0:if(!x.endpoint||!(null==w?void 0:w.citationUrl)||!(null==w?void 0:w.content))return O("error"),[2];O("pending"),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch(x.endpoint,{method:"POST",headers:i({"actor-id":w.userEmail,Accept:"application/json, text/plain, */*","Content-Type":"application/json"},x.headers||{}),body:JSON.stringify(w)})];case 2:if(!(n=t.sent()).ok)throw new Error("Failed to fetch GPT web citation (".concat(n.status,")"));return[4,n.json()];case 3:return e=t.sent(),l=(null==e?void 0:e.responseData)||(null==e?void 0:e.result)||(null==e?void 0:e.data)||e,o?(H(l),O("success"),[3,5]):[2];case 4:return r=t.sent(),o?(console.error("Failed to load GPT web citation",r),O("error"),[3,5]):[2];case 5:return[2]}})}),function(){o=!1}},[w,x]);var J=m(function(){return{item:{confidence_score:Number((null==P?void 0:P.Confidence_score)||0),text:(null==F?void 0:F.paraphrase)||"Web citation reasoning",dataSource:(null==F?void 0:F.text)||(null==P?void 0:P.Reasoning)||"",paraphrase:(null==F?void 0:F.paraphrase)||""},headerTitle:"GPT Web Citation",index:Number((null==w?void 0:w.citatioNumber)||1)-1,iconsConfig:{ChevronDownIcon:d,ChevronUpIcon:a,MaximizeIcon:u,CloseIcon:c}}},[F,null==w?void 0:w.citatioNumber,P]),$=m(function(){return i(i({},J),f?{bodyHeight:U}:{})},[J,f]);return e(T,{gptCitation:$,defaultCitationUrl:(null==w?void 0:w.citationUrl)||"",citationType:S.GPT_WEB,webCitationData:A,webCitationStatus:z,showWebCitation:B,onToggleCitationView:function(){return L(function(i){return!i})},iconsConfig:{MaximizeIcon:u,ExternalLinkIcon:s},isFixedHeight:!0})},H=function(n){var t,o,r,a,d,u,c,s=n.href,v=n.metaData,p=n.citationTitle,h=n.citationType,b=n.citationReason,x=n.isFullscreen,w=D().guidelinesData,T=function(i){try{var n=function(i){var n=i.match(/^(?:pdf_citation|deviation_summary)\$(\d+)/);if(n)try{var t=i.indexOf("?"),o=t>=0?i.slice(t):"";return{citationNumber:n[1],parsedUrl:new URL(o||"./",window.location.origin)}}catch(i){return{citationNumber:n[1],parsedUrl:null}}try{var e=new URL(i,window.location.origin);return{citationNumber:e.searchParams.get("citationNumber")||e.searchParams.get("citation_number"),parsedUrl:e}}catch(i){return{citationNumber:null,parsedUrl:null}}}(i),t=n.citationNumber,o=n.parsedUrl;return{citationNumber:t,phraseToHighlight:(null==o?void 0:o.searchParams.get("phrase_to_highlight"))||null,citationTypeFromHref:(null==o?void 0:o.searchParams.get("citation_type"))||null}}catch(i){return{citationNumber:null,phraseToHighlight:null,citationTypeFromHref:null}}}(s),S=T.citationNumber,k=T.phraseToHighlight,N=T.citationTypeFromHref,j=h||N||void 0,I="il_rulebook_citation"===j?"rulebook_citation":j,R=S&&(null===(t=null==v?void 0:v.citations)||void 0===t?void 0:t[S])||{},G=(null===(o=null==v?void 0:v.docData)||void 0===o?void 0:o.documents)||{},U=(null===(r=null==v?void 0:v.docData)||void 0===r?void 0:r.input_index_map)||{},E=Object.keys((null==v?void 0:v.citations)||{}).length>0||Object.keys((null==v?void 0:v.docData)||{}).length>0,M=null==U?void 0:U[0],H=null==U?void 0:U[1],W=M?G[M]:null,z=H?G[H]:null,O=M?R[M]:null,V=H?R[H]:null,B=m(function(){var i,n,t,o;return O&&W?e(f,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==W?void 0:W.title,pdfUrl:null==W?void 0:W.signed_url,highlightText:[null!==(i=null==O?void 0:O.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(n=null==O?void 0:O.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(t=null==O?void 0:O.custom_metadata)||void 0===t?void 0:t.pdf_start_page_number,null===(o=null==O?void 0:O.custom_metadata)||void 0===o?void 0:o.pdf_end_page_number]}):null},[null==W?void 0:W.title,null==W?void 0:W.signed_url,null==O?void 0:O.highlighted_text,null===(a=null==O?void 0:O.custom_metadata)||void 0===a?void 0:a.pdf_start_page_number,null===(d=null==O?void 0:O.custom_metadata)||void 0===d?void 0:d.pdf_end_page_number]),L=m(function(){var i,n,t,o;return V&&z?e(f,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:null==z?void 0:z.title,pdfUrl:null==z?void 0:z.signed_url,jumpToPageValue:1,highlightText:[null!==(i=null==V?void 0:V.highlighted_text)&&void 0!==i?i:""],highlightPages:{1:null===(n=null==V?void 0:V.custom_metadata)||void 0===n?void 0:n.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(t=null==V?void 0:V.custom_metadata)||void 0===t?void 0:t.pdf_start_page_number,null===(o=null==V?void 0:V.custom_metadata)||void 0===o?void 0:o.pdf_end_page_number]}):null},[null==z?void 0:z.title,null==z?void 0:z.signed_url,null==V?void 0:V.highlighted_text,null===(u=null==V?void 0:V.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number,null===(c=null==V?void 0:V.custom_metadata)||void 0===c?void 0:c.pdf_end_page_number]),J="dual_citation"===I,$=J&&!!(null==v?void 0:v.webGpt),q=m(function(){if(!B)return null;var n=$?e(A,{metaData:v,isFullscreen:x}):"rulebook_citation"===I?e(l,{children:e(C,i({sx:i(i({padding:"0px 20px",backgroundColor:"#FFFFFF",borderRadius:"8px"},F),{overflow:"auto"})},{children:e(_,i({rehypePlugins:[y]},{children:P({guidelinesData:w,targetHighlights:[k],labelColor:"#FEF08A"})}))}))}):L;return n?e(g,{leftComponent:B,rightComponent:n,isFullscreen:x}):B},[B,L,I,$,v,x,w,k]);return(null==v?void 0:v.webGpt)&&!E?e(A,{metaData:v,isFullscreen:x}):S?"rulebook_citation"===I?e("div",O?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:q}):i({style:{padding:"12px",fontSize:"13px",color:"#344054",lineHeight:1.5}},{children:b||"Rulebook citation selected."})):J?O||V?e("div",i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:q})):(null==v?void 0:v.webGpt)?e(A,{metaData:v,isFullscreen:x}):e("div",{children:"Missing PDF Citation. Please try again later"}):["contract","clause"].includes(p)?e("div",O||V?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:q}):{children:"Missing PDF Citation. Please try again later"}):e("div",{children:"No Citation Found. Please try again later"}):null},W=function(n){var t,l,u,c,s,m,h,g=n.href,f=n.children,_=n.citationType,y=n.citationReason,C=n.metaData,F=n.chevronUpComponent,D=void 0===F?null:F,P=n.chevronDownComponent,T=void 0===P?null:P,S=n.customStyle,k=void 0===S?{}:S,N=n.defaultState,j=void 0!==N&&N,I=n.onFullscreenChange,R=v(j),U=R[0],E=R[1],M=v(!1),A=M[0],W=M[1],z="string"==typeof f&&(null===(t=null==f?void 0:f.split("\n"))||void 0===t?void 0:t.length)>1?f.split("\n").join(" "):f;p(function(){if(null==I||I(A),A)return function(){null==I||I(!1)}},[A,I]);var O="string"==typeof f?f:f[0],V=null!=D?D:function(i){var n,t;return e(a,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(l=null==k?void 0:k.arrow)&&void 0!==l?l:{}),B=null!=T?T:function(i){var n,t;return e(d,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(t=null==i?void 0:i.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(u=null==k?void 0:k.arrow)&&void 0!==u?u:{}),L=o("div",i({style:{boxSizing:"border-box",border:A?"none":"1px solid #E4E7EC",borderRadius:A?0:"8px",overflow:"hidden",marginTop:A?0:"8px",display:"flex",flexDirection:"column",width:"100%",height:A?"100%":void 0,backgroundColor:"#FAFAFA"}},{children:[e("div",i({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:e("button",i({onClick:function(){W(function(i){return!i})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:e(A?b:x,{})}))})),e("div",i({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:e(H,{href:g,children:f,metaData:C,citationTitle:O,citationType:_,citationReason:y,isFullscreen:A})}))]}));return o("span",i({style:i({display:"inline"},k.relativeWrapper||{})},{children:[e("div",i({style:i({display:"inline",marginTop:0},k.citationButtonWrapper||{})},{children:o("button",i({type:"button",onClick:function(){return E(function(i){return!i})},style:i({display:(null==C?void 0:C.webGpt)?"inline":"inline-flex",alignItems:(null==C?void 0:C.webGpt)?void 0:"center",gap:(null==C?void 0:C.webGpt)?void 0:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:(null==C?void 0:C.webGpt)?600:700,color:(null==C?void 0:C.webGpt)?"#6D28D9":"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},k.citationButton||{})},{children:[(null==C?void 0:C.webGpt)&&e(r,{size:null!==(s=null===(c=k.arrow)||void 0===c?void 0:c.fontSize)&&void 0!==s?s:"1em",color:null!==(h=null===(m=k.arrow)||void 0===m?void 0:m.color)&&void 0!==h?h:"#6D28D9",style:{display:"inline-block",width:"1em",height:"1em",marginRight:"3px",verticalAlign:"-0.125em",flexShrink:0}}),e("span",{children:z}),e("span",i({style:{display:"inline-flex",alignItems:"center",marginLeft:(null==C?void 0:C.webGpt)?"3px":void 0,verticalAlign:(null==C?void 0:C.webGpt)?"-0.125em":void 0}},{children:U?V:B}))]}))})),U&&(A?e(w,i({open:A,onClose:function(){return W(!1)},maxWidth:!1,BackdropProps:{sx:{backgroundColor:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(4px)"}},PaperProps:{sx:{backgroundColor:"#FAFAFA",borderRadius:"16px",height:G,m:0,maxHeight:G,maxWidth:"95vw",overflow:"hidden",width:"95vw"}}},{children:L})):L)]}))};export{W as default};
|
|
1
|
+
import{__assign as n}from"tslib";import{jsxs as o,jsx as i}from"react/jsx-runtime";import{Dialog as e}from"@mui/material";import{Globe as t,ChevronUp as l,ChevronDown as r}from"lucide-react";import{useState as d,useEffect as a,useMemo as u,useCallback as s}from"react";import{DefaultFullScreenCloseIcon as c,DefaultFullScreenIcon as p}from"../../assests/svg/PdfViewerIcons.js";import{useOptionalCompareContext as v}from"./CompareContext.js";import f from"./CitationRendererInner.js";var g="90vh",h={border:"1px solid #D0D5DD",borderRadius:"6px",background:"#FFFFFF",color:"#344054",cursor:"pointer",fontSize:"12px",fontWeight:600,padding:"3px 8px"},m=function(m){var x,b,y,C,w,F,D,k=m.href,S=m.children,z=m.citationType,R=m.citationReason,A=m.metaData,j=m.chevronUpComponent,B=void 0===j?null:j,G=m.chevronDownComponent,W=void 0===G?null:G,E=m.customStyle,I=void 0===E?{}:E,P=m.defaultState,T=void 0!==P&&P,O=m.onFullscreenChange,H=m.onDemandCitationContext,L=v(),U=null==L?void 0:L.onDemandCitationConfig,V=null==L?void 0:L.getOnDemandCitationCacheEntry,q=null==L?void 0:L.fetchOnDemandCitationContext,J=null==L?void 0:L.onDemandCitationCacheVersion,K=d(T),M=K[0],N=K[1],Q=d(!1),X=Q[0],Y=Q[1],Z="string"==typeof S&&(null===(x=null==S?void 0:S.split("\n"))||void 0===x?void 0:x.length)>1?S.split("\n").join(" "):S,$="string"==typeof S?S:S[0];a(function(){if(null==O||O(X),X)return function(){null==O||O(!1)}},[X,O]);var _=u(function(){return H&&V?V(H):void 0},[V,J,H]),nn=!!(null==U?void 0:U.enabled)&&!!H,on="success"===(null==_?void 0:_.status)&&_.data&&"object"==typeof _.data&&Object.keys(_.data).length>0,en=u(function(){return n(n({},A),{citations:nn?on?null==_?void 0:_.data:{}:null==A?void 0:A.citations})},[on,nn,A,null==_?void 0:_.data]),tn=nn&&(!_||"loading"===_.status)&&!on,ln=nn&&"error"===(null==_?void 0:_.status)&&!on,rn=nn&&"success"===(null==_?void 0:_.status)&&!on,dn=!nn||on,an=s(function(){(null==U?void 0:U.enabled)&&H&&q&&("loading"===(null==_?void 0:_.status)||"success"===(null==_?void 0:_.status)&&on||q(H).catch(function(n){U.debug&&console.error("[CognitiveCompare:onDemandCitations] citation fetch failed",n)}))},[q,on,null==_?void 0:_.status,U,H]),un=null!=B?B:function(n){var o,e;return i(l,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(e=null==n?void 0:n.color)&&void 0!==e?e:"rgb(214, 51, 132)"})}(null!==(b=null==I?void 0:I.arrow)&&void 0!==b?b:{}),sn=null!=W?W:function(n){var o,e;return i(r,{size:null!==(o=null==n?void 0:n.fontSize)&&void 0!==o?o:16,color:null!==(e=null==n?void 0:n.color)&&void 0!==e?e:"rgb(214, 51, 132)"})}(null!==(y=null==I?void 0:I.arrow)&&void 0!==y?y:{}),cn=function(o){return i("button",n({type:"button",onClick:function(n){n.stopPropagation(),an()},style:n(n({},h),o)},{children:"Retry"}))},pn=o("div",n({style:{boxSizing:"border-box",border:X?"none":"1px solid #E4E7EC",borderRadius:X?0:"8px",overflow:"hidden",marginTop:X?0:"8px",display:"flex",flexDirection:"column",width:"100%",height:X?"100%":void 0,backgroundColor:"#FAFAFA"}},{children:[i("div",n({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:i("button",n({onClick:function(){Y(function(n){return!n})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:i(X?c:p,{})}))})),o("div",n({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:[tn&&i("div",n({style:{padding:"12px",fontSize:"13px",color:"#475467"}},{children:"Loading citation details..."})),ln&&o("div",n({style:{padding:"12px",fontSize:"13px",color:"#B42318",display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[i("span",{children:"Unable to load citation details. Please try again later."}),cn({border:"1px solid #FDA29B",color:"#B42318"})]})),rn&&o("div",n({style:{padding:"12px",fontSize:"13px",color:"#475467",display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[i("span",{children:"Citation details are not available for this source."}),cn()]})),dn&&i(f,{href:k,children:S,metaData:en,citationTitle:$,citationType:z,citationReason:R,isFullscreen:X})]}))]}));return o("span",n({style:n({display:"inline"},I.relativeWrapper||{})},{children:[i("div",n({style:n({display:"inline",marginTop:0},I.citationButtonWrapper||{})},{children:o("button",n({type:"button",onClick:function(){N(function(n){var o=!n;return o&&an(),o})},style:n({display:(null==A?void 0:A.webGpt)?"inline":"inline-flex",alignItems:(null==A?void 0:A.webGpt)?void 0:"center",gap:(null==A?void 0:A.webGpt)?void 0:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:(null==A?void 0:A.webGpt)?600:700,color:(null==A?void 0:A.webGpt)?"#6D28D9":"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},I.citationButton||{})},{children:[(null==A?void 0:A.webGpt)&&i(t,{size:null!==(w=null===(C=I.arrow)||void 0===C?void 0:C.fontSize)&&void 0!==w?w:"1em",color:null!==(D=null===(F=I.arrow)||void 0===F?void 0:F.color)&&void 0!==D?D:"#6D28D9",style:{display:"inline-block",width:"1em",height:"1em",marginRight:"3px",verticalAlign:"-0.125em",flexShrink:0}}),i("span",{children:Z}),i("span",n({style:{display:"inline-flex",alignItems:"center",marginLeft:(null==A?void 0:A.webGpt)?"3px":void 0,verticalAlign:(null==A?void 0:A.webGpt)?"-0.125em":void 0}},{children:M?un:sn}))]}))})),M&&(X?i(e,n({open:X,onClose:function(){Y(!1),null==O||O(!1)},maxWidth:!1,BackdropProps:{sx:{backgroundColor:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(4px)"}},PaperProps:{sx:{backgroundColor:"#FAFAFA",borderRadius:"16px",height:g,m:0,maxHeight:g,maxWidth:"95vw",overflow:"hidden",width:"95vw"}}},{children:pn})):pn)]}))};export{m as default};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as e,__assign as n}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{useMemo as i}from"react";import{Box as r,Typography as a}from"@mui/material";import l from"react-markdown";import d from"rehype-raw";import c from"./CitationAnchor.js";import{mergeRulebookCitationsIntoMatchingLinks as u}from"./Guidelines/utils/helper.js";import{useOptionalCompareContext as s}from"./CompareContext.js";import{buildOnDemandCitationContexts as f}from"./onDemandCitations/contextBuilder.js";import{getOnDemandCitationLinkKey as m}from"./onDemandCitations/href.js";import"./utils/normalizeRedlineMarkdown.js";var p=function(e){return e?"./dual-citation?citationNumber=".concat(encodeURIComponent(e)):""};function v(v){var h=v.content,x=void 0===h?"":h,C=v.title,D=void 0===C?"":C,y=v.citations,g=void 0===y?{}:y,b=v.styles,w=void 0===b?{}:b,I=v.docData,S=void 0===I?{}:I,j=v.deviationData,F=void 0===j?null:j;v.open;var M=v.onCitationFullscreenChange,E=v.tabKey,N=v.sectionTitle,T=v.referenceSectionTitle,_=v.sourceNodeId,K=v.deviationKey,R=v.baseContentId,k=v.compareContentIds,A=s(),O=null==A?void 0:A.treeData,q=null==A?void 0:A.onDemandCitationConfig,z=i(function(){return JSON.stringify(g||{})},[g]),B=i(function(){return g},[z]),G=i(function(){return JSON.stringify(S||{})},[S]),J=i(function(){return S},[G]),H=i(function(){return{citations:B,docData:J}},[B,J]),P=i(function(){return(null==q?void 0:q.enabled)?f({treeData:O,content:x,requestId:q.requestId,tabKey:E,popupNodeId:_||(null==F?void 0:F.nodeId),deviationKey:K,sectionTitle:N,referenceSectionTitle:T,docData:J,staticCitations:B,deviationData:F,cognitiveData:null,baseContentId:R,compareContentIds:k}).reduce(function(e,n){return e.set(m(n.href),n),e},new Map):new Map},[R,k,x,F,K,q,T,N,_,B,J,E,O]),U=i(function(){var e=null==F?void 0:F.web_search_answer,n=(null==e?void 0:e.extraMetaData)||{};return Object.keys(n).reduce(function(e,n){var t=function(e,n){var t;if(!e||!n)return null;var o=null==e?void 0:e.web_search_answer,i=null===(t=null==o?void 0:o.extraMetaData)||void 0===t?void 0:t[n];return o&&i?{reasoningId:n,evaluation:e,webSearchAnswer:o,extraMetaData:i}:null}(F,n);return t&&(e[n]=t),e},{})},[F]),W=i(function(){return u(x)},[x]),L=i(function(){return{a:function(o){var i,r=o.href,a=void 0===r?"":r,l=o.children,d=o.type,u=o.reason,s=e(o,["href","children","type","reason"]),f=null==s?void 0:s["data-cognitive-reasoning"],v=!0===(i=null==s?void 0:s["dual-citation"])||"true"===i,h=v&&f?U[String(f)]:null;return t(c,{href:v?p(String(f||"")):a,children:l,citationType:v?"dual_citation":d,citationReason:u,onDemandCitationContext:v?void 0:P.get(m(a)),metaData:n(n({},H),h?{webGpt:h}:{}),customStyle:h?{arrow:{color:"#6D28D9"}}:{},onFullscreenChange:M})}}},[P,H,U,M]);return o(r,n({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD"}},{children:[t(r,n({sx:{px:1.5,py:.75,borderBottom:"1px solid #EAECF0"}},{children:t(a,n({sx:{fontSize:"15px",fontWeight:600,color:"#344054",lineHeight:1.25}},{children:D}))})),t(r,n({sx:{px:1.5,py:1.1,display:"flex",flexDirection:"column",gap:.95}},{children:t(r,n({sx:{display:"flex",flexDirection:"column"}},{children:t(a,n({component:"div",sx:n({},w)},{children:t(l,n({components:L,rehypePlugins:[d]},{children:W}))}))}))}))]}))}export{v as default};
|
|
2
2
|
//# sourceMappingURL=CitationRenderer.js.map
|