@viswa-test/test-citation 0.0.370 → 0.0.372
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/CitationAnchor.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js +2 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/cjs/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfStyle.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
- package/dist/features/CognitiveCompare/CognitivePopup.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/components/GuidelinePanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/components/WebGptPanel.js +1 -1
- package/dist/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js +2 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.js.map +1 -0
- package/dist/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useLinesCalculator.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +1 -1
- package/dist/features/GptWebCitation/utils/fixedHeight.utils.js +1 -1
- package/dist/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/features/PdfViewer/PdfStyle.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +12 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/GuidelinePanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/components/WebGptPanel.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.d.ts +3 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/hasGptCitationObjects.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts +14 -1
- package/dist/types/src/features/CognitiveCompare/Guidelines/utils/processGuidelinesMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useLinesCalculator.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +1 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +2 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/types.d.ts +11 -0
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts +2 -0
- package/dist/types/src/features/GptWebCitation/utils/fixedHeight.utils.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts +2 -4
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfStyle.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts +2 -18
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as t,useRef as e,useCallback as n,useEffect as i}from"react";import{DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";var c=function(c){var o=c.containerRef,l=c.leftContainerRef,u=c.rightContainerRef;c.svgContainerRef;var a=c.pathRefs,d=c.leftHeaderRef,s=c.rightHeaderRef,v=c.proposedSections,h=c.existingSections,g=c.visibleFields,f=c.leftRefs,p=c.rightRefs,b=c.sectionLeftRefs,y=c.sectionRightRefs,x=c.subSectionLeftRefs,m=c.subSectionRightRefs,R=c.lhsBadgeRefs,C=c.rhsBadgeRefs,A=c.sectionRowRefs,B=c.expandedSections,S=c.expandedSubSections,M=c.connectedSections,I=c.isSideBySide,T=c.activeSideBySideSection,L=c.maintainRelativeOrder,F=c.isGuidelineMode,H=c.cognitiveMap,w=c.getSectionCompareStyle,k=c.getSubSectionCompareStyle,E=c.getDeviationStyleByKey,N=c.isArrowVisible,Y=c.isAnimatingRef,D=c.isSideBySideRef,j=c.sideBySideCacheRef,O=c.sideBySideLineRef,z=c.activeSideBySideSectionRef,P=c.activeSideBySideRightSectionRef,Q=c.connectedLines,X=c.setConnectedLines,q=c.cachedConnectedPositions,G=c.calculateLinesRef,K=c.resizeTimerRef,V=c.scrollLock,J=c.scrollSyncLocked,U=c.handleResizeRef,W=c.activeProposed,Z=c.existingRule,$=c.analysisData,_=c.pendingScrollTargetRef,tt=c.pendingScrollCallbackRef,et=c.resolvedComparisonConfig,nt=c.getFieldData,it=t([]),rt=it[0],ct=it[1],ot=t(null),lt=ot[0],ut=ot[1],at=t([]),dt=at[0],st=at[1],vt=null!=Q?Q:dt,ht=null!=X?X:st,gt=t({width:0,height:0}),ft=gt[0],pt=gt[1],bt=e(!1),yt=e(!1),xt=e(!1),mt=e(null),Rt=e([]),Ct=null!=q?q:Rt,At=function(t,e,n,i,r,c,o){if(Math.abs(i-e)<=1)return c&&o?"M ".concat(t,",").concat(e," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r,",").concat(e):!c&&o?"M ".concat(r,",").concat(e," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i);var l=Math.min(15,Math.abs(r-t),Math.abs(i-e)/2),u=Math.min(15,Math.abs(n-r),Math.abs(i-e)/2),a=i>e?l:-l,d=i>e?u:-u,s=n>r?u:-u;return c&&o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i):!c&&o?"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i)},Bt=n(function(){var t,e,n,i,c,a,A,N,D,j,O,z,P,Q,X,q,G,K;if(!bt.current&&!Y.current){bt.current=!0;try{if(!o.current)return;var V=function(t){var e=t.split("-"),n=e[0];if(!B[n]&&!1===L)return!1;if(L&&!B["left-".concat(n)]&&!B["right-".concat(n)]&&!B[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!S[i])return!1;return!0},J=o.current.getBoundingClientRect();pt({width:J.width,height:J.height});var U=[];if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!Y.current){for(var W=0;W<Math.max(v.length,h.length);W++){var Z=null===(t=b.current[W])||void 0===t?void 0:t.current,$=null===(e=y.current[W])||void 0===e?void 0:e.current;Z&&(Z.style.height="auto",Z.style.minHeight="0px"),$&&($.style.height="auto",$.style.minHeight="0px")}L||Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var _={};g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=r.getBoundingClientRect(),l=c.getBoundingClientRect();_[i]=Math.max(o.height,l.height)}});var tt={left:{},right:{}},et={};if(!Y.current)if(L){if(I&&null!==T)if("number"==typeof T){var nt=T,it=v[nt],rt=null===(c=b.current[nt])||void 0===c?void 0:c.current;rt&&it&&(it.refIndexes||[]).forEach(function(t){var e,n=h.findIndex(function(e){return e.selfIndex===t}),i=null===(e=y.current[n])||void 0===e?void 0:e.current;if(i&&(B["left-".concat(nt)]||B["right-".concat(n)])){var r=Math.max(rt.getBoundingClientRect().height,i.getBoundingClientRect().height);tt.left[nt]=Math.max(tt.left[nt]||0,r),tt.right[n]=Math.max(tt.right[n]||0,r)}})}else{var ot=T.split(r)[2];if(ot){Z=null===(a=x.current[ot])||void 0===a?void 0:a.current,$=null===(A=m.current[ot])||void 0===A?void 0:A.current;if(Z&&$){lt=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);et[ot]=Math.max(et[ot]||0,lt)}}}}else{Object.keys(x.current).forEach(function(t){var e,n;if(V(t)){var i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),o=r.getBoundingClientRect(),l=Math.max(c.height,o.height);et[t]=l,i.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}});for(W=0;W<Math.min(v.length,h.length);W++){var Z=null===(n=b.current[W])||void 0===n?void 0:n.current,$=null===(i=y.current[W])||void 0===i?void 0:i.current;if(Z&&$){var lt=Math.max(Z.getBoundingClientRect().height,$.getBoundingClientRect().height);tt.left[W]=lt,tt.right[W]=lt}}}if(g.forEach(function(t){var e,n,i=t.key,r=null===(e=f.current[i])||void 0===e?void 0:e.current,c=null===(n=p.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=_[i];r.style.minHeight="".concat(o,"px"),c.style.minHeight="".concat(o,"px")}}),Y.current||(Object.entries(tt.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=b.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(tt.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=y.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),L||Object.keys(et).forEach(function(t){var e,n,i=null===(e=x.current[t])||void 0===e?void 0:e.current,r=null===(n=m.current[t])||void 0===n?void 0:n.current;if(i&&r&&et[t]){var c=et[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),!F){v.forEach(function(t,e){var n,i=t.continuationSourceRowId?v.findIndex(function(e){return e.comparisonRowId===t.continuationSourceRowId}):-1,r=i>=0?i:e,c=null===(n=b.current[r])||void 0===n?void 0:n.current;if(c){var o=function(t,e){if(!L)return h[e]?[e]:[];var n=(t.refIndexes||[]).map(function(t){return h.findIndex(function(e){return e.selfIndex===t})}).filter(function(t){return-1!==t});return!n.length&&h[e]?[e]:Array.from(new Set(n))}(t,e);o.forEach(function(t){var n,o,a,d,s,g,f,p,b,x,m,R,C=null===(n=y.current[t])||void 0===n?void 0:n.current;if(C){var A=c.getBoundingClientRect(),B=C.getBoundingClientRect(),S=A.right-J.left,M=B.left-J.left,F=A.top+18-J.top,k=B.top+18-J.top;if(L&&I&&T===e){var E=null!==(a=null===(o=l.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==a?a:0,N=null!==(s=null===(d=u.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,Y=E+(null!==(f=null===(g=l.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0),D=N+(null!==(b=null===(p=u.current)||void 0===p?void 0:p.clientHeight)&&void 0!==b?b:1/0),j=function(t,e,n){return Math.max(e,Math.min(n,t))};F=j(A.top+18,E,Y)-J.top,k=j(B.top+18,N,D)-J.top}var O=w(r);O&&U.push({id:"line-".concat(r,"-").concat(t),x1:S,y1:F,x2:M,y2:k,style:O,sectionIdx:r,targetRightIdx:t,isSubSection:!1,isMappingContinuation:i>=0,hasCognitive:!!((null===(x=v[r])||void 0===x?void 0:x.cognitiveData)||(null===(m=h[t])||void 0===m?void 0:m.cognitiveData)||(null===(R=v[r])||void 0===R?void 0:R.nodeId)&&H[v[r].nodeId])})}})}})}if(!F&&I&&"string"==typeof T&&T.includes(r)){var at=T.split(r),dt=at[0],st=at[1],vt=at[2],gt=(at[3],"".concat(dt).concat(r).concat(st)),ft=null===(N=R.current[gt])||void 0===N?void 0:N.current,yt=null===(D=C.current[gt])||void 0===D?void 0:D.current;if(ft&&yt){var xt=ft.getBoundingClientRect(),mt=yt.getBoundingClientRect(),Rt=xt.right-J.left,Bt=mt.left-J.left,Mt=xt.top+xt.height/2-J.top,It=mt.top+mt.height/2-J.top;if(L){var Tt=null!==(O=null===(j=l.current)||void 0===j?void 0:j.getBoundingClientRect().top)&&void 0!==O?O:0,Lt=null!==(P=null===(z=u.current)||void 0===z?void 0:z.getBoundingClientRect().top)&&void 0!==P?P:0,Ft=Tt+(null!==(X=null===(Q=l.current)||void 0===Q?void 0:Q.clientHeight)&&void 0!==X?X:1/0),Ht=Lt+(null!==(G=null===(q=u.current)||void 0===q?void 0:q.clientHeight)&&void 0!==G?G:1/0),wt=function(t,e,n){return Math.max(e,Math.min(n,t))};Mt=wt(xt.top+xt.height/2,Tt,Ft)-J.top,It=wt(mt.top+mt.height/2,Lt,Ht)-J.top}var kt=null!==(K=E(dt,st))&&void 0!==K?K:k(vt);kt&&U.push({id:"line-subsec-".concat(gt),x1:Rt,y1:Mt,x2:Bt,y2:It,style:kt,sectionIdx:Number(vt.split("-")[0]),isSubSection:!0,subSectionKeyPath:T})}}if(ct(U),d.current&&s.current){var Et=d.current.getBoundingClientRect(),Nt=s.current.getBoundingClientRect(),Yt=(Et.top+Et.height/2-J.top+Nt.top+Nt.height/2-J.top)/2;ut({x1:Et.right-J.left,x2:Nt.left-J.left,y:Yt})}else ut(null);if(M.size>0){var Dt=[],jt=l.current,Ot=u.current;if(jt&&Ot){var zt=[],Pt=jt.getBoundingClientRect().top,Qt=Ot.getBoundingClientRect().top,Xt=Pt+jt.clientHeight,qt=Qt+Ot.clientHeight,Gt=jt.scrollTop,Kt=Ot.scrollTop,Vt=J.top,Jt=function(t,e,n){return Math.max(e,Math.min(n,t))};M.forEach(function(t){var e,n,i,c,o,l,u,a,d;if(F){var s=null,g=null,f=null;if("string"==typeof t&&t.includes(r)){var p=t.split(r),b=p[0],y=p[1],x=p[2],m="".concat(b).concat(r).concat(y);s=null===(e=R.current[m])||void 0===e?void 0:e.current,f=null!==(n=E(b,y))&&void 0!==n?n:k(x),g=Number((null==x?void 0:x.split("-")[0])||0)}else g=Number(t),s=null===(i=R.current[g])||void 0===i?void 0:i.current,f=w(g);if(!s)return;var A=document.querySelectorAll('[id^="guideline-target-"]');A.forEach(function(e,n){var i=s.getBoundingClientRect(),c=e.getBoundingClientRect(),o=i.right-J.left,l=c.left-J.left-0,u=o+75,a=i.top+i.height/2,d=c.top+c.height/2,v=a-Pt+Gt,h=d-Qt+Kt,g="conn-guide-".concat(t,"-").concat(n),p="";"string"==typeof t&&t.includes(r)?p=(t.split(r)[2]||"").split("-").map(function(t){return Number(t)+1}).join("."):p=String(Number(t)+1);var b=String.fromCharCode(97+n),y=1===A.length?null:"".concat(p,"(").concat(b,")");zt.push({lhsScrollY:v,rhsScrollY:h,x1:o,x2:l,containerTop:Vt,leftIdx:t,rhsArrayIdx:n,styleColor:(null==f?void 0:f.badgeBorder)||"#6366F1",styleBg:(null==f?void 0:f.badgeBg)||"#FFFFFF",styleText:(null==f?void 0:f.badgeText)||"#A16207",styleId:g,centerX:u});var x=Jt(a,Pt,Xt),m=Jt(d,Qt,qt),R=x-Vt,C=m-Vt,B=At(o,R,l,C,u,a>=Pt-4&&a<=Xt+4,d>=Qt-4&&d<=qt+4);Dt.push({id:g,pathD:B,style:f,leftIdx:t,rhsArrayIdx:n,x1:o,x2:l,y1:R,y2:C,centerX:u,matchLabel:y,isGuideline:!0})})}else if("string"==typeof t&&t.includes(r)){var B=t.split(r),S=(b=B[0],y=B[1],x=B[2],B[3],m="".concat(b).concat(r).concat(y),null===(c=R.current[m])||void 0===c?void 0:c.current),M=null===(o=C.current[m])||void 0===o?void 0:o.current;if(!S||!M)return;var I=S.getBoundingClientRect(),T=M.getBoundingClientRect(),H=null!==(l=E(b,y))&&void 0!==l?l:k(x),N=I.right-J.left,Y=T.left-J.left-0,D=N+75,j=I.top+I.height/2,O=T.top+T.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-subsec-".concat(m),X=((x||"").split("-").map(function(t){return Number(t)+1}).join("."),null);zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:t,rhsArrayIdx:t,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:t,rhsArrayIdx:t,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}else if(L){var V=t,U=v[V];if(!(null===(d=null==U?void 0:U.refIndexes)||void 0===d?void 0:d.length))return;U.refIndexes.forEach(function(e,n){var i,r,c=h.findIndex(function(t){return t.selfIndex===e});if(-1!==c){var o=null===(i=R.current[V])||void 0===i?void 0:i.current,l=null===(r=C.current[c])||void 0===r?void 0:r.current;if(o&&l){var u=o.getBoundingClientRect(),a=l.getBoundingClientRect(),d=w(V),s=u.right-J.left,v=a.left-J.left-0,g=s+75,f=u.top+u.height/2,p=a.top+a.height/2,b=f-Pt+Gt,y=p-Qt+Kt,x="conn-".concat(V,"-").concat(c),m=String(Number(t)+1),A=String.fromCharCode(97+n),B=1===U.refIndexes.length?null:"".concat(m,"(").concat(A,")");zt.push({lhsScrollY:b,rhsScrollY:y,x1:s,x2:v,containerTop:Vt,leftIdx:V,rhsArrayIdx:c,styleColor:(null==d?void 0:d.badgeBorder)||"#6366F1",styleBg:(null==d?void 0:d.badgeBg)||"#FFFFFF",styleText:(null==d?void 0:d.badgeText)||"#A16207",styleId:x,centerX:g});var S=Jt(f,Pt,Xt),M=Jt(p,Qt,qt),I=S-Vt,T=M-Vt,L=At(s,I,v,T,g,f>=Pt-4&&f<=Xt+4,p>=Qt-4&&p<=qt+4);Dt.push({id:x,pathD:L,style:d,leftIdx:V,rhsArrayIdx:c,x1:s,x2:v,y1:I,y2:T,matchLabel:B})}}})}else{var W=t,Z=W;S=null===(u=R.current[W])||void 0===u?void 0:u.current,M=null===(a=C.current[Z])||void 0===a?void 0:a.current;if(!S||!M)return;I=S.getBoundingClientRect(),T=M.getBoundingClientRect(),H=w(W),N=I.right-J.left,Y=T.left-J.left-0,D=N+75,j=I.top+I.height/2,O=T.top+T.height/2,z=j-Pt+Gt,P=O-Qt+Kt,Q="conn-".concat(W,"-").concat(Z),String(Number(t)+1),X=null;zt.push({lhsScrollY:z,rhsScrollY:P,x1:N,x2:Y,containerTop:Vt,leftIdx:W,rhsArrayIdx:Z,styleColor:(null==H?void 0:H.badgeBorder)||"#6366F1",styleBg:(null==H?void 0:H.badgeBg)||"#FFFFFF",styleText:(null==H?void 0:H.badgeText)||"#A16207",styleId:Q,centerX:D});var $,_;q=Jt(j,Pt,Xt),G=Jt(O,Qt,qt),K=At(N,$=q-Vt,Y,_=G-Vt,D,j>=Pt-4&&j<=Xt+4,O>=Qt-4&&O<=qt+4);Dt.push({id:Q,pathD:K,style:H,leftIdx:W,rhsArrayIdx:Z,x1:N,x2:Y,y1:$,y2:_,matchLabel:X})}}),Ct.current=zt}ht(Dt),setTimeout(function(){return St()},10)}else ht([]),Ct.current=[],setTimeout(function(){return St()},10)}catch(t){console.error("Line render safe fail: ",t)}finally{bt.current=!1}}},[g,v,h,H,et,nt,w,E,L,I,T,M,B,S,F]),St=n(function(){var t,e,n,i,r,c,d,s,v,h,g,f,p,b,y,x,m,R,C,A=Ct.current;if(!A.length)return null===(t=a.current["guideline-up-stroke"])||void 0===t||t.setAttribute("visibility","hidden"),null===(e=a.current["guideline-up-badge"])||void 0===e||e.setAttribute("visibility","hidden"),null===(n=a.current["guideline-down-stroke"])||void 0===n||n.setAttribute("visibility","hidden"),void(null===(i=a.current["guideline-down-badge"])||void 0===i||i.setAttribute("visibility","hidden"));if(!Y.current){var B=null!==(c=null===(r=l.current)||void 0===r?void 0:r.scrollTop)&&void 0!==c?c:0,S=null!==(s=null===(d=u.current)||void 0===d?void 0:d.scrollTop)&&void 0!==s?s:0,M=null!==(h=null===(v=l.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0,I=null!==(f=null===(g=u.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0,T=null!==(b=null===(p=l.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==b?b:0,L=null!==(x=null===(y=u.current)||void 0===y?void 0:y.getBoundingClientRect().top)&&void 0!==x?x:0,F=T+M,H=L+I,w=null===(m=o.current)||void 0===m?void 0:m.getBoundingClientRect(),k=null!==(R=null==w?void 0:w.top)&&void 0!==R?R:0,E=null!==(C=null==w?void 0:w.height)&&void 0!==C?C:1/0,N=function(t,e,n){return Math.max(e,Math.min(n,t))},D=0,j=0,O=0,z=0,P="#6366F1",Q="#A16207",X=!1,q=0;if(A.forEach(function(t){var e=t.lhsScrollY-B+T,n=t.rhsScrollY-S+L,i=a.current[t.styleId+"-stroke"],r=a.current[t.styleId+"-bg"],c=a.current[t.styleId+"-btn"],o=a.current[t.styleId+"-number"];if(i||r){var l=N(e,T,F),u=N(n,L,H),d=l-k,s=u-k,v=e>=T-4&&e<=F+4,h=n>=L-4&&n<=H+4,g=!0;X=!0;var f=t.centerX||t.x1+75;0===O&&(O=t.x1,z=d,q=f,P=t.styleColor,t.styleBg,Q=t.styleText||"#A16207"),n<L-4?(D++,g=!1):n>H+4&&(j++,g=!1);var p=At(t.x1,d,t.x2,s,q,v,h);i&&(g&&p?(i.setAttribute("visibility","visible"),i.setAttribute("d",p)):i.setAttribute("visibility","hidden")),r&&(g&&p?(r.setAttribute("visibility","visible"),r.setAttribute("d",p)):r.setAttribute("visibility","hidden")),c&&(v&&g?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(d-12))):c.setAttribute("visibility","hidden")),o&&(v&&g?(o.setAttribute("visibility","visible"),o.setAttribute("transform","translate(".concat(t.x2-42,", ").concat(s,")"))):o.setAttribute("visibility","hidden"))}}),X&&q>0){var G=a.current["guideline-up-stroke"],K=a.current["guideline-up-badge"],V=a.current["guideline-up-arrow"],J=a.current["guideline-up-text"],U=a.current["guideline-up-badge-rect"];if(D>0){var W=Math.max(15,L-k+15),Z=Math.min(15,Math.abs(q-O),Math.max(0,z-W)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z-Z," L ").concat(q,",").concat(W);null==G||G.setAttribute("visibility","visible"),null==G||G.setAttribute("d",$),null==G||G.setAttribute("stroke",P),null==K||K.setAttribute("visibility","visible"),null==K||K.setAttribute("transform","translate(".concat(q,", ").concat(W,")")),V&&V.setAttribute("fill",P),J&&(J.textContent="+".concat(D),J.setAttribute("fill",Q)),U&&U.setAttribute("stroke",P)}else null==G||G.setAttribute("visibility","hidden"),null==K||K.setAttribute("visibility","hidden");var _=a.current["guideline-down-stroke"],tt=a.current["guideline-down-badge"],et=a.current["guideline-down-arrow"],nt=a.current["guideline-down-text"],it=a.current["guideline-down-badge-rect"];if(j>0){var rt=Math.min(E-15,H-k-15);Z=Math.min(15,Math.abs(q-O),Math.max(0,rt-z)),$="M ".concat(O,",").concat(z," L ").concat(q-Z,",").concat(z," Q ").concat(q,",").concat(z," ").concat(q,",").concat(z+Z," L ").concat(q,",").concat(rt);null==_||_.setAttribute("visibility","visible"),null==_||_.setAttribute("d",$),null==_||_.setAttribute("stroke",P),null==tt||tt.setAttribute("visibility","visible"),null==tt||tt.setAttribute("transform","translate(".concat(q,", ").concat(rt,")")),et&&et.setAttribute("fill",P),nt&&(nt.textContent="+".concat(j),nt.setAttribute("fill",Q)),it&&it.setAttribute("stroke",P)}else null==_||_.setAttribute("visibility","hidden"),null==tt||tt.setAttribute("visibility","hidden")}}},[]),Mt=n(function(){Ct.current.length>0&&!Y.current||(null!==mt.current&&clearTimeout(mt.current),mt.current=setTimeout(function(){G.current(),mt.current=null},50))},[]),It=n(function(t){if(null!==_.current&&tt.current&&Math.abs(t.currentTarget.scrollTop-_.current)<=2){var e=tt.current;_.current=null,tt.current=null,e()}if(!xt.current&&!V.current){if(L&&J&&(D.current||M.size>0)){var n=t.currentTarget,i=l.current,c=u.current,a=n===i?c:n===c?i:null;if(n&&a){var d=function(){var t,e,n,i,c,o,l,u,a,d,s,v=z.current,h=P.current;if(null===v)return{leftAnchor:null,rightAnchor:null};if("string"==typeof v&&v.includes(r)){var g=v.split(r),f="".concat(g[0]).concat(r).concat(g[1]);return{leftAnchor:(null===(t=R.current[f])||void 0===t?void 0:t.current)||(null===(e=x.current[g[2]])||void 0===e?void 0:e.current)||(null===(n=b.current[Number(g[2])])||void 0===n?void 0:n.current)||null,rightAnchor:(null===(i=C.current[f])||void 0===i?void 0:i.current)||(null===(c=m.current[g[3]])||void 0===c?void 0:c.current)||(null===(o=y.current[Number(g[3])])||void 0===o?void 0:o.current)||null}}var p=Number(v),B=null!==h?Number(h):p;return{leftAnchor:(null===(l=R.current[p])||void 0===l?void 0:l.current)||(null===(u=A.current[p])||void 0===u?void 0:u.current)||(null===(a=b.current[p])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=C.current[B])||void 0===d?void 0:d.current)||(null===(s=y.current[B])||void 0===s?void 0:s.current)||null}}(),s=d.leftAnchor,v=d.rightAnchor,h=n===i?s:v,g=n===i?v:s,f=null;if(h&&g){var p=h.getBoundingClientRect(),B=g.getBoundingClientRect(),S=a.getBoundingClientRect(),I=p.top+p.height/2;f=B.top-S.top+a.scrollTop+B.height/2-(I-S.top)}else{var T=Math.max(0,n.scrollHeight-n.clientHeight),F=Math.max(0,a.scrollHeight-a.clientHeight);f=T>0?n.scrollTop/T*F:n.scrollTop}var H=Math.max(0,a.scrollHeight-a.clientHeight);f=Math.max(0,Math.min(f,H)),Math.abs(a.scrollTop-f)>1&&(xt.current=!0,a.scrollTop=f,requestAnimationFrame(function(){xt.current=!1}))}}L||Mt(),yt.current||(yt.current=!0,requestAnimationFrame(function(){var t,e,n,i,c,a,d;if(D.current){var s=l.current,v=u.current;if(s&&v&&O.current){if(!j.current){var h=z.current,g=void 0;if("string"==typeof h&&h.includes(r)){var f=h.split(r),p="".concat(f[0]).concat(r).concat(f[1]);g=null===(t=R.current[p])||void 0===t?void 0:t.current}else g=null===(e=R.current[h])||void 0===e?void 0:e.current;if(g){var b=g.getBoundingClientRect();j.current={badgeScreenY:b.top+b.height/2,initialScrollTop:s.scrollTop,leftTop:s.getBoundingClientRect().top,leftBottom:s.getBoundingClientRect().top+s.clientHeight,cTop:null!==(i=null===(n=o.current)||void 0===n?void 0:n.getBoundingClientRect().top)&&void 0!==i?i:0}}}if(j.current){var y=j.current,x=s.scrollTop-y.initialScrollTop,m=y.badgeScreenY-x,C=((c=m,a=y.leftTop,d=y.leftBottom,Math.max(a,Math.min(d,c)))-y.cTop).toString(),A=m>=y.leftTop-4&&m<=y.leftBottom+4;O.current.setAttribute("y1",C),O.current.setAttribute("y2",C),O.current.setAttribute("visibility",A?"visible":"hidden")}}}St(),yt.current=!1}))}},[St,L,J,M,Mt]);return i(function(){G.current=Bt},[Bt]),i(function(){var t=setTimeout(Mt,250),e=function(){return U.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==mt.current&&clearTimeout(mt.current),null!==K.current&&clearTimeout(K.current),window.removeEventListener("resize",e)}},[W,Z,$,g,B,S,v,h,et,Mt,I,T,N,M]),{lines:rt,setLines:ct,overallConnector:lt,setOverallConnector:ut,connectedLines:vt,setConnectedLines:ht,svgDimensions:ft,cachedConnectedPositions:Ct,calculateLines:Bt,calculateLinesRef:G,calculateLinesDebounced:Mt,handleColumnScroll:It}};export{c as useLinesCalculator};
|
|
1
|
+
import{useState as t,useRef as e,useCallback as n,useEffect as i}from"react";import{DEVIATION_BADGE_SEPARATOR as r}from"../CognitiveComparehelpers.js";import{getVisibleGuidelineTargets as c}from"../Guidelines/utils/guidelineTargets.js";var o=function(o){var l=o.containerRef,u=o.leftContainerRef,a=o.rightContainerRef;o.svgContainerRef;var d=o.pathRefs,s=o.leftHeaderRef,v=o.rightHeaderRef,h=o.proposedSections,g=o.existingSections,f=o.visibleFields,p=o.leftRefs,b=o.rightRefs,y=o.sectionLeftRefs,x=o.sectionRightRefs,m=o.subSectionLeftRefs,R=o.subSectionRightRefs,C=o.lhsBadgeRefs,B=o.rhsBadgeRefs,A=o.sectionRowRefs,S=o.expandedSections,M=o.expandedSubSections,T=o.connectedSections,I=o.isSideBySide,L=o.activeSideBySideSection,F=o.maintainRelativeOrder,H=o.isGuidelineMode,w=o.cognitiveMap,k=o.getSectionCompareStyle,E=o.getSubSectionCompareStyle,N=o.getDeviationStyleByKey,Y=o.isArrowVisible,D=o.isAnimatingRef,j=o.isSideBySideRef,O=o.sideBySideCacheRef,z=o.sideBySideLineRef,P=o.activeSideBySideSectionRef,Q=o.activeSideBySideRightSectionRef,X=o.connectedLines,G=o.setConnectedLines,q=o.cachedConnectedPositions,K=o.calculateLinesRef,V=o.resizeTimerRef,J=o.scrollLock,U=o.scrollSyncLocked,W=o.handleResizeRef,Z=o.activeProposed,$=o.existingRule,_=o.analysisData,tt=o.pendingScrollTargetRef,et=o.pendingScrollCallbackRef,nt=o.resolvedComparisonConfig,it=o.getFieldData,rt=t([]),ct=rt[0],ot=rt[1],lt=t(null),ut=lt[0],at=lt[1],dt=t([]),st=dt[0],vt=dt[1],ht=null!=X?X:st,gt=null!=G?G:vt,ft=t({width:0,height:0}),pt=ft[0],bt=ft[1],yt=e(!1),xt=e(!1),mt=e(!1),Rt=e(null),Ct=e([]),Bt=null!=q?q:Ct,At=function(t,e,n,i,r,c,o){if(Math.abs(i-e)<=1)return c&&o?"M ".concat(t,",").concat(e," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r,",").concat(e):!c&&o?"M ".concat(r,",").concat(e," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i);var l=Math.min(15,Math.abs(r-t),Math.abs(i-e)/2),u=Math.min(15,Math.abs(n-r),Math.abs(i-e)/2),a=i>e?l:-l,d=i>e?u:-u,s=n>r?u:-u;return c&&o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):c&&!o?"M ".concat(t,",").concat(e," L ").concat(r-l,",").concat(e," Q ").concat(r,",").concat(e," ").concat(r,",").concat(e+a," L ").concat(r,",").concat(i):!c&&o?"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i-d," Q ").concat(r,",").concat(i," ").concat(r+s,",").concat(i," L ").concat(n,",").concat(i):"M ".concat(r,",").concat(e," L ").concat(r,",").concat(i)},St=n(function(){var t,e,n,i,o,d,A,Y,j,O,z,P,Q,X,G,q,K,V;if(!yt.current&&!D.current){yt.current=!0;try{if(!l.current)return;var J=function(t){var e=t.split("-"),n=e[0];if(!S[n]&&!1===F)return!1;if(F&&!S["left-".concat(n)]&&!S["right-".concat(n)]&&!S[n])return!1;for(var i=n,r=1;r<e.length-1;r++)if(i+="-".concat(e[r]),!M[i])return!1;return!0},U=l.current.getBoundingClientRect();bt({width:U.width,height:U.height});var W=[];if(f.forEach(function(t){var e,n,i=t.key,r=null===(e=p.current[i])||void 0===e?void 0:e.current,c=null===(n=b.current[i])||void 0===n?void 0:n.current;r&&c&&(r.style.height="auto",c.style.height="auto",r.style.minHeight="0px",c.style.minHeight="0px")}),!D.current){for(var Z=0;Z<Math.max(h.length,g.length);Z++){var $=null===(t=y.current[Z])||void 0===t?void 0:t.current,_=null===(e=x.current[Z])||void 0===e?void 0:e.current;$&&($.style.height="auto",$.style.minHeight="0px"),_&&(_.style.height="auto",_.style.minHeight="0px")}F||Object.keys(m.current).forEach(function(t){var e,n;if(J(t)){var i=null===(e=m.current[t])||void 0===e?void 0:e.current,r=null===(n=R.current[t])||void 0===n?void 0:n.current;i&&r&&(i.style.height="auto",r.style.height="auto",i.style.minHeight="0px",r.style.minHeight="0px")}})}var tt={};f.forEach(function(t){var e,n,i=t.key,r=null===(e=p.current[i])||void 0===e?void 0:e.current,c=null===(n=b.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=r.getBoundingClientRect(),l=c.getBoundingClientRect();tt[i]=Math.max(o.height,l.height)}});var et={left:{},right:{}},nt={};if(!D.current)if(F){if(I&&null!==L)if("number"==typeof L){var it=L,rt=h[it],ct=null===(o=y.current[it])||void 0===o?void 0:o.current;ct&&rt&&(rt.refIndexes||[]).forEach(function(t){var e,n=g.findIndex(function(e){return e.selfIndex===t}),i=null===(e=x.current[n])||void 0===e?void 0:e.current;if(i&&(S["left-".concat(it)]||S["right-".concat(n)])){var r=Math.max(ct.getBoundingClientRect().height,i.getBoundingClientRect().height);et.left[it]=Math.max(et.left[it]||0,r),et.right[n]=Math.max(et.right[n]||0,r)}})}else{var lt=L.split(r)[2];if(lt){$=null===(d=m.current[lt])||void 0===d?void 0:d.current,_=null===(A=R.current[lt])||void 0===A?void 0:A.current;if($&&_){ut=Math.max($.getBoundingClientRect().height,_.getBoundingClientRect().height);nt[lt]=Math.max(nt[lt]||0,ut)}}}}else{Object.keys(m.current).forEach(function(t){var e,n;if(J(t)){var i=null===(e=m.current[t])||void 0===e?void 0:e.current,r=null===(n=R.current[t])||void 0===n?void 0:n.current;if(i&&r&&null!==i.offsetParent&&null!==r.offsetParent){var c=i.getBoundingClientRect(),o=r.getBoundingClientRect(),l=Math.max(c.height,o.height);nt[t]=l,i.style.minHeight="".concat(l,"px"),r.style.minHeight="".concat(l,"px")}}});for(Z=0;Z<Math.min(h.length,g.length);Z++){var $=null===(n=y.current[Z])||void 0===n?void 0:n.current,_=null===(i=x.current[Z])||void 0===i?void 0:i.current;if($&&_){var ut=Math.max($.getBoundingClientRect().height,_.getBoundingClientRect().height);et.left[Z]=ut,et.right[Z]=ut}}}if(f.forEach(function(t){var e,n,i=t.key,r=null===(e=p.current[i])||void 0===e?void 0:e.current,c=null===(n=b.current[i])||void 0===n?void 0:n.current;if(r&&c){var o=tt[i];r.style.minHeight="".concat(o,"px"),c.style.minHeight="".concat(o,"px")}}),D.current||(Object.entries(et.left).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=y.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),Object.entries(et.right).forEach(function(t){var e,n=t[0],i=t[1],r=null===(e=x.current[Number(n)])||void 0===e?void 0:e.current;r&&(r.style.minHeight="".concat(i,"px"))}),F||Object.keys(nt).forEach(function(t){var e,n,i=null===(e=m.current[t])||void 0===e?void 0:e.current,r=null===(n=R.current[t])||void 0===n?void 0:n.current;if(i&&r&&nt[t]){var c=nt[t];i.style.minHeight="".concat(c,"px"),r.style.minHeight="".concat(c,"px")}})),!H){h.forEach(function(t,e){var n,i=t.continuationSourceRowId?h.findIndex(function(e){return e.comparisonRowId===t.continuationSourceRowId}):-1,r=i>=0?i:e,c=null===(n=y.current[r])||void 0===n?void 0:n.current;if(c){var o=function(t,e){if(!F)return g[e]?[e]:[];var n=(t.refIndexes||[]).map(function(t){return g.findIndex(function(e){return e.selfIndex===t})}).filter(function(t){return-1!==t});return!n.length&&g[e]?[e]:Array.from(new Set(n))}(t,e);o.forEach(function(t){var n,o,l,d,s,v,f,p,b,y,m,R,C=null===(n=x.current[t])||void 0===n?void 0:n.current;if(C){var B=c.getBoundingClientRect(),A=C.getBoundingClientRect(),S=B.right-U.left,M=A.left-U.left,T=B.top+18-U.top,H=A.top+18-U.top;if(F&&I&&L===e){var E=null!==(l=null===(o=u.current)||void 0===o?void 0:o.getBoundingClientRect().top)&&void 0!==l?l:0,N=null!==(s=null===(d=a.current)||void 0===d?void 0:d.getBoundingClientRect().top)&&void 0!==s?s:0,Y=E+(null!==(f=null===(v=u.current)||void 0===v?void 0:v.clientHeight)&&void 0!==f?f:1/0),D=N+(null!==(b=null===(p=a.current)||void 0===p?void 0:p.clientHeight)&&void 0!==b?b:1/0),j=function(t,e,n){return Math.max(e,Math.min(n,t))};T=j(B.top+18,E,Y)-U.top,H=j(A.top+18,N,D)-U.top}var O=k(r);O&&W.push({id:"line-".concat(r,"-").concat(t),x1:S,y1:T,x2:M,y2:H,style:O,sectionIdx:r,targetRightIdx:t,isSubSection:!1,isMappingContinuation:i>=0,hasCognitive:!!((null===(y=h[r])||void 0===y?void 0:y.cognitiveData)||(null===(m=g[t])||void 0===m?void 0:m.cognitiveData)||(null===(R=h[r])||void 0===R?void 0:R.nodeId)&&w[h[r].nodeId])})}})}})}if(!H&&I&&"string"==typeof L&&L.includes(r)){var dt=L.split(r),st=dt[0],vt=dt[1],ht=dt[2],ft=(dt[3],"".concat(st).concat(r).concat(vt)),pt=null===(Y=C.current[ft])||void 0===Y?void 0:Y.current,xt=null===(j=B.current[ft])||void 0===j?void 0:j.current;if(pt&&xt){var mt=pt.getBoundingClientRect(),Rt=xt.getBoundingClientRect(),Ct=mt.right-U.left,St=Rt.left-U.left,Tt=mt.top+mt.height/2-U.top,It=Rt.top+Rt.height/2-U.top;if(F){var Lt=null!==(z=null===(O=u.current)||void 0===O?void 0:O.getBoundingClientRect().top)&&void 0!==z?z:0,Ft=null!==(Q=null===(P=a.current)||void 0===P?void 0:P.getBoundingClientRect().top)&&void 0!==Q?Q:0,Ht=Lt+(null!==(G=null===(X=u.current)||void 0===X?void 0:X.clientHeight)&&void 0!==G?G:1/0),wt=Ft+(null!==(K=null===(q=a.current)||void 0===q?void 0:q.clientHeight)&&void 0!==K?K:1/0),kt=function(t,e,n){return Math.max(e,Math.min(n,t))};Tt=kt(mt.top+mt.height/2,Lt,Ht)-U.top,It=kt(Rt.top+Rt.height/2,Ft,wt)-U.top}var Et=null!==(V=N(st,vt))&&void 0!==V?V:E(ht);Et&&W.push({id:"line-subsec-".concat(ft),x1:Ct,y1:Tt,x2:St,y2:It,style:Et,sectionIdx:Number(ht.split("-")[0]),isSubSection:!0,subSectionKeyPath:L})}}if(ot(W),s.current&&v.current){var Nt=s.current.getBoundingClientRect(),Yt=v.current.getBoundingClientRect(),Dt=(Nt.top+Nt.height/2-U.top+Yt.top+Yt.height/2-U.top)/2;at({x1:Nt.right-U.left,x2:Yt.left-U.left,y:Dt})}else at(null);if(T.size>0){var jt=[],Ot=u.current,zt=a.current;if(Ot&&zt){var Pt=[],Qt=Ot.getBoundingClientRect().top,Xt=zt.getBoundingClientRect().top,Gt=Qt+Ot.clientHeight,qt=Xt+zt.clientHeight,Kt=Ot.scrollTop,Vt=zt.scrollTop,Jt=U.top,Ut=function(t,e,n){return Math.max(e,Math.min(n,t))};T.forEach(function(t){var e,n,i,o,l,u,a,d,s;if(H){var v=null,f=null,p=null;if("string"==typeof t&&t.includes(r)){var b=t.split(r),y=b[0],x=b[1],m=b[2],R="".concat(y).concat(r).concat(x);v=null===(e=C.current[R])||void 0===e?void 0:e.current,p=null!==(n=N(y,x))&&void 0!==n?n:E(m),f=Number((null==m?void 0:m.split("-")[0])||0)}else f=Number(t),v=null===(i=C.current[f])||void 0===i?void 0:i.current,p=k(f);if(!v)return;var A=c(zt);A.forEach(function(e,n){var i=v.getBoundingClientRect(),c=e.getBoundingClientRect(),o=i.right-U.left,l=c.left-U.left-0,u=o+75,a=i.top+i.height/2,d=c.top+c.height/2,s=a-Qt+Kt,h=d-Xt+Vt,g="conn-guide-".concat(t,"-").concat(n),f="";"string"==typeof t&&t.includes(r)?f=(t.split(r)[2]||"").split("-").map(function(t){return Number(t)+1}).join("."):f=String(Number(t)+1);var b=String.fromCharCode(97+n),y=1===A.length?null:"".concat(f,"(").concat(b,")");Pt.push({lhsScrollY:s,rhsScrollY:h,x1:o,x2:l,containerTop:Jt,leftIdx:t,rhsArrayIdx:n,styleColor:(null==p?void 0:p.badgeBorder)||"#6366F1",styleBg:(null==p?void 0:p.badgeBg)||"#FFFFFF",styleText:(null==p?void 0:p.badgeText)||"#A16207",styleId:g,centerX:u});var x=Ut(a,Qt,Gt),m=Ut(d,Xt,qt),R=x-Jt,C=m-Jt,B=At(o,R,l,C,u,a>=Qt-4&&a<=Gt+4,d>=Xt-4&&d<=qt+4);jt.push({id:g,pathD:B,style:p,leftIdx:t,rhsArrayIdx:n,x1:o,x2:l,y1:R,y2:C,centerX:u,matchLabel:y,isGuideline:!0})})}else if("string"==typeof t&&t.includes(r)){var S=t.split(r),M=(y=S[0],x=S[1],m=S[2],S[3],R="".concat(y).concat(r).concat(x),null===(o=C.current[R])||void 0===o?void 0:o.current),T=null===(l=B.current[R])||void 0===l?void 0:l.current;if(!M||!T)return;var I=M.getBoundingClientRect(),L=T.getBoundingClientRect(),w=null!==(u=N(y,x))&&void 0!==u?u:E(m),Y=I.right-U.left,D=L.left-U.left-0,j=Y+75,O=I.top+I.height/2,z=L.top+L.height/2,P=O-Qt+Kt,Q=z-Xt+Vt,X="conn-subsec-".concat(R),G=((m||"").split("-").map(function(t){return Number(t)+1}).join("."),null);Pt.push({lhsScrollY:P,rhsScrollY:Q,x1:Y,x2:D,containerTop:Jt,leftIdx:t,rhsArrayIdx:t,styleColor:(null==w?void 0:w.badgeBorder)||"#6366F1",styleBg:(null==w?void 0:w.badgeBg)||"#FFFFFF",styleText:(null==w?void 0:w.badgeText)||"#A16207",styleId:X,centerX:j});var q=Ut(O,Qt,Gt),K=Ut(z,Xt,qt),V=At(Y,_=q-Jt,D,tt=K-Jt,j,O>=Qt-4&&O<=Gt+4,z>=Xt-4&&z<=qt+4);jt.push({id:X,pathD:V,style:w,leftIdx:t,rhsArrayIdx:t,x1:Y,x2:D,y1:_,y2:tt,matchLabel:G})}else if(F){var J=t,W=h[J];if(!(null===(s=null==W?void 0:W.refIndexes)||void 0===s?void 0:s.length))return;W.refIndexes.forEach(function(e,n){var i,r,c=g.findIndex(function(t){return t.selfIndex===e});if(-1!==c){var o=null===(i=C.current[J])||void 0===i?void 0:i.current,l=null===(r=B.current[c])||void 0===r?void 0:r.current;if(o&&l){var u=o.getBoundingClientRect(),a=l.getBoundingClientRect(),d=k(J),s=u.right-U.left,v=a.left-U.left-0,h=s+75,f=u.top+u.height/2,p=a.top+a.height/2,b=f-Qt+Kt,y=p-Xt+Vt,x="conn-".concat(J,"-").concat(c),m=String(Number(t)+1),R=String.fromCharCode(97+n),A=1===W.refIndexes.length?null:"".concat(m,"(").concat(R,")");Pt.push({lhsScrollY:b,rhsScrollY:y,x1:s,x2:v,containerTop:Jt,leftIdx:J,rhsArrayIdx:c,styleColor:(null==d?void 0:d.badgeBorder)||"#6366F1",styleBg:(null==d?void 0:d.badgeBg)||"#FFFFFF",styleText:(null==d?void 0:d.badgeText)||"#A16207",styleId:x,centerX:h});var S=Ut(f,Qt,Gt),M=Ut(p,Xt,qt),T=S-Jt,I=M-Jt,L=At(s,T,v,I,h,f>=Qt-4&&f<=Gt+4,p>=Xt-4&&p<=qt+4);jt.push({id:x,pathD:L,style:d,leftIdx:J,rhsArrayIdx:c,x1:s,x2:v,y1:T,y2:I,matchLabel:A})}}})}else{var Z=t,$=Z;M=null===(a=C.current[Z])||void 0===a?void 0:a.current,T=null===(d=B.current[$])||void 0===d?void 0:d.current;if(!M||!T)return;I=M.getBoundingClientRect(),L=T.getBoundingClientRect(),w=k(Z),Y=I.right-U.left,D=L.left-U.left-0,j=Y+75,O=I.top+I.height/2,z=L.top+L.height/2,P=O-Qt+Kt,Q=z-Xt+Vt,X="conn-".concat(Z,"-").concat($),String(Number(t)+1),G=null;Pt.push({lhsScrollY:P,rhsScrollY:Q,x1:Y,x2:D,containerTop:Jt,leftIdx:Z,rhsArrayIdx:$,styleColor:(null==w?void 0:w.badgeBorder)||"#6366F1",styleBg:(null==w?void 0:w.badgeBg)||"#FFFFFF",styleText:(null==w?void 0:w.badgeText)||"#A16207",styleId:X,centerX:j});var _,tt;q=Ut(O,Qt,Gt),K=Ut(z,Xt,qt),V=At(Y,_=q-Jt,D,tt=K-Jt,j,O>=Qt-4&&O<=Gt+4,z>=Xt-4&&z<=qt+4);jt.push({id:X,pathD:V,style:w,leftIdx:Z,rhsArrayIdx:$,x1:Y,x2:D,y1:_,y2:tt,matchLabel:G})}}),Bt.current=Pt}gt(jt),setTimeout(function(){return Mt()},10)}else gt([]),Bt.current=[],setTimeout(function(){return Mt()},10)}catch(t){console.error("Line render safe fail: ",t)}finally{yt.current=!1}}},[f,h,g,w,nt,it,k,N,F,I,L,T,S,M,H]),Mt=n(function(){var t,e,n,i,r,c,o,s,v,h,g,f,p,b,y,x,m,R,C,B=Bt.current;if(!B.length)return null===(t=d.current["guideline-up-stroke"])||void 0===t||t.setAttribute("visibility","hidden"),null===(e=d.current["guideline-up-badge"])||void 0===e||e.setAttribute("visibility","hidden"),null===(n=d.current["guideline-down-stroke"])||void 0===n||n.setAttribute("visibility","hidden"),void(null===(i=d.current["guideline-down-badge"])||void 0===i||i.setAttribute("visibility","hidden"));if(!D.current){var A=null!==(c=null===(r=u.current)||void 0===r?void 0:r.scrollTop)&&void 0!==c?c:0,S=null!==(s=null===(o=a.current)||void 0===o?void 0:o.scrollTop)&&void 0!==s?s:0,M=null!==(h=null===(v=u.current)||void 0===v?void 0:v.clientHeight)&&void 0!==h?h:1/0,T=null!==(f=null===(g=a.current)||void 0===g?void 0:g.clientHeight)&&void 0!==f?f:1/0,I=null!==(b=null===(p=u.current)||void 0===p?void 0:p.getBoundingClientRect().top)&&void 0!==b?b:0,L=null!==(x=null===(y=a.current)||void 0===y?void 0:y.getBoundingClientRect().top)&&void 0!==x?x:0,F=I+M,H=L+T,w=null===(m=l.current)||void 0===m?void 0:m.getBoundingClientRect(),k=null!==(R=null==w?void 0:w.top)&&void 0!==R?R:0,E=null!==(C=null==w?void 0:w.height)&&void 0!==C?C:1/0,N=function(t,e,n){return Math.max(e,Math.min(n,t))},Y=0,j=0,O=0,z=0,P="#6366F1",Q="#A16207",X=!1,G=0;if(B.forEach(function(t){var e=t.lhsScrollY-A+I,n=t.rhsScrollY-S+L,i=d.current[t.styleId+"-stroke"],r=d.current[t.styleId+"-bg"],c=d.current[t.styleId+"-btn"],o=d.current[t.styleId+"-number"];if(i||r){var l=N(e,I,F),u=N(n,L,H),a=l-k,s=u-k,v=e>=I-4&&e<=F+4,h=n>=L-4&&n<=H+4,g=!0;X=!0;var f=t.centerX||t.x1+75;0===O&&(O=t.x1,z=a,G=f,P=t.styleColor,t.styleBg,Q=t.styleText||"#A16207"),n<L-4?(Y++,g=!1):n>H+4&&(j++,g=!1);var p=At(t.x1,a,t.x2,s,G,v,h);i&&(g&&p?(i.setAttribute("visibility","visible"),i.setAttribute("d",p)):i.setAttribute("visibility","hidden")),r&&(g&&p?(r.setAttribute("visibility","visible"),r.setAttribute("d",p)):r.setAttribute("visibility","hidden")),c&&(v&&g?(c.setAttribute("visibility","visible"),c.setAttribute("y",String(a-12))):c.setAttribute("visibility","hidden")),o&&(v&&g?(o.setAttribute("visibility","visible"),o.setAttribute("transform","translate(".concat(t.x2-42,", ").concat(s,")"))):o.setAttribute("visibility","hidden"))}}),X&&G>0){var q=d.current["guideline-up-stroke"],K=d.current["guideline-up-badge"],V=d.current["guideline-up-arrow"],J=d.current["guideline-up-text"],U=d.current["guideline-up-badge-rect"];if(Y>0){var W=Math.max(15,L-k+15),Z=Math.min(15,Math.abs(G-O),Math.max(0,z-W)),$="M ".concat(O,",").concat(z," L ").concat(G-Z,",").concat(z," Q ").concat(G,",").concat(z," ").concat(G,",").concat(z-Z," L ").concat(G,",").concat(W);null==q||q.setAttribute("visibility","visible"),null==q||q.setAttribute("d",$),null==q||q.setAttribute("stroke",P),null==K||K.setAttribute("visibility","visible"),null==K||K.setAttribute("transform","translate(".concat(G,", ").concat(W,")")),V&&V.setAttribute("fill",P),J&&(J.textContent="+".concat(Y),J.setAttribute("fill",Q)),U&&U.setAttribute("stroke",P)}else null==q||q.setAttribute("visibility","hidden"),null==K||K.setAttribute("visibility","hidden");var _=d.current["guideline-down-stroke"],tt=d.current["guideline-down-badge"],et=d.current["guideline-down-arrow"],nt=d.current["guideline-down-text"],it=d.current["guideline-down-badge-rect"];if(j>0){var rt=Math.min(E-15,H-k-15);Z=Math.min(15,Math.abs(G-O),Math.max(0,rt-z)),$="M ".concat(O,",").concat(z," L ").concat(G-Z,",").concat(z," Q ").concat(G,",").concat(z," ").concat(G,",").concat(z+Z," L ").concat(G,",").concat(rt);null==_||_.setAttribute("visibility","visible"),null==_||_.setAttribute("d",$),null==_||_.setAttribute("stroke",P),null==tt||tt.setAttribute("visibility","visible"),null==tt||tt.setAttribute("transform","translate(".concat(G,", ").concat(rt,")")),et&&et.setAttribute("fill",P),nt&&(nt.textContent="+".concat(j),nt.setAttribute("fill",Q)),it&&it.setAttribute("stroke",P)}else null==_||_.setAttribute("visibility","hidden"),null==tt||tt.setAttribute("visibility","hidden")}}},[]),Tt=n(function(){Bt.current.length>0&&!D.current||(null!==Rt.current&&clearTimeout(Rt.current),Rt.current=setTimeout(function(){K.current(),Rt.current=null},50))},[]),It=n(function(t){if(null!==tt.current&&et.current&&Math.abs(t.currentTarget.scrollTop-tt.current)<=2){var e=et.current;tt.current=null,et.current=null,e()}if(!mt.current&&!J.current){if(F&&U&&(j.current||T.size>0)){var n=t.currentTarget,i=u.current,c=a.current,o=n===i?c:n===c?i:null;if(n&&o){var d=function(){var t,e,n,i,c,o,l,u,a,d,s,v=P.current,h=Q.current;if(null===v)return{leftAnchor:null,rightAnchor:null};if("string"==typeof v&&v.includes(r)){var g=v.split(r),f="".concat(g[0]).concat(r).concat(g[1]);return{leftAnchor:(null===(t=C.current[f])||void 0===t?void 0:t.current)||(null===(e=m.current[g[2]])||void 0===e?void 0:e.current)||(null===(n=y.current[Number(g[2])])||void 0===n?void 0:n.current)||null,rightAnchor:(null===(i=B.current[f])||void 0===i?void 0:i.current)||(null===(c=R.current[g[3]])||void 0===c?void 0:c.current)||(null===(o=x.current[Number(g[3])])||void 0===o?void 0:o.current)||null}}var p=Number(v),b=null!==h?Number(h):p;return{leftAnchor:(null===(l=C.current[p])||void 0===l?void 0:l.current)||(null===(u=A.current[p])||void 0===u?void 0:u.current)||(null===(a=y.current[p])||void 0===a?void 0:a.current)||null,rightAnchor:(null===(d=B.current[b])||void 0===d?void 0:d.current)||(null===(s=x.current[b])||void 0===s?void 0:s.current)||null}}(),s=d.leftAnchor,v=d.rightAnchor,h=n===i?s:v,g=n===i?v:s,f=null;if(h&&g){var p=h.getBoundingClientRect(),b=g.getBoundingClientRect(),S=o.getBoundingClientRect(),M=p.top+p.height/2;f=b.top-S.top+o.scrollTop+b.height/2-(M-S.top)}else{var I=Math.max(0,n.scrollHeight-n.clientHeight),L=Math.max(0,o.scrollHeight-o.clientHeight);f=I>0?n.scrollTop/I*L:n.scrollTop}var H=Math.max(0,o.scrollHeight-o.clientHeight);f=Math.max(0,Math.min(f,H)),Math.abs(o.scrollTop-f)>1&&(mt.current=!0,o.scrollTop=f,requestAnimationFrame(function(){mt.current=!1}))}}F||Tt(),xt.current||(xt.current=!0,requestAnimationFrame(function(){var t,e,n,i,c,o,d;if(j.current){var s=u.current,v=a.current;if(s&&v&&z.current){if(!O.current){var h=P.current,g=void 0;if("string"==typeof h&&h.includes(r)){var f=h.split(r),p="".concat(f[0]).concat(r).concat(f[1]);g=null===(t=C.current[p])||void 0===t?void 0:t.current}else g=null===(e=C.current[h])||void 0===e?void 0:e.current;if(g){var b=g.getBoundingClientRect();O.current={badgeScreenY:b.top+b.height/2,initialScrollTop:s.scrollTop,leftTop:s.getBoundingClientRect().top,leftBottom:s.getBoundingClientRect().top+s.clientHeight,cTop:null!==(i=null===(n=l.current)||void 0===n?void 0:n.getBoundingClientRect().top)&&void 0!==i?i:0}}}if(O.current){var y=O.current,x=s.scrollTop-y.initialScrollTop,m=y.badgeScreenY-x,R=((c=m,o=y.leftTop,d=y.leftBottom,Math.max(o,Math.min(d,c)))-y.cTop).toString(),B=m>=y.leftTop-4&&m<=y.leftBottom+4;z.current.setAttribute("y1",R),z.current.setAttribute("y2",R),z.current.setAttribute("visibility",B?"visible":"hidden")}}}Mt(),xt.current=!1}))}},[Mt,F,U,T,Tt]);return i(function(){K.current=St},[St]),i(function(){var t=setTimeout(Tt,250),e=function(){return W.current()};return window.addEventListener("resize",e),function(){clearTimeout(t),null!==Rt.current&&clearTimeout(Rt.current),null!==V.current&&clearTimeout(V.current),window.removeEventListener("resize",e)}},[Z,$,_,f,S,M,h,g,nt,Tt,I,L,Y,T]),{lines:ct,setLines:ot,overallConnector:ut,setOverallConnector:at,connectedLines:ht,setConnectedLines:gt,svgDimensions:pt,cachedConnectedPositions:Bt,calculateLines:St,calculateLinesRef:K,calculateLinesDebounced:Tt,handleColumnScroll:It}};export{o as useLinesCalculator};
|
|
2
2
|
//# sourceMappingURL=useLinesCalculator.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as e,useRef as n,useCallback as t,useEffect as r}from"react";import{DEVIATION_BADGE_SEPARATOR as i,resetClauseHighlight as l,smoothScrollTo as u}from"../CognitiveComparehelpers.js";var
|
|
1
|
+
import{useState as e,useRef as n,useCallback as t,useEffect as r}from"react";import{DEVIATION_BADGE_SEPARATOR as i,resetClauseHighlight as l,smoothScrollTo as u}from"../CognitiveComparehelpers.js";import{getVisibleGuidelineTargets as o}from"../Guidelines/utils/guidelineTargets.js";var c=function(c){var d=c.isGuidelineMode,s=c.maintainRelativeOrder,v=c.proposedSections,a=c.existingSections,p=c.leftContainerRef,g=c.rightContainerRef,f=c.scrollContainerRef,h=c.sectionLeftRefs,R=c.sectionRightRefs,S=c.subSectionLeftRefs,y=c.subSectionRightRefs,m=c.lhsBadgeRefs,B=c.rhsBadgeRefs,x=c.sectionRowRefs,C=c.sectionRightRowRefs,T=c.rhsTopSpacerRef,b=c.rhsBottomSpacerRef,A=c.lhsTopSpacerRef,w=c.lhsBottomSpacerRef,I=c.calculateLinesRef,L=c.setConnectedSections,F=c.setConnectedLines,N=c.cachedConnectedPositions,E=c.closeMoreFunctionsPopup,q=c.setErrorToast;c.moreFunctions,c.closeSummaryPopup;var H=e(!1),M=H[0],P=H[1],j=e(!1),z=j[0],G=j[1],V=e(!1),k=V[0],O=V[1],D=e(!1),J=D[0],K=D[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){l(e)}),ne.current.clear()},re=function(e,n,t){var r,l,u,o,c,d,s,v,a,f,T,b,A=null,w=null,I=null,L=null,F=null,N=null,E=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 q=n.split(i),H="".concat(q[0]).concat(i).concat(q[1]);A=(null===(r=S.current[q[2]])||void 0===r?void 0:r.current)||(null===(l=h.current[Number(q[2])])||void 0===l?void 0:l.current)||null,w=(null===(u=y.current[q[3]])||void 0===u?void 0:u.current)||(null===(o=R.current[Number(q[3])])||void 0===o?void 0:o.current)||null,I=(null===(c=m.current[H])||void 0===c?void 0:c.current)||A,L=(null===(d=B.current[H])||void 0===d?void 0:d.current)||w}else{var M=Number(n),P=null!==t?Number(t):M;A=(null===(s=h.current[M])||void 0===s?void 0:s.current)||null,w=(null===(v=R.current[P])||void 0===v?void 0:v.current)||null,F=(null===(a=m.current[M])||void 0===a?void 0:a.current)||null,N=(null===(f=B.current[P])||void 0===f?void 0:f.current)||null,I=F||(null===(T=x.current[M])||void 0===T?void 0:T.current)||A,L=N||(null===(b=C.current[P])||void 0===b?void 0:b.current)||w}if(A&&(A.style.paddingTop="0px"),w&&(w.style.paddingTop="0px"),e||(F&&(F.style.marginTop="0px"),N&&(N.style.marginTop="0px")),!e&&F&&N){var j=p.current,z=g.current;if(!E(F,j)||!E(N,z))return;var G=F.getBoundingClientRect(),V=N.getBoundingClientRect(),k=G.top-V.top;if(Math.abs(k)>32)return;k>0&&(N.style.marginTop="".concat(k,"px"))}else if(I&&L&&A&&w){G=I.getBoundingClientRect(),V=L.getBoundingClientRect();(k=G.top-V.top)>0&&(w.style.paddingTop="".concat(k,"px"))}},ie=t(function(){var e,n,t,r,l,u,o,c,d=$.current,s=_.current;if(null!==d)if("string"==typeof d&&d.includes(i)){var v=d.split(i),a=(null===(e=S.current[v[2]])||void 0===e?void 0:e.current)||(null===(n=h.current[Number(v[2])])||void 0===n?void 0:n.current)||null,p=(null===(t=y.current[v[3]])||void 0===t?void 0:t.current)||(null===(r=R.current[Number(v[3])])||void 0===r?void 0:r.current)||null;a&&(a.style.paddingTop="0px"),p&&(p.style.paddingTop="0px")}else{a=(null===(l=h.current[d])||void 0===l?void 0:l.current)||null,p=(null===(u=R.current[null!=s?s:d])||void 0===u?void 0:u.current)||null;a&&(a.style.paddingTop="0px"),p&&(p.style.paddingTop="0px");var g=(null===(o=m.current[d])||void 0===o?void 0:o.current)||null,f=(null===(c=B.current[null!=s?s:d])||void 0===c?void 0:c.current)||null;g&&(g.style.marginTop="0px"),f&&(f.style.marginTop="0px")}T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px"),A.current&&(A.current.style.height="0px"),w.current&&(w.current.style.height="0px")},[]);r(function(){Z.current=M},[M]),r(function(){$.current=U},[U]);var le=t(function(){te(),P(!1),Z.current=!1,Y.current=null,ie(),W(null),$.current=null,_.current=null,G(!1),K(!1)},[ie]),ue=t(function(e,n,t){var r,l,c=null===(r=null==t?void 0:t.toggleIfSame)||void 0===r||r,S=null==t?void 0:t.onReady,y=null!==(l=null==t?void 0:t.sourceSide)&&void 0!==l?l:"left";if(E(),null!=e)if(!n||d){te();var H=M&&U===e;M&&null!==U&&ie(),H&&c?le():(L(new Set([e])),F([]),N.current=[],K(!0),X.current=!0,W(e),$.current=e,P(!0),Z.current=!0,G(!1),T.current&&(T.current.style.height="0px"),b.current&&(b.current.style.height="0px"),A.current&&(A.current.style.height="0px"),w.current&&(w.current.style.height="0px"),requestAnimationFrame(function(){var n=function(){var n,t,r,l,c,A,w,L,F,N,E,q="string"==typeof e&&e.includes(i),H=null,M=null,P=null;if(d){if(q){var j=e.split(i),z="".concat(j[0]).concat(i).concat(j[1]);H=(null===(n=m.current[z])||void 0===n?void 0:n.current)||null}else H=(null===(t=h.current[e])||void 0===t?void 0:t.current)||(null===(r=x.current[e])||void 0===r?void 0:r.current)||null;M=o(g.current)[0]||null,P=M?e:null}else if(q){j=e.split(i),z="".concat(j[0]).concat(i).concat(j[1]);H=(null===(l=m.current[z])||void 0===l?void 0:l.current)||null,M=(null===(c=B.current[z])||void 0===c?void 0:c.current)||null,P=M?e:null}else if(H=(null===(A=h.current[e])||void 0===A?void 0:A.current)||(null===(w=x.current[e])||void 0===w?void 0:w.current)||null,s){var V=v[e],k=(null==V?void 0:V.refIndexes)||[];if(k.length>0){var O=k[0],D=a.findIndex(function(e){return e.selfIndex===O});-1!==D&&(M=(null===(N=R.current[D])||void 0===N?void 0:N.current)||(null===(E=C.current[D])||void 0===E?void 0:E.current)||null,P=D)}}else M=(null===(L=R.current[e])||void 0===L?void 0:L.current)||(null===(F=C.current[e])||void 0===F?void 0:F.current)||null,P=M?e:null;_.current=P;var J=p.current,Q=g.current,U=function(){re(q,e,P),G(!0),I.current&&I.current(),X.current=!1,"right"===y&&Q?Q.dispatchEvent(new Event("scroll")):J&&J.dispatchEvent(new Event("scroll")),K(!1),null==S||S()};if(!H||!J)return X.current=!1,K(!1),void(null==S||S());if(M&&Q){if(!s){var W=0;W="right"===y?M?M.getBoundingClientRect().top:0:H?H.getBoundingClientRect().top:0;var Y=f.current,Z=(null==Y?void 0:Y.getBoundingClientRect().top)||0,$=Y?Y.scrollTop+W-Z-150:0;return Y?void u(Y,$,200,U):void U()}var ee=H.getBoundingClientRect().top-J.getBoundingClientRect().top+J.scrollTop,ne=M.getBoundingClientRect().top-Q.getBoundingClientRect().top+Q.scrollTop,te=200;if("left"===y){var ie=ne-(ee-J.scrollTop);ie<0&&T.current&&!d&&(T.current.style.height="".concat(Math.abs(ie),"px")),requestAnimationFrame(function(){var e,n=Q.scrollHeight-Q.clientHeight;if(ie<0)e=0;else{if(ie>n){var t=ie-n;return b.current&&!d&&(b.current.style.height="".concat(t+150,"px")),void requestAnimationFrame(function(){u(Q,ie,te,U)})}e=ie}u(Q,e,te,U)})}else{var le=ee-(ne-Q.scrollTop);requestAnimationFrame(function(){var e,n=J.scrollHeight-J.clientHeight;if(le<0)e=0;else{if(le>n)return void requestAnimationFrame(function(){return u(J,n,te,U)});e=le}u(J,e,te,U)})}}else U()};d?setTimeout(n,100):n()}))}else q("No counterpart exists for this section.")},[U,E,a,M,s,v,ie,le,d]);return{isSideBySide:M,setIsSideBySide:P,isArrowVisible:z,setIsArrowVisible:G,isResizing:k,setIsResizing:O,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:le,activateSideBySide:ue}};export{c as useSideBySide};
|
|
2
2
|
//# sourceMappingURL=useSideBySide.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as l,jsx as i,Fragment as o}from"react/jsx-runtime";import{useMemo as t,useState as r,useRef as d,useEffect as a}from"react";import{ExternalLink as s,ChevronUp as c,ChevronDown as u}from"lucide-react";import v from"./CognitiveNonWebSearchReasoning.module.css.js";var h=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},m=function(n){return n.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(n,l){return n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?i("strong",e({className:v.boldText},{children:n.slice(2,-2)}),l):n})},g=function(g){var p=g.item,f=g.headerTitle;g.index;var x=g.iconsConfig,y=g.DocumentTitle,b=g.previewCallback,N=g.bodyHeight,C=g.disableMaximize,I=void 0!==C&&C,k=g.splitterCustomStyle,T=void 0!==k&&k,H=g.themeTokens,L=g.classNames,B=g.styles,w=p.dataSource,z=p.confidence_score,S=p.trainingDataTitle,A=null==x?void 0:x.ChevronDownIcon,F=null==x?void 0:x.ChevronUpIcon,_=null==x?void 0:x.MaximizeIcon,D=null==x?void 0:x.CloseIcon,R=t(function(){var e=(w?w.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),l=0,i=e.map(function(n){var e=n.startsWith("<highlight>"),i={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?l:-1};return e&&l++,i}),o=i.filter(function(n){return n.isHighlight}).length,t=[],r=[];return i.forEach(function(e){var l=e.text,i=e.isHighlight,o=e.highlightIndex;l.split("\n").forEach(function(e,l){l>0&&((r.length>0||t.length>0)&&t.push(n([],r,!0)),r=[]),e&&r.push({text:e,isHighlight:i,highlightIndex:o})})}),r.length>0&&t.push(n([],r,!0)),{processedLines:t.map(function(n){var e=n.map(function(n){return n.text}).join(""),l=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!l,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==l?void 0:l[1])||"",content:(null==l?void 0:l[3])||e}}),totalHighlights:o}},[w]),W=R.processedLines,j=R.totalHighlights,M=r(0),V=M[0],E=M[1],$=d(null),U=d(null),Y=d(null),q=d([]),G=d([]);a(function(){q.current=q.current.slice(0,j),G.current=G.current.slice(0,j)},[j]),a(function(){if(j>0){E(0);var n=setTimeout(function(){var n;null===(n=q.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[j]);var J=function(n,e){setTimeout(function(){var l=e?G.current[n]:q.current[n];null==l||l.scrollIntoView({behavior:"smooth",block:"center"})},50)},K=function(n){if(void 0===n&&(n=!1),j){var e=V>0?V-1:j-1;E(e),J(e,n)}},O=function(n){if(void 0===n&&(n=!1),j){var e=V<j-1?V+1:0;E(e),J(e,n)}},P=function(n){var o=n?G:q,t=0;return W.map(function(n,r){n.isHeader&&(t=0),n.isListItem&&(t+=1);var d=function(){return n.segments.map(function(l,t){var r=l.isHighlight&&l.highlightIndex===V,d=l.text;return n.isListItem&&0===t&&(d=l.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),l.isHighlight?i("span",e({ref:function(n){n&&(o.current[l.highlightIndex]=n)},className:h(v.highlight,r?v.highlightActive:void 0,null==L?void 0:L.highlight,r?null==L?void 0:L.highlightActive:void 0),style:r?e(e({},null==B?void 0:B.highlight),null==B?void 0:B.highlightActive):null==B?void 0:B.highlight},{children:m(d)}),t):i("span",{children:m(d)},t)})};return n.isHeader?i("span",e({className:h(v.headerLine,null==L?void 0:L.headerLine),style:null==B?void 0:B.headerLine},{children:d()}),r):n.isListItem?l("span",e({className:h(v.listItemLine,null==L?void 0:L.listItemLine),style:e({paddingLeft:n.indent?"1rem":"0"},null==B?void 0:B.listItemLine)},{children:[l("span",e({className:h(v.listCounter,null==L?void 0:L.listCounter),style:null==B?void 0:B.listCounter},{children:[t,"."]})),i("span",{children:d()})]}),r):i("span",e({className:h(v.blockLine,null==L?void 0:L.blockLine),style:null==B?void 0:B.blockLine},{children:d()}),r)})},Q=function(n){return j>1?l("div",e({className:h(n?v.modalNavContainer:v.navigationContainer,n?null==L?void 0:L.modalNavContainer:null==L?void 0:L.navigationContainer),style:n?null==B?void 0:B.modalNavContainer:null==B?void 0:B.navigationContainer},{children:[F&&i("button",e({onClick:function(){return K(n)},className:h(n?v.modalNavButton:v.navButton,null==L?void 0:L.navButton),style:null==B?void 0:B.navButton},{children:i(F,{className:h(v.navIcon,null==L?void 0:L.navIcon),style:null==B?void 0:B.navIcon})})),l("span",e({className:h(v.navCounter,null==L?void 0:L.navCounter),style:null==B?void 0:B.navCounter},{children:[V+1,"/",j]})),A&&i("button",e({onClick:function(){return O(n)},className:h(n?v.modalNavButton:v.navButton,null==L?void 0:L.navButton),style:null==B?void 0:B.navButton},{children:i(A,{className:h(v.navIcon,null==L?void 0:L.navIcon),style:null==B?void 0:B.navIcon})}))]})):null},X=null!=z?l("span",e({className:h(v.confidenceBadge,null==L?void 0:L.confidenceBadge),style:null==B?void 0:B.confidenceBadge},{children:[i("span",e({className:v.confidenceStar},{children:"✦"})),l("span",e({className:v.confidenceScore},{children:[z,"%"]}))]})):null,Z=T?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,nn=l(o,{children:[S&&i("div",e({className:h(v.footer,null==L?void 0:L.footer),style:e(e({},Z),null==B?void 0:B.footer)},{children:i("span",e({className:h(v.trainingTitle,null==L?void 0:L.trainingTitle),style:null==B?void 0:B.trainingTitle},{children:S}))})),y&&i("div",e({className:h(v.modalFooterSource,null==L?void 0:L.modalFooterSource),style:e(e({},Z),null==B?void 0:B.modalFooterSource)},{children:l("button",e({type:"button",onClick:function(){return null==b?void 0:b()},className:h(v.trainingTitleLink,null==L?void 0:L.trainingTitleLink),style:null==B?void 0:B.trainingTitleLink},{children:[y,i(s,{size:16,color:"#2563eb"})]}))}))]});return l(o,{children:[l("div",e({className:h(v.expandedContainer,null==L?void 0:L.expandedContainer),style:e(e(e(e({},H),N?{height:"".concat(N),display:"flex",flexDirection:"column"}:void 0),T?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==B?void 0:B.expandedContainer)},{children:[l("div",e({className:h(v.expandedHeader,null==L?void 0:L.expandedHeader),style:e(e({},T?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==B?void 0:B.expandedHeader)},{children:[i("span",e({className:h(v.headerTitle,null==L?void 0:L.headerTitle),style:null==B?void 0:B.headerTitle},{children:f})),l("div",e({className:h(v.headerActions,null==L?void 0:L.headerActions),style:null==B?void 0:B.headerActions},{children:[T?j>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[V+1," / ",j]})),i("button",e({onClick:function(){return K(!0)},disabled:V<=0,style:{padding:"2px 4px",cursor:V<=0?"not-allowed":"pointer",opacity:V<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(c,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return O(!0)},disabled:V>=j-1,style:{padding:"2px 4px",cursor:V>=j-1?"not-allowed":"pointer",opacity:V>=j-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):Q(!1),X,!I&&_&&i("button",e({onClick:function(){var n;return null===(n=Y.current)||void 0===n?void 0:n.showModal()},className:h(v.maximizeButton,null==L?void 0:L.maximizeButton),style:null==B?void 0:B.maximizeButton,title:"View fullscreen"},{children:i(_,{className:v.maximizeIcon})}))]}))]})),i("div",e({ref:$,className:h(v.contentArea,null==L?void 0:L.contentArea),style:e(e(e({},N?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),T?{padding:"1rem 1.5rem"}:void 0),null==B?void 0:B.contentArea)},{children:i("div",e({className:h(v.contentInner,null==L?void 0:L.contentInner),style:null==B?void 0:B.contentInner},{children:P(!1)}))})),nn]})),!I&&i("dialog",e({ref:Y,className:v.modalDialog,onClick:function(n){var e;n.target===Y.current&&(null===(e=Y.current)||void 0===e||e.close())}},{children:l("div",e({className:h(v.modalContainer,null==L?void 0:L.modalContainer),style:null==B?void 0:B.modalContainer},{children:[l("div",e({className:h(v.modalHeader,null==L?void 0:L.modalHeader),style:null==B?void 0:B.modalHeader},{children:[i("span",e({className:h(v.modalHeaderTitle,null==L?void 0:L.modalHeaderTitle),style:null==B?void 0:B.modalHeaderTitle},{children:f})),l("div",e({className:h(v.modalHeaderActions,null==L?void 0:L.modalHeaderActions),style:null==B?void 0:B.modalHeaderActions},{children:[T?j>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[V+1," / ",j]})),i("button",e({onClick:function(){return K(!0)},disabled:V<=0,style:{padding:"2px 4px",cursor:V<=0?"not-allowed":"pointer",opacity:V<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(c,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return O(!0)},disabled:V>=j-1,style:{padding:"2px 4px",cursor:V>=j-1?"not-allowed":"pointer",opacity:V>=j-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):Q(!0),X,D&&i("button",e({onClick:function(){var n;return null===(n=Y.current)||void 0===n?void 0:n.close()},className:h(v.closeButton,null==L?void 0:L.closeButton),style:null==B?void 0:B.closeButton,title:"Close"},{children:i(D,{className:h(v.closeIcon,null==L?void 0:L.closeIcon),style:null==B?void 0:B.closeIcon})}))]}))]})),i("div",e({ref:U,className:h(v.modalContent,null==L?void 0:L.modalContent),style:null==B?void 0:B.modalContent},{children:i("div",e({className:h(v.modalContentInner,null==L?void 0:L.modalContentInner),style:null==B?void 0:B.modalContentInner},{children:P(!0)}))})),S&&i("div",e({className:h(v.modalFooter,null==L?void 0:L.modalFooter),style:null==B?void 0:B.modalFooter},{children:i("span",e({className:h(v.trainingTitle,null==L?void 0:L.trainingTitle),style:null==B?void 0:B.trainingTitle},{children:S}))})),y&&i("div",e({className:h(v.modalFooterSource,null==L?void 0:L.modalFooterSource),style:null==B?void 0:B.modalFooterSource},{children:l("button",e({type:"button",onClick:function(){var n;null==b||b(),null===(n=Y.current)||void 0===n||n.close()},className:h(v.trainingTitleLink,null==L?void 0:L.trainingTitleLink),style:null==B?void 0:B.trainingTitleLink},{children:[y,i(s,{size:16,color:"#2563eb"})]}))}))]}))}))]})};export{g as default};
|
|
1
|
+
import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as l,jsx as i,Fragment as o}from"react/jsx-runtime";import{useMemo as t,useState as r,useRef as d,useEffect as a}from"react";import{ExternalLink as c,ChevronUp as s,ChevronDown as u}from"lucide-react";import v from"./CognitiveNonWebSearchReasoning.module.css.js";var h=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},m=function(n){return n.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(n,l){return n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?i("strong",e({className:v.boldText},{children:n.slice(2,-2)}),l):n})},g=function(g){var p=g.item,f=g.headerTitle;g.index;var x=g.iconsConfig,y=g.DocumentTitle,b=g.previewCallback,C=g.bodyHeight,N=g.disableMaximize,I=void 0!==N&&N,k=g.onFullscreenChange,T=g.splitterCustomStyle,H=void 0!==T&&T,L=g.themeTokens,B=g.classNames,w=g.styles,z=p.dataSource,S=p.confidence_score,A=p.trainingDataTitle,F=null==x?void 0:x.ChevronDownIcon,_=null==x?void 0:x.ChevronUpIcon,D=null==x?void 0:x.MaximizeIcon,R=null==x?void 0:x.CloseIcon,W=t(function(){var e=(z?z.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),l=0,i=e.map(function(n){var e=n.startsWith("<highlight>"),i={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?l:-1};return e&&l++,i}),o=i.filter(function(n){return n.isHighlight}).length,t=[],r=[];return i.forEach(function(e){var l=e.text,i=e.isHighlight,o=e.highlightIndex;l.split("\n").forEach(function(e,l){l>0&&((r.length>0||t.length>0)&&t.push(n([],r,!0)),r=[]),e&&r.push({text:e,isHighlight:i,highlightIndex:o})})}),r.length>0&&t.push(n([],r,!0)),{processedLines:t.map(function(n){var e=n.map(function(n){return n.text}).join(""),l=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!l,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==l?void 0:l[1])||"",content:(null==l?void 0:l[3])||e}}),totalHighlights:o}},[z]),j=W.processedLines,M=W.totalHighlights,V=r(0),E=V[0],$=V[1],U=d(null),Y=d(null),q=d(null),G=d([]),J=d([]);a(function(){G.current=G.current.slice(0,M),J.current=J.current.slice(0,M)},[M]),a(function(){if(M>0){$(0);var n=setTimeout(function(){var n;null===(n=G.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[M]),a(function(){return function(){var n;(null===(n=q.current)||void 0===n?void 0:n.open)&&(null==k||k(!1))}},[k]);var K=function(n,e){setTimeout(function(){var l=e?J.current[n]:G.current[n];null==l||l.scrollIntoView({behavior:"smooth",block:"center"})},50)},O=function(n){if(void 0===n&&(n=!1),M){var e=E>0?E-1:M-1;$(e),K(e,n)}},P=function(n){if(void 0===n&&(n=!1),M){var e=E<M-1?E+1:0;$(e),K(e,n)}},Q=function(n){var o=n?J:G,t=0;return j.map(function(n,r){n.isHeader&&(t=0),n.isListItem&&(t+=1);var d=function(){return n.segments.map(function(l,t){var r=l.isHighlight&&l.highlightIndex===E,d=l.text;return n.isListItem&&0===t&&(d=l.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),l.isHighlight?i("span",e({ref:function(n){n&&(o.current[l.highlightIndex]=n)},className:h(v.highlight,r?v.highlightActive:void 0,null==B?void 0:B.highlight,r?null==B?void 0:B.highlightActive:void 0),style:r?e(e({},null==w?void 0:w.highlight),null==w?void 0:w.highlightActive):null==w?void 0:w.highlight},{children:m(d)}),t):i("span",{children:m(d)},t)})};return n.isHeader?i("span",e({className:h(v.headerLine,null==B?void 0:B.headerLine),style:null==w?void 0:w.headerLine},{children:d()}),r):n.isListItem?l("span",e({className:h(v.listItemLine,null==B?void 0:B.listItemLine),style:e({paddingLeft:n.indent?"1rem":"0"},null==w?void 0:w.listItemLine)},{children:[l("span",e({className:h(v.listCounter,null==B?void 0:B.listCounter),style:null==w?void 0:w.listCounter},{children:[t,"."]})),i("span",{children:d()})]}),r):i("span",e({className:h(v.blockLine,null==B?void 0:B.blockLine),style:null==w?void 0:w.blockLine},{children:d()}),r)})},X=function(n){return M>1?l("div",e({className:h(n?v.modalNavContainer:v.navigationContainer,n?null==B?void 0:B.modalNavContainer:null==B?void 0:B.navigationContainer),style:n?null==w?void 0:w.modalNavContainer:null==w?void 0:w.navigationContainer},{children:[_&&i("button",e({onClick:function(){return O(n)},className:h(n?v.modalNavButton:v.navButton,null==B?void 0:B.navButton),style:null==w?void 0:w.navButton},{children:i(_,{className:h(v.navIcon,null==B?void 0:B.navIcon),style:null==w?void 0:w.navIcon})})),l("span",e({className:h(v.navCounter,null==B?void 0:B.navCounter),style:null==w?void 0:w.navCounter},{children:[E+1,"/",M]})),F&&i("button",e({onClick:function(){return P(n)},className:h(n?v.modalNavButton:v.navButton,null==B?void 0:B.navButton),style:null==w?void 0:w.navButton},{children:i(F,{className:h(v.navIcon,null==B?void 0:B.navIcon),style:null==w?void 0:w.navIcon})}))]})):null},Z=null!=S?l("span",e({className:h(v.confidenceBadge,null==B?void 0:B.confidenceBadge),style:null==w?void 0:w.confidenceBadge},{children:[i("span",e({className:v.confidenceStar},{children:"✦"})),l("span",e({className:v.confidenceScore},{children:[S,"%"]}))]})):null,nn=H?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,en=l(o,{children:[A&&i("div",e({className:h(v.footer,null==B?void 0:B.footer),style:e(e({},nn),null==w?void 0:w.footer)},{children:i("span",e({className:h(v.trainingTitle,null==B?void 0:B.trainingTitle),style:null==w?void 0:w.trainingTitle},{children:A}))})),y&&i("div",e({className:h(v.modalFooterSource,null==B?void 0:B.modalFooterSource),style:e(e({},nn),null==w?void 0:w.modalFooterSource)},{children:l("button",e({type:"button",onClick:function(){return null==b?void 0:b()},className:h(v.trainingTitleLink,null==B?void 0:B.trainingTitleLink),style:null==w?void 0:w.trainingTitleLink},{children:[y,i(c,{size:16,color:"#2563eb"})]}))}))]});return l(o,{children:[l("div",e({className:h(v.expandedContainer,null==B?void 0:B.expandedContainer),style:e(e(e(e({},L),C?{height:"".concat(C),display:"flex",flexDirection:"column"}:void 0),H?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==w?void 0:w.expandedContainer)},{children:[l("div",e({className:h(v.expandedHeader,null==B?void 0:B.expandedHeader),style:e(e({},H?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==w?void 0:w.expandedHeader)},{children:[i("span",e({className:h(v.headerTitle,null==B?void 0:B.headerTitle),style:null==w?void 0:w.headerTitle},{children:f})),l("div",e({className:h(v.headerActions,null==B?void 0:B.headerActions),style:null==w?void 0:w.headerActions},{children:[H?M>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[E+1," / ",M]})),i("button",e({onClick:function(){return O(!0)},disabled:E<=0,style:{padding:"2px 4px",cursor:E<=0?"not-allowed":"pointer",opacity:E<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(s,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return P(!0)},disabled:E>=M-1,style:{padding:"2px 4px",cursor:E>=M-1?"not-allowed":"pointer",opacity:E>=M-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):X(!1),Z,!I&&D&&i("button",e({onClick:function(){var n;null==k||k(!0),null===(n=q.current)||void 0===n||n.showModal()},className:h(v.maximizeButton,null==B?void 0:B.maximizeButton),style:null==w?void 0:w.maximizeButton,title:"View fullscreen"},{children:i(D,{className:v.maximizeIcon})}))]}))]})),i("div",e({ref:U,className:h(v.contentArea,null==B?void 0:B.contentArea),style:e(e(e({},C?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),H?{padding:"1rem 1.5rem"}:void 0),null==w?void 0:w.contentArea)},{children:i("div",e({className:h(v.contentInner,null==B?void 0:B.contentInner),style:null==w?void 0:w.contentInner},{children:Q(!1)}))})),en]})),!I&&i("dialog",e({ref:q,className:v.modalDialog,onClose:function(){return null==k?void 0:k(!1)},onClick:function(n){var e;n.target===q.current&&(null===(e=q.current)||void 0===e||e.close())}},{children:l("div",e({className:h(v.modalContainer,null==B?void 0:B.modalContainer),style:null==w?void 0:w.modalContainer},{children:[l("div",e({className:h(v.modalHeader,null==B?void 0:B.modalHeader),style:null==w?void 0:w.modalHeader},{children:[i("span",e({className:h(v.modalHeaderTitle,null==B?void 0:B.modalHeaderTitle),style:null==w?void 0:w.modalHeaderTitle},{children:f})),l("div",e({className:h(v.modalHeaderActions,null==B?void 0:B.modalHeaderActions),style:null==w?void 0:w.modalHeaderActions},{children:[H?M>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[E+1," / ",M]})),i("button",e({onClick:function(){return O(!0)},disabled:E<=0,style:{padding:"2px 4px",cursor:E<=0?"not-allowed":"pointer",opacity:E<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(s,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return P(!0)},disabled:E>=M-1,style:{padding:"2px 4px",cursor:E>=M-1?"not-allowed":"pointer",opacity:E>=M-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):X(!0),Z,R&&i("button",e({onClick:function(){var n;return null===(n=q.current)||void 0===n?void 0:n.close()},className:h(v.closeButton,null==B?void 0:B.closeButton),style:null==w?void 0:w.closeButton,title:"Close"},{children:i(R,{className:h(v.closeIcon,null==B?void 0:B.closeIcon),style:null==w?void 0:w.closeIcon})}))]}))]})),i("div",e({ref:Y,className:h(v.modalContent,null==B?void 0:B.modalContent),style:null==w?void 0:w.modalContent},{children:i("div",e({className:h(v.modalContentInner,null==B?void 0:B.modalContentInner),style:null==w?void 0:w.modalContentInner},{children:Q(!0)}))})),A&&i("div",e({className:h(v.modalFooter,null==B?void 0:B.modalFooter),style:null==w?void 0:w.modalFooter},{children:i("span",e({className:h(v.trainingTitle,null==B?void 0:B.trainingTitle),style:null==w?void 0:w.trainingTitle},{children:A}))})),y&&i("div",e({className:h(v.modalFooterSource,null==B?void 0:B.modalFooterSource),style:null==w?void 0:w.modalFooterSource},{children:l("button",e({type:"button",onClick:function(){var n;null==b||b(),null===(n=q.current)||void 0===n||n.close()},className:h(v.trainingTitleLink,null==B?void 0:B.trainingTitleLink),style:null==w?void 0:w.trainingTitleLink},{children:[y,i(c,{size:16,color:"#2563eb"})]}))}))]}))}))]})};export{g as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveInternalgptCoreComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{useMemo as o,useState as l,useCallback as a}from"react";import{Sparkles as r,Globe as s}from"lucide-react";import d from"../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";import u from"./GptWebCitationImageCitation.js";import c from"./GptWebCitationSkeleton.js";import{allowsGptCitationView as v,allowsWebCitationView as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{useMemo as o,useState as l,useCallback as a}from"react";import{Sparkles as r,Globe as s}from"lucide-react";import d from"../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";import u from"./GptWebCitationImageCitation.js";import c from"./GptWebCitationSkeleton.js";import{allowsGptCitationView as v,allowsWebCitationView as g,showsCitationViewToggle as p,CitationType as m}from"./types.js";import{mapCitationDataToDisplay as b,resolveSkeletonVisitUrl as C,getWebCitationImageUrl as w}from"./utils/citationData.utils.js";import{resolveWebCitationVisitLinkStyles as h}from"./utils/styleOverrides.utils.js";import{resolveFixedHeightLayout as f,getFixedPanelStyle as k,getParentHeightPanelStyle as y,getParentHeightGptBodyHeight as x,getFixedWebContentStyle as F}from"./utils/fixedHeight.utils.js";import I from"./GptWebCitation.module.css.js";import B from"../../assests/svg/NeuralNetworkIcon.js";var S=function(o){var l=o.variant,a=o.disabled,r=o.onClick,d=o.title,u=o.style;return t("button",i({type:"button",className:I.webCitationButton,onClick:r,disabled:a,title:d,style:u},{children:e(n,"gpt"===l?{children:[t(B,{className:I.webCitationButtonIcon}),"View GPT Citation"]}:{children:[t(s,{size:24,className:I.webCitationButtonIcon}),"View Web Citation"]})}))},H=function(n){var s,B,H,L,N=n.gptCitation,W=n.defaultCitationUrl,j=n.citationType,T=n.webCitationData,E=n.topic,V=n.sourceLabel,z=n.relevanceScore,G=n.learnedFrom,A=n.webCitationStatus,M=n.onGenerateWebCitation,P=n.showWebCitation,U=n.onToggleCitationView,D=n.showExpandImageButton,O=void 0===D||D,R=n.onFullscreenChange,q=n.showGptMaximizeButton,J=n.iconsConfig,K=n.isFixedHeight,Q=void 0!==K&&K,X=n.useParentHeight,Y=void 0!==X&&X,Z=n.styles,$=o(function(){return function(t){var e,n,o,l,a,r,s,d,u,c,v;return{container:null==t?void 0:t.container,gptWrapper:i(i({},null===(e=null==t?void 0:t.gptCitation)||void 0===e?void 0:e.wrapper),null==t?void 0:t.gptCitationWrapper),gptFooterAction:i(i({},null===(n=null==t?void 0:t.gptCitation)||void 0===n?void 0:n.footerAction),null==t?void 0:t.footerAction),gptToggleButton:i(i({},null===(o=null==t?void 0:t.gptCitation)||void 0===o?void 0:o.toggleButton),null==t?void 0:t.webCitationButton),webPanel:i(i({},null==t?void 0:t.container),null===(l=null==t?void 0:t.webCitation)||void 0===l?void 0:l.panel),webHeader:null===(a=null==t?void 0:t.webCitation)||void 0===a?void 0:a.header,webContent:null===(r=null==t?void 0:t.webCitation)||void 0===r?void 0:r.content,webFooter:null===(s=null==t?void 0:t.webCitation)||void 0===s?void 0:s.footer,webToggleButton:i(i({},null===(d=null==t?void 0:t.webCitation)||void 0===d?void 0:d.toggleButton),null==t?void 0:t.webCitationButton),webLearnedFrom:null===(u=null==t?void 0:t.webCitation)||void 0===u?void 0:u.learnedFrom,webImage:null===(c=null==t?void 0:t.webCitation)||void 0===c?void 0:c.image,webSkeleton:null===(v=null==t?void 0:t.webCitation)||void 0===v?void 0:v.skeleton,webImageVisitLink:h(null==t?void 0:t.webCitation,"image"),webSkeletonVisitLink:h(null==t?void 0:t.webCitation,"skeleton")}}(Z)},[Z]),_=v(j),ii=g(j),ti=p(j),ei=Q||Y,ni=o(function(){return Q?f(N.bodyHeight,ti):null},[Q,N.bodyHeight,ti]),oi=o(function(){return ni?k(ni.panelHeight):void 0},[ni]),li=o(function(){return Y?y():void 0},[Y]),ai=null!=li?li:oi,ri=o(function(){var i,t;return{MaximizeIcon:null!==(i=null==J?void 0:J.MaximizeIcon)&&void 0!==i?i:null===(t=N.iconsConfig)||void 0===t?void 0:t.MaximizeIcon,ExternalLinkIcon:null==J?void 0:J.ExternalLinkIcon}},[J,null===(s=N.iconsConfig)||void 0===s?void 0:s.MaximizeIcon]),si=o(function(){var t=Y?{bodyHeight:x(ti)}:Q&&ni?{bodyHeight:ni.gptBodyHeight}:{};return i(i(i(i({},N),t),{disableMaximize:void 0!==q?!q:N.disableMaximize}),ti||j===m.WEB?{DocumentTitle:void 0,previewCallback:void 0}:{})},[N,q,ti,j,Y,Q,ni]),di=l(j!==m.GPT),ui=di[0],ci=di[1],vi=j!==m.GPT&&(j===m.WEB||(null!=P?P:ui)),gi=void 0!==P,pi=o(function(){return T?b(T):null},[T]),mi=null!==(B=null!=E?E:null==pi?void 0:pi.topic)&&void 0!==B?B:"Web Citation",bi=null!==(H=null!=z?z:null==pi?void 0:pi.relevanceScore)&&void 0!==H?H:0,Ci=null!=G?G:null==pi?void 0:pi.learnedFrom,wi=C(null==pi?void 0:pi.highlightedUrl,null!==(L=null==pi?void 0:pi.citationUrl)&&void 0!==L?L:W),hi=w(T),fi=o(function(){return function(i,t,e){return e?"success":i||(t?"error":"pending")}(A,T,hi)},[A,T,hi]),ki=a(function(){U?U():gi||ci(!1)},[U,gi]),yi=a(function(){U?U():gi||ci(!0),hi||"success"===fi||null==M||M()},[U,gi,hi,fi,M]),xi=null!=V?V:"Source: Web Citation > ".concat(mi),Fi=function(n){var o=!!si.DocumentTitle,l=[I.gptCitationWrapper,o?I.gptCitationWrapperWithSource:"",ei?I.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" ");return e("div",i({className:l,style:i(i({},$.gptWrapper),ai)},{children:[t(d,i({},si,{splitterCustomStyle:!0,onFullscreenChange:R})),n&&t("div",i(o?{className:I.gptCitationFooterAction,style:$.gptFooterAction}:{className:[I.gptCitationToggleFooter,ei?I.gptCitationToggleFooterFixedHeight:""].filter(Boolean).join(" "),style:$.gptFooterAction},{children:n}))]}))};return _&&!vi?t("div",i({className:I.overlay,style:i(i({},$.container),li)},{children:Fi(ti?t(S,{variant:"web",onClick:yi,title:"View web-based citation for this source.",style:$.gptToggleButton}):void 0)})):ii?e("div",i({className:[I.panel,ei?I.gptCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:i(i({},$.webPanel),ai)},{children:[e("div",i({className:I.panelHeader,style:$.webHeader},{children:[t("span",i({className:I.panelSource},{children:xi})),t("div",i({className:I.panelHeaderActions},{children:bi>0&&e("div",i({className:I.confidenceBadge,title:"Decision strength"},{children:[t(r,{size:14}),bi,"%"]}))}))]})),t("div",i({className:[I.panelContent,I.panelContentExpanded,ei?I.panelContentFixedHeight:""].filter(Boolean).join(" "),style:i(i({},$.webContent),ei?F():void 0)},{children:"pending"===fi?t(c,{status:"pending",citationUrl:wi,ExternalLinkIcon:ri.ExternalLinkIcon,styles:$.webSkeleton,visitLinkStyles:$.webSkeletonVisitLink,isFixedHeight:ei}):"success"===fi&&hi?t(u,{citationImage:hi,citationUrl:wi,showExpandImageButton:O,iconsConfig:ri,styles:$.webImage,visitLinkStyles:$.webImageVisitLink,skeletonStyles:$.webSkeleton,skeletonVisitLinkStyles:$.webSkeletonVisitLink,isFixedHeight:ei,onFullscreenChange:R}):t(c,{status:"error",citationUrl:wi,ExternalLinkIcon:ri.ExternalLinkIcon,styles:$.webSkeleton,visitLinkStyles:$.webSkeletonVisitLink,isFixedHeight:ei})})),e("div",i({className:I.panelFooter,style:$.webFooter},{children:[ti?t(S,{variant:"gpt",onClick:ki,style:$.webToggleButton}):null,Ci&&e("span",i({className:I.learnedFrom,style:$.webLearnedFrom},{children:["Learned From ",Ci]}))]}))]})):t("div",i({className:I.overlay,style:i(i({},$.container),li)},{children:Fi()}))};export{H as default};
|
|
2
2
|
//# sourceMappingURL=GptWebCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as e,jsx as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as t,useRef as l,useEffect as o}from"react";import{Maximize2 as r,ExternalLink as a}from"lucide-react";import s from"./GptWebCitationImageFullScreenView.js";import c from"./GptWebCitationSkeleton.js";import{sanitizeExternalUrl as d}from"./utils/citationData.utils.js";import u from"./GptWebCitation.module.css.js";var m=function(m){var v,g,p=m.citationImage,f=m.citationUrl,C=m.skeletonVisitUrl,h=m.showExpandImageButton,k=void 0===h||h,y=m.iconsConfig,x=m.styles,w=m.visitLinkStyles,I=m.skeletonStyles,b=m.skeletonVisitLinkStyles,j=m.isFixedHeight,L=void 0!==j&&j,N=m.onFullscreenChange,S=null!==(v=null==y?void 0:y.MaximizeIcon)&&void 0!==v?v:r,B=null!==(g=null==y?void 0:y.ExternalLinkIcon)&&void 0!==g?g:a,F=t(!1),H=F[0],V=F[1],W=t("loading"),E=W[0],z=W[1],G=l(!1);o(function(){var i=!0;G.current&&(G.current=!1,null==N||N(!1)),z("loading"),V(!1);var e=new Image;return e.onload=function(){i&&z("loaded")},e.onerror=function(){i&&z("error")},e.src=p,function(){i=!1,e.onload=null,e.onerror=null}},[p,N]),o(function(){return function(){G.current&&(G.current=!1,null==N||N(!1))}},[N]);var U="loaded"===E,D=d(f);return e("div",i({className:[u.imageCitationWrapper,L?u.imageCitationWrapperFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.wrapper},{children:[n("div",i({className:[u.imageCitationCenter,L?u.imageCitationCenterFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.center},{children:U?e("div",i({className:[u.imageCitationViewport,L?u.imageCitationViewportFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.viewport},{children:[n("div",i({className:[u.imageCitationScrollContainer,L?u.imageCitationScrollContainerFixedHeight:""].filter(Boolean).join(" "),style:null==x?void 0:x.scrollContainer},{children:n("img",{src:p,alt:"Web citation snapshot",className:[u.citationImage,L?u.citationImageContained:""].filter(Boolean).join(" "),style:null==x?void 0:x.image})})),k&&n("button",i({type:"button",onClick:function(i){i.stopPropagation(),G.current=!0,null==N||N(!0),V(!0)},className:u.expandImageButton,style:null==x?void 0:x.expandButton,"aria-label":"View citation image in full screen",title:"Expand image"},{children:n(S,{size:16,strokeWidth:2})}))]})):n(c,{status:"error"===E?"error":"pending",citationUrl:null!=C?C:f,ExternalLinkIcon:null==y?void 0:y.ExternalLinkIcon,styles:I,visitLinkStyles:b,isFixedHeight:L})})),D&&U&&e("div",i({className:u.visitLinkRow,style:null==w?void 0:w.row},{children:[n("span",i({className:u.visitLinkHint,style:null==w?void 0:w.hint},{children:"Open link in new tab to read in detail"})),e("a",i({href:D,target:"_blank",rel:"noreferrer",className:u.visitLink,style:null==w?void 0:w.link},{children:["Visit Link",n(B,{size:16})]}))]})),H&&U&&n(s,{src:p,onClose:function(){G.current=!1,null==N||N(!1),V(!1)},styles:null==x?void 0:x.fullScreen})]}))};export{m as default};
|
|
2
2
|
//# sourceMappingURL=GptWebCitationImageCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e="520px",
|
|
1
|
+
var e="520px",n="3.25rem",t=function(t,i){if(void 0===i&&(i=!0),!i){var o=null!=t?t:e;return{contentHeight:o,gptBodyHeight:o,panelHeight:o}}if(t)return{contentHeight:t,gptBodyHeight:t,panelHeight:"calc(".concat(t," + ").concat(n,")")};var c="calc(".concat(e," - ").concat(n,")");return{contentHeight:c,gptBodyHeight:c,panelHeight:e}},i=function(e){return{height:e,minHeight:e,maxHeight:e,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"}},o=function(){return{height:"100%",minHeight:0,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden",boxSizing:"border-box"}},c=function(e){return void 0===e&&(e=!0),e?"calc(100% - ".concat(n,")"):"100%"},r=function(){return{flex:1,minHeight:0,maxHeight:"none",overflow:"hidden",display:"flex",flexDirection:"column"}};export{i as getFixedPanelStyle,r as getFixedWebContentStyle,c as getParentHeightGptBodyHeight,o as getParentHeightPanelStyle,t as resolveFixedHeightLayout};
|
|
2
2
|
//# sourceMappingURL=fixedHeight.utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import{Worker as o,Viewer as t}from"@react-pdf-viewer/core";import{pdfStyles as n}from"./PdfStyle.js";var i="https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js",l=function(l){var a=l.pdfUrl,d=l.plugins,f=l.onLoad,p=l.customStyles,m=l.onPageChange,s=l.defaultScale;return e("div",r({style:r(r({},n.pdfConatiner),null==p?void 0:p.pdfContainer)},{children:e(o,r({workerUrl:i},{children:e(t,{fileUrl:a,defaultScale:s,plugins:d,onDocumentLoad:f,onPageChange:m})}))}))};export{l as default,i as pdfWorker};
|
|
2
2
|
//# sourceMappingURL=PdfContainer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",width:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},header:{display:"flex",
|
|
1
|
+
var e={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",width:"100%",minWidth:0,boxSizing:"border-box",overflow:"hidden"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",width:"100%",minWidth:0,boxSizing:"border-box"},title:{fontSize:"14px",fontWeight:600,color:"#60A3F8",fontFamily:'Roboto, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'},toolbar:{display:"flex",alignItems:"center",gap:"8px",position:"relative"},button:{border:"1px solid #DFE5EC",borderRadius:"6px",padding:"4px 8px",fontSize:"12px",cursor:"pointer",backgroundColor:"#FFFFFF"},buttonDisabled:{opacity:.4,cursor:"not-allowed"},counter:{fontSize:"13px",color:"#64748B",margin:"0 6px"},viewerWrapper:{height:"30rem",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid #DEE4EB",borderRadius:"8px"},emptyState:{fontSize:"14px",color:"#EF4444"},pdfConatiner:{height:"100%",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center"}};export{e as pdfStyles};
|
|
2
2
|
//# sourceMappingURL=PdfStyle.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import i from"react";import{pdfStyles as o}from"./PdfStyle.js";import{DefaultPdfIcon as r,DefaultFullScreenIcon as l,DefaultDownloadIcon as d,DefaultCloseIcon as a}from"../../assests/svg/PdfViewerIcons.js";import s
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import i from"react";import{pdfStyles as o}from"./PdfStyle.js";import{DefaultPdfIcon as r,DefaultFullScreenIcon as l,DefaultDownloadIcon as d,DefaultCloseIcon as a}from"../../assests/svg/PdfViewerIcons.js";import{Tooltip as s}from"@mui/material";import{Info as c}from"lucide-react";var p=function(p){p.highlightIndex;var h=p.totalHighlights,u=p.controls,g=p.currentPosition,f=p.pdfName,x=p.onClose,m=p.pdfUrl,v=p.viewerRef,y=p.customStyles,b=p.customClasses,w=p.customIcons,k=p.headerAction,S=p.isZoomEnabled,F=void 0===S||S,I=p.showHighlightsAction,C=void 0===I||I,D=p.showFullScreenAction,W=void 0===D||D,E=p.currentSegment,B=p.segmentTooltipText,j=void 0===B?"Details of current segment":B,z=p.currentPage,A=p.totalPages,L=p.onPageNavigate,P=u.ZoomInButton,N=u.ZoomOutButton,R=u.ZoomPopover,T=u.goToPrevious,H=u.goToNext,O=i.useState(String(z)),M=O[0],Z=O[1];i.useEffect(function(){Z(String(z))},[z]);var _={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},V=function(e){return String(e).padStart(2,"0")};return t("div",e({style:e(e(e({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},o.header),null==y?void 0:y.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:0}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0,overflow:"hidden"}},{children:[n("div",e({style:e(e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==y?void 0:y.pdfIconWrapper),{flexShrink:0})},{children:(null==w?void 0:w.pdfIcon)||n(r,{})})),n(s,e({title:f||"",arrow:!0,placement:"top"},{children:n("div",e({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n("span",e({style:e({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==y?void 0:y.pdfName),className:null==b?void 0:b.pdfName},{children:f}))}))}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:C?"16px":"2px",color:"#4B5563",flexShrink:0,whiteSpace:"nowrap",minWidth:"fit-content"}},{children:[A>0&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:M,onChange:function(e){var t=e.target.value.replace(/\D/g,"");Z(t)},onBlur:function(){var e=Number(M);if(!Number.isInteger(e)||e<1)Z(String(z));else{var t=A?Math.min(e,A):e;L(t),Z(String(t))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(Z(String(z)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(A)}))]})),F&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n(N,{}),n("div",e({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n(R,{})})),n(P,{})]})),!!h&&C&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[t("span",e({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[g," of ",h]})),n("button",e({style:{background:"none",border:"none",cursor:g<=1?"not-allowed":"pointer",padding:"2px 4px",color:g<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:T,disabled:g<=1},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n("button",e({style:{background:"none",border:"none",cursor:g===h?"not-allowed":"pointer",padding:"2px 4px",color:g===h?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:H,disabled:g===h},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),t("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==W&&((null==k?void 0:k.icon)&&(null==k?void 0:k.onClick)?n(s,e({title:(null==k?void 0:k.tooltip)||"",arrow:!0,placement:"top"},{children:n("div",e({onClick:k.onClick,style:e({display:"flex",alignItems:"center",cursor:"pointer"},_)},{children:k.icon}))})):n("button",e({onClick:function(){var e=null==v?void 0:v.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:_,title:"Full Screen"},{children:(null==w?void 0:w.fullScreenIcon)||n(l,{})}))),m&&n("a",e({href:m,target:"_blank",rel:"noopener noreferrer",style:_,title:"Open in new tab"},{children:(null==w?void 0:w.downloadIcon)||n(d,{})})),x&&n("button",e({onClick:x,style:_,title:"Close"},{children:(null==w?void 0:w.closeIcon)||n(a,{})}))]}))]}))]})),E&&t("div",e({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n(s,e({title:j,arrow:!0,placement:"top"},{children:n(c,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),t("span",e({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:["Viewing ",E.title," • Pages ",V(E.start_page),"-",V(E.end_page)]}))]}))]}))};export{p as default};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{SpecialZoomLevel as r}from"@react-pdf-viewer/core";import a from"./PdfContainer.js";import l from"./PdfToolbar.js";import{pdfStyles as s}from"./PdfStyle.js";import{PdfHighlightControls as c}from"./usePdfHighlight.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import{useRef as u,useState as d,useMemo as g,useEffect as f}from"react";import h from"../ScannedDocCitation/ScannedDocCitation.js";var m=function(e){switch(e){case"ActualSize":return r.ActualSize;case"PageFit":return r.PageFit;case"PageWidth":return r.PageWidth;default:return null!=e?e:r.PageWidth}},v=function(v){var p,x=v.pdfUrl,P=v.highlightText,T=v.highlightPages,C=v.highlightCordinatePages,w=v.highlightColor,S=void 0===w?"yellow":w,y=v.activeHighlightColor,A=void 0===y?"#f7dc51":y,b=v.jumpToPageValue,H=void 0===b?0:b,I=v.pdfName,_=v.onClose,j=v.customStyles,F=v.customClasses,N=v.customIcons,z=v.useCoordinates,D=v.fallbackPages,R=v.activeCitationIndex,V=v.onActiveCitationChange,W=v.headerAction,q=v.isZoomEnabled,E=void 0===q||q,B=v.showHighlightsAction,O=void 0===B||B,U=v.defaultScale,k=void 0===U?r.ActualSize:U,M=v.useRange,Z=void 0!==M&&M,J=v.rangeOfPages,K=void 0===J?null:J,L=v.showFullScreenAction,G=void 0===L||L,Q=v.segments,X=void 0===Q?[{title:"Document 2",start_page:52,end_page:52,page_count:1}]:Q,Y=v.segmentTooltipText,$=u(null),ee=d(0),te=ee[0],ie=ee[1],oe=d(0),ne=oe[0],re=oe[1],ae=g(function(){if(z)return new Set(C.map(function(e){return e.pageIndex}));var e=new Set;return Object.values(T).forEach(function(t){t>0&&e.add(t-1)}),e},[C,T,z]),le=(p=P)&&0!==p.length?p.filter(function(e){return!p.some(function(t){return t!==e&&t.includes(e)})}):p,se=c(le,z?{}:T,$,ae,z,z?C:[],S,A),ce=se.highlightIndex,ue=se.cursorIndex,de=se.setCursorIndex,ge=se.orderedKeys,fe=se.totalHighlights,he=se.getValidPosition,me=se.tryJump,ve=se.jumpToPage,pe=se.zoomTo,xe=se.plugins,Pe=se.controls,Te=se.hideNonTargetHighlights,Ce=se.deduplicateHighlights,we=he(ue),Se=g(function(){var e=te+1;return X.find(function(t){return e>=t.start_page&&e<=t.end_page})},[te,X]);f(function(){void 0!==R&&R!==ue&&de(R)},[R]);var ye=e(e({},Pe),{goToNext:function(){ue>=fe-1||(Pe.goToNext(),V&&V(ue+1))},goToPrevious:function(){ue<=0||(Pe.goToPrevious(),V&&V(ue-1))}});if(!x)return o(h,{pages:D,activeCitationIndex:R,onActiveCitationChange:V,headerAction:W});return n("div",e({ref:$,className:(null==F?void 0:F.pdfViewerWrapper)||"",style:e(e(e({height:"100%",minHeight:0,minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column"},s.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==j?void 0:j.pdfViewer)},{children:[o(l,{highlightIndex:ce,totalHighlights:fe,controls:ye,currentPosition:we,pdfName:I,onClose:_,pdfUrl:x,viewerRef:$,customStyles:j,customClasses:F,customIcons:N,headerAction:W,isZoomEnabled:E,showHighlightsAction:O,showFullScreenAction:G,currentSegment:Se,segmentTooltipText:Y,currentPage:te+1,totalPages:ne,onPageNavigate:function(e){var t=Math.min(Math.max(e,1),ne||e);ie(t-1),ve(t-1)}}),o(a,{defaultScale:m(k),pdfUrl:x,plugins:xe,customStyles:j,onLoad:function(e){re(e.doc.numPages);var o=!z&&!Z&&H<=0;if(pe(r.ActualSize),H>0&&!Z){var n=H-1,a=ge[n],l=T[a],s=C[n];de(n),console.log(s,"cordinateTargetHighlight"),z&&s.pageIndex>0&&ve(s.pageIndex),l>0&&(setTimeout(function(){Te(ae),Ce(l-1)},1e3),z||ve(l-1))}else if(Z&&K&&2===K.length){t(void 0,void 0,void 0,function(){var e,t,o,n,r;return i(this,function(i){switch(i.label){case 0:e=K[0],t=K[1],o=e,i.label=1;case 1:return o<=t?(ve(n=o-1),[4,new Promise(function(e){return setTimeout(e,1e3)})]):[3,4];case 2:if(i.sent(),Te(ae),(r=Ce(n))&&r>0)return[3,4];i.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}else if(!z&&T){var c=ge.find(function(e){return T[e]>0});if(void 0!==c){var u=T[c]-1;ve(u),setTimeout(function(){Te(ae),Ce(u)},1e3)}}requestAnimationFrame(function(){o&&me(),!z&&H>0&&!Z&&function(){if($.current){var e=H-1,t=ge[e],i=T[t],o=i>0?i-1:0,n={};ge.forEach(function(e,t){var i=T[e];i>0&&(n[i]||(n[i]=[]),n[i].push(t))});var r=(n[i]||[]).indexOf(e),a=0,l=function(){var e,t;if(!(++a>40)){var i=null===(e=$.current)||void 0===e?void 0:e.querySelector(".rpv-core__inner-pages");if(i){var n=null===(t=$.current)||void 0===t?void 0:t.querySelector('[data-testid="core__page-layer-'.concat(o,'"]'));if(n){var s=i.getBoundingClientRect(),c=n.getBoundingClientRect();if(c.top<s.bottom&&c.bottom>s.top){var u=n.querySelectorAll(".rpv-search__highlight")[r];if(u){var d=u.getBoundingClientRect(),g=i.scrollTop+(d.top-s.top)-i.clientHeight/2+d.height/2;i.scrollTo({top:g,behavior:"smooth"})}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}else setTimeout(l,100)}};setTimeout(l,500)}}()})},onPageChange:function(e){var t=e.currentPage;ie(t),ae.has(t)?(Ce(t),Te(ae)):Te(ae)}})]}))};export{v as default};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{
|
|
1
|
+
export{default as CodeCitation}from"./features/CodeCitation/CodeCitation.js";export{default as ProjectAccordian}from"./features/ProjectAccordion/ProjectAccordion.js";export{default as BookCitation}from"./features/BookCitation/BookCitation.js";export{default as Bookemon}from"./features/Bookemon/Bookemon.js";export{PdfEditorCitation as PdfCitation}from"./features/PdfEditorCitation/PdfEditorCitation.js";export{default as CitationRenderer}from"./features/CitationRenderer/CitationRenderer.js";export{default as MarkdownRenderer}from"./features/CitationRenderer/MarkdownRenderer.js";export{DiagnosticSeverity}from"./features/CodeCitation/_components/CodeEditor.js";export{default as PaginatedTable}from"./features/PaginatedTable/PaginatedTable.js";export{default as InternalgptReasoningComponent,default as NonWebReasoningComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";export{default as ChatCitation}from"./features/ChatCitation/ChatCitationRenderer.js";export{default as CognitiveDecisioningCard}from"./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js";export{default as PdfViewer}from"./features/PdfViewer/PdfViewer.js";export{default as FaqCitation}from"./features/CognitiveDecisioning/FaqCitation/FaqCitation.js";export{default as ImageCitationContent}from"./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js";export{default as VideoCitationContent}from"./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js";export{default as FileCitationContent}from"./features/RequirementAiCitations/FileCitation/FileCitationContent.js";export{default as WebCitationWithImageContent}from"./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";export{default as MarkdownWithImageCitation}from"./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js";export{default as AiReasoningCitation}from"./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js";export{default as TableCitationContent}from"./features/TableCitation/TableCitationContent.js";export{default as CitationsViewer}from"./features/CitationViewer/CitationsViewer.js";export{default as ExcelCitation}from"./features/ExcelCitation/ExcelCitations.js";export{default as ScannedDocCitation}from"./features/ScannedDocCitation/ScannedDocCitation.js";export{default as ChatDrawer}from"./features/ChatDrawer/ChatDrawer.js";export{FILE_INGESTION_STATUS,SUMMARY_EXPAND_HEIGHT_NUDGE,TRUNCATE_THRESHOLD}from"./features/ChatDrawer/constants/ChatDrawer.js";export{default as SplitterCitationsComponent}from"./features/SplitterCitations/SplitterCitationsComponent.js";export{SourcesBQCitation,findSourceCitation,parseSourcesBQHref}from"./features/DualCitation/SourceBQDataCompnent.js";export{default as CognitiveCompare}from"./features/CognitiveCompare/CognitiveCompare.js";export{default as CognitiveInternalgptCoreComponent}from"./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js";export{default as TextualGuideLinesComponent}from"./features/TextualGuidelines/TextualGuideLinesComponent.js";export{default as RuleBookCitationWrapper}from"./features/RulebookCitations/RuleBookCitationWrapper.js";export{IngestionStatusChip,IngestionStatusComponent}from"./features/IngestionStatus/IngestionStatusComponent.js";export{ManageReminders}from"./features/ManageRemainders/ManageReminders.js";export{default as PromptemonBlockViewer}from"./features/PromptemonBlockViewer/PromptemonBlockViewer.js";export{default as PromptemonViewer}from"./features/PromptemonViewer/PromptemonViewer.js";export{default as SPBAnalysisPanel}from"./features/SPBAnalysisPanel/Spbanalysispanel.js";export{default as GptWebCitation}from"./features/GptWebCitation/GptWebCitation.js";export{useOnDemandCitationFetch}from"./hooks/useOnDemandCitationFetch.js";export{default as InstantLearningCitationWrapper}from"./features/InstantLearningCitation/InstantLearningCitationComponent.js";export{default as BPACitationRenderer}from"./features/BPACitationRenderer/BPACitationRenderer.js";export{extractLearnedFromUrl,extractRelevanceScoreFromContent,extractTopicFromContent,getWebCitationImageUrl,mapCitationDataToDisplay,resolveSkeletonVisitUrl,sanitizeExternalUrl}from"./features/GptWebCitation/utils/citationData.utils.js";export{CitationType,allowsGptCitationView,allowsWebCitationView,showsCitationViewToggle}from"./features/GptWebCitation/types.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;
|
|
1
|
+
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAcf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAgeD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgOjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CognitiveCompareProps } from "./CognitiveCompareTypes";
|
|
2
2
|
import { SHARED_MARKDOWN_STYLES } from "./CognitiveCompareConfig";
|
|
3
|
-
declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, resetTrigger, displayConfig, onMaintainRelativeOrderChange, popupConfig, deviationData, deviationNodeIdToView, resetDeviationNodeId, isProposingFix, proposingFixNodeId, isRedlineFlow, badgeStyleOverride, guidelinesData, gptWebCitationConfig }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CognitiveCompare: ({ componentHeaderText, treeData, comparisonConfig, leftColumnTitleText, rightColumnTitleText, markdownStyles, resetTrigger, displayConfig, onMaintainRelativeOrderChange, popupConfig, deviationData, deviationNodeIdToView, resetDeviationNodeId, isProposingFix, proposingFixNodeId, isRedlineFlow, badgeStyleOverride, guidelinesData, isGuidelineMode: isGuidelineModeFromParent, gptWebCitationConfig }: CognitiveCompareProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { SHARED_MARKDOWN_STYLES };
|
|
5
5
|
export default CognitiveCompare;
|
|
6
6
|
//# sourceMappingURL=CognitiveCompare.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAEL,qBAAqB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"CognitiveCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompare.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAEL,qBAAqB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAgClC,QAAA,MAAM,gBAAgB,iZA8BnB,qBAAqB,4CAg/FvB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,eAAe,gBAAgB,CAAC"}
|
|
@@ -102,7 +102,7 @@ export interface GptWebCitationConfig {
|
|
|
102
102
|
headers?: Record<string, string>;
|
|
103
103
|
}
|
|
104
104
|
export interface CognitiveCompareProps {
|
|
105
|
-
guidelinesData?: Record<string, any> | null;
|
|
105
|
+
guidelinesData?: string | Record<string, any> | null;
|
|
106
106
|
gptWebCitationConfig?: GptWebCitationConfig;
|
|
107
107
|
isGuidelineMode?: boolean;
|
|
108
108
|
componentHeaderText?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,0BAA0B,EAAE;QAC1B,OAAO,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GACV,uBAAuB,GACvB;gBAAE,KAAK,EAAE,MAA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AoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,KAAK;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;CAAE,GAAG,IAAI,CAAC;AAElI,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTypes.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CognitiveCompareTypes.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,0BAA0B,EAAE;QAC1B,OAAO,EAAE;YACP,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;QACF,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GACV,uBAAuB,GACvB;gBAAE,KAAK,EAAE,MAAM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