@viswa-test/test-citation 0.0.382 → 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.
Files changed (440) hide show
  1. package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
  3. package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js +2 -0
  4. package/dist/cjs/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
  5. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
  7. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  8. package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
  9. package/dist/cjs/features/CognitiveCompare/CompareContext.js +1 -1
  10. package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
  11. package/dist/cjs/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
  12. package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
  13. package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
  14. package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  15. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  16. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  17. package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  18. package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  19. package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  20. package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
  21. package/dist/cjs/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
  22. package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  23. package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
  24. package/dist/cjs/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
  25. package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
  26. package/dist/cjs/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
  27. package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js +2 -0
  28. package/dist/cjs/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
  29. package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
  30. package/dist/cjs/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
  31. package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js +2 -0
  32. package/dist/cjs/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
  33. package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
  34. package/dist/cjs/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
  35. package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
  36. package/dist/cjs/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
  37. package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
  38. package/dist/cjs/features/GptWebCitation/GptWebCitation.js +1 -1
  39. package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
  40. package/dist/cjs/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
  41. package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
  42. package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
  43. package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
  44. package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  45. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
  46. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
  47. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
  48. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
  49. package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  50. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
  51. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
  52. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
  53. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
  54. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
  55. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
  56. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
  57. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
  58. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
  59. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
  60. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
  61. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
  62. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
  63. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
  64. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  65. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  66. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  67. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  68. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  69. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  70. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  71. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
  72. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
  73. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
  74. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
  75. package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
  76. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  77. package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  78. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  79. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
  80. package/dist/cjs/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  81. package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  82. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  83. package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  84. package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
  85. package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  86. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  87. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  88. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  89. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  90. package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  91. package/dist/cjs/features/RequirementAI/utils/helpers.js +1 -1
  92. package/dist/cjs/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
  93. package/dist/cjs/features/SegmentReviewComponents/BoundaryCard.js +1 -1
  94. package/dist/cjs/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
  95. package/dist/cjs/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
  96. package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
  97. package/dist/cjs/features/SegmentReviewComponents/helper.js +1 -1
  98. package/dist/cjs/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
  99. package/dist/cjs/index.js +1 -1
  100. package/dist/cjs/service/redlineService.js +1 -1
  101. package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
  102. package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
  103. package/dist/features/CognitiveCompare/CitationRendererInner.js +2 -0
  104. package/dist/features/CognitiveCompare/CitationRendererInner.js.map +1 -0
  105. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  106. package/dist/features/CognitiveCompare/CognitiveCompareConstants.js +1 -1
  107. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  108. package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
  109. package/dist/features/CognitiveCompare/CompareContext.js +1 -1
  110. package/dist/features/CognitiveCompare/GptWebCitationPanel.js +2 -0
  111. package/dist/features/CognitiveCompare/GptWebCitationPanel.js.map +1 -0
  112. package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
  113. package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
  114. package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
  115. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  116. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  117. package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  118. package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
  119. package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
  120. package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js +2 -0
  121. package/dist/features/CognitiveCompare/hooks/useOnDemandCitationCache.js.map +1 -0
  122. package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
  123. package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js +2 -0
  124. package/dist/features/CognitiveCompare/onDemandCitations/cacheKey.js.map +1 -0
  125. package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js +2 -0
  126. package/dist/features/CognitiveCompare/onDemandCitations/contextBuilder.js.map +1 -0
  127. package/dist/features/CognitiveCompare/onDemandCitations/href.js +2 -0
  128. package/dist/features/CognitiveCompare/onDemandCitations/href.js.map +1 -0
  129. package/dist/features/CognitiveCompare/onDemandCitations/payload.js +2 -0
  130. package/dist/features/CognitiveCompare/onDemandCitations/payload.js.map +1 -0
  131. package/dist/features/CognitiveCompare/onDemandCitations/response.js +2 -0
  132. package/dist/features/CognitiveCompare/onDemandCitations/response.js.map +1 -0
  133. package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js +2 -0
  134. package/dist/features/CognitiveCompare/utils/normalizeInlineMarkdown.js.map +1 -0
  135. package/dist/features/CognitiveCompare/utils/onDemandCitations.js +2 -0
  136. package/dist/features/CognitiveCompare/utils/onDemandCitations.js.map +1 -0
  137. package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
  138. package/dist/features/GptWebCitation/GptWebCitation.js +1 -1
  139. package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
  140. package/dist/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
  141. package/dist/features/PdfViewer/PdfToolbar.js +1 -1
  142. package/dist/features/PdfViewer/PdfViewer.js +1 -1
  143. package/dist/features/PdfViewer/usePdfHighlight.js +1 -1
  144. package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
  145. package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js +2 -0
  146. package/dist/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.js.map +1 -0
  147. package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js +2 -0
  148. package/dist/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js.map +1 -0
  149. package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  150. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js +2 -0
  151. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.css.js.map +1 -0
  152. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js +2 -0
  153. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.js.map +1 -0
  154. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js +2 -0
  155. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.css.js.map +1 -0
  156. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js +2 -0
  157. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.js.map +1 -0
  158. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js +2 -0
  159. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.css.js.map +1 -0
  160. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js +2 -0
  161. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.js.map +1 -0
  162. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js +2 -0
  163. package/dist/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.js.map +1 -0
  164. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.js +1 -1
  165. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  166. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  167. package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
  168. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  169. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  170. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  171. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
  172. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +1 -1
  173. package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +1 -1
  174. package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +1 -1
  175. package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +1 -1
  176. package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
  177. package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
  178. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.js +1 -1
  179. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationContent.module.css.js +1 -1
  180. package/dist/features/RequirementAI/components/citations/file-citation/FileCitationRender.js +1 -1
  181. package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
  182. package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
  183. package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js +1 -1
  184. package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
  185. package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
  186. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  187. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  188. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  189. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  190. package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
  191. package/dist/features/RequirementAI/utils/helpers.js +1 -1
  192. package/dist/features/RequirementAI/utils/proccess-stream.utils.js +1 -1
  193. package/dist/features/SegmentReviewComponents/BoundaryCard.js +1 -1
  194. package/dist/features/SegmentReviewComponents/CognitiveScoreBadge.js +1 -1
  195. package/dist/features/SegmentReviewComponents/RevertSuccessCard.js +1 -1
  196. package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
  197. package/dist/features/SegmentReviewComponents/helper.js +1 -1
  198. package/dist/features/SegmentReviewComponents/reviewStepAdapters.js +1 -1
  199. package/dist/index.js +1 -1
  200. package/dist/service/redlineService.js +1 -1
  201. package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
  202. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  203. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  204. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts +2 -0
  205. package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
  206. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts +8 -1
  207. package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
  208. package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts +13 -0
  209. package/dist/types/src/features/CognitiveCompare/CitationRendererInner.d.ts.map +1 -0
  210. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
  211. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  212. package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts +1 -1
  213. package/dist/types/src/features/CognitiveCompare/CognitiveCompareConstants.d.ts.map +1 -1
  214. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +12 -1
  215. package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
  216. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +12 -0
  217. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
  218. package/dist/types/src/features/CognitiveCompare/CognitivePopup.d.ts.map +1 -1
  219. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +9 -1
  220. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
  221. package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts +6 -0
  222. package/dist/types/src/features/CognitiveCompare/GptWebCitationPanel.d.ts.map +1 -0
  223. package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -1
  224. package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -1
  225. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +3028 -891
  226. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
  227. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +14 -1
  228. package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
  229. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  230. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
  231. package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts +2 -1
  232. package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
  233. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +1 -1
  234. package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
  235. package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
  236. package/dist/types/src/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts +10 -0
  237. package/dist/types/src/features/CognitiveCompare/hooks/useOnDemandCitationCache.d.ts.map +1 -0
  238. package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
  239. package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts +3 -0
  240. package/dist/types/src/features/CognitiveCompare/onDemandCitations/cacheKey.d.ts.map +1 -0
  241. package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts +16 -0
  242. package/dist/types/src/features/CognitiveCompare/onDemandCitations/contextBuilder.d.ts.map +1 -0
  243. package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts +6 -0
  244. package/dist/types/src/features/CognitiveCompare/onDemandCitations/href.d.ts.map +1 -0
  245. package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts +7 -0
  246. package/dist/types/src/features/CognitiveCompare/onDemandCitations/index.d.ts.map +1 -0
  247. package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts +4 -0
  248. package/dist/types/src/features/CognitiveCompare/onDemandCitations/payload.d.ts.map +1 -0
  249. package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts +3 -0
  250. package/dist/types/src/features/CognitiveCompare/onDemandCitations/response.d.ts.map +1 -0
  251. package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts +134 -0
  252. package/dist/types/src/features/CognitiveCompare/onDemandCitations/types.d.ts.map +1 -0
  253. package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts +6 -0
  254. package/dist/types/src/features/CognitiveCompare/utils/normalizeInlineMarkdown.d.ts.map +1 -0
  255. package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts +2 -0
  256. package/dist/types/src/features/CognitiveCompare/utils/onDemandCitations.d.ts.map +1 -0
  257. package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +1 -0
  258. package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts.map +1 -1
  259. package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -1
  260. package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +2 -1
  261. package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
  262. package/dist/types/src/features/GptWebCitation/types.d.ts +11 -0
  263. package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
  264. package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts +2 -0
  265. package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts.map +1 -1
  266. package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
  267. package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
  268. package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts +0 -1
  269. package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
  270. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +39 -29
  271. package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
  272. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts +2 -0
  273. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/constants/changeTags.d.ts.map +1 -0
  274. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts +2 -0
  275. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/utils/normalizeRedlineMarkdown.d.ts.map +1 -0
  276. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  277. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts +10 -0
  278. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/Avatar.d.ts.map +1 -0
  279. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts +17 -0
  280. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsGroup.d.ts.map +1 -0
  281. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts +23 -0
  282. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/CollaboratorsPopup.d.ts.map +1 -0
  283. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts +3 -0
  284. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Avatar/avatarUtils.d.ts.map +1 -0
  285. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationAnchor.d.ts.map +1 -1
  286. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +1 -1
  287. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  288. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts +84 -5439
  289. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/userstory.mock.data.d.ts.map +1 -1
  290. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +1 -1
  291. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  292. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts +1 -1
  293. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
  294. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +2 -2
  295. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  296. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +19 -2
  297. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  298. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +7 -2
  299. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +1 -1
  300. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +1 -1
  301. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +15 -1
  302. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +1 -1
  303. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +2 -1
  304. package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +1 -1
  305. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts +3 -2
  306. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
  307. package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
  308. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts +1 -0
  309. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationContent.d.ts.map +1 -1
  310. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts +1 -0
  311. package/dist/types/src/features/RequirementAI/components/citations/file-citation/FileCitationRender.d.ts.map +1 -1
  312. package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -1
  313. package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts +12 -0
  314. package/dist/types/src/features/RequirementAI/components/common/onDemandCitationButton.d.ts.map +1 -0
  315. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +3 -2
  316. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts.map +1 -1
  317. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts +1 -1
  318. package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map +1 -1
  319. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +3 -1
  320. package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
  321. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +2 -1
  322. package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
  323. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts +1 -0
  324. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts.map +1 -1
  325. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +2 -0
  326. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
  327. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +2 -1
  328. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  329. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +2 -1
  330. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  331. package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts +1 -1
  332. package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
  333. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +2 -0
  334. package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
  335. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +3 -0
  336. package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
  337. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +2 -1
  338. package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
  339. package/dist/types/src/features/RequirementAI/utils/helpers.d.ts +2 -0
  340. package/dist/types/src/features/RequirementAI/utils/helpers.d.ts.map +1 -1
  341. package/dist/types/src/features/RequirementAI/utils/proccess-stream.utils.d.ts.map +1 -1
  342. package/dist/types/src/features/SegmentReviewComponents/BoundaryCard.d.ts.map +1 -1
  343. package/dist/types/src/features/SegmentReviewComponents/CognitiveScoreBadge.d.ts.map +1 -1
  344. package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts +0 -6
  345. package/dist/types/src/features/SegmentReviewComponents/PageCheck.d.ts.map +1 -1
  346. package/dist/types/src/features/SegmentReviewComponents/RevertSuccessCard.d.ts.map +1 -1
  347. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
  348. package/dist/types/src/features/SegmentReviewComponents/SegmentReviewRedirectionTest.d.ts.map +1 -1
  349. package/dist/types/src/features/SegmentReviewComponents/helper.d.ts +4 -2
  350. package/dist/types/src/features/SegmentReviewComponents/helper.d.ts.map +1 -1
  351. package/dist/types/src/features/SegmentReviewComponents/index.d.ts +1 -3
  352. package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -1
  353. package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +1 -2
  354. package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -1
  355. package/dist/types/src/service/redlineService.d.ts.map +1 -1
  356. package/package.json +4 -4
  357. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
  358. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
  359. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
  360. package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
  361. package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
  362. package/dist/cjs/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
  363. package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
  364. package/dist/cjs/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
  365. package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
  366. package/dist/cjs/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
  367. package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
  368. package/dist/cjs/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
  369. package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
  370. package/dist/cjs/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
  371. package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js +0 -2
  372. package/dist/cjs/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
  373. package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
  374. package/dist/cjs/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
  375. package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
  376. package/dist/cjs/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
  377. package/dist/cjs/features/SegmentReviewComponents/reviewScore.js +0 -2
  378. package/dist/cjs/features/SegmentReviewComponents/reviewScore.js.map +0 -1
  379. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +0 -2
  380. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +0 -1
  381. package/dist/features/ParentCitationComponent/ParentCitationComponent.js +0 -2
  382. package/dist/features/ParentCitationComponent/ParentCitationComponent.js.map +0 -1
  383. package/dist/features/PdfViewer/nyc-components/BoundaryCard.js +0 -2
  384. package/dist/features/PdfViewer/nyc-components/BoundaryCard.js.map +0 -1
  385. package/dist/features/PdfViewer/nyc-components/CardWrapper.js +0 -2
  386. package/dist/features/PdfViewer/nyc-components/CardWrapper.js.map +0 -1
  387. package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js +0 -2
  388. package/dist/features/PdfViewer/nyc-components/CognitiveIcon.js.map +0 -1
  389. package/dist/features/PdfViewer/nyc-components/LabelCheck.js +0 -2
  390. package/dist/features/PdfViewer/nyc-components/LabelCheck.js.map +0 -1
  391. package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js +0 -2
  392. package/dist/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.js.map +0 -1
  393. package/dist/features/PdfViewer/nyc-components/infoAlert.js +0 -2
  394. package/dist/features/PdfViewer/nyc-components/infoAlert.js.map +0 -1
  395. package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js +0 -2
  396. package/dist/features/PdfViewer/nyc-components/reviewStepAdapters.js.map +0 -1
  397. package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js +0 -2
  398. package/dist/features/SegmentReviewComponents/PageTypeChoiceCheck.js.map +0 -1
  399. package/dist/features/SegmentReviewComponents/reviewScore.js +0 -2
  400. package/dist/features/SegmentReviewComponents/reviewScore.js.map +0 -1
  401. package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts +0 -23
  402. package/dist/types/node_modules/react-markdown/lib/complex-types.d.ts.map +0 -1
  403. package/dist/types/src/Background.d.ts +0 -7
  404. package/dist/types/src/Background.d.ts.map +0 -1
  405. package/dist/types/src/RedlineApprovalCardTest.d.ts +0 -1
  406. package/dist/types/src/RedlineApprovalCardTest.d.ts.map +0 -1
  407. package/dist/types/src/RedlineEditorTest2.d.ts +0 -3
  408. package/dist/types/src/RedlineEditorTest2.d.ts.map +0 -1
  409. package/dist/types/src/commonConstants.d.ts +0 -31103
  410. package/dist/types/src/commonConstants.d.ts.map +0 -1
  411. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts +0 -2
  412. package/dist/types/src/features/CognitiveCompare/utils/buildComparisonRows.test.d.ts.map +0 -1
  413. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +0 -128
  414. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +0 -1
  415. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +0 -13
  416. package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +0 -1
  417. package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts +0 -59
  418. package/dist/types/src/features/PdfViewer/nyc-components/BoundaryCard.d.ts.map +0 -1
  419. package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts +0 -19
  420. package/dist/types/src/features/PdfViewer/nyc-components/CardWrapper.d.ts.map +0 -1
  421. package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts +0 -3
  422. package/dist/types/src/features/PdfViewer/nyc-components/CognitiveIcon.d.ts.map +0 -1
  423. package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts +0 -77
  424. package/dist/types/src/features/PdfViewer/nyc-components/LabelCheck.d.ts.map +0 -1
  425. package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts +0 -47
  426. package/dist/types/src/features/PdfViewer/nyc-components/SegmentReviewPdfWrapper.d.ts.map +0 -1
  427. package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts +0 -15
  428. package/dist/types/src/features/PdfViewer/nyc-components/index.d.ts.map +0 -1
  429. package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts +0 -3
  430. package/dist/types/src/features/PdfViewer/nyc-components/infoAlert.d.ts.map +0 -1
  431. package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts +0 -36
  432. package/dist/types/src/features/PdfViewer/nyc-components/reviewStepAdapters.d.ts.map +0 -1
  433. package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts +0 -28
  434. package/dist/types/src/features/SegmentReviewComponents/PageTypeChoiceCheck.d.ts.map +0 -1
  435. package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts +0 -2
  436. package/dist/types/src/features/SegmentReviewComponents/helper.test.d.ts.map +0 -1
  437. package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts +0 -4
  438. package/dist/types/src/features/SegmentReviewComponents/reviewScore.d.ts.map +0 -1
  439. package/dist/types/src/features/SegmentReviewComponents/segmentReviewEdgeCases.test.d.ts +0 -2
  440. 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("react/jsx-runtime"),t=require("react"),r=require("lodash"),o=require("./GapFilterContentWrapper.js"),i=require("./GapFilterItem.js"),n=require("./CustomChatCrRedirection.js"),a=require("./gapFilterSvgs.js"),l=require("./GapFilterBlock.module.css.js");require("react-markdown"),require("rehype-raw"),require("../RequirementAIWrapper/RequirementAIWrapper.js");const d=["critical","recommendation","warning"];function c(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function s(e){return t.Children.toArray(e).filter(e=>t.isValidElement(e)).filter(e=>{var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(e=>{var t,r;const{children:o,...i}=e.props,n={};Object.keys(i).forEach(e=>{e.startsWith("data-")||(n[e]=i[e])});const a=function(e){const t={};return Object.keys(e).forEach(r=>{r.startsWith("data-")&&(t[r.replace(/^data-/,"")]=e[r])}),t}(i),l=i["decision-strength"],d=i["data-is-completed"];return{text:o,headerText:i.headertext,tags:i.tags,dataAttrs:a,decisionStrength:l,attrs:n,type:"gapfilteritem"===e.type?"gapfilteritem":"crredirection",score:i.score,isCompleted:d,pendingCount:i.pendingcount,question:i.question,components:i.components,showFix:null!==(t=i.showfix)&&void 0!==t&&t,showRedirect:null!==(r=i.showredirect)&&void 0!==r&&r}})}const u={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}};exports.GapFilterBlock=({isDefaultOpen:g,processItemId:p,mode:m,node:C,children:b,type:f,supportedmodes:y="","decision-strength":h="",pendingdata:x="",isGeneratingGap:v=!1,selectedGapItemId:S="",onItemSelect:I,onHandleSend:k,onModeAction:j,msg:R,panelRef:F,getAccordionState:A,setAccordionState:B,registerGapFilterBlockCount:G,getShowGapReviewButtonType:T,customStyles:q,customIcons:w,cognitiveDecisionHeaders:D,onRedirectClick:N})=>{const E=f,W=c(h),[O,$]=t.useState(()=>{var e;const t=null!==(e=null==A?void 0:A(E))&&void 0!==e?e:"";return"true"!==g||t?t:E}),H=e=>{$(e),null==B||B(E,e)},z=s(b),M=t.useMemo(()=>z.reduce((e,t)=>{var r,o,i;const n=null!==(r=t.tags)&&void 0!==r?r:"Uncategorized",a=null!==(i=null===(o=t.dataAttrs)||void 0===o?void 0:o.categoryid)&&void 0!==i?i:"1";let l=e.find(e=>e.categoryName===n);return l||(l={categoryName:n,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[]),[z]),U={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:e.jsx(a.SirenIcon,{}),label:"risk-gap"===m?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:e.jsx(a.WarningIcon,{}),label:"risk-gap"===m?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:e.jsx(a.SupportIcon,{}),label:"risk-gap"===m?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:e.jsx(a.SupportIcon,{}),label:"",decisionStrength:""}},_=t.useMemo(()=>{return e=E,d.includes(e)?{labelColor:U[E].labelColor,badgeBackgroundColor:U[E].badgeBackgroundColor,badgeTextColor:U[E].badgeTextColor,label:U[E].label,decisionStrength:W||U[E].decisionStrength}:{labelColor:U.default.labelColor,badgeBackgroundColor:U.default.badgeBackgroundColor,badgeTextColor:U.default.badgeTextColor,label:r.capitalize(E),decisionStrength:W||""};var e},[E,W]);t.useEffect(()=>{null==G||G(E,z.length)},[E,z.length,G]);const L=(e,t,r={})=>{if(v)return;const o=`${M[e].categoryId}-${t}`;null==I||I(o);const i={...M[e].items[t].dataAttrs,...r};null==j||j(y,i)};return T&&T(),e.jsx(o.GapFilterContentWrapper,{mode:m,type:E,config:_,count:z.length,handleReviewClick:()=>{z.length>0&&H(E)},openAccordion:O,onAccordionChange:e=>{H(O===e?"":e)},shouldShowReviewButton:!1,pendingData:x,customStyles:q,children:M.map((t,r)=>e.jsxs("div",{className:l.default.categoryGroup,style:null==q?void 0:q.categoryGroup,children:["gapfilteritem"===t.type&&"Uncategorized"!==t.categoryName&&e.jsx("p",{className:l.default.categoryLabel,style:null==q?void 0:q.categoryLabel,children:t.categoryName}),t.items.map((o,a)=>{var d,c,s,g;const C=o.attrs||{},b=null===(d=o.dataAttrs)||void 0===d?void 0:d["cognitive-reasoning"],f=C.id||(null===(c=o.dataAttrs)||void 0===c?void 0:c.id)||"",y="I"===f[0]?"UI_REF":"CHAT_REF",h=null===(s=null==R?void 0:R.contextAwareAgentReasoning)||void 0===s?void 0:s[b],x=o.isCompleted,I="true"===C.isDefaultOpen||"true"===C.isdefaultopen;return"gapfilteritem"===o.type?e.jsx("div",{className:[l.default.gapFilterItemWrapper,"Uncategorized"!==t.categoryName?l.default.gapFilterItemWrapperIndented:""].join(" "),style:null==q?void 0:q.blockContainer,children:e.jsx(i.GapFilterItem,{isDefaultOpen:I,isCompleted:x,mode:m,index:a,isSelected:S===`${t.categoryId}-${a}`,onClick:()=>L(r,a),onFixClick:()=>L(r,a,{triggerFrom:"fix"}),onRedirect:()=>L(r,a,{triggerFrom:"redirect"}),item:o,isGenerating:v,aiReason:h,panelRef:null!=F?F:{current:null},id:b,customStyles:q,customIcons:w,cognitiveDecisionHeaders:D})},a):e.jsx("div",{className:l.default.crRedirectionGroup,style:null==q?void 0:q.crRedirectionGroup,children:e.jsx("div",{className:l.default.crRedirectionInner,style:null==q?void 0:q.crRedirectionInner,children:e.jsx(n.CustomChatCrRedirection,{isDefaultOpen:I,processItemId:p,isCompleted:x,mode:m,msg:R,type:y,text:o.text,headerText:o.headerText,decisionStrength:o.decisionStrength,id:f,gapType:E,onHandleSend:k,isGenerating:v,aiReason:h,onRedirectClick:N,statusUi:null!==(g=u[E])&&void 0!==g?g:u.recommendation,panelRef:null!=F?F:{current:null},customStyles:q,customIcons:w,cognitiveDecisionHeaders:D})})},a)})]},`${t.categoryName}-${r}`))})},exports.normalizeDecisionStrength=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("lodash"),o=require("./GapFilterContentWrapper.js"),i=require("./GapFilterItem.js"),n=require("./CustomChatCrRedirection.js"),a=require("./gapFilterSvgs.js"),l=require("./GapFilterBlock.module.css.js");require("react-markdown"),require("rehype-raw"),require("../RequirementAIWrapper/RequirementAIWrapper.js");const c=["critical","recommendation","warning"];function d(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function s(e){return t.Children.toArray(e).filter(e=>t.isValidElement(e)).filter(e=>{var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(e=>{var t,r;const{children:o,...i}=e.props,n={};Object.keys(i).forEach(e=>{e.startsWith("data-")||(n[e]=i[e])});const a=function(e){const t={};return Object.keys(e).forEach(r=>{r.startsWith("data-")&&(t[r.replace(/^data-/,"")]=e[r])}),t}(i),l=function(e){const t={};return Object.keys(e).forEach(r=>{r.startsWith("meta-")&&(t[r.replace(/^meta-/,"")]=e[r])}),t}(i),c=i["decision-strength"],d=i["data-is-completed"];return{text:o,headerText:i.headertext,tags:i.tags,dataAttrs:a,decisionStrength:c,attrs:n,type:"gapfilteritem"===e.type?"gapfilteritem":"crredirection",score:i.score,isCompleted:d,pendingCount:i.pendingcount,question:i.question,components:i.components,showFix:null!==(t=i.showfix)&&void 0!==t&&t,showRedirect:null!==(r=i.showredirect)&&void 0!==r&&r,metaDataAttrs:l}})}const u={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}};exports.GapFilterBlock=({isDefaultOpen:g,processItemId:p,mode:m,node:C,children:b,type:f,supportedmodes:h="","decision-strength":y="",pendingdata:x="",isGeneratingGap:v=!1,selectedGapItemId:S="",onItemSelect:I,onHandleSend:k,onModeAction:j,msg:R,panelRef:F,getAccordionState:A,setAccordionState:B,registerGapFilterBlockCount:D,getShowGapReviewButtonType:G,customStyles:T,customIcons:q,cognitiveDecisionHeaders:w,onRedirectClick:N})=>{const E=f,W=d(y),[O,$]=t.useState(()=>{var e;const t=null!==(e=null==A?void 0:A(E))&&void 0!==e?e:"";return"true"!==g||t?t:E}),H=e=>{$(e),null==B||B(E,e)},z=s(b),M=t.useMemo(()=>z.reduce((e,t)=>{var r,o,i;const n=null!==(r=t.tags)&&void 0!==r?r:"Uncategorized",a=null!==(i=null===(o=t.dataAttrs)||void 0===o?void 0:o.categoryid)&&void 0!==i?i:"1";let l=e.find(e=>e.categoryName===n);return l||(l={categoryName:n,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[]),[z]),U={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:e.jsx(a.SirenIcon,{}),label:"risk-gap"===m?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:e.jsx(a.WarningIcon,{}),label:"risk-gap"===m?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:e.jsx(a.SupportIcon,{}),label:"risk-gap"===m?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:e.jsx(a.SupportIcon,{}),label:"",decisionStrength:""}},_=t.useMemo(()=>{return e=E,c.includes(e)?{labelColor:U[E].labelColor,badgeBackgroundColor:U[E].badgeBackgroundColor,badgeTextColor:U[E].badgeTextColor,label:U[E].label,decisionStrength:W||U[E].decisionStrength}:{labelColor:U.default.labelColor,badgeBackgroundColor:U.default.badgeBackgroundColor,badgeTextColor:U.default.badgeTextColor,label:r.capitalize(E),decisionStrength:W||""};var e},[E,W]);t.useEffect(()=>{null==D||D(E,z.length)},[E,z.length,D]);const L=(e,t,r={})=>{if(v)return;const o=`${M[e].categoryId}-${t}`;null==I||I(o);const i={...M[e].items[t].dataAttrs,...r};null==j||j(h,i)};return G&&G(),e.jsx(o.GapFilterContentWrapper,{mode:m,type:E,config:_,count:z.length,handleReviewClick:()=>{z.length>0&&H(E)},openAccordion:O,onAccordionChange:e=>{H(O===e?"":e)},shouldShowReviewButton:!1,pendingData:x,customStyles:T,children:M.map((t,r)=>e.jsxs("div",{className:l.default.categoryGroup,style:null==T?void 0:T.categoryGroup,children:["gapfilteritem"===t.type&&"Uncategorized"!==t.categoryName&&e.jsx("p",{className:l.default.categoryLabel,style:null==T?void 0:T.categoryLabel,children:t.categoryName}),t.items.map((o,a)=>{var c,d,s,g;const C=o.attrs||{},b=null===(c=o.dataAttrs)||void 0===c?void 0:c["cognitive-reasoning"],f=C.id||(null===(d=o.dataAttrs)||void 0===d?void 0:d.id)||"",h="I"===f[0]?"UI_REF":"CHAT_REF",y=null===(s=null==R?void 0:R.contextAwareAgentReasoning)||void 0===s?void 0:s[b],x=o.isCompleted,I="true"===C.isDefaultOpen||"true"===C.isdefaultopen;return"gapfilteritem"===o.type?e.jsx("div",{className:[l.default.gapFilterItemWrapper,"Uncategorized"!==t.categoryName?l.default.gapFilterItemWrapperIndented:""].join(" "),style:null==T?void 0:T.blockContainer,children:e.jsx(i.GapFilterItem,{isDefaultOpen:I,isCompleted:x,mode:m,index:a,isSelected:S===`${t.categoryId}-${a}`,onClick:()=>L(r,a),onFixClick:()=>L(r,a,{triggerFrom:"fix"}),onRedirect:()=>L(r,a,{triggerFrom:"redirect"}),item:o,isGenerating:v,aiReason:y,panelRef:null!=F?F:{current:null},id:b,customStyles:T,customIcons:q,cognitiveDecisionHeaders:w})},a):e.jsx("div",{className:l.default.crRedirectionGroup,style:null==T?void 0:T.crRedirectionGroup,children:e.jsx("div",{className:l.default.crRedirectionInner,style:null==T?void 0:T.crRedirectionInner,children:e.jsx(n.CustomChatCrRedirection,{isDefaultOpen:I,processItemId:p,isCompleted:x,mode:m,msg:R,type:h,text:o.text,headerText:o.headerText,decisionStrength:o.decisionStrength,id:f,gapType:E,onHandleSend:k,isGenerating:v,aiReason:y,onRedirectClick:N,statusUi:null!==(g=u[E])&&void 0!==g?g:u.recommendation,panelRef:null!=F?F:{current:null},customStyles:T,customIcons:q,cognitiveDecisionHeaders:w,metaData:o.metaDataAttrs})})},a)})]},`${t.categoryName}-${r}`))})},exports.normalizeDecisionStrength=d;
2
2
  //# sourceMappingURL=GapFilterBlock.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),l=require("../../../UserStoryImport/lib/cn.js"),a=require("./segment.module.css.js"),i=require("./deleteSegmentDialog.module.css.js"),s=require("./ExampleComponentWrapper.js"),o=require("../ai-reasoning/AiReasoningCitationContent.js"),d=require("./SegmentLoader.js");require("./segment-common.css.js");var r=require("../../store/markdown-context.js"),u=require("@mui/material/Dialog"),c=require("@mui/material/IconButton"),m=require("./DeleteSegmentsDialog.js"),p=require("@mui/material/Tooltip"),g=require("./EditSegmentDialog.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=x(t),f=x(u),y=x(c),h=x(p);exports.default=({id:u="Segment",label:c,children:p,segmentUUID:x,decisionStrength:j=80,aiReason:C,customStyles:S,customIcons:b,aiReasoningCitationCustomStyles:I,segmentExampleComponent:E,handleViewGlossary:w,isUpdatedSegment:D,onOpen:k,onDelete:q,onEdit:N,customDeleteStyles:B,customDeleteIcons:M,enabledSegmentActions:$})=>{var z,A;const{citationsMetadata:L,updateCitationsMetadata:R}=t.useContext(r.MarkdownStateContext),[W,U]=v.default.useState(!1),[T,F]=v.default.useState(!1),[G,V]=v.default.useState(!1),[H,O]=v.default.useState(""),[P,X]=v.default.useState(!1),{prefix:_,inner:K}=t.useMemo(()=>(e=>{const t=e.match(/^(.*?)\s*\{([^}]+)\}\s*$/);return!t||t.length<3?{prefix:"",inner:e}:{prefix:t[1].trim(),inner:t[2].trim()}})(null!=c?c:""),[c]);v.default.useEffect(()=>{G||O(K)},[G,K]);const J=async()=>{if(N){const e=H.toLowerCase();await N(e)}V(!1),X(!1)},Q=()=>V(!1),Y=(null==M?void 0:M.editIcon)||e.jsx(n.Pencil,{size:14}),Z=(null==M?void 0:M.checkIcon)||e.jsx(n.Check,{size:16,color:"#16A34A"}),ee=(null==M?void 0:M.crossIcon)||e.jsx(n.X,{size:16,color:"#DC2626"}),te=t.useMemo(()=>L.get(x),[L,x]),ne=t.useMemo(()=>(null==te?void 0:te.open)||!1,[te]),le=t.useMemo(()=>te&&"loading"===te.state,[te]),ae=async()=>{const e=!ne;if(U(!1),console.log("citation metadata::",e,C),e&&!(null==C?void 0:C.reason)){R(x,t=>{if(t){const e={...t};return e.state="loading",e}return{open:e,state:"loading"}});try{console.log("citation metadata:: onopen"),await(null==k?void 0:k())}finally{R(x,t=>{if(t){const n={...t};return n.state="ready",n.open=e,n}return{open:e,state:"ready"}})}}else console.log("citation metadata:: else block"),R(x,t=>{if(t){const n={...t};return n.open=e,n}return{open:e,state:le?"loading":"ready"}})};return e.jsxs("div",{className:`segment-wrapper-${u} ${a.default.segmentWrapper}`,style:{...null==S?void 0:S.segmentWrapper,display:"inline-flex",verticalAlign:"middle"},children:[e.jsxs("div",{className:`segment-${u}-container segmentContainer ${D?"updatedSegmentContainer":""}`,style:{...null==S?void 0:S.container},children:[e.jsx("span",{className:`segment-${u} segmentLabel ${D?"updatedSegmentLabel":""}`,style:{...null==S?void 0:S.label},children:D?p:c}),e.jsx("button",{className:`${a.default.segmentExplanationButtonContainer}`,style:{...null==S?void 0:S.buttonContainer},onClick:ae,children:e.jsx(n.ArrowUpRight,{className:l.cn(D&&a.default.updatedChevronIcon,a.default.cheveronIcon),style:{...null==S?void 0:S.cheveronIcon}})})]}),ne&&e.jsx(f.default,{open:!0,onClose:ae,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",maxWidth:"xl",container:document.getElementById("#root"),children:e.jsxs("div",{style:{minWidth:"50vw",paddingLeft:16,paddingRight:16,paddingTop:24,paddingBottom:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[G?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[_&&e.jsx("span",{className:"segmentLabel",style:{fontSize:18,fontWeight:600,...null==S?void 0:S.label},children:_}),e.jsxs("div",{className:a.default.editInputWrapper,style:null==S?void 0:S.editInputWrapper,children:[e.jsx("input",{value:H,onChange:e=>O(e.target.value),className:a.default.editInput,style:{...null==S?void 0:S.editInput,color:(null===(z=null==S?void 0:S.label)||void 0===z?void 0:z.color)?String(S.label.color):"#3B82F6",textTransform:"uppercase"},autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&J(),"Escape"===e.key&&Q()}}),e.jsx(y.default,{onClick:()=>{H!==K?(R(x,e=>e?{...e,open:!1}:{open:!1,state:le?"loading":"ready"}),X(!0)):V(!1)},size:"small",style:null==S?void 0:S.editCheckIcon,children:Z}),e.jsx(y.default,{onClick:Q,size:"small",style:null==S?void 0:S.editCrossIcon,children:ee})]})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx("span",{className:"segmentLabel",style:{fontSize:18,fontWeight:600,...null==S?void 0:S.label},children:null!=c?c:"SEGMENT NAME"}),(null==$?void 0:$.includes("edit"))&&e.jsx(h.default,{title:"Edit segment",placement:"top",arrow:!0,children:e.jsx("button",{onClick:()=>V(!0),className:a.default.headerEditButton,style:null==S?void 0:S.editIconButton,children:Y})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0,...null==S?void 0:S.headerActionsContainer},children:[(null==$?void 0:$.includes("delete"))&&e.jsx(h.default,{title:"Delete segment",placement:"top",arrow:!0,children:e.jsxs("button",{onClick:()=>{U(!1),F(!0),R(x,e=>{if(e){const t={...e};return t.open=!1,t}return{open:!1,state:le?"loading":"ready"}})},className:i.default.headerDeleteButton,children:[e.jsx(n.Trash2,{size:14}),"Delete"]})}),e.jsx(y.default,{"aria-label":"close",onClick:ae,sx:e=>({padding:"4px",color:e.palette.grey[500]}),children:e.jsx(n.X,{size:20})})]})]}),le?e.jsx(d.default,{customStyles:null==S?void 0:S.loadingSkeleton}):e.jsxs(e.Fragment,{children:[W&&!D&&e.jsx("div",{style:{marginBottom:16},children:e.jsx(s.default,{label:null!=c?c:"",segmentExampleComponent:E,customStyles:{...null==S?void 0:S.segmentExample,exampleContainer:{...null===(A=null==S?void 0:S.segmentExample)||void 0===A?void 0:A.exampleContainer,width:"100%"}},handleCancelExample:()=>{U(!1)}})}),D&&e.jsx("div",{style:{marginBottom:16},children:e.jsx("div",{className:`segment-${u}-container segmentContainer updatedSegmentContainer`,style:{...null==S?void 0:S.container},children:e.jsx("span",{className:`segment-${u} segmentLabel updatedSegmentLabel`,style:{...null==S?void 0:S.label},children:p})})}),e.jsx("div",{children:e.jsx(o.default,{aiReason:C,customStyles:{...I,aiReasoningContent:{...null==I?void 0:I.aiReasoningContent,headerBar:{width:"auto"}},aiReasoningAccordion:{header:{width:"auto"}}},customIcons:b,isSegmentExplanation:!0,handleViewGlossary:w?()=>{R(x,e=>{if(e){const t={...e};return t.open=!1,t}return{open:!1,state:le?"loading":"ready"}}),null==w||w(u)}:void 0,handleViewExample:E?()=>{U(!0)}:void 0,isUpdatedSegment:D})})]})]})}),e.jsx(m.default,{open:T,onHide:()=>{F(!1)},customDeleteStyles:B,customDeleteIcons:M,onDelete:async e=>{await(null==q?void 0:q(e))}}),e.jsx(g.default,{open:P,onHide:()=>{X(!1),V(!1)},customStyles:B,customIcons:M,onConfirm:J})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),l=require("../../../UserStoryImport/lib/cn.js"),a=require("./segment.module.css.js"),i=require("./deleteSegmentDialog.module.css.js"),o=require("./ExampleComponentWrapper.js"),s=require("../ai-reasoning/AiReasoningCitationContent.js"),r=require("./SegmentLoader.js");require("./segment-common.css.js");var d=require("../../store/markdown-context.js"),u=require("@mui/material/Dialog"),c=require("@mui/material/IconButton"),m=require("./DeleteSegmentsDialog.js"),p=require("@mui/material/Tooltip"),g=require("./EditSegmentDialog.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=x(t),f=x(u),y=x(c),h=x(p);exports.default=({id:u="Segment",label:c,children:p,segmentUUID:x,decisionStrength:j=80,aiReason:C,customStyles:S,customIcons:b,aiReasoningCitationCustomStyles:I,segmentExampleComponent:w,handleViewGlossary:E,isUpdatedSegment:D,onOpen:k,onDelete:q,onEdit:N,customDeleteStyles:B,customDeleteIcons:L,enabledSegmentActions:M,segmentDataList:$,onShowNotification:z})=>{var A,R;const{citationsMetadata:W,updateCitationsMetadata:U}=t.useContext(d.MarkdownStateContext),[T,F]=v.default.useState(!1),[G,V]=v.default.useState(!1),[_,H]=v.default.useState(!1),[O,P]=v.default.useState(""),[X,K]=v.default.useState(!1),{prefix:J,inner:Q}=t.useMemo(()=>(e=>{const t=e.match(/^(.*?)\s*\{([^}]+)\}\s*$/);return!t||t.length<3?{prefix:"",inner:e}:{prefix:t[1].trim(),inner:t[2].trim()}})(null!=c?c:""),[c]);v.default.useEffect(()=>{_||P(Q)},[_,Q]);const Y=async()=>{if(N){const e=O.toLowerCase();U(x,e=>e?{...e,open:!1}:{open:!1,state:ie?"loading":"ready"}),await N(e)}H(!1),K(!1)},Z=()=>H(!1),ee=(null==L?void 0:L.editIcon)||e.jsx(n.Pencil,{size:14}),te=(null==L?void 0:L.checkIcon)||e.jsx(n.Check,{size:16,color:"#16A34A"}),ne=(null==L?void 0:L.crossIcon)||e.jsx(n.X,{size:16,color:"#DC2626"}),le=t.useMemo(()=>W.get(x),[W,x]),ae=t.useMemo(()=>(null==le?void 0:le.open)||!1,[le]),ie=t.useMemo(()=>le&&"loading"===le.state,[le]),oe=async()=>{const e=!ae;if(F(!1),console.log("citation metadata::",e,C),e&&!(null==C?void 0:C.reason)){U(x,t=>{if(t){const e={...t};return e.state="loading",e}return{open:e,state:"loading"}});try{console.log("citation metadata:: onopen"),await(null==k?void 0:k())}finally{U(x,t=>{if(t){const n={...t};return n.state="ready",n.open=e,n}return{open:e,state:"ready"}})}}else console.log("citation metadata:: else block"),U(x,t=>{if(t){const n={...t};return n.open=e,n}return{open:e,state:ie?"loading":"ready"}})};return e.jsxs("div",{className:`segment-wrapper-${u} ${a.default.segmentWrapper}`,style:{...null==S?void 0:S.segmentWrapper,display:"inline-flex",verticalAlign:"middle"},children:[e.jsxs("div",{className:`segment-${u}-container segmentContainer ${D?"updatedSegmentContainer":""}`,style:{...null==S?void 0:S.container},children:[e.jsx("span",{className:`segment-${u} segmentLabel ${D?"updatedSegmentLabel":""}`,style:{...null==S?void 0:S.label},children:D?p:c}),e.jsx("button",{className:`${a.default.segmentExplanationButtonContainer}`,style:{...null==S?void 0:S.buttonContainer},onClick:oe,children:e.jsx(n.ArrowUpRight,{className:l.cn(D&&a.default.updatedChevronIcon,a.default.cheveronIcon),style:{...null==S?void 0:S.cheveronIcon}})})]}),ae&&e.jsx(f.default,{open:!0,onClose:oe,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",maxWidth:"xl",container:document.getElementById("#root"),children:e.jsxs("div",{style:{minWidth:"50vw",paddingLeft:16,paddingRight:16,paddingTop:24,paddingBottom:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[_?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[J&&e.jsx("span",{className:"segmentLabel",style:{fontSize:18,fontWeight:600,...null==S?void 0:S.label},children:J}),e.jsxs("div",{className:a.default.editInputWrapper,style:null==S?void 0:S.editInputWrapper,children:[e.jsx("input",{value:O,onChange:e=>P(e.target.value),className:a.default.editInput,style:{...null==S?void 0:S.editInput,color:(null===(A=null==S?void 0:S.label)||void 0===A?void 0:A.color)?String(S.label.color):"#3B82F6",textTransform:"uppercase"},autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&Y(),"Escape"===e.key&&Z()}}),e.jsx(y.default,{onClick:()=>{if(O===Q||""===O.trim())return void H(!1);const e=O.toLowerCase().trim();if(null==$?void 0:$.some(t=>t.segment_name.toLowerCase().trim()===e))return null==z||z("error","Error","Segment name already exists!"),U(x,e=>e?{...e,open:!1}:{open:!1,state:ie?"loading":"ready"}),void H(!1);K(!0)},size:"small",style:null==S?void 0:S.editCheckIcon,children:te}),e.jsx(y.default,{onClick:Z,size:"small",style:null==S?void 0:S.editCrossIcon,children:ne})]})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx("span",{className:"segmentLabel",style:{fontSize:18,fontWeight:600,...null==S?void 0:S.label},children:null!=c?c:"SEGMENT NAME"}),(null==M?void 0:M.includes("edit"))&&e.jsx(h.default,{title:"Edit segment",placement:"top",arrow:!0,children:e.jsx("button",{onClick:()=>H(!0),className:a.default.headerEditButton,style:null==S?void 0:S.editIconButton,children:ee})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0,...null==S?void 0:S.headerActionsContainer},children:[(null==M?void 0:M.includes("delete"))&&e.jsx(h.default,{title:"Delete segment",placement:"top",arrow:!0,children:e.jsxs("button",{onClick:()=>{F(!1),V(!0),U(x,e=>{if(e){const t={...e};return t.open=!1,t}return{open:!1,state:ie?"loading":"ready"}})},className:i.default.headerDeleteButton,children:[e.jsx(n.Trash2,{size:14}),"Delete"]})}),e.jsx(y.default,{"aria-label":"close",onClick:oe,sx:e=>({padding:"4px",color:e.palette.grey[500]}),children:e.jsx(n.X,{size:20})})]})]}),ie?e.jsx(r.default,{customStyles:null==S?void 0:S.loadingSkeleton}):e.jsxs(e.Fragment,{children:[T&&!D&&e.jsx("div",{style:{marginBottom:16},children:e.jsx(o.default,{label:null!=c?c:"",segmentExampleComponent:w,customStyles:{...null==S?void 0:S.segmentExample,exampleContainer:{...null===(R=null==S?void 0:S.segmentExample)||void 0===R?void 0:R.exampleContainer,width:"100%"}},handleCancelExample:()=>{F(!1)}})}),D&&e.jsx("div",{style:{marginBottom:16},children:e.jsx("div",{className:`segment-${u}-container segmentContainer updatedSegmentContainer`,style:{...null==S?void 0:S.container},children:e.jsx("span",{className:`segment-${u} segmentLabel updatedSegmentLabel`,style:{...null==S?void 0:S.label},children:p})})}),e.jsx("div",{children:e.jsx(s.default,{aiReason:C,customStyles:{...I,aiReasoningContent:{...null==I?void 0:I.aiReasoningContent,headerBar:{width:"auto"}},aiReasoningAccordion:{header:{width:"auto"}}},customIcons:b,isSegmentExplanation:!0,handleViewGlossary:E?()=>{U(x,e=>{if(e){const t={...e};return t.open=!1,t}return{open:!1,state:ie?"loading":"ready"}}),null==E||E(u)}:void 0,handleViewExample:w?()=>{F(!0)}:void 0,isUpdatedSegment:D})})]})]})}),e.jsx(m.default,{open:G,onHide:()=>{V(!1)},customDeleteStyles:B,customDeleteIcons:L,onDelete:async e=>{await(null==q?void 0:q(e))}}),e.jsx(g.default,{open:X,onHide:()=>{K(!1),H(!1)},customStyles:B,customIcons:L,onConfirm:Y})]})};
2
2
  //# sourceMappingURL=Segment.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("./Segment.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=t(require("dompurify"));exports.default=({id:t,children:o,props:i,segmentComponentConfig:d,customStyles:s,customIcons:a,extractText:u,isUpdatedSegment:r=!1,blockId:v,customDeleteStyles:m,customDeleteIcons:g})=>{var c,p,S,h,I,f,y,C,b,x,D,_,j,E,U,W,k,A,F;const L=(null==i?void 0:i.id)||"Segment",q=(null==i?void 0:i.decisionstrength)||"80",{segmentDataList:w,getSegmentExampleComponent:O,handleViewGlossary:R,upadatedSegmentDataList:B,handleFetchUpdatedSegmentDetails:G,handleFetchSegmentDetails:M,handleDeleteSegment:T,handleEditSegment:V,enabledSegmentActions:z}=d||{},H=r?null==B?void 0:B.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==L?void 0:L.split("-"))||void 0===n?void 0:n[0])}):null==w?void 0:w.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==L?void 0:L.split("-"))||void 0===n?void 0:n[0])}),P={id:L,reason:null!==(c=null==H?void 0:H.reason)&&void 0!==c?c:"",gap:null!==(p=null==H?void 0:H.gap)&&void 0!==p?p:"",explanation:null!==(S=null==H?void 0:H.explanation)&&void 0!==S?S:"",relevance_score:null!==(h=null==H?void 0:H.relevance_score)&&void 0!==h?h:0,isOpen:!1};let J;const K=u(o),N=i["data-table"];let Q="";if(N&&!r)try{Q=decodeURIComponent(atob(N))}catch(e){console.error("Failed to decode data-table for segment",L,e)}const X=l.default.sanitize(Q),Y=()=>e.jsx("div",{dangerouslySetInnerHTML:{__html:X}});return H||!M||r||null==M||M(L),L&&H&&O&&!r&&(J=N?e.jsx(Y,{}):O(L,K,H.segment_type)),e.jsx(n.default,{id:L,segmentUUID:t,label:null!==(I=null==H?void 0:H.label)&&void 0!==I?I:null==H?void 0:H.segment_name,decisionStrength:q,aiReason:P,customIcons:a,aiReasoningCitationCustomStyles:s,segmentExampleComponent:J,handleViewGlossary:R,customStyles:{segmentWrapper:null===(f=null==s?void 0:s.segment)||void 0===f?void 0:f.segmentWrapper,container:null===(y=null==s?void 0:s.segment)||void 0===y?void 0:y.container,label:null===(C=null==s?void 0:s.segment)||void 0===C?void 0:C.label,decisionStrength:null===(b=null==s?void 0:s.segment)||void 0===b?void 0:b.decisionStrength,buttonContainer:null===(x=null==s?void 0:s.segment)||void 0===x?void 0:x.buttonContainer,cheveronIcon:null===(D=null==s?void 0:s.segment)||void 0===D?void 0:D.cheveronIcon,segmentExample:null===(_=null==s?void 0:s.segment)||void 0===_?void 0:_.segmentExample,loadingSkeleton:null===(j=null==s?void 0:s.segment)||void 0===j?void 0:j.SegmentLoadingSkeletonStyles,editInputWrapper:null===(E=null==s?void 0:s.segment)||void 0===E?void 0:E.editInputWrapper,editInput:null===(U=null==s?void 0:s.segment)||void 0===U?void 0:U.editInput,editCheckIcon:null===(W=null==s?void 0:s.segment)||void 0===W?void 0:W.editCheckIcon,editCrossIcon:null===(k=null==s?void 0:s.segment)||void 0===k?void 0:k.editCrossIcon,headerActionsContainer:null===(A=null==s?void 0:s.segment)||void 0===A?void 0:A.headerActionsContainer,editIconButton:null===(F=null==s?void 0:s.segment)||void 0===F?void 0:F.editIconButton},isUpdatedSegment:r,onOpen:async()=>{!H&&r&&(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),await(null==G?void 0:G(L)))},onDelete:e=>{if(console.log("SegmentWrapper: onDelete",e,{...H,segment_uuid:L},v),H)return null==T?void 0:T(e,{...H,segment_uuid:L},v)},onEdit:e=>{if(console.log("SegmentWrapper: onEdit",H,e),H&&V)return null==V?void 0:V(H,e)},customDeleteStyles:m,customDeleteIcons:g,enabledSegmentActions:z,children:o},L)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("./Segment.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(require("dompurify"));exports.default=({id:t,children:l,props:i,segmentComponentConfig:d,customStyles:s,customIcons:a,extractText:u,isUpdatedSegment:r=!1,blockId:v,storyId:m,customDeleteStyles:c,customDeleteIcons:g})=>{var p,S,h,I,f,y,C,b,x,D,_,j,E,U,W,k,w,L,A;const F=(null==i?void 0:i.id)||"Segment",q=(null==i?void 0:i.decisionstrength)||"80",{segmentDataList:O,getSegmentExampleComponent:R,handleViewGlossary:B,upadatedSegmentDataList:G,handleFetchUpdatedSegmentDetails:M,handleFetchSegmentDetails:N,handleDeleteSegment:T,handleEditSegment:V,enabledSegmentActions:z,onShowNotification:H}=d||{},P=r?null==G?void 0:G.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==F?void 0:F.split("-"))||void 0===n?void 0:n[0])}):null==O?void 0:O.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==F?void 0:F.split("-"))||void 0===n?void 0:n[0])}),J={id:F,reason:null!==(p=null==P?void 0:P.reason)&&void 0!==p?p:"",gap:null!==(S=null==P?void 0:P.gap)&&void 0!==S?S:"",explanation:null!==(h=null==P?void 0:P.explanation)&&void 0!==h?h:"",relevance_score:null!==(I=null==P?void 0:P.relevance_score)&&void 0!==I?I:0,isOpen:!1};let K;const Q=u(l),X=i["data-table"];let Y="";if(X&&!r)try{Y=decodeURIComponent(atob(X))}catch(e){console.error("Failed to decode data-table for segment",F,e)}const Z=o.default.sanitize(Y),$=()=>e.jsx("div",{dangerouslySetInnerHTML:{__html:Z}});return P||!N||r||null==N||N(F),F&&P&&R&&!r&&(K=X?e.jsx($,{}):R(F,Q,P.segment_type)),e.jsx(n.default,{id:F,segmentUUID:t,label:null!==(f=null==P?void 0:P.label)&&void 0!==f?f:null==P?void 0:P.segment_name,decisionStrength:q,aiReason:J,customIcons:a,aiReasoningCitationCustomStyles:s,segmentExampleComponent:K,handleViewGlossary:B,customStyles:{segmentWrapper:null===(y=null==s?void 0:s.segment)||void 0===y?void 0:y.segmentWrapper,container:null===(C=null==s?void 0:s.segment)||void 0===C?void 0:C.container,label:null===(b=null==s?void 0:s.segment)||void 0===b?void 0:b.label,decisionStrength:null===(x=null==s?void 0:s.segment)||void 0===x?void 0:x.decisionStrength,buttonContainer:null===(D=null==s?void 0:s.segment)||void 0===D?void 0:D.buttonContainer,cheveronIcon:null===(_=null==s?void 0:s.segment)||void 0===_?void 0:_.cheveronIcon,segmentExample:null===(j=null==s?void 0:s.segment)||void 0===j?void 0:j.segmentExample,loadingSkeleton:null===(E=null==s?void 0:s.segment)||void 0===E?void 0:E.SegmentLoadingSkeletonStyles,editInputWrapper:null===(U=null==s?void 0:s.segment)||void 0===U?void 0:U.editInputWrapper,editInput:null===(W=null==s?void 0:s.segment)||void 0===W?void 0:W.editInput,editCheckIcon:null===(k=null==s?void 0:s.segment)||void 0===k?void 0:k.editCheckIcon,editCrossIcon:null===(w=null==s?void 0:s.segment)||void 0===w?void 0:w.editCrossIcon,headerActionsContainer:null===(L=null==s?void 0:s.segment)||void 0===L?void 0:L.headerActionsContainer,editIconButton:null===(A=null==s?void 0:s.segment)||void 0===A?void 0:A.editIconButton},isUpdatedSegment:r,onOpen:async()=>{!P&&r&&(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),await(null==M?void 0:M(F)))},onDelete:e=>{if(console.log("SegmentWrapper: onDelete",e,{...P,segment_uuid:F},m,v),P)return null==T?void 0:T(e,{...P,segment_uuid:F},m,v)},onEdit:e=>{if(console.log("SegmentWrapper: onEdit",P,e),P&&V)return null==V?void 0:V(P,e)},customDeleteStyles:c,customDeleteIcons:g,enabledSegmentActions:z,segmentDataList:O,onShowNotification:(e,n,t)=>{H&&H(e,n,t)},children:l},F)};
2
2
  //# sourceMappingURL=SegmentWrapper.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("showdown"),o=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),r=require("../../utils/userstory-approval.utils.js"),a=require("../../hooks/useApprovalStatus.js"),i=require("./components/ContentSegment/ContentSegment.js"),s=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),u=require("../../icons/CheckIcon.js"),c=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),h=require("../story-screen/BigEnoughPanel.js"),m=require("../../icons/BigEnoughIcon.js"),y=require("@mui/material"),f=require("../../utils/helpers.js"),g=require("../../utils/user-story.utils.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=b(l);const A={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},C={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},x=Object.assign(({artifactTitleIds:l,config:i={},callbacks:s={},labels:u={},isDisabled:c=!1,children:v,classNames:p,selectedArtifactId:h})=>{var m;const{userStory:y,customStyles:f}=o.useRequirementAI(),g={...A,...i},b={...C,...u},[I,x]=t.useState([]),[j,w]=t.useState(""),[E,k]=t.useState(""),[U,N]=t.useState(!1),[q,T]=t.useState(!0),B=t.useRef(void 0),F=t.useCallback((e,t,l,o)=>{s.onShowNotification?s.onShowNotification(e,t,l,o):console.log(`[${e.toUpperCase()}] ${t}: ${l}`)},[s]),D=t.useCallback(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),M=t.useMemo(()=>{const e=I.findIndex(e=>e.artifactId===j);return e>=0?e:0},[I,j]),R=I[M];t.useEffect(()=>{B.current=R},[R]),t.useEffect(()=>{var e;if(!(null==y?void 0:y.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===y.length&&T(!1),y.length>0&&!j&&w(h||y[0].artifactId);const t=n.createUserStoriesForApproval(n.cloneUserStories(y));x(t)},[y,h]),t.useEffect(()=>{h&&h!==j&&w(h)},[h,j]),t.useEffect(()=>{if(!R)return;const e=r.getFirstNonApprovedSegmentId(R,"");k(e)},[null==R?void 0:R.artifactId]);const P=t.useCallback((e,t)=>{x(l=>{const o=[...l];if("APPROVED"===t.approval_status&&"APPROVED"!==l[e].approval_status){const e=r.getFirstUnapprovedStoryId(l,t.artifactId);e&&w(e)}return o[e]=t,o})},[]),_=t.useCallback(e=>{const t=B.current;if(!t)return;const l=r.getFirstNonApprovedSegmentId(t,e);"NA"!==l&&(k(""),setTimeout(()=>{k(l)},0))},[]);a.useApprovalStatus({userStoryForApproval:I,selectedUserStoryForApproval:R,userStoryIndex:M,callbacks:s,labels:b,onSaveUserStory:P});const z={height:g.containerHeight,...g.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},O={userStoryForApproval:I,setUserStoryForApproval:x,selectedStoryArtifactId:j,setSelectedStoryArtifactId:w,selectedUserStoryIndex:M,selectedUserStoryForApproval:R,currentContentId:E,setCurrentContentId:k,isEditingSegment:U,setIsEditingSegment:N,isSidebarExpanded:q,setIsSidebarExpanded:T,artifactTitleIds:l,config:g,labels:b,callbacks:s,isDisabled:c,handleSaveUserStory:P,handleUpdateContentId:_,showNotification:F,scrollToElement:D};return e.jsx(S.UserStoryApprovalScreenContext.Provider,{value:O,children:e.jsx("div",{className:`${d.default.container} ${(null==p?void 0:p.container)||""}`,style:{...z,...null===(m=null==f?void 0:f.approvalScreen)||void 0===m?void 0:m.wrapperContainer},children:v})})},{Sidebar:({Component:t,config:l,className:o})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingSegment:s,artifactTitleIds:d}=S.useUserStoryApprovalScreen();return t?e.jsx(t,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e.jsx(v.ApprovalSidebar,{config:l,className:o})},SidebarToggle:({OpenIcon:t,CloseIcon:l,className:o=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=S.useUserStoryApprovalScreen(),a=t||p.SidebarOpenIcon,i=l||p.SidebarCloseIcon;return e.jsx("div",{className:`${d.default.sidebarToggleWrapper} ${o}`,children:e.jsx("button",{onClick:()=>r(e=>!e),className:d.default.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:n?e.jsx(i,{}):e.jsx(a,{})})})},Content:({children:l,ButtonComponent:n,hideApproveAll:a=!1,pageTitle:i="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:b,handleOpenSendDialog:A,pageDescription:C="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var x,j,w,E,k,U,N,q,T,B,F,D,M,R,P,_,z,O,W,L,$,V,H,G,Y,J,K,Q,X,Z,ee;const{selectedUserStoryForApproval:te,selectedUserStoryIndex:le,artifactTitleIds:oe,labels:ne,config:re,isDisabled:ae,isEditingSegment:ie,handleSaveUserStory:se,setCurrentContentId:de,showNotification:ue}=S.useUserStoryApprovalScreen(),{userStory:ce,setUserStory:ve}=o.useRequirementAI(),pe=ce[0],[Se,he]=t.useState(null),me=()=>{he(null)},ye=t.useRef(null),[fe,ge]=t.useState(!1),{customStyles:be,customIcons:Ie}=o.useRequirementAI(),Ae=null==be?void 0:be.userStoryCardStyles,[Ce,xe]=t.useState(!1),je=t.useCallback(()=>{if(!te)return;if(ie)return void ue("warn","Warning!",ne.unsavedChangesWarning,3e3);const e=r.approveAllSegments(te);se(le,e),de("")},[te,le,ie,ne,se,de,ue]);if(!te)return null;const we=oe[le]||"",Ee="APPROVED"===te.approval_status,ke=null!=(null==te?void 0:te.big_enough)&&!Number.isNaN(te.big_enough)&&!!(null==te?void 0:te.big_enough_decision_factors);return e.jsxs("div",{className:d.default.content,style:{...null===(j=null===(x=null==be?void 0:be.approvalScreen)||void 0===x?void 0:x.content)||void 0===j?void 0:j.content},"data-lsc-ui-page-title":i,"data-lsc-ui-page-description":C,children:[e.jsxs("div",{className:d.default.header,style:{...null===(k=null===(E=null===(w=null==be?void 0:be.approvalScreen)||void 0===w?void 0:w.body)||void 0===E?void 0:E.contentSegment)||void 0===k?void 0:k.header},children:[e.jsxs("div",{className:d.default.headerLeft,style:{...null===(N=null===(U=null==be?void 0:be.approvalScreen)||void 0===U?void 0:U.content)||void 0===N?void 0:N.headerLeft},children:[e.jsxs("div",{className:d.default.headerMeta,style:{...null===(B=null===(T=null===(q=null==be?void 0:be.approvalScreen)||void 0===q?void 0:q.body)||void 0===T?void 0:T.contentSegment)||void 0===B?void 0:B.headerMeta},children:[e.jsx(c.BookmarkIcon,{size:16,color:(null===(M=null===(D=null===(F=null==be?void 0:be.approvalScreen)||void 0===F?void 0:F.body)||void 0===D?void 0:D.contentSegment)||void 0===M?void 0:M.bookMarkColor)||"#8C8C8C"}),e.jsx("h2",{className:d.default.headerArtifactId,style:{...null===(_=null===(P=null===(R=null==be?void 0:be.approvalScreen)||void 0===R?void 0:R.body)||void 0===P?void 0:P.contentSegment)||void 0===_?void 0:_.headerArtifactId},children:we})]}),e.jsx("p",{className:d.default.headerTitle,style:{...null===(W=null===(O=null===(z=null==be?void 0:be.approvalScreen)||void 0===z?void 0:z.body)||void 0===O?void 0:O.contentSegment)||void 0===W?void 0:W.headerTitle},children:null==te?void 0:te.title})]}),e.jsxs("div",{className:null===d.default||void 0===d.default?void 0:d.default.containerStyle,style:null===($=null===(L=null==be?void 0:be.approvalScreen)||void 0===L?void 0:L.BigEnoughStyles)||void 0===$?void 0:$.containerStyle,children:[ke&&e.jsx("button",{className:d.default.developerEffortButton,style:null===(H=null===(V=null==be?void 0:be.approvalScreen)||void 0===V?void 0:V.BigEnoughStyles)||void 0===H?void 0:H.buttonStyle,onClick:()=>xe(!Ce),children:e.jsx(m.default,{color:null===(Y=null===(G=null==be?void 0:be.approvalScreen)||void 0===G?void 0:G.BigEnoughStyles)||void 0===Y?void 0:Y.iconColor,size:null===(K=null===(J=null==be?void 0:be.approvalScreen)||void 0===J?void 0:J.BigEnoughStyles)||void 0===K?void 0:K.iconSize})}),v&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:d.default.iconButton,style:null==Ae?void 0:Ae.iconButton,onClick:e=>{he(e.currentTarget)},children:e.jsx(p.ExternalLink,{size:16})}),e.jsxs(y.Menu,{id:"user-story-share-menu",anchorEl:Se,open:!!Se,onClose:()=>he(null),style:null==Ae?void 0:Ae.userStoryShareMenu,children:[e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{ge(!0),b&&(await Promise.all([b("pdf"),b("doc")]),ge(!1))},children:e.jsxs("div",{ref:ye,className:d.default.menuItemContent,style:null==Ae?void 0:Ae.menuItemContent,children:[e.jsx(p.Download,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Download"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{let e=pe;e={...pe,value:`${g.replaceTitleSection(null==pe?void 0:pe.value,pe.title)}`},null==A||A(!0,[e],pe.artifactId),me()},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Share2,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Send"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{const e=(new I.default.Converter).makeHtml(f.formatMarkdown(pe.value)||pe.value),t=function(e){const t=(new I.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(f.formatMarkdown(pe.value)||pe.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{me()}},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Copy,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Copy"})]})})]})]}),!a&&re.showApproveAllButton&&e.jsx("div",{className:d.default.headerRight,children:Ee?e.jsx(s.ApprovalBadge,{status:"APPROVED",label:ne.approved}):n?e.jsx(n,{type:"fill",onClick:je,isDisable:ae,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ne.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:e.jsxs("div",{className:d.default.approveAllContent,children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})}):e.jsxs("button",{onClick:je,disabled:ae,className:d.default.approveAllButtonDefault,style:{...null===(X=null===(Q=null==be?void 0:be.approvalScreen)||void 0===Q?void 0:Q.content)||void 0===X?void 0:X.approveAllButtonDefault},children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})]})]}),Ce&&ke&&e.jsx("div",{className:d.default.bigEnoughWrapper,children:e.jsx(h.BigEnoughPanel,{customIcons:null==Ie?void 0:Ie.userStoryIcons,customStyles:null===(Z=null==be?void 0:be.approvalScreen)||void 0===Z?void 0:Z.aiReasoningCitaionStyles,currentUserStory:te,panelStyles:null===(ee=null==be?void 0:be.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles,showPanel:Ce})}),l]})},Body:({children:l,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u=!1})=>{var c,v,p;const{selectedUserStoryForApproval:h,selectedUserStoryIndex:m,artifactTitleIds:y,handleSaveUserStory:f}=S.useUserStoryApprovalScreen(),{customStyles:g}=o.useRequirementAI(),b=t.useCallback(e=>{f(m,e)},[m,f]),I=t.useCallback((e,t)=>{var l;if(!h)return;const o={...h,sub_features:null===(l=h.sub_features)||void 0===l?void 0:l.map((l,o)=>o===e?t:l)};f(m,o)},[h,m,f]),A=t.useCallback(e=>{var t;if(!h)return;const l={...h,sub_features:null===(t=h.sub_features)||void 0===t?void 0:t.filter((t,l)=>l!==e)};f(m,l)},[h,m,f]);if(!h)return null;const C=y[m]||"";return e.jsxs("div",{className:d.default.body,style:{...null===(v=null===(c=null==g?void 0:g.approvalScreen)||void 0===c?void 0:c.body)||void 0===v?void 0:v.container},children:[e.jsx(i.ContentSegment,{userStoryForApproval:h,artifactTitleId:C,onSaveMainStoryContent:b,EditorComponent:n,ViewerComponent:r}),null===(p=h.sub_features)||void 0===p?void 0:p.map((t,l)=>e.jsx(i.ContentSegment,{userStoryForApproval:t,artifactTitleId:`${C} - ${String.fromCharCode(65+l)}`,isSubFeature:!0,subFeatureIndex:l,onSaveSubFeature:I,onDeleteSubFeature:A,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u},t.artifactId)),l]})}});exports.default=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("showdown"),o=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),r=require("../../utils/userstory-approval.utils.js"),a=require("../../hooks/useApprovalStatus.js"),i=require("./components/ContentSegment/ContentSegment.js"),s=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),u=require("../../icons/CheckIcon.js"),c=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),h=require("../story-screen/BigEnoughPanel.js"),m=require("../../icons/BigEnoughIcon.js"),y=require("@mui/material"),f=require("../../utils/helpers.js"),g=require("../../utils/user-story.utils.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=b(l);const x={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},A={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},C=Object.assign(({artifactTitleIds:l,config:i={},callbacks:s={},labels:u={},isDisabled:c=!1,disabledReason:v="",children:p,classNames:h,selectedArtifactId:m})=>{var y;const{userStory:f,customStyles:g}=o.useRequirementAI(),b={...x,...i},I={...A,...u},[C,j]=t.useState([]),[w,E]=t.useState(""),[k,U]=t.useState(""),[N,q]=t.useState(!1),[T,B]=t.useState(!0),F=t.useRef(void 0),D=t.useCallback((e,t,l,o)=>{s.onShowNotification?s.onShowNotification(e,t,l,o):console.log(`[${e.toUpperCase()}] ${t}: ${l}`)},[s]),M=t.useCallback(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),R=t.useMemo(()=>{const e=C.findIndex(e=>e.artifactId===w);return e>=0?e:0},[C,w]),P=C[R];t.useEffect(()=>{F.current=P},[P]),t.useEffect(()=>{var e;if(!(null==f?void 0:f.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===f.length&&B(!1),f.length>0&&!w&&E(m||f[0].artifactId);const t=n.createUserStoriesForApproval(n.cloneUserStories(f));j(t)},[f,m]),t.useEffect(()=>{m&&m!==w&&E(m)},[m,w]),t.useEffect(()=>{if(!P)return;const e=r.getFirstNonApprovedSegmentId(P,"");U(e)},[null==P?void 0:P.artifactId]);const _=t.useCallback((e,t)=>{j(l=>{const o=[...l];if("APPROVED"===t.approval_status&&"APPROVED"!==l[e].approval_status){const e=r.getFirstUnapprovedStoryId(l,t.artifactId);e&&E(e)}return o[e]=t,o})},[]),z=t.useCallback(e=>{const t=F.current;if(!t)return;const l=r.getFirstNonApprovedSegmentId(t,e);"NA"!==l&&(U(""),setTimeout(()=>{U(l)},0))},[]);a.useApprovalStatus({userStoryForApproval:C,selectedUserStoryForApproval:P,userStoryIndex:R,callbacks:s,labels:I,onSaveUserStory:_});const O={height:b.containerHeight,...b.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},W={userStoryForApproval:C,setUserStoryForApproval:j,selectedStoryArtifactId:w,setSelectedStoryArtifactId:E,selectedUserStoryIndex:R,selectedUserStoryForApproval:P,currentContentId:k,setCurrentContentId:U,isEditingSegment:N,setIsEditingSegment:q,isSidebarExpanded:T,setIsSidebarExpanded:B,artifactTitleIds:l,config:b,labels:I,callbacks:s,isDisabled:c,disabledReason:v,handleSaveUserStory:_,handleUpdateContentId:z,showNotification:D,scrollToElement:M};return e.jsx(S.UserStoryApprovalScreenContext.Provider,{value:W,children:e.jsx("div",{className:`${d.default.container} ${(null==h?void 0:h.container)||""}`,style:{...O,...null===(y=null==g?void 0:g.approvalScreen)||void 0===y?void 0:y.wrapperContainer},children:p})})},{Sidebar:({Component:t,config:l,className:o})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingSegment:s,artifactTitleIds:d}=S.useUserStoryApprovalScreen();return t?e.jsx(t,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e.jsx(v.ApprovalSidebar,{config:l,className:o})},SidebarToggle:({OpenIcon:t,CloseIcon:l,className:o=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=S.useUserStoryApprovalScreen(),a=t||p.SidebarOpenIcon,i=l||p.SidebarCloseIcon;return e.jsx("div",{className:`${d.default.sidebarToggleWrapper} ${o}`,children:e.jsx("button",{onClick:()=>r(e=>!e),className:d.default.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:n?e.jsx(i,{}):e.jsx(a,{})})})},Content:({children:l,ButtonComponent:n,hideApproveAll:a=!1,pageTitle:i="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:b,handleOpenSendDialog:x,pageDescription:A="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var C,j,w,E,k,U,N,q,T,B,F,D,M,R,P,_,z,O,W,L,$,V,H,G,Y,J,K,Q,X,Z,ee;const{selectedUserStoryForApproval:te,selectedUserStoryIndex:le,artifactTitleIds:oe,labels:ne,config:re,isDisabled:ae,disabledReason:ie,isEditingSegment:se,handleSaveUserStory:de,setCurrentContentId:ue,showNotification:ce}=S.useUserStoryApprovalScreen(),{userStory:ve,setUserStory:pe}=o.useRequirementAI(),Se=ve[0],[he,me]=t.useState(null),ye=()=>{me(null)},fe=t.useRef(null),[ge,be]=t.useState(!1),{customStyles:Ie,customIcons:xe}=o.useRequirementAI(),Ae=null==Ie?void 0:Ie.userStoryCardStyles,[Ce,je]=t.useState(!1),we=t.useCallback(()=>{if(!te)return;if(se)return void ce("warn","Warning!",ne.unsavedChangesWarning,3e3);const e=r.approveAllSegments(te);de(le,e),ue("")},[te,le,se,ne,de,ue,ce]);if(!te)return null;const Ee=oe[le]||"",ke="APPROVED"===te.approval_status,Ue=ae?ie:"",Ne=null!=(null==te?void 0:te.big_enough)&&!Number.isNaN(te.big_enough)&&!!(null==te?void 0:te.big_enough_decision_factors);return e.jsxs("div",{className:d.default.content,style:{...null===(j=null===(C=null==Ie?void 0:Ie.approvalScreen)||void 0===C?void 0:C.content)||void 0===j?void 0:j.content},"data-lsc-ui-page-title":i,"data-lsc-ui-page-description":A,children:[e.jsxs("div",{className:d.default.header,style:{...null===(k=null===(E=null===(w=null==Ie?void 0:Ie.approvalScreen)||void 0===w?void 0:w.body)||void 0===E?void 0:E.contentSegment)||void 0===k?void 0:k.header},children:[e.jsxs("div",{className:d.default.headerLeft,style:{...null===(N=null===(U=null==Ie?void 0:Ie.approvalScreen)||void 0===U?void 0:U.content)||void 0===N?void 0:N.headerLeft},children:[e.jsxs("div",{className:d.default.headerMeta,style:{...null===(B=null===(T=null===(q=null==Ie?void 0:Ie.approvalScreen)||void 0===q?void 0:q.body)||void 0===T?void 0:T.contentSegment)||void 0===B?void 0:B.headerMeta},children:[e.jsx(c.BookmarkIcon,{size:16,color:(null===(M=null===(D=null===(F=null==Ie?void 0:Ie.approvalScreen)||void 0===F?void 0:F.body)||void 0===D?void 0:D.contentSegment)||void 0===M?void 0:M.bookMarkColor)||"#8C8C8C"}),e.jsx("h2",{className:d.default.headerArtifactId,style:{...null===(_=null===(P=null===(R=null==Ie?void 0:Ie.approvalScreen)||void 0===R?void 0:R.body)||void 0===P?void 0:P.contentSegment)||void 0===_?void 0:_.headerArtifactId},children:Ee})]}),e.jsx("p",{className:d.default.headerTitle,style:{...null===(W=null===(O=null===(z=null==Ie?void 0:Ie.approvalScreen)||void 0===z?void 0:z.body)||void 0===O?void 0:O.contentSegment)||void 0===W?void 0:W.headerTitle},children:null==te?void 0:te.title})]}),e.jsxs("div",{className:null===d.default||void 0===d.default?void 0:d.default.containerStyle,style:null===($=null===(L=null==Ie?void 0:Ie.approvalScreen)||void 0===L?void 0:L.BigEnoughStyles)||void 0===$?void 0:$.containerStyle,children:[Ne&&e.jsx("button",{className:d.default.developerEffortButton,style:null===(H=null===(V=null==Ie?void 0:Ie.approvalScreen)||void 0===V?void 0:V.BigEnoughStyles)||void 0===H?void 0:H.buttonStyle,onClick:()=>je(!Ce),children:e.jsx(m.default,{color:null===(Y=null===(G=null==Ie?void 0:Ie.approvalScreen)||void 0===G?void 0:G.BigEnoughStyles)||void 0===Y?void 0:Y.iconColor,size:null===(K=null===(J=null==Ie?void 0:Ie.approvalScreen)||void 0===J?void 0:J.BigEnoughStyles)||void 0===K?void 0:K.iconSize})}),v&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:d.default.iconButton,style:null==Ae?void 0:Ae.iconButton,onClick:e=>{me(e.currentTarget)},children:e.jsx(p.ExternalLink,{size:16})}),e.jsxs(y.Menu,{id:"user-story-share-menu",anchorEl:he,open:!!he,onClose:()=>me(null),style:null==Ae?void 0:Ae.userStoryShareMenu,children:[e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{be(!0),b&&(await Promise.all([b("pdf"),b("doc")]),be(!1))},children:e.jsxs("div",{ref:fe,className:d.default.menuItemContent,style:null==Ae?void 0:Ae.menuItemContent,children:[e.jsx(p.Download,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Download"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{let e=Se;e={...Se,value:`${g.replaceTitleSection(null==Se?void 0:Se.value,Se.title)}`},null==x||x(!0,[e],Se.artifactId),ye()},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Share2,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Send"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{const e=(new I.default.Converter).makeHtml(f.formatMarkdown(Se.value)||Se.value),t=function(e){const t=(new I.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(f.formatMarkdown(Se.value)||Se.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{ye()}},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Copy,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Copy"})]})})]})]}),!a&&re.showApproveAllButton&&e.jsx("div",{className:d.default.headerRight,children:ke?e.jsx(s.ApprovalBadge,{status:"APPROVED",label:ne.approved}):n?e.jsx(y.Tooltip,{title:Ue,children:e.jsx("span",{children:e.jsx(n,{type:"fill",onClick:we,isDisable:ae,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ne.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:e.jsxs("div",{className:d.default.approveAllContent,children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})})}):e.jsx(y.Tooltip,{title:Ue,children:e.jsx("span",{children:e.jsxs("button",{onClick:we,disabled:ae,className:d.default.approveAllButtonDefault,style:{...null===(X=null===(Q=null==Ie?void 0:Ie.approvalScreen)||void 0===Q?void 0:Q.content)||void 0===X?void 0:X.approveAllButtonDefault},children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})})})]})]}),Ce&&Ne&&e.jsx("div",{className:d.default.bigEnoughWrapper,children:e.jsx(h.BigEnoughPanel,{customIcons:null==xe?void 0:xe.userStoryIcons,customStyles:null===(Z=null==Ie?void 0:Ie.approvalScreen)||void 0===Z?void 0:Z.aiReasoningCitaionStyles,currentUserStory:te,panelStyles:null===(ee=null==Ie?void 0:Ie.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles,showPanel:Ce})}),l]})},Body:({children:l,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u=!1})=>{var c,v,p;const{selectedUserStoryForApproval:h,selectedUserStoryIndex:m,artifactTitleIds:y,handleSaveUserStory:f}=S.useUserStoryApprovalScreen(),{customStyles:g}=o.useRequirementAI(),b=t.useCallback(e=>{f(m,e)},[m,f]),I=t.useCallback((e,t)=>{var l;if(!h)return;const o={...h,sub_features:null===(l=h.sub_features)||void 0===l?void 0:l.map((l,o)=>o===e?t:l)};f(m,o)},[h,m,f]),x=t.useCallback(e=>{var t;if(!h)return;const l={...h,sub_features:null===(t=h.sub_features)||void 0===t?void 0:t.filter((t,l)=>l!==e)};f(m,l)},[h,m,f]);if(!h)return null;const A=y[m]||"";return e.jsxs("div",{className:d.default.body,style:{...null===(v=null===(c=null==g?void 0:g.approvalScreen)||void 0===c?void 0:c.body)||void 0===v?void 0:v.container},children:[e.jsx(i.ContentSegment,{userStoryForApproval:h,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:n,ViewerComponent:r}),null===(p=h.sub_features)||void 0===p?void 0:p.map((t,l)=>e.jsx(i.ContentSegment,{userStoryForApproval:t,artifactTitleId:`${A} - ${String.fromCharCode(65+l)}`,isSubFeature:!0,subFeatureIndex:l,onSaveSubFeature:I,onDeleteSubFeature:x,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u},t.artifactId)),l]})}});exports.default=C;
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),i=require("react-markdown"),t=require("rehype-raw"),o=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),d=require("lucide-react"),a=require("@mui/material"),r=require("dompurify"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),h=require("../../icons/CognitiveDecision.js"),p=require("../../icons/BrainRed.js"),v=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),f=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),w=require("./components/InlineManualComponent.js"),I=require("./components/HighlightButtonComponent.js"),b=require("../../../../utils/tagHelper.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=R(n),$=R(i),k=R(t),A=R(r);const q=n.createContext(!1),E=n.createContext({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),M=n.createContext({rowId:""}),T=({aiReason:i,isHighConfidence:t,customStyle:l,customIcons:d})=>{var a;const{expandedInfo:r,setExpanded:s,reasonToRow:c}=n.useContext(E),{rowId:u}=n.useContext(M),g=String(i.id);u&&c.current.set(g,u);const v=(null===(a=null==r?void 0:r.aiReason)||void 0===a?void 0:a.id)===i.id,m=t?(null==d?void 0:d.highConfidence)||e.jsx(h.default,{}):(null==d?void 0:d.lowConfidence)||e.jsx(p.default,{});return e.jsxs("button",{className:o.default.aiReasoningButton,style:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),s(v?null:u,v?null:i)},children:[m,v?e.jsx("i",{className:`pi pi-angle-up ${t?o.default.aiReasoningIconHighConfidence:o.default.aiReasoningIconLowConfidence}`}):e.jsx("i",{className:`pi pi-angle-down ${t?o.default.aiReasoningIconHighConfidence:o.default.aiReasoningIconLowConfidence}`})]})},_=({children:i,node:t,customStyles:l,customIcons:d})=>{var a,r;const s=n.useRef(Math.random().toString(36).slice(2)).current,{expandedInfo:c}=n.useContext(E),u=(null==c?void 0:c.rowId)===s,g=Array.isArray(null==t?void 0:t.children)?t.children.filter(e=>"element"===e.type).length:1,h=null!==(r=null===(a=null==t?void 0:t.properties)||void 0===a?void 0:a.style)&&void 0!==r?r:void 0;return e.jsxs(M.Provider,{value:{rowId:s},children:[e.jsx("tr",{style:h?{cssText:h}:void 0,children:i}),u&&(null==c?void 0:c.aiReason)&&e.jsx("tr",{style:{width:"100%"},children:e.jsx("td",{colSpan:g||1,className:o.default.tableExpandedCell,children:e.jsx("div",{className:o.default.tableExpandedCellInner,children:e.jsx("div",{className:o.default.tableExpandedCellContent,children:e.jsx(x.default,{aiReason:c.aiReason,customIcons:d,customStyles:{aiReasoningContent:null==l?void 0:l.aiReasoningContent,aiReasoningAccordion:null==l?void 0:l.aiReasoningAccordion,aiReasoningMarkdown:null==l?void 0:l.aiReasoningMarkdown,aiReasoningPill:null==l?void 0:l.aiReasoningPill,webCitation:null==l?void 0:l.webCitation,stormeeCitation:null==l?void 0:l.stormeeCitation,waveformCitation:null==l?void 0:l.waveformCitation,imageCitation:null==l?void 0:l.imageCitation,fileCitation:null==l?void 0:l.fileCitation,appModCitation:null==l?void 0:l.appModCitation,rcaCitation:null==l?void 0:l.rcaCitation,readFileCitation:null==l?void 0:l.readFileCitation,loadingCitations:null==l?void 0:l.loadingCitations,chatCitation:null==l?void 0:l.chatCitation}})})})})})]})};const U=["del","ins"];function L(e){return function(e,n,i){const t=n.join("|");return e.replace(new RegExp(`<(${t})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,t)=>`<${n}>${i(t)}</${n}>`)}(e,U,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var t;return`<code>${o=null!==(t=n[Number(i)])&&void 0!==t?t:"",o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code>`;var o})}(e)).join(""))}const F=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function P(e,n){const i=[],t=new Set(n.map(e=>e.toLowerCase())),o=e=>{var n,l;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>o(e)).flat().filter(e=>null!=e);if(!N.default.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(d))return i.push(e),null;if(F.has(d))return e;const a=null===(l=N.default.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,o))||void 0===l?void 0:l.flat().filter(e=>null!=e);return a&&0!==a.length?N.default.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:o(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}exports.default=({message:i,noMarkdownContent:t,useMarkdown:r=!0,isParent:h,scenario:p,showUserStoryDiff:x=!1,aiReasoningsForBlock:R,isCitationLoadingDisplay:M=!1,className:U,highConfidenceIcon:F,lowConfidenceIcon:D,customStyles:H,customIcons:O,contextVariant:B,aiReasoningDiffView:W,userStoryCitations:V,artifactId:z,isCraflow:G,onCraAccept:Q,onCraReject:J,craFlowConfig:K,isDisplayHighlightControl:X=!1,showConfidenceScore:Y=!0,CDNeededInChip:Z,blockId:ee,showWaitingIconInChip:ne})=>{var ie;console.log("userstorywithcitation blockid ",ee);const te=n.useRef(null),{userStory:oe,inlineUpdateComponentConfig:le,getAvgScoreForStory:de,setUserStory:ae,aiReasoning:re,setAiReasoning:se,customIcons:ce,searchQueryList:ue,searchQueryReasoningIdList:ge,currentHighlightIndex:he,segmentComponentConfig:pe,inlineManualComponentConfig:ve,diffEditConfig:me}=g.useRequirementAI(),fe=null!=O?O:null==ce?void 0:ce.userStoryIcons;null==H||H.searchHighlight;const{search:Ce,clear:xe}=l.useMarkdownSearch(te),[je,ye]=n.useState("1"),[Se,we]=n.useState(null),Ie=n.useRef(new Map),[be,Re]=n.useState(new Set),Ne=n.useCallback((e,n)=>{we(e&&n?{rowId:e,aiReason:n}:null)},[]),$e=z?de(z):0,[ke,Ae]=n.useState([]),qe=n.useCallback(e=>{Re(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Ee=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Ee).join(""):N.default.isValidElement(e)?Ee(e.props.children):"",Me=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,t,o)=>{const l=t.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,t,o)=>{const l=n.substring(0,o),d=l.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(l.substring(d+1))||/^\s+\d+\.\s/.test(l.substring(d+1)),r=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(d+1));if(a||r){let e=t;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let t;const o=new RegExp(n.source,n.flags);for(;null!==(t=o.exec(e));){const e=t[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),o=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:t.index,endIndex:t.index+t[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==o?void 0:o[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],t=n.changedItemCount-n.deletedItemCount;if(0===t)continue;const o=l.substring(0,n.index).split("\n").reverse();let d=!1;for(const e of o){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(d=!0);break}}if(!d)continue;const a=n.endIndex,r=e+1<i.length?i[e+1].index:l.length;let s=l.substring(a,r);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+t}. `),l=l.substring(0,a)+s+l.substring(r)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=L(n),n},Te=n.useMemo(()=>i?Me(i):i,[i]);n.useEffect(()=>{Ae(R||re)},[R,re]);const _e=n.useMemo(()=>({span:({node:n,children:i,...t})=>{var o,l,d,a,r;const s=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o["highlight-id"])&&void 0!==l?l:null==t?void 0:t["highlight-id"],c="string"==typeof s&&be.has(s),u=null!==(a=null===(d=null==n?void 0:n.properties)||void 0===d?void 0:d["highlight-color"])&&void 0!==a?a:null==t?void 0:t["highlight-color"];return e.jsx("span",{style:{...null!==(r=null==H?void 0:H.span)&&void 0!==r?r:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:n,children:i,...t})=>{var o,l,d,a,r,s;const c=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.action)&&void 0!==l?l:null==t?void 0:t.action,u=null!==(a=null===(d=null==n?void 0:n.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==t?void 0:t["highlight-id"],g=null!==(s=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-type"])&&void 0!==s?s:null==t?void 0:t["highlight-type"];return"highlight"===c?e.jsx(I.default,{highlightId:u,handleHighlightSpan:qe,icon:"web"===g?null==fe?void 0:fe.webCitationIcon:"doc"===g?null==fe?void 0:fe.fileCitationIcon:e.jsx(e.Fragment,{}),customStyles:"web"===g?null==H?void 0:H.webButton:"doc"===g?null==H?void 0:H.docButton:{}}):null},upt:({node:n,children:i,...t})=>{var o,l;const d=null==t?void 0:t.id,a=d?null===(l=null===(o=d.split("$"))||void 0===o?void 0:o[1])||void 0===l?void 0:l.replaceAll("@","<").replaceAll("#",">"):null,r=re.find(e=>e.id.toString()===a);if(!r)return i||e.jsx(e.Fragment,{});const s="data-main"in t,c=t["data-status"];return e.jsx(e.Fragment,{children:e.jsx(j.default,{aiReason:r,customStyles:null==H?void 0:H.inlineUpdatedComponent,handleClickCognitiveDecision:null==le?void 0:le.handleClickCognitiveDecision,handleClickUpdatedPill:null==le?void 0:le.handleClickUpdatedPill,handleClickOutputValue:null==le?void 0:le.handleClickOutputValue,customIcons:null==le?void 0:le.customIcons,CDNeededInChip:Z,showWaitingIconInChip:ne,showChip:s,status:c,children:i||e.jsx(e.Fragment,{})})})},del:({node:n,children:i,...t})=>{var l;const{cleanedChildren:d,extractedNodes:a}=P(i,["ins"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:o.default.deleted,style:null!==(l=null==H?void 0:H.deleted)&&void 0!==l?l:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:d}),a]})},ins:({children:n,...i})=>{var t;const{cleanedChildren:l,extractedNodes:d}=P(n,["del"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:o.default.inserted,style:null!==(t=null==H?void 0:H.inserted)&&void 0!==t?t:{},...i,onClick:()=>{i.onclick&&i.onclick()},children:l}),d]})},preserved:({children:n,...i})=>e.jsx("span",{className:o.default.preserved,style:null==H?void 0:H.preserved,...i,children:n}),manual:({children:n,...i})=>{var t;const o=null===(t=null==i?void 0:i.id)||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),l=re.find(e=>e.id.toString()===o),d=i["data-status"];return l?e.jsx(w.default,{aiReason:l,handleClick:null==ve?void 0:ve.handleClick,status:d,children:n}):n||e.jsx(e.Fragment,{})},invisible:({children:n,...i})=>e.jsx(e.Fragment,{}),h1:({node:n,...i})=>e.jsx("h1",{className:o.default.heading1,style:null==H?void 0:H.heading1,children:i.children}),h2:({node:n,...i})=>e.jsx("h2",{className:o.default.heading2,style:null==H?void 0:H.heading2,children:i.children}),h3:({node:n,...i})=>e.jsx("h3",{className:o.default.heading3,style:null==H?void 0:H.heading3,children:i.children}),b:({node:n,...i})=>e.jsx("b",{className:o.default.bold,style:null==H?void 0:H.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e.jsx("p",{...i,className:o.default.paragraph,style:null==H?void 0:H.paragraph,children:i.children}),updated:({node:n,...i})=>e.jsx(s.default,{...i,showUserStoryDiff:x,currentUpdatedTagId:je,setCurrentUpdatedTagId:ye,userStory:oe,setUserStory:ae,setAiReasoning:se,node:n,isCraflow:G,onCraAccept:Q,onCraReject:J,diffEditConfig:me,customStyles:null==H?void 0:H.updatedContent,craFlowConfig:K}),ol:({node:n,...i})=>{var t,l,d;const a=null!==(d=null!==(l=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.start)&&void 0!==l?l:null==i?void 0:i.start)&&void 0!==d?d:void 0;return e.jsx("ol",{className:o.default.orderedList,style:null==H?void 0:H.olist,...a?{start:Number(a)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>e.jsx("ul",{className:o.default.unorderedList,style:null==H?void 0:H.ulist,children:null==i?void 0:i.children}),table:({children:n})=>e.jsx("div",{className:o.default.tableWrapper,children:e.jsx("table",{className:o.default.table,style:null==H?void 0:H.table,children:n})}),tr:({node:n,children:i})=>e.jsx(_,{node:n,children:i,customStyles:H}),td:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("td",{...l,style:o?{cssText:o}:void 0,children:i})})},th:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("th",{...l,style:o?{cssText:o}:void 0,children:i})})},recommendation:({node:n,...i})=>{var t;const o=`The AI has selected this content based on: ${(null===(t=null==i?void 0:i.children)||void 0===t?void 0:t[0])||""}`;return e.jsx(f.default,{...i,customStyles:null==H?void 0:H.recommendationBlock,label:o})},a:({inline:i,children:t,node:o,...l})=>{var d,a,r;const s=n.useContext(q)||"true"==(null==l?void 0:l.table),c=`${null==l?void 0:l.href}`,u=null===(d=c.split("$"))||void 0===d?void 0:d[0],g=null===(a=c.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===u){const n=(null!==(r=x?W:re)&&void 0!==r?r:[]).find(e=>e.id.toString()===decodeURIComponent(g)),i=ge.includes(g);if(n){if(s)return e.jsx(T,{aiReason:n,customStyle:null==H?void 0:H.tableAiReasoning,customIcons:fe,isHighConfidence:n.relevance_score>=v.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});const o=Ee(t),l="source"!==o.trim().toLowerCase();return e.jsx(v.default,{aiReason:n,isSourceHasHighlight:i,inlineLabel:o,isInlineCitation:l,customIcons:fe,customStyles:{aiReasoningContent:null==H?void 0:H.aiReasoningContent,aiReasoningAccordion:null==H?void 0:H.aiReasoningAccordion,aiReasoningMarkdown:null==H?void 0:H.aiReasoningMarkdown,aiReasoningPill:null==H?void 0:H.aiReasoningPill,webCitation:null==H?void 0:H.webCitation,stormeeCitation:null==H?void 0:H.stormeeCitation,waveformCitation:null==H?void 0:H.waveformCitation,imageCitation:null==H?void 0:H.imageCitation,fileCitation:null==H?void 0:H.fileCitation,appModCitation:null==H?void 0:H.appModCitation,rcaCitation:null==H?void 0:H.rcaCitation,readFileCitation:null==H?void 0:H.readFileCitation,loadingCitations:null==H?void 0:H.loadingCitations,chatCitation:null==H?void 0:H.chatCitation,bigEnoughCitation:null==H?void 0:H.bigEnoughCitation}})}}return null},code:({inline:n,children:i,className:t,node:l,...d})=>/language-(\w+)/.exec(t||"")||(null==t?void 0:t.includes("language-"))?e.jsx("div",{children:e.jsx("code",{className:o.default.blockCode,style:null==H?void 0:H.code,children:i})}):e.jsx("code",{className:o.default.inlineCode,style:null==H?void 0:H.code,children:i}),learned:({children:n})=>e.jsx(a.Tooltip,{title:n,placement:"top",children:e.jsx(d.Info,{size:16,className:o.default.learned})}),generatedcode:({node:n,...i})=>{const t=(null==i?void 0:i.language)||"python",o=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n})(i);return e.jsx(c.default,{title:"Generated Code",code:o,language:t,customStyles:{pill:null==H?void 0:H.generatedCodePill,content:null==H?void 0:H.generatedCodeContent}})},updatedsegment:({node:n,children:i,...t})=>{var o,l,d,a;const r=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(d=n.position)||void 0===d?void 0:d.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(t),c=s?e.jsx("div",{dangerouslySetInnerHTML:{__html:A.default.sanitize(s)}}):e.jsx("div",{children:i});return e.jsx(y.default,{id:r,node:n,children:c,props:t,segmentComponentConfig:pe,customStyles:H,customIcons:O,extractText:Ee,isUpdatedSegment:!0})},segment:({node:n,children:i,...t})=>{var o,l,d,a;const r=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(d=n.position)||void 0===d?void 0:d.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`;return e.jsx(y.default,{id:r,node:n,children:i,props:t,segmentComponentConfig:pe,customStyles:H,customIcons:O,extractText:Ee,blockId:ee})}}),[ke,K,re,V,je,x,i,O,ue,ge,H,pe,be,qe,ee]),Ue=n.useMemo(()=>{let e=b.escapeTagIds(Te,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=b.splitTagAcrossParagraphs(e,n,"upt"===n)}),e},[Te]);return n.useEffect(()=>{if(!te.current)return;if(!ue.length)return void xe();let e;if(0===ge.length||X)requestAnimationFrame(()=>{Ce([ue[he].replace(/\*/g,"")])});else{const n=te.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{Ce([ue[he].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[ue,ge,he,X]),e.jsx(E.Provider,{value:{expandedInfo:Se,setExpanded:Ne,reasonToRow:Ie},children:e.jsxs("div",{ref:te,className:`${o.default.container} ${"approving"!==p?o.default.wrapper:""} ${U||""}`,style:null==H?void 0:H.container,children:[r?e.jsx(S.MarkdownContextProvider,{children:e.jsx($.default,{components:_e,rehypePlugins:[k.default],children:Ue})}):t,$e>0&&Y&&e.jsx("div",{className:o.default.confidenceScoreContainer,style:null==H?void 0:H.confidenceScoreContainer,children:e.jsxs("span",{className:o.default.confidenceScore,style:null==H?void 0:H.confidenceScore,children:[e.jsx(m.default,{size:14,color:(null==H?void 0:H.confidenceScoreIconColor)||"#166534"}),$e,"%"]})}),M&&e.jsx("div",{className:o.default.citationLoader,style:null==H?void 0:H.citationLoaderContainer,children:e.jsx(u.default,{customStyles:{container:null==H?void 0:H.citationLoadingContainer,icon:null==H?void 0:H.citationLoadingIcon,text:null==H?void 0:H.citationLoadingText}})}),h&&e.jsx("div",{style:{...null===(ie=null==H?void 0:H.attachedContext)||void 0===ie?void 0:ie.wrapper},className:"flex mt-5",children:e.jsx(C.default,{customStyles:null==H?void 0:H.attachedContext,variant:B})})]})})},exports.splitNestedDiffNodes=P;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("react-markdown"),i=require("rehype-raw"),l=require("./UserStoryWithCitation.module.css.js"),o=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),d=require("@mui/material"),a=require("dompurify"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),h=require("../../icons/CognitiveDecision.js"),p=require("../../icons/BrainRed.js"),v=require("../ai-reasoning/AiReasoningCitation.js"),f=require("../../icons/RelevanceScoreIcon.js"),m=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),y=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),I=require("./components/InlineManualComponent.js"),b=require("./components/HighlightButtonComponent.js"),w=require("../../../../utils/tagHelper.js"),R=require("../RichTextEditor/Editor/utils/normalizeRedlineMarkdown.js");function $(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=$(n),k=$(t),A=$(i),q=$(a);const E=n.createContext(!1),L=n.createContext({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),M=n.createContext({rowId:""}),U=({aiReason:t,isHighConfidence:i,customStyle:o,customIcons:r})=>{var d;const{expandedInfo:a,setExpanded:s,reasonToRow:c}=n.useContext(L),{rowId:u}=n.useContext(M),g=String(t.id);u&&c.current.set(g,u);const v=(null===(d=null==a?void 0:a.aiReason)||void 0===d?void 0:d.id)===t.id,f=i?(null==r?void 0:r.highConfidence)||e.jsx(h.default,{}):(null==r?void 0:r.lowConfidence)||e.jsx(p.default,{});return e.jsxs("button",{className:l.default.aiReasoningButton,style:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),s(v?null:u,v?null:t)},children:[f,v?e.jsx("i",{className:`pi pi-angle-up ${i?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence}`}):e.jsx("i",{className:`pi pi-angle-down ${i?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence}`})]})},T=({children:t,node:i,customStyles:o,customIcons:r})=>{var d,a;const s=n.useRef(Math.random().toString(36).slice(2)).current,{expandedInfo:c}=n.useContext(L),u=(null==c?void 0:c.rowId)===s,g=Array.isArray(null==i?void 0:i.children)?i.children.filter(e=>"element"===e.type).length:1,h=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return e.jsxs(M.Provider,{value:{rowId:s},children:[e.jsx("tr",{style:h?{cssText:h}:void 0,children:t}),u&&(null==c?void 0:c.aiReason)&&e.jsx("tr",{style:{width:"100%"},children:e.jsx("td",{colSpan:g||1,className:l.default.tableExpandedCell,children:e.jsx("div",{className:l.default.tableExpandedCellInner,children:e.jsx("div",{className:l.default.tableExpandedCellContent,children:e.jsx(x.default,{aiReason:c.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==o?void 0:o.aiReasoningContent,aiReasoningAccordion:null==o?void 0:o.aiReasoningAccordion,aiReasoningMarkdown:null==o?void 0:o.aiReasoningMarkdown,aiReasoningPill:null==o?void 0:o.aiReasoningPill,webCitation:null==o?void 0:o.webCitation,stormeeCitation:null==o?void 0:o.stormeeCitation,waveformCitation:null==o?void 0:o.waveformCitation,imageCitation:null==o?void 0:o.imageCitation,fileCitation:null==o?void 0:o.fileCitation,appModCitation:null==o?void 0:o.appModCitation,rcaCitation:null==o?void 0:o.rcaCitation,readFileCitation:null==o?void 0:o.readFileCitation,loadingCitations:null==o?void 0:o.loadingCitations,chatCitation:null==o?void 0:o.chatCitation}})})})})})]})};const P=["del","ins"];function _(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,t)=>`@@CODE_SPAN_${n.push(t)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,t)=>{var i;const l=null!==(i=n[Number(t)])&&void 0!==i?i:"";return`<code>${o=l,o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code>`;var o})}function D(e){return function(e,n,t){const i=n.join("|");return e.replace(new RegExp(`<(${i})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,i)=>`<${n}>${t(i)}</${n}>`)}(e,P,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:_(e)).join(""))}function F(e){let n=e.trim();n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const t=[];let i="",l=!1;for(const e of n)l?(i+=e,l=!1):"\\"!==e?"|"!==e?i+=e:(t.push(i.trim()),i=""):(i+=e,l=!0);return t.push(i.trim()),t}function H(e){return e.trim().includes("|")&&F(e).length>1}function O(e){const n=F(e);return n.length>1&&n.every(e=>/^:?-{3,}:?$/.test(e.replace(/\s+/g,"")))}function W(e){if(!e)return;const n=e.replace(/\s+/g,"");return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":"left"}function B(e,n){return Array.from({length:n},(n,t)=>{var i;return null!==(i=e[t])&&void 0!==i?i:""})}function z(e,n,t){return`<${e}${function(e){return e?` align="${e}"`:""}(t)}>${_(n)}</${e}>`}function V(e,n,t){const i=Math.max(e.length,n.length,...t.map(e=>e.length)),l=B(e,i),o=B(n,i).map(W);return`\n\n<table>${`<thead><tr>${l.map((e,n)=>z("th",e,o[n])).join("")}</tr></thead>`}${t.length?`<tbody>${t.map(e=>`<tr>${B(e,i).map((e,n)=>z("td",e,o[n])).join("")}</tr>`).join("")}</tbody>`:""}</table>\n\n`}const G=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Q(e,n){const t=[],i=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,o;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!N.default.isValidElement(e))return e;const r="string"==typeof e.type?e.type.toLowerCase():"";if(i.has(r))return t.push(e),null;if(G.has(r))return e;const d=null===(o=N.default.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===o?void 0:o.flat().filter(e=>null!=e);return d&&0!==d.length?N.default.cloneElement(e,void 0,d):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:t}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}exports.default=({message:t,noMarkdownContent:i,useMarkdown:a=!0,isParent:h,scenario:p,showUserStoryDiff:x=!1,aiReasoningsForBlock:$,isCitationLoadingDisplay:M=!1,className:P,highConfidenceIcon:_,lowConfidenceIcon:W,customStyles:B,customIcons:z,contextVariant:G,aiReasoningDiffView:J,userStoryCitations:K,artifactId:X,isCraflow:Y,onCraAccept:Z,onCraReject:ee,craFlowConfig:ne,isDisplayHighlightControl:te=!1,showConfidenceScore:ie=!0,CDNeededInChip:le,blockId:oe,storyId:re,showWaitingIconInChip:de})=>{var ae;console.log("userstorywithcitation blockid ",oe);const se=n.useRef(null),{userStory:ce,inlineUpdateComponentConfig:ue,getAvgScoreForStory:ge,setUserStory:he,aiReasoning:pe,setAiReasoning:ve,customIcons:fe,searchQueryList:me,searchQueryReasoningIdList:Ce,currentHighlightIndex:xe,segmentComponentConfig:ye,inlineManualComponentConfig:je,diffEditConfig:Se,customSectionConfig:Ie}=g.useRequirementAI(),be=null!=z?z:null==fe?void 0:fe.userStoryIcons;null==B||B.searchHighlight;const{search:we,clear:Re}=o.useMarkdownSearch(se),[$e,Ne]=n.useState("1"),[ke,Ae]=n.useState(null),qe=n.useRef(new Map),[Ee,Le]=n.useState(new Set),Me=n.useCallback((e,n)=>{Ae(e&&n?{rowId:e,aiReason:n}:null)},[]),Ue=X?ge(X):0,[Te,Pe]=n.useState([]),_e=n.useCallback(e=>{Le(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},[]),De=n.useCallback((e,n)=>{var t,i,l,o,r,d;const a=n["data-upt-id"];if("string"!=typeof a)return;let s=a;try{s=decodeURIComponent(a)}catch(e){}const c=null===(i=null===(t=s.split("$"))||void 0===t?void 0:t[1])||void 0===i?void 0:i.replaceAll("@","<").replaceAll("#",">"),u=pe.find(e=>e.id.toString()===c);if(!u)return;e.preventDefault(),e.stopPropagation();const g=null!==(r=Array.from(null!==(o=null===(l=se.current)||void 0===l?void 0:l.querySelectorAll("[data-ai-reason-id]"))&&void 0!==o?o:[]).find(e=>e.dataset.aiReasonId===u.id.toString()))&&void 0!==r?r:e.currentTarget;null===(d=null==ue?void 0:ue.handleClickUpdatedPill)||void 0===d||d.call(ue,g,u)},[pe,null==ue?void 0:ue.handleClickUpdatedPill]),Fe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Fe).join(""):N.default.isValidElement(e)?Fe(e.props.children):"",He=e=>{let n=function(e){const n=e.split("\n"),t=[];let i=!1;for(let e=0;e<n.length;e++){const l=n[e];if(/^\s*(```|~~~)/.test(l)){i=!i,t.push(l);continue}const o=n[e+1];if(!i&&void 0!==o&&H(l)&&O(o)){const i=F(l),r=F(o),d=[];for(e+=2;e<n.length&&H(n[e])&&!O(n[e]);)d.push(F(n[e])),e++;e--,t.push(V(i,r,d));continue}t.push(l)}return t.join("\n")}(R.normalizeRedlineMarkdown(function(e){return e.replace(/\\r\\n|\\n|\\r/g,"\n")}(e)));return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,t)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(t.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,t,i,l)=>{const o=i.match(/<table[\s\S]*?<\/table>/i);if(o){return`<segment${t} data-table="${btoa(encodeURIComponent(o[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,t)=>{if(/<table[\s>]/i.test(t)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(t))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,t,i,l)=>{const o=n.substring(0,l),r=o.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(o.substring(r+1))||/^\s+\d+\.\s/.test(o.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(o.substring(r+1));if(d||a){let e=i;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${t}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[];let i;const l=new RegExp(n.source,n.flags);for(;null!==(i=l.exec(e));){const e=i[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),l=e.match(/<changed>([\s\S]*?)<\/changed>/i),o=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;t.push({index:i.index,endIndex:i.index+i[0].length,deletedItemCount:o((null==n?void 0:n[1])||""),changedItemCount:o((null==l?void 0:l[1])||"")})}if(0===t.length)return e;let o=e;for(let e=t.length-1;e>=0;e--){const n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)continue;const l=o.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of l){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<t.length?t[e+1].index:o.length;let s=o.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,t)=>`${n}${parseInt(t,10)+i}. `),o=o.substring(0,d)+s+o.substring(a)}return o}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const t=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:t!==n}),`<deleted>${t}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const t=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:t!==n,preview:n.substring(0,120)}),`<changed>${t}</changed>`}),n}(n),n=D(n),n},Oe=n.useMemo(()=>t?He(t):t,[t]);n.useEffect(()=>{Pe($||pe)},[$,pe]);const We=n.useMemo(()=>{const t=Boolean(null==Ie?void 0:Ie.negateList),i=(e,n)=>{let t=0;return N.default.Children.map(e,e=>{if(!N.default.isValidElement(e))return e;const i=n(t);return t+=1,N.default.cloneElement(e,{"data-list-marker":i})})};return{span:({node:n,children:t,...i})=>{var l,o,r,d,a;const s=null!==(o=null===(l=null==n?void 0:n.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==o?o:null==i?void 0:i["highlight-id"],c="string"==typeof s&&Ee.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==i?void 0:i["highlight-color"];return e.jsx("span",{style:{...null!==(a=null==B?void 0:B.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:t})},button:({node:n,children:t,...i})=>{var l,o,r,d,a,s;const c=null!==(o=null===(l=null==n?void 0:n.properties)||void 0===l?void 0:l.action)&&void 0!==o?o:null==i?void 0:i.action,u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-id"])&&void 0!==d?d:null==i?void 0:i["highlight-id"],g=null!==(s=null===(a=null==n?void 0:n.properties)||void 0===a?void 0:a["highlight-type"])&&void 0!==s?s:null==i?void 0:i["highlight-type"];return"highlight"===c?e.jsx(b.default,{highlightId:u,handleHighlightSpan:_e,icon:"web"===g?null==be?void 0:be.webCitationIcon:"doc"===g?null==be?void 0:be.fileCitationIcon:e.jsx(e.Fragment,{}),customStyles:"web"===g?null==B?void 0:B.webButton:"doc"===g?null==B?void 0:B.docButton:{}}):null},upt:({node:n,children:t,...i})=>{var l,o;const r=null==i?void 0:i.id,d=r?null===(o=null===(l=r.split("$"))||void 0===l?void 0:l[1])||void 0===o?void 0:o.replaceAll("@","<").replaceAll("#",">"):null,a=pe.find(e=>e.id.toString()===d);if(!a)return t||e.jsx(e.Fragment,{});const s="data-main"in i,c=i["data-status"];return e.jsx(e.Fragment,{children:e.jsx(y.default,{aiReason:a,customStyles:null==B?void 0:B.inlineUpdatedComponent,handleClickCognitiveDecision:null==ue?void 0:ue.handleClickCognitiveDecision,handleClickUpdatedPill:null==ue?void 0:ue.handleClickUpdatedPill,handleClickOutputValue:null==ue?void 0:ue.handleClickOutputValue,customIcons:null==ue?void 0:ue.customIcons,CDNeededInChip:le,showWaitingIconInChip:de,showChip:s,status:c,containerRef:se,children:t||e.jsx(e.Fragment,{})})})},del:({node:n,children:t,...i})=>{var o;const{cleanedChildren:r,extractedNodes:d}=Q(t,["ins"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.default.deleted,style:null!==(o=null==B?void 0:B.deleted)&&void 0!==o?o:{},...i,onClick:()=>{i.onclick&&i.onclick()},children:r}),d]})},ins:({children:n,...t})=>{var i;const{cleanedChildren:o,extractedNodes:r}=Q(n,["del"]);return console.log("LOG: Printing ins props",t),e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.default.inserted,style:null!==(i=null==B?void 0:B.inserted)&&void 0!==i?i:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:o}),r]})},deleted:({children:n,...t})=>e.jsx("span",{style:{textDecorationLine:"line-through",textDecorationColor:"#dc2626",cursor:"pointer"},...t,onClick:e=>De(e,t),children:n}),changed:({children:n,...t})=>e.jsx("span",{style:{backgroundColor:"#f3e8ff",color:"#1e3a8a",padding:"1px 2px",borderRadius:"2px",cursor:"pointer"},...t,onClick:e=>De(e,t),children:n}),preserved:({children:n,...t})=>e.jsx("span",{className:l.default.preserved,style:null==B?void 0:B.preserved,...t,children:n}),manual:({children:n,...t})=>{var i;const l=null===(i=null==t?void 0:t.id)||void 0===i?void 0:i.replaceAll("@","<").replaceAll("#",">"),o=pe.find(e=>e.id.toString()===l),r=t["data-status"];return o?e.jsx(I.default,{aiReason:o,handleClick:null==je?void 0:je.handleClick,status:r,children:n}):n||e.jsx(e.Fragment,{})},invisible:({children:n,...t})=>e.jsx(e.Fragment,{}),h1:({node:n,...t})=>e.jsx("h1",{className:l.default.heading1,style:null==B?void 0:B.heading1,children:t.children}),h2:({node:n,...t})=>e.jsx("h2",{className:l.default.heading2,style:null==B?void 0:B.heading2,children:t.children}),h3:({node:n,...t})=>e.jsx("h3",{className:l.default.heading3,style:null==B?void 0:B.heading3,children:t.children}),b:({node:n,...t})=>e.jsx("b",{className:l.default.bold,style:null==B?void 0:B.bold,children:null==t?void 0:t.children}),p:({node:n,...t})=>e.jsx("p",{...t,className:l.default.paragraph,style:null==B?void 0:B.paragraph,children:t.children}),updated:({node:n,...t})=>e.jsx(s.default,{...t,showUserStoryDiff:x,currentUpdatedTagId:$e,setCurrentUpdatedTagId:Ne,userStory:ce,setUserStory:he,setAiReasoning:ve,node:n,isCraflow:Y,onCraAccept:Z,onCraReject:ee,diffEditConfig:Se,customStyles:null==B?void 0:B.updatedContent,craFlowConfig:ne}),ol:({node:n,...o})=>{var r,d,a;const s=null!==(a=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r.start)&&void 0!==d?d:null==o?void 0:o.start)&&void 0!==a?a:void 0,c=Number(null!=s?s:1);return t?e.jsx("div",{role:"list",className:l.default.negatedOrderedList,style:null==B?void 0:B.olist,children:i(o.children,e=>`${c+e}.`)}):e.jsx("ol",{className:l.default.orderedList,style:null==B?void 0:B.olist,...s?{start:Number(s)}:{},children:null==o?void 0:o.children})},ul:({node:n,...o})=>t?e.jsx("div",{role:"list",className:l.default.negatedUnorderedList,style:null==B?void 0:B.ulist,children:i(o.children,()=>"•")}):e.jsx("ul",{className:l.default.unorderedList,style:null==B?void 0:B.ulist,children:null==o?void 0:o.children}),li:({node:n,...i})=>{if(t){const n=i["data-list-marker"],{children:t,"data-list-marker":o,...r}=i;return e.jsxs("div",{...r,role:"listitem",className:`${l.default.paragraph} ${l.default.negatedListItem}`,style:null==B?void 0:B.paragraph,children:[n&&e.jsxs("span",{className:l.default.negatedListMarker,children:[n," "]}),t]})}return e.jsx("li",{children:null==i?void 0:i.children})},table:({children:n})=>e.jsx("div",{className:l.default.tableWrapper,children:e.jsx("table",{className:l.default.table,style:null==B?void 0:B.table,children:n})}),tr:({node:n,children:t})=>e.jsx(T,{node:n,children:t,customStyles:B}),td:({node:n,children:t})=>{var i;const{style:l,...o}=null!==(i=null==n?void 0:n.properties)&&void 0!==i?i:{};return e.jsx(E.Provider,{value:!0,children:e.jsx("td",{...o,style:l?{cssText:l}:void 0,children:t})})},th:({node:n,children:t})=>{var i;const{style:l,...o}=null!==(i=null==n?void 0:n.properties)&&void 0!==i?i:{};return e.jsx(E.Provider,{value:!0,children:e.jsx("th",{...o,style:l?{cssText:l}:void 0,children:t})})},recommendation:({node:n,...t})=>{var i;const l=`The AI has selected this content based on: ${(null===(i=null==t?void 0:t.children)||void 0===i?void 0:i[0])||""}`;return e.jsx(m.default,{...t,customStyles:null==B?void 0:B.recommendationBlock,label:l})},a:({inline:t,children:i,node:l,...o})=>{var r;const d=n.useContext(E)||"true"===(null==o?void 0:o.table),a=`${null==o?void 0:o.href}`,[s,c]=a.split("$"),u=null==c?void 0:c.split("?")[0];if("ai_reasoning"===s){const n=(null!==(r=x?J:pe)&&void 0!==r?r:[]).find(e=>e.id.toString()===decodeURIComponent(u)),t=Ce.includes(u);if(n){if(d)return e.jsx(U,{aiReason:n,customStyle:null==B?void 0:B.tableAiReasoning,customIcons:be,isHighConfidence:n.relevance_score>=v.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});const l=Fe(i),o="source"!==l.trim().toLowerCase();return e.jsx(v.default,{aiReason:n,isSourceHasHighlight:t,inlineLabel:l,isInlineCitation:o,customIcons:be,customStyles:{aiReasoningContent:null==B?void 0:B.aiReasoningContent,aiReasoningAccordion:null==B?void 0:B.aiReasoningAccordion,aiReasoningMarkdown:null==B?void 0:B.aiReasoningMarkdown,aiReasoningPill:null==B?void 0:B.aiReasoningPill,webCitation:null==B?void 0:B.webCitation,stormeeCitation:null==B?void 0:B.stormeeCitation,waveformCitation:null==B?void 0:B.waveformCitation,imageCitation:null==B?void 0:B.imageCitation,fileCitation:null==B?void 0:B.fileCitation,appModCitation:null==B?void 0:B.appModCitation,rcaCitation:null==B?void 0:B.rcaCitation,readFileCitation:null==B?void 0:B.readFileCitation,loadingCitations:null==B?void 0:B.loadingCitations,chatCitation:null==B?void 0:B.chatCitation,bigEnoughCitation:null==B?void 0:B.bigEnoughCitation}})}}return null},code:({inline:n,children:t,className:i,node:o,...r})=>/language-(\w+)/.exec(i||"")||(null==i?void 0:i.includes("language-"))?e.jsx("div",{children:e.jsx("code",{className:l.default.blockCode,style:null==B?void 0:B.code,children:t})}):e.jsx("code",{className:l.default.inlineCode,style:null==B?void 0:B.code,children:t}),learned:({children:n})=>e.jsx(d.Tooltip,{title:n,placement:"top",children:e.jsx(r.Info,{size:16,className:l.default.learned})}),generatedcode:({node:n,...t})=>{const i=(null==t?void 0:t.language)||"python",l=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const t=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(t).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?t(e.props.children):""};n=t(e.children)}}catch(t){console.error("Error decoding generated code:",t),n=String(e.children)}return n})(t);return e.jsx(c.default,{title:"Generated Code",code:l,language:i,customStyles:{pill:null==B?void 0:B.generatedCodePill,content:null==B?void 0:B.generatedCodeContent}})},updatedsegment:({node:n,children:t,...i})=>{var l,o,r,d;const a=`${null===(l=n.position)||void 0===l?void 0:l.start.line}-${null===(o=n.position)||void 0===o?void 0:o.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(i),c=s?e.jsx("div",{dangerouslySetInnerHTML:{__html:q.default.sanitize(s)}}):e.jsx("div",{children:t});return e.jsx(j.default,{id:a,node:n,children:c,props:i,segmentComponentConfig:ye,customStyles:B,customIcons:z,extractText:Fe,isUpdatedSegment:!0})},segment:({node:n,children:t,...i})=>{var l,o,r,d;const a=`${null===(l=n.position)||void 0===l?void 0:l.start.line}-${null===(o=n.position)||void 0===o?void 0:o.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e.jsx(j.default,{id:a,node:n,children:t,props:i,segmentComponentConfig:ye,customStyles:B,customIcons:z,extractText:Fe,blockId:oe,storyId:re})}}},[Te,ne,pe,K,$e,x,t,z,me,Ce,B,ye,Ee,_e,De,oe,re,null==Ie?void 0:Ie.negateList]),Be=n.useMemo(()=>{let e=w.escapeTagIds(Oe,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=w.splitTagAcrossParagraphs(e,n,"upt"===n)}),e},[Oe]);return n.useEffect(()=>{if(!se.current)return;if(!me.length)return void Re();let e;if(0===Ce.length||te)requestAnimationFrame(()=>{we([me[xe].replace(/\*/g,"")])});else{const n=se.current,t=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{t.disconnect(),requestAnimationFrame(()=>{we([me[xe].replace(/\*/g,"")])})},50)});t.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[me,Ce,xe,te]),e.jsx(L.Provider,{value:{expandedInfo:ke,setExpanded:Me,reasonToRow:qe},children:e.jsxs("div",{ref:se,className:`${l.default.container} ${"approving"!==p?l.default.wrapper:""} ${P||""}`,style:null==B?void 0:B.container,children:[a?e.jsx(S.MarkdownContextProvider,{children:e.jsx(k.default,{components:We,rehypePlugins:[A.default],children:Be})}):i,Ue>0&&ie&&e.jsx("div",{className:l.default.confidenceScoreContainer,style:null==B?void 0:B.confidenceScoreContainer,children:e.jsxs("span",{className:l.default.confidenceScore,style:null==B?void 0:B.confidenceScore,children:[e.jsx(f.default,{size:14,color:(null==B?void 0:B.confidenceScoreIconColor)||"#166534"}),Ue,"%"]})}),M&&e.jsx("div",{className:l.default.citationLoader,style:null==B?void 0:B.citationLoaderContainer,children:e.jsx(u.default,{customStyles:{container:null==B?void 0:B.citationLoadingContainer,icon:null==B?void 0:B.citationLoadingIcon,text:null==B?void 0:B.citationLoadingText}})}),h&&e.jsx("div",{style:{...null===(ae=null==B?void 0:B.attachedContext)||void 0===ae?void 0:ae.wrapper},className:"flex mt-5",children:e.jsx(C.default,{customStyles:null==B?void 0:B.attachedContext,variant:G})})]})})},exports.splitNestedDiffNodes=Q;
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode('.UserStoryWithCitation-module_container__YRdbR{box-sizing:border-box;position:relative;width:100%}.UserStoryWithCitation-module_wrapper__wbnqg{border:1px solid #d5d5d5;border-radius:16px;padding:20px}.UserStoryWithCitation-module_heading1__KsWUO{color:#000;font-family:Inter,sans-serif;font-size:1.5rem;margin:.75rem 0 .25rem;padding:0}.UserStoryWithCitation-module_heading2__GHshw{color:#000;font-family:Inter,sans-serif;font-size:1.25rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_heading3__Jm9Xb{color:#000;font-family:Inter,sans-serif;font-size:1.125rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_bold__HenfX{font-family:Inter,sans-serif;font-weight:700}.UserStoryWithCitation-module_paragraph__a1-pc{word-wrap:break-word;display:block;flex-wrap:wrap;font-family:Inter,sans-serif;font-size:1rem;line-height:1.75rem;margin:0;max-width:100%;overflow:hidden;overflow:visible;overflow-wrap:break-word;text-align:justify;white-space:normal;word-break:break-word}.UserStoryWithCitation-module_orderedList__E5PQa{font-family:Inter,sans-serif;list-style-type:decimal;margin-left:1rem}.UserStoryWithCitation-module_unorderedList__SFvpc{font-family:Inter,sans-serif;list-style-type:disc;margin-left:1rem}.UserStoryWithCitation-module_inlineCode__5014y{background-color:#d633840d;border-radius:.3rem;box-sizing:border-box;color:#d63384;font-family:Source Code Pro,monospace;font-size:.95em;overflow-wrap:break-word;padding:.2rem .5rem;white-space:pre-wrap;width:100%;word-break:break-word}.UserStoryWithCitation-module_blockCode__pmHG5{color:#d63384;display:block;overflow:hidden;white-space:pre-wrap;word-break:break-words}.UserStoryWithCitation-module_learned__0US6d{color:#3b82f6;cursor:pointer;display:inline-block;margin-left:.25rem;margin-right:.25rem}.UserStoryWithCitation-module_linkText__5kBNv:hover{color:#1d4ed8}.UserStoryWithCitation-module_tableWrapper__r94Fx{box-sizing:border-box;max-width:100%;overflow-x:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd{border-collapse:collapse;box-sizing:border-box;margin:20px 0;table-layout:fixed;width:100%}.UserStoryWithCitation-module_scrollContainer__S-BtW{overflow:hidden}.UserStoryWithCitation-module_citationLoader__Op7Sm{bottom:0;left:0;margin-top:12px}.UserStoryWithCitation-module_aiReasoningButton__-tprH{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;gap:2px;padding:2px 4px;vertical-align:middle}.UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6{color:#4b5563;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz{color:#cf4343;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_confidenceScoreContainer__zOE-E{position:absolute;right:12px;top:12px;z-index:10}.UserStoryWithCitation-module_confidenceScore__lhT4p{align-items:center;background-color:#f0fdf4;border:1px solid #bbf7d0;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#166534;display:inline-flex;font-family:Inter,sans-serif;font-size:12px;font-weight:700;gap:4px;padding:4px 8px}.UserStoryWithCitation-module_orderedList__E5PQa{counter-reset:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa>li{counter-increment:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:childItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:childItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:grandchildItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:grandchildItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) "." counter(grandchildItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_inserted__66gBL{background-color:#8cbeff}.UserStoryWithCitation-module_deleted__mzR4t{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}.UserStoryWithCitation-module_preserved__ND8uC{background-color:#fff;text-decoration:underline;text-decoration-color:#d3d3d3}[class*=_upt-]>[class*=_inserted_]{background-color:#f3e8ff}[class^=_manual-]>[class^=_inserted_]{background-color:#8cbeff}'));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"UserStoryWithCitation-module_container__YRdbR",wrapper:"UserStoryWithCitation-module_wrapper__wbnqg",heading1:"UserStoryWithCitation-module_heading1__KsWUO",heading2:"UserStoryWithCitation-module_heading2__GHshw",heading3:"UserStoryWithCitation-module_heading3__Jm9Xb",bold:"UserStoryWithCitation-module_bold__HenfX",paragraph:"UserStoryWithCitation-module_paragraph__a1-pc",orderedList:"UserStoryWithCitation-module_orderedList__E5PQa",unorderedList:"UserStoryWithCitation-module_unorderedList__SFvpc",inlineCode:"UserStoryWithCitation-module_inlineCode__5014y",blockCode:"UserStoryWithCitation-module_blockCode__pmHG5",learned:"UserStoryWithCitation-module_learned__0US6d",linkText:"UserStoryWithCitation-module_linkText__5kBNv",tableWrapper:"UserStoryWithCitation-module_tableWrapper__r94Fx",table:"UserStoryWithCitation-module_table__tEyKd",scrollContainer:"UserStoryWithCitation-module_scrollContainer__S-BtW",citationLoader:"UserStoryWithCitation-module_citationLoader__Op7Sm",aiReasoningButton:"UserStoryWithCitation-module_aiReasoningButton__-tprH",aiReasoningIconHighConfidence:"UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6",aiReasoningIconLowConfidence:"UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz",confidenceScoreContainer:"UserStoryWithCitation-module_confidenceScoreContainer__zOE-E",confidenceScore:"UserStoryWithCitation-module_confidenceScore__lhT4p",inserted:"UserStoryWithCitation-module_inserted__66gBL",deleted:"UserStoryWithCitation-module_deleted__mzR4t",preserved:"UserStoryWithCitation-module_preserved__ND8uC"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const e=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode('.UserStoryWithCitation-module_container__YRdbR{box-sizing:border-box;position:relative;width:100%}.UserStoryWithCitation-module_wrapper__wbnqg{border:1px solid #d5d5d5;border-radius:16px;padding:20px}.UserStoryWithCitation-module_heading1__KsWUO{color:#000;font-family:Inter,sans-serif;font-size:1.5rem;margin:.75rem 0 .25rem;padding:0}.UserStoryWithCitation-module_heading2__GHshw{color:#000;font-family:Inter,sans-serif;font-size:1.25rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_heading3__Jm9Xb{color:#000;font-family:Inter,sans-serif;font-size:1.125rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_bold__HenfX{font-family:Inter,sans-serif;font-weight:700}.UserStoryWithCitation-module_paragraph__a1-pc{word-wrap:break-word;display:block;flex-wrap:wrap;font-family:Inter,sans-serif;font-size:1rem;line-height:1.75rem;margin:0;max-width:100%;overflow:hidden;overflow:visible;overflow-wrap:break-word;text-align:justify;white-space:normal;word-break:break-word}.UserStoryWithCitation-module_orderedList__E5PQa{font-family:Inter,sans-serif;list-style-type:decimal;margin-left:1rem}.UserStoryWithCitation-module_unorderedList__SFvpc{font-family:Inter,sans-serif;list-style-type:disc;margin-left:1rem}.UserStoryWithCitation-module_inlineCode__5014y{background-color:#f0f2f5;border-radius:.3rem;box-sizing:border-box;color:#323232;font-family:Source Code Pro,monospace;font-size:.95em;overflow-wrap:break-word;padding:.2rem .5rem;white-space:pre-wrap;width:100%;word-break:break-word}.UserStoryWithCitation-module_blockCode__pmHG5{color:#d63384;display:block;overflow:hidden;white-space:pre-wrap;word-break:break-words}.UserStoryWithCitation-module_learned__0US6d{color:#3b82f6;cursor:pointer;display:inline-block;margin-left:.25rem;margin-right:.25rem}.UserStoryWithCitation-module_linkText__5kBNv:hover{color:#1d4ed8}.UserStoryWithCitation-module_tableWrapper__r94Fx{-webkit-overflow-scrolling:touch;box-sizing:border-box;margin:16px 0;max-width:100%;overflow-x:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd{border:1px solid #d1d5db;border-collapse:collapse;box-sizing:border-box;font-family:Inter,sans-serif;font-size:.95rem;line-height:1.45rem;margin:0;min-width:100%;table-layout:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd td,.UserStoryWithCitation-module_table__tEyKd th{border:1px solid #d1d5db;color:#111827;overflow-wrap:break-word;padding:8px 10px;vertical-align:top;white-space:normal;word-break:normal}.UserStoryWithCitation-module_table__tEyKd th{background:#f3f4f6;font-weight:700;white-space:nowrap}.UserStoryWithCitation-module_table__tEyKd td[align=center],.UserStoryWithCitation-module_table__tEyKd th[align=center]{text-align:center}.UserStoryWithCitation-module_table__tEyKd td[align=right],.UserStoryWithCitation-module_table__tEyKd th[align=right]{text-align:right}.UserStoryWithCitation-module_table__tEyKd tr:nth-child(2n) td{background:#fafafa}.UserStoryWithCitation-module_table__tEyKd p{margin:0}.UserStoryWithCitation-module_scrollContainer__S-BtW{overflow:hidden}.UserStoryWithCitation-module_citationLoader__Op7Sm{bottom:0;left:0;margin-top:12px}.UserStoryWithCitation-module_aiReasoningButton__-tprH{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;gap:2px;padding:2px 4px;vertical-align:middle}.UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6{color:#4b5563;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz{color:#cf4343;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_confidenceScoreContainer__zOE-E{position:absolute;right:12px;top:12px;z-index:10}.UserStoryWithCitation-module_confidenceScore__lhT4p{align-items:center;background-color:#f0fdf4;border:1px solid #bbf7d0;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#166534;display:inline-flex;font-family:Inter,sans-serif;font-size:12px;font-weight:700;gap:4px;padding:4px 8px}.UserStoryWithCitation-module_orderedList__E5PQa{counter-reset:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa>li{counter-increment:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:childItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:childItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:grandchildItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:grandchildItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) "." counter(grandchildItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_inserted__66gBL{background-color:#8cbeff}.UserStoryWithCitation-module_deleted__mzR4t{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}.UserStoryWithCitation-module_preserved__ND8uC{background-color:#fff;text-decoration:underline;text-decoration-color:#d3d3d3}[class*=_upt-]>[class*=_inserted_]{background-color:#f3e8ff}[class^=_manual-]>[class^=_inserted_]{background-color:#8cbeff}.UserStoryWithCitation-module_negatedOrderedList__RZDGe,.UserStoryWithCitation-module_negatedUnorderedList__ZTOPu{margin:0;padding:0}.UserStoryWithCitation-module_negatedListItem__pcJY9{display:block;margin:0;padding:0}.UserStoryWithCitation-module_negatedListMarker__yWtUn{display:inline;font:inherit}.UserStoryWithCitation-module_negatedListItem__pcJY9>p:first-of-type{display:inline;margin:0}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span{display:inline!important;margin:0!important;width:auto!important}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span>span:not([class*=_hoverActions_]){display:inline!important;width:auto!important}'));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(t)}(),exports.default={container:"UserStoryWithCitation-module_container__YRdbR",wrapper:"UserStoryWithCitation-module_wrapper__wbnqg",heading1:"UserStoryWithCitation-module_heading1__KsWUO",heading2:"UserStoryWithCitation-module_heading2__GHshw",heading3:"UserStoryWithCitation-module_heading3__Jm9Xb",bold:"UserStoryWithCitation-module_bold__HenfX",paragraph:"UserStoryWithCitation-module_paragraph__a1-pc",orderedList:"UserStoryWithCitation-module_orderedList__E5PQa",unorderedList:"UserStoryWithCitation-module_unorderedList__SFvpc",inlineCode:"UserStoryWithCitation-module_inlineCode__5014y",blockCode:"UserStoryWithCitation-module_blockCode__pmHG5",learned:"UserStoryWithCitation-module_learned__0US6d",linkText:"UserStoryWithCitation-module_linkText__5kBNv",tableWrapper:"UserStoryWithCitation-module_tableWrapper__r94Fx",table:"UserStoryWithCitation-module_table__tEyKd",scrollContainer:"UserStoryWithCitation-module_scrollContainer__S-BtW",citationLoader:"UserStoryWithCitation-module_citationLoader__Op7Sm",aiReasoningButton:"UserStoryWithCitation-module_aiReasoningButton__-tprH",aiReasoningIconHighConfidence:"UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6",aiReasoningIconLowConfidence:"UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz",confidenceScoreContainer:"UserStoryWithCitation-module_confidenceScoreContainer__zOE-E",confidenceScore:"UserStoryWithCitation-module_confidenceScore__lhT4p",inserted:"UserStoryWithCitation-module_inserted__66gBL",deleted:"UserStoryWithCitation-module_deleted__mzR4t",preserved:"UserStoryWithCitation-module_preserved__ND8uC",negatedOrderedList:"UserStoryWithCitation-module_negatedOrderedList__RZDGe",negatedUnorderedList:"UserStoryWithCitation-module_negatedUnorderedList__ZTOPu",negatedListItem:"UserStoryWithCitation-module_negatedListItem__pcJY9",negatedListMarker:"UserStoryWithCitation-module_negatedListMarker__yWtUn"};
2
2
  //# sourceMappingURL=UserStoryWithCitation.module.css.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("@mui/material"),n=require("../../../utils/css.utils.js"),i=require("./InlineUpdatedComponent.module.css.js"),o=require("../../../icons/CognitiveDecision.js"),t=require("lucide-react"),r=require("react");exports.default=({aiReason:d,children:s,customStyles:a,handleClickCognitiveDecision:u,handleClickUpdatedPill:c,handleClickOutputValue:v,customIcons:p,CDNeededInChip:f=!0,showWaitingIconInChip:g=!1,showChip:h,status:m})=>{var x,j,C,y,w,b,k,D,N,P,_,I,S,T,q,O,W,$,z;const L=r.useRef(null),R=r.useRef(null),[E,A]=r.useState(null),F=r.useCallback(()=>{var e;const l=R.current,n=(null===(e=L.current)||void 0===e?void 0:e.offsetParent)||(null==l?void 0:l.offsetParent);if(!(l&&n instanceof HTMLElement))return;const i=l.getBoundingClientRect(),o=n.getBoundingClientRect(),t=i.top-o.top+i.height/2;A(e=>null!==e&&Math.abs(e-t)<.5?e:t)},[]);r.useLayoutEffect(()=>{F()}),r.useLayoutEffect(()=>{var e,l;if("undefined"==typeof window)return;const n=window.requestAnimationFrame(F);window.addEventListener("resize",F);const i="undefined"!=typeof ResizeObserver?new ResizeObserver(F):null;R.current&&(null==i||i.observe(R.current));const o=(null===(e=L.current)||void 0===e?void 0:e.offsetParent)||(null===(l=R.current)||void 0===l?void 0:l.offsetParent);return o instanceof HTMLElement&&(null==i||i.observe(o)),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",F),null==i||i.disconnect()}},[F]);const M="pending"!==m?"#303030":null===(C=null===(j=null===(x=d.redlining_details)||void 0===x?void 0:x.evaluation_outputs)||void 0===j?void 0:j.metadata)||void 0===C?void 0:C.label_color,U={color:M||"#000000",background:n.hexToOpacity(M||"#000000",25),border:`1px solid ${n.hexToOpacity(M||"#000000",75)}`},H=M||"#000000",B=n.hexToOpacity(M||"#000000",25),V={background:n.hexToOpacity(M||"#000000",75),...null==a?void 0:a.dividerStyle};let X=null;"accepted"===m?X=null!==(y=null==p?void 0:p.accepted)&&void 0!==y?y:e.jsx(t.Check,{color:"#16A34A"}):"rejected"===m?X=null!==(w=null==p?void 0:p.rejected)&&void 0!==w?w:e.jsx(t.X,{color:"#DC2626"}):"reverted"===m&&(X=null!==(b=null==p?void 0:p.reverted)&&void 0!==b?b:e.jsx(t.Undo2,{color:"#475569"}));const G=null===E?{}:{"--inline-update-anchor-top":`${E}px`},J=null===E?"":` ${i.default.anchorAligned}`;return e.jsxs("span",{className:i.default.inlineUpdatedWrapper,children:[h&&e.jsxs(e.Fragment,{children:[X&&e.jsx("span",{className:`${i.default.resolvedStatus}${J}`,style:{...G,...null==a?void 0:a.resolvedIcon},children:X}),e.jsx("span",{ref:L,id:d.id.toString(),onClick:e=>{e.stopPropagation(),null==c||c(e.currentTarget,d)},className:`${i.default.pillWrapper}${J}`,style:{...G,...null==a?void 0:a.pillStyleWrapper},children:e.jsxs("span",{className:i.default.pillComponent,style:{...U,...null===(k=null==a?void 0:a.pillComponent)||void 0===k?void 0:k.commonStyle},children:[e.jsx("span",{children:(null===(P=null===(N=null===(D=d.redlining_details)||void 0===D?void 0:D.evaluation_outputs)||void 0===N?void 0:N.metadata)||void 0===P?void 0:P.label_text)||""}),e.jsx(l.Divider,{className:i.default.dividerStyle,style:V}),g&&"pending"===m&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:i.default.waitingIconWrapper,style:{color:M},title:"Waiting",children:e.jsx(t.Hourglass,{size:16})}),e.jsx(l.Divider,{className:i.default.dividerStyle,style:V})]}),e.jsx("span",{className:i.default["output-container"],onClick:e=>{v&&(e.stopPropagation(),null==v||v(e.currentTarget,d))},children:d.resolving?e.jsx(l.CircularProgress,{size:(null===(_=null==a?void 0:a.loader)||void 0===_?void 0:_.size)||18,"aria-label":"Loading…",sx:{color:(null===(I=null==a?void 0:a.loader)||void 0===I?void 0:I.color)||M}}):"pending"!==m?X:null===(T=null===(S=null==d?void 0:d.redlining_details)||void 0===S?void 0:S.evaluation_outputs)||void 0===T?void 0:T.output_value}),f&&e.jsxs(e.Fragment,{children:[e.jsx(l.Divider,{className:i.default.dividerStyle,style:V}),e.jsx("span",{onClick:e=>{e.stopPropagation(),null==u||u(e.currentTarget,d)},className:i.default.cognitiveDecisionWrapper,style:null===(q=null==a?void 0:a.cognitiveDecisionIcon)||void 0===q?void 0:q.wrapper,children:e.jsx(o.default,{color:(null===(O=null==a?void 0:a.cognitiveDecisionIcon)||void 0===O?void 0:O.color)||H,backgroundColor:(null===(W=null==a?void 0:a.cognitiveDecisionIcon)||void 0===W?void 0:W.backgroundColor)||B})}),e.jsx("span",{className:i.default.chevronWrapper,style:null===($=null==a?void 0:a.Chevron)||void 0===$?void 0:$.wrapper,children:e.jsx(t.ChevronDown,{color:(null===(z=null==a?void 0:a.Chevron)||void 0===z?void 0:z.color)||M})})]})]})})]}),e.jsx("span",{ref:R,className:i.default[`upt-${m}`],onClick:e=>{e.preventDefault(),e.stopPropagation(),L.current&&(null==c||c(L.current,d))},children:s})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("@mui/material"),n=require("../../../utils/css.utils.js"),i=require("./InlineUpdatedComponent.module.css.js"),o=require("../../../icons/CognitiveDecision.js"),t=require("lucide-react"),r=require("react");exports.default=({aiReason:d,children:a,customStyles:s,handleClickCognitiveDecision:u,handleClickUpdatedPill:c,handleClickOutputValue:v,customIcons:p,CDNeededInChip:f=!0,showWaitingIconInChip:g=!1,showChip:h,status:m,containerRef:x})=>{var j,y,C,w,b,k,D,N,S,I,P,_,q,R,T,O,W,$,z;const A=r.useRef(null),L=r.useRef(null),[E,F]=r.useState(null),M=r.useCallback(()=>{var e;const l=L.current,n=(null===(e=A.current)||void 0===e?void 0:e.offsetParent)||(null==l?void 0:l.offsetParent);if(!(l&&n instanceof HTMLElement))return;const i=l.getBoundingClientRect(),o=n.getBoundingClientRect(),t=i.top-o.top+i.height/2;F(e=>null!==e&&Math.abs(e-t)<.5?e:t)},[]);r.useLayoutEffect(()=>{M()}),r.useLayoutEffect(()=>{var e,l;if("undefined"==typeof window)return;const n=window.requestAnimationFrame(M);window.addEventListener("resize",M);const i="undefined"!=typeof ResizeObserver?new ResizeObserver(M):null;L.current&&(null==i||i.observe(L.current));const o=(null===(e=A.current)||void 0===e?void 0:e.offsetParent)||(null===(l=L.current)||void 0===l?void 0:l.offsetParent);return o instanceof HTMLElement&&(null==i||i.observe(o)),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",M),null==i||i.disconnect()}},[M]);const U="pending"!==m?"#303030":null===(C=null===(y=null===(j=d.redlining_details)||void 0===j?void 0:j.evaluation_outputs)||void 0===y?void 0:y.metadata)||void 0===C?void 0:C.label_color,H={color:U||"#000000",background:n.hexToOpacity(U||"#000000",25),border:`1px solid ${n.hexToOpacity(U||"#000000",75)}`},B=U||"#000000",V=n.hexToOpacity(U||"#000000",25),X={background:n.hexToOpacity(U||"#000000",75),...null==s?void 0:s.dividerStyle};let G=null;"accepted"===m?G=null!==(w=null==p?void 0:p.accepted)&&void 0!==w?w:e.jsx(t.Check,{color:"#16A34A"}):"rejected"===m?G=null!==(b=null==p?void 0:p.rejected)&&void 0!==b?b:e.jsx(t.X,{color:"#DC2626"}):"reverted"===m&&(G=null!==(k=null==p?void 0:p.reverted)&&void 0!==k?k:e.jsx(t.Undo2,{color:"#475569"}));const J=null===E?{}:{"--inline-update-anchor-top":`${E}px`},K=null===E?"":` ${i.default.anchorAligned}`;return e.jsxs("span",{className:i.default.inlineUpdatedWrapper,children:[h&&e.jsxs(e.Fragment,{children:[G&&e.jsx("span",{className:`${i.default.resolvedStatus}${K}`,style:{...J,...null==s?void 0:s.resolvedIcon},children:G}),e.jsx("span",{ref:A,id:d.id.toString(),"data-ai-reason-id":d.id.toString(),onClick:e=>{e.stopPropagation(),null==c||c(e.currentTarget,d)},className:`${i.default.pillWrapper}${K}`,style:{...J,...null==s?void 0:s.pillStyleWrapper},children:e.jsxs("span",{className:i.default.pillComponent,style:{...H,...null===(D=null==s?void 0:s.pillComponent)||void 0===D?void 0:D.commonStyle},children:[e.jsx("span",{children:(null===(I=null===(S=null===(N=d.redlining_details)||void 0===N?void 0:N.evaluation_outputs)||void 0===S?void 0:S.metadata)||void 0===I?void 0:I.label_text)||""}),e.jsx(l.Divider,{className:i.default.dividerStyle,style:X}),g&&"pending"===m&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:i.default.waitingIconWrapper,style:{color:U},title:"Waiting",children:e.jsx(t.Hourglass,{size:16})}),e.jsx(l.Divider,{className:i.default.dividerStyle,style:X})]}),e.jsx("span",{className:i.default["output-container"],onClick:e=>{v&&(e.stopPropagation(),null==v||v(e.currentTarget,d))},children:d.resolving?e.jsx(l.CircularProgress,{size:(null===(P=null==s?void 0:s.loader)||void 0===P?void 0:P.size)||18,"aria-label":"Loading…",sx:{color:(null===(_=null==s?void 0:s.loader)||void 0===_?void 0:_.color)||U}}):"pending"!==m?G:null===(R=null===(q=null==d?void 0:d.redlining_details)||void 0===q?void 0:q.evaluation_outputs)||void 0===R?void 0:R.output_value}),f&&e.jsxs(e.Fragment,{children:[e.jsx(l.Divider,{className:i.default.dividerStyle,style:X}),e.jsx("span",{onClick:e=>{e.stopPropagation(),null==u||u(e.currentTarget,d)},className:i.default.cognitiveDecisionWrapper,style:null===(T=null==s?void 0:s.cognitiveDecisionIcon)||void 0===T?void 0:T.wrapper,children:e.jsx(o.default,{color:(null===(O=null==s?void 0:s.cognitiveDecisionIcon)||void 0===O?void 0:O.color)||B,backgroundColor:(null===(W=null==s?void 0:s.cognitiveDecisionIcon)||void 0===W?void 0:W.backgroundColor)||V})}),e.jsx("span",{className:i.default.chevronWrapper,style:null===($=null==s?void 0:s.Chevron)||void 0===$?void 0:$.wrapper,children:e.jsx(t.ChevronDown,{color:(null===(z=null==s?void 0:s.Chevron)||void 0===z?void 0:z.color)||U})})]})]})})]}),e.jsx("span",{ref:L,className:i.default[`upt-${m}`],onClick:e=>{var l,n,i;e.preventDefault(),e.stopPropagation();const o=d.id.toString(),t=null!==(l=A.current)&&void 0!==l?l:Array.from(null!==(i=null===(n=x.current)||void 0===n?void 0:n.querySelectorAll("[data-ai-reason-id]"))&&void 0!==i?i:[]).find(e=>e.dataset.aiReasonId===o);t&&(null==c||c(t,d))},children:a})]})};
2
2
  //# sourceMappingURL=InlineUpdatedComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),i=require("../utils/proccess-stream.utils.js");exports.useStreamContentHandler=function({setUserStory:t,setAiReasoning:o,setUserStoryCitations:n,onStreamingCompleted:r,isGraphQLCallInProgress:s,knowledgeBase:a,projectAnalyserSummary:u,dataSourceFiles:l,aiReasoning:c,setRedisValue:d,fetchCitationByBlock:_}){const p=e.useRef(new Set),m=e.useRef(new Set),g=e.useRef(null),b=e.useRef(null),v=e.useRef({gap_items_prompt:"",risk_items_prompt:""}),f=e.useRef(new Set);async function h(e,i,t){var a,u;let l="",c="";try{const r=await _(e,t,i);o(e=>{var i;const t=[...e];return null===(i=r.response.ai_reasonings)||void 0===i||i.forEach(e=>{const i=t.findIndex(i=>i.id===e.id);-1!==i&&e.gap.length>0&&e.reason.length>0&&(t[i]={...e})}),t}),l=(null===(a=r.response)||void 0===a?void 0:a.gap_items_prompt)||"",c=(null===(u=r.response)||void 0===u?void 0:u.risk_items_prompt)||"",(l||c)&&(v.current={gap_items_prompt:l,risk_items_prompt:c}),n(e=>{var i,t,o,n,s,a,u,l,c,d,_,p,m,g;return{...e,appmod_citations:[...null!==(i=e.appmod_citations)&&void 0!==i?i:[],...null!==(t=r.response.appmod_citations)&&void 0!==t?t:[]],audio_citations:[...null!==(o=e.audio_citations)&&void 0!==o?o:[],...null!==(n=r.response.audio_citations)&&void 0!==n?n:[]],file_citations:[...null!==(s=e.file_citations)&&void 0!==s?s:[],...null!==(a=r.response.file_citations)&&void 0!==a?a:[]],image_citations:[...null!==(u=e.image_citations)&&void 0!==u?u:[],...null!==(l=r.response.image_citations)&&void 0!==l?l:[]],rca_citations:[...null!==(c=e.rca_citations)&&void 0!==c?c:[],...null!==(d=r.response.rca_citations)&&void 0!==d?d:[]],web_citations:[...null!==(_=e.web_citations)&&void 0!==_?_:[],...null!==(p=r.response.web_citations)&&void 0!==p?p:[]],readfile_citations:[...null!==(m=e.readfile_citations)&&void 0!==m?m:[],...null!==(g=r.response.readfile_citations)&&void 0!==g?g:[]]}})}catch(i){console.error("[liblogs] processCitationsByBlock error — story:%s block:%s",e.storyNumber,e.blockNumber,i)}finally{let i=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}`;if(m.current.add(i),m.current.size===p.current.size&&!s.current){const e=l||v.current.gap_items_prompt,i=c||v.current.risk_items_prompt;await r(e,i),p.current.clear(),m.current.clear(),g.current=null,b.current=null,v.current={gap_items_prompt:"",risk_items_prompt:""},f.current.clear()}}}return{processStreamContent:function(e,r,s){try{const _=JSON.stringify(e);if(b.current===_)return;b.current=_;let m=[],v=[];e=e.map(e=>{var t;const o=`${(e={...e,subBlockNumber:null!==(t=e.subBlockNumber)&&void 0!==t?t:"1"}).storyNumber}-${e.blockNumber}-${e.subBlockNumber}`;if(f.current.has(o))return null;f.current.add(o);let{outputText:s,reasonings:a,gpt_citation:u,processedDescription:l}=i.processAIReasoningFromBlocks(e.value,e.blockNumber,e.storyNumber,e.description);n(e=>{var i;return u.length>0&&((null==e?void 0:e.gpt_citations)||(e.gpt_citations=[]),null===(i=e.gpt_citations)||void 0===i||i.push(...u)),{...e}}),m.push(...a),v.push([...a]);let c=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}<SUB_BLOCK>${e.subBlockNumber}`;return p.current.has(c)||(h({...e,value:s,description:l},a,r),p.current.add(c)),{...e,value:s,description:l}}).filter(Boolean),m.forEach(e=>{o(i=>(i.find(i=>i.id===e.id)||i.push(e),[...i]))}),e.length>0&&e.map(({title:e,section:i,value:o,storyNumber:n,description:r,blockNumber:_,big_enough:p,big_enough_decision_factors:m,gapValue:b,confidenceScore:f,metadata:h},N)=>{t(t=>{var y,k,R,S,B,$,C,w;const O=t.findIndex(e=>e.storyNumber===n);if("intro"===i)-1===O?t.push({artifactId:`STORY-${n}-${_}`,title:e,value:o,description:r,storyNumber:n,sub_features:[],section:i,blockNumber:_,aiReasoning:v[N],big_enough:p,big_enough_decision_factors:m,gapValue:b,confidenceScore:f,metadata:h}):(t[O].value+=o,t[O].aiReasoning=t[O].aiReasoning||[],null===(k=null===(y=t[O])||void 0===y?void 0:y.aiReasoning)||void 0===k||k.push(...v[N]),t[O].big_enough=p,t[O].big_enough_decision_factors=m,t[O].gapValue=b,t[O].confidenceScore=f,t[O].metadata=h);else{t[O].sub_features||(t[O].sub_features=[]);const r=(null===(S=null===(R=t[O])||void 0===R?void 0:R.sub_features)||void 0===S?void 0:S.findIndex(e=>e.blockNumber===_))||-1;if(-1===r)null===($=null===(B=t[O])||void 0===B?void 0:B.sub_features)||void 0===$||$.push({artifactId:`STORY-${n}-${_}`,title:e,value:o,storyNumber:n,blockNumber:_,section:i,aiReasoning:v[N],big_enough:p,big_enough_decision_factors:m,gapValue:b,confidenceScore:f,metadata:h});else{let e=null===(w=null===(C=null==t?void 0:t[O])||void 0===C?void 0:C.sub_features)||void 0===w?void 0:w[r];e.value=(e.value||"")+o,e.aiReasoning=e.aiReasoning||[],e.aiReasoning.push(...v[N]),e.big_enough=p,e.big_enough_decision_factors=m,e.gapValue=b,e.confidenceScore=f,e.metadata=h}}const E=JSON.stringify(t);return g.current!==E&&(d({key:`streaming-redis-key-${s}`,value:{mmvf_list:t,knowledgeBase:a,projectAnalyserSummary:u,dataSources_files:l,ai_reasonings:c}}),g.current=E),[...t]})})}catch(e){console.error("Error in processing Stream Content",e)}}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../utils/proccess-stream.utils.js");exports.useStreamContentHandler=function({setUserStory:i,setAiReasoning:o,setUserStoryCitations:n,onStreamingCompleted:r,isGraphQLCallInProgress:s,knowledgeBase:a,projectAnalyserSummary:l,dataSourceFiles:u,aiReasoning:c,setRedisValue:d,fetchCitationByBlock:p}){const[_,m]=e.useState({finalGap:"",finalRisk:"",status:"in-progress"}),f=e.useRef(new Set),g=e.useRef(new Set),b=e.useRef(null),v=e.useRef(null),h=e.useRef({gap_items_prompt:"",risk_items_prompt:""}),k=e.useRef(new Set);return e.useEffect(()=>{"complete"!==_.status||s||(r(_.finalGap,_.finalRisk),f.current.clear(),g.current.clear(),b.current=null,v.current=null,h.current={gap_items_prompt:"",risk_items_prompt:""},k.current.clear(),m({finalGap:"",finalRisk:"",status:"in-progress"}))},[_,s]),{processStreamContent:function(e,r,s){try{const _=JSON.stringify(e);if(v.current===_)return;v.current=_;let y=[],R=[];e=e.map(e=>{var i;const s=`${(e={...e,subBlockNumber:null!==(i=e.subBlockNumber)&&void 0!==i?i:"1"}).storyNumber}-${e.blockNumber}-${e.subBlockNumber}`;if(k.current.has(s))return null;k.current.add(s);let{outputText:a,reasonings:l,gpt_citation:u,processedDescription:c}=t.processAIReasoningFromBlocks(e.value,e.blockNumber,e.storyNumber,e.description);n(e=>{var t;return u.length>0&&((null==e?void 0:e.gpt_citations)||(e.gpt_citations=[]),null===(t=e.gpt_citations)||void 0===t||t.push(...u)),{...e}}),y.push(...l),R.push([...l]);const d=l.filter(e=>e.on_demand).flatMap(e=>[...e.reason.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g),...e.gap.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g)].map(e=>{const[t,i]=e[1].split("$");return"book_citation_doc"!==t&&"book_citation_pdf"!==t&&"document_citation"!==t?null:{citation_number:i,customMetadata:{type:"document_citation"===t?"book_citation_pdf":t,file_name:"",fileType:"",gcs_upload_url:""}}}).filter(Boolean));d.length&&n(e=>{var t;return{...e,file_citations:[...null!==(t=e.file_citations)&&void 0!==t?t:[],...d]}});let _=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}<SUB_BLOCK>${e.subBlockNumber}`;return f.current.has(_)||(!async function(e,t,i){var r,s;let a="",l="";try{const u=await p(e,i,t);o(e=>{var t;const i=[...e];return null===(t=u.response.ai_reasonings)||void 0===t||t.forEach(e=>{const t=i.findIndex(t=>t.id===e.id);-1!==t&&e.gap.length>0&&e.reason.length>0&&(i[t]={...e})}),i}),a=(null===(r=u.response)||void 0===r?void 0:r.gap_items_prompt)||"",l=(null===(s=u.response)||void 0===s?void 0:s.risk_items_prompt)||"",(a||l)&&(h.current={gap_items_prompt:a,risk_items_prompt:l}),n(e=>{var t,i,o,n,r,s,a,l,c,d,p,_,m,f;return{...e,appmod_citations:[...null!==(t=e.appmod_citations)&&void 0!==t?t:[],...null!==(i=u.response.appmod_citations)&&void 0!==i?i:[]],audio_citations:[...null!==(o=e.audio_citations)&&void 0!==o?o:[],...null!==(n=u.response.audio_citations)&&void 0!==n?n:[]],file_citations:[...null!==(r=e.file_citations)&&void 0!==r?r:[],...null!==(s=u.response.file_citations)&&void 0!==s?s:[]],image_citations:[...null!==(a=e.image_citations)&&void 0!==a?a:[],...null!==(l=u.response.image_citations)&&void 0!==l?l:[]],rca_citations:[...null!==(c=e.rca_citations)&&void 0!==c?c:[],...null!==(d=u.response.rca_citations)&&void 0!==d?d:[]],web_citations:[...null!==(p=e.web_citations)&&void 0!==p?p:[],...null!==(_=u.response.web_citations)&&void 0!==_?_:[]],readfile_citations:[...null!==(m=e.readfile_citations)&&void 0!==m?m:[],...null!==(f=u.response.readfile_citations)&&void 0!==f?f:[]]}})}catch(t){console.error("[liblogs] processCitationsByBlock error — story:%s block:%s",e.storyNumber,e.blockNumber,t)}finally{let t=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}`;if(g.current.add(t),g.current.size===f.current.size){const e=a||h.current.gap_items_prompt,t=l||h.current.risk_items_prompt;m({finalGap:e,finalRisk:t,status:"complete"})}}}({...e,value:a,description:c},l,r),f.current.add(_)),{...e,value:a,description:c}}).filter(Boolean),y.forEach(e=>{o(t=>(t.find(t=>t.id===e.id)||t.push(e),[...t]))}),e.length>0&&e.map(({title:e,section:t,value:o,storyNumber:n,description:r,blockNumber:p,big_enough:_,big_enough_decision_factors:m,gapValue:f,confidenceScore:g,metadata:v},h)=>{i(i=>{var k,y,N,S,B,$,C,O;const w=i.findIndex(e=>e.storyNumber===n);if("intro"===t)-1===w?i.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,description:r,storyNumber:n,sub_features:[],section:t,blockNumber:p,aiReasoning:R[h],big_enough:_,big_enough_decision_factors:m,gapValue:f,confidenceScore:g,metadata:v}):(i[w].value+=o,i[w].aiReasoning=i[w].aiReasoning||[],null===(y=null===(k=i[w])||void 0===k?void 0:k.aiReasoning)||void 0===y||y.push(...R[h]),i[w].big_enough=_,i[w].big_enough_decision_factors=m,i[w].gapValue=f,i[w].confidenceScore=g,i[w].metadata=v);else{i[w].sub_features||(i[w].sub_features=[]);const r=(null===(S=null===(N=i[w])||void 0===N?void 0:N.sub_features)||void 0===S?void 0:S.findIndex(e=>e.blockNumber===p))||-1;if(-1===r)null===($=null===(B=i[w])||void 0===B?void 0:B.sub_features)||void 0===$||$.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,storyNumber:n,blockNumber:p,section:t,aiReasoning:R[h],big_enough:_,big_enough_decision_factors:m,gapValue:f,confidenceScore:g,metadata:v});else{let e=null===(O=null===(C=null==i?void 0:i[w])||void 0===C?void 0:C.sub_features)||void 0===O?void 0:O[r];e.value=(e.value||"")+o,e.aiReasoning=e.aiReasoning||[],e.aiReasoning.push(...R[h]),e.big_enough=_,e.big_enough_decision_factors=m,e.gapValue=f,e.confidenceScore=g,e.metadata=v}}const E=JSON.stringify(i);return b.current!==E&&(d({key:`streaming-redis-key-${s}`,value:{mmvf_list:i,knowledgeBase:a,projectAnalyserSummary:l,dataSources_files:u,ai_reasonings:c}}),b.current=E),[...i]})})}catch(e){console.error("Error in processing Stream Content",e)}}}};
2
2
  //# sourceMappingURL=useStreamContentHandler.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.extractAllAiReasoningIds=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return Array.from(r.querySelectorAll('a[href^="ai_reasoning$"]')).map(e=>e.getAttribute("href").replace("ai_reasoning$",""))},exports.formatMarkdown=function(e){try{return e}catch(e){console.error("Error in formatMarkdown",e)}},exports.indentMarkdown=function(e){return e.includes("Acceptance Criteria")?e=null==(e=null==(e=null==(e=null==e?void 0:e.replace(/\\n/g,"\n"))?void 0:e.replace(/(\*\*.+?\*\*)\s*:/g,"\n$1:\n"))?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,(e,r)=>{const n=r.split(".");return`${" ".repeat(n.length-1)}${r}.`}))?void 0:e.replace(/([^\n])\n(?![\n\*#])/g,"$1<br>\n"):e},exports.stripAiReasoningAnchors=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return r.querySelectorAll('a[href^="ai_reasoning$"]').forEach(e=>{e.remove()}),r.body.innerHTML.trim()},exports.stripHtmlAndMetadata=e=>{if(!e)return"";e=(e=(e=(e=(e=e.replace(/%&&%[\s\S]*?%&&%/g,"")).replace(/<!--[\s\S]*?-->/g,"")).replace(/<crredirection[^>]*>[\s\S]*?<\/crredirection>/gi,"")).replace(/<answerExample[^>]*>[\s\S]*?<\/answerExample>/gi,"")).replace(/<a\s+data-cognitive-reasoning[^>]*>[\s\S]*?<\/a>/gi,"");return["b","strong","i","em","u","ol","ul","li","p","div","span","h1","h2","h3","h4","h5","h6","highlight","br","hr"].forEach(r=>{const n=new RegExp(`</?${r}[^>]*>`,"gi");e=e.replace(n,"")}),e=(e=(e=(e=(e=e.replace("ð","")).replace(/\*\*/g,"")).replace(/\n/g," ")).replace(/\s+/g," ")).trim()};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.extractAllAiReasoningIds=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return Array.from(r.querySelectorAll('a[href^="ai_reasoning$"]')).map(e=>e.getAttribute("href").replace("ai_reasoning$",""))},exports.formatMarkdown=function(e){try{return e}catch(e){console.error("Error in formatMarkdown",e)}},exports.getHrefQueryParam=(e="",r)=>{const t=e.split("?")[1]||"";if(!t)return"";try{return new URLSearchParams(t).get(r)||""}catch(e){return console.error("Failed to parse citation href query params",e),""}},exports.guidelineCitationTypes=["rulebook_citation","il_rulebook_citation","rulebook_chunk"],exports.indentMarkdown=function(e){return e.includes("Acceptance Criteria")?e=null==(e=null==(e=null==(e=null==e?void 0:e.replace(/\\n/g,"\n"))?void 0:e.replace(/(\*\*.+?\*\*)\s*:/g,"\n$1:\n"))?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,(e,r)=>{const t=r.split(".");return`${" ".repeat(t.length-1)}${r}.`}))?void 0:e.replace(/([^\n])\n(?![\n\*#])/g,"$1<br>\n"):e},exports.stripAiReasoningAnchors=e=>{const r=(new DOMParser).parseFromString(e,"text/html");return r.querySelectorAll('a[href^="ai_reasoning$"]').forEach(e=>{e.remove()}),r.body.innerHTML.trim()},exports.stripHtmlAndMetadata=e=>{if(!e)return"";e=(e=(e=(e=(e=e.replace(/%&&%[\s\S]*?%&&%/g,"")).replace(/<!--[\s\S]*?-->/g,"")).replace(/<crredirection[^>]*>[\s\S]*?<\/crredirection>/gi,"")).replace(/<answerExample[^>]*>[\s\S]*?<\/answerExample>/gi,"")).replace(/<a\s+data-cognitive-reasoning[^>]*>[\s\S]*?<\/a>/gi,"");return["b","strong","i","em","u","ol","ul","li","p","div","span","h1","h2","h3","h4","h5","h6","highlight","br","hr"].forEach(r=>{const t=new RegExp(`</?${r}[^>]*>`,"gi");e=e.replace(t,"")}),e=(e=(e=(e=(e=e.replace("ð","")).replace(/\*\*/g,"")).replace(/\n/g," ")).replace(/\s+/g," ")).trim()};
2
2
  //# sourceMappingURL=helpers.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});function e(e,t){if(!e)return e;let n="",r=0;for(;;){const o=e.indexOf("<gpt_citation_here ",r);if(-1===o){n+=e.slice(r);break}n+=e.slice(r,o);const i=e.indexOf(">",o);if(-1===i){n+=e.slice(o);break}const s=e.slice(o,i+1),c=s.indexOf("id=");let a="";if(-1!==c){let e=c+3;for("\\"===s[e]&&e++,'"'!==s[e]&&"'"!==s[e]||e++;e<s.length&&/\d/.test(s[e]);)a+=s[e++]}if(a){n+=`<a href="gpt_citation$${`${t}<GPT_CITATION_ID>${a}`}">Source</a>`}r=i+1}return n}function t(e,t){const n=t=>{const n=new RegExp(`<${t}>([\\s\\S]*?)<\\/${t}>`,"gi"),r=[];let o;for(;null!==(o=n.exec(e));)r.push(o[1].trim());return r},r=n("domain"),o=n("paraphrase");return{citation_number:t,customMetadata:{type:"gpt_citation",data_sources:n("data_sources"),training_data_title:r,paraphrase:o}}}exports.extractBlockStreams=e=>{const t=[];try{const n="<BLOCK_STREAM_START>",r="<BLOCK_STREAM_END>";let o=0;for(;;){const i=e.indexOf(n,o);if(-1===i)break;const s=e.indexOf(r,i+n.length);if(-1===s)break;const c=e.slice(i+n.length,s).trim();t.push(JSON.parse(c)),o=s+r.length}}catch(e){console.error("Error in extracting blocks from stream",e)}finally{return t}},exports.extractDescription=function(e){try{const t=/<h2>\s*(?:<b>)?Description(?:<\/b>)?\s*<\/h2>\s*([\s\S]*?)(?=\s*<h2>|$)/i,n=e.match(t);if(n)return n[1].trim()}catch(e){}return null},exports.parseGptCitation=t,exports.processAIReasoningFromBlocks=function(n,r,o,i){const s=[];let c="";const a=[];let l="";console.log("RAW INPUT",JSON.stringify(n),JSON.stringify(i));try{const u=n=>n.replace(/<a\s+(?:(table="true")\s+)?href=(\\"|")ai_reasoning\$(\d+)(\\"|")>([\s\S]*?)<\/a>/g,(n,i,c,l,u,p)=>{var f,d,h,g,_;const b=`${l}<BLOCK_NUMBER>${r}<STORY_NUMBER>${o}`,m=function(e){const t=new Map,n="<gpt_citation ",r="</gpt_citation>";let o=0;for(;;){const i=e.indexOf(n,o);if(-1===i)break;const s=e.indexOf(">",i);if(-1===s)break;const c=e.indexOf(r,s);if(-1===c)break;const a=e.slice(i,c+r.length),l=e.slice(i,s+1),u=l.indexOf("id=");if(-1!==u){let e=u+3;"\\"===l[e]&&e++,'"'!==l[e]&&"'"!==l[e]||e++;let n="";for(;e<l.length&&/\d/.test(l[e]);)n+=l[e++];n&&t.set(n,a)}o=c+r.length}return t}(p);console.log("RAW INPUT",m);const x=p.match(/<reason(?:\s+source="([^"]*)")?>([\s\S]*?)<\/reason>/),$=p.match(/<gap(?:\s+source="([^"]*)")?>([\s\S]*?)<\/gap>/),v=p.match(/<relevance_score>([\s\S]*?)<\/relevance_score>/);let O=(null===(f=null==x?void 0:x[2])||void 0===f?void 0:f.trim())||"",S=(null===(d=null==$?void 0:$[2])||void 0===d?void 0:d.trim())||"";O=e(O,b),S=e(S,b),m.forEach((e,n)=>{const r=`${b}<GPT_CITATION_ID>${n}`;a.push(t(e,r))}),s.push({id:b,reason:O,reasonSource:(null===(h=null==x?void 0:x[1])||void 0===h?void 0:h.trim())||"",gap:S,gapSource:(null===(g=null==$?void 0:$[1])||void 0===g?void 0:g.trim())||"",relevance_score:Number(null===(_=null==v?void 0:v[1])||void 0===_?void 0:_.trim())||0});return`<a ${i?'table="true"':""} href=${c}ai_reasoning$${b}${u}>Source</a>`});c=u(n),i&&(l=u(i))}catch(e){console.error("Error in extracting AI Reasoning from this block:",n)}finally{return{outputText:c,reasonings:s,gpt_citation:a,processedDescription:l}}},exports.processUserStoryValue=(e,t,n)=>{let r=e.includes("<h1><b>Title</b></h1>\n\n")?e:n?`<h1><b>Title</b></h1>\n\n${n} \n${e}`:e;return r=r.includes("<h1><b>Requirement Type</b></h1>\n\n")?r:t?`<h1><b>Requirement Type</b></h1>\n\n${t} \n${r}`:r,r},exports.replaceGptCitation=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=e=>e.replace(/<onDemandCitation\s+type=(?:\\"|")([^"]+)(?:\\"|")\s+citationNo=(?:\\"|")(\d+)(?:\\"|")\s*(?:\/>|><\/onDemandCitation>)/g,(e,t,n)=>`<a href="${t}$${n}?type=on_demand">Source</a>`);function t(e,t){if(!e)return e;let n="",r=0;for(;;){const o=e.indexOf("<gpt_citation_here ",r);if(-1===o){n+=e.slice(r);break}n+=e.slice(r,o);const i=e.indexOf(">",o);if(-1===i){n+=e.slice(o);break}const s=e.slice(o,i+1),c=s.indexOf("id=");let a="";if(-1!==c){let e=c+3;for("\\"===s[e]&&e++,'"'!==s[e]&&"'"!==s[e]||e++;e<s.length&&/\d/.test(s[e]);)a+=s[e++]}if(a){n+=`<a href="gpt_citation$${`${t}<GPT_CITATION_ID>${a}`}">Source</a>`}r=i+1}return n}function n(e,t){const n=t=>{const n=new RegExp(`<${t}>([\\s\\S]*?)<\\/${t}>`,"gi"),r=[];let o;for(;null!==(o=n.exec(e));)r.push(o[1].trim());return r},r=n("domain"),o=n("paraphrase");return{citation_number:t,customMetadata:{type:"gpt_citation",data_sources:n("data_sources"),training_data_title:r,paraphrase:o}}}exports.extractBlockStreams=e=>{const t=[];try{const n="<BLOCK_STREAM_START>",r="<BLOCK_STREAM_END>";let o=0;for(;;){const i=e.indexOf(n,o);if(-1===i)break;const s=e.indexOf(r,i+n.length);if(-1===s)break;const c=e.slice(i+n.length,s).trim();t.push(JSON.parse(c)),o=s+r.length}}catch(e){console.error("Error in extracting blocks from stream",e)}finally{return t}},exports.extractDescription=function(e){try{const t=/<h2>\s*(?:<b>)?Description(?:<\/b>)?\s*<\/h2>\s*([\s\S]*?)(?=\s*<h2>|$)/i,n=e.match(t);if(n)return n[1].trim()}catch(e){}return null},exports.parseGptCitation=n,exports.processAIReasoningFromBlocks=function(r,o,i,s){const c=[];let a="";const l=[];let u="";console.log("RAW INPUT",JSON.stringify(r),JSON.stringify(s));try{const d=r=>r.replace(/<a\s+(?:(table="true")\s+)?href=(\\"|")ai_reasoning\$(\d+)(\?[^\\"]*)?(\\"|")>([\s\S]*?)<\/a>/g,(r,s,a,u,d,p,f)=>{var h,g,_,m,$;const b=`${u}<BLOCK_NUMBER>${o}<STORY_NUMBER>${i}`,x=!!d&&d.includes("type=on_demand"),v=function(e){const t=new Map,n="<gpt_citation ",r="</gpt_citation>";let o=0;for(;;){const i=e.indexOf(n,o);if(-1===i)break;const s=e.indexOf(">",i);if(-1===s)break;const c=e.indexOf(r,s);if(-1===c)break;const a=e.slice(i,c+r.length),l=e.slice(i,s+1),u=l.indexOf("id=");if(-1!==u){let e=u+3;"\\"===l[e]&&e++,'"'!==l[e]&&"'"!==l[e]||e++;let n="";for(;e<l.length&&/\d/.test(l[e]);)n+=l[e++];n&&t.set(n,a)}o=c+r.length}return t}(f);console.log("RAW INPUT",v);const S=f.match(/<reason(?:\s+source="([^"]*)")?>([\s\S]*?)<\/reason>/),O=f.match(/<gap(?:\s+source="([^"]*)")?>([\s\S]*?)<\/gap>/),T=f.match(/<relevance_score>([\s\S]*?)<\/relevance_score>/);let y=(null===(h=null==S?void 0:S[2])||void 0===h?void 0:h.trim())||"",R=(null===(g=null==O?void 0:O[2])||void 0===g?void 0:g.trim())||"";y=e(y),R=e(R),y=t(y,b),R=t(R,b),v.forEach((e,t)=>{const r=`${b}<GPT_CITATION_ID>${t}`;l.push(n(e,r))}),c.push({id:b,reason:y,reasonSource:(null===(_=null==S?void 0:S[1])||void 0===_?void 0:_.trim())||"",gap:R,gapSource:(null===(m=null==O?void 0:O[1])||void 0===m?void 0:m.trim())||"",relevance_score:Number(null===($=null==T?void 0:T[1])||void 0===$?void 0:$.trim())||0,on_demand:x});return`<a ${s?'table="true"':""} href=${a}ai_reasoning$${b}${d||""}${p}>Source</a>`});a=d(r),s&&(u=d(s))}catch(e){console.error("Error in extracting AI Reasoning from this block:",r)}finally{return{outputText:a,reasonings:c,gpt_citation:l,processedDescription:u}}},exports.processUserStoryValue=(e,t,n)=>{let r=e.includes("<h1><b>Title</b></h1>\n\n")?e:n?`<h1><b>Title</b></h1>\n\n${n} \n${e}`:e;return r=r.includes("<h1><b>Requirement Type</b></h1>\n\n")?r:t?`<h1><b>Requirement Type</b></h1>\n\n${t} \n${r}`:r,r},exports.replaceGptCitation=t;
2
2
  //# sourceMappingURL=proccess-stream.utils.js.map