@viswa-test/test-citation 0.0.75 → 0.0.76
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/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/CitationAnchor.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationAnchor.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),l=require("react"),t=require("./ResizableSplitPane.js"),o=require("../PdfViewer/PdfViewer.js"),r=require("../../assests/svg/PdfViewerIcons.js"),a=function(n){var l,r,a,d,s,u,c,g,v,p,h,f=n.href,x=n.metaData,_=n.citationTitle,m=n.isFullscreen,b=function(e){try{return new URL(e,window.location.origin).searchParams.get("citationNumber")}catch(e){return null}}(f);if(!b)return null;var j=(null===(l=null==x?void 0:x.citations)||void 0===l?void 0:l[b])||{},y=(null===(r=null==x?void 0:x.docData)||void 0===r?void 0:r.documents)||{},C=(null===(a=null==x?void 0:x.docData)||void 0===a?void 0:a.input_index_map)||{},w=null==C?void 0:C[0],F=null==C?void 0:C[1],P=w?y[w]:null,S=F?y[F]:null,D=w?j[w]:null,k=F?j[F]:null;if(["contract","clause"].includes(_)){var z=D?i.jsx(o.default,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:P.title,pdfUrl:P.signed_url,highlightText:[null!==(d=null==D?void 0:D.highlighted_text)&&void 0!==d?d:""],highlightPages:{1:null===(s=null==D?void 0:D.custom_metadata)||void 0===s?void 0:s.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(u=null==D?void 0:D.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number,null===(c=null==D?void 0:D.custom_metadata)||void 0===c?void 0:c.pdf_end_page_number]}):null,R=k?i.jsx(o.default,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:S.title,pdfUrl:S.signed_url,jumpToPageValue:1,highlightText:[null!==(g=null==k?void 0:k.highlighted_text)&&void 0!==g?g:""],highlightPages:{1:null===(v=null==k?void 0:k.custom_metadata)||void 0===v?void 0:v.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(p=null==k?void 0:k.custom_metadata)||void 0===p?void 0:p.pdf_start_page_number,null===(h=null==k?void 0:k.custom_metadata)||void 0===h?void 0:h.pdf_end_page_number]}):null;return D||k?i.jsx("div",e.__assign({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:i.jsx(t.default,{leftComponent:z,rightComponent:R,isFullscreen:m})})):i.jsx("div",{children:"Missing PDF Citation. Please try again later"})}return i.jsx("div",{children:"No Citation Found. Please try again later"})};exports.default=function(t){var o,d,s,u=t.href,c=t.children,g=t.metaData,v=t.chevronUpComponent,p=void 0===v?null:v,h=t.chevronDownComponent,f=void 0===h?null:h,x=t.customStyle,_=void 0===x?{}:x,m=t.defaultState,b=void 0!==m&&m,j=l.useState(b),y=j[0],C=j[1],w=l.useState(!1),F=w[0],P=w[1],S="string"==typeof c&&(null===(o=null==c?void 0:c.split("\n"))||void 0===o?void 0:o.length)>1?c.split("\n").join(" "):c,D="string"==typeof c?c:c[0],k=null!=p?p:function(e){var l,t;return i.jsx(n.ChevronUp,{size:null!==(l=null==e?void 0:e.fontSize)&&void 0!==l?l:16,color:null!==(t=null==e?void 0:e.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(d=null==_?void 0:_.arrow)&&void 0!==d?d:{}),z=null!=f?f:function(e){var l,t;return i.jsx(n.ChevronDown,{size:null!==(l=null==e?void 0:e.fontSize)&&void 0!==l?l:16,color:null!==(t=null==e?void 0:e.color)&&void 0!==t?t:"rgb(214, 51, 132)"})}(null!==(s=null==_?void 0:_.arrow)&&void 0!==s?s:{});return i.jsxs("span",e.__assign({style:e.__assign({display:"inline"},_.relativeWrapper||{})},{children:[i.jsx("div",e.__assign({style:e.__assign({display:"inline",marginTop:0},_.citationButtonWrapper||{})},{children:i.jsxs("button",e.__assign({type:"button",onClick:function(){return C(function(e){return!e})},style:e.__assign({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},_.citationButton||{})},{children:[i.jsx("span",{children:S}),i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:y?k:z}))]}))})),y&&i.jsxs("div",e.__assign({style:F?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"}},{children:[i.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:i.jsx("button",e.__assign({onClick:function(){P(function(e){return!e})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:F?i.jsx(r.DefaultFullScreenCloseIcon,{}):i.jsx(r.DefaultFullScreenIcon,{})}))})),i.jsx("div",e.__assign({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:i.jsx(a,{href:u,children:c,metaData:g,citationTitle:D,isFullscreen:F})}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),r=require("../CognitiveComparehelpers.js"),a=require("../CognitiveCompareConstants.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=d(i),u=function(e){var n=function(e){for(var n=(null==e?void 0:e.parentElement)||null;n;){var i=window.getComputedStyle(n).overflowY;if(("auto"===i||"scroll"===i)&&n.scrollHeight>n.clientHeight)return n;n=n.parentElement}return null}(e),i=e.getBoundingClientRect(),t=(null==n?void 0:n.getBoundingClientRect())||{top:0,bottom:window.innerHeight};return i.top>=t.top&&i.bottom<=t.bottom};exports.default=function(d){var c,v,f,p,g,h,x,m,_,y,b,w,I,S,R,A,E=d.section,C=d.idx,j=d.columnKey,D=d.colRef,F=d.mb,T=void 0===F?1:F,k=d.parentNodeId,B=void 0===k?"":k,O=d.isExpanded,M=d.onToggle,P=d.navigation,N=d.showOpenNodeRef,V=d.resolvedMarkdownStyles,W=d.maintainRelativeOrder,q=d.renderSubSections,G=d.treeData,z=d.proposedSections,H=void 0===z?[]:z,K=d.existingSections,Y=void 0===K?[]:K,L=d.deviationNumberRegistry,U=void 0===L?{}:L,X=d.getBadgeRef,$=d.openSummaryPopup,J=d.getSectionCompareStyle,Q=d.connectedSections,Z=d.openMoreFunctionsPopup,ee=d.deviationNodeIdToView,ne=d.deviationTargetParentId,ie=(null===(c=E.displayTitle)||void 0===c||c)&&r.hasValue(E.title),te=(null===(v=E.displayContent)||void 0===v||v)&&r.hasValue(E.content),oe=!ie&&!te,le={current:1},re=E.title;ie||(re=te?"No Title Found":"No Matching Section Found");var ae=E.evaluationResult;if(!ae&&"right"===j)if(W){var de=null===(f=E.refIndexes)||void 0===f?void 0:f[0],se=H.find(function(e){return e.selfIndex===de});ae=null==se?void 0:se.evaluationResult}else ae=null===(p=H[C])||void 0===p?void 0:p.evaluationResult;var ue=null===(g=null==G?void 0:G.input_index_map)||void 0===g?void 0:g[0],ce=null===(h=null==G?void 0:G.input_index_map)||void 0===h?void 0:h[1],ve="left"===j?ce:ue,fe="left"===j?E:H[C],pe="right"===j?E:Y[C];if(W)if("left"===j){var ge=null===(x=E.refIndexes)||void 0===x?void 0:x[0],he=Y.findIndex(function(e){return e.selfIndex===ge});pe=-1!==he?Y[he]:void 0}else{var xe=null===(m=E.refIndexes)||void 0===m?void 0:m[0],me=H.findIndex(function(e){return e.selfIndex===xe});fe=-1!==me?H[me]:void 0}var _e="left"===j?!pe:!fe,ye=ae||(null==fe?void 0:fe.evaluationResult)||(null==pe?void 0:pe.evaluationResult),be=null!==(b=null===(y=null===(_=null==ye?void 0:ye.evaluation_outputs)||void 0===_?void 0:_.metadata)||void 0===y?void 0:y.label_color)&&void 0!==b?b:a.DEFAULT_DEVIAION_COLOR,we=r.generateColorPalette(be),Ie=we.highlightBg,Se=null!==(I=null===(w=null==ye?void 0:ye.evaluation_outputs)||void 0===w?void 0:w.output_value)&&void 0!==I?I:null,Re=(null==ye?void 0:ye.deviations)||{},Ae=C+1,Ee=E.id;if("right"===j&&W){var Ce=null===(S=E.refIndexes)||void 0===S?void 0:S[0];-1!==(me=H.findIndex(function(e){return e.selfIndex===Ce}))&&(Ae=me+1,Ee=H[me].id)}var je,De=[],Fe=Object.entries(Re).map(function(n){var i,t,o,l=n[0],a=n[1],d="".concat(Ee).concat(r.DEVIATION_BADGE_SEPARATOR).concat(l),s=U[d];if(!s)return null;var u=a[B],c=r.isMissingStr(u);if(c)u="";else if(!u)return null;De.push(u);var v=a[ve],f="left"===j?null===(i=H[C])||void 0===i?void 0:i.content:null===(t=Y[C])||void 0===t?void 0:t.content,p=r.safeStringify(f),g=Object.keys(Re).map(function(e){return{key:e,text:Re[e][ve]}}).filter(function(e){return!r.isMissingStr(e.text)}).sort(function(e,n){return n.text.length-e.text.length}),h=new Set;g.forEach(function(e){var n=e.text.replace(/\\(['’])/g,"$1").replace(/\\n/g,"\n");if(n){var i=new RegExp(r.escapeRegExp(n));i.test(p)&&(h.add(e.key),p=p.replace(i,"__TOKEN_".concat(e.key,"__")))}});var x=!r.isMissingStr(v)&&!h.has(l),m=_e||r.isMissingStr(v)||x,_="".concat(Ae,".").concat(s),y="".concat(Ee).concat(r.DEVIATION_BADGE_SEPARATOR).concat(l).concat(r.DEVIATION_BADGE_SEPARATOR).concat(C).concat(r.DEVIATION_BADGE_SEPARATOR).concat(C),b=C;if("right"===j&&W){var w=null===(o=E.refIndexes)||void 0===o?void 0:o[0],I=H.findIndex(function(e){return e.selfIndex===w});-1!==I&&(b=I)}var S=J?J(b):null,R=S?e.__assign(e.__assign({},S),{badgeBg:we.badgeBg,badgeBorder:we.badgeBorder,badgeText:we.badgeText}):e.__assign({},we),A=(null==a?void 0:a.deviation_summary)?{deviation_summary:a.deviation_summary,deviation_title:null==ye?void 0:ye.deviation_title,evaluation_outputs:null==ye?void 0:ye.evaluation_outputs}:null;return{id:d,actionId:y,label:_,highlight:u,side:j,style:R,score:Se,isConnected:null==Q?void 0:Q.has(y),isOrphan:m,isMissingClause:c,badgeRef:X(j,d),onClick:function(e){e.stopPropagation(),Z&&Z(e,fe||{id:"orphan-left",title:"",content:""},m,pe||{id:"orphan-right",title:"",content:""},y,R)},onSummaryClick:function(e){e.stopPropagation(),$(e,y,m,A)}}}).filter(Boolean),Te=E.id&&j===(null==P?void 0:P.columnKey)?P:null,ke=s.default.useRef(!1);return i.useEffect(function(){O||(ke.current=!1)},[O]),i.useEffect(function(){var e=!!ee&&!!ne&&Ee===ne,n=!!ee&&(E.subsections||[]).some(function(e){return e.id===ee});if(O&&!ke.current&&!e&&!n){var i=setTimeout(function(){var e,n=null===(e=null==Te?void 0:Te.firstDeviationRef)||void 0===e?void 0:e.current,i=null==Te?void 0:Te.firstDeviationPosition;n?"inside"===i||u(n)?ke.current=!0:(ke.current=!0,n.scrollIntoView({behavior:"smooth",block:"center"})):ke.current=!0},600);return function(){return clearTimeout(i)}}},[O,ee,ne,Ee,null==Te?void 0:Te.firstDeviationPosition,null==Te?void 0:Te.firstDeviationRef]),n.jsxs(t.Box,e.__assign({ref:D,sx:{mb:T,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[O&&(null==Te?void 0:Te.showAbove)&&n.jsx("div",e.__assign({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Te?void 0:Te.showAboveRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:n.jsx("div",e.__assign({style:e.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===j?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===j?{right:"0px"}:{left:"0px"})},{children:n.jsx(o.ChevronUp,{color:window.getComputedStyle(null===(R=null==Te?void 0:Te.showAboveRef)||void 0===R?void 0:R.current).color})}))})),n.jsxs(t.Accordion,e.__assign({disableGutters:!0,expanded:!oe&&O,onChange:function(){oe||(M(),N.current=E.id)},sx:{boxShadow:"none",border:oe?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:oe?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flexGrow:1,width:"100%",display:"flex",flexDirection:"column",minWidth:0,"&:before":{display:"none"},"& .MuiAccordion-heading":{position:"sticky",top:-12,zIndex:10,background:"#fff"}}},{children:[n.jsx(t.AccordionSummary,e.__assign({expandIcon:oe?null:n.jsx(o.ChevronDown,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:oe?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:ie&&n.jsx(t.Tooltip,e.__assign({title:re,placement:"top"},{children:n.jsx(t.Typography,e.__assign({component:"div",sx:{fontSize:"12px",color:oe?"#94A3B8":"#19213D",fontWeight:oe?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(je=re,je?r.safeStringify(je).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,i){return e.startsWith("**")&&e.endsWith("**")?n.jsx("strong",{children:e.slice(2,-2)},i):n.jsx(s.default.Fragment,{children:e},i)}):null)}))}))})),!oe&&n.jsxs(t.AccordionDetails,e.__assign({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[te&&n.jsx(l.MemoizedMarkdown,{content:E.content,sxStyles:V,highlights:De,maintainRelativeOrder:W,highlightBg:Ie,deviationBadges:Fe}),(E.subsections||[]).map(function(e,n){return q({section:e,keyPath:"".concat(C,"-").concat(n),depth:0,columnKey:j,parentNodeId:B,devCounter:le})})]}))]})),O&&(null==Te?void 0:Te.showBelow)&&n.jsx("div",e.__assign({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Te?void 0:Te.showBelowRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:n.jsx("div",e.__assign({style:e.__assign({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===j?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===j?{right:"0px"}:{left:"0px"})},{children:n.jsx(o.ChevronDown,{color:window.getComputedStyle(null===(A=null==Te?void 0:Te.showBelowRef)||void 0===A?void 0:A.current).color})}))}))]}),"".concat(j,"-sec-").concat(C))};
|
|
2
2
|
//# sourceMappingURL=SectionAccordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as n,jsx as e}from"react/jsx-runtime";import{ChevronUp as l,ChevronDown as o}from"lucide-react";import{useState as t}from"react";import r from"./ResizableSplitPane.js";import d from"../PdfViewer/PdfViewer.js";import{DefaultFullScreenCloseIcon as a,DefaultFullScreenIcon as u}from"../../assests/svg/PdfViewerIcons.js";var s=function(n){var l,o,t,a,u,s,c,p,g,v,h,f=n.href,m=n.metaData,x=n.citationTitle,b=n.isFullscreen,_=function(i){try{return new URL(i,window.location.origin).searchParams.get("citationNumber")}catch(i){return null}}(f);if(!_)return null;var y=(null===(l=null==m?void 0:m.citations)||void 0===l?void 0:l[_])||{},w=(null===(o=null==m?void 0:m.docData)||void 0===o?void 0:o.documents)||{},C=(null===(t=null==m?void 0:m.docData)||void 0===t?void 0:t.input_index_map)||{},P=null==C?void 0:C[0],F=null==C?void 0:C[1],S=P?w[P]:null,D=F?w[F]:null,k=P?y[P]:null,j=F?y[F]:null;if(["contract","clause"].includes(x)){var z=k?e(d,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:S.title,pdfUrl:S.signed_url,highlightText:[null!==(a=null==k?void 0:k.highlighted_text)&&void 0!==a?a:""],highlightPages:{1:null===(u=null==k?void 0:k.custom_metadata)||void 0===u?void 0:u.pdf_start_page_number},jumpToPageValue:1,highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(s=null==k?void 0:k.custom_metadata)||void 0===s?void 0:s.pdf_start_page_number,null===(c=null==k?void 0:k.custom_metadata)||void 0===c?void 0:c.pdf_end_page_number]}):null,R=j?e(d,{defaultScale:"PageWidth",showFullScreenAction:!1,showHighlightsAction:!1,pdfName:D.title,pdfUrl:D.signed_url,jumpToPageValue:1,highlightText:[null!==(p=null==j?void 0:j.highlighted_text)&&void 0!==p?p:""],highlightPages:{1:null===(g=null==j?void 0:j.custom_metadata)||void 0===g?void 0:g.pdf_start_page_number},highlightCordinatePages:[],useCoordinates:!1,useRange:!0,rangeOfPages:[null===(v=null==j?void 0:j.custom_metadata)||void 0===v?void 0:v.pdf_start_page_number,null===(h=null==j?void 0:j.custom_metadata)||void 0===h?void 0:h.pdf_end_page_number]}):null;return e("div",k||j?i({style:{height:"100%",display:"flex",flexDirection:"column"}},{children:e(r,{leftComponent:z,rightComponent:R,isFullscreen:b})}):{children:"Missing PDF Citation. Please try again later"})}return e("div",{children:"No Citation Found. Please try again later"})},c=function(r){var d,c,p,g=r.href,v=r.children,h=r.metaData,f=r.chevronUpComponent,m=void 0===f?null:f,x=r.chevronDownComponent,b=void 0===x?null:x,_=r.customStyle,y=void 0===_?{}:_,w=r.defaultState,C=t(void 0!==w&&w),P=C[0],F=C[1],S=t(!1),D=S[0],k=S[1],j="string"==typeof v&&(null===(d=null==v?void 0:v.split("\n"))||void 0===d?void 0:d.length)>1?v.split("\n").join(" "):v,z="string"==typeof v?v:v[0],R=null!=m?m:function(i){var n,o;return e(l,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(o=null==i?void 0:i.color)&&void 0!==o?o:"rgb(214, 51, 132)"})}(null!==(c=null==y?void 0:y.arrow)&&void 0!==c?c:{}),T=null!=b?b:function(i){var n,l;return e(o,{size:null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:16,color:null!==(l=null==i?void 0:i.color)&&void 0!==l?l:"rgb(214, 51, 132)"})}(null!==(p=null==y?void 0:y.arrow)&&void 0!==p?p:{});return n("span",i({style:i({display:"inline"},y.relativeWrapper||{})},{children:[e("div",i({style:i({display:"inline",marginTop:0},y.citationButtonWrapper||{})},{children:n("button",i({type:"button",onClick:function(){return F(function(i){return!i})},style:i({display:"inline-flex",alignItems:"center",gap:"3px",fontFamily:'"Inter", sans-serif',backgroundColor:"transparent",padding:0,margin:0,fontSize:"13px",borderRadius:9999,cursor:"pointer",fontWeight:700,color:"rgb(214, 51, 132)",border:"none",textDecoration:"none",wordBreak:"break-word",whiteSpace:"normal"},y.citationButton||{})},{children:[e("span",{children:j}),e("span",i({style:{display:"flex",alignItems:"center"}},{children:P?R:T}))]}))})),P&&n("div",i({style:D?{position:"fixed",inset:0,zIndex:999999,backgroundColor:"#FAFAFA",display:"flex",flexDirection:"column"}:{boxSizing:"border-box",border:"1px solid #E4E7EC",borderRadius:"8px",overflow:"hidden",marginTop:"8px",display:"flex",flexDirection:"column",width:"100%"}},{children:[e("div",i({style:{display:"flex",justifyContent:"flex-end",padding:"6px 10px",borderBottom:"1px solid #E4E7EC",backgroundColor:"#FFFFFF",flexShrink:0}},{children:e("button",i({onClick:function(){k(function(i){return!i})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:"6px",color:"#475467",marginRight:"9px"}},{children:e(D?a:u,{})}))})),e("div",i({style:{flex:1,minHeight:0,height:"100%",overflow:"hidden"}},{children:e(s,{href:g,children:v,metaData:h,citationTitle:z,isFullscreen:D})}))]}))]}))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=CitationAnchor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useEffect as i}from"react";import{Box as l,Accordion as r,AccordionSummary as d,Tooltip as a,Typography as u,AccordionDetails as c}from"@mui/material";import{ChevronUp as s,ChevronDown as v}from"lucide-react";import{MemoizedMarkdown as f}from"../hooks/memoizedMarkdown.js";import{hasValue as p,generateColorPalette as m,isMissingStr as h,safeStringify as g,escapeRegExp as x,DEVIATION_BADGE_SEPARATOR as b}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as y}from"../CognitiveCompareConstants.js";var w=function(e){var n=function(e){for(var n=(null==e?void 0:e.parentElement)||null;n;){var o=window.getComputedStyle(n).overflowY;if(("auto"===o||"scroll"===o)&&n.scrollHeight>n.clientHeight)return n;n=n.parentElement}return null}(e),o=e.getBoundingClientRect(),t=(null==n?void 0:n.getBoundingClientRect())||{top:0,bottom:window.innerHeight};return o.top>=t.top&&o.bottom<=t.bottom},I=function(I){var R,S,F,k,C,_,B,A,T,E,M,W,D,N,O,P,j=I.section,z=I.idx,H=I.columnKey,K=I.colRef,V=I.mb,Y=void 0===V?1:V,G=I.parentNodeId,X=void 0===G?"":G,$=I.isExpanded,q=I.onToggle,J=I.navigation,L=I.showOpenNodeRef,Q=I.resolvedMarkdownStyles,U=I.maintainRelativeOrder,Z=I.renderSubSections,ee=I.treeData,ne=I.proposedSections,oe=void 0===ne?[]:ne,te=I.existingSections,ie=void 0===te?[]:te,le=I.deviationNumberRegistry,re=void 0===le?{}:le,de=I.getBadgeRef,ae=I.openSummaryPopup,ue=I.getSectionCompareStyle,ce=I.connectedSections,se=I.openMoreFunctionsPopup,ve=I.deviationNodeIdToView,fe=I.deviationTargetParentId,pe=(null===(R=j.displayTitle)||void 0===R||R)&&p(j.title),me=(null===(S=j.displayContent)||void 0===S||S)&&p(j.content),he=!pe&&!me,ge={current:1},xe=j.title;pe||(xe=me?"No Title Found":"No Matching Section Found");var be=j.evaluationResult;if(!be&&"right"===H)if(U){var ye=null===(F=j.refIndexes)||void 0===F?void 0:F[0],we=oe.find(function(e){return e.selfIndex===ye});be=null==we?void 0:we.evaluationResult}else be=null===(k=oe[z])||void 0===k?void 0:k.evaluationResult;var Ie=null===(C=null==ee?void 0:ee.input_index_map)||void 0===C?void 0:C[0],Re=null===(_=null==ee?void 0:ee.input_index_map)||void 0===_?void 0:_[1],Se="left"===H?Re:Ie,Fe="left"===H?j:oe[z],ke="right"===H?j:ie[z];if(U)if("left"===H){var Ce=null===(B=j.refIndexes)||void 0===B?void 0:B[0],_e=ie.findIndex(function(e){return e.selfIndex===Ce});ke=-1!==_e?ie[_e]:void 0}else{var Be=null===(A=j.refIndexes)||void 0===A?void 0:A[0],Ae=oe.findIndex(function(e){return e.selfIndex===Be});Fe=-1!==Ae?oe[Ae]:void 0}var Te="left"===H?!ke:!Fe,Ee=be||(null==Fe?void 0:Fe.evaluationResult)||(null==ke?void 0:ke.evaluationResult),Me=null!==(M=null===(E=null===(T=null==Ee?void 0:Ee.evaluation_outputs)||void 0===T?void 0:T.metadata)||void 0===E?void 0:E.label_color)&&void 0!==M?M:y,We=m(Me),De=We.highlightBg,Ne=null!==(D=null===(W=null==Ee?void 0:Ee.evaluation_outputs)||void 0===W?void 0:W.output_value)&&void 0!==D?D:null,Oe=(null==Ee?void 0:Ee.deviations)||{},Pe=z+1,je=j.id;if("right"===H&&U){var ze=null===(N=j.refIndexes)||void 0===N?void 0:N[0];-1!==(Ae=oe.findIndex(function(e){return e.selfIndex===ze}))&&(Pe=Ae+1,je=oe[Ae].id)}var He,Ke=[],Ve=Object.entries(Oe).map(function(n){var o,t,i,l=n[0],r=n[1],d="".concat(je).concat(b).concat(l),a=re[d];if(!a)return null;var u=r[X],c=h(u);if(c)u="";else if(!u)return null;Ke.push(u);var s=r[Se],v="left"===H?null===(o=oe[z])||void 0===o?void 0:o.content:null===(t=ie[z])||void 0===t?void 0:t.content,f=g(v),p=Object.keys(Oe).map(function(e){return{key:e,text:Oe[e][Se]}}).filter(function(e){return!h(e.text)}).sort(function(e,n){return n.text.length-e.text.length}),m=new Set;p.forEach(function(e){var n=e.text.replace(/\\(['’])/g,"$1").replace(/\\n/g,"\n");if(n){var o=new RegExp(x(n));o.test(f)&&(m.add(e.key),f=f.replace(o,"__TOKEN_".concat(e.key,"__")))}});var y=!h(s)&&!m.has(l),w=Te||h(s)||y,I="".concat(Pe,".").concat(a),R="".concat(je).concat(b).concat(l).concat(b).concat(z).concat(b).concat(z),S=z;if("right"===H&&U){var F=null===(i=j.refIndexes)||void 0===i?void 0:i[0],k=oe.findIndex(function(e){return e.selfIndex===F});-1!==k&&(S=k)}var C=ue?ue(S):null,_=C?e(e({},C),{badgeBg:We.badgeBg,badgeBorder:We.badgeBorder,badgeText:We.badgeText}):e({},We),B=(null==r?void 0:r.deviation_summary)?{deviation_summary:r.deviation_summary,deviation_title:null==Ee?void 0:Ee.deviation_title,evaluation_outputs:null==Ee?void 0:Ee.evaluation_outputs}:null;return{id:d,actionId:R,label:I,highlight:u,side:H,style:_,score:Ne,isConnected:null==ce?void 0:ce.has(R),isOrphan:w,isMissingClause:c,badgeRef:de(H,d),onClick:function(e){e.stopPropagation(),se&&se(e,Fe||{id:"orphan-left",title:"",content:""},w,ke||{id:"orphan-right",title:"",content:""},R,_)},onSummaryClick:function(e){e.stopPropagation(),ae(e,R,w,B)}}}).filter(Boolean),Ye=j.id&&H===(null==J?void 0:J.columnKey)?J:null,Ge=t.useRef(!1);return i(function(){$||(Ge.current=!1)},[$]),i(function(){var e=!!ve&&!!fe&&je===fe,n=!!ve&&(j.subsections||[]).some(function(e){return e.id===ve});if($&&!Ge.current&&!e&&!n){var o=setTimeout(function(){var e,n=null===(e=null==Ye?void 0:Ye.firstDeviationRef)||void 0===e?void 0:e.current,o=null==Ye?void 0:Ye.firstDeviationPosition;n?"inside"===o||w(n)?Ge.current=!0:(Ge.current=!0,n.scrollIntoView({behavior:"smooth",block:"center"})):Ge.current=!0},600);return function(){return clearTimeout(o)}}},[$,ve,fe,je,null==Ye?void 0:Ye.firstDeviationPosition,null==Ye?void 0:Ye.firstDeviationRef]),n(l,e({ref:K,sx:{mb:Y,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[$&&(null==Ye?void 0:Ye.showAbove)&&o("div",e({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Ye?void 0:Ye.showAboveRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:o("div",e({style:e({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===H?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===H?{right:"0px"}:{left:"0px"})},{children:o(s,{color:window.getComputedStyle(null===(O=null==Ye?void 0:Ye.showAboveRef)||void 0===O?void 0:O.current).color})}))})),n(r,e({disableGutters:!0,expanded:!he&&$,onChange:function(){he||(q(),L.current=j.id)},sx:{boxShadow:"none",border:he?"1px dashed #E2E8F0":"1px solid #E2E8F0",bgcolor:he?"#FAFAFA":"#FFFFFF",borderRadius:"6px",flexGrow:1,width:"100%",display:"flex",flexDirection:"column",minWidth:0,"&:before":{display:"none"},"& .MuiAccordion-heading":{position:"sticky",top:-12,zIndex:10,background:"#fff"}}},{children:[o(d,e({expandIcon:he?null:o(v,{size:16}),sx:{minHeight:"36px",flexShrink:0,cursor:he?"default":"pointer","& .MuiAccordionSummary-content":{my:.5,display:"grid",alignItems:"center",minWidth:0,width:"100%"},"& .MuiAccordionSummary-expandIconWrapper":{transition:"transform 0.2s ease"},"& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(180deg)"}}},{children:pe&&o(a,e({title:xe,placement:"top"},{children:o(u,e({component:"div",sx:{fontSize:"12px",color:he?"#94A3B8":"#19213D",fontWeight:he?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0}},{children:(He=xe,He?g(He).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,n){return e.startsWith("**")&&e.endsWith("**")?o("strong",{children:e.slice(2,-2)},n):o(t.Fragment,{children:e},n)}):null)}))}))})),!he&&n(c,e({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[me&&o(f,{content:j.content,sxStyles:Q,highlights:Ke,maintainRelativeOrder:U,highlightBg:De,deviationBadges:Ve}),(j.subsections||[]).map(function(e,n){return Z({section:e,keyPath:"".concat(z,"-").concat(n),depth:0,columnKey:H,parentNodeId:X,devCounter:ge})})]}))]})),$&&(null==Ye?void 0:Ye.showBelow)&&o("div",e({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Ye?void 0:Ye.showBelowRef)||void 0===e?void 0:e.current)||void 0===n?void 0:n.scrollIntoView({behavior:"smooth",block:"center"})}},{children:o("div",e({style:e({transform:"translateY(-50%) translateX(calc(100% ".concat("left"===H?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===H?{right:"0px"}:{left:"0px"})},{children:o(v,{color:window.getComputedStyle(null===(P=null==Ye?void 0:Ye.showBelowRef)||void 0===P?void 0:P.current).color})}))}))]}),"".concat(H,"-sec-").concat(z))};export{I as default};
|
|
2
2
|
//# sourceMappingURL=SectionAccordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,oBAAoB,+
|
|
1
|
+
{"version":3,"file":"CognitiveCompareTest.d.ts","sourceRoot":"","sources":["../../../src/CognitiveCompareTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,oBAAoB,+CA+FzB,CAAA;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA;AAEnF,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"CommonConstants.d.ts","sourceRoot":"","sources":["../../../../src/CommonConstants/CommonConstants.tsx"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAC5C,eAAO,MAAM,OAAO,EAAE,aAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,EAAE,aAAuB,CAAC;AAChD,eAAO,MAAM,6BAA6B,yCAAyC,CAAA;AAEnF,eAAO,MAAM,iBAAiB,EAAE,GAuwZ/B,CAAA"}
|
|
@@ -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;AAKf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"CitationAnchor.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveCompare/CitationAnchor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EACV,aAAa,EAKhB,MAAM,OAAO,CAAC;AAKf,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACV,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACnC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AA6FD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiKjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|