@viswa-test/test-citation 0.0.67 → 0.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assests/svg/PdfViewerIcons.js +1 -1
- package/dist/cjs/assests/svg/PdfViewerIcons.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/ResizableSplitPane.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/ResizableSplitPane.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts +1 -0
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/ResizableSplitPane.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/ResizableSplitPane.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts +2 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts +2 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";var t=function(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},o=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},r=function(){return i("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n("polyline",{points:"7 10 12 15 17 10"}),n("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},h=function(){return i("svg",e({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))};export{h as DefaultCloseIcon,r as DefaultDownloadIcon,o as DefaultFullScreenIcon,t as DefaultPdfIcon};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";var t=function(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},o=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},r=function(){return i("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n("polyline",{points:"7 10 12 15 17 10"}),n("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},h=function(){return i("svg",e({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},s=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}))};export{h as DefaultCloseIcon,r as DefaultDownloadIcon,s as DefaultFullScreenCloseIcon,o as DefaultFullScreenIcon,t as DefaultPdfIcon};
|
|
2
2
|
//# sourceMappingURL=PdfViewerIcons.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime");exports.DefaultCloseIcon=function(){return n.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},exports.DefaultDownloadIcon=function(){return n.jsxs("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"7 10 12 15 17 10"}),n.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},exports.DefaultFullScreenIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},exports.DefaultPdfIcon=function(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n.jsx("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime");exports.DefaultCloseIcon=function(){return n.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},exports.DefaultDownloadIcon=function(){return n.jsxs("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"7 10 12 15 17 10"}),n.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},exports.DefaultFullScreenCloseIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}))},exports.DefaultFullScreenIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},exports.DefaultPdfIcon=function(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n.jsx("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))};
|
|
2
2
|
//# sourceMappingURL=PdfViewerIcons.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("lucide-react"),l=require("react"),t=require("./ResizableSplitPane.js"),o=require("../PdfViewer/PdfViewer.js");exports.default=function(a){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("lucide-react"),l=require("react"),t=require("./ResizableSplitPane.js"),o=require("../PdfViewer/PdfViewer.js"),r=require("../../assests/svg/PdfViewerIcons.js");exports.default=function(a){var s,u,d,c=a.href,g=a.children,v=a.metaData,h=a.chevronUpComponent,f=void 0===h?null:h,p=a.chevronDownComponent,m=void 0===p?null:p,_=a.customStyle,x=void 0===_?{}:_,b=a.defaultState,j=void 0!==b&&b,y=l.useState(j),C=y[0],F=y[1],w=l.useState(!1),P=w[0],S=w[1],D=l.useRef(null),E="string"==typeof g&&(null===(s=null==g?void 0:g.split("\n"))||void 0===s?void 0:s.length)>1?g.split("\n").join(" "):g,k="string"==typeof g?g:g[0],I=null!=f?f:function(e){var l,t;return n.jsx(i.ChevronUp,{size:null!==(l=null==e?void 0:e.fontSize)&&void 0!==l?l:16,color:null!==(t=null==e?void 0:e.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(u=null==x?void 0:x.arrow)&&void 0!==u?u:{}),R=null!=m?m:function(e){var l,t;return n.jsx(i.ChevronDown,{size:null!==(l=null==e?void 0:e.fontSize)&&void 0!==l?l:16,color:null!==(t=null==e?void 0:e.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(d=null==x?void 0:x.arrow)&&void 0!==d?d:{}),q=["contract","clause"];l.useEffect(function(){var e=function(){S(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),function(){return document.removeEventListener("fullscreenchange",e)}},[]);return n.jsxs("span",e.__assign({style:e.__assign({display:"inline"},x.relativeWrapper||{})},{children:[n.jsx("div",e.__assign({style:e.__assign({display:"inline",marginTop:0},x.citationButtonWrapper||{})},{children:n.jsxs("button",e.__assign({type:"button",onClick:function(){return F(function(e){return!e})},style:e.__assign({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},x.citationButton||{})},{children:[n.jsx("span",{children:E}),n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:C?I:R}))]}))})),C&&n.jsxs("div",e.__assign({ref:D,style:e.__assign({boxSizing:"border-box",border:P?"none":"1px solid #E4E7EC",borderRadius:P?"0":"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%",height:P?"100vh":"auto"},P?{position:"fixed",inset:0,zIndex:99999,backgroundColor:"#FAFAFA"}:{})},{children:[n.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:n.jsx("button",e.__assign({onClick:function(){var e=D.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Fullscreen error: ".concat(e.message))}))},title:P?"Exit fullscreen":"Fullscreen",style:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:P?n.jsx(r.DefaultFullScreenCloseIcon,{}):n.jsx(r.DefaultFullScreenIcon,{})}))})),n.jsx("div",e.__assign({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:n.jsx(function(){var i,l,r,a,s,u,d,h,f,p,m;console.log("citation details ->","href ->",c,"children ->",g,"metaData ->",v,"citationDisplayTitle ->",E);var _=function(e){try{return new URL(e,window.location.origin).searchParams.get("citationNumber")}catch(e){return null}}(c);if(!_)return null;var x=(null===(i=null==v?void 0:v.citations)||void 0===i?void 0:i[_])||{},b=(null===(l=null==v?void 0:v.docData)||void 0===l?void 0:l.documents)||{},j=(null===(r=null==v?void 0:v.docData)||void 0===r?void 0:r.input_index_map)||{},y=null==j?void 0:j[0],C=null==j?void 0:j[1],F=y?b[y]:null,w=C?b[C]:null,S=y?x[y]:null,D=C?x[C]:null;if(q.includes(k)){console.log("leftDocument",F,"rightDocument",w),console.log("leftCitation",S,"rightCitation",D);var I=S?n.jsx(o.default,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:F.title,pdfUrl:F.signed_url,highlightText:[null!==(a=null==S?void 0:S.highlighted_text)&&void 0!==a?a:""],highlightPages:{1:null===(s=null==S?void 0:S.custom_metadata)||void 0===s?void 0:s.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(u=null==S?void 0:S.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number,null===(d=null==S?void 0:S.custom_metadata)||void 0===d?void 0:d.pdf_end_page_number]}):null,R=D?n.jsx(o.default,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:w.title,pdfUrl:w.signed_url,jumpToPageValue:1,highlightText:[null!==(h=null==D?void 0:D.highlighted_text)&&void 0!==h?h:""],highlightPages:{1:null===(f=null==D?void 0:D.custom_metadata)||void 0===f?void 0:f.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(p=null==D?void 0:D.custom_metadata)||void 0===p?void 0:p.pdf_start_page_number,null===(m=null==D?void 0:D.custom_metadata)||void 0===m?void 0:m.pdf_end_page_number]}):null;return S||D?n.jsx("div",e.__assign({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:n.jsx(t.default,{leftComponent:I,rightComponent:R,isFullscreen:P})})):n.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return n.jsx("div",{children:"No Citation Found. Please try again later"})},{})}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),c=require("./CognitiveComparehelpers.js"),u=require("./CognitiveCompareConfig.js"),s=require("./CognitiveCompareConstants.js"),a=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),g=require("./components/ThreeDotsLoader.js"),f=require("./hooks/useCompareData.js"),p=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),x=require("./hooks/useAccordionState.js"),_=require("./hooks/useDeviationNavigation.js"),m=require("./components/CompareHeader.js"),y=require("./components/SectionAccordion.js"),R=require("./components/SubSectionAccordion.js"),S=require("./components/CognitiveSummaryPopup.js");exports.SHARED_MARKDOWN_STYLES=u.SHARED_MARKDOWN_STYLES,exports.default=function(b){var A,E,I,T,B,C,D,O,j,w,P,N,F,k,M,L=b.componentHeaderText,H=void 0===L?s.DEFAULT_COMPONENT_HEADER_TEXT:L,V=b.treeData,G=b.comparisonConfig,q=b.leftColumnTitleText,z=b.rightColumnTitleText,W=b.markdownStyles,Y=b.displayConfig,K=void 0===Y?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:Y,U=b.popupConfig,X=b.deviationData,J=void 0===X?{}:X,Q=b.deviationNodeIdToView,Z=t.useState(K.maintainRelativeOrder),$=Z[0],ee=Z[1],ne=t.useState(!1),te=ne[0],ie=ne[1],oe=t.useState(!1),re=oe[0],le=oe[1],ce=t.useState(null),ue=ce[0],se=ce[1],ae=t.useState(!1),de=ae[0],ve=ae[1],ge=t.useState(!1),fe=ge[0],pe=ge[1],he=t.useState(null),xe=he[0],_e=he[1],me=t.useRef(!1),ye=t.useState(new Set),Re=ye[0],Se=ye[1],be=t.useState([]),Ae=be[0],Ee=be[1],Ie=t.useRef(null),Te=t.useRef(!1),Be=t.useRef(null),Ce=t.useRef({}),De=t.useRef([]),Oe=t.useRef(!1),je=t.useRef(!1),we=t.useRef(null),Pe=t.useRef(function(){}),Ne=t.useMemo(function(){return(null==V?void 0:V.cognitive_decisioning)||{}},[V]),Fe=t.useState({width:0,height:0}),ke=Fe[0],Me=Fe[1],Le=t.useMemo(function(){return e.__assign(e.__assign({},u.SHARED_MARKDOWN_STYLES),W)},[W]),He=t.useRef(null),Ve=t.useRef(null),Ge=t.useRef(null),qe=t.useRef(null),ze=t.useRef(null),We=t.useRef(null),Ye=t.useRef(null),Ke=t.useRef(null),Ue=t.useRef(!1),Xe=p.useComparePopups(He),Je=Xe.cognitivePopup,Qe=Xe.setCognitivePopup,Ze=Xe.moreFunctions,$e=Xe.setMoreFunctions,en=Xe.position,nn=Xe.setPosition,tn=Xe.activeBadgeId,on=Xe.summaryPopup,rn=Xe.setSummaryPopup,ln=Xe.closeSummaryPopup,cn=Xe.setActiveBadgeId,un=Xe.popupRef,sn=Xe.closeCognitivePopup,an=Xe.closeMoreFunctionsPopup,dn=t.useMemo(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==G?void 0:G.fields)&&void 0!==e?e:u.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(t=null===(n=null==G?void 0:G.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:u.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(i=null==G?void 0:G.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:u.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==G?void 0:G.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:u.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[G]),vn=t.useState(null),gn=vn[0];vn[1];var fn=null===(I=null===(A=null==V?void 0:V.documents)||void 0===A?void 0:A[null===(E=null==V?void 0:V.input_index_map)||void 0===E?void 0:E[0]])||void 0===I?void 0:I.title,pn=null===(C=null===(T=null==V?void 0:V.documents)||void 0===T?void 0:T[null===(B=null==V?void 0:V.input_index_map)||void 0===B?void 0:B[1]])||void 0===C?void 0:C.title,hn=c.safeStringify(q||fn||"Uploaded Contract"),xn=c.safeStringify(z||pn||"Reference Template"),_n=f.useCognitiveTreeData(V,$,J,dn),mn=_n.activeProposed,yn=_n.existingRule,Rn=_n.proposedSections,Sn=_n.existingSections,bn=_n.visibleFields,An=_n.parentDeviationRecord,En=_n.deviationNumberRegistry,In=_n.parseError;t.useEffect(function(){In&&se("Failed to load comparison: ".concat(In))},[In]);var Tn=Rn.length>0||Sn.length>0,Bn=h.useSectionRefs(bn.map(function(e){return e.key}),Math.max(Rn.length,Sn.length)),Cn=Bn.leftRefs,Dn=Bn.rightRefs,On=Bn.sectionLeftRefs,jn=Bn.sectionRightRefs,wn=Bn.lhsBadgeRefs,Pn=Bn.rhsBadgeRefs,Nn=Bn.sectionRightRowRefs,Fn=Bn.subSectionLeftRefs,kn=Bn.subSectionRightRefs,Mn=Bn.sectionRowRefs,Ln=Bn.getSectionRowRef,Hn=Bn.getSubSectionRef,Vn=Bn.getBadgeRef,Gn=yn.analysis,qn=c.safeStringify(null===(O=null===(D=null==Gn?void 0:Gn.rule_difference_comparison)||void 0===D?void 0:D.summary)||void 0===O?void 0:O.overall_summary),zn=!!qn.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Wn=null!==(j=null==V?void 0:V.base_root_id)&&void 0!==j?j:"-1";null==V||V[Wn];var Yn=(null===(w=null==J?void 0:J[Wn])||void 0===w?void 0:w.evaluation_result)||(null===(N=null===(P=null==V?void 0:V.nodes)||void 0===P?void 0:P[Wn])||void 0===N?void 0:N.evaluation_result)||null,Kn=c.extractDeviationScore(Yn),Un=c.generateColorPalette(null!==(M=null===(k=null===(F=null==Yn?void 0:Yn.evaluation_outputs)||void 0===F?void 0:F.metadata)||void 0===k?void 0:k.label_color)&&void 0!==M?M:""),Xn=t.useCallback(function(){var e,n,t,i;ve(!1),je.current=!1;var o=we.current,r=ut.current;if(null!==o)if("string"==typeof o&&o.includes(c.DEVIATION_BADGE_SEPARATOR)){var l=o.split(c.DEVIATION_BADGE_SEPARATOR);(u=null===(e=Fn.current[l[2]])||void 0===e?void 0:e.current)&&(u.style.paddingTop="0px")}else{var u;(u=null===(n=On.current[o])||void 0===n?void 0:n.current)&&(u.style.paddingTop="0px")}if(null!==r)if("string"==typeof r&&r.includes(c.DEVIATION_BADGE_SEPARATOR)){l=r.split(c.DEVIATION_BADGE_SEPARATOR);(s=null===(t=kn.current[l[3]])||void 0===t?void 0:t.current)&&(s.style.paddingTop="0px")}else{var s;(s=null===(i=jn.current[r])||void 0===i?void 0:i.current)&&(s.style.paddingTop="0px")}_e(null),we.current=null,ut.current=null,pe(!1),le(!1),qe.current&&(qe.current.style.height="0px"),ze.current&&(ze.current.style.height="0px"),We.current&&(We.current.style.height="0px"),Ye.current&&(Ye.current.style.height="0px")},[]),Jn=x.useAccordionState({maintainRelativeOrder:!!$,proposedSections:Rn,existingSections:Sn,activeSideBySideSection:xe,connectedSections:Re,resetSideBySide:Xn,setConnectedSections:Se,setConnectedLines:Ee,cachedConnectedPositions:De,svgContainerRef:Ie,isAnimatingRef:Te,animationTimerRef:Be,calculateLinesRef:Pe,sectionLeftRefs:On,sectionRightRefs:jn,subSectionLeftRefs:Fn,subSectionRightRefs:kn}),Qn=Jn.expandedSections,Zn=Jn.expandedSubSections,$n=Jn.setExpandedSubSections,et=Jn.toggleSection,nt=t.useCallback(function(e,n,t,i,o,r,l){var u,s,a,d=c.safeStringify(null==n?void 0:n.id)||c.safeStringify(null==t?void 0:t.id)||"",v=(d?Ne[d]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:d,decisioning:[],gap:[],relevance_score:0},g=null!==(s=null===(u=Mn.current[i])||void 0===u?void 0:u.current)&&void 0!==s?s:null;return{isLoading:null!==(a=null==K?void 0:K.isLoading)&&void 0!==a&&a,open:!0,sectionTitle:(null==n?void 0:n.displayTitle)?null==n?void 0:n.title:"no title",refSectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",cognitiveData:v,anchorEl:e,sectionAnchorEl:g,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==V?void 0:V.documents,input_index_map:null==V?void 0:V.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[Ne,V]),tt=t.useCallback(function(e){an(),nn(null),Qe(e)},[an]),it=function(e,n,t,i,o,r){e.stopPropagation(),Ze.open&&Ze.sectionIdx===o?an():(sn(),$e(nt(e.currentTarget,n,i,o,t,r)))},ot=t.useCallback(function(){null!==Ze.sectionIdx&&Ze.anchorEl?tt(e.__assign(e.__assign({},Ze),{open:!0})):an()},[Ze,an,tt]),rt=t.useCallback(function(){var e=Ze.sectionIdx,n=Ze.isOrphan,t=null!==e&&Re.has(e);an(),null!==e&&(n?se("No counterpart exists to connect to."):(je.current&&Xn(),t&&(Ee([]),De.current=[]),Se(function(n){return n.has(e)?new Set:new Set([e])})))},[Ze.sectionIdx,an,Xn]),lt=t.useRef(null),ct=t.useRef(null),ut=t.useRef(null),st=t.useRef(null),at=t.useRef(null),dt=t.useRef(null),vt=t.useState([]),gt=vt[0],ft=vt[1];t.useRef(null);var pt=t.useState(null),ht=pt[0],xt=pt[1];t.useEffect(function(){if(gn){var e=dn.fields.find(function(e){return e.analysisKey===gn||e.key===gn});if(e){var n=Cn.current[e.key]||Dn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[gn,dn.fields]);var _t=t.useCallback(function(e){var n,t,i,o,r,l,c,u,s,a=null===(n=null==Gn?void 0:Gn.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!a||!a[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=a[e],v=(null==d?void 0:d.relation)||(null===(i=null===(t=null==d?void 0:d.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var g=d.mappings[0]||{};return{score:d.score,relation:g.relation||"",highlightsA:(null===(l=g.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=g.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(u=d.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(s=d.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!v}},[Gn]),mt=t.useCallback(function(n,t){var i,o,r,l,u,a,d;void 0===t&&(t="left");var v=null,g=null;if("left"===t)if(v=Rn[n],$&&v){var f=Sn.filter(function(e){var n;return null===(n=v.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});g=f.find(function(e){return e.evaluationResult})||f[0]}else g=Sn[n];else if(g=Sn[n],$&&g){var p=Rn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(g.selfIndex)});v=p.find(function(e){return e.evaluationResult})||p[0]}else v=Rn[n];var h=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,x=(null==g?void 0:g.relation)&&"not_defined"!==g.relation,_=!(!(null==v?void 0:v.cognitiveData)&&!(null==g?void 0:g.cognitiveData));if(!h&&!x&&!_)return e.__assign(e.__assign({},c.generateColorPalette(s.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});var m=null!==(o=null!==(i=null==v?void 0:v.evaluationResult)&&void 0!==i?i:null==g?void 0:g.evaluationResult)&&void 0!==o?o:null,y=null===(r=null==m?void 0:m.evaluation_outputs)||void 0===r?void 0:r.output_value,R=null!==(a=null===(u=null===(l=null==m?void 0:m.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===u?void 0:u.label_color)&&void 0!==a?a:s.DEFAULT_DEVIAION_COLOR;return null!=m?e.__assign(e.__assign({},c.generateColorPalette(R)),{label:null!==(d=y)&&void 0!==d?d:""}):e.__assign(e.__assign({},c.generateColorPalette(R)),{label:null})},[Rn,Sn,Ne,dn,$]),yt=t.useCallback(function(n){for(var t,i,o,r,l,u,a,d,v,g=n.split("-").map(Number),f=Rn[g[0]],p=Sn[g[0]],h=1;h<g.length;h++)(null==f?void 0:f.subsections)&&(f=f.subsections[g[h]]),(null==p?void 0:p.subsections)&&(p=p.subsections[g[h]]);if(!f&&!p)return null;var x=(null==f?void 0:f.relation)&&"not_defined"!==f.relation,_=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,m=c.safeStringify(null==f?void 0:f.id)||c.safeStringify(null==p?void 0:p.id)||"",y=!(!(null==f?void 0:f.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!x&&!_&&!y)return e.__assign(e.__assign({},c.generateColorPalette(s.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});null!==(i=null!==(t=null==f?void 0:f.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||m&&(null===(o=Ne[m])||void 0===o||o.relevance_score);var R=null!==(l=null!==(r=null==f?void 0:f.evaluationResult)&&void 0!==r?r:null==p?void 0:p.evaluationResult)&&void 0!==l?l:null,S=null===(u=null==R?void 0:R.evaluation_outputs)||void 0===u?void 0:u.output_value,b=null!==(v=null===(d=null===(a=null==R?void 0:R.evaluation_outputs)||void 0===a?void 0:a.metadata)||void 0===d?void 0:d.label_color)&&void 0!==v?v:s.DEFAULT_DEVIAION_COLOR;return null!=R?e.__assign(e.__assign({},c.generateColorPalette(b)),{label:null!=S?S:""}):e.__assign(e.__assign({},c.generateColorPalette(b)),{label:null})},[Rn,Sn,Ne,dn]),Rt=t.useCallback(function(){var e,n,t,i,o,r,l,u,s,a,d,v,g,f,p,h,x,_,m,y,R,S;if(!Ue.current&&!Te.current){Ue.current=!0;try{if(!lt.current)return;var b=function(e){var n=e.split("-"),t=n[0];if(!Qn[t]&&!1===$)return!1;if($&&!Qn["left-".concat(t)]&&!Qn["right-".concat(t)]&&!Qn[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!Zn[i])return!1;return!0},A=lt.current.getBoundingClientRect();Me({width:A.width,height:A.height});var E=[];if(bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Cn.current[i])||void 0===n?void 0:n.current,r=null===(t=Dn.current[i])||void 0===t?void 0:t.current;o&&r&&(o.style.height="auto",r.style.height="auto",o.style.minHeight="0px",r.style.minHeight="0px")}),!Te.current){for(var I=0;I<Math.max(Rn.length,Sn.length);I++){var T=null===(e=On.current[I])||void 0===e?void 0:e.current,B=null===(n=jn.current[I])||void 0===n?void 0:n.current;T&&(T.style.height="auto",T.style.minHeight="0px"),B&&(B.style.height="auto",B.style.minHeight="0px")}$||Object.keys(Fn.current).forEach(function(e){var n,t;if(b(e)){var i=null===(n=Fn.current[e])||void 0===n?void 0:n.current,o=null===(t=kn.current[e])||void 0===t?void 0:t.current;i&&o&&(i.style.height="auto",o.style.height="auto",i.style.minHeight="0px",o.style.minHeight="0px")}})}var C={};bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Cn.current[i])||void 0===n?void 0:n.current,r=null===(t=Dn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect();C[i]=Math.max(l.height,c.height)}});var D={left:{},right:{}},O={};if(!Te.current)if($){if(de&&null!==xe)if("number"==typeof xe){var j=xe,w=Rn[j],P=null===(o=On.current[j])||void 0===o?void 0:o.current;P&&w&&(w.refIndexes||[]).forEach(function(e){var n,t=Sn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=jn.current[t])||void 0===n?void 0:n.current;if(i&&(Qn["left-".concat(j)]||Qn["right-".concat(t)])){var o=Math.max(P.getBoundingClientRect().height,i.getBoundingClientRect().height);D.left[j]=Math.max(D.left[j]||0,o),D.right[t]=Math.max(D.right[t]||0,o)}})}else{var N=xe.split(c.DEVIATION_BADGE_SEPARATOR)[2];if(N){T=null===(r=Fn.current[N])||void 0===r?void 0:r.current,B=null===(l=kn.current[N])||void 0===l?void 0:l.current;if(T&&B){F=Math.max(T.getBoundingClientRect().height,B.getBoundingClientRect().height);O[N]=Math.max(O[N]||0,F)}}}}else{Object.keys(Fn.current).forEach(function(e){var n,t;if(b(e)){var i=null===(n=Fn.current[e])||void 0===n?void 0:n.current,o=null===(t=kn.current[e])||void 0===t?void 0:t.current;if(i&&o&&null!==i.offsetParent&&null!==o.offsetParent){var r=i.getBoundingClientRect(),l=o.getBoundingClientRect(),c=Math.max(r.height,l.height);O[e]=c,i.style.minHeight="".concat(c,"px"),o.style.minHeight="".concat(c,"px")}}});for(I=0;I<Math.min(Rn.length,Sn.length);I++){var T=null===(t=On.current[I])||void 0===t?void 0:t.current,B=null===(i=jn.current[I])||void 0===i?void 0:i.current;if(T&&B){var F=Math.max(T.getBoundingClientRect().height,B.getBoundingClientRect().height);D.left[I]=F,D.right[I]=F}}}if(bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Cn.current[i])||void 0===n?void 0:n.current,r=null===(t=Dn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=C[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),Te.current||(Object.entries(D.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=On.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(D.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=jn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),$||Object.keys(O).forEach(function(e){var n,t,i=null===(n=Fn.current[e])||void 0===n?void 0:n.current,o=null===(t=kn.current[e])||void 0===t?void 0:t.current;if(i&&o&&O[e]){var r=O[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),$)Rn.forEach(function(e,n){var t;(null===(t=On.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,r,l,c,u,s,a,d,v=Sn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var g=null===(t=wn.current[n])||void 0===t?void 0:t.current,f=null===(i=Pn.current[v])||void 0===i?void 0:i.current;if(g&&f){var p=g.getBoundingClientRect(),h=f.getBoundingClientRect(),x=p.right-A.left,_=h.left-A.left,m=p.top+p.height/2-A.top,y=h.top+h.height/2-A.top;if(de&&xe===n){var R=null!==(r=null===(o=Ke.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,S=null!==(c=null===(l=Ge.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,b=R+(null!==(s=null===(u=Ke.current)||void 0===u?void 0:u.clientHeight)&&void 0!==s?s:1/0),I=S+(null!==(d=null===(a=Ge.current)||void 0===a?void 0:a.clientHeight)&&void 0!==d?d:1/0),T=p.top+p.height/2,B=function(e,n,t){return Math.max(n,Math.min(t,e))};m=B(T,R,b)-A.top,y=B(T,S,I)-A.top}var C=mt(n);C&&E.push({id:"line-".concat(n,"-").concat(v),x1:x,y1:m,x2:_,y2:y,style:C,sectionIdx:n,targetRightIdx:v})}}})});else{for(I=0;I<Math.min(Rn.length,Sn.length);I++){var k=null===(u=On.current[I])||void 0===u?void 0:u.current,M=null===(s=jn.current[I])||void 0===s?void 0:s.current;if(k&&M){var L=k.getBoundingClientRect(),H=M.getBoundingClientRect(),V=Math.max(L.top,H.top)+18-A.top,G=(null===(a=Sn[I])||void 0===a?void 0:a.id)||"sec-".concat(I);(J=mt(I))&&E.push({id:G,x1:L.right-A.left,y1:V,x2:H.left-A.left,y2:V,style:J,sectionIdx:I,hasCognitive:!!((null===(d=Rn[I])||void 0===d?void 0:d.cognitiveData)||(null===(v=Sn[I])||void 0===v?void 0:v.cognitiveData)||G&&Ne[G]),isSubSection:!1})}}Object.keys(Fn.current).forEach(function(e){var n,t,i,o,r,l;if(b(e)){var u=null===(n=Fn.current[e])||void 0===n?void 0:n.current,s=null===(t=kn.current[e])||void 0===t?void 0:t.current;if(u&&s){for(var a=e.split("-").map(Number),d=Rn[a[0]],v=Sn[a[0]],g=1;g<a.length;g++)(null==d?void 0:d.subsections)&&(d=d.subsections[a[g]]),(null==v?void 0:v.subsections)&&(v=v.subsections[a[g]]);var f=!!d&&((null===(i=d.displayTitle)||void 0===i||i)&&c.hasValue(d.title)),p=!!d&&((null===(o=d.displayContent)||void 0===o||o)&&c.hasValue(d.content)),h=!!v&&((null===(r=v.displayTitle)||void 0===r||r)&&c.hasValue(v.title)),x=!!v&&((null===(l=v.displayContent)||void 0===l||l)&&c.hasValue(v.content));if(f&&p||h&&x){var _=u.getBoundingClientRect(),m=s.getBoundingClientRect(),y=Math.max(_.top,m.top)+16-A.top,R=yt(e);R&&"Not Defined"!==R.label&&E.push({id:"subsec-".concat(e),x1:_.right-A.left,y1:y,x2:m.left-A.left,y2:y,style:R,sectionIdx:a[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==d?void 0:d.cognitiveData)&&!(null==v?void 0:v.cognitiveData))})}}}})}if(de&&"string"==typeof xe&&xe.includes(c.DEVIATION_BADGE_SEPARATOR)){var q=xe.split(c.DEVIATION_BADGE_SEPARATOR),z=q[0],W=q[1],Y=q[2],K=(q[3],"".concat(z).concat(c.DEVIATION_BADGE_SEPARATOR).concat(W)),U=null===(g=wn.current[K])||void 0===g?void 0:g.current,X=null===(f=Pn.current[K])||void 0===f?void 0:f.current;if(U&&X){var J,Q=U.getBoundingClientRect(),Z=X.getBoundingClientRect(),ee=Q.right-A.left,ne=Z.left-A.left,te=Q.top+Q.height/2-A.top,ie=Z.top+Z.height/2-A.top;if($){var oe=null!==(h=null===(p=Ke.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==h?h:0,re=null!==(_=null===(x=Ge.current)||void 0===x?void 0:x.getBoundingClientRect().top)&&void 0!==_?_:0,le=oe+(null!==(y=null===(m=Ke.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ce=re+(null!==(S=null===(R=Ge.current)||void 0===R?void 0:R.clientHeight)&&void 0!==S?S:1/0),ue=function(e,n,t){return Math.max(n,Math.min(t,e))};te=ue(Q.top+Q.height/2,oe,le)-A.top,ie=ue(Z.top+Z.height/2,re,ce)-A.top}(J=yt(Y))&&E.push({id:"line-subsec-".concat(K),x1:ee,y1:te,x2:ne,y2:ie,style:J,sectionIdx:Number(Y.split("-")[0]),isSubSection:!0,subSectionKeyPath:xe})}}if(ft(E),at.current&&dt.current){var se=at.current.getBoundingClientRect(),ae=dt.current.getBoundingClientRect(),ve=(se.top+se.height/2-A.top+ae.top+ae.height/2-A.top)/2;xt({x1:se.right-A.left,x2:ae.left-A.left,y:ve})}else xt(null);if(Re.size>0){var ge=[],fe=Ke.current,pe=Ge.current;if(fe&&pe){var he=[],_e=fe.getBoundingClientRect().top,me=pe.getBoundingClientRect().top,ye=_e+fe.clientHeight,Se=me+pe.clientHeight,be=fe.scrollTop,Ae=pe.scrollTop,Ie=A.top,Be=function(e,n,t){return Math.max(n,Math.min(t,e))};Re.forEach(function(e){var n,t,i,o,r;if("string"==typeof e&&e.includes(c.DEVIATION_BADGE_SEPARATOR)){var l=e.split(c.DEVIATION_BADGE_SEPARATOR),u=l[0],s=l[1],a=l[2],d=(l[3],"".concat(u).concat(c.DEVIATION_BADGE_SEPARATOR).concat(s)),v=null===(n=wn.current[d])||void 0===n?void 0:n.current,g=null===(t=Pn.current[d])||void 0===t?void 0:t.current;if(!v||!g)return;var f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=yt(a),x=(P=f.right-A.left)+.5*((N=p.left-A.left-0)-P),_=f.top+f.height/2,m=p.top+p.height/2,y=_-_e+be,R=m-me+Ae,S="conn-subsec-".concat(d);he.push({lhsScrollY:y,rhsScrollY:R,x1:P,x2:N,containerTop:Ie,leftIdx:e,rhsArrayIdx:e,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var b=Be(_,_e,ye),E=Be(m,me,Se),I=b-Ie,T=E-Ie,B=m>=me-4&&m<=Se+4,C="";C=(F=_>=_e-4&&_<=ye+4)&&B?c.getBentArrowPath(P,I,N,T):F&&!B?"M ".concat(P,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&B?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(N,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:C,style:h,leftIdx:e,rhsArrayIdx:e})}else if($){var D=e,O=Rn[D];if(!(null===(r=null==O?void 0:O.refIndexes)||void 0===r?void 0:r.length))return;O.refIndexes.forEach(function(e){var n,t,i=Sn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=wn.current[D])||void 0===n?void 0:n.current,r=null===(t=Pn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),u=r.getBoundingClientRect(),s=mt(D),a=l.right-A.left,d=u.left-A.left-0,v=a+.5*(d-a),g=l.top+l.height/2,f=u.top+u.height/2,p=g-_e+be,h=f-me+Ae,x="conn-".concat(D,"-").concat(i);he.push({lhsScrollY:p,rhsScrollY:h,x1:a,x2:d,containerTop:Ie,leftIdx:D,rhsArrayIdx:i,styleColor:(null==s?void 0:s.badgeBorder)||"#6366F1",styleId:x});var _=Be(g,_e,ye),m=Be(f,me,Se),y=_-Ie,R=m-Ie,S=g>=_e-4&&g<=ye+4,b=f>=me-4&&f<=Se+4,E="";E=S&&b?c.getBentArrowPath(a,y,d,R):S&&!b?"M ".concat(a,",").concat(y," L ").concat(v,",").concat(y," L ").concat(v,",").concat(R):!S&&b?"M ".concat(v,",").concat(y," L ").concat(v,",").concat(R," L ").concat(d,",").concat(R):"M ".concat(v,",").concat(y," L ").concat(v,",").concat(R),ge.push({id:x,pathD:E,style:s,leftIdx:D,rhsArrayIdx:i})}}})}else{var j=e,w=j;v=null===(i=wn.current[j])||void 0===i?void 0:i.current,g=null===(o=Pn.current[w])||void 0===o?void 0:o.current;if(!v||!g)return;var P,N;f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=mt(j),x=(P=f.right-A.left)+.5*((N=p.left-A.left-0)-P),_=f.top+f.height/2,m=p.top+p.height/2,y=_-_e+be,R=m-me+Ae,S="conn-".concat(j,"-").concat(w);he.push({lhsScrollY:y,rhsScrollY:R,x1:P,x2:N,containerTop:Ie,leftIdx:j,rhsArrayIdx:w,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var F;b=Be(_,_e,ye),E=Be(m,me,Se),I=b-Ie,T=E-Ie,B=m>=me-4&&m<=Se+4,C="";C=(F=_>=_e-4&&_<=ye+4)&&B?c.getBentArrowPath(P,I,N,T):F&&!B?"M ".concat(P,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&B?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(N,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:C,style:h,leftIdx:j,rhsArrayIdx:w})}}),De.current=he}Ee(ge)}else Ee([]),De.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{Ue.current=!1}}},[bn,Rn,Sn,Ne,dn,_t,mt,$,de,xe,Re,Qn,Zn]),St=t.useCallback(function(){var e,n,t,i,o,r,l,u,s,a,d,v,g,f,p=De.current;if(p.length&&!Te.current){var h=null!==(n=null===(e=Ke.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,x=null!==(i=null===(t=Ge.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,_=null!==(r=null===(o=Ke.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(u=null===(l=Ge.current)||void 0===l?void 0:l.clientHeight)&&void 0!==u?u:1/0,y=null!==(a=null===(s=Ke.current)||void 0===s?void 0:s.getBoundingClientRect().top)&&void 0!==a?a:0,R=null!==(v=null===(d=Ge.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==v?v:0,S=y+_,b=R+m,A=null!==(f=null===(g=lt.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==f?f:0,E=function(e,n,t){return Math.max(n,Math.min(t,e))};p.forEach(function(e){var n=e.lhsScrollY-h+y,t=e.rhsScrollY-x+R,i=Ce.current[e.styleId+"-stroke"],o=Ce.current[e.styleId+"-bg"];if(i||o){var r,l=E(n,y,S),u=E(t,R,b),s=l-A,a=u-A,d=n>=y-4&&n<=S+4,v=t>=R-4&&t<=b+4,g=e.x1+.5*(e.x2-e.x1);r=d&&v?c.getBentArrowPath(e.x1,s,e.x2,a):d&&!v?"M ".concat(e.x1,",").concat(s," L ").concat(g,",").concat(s," L ").concat(g,",").concat(a):!d&&v?"M ".concat(g,",").concat(s," L ").concat(g,",").concat(a," L ").concat(e.x2,",").concat(a):"M ".concat(g,",").concat(s," L ").concat(g,",").concat(a),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);t.useEffect(function(){Pe.current=Rt},[Rt]);var bt=t.useRef(null),At=t.useCallback(function(){De.current.length>0&&!Te.current||(null!==bt.current&&clearTimeout(bt.current),bt.current=setTimeout(function(){Pe.current(),bt.current=null},50))},[]),Et=t.useCallback(function(){null!==bt.current&&clearTimeout(bt.current),bt.current=setTimeout(function(){De.current=[],Pe.current(),bt.current=null},100)},[]),It=t.useCallback(function(e){var n,t,i,o,r,l,u,s,a,d;if(!me.current){if($||At(),je.current){var v=we.current,g=ut.current,f=Ke.current,p=Ge.current;if(null!==v&&null!==g&&f&&p){var h="string"==typeof v&&v.includes(c.DEVIATION_BADGE_SEPARATOR)?null===(n=wn.current["".concat(v.split(c.DEVIATION_BADGE_SEPARATOR)[0]).concat(c.DEVIATION_BADGE_SEPARATOR).concat(v.split(c.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===n?void 0:n.current:null===(t=Mn.current[v])||void 0===t?void 0:t.current,x="string"==typeof g&&g.includes(c.DEVIATION_BADGE_SEPARATOR)?null===(i=Pn.current["".concat(g.split(c.DEVIATION_BADGE_SEPARATOR)[0]).concat(c.DEVIATION_BADGE_SEPARATOR).concat(g.split(c.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===i?void 0:i.current:null===(o=Nn.current[g])||void 0===o?void 0:o.current;if(h&&x){var _=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop,m=x.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop;if(e.currentTarget===f){var y=m-(_-f.scrollTop),R=p.scrollHeight-p.clientHeight,S=Math.max(0,Math.min(y,R));Math.abs(p.scrollTop-S)>1&&(p.scrollTop=S)}else if(e.currentTarget===p){var b=_-(m-p.scrollTop),A=f.scrollHeight-f.clientHeight,E=Math.max(0,Math.min(b,A));Math.abs(f.scrollTop-E)>1&&(f.scrollTop=E)}if(st.current){var I=void 0,T=void 0;if("string"==typeof v&&v.includes(c.DEVIATION_BADGE_SEPARATOR)){var B=v.split(c.DEVIATION_BADGE_SEPARATOR),C="".concat(B[0]).concat(c.DEVIATION_BADGE_SEPARATOR).concat(B[1]);I=null===(r=wn.current[C])||void 0===r?void 0:r.current,T=null===(l=Pn.current[C])||void 0===l?void 0:l.current}else I=null===(u=wn.current[v])||void 0===u?void 0:u.current,T=null===(s=Pn.current[g])||void 0===s?void 0:s.current;var D=null!==(d=null===(a=lt.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==d?d:0,O=f.getBoundingClientRect().top,j=O+f.clientHeight,w=p.getBoundingClientRect().top,P=w+p.clientHeight,N=function(e,n,t){return Math.max(n,Math.min(t,e))};if(I&&T){var F=I.getBoundingClientRect(),k=T.getBoundingClientRect(),M=F.top+F.height/2,L=k.top+k.height/2,H=N(M,O,j),V=N(L,w,P);st.current.setAttribute("y1",(H-D).toString()),st.current.setAttribute("y2",(V-D).toString());var G=M>=O-4&&M<=j+4;st.current.setAttribute("visibility",G?"visible":"hidden")}}}}}De.current.length>0&&!Oe.current&&(Oe.current=!0,requestAnimationFrame(function(){St(),Oe.current=!1}))}},[St,$,At]);t.useEffect(function(){var e=setTimeout(At,250);window.addEventListener("resize",Et);var n=null,t=null;return He.current&&(n=new ResizeObserver(At)).observe(He.current),lt.current&&(t=new ResizeObserver(At)).observe(lt.current),function(){clearTimeout(e),window.removeEventListener("resize",At),null==n||n.disconnect(),null==t||t.disconnect()}},[mn,yn,Gn,bn,Qn,Zn,Rn,Sn,dn,At,Et,de,xe,fe,Re]),t.useEffect(function(){je.current=de},[de]),t.useEffect(function(){we.current=xe},[xe]);var Tt=t.useCallback(function(e,n,t){var i,o,r,l,u,s=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,a=null==t?void 0:t.onReady;if(an(),null!=e)if(n)se("No counterpart exists for this section.");else if(de&&xe===e)s?Xn():null==a||a();else{if(!$){var d=we.current,v=ut.current;if(null!==d)if("string"==typeof d&&d.includes(c.DEVIATION_BADGE_SEPARATOR)){var g=d.split(c.DEVIATION_BADGE_SEPARATOR);(f=null===(o=Fn.current[g[2]])||void 0===o?void 0:o.current)&&(f.style.paddingTop="0px")}else{var f;(f=null===(r=On.current[d])||void 0===r?void 0:r.current)&&(f.style.paddingTop="0px")}if(null!==v)if("string"==typeof v&&v.includes(c.DEVIATION_BADGE_SEPARATOR)){g=v.split(c.DEVIATION_BADGE_SEPARATOR);(p=null===(l=kn.current[g[3]])||void 0===l?void 0:l.current)&&(p.style.paddingTop="0px")}else{var p;(p=null===(u=jn.current[v])||void 0===u?void 0:u.current)&&(p.style.paddingTop="0px")}}Se(new Set),Ee([]),De.current=[],le(!0),me.current=!0,_e(e),we.current=e,ve(!0),je.current=!0,pe(!1),qe.current&&(qe.current.style.height="0px"),ze.current&&(ze.current.style.height="0px"),We.current&&(We.current.style.height="0px"),Ye.current&&(Ye.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,r,l,u,s,d,v,g=null,f=null,p=null,h=null,x=null;if("string"==typeof e&&e.includes(c.DEVIATION_BADGE_SEPARATOR)){var _=e.split(c.DEVIATION_BADGE_SEPARATOR),m="".concat(_[0]).concat(c.DEVIATION_BADGE_SEPARATOR).concat(_[1]);g=(null===(n=wn.current[m])||void 0===n?void 0:n.current)||null,x=(f=(null===(t=Pn.current[m])||void 0===t?void 0:t.current)||null)?e:null,p=(null===(i=Fn.current[_[2]])||void 0===i?void 0:i.current)||null,h=(null===(o=kn.current[_[3]])||void 0===o?void 0:o.current)||null}else if(g=(null===(r=Mn.current[e])||void 0===r?void 0:r.current)||null,p=(null===(l=On.current[e])||void 0===l?void 0:l.current)||null,$){var y=Rn[e],R=(null==y?void 0:y.refIndexes)||[];if(R.length>0){var S=R[0],b=Sn.findIndex(function(e){return e.selfIndex===S});-1!==b&&(f=(null===(d=Nn.current[b])||void 0===d?void 0:d.current)||null,h=(null===(v=jn.current[b])||void 0===v?void 0:v.current)||null,x=b)}}else f=(null===(u=Nn.current[e])||void 0===u?void 0:u.current)||null,h=(null===(s=jn.current[e])||void 0===s?void 0:s.current)||null,x=f?e:null;ut.current=x;var A=Ke.current,E=Ge.current;if(!g||!A)return me.current=!1,le(!1),void(null==a||a());if(!f||!E)return pe(!0),Pe.current(),me.current=!1,le(!1),void(null==a||a());if(!$){var I=g.getBoundingClientRect(),T=f.getBoundingClientRect(),B=I.top-T.top;p&&h&&(p.style.paddingTop="0px",h.style.paddingTop="0px",B>0?h.style.paddingTop="".concat(B,"px"):B<0&&(p.style.paddingTop="".concat(Math.abs(B),"px")));var C=g?g.getBoundingClientRect().top:(null==p?void 0:p.getBoundingClientRect().top)||0,D=He.current,O=D?D.scrollTop+C-150:0;return D?void c.smoothScrollTo(D,O,200,function(){pe(!0),Pe.current(),me.current=!1,le(!1),null==a||a()}):(pe(!0),Pe.current(),me.current=!1,le(!1),void(null==a||a()))}var j=g.getBoundingClientRect().top-A.getBoundingClientRect().top+A.scrollTop,w=f.getBoundingClientRect().top-E.getBoundingClientRect().top+E.scrollTop-(j-A.scrollTop);w<0&&qe.current&&(qe.current.style.height="".concat(Math.abs(w),"px"));requestAnimationFrame(function(){var e,n=E.scrollHeight-E.clientHeight;if(w<0)e=0;else{if(w>n){var t=w-n;return ze.current&&(ze.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){c.smoothScrollTo(E,w,200,function(){pe(!0),Pe.current(),me.current=!1,le(!1),null==a||a()})})}e=w}c.smoothScrollTo(E,e,200,function(){pe(!0),Pe.current(),me.current=!1,le(!1),null==a||a()})})})}},[xe,an,Sn,de,$,Rn,Xn]),Bt=t.useCallback(function(e,n,t,i){var o="string"==typeof i?c.safeStringify(i).trim():c.safeStringify(null==i?void 0:i.deviation_summary).trim(),r=e.currentTarget;sn(),t?o&&rn({open:!0,anchorEl:r,summary:i}):Tt(n,t,o?{toggleIfSame:!1,onReady:function(){rn({open:!0,anchorEl:r,summary:i})}}:{toggleIfSame:!1})},[Tt,sn,rn]),Ct=t.useCallback(function(){var e=Ze.sectionIdx,n=Ze.isOrphan;null!=e&&Tt(e,n)},[Tt,Ze.isOrphan,Ze.sectionIdx]),Dt=t.useCallback(function(){ln(),Xn()},[ln,Xn]),Ot=null!==Ze.sectionIdx&&Re.has(Ze.sectionIdx),jt=_.useDeviationNavigation({proposedSections:Rn,existingSections:Sn,parentDeviationRecord:An,expandedSections:Qn,maintainRelativeOrder:!!$,scrollContainerRef:He,leftContainerRef:Ke,lhsBadgeRefs:wn,rhsBadgeRefs:Pn}),wt=jt.showDeviationNavigation,Pt=jt.showOpenNodeRef,Nt=t.useRef(null);t.useEffect(function(){if(Q&&Nt.current!==Q){var n=!1,t=0,i=null,o=150,r=function(e,n){for(var t=function(e,i){if(!e)return null;if(e.id===n)return i;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=t(e.subsections[o],"".concat(i,"-").concat(o));if(r)return r}return null},i=0;i<e.length;i++){var o=t(e[i],String(i));if(o)return o}return null},l=function(){var u,s,a,d;if(!n){var v=null,g=null;for(var f in An){var p=An[f].find(function(e){return e.id===Q});if(p){v=f,g=p;break}}if(g&&v){var h=Rn.findIndex(function(e){return e.id===v});if(!($?!!Qn["left-".concat(h)]:!!Qn[String(h)])&&h>=0)return et(h,"left"),t+=1,void(i=setTimeout(l,450));var x=r(Rn,g.id),_=r(Sn,g.id);if(x&&!_){var m=x.split("-"),y=Number(m[0]);if($){var R=null===(s=null===(u=Rn[y])||void 0===u?void 0:u.refIndexes)||void 0===s?void 0:s[0],S=Sn.findIndex(function(e){return e.selfIndex===R});-1!==S&&(y=S)}_=e.__spreadArray([y],m.slice(1),!0).join("-")}if(x&&_){var b="".concat(g.id).concat(c.DEVIATION_BADGE_SEPARATOR,"0").concat(c.DEVIATION_BADGE_SEPARATOR).concat(x).concat(c.DEVIATION_BADGE_SEPARATOR).concat(_),A="".concat(g.id).concat(c.DEVIATION_BADGE_SEPARATOR,"0"),E=null===(a=wn.current[A])||void 0===a?void 0:a.current,I=null===(d=Pn.current[A])||void 0===d?void 0:d.current,T=$?Ke.current:He.current;if(E&&T){var B=E.getBoundingClientRect();if(0===B.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var C=T.getBoundingClientRect(),D=B.top-C.top+T.scrollTop-C.height/2+B.height/2,O=function(){var e=window.getComputedStyle(E).color;E.style.transition="box-shadow 300ms ease-in-out",E.style.boxShadow="0 0 10px ".concat(e),I&&(I.style.transition="box-shadow 300ms ease-in-out",I.style.boxShadow="0 0 10px ".concat(e)),setTimeout(function(){E&&(E.style.boxShadow=""),I&&(I.style.boxShadow="")},2e3)};Nt.current=Q,$?(T.scrollTo({top:D,behavior:"smooth"}),Tt(b,!1,{toggleIfSame:!1}),O()):c.smoothScrollTo(T,D,300,function(){n||(Tt(b,!1,{toggleIfSame:!1}),O())})}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}};return i=setTimeout(l,o),function(){n=!0,i&&clearTimeout(i)}}},[Q,An,Rn,Sn,$,Qn,et,Tt]);var Ft=function(e){var t=e.section,i=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,c=void 0===l?"left":l,u=e.parentNodeId,s=void 0===u?"":u;return n.jsx(R.default,{section:t,keyPath:i,depth:r,columnKey:c,parentNodeId:s,expandedSubSections:Zn,setExpandedSubSections:$n,maintainRelativeOrder:$||!1,proposedSections:Rn,existingSections:Sn,treeData:V,deviationNumberRegistry:En,connectedSections:Re,activeSideBySideSection:xe,resolvedMarkdownStyles:Le,getSubSectionRef:Hn,getSubSectionCompareStyle:yt,getBadgeRef:Vn,openMoreFunctionsPopup:it,openSummaryPopup:Bt,resetSideBySide:Xn,setConnectedSections:Se,setConnectedLines:Ee,cachedConnectedPositions:De})};return n.jsxs(i.Box,e.__assign({ref:Ve,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},$?{}:{overflow:"visible"}),{position:"relative"})},{children:[te&&n.jsx(i.Box,e.__assign({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n.jsx(v.default,{})})),on.open&&n.jsx(S.default,{open:on.open,anchorEl:on.anchorEl,containerEl:ct.current,clipTopEl:at.current,onClose:Dt,summary:on.summary}),n.jsx(d.default,{open:Ze.open,anchorEl:Ze.anchorEl,sectionTitle:Ze.sectionTitle,referenceSectionTitle:Ze.refSectionTitle,onClose:an,onOpenCognitiveCompare:ot,onOpenSideBySide:Ct,onConnect:rt,isConnected:Ot,isOrphan:Ze.isOrphan}),Je.open&&n.jsx(a.default,{open:Je.open,popupRef:un,position:en,popupConfig:U,onClose:function(){nn(null),Qe(function(n){return e.__assign(e.__assign({},n),{open:!1})}),cn(null)},markdownStyles:W,sectionTitle:Je.sectionTitle,referenceSectionTitle:Je.refSectionTitle,cognitiveData:Je.cognitiveData,anchorEl:Je.anchorEl,sectionAnchorEl:Je.sectionAnchorEl,scrollContainerEl:He.current,badgeStyle:Je.badgeStyle,docData:Je.docData,deviationData:Je.deviationData,isLoading:Je.isLoading}),n.jsx(i.Snackbar,e.__assign({open:!!ue,autoHideDuration:8e3,onClose:function(){return se(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(i.Alert,e.__assign({onClose:function(){return se(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:ue}))})),n.jsx(m.default,{componentHeaderText:H,displayConfig:K,maintainRelativeOrder:$,onToggleView:function(e){ie(!0),setTimeout(function(){ee(!e),Xn(),Se(new Set),Ee([]),De.current=[],setTimeout(function(){ie(!1)},400)},50)}}),n.jsx(i.Box,e.__assign({ref:He,onScroll:It,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:$?"hidden":"auto",borderTop:qn&&zn?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},$?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:lt,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},$?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({ref:Ie,style:{position:"absolute",top:0,left:0,width:ke.width||"100%",height:ke.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[ht&&n.jsx("g",{children:n.jsx("line",{x1:ht.x1,y1:ht.y,x2:ht.x2,y2:ht.y,stroke:Un.badgeBorder,strokeWidth:"1.5"})}),gt.map(function(t){var l=t.x1+.5*(t.x2-t.x1),u=(t.y1+t.y2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;if(t.isSubSection?de&&xe===t.subSectionKeyPath&&fe:de&&xe===t.sectionIdx&&fe)return n.jsxs("g",e.__assign({style:{transition:"opacity 0.2s"}},{children:[n.jsx("defs",{children:n.jsx("marker",e.__assign({id:"arr-".concat(t.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 7 2.5, 0 5",fill:t.style.badgeBorder||"#6366F1"})}))}),n.jsx("line",{ref:st,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(t.id,")")})]}),t.id);if(!$){var a=t.isSubSection?c.getBentArrowPath(t.x1,t.y1,t.x2,t.y2):"M ".concat(t.x1," ").concat(t.y1," L ").concat(t.x2," ").concat(t.y2);return n.jsxs("g",{children:[n.jsx("path",{d:a,fill:"none",stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:l-100,y:u-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsxs(i.Box,e.__assign({onClick:function(n){if(n.stopPropagation(),Je.open&&tn===t.id)sn();else{var i=Rn[t.sectionIdx]||{title:"",content:""},o=Sn[t.sectionIdx]||{title:"",content:""};if(t.isSubSection&&t.subSectionKeyPath){for(var r=t.subSectionKeyPath.split(c.DEVIATION_BADGE_SEPARATOR)[2].split("-").map(Number),l=Rn[r[0]],u=Sn[r[0]],s=(null==l?void 0:l.title)||"",a=(null==u?void 0:u.title)||"",d=1;d<r.length;d++)(null==l?void 0:l.subsections)&&(l=l.subsections[r[d]]),(null==u?void 0:u.subsections)&&(u=u.subsections[r[d]]);l&&(i=e.__assign(e.__assign({},l),{title:s||l.title})),u&&(o=e.__assign(e.__assign({},u),{title:a||u.title}))}cn(t.id),tt(nt(n.currentTarget,i,o,t.sectionIdx,t.style))}},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:t.style.badgeBg,color:t.style.badgeText,border:"1px solid ".concat(t.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"}},{children:[t.style.badgeText===s.DEFAULT_DEVIAION_COLOR&&null==t.style.label?n.jsx(g.default,{color:t.style.badgeText}):0===t.style.label?"Same":t.style.label,n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:Je.open&&tn===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),Ae.map(function(t){var i,o=t.pathD,r=(null===(i=t.style)||void 0===i?void 0:i.badgeBorder)||"#6366F1",l="conn-marker-".concat(t.id),c="".concat(t.id,"-bg"),u="".concat(t.id,"-stroke");return n.jsxs("g",{children:[n.jsx("defs",{children:n.jsx("clipPath",e.__assign({id:"connections-clip"},{children:n.jsx("marker",e.__assign({id:l,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:r})}))}))}),n.jsx("path",{ref:function(e){Ce.current[c]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n.jsx("path",{ref:function(e){Ce.current[u]=e},d:o,fill:"none",stroke:r,strokeWidth:"1.75",markerEnd:"url(#".concat(l,")")})]},t.id)})]})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},$?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({ref:at,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:n.jsx(i.Tooltip,e.__assign({title:hn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:hn}))}))})),n.jsxs(i.Box,e.__assign({ref:Ke,onScroll:It,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},$?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:We,style:{width:"100%",height:"0px",flexShrink:0}}),Tn&&Rn.map(function(t,r){var l,u,s=!t.title&&!t.content;if($&&s)return null;var a=t,d=mt(r,"left"),v=$?!(null===(l=a.refIndexes)||void 0===l?void 0:l.length)||a.selfIndex<0:!Sn[r],f=$?"number"==typeof a.selfIndex&&a.selfIndex>=0?a.selfIndex+1:null:r+1,p=Re.has(r),h=c.extractDeviationScore(a.evaluationResult,null==d?void 0:d.deviationLabel);return n.jsx(i.Box,e.__assign({ref:Ln(r),sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:On.current[r],sx:e.__assign({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==d?void 0:d.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:n.jsx(y.default,{section:t,idx:r,columnKey:"left",colRef:Ln("left-accordion-".concat(r)),mb:0,treeData:V,proposedSections:Rn,existingSections:Sn,deviationNumberRegistry:En,getSectionCompareStyle:mt,getBadgeRef:Vn,connectedSections:Re,openMoreFunctionsPopup:it,openSummaryPopup:Bt,parentNodeId:(null===(u=null==V?void 0:V.input_index_map)||void 0===u?void 0:u[0])||"",isExpanded:$?!!Qn["left-".concat(r)]:!!Qn[String(r)],onToggle:function(){return et(r,"left")},navigation:t.id?wt[t.id]:null,showOpenNodeRef:Pt,resolvedMarkdownStyles:Le,maintainRelativeOrder:$,renderSubSections:Ft})})),$&&d&&n.jsxs(i.Box,e.__assign({ref:wn.current[r],onClick:function(e){var n=$?Sn.find(function(e){var n;return null===(n=a.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Sn[r]||{title:"",content:""};it(e,t,v,n,r,d)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:d.badgeBg,color:d.badgeText,border:"1px solid ".concat(d.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==f&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:f})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!K.isLoading||null!=a.evaluationResult&&null!=a.evaluationResult?v?"No Deviation Found":"N/A"===h||"NA"===h?"N/A":0==h||null==h?"Same":"".concat(h):n.jsx(g.default,{color:d.badgeText})})),n.jsx(o.EllipsisVertical,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(r))}),n.jsx("div",{ref:Ye,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(i.Box,e.__assign({ref:ct,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(i.Box,e.__assign({onClick:function(n){n.stopPropagation(),Je.open&&tn===Wn?sn():(cn(Wn),tt(nt(n.currentTarget,{title:"",content:"",evaluationResult:Yn,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Wn,!0,e.__assign(e.__assign({},Un),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:Un.badgeBg,color:Un.badgeText,border:"1px solid ".concat(Un.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=Kn?Kn:n.jsx(g.default,{}),n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:Je.open&&tn===Wn?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},$?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[re&&n.jsx(l.default,{sections:11}),n.jsx(i.Box,e.__assign({ref:dt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(i.Tooltip,e.__assign({title:xn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:xn}))}))})),n.jsxs(i.Box,e.__assign({ref:Ge,onScroll:It,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},$?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:qe,style:{width:"100%",height:"0px",flexShrink:0}}),Tn&&Sn.map(function(t,o){var r,l=t,c=[],u=!1,s=null,a=-1;if($){c=Rn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),a=Rn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var d=Rn.findIndex(function(e,n){var t;return Re.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(u=-1!==d)&&(s=mt(d))}else c=[o+1],(u=Re.has(o))&&(s=mt(o));var v=mt($&&-1!==a?a:o);return n.jsx(i.Box,e.__assign({ref:Nn.current[o],sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:jn.current[o],sx:e.__assign({width:"100%",display:"flex"},u&&s&&{borderRadius:"6px",outline:"2px solid ".concat(s.badgeBorder),outlineOffset:"1px"})},{children:n.jsx(y.default,{section:t,idx:o,columnKey:"right",colRef:Ln("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==V?void 0:V.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:$?!!Qn["right-".concat(o)]:!!Qn[String(o)],treeData:V,proposedSections:Rn,existingSections:Sn,deviationNumberRegistry:En,getBadgeRef:Vn,getSectionCompareStyle:mt,connectedSections:Re,openMoreFunctionsPopup:it,openSummaryPopup:Bt,onToggle:function(){return et(o,"right")},navigation:t.id?wt[t.id]:null,showOpenNodeRef:Pt,resolvedMarkdownStyles:Le,maintainRelativeOrder:$,renderSubSections:Ft})})),$&&!re&&v&&n.jsx(i.Box,e.__assign({ref:Pn.current[o],"data-section-id":l.id,sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:v.badgeBg,color:v.badgeText,border:"1px solid ".concat(v.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:c.length>0?c.join(", "):"-"}))]}))}),"right-row-".concat(o))}),n.jsx("div",{ref:ze,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@mui/material"),o=require("lucide-react"),l=require("../../assests/svg/ButtonCognitiveIcon.js"),r=require("./OverlayComponent.js"),u=require("./CognitiveComparehelpers.js"),c=require("./CognitiveCompareConfig.js"),s=require("./CognitiveCompareConstants.js"),a=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),g=require("./components/ThreeDotsLoader.js"),f=require("./hooks/useCompareData.js"),p=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),x=require("./hooks/useAccordionState.js"),_=require("./hooks/useDeviationNavigation.js"),m=require("./components/CompareHeader.js"),y=require("./components/SectionAccordion.js"),R=require("./components/SubSectionAccordion.js"),S=require("./components/CognitiveSummaryPopup.js");exports.SHARED_MARKDOWN_STYLES=c.SHARED_MARKDOWN_STYLES,exports.default=function(b){var A,E,I,T,C,B,D,O,j,w,P,N,F,k,M,L=b.componentHeaderText,H=void 0===L?s.DEFAULT_COMPONENT_HEADER_TEXT:L,V=b.treeData,G=b.comparisonConfig,q=b.leftColumnTitleText,z=b.rightColumnTitleText,W=b.markdownStyles,Y=b.displayConfig,K=void 0===Y?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:Y,U=b.popupConfig,X=b.deviationData,J=void 0===X?{}:X,Q=b.deviationNodeIdToView,Z=t.useState(K.maintainRelativeOrder),$=Z[0],ee=Z[1],ne=t.useState(!1),te=ne[0],ie=ne[1],oe=t.useState(!1),le=oe[0],re=oe[1],ue=t.useState(null),ce=ue[0],se=ue[1],ae=t.useState(!1),de=ae[0],ve=ae[1],ge=t.useState(!1),fe=ge[0],pe=ge[1],he=t.useState(null),xe=he[0],_e=he[1],me=t.useRef(!1),ye=t.useState(new Set),Re=ye[0],Se=ye[1],be=t.useState([]),Ae=be[0],Ee=be[1],Ie=t.useRef(null),Te=t.useRef(!1),Ce=t.useRef(null),Be=t.useRef({}),De=t.useRef([]),Oe=t.useRef(!1),je=t.useRef(!1),we=t.useRef(null),Pe=t.useRef(function(){}),Ne=t.useMemo(function(){return(null==V?void 0:V.cognitive_decisioning)||{}},[V]),Fe=t.useState({width:0,height:0}),ke=Fe[0],Me=Fe[1],Le=t.useMemo(function(){return e.__assign(e.__assign({},c.SHARED_MARKDOWN_STYLES),W)},[W]),He=t.useRef(null),Ve=t.useRef(null),Ge=t.useRef(null),qe=t.useRef(null),ze=t.useRef(null),We=t.useRef(null),Ye=t.useRef(null),Ke=t.useRef(null),Ue=t.useRef(!1),Xe=p.useComparePopups(He),Je=Xe.cognitivePopup,Qe=Xe.setCognitivePopup,Ze=Xe.moreFunctions,$e=Xe.setMoreFunctions,en=Xe.position,nn=Xe.setPosition,tn=Xe.activeBadgeId,on=Xe.summaryPopup,ln=Xe.setSummaryPopup,rn=Xe.closeSummaryPopup,un=Xe.setActiveBadgeId,cn=Xe.popupRef,sn=Xe.closeCognitivePopup,an=Xe.closeMoreFunctionsPopup,dn=t.useMemo(function(){var e,n,t,i,o,l,r;return{fields:null!==(e=null==G?void 0:G.fields)&&void 0!==e?e:c.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(t=null===(n=null==G?void 0:G.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:c.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(i=null==G?void 0:G.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:c.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(r=null===(l=null==G?void 0:G.thresholds)||void 0===l?void 0:l.exact)&&void 0!==r?r:c.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[G]),vn=t.useState(null),gn=vn[0];vn[1];var fn=null===(I=null===(A=null==V?void 0:V.documents)||void 0===A?void 0:A[null===(E=null==V?void 0:V.input_index_map)||void 0===E?void 0:E[0]])||void 0===I?void 0:I.title,pn=null===(B=null===(T=null==V?void 0:V.documents)||void 0===T?void 0:T[null===(C=null==V?void 0:V.input_index_map)||void 0===C?void 0:C[1]])||void 0===B?void 0:B.title,hn=u.safeStringify(q||fn||"Uploaded Contract"),xn=u.safeStringify(z||pn||"Reference Template"),_n=f.useCognitiveTreeData(V,$,J,dn),mn=_n.activeProposed,yn=_n.existingRule,Rn=_n.proposedSections,Sn=_n.existingSections,bn=_n.visibleFields,An=_n.parentDeviationRecord,En=_n.deviationNumberRegistry,In=_n.parseError;t.useEffect(function(){In&&se("Failed to load comparison: ".concat(In))},[In]);var Tn=Rn.length>0||Sn.length>0,Cn=h.useSectionRefs(bn.map(function(e){return e.key}),Math.max(Rn.length,Sn.length)),Bn=Cn.leftRefs,Dn=Cn.rightRefs,On=Cn.sectionLeftRefs,jn=Cn.sectionRightRefs,wn=Cn.lhsBadgeRefs,Pn=Cn.rhsBadgeRefs,Nn=Cn.sectionRightRowRefs,Fn=Cn.subSectionLeftRefs,kn=Cn.subSectionRightRefs,Mn=Cn.sectionRowRefs,Ln=Cn.getSectionRowRef,Hn=Cn.getSubSectionRef,Vn=Cn.getBadgeRef,Gn=yn.analysis,qn=u.safeStringify(null===(O=null===(D=null==Gn?void 0:Gn.rule_difference_comparison)||void 0===D?void 0:D.summary)||void 0===O?void 0:O.overall_summary),zn=!!qn.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Wn=null!==(j=null==V?void 0:V.base_root_id)&&void 0!==j?j:"-1";null==V||V[Wn];var Yn=(null===(w=null==J?void 0:J[Wn])||void 0===w?void 0:w.evaluation_result)||(null===(N=null===(P=null==V?void 0:V.nodes)||void 0===P?void 0:P[Wn])||void 0===N?void 0:N.evaluation_result)||null,Kn=u.extractDeviationScore(Yn),Un=u.generateColorPalette(null!==(M=null===(k=null===(F=null==Yn?void 0:Yn.evaluation_outputs)||void 0===F?void 0:F.metadata)||void 0===k?void 0:k.label_color)&&void 0!==M?M:""),Xn=t.useCallback(function(){var e,n,t,i;ve(!1),je.current=!1;var o=we.current,l=ct.current;if(null!==o)if("string"==typeof o&&o.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=o.split(u.DEVIATION_BADGE_SEPARATOR);(c=null===(e=Fn.current[r[2]])||void 0===e?void 0:e.current)&&(c.style.paddingTop="0px")}else{var c;(c=null===(n=On.current[o])||void 0===n?void 0:n.current)&&(c.style.paddingTop="0px")}if(null!==l)if("string"==typeof l&&l.includes(u.DEVIATION_BADGE_SEPARATOR)){r=l.split(u.DEVIATION_BADGE_SEPARATOR);(s=null===(t=kn.current[r[3]])||void 0===t?void 0:t.current)&&(s.style.paddingTop="0px")}else{var s;(s=null===(i=jn.current[l])||void 0===i?void 0:i.current)&&(s.style.paddingTop="0px")}_e(null),we.current=null,ct.current=null,pe(!1),re(!1),qe.current&&(qe.current.style.height="0px"),ze.current&&(ze.current.style.height="0px"),We.current&&(We.current.style.height="0px"),Ye.current&&(Ye.current.style.height="0px")},[]),Jn=x.useAccordionState({maintainRelativeOrder:!!$,proposedSections:Rn,existingSections:Sn,activeSideBySideSection:xe,connectedSections:Re,resetSideBySide:Xn,setConnectedSections:Se,setConnectedLines:Ee,cachedConnectedPositions:De,svgContainerRef:Ie,isAnimatingRef:Te,animationTimerRef:Ce,calculateLinesRef:Pe,sectionLeftRefs:On,sectionRightRefs:jn,subSectionLeftRefs:Fn,subSectionRightRefs:kn}),Qn=Jn.expandedSections,Zn=Jn.expandedSubSections,$n=Jn.setExpandedSubSections,et=Jn.toggleSection,nt=t.useCallback(function(e,n,t,i,o,l,r){var c,s,a,d=u.safeStringify(null==n?void 0:n.id)||u.safeStringify(null==t?void 0:t.id)||"",v=(d?Ne[d]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:d,decisioning:[],gap:[],relevance_score:0},g=null!==(s=null===(c=Mn.current[i])||void 0===c?void 0:c.current)&&void 0!==s?s:null;return{isLoading:null!==(a=null==K?void 0:K.isLoading)&&void 0!==a&&a,open:!0,sectionTitle:(null==n?void 0:n.displayTitle)?null==n?void 0:n.title:"no title",refSectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",cognitiveData:v,anchorEl:e,sectionAnchorEl:g,badgeStyle:l||null,sectionIdx:i,docData:{documents:null==V?void 0:V.documents,input_index_map:null==V?void 0:V.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[Ne,V]),tt=t.useCallback(function(e){an(),nn(null),Qe(e)},[an]),it=function(e,n,t,i,o,l){e.stopPropagation(),Ze.open&&Ze.sectionIdx===o?an():(sn(),$e(nt(e.currentTarget,n,i,o,t,l)))},ot=t.useCallback(function(){null!==Ze.sectionIdx&&Ze.anchorEl?tt(e.__assign(e.__assign({},Ze),{open:!0})):an()},[Ze,an,tt]),lt=t.useCallback(function(){var e=Ze.sectionIdx,n=Ze.isOrphan,t=null!==e&&Re.has(e);an(),null!==e&&(n?se("No counterpart exists to connect to."):(je.current&&Xn(),t&&(Ee([]),De.current=[]),Se(function(n){return n.has(e)?new Set:new Set([e])})))},[Ze.sectionIdx,an,Xn]),rt=t.useRef(null),ut=t.useRef(null),ct=t.useRef(null),st=t.useRef(null),at=t.useRef(null),dt=t.useRef(null),vt=t.useState([]),gt=vt[0],ft=vt[1];t.useRef(null);var pt=t.useState(null),ht=pt[0],xt=pt[1];t.useEffect(function(){if(gn){var e=dn.fields.find(function(e){return e.analysisKey===gn||e.key===gn});if(e){var n=Bn.current[e.key]||Dn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[gn,dn.fields]);var _t=t.useCallback(function(e){var n,t,i,o,l,r,u,c,s,a=null===(n=null==Gn?void 0:Gn.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!a||!a[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=a[e],v=(null==d?void 0:d.relation)||(null===(i=null===(t=null==d?void 0:d.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(l=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===l?void 0:l.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var g=d.mappings[0]||{};return{score:d.score,relation:g.relation||"",highlightsA:(null===(r=g.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(u=g.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(c=d.highlights)||void 0===c?void 0:c.ruleA_spans)||[],highlightsB:(null===(s=d.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!v}},[Gn]),mt=t.useCallback(function(n,t){var i,o,l,r,c,a,d;void 0===t&&(t="left");var v=null,g=null;if("left"===t)if(v=Rn[n],$&&v){var f=Sn.filter(function(e){var n;return null===(n=v.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});g=f.find(function(e){return e.evaluationResult})||f[0]}else g=Sn[n];else if(g=Sn[n],$&&g){var p=Rn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(g.selfIndex)});v=p.find(function(e){return e.evaluationResult})||p[0]}else v=Rn[n];var h=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,x=(null==g?void 0:g.relation)&&"not_defined"!==g.relation,_=!(!(null==v?void 0:v.cognitiveData)&&!(null==g?void 0:g.cognitiveData));if(!h&&!x&&!_)return e.__assign(e.__assign({},u.generateColorPalette(s.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});var m=null!==(o=null!==(i=null==v?void 0:v.evaluationResult)&&void 0!==i?i:null==g?void 0:g.evaluationResult)&&void 0!==o?o:null,y=null===(l=null==m?void 0:m.evaluation_outputs)||void 0===l?void 0:l.output_value,R=null!==(a=null===(c=null===(r=null==m?void 0:m.evaluation_outputs)||void 0===r?void 0:r.metadata)||void 0===c?void 0:c.label_color)&&void 0!==a?a:s.DEFAULT_DEVIAION_COLOR;return null!=m?e.__assign(e.__assign({},u.generateColorPalette(R)),{label:null!==(d=y)&&void 0!==d?d:""}):e.__assign(e.__assign({},u.generateColorPalette(R)),{label:null})},[Rn,Sn,Ne,dn,$]),yt=t.useCallback(function(n){for(var t,i,o,l,r,c,a,d,v,g=n.split("-").map(Number),f=Rn[g[0]],p=Sn[g[0]],h=1;h<g.length;h++)(null==f?void 0:f.subsections)&&(f=f.subsections[g[h]]),(null==p?void 0:p.subsections)&&(p=p.subsections[g[h]]);if(!f&&!p)return null;var x=(null==f?void 0:f.relation)&&"not_defined"!==f.relation,_=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,m=u.safeStringify(null==f?void 0:f.id)||u.safeStringify(null==p?void 0:p.id)||"",y=!(!(null==f?void 0:f.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!x&&!_&&!y)return e.__assign(e.__assign({},u.generateColorPalette(s.DEFAULT_DEVIAION_COLOR)),{label:"Not Defined"});null!==(i=null!==(t=null==f?void 0:f.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||m&&(null===(o=Ne[m])||void 0===o||o.relevance_score);var R=null!==(r=null!==(l=null==f?void 0:f.evaluationResult)&&void 0!==l?l:null==p?void 0:p.evaluationResult)&&void 0!==r?r:null,S=null===(c=null==R?void 0:R.evaluation_outputs)||void 0===c?void 0:c.output_value,b=null!==(v=null===(d=null===(a=null==R?void 0:R.evaluation_outputs)||void 0===a?void 0:a.metadata)||void 0===d?void 0:d.label_color)&&void 0!==v?v:s.DEFAULT_DEVIAION_COLOR;return null!=R?e.__assign(e.__assign({},u.generateColorPalette(b)),{label:null!=S?S:""}):e.__assign(e.__assign({},u.generateColorPalette(b)),{label:null})},[Rn,Sn,Ne,dn]),Rt=t.useCallback(function(){var e,n,t,i,o,l,r,c,s,a,d,v,g,f,p,h,x,_,m,y,R,S;if(!Ue.current&&!Te.current){Ue.current=!0;try{if(!rt.current)return;var b=function(e){var n=e.split("-"),t=n[0];if(!Qn[t]&&!1===$)return!1;if($&&!Qn["left-".concat(t)]&&!Qn["right-".concat(t)]&&!Qn[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!Zn[i])return!1;return!0},A=rt.current.getBoundingClientRect();Me({width:A.width,height:A.height});var E=[];if(bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Bn.current[i])||void 0===n?void 0:n.current,l=null===(t=Dn.current[i])||void 0===t?void 0:t.current;o&&l&&(o.style.height="auto",l.style.height="auto",o.style.minHeight="0px",l.style.minHeight="0px")}),!Te.current){for(var I=0;I<Math.max(Rn.length,Sn.length);I++){var T=null===(e=On.current[I])||void 0===e?void 0:e.current,C=null===(n=jn.current[I])||void 0===n?void 0:n.current;T&&(T.style.height="auto",T.style.minHeight="0px"),C&&(C.style.height="auto",C.style.minHeight="0px")}$||Object.keys(Fn.current).forEach(function(e){var n,t;if(b(e)){var i=null===(n=Fn.current[e])||void 0===n?void 0:n.current,o=null===(t=kn.current[e])||void 0===t?void 0:t.current;i&&o&&(i.style.height="auto",o.style.height="auto",i.style.minHeight="0px",o.style.minHeight="0px")}})}var B={};bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Bn.current[i])||void 0===n?void 0:n.current,l=null===(t=Dn.current[i])||void 0===t?void 0:t.current;if(o&&l){var r=o.getBoundingClientRect(),u=l.getBoundingClientRect();B[i]=Math.max(r.height,u.height)}});var D={left:{},right:{}},O={};if(!Te.current)if($){if(de&&null!==xe)if("number"==typeof xe){var j=xe,w=Rn[j],P=null===(o=On.current[j])||void 0===o?void 0:o.current;P&&w&&(w.refIndexes||[]).forEach(function(e){var n,t=Sn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=jn.current[t])||void 0===n?void 0:n.current;if(i&&(Qn["left-".concat(j)]||Qn["right-".concat(t)])){var o=Math.max(P.getBoundingClientRect().height,i.getBoundingClientRect().height);D.left[j]=Math.max(D.left[j]||0,o),D.right[t]=Math.max(D.right[t]||0,o)}})}else{var N=xe.split(u.DEVIATION_BADGE_SEPARATOR)[2];if(N){T=null===(l=Fn.current[N])||void 0===l?void 0:l.current,C=null===(r=kn.current[N])||void 0===r?void 0:r.current;if(T&&C){F=Math.max(T.getBoundingClientRect().height,C.getBoundingClientRect().height);O[N]=Math.max(O[N]||0,F)}}}}else{Object.keys(Fn.current).forEach(function(e){var n,t;if(b(e)){var i=null===(n=Fn.current[e])||void 0===n?void 0:n.current,o=null===(t=kn.current[e])||void 0===t?void 0:t.current;if(i&&o&&null!==i.offsetParent&&null!==o.offsetParent){var l=i.getBoundingClientRect(),r=o.getBoundingClientRect(),u=Math.max(l.height,r.height);O[e]=u,i.style.minHeight="".concat(u,"px"),o.style.minHeight="".concat(u,"px")}}});for(I=0;I<Math.min(Rn.length,Sn.length);I++){var T=null===(t=On.current[I])||void 0===t?void 0:t.current,C=null===(i=jn.current[I])||void 0===i?void 0:i.current;if(T&&C){var F=Math.max(T.getBoundingClientRect().height,C.getBoundingClientRect().height);D.left[I]=F,D.right[I]=F}}}if(bn.forEach(function(e){var n,t,i=e.key,o=null===(n=Bn.current[i])||void 0===n?void 0:n.current,l=null===(t=Dn.current[i])||void 0===t?void 0:t.current;if(o&&l){var r=B[i];o.style.minHeight="".concat(r,"px"),l.style.minHeight="".concat(r,"px")}}),Te.current||(Object.entries(D.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=On.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(D.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=jn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),$||Object.keys(O).forEach(function(e){var n,t,i=null===(n=Fn.current[e])||void 0===n?void 0:n.current,o=null===(t=kn.current[e])||void 0===t?void 0:t.current;if(i&&o&&O[e]){var l=O[e];i.style.minHeight="".concat(l,"px"),o.style.minHeight="".concat(l,"px")}})),$)Rn.forEach(function(e,n){var t;(null===(t=On.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,l,r,u,c,s,a,d,v=Sn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var g=null===(t=wn.current[n])||void 0===t?void 0:t.current,f=null===(i=Pn.current[v])||void 0===i?void 0:i.current;if(g&&f){var p=g.getBoundingClientRect(),h=f.getBoundingClientRect(),x=p.right-A.left,_=h.left-A.left,m=p.top+p.height/2-A.top,y=h.top+h.height/2-A.top;if(de&&xe===n){var R=null!==(l=null===(o=Ke.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==l?l:0,S=null!==(u=null===(r=Ge.current)||void 0===r?void 0:r.getBoundingClientRect().top)&&void 0!==u?u:0,b=R+(null!==(s=null===(c=Ke.current)||void 0===c?void 0:c.clientHeight)&&void 0!==s?s:1/0),I=S+(null!==(d=null===(a=Ge.current)||void 0===a?void 0:a.clientHeight)&&void 0!==d?d:1/0),T=p.top+p.height/2,C=function(e,n,t){return Math.max(n,Math.min(t,e))};m=C(T,R,b)-A.top,y=C(T,S,I)-A.top}var B=mt(n);B&&E.push({id:"line-".concat(n,"-").concat(v),x1:x,y1:m,x2:_,y2:y,style:B,sectionIdx:n,targetRightIdx:v})}}})});else{for(I=0;I<Math.min(Rn.length,Sn.length);I++){var k=null===(c=On.current[I])||void 0===c?void 0:c.current,M=null===(s=jn.current[I])||void 0===s?void 0:s.current;if(k&&M){var L=k.getBoundingClientRect(),H=M.getBoundingClientRect(),V=Math.max(L.top,H.top)+18-A.top,G=(null===(a=Sn[I])||void 0===a?void 0:a.id)||"sec-".concat(I);(J=mt(I))&&E.push({id:G,x1:L.right-A.left,y1:V,x2:H.left-A.left,y2:V,style:J,sectionIdx:I,hasCognitive:!!((null===(d=Rn[I])||void 0===d?void 0:d.cognitiveData)||(null===(v=Sn[I])||void 0===v?void 0:v.cognitiveData)||G&&Ne[G]),isSubSection:!1})}}Object.keys(Fn.current).forEach(function(e){var n,t,i,o,l,r;if(b(e)){var c=null===(n=Fn.current[e])||void 0===n?void 0:n.current,s=null===(t=kn.current[e])||void 0===t?void 0:t.current;if(c&&s){for(var a=e.split("-").map(Number),d=Rn[a[0]],v=Sn[a[0]],g=1;g<a.length;g++)(null==d?void 0:d.subsections)&&(d=d.subsections[a[g]]),(null==v?void 0:v.subsections)&&(v=v.subsections[a[g]]);var f=!!d&&((null===(i=d.displayTitle)||void 0===i||i)&&u.hasValue(d.title)),p=!!d&&((null===(o=d.displayContent)||void 0===o||o)&&u.hasValue(d.content)),h=!!v&&((null===(l=v.displayTitle)||void 0===l||l)&&u.hasValue(v.title)),x=!!v&&((null===(r=v.displayContent)||void 0===r||r)&&u.hasValue(v.content));if(f&&p||h&&x){var _=c.getBoundingClientRect(),m=s.getBoundingClientRect(),y=Math.max(_.top,m.top)+16-A.top,R=yt(e);R&&"Not Defined"!==R.label&&E.push({id:"subsec-".concat(e),x1:_.right-A.left,y1:y,x2:m.left-A.left,y2:y,style:R,sectionIdx:a[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==d?void 0:d.cognitiveData)&&!(null==v?void 0:v.cognitiveData))})}}}})}if(de&&"string"==typeof xe&&xe.includes(u.DEVIATION_BADGE_SEPARATOR)){var q=xe.split(u.DEVIATION_BADGE_SEPARATOR),z=q[0],W=q[1],Y=q[2],K=(q[3],"".concat(z).concat(u.DEVIATION_BADGE_SEPARATOR).concat(W)),U=null===(g=wn.current[K])||void 0===g?void 0:g.current,X=null===(f=Pn.current[K])||void 0===f?void 0:f.current;if(U&&X){var J,Q=U.getBoundingClientRect(),Z=X.getBoundingClientRect(),ee=Q.right-A.left,ne=Z.left-A.left,te=Q.top+Q.height/2-A.top,ie=Z.top+Z.height/2-A.top;if($){var oe=null!==(h=null===(p=Ke.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==h?h:0,le=null!==(_=null===(x=Ge.current)||void 0===x?void 0:x.getBoundingClientRect().top)&&void 0!==_?_:0,re=oe+(null!==(y=null===(m=Ke.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ue=le+(null!==(S=null===(R=Ge.current)||void 0===R?void 0:R.clientHeight)&&void 0!==S?S:1/0),ce=function(e,n,t){return Math.max(n,Math.min(t,e))};te=ce(Q.top+Q.height/2,oe,re)-A.top,ie=ce(Z.top+Z.height/2,le,ue)-A.top}(J=yt(Y))&&E.push({id:"line-subsec-".concat(K),x1:ee,y1:te,x2:ne,y2:ie,style:J,sectionIdx:Number(Y.split("-")[0]),isSubSection:!0,subSectionKeyPath:xe})}}if(ft(E),at.current&&dt.current){var se=at.current.getBoundingClientRect(),ae=dt.current.getBoundingClientRect(),ve=(se.top+se.height/2-A.top+ae.top+ae.height/2-A.top)/2;xt({x1:se.right-A.left,x2:ae.left-A.left,y:ve})}else xt(null);if(Re.size>0){var ge=[],fe=Ke.current,pe=Ge.current;if(fe&&pe){var he=[],_e=fe.getBoundingClientRect().top,me=pe.getBoundingClientRect().top,ye=_e+fe.clientHeight,Se=me+pe.clientHeight,be=fe.scrollTop,Ae=pe.scrollTop,Ie=A.top,Ce=function(e,n,t){return Math.max(n,Math.min(t,e))};Re.forEach(function(e){var n,t,i,o,l;if("string"==typeof e&&e.includes(u.DEVIATION_BADGE_SEPARATOR)){var r=e.split(u.DEVIATION_BADGE_SEPARATOR),c=r[0],s=r[1],a=r[2],d=(r[3],"".concat(c).concat(u.DEVIATION_BADGE_SEPARATOR).concat(s)),v=null===(n=wn.current[d])||void 0===n?void 0:n.current,g=null===(t=Pn.current[d])||void 0===t?void 0:t.current;if(!v||!g)return;var f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=yt(a),x=(P=f.right-A.left)+.5*((N=p.left-A.left-0)-P),_=f.top+f.height/2,m=p.top+p.height/2,y=_-_e+be,R=m-me+Ae,S="conn-subsec-".concat(d);he.push({lhsScrollY:y,rhsScrollY:R,x1:P,x2:N,containerTop:Ie,leftIdx:e,rhsArrayIdx:e,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var b=Ce(_,_e,ye),E=Ce(m,me,Se),I=b-Ie,T=E-Ie,C=m>=me-4&&m<=Se+4,B="";B=(F=_>=_e-4&&_<=ye+4)&&C?u.getBentArrowPath(P,I,N,T):F&&!C?"M ".concat(P,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&C?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(N,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:B,style:h,leftIdx:e,rhsArrayIdx:e})}else if($){var D=e,O=Rn[D];if(!(null===(l=null==O?void 0:O.refIndexes)||void 0===l?void 0:l.length))return;O.refIndexes.forEach(function(e){var n,t,i=Sn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=wn.current[D])||void 0===n?void 0:n.current,l=null===(t=Pn.current[i])||void 0===t?void 0:t.current;if(o&&l){var r=o.getBoundingClientRect(),c=l.getBoundingClientRect(),s=mt(D),a=r.right-A.left,d=c.left-A.left-0,v=a+.5*(d-a),g=r.top+r.height/2,f=c.top+c.height/2,p=g-_e+be,h=f-me+Ae,x="conn-".concat(D,"-").concat(i);he.push({lhsScrollY:p,rhsScrollY:h,x1:a,x2:d,containerTop:Ie,leftIdx:D,rhsArrayIdx:i,styleColor:(null==s?void 0:s.badgeBorder)||"#6366F1",styleId:x});var _=Ce(g,_e,ye),m=Ce(f,me,Se),y=_-Ie,R=m-Ie,S=g>=_e-4&&g<=ye+4,b=f>=me-4&&f<=Se+4,E="";E=S&&b?u.getBentArrowPath(a,y,d,R):S&&!b?"M ".concat(a,",").concat(y," L ").concat(v,",").concat(y," L ").concat(v,",").concat(R):!S&&b?"M ".concat(v,",").concat(y," L ").concat(v,",").concat(R," L ").concat(d,",").concat(R):"M ".concat(v,",").concat(y," L ").concat(v,",").concat(R),ge.push({id:x,pathD:E,style:s,leftIdx:D,rhsArrayIdx:i})}}})}else{var j=e,w=j;v=null===(i=wn.current[j])||void 0===i?void 0:i.current,g=null===(o=Pn.current[w])||void 0===o?void 0:o.current;if(!v||!g)return;var P,N;f=v.getBoundingClientRect(),p=g.getBoundingClientRect(),h=mt(j),x=(P=f.right-A.left)+.5*((N=p.left-A.left-0)-P),_=f.top+f.height/2,m=p.top+p.height/2,y=_-_e+be,R=m-me+Ae,S="conn-".concat(j,"-").concat(w);he.push({lhsScrollY:y,rhsScrollY:R,x1:P,x2:N,containerTop:Ie,leftIdx:j,rhsArrayIdx:w,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:S});var F;b=Ce(_,_e,ye),E=Ce(m,me,Se),I=b-Ie,T=E-Ie,C=m>=me-4&&m<=Se+4,B="";B=(F=_>=_e-4&&_<=ye+4)&&C?u.getBentArrowPath(P,I,N,T):F&&!C?"M ".concat(P,",").concat(I," L ").concat(x,",").concat(I," L ").concat(x,",").concat(T):!F&&C?"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T," L ").concat(N,",").concat(T):"M ".concat(x,",").concat(I," L ").concat(x,",").concat(T),ge.push({id:S,pathD:B,style:h,leftIdx:j,rhsArrayIdx:w})}}),De.current=he}Ee(ge)}else Ee([]),De.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{Ue.current=!1}}},[bn,Rn,Sn,Ne,dn,_t,mt,$,de,xe,Re,Qn,Zn]),St=t.useCallback(function(){var e,n,t,i,o,l,r,c,s,a,d,v,g,f,p=De.current;if(p.length&&!Te.current){var h=null!==(n=null===(e=Ke.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,x=null!==(i=null===(t=Ge.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,_=null!==(l=null===(o=Ke.current)||void 0===o?void 0:o.clientHeight)&&void 0!==l?l:1/0,m=null!==(c=null===(r=Ge.current)||void 0===r?void 0:r.clientHeight)&&void 0!==c?c:1/0,y=null!==(a=null===(s=Ke.current)||void 0===s?void 0:s.getBoundingClientRect().top)&&void 0!==a?a:0,R=null!==(v=null===(d=Ge.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==v?v:0,S=y+_,b=R+m,A=null!==(f=null===(g=rt.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==f?f:0,E=function(e,n,t){return Math.max(n,Math.min(t,e))};p.forEach(function(e){var n=e.lhsScrollY-h+y,t=e.rhsScrollY-x+R,i=Be.current[e.styleId+"-stroke"],o=Be.current[e.styleId+"-bg"];if(i||o){var l,r=E(n,y,S),c=E(t,R,b),s=r-A,a=c-A,d=n>=y-4&&n<=S+4,v=t>=R-4&&t<=b+4,g=e.x1+.5*(e.x2-e.x1);l=d&&v?u.getBentArrowPath(e.x1,s,e.x2,a):d&&!v?"M ".concat(e.x1,",").concat(s," L ").concat(g,",").concat(s," L ").concat(g,",").concat(a):!d&&v?"M ".concat(g,",").concat(s," L ").concat(g,",").concat(a," L ").concat(e.x2,",").concat(a):"M ".concat(g,",").concat(s," L ").concat(g,",").concat(a),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",l)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",l))}})}},[]);t.useEffect(function(){Pe.current=Rt},[Rt]);var bt=t.useRef(null),At=t.useCallback(function(){De.current.length>0&&!Te.current||(null!==bt.current&&clearTimeout(bt.current),bt.current=setTimeout(function(){Pe.current(),bt.current=null},50))},[]),Et=t.useCallback(function(){null!==bt.current&&clearTimeout(bt.current),bt.current=setTimeout(function(){De.current=[],Pe.current(),bt.current=null},100)},[]),It=t.useCallback(function(e){var n,t,i,o,l,r,c,s,a,d;if(!me.current){if($||At(),je.current){var v=we.current,g=ct.current,f=Ke.current,p=Ge.current;if(null!==v&&null!==g&&f&&p){var h="string"==typeof v&&v.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(n=wn.current["".concat(v.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(v.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===n?void 0:n.current:null===(t=Mn.current[v])||void 0===t?void 0:t.current,x="string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)?null===(i=Pn.current["".concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(g.split(u.DEVIATION_BADGE_SEPARATOR)[1])])||void 0===i?void 0:i.current:null===(o=Nn.current[g])||void 0===o?void 0:o.current;if(h&&x){var _=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop,m=x.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop;if(e.currentTarget===f){var y=m-(_-f.scrollTop),R=p.scrollHeight-p.clientHeight,S=Math.max(0,Math.min(y,R));Math.abs(p.scrollTop-S)>1&&(p.scrollTop=S)}else if(e.currentTarget===p){var b=_-(m-p.scrollTop),A=f.scrollHeight-f.clientHeight,E=Math.max(0,Math.min(b,A));Math.abs(f.scrollTop-E)>1&&(f.scrollTop=E)}if(st.current){var I=void 0,T=void 0;if("string"==typeof v&&v.includes(u.DEVIATION_BADGE_SEPARATOR)){var C=v.split(u.DEVIATION_BADGE_SEPARATOR),B="".concat(C[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(C[1]);I=null===(l=wn.current[B])||void 0===l?void 0:l.current,T=null===(r=Pn.current[B])||void 0===r?void 0:r.current}else I=null===(c=wn.current[v])||void 0===c?void 0:c.current,T=null===(s=Pn.current[g])||void 0===s?void 0:s.current;var D=null!==(d=null===(a=rt.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==d?d:0,O=f.getBoundingClientRect().top,j=O+f.clientHeight,w=p.getBoundingClientRect().top,P=w+p.clientHeight,N=function(e,n,t){return Math.max(n,Math.min(t,e))};if(I&&T){var F=I.getBoundingClientRect(),k=T.getBoundingClientRect(),M=F.top+F.height/2,L=k.top+k.height/2,H=N(M,O,j),V=N(L,w,P);st.current.setAttribute("y1",(H-D).toString()),st.current.setAttribute("y2",(V-D).toString());var G=M>=O-4&&M<=j+4;st.current.setAttribute("visibility",G?"visible":"hidden")}}}}}De.current.length>0&&!Oe.current&&(Oe.current=!0,requestAnimationFrame(function(){St(),Oe.current=!1}))}},[St,$,At]);t.useEffect(function(){var e=setTimeout(At,250);window.addEventListener("resize",Et);var n=null,t=null;return He.current&&(n=new ResizeObserver(At)).observe(He.current),rt.current&&(t=new ResizeObserver(At)).observe(rt.current),function(){clearTimeout(e),window.removeEventListener("resize",At),null==n||n.disconnect(),null==t||t.disconnect()}},[mn,yn,Gn,bn,Qn,Zn,Rn,Sn,dn,At,Et,de,xe,fe,Re]),t.useEffect(function(){je.current=de},[de]),t.useEffect(function(){we.current=xe},[xe]);var Tt=t.useCallback(function(e,n,t){var i,o,l,r,c,s,a=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,d=null==t?void 0:t.onReady,v=null!==(o=null==t?void 0:t.sourceSide)&&void 0!==o?o:"left";if(an(),null!=e)if(n)se("No counterpart exists for this section.");else if(de&&xe===e)a?Xn():null==d||d();else{if(!$){var g=we.current,f=ct.current;if(null!==g)if("string"==typeof g&&g.includes(u.DEVIATION_BADGE_SEPARATOR)){var p=g.split(u.DEVIATION_BADGE_SEPARATOR);(h=null===(l=Fn.current[p[2]])||void 0===l?void 0:l.current)&&(h.style.paddingTop="0px")}else{var h;(h=null===(r=On.current[g])||void 0===r?void 0:r.current)&&(h.style.paddingTop="0px")}if(null!==f)if("string"==typeof f&&f.includes(u.DEVIATION_BADGE_SEPARATOR)){p=f.split(u.DEVIATION_BADGE_SEPARATOR);(x=null===(c=kn.current[p[3]])||void 0===c?void 0:c.current)&&(x.style.paddingTop="0px")}else{var x;(x=null===(s=jn.current[f])||void 0===s?void 0:s.current)&&(x.style.paddingTop="0px")}}Se(new Set),Ee([]),De.current=[],re(!0),me.current=!0,_e(e),we.current=e,ve(!0),je.current=!0,pe(!1),qe.current&&(qe.current.style.height="0px"),ze.current&&(ze.current.style.height="0px"),We.current&&(We.current.style.height="0px"),Ye.current&&(Ye.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,l,r,c,s,a,g,f=null,p=null,h=null,x=null,_=null;if("string"==typeof e&&e.includes(u.DEVIATION_BADGE_SEPARATOR)){var m=e.split(u.DEVIATION_BADGE_SEPARATOR),y="".concat(m[0]).concat(u.DEVIATION_BADGE_SEPARATOR).concat(m[1]);f=(null===(n=wn.current[y])||void 0===n?void 0:n.current)||null,_=(p=(null===(t=Pn.current[y])||void 0===t?void 0:t.current)||null)?e:null,h=(null===(i=Fn.current[m[2]])||void 0===i?void 0:i.current)||null,x=(null===(o=kn.current[m[3]])||void 0===o?void 0:o.current)||null}else if(f=(null===(l=Mn.current[e])||void 0===l?void 0:l.current)||null,h=(null===(r=On.current[e])||void 0===r?void 0:r.current)||null,$){var R=Rn[e],S=(null==R?void 0:R.refIndexes)||[];if(S.length>0){var b=S[0],A=Sn.findIndex(function(e){return e.selfIndex===b});-1!==A&&(p=(null===(a=Nn.current[A])||void 0===a?void 0:a.current)||null,x=(null===(g=jn.current[A])||void 0===g?void 0:g.current)||null,_=A)}}else p=(null===(c=Nn.current[e])||void 0===c?void 0:c.current)||null,x=(null===(s=jn.current[e])||void 0===s?void 0:s.current)||null,_=p?e:null;ct.current=_;var E=Ke.current,I=Ge.current;if(!f||!E)return me.current=!1,re(!1),void(null==d||d());if(!p||!I)return pe(!0),Pe.current(),me.current=!1,re(!1),void(null==d||d());if(!$){var T=f.getBoundingClientRect(),C=p.getBoundingClientRect(),B=T.top-C.top;h&&x&&(h.style.paddingTop="0px",x.style.paddingTop="0px",B>0?x.style.paddingTop="".concat(B,"px"):B<0&&(h.style.paddingTop="".concat(Math.abs(B),"px")));var D=0;D="right"===v?p?p.getBoundingClientRect().top:(null==x?void 0:x.getBoundingClientRect().top)||0:f?f.getBoundingClientRect().top:(null==h?void 0:h.getBoundingClientRect().top)||0;var O=He.current,j=O?O.scrollTop+D-150:0;return O?void u.smoothScrollTo(O,j,200,function(){pe(!0),Pe.current(),me.current=!1,re(!1),null==d||d()}):(pe(!0),Pe.current(),me.current=!1,re(!1),void(null==d||d()))}var w=f.getBoundingClientRect().top-E.getBoundingClientRect().top+E.scrollTop,P=p.getBoundingClientRect().top-I.getBoundingClientRect().top+I.scrollTop,N=200;if("left"===v){var F=P-(w-E.scrollTop);F<0&&qe.current&&(qe.current.style.height="".concat(Math.abs(F),"px")),requestAnimationFrame(function(){var e,n=I.scrollHeight-I.clientHeight;if(F<0)e=0;else{if(F>n){var t=F-n;return ze.current&&(ze.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){u.smoothScrollTo(I,F,N,function(){pe(!0),Pe.current(),me.current=!1,re(!1),null==d||d()})})}e=F}u.smoothScrollTo(I,e,N,function(){pe(!0),Pe.current(),me.current=!1,re(!1),null==d||d()})})}else{var k=w-(P-I.scrollTop);k<0&&We.current&&(We.current.style.height="".concat(Math.abs(k),"px")),requestAnimationFrame(function(){var e,n=E.scrollHeight-E.clientHeight;if(k<0)e=0;else{if(k>n){var t=k-n;return Ye.current&&(Ye.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){u.smoothScrollTo(E,k,N,function(){pe(!0),Pe.current(),me.current=!1,re(!1),null==d||d()})})}e=k}u.smoothScrollTo(E,e,N,function(){pe(!0),Pe.current(),me.current=!1,re(!1),null==d||d()})})}})}},[xe,an,Sn,de,$,Rn,Xn]),Ct=t.useCallback(function(e,n,t,i){var o,l="string"==typeof i?u.safeStringify(i).trim():u.safeStringify(null==i?void 0:i.deviation_summary).trim(),r=e.currentTarget;sn();var c="left";(null===(o=Ge.current)||void 0===o?void 0:o.contains(r))&&(c="right"),t?l&&ln({open:!0,anchorEl:r,summary:i}):Tt(n,t,l?{toggleIfSame:!1,sourceSide:c,onReady:function(){ln({open:!0,anchorEl:r,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[Tt,sn,ln]),Bt=t.useCallback(function(){var e,n=Ze.sectionIdx,t=Ze.isOrphan;if(null!=n){var i="left";Ze.anchorEl&&(null===(e=Ge.current)||void 0===e?void 0:e.contains(Ze.anchorEl))&&(i="right"),Tt(n,t,{sourceSide:i})}},[Tt,Ze.isOrphan,Ze.sectionIdx,Ze.anchorEl]),Dt=t.useCallback(function(){rn(),Xn()},[rn,Xn]),Ot=null!==Ze.sectionIdx&&Re.has(Ze.sectionIdx),jt=_.useDeviationNavigation({proposedSections:Rn,existingSections:Sn,parentDeviationRecord:An,expandedSections:Qn,maintainRelativeOrder:!!$,scrollContainerRef:He,leftContainerRef:Ke,lhsBadgeRefs:wn,rhsBadgeRefs:Pn}),wt=jt.showDeviationNavigation,Pt=jt.showOpenNodeRef,Nt=t.useRef(null);t.useEffect(function(){if(Q&&Nt.current!==Q){var n=!1,t=0,i=null,o=150,l=function(e,n){for(var t=function(e,i){if(!e)return null;if(e.id===n)return i;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var l=t(e.subsections[o],"".concat(i,"-").concat(o));if(l)return l}return null},i=0;i<e.length;i++){var o=t(e[i],String(i));if(o)return o}return null},r=function(){var c,s,a,d;if(!n){var v=null,g=null;for(var f in An){var p=An[f].find(function(e){return e.id===Q});if(p){v=f,g=p;break}}if(g&&v){var h=Rn.findIndex(function(e){return e.id===v});if(!($?!!Qn["left-".concat(h)]:!!Qn[String(h)])&&h>=0)return et(h,"left"),t+=1,void(i=setTimeout(r,450));var x=l(Rn,g.id),_=l(Sn,g.id);if(x&&!_){var m=x.split("-"),y=Number(m[0]);if($){var R=null===(s=null===(c=Rn[y])||void 0===c?void 0:c.refIndexes)||void 0===s?void 0:s[0],S=Sn.findIndex(function(e){return e.selfIndex===R});-1!==S&&(y=S)}_=e.__spreadArray([y],m.slice(1),!0).join("-")}if(x&&_){var b="".concat(g.id).concat(u.DEVIATION_BADGE_SEPARATOR,"0").concat(u.DEVIATION_BADGE_SEPARATOR).concat(x).concat(u.DEVIATION_BADGE_SEPARATOR).concat(_),A="".concat(g.id).concat(u.DEVIATION_BADGE_SEPARATOR,"0"),E=null===(a=wn.current[A])||void 0===a?void 0:a.current,I=null===(d=Pn.current[A])||void 0===d?void 0:d.current,T=$?Ke.current:He.current;if(E&&T){var C=E.getBoundingClientRect();if(0===C.height)return void((t+=1)<20&&(i=setTimeout(r,o)));var B=T.getBoundingClientRect(),D=C.top-B.top+T.scrollTop-B.height/2+C.height/2,O=function(){var e=window.getComputedStyle(E).color;E.style.transition="box-shadow 300ms ease-in-out",E.style.boxShadow="0 0 10px ".concat(e),I&&(I.style.transition="box-shadow 300ms ease-in-out",I.style.boxShadow="0 0 10px ".concat(e)),setTimeout(function(){E&&(E.style.boxShadow=""),I&&(I.style.boxShadow="")},2e3)};Nt.current=Q,$?(T.scrollTo({top:D,behavior:"smooth"}),Tt(b,!1,{toggleIfSame:!1}),O()):u.smoothScrollTo(T,D,300,function(){n||(Tt(b,!1,{toggleIfSame:!1}),O())})}else(t+=1)<20&&(i=setTimeout(r,o))}else(t+=1)<20&&(i=setTimeout(r,o))}else(t+=1)<20&&(i=setTimeout(r,o))}};return i=setTimeout(r,o),function(){n=!0,i&&clearTimeout(i)}}},[Q,An,Rn,Sn,$,Qn,et,Tt]);var Ft=function(e){var t=e.section,i=e.keyPath,o=e.depth,l=void 0===o?0:o,r=e.columnKey,u=void 0===r?"left":r,c=e.parentNodeId,s=void 0===c?"":c;return n.jsx(R.default,{section:t,keyPath:i,depth:l,columnKey:u,parentNodeId:s,expandedSubSections:Zn,setExpandedSubSections:$n,maintainRelativeOrder:$||!1,proposedSections:Rn,existingSections:Sn,treeData:V,deviationNumberRegistry:En,connectedSections:Re,activeSideBySideSection:xe,resolvedMarkdownStyles:Le,getSubSectionRef:Hn,getSubSectionCompareStyle:yt,getBadgeRef:Vn,openMoreFunctionsPopup:it,openSummaryPopup:Ct,resetSideBySide:Xn,setConnectedSections:Se,setConnectedLines:Ee,cachedConnectedPositions:De})};return n.jsxs(i.Box,e.__assign({ref:Ve,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},$?{}:{overflow:"visible"}),{position:"relative"})},{children:[te&&n.jsx(i.Box,e.__assign({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n.jsx(v.default,{})})),on.open&&n.jsx(S.default,{open:on.open,anchorEl:on.anchorEl,containerEl:ut.current,clipTopEl:at.current,onClose:Dt,summary:on.summary}),n.jsx(d.default,{open:Ze.open,anchorEl:Ze.anchorEl,sectionTitle:Ze.sectionTitle,referenceSectionTitle:Ze.refSectionTitle,onClose:an,onOpenCognitiveCompare:ot,onOpenSideBySide:Bt,onConnect:lt,isConnected:Ot,isOrphan:Ze.isOrphan}),Je.open&&n.jsx(a.default,{open:Je.open,popupRef:cn,position:en,popupConfig:U,onClose:function(){nn(null),Qe(function(n){return e.__assign(e.__assign({},n),{open:!1})}),un(null)},markdownStyles:W,sectionTitle:Je.sectionTitle,referenceSectionTitle:Je.refSectionTitle,cognitiveData:Je.cognitiveData,anchorEl:Je.anchorEl,sectionAnchorEl:Je.sectionAnchorEl,scrollContainerEl:He.current,badgeStyle:Je.badgeStyle,docData:Je.docData,deviationData:Je.deviationData,isLoading:Je.isLoading}),n.jsx(i.Snackbar,e.__assign({open:!!ce,autoHideDuration:8e3,onClose:function(){return se(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(i.Alert,e.__assign({onClose:function(){return se(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:ce}))})),n.jsx(m.default,{componentHeaderText:H,displayConfig:K,maintainRelativeOrder:$,onToggleView:function(e){ie(!0),setTimeout(function(){ee(!e),Xn(),Se(new Set),Ee([]),De.current=[],setTimeout(function(){ie(!1)},400)},50)}}),n.jsx(i.Box,e.__assign({ref:He,onScroll:It,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:$?"hidden":"auto",borderTop:qn&&zn?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(i.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},$?{flex:1,minHeight:0}:{})},{children:n.jsxs(i.Box,e.__assign({ref:rt,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},$?{flex:1,overflow:"visible"}:{})},{children:[n.jsxs("svg",e.__assign({ref:Ie,style:{position:"absolute",top:0,left:0,width:ke.width||"100%",height:ke.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[ht&&n.jsx("g",{children:n.jsx("line",{x1:ht.x1,y1:ht.y,x2:ht.x2,y2:ht.y,stroke:Un.badgeBorder,strokeWidth:"1.5"})}),gt.map(function(t){var r,c,a,d,v=t.x1+.5*(t.x2-t.x1),f=(t.y1+t.y2)/2;if("Not Defined"===t.style.label&&!t.hasCognitive)return null;if(t.isSubSection?de&&xe===t.subSectionKeyPath&&fe:de&&xe===t.sectionIdx&&fe)return n.jsxs("g",e.__assign({style:{transition:"opacity 0.2s"}},{children:[n.jsx("defs",{children:n.jsx("marker",e.__assign({id:"arr-".concat(t.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 7 2.5, 0 5",fill:t.style.badgeBorder||"#6366F1"})}))}),n.jsx("line",{ref:st,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(t.id,")")})]}),t.id);if(!$){var p=t.isSubSection?u.getBentArrowPath(t.x1,t.y1,t.x2,t.y2):"M ".concat(t.x1," ").concat(t.y1," L ").concat(t.x2," ").concat(t.y2),h=Rn[t.sectionIdx]||{title:"",content:""},x=Sn[t.sectionIdx]||{title:"",content:""};if(t.isSubSection&&t.subSectionKeyPath){for(var _=t.subSectionKeyPath.split(u.DEVIATION_BADGE_SEPARATOR)[2].split("-").map(Number),m=Rn[_[0]],y=Sn[_[0]],R=(null==m?void 0:m.title)||"",S=(null==y?void 0:y.title)||"",b=1;b<_.length;b++)(null==m?void 0:m.subsections)&&(m=m.subsections[_[b]]),(null==y?void 0:y.subsections)&&(y=y.subsections[_[b]]);m&&(h=e.__assign(e.__assign({},m),{title:R||m.title})),y&&(x=e.__assign(e.__assign({},y),{title:S||y.title}))}var A=(null===(r=h.displayTitle)||void 0===r||r)&&u.hasValue(h.title),E=(null===(c=h.displayContent)||void 0===c||c)&&u.hasValue(h.content),I=!A&&!E,T=(null===(a=x.displayTitle)||void 0===a||a)&&u.hasValue(x.title),C=(null===(d=x.displayContent)||void 0===d||d)&&u.hasValue(x.content),B=I||!T&&!C;return n.jsxs("g",{children:[n.jsx("path",{d:p,fill:"none",stroke:t.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),n.jsx("foreignObject",e.__assign({x:v-100,y:f-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n.jsxs(i.Box,e.__assign({onClick:function(e){e.stopPropagation(),B||(Je.open&&tn===t.id?sn():(un(t.id),tt(nt(e.currentTarget,h,x,t.sectionIdx,t.style))))},sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:t.style.badgeBg,color:t.style.badgeText,border:"1px solid ".concat(t.style.badgeBorder),borderRadius:"12px",px:1.5,py:.5,fontWeight:600,textAlign:"center",whiteSpace:"nowrap",cursor:B?"default":"pointer"}},{children:[t.style.badgeText===s.DEFAULT_DEVIAION_COLOR&&null==t.style.label?n.jsx(g.default,{color:t.style.badgeText}):0===t.style.label?"Same":t.style.label,n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(l.ButtonCognitiveIcon,{})})),!B&&n.jsx(o.ChevronDown,{size:11,style:{transform:Je.open&&tn===t.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},t.id)}return null}),Ae.map(function(t){var i,o=t.pathD,l=(null===(i=t.style)||void 0===i?void 0:i.badgeBorder)||"#6366F1",r="conn-marker-".concat(t.id),u="".concat(t.id,"-bg"),c="".concat(t.id,"-stroke");return n.jsxs("g",{children:[n.jsx("defs",{children:n.jsx("clipPath",e.__assign({id:"connections-clip"},{children:n.jsx("marker",e.__assign({id:r,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:n.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),n.jsx("path",{ref:function(e){Be.current[u]=e},d:o,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),n.jsx("path",{ref:function(e){Be.current[c]=e},d:o,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(r,")")})]},t.id)})]})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},$?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(i.Box,e.__assign({ref:at,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:n.jsx(i.Tooltip,e.__assign({title:hn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:hn}))}))})),n.jsxs(i.Box,e.__assign({ref:Ke,onScroll:It,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},$?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:We,style:{width:"100%",height:"0px",flexShrink:0}}),Tn&&Rn.map(function(t,l){var r,c,s=!t.title&&!t.content;if($&&s)return null;var a=t,d=mt(l,"left"),v=$?!(null===(r=a.refIndexes)||void 0===r?void 0:r.length)||a.selfIndex<0:!Sn[l],f=$?"number"==typeof a.selfIndex&&a.selfIndex>=0?a.selfIndex+1:null:l+1,p=Re.has(l),h=u.extractDeviationScore(a.evaluationResult,null==d?void 0:d.deviationLabel);return n.jsx(i.Box,e.__assign({ref:Ln(l),sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:On.current[l],sx:e.__assign({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==d?void 0:d.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:n.jsx(y.default,{section:t,idx:l,columnKey:"left",colRef:Ln("left-accordion-".concat(l)),mb:0,treeData:V,proposedSections:Rn,existingSections:Sn,deviationNumberRegistry:En,getSectionCompareStyle:mt,getBadgeRef:Vn,connectedSections:Re,openMoreFunctionsPopup:it,openSummaryPopup:Ct,parentNodeId:(null===(c=null==V?void 0:V.input_index_map)||void 0===c?void 0:c[0])||"",isExpanded:$?!!Qn["left-".concat(l)]:!!Qn[String(l)],onToggle:function(){return et(l,"left")},navigation:t.id?wt[t.id]:null,showOpenNodeRef:Pt,resolvedMarkdownStyles:Le,maintainRelativeOrder:$,renderSubSections:Ft})})),$&&d&&n.jsxs(i.Box,e.__assign({ref:wn.current[l],onClick:function(e){var n=$?Sn.find(function(e){var n;return null===(n=a.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Sn[l]||{title:"",content:""};it(e,t,v,n,l,d)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:d.badgeBg,color:d.badgeText,border:"1px solid ".concat(d.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==f&&n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(d.badgeBorder)}},{children:f})),n.jsx(i.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!K.isLoading||null!=a.evaluationResult&&null!=a.evaluationResult?v?"No Deviation Found":"N/A"===h||"NA"===h?"N/A":0==h||null==h?"Same":"".concat(h):n.jsx(g.default,{color:d.badgeText})})),n.jsx(o.EllipsisVertical,{size:11,color:d.badgeText})]}))]}))}),"left-row-".concat(l))}),n.jsx("div",{ref:Ye,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(i.Box,e.__assign({ref:ut,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(i.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(i.Box,e.__assign({onClick:function(n){n.stopPropagation(),Je.open&&tn===Wn?sn():(un(Wn),tt(nt(n.currentTarget,{title:"",content:"",evaluationResult:Yn,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Wn,!0,e.__assign(e.__assign({},Un),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:Un.badgeBg,color:Un.badgeText,border:"1px solid ".concat(Un.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=Kn?Kn:n.jsx(g.default,{}),n.jsx(i.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(l.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:Je.open&&tn===Wn?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(i.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},$?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[le&&n.jsx(r.default,{sections:11}),n.jsx(i.Box,e.__assign({ref:dt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(i.Tooltip,e.__assign({title:xn,placement:"top"},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:xn}))}))})),n.jsxs(i.Box,e.__assign({ref:Ge,onScroll:It,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},$?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:qe,style:{width:"100%",height:"0px",flexShrink:0}}),Tn&&Sn.map(function(t,o){var l,r=t,u=[],c=!1,s=null,a=-1;if($){u=Rn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(r.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),a=Rn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(r.selfIndex))&&e.selfIndex>=0});var d=Rn.findIndex(function(e,n){var t;return Re.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(r.selfIndex))});(c=-1!==d)&&(s=mt(d))}else u=[o+1],(c=Re.has(o))&&(s=mt(o));var v=mt($&&-1!==a?a:o);return n.jsx(i.Box,e.__assign({ref:Nn.current[o],sx:{mb:1,width:"100%"}},{children:n.jsxs(i.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[n.jsx(i.Box,e.__assign({ref:jn.current[o],sx:e.__assign({width:"100%",display:"flex"},c&&s&&{borderRadius:"6px",outline:"2px solid ".concat(s.badgeBorder),outlineOffset:"1px"})},{children:n.jsx(y.default,{section:t,idx:o,columnKey:"right",colRef:Ln("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(l=null==V?void 0:V.input_index_map)||void 0===l?void 0:l[1])||"",isExpanded:$?!!Qn["right-".concat(o)]:!!Qn[String(o)],treeData:V,proposedSections:Rn,existingSections:Sn,deviationNumberRegistry:En,getBadgeRef:Vn,getSectionCompareStyle:mt,connectedSections:Re,openMoreFunctionsPopup:it,openSummaryPopup:Ct,onToggle:function(){return et(o,"right")},navigation:t.id?wt[t.id]:null,showOpenNodeRef:Pt,resolvedMarkdownStyles:Le,maintainRelativeOrder:$,renderSubSections:Ft})})),$&&!le&&v&&n.jsx(i.Box,e.__assign({ref:Pn.current[o],"data-section-id":r.id,sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:v.badgeBg,color:v.badgeText,border:"1px solid ".concat(v.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:u.length>0?u.join(", "):"-"}))]}))}),"right-row-".concat(o))}),n.jsx("div",{ref:ze,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),s=require("react");exports.default=function(n){var t=n.leftComponent,l=n.rightComponent,r=s.useRef(null),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),s=require("react");exports.default=function(n){var t=n.leftComponent,l=n.rightComponent,r=n.isFullscreen,a=void 0!==r&&r,o=s.useRef(null),d=s.useState(50),u=d[0],c=d[1],_=s.useState(!1),h=_[0],g=_[1],x=null!=t,f=null!=l,v=s.useCallback(function(){x&&f&&g(!0)},[x,f]),p=s.useCallback(function(e){if(h&&o.current){var i=o.current.getBoundingClientRect(),s=(e.clientX-i.left)/i.width*100;s=Math.max(25,Math.min(75,s)),c(s)}},[h]),j=s.useCallback(function(){g(!1)},[]),m={minWidth:0,minHeight:0,height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"};return i.jsxs("div",e.__assign({ref:o,onMouseMove:p,onMouseUp:j,onMouseLeave:j,style:{display:"flex",width:"calc(100% - 1px)",height:a?"100%":"400px",border:"1px solid #ddd",overflow:"hidden",userSelect:h?"none":"auto"}},{children:[x&&!f&&i.jsx("div",e.__assign({style:e.__assign(e.__assign({},m),{width:"100%"})},{children:t})),!x&&f&&i.jsx("div",e.__assign({style:e.__assign(e.__assign({},m),{width:"100%"})},{children:l})),x&&f&&i.jsxs(i.Fragment,{children:[i.jsx("div",e.__assign({style:e.__assign(e.__assign({},m),{width:"".concat(u,"%"),flexShrink:0})},{children:t})),i.jsx("div",{onMouseDown:v,style:{width:"6px",background:"#D0D5DD",cursor:"col-resize",flexShrink:0}}),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},m),{flex:1})},{children:l}))]})]}))};
|
|
2
2
|
//# sourceMappingURL=ResizableSplitPane.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("./PdfStyle.js"),s=require("../../assests/svg/PdfViewerIcons.js"),t=require("@mui/material");exports.default=function(o){o.highlightIndex;var l=o.totalHighlights,r=o.controls,d=o.currentPosition,a=o.pdfName,c=o.onClose,p=o.pdfUrl,x=o.viewerRef,g=o.customStyles,u=o.customClasses,h=o.customIcons,f=o.headerAction,_=o.isZoomEnabled,j=void 0===_||_,v=o.showHighlightsAction,m=void 0===v||v,y=r.ZoomInButton,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("./PdfStyle.js"),s=require("../../assests/svg/PdfViewerIcons.js"),t=require("@mui/material");exports.default=function(o){o.highlightIndex;var l=o.totalHighlights,r=o.controls,d=o.currentPosition,a=o.pdfName,c=o.onClose,p=o.pdfUrl,x=o.viewerRef,g=o.customStyles,u=o.customClasses,h=o.customIcons,f=o.headerAction,_=o.isZoomEnabled,j=void 0===_||_,v=o.showHighlightsAction,m=void 0===v||v,y=o.showFullScreenAction,w=void 0===y||y,b=r.ZoomInButton,k=r.ZoomOutButton,I=r.ZoomPopover,C=r.goToPrevious,S=r.goToNext,D={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0};return n.jsxs("div",e.__assign({style:e.__assign(e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},i.pdfStyles.header),null==g?void 0:g.header)},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0,overflow:"hidden"}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==g?void 0:g.pdfIconWrapper),{flexShrink:0})},{children:(null==h?void 0:h.pdfIcon)||n.jsx(s.DefaultPdfIcon,{})})),n.jsx(t.Tooltip,e.__assign({title:a||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n.jsx("span",e.__assign({style:e.__assign({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==g?void 0:g.pdfName),className:null==u?void 0:u.pdfName},{children:a}))}))}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:m?"16px":"2px",color:"#4B5563",flexShrink:0,whiteSpace:"nowrap",minWidth:"fit-content"}},{children:[j&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(k,{}),n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n.jsx(I,{})})),n.jsx(b,{})]})),!!l&&m&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("span",e.__assign({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[d," of ",l]})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:d<=1?"not-allowed":"pointer",padding:"2px 4px",color:d<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:C,disabled:d<=1},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:d===l?"not-allowed":"pointer",padding:"2px 4px",color:d===l?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:S,disabled:d===l},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n.jsx("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==w&&((null==f?void 0:f.icon)&&(null==f?void 0:f.onClick)?n.jsx(t.Tooltip,e.__assign({title:(null==f?void 0:f.tooltip)||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({onClick:f.onClick,style:e.__assign({display:"flex",alignItems:"center",cursor:"pointer"},D)},{children:f.icon}))})):n.jsx("button",e.__assign({onClick:function(){var e=null==x?void 0:x.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:D,title:"Full Screen"},{children:(null==h?void 0:h.fullScreenIcon)||n.jsx(s.DefaultFullScreenIcon,{})}))),p&&n.jsx("a",e.__assign({href:p,target:"_blank",rel:"noopener noreferrer",style:D,title:"Open in new tab"},{children:(null==h?void 0:h.downloadIcon)||n.jsx(s.DefaultDownloadIcon,{})})),c&&n.jsx("button",e.__assign({onClick:c,style:D,title:"Close"},{children:(null==h?void 0:h.closeIcon)||n.jsx(s.DefaultCloseIcon,{})}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@react-pdf-viewer/core"),o=require("./PdfContainer.js"),r=require("./PdfToolbar.js"),n=require("./PdfStyle.js"),a=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var s=require("react"),l=require("../ScannedDocCitation/ScannedDocCitation.js"),u=function(e){switch(e){case"ActualSize":return t.SpecialZoomLevel.ActualSize;case"PageFit":return t.SpecialZoomLevel.PageFit;case"PageWidth":return t.SpecialZoomLevel.PageWidth;default:return null!=e?e:t.SpecialZoomLevel.PageWidth}};exports.default=function(c){var d,g=c.pdfUrl,f=c.highlightText,h=c.highlightPages,v=c.highlightCordinatePages,p=c.highlightColor,m=void 0===p?"yellow":p,x=c.activeHighlightColor,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@react-pdf-viewer/core"),o=require("./PdfContainer.js"),r=require("./PdfToolbar.js"),n=require("./PdfStyle.js"),a=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var s=require("react"),l=require("../ScannedDocCitation/ScannedDocCitation.js"),u=function(e){switch(e){case"ActualSize":return t.SpecialZoomLevel.ActualSize;case"PageFit":return t.SpecialZoomLevel.PageFit;case"PageWidth":return t.SpecialZoomLevel.PageWidth;default:return null!=e?e:t.SpecialZoomLevel.PageWidth}};exports.default=function(c){var d,g=c.pdfUrl,f=c.highlightText,h=c.highlightPages,v=c.highlightCordinatePages,p=c.highlightColor,m=void 0===p?"yellow":p,x=c.activeHighlightColor,S=void 0===x?"#f7dc51":x,C=c.jumpToPageValue,P=void 0===C?0:C,_=c.pdfName,w=c.onClose,T=c.customStyles,y=c.customClasses,b=c.customIcons,A=c.useCoordinates,q=c.fallbackPages,j=c.activeCitationIndex,H=c.onActiveCitationChange,I=c.headerAction,F=c.isZoomEnabled,Z=void 0===F||F,L=c.showHighlightsAction,z=void 0===L||L,N=c.defaultScale,R=void 0===N?t.SpecialZoomLevel.ActualSize:N,E=c.useRange,V=void 0!==E&&E,W=c.rangeOfPages,D=void 0===W?null:W,O=c.showFullScreenAction,B=void 0===O||O,U=s.useRef(null),k=s.useMemo(function(){if(A)return new Set(v.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(h).forEach(function(i){i>0&&e.add(i-1)}),e},[h]),M=(d=f)&&0!==d.length?d.filter(function(e){return!d.some(function(i){return i!==e&&i.includes(e)})}):d,J=a.PdfHighlightControls(M,A?{}:h,U,k,A,A?v:[],m,S),K=J.highlightIndex,G=J.cursorIndex,Q=J.setCursorIndex,X=J.orderedKeys,Y=J.totalHighlights,$=J.getValidPosition,ee=J.tryJump,ie=J.jumpToPage,te=J.zoomTo,oe=J.plugins,re=J.controls,ne=J.hideNonTargetHighlights,ae=J.deduplicateHighlights,se=$(G);s.useEffect(function(){void 0!==j&&j!==G&&Q(j)},[j]);var le=e.__assign(e.__assign({},re),{goToNext:function(){re.goToNext(),H&&H(G+1)},goToPrevious:function(){re.goToPrevious(),H&&H(G-1)}});if(!g)return i.jsx(l.default,{pages:q,activeCitationIndex:j,onActiveCitationChange:H,headerAction:I});return i.jsxs("div",e.__assign({ref:U,className:(null==y?void 0:y.pdfViewerWrapper)||"",style:e.__assign(e.__assign(e.__assign({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},n.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==T?void 0:T.pdfViewer)},{children:[i.jsx(r.default,{highlightIndex:K,totalHighlights:Y,controls:le,currentPosition:se,pdfName:_,onClose:w,pdfUrl:g,viewerRef:U,customStyles:T,customClasses:y,customIcons:b,headerAction:I,isZoomEnabled:Z,showHighlightsAction:z,showFullScreenAction:B}),i.jsx(o.default,{defaultScale:u(R),pdfUrl:g,plugins:oe,customStyles:T,onLoad:function(){if(te(t.SpecialZoomLevel.ActualSize),P>0&&!V){var i=P-1,o=X[i],r=h[o],n=v[i];Q(i),console.log(n,"cordinateTargetHighlight"),A&&n.pageIndex>0&&ie(n.pageIndex),r>0&&(setTimeout(function(){ne(k),ae(r-1)},1e3),A||ie(r-1))}else if(V&&D&&2===D.length){e.__awaiter(void 0,void 0,void 0,function(){var i,t,o,r,n;return e.__generator(this,function(e){switch(e.label){case 0:i=D[0],t=D[1],o=i,e.label=1;case 1:return o<=t?(ie(r=o-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(e.sent(),ne(k),(n=ae(r))&&n>0)return[3,4];e.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}else if(!A&&h){var a=X.find(function(e){return h[e]>0});if(void 0!==a){var s=h[a]-1;ie(s),setTimeout(function(){ne(k),ae(s)},1e3)}}requestAnimationFrame(function(){ee(),A||function(){if(U.current){var e=P-1,i=X[e],t=h[i],o=t>0?t-1:0,r={};X.forEach(function(e,i){var t=h[e];t>0&&(r[t]||(r[t]=[]),r[t].push(i))});var n=(r[t]||[]).indexOf(e),a=0,s=function(){var e,i;if(!(++a>40)){var t=null===(e=U.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(t){var r=null===(i=U.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(o,'"]'));if(r){var l=t.getBoundingClientRect(),u=r.getBoundingClientRect();if(u.top<l.bottom&&u.bottom>l.top){var c=r.querySelectorAll(".rpv-search__highlight")[n];if(c){var d=c.getBoundingClientRect(),g=t.scrollTop+(d.top-l.top)-t.clientHeight/2+d.height/2;t.scrollTo({top:g,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 i=e.currentPage;k.has(i)?(ae(i),ne(k)):ne(k)}})]}))};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import{ChevronUp as l,ChevronDown as t}from"lucide-react";import{useState as o,useRef as r,useEffect as d}from"react";import a from"./ResizableSplitPane.js";import u from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as s,DefaultFullScreenIcon as c}from"../../assests/svg/PdfViewerIcons.js";var g=function(g){var v,p,h,f=g.href,m=g.children,x=g.metaData,b=g.chevronUpComponent,_=void 0===b?null:b,y=g.chevronDownComponent,C=void 0===y?null:y,w=g.customStyle,F=void 0===w?{}:w,P=g.defaultState,S=o(void 0!==P&&P),D=S[0],E=S[1],j=o(!1),k=j[0],z=j[1],R=r(null),A="string"==typeof m&&(null===(v=null==m?void 0:m.split("\n"))||void 0===v?void 0:v.length)>1?m.split("\n").join(" "):m,I="string"==typeof m?m:m[0],T=null!=_?_:function(e){var n,t;return i(l,{size:null!==(n=null==e?void 0:e.fontSize)&&void 0!==n?n:16,color:null!==(t=null==e?void 0:e.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(p=null==F?void 0:F.arrow)&&void 0!==p?p:{}),V=null!=C?C:function(e){var n,l;return i(t,{size:null!==(n=null==e?void 0:e.fontSize)&&void 0!==n?n:16,color:null!==(l=null==e?void 0:e.color)&&void 0!==l?l:"rgb(214, 51, 132)"})}(null!==(h=null==F?void 0:F.arrow)&&void 0!==h?h:{}),W=["contract","clause"];d(function(){var e=function(){z(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),function(){return document.removeEventListener("fullscreenchange",e)}},[]);return n("span",e({style:e({display:"inline"},F.relativeWrapper||{})},{children:[i("div",e({style:e({display:"inline",marginTop:0},F.citationButtonWrapper||{})},{children:n("button",e({type:"button",onClick:function(){return E(function(e){return!e})},style:e({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},F.citationButton||{})},{children:[i("span",{children:A}),i("span",e({style:{display:"flex",alignItems:"center"}},{children:D?T:V}))]}))})),D&&n("div",e({ref:R,style:e({boxSizing:"border-box",border:k?"none":"1px solid #E4E7EC",borderRadius:k?"0":"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%",height:k?"100vh":"auto"},k?{position:"fixed",inset:0,zIndex:99999,backgroundColor:"#FAFAFA"}:{})},{children:[i("div",e({style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:i("button",e({onClick:function(){var e=R.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Fullscreen error: ".concat(e.message))}))},title:k?"Exit fullscreen":"Fullscreen",style:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:i(k?s:c,{})}))})),i("div",e({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:i(function(){var n,l,t,o,r,d,s,c,g,v,p;console.log("citation details ->","href ->",f,"children ->",m,"metaData ->",x,"citationDisplayTitle ->",A);var h=function(e){try{return new URL(e,window.location.origin).searchParams.get("citationNumber")}catch(e){return null}}(f);if(!h)return null;var b=(null===(n=null==x?void 0:x.citations)||void 0===n?void 0:n[h])||{},_=(null===(l=null==x?void 0:x.docData)||void 0===l?void 0:l.documents)||{},y=(null===(t=null==x?void 0:x.docData)||void 0===t?void 0:t.input_index_map)||{},C=null==y?void 0:y[0],w=null==y?void 0:y[1],F=C?_[C]:null,P=w?_[w]:null,S=C?b[C]:null,D=w?b[w]:null;if(W.includes(I)){console.log("leftDocument",F,"rightDocument",P),console.log("leftCitation",S,"rightCitation",D);var E=S?i(u,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:F.title,pdfUrl:F.signed_url,highlightText:[null!==(o=null==S?void 0:S.highlighted_text)&&void 0!==o?o:""],highlightPages:{1:null===(r=null==S?void 0:S.custom_metadata)||void 0===r?void 0:r.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(d=null==S?void 0:S.custom_metadata)||void 0===d?void 0:d.pdf_start_page_number,null===(s=null==S?void 0:S.custom_metadata)||void 0===s?void 0:s.pdf_end_page_number]}):null,j=D?i(u,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:P.title,pdfUrl:P.signed_url,jumpToPageValue:1,highlightText:[null!==(c=null==D?void 0:D.highlighted_text)&&void 0!==c?c:""],highlightPages:{1:null===(g=null==D?void 0:D.custom_metadata)||void 0===g?void 0:g.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(v=null==D?void 0:D.custom_metadata)||void 0===v?void 0:v.pdf_start_page_number,null===(p=null==D?void 0:D.custom_metadata)||void 0===p?void 0:p.pdf_end_page_number]}):null;return i("div",S||D?e({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:i(a,{leftComponent:E,rightComponent:j,isFullscreen:k})}):{children:"Missing PDF Citation. Please try again later"})}return i("div",{children:"No Citation Found. Please try again later"})},{})}))]}))]}))};export{g as default};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{useState as o,useRef as r,useMemo as l,useEffect as c,useCallback as u}from"react";import{Box as d,Snackbar as a,Alert as s,Tooltip as v,Typography as p}from"@mui/material";import{ChevronDown as f,EllipsisVertical as h}from"lucide-react";import{ButtonCognitiveIcon as g}from"../../assests/svg/ButtonCognitiveIcon.js";import x from"./OverlayComponent.js";import{safeStringify as m,extractDeviationScore as y,generateColorPalette as b,DEVIATION_BADGE_SEPARATOR as S,hasValue as R,getBentArrowPath as C,smoothScrollTo as I}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as B,DEFAULT_FIELD_CONFIG as w,DEFAULT_COMPARISON_CONFIG as T}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as F,DEFAULT_COMPONENT_HEADER_TEXT as E}from"./CognitiveCompareConstants.js";import k from"./CognitivePopup.js";import M from"./MoreFunctionsPopup.js";import D from"./LoaderComponent.js";import _ from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as H}from"./hooks/useCompareData.js";import{useComparePopups as A}from"./hooks/useComparePopups.js";import{useSectionRefs as L}from"./hooks/useSectionRefs.js";import{useAccordionState as O}from"./hooks/useAccordionState.js";import{useDeviationNavigation as P}from"./hooks/useDeviationNavigation.js";import j from"./components/CompareHeader.js";import N from"./components/SectionAccordion.js";import z from"./components/SubSectionAccordion.js";import W from"./components/CognitiveSummaryPopup.js";var Y=function(Y){var K,X,V,q,J,U,G,Q,Z,$,ee,ne,te,ie,oe,re=Y.componentHeaderText,le=void 0===re?E:re,ce=Y.treeData,ue=Y.comparisonConfig,de=Y.leftColumnTitleText,ae=Y.rightColumnTitleText,se=Y.markdownStyles,ve=Y.displayConfig,pe=void 0===ve?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:ve,fe=Y.popupConfig,he=Y.deviationData,ge=void 0===he?{}:he,xe=Y.deviationNodeIdToView,me=o(pe.maintainRelativeOrder),ye=me[0],be=me[1],Se=o(!1),Re=Se[0],Ce=Se[1],Ie=o(!1),Be=Ie[0],we=Ie[1],Te=o(null),Fe=Te[0],Ee=Te[1],ke=o(!1),Me=ke[0],De=ke[1],_e=o(!1),He=_e[0],Ae=_e[1],Le=o(null),Oe=Le[0],Pe=Le[1],je=r(!1),Ne=o(new Set),ze=Ne[0],We=Ne[1],Ye=o([]),Ke=Ye[0],Xe=Ye[1],Ve=r(null),qe=r(!1),Je=r(null),Ue=r({}),Ge=r([]),Qe=r(!1),Ze=r(!1),$e=r(null),en=r(function(){}),nn=l(function(){return(null==ce?void 0:ce.cognitive_decisioning)||{}},[ce]),tn=o({width:0,height:0}),on=tn[0],rn=tn[1],ln=l(function(){return e(e({},B),se)},[se]),cn=r(null),un=r(null),dn=r(null),an=r(null),sn=r(null),vn=r(null),pn=r(null),fn=r(null),hn=r(!1),gn=A(cn),xn=gn.cognitivePopup,mn=gn.setCognitivePopup,yn=gn.moreFunctions,bn=gn.setMoreFunctions,Sn=gn.position,Rn=gn.setPosition,Cn=gn.activeBadgeId,In=gn.summaryPopup,Bn=gn.setSummaryPopup,wn=gn.closeSummaryPopup,Tn=gn.setActiveBadgeId,Fn=gn.popupRef,En=gn.closeCognitivePopup,kn=gn.closeMoreFunctionsPopup,Mn=l(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==ue?void 0:ue.fields)&&void 0!==e?e:w,thresholds:{high:null!==(t=null===(n=null==ue?void 0:ue.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:T.thresholds.high,medium:null!==(o=null===(i=null==ue?void 0:ue.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:T.thresholds.medium,exact:null!==(l=null===(r=null==ue?void 0:ue.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:T.thresholds.exact}}},[ue]),Dn=o(null),_n=Dn[0];Dn[1];var Hn=null===(V=null===(K=null==ce?void 0:ce.documents)||void 0===K?void 0:K[null===(X=null==ce?void 0:ce.input_index_map)||void 0===X?void 0:X[0]])||void 0===V?void 0:V.title,An=null===(U=null===(q=null==ce?void 0:ce.documents)||void 0===q?void 0:q[null===(J=null==ce?void 0:ce.input_index_map)||void 0===J?void 0:J[1]])||void 0===U?void 0:U.title,Ln=m(de||Hn||"Uploaded Contract"),On=m(ae||An||"Reference Template"),Pn=H(ce,ye,ge,Mn),jn=Pn.activeProposed,Nn=Pn.existingRule,zn=Pn.proposedSections,Wn=Pn.existingSections,Yn=Pn.visibleFields,Kn=Pn.parentDeviationRecord,Xn=Pn.deviationNumberRegistry,Vn=Pn.parseError;c(function(){Vn&&Ee("Failed to load comparison: ".concat(Vn))},[Vn]);var qn=zn.length>0||Wn.length>0,Jn=L(Yn.map(function(e){return e.key}),Math.max(zn.length,Wn.length)),Un=Jn.leftRefs,Gn=Jn.rightRefs,Qn=Jn.sectionLeftRefs,Zn=Jn.sectionRightRefs,$n=Jn.lhsBadgeRefs,et=Jn.rhsBadgeRefs,nt=Jn.sectionRightRowRefs,tt=Jn.subSectionLeftRefs,it=Jn.subSectionRightRefs,ot=Jn.sectionRowRefs,rt=Jn.getSectionRowRef,lt=Jn.getSubSectionRef,ct=Jn.getBadgeRef,ut=Nn.analysis,dt=m(null===(Q=null===(G=null==ut?void 0:ut.rule_difference_comparison)||void 0===G?void 0:G.summary)||void 0===Q?void 0:Q.overall_summary),at=!!dt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),st=null!==(Z=null==ce?void 0:ce.base_root_id)&&void 0!==Z?Z:"-1";null==ce||ce[st];var vt=(null===($=null==ge?void 0:ge[st])||void 0===$?void 0:$.evaluation_result)||(null===(ne=null===(ee=null==ce?void 0:ce.nodes)||void 0===ee?void 0:ee[st])||void 0===ne?void 0:ne.evaluation_result)||null,pt=y(vt),ft=b(null!==(oe=null===(ie=null===(te=null==vt?void 0:vt.evaluation_outputs)||void 0===te?void 0:te.metadata)||void 0===ie?void 0:ie.label_color)&&void 0!==oe?oe:""),ht=u(function(){var e,n,t,i;De(!1),Ze.current=!1;var o=$e.current,r=Ft.current;if(null!==o)if("string"==typeof o&&o.includes(S)){var l=o.split(S);(c=null===(e=tt.current[l[2]])||void 0===e?void 0:e.current)&&(c.style.paddingTop="0px")}else{var c;(c=null===(n=Qn.current[o])||void 0===n?void 0:n.current)&&(c.style.paddingTop="0px")}if(null!==r)if("string"==typeof r&&r.includes(S)){l=r.split(S);(u=null===(t=it.current[l[3]])||void 0===t?void 0:t.current)&&(u.style.paddingTop="0px")}else{var u;(u=null===(i=Zn.current[r])||void 0===i?void 0:i.current)&&(u.style.paddingTop="0px")}Pe(null),$e.current=null,Ft.current=null,Ae(!1),we(!1),an.current&&(an.current.style.height="0px"),sn.current&&(sn.current.style.height="0px"),vn.current&&(vn.current.style.height="0px"),pn.current&&(pn.current.style.height="0px")},[]),gt=O({maintainRelativeOrder:!!ye,proposedSections:zn,existingSections:Wn,activeSideBySideSection:Oe,connectedSections:ze,resetSideBySide:ht,setConnectedSections:We,setConnectedLines:Xe,cachedConnectedPositions:Ge,svgContainerRef:Ve,isAnimatingRef:qe,animationTimerRef:Je,calculateLinesRef:en,sectionLeftRefs:Qn,sectionRightRefs:Zn,subSectionLeftRefs:tt,subSectionRightRefs:it}),xt=gt.expandedSections,mt=gt.expandedSubSections,yt=gt.setExpandedSubSections,bt=gt.toggleSection,St=u(function(e,n,t,i,o,r,l){var c,u,d,a=m(null==n?void 0:n.id)||m(null==t?void 0:t.id)||"",s=(a?nn[a]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:a,decisioning:[],gap:[],relevance_score:0},v=null!==(u=null===(c=ot.current[i])||void 0===c?void 0:c.current)&&void 0!==u?u:null;return{isLoading:null!==(d=null==pe?void 0:pe.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==n?void 0:n.displayTitle)?null==n?void 0:n.title:"no title",refSectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",cognitiveData:s,anchorEl:e,sectionAnchorEl:v,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==ce?void 0:ce.documents,input_index_map:null==ce?void 0:ce.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[nn,ce]),Rt=u(function(e){kn(),Rn(null),mn(e)},[kn]),Ct=function(e,n,t,i,o,r){e.stopPropagation(),yn.open&&yn.sectionIdx===o?kn():(En(),bn(St(e.currentTarget,n,i,o,t,r)))},It=u(function(){null!==yn.sectionIdx&&yn.anchorEl?Rt(e(e({},yn),{open:!0})):kn()},[yn,kn,Rt]),Bt=u(function(){var e=yn.sectionIdx,n=yn.isOrphan,t=null!==e&&ze.has(e);kn(),null!==e&&(n?Ee("No counterpart exists to connect to."):(Ze.current&&ht(),t&&(Xe([]),Ge.current=[]),We(function(n){return n.has(e)?new Set:new Set([e])})))},[yn.sectionIdx,kn,ht]),wt=r(null),Tt=r(null),Ft=r(null),Et=r(null),kt=r(null),Mt=r(null),Dt=o([]),_t=Dt[0],Ht=Dt[1];r(null);var At=o(null),Lt=At[0],Ot=At[1];c(function(){if(_n){var e=Mn.fields.find(function(e){return e.analysisKey===_n||e.key===_n});if(e){var n=Un.current[e.key]||Gn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_n,Mn.fields]);var Pt=u(function(e){var n,t,i,o,r,l,c,u,d,a=null===(n=null==ut?void 0:ut.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!a||!a[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=a[e],v=(null==s?void 0:s.relation)||(null===(i=null===(t=null==s?void 0:s.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(r=null===(o=null==s?void 0:s.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var p=s.mappings[0]||{};return{score:s.score,relation:p.relation||"",highlightsA:(null===(l=p.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=p.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(u=s.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(d=s.highlights)||void 0===d?void 0:d.ruleB_spans)||[],hasContent:!!v}},[ut]),jt=u(function(n,t){var i,o,r,l,c,u,d;void 0===t&&(t="left");var a=null,s=null;if("left"===t)if(a=zn[n],ye&&a){var v=Wn.filter(function(e){var n;return null===(n=a.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});s=v.find(function(e){return e.evaluationResult})||v[0]}else s=Wn[n];else if(s=Wn[n],ye&&s){var p=zn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(s.selfIndex)});a=p.find(function(e){return e.evaluationResult})||p[0]}else a=zn[n];var f=(null==a?void 0:a.relation)&&"not_defined"!==a.relation,h=(null==s?void 0:s.relation)&&"not_defined"!==s.relation,g=!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData));if(!f&&!h&&!g)return e(e({},b(F)),{label:"Not Defined"});var x=null!==(o=null!==(i=null==a?void 0:a.evaluationResult)&&void 0!==i?i:null==s?void 0:s.evaluationResult)&&void 0!==o?o:null,m=null===(r=null==x?void 0:x.evaluation_outputs)||void 0===r?void 0:r.output_value,y=null!==(u=null===(c=null===(l=null==x?void 0:x.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===c?void 0:c.label_color)&&void 0!==u?u:F;return e(e({},b(y)),null!=x?{label:null!==(d=m)&&void 0!==d?d:""}:{label:null})},[zn,Wn,nn,Mn,ye]),Nt=u(function(n){for(var t,i,o,r,l,c,u,d,a,s=n.split("-").map(Number),v=zn[s[0]],p=Wn[s[0]],f=1;f<s.length;f++)(null==v?void 0:v.subsections)&&(v=v.subsections[s[f]]),(null==p?void 0:p.subsections)&&(p=p.subsections[s[f]]);if(!v&&!p)return null;var h=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,g=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,x=m(null==v?void 0:v.id)||m(null==p?void 0:p.id)||"",y=!(!(null==v?void 0:v.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!h&&!g&&!y)return e(e({},b(F)),{label:"Not Defined"});null!==(i=null!==(t=null==v?void 0:v.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||x&&(null===(o=nn[x])||void 0===o||o.relevance_score);var S=null!==(l=null!==(r=null==v?void 0:v.evaluationResult)&&void 0!==r?r:null==p?void 0:p.evaluationResult)&&void 0!==l?l:null,R=null===(c=null==S?void 0:S.evaluation_outputs)||void 0===c?void 0:c.output_value,C=null!==(a=null===(d=null===(u=null==S?void 0:S.evaluation_outputs)||void 0===u?void 0:u.metadata)||void 0===d?void 0:d.label_color)&&void 0!==a?a:F;return e(e({},b(C)),null!=S?{label:null!=R?R:""}:{label:null})},[zn,Wn,nn,Mn]),zt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f,h,g,x,m,y,b,I;if(!hn.current&&!qe.current){hn.current=!0;try{if(!wt.current)return;var B=function(e){var n=e.split("-"),t=n[0];if(!xt[t]&&!1===ye)return!1;if(ye&&!xt["left-".concat(t)]&&!xt["right-".concat(t)]&&!xt[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!mt[i])return!1;return!0},w=wt.current.getBoundingClientRect();rn({width:w.width,height:w.height});var T=[];if(Yn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Gn.current[i])||void 0===t?void 0:t.current;o&&r&&(o.style.height="auto",r.style.height="auto",o.style.minHeight="0px",r.style.minHeight="0px")}),!qe.current){for(var F=0;F<Math.max(zn.length,Wn.length);F++){var E=null===(e=Qn.current[F])||void 0===e?void 0:e.current,k=null===(n=Zn.current[F])||void 0===n?void 0:n.current;E&&(E.style.height="auto",E.style.minHeight="0px"),k&&(k.style.height="auto",k.style.minHeight="0px")}ye||Object.keys(tt.current).forEach(function(e){var n,t;if(B(e)){var i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.current[e])||void 0===t?void 0:t.current;i&&o&&(i.style.height="auto",o.style.height="auto",i.style.minHeight="0px",o.style.minHeight="0px")}})}var M={};Yn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Gn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect();M[i]=Math.max(l.height,c.height)}});var D={left:{},right:{}},_={};if(!qe.current)if(ye){if(Me&&null!==Oe)if("number"==typeof Oe){var H=Oe,A=zn[H],L=null===(o=Qn.current[H])||void 0===o?void 0:o.current;L&&A&&(A.refIndexes||[]).forEach(function(e){var n,t=Wn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=Zn.current[t])||void 0===n?void 0:n.current;if(i&&(xt["left-".concat(H)]||xt["right-".concat(t)])){var o=Math.max(L.getBoundingClientRect().height,i.getBoundingClientRect().height);D.left[H]=Math.max(D.left[H]||0,o),D.right[t]=Math.max(D.right[t]||0,o)}})}else{var O=Oe.split(S)[2];if(O){E=null===(r=tt.current[O])||void 0===r?void 0:r.current,k=null===(l=it.current[O])||void 0===l?void 0:l.current;if(E&&k){P=Math.max(E.getBoundingClientRect().height,k.getBoundingClientRect().height);_[O]=Math.max(_[O]||0,P)}}}}else{Object.keys(tt.current).forEach(function(e){var n,t;if(B(e)){var i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.current[e])||void 0===t?void 0:t.current;if(i&&o&&null!==i.offsetParent&&null!==o.offsetParent){var r=i.getBoundingClientRect(),l=o.getBoundingClientRect(),c=Math.max(r.height,l.height);_[e]=c,i.style.minHeight="".concat(c,"px"),o.style.minHeight="".concat(c,"px")}}});for(F=0;F<Math.min(zn.length,Wn.length);F++){var E=null===(t=Qn.current[F])||void 0===t?void 0:t.current,k=null===(i=Zn.current[F])||void 0===i?void 0:i.current;if(E&&k){var P=Math.max(E.getBoundingClientRect().height,k.getBoundingClientRect().height);D.left[F]=P,D.right[F]=P}}}if(Yn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Gn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=M[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),qe.current||(Object.entries(D.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Qn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(D.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Zn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),ye||Object.keys(_).forEach(function(e){var n,t,i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.current[e])||void 0===t?void 0:t.current;if(i&&o&&_[e]){var r=_[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),ye)zn.forEach(function(e,n){var t;(null===(t=Qn.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,r,l,c,u,d,a,s,v=Wn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var p=null===(t=$n.current[n])||void 0===t?void 0:t.current,f=null===(i=et.current[v])||void 0===i?void 0:i.current;if(p&&f){var h=p.getBoundingClientRect(),g=f.getBoundingClientRect(),x=h.right-w.left,m=g.left-w.left,y=h.top+h.height/2-w.top,b=g.top+g.height/2-w.top;if(Me&&Oe===n){var S=null!==(r=null===(o=fn.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,R=null!==(c=null===(l=dn.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,C=S+(null!==(d=null===(u=fn.current)||void 0===u?void 0:u.clientHeight)&&void 0!==d?d:1/0),I=R+(null!==(s=null===(a=dn.current)||void 0===a?void 0:a.clientHeight)&&void 0!==s?s:1/0),B=h.top+h.height/2,F=function(e,n,t){return Math.max(n,Math.min(t,e))};y=F(B,S,C)-w.top,b=F(B,R,I)-w.top}var E=jt(n);E&&T.push({id:"line-".concat(n,"-").concat(v),x1:x,y1:y,x2:m,y2:b,style:E,sectionIdx:n,targetRightIdx:v})}}})});else{for(F=0;F<Math.min(zn.length,Wn.length);F++){var j=null===(c=Qn.current[F])||void 0===c?void 0:c.current,N=null===(u=Zn.current[F])||void 0===u?void 0:u.current;if(j&&N){var z=j.getBoundingClientRect(),W=N.getBoundingClientRect(),Y=Math.max(z.top,W.top)+18-w.top,K=(null===(d=Wn[F])||void 0===d?void 0:d.id)||"sec-".concat(F);(Z=jt(F))&&T.push({id:K,x1:z.right-w.left,y1:Y,x2:W.left-w.left,y2:Y,style:Z,sectionIdx:F,hasCognitive:!!((null===(a=zn[F])||void 0===a?void 0:a.cognitiveData)||(null===(s=Wn[F])||void 0===s?void 0:s.cognitiveData)||K&&nn[K]),isSubSection:!1})}}Object.keys(tt.current).forEach(function(e){var n,t,i,o,r,l;if(B(e)){var c=null===(n=tt.current[e])||void 0===n?void 0:n.current,u=null===(t=it.current[e])||void 0===t?void 0:t.current;if(c&&u){for(var d=e.split("-").map(Number),a=zn[d[0]],s=Wn[d[0]],v=1;v<d.length;v++)(null==a?void 0:a.subsections)&&(a=a.subsections[d[v]]),(null==s?void 0:s.subsections)&&(s=s.subsections[d[v]]);var p=!!a&&((null===(i=a.displayTitle)||void 0===i||i)&&R(a.title)),f=!!a&&((null===(o=a.displayContent)||void 0===o||o)&&R(a.content)),h=!!s&&((null===(r=s.displayTitle)||void 0===r||r)&&R(s.title)),g=!!s&&((null===(l=s.displayContent)||void 0===l||l)&&R(s.content));if(p&&f||h&&g){var x=c.getBoundingClientRect(),m=u.getBoundingClientRect(),y=Math.max(x.top,m.top)+16-w.top,b=Nt(e);b&&"Not Defined"!==b.label&&T.push({id:"subsec-".concat(e),x1:x.right-w.left,y1:y,x2:m.left-w.left,y2:y,style:b,sectionIdx:d[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData))})}}}})}if(Me&&"string"==typeof Oe&&Oe.includes(S)){var X=Oe.split(S),V=X[0],q=X[1],J=X[2],U=(X[3],"".concat(V).concat(S).concat(q)),G=null===(v=$n.current[U])||void 0===v?void 0:v.current,Q=null===(p=et.current[U])||void 0===p?void 0:p.current;if(G&&Q){var Z,$=G.getBoundingClientRect(),ee=Q.getBoundingClientRect(),ne=$.right-w.left,te=ee.left-w.left,ie=$.top+$.height/2-w.top,oe=ee.top+ee.height/2-w.top;if(ye){var re=null!==(h=null===(f=fn.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==h?h:0,le=null!==(x=null===(g=dn.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==x?x:0,ce=re+(null!==(y=null===(m=fn.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ue=le+(null!==(I=null===(b=dn.current)||void 0===b?void 0:b.clientHeight)&&void 0!==I?I:1/0),de=function(e,n,t){return Math.max(n,Math.min(t,e))};ie=de($.top+$.height/2,re,ce)-w.top,oe=de(ee.top+ee.height/2,le,ue)-w.top}(Z=Nt(J))&&T.push({id:"line-subsec-".concat(U),x1:ne,y1:ie,x2:te,y2:oe,style:Z,sectionIdx:Number(J.split("-")[0]),isSubSection:!0,subSectionKeyPath:Oe})}}if(Ht(T),kt.current&&Mt.current){var ae=kt.current.getBoundingClientRect(),se=Mt.current.getBoundingClientRect(),ve=(ae.top+ae.height/2-w.top+se.top+se.height/2-w.top)/2;Ot({x1:ae.right-w.left,x2:se.left-w.left,y:ve})}else Ot(null);if(ze.size>0){var pe=[],fe=fn.current,he=dn.current;if(fe&&he){var ge=[],xe=fe.getBoundingClientRect().top,me=he.getBoundingClientRect().top,be=xe+fe.clientHeight,Se=me+he.clientHeight,Re=fe.scrollTop,Ce=he.scrollTop,Ie=w.top,Be=function(e,n,t){return Math.max(n,Math.min(t,e))};ze.forEach(function(e){var n,t,i,o,r;if("string"==typeof e&&e.includes(S)){var l=e.split(S),c=l[0],u=l[1],d=l[2],a=(l[3],"".concat(c).concat(S).concat(u)),s=null===(n=$n.current[a])||void 0===n?void 0:n.current,v=null===(t=et.current[a])||void 0===t?void 0:t.current;if(!s||!v)return;var p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),h=Nt(d),g=(A=p.right-w.left)+.5*((L=f.left-w.left-0)-A),x=p.top+p.height/2,m=f.top+f.height/2,y=x-xe+Re,b=m-me+Ce,R="conn-subsec-".concat(a);ge.push({lhsScrollY:y,rhsScrollY:b,x1:A,x2:L,containerTop:Ie,leftIdx:e,rhsArrayIdx:e,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:R});var I=Be(x,xe,be),B=Be(m,me,Se),T=I-Ie,F=B-Ie,E=m>=me-4&&m<=Se+4,k="";k=(O=x>=xe-4&&x<=be+4)&&E?C(A,T,L,F):O&&!E?"M ".concat(A,",").concat(T," L ").concat(g,",").concat(T," L ").concat(g,",").concat(F):!O&&E?"M ".concat(g,",").concat(T," L ").concat(g,",").concat(F," L ").concat(L,",").concat(F):"M ".concat(g,",").concat(T," L ").concat(g,",").concat(F),pe.push({id:R,pathD:k,style:h,leftIdx:e,rhsArrayIdx:e})}else if(ye){var M=e,D=zn[M];if(!(null===(r=null==D?void 0:D.refIndexes)||void 0===r?void 0:r.length))return;D.refIndexes.forEach(function(e){var n,t,i=Wn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=$n.current[M])||void 0===n?void 0:n.current,r=null===(t=et.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),u=jt(M),d=l.right-w.left,a=c.left-w.left-0,s=d+.5*(a-d),v=l.top+l.height/2,p=c.top+c.height/2,f=v-xe+Re,h=p-me+Ce,g="conn-".concat(M,"-").concat(i);ge.push({lhsScrollY:f,rhsScrollY:h,x1:d,x2:a,containerTop:Ie,leftIdx:M,rhsArrayIdx:i,styleColor:(null==u?void 0:u.badgeBorder)||"#6366F1",styleId:g});var x=Be(v,xe,be),m=Be(p,me,Se),y=x-Ie,b=m-Ie,S=v>=xe-4&&v<=be+4,R=p>=me-4&&p<=Se+4,I="";I=S&&R?C(d,y,a,b):S&&!R?"M ".concat(d,",").concat(y," L ").concat(s,",").concat(y," L ").concat(s,",").concat(b):!S&&R?"M ".concat(s,",").concat(y," L ").concat(s,",").concat(b," L ").concat(a,",").concat(b):"M ".concat(s,",").concat(y," L ").concat(s,",").concat(b),pe.push({id:g,pathD:I,style:u,leftIdx:M,rhsArrayIdx:i})}}})}else{var _=e,H=_;s=null===(i=$n.current[_])||void 0===i?void 0:i.current,v=null===(o=et.current[H])||void 0===o?void 0:o.current;if(!s||!v)return;var A,L;p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),h=jt(_),g=(A=p.right-w.left)+.5*((L=f.left-w.left-0)-A),x=p.top+p.height/2,m=f.top+f.height/2,y=x-xe+Re,b=m-me+Ce,R="conn-".concat(_,"-").concat(H);ge.push({lhsScrollY:y,rhsScrollY:b,x1:A,x2:L,containerTop:Ie,leftIdx:_,rhsArrayIdx:H,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:R});var O;I=Be(x,xe,be),B=Be(m,me,Se),T=I-Ie,F=B-Ie,E=m>=me-4&&m<=Se+4,k="";k=(O=x>=xe-4&&x<=be+4)&&E?C(A,T,L,F):O&&!E?"M ".concat(A,",").concat(T," L ").concat(g,",").concat(T," L ").concat(g,",").concat(F):!O&&E?"M ".concat(g,",").concat(T," L ").concat(g,",").concat(F," L ").concat(L,",").concat(F):"M ".concat(g,",").concat(T," L ").concat(g,",").concat(F),pe.push({id:R,pathD:k,style:h,leftIdx:_,rhsArrayIdx:H})}}),Ge.current=ge}Xe(pe)}else Xe([]),Ge.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{hn.current=!1}}},[Yn,zn,Wn,nn,Mn,Pt,jt,ye,Me,Oe,ze,xt,mt]),Wt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f=Ge.current;if(f.length&&!qe.current){var h=null!==(n=null===(e=fn.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,g=null!==(i=null===(t=dn.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,x=null!==(r=null===(o=fn.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=dn.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(d=null===(u=fn.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==d?d:0,b=null!==(s=null===(a=dn.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,R=b+m,I=null!==(p=null===(v=wt.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==p?p:0,B=function(e,n,t){return Math.max(n,Math.min(t,e))};f.forEach(function(e){var n=e.lhsScrollY-h+y,t=e.rhsScrollY-g+b,i=Ue.current[e.styleId+"-stroke"],o=Ue.current[e.styleId+"-bg"];if(i||o){var r,l=B(n,y,S),c=B(t,b,R),u=l-I,d=c-I,a=n>=y-4&&n<=S+4,s=t>=b-4&&t<=R+4,v=e.x1+.5*(e.x2-e.x1);r=a&&s?C(e.x1,u,e.x2,d):a&&!s?"M ".concat(e.x1,",").concat(u," L ").concat(v,",").concat(u," L ").concat(v,",").concat(d):!a&&s?"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d," L ").concat(e.x2,",").concat(d):"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);c(function(){en.current=zt},[zt]);var Yt=r(null),Kt=u(function(){Ge.current.length>0&&!qe.current||(null!==Yt.current&&clearTimeout(Yt.current),Yt.current=setTimeout(function(){en.current(),Yt.current=null},50))},[]),Xt=u(function(){null!==Yt.current&&clearTimeout(Yt.current),Yt.current=setTimeout(function(){Ge.current=[],en.current(),Yt.current=null},100)},[]),Vt=u(function(e){var n,t,i,o,r,l,c,u,d,a;if(!je.current){if(ye||Kt(),Ze.current){var s=$e.current,v=Ft.current,p=fn.current,f=dn.current;if(null!==s&&null!==v&&p&&f){var h="string"==typeof s&&s.includes(S)?null===(n=$n.current["".concat(s.split(S)[0]).concat(S).concat(s.split(S)[1])])||void 0===n?void 0:n.current:null===(t=ot.current[s])||void 0===t?void 0:t.current,g="string"==typeof v&&v.includes(S)?null===(i=et.current["".concat(v.split(S)[0]).concat(S).concat(v.split(S)[1])])||void 0===i?void 0:i.current:null===(o=nt.current[v])||void 0===o?void 0:o.current;if(h&&g){var x=h.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop,m=g.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;if(e.currentTarget===p){var y=m-(x-p.scrollTop),b=f.scrollHeight-f.clientHeight,R=Math.max(0,Math.min(y,b));Math.abs(f.scrollTop-R)>1&&(f.scrollTop=R)}else if(e.currentTarget===f){var C=x-(m-f.scrollTop),I=p.scrollHeight-p.clientHeight,B=Math.max(0,Math.min(C,I));Math.abs(p.scrollTop-B)>1&&(p.scrollTop=B)}if(Et.current){var w=void 0,T=void 0;if("string"==typeof s&&s.includes(S)){var F=s.split(S),E="".concat(F[0]).concat(S).concat(F[1]);w=null===(r=$n.current[E])||void 0===r?void 0:r.current,T=null===(l=et.current[E])||void 0===l?void 0:l.current}else w=null===(c=$n.current[s])||void 0===c?void 0:c.current,T=null===(u=et.current[v])||void 0===u?void 0:u.current;var k=null!==(a=null===(d=wt.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==a?a:0,M=p.getBoundingClientRect().top,D=M+p.clientHeight,_=f.getBoundingClientRect().top,H=_+f.clientHeight,A=function(e,n,t){return Math.max(n,Math.min(t,e))};if(w&&T){var L=w.getBoundingClientRect(),O=T.getBoundingClientRect(),P=L.top+L.height/2,j=O.top+O.height/2,N=A(P,M,D),z=A(j,_,H);Et.current.setAttribute("y1",(N-k).toString()),Et.current.setAttribute("y2",(z-k).toString());var W=P>=M-4&&P<=D+4;Et.current.setAttribute("visibility",W?"visible":"hidden")}}}}}Ge.current.length>0&&!Qe.current&&(Qe.current=!0,requestAnimationFrame(function(){Wt(),Qe.current=!1}))}},[Wt,ye,Kt]);c(function(){var e=setTimeout(Kt,250);window.addEventListener("resize",Xt);var n=null,t=null;return cn.current&&(n=new ResizeObserver(Kt)).observe(cn.current),wt.current&&(t=new ResizeObserver(Kt)).observe(wt.current),function(){clearTimeout(e),window.removeEventListener("resize",Kt),null==n||n.disconnect(),null==t||t.disconnect()}},[jn,Nn,ut,Yn,xt,mt,zn,Wn,Mn,Kt,Xt,Me,Oe,He,ze]),c(function(){Ze.current=Me},[Me]),c(function(){$e.current=Oe},[Oe]);var qt=u(function(e,n,t){var i,o,r,l,c,u=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,d=null==t?void 0:t.onReady;if(kn(),null!=e)if(n)Ee("No counterpart exists for this section.");else if(Me&&Oe===e)u?ht():null==d||d();else{if(!ye){var a=$e.current,s=Ft.current;if(null!==a)if("string"==typeof a&&a.includes(S)){var v=a.split(S);(p=null===(o=tt.current[v[2]])||void 0===o?void 0:o.current)&&(p.style.paddingTop="0px")}else{var p;(p=null===(r=Qn.current[a])||void 0===r?void 0:r.current)&&(p.style.paddingTop="0px")}if(null!==s)if("string"==typeof s&&s.includes(S)){v=s.split(S);(f=null===(l=it.current[v[3]])||void 0===l?void 0:l.current)&&(f.style.paddingTop="0px")}else{var f;(f=null===(c=Zn.current[s])||void 0===c?void 0:c.current)&&(f.style.paddingTop="0px")}}We(new Set),Xe([]),Ge.current=[],we(!0),je.current=!0,Pe(e),$e.current=e,De(!0),Ze.current=!0,Ae(!1),an.current&&(an.current.style.height="0px"),sn.current&&(sn.current.style.height="0px"),vn.current&&(vn.current.style.height="0px"),pn.current&&(pn.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,r,l,c,u,a,s,v=null,p=null,f=null,h=null,g=null;if("string"==typeof e&&e.includes(S)){var x=e.split(S),m="".concat(x[0]).concat(S).concat(x[1]);v=(null===(n=$n.current[m])||void 0===n?void 0:n.current)||null,g=(p=(null===(t=et.current[m])||void 0===t?void 0:t.current)||null)?e:null,f=(null===(i=tt.current[x[2]])||void 0===i?void 0:i.current)||null,h=(null===(o=it.current[x[3]])||void 0===o?void 0:o.current)||null}else if(v=(null===(r=ot.current[e])||void 0===r?void 0:r.current)||null,f=(null===(l=Qn.current[e])||void 0===l?void 0:l.current)||null,ye){var y=zn[e],b=(null==y?void 0:y.refIndexes)||[];if(b.length>0){var R=b[0],C=Wn.findIndex(function(e){return e.selfIndex===R});-1!==C&&(p=(null===(a=nt.current[C])||void 0===a?void 0:a.current)||null,h=(null===(s=Zn.current[C])||void 0===s?void 0:s.current)||null,g=C)}}else p=(null===(c=nt.current[e])||void 0===c?void 0:c.current)||null,h=(null===(u=Zn.current[e])||void 0===u?void 0:u.current)||null,g=p?e:null;Ft.current=g;var B=fn.current,w=dn.current;if(!v||!B)return je.current=!1,we(!1),void(null==d||d());if(!p||!w)return Ae(!0),en.current(),je.current=!1,we(!1),void(null==d||d());if(!ye){var T=v.getBoundingClientRect(),F=p.getBoundingClientRect(),E=T.top-F.top;f&&h&&(f.style.paddingTop="0px",h.style.paddingTop="0px",E>0?h.style.paddingTop="".concat(E,"px"):E<0&&(f.style.paddingTop="".concat(Math.abs(E),"px")));var k=v?v.getBoundingClientRect().top:(null==f?void 0:f.getBoundingClientRect().top)||0,M=cn.current,D=M?M.scrollTop+k-150:0;return M?void I(M,D,200,function(){Ae(!0),en.current(),je.current=!1,we(!1),null==d||d()}):(Ae(!0),en.current(),je.current=!1,we(!1),void(null==d||d()))}var _=v.getBoundingClientRect().top-B.getBoundingClientRect().top+B.scrollTop,H=p.getBoundingClientRect().top-w.getBoundingClientRect().top+w.scrollTop-(_-B.scrollTop);H<0&&an.current&&(an.current.style.height="".concat(Math.abs(H),"px"));requestAnimationFrame(function(){var e,n=w.scrollHeight-w.clientHeight;if(H<0)e=0;else{if(H>n){var t=H-n;return sn.current&&(sn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(w,H,200,function(){Ae(!0),en.current(),je.current=!1,we(!1),null==d||d()})})}e=H}I(w,e,200,function(){Ae(!0),en.current(),je.current=!1,we(!1),null==d||d()})})})}},[Oe,kn,Wn,Me,ye,zn,ht]),Jt=u(function(e,n,t,i){var o="string"==typeof i?m(i).trim():m(null==i?void 0:i.deviation_summary).trim(),r=e.currentTarget;En(),t?o&&Bn({open:!0,anchorEl:r,summary:i}):qt(n,t,o?{toggleIfSame:!1,onReady:function(){Bn({open:!0,anchorEl:r,summary:i})}}:{toggleIfSame:!1})},[qt,En,Bn]),Ut=u(function(){var e=yn.sectionIdx,n=yn.isOrphan;null!=e&&qt(e,n)},[qt,yn.isOrphan,yn.sectionIdx]),Gt=u(function(){wn(),ht()},[wn,ht]),Qt=null!==yn.sectionIdx&&ze.has(yn.sectionIdx),Zt=P({proposedSections:zn,existingSections:Wn,parentDeviationRecord:Kn,expandedSections:xt,maintainRelativeOrder:!!ye,scrollContainerRef:cn,leftContainerRef:fn,lhsBadgeRefs:$n,rhsBadgeRefs:et}),$t=Zt.showDeviationNavigation,ei=Zt.showOpenNodeRef,ni=r(null);c(function(){if(xe&&ni.current!==xe){var e=!1,t=0,i=null,o=150,r=function(e,n){for(var t=function(e,i){if(!e)return null;if(e.id===n)return i;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=t(e.subsections[o],"".concat(i,"-").concat(o));if(r)return r}return null},i=0;i<e.length;i++){var o=t(e[i],String(i));if(o)return o}return null},l=function(){var c,u,d,a;if(!e){var s=null,v=null;for(var p in Kn){var f=Kn[p].find(function(e){return e.id===xe});if(f){s=p,v=f;break}}if(v&&s){var h=zn.findIndex(function(e){return e.id===s});if(!(ye?!!xt["left-".concat(h)]:!!xt[String(h)])&&h>=0)return bt(h,"left"),t+=1,void(i=setTimeout(l,450));var g=r(zn,v.id),x=r(Wn,v.id);if(g&&!x){var m=g.split("-"),y=Number(m[0]);if(ye){var b=null===(u=null===(c=zn[y])||void 0===c?void 0:c.refIndexes)||void 0===u?void 0:u[0],R=Wn.findIndex(function(e){return e.selfIndex===b});-1!==R&&(y=R)}x=n([y],m.slice(1),!0).join("-")}if(g&&x){var C="".concat(v.id).concat(S,"0").concat(S).concat(g).concat(S).concat(x),B="".concat(v.id).concat(S,"0"),w=null===(d=$n.current[B])||void 0===d?void 0:d.current,T=null===(a=et.current[B])||void 0===a?void 0:a.current,F=ye?fn.current:cn.current;if(w&&F){var E=w.getBoundingClientRect();if(0===E.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var k=F.getBoundingClientRect(),M=E.top-k.top+F.scrollTop-k.height/2+E.height/2,D=function(){var e=window.getComputedStyle(w).color;w.style.transition="box-shadow 300ms ease-in-out",w.style.boxShadow="0 0 10px ".concat(e),T&&(T.style.transition="box-shadow 300ms ease-in-out",T.style.boxShadow="0 0 10px ".concat(e)),setTimeout(function(){w&&(w.style.boxShadow=""),T&&(T.style.boxShadow="")},2e3)};ni.current=xe,ye?(F.scrollTo({top:M,behavior:"smooth"}),qt(C,!1,{toggleIfSame:!1}),D()):I(F,M,300,function(){e||(qt(C,!1,{toggleIfSame:!1}),D())})}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}};return i=setTimeout(l,o),function(){e=!0,i&&clearTimeout(i)}}},[xe,Kn,zn,Wn,ye,xt,bt,qt]);var ti=function(e){var n=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,c=void 0===l?"left":l,u=e.parentNodeId;return i(z,{section:n,keyPath:t,depth:r,columnKey:c,parentNodeId:void 0===u?"":u,expandedSubSections:mt,setExpandedSubSections:yt,maintainRelativeOrder:ye||!1,proposedSections:zn,existingSections:Wn,treeData:ce,deviationNumberRegistry:Xn,connectedSections:ze,activeSideBySideSection:Oe,resolvedMarkdownStyles:ln,getSubSectionRef:lt,getSubSectionCompareStyle:Nt,getBadgeRef:ct,openMoreFunctionsPopup:Ct,openSummaryPopup:Jt,resetSideBySide:ht,setConnectedSections:We,setConnectedLines:Xe,cachedConnectedPositions:Ge})};return t(d,e({ref:un,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ye?{}:{overflow:"visible"}),{position:"relative"})},{children:[Re&&i(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:i(D,{})})),In.open&&i(W,{open:In.open,anchorEl:In.anchorEl,containerEl:Tt.current,clipTopEl:kt.current,onClose:Gt,summary:In.summary}),i(M,{open:yn.open,anchorEl:yn.anchorEl,sectionTitle:yn.sectionTitle,referenceSectionTitle:yn.refSectionTitle,onClose:kn,onOpenCognitiveCompare:It,onOpenSideBySide:Ut,onConnect:Bt,isConnected:Qt,isOrphan:yn.isOrphan}),xn.open&&i(k,{open:xn.open,popupRef:Fn,position:Sn,popupConfig:fe,onClose:function(){Rn(null),mn(function(n){return e(e({},n),{open:!1})}),Tn(null)},markdownStyles:se,sectionTitle:xn.sectionTitle,referenceSectionTitle:xn.refSectionTitle,cognitiveData:xn.cognitiveData,anchorEl:xn.anchorEl,sectionAnchorEl:xn.sectionAnchorEl,scrollContainerEl:cn.current,badgeStyle:xn.badgeStyle,docData:xn.docData,deviationData:xn.deviationData,isLoading:xn.isLoading}),i(a,e({open:!!Fe,autoHideDuration:8e3,onClose:function(){return Ee(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(s,e({onClose:function(){return Ee(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Fe}))})),i(j,{componentHeaderText:le,displayConfig:pe,maintainRelativeOrder:ye,onToggleView:function(e){Ce(!0),setTimeout(function(){be(!e),ht(),We(new Set),Xe([]),Ge.current=[],setTimeout(function(){Ce(!1)},400)},50)}}),i(d,e({ref:cn,onScroll:Vt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ye?"hidden":"auto",borderTop:dt&&at?"none":"1.5px solid #EEF0F4"}},{children:i(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ye?{flex:1,minHeight:0}:{})},{children:t(d,e({ref:wt,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ye?{flex:1,overflow:"visible"}:{})},{children:[t("svg",e({ref:Ve,style:{position:"absolute",top:0,left:0,width:on.width||"100%",height:on.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[Lt&&i("g",{children:i("line",{x1:Lt.x1,y1:Lt.y,x2:Lt.x2,y2:Lt.y,stroke:ft.badgeBorder,strokeWidth:"1.5"})}),_t.map(function(n){var o=n.x1+.5*(n.x2-n.x1),r=(n.y1+n.y2)/2;if("Not Defined"===n.style.label&&!n.hasCognitive)return null;if(n.isSubSection?Me&&Oe===n.subSectionKeyPath&&He:Me&&Oe===n.sectionIdx&&He)return t("g",e({style:{transition:"opacity 0.2s"}},{children:[i("defs",{children:i("marker",e({id:"arr-".concat(n.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:i("polygon",{points:"0 0, 7 2.5, 0 5",fill:n.style.badgeBorder||"#6366F1"})}))}),i("line",{ref:Et,x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(n.id,")")})]}),n.id);if(!ye){var l=n.isSubSection?C(n.x1,n.y1,n.x2,n.y2):"M ".concat(n.x1," ").concat(n.y1," L ").concat(n.x2," ").concat(n.y2);return t("g",{children:[i("path",{d:l,fill:"none",stroke:n.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:o-100,y:r-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(d,e({onClick:function(t){if(t.stopPropagation(),xn.open&&Cn===n.id)En();else{var i=zn[n.sectionIdx]||{title:"",content:""},o=Wn[n.sectionIdx]||{title:"",content:""};if(n.isSubSection&&n.subSectionKeyPath){for(var r=n.subSectionKeyPath.split(S)[2].split("-").map(Number),l=zn[r[0]],c=Wn[r[0]],u=(null==l?void 0:l.title)||"",d=(null==c?void 0:c.title)||"",a=1;a<r.length;a++)(null==l?void 0:l.subsections)&&(l=l.subsections[r[a]]),(null==c?void 0:c.subsections)&&(c=c.subsections[r[a]]);l&&(i=e(e({},l),{title:u||l.title})),c&&(o=e(e({},c),{title:d||c.title}))}Tn(n.id),Rt(St(t.currentTarget,i,o,n.sectionIdx,n.style))}},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:600,textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"}},{children:[n.style.badgeText===F&&null==n.style.label?i(_,{color:n.style.badgeText}):0===n.style.label?"Same":n.style.label,i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(g,{})})),i(f,{size:11,style:{transform:xn.open&&Cn===n.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},n.id)}return null}),Ke.map(function(n){var o,r=n.pathD,l=(null===(o=n.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",c="conn-marker-".concat(n.id),u="".concat(n.id,"-bg"),d="".concat(n.id,"-stroke");return t("g",{children:[i("defs",{children:i("clipPath",e({id:"connections-clip"},{children:i("marker",e({id:c,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:i("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),i("path",{ref:function(e){Ue.current[u]=e},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(e){Ue.current[d]=e},d:r,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(c,")")})]},n.id)})]})),t(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ye?{flex:1,overflow:"visible"}:{})},{children:[i(d,e({ref:kt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:i(v,e({title:Ln,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ln}))}))})),t(d,e({ref:fn,onScroll:Vt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:vn,style:{width:"100%",height:"0px",flexShrink:0}}),qn&&zn.map(function(n,o){var r,l,c=!n.title&&!n.content;if(ye&&c)return null;var u=n,a=jt(o,"left"),s=ye?!(null===(r=u.refIndexes)||void 0===r?void 0:r.length)||u.selfIndex<0:!Wn[o],v=ye?"number"==typeof u.selfIndex&&u.selfIndex>=0?u.selfIndex+1:null:o+1,p=ze.has(o),f=y(u.evaluationResult,null==a?void 0:a.deviationLabel);return i(d,e({ref:rt(o),sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:Qn.current[o],sx:e({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==a?void 0:a.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i(N,{section:n,idx:o,columnKey:"left",colRef:rt("left-accordion-".concat(o)),mb:0,treeData:ce,proposedSections:zn,existingSections:Wn,deviationNumberRegistry:Xn,getSectionCompareStyle:jt,getBadgeRef:ct,connectedSections:ze,openMoreFunctionsPopup:Ct,openSummaryPopup:Jt,parentNodeId:(null===(l=null==ce?void 0:ce.input_index_map)||void 0===l?void 0:l[0])||"",isExpanded:ye?!!xt["left-".concat(o)]:!!xt[String(o)],onToggle:function(){return bt(o,"left")},navigation:n.id?$t[n.id]:null,showOpenNodeRef:ei,resolvedMarkdownStyles:ln,maintainRelativeOrder:ye,renderSubSections:ti})})),ye&&a&&t(d,e({ref:$n.current[o],onClick:function(e){var t=ye?Wn.find(function(e){var n;return null===(n=u.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Wn[o]||{title:"",content:""};Ct(e,n,s,t,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==v&&i(d,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:v})),i(d,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!pe.isLoading||null!=u.evaluationResult&&null!=u.evaluationResult?s?"No Deviation Found":"N/A"===f||"NA"===f?"N/A":0==f||null==f?"Same":"".concat(f):i(_,{color:a.badgeText})})),i(h,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))}),i("div",{ref:pn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(d,e({ref:Tt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(d,e({onClick:function(n){n.stopPropagation(),xn.open&&Cn===st?En():(Tn(st),Rt(St(n.currentTarget,{title:"",content:"",evaluationResult:vt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,st,!0,e(e({},ft),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:ft.badgeBg,color:ft.badgeText,border:"1px solid ".concat(ft.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=pt?pt:i(_,{}),i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(g,{})})),i(f,{size:11,style:{transform:xn.open&&Cn===st?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ye?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Be&&i(x,{sections:11}),i(d,e({ref:Mt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:i(v,e({title:On,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:On}))}))})),t(d,e({ref:dn,onScroll:Vt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:an,style:{width:"100%",height:"0px",flexShrink:0}}),qn&&Wn.map(function(n,o){var r,l=n,c=[],u=!1,a=null,s=-1;if(ye){c=zn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),s=zn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var v=zn.findIndex(function(e,n){var t;return ze.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(u=-1!==v)&&(a=jt(v))}else c=[o+1],(u=ze.has(o))&&(a=jt(o));var p=jt(ye&&-1!==s?s:o);return i(d,e({ref:nt.current[o],sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:Zn.current[o],sx:e({width:"100%",display:"flex"},u&&a&&{borderRadius:"6px",outline:"2px solid ".concat(a.badgeBorder),outlineOffset:"1px"})},{children:i(N,{section:n,idx:o,columnKey:"right",colRef:rt("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==ce?void 0:ce.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:ye?!!xt["right-".concat(o)]:!!xt[String(o)],treeData:ce,proposedSections:zn,existingSections:Wn,deviationNumberRegistry:Xn,getBadgeRef:ct,getSectionCompareStyle:jt,connectedSections:ze,openMoreFunctionsPopup:Ct,openSummaryPopup:Jt,onToggle:function(){return bt(o,"right")},navigation:n.id?$t[n.id]:null,showOpenNodeRef:ei,resolvedMarkdownStyles:ln,maintainRelativeOrder:ye,renderSubSections:ti})})),ye&&!Be&&p&&i(d,e({ref:et.current[o],"data-section-id":l.id,sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:p.badgeBg,color:p.badgeText,border:"1px solid ".concat(p.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:c.length>0?c.join(", "):"-"}))]}))}),"right-row-".concat(o))}),i("div",{ref:sn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{Y as default};
|
|
1
|
+
import{__assign as e,__spreadArray as n}from"tslib";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{useState as o,useRef as r,useMemo as l,useEffect as c,useCallback as u}from"react";import{Box as d,Snackbar as a,Alert as s,Tooltip as v,Typography as p}from"@mui/material";import{ChevronDown as f,EllipsisVertical as h}from"lucide-react";import{ButtonCognitiveIcon as g}from"../../assests/svg/ButtonCognitiveIcon.js";import x from"./OverlayComponent.js";import{safeStringify as m,extractDeviationScore as y,generateColorPalette as b,DEVIATION_BADGE_SEPARATOR as S,hasValue as R,getBentArrowPath as C,smoothScrollTo as I}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as B,DEFAULT_FIELD_CONFIG as T,DEFAULT_COMPARISON_CONFIG as w}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as E,DEFAULT_COMPONENT_HEADER_TEXT as F}from"./CognitiveCompareConstants.js";import k from"./CognitivePopup.js";import M from"./MoreFunctionsPopup.js";import D from"./LoaderComponent.js";import _ from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as H}from"./hooks/useCompareData.js";import{useComparePopups as A}from"./hooks/useComparePopups.js";import{useSectionRefs as L}from"./hooks/useSectionRefs.js";import{useAccordionState as O}from"./hooks/useAccordionState.js";import{useDeviationNavigation as P}from"./hooks/useDeviationNavigation.js";import j from"./components/CompareHeader.js";import N from"./components/SectionAccordion.js";import z from"./components/SubSectionAccordion.js";import W from"./components/CognitiveSummaryPopup.js";var Y=function(Y){var K,X,q,V,J,U,G,Q,Z,$,ee,ne,te,ie,oe,re=Y.componentHeaderText,le=void 0===re?F:re,ce=Y.treeData,ue=Y.comparisonConfig,de=Y.leftColumnTitleText,ae=Y.rightColumnTitleText,se=Y.markdownStyles,ve=Y.displayConfig,pe=void 0===ve?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0}:ve,fe=Y.popupConfig,he=Y.deviationData,ge=void 0===he?{}:he,xe=Y.deviationNodeIdToView,me=o(pe.maintainRelativeOrder),ye=me[0],be=me[1],Se=o(!1),Re=Se[0],Ce=Se[1],Ie=o(!1),Be=Ie[0],Te=Ie[1],we=o(null),Ee=we[0],Fe=we[1],ke=o(!1),Me=ke[0],De=ke[1],_e=o(!1),He=_e[0],Ae=_e[1],Le=o(null),Oe=Le[0],Pe=Le[1],je=r(!1),Ne=o(new Set),ze=Ne[0],We=Ne[1],Ye=o([]),Ke=Ye[0],Xe=Ye[1],qe=r(null),Ve=r(!1),Je=r(null),Ue=r({}),Ge=r([]),Qe=r(!1),Ze=r(!1),$e=r(null),en=r(function(){}),nn=l(function(){return(null==ce?void 0:ce.cognitive_decisioning)||{}},[ce]),tn=o({width:0,height:0}),on=tn[0],rn=tn[1],ln=l(function(){return e(e({},B),se)},[se]),cn=r(null),un=r(null),dn=r(null),an=r(null),sn=r(null),vn=r(null),pn=r(null),fn=r(null),hn=r(!1),gn=A(cn),xn=gn.cognitivePopup,mn=gn.setCognitivePopup,yn=gn.moreFunctions,bn=gn.setMoreFunctions,Sn=gn.position,Rn=gn.setPosition,Cn=gn.activeBadgeId,In=gn.summaryPopup,Bn=gn.setSummaryPopup,Tn=gn.closeSummaryPopup,wn=gn.setActiveBadgeId,En=gn.popupRef,Fn=gn.closeCognitivePopup,kn=gn.closeMoreFunctionsPopup,Mn=l(function(){var e,n,t,i,o,r,l;return{fields:null!==(e=null==ue?void 0:ue.fields)&&void 0!==e?e:T,thresholds:{high:null!==(t=null===(n=null==ue?void 0:ue.thresholds)||void 0===n?void 0:n.high)&&void 0!==t?t:w.thresholds.high,medium:null!==(o=null===(i=null==ue?void 0:ue.thresholds)||void 0===i?void 0:i.medium)&&void 0!==o?o:w.thresholds.medium,exact:null!==(l=null===(r=null==ue?void 0:ue.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:w.thresholds.exact}}},[ue]),Dn=o(null),_n=Dn[0];Dn[1];var Hn=null===(q=null===(K=null==ce?void 0:ce.documents)||void 0===K?void 0:K[null===(X=null==ce?void 0:ce.input_index_map)||void 0===X?void 0:X[0]])||void 0===q?void 0:q.title,An=null===(U=null===(V=null==ce?void 0:ce.documents)||void 0===V?void 0:V[null===(J=null==ce?void 0:ce.input_index_map)||void 0===J?void 0:J[1]])||void 0===U?void 0:U.title,Ln=m(de||Hn||"Uploaded Contract"),On=m(ae||An||"Reference Template"),Pn=H(ce,ye,ge,Mn),jn=Pn.activeProposed,Nn=Pn.existingRule,zn=Pn.proposedSections,Wn=Pn.existingSections,Yn=Pn.visibleFields,Kn=Pn.parentDeviationRecord,Xn=Pn.deviationNumberRegistry,qn=Pn.parseError;c(function(){qn&&Fe("Failed to load comparison: ".concat(qn))},[qn]);var Vn=zn.length>0||Wn.length>0,Jn=L(Yn.map(function(e){return e.key}),Math.max(zn.length,Wn.length)),Un=Jn.leftRefs,Gn=Jn.rightRefs,Qn=Jn.sectionLeftRefs,Zn=Jn.sectionRightRefs,$n=Jn.lhsBadgeRefs,et=Jn.rhsBadgeRefs,nt=Jn.sectionRightRowRefs,tt=Jn.subSectionLeftRefs,it=Jn.subSectionRightRefs,ot=Jn.sectionRowRefs,rt=Jn.getSectionRowRef,lt=Jn.getSubSectionRef,ct=Jn.getBadgeRef,ut=Nn.analysis,dt=m(null===(Q=null===(G=null==ut?void 0:ut.rule_difference_comparison)||void 0===G?void 0:G.summary)||void 0===Q?void 0:Q.overall_summary),at=!!dt.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),st=null!==(Z=null==ce?void 0:ce.base_root_id)&&void 0!==Z?Z:"-1";null==ce||ce[st];var vt=(null===($=null==ge?void 0:ge[st])||void 0===$?void 0:$.evaluation_result)||(null===(ne=null===(ee=null==ce?void 0:ce.nodes)||void 0===ee?void 0:ee[st])||void 0===ne?void 0:ne.evaluation_result)||null,pt=y(vt),ft=b(null!==(oe=null===(ie=null===(te=null==vt?void 0:vt.evaluation_outputs)||void 0===te?void 0:te.metadata)||void 0===ie?void 0:ie.label_color)&&void 0!==oe?oe:""),ht=u(function(){var e,n,t,i;De(!1),Ze.current=!1;var o=$e.current,r=Et.current;if(null!==o)if("string"==typeof o&&o.includes(S)){var l=o.split(S);(c=null===(e=tt.current[l[2]])||void 0===e?void 0:e.current)&&(c.style.paddingTop="0px")}else{var c;(c=null===(n=Qn.current[o])||void 0===n?void 0:n.current)&&(c.style.paddingTop="0px")}if(null!==r)if("string"==typeof r&&r.includes(S)){l=r.split(S);(u=null===(t=it.current[l[3]])||void 0===t?void 0:t.current)&&(u.style.paddingTop="0px")}else{var u;(u=null===(i=Zn.current[r])||void 0===i?void 0:i.current)&&(u.style.paddingTop="0px")}Pe(null),$e.current=null,Et.current=null,Ae(!1),Te(!1),an.current&&(an.current.style.height="0px"),sn.current&&(sn.current.style.height="0px"),vn.current&&(vn.current.style.height="0px"),pn.current&&(pn.current.style.height="0px")},[]),gt=O({maintainRelativeOrder:!!ye,proposedSections:zn,existingSections:Wn,activeSideBySideSection:Oe,connectedSections:ze,resetSideBySide:ht,setConnectedSections:We,setConnectedLines:Xe,cachedConnectedPositions:Ge,svgContainerRef:qe,isAnimatingRef:Ve,animationTimerRef:Je,calculateLinesRef:en,sectionLeftRefs:Qn,sectionRightRefs:Zn,subSectionLeftRefs:tt,subSectionRightRefs:it}),xt=gt.expandedSections,mt=gt.expandedSubSections,yt=gt.setExpandedSubSections,bt=gt.toggleSection,St=u(function(e,n,t,i,o,r,l){var c,u,d,a=m(null==n?void 0:n.id)||m(null==t?void 0:t.id)||"",s=(a?nn[a]:null)||(null==n?void 0:n.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:a,decisioning:[],gap:[],relevance_score:0},v=null!==(u=null===(c=ot.current[i])||void 0===c?void 0:c.current)&&void 0!==u?u:null;return{isLoading:null!==(d=null==pe?void 0:pe.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==n?void 0:n.displayTitle)?null==n?void 0:n.title:"no title",refSectionTitle:(null==t?void 0:t.displayTitle)?null==t?void 0:t.title:"no title",cognitiveData:s,anchorEl:e,sectionAnchorEl:v,badgeStyle:r||null,sectionIdx:i,docData:{documents:null==ce?void 0:ce.documents,input_index_map:null==ce?void 0:ce.input_index_map},deviationData:(null==n?void 0:n.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,isOrphan:!!o}},[nn,ce]),Rt=u(function(e){kn(),Rn(null),mn(e)},[kn]),Ct=function(e,n,t,i,o,r){e.stopPropagation(),yn.open&&yn.sectionIdx===o?kn():(Fn(),bn(St(e.currentTarget,n,i,o,t,r)))},It=u(function(){null!==yn.sectionIdx&&yn.anchorEl?Rt(e(e({},yn),{open:!0})):kn()},[yn,kn,Rt]),Bt=u(function(){var e=yn.sectionIdx,n=yn.isOrphan,t=null!==e&&ze.has(e);kn(),null!==e&&(n?Fe("No counterpart exists to connect to."):(Ze.current&&ht(),t&&(Xe([]),Ge.current=[]),We(function(n){return n.has(e)?new Set:new Set([e])})))},[yn.sectionIdx,kn,ht]),Tt=r(null),wt=r(null),Et=r(null),Ft=r(null),kt=r(null),Mt=r(null),Dt=o([]),_t=Dt[0],Ht=Dt[1];r(null);var At=o(null),Lt=At[0],Ot=At[1];c(function(){if(_n){var e=Mn.fields.find(function(e){return e.analysisKey===_n||e.key===_n});if(e){var n=Un.current[e.key]||Gn.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[_n,Mn.fields]);var Pt=u(function(e){var n,t,i,o,r,l,c,u,d,a=null===(n=null==ut?void 0:ut.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!a||!a[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var s=a[e],v=(null==s?void 0:s.relation)||(null===(i=null===(t=null==s?void 0:s.highlights)||void 0===t?void 0:t.ruleA_spans)||void 0===i?void 0:i.length)||(null===(r=null===(o=null==s?void 0:s.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==s?void 0:s.mappings)&&s.mappings.length>0;if(s.mappings){var p=s.mappings[0]||{};return{score:s.score,relation:p.relation||"",highlightsA:(null===(l=p.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(c=p.highlights)||void 0===c?void 0:c.ruleB_spans)||[],hasContent:!!v}}return{score:s.score,relation:s.relation||"",highlightsA:(null===(u=s.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(d=s.highlights)||void 0===d?void 0:d.ruleB_spans)||[],hasContent:!!v}},[ut]),jt=u(function(n,t){var i,o,r,l,c,u,d;void 0===t&&(t="left");var a=null,s=null;if("left"===t)if(a=zn[n],ye&&a){var v=Wn.filter(function(e){var n;return null===(n=a.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)});s=v.find(function(e){return e.evaluationResult})||v[0]}else s=Wn[n];else if(s=Wn[n],ye&&s){var p=zn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(s.selfIndex)});a=p.find(function(e){return e.evaluationResult})||p[0]}else a=zn[n];var f=(null==a?void 0:a.relation)&&"not_defined"!==a.relation,h=(null==s?void 0:s.relation)&&"not_defined"!==s.relation,g=!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData));if(!f&&!h&&!g)return e(e({},b(E)),{label:"Not Defined"});var x=null!==(o=null!==(i=null==a?void 0:a.evaluationResult)&&void 0!==i?i:null==s?void 0:s.evaluationResult)&&void 0!==o?o:null,m=null===(r=null==x?void 0:x.evaluation_outputs)||void 0===r?void 0:r.output_value,y=null!==(u=null===(c=null===(l=null==x?void 0:x.evaluation_outputs)||void 0===l?void 0:l.metadata)||void 0===c?void 0:c.label_color)&&void 0!==u?u:E;return e(e({},b(y)),null!=x?{label:null!==(d=m)&&void 0!==d?d:""}:{label:null})},[zn,Wn,nn,Mn,ye]),Nt=u(function(n){for(var t,i,o,r,l,c,u,d,a,s=n.split("-").map(Number),v=zn[s[0]],p=Wn[s[0]],f=1;f<s.length;f++)(null==v?void 0:v.subsections)&&(v=v.subsections[s[f]]),(null==p?void 0:p.subsections)&&(p=p.subsections[s[f]]);if(!v&&!p)return null;var h=(null==v?void 0:v.relation)&&"not_defined"!==v.relation,g=(null==p?void 0:p.relation)&&"not_defined"!==p.relation,x=m(null==v?void 0:v.id)||m(null==p?void 0:p.id)||"",y=!(!(null==v?void 0:v.cognitiveData)&&!(null==p?void 0:p.cognitiveData));if(!h&&!g&&!y)return e(e({},b(E)),{label:"Not Defined"});null!==(i=null!==(t=null==v?void 0:v.cognitiveRelevanceScore)&&void 0!==t?t:null==p?void 0:p.cognitiveRelevanceScore)&&void 0!==i||x&&(null===(o=nn[x])||void 0===o||o.relevance_score);var S=null!==(l=null!==(r=null==v?void 0:v.evaluationResult)&&void 0!==r?r:null==p?void 0:p.evaluationResult)&&void 0!==l?l:null,R=null===(c=null==S?void 0:S.evaluation_outputs)||void 0===c?void 0:c.output_value,C=null!==(a=null===(d=null===(u=null==S?void 0:S.evaluation_outputs)||void 0===u?void 0:u.metadata)||void 0===d?void 0:d.label_color)&&void 0!==a?a:E;return e(e({},b(C)),null!=S?{label:null!=R?R:""}:{label:null})},[zn,Wn,nn,Mn]),zt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f,h,g,x,m,y,b,I;if(!hn.current&&!Ve.current){hn.current=!0;try{if(!Tt.current)return;var B=function(e){var n=e.split("-"),t=n[0];if(!xt[t]&&!1===ye)return!1;if(ye&&!xt["left-".concat(t)]&&!xt["right-".concat(t)]&&!xt[t])return!1;for(var i=t,o=1;o<n.length-1;o++)if(i+="-".concat(n[o]),!mt[i])return!1;return!0},T=Tt.current.getBoundingClientRect();rn({width:T.width,height:T.height});var w=[];if(Yn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Gn.current[i])||void 0===t?void 0:t.current;o&&r&&(o.style.height="auto",r.style.height="auto",o.style.minHeight="0px",r.style.minHeight="0px")}),!Ve.current){for(var E=0;E<Math.max(zn.length,Wn.length);E++){var F=null===(e=Qn.current[E])||void 0===e?void 0:e.current,k=null===(n=Zn.current[E])||void 0===n?void 0:n.current;F&&(F.style.height="auto",F.style.minHeight="0px"),k&&(k.style.height="auto",k.style.minHeight="0px")}ye||Object.keys(tt.current).forEach(function(e){var n,t;if(B(e)){var i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.current[e])||void 0===t?void 0:t.current;i&&o&&(i.style.height="auto",o.style.height="auto",i.style.minHeight="0px",o.style.minHeight="0px")}})}var M={};Yn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Gn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect();M[i]=Math.max(l.height,c.height)}});var D={left:{},right:{}},_={};if(!Ve.current)if(ye){if(Me&&null!==Oe)if("number"==typeof Oe){var H=Oe,A=zn[H],L=null===(o=Qn.current[H])||void 0===o?void 0:o.current;L&&A&&(A.refIndexes||[]).forEach(function(e){var n,t=Wn.findIndex(function(n){return n.selfIndex===e}),i=null===(n=Zn.current[t])||void 0===n?void 0:n.current;if(i&&(xt["left-".concat(H)]||xt["right-".concat(t)])){var o=Math.max(L.getBoundingClientRect().height,i.getBoundingClientRect().height);D.left[H]=Math.max(D.left[H]||0,o),D.right[t]=Math.max(D.right[t]||0,o)}})}else{var O=Oe.split(S)[2];if(O){F=null===(r=tt.current[O])||void 0===r?void 0:r.current,k=null===(l=it.current[O])||void 0===l?void 0:l.current;if(F&&k){P=Math.max(F.getBoundingClientRect().height,k.getBoundingClientRect().height);_[O]=Math.max(_[O]||0,P)}}}}else{Object.keys(tt.current).forEach(function(e){var n,t;if(B(e)){var i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.current[e])||void 0===t?void 0:t.current;if(i&&o&&null!==i.offsetParent&&null!==o.offsetParent){var r=i.getBoundingClientRect(),l=o.getBoundingClientRect(),c=Math.max(r.height,l.height);_[e]=c,i.style.minHeight="".concat(c,"px"),o.style.minHeight="".concat(c,"px")}}});for(E=0;E<Math.min(zn.length,Wn.length);E++){var F=null===(t=Qn.current[E])||void 0===t?void 0:t.current,k=null===(i=Zn.current[E])||void 0===i?void 0:i.current;if(F&&k){var P=Math.max(F.getBoundingClientRect().height,k.getBoundingClientRect().height);D.left[E]=P,D.right[E]=P}}}if(Yn.forEach(function(e){var n,t,i=e.key,o=null===(n=Un.current[i])||void 0===n?void 0:n.current,r=null===(t=Gn.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=M[i];o.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}),Ve.current||(Object.entries(D.left).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Qn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),Object.entries(D.right).forEach(function(e){var n,t=e[0],i=e[1],o=null===(n=Zn.current[Number(t)])||void 0===n?void 0:n.current;o&&(o.style.minHeight="".concat(i,"px"))}),ye||Object.keys(_).forEach(function(e){var n,t,i=null===(n=tt.current[e])||void 0===n?void 0:n.current,o=null===(t=it.current[e])||void 0===t?void 0:t.current;if(i&&o&&_[e]){var r=_[e];i.style.minHeight="".concat(r,"px"),o.style.minHeight="".concat(r,"px")}})),ye)zn.forEach(function(e,n){var t;(null===(t=Qn.current[n])||void 0===t?void 0:t.current)&&(e.refIndexes||[]).forEach(function(e){var t,i,o,r,l,c,u,d,a,s,v=Wn.findIndex(function(n){return n.selfIndex===e});if(-1!==v){var p=null===(t=$n.current[n])||void 0===t?void 0:t.current,f=null===(i=et.current[v])||void 0===i?void 0:i.current;if(p&&f){var h=p.getBoundingClientRect(),g=f.getBoundingClientRect(),x=h.right-T.left,m=g.left-T.left,y=h.top+h.height/2-T.top,b=g.top+g.height/2-T.top;if(Me&&Oe===n){var S=null!==(r=null===(o=fn.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==r?r:0,R=null!==(c=null===(l=dn.current)||void 0===l?void 0:l.getBoundingClientRect().top)&&void 0!==c?c:0,C=S+(null!==(d=null===(u=fn.current)||void 0===u?void 0:u.clientHeight)&&void 0!==d?d:1/0),I=R+(null!==(s=null===(a=dn.current)||void 0===a?void 0:a.clientHeight)&&void 0!==s?s:1/0),B=h.top+h.height/2,E=function(e,n,t){return Math.max(n,Math.min(t,e))};y=E(B,S,C)-T.top,b=E(B,R,I)-T.top}var F=jt(n);F&&w.push({id:"line-".concat(n,"-").concat(v),x1:x,y1:y,x2:m,y2:b,style:F,sectionIdx:n,targetRightIdx:v})}}})});else{for(E=0;E<Math.min(zn.length,Wn.length);E++){var j=null===(c=Qn.current[E])||void 0===c?void 0:c.current,N=null===(u=Zn.current[E])||void 0===u?void 0:u.current;if(j&&N){var z=j.getBoundingClientRect(),W=N.getBoundingClientRect(),Y=Math.max(z.top,W.top)+18-T.top,K=(null===(d=Wn[E])||void 0===d?void 0:d.id)||"sec-".concat(E);(Z=jt(E))&&w.push({id:K,x1:z.right-T.left,y1:Y,x2:W.left-T.left,y2:Y,style:Z,sectionIdx:E,hasCognitive:!!((null===(a=zn[E])||void 0===a?void 0:a.cognitiveData)||(null===(s=Wn[E])||void 0===s?void 0:s.cognitiveData)||K&&nn[K]),isSubSection:!1})}}Object.keys(tt.current).forEach(function(e){var n,t,i,o,r,l;if(B(e)){var c=null===(n=tt.current[e])||void 0===n?void 0:n.current,u=null===(t=it.current[e])||void 0===t?void 0:t.current;if(c&&u){for(var d=e.split("-").map(Number),a=zn[d[0]],s=Wn[d[0]],v=1;v<d.length;v++)(null==a?void 0:a.subsections)&&(a=a.subsections[d[v]]),(null==s?void 0:s.subsections)&&(s=s.subsections[d[v]]);var p=!!a&&((null===(i=a.displayTitle)||void 0===i||i)&&R(a.title)),f=!!a&&((null===(o=a.displayContent)||void 0===o||o)&&R(a.content)),h=!!s&&((null===(r=s.displayTitle)||void 0===r||r)&&R(s.title)),g=!!s&&((null===(l=s.displayContent)||void 0===l||l)&&R(s.content));if(p&&f||h&&g){var x=c.getBoundingClientRect(),m=u.getBoundingClientRect(),y=Math.max(x.top,m.top)+16-T.top,b=Nt(e);b&&"Not Defined"!==b.label&&w.push({id:"subsec-".concat(e),x1:x.right-T.left,y1:y,x2:m.left-T.left,y2:y,style:b,sectionIdx:d[0],isSubSection:!0,subSectionKeyPath:e,hasCognitive:!(!(null==a?void 0:a.cognitiveData)&&!(null==s?void 0:s.cognitiveData))})}}}})}if(Me&&"string"==typeof Oe&&Oe.includes(S)){var X=Oe.split(S),q=X[0],V=X[1],J=X[2],U=(X[3],"".concat(q).concat(S).concat(V)),G=null===(v=$n.current[U])||void 0===v?void 0:v.current,Q=null===(p=et.current[U])||void 0===p?void 0:p.current;if(G&&Q){var Z,$=G.getBoundingClientRect(),ee=Q.getBoundingClientRect(),ne=$.right-T.left,te=ee.left-T.left,ie=$.top+$.height/2-T.top,oe=ee.top+ee.height/2-T.top;if(ye){var re=null!==(h=null===(f=fn.current)||void 0===f?void 0:f.getBoundingClientRect().top)&&void 0!==h?h:0,le=null!==(x=null===(g=dn.current)||void 0===g?void 0:g.getBoundingClientRect().top)&&void 0!==x?x:0,ce=re+(null!==(y=null===(m=fn.current)||void 0===m?void 0:m.clientHeight)&&void 0!==y?y:1/0),ue=le+(null!==(I=null===(b=dn.current)||void 0===b?void 0:b.clientHeight)&&void 0!==I?I:1/0),de=function(e,n,t){return Math.max(n,Math.min(t,e))};ie=de($.top+$.height/2,re,ce)-T.top,oe=de(ee.top+ee.height/2,le,ue)-T.top}(Z=Nt(J))&&w.push({id:"line-subsec-".concat(U),x1:ne,y1:ie,x2:te,y2:oe,style:Z,sectionIdx:Number(J.split("-")[0]),isSubSection:!0,subSectionKeyPath:Oe})}}if(Ht(w),kt.current&&Mt.current){var ae=kt.current.getBoundingClientRect(),se=Mt.current.getBoundingClientRect(),ve=(ae.top+ae.height/2-T.top+se.top+se.height/2-T.top)/2;Ot({x1:ae.right-T.left,x2:se.left-T.left,y:ve})}else Ot(null);if(ze.size>0){var pe=[],fe=fn.current,he=dn.current;if(fe&&he){var ge=[],xe=fe.getBoundingClientRect().top,me=he.getBoundingClientRect().top,be=xe+fe.clientHeight,Se=me+he.clientHeight,Re=fe.scrollTop,Ce=he.scrollTop,Ie=T.top,Be=function(e,n,t){return Math.max(n,Math.min(t,e))};ze.forEach(function(e){var n,t,i,o,r;if("string"==typeof e&&e.includes(S)){var l=e.split(S),c=l[0],u=l[1],d=l[2],a=(l[3],"".concat(c).concat(S).concat(u)),s=null===(n=$n.current[a])||void 0===n?void 0:n.current,v=null===(t=et.current[a])||void 0===t?void 0:t.current;if(!s||!v)return;var p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),h=Nt(d),g=(A=p.right-T.left)+.5*((L=f.left-T.left-0)-A),x=p.top+p.height/2,m=f.top+f.height/2,y=x-xe+Re,b=m-me+Ce,R="conn-subsec-".concat(a);ge.push({lhsScrollY:y,rhsScrollY:b,x1:A,x2:L,containerTop:Ie,leftIdx:e,rhsArrayIdx:e,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:R});var I=Be(x,xe,be),B=Be(m,me,Se),w=I-Ie,E=B-Ie,F=m>=me-4&&m<=Se+4,k="";k=(O=x>=xe-4&&x<=be+4)&&F?C(A,w,L,E):O&&!F?"M ".concat(A,",").concat(w," L ").concat(g,",").concat(w," L ").concat(g,",").concat(E):!O&&F?"M ".concat(g,",").concat(w," L ").concat(g,",").concat(E," L ").concat(L,",").concat(E):"M ".concat(g,",").concat(w," L ").concat(g,",").concat(E),pe.push({id:R,pathD:k,style:h,leftIdx:e,rhsArrayIdx:e})}else if(ye){var M=e,D=zn[M];if(!(null===(r=null==D?void 0:D.refIndexes)||void 0===r?void 0:r.length))return;D.refIndexes.forEach(function(e){var n,t,i=Wn.findIndex(function(n){return n.selfIndex===e});if(-1!==i){var o=null===(n=$n.current[M])||void 0===n?void 0:n.current,r=null===(t=et.current[i])||void 0===t?void 0:t.current;if(o&&r){var l=o.getBoundingClientRect(),c=r.getBoundingClientRect(),u=jt(M),d=l.right-T.left,a=c.left-T.left-0,s=d+.5*(a-d),v=l.top+l.height/2,p=c.top+c.height/2,f=v-xe+Re,h=p-me+Ce,g="conn-".concat(M,"-").concat(i);ge.push({lhsScrollY:f,rhsScrollY:h,x1:d,x2:a,containerTop:Ie,leftIdx:M,rhsArrayIdx:i,styleColor:(null==u?void 0:u.badgeBorder)||"#6366F1",styleId:g});var x=Be(v,xe,be),m=Be(p,me,Se),y=x-Ie,b=m-Ie,S=v>=xe-4&&v<=be+4,R=p>=me-4&&p<=Se+4,I="";I=S&&R?C(d,y,a,b):S&&!R?"M ".concat(d,",").concat(y," L ").concat(s,",").concat(y," L ").concat(s,",").concat(b):!S&&R?"M ".concat(s,",").concat(y," L ").concat(s,",").concat(b," L ").concat(a,",").concat(b):"M ".concat(s,",").concat(y," L ").concat(s,",").concat(b),pe.push({id:g,pathD:I,style:u,leftIdx:M,rhsArrayIdx:i})}}})}else{var _=e,H=_;s=null===(i=$n.current[_])||void 0===i?void 0:i.current,v=null===(o=et.current[H])||void 0===o?void 0:o.current;if(!s||!v)return;var A,L;p=s.getBoundingClientRect(),f=v.getBoundingClientRect(),h=jt(_),g=(A=p.right-T.left)+.5*((L=f.left-T.left-0)-A),x=p.top+p.height/2,m=f.top+f.height/2,y=x-xe+Re,b=m-me+Ce,R="conn-".concat(_,"-").concat(H);ge.push({lhsScrollY:y,rhsScrollY:b,x1:A,x2:L,containerTop:Ie,leftIdx:_,rhsArrayIdx:H,styleColor:(null==h?void 0:h.badgeBorder)||"#6366F1",styleId:R});var O;I=Be(x,xe,be),B=Be(m,me,Se),w=I-Ie,E=B-Ie,F=m>=me-4&&m<=Se+4,k="";k=(O=x>=xe-4&&x<=be+4)&&F?C(A,w,L,E):O&&!F?"M ".concat(A,",").concat(w," L ").concat(g,",").concat(w," L ").concat(g,",").concat(E):!O&&F?"M ".concat(g,",").concat(w," L ").concat(g,",").concat(E," L ").concat(L,",").concat(E):"M ".concat(g,",").concat(w," L ").concat(g,",").concat(E),pe.push({id:R,pathD:k,style:h,leftIdx:_,rhsArrayIdx:H})}}),Ge.current=ge}Xe(pe)}else Xe([]),Ge.current=[]}catch(e){console.error("Line render safe fail: ",e)}finally{hn.current=!1}}},[Yn,zn,Wn,nn,Mn,Pt,jt,ye,Me,Oe,ze,xt,mt]),Wt=u(function(){var e,n,t,i,o,r,l,c,u,d,a,s,v,p,f=Ge.current;if(f.length&&!Ve.current){var h=null!==(n=null===(e=fn.current)||void 0===e?void 0:e.scrollTop)&&void 0!==n?n:0,g=null!==(i=null===(t=dn.current)||void 0===t?void 0:t.scrollTop)&&void 0!==i?i:0,x=null!==(r=null===(o=fn.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:1/0,m=null!==(c=null===(l=dn.current)||void 0===l?void 0:l.clientHeight)&&void 0!==c?c:1/0,y=null!==(d=null===(u=fn.current)||void 0===u?void 0:u.getBoundingClientRect().top)&&void 0!==d?d:0,b=null!==(s=null===(a=dn.current)||void 0===a?void 0:a.getBoundingClientRect().top)&&void 0!==s?s:0,S=y+x,R=b+m,I=null!==(p=null===(v=Tt.current)||void 0===v?void 0:v.getBoundingClientRect().top)&&void 0!==p?p:0,B=function(e,n,t){return Math.max(n,Math.min(t,e))};f.forEach(function(e){var n=e.lhsScrollY-h+y,t=e.rhsScrollY-g+b,i=Ue.current[e.styleId+"-stroke"],o=Ue.current[e.styleId+"-bg"];if(i||o){var r,l=B(n,y,S),c=B(t,b,R),u=l-I,d=c-I,a=n>=y-4&&n<=S+4,s=t>=b-4&&t<=R+4,v=e.x1+.5*(e.x2-e.x1);r=a&&s?C(e.x1,u,e.x2,d):a&&!s?"M ".concat(e.x1,",").concat(u," L ").concat(v,",").concat(u," L ").concat(v,",").concat(d):!a&&s?"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d," L ").concat(e.x2,",").concat(d):"M ".concat(v,",").concat(u," L ").concat(v,",").concat(d),i&&(i.setAttribute("visibility","visible"),i.setAttribute("d",r)),o&&(o.setAttribute("visibility","visible"),o.setAttribute("d",r))}})}},[]);c(function(){en.current=zt},[zt]);var Yt=r(null),Kt=u(function(){Ge.current.length>0&&!Ve.current||(null!==Yt.current&&clearTimeout(Yt.current),Yt.current=setTimeout(function(){en.current(),Yt.current=null},50))},[]),Xt=u(function(){null!==Yt.current&&clearTimeout(Yt.current),Yt.current=setTimeout(function(){Ge.current=[],en.current(),Yt.current=null},100)},[]),qt=u(function(e){var n,t,i,o,r,l,c,u,d,a;if(!je.current){if(ye||Kt(),Ze.current){var s=$e.current,v=Et.current,p=fn.current,f=dn.current;if(null!==s&&null!==v&&p&&f){var h="string"==typeof s&&s.includes(S)?null===(n=$n.current["".concat(s.split(S)[0]).concat(S).concat(s.split(S)[1])])||void 0===n?void 0:n.current:null===(t=ot.current[s])||void 0===t?void 0:t.current,g="string"==typeof v&&v.includes(S)?null===(i=et.current["".concat(v.split(S)[0]).concat(S).concat(v.split(S)[1])])||void 0===i?void 0:i.current:null===(o=nt.current[v])||void 0===o?void 0:o.current;if(h&&g){var x=h.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop,m=g.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;if(e.currentTarget===p){var y=m-(x-p.scrollTop),b=f.scrollHeight-f.clientHeight,R=Math.max(0,Math.min(y,b));Math.abs(f.scrollTop-R)>1&&(f.scrollTop=R)}else if(e.currentTarget===f){var C=x-(m-f.scrollTop),I=p.scrollHeight-p.clientHeight,B=Math.max(0,Math.min(C,I));Math.abs(p.scrollTop-B)>1&&(p.scrollTop=B)}if(Ft.current){var T=void 0,w=void 0;if("string"==typeof s&&s.includes(S)){var E=s.split(S),F="".concat(E[0]).concat(S).concat(E[1]);T=null===(r=$n.current[F])||void 0===r?void 0:r.current,w=null===(l=et.current[F])||void 0===l?void 0:l.current}else T=null===(c=$n.current[s])||void 0===c?void 0:c.current,w=null===(u=et.current[v])||void 0===u?void 0:u.current;var k=null!==(a=null===(d=Tt.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==a?a:0,M=p.getBoundingClientRect().top,D=M+p.clientHeight,_=f.getBoundingClientRect().top,H=_+f.clientHeight,A=function(e,n,t){return Math.max(n,Math.min(t,e))};if(T&&w){var L=T.getBoundingClientRect(),O=w.getBoundingClientRect(),P=L.top+L.height/2,j=O.top+O.height/2,N=A(P,M,D),z=A(j,_,H);Ft.current.setAttribute("y1",(N-k).toString()),Ft.current.setAttribute("y2",(z-k).toString());var W=P>=M-4&&P<=D+4;Ft.current.setAttribute("visibility",W?"visible":"hidden")}}}}}Ge.current.length>0&&!Qe.current&&(Qe.current=!0,requestAnimationFrame(function(){Wt(),Qe.current=!1}))}},[Wt,ye,Kt]);c(function(){var e=setTimeout(Kt,250);window.addEventListener("resize",Xt);var n=null,t=null;return cn.current&&(n=new ResizeObserver(Kt)).observe(cn.current),Tt.current&&(t=new ResizeObserver(Kt)).observe(Tt.current),function(){clearTimeout(e),window.removeEventListener("resize",Kt),null==n||n.disconnect(),null==t||t.disconnect()}},[jn,Nn,ut,Yn,xt,mt,zn,Wn,Mn,Kt,Xt,Me,Oe,He,ze]),c(function(){Ze.current=Me},[Me]),c(function(){$e.current=Oe},[Oe]);var Vt=u(function(e,n,t){var i,o,r,l,c,u,d=null===(i=null==t?void 0:t.toggleIfSame)||void 0===i||i,a=null==t?void 0:t.onReady,s=null!==(o=null==t?void 0:t.sourceSide)&&void 0!==o?o:"left";if(kn(),null!=e)if(n)Fe("No counterpart exists for this section.");else if(Me&&Oe===e)d?ht():null==a||a();else{if(!ye){var v=$e.current,p=Et.current;if(null!==v)if("string"==typeof v&&v.includes(S)){var f=v.split(S);(h=null===(r=tt.current[f[2]])||void 0===r?void 0:r.current)&&(h.style.paddingTop="0px")}else{var h;(h=null===(l=Qn.current[v])||void 0===l?void 0:l.current)&&(h.style.paddingTop="0px")}if(null!==p)if("string"==typeof p&&p.includes(S)){f=p.split(S);(g=null===(c=it.current[f[3]])||void 0===c?void 0:c.current)&&(g.style.paddingTop="0px")}else{var g;(g=null===(u=Zn.current[p])||void 0===u?void 0:u.current)&&(g.style.paddingTop="0px")}}We(new Set),Xe([]),Ge.current=[],Te(!0),je.current=!0,Pe(e),$e.current=e,De(!0),Ze.current=!0,Ae(!1),an.current&&(an.current.style.height="0px"),sn.current&&(sn.current.style.height="0px"),vn.current&&(vn.current.style.height="0px"),pn.current&&(pn.current.style.height="0px"),requestAnimationFrame(function(){var n,t,i,o,r,l,c,u,d,v,p=null,f=null,h=null,g=null,x=null;if("string"==typeof e&&e.includes(S)){var m=e.split(S),y="".concat(m[0]).concat(S).concat(m[1]);p=(null===(n=$n.current[y])||void 0===n?void 0:n.current)||null,x=(f=(null===(t=et.current[y])||void 0===t?void 0:t.current)||null)?e:null,h=(null===(i=tt.current[m[2]])||void 0===i?void 0:i.current)||null,g=(null===(o=it.current[m[3]])||void 0===o?void 0:o.current)||null}else if(p=(null===(r=ot.current[e])||void 0===r?void 0:r.current)||null,h=(null===(l=Qn.current[e])||void 0===l?void 0:l.current)||null,ye){var b=zn[e],R=(null==b?void 0:b.refIndexes)||[];if(R.length>0){var C=R[0],B=Wn.findIndex(function(e){return e.selfIndex===C});-1!==B&&(f=(null===(d=nt.current[B])||void 0===d?void 0:d.current)||null,g=(null===(v=Zn.current[B])||void 0===v?void 0:v.current)||null,x=B)}}else f=(null===(c=nt.current[e])||void 0===c?void 0:c.current)||null,g=(null===(u=Zn.current[e])||void 0===u?void 0:u.current)||null,x=f?e:null;Et.current=x;var T=fn.current,w=dn.current;if(!p||!T)return je.current=!1,Te(!1),void(null==a||a());if(!f||!w)return Ae(!0),en.current(),je.current=!1,Te(!1),void(null==a||a());if(!ye){var E=p.getBoundingClientRect(),F=f.getBoundingClientRect(),k=E.top-F.top;h&&g&&(h.style.paddingTop="0px",g.style.paddingTop="0px",k>0?g.style.paddingTop="".concat(k,"px"):k<0&&(h.style.paddingTop="".concat(Math.abs(k),"px")));var M=0;M="right"===s?f?f.getBoundingClientRect().top:(null==g?void 0:g.getBoundingClientRect().top)||0:p?p.getBoundingClientRect().top:(null==h?void 0:h.getBoundingClientRect().top)||0;var D=cn.current,_=D?D.scrollTop+M-150:0;return D?void I(D,_,200,function(){Ae(!0),en.current(),je.current=!1,Te(!1),null==a||a()}):(Ae(!0),en.current(),je.current=!1,Te(!1),void(null==a||a()))}var H=p.getBoundingClientRect().top-T.getBoundingClientRect().top+T.scrollTop,A=f.getBoundingClientRect().top-w.getBoundingClientRect().top+w.scrollTop,L=200;if("left"===s){var O=A-(H-T.scrollTop);O<0&&an.current&&(an.current.style.height="".concat(Math.abs(O),"px")),requestAnimationFrame(function(){var e,n=w.scrollHeight-w.clientHeight;if(O<0)e=0;else{if(O>n){var t=O-n;return sn.current&&(sn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(w,O,L,function(){Ae(!0),en.current(),je.current=!1,Te(!1),null==a||a()})})}e=O}I(w,e,L,function(){Ae(!0),en.current(),je.current=!1,Te(!1),null==a||a()})})}else{var P=H-(A-w.scrollTop);P<0&&vn.current&&(vn.current.style.height="".concat(Math.abs(P),"px")),requestAnimationFrame(function(){var e,n=T.scrollHeight-T.clientHeight;if(P<0)e=0;else{if(P>n){var t=P-n;return pn.current&&(pn.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){I(T,P,L,function(){Ae(!0),en.current(),je.current=!1,Te(!1),null==a||a()})})}e=P}I(T,e,L,function(){Ae(!0),en.current(),je.current=!1,Te(!1),null==a||a()})})}})}},[Oe,kn,Wn,Me,ye,zn,ht]),Jt=u(function(e,n,t,i){var o,r="string"==typeof i?m(i).trim():m(null==i?void 0:i.deviation_summary).trim(),l=e.currentTarget;Fn();var c="left";(null===(o=dn.current)||void 0===o?void 0:o.contains(l))&&(c="right"),t?r&&Bn({open:!0,anchorEl:l,summary:i}):Vt(n,t,r?{toggleIfSame:!1,sourceSide:c,onReady:function(){Bn({open:!0,anchorEl:l,summary:i})}}:{toggleIfSame:!1,sourceSide:c})},[Vt,Fn,Bn]),Ut=u(function(){var e,n=yn.sectionIdx,t=yn.isOrphan;if(null!=n){var i="left";yn.anchorEl&&(null===(e=dn.current)||void 0===e?void 0:e.contains(yn.anchorEl))&&(i="right"),Vt(n,t,{sourceSide:i})}},[Vt,yn.isOrphan,yn.sectionIdx,yn.anchorEl]),Gt=u(function(){Tn(),ht()},[Tn,ht]),Qt=null!==yn.sectionIdx&&ze.has(yn.sectionIdx),Zt=P({proposedSections:zn,existingSections:Wn,parentDeviationRecord:Kn,expandedSections:xt,maintainRelativeOrder:!!ye,scrollContainerRef:cn,leftContainerRef:fn,lhsBadgeRefs:$n,rhsBadgeRefs:et}),$t=Zt.showDeviationNavigation,ei=Zt.showOpenNodeRef,ni=r(null);c(function(){if(xe&&ni.current!==xe){var e=!1,t=0,i=null,o=150,r=function(e,n){for(var t=function(e,i){if(!e)return null;if(e.id===n)return i;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=t(e.subsections[o],"".concat(i,"-").concat(o));if(r)return r}return null},i=0;i<e.length;i++){var o=t(e[i],String(i));if(o)return o}return null},l=function(){var c,u,d,a;if(!e){var s=null,v=null;for(var p in Kn){var f=Kn[p].find(function(e){return e.id===xe});if(f){s=p,v=f;break}}if(v&&s){var h=zn.findIndex(function(e){return e.id===s});if(!(ye?!!xt["left-".concat(h)]:!!xt[String(h)])&&h>=0)return bt(h,"left"),t+=1,void(i=setTimeout(l,450));var g=r(zn,v.id),x=r(Wn,v.id);if(g&&!x){var m=g.split("-"),y=Number(m[0]);if(ye){var b=null===(u=null===(c=zn[y])||void 0===c?void 0:c.refIndexes)||void 0===u?void 0:u[0],R=Wn.findIndex(function(e){return e.selfIndex===b});-1!==R&&(y=R)}x=n([y],m.slice(1),!0).join("-")}if(g&&x){var C="".concat(v.id).concat(S,"0").concat(S).concat(g).concat(S).concat(x),B="".concat(v.id).concat(S,"0"),T=null===(d=$n.current[B])||void 0===d?void 0:d.current,w=null===(a=et.current[B])||void 0===a?void 0:a.current,E=ye?fn.current:cn.current;if(T&&E){var F=T.getBoundingClientRect();if(0===F.height)return void((t+=1)<20&&(i=setTimeout(l,o)));var k=E.getBoundingClientRect(),M=F.top-k.top+E.scrollTop-k.height/2+F.height/2,D=function(){var e=window.getComputedStyle(T).color;T.style.transition="box-shadow 300ms ease-in-out",T.style.boxShadow="0 0 10px ".concat(e),w&&(w.style.transition="box-shadow 300ms ease-in-out",w.style.boxShadow="0 0 10px ".concat(e)),setTimeout(function(){T&&(T.style.boxShadow=""),w&&(w.style.boxShadow="")},2e3)};ni.current=xe,ye?(E.scrollTo({top:M,behavior:"smooth"}),Vt(C,!1,{toggleIfSame:!1}),D()):I(E,M,300,function(){e||(Vt(C,!1,{toggleIfSame:!1}),D())})}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}else(t+=1)<20&&(i=setTimeout(l,o))}};return i=setTimeout(l,o),function(){e=!0,i&&clearTimeout(i)}}},[xe,Kn,zn,Wn,ye,xt,bt,Vt]);var ti=function(e){var n=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,c=void 0===l?"left":l,u=e.parentNodeId;return i(z,{section:n,keyPath:t,depth:r,columnKey:c,parentNodeId:void 0===u?"":u,expandedSubSections:mt,setExpandedSubSections:yt,maintainRelativeOrder:ye||!1,proposedSections:zn,existingSections:Wn,treeData:ce,deviationNumberRegistry:Xn,connectedSections:ze,activeSideBySideSection:Oe,resolvedMarkdownStyles:ln,getSubSectionRef:lt,getSubSectionCompareStyle:Nt,getBadgeRef:ct,openMoreFunctionsPopup:Ct,openSummaryPopup:Jt,resetSideBySide:ht,setConnectedSections:We,setConnectedLines:Xe,cachedConnectedPositions:Ge})};return t(d,e({ref:un,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},ye?{}:{overflow:"visible"}),{position:"relative"})},{children:[Re&&i(d,e({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:i(D,{})})),In.open&&i(W,{open:In.open,anchorEl:In.anchorEl,containerEl:wt.current,clipTopEl:kt.current,onClose:Gt,summary:In.summary}),i(M,{open:yn.open,anchorEl:yn.anchorEl,sectionTitle:yn.sectionTitle,referenceSectionTitle:yn.refSectionTitle,onClose:kn,onOpenCognitiveCompare:It,onOpenSideBySide:Ut,onConnect:Bt,isConnected:Qt,isOrphan:yn.isOrphan}),xn.open&&i(k,{open:xn.open,popupRef:En,position:Sn,popupConfig:fe,onClose:function(){Rn(null),mn(function(n){return e(e({},n),{open:!1})}),wn(null)},markdownStyles:se,sectionTitle:xn.sectionTitle,referenceSectionTitle:xn.refSectionTitle,cognitiveData:xn.cognitiveData,anchorEl:xn.anchorEl,sectionAnchorEl:xn.sectionAnchorEl,scrollContainerEl:cn.current,badgeStyle:xn.badgeStyle,docData:xn.docData,deviationData:xn.deviationData,isLoading:xn.isLoading}),i(a,e({open:!!Ee,autoHideDuration:8e3,onClose:function(){return Fe(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(s,e({onClose:function(){return Fe(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ee}))})),i(j,{componentHeaderText:le,displayConfig:pe,maintainRelativeOrder:ye,onToggleView:function(e){Ce(!0),setTimeout(function(){be(!e),ht(),We(new Set),Xe([]),Ge.current=[],setTimeout(function(){Ce(!1)},400)},50)}}),i(d,e({ref:cn,onScroll:qt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:ye?"hidden":"auto",borderTop:dt&&at?"none":"1.5px solid #EEF0F4"}},{children:i(d,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},ye?{flex:1,minHeight:0}:{})},{children:t(d,e({ref:Tt,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"40px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},ye?{flex:1,overflow:"visible"}:{})},{children:[t("svg",e({ref:qe,style:{position:"absolute",top:0,left:0,width:on.width||"100%",height:on.height||"100%",pointerEvents:"none",zIndex:10,overflow:"visible",transition:"opacity 0.15s ease-in-out"}},{children:[Lt&&i("g",{children:i("line",{x1:Lt.x1,y1:Lt.y,x2:Lt.x2,y2:Lt.y,stroke:ft.badgeBorder,strokeWidth:"1.5"})}),_t.map(function(n){var o,r,l,c,u=n.x1+.5*(n.x2-n.x1),a=(n.y1+n.y2)/2;if("Not Defined"===n.style.label&&!n.hasCognitive)return null;if(n.isSubSection?Me&&Oe===n.subSectionKeyPath&&He:Me&&Oe===n.sectionIdx&&He)return t("g",e({style:{transition:"opacity 0.2s"}},{children:[i("defs",{children:i("marker",e({id:"arr-".concat(n.id),markerWidth:"7",markerHeight:"5",refX:"7",refY:"2.5",orient:"auto"},{children:i("polygon",{points:"0 0, 7 2.5, 0 5",fill:n.style.badgeBorder||"#6366F1"})}))}),i("line",{ref:Ft,x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder||"#6366F1",strokeWidth:"1.5",markerEnd:"url(#arr-".concat(n.id,")")})]}),n.id);if(!ye){var s=n.isSubSection?C(n.x1,n.y1,n.x2,n.y2):"M ".concat(n.x1," ").concat(n.y1," L ").concat(n.x2," ").concat(n.y2),v=zn[n.sectionIdx]||{title:"",content:""},p=Wn[n.sectionIdx]||{title:"",content:""};if(n.isSubSection&&n.subSectionKeyPath){for(var h=n.subSectionKeyPath.split(S)[2].split("-").map(Number),x=zn[h[0]],m=Wn[h[0]],y=(null==x?void 0:x.title)||"",b=(null==m?void 0:m.title)||"",I=1;I<h.length;I++)(null==x?void 0:x.subsections)&&(x=x.subsections[h[I]]),(null==m?void 0:m.subsections)&&(m=m.subsections[h[I]]);x&&(v=e(e({},x),{title:y||x.title})),m&&(p=e(e({},m),{title:b||m.title}))}var B=(null===(o=v.displayTitle)||void 0===o||o)&&R(v.title),T=(null===(r=v.displayContent)||void 0===r||r)&&R(v.content),w=!B&&!T,F=(null===(l=p.displayTitle)||void 0===l||l)&&R(p.title),k=(null===(c=p.displayContent)||void 0===c||c)&&R(p.content),M=w||!F&&!k;return t("g",{children:[i("path",{d:s,fill:"none",stroke:n.style.badgeBorder||"#E2E8F0",strokeWidth:"1.5"}),i("foreignObject",e({x:u-100,y:a-14,width:"200",height:"28",style:{pointerEvents:"auto",overflow:"visible"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t(d,e({onClick:function(e){e.stopPropagation(),M||(xn.open&&Cn===n.id?Fn():(wn(n.id),Rt(St(e.currentTarget,v,p,n.sectionIdx,n.style))))},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:600,textAlign:"center",whiteSpace:"nowrap",cursor:M?"default":"pointer"}},{children:[n.style.badgeText===E&&null==n.style.label?i(_,{color:n.style.badgeText}):0===n.style.label?"Same":n.style.label,i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(g,{})})),!M&&i(f,{size:11,style:{transform:xn.open&&Cn===n.id?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))}))]},n.id)}return null}),Ke.map(function(n){var o,r=n.pathD,l=(null===(o=n.style)||void 0===o?void 0:o.badgeBorder)||"#6366F1",c="conn-marker-".concat(n.id),u="".concat(n.id,"-bg"),d="".concat(n.id,"-stroke");return t("g",{children:[i("defs",{children:i("clipPath",e({id:"connections-clip"},{children:i("marker",e({id:c,markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto"},{children:i("polygon",{points:"0 0, 8 3, 0 6",fill:l})}))}))}),i("path",{ref:function(e){Ue.current[u]=e},d:r,fill:"none",stroke:"#FFFFFF",strokeWidth:"4",strokeOpacity:"0.7"}),i("path",{ref:function(e){Ue.current[d]=e},d:r,fill:"none",stroke:l,strokeWidth:"1.75",markerEnd:"url(#".concat(c,")")})]},n.id)})]})),t(d,e({sx:e({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},ye?{flex:1,overflow:"visible"}:{})},{children:[i(d,e({ref:kt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:i(v,e({title:Ln,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Ln}))}))})),t(d,e({ref:fn,onScroll:qt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:vn,style:{width:"100%",height:"0px",flexShrink:0}}),Vn&&zn.map(function(n,o){var r,l,c=!n.title&&!n.content;if(ye&&c)return null;var u=n,a=jt(o,"left"),s=ye?!(null===(r=u.refIndexes)||void 0===r?void 0:r.length)||u.selfIndex<0:!Wn[o],v=ye?"number"==typeof u.selfIndex&&u.selfIndex>=0?u.selfIndex+1:null:o+1,p=ze.has(o),f=y(u.evaluationResult,null==a?void 0:a.deviationLabel);return i(d,e({ref:rt(o),sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:Qn.current[o],sx:e({width:"100%",display:"flex"},p&&{borderRadius:"6px",outline:"2px solid ".concat((null==a?void 0:a.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i(N,{section:n,idx:o,columnKey:"left",colRef:rt("left-accordion-".concat(o)),mb:0,treeData:ce,proposedSections:zn,existingSections:Wn,deviationNumberRegistry:Xn,getSectionCompareStyle:jt,getBadgeRef:ct,connectedSections:ze,openMoreFunctionsPopup:Ct,openSummaryPopup:Jt,parentNodeId:(null===(l=null==ce?void 0:ce.input_index_map)||void 0===l?void 0:l[0])||"",isExpanded:ye?!!xt["left-".concat(o)]:!!xt[String(o)],onToggle:function(){return bt(o,"left")},navigation:n.id?$t[n.id]:null,showOpenNodeRef:ei,resolvedMarkdownStyles:ln,maintainRelativeOrder:ye,renderSubSections:ti})})),ye&&a&&t(d,e({ref:$n.current[o],onClick:function(e){var t=ye?Wn.find(function(e){var n;return null===(n=u.refIndexes)||void 0===n?void 0:n.includes(e.selfIndex)})||{title:"",content:""}:Wn[o]||{title:"",content:""};Ct(e,n,s,t,o,a)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:a.badgeBg,color:a.badgeText,border:"1px solid ".concat(a.badgeBorder),borderRadius:"12px",px:1.2,py:.4,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[null!==v&&i(d,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(a.badgeBorder)}},{children:v})),i(d,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!pe.isLoading||null!=u.evaluationResult&&null!=u.evaluationResult?s?"No Deviation Found":"N/A"===f||"NA"===f?"N/A":0==f||null==f?"Same":"".concat(f):i(_,{color:a.badgeText})})),i(h,{size:11,color:a.badgeText})]}))]}))}),"left-row-".concat(o))}),i("div",{ref:pn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(d,e({ref:wt,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(d,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(d,e({onClick:function(n){n.stopPropagation(),xn.open&&Cn===st?Fn():(wn(st),Rt(St(n.currentTarget,{title:"",content:"",evaluationResult:vt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,st,!0,e(e({},ft),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-5px",borderRadius:"20px",bgcolor:ft.badgeBg,color:ft.badgeText,border:"1px solid ".concat(ft.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=pt?pt:i(_,{}),i(d,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(g,{})})),i(f,{size:11,style:{transform:xn.open&&Cn===st?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(d,e({sx:e({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},ye?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Be&&i(x,{sections:11}),i(d,e({ref:Mt,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:i(v,e({title:On,placement:"top"},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:On}))}))})),t(d,e({ref:dn,onScroll:qt,sx:e({p:"12px",display:"flex",flexDirection:"column"},ye?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-120px",pl:"140px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:an,style:{width:"100%",height:"0px",flexShrink:0}}),Vn&&Wn.map(function(n,o){var r,l=n,c=[],u=!1,a=null,s=-1;if(ye){c=zn.filter(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0}).map(function(e){return e.selfIndex+1}),s=zn.findIndex(function(e){var n;return(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(l.selfIndex))&&e.selfIndex>=0});var v=zn.findIndex(function(e,n){var t;return ze.has(n)&&(null===(t=e.refIndexes)||void 0===t?void 0:t.includes(l.selfIndex))});(u=-1!==v)&&(a=jt(v))}else c=[o+1],(u=ze.has(o))&&(a=jt(o));var p=jt(ye&&-1!==s?s:o);return i(d,e({ref:nt.current[o],sx:{mb:1,width:"100%"}},{children:t(d,e({sx:{position:"relative",width:"100%"}},{children:[i(d,e({ref:Zn.current[o],sx:e({width:"100%",display:"flex"},u&&a&&{borderRadius:"6px",outline:"2px solid ".concat(a.badgeBorder),outlineOffset:"1px"})},{children:i(N,{section:n,idx:o,columnKey:"right",colRef:rt("right-accordion-".concat(o)),mb:0,parentNodeId:(null===(r=null==ce?void 0:ce.input_index_map)||void 0===r?void 0:r[1])||"",isExpanded:ye?!!xt["right-".concat(o)]:!!xt[String(o)],treeData:ce,proposedSections:zn,existingSections:Wn,deviationNumberRegistry:Xn,getBadgeRef:ct,getSectionCompareStyle:jt,connectedSections:ze,openMoreFunctionsPopup:Ct,openSummaryPopup:Jt,onToggle:function(){return bt(o,"right")},navigation:n.id?$t[n.id]:null,showOpenNodeRef:ei,resolvedMarkdownStyles:ln,maintainRelativeOrder:ye,renderSubSections:ti})})),ye&&!Be&&p&&i(d,e({ref:et.current[o],"data-section-id":l.id,sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"11px",bgcolor:p.badgeBg,color:p.badgeText,border:"1px solid ".concat(p.badgeBorder),borderRadius:"10px",px:1,py:.3,fontWeight:700,whiteSpace:"nowrap",zIndex:20}},{children:c.length>0?c.join(", "):"-"}))]}))}),"right-row-".concat(o))}),i("div",{ref:sn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))};export{Y as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as i,jsx as n,Fragment as t}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as n,Fragment as t}from"react/jsx-runtime";import{useRef as l,useState as o,useCallback as r}from"react";var d=function(d){var c=d.leftComponent,h=d.rightComponent,u=d.isFullscreen,s=void 0!==u&&u,f=l(null),a=o(50),m=a[0],v=a[1],p=o(!1),x=p[0],w=p[1],y=null!=c,g=null!=h,M=r(function(){y&&g&&w(!0)},[y,g]),D=r(function(e){if(x&&f.current){var i=f.current.getBoundingClientRect(),n=(e.clientX-i.left)/i.width*100;n=Math.max(25,Math.min(75,n)),v(n)}},[x]),b=r(function(){w(!1)},[]),k={minWidth:0,minHeight:0,height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"};return i("div",e({ref:f,onMouseMove:D,onMouseUp:b,onMouseLeave:b,style:{display:"flex",width:"calc(100% - 1px)",height:s?"100%":"400px",border:"1px solid #ddd",overflow:"hidden",userSelect:x?"none":"auto"}},{children:[y&&!g&&n("div",e({style:e(e({},k),{width:"100%"})},{children:c})),!y&&g&&n("div",e({style:e(e({},k),{width:"100%"})},{children:h})),y&&g&&i(t,{children:[n("div",e({style:e(e({},k),{width:"".concat(m,"%"),flexShrink:0})},{children:c})),n("div",{onMouseDown:M,style:{width:"6px",background:"#D0D5DD",cursor:"col-resize",flexShrink:0}}),n("div",e({style:e(e({},k),{flex:1})},{children:h}))]})]}))};export{d as default};
|
|
2
2
|
//# sourceMappingURL=ResizableSplitPane.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 i}from"./PdfStyle.js";import{DefaultPdfIcon as o,DefaultFullScreenIcon as l,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,h=c.currentPosition,u=c.pdfName,f=c.onClose,x=c.pdfUrl,g=c.viewerRef,m=c.customStyles,v=c.customClasses,y=c.customIcons,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import{pdfStyles as i}from"./PdfStyle.js";import{DefaultPdfIcon as o,DefaultFullScreenIcon as l,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,h=c.currentPosition,u=c.pdfName,f=c.onClose,x=c.pdfUrl,g=c.viewerRef,m=c.customStyles,v=c.customClasses,y=c.customIcons,w=c.headerAction,b=c.isZoomEnabled,k=void 0===b||b,I=c.showHighlightsAction,C=void 0===I||I,S=c.showFullScreenAction,F=void 0===S||S,D=p.ZoomInButton,j=p.ZoomOutButton,L=p.ZoomPopover,W=p.goToPrevious,B=p.goToNext,A={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0};return n("div",e({style:e(e({display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},i.header),null==m?void 0:m.header)},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0,overflow:"hidden"}},{children:[t("div",e({style:e(e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==m?void 0:m.pdfIconWrapper),{flexShrink:0})},{children:(null==y?void 0:y.pdfIcon)||t(o,{})})),t(s,e({title:u||"",arrow:!0,placement:"top"},{children:t("div",e({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:t("span",e({style:e({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==m?void 0:m.pdfName),className:null==v?void 0:v.pdfName},{children:u}))}))}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:C?"16px":"2px",color:"#4B5563",flexShrink:0,whiteSpace:"nowrap",minWidth:"fit-content"}},{children:[k&&n("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[t(j,{}),t("div",e({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:t(L,{})})),t(D,{})]})),!!a&&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:[h," of ",a]})),t("button",e({style:{background:"none",border:"none",cursor:h<=1?"not-allowed":"pointer",padding:"2px 4px",color:h<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:W,disabled:h<=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:h===a?"not-allowed":"pointer",padding:"2px 4px",color:h===a?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:B,disabled:h===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",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==F&&((null==w?void 0:w.icon)&&(null==w?void 0:w.onClick)?t(s,e({title:(null==w?void 0:w.tooltip)||"",arrow:!0,placement:"top"},{children:t("div",e({onClick:w.onClick,style:e({display:"flex",alignItems:"center",cursor:"pointer"},A)},{children:w.icon}))})):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))}))},style:A,title:"Full Screen"},{children:(null==y?void 0:y.fullScreenIcon)||t(l,{})}))),x&&t("a",e({href:x,target:"_blank",rel:"noopener noreferrer",style:A,title:"Open in new tab"},{children:(null==y?void 0:y.downloadIcon)||t(r,{})})),f&&t("button",e({onClick:f,style:A,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,__awaiter as t,__generator as i}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{SpecialZoomLevel as r}from"@react-pdf-viewer/core";import a from"./PdfContainer.js";import l from"./PdfToolbar.js";import{pdfStyles as s}from"./PdfStyle.js";import{PdfHighlightControls as c}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 u,useMemo as d,useEffect as g}from"react";import f from"../ScannedDocCitation/ScannedDocCitation.js";var h=function(e){switch(e){case"ActualSize":return r.ActualSize;case"PageFit":return r.PageFit;case"PageWidth":return r.PageWidth;default:return null!=e?e:r.PageWidth}},m=function(m){var v,p=m.pdfUrl,x=m.highlightText,C=m.highlightPages,P=m.highlightCordinatePages,
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{SpecialZoomLevel as r}from"@react-pdf-viewer/core";import a from"./PdfContainer.js";import l from"./PdfToolbar.js";import{pdfStyles as s}from"./PdfStyle.js";import{PdfHighlightControls as c}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 u,useMemo as d,useEffect as g}from"react";import f from"../ScannedDocCitation/ScannedDocCitation.js";var h=function(e){switch(e){case"ActualSize":return r.ActualSize;case"PageFit":return r.PageFit;case"PageWidth":return r.PageWidth;default:return null!=e?e:r.PageWidth}},m=function(m){var v,p=m.pdfUrl,x=m.highlightText,C=m.highlightPages,P=m.highlightCordinatePages,w=m.highlightColor,T=void 0===w?"yellow":w,S=m.activeHighlightColor,y=void 0===S?"#f7dc51":S,A=m.jumpToPageValue,b=void 0===A?0:A,H=m.pdfName,I=m.onClose,j=m.customStyles,F=m.customClasses,z=m.customIcons,N=m.useCoordinates,_=m.fallbackPages,R=m.activeCitationIndex,V=m.onActiveCitationChange,W=m.headerAction,q=m.isZoomEnabled,D=void 0===q||q,E=m.showHighlightsAction,B=void 0===E||E,O=m.defaultScale,U=void 0===O?r.ActualSize:O,k=m.useRange,Z=void 0!==k&&k,J=m.rangeOfPages,K=void 0===J?null:J,L=m.showFullScreenAction,G=void 0===L||L,M=u(null),Q=d(function(){if(N)return new Set(P.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(C).forEach(function(t){t>0&&e.add(t-1)}),e},[C]),X=(v=x)&&0!==v.length?v.filter(function(e){return!v.some(function(t){return t!==e&&t.includes(e)})}):v,Y=c(X,N?{}:C,M,Q,N,N?P:[],T,y),$=Y.highlightIndex,ee=Y.cursorIndex,te=Y.setCursorIndex,ie=Y.orderedKeys,oe=Y.totalHighlights,ne=Y.getValidPosition,re=Y.tryJump,ae=Y.jumpToPage,le=Y.zoomTo,se=Y.plugins,ce=Y.controls,ue=Y.hideNonTargetHighlights,de=Y.deduplicateHighlights,ge=ne(ee);g(function(){void 0!==R&&R!==ee&&te(R)},[R]);var fe=e(e({},ce),{goToNext:function(){ce.goToNext(),V&&V(ee+1)},goToPrevious:function(){ce.goToPrevious(),V&&V(ee-1)}});if(!p)return o(f,{pages:_,activeCitationIndex:R,onActiveCitationChange:V,headerAction:W});return n("div",e({ref:M,className:(null==F?void 0:F.pdfViewerWrapper)||"",style:e(e(e({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},s.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==j?void 0:j.pdfViewer)},{children:[o(l,{highlightIndex:$,totalHighlights:oe,controls:fe,currentPosition:ge,pdfName:H,onClose:I,pdfUrl:p,viewerRef:M,customStyles:j,customClasses:F,customIcons:z,headerAction:W,isZoomEnabled:D,showHighlightsAction:B,showFullScreenAction:G}),o(a,{defaultScale:h(U),pdfUrl:p,plugins:se,customStyles:j,onLoad:function(){if(le(r.ActualSize),b>0&&!Z){var e=b-1,o=ie[e],n=C[o],a=P[e];te(e),console.log(a,"cordinateTargetHighlight"),N&&a.pageIndex>0&&ae(a.pageIndex),n>0&&(setTimeout(function(){ue(Q),de(n-1)},1e3),N||ae(n-1))}else if(Z&&K&&2===K.length){t(void 0,void 0,void 0,function(){var e,t,o,n,r;return i(this,function(i){switch(i.label){case 0:e=K[0],t=K[1],o=e,i.label=1;case 1:return o<=t?(ae(n=o-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(i.sent(),ue(Q),(r=de(n))&&r>0)return[3,4];i.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}else if(!N&&C){var l=ie.find(function(e){return C[e]>0});if(void 0!==l){var s=C[l]-1;ae(s),setTimeout(function(){ue(Q),de(s)},1e3)}}requestAnimationFrame(function(){re(),N||function(){if(M.current){var e=b-1,t=ie[e],i=C[t],o=i>0?i-1:0,n={};ie.forEach(function(e,t){var i=C[e];i>0&&(n[i]||(n[i]=[]),n[i].push(t))});var r=(n[i]||[]).indexOf(e),a=0,l=function(){var e,t;if(!(++a>40)){var i=null===(e=M.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(i){var n=null===(t=M.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(o,'"]'));if(n){var s=i.getBoundingClientRect(),c=n.getBoundingClientRect();if(c.top<s.bottom&&c.bottom>s.top){var u=n.querySelectorAll(".rpv-search__highlight")[r];if(u){var d=u.getBoundingClientRect(),g=i.scrollTop+(d.top-s.top)-i.clientHeight/2+d.height/2;i.scrollTo({top:g,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;Q.has(t)?(de(t),ue(Q)):ue(Q)}})]}))};export{m as default};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -2,4 +2,5 @@ export declare const DefaultPdfIcon: () => import("react/jsx-runtime").JSX.Eleme
|
|
|
2
2
|
export declare const DefaultFullScreenIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const DefaultDownloadIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const DefaultCloseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const DefaultFullScreenCloseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
//# sourceMappingURL=PdfViewerIcons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewerIcons.d.ts","sourceRoot":"","sources":["../../../../../src/assests/svg/PdfViewerIcons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,+CAI1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,+CAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAM/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAK5B,CAAC"}
|
|
1
|
+
{"version":3,"file":"PdfViewerIcons.d.ts","sourceRoot":"","sources":["../../../../../src/assests/svg/PdfViewerIcons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,+CAI1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,+CAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAM/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAK5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,+CAetC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAKf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsSjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAEL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAiBlC,QAAA,MAAM,gBAAgB,sLAWnB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAEL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAiBlC,QAAA,MAAM,gBAAgB,sLAWnB,qBAAqB,4CA+yFvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode } from "react";
|
|
|
2
2
|
interface ResizableSplitPaneProps {
|
|
3
3
|
leftComponent?: ReactNode;
|
|
4
4
|
rightComponent?: ReactNode;
|
|
5
|
+
isFullscreen?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const ResizableSplitPane: React.FC<ResizableSplitPaneProps>;
|
|
7
8
|
export default ResizableSplitPane;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizableSplitPane.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/ResizableSplitPane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAEf,UAAU,uBAAuB;IAC/B,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ResizableSplitPane.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/ResizableSplitPane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAEf,UAAU,uBAAuB;IAC/B,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAiIzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -19,7 +19,8 @@ type Props = {
|
|
|
19
19
|
};
|
|
20
20
|
isZoomEnabled: boolean;
|
|
21
21
|
showHighlightsAction: boolean;
|
|
22
|
+
showFullScreenAction?: boolean;
|
|
22
23
|
};
|
|
23
|
-
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, currentPosition, pdfName, onClose, pdfUrl, viewerRef, customStyles, customClasses, customIcons, headerAction, isZoomEnabled, showHighlightsAction }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, currentPosition, pdfName, onClose, pdfUrl, viewerRef, customStyles, customClasses, customIcons, headerAction, isZoomEnabled, showHighlightsAction, showFullScreenAction, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export default PdfToolbar;
|
|
25
26
|
//# sourceMappingURL=PdfToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAInF,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE;QACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,aAAa,EAAE,OAAO,CAAA;IACtB,oBAAoB,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAInF,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE;QACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,aAAa,EAAE,OAAO,CAAA;IACtB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,CAAC;AAEF,QAAA,MAAM,UAAU,4NAiBb,KAAK,4CA8PP,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -54,6 +54,7 @@ interface PdfViewerProps {
|
|
|
54
54
|
defaultScale?: PdfScaleOption;
|
|
55
55
|
useRange?: boolean;
|
|
56
56
|
rangeOfPages?: number[] | null;
|
|
57
|
+
showFullScreenAction?: boolean;
|
|
57
58
|
}
|
|
58
59
|
export type HighlightArea = {
|
|
59
60
|
pageIndex: number;
|
|
@@ -63,6 +64,6 @@ export type HighlightArea = {
|
|
|
63
64
|
height: number;
|
|
64
65
|
pageNumber?: number;
|
|
65
66
|
};
|
|
66
|
-
declare const PdfViewer: ({ pdfUrl, highlightText, highlightPages, highlightCordinatePages, highlightColor, activeHighlightColor, jumpToPageValue, pdfName, onClose, customStyles, customClasses, customIcons, useCoordinates, fallbackPages, activeCitationIndex, onActiveCitationChange, headerAction, isZoomEnabled, showHighlightsAction, defaultScale, useRange, rangeOfPages }: PdfViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
declare const PdfViewer: ({ pdfUrl, highlightText, highlightPages, highlightCordinatePages, highlightColor, activeHighlightColor, jumpToPageValue, pdfName, onClose, customStyles, customClasses, customIcons, useCoordinates, fallbackPages, activeCitationIndex, onActiveCitationChange, headerAction, isZoomEnabled, showHighlightsAction, defaultScale, useRange, rangeOfPages, showFullScreenAction }: PdfViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
67
68
|
export default PdfViewer;
|
|
68
69
|
//# sourceMappingURL=PdfViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"AAKA,OAAO,6CAA6C,CAAC;AACrD,OAAO,wDAAwD,CAAC;AAChE,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAA2B,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,cAAc,GACf,YAAY,GACZ,SAAS,GACT,WAAW,GACX,MAAM,CAAC;AACX,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,uBAAuB,EAAE,aAAa,EAAE,CAAC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE;QACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC;AAoBD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"AAKA,OAAO,6CAA6C,CAAC;AACrD,OAAO,wDAAwD,CAAC;AAChE,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAA2B,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,cAAc,GACf,YAAY,GACZ,SAAS,GACT,WAAW,GACX,MAAM,CAAC;AACX,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,uBAAuB,EAAE,aAAa,EAAE,CAAC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE;QACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAoBD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,SAAS,qXAwBZ,cAAc,4CAiShB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|