@viswa-test/test-citation 0.0.310 → 0.0.312
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/SegmentReviewComponents/CognitiveIntegrity.js +1 -1
- package/dist/cjs/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/features/SegmentReviewComponents/CognitiveIntegrity.js +1 -1
- package/dist/features/SegmentReviewComponents/SegmentReviewPdfWrapper.js +1 -1
- package/dist/types/src/features/SegmentReviewComponents/CognitiveIntegrity.d.ts +8 -1
- package/dist/types/src/features/SegmentReviewComponents/CognitiveIntegrity.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts +1 -1
- package/dist/types/src/features/SegmentReviewComponents/index.d.ts.map +1 -1
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts +1 -0
- package/dist/types/src/features/SegmentReviewComponents/reviewStepAdapters.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.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"),i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@mui/icons-material/ChevronLeft"),n=require("@mui/icons-material/Close"),a=require("@mui/material/Box"),r=require("@mui/material/Divider"),s=require("@mui/material/IconButton"),l=require("@mui/material/Paper"),o=require("@mui/material/Stack"),u=require("@mui/material/Typography"),d=require("../CitationRenderer/MarkdownRenderer.js"),c=require("./CognitiveIcon.js"),g=require("./CognitiveScoreBadge.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=m(t),f=m(n),h=m(a),p=m(r),_=m(s),v=m(l),j=m(o),y=m(u),b=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)};exports.default=function(t){var n=t.reasons,a=t.reason,r=t.gap,s=t.score,l=t.headerName,o=void 0===l?"Cognitive Integrity":l,u=t.onBack,m=t.onClose,C=t.showCloseButton,w=void 0===C||C,q=t.width,k=void 0===q?260:q,H=t.maxWidth,S=void 0===H?260:H,z=t.className,B=t.styles,W=(null!=n?n:[]).filter(function(e){return"evidence"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),R=(null!=n?n:[]).filter(function(e){return"gap"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),A=null==a?void 0:a.trim(),I=null==r?void 0:r.trim();if(0===W.length&&A&&W.push(A),0===R.length&&I&&R.push(I),0===W.length&&0===R.length)return null;var M,L=(M=null==B?void 0:B.markdown,e.__assign(e.__assign({},M),{containerWrapper:e.__assign(e.__assign({},null==M?void 0:M.containerWrapper),{display:"block",height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto"}),mainCard:e.__assign(e.__assign({},null==M?void 0:M.mainCard),{height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto",padding:0,border:"none",borderRadius:0,boxShadow:"none",backgroundColor:"transparent"}),scrollArea:e.__assign(e.__assign({},null==M?void 0:M.scrollArea),{height:"auto",minHeight:0,maxHeight:"none",overflowY:"visible",paddingRight:0,color:"#475467",fontSize:11.5,lineHeight:1.3})}));return i.jsx(v.default,e.__assign({className:z,elevation:4,sx:b({width:k,maxWidth:S,height:"fit-content",minHeight:0,alignSelf:"flex-start",flex:"0 0 auto",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==B?void 0:B.root)},{children:i.jsxs(j.default,e.__assign({spacing:.75,sx:{p:1,height:"auto",minHeight:0}},{children:[i.jsxs(j.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==B?void 0:B.header},{children:[u&&i.jsx(_.default,e.__assign({size:"small",onClick:u,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:i.jsx(x.default,{sx:{fontSize:17}})})),i.jsx(c.default,{sx:{color:"#6941C6"}}),i.jsx(y.default,e.__assign({sx:{flex:1,fontSize:12,fontWeight:500,alignItems:"center",display:"flex",lineHeight:1.25,textTransform:"capitalise"}},{children:o})),i.jsx(g.default,{score:s}),w&&i.jsx(_.default,e.__assign({size:"small",onClick:m,disabled:!m,"aria-label":"Close cognitive integrity",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(f.default,{sx:{fontSize:17}})}))]})),i.jsxs(j.default,e.__assign({spacing:.75,sx:b({height:"auto",minHeight:0,flex:"0 0 auto"},null==B?void 0:B.content)},{children:[W.length>0&&i.jsxs(h.default,e.__assign({sx:{marginTop:4}},{children:[i.jsx(y.default,e.__assign({sx:{mt:1,mb:.25,color:"text.primary",fontSize:12,fontWeight:500}},{children:"Decision Making Factors"})),i.jsx(p.default,{sx:{my:.625}}),i.jsx(h.default,e.__assign({component:"ol",sx:{m:0,pl:2.5}},{children:W.map(function(t,n){return i.jsx(h.default,e.__assign({component:"li",sx:{mb:.5,pl:.25}},{children:i.jsx(d.default,{value:"<summary>".concat(t,"</summary>"),styles:L})}),"evidence-".concat(n))})}))]})),R.length>0&&i.jsxs(h.default,e.__assign({sx:null==B?void 0:B.section},{children:[i.jsx(y.default,e.__assign({sx:{mb:.25,color:"text.primary",fontSize:12,fontWeight:500}},{children:"Gap"})),i.jsx(p.default,{sx:{my:.625}}),i.jsx(h.default,e.__assign({component:"ol",sx:{m:0,pl:2.5}},{children:R.map(function(t,n){return i.jsx(h.default,e.__assign({component:"li",sx:{mb:.5,pl:.25}},{children:i.jsx(d.default,{value:"<summary>".concat(t,"</summary>"),styles:L})}),"gap-".concat(n))})}))]}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveIntegrity.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@react-pdf-viewer/core"),r=require("../PdfViewer/PdfViewer.js"),o=require("./BoundaryCard.js"),a=require("./CardWrapper.js"),l=require("./CognitiveIntegrity.js"),s=require("./LabelCheck.js"),u=require("./reviewStepAdapters.js"),d=require("lucide-react"),c=require("@mui/material"),g=require("./helper.js"),f=260,v=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};exports.default=function(p){var m,h,_,b,w,x,y,C=this,S=p.pdfUrl,j=p.pdfName,k=p.segments,N=p.styles,E=p.pdfViewerProps,I=p.showBadges,M=void 0===I||I,A=p.sortByConfidence,R=void 0===A?"low":A,F=p.filterByConfidence,B=void 0===F?"all":F,P=p.showBadgeNavigation,q=void 0===P||P,L=p.autoSelectReviewOnPageChange,W=void 0!==L&&L,z=p.autoAdvanceAfterConfirm,T=void 0===z||z,D=p.badgePreloadPages,O=void 0===D?8:D,V=p.badgeOffsetTop,H=void 0===V?20:V,G=p.badgeOffsetRight,U=void 0===G?68:G,X=p.badgeOffsetLeft,Z=void 0===X?0:X,J=p.initialReviewId,K=p.onBoundaryAction,Q=p.onLabelAction,Y=p.onActiveReviewChange,$=p.onCurrentPageChange,ee=p.onActionError,ne=p.disableAllActions,te=void 0!==ne&&ne,ie=p.onAdjustManually,re=p.onCognitiveClick,oe=p.className,ae=p.style,le=p.viewerStyle,se=p.railStyle,ue=p.redirectionData,de=t.useMemo(function(){return u.extractSegmentReviewData(k)},[k]),ce=de.boundaryReviews,ge=de.labelReviews,fe=t.useMemo(function(){return new Map(k.map(function(e,n){return[e.stable_key,n+1]}))},[k]),ve=t.useRef(null),pe=t.useMemo(function(){return e.__spreadArray(e.__spreadArray([],ce.map(function(n){var t;return e.__assign(e.__assign({},n),{kind:"boundary",pageNumber:null!==(t=n.metadata.focus_page)&&void 0!==t?t:n.segment.start_page})}),!0),ge.map(function(n){return e.__assign(e.__assign({},n),{kind:"label",pageNumber:n.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=fe.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=fe.get(n.segment.stable_key))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-o||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[ce,ge,fe]),me=t.useMemo(function(){return k.map(function(n){var t;return e.__assign(e.__assign({},n),{title:(null===(t=n.label)||void 0===t?void 0:t.trim())||n.title})})},[k]),he=t.useState(1),_e=he[0],be=he[1],we=t.useState(null!=J?J:null),xe=we[0],ye=we[1],Ce=t.useState(null!=J?J:null),Se=Ce[0],je=Ce[1],ke=t.useState(!1),Ne=ke[0],Ee=ke[1],Ie=t.useState(null),Me=Ie[0],Ae=Ie[1],Re=t.useState(null),Fe=Re[0],Be=Re[1],Pe=t.useState(function(){return new Set}),qe=Pe[0],Le=Pe[1],We=t.useState(null),ze=We[0],Te=We[1],De=t.useRef(0),Oe=t.useRef(null),Ve=t.useRef(new Map),He=t.useRef(null),Ge=t.useRef(null),Ue=t.useState(f),Xe=Ue[0],Ze=Ue[1],Je=null!==(h=null===(m=null==N?void 0:N.aside)||void 0===m?void 0:m.width)&&void 0!==h?h:"40%",Ke="number"==typeof Je?"min(".concat(Je,"px, ").concat(f,"px)"):"min(".concat(Je,", ").concat(f,"px)");t.useEffect(function(){var e=ve.current;if(e&&M){var n=function(){var n=e.getBoundingClientRect().width;n>0&&Ze(n)};n();var t="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==t||t.observe(e),function(){return null==t?void 0:t.disconnect()}}},[M]),t.useMemo(function(){var e=new Set(qe);return pe.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[qe,pe]);var Qe=t.useMemo(function(){var e;return null!==(e=pe.find(function(e){return e.id===xe}))&&void 0!==e?e:null},[xe,pe]),Ye=null==Qe?-1:k.findIndex(function(e){return e.stable_key===Qe.segment.stable_key}),$e=Ye>0?k[Ye-1]:void 0,en=Ye>=0?k[Ye+1]:void 0,nn=(null===(_=null==$e?void 0:$e.label)||void 0===_?void 0:_.trim())||(null==$e?void 0:$e.title),tn=(null===(b=null==en?void 0:en.label)||void 0===b?void 0:b.trim())||(null==en?void 0:en.title),rn=g.getConfidenceColors(null==Qe?void 0:Qe.review_step.score,null==Qe?void 0:Qe.review_step.confidence,null===(w=null==Qe?void 0:Qe.segment.confidence)||void 0===w?void 0:w.awaiting_llm),on=Boolean((null===(x=null==Qe?void 0:Qe.review_step.reason)||void 0===x?void 0:x.trim())||(null===(y=null==Qe?void 0:Qe.review_step.gap)||void 0===y?void 0:y.trim())),an=t.useCallback(function(e,n){De.current+=1,Oe.current={requestId:De.current,pageNumber:e,reviewId:n},Be({pageNumber:e,requestId:De.current})},[]),ln=t.useCallback(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(ye(e.id),je(e.id),Ee(!1),Ae(null),an(e.pageNumber,e.id),null==Y||Y(e.id,e.segment))},[Y,an]);t.useEffect(function(){if((null==ue?void 0:ue.pageNumber)&&ue.type){var e=Number(ue.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=pe.find(function(n){return n.segment.start_page===e&&n.kind===ue.type});n&&ln(n)}}},[ue,ln,pe]);var sn=t.useCallback(function(){Oe.current=null,Ee(!1),ye(null),Ae(null),null==Y||Y(null,null)},[Y]),un=t.useCallback(function(e){var n;if(T){var t=pe.findIndex(function(n){return n.id===e}),i=new Set(pe.map(function(e){return e.id})),r=null!==(n=pe.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:pe.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return ln(r)}):sn()}else sn()},[T,sn,pe,ln,pe]),dn=t.useCallback(function(n,t,i){return e.__awaiter(C,void 0,void 0,function(){var r,o;return e.__generator(this,function(e){switch(e.label){case 0:if(te)return[2];r=v(n),Te(n.id),e.label=1;case 1:return e.trys.push([1,6,7,8]),"boundary"!==n.kind?[3,3]:[4,null==K?void 0:K(t,i,r)];case 2:return e.sent(),[3,5];case 3:return[4,null==Q?void 0:Q(t,i,r)];case 4:e.sent(),e.label=5;case 5:return Le(function(e){var t=new Set(e);return t.add(n.id),t}),un(n.id),[3,8];case 6:return o=e.sent(),null==ee||ee(o,r),[3,8];case 7:return Te(null),[7];case 8:return[2]}})})},[te,ee,K,Q,un]);t.useEffect(function(){xe&&!pe.some(function(e){return e.id===xe})&&sn()},[xe,sn,pe]),t.useEffect(function(){if(W){var e=pe.find(function(e){return e.pageNumber===_e});e&&e.id!==xe&&ln(e)}},[xe,W,_e,ln,pe]),t.useEffect(function(){xe&&!pe.some(function(e){var n;return e.id===xe&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&sn()},[xe,sn,pe]);var cn=t.useMemo(function(){var n=pe.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===B)return n;var t=["low","medium","high"].filter(function(e){return e!==R}),i=e.__spreadArray([R],t,!0),r=new Map(i.map(function(e,n){return[e,n]}));return n.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,a,l,s=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==s?i.length:null!==(a=r.get(s))&&void 0!==a?a:i.length)-(null==u?i.length:null!==(l=r.get(u))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[B,R,pe]),gn=cn.findIndex(function(e){return e.id===Se}),fn=t.useState(null),vn=fn[0],pn=fn[1],mn=t.useRef(!1),hn=t.useCallback(function(e){var n=cn[e];n&&ln(n)},[cn,ln]);t.useEffect(function(){Se&&!cn.some(function(e){return e.id===Se})&&je(null)},[cn,Se]),t.useEffect(function(){mn.current=!1,pn(gn>=0?String(gn+1):null)},[gn,cn.length]),t.useEffect(function(){if(mn.current&&null!=vn){var e=window.setTimeout(function(){var e=Number(vn.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<cn.length&&(mn.current=!1,hn(n))},300);return function(){return window.clearTimeout(e)}}},[hn,vn,cn.length]);var _n=t.useMemo(function(){var e=new Map;pe.forEach(function(n){var t,i=null!==(t=e.get(n.segment.stable_key))&&void 0!==t?t:[];i.push(n),e.set(n.segment.stable_key,i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=fe.get(t))&&void 0!==i?i:1;e.sort(function(e,n){return e.reviewStepIndex-n.reviewStepIndex}).forEach(function(e,t){n.set(e.id,"".concat(r).concat(function(e){for(var n=e+1,t="";n>0;)n-=1,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}(t)))})}),n},[pe,fe]),bn=t.useMemo(function(){var e=new Map;pe.forEach(function(n){var t,i=null!==(t=e.get(n.pageNumber))&&void 0!==t?t:[];i.push(n),e.set(n.pageNumber,i)});var n=new Map;return e.forEach(function(e){e.forEach(function(e,t){return n.set(e.id,t)})}),n},[pe]),wn=t.useCallback(function(e){return{startPage:Math.max(0,e.startPage-O),endPage:Math.min(e.numPages-1,e.endPage+O)}},[O]),xn=t.useCallback(function(){var e,n=He.current,t=Ge.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),o=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();pe.forEach(function(e){var n,r=Ve.current.get(e.id);if(r){var a=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(a){var l=a.getBoundingClientRect(),s=null!==(n=bn.get(e.id))&&void 0!==n?n:0,u=l.top+H+40*s,d=u+(r.offsetHeight||32),c=u>=o.top&&d<=o.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}})}},[H,bn,pe]),yn=t.useCallback(function(e){var n=Oe.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(Oe.current=null,xn(),requestAnimationFrame(function(){if(null==Oe.current){var e=Ve.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Ae(e)}}))},[xn]);return t.useEffect(function(){var e=Ge.current;if(e&&M){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,xn()}))};e.addEventListener("scroll",t,!0),window.addEventListener("resize",t);var i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});var r="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==r||r.observe(e),t(),function(){null!=n&&cancelAnimationFrame(n),e.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t),i.disconnect(),null==r||r.disconnect()}}},[M,xn]),n.jsxs("div",e.__assign({ref:He,className:oe,style:e.__assign(e.__assign({},ae),{display:"flex",position:"relative",width:"100%",height:"100%",minWidth:0,overflow:"hidden"})},{children:[n.jsxs("div",e.__assign({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,flex:"1 1 0",width:"100%",minWidth:0,height:"100%",boxSizing:"border-box"}},{children:[n.jsx("div",e.__assign({ref:Ge,style:e.__assign(e.__assign({},le),{flex:"1 1 0",width:"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:n.jsx(r.default,e.__assign({defaultScale:i.SpecialZoomLevel.PageFit,highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},E,{pdfUrl:S,pdfName:j,segments:me,navigationRequest:Fe,onNavigationSettled:yn,setRenderRange:wn,onCurrentPageChange:function(e){be(e),null==Oe.current&&Qe&&Qe.pageNumber!==e&&sn(),null==$||$(e)}}))})),M&&n.jsxs("aside",e.__assign({"aria-label":"Page review badges",ref:ve,style:e.__assign(e.__assign({},se),{position:"relative",width:Ke,maxWidth:f,flex:"0 1 ".concat(Ke),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[q&&cn.length>0&&n.jsxs("nav",e.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:U||"auto",left:Z||"auto",zIndex:2,display:"flex",alignItems:"center",gap:7,width:128,minHeight:40,padding:"4px 6px",border:"1px solid #CBD5E1",borderRadius:6,backgroundColor:"#FFFFFF",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.06)",font:"inherit"}},{children:[n.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=vn?vn:"-","aria-label":"Review badge number",onChange:function(e){mn.current=!0,pn(e.target.value)},style:{width:30,height:28,padding:0,border:"1px solid #A5B4FC",borderRadius:3,color:"#4F46E5",backgroundColor:"#FFFFFF",textAlign:"center",font:"inherit",fontSize:15,outline:"none"}}),n.jsxs("span",e.__assign({"aria-label":"".concat(cn.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",cn.length]})),["previous","next"].map(function(t){var i="previous"===t,r=gn+(i?-1:1),o=r<0||r>=cn.length;return n.jsx("button",e.__assign({type:"button","aria-label":"".concat(i?"Previous":"Next"," review badge"),disabled:o,onClick:function(){return hn(r)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:o?"#C7D2FE":"#4F46E5",cursor:o?"default":"pointer"}},{children:n.jsx("svg",e.__assign({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:n.jsx("path",{d:i?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),t)})]})),pe.map(function(t){var i,r,o=xe===t.id,a=null!==(i=_n.get(t.id))&&void 0!==i?i:"1A",l=t.review_step.score,s=t.review_step.confidence,u=g.formatScore(l,s),f=!0===(null===(r=t.segment.confidence)||void 0===r?void 0:r.awaiting_llm),v=g.getConfidenceColors(l,s,f),p=t.review_step.review&&null!==t.review_step.review.action,m=Boolean(p)||f;return n.jsx(c.Tooltip,e.__assign({title:f?"data is being processed":"",arrow:!0},{children:n.jsx("span",e.__assign({ref:function(e){e?Ve.current.set(t.id,e):Ve.current.delete(t.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:m?"not-allowed":"pointer"}},{children:n.jsx("button",e.__assign({disabled:m,type:"button","aria-pressed":o,"aria-label":f?"".concat(t.review_step.type," · Page ").concat(t.pageNumber," · Data is being processed"):"".concat(t.review_step.type," · Page ").concat(t.pageNumber),onClick:function(){return ln(t)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:p&&!f?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(p&&!f?"#E2E8F0":v.border),borderRadius:16,backgroundColor:p&&!f?"#F8FAFC":v.background,color:p&&!f?"#475569":v.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:p&&!f?n.jsxs(c.Typography,e.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:[n.jsx("svg",e.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===u?u:"".concat(u,"%")}))]})),n.jsxs("span",e.__assign({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[n.jsx("svg",e.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),n.jsx("span",e.__assign({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:n.jsx(d.CircleCheck,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]})):n.jsxs(c.Typography,e.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:[n.jsx("svg",e.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M0.399902 0V14",stroke:v.divider,strokeWidth:"0.8"})})),n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===u?u:"".concat(u,"%")}))]}))]}))}))}))}),t.id)})]}))]})),Qe&&Me&&n.jsxs(a.default,e.__assign({anchorElement:Me,placement:"bottom-start",offset:{top:8},width:Math.min(Xe,f),maxWidth:f},{children:[Ne&&n.jsx(l.default,{width:"100%",maxWidth:"100%",score:Qe.review_step.score,reason:Qe.review_step.reason,gap:Qe.review_step.gap,onBack:function(){return Ee(!1)},onClose:sn}),n.jsx("div",e.__assign({style:{display:Ne?"none":"block"}},{children:Qe.review_step.review&&Qe.review_step.human_resolution?n.jsx(n.Fragment,{}):"boundary"===Qe.kind?n.jsx(o.default,{width:"100%",maxWidth:"100%",title:Qe.segment.label||Qe.segment.title,pageNo:"Page ".concat(Qe.pageNumber),content:Qe.review_step.reason,cognitiveScore:Qe.review_step.score,metadata:Qe.metadata,previousSegmentTitle:nn,nextSegmentTitle:tn,defaultStartPage:Qe.segment.start_page,defaultEndPage:Qe.segment.end_page,styles:{root:{borderColor:rn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:rn.text}}},confirmDisabled:te||ze===Qe.id,onConfirm:function(e,n,t){t&&o.isBoundaryReviewAction(n.id)&&dn(Qe,n.id,t)},onAdjustManually:function(){return null==ie?void 0:ie(v(Qe))},onCognitiveClick:on?function(){Ee(!0),null==re||re(v(Qe))}:void 0,onClose:sn},Qe.id):n.jsx(s.default,{width:"100%",maxWidth:"100%",title:Qe.metadata.current_label||Qe.segment.label||Qe.segment.title,pageNo:"Pages ".concat(Qe.segment.start_page,"-").concat(Qe.segment.end_page),content:Qe.review_step.reason,cognitiveScore:Qe.review_step.score,metadata:Qe.metadata,styles:{root:{borderColor:rn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:rn.text}}},confirmDisabled:te||ze===Qe.id,onActionConfirm:function(e,n){dn(Qe,e,n)},onAdjustManually:function(){return null==ie?void 0:ie(v(Qe))},onCognitiveClick:on?function(){Ee(!0),null==re||re(v(Qe))}:void 0,onClose:sn},Qe.id)}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("@react-pdf-viewer/core"),r=require("../PdfViewer/PdfViewer.js"),o=require("./BoundaryCard.js"),a=require("./CardWrapper.js"),l=require("./CognitiveIntegrity.js"),s=require("./LabelCheck.js"),u=require("./reviewStepAdapters.js"),d=require("lucide-react"),c=require("@mui/material"),g=require("./helper.js"),f=260,v=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};exports.default=function(p){var m,h,_,b,w,x,y,C,S,E,k=this,j=p.pdfUrl,R=p.pdfName,I=p.segments,N=p.styles,M=p.pdfViewerProps,A=p.showBadges,F=void 0===A||A,B=p.sortByConfidence,P=void 0===B?"low":B,q=p.filterByConfidence,L=void 0===q?"all":q,W=p.showBadgeNavigation,z=void 0===W||W,T=p.autoSelectReviewOnPageChange,O=void 0!==T&&T,D=p.autoAdvanceAfterConfirm,V=void 0===D||D,G=p.badgePreloadPages,H=void 0===G?8:G,U=p.badgeOffsetTop,X=void 0===U?20:U,J=p.badgeOffsetRight,Y=void 0===J?68:J,Z=p.badgeOffsetLeft,K=void 0===Z?0:Z,Q=p.initialReviewId,$=p.onBoundaryAction,ee=p.onLabelAction,ne=p.onActiveReviewChange,te=p.onCurrentPageChange,ie=p.onActionError,re=p.disableAllActions,oe=void 0!==re&&re,ae=p.onAdjustManually,le=p.onCognitiveClick,se=p.className,ue=p.style,de=p.viewerStyle,ce=p.railStyle,ge=p.redirectionData,fe=t.useMemo(function(){return u.extractSegmentReviewData(I)},[I]),ve=fe.boundaryReviews,pe=fe.labelReviews,me=t.useMemo(function(){return new Map(I.map(function(e,n){return[e.stable_key,n+1]}))},[I]),he=t.useRef(null),_e=t.useMemo(function(){return e.__spreadArray(e.__spreadArray([],ve.map(function(n){var t;return e.__assign(e.__assign({},n),{kind:"boundary",pageNumber:null!==(t=n.metadata.focus_page)&&void 0!==t?t:n.segment.start_page})}),!0),pe.map(function(n){return e.__assign(e.__assign({},n),{kind:"label",pageNumber:n.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=me.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=me.get(n.segment.stable_key))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-o||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[ve,pe,me]),be=t.useMemo(function(){return I.map(function(n){var t;return e.__assign(e.__assign({},n),{title:(null===(t=n.label)||void 0===t?void 0:t.trim())||n.title})})},[I]),we=t.useState(1),xe=we[0],ye=we[1],Ce=t.useState(null!=Q?Q:null),Se=Ce[0],Ee=Ce[1],ke=t.useState(null!=Q?Q:null),je=ke[0],Re=ke[1],Ie=t.useState(!1),Ne=Ie[0],Me=Ie[1],Ae=t.useState(null),Fe=Ae[0],Be=Ae[1],Pe=t.useState(null),qe=Pe[0],Le=Pe[1],We=t.useState(function(){return new Set}),ze=We[0],Te=We[1],Oe=t.useState(null),De=Oe[0],Ve=Oe[1],Ge=t.useRef(0),He=t.useRef(null),Ue=t.useRef(null),Xe=t.useRef(new Map),Je=t.useRef(null),Ye=t.useRef(null),Ze=t.useState(f),Ke=Ze[0],Qe=Ze[1],$e=null!==(h=null===(m=null==N?void 0:N.aside)||void 0===m?void 0:m.width)&&void 0!==h?h:"40%",en="min(".concat("number"==typeof $e?"".concat($e,"px"):$e,", ").concat(f,"px, 100%)");t.useEffect(function(){var e=he.current;if(e&&F){var n=function(){var n=e.getBoundingClientRect().width;n>0&&Qe(n)};n();var t="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==t||t.observe(e),function(){return null==t?void 0:t.disconnect()}}},[F]),t.useMemo(function(){var e=new Set(ze);return _e.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[ze,_e]);var nn=t.useMemo(function(){var e;return null!==(e=_e.find(function(e){return e.id===Se}))&&void 0!==e?e:null},[Se,_e]),tn=null==nn?-1:I.findIndex(function(e){return e.stable_key===nn.segment.stable_key}),rn=tn>0?I[tn-1]:void 0,on=tn>=0?I[tn+1]:void 0,an=(null===(_=null==rn?void 0:rn.label)||void 0===_?void 0:_.trim())||(null==rn?void 0:rn.title),ln=(null===(b=null==on?void 0:on.label)||void 0===b?void 0:b.trim())||(null==on?void 0:on.title),sn=g.getConfidenceColors(null==nn?void 0:nn.review_step.score,null==nn?void 0:nn.review_step.confidence,null===(w=null==nn?void 0:nn.segment.confidence)||void 0===w?void 0:w.awaiting_llm),un=(null===(x=null==nn?void 0:nn.review_step.reasons)||void 0===x?void 0:x.length)?nn.review_step.reasons:null!==(C=null===(y=null==nn?void 0:nn.segment.confidence)||void 0===y?void 0:y.reasons)&&void 0!==C?C:[],dn=Boolean(un.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(S=null==nn?void 0:nn.review_step.reason)||void 0===S?void 0:S.trim())||(null===(E=null==nn?void 0:nn.review_step.gap)||void 0===E?void 0:E.trim())),cn=t.useCallback(function(e,n){Ge.current+=1,He.current={requestId:Ge.current,pageNumber:e,reviewId:n},Le({pageNumber:e,requestId:Ge.current})},[]),gn=t.useCallback(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(Ee(e.id),Re(e.id),Me(!1),Be(null),cn(e.pageNumber,e.id),null==ne||ne(e.id,e.segment))},[ne,cn]);t.useEffect(function(){if((null==ge?void 0:ge.pageNumber)&&ge.type){var e=Number(ge.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=_e.find(function(n){return n.segment.start_page===e&&n.kind===ge.type});n&&gn(n)}}},[ge,gn,_e]);var fn=t.useCallback(function(){He.current=null,Me(!1),Ee(null),Be(null),null==ne||ne(null,null)},[ne]),vn=t.useCallback(function(e){var n;if(V){var t=_e.findIndex(function(n){return n.id===e}),i=new Set(_e.map(function(e){return e.id})),r=null!==(n=_e.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:_e.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return gn(r)}):fn()}else fn()},[V,fn,_e,gn,_e]),pn=t.useCallback(function(n,t,i){return e.__awaiter(k,void 0,void 0,function(){var r,a,l,s,u;return e.__generator(this,function(e){switch(e.label){case 0:if(oe)return[2];r=v(n),a=t,l="boundary"===n.kind&&null!=$&&V&&(a===o.BoundaryReviewActionEnum.SPLIT_HERE||a===o.BoundaryReviewActionEnum.MERGE_NEXT||a===o.BoundaryReviewActionEnum.MERGE_PREVIOUS),s=l?I.findIndex(function(e){return e.stable_key===n.segment.stable_key}):-1,l&&s>=0&&(Ue.current={action:a,originalSegmentIndex:s,segmentSignature:JSON.stringify(I.map(function(e){return e.stable_key})),ready:!1}),Ve(n.id),e.label=1;case 1:return e.trys.push([1,6,7,8]),"boundary"!==n.kind?[3,3]:[4,null==$?void 0:$(t,i,r)];case 2:return e.sent(),[3,5];case 3:return[4,null==ee?void 0:ee(t,i,r)];case 4:e.sent(),e.label=5;case 5:return Te(function(e){var t=new Set(e);return t.add(n.id),t}),Ue.current?Ue.current.ready=!0:vn(n.id),[3,8];case 6:return u=e.sent(),l&&(Ue.current=null),null==ie||ie(u,r),[3,8];case 7:return Ve(null),[7];case 8:return[2]}})})},[V,oe,ie,$,ee,I,vn]);t.useEffect(function(){var e=Ue.current;if((null==e?void 0:e.ready)&&JSON.stringify(I.map(function(e){return e.stable_key}))!==e.segmentSignature){var n=e.action===o.BoundaryReviewActionEnum.MERGE_PREVIOUS?e.originalSegmentIndex:e.originalSegmentIndex+1,t=new Map(I.map(function(e,n){return[e.stable_key,n]})),i=_e.find(function(e){var i,r=t.get(e.segment.stable_key);return null!=r&&r>=n&&null==e.review_step.review&&!ze.has(e.id)&&!0!==(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm)});if(!i)return Ue.current=null,void fn();requestAnimationFrame(function(){Ue.current=null,gn(i)})}},[fn,ze,_e,I,gn]),t.useEffect(function(){Ue.current||Se&&!_e.some(function(e){return e.id===Se})&&fn()},[Se,fn,_e]),t.useEffect(function(){if(O&&!Ue.current){var e=_e.find(function(e){return e.pageNumber===xe});e&&e.id!==Se&&gn(e)}},[Se,O,xe,gn,_e]),t.useEffect(function(){Ue.current||Se&&!_e.some(function(e){var n;return e.id===Se&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&fn()},[Se,fn,_e]);var mn=t.useMemo(function(){var n=_e.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===L)return n;var t=["low","medium","high"].filter(function(e){return e!==P}),i=e.__spreadArray([P],t,!0),r=new Map(i.map(function(e,n){return[e,n]}));return n.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,a,l,s=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==s?i.length:null!==(a=r.get(s))&&void 0!==a?a:i.length)-(null==u?i.length:null!==(l=r.get(u))&&void 0!==l?l:i.length)||e.index-n.index}).map(function(e){return e.item})},[L,P,_e]),hn=mn.findIndex(function(e){return e.id===je}),_n=t.useState(null),bn=_n[0],wn=_n[1],xn=t.useRef(!1),yn=t.useCallback(function(e){var n=mn[e];n&&gn(n)},[mn,gn]);t.useEffect(function(){je&&!mn.some(function(e){return e.id===je})&&Re(null)},[mn,je]),t.useEffect(function(){xn.current=!1,wn(hn>=0?String(hn+1):null)},[hn,mn.length]),t.useEffect(function(){if(xn.current&&null!=bn){var e=window.setTimeout(function(){var e=Number(bn.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<mn.length&&(xn.current=!1,yn(n))},300);return function(){return window.clearTimeout(e)}}},[yn,bn,mn.length]);var Cn=t.useMemo(function(){var e=new Map;_e.forEach(function(n){var t,i=null!==(t=e.get(n.segment.stable_key))&&void 0!==t?t:[];i.push(n),e.set(n.segment.stable_key,i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=me.get(t))&&void 0!==i?i:1;e.sort(function(e,n){return e.reviewStepIndex-n.reviewStepIndex}).forEach(function(e,t){n.set(e.id,"".concat(r).concat(function(e){for(var n=e+1,t="";n>0;)n-=1,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}(t)))})}),n},[_e,me]),Sn=t.useMemo(function(){var e=new Map;_e.forEach(function(n){var t,i=null!==(t=e.get(n.pageNumber))&&void 0!==t?t:[];i.push(n),e.set(n.pageNumber,i)});var n=new Map;return e.forEach(function(e){e.forEach(function(e,t){return n.set(e.id,t)})}),n},[_e]),En=t.useCallback(function(e){return{startPage:Math.max(0,e.startPage-H),endPage:Math.min(e.numPages-1,e.endPage+H)}},[H]),kn=t.useCallback(function(){var e,n=Je.current,t=Ye.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),o=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();_e.forEach(function(e){var n,r=Xe.current.get(e.id);if(r){var a=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(a){var l=a.getBoundingClientRect(),s=null!==(n=Sn.get(e.id))&&void 0!==n?n:0,u=l.top+X+40*s,d=u+(r.offsetHeight||32),c=u>=o.top&&d<=o.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}})}},[X,Sn,_e]),jn=t.useCallback(function(e){var n=He.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(He.current=null,kn(),requestAnimationFrame(function(){if(null==He.current){var e=Xe.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Be(e)}}))},[kn]);return t.useEffect(function(){var e=Ye.current;if(e&&F){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,kn()}))};e.addEventListener("scroll",t,!0),window.addEventListener("resize",t);var i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});var r="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==r||r.observe(e),t(),function(){null!=n&&cancelAnimationFrame(n),e.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t),i.disconnect(),null==r||r.disconnect()}}},[F,kn]),n.jsxs("div",e.__assign({ref:Je,className:se,style:e.__assign(e.__assign({},ue),{display:"block",position:"relative",width:"100%",height:"100%",minWidth:0,overflowX:"auto",overflowY:"hidden"})},{children:[n.jsxs("div",e.__assign({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,width:"100%",minWidth:650,height:"100%"}},{children:[n.jsx("div",e.__assign({ref:Ye,style:e.__assign(e.__assign({},de),{flex:"1 1 auto",width:F?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:n.jsx(r.default,e.__assign({defaultScale:i.SpecialZoomLevel.PageFit,highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},M,{pdfUrl:j,pdfName:R,segments:be,navigationRequest:qe,onNavigationSettled:jn,setRenderRange:En,onCurrentPageChange:function(e){ye(e),null==He.current&&nn&&nn.pageNumber!==e&&fn(),null==te||te(e)}}))})),F&&n.jsxs("aside",e.__assign({"aria-label":"Page review badges",ref:he,style:e.__assign(e.__assign({},ce),{position:"relative",width:en,maxWidth:f,flex:"0 1 ".concat(en),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[z&&mn.length>0&&n.jsxs("nav",e.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:Y||"auto",left:K||"auto",zIndex:2,display:"flex",alignItems:"center",gap:7,width:128,minHeight:40,padding:"4px 6px",border:"1px solid #CBD5E1",borderRadius:6,backgroundColor:"#FFFFFF",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.06)",font:"inherit"}},{children:[n.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=bn?bn:"-","aria-label":"Review badge number",onChange:function(e){xn.current=!0,wn(e.target.value)},style:{width:30,height:28,padding:0,border:"1px solid #A5B4FC",borderRadius:3,color:"#4F46E5",backgroundColor:"#FFFFFF",textAlign:"center",font:"inherit",fontSize:15,outline:"none"}}),n.jsxs("span",e.__assign({"aria-label":"".concat(mn.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",mn.length]})),["previous","next"].map(function(t){var i="previous"===t,r=hn+(i?-1:1),o=r<0||r>=mn.length;return n.jsx("button",e.__assign({type:"button","aria-label":"".concat(i?"Previous":"Next"," review badge"),disabled:o,onClick:function(){return yn(r)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:o?"#C7D2FE":"#4F46E5",cursor:o?"default":"pointer"}},{children:n.jsx("svg",e.__assign({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:n.jsx("path",{d:i?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),t)})]})),_e.map(function(t){var i,r,o=Se===t.id,a=null!==(i=Cn.get(t.id))&&void 0!==i?i:"1A",l=t.review_step.score,s=t.review_step.confidence,u=g.formatScore(l,s),f=!0===(null===(r=t.segment.confidence)||void 0===r?void 0:r.awaiting_llm),v=g.getConfidenceColors(l,s,f),p=t.review_step.review&&null!==t.review_step.review.action,m=Boolean(p)||f;return n.jsx(c.Tooltip,e.__assign({title:f?"data is being processed":"",arrow:!0},{children:n.jsx("span",e.__assign({ref:function(e){e?Xe.current.set(t.id,e):Xe.current.delete(t.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:m?"not-allowed":"pointer"}},{children:n.jsx("button",e.__assign({disabled:m,type:"button","aria-pressed":o,"aria-label":f?"".concat(t.review_step.type," · Page ").concat(t.pageNumber," · Data is being processed"):"".concat(t.review_step.type," · Page ").concat(t.pageNumber),onClick:function(){return gn(t)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:p&&!f?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(p&&!f?"#E2E8F0":v.border),borderRadius:16,backgroundColor:p&&!f?"#F8FAFC":v.background,color:p&&!f?"#475569":v.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:p&&!f?n.jsxs(c.Typography,e.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:[n.jsx("svg",e.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===u?u:"".concat(u,"%")}))]})),n.jsxs("span",e.__assign({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[n.jsx("svg",e.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),n.jsx("span",e.__assign({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:n.jsx(d.CircleCheck,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]})):n.jsxs(c.Typography,e.__assign({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},{children:[n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500}},{children:a})),n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:[n.jsx("svg",e.__assign({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M0.399902 0V14",stroke:v.divider,strokeWidth:"0.8"})})),n.jsx("span",e.__assign({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===u?u:"".concat(u,"%")}))]}))]}))}))}))}),t.id)})]}))]})),nn&&Fe&&n.jsxs(a.default,e.__assign({anchorElement:Fe,placement:"bottom-start",offset:{top:8},width:Math.min(Ke,f),maxWidth:f},{children:[Ne&&n.jsx(l.default,{width:"100%",maxWidth:"100%",score:nn.review_step.score,reasons:un,reason:nn.review_step.reason,gap:nn.review_step.gap,onBack:function(){return Me(!1)},onClose:fn}),n.jsx("div",e.__assign({style:{display:Ne?"none":"block"}},{children:nn.review_step.review&&nn.review_step.human_resolution?n.jsx(n.Fragment,{}):"boundary"===nn.kind?n.jsx(o.default,{width:"100%",maxWidth:"100%",title:nn.segment.label||nn.segment.title,pageNo:"Page ".concat(nn.pageNumber),content:nn.review_step.reason,cognitiveScore:nn.review_step.score,metadata:nn.metadata,previousSegmentTitle:an,nextSegmentTitle:ln,defaultStartPage:nn.segment.start_page,defaultEndPage:nn.segment.end_page,styles:{root:{borderColor:sn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:sn.text}}},confirmDisabled:oe||De===nn.id,onConfirm:function(e,n,t){t&&o.isBoundaryReviewAction(n.id)&&pn(nn,n.id,t)},onAdjustManually:function(){return null==ae?void 0:ae(v(nn))},onCognitiveClick:dn?function(){Me(!0),null==le||le(v(nn))}:void 0,onClose:fn},nn.id):n.jsx(s.default,{width:"100%",maxWidth:"100%",title:nn.metadata.current_label||nn.segment.label||nn.segment.title,pageNo:"Pages ".concat(nn.segment.start_page,"-").concat(nn.segment.end_page),content:nn.review_step.reason,cognitiveScore:nn.review_step.score,metadata:nn.metadata,styles:{root:{borderColor:sn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:sn.text}}},confirmDisabled:oe||De===nn.id,onActionConfirm:function(e,n){pn(nn,e,n)},onAdjustManually:function(){return null==ae?void 0:ae(v(nn))},onCognitiveClick:dn?function(){Me(!0),null==le||le(v(nn))}:void 0,onClose:fn},nn.id)}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=SegmentReviewPdfWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e,__spreadArray as i}from"tslib";import{jsx as o,jsxs as t}from"react/jsx-runtime";import r from"@mui/icons-material/ChevronLeft";import n from"@mui/icons-material/Close";import l from"@mui/material/Box";import a from"@mui/material/Divider";import m from"@mui/material/IconButton";import c from"@mui/material/Paper";import s from"@mui/material/Stack";import d from"@mui/material/Typography";import u from"../CitationRenderer/MarkdownRenderer.js";import h from"./CognitiveIcon.js";import p from"./CognitiveScoreBadge.js";var g=function(e,o){return i([e],Array.isArray(o)?o:null==o?[]:[o],!0)};function f(i){var f=i.reasons,x=i.reason,v=i.gap,y=i.score,b=i.headerName,C=void 0===b?"Cognitive Integrity":b,w=i.onBack,k=i.onClose,H=i.showCloseButton,S=void 0===H||H,z=i.width,B=void 0===z?260:z,W=i.maxWidth,R=void 0===W?260:W,I=i.className,j=i.styles,A=(null!=f?f:[]).filter(function(e){return"evidence"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),L=(null!=f?f:[]).filter(function(e){return"gap"===e.type.trim().toLowerCase()}).map(function(e){return e.text.trim()}).filter(Boolean),M=null==x?void 0:x.trim(),N=null==v?void 0:v.trim();if(0===A.length&&M&&A.push(M),0===L.length&&N&&L.push(N),0===A.length&&0===L.length)return null;var T,D=(T=null==j?void 0:j.markdown,e(e({},T),{containerWrapper:e(e({},null==T?void 0:T.containerWrapper),{display:"block",height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto"}),mainCard:e(e({},null==T?void 0:T.mainCard),{height:"auto",minHeight:0,maxHeight:"none",flex:"0 0 auto",padding:0,border:"none",borderRadius:0,boxShadow:"none",backgroundColor:"transparent"}),scrollArea:e(e({},null==T?void 0:T.scrollArea),{height:"auto",minHeight:0,maxHeight:"none",overflowY:"visible",paddingRight:0,color:"#475467",fontSize:11.5,lineHeight:1.3})}));return o(c,e({className:I,elevation:4,sx:g({width:B,maxWidth:R,height:"fit-content",minHeight:0,alignSelf:"flex-start",flex:"0 0 auto",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==j?void 0:j.root)},{children:t(s,e({spacing:.75,sx:{p:1,height:"auto",minHeight:0}},{children:[t(s,e({direction:"row",alignItems:"center",spacing:.75,sx:null==j?void 0:j.header},{children:[w&&o(m,e({size:"small",onClick:w,"aria-label":"Return to review check",sx:{p:0,color:"#6941C6"}},{children:o(r,{sx:{fontSize:17}})})),o(h,{sx:{color:"#6941C6"}}),o(d,e({sx:{flex:1,fontSize:12,fontWeight:500,alignItems:"center",display:"flex",lineHeight:1.25,textTransform:"capitalise"}},{children:C})),o(p,{score:y}),S&&o(m,e({size:"small",onClick:k,disabled:!k,"aria-label":"Close cognitive integrity",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:o(n,{sx:{fontSize:17}})}))]})),t(s,e({spacing:.75,sx:g({height:"auto",minHeight:0,flex:"0 0 auto"},null==j?void 0:j.content)},{children:[A.length>0&&t(l,e({sx:{marginTop:4}},{children:[o(d,e({sx:{mt:1,mb:.25,color:"text.primary",fontSize:12,fontWeight:500}},{children:"Decision Making Factors"})),o(a,{sx:{my:.625}}),o(l,e({component:"ol",sx:{m:0,pl:2.5}},{children:A.map(function(i,t){return o(l,e({component:"li",sx:{mb:.5,pl:.25}},{children:o(u,{value:"<summary>".concat(i,"</summary>"),styles:D})}),"evidence-".concat(t))})}))]})),L.length>0&&t(l,e({sx:null==j?void 0:j.section},{children:[o(d,e({sx:{mb:.25,color:"text.primary",fontSize:12,fontWeight:500}},{children:"Gap"})),o(a,{sx:{my:.625}}),o(l,e({component:"ol",sx:{m:0,pl:2.5}},{children:L.map(function(i,t){return o(l,e({component:"li",sx:{mb:.5,pl:.25}},{children:o(u,{value:"<summary>".concat(i,"</summary>"),styles:D})}),"gap-".concat(t))})}))]}))]}))]}))}))}export{f as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveIntegrity.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as e,__assign as n,__awaiter as t,__generator as i}from"tslib";import{jsxs as r,jsx as o,Fragment as l}from"react/jsx-runtime";import{useMemo as a,useRef as d,useState as u,useEffect as s,useCallback as c}from"react";import{SpecialZoomLevel as f}from"@react-pdf-viewer/core";import v from"../PdfViewer/PdfViewer.js";import g,{isBoundaryReviewAction as p}from"./BoundaryCard.js";import m from"./CardWrapper.js";import h from"./CognitiveIntegrity.js";import b from"./LabelCheck.js";import{extractSegmentReviewData as w}from"./reviewStepAdapters.js";import{CircleCheck as y}from"lucide-react";import{Tooltip as x,Typography as _}from"@mui/material";import{getConfidenceColors as C,formatScore as N}from"./helper.js";var S=260,k=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};function I(I){var A,E,F,M,R,B,P,L=this,W=I.pdfUrl,z=I.pdfName,j=I.segments,q=I.styles,T=I.pdfViewerProps,D=I.showBadges,O=void 0===D||D,V=I.sortByConfidence,H=void 0===V?"low":V,G=I.filterByConfidence,U=void 0===G?"all":G,X=I.showBadgeNavigation,J=void 0===X||X,K=I.autoSelectReviewOnPageChange,Q=void 0!==K&&K,Y=I.autoAdvanceAfterConfirm,Z=void 0===Y||Y,$=I.badgePreloadPages,ee=void 0===$?8:$,ne=I.badgeOffsetTop,te=void 0===ne?20:ne,ie=I.badgeOffsetRight,re=void 0===ie?68:ie,oe=I.badgeOffsetLeft,le=void 0===oe?0:oe,ae=I.initialReviewId,de=I.onBoundaryAction,ue=I.onLabelAction,se=I.onActiveReviewChange,ce=I.onCurrentPageChange,fe=I.onActionError,ve=I.disableAllActions,ge=void 0!==ve&&ve,pe=I.onAdjustManually,me=I.onCognitiveClick,he=I.className,be=I.style,we=I.viewerStyle,ye=I.railStyle,xe=I.redirectionData,_e=a(function(){return w(j)},[j]),Ce=_e.boundaryReviews,Ne=_e.labelReviews,Se=a(function(){return new Map(j.map(function(e,n){return[e.stable_key,n+1]}))},[j]),ke=d(null),Ie=a(function(){return e(e([],Ce.map(function(e){var t;return n(n({},e),{kind:"boundary",pageNumber:null!==(t=e.metadata.focus_page)&&void 0!==t?t:e.segment.start_page})}),!0),Ne.map(function(e){return n(n({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=Se.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=Se.get(n.segment.stable_key))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-o||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[Ce,Ne,Se]),Ae=a(function(){return j.map(function(e){var t;return n(n({},e),{title:(null===(t=e.label)||void 0===t?void 0:t.trim())||e.title})})},[j]),Ee=u(1),Fe=Ee[0],Me=Ee[1],Re=u(null!=ae?ae:null),Be=Re[0],Pe=Re[1],Le=u(null!=ae?ae:null),We=Le[0],ze=Le[1],je=u(!1),qe=je[0],Te=je[1],De=u(null),Oe=De[0],Ve=De[1],He=u(null),Ge=He[0],Ue=He[1],Xe=u(function(){return new Set}),Je=Xe[0],Ke=Xe[1],Qe=u(null),Ye=Qe[0],Ze=Qe[1],$e=d(0),en=d(null),nn=d(new Map),tn=d(null),rn=d(null),on=u(S),ln=on[0],an=on[1],dn=null!==(E=null===(A=null==q?void 0:q.aside)||void 0===A?void 0:A.width)&&void 0!==E?E:"40%",un="number"==typeof dn?"min(".concat(dn,"px, ").concat(S,"px)"):"min(".concat(dn,", ").concat(S,"px)");s(function(){var e=ke.current;if(e&&O){var n=function(){var n=e.getBoundingClientRect().width;n>0&&an(n)};n();var t="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==t||t.observe(e),function(){return null==t?void 0:t.disconnect()}}},[O]),a(function(){var e=new Set(Je);return Ie.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[Je,Ie]);var sn=a(function(){var e;return null!==(e=Ie.find(function(e){return e.id===Be}))&&void 0!==e?e:null},[Be,Ie]),cn=null==sn?-1:j.findIndex(function(e){return e.stable_key===sn.segment.stable_key}),fn=cn>0?j[cn-1]:void 0,vn=cn>=0?j[cn+1]:void 0,gn=(null===(F=null==fn?void 0:fn.label)||void 0===F?void 0:F.trim())||(null==fn?void 0:fn.title),pn=(null===(M=null==vn?void 0:vn.label)||void 0===M?void 0:M.trim())||(null==vn?void 0:vn.title),mn=C(null==sn?void 0:sn.review_step.score,null==sn?void 0:sn.review_step.confidence,null===(R=null==sn?void 0:sn.segment.confidence)||void 0===R?void 0:R.awaiting_llm),hn=Boolean((null===(B=null==sn?void 0:sn.review_step.reason)||void 0===B?void 0:B.trim())||(null===(P=null==sn?void 0:sn.review_step.gap)||void 0===P?void 0:P.trim())),bn=c(function(e,n){$e.current+=1,en.current={requestId:$e.current,pageNumber:e,reviewId:n},Ue({pageNumber:e,requestId:$e.current})},[]),wn=c(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(Pe(e.id),ze(e.id),Te(!1),Ve(null),bn(e.pageNumber,e.id),null==se||se(e.id,e.segment))},[se,bn]);s(function(){if((null==xe?void 0:xe.pageNumber)&&xe.type){var e=Number(xe.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=Ie.find(function(n){return n.segment.start_page===e&&n.kind===xe.type});n&&wn(n)}}},[xe,wn,Ie]);var yn=c(function(){en.current=null,Te(!1),Pe(null),Ve(null),null==se||se(null,null)},[se]),xn=c(function(e){var n;if(Z){var t=Ie.findIndex(function(n){return n.id===e}),i=new Set(Ie.map(function(e){return e.id})),r=null!==(n=Ie.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:Ie.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return wn(r)}):yn()}else yn()},[Z,yn,Ie,wn,Ie]),_n=c(function(e,n,r){return t(L,void 0,void 0,function(){var t,o;return i(this,function(i){switch(i.label){case 0:if(ge)return[2];t=k(e),Ze(e.id),i.label=1;case 1:return i.trys.push([1,6,7,8]),"boundary"!==e.kind?[3,3]:[4,null==de?void 0:de(n,r,t)];case 2:return i.sent(),[3,5];case 3:return[4,null==ue?void 0:ue(n,r,t)];case 4:i.sent(),i.label=5;case 5:return Ke(function(n){var t=new Set(n);return t.add(e.id),t}),xn(e.id),[3,8];case 6:return o=i.sent(),null==fe||fe(o,t),[3,8];case 7:return Ze(null),[7];case 8:return[2]}})})},[ge,fe,de,ue,xn]);s(function(){Be&&!Ie.some(function(e){return e.id===Be})&&yn()},[Be,yn,Ie]),s(function(){if(Q){var e=Ie.find(function(e){return e.pageNumber===Fe});e&&e.id!==Be&&wn(e)}},[Be,Q,Fe,wn,Ie]),s(function(){Be&&!Ie.some(function(e){var n;return e.id===Be&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&yn()},[Be,yn,Ie]);var Cn=a(function(){var n=Ie.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===U)return n;var t=["low","medium","high"].filter(function(e){return e!==H}),i=e([H],t,!0),r=new Map(i.map(function(e,n){return[e,n]}));return n.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,l,a,d=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==d?i.length:null!==(l=r.get(d))&&void 0!==l?l:i.length)-(null==u?i.length:null!==(a=r.get(u))&&void 0!==a?a:i.length)||e.index-n.index}).map(function(e){return e.item})},[U,H,Ie]),Nn=Cn.findIndex(function(e){return e.id===We}),Sn=u(null),kn=Sn[0],In=Sn[1],An=d(!1),En=c(function(e){var n=Cn[e];n&&wn(n)},[Cn,wn]);s(function(){We&&!Cn.some(function(e){return e.id===We})&&ze(null)},[Cn,We]),s(function(){An.current=!1,In(Nn>=0?String(Nn+1):null)},[Nn,Cn.length]),s(function(){if(An.current&&null!=kn){var e=window.setTimeout(function(){var e=Number(kn.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<Cn.length&&(An.current=!1,En(n))},300);return function(){return window.clearTimeout(e)}}},[En,kn,Cn.length]);var Fn=a(function(){var e=new Map;Ie.forEach(function(n){var t,i=null!==(t=e.get(n.segment.stable_key))&&void 0!==t?t:[];i.push(n),e.set(n.segment.stable_key,i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=Se.get(t))&&void 0!==i?i:1;e.sort(function(e,n){return e.reviewStepIndex-n.reviewStepIndex}).forEach(function(e,t){n.set(e.id,"".concat(r).concat(function(e){for(var n=e+1,t="";n>0;)n-=1,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}(t)))})}),n},[Ie,Se]),Mn=a(function(){var e=new Map;Ie.forEach(function(n){var t,i=null!==(t=e.get(n.pageNumber))&&void 0!==t?t:[];i.push(n),e.set(n.pageNumber,i)});var n=new Map;return e.forEach(function(e){e.forEach(function(e,t){return n.set(e.id,t)})}),n},[Ie]),Rn=c(function(e){return{startPage:Math.max(0,e.startPage-ee),endPage:Math.min(e.numPages-1,e.endPage+ee)}},[ee]),Bn=c(function(){var e,n=tn.current,t=rn.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),o=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();Ie.forEach(function(e){var n,r=nn.current.get(e.id);if(r){var l=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(l){var a=l.getBoundingClientRect(),d=null!==(n=Mn.get(e.id))&&void 0!==n?n:0,u=a.top+te+40*d,s=u+(r.offsetHeight||32),c=u>=o.top&&s<=o.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}})}},[te,Mn,Ie]),Pn=c(function(e){var n=en.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(en.current=null,Bn(),requestAnimationFrame(function(){if(null==en.current){var e=nn.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Ve(e)}}))},[Bn]);return s(function(){var e=rn.current;if(e&&O){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,Bn()}))};e.addEventListener("scroll",t,!0),window.addEventListener("resize",t);var i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});var r="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==r||r.observe(e),t(),function(){null!=n&&cancelAnimationFrame(n),e.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t),i.disconnect(),null==r||r.disconnect()}}},[O,Bn]),r("div",n({ref:tn,className:he,style:n(n({},be),{display:"flex",position:"relative",width:"100%",height:"100%",minWidth:0,overflow:"hidden"})},{children:[r("div",n({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,flex:"1 1 0",width:"100%",minWidth:0,height:"100%",boxSizing:"border-box"}},{children:[o("div",n({ref:rn,style:n(n({},we),{flex:"1 1 0",width:"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:o(v,n({defaultScale:f.PageFit,highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},T,{pdfUrl:W,pdfName:z,segments:Ae,navigationRequest:Ge,onNavigationSettled:Pn,setRenderRange:Rn,onCurrentPageChange:function(e){Me(e),null==en.current&&sn&&sn.pageNumber!==e&&yn(),null==ce||ce(e)}}))})),O&&r("aside",n({"aria-label":"Page review badges",ref:ke,style:n(n({},ye),{position:"relative",width:un,maxWidth:S,flex:"0 1 ".concat(un),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[J&&Cn.length>0&&r("nav",n({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:re||"auto",left:le||"auto",zIndex:2,display:"flex",alignItems:"center",gap:7,width:128,minHeight:40,padding:"4px 6px",border:"1px solid #CBD5E1",borderRadius:6,backgroundColor:"#FFFFFF",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.06)",font:"inherit"}},{children:[o("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=kn?kn:"-","aria-label":"Review badge number",onChange:function(e){An.current=!0,In(e.target.value)},style:{width:30,height:28,padding:0,border:"1px solid #A5B4FC",borderRadius:3,color:"#4F46E5",backgroundColor:"#FFFFFF",textAlign:"center",font:"inherit",fontSize:15,outline:"none"}}),r("span",n({"aria-label":"".concat(Cn.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",Cn.length]})),["previous","next"].map(function(e){var t="previous"===e,i=Nn+(t?-1:1),r=i<0||i>=Cn.length;return o("button",n({type:"button","aria-label":"".concat(t?"Previous":"Next"," review badge"),disabled:r,onClick:function(){return En(i)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:r?"#C7D2FE":"#4F46E5",cursor:r?"default":"pointer"}},{children:o("svg",n({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:o("path",{d:t?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),e)})]})),Ie.map(function(e){var t,i,l=Be===e.id,a=null!==(t=Fn.get(e.id))&&void 0!==t?t:"1A",d=e.review_step.score,u=e.review_step.confidence,s=N(d,u),c=!0===(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm),f=C(d,u,c),v=e.review_step.review&&null!==e.review_step.review.action,g=Boolean(v)||c;return o(x,n({title:c?"data is being processed":"",arrow:!0},{children:o("span",n({ref:function(n){n?nn.current.set(e.id,n):nn.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:g?"not-allowed":"pointer"}},{children:o("button",n({disabled:g,type:"button","aria-pressed":l,"aria-label":c?"".concat(e.review_step.type," · Page ").concat(e.pageNumber," · Data is being processed"):"".concat(e.review_step.type," · Page ").concat(e.pageNumber),onClick:function(){return wn(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:v&&!c?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(v&&!c?"#E2E8F0":f.border),borderRadius:16,backgroundColor:v&&!c?"#F8FAFC":f.background,color:v&&!c?"#475569":f.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:r(_,n({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},v&&!c?{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:a})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===s?s:"".concat(s,"%")}))]})),r("span",n({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:o(y,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]}:{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:a})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:f.divider,strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===s?s:"".concat(s,"%")}))]}))]}))}))}))}),e.id)})]}))]})),sn&&Oe&&r(m,n({anchorElement:Oe,placement:"bottom-start",offset:{top:8},width:Math.min(ln,S),maxWidth:S},{children:[qe&&o(h,{width:"100%",maxWidth:"100%",score:sn.review_step.score,reason:sn.review_step.reason,gap:sn.review_step.gap,onBack:function(){return Te(!1)},onClose:yn}),o("div",n({style:{display:qe?"none":"block"}},{children:sn.review_step.review&&sn.review_step.human_resolution?o(l,{}):"boundary"===sn.kind?o(g,{width:"100%",maxWidth:"100%",title:sn.segment.label||sn.segment.title,pageNo:"Page ".concat(sn.pageNumber),content:sn.review_step.reason,cognitiveScore:sn.review_step.score,metadata:sn.metadata,previousSegmentTitle:gn,nextSegmentTitle:pn,defaultStartPage:sn.segment.start_page,defaultEndPage:sn.segment.end_page,styles:{root:{borderColor:mn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:mn.text}}},confirmDisabled:ge||Ye===sn.id,onConfirm:function(e,n,t){t&&p(n.id)&&_n(sn,n.id,t)},onAdjustManually:function(){return null==pe?void 0:pe(k(sn))},onCognitiveClick:hn?function(){Te(!0),null==me||me(k(sn))}:void 0,onClose:yn},sn.id):o(b,{width:"100%",maxWidth:"100%",title:sn.metadata.current_label||sn.segment.label||sn.segment.title,pageNo:"Pages ".concat(sn.segment.start_page,"-").concat(sn.segment.end_page),content:sn.review_step.reason,cognitiveScore:sn.review_step.score,metadata:sn.metadata,styles:{root:{borderColor:mn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:mn.text}}},confirmDisabled:ge||Ye===sn.id,onActionConfirm:function(e,n){_n(sn,e,n)},onAdjustManually:function(){return null==pe?void 0:pe(k(sn))},onCognitiveClick:hn?function(){Te(!0),null==me||me(k(sn))}:void 0,onClose:yn},sn.id)}))]}))]}))}export{I as default};
|
|
1
|
+
import{__spreadArray as e,__assign as n,__awaiter as t,__generator as i}from"tslib";import{jsxs as r,jsx as o,Fragment as l}from"react/jsx-runtime";import{useMemo as a,useRef as u,useState as d,useEffect as s,useCallback as c}from"react";import{SpecialZoomLevel as v}from"@react-pdf-viewer/core";import g from"../PdfViewer/PdfViewer.js";import f,{BoundaryReviewActionEnum as p,isBoundaryReviewAction as m}from"./BoundaryCard.js";import h from"./CardWrapper.js";import w from"./CognitiveIntegrity.js";import b from"./LabelCheck.js";import{extractSegmentReviewData as y}from"./reviewStepAdapters.js";import{CircleCheck as x}from"lucide-react";import{Tooltip as _,Typography as C}from"@mui/material";import{getConfidenceColors as S,formatScore as k}from"./helper.js";var N=260,I=function(e){return{reviewId:e.id,segment:e.segment,pageNumber:e.pageNumber}};function E(E){var A,F,M,R,P,B,L,W,z,j,O=this,T=E.pdfUrl,q=E.pdfName,D=E.segments,V=E.styles,G=E.pdfViewerProps,H=E.showBadges,U=void 0===H||H,X=E.sortByConfidence,J=void 0===X?"low":X,Y=E.filterByConfidence,K=void 0===Y?"all":Y,Q=E.showBadgeNavigation,Z=void 0===Q||Q,$=E.autoSelectReviewOnPageChange,ee=void 0!==$&&$,ne=E.autoAdvanceAfterConfirm,te=void 0===ne||ne,ie=E.badgePreloadPages,re=void 0===ie?8:ie,oe=E.badgeOffsetTop,le=void 0===oe?20:oe,ae=E.badgeOffsetRight,ue=void 0===ae?68:ae,de=E.badgeOffsetLeft,se=void 0===de?0:de,ce=E.initialReviewId,ve=E.onBoundaryAction,ge=E.onLabelAction,fe=E.onActiveReviewChange,pe=E.onCurrentPageChange,me=E.onActionError,he=E.disableAllActions,we=void 0!==he&&he,be=E.onAdjustManually,ye=E.onCognitiveClick,xe=E.className,_e=E.style,Ce=E.viewerStyle,Se=E.railStyle,ke=E.redirectionData,Ne=a(function(){return y(D)},[D]),Ie=Ne.boundaryReviews,Ee=Ne.labelReviews,Ae=a(function(){return new Map(D.map(function(e,n){return[e.stable_key,n+1]}))},[D]),Fe=u(null),Me=a(function(){return e(e([],Ie.map(function(e){var t;return n(n({},e),{kind:"boundary",pageNumber:null!==(t=e.metadata.focus_page)&&void 0!==t?t:e.segment.start_page})}),!0),Ee.map(function(e){return n(n({},e),{kind:"label",pageNumber:e.segment.start_page})}),!0).sort(function(e,n){var t,i,r=null!==(t=Ae.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=Ae.get(n.segment.stable_key))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-o||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[Ie,Ee,Ae]),Re=a(function(){return D.map(function(e){var t;return n(n({},e),{title:(null===(t=e.label)||void 0===t?void 0:t.trim())||e.title})})},[D]),Pe=d(1),Be=Pe[0],Le=Pe[1],We=d(null!=ce?ce:null),ze=We[0],je=We[1],Oe=d(null!=ce?ce:null),Te=Oe[0],qe=Oe[1],De=d(!1),Ve=De[0],Ge=De[1],He=d(null),Ue=He[0],Xe=He[1],Je=d(null),Ye=Je[0],Ke=Je[1],Qe=d(function(){return new Set}),Ze=Qe[0],$e=Qe[1],en=d(null),nn=en[0],tn=en[1],rn=u(0),on=u(null),ln=u(null),an=u(new Map),un=u(null),dn=u(null),sn=d(N),cn=sn[0],vn=sn[1],gn=null!==(F=null===(A=null==V?void 0:V.aside)||void 0===A?void 0:A.width)&&void 0!==F?F:"40%",fn="min(".concat("number"==typeof gn?"".concat(gn,"px"):gn,", ").concat(N,"px, 100%)");s(function(){var e=Fe.current;if(e&&U){var n=function(){var n=e.getBoundingClientRect().width;n>0&&vn(n)};n();var t="undefined"==typeof ResizeObserver?null:new ResizeObserver(n);return null==t||t.observe(e),function(){return null==t?void 0:t.disconnect()}}},[U]),a(function(){var e=new Set(Ze);return Me.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[Ze,Me]);var pn=a(function(){var e;return null!==(e=Me.find(function(e){return e.id===ze}))&&void 0!==e?e:null},[ze,Me]),mn=null==pn?-1:D.findIndex(function(e){return e.stable_key===pn.segment.stable_key}),hn=mn>0?D[mn-1]:void 0,wn=mn>=0?D[mn+1]:void 0,bn=(null===(M=null==hn?void 0:hn.label)||void 0===M?void 0:M.trim())||(null==hn?void 0:hn.title),yn=(null===(R=null==wn?void 0:wn.label)||void 0===R?void 0:R.trim())||(null==wn?void 0:wn.title),xn=S(null==pn?void 0:pn.review_step.score,null==pn?void 0:pn.review_step.confidence,null===(P=null==pn?void 0:pn.segment.confidence)||void 0===P?void 0:P.awaiting_llm),_n=(null===(B=null==pn?void 0:pn.review_step.reasons)||void 0===B?void 0:B.length)?pn.review_step.reasons:null!==(W=null===(L=null==pn?void 0:pn.segment.confidence)||void 0===L?void 0:L.reasons)&&void 0!==W?W:[],Cn=Boolean(_n.some(function(e){return e.text.trim()&&["evidence","gap"].includes(e.type.trim().toLowerCase())})||(null===(z=null==pn?void 0:pn.review_step.reason)||void 0===z?void 0:z.trim())||(null===(j=null==pn?void 0:pn.review_step.gap)||void 0===j?void 0:j.trim())),Sn=c(function(e,n){rn.current+=1,on.current={requestId:rn.current,pageNumber:e,reviewId:n},Ke({pageNumber:e,requestId:rn.current})},[]),kn=c(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(je(e.id),qe(e.id),Ge(!1),Xe(null),Sn(e.pageNumber,e.id),null==fe||fe(e.id,e.segment))},[fe,Sn]);s(function(){if((null==ke?void 0:ke.pageNumber)&&ke.type){var e=Number(ke.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=Me.find(function(n){return n.segment.start_page===e&&n.kind===ke.type});n&&kn(n)}}},[ke,kn,Me]);var Nn=c(function(){on.current=null,Ge(!1),je(null),Xe(null),null==fe||fe(null,null)},[fe]),In=c(function(e){var n;if(te){var t=Me.findIndex(function(n){return n.id===e}),i=new Set(Me.map(function(e){return e.id})),r=null!==(n=Me.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:Me.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return kn(r)}):Nn()}else Nn()},[te,Nn,Me,kn,Me]),En=c(function(e,n,r){return t(O,void 0,void 0,function(){var t,o,l,a,u;return i(this,function(i){switch(i.label){case 0:if(we)return[2];t=I(e),o=n,l="boundary"===e.kind&&null!=ve&&te&&(o===p.SPLIT_HERE||o===p.MERGE_NEXT||o===p.MERGE_PREVIOUS),a=l?D.findIndex(function(n){return n.stable_key===e.segment.stable_key}):-1,l&&a>=0&&(ln.current={action:o,originalSegmentIndex:a,segmentSignature:JSON.stringify(D.map(function(e){return e.stable_key})),ready:!1}),tn(e.id),i.label=1;case 1:return i.trys.push([1,6,7,8]),"boundary"!==e.kind?[3,3]:[4,null==ve?void 0:ve(n,r,t)];case 2:return i.sent(),[3,5];case 3:return[4,null==ge?void 0:ge(n,r,t)];case 4:i.sent(),i.label=5;case 5:return $e(function(n){var t=new Set(n);return t.add(e.id),t}),ln.current?ln.current.ready=!0:In(e.id),[3,8];case 6:return u=i.sent(),l&&(ln.current=null),null==me||me(u,t),[3,8];case 7:return tn(null),[7];case 8:return[2]}})})},[te,we,me,ve,ge,D,In]);s(function(){var e=ln.current;if((null==e?void 0:e.ready)&&JSON.stringify(D.map(function(e){return e.stable_key}))!==e.segmentSignature){var n=e.action===p.MERGE_PREVIOUS?e.originalSegmentIndex:e.originalSegmentIndex+1,t=new Map(D.map(function(e,n){return[e.stable_key,n]})),i=Me.find(function(e){var i,r=t.get(e.segment.stable_key);return null!=r&&r>=n&&null==e.review_step.review&&!Ze.has(e.id)&&!0!==(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm)});if(!i)return ln.current=null,void Nn();requestAnimationFrame(function(){ln.current=null,kn(i)})}},[Nn,Ze,Me,D,kn]),s(function(){ln.current||ze&&!Me.some(function(e){return e.id===ze})&&Nn()},[ze,Nn,Me]),s(function(){if(ee&&!ln.current){var e=Me.find(function(e){return e.pageNumber===Be});e&&e.id!==ze&&kn(e)}},[ze,ee,Be,kn,Me]),s(function(){ln.current||ze&&!Me.some(function(e){var n;return e.id===ze&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&Nn()},[ze,Nn,Me]);var An=a(function(){var n=Me.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===K)return n;var t=["low","medium","high"].filter(function(e){return e!==J}),i=e([J],t,!0),r=new Map(i.map(function(e,n){return[e,n]}));return n.map(function(e,n){return{item:e,index:n}}).sort(function(e,n){var t,o,l,a,u=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),d=null===(o=n.item.review_step.confidence)||void 0===o?void 0:o.trim().toLowerCase();return(null==u?i.length:null!==(l=r.get(u))&&void 0!==l?l:i.length)-(null==d?i.length:null!==(a=r.get(d))&&void 0!==a?a:i.length)||e.index-n.index}).map(function(e){return e.item})},[K,J,Me]),Fn=An.findIndex(function(e){return e.id===Te}),Mn=d(null),Rn=Mn[0],Pn=Mn[1],Bn=u(!1),Ln=c(function(e){var n=An[e];n&&kn(n)},[An,kn]);s(function(){Te&&!An.some(function(e){return e.id===Te})&&qe(null)},[An,Te]),s(function(){Bn.current=!1,Pn(Fn>=0?String(Fn+1):null)},[Fn,An.length]),s(function(){if(Bn.current&&null!=Rn){var e=window.setTimeout(function(){var e=Number(Rn.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<An.length&&(Bn.current=!1,Ln(n))},300);return function(){return window.clearTimeout(e)}}},[Ln,Rn,An.length]);var Wn=a(function(){var e=new Map;Me.forEach(function(n){var t,i=null!==(t=e.get(n.segment.stable_key))&&void 0!==t?t:[];i.push(n),e.set(n.segment.stable_key,i)});var n=new Map;return e.forEach(function(e,t){var i,r=null!==(i=Ae.get(t))&&void 0!==i?i:1;e.sort(function(e,n){return e.reviewStepIndex-n.reviewStepIndex}).forEach(function(e,t){n.set(e.id,"".concat(r).concat(function(e){for(var n=e+1,t="";n>0;)n-=1,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}(t)))})}),n},[Me,Ae]),zn=a(function(){var e=new Map;Me.forEach(function(n){var t,i=null!==(t=e.get(n.pageNumber))&&void 0!==t?t:[];i.push(n),e.set(n.pageNumber,i)});var n=new Map;return e.forEach(function(e){e.forEach(function(e,t){return n.set(e.id,t)})}),n},[Me]),jn=c(function(e){return{startPage:Math.max(0,e.startPage-re),endPage:Math.min(e.numPages-1,e.endPage+re)}},[re]),On=c(function(){var e,n=un.current,t=dn.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),o=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();Me.forEach(function(e){var n,r=an.current.get(e.id);if(r){var l=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(l){var a=l.getBoundingClientRect(),u=null!==(n=zn.get(e.id))&&void 0!==n?n:0,d=a.top+le+40*u,s=d+(r.offsetHeight||32),c=d>=o.top&&s<=o.bottom;r.style.top="".concat(d-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}})}},[le,zn,Me]),Tn=c(function(e){var n=on.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(on.current=null,On(),requestAnimationFrame(function(){if(null==on.current){var e=an.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Xe(e)}}))},[On]);return s(function(){var e=dn.current;if(e&&U){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,On()}))};e.addEventListener("scroll",t,!0),window.addEventListener("resize",t);var i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});var r="undefined"==typeof ResizeObserver?null:new ResizeObserver(t);return null==r||r.observe(e),t(),function(){null!=n&&cancelAnimationFrame(n),e.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t),i.disconnect(),null==r||r.disconnect()}}},[U,On]),r("div",n({ref:un,className:xe,style:n(n({},_e),{display:"block",position:"relative",width:"100%",height:"100%",minWidth:0,overflowX:"auto",overflowY:"hidden"})},{children:[r("div",n({className:"segment-review-wrapper__container",style:{display:"flex",alignItems:"stretch",gap:0,width:"100%",minWidth:650,height:"100%"}},{children:[o("div",n({ref:dn,style:n(n({},Ce),{flex:"1 1 auto",width:U?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:o(g,n({defaultScale:v.PageFit,highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},G,{pdfUrl:T,pdfName:q,segments:Re,navigationRequest:Ye,onNavigationSettled:Tn,setRenderRange:jn,onCurrentPageChange:function(e){Le(e),null==on.current&&pn&&pn.pageNumber!==e&&Nn(),null==pe||pe(e)}}))})),U&&r("aside",n({"aria-label":"Page review badges",ref:Fe,style:n(n({},Se),{position:"relative",width:fn,maxWidth:N,flex:"0 1 ".concat(fn),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[Z&&An.length>0&&r("nav",n({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:ue||"auto",left:se||"auto",zIndex:2,display:"flex",alignItems:"center",gap:7,width:128,minHeight:40,padding:"4px 6px",border:"1px solid #CBD5E1",borderRadius:6,backgroundColor:"#FFFFFF",boxSizing:"border-box",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.06)",font:"inherit"}},{children:[o("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:null!=Rn?Rn:"-","aria-label":"Review badge number",onChange:function(e){Bn.current=!0,Pn(e.target.value)},style:{width:30,height:28,padding:0,border:"1px solid #A5B4FC",borderRadius:3,color:"#4F46E5",backgroundColor:"#FFFFFF",textAlign:"center",font:"inherit",fontSize:15,outline:"none"}}),r("span",n({"aria-label":"".concat(An.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",An.length]})),["previous","next"].map(function(e){var t="previous"===e,i=Fn+(t?-1:1),r=i<0||i>=An.length;return o("button",n({type:"button","aria-label":"".concat(t?"Previous":"Next"," review badge"),disabled:r,onClick:function(){return Ln(i)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:r?"#C7D2FE":"#4F46E5",cursor:r?"default":"pointer"}},{children:o("svg",n({width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},{children:o("path",{d:t?"M1 7L6 2L11 7":"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))}),e)})]})),Me.map(function(e){var t,i,l=ze===e.id,a=null!==(t=Wn.get(e.id))&&void 0!==t?t:"1A",u=e.review_step.score,d=e.review_step.confidence,s=k(u,d),c=!0===(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm),v=S(u,d,c),g=e.review_step.review&&null!==e.review_step.review.action,f=Boolean(g)||c;return o(_,n({title:c?"data is being processed":"",arrow:!0},{children:o("span",n({ref:function(n){n?an.current.set(e.id,n):an.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:f?"not-allowed":"pointer"}},{children:o("button",n({disabled:f,type:"button","aria-pressed":l,"aria-label":c?"".concat(e.review_step.type," · Page ").concat(e.pageNumber," · Data is being processed"):"".concat(e.review_step.type," · Page ").concat(e.pageNumber),onClick:function(){return kn(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:g&&!c?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(g&&!c?"#E2E8F0":v.border),borderRadius:16,backgroundColor:g&&!c?"#F8FAFC":v.background,color:g&&!c?"#475569":v.text,font:"inherit",alignContent:"center",boxShadow:"0 1px 2px rgba(16, 24, 40, 0.08)"}},{children:r(C,n({fontFamily:"Inter",sx:{display:"flex",gap:1,alignItems:"center",flexDirection:"row"}},g&&!c?{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:a})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===s?s:"".concat(s,"%")}))]})),r("span",n({style:{fontSize:11,fontWeight:500,display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:"#CBD5E1",strokeWidth:"0.8"})})),o("span",n({style:{display:"flex",marginLeft:"7px",alignItems:"center"}},{children:o(x,{height:14,width:14,strokeWidth:2,color:"#16A34A"})}))]}))]}:{children:[o("span",n({style:{fontSize:11,fontWeight:500}},{children:a})),r("span",n({style:{display:"flex",alignItems:"center"}},{children:[o("svg",n({width:"2",height:"14",viewBox:"0 0 1 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:o("path",{d:"M0.399902 0V14",stroke:v.divider,strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===s?s:"".concat(s,"%")}))]}))]}))}))}))}),e.id)})]}))]})),pn&&Ue&&r(h,n({anchorElement:Ue,placement:"bottom-start",offset:{top:8},width:Math.min(cn,N),maxWidth:N},{children:[Ve&&o(w,{width:"100%",maxWidth:"100%",score:pn.review_step.score,reasons:_n,reason:pn.review_step.reason,gap:pn.review_step.gap,onBack:function(){return Ge(!1)},onClose:Nn}),o("div",n({style:{display:Ve?"none":"block"}},{children:pn.review_step.review&&pn.review_step.human_resolution?o(l,{}):"boundary"===pn.kind?o(f,{width:"100%",maxWidth:"100%",title:pn.segment.label||pn.segment.title,pageNo:"Page ".concat(pn.pageNumber),content:pn.review_step.reason,cognitiveScore:pn.review_step.score,metadata:pn.metadata,previousSegmentTitle:bn,nextSegmentTitle:yn,defaultStartPage:pn.segment.start_page,defaultEndPage:pn.segment.end_page,styles:{root:{borderColor:xn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:xn.text}}},confirmDisabled:we||nn===pn.id,onConfirm:function(e,n,t){t&&m(n.id)&&En(pn,n.id,t)},onAdjustManually:function(){return null==be?void 0:be(I(pn))},onCognitiveClick:Cn?function(){Ge(!0),null==ye||ye(I(pn))}:void 0,onClose:Nn},pn.id):o(b,{width:"100%",maxWidth:"100%",title:pn.metadata.current_label||pn.segment.label||pn.segment.title,pageNo:"Pages ".concat(pn.segment.start_page,"-").concat(pn.segment.end_page),content:pn.review_step.reason,cognitiveScore:pn.review_step.score,metadata:pn.metadata,styles:{root:{borderColor:xn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:xn.text}}},confirmDisabled:we||nn===pn.id,onActionConfirm:function(e,n){En(pn,e,n)},onAdjustManually:function(){return null==be?void 0:be(I(pn))},onCognitiveClick:Cn?function(){Ge(!0),null==ye||ye(I(pn))}:void 0,onClose:Nn},pn.id)}))]}))]}))}export{E as default};
|
|
2
2
|
//# sourceMappingURL=SegmentReviewPdfWrapper.js.map
|
|
@@ -9,7 +9,10 @@ export interface CognitiveIntegrityStyles {
|
|
|
9
9
|
markdown?: MarkdownRendererStyles;
|
|
10
10
|
}
|
|
11
11
|
export interface CognitiveIntegrityProps {
|
|
12
|
+
reasons?: readonly CognitiveIntegrityReason[] | null;
|
|
13
|
+
/** @deprecated Use `reasons` with `type: "evidence"` instead. */
|
|
12
14
|
reason?: string | null;
|
|
15
|
+
/** @deprecated Use `reasons` with `type: "gap"` instead. */
|
|
13
16
|
gap?: string | null;
|
|
14
17
|
score?: string | number | null;
|
|
15
18
|
headerName?: ReactNode;
|
|
@@ -21,6 +24,10 @@ export interface CognitiveIntegrityProps {
|
|
|
21
24
|
className?: string;
|
|
22
25
|
styles?: CognitiveIntegrityStyles;
|
|
23
26
|
}
|
|
27
|
+
export interface CognitiveIntegrityReason {
|
|
28
|
+
text: string;
|
|
29
|
+
type: string;
|
|
30
|
+
}
|
|
24
31
|
/** Compact popup content for displaying review reason and gap as Markdown. */
|
|
25
|
-
export default function CognitiveIntegrity({ reason, gap, score: cognitiveScore, headerName, onBack, onClose, showCloseButton, width, maxWidth, className, styles, }: CognitiveIntegrityProps): import("react/jsx-runtime").JSX.Element | null;
|
|
32
|
+
export default function CognitiveIntegrity({ reasons, reason, gap, score: cognitiveScore, headerName, onBack, onClose, showCloseButton, width, maxWidth, className, styles, }: CognitiveIntegrityProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
33
|
//# sourceMappingURL=CognitiveIntegrity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveIntegrity.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/CognitiveIntegrity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,OAAO,KAAK,EAAE,OAA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O,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,MAAM,EACN,GAAG,EACH,KAAK,EAAE,cAAc,EACrB,UAAkC,EAClC,MAAM,EACN,OAAO,EACP,eAAsB,EACtB,KAAW,EACX,QAAc,EACd,SAAS,EACT,MAAM,GACP,EAAE,uBAAuB,kDAiIzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentReviewPdfWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAkB,EAGhB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAqB,
|
|
1
|
+
{"version":3,"file":"SegmentReviewPdfWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/SegmentReviewPdfWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAkB,EAGhB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAqB,EAGnB,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,gBAAgB,CAAC;AAGxB,OAAmB,EACjB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAM9B,KAAK,uBAAuB,GAAG,OAAO,CAAC,IAAI,CACzC,cAAc,EACZ,QAAQ,GACR,SAAS,GACT,UAAU,GACV,qBAAqB,GACrB,mBAAmB,GACnB,qBAAqB,GACrB,YAAY,GACZ,gBAAgB,CACnB,CAAC,CAAC;AAeH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AACzD,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,MAA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,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,eAAe,GAChB,EAAE,4BAA4B,2CA0/B9B"}
|
|
@@ -5,7 +5,7 @@ export { default as CardWrapper } from './CardWrapper';
|
|
|
5
5
|
export type { CardWrapperProps } from './CardWrapper';
|
|
6
6
|
export { default as CognitiveIcon } from './CognitiveIcon';
|
|
7
7
|
export { default as CognitiveIntegrity } from './CognitiveIntegrity';
|
|
8
|
-
export type { CognitiveIntegrityProps, CognitiveIntegrityStyles, } from './CognitiveIntegrity';
|
|
8
|
+
export type { CognitiveIntegrityReason, CognitiveIntegrityProps, CognitiveIntegrityStyles, } from './CognitiveIntegrity';
|
|
9
9
|
export { default as LabelCheck } from './LabelCheck';
|
|
10
10
|
export { LabelReviewActionEnum, createLabelCheckOptions, isLabelReviewAction, } from './LabelCheck';
|
|
11
11
|
export { formatScore, getConfidenceColors, getFallbackScore, getNumericScore, getResolvedScore, } from './helper';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EACV,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EACV,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACL,wBAAwB,EACxB,yB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ACnB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC"}
|
|
@@ -50,6 +50,7 @@ export interface ReviewStepSource {
|
|
|
50
50
|
decided_by?: string | null;
|
|
51
51
|
llm_decision_awaited?: boolean | null;
|
|
52
52
|
reason?: string | null;
|
|
53
|
+
reasons?: readonly SegmentConfidenceReason[] | null;
|
|
53
54
|
score?: string | number | null;
|
|
54
55
|
gap?: string | null;
|
|
55
56
|
details?: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewStepAdapters.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/reviewStepAdapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAG3E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB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,MAAM,WAAW,oBAAoB,CAAC,QAAQ,SAAS,mBAAmB;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,QAAQ,CAAC;IAClB,WAAW,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAmDD,mFAAmF;AACnF,eAAO,MAAM,wBAAwB;;;CAkCpC,CAAC"}
|
|
1
|
+
{"version":3,"file":"reviewStepAdapters.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/reviewStepAdapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAG3E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,gB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W,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAmDD,mFAAmF;AACnF,eAAO,MAAM,wBAAwB;;;CAkCpC,CAAC"}
|
|
@@ -12,7 +12,7 @@ export { default as ChatCitation } from "./features/ChatCitation/ChatCitationRen
|
|
|
12
12
|
export { default as CognitiveDecisioningCard } from "./features/CognitiveDecisioning/CognitiveDecisioningWrapper";
|
|
13
13
|
export { default as PdfViewer } from "./features/PdfViewer/PdfViewer";
|
|
14
14
|
export { BoundaryReviewActionEnum, CognitiveIntegrity, LabelReviewActionEnum, ReviewedCard, SegmentReviewPdfWrapper, createBoundaryCardOptions, createLabelCheckOptions, extractSegmentReviewData, formatScore, getConfidenceColors, getFallbackScore, getNumericScore, getResolvedScore, isBoundaryReviewAction, isLabelReviewAction } from "./features/SegmentReviewComponents";
|
|
15
|
-
export type { BoundaryCardOption, BoundaryCardProps, BoundaryCardStyles, BoundaryReviewAction, BoundaryReviewConfirmDetails, BoundaryReviewMetadata, CardWrapperProps, CognitiveIntegrityProps, CognitiveIntegrityStyles, ExtractedBoundaryReview, ExtractedLabelReview, LabelCheckOption, LabelCheckProps, LabelCheckStyles, LabelReviewAction, LabelReviewConfirmDetails, LabelReviewMetadata, RedirectionData, ReviewedCardProps, ReviewedCardStyles, ReviewStepHumanResolution, ReviewStepMetadata, ReviewStepPerformedAction, ReviewStepReview, ReviewStepSource, ReviewStepValueSnapshot, ReviewConfidence, ReviewConfidenceFilter, ReviewRedirectionType, SegmentConfidence, SegmentConfidenceReason, SegmentHumanActionLogEntry, SegmentReviewAction, SegmentReviewSource, SegmentReviewActionContext, SegmentReviewPdfWrapperProps, SegmentTimings } from "./features/SegmentReviewComponents";
|
|
15
|
+
export type { BoundaryCardOption, BoundaryCardProps, BoundaryCardStyles, BoundaryReviewAction, BoundaryReviewConfirmDetails, BoundaryReviewMetadata, CardWrapperProps, CognitiveIntegrityProps, CognitiveIntegrityReason, CognitiveIntegrityStyles, ExtractedBoundaryReview, ExtractedLabelReview, LabelCheckOption, LabelCheckProps, LabelCheckStyles, LabelReviewAction, LabelReviewConfirmDetails, LabelReviewMetadata, RedirectionData, ReviewedCardProps, ReviewedCardStyles, ReviewStepHumanResolution, ReviewStepMetadata, ReviewStepPerformedAction, ReviewStepReview, ReviewStepSource, ReviewStepValueSnapshot, ReviewConfidence, ReviewConfidenceFilter, ReviewRedirectionType, SegmentConfidence, SegmentConfidenceReason, SegmentHumanActionLogEntry, SegmentReviewAction, SegmentReviewSource, SegmentReviewActionContext, SegmentReviewPdfWrapperProps, SegmentTimings } from "./features/SegmentReviewComponents";
|
|
16
16
|
export { default as FaqCitation } from "./features/CognitiveDecisioning/FaqCitation/FaqCitation";
|
|
17
17
|
export { default as ImageCitationContent } from "./features/RequirementAiCitations/ImageCitation/ImageCitationContent";
|
|
18
18
|
export { default as VideoCitationContent } from "./features/RequirementAiCitations/VideoCitation/VideoCitationContent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAC1G,OAAO,EAAE,OAAO,IAAI,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