@viswa-test/test-citation 0.0.10 → 0.0.12

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 (68) hide show
  1. package/README.md +118 -2
  2. package/dist/assests/svg/SparkleIcon.js +2 -0
  3. package/dist/assests/svg/SparkleIcon.js.map +1 -0
  4. package/dist/cjs/assests/svg/SparkleIcon.js +2 -0
  5. package/dist/cjs/assests/svg/SparkleIcon.js.map +1 -0
  6. package/dist/cjs/features/ChatDrawer/ChatDrawer.js +1 -1
  7. package/dist/cjs/features/CitationRenderer/MarkdownRenderer.module.css.js +1 -1
  8. package/dist/cjs/features/CodeCitation/_components/TooltipComponent.js +1 -1
  9. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +2 -0
  10. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js.map +1 -0
  11. package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js +1 -1
  12. package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  13. package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
  14. package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
  15. package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
  16. package/dist/cjs/features/ScannedDocCitation/ScannedDocCitation.js +1 -1
  17. package/dist/cjs/features/SplitterCitations/Splitter.module.css.js +2 -0
  18. package/dist/cjs/features/SplitterCitations/Splitter.module.css.js.map +1 -0
  19. package/dist/cjs/features/SplitterCitations/SplitterCitationsComponent.js +2 -0
  20. package/dist/cjs/features/SplitterCitations/SplitterCitationsComponent.js.map +1 -0
  21. package/dist/cjs/features/TableCitation/TableCitationContent.module.css.js +1 -1
  22. package/dist/cjs/index.js +1 -1
  23. package/dist/features/ChatDrawer/ChatDrawer.js +1 -1
  24. package/dist/features/CitationRenderer/MarkdownRenderer.module.css.js +1 -1
  25. package/dist/features/CodeCitation/_components/TooltipComponent.js +1 -1
  26. package/dist/features/CognitiveCompare/CognitiveCompare.js +2 -0
  27. package/dist/features/CognitiveCompare/CognitiveCompare.js.map +1 -0
  28. package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js +1 -1
  29. package/dist/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
  30. package/dist/features/PdfViewer/PdfToolbar.js +1 -1
  31. package/dist/features/PdfViewer/PdfViewer.js +1 -1
  32. package/dist/features/PdfViewer/usePdfHighlight.js +1 -1
  33. package/dist/features/ScannedDocCitation/ScannedDocCitation.js +1 -1
  34. package/dist/features/SplitterCitations/Splitter.module.css.js +2 -0
  35. package/dist/features/SplitterCitations/Splitter.module.css.js.map +1 -0
  36. package/dist/features/SplitterCitations/SplitterCitationsComponent.js +2 -0
  37. package/dist/features/SplitterCitations/SplitterCitationsComponent.js.map +1 -0
  38. package/dist/features/TableCitation/TableCitationContent.module.css.js +1 -1
  39. package/dist/index.js +1 -1
  40. package/dist/types/src/PdfViewerTest.d.ts +3 -1
  41. package/dist/types/src/PdfViewerTest.d.ts.map +1 -1
  42. package/dist/types/src/assests/svg/SparkleIcon.d.ts +3 -0
  43. package/dist/types/src/assests/svg/SparkleIcon.d.ts.map +1 -0
  44. package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts +2 -0
  45. package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts.map +1 -1
  46. package/dist/types/src/features/CodeCitation/_components/TooltipComponent.d.ts.map +1 -1
  47. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +109 -0
  48. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -0
  49. package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.d.ts +2 -0
  50. package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.d.ts.map +1 -1
  51. package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningTest.d.ts.map +1 -1
  52. package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts +6 -1
  53. package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
  54. package/dist/types/src/features/PdfViewer/PdfViewer.d.ts +22 -1
  55. package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
  56. package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts +4 -2
  57. package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
  58. package/dist/types/src/features/ScannedDocCitation/ScannedDocCitation.d.ts +9 -1
  59. package/dist/types/src/features/ScannedDocCitation/ScannedDocCitation.d.ts.map +1 -1
  60. package/dist/types/src/features/SplitterCitations/SplitterCitationsComponent.d.ts +22 -0
  61. package/dist/types/src/features/SplitterCitations/SplitterCitationsComponent.d.ts.map +1 -0
  62. package/dist/types/src/features/SplitterCitations/SplitterCitationsTest.d.ts +4 -0
  63. package/dist/types/src/features/SplitterCitations/SplitterCitationsTest.d.ts.map +1 -0
  64. package/dist/types/src/index.d.ts +3 -1
  65. package/dist/types/src/index.d.ts.map +1 -1
  66. package/dist/types/src/service/constants.d.ts +0 -1
  67. package/dist/types/src/service/constants.d.ts.map +1 -1
  68. package/package.json +44 -33
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),t=require("lucide-react"),o=require("../ChatCitation/components/wrappers/Modal.js");exports.default=function(r){var s=r.images,a=r.highlights,l=r.pages,d=r.subHeadingText,c=void 0===d?"":d,u=r.showFullScreenMode,g=void 0===u||u,x=r.citationLabelColor,p=void 0===x?"#FFFF2E":x,h=r.showCitationLabelOnHover,f=void 0!==h&&h,_=r.highlightColor,v=void 0===_?"rgba(255, 220, 0, 0.15)":_,b=r.highlightActiveColor,m=void 0===b?"rgba(255, 220, 0, 0.35)":b,y=r.highlightBorderColor,j=void 0===y?"rgba(200, 160, 0, 0.4)":y,C=r.height,w=void 0===C?"700px":C,k=r.subHeadingTitleInsideModal,I=r.scrollToFirstCitation,S=void 0!==I&&I,z=r.showPageSeparator,M=void 0===z||z,R=r.pageSeparatorColor,F=void 0===R?"#e2e8f0":R,B=[],L=[];(null==l?void 0:l.length)?l.forEach(function(e,i){var n;e.gs_url&&B.push(e.gs_url),null===(n=e.highlighted_coordinates)||void 0===n||n.forEach(function(e){L.push({pageIndex:i,bboxes:[e]})})}):(B.push.apply(B,s||[]),L.push.apply(L,a||[]));var q=L.flatMap(function(e,i){return e.bboxes.map(function(n,t){return{bbox:n,pageIndex:e.pageIndex,key:"".concat(i,"-").concat(t)}})}),T=q.length,E=n.useState(null),H=E[0],D=E[1],P=n.useState(0),O=P[0],W=P[1],A=n.useState(!1),U=A[0],X=A[1],Y=n.useState({}),G=Y[0],J=Y[1],K=n.useRef(null),N=n.useRef(null),Q=n.useRef([]),V=n.useRef([]),Z=n.useRef(!1),$=n.useCallback(function(e,i){void 0===i&&(i=!1);var n=Math.max(0,Math.min(T-1,e));W(n),requestAnimationFrame(function(){var e=i?N.current:K.current,t=(i?V:Q).current[n];if(e&&t){var o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=r.top-o.top+e.scrollTop-e.clientHeight/2+r.height/2;e.scrollTo({top:s,behavior:"smooth"})}})},[T]);n.useEffect(function(){var e;if(S&&!Z.current&&0!==T){var i=null===(e=null==q?void 0:q[0])||void 0===e?void 0:e.pageIndex;G[i]&&(Z.current=!0,$(0,!1))}},[S,G,T,q,$]);var ee=function(n){return void 0===n&&(n=!1),T>0&&i.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:i.jsxs("div",e.__assign({style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px"}},{children:[i.jsxs("span",e.__assign({style:{fontSize:"12px",color:"#888"}},{children:[O+1," / ",T]})),i.jsx("button",e.__assign({onClick:function(){return $(O-1,n)},disabled:O<=0,style:{padding:"2px 4px",cursor:O<=0?"not-allowed":"pointer",opacity:O<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i.jsx(t.ChevronUp,{size:14,color:"#64748b"})})),i.jsx("button",e.__assign({onClick:function(){return $(O+1,n)},disabled:O>=T-1,style:{padding:"2px 4px",cursor:O>=T-1?"not-allowed":"pointer",opacity:O>=T-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i.jsx(t.ChevronDown,{size:14,color:"#64748b"})})),g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{width:"1px",height:"16px",background:"#e2e8f0",margin:"0 2px"}}),n?i.jsx(t.X,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return X(!1)}}):i.jsx(t.Maximize2,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return X(!0)}})]})]}))}))},ie=function(n){void 0===n&&(n=!1);var t=n?V:Q,o=-1;return B.map(function(n,r){var s=L.filter(function(e){return e.pageIndex===r}).flatMap(function(e,i){return e.bboxes.map(function(e,n){return o++,{bbox:e,key:"".concat(r,"-").concat(i,"-").concat(n),globalIndex:o}})});return i.jsxs("div",e.__assign({style:{marginBottom:"8px"}},{children:[i.jsxs("div",e.__assign({style:{fontSize:"12px",color:"#888",marginBottom:"4px"}},{children:["Page ",r+1]})),i.jsx("div",e.__assign({style:{position:"relative",width:"100%",paddingTop:"129%",flexShrink:0}},{children:i.jsxs("div",e.__assign({style:{position:"absolute",inset:0}},{children:[i.jsx("img",{src:n,alt:"Page ".concat(r+1),style:{display:"block",width:"100%",height:"100%",objectFit:"fill"},draggable:!1,ref:function(i){i&&i.complete&&!G[r]&&J(function(i){var n;return e.__assign(e.__assign({},i),((n={})[r]=!0,n))})},onLoad:function(){return J(function(i){var n;return e.__assign(e.__assign({},i),((n={})[r]=!0,n))})}}),G[r]&&s.map(function(n){var o=n.bbox,r=n.key,s=n.globalIndex,a=O===s;return i.jsx("div",e.__assign({ref:function(e){t.current[s]=e},onMouseEnter:function(){return D(s)},onMouseLeave:function(){return D(null)},style:{position:"absolute",left:"".concat(100*o.xmin,"%"),top:"".concat(100*o.ymin,"%"),width:"".concat(100*(o.xmax-o.xmin),"%"),height:"".concat(100*(o.ymax-o.ymin),"%"),background:a?m:v,border:a?"1.5px solid ".concat(j):"none",borderRadius:"2px",zIndex:2}},{children:f&&H===s&&i.jsxs("div",e.__assign({style:{position:"absolute",top:"-18px",right:"0",fontSize:"10px",background:p,color:"black",padding:"2px 6px",borderRadius:"3px",whiteSpace:"nowrap"}},{children:["Citation ",s+1]}))}),r)})]}))})),M&&r<B.length-1&&i.jsx("div",{style:{height:"1px",background:F,margin:"0"}})]}),r)})},ne={overflowY:"auto",border:"1px solid #ddd",borderRadius:"4px",padding:"8px",paddingBottom:0,display:"flex",flexDirection:"column",boxSizing:"border-box"};return i.jsxs(i.Fragment,{children:[i.jsxs("div",e.__assign({style:{width:"100%",maxWidth:"800px",fontFamily:"inherit",display:"flex",flexDirection:"column"}},{children:[(c||T>0)&&i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:[c&&i.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:c})),i.jsx("div",e.__assign({style:{marginLeft:"auto"}},{children:ee(!1)}))]})),i.jsx("div",e.__assign({ref:K,style:e.__assign(e.__assign({},ne),{maxHeight:w})},{children:ie(!1)}))]})),i.jsx(o.Modal,e.__assign({isOpen:U,onClose:function(){return X(!1)}},{children:i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"}},{children:[(k||T>0)&&i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",marginBottom:"6px",padding:"8px"}},{children:[k&&i.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:k})),i.jsx("div",e.__assign({style:{marginLeft:"auto"}},{children:ee(!0)}))]})),i.jsx("div",e.__assign({ref:N,style:e.__assign(e.__assign({},ne),{flex:1})},{children:U&&ie(!0)}))]}))}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),t=require("lucide-react"),o=require("../ChatCitation/components/wrappers/Modal.js"),r=require("@mui/material");exports.default=function(s){var a=s.images,l=s.highlights,d=s.pages,c=s.subHeadingText,u=void 0===c?"":c,g=s.showFullScreenMode,x=void 0===g||g,p=s.citationLabelColor,h=void 0===p?"#FFFF2E":p,f=s.showCitationLabelOnHover,v=void 0!==f&&f,_=s.highlightColor,b=void 0===_?"rgba(255, 220, 0, 0.15)":_,m=s.highlightActiveColor,y=void 0===m?"rgba(255, 220, 0, 0.35)":m,j=s.highlightBorderColor,C=void 0===j?"rgba(200, 160, 0, 0.4)":j,k=s.height,w=void 0===k?"700px":k,I=s.subHeadingTitleInsideModal,S=s.scrollToFirstCitation,R=void 0!==S&&S,z=s.showPageSeparator,F=void 0===z||z,M=s.pageSeparatorColor,B=void 0===M?"#e2e8f0":M,q=s.activeCitationIndex,L=s.onActiveCitationChange,T=s.headerAction,E=[],H=[];(null==d?void 0:d.length)?d.forEach(function(e,i){var n;e.gs_url&&E.push(e.gs_url),null===(n=e.highlighted_coordinates)||void 0===n||n.forEach(function(e){H.push({pageIndex:i,bboxes:[e]})})}):(E.push.apply(E,a||[]),H.push.apply(H,l||[]));var A=H.flatMap(function(e,i){return e.bboxes.map(function(n,t){return{bbox:n,pageIndex:e.pageIndex,key:"".concat(i,"-").concat(t)}})}),D=A.length,P=n.useState(null),O=P[0],W=P[1],U=n.useState(0),X=U[0],Y=U[1],G=n.useState(!1),J=G[0],K=G[1],N=n.useState({}),Q=N[0],V=N[1],Z=n.useRef(null),$=n.useRef(null),ee=n.useRef(null),ie=n.useRef([]),ne=n.useRef([]),te=n.useRef(!1),oe=n.useCallback(function(e,i){void 0===i&&(i=!1);var n=Math.max(0,Math.min(D-1,e));Y(n),L&&L(n),requestAnimationFrame(function(){var e=i?ee.current:$.current,t=(i?ne:ie).current[n];if(e&&t){var o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=r.top-o.top+e.scrollTop-e.clientHeight/2+r.height/2;e.scrollTo({top:s,behavior:"smooth"})}})},[D,L]);n.useEffect(function(){void 0!==q&&0!==D&&Z.current!==q&&(Z.current=q,Y(q),oe(q,!1))},[q,D,oe]),n.useEffect(function(){var e;if(R&&!te.current&&0!==D){var i=null===(e=null==A?void 0:A[0])||void 0===e?void 0:e.pageIndex;Q[i]&&(te.current=!0,oe(0,!1))}},[R,Q,D,A,oe]);var re=function(n){return void 0===n&&(n=!1),D>0&&i.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:i.jsxs("div",e.__assign({style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px"}},{children:[i.jsxs("span",e.__assign({style:{fontSize:"12px",color:"#888"}},{children:[X+1," / ",D]})),i.jsx("button",e.__assign({onClick:function(){return oe(X-1,n)},disabled:X<=0,style:{padding:"2px 4px",cursor:X<=0?"not-allowed":"pointer",opacity:X<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i.jsx(t.ChevronUp,{size:14,color:"#64748b"})})),i.jsx("button",e.__assign({onClick:function(){return oe(X+1,n)},disabled:X>=D-1,style:{padding:"2px 4px",cursor:X>=D-1?"not-allowed":"pointer",opacity:X>=D-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i.jsx(t.ChevronDown,{size:14,color:"#64748b"})})),!T&&x&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{width:"1px",height:"16px",background:"#e2e8f0",margin:"0 2px"}}),n?i.jsx(t.X,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return K(!1)}}):i.jsx(t.Maximize2,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return K(!0)}})]}),T&&(null==T?void 0:T.icon)&&(null==T?void 0:T.onClick)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{width:"1px",height:"16px",background:"#e2e8f0",margin:"0 2px"}}),i.jsx(r.Tooltip,e.__assign({title:(null==T?void 0:T.tooltip)||"",arrow:!0,placement:"top"},{children:i.jsx("div",e.__assign({onClick:T.onClick,style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:T.icon}))}))]})]}))}))},se=function(n){void 0===n&&(n=!1);var t=n?ne:ie,o=-1;return E.map(function(n,r){var s=H.filter(function(e){return e.pageIndex===r}).flatMap(function(e,i){return e.bboxes.map(function(e,n){return o++,{bbox:e,key:"".concat(r,"-").concat(i,"-").concat(n),globalIndex:o}})});return i.jsxs("div",e.__assign({style:{marginBottom:"8px"}},{children:[i.jsxs("div",e.__assign({style:{fontSize:"12px",color:"#888",marginBottom:"4px"}},{children:["Page ",r+1]})),i.jsx("div",e.__assign({style:{position:"relative",width:"100%",paddingTop:"129%",flexShrink:0}},{children:i.jsxs("div",e.__assign({style:{position:"absolute",inset:0}},{children:[i.jsx("img",{src:n,alt:"Page ".concat(r+1),style:{display:"block",width:"100%",height:"100%",objectFit:"fill"},draggable:!1,ref:function(i){i&&i.complete&&!Q[r]&&V(function(i){var n;return e.__assign(e.__assign({},i),((n={})[r]=!0,n))})},onLoad:function(){return V(function(i){var n;return e.__assign(e.__assign({},i),((n={})[r]=!0,n))})}}),Q[r]&&s.map(function(n){var o=n.bbox,r=n.key,s=n.globalIndex,a=X===s;return i.jsx("div",e.__assign({ref:function(e){t.current[s]=e},onMouseEnter:function(){return W(s)},onMouseLeave:function(){return W(null)},style:{position:"absolute",left:"".concat(100*o.xmin,"%"),top:"".concat(100*o.ymin,"%"),width:"".concat(100*(o.xmax-o.xmin),"%"),height:"".concat(100*(o.ymax-o.ymin),"%"),background:a?y:b,border:a?"1.5px solid ".concat(C):"none",borderRadius:"2px",zIndex:2}},{children:v&&O===s&&i.jsxs("div",e.__assign({style:{position:"absolute",top:"-18px",right:"0",fontSize:"10px",background:h,color:"black",padding:"2px 6px",borderRadius:"3px",whiteSpace:"nowrap"}},{children:["Citation ",s+1]}))}),r)})]}))})),F&&r<E.length-1&&i.jsx("div",{style:{height:"1px",background:B,margin:"0"}})]}),r)})},ae={overflowY:"auto",border:"1px solid #ddd",borderRadius:"4px",padding:"8px",paddingBottom:0,display:"flex",flexDirection:"column",boxSizing:"border-box"};return i.jsxs(i.Fragment,{children:[i.jsxs("div",e.__assign({style:{width:"100%",maxWidth:"800px",fontFamily:"inherit",display:"flex",flexDirection:"column"}},{children:[(u||D>0)&&i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:[u&&i.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:u})),i.jsx("div",e.__assign({style:{marginLeft:"auto"}},{children:re(!1)}))]})),i.jsx("div",e.__assign({ref:$,style:e.__assign(e.__assign({},ae),{maxHeight:w})},{children:se(!1)}))]})),i.jsx(o.Modal,e.__assign({isOpen:J,onClose:function(){return K(!1)}},{children:i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"}},{children:[(I||D>0)&&i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",marginBottom:"6px",padding:"8px"}},{children:[I&&i.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:I})),i.jsx("div",e.__assign({style:{marginLeft:"auto"}},{children:re(!0)}))]})),i.jsx("div",e.__assign({ref:ee,style:e.__assign(e.__assign({},ae),{flex:1})},{children:J&&se(!0)}))]}))}))]})};
2
2
  //# sourceMappingURL=ScannedDocCitation.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".Splitter-module_container__RzL6s{border:1px solid #e5e7eb;border-radius:8px;display:flex;flex-direction:column;margin:8px;position:relative}.Splitter-module_containerHorizontal__2p-d4{overflow:hidden}.Splitter-module_containerVertical__9n65N{overflow:visible}.Splitter-module_header__TfhkL{align-items:center;background-color:#fff;border-bottom:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:space-between;padding:12px 16px}.Splitter-module_headerLeft__85ugE{align-items:center;color:#5928ed;display:flex;gap:8px}.Splitter-module_headerTitle__TB5BN{display:flex;flex-direction:column;gap:2px}.Splitter-module_headerTitleText__L4F7s{color:#5928ed;font-size:14px;font-weight:600}.Splitter-module_headerIcon__OHxry{height:16px;width:16px}.Splitter-module_confidenceScore__0k845{align-items:center;border:2px solid #dff6e6;border-radius:8px;display:flex;font-size:13px;gap:8px;padding:4px 8px}.Splitter-module_confidenceScoreHigh__H8j5I{background-color:#f0fdf4;color:#64af77}.Splitter-module_confidenceScoreMedium__qiIsl{background-color:#fef3c7;color:#92400e}.Splitter-module_confidenceScoreLow__-lIle{background-color:#fee2e2;color:#991b1b}.Splitter-module_confidenceScoreTitle__Boieh{color:#64af77;font-size:14px}.Splitter-module_contentArea__ajG2D{display:flex;gap:4px;position:relative}.Splitter-module_contentAreaHorizontal__xu6oA{flex:1;flex-direction:row;overflow:hidden}.Splitter-module_contentAreaVertical__DPFG7{flex:none;flex-direction:column;overflow:visible}.Splitter-module_panel__y11eZ{min-width:0;overflow:auto;position:relative}.Splitter-module_panelVertical__qrsgc{min-height:0}.Splitter-module_expandButton__w3AI-{align-items:center;background-color:#f9fafb;border:none;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;transition:background-color .2s}.Splitter-module_expandButton__w3AI-:hover{background-color:#f3f4f6}.Splitter-module_expandButtonHorizontal__soV3P{border-right:1px solid #e5e7eb;width:28px}.Splitter-module_expandButtonVertical__-2hdL{border-bottom:1px solid #e5e7eb;height:28px;width:100%}.Splitter-module_expandButtonRightHorizontal__kN8SH{border-left:1px solid #e5e7eb;width:28px}.Splitter-module_expandButtonBottomVertical__QUw-u{border-top:1px solid #e5e7eb;height:28px;width:100%}.Splitter-module_divider__iY680{flex-shrink:0;overflow:visible;position:relative;transition:background-color .2s;z-index:10}.Splitter-module_dividerHorizontal__r6rzG{cursor:col-resize;width:4px}.Splitter-module_dividerVertical__J-KxS{cursor:row-resize;height:4px;width:100%}.Splitter-module_dividerDragging__P3fsp{background-color:#06c;transition:none}.Splitter-module_dividerIdle__OML9v{background-color:#e0e0e0}.Splitter-module_dividerHitArea__OkbGH{position:absolute}.Splitter-module_dividerHitAreaHorizontal__JP5DH{cursor:col-resize;height:100%;left:-4px;width:12px}.Splitter-module_dividerHitAreaVertical__S7npZ{cursor:row-resize;height:12px;top:-4px;width:100%}.Splitter-module_collapseButton__2kemB{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:4px;box-shadow:0 1px 3px #0000001a;cursor:pointer;display:flex;height:22px;justify-content:center;left:-9px;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:22px;z-index:100}.Splitter-module_dragOverlay__iUloH{bottom:0;left:0;position:absolute;right:0;top:0;z-index:9999}.Splitter-module_dragOverlayHorizontal__m9g3w{cursor:col-resize}.Splitter-module_dragOverlayVertical__9Nt5f{cursor:row-resize}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"Splitter-module_container__RzL6s",containerHorizontal:"Splitter-module_containerHorizontal__2p-d4",containerVertical:"Splitter-module_containerVertical__9n65N",header:"Splitter-module_header__TfhkL",headerLeft:"Splitter-module_headerLeft__85ugE",headerTitle:"Splitter-module_headerTitle__TB5BN",headerTitleText:"Splitter-module_headerTitleText__L4F7s",headerIcon:"Splitter-module_headerIcon__OHxry",confidenceScore:"Splitter-module_confidenceScore__0k845",confidenceScoreHigh:"Splitter-module_confidenceScoreHigh__H8j5I",confidenceScoreMedium:"Splitter-module_confidenceScoreMedium__qiIsl",confidenceScoreLow:"Splitter-module_confidenceScoreLow__-lIle",confidenceScoreTitle:"Splitter-module_confidenceScoreTitle__Boieh",contentArea:"Splitter-module_contentArea__ajG2D",contentAreaHorizontal:"Splitter-module_contentAreaHorizontal__xu6oA",contentAreaVertical:"Splitter-module_contentAreaVertical__DPFG7",panel:"Splitter-module_panel__y11eZ",panelVertical:"Splitter-module_panelVertical__qrsgc",expandButton:"Splitter-module_expandButton__w3AI-",expandButtonHorizontal:"Splitter-module_expandButtonHorizontal__soV3P",expandButtonVertical:"Splitter-module_expandButtonVertical__-2hdL",expandButtonRightHorizontal:"Splitter-module_expandButtonRightHorizontal__kN8SH",expandButtonBottomVertical:"Splitter-module_expandButtonBottomVertical__QUw-u",divider:"Splitter-module_divider__iY680",dividerHorizontal:"Splitter-module_dividerHorizontal__r6rzG",dividerVertical:"Splitter-module_dividerVertical__J-KxS",dividerDragging:"Splitter-module_dividerDragging__P3fsp",dividerIdle:"Splitter-module_dividerIdle__OML9v",dividerHitArea:"Splitter-module_dividerHitArea__OkbGH",dividerHitAreaHorizontal:"Splitter-module_dividerHitAreaHorizontal__JP5DH",dividerHitAreaVertical:"Splitter-module_dividerHitAreaVertical__S7npZ",collapseButton:"Splitter-module_collapseButton__2kemB",dragOverlay:"Splitter-module_dragOverlay__iUloH",dragOverlayHorizontal:"Splitter-module_dragOverlayHorizontal__m9g3w",dragOverlayVertical:"Splitter-module_dragOverlayVertical__9Nt5f"};
2
+ //# sourceMappingURL=Splitter.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Splitter.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),a=require("lucide-react"),i=require("./Splitter.module.css.js"),o=function(){return t.jsxs("svg",e.__assign({width:"21",height:"54",viewBox:"0 0 20 54",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsx("path",{d:"M0.260742 1.57324L15.4268 10.8262C17.9563 12.3695 19.4999 15.1188 19.5 18.082V37.0273C19.4999 40.16 17.7767 43.0386 15.0156 44.5186L0.236328 52.4404L-0.5 52.835V1.10938L0.260742 1.57324Z",fill:"#F8FAFC",stroke:"#E0E0E0"}),t.jsx("path",{d:"M7.5 32L12.5 27L7.5 22",stroke:"#111827",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"21",height:"54",viewBox:"0 0 21 54",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsx("path",{d:"M1.26074 1.57324L16.4268 10.8262C18.9563 12.3695 20.4999 15.1188 20.5 18.082V37.0273C20.4999 40.16 18.7767 43.0386 16.0156 44.5186L1.23633 52.4404L0.5 52.835V1.10938L1.26074 1.57324Z",fill:"#F8FAFC",stroke:"#E0E0E0"}),t.jsx("path",{d:"M13.5 32L8.5 27L13.5 22",stroke:"black",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}))};exports.default=function(s){var l=s.left,r=s.right,d=s.defaultLeftWidth,u=void 0===d?50:d,f=s.minLeftWidth,h=void 0===f?250:f,v=s.minRightWidth,x=void 0===v?250:v,g=s.className,p=void 0===g?"":g,m=s.height,_=void 0===m?"400px":m,j=s.width,w=void 0===j?"100%":j,L=s.header,N=s.onLeftWidthChange,C=n.useState(u),E=C[0],S=C[1],k=n.useState(u),B=k[0],V=k[1],b=n.useState(!1),M=b[0],H=b[1],z=n.useState(!1),A=z[0],y=z[1],F=n.useState(!1),R=F[0],D=F[1],q=n.useState(0),T=q[0],W=q[1],O=n.useRef(null),P=n.useRef(null);n.useEffect(function(){var e=O.current;if(e){var t,n=new ResizeObserver(function(e){var n=e[0];t=requestAnimationFrame(function(){W(n.contentRect.width)})});return n.observe(e),W(e.getBoundingClientRect().width),function(){cancelAnimationFrame(t),n.disconnect()}}},[]);var I=T>0&&T<500;n.useEffect(function(){var e=function(e){if(M)if(I&&P.current){var t=P.current.getBoundingClientRect(),n=t.height,a=e.clientY-t.top;if(a>=h&&n-a-4>=x)V(a/n*100)}else if(!I&&O.current){var i=O.current.getBoundingClientRect(),o=i.width,c=e.clientX-i.left;if(c>=h&&o-c-4>=x)S(c/o*100),null==N||N(c)}},t=function(){H(!1)};return M&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[M,I,h,x,N]);var Z,U=function(){A?(S(50),V(50),y(!1)):y(!0)},X=function(){R?(S(50),V(50),D(!1)):D(!0)},Y=E/100*T,G=T-Y-4;Z=I?R?{flex:1}:{height:"".concat(B,"%")}:R?{flex:1}:{width:"".concat(E,"%")};var J,K=!I&&!A&&Y<=Math.max(h+10,250),Q=!I&&!R&&G<=Math.max(x+10,250),$="number"==typeof _?"".concat(_,"px"):_,ee="number"==typeof w?"".concat(w,"px"):w;return t.jsxs("div",e.__assign({ref:O,className:"".concat(i.default.container," ").concat(I?i.default.containerVertical:i.default.containerHorizontal," ").concat(p),style:{height:I?"auto":$,width:ee}},{children:[L&&t.jsxs("div",e.__assign({className:i.default.header},{children:[t.jsxs("div",e.__assign({className:i.default.headerLeft},{children:[L.showDocIcon&&t.jsx(a.FileText,{className:i.default.headerIcon}),t.jsx("div",e.__assign({className:i.default.headerTitle},{children:L.title&&t.jsx("span",e.__assign({className:i.default.headerTitleText},{children:L.title}))}))]})),void 0!==L.confidenceScore&&t.jsxs("div",e.__assign({className:"".concat(i.default.confidenceScore," ").concat((J=L.confidenceScore,J>=80?i.default.confidenceScoreHigh:J>=60?i.default.confidenceScoreMedium:i.default.confidenceScoreLow))},{children:[t.jsxs("span",e.__assign({className:i.default.confidenceScoreTitle},{children:[L.confidenceScoreTitle," :"]})),t.jsxs("div",{children:[Math.round(L.confidenceScore),"%"]})]}))]})),t.jsxs("div",e.__assign({ref:P,className:"".concat(i.default.contentArea," ").concat(I?i.default.contentAreaVertical:i.default.contentAreaHorizontal)},{children:[!A&&t.jsx("div",e.__assign({className:"".concat(i.default.panel," ").concat(I?i.default.panelVertical:""),style:e.__assign(e.__assign({},Z),I?{height:$}:{})},{children:l})),A&&t.jsx("button",e.__assign({onClick:U,className:"".concat(i.default.expandButton," ").concat(I?i.default.expandButtonVertical:i.default.expandButtonHorizontal),title:I?"Expand top panel (50/50)":"Expand left panel (50/50)"},{children:I?t.jsx(a.ChevronDown,{size:14}):t.jsx(o,{})})),!A&&!R&&t.jsxs("div",e.__assign({onMouseDown:function(e){e.preventDefault(),H(!0)},className:"".concat(i.default.divider," ").concat(I?i.default.dividerVertical:i.default.dividerHorizontal," ").concat(M?i.default.dividerDragging:i.default.dividerIdle)},{children:[t.jsx("div",{className:"".concat(i.default.dividerHitArea," ").concat(I?i.default.dividerHitAreaVertical:i.default.dividerHitAreaHorizontal)}),K&&t.jsx("button",e.__assign({onClick:function(e){e.stopPropagation(),U()},onMouseDown:function(e){return e.stopPropagation()},className:i.default.collapseButton,title:"Collapse left panel"},{children:t.jsx(c,{})})),Q&&t.jsx("button",e.__assign({onClick:function(e){e.stopPropagation(),X()},onMouseDown:function(e){return e.stopPropagation()},className:i.default.collapseButton,title:"Collapse right panel"},{children:t.jsx(o,{})}))]})),!R&&t.jsx("div",e.__assign({className:"".concat(i.default.panel," ").concat(I?i.default.panelVertical:""),style:e.__assign({flex:1},I?{height:$}:{})},{children:r})),R&&t.jsx("button",e.__assign({onClick:X,className:"".concat(i.default.expandButton," ").concat(I?i.default.expandButtonBottomVertical:i.default.expandButtonRightHorizontal),title:I?"Expand bottom panel (50/50)":"Expand right panel (50/50)"},{children:I?t.jsx(a.ChevronUp,{size:14}):t.jsx(c,{})})),M&&t.jsx("div",{className:"".concat(i.default.dragOverlay," ").concat(I?i.default.dragOverlayVertical:i.default.dragOverlayHorizontal)})]}))]}))};
2
+ //# sourceMappingURL=SplitterCitationsComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitterCitationsComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".TableCitationContent-module_container__OfivB{background-color:var(--cite-bg-color,#fff);border:1px solid var(--cite-border-color,#e5e7eb);display:flex;flex-direction:column;font-family:var(--cite-font-family,Inter,system-ui,sans-serif);height:100%;min-height:200px;width:100%}.TableCitationContent-module_header__ANgC5{align-items:center;border-bottom:1px solid var(--cite-border-color,#e5e7eb);display:flex;justify-content:space-between;padding:.5rem 1rem}.TableCitationContent-module_title__UzB8i{color:var(--cite-text-primary,#1f2937);font-size:1.1rem;font-weight:500;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.TableCitationContent-module_headerRight__GLyqb{align-items:center;display:flex;gap:1rem}.TableCitationContent-module_divider__SYxWE{align-self:stretch;background-color:var(--cite-border-color,#e5e7eb);margin-bottom:-.5rem;margin-top:-.5rem;width:1px}.TableCitationContent-module_closeBtn__lTrT4{align-items:center;color:var(--cite-text-secondary,#6b7280);cursor:pointer;display:flex;transition:opacity .2s}.TableCitationContent-module_ccloseBtn__Gp3l5:hover{opacity:.7}.TableCitationContent-module_tableWrapper__nst7D{overflow:auto;padding:.75rem 1rem;width:100%}.TableCitationContent-module_table__ZIHBi{border-collapse:collapse;font-size:.875rem;min-width:100%;width:max-content}.TableCitationContent-module_table__ZIHBi td,.TableCitationContent-module_table__ZIHBi th{border:1px solid var(--cite-border-color,#e5e7eb);padding:.5rem .75rem}.TableCitationContent-module_table__ZIHBi th{background-color:var(--cite-header-bg,#f9fafb);color:var(--cite-text-header,#374151);font-weight:600;position:sticky;top:0}.TableCitationContent-module_highlightCell__1RESY{background-color:var(--cite-highlight-color,#f7ef9e)!important}.TableCitationContent-module_failedCell__-Q2WX{background-color:var(--cite-error-bg,#fee2e2);color:var(--cite-error-text,#991b1b)}.TableCitationContent-module_actions__yvyTj{align-items:center;display:flex;gap:.5rem}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"TableCitationContent-module_container__OfivB",header:"TableCitationContent-module_header__ANgC5",title:"TableCitationContent-module_title__UzB8i",headerRight:"TableCitationContent-module_headerRight__GLyqb",divider:"TableCitationContent-module_divider__SYxWE",closeBtn:"TableCitationContent-module_closeBtn__lTrT4",ccloseBtn:"TableCitationContent-module_ccloseBtn__Gp3l5",tableWrapper:"TableCitationContent-module_tableWrapper__nst7D",table:"TableCitationContent-module_table__ZIHBi",highlightCell:"TableCitationContent-module_highlightCell__1RESY",failedCell:"TableCitationContent-module_failedCell__-Q2WX",actions:"TableCitationContent-module_actions__yvyTj"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".TableCitationContent-module_container__OfivB{background-color:var(--cite-bg-color,#fff);border:1px solid var(--cite-border-color,#e5e7eb);display:flex;flex-direction:column;font-family:var(--cite-font-family,Inter,system-ui,sans-serif);height:100%;min-height:200px;overflow:hidden;width:100%}.TableCitationContent-module_header__ANgC5{align-items:center;border-bottom:1px solid var(--cite-border-color,#e5e7eb);display:flex;justify-content:space-between;padding:.5rem 1rem}.TableCitationContent-module_title__UzB8i{color:var(--cite-text-primary,#1f2937);font-size:1.1rem;font-weight:500;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.TableCitationContent-module_headerRight__GLyqb{align-items:center;display:flex;gap:1rem}.TableCitationContent-module_divider__SYxWE{align-self:stretch;background-color:var(--cite-border-color,#e5e7eb);margin-bottom:-.5rem;margin-top:-.5rem;width:1px}.TableCitationContent-module_closeBtn__lTrT4{align-items:center;color:var(--cite-text-secondary,#6b7280);cursor:pointer;display:flex;transition:opacity .2s}.TableCitationContent-module_ccloseBtn__Gp3l5:hover{opacity:.7}.TableCitationContent-module_tableScroll__Gv2KN{flex:1;overflow:auto;padding:.75rem 1rem}.TableCitationContent-module_table__ZIHBi{border-collapse:collapse;font-size:.875rem;min-width:100%;width:max-content}.TableCitationContent-module_table__ZIHBi td,.TableCitationContent-module_table__ZIHBi th{border:1px solid var(--cite-border-color,#e5e7eb);padding:.5rem .75rem}.TableCitationContent-module_table__ZIHBi th{background-color:var(--cite-header-bg,#f9fafb);color:var(--cite-text-header,#374151);font-weight:600;position:sticky;top:0}.TableCitationContent-module_highlightCell__1RESY{background-color:var(--cite-highlight-color,#f7ef9e)!important}.TableCitationContent-module_failedCell__-Q2WX{background-color:var(--cite-error-bg,#fee2e2);color:var(--cite-error-text,#991b1b)}.TableCitationContent-module_actions__yvyTj{align-items:center;display:flex;gap:.5rem}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"TableCitationContent-module_container__OfivB",header:"TableCitationContent-module_header__ANgC5",title:"TableCitationContent-module_title__UzB8i",headerRight:"TableCitationContent-module_headerRight__GLyqb",divider:"TableCitationContent-module_divider__SYxWE",closeBtn:"TableCitationContent-module_closeBtn__lTrT4",ccloseBtn:"TableCitationContent-module_ccloseBtn__Gp3l5",tableScroll:"TableCitationContent-module_tableScroll__Gv2KN",table:"TableCitationContent-module_table__ZIHBi",highlightCell:"TableCitationContent-module_highlightCell__1RESY",failedCell:"TableCitationContent-module_failedCell__-Q2WX",actions:"TableCitationContent-module_actions__yvyTj"};
2
2
  //# sourceMappingURL=TableCitationContent.module.css.js.map
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),r=require("./features/Bookemon/Bookemon.js"),o=require("./features/PdfEditorCitation/PdfEditorCitation.js"),a=require("./features/CitationRenderer/CitationRenderer.js"),n=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),C=require("./features/PaginatedTable/PaginatedTable.js"),u=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),d=require("./features/ChatCitation/ChatCitationRenderer.js"),f=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),p=require("./features/PdfViewer/PdfViewer.js"),l=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),q=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),x=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),j=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),c=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),g=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),R=require("./features/TableCitation/TableCitationContent.js"),A=require("./features/CitationViewer/CitationsViewer.js"),m=require("./features/ExcelCitation/ExcelCitations.js"),E=require("./features/ScannedDocCitation/ScannedDocCitation.js"),D=require("./features/ChatDrawer/ChatDrawer.js"),T=require("./features/ChatDrawer/constants/ChatDrawer.js"),P=require("./features/AiRedLineCompare/AiRedLineCompare.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=r.default,exports.PdfCitation=o.PdfEditorCitation,exports.CitationRenderer=a.default,exports.MarkdownRenderer=n.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=C.default,exports.NonWebReasoningComponent=u.default,exports.ChatCitation=d.default,exports.CognitiveDecisioningCard=f.default,exports.PdfViewer=p.default,exports.FaqCitation=l.default,exports.ImageCitationContent=q.default,exports.VideoCitationContent=x.default,exports.FileCitationContent=j.default,exports.WebCitationWithImageContent=c.default,exports.AiReasoningCitation=g.default,exports.TableCitationContent=R.default,exports.CitationsViewer=A.default,exports.ExcelCitation=m.default,exports.ScannedDocCitation=E.default,exports.ChatDrawer=D.default,exports.FILE_INGESTION_STATUS=T.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=T.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=T.TRUNCATE_THRESHOLD,exports.AiRedLineCompare=P.AiRedLineCompare;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),r=require("./features/Bookemon/Bookemon.js"),o=require("./features/PdfEditorCitation/PdfEditorCitation.js"),a=require("./features/CitationRenderer/CitationRenderer.js"),n=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),C=require("./features/PaginatedTable/PaginatedTable.js"),u=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),d=require("./features/ChatCitation/ChatCitationRenderer.js"),f=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),p=require("./features/PdfViewer/PdfViewer.js"),l=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),q=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),g=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),x=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),j=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),c=require("./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js"),m=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),R=require("./features/TableCitation/TableCitationContent.js"),E=require("./features/CitationViewer/CitationsViewer.js"),D=require("./features/ExcelCitation/ExcelCitations.js"),T=require("./features/ScannedDocCitation/ScannedDocCitation.js"),A=require("./features/ChatDrawer/ChatDrawer.js"),I=require("./features/ChatDrawer/constants/ChatDrawer.js"),S=require("./features/SplitterCitations/SplitterCitationsComponent.js"),P=require("./features/CognitiveCompare/CognitiveCompare.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=r.default,exports.PdfCitation=o.PdfEditorCitation,exports.CitationRenderer=a.default,exports.MarkdownRenderer=n.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=C.default,exports.NonWebReasoningComponent=u.default,exports.ChatCitation=d.default,exports.CognitiveDecisioningCard=f.default,exports.PdfViewer=p.default,exports.FaqCitation=l.default,exports.ImageCitationContent=q.default,exports.VideoCitationContent=g.default,exports.FileCitationContent=x.default,exports.WebCitationWithImageContent=j.default,exports.MarkdownWithImageCitation=c.default,exports.AiReasoningCitation=m.default,exports.TableCitationContent=R.default,exports.CitationsViewer=E.default,exports.ExcelCitation=D.default,exports.ScannedDocCitation=T.default,exports.ChatDrawer=A.default,exports.FILE_INGESTION_STATUS=I.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=I.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=I.TRUNCATE_THRESHOLD,exports.SplitterCitationsComponent=S.default,exports.CognitiveCompare=P.default;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as o,useRef as i,useEffect as r}from"react";import{ChevronDown as d}from"lucide-react";var l=function(l){var a,s=l.children,u=l.uploadListTopContent,c=l.defaultHeight,p=void 0===c?300:c,h=l.minHeight,f=void 0===h?150:h,x=l.maxHeight,m=l.isExpanded,g=void 0!==m&&m,v=l.onToggle,y=l.onHeightChange,b=l.styles,w=void 0===b?{}:b,C=o(!1),H=C[0],S=C[1],k=o(p),E=k[0],B=k[1],D=i(0),I=i(p),L=i(null),R=i(0),z="string"==typeof x?parseFloat(x)/100*window.innerHeight:null!=x?x:.4*window.innerHeight;r(function(){!g&&L.current&&(R.current=L.current.getBoundingClientRect().height)},[g]);return r(function(){if(H){var e=function(e){e.preventDefault();var t=e.clientY-D.current,n=Math.max(f,Math.min(z,I.current+t));B(n),null==y||y(n)},t=function(){S(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[H]),t("div",e({ref:L,style:{position:"relative",width:"100%",minHeight:g?R.current:"auto"}},{children:[t("div",e({style:e({position:g?"absolute":"relative",zIndex:g?10:"auto",left:0,right:0,top:0,display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:g?"".concat(E,"px"):"auto",minHeight:g?"".concat(f,"px"):"auto",maxHeight:g?"".concat(E,"px"):"auto",overflow:"hidden",width:"100%"},w.container)},{children:[n("div",e({style:e({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},w.header)},{children:n("span",e({style:e({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},w.title)},{children:(null==u?void 0:u.trim())?u:"Data uploaded for your context"}))})),g&&n("div",e({style:e({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},w.body)},{children:s})),g&&n("div",e({onMouseDown:function(e){e.preventDefault(),S(!0),D.current=e.clientY,I.current=E,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:n("div",{style:e({width:48,height:4,borderRadius:4,background:H?"#a78bfa":"#d1d5db"},w.dragPill)})}))]})),n("div",e({style:{position:g?"absolute":"relative",top:g?"".concat(E,"px"):"auto",width:"100%",display:"flex",justifyContent:"center",height:18,zIndex:g?10:"auto"}},{children:n("button",e({onClick:v,"aria-label":g?"Collapse":"Expand",style:e({position:"absolute",width:"52px",height:"18px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"1px solid rgb(189, 180, 254)",borderTop:"none",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},w.notch)},{children:n(d,{size:14,color:null!==(a=w.notchArrowColor)&&void 0!==a?a:"#6d28d9",style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})}))}))]}))};export{l as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as n,useRef as i,useEffect as r}from"react";import{ChevronDown as l}from"lucide-react";var d=function(d){var a,s,u=d.children,c=d.uploadListTopContent,p=d.defaultHeight,h=void 0===p?300:p,f=d.minHeight,x=void 0===f?150:f,m=d.maxHeight,g=d.isExpanded,v=void 0!==g&&g,y=d.onToggle,b=d.onHeightChange,w=d.styles,C=void 0===w?{}:w,H=n(!1),S=H[0],k=H[1],E=n(h),B=E[0],D=E[1],I=i(0),L=i(h),R=i(null),z=i(0),j="string"==typeof m?parseFloat(m)/100*window.innerHeight:null!=m?m:.4*window.innerHeight;r(function(){!v&&R.current&&(z.current=R.current.getBoundingClientRect().height)},[v]);return r(function(){if(S){var e=function(e){e.preventDefault();var t=e.clientY-I.current,o=Math.max(x,Math.min(j,L.current+t));D(o),null==b||b(o)},t=function(){k(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[S]),t("div",e({ref:R,style:{position:"relative",width:"100%",minHeight:v?z.current:"auto"}},{children:[t("div",e({style:e({position:v?"absolute":"relative",zIndex:v?10:"auto",left:0,right:0,top:0,display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:v?"".concat(B,"px"):"auto",minHeight:v?"".concat(x,"px"):"auto",maxHeight:v?"".concat(B,"px"):"auto",overflow:"hidden",width:"100%"},C.container)},{children:[o("div",e({style:e({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},C.header)},{children:o("span",e({style:e({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},C.title)},{children:(null==c?void 0:c.trim())?c:"Data uploaded for your context"}))})),v&&o("div",e({style:e({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},C.body)},{children:u})),v&&o("div",e({onMouseDown:function(e){e.preventDefault(),k(!0),I.current=e.clientY,L.current=B,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:o("div",{style:e({width:48,height:4,borderRadius:4,background:S?null!==(a=C.dragPillActiveColor)&&void 0!==a?a:"#a78bfa":"#d1d5db"},C.dragPill)})}))]})),o("div",e({style:{position:v?"absolute":"relative",top:v?"".concat(B,"px"):"auto",width:"100%",display:"flex",justifyContent:"center",height:18,zIndex:v?10:"auto"}},{children:o("button",e({onClick:y,"aria-label":v?"Collapse":"Expand",style:e({position:"absolute",width:"52px",height:"18px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"1px solid rgb(189, 180, 254)",borderTop:"none",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},C.notch)},{children:o(l,{size:14,color:null!==(s=C.notchArrowColor)&&void 0!==s?s:"#6d28d9",style:{transform:v?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})}))}))]}))};export{d as default};
2
2
  //# sourceMappingURL=ChatDrawer.js.map
@@ -1,2 +1,2 @@
1
- var e={containerWrapper:"MarkdownRenderer-module_containerWrapper__tpDPF",mainCard:"MarkdownRenderer-module_mainCard__UA4RV",scrollArea:"MarkdownRenderer-module_scrollArea__vtj12",checkGreen:"MarkdownRenderer-module_checkGreen__gcFyY",list:"MarkdownRenderer-module_list__K9Pvu",customHighlight:"MarkdownRenderer-module_customHighlight__zse-n",detailsInline:"MarkdownRenderer-module_detailsInline__jjTzb",detailsTarget:"MarkdownRenderer-module_detailsTarget__Y-duI",detailsBlock:"MarkdownRenderer-module_detailsBlock__NfeQe",summary:"MarkdownRenderer-module_summary__SpV4s",targetDummySummary:"MarkdownRenderer-module_targetDummySummary__aQ8E5",popup:"MarkdownRenderer-module_popup__OhFrR"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".MarkdownRenderer-module_containerWrapper__tpDPF{display:flex;gap:16px;height:42vh}.MarkdownRenderer-module_mainCard__UA4RV{background-color:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 1px 2px 0 #0000000d;flex:1;height:42vh;padding:20px}.MarkdownRenderer-module_scrollArea__vtj12{height:100%;overflow-y:auto;padding-right:8px}.MarkdownRenderer-module_checkGreen__gcFyY{color:#16a34a!important;display:inline-block;font-weight:500;margin-right:4px;vertical-align:middle}.MarkdownRenderer-module_list__K9Pvu{list-style-type:decimal;margin:4px 0;padding-left:20px}.MarkdownRenderer-module_customHighlight__zse-n{background-color:#fef08a;border-radius:4px;color:#374151;padding:2px 4px}.MarkdownRenderer-module_detailsInline__jjTzb{border-radius:8px;display:inline-block;margin:4px 0;position:relative;vertical-align:middle}.MarkdownRenderer-module_detailsInline__jjTzb>:not(summary){display:none!important}.MarkdownRenderer-module_detailsTarget__Y-duI{display:block;margin:8px 0}.MarkdownRenderer-module_detailsBlock__NfeQe{border-radius:8px;margin:4px 0;position:relative;width:100%}.MarkdownRenderer-module_summary__SpV4s{align-items:center;color:#19213d;cursor:pointer;display:inline-flex;font-weight:500;gap:4px;padding:4px 0;user-select:none}.MarkdownRenderer-module_summary__SpV4s:hover{opacity:.9}.MarkdownRenderer-module_detailsBlock__NfeQe summary::-webkit-details-marker,.MarkdownRenderer-module_detailsInline__jjTzb summary::-webkit-details-marker,.MarkdownRenderer-module_detailsTarget__Y-duI summary::-webkit-details-marker{display:none}.MarkdownRenderer-module_targetDummySummary__aQ8E5{display:none!important}.MarkdownRenderer-module_popup__OhFrR{background:#6d28d91a;border:1px solid #6d28d9;border-radius:10px;box-shadow:0 8px 24px #0000000f;color:#6d28d9;display:block;font-size:12px;line-height:1.35;margin-top:6px;padding:12px;transition:opacity .2s ease,transform .2s ease}.MarkdownRenderer-module_detailsTarget__Y-duI .MarkdownRenderer-module_popup__OhFrR{opacity:0;transform:translateY(-4px)}.MarkdownRenderer-module_detailsTarget__Y-duI[open] .MarkdownRenderer-module_popup__OhFrR{opacity:1;transform:translateY(0)}.MarkdownRenderer-module_popup__OhFrR .MarkdownRenderer-module_popup__OhFrR{background:#0000!important;border:none!important;box-shadow:none!important;color:inherit!important;padding:0!important}"));const d=document.head||document.getElementsByTagName("head")[0]||document.documentElement;d&&d.appendChild(e)}();export{e as default};
1
+ var e={containerWrapper:"MarkdownRenderer-module_containerWrapper__tpDPF",mainCard:"MarkdownRenderer-module_mainCard__UA4RV",scrollArea:"MarkdownRenderer-module_scrollArea__vtj12",checkGreen:"MarkdownRenderer-module_checkGreen__gcFyY",list:"MarkdownRenderer-module_list__K9Pvu",customHighlight:"MarkdownRenderer-module_customHighlight__zse-n",detailsInline:"MarkdownRenderer-module_detailsInline__jjTzb",detailsTarget:"MarkdownRenderer-module_detailsTarget__Y-duI",detailsBlock:"MarkdownRenderer-module_detailsBlock__NfeQe",summary:"MarkdownRenderer-module_summary__SpV4s",targetDummySummary:"MarkdownRenderer-module_targetDummySummary__aQ8E5",popup:"MarkdownRenderer-module_popup__OhFrR"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".MarkdownRenderer-module_containerWrapper__tpDPF{display:flex;gap:16px;height:42vh!important}.MarkdownRenderer-module_mainCard__UA4RV{background-color:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 1px 2px 0 #0000000d;flex:1;height:42vh;padding:20px}.MarkdownRenderer-module_scrollArea__vtj12{height:100%;overflow-y:auto;padding-right:8px}.MarkdownRenderer-module_checkGreen__gcFyY{color:#16a34a!important;display:inline-block;font-weight:500;margin-right:4px;vertical-align:middle}.MarkdownRenderer-module_list__K9Pvu{list-style-type:decimal;margin:4px 0;padding-left:20px}.MarkdownRenderer-module_customHighlight__zse-n{background-color:#fef08a;border-radius:4px;color:#374151;padding:2px 4px}.MarkdownRenderer-module_detailsInline__jjTzb{border-radius:8px;display:inline-block;margin:4px 0;position:relative;vertical-align:middle}.MarkdownRenderer-module_detailsInline__jjTzb>:not(summary){display:none!important}.MarkdownRenderer-module_detailsTarget__Y-duI{display:block;margin:8px 0}.MarkdownRenderer-module_detailsBlock__NfeQe{border-radius:8px;margin:4px 0;position:relative;width:100%}.MarkdownRenderer-module_summary__SpV4s{align-items:center;color:#19213d;cursor:pointer;display:inline-flex;font-weight:500;gap:4px;padding:4px 0;user-select:none}.MarkdownRenderer-module_summary__SpV4s:hover{opacity:.9}.MarkdownRenderer-module_detailsBlock__NfeQe summary::-webkit-details-marker,.MarkdownRenderer-module_detailsInline__jjTzb summary::-webkit-details-marker,.MarkdownRenderer-module_detailsTarget__Y-duI summary::-webkit-details-marker{display:none}.MarkdownRenderer-module_targetDummySummary__aQ8E5{display:none!important}.MarkdownRenderer-module_popup__OhFrR{background:#6d28d91a;border:1px solid #6d28d9;border-radius:10px;box-shadow:0 8px 24px #0000000f;color:#6d28d9;display:block;font-size:12px;line-height:1.35;margin-top:6px;padding:12px;transition:opacity .2s ease,transform .2s ease}.MarkdownRenderer-module_detailsTarget__Y-duI .MarkdownRenderer-module_popup__OhFrR{opacity:0;transform:translateY(-4px)}.MarkdownRenderer-module_detailsTarget__Y-duI[open] .MarkdownRenderer-module_popup__OhFrR{opacity:1;transform:translateY(0)}.MarkdownRenderer-module_popup__OhFrR .MarkdownRenderer-module_popup__OhFrR{background:#0000!important;border:none!important;box-shadow:none!important;color:inherit!important;padding:0!important}"));const d=document.head||document.getElementsByTagName("head")[0]||document.documentElement;d&&d.appendChild(e)}();export{e as default};
2
2
  //# sourceMappingURL=MarkdownRenderer.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as r,__assign as a}from"tslib";import{jsx as t}from"react/jsx-runtime";import o,{tooltipClasses as e}from"@mui/material/Tooltip";import{styled as i}from"@mui/material/styles";var n=i(function(e){var i=e.className,n=r(e,["className"]);return t(o,a({},n,{classes:{popper:i}}))})(function(){var r;return(r={})["& .".concat(e.tooltip)]={fontFamily:"Plus Jakarta Sans, sans-serif",backgroundColor:"#555",color:"#fff",fontSize:12,padding:"5px 8px",borderRadius:6,maxWidth:250,textAlign:"center",whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4},r["& .".concat(e.arrow)]={color:"#555"},r}),l=function(r){var o=r.description,e=r.children;return t(n,a({title:t("span",{children:o}),arrow:!0,placement:"top"},{children:t("span",a({style:{display:"inline-block"}},{children:e}))}))};export{l as default};
1
+ import{__rest as r,__assign as a}from"tslib";import{jsx as t}from"react/jsx-runtime";import o,{tooltipClasses as e}from"@mui/material/Tooltip";import{styled as i}from"@mui/material/styles";var n=i(function(e){var i=e.className,n=r(e,["className"]);return t(o,a({},n,{classes:{popper:i},arrow:!0,placement:"top"}))})(function(){var r;return(r={})["& .".concat(e.tooltip)]={fontFamily:"Plus Jakarta Sans, sans-serif",backgroundColor:"#555",color:"#fff",fontSize:12,padding:"5px 8px",borderRadius:6,maxWidth:250,textAlign:"center",whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4},r["& .".concat(e.arrow)]={color:"#555"},r}),l=function(r){var o=r.description,e=r.children;return t(n,a({title:t("span",{children:o})},{children:t("span",a({style:{display:"inline-block"}},{children:e}))}))};export{l as default};
2
2
  //# sourceMappingURL=TooltipComponent.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as t,jsx as i,Fragment as r}from"react/jsx-runtime";import o,{useState as l,useMemo as a,useRef as c,useCallback as s,useEffect as d}from"react";import{Box as u,Typography as p,Snackbar as h,Alert as g,IconButton as f,Skeleton as x,Accordion as v,AccordionSummary as m,AccordionDetails as b}from"@mui/material";import{ArrowLeft as y,ArrowRight as F,ChevronUp as w,ChevronDown as E,X as C}from"lucide-react";import S from"react-dom";import k from"../../assests/svg/SparkleIcon.js";import{ButtonCognitiveIcon as D}from"../../assests/svg/ButtonCognitiveIcon.js";import B from"react-markdown";var A=function(e){return null==e?"":"string"==typeof e?e:Array.isArray(e)?e.map(A).join("\n\n"):"object"==typeof e?JSON.stringify(e):String(e)},I=function(e){return e?A(e).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,n){return e.startsWith("**")&&e.endsWith("**")?i("strong",{children:e.slice(2,-2)},n):i(o.Fragment,{children:e},n)}):null},z=function(n,t,i,r){var o=100*(n||0),l=r.thresholds,a=r.relationStyles;if(!i)return null;var c=function(e){return e&&"string"==typeof e?e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" "):"Unknown"}(t),s=(t||"").toLowerCase();return s.includes("no_deviation")?e(e({},a.low),{label:c}):s.includes("deviation")||s.includes("high_risk")||s.includes("critical")?e(e({},a.high),{label:c}):o>=l.exact?e(e({},a.exact),{label:c}):o>=l.high?e(e({},a.high),{label:c}):o>=l.medium?e(e({},a.medium),{label:c}):e(e({},a.low),{label:c})},R=o.forwardRef(function(n,r){var l=n.label,a=n.content,c=n.highlights,s=void 0===c?[]:c,d=n.styleVariant,h=n.isHighlighted,g=void 0!==h&&h,f=Array.isArray(a)?a.map(A).join("\n"):A(a),x="#9F1239"===d.badgeText?{borderColor:"#E11D48",shadow:"rgba(225, 29, 72, 0.25)"}:"#B91C1C"===d.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#1D4ED8"===d.badgeText?{borderColor:"#3B82F6",shadow:"rgba(59, 130, 246, 0.25)"}:"#A16207"===d.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return t(u,e({sx:{mb:1.5}},{children:[i(p,e({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500}},{children:l})),i(u,e({ref:r,sx:{p:"4px 12px",borderRadius:"6px",border:g?"1.5px solid ".concat(x.borderColor):"1px solid ".concat(d.border),boxShadow:g?"0px 0px 0px 2px ".concat(x.shadow):"none",bgcolor:d.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"24px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:i(u,{children:function(){if(!f)return null;if(!s||0===s.length)return I(f);var n=s.filter(function(e){return e&&"string"==typeof e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===n.length)return I(f);var t=new RegExp("(".concat(n.join("|"),")"),"gi");return f.split(t).map(function(n,t){return s.some(function(e){return e&&"string"==typeof e&&e.toLowerCase()===n.toLowerCase()})?i(u,e({component:"span",sx:{bgcolor:d.highlightBg,borderRadius:"2px",px:"2px"}},{children:I(n)}),t):i(o.Fragment,{children:I(n)},t)})}()})}))]}))}),_=10,W=function(n){var o,c,s,h,g,x,v,m=n.open,b=n.onClose,y=n.sectionTitle,F=n.referenceSectionTitle,w=n.cognitiveData,D=n.relevanceScore,B=n.anchorEl,I=n.badgeStyle,z=n.popupRef,R=n.position,W=l("association"),T=W[0],L=W[1],H=a(function(){if(!I)return{border:"#5928ED",shadow:"rgba(89,40,237,0.18)"};var e=I.badgeText;return"#9F1239"===e||"#B42318"===e?{border:"#E11D48",shadow:"rgba(225,29,72,0.15)"}:"#1D4ED8"===e?{border:"#3B82F6",shadow:"rgba(59,130,246,0.15)"}:"#A16207"===e?{border:"#F59E0B",shadow:"rgba(245,158,11,0.15)"}:{border:"#5928ED",shadow:"rgba(89,40,237,0.18)"}},[I]);if(d(function(){if(m){var e=function(e){var n;(null===(n=z.current)||void 0===n?void 0:n.contains(e.target))||(null==B?void 0:B.contains(e.target))||b()};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}},[m,b,B,z]),!m||!w)return null;var j=null!==(c=null!==(o=w.relevance_score)&&void 0!==o?o:D)&&void 0!==c?c:0,M=function(e){return e?e.split(/(?<=\.)(?:\s+(?=[A-Z])|\s+\d+\.\s)/).map(function(e){return e.trim()}).filter(function(e){return e.length>10}):[]},O=M(null!==(s=w.decisioning)&&void 0!==s?s:""),P=M(null!==(h=w.gap)&&void 0!==h?h:""),V=function(e){if(!e)return[];if(Array.isArray(e))return e.flatMap(function(e){if("string"==typeof e)return[{key:"metadata",value:e}];if("object"==typeof e&&null!==e){var n=e,t={key:A(n.key),value:A(n.value),url:A(n.url)};return t.value||t.key||t.url?[t]:[]}return[]});if("string"==typeof e)return[{key:"metadata",value:e}];if("object"==typeof e){var n=e;if("value"in n||"key"in n||"url"in n)return[{key:A(n.key),value:A(n.value),url:A(n.url)}]}return[]},K=function(e,n){var t,i,r=w,o="decisioning"===e?null!==(t=r.decisioning_metadata)&&void 0!==t?t:r.decisioningMetadata:null!==(i=r.gap_metadata)&&void 0!==i?i:r.gapMetadata;if(Array.isArray(o)){if((d=V(o[n])).length)return d;if((u=V(o)).length)return u}else{var l=V(o);if(l.length)return l}var a=r.metadata;if(a&&"object"==typeof a&&!Array.isArray(a)){var c=a,s="decisioning"===e?c.decisioning:c.gap;if(Array.isArray(s)){var d,u;if((d=V(s[n])).length)return d;if((u=V(s)).length)return u}else{var p=V(s);if(p.length)return p}}return[]},N=function(n){if(!n.length)return null;var r=n[0],o=r.key||"metadata",l=r.value||r.url||"",a=l?"".concat(o,": ").concat(l):o;return t(u,e({component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#253AE4",fontWeight:600,ml:.5,whiteSpace:"nowrap"}},{children:["(",a,i(E,{size:13,style:{marginLeft:2}}),")"]}))},U=null!==(g=null==R?void 0:R.arrowLeft)&&void 0!==g?g:60,q=t(u,e({ref:z,sx:{position:"fixed",top:null!==(x=null==R?void 0:R.top)&&void 0!==x?x:-9999,left:null!==(v=null==R?void 0:R.left)&&void 0!==v?v:-9999,zIndex:9999,width:"min(".concat(680,"px, calc(100vw - ").concat(24,"px))"),bgcolor:"#FFFFFF",borderRadius:"14px",border:"1.5px solid ".concat(H.border),boxShadow:"0px 8px 32px ".concat(H.shadow,", 0px 0px 0px 3px ").concat(H.shadow),overflow:"visible",display:"flex",flexDirection:"column",maxHeight:"60vh",visibility:R?"visible":"hidden"}},{children:[R&&(R.openAbove?t(r,{children:[i(u,{sx:{position:"absolute",bottom:-11,left:U-_,width:0,height:0,borderLeft:"".concat(_,"px solid transparent"),borderRight:"".concat(_,"px solid transparent"),borderTop:"".concat(11,"px solid ").concat(H.border),zIndex:1}}),i(u,{sx:{position:"absolute",bottom:-9,left:U-_+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderTop:"".concat(_,"px solid #FFFFFF"),zIndex:2}})]}):t(r,{children:[i(u,{sx:{position:"absolute",top:-11,left:U-_,width:0,height:0,borderLeft:"".concat(_,"px solid transparent"),borderRight:"".concat(_,"px solid transparent"),borderBottom:"".concat(11,"px solid ").concat(H.border),zIndex:1}}),i(u,{sx:{position:"absolute",top:-9,left:U-_+1,width:0,height:0,borderLeft:"".concat(9,"px solid transparent"),borderRight:"".concat(9,"px solid transparent"),borderBottom:"".concat(_,"px solid #FFFFFF"),zIndex:2}})]})),t(u,e({sx:{px:2.5,pt:2,pb:1.5,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2,flexShrink:0}},{children:[t(u,e({sx:{flex:1,minWidth:0}},{children:[t(p,e({sx:{fontSize:"18px",fontWeight:600,color:"#101828",lineHeight:1.3,display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap",overflow:"hidden"}},{children:[i(u,e({component:"span",title:y,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flexShrink:1,minWidth:0}},{children:y})),i(u,e({component:"span",sx:{color:"#667085",fontWeight:400,flexShrink:0,mx:.5}},{children:"↔"})),i(u,e({component:"span",title:F||"Reference Section",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flexShrink:1,minWidth:0}},{children:F||"Reference Section"}))]})),i(u,e({sx:{mt:.75,display:"inline-flex",alignItems:"center",gap:.75}},{children:i(p,e({sx:{fontSize:"13px",fontWeight:400,color:"#5928ED",lineHeight:1}},{children:"Why this is a Deviation?"}))}))]})),t(u,e({sx:{display:"flex",alignItems:"center",gap:1.5,flexShrink:0}},{children:[t(u,e({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:.5,borderRadius:"20px",bgcolor:"#FFFFFF",border:"1px solid #5928ED",fontSize:"12px",fontWeight:600,color:"#5928ED"}},{children:[i(k,{}),"Decision Strength ",j,"%"]})),i(f,e({onClick:b,size:"small",sx:{color:"#667085",width:24,height:24,"&:hover":{bgcolor:"transparent",color:"#101828"}}},{children:i(C,{size:22})}))]}))]})),i(u,e({sx:{display:"flex",borderBottom:"1px solid #E4E7EC",px:2.5,flexShrink:0}},{children:["deviation","association"].map(function(n){var t=T===n;return i(u,e({onClick:function(){return L(n)},sx:{pb:"10px",pt:"4px",mr:3,px:2,cursor:"pointer",fontSize:"14px",fontWeight:t?600:400,color:t?"#5928ED":"#667085",backgroundColor:t?"rgba(89,40,237,0.08)":"transparent",borderBottom:t?"2px solid #5928ED":"2px solid transparent",transition:"all 0.15s",userSelect:"none",overflowY:"auto"}},{children:"deviation"===n?"Deviation Analysis":"Association Logic"}),n)})})),i(u,e({sx:{flex:1,minHeight:0,overflowY:"auto",px:2.5,py:2,display:"flex",flexDirection:"column",gap:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"".concat(H.border,"55"),borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:H.border},scrollbarWidth:"thin",scrollbarColor:"".concat(H.border,"55 transparent")}},{children:"deviation"===T?t(u,e({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD",p:2,display:"flex",flexDirection:"column",gap:1}},{children:[i(p,e({sx:{fontSize:"15px",fontWeight:600,color:"#344054"}},{children:"Deviation Analysis"})),i(p,e({sx:{fontSize:"14px",color:"#667085",lineHeight:1.6}},{children:"Deviation analysis content will appear here. This tab shows structural and semantic deviations identified between the two sections being compared."}))]})):t(r,{children:[O.length>0&&t(u,e({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD"}},{children:[i(u,e({sx:{px:1.5,py:.75,borderBottom:"1px solid #EAECF0"}},{children:i(p,e({sx:{fontSize:"15px",fontWeight:600,color:"#344054",lineHeight:1.25}},{children:"Decision Making Factors"}))})),i(u,e({sx:{px:1.5,py:1.1,display:"flex",flexDirection:"column",gap:.95}},{children:O.map(function(n,i){return t(p,e({sx:{fontSize:"14px",color:"#344054",lineHeight:1.55,wordBreak:"break-word"}},{children:[i+1,". ",n,N(K("decisioning",i))]}),i)})}))]})),P.length>0&&t(u,e({sx:{borderRadius:"8px",border:"1px solid #E4E7EC",bgcolor:"#FCFCFD"}},{children:[i(u,e({sx:{px:1.5,py:.75,borderBottom:"1px solid #EAECF0"}},{children:i(p,e({sx:{fontSize:"15px",fontWeight:600,color:"#344054",lineHeight:1.25}},{children:"Gaps in Decision"}))})),i(u,e({sx:{px:1.5,py:1.1,display:"flex",flexDirection:"column",gap:.95}},{children:P.map(function(n,i){return t(p,e({sx:{fontSize:"14px",color:"#344054",lineHeight:1.55,wordBreak:"break-word"}},{children:[i+1,". ",n,N(K("gap",i))]}),i)})}))]})),0===O.length&&0===P.length&&i(u,e({sx:{p:2,bgcolor:"#F8FAFC",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:i(p,e({sx:{fontSize:"13px",color:"#64748B"}},{children:"No cognitive decisioning data available for this section."}))}))]})}))]}));return S.createPortal(q,document.body)},T=function(n){var r=n.data,o=n.isSelected,l=n.isCognitiveOpen,a=n.onToggleCognitive,c=n.onClick,s=A(r.summaryText||r.description),d=s.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),h=d?s.replace(d[0],"").trim():s,g=!!d;return t(u,e({id:"variant-card-".concat(r.id),onClick:c,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:r.isLoading?.7:1,border:o?"1.4px solid #2563EB":void 0,boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[i(u,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:r.isLoading?i(x,{variant:"rounded",width:80,height:20}):t(u,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==r.similarity?r.similarity:0,"% Similarity"]}))})),t(u,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[i(u,e({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:i(p,e({sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:A(r.title)}))})),r.isLoading?t(u,{children:[i(x,{width:"90%"}),i(x,{width:"60%"})]}):t(u,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i(p,e({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"}},{children:h})),g&&t(u,e({onClick:function(e){e.stopPropagation(),o||c(),a()},sx:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"4px",cursor:"pointer",marginLeft:"-4px","&:hover":{backgroundColor:"#F1F5F9"}}},{children:[i("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:i(D,{})})),i(E,{size:12,style:{transform:o&&l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})]}))]}))]}))]}))},L=[{key:"title",label:"Title",analysisKey:"title"},{key:"description",label:"Description",analysisKey:"description"}],H={fields:L,thresholds:{exact:90,high:70,medium:40},relationStyles:{noContent:{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F8FAFC",badgeBorder:"#F1F5F9",badgeText:"#64748B",highlightBg:"transparent"},exact:{bg:"#FFF1F2",border:"#FECDD3",badgeBg:"#FFE4E6",badgeBorder:"#FEE2E2",badgeText:"#9F1239",highlightBg:"#FECDD3"},high:{bg:"#FFF5F5",border:"#FECACA",badgeBg:"#FEECEC",badgeBorder:"#F8C2C2",badgeText:"#B42318",highlightBg:"#FDD5D5"},medium:{bg:"#FFFCF6",border:"#FFDD80",badgeBg:"#FEF9C3",badgeBorder:"#FEF08A",badgeText:"#A16207",highlightBg:"#FDDEB3"},low:{bg:"#F5F9FF",border:"#CFE0FF",badgeBg:"#EEF4FF",badgeBorder:"#BFD3FF",badgeText:"#1D4ED8",highlightBg:"#DCEAFF"}}},j=function(e){return null!=e&&("string"==typeof e?e.trim().length>0:!Array.isArray(e)||e.length>0&&e.some(function(e){return j(e)}))},M=function(n){var t,i,r,o,l=[],a=[],c=n.base_root_id,s=n.input_index_map||{0:"left",1:"right"},d=n[c];if(!d||!1===d.display_node)return{activeProposed:{title:"No Data",sections:[]},activeVariants:[]};var u=function(e,n){var t,i=s[n],r=null===(t=null==e?void 0:e.comparison_inputs)||void 0===t?void 0:t[i];return{title:A((null==r?void 0:r.title)||""),content:A((null==r?void 0:r.content)||"")}};d.next&&Object.values(d.next).forEach(function(t){var i=n[t];if(i&&!1!==i.display_node){var r=function(e){if(!e.mapping_rationale)return{score:void 0,relation:"not_defined"};var n=e.mapping_rationale,t=!n.decision_strength,i=parseInt(n.decision_strength||"0");return{cognitiveData:{decisioning:n.decisioning_factors||"",gap:n.gaps_in_decision||"",relevance_score:i},score:t?100:i/100,relation:i>=70?"no_deviation":"deviation"}}(i),o=u(i,"0"),c=u(i,"1"),s=e({id:t,title:o.title,content:o.content,subsections:[]},r),d=e({id:t,title:c.title,content:c.content,subsections:[]},r);if(i.next)Object.values(i.next).forEach(function(e){var t=n[e];if(t&&!1!==t.display_node){var i=u(t,"0"),r=u(t,"1");i.content&&s.subsections.push(i.content),r.content&&d.subsections.push(r.content)}});l.push(s),a.push(d)}});return{activeProposed:{title:(null===(i=null===(t=d.comparison_inputs)||void 0===t?void 0:t[s[0]])||void 0===i?void 0:i.title)||"Uploaded Contract",description:d.decision_scope_description||"",sections:l},activeVariants:[{id:"tree-variant-1",title:(null===(o=null===(r=d.comparison_inputs)||void 0===r?void 0:r[s[1]])||void 0===o?void 0:o.title)||"Reference Template",similarity:l.length>0?Math.round(l.reduce(function(e,n){return e+(n.score||0)},0)/l.length*100):0,sections:a,analysis:{rule_difference_comparison:{summary:{overall_score:0,overall_summary:d.decision_scope_description||""},fields:{}}}}]}},O=function(r){var x,C,S,k=r.variants,O=void 0===k?[]:k,P=r.treeData,V=r.comparisonConfig,K=r.onSelectVariant,N=r.onSkip,U=r.onBack,q=r.targetVariantId,Y=r.highlightedField;r.onBadgeClick,r.activeBadgeId;var G=l(null),J=G[0],$=G[1],X=a(function(){return(null==P?void 0:P.cognitive_decisioning)||{}},[P]),Z=c(null),Q=l(null),ee=Q[0],ne=Q[1],te=c(null),ie=l({open:!1,sectionTitle:"",refSectionTitle:"",cognitiveData:null,anchorEl:null,sectionAnchorEl:null,badgeStyle:null,sectionId:""}),re=ie[0],oe=ie[1],le=c(null),ae=c(null),ce=c(null),se=c(!1),de=s(function(){var e;if(re.anchorEl&&re.refSectionTitle){var n=re.anchorEl.getBoundingClientRect(),t=(null===(e=null==te?void 0:te.current)||void 0===e?void 0:e.offsetHeight)||0,i=Math.min(680,window.innerWidth-24),r=window.innerHeight-n.bottom-12,o=n.top-12,l=r<t&&o>r,a=l?n.top-12-t:n.bottom+12,c=n.left+n.width/2,s=c-i/2,d=Math.max(12,Math.min(s,window.innerWidth-i-12)),u=Math.max(14,Math.min(c-d,i-_-4));ne({top:a,left:d,arrowLeft:u,openAbove:l})}},[re.anchorEl,re.refSectionTitle]);d(function(){if(re.open){window.addEventListener("resize",de);var e=requestAnimationFrame(de);return function(){cancelAnimationFrame(e),window.removeEventListener("resize",de)}}},[re.open,de]),d(function(){var n=ae.current;if(n&&re.open){var t=function(n){console.log("Scroll event detected on:",n.target,"- closing CognitivePopup"),oe(function(n){return e(e({},n),{open:!1,anchorEl:null,sectionAnchorEl:null})})};return n.addEventListener("scroll",t,{capture:!0}),window.addEventListener("scroll",t,{capture:!0}),function(){n.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("scroll",t,{capture:!0})}}},[re.open]);var ue=a(function(){var n,t,i,r,o,l,a,c,s,d,u,p;return{fields:null!==(n=null==V?void 0:V.fields)&&void 0!==n?n:L,thresholds:{high:null!==(i=null===(t=null==V?void 0:V.thresholds)||void 0===t?void 0:t.high)&&void 0!==i?i:H.thresholds.high,medium:null!==(o=null===(r=null==V?void 0:V.thresholds)||void 0===r?void 0:r.medium)&&void 0!==o?o:H.thresholds.medium,exact:null!==(a=null===(l=null==V?void 0:V.thresholds)||void 0===l?void 0:l.exact)&&void 0!==a?a:H.thresholds.exact},relationStyles:{noContent:e(e({},H.relationStyles.noContent),(null===(c=null==V?void 0:V.relationStyles)||void 0===c?void 0:c.noContent)||{}),high:e(e({},H.relationStyles.high),(null===(s=null==V?void 0:V.relationStyles)||void 0===s?void 0:s.high)||{}),exact:e(e({},H.relationStyles.exact),(null===(d=null==V?void 0:V.relationStyles)||void 0===d?void 0:d.exact)||{}),medium:e(e({},H.relationStyles.medium),(null===(u=null==V?void 0:V.relationStyles)||void 0===u?void 0:u.medium)||{}),low:e(e({},H.relationStyles.low),(null===(p=null==V?void 0:V.relationStyles)||void 0===p?void 0:p.low)||{})}}},[V]),pe=a(function(){if(P&&Object.keys(P).length>0)try{var n=M(P);return e(e({},n),{parseError:null})}catch(e){return console.error("Data Transformation Error: ",e),{activeProposed:{},activeVariants:O||[],parseError:e instanceof Error?e.message:"Unknown Parsing Error"}}return{activeProposed:{},activeVariants:O||[],parseError:null}},[P,O]),he=pe.activeProposed,ge=pe.activeVariants,fe=pe.parseError;d(function(){fe&&$("Failed to load comparison: ".concat(fe))},[fe]);var xe=l(q||null),ve=xe[0],me=xe[1],be=l(!1),ye=be[0],Fe=be[1],we=l(null),Ee=we[0],Ce=we[1],Se=l({}),ke=Se[0],De=Se[1];d(function(){if(q&&me(q),Ce(null!=Y?Y:null),Y){var e=setTimeout(function(){return Ce(null)},6e3);return function(){return clearTimeout(e)}}},[q,Y]);var Be=function(e){var n;null===(n=le.current)||void 0===n||n.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},Ae=a(function(){return n([],ge,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[ge]),Ie=a(function(){if(ve){var e=String(ve).trim();return ge.find(function(n){return n.id&&String(n.id).trim()===e})||Ae[0]}return Ae[0]||null},[ve,ge,Ae]);d(function(){ve&&le.current&&setTimeout(function(){var e=document.getElementById("variant-card-".concat(ve.trim())),n=le.current;if(e&&n){var t=e.offsetLeft-n.offsetLeft-n.clientWidth/2+e.clientWidth/2;n.scrollTo({left:t,behavior:"smooth"})}},150)},[ve,Ae]);var ze=Ie||{id:"",title:""},Re=A(he.title)||"Uploaded Contract",_e=A(ze.title)||"Reference Template",We=he.sections||[],Te=ze.sections||[],Le=We.length>0||Te.length>0,He=null==Ie?void 0:Ie.analysis,je=A(null===(C=null===(x=null==He?void 0:He.rule_difference_comparison)||void 0===x?void 0:x.summary)||void 0===C?void 0:C.overall_summary),Me=!!je.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Oe=null!==(S=null==Ie?void 0:Ie.similarity)&&void 0!==S?S:0,Pe=c({}),Ve=function(e){return Pe.current[e]||(Pe.current[e]=o.createRef()),Pe.current[e]};d(function(){!ve&&!q&&Ae.length>0&&!Ae[0].isLoading&&me(Ae[0].id)},[Ae,ve,q]);var Ke=c(null),Ne=c(null),Ue=c(null),qe=l([]),Ye=qe[0],Ge=qe[1],Je=l(null),$e=Je[0],Xe=Je[1],Ze=l(!1),Qe=Ze[0],en=Ze[1],nn=l(!1),tn=nn[0],rn=nn[1];d(function(){var e=le.current;if(e){var n=function(){en(e.scrollLeft>0),rn(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return n(),e.addEventListener("scroll",n),window.addEventListener("resize",n),function(){e.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}},[Ae]);var on=a(function(){return ue.fields.filter(function(e){var n=e.key;return(!Le||"description"!==n)&&(j(he[n])||j(ze[n]))})},[he,ze,Le,ue.fields]),ln=c({}),an=c({}),cn=c({}),sn=c({});on.forEach(function(e){var n=e.key;ln.current[n]||(ln.current[n]=o.createRef()),an.current[n]||(an.current[n]=o.createRef())});for(var dn=0;dn<Math.max(We.length,Te.length);dn+=1)cn.current[dn]||(cn.current[dn]=o.createRef()),sn.current[dn]||(sn.current[dn]=o.createRef());d(function(){if(Ee){var e=ue.fields.find(function(e){return e.analysisKey===Ee||e.key===Ee});if(e){var n=ln.current[e.key]||an.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Ee,ue.fields]);var un=function(e){var n,t,i,r,o,l,a,c,s,d=null===(n=null==He?void 0:He.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!d||!d[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var u=d[e],p=(null==u?void 0:u.relation)||(null===(i=null===(t=null==u?void 0:u.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(o=null===(r=null==u?void 0:u.highlights)||void 0===r?void 0:r.ruleB_spans)||void 0===o?void 0:o.length)||(null==u?void 0:u.mappings)&&u.mappings.length>0;if(u.mappings){var h=u.mappings[0]||{};return{score:u.score,relation:h.relation||"",highlightsA:(null===(l=h.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(a=h.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!p}}return{score:u.score,relation:u.relation||"",highlightsA:(null===(c=u.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(s=u.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!p}},pn=function(n){var t=Te[n];if("not_defined"===(null==t?void 0:t.relation))return e(e({},ue.relationStyles.noContent),{label:"Not Defined"});var i,r=un("description");if(null!=(null==t?void 0:t.cognitiveRelevanceScore)){var o=(i=t.cognitiveRelevanceScore)>=90?{score:1,relation:"exact_match"}:i>=70?{score:.8,relation:"high_match"}:i>=40?{score:.5,relation:"partial_match"}:{score:0,relation:"no_deviation"};return z(o.score,o.relation,!0,ue)}var l=null!=(null==t?void 0:t.relation)&&""!==t.relation?t.relation:r.relation,a="number"==typeof(null==t?void 0:t.score)?t.score:r.score;return z(a,l,!0,ue)},hn=function(){var e,n,t;if(!se.current){se.current=!0;try{if(!Ke.current)return;var i=Ke.current.getBoundingClientRect(),r=[];on.forEach(function(e){var n=e.key,t=e.analysisKey,o=ln.current[n],l=an.current[n];if((null==o?void 0:o.current)&&(null==l?void 0:l.current)){o.current.style.height="auto",l.current.style.height="auto",o.current.style.minHeight="0px",l.current.style.minHeight="0px";var a=o.current.getBoundingClientRect().height,c=l.current.getBoundingClientRect().height,s=Math.max(a,c);o.current.style.minHeight="".concat(s,"px"),l.current.style.minHeight="".concat(s,"px");var d=o.current.getBoundingClientRect(),u=l.current.getBoundingClientRect(),p=un(t),h=z(p.score,p.relation,p.hasContent,ue);if(!h)return;var g=d.top+d.height/2-i.top;r.push({id:"field-".concat(n),x1:d.right-i.left,y1:g,x2:u.left-i.left,y2:g,style:h})}});for(var o=Math.min(We.length,Te.length),l=0;l<o;l+=1){var a=cn.current[l],c=sn.current[l];if((null==a?void 0:a.current)&&(null==c?void 0:c.current)){a.current.style.height="auto",c.current.style.height="auto",a.current.style.minHeight="0px",c.current.style.minHeight="0px";var s=Math.max(a.current.getBoundingClientRect().height,c.current.getBoundingClientRect().height);a.current.style.minHeight="".concat(s,"px"),c.current.style.minHeight="".concat(s,"px");var d=a.current.querySelector(".MuiAccordionSummary-root"),u=c.current.querySelector(".MuiAccordionSummary-root");if(d&&u){var p=d.getBoundingClientRect(),h=u.getBoundingClientRect(),g=(p.top+p.height/2-i.top+h.top+h.height/2-i.top)/2,f=(null===(e=Te[l])||void 0===e?void 0:e.id)||"sec-".concat(l),x=pn(l);x&&r.push({id:f,x1:p.right-i.left,y1:g,x2:h.left-i.left,y2:g,style:x,sectionIdx:l,hasCognitive:!(!(null===(n=We[l])||void 0===n?void 0:n.cognitiveData)&&!(null===(t=Te[l])||void 0===t?void 0:t.cognitiveData))})}}}if(Ge(r),Ne.current&&Ue.current){var v=Ne.current.getBoundingClientRect(),m=Ue.current.getBoundingClientRect(),b=(v.top+v.height/2-i.top+m.top+m.height/2-i.top)/2;Xe({x1:v.right-i.left,x2:m.left-i.left,y:b})}else Xe(null)}catch(e){console.error("Line render safe fail: ",e)}finally{se.current=!1}}};d(function(){var e=setTimeout(hn,250);window.addEventListener("resize",hn);var n=null;return ae.current&&(n=new ResizeObserver(function(){return window.requestAnimationFrame(hn)})).observe(ae.current),function(){clearTimeout(e),window.removeEventListener("resize",hn),null==n||n.disconnect()}},[he,ze,He,ye,on,ke,We,Te,ue]);var gn={fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,wordBreak:"break-word",overflowWrap:"break-word",overflow:"hidden","& p":{mt:0,mb:1.5},"& p:last-child":{mb:0},"& ul, & ol":{mt:0,mb:1.5,pl:2.5},"& li":{mb:.5},"& strong":{fontWeight:600},"& code":{whiteSpace:"pre-wrap",wordBreak:"break-word"}},fn=function(n,r,o,l){return i(u,e({ref:l,sx:{mb:1,minHeight:0,display:"flex",flexDirection:"column"}},{children:t(v,e({disableGutters:!0,expanded:!!ke[r],onChange:function(){return n=r,void De(function(t){var i;return e(e({},t),((i={})[n]=!t[n],i))});var n},sx:{boxShadow:"none",border:"1px solid #E2E8F0",bgcolor:"#FFFFFF",borderRadius:"6px",flex:1,display:"flex",flexDirection:"column","&:before":{display:"none"}}},{children:[i(m,e({expandIcon:i(E,{size:16}),sx:{minHeight:"36px",flexShrink:0,"& .MuiAccordionSummary-content":{my:.5,display:"flex",alignItems:"center",overflow:"hidden"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:i(p,e({sx:{fontSize:"12px",color:"#19213D",fontWeight:500,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:I(n.title||"Section ".concat(r+1))}))})),t(b,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column"}},{children:[i(p,e({component:"div",sx:gn},{children:i(B,{children:A(n.content).replace(/\\n/g,"\n")})})),(n.subsections||[]).map(function(n,t){return i(u,e({sx:{mt:1,pt:1,borderTop:"1px solid #EEF2F7"}},{children:i(p,e({component:"div",sx:gn},{children:i(B,{children:A(n).replace(/\\n/g,"\n")})}))}),"".concat(o,"-sub-").concat(r,"-").concat(t))})]}))]}))}),"".concat(o,"-sec-").concat(r))};return t(u,e({ref:ce,sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"visible",position:"relative"}},{children:[re.open&&i(W,{open:re.open,popupRef:te,position:ee,onClose:function(){return oe(function(n){return e(e({},n),{open:!1})})},sectionTitle:re.sectionTitle,referenceSectionTitle:re.refSectionTitle,cognitiveData:re.cognitiveData,anchorEl:re.anchorEl,sectionAnchorEl:re.sectionAnchorEl,scrollContainerEl:ae.current,badgeStyle:re.badgeStyle}),i(h,e({open:!!J,autoHideDuration:8e3,onClose:function(){return $(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(g,e({onClose:function(){return $(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:J}))})),t(u,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[t(u,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[i(f,e({onClick:U,size:"small"},{children:i(y,{})})),i(p,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),i(f,e({onClick:N,size:"small"},{children:i(u,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),Ae.length>1&&t(u,e({sx:{px:3,pb:.25},ref:Z},{children:[t(u,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[i(p,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),t(u,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[i(f,e({onClick:function(){return Be("left")},size:"small",disabled:!Qe},{children:i(y,{size:18})})),i(f,e({onClick:function(){return Be("right")},size:"small",disabled:!tn},{children:i(F,{size:18})}))]}))]})),i(u,e({ref:le,sx:{display:"flex",gap:1,overflowX:"auto",pb:.05,"&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"transparent",borderRadius:"10px"}}},{children:Ae.map(function(e){return i(T,{data:e,isSelected:(null==Ie?void 0:Ie.id)===e.id,isCognitiveOpen:ye,onToggleCognitive:function(){return Fe(function(e){return!e})},onClick:function(){return me((n=e).id),K(n),void Fe(!1);var n}},e.id)})}))]})),i(u,e({ref:ae,sx:{flex:1,overflowY:"auto",minHeight:0,pt:1.5,pb:8,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:je&&Me&&ye?"none":"1.5px solid #EEF0F4"}},{children:i(u,e({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:t(u,e({ref:Ke,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[t("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:[$e&&t("g",{children:[i("line",{x1:$e.x1,y1:$e.y,x2:Math.max($e.x1,($e.x1+$e.x2)/2-70),y2:$e.y,stroke:"#BBF7D0",strokeWidth:"1.5"}),i("line",{x1:Math.min($e.x2,($e.x1+$e.x2)/2+70),y1:$e.y,x2:$e.x2,y2:$e.y,stroke:"#BBF7D0",strokeWidth:"1.5"})]}),Ye.map(function(n,r){var o=(n.x1+n.x2)/2;return n.id||"line-".concat(r),"Not Defined"===n.style.label?null:t("g",{children:[i("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder,strokeWidth:"1.5"}),i("foreignObject",e({x:o-75,y:n.y1-14,width:"150",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(u,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(u,e({sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:500,textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"},onClick:function(e){e.stopPropagation(),function(e,n,t,i,r){var o,l;e.stopPropagation();var a=A(n.id)||A(t.id)||"",c=(a?X[a]:null)||n.cognitiveData||t.cognitiveData||null,s=null!==(l=null===(o=Pe.current[i])||void 0===o?void 0:o.current)&&void 0!==l?l:null;oe({open:!0,sectionTitle:n.title||"Section",refSectionTitle:t.title||"Reference Section",cognitiveData:c,anchorEl:e.currentTarget,sectionAnchorEl:s,badgeStyle:r||null,sectionId:a})}(e,We[n.sectionIdx]||{title:"",content:""},Te[n.sectionIdx]||{title:"",content:""},n.sectionIdx,n.style)}},{children:[n.style.label,n.hasCognitive&&void 0!==n.sectionIdx&&i(u,e({sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",px:"4px",ml:"2px",color:n.style.badgeText,transition:"background 0.15s","&:hover":{backgroundColor:"rgba(0,0,0,0.05)"}}},{children:i("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:i(D,{})}))})),parseInt(n.sectionIdx)===parseInt(re.sectionId)?i(w,{size:12,color:n.style.badgeText}):i(E,{size:12,color:n.style.badgeText})]}))}))}))]},r)})]})),t(u,e({sx:{border:"1px dashed #B0B0B0",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)",minWidth:0}},{children:[i(u,e({ref:Ne,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:Re}))})),t(u,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:[on.map(function(e){var n=e.key,t=e.label,r=e.analysisKey,o=un(r),l=he[n],a=ze[n];if(!j(l)&&!j(a))return null;var c=z(o.score,o.relation,o.hasContent,ue);return c?i(R,{ref:ln.current[n],label:t,content:l,highlights:o.highlightsA,styleVariant:c,isHighlighted:Ee===r||Ee===n},"left-".concat(n)):null}),Le&&We.map(function(e,n){return{section:e,idx:n}}).filter(function(e){var n=e.section;return j(n.title)||j(n.content)||(n.subsections||[]).some(j)}).map(function(n){var t=n.section,r=n.idx;return i(u,e({ref:Ve(r)},{children:fn(t,r,"left",cn.current[r]||o.createRef())}),"left-row-".concat(r))})]}))]})),i(u,e({sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"6px",gap:0}},{children:i(u,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(u,e({sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",borderRadius:"20px",bgcolor:"#ECFDF3",border:"1px solid #A7F3D0",color:"#15803D",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1}},{children:[i(u,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(D,{})})),Oe,"% Similarity",i(E,{size:11})]}))}))})),t(u,e({sx:{border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0}},{children:[i(u,e({ref:Ue,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:_e}))})),t(u,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:[on.map(function(e){var n=e.key,t=e.label,r=e.analysisKey,o=un(r),l=he[n],a=ze[n];if(!j(l)&&!j(a))return null;var c=z(o.score,o.relation,o.hasContent,ue);return c?i(R,{ref:an.current[n],label:t,content:a,highlights:o.highlightsB,styleVariant:c,isHighlighted:Ee===r||Ee===n},"right-".concat(n)):null}),Le&&Te.map(function(e,n){return{section:e,idx:n}}).filter(function(e){var n=e.section;return j(n.title)||j(n.content)||(n.subsections||[]).some(j)}).map(function(e){var n=e.section,t=e.idx;return fn(n,t,"right",sn.current[t]||o.createRef())})]}))]}))]}))}))}))]}))};export{H as DEFAULT_COMPARISON_CONFIG,L as DEFAULT_FIELD_CONFIG,O as default};
2
+ //# sourceMappingURL=CognitiveCompare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CognitiveCompare.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as a,useRef as c,useMemo as r,useEffect as l}from"react";import s from"./CognitiveNonWebSearchReasoning.module.css.js";var o=function(o){var d=o.item,h=o.index,u=o.iconsConfig,m=o.headerTitle,v=void 0===m?"GPT - Gemini 2.5 Flash":m,g=null==u?void 0:u.ChevronDownIcon,f=null==u?void 0:u.ChevronUpIcon,p=null==u?void 0:u.MaximizeIcon,N=null==u?void 0:u.CloseIcon,I=a(!1),x=I[0],C=I[1],T=a(0),b=T[0],H=T[1],_=c(null),k=c(null),L=c(null),S=c([]),B=c([]),D=r(function(){return d.dataSource?d.dataSource.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):""},[d.dataSource]),W=r(function(){var n=D.split(/(<highlight>[\s\S]*?<\/highlight>)/g)||[],e=n.filter(function(n){return n.startsWith("<highlight>")}).length,i=0;return{parts:n.map(function(n,e){var t=n.startsWith("<highlight>"),a={text:t?n.replace(/<\/?highlight>/g,""):n,isHighlight:t,highlightIndex:t?i:-1,idx:e};return t&&i++,a}),totalHighlights:e}},[D]),w=W.parts,A=W.totalHighlights,j=function(n,e){void 0===e&&(e=!1);var i=e?B.current[n]:S.current[n],t=e?k.current:_.current;i&&t&&i.scrollIntoView({behavior:"smooth",block:"center"})},y=function(n){if(void 0===n&&(n=!1),A){var e=b>0?b-1:A-1;H(e),setTimeout(function(){return j(e,n)},50)}},z=function(n){if(void 0===n&&(n=!1),A){var e=b<A-1?b+1:0;H(e),setTimeout(function(){return j(e,n)},50)}};l(function(){S.current=S.current.slice(0,A),B.current=B.current.slice(0,A)},[A]),l(function(){var n;return x&&A>0&&(H(0),n=setTimeout(function(){return j(0)},50)),function(){n&&clearTimeout(n)}},[x,A]);var R=function(n){return n.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(n,i){return n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?t("strong",e({className:s.boldText},{children:n.slice(2,-2)}),i):n})},E=r(function(){var i=[],t=[];return w.forEach(function(e){var a=e.text,c=e.isHighlight,r=e.highlightIndex;a.split("\n").forEach(function(e,a){a>0&&((t.length>0||i.length>0)&&i.push({segments:n([],t,!0),isListItem:!1,isHeader:!1,indent:"",content:""}),t=[]),e&&t.push({text:e,isHighlight:c,highlightIndex:r})})}),t.length>0&&i.push({segments:n([],t,!0),isListItem:!1,isHeader:!1,indent:"",content:""}),i.map(function(n){var i=n.segments.map(function(n){return n.text}).join(""),t=i.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/),a=i.match(/^(Title|Description|Training-basis):\s*(.*)$/i);return e(e({},n),{isListItem:!!t,isHeader:!!a,indent:(null==t?void 0:t[1])||"",content:(null==t?void 0:t[3])||i})})},[w]),F=function(n){void 0===n&&(n=!1);var a=0;return E.map(function(c,r){c.isHeader&&(a=0),c.isListItem&&(a+=1);var l=function(){return c.segments.map(function(i,a){var r=i.isHighlight&&i.highlightIndex===b,l=i.text;return c.isListItem&&0===a&&(l=i.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),i.isHighlight?t("span",e({ref:function(e){e&&(n?B.current[i.highlightIndex]=e:S.current[i.highlightIndex]=e)},className:"".concat(s.highlight).concat(r?" ".concat(s.highlightActive):"")},{children:R(l)}),a):t("span",{children:R(l)},a)})};return c.isHeader?t("span",e({className:s.headerLine},{children:l()}),r):c.isListItem?i("span",e({className:s.listItemLine,style:{paddingLeft:c.indent?"1rem":"0"}},{children:[i("span",e({className:s.listCounter},{children:[a,"."]})),t("span",{children:l()})]}),r):t("span",e({className:s.blockLine},{children:l()}),r)})};return i("div",e({className:s.container},{children:[i("div",e({className:s.itemRow},{children:["number"==typeof h&&i("span",e({className:s.indexNumber},{children:[h+1,"."]})),i("div",e({className:s.textContent},{children:[t("span",{children:null==d?void 0:d.text}),(null==d?void 0:d.paraphrase)&&i("button",e({type:"button",onClick:function(){return C(!x)},className:s.paraphraseButton},{children:[i("span",e({className:s.paraphraseText},{children:[t("span",e({className:s.paraphraseStar},{children:"✦"})),d.paraphrase]})),g&&t(g,{className:"".concat(s.chevronIcon).concat(x?" ".concat(s.chevronIconRotated):"")})]}))]}))]})),x&&i("div",e({className:s.expandedContainer},{children:[i("div",e({className:s.expandedHeader},{children:[t("span",e({className:s.headerTitle},{children:v})),i("div",e({className:s.headerActions},{children:[A>1&&i("div",e({className:s.navigationContainer},{children:[f&&t("button",e({onClick:function(){return y(!1)},className:s.navButton},{children:t(f,{className:s.navIcon})})),i("span",e({className:s.navCounter},{children:[b+1,"/",A]})),g&&t("button",e({onClick:function(){return z(!1)},className:s.navButton},{children:t(g,{className:s.navIcon})}))]})),null!=(null==d?void 0:d.confidence_score)&&i("span",e({className:s.confidenceBadge},{children:[t("span",e({className:s.confidenceStar},{children:"✦"})),i("span",e({className:s.confidenceScore},{children:[null==d?void 0:d.confidence_score,"%"]}))]})),p&&t("button",e({onClick:function(){var n;null===(n=L.current)||void 0===n||n.showModal()},className:s.maximizeButton,title:"View fullscreen"},{children:t(p,{className:s.maximizeIcon})}))]}))]})),t("div",e({ref:_,className:s.contentArea},{children:t("div",e({className:s.contentInner},{children:F(!1)}))})),d.trainingDataTitle&&t("div",e({className:s.footer},{children:t("span",e({className:s.trainingTitle},{children:d.trainingDataTitle}))}))]})),t("dialog",e({ref:L,className:s.modalDialog,onClick:function(n){var e;n.target===L.current&&(null===(e=L.current)||void 0===e||e.close())}},{children:i("div",e({className:s.modalContainer},{children:[i("div",e({className:s.modalHeader},{children:[t("span",e({className:s.modalHeaderTitle},{children:v})),i("div",e({className:s.modalHeaderActions},{children:[A>1&&i("div",e({className:s.modalNavContainer},{children:[f&&t("button",e({onClick:function(){return y(!0)},className:s.modalNavButton},{children:t(f,{className:s.navIcon})})),i("span",e({className:s.navCounter},{children:[b+1,"/",A]})),g&&t("button",e({onClick:function(){return z(!0)},className:s.modalNavButton},{children:t(g,{className:s.navIcon})}))]})),null!=(null==d?void 0:d.confidence_score)&&i("span",e({className:s.confidenceBadge},{children:[t("span",e({className:s.confidenceStar},{children:"✦"})),i("span",e({className:s.confidenceScore},{children:[null==d?void 0:d.confidence_score,"%"]}))]})),N&&t("button",e({onClick:function(){var n;null===(n=L.current)||void 0===n||n.close()},className:s.closeButton,title:"Close"},{children:t(N,{className:s.closeIcon})}))]}))]})),t("div",e({ref:k,className:s.modalContent},{children:t("div",e({className:s.modalContentInner},{children:F(!0)}))})),d.trainingDataTitle&&t("div",e({className:s.modalFooter},{children:t("span",e({className:s.trainingTitle},{children:d.trainingDataTitle}))}))]}))}))]}))};export{o as default};
1
+ import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as a,useRef as c,useMemo as l,useEffect as r}from"react";import s from"./CognitiveNonWebSearchReasoning.module.css.js";import{ExternalLink as o}from"lucide-react";var d=function(d){var h=d.item,u=d.index,m=d.iconsConfig,v=d.headerTitle,g=void 0===v?"GPT - Gemini 2.5 Flash":v,p=d.previewCallback,f=d.DocumentTitle,N=null==m?void 0:m.ChevronDownIcon,I=null==m?void 0:m.ChevronUpIcon,C=null==m?void 0:m.MaximizeIcon,x=null==m?void 0:m.CloseIcon,b=a(!1),T=b[0],H=b[1],k=a(0),L=k[0],S=k[1],_=c(null),B=c(null),D=c(null),W=c([]),w=c([]),y=l(function(){return h.dataSource?h.dataSource.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):""},[h.dataSource]),z=l(function(){var n=y.split(/(<highlight>[\s\S]*?<\/highlight>)/g)||[],e=n.filter(function(n){return n.startsWith("<highlight>")}).length,i=0;return{parts:n.map(function(n,e){var t=n.startsWith("<highlight>"),a={text:t?n.replace(/<\/?highlight>/g,""):n,isHighlight:t,highlightIndex:t?i:-1,idx:e};return t&&i++,a}),totalHighlights:e}},[y]),A=z.parts,F=z.totalHighlights,j=function(n,e){void 0===e&&(e=!1);var i=e?w.current[n]:W.current[n],t=e?B.current:_.current;i&&t&&i.scrollIntoView({behavior:"smooth",block:"center"})},R=function(n){if(void 0===n&&(n=!1),F){var e=L>0?L-1:F-1;S(e),setTimeout(function(){return j(e,n)},50)}},E=function(n){if(void 0===n&&(n=!1),F){var e=L<F-1?L+1:0;S(e),setTimeout(function(){return j(e,n)},50)}};r(function(){W.current=W.current.slice(0,F),w.current=w.current.slice(0,F)},[F]),r(function(){var n;return T&&F>0&&(S(0),n=setTimeout(function(){return j(0)},50)),function(){n&&clearTimeout(n)}},[T,F]);var G=function(n){return n.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(n,i){return n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?t("strong",e({className:s.boldText},{children:n.slice(2,-2)}),i):n})},M=l(function(){var i=[],t=[];return A.forEach(function(e){var a=e.text,c=e.isHighlight,l=e.highlightIndex;a.split("\n").forEach(function(e,a){a>0&&((t.length>0||i.length>0)&&i.push({segments:n([],t,!0),isListItem:!1,isHeader:!1,indent:"",content:""}),t=[]),e&&t.push({text:e,isHighlight:c,highlightIndex:l})})}),t.length>0&&i.push({segments:n([],t,!0),isListItem:!1,isHeader:!1,indent:"",content:""}),i.map(function(n){var i=n.segments.map(function(n){return n.text}).join(""),t=i.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/),a=i.match(/^(Title|Description|Training-basis):\s*(.*)$/i);return e(e({},n),{isListItem:!!t,isHeader:!!a,indent:(null==t?void 0:t[1])||"",content:(null==t?void 0:t[3])||i})})},[A]),V=function(n){void 0===n&&(n=!1);var a=0;return M.map(function(c,l){c.isHeader&&(a=0),c.isListItem&&(a+=1);var r=function(){return c.segments.map(function(i,a){var l=i.isHighlight&&i.highlightIndex===L,r=i.text;return c.isListItem&&0===a&&(r=i.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),i.isHighlight?t("span",e({ref:function(e){e&&(n?w.current[i.highlightIndex]=e:W.current[i.highlightIndex]=e)},className:"".concat(s.highlight).concat(l?" ".concat(s.highlightActive):"")},{children:G(r)}),a):t("span",{children:G(r)},a)})};return c.isHeader?t("span",e({className:s.headerLine},{children:r()}),l):c.isListItem?i("span",e({className:s.listItemLine,style:{paddingLeft:c.indent?"1rem":"0"}},{children:[i("span",e({className:s.listCounter},{children:[a,"."]})),t("span",{children:r()})]}),l):t("span",e({className:s.blockLine},{children:r()}),l)})};return i("div",e({className:s.container},{children:[i("div",e({className:s.itemRow},{children:["number"==typeof u&&i("span",e({className:s.indexNumber},{children:[u+1,"."]})),i("div",e({className:s.textContent},{children:[t("span",{children:null==h?void 0:h.text}),(null==h?void 0:h.paraphrase)&&i("button",e({type:"button",onClick:function(){return H(!T)},className:s.paraphraseButton},{children:[i("span",e({className:s.paraphraseText},{children:[t("span",e({className:s.paraphraseStar},{children:"✦"})),h.paraphrase]})),N&&t(N,{className:"".concat(s.chevronIcon).concat(T?" ".concat(s.chevronIconRotated):"")})]}))]}))]})),T&&i("div",e({className:s.expandedContainer},{children:[i("div",e({className:s.expandedHeader},{children:[t("span",e({className:s.headerTitle},{children:g})),i("div",e({className:s.headerActions},{children:[F>1&&i("div",e({className:s.navigationContainer},{children:[I&&t("button",e({onClick:function(){return R(!1)},className:s.navButton},{children:t(I,{className:s.navIcon})})),i("span",e({className:s.navCounter},{children:[L+1,"/",F]})),N&&t("button",e({onClick:function(){return E(!1)},className:s.navButton},{children:t(N,{className:s.navIcon})}))]})),null!=(null==h?void 0:h.confidence_score)&&i("span",e({className:s.confidenceBadge},{children:[t("span",e({className:s.confidenceStar},{children:"✦"})),i("span",e({className:s.confidenceScore},{children:[null==h?void 0:h.confidence_score,"%"]}))]})),C&&t("button",e({onClick:function(){var n;null===(n=D.current)||void 0===n||n.showModal()},className:s.maximizeButton,title:"View fullscreen"},{children:t(C,{className:s.maximizeIcon})}))]}))]})),t("div",e({ref:_,className:s.contentArea},{children:t("div",e({className:s.contentInner},{children:V(!1)}))})),h.trainingDataTitle&&t("div",e({className:s.footer},{children:t("span",e({className:s.trainingTitle},{children:h.trainingDataTitle}))})),f&&t("div",e({className:s.modalFooterSource},{children:i("button",e({type:"button",onClick:function(){null==p||p()},className:s.trainingTitleLink},{children:[f,t(o,{size:16,color:"#2563eb"})]}))}))]})),t("dialog",e({ref:D,className:s.modalDialog,onClick:function(n){var e;n.target===D.current&&(null===(e=D.current)||void 0===e||e.close())}},{children:i("div",e({className:s.modalContainer},{children:[i("div",e({className:s.modalHeader},{children:[t("span",e({className:s.modalHeaderTitle},{children:g})),i("div",e({className:s.modalHeaderActions},{children:[F>1&&i("div",e({className:s.modalNavContainer},{children:[I&&t("button",e({onClick:function(){return R(!0)},className:s.modalNavButton},{children:t(I,{className:s.navIcon})})),i("span",e({className:s.navCounter},{children:[L+1,"/",F]})),N&&t("button",e({onClick:function(){return E(!0)},className:s.modalNavButton},{children:t(N,{className:s.navIcon})}))]})),null!=(null==h?void 0:h.confidence_score)&&i("span",e({className:s.confidenceBadge},{children:[t("span",e({className:s.confidenceStar},{children:"✦"})),i("span",e({className:s.confidenceScore},{children:[null==h?void 0:h.confidence_score,"%"]}))]})),x&&t("button",e({onClick:function(){var n;null===(n=D.current)||void 0===n||n.close()},className:s.closeButton,title:"Close"},{children:t(x,{className:s.closeIcon})}))]}))]})),t("div",e({ref:B,className:s.modalContent},{children:t("div",e({className:s.modalContentInner},{children:V(!0)}))})),h.trainingDataTitle&&t("div",e({className:s.modalFooter},{children:t("span",e({className:s.trainingTitle},{children:h.trainingDataTitle}))})),f&&t("div",e({className:s.modalFooterSource},{children:i("button",e({type:"button",onClick:function(){var n;null==p||p(),null===(n=D.current)||void 0===n||n.close()},className:s.trainingTitleLink},{children:[f,t(o,{size:16,color:"#2563eb"})]}))}))]}))}))]}))};export{d as default};
2
2
  //# sourceMappingURL=CognitiveInternalgptReasoningComponent.js.map
@@ -1,2 +1,2 @@
1
- var e={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:.5rem}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:.875rem;gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:#475467;font-weight:500}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:#475467;flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:#0000;border:none;border-radius:.375rem;cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:#2563eb;font-weight:500;text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:#2563eb;padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:#2563eb;height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{border:solid #e5e7eb;border-radius:.5rem;border-width:1px 1px 2px;margin-left:1.5rem;margin-top:.5rem;overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.25rem .75rem}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{font-size:.875rem;font-weight:400}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:#f3f4f6}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:#4b5563;font-size:.875rem;min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:#f0fdf4;border:2px solid #3ac894;border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:#059669;font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:#059669;font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{font-size:.875rem;max-height:11rem;overflow-y:auto;padding:.5rem .75rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:1.5rem}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end;padding:.5rem .75rem}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{font-size:.875rem;font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:none;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:#fff;border-radius:.75rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{font-size:1rem;font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:#f3f4f6;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:#4b5563;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{flex:1;font-size:.875rem;overflow-y:auto;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:1.75rem}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:400}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:500;text-align:left;width:1.5rem}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:600}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:#fef08a;border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px 0 #0000000d}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
1
+ var e={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",trainingTitleLink:"CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",modalFooterSource:"CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:.5rem}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:.875rem;gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:#475467;font-weight:500}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:#475467;flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:#0000;border:none;border-radius:.375rem;cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:#2563eb;font-weight:500;text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:#2563eb;padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:#2563eb;height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{border:solid #e5e7eb;border-radius:.5rem;border-width:1px 1px 2px;margin-left:1.5rem;margin-top:.5rem;overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.25rem .75rem}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{font-size:.875rem;font-weight:400}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:#f3f4f6}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:#4b5563;font-size:.875rem;min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:#f0fdf4;border:2px solid #3ac894;border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:#059669;font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:#059669;font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{font-size:.875rem;max-height:11rem;overflow-y:auto;padding:.5rem .75rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:1.5rem}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{font-size:.875rem;font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;font-size:.8rem;font-weight:600;gap:.25rem}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:none;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:#fff;border-radius:.75rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{font-size:1rem;font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:#f3f4f6;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:#4b5563;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{flex:1;font-size:.875rem;overflow-y:auto;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:1.75rem}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-start;padding:1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:400}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:500;text-align:left;width:1.5rem}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:600}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:#fef08a;border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px 0 #0000000d}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
2
2
  //# sourceMappingURL=CognitiveNonWebSearchReasoning.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{pdfStyles as o}from"./PdfStyle.js";import{DefaultPdfIcon as l,DefaultFullScreenIcon as r,DefaultDownloadIcon as i,DefaultCloseIcon as s}from"../../assests/svg/PdfViewerIcons.js";var d=function(d){d.highlightIndex;var c=d.totalHighlights,a=d.controls,u=d.currentPosition,h=d.pdfName,m=d.onClose,p=d.pdfUrl,g=d.viewerRef,f=d.customStyles,x=d.customClasses,v=d.customIcons,b=a.ZoomInButton,y=a.ZoomOutButton,k=a.ZoomPopover,w=a.goToPrevious,N=a.goToNext,I=(null==x?void 0:x.actionButton)||"p-1 hover:bg-gray-200 rounded-md transition-colors";return n("div",e({className:(null==x?void 0:x.header)||"flex items-center justify-between mb-3 bg-[#FAFAFA] border-b border-gray-100 rounded-t-xl",style:e(e({},o.header),null==f?void 0:f.header)},{children:[n("div",e({className:"flex items-center gap-3 min-w-0 flex-1"},{children:[t("div",e({style:e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==f?void 0:f.pdfIconWrapper)},{children:(null==v?void 0:v.pdfIcon)||t(l,{})})),t("span",e({className:(null==x?void 0:x.pdfName)||"text-gray-800 text-sm truncate",style:e({fontWeight:500},null==f?void 0:f.pdfName)},{children:h}))]})),n("div",e({className:"flex items-center gap-4 text-gray-600 flex-shrink-0"},{children:[n("div",e({className:"flex items-center gap-1"},{children:[t(y,{}),t("div",e({className:"text-sm font-medium w-14 text-center"},{children:t(k,{})})),t(b,{})]})),!!c&&n("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n("span",e({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[u," of ",c]})),t("button",e({style:{background:"none",border:"none",cursor:u<=1?"not-allowed":"pointer",padding:"2px 4px",color:u<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:w,disabled:u<=1},{children:t("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:t("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),t("button",e({style:{background:"none",border:"none",cursor:u===c?"not-allowed":"pointer",padding:"2px 4px",color:u===c?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:N,disabled:u===c},{children:t("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:t("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),t("div",{className:"w-px h-5 bg-gray-300 mx-1"}),n("div",e({className:"flex items-center gap-2"},{children:[t("button",e({onClick:function(){var e=null==g?void 0:g.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},className:I,title:"Full Screen"},{children:(null==v?void 0:v.fullScreenIcon)||t(r,{})})),p&&t("a",e({href:p,target:"_blank",rel:"noopener noreferrer",className:I,title:"Open in new tab"},{children:(null==v?void 0:v.downloadIcon)||t(i,{})})),m&&t("button",e({onClick:m,className:"".concat(I," ml-1"),title:"Close"},{children:(null==v?void 0:v.closeIcon)||t(s,{})}))]}))]}))]}))};export{d as default};
1
+ import{__assign as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{pdfStyles as o}from"./PdfStyle.js";import{DefaultPdfIcon as l,DefaultFullScreenIcon as i,DefaultDownloadIcon as r,DefaultCloseIcon as d}from"../../assests/svg/PdfViewerIcons.js";import{Tooltip as s}from"@mui/material";var c=function(c){c.highlightIndex;var a=c.totalHighlights,p=c.controls,u=c.currentPosition,h=c.pdfName,m=c.onClose,g=c.pdfUrl,f=c.viewerRef,x=c.customStyles,v=c.customClasses,y=c.customIcons,b=c.headerAction,k=p.ZoomInButton,w=p.ZoomOutButton,I=p.ZoomPopover,C=p.goToPrevious,N=p.goToNext,F=(null==v?void 0:v.actionButton)||"p-1 hover:bg-gray-200 rounded-md transition-colors";return n("div",e({className:(null==v?void 0:v.header)||"flex items-center justify-between mb-3 bg-[#FAFAFA] border-b border-gray-100 rounded-t-xl",style:e(e({},o.header),null==x?void 0:x.header)},{children:[n("div",e({className:"flex items-center gap-3 min-w-0 flex-1"},{children:[t("div",e({style:e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==x?void 0:x.pdfIconWrapper)},{children:(null==y?void 0:y.pdfIcon)||t(l,{})})),t("span",e({className:(null==v?void 0:v.pdfName)||"text-gray-800 text-sm truncate",style:e({fontWeight:500},null==x?void 0:x.pdfName)},{children:h}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:"16px",color:"#4B5563",flexShrink:0}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[t(w,{}),t("div",e({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:t(I,{})})),t(k,{})]})),!!a&&n("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n("span",e({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[u," of ",a]})),t("button",e({style:{background:"none",border:"none",cursor:u<=1?"not-allowed":"pointer",padding:"2px 4px",color:u<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:C,disabled:u<=1},{children:t("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:t("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),t("button",e({style:{background:"none",border:"none",cursor:u===a?"not-allowed":"pointer",padding:"2px 4px",color:u===a?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:N,disabled:u===a},{children:t("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:t("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),t("div",{className:"w-px h-5 bg-gray-300 mx-1"}),n("div",e({className:"flex items-center gap-2"},{children:[(null==b?void 0:b.icon)&&(null==b?void 0:b.onClick)?t(s,e({title:(null==b?void 0:b.tooltip)||"",arrow:!0,placement:"top"},{children:t("div",e({onClick:b.onClick,style:{display:"flex",alignItems:"center",cursor:"pointer"},className:F},{children:b.icon}))})):t("button",e({onClick:function(){var e=null==f?void 0:f.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},className:F,title:"Full Screen"},{children:(null==y?void 0:y.fullScreenIcon)||t(i,{})})),g&&t("a",e({href:g,target:"_blank",rel:"noopener noreferrer",className:F,title:"Open in new tab"},{children:(null==y?void 0:y.downloadIcon)||t(r,{})})),m&&t("button",e({onClick:m,className:"".concat(F," ml-1"),title:"Close"},{children:(null==y?void 0:y.closeIcon)||t(d,{})}))]}))]}))]}))};export{c as default};
2
2
  //# sourceMappingURL=PdfToolbar.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{SpecialZoomLevel as o}from"@react-pdf-viewer/core";import r from"./PdfContainer.js";import n from"./PdfToolbar.js";import{pdfStyles as s}from"./PdfStyle.js";import{PdfHighlightControls as l}from"./usePdfHighlight.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import{useRef as a,useMemo as c}from"react";var u=function(u){var d,f=u.pdfUrl,m=u.highlightText,p=u.highlightPages,g=u.jumpToPageValue,h=void 0===g?0:g,v=u.pdfName,y=u.onClose,x=u.customStyles,T=u.customClasses,b=u.customIcons,P=a(null),w=c(function(){var e=new Set;return Object.values(p).forEach(function(t){t>0&&e.add(t-1)}),e},[p]),C=(d=m)&&0!==d.length?d.filter(function(e){return!d.some(function(t){return t!==e&&t.includes(e)})}):d,S=l(C,p,P,w),j=S.highlightIndex,A=S.cursorIndex,H=S.setCursorIndex,I=S.orderedKeys,_=S.totalHighlights,F=S.getValidPosition,V=S.tryJump,q=S.jumpToPage,N=S.zoomTo,R=S.plugins,z=S.controls,B=S.hideNonTargetHighlights,U=S.deduplicateHighlights,D=F(A);if(!f)return t("div",e({style:e(e({},s.emptyState),null==x?void 0:x.emptyState)},{children:"PDF is not available for this selection"}));return i("div",e({ref:P,className:(null==T?void 0:T.pdfViewerWrapper)||"",style:e(e(e({},s.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==x?void 0:x.pdfViewer)},{children:[t(n,{highlightIndex:j,totalHighlights:_,controls:z,currentPosition:D,pdfName:v,onClose:y,pdfUrl:f,viewerRef:P,customStyles:x,customClasses:T,customIcons:b}),t(r,{pdfUrl:f,plugins:R,customStyles:x,onLoad:function(){if(N(o.ActualSize),h>0){var e=h-1,t=I[e],i=p[t];H(e),i>0&&(setTimeout(function(){B(w),U(i-1)},1e3),q(i-1))}requestAnimationFrame(function(){V(),function(){if(P.current){var e=h-1,t=I[e],i=p[t],o=i>0?i-1:0,r={};I.forEach(function(e,t){var i=p[e];i>0&&(r[i]||(r[i]=[]),r[i].push(t))});var n=(r[i]||[]).indexOf(e),s=0,l=function(){var e,t;if(!(++s>40)){var i=null===(e=P.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(i){var r=null===(t=P.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(o,'"]'));if(r){var a=i.getBoundingClientRect(),c=r.getBoundingClientRect();if(c.top<a.bottom&&c.bottom>a.top){var u=r.querySelectorAll(".rpv-search__highlight")[n];if(u){var d=u.getBoundingClientRect(),f=i.scrollTop+(d.top-a.top)-i.clientHeight/2+d.height/2;i.scrollTo({top:f,behavior:"smooth"})}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}};setTimeout(l,500)}}()})},onPageChange:function(e){var t=e.currentPage;w.has(t)?(U(t),B(w)):B(w)}})]}))};export{u as default};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{SpecialZoomLevel as i}from"@react-pdf-viewer/core";import r from"./PdfContainer.js";import n from"./PdfToolbar.js";import{pdfStyles as a}from"./PdfStyle.js";import{PdfHighlightControls as s}from"./usePdfHighlight.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import{useRef as l,useMemo as c,useEffect as u}from"react";import d from"../ScannedDocCitation/ScannedDocCitation.js";var f=function(f){var g,h=f.pdfUrl,m=f.highlightText,p=f.highlightPages,v=f.highlightCordinatePages,C=f.highlightColor,x=void 0===C?"yellow":C,T=f.activeHighlightColor,y=void 0===T?"#f7dc51":T,P=f.jumpToPageValue,w=void 0===P?0:P,b=f.pdfName,S=f.onClose,A=f.customStyles,I=f.customClasses,j=f.customIcons,H=f.useCoordinates,N=f.fallbackPages,_=f.activeCitationIndex,V=f.onActiveCitationChange,q=f.headerAction,F=l(null),R=c(function(){if(H)return new Set(v.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(p).forEach(function(t){t>0&&e.add(t-1)}),e},[p]),z=(g=m)&&0!==g.length?g.filter(function(e){return!g.some(function(t){return t!==e&&t.includes(e)})}):g,B=s(z,H?{}:p,F,R,H,H?v:[],x,y),D=B.highlightIndex,U=B.cursorIndex,k=B.setCursorIndex,E=B.orderedKeys,O=B.totalHighlights,J=B.getValidPosition,K=B.tryJump,L=B.jumpToPage,W=B.zoomTo,G=B.plugins,M=B.controls,Q=B.hideNonTargetHighlights,X=B.deduplicateHighlights,Y=J(U);u(function(){void 0!==_&&_!==U&&k(_)},[_]);var Z=e(e({},M),{goToNext:function(){M.goToNext(),V&&V(U+1)},goToPrevious:function(){M.goToPrevious(),V&&V(U-1)}});if(!h)return t(d,{pages:N,activeCitationIndex:_,onActiveCitationChange:V,headerAction:q});return o("div",e({ref:F,className:(null==I?void 0:I.pdfViewerWrapper)||"",style:e(e(e({},a.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==A?void 0:A.pdfViewer)},{children:[t(n,{highlightIndex:D,totalHighlights:O,controls:Z,currentPosition:Y,pdfName:b,onClose:S,pdfUrl:h,viewerRef:F,customStyles:A,customClasses:I,customIcons:j,headerAction:q}),t(r,{pdfUrl:h,plugins:G,customStyles:A,onLoad:function(){if(W(i.ActualSize),w>0){var e=w-1,t=E[e],o=p[t],r=v[e];k(e),console.log(r,"cordinateTargetHighlight"),H&&r.pageIndex>0&&L(r.pageIndex),o>0&&(setTimeout(function(){Q(R),X(o-1)},1e3),H||L(o-1))}else if(!H&&p){var n=E.find(function(e){return p[e]>0});if(void 0!==n){var a=p[n]-1;L(a),setTimeout(function(){Q(R),X(a)},1e3)}}requestAnimationFrame(function(){K(),H||function(){if(F.current){var e=w-1,t=E[e],o=p[t],i=o>0?o-1:0,r={};E.forEach(function(e,t){var o=p[e];o>0&&(r[o]||(r[o]=[]),r[o].push(t))});var n=(r[o]||[]).indexOf(e),a=0,s=function(){var e,t;if(!(++a>40)){var o=null===(e=F.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(o){var r=null===(t=F.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(i,'"]'));if(r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect();if(c.top<l.bottom&&c.bottom>l.top){var u=r.querySelectorAll(".rpv-search__highlight")[n];if(u){var d=u.getBoundingClientRect(),f=o.scrollTop+(d.top-l.top)-o.clientHeight/2+d.height/2;o.scrollTo({top:f,behavior:"smooth"})}else setTimeout(s,100)}else setTimeout(s,100)}else setTimeout(s,100)}else setTimeout(s,100)}};setTimeout(s,500)}}()})},onPageChange:function(e){var t=e.currentPage;R.has(t)?(X(t),Q(R)):Q(R)}})]}))};export{f as default};
2
2
  //# sourceMappingURL=PdfViewer.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e}from"tslib";import{useState as t,useRef as r,useMemo as n}from"react";import{searchPlugin as o}from"@react-pdf-viewer/search";import{pageNavigationPlugin as i}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as a}from"@react-pdf-viewer/zoom";var l=function(l,u,c,s){var f=t(0),p=f[0],h=f[1],g=r(!1),v=t(0),d=v[0],m=v[1],_=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],n=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,o=0;null!==(t=n.exec(e));){var i=e.slice(o,t.index).trim();i&&r.push(i),t[2]&&r.push(t[2].trim()),o=t.index+t[0].length}var a=e.slice(o).trim();return a&&r.push(a),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},y=Object.keys(u).map(Number).sort(function(e,t){return e-t}),T=Object.values(u).filter(function(e){return e>0}).length,b=function(t){if(c.current){var r=c.current.querySelectorAll(".rpv-search__highlights"),n=new Set,o=new Set,i=new Map;r.forEach(function(r){var a=r.getAttribute("data-testid"),u=parseInt((null==a?void 0:a.replace("search__highlights-",""))||"-1"),c=r.querySelectorAll(".rpv-search__highlight");if(u===t){var s=new Set;c.forEach(function(t){var r=t,a=(r.getAttribute("title")||"").toLowerCase(),l=r.style.top,u="".concat(a,"_#$_").concat(l);if(r.style.display="none",n.has(u))if(i.has(u)){var c=i.get(u);i.set(u,e(e([],c,!0),[r],!1))}else i.set(u,[r]);else{if(n.add(u),i.has(u)){c=i.get(u);i.set(u,e(e([],c,!0),[r],!1))}else i.set(u,[r]);o.has(a)?s.add(u):o.add(a)}});var f=w(S,i);f.forEach(function(e){var t=new Set;e.elements.forEach(function(e){var r=e.style.left,n=e.style.width,o="".concat(r,"_").concat(n);t.has(o)?e.style.display="none":(t.add(o),e.style.display="")})}),console.groupCollapsed("[debug: PDF highlight text]"),console.log("input->",l),console.log("processed text->",S),console.log("dom->processed elements->",f),console.groupEnd()}})}},w=function(e,t){for(var r=Array.from(t.entries()),n=0,o=[],i=function(e){return e.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},a=0;a<e.length;a++)for(var l=e[a],u=i(l);n<r.length;){var c=r[n],s=c[0],f=c[1],p=i(s.split("_#$_")[0]),h=e[a+1],g=r[n+1],v=h?i(h):null,d=g?i(g[0].split("_#$_")[0]):null,m=u===p,_=n+1<r.length&&p===i(r[n+1][0].split("_#$_")[0]),y=m;if(m&&_&&v&&(y=v===d),y){o.push({chunk:l,matchedKey:s,elements:f}),n++;break}n++}return o},x=function(e){c.current&&c.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),o=t.querySelectorAll(".rpv-search__highlight");e.has(n)||o.forEach(function(e){e.style.display="none"})})},S=l.map(function(e){return _(e)}).flat(),A=o({keyword:S}),E=i(),j=a(),q=A.jumpToMatch,B=E.jumpToPage,I=j.zoomTo,M=j.ZoomInButton,Z=j.ZoomOutButton,O=j.ZoomPopover,P=function(){if(!g.current)try{q(0),g.current=!0}catch(e){requestAnimationFrame(P)}},$=function(e,t){if(c.current&&c.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var o,i,a=null===(o=c.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(i=c.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var u=l.querySelectorAll(".rpv-search__highlight")[t];if(u){var s=a.getBoundingClientRect(),f=u.getBoundingClientRect(),p=a.scrollTop+(f.top-s.top)-a.clientHeight/2+f.height/2;a.scrollTo({top:p,behavior:"smooth"})}}}};setTimeout(n,300)}},k=n(function(){var e={};return y.forEach(function(t,r){var n=u[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[y,u]),C=function(e){var t=u[y[e]];return(k[t]||[]).indexOf(e)};return{setHighlightIndex:h,highlightIndex:p,cursorIndex:d,setCursorIndex:m,orderedKeys:y,totalHighlights:T,getValidPosition:function(e){for(var t=0,r=0;r<=e;r++){var n=y[r];u[n]>0&&t++}return t},tryJump:P,jumpToPage:B,zoomTo:I,hideNonTargetHighlights:x,deduplicateHighlights:b,plugins:[A,E,j],controls:{ZoomInButton:M,ZoomOutButton:Z,ZoomPopover:O,goToNext:function(){for(var e=function(e){var t=y[e];if(u[t]>0){var r=u[t]-1,n=C(e);return m(e),B(u[t]-1),$(r,n),setTimeout(function(){b(r)},500),1===Object.keys(u).length&&x(s),{value:void 0}}},t=d+1;t<y.length;t++){var r=e(t);if("object"==typeof r)return r.value}},goToPrevious:function(){for(var e=function(e){var t=y[e];if(u[t]>0){var r=u[t]-1,n=C(e);return m(e),B(u[t]-1),$(r,n),setTimeout(function(){b(r)},500),1===Object.keys(u).length&&x(s),{value:void 0}}},t=d-1;t>=0;t--){var r=e(t);if("object"==typeof r)return r.value}}}}};export{l as PdfHighlightControls};
1
+ import{__assign as e}from"tslib";import{jsx as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useRef as n,useMemo as i}from"react";import{searchPlugin as a}from"@react-pdf-viewer/search";import{pageNavigationPlugin as u}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as c}from"@react-pdf-viewer/zoom";import{highlightPlugin as l}from"@react-pdf-viewer/highlight";var p=function(p,s,g,f,v,h,d,m){void 0===d&&(d="yellow"),void 0===m&&(m="#F6D739");var y=o(0),x=y[0],_=y[1],T=n(!1),I=o(0),b=I[0],S=I[1];n([]);var q=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],o=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,n=0;null!==(t=o.exec(e));){var i=e.slice(n,t.index).trim();i&&r.push(i),t[2]&&r.push(t[2].trim()),n=t.index+t[0].length}var a=e.slice(n).trim();return a&&r.push(a),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},w=Object.keys(s).map(Number).sort(function(e,t){return e-t}),A=i(function(){return v?h.length:v?0:Object.values(s).filter(function(e){return e>0}).length},[h,s]),B=function(e){if(g.current){var t=g.current.querySelectorAll(".rpv-search__highlights"),r=new Set;t.forEach(function(t){var o=t.getAttribute("data-testid"),n=parseInt((null==o?void 0:o.replace("search__highlights-",""))||"-1"),i=t.querySelectorAll(".rpv-search__highlight");n===e&&(i.forEach(function(e){var t=e,o=(t.getAttribute("title")||"").toLowerCase(),n=t.style.top,i="".concat(o,"_#$_").concat(n);r.has(i)?t.style.display="none":(r.add(i),t.style.display="")}),console.groupCollapsed("[debug: PDF highlight text]"),console.log("input->",p),console.log("processed text->",C),console.groupEnd())})}},j=function(e){g.current&&g.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),o=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),n=t.querySelectorAll(".rpv-search__highlight");e.has(o)||n.forEach(function(e){e.style.display="none"})})},C=p.map(function(e){return q(e)}).flat(),E=a({keyword:C}),Z=u(),F=c(),H=E.jumpToMatch,M=Z.jumpToPage,O=F.zoomTo,P=F.ZoomInButton,k=F.ZoomOutButton,R=F.ZoomPopover,z=l({renderHighlights:function(o){return t(r,{children:h.map(function(t,r){return e(e({},t),{originalIndex:r})}).filter(function(e){return e.pageNumber?e.pageNumber-1===o.pageIndex:e.pageIndex===o.pageIndex}).map(function(e){var r=e.originalIndex,o=r===b;return t("div",{style:{position:"absolute",left:"".concat(e.left,"%"),top:"".concat(e.top,"%"),width:"".concat(e.width,"%"),height:"".concat(e.height,"%"),background:o?m:d,opacity:o?.7:.4,transition:"background 0.2s, opacity 0.2s"}},r)})})}}),N=function(){if(!T.current)try{H(0),T.current=!0;var e=h[0];e&&v&&D(e.pageIndex,e.top)}catch(e){requestAnimationFrame(N)}},$=function(e,t){if(g.current&&g.current.querySelector(".rpv-core__viewer")){var r=-1,o=function(){var n,i,a=null===(n=g.current)||void 0===n?void 0:n.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(o,100);var u=null===(i=g.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(u){var c=u.querySelectorAll(".rpv-search__highlight")[t];if(c){var l=a.getBoundingClientRect(),p=c.getBoundingClientRect(),s=a.scrollTop+(p.top-l.top)-a.clientHeight/2+p.height/2;a.scrollTo({top:s,behavior:"smooth"})}}}};setTimeout(o,300)}},D=function(e,t){if(g.current){var r=0,o=function(){var n,i;if(!(++r>60)){var a=null===(n=g.current)||void 0===n?void 0:n.querySelector(".rpv-core__inner-pages");if(a){var u=null===(i=g.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(u){var c=u.getBoundingClientRect();if(0!==c.height){var l=a.getBoundingClientRect(),p=t/100*c.height,s=c.top-l.top+p;a.scrollTo({top:a.scrollTop+s-40,behavior:"smooth"})}else setTimeout(o,100)}else setTimeout(o,100)}else setTimeout(o,100)}};setTimeout(o,100)}},L=i(function(){var e={};return w.forEach(function(t,r){var o=s[t];o>0&&(e[o]||(e[o]=[]),e[o].push(r))}),e},[w,s]),J=function(e){var t=s[w[e]];return(L[t]||[]).indexOf(e)},K=function(e,t){if(g.current){var r=-1,o=0,n=function(){var i,a;if(!(++o>60)){var u=null===(i=g.current)||void 0===i?void 0:i.querySelector(".rpv-core__inner-pages");if(u){if(u.scrollTop!==r)return r=u.scrollTop,void setTimeout(n,100);var c=null===(a=g.current)||void 0===a?void 0:a.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(c){var l=c.getBoundingClientRect();if(0!==l.height){var p=u.getBoundingClientRect(),s=t/100*l.height,f=l.top-p.top+s;u.scrollTo({top:u.scrollTop+f-40,behavior:"instant"})}else setTimeout(n,100)}else setTimeout(n,100)}else setTimeout(n,100)}};setTimeout(n,100)}};return{setHighlightIndex:_,highlightIndex:x,cursorIndex:b,setCursorIndex:S,orderedKeys:w,totalHighlights:A,getValidPosition:function(e){if(v)return e+1;if(!s)return 0;for(var t=0,r=0;r<=e;r++)s[w[r]]>0&&t++;return t},tryJump:N,jumpToPage:M,zoomTo:O,hideNonTargetHighlights:j,deduplicateHighlights:B,scrollToCoord:D,plugins:[v?z:E,Z,F],controls:{ZoomInButton:P,ZoomOutButton:k,ZoomPopover:R,goToNext:function(){if(v&&h)for(var e=b+1;e<h.length;e++){var t=h[e],r=h[b];return S(e),M(t.pageIndex),void(t.pageIndex!==r.pageIndex?(M(t.pageIndex),K(t.pageIndex,t.top)):D(t.pageIndex,t.top))}else{var o=function(e){var t=w[e];if(s[t]>0){var r=s[t]-1,o=J(e);return S(e),M(s[t]-1),$(r,o),setTimeout(function(){B(r)},500),1===Object.keys(s).length&&j(f),{value:void 0}}};for(e=b+1;e<w.length;e++){var n=o(e);if("object"==typeof n)return n.value}}},goToPrevious:function(){if(v&&h)for(var e=b-1;e>=0;e--){var t=h[e],r=h[b];return S(e),M(t.pageIndex),void(t.pageIndex!==r.pageIndex?(M(t.pageIndex),K(t.pageIndex,t.top)):D(t.pageIndex,t.top))}else{var o=function(e){var t=w[e];if(s[t]>0){var r=s[t]-1,o=J(e);return S(e),M(s[t]-1),$(r,o),setTimeout(function(){B(r)},500),1===Object.keys(s).length&&j(f),{value:void 0}}};for(e=b-1;e>=0;e--){var n=o(e);if("object"==typeof n)return n.value}}}}}};export{p as PdfHighlightControls};
2
2
  //# sourceMappingURL=usePdfHighlight.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as i,Fragment as n,jsx as o}from"react/jsx-runtime";import{useState as t,useRef as r,useCallback as l,useEffect as d}from"react";import{ChevronUp as a,ChevronDown as c,X as p,Maximize2 as s}from"lucide-react";import{Modal as u}from"../ChatCitation/components/wrappers/Modal.js";function h(h){var g=h.images,x=h.highlights,f=h.pages,v=h.subHeadingText,m=void 0===v?"":v,b=h.showFullScreenMode,y=void 0===b||b,w=h.citationLabelColor,C=void 0===w?"#FFFF2E":w,k=h.showCitationLabelOnHover,I=void 0!==k&&k,z=h.highlightColor,S=void 0===z?"rgba(255, 220, 0, 0.15)":z,B=h.highlightActiveColor,F=void 0===B?"rgba(255, 220, 0, 0.35)":B,M=h.highlightBorderColor,L=void 0===M?"rgba(200, 160, 0, 0.4)":M,R=h.height,T=void 0===R?"700px":R,H=h.subHeadingTitleInsideModal,E=h.scrollToFirstCitation,j=void 0!==E&&E,D=h.showPageSeparator,P=void 0===D||D,W=h.pageSeparatorColor,_=void 0===W?"#e2e8f0":W,A=[],O=[];(null==f?void 0:f.length)?f.forEach(function(e,i){var n;e.gs_url&&A.push(e.gs_url),null===(n=e.highlighted_coordinates)||void 0===n||n.forEach(function(e){O.push({pageIndex:i,bboxes:[e]})})}):(A.push.apply(A,g||[]),O.push.apply(O,x||[]));var q=O.flatMap(function(e,i){return e.bboxes.map(function(n,o){return{bbox:n,pageIndex:e.pageIndex,key:"".concat(i,"-").concat(o)}})}),Y=q.length,G=t(null),J=G[0],K=G[1],N=t(0),Q=N[0],U=N[1],V=t(!1),X=V[0],Z=V[1],$=t({}),ee=$[0],ie=$[1],ne=r(null),oe=r(null),te=r([]),re=r([]),le=r(!1),de=l(function(e,i){void 0===i&&(i=!1);var n=Math.max(0,Math.min(Y-1,e));U(n),requestAnimationFrame(function(){var e=i?oe.current:ne.current,o=(i?re:te).current[n];if(e&&o){var t=e.getBoundingClientRect(),r=o.getBoundingClientRect(),l=r.top-t.top+e.scrollTop-e.clientHeight/2+r.height/2;e.scrollTo({top:l,behavior:"smooth"})}})},[Y]);d(function(){var e;if(j&&!le.current&&0!==Y){var i=null===(e=null==q?void 0:q[0])||void 0===e?void 0:e.pageIndex;ee[i]&&(le.current=!0,de(0,!1))}},[j,ee,Y,q,de]);var ae=function(t){return void 0===t&&(t=!1),Y>0&&o("div",e({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:i("div",e({style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px"}},{children:[i("span",e({style:{fontSize:"12px",color:"#888"}},{children:[Q+1," / ",Y]})),o("button",e({onClick:function(){return de(Q-1,t)},disabled:Q<=0,style:{padding:"2px 4px",cursor:Q<=0?"not-allowed":"pointer",opacity:Q<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:o(a,{size:14,color:"#64748b"})})),o("button",e({onClick:function(){return de(Q+1,t)},disabled:Q>=Y-1,style:{padding:"2px 4px",cursor:Q>=Y-1?"not-allowed":"pointer",opacity:Q>=Y-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:o(c,{size:14,color:"#64748b"})})),y&&i(n,{children:[o("span",{style:{width:"1px",height:"16px",background:"#e2e8f0",margin:"0 2px"}}),t?o(p,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return Z(!1)}}):o(s,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return Z(!0)}})]})]}))}))},ce=function(n){void 0===n&&(n=!1);var t=n?re:te,r=-1;return A.map(function(n,l){var d=O.filter(function(e){return e.pageIndex===l}).flatMap(function(e,i){return e.bboxes.map(function(e,n){return r++,{bbox:e,key:"".concat(l,"-").concat(i,"-").concat(n),globalIndex:r}})});return i("div",e({style:{marginBottom:"8px"}},{children:[i("div",e({style:{fontSize:"12px",color:"#888",marginBottom:"4px"}},{children:["Page ",l+1]})),o("div",e({style:{position:"relative",width:"100%",paddingTop:"129%",flexShrink:0}},{children:i("div",e({style:{position:"absolute",inset:0}},{children:[o("img",{src:n,alt:"Page ".concat(l+1),style:{display:"block",width:"100%",height:"100%",objectFit:"fill"},draggable:!1,ref:function(i){i&&i.complete&&!ee[l]&&ie(function(i){var n;return e(e({},i),((n={})[l]=!0,n))})},onLoad:function(){return ie(function(i){var n;return e(e({},i),((n={})[l]=!0,n))})}}),ee[l]&&d.map(function(n){var r=n.bbox,l=n.key,d=n.globalIndex,a=Q===d;return o("div",e({ref:function(e){t.current[d]=e},onMouseEnter:function(){return K(d)},onMouseLeave:function(){return K(null)},style:{position:"absolute",left:"".concat(100*r.xmin,"%"),top:"".concat(100*r.ymin,"%"),width:"".concat(100*(r.xmax-r.xmin),"%"),height:"".concat(100*(r.ymax-r.ymin),"%"),background:a?F:S,border:a?"1.5px solid ".concat(L):"none",borderRadius:"2px",zIndex:2}},{children:I&&J===d&&i("div",e({style:{position:"absolute",top:"-18px",right:"0",fontSize:"10px",background:C,color:"black",padding:"2px 6px",borderRadius:"3px",whiteSpace:"nowrap"}},{children:["Citation ",d+1]}))}),l)})]}))})),P&&l<A.length-1&&o("div",{style:{height:"1px",background:_,margin:"0"}})]}),l)})},pe={overflowY:"auto",border:"1px solid #ddd",borderRadius:"4px",padding:"8px",paddingBottom:0,display:"flex",flexDirection:"column",boxSizing:"border-box"};return i(n,{children:[i("div",e({style:{width:"100%",maxWidth:"800px",fontFamily:"inherit",display:"flex",flexDirection:"column"}},{children:[(m||Y>0)&&i("div",e({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:[m&&o("div",e({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:m})),o("div",e({style:{marginLeft:"auto"}},{children:ae(!1)}))]})),o("div",e({ref:ne,style:e(e({},pe),{maxHeight:T})},{children:ce(!1)}))]})),o(u,e({isOpen:X,onClose:function(){return Z(!1)}},{children:i("div",e({style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"}},{children:[(H||Y>0)&&i("div",e({style:{display:"flex",alignItems:"center",marginBottom:"6px",padding:"8px"}},{children:[H&&o("div",e({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:H})),o("div",e({style:{marginLeft:"auto"}},{children:ae(!0)}))]})),o("div",e({ref:oe,style:e(e({},pe),{flex:1})},{children:X&&ce(!0)}))]}))}))]})}export{h as default};
1
+ import{__assign as i}from"tslib";import{jsxs as e,Fragment as n,jsx as o}from"react/jsx-runtime";import{useState as t,useRef as r,useCallback as l,useEffect as a}from"react";import{ChevronUp as d,ChevronDown as c,X as p,Maximize2 as u}from"lucide-react";import{Modal as s}from"../ChatCitation/components/wrappers/Modal.js";import{Tooltip as h}from"@mui/material";function g(g){var x=g.images,f=g.highlights,v=g.pages,m=g.subHeadingText,b=void 0===m?"":m,y=g.showFullScreenMode,C=void 0===y||y,k=g.citationLabelColor,w=void 0===k?"#FFFF2E":k,I=g.showCitationLabelOnHover,z=void 0!==I&&I,S=g.highlightColor,B=void 0===S?"rgba(255, 220, 0, 0.15)":S,F=g.highlightActiveColor,M=void 0===F?"rgba(255, 220, 0, 0.35)":F,L=g.highlightBorderColor,R=void 0===L?"rgba(200, 160, 0, 0.4)":L,T=g.height,H=void 0===T?"700px":T,A=g.subHeadingTitleInsideModal,E=g.scrollToFirstCitation,j=void 0!==E&&E,D=g.showPageSeparator,P=void 0===D||D,W=g.pageSeparatorColor,_=void 0===W?"#e2e8f0":W,O=g.activeCitationIndex,q=g.onActiveCitationChange,Y=g.headerAction,G=[],J=[];(null==v?void 0:v.length)?v.forEach(function(i,e){var n;i.gs_url&&G.push(i.gs_url),null===(n=i.highlighted_coordinates)||void 0===n||n.forEach(function(i){J.push({pageIndex:e,bboxes:[i]})})}):(G.push.apply(G,x||[]),J.push.apply(J,f||[]));var K=J.flatMap(function(i,e){return i.bboxes.map(function(n,o){return{bbox:n,pageIndex:i.pageIndex,key:"".concat(e,"-").concat(o)}})}),N=K.length,Q=t(null),U=Q[0],V=Q[1],X=t(0),Z=X[0],$=X[1],ii=t(!1),ei=ii[0],ni=ii[1],oi=t({}),ti=oi[0],ri=oi[1],li=r(null),ai=r(null),di=r(null),ci=r([]),pi=r([]),ui=r(!1),si=l(function(i,e){void 0===e&&(e=!1);var n=Math.max(0,Math.min(N-1,i));$(n),q&&q(n),requestAnimationFrame(function(){var i=e?di.current:ai.current,o=(e?pi:ci).current[n];if(i&&o){var t=i.getBoundingClientRect(),r=o.getBoundingClientRect(),l=r.top-t.top+i.scrollTop-i.clientHeight/2+r.height/2;i.scrollTo({top:l,behavior:"smooth"})}})},[N,q]);a(function(){void 0!==O&&0!==N&&li.current!==O&&(li.current=O,$(O),si(O,!1))},[O,N,si]),a(function(){var i;if(j&&!ui.current&&0!==N){var e=null===(i=null==K?void 0:K[0])||void 0===i?void 0:i.pageIndex;ti[e]&&(ui.current=!0,si(0,!1))}},[j,ti,N,K,si]);var hi=function(t){return void 0===t&&(t=!1),N>0&&o("div",i({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:e("div",i({style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"4px"}},{children:[e("span",i({style:{fontSize:"12px",color:"#888"}},{children:[Z+1," / ",N]})),o("button",i({onClick:function(){return si(Z-1,t)},disabled:Z<=0,style:{padding:"2px 4px",cursor:Z<=0?"not-allowed":"pointer",opacity:Z<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:o(d,{size:14,color:"#64748b"})})),o("button",i({onClick:function(){return si(Z+1,t)},disabled:Z>=N-1,style:{padding:"2px 4px",cursor:Z>=N-1?"not-allowed":"pointer",opacity:Z>=N-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:o(c,{size:14,color:"#64748b"})})),!Y&&C&&e(n,{children:[o("span",{style:{width:"1px",height:"16px",background:"#e2e8f0",margin:"0 2px"}}),t?o(p,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return ni(!1)}}):o(u,{size:16,color:"#64748b",style:{cursor:"pointer"},onClick:function(){return ni(!0)}})]}),Y&&(null==Y?void 0:Y.icon)&&(null==Y?void 0:Y.onClick)&&e(n,{children:[o("span",{style:{width:"1px",height:"16px",background:"#e2e8f0",margin:"0 2px"}}),o(h,i({title:(null==Y?void 0:Y.tooltip)||"",arrow:!0,placement:"top"},{children:o("div",i({onClick:Y.onClick,style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:Y.icon}))}))]})]}))}))},gi=function(n){void 0===n&&(n=!1);var t=n?pi:ci,r=-1;return G.map(function(n,l){var a=J.filter(function(i){return i.pageIndex===l}).flatMap(function(i,e){return i.bboxes.map(function(i,n){return r++,{bbox:i,key:"".concat(l,"-").concat(e,"-").concat(n),globalIndex:r}})});return e("div",i({style:{marginBottom:"8px"}},{children:[e("div",i({style:{fontSize:"12px",color:"#888",marginBottom:"4px"}},{children:["Page ",l+1]})),o("div",i({style:{position:"relative",width:"100%",paddingTop:"129%",flexShrink:0}},{children:e("div",i({style:{position:"absolute",inset:0}},{children:[o("img",{src:n,alt:"Page ".concat(l+1),style:{display:"block",width:"100%",height:"100%",objectFit:"fill"},draggable:!1,ref:function(e){e&&e.complete&&!ti[l]&&ri(function(e){var n;return i(i({},e),((n={})[l]=!0,n))})},onLoad:function(){return ri(function(e){var n;return i(i({},e),((n={})[l]=!0,n))})}}),ti[l]&&a.map(function(n){var r=n.bbox,l=n.key,a=n.globalIndex,d=Z===a;return o("div",i({ref:function(i){t.current[a]=i},onMouseEnter:function(){return V(a)},onMouseLeave:function(){return V(null)},style:{position:"absolute",left:"".concat(100*r.xmin,"%"),top:"".concat(100*r.ymin,"%"),width:"".concat(100*(r.xmax-r.xmin),"%"),height:"".concat(100*(r.ymax-r.ymin),"%"),background:d?M:B,border:d?"1.5px solid ".concat(R):"none",borderRadius:"2px",zIndex:2}},{children:z&&U===a&&e("div",i({style:{position:"absolute",top:"-18px",right:"0",fontSize:"10px",background:w,color:"black",padding:"2px 6px",borderRadius:"3px",whiteSpace:"nowrap"}},{children:["Citation ",a+1]}))}),l)})]}))})),P&&l<G.length-1&&o("div",{style:{height:"1px",background:_,margin:"0"}})]}),l)})},xi={overflowY:"auto",border:"1px solid #ddd",borderRadius:"4px",padding:"8px",paddingBottom:0,display:"flex",flexDirection:"column",boxSizing:"border-box"};return e(n,{children:[e("div",i({style:{width:"100%",maxWidth:"800px",fontFamily:"inherit",display:"flex",flexDirection:"column"}},{children:[(b||N>0)&&e("div",i({style:{display:"flex",alignItems:"center",marginBottom:"6px"}},{children:[b&&o("div",i({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:b})),o("div",i({style:{marginLeft:"auto"}},{children:hi(!1)}))]})),o("div",i({ref:ai,style:i(i({},xi),{maxHeight:H})},{children:gi(!1)}))]})),o(s,i({isOpen:ei,onClose:function(){return ni(!1)}},{children:e("div",i({style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"}},{children:[(A||N>0)&&e("div",i({style:{display:"flex",alignItems:"center",marginBottom:"6px",padding:"8px"}},{children:[A&&o("div",i({style:{fontSize:"14px",fontWeight:500,color:"#111"}},{children:A})),o("div",i({style:{marginLeft:"auto"}},{children:hi(!0)}))]})),o("div",i({ref:di,style:i(i({},xi),{flex:1})},{children:ei&&gi(!0)}))]}))}))]})}export{g as default};
2
2
  //# sourceMappingURL=ScannedDocCitation.js.map