@e-llm-studio/citation 0.0.123 → 0.0.124

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 (108) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
  3. package/dist/cjs/features/Bookemon/BookPreview/BookPreview.js +1 -1
  4. package/dist/cjs/features/Bookemon/Bookemon.js +1 -1
  5. package/dist/cjs/features/Bookemon/BookemonContent.js +1 -1
  6. package/dist/cjs/features/ChatCitation/ChatCitationRenderer.js +1 -1
  7. package/dist/cjs/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  8. package/dist/cjs/features/ChatCitation/components/AssistantChatItem.js +1 -1
  9. package/dist/cjs/features/ChatCitation/components/ChatCitation.js +1 -1
  10. package/dist/cjs/features/ChatCitation/components/InViewNavigation.js +1 -1
  11. package/dist/cjs/features/CodeCitation/_components/CodeCitationPopup.js +1 -1
  12. package/dist/cjs/features/CodeCitation/_components/Spinner.js +1 -1
  13. package/dist/cjs/features/CodeCitation/_components/TooltipComponent.js +1 -1
  14. package/dist/cjs/features/PaginatedTable/PaginatedTable.js +1 -1
  15. package/dist/cjs/features/PdfEditorCitation/PdfEditorCitation.js +1 -1
  16. package/dist/cjs/features/ProjectAccordion/ProjectAccordion.js +1 -1
  17. package/dist/cjs/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js +1 -1
  18. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.js +1 -1
  19. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.js +1 -1
  20. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.js +1 -1
  21. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js +2 -0
  22. package/dist/cjs/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js.map +1 -0
  23. package/dist/cjs/features/RequirementAiCitations/ImageCitation/ImageCitationContent.js +1 -1
  24. package/dist/cjs/features/RequirementAiCitations/VideoCitation/VideoCitationContent.js +1 -1
  25. package/dist/cjs/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
  26. package/dist/cjs/features/RequirementAiCitations/WebCitation/components/ImagePreviewDialog.js +1 -1
  27. package/dist/cjs/features/RequirementAiCitations/components/CitationAIConfidenceDisplay.js +1 -1
  28. package/dist/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
  29. package/dist/features/Bookemon/BookPreview/BookPreview.js +1 -1
  30. package/dist/features/Bookemon/Bookemon.js +1 -1
  31. package/dist/features/Bookemon/BookemonContent.js +1 -1
  32. package/dist/features/ChatCitation/ChatCitationRenderer.js +1 -1
  33. package/dist/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
  34. package/dist/features/ChatCitation/components/AssistantChatItem.js +1 -1
  35. package/dist/features/ChatCitation/components/ChatCitation.js +1 -1
  36. package/dist/features/ChatCitation/components/InViewNavigation.js +1 -1
  37. package/dist/features/CodeCitation/_components/CodeCitationPopup.js +1 -1
  38. package/dist/features/CodeCitation/_components/Spinner.js +1 -1
  39. package/dist/features/CodeCitation/_components/TooltipComponent.js +1 -1
  40. package/dist/features/PaginatedTable/PaginatedTable.js +1 -1
  41. package/dist/features/PdfEditorCitation/PdfEditorCitation.js +1 -1
  42. package/dist/features/ProjectAccordion/ProjectAccordion.js +1 -1
  43. package/dist/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js +1 -1
  44. package/dist/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.js +1 -1
  45. package/dist/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.js +1 -1
  46. package/dist/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.js +1 -1
  47. package/dist/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js +2 -0
  48. package/dist/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.js.map +1 -0
  49. package/dist/features/RequirementAiCitations/ImageCitation/ImageCitationContent.js +1 -1
  50. package/dist/features/RequirementAiCitations/VideoCitation/VideoCitationContent.js +1 -1
  51. package/dist/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
  52. package/dist/features/RequirementAiCitations/WebCitation/components/ImagePreviewDialog.js +1 -1
  53. package/dist/features/RequirementAiCitations/components/CitationAIConfidenceDisplay.js +1 -1
  54. package/dist/types/src/AccordianHeadTest.d.ts.map +1 -1
  55. package/dist/types/src/ChatCitationTest.d.ts +6 -1
  56. package/dist/types/src/ChatCitationTest.d.ts.map +1 -1
  57. package/dist/types/src/CommonComponents/CustomDropdown.d.ts.map +1 -1
  58. package/dist/types/src/CommonComponents/NoTableData.d.ts.map +1 -1
  59. package/dist/types/src/CustomStylesProvider.d.ts.map +1 -1
  60. package/dist/types/src/RequirementAICitationTest.d.ts.map +1 -1
  61. package/dist/types/src/features/Bookemon/BookDetailsCard/BookDetailsCard.d.ts.map +1 -1
  62. package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts.map +1 -1
  63. package/dist/types/src/features/Bookemon/BookOverviewCard/BookOverviewCard.d.ts.map +1 -1
  64. package/dist/types/src/features/Bookemon/BookemonContent.d.ts.map +1 -1
  65. package/dist/types/src/features/ChatCitation/ChatCitationRenderer.d.ts +4 -0
  66. package/dist/types/src/features/ChatCitation/ChatCitationRenderer.d.ts.map +1 -1
  67. package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts +1 -1
  68. package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts.map +1 -1
  69. package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts.map +1 -1
  70. package/dist/types/src/features/ChatCitation/constants/icons.d.ts +3 -3
  71. package/dist/types/src/features/ChatCitation/constants/icons.d.ts.map +1 -1
  72. package/dist/types/src/features/ChatCitation/types/citations.types.d.ts +7 -0
  73. package/dist/types/src/features/ChatCitation/types/citations.types.d.ts.map +1 -1
  74. package/dist/types/src/features/CodeCitation/_components/CodeCitationPopup.d.ts.map +1 -1
  75. package/dist/types/src/features/CodeCitation/_components/DescriptionWithToggle.d.ts.map +1 -1
  76. package/dist/types/src/features/CodeCitation/_components/HighlightedCodeDetails.d.ts.map +1 -1
  77. package/dist/types/src/features/DataSelector/components/DataSelectionOptionsScreen.d.ts.map +1 -1
  78. package/dist/types/src/features/DataSelector/components/RlefDataTabsComponent.d.ts.map +1 -1
  79. package/dist/types/src/features/DataSelector/tables/ShowSelectedDataTable.d.ts.map +1 -1
  80. package/dist/types/src/features/DatagestMon/DynamicDataPreviiewer/DynamicDataPreviewer.d.ts.map +1 -1
  81. package/dist/types/src/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.d.ts +7 -1
  82. package/dist/types/src/features/RequirementAiCitations/AiReasoning/AiReasoningCitation.d.ts.map +1 -1
  83. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.d.ts +11 -2
  84. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasonMarkdownWrapper.d.ts.map +1 -1
  85. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.d.ts +7 -1
  86. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationContent.d.ts.map +1 -1
  87. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.d.ts +7 -1
  88. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/AiReasoningCitationPreview.d.ts.map +1 -1
  89. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.d.ts +7 -0
  90. package/dist/types/src/features/RequirementAiCitations/AiReasoning/components/ChatCitationTestForAiReasoning.d.ts.map +1 -0
  91. package/dist/types/src/features/RequirementAiCitations/AiReasoning/types/interface.d.ts +11 -3
  92. package/dist/types/src/features/RequirementAiCitations/AiReasoning/types/interface.d.ts.map +1 -1
  93. package/dist/types/src/features/UploadData/Components/SelectDataFromGoogleDrive/SelectDataFromGoogleDriveButton.d.ts.map +1 -1
  94. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/ProjectTaskSelect.d.ts.map +1 -1
  95. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/Tooltip.d.ts.map +1 -1
  96. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/ConfidenceScoreColumnMenu.d.ts.map +1 -1
  97. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/LabelColumnMenu.d.ts.map +1 -1
  98. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TableColumnResetFilterButton.d.ts +5 -16
  99. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TableColumnResetFilterButton.d.ts.map +1 -1
  100. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dataset-collectionFilterColumnMenuComponents/TagColumnMenu.d.ts.map +1 -1
  101. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/dropdown-with-radio.d.ts.map +1 -1
  102. package/dist/types/src/features/UploadData/Components/SelectDataFromRLEF/Components/input-label-with-info.d.ts.map +1 -1
  103. package/dist/types/src/features/UploadData/Components/SelectDataFromSavedDataSet/SelectDataFromSavedDataSetButton.d.ts.map +1 -1
  104. package/dist/types/src/features/UploadData/main.d.ts.map +1 -1
  105. package/dist/types/src/theme.d.ts +1 -1
  106. package/dist/types/src/theme.d.ts.map +1 -1
  107. package/dist/types/src/utils/CustomSkeleton.d.ts.map +1 -1
  108. package/package.json +15 -7
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),n=require("../components/CitationAIConfidenceDisplay.js"),s=require("@material-ui/core"),a=require("./ImageCitationContent.module.css.js");exports.default=function(t){var o,r,d,c,u,g,v=null===(o=null==t?void 0:t.closeCitationConfig)||void 0===o?void 0:o.CloseIcon,f=null===(r=null==t?void 0:t.cachingConfig)||void 0===r?void 0:r.queryClient,m=t.styles,h=["getSignedUrl",(null==t?void 0:t.gsUtilPath)||""],C=null!==(c=null===(d=t.cachingConfig)||void 0===d?void 0:d.useGetSignedUrlQuery)&&void 0!==c?c:function(e,i){return{data:void 0}},y=null!==(g=null===(u=t.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlMutation)&&void 0!==g?g:function(e){return{mutate:function(){},isPending:!1}},x=C((null==t?void 0:t.gsUtilPath)||"",h).data,j=y((null==t?void 0:t.gsUtilPath)||""),p=j.mutate,U=j.isPending;return l.useEffect(function(){var e;t.signedUrl||(t.gsUtilPath?(null===(e=null==f?void 0:f.getQueryData)||void 0===e?void 0:e.call(f,h))||p({gsUtilPath:t.gsUtilPath}):console.error("Error -> ImageCitationContent: gsUtilPath is required to fetch signed URL"))},[t.gsUtilPath,t.signedUrl,f,p]),i.jsxs("div",e.__assign({className:a.default.container,style:null==m?void 0:m.container},{children:[i.jsxs("div",e.__assign({className:a.default.header,style:null==m?void 0:m.header},{children:[i.jsx("h2",e.__assign({className:a.default.title,style:null==m?void 0:m.title},{children:(null==t?void 0:t.citationTitle)||"Visual Reference"})),(null==t?void 0:t.closeCitationConfig)?i.jsxs("div",e.__assign({className:a.default.headerRight,style:null==m?void 0:m.headerRight},{children:[n.renderCitationAIConfidenceDisplay(t.relevanceScore,!1,null==m?void 0:m.aiConfidenceDisplayPill),i.jsx("div",{className:a.default.divider,style:null==m?void 0:m.divider}),v&&i.jsx("div",e.__assign({className:a.default.closeIconWrapper,style:null==m?void 0:m.closeIconWrapper,onClick:t.closeCitationConfig.handleCloseCitationPreview},{children:i.jsx(v,{className:a.default.closeIcon})}))]})):n.renderCitationAIConfidenceDisplay(t.relevanceScore,!0,null==m?void 0:m.aiConfidenceDisplayPill)]})),t.signedUrl?i.jsx("img",{src:t.signedUrl,alt:"images",className:a.default.image,style:null==m?void 0:m.image}):U?i.jsxs("div",e.__assign({className:a.default.loaderContainer,style:null==m?void 0:m.loaderContainer},{children:[i.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),i.jsx(s.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),i.jsx("span",e.__assign({className:a.default.loaderText,style:null==m?void 0:m.loaderText},{children:"Loading Image..."}))]})):x&&i.jsx("img",{src:x,alt:"images",className:a.default.image,style:null==m?void 0:m.image})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),n=require("../components/CitationAIConfidenceDisplay.js"),s=require("@mui/material"),a=require("./ImageCitationContent.module.css.js");exports.default=function(t){var o,r,d,c,u,g,v=null===(o=null==t?void 0:t.closeCitationConfig)||void 0===o?void 0:o.CloseIcon,f=null===(r=null==t?void 0:t.cachingConfig)||void 0===r?void 0:r.queryClient,m=t.styles,h=["getSignedUrl",(null==t?void 0:t.gsUtilPath)||""],C=null!==(c=null===(d=t.cachingConfig)||void 0===d?void 0:d.useGetSignedUrlQuery)&&void 0!==c?c:function(e,i){return{data:void 0}},y=null!==(g=null===(u=t.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlMutation)&&void 0!==g?g:function(e){return{mutate:function(){},isPending:!1}},x=C((null==t?void 0:t.gsUtilPath)||"",h).data,j=y((null==t?void 0:t.gsUtilPath)||""),p=j.mutate,U=j.isPending;return l.useEffect(function(){var e;t.signedUrl||(t.gsUtilPath?(null===(e=null==f?void 0:f.getQueryData)||void 0===e?void 0:e.call(f,h))||p({gsUtilPath:t.gsUtilPath}):console.error("Error -> ImageCitationContent: gsUtilPath is required to fetch signed URL"))},[t.gsUtilPath,t.signedUrl,f,p]),i.jsxs("div",e.__assign({className:a.default.container,style:null==m?void 0:m.container},{children:[i.jsxs("div",e.__assign({className:a.default.header,style:null==m?void 0:m.header},{children:[i.jsx("h2",e.__assign({className:a.default.title,style:null==m?void 0:m.title},{children:(null==t?void 0:t.citationTitle)||"Visual Reference"})),(null==t?void 0:t.closeCitationConfig)?i.jsxs("div",e.__assign({className:a.default.headerRight,style:null==m?void 0:m.headerRight},{children:[n.renderCitationAIConfidenceDisplay(t.relevanceScore,!1,null==m?void 0:m.aiConfidenceDisplayPill),i.jsx("div",{className:a.default.divider,style:null==m?void 0:m.divider}),v&&i.jsx("div",e.__assign({className:a.default.closeIconWrapper,style:null==m?void 0:m.closeIconWrapper,onClick:t.closeCitationConfig.handleCloseCitationPreview},{children:i.jsx(v,{className:a.default.closeIcon})}))]})):n.renderCitationAIConfidenceDisplay(t.relevanceScore,!0,null==m?void 0:m.aiConfidenceDisplayPill)]})),t.signedUrl?i.jsx("img",{src:t.signedUrl,alt:"images",className:a.default.image,style:null==m?void 0:m.image}):U?i.jsxs("div",e.__assign({className:a.default.loaderContainer,style:null==m?void 0:m.loaderContainer},{children:[i.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),i.jsx(s.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),i.jsx("span",e.__assign({className:a.default.loaderText,style:null==m?void 0:m.loaderText},{children:"Loading Image..."}))]})):x&&i.jsx("img",{src:x,alt:"images",className:a.default.image,style:null==m?void 0:m.image})]}))};
2
2
  //# sourceMappingURL=ImageCitationContent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),n=require("react-player"),t=require("../components/CitationAIConfidenceDisplay.js"),o=require("@material-ui/core"),s=require("./VideoCitationContent.module.css.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(n);exports.default=function(n){var a,d,c,u,v,g,h=null===(a=null==n?void 0:n.closeCitationConfig)||void 0===a?void 0:a.CloseIcon,f=null===(d=null==n?void 0:n.cachingConfig)||void 0===d?void 0:d.queryClient,p=n.styles,C=["getSignedUrl",(null==n?void 0:n.gsUtilPath)||""],y=null!==(u=null===(c=n.cachingConfig)||void 0===c?void 0:c.useGetSignedUrlQuery)&&void 0!==u?u:function(e,i){return{data:void 0}},m=null!==(g=null===(v=n.cachingConfig)||void 0===v?void 0:v.useGetSignedUrlMutation)&&void 0!==g?g:function(e){return{mutate:function(){},isPending:!1}},_=y((null==n?void 0:n.gsUtilPath)||"",C).data,j=m((null==n?void 0:n.gsUtilPath)||""),x=j.mutate,P=j.isPending;l.useEffect(function(){var e;n.videoUrl||(n.gsUtilPath?(null===(e=null==f?void 0:f.getQueryData)||void 0===e?void 0:e.call(f,C))||x({gsUtilPath:n.gsUtilPath}):console.error("Error -> VideoCitationContent: gsUtilPath is required to fetch signed URL"))},[n.gsUtilPath,n.videoUrl,f,x,C]);var U=n.videoUrl||_,N=e.__assign({controls:!0,playing:!1,loop:!1,muted:!1,volume:.8,width:"100%",height:"100%"},n.playerConfig);return i.jsxs("div",e.__assign({className:s.default.container,style:null==p?void 0:p.container},{children:[i.jsxs("div",e.__assign({className:s.default.header,style:null==p?void 0:p.header},{children:[i.jsx("h2",e.__assign({className:s.default.title,style:null==p?void 0:p.title},{children:(null==n?void 0:n.citationTitle)||"Video Reference"})),(null==n?void 0:n.closeCitationConfig)?i.jsxs("div",e.__assign({className:s.default.headerRight,style:null==p?void 0:p.headerRight},{children:[t.renderCitationAIConfidenceDisplay(n.relevanceScore,!1,null==p?void 0:p.aiConfidenceDisplayPill),i.jsx("div",{className:s.default.divider,style:null==p?void 0:p.divider}),h&&i.jsx("div",e.__assign({className:s.default.closeIconWrapper,style:null==p?void 0:p.closeIconWrapper,onClick:n.closeCitationConfig.handleCloseCitationPreview},{children:i.jsx(h,{className:s.default.closeIcon})}))]})):t.renderCitationAIConfidenceDisplay(n.relevanceScore,!0,null==p?void 0:p.aiConfidenceDisplayPill)]})),U?i.jsx("div",e.__assign({className:s.default.videoWrapper,style:null==p?void 0:p.videoWrapper},{children:i.jsx(r.default,{src:U,controls:N.controls,playing:N.playing,loop:N.loop,muted:N.muted,volume:N.volume,style:{width:N.width,height:N.height}})})):P?i.jsxs("div",e.__assign({className:s.default.loaderContainer,style:null==p?void 0:p.loaderContainer},{children:[i.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),i.jsx(o.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),i.jsx("span",e.__assign({className:s.default.loaderText,style:null==p?void 0:p.loaderText},{children:"Loading Video..."}))]})):null]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),n=require("react-player"),t=require("../components/CitationAIConfidenceDisplay.js"),o=require("@mui/material"),s=require("./VideoCitationContent.module.css.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(n);exports.default=function(n){var a,d,c,u,v,g,h=null===(a=null==n?void 0:n.closeCitationConfig)||void 0===a?void 0:a.CloseIcon,f=null===(d=null==n?void 0:n.cachingConfig)||void 0===d?void 0:d.queryClient,p=n.styles,C=["getSignedUrl",(null==n?void 0:n.gsUtilPath)||""],y=null!==(u=null===(c=n.cachingConfig)||void 0===c?void 0:c.useGetSignedUrlQuery)&&void 0!==u?u:function(e,i){return{data:void 0}},m=null!==(g=null===(v=n.cachingConfig)||void 0===v?void 0:v.useGetSignedUrlMutation)&&void 0!==g?g:function(e){return{mutate:function(){},isPending:!1}},_=y((null==n?void 0:n.gsUtilPath)||"",C).data,j=m((null==n?void 0:n.gsUtilPath)||""),x=j.mutate,P=j.isPending;l.useEffect(function(){var e;n.videoUrl||(n.gsUtilPath?(null===(e=null==f?void 0:f.getQueryData)||void 0===e?void 0:e.call(f,C))||x({gsUtilPath:n.gsUtilPath}):console.error("Error -> VideoCitationContent: gsUtilPath is required to fetch signed URL"))},[n.gsUtilPath,n.videoUrl,f,x,C]);var U=n.videoUrl||_,N=e.__assign({controls:!0,playing:!1,loop:!1,muted:!1,volume:.8,width:"100%",height:"100%"},n.playerConfig);return i.jsxs("div",e.__assign({className:s.default.container,style:null==p?void 0:p.container},{children:[i.jsxs("div",e.__assign({className:s.default.header,style:null==p?void 0:p.header},{children:[i.jsx("h2",e.__assign({className:s.default.title,style:null==p?void 0:p.title},{children:(null==n?void 0:n.citationTitle)||"Video Reference"})),(null==n?void 0:n.closeCitationConfig)?i.jsxs("div",e.__assign({className:s.default.headerRight,style:null==p?void 0:p.headerRight},{children:[t.renderCitationAIConfidenceDisplay(n.relevanceScore,!1,null==p?void 0:p.aiConfidenceDisplayPill),i.jsx("div",{className:s.default.divider,style:null==p?void 0:p.divider}),h&&i.jsx("div",e.__assign({className:s.default.closeIconWrapper,style:null==p?void 0:p.closeIconWrapper,onClick:n.closeCitationConfig.handleCloseCitationPreview},{children:i.jsx(h,{className:s.default.closeIcon})}))]})):t.renderCitationAIConfidenceDisplay(n.relevanceScore,!0,null==p?void 0:p.aiConfidenceDisplayPill)]})),U?i.jsx("div",e.__assign({className:s.default.videoWrapper,style:null==p?void 0:p.videoWrapper},{children:i.jsx(r.default,{src:U,controls:N.controls,playing:N.playing,loop:N.loop,muted:N.muted,volume:N.volume,style:{width:N.width,height:N.height}})})):P?i.jsxs("div",e.__assign({className:s.default.loaderContainer,style:null==p?void 0:p.loaderContainer},{children:[i.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),i.jsx(o.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),i.jsx("span",e.__assign({className:s.default.loaderText,style:null==p?void 0:p.loaderText},{children:"Loading Video..."}))]})):null]}))};
2
2
  //# sourceMappingURL=VideoCitationContent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("react"),s=require("../components/CitationAIConfidenceDisplay.js"),n=require("../AiReasoning/components/icons/FullScreenIcon.js"),a=require("./components/ImagePreviewDialog.js"),t=require("@material-ui/core"),r=require("./WebCitationWithImageContent.module.css.js");exports.default=function(o){var d,c,u,g,v,f,m,h=null===(d=null==o?void 0:o.closeCitationConfig)||void 0===d?void 0:d.CloseIcon,C=o.visitIcon,j=i.useState(!1),p=j[0],x=j[1],_=null===(c=null==o?void 0:o.cachingConfig)||void 0===c?void 0:c.queryClient,y=o.styles,N=["getSignedUrl",o.gsUtilPath||""],I=null!==(g=null===(u=o.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlQuery)&&void 0!==g?g:function(){return{data:void 0}},P=null!==(f=null===(v=o.cachingConfig)||void 0===v?void 0:v.useGetSignedUrlMutation)&&void 0!==f?f:function(){return{mutate:function(e){},isPending:!1}},U=I((null==o?void 0:o.gsUtilPath)||"",N).data,S=P((null==o?void 0:o.gsUtilPath)||""),k=S.mutate,D=S.isPending;return i.useEffect(function(){o.signedUrl||o.gsUtilPath&&(((null==_?void 0:_.getQueryData)?_.getQueryData(N):void 0)||k({gsUtilPath:o.gsUtilPath}))},[o.gsUtilPath,o.signedUrl,_,k]),l.jsxs("div",e.__assign({className:r.default.container,style:null==y?void 0:y.container},{children:[l.jsxs("div",e.__assign({className:r.default.header,style:null==y?void 0:y.header},{children:[l.jsx("div",e.__assign({className:r.default.headerLeft,style:null==y?void 0:y.headerLeft},{children:l.jsx("a",e.__assign({className:r.default.link,target:"_blank",rel:"noopener noreferrer",href:o.url},{children:o.label}))})),(null==o?void 0:o.closeCitationConfig)?l.jsxs("div",e.__assign({className:r.default.headerActions,style:null==y?void 0:y.headerActions},{children:[s.renderCitationAIConfidenceDisplay(o.relevanceScore,!1,null==y?void 0:y.aiConfidenceDisplayPill),l.jsx("div",{className:r.default.divider,style:null==y?void 0:y.divider}),h&&l.jsx("div",e.__assign({className:r.default.closeIconWrapper,style:null==y?void 0:y.closeIconWrapper,onClick:o.closeCitationConfig.handleCloseCitationPreview},{children:l.jsx(h,{className:r.default.closeIcon})}))]})):l.jsx(l.Fragment,{children:s.renderCitationAIConfidenceDisplay(o.relevanceScore,!0,null==y?void 0:y.aiConfidenceDisplayPill)})]})),o.signedUrl?l.jsxs("div",e.__assign({className:r.default.imageWrapper,style:null==y?void 0:y.imageWrapper},{children:[l.jsx("img",{src:o.signedUrl,alt:"images",className:r.default.image,style:null==y?void 0:y.image}),l.jsx("div",e.__assign({className:r.default.fullScreenButton,style:null==y?void 0:y.fullScreenButton,onClick:function(){return x(!0)}},{children:l.jsx(n.default,{})})),l.jsx(a.default,{open:p,handleClose:function(){return x(!1)},src:o.signedUrl,CloseIcon:o.PreviewDialogCloseIcon,styles:null===(m=o.styles)||void 0===m?void 0:m.previewDialogStyles})]})):D?l.jsxs("div",e.__assign({className:r.default.loaderContainer},{children:[l.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),l.jsx(t.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),l.jsx("span",e.__assign({className:r.default.loaderText,style:null==y?void 0:y.loaderText},{children:"Loading Image..."}))]})):U&&l.jsxs("div",e.__assign({className:r.default.imageWrapper},{children:[l.jsx("img",{src:U,alt:"images",className:r.default.image,style:null==y?void 0:y.image}),l.jsx("div",e.__assign({className:r.default.fullScreenButton,style:null==y?void 0:y.fullScreenButton,onClick:function(){return x(!0)}},{children:l.jsx(n.default,{})})),l.jsx(a.default,{open:p,handleClose:function(){return x(!1)},src:U,CloseIcon:o.PreviewDialogCloseIcon,styles:null==y?void 0:y.previewDialogStyles})]})),l.jsx("div",e.__assign({className:r.default.footer,style:null==y?void 0:y.footer},{children:l.jsxs("div",e.__assign({className:r.default.footerContent,style:null==y?void 0:y.footerContent},{children:[l.jsx("span",{children:"Open link in new tab to read in detail"}),l.jsxs("a",e.__assign({className:r.default.visitLink,style:null==y?void 0:y.visitLink,href:o.url,target:"_blank",rel:"noopener noreferrer"},{children:[l.jsx("span",{children:"Visit Link"}),l.jsx(C,{className:r.default.visitIcon})]}))]}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("react"),s=require("../components/CitationAIConfidenceDisplay.js"),n=require("../AiReasoning/components/icons/FullScreenIcon.js"),a=require("./components/ImagePreviewDialog.js"),t=require("@mui/material"),r=require("./WebCitationWithImageContent.module.css.js");exports.default=function(o){var d,c,u,g,v,f,m,h=null===(d=null==o?void 0:o.closeCitationConfig)||void 0===d?void 0:d.CloseIcon,C=o.visitIcon,j=i.useState(!1),p=j[0],x=j[1],_=null===(c=null==o?void 0:o.cachingConfig)||void 0===c?void 0:c.queryClient,y=o.styles,N=["getSignedUrl",o.gsUtilPath||""],I=null!==(g=null===(u=o.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlQuery)&&void 0!==g?g:function(){return{data:void 0}},P=null!==(f=null===(v=o.cachingConfig)||void 0===v?void 0:v.useGetSignedUrlMutation)&&void 0!==f?f:function(){return{mutate:function(e){},isPending:!1}},U=I((null==o?void 0:o.gsUtilPath)||"",N).data,S=P((null==o?void 0:o.gsUtilPath)||""),k=S.mutate,D=S.isPending;return i.useEffect(function(){o.signedUrl||o.gsUtilPath&&(((null==_?void 0:_.getQueryData)?_.getQueryData(N):void 0)||k({gsUtilPath:o.gsUtilPath}))},[o.gsUtilPath,o.signedUrl,_,k]),l.jsxs("div",e.__assign({className:r.default.container,style:null==y?void 0:y.container},{children:[l.jsxs("div",e.__assign({className:r.default.header,style:null==y?void 0:y.header},{children:[l.jsx("div",e.__assign({className:r.default.headerLeft,style:null==y?void 0:y.headerLeft},{children:l.jsx("a",e.__assign({className:r.default.link,target:"_blank",rel:"noopener noreferrer",href:o.url},{children:o.label}))})),(null==o?void 0:o.closeCitationConfig)?l.jsxs("div",e.__assign({className:r.default.headerActions,style:null==y?void 0:y.headerActions},{children:[s.renderCitationAIConfidenceDisplay(o.relevanceScore,!1,null==y?void 0:y.aiConfidenceDisplayPill),l.jsx("div",{className:r.default.divider,style:null==y?void 0:y.divider}),h&&l.jsx("div",e.__assign({className:r.default.closeIconWrapper,style:null==y?void 0:y.closeIconWrapper,onClick:o.closeCitationConfig.handleCloseCitationPreview},{children:l.jsx(h,{className:r.default.closeIcon})}))]})):l.jsx(l.Fragment,{children:s.renderCitationAIConfidenceDisplay(o.relevanceScore,!0,null==y?void 0:y.aiConfidenceDisplayPill)})]})),o.signedUrl?l.jsxs("div",e.__assign({className:r.default.imageWrapper,style:null==y?void 0:y.imageWrapper},{children:[l.jsx("img",{src:o.signedUrl,alt:"images",className:r.default.image,style:null==y?void 0:y.image}),l.jsx("div",e.__assign({className:r.default.fullScreenButton,style:null==y?void 0:y.fullScreenButton,onClick:function(){return x(!0)}},{children:l.jsx(n.default,{})})),l.jsx(a.default,{open:p,handleClose:function(){return x(!1)},src:o.signedUrl,CloseIcon:o.PreviewDialogCloseIcon,styles:null===(m=o.styles)||void 0===m?void 0:m.previewDialogStyles})]})):D?l.jsxs("div",e.__assign({className:r.default.loaderContainer},{children:[l.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),l.jsx(t.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),l.jsx("span",e.__assign({className:r.default.loaderText,style:null==y?void 0:y.loaderText},{children:"Loading Image..."}))]})):U&&l.jsxs("div",e.__assign({className:r.default.imageWrapper},{children:[l.jsx("img",{src:U,alt:"images",className:r.default.image,style:null==y?void 0:y.image}),l.jsx("div",e.__assign({className:r.default.fullScreenButton,style:null==y?void 0:y.fullScreenButton,onClick:function(){return x(!0)}},{children:l.jsx(n.default,{})})),l.jsx(a.default,{open:p,handleClose:function(){return x(!1)},src:U,CloseIcon:o.PreviewDialogCloseIcon,styles:null==y?void 0:y.previewDialogStyles})]})),l.jsx("div",e.__assign({className:r.default.footer,style:null==y?void 0:y.footer},{children:l.jsxs("div",e.__assign({className:r.default.footerContent,style:null==y?void 0:y.footerContent},{children:[l.jsx("span",{children:"Open link in new tab to read in detail"}),l.jsxs("a",e.__assign({className:r.default.visitLink,style:null==y?void 0:y.visitLink,href:o.url,target:"_blank",rel:"noopener noreferrer"},{children:[l.jsx("span",{children:"Visit Link"}),l.jsx(C,{className:r.default.visitIcon})]}))]}))}))]}))};
2
2
  //# sourceMappingURL=WebCitationWithImageContent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),l=require("@material-ui/core"),a=require("./ImagePreviewDialog.module.css.js");exports.default=function(i){var r=i.open,n=i.handleClose,t=i.CloseIcon,o=i.src,c=i.styles;return s.jsx(l.Dialog,e.__assign({maxWidth:"lg",onClose:n,open:r},{children:s.jsxs("div",e.__assign({className:a.default.container,style:null==c?void 0:c.container},{children:[s.jsxs("div",e.__assign({className:a.default.header,style:null==c?void 0:c.header},{children:[s.jsx("h1",e.__assign({className:a.default.title,style:null==c?void 0:c.title},{children:"Image Preview"})),s.jsx("div",e.__assign({className:a.default.closeIconWrapper,style:null==c?void 0:c.closeIconWrapper,onClick:n},{children:s.jsx(t,{className:a.default.closeIcon})}))]})),s.jsx("img",{src:o,alt:"Preview",className:a.default.image,style:null==c?void 0:c.image})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),l=require("@mui/material"),a=require("./ImagePreviewDialog.module.css.js");exports.default=function(i){var r=i.open,n=i.handleClose,t=i.CloseIcon,o=i.src,c=i.styles;return s.jsx(l.Dialog,e.__assign({maxWidth:"lg",onClose:n,open:r},{children:s.jsxs("div",e.__assign({className:a.default.container,style:null==c?void 0:c.container},{children:[s.jsxs("div",e.__assign({className:a.default.header,style:null==c?void 0:c.header},{children:[s.jsx("h1",e.__assign({className:a.default.title,style:null==c?void 0:c.title},{children:"Image Preview"})),s.jsx("div",e.__assign({className:a.default.closeIconWrapper,style:null==c?void 0:c.closeIconWrapper,onClick:n},{children:s.jsx(t,{className:a.default.closeIcon})}))]})),s.jsx("img",{src:o,alt:"Preview",className:a.default.image,style:null==c?void 0:c.image})]}))}))};
2
2
  //# sourceMappingURL=ImagePreviewDialog.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("@material-ui/core"),r=require("./CitationAIConfidenceDisplay.module.css.js"),t=require("../AiReasoning/components/icons/RelevanceScoreIcon.js");exports.renderCitationAIConfidenceDisplay=function(a,o,s){if("number"!=typeof a||isNaN(a))return null;var c=n.jsxs("div",e.__assign({className:"".concat(r.default.container," ").concat(o?r.default.legacy:r.default.modern),style:null==s?void 0:s.container},{children:[n.jsx(t.default,{size:20}),n.jsx("span",{children:o?"Citation Relevance: ".concat(a,"%"):"".concat(a,"%")})]}));return o?c:n.jsx(i.Tooltip,e.__assign({title:"Citation Relevance",arrow:!0},{children:c}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("@mui/material"),t=require("./CitationAIConfidenceDisplay.module.css.js"),r=require("../AiReasoning/components/icons/RelevanceScoreIcon.js");exports.renderCitationAIConfidenceDisplay=function(a,s,o){if("number"!=typeof a||isNaN(a))return null;var c=n.jsxs("div",e.__assign({className:"".concat(t.default.container," ").concat(s?t.default.legacy:t.default.modern),style:null==o?void 0:o.container},{children:[n.jsx(r.default,{size:20}),n.jsx("span",{children:s?"Citation Relevance: ".concat(a,"%"):"".concat(a,"%")})]}));return s?c:n.jsx(i.Tooltip,e.__assign({title:"Citation Relevance",arrow:!0},{children:c}))};
2
2
  //# sourceMappingURL=CitationAIConfidenceDisplay.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e,__assign as t,__awaiter as n,__generator as o,__rest as r}from"tslib";import{jsxs as i,jsx as a,Fragment as l}from"react/jsx-runtime";import s from"@material-ui/lab/Pagination";import d from"@material-ui/lab/Skeleton";import{useRef as c,useEffect as u,useState as p}from"react";import h from"react-markdown";import{highlightTermsFunc as g}from"../utils/highlight.js";import{sanitizeHtml as x}from"../../../utils/sanitizeHtml.js";var f={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},y=function(y){y.data;var v=y.updateQuotesToHighLight,m=y.handleFetchManuscriptElements,b=y.BookIsbn,T=y.title,C=y.highlightTerms,S=y.onHighlightMatch,k=c(!0);u(function(){return function(){k.current=!1}},[]);var w=p([]),L=w[0],B=w[1],D=p(1),M=D[0],q=D[1],F=p(!1),E=F[0],H=F[1],I=p(!0),P=I[0],W=I[1],z=p(0),_=z[0],N=z[1],R=p([]),j=R[0],G=R[1],K=p(1),Y=K[0],A=K[1],Q=p(!1),O=Q[0],J=Q[1],U=p(!0),V=U[0],X=U[1],Z=p(0),$=Z[0],ee=Z[1],te=p([]),ne=te[0],oe=te[1],re=p(1),ie=re[0],ae=re[1],le=p(!1),se=le[0],de=le[1],ce=p(!0),ue=ce[0],pe=ce[1],he=p(0),ge=he[0],xe=he[1],fe=p({list:"",index:-1,page:1}),ye=fe[0],ve=fe[1],me=c(!1);u(function(){var t,n,o;C&&0!==C.length&&(me.current||e(e(e([],null!==(t=null==L?void 0:L.map(function(e){return e.text}))&&void 0!==t?t:[],!0),null!==(n=null==ne?void 0:ne.map(function(e){return e.name}))&&void 0!==n?n:[],!0),null!==(o=null==j?void 0:j.flatMap(function(e){return[e.name,e.description]}))&&void 0!==o?o:[],!0).some(function(e){return!!e&&C.some(function(t){return e.toLowerCase().includes(t.toLowerCase())})})&&(null==S||S(!0),me.current=!0))},[C]),u(function(){me.current=!1},[C]);var be=function(e){var t=e.endpoint,r=e.page,i=e.isbn,a=e.setData,l=e.setLoading,s=e.setHasMore,d=e.setTotalPage,c=e.title;return n(void 0,void 0,void 0,function(){var e,n,u,p;return o(this,function(o){switch(o.label){case 0:l(!0),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,m({endpoint:t,page:r,pageSize:10,isbn:i,title:c})];case 2:return e=o.sent(),k.current?(a((null==e?void 0:e.data)||[]),d((null===(n=null==e?void 0:e.pagination)||void 0===n?void 0:n.totalPages)||0),s(!(null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.hasNext)&&!(null===(p=null==e?void 0:e.pagination)||void 0===p?void 0:p.hasPrevious)),[3,4]):[2];case 3:return k.current&&l(!1),[7];case 4:return[2]}})})};return u(function(){be({endpoint:"notable-quotes",page:M,isbn:b,setData:B,setLoading:H,setHasMore:W,setTotalPage:N,title:T})},[M]),u(function(){be({endpoint:"notable-characters",page:Y,isbn:b,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee,title:T})},[Y]),u(function(){be({endpoint:"geo-locations",page:ie,isbn:b,setData:oe,setLoading:de,setHasMore:pe,setTotalPage:xe,title:T})},[ie]),i("div",{children:[i("div",t({style:{marginBottom:"24px"}},{children:[a("p",t({style:f.sectionTitle},{children:"Notable Quotes"})),i("div",t({style:f.quotesPadding},{children:[E?a("div",t({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return i("div",t({style:f.quoteCard},{children:[a(d,{variant:"text",width:"60%",height:28}),a(d,{variant:"text",width:"40%",height:20}),a(d,{variant:"text",width:"25%",height:20}),a(d,{variant:"text",width:"30%",height:20})]}),e)})})):0===L.length?i("p",t({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",a("button",t({style:f.retryButton,onClick:function(){return be({endpoint:"notable-quotes",page:M,isbn:b,setData:B,setLoading:H,setHasMore:W,setTotalPage:N,title:T})}},{children:"Retry"}))]})):a(l,{children:L.map(function(e,r){var l="notable"===ye.list&&ye.page===M&&ye.index===r;return i("div",t({style:t(t({},f.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return n(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ve({list:"notable",page:M,index:r}),(null===(n=null==e?void 0:e.chunkIds)||void 0===n?void 0:n.length)>0?[4,v(e.text,"Notable Quotes",e.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return t=o.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})}},{children:[C&&C.length>0?a("p",{style:f.quoteText,dangerouslySetInnerHTML:{__html:x(g(null==e?void 0:e.text,C))}}):a("p",t({style:f.quoteText},{children:null==e?void 0:e.text})),i("p",t({style:f.quoteMeta},{children:[e.chapter," ",a("br",{})," ",e.page]})),i("p",t({style:f.quoteAuthor},{children:["— ",null==e?void 0:e.author]}))]}),r)})}),a("div",t({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!P&&a(s,{disabled:E,count:_,page:M,onChange:function(e,t){return q(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),i("div",t({style:f.geoLocationsContainer},{children:[a("p",t({style:f.sectionTitle},{children:"Key Geo Locations"})),i("div",t({style:t(t({},f.quotesPadding),{marginBottom:"8px"})},{children:[se?a("div",t({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return a(d,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ne.length?i("p",t({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",a("button",t({style:f.retryButton,onClick:function(){return be({endpoint:"geo-locations",page:ie,isbn:b,setData:oe,setLoading:de,setHasMore:pe,setTotalPage:xe,title:T})}},{children:"Retry"}))]})):a(l,{children:ne.map(function(e,r){var l="geo_location"===ye.list&&ye.page===ie&&ye.index===r;return i("span",t({style:f.geoLocationFlex},{children:[a("span",t({style:t(t({},f.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return n(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ve({list:"geo_location",page:ie,index:r}),(null===(n=null==e?void 0:e.chunkIds)||void 0===n?void 0:n.length)>0?[4,v(e.name,"Key Geo Locations",e.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return t=o.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:C&&C.length>0?a("span",{dangerouslySetInnerHTML:{__html:x(g(null==e?void 0:e.name,C))}}):null==e?void 0:e.name})),r<ne.length-1&&a("span",{style:f.geoDivider})]}),r)})}),a("div",t({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ue&&a(s,{disabled:se,count:ge,page:ie,onChange:function(e,t){return ae(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),i("div",t({style:f.charactersContainer},{children:[a("p",t({style:f.sectionTitle},{children:"Key Characters"})),O?a("div",t({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return i("div",t({style:t(t({},f.characterCard),{flexBasis:"40%"})},{children:[a(d,{variant:"circle",style:t(t({},f.avatar),{flexShrink:0})}),i("div",t({style:{display:"flex",flexDirection:"column",flex:1}},{children:[a(d,{variant:"text",style:{flex:"1",flexShrink:0}}),a(d,{variant:"text",style:{flex:"1"}}),a(d,{variant:"text",style:{flex:"1"}}),a(d,{variant:"text",style:{flex:"1"}})]}))]}),e)})})):0===j.length?i("p",t({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",a("button",t({style:f.retryButton,onClick:function(){return be({endpoint:"notable-characters",page:Y,isbn:b,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee,title:T})}},{children:"Retry"}))]})):a(l,{children:a("div",t({style:f.charactersGrid},{children:j.map(function(e,l){var s=t(t({},f.avatar),{backgroundColor:e.bg,color:e.color}),d="key_character"===ye.list&&ye.page===Y&&ye.index===l;return i("div",t({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:t(t({},f.characterCard),{borderColor:d?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return n(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:ve({list:"key_character",page:Y,index:l}),o.label=1;case 1:return o.trys.push([1,4,,5]),(null===(n=null==e?void 0:e.chunkIds)||void 0===n?void 0:n.length)>0?[4,v(e.name,"Key Characters",e.chunkIds,0)]:[3,3];case 2:o.sent(),o.label=3;case 3:return[3,5];case 4:return t=o.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})}},{children:[a("div",t({style:s},{children:e.initials})),i("div",t({style:{display:"flex",flexDirection:"column"}},{children:[a("p",t({style:t(t({},f.charName),{margin:0})},{children:C&&C.length>0?a("span",{dangerouslySetInnerHTML:{__html:x(g(e.name,C))}}):e.name})),a("p",t({style:t(t({},f.charDesc),{margin:0,marginTop:"4px"})},{children:C&&C.length>0?a("span",{dangerouslySetInnerHTML:{__html:x(g(null==e?void 0:e.description,C))}}):a(h,t({components:{p:function(e){e.node;var n=r(e,["node"]);return a("p",t({style:{marginTop:"0"}},n))}}},{children:null==e?void 0:e.description}))}))]}))]}),l)})}))}),a("div",t({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!V&&a(s,{count:$,disabled:O,page:Y,onChange:function(e,t){return A(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};export{y as default};
1
+ import{__spreadArray as e,__assign as t,__awaiter as n,__generator as o,__rest as r}from"tslib";import{jsxs as i,jsx as a,Fragment as l}from"react/jsx-runtime";import s from"@mui/material/Pagination";import d from"@mui/material/Skeleton";import{useRef as c,useEffect as u,useState as p}from"react";import h from"react-markdown";import{highlightTermsFunc as g}from"../utils/highlight.js";import{sanitizeHtml as x}from"../../../utils/sanitizeHtml.js";var f={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},y=function(y){y.data;var v=y.updateQuotesToHighLight,m=y.handleFetchManuscriptElements,b=y.BookIsbn,T=y.title,C=y.highlightTerms,S=y.onHighlightMatch,k=c(!0);u(function(){return function(){k.current=!1}},[]);var w=p([]),L=w[0],B=w[1],D=p(1),M=D[0],q=D[1],F=p(!1),E=F[0],H=F[1],I=p(!0),P=I[0],W=I[1],z=p(0),_=z[0],N=z[1],R=p([]),j=R[0],G=R[1],K=p(1),Y=K[0],A=K[1],Q=p(!1),O=Q[0],J=Q[1],U=p(!0),V=U[0],X=U[1],Z=p(0),$=Z[0],ee=Z[1],te=p([]),ne=te[0],oe=te[1],re=p(1),ie=re[0],ae=re[1],le=p(!1),se=le[0],de=le[1],ce=p(!0),ue=ce[0],pe=ce[1],he=p(0),ge=he[0],xe=he[1],fe=p({list:"",index:-1,page:1}),ye=fe[0],ve=fe[1],me=c(!1);u(function(){var t,n,o;C&&0!==C.length&&(me.current||e(e(e([],null!==(t=null==L?void 0:L.map(function(e){return e.text}))&&void 0!==t?t:[],!0),null!==(n=null==ne?void 0:ne.map(function(e){return e.name}))&&void 0!==n?n:[],!0),null!==(o=null==j?void 0:j.flatMap(function(e){return[e.name,e.description]}))&&void 0!==o?o:[],!0).some(function(e){return!!e&&C.some(function(t){return e.toLowerCase().includes(t.toLowerCase())})})&&(null==S||S(!0),me.current=!0))},[C]),u(function(){me.current=!1},[C]);var be=function(e){var t=e.endpoint,r=e.page,i=e.isbn,a=e.setData,l=e.setLoading,s=e.setHasMore,d=e.setTotalPage,c=e.title;return n(void 0,void 0,void 0,function(){var e,n,u,p;return o(this,function(o){switch(o.label){case 0:l(!0),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,m({endpoint:t,page:r,pageSize:10,isbn:i,title:c})];case 2:return e=o.sent(),k.current?(a((null==e?void 0:e.data)||[]),d((null===(n=null==e?void 0:e.pagination)||void 0===n?void 0:n.totalPages)||0),s(!(null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.hasNext)&&!(null===(p=null==e?void 0:e.pagination)||void 0===p?void 0:p.hasPrevious)),[3,4]):[2];case 3:return k.current&&l(!1),[7];case 4:return[2]}})})};return u(function(){be({endpoint:"notable-quotes",page:M,isbn:b,setData:B,setLoading:H,setHasMore:W,setTotalPage:N,title:T})},[M]),u(function(){be({endpoint:"notable-characters",page:Y,isbn:b,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee,title:T})},[Y]),u(function(){be({endpoint:"geo-locations",page:ie,isbn:b,setData:oe,setLoading:de,setHasMore:pe,setTotalPage:xe,title:T})},[ie]),i("div",{children:[i("div",t({style:{marginBottom:"24px"}},{children:[a("p",t({style:f.sectionTitle},{children:"Notable Quotes"})),i("div",t({style:f.quotesPadding},{children:[E?a("div",t({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return i("div",t({style:f.quoteCard},{children:[a(d,{variant:"text",width:"60%",height:28}),a(d,{variant:"text",width:"40%",height:20}),a(d,{variant:"text",width:"25%",height:20}),a(d,{variant:"text",width:"30%",height:20})]}),e)})})):0===L.length?i("p",t({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",a("button",t({style:f.retryButton,onClick:function(){return be({endpoint:"notable-quotes",page:M,isbn:b,setData:B,setLoading:H,setHasMore:W,setTotalPage:N,title:T})}},{children:"Retry"}))]})):a(l,{children:L.map(function(e,r){var l="notable"===ye.list&&ye.page===M&&ye.index===r;return i("div",t({style:t(t({},f.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return n(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ve({list:"notable",page:M,index:r}),(null===(n=null==e?void 0:e.chunkIds)||void 0===n?void 0:n.length)>0?[4,v(e.text,"Notable Quotes",e.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return t=o.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})}},{children:[C&&C.length>0?a("p",{style:f.quoteText,dangerouslySetInnerHTML:{__html:x(g(null==e?void 0:e.text,C))}}):a("p",t({style:f.quoteText},{children:null==e?void 0:e.text})),i("p",t({style:f.quoteMeta},{children:[e.chapter," ",a("br",{})," ",e.page]})),i("p",t({style:f.quoteAuthor},{children:["— ",null==e?void 0:e.author]}))]}),r)})}),a("div",t({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!P&&a(s,{disabled:E,count:_,page:M,onChange:function(e,t){return q(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),i("div",t({style:f.geoLocationsContainer},{children:[a("p",t({style:f.sectionTitle},{children:"Key Geo Locations"})),i("div",t({style:t(t({},f.quotesPadding),{marginBottom:"8px"})},{children:[se?a("div",t({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return a(d,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ne.length?i("p",t({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",a("button",t({style:f.retryButton,onClick:function(){return be({endpoint:"geo-locations",page:ie,isbn:b,setData:oe,setLoading:de,setHasMore:pe,setTotalPage:xe,title:T})}},{children:"Retry"}))]})):a(l,{children:ne.map(function(e,r){var l="geo_location"===ye.list&&ye.page===ie&&ye.index===r;return i("span",t({style:f.geoLocationFlex},{children:[a("span",t({style:t(t({},f.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return n(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ve({list:"geo_location",page:ie,index:r}),(null===(n=null==e?void 0:e.chunkIds)||void 0===n?void 0:n.length)>0?[4,v(e.name,"Key Geo Locations",e.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return t=o.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:C&&C.length>0?a("span",{dangerouslySetInnerHTML:{__html:x(g(null==e?void 0:e.name,C))}}):null==e?void 0:e.name})),r<ne.length-1&&a("span",{style:f.geoDivider})]}),r)})}),a("div",t({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ue&&a(s,{disabled:se,count:ge,page:ie,onChange:function(e,t){return ae(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),i("div",t({style:f.charactersContainer},{children:[a("p",t({style:f.sectionTitle},{children:"Key Characters"})),O?a("div",t({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return i("div",t({style:t(t({},f.characterCard),{flexBasis:"40%"})},{children:[a(d,{variant:"circular",style:t(t({},f.avatar),{flexShrink:0})}),i("div",t({style:{display:"flex",flexDirection:"column",flex:1}},{children:[a(d,{variant:"text",style:{flex:"1",flexShrink:0}}),a(d,{variant:"text",style:{flex:"1"}}),a(d,{variant:"text",style:{flex:"1"}}),a(d,{variant:"text",style:{flex:"1"}})]}))]}),e)})})):0===j.length?i("p",t({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",a("button",t({style:f.retryButton,onClick:function(){return be({endpoint:"notable-characters",page:Y,isbn:b,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee,title:T})}},{children:"Retry"}))]})):a(l,{children:a("div",t({style:f.charactersGrid},{children:j.map(function(e,l){var s=t(t({},f.avatar),{backgroundColor:e.bg,color:e.color}),d="key_character"===ye.list&&ye.page===Y&&ye.index===l;return i("div",t({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:t(t({},f.characterCard),{borderColor:d?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return n(void 0,void 0,void 0,function(){var t,n;return o(this,function(o){switch(o.label){case 0:ve({list:"key_character",page:Y,index:l}),o.label=1;case 1:return o.trys.push([1,4,,5]),(null===(n=null==e?void 0:e.chunkIds)||void 0===n?void 0:n.length)>0?[4,v(e.name,"Key Characters",e.chunkIds,0)]:[3,3];case 2:o.sent(),o.label=3;case 3:return[3,5];case 4:return t=o.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})}},{children:[a("div",t({style:s},{children:e.initials})),i("div",t({style:{display:"flex",flexDirection:"column"}},{children:[a("p",t({style:t(t({},f.charName),{margin:0})},{children:C&&C.length>0?a("span",{dangerouslySetInnerHTML:{__html:x(g(e.name,C))}}):e.name})),a("p",t({style:t(t({},f.charDesc),{margin:0,marginTop:"4px"})},{children:C&&C.length>0?a("span",{dangerouslySetInnerHTML:{__html:x(g(null==e?void 0:e.description,C))}}):a(h,t({components:{p:function(e){e.node;var n=r(e,["node"]);return a("p",t({style:{marginTop:"0"}},n))}}},{children:null==e?void 0:e.description}))}))]}))]}),l)})}))}),a("div",t({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!V&&a(s,{count:$,disabled:O,page:Y,onChange:function(e,t){return A(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};export{y as default};
2
2
  //# sourceMappingURL=BookElementsCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import r from"@material-ui/icons/Close";import l from"@material-ui/icons/ArrowBack";import a from"../../BookCitation/BookCitation.js";import{comingSoonStyles as d,defaultIcon as c}from"../Bookemon.js";import s from"@material-ui/core/Switch";import p from"@material-ui/core/Tooltip";var g=function(g){var h=g.bookOverView,u=g.bookCoverImage,f=g.onClose,m=g.customStyle,x=g.quotesToHighLightData,v=g.updateQuotesToHighLight,y=g.citationLoad,b=g.clickableElementCategory,k=void 0===b?"":b,C=g.comingSoonData,w=g.isNonHighlightedBlur,B=void 0!==w&&w,S=g.isBlurToggleVisible,I=void 0!==S&&S,T=g.noHtmlContent,W=void 0!==T&&T,j=g.isBookemon,L=void 0===j||j,P=i(!1),H=P[0],F=P[1],z=i(!0),D=z[0],O=z[1],R=!!x.content,A={header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"},headerLeft:{display:"flex",alignItems:"center",gap:"8px"},closeButton:{padding:"4px",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},flexCenter:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},coverContainer:{width:"100%",maxWidth:"300px",borderRadius:"12px",padding:"4px",background:"linear-gradient(135deg, #34D399, #3B82F6, #10B981)",position:"relative",overflow:"hidden",boxShadow:"0 10px 25px rgba(0,0,0,0.3)",marginBottom:"24px"},bookCoverStyle:{width:"100%",height:"auto",objectFit:"contain",borderRadius:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)"},loadingStyle:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},rightPanel:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},clickableElementCategory:{fontSize:"20px",fontWeight:600},previewWrapper:{flex:1,width:"80%",margin:"0 auto",display:"flex",flexDirection:"column",overflow:"hidden",justifyContent:"flex-start",alignItems:"center"},coverImagePreview:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"7 / 10",background:"",padding:0},toggleBlurContainer:{display:"flex",alignItems:"center",gap:"20px"},bookCoverPlaceholder:{width:"100%",height:"calc(100% - 8px)",background:"linear-gradient(to bottom, #22c55e, #14532d)",borderRadius:"4px",padding:"4px",color:"white",fontSize:"10px",display:"flex",justifyContent:"center",alignItems:"center"},bookCoverInner:{border:"1px solid white",padding:"4px",width:"calc(100% - 26px)",height:"calc(100% - 26px)",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",justifyContent:"space-around"},bookTitle:{fontWeight:800,fontSize:"1.5rem",textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.2,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",padding:"0 8px"},bookAuthor:{fontSize:"1rem",fontWeight:500,opacity:.9,marginTop:"8px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}};return n(function(){O(!0),console.log(y,"citationLoad")},[y]),t("div",e({style:e(e({},A.rightPanel),(null==m?void 0:m.rightPanel)||{})},{children:[t("div",e({style:A.header},{children:[t("div",e({style:A.headerLeft},{children:[(R||W)&&o("button",e({style:A.closeButton,onClick:function(){return v("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:o(l,{})})),o("h2",e({style:A.clickableElementCategory},{children:k}))]})),t("div",e({style:A.toggleBlurContainer},{children:[R&&I&&t("div",e({style:{display:"flex",alignItems:"center",gap:"2px"}},{children:[o(s,{checked:D,onChange:function(e){O(e.target.checked),console.log(e.target.checked,"event.target.checked")},color:"primary",size:"small"}),t("span",e({style:{fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px"}},{children:["Blur",o(p,e({title:"Blur Text is enabled by default. Non-highlighted parts of the text will appear blurred to help you focus on the highlighted content. You can turn this off if you want to see all text clearly."},{children:o("span",e({style:{display:"inline-flex",justifyContent:"center",alignItems:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#485468",color:"#fff",fontSize:"10px",fontWeight:"bold",cursor:"pointer",lineHeight:"14px",userSelect:"none"}},{children:"i"}))}))]}))]})),o("button",e({style:A.closeButton,onClick:function(){f(),v("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:o(r,{})}))]}))]})),o("div",e({style:e(e({},A.previewWrapper),null==m?void 0:m.previewWrapper)},{children:R?o(a,{citationNumber:1,defaultState:!0,partialMatch:!0,fixedWidth:!1,citationTitle:"Sample Citation",title:"Sample Title",paragraphs:[null==x?void 0:x.content],textToHighlight:[null==x?void 0:x.textToHighLight],externalLinkComponent:"",bookCoverImage:u,customStyle:null==m?void 0:m.citationCustomStyle,isNonHighlightedBlur:B,isBookemon:L,toggleBlur:D}):y||W?t("div",e({style:A.loadingStyle},{children:[o("div",e({style:d.iconWrapper},{children:(null==C?void 0:C.icon)||c})),t("p",e({style:d.text},W?{children:["No data found matching the selected ",k.toLowerCase()]}:{children:["fetching ",k.toLowerCase(),"...."]}))]})):o("div",e({style:A.flexCenter},{children:o("div",e({style:e(e({},A.coverContainer),H||!u?e(e({},A.coverImagePreview),null==m?void 0:m.coverImagePreview):{})},{children:u&&!H?o("img",{onError:function(){return F(!0)},style:A.bookCoverStyle,src:u,alt:"Book Cover Image"}):o("div",e({style:A.bookCoverPlaceholder},{children:t("div",e({style:A.bookCoverInner},{children:[o("div",e({style:A.bookTitle},{children:(null==h?void 0:h.title)||"Unknown Title"})),o("div",e({style:A.bookAuthor},{children:(null==h?void 0:h.author)||"Unknown Author"}))]}))}))}))}))}))]}))};export{g as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import r from"@mui/icons-material/Close";import l from"@mui/icons-material/ArrowBack";import a from"../../BookCitation/BookCitation.js";import{comingSoonStyles as d,defaultIcon as c}from"../Bookemon.js";import s from"@mui/material/Switch";import p from"@mui/material/Tooltip";var g=function(g){var h=g.bookOverView,u=g.bookCoverImage,f=g.onClose,m=g.customStyle,x=g.quotesToHighLightData,v=g.updateQuotesToHighLight,y=g.citationLoad,b=g.clickableElementCategory,k=void 0===b?"":b,C=g.comingSoonData,w=g.isNonHighlightedBlur,B=void 0!==w&&w,S=g.isBlurToggleVisible,I=void 0!==S&&S,T=g.noHtmlContent,W=void 0!==T&&T,j=g.isBookemon,L=void 0===j||j,P=i(!1),H=P[0],F=P[1],z=i(!0),D=z[0],O=z[1],R=!!x.content,A={header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"},headerLeft:{display:"flex",alignItems:"center",gap:"8px"},closeButton:{padding:"4px",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},flexCenter:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},coverContainer:{width:"100%",maxWidth:"300px",borderRadius:"12px",padding:"4px",background:"linear-gradient(135deg, #34D399, #3B82F6, #10B981)",position:"relative",overflow:"hidden",boxShadow:"0 10px 25px rgba(0,0,0,0.3)",marginBottom:"24px"},bookCoverStyle:{width:"100%",height:"auto",objectFit:"contain",borderRadius:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)"},loadingStyle:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},rightPanel:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},clickableElementCategory:{fontSize:"20px",fontWeight:600},previewWrapper:{flex:1,width:"80%",margin:"0 auto",display:"flex",flexDirection:"column",overflow:"hidden",justifyContent:"flex-start",alignItems:"center"},coverImagePreview:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"7 / 10",background:"",padding:0},toggleBlurContainer:{display:"flex",alignItems:"center",gap:"20px"},bookCoverPlaceholder:{width:"100%",height:"calc(100% - 8px)",background:"linear-gradient(to bottom, #22c55e, #14532d)",borderRadius:"4px",padding:"4px",color:"white",fontSize:"10px",display:"flex",justifyContent:"center",alignItems:"center"},bookCoverInner:{border:"1px solid white",padding:"4px",width:"calc(100% - 26px)",height:"calc(100% - 26px)",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",justifyContent:"space-around"},bookTitle:{fontWeight:800,fontSize:"1.5rem",textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.2,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",padding:"0 8px"},bookAuthor:{fontSize:"1rem",fontWeight:500,opacity:.9,marginTop:"8px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"}};return n(function(){O(!0),console.log(y,"citationLoad")},[y]),t("div",e({style:e(e({},A.rightPanel),(null==m?void 0:m.rightPanel)||{})},{children:[t("div",e({style:A.header},{children:[t("div",e({style:A.headerLeft},{children:[(R||W)&&o("button",e({style:A.closeButton,onClick:function(){return v("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:o(l,{})})),o("h2",e({style:A.clickableElementCategory},{children:k}))]})),t("div",e({style:A.toggleBlurContainer},{children:[R&&I&&t("div",e({style:{display:"flex",alignItems:"center",gap:"2px"}},{children:[o(s,{checked:D,onChange:function(e){O(e.target.checked),console.log(e.target.checked,"event.target.checked")},color:"primary",size:"small"}),t("span",e({style:{fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"4px"}},{children:["Blur",o(p,e({title:"Blur Text is enabled by default. Non-highlighted parts of the text will appear blurred to help you focus on the highlighted content. You can turn this off if you want to see all text clearly."},{children:o("span",e({style:{display:"inline-flex",justifyContent:"center",alignItems:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#485468",color:"#fff",fontSize:"10px",fontWeight:"bold",cursor:"pointer",lineHeight:"14px",userSelect:"none"}},{children:"i"}))}))]}))]})),o("button",e({style:A.closeButton,onClick:function(){f(),v("","Book Preview")},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="transparent"}},{children:o(r,{})}))]}))]})),o("div",e({style:e(e({},A.previewWrapper),null==m?void 0:m.previewWrapper)},{children:R?o(a,{citationNumber:1,defaultState:!0,partialMatch:!0,fixedWidth:!1,citationTitle:"Sample Citation",title:"Sample Title",paragraphs:[null==x?void 0:x.content],textToHighlight:[null==x?void 0:x.textToHighLight],externalLinkComponent:"",bookCoverImage:u,customStyle:null==m?void 0:m.citationCustomStyle,isNonHighlightedBlur:B,isBookemon:L,toggleBlur:D}):y||W?t("div",e({style:A.loadingStyle},{children:[o("div",e({style:d.iconWrapper},{children:(null==C?void 0:C.icon)||c})),t("p",e({style:d.text},W?{children:["No data found matching the selected ",k.toLowerCase()]}:{children:["fetching ",k.toLowerCase(),"...."]}))]})):o("div",e({style:A.flexCenter},{children:o("div",e({style:e(e({},A.coverContainer),H||!u?e(e({},A.coverImagePreview),null==m?void 0:m.coverImagePreview):{})},{children:u&&!H?o("img",{onError:function(){return F(!0)},style:A.bookCoverStyle,src:u,alt:"Book Cover Image"}):o("div",e({style:A.bookCoverPlaceholder},{children:t("div",e({style:A.bookCoverInner},{children:[o("div",e({style:A.bookTitle},{children:(null==h?void 0:h.title)||"Unknown Title"})),o("div",e({style:A.bookAuthor},{children:(null==h?void 0:h.author)||"Unknown Author"}))]}))}))}))}))}))]}))};export{g as default};
2
2
  //# sourceMappingURL=BookPreview.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsx as i}from"react/jsx-runtime";import e from"@material-ui/core/Dialog";import t from"@material-ui/core/DialogContent";import{BookemonContent as n}from"./BookemonContent.js";var r={maxWidth:"none",fontFamily:"Inter, sans-serif"},l={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},s=i("svg",o({style:l.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),a=function(l){var a=l.open,g=l.onClose,h=l.isDialog,d=void 0===h||h,m=l.isBookPreview,c=void 0===m||m,u=l.isNonHighlightedBlur,p=l.isBookemon,f=l.getHighlightContent,x=l.handleFetchManuscriptElements,B=l.data,C=l.showComingSoon,v=void 0!==C&&C,k=l.comingSoonData,w=void 0===k?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:s}:k,y=l.customStyle,S=void 0===y?{}:y,F=l.isBlurToggleVisible,D=void 0!==F&&F,b=l.highlightTerms,H=null!=g?g:function(){};return d?i(e,o({open:null!=a&&a,fullWidth:!0,PaperProps:{style:o(o({},r),null==S?void 0:S.dialogDimension)}},{children:i(t,o({style:{padding:0}},{children:i(n,{data:B,customStyle:S,comingSoonData:w,showComingSoon:v,isNonHighlightedBlur:u,isBlurToggleVisible:D,isBookemon:p,highlightTerms:b,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:c,isDialog:d,onClose:H})}))})):i("div",o({style:{width:"100%",height:"100%"}},{children:i(n,{data:B,customStyle:S,comingSoonData:w,showComingSoon:v,isNonHighlightedBlur:u,isBlurToggleVisible:D,isBookemon:p,highlightTerms:b,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:c,isDialog:d,onClose:H})}))};export{l as comingSoonStyles,a as default,s as defaultIcon};
1
+ import{__assign as o}from"tslib";import{jsx as i}from"react/jsx-runtime";import e from"@mui/material/Dialog";import t from"@mui/material/DialogContent";import{BookemonContent as n}from"./BookemonContent.js";var r={maxWidth:"none",fontFamily:"Inter, sans-serif"},l={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},s=i("svg",o({style:l.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),a=function(l){var a=l.open,g=l.onClose,h=l.isDialog,d=void 0===h||h,m=l.isBookPreview,c=void 0===m||m,u=l.isNonHighlightedBlur,p=l.isBookemon,f=l.getHighlightContent,x=l.handleFetchManuscriptElements,B=l.data,C=l.showComingSoon,v=void 0!==C&&C,k=l.comingSoonData,w=void 0===k?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:s}:k,y=l.customStyle,S=void 0===y?{}:y,F=l.isBlurToggleVisible,D=void 0!==F&&F,b=l.highlightTerms,H=null!=g?g:function(){};return d?i(e,o({open:null!=a&&a,fullWidth:!0,PaperProps:{style:o(o({},r),null==S?void 0:S.dialogDimension)}},{children:i(t,o({style:{padding:0}},{children:i(n,{data:B,customStyle:S,comingSoonData:w,showComingSoon:v,isNonHighlightedBlur:u,isBlurToggleVisible:D,isBookemon:p,highlightTerms:b,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:c,isDialog:d,onClose:H})}))})):i("div",o({style:{width:"100%",height:"100%"}},{children:i(n,{data:B,customStyle:S,comingSoonData:w,showComingSoon:v,isNonHighlightedBlur:u,isBlurToggleVisible:D,isBookemon:p,highlightTerms:b,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:c,isDialog:d,onClose:H})}))};export{l as comingSoonStyles,a as default,s as defaultIcon};
2
2
  //# sourceMappingURL=Bookemon.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as o,__generator as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@material-ui/core/Accordion";import g from"@material-ui/core/AccordionSummary";import u from"@material-ui/core/Typography";import p from"@material-ui/core/AccordionDetails";import m from"@material-ui/core/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import y from"./BookOverviewCard/BookOverviewCard.js";import v from"./BookElementsCard/BookElementsCard.js";import x from"./BookCopyrightsCard/BookCopyrightsCard.js";import b from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import C from"./BookPreview/BookPreview.js";import k from"@material-ui/icons/ExpandMore";import w from"@material-ui/icons/Close";var B={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},D={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},F=function(o){var t=o.header,n=o.subheader,l=o.icon;return r("div",e({style:D.wrapper},{children:i("div",e({style:D.inner},{children:[r("div",e({style:{marginBottom:"32px"}},{children:r("div",e({style:D.iconWrapper},{children:l}))})),i("div",{children:[r("h1",e({style:D.heading},{children:t})),r("p",e({style:D.text},{children:n}))]})]}))}))},S=function(D){var S=D.showComingSoon,H=D.onClose,j=D.highlightTerms,z=D.data,M=D.customStyle,I=D.comingSoonData,P=D.isNonHighlightedBlur,T=D.isBlurToggleVisible,A=D.isBookemon,E=D.getHighlightContent,O=D.handleFetchManuscriptElements,L=D.isBookPreview,R=D.isDialog,W=n({textToHighLight:"",content:""}),N=W[0],V=W[1],Q=n(1),Y=Q[0],q=Q[1],_=n(!1),G=_[0],J=_[1],K=n("Book Preview"),U=K[0],X=K[1],Z=n(70),$=Z[0],ee=Z[1],oe=l(null),te=n(!1),ie=te[0],re=te[1],ne=function(e,i,r,n){return void 0===n&&(n=0),o(void 0,void 0,void 0,function(){var o,l,a,d,c,s,h,g,u,p,m,f,y,v,x,b;return t(this,function(t){switch(t.label){case 0:V({textToHighLight:"",content:""}),re(!1),J(!0),X(i),t.label=1;case 1:return t.trys.push([1,5,6,7]),r&&0!==r.length?[4,null==E?void 0:E([r[n]])]:(J(!1),ee(70),null===(x=oe.current)||void 0===x||x.resize(70),[2]);case 2:if(o=t.sent(),l=(null==o?void 0:o.data)||o||[],!Array.isArray(l)||0===l.length)return re(!0),J(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(g=d.split(" ").filter(Boolean);g.length>0;){for(u=g.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(u)){c=f;break}if(c)break;g.pop()}return y=l.map(function(e){return e.htmlContent}).join("\n"),V({textToHighLight:c?c.htmlContent:"",content:y}),ee(50),null===(b=oe.current)||void 0===b||b.resize(50),!c&&n+1<r.length?[4,ne(e,i,r,n+1)]:[3,4];case 3:return[2,t.sent()];case 4:return[2];case 5:return v=t.sent(),console.error("Highlight error:",v),re(!0),[3,7];case 6:return J(!1),[7];case 7:return[2]}})})},le=n(!1),ae=le[0],de=le[1],ce=n(!1),se=ce[0],he=ce[1],ge=n(!1),ue=ge[0],pe=ge[1],me=n(!1),fe=me[0],ye=me[1],ve=n(!1),xe=ve[0],be=ve[1],Ce=n(!1),ke=Ce[0],we=Ce[1],Be=n(!1),De=Be[0],Fe=Be[1],Se=n(!1),He=Se[0],je=Se[1],ze=n(!1),Me=ze[0],Ie=ze[1],Pe=n(!1),Te=Pe[0],Ae=Pe[1];a(function(){ae&&we(!0),se&&Fe(!0),ue&&je(!0),fe&&Ie(!0),xe&&Ae(!0)},[ae,se,ue,fe,xe]);var Ee=z.bookAwards,Oe=z.bookCopyRight,Le=z.bookDetails,Re=z.bookElements,We=z.bookOverView,Ne=z.bookCoverImage,Ve=null==Le?void 0:Le.isbn,Qe=null!=H?H:function(){};return i("div",e({style:e(e({},B.dialogContent),R?B.dialogHeight:{})},{children:[!S&&r("div",e({style:B.container},{children:i(d,e({direction:"horizontal"},{children:[r(c,e({order:1,ref:oe,defaultSize:$||70},{children:i("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==M?void 0:M.leftPanel)},{children:[r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:ke,onChange:function(e,o){return we(o)},elevation:0,style:B.accordion},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Book Overview"}))})),r(p,e({style:B.accordionDetails},{children:We&&Object.keys(We).length>0?r(y,{data:We,highlightTerms:j,onHighlightMatch:de}):r("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:De,onChange:function(e,o){return Fe(o)}},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Book Manuscript Elements"}))})),r(p,e({style:B.accordionDetails},{children:r(v,{data:Re,title:(null==We?void 0:We.title)||"",handleFetchManuscriptElements:O,BookIsbn:Ve,updateQuotesToHighLight:ne,highlightTerms:j,onHighlightMatch:he})}))]}))})),r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:He,onChange:function(e,o){return je(o)},elevation:0,style:B.accordion},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Book Metadata Details"}))})),r(p,e({style:B.accordionDetails},{children:Le&&Object.keys(Le).length>0?r(f,{data:Le,highlightTerms:j,onHighlightMatch:pe}):r("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:Me,onChange:function(e,o){return Ie(o)}},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Copyrights & Marketing"}))})),r(p,e({style:B.accordionDetails},{children:Oe&&Object.keys(Oe).length>0?r(x,{data:Oe,highlightTerms:j,onHighlightMatch:ye}):r("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),r("div",{children:i(h,e({elevation:0,style:B.accordion,expanded:Te,onChange:function(e,o){return Ae(o)}},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"People & Awards"}))})),r(p,e({style:B.accordionDetails},{children:Ee&&Object.keys(Ee).length>0?r(b,{data:Ee,highlightTerms:j,onHighlightMatch:be}):r("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),L&&r(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),L&&r(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:r(C,{bookOverView:We,bookCoverImage:Ne,onClose:Qe,clickableElementCategory:U,quotesToHighLightData:N,updateQuotesToHighLight:ne,citationLoad:G,previewPage:Y,setPreviewPage:q,customStyle:M,comingSoonData:I,isNonHighlightedBlur:P,isBlurToggleVisible:T,isBookemon:A,noHtmlContent:ie})}))]}))})),S&&i("div",e({style:B.blurOverlay},{children:[r(m,e({style:B.closeButton,onClick:H},{children:r(w,{})})),r(F,{header:null==I?void 0:I.header,subheader:null==I?void 0:I.subheader,icon:null==I?void 0:I.icon})]}))]}))};export{S as BookemonContent};
1
+ import{__assign as e,__awaiter as o,__generator as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@mui/material/Accordion";import g from"@mui/material/AccordionSummary";import u from"@mui/material/Typography";import p from"@mui/material/AccordionDetails";import m from"@mui/material/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import y from"./BookOverviewCard/BookOverviewCard.js";import v from"./BookElementsCard/BookElementsCard.js";import x from"./BookCopyrightsCard/BookCopyrightsCard.js";import b from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import C from"./BookPreview/BookPreview.js";import k from"@mui/icons-material/ExpandMore";import w from"@mui/icons-material/Close";var B={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},D={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},F=function(o){var t=o.header,n=o.subheader,l=o.icon;return r("div",e({style:D.wrapper},{children:i("div",e({style:D.inner},{children:[r("div",e({style:{marginBottom:"32px"}},{children:r("div",e({style:D.iconWrapper},{children:l}))})),i("div",{children:[r("h1",e({style:D.heading},{children:t})),r("p",e({style:D.text},{children:n}))]})]}))}))},S=function(D){var S=D.showComingSoon,H=D.onClose,z=D.highlightTerms,j=D.data,M=D.customStyle,I=D.comingSoonData,P=D.isNonHighlightedBlur,T=D.isBlurToggleVisible,A=D.isBookemon,E=D.getHighlightContent,O=D.handleFetchManuscriptElements,L=D.isBookPreview,R=D.isDialog,W=n({textToHighLight:"",content:""}),N=W[0],V=W[1],Q=n(1),Y=Q[0],q=Q[1],_=n(!1),G=_[0],J=_[1],K=n("Book Preview"),U=K[0],X=K[1],Z=n(70),$=Z[0],ee=Z[1],oe=l(null),te=n(!1),ie=te[0],re=te[1],ne=function(e,i,r,n){return void 0===n&&(n=0),o(void 0,void 0,void 0,function(){var o,l,a,d,c,s,h,g,u,p,m,f,y,v,x,b;return t(this,function(t){switch(t.label){case 0:V({textToHighLight:"",content:""}),re(!1),J(!0),X(i),t.label=1;case 1:return t.trys.push([1,5,6,7]),r&&0!==r.length?[4,null==E?void 0:E([r[n]])]:(J(!1),ee(70),null===(x=oe.current)||void 0===x||x.resize(70),[2]);case 2:if(o=t.sent(),l=(null==o?void 0:o.data)||o||[],!Array.isArray(l)||0===l.length)return re(!0),J(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(g=d.split(" ").filter(Boolean);g.length>0;){for(u=g.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(u)){c=f;break}if(c)break;g.pop()}return y=l.map(function(e){return e.htmlContent}).join("\n"),V({textToHighLight:c?c.htmlContent:"",content:y}),ee(50),null===(b=oe.current)||void 0===b||b.resize(50),!c&&n+1<r.length?[4,ne(e,i,r,n+1)]:[3,4];case 3:return[2,t.sent()];case 4:return[2];case 5:return v=t.sent(),console.error("Highlight error:",v),re(!0),[3,7];case 6:return J(!1),[7];case 7:return[2]}})})},le=n(!1),ae=le[0],de=le[1],ce=n(!1),se=ce[0],he=ce[1],ge=n(!1),ue=ge[0],pe=ge[1],me=n(!1),fe=me[0],ye=me[1],ve=n(!1),xe=ve[0],be=ve[1],Ce=n(!1),ke=Ce[0],we=Ce[1],Be=n(!1),De=Be[0],Fe=Be[1],Se=n(!1),He=Se[0],ze=Se[1],je=n(!1),Me=je[0],Ie=je[1],Pe=n(!1),Te=Pe[0],Ae=Pe[1];a(function(){ae&&we(!0),se&&Fe(!0),ue&&ze(!0),fe&&Ie(!0),xe&&Ae(!0)},[ae,se,ue,fe,xe]);var Ee=j.bookAwards,Oe=j.bookCopyRight,Le=j.bookDetails,Re=j.bookElements,We=j.bookOverView,Ne=j.bookCoverImage,Ve=null==Le?void 0:Le.isbn,Qe=null!=H?H:function(){};return i("div",e({style:e(e({},B.dialogContent),R?B.dialogHeight:{})},{children:[!S&&r("div",e({style:B.container},{children:i(d,e({direction:"horizontal"},{children:[r(c,e({order:1,ref:oe,defaultSize:$||70},{children:i("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==M?void 0:M.leftPanel)},{children:[r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:ke,onChange:function(e,o){return we(o)},elevation:0,style:B.accordion},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Book Overview"}))})),r(p,e({style:B.accordionDetails},{children:We&&Object.keys(We).length>0?r(y,{data:We,highlightTerms:z,onHighlightMatch:de}):r("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:De,onChange:function(e,o){return Fe(o)}},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Book Manuscript Elements"}))})),r(p,e({style:B.accordionDetails},{children:r(v,{data:Re,title:(null==We?void 0:We.title)||"",handleFetchManuscriptElements:O,BookIsbn:Ve,updateQuotesToHighLight:ne,highlightTerms:z,onHighlightMatch:he})}))]}))})),r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:He,onChange:function(e,o){return ze(o)},elevation:0,style:B.accordion},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Book Metadata Details"}))})),r(p,e({style:B.accordionDetails},{children:Le&&Object.keys(Le).length>0?r(f,{data:Le,highlightTerms:z,onHighlightMatch:pe}):r("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),r("div",e({style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:Me,onChange:function(e,o){return Ie(o)}},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"Copyrights & Marketing"}))})),r(p,e({style:B.accordionDetails},{children:Oe&&Object.keys(Oe).length>0?r(x,{data:Oe,highlightTerms:z,onHighlightMatch:ye}):r("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),r("div",{children:i(h,e({elevation:0,style:B.accordion,expanded:Te,onChange:function(e,o){return Ae(o)}},{children:[r(g,e({expandIcon:r(k,{}),style:B.accordionSummary},{children:r(u,e({style:B.heading},{children:"People & Awards"}))})),r(p,e({style:B.accordionDetails},{children:Ee&&Object.keys(Ee).length>0?r(b,{data:Ee,highlightTerms:z,onHighlightMatch:be}):r("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),L&&r(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),L&&r(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:r(C,{bookOverView:We,bookCoverImage:Ne,onClose:Qe,clickableElementCategory:U,quotesToHighLightData:N,updateQuotesToHighLight:ne,citationLoad:G,previewPage:Y,setPreviewPage:q,customStyle:M,comingSoonData:I,isNonHighlightedBlur:P,isBlurToggleVisible:T,isBookemon:A,noHtmlContent:ie})}))]}))})),S&&i("div",e({style:B.blurOverlay},{children:[r(m,e({style:B.closeButton,onClick:H,size:"large"},{children:r(w,{})})),r(F,{header:null==I?void 0:I.header,subheader:null==I?void 0:I.subheader,icon:null==I?void 0:I.icon})]}))]}))};export{S as BookemonContent};
2
2
  //# sourceMappingURL=BookemonContent.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o,__spreadArray as n}from"tslib";import{jsxs as t,Fragment as e,jsx as i}from"react/jsx-runtime";import{useState as r,useMemo as a}from"react";import l from"./InternalChatCitationRenderer.js";import{Modal as s}from"./components/wrappers/Modal.js";import d from"./components/IconContainer.js";import{Maximize2 as c,X as u,Minimize2 as C}from"lucide-react";function h(h){var p,v,m,f,b,y=r(!1),k=y[0],w=y[1],x=r(),B=x[0],E=x[1];function g(o){w(!0),E(o)}function A(){w(!1),E(void 0)}function S(o){E(o)}var j=a(function(){var o;return!!(null===(o=h.ruleBookContainer)||void 0===o?void 0:o.data)},[null===(p=h.ruleBookContainer)||void 0===p?void 0:p.data]),z=a(function(){var o;return!!((null===(o=h.tableComponent)||void 0===o?void 0:o.rows)&&Object.keys(h.tableComponent.rows).length>0)},[h.tableComponent]);return console.log("tableComponent data:",h.tableComponent),console.log("isTableDataPresent:",z),console.log("rootContainer",h.rootContainer),console.log("chatCitation",h.chatContainer),t(e,{children:[i(l,o({},h,{showRootContainer:h.showRootContainer,tableComponent:h.tableComponent,additionalData:{isExpanded:!1},chatContainer:o(o({},h.chatContainer),{show:!0,secondaryActions:function(t){var e,r,a;return n(n([],t,!0),[(null===(a=null===(r=null===(e=h.chatContainer)||void 0===e?void 0:e.detailedTab)||void 0===r?void 0:r.chip)||void 0===a?void 0:a.isActive)&&i("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),i(d,o({onClick:function(){return g("chat")},style:{cursor:"pointer"}},{children:i(c,{size:16,color:"#64748B"})}))],!1)}}),ruleBookContainer:j?o(o({},h.ruleBookContainer),{show:!0,secondaryActions:function(t){return n(n([],t,!0),[i("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),i(d,o({onClick:function(){return g("rulebook")},style:{cursor:"pointer"}},{children:i(c,{size:16,color:"#64748B"})}))],!1)}}):void 0})),i(s,o({isOpen:k,onClose:A},{children:i(l,o({},h,{showRootContainer:h.showRootContainer,tableComponent:h.tableComponent,additionalData:{isExpanded:!0},rootContainer:o(o({},h.rootContainer),{secondaryActions:function(t){return n(n([],t,!0),[i(d,o({onClick:A,style:{cursor:"pointer"}},{children:i(u,{size:20,color:"#64748B"})}))],!1)}}),chatContainer:o(o({},h.chatContainer),{show:void 0===B?void 0:"chat"===B,secondaryActions:function(e){var r,a,l;return n(n([],e,!0),[(null===(l=null===(a=null===(r=h.chatContainer)||void 0===r?void 0:r.detailedTab)||void 0===a?void 0:a.chip)||void 0===l?void 0:l.isActive)&&(j||z)&&i("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),(j||z)&&t(d,o({style:{cursor:"pointer"}},{children:["onClick=",function(){return S("rulebook")},i(C,{size:16,color:"#64748B"})]}))],!1)},slotStyles:o(o({},h.chatContainer.slotStyles),{chatDataContainer:o(o({},null===(v=h.chatContainer.slotStyles)||void 0===v?void 0:v.chatDataContainer),{maxHeight:void 0})})}),ruleBookContainer:j?o(o({},h.ruleBookContainer),{show:void 0===B?void 0:"rulebook"===B,secondaryActions:function(t){return n(n([],t,!0),[i("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),i(d,o({style:{cursor:"pointer"},onClick:function(){return S("chat")}},{children:i(C,{size:16,color:"#64748B"})}))],!1)},slotStyles:o(o({},null===(m=h.ruleBookContainer)||void 0===m?void 0:m.slotStyles),{dataContainer:o(o({},null===(b=null===(f=h.ruleBookContainer)||void 0===f?void 0:f.slotStyles)||void 0===b?void 0:b.dataContainer),{maxHeight:void 0})})}):void 0}))}))]})}export{h as default};
1
+ import{__assign as o,__spreadArray as n}from"tslib";import{jsxs as t,Fragment as e,jsx as i}from"react/jsx-runtime";import{useState as r,useMemo as a}from"react";import l from"./InternalChatCitationRenderer.js";import{Modal as d}from"./components/wrappers/Modal.js";import s from"./components/IconContainer.js";import{Maximize2 as c,X as u}from"lucide-react";import C from"@mui/icons-material/SwapHoriz";function p(p){var v,h,m,f,y,b=r(!1),w=b[0],k=b[1],x=r(),g=x[0],B=x[1];function E(o){k(!0),B(o)}function S(){k(!1),B(void 0)}function A(o){B(o)}var D=a(function(){var o;return!!(null===(o=p.ruleBookContainer)||void 0===o?void 0:o.data)},[null===(v=p.ruleBookContainer)||void 0===v?void 0:v.data]),R=a(function(){var o;return!!((null===(o=p.tableComponent)||void 0===o?void 0:o.rows)&&Object.keys(p.tableComponent.rows).length>0)},[p.tableComponent]);return console.log("tableComponent data:",p.tableComponent),console.log("isTableDataPresent:",R),console.log("rootContainer",p.rootContainer),console.log("chatCitation",p.chatContainer),t(e,{children:[i(l,o({},p,{showRootContainer:p.showRootContainer,tableComponent:p.tableComponent,additionalData:o(o({},p.additionalData),{isExpanded:!1}),isRenderedCustomComponent:p.isRenderedCustomComponent||!1,closePreview:p.closePreview,chatContainer:o(o({},p.chatContainer),{show:!0,secondaryActions:function(t){var e,r,a;return n(n([],t,!0),[(null===(a=null===(r=null===(e=p.chatContainer)||void 0===e?void 0:e.detailedTab)||void 0===r?void 0:r.chip)||void 0===a?void 0:a.isActive)&&i("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),i(s,o({onClick:function(){return E("chat")},style:{cursor:"pointer"}},{children:i(c,{size:16,color:"#64748B"})}))],!1)}}),ruleBookContainer:D?o(o({},p.ruleBookContainer),{show:!0,secondaryActions:function(t){return n(n([],t,!0),[i("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),i(s,o({onClick:function(){return E("rulebook")},style:{cursor:"pointer"}},{children:i(c,{size:16,color:"#64748B"})}))],!1)}}):void 0})),i(d,o({isOpen:w,onClose:S},{children:i(l,o({},p,{showRootContainer:p.showRootContainer,tableComponent:p.tableComponent,additionalData:o(o({},p.additionalData),{isExpanded:!0}),rootContainer:o(o({},p.rootContainer),{secondaryActions:function(t){return n(n([],t,!0),[i(s,o({onClick:S,style:{cursor:"pointer"}},{children:i(u,{size:20,color:"#64748B"})}))],!1)}}),chatContainer:o(o({},p.chatContainer),{show:void 0===g?void 0:"chat"===g,secondaryActions:function(t){var e,r,a;return n(n([],t,!0),[(null===(a=null===(r=null===(e=p.chatContainer)||void 0===e?void 0:e.detailedTab)||void 0===r?void 0:r.chip)||void 0===a?void 0:a.isActive)&&(D||R)&&i("span",{style:{width:"1px",height:"100%",border:"1px solid #E2E8F0"}}),(D||R)&&i(s,o({style:{cursor:"pointer"},onClick:function(){return A("rulebook")}},{children:i(C,{style:{color:"gray",fontSize:22}})}))],!1)},slotStyles:o(o({},p.chatContainer.slotStyles),{chatDataContainer:o(o({},null===(h=p.chatContainer.slotStyles)||void 0===h?void 0:h.chatDataContainer),{maxHeight:void 0})})}),ruleBookContainer:D?o(o({},p.ruleBookContainer),{show:void 0===g?void 0:"rulebook"===g,secondaryActions:function(t){return n(n([],t,!0),[i("span",{style:{width:"1px",border:"1px solid #E2E8F0"}}),i(s,o({style:{cursor:"pointer"},onClick:function(){return A("chat")}},{children:i(C,{style:{color:"gray",fontSize:22}})}))],!1)},slotStyles:o(o({},null===(m=p.ruleBookContainer)||void 0===m?void 0:m.slotStyles),{dataContainer:o(o({},null===(y=null===(f=p.ruleBookContainer)||void 0===f?void 0:f.slotStyles)||void 0===y?void 0:y.dataContainer),{maxHeight:void 0})})}):void 0}))}))]})}export{p as default};
2
2
  //# sourceMappingURL=ChatCitationRenderer.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import t from"./components/Chip.js";import r from"./assets/message-chat-square.svg.js";import"@material-ui/icons/KeyboardArrowDown";import"@material-ui/icons/KeyboardArrowUp";import"@material-ui/icons/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import s from"./components/SummarizedView.js";import u from"./components/RuleBook.js";import{useState as v,useRef as c,useMemo as h,useEffect as f,useCallback as m}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import b from"./components/IconContainer.js";import{Table as y}from"lucide-react";import{BigQueryTable as g}from"./BigQueryTable.js";function x(x){var w,C,k,S,A,T,I,D,F,j,z,V,R,P,E,q,N,W,B,Y,H,K,O,Q,U,G,J,L,M,X,Z,$,_,oo,lo,io,eo,no,to,ro,ao,so=x.rootContainer,uo=x.chatContainer,vo=x.ruleBookContainer,co=x.renderer,ho=x.additionalData,fo=x.tableComponent,mo=x.showRootContainer,po=void 0===mo||mo,bo=v(0),yo=bo[0],go=bo[1],xo=v(0),wo=xo[0],Co=xo[1],ko=v(0),So=ko[0],Ao=ko[1],To=v(0),Io=To[0],Do=To[1],Fo=c(null),jo=c(null),zo=h(function(){return o(o({},p),co)},[co]),Vo=h(function(){return!!((null==fo?void 0:fo.rows)&&Object.keys(fo.rows).length>0)},[fo]);f(function(){var o,l;if((null==vo?void 0:vo.show)&&Fo.current){var i=null===(o=Fo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(go((null==i?void 0:i.length)||0),Co(0),i&&i.length>0)(e=i[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}if(uo.show&&jo.current){var e,n=null===(l=jo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Ao((null==n?void 0:n.length)||0),Do(0),n&&n.length>0)(e=n[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}},[uo.show,null==vo?void 0:vo.show,null==vo?void 0:vo.data,null==uo?void 0:uo.chatData]);var Ro=m(function(){var o;if(wo+1<yo){var l=null===(o=Fo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[wo].style.backgroundColor="#ffffb8";var i=wo+1;Co(i);var e=l[i];e.style.backgroundColor="#ffff5c",null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[wo,yo]),Po=m(function(){var o;if(!(wo-1<0)){var l=null===(o=Fo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[wo].style.backgroundColor="#ffffb8";var i=wo-1,e=l[i];e.style.backgroundColor="#ffff5c",Co(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[wo]),Eo=m(function(){var o;if(Io+1<So){var l=null===(o=jo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[Io].style.backgroundColor="#ffffb8";var i=Io+1,e=l[i];e.style.backgroundColor="#ffff5c",Do(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[Io,So]),qo=m(function(){var o;if(!(Io-1<0)){var l=null===(o=jo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[Io].style.backgroundColor="#ffffb8";var i=Io-1,e=l[i];e.style.backgroundColor="#ffff5c",Do(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[Io]),No=n((null==so?void 0:so.relevanceScore)||0),Wo=h(function(){var i;return[l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:No.border,backgroundColor:No.background,color:No.text},null===(i=null==so?void 0:so.slotStyles)||void 0===i?void 0:i.relevanceScore)},{children:[(null==so?void 0:so.relevanceTitle)||"Decision Strength",":"," ",(null==so?void 0:so.relevanceScore)||0,"%"]}),"relevance-score")]},[No.background,No.border,No.text,null==so?void 0:so.relevanceScore,null===(w=null==so?void 0:so.slotStyles)||void 0===w?void 0:w.relevanceScore,null==so?void 0:so.relevanceTitle]),Bo=h(function(){return[yo>0&&i(d,{currentItemNumber:wo+1,totalItems:yo,disableNext:wo+1>=yo,onNext:Ro,onPrevious:Po,disablePrevious:wo<=0},"rulebook-nav")]},[wo,Ro,Po,yo]),Yo=h(function(){var o,l;return[(null===(l=null===(o=null==uo?void 0:uo.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&So>0&&i(d,{currentItemNumber:Io+1,totalItems:So,onNext:Eo,onPrevious:qo,disableNext:Io+1>=So,disablePrevious:Io<=0},"chat-nav")]},[null===(k=null===(C=null==uo?void 0:uo.detailedTab)||void 0===C?void 0:C.chip)||void 0===k?void 0:k.isActive,Io,Eo,qo,So]),Ho=l("div",o({style:o({display:"flex",flexDirection:"row",gap:"12px",height:"100%"},null===(S=null==so?void 0:so.slotStyles)||void 0===S?void 0:S.container)},{children:[Vo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(A=null==uo?void 0:uo.slotStyles)||void 0===A?void 0:A.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(b,{children:i(y,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==ho?void 0:ho.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==fo?void 0:fo.rows)&&i(g,{rows:fo.rows,columns:fo.columns||[]})}))}))})),(null==vo?void 0:vo.data)&&(vo.show||void 0===vo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(T=null==vo?void 0:vo.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:i(e,o({title:null!==(I=null==vo?void 0:vo.title)&&void 0!==I?I:"Rule book",icon:null==vo?void 0:vo.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(D=null==vo?void 0:vo.slotStyles)||void 0===D?void 0:D.title)},secondaryActions:(null==vo?void 0:vo.secondaryActions)?vo.secondaryActions(Bo):Bo},{children:i("div",o({style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(F=null==vo?void 0:vo.slotStyles)||void 0===F?void 0:F.dataContainer)},{children:i("div",o({style:{position:"absolute",padding:"12px",inset:0,overflowY:"auto"},ref:Fo},{children:i(u,{data:vo.data,renderers:null!==(j=null==vo?void 0:vo.renderer)&&void 0!==j?j:zo})}))}))}))})),(uo.show||void 0===uo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(z=null==uo?void 0:uo.slotStyles)||void 0===z?void 0:z.outerContainer)},{children:i(e,o({title:null!==(V=null==uo?void 0:uo.title)&&void 0!==V?V:"Chat",icon:null==uo?void 0:uo.chatIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(R=null==uo?void 0:uo.slotStyles)||void 0===R?void 0:R.title)},primaryActions:[((null===(E=null===(P=null==uo?void 0:uo.summarizedTab)||void 0===P?void 0:P.chip)||void 0===E?void 0:E.show)||void 0===(null===(N=null===(q=null==uo?void 0:uo.summarizedTab)||void 0===q?void 0:q.chip)||void 0===N?void 0:N.show))&&i(t,o({label:"Summarized"},null===(W=null==uo?void 0:uo.summarizedTab)||void 0===W?void 0:W.chip)),i(t,o({label:"Detailed"},null===(B=null==uo?void 0:uo.detailedTab)||void 0===B?void 0:B.chip))],secondaryActions:uo.secondaryActions?null==uo?void 0:uo.secondaryActions(Yo):Yo},{children:l("div",o({style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(Y=null==uo?void 0:uo.slotStyles)||void 0===Y?void 0:Y.chatDataContainer)},{children:[(null===(K=null===(H=null==uo?void 0:uo.detailedTab)||void 0===H?void 0:H.chip)||void 0===K?void 0:K.isActive)&&i("div",o({ref:jo,style:{position:(null==ho?void 0:ho.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:uo.chatData,assistantChatProps:o(o({},null===(Q=null===(O=null==uo?void 0:uo.detailedTab)||void 0===O?void 0:O.view)||void 0===Q?void 0:Q.assistantChatProps),{renderers:null!==(J=null===(G=null===(U=null==uo?void 0:uo.detailedTab)||void 0===U?void 0:U.detailedViewRenderer)||void 0===G?void 0:G.assistantText)&&void 0!==J?J:zo}),userChatItemProps:o(o({},null===(M=null===(L=null==uo?void 0:uo.detailedTab)||void 0===L?void 0:L.view)||void 0===M?void 0:M.userChatItemProps),{renderers:null!==($=null===(Z=null===(X=null==uo?void 0:uo.detailedTab)||void 0===X?void 0:X.detailedViewRenderer)||void 0===Z?void 0:Z.userText)&&void 0!==$?$:zo})})})),(null===(oo=null===(_=null==uo?void 0:uo.summarizedTab)||void 0===_?void 0:_.chip)||void 0===oo?void 0:oo.show)&&(null===(io=null===(lo=null==uo?void 0:uo.summarizedTab)||void 0===lo?void 0:lo.chip)||void 0===io?void 0:io.isActive)&&i(s,o({chatData:uo.chatData},null===(eo=null==uo?void 0:uo.summarizedTab)||void 0===eo?void 0:eo.view,{renderer:null!==(to=null===(no=null==uo?void 0:uo.summarizedTab)||void 0===no?void 0:no.summarizedViewRenderer)&&void 0!==to?to:zo}))]}))}))}))]}));return po?i(e,o({title:null==so?void 0:so.title,slotStyles:{title:null===(ro=null==so?void 0:so.slotStyles)||void 0===ro?void 0:ro.title},icon:null!==(ao=null==so?void 0:so.icon)&&void 0!==ao?ao:i(b,{children:i("img",{src:r,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==so?void 0:so.secondaryActions)?so.secondaryActions(Wo):Wo},{children:Ho})):Ho}export{x as default};
1
+ import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import r from"./components/Chip.js";import t from"./assets/message-chat-square.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import u from"./components/SummarizedView.js";import s from"./components/RuleBook.js";import{useState as v,useRef as c,useMemo as h,useEffect as m,useCallback as f}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import b from"./components/IconContainer.js";import{Table as g}from"lucide-react";import{BigQueryTable as y}from"./BigQueryTable.js";import x from"@mui/icons-material/CloseOutlined";function w(w){var C,k,S,A,T,I,D,R,V,F,j,z,P,E,B,H,q,N,W,Y,K,O,Q,U,G,J,L,M,X,Z,$,_,oo,lo,io,eo,no,ro,to,ao,uo,so=w.rootContainer,vo=w.chatContainer,co=w.ruleBookContainer,ho=w.renderer,mo=w.additionalData,fo=w.tableComponent,po=w.closePreview,bo=w.isRenderedCustomComponent,go=void 0!==bo&&bo,yo=w.showRootContainer,xo=void 0===yo||yo,wo=w.reversePanels,Co=void 0!==wo&&wo,ko=v(0),So=ko[0],Ao=ko[1],To=v(0),Io=To[0],Do=To[1],Ro=v(0),Vo=Ro[0],Fo=Ro[1],jo=v(0),zo=jo[0],Po=jo[1],Eo=c(null),Bo=c(null),Ho=h(function(){return o(o({},p),ho)},[ho]),qo=h(function(){return!!((null==fo?void 0:fo.rows)&&Object.keys(fo.rows).length>0)},[fo]),No=h(function(){var o;return null!==(o=null==mo?void 0:mo.RuleBookDetailedViewVerticallyStacked)&&void 0!==o&&o},[null==mo?void 0:mo.RuleBookDetailedViewVerticallyStacked]);m(function(){var o,l;if((null==co?void 0:co.show)&&Eo.current){var i=null===(o=Eo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(Ao((null==i?void 0:i.length)||0),Do(0),i&&i.length>0)(e=i[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}if(vo.show&&Bo.current){var e,n=null===(l=Bo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Fo((null==n?void 0:n.length)||0),Po(0),n&&n.length>0)(e=n[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}},[vo.show,null==co?void 0:co.show,null==co?void 0:co.data,null==vo?void 0:vo.chatData]);var Wo=f(function(){var o;if(Io+1<So){var l=null===(o=Eo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[Io].style.backgroundColor="#ffffb8";var i=Io+1;Do(i);var e=l[i];e.style.backgroundColor="#ffff5c",null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[Io,So]),Yo=f(function(){var o;if(!(Io-1<0)){var l=null===(o=Eo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[Io].style.backgroundColor="#ffffb8";var i=Io-1,e=l[i];e.style.backgroundColor="#ffff5c",Do(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[Io]),Ko=f(function(){var o;if(zo+1<Vo){var l=null===(o=Bo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[zo].style.backgroundColor="#ffffb8";var i=zo+1,e=l[i];e.style.backgroundColor="#ffff5c",Po(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[zo,Vo]),Oo=f(function(){var o;if(!(zo-1<0)){var l=null===(o=Bo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[zo].style.backgroundColor="#ffffb8";var i=zo-1,e=l[i];e.style.backgroundColor="#ffff5c",Po(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[zo]),Qo=n((null==so?void 0:so.relevanceScore)||0),Uo=h(function(){var e,n=l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Qo.border,backgroundColor:Qo.background,color:Qo.text},null===(e=null==so?void 0:so.slotStyles)||void 0===e?void 0:e.relevanceScore)},{children:[(null==so?void 0:so.relevanceTitle)||"Decision Strength",":"," ",(null==so?void 0:so.relevanceScore)||0,"%"]}),"relevance-score"),r=i("span",o({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:po},{children:i(x,{})}),"close-preview");return go&&!(null==mo?void 0:mo.isExpanded)?[n,r]:[n]},[go,Qo.background,Qo.border,Qo.text,null==so?void 0:so.relevanceScore,null===(C=null==so?void 0:so.slotStyles)||void 0===C?void 0:C.relevanceScore,null==so?void 0:so.relevanceTitle]),Go=h(function(){return[So>0&&i(d,{currentItemNumber:Io+1,totalItems:So,disableNext:Io+1>=So,onNext:Wo,onPrevious:Yo,disablePrevious:Io<=0},"rulebook-nav")]},[Io,Wo,Yo,So]),Jo=h(function(){return(null==mo?void 0:mo.RuleBookContainerHeight)?mo.RuleBookContainerHeight:!(!No||(null==mo?void 0:mo.isExpanded))&&"600px"},[null==mo?void 0:mo.RuleBookContainerHeight,No]),Lo=h(function(){var o,l;return[(null===(l=null===(o=null==vo?void 0:vo.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&Vo>0&&i(d,{currentItemNumber:zo+1,totalItems:Vo,onNext:Ko,onPrevious:Oo,disableNext:zo+1>=Vo,disablePrevious:zo<=0},"chat-nav")]},[null===(S=null===(k=null==vo?void 0:vo.detailedTab)||void 0===k?void 0:k.chip)||void 0===S?void 0:S.isActive,zo,Ko,Oo,Vo]),Mo=l("div",o({style:o({display:"flex",flexDirection:Co?No?"column-reverse":"row-reverse":No?"column":"row",gap:"12px",height:Jo||"100%",minHeight:0},null===(A=null==so?void 0:so.slotStyles)||void 0===A?void 0:A.container)},{children:[qo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(T=null==vo?void 0:vo.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(b,{children:i(g,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==mo?void 0:mo.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==fo?void 0:fo.rows)&&i(y,{rows:fo.rows,columns:fo.columns||[]})}))}))})),(null==co?void 0:co.data)&&(co.show||void 0===co.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(I=null==co?void 0:co.slotStyles)||void 0===I?void 0:I.outerContainer)},{children:i(e,o({title:null!==(D=null==co?void 0:co.title)&&void 0!==D?D:"Rule book",icon:null==co?void 0:co.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(R=null==co?void 0:co.slotStyles)||void 0===R?void 0:R.title)},secondaryActions:(null==co?void 0:co.secondaryActions)?co.secondaryActions(Go):Go},{children:i("div",o({style:o({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(V=null==co?void 0:co.slotStyles)||void 0===V?void 0:V.dataContainer)},{children:i("div",o({style:{position:"absolute",padding:"12px",inset:0,overflowY:"auto"},ref:Eo},{children:i(s,{data:co.data,renderers:null!==(F=null==co?void 0:co.renderer)&&void 0!==F?F:Ho})}))}))}))})),(vo.show||void 0===vo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(j=null==vo?void 0:vo.slotStyles)||void 0===j?void 0:j.outerContainer)},{children:i(e,o({title:null!==(z=null==vo?void 0:vo.title)&&void 0!==z?z:"Chat",icon:null==vo?void 0:vo.chatIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(P=null==vo?void 0:vo.slotStyles)||void 0===P?void 0:P.title)},primaryActions:[((null===(B=null===(E=null==vo?void 0:vo.summarizedTab)||void 0===E?void 0:E.chip)||void 0===B?void 0:B.show)||void 0===(null===(q=null===(H=null==vo?void 0:vo.summarizedTab)||void 0===H?void 0:H.chip)||void 0===q?void 0:q.show))&&i(r,o({label:"Summarized"},null===(N=null==vo?void 0:vo.summarizedTab)||void 0===N?void 0:N.chip)),i(r,o({label:"Detailed"},null===(W=null==vo?void 0:vo.detailedTab)||void 0===W?void 0:W.chip))],secondaryActions:vo.secondaryActions?null==vo?void 0:vo.secondaryActions(Lo):Lo},{children:l("div",o({style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(Y=null==vo?void 0:vo.slotStyles)||void 0===Y?void 0:Y.chatDataContainer)},{children:[(null===(O=null===(K=null==vo?void 0:vo.detailedTab)||void 0===K?void 0:K.chip)||void 0===O?void 0:O.isActive)&&i("div",o({ref:Bo,style:{position:(null==mo?void 0:mo.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:vo.chatData,assistantChatProps:o(o({},null===(U=null===(Q=null==vo?void 0:vo.detailedTab)||void 0===Q?void 0:Q.view)||void 0===U?void 0:U.assistantChatProps),{renderers:null!==(L=null===(J=null===(G=null==vo?void 0:vo.detailedTab)||void 0===G?void 0:G.detailedViewRenderer)||void 0===J?void 0:J.assistantText)&&void 0!==L?L:Ho}),userChatItemProps:o(o({},null===(X=null===(M=null==vo?void 0:vo.detailedTab)||void 0===M?void 0:M.view)||void 0===X?void 0:X.userChatItemProps),{renderers:null!==(_=null===($=null===(Z=null==vo?void 0:vo.detailedTab)||void 0===Z?void 0:Z.detailedViewRenderer)||void 0===$?void 0:$.userText)&&void 0!==_?_:Ho})})})),(null===(lo=null===(oo=null==vo?void 0:vo.summarizedTab)||void 0===oo?void 0:oo.chip)||void 0===lo?void 0:lo.show)&&(null===(eo=null===(io=null==vo?void 0:vo.summarizedTab)||void 0===io?void 0:io.chip)||void 0===eo?void 0:eo.isActive)&&i(u,o({chatData:vo.chatData},null===(no=null==vo?void 0:vo.summarizedTab)||void 0===no?void 0:no.view,{renderer:null!==(to=null===(ro=null==vo?void 0:vo.summarizedTab)||void 0===ro?void 0:ro.summarizedViewRenderer)&&void 0!==to?to:Ho}))]}))}))}))]}));return xo?i(e,o({title:null==so?void 0:so.title,slotStyles:{title:null===(ao=null==so?void 0:so.slotStyles)||void 0===ao?void 0:ao.title},icon:null!==(uo=null==so?void 0:so.icon)&&void 0!==uo?uo:i(b,{children:i("img",{src:t,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==so?void 0:so.secondaryActions)?so.secondaryActions(Uo):Uo},{children:Mo})):Mo}export{w as default};
2
2
  //# sourceMappingURL=InternalChatCitationRenderer.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as r}from"react/jsx-runtime";import o from"../assets/cw_chat.svg.js";import"@material-ui/icons/KeyboardArrowDown";import"@material-ui/icons/KeyboardArrowUp";import"@material-ui/icons/Clear";import{highlightContent as i}from"../utils/helpers.js";import a from"./MarkdownRenderer.js";var l={rootRow:{display:"flex",gap:4},avatar:{width:24,height:24,flexShrink:0},contentColumn:{display:"flex",flexDirection:"column",gap:4},messageText:{fontSize:14,fontWeight:400},footerText:{fontSize:10,fontWeight:400,color:"#94A3B8"}};function s(s){var n=s.chatDetails,m=s.image,d=s.timestampFormat,h=void 0===d?"h:mm A | D MMM YYYY":d,c=s.maxWidthOfTextInPercent,f=void 0===c?60:c;s.slotClassname;var p=s.slotProps,u=s.slotStyles,g=s.renderers,x=i(n.message,[n.highlighted_text],"user-chat-highlight");return t("div",e({style:{maxWidth:"".concat(f,"%")}},{children:r("div",e({style:l.rootRow},{children:[null!=m?m:t("span",e({style:l.avatar},{children:t("img",{src:o,alt:"CW Chat"})})),r("div",e({style:l.contentColumn},{children:[t("p",e({style:e(e({},l.messageText),null==u?void 0:u.message)},null==p?void 0:p.message,{children:t(a,{content:x,renderers:g})})),r("p",e({style:e(e({},l.footerText),null==u?void 0:u.footerText)},null==p?void 0:p.footerText,{children:[n.userName," |"," ",n.timeStamp.format(h)]}))]}))]}))}))}export{s as default};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as r}from"react/jsx-runtime";import o from"../assets/cw_chat.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import{highlightContent as i}from"../utils/helpers.js";import a from"./MarkdownRenderer.js";var l={rootRow:{display:"flex",gap:4},avatar:{width:24,height:24,flexShrink:0},contentColumn:{display:"flex",flexDirection:"column",gap:4},messageText:{fontSize:14,fontWeight:400},footerText:{fontSize:10,fontWeight:400,color:"#94A3B8"}};function s(s){var n=s.chatDetails,m=s.image,d=s.timestampFormat,h=void 0===d?"h:mm A | D MMM YYYY":d,c=s.maxWidthOfTextInPercent,f=void 0===c?60:c;s.slotClassname;var p=s.slotProps,u=s.slotStyles,g=s.renderers,x=i(n.message,[n.highlighted_text],"user-chat-highlight");return t("div",e({style:{maxWidth:"".concat(f,"%")}},{children:r("div",e({style:l.rootRow},{children:[null!=m?m:t("span",e({style:l.avatar},{children:t("img",{src:o,alt:"CW Chat"})})),r("div",e({style:l.contentColumn},{children:[t("p",e({style:e(e({},l.messageText),null==u?void 0:u.message)},null==p?void 0:p.message,{children:t(a,{content:x,renderers:g})})),r("p",e({style:e(e({},l.footerText),null==u?void 0:u.footerText)},null==p?void 0:p.footerText,{children:[n.userName," |"," ",n.timeStamp.format(h)]}))]}))]}))}))}export{s as default};
2
2
  //# sourceMappingURL=AssistantChatItem.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";var n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};function o(o){var l=o.title,r=void 0===l?"User Chat":l,d=o.icon,a=o.slotStyles,c=o.primaryActions,s=o.secondaryActions,p=o.children;return i("div",e({style:n.container},{children:[i("div",e({style:n.headerRow},{children:[i("div",e({style:n.leftRow},{children:[i("div",e({style:n.iconTitleRow},{children:[t("span",{children:d}),t("span",e({style:e(e({},n.titleText),null==a?void 0:a.title)},{children:r}))]})),t("div",e({style:n.actionsRow},{children:null==c?void 0:c.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:e(e({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==s?void 0:s.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:n.body,id:"body"},{children:p}))]}))}export{o as default};
1
+ import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";var n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};function o(o){var l=o.title,r=void 0===l?"User Chat":l,d=o.icon,a=o.slotStyles,c=o.primaryActions,s=o.secondaryActions,f=o.children;return i("div",e({style:n.container},{children:[i("div",e({style:e(e({},n.headerRow),{overflowX:"auto",minHeight:"2.18rem",overflowY:"hidden",scrollbarWidth:"thin"})},{children:[i("div",e({style:n.leftRow},{children:[i("div",e({style:n.iconTitleRow},{children:[t("span",{children:d}),t("span",e({style:e(e({},n.titleText),null==a?void 0:a.title)},{children:r}))]})),t("div",e({style:n.actionsRow},{children:null==c?void 0:c.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:e(e({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==s?void 0:s.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:n.body,id:"body"},{children:f}))]}))}export{o as default};
2
2
  //# sourceMappingURL=ChatCitation.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as r}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import i from"@material-ui/icons/KeyboardArrowDown";import t from"@material-ui/icons/KeyboardArrowUp";import"@material-ui/icons/Clear";import n from"./IconContainer.js";var a={container:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},counterText:{fontSize:12,fontWeight:500},icon:function(r){return{cursor:"pointer",color:r?"gray":"inherit",fontSize:"18px"}}};function c(c){var l=c.currentItemNumber,s=c.onNext,m=c.onPrevious,u=c.totalItems,f=c.disableNext,p=c.disablePrevious;return e("span",r({style:a.container},{children:[e("span",r({style:a.counterText},{children:[l," of ",u]})),o(n,r({onClick:m},{children:o(t,{style:a.icon(!!p)})})),o(n,r({onClick:s},{children:o(i,{style:a.icon(!!f)})}))]}))}export{c as default};
1
+ import{__assign as r}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import i from"@mui/icons-material/KeyboardArrowDown";import t from"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import n from"./IconContainer.js";var a={container:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},counterText:{fontSize:12,fontWeight:500},icon:function(r){return{cursor:"pointer",color:r?"gray":"inherit",fontSize:"18px"}}};function c(c){var l=c.currentItemNumber,m=c.onNext,s=c.onPrevious,u=c.totalItems,f=c.disableNext,p=c.disablePrevious;return e("span",r({style:a.container},{children:[e("span",r({style:a.counterText},{children:[l," of ",u]})),o(n,r({onClick:s},{children:o(t,{style:a.icon(!!p)})})),o(n,r({onClick:m},{children:o(i,{style:a.icon(!!f)})}))]}))}export{c as default};
2
2
  //# sourceMappingURL=InViewNavigation.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Close as o}from"@material-ui/icons";import l from"./CodeCitationsStats.js";import{returnCitationTitle as a,returnCodeTitle as r}from"../../../utils/codeCitations.utils.js";import n from"@material-ui/core/Dialog";import s from"@material-ui/core/IconButton";import d from"@material-ui/core/DialogContent";import f from"@material-ui/core/DialogTitle";var h=function(h){var c=h.open,g=h.onClose,p=h.title,u=h.customStyles,y=h.editorChildren,x=h.fileDetails,b=h.setHighlightIndexes,S=h.highlightCodeStatsLine,v=h.setHighlightCodeStatsLine,C=h.highlightCodeStatsVariable,k=h.setHighlightCodeStatsVariable,D=h.filepath,w=h.datasource,H=void 0===w?"codebase":w;return e(n,i({open:c,onClose:g,maxWidth:"xl",fullWidth:!0,PaperProps:{style:i({},null==u?void 0:u.popupContainer)}},{children:[e(f,i({style:(null==u?void 0:u.popupTitleContainer)||{fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"bold"}},{children:[e("div",i({style:{display:"flex",flexDirection:"column"}},{children:[t("span",i({style:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:p})),e("div",i({style:{display:"flex",flexDirection:"row",gap:"5px",fontSize:"0.875rem",color:"#666",marginTop:"0.25rem"}},{children:[t("span",i({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:"File path: "})),e("span",i({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[" ",a(D,H)]}))]}))]})),t(s,i({edge:"end",onClick:g,"aria-label":"close",style:{position:"absolute",top:5,right:16}},{children:t(o,{})}))]})),e(d,i({style:i(i({},m.body),null==u?void 0:u.body)},{children:[t("div",i({style:(null==u?void 0:u.leftSection)||m.leftSection},{children:t(l,{datasource:H,fileDetails:x,setHighlightIndexes:b,highlightCodeStatsLine:S,setHighlightCodeStatsLine:v,highlightCodeStatsVariable:C,setHighlightCodeStatsVariable:k})})),e("div",i({style:m.rightSection},{children:[t("div",i({style:{minHeight:"4vh",fontWeight:"700",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:r(H)})),t("div",i({style:{width:"100%",height:"100%"}},{children:y}))]}))]}))]}))},m={body:{backgroundColor:"#fff",display:"flex",gap:"1rem",flexDirection:"row",paddingTop:"1rem",paddingRight:"1rem",paddingLeft:"1rem",minHeight:"60vh",maxWidth:"100%",overflow:"hidden"},leftSection:{display:"flex",flexDirection:"column",width:"50%",background:"#f6f6f6",borderRadius:"0.375rem",fontFamily:"Plus Jakarta Sans, sans-serif",overflowY:"scroll"},topLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},bottomLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},rightSection:{width:"50%",minHeight:"70vh",paddingLeft:"10px",backgroundColor:"#fff",zIndex:30}};export{h as default};
1
+ import{__assign as i}from"tslib";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Close as l}from"@mui/icons-material";import o from"./CodeCitationsStats.js";import{returnCitationTitle as a,returnCodeTitle as r}from"../../../utils/codeCitations.utils.js";import n from"@mui/material/Dialog";import s from"@mui/material/IconButton";import d from"@mui/material/DialogContent";import f from"@mui/material/DialogTitle";var h=function(h){var g=h.open,c=h.onClose,p=h.title,u=h.customStyles,y=h.editorChildren,x=h.fileDetails,b=h.setHighlightIndexes,S=h.highlightCodeStatsLine,v=h.setHighlightCodeStatsLine,C=h.highlightCodeStatsVariable,k=h.setHighlightCodeStatsVariable,D=h.filepath,w=h.datasource,H=void 0===w?"codebase":w;return e(n,i({open:g,onClose:c,maxWidth:"xl",fullWidth:!0,PaperProps:{style:i({},null==u?void 0:u.popupContainer)}},{children:[e(f,i({style:(null==u?void 0:u.popupTitleContainer)||{fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"bold"}},{children:[e("div",i({style:{display:"flex",flexDirection:"column"}},{children:[t("span",i({style:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:p})),e("div",i({style:{display:"flex",flexDirection:"row",gap:"5px",fontSize:"0.875rem",color:"#666",marginTop:"0.25rem"}},{children:[t("span",i({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:"File path: "})),e("span",i({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[" ",a(D,H)]}))]}))]})),t(s,i({edge:"end",onClick:c,"aria-label":"close",style:{position:"absolute",top:5,right:16},size:"large"},{children:t(l,{})}))]})),e(d,i({style:i(i({},m.body),null==u?void 0:u.body)},{children:[t("div",i({style:(null==u?void 0:u.leftSection)||m.leftSection},{children:t(o,{datasource:H,fileDetails:x,setHighlightIndexes:b,highlightCodeStatsLine:S,setHighlightCodeStatsLine:v,highlightCodeStatsVariable:C,setHighlightCodeStatsVariable:k})})),e("div",i({style:m.rightSection},{children:[t("div",i({style:{minHeight:"4vh",fontWeight:"700",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:r(H)})),t("div",i({style:{width:"100%",height:"100%"}},{children:y}))]}))]}))]}))},m={body:{backgroundColor:"#fff",display:"flex",gap:"1rem",flexDirection:"row",paddingTop:"1rem",paddingRight:"1rem",paddingLeft:"1rem",minHeight:"60vh",maxWidth:"100%",overflow:"hidden"},leftSection:{display:"flex",flexDirection:"column",width:"50%",background:"#f6f6f6",borderRadius:"0.375rem",fontFamily:"Plus Jakarta Sans, sans-serif",overflowY:"scroll"},topLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},bottomLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},rightSection:{width:"50%",minHeight:"70vh",paddingLeft:"10px",backgroundColor:"#fff",zIndex:30}};export{h as default};
2
2
  //# sourceMappingURL=CodeCitationPopup.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import i from"@material-ui/core/CircularProgress";var a=function(){return r("div",e({role:"alert","aria-busy":"true","aria-label":"Loading content",style:{color:"#242424",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem",height:"100vh",fontSize:"1rem",padding:"0 1rem",textAlign:"center"}},{children:[t(i,{size:24}),t("div",e({"aria-live":"polite"},{children:"Curating code and file statistics, please wait..."}))]}))};export{a as default};
1
+ import{__assign as e}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import i from"@mui/material/CircularProgress";var a=function(){return r("div",e({role:"alert","aria-busy":"true","aria-label":"Loading content",style:{color:"#242424",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem",height:"100vh",fontSize:"1rem",padding:"0 1rem",textAlign:"center"}},{children:[t(i,{size:24}),t("div",e({"aria-live":"polite"},{children:"Curating code and file statistics, please wait..."}))]}))};export{a as default};
2
2
  //# sourceMappingURL=Spinner.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as r}from"tslib";import{jsx as o}from"react/jsx-runtime";import t from"@material-ui/core/Tooltip";import{makeStyles as i}from"@material-ui/core/styles";var e=i(function(){return{tooltip:{fontFamily:"Plus Jakarta Sans, sans-serif",backgroundColor:"#555",color:"#fff",fontSize:12,padding:"5px 8px",borderRadius:6,maxWidth:250,textAlign:"center",whiteSpace:"normal",wordWrap:"break-word",lineHeight:1.4},arrow:{color:"#555"}}}),a=function(i){var a=i.description,l=i.children,n=e();return o(t,r({title:o("span",{children:a}),classes:{tooltip:n.tooltip,arrow:n.arrow},arrow:!0,placement:"top"},{children:o("span",r({style:{display:"inline-block"}},{children:l}))}))};export{a as default};
1
+ import{__assign as r}from"tslib";import{jsx as o}from"react/jsx-runtime";import t from"@mui/material/Tooltip";import i from"@mui/styles/makeStyles";var e=i(function(){return{tooltip:{fontFamily:"Plus Jakarta Sans, sans-serif",backgroundColor:"#555",color:"#fff",fontSize:12,padding:"5px 8px",borderRadius:6,maxWidth:250,textAlign:"center",whiteSpace:"normal",wordWrap:"break-word",lineHeight:1.4},arrow:{color:"#555"}}}),a=function(i){var a=i.description,l=i.children,n=e();return o(t,r({title:o("span",{children:a}),classes:{tooltip:n.tooltip,arrow:n.arrow},arrow:!0,placement:"top"},{children:o("span",r({style:{display:"inline-block"}},{children:l}))}))};export{a as default};
2
2
  //# sourceMappingURL=TooltipComponent.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import i from"react-virtualized-auto-sizer";import{FixedSizeList as r}from"react-window";import{Paper as n}from"@material-ui/core";import l from"@material-ui/lab/Skeleton";import d from"./paginatedTable.module.css.js";import a from"react";var c=function(c){var h=c.headers,f=c.tableData,s=c.onNextPage,p=c.loadingMore,x=void 0!==p&&p,m=c.headerRefs,u=c.totalFileRecords,b=c.columnWidth,g=void 0===b?250:b,v=c.rowHeight,w=void 0===v?45:v,y=c.style,R=c.className,S=void 0===R?"":R,z=c.styleOverrides,k=void 0===z?{}:z,C=a.useRef(null),I=a.useCallback(function(e){var t=e.visibleStopIndex;u&&f.length>=u||!x&&t>=f.length-10&&s()},[x,f.length,s,u]),N=e({color:"#111827",fontFamily:"Inter, sans-serif",fontSize:"14px",cursor:"default",padding:"12px 24px",borderBottom:"1px solid #e5e7eb",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},k.dataRow),B=e({padding:"12px 24px",borderBottom:"1px solid #e5e7eb",fontWeight:"bold",color:"#374151",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},k.headerRow),H=a.useCallback(function(o){var i=o.index,r=o.style;if(x&&i===f.length)return t("div",e({style:e(e({},r),{display:"flex",width:"".concat(h.length*g,"px"),backgroundColor:i%2==0?"#ffffff":"#f9fafb"})},{children:h.map(function(o,i){var r=i===h.length-1;return t("div",e({style:{flex:"0 0 ".concat(g,"px"),padding:"12px 24px",borderBottom:"1px solid #e5e7eb",borderRight:r?"none":"1px solid #e5e7eb",boxSizing:"border-box"}},{children:t(l,{variant:"rect",width:"100%",height:20,className:"rounded-[0.25rem]",animation:"wave"})}),"loading-".concat(i))})}));var n=f[i],d=i%2==0;return t("div",e({style:e(e({},r),{display:"flex",width:"".concat(h.length*g,"px"),backgroundColor:d?"#ffffff":"#f9fafb"})},{children:h.map(function(o,r){var l=r===h.length-1;return function(o,i,r,n){return t("div",e({title:i[o],style:e({flex:"0 0 ".concat(g,"px"),position:"relative",borderRight:n?"none":"1px solid #e5e7eb",boxSizing:"border-box"},N)},{children:i[o]}),"".concat(o,"-").concat(r))}(o,n,i,l)})}))},[h,f,x]);return t(n,e({elevation:0,style:e({border:"1px solid #e5e7eb",borderRadius:"0",height:"65vh",minHeight:"425px",overflowY:"hidden",position:"relative"},y),className:"".concat(d.custom_scrollbar," ").concat(S)},{children:o("div",e({style:{minWidth:"".concat(h.length*g,"px"),height:"100%"}},{children:[t("div",e({style:{display:"flex",backgroundColor:"#f9fafb",position:"sticky",top:0,zIndex:1,width:"".concat(h.length*g,"px")}},{children:h.map(function(o,i){var r=i===h.length-1;return t("div",e({ref:function(e){m.current[o]=e},style:e({borderRight:r?"none":"1px solid #e5e7eb",flex:"0 0 ".concat(g,"px"),boxSizing:"border-box"},B)},{children:o}),o)})})),t("div",e({style:{minHeight:"380px",height:"calc(60vh)",width:"100%"}},{children:t(i,{children:function(o){var i=o.height,n=o.width;return t(r,e({ref:C,height:i,width:n,itemCount:x?f.length+1:f.length,itemSize:w,onItemsRendered:I,overscanCount:20,style:{overflowX:"hidden"}},{children:H}))}})}))]}))}))};export{c as default};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import i from"react-virtualized-auto-sizer";import{FixedSizeList as r}from"react-window";import{Paper as n}from"@mui/material";import l from"@mui/material/Skeleton";import a from"./paginatedTable.module.css.js";import d from"react";var c=function(c){var h=c.headers,f=c.tableData,s=c.onNextPage,p=c.loadingMore,x=void 0!==p&&p,m=c.headerRefs,u=c.totalFileRecords,g=c.columnWidth,v=void 0===g?250:g,b=c.rowHeight,w=void 0===b?45:b,y=c.style,R=c.className,S=void 0===R?"":R,z=c.styleOverrides,k=void 0===z?{}:z,C=d.useRef(null),I=d.useCallback(function(e){var t=e.visibleStopIndex;u&&f.length>=u||!x&&t>=f.length-10&&s()},[x,f.length,s,u]),N=e({color:"#111827",fontFamily:"Inter, sans-serif",fontSize:"14px",cursor:"default",padding:"12px 24px",borderBottom:"1px solid #e5e7eb",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},k.dataRow),B=e({padding:"12px 24px",borderBottom:"1px solid #e5e7eb",fontWeight:"bold",color:"#374151",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},k.headerRow),H=d.useCallback(function(o){var i=o.index,r=o.style;if(x&&i===f.length)return t("div",e({style:e(e({},r),{display:"flex",width:"".concat(h.length*v,"px"),backgroundColor:i%2==0?"#ffffff":"#f9fafb"})},{children:h.map(function(o,i){var r=i===h.length-1;return t("div",e({style:{flex:"0 0 ".concat(v,"px"),padding:"12px 24px",borderBottom:"1px solid #e5e7eb",borderRight:r?"none":"1px solid #e5e7eb",boxSizing:"border-box"}},{children:t(l,{variant:"rectangular",width:"100%",height:20,className:"rounded-[0.25rem]",animation:"wave"})}),"loading-".concat(i))})}));var n=f[i],a=i%2==0;return t("div",e({style:e(e({},r),{display:"flex",width:"".concat(h.length*v,"px"),backgroundColor:a?"#ffffff":"#f9fafb"})},{children:h.map(function(o,r){var l=r===h.length-1;return function(o,i,r,n){return t("div",e({title:i[o],style:e({flex:"0 0 ".concat(v,"px"),position:"relative",borderRight:n?"none":"1px solid #e5e7eb",boxSizing:"border-box"},N)},{children:i[o]}),"".concat(o,"-").concat(r))}(o,n,i,l)})}))},[h,f,x]);return t(n,e({elevation:0,style:e({border:"1px solid #e5e7eb",borderRadius:"0",height:"65vh",minHeight:"425px",overflowY:"hidden",position:"relative"},y),className:"".concat(a.custom_scrollbar," ").concat(S)},{children:o("div",e({style:{minWidth:"".concat(h.length*v,"px"),height:"100%"}},{children:[t("div",e({style:{display:"flex",backgroundColor:"#f9fafb",position:"sticky",top:0,zIndex:1,width:"".concat(h.length*v,"px")}},{children:h.map(function(o,i){var r=i===h.length-1;return t("div",e({ref:function(e){m.current[o]=e},style:e({borderRight:r?"none":"1px solid #e5e7eb",flex:"0 0 ".concat(v,"px"),boxSizing:"border-box"},B)},{children:o}),o)})})),t("div",e({style:{minHeight:"380px",height:"calc(60vh)",width:"100%"}},{children:t(i,{children:function(o){var i=o.height,n=o.width;return t(r,e({ref:C,height:i,width:n,itemCount:x?f.length+1:f.length,itemSize:w,onItemsRendered:I,overscanCount:20,style:{overflowX:"hidden"}},{children:H}))}})}))]}))}))};export{c as default};
2
2
  //# sourceMappingURL=PaginatedTable.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as t}from"tslib";import{jsxs as e,jsx as a}from"react/jsx-runtime";import{useState as o}from"react";import i from"./PdfEditorCitation.module.css.js";import n from"@material-ui/icons/ExpandLess";import l from"@material-ui/icons/ExpandMore";import{PdfEditorContextProvider as c,WakeupServersContextProvider as r,PdfEditor as s}from"pdf-collaborative-tool";function d(d){var m=o("collapsed"),p=m[0],f=m[1];return e("div",t({className:"\n ".concat(i.citationRoot,"\n ").concat(d.citationRootClassName?d.citationRootClassName:"","\n ")},{children:[e("div",t({className:"\n ".concat(i.citationTitle,"\n ").concat(d.citationTitleClassName?d.citationTitleClassName:"","\n "),onClick:function(){f("collapsed"===p?"expanded":"collapsed")}},{children:[d.citationTitleElement,a("collapsed"===p?n:l,{})]})),a("div",t({className:"\n ".concat(i.citationBody,"\n ").concat(d.citationBodyClassName?d.citationBodyClassName:"","\n ").concat("collapsed"===p?i.citationBodyWhenCollapsed:"","\n ").concat(d.citationBodyWhenCollapsedClassName?d.citationBodyWhenCollapsedClassName:"","\n ")},{children:a(c,t({backendBaseUrl:d.pdfEditorBackendBaseUrl,rlefEventServiceBaseUrl:d.rlefEventServiceBaseUrl,currentUserId:d.currentUserId,areAnnotationsVisibleByDefault:!0},{children:a(r,t({frontendHealthCheckUrl:""},{children:a(s,{sentenceHighlightDetails:d.sentenceHighlightDetails,pdfDownloadUrl:d.pdfUrl})}))}))}))]}))}export{d as PdfEditorCitation};
1
+ import{__assign as t}from"tslib";import{jsxs as e,jsx as a}from"react/jsx-runtime";import{useState as o}from"react";import i from"./PdfEditorCitation.module.css.js";import n from"@mui/icons-material/ExpandLess";import l from"@mui/icons-material/ExpandMore";import{PdfEditorContextProvider as c,WakeupServersContextProvider as r,PdfEditor as s}from"pdf-collaborative-tool";function d(d){var m=o("collapsed"),p=m[0],f=m[1];return e("div",t({className:"\n ".concat(i.citationRoot,"\n ").concat(d.citationRootClassName?d.citationRootClassName:"","\n ")},{children:[e("div",t({className:"\n ".concat(i.citationTitle,"\n ").concat(d.citationTitleClassName?d.citationTitleClassName:"","\n "),onClick:function(){f("collapsed"===p?"expanded":"collapsed")}},{children:[d.citationTitleElement,a("collapsed"===p?n:l,{})]})),a("div",t({className:"\n ".concat(i.citationBody,"\n ").concat(d.citationBodyClassName?d.citationBodyClassName:"","\n ").concat("collapsed"===p?i.citationBodyWhenCollapsed:"","\n ").concat(d.citationBodyWhenCollapsedClassName?d.citationBodyWhenCollapsedClassName:"","\n ")},{children:a(c,t({backendBaseUrl:d.pdfEditorBackendBaseUrl,rlefEventServiceBaseUrl:d.rlefEventServiceBaseUrl,currentUserId:d.currentUserId,areAnnotationsVisibleByDefault:!0},{children:a(r,t({frontendHealthCheckUrl:""},{children:a(s,{sentenceHighlightDetails:d.sentenceHighlightDetails,pdfDownloadUrl:d.pdfUrl})}))}))}))]}))}export{d as PdfEditorCitation};
2
2
  //# sourceMappingURL=PdfEditorCitation.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as r}from"react/jsx-runtime";import{useState as l,useRef as c,useEffect as s}from"react";import a from"./ProjectAccordion.module.css.js";import u from"axios";import d from"./_components/Markdown.js";import p from"../CodeCitation/_components/TooltipComponent.js";import m from"@material-ui/core/CircularProgress";var h=function(h){var v=h.baseUrl,f=h.taskId,g=h.execSummary,y=h.citationTitle,C=h.isDisabled,x=void 0!==C&&C,k=h.disabledText,b=void 0===k?"":k,w=h.isChecked,j=h.onCheckChange,P=h.customClickHandler,_=h.chevronDownComponent,D=h.chevronUpComponent,I=h.styles,T=l(""),N=T[0],S=T[1],W=l(!1),z=W[0],B=W[1],E=l(!1),H=E[0],O=E[1],U=l(!1),V=U[0],$=U[1],A=l(!1),M=A[0],R=A[1],q=l(""),F=q[0],G=q[1],J=l(""),K=J[0],L=J[1],Q=c(null),X=l("0px"),Y=X[0],Z=X[1],ee=null!=w?w:H,te=300,ne=function(e){j?j(e):O(e)};s(function(){if(g){var e=g||"";G(e);var i=(null==e?void 0:e.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/))||[],o=(null==i?void 0:i.length)>=1?i[1].trim():null;L(o||e.slice(0,te)+"..."),S(e)}else t(void 0,void 0,void 0,function(){var e,t,i,o,r,l;return n(this,function(n){switch(n.label){case 0:$(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,u.get("".concat(v,"/analyzer/get_executive_summary?task_id=").concat(f))];case 2:return e=n.sent(),t=(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.summary)||"",G(t),i=null==t?void 0:t.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/),o=(null==i?void 0:i.length)>=1?i[1].trim():null,L(o||t.slice(0,te)+"..."),S(t),[3,4];case 3:return r=n.sent(),console.error("Error retrieving summary: ",r),S(""),[3,4];case 4:return $(!1),[2]}})})},[v,f]),s(function(){z&&Q.current?Z("".concat(Q.current.scrollHeight,"px")):Z("0px")},[z,N,M]);return i(o,{children:[r("div",e({className:a.pillButton,style:null==I?void 0:I.pillButton},{children:i("div",e({style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",cursor:"pointer",gap:"0.5rem"},onClick:function(e){!function(e){e.preventDefault(),e.stopPropagation(),P&&P(e),B(!z)}(e)}},{children:[i("label",e({style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"}},{children:[x?r(p,e({description:b},{children:r("input",{type:"checkbox",disabled:x,checked:ee,onChange:function(e){return ne(e.target.checked)},style:null==I?void 0:I.checkbox,onClick:function(e){return e.stopPropagation()}})})):r("input",{type:"checkbox",disabled:x,checked:ee,onChange:function(e){return ne(e.target.checked)},style:null==I?void 0:I.checkbox,onClick:function(e){return e.stopPropagation()}}),r("span",e({style:null==I?void 0:I.citationTitle},{children:y}))]})),z?D:_]}))})),z?r("div",e({className:a.citationWrapper,style:e({overflow:"hidden",transition:"height 0.3s ease",height:Y},null==I?void 0:I.citationWrapper)},{children:r("div",e({ref:Q,className:a.citationContent,style:null==I?void 0:I.citationContent,onClick:function(e){return e.stopPropagation()}},{children:V?i("div",e({style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[r(m,{size:24}),r("span",{children:" Retrieving project's executive summary..."})]})):i(o,{children:[r(d,{text:F?M||N.length<=te?N:""!==K?K:N.slice(0,te)+"...":"Executive summary not found."}),F&&N.length>te&&r("span",e({style:{color:"#4f46e5",cursor:"pointer",fontWeight:500},onClick:function(e){e.stopPropagation(),function(e){e.stopPropagation(),R(function(e){return!e})}(e)}},{children:M?"View less":"View more"}))]})}))})):r(o,{})]})};export{h as default};
1
+ import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as r}from"react/jsx-runtime";import{useState as l,useRef as c,useEffect as s}from"react";import a from"./ProjectAccordion.module.css.js";import u from"axios";import d from"./_components/Markdown.js";import p from"../CodeCitation/_components/TooltipComponent.js";import m from"@mui/material/CircularProgress";var h=function(h){var v=h.baseUrl,f=h.taskId,g=h.execSummary,y=h.citationTitle,C=h.isDisabled,x=void 0!==C&&C,k=h.disabledText,b=void 0===k?"":k,w=h.isChecked,j=h.onCheckChange,P=h.customClickHandler,_=h.chevronDownComponent,D=h.chevronUpComponent,I=h.styles,T=l(""),N=T[0],S=T[1],W=l(!1),z=W[0],B=W[1],E=l(!1),H=E[0],O=E[1],U=l(!1),V=U[0],$=U[1],A=l(!1),M=A[0],R=A[1],q=l(""),F=q[0],G=q[1],J=l(""),K=J[0],L=J[1],Q=c(null),X=l("0px"),Y=X[0],Z=X[1],ee=null!=w?w:H,te=300,ne=function(e){j?j(e):O(e)};s(function(){if(g){var e=g||"";G(e);var i=(null==e?void 0:e.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/))||[],o=(null==i?void 0:i.length)>=1?i[1].trim():null;L(o||e.slice(0,te)+"..."),S(e)}else t(void 0,void 0,void 0,function(){var e,t,i,o,r,l;return n(this,function(n){switch(n.label){case 0:$(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,u.get("".concat(v,"/analyzer/get_executive_summary?task_id=").concat(f))];case 2:return e=n.sent(),t=(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.summary)||"",G(t),i=null==t?void 0:t.match(/(\*\*Overview\*\*\s*[\s\S]*?)(?=\n\*\*|$)/),o=(null==i?void 0:i.length)>=1?i[1].trim():null,L(o||t.slice(0,te)+"..."),S(t),[3,4];case 3:return r=n.sent(),console.error("Error retrieving summary: ",r),S(""),[3,4];case 4:return $(!1),[2]}})})},[v,f]),s(function(){z&&Q.current?Z("".concat(Q.current.scrollHeight,"px")):Z("0px")},[z,N,M]);return i(o,{children:[r("div",e({className:a.pillButton,style:null==I?void 0:I.pillButton},{children:i("div",e({style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",cursor:"pointer",gap:"0.5rem"},onClick:function(e){!function(e){e.preventDefault(),e.stopPropagation(),P&&P(e),B(!z)}(e)}},{children:[i("label",e({style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"}},{children:[x?r(p,e({description:b},{children:r("input",{type:"checkbox",disabled:x,checked:ee,onChange:function(e){return ne(e.target.checked)},style:null==I?void 0:I.checkbox,onClick:function(e){return e.stopPropagation()}})})):r("input",{type:"checkbox",disabled:x,checked:ee,onChange:function(e){return ne(e.target.checked)},style:null==I?void 0:I.checkbox,onClick:function(e){return e.stopPropagation()}}),r("span",e({style:null==I?void 0:I.citationTitle},{children:y}))]})),z?D:_]}))})),z?r("div",e({className:a.citationWrapper,style:e({overflow:"hidden",transition:"height 0.3s ease",height:Y},null==I?void 0:I.citationWrapper)},{children:r("div",e({ref:Q,className:a.citationContent,style:null==I?void 0:I.citationContent,onClick:function(e){return e.stopPropagation()}},{children:V?i("div",e({style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[r(m,{size:24}),r("span",{children:" Retrieving project's executive summary..."})]})):i(o,{children:[r(d,{text:F?M||N.length<=te?N:""!==K?K:N.slice(0,te)+"...":"Executive summary not found."}),F&&N.length>te&&r("span",e({style:{color:"#4f46e5",cursor:"pointer",fontWeight:500},onClick:function(e){e.stopPropagation(),function(e){e.stopPropagation(),R(function(e){return!e})}(e)}},{children:M?"View less":"View more"}))]})}))})):r(o,{})]})};export{h as default};
2
2
  //# sourceMappingURL=ProjectAccordion.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as i,Fragment as n}from"react/jsx-runtime";import t from"../../CitationRenderer/CitationRenderer.js";import o from"./components/AiReasoningCitationContent.js";var e=function(e){var a=e.title,r=e.aiReason,c=e.citationList,s=e.aiReasoningAccordionProps,l=e.projectDetails,p=e.cachingConfig,f=e.titleConfig,g=e.iconConfig,m=e.styles,d=e.citationStyles;return i(t,{inLineCitation:!0,citationTitle:a,citationIcon:i(n,{}),citationComponent:i(o,{aiReason:r,citationsList:c,projectDetails:l,aiReasoningAccordionProps:s,cachingConfig:p,titleConfig:f,iconConfig:g,styles:m,citationStyles:d}),chevronDownComponent:i(function(){return i("i",{className:"pi pi-angle-down",style:{color:"#4B5563"}})},{}),chevronUpComponent:i(function(){return i("i",{className:"pi pi-angle-up",style:{color:"#4B5563"}})},{}),styles:{pillButton:{margin:"0px",padding:"2px 6px",fontSize:"15px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",background:"#ffffffff",fontWeight:"700",border:"none"},citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})};export{e as default};
1
+ import{jsx as n,Fragment as t}from"react/jsx-runtime";import i from"../../CitationRenderer/CitationRenderer.js";import o from"./components/AiReasoningCitationContent.js";import e from"./components/ChatCitationTestForAiReasoning.js";import r from"@mui/icons-material/ChatBubbleOutlineOutlined";var a=function(a){var c=a.title,s=a.aiReason,l=a.citationList,p=a.aiReasoningAccordionProps,f=a.projectDetails,m=a.cachingConfig,u=a.titleConfig,C=a.iconConfig,g=a.styles,d=a.citationStyles;return n(i,{inLineCitation:!0,citationTitle:c,citationIcon:n(t,{}),citationComponent:n(o,{renderCustomComponent:function(t){var i=t.close;return n(e,{closePreview:i})},CustomComponentIcon:function(){return n(r,{style:{fontSize:15}})},isCustomComponent:!0,aiReason:s,citationsList:l,projectDetails:f,aiReasoningAccordionProps:p,cachingConfig:m,titleConfig:u,iconConfig:C,styles:g,citationStyles:d}),chevronDownComponent:n(function(){return n("i",{className:"pi pi-angle-down",style:{color:"#4B5563"}})},{}),chevronUpComponent:n(function(){return n("i",{className:"pi pi-angle-up",style:{color:"#4B5563"}})},{}),styles:{pillButton:{margin:"0px",padding:"2px 6px",fontSize:"15px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",background:"#ffffffff",fontWeight:"700",border:"none"},citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})};export{a as default};
2
2
  //# sourceMappingURL=AiReasoningCitation.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as i,__assign as t}from"tslib";import{jsx as n,Fragment as o}from"react/jsx-runtime";import{useRef as e,useMemo as a,Suspense as l}from"react";import r from"react-markdown";import c from"rehype-raw";import d from"./AiReasonMarkdownWrapper.module.css.js";import s from"./citationRenderers/ImageCitation.js";import u from"./citationRenderers/FileCitation.js";import m from"./citationRenderers/WebCitationWithImage.js";import h from"../../../Bookemon/BookemonCitationLayer.js";var v=function(v){var p=v.message,f=v.setOpenCitationType,_=v.setOpenCitationDetails,b=v.citationsList,g=v.projectDetails,k=v.citationIconConfig,y=e(null),C=a(function(){return{h1:function(o){o.node;var e=i(o,["node"]);return n("h1",t({className:d.h1},{children:e.children}))},h2:function(o){o.node;var e=i(o,["node"]);return n("h2",t({className:d.h2},{children:e.children}))},h3:function(o){o.node;var e=i(o,["node"]);return n("h3",t({className:d.h3},{children:e.children}))},b:function(o){o.node;var e=i(o,["node"]);return n("b",t({className:d.bold},{children:e.children}))},p:function(o){o.node;var e=i(o,["node"]);return n("p",t({},e,{className:d.paragraph},{children:e.children}))},ol:function(o){o.node;var e=i(o,["node"]);return n("ol",t({className:d.orderedList},{children:e.children}))},ul:function(o){o.node;var e=i(o,["node"]);return n("ul",t({className:d.unorderedList},{children:e.children}))},a:function(e){var a,r,c,d,v,p,g,y;e.inline;var C=e.children;e.node;var M=i(e,["inline","children","node"]),N="".concat(null==M?void 0:M.href),w=null===(a=N.split("$"))||void 0===a?void 0:a[0],I=null===(r=N.split("$"))||void 0===r?void 0:r[1],O=("appmode_citation"===w?(null==b?void 0:b.appmod_citations)||[]:"image_citation"===w?(null==b?void 0:b.image_citations)||[]:"audio_citation"===w?(null==b?void 0:b.audio_citations)||[]:"document_citation"===w?(null==b?void 0:b.file_citations)||[]:"rca_citation"===w?(null==b?void 0:b.rca_citations)||[]:"web_citation"===w?(null==b?void 0:b.web_citations)||[]:"bookemon_citation"===w&&(null==b?void 0:b.bookemon_citations)||[]).find(function(i){return i.citation_number===I});if("image_citation"===(null==O?void 0:O.customMetadata.type))return n(l,t({fallback:n(o,{})},{children:n(s,{title:"".concat(C),citation:O,setOpenCitationType:f,setOpenCitationDetails:_,citationIcon:null==k?void 0:k.imageIcon})}));if("book_citation_doc"===(null===(c=null==O?void 0:O.customMetadata)||void 0===c?void 0:c.type)||"book_citation_pdf"===(null==O?void 0:O.customMetadata.type))return n(l,t({fallback:n(o,{})},{children:n(u,{title:"".concat(C),citation:O,setOpenCitationType:f,setOpenCitationDetails:_,citationIcon:null==k?void 0:k.fileIcon})}));if("web_citation"===(null===(d=null==O?void 0:O.customMetadata)||void 0===d?void 0:d.type)){if(null===(v=O.customMetadata)||void 0===v?void 0:v.screenshot_url)return n(m,{title:C,citation:O,setOpenCitationDetails:_,setOpenCitationType:f,citationIcon:null==k?void 0:k.webIcon})}else if("bookemon_citation"===(null===(p=null==O?void 0:O.customMetadata)||void 0===p?void 0:p.type))return n(l,t({fallback:n(o,{})},{children:n(h,{title:C,bookemonPayload:t(t({},O.customMetadata.bookemonPayload),{highlightTerms:(null===(g=O.customMetadata)||void 0===g?void 0:g.highlighted_text)?[null===(y=O.customMetadata)||void 0===y?void 0:y.highlighted_text]:O.customMetadata.bookemonPayload.highlightTerms})})}));return n(o,{})},code:function(i){i.inline;var o=i.children,e=i.className;return/language-(\w+)/.exec(e||"")||(null==e?void 0:e.includes("language-"))?n("div",{children:n("code",t({className:d.blockCode},{children:o}))}):n("code",t({className:d.inlineCode},{children:o}))}}},[g,b]);return n("div",t({ref:y,className:d.wrapper},{children:n(r,t({components:C,rehypePlugins:[c]},{children:p}))}))};export{v as AiReasonMarkdownWrapper};
1
+ import{__rest as i,__assign as n}from"tslib";import{jsx as t,Fragment as e,jsxs as o}from"react/jsx-runtime";import{useRef as a,useMemo as l,Suspense as r}from"react";import c from"react-markdown";import d from"rehype-raw";import s from"./AiReasonMarkdownWrapper.module.css.js";import u from"./citationRenderers/ImageCitation.js";import m from"./citationRenderers/FileCitation.js";import p from"./citationRenderers/WebCitationWithImage.js";import h from"../../../Bookemon/BookemonCitationLayer.js";var v=function(v){var f=v.message,g=v.gap,_=v.setOpenCitationType,b=v.setOpenCitationDetails,y=v.citationsList,C=v.projectDetails,k=v.citationIconConfig,x=v.setSelectedIdFromReason;v.isCustomComponent;var I=v.relevance_score,M=v.CustomComponentIcon,N=a(null),T=function(i,n){return i<100?"The relevance score is ".concat(i,"% because:\n").concat(n):n},w=l(function(){return{h1:function(e){e.node;var o=i(e,["node"]);return t("h1",n({className:s.h1},{children:o.children}))},h2:function(e){e.node;var o=i(e,["node"]);return t("h2",n({className:s.h2},{children:o.children}))},h3:function(e){e.node;var o=i(e,["node"]);return t("h3",n({className:s.h3},{children:o.children}))},b:function(e){e.node;var o=i(e,["node"]);return t("b",n({className:s.bold},{children:o.children}))},p:function(e){e.node;var o=i(e,["node"]);return t("p",n({},o,{className:s.paragraph},{children:o.children}))},ol:function(e){e.node;var o=i(e,["node"]);return t("ol",n({className:s.orderedList},{children:o.children}))},ul:function(e){e.node;var o=i(e,["node"]);return t("ul",n({className:s.unorderedList},{children:o.children}))},a:function(a){var l,c,d,s,v,f,g,C,I;a.inline;var N=a.children;a.node;var T=i(a,["inline","children","node"]);if(!T.href)return t(e,{children:N});var w="".concat(null==T?void 0:T.href),j=null===(l=w.split("$"))||void 0===l?void 0:l[0],O=null===(c=w.split("$"))||void 0===c?void 0:c[1],D=("appmode_citation"===j?(null==y?void 0:y.appmod_citations)||[]:"image_citation"===j?(null==y?void 0:y.image_citations)||[]:"audio_citation"===j?(null==y?void 0:y.audio_citations)||[]:"document_citation"===j?(null==y?void 0:y.file_citations)||[]:"rca_citation"===j?(null==y?void 0:y.rca_citations)||[]:"web_citation"===j?(null==y?void 0:y.web_citations)||[]:"bookemon_citation"===j?(null==y?void 0:y.bookemon_citations)||[]:"custom_citations"===j&&(null==y?void 0:y.custom_citations)||[]).find(function(i){return i.citation_number===O});if("image_citation"===(null==D?void 0:D.customMetadata.type))return t(r,n({fallback:t(e,{})},{children:t(u,{title:"".concat(N),citation:D,setOpenCitationType:_,setOpenCitationDetails:b,citationIcon:null==k?void 0:k.imageIcon})}));if("book_citation_doc"===(null===(d=null==D?void 0:D.customMetadata)||void 0===d?void 0:d.type)||"book_citation_pdf"===(null==D?void 0:D.customMetadata.type))return t(r,n({fallback:t(e,{})},{children:t(m,{title:"".concat(N),citation:D,setOpenCitationType:_,setOpenCitationDetails:b,citationIcon:null==k?void 0:k.fileIcon})}));if("web_citation"===(null===(s=null==D?void 0:D.customMetadata)||void 0===s?void 0:s.type)){if(null===(v=D.customMetadata)||void 0===v?void 0:v.screenshot_url)return t(p,{title:N,citation:D,setOpenCitationDetails:b,setOpenCitationType:_,citationIcon:null==k?void 0:k.webIcon})}else{if("bookemon_citation"===(null===(f=null==D?void 0:D.customMetadata)||void 0===f?void 0:f.type))return t(r,n({fallback:t(e,{})},{children:t(h,{title:N,bookemonPayload:n(n({},D.customMetadata.bookemonPayload),{highlightTerms:(null===(g=D.customMetadata)||void 0===g?void 0:g.highlighted_text)?[null===(C=D.customMetadata)||void 0===C?void 0:C.highlighted_text]:D.customMetadata.bookemonPayload.highlightTerms})})}));if("custom_citations"===(null===(I=null==D?void 0:D.customMetadata)||void 0===I?void 0:I.type))return o("a",n({style:{textDecoration:"none",color:"#526eff",display:"inline-flex",alignItems:"center",gap:"4px"},href:T.href.startsWith("javascript:")?"#":T.href,onClick:function(i){i.preventDefault(),null==x||x(T.href),null==_||_("custom"),null==b||b(D)}},{children:[N,M&&t(M,{})]}))}return t(e,{})},code:function(i){i.inline;var e=i.children,o=i.className;return/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?t("div",{children:t("code",n({className:s.blockCode},{children:e}))}):t("code",n({className:s.inlineCode},{children:e}))}}},[C,y]);return o("div",n({ref:N,className:s.wrapper},{children:[null==f?void 0:f.map(function(i,e){var a,l;return o("div",n({style:{display:"flex",gap:"8px",alignItems:"flex-start",marginTop:2}},{children:[o("span",n({style:{fontWeight:400,color:null!==(l=null===(a=s.paragraph)||void 0===a?void 0:a.color)&&void 0!==l?l:"black",marginTop:"2px",fontSize:"0.9rem"}},{children:[e+1,"."]})),t(c,n({components:w,rehypePlugins:[d]},{children:i}))]}),e)}),g&&g.map(function(i,e){var a,l;return o("div",n({style:{display:"flex",gap:"8px",alignItems:"flex-start",marginTop:"16px"}},{children:[o("span",n({style:{fontWeight:400,color:null!==(l=null===(a=s.paragraph)||void 0===a?void 0:a.color)&&void 0!==l?l:"black",marginTop:"2px",fontSize:"0.9rem"}},{children:[e+1,"."]})),t("div",{children:t("p",n({className:s.paragraph},{children:T(I||0,i)}))})]}),e)})]}))};export{v as AiReasonMarkdownWrapper};
2
2
  //# sourceMappingURL=AiReasonMarkdownWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import e,{useState as t}from"react";import{AiReasonMarkdownWrapper as l}from"./AiReasonMarkdownWrapper.js";import a from"./AiReasoningCitationPreview.js";import s from"./icons/AiReasoningIcon.js";import{renderAIConfidenceDisplay as c}from"./AIConfidenceDisplay.js";import r from"./AiReasonAccordion.js";import d from"./icons/AiGapIcon.js";import p from"./icons/ReasoningBulbIcon.js";import v from"./AiReasoningCitationContent.module.css.js";var u=function(u){var m,g,f,y,C,h,A,T,R,j,I,W=u.aiReason,b=u.citationsList,D=u.projectDetails,N=u.aiReasoningAccordionProps,P=u.cachingConfig,x=u.iconConfig,w=u.titleConfig,L=u.styles,O=u.citationStyles,E=t("noCitation"),_=E[0],k=E[1],G=t(null),M=G[0],S=G[1],B="noCitation"!==_&&null!==M;return n("div",i({className:v.container,style:null==L?void 0:L.container},{children:[n("div",i({className:v.header,style:null==L?void 0:L.header},{children:[n("div",i({className:v.headerLeft,style:null==L?void 0:L.headerLeft},{children:[(null==x?void 0:x.citationIcon)?e.createElement(x.citationIcon):o(s,{}),o("p",{children:null!==(m=null==w?void 0:w.titleText)&&void 0!==m?m:"Cognitive Decisioning AI"})]})),!isNaN(null==W?void 0:W.relevance_score)&&c(W.relevance_score,null==L?void 0:L.aiConfidenceDisplayPill)]})),n("div",i({className:v.body,style:null==L?void 0:L.body},{children:[n("div",i({className:"".concat(v.accordionWrapper," ").concat(B?v.withPreview:""),style:null==L?void 0:L.accordionWrapper},{children:[o(r,{icon:(null==x?void 0:x.reasoningIcon)?e.createElement(x.reasoningIcon):o("div",i({className:v.iconWrapper,style:null==L?void 0:L.iconWrapper},{children:o(p,{})})),title:null!==(f=null===(g=null==w?void 0:w.reason)||void 0===g?void 0:g.titleText)&&void 0!==f?f:"Reasoning",subTitle:null!==(C=null===(y=null==w?void 0:w.reason)||void 0===y?void 0:y.subTitleText)&&void 0!==C?C:"Why This Was Picked",content:o(l,{message:W.reason,setOpenCitationType:k,setOpenCitationDetails:S,projectDetails:D,citationsList:b}),aiReasoningAccordionProps:N,styles:null==L?void 0:L.aiReasoningAccordian}),o(r,{icon:(null==x?void 0:x.gapIcon)?e.createElement(x.gapIcon):o("div",i({className:v.iconWrapper,style:null==L?void 0:L.iconWrapper},{children:o(d,{})})),title:null!==(A=null===(h=null==w?void 0:w.gap)||void 0===h?void 0:h.titleText)&&void 0!==A?A:"Gap",subTitle:null!==(R=null===(T=null==w?void 0:w.gap)||void 0===T?void 0:T.subTitleText)&&void 0!==R?R:"What's Missing or Unclear",content:o(l,{message:(j=W.relevance_score,I=W.gap,j<100?"The relevance score is ".concat(j,"% because:\n").concat(I):I),setOpenCitationType:k,setOpenCitationDetails:S,projectDetails:D,citationsList:b}),aiReasoningAccordionProps:N,styles:null==L?void 0:L.aiReasoningAccordian})]})),B&&o(a,{openCitationType:_,openCitationDetails:M,handleCloseCitationPreview:function(){k("noCitation"),S(null)},cachingConfig:P,styles:null==L?void 0:L.citationPreview,citationStyles:O})]}))]}))};export{u as default};
1
+ import{__assign as i}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import e,{useState as t}from"react";import{AiReasonMarkdownWrapper as l}from"./AiReasonMarkdownWrapper.js";import a from"./AiReasoningCitationPreview.js";import s from"./icons/AiReasoningIcon.js";import{renderAIConfidenceDisplay as r}from"./AIConfidenceDisplay.js";import c from"./AiReasonAccordion.js";import d from"./icons/AiGapIcon.js";import p from"./icons/ReasoningBulbIcon.js";import m from"./AiReasoningCitationContent.module.css.js";var u=function(u){var v,C,g,f,y,h,I,R,A,T=u.aiReason,j=u.citationsList,W=u.projectDetails,D=u.aiReasoningAccordionProps,N=u.cachingConfig,P=u.iconConfig,b=u.titleConfig,x=u.styles,w=u.citationStyles,L=u.renderCustomComponent,O=u.isCustomComponent,_=u.CustomComponentIcon,E=t("noCitation"),S=E[0],k=E[1],F=t(null),G=F[0],M=F[1],B=t(null),U=B[0],q=B[1],z="noCitation"!==S&&null!==G;return o("div",i({className:m.container,style:null==x?void 0:x.container},{children:[o("div",i({className:m.header,style:null==x?void 0:x.header},{children:[o("div",i({className:m.headerLeft,style:null==x?void 0:x.headerLeft},{children:[(null==P?void 0:P.citationIcon)?e.createElement(P.citationIcon):n(s,{}),n("p",{children:null!==(v=null==b?void 0:b.titleText)&&void 0!==v?v:"Cognitive Decisioning AI"})]})),!isNaN(null==T?void 0:T.relevance_score)&&r(T.relevance_score,null==x?void 0:x.aiConfidenceDisplayPill)]})),o("div",i({className:m.body,style:null==x?void 0:x.body},{children:[o("div",i({className:"".concat(m.accordionWrapper," ").concat(z?m.withPreview:""),style:null==x?void 0:x.accordionWrapper},{children:[n(c,{icon:(null==P?void 0:P.reasoningIcon)?e.createElement(P.reasoningIcon):n("div",i({className:m.iconWrapper,style:null==x?void 0:x.iconWrapper},{children:n(p,{})})),title:null!==(g=null===(C=null==b?void 0:b.reason)||void 0===C?void 0:C.titleText)&&void 0!==g?g:"Reasoning",subTitle:null!==(y=null===(f=null==b?void 0:b.reason)||void 0===f?void 0:f.subTitleText)&&void 0!==y?y:"Why This Was Picked",content:n(l,{CustomComponentIcon:_,isCustomComponent:O||!1,setSelectedIdFromReason:q,message:T.reason,setOpenCitationType:k,setOpenCitationDetails:M,projectDetails:W,citationsList:j}),aiReasoningAccordionProps:D,styles:null==x?void 0:x.aiReasoningAccordian}),n(c,{icon:(null==P?void 0:P.gapIcon)?e.createElement(P.gapIcon):n("div",i({className:m.iconWrapper,style:null==x?void 0:x.iconWrapper},{children:n(d,{})})),title:null!==(I=null===(h=null==b?void 0:b.gap)||void 0===h?void 0:h.titleText)&&void 0!==I?I:"Gap",subTitle:null!==(A=null===(R=null==b?void 0:b.gap)||void 0===R?void 0:R.subTitleText)&&void 0!==A?A:"What's Missing or Unclear",content:n(l,{relevance_score:T.relevance_score,gap:T.gap,setOpenCitationType:k,setOpenCitationDetails:M,projectDetails:W,citationsList:j}),aiReasoningAccordionProps:D,styles:null==x?void 0:x.aiReasoningAccordian})]})),z&&n(a,{isCustomComponent:O,selectedIdFromReason:U,renderCustomComponent:L,openCitationType:S,openCitationDetails:G,handleCloseCitationPreview:function(){k("noCitation"),M(null)},cachingConfig:N,styles:null==x?void 0:x.citationPreview,citationStyles:w})]}))]}))};export{u as default};
2
2
  //# sourceMappingURL=AiReasoningCitationContent.js.map