@viswa-test/test-citation 0.0.306 → 0.0.308

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PdfStyle.js"),s=require("../../assests/svg/PdfViewerIcons.js"),o=require("@mui/material"),r=require("lucide-react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(i);exports.default=function(i){i.highlightIndex;var l=i.totalHighlights,d=i.controls,c=i.currentPosition,p=i.pdfName,g=i.onClose,x=i.pdfUrl,u=i.viewerRef,h=i.customStyles,f=i.customClasses,_=i.customIcons,v=i.headerAction,m=i.isZoomEnabled,y=void 0===m||m,j=i.showHighlightsAction,b=void 0===j||j,w=i.showFullScreenAction,S=void 0===w||w,k=i.currentSegment,I=i.segmentTooltipText,F=void 0===I?"Details of current segment":I,C=i.currentPage,D=i.totalPages,W=i.onPageNavigate,E=d.ZoomInButton,B=d.ZoomOutButton,P=d.ZoomPopover,T=d.goToPrevious,L=d.goToNext,z=a.default.useState(String(C)),A=z[0],q=z[1];a.default.useEffect(function(){q(String(C))},[C]);var N={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},R=function(e){return String(e).padStart(2,"0")};return n.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},t.pdfStyles.header),null==h?void 0:h.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",columnGap:"16px",rowGap:"12px",minWidth:0}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flex:"1 1 180px",minWidth:0}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==h?void 0:h.pdfIconWrapper),{flexShrink:0})},{children:(null==_?void 0:_.pdfIcon)||n.jsx(s.DefaultPdfIcon,{})})),n.jsx(o.Tooltip,e.__assign({title:p||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n.jsx("span",e.__assign({style:e.__assign({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==h?void 0:h.pdfName),className:null==f?void 0:f.pdfName},{children:p}))}))}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:b?"16px":"2px",color:"#4B5563",flex:"0 1 auto",marginLeft:"auto",whiteSpace:"nowrap",minWidth:0,maxWidth:"100%",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"}},{children:[D>0&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n.jsx("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:A,onChange:function(e){var n=e.target.value.replace(/\D/g,"");q(n)},onBlur:function(){var e=Number(A);if(!Number.isInteger(e)||e<1)q(String(C));else{var n=D?Math.min(e,D):e;W(n),q(String(n))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(q(String(C)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(D)}))]})),y&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(B,{}),n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n.jsx(P,{})})),n.jsx(E,{})]})),!!l&&b&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("span",e.__assign({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[c," of ",l]})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c<=1?"not-allowed":"pointer",padding:"2px 4px",color:c<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:T,disabled:c<=1},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c===l?"not-allowed":"pointer",padding:"2px 4px",color:c===l?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:L,disabled:c===l},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n.jsx("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==S&&((null==v?void 0:v.icon)&&(null==v?void 0:v.onClick)?n.jsx(o.Tooltip,e.__assign({title:(null==v?void 0:v.tooltip)||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({onClick:v.onClick,style:e.__assign({display:"flex",alignItems:"center",cursor:"pointer"},N)},{children:v.icon}))})):n.jsx("button",e.__assign({onClick:function(){var e=null==u?void 0:u.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:N,title:"Full Screen"},{children:(null==_?void 0:_.fullScreenIcon)||n.jsx(s.DefaultFullScreenIcon,{})}))),x&&n.jsx("a",e.__assign({href:x,target:"_blank",rel:"noopener noreferrer",style:N,title:"Open in new tab"},{children:(null==_?void 0:_.downloadIcon)||n.jsx(s.DefaultDownloadIcon,{})})),g&&n.jsx("button",e.__assign({onClick:g,style:N,title:"Close"},{children:(null==_?void 0:_.closeIcon)||n.jsx(s.DefaultCloseIcon,{})}))]}))]}))]})),k&&n.jsxs("div",e.__assign({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n.jsx(o.Tooltip,e.__assign({title:F,arrow:!0,placement:"top"},{children:n.jsx(r.Info,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n.jsxs("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:["Viewing ",k.title," • Pages ",R(k.start_page),"-",R(k.end_page)]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("./PdfStyle.js"),s=require("../../assests/svg/PdfViewerIcons.js"),l=require("@mui/material/Tooltip"),r=require("lucide-react");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t),d=o(l);exports.default=function(t){t.highlightIndex;var l=t.totalHighlights,o=t.controls,c=t.currentPosition,p=t.pdfName,g=t.onClose,x=t.pdfUrl,u=t.viewerRef,h=t.customStyles,f=t.customClasses,_=t.customIcons,v=t.headerAction,m=t.isZoomEnabled,j=void 0===m||m,y=t.showHighlightsAction,w=void 0===y||y,b=t.showFullScreenAction,S=void 0===b||b,k=t.currentSegment,I=t.segmentTooltipText,F=void 0===I?"Details of current segment":I,C=t.currentPage,D=t.totalPages,W=t.onPageNavigate,E=o.ZoomInButton,B=o.ZoomOutButton,P=o.ZoomPopover,L=o.goToPrevious,z=o.goToNext,A=a.default.useState(String(C)),T=A[0],q=A[1];a.default.useEffect(function(){q(String(C))},[C]);var N={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},R=function(e){return String(e).padStart(2,"0")};return n.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},i.pdfStyles.header),null==h?void 0:h.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",columnGap:"16px",rowGap:"12px",minWidth:0}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flex:"1 1 180px",minWidth:0}},{children:[n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==h?void 0:h.pdfIconWrapper),{flexShrink:0})},{children:(null==_?void 0:_.pdfIcon)||n.jsx(s.DefaultPdfIcon,{})})),n.jsx(d.default,e.__assign({title:p||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n.jsx("span",e.__assign({style:e.__assign({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==h?void 0:h.pdfName),className:null==f?void 0:f.pdfName},{children:p}))}))}))]})),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:w?"16px":"2px",color:"#4B5563",flex:"0 1 auto",marginLeft:"auto",whiteSpace:"nowrap",minWidth:0,maxWidth:"100%",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"}},{children:[D>0&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n.jsx("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:T,onChange:function(e){var n=e.target.value.replace(/\D/g,"");q(n)},onBlur:function(){var e=Number(T);if(!Number.isInteger(e)||e<1)q(String(C));else{var n=D?Math.min(e,D):e;W(n),q(String(n))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(q(String(C)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(D)}))]})),j&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(B,{}),n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n.jsx(P,{})})),n.jsx(E,{})]})),!!l&&w&&n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("span",e.__assign({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[c," of ",l]})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c<=1?"not-allowed":"pointer",padding:"2px 4px",color:c<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:L,disabled:c<=1},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n.jsx("button",e.__assign({style:{background:"none",border:"none",cursor:c===l?"not-allowed":"pointer",padding:"2px 4px",color:c===l?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:z,disabled:c===l},{children:n.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n.jsx("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n.jsx("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==S&&((null==v?void 0:v.icon)&&(null==v?void 0:v.onClick)?n.jsx(d.default,e.__assign({title:(null==v?void 0:v.tooltip)||"",arrow:!0,placement:"top"},{children:n.jsx("div",e.__assign({onClick:v.onClick,style:e.__assign({display:"flex",alignItems:"center",cursor:"pointer"},N)},{children:v.icon}))})):n.jsx("button",e.__assign({onClick:function(){var e=null==u?void 0:u.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:N,title:"Full Screen"},{children:(null==_?void 0:_.fullScreenIcon)||n.jsx(s.DefaultFullScreenIcon,{})}))),x&&n.jsx("a",e.__assign({href:x,target:"_blank",rel:"noopener noreferrer",style:N,title:"Open in new tab"},{children:(null==_?void 0:_.downloadIcon)||n.jsx(s.DefaultDownloadIcon,{})})),g&&n.jsx("button",e.__assign({onClick:g,style:N,title:"Close"},{children:(null==_?void 0:_.closeIcon)||n.jsx(s.DefaultCloseIcon,{})}))]}))]}))]})),k&&n.jsxs("div",e.__assign({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n.jsx(d.default,e.__assign({title:F,arrow:!0,placement:"top"},{children:n.jsx(r.Info,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n.jsx("span",e.__assign({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:n.jsx(d.default,e.__assign({title:k.title,arrow:!0,placement:"top"},{children:n.jsxs("span",{children:["Viewing ",k.title," • Pages ",R(k.start_page),"-",R(k.end_page)]})}))}))]}))]}))};
2
2
  //# sourceMappingURL=PdfToolbar.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ChevronRight"),r=require("@mui/icons-material/Close"),o=require("@mui/icons-material/ExpandMore"),a=require("@mui/material/Box"),s=require("@mui/material/Button"),l=require("@mui/material/ButtonBase"),d=require("@mui/material/Divider"),u=require("@mui/material/IconButton"),c=require("@mui/material/Paper"),x=require("@mui/material/Radio"),p=require("@mui/material/Stack"),f=require("@mui/material/TextField"),g=require("@mui/material/Typography"),m=require("./CognitiveIcon.js"),h=require("./CognitiveScoreBadge.js"),b=require("../../assests/icons/InfoAlert.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C,v=_(n),j=_(r),y=_(o),E=_(a),F=_(s),S=_(l),w=_(d),A=_(u),R=_(c),M=_(x),k=_(p),I=_(f),z=_(g),B=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)};exports.BoundaryReviewActionEnum=void 0,(C=exports.BoundaryReviewActionEnum||(exports.BoundaryReviewActionEnum={})).KEEP="KEEP",C.SPLIT_HERE="SPLIT_HERE",C.MERGE_NEXT="MERGE_NEXT",C.MERGE_PREVIOUS="MERGE_PREVIOUS",C.SET_RANGE="SET_RANGE";var T=function(e){return Object.values(exports.BoundaryReviewActionEnum).includes(e)},W=function(e){return e.user_actions.flatMap(function(i){var t=e.focus_page;switch(i){case exports.BoundaryReviewActionEnum.SET_RANGE:return[];case"KEEP":return[{id:i,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:i,title:"Create a separate document",description:t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary."}];case"MERGE_NEXT":return[{id:i,title:"Merge into next document",description:t?"Move page ".concat(t," onward into the next document."):"Merge this segment into the next document."}];case"MERGE_PREVIOUS":return[{id:i,title:"Merge into previous document",description:"Merge this segment into the previous document."}]}return[]})};exports.createBoundaryCardOptions=W,exports.default=function(n){var r=n.headerName,o=void 0===r?"Boundary Check":r,a=n.title,s=n.pageNo,l=n.content,d=n.cognitiveScore,u=n.config,c=n.metadata,x=n.selectedIndex,p=n.defaultSelectedIndex,f=void 0===p?null:p,g=n.defaultStartPage,_=n.defaultEndPage,C=n.onSelectionChange,q=n.onConfirm,P=n.onActionConfirm,N=n.onCognitiveClick,H=n.onAdjustManually,G=n.onClose,D=n.confirmLabel,O=void 0===D?"Confirm":D,L=n.manualPrompt,K=void 0===L?"Didn't find the right option?":L,U=n.manualActionLabel,V=void 0===U?"Adjust Manually":U,X=n.cognitiveLabel,Y=void 0===X?"Cognitive Integrity":X,J=n.showAdjustManually,Q=void 0===J||J,Z=n.showCognitiveIntegrity,$=void 0===Z||Z,ee=n.showCloseButton,ie=void 0===ee||ee,te=n.confirmDisabled,ne=void 0!==te&&te,re=n.width,oe=void 0===re?260:re,ae=n.maxWidth,se=void 0===ae?260:ae,le=n.className,de=n.styles,ue=t.useMemo(function(){return(null!=u?u:c?W(c):[]).filter(function(e){return e.id!==exports.BoundaryReviewActionEnum.SET_RANGE})},[u,c]),ce=t.useState(f),xe=ce[0],pe=ce[1],fe=t.useState(null==g?"":String(g)),ge=fe[0],me=fe[1],he=t.useState(null==_?"":String(_)),be=he[0],_e=he[1],Ce=t.useState(!1),ve=Ce[0],je=Ce[1],ye=t.useState(!1),Ee=ye[0],Fe=ye[1],Se=void 0===x?xe:x,we=null==Se?void 0:ue[Se],Ae=Number(ge),Re=Number(be),Me=ge.trim().length>0&&be.trim().length>0&&Number.isInteger(Ae)&&Number.isInteger(Re)&&Ae>0&&Re>0&&Ae<=Re,ke=ne||!we||!0===we.disabled||!q&&!P;return i.jsx(R.default,e.__assign({className:le,elevation:4,sx:B({width:oe,maxWidth:se,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==de?void 0:de.root)},{children:i.jsxs(k.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==de?void 0:de.header},{children:[i.jsx(b.default,{color:"error",height:16,width:16}),i.jsx(z.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:o})),ie&&i.jsx(A.default,e.__assign({size:"small",onClick:G,disabled:!G,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(j.default,{sx:{fontSize:17}})}))]})),i.jsxs(E.default,{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=s&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:s})),i.jsx(w.default,{sx:{my:.625}}),null!=l&&i.jsx(z.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:l}))]}),i.jsxs(k.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[ue.map(function(t,n){var r=Se===n;return i.jsx(R.default,e.__assign({variant:"outlined",sx:B({borderColor:r?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==de?void 0:de.option)},{children:i.jsxs(S.default,e.__assign({role:"radio","aria-checked":r,disabled:t.disabled,onClick:function(){return function(e,i){i.disabled||(void 0===x&&pe(e),ve&&(je(!1),Fe(!1)),null==C||C(e,i))}(n,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(M.default,{checked:r,disabled:t.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),i.jsxs(E.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:t.description}))]}))]}))}),t.id)}),i.jsx(F.default,e.__assign({variant:"contained",fullWidth:!0,disabled:ke,onClick:function(){if(!ke&&null!=Se&&we){var e={selectedIndex:Se,option:we,metadata:c};null==q||q(Se,we,e),P&&T(we.id)&&P(we.id,e)}},sx:B({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==de?void 0:de.confirmButton)},{children:O}))]})),Q&&i.jsxs(k.default,e.__assign({spacing:.625,sx:null==de?void 0:de.manualSection},{children:[i.jsxs(S.default,e.__assign({onClick:function(){var e=!ve;je(e),Fe(!1),e&&(void 0===x&&pe(null),null==H||H())},"aria-expanded":ve,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[i.jsxs(E.default,{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:K})),i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.primary",fontSize:12}},{children:V}))]}),i.jsx(y.default,{sx:{color:"text.secondary",fontSize:18,transform:ve?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),ve&&!Ee&&i.jsxs(E.default,e.__assign({sx:{pt:1.25,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[i.jsxs(E.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"7px",px:1.5}},{children:[i.jsx(z.default,e.__assign({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Starts"})),i.jsx(z.default,e.__assign({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Ends"}))]})),i.jsxs(E.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"5px",px:1.5}},{children:[i.jsx(I.default,{size:"small",type:"number",value:ge,onChange:function(e){return me(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}}),i.jsx(I.default,{size:"small",type:"number",value:be,error:ge.trim().length>0&&be.trim().length>0&&Ae>Re,onChange:function(e){return _e(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}})]})),i.jsx(E.default,e.__assign({sx:{px:1.5}},{children:i.jsx(F.default,e.__assign({onClick:function(){Me&&Fe(!0)},disabled:!Me,sx:{height:"36px",padding:"0 16px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"2px solid #8E80F3",borderRadius:"8px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"14px",fontWeight:700,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Me?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Me?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))})),i.jsx(E.default,{sx:{width:"calc(100% + 48px)",height:"1px",marginTop:"12px",marginLeft:"-24px",backgroundColor:"#EEF0F2",border:"0"}})]})),ve&&Ee&&i.jsxs(k.default,e.__assign({spacing:.75,sx:B({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==de?void 0:de.manualConfirmation)},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(b.default,{color:"warning",height:14,width:14}),i.jsx(z.default,e.__assign({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),i.jsxs(z.default,e.__assign({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Ae,"-",Re," will become part of ",a,", including pages from other documents in this range."]})),i.jsxs(k.default,e.__assign({direction:"row",spacing:.75},{children:[i.jsx(F.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:function(){return Fe(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),i.jsx(F.default,e.__assign({variant:"contained",fullWidth:!0,disabled:ne||!q,onClick:function(){if(Me&&q){var e={id:exports.BoundaryReviewActionEnum.SET_RANGE,title:V};q(-1,e,{selectedIndex:-1,option:e,startPage:Ae,endPage:Re,metadata:c})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),i.jsx(k.default,e.__assign({spacing:.625,sx:null==de?void 0:de.footer},{children:$&&i.jsxs(i.Fragment,{children:[i.jsx(w.default,{}),i.jsxs(S.default,e.__assign({onClick:N,disabled:!N,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:N?"pointer":"not-allowed"}},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(m.default,{sx:{color:"text.secondary"}}),i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:Y}))]})),i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(h.default,{score:d}),i.jsx(v.default,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))},exports.isBoundaryReviewAction=T;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ChevronRight"),r=require("@mui/icons-material/Close"),o=require("@mui/icons-material/ExpandMore"),a=require("@mui/material/Box"),s=require("@mui/material/Button"),l=require("@mui/material/ButtonBase"),d=require("@mui/material/Divider"),u=require("@mui/material/IconButton"),c=require("@mui/material/Paper"),x=require("@mui/material/Radio"),p=require("@mui/material/Stack"),f=require("@mui/material/TextField"),g=require("@mui/material/Typography"),m=require("./CognitiveIcon.js"),h=require("./CognitiveScoreBadge.js"),b=require("../../assests/icons/InfoAlert.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C,v=_(n),j=_(r),y=_(o),E=_(a),F=_(s),S=_(l),w=_(d),A=_(u),R=_(c),M=_(x),k=_(p),I=_(f),z=_(g),B=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)};exports.BoundaryReviewActionEnum=void 0,(C=exports.BoundaryReviewActionEnum||(exports.BoundaryReviewActionEnum={})).KEEP="KEEP",C.SPLIT_HERE="SPLIT_HERE",C.MERGE_NEXT="MERGE_NEXT",C.MERGE_PREVIOUS="MERGE_PREVIOUS",C.SET_RANGE="SET_RANGE";var T=function(e){return Object.values(exports.BoundaryReviewActionEnum).includes(e)},W=function(e){return e.user_actions.flatMap(function(i){var t=e.focus_page;switch(i){case exports.BoundaryReviewActionEnum.SET_RANGE:return[];case"KEEP":return[{id:i,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:i,title:"Create a separate document",description:t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary."}];case"MERGE_NEXT":return[{id:i,title:"Merge into next document",description:t?"Move page ".concat(t," onward into the next document."):"Merge this segment into the next document."}];case"MERGE_PREVIOUS":return[{id:i,title:"Merge into previous document",description:"Merge this segment into the previous document."}]}return[]})};exports.createBoundaryCardOptions=W,exports.default=function(n){var r=n.headerName,o=void 0===r?"Boundary Check":r,a=n.title,s=n.pageNo,l=n.content,d=n.cognitiveScore,u=n.config,c=n.metadata,x=n.selectedIndex,p=n.defaultSelectedIndex,f=void 0===p?null:p,g=n.defaultStartPage,_=n.defaultEndPage,C=n.onSelectionChange,q=n.onConfirm,P=n.onActionConfirm,N=n.onCognitiveClick,H=n.onAdjustManually,G=n.onClose,D=n.confirmLabel,O=void 0===D?"Confirm":D,L=n.manualPrompt,K=void 0===L?"Didn't find the right option?":L,U=n.manualActionLabel,V=void 0===U?"Adjust Manually":U,X=n.cognitiveLabel,Y=void 0===X?"Cognitive Integrity":X,J=n.showAdjustManually,Q=void 0===J||J,Z=n.showCognitiveIntegrity,$=void 0===Z||Z,ee=n.showCloseButton,ie=void 0===ee||ee,te=n.confirmDisabled,ne=void 0!==te&&te,re=n.width,oe=void 0===re?260:re,ae=n.maxWidth,se=void 0===ae?260:ae,le=n.className,de=n.styles,ue=t.useMemo(function(){return(null!=u?u:c?W(c):[]).filter(function(e){return e.id!==exports.BoundaryReviewActionEnum.SET_RANGE})},[u,c]),ce=t.useState(f),xe=ce[0],pe=ce[1],fe=t.useState(null==g?"":String(g)),ge=fe[0],me=fe[1],he=t.useState(null==_?"":String(_)),be=he[0],_e=he[1],Ce=t.useState(!1),ve=Ce[0],je=Ce[1],ye=t.useState(!1),Ee=ye[0],Fe=ye[1],Se=void 0===x?xe:x,we=null==Se?void 0:ue[Se],Ae=Number(ge),Re=Number(be),Me=ge.trim().length>0&&be.trim().length>0&&Number.isInteger(Ae)&&Number.isInteger(Re)&&Ae>0&&Re>0&&Ae<=Re,ke=ne||!we||!0===we.disabled||!q&&!P;return i.jsx(R.default,e.__assign({className:le,elevation:4,sx:B({width:oe,maxWidth:se,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==de?void 0:de.root)},{children:i.jsxs(k.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==de?void 0:de.header},{children:[i.jsx(b.default,{color:"error",height:16,width:16}),i.jsx(z.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:o})),ie&&i.jsx(A.default,e.__assign({size:"small",onClick:G,disabled:!G,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(j.default,{sx:{fontSize:17}})}))]})),i.jsxs(E.default,{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=s&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:s})),i.jsx(w.default,{sx:{my:.625}}),null!=l&&i.jsx(z.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:l}))]}),i.jsxs(k.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[ue.map(function(t,n){var r=Se===n;return i.jsx(R.default,e.__assign({variant:"outlined",sx:B({borderColor:r?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==de?void 0:de.option)},{children:i.jsxs(S.default,e.__assign({role:"radio","aria-checked":r,disabled:ne||t.disabled,onClick:function(){return function(e,i){ne||i.disabled||(void 0===x&&pe(e),ve&&(je(!1),Fe(!1)),null==C||C(e,i))}(n,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(M.default,{checked:r,disabled:ne||t.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),i.jsxs(E.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:t.description}))]}))]}))}),t.id)}),i.jsx(F.default,e.__assign({variant:"contained",fullWidth:!0,disabled:ke,onClick:function(){if(!ke&&null!=Se&&we){var e={selectedIndex:Se,option:we,metadata:c};null==q||q(Se,we,e),P&&T(we.id)&&P(we.id,e)}},sx:B({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==de?void 0:de.confirmButton)},{children:O}))]})),Q&&i.jsxs(k.default,e.__assign({spacing:.625,sx:null==de?void 0:de.manualSection},{children:[i.jsxs(S.default,e.__assign({disabled:ne,onClick:function(){var e=!ve;je(e),Fe(!1),e&&(void 0===x&&pe(null),null==H||H())},"aria-expanded":ve,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[i.jsxs(E.default,{children:[i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:K})),i.jsx(z.default,e.__assign({sx:{mt:.125,color:"text.primary",fontSize:12}},{children:V}))]}),i.jsx(y.default,{sx:{color:"text.secondary",fontSize:18,transform:ve?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),ve&&!Ee&&i.jsxs(E.default,e.__assign({sx:{pt:1.25,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[i.jsxs(E.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"7px",px:1.5}},{children:[i.jsx(z.default,e.__assign({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Starts"})),i.jsx(z.default,e.__assign({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Ends"}))]})),i.jsxs(E.default,e.__assign({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"5px",px:1.5}},{children:[i.jsx(I.default,{size:"small",type:"number",value:ge,disabled:ne,onChange:function(e){return me(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}}),i.jsx(I.default,{size:"small",type:"number",value:be,disabled:ne,error:ge.trim().length>0&&be.trim().length>0&&Ae>Re,onChange:function(e){return _e(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}})]})),i.jsx(E.default,e.__assign({sx:{px:1.5}},{children:i.jsx(F.default,e.__assign({onClick:function(){Me&&Fe(!0)},disabled:ne||!Me,sx:{height:"36px",padding:"0 16px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"2px solid #8E80F3",borderRadius:"8px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"14px",fontWeight:700,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Me?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Me?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))})),i.jsx(E.default,{sx:{width:"calc(100% + 48px)",height:"1px",marginTop:"12px",marginLeft:"-24px",backgroundColor:"#EEF0F2",border:"0"}})]})),ve&&Ee&&i.jsxs(k.default,e.__assign({spacing:.75,sx:B({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==de?void 0:de.manualConfirmation)},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(b.default,{color:"warning",height:14,width:14}),i.jsx(z.default,e.__assign({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),i.jsxs(z.default,e.__assign({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Ae,"-",Re," will become part of ",a,", including pages from other documents in this range."]})),i.jsxs(k.default,e.__assign({direction:"row",spacing:.75},{children:[i.jsx(F.default,e.__assign({variant:"outlined",fullWidth:!0,onClick:function(){return Fe(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),i.jsx(F.default,e.__assign({variant:"contained",fullWidth:!0,disabled:ne||!q,onClick:function(){if(Me&&q){var e={id:exports.BoundaryReviewActionEnum.SET_RANGE,title:V};q(-1,e,{selectedIndex:-1,option:e,startPage:Ae,endPage:Re,metadata:c})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),i.jsx(k.default,e.__assign({spacing:.625,sx:null==de?void 0:de.footer},{children:$&&i.jsxs(i.Fragment,{children:[i.jsx(w.default,{}),i.jsxs(S.default,e.__assign({onClick:N,disabled:!N,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:N?"pointer":"not-allowed"}},{children:[i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(m.default,{sx:{color:"text.secondary"}}),i.jsx(z.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:Y}))]})),i.jsxs(k.default,e.__assign({direction:"row",alignItems:"center",spacing:.5},{children:[i.jsx(h.default,{score:d}),i.jsx(v.default,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))},exports.isBoundaryReviewAction=T;
2
2
  //# sourceMappingURL=BoundaryCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ChevronRight"),r=require("@mui/icons-material/Close"),o=require("@mui/material/Box"),l=require("@mui/material/Button"),a=require("@mui/material/ButtonBase"),s=require("@mui/material/Divider"),d=require("@mui/material/IconButton"),u=require("@mui/material/Paper"),c=require("@mui/material/Radio"),x=require("@mui/material/Stack"),f=require("@mui/material/TextField"),m=require("@mui/material/Typography"),p=require("./CognitiveIcon.js"),h=require("./CognitiveScoreBadge.js"),b=require("../../assests/icons/InfoAlert.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v,_=g(n),j=g(r),C=g(o),y=g(l),L=g(a),w=g(s),S=g(d),A=g(u),E=g(c),I=g(x),q=g(f),k=g(m),D=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)};exports.LabelReviewActionEnum=void 0,(v=exports.LabelReviewActionEnum||(exports.LabelReviewActionEnum={})).KEEP_LABEL="KEEP_LABEL",v.SET_CUSTOM_LABEL="SET_CUSTOM_LABEL";var B=function(e){return e.user_actions.map(function(i){switch(i){case"KEEP_LABEL":return{id:i,title:"Keep as is",description:e.current_label?'Label stays "'.concat(e.current_label,'"'):"Keep the current document label"};case"SET_CUSTOM_LABEL":return{id:i,title:"Enter a custom label",description:"Create your own document label",requiresInput:!0,inputPlaceholder:e.current_label?"e.g. ".concat(e.current_label):"Enter a document label"}}})},z=function(e){return Object.values(exports.LabelReviewActionEnum).includes(e)};exports.createLabelCheckOptions=B,exports.default=function(n){var r,o=n.headerName,l=void 0===o?"Title Check":o,a=n.title,s=n.pageNo,d=n.content,u=void 0===d?"We're not fully confident about this label. Confirm it, choose a different type, or add a new one.":d,c=n.cognitiveScore,x=n.config,f=n.metadata,m=n.selectedIndex,g=n.defaultSelectedIndex,v=void 0===g?null:g,M=n.onSelectionChange,O=n.customLabel,R=n.defaultCustomLabel,T=n.onCustomLabelChange,W=n.onConfirm,F=n.onActionConfirm,P=n.onCognitiveClick;n.onAdjustManually;var K=n.onClose,H=n.confirmLabel,N=void 0===H?"Confirm":H,U=n.customInputAriaLabel,G=void 0===U?"Custom document label":U;n.manualPrompt,n.manualActionLabel;var J=n.cognitiveLabel,Q=void 0===J?"Cognitive Integrity":J;n.showAdjustManually;var V=n.showCognitiveIntegrity,X=void 0===V||V,Y=n.showCloseButton,Z=void 0===Y||Y,$=n.confirmDisabled,ee=void 0!==$&&$,ie=n.width,te=void 0===ie?260:ie,ne=n.maxWidth,re=void 0===ne?260:ne,oe=n.className,le=n.styles,ae=t.useMemo(function(){return null!=x?x:f?B(f):[]},[x,f]),se=t.useState(v),de=se[0],ue=se[1],ce=t.useState(null!==(r=null!=R?R:null==f?void 0:f.custom_label)&&void 0!==r?r:""),xe=ce[0],fe=ce[1],me=void 0===m?de:m,pe=void 0===O?xe:O,he=null==me?void 0:ae[me],be=Boolean(null==he?void 0:he.requiresInput),ge=ee||!W&&!F||!he||!0===he.disabled||be&&0===pe.trim().length,ve=function(){if(!ge&&null!=me&&he){var e=be?pe.trim():void 0;null==W||W(me,he,e),F&&z(he.id)&&F(he.id,{selectedIndex:me,option:he,customLabel:e,metadata:f})}};return i.jsx(A.default,e.__assign({className:oe,elevation:0,sx:D({width:te,maxWidth:re,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.2)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==le?void 0:le.root)},{children:i.jsx(C.default,e.__assign({sx:{overflow:"hidden"}},{children:i.jsxs(I.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==le?void 0:le.header},{children:[i.jsx(b.default,{color:"error",height:16,width:16}),i.jsx(k.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:l})),Z&&i.jsx(S.default,e.__assign({size:"small",onClick:K,disabled:!K,"aria-label":"Close label check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(j.default,{sx:{fontSize:17}})}))]})),i.jsxs(C.default,{children:[i.jsx(k.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=s&&i.jsx(k.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:s})),i.jsx(w.default,{sx:{my:.625}}),null!=u&&i.jsx(k.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:u}))]}),i.jsxs(I.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Label options"},{children:[ae.map(function(t,n){var r=me===n;return i.jsxs(A.default,e.__assign({variant:"outlined",sx:D({borderColor:r?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==le?void 0:le.option)},{children:[i.jsxs(L.default,e.__assign({role:"radio","aria-checked":r,disabled:t.disabled,onClick:function(){return function(e,i){i.disabled||(void 0===m&&ue(e),null==M||M(e,i))}(n,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(E.default,{checked:r,disabled:t.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),i.jsxs(C.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(k.default,e.__assign({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(k.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:t.description}))]}))]})),r&&t.requiresInput&&i.jsx(C.default,e.__assign({sx:{px:1.25,pb:1}},{children:i.jsx(q.default,{autoFocus:!0,fullWidth:!0,size:"small",value:pe,placeholder:t.inputPlaceholder,inputProps:{"aria-label":G},onChange:function(e){return i=e.target.value,void 0===O&&fe(i),void(null==T||T(i));var i},onKeyDown:function(e){"Enter"===e.key&&ve()},variant:"outlined",InputProps:{sx:{height:36,borderRadius:2,backgroundColor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1px"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1.5px"},"& .MuiOutlinedInput-input":{height:"100%",boxSizing:"border-box",px:1.25,py:0,fontSize:12,lineHeight:1.25},"& .MuiOutlinedInput-input::placeholder":{color:"#98A2B3",opacity:1}}},sx:null==le?void 0:le.customInput})}))]}),t.id)}),i.jsx(y.default,e.__assign({variant:"contained",fullWidth:!0,disabled:ge,onClick:ve,sx:D({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==le?void 0:le.confirmButton)},{children:N}))]})),i.jsx(I.default,e.__assign({spacing:.625,sx:null==le?void 0:le.footer},{children:X&&i.jsxs(i.Fragment,{children:[i.jsx(w.default,{}),i.jsxs(L.default,e.__assign({onClick:P,disabled:!P,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:P?"pointer":"not-allowed"}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(p.default,{sx:{color:"text.secondary"}}),i.jsx(k.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:Q}))]})),i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.75},{children:[i.jsx(h.default,{score:c}),i.jsx(_.default,{sx:{color:"text.secondary",fontSize:18}})]}))]}))]})}))]}))}))}))},exports.isLabelReviewAction=z;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/icons-material/ChevronRight"),o=require("@mui/icons-material/Close"),r=require("@mui/material/Box"),l=require("@mui/material/Button"),a=require("@mui/material/ButtonBase"),s=require("@mui/material/Divider"),d=require("@mui/material/IconButton"),u=require("@mui/material/Paper"),c=require("@mui/material/Radio"),x=require("@mui/material/Stack"),f=require("@mui/material/TextField"),m=require("@mui/material/Typography"),p=require("./CognitiveIcon.js"),h=require("./CognitiveScoreBadge.js"),b=require("../../assests/icons/InfoAlert.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v,_=g(n),j=g(o),C=g(r),y=g(l),L=g(a),w=g(s),S=g(d),A=g(u),E=g(c),I=g(x),q=g(f),k=g(m),D=function(i,t){return e.__spreadArray([i],Array.isArray(t)?t:null==t?[]:[t],!0)};exports.LabelReviewActionEnum=void 0,(v=exports.LabelReviewActionEnum||(exports.LabelReviewActionEnum={})).KEEP_LABEL="KEEP_LABEL",v.SET_CUSTOM_LABEL="SET_CUSTOM_LABEL";var B=function(e){return e.user_actions.map(function(i){switch(i){case"KEEP_LABEL":return{id:i,title:"Keep as is",description:e.current_label?'Label stays "'.concat(e.current_label,'"'):"Keep the current document label"};case"SET_CUSTOM_LABEL":return{id:i,title:"Enter a custom label",description:"Create your own document label",requiresInput:!0,inputPlaceholder:e.current_label?"e.g. ".concat(e.current_label):"Enter a document label"}}})},z=function(e){return Object.values(exports.LabelReviewActionEnum).includes(e)};exports.createLabelCheckOptions=B,exports.default=function(n){var o,r=n.headerName,l=void 0===r?"Title Check":r,a=n.title,s=n.pageNo,d=n.content,u=void 0===d?"We're not fully confident about this label. Confirm it, choose a different type, or add a new one.":d,c=n.cognitiveScore,x=n.config,f=n.metadata,m=n.selectedIndex,g=n.defaultSelectedIndex,v=void 0===g?null:g,M=n.onSelectionChange,O=n.customLabel,R=n.defaultCustomLabel,T=n.onCustomLabelChange,W=n.onConfirm,F=n.onActionConfirm,P=n.onCognitiveClick;n.onAdjustManually;var K=n.onClose,H=n.confirmLabel,N=void 0===H?"Confirm":H,U=n.customInputAriaLabel,G=void 0===U?"Custom document label":U;n.manualPrompt,n.manualActionLabel;var J=n.cognitiveLabel,Q=void 0===J?"Cognitive Integrity":J;n.showAdjustManually;var V=n.showCognitiveIntegrity,X=void 0===V||V,Y=n.showCloseButton,Z=void 0===Y||Y,$=n.confirmDisabled,ee=void 0!==$&&$,ie=n.disableAllActions,te=void 0!==ie&&ie,ne=n.width,oe=void 0===ne?260:ne,re=n.maxWidth,le=void 0===re?260:re,ae=n.className,se=n.styles,de=t.useMemo(function(){return null!=x?x:f?B(f):[]},[x,f]),ue=t.useState(v),ce=ue[0],xe=ue[1],fe=t.useState(null!==(o=null!=R?R:null==f?void 0:f.custom_label)&&void 0!==o?o:""),me=fe[0],pe=fe[1],he=void 0===m?ce:m,be=void 0===O?me:O,ge=null==he?void 0:de[he],ve=Boolean(null==ge?void 0:ge.requiresInput),_e=te||ee||!W&&!F||!ge||!0===ge.disabled||ve&&0===be.trim().length,je=function(){if(!_e&&null!=he&&ge){var e=ve?be.trim():void 0;null==W||W(he,ge,e),F&&z(ge.id)&&F(ge.id,{selectedIndex:he,option:ge,customLabel:e,metadata:f})}};return i.jsx(A.default,e.__assign({className:ae,elevation:0,sx:D({width:oe,maxWidth:le,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.2)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==se?void 0:se.root)},{children:i.jsx(C.default,e.__assign({sx:{overflow:"hidden"}},{children:i.jsxs(I.default,e.__assign({spacing:.75,sx:{p:1}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.75,sx:null==se?void 0:se.header},{children:[i.jsx(b.default,{color:"error",height:16,width:16}),i.jsx(k.default,e.__assign({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:l})),Z&&i.jsx(S.default,e.__assign({size:"small",onClick:K,disabled:!K,"aria-label":"Close label check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i.jsx(j.default,{sx:{fontSize:17}})}))]})),i.jsxs(C.default,{children:[i.jsx(k.default,e.__assign({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:a})),null!=s&&i.jsx(k.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:s})),i.jsx(w.default,{sx:{my:.625}}),null!=u&&i.jsx(k.default,e.__assign({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:u}))]}),i.jsxs(I.default,e.__assign({spacing:.625,role:"radiogroup","aria-label":"Label options"},{children:[de.map(function(t,n){var o=he===n;return i.jsxs(A.default,e.__assign({variant:"outlined",sx:D({borderColor:o?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==se?void 0:se.option)},{children:[i.jsxs(L.default,e.__assign({role:"radio","aria-checked":o,disabled:ee||t.disabled,onClick:function(){return function(e,i){ee||i.disabled||(void 0===m&&xe(e),null==M||M(e,i))}(n,t)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i.jsx(E.default,{checked:o,disabled:ee||t.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),i.jsxs(C.default,e.__assign({sx:{minWidth:0}},{children:[i.jsx(k.default,e.__assign({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:t.title})),null!=t.description&&i.jsx(k.default,e.__assign({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:t.description}))]}))]})),o&&t.requiresInput&&i.jsx(C.default,e.__assign({sx:{px:1.25,pb:1}},{children:i.jsx(q.default,{autoFocus:!0,fullWidth:!0,size:"small",value:be,disabled:ee,placeholder:t.inputPlaceholder,inputProps:{"aria-label":G},onChange:function(e){return i=e.target.value,void 0===O&&pe(i),void(null==T||T(i));var i},onKeyDown:function(e){"Enter"===e.key&&je()},variant:"outlined",InputProps:{sx:{height:36,borderRadius:2,backgroundColor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1px"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1.5px"},"& .MuiOutlinedInput-input":{height:"100%",boxSizing:"border-box",px:1.25,py:0,fontSize:12,lineHeight:1.25},"& .MuiOutlinedInput-input::placeholder":{color:"#98A2B3",opacity:1}}},sx:null==se?void 0:se.customInput})}))]}),t.id)}),i.jsx(y.default,e.__assign({variant:"contained",fullWidth:!0,disabled:_e,onClick:je,sx:D({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==se?void 0:se.confirmButton)},{children:N}))]})),i.jsx(I.default,e.__assign({spacing:.625,sx:null==se?void 0:se.footer},{children:X&&i.jsxs(i.Fragment,{children:[i.jsx(w.default,{}),i.jsxs(L.default,e.__assign({onClick:P,disabled:!P,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:P?"pointer":"not-allowed"}},{children:[i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:1},{children:[i.jsx(p.default,{sx:{color:"text.secondary"}}),i.jsx(k.default,e.__assign({sx:{color:"text.primary",fontSize:12}},{children:Q}))]})),i.jsxs(I.default,e.__assign({direction:"row",alignItems:"center",spacing:.75},{children:[i.jsx(h.default,{score:c}),i.jsx(_.default,{sx:{color:"text.secondary",fontSize:18}})]}))]}))]})}))]}))}))}))},exports.isLabelReviewAction=z;
2
2
  //# sourceMappingURL=LabelCheck.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"),a=require("./BoundaryCard.js"),o=require("./CardWrapper.js"),s=require("./CognitiveIntegrity.js"),l=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,_,w,b,x=this,y=p.pdfUrl,C=p.pdfName,j=p.segments,S=p.styles,k=p.pdfViewerProps,N=p.showBadges,E=void 0===N||N,M=p.sortByConfidence,I=void 0===M?"low":M,R=p.filterByConfidence,A=void 0===R?"all":R,F=p.showBadgeNavigation,B=void 0===F||F,P=p.autoSelectReviewOnPageChange,q=void 0!==P&&P,L=p.autoAdvanceAfterConfirm,W=void 0===L||L,z=p.badgePreloadPages,D=void 0===z?8:z,T=p.badgeOffsetTop,O=void 0===T?20:T,V=p.badgeOffsetRight,H=void 0===V?8:V,X=p.initialReviewId,G=p.onBoundaryAction,U=p.onLabelAction,Y=p.onActiveReviewChange,Z=p.onCurrentPageChange,J=p.onActionError,K=p.onAdjustManually,Q=p.onCognitiveClick,$=p.className,ee=p.style,ne=p.viewerStyle,te=p.railStyle,ie=p.redirectionData,re=t.useMemo(function(){return u.extractSegmentReviewData(j)},[j]),ae=re.boundaryReviews,oe=re.labelReviews,se=t.useMemo(function(){return new Map(j.map(function(e,n){return[e.stable_key,n+1]}))},[j]),le=t.useRef(null),ue=t.useMemo(function(){return e.__spreadArray(e.__spreadArray([],ae.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),oe.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=se.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,a=null!==(i=se.get(n.segment.stable_key))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-a||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[ae,oe,se]),de=t.useMemo(function(){return j.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})})},[j]),ce=t.useState(1),ge=ce[0],fe=ce[1],ve=t.useState(null!=X?X:null),pe=ve[0],me=ve[1],he=t.useState(null!=X?X:null),_e=he[0],we=he[1],be=t.useState(!1),xe=be[0],ye=be[1],Ce=t.useState(null),je=Ce[0],Se=Ce[1],ke=t.useState(null),Ne=ke[0],Ee=ke[1],Me=t.useState(function(){return new Set}),Ie=Me[0],Re=Me[1],Ae=t.useState(null),Fe=Ae[0],Be=Ae[1],Pe=t.useRef(0),qe=t.useRef(null),Le=t.useRef(new Map),We=t.useRef(null),ze=t.useRef(null),De=t.useState(f),Te=De[0],Oe=De[1],Ve=null!==(h=null===(m=null==S?void 0:S.aside)||void 0===m?void 0:m.width)&&void 0!==h?h:"40%",He="min(".concat("number"==typeof Ve?"".concat(Ve,"px"):Ve,", ").concat(f,"px, 100%)");t.useEffect(function(){var e=le.current;if(e&&E){var n=function(){var n=e.getBoundingClientRect().width;n>0&&Oe(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()}}},[E]),t.useMemo(function(){var e=new Set(Ie);return ue.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[Ie,ue]);var Xe=t.useMemo(function(){var e;return null!==(e=ue.find(function(e){return e.id===pe}))&&void 0!==e?e:null},[pe,ue]),Ge=g.getConfidenceColors(null==Xe?void 0:Xe.review_step.score,null==Xe?void 0:Xe.review_step.confidence,null===(_=null==Xe?void 0:Xe.segment.confidence)||void 0===_?void 0:_.awaiting_llm),Ue=Boolean((null===(w=null==Xe?void 0:Xe.review_step.reason)||void 0===w?void 0:w.trim())||(null===(b=null==Xe?void 0:Xe.review_step.gap)||void 0===b?void 0:b.trim())),Ye=t.useCallback(function(e,n){Pe.current+=1,qe.current={requestId:Pe.current,pageNumber:e,reviewId:n},Ee({pageNumber:e,requestId:Pe.current})},[]),Ze=t.useCallback(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(me(e.id),we(e.id),ye(!1),Se(null),Ye(e.pageNumber,e.id),null==Y||Y(e.id,e.segment))},[Y,Ye]);t.useEffect(function(){if((null==ie?void 0:ie.pageNumber)&&ie.type){var e=Number(ie.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=ue.find(function(n){return n.segment.start_page===e&&n.kind===ie.type});n&&Ze(n)}}},[ie,Ze,ue]);var Je=t.useCallback(function(){qe.current=null,ye(!1),me(null),Se(null),null==Y||Y(null,null)},[Y]),Ke=t.useCallback(function(e){var n;if(W){var t=ue.findIndex(function(n){return n.id===e}),i=new Set(ue.map(function(e){return e.id})),r=null!==(n=ue.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:ue.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return Ze(r)}):Je()}else Je()},[W,Je,ue,Ze,ue]),Qe=t.useCallback(function(n,t,i){return e.__awaiter(x,void 0,void 0,function(){var r,a;return e.__generator(this,function(e){switch(e.label){case 0:r=v(n),Be(n.id),e.label=1;case 1:return e.trys.push([1,6,7,8]),"boundary"!==n.kind?[3,3]:[4,null==G?void 0:G(t,i,r)];case 2:return e.sent(),[3,5];case 3:return[4,null==U?void 0:U(t,i,r)];case 4:e.sent(),e.label=5;case 5:return Re(function(e){var t=new Set(e);return t.add(n.id),t}),Ke(n.id),[3,8];case 6:return a=e.sent(),null==J||J(a,r),[3,8];case 7:return Be(null),[7];case 8:return[2]}})})},[J,G,U,Ke]);t.useEffect(function(){pe&&!ue.some(function(e){return e.id===pe})&&Je()},[pe,Je,ue]),t.useEffect(function(){if(q){var e=ue.find(function(e){return e.pageNumber===ge});e&&e.id!==pe&&Ze(e)}},[pe,q,ge,Ze,ue]),t.useEffect(function(){pe&&!ue.some(function(e){var n;return e.id===pe&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&Je()},[pe,Je,ue]);var $e=t.useMemo(function(){var n=ue.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===A)return n;var t=["low","medium","high"].filter(function(e){return e!==I}),i=e.__spreadArray([I],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,a,o,s,l=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(a=n.item.review_step.confidence)||void 0===a?void 0:a.trim().toLowerCase();return(null==l?i.length:null!==(o=r.get(l))&&void 0!==o?o:i.length)-(null==u?i.length:null!==(s=r.get(u))&&void 0!==s?s:i.length)||e.index-n.index}).map(function(e){return e.item})},[A,I,ue]),en=$e.findIndex(function(e){return e.id===_e}),nn=t.useState(null),tn=nn[0],rn=nn[1],an=t.useRef(!1),on=t.useCallback(function(e){var n=$e[e];n&&Ze(n)},[$e,Ze]);t.useEffect(function(){_e&&!$e.some(function(e){return e.id===_e})&&we(null)},[$e,_e]),t.useEffect(function(){an.current=!1,rn(en>=0?String(en+1):null)},[en,$e.length]),t.useEffect(function(){if(an.current&&null!=tn){var e=window.setTimeout(function(){var e=Number(tn.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<$e.length&&(an.current=!1,on(n))},300);return function(){return window.clearTimeout(e)}}},[on,tn,$e.length]);var sn=t.useMemo(function(){var e=new Map;ue.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},[ue,se]),ln=t.useMemo(function(){var e=new Map;ue.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},[ue]),un=t.useCallback(function(e){return{startPage:Math.max(0,e.startPage-D),endPage:Math.min(e.numPages-1,e.endPage+D)}},[D]),dn=t.useCallback(function(){var e,n=We.current,t=ze.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),a=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();ue.forEach(function(e){var n,r=Le.current.get(e.id);if(r){var o=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(o){var s=o.getBoundingClientRect(),l=null!==(n=ln.get(e.id))&&void 0!==n?n:0,u=s.top+O+40*l,d=u+(r.offsetHeight||32),c=u>=a.top&&d<=a.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}})}},[O,ln,ue]),cn=t.useCallback(function(e){var n=qe.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(qe.current=null,dn(),requestAnimationFrame(function(){if(null==qe.current){var e=Le.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Se(e)}}))},[dn]);return t.useEffect(function(){var e=ze.current;if(e&&E){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,dn()}))};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()}}},[E,dn]),n.jsxs("div",e.__assign({ref:We,className:$,style:e.__assign(e.__assign({},ee),{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:ze,style:e.__assign(e.__assign({},ne),{flex:"1 1 auto",width:E?"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},k,{pdfUrl:y,pdfName:C,segments:de,navigationRequest:Ne,onNavigationSettled:cn,setRenderRange:un,onCurrentPageChange:function(e){fe(e),null==qe.current&&Xe&&Xe.pageNumber!==e&&Je(),null==Z||Z(e)}}))})),E&&n.jsxs("aside",e.__assign({"aria-label":"Page review badges",ref:le,style:e.__assign(e.__assign({},te),{position:"relative",width:He,maxWidth:f,flex:"0 1 ".concat(He),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[B&&$e.length>0&&n.jsxs("nav",e.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:H,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!=tn?tn:"-","aria-label":"Review badge number",onChange:function(e){an.current=!0,rn(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($e.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",$e.length]})),["previous","next"].map(function(t){var i="previous"===t,r=en+(i?-1:1),a=r<0||r>=$e.length;return n.jsx("button",e.__assign({type:"button","aria-label":"".concat(i?"Previous":"Next"," review badge"),disabled:a,onClick:function(){return on(r)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:a?"#C7D2FE":"#4F46E5",cursor:a?"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)})]})),ue.map(function(t){var i,r,a=pe===t.id,o=null!==(i=sn.get(t.id))&&void 0!==i?i:"1A",s=t.review_step.score,l=t.review_step.confidence,u=g.formatScore(s,l),f=!0===(null===(r=t.segment.confidence)||void 0===r?void 0:r.awaiting_llm),v=g.getConfidenceColors(s,l,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?Le.current.set(t.id,e):Le.current.delete(t.id)},style:{position:"absolute",top:0,left:0,visibility:"hidden",display:"inline-flex",cursor:m?"not-allowed":"pointer"}},{children:n.jsx("button",e.__assign({disabled:m,type:"button","aria-pressed":a,"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 Ze(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:o})),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:o})),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)})]}))]})),Xe&&je&&n.jsxs(o.default,e.__assign({anchorElement:je,placement:"bottom-start",offset:{top:8},width:Math.min(Te,f),maxWidth:f},{children:[xe&&n.jsx(s.default,{width:"100%",maxWidth:"100%",score:Xe.review_step.score,reason:Xe.review_step.reason,gap:Xe.review_step.gap,onBack:function(){return ye(!1)},onClose:Je}),n.jsx("div",e.__assign({style:{display:xe?"none":"block"}},{children:Xe.review_step.review&&Xe.review_step.human_resolution?n.jsx(n.Fragment,{}):"boundary"===Xe.kind?n.jsx(a.default,{width:"100%",maxWidth:"100%",title:Xe.segment.label||Xe.segment.title,pageNo:"Page ".concat(Xe.pageNumber),content:Xe.review_step.reason,cognitiveScore:Xe.review_step.score,metadata:Xe.metadata,defaultStartPage:Xe.segment.start_page,defaultEndPage:Xe.segment.end_page,styles:{root:{borderColor:Ge.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Ge.text}}},confirmDisabled:Fe===Xe.id,onConfirm:function(e,n,t){t&&a.isBoundaryReviewAction(n.id)&&Qe(Xe,n.id,t)},onAdjustManually:function(){return null==K?void 0:K(v(Xe))},onCognitiveClick:Ue?function(){ye(!0),null==Q||Q(v(Xe))}:void 0,onClose:Je},Xe.id):n.jsx(l.default,{width:"100%",maxWidth:"100%",title:Xe.metadata.current_label||Xe.segment.label||Xe.segment.title,pageNo:"Pages ".concat(Xe.segment.start_page,"-").concat(Xe.segment.end_page),content:Xe.review_step.reason,cognitiveScore:Xe.review_step.score,metadata:Xe.metadata,styles:{root:{borderColor:Ge.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Ge.text}}},confirmDisabled:Fe===Xe.id,onActionConfirm:function(e,n){Qe(Xe,e,n)},onAdjustManually:function(){return null==K?void 0:K(v(Xe))},onCognitiveClick:Ue?function(){ye(!0),null==Q||Q(v(Xe))}:void 0,onClose:Je},Xe.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"),a=require("./BoundaryCard.js"),o=require("./CardWrapper.js"),s=require("./CognitiveIntegrity.js"),l=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=this,y=p.pdfUrl,C=p.pdfName,j=p.segments,S=p.styles,k=p.pdfViewerProps,N=p.showBadges,E=void 0===N||N,M=p.sortByConfidence,I=void 0===M?"low":M,A=p.filterByConfidence,R=void 0===A?"all":A,F=p.showBadgeNavigation,B=void 0===F||F,P=p.autoSelectReviewOnPageChange,q=void 0!==P&&P,L=p.autoAdvanceAfterConfirm,W=void 0===L||L,z=p.badgePreloadPages,D=void 0===z?8:z,T=p.badgeOffsetTop,O=void 0===T?20:T,V=p.badgeOffsetRight,H=void 0===V?68:V,X=p.badgeOffsetLeft,G=void 0===X?0:X,U=p.initialReviewId,Y=p.onBoundaryAction,Z=p.onLabelAction,J=p.onActiveReviewChange,K=p.onCurrentPageChange,Q=p.onActionError,$=p.disableAllActions,ee=void 0!==$&&$,ne=p.onAdjustManually,te=p.onCognitiveClick,ie=p.className,re=p.style,ae=p.viewerStyle,oe=p.railStyle,se=p.redirectionData,le=t.useMemo(function(){return u.extractSegmentReviewData(j)},[j]),ue=le.boundaryReviews,de=le.labelReviews,ce=t.useMemo(function(){return new Map(j.map(function(e,n){return[e.stable_key,n+1]}))},[j]),ge=t.useRef(null),fe=t.useMemo(function(){return e.__spreadArray(e.__spreadArray([],ue.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),de.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=ce.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,a=null!==(i=ce.get(n.segment.stable_key))&&void 0!==i?i:Number.MAX_SAFE_INTEGER;return e.pageNumber-n.pageNumber||r-a||e.reviewStepIndex-n.reviewStepIndex||e.id.localeCompare(n.id)})},[ue,de,ce]),ve=t.useMemo(function(){return j.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})})},[j]),pe=t.useState(1),me=pe[0],he=pe[1],_e=t.useState(null!=U?U:null),be=_e[0],we=_e[1],xe=t.useState(null!=U?U:null),ye=xe[0],Ce=xe[1],je=t.useState(!1),Se=je[0],ke=je[1],Ne=t.useState(null),Ee=Ne[0],Me=Ne[1],Ie=t.useState(null),Ae=Ie[0],Re=Ie[1],Fe=t.useState(function(){return new Set}),Be=Fe[0],Pe=Fe[1],qe=t.useState(null),Le=qe[0],We=qe[1],ze=t.useRef(0),De=t.useRef(null),Te=t.useRef(new Map),Oe=t.useRef(null),Ve=t.useRef(null),He=t.useState(f),Xe=He[0],Ge=He[1],Ue=null!==(h=null===(m=null==S?void 0:S.aside)||void 0===m?void 0:m.width)&&void 0!==h?h:"40%",Ye="min(".concat("number"==typeof Ue?"".concat(Ue,"px"):Ue,", ").concat(f,"px, 100%)");t.useEffect(function(){var e=ge.current;if(e&&E){var n=function(){var n=e.getBoundingClientRect().width;n>0&&Ge(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()}}},[E]),t.useMemo(function(){var e=new Set(Be);return fe.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[Be,fe]);var Ze=t.useMemo(function(){var e;return null!==(e=fe.find(function(e){return e.id===be}))&&void 0!==e?e:null},[be,fe]),Je=g.getConfidenceColors(null==Ze?void 0:Ze.review_step.score,null==Ze?void 0:Ze.review_step.confidence,null===(_=null==Ze?void 0:Ze.segment.confidence)||void 0===_?void 0:_.awaiting_llm),Ke=Boolean((null===(b=null==Ze?void 0:Ze.review_step.reason)||void 0===b?void 0:b.trim())||(null===(w=null==Ze?void 0:Ze.review_step.gap)||void 0===w?void 0:w.trim())),Qe=t.useCallback(function(e,n){ze.current+=1,De.current={requestId:ze.current,pageNumber:e,reviewId:n},Re({pageNumber:e,requestId:ze.current})},[]),$e=t.useCallback(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(we(e.id),Ce(e.id),ke(!1),Me(null),Qe(e.pageNumber,e.id),null==J||J(e.id,e.segment))},[J,Qe]);t.useEffect(function(){if((null==se?void 0:se.pageNumber)&&se.type){var e=Number(se.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=fe.find(function(n){return n.segment.start_page===e&&n.kind===se.type});n&&$e(n)}}},[se,$e,fe]);var en=t.useCallback(function(){De.current=null,ke(!1),we(null),Me(null),null==J||J(null,null)},[J]),nn=t.useCallback(function(e){var n;if(W){var t=fe.findIndex(function(n){return n.id===e}),i=new Set(fe.map(function(e){return e.id})),r=null!==(n=fe.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:fe.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return $e(r)}):en()}else en()},[W,en,fe,$e,fe]),tn=t.useCallback(function(n,t,i){return e.__awaiter(x,void 0,void 0,function(){var r,a;return e.__generator(this,function(e){switch(e.label){case 0:if(ee)return[2];r=v(n),We(n.id),e.label=1;case 1:return e.trys.push([1,6,7,8]),"boundary"!==n.kind?[3,3]:[4,null==Y?void 0:Y(t,i,r)];case 2:return e.sent(),[3,5];case 3:return[4,null==Z?void 0:Z(t,i,r)];case 4:e.sent(),e.label=5;case 5:return Pe(function(e){var t=new Set(e);return t.add(n.id),t}),nn(n.id),[3,8];case 6:return a=e.sent(),null==Q||Q(a,r),[3,8];case 7:return We(null),[7];case 8:return[2]}})})},[ee,Q,Y,Z,nn]);t.useEffect(function(){be&&!fe.some(function(e){return e.id===be})&&en()},[be,en,fe]),t.useEffect(function(){if(q){var e=fe.find(function(e){return e.pageNumber===me});e&&e.id!==be&&$e(e)}},[be,q,me,$e,fe]),t.useEffect(function(){be&&!fe.some(function(e){var n;return e.id===be&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&en()},[be,en,fe]);var rn=t.useMemo(function(){var n=fe.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===R)return n;var t=["low","medium","high"].filter(function(e){return e!==I}),i=e.__spreadArray([I],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,a,o,s,l=null===(t=e.item.review_step.confidence)||void 0===t?void 0:t.trim().toLowerCase(),u=null===(a=n.item.review_step.confidence)||void 0===a?void 0:a.trim().toLowerCase();return(null==l?i.length:null!==(o=r.get(l))&&void 0!==o?o:i.length)-(null==u?i.length:null!==(s=r.get(u))&&void 0!==s?s:i.length)||e.index-n.index}).map(function(e){return e.item})},[R,I,fe]),an=rn.findIndex(function(e){return e.id===ye}),on=t.useState(null),sn=on[0],ln=on[1],un=t.useRef(!1),dn=t.useCallback(function(e){var n=rn[e];n&&$e(n)},[rn,$e]);t.useEffect(function(){ye&&!rn.some(function(e){return e.id===ye})&&Ce(null)},[rn,ye]),t.useEffect(function(){un.current=!1,ln(an>=0?String(an+1):null)},[an,rn.length]),t.useEffect(function(){if(un.current&&null!=sn){var e=window.setTimeout(function(){var e=Number(sn.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<rn.length&&(un.current=!1,dn(n))},300);return function(){return window.clearTimeout(e)}}},[dn,sn,rn.length]);var cn=t.useMemo(function(){var e=new Map;fe.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=ce.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},[fe,ce]),gn=t.useMemo(function(){var e=new Map;fe.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},[fe]),fn=t.useCallback(function(e){return{startPage:Math.max(0,e.startPage-D),endPage:Math.min(e.numPages-1,e.endPage+D)}},[D]),vn=t.useCallback(function(){var e,n=Oe.current,t=Ve.current;if(n&&t){var i=n.getBoundingClientRect(),r=t.querySelector(".rpv-core__inner-pages"),a=null!==(e=null==r?void 0:r.getBoundingClientRect())&&void 0!==e?e:t.getBoundingClientRect();fe.forEach(function(e){var n,r=Te.current.get(e.id);if(r){var o=t.querySelector('[data-testid="core__page-layer-'.concat(e.pageNumber-1,'"]'));if(o){var s=o.getBoundingClientRect(),l=null!==(n=gn.get(e.id))&&void 0!==n?n:0,u=s.top+O+40*l,d=u+(r.offsetHeight||32),c=u>=a.top&&d<=a.bottom;r.style.top="".concat(u-i.top,"px"),r.style.visibility=c?"visible":"hidden"}else r.style.visibility="hidden"}})}},[O,gn,fe]),pn=t.useCallback(function(e){var n=De.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(De.current=null,vn(),requestAnimationFrame(function(){if(null==De.current){var e=Te.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Me(e)}}))},[vn]);return t.useEffect(function(){var e=Ve.current;if(e&&E){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,vn()}))};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()}}},[E,vn]),n.jsxs("div",e.__assign({ref:Oe,className:ie,style:e.__assign(e.__assign({},re),{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:Ve,style:e.__assign(e.__assign({},ae),{flex:"1 1 auto",width:E?"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},k,{pdfUrl:y,pdfName:C,segments:ve,navigationRequest:Ae,onNavigationSettled:pn,setRenderRange:fn,onCurrentPageChange:function(e){he(e),null==De.current&&Ze&&Ze.pageNumber!==e&&en(),null==K||K(e)}}))})),E&&n.jsxs("aside",e.__assign({"aria-label":"Page review badges",ref:ge,style:e.__assign(e.__assign({},oe),{position:"relative",width:Ye,maxWidth:f,flex:"0 1 ".concat(Ye),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[B&&rn.length>0&&n.jsxs("nav",e.__assign({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:H||"auto",left:G||"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!=sn?sn:"-","aria-label":"Review badge number",onChange:function(e){un.current=!0,ln(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(rn.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",rn.length]})),["previous","next"].map(function(t){var i="previous"===t,r=an+(i?-1:1),a=r<0||r>=rn.length;return n.jsx("button",e.__assign({type:"button","aria-label":"".concat(i?"Previous":"Next"," review badge"),disabled:a,onClick:function(){return dn(r)},style:{display:"grid",placeItems:"center",width:17,height:28,padding:0,border:0,background:"transparent",color:a?"#C7D2FE":"#4F46E5",cursor:a?"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)})]})),fe.map(function(t){var i,r,a=be===t.id,o=null!==(i=cn.get(t.id))&&void 0!==i?i:"1A",s=t.review_step.score,l=t.review_step.confidence,u=g.formatScore(s,l),f=!0===(null===(r=t.segment.confidence)||void 0===r?void 0:r.awaiting_llm),v=g.getConfidenceColors(s,l,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?Te.current.set(t.id,e):Te.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":a,"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 $e(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:o})),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:o})),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)})]}))]})),Ze&&Ee&&n.jsxs(o.default,e.__assign({anchorElement:Ee,placement:"bottom-start",offset:{top:8},width:Math.min(Xe,f),maxWidth:f},{children:[Se&&n.jsx(s.default,{width:"100%",maxWidth:"100%",score:Ze.review_step.score,reason:Ze.review_step.reason,gap:Ze.review_step.gap,onBack:function(){return ke(!1)},onClose:en}),n.jsx("div",e.__assign({style:{display:Se?"none":"block"}},{children:Ze.review_step.review&&Ze.review_step.human_resolution?n.jsx(n.Fragment,{}):"boundary"===Ze.kind?n.jsx(a.default,{width:"100%",maxWidth:"100%",title:Ze.segment.label||Ze.segment.title,pageNo:"Page ".concat(Ze.pageNumber),content:Ze.review_step.reason,cognitiveScore:Ze.review_step.score,metadata:Ze.metadata,defaultStartPage:Ze.segment.start_page,defaultEndPage:Ze.segment.end_page,styles:{root:{borderColor:Je.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Je.text}}},confirmDisabled:ee||Le===Ze.id,onConfirm:function(e,n,t){t&&a.isBoundaryReviewAction(n.id)&&tn(Ze,n.id,t)},onAdjustManually:function(){return null==ne?void 0:ne(v(Ze))},onCognitiveClick:Ke?function(){ke(!0),null==te||te(v(Ze))}:void 0,onClose:en},Ze.id):n.jsx(l.default,{width:"100%",maxWidth:"100%",title:Ze.metadata.current_label||Ze.segment.label||Ze.segment.title,pageNo:"Pages ".concat(Ze.segment.start_page,"-").concat(Ze.segment.end_page),content:Ze.review_step.reason,cognitiveScore:Ze.review_step.score,metadata:Ze.metadata,styles:{root:{borderColor:Je.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:Je.text}}},confirmDisabled:ee||Le===Ze.id,onActionConfirm:function(e,n){tn(Ze,e,n)},onAdjustManually:function(){return null==ne?void 0:ne(v(Ze))},onCognitiveClick:Ke?function(){ke(!0),null==te||te(v(Ze))}:void 0,onClose:en},Ze.id)}))]}))]}))};
2
2
  //# sourceMappingURL=SegmentReviewPdfWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import i from"react";import{pdfStyles as o}from"./PdfStyle.js";import{DefaultPdfIcon as r,DefaultFullScreenIcon as l,DefaultDownloadIcon as d,DefaultCloseIcon as a}from"../../assests/svg/PdfViewerIcons.js";import{Tooltip as s}from"@mui/material";import{Info as c}from"lucide-react";var p=function(p){p.highlightIndex;var h=p.totalHighlights,u=p.controls,g=p.currentPosition,f=p.pdfName,x=p.onClose,m=p.pdfUrl,v=p.viewerRef,y=p.customStyles,w=p.customClasses,b=p.customIcons,k=p.headerAction,S=p.isZoomEnabled,F=void 0===S||S,I=p.showHighlightsAction,C=void 0===I||I,W=p.showFullScreenAction,D=void 0===W||W,E=p.currentSegment,B=p.segmentTooltipText,j=void 0===B?"Details of current segment":B,L=p.currentPage,z=p.totalPages,A=p.onPageNavigate,P=u.ZoomInButton,N=u.ZoomOutButton,R=u.ZoomPopover,T=u.goToPrevious,H=u.goToNext,O=i.useState(String(L)),M=O[0],Z=O[1];i.useEffect(function(){Z(String(L))},[L]);var _={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},G=function(e){return String(e).padStart(2,"0")};return t("div",e({style:e(e(e({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},o.header),null==y?void 0:y.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",columnGap:"16px",rowGap:"12px",minWidth:0}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px",flex:"1 1 180px",minWidth:0}},{children:[n("div",e({style:e(e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==y?void 0:y.pdfIconWrapper),{flexShrink:0})},{children:(null==b?void 0:b.pdfIcon)||n(r,{})})),n(s,e({title:f||"",arrow:!0,placement:"top"},{children:n("div",e({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n("span",e({style:e({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==y?void 0:y.pdfName),className:null==w?void 0:w.pdfName},{children:f}))}))}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:C?"16px":"2px",color:"#4B5563",flex:"0 1 auto",marginLeft:"auto",whiteSpace:"nowrap",minWidth:0,maxWidth:"100%",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"}},{children:[z>0&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:M,onChange:function(e){var t=e.target.value.replace(/\D/g,"");Z(t)},onBlur:function(){var e=Number(M);if(!Number.isInteger(e)||e<1)Z(String(L));else{var t=z?Math.min(e,z):e;A(t),Z(String(t))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(Z(String(L)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(z)}))]})),F&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n(N,{}),n("div",e({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n(R,{})})),n(P,{})]})),!!h&&C&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[t("span",e({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[g," of ",h]})),n("button",e({style:{background:"none",border:"none",cursor:g<=1?"not-allowed":"pointer",padding:"2px 4px",color:g<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:T,disabled:g<=1},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n("button",e({style:{background:"none",border:"none",cursor:g===h?"not-allowed":"pointer",padding:"2px 4px",color:g===h?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:H,disabled:g===h},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),t("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==D&&((null==k?void 0:k.icon)&&(null==k?void 0:k.onClick)?n(s,e({title:(null==k?void 0:k.tooltip)||"",arrow:!0,placement:"top"},{children:n("div",e({onClick:k.onClick,style:e({display:"flex",alignItems:"center",cursor:"pointer"},_)},{children:k.icon}))})):n("button",e({onClick:function(){var e=null==v?void 0:v.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:_,title:"Full Screen"},{children:(null==b?void 0:b.fullScreenIcon)||n(l,{})}))),m&&n("a",e({href:m,target:"_blank",rel:"noopener noreferrer",style:_,title:"Open in new tab"},{children:(null==b?void 0:b.downloadIcon)||n(d,{})})),x&&n("button",e({onClick:x,style:_,title:"Close"},{children:(null==b?void 0:b.closeIcon)||n(a,{})}))]}))]}))]})),E&&t("div",e({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n(s,e({title:j,arrow:!0,placement:"top"},{children:n(c,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),t("span",e({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:["Viewing ",E.title," • Pages ",G(E.start_page),"-",G(E.end_page)]}))]}))]}))};export{p as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import i from"react";import{pdfStyles as o}from"./PdfStyle.js";import{DefaultPdfIcon as r,DefaultFullScreenIcon as l,DefaultDownloadIcon as d,DefaultCloseIcon as a}from"../../assests/svg/PdfViewerIcons.js";import s from"@mui/material/Tooltip";import{Info as c}from"lucide-react";var p=function(p){p.highlightIndex;var h=p.totalHighlights,u=p.controls,g=p.currentPosition,f=p.pdfName,x=p.onClose,m=p.pdfUrl,v=p.viewerRef,y=p.customStyles,w=p.customClasses,b=p.customIcons,k=p.headerAction,S=p.isZoomEnabled,F=void 0===S||S,I=p.showHighlightsAction,C=void 0===I||I,W=p.showFullScreenAction,D=void 0===W||W,E=p.currentSegment,B=p.segmentTooltipText,j=void 0===B?"Details of current segment":B,L=p.currentPage,z=p.totalPages,A=p.onPageNavigate,P=u.ZoomInButton,T=u.ZoomOutButton,N=u.ZoomPopover,R=u.goToPrevious,H=u.goToNext,O=i.useState(String(L)),M=O[0],Z=O[1];i.useEffect(function(){Z(String(L))},[L]);var _={padding:"4px",borderRadius:"6px",background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},G=function(e){return String(e).padStart(2,"0")};return t("div",e({style:e(e(e({marginBottom:"12px",background:"#FAFAFA",borderBottom:"1px solid #F3F4F6",borderTopLeftRadius:"12px",borderTopRightRadius:"12px"},o.header),null==y?void 0:y.header),{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"12px"})},{children:[t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",columnGap:"16px",rowGap:"12px",minWidth:0}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px",flex:"1 1 180px",minWidth:0}},{children:[n("div",e({style:e(e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==y?void 0:y.pdfIconWrapper),{flexShrink:0})},{children:(null==b?void 0:b.pdfIcon)||n(r,{})})),n(s,e({title:f||"",arrow:!0,placement:"top"},{children:n("div",e({style:{flex:1,minWidth:0,overflow:"hidden"}},{children:n("span",e({style:e({display:"block",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500,cursor:"default"},null==y?void 0:y.pdfName),className:null==w?void 0:w.pdfName},{children:f}))}))}))]})),t("div",e({style:{display:"flex",alignItems:"center",gap:C?"16px":"2px",color:"#4B5563",flex:"0 1 auto",marginLeft:"auto",whiteSpace:"nowrap",minWidth:0,maxWidth:"100%",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"}},{children:[z>0&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px",color:"#475467",flexShrink:0,whiteSpace:"nowrap"}},{children:[n("input",{"aria-label":"Current page",inputMode:"numeric",pattern:"[0-9]*",value:M,onChange:function(e){var t=e.target.value.replace(/\D/g,"");Z(t)},onBlur:function(){var e=Number(M);if(!Number.isInteger(e)||e<1)Z(String(L));else{var t=z?Math.min(e,z):e;A(t),Z(String(t))}},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(Z(String(L)),e.currentTarget.blur())},style:{width:"40px",height:"28px",border:"1px solid #E5E7EB",borderRadius:"4px",background:"#FFFFFF",color:"#111827",fontSize:"14px",fontWeight:500,textAlign:"center",outline:"none",boxSizing:"border-box"}}),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:"/"})),n("span",e({style:{fontSize:"14px",fontWeight:500,color:"#111827"}},{children:String(z)}))]})),F&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n(T,{}),n("div",e({style:{fontSize:"14px",fontWeight:500,width:"56px",textAlign:"center"}},{children:n(N,{})})),n(P,{})]})),!!h&&C&&t("div",e({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[t("span",e({style:{fontSize:"14px",color:"#475467",fontWeight:500,lineHeight:1}},{children:[g," of ",h]})),n("button",e({style:{background:"none",border:"none",cursor:g<=1?"not-allowed":"pointer",padding:"2px 4px",color:g<=1?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:R,disabled:g<=1},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 8L6 4L10 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),n("button",e({style:{background:"none",border:"none",cursor:g===h?"not-allowed":"pointer",padding:"2px 4px",color:g===h?"#D0D5DD":"#475467",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,height:"20px",width:"20px"},onClick:H,disabled:g===h},{children:n("svg",e({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},{children:n("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]})),n("div",{style:{width:"1px",height:"20px",background:"#D1D5DB",margin:"0 4px",flexShrink:0}}),t("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0,whiteSpace:"nowrap"}},{children:[!1!==D&&((null==k?void 0:k.icon)&&(null==k?void 0:k.onClick)?n(s,e({title:(null==k?void 0:k.tooltip)||"",arrow:!0,placement:"top"},{children:n("div",e({onClick:k.onClick,style:e({display:"flex",alignItems:"center",cursor:"pointer"},_)},{children:k.icon}))})):n("button",e({onClick:function(){var e=null==v?void 0:v.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},style:_,title:"Full Screen"},{children:(null==b?void 0:b.fullScreenIcon)||n(l,{})}))),m&&n("a",e({href:m,target:"_blank",rel:"noopener noreferrer",style:_,title:"Open in new tab"},{children:(null==b?void 0:b.downloadIcon)||n(d,{})})),x&&n("button",e({onClick:x,style:_,title:"Close"},{children:(null==b?void 0:b.closeIcon)||n(a,{})}))]}))]}))]})),E&&t("div",e({style:{background:"#EEF2FF",border:"1px solid #A5B4FC",borderRadius:"8px",color:"#4F46E5",display:"flex",alignItems:"center",gap:"12px",minWidth:0,padding:"10px 16px",fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:[n(s,e({title:j,arrow:!0,placement:"top"},{children:n(c,{size:16,color:"#4F46E5",strokeWidth:2,style:{flexShrink:0}})})),n("span",e({style:{overflow:"hidden",textOverflow:"ellipsis"}},{children:n(s,e({title:E.title,arrow:!0,placement:"top"},{children:t("span",{children:["Viewing ",E.title," • Pages ",G(E.start_page),"-",G(E.end_page)]})}))}))]}))]}))};export{p as default};
2
2
  //# sourceMappingURL=PdfToolbar.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as i}from"tslib";import{jsx as t,jsxs as n,Fragment as r}from"react/jsx-runtime";import{useMemo as o,useState as l}from"react";import a from"@mui/icons-material/ChevronRight";import d from"@mui/icons-material/Close";import s from"@mui/icons-material/ExpandMore";import c from"@mui/material/Box";import u from"@mui/material/Button";import m from"@mui/material/ButtonBase";import p from"@mui/material/Divider";import h from"@mui/material/IconButton";import f from"@mui/material/Paper";import g from"@mui/material/Radio";import x from"@mui/material/Stack";import b from"@mui/material/TextField";import C from"@mui/material/Typography";import v from"./CognitiveIcon.js";import F from"./CognitiveScoreBadge.js";import y from"../../assests/icons/InfoAlert.js";var E,S=function(e,t){return i([e],Array.isArray(t)?t:null==t?[]:[t],!0)};!function(e){e.KEEP="KEEP",e.SPLIT_HERE="SPLIT_HERE",e.MERGE_NEXT="MERGE_NEXT",e.MERGE_PREVIOUS="MERGE_PREVIOUS",e.SET_RANGE="SET_RANGE"}(E||(E={}));var w=function(e){return Object.values(E).includes(e)},k=function(e){return e.user_actions.flatMap(function(i){var t=e.focus_page;switch(i){case E.SET_RANGE:return[];case"KEEP":return[{id:i,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:i,title:"Create a separate document",description:t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary."}];case"MERGE_NEXT":return[{id:i,title:"Merge into next document",description:t?"Move page ".concat(t," onward into the next document."):"Merge this segment into the next document."}];case"MERGE_PREVIOUS":return[{id:i,title:"Merge into previous document",description:"Merge this segment into the previous document."}]}return[]})};function A(i){var A=i.headerName,I=void 0===A?"Boundary Check":A,M=i.title,R=i.pageNo,z=i.content,T=i.cognitiveScore,W=i.config,P=i.metadata,N=i.selectedIndex,_=i.defaultSelectedIndex,B=void 0===_?null:_,H=i.defaultStartPage,G=i.defaultEndPage,j=i.onSelectionChange,D=i.onConfirm,O=i.onActionConfirm,L=i.onCognitiveClick,K=i.onAdjustManually,U=i.onClose,V=i.confirmLabel,X=void 0===V?"Confirm":V,Y=i.manualPrompt,q=void 0===Y?"Didn't find the right option?":Y,J=i.manualActionLabel,Q=void 0===J?"Adjust Manually":J,Z=i.cognitiveLabel,$=void 0===Z?"Cognitive Integrity":Z,ee=i.showAdjustManually,ie=void 0===ee||ee,te=i.showCognitiveIntegrity,ne=void 0===te||te,re=i.showCloseButton,oe=void 0===re||re,le=i.confirmDisabled,ae=void 0!==le&&le,de=i.width,se=void 0===de?260:de,ce=i.maxWidth,ue=void 0===ce?260:ce,me=i.className,pe=i.styles,he=o(function(){return(null!=W?W:P?k(P):[]).filter(function(e){return e.id!==E.SET_RANGE})},[W,P]),fe=l(B),ge=fe[0],xe=fe[1],be=l(null==H?"":String(H)),Ce=be[0],ve=be[1],Fe=l(null==G?"":String(G)),ye=Fe[0],Ee=Fe[1],Se=l(!1),we=Se[0],ke=Se[1],Ae=l(!1),Ie=Ae[0],Me=Ae[1],Re=void 0===N?ge:N,ze=null==Re?void 0:he[Re],Te=Number(Ce),We=Number(ye),Pe=Ce.trim().length>0&&ye.trim().length>0&&Number.isInteger(Te)&&Number.isInteger(We)&&Te>0&&We>0&&Te<=We,Ne=ae||!ze||!0===ze.disabled||!D&&!O;return t(f,e({className:me,elevation:4,sx:S({width:se,maxWidth:ue,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==pe?void 0:pe.root)},{children:n(x,e({spacing:.75,sx:{p:1}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.75,sx:null==pe?void 0:pe.header},{children:[t(y,{color:"error",height:16,width:16}),t(C,e({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:I})),oe&&t(h,e({size:"small",onClick:U,disabled:!U,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:t(d,{sx:{fontSize:17}})}))]})),n(c,{children:[t(C,e({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:M})),null!=R&&t(C,e({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:R})),t(p,{sx:{my:.625}}),null!=z&&t(C,e({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:z}))]}),n(x,e({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[he.map(function(i,r){var o=Re===r;return t(f,e({variant:"outlined",sx:S({borderColor:o?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==pe?void 0:pe.option)},{children:n(m,e({role:"radio","aria-checked":o,disabled:i.disabled,onClick:function(){return function(e,i){i.disabled||(void 0===N&&xe(e),we&&(ke(!1),Me(!1)),null==j||j(e,i))}(r,i)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[t(g,{checked:o,disabled:i.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),n(c,e({sx:{minWidth:0}},{children:[t(C,e({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:i.title})),null!=i.description&&t(C,e({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:i.description}))]}))]}))}),i.id)}),t(u,e({variant:"contained",fullWidth:!0,disabled:Ne,onClick:function(){if(!Ne&&null!=Re&&ze){var e={selectedIndex:Re,option:ze,metadata:P};null==D||D(Re,ze,e),O&&w(ze.id)&&O(ze.id,e)}},sx:S({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==pe?void 0:pe.confirmButton)},{children:X}))]})),ie&&n(x,e({spacing:.625,sx:null==pe?void 0:pe.manualSection},{children:[n(m,e({onClick:function(){var e=!we;ke(e),Me(!1),e&&(void 0===N&&xe(null),null==K||K())},"aria-expanded":we,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[n(c,{children:[t(C,e({sx:{color:"text.primary",fontSize:12}},{children:q})),t(C,e({sx:{mt:.125,color:"text.primary",fontSize:12}},{children:Q}))]}),t(s,{sx:{color:"text.secondary",fontSize:18,transform:we?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),we&&!Ie&&n(c,e({sx:{pt:1.25,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[n(c,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"7px",px:1.5}},{children:[t(C,e({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Starts"})),t(C,e({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Ends"}))]})),n(c,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"5px",px:1.5}},{children:[t(b,{size:"small",type:"number",value:Ce,onChange:function(e){return ve(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}}),t(b,{size:"small",type:"number",value:ye,error:Ce.trim().length>0&&ye.trim().length>0&&Te>We,onChange:function(e){return Ee(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}})]})),t(c,e({sx:{px:1.5}},{children:t(u,e({onClick:function(){Pe&&Me(!0)},disabled:!Pe,sx:{height:"36px",padding:"0 16px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"2px solid #8E80F3",borderRadius:"8px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"14px",fontWeight:700,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Pe?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Pe?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))})),t(c,{sx:{width:"calc(100% + 48px)",height:"1px",marginTop:"12px",marginLeft:"-24px",backgroundColor:"#EEF0F2",border:"0"}})]})),we&&Ie&&n(x,e({spacing:.75,sx:S({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==pe?void 0:pe.manualConfirmation)},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(y,{color:"warning",height:14,width:14}),t(C,e({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),n(C,e({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Te,"-",We," will become part of ",M,", including pages from other documents in this range."]})),n(x,e({direction:"row",spacing:.75},{children:[t(u,e({variant:"outlined",fullWidth:!0,onClick:function(){return Me(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),t(u,e({variant:"contained",fullWidth:!0,disabled:ae||!D,onClick:function(){if(Pe&&D){var e={id:E.SET_RANGE,title:Q};D(-1,e,{selectedIndex:-1,option:e,startPage:Te,endPage:We,metadata:P})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),t(x,e({spacing:.625,sx:null==pe?void 0:pe.footer},{children:ne&&n(r,{children:[t(p,{}),n(m,e({onClick:L,disabled:!L,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:L?"pointer":"not-allowed"}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:1},{children:[t(v,{sx:{color:"text.secondary"}}),t(C,e({sx:{color:"text.primary",fontSize:12}},{children:$}))]})),n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(F,{score:T}),t(a,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))}export{E as BoundaryReviewActionEnum,k as createBoundaryCardOptions,A as default,w as isBoundaryReviewAction};
1
+ import{__assign as e,__spreadArray as i}from"tslib";import{jsx as t,jsxs as n,Fragment as r}from"react/jsx-runtime";import{useMemo as o,useState as l}from"react";import a from"@mui/icons-material/ChevronRight";import d from"@mui/icons-material/Close";import s from"@mui/icons-material/ExpandMore";import c from"@mui/material/Box";import u from"@mui/material/Button";import m from"@mui/material/ButtonBase";import p from"@mui/material/Divider";import h from"@mui/material/IconButton";import f from"@mui/material/Paper";import g from"@mui/material/Radio";import x from"@mui/material/Stack";import b from"@mui/material/TextField";import C from"@mui/material/Typography";import v from"./CognitiveIcon.js";import F from"./CognitiveScoreBadge.js";import y from"../../assests/icons/InfoAlert.js";var E,S=function(e,t){return i([e],Array.isArray(t)?t:null==t?[]:[t],!0)};!function(e){e.KEEP="KEEP",e.SPLIT_HERE="SPLIT_HERE",e.MERGE_NEXT="MERGE_NEXT",e.MERGE_PREVIOUS="MERGE_PREVIOUS",e.SET_RANGE="SET_RANGE"}(E||(E={}));var w=function(e){return Object.values(E).includes(e)},k=function(e){return e.user_actions.flatMap(function(i){var t=e.focus_page;switch(i){case E.SET_RANGE:return[];case"KEEP":return[{id:i,title:"Keep as is",description:"Keep the current document boundary unchanged."}];case"SPLIT_HERE":return[{id:i,title:"Create a separate document",description:t?"Start a new document at page ".concat(t,"."):"Create a new document at this boundary."}];case"MERGE_NEXT":return[{id:i,title:"Merge into next document",description:t?"Move page ".concat(t," onward into the next document."):"Merge this segment into the next document."}];case"MERGE_PREVIOUS":return[{id:i,title:"Merge into previous document",description:"Merge this segment into the previous document."}]}return[]})};function A(i){var A=i.headerName,I=void 0===A?"Boundary Check":A,M=i.title,R=i.pageNo,z=i.content,T=i.cognitiveScore,W=i.config,P=i.metadata,N=i.selectedIndex,_=i.defaultSelectedIndex,B=void 0===_?null:_,H=i.defaultStartPage,G=i.defaultEndPage,j=i.onSelectionChange,D=i.onConfirm,O=i.onActionConfirm,L=i.onCognitiveClick,K=i.onAdjustManually,U=i.onClose,V=i.confirmLabel,X=void 0===V?"Confirm":V,Y=i.manualPrompt,q=void 0===Y?"Didn't find the right option?":Y,J=i.manualActionLabel,Q=void 0===J?"Adjust Manually":J,Z=i.cognitiveLabel,$=void 0===Z?"Cognitive Integrity":Z,ee=i.showAdjustManually,ie=void 0===ee||ee,te=i.showCognitiveIntegrity,ne=void 0===te||te,re=i.showCloseButton,oe=void 0===re||re,le=i.confirmDisabled,ae=void 0!==le&&le,de=i.width,se=void 0===de?260:de,ce=i.maxWidth,ue=void 0===ce?260:ce,me=i.className,pe=i.styles,he=o(function(){return(null!=W?W:P?k(P):[]).filter(function(e){return e.id!==E.SET_RANGE})},[W,P]),fe=l(B),ge=fe[0],xe=fe[1],be=l(null==H?"":String(H)),Ce=be[0],ve=be[1],Fe=l(null==G?"":String(G)),ye=Fe[0],Ee=Fe[1],Se=l(!1),we=Se[0],ke=Se[1],Ae=l(!1),Ie=Ae[0],Me=Ae[1],Re=void 0===N?ge:N,ze=null==Re?void 0:he[Re],Te=Number(Ce),We=Number(ye),Pe=Ce.trim().length>0&&ye.trim().length>0&&Number.isInteger(Te)&&Number.isInteger(We)&&Te>0&&We>0&&Te<=We,Ne=ae||!ze||!0===ze.disabled||!D&&!O;return t(f,e({className:me,elevation:4,sx:S({width:se,maxWidth:ue,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",overflow:"hidden",boxSizing:"border-box","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==pe?void 0:pe.root)},{children:n(x,e({spacing:.75,sx:{p:1}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.75,sx:null==pe?void 0:pe.header},{children:[t(y,{color:"error",height:16,width:16}),t(C,e({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:I})),oe&&t(h,e({size:"small",onClick:U,disabled:!U,"aria-label":"Close boundary check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:t(d,{sx:{fontSize:17}})}))]})),n(c,{children:[t(C,e({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:M})),null!=R&&t(C,e({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:R})),t(p,{sx:{my:.625}}),null!=z&&t(C,e({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:z}))]}),n(x,e({spacing:.625,role:"radiogroup","aria-label":"Boundary options"},{children:[he.map(function(i,r){var o=Re===r;return t(f,e({variant:"outlined",sx:S({borderColor:o?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==pe?void 0:pe.option)},{children:n(m,e({role:"radio","aria-checked":o,disabled:ae||i.disabled,onClick:function(){return function(e,i){ae||i.disabled||(void 0===N&&xe(e),we&&(ke(!1),Me(!1)),null==j||j(e,i))}(r,i)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[t(g,{checked:o,disabled:ae||i.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),n(c,e({sx:{minWidth:0}},{children:[t(C,e({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:i.title})),null!=i.description&&t(C,e({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:i.description}))]}))]}))}),i.id)}),t(u,e({variant:"contained",fullWidth:!0,disabled:Ne,onClick:function(){if(!Ne&&null!=Re&&ze){var e={selectedIndex:Re,option:ze,metadata:P};null==D||D(Re,ze,e),O&&w(ze.id)&&O(ze.id,e)}},sx:S({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==pe?void 0:pe.confirmButton)},{children:X}))]})),ie&&n(x,e({spacing:.625,sx:null==pe?void 0:pe.manualSection},{children:[n(m,e({disabled:ae,onClick:function(){var e=!we;ke(e),Me(!1),e&&(void 0===N&&xe(null),null==K||K())},"aria-expanded":we,sx:{width:"100%",justifyContent:"space-between",borderRadius:1,textAlign:"left"}},{children:[n(c,{children:[t(C,e({sx:{color:"text.primary",fontSize:12}},{children:q})),t(C,e({sx:{mt:.125,color:"text.primary",fontSize:12}},{children:Q}))]}),t(s,{sx:{color:"text.secondary",fontSize:18,transform:we?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]})),we&&!Ie&&n(c,e({sx:{pt:1.25,fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif'}},{children:[n(c,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"7px",px:1.5}},{children:[t(C,e({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Starts"})),t(C,e({sx:{fontSize:"12px",fontWeight:400,lineHeight:"16px",color:"#57697E",margin:0}},{children:"Ends"}))]})),n(c,e({sx:{display:"grid",gridTemplateColumns:"1fr 1fr",columnGap:"12px",mb:"5px",px:1.5}},{children:[t(b,{size:"small",type:"number",value:Ce,disabled:ae,onChange:function(e){return ve(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}}),t(b,{size:"small",type:"number",value:ye,disabled:ae,error:Ce.trim().length>0&&ye.trim().length>0&&Te>We,onChange:function(e){return Ee(e.target.value)},inputProps:{min:1,step:1,inputMode:"numeric"},sx:{"& .MuiOutlinedInput-root":{height:"36px",backgroundColor:"#FFFFFF","& fieldset":{borderColor:"#C3CFDC",borderWidth:"1.5px",borderRadius:"8px"},"&:hover fieldset":{borderColor:"#C3CFDC"},"&.Mui-focused fieldset":{borderColor:"#9488F6",borderWidth:"1.5px",boxShadow:"0 0 0 2px rgba(142, 128, 243, 0.12)"}},"& .MuiOutlinedInput-input":{fontSize:"15px",fontWeight:400,lineHeight:"1",color:"#34445A",padding:"0 12px",height:"36px"},"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button, & input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}},onWheel:function(e){return e.currentTarget.blur()}})]})),t(c,e({sx:{px:1.5}},{children:t(u,e({onClick:function(){Pe&&Me(!0)},disabled:ae||!Pe,sx:{height:"36px",padding:"0 16px",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",backgroundColor:"#FFFFFF",border:"2px solid #8E80F3",borderRadius:"8px",fontFamily:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif',fontSize:"14px",fontWeight:700,lineHeight:"1",color:"#4A24CF",outline:"none",cursor:"pointer",textTransform:"none",transition:"all 150ms ease-in-out","&:hover":Pe?{backgroundColor:"#FAF9FF",borderColor:"#7F6FF0"}:{},"&:active":Pe?{transform:"translateY(1px)"}:{},"&.Mui-disabled":{backgroundColor:"#FFFFFF",borderColor:"#C3CFDC",color:"#A0ABBE",cursor:"not-allowed"}}},{children:"Apply"}))})),t(c,{sx:{width:"calc(100% + 48px)",height:"1px",marginTop:"12px",marginLeft:"-24px",backgroundColor:"#EEF0F2",border:"0"}})]})),we&&Ie&&n(x,e({spacing:.75,sx:S({p:.75,borderRadius:1.5,bgcolor:"#FFF7ED"},null==pe?void 0:pe.manualConfirmation)},{children:[n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(y,{color:"warning",height:14,width:14}),t(C,e({sx:{color:"#EA580C",fontSize:11,fontWeight:600}},{children:"Confirm this change?"}))]})),n(C,e({sx:{color:"text.secondary",fontSize:10.5,lineHeight:1.4}},{children:["Pages ",Te,"-",We," will become part of ",M,", including pages from other documents in this range."]})),n(x,e({direction:"row",spacing:.75},{children:[t(u,e({variant:"outlined",fullWidth:!0,onClick:function(){return Me(!1)},sx:{minHeight:28,borderRadius:1.5,fontSize:11,textTransform:"none"}},{children:"Cancel"})),t(u,e({variant:"contained",fullWidth:!0,disabled:ae||!D,onClick:function(){if(Pe&&D){var e={id:E.SET_RANGE,title:Q};D(-1,e,{selectedIndex:-1,option:e,startPage:Te,endPage:We,metadata:P})}},sx:{minHeight:28,borderRadius:1.5,bgcolor:"#EA580C",fontSize:11,textTransform:"none","&:hover":{bgcolor:"#C2410C"}}},{children:"Confirm"}))]}))]}))]})),t(x,e({spacing:.625,sx:null==pe?void 0:pe.footer},{children:ne&&n(r,{children:[t(p,{}),n(m,e({onClick:L,disabled:!L,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:L?"pointer":"not-allowed"}},{children:[n(x,e({direction:"row",alignItems:"center",spacing:1},{children:[t(v,{sx:{color:"text.secondary"}}),t(C,e({sx:{color:"text.primary",fontSize:12}},{children:$}))]})),n(x,e({direction:"row",alignItems:"center",spacing:.5},{children:[t(F,{score:T}),t(a,{sx:{color:"text.secondary"}})]}))]}))]})}))]}))}))}export{E as BoundaryReviewActionEnum,k as createBoundaryCardOptions,A as default,w as isBoundaryReviewAction};
2
2
  //# sourceMappingURL=BoundaryCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as o}from"tslib";import{jsx as i,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useMemo as n,useState as l}from"react";import a from"@mui/icons-material/ChevronRight";import d from"@mui/icons-material/Close";import c from"@mui/material/Box";import u from"@mui/material/Button";import s from"@mui/material/ButtonBase";import m from"@mui/material/Divider";import p from"@mui/material/IconButton";import h from"@mui/material/Paper";import f from"@mui/material/Radio";import b from"@mui/material/Stack";import x from"@mui/material/TextField";import v from"@mui/material/Typography";import g from"./CognitiveIcon.js";import C from"./CognitiveScoreBadge.js";import y from"../../assests/icons/InfoAlert.js";var S,I=function(e,i){return o([e],Array.isArray(i)?i:null==i?[]:[i],!0)};!function(e){e.KEEP_LABEL="KEEP_LABEL",e.SET_CUSTOM_LABEL="SET_CUSTOM_LABEL"}(S||(S={}));var w=function(e){return e.user_actions.map(function(o){switch(o){case"KEEP_LABEL":return{id:o,title:"Keep as is",description:e.current_label?'Label stays "'.concat(e.current_label,'"'):"Keep the current document label"};case"SET_CUSTOM_LABEL":return{id:o,title:"Enter a custom label",description:"Create your own document label",requiresInput:!0,inputPlaceholder:e.current_label?"e.g. ".concat(e.current_label):"Enter a document label"}}})},L=function(e){return Object.values(S).includes(e)};function E(o){var S,E=o.headerName,A=void 0===E?"Title Check":E,D=o.title,k=o.pageNo,B=o.content,z=void 0===B?"We're not fully confident about this label. Confirm it, choose a different type, or add a new one.":B,_=o.cognitiveScore,M=o.config,O=o.metadata,T=o.selectedIndex,W=o.defaultSelectedIndex,F=void 0===W?null:W,j=o.onSelectionChange,P=o.customLabel,R=o.defaultCustomLabel,K=o.onCustomLabelChange,H=o.onConfirm,N=o.onActionConfirm,q=o.onCognitiveClick;o.onAdjustManually;var U=o.onClose,G=o.confirmLabel,J=void 0===G?"Confirm":G,Q=o.customInputAriaLabel,V=void 0===Q?"Custom document label":Q;o.manualPrompt,o.manualActionLabel;var X=o.cognitiveLabel,Y=void 0===X?"Cognitive Integrity":X;o.showAdjustManually;var Z=o.showCognitiveIntegrity,$=void 0===Z||Z,ee=o.showCloseButton,oe=void 0===ee||ee,ie=o.confirmDisabled,te=void 0!==ie&&ie,re=o.width,ne=void 0===re?260:re,le=o.maxWidth,ae=void 0===le?260:le,de=o.className,ce=o.styles,ue=n(function(){return null!=M?M:O?w(O):[]},[M,O]),se=l(F),me=se[0],pe=se[1],he=l(null!==(S=null!=R?R:null==O?void 0:O.custom_label)&&void 0!==S?S:""),fe=he[0],be=he[1],xe=void 0===T?me:T,ve=void 0===P?fe:P,ge=null==xe?void 0:ue[xe],Ce=Boolean(null==ge?void 0:ge.requiresInput),ye=te||!H&&!N||!ge||!0===ge.disabled||Ce&&0===ve.trim().length,Se=function(){if(!ye&&null!=xe&&ge){var e=Ce?ve.trim():void 0;null==H||H(xe,ge,e),N&&L(ge.id)&&N(ge.id,{selectedIndex:xe,option:ge,customLabel:e,metadata:O})}};return i(h,e({className:de,elevation:0,sx:I({width:ne,maxWidth:ae,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.2)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==ce?void 0:ce.root)},{children:i(c,e({sx:{overflow:"hidden"}},{children:t(b,e({spacing:.75,sx:{p:1}},{children:[t(b,e({direction:"row",alignItems:"center",spacing:.75,sx:null==ce?void 0:ce.header},{children:[i(y,{color:"error",height:16,width:16}),i(v,e({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:A})),oe&&i(p,e({size:"small",onClick:U,disabled:!U,"aria-label":"Close label check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i(d,{sx:{fontSize:17}})}))]})),t(c,{children:[i(v,e({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:D})),null!=k&&i(v,e({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:k})),i(m,{sx:{my:.625}}),null!=z&&i(v,e({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:z}))]}),t(b,e({spacing:.625,role:"radiogroup","aria-label":"Label options"},{children:[ue.map(function(o,r){var n=xe===r;return t(h,e({variant:"outlined",sx:I({borderColor:n?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==ce?void 0:ce.option)},{children:[t(s,e({role:"radio","aria-checked":n,disabled:o.disabled,onClick:function(){return function(e,o){o.disabled||(void 0===T&&pe(e),null==j||j(e,o))}(r,o)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i(f,{checked:n,disabled:o.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),t(c,e({sx:{minWidth:0}},{children:[i(v,e({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:o.title})),null!=o.description&&i(v,e({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:o.description}))]}))]})),n&&o.requiresInput&&i(c,e({sx:{px:1.25,pb:1}},{children:i(x,{autoFocus:!0,fullWidth:!0,size:"small",value:ve,placeholder:o.inputPlaceholder,inputProps:{"aria-label":V},onChange:function(e){return o=e.target.value,void 0===P&&be(o),void(null==K||K(o));var o},onKeyDown:function(e){"Enter"===e.key&&Se()},variant:"outlined",InputProps:{sx:{height:36,borderRadius:2,backgroundColor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1px"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1.5px"},"& .MuiOutlinedInput-input":{height:"100%",boxSizing:"border-box",px:1.25,py:0,fontSize:12,lineHeight:1.25},"& .MuiOutlinedInput-input::placeholder":{color:"#98A2B3",opacity:1}}},sx:null==ce?void 0:ce.customInput})}))]}),o.id)}),i(u,e({variant:"contained",fullWidth:!0,disabled:ye,onClick:Se,sx:I({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==ce?void 0:ce.confirmButton)},{children:J}))]})),i(b,e({spacing:.625,sx:null==ce?void 0:ce.footer},{children:$&&t(r,{children:[i(m,{}),t(s,e({onClick:q,disabled:!q,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:q?"pointer":"not-allowed"}},{children:[t(b,e({direction:"row",alignItems:"center",spacing:1},{children:[i(g,{sx:{color:"text.secondary"}}),i(v,e({sx:{color:"text.primary",fontSize:12}},{children:Y}))]})),t(b,e({direction:"row",alignItems:"center",spacing:.75},{children:[i(C,{score:_}),i(a,{sx:{color:"text.secondary",fontSize:18}})]}))]}))]})}))]}))}))}))}export{S as LabelReviewActionEnum,w as createLabelCheckOptions,E as default,L as isLabelReviewAction};
1
+ import{__assign as e,__spreadArray as o}from"tslib";import{jsx as i,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useMemo as n,useState as l}from"react";import a from"@mui/icons-material/ChevronRight";import d from"@mui/icons-material/Close";import c from"@mui/material/Box";import u from"@mui/material/Button";import s from"@mui/material/ButtonBase";import m from"@mui/material/Divider";import p from"@mui/material/IconButton";import h from"@mui/material/Paper";import f from"@mui/material/Radio";import b from"@mui/material/Stack";import x from"@mui/material/TextField";import v from"@mui/material/Typography";import g from"./CognitiveIcon.js";import C from"./CognitiveScoreBadge.js";import y from"../../assests/icons/InfoAlert.js";var S,I=function(e,i){return o([e],Array.isArray(i)?i:null==i?[]:[i],!0)};!function(e){e.KEEP_LABEL="KEEP_LABEL",e.SET_CUSTOM_LABEL="SET_CUSTOM_LABEL"}(S||(S={}));var w=function(e){return e.user_actions.map(function(o){switch(o){case"KEEP_LABEL":return{id:o,title:"Keep as is",description:e.current_label?'Label stays "'.concat(e.current_label,'"'):"Keep the current document label"};case"SET_CUSTOM_LABEL":return{id:o,title:"Enter a custom label",description:"Create your own document label",requiresInput:!0,inputPlaceholder:e.current_label?"e.g. ".concat(e.current_label):"Enter a document label"}}})},L=function(e){return Object.values(S).includes(e)};function A(o){var S,A=o.headerName,E=void 0===A?"Title Check":A,D=o.title,k=o.pageNo,B=o.content,z=void 0===B?"We're not fully confident about this label. Confirm it, choose a different type, or add a new one.":B,_=o.cognitiveScore,M=o.config,O=o.metadata,T=o.selectedIndex,W=o.defaultSelectedIndex,F=void 0===W?null:W,j=o.onSelectionChange,P=o.customLabel,R=o.defaultCustomLabel,K=o.onCustomLabelChange,H=o.onConfirm,N=o.onActionConfirm,q=o.onCognitiveClick;o.onAdjustManually;var U=o.onClose,G=o.confirmLabel,J=void 0===G?"Confirm":G,Q=o.customInputAriaLabel,V=void 0===Q?"Custom document label":Q;o.manualPrompt,o.manualActionLabel;var X=o.cognitiveLabel,Y=void 0===X?"Cognitive Integrity":X;o.showAdjustManually;var Z=o.showCognitiveIntegrity,$=void 0===Z||Z,ee=o.showCloseButton,oe=void 0===ee||ee,ie=o.confirmDisabled,te=void 0!==ie&&ie,re=o.disableAllActions,ne=void 0!==re&&re,le=o.width,ae=void 0===le?260:le,de=o.maxWidth,ce=void 0===de?260:de,ue=o.className,se=o.styles,me=n(function(){return null!=M?M:O?w(O):[]},[M,O]),pe=l(F),he=pe[0],fe=pe[1],be=l(null!==(S=null!=R?R:null==O?void 0:O.custom_label)&&void 0!==S?S:""),xe=be[0],ve=be[1],ge=void 0===T?he:T,Ce=void 0===P?xe:P,ye=null==ge?void 0:me[ge],Se=Boolean(null==ye?void 0:ye.requiresInput),Ie=ne||te||!H&&!N||!ye||!0===ye.disabled||Se&&0===Ce.trim().length,we=function(){if(!Ie&&null!=ge&&ye){var e=Se?Ce.trim():void 0;null==H||H(ge,ye,e),N&&L(ye.id)&&N(ye.id,{selectedIndex:ge,option:ye,customLabel:e,metadata:O})}};return i(h,e({className:ue,elevation:0,sx:I({width:ae,maxWidth:ce,borderTop:"4px solid",borderColor:"error.main",borderRadius:2,bgcolor:"background.paper",boxSizing:"border-box",boxShadow:"0 8px 16px rgba(16, 24, 40, 0.2)","@media (max-width: 372px)":{width:"calc(100vw - 32px)"}},null==se?void 0:se.root)},{children:i(c,e({sx:{overflow:"hidden"}},{children:t(b,e({spacing:.75,sx:{p:1}},{children:[t(b,e({direction:"row",alignItems:"center",spacing:.75,sx:null==se?void 0:se.header},{children:[i(y,{color:"error",height:16,width:16}),i(v,e({sx:{flex:1,color:"error.main",fontSize:12,fontWeight:500,lineHeight:1.25,textTransform:"uppercase"}},{children:E})),oe&&i(p,e({size:"small",onClick:U,disabled:!U,"aria-label":"Close label check",sx:{p:0,"&.Mui-disabled":{color:"text.secondary"}}},{children:i(d,{sx:{fontSize:17}})}))]})),t(c,{children:[i(v,e({sx:{color:"text.primary",fontSize:14,fontWeight:500}},{children:D})),null!=k&&i(v,e({sx:{mt:.125,color:"text.secondary",fontSize:12}},{children:k})),i(m,{sx:{my:.625}}),null!=z&&i(v,e({component:"div",sx:{color:"text.secondary",fontSize:11.5,lineHeight:1.3}},{children:z}))]}),t(b,e({spacing:.625,role:"radiogroup","aria-label":"Label options"},{children:[me.map(function(o,r){var n=ge===r;return t(h,e({variant:"outlined",sx:I({borderColor:n?"#1976d2":"divider",borderRadius:2,overflow:"hidden"},null==se?void 0:se.option)},{children:[t(s,e({role:"radio","aria-checked":n,disabled:te||o.disabled,onClick:function(){return function(e,o){te||o.disabled||(void 0===T&&fe(e),null==j||j(e,o))}(r,o)},sx:{width:"100%",justifyContent:"flex-start",px:.75,py:.5,textAlign:"left"}},{children:[i(f,{checked:n,disabled:te||o.disabled,tabIndex:-1,size:"small",sx:{p:.25,mr:.5}}),t(c,e({sx:{minWidth:0}},{children:[i(v,e({sx:{color:"text.primary",fontSize:12.5,fontWeight:500}},{children:o.title})),null!=o.description&&i(v,e({sx:{mt:.125,color:"text.secondary",fontSize:11}},{children:o.description}))]}))]})),n&&o.requiresInput&&i(c,e({sx:{px:1.25,pb:1}},{children:i(x,{autoFocus:!0,fullWidth:!0,size:"small",value:Ce,disabled:te,placeholder:o.inputPlaceholder,inputProps:{"aria-label":V},onChange:function(e){return o=e.target.value,void 0===P&&ve(o),void(null==K||K(o));var o},onKeyDown:function(e){"Enter"===e.key&&we()},variant:"outlined",InputProps:{sx:{height:36,borderRadius:2,backgroundColor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1px"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#D0D5DD",borderWidth:"1.5px"},"& .MuiOutlinedInput-input":{height:"100%",boxSizing:"border-box",px:1.25,py:0,fontSize:12,lineHeight:1.25},"& .MuiOutlinedInput-input::placeholder":{color:"#98A2B3",opacity:1}}},sx:null==se?void 0:se.customInput})}))]}),o.id)}),i(u,e({variant:"contained",fullWidth:!0,disabled:Ie,onClick:we,sx:I({minHeight:32,mt:.25,borderRadius:2,fontSize:13,fontWeight:600,textTransform:"none",backgroundColor:"#5925DC","&:hover":{backgroundColor:"#4A1FB8"},"&.Mui-disabled":{backgroundColor:"#D9D6FE",color:"#FFFFFF"}},null==se?void 0:se.confirmButton)},{children:J}))]})),i(b,e({spacing:.625,sx:null==se?void 0:se.footer},{children:$&&t(r,{children:[i(m,{}),t(s,e({onClick:q,disabled:!q,sx:{justifyContent:"space-between",borderRadius:1,textAlign:"left",cursor:q?"pointer":"not-allowed"}},{children:[t(b,e({direction:"row",alignItems:"center",spacing:1},{children:[i(g,{sx:{color:"text.secondary"}}),i(v,e({sx:{color:"text.primary",fontSize:12}},{children:Y}))]})),t(b,e({direction:"row",alignItems:"center",spacing:.75},{children:[i(C,{score:_}),i(a,{sx:{color:"text.secondary",fontSize:18}})]}))]}))]})}))]}))}))}))}export{S as LabelReviewActionEnum,w as createLabelCheckOptions,A as default,L as isLabelReviewAction};
2
2
  //# sourceMappingURL=LabelCheck.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 u,useState as d,useEffect as c,useCallback as s}from"react";import{SpecialZoomLevel as g}from"@react-pdf-viewer/core";import f from"../PdfViewer/PdfViewer.js";import v,{isBoundaryReviewAction as p}from"./BoundaryCard.js";import m from"./CardWrapper.js";import h from"./CognitiveIntegrity.js";import w from"./LabelCheck.js";import{extractSegmentReviewData as b}from"./reviewStepAdapters.js";import{CircleCheck as y}from"lucide-react";import{Tooltip as x,Typography as C}from"@mui/material";import{getConfidenceColors as _,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 E,F,A,M,R,B=this,P=I.pdfUrl,W=I.pdfName,L=I.segments,z=I.styles,j=I.pdfViewerProps,q=I.showBadges,D=void 0===q||q,O=I.sortByConfidence,T=void 0===O?"low":O,V=I.filterByConfidence,H=void 0===V?"all":V,X=I.showBadgeNavigation,G=void 0===X||X,U=I.autoSelectReviewOnPageChange,Y=void 0!==U&&U,J=I.autoAdvanceAfterConfirm,K=void 0===J||J,Q=I.badgePreloadPages,Z=void 0===Q?8:Q,$=I.badgeOffsetTop,ee=void 0===$?20:$,ne=I.badgeOffsetRight,te=void 0===ne?8:ne,ie=I.initialReviewId,re=I.onBoundaryAction,oe=I.onLabelAction,le=I.onActiveReviewChange,ae=I.onCurrentPageChange,ue=I.onActionError,de=I.onAdjustManually,ce=I.onCognitiveClick,se=I.className,ge=I.style,fe=I.viewerStyle,ve=I.railStyle,pe=I.redirectionData,me=a(function(){return b(L)},[L]),he=me.boundaryReviews,we=me.labelReviews,be=a(function(){return new Map(L.map(function(e,n){return[e.stable_key,n+1]}))},[L]),ye=u(null),xe=a(function(){return e(e([],he.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),we.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=be.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=be.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)})},[he,we,be]),Ce=a(function(){return L.map(function(e){var t;return n(n({},e),{title:(null===(t=e.label)||void 0===t?void 0:t.trim())||e.title})})},[L]),_e=d(1),Ne=_e[0],Se=_e[1],ke=d(null!=ie?ie:null),Ie=ke[0],Ee=ke[1],Fe=d(null!=ie?ie:null),Ae=Fe[0],Me=Fe[1],Re=d(!1),Be=Re[0],Pe=Re[1],We=d(null),Le=We[0],ze=We[1],je=d(null),qe=je[0],De=je[1],Oe=d(function(){return new Set}),Te=Oe[0],Ve=Oe[1],He=d(null),Xe=He[0],Ge=He[1],Ue=u(0),Ye=u(null),Je=u(new Map),Ke=u(null),Qe=u(null),Ze=d(S),$e=Ze[0],en=Ze[1],nn=null!==(F=null===(E=null==z?void 0:z.aside)||void 0===E?void 0:E.width)&&void 0!==F?F:"40%",tn="min(".concat("number"==typeof nn?"".concat(nn,"px"):nn,", ").concat(S,"px, 100%)");c(function(){var e=ye.current;if(e&&D){var n=function(){var n=e.getBoundingClientRect().width;n>0&&en(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()}}},[D]),a(function(){var e=new Set(Te);return xe.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[Te,xe]);var rn=a(function(){var e;return null!==(e=xe.find(function(e){return e.id===Ie}))&&void 0!==e?e:null},[Ie,xe]),on=_(null==rn?void 0:rn.review_step.score,null==rn?void 0:rn.review_step.confidence,null===(A=null==rn?void 0:rn.segment.confidence)||void 0===A?void 0:A.awaiting_llm),ln=Boolean((null===(M=null==rn?void 0:rn.review_step.reason)||void 0===M?void 0:M.trim())||(null===(R=null==rn?void 0:rn.review_step.gap)||void 0===R?void 0:R.trim())),an=s(function(e,n){Ue.current+=1,Ye.current={requestId:Ue.current,pageNumber:e,reviewId:n},De({pageNumber:e,requestId:Ue.current})},[]),un=s(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(Ee(e.id),Me(e.id),Pe(!1),ze(null),an(e.pageNumber,e.id),null==le||le(e.id,e.segment))},[le,an]);c(function(){if((null==pe?void 0:pe.pageNumber)&&pe.type){var e=Number(pe.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=xe.find(function(n){return n.segment.start_page===e&&n.kind===pe.type});n&&un(n)}}},[pe,un,xe]);var dn=s(function(){Ye.current=null,Pe(!1),Ee(null),ze(null),null==le||le(null,null)},[le]),cn=s(function(e){var n;if(K){var t=xe.findIndex(function(n){return n.id===e}),i=new Set(xe.map(function(e){return e.id})),r=null!==(n=xe.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:xe.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return un(r)}):dn()}else dn()},[K,dn,xe,un,xe]),sn=s(function(e,n,r){return t(B,void 0,void 0,function(){var t,o;return i(this,function(i){switch(i.label){case 0:t=k(e),Ge(e.id),i.label=1;case 1:return i.trys.push([1,6,7,8]),"boundary"!==e.kind?[3,3]:[4,null==re?void 0:re(n,r,t)];case 2:return i.sent(),[3,5];case 3:return[4,null==oe?void 0:oe(n,r,t)];case 4:i.sent(),i.label=5;case 5:return Ve(function(n){var t=new Set(n);return t.add(e.id),t}),cn(e.id),[3,8];case 6:return o=i.sent(),null==ue||ue(o,t),[3,8];case 7:return Ge(null),[7];case 8:return[2]}})})},[ue,re,oe,cn]);c(function(){Ie&&!xe.some(function(e){return e.id===Ie})&&dn()},[Ie,dn,xe]),c(function(){if(Y){var e=xe.find(function(e){return e.pageNumber===Ne});e&&e.id!==Ie&&un(e)}},[Ie,Y,Ne,un,xe]),c(function(){Ie&&!xe.some(function(e){var n;return e.id===Ie&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&dn()},[Ie,dn,xe]);var gn=a(function(){var n=xe.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===H)return n;var t=["low","medium","high"].filter(function(e){return e!==T}),i=e([T],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})},[H,T,xe]),fn=gn.findIndex(function(e){return e.id===Ae}),vn=d(null),pn=vn[0],mn=vn[1],hn=u(!1),wn=s(function(e){var n=gn[e];n&&un(n)},[gn,un]);c(function(){Ae&&!gn.some(function(e){return e.id===Ae})&&Me(null)},[gn,Ae]),c(function(){hn.current=!1,mn(fn>=0?String(fn+1):null)},[fn,gn.length]),c(function(){if(hn.current&&null!=pn){var e=window.setTimeout(function(){var e=Number(pn.trim()),n=e-1;Number.isInteger(e)&&n>=0&&n<gn.length&&(hn.current=!1,wn(n))},300);return function(){return window.clearTimeout(e)}}},[wn,pn,gn.length]);var bn=a(function(){var e=new Map;xe.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=be.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},[xe,be]),yn=a(function(){var e=new Map;xe.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},[xe]),xn=s(function(e){return{startPage:Math.max(0,e.startPage-Z),endPage:Math.min(e.numPages-1,e.endPage+Z)}},[Z]),Cn=s(function(){var e,n=Ke.current,t=Qe.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();xe.forEach(function(e){var n,r=Je.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=yn.get(e.id))&&void 0!==n?n:0,d=a.top+ee+40*u,c=d+(r.offsetHeight||32),s=d>=o.top&&c<=o.bottom;r.style.top="".concat(d-i.top,"px"),r.style.visibility=s?"visible":"hidden"}else r.style.visibility="hidden"}})}},[ee,yn,xe]),_n=s(function(e){var n=Ye.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(Ye.current=null,Cn(),requestAnimationFrame(function(){if(null==Ye.current){var e=Je.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&ze(e)}}))},[Cn]);return c(function(){var e=Qe.current;if(e&&D){var n=null,t=function(){null==n&&(n=requestAnimationFrame(function(){n=null,Cn()}))};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()}}},[D,Cn]),r("div",n({ref:Ke,className:se,style:n(n({},ge),{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:Qe,style:n(n({},fe),{flex:"1 1 auto",width:D?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:o(f,n({defaultScale:g.PageFit,highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},j,{pdfUrl:P,pdfName:W,segments:Ce,navigationRequest:qe,onNavigationSettled:_n,setRenderRange:xn,onCurrentPageChange:function(e){Se(e),null==Ye.current&&rn&&rn.pageNumber!==e&&dn(),null==ae||ae(e)}}))})),D&&r("aside",n({"aria-label":"Page review badges",ref:ye,style:n(n({},ve),{position:"relative",width:tn,maxWidth:S,flex:"0 1 ".concat(tn),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[G&&gn.length>0&&r("nav",n({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:te,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!=pn?pn:"-","aria-label":"Review badge number",onChange:function(e){hn.current=!0,mn(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(gn.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",gn.length]})),["previous","next"].map(function(e){var t="previous"===e,i=fn+(t?-1:1),r=i<0||i>=gn.length;return o("button",n({type:"button","aria-label":"".concat(t?"Previous":"Next"," review badge"),disabled:r,onClick:function(){return wn(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)})]})),xe.map(function(e){var t,i,l=Ie===e.id,a=null!==(t=bn.get(e.id))&&void 0!==t?t:"1A",u=e.review_step.score,d=e.review_step.confidence,c=N(u,d),s=!0===(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm),g=_(u,d,s),f=e.review_step.review&&null!==e.review_step.review.action,v=Boolean(f)||s;return o(x,n({title:s?"data is being processed":"",arrow:!0},{children:o("span",n({ref:function(n){n?Je.current.set(e.id,n):Je.current.delete(e.id)},style:{position:"absolute",top:0,left:0,visibility:"hidden",display:"inline-flex",cursor:v?"not-allowed":"pointer"}},{children:o("button",n({disabled:v,type:"button","aria-pressed":l,"aria-label":s?"".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 un(e)},style:{cursor:"inherit",display:"flex",alignItems:"center",justifyContent:"space-around",gap:4,width:f&&!s?105:80,minHeight:25,padding:"2px 5px",border:"1px solid ".concat(f&&!s?"#E2E8F0":g.border),borderRadius:16,backgroundColor:f&&!s?"#F8FAFC":g.background,color:f&&!s?"#475569":g.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"}},f&&!s?{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"===c?c:"".concat(c,"%")}))]})),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:g.divider,strokeWidth:"0.8"})})),o("span",n({style:{fontSize:11,fontWeight:500,marginLeft:"7px",display:"flex",alignItems:"center"}},{children:"N/A"===c?c:"".concat(c,"%")}))]}))]}))}))}))}),e.id)})]}))]})),rn&&Le&&r(m,n({anchorElement:Le,placement:"bottom-start",offset:{top:8},width:Math.min($e,S),maxWidth:S},{children:[Be&&o(h,{width:"100%",maxWidth:"100%",score:rn.review_step.score,reason:rn.review_step.reason,gap:rn.review_step.gap,onBack:function(){return Pe(!1)},onClose:dn}),o("div",n({style:{display:Be?"none":"block"}},{children:rn.review_step.review&&rn.review_step.human_resolution?o(l,{}):"boundary"===rn.kind?o(v,{width:"100%",maxWidth:"100%",title:rn.segment.label||rn.segment.title,pageNo:"Page ".concat(rn.pageNumber),content:rn.review_step.reason,cognitiveScore:rn.review_step.score,metadata:rn.metadata,defaultStartPage:rn.segment.start_page,defaultEndPage:rn.segment.end_page,styles:{root:{borderColor:on.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:on.text}}},confirmDisabled:Xe===rn.id,onConfirm:function(e,n,t){t&&p(n.id)&&sn(rn,n.id,t)},onAdjustManually:function(){return null==de?void 0:de(k(rn))},onCognitiveClick:ln?function(){Pe(!0),null==ce||ce(k(rn))}:void 0,onClose:dn},rn.id):o(w,{width:"100%",maxWidth:"100%",title:rn.metadata.current_label||rn.segment.label||rn.segment.title,pageNo:"Pages ".concat(rn.segment.start_page,"-").concat(rn.segment.end_page),content:rn.review_step.reason,cognitiveScore:rn.review_step.score,metadata:rn.metadata,styles:{root:{borderColor:on.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:on.text}}},confirmDisabled:Xe===rn.id,onActionConfirm:function(e,n){sn(rn,e,n)},onAdjustManually:function(){return null==de?void 0:de(k(rn))},onCognitiveClick:ln?function(){Pe(!0),null==ce||ce(k(rn))}:void 0,onClose:dn},rn.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 f}from"@react-pdf-viewer/core";import g from"../PdfViewer/PdfViewer.js";import v,{isBoundaryReviewAction as p}from"./BoundaryCard.js";import m from"./CardWrapper.js";import h from"./CognitiveIntegrity.js";import w from"./LabelCheck.js";import{extractSegmentReviewData as b}from"./reviewStepAdapters.js";import{CircleCheck as y}from"lucide-react";import{Tooltip as x,Typography as C}from"@mui/material";import{getConfidenceColors as _,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=this,P=I.pdfUrl,L=I.pdfName,W=I.segments,z=I.styles,j=I.pdfViewerProps,q=I.showBadges,D=void 0===q||q,O=I.sortByConfidence,T=void 0===O?"low":O,V=I.filterByConfidence,H=void 0===V?"all":V,X=I.showBadgeNavigation,G=void 0===X||X,U=I.autoSelectReviewOnPageChange,Y=void 0!==U&&U,J=I.autoAdvanceAfterConfirm,K=void 0===J||J,Q=I.badgePreloadPages,Z=void 0===Q?8:Q,$=I.badgeOffsetTop,ee=void 0===$?20:$,ne=I.badgeOffsetRight,te=void 0===ne?68:ne,ie=I.badgeOffsetLeft,re=void 0===ie?0:ie,oe=I.initialReviewId,le=I.onBoundaryAction,ae=I.onLabelAction,ue=I.onActiveReviewChange,de=I.onCurrentPageChange,se=I.onActionError,ce=I.disableAllActions,fe=void 0!==ce&&ce,ge=I.onAdjustManually,ve=I.onCognitiveClick,pe=I.className,me=I.style,he=I.viewerStyle,we=I.railStyle,be=I.redirectionData,ye=a(function(){return b(W)},[W]),xe=ye.boundaryReviews,Ce=ye.labelReviews,_e=a(function(){return new Map(W.map(function(e,n){return[e.stable_key,n+1]}))},[W]),Ne=u(null),Se=a(function(){return e(e([],xe.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),Ce.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=_e.get(e.segment.stable_key))&&void 0!==t?t:Number.MAX_SAFE_INTEGER,o=null!==(i=_e.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)})},[xe,Ce,_e]),ke=a(function(){return W.map(function(e){var t;return n(n({},e),{title:(null===(t=e.label)||void 0===t?void 0:t.trim())||e.title})})},[W]),Ie=d(1),Ae=Ie[0],Ee=Ie[1],Fe=d(null!=oe?oe:null),Me=Fe[0],Re=Fe[1],Be=d(null!=oe?oe:null),Pe=Be[0],Le=Be[1],We=d(!1),ze=We[0],je=We[1],qe=d(null),De=qe[0],Oe=qe[1],Te=d(null),Ve=Te[0],He=Te[1],Xe=d(function(){return new Set}),Ge=Xe[0],Ue=Xe[1],Ye=d(null),Je=Ye[0],Ke=Ye[1],Qe=u(0),Ze=u(null),$e=u(new Map),en=u(null),nn=u(null),tn=d(S),rn=tn[0],on=tn[1],ln=null!==(E=null===(A=null==z?void 0:z.aside)||void 0===A?void 0:A.width)&&void 0!==E?E:"40%",an="min(".concat("number"==typeof ln?"".concat(ln,"px"):ln,", ").concat(S,"px, 100%)");s(function(){var e=Ne.current;if(e&&D){var n=function(){var n=e.getBoundingClientRect().width;n>0&&on(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()}}},[D]),a(function(){var e=new Set(Ge);return Se.forEach(function(n){null!=n.review_step.review&&e.add(n.id)}),e},[Ge,Se]);var un=a(function(){var e;return null!==(e=Se.find(function(e){return e.id===Me}))&&void 0!==e?e:null},[Me,Se]),dn=_(null==un?void 0:un.review_step.score,null==un?void 0:un.review_step.confidence,null===(F=null==un?void 0:un.segment.confidence)||void 0===F?void 0:F.awaiting_llm),sn=Boolean((null===(M=null==un?void 0:un.review_step.reason)||void 0===M?void 0:M.trim())||(null===(R=null==un?void 0:un.review_step.gap)||void 0===R?void 0:R.trim())),cn=c(function(e,n){Qe.current+=1,Ze.current={requestId:Qe.current,pageNumber:e,reviewId:n},He({pageNumber:e,requestId:Qe.current})},[]),fn=c(function(e){var n;!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)&&(Re(e.id),Le(e.id),je(!1),Oe(null),cn(e.pageNumber,e.id),null==ue||ue(e.id,e.segment))},[ue,cn]);s(function(){if((null==be?void 0:be.pageNumber)&&be.type){var e=Number(be.pageNumber);if(Number.isInteger(e)&&!(e<1)){var n=Se.find(function(n){return n.segment.start_page===e&&n.kind===be.type});n&&fn(n)}}},[be,fn,Se]);var gn=c(function(){Ze.current=null,je(!1),Re(null),Oe(null),null==ue||ue(null,null)},[ue]),vn=c(function(e){var n;if(K){var t=Se.findIndex(function(n){return n.id===e}),i=new Set(Se.map(function(e){return e.id})),r=null!==(n=Se.find(function(n,r){return r>t&&n.id!==e&&i.has(n.id)}))&&void 0!==n?n:Se.find(function(n){return n.id!==e});r?requestAnimationFrame(function(){return fn(r)}):gn()}else gn()},[K,gn,Se,fn,Se]),pn=c(function(e,n,r){return t(B,void 0,void 0,function(){var t,o;return i(this,function(i){switch(i.label){case 0:if(fe)return[2];t=k(e),Ke(e.id),i.label=1;case 1:return i.trys.push([1,6,7,8]),"boundary"!==e.kind?[3,3]:[4,null==le?void 0:le(n,r,t)];case 2:return i.sent(),[3,5];case 3:return[4,null==ae?void 0:ae(n,r,t)];case 4:i.sent(),i.label=5;case 5:return Ue(function(n){var t=new Set(n);return t.add(e.id),t}),vn(e.id),[3,8];case 6:return o=i.sent(),null==se||se(o,t),[3,8];case 7:return Ke(null),[7];case 8:return[2]}})})},[fe,se,le,ae,vn]);s(function(){Me&&!Se.some(function(e){return e.id===Me})&&gn()},[Me,gn,Se]),s(function(){if(Y){var e=Se.find(function(e){return e.pageNumber===Ae});e&&e.id!==Me&&fn(e)}},[Me,Y,Ae,fn,Se]),s(function(){Me&&!Se.some(function(e){var n;return e.id===Me&&!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)})&&gn()},[Me,gn,Se]);var mn=a(function(){var n=Se.filter(function(e){var n;return!0!==(null===(n=e.segment.confidence)||void 0===n?void 0:n.awaiting_llm)});if("all"===H)return n;var t=["low","medium","high"].filter(function(e){return e!==T}),i=e([T],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})},[H,T,Se]),hn=mn.findIndex(function(e){return e.id===Pe}),wn=d(null),bn=wn[0],yn=wn[1],xn=u(!1),Cn=c(function(e){var n=mn[e];n&&fn(n)},[mn,fn]);s(function(){Pe&&!mn.some(function(e){return e.id===Pe})&&Le(null)},[mn,Pe]),s(function(){xn.current=!1,yn(hn>=0?String(hn+1):null)},[hn,mn.length]),s(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,Cn(n))},300);return function(){return window.clearTimeout(e)}}},[Cn,bn,mn.length]);var _n=a(function(){var e=new Map;Se.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=_e.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},[Se,_e]),Nn=a(function(){var e=new Map;Se.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},[Se]),Sn=c(function(e){return{startPage:Math.max(0,e.startPage-Z),endPage:Math.min(e.numPages-1,e.endPage+Z)}},[Z]),kn=c(function(){var e,n=en.current,t=nn.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();Se.forEach(function(e){var n,r=$e.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=Nn.get(e.id))&&void 0!==n?n:0,d=a.top+ee+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"}})}},[ee,Nn,Se]),In=c(function(e){var n=Ze.current;n&&n.requestId===e.requestId&&n.pageNumber===e.pageNumber&&(Ze.current=null,kn(),requestAnimationFrame(function(){if(null==Ze.current){var e=$e.current.get(n.reviewId);e&&"hidden"!==e.style.visibility&&Oe(e)}}))},[kn]);return s(function(){var e=nn.current;if(e&&D){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()}}},[D,kn]),r("div",n({ref:en,className:pe,style:n(n({},me),{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:nn,style:n(n({},he),{flex:"1 1 auto",width:D?"auto":"100%",minWidth:0,height:"100%",boxSizing:"border-box"})},{children:o(g,n({defaultScale:f.PageFit,highlightText:[],highlightPages:{},highlightCordinatePages:[],useCoordinates:!1},j,{pdfUrl:P,pdfName:L,segments:ke,navigationRequest:Ve,onNavigationSettled:In,setRenderRange:Sn,onCurrentPageChange:function(e){Ee(e),null==Ze.current&&un&&un.pageNumber!==e&&gn(),null==de||de(e)}}))})),D&&r("aside",n({"aria-label":"Page review badges",ref:Ne,style:n(n({},we),{position:"relative",width:an,maxWidth:S,flex:"0 1 ".concat(an),minHeight:0,overflow:"hidden",boxSizing:"border-box"})},{children:[G&&mn.length>0&&r("nav",n({"aria-label":"Review badge navigation",style:{position:"absolute",top:8,right:te||"auto",left:re||"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!=bn?bn:"-","aria-label":"Review badge number",onChange:function(e){xn.current=!0,yn(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(mn.length," reviews"),style:{flex:1,color:"#4F46E5",fontSize:14,whiteSpace:"nowrap",textAlign:"center"}},{children:["of ",mn.length]})),["previous","next"].map(function(e){var t="previous"===e,i=hn+(t?-1:1),r=i<0||i>=mn.length;return o("button",n({type:"button","aria-label":"".concat(t?"Previous":"Next"," review badge"),disabled:r,onClick:function(){return Cn(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)})]})),Se.map(function(e){var t,i,l=Me===e.id,a=null!==(t=_n.get(e.id))&&void 0!==t?t:"1A",u=e.review_step.score,d=e.review_step.confidence,s=N(u,d),c=!0===(null===(i=e.segment.confidence)||void 0===i?void 0:i.awaiting_llm),f=_(u,d,c),g=e.review_step.review&&null!==e.review_step.review.action,v=Boolean(g)||c;return o(x,n({title:c?"data is being processed":"",arrow:!0},{children:o("span",n({ref:function(n){n?$e.current.set(e.id,n):$e.current.delete(e.id)},style:{position:"absolute",top:0,left:10,visibility:"hidden",display:"inline-flex",cursor:v?"not-allowed":"pointer"}},{children:o("button",n({disabled:v,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 fn(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":f.border),borderRadius:16,backgroundColor:g&&!c?"#F8FAFC":f.background,color:g&&!c?"#475569":f.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(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)})]}))]})),un&&De&&r(m,n({anchorElement:De,placement:"bottom-start",offset:{top:8},width:Math.min(rn,S),maxWidth:S},{children:[ze&&o(h,{width:"100%",maxWidth:"100%",score:un.review_step.score,reason:un.review_step.reason,gap:un.review_step.gap,onBack:function(){return je(!1)},onClose:gn}),o("div",n({style:{display:ze?"none":"block"}},{children:un.review_step.review&&un.review_step.human_resolution?o(l,{}):"boundary"===un.kind?o(v,{width:"100%",maxWidth:"100%",title:un.segment.label||un.segment.title,pageNo:"Page ".concat(un.pageNumber),content:un.review_step.reason,cognitiveScore:un.review_step.score,metadata:un.metadata,defaultStartPage:un.segment.start_page,defaultEndPage:un.segment.end_page,styles:{root:{borderColor:dn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:dn.text}}},confirmDisabled:fe||Je===un.id,onConfirm:function(e,n,t){t&&p(n.id)&&pn(un,n.id,t)},onAdjustManually:function(){return null==ge?void 0:ge(k(un))},onCognitiveClick:sn?function(){je(!0),null==ve||ve(k(un))}:void 0,onClose:gn},un.id):o(w,{width:"100%",maxWidth:"100%",title:un.metadata.current_label||un.segment.label||un.segment.title,pageNo:"Pages ".concat(un.segment.start_page,"-").concat(un.segment.end_page),content:un.review_step.reason,cognitiveScore:un.review_step.score,metadata:un.metadata,styles:{root:{borderColor:dn.cardBorder},header:{"& > .MuiSvgIcon-root, & .MuiTypography-root":{color:dn.text}}},confirmDisabled:fe||Je===un.id,onActionConfirm:function(e,n){pn(un,e,n)},onAdjustManually:function(){return null==ge?void 0:ge(k(un))},onCognitiveClick:sn?function(){je(!0),null==ve||ve(k(un))}:void 0,onClose:gn},un.id)}))]}))]}))}export{I as default};
2
2
  //# sourceMappingURL=SegmentReviewPdfWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,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AAE,SAAS,CAAC;IAC9B,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,UAA6B,EAC7B,KAAK,EACL,MAAM,EACN,OAAO,EACP,cAAc,EACd,MAAM,EACN,QAAQ,EACR,aAAa,EACb,oBAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,YAAwB,EACxB,YAA8C,EAC9C,iBAAqC,EACrC,cAAsC,EACtC,kBAAyB,EACzB,sBAA6B,EAC7B,eAAsB,EACtB,eAAuB,EACvB,KAAW,EACX,QAAc,EACd,SAAS,EACT,MAAM,GACP,EAAE,iBAAiB,2CAijBnB"}
1
+ {"version":3,"file":"BoundaryCard.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/BoundaryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc1D,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAa3D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oBAAY,wB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,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,UAA6B,EAC7B,KAAK,EACL,MAAM,EACN,OAAO,EACP,cAAc,EACd,MAAM,EACN,QAAQ,EACR,aAAa,EACb,oBAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,YAAwB,EACxB,YAA8C,EAC9C,iBAAqC,EACrC,cAAsC,EACtC,kBAAyB,EACzB,sBAA6B,EAC7B,eAAsB,EACtB,eAAuB,EACvB,KAAW,EACX,QAAc,EACd,SAAS,EACT,MAAM,GACP,EAAE,iBAAiB,2CAojBnB"}
@@ -72,10 +72,11 @@ export interface LabelCheckProps {
72
72
  showCognitiveIntegrity?: boolean;
73
73
  showCloseButton?: boolean;
74
74
  confirmDisabled?: boolean;
75
+ disableAllActions?: boolean;
75
76
  width?: number | string;
76
77
  maxWidth?: number | string;
77
78
  className?: string;
78
79
  styles?: LabelCheckStyles;
79
80
  }
80
- export default function LabelCheck({ headerName, title, pageNo, content, cognitiveScore, config, metadata, selectedIndex, defaultSelectedIndex, onSelectionChange, customLabel, defaultCustomLabel, onCustomLabelChange, onConfirm, onActionConfirm, onCognitiveClick, onAdjustManually, onClose, confirmLabel, customInputAriaLabel, manualPrompt, manualActionLabel, cognitiveLabel, showAdjustManually, showCognitiveIntegrity, showCloseButton, confirmDisabled, width, maxWidth, className, styles, }: LabelCheckProps): import("react/jsx-runtime").JSX.Element;
81
+ export default function LabelCheck({ headerName, title, pageNo, content, cognitiveScore, config, metadata, selectedIndex, defaultSelectedIndex, onSelectionChange, customLabel, defaultCustomLabel, onCustomLabelChange, onConfirm, onActionConfirm, onCognitiveClick, onAdjustManually, onClose, confirmLabel, customInputAriaLabel, manualPrompt, manualActionLabel, cognitiveLabel, showAdjustManually, showCognitiveIntegrity, showCloseButton, confirmDisabled, disableAllActions, width, maxWidth, className, styles, }: LabelCheckProps): import("react/jsx-runtime").JSX.Element;
81
82
  //# sourceMappingURL=LabelCheck.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LabelCheck.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/LabelCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc1D,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAa3D,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oBAAY,qBAAqB;IAC/B,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;CACtC;AAED,MAAM,MAAM,iBAAiB,GAAG,GAAG,qBAAqB,EAAE,CAAC;AAE3D,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED,eAAO,MAAM,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W,EACX,QAAc,EACd,SAAS,EACT,MAAM,GACP,EAAE,eAAe,2CAyTjB"}
1
+ {"version":3,"file":"LabelCheck.d.ts","sourceRoot":"","sources":["../../../../../src/features/SegmentReviewComponents/LabelCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc1D,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAa3D,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oBAAY,qBAAqB;IAC/B,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;CACtC;AAED,MAAM,MAAM,iBAAiB,GAAG,GAAG,qBAAqB,EAAE,CAAC;AAE3D,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED,eAAO,MAAM,uBAAuB,aACxB,mBAAmB,KAC5B,gBAAgB,EAqBjB,CAAC;AAEH,eAAO,MAAM,mBAAmB,UAAW,MAAM,+CAC8B,CAAC;AAEhF,MAAM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@@ -38,6 +38,7 @@ export interface SegmentReviewPdfWrapperProps {
38
38
  badgeOffsetTop?: number;
39
39
  /** Horizontal inset from the external badge rail's right edge. */
40
40
  badgeOffsetRight?: number;
41
+ badgeOffsetLeft?: number;
41
42
  initialReviewId?: string;
42
43
  onBoundaryAction?: (action: BoundaryReviewAction, details: BoundaryReviewConfirmDetails, context: SegmentReviewActionContext) => void | Promise<void>;
43
44
  onLabelAction?: (action: LabelReviewAction, details: LabelReviewConfirmDetails, context: SegmentReviewActionContext) => void | Promise<void>;
@@ -53,11 +54,12 @@ export interface SegmentReviewPdfWrapperProps {
53
54
  railStyle?: CSSProperties;
54
55
  redirectionData?: RedirectionData;
55
56
  styles?: Record<string, React.CSSProperties>;
57
+ disableAllActions?: boolean;
56
58
  }
57
59
  /**
58
60
  * Orchestrates the PDF, review badges, page navigation, active card and actions.
59
61
  * It consumes backend-shaped segments directly; cards never parse the raw payload.
60
62
  */
61
- export default function SegmentReviewPdfWrapper({ pdfUrl, pdfName, segments, styles, pdfViewerProps, showBadges, sortByConfidence, filterByConfidence, showBadgeNavigation, autoSelectReviewOnPageChange, autoAdvanceAfterConfirm, badgePreloadPages, badgeOffsetTop, badgeOffsetRight, initialReviewId, onBoundaryAction, onLabelAction, onActiveReviewChange, onCurrentPageChange, onActionError, onAdjustManually, onCognitiveClick, className, style, viewerStyle, railStyle, redirectionData, }: SegmentReviewPdfWrapperProps): import("react/jsx-runtime").JSX.Element;
63
+ export default function SegmentReviewPdfWrapper({ pdfUrl, pdfName, segments, styles, pdfViewerProps, showBadges, sortByConfidence, filterByConfidence, showBadgeNavigation, autoSelectReviewOnPageChange, autoAdvanceAfterConfirm, badgePreloadPages, badgeOffsetTop, badgeOffsetRight, badgeOffsetLeft, initialReviewId, onBoundaryAction, onLabelAction, onActiveReviewChange, onCurrentPageChange, onActionError, disableAllActions, onAdjustManually, onCognitiveClick, className, style, viewerStyle, railStyle, redirectionData, }: SegmentReviewPdfWrapperProps): import("react/jsx-runtime").JSX.Element;
62
64
  export {};
63
65
  //# sourceMappingURL=SegmentReviewPdfWrapper.d.ts.map
@@ -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,EAEnB,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,MAAM,GAAG,KAAK,CAAC;AAC5D,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,qBAAqB,CAAC;CAC9B;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;I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AgB,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACjE,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAEjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAC9C;AAsBD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,cAAc,EACd,UAAiB,EACjB,gBAAwB,EACxB,kBAA0B,EAC1B,mBAA0B,EAC1B,4BAAoC,EACpC,uBAA8B,EAC9B,iBAAqB,EACrB,cAAmB,EACnB,gBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,eAAe,GAChB,EAAE,4BAA4B,2CAi4B9B"}
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,EAEnB,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,gBAAgB,CAAC;AAGxB,OAAmB,EACjB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAA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C;CAC7B;AAsBD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,cAAc,EACd,UAAiB,EACjB,gBAAwB,EACxB,kBAA0B,EAC1B,mBAA0B,EAC1B,4BAAoC,EACpC,uBAA8B,EAC9B,iBAAqB,EACrB,cAAmB,EACnB,gBAAqB,EACrB,eAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,iBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACT,eAAe,GAChB,EAAE,4BAA4B,2CAo4B9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viswa-test/test-citation",
3
- "version": "0.0.306",
3
+ "version": "0.0.308",
4
4
  "author": "Viswa Koduru",
5
5
  "description": "",
6
6
  "license": "MIT",