@viswa-test/test-citation 0.0.139 → 0.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/components/LHSSectionRow.js +1 -1
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),s=require("./CognitiveComparehelpers.js"),u=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),c=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),f=require("./components/ThreeDotsLoader.js"),p=require("./hooks/useCompareData.js"),g=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),m=require("./hooks/useAccordionState.js"),S=require("./hooks/useDeviationNavigation.js"),R=require("./components/CompareHeader.js"),x=require("./components/SubSectionAccordion.js"),_=require("./components/LHSSectionRow.js"),y=require("./components/RHSSectionRow.js"),b=require("./components/CognitiveSummaryPopup.js"),C=require("./CompareContext.js"),E=require("./hooks/useStyles.js"),A=require("./hooks/useResizeHandler.js"),B=require("./hooks/useLinesCalculator.js"),T=require("./hooks/useSideBySide.js"),w=require("./components/SvgConnectors.js");exports.SHARED_MARKDOWN_STYLES=u.SHARED_MARKDOWN_STYLES,exports.default=function(I){var D,F,O,j,P,N,k,L,q,M,H,V,z,G,W,K,U,Y,X,$,J,Q,Z,ee,ne,ie,te=I.componentHeaderText,oe=void 0===te?a.DEFAULT_COMPONENT_HEADER_TEXT:te,re=I.treeData,le=I.comparisonConfig,se=I.leftColumnTitleText,ue=I.rightColumnTitleText,ae=I.markdownStyles,ce=I.resetTrigger,de=I.displayConfig,ve=void 0===de?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:de,fe=I.popupConfig,pe=I.deviationData,ge=void 0===pe?{}:pe,he=I.deviationNodeIdToView,me=I.resetDeviationNodeId,Se=I.isProposingFix,Re=void 0!==Se&&Se,xe=I.proposingFixNodeId,_e=I.isRedlineFlow,ye=i.useState(ve.maintainRelativeOrder),be=ye[0],Ce=ye[1],Ee=!!be||!!(null==ve?void 0:ve.showDeviationBadges),Ae=i.useState(!1),Be=Ae[0],Te=Ae[1],we=i.useState(null),Ie=we[0],De=we[1],Fe=i.useState(null===(F=null!==(D=null==re?void 0:re.newEvaluationResult)&&void 0!==D?D:null==ve?void 0:ve.enableDeviationSchemaBackwardCompatibility)||void 0===F||F)[0],Oe=i.useState(new Set),je=Oe[0],Pe=Oe[1],Ne=i.useState([]),ke=Ne[0],Le=Ne[1],qe=i.useRef(null),Me=i.useRef(null),He=i.useRef(null),Ve=i.useRef(null),ze=i.useRef(null),Ge=i.useRef(!1),We=i.useRef(null),Ke=i.useRef({}),Ue=i.useRef([]),Ye=i.useRef(function(){}),Xe=i.useRef(null),$e=i.useRef(function(){}),Je=i.useMemo(function(){return(null==re?void 0:re.cognitive_decisioning)||{}},[re]),Qe=i.useMemo(function(){return e.__assign(e.__assign({},u.SHARED_MARKDOWN_STYLES),ae)},[ae]),Ze=i.useRef(null),en=i.useRef(null),nn=i.useRef(null),tn=i.useRef(null),on=i.useRef(null),rn=i.useRef(null),ln=i.useRef(null),sn=i.useRef(null),un=i.useRef(null),an=i.useRef(null),cn=g.useComparePopups(Ze),dn=cn.cognitivePopup,vn=cn.setCognitivePopup,fn=cn.moreFunctions,pn=cn.setMoreFunctions,gn=cn.position,hn=cn.setPosition,mn=cn.activeBadgeId,Sn=cn.summaryPopup,Rn=cn.setSummaryPopup,xn=cn.closeSummaryPopup,_n=cn.setActiveBadgeId,yn=cn.popupRef,bn=cn.handleOpenCognitiveCompare,Cn=cn.openCognitivePopupFromState,En=cn.closeCognitivePopup,An=cn.closeMoreFunctionsPopup,Bn=i.useMemo(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==le?void 0:le.fields)&&void 0!==e?e:u.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(n=null==le?void 0:le.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:u.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(t=null==le?void 0:le.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:u.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==le?void 0:le.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:u.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[le]),Tn=i.useState(null),wn=Tn[0];Tn[1];var In=null===(P=null===(O=null==re?void 0:re.documents)||void 0===O?void 0:O[null===(j=null==re?void 0:re.input_index_map)||void 0===j?void 0:j[0]])||void 0===P?void 0:P.title,Dn=null===(L=null===(N=null==re?void 0:re.documents)||void 0===N?void 0:N[null===(k=null==re?void 0:re.input_index_map)||void 0===k?void 0:k[1]])||void 0===L?void 0:L.title,Fn=s.safeStringify(se||In||"Uploaded Contract"),On=s.safeStringify(ue||Dn||"Reference Template"),jn=p.useCognitiveTreeData(re,be,ge,Bn,Fe),Pn=jn.activeProposed,Nn=jn.existingRule,kn=jn.proposedSections,Ln=jn.existingSections,qn=jn.visibleFields,Mn=jn.parentDeviationRecord,Hn=jn.deviationNumberRegistry,Vn=jn.parseError;i.useEffect(function(){Vn&&De("Failed to load comparison: ".concat(Vn))},[Vn]);var zn=kn.length>0||Ln.length>0,Gn=i.useMemo(function(){if(!_e)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";s.hasMeaningfulRedlineTags(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(kn),i(Ln),"".concat(e,":").concat(n)},[_e,kn,Ln]),Wn=h.useSectionRefs(qn.map(function(e){return e.key}),Math.max(kn.length,Ln.length)),Kn=Wn.leftRefs,Un=Wn.rightRefs,Yn=Wn.sectionLeftRefs,Xn=Wn.sectionRightRefs,$n=Wn.lhsBadgeRefs,Jn=Wn.rhsBadgeRefs,Qn=Wn.sectionRightRowRefs,Zn=Wn.subSectionLeftRefs,ei=Wn.subSectionRightRefs,ni=Wn.sectionRowRefs,ii=Wn.getSectionRowRef,ti=Wn.getSubSectionRef,oi=Wn.getBadgeRef,ri=T.useSideBySide({maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,leftContainerRef:sn,rightContainerRef:nn,scrollContainerRef:Ze,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,sectionRightRowRefs:Qn,rhsTopSpacerRef:tn,rhsBottomSpacerRef:on,lhsTopSpacerRef:rn,lhsBottomSpacerRef:ln,calculateLinesRef:Ye,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,closeMoreFunctionsPopup:An,setErrorToast:De,moreFunctions:fn,closeSummaryPopup:xn}),li=ri.isSideBySide,si=ri.isArrowVisible,ui=ri.setIsArrowVisible,ai=ri.isResizing,ci=ri.setIsResizing,di=ri.isSideBySideLoading,vi=ri.activeSideBySideSection,fi=ri.scrollLock,pi=ri.sideBySideCacheRef,gi=ri.isSideBySideRef,hi=ri.activeSideBySideRightSectionRef,mi=ri.activeSideBySideSectionRef,Si=ri.sideBySideLineRef,Ri=ri.highlightedClauseRefs,xi=ri.clearClauseHighlight,_i=ri.applyAlignmentPadding,yi=ri.resetSideBySide,bi=ri.activateSideBySide,Ci=m.useAccordionState({maintainRelativeOrder:!!be,proposedSections:kn,existingSections:Ln,activeSideBySideSection:vi,connectedSections:je,resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,svgContainerRef:qe,isAnimatingRef:Ge,animationTimerRef:We,calculateLinesRef:Ye,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei}),Ei=Ci.expandedSections,Ai=Ci.setExpandedSections,Bi=Ci.expandedSubSections,Ti=Ci.setExpandedSubSections,wi=Ci.handleSubSectionToggle,Ii=Ci.toggleSection;i.useEffect(function(){_e&&"off"!==Gn&&"0:0"!==Gn&&(pi.current=null,Ue.current=[],requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)}))},[_e,Gn]);var Di=i.useMemo(function(){var e=new Map,n=new Map,i=1;if(be)kn.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Ln.forEach(function(t){if(t.id){var o=kn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(kn.length,Ln.length),o=0;o<t;o++){var r=kn[o],l=Ln[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[kn,Ln,be]),Fi=Nn.analysis,Oi=s.safeStringify(null===(M=null===(q=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===q?void 0:q.summary)||void 0===M?void 0:M.overall_summary),ji=!!Oi.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Pi=null!==(H=null==re?void 0:re.base_root_id)&&void 0!==H?H:"-1";null==re||re[Pi];var Ni=Fe?null!==(Z=null!==($=ge&&(null===(X=null==ge?void 0:ge[Pi])||void 0===X?void 0:X.evaluation_result))&&void 0!==$?$:null===(Q=null===(J=null==re?void 0:re.nodes)||void 0===J?void 0:J[Pi])||void 0===Q?void 0:Q.evaluation_result)&&void 0!==Z?Z:null:null!==(Y=null!==(G=ge&&(null===(z=null===(V=null==ge?void 0:ge[Pi])||void 0===V?void 0:V.evaluation_result)||void 0===z?void 0:z[0]))&&void 0!==G?G:null===(U=null===(K=null===(W=null==re?void 0:re.nodes)||void 0===W?void 0:W[Pi])||void 0===K?void 0:K.evaluation_result)||void 0===U?void 0:U[0])&&void 0!==Y?Y:null,ki=s.extractDeviationScore(Ni),Li=s.generateColorPalette(null!==(ie=null===(ne=null===(ee=null==Ni?void 0:Ni.evaluation_outputs)||void 0===ee?void 0:ee.metadata)||void 0===ne?void 0:ne.label_color)&&void 0!==ie?ie:a.DEFAULT_DEVIAION_COLOR),qi=i.useCallback(function(){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],et([]),it(null),Rn(a.EMPTY_SUMMARY_POPUP_STATE),En(),requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)})},[]),Mi=i.useRef(qi);i.useEffect(function(){Mi.current=qi},[qi]),i.useEffect(function(){ce&&Mi.current()},[ce]);var Hi=i.useCallback(function(n,i,t,o,r,l,u){var a,c,d,v=s.safeStringify(null==i?void 0:i.id)||s.safeStringify(null==t?void 0:t.id)||"",f=(v?Je[v]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},p=null!==(c=null===(a=ni.current[o])||void 0===a?void 0:a.current)&&void 0!==c?c:null;return{isLoading:null!==(d=null==ve?void 0:ve.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:f,anchorEl:n,sectionAnchorEl:p,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==re?void 0:re.documents,input_index_map:null==re?void 0:re.input_index_map},deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)))return u(l);var a=o.split(s.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var c=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},d=(null===(n=null==c?void 0:c.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==c?void 0:c.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},c),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==c?void 0:c.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==c?void 0:c.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==c?void 0:c.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==c?void 0:c.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==c?void 0:c.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==c?void 0:c.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Je,re]),Vi=i.useCallback(function(){var e=fn.sectionIdx,n=fn.isOrphan;An(),xn(),null!==e&&(n?De("No counterpart exists to connect to."):(xi(),gi.current&&yi(),Le([]),Ue.current=[],Pe(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Ye.current&&Ye.current()},50)))},[fn.sectionIdx,fn.isOrphan,An,xn,yi]),zi=i.useCallback(function(){var e=ze.current;if(e){ze.current=null;var n=kn.findIndex(function(n){return n.id===e}),i=Ln.findIndex(function(n){return n.id===e}),t=-1===n?s.findKeyPathByNodeId(kn,e):null,o=-1===i?s.findKeyPathByNodeId(Ln,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,s;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(s=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==s?s:null},a=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(Ri.current.add(r),s.scrollAndHighlightClause(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(be)-1!==r&&sn.current&&a(function(){return u(n,t,Yn,Zn)},sn.current),-1!==l&&nn.current&&a(function(){return u(i,o,Xn,ei)},nn.current);else{var c=Ze.current;if(!c)return;a(function(){return-1!==r?u(n,t,Yn,Zn):u(i,o,Xn,ei)},c)}}},[kn,Ln,be,Yn,Xn,Zn,ei,sn,nn,Ze]),Gi=i.useCallback(function(n){if(n){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En();var i=kn.findIndex(function(e){return e.id===n}),t=Ln.findIndex(function(e){return e.id===n}),o=-1===i?s.findKeyPathByNodeId(kn,n):null,r=-1===t?s.findKeyPathByNodeId(Ln,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;ze.current=n,Ai(function(n){var i,t=e.__assign({},n),o=!1;-1!==l&&(t[i=be?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=be?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),Ti(function(n){var i=e.__assign({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){ze.current===n&&Wi.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[kn,Ln,be,Ai,Ti,yi,xn,En]),Wi=i.useRef(zi);i.useEffect(function(){Wi.current=zi},[zi]);var Ki=i.useRef(null);i.useEffect(function(){if(wn){var e=Bn.fields.find(function(e){return e.analysisKey===wn||e.key===wn});if(e){var n=Kn.current[e.key]||Un.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[wn,Bn.fields]);var Ui=i.useCallback(function(e){var n,i,t,o,r,l,s,u,a,c=null===(n=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.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 f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(s=f.highlights)||void 0===s?void 0:s.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===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Fi]),Yi=E.useStyleHelpers({proposedSections:kn,existingSections:Ln,maintainRelativeOrder:be,cognitiveMap:Je,deviationData:ge,treeData:re,resolvedComparisonConfig:Bn}),Xi=Yi.getSectionCompareStyle,$i=Yi.getSubSectionCompareStyle,Ji=Yi.getDeviationStyleByKey,Qi=B.useLinesCalculator({containerRef:Me,leftContainerRef:sn,rightContainerRef:nn,svgContainerRef:qe,pathRefs:Ke,leftHeaderRef:He,rightHeaderRef:Ve,proposedSections:kn,existingSections:Ln,visibleFields:qn,leftRefs:Kn,rightRefs:Un,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,expandedSections:Ei,expandedSubSections:Bi,connectedSections:je,isSideBySide:li,activeSideBySideSection:vi,maintainRelativeOrder:be,cognitiveMap:Je,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getDeviationStyleByKey:Ji,isArrowVisible:si,isAnimatingRef:Ge,isSideBySideRef:gi,sideBySideCacheRef:pi,sideBySideLineRef:Si,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,connectedLines:ke,setConnectedLines:Le,cachedConnectedPositions:Ue,calculateLinesRef:Ye,resizeTimerRef:Xe,scrollLock:fi,handleResizeRef:$e,activeProposed:Pn,existingRule:Nn,analysisData:Fi,pendingScrollTargetRef:un,pendingScrollCallbackRef:an,resolvedComparisonConfig:Bn,getFieldData:Ui}),Zi=Qi.lines,et=Qi.setLines,nt=Qi.overallConnector,it=Qi.setOverallConnector,tt=Qi.svgDimensions,ot=Qi.handleColumnScroll,rt=i.useCallback(function(){xi(),Ai({}),Ti({}),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En(),An(),requestAnimationFrame(function(){Ye.current&&Ye.current()})},[Ai,Ti,yi,xn,En,An]),lt=i.useMemo(function(){return Object.values(Ei).some(Boolean)||Object.values(Bi).some(Boolean)},[Ei,Bi]),st=i.useRef(null),ut=i.useRef(0),at=i.useRef(0),ct=i.useRef(0),dt=A.useResizeHandler({timerRef:st,ruleComponentRef:en,scrollContainerRef:Ze,containerRef:Me,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,isSideBySideRef:gi,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,sectionRowRefs:ni,sectionRightRowRefs:Qn,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,leftContainerRef:sn,rightContainerRef:nn,calculateLinesRef:Ye,handleResizeRef:$e,setIsResizing:ci,setIsArrowVisible:ui,sideBySideCacheRef:pi,cachedConnectedPositions:Ue}).handleResize;i.useEffect(function(){$e.current=dt},[dt,$e]),i.useEffect(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,s;i.current=null;var u=e[e.length-1];if(u){var a=null!==(s=null===(l=null===(r=u.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==s?s:u.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return en.current&&o.push(e(en.current,ut,n,function(){return $e.current()},function(){})),Ze.current&&o.push(e(Ze.current,at,i,function(){return $e.current()},function(){return Ye.current()})),Me.current&&o.push(e(Me.current,ct,t,function(){return $e.current()},function(){return Ye.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),i.useEffect(function(){gi.current=li},[li]),i.useEffect(function(){mi.current=vi},[vi]);var vt=i.useCallback(function(){var e,n=fn.sectionIdx,i=fn.isOrphan;if(xn(),null!=n){var t="left";fn.anchorEl&&(null===(e=nn.current)||void 0===e?void 0:e.contains(fn.anchorEl))&&(t="right"),bi(n,i,{sourceSide:t})}},[bi,fn.isOrphan,fn.sectionIdx,fn.anchorEl,xn]),ft=i.useCallback(function(){xn(),yi(),Pe(new Set),Le([]),Ue.current=[]},[xn,yi]),pt=null!==fn.sectionIdx&&je.has(fn.sectionIdx),gt=S.useDeviationNavigation({proposedSections:kn,existingSections:Ln,parentDeviationRecord:Mn,expandedSections:Ei,maintainRelativeOrder:!!be,scrollContainerRef:Ze,leftContainerRef:sn,rightContainerRef:nn,lhsBadgeRefs:$n,rhsBadgeRefs:Jn}),ht=gt.showDeviationNavigation,mt=gt.showOpenNodeRef,St=gt.adjustScrollForPopup,Rt=i.useCallback(function(e,n,i,t,o){var r,l="string"==typeof t?s.safeStringify(t).trim():s.safeStringify(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;En();var a="left";(null===(r=nn.current)||void 0===r?void 0:r.contains(u))&&(a="right");var c=function(){var e,i,t,o;if("string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=n.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(i=$n.current[l])||void 0===i?void 0:i.current}return"right"===a?null===(t=Jn.current[n])||void 0===t?void 0:t.current:null===(o=$n.current[n])||void 0===o?void 0:o.current},d=function(e,t){var o=!!be,r=o?"right"===a?nn.current:sn.current:Ze.current,l=o?"right"===a?sn.current:nn.current:null;if(r&&e){var u=function(){var e="string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR);i||!e?t():requestAnimationFrame(function(){var e,i,o;pi.current=null,Ue.current=[],_i(!0,n,null),null===(e=Ye.current)||void 0===e||e.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),t()})},c=e.getBoundingClientRect(),d=r.getBoundingClientRect(),v=d.bottom-.35*d.height,f=d.top+.35*d.height;if(c.top>v||c.top<f){var p=d.top+d.height/2,g=c.top+c.height/2-p;o&&l&&s.smoothScrollTo(l,l.scrollTop+g,250,function(){}),s.smoothScrollTo(r,r.scrollTop+g,250,u)}else u()}else t()};if(i)return yi(),Pe(new Set),Le([]),Ue.current=[],void(l&&requestAnimationFrame(function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}));bi(n,i,l?{toggleIfSame:!1,sourceSide:a,onReady:function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}}:{toggleIfSame:!1,sourceSide:a})},[bi,En,Rn,yi,be]),xt=i.useMemo(function(){var e;if(!he)return null;var n=null===(e=null==he?void 0:he.id)||void 0===e?void 0:e.split(":")[0];for(var i in Mn){if((Mn[i]||[]).some(function(e){return e.id===n}))return i}return null},[he,Mn]),_t=i.useRef({id:null,triggerMs:null}),yt=i.useRef(null);i.useEffect(function(){var n;if(null==he?void 0:he.id){var i=Number(he.trigger),t=_t.current;if((null==t?void 0:t.triggerMs)!==i){if(!(he.id.includes(":")&&/:\d+$/.test(he.id)))return _t.current={id:he.id,triggerMs:i},void Gi(he.id);var o=null===(n=null==he?void 0:he.id)||void 0===n?void 0:n.split(":"),r=o[0],l=o[1],u=null!=l?l:"0";yt.current!==he.id&&(xn(),En(),yi(),Pe(new Set),Le([]),Ue.current=[],yt.current=he.id);var a=!1,c=0,d=null,v=150,f=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},p=function(){var n,t,o,l;if(!a){var g=function(){_t.current={id:he.id,triggerMs:i}},h=null,m=null;for(var S in Mn){var R=Mn[S].find(function(e){return e.id===r});if(R){h=S,m=R;break}}if(m&&h){var x=kn.findIndex(function(e){return e.id===h}),_=Ln.findIndex(function(e){return e.id===h}),y=-1===x&&-1!==_,b=f(kn,m.id),C=f(Ln,m.id);if(b&&!C&&!y){var E=b.split("-"),A=Number(E[0]);if(be){var B=null===(t=null===(n=kn[A])||void 0===n?void 0:n.refIndexes)||void 0===t?void 0:t[0],T=Ln.findIndex(function(e){return e.selfIndex===B});-1!==T&&(A=T)}C=e.__spreadArray([A],E.slice(1),!0).join("-")}if(b||C){var w=y||!b&&!!C,I=b?Number(b.split("-")[0]):x,D=C?Number(C.split("-")[0]):_;if(w){if(!(be?!!Ei["right-".concat(D)]:!!Ei[String(D)])&&D>=0)return Ii(D,"right"),c+=1,void(d=setTimeout(p,450))}else if(!(be?!!Ei["left-".concat(I)]:!!Ei[String(I)])&&I>=0)return Ii(I,"left"),c+=1,void(d=setTimeout(p,450));var F,O=b||"",j=C||"",P="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u).concat(s.DEVIATION_BADGE_SEPARATOR).concat(O).concat(s.DEVIATION_BADGE_SEPARATOR).concat(j),N="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u),k=null===(o=$n.current[N])||void 0===o?void 0:o.current,L=null===(l=Jn.current[N])||void 0===l?void 0:l.current,q=w||!k&&!!L,M=q?L:k;if(F=be?q?nn.current:sn.current:Ze.current,M&&F){var H=M.getBoundingClientRect();if(0===H.height)return void((c+=1)<2?d=setTimeout(p,v):g());var V=F.getBoundingClientRect(),z=H.top-V.top+F.scrollTop-V.height/2+H.height/2+150,G=function(){var n,i,t,o,r;if(!a){g();var l=M instanceof Element?window.getComputedStyle(M).color:"";k&&(k.style.transition="box-shadow 300ms ease-in-out",k.style.boxShadow="0 0 10px ".concat(l)),L&&(L.style.transition="box-shadow 300ms ease-in-out",L.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){k&&(k.style.boxShadow=""),L&&(L.style.boxShadow="")},2e3);var s=(null===(i=null===(n=m.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[u])||m,c=(null===(t=m.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||m.evaluation_outputs;if(!(!!k&&!!L)){var d=q?(null===(o=Jn.current[N])||void 0===o?void 0:o.current)||L:(null===(r=$n.current[N])||void 0===r?void 0:r.current)||k;return St(d,function(){Rn({open:!0,anchorEl:d,displayImpact:he.displayImpact,summary:e.__assign(e.__assign({},s),{evaluation_outputs:c})})}),void(null==me||me())}bi(P,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,i,t=q?(null===(n=Jn.current[N])||void 0===n?void 0:n.current)||L:(null===(i=$n.current[N])||void 0===i?void 0:i.current)||k;St(t,function(){requestAnimationFrame(function(){var n,i,o;pi.current=null,Ue.current=[],_i(!0,P,null),null===(n=Ye.current)||void 0===n||n.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),Rn({open:!0,anchorEl:t,displayImpact:null==he?void 0:he.displayImpact,summary:e.__assign({},s)})})})}})}};Math.abs(F.scrollTop-z)<=2?G():(un.current=z,an.current=G,F.scrollTo({top:z,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(an.current){un.current=null;var e=an.current;an.current=null,e()}},800))}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}};return d=setTimeout(p,v),function(){a=!0,d&&clearTimeout(d)}}}},[he,Mn,kn,Ln,be,Ei,Ii,bi,Rn,Gi]);var bt={maintainRelativeOrder:!!be,showDeviationBadges:Ee,isProposingFix:Re,proposingFixNodeId:xe,isRedlineFlow:_e,isSideBySide:li,activeSideBySideSection:vi,connectedSections:je,proposedSections:kn,existingSections:Ln,deviationNumberRegistry:Hn,treeData:re,displayConfig:ve,resolvedMarkdownStyles:Qe,unifiedNumbering:Di,expandedSections:Ei,expandedSubSections:Bi,setExpandedSubSections:Ti,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getBadgeRef:oi,getSectionRowRef:ii,getSubSectionRef:ti,sectionLeftRefs:Yn,sectionRightRefs:Xn,sectionRowRefs:ni,sectionRightRowRefs:Qn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,openMoreFunctionsPopup:function(e,n,i,t,o,r){var l;if(e.stopPropagation(),fn.open&&fn.sectionIdx===o)An();else{var u=e.currentTarget,a="left";(null===(l=nn.current)||void 0===l?void 0:l.contains(u))&&(a="right");xi(),gi.current&&yi(),Pe(new Set),Le([]),Ue.current=[],En(),Sn.open?ft():xn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=o.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(n=$n.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(i=Jn.current[o])||void 0===i?void 0:i.current:null===(t=$n.current[o])||void 0===t?void 0:t.current}()||u;pn(Hi(e,n,t,o,i,r))})}},handleOpenSummaryPopup:Rt,openSummaryPopup:Rt,handleCloseSummaryPopup:ft,toggleSection:Ii,handleSubSectionToggle:wi,renderSubSectionAccordion:function(e){var i=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,s=void 0===l?"left":l,u=e.parentNodeId,a=void 0===u?"":u,c=e.sectionOffset;return n.jsx(x.default,{section:i,keyPath:t,depth:r,columnKey:s,parentNodeId:a,sectionOffset:c})},resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,showDeviationNavigation:ht,showOpenNodeRef:mt,deviationNodeIdToView:null==he?void 0:he.id,deviationTargetParentId:xt};return n.jsx(C.CompareContextProvider,e.__assign({value:bt},{children:n.jsxs(t.Box,e.__assign({ref:en,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},be?{}:{overflow:"visible"}),{position:"relative"})},{children:[Be&&n.jsx(t.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,{})})),Sn.open&&n.jsx(b.default,{open:Sn.open,anchorEl:Sn.anchorEl,containerEl:Ki.current,clipTopEl:He.current,scrollContainerEl:Ze.current,onClose:ft,summary:Sn.summary,displayImpact:Sn.displayImpact}),n.jsx(d.default,{open:fn.open,anchorEl:fn.anchorEl,sectionTitle:fn.sectionTitle,referenceSectionTitle:fn.refSectionTitle,onClose:An,onOpenCognitiveCompare:bn,onOpenSideBySide:vt,onConnect:Vi,isConnected:pt,isOrphan:fn.isOrphan}),dn.open&&n.jsx(c.default,{open:dn.open,popupRef:yn,position:gn,popupConfig:fe,onClose:function(){hn(null),vn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),_n(null)},markdownStyles:ae,sectionTitle:dn.sectionTitle,referenceSectionTitle:dn.refSectionTitle,cognitiveData:dn.cognitiveData,anchorEl:dn.anchorEl,sectionAnchorEl:dn.sectionAnchorEl,scrollContainerEl:Ze.current,badgeStyle:dn.badgeStyle,docData:dn.docData,deviationData:dn.deviationData,isLoading:dn.isLoading}),n.jsx(t.Snackbar,e.__assign({open:!!Ie,autoHideDuration:8e3,onClose:function(){return De(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(t.Alert,e.__assign({onClose:function(){return De(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ie}))})),n.jsx(R.default,{componentHeaderText:oe,displayConfig:ve,maintainRelativeOrder:be,onCollapseAll:rt,showCollapseAll:lt,onToggleView:function(e){Te(!0),setTimeout(function(){Ce(!e),yi(),xn(),Pe(new Set),Le([]),Ue.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Te(!1)},600)})})},50)}}),n.jsx(t.Box,e.__assign({ref:Ze,onScroll:ot,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:be?"hidden":"auto",borderTop:Oi&&ji?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(t.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},be?{flex:1,minHeight:0}:{})},{children:n.jsxs(t.Box,e.__assign({ref:Me,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(w.default,{svgContainerRef:qe,svgDimensions:tt,isResizing:ai,overallConnector:nt,rootDeviationStyle:Li,lines:Zi,isSideBySide:li,activeSideBySideSection:vi,isArrowVisible:si,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,cognitivePopup:dn,activeBadgeId:mn,closeCognitivePopup:En,setActiveBadgeId:_n,openCognitivePopupFromState:Cn,buildSectionPopupState:Hi,connectedLines:ke,pathRefs:Ke}),n.jsxs(t.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)"},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(t.Box,e.__assign({ref:He,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(t.Tooltip,e.__assign({title:Fn,placement:"top"},{children:n.jsx(t.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:Fn}))}))})),n.jsxs(t.Box,e.__assign({ref:sn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{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:rn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&kn.map(function(e,i){return n.jsx(_.default,{section:e,idx:i},"left-row-".concat(i))}),n.jsx("div",{ref:ln,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(t.Box,e.__assign({ref:Ki,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(t.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(t.Box,e.__assign({onClick:function(n){n.stopPropagation(),dn.open&&mn===Pi?En():(_n(Pi),Cn(Hi(n.currentTarget,{title:"",content:"",evaluationResult:Ni,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Pi,!0,e.__assign(e.__assign({},Li),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Li.badgeBg,color:Li.badgeText,border:"1px solid ".concat(Li.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ki?ki:n.jsx(f.default,{}),n.jsx(t.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:dn.open&&mn===Pi?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(t.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},be?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[di&&n.jsx(l.default,{sections:11}),n.jsx(t.Box,e.__assign({ref:Ve,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(t.Tooltip,e.__assign({title:On,placement:"top"},{children:n.jsx(t.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:On}))}))})),n.jsxs(t.Box,e.__assign({ref:nn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:tn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&Ln.map(function(e,i){return n.jsx(y.default,{section:e,idx:i},"right-row-".concat(i))}),n.jsx("div",{ref:on,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"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),s=require("./CognitiveComparehelpers.js"),u=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),c=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),f=require("./components/ThreeDotsLoader.js"),p=require("./hooks/useCompareData.js"),g=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),m=require("./hooks/useAccordionState.js"),S=require("./hooks/useDeviationNavigation.js"),R=require("./components/CompareHeader.js"),x=require("./components/SubSectionAccordion.js"),_=require("./components/LHSSectionRow.js"),y=require("./components/RHSSectionRow.js"),b=require("./components/CognitiveSummaryPopup.js"),C=require("./CompareContext.js"),E=require("./hooks/useStyles.js"),A=require("./hooks/useResizeHandler.js"),B=require("./hooks/useLinesCalculator.js"),w=require("./hooks/useSideBySide.js"),T=require("./components/SvgConnectors.js");exports.SHARED_MARKDOWN_STYLES=u.SHARED_MARKDOWN_STYLES,exports.default=function(I){var D,F,O,j,P,N,k,L,q,M,H,V,z,G,W,K,U,Y,X,$,J,Q,Z,ee,ne,ie,te=I.componentHeaderText,oe=void 0===te?a.DEFAULT_COMPONENT_HEADER_TEXT:te,re=I.treeData,le=I.comparisonConfig,se=I.leftColumnTitleText,ue=I.rightColumnTitleText,ae=I.markdownStyles,ce=I.resetTrigger,de=I.displayConfig,ve=void 0===de?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:de,fe=I.popupConfig,pe=I.deviationData,ge=void 0===pe?{}:pe,he=I.deviationNodeIdToView,me=I.resetDeviationNodeId,Se=I.isProposingFix,Re=void 0!==Se&&Se,xe=I.proposingFixNodeId,_e=I.isRedlineFlow,ye=i.useState(ve.maintainRelativeOrder),be=ye[0],Ce=ye[1],Ee=!!be||!!(null==ve?void 0:ve.showDeviationBadges),Ae=i.useState(!1),Be=Ae[0],we=Ae[1],Te=i.useState(null),Ie=Te[0],De=Te[1],Fe=i.useState(null===(F=null!==(D=null==re?void 0:re.newEvaluationResult)&&void 0!==D?D:null==ve?void 0:ve.enableDeviationSchemaBackwardCompatibility)||void 0===F||F)[0],Oe=i.useState(new Set),je=Oe[0],Pe=Oe[1],Ne=i.useState([]),ke=Ne[0],Le=Ne[1],qe=i.useRef(null),Me=i.useRef(null),He=i.useRef(null),Ve=i.useRef(null),ze=i.useRef(null),Ge=i.useRef(!1),We=i.useRef(null),Ke=i.useRef({}),Ue=i.useRef([]),Ye=i.useRef(function(){}),Xe=i.useRef(null),$e=i.useRef(function(){}),Je=i.useMemo(function(){return(null==re?void 0:re.cognitive_decisioning)||{}},[re]),Qe=i.useMemo(function(){return e.__assign(e.__assign({},u.SHARED_MARKDOWN_STYLES),ae)},[ae]),Ze=i.useRef(null),en=i.useRef(null),nn=i.useRef(null),tn=i.useRef(null),on=i.useRef(null),rn=i.useRef(null),ln=i.useRef(null),sn=i.useRef(null),un=i.useRef(null),an=i.useRef(null),cn=g.useComparePopups(Ze),dn=cn.cognitivePopup,vn=cn.setCognitivePopup,fn=cn.moreFunctions,pn=cn.setMoreFunctions,gn=cn.position,hn=cn.setPosition,mn=cn.activeBadgeId,Sn=cn.summaryPopup,Rn=cn.setSummaryPopup,xn=cn.closeSummaryPopup,_n=cn.setActiveBadgeId,yn=cn.popupRef,bn=cn.handleOpenCognitiveCompare,Cn=cn.openCognitivePopupFromState,En=cn.closeCognitivePopup,An=cn.closeMoreFunctionsPopup,Bn=i.useMemo(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==le?void 0:le.fields)&&void 0!==e?e:u.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(n=null==le?void 0:le.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:u.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(t=null==le?void 0:le.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:u.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==le?void 0:le.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:u.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[le]),wn=i.useState(null),Tn=wn[0];wn[1];var In=null===(P=null===(O=null==re?void 0:re.documents)||void 0===O?void 0:O[null===(j=null==re?void 0:re.input_index_map)||void 0===j?void 0:j[0]])||void 0===P?void 0:P.title,Dn=null===(L=null===(N=null==re?void 0:re.documents)||void 0===N?void 0:N[null===(k=null==re?void 0:re.input_index_map)||void 0===k?void 0:k[1]])||void 0===L?void 0:L.title,Fn=s.safeStringify(se||In||"Uploaded Contract"),On=s.safeStringify(ue||Dn||"Reference Template"),jn=p.useCognitiveTreeData(re,be,ge,Bn,Fe),Pn=jn.activeProposed,Nn=jn.existingRule,kn=jn.proposedSections,Ln=jn.existingSections,qn=jn.visibleFields,Mn=jn.parentDeviationRecord,Hn=jn.deviationNumberRegistry,Vn=jn.parseError;i.useEffect(function(){Vn&&De("Failed to load comparison: ".concat(Vn))},[Vn]);var zn=kn.length>0||Ln.length>0,Gn=i.useMemo(function(){if(!_e)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";s.hasMeaningfulRedlineTags(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(kn),i(Ln),"".concat(e,":").concat(n)},[_e,kn,Ln]),Wn=h.useSectionRefs(qn.map(function(e){return e.key}),Math.max(kn.length,Ln.length)),Kn=Wn.leftRefs,Un=Wn.rightRefs,Yn=Wn.sectionLeftRefs,Xn=Wn.sectionRightRefs,$n=Wn.lhsBadgeRefs,Jn=Wn.rhsBadgeRefs,Qn=Wn.sectionRightRowRefs,Zn=Wn.subSectionLeftRefs,ei=Wn.subSectionRightRefs,ni=Wn.sectionRowRefs,ii=Wn.getSectionRowRef,ti=Wn.getSubSectionRef,oi=Wn.getBadgeRef,ri=w.useSideBySide({maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,leftContainerRef:sn,rightContainerRef:nn,scrollContainerRef:Ze,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,sectionRightRowRefs:Qn,rhsTopSpacerRef:tn,rhsBottomSpacerRef:on,lhsTopSpacerRef:rn,lhsBottomSpacerRef:ln,calculateLinesRef:Ye,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,closeMoreFunctionsPopup:An,setErrorToast:De,moreFunctions:fn,closeSummaryPopup:xn}),li=ri.isSideBySide,si=ri.isArrowVisible,ui=ri.setIsArrowVisible,ai=ri.isResizing,ci=ri.setIsResizing,di=ri.isSideBySideLoading,vi=ri.activeSideBySideSection,fi=ri.scrollLock,pi=ri.sideBySideCacheRef,gi=ri.isSideBySideRef,hi=ri.activeSideBySideRightSectionRef,mi=ri.activeSideBySideSectionRef,Si=ri.sideBySideLineRef,Ri=ri.highlightedClauseRefs,xi=ri.clearClauseHighlight,_i=ri.applyAlignmentPadding,yi=ri.resetSideBySide,bi=ri.activateSideBySide,Ci=m.useAccordionState({maintainRelativeOrder:!!be,proposedSections:kn,existingSections:Ln,activeSideBySideSection:vi,connectedSections:je,resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,svgContainerRef:qe,isAnimatingRef:Ge,animationTimerRef:We,calculateLinesRef:Ye,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei}),Ei=Ci.expandedSections,Ai=Ci.setExpandedSections,Bi=Ci.expandedSubSections,wi=Ci.setExpandedSubSections,Ti=Ci.handleSubSectionToggle,Ii=Ci.toggleSection;i.useEffect(function(){_e&&"off"!==Gn&&"0:0"!==Gn&&(pi.current=null,Ue.current=[],requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)}))},[_e,Gn]);var Di=i.useMemo(function(){var e=new Map,n=new Map,i=1;if(be)kn.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Ln.forEach(function(t){if(t.id){var o=kn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(kn.length,Ln.length),o=0;o<t;o++){var r=kn[o],l=Ln[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[kn,Ln,be]),Fi=Nn.analysis,Oi=s.safeStringify(null===(M=null===(q=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===q?void 0:q.summary)||void 0===M?void 0:M.overall_summary),ji=!!Oi.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Pi=null!==(H=null==re?void 0:re.base_root_id)&&void 0!==H?H:"-1";null==re||re[Pi];var Ni=Fe?null!==(Z=null!==($=ge&&(null===(X=null==ge?void 0:ge[Pi])||void 0===X?void 0:X.evaluation_result))&&void 0!==$?$:null===(Q=null===(J=null==re?void 0:re.nodes)||void 0===J?void 0:J[Pi])||void 0===Q?void 0:Q.evaluation_result)&&void 0!==Z?Z:null:null!==(Y=null!==(G=ge&&(null===(z=null===(V=null==ge?void 0:ge[Pi])||void 0===V?void 0:V.evaluation_result)||void 0===z?void 0:z[0]))&&void 0!==G?G:null===(U=null===(K=null===(W=null==re?void 0:re.nodes)||void 0===W?void 0:W[Pi])||void 0===K?void 0:K.evaluation_result)||void 0===U?void 0:U[0])&&void 0!==Y?Y:null,ki=s.extractDeviationScore(Ni),Li=s.generateColorPalette(null!==(ie=null===(ne=null===(ee=null==Ni?void 0:Ni.evaluation_outputs)||void 0===ee?void 0:ee.metadata)||void 0===ne?void 0:ne.label_color)&&void 0!==ie?ie:a.DEFAULT_DEVIAION_COLOR),qi=i.useCallback(function(){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],et([]),it(null),Rn(a.EMPTY_SUMMARY_POPUP_STATE),En(),requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)})},[]),Mi=i.useRef(qi);i.useEffect(function(){Mi.current=qi},[qi]),i.useEffect(function(){ce&&Mi.current()},[ce]);var Hi=i.useCallback(function(n,i,t,o,r,l,u){var a,c,d,v=s.safeStringify(null==i?void 0:i.id)||s.safeStringify(null==t?void 0:t.id)||"",f=(v?Je[v]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},p=null!==(c=null===(a=ni.current[o])||void 0===a?void 0:a.current)&&void 0!==c?c:null;return{isLoading:null!==(d=null==ve?void 0:ve.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:f,anchorEl:n,sectionAnchorEl:p,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==re?void 0:re.documents,input_index_map:null==re?void 0:re.input_index_map},deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)))return u(l);var a=o.split(s.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var c=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},d=(null===(n=null==c?void 0:c.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==c?void 0:c.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},c),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==c?void 0:c.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==c?void 0:c.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==c?void 0:c.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==c?void 0:c.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==c?void 0:c.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==c?void 0:c.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Je,re]),Vi=i.useCallback(function(){var e=fn.sectionIdx,n=fn.isOrphan;An(),xn(),null!==e&&(n?De("No counterpart exists to connect to."):(xi(),gi.current&&yi(),Le([]),Ue.current=[],Pe(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Ye.current&&Ye.current()},50)))},[fn.sectionIdx,fn.isOrphan,An,xn,yi]),zi=i.useCallback(function(){var e=ze.current;if(e){ze.current=null;var n=kn.findIndex(function(n){return n.id===e}),i=Ln.findIndex(function(n){return n.id===e}),t=-1===n?s.findKeyPathByNodeId(kn,e):null,o=-1===i?s.findKeyPathByNodeId(Ln,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,s;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(s=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==s?s:null},a=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(Ri.current.add(r),s.scrollAndHighlightClause(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(be)-1!==r&&sn.current&&a(function(){return u(n,t,Yn,Zn)},sn.current),-1!==l&&nn.current&&a(function(){return u(i,o,Xn,ei)},nn.current);else{var c=Ze.current;if(!c)return;a(function(){return-1!==r?u(n,t,Yn,Zn):u(i,o,Xn,ei)},c)}}},[kn,Ln,be,Yn,Xn,Zn,ei,sn,nn,Ze]),Gi=i.useCallback(function(n){if(n){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En();var i=kn.findIndex(function(e){return e.id===n}),t=Ln.findIndex(function(e){return e.id===n}),o=-1===i?s.findKeyPathByNodeId(kn,n):null,r=-1===t?s.findKeyPathByNodeId(Ln,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;ze.current=n,Ai(function(n){var i,t=e.__assign({},n),o=!1;-1!==l&&(t[i=be?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=be?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),wi(function(n){var i=e.__assign({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){ze.current===n&&Wi.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[kn,Ln,be,Ai,wi,yi,xn,En]),Wi=i.useRef(zi);i.useEffect(function(){Wi.current=zi},[zi]);var Ki=i.useRef(null);i.useEffect(function(){if(Tn){var e=Bn.fields.find(function(e){return e.analysisKey===Tn||e.key===Tn});if(e){var n=Kn.current[e.key]||Un.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Tn,Bn.fields]);var Ui=i.useCallback(function(e){var n,i,t,o,r,l,s,u,a,c=null===(n=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.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 f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(s=f.highlights)||void 0===s?void 0:s.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===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Fi]),Yi=E.useStyleHelpers({proposedSections:kn,existingSections:Ln,maintainRelativeOrder:be,cognitiveMap:Je,deviationData:ge,treeData:re,resolvedComparisonConfig:Bn}),Xi=Yi.getSectionCompareStyle,$i=Yi.getSubSectionCompareStyle,Ji=Yi.getDeviationStyleByKey,Qi=B.useLinesCalculator({containerRef:Me,leftContainerRef:sn,rightContainerRef:nn,svgContainerRef:qe,pathRefs:Ke,leftHeaderRef:He,rightHeaderRef:Ve,proposedSections:kn,existingSections:Ln,visibleFields:qn,leftRefs:Kn,rightRefs:Un,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,expandedSections:Ei,expandedSubSections:Bi,connectedSections:je,isSideBySide:li,activeSideBySideSection:vi,maintainRelativeOrder:be,cognitiveMap:Je,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getDeviationStyleByKey:Ji,isArrowVisible:si,isAnimatingRef:Ge,isSideBySideRef:gi,sideBySideCacheRef:pi,sideBySideLineRef:Si,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,connectedLines:ke,setConnectedLines:Le,cachedConnectedPositions:Ue,calculateLinesRef:Ye,resizeTimerRef:Xe,scrollLock:fi,handleResizeRef:$e,activeProposed:Pn,existingRule:Nn,analysisData:Fi,pendingScrollTargetRef:un,pendingScrollCallbackRef:an,resolvedComparisonConfig:Bn,getFieldData:Ui}),Zi=Qi.lines,et=Qi.setLines,nt=Qi.overallConnector,it=Qi.setOverallConnector,tt=Qi.svgDimensions,ot=Qi.handleColumnScroll,rt=i.useCallback(function(){xi(),Ai({}),wi({}),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En(),An(),requestAnimationFrame(function(){Ye.current&&Ye.current()})},[Ai,wi,yi,xn,En,An]),lt=i.useMemo(function(){return Object.values(Ei).some(Boolean)||Object.values(Bi).some(Boolean)},[Ei,Bi]),st=i.useRef(null),ut=i.useRef(0),at=i.useRef(0),ct=i.useRef(0),dt=A.useResizeHandler({timerRef:st,ruleComponentRef:en,scrollContainerRef:Ze,containerRef:Me,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,isSideBySideRef:gi,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,sectionRowRefs:ni,sectionRightRowRefs:Qn,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,leftContainerRef:sn,rightContainerRef:nn,calculateLinesRef:Ye,handleResizeRef:$e,setIsResizing:ci,setIsArrowVisible:ui,sideBySideCacheRef:pi,cachedConnectedPositions:Ue}).handleResize;i.useEffect(function(){$e.current=dt},[dt,$e]),i.useEffect(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,s;i.current=null;var u=e[e.length-1];if(u){var a=null!==(s=null===(l=null===(r=u.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==s?s:u.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return en.current&&o.push(e(en.current,ut,n,function(){return $e.current()},function(){})),Ze.current&&o.push(e(Ze.current,at,i,function(){return $e.current()},function(){return Ye.current()})),Me.current&&o.push(e(Me.current,ct,t,function(){return $e.current()},function(){return Ye.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),i.useEffect(function(){gi.current=li},[li]),i.useEffect(function(){mi.current=vi},[vi]);var vt=i.useCallback(function(){var e,n=fn.sectionIdx,i=fn.isOrphan;if(xn(),null!=n){var t="left";fn.anchorEl&&(null===(e=nn.current)||void 0===e?void 0:e.contains(fn.anchorEl))&&(t="right"),bi(n,i,{sourceSide:t})}},[bi,fn.isOrphan,fn.sectionIdx,fn.anchorEl,xn]),ft=i.useCallback(function(){xn(),yi(),Pe(new Set),Le([]),Ue.current=[]},[xn,yi]),pt=null!==fn.sectionIdx&&je.has(fn.sectionIdx),gt=S.useDeviationNavigation({proposedSections:kn,existingSections:Ln,parentDeviationRecord:Mn,expandedSections:Ei,maintainRelativeOrder:!!be,scrollContainerRef:Ze,leftContainerRef:sn,rightContainerRef:nn,lhsBadgeRefs:$n,rhsBadgeRefs:Jn}),ht=gt.showDeviationNavigation,mt=gt.showOpenNodeRef,St=gt.adjustScrollForPopup,Rt=i.useCallback(function(e,n,i,t,o){var r,l="string"==typeof t?s.safeStringify(t).trim():s.safeStringify(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;En();var a="left";(null===(r=nn.current)||void 0===r?void 0:r.contains(u))&&(a="right");var c=function(){var e,i,t,o;if("string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=n.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(i=$n.current[l])||void 0===i?void 0:i.current}return"right"===a?null===(t=Jn.current[n])||void 0===t?void 0:t.current:null===(o=$n.current[n])||void 0===o?void 0:o.current},d=function(e,t){var o=!!be,r=o?"right"===a?nn.current:sn.current:Ze.current,l=o?"right"===a?sn.current:nn.current:null;if(r&&e){var u=function(){var e="string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR);i||!e?t():requestAnimationFrame(function(){var e,i,o;pi.current=null,Ue.current=[],_i(!0,n,null),null===(e=Ye.current)||void 0===e||e.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),t()})},c=e.getBoundingClientRect(),d=r.getBoundingClientRect(),v=d.bottom-.35*d.height,f=d.top+.35*d.height;if(c.top>v||c.top<f){var p=d.top+d.height/2,g=c.top+c.height/2-p;o&&l&&s.smoothScrollTo(l,l.scrollTop+g,250,function(){}),s.smoothScrollTo(r,r.scrollTop+g,250,u)}else u()}else t()};if(i)return yi(),Pe(new Set),Le([]),Ue.current=[],void(l&&requestAnimationFrame(function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}));bi(n,i,l?{toggleIfSame:!1,sourceSide:a,onReady:function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}}:{toggleIfSame:!1,sourceSide:a})},[bi,En,Rn,yi,be]),xt=i.useMemo(function(){var e;if(!he)return null;var n=null===(e=null==he?void 0:he.id)||void 0===e?void 0:e.split(":")[0];for(var i in Mn){if((Mn[i]||[]).some(function(e){return e.id===n}))return i}return null},[he,Mn]),_t=i.useRef({id:null,triggerMs:null}),yt=i.useRef(null);i.useEffect(function(){var n;if(null==he?void 0:he.id){var i=Number(he.trigger),t=_t.current;if((null==t?void 0:t.triggerMs)!==i){if(!(he.id.includes(":")&&/:\d+$/.test(he.id)))return _t.current={id:he.id,triggerMs:i},void Gi(he.id);var o=null===(n=null==he?void 0:he.id)||void 0===n?void 0:n.split(":"),r=o[0],l=o[1],u=null!=l?l:"0";yt.current!==he.id&&(xn(),En(),yi(),Pe(new Set),Le([]),Ue.current=[],yt.current=he.id);var a=!1,c=0,d=null,v=150,f=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},p=function(){var n,t,o,l;if(!a){var g=function(){_t.current={id:he.id,triggerMs:i}},h=null,m=null;for(var S in Mn){var R=Mn[S].find(function(e){return e.id===r});if(R){h=S,m=R;break}}if(m&&h){var x=kn.findIndex(function(e){return e.id===h}),_=Ln.findIndex(function(e){return e.id===h}),y=-1===x&&-1!==_,b=f(kn,m.id),C=f(Ln,m.id);if(b&&!C&&!y){var E=b.split("-"),A=Number(E[0]);if(be){var B=null===(t=null===(n=kn[A])||void 0===n?void 0:n.refIndexes)||void 0===t?void 0:t[0],w=Ln.findIndex(function(e){return e.selfIndex===B});-1!==w&&(A=w)}C=e.__spreadArray([A],E.slice(1),!0).join("-")}if(b||C){var T=y||!b&&!!C,I=b?Number(b.split("-")[0]):x,D=C?Number(C.split("-")[0]):_;if(T){if(!(be?!!Ei["right-".concat(D)]:!!Ei[String(D)])&&D>=0)return Ii(D,"right"),c+=1,void(d=setTimeout(p,450))}else if(!(be?!!Ei["left-".concat(I)]:!!Ei[String(I)])&&I>=0)return Ii(I,"left"),c+=1,void(d=setTimeout(p,450));var F,O=b||"",j=C||"",P="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u).concat(s.DEVIATION_BADGE_SEPARATOR).concat(O).concat(s.DEVIATION_BADGE_SEPARATOR).concat(j),N="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u),k=null===(o=$n.current[N])||void 0===o?void 0:o.current,L=null===(l=Jn.current[N])||void 0===l?void 0:l.current,q=T||!k&&!!L,M=q?L:k;if(F=be?q?nn.current:sn.current:Ze.current,M&&F){var H=M.getBoundingClientRect();if(0===H.height)return void((c+=1)<2?d=setTimeout(p,v):g());var V=F.getBoundingClientRect(),z=H.top-V.top+F.scrollTop-V.height/2+H.height/2+150,G=function(){var n,i,t,o,r;if(!a){g();var l=M instanceof Element?window.getComputedStyle(M).color:"";k&&(k.style.transition="box-shadow 300ms ease-in-out",k.style.boxShadow="0 0 10px ".concat(l)),L&&(L.style.transition="box-shadow 300ms ease-in-out",L.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){k&&(k.style.boxShadow=""),L&&(L.style.boxShadow="")},2e3);var s=(null===(i=null===(n=m.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[u])||m,c=(null===(t=m.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||m.evaluation_outputs;if(!(!!k&&!!L)){var d=q?(null===(o=Jn.current[N])||void 0===o?void 0:o.current)||L:(null===(r=$n.current[N])||void 0===r?void 0:r.current)||k;return St(d,function(){Rn({open:!0,anchorEl:d,displayImpact:he.displayImpact,summary:e.__assign(e.__assign({},s),{evaluation_outputs:c})})}),void(null==me||me())}bi(P,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,i,t=q?(null===(n=Jn.current[N])||void 0===n?void 0:n.current)||L:(null===(i=$n.current[N])||void 0===i?void 0:i.current)||k;St(t,function(){requestAnimationFrame(function(){var n,i,o;pi.current=null,Ue.current=[],_i(!0,P,null),null===(n=Ye.current)||void 0===n||n.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),Rn({open:!0,anchorEl:t,displayImpact:null==he?void 0:he.displayImpact,summary:e.__assign({},s)})})})}})}};Math.abs(F.scrollTop-z)<=2?G():(un.current=z,an.current=G,F.scrollTo({top:z,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(an.current){un.current=null;var e=an.current;an.current=null,e()}},800))}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}};return d=setTimeout(p,v),function(){a=!0,d&&clearTimeout(d)}}}},[he,Mn,kn,Ln,be,Ei,Ii,bi,Rn,Gi]);var bt={maintainRelativeOrder:!!be,showDeviationBadges:Ee,isProposingFix:Re,proposingFixNodeId:xe,isRedlineFlow:_e,isSideBySide:li,activeSideBySideSection:vi,connectedSections:je,proposedSections:kn,existingSections:Ln,deviationNumberRegistry:Hn,treeData:re,displayConfig:ve,resolvedMarkdownStyles:Qe,unifiedNumbering:Di,expandedSections:Ei,expandedSubSections:Bi,setExpandedSubSections:wi,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getBadgeRef:oi,getSectionRowRef:ii,getSubSectionRef:ti,sectionLeftRefs:Yn,sectionRightRefs:Xn,sectionRowRefs:ni,sectionRightRowRefs:Qn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,openMoreFunctionsPopup:function(e,n,i,t,o,r){var l;if(e.stopPropagation(),fn.open&&fn.sectionIdx===o)An();else{var u=e.currentTarget,a="left";(null===(l=nn.current)||void 0===l?void 0:l.contains(u))&&(a="right");xi(),gi.current&&yi(),Pe(new Set),Le([]),Ue.current=[],En(),Sn.open?ft():xn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=o.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(n=$n.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(i=Jn.current[o])||void 0===i?void 0:i.current:null===(t=$n.current[o])||void 0===t?void 0:t.current}()||u;pn(Hi(e,n,t,o,i,r))})}},handleOpenSummaryPopup:Rt,openSummaryPopup:Rt,handleCloseSummaryPopup:ft,toggleSection:Ii,handleSubSectionToggle:Ti,renderSubSectionAccordion:function(e){var i=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,s=void 0===l?"left":l,u=e.parentNodeId,a=void 0===u?"":u,c=e.sectionOffset;return n.jsx(x.default,{section:i,keyPath:t,depth:r,columnKey:s,parentNodeId:a,sectionOffset:c})},resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,showDeviationNavigation:ht,showOpenNodeRef:mt,deviationNodeIdToView:null==he?void 0:he.id,deviationTargetParentId:xt};return n.jsx(C.CompareContextProvider,e.__assign({value:bt},{children:n.jsxs(t.Box,e.__assign({ref:en,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},be?{}:{overflow:"visible"}),{position:"relative"})},{children:[Be&&n.jsx(t.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,{})})),Sn.open&&n.jsx(b.default,{open:Sn.open,anchorEl:Sn.anchorEl,containerEl:Ki.current,clipTopEl:He.current,scrollContainerEl:Ze.current,onClose:ft,summary:Sn.summary,displayImpact:Sn.displayImpact}),n.jsx(d.default,{open:fn.open,anchorEl:fn.anchorEl,sectionTitle:fn.sectionTitle,referenceSectionTitle:fn.refSectionTitle,onClose:An,onOpenCognitiveCompare:bn,onOpenSideBySide:vt,onConnect:Vi,isConnected:pt,isOrphan:fn.isOrphan}),dn.open&&n.jsx(c.default,{open:dn.open,popupRef:yn,position:gn,popupConfig:fe,onClose:function(){hn(null),vn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),_n(null)},markdownStyles:ae,sectionTitle:Fn,referenceSectionTitle:On,cognitiveData:dn.cognitiveData,anchorEl:dn.anchorEl,sectionAnchorEl:dn.sectionAnchorEl,scrollContainerEl:Ze.current,badgeStyle:dn.badgeStyle,docData:dn.docData,deviationData:dn.deviationData,isLoading:dn.isLoading}),n.jsx(t.Snackbar,e.__assign({open:!!Ie,autoHideDuration:8e3,onClose:function(){return De(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(t.Alert,e.__assign({onClose:function(){return De(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ie}))})),n.jsx(R.default,{componentHeaderText:oe,displayConfig:ve,maintainRelativeOrder:be,onCollapseAll:rt,showCollapseAll:lt,onToggleView:function(e){we(!0),setTimeout(function(){Ce(!e),yi(),xn(),Pe(new Set),Le([]),Ue.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){we(!1)},600)})})},50)}}),n.jsx(t.Box,e.__assign({ref:Ze,onScroll:ot,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:be?"hidden":"auto",borderTop:Oi&&ji?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(t.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},be?{flex:1,minHeight:0}:{})},{children:n.jsxs(t.Box,e.__assign({ref:Me,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(T.default,{svgContainerRef:qe,svgDimensions:tt,isResizing:ai,overallConnector:nt,rootDeviationStyle:Li,lines:Zi,isSideBySide:li,activeSideBySideSection:vi,isArrowVisible:si,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,cognitivePopup:dn,activeBadgeId:mn,closeCognitivePopup:En,setActiveBadgeId:_n,openCognitivePopupFromState:Cn,buildSectionPopupState:Hi,connectedLines:ke,pathRefs:Ke}),n.jsxs(t.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)"},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(t.Box,e.__assign({ref:He,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(t.Tooltip,e.__assign({title:Fn,placement:"top"},{children:n.jsx(t.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:Fn}))}))})),n.jsxs(t.Box,e.__assign({ref:sn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{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:rn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&kn.map(function(e,i){return n.jsx(_.default,{section:e,idx:i},"left-row-".concat(i))}),n.jsx("div",{ref:ln,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(t.Box,e.__assign({ref:Ki,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(t.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(t.Box,e.__assign({onClick:function(n){n.stopPropagation(),dn.open&&mn===Pi?En():(_n(Pi),Cn(Hi(n.currentTarget,{title:"",content:"",evaluationResult:Ni,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Pi,!0,e.__assign(e.__assign({},Li),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Li.badgeBg,color:Li.badgeText,border:"1px solid ".concat(Li.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ki?ki:n.jsx(f.default,{}),n.jsx(t.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:dn.open&&mn===Pi?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(t.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},be?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[di&&n.jsx(l.default,{sections:11}),n.jsx(t.Box,e.__assign({ref:Ve,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(t.Tooltip,e.__assign({title:On,placement:"top"},{children:n.jsx(t.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:On}))}))})),n.jsxs(t.Box,e.__assign({ref:nn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:tn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&Ln.map(function(e,i){return n.jsx(y.default,{section:e,idx:i},"right-row-".concat(i))}),n.jsx("div",{ref:on,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"),o=require("react"),n=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(o).default.memo(function(o){var d,c,u=o.section,p=o.idx,x=s.useCompareContext(),g=x.maintainRelativeOrder,v=x.existingSections;x.proposedSections;var f=x.connectedSections,m=x.expandedSections,b=x.displayConfig,h=x.treeData;x.deviationNumberRegistry;var S=x.getSectionCompareStyle;x.getBadgeRef;var B=x.getSectionRowRef,_=x.sectionLeftRefs,R=x.lhsBadgeRefs,j=x.openMoreFunctionsPopup,y=x.handleOpenSummaryPopup,w=x.handleCloseSummaryPopup,C=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var I=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var N=x.unifiedNumbering,q=!u.title&&!u.content;if(g&&q)return null;var D=u,P=S(p,"left"),T=g?!(null===(d=D.refIndexes)||void 0===d?void 0:d.length)||D.selfIndex<0:!v[p],k=f.has(p),z=l.extractDeviationScore(D.evaluationResult,null==P?void 0:P.deviationLabel),A=N.leftNums.get(D.id);return i.jsx(n.Box,e.__assign({ref:B(p),sx:{mb:1,width:"100%"}},{children:i.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),o=require("react"),n=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(o).default.memo(function(o){var d,c,u=o.section,p=o.idx,x=s.useCompareContext(),g=x.maintainRelativeOrder,v=x.existingSections;x.proposedSections;var f=x.connectedSections,m=x.expandedSections,b=x.displayConfig,h=x.treeData;x.deviationNumberRegistry;var S=x.getSectionCompareStyle;x.getBadgeRef;var B=x.getSectionRowRef,_=x.sectionLeftRefs,R=x.lhsBadgeRefs,j=x.openMoreFunctionsPopup,y=x.handleOpenSummaryPopup,w=x.handleCloseSummaryPopup,C=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var I=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var N=x.unifiedNumbering,q=!u.title&&!u.content;if(g&&q)return null;var D=u,P=S(p,"left"),T=g?!(null===(d=D.refIndexes)||void 0===d?void 0:d.length)||D.selfIndex<0:!v[p],k=f.has(p),z=l.extractDeviationScore(D.evaluationResult,null==P?void 0:P.deviationLabel),A=N.leftNums.get(D.id);return i.jsx(n.Box,e.__assign({ref:B(p),sx:{mb:1,width:"100%"}},{children:i.jsx(n.Box,e.__assign({ref:_.current[p],sx:e.__assign({width:"100%",display:"flex",flexDirection:"column",minWidth:0},k&&{borderRadius:"6px",outline:"2px solid ".concat((null==P?void 0:P.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i.jsxs(n.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[i.jsx(r.default,{section:u,idx:p,columnKey:"left",colRef:B("left-accordion-".concat(p)),mb:0,parentNodeId:(null===(c=null==h?void 0:h.input_index_map)||void 0===c?void 0:c[0])||"",isExpanded:g?!!m["left-".concat(p)]:!!m[String(p)],onToggle:function(){w(),C(p,"left")},navigation:u.id?I[u.id]:null}),g&&P&&i.jsxs(n.Box,e.__assign({ref:R.current[p],onClick:function(e){var i,o,n,t=b.enableDeviationSchemaBackwardCompatibility?null!==(i=D.evaluationResult)&&void 0!==i?i:null:null!==(n=null===(o=D.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==n?n:null;y(e,String(p),T,t)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:P.badgeBg,color:P.badgeText,border:"1px solid ".concat(P.badgeBorder),borderRadius:"12px",px:1.2,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[i.jsxs(n.Box,e.__assign({component:"span",onClick:function(e){var i,o,n;e.stopPropagation();var t=b.enableDeviationSchemaBackwardCompatibility?null!==(i=D.evaluationResult)&&void 0!==i?i:null:null!==(n=null===(o=D.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==n?n:null;y(e,String(p),T,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:T?"default":"pointer",borderRight:"1px solid ".concat(P.badgeBorder),"&:hover":T?{}:{bgColor:"".concat(P.badgeBorder,"22")}}},{children:[null!=A&&i.jsx(n.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(P.badgeBorder)}},{children:A})),i.jsx(n.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!b.isLoading||null!=D.evaluationResult&&void 0!==D.evaluationResult?"N/A"===z||"NA"===z?"N/A":0==z||null==z?"Same":"".concat(z):i.jsx(a.default,{color:P.badgeText})}))]})),i.jsx(n.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var i=g?v.find(function(e){var i;return null===(i=D.refIndexes)||void 0===i?void 0:i.includes(e.selfIndex)})||{title:"",content:""}:v[p]||{title:"",content:""};j(e,u,T,i,p,P)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(P.badgeBorder,"22")}}},{children:i.jsx(t.EllipsisVertical,{size:11,color:P.badgeText})}))]}))]}))}))}),"left-row-".concat(p))});exports.default=c;
|
|
2
2
|
//# sourceMappingURL=LHSSectionRow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=d(n).default.memo(function(n){var d,s,c=n.section,u=n.idx,x=l.useCompareContext(),p=x.maintainRelativeOrder;x.existingSections;var g=x.proposedSections,v=x.connectedSections,f=x.expandedSections,h=x.displayConfig,b=x.treeData;x.deviationNumberRegistry;var m=x.getSectionCompareStyle;x.getBadgeRef;var S=x.getSectionRowRef,B=x.sectionRightRefs,_=x.rhsBadgeRefs,R=x.openMoreFunctionsPopup,j=x.handleOpenSummaryPopup,y=x.handleCloseSummaryPopup,I=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var w=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var C=x.unifiedNumbering,q=c,N=!1,P=null,D=-1;if(p){D=g.findIndex(function(e){var i;return(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(q.selfIndex))&&e.selfIndex>=0});var T=g.findIndex(function(e,i){var n;return v.has(i)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(q.selfIndex))});(N=-1!==T)&&(P=m(T,"left"))}else(N=v.has(u))&&(P=m(u,"right"));var k=p&&-1!==D?m(D,"left"):m(u,"right"),z=p?-1!==D||!(null===(d=q.refIndexes)||void 0===d?void 0:d.length)&&g.some(function(e){return e.id&&e.id===q.id}):Boolean(g[u]),F=p?q.selfIndex<0||!z:!g[u],O=C.rightNums.get(q.id);return i.jsx(o.Box,e.__assign({ref:S(u),sx:{mb:1,width:"100%"}},{children:i.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=d(n).default.memo(function(n){var d,s,c=n.section,u=n.idx,x=l.useCompareContext(),p=x.maintainRelativeOrder;x.existingSections;var g=x.proposedSections,v=x.connectedSections,f=x.expandedSections,h=x.displayConfig,b=x.treeData;x.deviationNumberRegistry;var m=x.getSectionCompareStyle;x.getBadgeRef;var S=x.getSectionRowRef,B=x.sectionRightRefs,_=x.rhsBadgeRefs,R=x.openMoreFunctionsPopup,j=x.handleOpenSummaryPopup,y=x.handleCloseSummaryPopup,I=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var w=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var C=x.unifiedNumbering,q=c,N=!1,P=null,D=-1;if(p){D=g.findIndex(function(e){var i;return(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(q.selfIndex))&&e.selfIndex>=0});var T=g.findIndex(function(e,i){var n;return v.has(i)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(q.selfIndex))});(N=-1!==T)&&(P=m(T,"left"))}else(N=v.has(u))&&(P=m(u,"right"));var k=p&&-1!==D?m(D,"left"):m(u,"right"),z=p?-1!==D||!(null===(d=q.refIndexes)||void 0===d?void 0:d.length)&&g.some(function(e){return e.id&&e.id===q.id}):Boolean(g[u]),F=p?q.selfIndex<0||!z:!g[u],O=C.rightNums.get(q.id);return i.jsx(o.Box,e.__assign({ref:S(u),sx:{mb:1,width:"100%"}},{children:i.jsx(o.Box,e.__assign({ref:B.current[u],sx:e.__assign({width:"100%",display:"flex"},N&&P&&{borderRadius:"6px",outline:"2px solid ".concat(P.badgeBorder),outlineOffset:"1px"})},{children:i.jsxs(o.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[i.jsx(r.default,{section:c,idx:u,columnKey:"right",colRef:S("right-accordion-".concat(u)),mb:0,parentNodeId:(null===(s=null==b?void 0:b.input_index_map)||void 0===s?void 0:s[1])||"",isExpanded:p?!!f["right-".concat(u)]:!!f[String(u)],onToggle:function(){y(),I(u,"right")},navigation:c.id?w[c.id]:null}),p&&k&&i.jsx(o.Box,e.__assign({ref:_.current[u],"data-section-id":q.id,onClick:function(e){var i,n,o;if(F){var t=h.enableDeviationSchemaBackwardCompatibility?null!==(i=q.evaluationResult)&&void 0!==i?i:null:null!==(o=null===(n=q.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==o?o:null;j(e,String(u),F,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:F?"4px":"0px",fontSize:"11px",bgcolor:k.badgeBg,color:k.badgeText,border:"1px solid ".concat(k.badgeBorder),borderRadius:F?"12px":"10px",px:F?1.2:1,py:.3,fontWeight:F?600:700,cursor:F?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:F?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:F?i.jsxs(i.Fragment,{children:[i.jsxs(o.Box,e.__assign({component:"span",onClick:function(e){var i,n,o;e.stopPropagation();var t=h.enableDeviationSchemaBackwardCompatibility?null!==(i=q.evaluationResult)&&void 0!==i?i:null:null!==(o=null===(n=q.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==o?o:null;j(e,String(u),F,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(k.badgeBorder),"&:hover":{bgcolor:"".concat(k.badgeBorder,"22")}}},{children:[null!=O&&i.jsx(o.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(k.badgeBorder)}},{children:O})),i.jsx(o.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!h.isLoading||null!=q.evaluationResult&&void 0!==q.evaluationResult?k.label?"".concat(k.label):"100% Deviation":i.jsx(a.default,{color:k.badgeText})}))]})),i.jsx(o.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var i=p?g.find(function(e){var i;return null===(i=e.refIndexes)||void 0===i?void 0:i.includes(q.selfIndex)})||{title:"",content:""}:g[u]||{title:"",content:""};R(e,i,F,q,u,k)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(k.badgeBorder,"22")}}},{children:i.jsx(t.EllipsisVertical,{size:11,color:k.badgeText})}))]}):null!=O?O:""}))]}))}))}),"right-row-".concat(u))});exports.default=s;
|
|
2
2
|
//# sourceMappingURL=RHSSectionRow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("../CognitiveComparehelpers.js");exports.useSideBySide=function(t){var r=t.maintainRelativeOrder,i=t.proposedSections,l=t.existingSections,u=t.leftContainerRef,o=t.rightContainerRef,c=t.scrollContainerRef,s=t.sectionLeftRefs,d=t.sectionRightRefs,a=t.subSectionLeftRefs,v=t.subSectionRightRefs,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("../CognitiveComparehelpers.js");exports.useSideBySide=function(t){var r=t.maintainRelativeOrder,i=t.proposedSections,l=t.existingSections,u=t.leftContainerRef,o=t.rightContainerRef,c=t.scrollContainerRef,s=t.sectionLeftRefs,d=t.sectionRightRefs,a=t.subSectionLeftRefs,v=t.subSectionRightRefs,p=t.lhsBadgeRefs,f=t.rhsBadgeRefs,g=t.sectionRowRefs,h=t.sectionRightRowRefs,R=t.rhsTopSpacerRef,S=t.rhsBottomSpacerRef,y=t.lhsTopSpacerRef,A=t.lhsBottomSpacerRef,T=t.calculateLinesRef,B=t.setConnectedSections,m=t.setConnectedLines,E=t.cachedConnectedPositions,x=t.closeMoreFunctionsPopup,C=t.setErrorToast,I=t.moreFunctions,O=t.closeSummaryPopup,b=e.useState(!0),_=b[0],D=b[1],N=e.useState(!1),P=N[0],V=N[1],G=e.useState(!1),w=G[0],L=G[1],q=e.useState(!1),F=q[0],M=q[1],H=e.useState(null),k=H[0],j=H[1],z=e.useRef(!1),J=e.useRef(null),K=e.useRef(!1),Q=e.useRef(null),U=e.useRef(null),W=e.useRef(null),X=e.useRef(new Set),Y=function(){X.current.forEach(function(e){n.resetClauseHighlight(e)}),X.current.clear()},Z=function(e,t,r){var i,l,c,R,S,y,A,T,B,m,E,x,C=null,I=null,O=null,b=null,_=null,D=null,N=function(e,n){if(!e||!n)return!0;var t=e.getBoundingClientRect(),r=n.getBoundingClientRect();return t.bottom>=r.top&&t.top<=r.bottom};if(e){var P=t.split(n.DEVIATION_BADGE_SEPARATOR),V="".concat(P[0]).concat(n.DEVIATION_BADGE_SEPARATOR).concat(P[1]);C=(null===(i=a.current[P[2]])||void 0===i?void 0:i.current)||(null===(l=s.current[Number(P[2])])||void 0===l?void 0:l.current)||null,I=(null===(c=v.current[P[3]])||void 0===c?void 0:c.current)||(null===(R=d.current[Number(P[3])])||void 0===R?void 0:R.current)||null,O=(null===(S=p.current[V])||void 0===S?void 0:S.current)||C,b=(null===(y=f.current[V])||void 0===y?void 0:y.current)||I}else{var G=Number(t),w=null!==r?Number(r):G;C=(null===(A=s.current[G])||void 0===A?void 0:A.current)||null,I=(null===(T=d.current[w])||void 0===T?void 0:T.current)||null,_=(null===(B=p.current[G])||void 0===B?void 0:B.current)||null,D=(null===(m=f.current[w])||void 0===m?void 0:m.current)||null,O=_||(null===(E=g.current[G])||void 0===E?void 0:E.current)||C,b=D||(null===(x=h.current[w])||void 0===x?void 0:x.current)||I}if(C&&(C.style.paddingTop="0px"),I&&(I.style.paddingTop="0px"),e||(_&&(_.style.marginTop="0px"),D&&(D.style.marginTop="0px")),!e&&_&&D){var L=u.current,q=o.current;if(!N(_,L)||!N(D,q))return;var F=_.getBoundingClientRect(),M=D.getBoundingClientRect(),H=F.top-M.top;if(Math.abs(H)>32)return;H>0?D.style.marginTop="".concat(H,"px"):H<0&&(_.style.marginTop="".concat(Math.abs(H),"px"))}else if(O&&b&&C&&I){F=O.getBoundingClientRect(),M=b.getBoundingClientRect();(H=F.top-M.top)>0?I.style.paddingTop="".concat(H,"px"):H<0&&(C.style.paddingTop="".concat(Math.abs(H),"px"))}};e.useEffect(function(){K.current=_},[_]),e.useEffect(function(){Q.current=k},[k]);var $=e.useCallback(function(){var e,t,r,i,l,u,o,c;Y(),D(!1),K.current=!1,J.current=null;var g=Q.current,h=U.current;if(null!==g)if("string"==typeof g&&g.includes(n.DEVIATION_BADGE_SEPARATOR)){var T=g.split(n.DEVIATION_BADGE_SEPARATOR);(B=(null===(e=a.current[T[2]])||void 0===e?void 0:e.current)||(null===(t=s.current[Number(T[2])])||void 0===t?void 0:t.current))&&(B.style.paddingTop="0px")}else{var B;(B=null===(r=s.current[g])||void 0===r?void 0:r.current)&&(B.style.paddingTop="0px");var m=null===(i=p.current[g])||void 0===i?void 0:i.current;m&&(m.style.marginTop="0px")}if(null!==h)if("string"==typeof h&&h.includes(n.DEVIATION_BADGE_SEPARATOR)){T=h.split(n.DEVIATION_BADGE_SEPARATOR);(E=(null===(l=v.current[T[3]])||void 0===l?void 0:l.current)||(null===(u=d.current[Number(T[3])])||void 0===u?void 0:u.current))&&(E.style.paddingTop="0px")}else{var E;(E=null===(o=d.current[h])||void 0===o?void 0:o.current)&&(E.style.paddingTop="0px");var x=null===(c=f.current[h])||void 0===c?void 0:c.current;x&&(x.style.marginTop="0px")}j(null),Q.current=null,U.current=null,V(!1),M(!1),R.current&&(R.current.style.height="0px"),S.current&&(S.current.style.height="0px"),y.current&&(y.current.style.height="0px"),A.current&&(A.current.style.height="0px")},[]),ee=e.useCallback(function(e,t,a){var v,I,O=null===(v=null==a?void 0:a.toggleIfSame)||void 0===v||v,b=null==a?void 0:a.onReady,N=null!==(I=null==a?void 0:a.sourceSide)&&void 0!==I?I:"left";x(),null!=e&&(t?C("No counterpart exists for this section."):(Y(),_&&k===e?O?$():null==b||b():(B(new Set([e])),m([]),E.current=[],M(!0),z.current=!0,j(e),Q.current=e,D(!0),K.current=!0,V(!1),R.current&&(R.current.style.height="0px"),S.current&&(S.current.style.height="0px"),y.current&&(y.current.style.height="0px"),A.current&&(A.current.style.height="0px"),requestAnimationFrame(function(){var t,a,v,B,m,E,x,C,I="string"==typeof e&&e.includes(n.DEVIATION_BADGE_SEPARATOR),O=null,_=null,D=null;if(I){var P=e.split(n.DEVIATION_BADGE_SEPARATOR),G="".concat(P[0]).concat(n.DEVIATION_BADGE_SEPARATOR).concat(P[1]);O=(null===(t=p.current[G])||void 0===t?void 0:t.current)||null,_=(null===(a=f.current[G])||void 0===a?void 0:a.current)||null,D=_?e:null}else if(O=(null===(v=s.current[e])||void 0===v?void 0:v.current)||(null===(B=g.current[e])||void 0===B?void 0:B.current)||null,r){var w=i[e],L=(null==w?void 0:w.refIndexes)||[];if(L.length>0){var q=L[0],F=l.findIndex(function(e){return e.selfIndex===q});-1!==F&&(_=(null===(x=d.current[F])||void 0===x?void 0:x.current)||(null===(C=h.current[F])||void 0===C?void 0:C.current)||null,D=F)}}else _=(null===(m=d.current[e])||void 0===m?void 0:m.current)||(null===(E=h.current[e])||void 0===E?void 0:E.current)||null,D=_?e:null;U.current=D;var H=u.current,k=o.current,j=function(){Z(I,e,D),V(!0),T.current&&T.current(),z.current=!1,"right"===N&&k?k.dispatchEvent(new Event("scroll")):H&&H.dispatchEvent(new Event("scroll")),M(!1),null==b||b()};if(!O||!H)return z.current=!1,M(!1),void(null==b||b());if(_&&k){if(!r){var J=0;J="right"===N?_?_.getBoundingClientRect().top:0:O?O.getBoundingClientRect().top:0;var K=c.current,Q=(null==K?void 0:K.getBoundingClientRect().top)||0,W=K?K.scrollTop+J-Q-150:0;return K?void n.smoothScrollTo(K,W,200,j):void j()}var X=O.getBoundingClientRect().top-H.getBoundingClientRect().top+H.scrollTop,Y=_.getBoundingClientRect().top-k.getBoundingClientRect().top+k.scrollTop,$=200;if("left"===N){var ee=Y-(X-H.scrollTop);ee<0&&R.current&&(R.current.style.height="".concat(Math.abs(ee),"px")),requestAnimationFrame(function(){var e,t=k.scrollHeight-k.clientHeight;if(ee<0)e=0;else{if(ee>t){var r=ee-t;return S.current&&(S.current.style.height="".concat(r+150,"px")),void requestAnimationFrame(function(){n.smoothScrollTo(k,ee,$,j)})}e=ee}n.smoothScrollTo(k,e,$,j)})}else{var ne=X-(Y-k.scrollTop);ne<0&&y.current&&(y.current.style.height="".concat(Math.abs(ne),"px")),requestAnimationFrame(function(){var e,t=H.scrollHeight-H.clientHeight;if(ne<0)e=0;else{if(ne>t){var r=ne-t;return A.current&&(A.current.style.height="".concat(r+150,"px")),void requestAnimationFrame(function(){n.smoothScrollTo(H,ne,$,j)})}e=ne}n.smoothScrollTo(H,e,$,j)})}}else j()}))))},[k,x,l,_,r,i,$]);return e.useCallback(function(){var e,n=I.sectionIdx,t=I.isOrphan;if(O(),null!=n){var r="left";I.anchorEl&&(null===(e=o.current)||void 0===e?void 0:e.contains(I.anchorEl))&&(r="right"),ee(n,t,{sourceSide:r})}},[ee,I.isOrphan,I.sectionIdx,I.anchorEl,O]),{isSideBySide:_,setIsSideBySide:D,isArrowVisible:P,setIsArrowVisible:V,isResizing:w,setIsResizing:L,isSideBySideLoading:F,setIsSideBySideLoading:M,activeSideBySideSection:k,setActiveSideBySideSection:j,scrollLock:z,sideBySideCacheRef:J,isSideBySideRef:K,activeSideBySideSectionRef:Q,activeSideBySideRightSectionRef:U,sideBySideLineRef:W,highlightedClauseRefs:X,clearClauseHighlight:Y,applyAlignmentPadding:Z,resetSideBySide:$,activateSideBySide:ee}};
|
|
2
2
|
//# sourceMappingURL=useSideBySide.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as n}from"tslib";import{jsx as i,jsxs as t}from"react/jsx-runtime";import{useState as o,useRef as r,useMemo as l,useEffect as u,useCallback as s}from"react";import{Box as a,Snackbar as c,Alert as d,Tooltip as v,Typography as f}from"@mui/material";import{ChevronDown as p}from"lucide-react";import{ButtonCognitiveIcon as g}from"../../assests/svg/ButtonCognitiveIcon.js";import m from"./OverlayComponent.js";import{safeStringify as h,extractDeviationScore as S,generateColorPalette as R,findKeyPathByNodeId as x,hasMeaningfulRedlineTags as y,DEVIATION_BADGE_SEPARATOR as b,smoothScrollTo as C,scrollAndHighlightClause as w}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as B,DEFAULT_FIELD_CONFIG as _,DEFAULT_COMPARISON_CONFIG as F}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as E,EMPTY_SUMMARY_POPUP_STATE as I,DEFAULT_COMPONENT_HEADER_TEXT as T}from"./CognitiveCompareConstants.js";import A from"./CognitivePopup.js";import D from"./MoreFunctionsPopup.js";import j from"./LoaderComponent.js";import P from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as k}from"./hooks/useCompareData.js";import{useComparePopups as L}from"./hooks/useComparePopups.js";import{useSectionRefs as O}from"./hooks/useSectionRefs.js";import{useAccordionState as N}from"./hooks/useAccordionState.js";import{useDeviationNavigation as H}from"./hooks/useDeviationNavigation.js";import z from"./components/CompareHeader.js";import M from"./components/SubSectionAccordion.js";import q from"./components/LHSSectionRow.js";import W from"./components/RHSSectionRow.js";import V from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as K}from"./CompareContext.js";import{useStyleHelpers as Y}from"./hooks/useStyles.js";import{useResizeHandler as X}from"./hooks/useResizeHandler.js";import{useLinesCalculator as $}from"./hooks/useLinesCalculator.js";import{useSideBySide as J}from"./hooks/useSideBySide.js";import U from"./components/SvgConnectors.js";var G=function(G){var Q,Z,ee,ne,ie,te,oe,re,le,ue,se,ae,ce,de,ve,fe,pe,ge,me,he,Se,Re,xe,ye,be,Ce,we=G.componentHeaderText,Be=void 0===we?T:we,_e=G.treeData,Fe=G.comparisonConfig,Ee=G.leftColumnTitleText,Ie=G.rightColumnTitleText,Te=G.markdownStyles,Ae=G.resetTrigger,De=G.displayConfig,je=void 0===De?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:De,Pe=G.popupConfig,ke=G.deviationData,Le=void 0===ke?{}:ke,Oe=G.deviationNodeIdToView,Ne=G.resetDeviationNodeId,He=G.isProposingFix,ze=void 0!==He&&He,Me=G.proposingFixNodeId,qe=G.isRedlineFlow,We=o(je.maintainRelativeOrder),Ve=We[0],Ke=We[1],Ye=!!Ve||!!(null==je?void 0:je.showDeviationBadges),Xe=o(!1),$e=Xe[0],Je=Xe[1],Ue=o(null),Ge=Ue[0],Qe=Ue[1],Ze=o(null===(Z=null!==(Q=null==_e?void 0:_e.newEvaluationResult)&&void 0!==Q?Q:null==je?void 0:je.enableDeviationSchemaBackwardCompatibility)||void 0===Z||Z)[0],en=o(new Set),nn=en[0],tn=en[1],on=o([]),rn=on[0],ln=on[1],un=r(null),sn=r(null),an=r(null),cn=r(null),dn=r(null),vn=r(!1),fn=r(null),pn=r({}),gn=r([]),mn=r(function(){}),hn=r(null),Sn=r(function(){}),Rn=l(function(){return(null==_e?void 0:_e.cognitive_decisioning)||{}},[_e]),xn=l(function(){return e(e({},B),Te)},[Te]),yn=r(null),bn=r(null),Cn=r(null),wn=r(null),Bn=r(null),_n=r(null),Fn=r(null),En=r(null),In=r(null),Tn=r(null),An=L(yn),Dn=An.cognitivePopup,jn=An.setCognitivePopup,Pn=An.moreFunctions,kn=An.setMoreFunctions,Ln=An.position,On=An.setPosition,Nn=An.activeBadgeId,Hn=An.summaryPopup,zn=An.setSummaryPopup,Mn=An.closeSummaryPopup,qn=An.setActiveBadgeId,Wn=An.popupRef,Vn=An.handleOpenCognitiveCompare,Kn=An.openCognitivePopupFromState,Yn=An.closeCognitivePopup,Xn=An.closeMoreFunctionsPopup,$n=l(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==Fe?void 0:Fe.fields)&&void 0!==e?e:_,thresholds:{high:null!==(i=null===(n=null==Fe?void 0:Fe.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:F.thresholds.high,medium:null!==(o=null===(t=null==Fe?void 0:Fe.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:F.thresholds.medium,exact:null!==(l=null===(r=null==Fe?void 0:Fe.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:F.thresholds.exact}}},[Fe]),Jn=o(null),Un=Jn[0];Jn[1];var Gn=null===(ie=null===(ee=null==_e?void 0:_e.documents)||void 0===ee?void 0:ee[null===(ne=null==_e?void 0:_e.input_index_map)||void 0===ne?void 0:ne[0]])||void 0===ie?void 0:ie.title,Qn=null===(re=null===(te=null==_e?void 0:_e.documents)||void 0===te?void 0:te[null===(oe=null==_e?void 0:_e.input_index_map)||void 0===oe?void 0:oe[1]])||void 0===re?void 0:re.title,Zn=h(Ee||Gn||"Uploaded Contract"),ei=h(Ie||Qn||"Reference Template"),ni=k(_e,Ve,Le,$n,Ze),ii=ni.activeProposed,ti=ni.existingRule,oi=ni.proposedSections,ri=ni.existingSections,li=ni.visibleFields,ui=ni.parentDeviationRecord,si=ni.deviationNumberRegistry,ai=ni.parseError;u(function(){ai&&Qe("Failed to load comparison: ".concat(ai))},[ai]);var ci=oi.length>0||ri.length>0,di=l(function(){if(!qe)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";y(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(oi),i(ri),"".concat(e,":").concat(n)},[qe,oi,ri]),vi=O(li.map(function(e){return e.key}),Math.max(oi.length,ri.length)),fi=vi.leftRefs,pi=vi.rightRefs,gi=vi.sectionLeftRefs,mi=vi.sectionRightRefs,hi=vi.lhsBadgeRefs,Si=vi.rhsBadgeRefs,Ri=vi.sectionRightRowRefs,xi=vi.subSectionLeftRefs,yi=vi.subSectionRightRefs,bi=vi.sectionRowRefs,Ci=vi.getSectionRowRef,wi=vi.getSubSectionRef,Bi=vi.getBadgeRef,_i=J({maintainRelativeOrder:Ve,proposedSections:oi,existingSections:ri,leftContainerRef:En,rightContainerRef:Cn,scrollContainerRef:yn,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,sectionRowRefs:bi,sectionRightRowRefs:Ri,rhsTopSpacerRef:wn,rhsBottomSpacerRef:Bn,lhsTopSpacerRef:_n,lhsBottomSpacerRef:Fn,calculateLinesRef:mn,setConnectedSections:tn,setConnectedLines:ln,cachedConnectedPositions:gn,closeMoreFunctionsPopup:Xn,setErrorToast:Qe,moreFunctions:Pn,closeSummaryPopup:Mn}),Fi=_i.isSideBySide,Ei=_i.isArrowVisible,Ii=_i.setIsArrowVisible,Ti=_i.isResizing,Ai=_i.setIsResizing,Di=_i.isSideBySideLoading,ji=_i.activeSideBySideSection,Pi=_i.scrollLock,ki=_i.sideBySideCacheRef,Li=_i.isSideBySideRef,Oi=_i.activeSideBySideRightSectionRef,Ni=_i.activeSideBySideSectionRef,Hi=_i.sideBySideLineRef,zi=_i.highlightedClauseRefs,Mi=_i.clearClauseHighlight,qi=_i.applyAlignmentPadding,Wi=_i.resetSideBySide,Vi=_i.activateSideBySide,Ki=N({maintainRelativeOrder:!!Ve,proposedSections:oi,existingSections:ri,activeSideBySideSection:ji,connectedSections:nn,resetSideBySide:Wi,setConnectedSections:tn,setConnectedLines:ln,cachedConnectedPositions:gn,svgContainerRef:un,isAnimatingRef:vn,animationTimerRef:fn,calculateLinesRef:mn,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi}),Yi=Ki.expandedSections,Xi=Ki.setExpandedSections,$i=Ki.expandedSubSections,Ji=Ki.setExpandedSubSections,Ui=Ki.handleSubSectionToggle,Gi=Ki.toggleSection;u(function(){qe&&"off"!==di&&"0:0"!==di&&(ki.current=null,gn.current=[],requestAnimationFrame(function(){var e;null===(e=mn.current)||void 0===e||e.call(mn)}))},[qe,di]);var Qi=l(function(){var e=new Map,n=new Map,i=1;if(Ve)oi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),ri.forEach(function(t){if(t.id){var o=oi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(oi.length,ri.length),o=0;o<t;o++){var r=oi[o],l=ri[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[oi,ri,Ve]),Zi=ti.analysis,et=h(null===(ue=null===(le=null==Zi?void 0:Zi.rule_difference_comparison)||void 0===le?void 0:le.summary)||void 0===ue?void 0:ue.overall_summary),nt=!!et.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),it=null!==(se=null==_e?void 0:_e.base_root_id)&&void 0!==se?se:"-1";null==_e||_e[it];var tt=Ze?null!==(xe=null!==(he=Le&&(null===(me=null==Le?void 0:Le[it])||void 0===me?void 0:me.evaluation_result))&&void 0!==he?he:null===(Re=null===(Se=null==_e?void 0:_e.nodes)||void 0===Se?void 0:Se[it])||void 0===Re?void 0:Re.evaluation_result)&&void 0!==xe?xe:null:null!==(ge=null!==(de=Le&&(null===(ce=null===(ae=null==Le?void 0:Le[it])||void 0===ae?void 0:ae.evaluation_result)||void 0===ce?void 0:ce[0]))&&void 0!==de?de:null===(pe=null===(fe=null===(ve=null==_e?void 0:_e.nodes)||void 0===ve?void 0:ve[it])||void 0===fe?void 0:fe.evaluation_result)||void 0===pe?void 0:pe[0])&&void 0!==ge?ge:null,ot=S(tt),rt=R(null!==(Ce=null===(be=null===(ye=null==tt?void 0:tt.evaluation_outputs)||void 0===ye?void 0:ye.metadata)||void 0===be?void 0:be.label_color)&&void 0!==Ce?Ce:E),lt=s(function(){Mi(),Wi(),tn(new Set),ln([]),gn.current=[],yt([]),Ct(null),zn(I),Yn(),requestAnimationFrame(function(){var e;null===(e=mn.current)||void 0===e||e.call(mn)})},[]),ut=r(lt);u(function(){ut.current=lt},[lt]),u(function(){Ae&&ut.current()},[Ae]);var st=s(function(n,i,t,o,r,l,u){var s,a,c,d=h(null==i?void 0:i.id)||h(null==t?void 0:t.id)||"",v=(d?Rn[d]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:d,decisioning:[],gap:[],relevance_score:0},f=null!==(a=null===(s=bi.current[o])||void 0===s?void 0:s.current)&&void 0!==a?a:null;return{isLoading:null!==(c=null==je?void 0:je.isLoading)&&void 0!==c&&c,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:v,anchorEl:n,sectionAnchorEl:f,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==_e?void 0:_e.documents,input_index_map:null==_e?void 0:_e.input_index_map},deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(b)))return u(l);var s=o.split(b)[1];if(!s)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},c=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[s])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[s])||null;return c?e(e(e({},a),c),{deviation_summary:(null==c?void 0:c.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==c?void 0:c.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==c?void 0:c.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==c?void 0:c.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==c?void 0:c.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==c?void 0:c.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Rn,_e]),at=s(function(){var e=Pn.sectionIdx,n=Pn.isOrphan;Xn(),Mn(),null!==e&&(n?Qe("No counterpart exists to connect to."):(Mi(),Li.current&&Wi(),ln([]),gn.current=[],tn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){mn.current&&mn.current()},50)))},[Pn.sectionIdx,Pn.isOrphan,Xn,Mn,Wi]),ct=s(function(){var e=dn.current;if(e){dn.current=null;var n=oi.findIndex(function(n){return n.id===e}),i=ri.findIndex(function(n){return n.id===e}),t=-1===n?x(oi,e):null,o=-1===i?x(ri,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},s=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(zi.current.add(r),w(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(Ve)-1!==r&&En.current&&s(function(){return u(n,t,gi,xi)},En.current),-1!==l&&Cn.current&&s(function(){return u(i,o,mi,yi)},Cn.current);else{var a=yn.current;if(!a)return;s(function(){return-1!==r?u(n,t,gi,xi):u(i,o,mi,yi)},a)}}},[oi,ri,Ve,gi,mi,xi,yi,En,Cn,yn]),dt=s(function(n){if(n){Mi(),Wi(),tn(new Set),ln([]),gn.current=[],Mn(),Yn();var i=oi.findIndex(function(e){return e.id===n}),t=ri.findIndex(function(e){return e.id===n}),o=-1===i?x(oi,n):null,r=-1===t?x(ri,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;dn.current=n,Xi(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=Ve?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=Ve?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),Ji(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){dn.current===n&&vt.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[oi,ri,Ve,Xi,Ji,Wi,Mn,Yn]),vt=r(ct);u(function(){vt.current=ct},[ct]);var ft=r(null);u(function(){if(Un){var e=$n.fields.find(function(e){return e.analysisKey===Un||e.key===Un});if(e){var n=fi.current[e.key]||pi.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Un,$n.fields]);var pt=s(function(e){var n,i,t,o,r,l,u,s,a,c=null===(n=null==Zi?void 0:Zi.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.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 f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(s=d.highlights)||void 0===s?void 0:s.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Zi]),gt=Y({proposedSections:oi,existingSections:ri,maintainRelativeOrder:Ve,cognitiveMap:Rn,deviationData:Le,treeData:_e,resolvedComparisonConfig:$n}),mt=gt.getSectionCompareStyle,ht=gt.getSubSectionCompareStyle,St=gt.getDeviationStyleByKey,Rt=$({containerRef:sn,leftContainerRef:En,rightContainerRef:Cn,svgContainerRef:un,pathRefs:pn,leftHeaderRef:an,rightHeaderRef:cn,proposedSections:oi,existingSections:ri,visibleFields:li,leftRefs:fi,rightRefs:pi,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,sectionRowRefs:bi,expandedSections:Yi,expandedSubSections:$i,connectedSections:nn,isSideBySide:Fi,activeSideBySideSection:ji,maintainRelativeOrder:Ve,cognitiveMap:Rn,getSectionCompareStyle:mt,getSubSectionCompareStyle:ht,getDeviationStyleByKey:St,isArrowVisible:Ei,isAnimatingRef:vn,isSideBySideRef:Li,sideBySideCacheRef:ki,sideBySideLineRef:Hi,activeSideBySideSectionRef:Ni,activeSideBySideRightSectionRef:Oi,connectedLines:rn,setConnectedLines:ln,cachedConnectedPositions:gn,calculateLinesRef:mn,resizeTimerRef:hn,scrollLock:Pi,handleResizeRef:Sn,activeProposed:ii,existingRule:ti,analysisData:Zi,pendingScrollTargetRef:In,pendingScrollCallbackRef:Tn,resolvedComparisonConfig:$n,getFieldData:pt}),xt=Rt.lines,yt=Rt.setLines,bt=Rt.overallConnector,Ct=Rt.setOverallConnector,wt=Rt.svgDimensions,Bt=Rt.handleColumnScroll,_t=s(function(){Mi(),Xi({}),Ji({}),Wi(),tn(new Set),ln([]),gn.current=[],Mn(),Yn(),Xn(),requestAnimationFrame(function(){mn.current&&mn.current()})},[Xi,Ji,Wi,Mn,Yn,Xn]),Ft=l(function(){return Object.values(Yi).some(Boolean)||Object.values($i).some(Boolean)},[Yi,$i]),Et=r(null),It=r(0),Tt=r(0),At=r(0),Dt=X({timerRef:Et,ruleComponentRef:bn,scrollContainerRef:yn,containerRef:sn,maintainRelativeOrder:Ve,proposedSections:oi,existingSections:ri,isSideBySideRef:Li,activeSideBySideSectionRef:Ni,activeSideBySideRightSectionRef:Oi,sectionRowRefs:bi,sectionRightRowRefs:Ri,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,leftContainerRef:En,rightContainerRef:Cn,calculateLinesRef:mn,handleResizeRef:Sn,setIsResizing:Ai,setIsArrowVisible:Ii,sideBySideCacheRef:ki,cachedConnectedPositions:gn}).handleResize;u(function(){Sn.current=Dt},[Dt,Sn]),u(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var s=e[e.length-1];if(s){var a=null!==(u=null===(l=null===(r=s.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:s.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return bn.current&&o.push(e(bn.current,It,n,function(){return Sn.current()},function(){})),yn.current&&o.push(e(yn.current,Tt,i,function(){return Sn.current()},function(){return mn.current()})),sn.current&&o.push(e(sn.current,At,t,function(){return Sn.current()},function(){return mn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),u(function(){Li.current=Fi},[Fi]),u(function(){Ni.current=ji},[ji]);var jt=s(function(){var e,n=Pn.sectionIdx,i=Pn.isOrphan;if(Mn(),null!=n){var t="left";Pn.anchorEl&&(null===(e=Cn.current)||void 0===e?void 0:e.contains(Pn.anchorEl))&&(t="right"),Vi(n,i,{sourceSide:t})}},[Vi,Pn.isOrphan,Pn.sectionIdx,Pn.anchorEl,Mn]),Pt=s(function(){Mn(),Wi(),tn(new Set),ln([]),gn.current=[]},[Mn,Wi]),kt=null!==Pn.sectionIdx&&nn.has(Pn.sectionIdx),Lt=H({proposedSections:oi,existingSections:ri,parentDeviationRecord:ui,expandedSections:Yi,maintainRelativeOrder:!!Ve,scrollContainerRef:yn,leftContainerRef:En,rightContainerRef:Cn,lhsBadgeRefs:hi,rhsBadgeRefs:Si}),Ot=Lt.showDeviationNavigation,Nt=Lt.showOpenNodeRef,Ht=Lt.adjustScrollForPopup,zt=s(function(e,n,i,t,o){var r,l="string"==typeof t?h(t).trim():h(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;Yn();var s="left";(null===(r=Cn.current)||void 0===r?void 0:r.contains(u))&&(s="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(b)){var r=n.split(b),l="".concat(r[0]).concat(b).concat(r[1]);return"right"===s?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(i=hi.current[l])||void 0===i?void 0:i.current}return"right"===s?null===(t=Si.current[n])||void 0===t?void 0:t.current:null===(o=hi.current[n])||void 0===o?void 0:o.current},c=function(e,t){var o=!!Ve,r=o?"right"===s?Cn.current:En.current:yn.current,l=o?"right"===s?En.current:Cn.current:null;if(r&&e){var u=function(){var e="string"==typeof n&&n.includes(b);i||!e?t():requestAnimationFrame(function(){var e,i,o;ki.current=null,gn.current=[],qi(!0,n,null),null===(e=mn.current)||void 0===e||e.call(mn),null===(i=En.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=Cn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),t()})},a=e.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.bottom-.35*c.height,v=c.top+.35*c.height;if(a.top>d||a.top<v){var f=c.top+c.height/2,p=a.top+a.height/2-f;o&&l&&C(l,l.scrollTop+p,250,function(){}),C(r,r.scrollTop+p,250,u)}else u()}else t()};if(i)return Wi(),tn(new Set),ln([]),gn.current=[],void(l&&requestAnimationFrame(function(){var e=a()||u;c(e,function(){zn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}));Vi(n,i,l?{toggleIfSame:!1,sourceSide:s,onReady:function(){var e=a()||u;c(e,function(){zn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}}:{toggleIfSame:!1,sourceSide:s})},[Vi,Yn,zn,Wi,Ve]),Mt=l(function(){var e;if(!Oe)return null;var n=null===(e=null==Oe?void 0:Oe.id)||void 0===e?void 0:e.split(":")[0];for(var i in ui){if((ui[i]||[]).some(function(e){return e.id===n}))return i}return null},[Oe,ui]),qt=r({id:null,triggerMs:null}),Wt=r(null);u(function(){var i;if(null==Oe?void 0:Oe.id){var t=Number(Oe.trigger),o=qt.current;if((null==o?void 0:o.triggerMs)!==t){if(!(Oe.id.includes(":")&&/:\d+$/.test(Oe.id)))return qt.current={id:Oe.id,triggerMs:t},void dt(Oe.id);var r=null===(i=null==Oe?void 0:Oe.id)||void 0===i?void 0:i.split(":"),l=r[0],u=r[1],s=null!=u?u:"0";Wt.current!==Oe.id&&(Mn(),Yn(),Wi(),tn(new Set),ln([]),gn.current=[],Wt.current=Oe.id);var a=!1,c=0,d=null,v=150,f=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},p=function(){var i,o,r,u;if(!a){var g=function(){qt.current={id:Oe.id,triggerMs:t}},m=null,h=null;for(var S in ui){var R=ui[S].find(function(e){return e.id===l});if(R){m=S,h=R;break}}if(h&&m){var x=oi.findIndex(function(e){return e.id===m}),y=ri.findIndex(function(e){return e.id===m}),C=-1===x&&-1!==y,w=f(oi,h.id),B=f(ri,h.id);if(w&&!B&&!C){var _=w.split("-"),F=Number(_[0]);if(Ve){var E=null===(o=null===(i=oi[F])||void 0===i?void 0:i.refIndexes)||void 0===o?void 0:o[0],I=ri.findIndex(function(e){return e.selfIndex===E});-1!==I&&(F=I)}B=n([F],_.slice(1),!0).join("-")}if(w||B){var T=C||!w&&!!B,A=w?Number(w.split("-")[0]):x,D=B?Number(B.split("-")[0]):y;if(T){if(!(Ve?!!Yi["right-".concat(D)]:!!Yi[String(D)])&&D>=0)return Gi(D,"right"),c+=1,void(d=setTimeout(p,450))}else if(!(Ve?!!Yi["left-".concat(A)]:!!Yi[String(A)])&&A>=0)return Gi(A,"left"),c+=1,void(d=setTimeout(p,450));var j,P=w||"",k=B||"",L="".concat(h.id).concat(b).concat(s).concat(b).concat(P).concat(b).concat(k),O="".concat(h.id).concat(b).concat(s),N=null===(r=hi.current[O])||void 0===r?void 0:r.current,H=null===(u=Si.current[O])||void 0===u?void 0:u.current,z=T||!N&&!!H,M=z?H:N;if(j=Ve?z?Cn.current:En.current:yn.current,M&&j){var q=M.getBoundingClientRect();if(0===q.height)return void((c+=1)<2?d=setTimeout(p,v):g());var W=j.getBoundingClientRect(),V=q.top-W.top+j.scrollTop-W.height/2+q.height/2+150,K=function(){var n,i,t,o,r;if(!a){g();var l=M instanceof Element?window.getComputedStyle(M).color:"";N&&(N.style.transition="box-shadow 300ms ease-in-out",N.style.boxShadow="0 0 10px ".concat(l)),H&&(H.style.transition="box-shadow 300ms ease-in-out",H.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){N&&(N.style.boxShadow=""),H&&(H.style.boxShadow="")},2e3);var u=(null===(i=null===(n=h.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[s])||h,c=(null===(t=h.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||h.evaluation_outputs;if(!(!!N&&!!H)){var d=z?(null===(o=Si.current[O])||void 0===o?void 0:o.current)||H:(null===(r=hi.current[O])||void 0===r?void 0:r.current)||N;return Ht(d,function(){zn({open:!0,anchorEl:d,displayImpact:Oe.displayImpact,summary:e(e({},u),{evaluation_outputs:c})})}),void(null==Ne||Ne())}Vi(L,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,i,t=z?(null===(n=Si.current[O])||void 0===n?void 0:n.current)||H:(null===(i=hi.current[O])||void 0===i?void 0:i.current)||N;Ht(t,function(){requestAnimationFrame(function(){var n,i,o;ki.current=null,gn.current=[],qi(!0,L,null),null===(n=mn.current)||void 0===n||n.call(mn),null===(i=En.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=Cn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),zn({open:!0,anchorEl:t,displayImpact:null==Oe?void 0:Oe.displayImpact,summary:e({},u)})})})}})}};Math.abs(j.scrollTop-V)<=2?K():(In.current=V,Tn.current=K,j.scrollTo({top:V,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(Tn.current){In.current=null;var e=Tn.current;Tn.current=null,e()}},800))}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}};return d=setTimeout(p,v),function(){a=!0,d&&clearTimeout(d)}}}},[Oe,ui,oi,ri,Ve,Yi,Gi,Vi,zn,dt]);var Vt={maintainRelativeOrder:!!Ve,showDeviationBadges:Ye,isProposingFix:ze,proposingFixNodeId:Me,isRedlineFlow:qe,isSideBySide:Fi,activeSideBySideSection:ji,connectedSections:nn,proposedSections:oi,existingSections:ri,deviationNumberRegistry:si,treeData:_e,displayConfig:je,resolvedMarkdownStyles:xn,unifiedNumbering:Qi,expandedSections:Yi,expandedSubSections:$i,setExpandedSubSections:Ji,getSectionCompareStyle:mt,getSubSectionCompareStyle:ht,getBadgeRef:Bi,getSectionRowRef:Ci,getSubSectionRef:wi,sectionLeftRefs:gi,sectionRightRefs:mi,sectionRowRefs:bi,sectionRightRowRefs:Ri,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,openMoreFunctionsPopup:function(e,n,i,t,o,r){var l;if(e.stopPropagation(),Pn.open&&Pn.sectionIdx===o)Xn();else{var u=e.currentTarget,s="left";(null===(l=Cn.current)||void 0===l?void 0:l.contains(u))&&(s="right");Mi(),Li.current&&Wi(),tn(new Set),ln([]),gn.current=[],Yn(),Hn.open?Pt():Mn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(b)){var r=o.split(b),l="".concat(r[0]).concat(b).concat(r[1]);return"right"===s?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(n=hi.current[l])||void 0===n?void 0:n.current}return"right"===s?null===(i=Si.current[o])||void 0===i?void 0:i.current:null===(t=hi.current[o])||void 0===t?void 0:t.current}()||u;kn(st(e,n,t,o,i,r))})}},handleOpenSummaryPopup:zt,openSummaryPopup:zt,handleCloseSummaryPopup:Pt,toggleSection:Gi,handleSubSectionToggle:Ui,renderSubSectionAccordion:function(e){var n=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,u=void 0===l?"left":l,s=e.parentNodeId,a=void 0===s?"":s,c=e.sectionOffset;return i(M,{section:n,keyPath:t,depth:r,columnKey:u,parentNodeId:a,sectionOffset:c})},resetSideBySide:Wi,setConnectedSections:tn,setConnectedLines:ln,cachedConnectedPositions:gn,showDeviationNavigation:Ot,showOpenNodeRef:Nt,deviationNodeIdToView:null==Oe?void 0:Oe.id,deviationTargetParentId:Mt};return i(K,e({value:Vt},{children:t(a,e({ref:bn,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},Ve?{}:{overflow:"visible"}),{position:"relative"})},{children:[$e&&i(a,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(j,{})})),Hn.open&&i(V,{open:Hn.open,anchorEl:Hn.anchorEl,containerEl:ft.current,clipTopEl:an.current,scrollContainerEl:yn.current,onClose:Pt,summary:Hn.summary,displayImpact:Hn.displayImpact}),i(D,{open:Pn.open,anchorEl:Pn.anchorEl,sectionTitle:Pn.sectionTitle,referenceSectionTitle:Pn.refSectionTitle,onClose:Xn,onOpenCognitiveCompare:Vn,onOpenSideBySide:jt,onConnect:at,isConnected:kt,isOrphan:Pn.isOrphan}),Dn.open&&i(A,{open:Dn.open,popupRef:Wn,position:Ln,popupConfig:Pe,onClose:function(){On(null),jn(function(n){return e(e({},n),{open:!1})}),qn(null)},markdownStyles:Te,sectionTitle:Dn.sectionTitle,referenceSectionTitle:Dn.refSectionTitle,cognitiveData:Dn.cognitiveData,anchorEl:Dn.anchorEl,sectionAnchorEl:Dn.sectionAnchorEl,scrollContainerEl:yn.current,badgeStyle:Dn.badgeStyle,docData:Dn.docData,deviationData:Dn.deviationData,isLoading:Dn.isLoading}),i(c,e({open:!!Ge,autoHideDuration:8e3,onClose:function(){return Qe(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(d,e({onClose:function(){return Qe(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ge}))})),i(z,{componentHeaderText:Be,displayConfig:je,maintainRelativeOrder:Ve,onCollapseAll:_t,showCollapseAll:Ft,onToggleView:function(e){Je(!0),setTimeout(function(){Ke(!e),Wi(),Mn(),tn(new Set),ln([]),gn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Je(!1)},600)})})},50)}}),i(a,e({ref:yn,onScroll:Bt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:Ve?"hidden":"auto",borderTop:et&&nt?"none":"1.5px solid #EEF0F4"}},{children:i(a,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},Ve?{flex:1,minHeight:0}:{})},{children:t(a,e({ref:sn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},Ve?{flex:1,overflow:"visible"}:{})},{children:[i(U,{svgContainerRef:un,svgDimensions:wt,isResizing:Ti,overallConnector:bt,rootDeviationStyle:rt,lines:xt,isSideBySide:Fi,activeSideBySideSection:ji,isArrowVisible:Ei,maintainRelativeOrder:Ve,proposedSections:oi,existingSections:ri,cognitivePopup:Dn,activeBadgeId:Nn,closeCognitivePopup:Yn,setActiveBadgeId:qn,openCognitivePopupFromState:Kn,buildSectionPopupState:st,connectedLines:rn,pathRefs:pn}),t(a,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)"},Ve?{flex:1,overflow:"visible"}:{})},{children:[i(a,e({ref:an,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:Zn,placement:"top"},{children:i(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Zn}))}))})),t(a,e({ref:En,onScroll:Bt,sx:e({p:"12px",display:"flex",flexDirection:"column"},Ve?{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:_n,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&oi.map(function(e,n){return i(q,{section:e,idx:n},"left-row-".concat(n))}),i("div",{ref:Fn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(a,e({ref:ft,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(a,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(a,e({onClick:function(n){n.stopPropagation(),Dn.open&&Nn===it?Yn():(qn(it),Kn(st(n.currentTarget,{title:"",content:"",evaluationResult:tt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,it,!0,e(e({},rt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:rt.badgeBg,color:rt.badgeText,border:"1px solid ".concat(rt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ot?ot:i(P,{}),i(a,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(g,{})})),i(p,{size:11,style:{transform:Dn.open&&Nn===it?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(a,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},Ve?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Di&&i(m,{sections:11}),i(a,e({ref:cn,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:ei,placement:"top"},{children:i(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:ei}))}))})),t(a,e({ref:Cn,onScroll:Bt,sx:e({p:"12px",display:"flex",flexDirection:"column"},Ve?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:wn,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&ri.map(function(e,n){return i(W,{section:e,idx:n},"right-row-".concat(n))}),i("div",{ref:Bn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{G as default};
|
|
1
|
+
import{__assign as e,__spreadArray as n}from"tslib";import{jsx as i,jsxs as t}from"react/jsx-runtime";import{useState as o,useRef as r,useMemo as l,useEffect as u,useCallback as s}from"react";import{Box as a,Snackbar as c,Alert as d,Tooltip as v,Typography as f}from"@mui/material";import{ChevronDown as p}from"lucide-react";import{ButtonCognitiveIcon as g}from"../../assests/svg/ButtonCognitiveIcon.js";import m from"./OverlayComponent.js";import{safeStringify as h,extractDeviationScore as S,generateColorPalette as R,findKeyPathByNodeId as x,hasMeaningfulRedlineTags as y,DEVIATION_BADGE_SEPARATOR as b,smoothScrollTo as C,scrollAndHighlightClause as w}from"./CognitiveComparehelpers.js";import{SHARED_MARKDOWN_STYLES as B,DEFAULT_FIELD_CONFIG as _,DEFAULT_COMPARISON_CONFIG as F}from"./CognitiveCompareConfig.js";export{SHARED_MARKDOWN_STYLES}from"./CognitiveCompareConfig.js";import{DEFAULT_DEVIAION_COLOR as E,EMPTY_SUMMARY_POPUP_STATE as I,DEFAULT_COMPONENT_HEADER_TEXT as T}from"./CognitiveCompareConstants.js";import A from"./CognitivePopup.js";import D from"./MoreFunctionsPopup.js";import j from"./LoaderComponent.js";import P from"./components/ThreeDotsLoader.js";import{useCognitiveTreeData as k}from"./hooks/useCompareData.js";import{useComparePopups as L}from"./hooks/useComparePopups.js";import{useSectionRefs as O}from"./hooks/useSectionRefs.js";import{useAccordionState as N}from"./hooks/useAccordionState.js";import{useDeviationNavigation as H}from"./hooks/useDeviationNavigation.js";import z from"./components/CompareHeader.js";import M from"./components/SubSectionAccordion.js";import q from"./components/LHSSectionRow.js";import W from"./components/RHSSectionRow.js";import V from"./components/CognitiveSummaryPopup.js";import{CompareContextProvider as K}from"./CompareContext.js";import{useStyleHelpers as Y}from"./hooks/useStyles.js";import{useResizeHandler as X}from"./hooks/useResizeHandler.js";import{useLinesCalculator as $}from"./hooks/useLinesCalculator.js";import{useSideBySide as J}from"./hooks/useSideBySide.js";import U from"./components/SvgConnectors.js";var G=function(G){var Q,Z,ee,ne,ie,te,oe,re,le,ue,se,ae,ce,de,ve,fe,pe,ge,me,he,Se,Re,xe,ye,be,Ce,we=G.componentHeaderText,Be=void 0===we?T:we,_e=G.treeData,Fe=G.comparisonConfig,Ee=G.leftColumnTitleText,Ie=G.rightColumnTitleText,Te=G.markdownStyles,Ae=G.resetTrigger,De=G.displayConfig,je=void 0===De?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:De,Pe=G.popupConfig,ke=G.deviationData,Le=void 0===ke?{}:ke,Oe=G.deviationNodeIdToView,Ne=G.resetDeviationNodeId,He=G.isProposingFix,ze=void 0!==He&&He,Me=G.proposingFixNodeId,qe=G.isRedlineFlow,We=o(je.maintainRelativeOrder),Ve=We[0],Ke=We[1],Ye=!!Ve||!!(null==je?void 0:je.showDeviationBadges),Xe=o(!1),$e=Xe[0],Je=Xe[1],Ue=o(null),Ge=Ue[0],Qe=Ue[1],Ze=o(null===(Z=null!==(Q=null==_e?void 0:_e.newEvaluationResult)&&void 0!==Q?Q:null==je?void 0:je.enableDeviationSchemaBackwardCompatibility)||void 0===Z||Z)[0],en=o(new Set),nn=en[0],tn=en[1],on=o([]),rn=on[0],ln=on[1],un=r(null),sn=r(null),an=r(null),cn=r(null),dn=r(null),vn=r(!1),fn=r(null),pn=r({}),gn=r([]),mn=r(function(){}),hn=r(null),Sn=r(function(){}),Rn=l(function(){return(null==_e?void 0:_e.cognitive_decisioning)||{}},[_e]),xn=l(function(){return e(e({},B),Te)},[Te]),yn=r(null),bn=r(null),Cn=r(null),wn=r(null),Bn=r(null),_n=r(null),Fn=r(null),En=r(null),In=r(null),Tn=r(null),An=L(yn),Dn=An.cognitivePopup,jn=An.setCognitivePopup,Pn=An.moreFunctions,kn=An.setMoreFunctions,Ln=An.position,On=An.setPosition,Nn=An.activeBadgeId,Hn=An.summaryPopup,zn=An.setSummaryPopup,Mn=An.closeSummaryPopup,qn=An.setActiveBadgeId,Wn=An.popupRef,Vn=An.handleOpenCognitiveCompare,Kn=An.openCognitivePopupFromState,Yn=An.closeCognitivePopup,Xn=An.closeMoreFunctionsPopup,$n=l(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==Fe?void 0:Fe.fields)&&void 0!==e?e:_,thresholds:{high:null!==(i=null===(n=null==Fe?void 0:Fe.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:F.thresholds.high,medium:null!==(o=null===(t=null==Fe?void 0:Fe.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:F.thresholds.medium,exact:null!==(l=null===(r=null==Fe?void 0:Fe.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:F.thresholds.exact}}},[Fe]),Jn=o(null),Un=Jn[0];Jn[1];var Gn=null===(ie=null===(ee=null==_e?void 0:_e.documents)||void 0===ee?void 0:ee[null===(ne=null==_e?void 0:_e.input_index_map)||void 0===ne?void 0:ne[0]])||void 0===ie?void 0:ie.title,Qn=null===(re=null===(te=null==_e?void 0:_e.documents)||void 0===te?void 0:te[null===(oe=null==_e?void 0:_e.input_index_map)||void 0===oe?void 0:oe[1]])||void 0===re?void 0:re.title,Zn=h(Ee||Gn||"Uploaded Contract"),ei=h(Ie||Qn||"Reference Template"),ni=k(_e,Ve,Le,$n,Ze),ii=ni.activeProposed,ti=ni.existingRule,oi=ni.proposedSections,ri=ni.existingSections,li=ni.visibleFields,ui=ni.parentDeviationRecord,si=ni.deviationNumberRegistry,ai=ni.parseError;u(function(){ai&&Qe("Failed to load comparison: ".concat(ai))},[ai]);var ci=oi.length>0||ri.length>0,di=l(function(){if(!qe)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";y(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(oi),i(ri),"".concat(e,":").concat(n)},[qe,oi,ri]),vi=O(li.map(function(e){return e.key}),Math.max(oi.length,ri.length)),fi=vi.leftRefs,pi=vi.rightRefs,gi=vi.sectionLeftRefs,mi=vi.sectionRightRefs,hi=vi.lhsBadgeRefs,Si=vi.rhsBadgeRefs,Ri=vi.sectionRightRowRefs,xi=vi.subSectionLeftRefs,yi=vi.subSectionRightRefs,bi=vi.sectionRowRefs,Ci=vi.getSectionRowRef,wi=vi.getSubSectionRef,Bi=vi.getBadgeRef,_i=J({maintainRelativeOrder:Ve,proposedSections:oi,existingSections:ri,leftContainerRef:En,rightContainerRef:Cn,scrollContainerRef:yn,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,sectionRowRefs:bi,sectionRightRowRefs:Ri,rhsTopSpacerRef:wn,rhsBottomSpacerRef:Bn,lhsTopSpacerRef:_n,lhsBottomSpacerRef:Fn,calculateLinesRef:mn,setConnectedSections:tn,setConnectedLines:ln,cachedConnectedPositions:gn,closeMoreFunctionsPopup:Xn,setErrorToast:Qe,moreFunctions:Pn,closeSummaryPopup:Mn}),Fi=_i.isSideBySide,Ei=_i.isArrowVisible,Ii=_i.setIsArrowVisible,Ti=_i.isResizing,Ai=_i.setIsResizing,Di=_i.isSideBySideLoading,ji=_i.activeSideBySideSection,Pi=_i.scrollLock,ki=_i.sideBySideCacheRef,Li=_i.isSideBySideRef,Oi=_i.activeSideBySideRightSectionRef,Ni=_i.activeSideBySideSectionRef,Hi=_i.sideBySideLineRef,zi=_i.highlightedClauseRefs,Mi=_i.clearClauseHighlight,qi=_i.applyAlignmentPadding,Wi=_i.resetSideBySide,Vi=_i.activateSideBySide,Ki=N({maintainRelativeOrder:!!Ve,proposedSections:oi,existingSections:ri,activeSideBySideSection:ji,connectedSections:nn,resetSideBySide:Wi,setConnectedSections:tn,setConnectedLines:ln,cachedConnectedPositions:gn,svgContainerRef:un,isAnimatingRef:vn,animationTimerRef:fn,calculateLinesRef:mn,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi}),Yi=Ki.expandedSections,Xi=Ki.setExpandedSections,$i=Ki.expandedSubSections,Ji=Ki.setExpandedSubSections,Ui=Ki.handleSubSectionToggle,Gi=Ki.toggleSection;u(function(){qe&&"off"!==di&&"0:0"!==di&&(ki.current=null,gn.current=[],requestAnimationFrame(function(){var e;null===(e=mn.current)||void 0===e||e.call(mn)}))},[qe,di]);var Qi=l(function(){var e=new Map,n=new Map,i=1;if(Ve)oi.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),ri.forEach(function(t){if(t.id){var o=oi.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(oi.length,ri.length),o=0;o<t;o++){var r=oi[o],l=ri[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[oi,ri,Ve]),Zi=ti.analysis,et=h(null===(ue=null===(le=null==Zi?void 0:Zi.rule_difference_comparison)||void 0===le?void 0:le.summary)||void 0===ue?void 0:ue.overall_summary),nt=!!et.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),it=null!==(se=null==_e?void 0:_e.base_root_id)&&void 0!==se?se:"-1";null==_e||_e[it];var tt=Ze?null!==(xe=null!==(he=Le&&(null===(me=null==Le?void 0:Le[it])||void 0===me?void 0:me.evaluation_result))&&void 0!==he?he:null===(Re=null===(Se=null==_e?void 0:_e.nodes)||void 0===Se?void 0:Se[it])||void 0===Re?void 0:Re.evaluation_result)&&void 0!==xe?xe:null:null!==(ge=null!==(de=Le&&(null===(ce=null===(ae=null==Le?void 0:Le[it])||void 0===ae?void 0:ae.evaluation_result)||void 0===ce?void 0:ce[0]))&&void 0!==de?de:null===(pe=null===(fe=null===(ve=null==_e?void 0:_e.nodes)||void 0===ve?void 0:ve[it])||void 0===fe?void 0:fe.evaluation_result)||void 0===pe?void 0:pe[0])&&void 0!==ge?ge:null,ot=S(tt),rt=R(null!==(Ce=null===(be=null===(ye=null==tt?void 0:tt.evaluation_outputs)||void 0===ye?void 0:ye.metadata)||void 0===be?void 0:be.label_color)&&void 0!==Ce?Ce:E),lt=s(function(){Mi(),Wi(),tn(new Set),ln([]),gn.current=[],yt([]),Ct(null),zn(I),Yn(),requestAnimationFrame(function(){var e;null===(e=mn.current)||void 0===e||e.call(mn)})},[]),ut=r(lt);u(function(){ut.current=lt},[lt]),u(function(){Ae&&ut.current()},[Ae]);var st=s(function(n,i,t,o,r,l,u){var s,a,c,d=h(null==i?void 0:i.id)||h(null==t?void 0:t.id)||"",v=(d?Rn[d]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:d,decisioning:[],gap:[],relevance_score:0},f=null!==(a=null===(s=bi.current[o])||void 0===s?void 0:s.current)&&void 0!==a?a:null;return{isLoading:null!==(c=null==je?void 0:je.isLoading)&&void 0!==c&&c,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:v,anchorEl:n,sectionAnchorEl:f,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==_e?void 0:_e.documents,input_index_map:null==_e?void 0:_e.input_index_map},deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e(e({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(b)))return u(l);var s=o.split(b)[1];if(!s)return l;var a=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},c=(null===(n=null==a?void 0:a.deviation_entries)||void 0===n?void 0:n[s])||(null===(r=null==a?void 0:a.deviations)||void 0===r?void 0:r[s])||null;return c?e(e(e({},a),c),{deviation_summary:(null==c?void 0:c.deviation_summary)||(null==a?void 0:a.deviation_summary),deviation_title:(null==c?void 0:c.deviation_title)||(null==a?void 0:a.deviation_title),deviation_impact:(null==c?void 0:c.deviation_impact)||(null==a?void 0:a.deviation_impact),deviation_explanation:(null==c?void 0:c.deviation_explanation)||(null==a?void 0:a.deviation_explanation),evaluation_outputs:(null==c?void 0:c.evaluation_outputs)||(null==a?void 0:a.evaluation_outputs),cognitive_decisioning:(null==c?void 0:c.cognitive_decisioning)||(null==a?void 0:a.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Rn,_e]),at=s(function(){var e=Pn.sectionIdx,n=Pn.isOrphan;Xn(),Mn(),null!==e&&(n?Qe("No counterpart exists to connect to."):(Mi(),Li.current&&Wi(),ln([]),gn.current=[],tn(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){mn.current&&mn.current()},50)))},[Pn.sectionIdx,Pn.isOrphan,Xn,Mn,Wi]),ct=s(function(){var e=dn.current;if(e){dn.current=null;var n=oi.findIndex(function(n){return n.id===e}),i=ri.findIndex(function(n){return n.id===e}),t=-1===n?x(oi,e):null,o=-1===i?x(ri,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,u;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(u=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==u?u:null},s=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(zi.current.add(r),w(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(Ve)-1!==r&&En.current&&s(function(){return u(n,t,gi,xi)},En.current),-1!==l&&Cn.current&&s(function(){return u(i,o,mi,yi)},Cn.current);else{var a=yn.current;if(!a)return;s(function(){return-1!==r?u(n,t,gi,xi):u(i,o,mi,yi)},a)}}},[oi,ri,Ve,gi,mi,xi,yi,En,Cn,yn]),dt=s(function(n){if(n){Mi(),Wi(),tn(new Set),ln([]),gn.current=[],Mn(),Yn();var i=oi.findIndex(function(e){return e.id===n}),t=ri.findIndex(function(e){return e.id===n}),o=-1===i?x(oi,n):null,r=-1===t?x(ri,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;dn.current=n,Xi(function(n){var i,t=e({},n),o=!1;-1!==l&&(t[i=Ve?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=Ve?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),Ji(function(n){var i=e({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){dn.current===n&&vt.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[oi,ri,Ve,Xi,Ji,Wi,Mn,Yn]),vt=r(ct);u(function(){vt.current=ct},[ct]);var ft=r(null);u(function(){if(Un){var e=$n.fields.find(function(e){return e.analysisKey===Un||e.key===Un});if(e){var n=fi.current[e.key]||pi.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Un,$n.fields]);var pt=s(function(e){var n,i,t,o,r,l,u,s,a,c=null===(n=null==Zi?void 0:Zi.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.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 f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(u=f.highlights)||void 0===u?void 0:u.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(s=d.highlights)||void 0===s?void 0:s.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Zi]),gt=Y({proposedSections:oi,existingSections:ri,maintainRelativeOrder:Ve,cognitiveMap:Rn,deviationData:Le,treeData:_e,resolvedComparisonConfig:$n}),mt=gt.getSectionCompareStyle,ht=gt.getSubSectionCompareStyle,St=gt.getDeviationStyleByKey,Rt=$({containerRef:sn,leftContainerRef:En,rightContainerRef:Cn,svgContainerRef:un,pathRefs:pn,leftHeaderRef:an,rightHeaderRef:cn,proposedSections:oi,existingSections:ri,visibleFields:li,leftRefs:fi,rightRefs:pi,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,sectionRowRefs:bi,expandedSections:Yi,expandedSubSections:$i,connectedSections:nn,isSideBySide:Fi,activeSideBySideSection:ji,maintainRelativeOrder:Ve,cognitiveMap:Rn,getSectionCompareStyle:mt,getSubSectionCompareStyle:ht,getDeviationStyleByKey:St,isArrowVisible:Ei,isAnimatingRef:vn,isSideBySideRef:Li,sideBySideCacheRef:ki,sideBySideLineRef:Hi,activeSideBySideSectionRef:Ni,activeSideBySideRightSectionRef:Oi,connectedLines:rn,setConnectedLines:ln,cachedConnectedPositions:gn,calculateLinesRef:mn,resizeTimerRef:hn,scrollLock:Pi,handleResizeRef:Sn,activeProposed:ii,existingRule:ti,analysisData:Zi,pendingScrollTargetRef:In,pendingScrollCallbackRef:Tn,resolvedComparisonConfig:$n,getFieldData:pt}),xt=Rt.lines,yt=Rt.setLines,bt=Rt.overallConnector,Ct=Rt.setOverallConnector,wt=Rt.svgDimensions,Bt=Rt.handleColumnScroll,_t=s(function(){Mi(),Xi({}),Ji({}),Wi(),tn(new Set),ln([]),gn.current=[],Mn(),Yn(),Xn(),requestAnimationFrame(function(){mn.current&&mn.current()})},[Xi,Ji,Wi,Mn,Yn,Xn]),Ft=l(function(){return Object.values(Yi).some(Boolean)||Object.values($i).some(Boolean)},[Yi,$i]),Et=r(null),It=r(0),Tt=r(0),At=r(0),Dt=X({timerRef:Et,ruleComponentRef:bn,scrollContainerRef:yn,containerRef:sn,maintainRelativeOrder:Ve,proposedSections:oi,existingSections:ri,isSideBySideRef:Li,activeSideBySideSectionRef:Ni,activeSideBySideRightSectionRef:Oi,sectionRowRefs:bi,sectionRightRowRefs:Ri,sectionLeftRefs:gi,sectionRightRefs:mi,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,leftContainerRef:En,rightContainerRef:Cn,calculateLinesRef:mn,handleResizeRef:Sn,setIsResizing:Ai,setIsArrowVisible:Ii,sideBySideCacheRef:ki,cachedConnectedPositions:gn}).handleResize;u(function(){Sn.current=Dt},[Dt,Sn]),u(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,u;i.current=null;var s=e[e.length-1];if(s){var a=null!==(u=null===(l=null===(r=s.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==u?u:s.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return bn.current&&o.push(e(bn.current,It,n,function(){return Sn.current()},function(){})),yn.current&&o.push(e(yn.current,Tt,i,function(){return Sn.current()},function(){return mn.current()})),sn.current&&o.push(e(sn.current,At,t,function(){return Sn.current()},function(){return mn.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),u(function(){Li.current=Fi},[Fi]),u(function(){Ni.current=ji},[ji]);var jt=s(function(){var e,n=Pn.sectionIdx,i=Pn.isOrphan;if(Mn(),null!=n){var t="left";Pn.anchorEl&&(null===(e=Cn.current)||void 0===e?void 0:e.contains(Pn.anchorEl))&&(t="right"),Vi(n,i,{sourceSide:t})}},[Vi,Pn.isOrphan,Pn.sectionIdx,Pn.anchorEl,Mn]),Pt=s(function(){Mn(),Wi(),tn(new Set),ln([]),gn.current=[]},[Mn,Wi]),kt=null!==Pn.sectionIdx&&nn.has(Pn.sectionIdx),Lt=H({proposedSections:oi,existingSections:ri,parentDeviationRecord:ui,expandedSections:Yi,maintainRelativeOrder:!!Ve,scrollContainerRef:yn,leftContainerRef:En,rightContainerRef:Cn,lhsBadgeRefs:hi,rhsBadgeRefs:Si}),Ot=Lt.showDeviationNavigation,Nt=Lt.showOpenNodeRef,Ht=Lt.adjustScrollForPopup,zt=s(function(e,n,i,t,o){var r,l="string"==typeof t?h(t).trim():h(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;Yn();var s="left";(null===(r=Cn.current)||void 0===r?void 0:r.contains(u))&&(s="right");var a=function(){var e,i,t,o;if("string"==typeof n&&n.includes(b)){var r=n.split(b),l="".concat(r[0]).concat(b).concat(r[1]);return"right"===s?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(i=hi.current[l])||void 0===i?void 0:i.current}return"right"===s?null===(t=Si.current[n])||void 0===t?void 0:t.current:null===(o=hi.current[n])||void 0===o?void 0:o.current},c=function(e,t){var o=!!Ve,r=o?"right"===s?Cn.current:En.current:yn.current,l=o?"right"===s?En.current:Cn.current:null;if(r&&e){var u=function(){var e="string"==typeof n&&n.includes(b);i||!e?t():requestAnimationFrame(function(){var e,i,o;ki.current=null,gn.current=[],qi(!0,n,null),null===(e=mn.current)||void 0===e||e.call(mn),null===(i=En.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=Cn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),t()})},a=e.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.bottom-.35*c.height,v=c.top+.35*c.height;if(a.top>d||a.top<v){var f=c.top+c.height/2,p=a.top+a.height/2-f;o&&l&&C(l,l.scrollTop+p,250,function(){}),C(r,r.scrollTop+p,250,u)}else u()}else t()};if(i)return Wi(),tn(new Set),ln([]),gn.current=[],void(l&&requestAnimationFrame(function(){var e=a()||u;c(e,function(){zn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}));Vi(n,i,l?{toggleIfSame:!1,sourceSide:s,onReady:function(){var e=a()||u;c(e,function(){zn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}}:{toggleIfSame:!1,sourceSide:s})},[Vi,Yn,zn,Wi,Ve]),Mt=l(function(){var e;if(!Oe)return null;var n=null===(e=null==Oe?void 0:Oe.id)||void 0===e?void 0:e.split(":")[0];for(var i in ui){if((ui[i]||[]).some(function(e){return e.id===n}))return i}return null},[Oe,ui]),qt=r({id:null,triggerMs:null}),Wt=r(null);u(function(){var i;if(null==Oe?void 0:Oe.id){var t=Number(Oe.trigger),o=qt.current;if((null==o?void 0:o.triggerMs)!==t){if(!(Oe.id.includes(":")&&/:\d+$/.test(Oe.id)))return qt.current={id:Oe.id,triggerMs:t},void dt(Oe.id);var r=null===(i=null==Oe?void 0:Oe.id)||void 0===i?void 0:i.split(":"),l=r[0],u=r[1],s=null!=u?u:"0";Wt.current!==Oe.id&&(Mn(),Yn(),Wi(),tn(new Set),ln([]),gn.current=[],Wt.current=Oe.id);var a=!1,c=0,d=null,v=150,f=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},p=function(){var i,o,r,u;if(!a){var g=function(){qt.current={id:Oe.id,triggerMs:t}},m=null,h=null;for(var S in ui){var R=ui[S].find(function(e){return e.id===l});if(R){m=S,h=R;break}}if(h&&m){var x=oi.findIndex(function(e){return e.id===m}),y=ri.findIndex(function(e){return e.id===m}),C=-1===x&&-1!==y,w=f(oi,h.id),B=f(ri,h.id);if(w&&!B&&!C){var _=w.split("-"),F=Number(_[0]);if(Ve){var E=null===(o=null===(i=oi[F])||void 0===i?void 0:i.refIndexes)||void 0===o?void 0:o[0],I=ri.findIndex(function(e){return e.selfIndex===E});-1!==I&&(F=I)}B=n([F],_.slice(1),!0).join("-")}if(w||B){var T=C||!w&&!!B,A=w?Number(w.split("-")[0]):x,D=B?Number(B.split("-")[0]):y;if(T){if(!(Ve?!!Yi["right-".concat(D)]:!!Yi[String(D)])&&D>=0)return Gi(D,"right"),c+=1,void(d=setTimeout(p,450))}else if(!(Ve?!!Yi["left-".concat(A)]:!!Yi[String(A)])&&A>=0)return Gi(A,"left"),c+=1,void(d=setTimeout(p,450));var j,P=w||"",k=B||"",L="".concat(h.id).concat(b).concat(s).concat(b).concat(P).concat(b).concat(k),O="".concat(h.id).concat(b).concat(s),N=null===(r=hi.current[O])||void 0===r?void 0:r.current,H=null===(u=Si.current[O])||void 0===u?void 0:u.current,z=T||!N&&!!H,M=z?H:N;if(j=Ve?z?Cn.current:En.current:yn.current,M&&j){var q=M.getBoundingClientRect();if(0===q.height)return void((c+=1)<2?d=setTimeout(p,v):g());var W=j.getBoundingClientRect(),V=q.top-W.top+j.scrollTop-W.height/2+q.height/2+150,K=function(){var n,i,t,o,r;if(!a){g();var l=M instanceof Element?window.getComputedStyle(M).color:"";N&&(N.style.transition="box-shadow 300ms ease-in-out",N.style.boxShadow="0 0 10px ".concat(l)),H&&(H.style.transition="box-shadow 300ms ease-in-out",H.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){N&&(N.style.boxShadow=""),H&&(H.style.boxShadow="")},2e3);var u=(null===(i=null===(n=h.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[s])||h,c=(null===(t=h.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||h.evaluation_outputs;if(!(!!N&&!!H)){var d=z?(null===(o=Si.current[O])||void 0===o?void 0:o.current)||H:(null===(r=hi.current[O])||void 0===r?void 0:r.current)||N;return Ht(d,function(){zn({open:!0,anchorEl:d,displayImpact:Oe.displayImpact,summary:e(e({},u),{evaluation_outputs:c})})}),void(null==Ne||Ne())}Vi(L,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,i,t=z?(null===(n=Si.current[O])||void 0===n?void 0:n.current)||H:(null===(i=hi.current[O])||void 0===i?void 0:i.current)||N;Ht(t,function(){requestAnimationFrame(function(){var n,i,o;ki.current=null,gn.current=[],qi(!0,L,null),null===(n=mn.current)||void 0===n||n.call(mn),null===(i=En.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=Cn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),zn({open:!0,anchorEl:t,displayImpact:null==Oe?void 0:Oe.displayImpact,summary:e({},u)})})})}})}};Math.abs(j.scrollTop-V)<=2?K():(In.current=V,Tn.current=K,j.scrollTo({top:V,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(Tn.current){In.current=null;var e=Tn.current;Tn.current=null,e()}},800))}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}};return d=setTimeout(p,v),function(){a=!0,d&&clearTimeout(d)}}}},[Oe,ui,oi,ri,Ve,Yi,Gi,Vi,zn,dt]);var Vt={maintainRelativeOrder:!!Ve,showDeviationBadges:Ye,isProposingFix:ze,proposingFixNodeId:Me,isRedlineFlow:qe,isSideBySide:Fi,activeSideBySideSection:ji,connectedSections:nn,proposedSections:oi,existingSections:ri,deviationNumberRegistry:si,treeData:_e,displayConfig:je,resolvedMarkdownStyles:xn,unifiedNumbering:Qi,expandedSections:Yi,expandedSubSections:$i,setExpandedSubSections:Ji,getSectionCompareStyle:mt,getSubSectionCompareStyle:ht,getBadgeRef:Bi,getSectionRowRef:Ci,getSubSectionRef:wi,sectionLeftRefs:gi,sectionRightRefs:mi,sectionRowRefs:bi,sectionRightRowRefs:Ri,subSectionLeftRefs:xi,subSectionRightRefs:yi,lhsBadgeRefs:hi,rhsBadgeRefs:Si,openMoreFunctionsPopup:function(e,n,i,t,o,r){var l;if(e.stopPropagation(),Pn.open&&Pn.sectionIdx===o)Xn();else{var u=e.currentTarget,s="left";(null===(l=Cn.current)||void 0===l?void 0:l.contains(u))&&(s="right");Mi(),Li.current&&Wi(),tn(new Set),ln([]),gn.current=[],Yn(),Hn.open?Pt():Mn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(b)){var r=o.split(b),l="".concat(r[0]).concat(b).concat(r[1]);return"right"===s?null===(e=Si.current[l])||void 0===e?void 0:e.current:null===(n=hi.current[l])||void 0===n?void 0:n.current}return"right"===s?null===(i=Si.current[o])||void 0===i?void 0:i.current:null===(t=hi.current[o])||void 0===t?void 0:t.current}()||u;kn(st(e,n,t,o,i,r))})}},handleOpenSummaryPopup:zt,openSummaryPopup:zt,handleCloseSummaryPopup:Pt,toggleSection:Gi,handleSubSectionToggle:Ui,renderSubSectionAccordion:function(e){var n=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,u=void 0===l?"left":l,s=e.parentNodeId,a=void 0===s?"":s,c=e.sectionOffset;return i(M,{section:n,keyPath:t,depth:r,columnKey:u,parentNodeId:a,sectionOffset:c})},resetSideBySide:Wi,setConnectedSections:tn,setConnectedLines:ln,cachedConnectedPositions:gn,showDeviationNavigation:Ot,showOpenNodeRef:Nt,deviationNodeIdToView:null==Oe?void 0:Oe.id,deviationTargetParentId:Mt};return i(K,e({value:Vt},{children:t(a,e({ref:bn,sx:e(e({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},Ve?{}:{overflow:"visible"}),{position:"relative"})},{children:[$e&&i(a,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(j,{})})),Hn.open&&i(V,{open:Hn.open,anchorEl:Hn.anchorEl,containerEl:ft.current,clipTopEl:an.current,scrollContainerEl:yn.current,onClose:Pt,summary:Hn.summary,displayImpact:Hn.displayImpact}),i(D,{open:Pn.open,anchorEl:Pn.anchorEl,sectionTitle:Pn.sectionTitle,referenceSectionTitle:Pn.refSectionTitle,onClose:Xn,onOpenCognitiveCompare:Vn,onOpenSideBySide:jt,onConnect:at,isConnected:kt,isOrphan:Pn.isOrphan}),Dn.open&&i(A,{open:Dn.open,popupRef:Wn,position:Ln,popupConfig:Pe,onClose:function(){On(null),jn(function(n){return e(e({},n),{open:!1})}),qn(null)},markdownStyles:Te,sectionTitle:Zn,referenceSectionTitle:ei,cognitiveData:Dn.cognitiveData,anchorEl:Dn.anchorEl,sectionAnchorEl:Dn.sectionAnchorEl,scrollContainerEl:yn.current,badgeStyle:Dn.badgeStyle,docData:Dn.docData,deviationData:Dn.deviationData,isLoading:Dn.isLoading}),i(c,e({open:!!Ge,autoHideDuration:8e3,onClose:function(){return Qe(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:i(d,e({onClose:function(){return Qe(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ge}))})),i(z,{componentHeaderText:Be,displayConfig:je,maintainRelativeOrder:Ve,onCollapseAll:_t,showCollapseAll:Ft,onToggleView:function(e){Je(!0),setTimeout(function(){Ke(!e),Wi(),Mn(),tn(new Set),ln([]),gn.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Je(!1)},600)})})},50)}}),i(a,e({ref:yn,onScroll:Bt,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:Ve?"hidden":"auto",borderTop:et&&nt?"none":"1.5px solid #EEF0F4"}},{children:i(a,e({sx:e({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},Ve?{flex:1,minHeight:0}:{})},{children:t(a,e({ref:sn,sx:e({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},Ve?{flex:1,overflow:"visible"}:{})},{children:[i(U,{svgContainerRef:un,svgDimensions:wt,isResizing:Ti,overallConnector:bt,rootDeviationStyle:rt,lines:xt,isSideBySide:Fi,activeSideBySideSection:ji,isArrowVisible:Ei,maintainRelativeOrder:Ve,proposedSections:oi,existingSections:ri,cognitivePopup:Dn,activeBadgeId:Nn,closeCognitivePopup:Yn,setActiveBadgeId:qn,openCognitivePopupFromState:Kn,buildSectionPopupState:st,connectedLines:rn,pathRefs:pn}),t(a,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)"},Ve?{flex:1,overflow:"visible"}:{})},{children:[i(a,e({ref:an,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:Zn,placement:"top"},{children:i(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Zn}))}))})),t(a,e({ref:En,onScroll:Bt,sx:e({p:"12px",display:"flex",flexDirection:"column"},Ve?{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:_n,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&oi.map(function(e,n){return i(q,{section:e,idx:n},"left-row-".concat(n))}),i("div",{ref:Fn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),i(a,e({ref:ft,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:i(a,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:t(a,e({onClick:function(n){n.stopPropagation(),Dn.open&&Nn===it?Yn():(qn(it),Kn(st(n.currentTarget,{title:"",content:"",evaluationResult:tt,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,it,!0,e(e({},rt),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:rt.badgeBg,color:rt.badgeText,border:"1px solid ".concat(rt.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ot?ot:i(P,{}),i(a,e({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:i(g,{})})),i(p,{size:11,style:{transform:Dn.open&&Nn===it?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),t(a,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},Ve?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[Di&&i(m,{sections:11}),i(a,e({ref:cn,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:ei,placement:"top"},{children:i(f,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:ei}))}))})),t(a,e({ref:Cn,onScroll:Bt,sx:e({p:"12px",display:"flex",flexDirection:"column"},Ve?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[i("div",{ref:wn,style:{width:"100%",height:"0px",flexShrink:0}}),ci&&ri.map(function(e,n){return i(W,{section:e,idx:n},"right-row-".concat(n))}),i("div",{ref:Bn,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};export{G as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as o,jsxs as i}from"react/jsx-runtime";import n from"react";import{Box as t}from"@mui/material";import{EllipsisVertical as r}from"lucide-react";import l from"./SectionAccordion.js";import a from"./ThreeDotsLoader.js";import{extractDeviationScore as d}from"../CognitiveComparehelpers.js";import{useCompareContext as c}from"../CompareContext.js";var s=n.memo(function(n){var s,p,u=n.section,f=n.idx,v=c(),g=v.maintainRelativeOrder,m=v.existingSections;v.proposedSections;var x=v.connectedSections,h=v.expandedSections,b=v.displayConfig,S=v.treeData;v.deviationNumberRegistry;var R=v.getSectionCompareStyle;v.getBadgeRef;var w=v.getSectionRowRef,y=v.sectionLeftRefs,B=v.lhsBadgeRefs,C=v.openMoreFunctionsPopup,I=v.handleOpenSummaryPopup,N=v.handleCloseSummaryPopup,D=v.toggleSection;v.showDeviationBadges,v.renderSubSectionAccordion,v.isProposingFix,v.proposingFixNodeId,v.isRedlineFlow,v.isSideBySide,v.activeSideBySideSection,v.deviationNodeIdToView,v.deviationTargetParentId;var P=v.showDeviationNavigation;v.showOpenNodeRef,v.resolvedMarkdownStyles;var T=v.unifiedNumbering,k=!u.title&&!u.content;if(g&&k)return null;var j=u,z=R(f,"left"),A=g?!(null===(s=j.refIndexes)||void 0===s?void 0:s.length)||j.selfIndex<0:!m[f],F=x.has(f),L=d(j.evaluationResult,null==z?void 0:z.deviationLabel),O=T.leftNums.get(j.id);return o(t,e({ref:w(f),sx:{mb:1,width:"100%"}},{children:
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as o,jsxs as i}from"react/jsx-runtime";import n from"react";import{Box as t}from"@mui/material";import{EllipsisVertical as r}from"lucide-react";import l from"./SectionAccordion.js";import a from"./ThreeDotsLoader.js";import{extractDeviationScore as d}from"../CognitiveComparehelpers.js";import{useCompareContext as c}from"../CompareContext.js";var s=n.memo(function(n){var s,p,u=n.section,f=n.idx,v=c(),g=v.maintainRelativeOrder,m=v.existingSections;v.proposedSections;var x=v.connectedSections,h=v.expandedSections,b=v.displayConfig,S=v.treeData;v.deviationNumberRegistry;var R=v.getSectionCompareStyle;v.getBadgeRef;var w=v.getSectionRowRef,y=v.sectionLeftRefs,B=v.lhsBadgeRefs,C=v.openMoreFunctionsPopup,I=v.handleOpenSummaryPopup,N=v.handleCloseSummaryPopup,D=v.toggleSection;v.showDeviationBadges,v.renderSubSectionAccordion,v.isProposingFix,v.proposingFixNodeId,v.isRedlineFlow,v.isSideBySide,v.activeSideBySideSection,v.deviationNodeIdToView,v.deviationTargetParentId;var P=v.showDeviationNavigation;v.showOpenNodeRef,v.resolvedMarkdownStyles;var T=v.unifiedNumbering,k=!u.title&&!u.content;if(g&&k)return null;var j=u,z=R(f,"left"),A=g?!(null===(s=j.refIndexes)||void 0===s?void 0:s.length)||j.selfIndex<0:!m[f],F=x.has(f),L=d(j.evaluationResult,null==z?void 0:z.deviationLabel),O=T.leftNums.get(j.id);return o(t,e({ref:w(f),sx:{mb:1,width:"100%"}},{children:o(t,e({ref:y.current[f],sx:e({width:"100%",display:"flex",flexDirection:"column",minWidth:0},F&&{borderRadius:"6px",outline:"2px solid ".concat((null==z?void 0:z.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i(t,e({sx:{position:"relative",width:"100%"}},{children:[o(l,{section:u,idx:f,columnKey:"left",colRef:w("left-accordion-".concat(f)),mb:0,parentNodeId:(null===(p=null==S?void 0:S.input_index_map)||void 0===p?void 0:p[0])||"",isExpanded:g?!!h["left-".concat(f)]:!!h[String(f)],onToggle:function(){N(),D(f,"left")},navigation:u.id?P[u.id]:null}),g&&z&&i(t,e({ref:B.current[f],onClick:function(e){var o,i,n,t=b.enableDeviationSchemaBackwardCompatibility?null!==(o=j.evaluationResult)&&void 0!==o?o:null:null!==(n=null===(i=j.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==n?n:null;I(e,String(f),A,t)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:z.badgeBg,color:z.badgeText,border:"1px solid ".concat(z.badgeBorder),borderRadius:"12px",px:1.2,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[i(t,e({component:"span",onClick:function(e){var o,i,n;e.stopPropagation();var t=b.enableDeviationSchemaBackwardCompatibility?null!==(o=j.evaluationResult)&&void 0!==o?o:null:null!==(n=null===(i=j.evaluationResult)||void 0===i?void 0:i[0])&&void 0!==n?n:null;I(e,String(f),A,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:A?"default":"pointer",borderRight:"1px solid ".concat(z.badgeBorder),"&:hover":A?{}:{bgColor:"".concat(z.badgeBorder,"22")}}},{children:[null!=O&&o(t,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(z.badgeBorder)}},{children:O})),o(t,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!b.isLoading||null!=j.evaluationResult&&void 0!==j.evaluationResult?"N/A"===L||"NA"===L?"N/A":0==L||null==L?"Same":"".concat(L):o(a,{color:z.badgeText})}))]})),o(t,e({component:"span",onClick:function(e){e.stopPropagation();var o=g?m.find(function(e){var o;return null===(o=j.refIndexes)||void 0===o?void 0:o.includes(e.selfIndex)})||{title:"",content:""}:m[f]||{title:"",content:""};C(e,u,A,o,f,z)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(z.badgeBorder,"22")}}},{children:o(r,{size:11,color:z.badgeText})}))]}))]}))}))}),"left-row-".concat(f))});export{s as default};
|
|
2
2
|
//# sourceMappingURL=LHSSectionRow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as i,jsxs as o,Fragment as n}from"react/jsx-runtime";import t from"react";import{Box as r}from"@mui/material";import{EllipsisVertical as a}from"lucide-react";import l from"./SectionAccordion.js";import d from"./ThreeDotsLoader.js";import{useCompareContext as c}from"../CompareContext.js";var s=t.memo(function(t){var s,p,u=t.section,x=t.idx,f=c(),g=f.maintainRelativeOrder;f.existingSections;var v=f.proposedSections,m=f.connectedSections,h=f.expandedSections,b=f.displayConfig,S=f.treeData;f.deviationNumberRegistry;var R=f.getSectionCompareStyle;f.getBadgeRef;var I=f.getSectionRowRef,y=f.sectionRightRefs,w=f.rhsBadgeRefs,B=f.openMoreFunctionsPopup,C=f.handleOpenSummaryPopup,N=f.handleCloseSummaryPopup,D=f.toggleSection;f.showDeviationBadges,f.renderSubSectionAccordion,f.isProposingFix,f.proposingFixNodeId,f.isRedlineFlow,f.isSideBySide,f.activeSideBySideSection,f.deviationNodeIdToView,f.deviationTargetParentId;var P=f.showDeviationNavigation;f.showOpenNodeRef,f.resolvedMarkdownStyles;var T=f.unifiedNumbering,k=u,j=!1,z=null,F=-1;if(g){F=v.findIndex(function(e){var i;return(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(k.selfIndex))&&e.selfIndex>=0});var O=v.findIndex(function(e,i){var o;return m.has(i)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(k.selfIndex))});(j=-1!==O)&&(z=R(O,"left"))}else(j=m.has(x))&&(z=R(x,"right"));var A=g&&-1!==F?R(F,"left"):R(x,"right"),L=g?-1!==F||!(null===(s=k.refIndexes)||void 0===s?void 0:s.length)&&v.some(function(e){return e.id&&e.id===k.id}):Boolean(v[x]),M=g?k.selfIndex<0||!L:!v[x],W=T.rightNums.get(k.id);return i(r,e({ref:I(x),sx:{mb:1,width:"100%"}},{children:
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as i,jsxs as o,Fragment as n}from"react/jsx-runtime";import t from"react";import{Box as r}from"@mui/material";import{EllipsisVertical as a}from"lucide-react";import l from"./SectionAccordion.js";import d from"./ThreeDotsLoader.js";import{useCompareContext as c}from"../CompareContext.js";var s=t.memo(function(t){var s,p,u=t.section,x=t.idx,f=c(),g=f.maintainRelativeOrder;f.existingSections;var v=f.proposedSections,m=f.connectedSections,h=f.expandedSections,b=f.displayConfig,S=f.treeData;f.deviationNumberRegistry;var R=f.getSectionCompareStyle;f.getBadgeRef;var I=f.getSectionRowRef,y=f.sectionRightRefs,w=f.rhsBadgeRefs,B=f.openMoreFunctionsPopup,C=f.handleOpenSummaryPopup,N=f.handleCloseSummaryPopup,D=f.toggleSection;f.showDeviationBadges,f.renderSubSectionAccordion,f.isProposingFix,f.proposingFixNodeId,f.isRedlineFlow,f.isSideBySide,f.activeSideBySideSection,f.deviationNodeIdToView,f.deviationTargetParentId;var P=f.showDeviationNavigation;f.showOpenNodeRef,f.resolvedMarkdownStyles;var T=f.unifiedNumbering,k=u,j=!1,z=null,F=-1;if(g){F=v.findIndex(function(e){var i;return(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(k.selfIndex))&&e.selfIndex>=0});var O=v.findIndex(function(e,i){var o;return m.has(i)&&(null===(o=e.refIndexes)||void 0===o?void 0:o.includes(k.selfIndex))});(j=-1!==O)&&(z=R(O,"left"))}else(j=m.has(x))&&(z=R(x,"right"));var A=g&&-1!==F?R(F,"left"):R(x,"right"),L=g?-1!==F||!(null===(s=k.refIndexes)||void 0===s?void 0:s.length)&&v.some(function(e){return e.id&&e.id===k.id}):Boolean(v[x]),M=g?k.selfIndex<0||!L:!v[x],W=T.rightNums.get(k.id);return i(r,e({ref:I(x),sx:{mb:1,width:"100%"}},{children:i(r,e({ref:y.current[x],sx:e({width:"100%",display:"flex"},j&&z&&{borderRadius:"6px",outline:"2px solid ".concat(z.badgeBorder),outlineOffset:"1px"})},{children:o(r,e({sx:{position:"relative",width:"100%"}},{children:[i(l,{section:u,idx:x,columnKey:"right",colRef:I("right-accordion-".concat(x)),mb:0,parentNodeId:(null===(p=null==S?void 0:S.input_index_map)||void 0===p?void 0:p[1])||"",isExpanded:g?!!h["right-".concat(x)]:!!h[String(x)],onToggle:function(){N(),D(x,"right")},navigation:u.id?P[u.id]:null}),g&&A&&i(r,e({ref:w.current[x],"data-section-id":k.id,onClick:function(e){var i,o,n;if(M){var t=b.enableDeviationSchemaBackwardCompatibility?null!==(i=k.evaluationResult)&&void 0!==i?i:null:null!==(n=null===(o=k.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==n?n:null;C(e,String(x),M,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:M?"4px":"0px",fontSize:"11px",bgcolor:A.badgeBg,color:A.badgeText,border:"1px solid ".concat(A.badgeBorder),borderRadius:M?"12px":"10px",px:M?1.2:1,py:.3,fontWeight:M?600:700,cursor:M?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:M?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:M?o(n,{children:[o(r,e({component:"span",onClick:function(e){var i,o,n;e.stopPropagation();var t=b.enableDeviationSchemaBackwardCompatibility?null!==(i=k.evaluationResult)&&void 0!==i?i:null:null!==(n=null===(o=k.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==n?n:null;C(e,String(x),M,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(A.badgeBorder),"&:hover":{bgcolor:"".concat(A.badgeBorder,"22")}}},{children:[null!=W&&i(r,e({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(A.badgeBorder)}},{children:W})),i(r,e({component:"span",sx:{fontSize:"11px",px:.25}},{children:!b.isLoading||null!=k.evaluationResult&&void 0!==k.evaluationResult?A.label?"".concat(A.label):"100% Deviation":i(d,{color:A.badgeText})}))]})),i(r,e({component:"span",onClick:function(e){e.stopPropagation();var i=g?v.find(function(e){var i;return null===(i=e.refIndexes)||void 0===i?void 0:i.includes(k.selfIndex)})||{title:"",content:""}:v[x]||{title:"",content:""};B(e,i,M,k,x,A)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(A.badgeBorder,"22")}}},{children:i(a,{size:11,color:A.badgeText})}))]}):null!=W?W:""}))]}))}))}),"right-row-".concat(x))});export{s as default};
|
|
2
2
|
//# sourceMappingURL=RHSSectionRow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as e,useRef as n,useEffect as t,useCallback as r}from"react";import{DEVIATION_BADGE_SEPARATOR as i,smoothScrollTo as l,resetClauseHighlight as u}from"../CognitiveComparehelpers.js";var
|
|
1
|
+
import{useState as e,useRef as n,useEffect as t,useCallback as r}from"react";import{DEVIATION_BADGE_SEPARATOR as i,smoothScrollTo as l,resetClauseHighlight as u}from"../CognitiveComparehelpers.js";var o=function(o){var c=o.maintainRelativeOrder,d=o.proposedSections,s=o.existingSections,a=o.leftContainerRef,v=o.rightContainerRef,p=o.scrollContainerRef,g=o.sectionLeftRefs,f=o.sectionRightRefs,h=o.subSectionLeftRefs,y=o.subSectionRightRefs,R=o.lhsBadgeRefs,S=o.rhsBadgeRefs,m=o.sectionRowRefs,x=o.sectionRightRowRefs,B=o.rhsTopSpacerRef,C=o.rhsBottomSpacerRef,T=o.lhsTopSpacerRef,b=o.lhsBottomSpacerRef,I=o.calculateLinesRef,A=o.setConnectedSections,E=o.setConnectedLines,w=o.cachedConnectedPositions,L=o.closeMoreFunctionsPopup,F=o.setErrorToast,N=o.moreFunctions,M=o.closeSummaryPopup,q=e(!0),H=q[0],P=q[1],O=e(!1),z=O[0],V=O[1],j=e(!1),k=j[0],D=j[1],G=e(!1),J=G[0],K=G[1],Q=e(null),U=Q[0],W=Q[1],X=n(!1),Y=n(null),Z=n(!1),$=n(null),_=n(null),ee=n(null),ne=n(new Set),te=function(){ne.current.forEach(function(e){u(e)}),ne.current.clear()},re=function(e,n,t){var r,l,u,o,c,d,s,p,B,C,T,b,I=null,A=null,E=null,w=null,L=null,F=null,N=function(e,n){if(!e||!n)return!0;var t=e.getBoundingClientRect(),r=n.getBoundingClientRect();return t.bottom>=r.top&&t.top<=r.bottom};if(e){var M=n.split(i),q="".concat(M[0]).concat(i).concat(M[1]);I=(null===(r=h.current[M[2]])||void 0===r?void 0:r.current)||(null===(l=g.current[Number(M[2])])||void 0===l?void 0:l.current)||null,A=(null===(u=y.current[M[3]])||void 0===u?void 0:u.current)||(null===(o=f.current[Number(M[3])])||void 0===o?void 0:o.current)||null,E=(null===(c=R.current[q])||void 0===c?void 0:c.current)||I,w=(null===(d=S.current[q])||void 0===d?void 0:d.current)||A}else{var H=Number(n),P=null!==t?Number(t):H;I=(null===(s=g.current[H])||void 0===s?void 0:s.current)||null,A=(null===(p=f.current[P])||void 0===p?void 0:p.current)||null,L=(null===(B=R.current[H])||void 0===B?void 0:B.current)||null,F=(null===(C=S.current[P])||void 0===C?void 0:C.current)||null,E=L||(null===(T=m.current[H])||void 0===T?void 0:T.current)||I,w=F||(null===(b=x.current[P])||void 0===b?void 0:b.current)||A}if(I&&(I.style.paddingTop="0px"),A&&(A.style.paddingTop="0px"),e||(L&&(L.style.marginTop="0px"),F&&(F.style.marginTop="0px")),!e&&L&&F){var O=a.current,z=v.current;if(!N(L,O)||!N(F,z))return;var V=L.getBoundingClientRect(),j=F.getBoundingClientRect(),k=V.top-j.top;if(Math.abs(k)>32)return;k>0?F.style.marginTop="".concat(k,"px"):k<0&&(L.style.marginTop="".concat(Math.abs(k),"px"))}else if(E&&w&&I&&A){V=E.getBoundingClientRect(),j=w.getBoundingClientRect();(k=V.top-j.top)>0?A.style.paddingTop="".concat(k,"px"):k<0&&(I.style.paddingTop="".concat(Math.abs(k),"px"))}};t(function(){Z.current=H},[H]),t(function(){$.current=U},[U]);var ie=r(function(){var e,n,t,r,l,u,o,c;te(),P(!1),Z.current=!1,Y.current=null;var d=$.current,s=_.current;if(null!==d)if("string"==typeof d&&d.includes(i)){var a=d.split(i);(v=(null===(e=h.current[a[2]])||void 0===e?void 0:e.current)||(null===(n=g.current[Number(a[2])])||void 0===n?void 0:n.current))&&(v.style.paddingTop="0px")}else{var v;(v=null===(t=g.current[d])||void 0===t?void 0:t.current)&&(v.style.paddingTop="0px");var p=null===(r=R.current[d])||void 0===r?void 0:r.current;p&&(p.style.marginTop="0px")}if(null!==s)if("string"==typeof s&&s.includes(i)){a=s.split(i);(m=(null===(l=y.current[a[3]])||void 0===l?void 0:l.current)||(null===(u=f.current[Number(a[3])])||void 0===u?void 0:u.current))&&(m.style.paddingTop="0px")}else{var m;(m=null===(o=f.current[s])||void 0===o?void 0:o.current)&&(m.style.paddingTop="0px");var x=null===(c=S.current[s])||void 0===c?void 0:c.current;x&&(x.style.marginTop="0px")}W(null),$.current=null,_.current=null,V(!1),K(!1),B.current&&(B.current.style.height="0px"),C.current&&(C.current.style.height="0px"),T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px")},[]),le=r(function(e,n,t){var r,u,o=null===(r=null==t?void 0:t.toggleIfSame)||void 0===r||r,h=null==t?void 0:t.onReady,y=null!==(u=null==t?void 0:t.sourceSide)&&void 0!==u?u:"left";L(),null!=e&&(n?F("No counterpart exists for this section."):(te(),H&&U===e?o?ie():null==h||h():(A(new Set([e])),E([]),w.current=[],K(!0),X.current=!0,W(e),$.current=e,P(!0),Z.current=!0,V(!1),B.current&&(B.current.style.height="0px"),C.current&&(C.current.style.height="0px"),T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px"),requestAnimationFrame(function(){var n,t,r,u,o,A,E,w,L="string"==typeof e&&e.includes(i),F=null,N=null,M=null;if(L){var q=e.split(i),H="".concat(q[0]).concat(i).concat(q[1]);F=(null===(n=R.current[H])||void 0===n?void 0:n.current)||null,N=(null===(t=S.current[H])||void 0===t?void 0:t.current)||null,M=N?e:null}else if(F=(null===(r=g.current[e])||void 0===r?void 0:r.current)||(null===(u=m.current[e])||void 0===u?void 0:u.current)||null,c){var P=d[e],O=(null==P?void 0:P.refIndexes)||[];if(O.length>0){var z=O[0],j=s.findIndex(function(e){return e.selfIndex===z});-1!==j&&(N=(null===(E=f.current[j])||void 0===E?void 0:E.current)||(null===(w=x.current[j])||void 0===w?void 0:w.current)||null,M=j)}}else N=(null===(o=f.current[e])||void 0===o?void 0:o.current)||(null===(A=x.current[e])||void 0===A?void 0:A.current)||null,M=N?e:null;_.current=M;var k=a.current,D=v.current,G=function(){re(L,e,M),V(!0),I.current&&I.current(),X.current=!1,"right"===y&&D?D.dispatchEvent(new Event("scroll")):k&&k.dispatchEvent(new Event("scroll")),K(!1),null==h||h()};if(!F||!k)return X.current=!1,K(!1),void(null==h||h());if(N&&D){if(!c){var J=0;J="right"===y?N?N.getBoundingClientRect().top:0:F?F.getBoundingClientRect().top:0;var Q=p.current,U=(null==Q?void 0:Q.getBoundingClientRect().top)||0,W=Q?Q.scrollTop+J-U-150:0;return Q?void l(Q,W,200,G):void G()}var Y=F.getBoundingClientRect().top-k.getBoundingClientRect().top+k.scrollTop,Z=N.getBoundingClientRect().top-D.getBoundingClientRect().top+D.scrollTop,$=200;if("left"===y){var ee=Z-(Y-k.scrollTop);ee<0&&B.current&&(B.current.style.height="".concat(Math.abs(ee),"px")),requestAnimationFrame(function(){var e,n=D.scrollHeight-D.clientHeight;if(ee<0)e=0;else{if(ee>n){var t=ee-n;return C.current&&(C.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){l(D,ee,$,G)})}e=ee}l(D,e,$,G)})}else{var ne=Y-(Z-D.scrollTop);ne<0&&T.current&&(T.current.style.height="".concat(Math.abs(ne),"px")),requestAnimationFrame(function(){var e,n=k.scrollHeight-k.clientHeight;if(ne<0)e=0;else{if(ne>n){var t=ne-n;return b.current&&(b.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){l(k,ne,$,G)})}e=ne}l(k,e,$,G)})}}else G()}))))},[U,L,s,H,c,d,ie]);return r(function(){var e,n=N.sectionIdx,t=N.isOrphan;if(M(),null!=n){var r="left";N.anchorEl&&(null===(e=v.current)||void 0===e?void 0:e.contains(N.anchorEl))&&(r="right"),le(n,t,{sourceSide:r})}},[le,N.isOrphan,N.sectionIdx,N.anchorEl,M]),{isSideBySide:H,setIsSideBySide:P,isArrowVisible:z,setIsArrowVisible:V,isResizing:k,setIsResizing:D,isSideBySideLoading:J,setIsSideBySideLoading:K,activeSideBySideSection:U,setActiveSideBySideSection:W,scrollLock:X,sideBySideCacheRef:Y,isSideBySideRef:Z,activeSideBySideSectionRef:$,activeSideBySideRightSectionRef:_,sideBySideLineRef:ee,highlightedClauseRefs:ne,clearClauseHighlight:te,applyAlignmentPadding:re,resetSideBySide:ie,activateSideBySide:le}};export{o as useSideBySide};
|
|
2
2
|
//# sourceMappingURL=useSideBySide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,oBAAoB,+
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,oBAAoB,+CAgLzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSideBySide.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useSideBySide.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,aAAa,mfAavB,GAAG;;;;;;;;;;;;;sBAUgD,MAAM;0BAAoB,MAAM;iBAAW,MAAM;oBAAc,MAAM;cAAQ,MAAM;;;;;;;;mCAe/F,OAAO,OAAO,GAAG,kBAAkB,GAAG;;
|
|
1
|
+
{"version":3,"file":"useSideBySide.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CognitiveCompare/hooks/useSideBySide.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,aAAa,mfAavB,GAAG;;;;;;;;;;;;;sBAUgD,MAAM;0BAAoB,MAAM;iBAAW,MAAM;oBAAc,MAAM;cAAQ,MAAM;;;;;;;;mCAe/F,OAAO,OAAO,GAAG,kBAAkB,GAAG;;8BAwI/D,MAAM,GAAG,MAAM,YACV,OAAO;;yBACmC,IAAI;;;CA0PnE,CAAA"}
|