@viswa-test/test-citation 0.0.74 → 0.0.75
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.
|
@@ -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"),o=require("@mui/material"),t=require("lucide-react"),l=require("../hooks/memoizedMarkdown.js"),r=require("../CognitiveComparehelpers.js"),d=require("../CognitiveCompareConstants.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(i);exports.default=function(a){var u,c,v,f,p,g,h,x,m,_,y,b,I,w,S,A,R=a.section,E=a.idx,j=a.columnKey,C=a.colRef,F=a.mb,k=void 0===F?1:F,D=a.parentNodeId,O=void 0===D?"":D,T=a.isExpanded,B=a.onToggle,M=a.navigation,N=a.showOpenNodeRef,P=a.resolvedMarkdownStyles,V=a.maintainRelativeOrder,W=a.renderSubSections,q=a.treeData,G=a.proposedSections,z=void 0===G?[]:G,K=a.existingSections,L=void 0===K?[]:K,U=a.deviationNumberRegistry,X=void 0===U?{}:U,Y=a.getBadgeRef,H=a.openSummaryPopup,$=a.getSectionCompareStyle,J=a.connectedSections,Q=a.openMoreFunctionsPopup,Z=a.deviationNodeIdToView,ee=a.deviationTargetParentId,ne=(null===(u=R.displayTitle)||void 0===u||u)&&r.hasValue(R.title),ie=(null===(c=R.displayContent)||void 0===c||c)&&r.hasValue(R.content),oe=!ne&&!ie,te={current:1},le=R.title;ne||(le=ie?"No Title Found":"No Matching Section Found");var re=R.evaluationResult;if(!re&&"right"===j)if(V){var de=null===(v=R.refIndexes)||void 0===v?void 0:v[0],ae=z.find(function(e){return e.selfIndex===de});re=null==ae?void 0:ae.evaluationResult}else re=null===(f=z[E])||void 0===f?void 0:f.evaluationResult;var se=null===(p=null==q?void 0:q.input_index_map)||void 0===p?void 0:p[0],ue=null===(g=null==q?void 0:q.input_index_map)||void 0===g?void 0:g[1],ce="left"===j?ue:se,ve="left"===j?R:z[E],fe="right"===j?R:L[E];if(V)if("left"===j){var pe=null===(h=R.refIndexes)||void 0===h?void 0:h[0],ge=L.findIndex(function(e){return e.selfIndex===pe});fe=-1!==ge?L[ge]:void 0}else{var he=null===(x=R.refIndexes)||void 0===x?void 0:x[0],xe=z.findIndex(function(e){return e.selfIndex===he});ve=-1!==xe?z[xe]:void 0}var me="left"===j?!fe:!ve,_e=re||(null==ve?void 0:ve.evaluationResult)||(null==fe?void 0:fe.evaluationResult),ye=null!==(y=null===(_=null===(m=null==_e?void 0:_e.evaluation_outputs)||void 0===m?void 0:m.metadata)||void 0===_?void 0:_.label_color)&&void 0!==y?y:d.DEFAULT_DEVIAION_COLOR,be=r.generateColorPalette(ye),Ie=be.highlightBg,we=null!==(I=null===(b=null==_e?void 0:_e.evaluation_outputs)||void 0===b?void 0:b.output_value)&&void 0!==I?I:null,Se=(null==_e?void 0:_e.deviations)||{},Ae=E+1,Re=R.id;if("right"===j&&V){var Ee=null===(w=R.refIndexes)||void 0===w?void 0:w[0];-1!==(xe=z.findIndex(function(e){return e.selfIndex===Ee}))&&(Ae=xe+1,Re=z[xe].id)}var je,Ce=[],Fe=Object.entries(Se).map(function(n){var i,o,t,l=n[0],d=n[1],a="".concat(Re).concat(r.DEVIATION_BADGE_SEPARATOR).concat(l),s=X[a];if(!s)return null;var u=d[O],c=r.isMissingStr(u);if(c)u="";else if(!u)return null;Ce.push(u);var v=d[ce],f="left"===j?null===(i=z[E])||void 0===i?void 0:i.content:null===(o=L[E])||void 0===o?void 0:o.content,p=r.safeStringify(f),g=Object.keys(Se).map(function(e){return{key:e,text:Se[e][ce]}}).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=me||r.isMissingStr(v)||x,_="".concat(Ae,".").concat(s),y="".concat(Re).concat(r.DEVIATION_BADGE_SEPARATOR).concat(l).concat(r.DEVIATION_BADGE_SEPARATOR).concat(E).concat(r.DEVIATION_BADGE_SEPARATOR).concat(E),b=E;if("right"===j&&V){var I=null===(t=R.refIndexes)||void 0===t?void 0:t[0],w=z.findIndex(function(e){return e.selfIndex===I});-1!==w&&(b=w)}var S=$?$(b):null,A=S?e.__assign(e.__assign({},S),{badgeBg:be.badgeBg,badgeBorder:be.badgeBorder,badgeText:be.badgeText}):e.__assign({},be),C=(null==d?void 0:d.deviation_summary)?{deviation_summary:d.deviation_summary,deviation_title:null==_e?void 0:_e.deviation_title,evaluation_outputs:null==_e?void 0:_e.evaluation_outputs}:null;return{id:a,actionId:y,label:_,highlight:u,side:j,style:A,score:we,isConnected:null==J?void 0:J.has(y),isOrphan:m,isMissingClause:c,badgeRef:Y(j,a),onClick:function(e){e.stopPropagation(),Q&&Q(e,ve||{id:"orphan-left",title:"",content:""},m,fe||{id:"orphan-right",title:"",content:""},y,A)},onSummaryClick:function(e){e.stopPropagation(),H(e,y,m,C)}}}).filter(Boolean),ke=R.id&&j===(null==M?void 0:M.columnKey)?M:null,De=s.default.useRef(!1);return i.useEffect(function(){T||(De.current=!1)},[T]),i.useEffect(function(){!!Z&&(R.subsections||[]).some(function(e){return e.id===Z});T&&De.current},[T,Z,ee,Re,null==ke?void 0:ke.firstDeviationPosition,null==ke?void 0:ke.firstDeviationRef]),n.jsxs(o.Box,e.__assign({ref:C,sx:{mb:k,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[T&&(null==ke?void 0:ke.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==ke?void 0:ke.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(t.ChevronUp,{color:window.getComputedStyle(null===(S=null==ke?void 0:ke.showAboveRef)||void 0===S?void 0:S.current).color})}))})),n.jsxs(o.Accordion,e.__assign({disableGutters:!0,expanded:!oe&&T,onChange:function(){oe||(B(),N.current=R.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(o.AccordionSummary,e.__assign({expandIcon:oe?null:n.jsx(t.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:ne&&n.jsx(o.Tooltip,e.__assign({title:le,placement:"top"},{children:n.jsx(o.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=le,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(o.AccordionDetails,e.__assign({sx:{pt:0,pb:1.25,bgcolor:"#FFFFFF",flex:1,display:"flex",flexDirection:"column",minWidth:0}},{children:[ie&&n.jsx(l.MemoizedMarkdown,{content:R.content,sxStyles:P,highlights:Ce,maintainRelativeOrder:V,highlightBg:Ie,deviationBadges:Fe}),(R.subsections||[]).map(function(e,n){return W({section:e,keyPath:"".concat(E,"-").concat(n),depth:0,columnKey:j,parentNodeId:O,devCounter:te})})]}))]})),T&&(null==ke?void 0:ke.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==ke?void 0:ke.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(t.ChevronDown,{color:window.getComputedStyle(null===(A=null==ke?void 0:ke.showBelowRef)||void 0===A?void 0:A.current).color})}))}))]}),"".concat(j,"-sec-").concat(E))};
|
|
2
2
|
//# sourceMappingURL=SectionAccordion.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 i,{useEffect as t}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 p}from"../hooks/memoizedMarkdown.js";import{hasValue as f,generateColorPalette as h,isMissingStr as m,safeStringify as g,escapeRegExp as x,DEVIATION_BADGE_SEPARATOR as y}from"../CognitiveComparehelpers.js";import{DEFAULT_DEVIAION_COLOR as b}from"../CognitiveCompareConstants.js";var w=function(w){var I,S,F,R,_,k,C,B,A,M,W,T,E,N,O,D,P=w.section,j=w.idx,z=w.columnKey,K=w.colRef,V=w.mb,G=void 0===V?1:V,X=w.parentNodeId,Y=void 0===X?"":X,H=w.isExpanded,$=w.onToggle,q=w.navigation,J=w.showOpenNodeRef,L=w.resolvedMarkdownStyles,Q=w.maintainRelativeOrder,U=w.renderSubSections,Z=w.treeData,ee=w.proposedSections,ne=void 0===ee?[]:ee,oe=w.existingSections,ie=void 0===oe?[]:oe,te=w.deviationNumberRegistry,le=void 0===te?{}:te,re=w.getBadgeRef,de=w.openSummaryPopup,ae=w.getSectionCompareStyle,ue=w.connectedSections,ce=w.openMoreFunctionsPopup,se=w.deviationNodeIdToView,ve=w.deviationTargetParentId,pe=(null===(I=P.displayTitle)||void 0===I||I)&&f(P.title),fe=(null===(S=P.displayContent)||void 0===S||S)&&f(P.content),he=!pe&&!fe,me={current:1},ge=P.title;pe||(ge=fe?"No Title Found":"No Matching Section Found");var xe=P.evaluationResult;if(!xe&&"right"===z)if(Q){var ye=null===(F=P.refIndexes)||void 0===F?void 0:F[0],be=ne.find(function(e){return e.selfIndex===ye});xe=null==be?void 0:be.evaluationResult}else xe=null===(R=ne[j])||void 0===R?void 0:R.evaluationResult;var we=null===(_=null==Z?void 0:Z.input_index_map)||void 0===_?void 0:_[0],Ie=null===(k=null==Z?void 0:Z.input_index_map)||void 0===k?void 0:k[1],Se="left"===z?Ie:we,Fe="left"===z?P:ne[j],Re="right"===z?P:ie[j];if(Q)if("left"===z){var _e=null===(C=P.refIndexes)||void 0===C?void 0:C[0],ke=ie.findIndex(function(e){return e.selfIndex===_e});Re=-1!==ke?ie[ke]:void 0}else{var Ce=null===(B=P.refIndexes)||void 0===B?void 0:B[0],Be=ne.findIndex(function(e){return e.selfIndex===Ce});Fe=-1!==Be?ne[Be]:void 0}var Ae="left"===z?!Re:!Fe,Me=xe||(null==Fe?void 0:Fe.evaluationResult)||(null==Re?void 0:Re.evaluationResult),We=null!==(W=null===(M=null===(A=null==Me?void 0:Me.evaluation_outputs)||void 0===A?void 0:A.metadata)||void 0===M?void 0:M.label_color)&&void 0!==W?W:b,Te=h(We),Ee=Te.highlightBg,Ne=null!==(E=null===(T=null==Me?void 0:Me.evaluation_outputs)||void 0===T?void 0:T.output_value)&&void 0!==E?E:null,Oe=(null==Me?void 0:Me.deviations)||{},De=j+1,Pe=P.id;if("right"===z&&Q){var je=null===(N=P.refIndexes)||void 0===N?void 0:N[0];-1!==(Be=ne.findIndex(function(e){return e.selfIndex===je}))&&(De=Be+1,Pe=ne[Be].id)}var ze,Ke=[],Ve=Object.entries(Oe).map(function(n){var o,i,t,l=n[0],r=n[1],d="".concat(Pe).concat(y).concat(l),a=le[d];if(!a)return null;var u=r[Y],c=m(u);if(c)u="";else if(!u)return null;Ke.push(u);var s=r[Se],v="left"===z?null===(o=ne[j])||void 0===o?void 0:o.content:null===(i=ie[j])||void 0===i?void 0:i.content,p=g(v),f=Object.keys(Oe).map(function(e){return{key:e,text:Oe[e][Se]}}).filter(function(e){return!m(e.text)}).sort(function(e,n){return n.text.length-e.text.length}),h=new Set;f.forEach(function(e){var n=e.text.replace(/\\(['’])/g,"$1").replace(/\\n/g,"\n");if(n){var o=new RegExp(x(n));o.test(p)&&(h.add(e.key),p=p.replace(o,"__TOKEN_".concat(e.key,"__")))}});var b=!m(s)&&!h.has(l),w=Ae||m(s)||b,I="".concat(De,".").concat(a),S="".concat(Pe).concat(y).concat(l).concat(y).concat(j).concat(y).concat(j),F=j;if("right"===z&&Q){var R=null===(t=P.refIndexes)||void 0===t?void 0:t[0],_=ne.findIndex(function(e){return e.selfIndex===R});-1!==_&&(F=_)}var k=ae?ae(F):null,C=k?e(e({},k),{badgeBg:Te.badgeBg,badgeBorder:Te.badgeBorder,badgeText:Te.badgeText}):e({},Te),B=(null==r?void 0:r.deviation_summary)?{deviation_summary:r.deviation_summary,deviation_title:null==Me?void 0:Me.deviation_title,evaluation_outputs:null==Me?void 0:Me.evaluation_outputs}:null;return{id:d,actionId:S,label:I,highlight:u,side:z,style:C,score:Ne,isConnected:null==ue?void 0:ue.has(S),isOrphan:w,isMissingClause:c,badgeRef:re(z,d),onClick:function(e){e.stopPropagation(),ce&&ce(e,Fe||{id:"orphan-left",title:"",content:""},w,Re||{id:"orphan-right",title:"",content:""},S,C)},onSummaryClick:function(e){e.stopPropagation(),de(e,S,w,B)}}}).filter(Boolean),Ge=P.id&&z===(null==q?void 0:q.columnKey)?q:null,Xe=i.useRef(!1);return t(function(){H||(Xe.current=!1)},[H]),t(function(){!!se&&(P.subsections||[]).some(function(e){return e.id===se});H&&Xe.current},[H,se,ve,Pe,null==Ge?void 0:Ge.firstDeviationPosition,null==Ge?void 0:Ge.firstDeviationRef]),n(l,e({ref:K,sx:{mb:G,width:"100%",display:"flex",flexDirection:"column",position:"relative",minWidth:0}},{children:[H&&(null==Ge?void 0:Ge.showAbove)&&o("div",e({style:{position:"sticky",top:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Ge?void 0:Ge.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"===z?"+":"-"," 130px))"),position:"absolute",paddingTop:"20px"},"left"===z?{right:"0px"}:{left:"0px"})},{children:o(s,{color:window.getComputedStyle(null===(O=null==Ge?void 0:Ge.showAboveRef)||void 0===O?void 0:O.current).color})}))})),n(r,e({disableGutters:!0,expanded:!he&&H,onChange:function(){he||($(),J.current=P.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:ge,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:(ze=ge,ze?g(ze).replace(/\\n/g,"\n").split(/(\*\*.*?\*\*)/g).map(function(e,n){return e.startsWith("**")&&e.endsWith("**")?o("strong",{children:e.slice(2,-2)},n):o(i.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:[fe&&o(p,{content:P.content,sxStyles:L,highlights:Ke,maintainRelativeOrder:Q,highlightBg:Ee,deviationBadges:Ve}),(P.subsections||[]).map(function(e,n){return U({section:e,keyPath:"".concat(j,"-").concat(n),depth:0,columnKey:z,parentNodeId:Y,devCounter:me})})]}))]})),H&&(null==Ge?void 0:Ge.showBelow)&&o("div",e({style:{position:"sticky",bottom:0,height:"0px",cursor:"pointer"},onClick:function(){var e,n;return null===(n=null===(e=null==Ge?void 0:Ge.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"===z?"+":"-"," 130px))"),position:"absolute",paddingBottom:"20px"},"left"===z?{right:"0px"}:{left:"0px"})},{children:o(v,{color:window.getComputedStyle(null===(D=null==Ge?void 0:Ge.showBelowRef)||void 0===D?void 0:D.current).color})}))}))]}),"".concat(z,"-sec-").concat(j))};export{w as default};
|
|
2
2
|
//# sourceMappingURL=SectionAccordion.js.map
|
|
@@ -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,GA4hW/B,CAAA"}
|