@viswa-test/test-citation 0.0.7 → 0.0.8

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"),i=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),t=require("./utils/helpers.js"),o=require("react-markdown");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(n),l=r(o),d=function(n){var t=n.type,o=n.label,r={display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap",borderRadius:"9999px",padding:"4px 12px",fontSize:"12px",fontWeight:600};switch(t){case"similarity":return i.jsx("span",e.__assign({style:e.__assign(e.__assign({},r),{border:"1px solid #C4B5FD",backgroundColor:"#F5F3FF",color:"#6D28D9"})},{children:o}));case"no_deviation":return i.jsx("span",e.__assign({style:e.__assign(e.__assign({},r),{border:"1px solid #A7F3D0",backgroundColor:"#ECFDF3",color:"#027A48"})},{children:o}));case"deviation":return i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},r),{gap:"6px",border:"1px solid #FECACA",backgroundColor:"#FEF2F2",color:"#DC2626"})},{children:[o,i.jsx("span",e.__assign({style:{borderRadius:"9999px",backgroundColor:"#FEE2E2",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:i.jsx(s.ThumbsDown,{style:{width:"12px",height:"12px"}})})),i.jsx(s.ChevronDown,{style:{width:"12px",height:"12px",color:"#DC2626"}})]}));default:return null}};function p(n,s,t){return n&&n.length>0?i.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:n.map(function(n){return i.jsx("p",e.__assign({style:{fontSize:"13px",lineHeight:"1.625",color:"#374151",margin:0}},{children:i.jsx(l.default,e.__assign({components:t},{children:n.text}))}),n.id)})})):s||i.jsx("p",e.__assign({style:{fontSize:"13px",fontStyle:"italic",color:"#9CA3AF",margin:0}},{children:"No content available"}))}var x=function(o){var r=o.leftDocumentName,x=void 0===r?"Uploaded Contract":r,c=o.rightDocumentName,g=void 0===c?"Template":c,h=o.overallSimilarity,u=void 0===h?"Similarity":h,_=o.rawMappingData,f=o.deviationMappingData,F=o.defaultExpandedIds,b=void 0===F?[]:F,y=o.onSectionToggle,v=o.showDeviationBar,j=void 0===v||v,m=o.centerColumnWidth,C=void 0===m?15:m,w=o.className,D=void 0===w?"":w,A=o.style,B=t.transformContractComparisons(_),E=n.useState(function(){return new Set(null!=b?b:[B[0].id])}),k=E[0],z=E[1],S=n.useMemo(function(){return{p:function(n){var s=n.children;return i.jsx("span",e.__assign({className:"inline"},{children:s}))},strong:function(n){var s=n.children;return i.jsx("strong",e.__assign({className:"font-semibold"},{children:s}))},em:function(n){var s=n.children;return i.jsx("em",e.__assign({className:"italic"},{children:s}))}}},[]),I=n.useState(!0),T=I[0],R=I[1],N=n.useCallback(function(e){z(function(i){var n=new Set(i),s=!n.has(e);return s?n.add(e):n.delete(e),null==y||y(e,s),n})},[y]),q=function(){return R(function(e){return!e})},W=j?"1fr minmax(80px, ".concat(C,"%) 1fr"):"1fr 1fr";return i.jsx("div",e.__assign({className:D,style:e.__assign({display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"auto",fontFamily:"sans-serif",background:"#FFFFFF"},A)},{children:i.jsx("div",e.__assign({style:{width:"100%",padding:"24px 16px 40px"}},{children:i.jsxs("div",e.__assign({style:{position:"relative",display:"grid",gridTemplateColumns:W,rowGap:"0px"}},{children:[T&&i.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,left:0,width:j?"calc((100% - ".concat(C,"%) / 2)"):"50%",zIndex:0,border:"2px dashed #A0AAB4",borderTop:"none",borderRadius:"0 0 12px 12px",background:"#FFFFFF"}}),T&&i.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,right:0,width:j?"calc((100% - ".concat(C,"%) / 2)"):"50%",zIndex:0,border:"1px solid #E5E7EB",borderTop:"none",background:"#F7F8FA",borderRadius:"0 0 12px 12px"}}),i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"2px dashed #A0AAB4",borderBottom:T?"1px dashed #A0AAB4":"2px dashed #A0AAB4",borderRadius:T?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:q},{children:[i.jsx(s.FileText,{style:{width:"18px",height:"18px",color:"#4B5563"}}),i.jsx("span",e.__assign({style:{flex:1,fontSize:"15px",fontWeight:700,color:"#19213D"}},{children:x})),T?i.jsx(s.ChevronUp,{style:{width:"20px",height:"20px",color:"#6B7280"}}):i.jsx(s.ChevronDown,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),j&&i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"}},{children:[i.jsx("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:"1.5px",background:"#C4B5FD",opacity:.5}}),i.jsx("div",e.__assign({style:{position:"relative",zIndex:11,background:"#FFFFFF",padding:"0 8px"}},{children:i.jsx(d,{type:"similarity",label:u})}))]})),i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"1px solid #E5E7EB",borderRadius:T?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:q},{children:[i.jsx(s.FileText,{style:{width:"18px",height:"18px",color:"#5928ED"}}),i.jsx("span",e.__assign({style:{flex:1,fontSize:"15px",fontWeight:600,color:"#5928ED"}},{children:g})),T?i.jsx(s.ChevronUp,{style:{width:"20px",height:"20px",color:"#6B7280"}}):i.jsx(s.ChevronDown,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),T&&B.map(function(n,t){var o,r,x,c=k.has(n.id),g=0===t?"42px":"38px";return i.jsxs(a.default.Fragment,{children:[i.jsx("div",e.__assign({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:i.jsxs("div",e.__assign({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return N(n.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i.jsx("span",e.__assign({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i.jsx(l.default,e.__assign({components:S},{children:n.leftTitle}))})),c?i.jsx(s.ChevronUp,{size:16,color:"#6B7280"}):i.jsx(s.ChevronDown,{size:16,color:"#6B7280"})]})),c&&i.jsx("div",e.__assign({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:p(null!==(o=n.leftClauses)&&void 0!==o?o:[],n.contentLeft,S)}))]}))})),j&&i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10}},{children:[i.jsx("div",{style:{position:"absolute",left:"-16px",right:"-16px",top:g,height:"1.5px",background:(x=f[t].matchType,"deviation"===x?"#FECACA":"no_deviation"===x?"#77BB9D":"#C4B5FD")}}),i.jsx("div",e.__assign({style:{position:"absolute",left:"50%",transform:"translate(-50%, -50%)",top:g,background:"#FFFFFF",padding:"0 8px"}},{children:i.jsx(d,{type:f[t].matchType,label:f[t].matchLabel})}))]})),i.jsx("div",e.__assign({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:i.jsxs("div",e.__assign({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return N(n.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i.jsx("span",e.__assign({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i.jsx(l.default,e.__assign({components:S},{children:n.rightTitle}))})),c?i.jsx(s.ChevronUp,{size:16,color:"#6B7280"}):i.jsx(s.ChevronDown,{size:16,color:"#6B7280"})]})),c&&i.jsx("div",e.__assign({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:p(null!==(r=n.rightClauses)&&void 0!==r?r:[],n.contentRight,S)}))]}))}))]},n.id)})]}))}))}))};exports.AiRedLineCompare=x,exports.default=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),t=require("./utils/helpers.js"),o=require("react-markdown");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(n),l=r(o),d=function(n){var t=n.type,o=n.label,r={display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap",borderRadius:"9999px",padding:"4px 12px",fontSize:"12px",fontWeight:600};switch(t){case"similarity":return i.jsx("span",e.__assign({style:e.__assign(e.__assign({},r),{border:"1px solid #C4B5FD",backgroundColor:"#F5F3FF",color:"#6D28D9"})},{children:o}));case"no_deviation":return i.jsx("span",e.__assign({style:e.__assign(e.__assign({},r),{border:"1px solid #A7F3D0",backgroundColor:"#ECFDF3",color:"#027A48"})},{children:o}));case"deviation":return i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},r),{gap:"6px",border:"1px solid #FECACA",backgroundColor:"#FEF2F2",color:"#DC2626"})},{children:[o,i.jsx("span",e.__assign({style:{borderRadius:"9999px",backgroundColor:"#FEE2E2",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:i.jsx(s.ThumbsDown,{style:{width:"12px",height:"12px"}})})),i.jsx(s.ChevronDown,{style:{width:"12px",height:"12px",color:"#DC2626"}})]}));default:return null}};function p(n,s,t){return n&&n.length>0?i.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:n.map(function(n){return i.jsx("p",e.__assign({style:{fontSize:"13px",lineHeight:"1.625",color:"#374151",margin:0}},{children:i.jsx(l.default,e.__assign({components:t},{children:n.text}))}),n.id)})})):s||i.jsx("p",e.__assign({style:{fontSize:"13px",fontStyle:"italic",color:"#9CA3AF",margin:0}},{children:"No content available"}))}var x=function(o){var r=o.leftDocumentName,x=void 0===r?"Uploaded Contract":r,c=o.rightDocumentName,g=void 0===c?"Template":c,h=o.overallSimilarity,u=void 0===h?"Similarity":h,_=o.rawMappingData,f=o.deviationMappingData,F=o.defaultExpandedIds,y=void 0===F?[]:F,b=o.onSectionToggle,v=o.showDeviationBar,j=void 0===v||v,m=o.centerColumnWidth,C=void 0===m?15:m,w=o.className,D=void 0===w?"":w,A=o.style,B=t.transformContractComparisons(_),E=n.useState(function(){return new Set(null!=y?y:[B[0].id])}),k=E[0],z=E[1],S=n.useMemo(function(){return{p:function(n){var s=n.children;return i.jsx("div",e.__assign({className:"inline",style:{padding:"8px 0px 8px 0px"}},{children:s}))},strong:function(n){var s=n.children;return i.jsx("strong",e.__assign({className:"font-semibold"},{children:s}))},em:function(n){var s=n.children;return i.jsx("em",e.__assign({className:"italic"},{children:s}))}}},[]),I=n.useState(!0),T=I[0],R=I[1],N=n.useCallback(function(e){z(function(i){var n=new Set(i),s=!n.has(e);return s?n.add(e):n.delete(e),null==b||b(e,s),n})},[b]),q=function(){return R(function(e){return!e})},W=j?"1fr minmax(80px, ".concat(C,"%) 1fr"):"1fr 1fr";return i.jsx("div",e.__assign({className:D,style:e.__assign({display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"auto",fontFamily:"sans-serif",background:"#FFFFFF"},A)},{children:i.jsx("div",e.__assign({style:{width:"100%",padding:"24px 16px 40px"}},{children:i.jsxs("div",e.__assign({style:{position:"relative",display:"grid",gridTemplateColumns:W,rowGap:"0px"}},{children:[T&&i.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,left:0,width:j?"calc((100% - ".concat(C,"%) / 2)"):"50%",zIndex:0,border:"2px dashed #A0AAB4",borderTop:"none",borderRadius:"0 0 12px 12px",background:"#FFFFFF"}}),T&&i.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,right:0,width:j?"calc((100% - ".concat(C,"%) / 2)"):"50%",zIndex:0,border:"1px solid #E5E7EB",borderTop:"none",background:"#F7F8FA",borderRadius:"0 0 12px 12px"}}),i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"2px dashed #A0AAB4",borderBottom:T?"1px dashed #A0AAB4":"2px dashed #A0AAB4",borderRadius:T?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:q},{children:[i.jsx(s.FileText,{style:{width:"18px",height:"18px",color:"#4B5563"}}),i.jsx("span",e.__assign({style:{flex:1,fontSize:"15px",fontWeight:700,color:"#19213D"}},{children:x})),T?i.jsx(s.ChevronUp,{style:{width:"20px",height:"20px",color:"#6B7280"}}):i.jsx(s.ChevronDown,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),j&&i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"}},{children:[i.jsx("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:"1.5px",background:"#C4B5FD",opacity:.5}}),i.jsx("div",e.__assign({style:{position:"relative",zIndex:11,background:"#FFFFFF",padding:"0 8px"}},{children:i.jsx(d,{type:"similarity",label:u})}))]})),i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"1px solid #E5E7EB",borderRadius:T?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:q},{children:[i.jsx(s.FileText,{style:{width:"18px",height:"18px",color:"#5928ED"}}),i.jsx("span",e.__assign({style:{flex:1,fontSize:"15px",fontWeight:600,color:"#5928ED"}},{children:g})),T?i.jsx(s.ChevronUp,{style:{width:"20px",height:"20px",color:"#6B7280"}}):i.jsx(s.ChevronDown,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),T&&B.map(function(n,t){var o,r,x,c=k.has(n.id),g=0===t?"42px":"38px";return i.jsxs(a.default.Fragment,{children:[i.jsx("div",e.__assign({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:i.jsxs("div",e.__assign({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return N(n.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i.jsx("span",e.__assign({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i.jsx(l.default,e.__assign({components:S},{children:n.leftTitle}))})),c?i.jsx(s.ChevronUp,{size:16,color:"#6B7280"}):i.jsx(s.ChevronDown,{size:16,color:"#6B7280"})]})),c&&i.jsx("div",e.__assign({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:p(null!==(o=n.leftClauses)&&void 0!==o?o:[],n.contentLeft,S)}))]}))})),j&&i.jsxs("div",e.__assign({style:{position:"relative",zIndex:10}},{children:[i.jsx("div",{style:{position:"absolute",left:"-16px",right:"-16px",top:g,height:"1.5px",background:(x=f[t].matchType,"deviation"===x?"#FECACA":"no_deviation"===x?"#77BB9D":"#C4B5FD")}}),i.jsx("div",e.__assign({style:{position:"absolute",left:"50%",transform:"translate(-50%, -50%)",top:g,background:"#FFFFFF",padding:"0 8px"}},{children:i.jsx(d,{type:f[t].matchType,label:f[t].matchLabel})}))]})),i.jsx("div",e.__assign({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:i.jsxs("div",e.__assign({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return N(n.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i.jsx("span",e.__assign({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i.jsx(l.default,e.__assign({components:S},{children:n.rightTitle}))})),c?i.jsx(s.ChevronUp,{size:16,color:"#6B7280"}):i.jsx(s.ChevronDown,{size:16,color:"#6B7280"})]})),c&&i.jsx("div",e.__assign({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:p(null!==(r=n.rightClauses)&&void 0!==r?r:[],n.contentRight,S)}))]}))}))]},n.id)})]}))}))}))};exports.AiRedLineCompare=x,exports.default=x;
2
2
  //# sourceMappingURL=AiRedLineCompare.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as i,jsxs as t}from"react/jsx-runtime";import n,{useState as o,useMemo as r,useCallback as d}from"react";import{FileText as l,ChevronUp as a,ChevronDown as p,ThumbsDown as s}from"lucide-react";import{transformContractComparisons as c}from"./utils/helpers.js";import x from"react-markdown";var h=function(n){var o=n.type,r=n.label,d={display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap",borderRadius:"9999px",padding:"4px 12px",fontSize:"12px",fontWeight:600};switch(o){case"similarity":return i("span",e({style:e(e({},d),{border:"1px solid #C4B5FD",backgroundColor:"#F5F3FF",color:"#6D28D9"})},{children:r}));case"no_deviation":return i("span",e({style:e(e({},d),{border:"1px solid #A7F3D0",backgroundColor:"#ECFDF3",color:"#027A48"})},{children:r}));case"deviation":return t("span",e({style:e(e({},d),{gap:"6px",border:"1px solid #FECACA",backgroundColor:"#FEF2F2",color:"#DC2626"})},{children:[r,i("span",e({style:{borderRadius:"9999px",backgroundColor:"#FEE2E2",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:i(s,{style:{width:"12px",height:"12px"}})})),i(p,{style:{width:"12px",height:"12px",color:"#DC2626"}})]}));default:return null}};function u(t,n,o){return t&&t.length>0?i("div",e({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:t.map(function(t){return i("p",e({style:{fontSize:"13px",lineHeight:"1.625",color:"#374151",margin:0}},{children:i(x,e({components:o},{children:t.text}))}),t.id)})})):n||i("p",e({style:{fontSize:"13px",fontStyle:"italic",color:"#9CA3AF",margin:0}},{children:"No content available"}))}var g=function(s){var g=s.leftDocumentName,f=void 0===g?"Uploaded Contract":g,F=s.rightDocumentName,b=void 0===F?"Template":F,y=s.overallSimilarity,m=void 0===y?"Similarity":y,v=s.rawMappingData,C=s.deviationMappingData,w=s.defaultExpandedIds,E=void 0===w?[]:w,A=s.onSectionToggle,k=s.showDeviationBar,B=void 0===k||k,D=s.centerColumnWidth,z=void 0===D?15:D,I=s.className,S=void 0===I?"":I,T=s.style,R=c(v),N=o(function(){return new Set(null!=E?E:[R[0].id])}),j=N[0],W=N[1],L=r(function(){return{p:function(t){var n=t.children;return i("span",e({className:"inline"},{children:n}))},strong:function(t){var n=t.children;return i("strong",e({className:"font-semibold"},{children:n}))},em:function(t){var n=t.children;return i("em",e({className:"italic"},{children:n}))}}},[]),M=o(!0),_=M[0],G=M[1],H=d(function(e){W(function(i){var t=new Set(i),n=!t.has(e);return n?t.add(e):t.delete(e),null==A||A(e,n),t})},[A]),U=function(){return G(function(e){return!e})},q=B?"1fr minmax(80px, ".concat(z,"%) 1fr"):"1fr 1fr";return i("div",e({className:S,style:e({display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"auto",fontFamily:"sans-serif",background:"#FFFFFF"},T)},{children:i("div",e({style:{width:"100%",padding:"24px 16px 40px"}},{children:t("div",e({style:{position:"relative",display:"grid",gridTemplateColumns:q,rowGap:"0px"}},{children:[_&&i("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,left:0,width:B?"calc((100% - ".concat(z,"%) / 2)"):"50%",zIndex:0,border:"2px dashed #A0AAB4",borderTop:"none",borderRadius:"0 0 12px 12px",background:"#FFFFFF"}}),_&&i("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,right:0,width:B?"calc((100% - ".concat(z,"%) / 2)"):"50%",zIndex:0,border:"1px solid #E5E7EB",borderTop:"none",background:"#F7F8FA",borderRadius:"0 0 12px 12px"}}),t("div",e({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"2px dashed #A0AAB4",borderBottom:_?"1px dashed #A0AAB4":"2px dashed #A0AAB4",borderRadius:_?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:U},{children:[i(l,{style:{width:"18px",height:"18px",color:"#4B5563"}}),i("span",e({style:{flex:1,fontSize:"15px",fontWeight:700,color:"#19213D"}},{children:f})),i(_?a:p,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),B&&t("div",e({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"}},{children:[i("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:"1.5px",background:"#C4B5FD",opacity:.5}}),i("div",e({style:{position:"relative",zIndex:11,background:"#FFFFFF",padding:"0 8px"}},{children:i(h,{type:"similarity",label:m})}))]})),t("div",e({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"1px solid #E5E7EB",borderRadius:_?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:U},{children:[i(l,{style:{width:"18px",height:"18px",color:"#5928ED"}}),i("span",e({style:{flex:1,fontSize:"15px",fontWeight:600,color:"#5928ED"}},{children:b})),i(_?a:p,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),_&&R.map(function(o,r){var d,l,s,c=j.has(o.id),g=0===r?"42px":"38px";return t(n.Fragment,{children:[i("div",e({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:t("div",e({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[t("button",e({onClick:function(){return H(o.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i("span",e({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i(x,e({components:L},{children:o.leftTitle}))})),i(c?a:p,{size:16,color:"#6B7280"})]})),c&&i("div",e({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:u(null!==(d=o.leftClauses)&&void 0!==d?d:[],o.contentLeft,L)}))]}))})),B&&t("div",e({style:{position:"relative",zIndex:10}},{children:[i("div",{style:{position:"absolute",left:"-16px",right:"-16px",top:g,height:"1.5px",background:(s=C[r].matchType,"deviation"===s?"#FECACA":"no_deviation"===s?"#77BB9D":"#C4B5FD")}}),i("div",e({style:{position:"absolute",left:"50%",transform:"translate(-50%, -50%)",top:g,background:"#FFFFFF",padding:"0 8px"}},{children:i(h,{type:C[r].matchType,label:C[r].matchLabel})}))]})),i("div",e({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:t("div",e({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[t("button",e({onClick:function(){return H(o.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i("span",e({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i(x,e({components:L},{children:o.rightTitle}))})),i(c?a:p,{size:16,color:"#6B7280"})]})),c&&i("div",e({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:u(null!==(l=o.rightClauses)&&void 0!==l?l:[],o.contentRight,L)}))]}))}))]},o.id)})]}))}))}))};export{g as AiRedLineCompare,g as default};
1
+ import{__assign as e}from"tslib";import{jsx as i,jsxs as t}from"react/jsx-runtime";import n,{useState as o,useMemo as r,useCallback as d}from"react";import{FileText as l,ChevronUp as a,ChevronDown as p,ThumbsDown as s}from"lucide-react";import{transformContractComparisons as c}from"./utils/helpers.js";import x from"react-markdown";var h=function(n){var o=n.type,r=n.label,d={display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap",borderRadius:"9999px",padding:"4px 12px",fontSize:"12px",fontWeight:600};switch(o){case"similarity":return i("span",e({style:e(e({},d),{border:"1px solid #C4B5FD",backgroundColor:"#F5F3FF",color:"#6D28D9"})},{children:r}));case"no_deviation":return i("span",e({style:e(e({},d),{border:"1px solid #A7F3D0",backgroundColor:"#ECFDF3",color:"#027A48"})},{children:r}));case"deviation":return t("span",e({style:e(e({},d),{gap:"6px",border:"1px solid #FECACA",backgroundColor:"#FEF2F2",color:"#DC2626"})},{children:[r,i("span",e({style:{borderRadius:"9999px",backgroundColor:"#FEE2E2",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:i(s,{style:{width:"12px",height:"12px"}})})),i(p,{style:{width:"12px",height:"12px",color:"#DC2626"}})]}));default:return null}};function u(t,n,o){return t&&t.length>0?i("div",e({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:t.map(function(t){return i("p",e({style:{fontSize:"13px",lineHeight:"1.625",color:"#374151",margin:0}},{children:i(x,e({components:o},{children:t.text}))}),t.id)})})):n||i("p",e({style:{fontSize:"13px",fontStyle:"italic",color:"#9CA3AF",margin:0}},{children:"No content available"}))}var g=function(s){var g=s.leftDocumentName,f=void 0===g?"Uploaded Contract":g,F=s.rightDocumentName,y=void 0===F?"Template":F,b=s.overallSimilarity,m=void 0===b?"Similarity":b,v=s.rawMappingData,C=s.deviationMappingData,w=s.defaultExpandedIds,E=void 0===w?[]:w,A=s.onSectionToggle,k=s.showDeviationBar,B=void 0===k||k,D=s.centerColumnWidth,z=void 0===D?15:D,I=s.className,S=void 0===I?"":I,T=s.style,R=c(v),N=o(function(){return new Set(null!=E?E:[R[0].id])}),j=N[0],W=N[1],L=r(function(){return{p:function(t){var n=t.children;return i("div",e({className:"inline",style:{padding:"8px 0px 8px 0px"}},{children:n}))},strong:function(t){var n=t.children;return i("strong",e({className:"font-semibold"},{children:n}))},em:function(t){var n=t.children;return i("em",e({className:"italic"},{children:n}))}}},[]),M=o(!0),_=M[0],G=M[1],H=d(function(e){W(function(i){var t=new Set(i),n=!t.has(e);return n?t.add(e):t.delete(e),null==A||A(e,n),t})},[A]),U=function(){return G(function(e){return!e})},q=B?"1fr minmax(80px, ".concat(z,"%) 1fr"):"1fr 1fr";return i("div",e({className:S,style:e({display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"auto",fontFamily:"sans-serif",background:"#FFFFFF"},T)},{children:i("div",e({style:{width:"100%",padding:"24px 16px 40px"}},{children:t("div",e({style:{position:"relative",display:"grid",gridTemplateColumns:q,rowGap:"0px"}},{children:[_&&i("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,left:0,width:B?"calc((100% - ".concat(z,"%) / 2)"):"50%",zIndex:0,border:"2px dashed #A0AAB4",borderTop:"none",borderRadius:"0 0 12px 12px",background:"#FFFFFF"}}),_&&i("div",{style:{pointerEvents:"none",position:"absolute",top:56,bottom:0,right:0,width:B?"calc((100% - ".concat(z,"%) / 2)"):"50%",zIndex:0,border:"1px solid #E5E7EB",borderTop:"none",background:"#F7F8FA",borderRadius:"0 0 12px 12px"}}),t("div",e({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"2px dashed #A0AAB4",borderBottom:_?"1px dashed #A0AAB4":"2px dashed #A0AAB4",borderRadius:_?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:U},{children:[i(l,{style:{width:"18px",height:"18px",color:"#4B5563"}}),i("span",e({style:{flex:1,fontSize:"15px",fontWeight:700,color:"#19213D"}},{children:f})),i(_?a:p,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),B&&t("div",e({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"}},{children:[i("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:"1.5px",background:"#C4B5FD",opacity:.5}}),i("div",e({style:{position:"relative",zIndex:11,background:"#FFFFFF",padding:"0 8px"}},{children:i(h,{type:"similarity",label:m})}))]})),t("div",e({style:{position:"relative",zIndex:10,display:"flex",alignItems:"center",gap:"12px",padding:"0 16px",height:56,cursor:"pointer",background:"#F7F8FA",border:"1px solid #E5E7EB",borderRadius:_?"12px 12px 0 0":"12px",transition:"border-radius 0.2s ease"},onClick:U},{children:[i(l,{style:{width:"18px",height:"18px",color:"#5928ED"}}),i("span",e({style:{flex:1,fontSize:"15px",fontWeight:600,color:"#5928ED"}},{children:y})),i(_?a:p,{style:{width:"20px",height:"20px",color:"#6B7280"}})]})),_&&R.map(function(o,r){var d,l,s,c=j.has(o.id),g=0===r?"42px":"38px";return t(n.Fragment,{children:[i("div",e({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:t("div",e({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[t("button",e({onClick:function(){return H(o.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i("span",e({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i(x,e({components:L},{children:o.leftTitle}))})),i(c?a:p,{size:16,color:"#6B7280"})]})),c&&i("div",e({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:u(null!==(d=o.leftClauses)&&void 0!==d?d:[],o.contentLeft,L)}))]}))})),B&&t("div",e({style:{position:"relative",zIndex:10}},{children:[i("div",{style:{position:"absolute",left:"-16px",right:"-16px",top:g,height:"1.5px",background:(s=C[r].matchType,"deviation"===s?"#FECACA":"no_deviation"===s?"#77BB9D":"#C4B5FD")}}),i("div",e({style:{position:"absolute",left:"50%",transform:"translate(-50%, -50%)",top:g,background:"#FFFFFF",padding:"0 8px"}},{children:i(h,{type:C[r].matchType,label:C[r].matchLabel})}))]})),i("div",e({style:{position:"relative",zIndex:10,padding:"12px 16px"}},{children:t("div",e({style:{borderRadius:"8px",border:"1px solid #E5E7EB",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"}},{children:[t("button",e({onClick:function(){return H(o.id)},style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"16px",background:"transparent",border:"none",cursor:"pointer"}},{children:[i("span",e({style:{fontSize:"13px",fontWeight:600,color:"#111827"}},{children:i(x,e({components:L},{children:o.rightTitle}))})),i(c?a:p,{size:16,color:"#6B7280"})]})),c&&i("div",e({style:{borderTop:"1px solid #F3F4F6",padding:"16px"}},{children:u(null!==(l=o.rightClauses)&&void 0!==l?l:[],o.contentRight,L)}))]}))}))]},o.id)})]}))}))}))};export{g as AiRedLineCompare,g as default};
2
2
  //# sourceMappingURL=AiRedLineCompare.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AiRedLineCompareTest.d.ts","sourceRoot":"","sources":["../../../src/AiRedLineCompareTest.tsx"],"names":[],"mappings":"AAqJA,QAAA,MAAM,oBAAoB,+CAazB,CAAA;AAED,eAAe,oBAAoB,CAAA"}
1
+ {"version":3,"file":"AiRedLineCompareTest.d.ts","sourceRoot":"","sources":["../../../src/AiRedLineCompareTest.tsx"],"names":[],"mappings":"AAkKA,QAAA,MAAM,oBAAoB,+CAazB,CAAA;AAED,eAAe,oBAAoB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AiRedLineCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/AiRedLineCompare/AiRedLineCompare.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,aAAa,EAEnB,MAAM,OAAO,CAAC;AAQf,OAAO,EAAU,sBAAsB,EAAa,MAAM,8BAA8B,CAAC;AAIzF,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;IAC9C,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAGxD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAyHD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoP5D,CAAC;AACF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"AiRedLineCompare.d.ts","sourceRoot":"","sources":["../../../../../src/features/AiRedLineCompare/AiRedLineCompare.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,aAAa,EAEnB,MAAM,OAAO,CAAC;AAQf,OAAO,EAAU,sBAAsB,EAAa,MAAM,8BAA8B,CAAC;AAIzF,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;IAC9C,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAGxD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAyHD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAwP5D,CAAC;AACF,eAAe,gBAAgB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export declare const APP_API: string;
2
2
  export declare const HYPERVISOR_DOMAIN: string;
3
+ export declare const testContractRes: any;
3
4
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/service/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,EAAE,MAAkF,CAAC;AACzG,eAAO,MAAM,iBAAiB,EAAE,MAA8C,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/service/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,EAAE,MAAkF,CAAC;AACzG,eAAO,MAAM,iBAAiB,EAAE,MAA8C,CAAC;AAE/E,eAAO,MAAM,eAAe,EAAE,GAivB7B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viswa-test/test-citation",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "author": "Viswa Koduru",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -117,7 +117,7 @@
117
117
  "require": "./dist/cjs/features/ReviewPanel/ReviewPanel.js",
118
118
  "types": "./dist/types/src/features/ReviewPanel/ReviewPanel.d.ts"
119
119
  },
120
- "./PdfViewer": {
120
+ "./AiRedLineCompare": {
121
121
  "import": "./dist/features/AiRedLineCompare/AiRedLineCompare.js",
122
122
  "require": "./dist/cjs/features/AiRedLineCompare/AiRedLineCompare.js",
123
123
  "types": "./dist/types/src/features/AiRedLineCompare/AiRedLineCompare.d.ts"