@viswa-test/test-citation 0.0.244 → 0.0.246
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/service/redlineService.js +1 -1
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/service/redlineService.js +1 -1
- package/dist/types/src/RedlineApprovalCardTest.d.ts +1 -0
- package/dist/types/src/RedlineApprovalCardTest.d.ts.map +1 -0
- package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
- package/dist/types/src/commonConstants.d.ts +31103 -0
- package/dist/types/src/commonConstants.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +1256 -553
- package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +1 -10
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/HistoryMenu.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/service/redlineService.d.ts +0 -6
- package/dist/types/src/service/redlineService.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +0 -2
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/cws/SocketManager.js.map +0 -1
- package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js +0 -2
- package/dist/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.js.map +0 -1
- package/dist/types/src/constants/deviationData.d.ts +0 -887
- package/dist/types/src/constants/deviationData.d.ts.map +0 -1
- package/dist/types/src/constants/treeData.d.ts +0 -732
- package/dist/types/src/constants/treeData.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts +0 -8
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts +0 -9
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineToast.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts +0 -14
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEvent.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts +0 -10
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/CwsEventProvider.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts +0 -30
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/SocketManager.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts +0 -4
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/index.d.ts.map +0 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts +0 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/cws/useCwsEvent.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o}from"react";import{styles as r}from"./IterateComponent.js";function n({onBack:n,onApply:i,historicalClausesData:l=[],isLoadingHistory:a,headerTitle:d="Historical Recommendations",customStyles:s={}}){const c={...r,...s},p=({clause:r})=>{const[n,l]=o(!1),[a,d]=o(!1),[s,p]=o(!1),h=r.title||r.filename,x=r.content||r.excerpt||"",f=((e=0)=>e>=80?{bg:"#dcfce7",text:"#166534",border:"#bbf7d0"}:e>=50?{bg:"#fef9c3",text:"#854d0e",border:"#fef08a"}:{bg:"#fee2e2",text:"#991b1b",border:"#fecaca"})(r.relevance_score),g=x.length>120,u=s&&h;return e("div",{onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{...c.clauseCard,display:"flex",flexDirection:"column",gap:6,textAlign:"left",backgroundColor:a?"#f8fafc":"#fff",borderColor:a?"#cbd5e1":"#dde5f0",transition:"all 0.2s ease"},children:[e("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"8px"},children:[e("div",{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{position:"relative",flex:1,minWidth:0},children:[t("p",{style:{...c.clauseFilename,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:h}),u&&t("div",{style:{position:"absolute",top:"100%",left:0,marginTop:"4px",backgroundColor:"#1E293B",color:"#fff",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:400,zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"normal",wordBreak:"break-word",width:"max-content",maxWidth:"220px",pointerEvents:"none",lineHeight:1.4},children:h})]}),void 0!==r.relevance_score&&e("div",{style:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:12,border:`1px solid ${f.border}`,backgroundColor:f.bg,color:f.text,whiteSpace:"nowrap",flexShrink:0},children:[r.relevance_score,"% Match"]})]}),e("div",{onClick:e=>e.stopPropagation(),style:{...c.clauseExcerpt,margin:0,display:n?"block":"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:n?"unset":3,overflowY:n?"auto":"hidden",overflowX:"hidden",maxHeight:n?"150px":"none",paddingRight:n?"4px":"0px",cursor:"auto"},children:['"',x,'"']}),e("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginTop:"4px"},children:[t("div",{children:g&&t("span",{onClick:e=>l(!n),style:{fontSize:12,color:"#2563EB",fontWeight:500,cursor:"pointer"},children:n?"View Less":"...View More"})}),t("button",{onClick:()=>null==i?void 0:i({type:"history",value:r}),style:{backgroundColor:"#F8FAFC",color:"#0F172A",border:"1px solid #E2E8F0",borderRadius:"6px",padding:"4px 12px",fontSize:"12px",fontWeight:400,cursor:"pointer",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#F1F5F9",e.currentTarget.style.borderColor="#CBD5E1"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#F8FAFC",e.currentTarget.style.borderColor="#E2E8F0"},children:"Proceed"})]})]})};return e("div",{style:c.card,children:[e("div",{style:c.header,children:[t("button",{onClick:n,style:c.backBtn,"aria-label":"Go back",children:"‹"}),t("span",{style:c.headerTitle,children:d})]}),t("div",{style:{...c.body,paddingTop:12,paddingBottom:16},children:e("div",a?{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",color:"#64748B",fontSize:13},children:[t("style",{children:"\n @keyframes iterateSpinner {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "}),t("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"iterateSpinner 1s linear infinite"},children:t("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),"Fetching recommendations..."]}:{style:{display:"flex",flexDirection:"column",gap:10,maxHeight:"40vh",overflowY:"auto",paddingRight:"4px"},children:[null==l?void 0:l.map(e=>t(p,{clause:e},e.id)),(!l||0===l.length)&&t("p",{style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"},children:"No clauses found"})]})})]})}export{n as default};
|
|
2
2
|
//# sourceMappingURL=HistoryMenu.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{UserPen as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{UserPen as n,CheckCircle as l,XCircle as t}from"lucide-react";import{useRequirementAI as o}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{resolveRedline as d}from"../../../../../service/redlineService.js";function a({onClose:a,editorInfo:s,headerText:c,btnsConfig:u,labelText:p,onActionTrigger:v,aiReason:f=null}){var b,g;const{redlineDcoumentId:m,redlineConfig:y,updateRedlineDataParent:h}=o(),I=async e=>{var i,n,l;null==v||v({status:"loading",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}});try{const{updated_reqai:t}=await d({documentId:m,userEmail:null==y?void 0:y.userEmail,userName:null==y?void 0:y.userName,redlineId:null!==(i=null==f?void 0:f.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==y?void 0:y.baseApiUrl,redlineConfigId:null!==(n=null==y?void 0:y.redlineConfigId)&&void 0!==n?n:""},null!==(l=null==y?void 0:y.token)&&void 0!==l?l:"");await(null==h?void 0:h(t)),null==v||v({status:"success",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}})}catch(i){null==v||v({status:"failed",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}})}};return e("div",{style:r.popup,children:[e("div",{style:r.header,children:[i("span",{style:r.title,children:c||"Manually Edited"}),i("button",{onClick:a,style:r.closeButton,"aria-label":"Close",children:"✕"})]}),e("div",{style:r.content,children:[e("div",{style:r.labelRow,children:[i(n,{}),i("span",{style:r.label,children:p||"Edited By"})]}),i("div",{style:r.editorInfo,children:s}),i("div",{style:r.divider}),e("div",{style:r.actions,children:[null==u?void 0:u.map(i=>e("button",{style:{...r.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==f?void 0:f.redline_id,id:null==f?void 0:f.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(b=null==f?void 0:f.redlining_details)||void 0===b?void 0:b.status)||"rejected"===(null===(g=null==f?void 0:f.redlining_details)||void 0===g?void 0:g.status))&&e("div",{style:r.resolveActions,children:[e("button",{style:{...r.actionBtn,...(null==f?void 0:f.resolving)?r.actionBtnDisabled:{}},disabled:null==f?void 0:f.resolving,onClick:()=>I("accept"),children:[i(l,{size:16,color:"#10B981"})," ","Adopt"]}),e("button",{style:{...r.actionBtn,...(null==f?void 0:f.resolving)?r.actionBtnDisabled:{}},onClick:()=>I("reject"),disabled:null==f?void 0:f.resolving,children:[i(t,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})}const r={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};export{a as default};
|
|
2
2
|
//# sourceMappingURL=ManualEditPopup.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{Undo2 as o,Hourglass as n}from"lucide-react";import r,{useState as l}from"react";import a from"./PopupDefaults.js";import{Tooltip as d}from"@mui/material";import{AiReasonMarkdownWrapper as s}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import{DisplayUsers as c,KebabMenu as h}from"./DeviationSummary.js";import{resolveRedline as p}from"../../../../../service/redlineService.js";import{useRequirementAI as u}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import g from"../cws/CwsEvent.js";function f(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const b=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),v=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),m=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),x=({open:t})=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),w=({color:i="#3b82f6"})=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),C=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),B=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function S({title:o,open:n,onToggle:r,children:l}){return t("div",{children:[t("div",{onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:o}),e(x,{open:n})]}),e("div",{style:{maxHeight:n?100:0,opacity:n?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:n&&e(i,{children:l})})]})}function I({icon:e,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:l={}}){const a={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?l:{}};return t("button",{onClick:r?void 0:o,disabled:r,style:a,onMouseEnter:e=>{r||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[e,i]})}function L({steps:i}){if(!(null==i?void 0:i.length))return null;const o=i.length>=3;return e("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:o?"6px 8px":"8px 10px",background:"#F8FAFC",gap:o?4:8,overflow:"hidden"},children:i.map((l,a)=>{const d=(e=>{const t=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return t[e%t.length]})(a),s=a===i.length-1;return t(r.Fragment,{children:[t("span",{title:l.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:o?4:6,overflow:"hidden"},children:[(c=l.status,"approved"===c?t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===c?t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e("circle",{cx:"12",cy:"12",r:"10"}),e("path",{d:"m15 9-6 6"}),e("path",{d:"m9 9 6 6"})]}):e(n,{size:o?14:16,color:"#F59E0B",style:{flexShrink:0}})),e("span",{style:{minWidth:0,color:"#475569",fontSize:o?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label}),l.initials&&e("span",{style:{width:o?20:22,height:o?20:22,minWidth:o?20:22,borderRadius:"50%",background:d.bg,color:d.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:o?9:10,fontWeight:700,lineHeight:1},children:l.initials})]}),!s&&t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"18",height:o?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:o?14:18},children:[e("path",{d:"M5 12h14"}),e("path",{d:"m12 5 7 7-7 7"})]})]},l.id);var c})})})}function T({status:i,onClose:r,impactText:x,secondText:T,actionTakenByName:W,actionTakenAtTime:R="NA",onHistory:j,onIterate:M,onActionTrigger:A,disableAllActions:D=!1,impactTitle:F="Impact",customConfigs:E={},customStyles:z={},secondaryTitle:H,onAssignClick:N,onReviewUsersClick:U,assignedUsers:O,redlineId:P,aiReasonId:$,cognitiveIconSmall:q,cognitiveTootipTitle:V="Cognitive Decisioning",historyIconSmall:_,onHistoryClick:Y,historyTootipTitle:G,onOpenCognitive:J,displayVariant:K="default",reviewTitle:Q,reviewSubtitle:X,reviewStatusIcon:Z=e(n,{size:18}),reviewSteps:ee=[],showReviewProgress:te=!1,showOriginalText:ie=!1,originalText:oe,originalTextHeader:ne="Original text",hideMeta:re=!1}){const[le,ae]=l(!0),[de,se]=l(!0),[ce,he]=l(!1);l(!1);const[pe,ue]=l(!0),ge="review"===K||"review"===i,{redlineDcoumentId:fe,redlineConfig:be,updateRedlineDataParent:ke}=u(),ve={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e(m,{}),StatusIcon:e(b,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e(w,{}),label:"History",onClick:j},{icon:e(o,{size:17}),label:"Revert",useLabel:!0},{icon:e(B,{}),label:"Iterate",onClick:M}],fallbackText:"No original text available"},me={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e(y,{}),StatusIcon:e(k,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e(w,{color:"#3b82f6"}),label:"History",onClick:j},{icon:e(C,{}),label:"Reinstate",useLabel:!0},{icon:e(B,{}),label:"Iterate",onClick:M}],fallbackText:"No rejected recommendation available"},ye={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e(m,{}),StatusIcon:e(o,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e(w,{}),label:"History",onClick:j},{icon:e(B,{}),label:"Iterate",onClick:M}],fallbackText:"No reverted redline available"},xe={headerBg:"#F8FAFC",headerBorder:"#E2E8F0",titleColor:"#1E293B",label:Q||"Redline In Review",metaLabel:"Current Status",UserIcon:e(n,{size:16,color:"#94A3B8"}),StatusIcon:Z,secondTitle:ne,secondBg:"#F8FAFC",secondBorder:"#CBD5E1",impactBox:!0,actions:[{icon:e(w,{}),label:"History",onClick:j},{icon:e(b,{}),label:"Approve",action:"accept",useLabel:!0},{icon:e(k,{}),label:"Reject",action:"reject",useLabel:!0},{icon:e(B,{}),label:"Iterate",onClick:M}],fallbackText:"No original text available"};let we;we=ge?xe:"accepted"===i?ve:"rejected"===i?me:ye;const Ce={...we,...E[i]||{}},Be=ge&&X||H;return t("div",{style:{...a.RedlineCardDefaults.root,animation:ce?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":a.RedlineCardDefaults.root.animation,...z.root},children:[t("div",{style:{...a.RedlineCardDefaults.header,background:Ce.headerBg,borderBottom:`1.5px solid ${Ce.headerBorder}`,...z.header},children:[t("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:Ce.StatusIcon}),t("div",{children:[e("span",{style:{fontSize:15,fontWeight:700,color:Ce.titleColor,letterSpacing:"-0.01em"},children:Ce.label}),e(d,{title:Be,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:Be})})]}),O&&O.length>0&&e(c,{users:O,onClick:e=>{e.stopPropagation(),null==U||U()}})]}),t("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(N||J||Y)&&e(h,{onAssignClick:N,onOpenCognitive:J,cognitiveIconSmall:q,cognitiveTootipTitle:V,historyIconSmall:_,onHistoryClick:Y,historyTootipTitle:G}),e("button",{onClick:()=>{he(!0),r()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e(v,{})})]})]}),ge&&te&&ee.length>0&&e("div",{style:{padding:"10px 14px 0"},children:e(L,{steps:ee})}),t("div",{style:{...a.RedlineCardDefaults.body,...z.body},children:[!ge&&!re&&t("div",{style:{...a.RedlineCardDefaults.meta,...z.meta},children:[t("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[Ce.UserIcon,e("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:Ce.metaLabel})]}),t("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e(d,{title:W,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:W})}),e("span",{children:f(R)})]})]}),!ge&&!re&&e("div",{style:{...a.RedlineCardDefaults.divider,...z.divider}}),e(S,{title:F,open:le,onToggle:()=>ae(e=>!e),children:e("div",{style:{...a.RedlineCardDefaults.impactText,...z.impactText},children:e(s,{message:`${x||""} [View chat](chat_citation$all)`,customStyles:z.impactMarkdown})})}),e("div",{style:{...a.RedlineCardDefaults.divider,...z.divider}}),e(S,{title:ge&&ie?ne:Ce.secondTitle,open:ge&&ie?pe:de,onToggle:()=>{ge&&ie?ue(e=>!e):se(e=>!e)},children:(ge&&ie?oe:T)?e("div",{style:{...a.RedlineCardDefaults.secondSection,background:Ce.secondBg,border:`1.5px solid ${Ce.secondBorder}`,...z.secondSection},children:ge&&ie?oe:T}):t("div",{style:{...a.RedlineCardDefaults.fallbackSectionStyle,...z.fallbackSectionStyle},children:[Ce.fallbackText," "]})}),e("div",{style:{...a.RedlineCardDefaults.actionsContainer,...z.actionsContainer},children:Ce.actions.map(t=>e(I,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i,o,n,r,l;null==A||A({status:"loading",action:e,metadata:{redlineId:P,aiReasonId:$}});try{const{updated_reqai:a}=await p({documentId:fe,userEmail:null==be?void 0:be.userEmail,userName:null==be?void 0:be.userName,redlineId:null!=P?P:"",action:e,baseApiUrl:null==be?void 0:be.baseApiUrl,redlineConfigId:null!==(t=null==be?void 0:be.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==be?void 0:be.token)&&void 0!==i?i:"");await(null==ke?void 0:ke(a)),null===(o=g.emit)||void 0===o||o.call(g,`redline-edit:${fe}:${null===(l=null===(r=null===(n=null==a?void 0:a.artifactData)||void 0===n?void 0:n.userStorySnapshot)||void 0===r?void 0:r[0])||void 0===l?void 0:l.artifactId}`,{updatedBy:null==be?void 0:be.userName}),null==A||A({status:"success",action:e,metadata:{redlineId:P,aiReasonId:$}})}catch(t){null==A||A({status:"failed",action:e,metadata:{redlineId:P,aiReasonId:$}})}})((t.action||t.label).toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...z.actionBtn},disabled:D||t.disabled,disabledStyle:z.actionBtnDisabled},t.label))})]})]})}export{b as ApprovedIcon,x as ChevronIcon,v as CloseIcon,w as HistoryIcon,B as IterateIcon,T as RedlineCard,C as ReinstateIcon,k as RejectedIcon,m as UserApprovedIcon,y as UserRejectedIcon,f as formatDate};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{Undo2 as o,Hourglass as n}from"lucide-react";import r,{useState as l}from"react";import a from"./PopupDefaults.js";import{Tooltip as d}from"@mui/material";import{AiReasonMarkdownWrapper as s}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import{DisplayUsers as c,KebabMenu as h}from"./DeviationSummary.js";import{resolveRedline as p}from"../../../../../service/redlineService.js";import{useRequirementAI as g}from"../../RequirementAIWrapper/RequirementAIWrapper.js";function u(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}const f=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),b=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),k=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),m=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),v=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),e("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),y=({open:t})=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),x=({color:i="#3b82f6"})=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),w=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),C=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function B({title:o,open:n,onToggle:r,children:l}){return t("div",{children:[t("div",{onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:o}),e(y,{open:n})]}),e("div",{style:{maxHeight:n?100:0,opacity:n?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:n&&e(i,{children:l})})]})}function S({icon:e,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:l={}}){const a={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:r?.5:1,...n,...r?l:{}};return t("button",{onClick:r?void 0:o,disabled:r,style:a,onMouseEnter:e=>{r||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[e,i]})}function I({steps:i}){if(!(null==i?void 0:i.length))return null;const o=i.length>=3;return e("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:e("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:o?"6px 8px":"8px 10px",background:"#F8FAFC",gap:o?4:8,overflow:"hidden"},children:i.map((l,a)=>{const d=(e=>{const t=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return t[e%t.length]})(a),s=a===i.length-1;return t(r.Fragment,{children:[t("span",{title:l.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:o?4:6,overflow:"hidden"},children:[(c=l.status,"approved"===c?t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e("polyline",{points:"22 4 12 14.01 9 11.01"})]}):"rejected"===c?t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"16",height:o?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e("circle",{cx:"12",cy:"12",r:"10"}),e("path",{d:"m15 9-6 6"}),e("path",{d:"m9 9 6 6"})]}):e(n,{size:o?14:16,color:"#F59E0B",style:{flexShrink:0}})),e("span",{style:{minWidth:0,color:"#475569",fontSize:o?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label}),l.initials&&e("span",{style:{width:o?20:22,height:o?20:22,minWidth:o?20:22,borderRadius:"50%",background:d.bg,color:d.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:o?9:10,fontWeight:700,lineHeight:1},children:l.initials})]}),!s&&t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o?"14":"18",height:o?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:o?14:18},children:[e("path",{d:"M5 12h14"}),e("path",{d:"m12 5 7 7-7 7"})]})]},l.id);var c})})})}function L({status:i,onClose:r,impactText:y,secondText:L,actionTakenByName:T,actionTakenAtTime:W="NA",onHistory:R,onIterate:j,onActionTrigger:M,disableAllActions:A=!1,impactTitle:D="Impact",customConfigs:F={},customStyles:E={},secondaryTitle:z,onAssignClick:H,onReviewUsersClick:N,assignedUsers:U,redlineId:O,aiReasonId:P,cognitiveIconSmall:$,cognitiveTootipTitle:q="Cognitive Decisioning",historyIconSmall:V,onHistoryClick:_,historyTootipTitle:Y,onOpenCognitive:G,displayVariant:J="default",reviewTitle:K,reviewSubtitle:Q,reviewStatusIcon:X=e(n,{size:18}),reviewSteps:Z=[],showReviewProgress:ee=!1,showOriginalText:te=!1,originalText:ie,originalTextHeader:oe="Original text",hideMeta:ne=!1}){const[re,le]=l(!0),[ae,de]=l(!0),[se,ce]=l(!1);l(!1);const[he,pe]=l(!0),ge="review"===J||"review"===i,{redlineDcoumentId:ue,redlineConfig:fe,updateRedlineDataParent:be}=g(),ke={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e(m,{}),StatusIcon:e(f,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e(x,{}),label:"History",onClick:R},{icon:e(o,{size:17}),label:"Revert",useLabel:!0},{icon:e(C,{}),label:"Iterate",onClick:j}],fallbackText:"No original text available"},me={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e(v,{}),StatusIcon:e(b,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e(x,{color:"#3b82f6"}),label:"History",onClick:R},{icon:e(w,{}),label:"Reinstate",useLabel:!0},{icon:e(C,{}),label:"Iterate",onClick:j}],fallbackText:"No rejected recommendation available"},ve={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e(m,{}),StatusIcon:e(o,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e(x,{}),label:"History",onClick:R},{icon:e(C,{}),label:"Iterate",onClick:j}],fallbackText:"No reverted redline available"},ye={headerBg:"#F8FAFC",headerBorder:"#E2E8F0",titleColor:"#1E293B",label:K||"Redline In Review",metaLabel:"Current Status",UserIcon:e(n,{size:16,color:"#94A3B8"}),StatusIcon:X,secondTitle:oe,secondBg:"#F8FAFC",secondBorder:"#CBD5E1",impactBox:!0,actions:[{icon:e(x,{}),label:"History",onClick:R},{icon:e(f,{}),label:"Approve",action:"accept",useLabel:!0},{icon:e(b,{}),label:"Reject",action:"reject",useLabel:!0},{icon:e(C,{}),label:"Iterate",onClick:j}],fallbackText:"No original text available"};let xe;xe=ge?ye:"accepted"===i?ke:"rejected"===i?me:ve;const we={...xe,...F[i]||{}},Ce=ge&&Q||z;return t("div",{style:{...a.RedlineCardDefaults.root,animation:se?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":a.RedlineCardDefaults.root.animation,...E.root},children:[t("div",{style:{...a.RedlineCardDefaults.header,background:we.headerBg,borderBottom:`1.5px solid ${we.headerBorder}`,...E.header},children:[t("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:we.StatusIcon}),t("div",{children:[e("span",{style:{fontSize:15,fontWeight:700,color:we.titleColor,letterSpacing:"-0.01em"},children:we.label}),e(d,{title:Ce,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:Ce})})]}),U&&U.length>0&&e(c,{users:U,onClick:e=>{e.stopPropagation(),null==N||N()}})]}),t("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(H||G||_)&&e(h,{onAssignClick:H,onOpenCognitive:G,cognitiveIconSmall:$,cognitiveTootipTitle:q,historyIconSmall:V,onHistoryClick:_,historyTootipTitle:Y}),e("button",{onClick:()=>{ce(!0),r()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e(k,{})})]})]}),ge&&ee&&Z.length>0&&e("div",{style:{padding:"10px 14px 0"},children:e(I,{steps:Z})}),t("div",{style:{...a.RedlineCardDefaults.body,...E.body},children:[!ge&&!ne&&t("div",{style:{...a.RedlineCardDefaults.meta,...E.meta},children:[t("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[we.UserIcon,e("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:we.metaLabel})]}),t("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e(d,{title:T,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:T})}),e("span",{children:u(W)})]})]}),!ge&&!ne&&e("div",{style:{...a.RedlineCardDefaults.divider,...E.divider}}),e(B,{title:D,open:re,onToggle:()=>le(e=>!e),children:e("div",{style:{...a.RedlineCardDefaults.impactText,...E.impactText},children:e(s,{message:`${y||""} [View chat](chat_citation$all)`,customStyles:E.impactMarkdown})})}),e("div",{style:{...a.RedlineCardDefaults.divider,...E.divider}}),e(B,{title:ge&&te?oe:we.secondTitle,open:ge&&te?he:ae,onToggle:()=>{ge&&te?pe(e=>!e):de(e=>!e)},children:(ge&&te?ie:L)?e("div",{style:{...a.RedlineCardDefaults.secondSection,background:we.secondBg,border:`1.5px solid ${we.secondBorder}`,...E.secondSection},children:ge&&te?ie:L}):t("div",{style:{...a.RedlineCardDefaults.fallbackSectionStyle,...E.fallbackSectionStyle},children:[we.fallbackText," "]})}),e("div",{style:{...a.RedlineCardDefaults.actionsContainer,...E.actionsContainer},children:we.actions.map(t=>e(S,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==M||M({status:"loading",action:e,metadata:{redlineId:O,aiReasonId:P}});try{const{updated_reqai:o}=await p({documentId:ue,userEmail:null==fe?void 0:fe.userEmail,userName:null==fe?void 0:fe.userName,redlineId:null!=O?O:"",action:e,baseApiUrl:null==fe?void 0:fe.baseApiUrl,redlineConfigId:null!==(t=null==fe?void 0:fe.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==fe?void 0:fe.token)&&void 0!==i?i:"");await(null==be?void 0:be(o)),null==M||M({status:"success",action:e,metadata:{redlineId:O,aiReasonId:P}})}catch(t){null==M||M({status:"failed",action:e,metadata:{redlineId:O,aiReasonId:P}})}})((t.action||t.label).toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...E.actionBtn},disabled:A||t.disabled,disabledStyle:E.actionBtnDisabled},t.label))})]})]})}export{f as ApprovedIcon,y as ChevronIcon,k as CloseIcon,x as HistoryIcon,C as IterateIcon,L as RedlineCard,w as ReinstateIcon,b as RejectedIcon,m as UserApprovedIcon,v as UserRejectedIcon,u as formatDate};
|
|
2
2
|
//# sourceMappingURL=RedlineStatusCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as i}from"react";import{ChevronUp as a,ChevronDown as s,Users as r,ExternalLink as d,Download as u,Share2 as c,Copy as v,LoaderCircle as p,PencilIcon as m,RefreshCw as h,Plus as y,Trash2 as g,X as f,Ellipsis as C,Hourglass as S,Check as I,ChevronUpIcon as b,ChevronDownIcon as w,Info as N,Bookmark as E}from"lucide-react";import D from"showdown";import{Tooltip as B,Menu as A,MenuItem as T}from"@mui/material";import x from"../../icons/Illustration.svg.js";import{v4 as U}from"uuid";import k from"./UserStoryCard.module.css.js";import{formatMarkdown as P,indentMarkdown as R}from"../../utils/helpers.js";import{replaceTitleSection as _,postprocessUserStoryAfterEdit as M}from"../../utils/user-story.utils.js";import W from"../../shared/AtomicButton.js";import L from"../RichTextEditor/RichTextEditor.js";import j from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as $,useRequirementAI as O,ToasterId as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as V}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as G}from"./TitleEditor/TitleEditor.js";import{fetchRedlineDocumentSection as F,updateRedlineDocument as H,getRedlineDocumentId as q,createRedlineDocument as Y}from"../../../../service/redlineService.js";import Q from"./ClinicalTrialSection.js";import{CompletionPanel as Z}from"../story-screen/CompletionPanel.js";import J from"../../icons/CDIcon.js";import K from"./cws/CwsEvent.js";import X from"./cws/useCwsEvent.js";import ee from"react-hot-toast";import te from"./Popups/RedlineToast.js";const le={[$.WAITING]:"WAITING TO GENERATE",[$.IN_PROGRESS]:"IN PROGRESS",[$.GENERATED]:"GENERATED",[$.FAILED]:"FAILED",[$.GENERATE]:"GENERATE",[$.APPROVED]:"APPROVED"};function ne(e){const l=[],n=/<learned>(.*?)<\/learned>/g;let o,i=0,a=0;for(;null!==(o=n.exec(e));){const[,s]=o,r=o.index;r>i&&l.push(t("span",{children:e.slice(i,r)},"text-pre-"+a++)),l.push(t(B,{title:s,placement:"top",children:t(N,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${U()}`)),i=n.lastIndex}return i<(null==e?void 0:e.length)&&l.push(t("span",{children:e.slice(i)},"text-post-"+a++)),l}function oe(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const ie=({displayName:l})=>{var n;const{customStyles:o}=O(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e("div",{className:k.displayName,style:null==i?void 0:i.wrapper,children:[t(E,{className:k.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[l,":"]})]})},ae=({isUserStoryCurrentlyUpdated:b,artifactId:w,artifactTitleId:N,parentUserStory:E,currentUserStory:q,onUserStoryChange:Y,parentIndex:se,currentIndex:re,enableDownload:de,isDiffEditReviewMode:ue,showUserStoryDiff:ce,handleDownloadUserStory:ve,handleOpenSendDialog:pe,updateUserStoryArtifact:me,selectedArtifactId:he,isDisplayHighlightControl:ye,elementDisplayConfig:ge,_resolvedConfig:fe,showWrapper:Ce=!1,defaultExpanded:Se,actionItemsConfig:Ie,onDelete:be,contextVariant:we,expandedSubFeatures:Ne,showDisplayName:Ee=!0,allowTitleEdit:De=!0,showConfidenceScore:Be=!0,showBorderTop:Ae=!0,sectionStatusConfig:Te,showCompletionPanel:xe=!1,completionPanelConfig:Ue,showAddSectionButton:ke=!1,disableEditPlan:Pe=!1,useMuiTooltip:Re=!1,approveButtonConfig:_e,editButtonConfig:Me,CDNeededInChip:We,blockNumber:Le,showWaitingIconInChip:je,showAssignSection:$e=!1,disableAssignSection:Oe=!1,onAssignSectionClick:ze})=>{var Ve,Ge,Fe,He,qe,Ye,Qe,Ze,Je,Ke,Xe,et,tt,lt,nt,ot,it,at,st,rt,dt,ut,ct,vt;const{isLoadingSectionData:pt=!1,onLoadSectionData:mt,status:ht,onStatusClick:yt,completedCount:gt,totalCount:ft,isNoDataAvailable:Ct=!1}=null!=Te?Te:{},{searchQueryList:St,citations:It,customStyles:bt,onEditBlocked:wt,redlineDcoumentId:Nt,redlineConfig:Et,customSectionConfig:Dt,updateRedlineDataParent:Bt,aiReasoning:At,redlineCollaborativeConfig:Tt}=O(),xt=null==bt?void 0:bt.userStoryCardStyles,Ut=null==xt?void 0:xt.customSectionEditButton,kt=null==xt?void 0:xt.statusStyles,Pt=null===(Ve=null==bt?void 0:bt.userStoryCardStyles)||void 0===Ve?void 0:Ve.userStoryEditStyles,Rt=null===(Ge=null==bt?void 0:bt.userStoryScreenStyles)||void 0===Ge?void 0:Ge.userStoryContentStyles,_t=null==xt?void 0:xt.progressHeaderStyles,Mt=null==xt?void 0:xt.clinicalTrialSectionStyles,Wt=null==xt?void 0:xt.CompletionStyles,Lt=null==xt?void 0:xt.noDataStyles,jt=null==xt?void 0:xt.approveButtonStyles,$t=null!==(He=null===(Fe=null==Dt?void 0:Dt.shouldRender)||void 0===Fe?void 0:Fe.call(Dt,q))&&void 0!==He&&He,Ot=null===(qe=null==Dt?void 0:Dt.getValue)||void 0===qe?void 0:qe.call(Dt,q),zt=null!==(Qe=null===(Ye=null==Dt?void 0:Dt.getFields)||void 0===Ye?void 0:Ye.call(Dt,q))&&void 0!==Qe?Qe:[],Vt=null!==(Ze=null==Dt?void 0:Dt.isEditDisabled)&&void 0!==Ze&&Ze,Gt=null!==(Ke=null===(Je=null==Dt?void 0:Dt.isSaving)||void 0===Je?void 0:Je.call(Dt,q))&&void 0!==Ke&&Ke,Ft=((e,t)=>e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion)(null!==(Xe=q.completion_percentage)&&void 0!==Xe?Xe:0,Wt),Ht={[$.WAITING]:null==kt?void 0:kt.waiting,[$.IN_PROGRESS]:null==kt?void 0:kt.inProgress,[$.GENERATED]:null==kt?void 0:kt.generated,[$.FAILED]:null==kt?void 0:kt.failed,[$.GENERATE]:null==kt?void 0:kt.generate,[$.APPROVED]:null==kt?void 0:kt.approved},[qt,Yt]=n({...structuredClone(q),value:P(q.value)||""}),[Qt,Zt]=n({userStory:!!q.isDefaultEdit}),[Jt,Kt]=n(!1),[Xt,el]=n(!1),[tl,ll]=n(null),[nl,ol]=n(null),{userStory:il,customIcons:al}=O(),[sl,rl]=n(null!=Se?Se:""===se||he===q.artifactId||!!q.isDefaultOpen),[dl,ul]=n(!1),[cl,vl]=n(null),[pl,ml]=n(null),[hl,yl]=n(!1),gl=o(null),fl=o(null),[Cl,Sl]=n(!1),[Il,bl]=n(!1),wl=o(null),[Nl,El]=n(!1),[Dl,Bl]=n(q.value);i(()=>{b&&rl(b)},[b]),i(()=>{Yt({...structuredClone(q),value:P(q.value)||""})},[q]),i(()=>{St.length>0?rl(!0):void 0===Se&&he&&rl(he===q.artifactId)},[St,he,q.artifactId]),i(()=>{Ne&&Ne.length>0&&rl(Ne.includes(q.artifactId)||""===se||he===q.artifactId||!!q.isDefaultOpen)},[Ne]);const Al=()=>{vl(null)},Tl=()=>{ml(null)},xl=()=>{sl&&Qt.userStory&&fl.current&&!fl.current.requestClose()||rl(e=>!e)},Ul=async()=>{var e,t;try{"userStory"==="userStory"&&(Y(qt),console.log("I am changing RTE editor values",qt)),await(null===(e=null==Me?void 0:Me.onSaveEditedSection)||void 0===e?void 0:e.call(Me,qt)),await me(It,il,w,null===(t=wl.current)||void 0===t?void 0:t.signal)}finally{}};const kl=null!=(null==q?void 0:q.big_enough)&&!Number.isNaN(q.big_enough)&&!!(null==q?void 0:q.big_enough_decision_factors),Pl=null!==(et=null==q?void 0:q.completion_percentage)&&void 0!==et?et:0,Rl=!!(null==q?void 0:q.completion_decision_factors),_l=""===se,Ml=null!=fe?fe:oe(ge,_l),Wl=!ue&&!ce;i(()=>{if(!nl)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${nl}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[nl]);const[Ll,jl]=n(0),[$l,Ol]=n(!1),zl=async()=>{var e,t;let l=!0;if(Ol(e=>(l=!e,!0)),l){let l;jl(e=>(l=e,e));try{const{updated_reqai:n}=await F({documentId:Nt,sectionId:q.artifactId,baseApiUrl:null==Et?void 0:Et.baseApiUrl,redlineConfigId:null!==(e=null==Et?void 0:Et.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Et?void 0:Et.token)&&void 0!==t?t:"");await(null==Bt?void 0:Bt(n)),jl(e=>l===e?0:1)}catch(e){}Ol(!1)}};i(()=>{q.isDefaultEdit&&Zt(e=>({...e,userStory:!0}))},[q.isDefaultEdit]),console.log("block number in userstory card ",Le),console.log("[TESTING-CURRENT-USER-STORY] \n",q,"\n[TESTING-USER-STORY] \n",il),X(`redline-edit:${Nt}:${q.artifactId}`,async({updatedBy:l})=>{var n;null===(n=wl.current)||void 0===n||n.abort(),jl(e=>e+1),Zt(n=>n.userStory?(ee.custom(n=>e(te,{onCancel:()=>ee.dismiss(n.id),onRefresh:()=>{ee.dismiss(n.id),zl()},children:["This ",t("span",{style:{fontWeight:600},children:q.title})," section has been updated by ",t("span",{style:{fontWeight:600},children:l})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:z}),{...il,userStory:!1}):(zl().then(()=>{ee.custom(n=>e(te,{onCancel:()=>ee.dismiss(n.id),children:[t("span",{style:{fontWeight:600},children:q.title})," updated,",t("br",{}),l," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:z})}),n))});return i(()=>Bl(q.value),[q.value]),e("div",{className:k.card,"data-block-id":"user-story-card-wrapper-"+Le,style:null==xt?void 0:xt.cardStyle,id:`story-card-${q.title}`,"data-expanded":sl,children:[e("div",{className:k.titleSection,style:null==xt?void 0:xt.titleSection,children:[e("div",{className:k.titleRow,style:null==xt?void 0:xt.titleRow,onClick:xl,children:[e("div",{className:k.titleLeft,style:null==xt?void 0:xt.titleLeft,onMouseEnter:()=>Sl(!0),onMouseLeave:()=>Sl(!1),children:[Ee&&t(ie,{displayName:N}),Jt&&Wl?t(G,{title:q.title,onSave:e=>(async(e,t)=>{var l;try{let n={...q};q.artifactId===t?n.title=e:n.sub_features=(null===(l=q.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],Yt(n),Y(n),Kt(!1)}catch(e){console.error("Failed to save title",e)}})(e,q.artifactId),onCancel:()=>{Kt(!1)},inputStyle:null==Pt?void 0:Pt.inlineTitleInput,confirmButtonStyle:null==Pt?void 0:Pt.inlineTitleConfirm,cancelButtonStyle:null==Pt?void 0:Pt.inlineTitleCancel},"inline-title-editor"):e("div",{className:k.storyTitleWrapper,children:[t(B,{title:ne(q.title),arrow:!0,children:t("h2",{title:Re?void 0:q.title,className:k.storyTitle,style:null==xt?void 0:xt.storyTitle,children:ne(q.title)},q.artifactId)}),xe&&(Rl?t(Z,{customIcons:null==al?void 0:al.userStoryIcons,customStyles:null==xt?void 0:xt.aiReasoningCitaionStyles,currentUserStory:q,panelStyles:null==xt?void 0:xt.CompletionStyles,onToggleStateChange:bl,completionPanelConfig:Ue,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Wt?void 0:Wt.badge,...Ft},children:[e("span",{children:[Pl,"% Completed"]}),t("span",{style:{display:"flex",alignItems:"center"},children:t(J,{color:"currentColor"})}),t(Il?a:s,{size:14,style:null==Wt?void 0:Wt.chevronStyle})]})}):t("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Wt?void 0:Wt.badge,...Ft},children:e("span",{children:[Pl,"% Completed"]})})),De&&t("button",{type:"button",className:k.titleEditButton,style:null==Pt?void 0:Pt.titleEditButton,onClick:e=>{e.stopPropagation(),Kt(!0),sl||rl(!0)},"aria-label":"Edit title",title:"Edit title",children:t("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),(ht||void 0!==gt&&void 0!==ft)&&e("div",{className:k.statusContainer,children:[void 0!==gt&&void 0!==ft&&e("div",{className:k.completedBadge,children:["Completed: ",gt,"/",ft]}),ht&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==yt||yt()},onMouseEnter:()=>El(!0),onMouseLeave:()=>El(!1),className:k.statusButton,style:{...null===(tt=Ht[ht])||void 0===tt?void 0:tt.default,...Nl&&(null===(lt=Ht[ht])||void 0===lt?void 0:lt.hover)},children:le[ht]})]}),e("div",{className:k.titleActions,style:null==xt?void 0:xt.titleActions,onClick:e=>e.stopPropagation(),children:[(Ml.showProgressPercentage||Ml.showGapBox)&&Ce&&e("div",{className:k.progressHeader,style:null==_t?void 0:_t.wrapper,children:[Ml.showProgressPercentage&&e("div",{className:k.progressPercentage,style:null==_t?void 0:_t.percentage,children:[null!==(ot=null!==(nt=null==q?void 0:q.confidenceScore)&&void 0!==nt?nt:null==Ml?void 0:Ml.confidenceValue)&&void 0!==ot?ot:"0","%"]}),Ml.showGapBox&&e("div",{className:k.gapBox,style:null==_t?void 0:_t.gapBox,children:[null!==(at=null!==(it=null==q?void 0:q.gapValue)&&void 0!==it?it:null==Ml?void 0:Ml.gapBoxValue)&&void 0!==at?at:"2"," ","Gaps"]})]}),kl&&t(V,{customIcons:null==al?void 0:al.userStoryIcons,customStyles:null==xt?void 0:xt.aiReasoningCitaionStyles,currentUserStory:q,panelStyles:null==xt?void 0:xt.BigEnoughStyles}),$e&&t("button",{type:"button",className:k.iconButton,style:null==xt?void 0:xt.iconButton,disabled:Oe,onClick:e=>{e.stopPropagation(),null==ze||ze(q)},"aria-label":"Assign section users",title:"Assign section users",children:t(r,{size:16})}),!Qt.userStory&&e(l,{children:[!1!==(null==Ml?void 0:Ml.showShareButton)&&t("button",{className:k.iconButton,style:null==xt?void 0:xt.iconButton,onClick:e=>{vl(e.currentTarget)},children:t(d,{size:16})}),e(A,{id:"user-story-share-menu",anchorEl:cl,open:!!cl,onClose:()=>vl(null),style:null==xt?void 0:xt.userStoryShareMenu,children:[de&&t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{ul(!0),ve&&(await Promise.all([ve("pdf"),ve("doc")]),ul(!1))},children:e("div",{ref:gl,className:k.menuItemContent,style:null==xt?void 0:xt.menuItemContent,children:[t(u,{size:16,color:null==xt?void 0:xt.menuIconColor}),t("p",{style:null==xt?void 0:xt.menuLabel,children:"Download"})]})}),t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{let e=q;E&&(e={...q,value:`${_(null==E?void 0:E.value,q.title)} \n${q.value}`}),null==pe||pe(!0,[e],q.artifactId),Al()},children:e("div",{style:null==xt?void 0:xt.menuItemContent,className:k.menuItemContentPadded,children:[t(c,{size:16,color:null==xt?void 0:xt.menuIconColor}),t("p",{style:null==xt?void 0:xt.menuLabel,children:"Send"})]})}),t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:async()=>{const e=(new D.Converter).makeHtml(P(q.value)||q.value),t=function(e){const t=(new D.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(P(q.value)||q.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Al()}},children:e("div",{style:null==xt?void 0:xt.menuItemContent,className:k.menuItemContentPadded,children:[t(v,{size:16,color:null==xt?void 0:xt.menuIconColor}),t("p",{style:null==xt?void 0:xt.menuLabel,children:"Copy"})]})})]})]}),!hl&&Qt.userStory&&sl?t(W,{type:"outline",children:"Cancel",style:null==xt?void 0:xt.cancelButton,onClick:()=>{var e;null===(e=wl.current)||void 0===e||e.abort(),Zt(e=>({...e,userStory:!1}))}}):t(l,{}),Qt.userStory&&sl?t(W,{type:"fill",children:hl?e("span",{className:k.savingSpinner,style:null==xt?void 0:xt.savingSpinner,children:[t(p,{className:k.spinAnimation,style:null==xt?void 0:xt.spinAnimation}),t("span",{children:"Saving..."})]}):"Save",isDisable:hl,style:hl?null==xt?void 0:xt.savingButton:null==xt?void 0:xt.saveButton,onClick:async()=>{yl(!0),await Ul();let e=await(async()=>{var e,t,l,n,o,i,a,s;let r=qt.value;console.log("[V] valueToUpdate before",r),r=r.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",r);try{if(null==Et?void 0:Et.callUpdateDocument){const{updated_reqai:d}=await H({documentId:Nt,sectionId:q.artifactId,baseApiUrl:null==Et?void 0:Et.baseApiUrl,updatedContent:r,userEmail:Et.userEmail,userName:Et.userName,redlineConfigId:null!==(e=Et.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Et?void 0:Et.token)&&void 0!==t?t:"");r=null===(o=null===(n=null===(l=null==d?void 0:d.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==Bt?void 0:Bt(d)),K.emit(`redline-edit:${Nt}:${null===(s=null===(a=null===(i=null==d?void 0:d.artifactData)||void 0===i?void 0:i.userStorySnapshot)||void 0===a?void 0:a[0])||void 0===s?void 0:s.artifactId}`,{updatedBy:null==Et?void 0:Et.userName})}}catch(e){console.error("failed to update redline document",e),r=Dl}return r=r.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),r})();const t={...qt,value:e};Y({...t,isDefaultEdit:!1}),Bl(t.value),Zt(e=>({...e,userStory:!1})),yl(!1)}}):!Ll&&!ue&&!ce&&!Pe&&sl&&!1!==(null==Ml?void 0:Ml.showEditButton)&&t("button",{className:k.iconButton,style:null==xt?void 0:xt.editButton,onClick:()=>Zt(e=>({...e,userStory:!0})),children:t(m,{color:null==xt?void 0:xt.pencilIconColor,size:16})}),(null==Tt?void 0:Tt.initiateCollaborativeFlow)&&!!Ll&&t(B,{title:"Fetch latest section",children:t(h,{color:$l?"#d3d3d3":"black",onClick:zl})}),ke&&_l&&sl&&!ue&&!ce&&!1!==(null==Ml?void 0:Ml.showEditButton)&&e("button",{type:"button",className:k.addSectionButton,style:null==Pt?void 0:Pt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=q.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:U(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...q,sub_features:[...null!==(n=q.sub_features)&&void 0!==n?n:[],i]};Yt(a),Y(a),rl(!0),ol(i.title)},"aria-label":"Add section",title:"Add section",children:[t(y,{size:14}),t("span",{className:k.addSectionLabel,children:"Add Section"})]}),!_l&&!ue&&!Pe&&!ce&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==be||be()},className:k.iconButton,style:null==Pt?void 0:Pt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:t(g,{size:16})}),$t&&t("button",{type:"button",className:k.iconButton,style:null==Ut?void 0:Ut.button,disabled:Vt,onClick:e=>{if(e.stopPropagation(),Xt)return ll(null),void el(!1);ll(structuredClone(null!=Ot?Ot:{})),rl(!0),el(!0)},children:Xt?t(f,{size:16,color:null==xt?void 0:xt.pencilIconColor,style:null==Ut?void 0:Ut.cancelIcon}):t(m,{size:16,color:null==xt?void 0:xt.pencilIconColor,style:null==Ut?void 0:Ut.editIcon})}),(null==Ml?void 0:Ml.actionItemsButton)&&e(l,{children:[t("span",{className:k.actionItemBtn,style:null==xt?void 0:xt.actionItemBtn,onClick:e=>{e.stopPropagation(),ml(e.currentTarget)},children:t(C,{})}),t(A,{id:"user-story-action-menu",anchorEl:pl,open:!!pl,onClose:Tl,style:null==xt?void 0:xt.userStoryShareMenu,children:null==Ie?void 0:Ie.items.map((l,n)=>t(T,{style:null==xt?void 0:xt.userStoryMenuItem,onClick:()=>{l.onclick(q),Tl()},children:e("div",{className:k.menuItemContent,style:{...null==xt?void 0:xt.menuItemContent,...!l.isActive&&{cursor:"not-allowed",opacity:.5}},children:[t("span",{className:k.menuItemIcon,style:null==xt?void 0:xt.menuItemIcon,children:l.icon}),t("p",{style:null==xt?void 0:xt.menuLabel,children:l.name}),t("span",{className:k.menuItemRight,style:null==xt?void 0:xt.menuItemRight})]})},`action-item-${n}-${l.name}`))})]}),t("button",{type:"button",onClick:e=>{e.stopPropagation(),xl()},style:null==xt?void 0:xt.chevronButton,className:k.chevronButton,children:t(sl?a:s,{className:k.chevronIcon,color:null==xt?void 0:xt.chevronIconColor})})]})]}),t("div",{className:k.divider,style:null==xt?void 0:xt.dividerStyle})]}),sl&&t("div",{className:k.cardContent,style:{...null==xt?void 0:xt.cardContentStyle,borderTop:Ae?"1px solid #E5E5E5":"none"},children:e("div",pt?{className:k.loadingContainer,children:[t("div",{className:k.loadingIconWrapper,children:t(S,{size:28,color:"#5B3DF5",className:k.spinAnimation})}),e("div",{children:[t("h3",{className:k.loadingTitle,children:"Section generation in progress.."}),t("p",{className:k.loadingSubtitle,children:"This may take a few minutes"})]}),t("button",{type:"button",onClick:()=>null==mt?void 0:mt(),className:k.viewStatusButton,children:"View Status"})]}:Ct?{className:k.noDataContainer,style:null==Lt?void 0:Lt.container,children:[t("img",{src:x,alt:"No data available",className:k.noDataIllustration,style:null==Lt?void 0:Lt.illustration}),t("h3",{className:k.noDataTitle,style:null==Lt?void 0:Lt.title,children:"No Data Available for This Section"}),t("p",{className:k.noDataSubtitle,style:null==Lt?void 0:Lt.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}:{className:k.contentInner,style:null==xt?void 0:xt.contentInner,children:[e("div",{className:k.descriptionSection,style:null==xt?void 0:xt.descriptionSection,children:[t("div",{className:k.justifyBetween,style:null==xt?void 0:xt.justifyBetween}),Qt.userStory?t(L,{ref:fl,minHeight:"100%",height:"100%",type:"string",value:P(Dl)||"",handleUpdateState:(e,t)=>{const l=M(R(t));Yt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:Qt.userStory?"edit":"readOnly",onEditBlocked:wt,onSaveUnsavedChanges:async()=>{await Ul(),rl(!1)},onDiscardUnsavedChanges:()=>{Yt({...structuredClone(q),value:P(q.value)||""}),Zt(e=>({...e,userStory:!1})),rl(!1)},isSavingUnsavedChanges:hl}):$t?t(Q,{styles:Mt,fields:zt,readonly:!Xt,isSaving:Gt,value:null!==(st=null!=tl?tl:Ot)&&void 0!==st?st:{},onChange:ll,onSave:async()=>{var e;tl&&(await(null===(e=null==Dt?void 0:Dt.onSave)||void 0===e?void 0:e.call(Dt,q,tl)),ll(null),el(!1))},onCancel:()=>{ll(null),el(!1)}}):e(l,{children:[t(j,{showUserStoryDiff:ce,isParent:""===se,message:P(q.value)||"",artifactId:q.artifactId,customStyles:Rt,isDisplayHighlightControl:ye,contextVariant:we,showConfidenceScore:Be,CDNeededInChip:We,blockId:Le,showWaitingIconInChip:je}),(_e||Me)&&e("div",{className:k.actionButtonsContainer,style:null==jt?void 0:jt.container,children:[Me&&!Qt.userStory&&e(l,{children:[t("button",{type:"button",className:k.actionButton,style:null==jt?void 0:jt.button,disabled:Me.disabled||Me.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Me.onClick)||void 0===t||t.call(Me),Zt(e=>({...e,userStory:!0})),rl(!0)},children:Me.isLoading?e(l,{children:[t(p,{size:16,className:k.actionButtonSpinner,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(rt=Me.label)&&void 0!==rt?rt:"Edit"})]}):e(l,{children:[t(m,{size:16,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(dt=Me.label)&&void 0!==dt?dt:"Edit"})]})}),_e&&t("span",{className:k.actionButtonDivider})]}),_e&&t("button",{type:"button",className:k.actionButton,style:null==jt?void 0:jt.button,disabled:_e.disabled||_e.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=_e.onClick)||void 0===t||t.call(_e)},children:_e.isLoading?e(l,{children:[t(p,{size:16,className:k.actionButtonSpinner,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(ut=_e.label)&&void 0!==ut?ut:"Approve"})]}):e(l,{children:[t(I,{size:16,style:null==jt?void 0:jt.icon}),t("span",{style:null==jt?void 0:jt.text,children:null!==(ct=_e.label)&&void 0!==ct?ct:"Approve"})]})})]})]})]}),null===(vt=qt.sub_features)||void 0===vt?void 0:vt.map((e,l)=>{console.log("UserStoryCardWrapper: sub",e);const n=oe(ge,!1,e.artifactId);return t(ae,{artifactId:w,isUserStoryCurrentlyUpdated:b,artifactTitleId:`${N}-${String.fromCharCode(65+l)}`,parentUserStory:q,parentIndex:`${se}${se&&"."}${re}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...q.sub_features||[]];l[e]=t,Y({...q,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:ue,showUserStoryDiff:ce,updateUserStoryArtifact:me,handleDownloadUserStory:ve,handleOpenSendDialog:pe,isDisplayHighlightControl:ye,elementDisplayConfig:ge,_resolvedConfig:n,actionItemsConfig:Ie,onDelete:()=>(e=>{const t=(q.sub_features||[]).filter((t,l)=>l!==e),l={...q,sub_features:t};Yt(l),Y(l)})(l),expandedSubFeatures:Ne,disableEditPlan:Pe,useMuiTooltip:Re,blockNumber:e.blockNumber,showAssignSection:$e,onAssignSectionClick:ze},e.artifactId)})]})})]})},se=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:h,showWrapper:y,actionItemsConfig:g,contextVariant:f,showDisplayName:C,allowTitleEdit:S,showConfidenceScore:I,showBorderTop:N,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:x=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,showWaitingIconInChip:_,setRedlineDocumentIdParent:M,showAssignSection:W,onAssignSectionClick:L,disableAssignSection:j})=>{const{userStory:$,setUserStory:z,customStyles:V,searchQueryList:G,currentHighlightIndex:F,setCurrentHighlightIndex:H,segmentComponentConfig:Q,sectionStatusConfig:Z,redlineConfig:J,setRedlineDocumentId:K}=O(),X=null==V?void 0:V.userStoryCardStyles,ee=0===F,te=F===G.length-1;return i(()=>{if(!(null==J?void 0:J.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await q({baseApiUrl:J.documentBaseApiUrl||"",comparisonId:J.documentComparisonId||""});if(t)K(t);else{const{document_id:t}=await Y({baseApiUrl:J.baseApiUrl,changelogConfigId:J.changelogConfigId,comparisonId:J.documentComparisonId,artifactId:J.artifactId,inputData:J.inputData,redlineConfigId:J.redlineConfigId,userEmail:J.userEmail,userName:J.userName},null!==(e=null==J?void 0:J.token)&&void 0!==e?e:"");t&&(K(t),null==M||M(t))}})()},[]),e("div",{className:k.userStoryCardWrapper,style:m?{...null==X?void 0:X.userStoryCardWrapper,position:"relative"}:null==X?void 0:X.userStoryCardWrapper,children:[m&&t(l,{children:G.length>0&&t("div",{className:k.wrapper,children:t("div",{className:k.highlightNavigation,children:e("div",{className:k.navigationContainer,children:[e("span",{className:k.navCounter,children:[F+1," of ",G.length]}),e("div",{className:k.navButtons,children:[t("button",{onClick:()=>{F>0&&H(e=>e-1)},className:k.navButton,disabled:ee,children:t(b,{size:20,className:k.navIcon})}),t("button",{onClick:()=>{F<G.length-1&&H(e=>e+1)},className:k.navButton,disabled:te,children:t(w,{size:20,className:k.navIcon})})]})]})})})}),$.map((e,l)=>{console.log("UserStoryCardWrapper: userstory",e);const i=oe(h,!0);return t(ae,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:e,onUserStoryChange:e=>{z(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:h,_resolvedConfig:i,showWrapper:y,defaultExpanded:E,actionItemsConfig:g,contextVariant:f,showDisplayName:C,allowTitleEdit:S,showConfidenceScore:I,showBorderTop:N,sectionStatusConfig:Z,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:x,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,showWaitingIconInChip:_,showAssignSection:W,disableAssignSection:j,onAssignSectionClick:L},e.artifactId)})]})};export{ae as StoryCard,se as UserStoryCardWrapper,ae as default,ne as replaceLearnedTagsWithInfo};
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as i}from"react";import{ChevronUp as a,ChevronDown as s,Users as r,ExternalLink as d,Download as u,Share2 as c,Copy as v,LoaderCircle as p,PencilIcon as m,Plus as y,Trash2 as h,X as g,Ellipsis as S,Hourglass as C,Check as f,ChevronUpIcon as I,ChevronDownIcon as b,Info as N,Bookmark as w}from"lucide-react";import E from"showdown";import{Tooltip as D,Menu as B,MenuItem as A}from"@mui/material";import T from"../../icons/Illustration.svg.js";import{v4 as x}from"uuid";import U from"./UserStoryCard.module.css.js";import{formatMarkdown as k,indentMarkdown as P}from"../../utils/helpers.js";import{replaceTitleSection as R,postprocessUserStoryAfterEdit as _}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import L from"../RichTextEditor/RichTextEditor.js";import W from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as O,useRequirementAI as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as V}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as j}from"./TitleEditor/TitleEditor.js";import{updateRedlineDocument as G,getRedlineDocumentId as $,createRedlineDocument as H}from"../../../../service/redlineService.js";import F from"./ClinicalTrialSection.js";import{CompletionPanel as q}from"../story-screen/CompletionPanel.js";import Q from"../../icons/CDIcon.js";const Y={[O.WAITING]:"WAITING TO GENERATE",[O.IN_PROGRESS]:"IN PROGRESS",[O.GENERATED]:"GENERATED",[O.FAILED]:"FAILED",[O.GENERATE]:"GENERATE",[O.APPROVED]:"APPROVED"};function Z(e){const l=[],n=/<learned>(.*?)<\/learned>/g;let o,i=0,a=0;for(;null!==(o=n.exec(e));){const[,s]=o,r=o.index;r>i&&l.push(t("span",{children:e.slice(i,r)},"text-pre-"+a++)),l.push(t(D,{title:s,placement:"top",children:t(N,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${x()}`)),i=n.lastIndex}return i<(null==e?void 0:e.length)&&l.push(t("span",{children:e.slice(i)},"text-post-"+a++)),l}function J(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const K=({displayName:l})=>{var n;const{customStyles:o}=z(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e("div",{className:U.displayName,style:null==i?void 0:i.wrapper,children:[t(w,{className:U.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[l,":"]})]})},X=({isUserStoryCurrentlyUpdated:I,artifactId:b,artifactTitleId:N,parentUserStory:w,currentUserStory:$,onUserStoryChange:H,parentIndex:ee,currentIndex:te,enableDownload:le,isDiffEditReviewMode:ne,showUserStoryDiff:oe,handleDownloadUserStory:ie,handleOpenSendDialog:ae,updateUserStoryArtifact:se,selectedArtifactId:re,isDisplayHighlightControl:de,elementDisplayConfig:ue,_resolvedConfig:ce,showWrapper:ve=!1,defaultExpanded:pe,actionItemsConfig:me,onDelete:ye,contextVariant:he,expandedSubFeatures:ge,showDisplayName:Se=!0,allowTitleEdit:Ce=!0,showConfidenceScore:fe=!0,showBorderTop:Ie=!0,sectionStatusConfig:be,showCompletionPanel:Ne=!1,completionPanelConfig:we,showAddSectionButton:Ee=!1,disableEditPlan:De=!1,useMuiTooltip:Be=!1,approveButtonConfig:Ae,editButtonConfig:Te,CDNeededInChip:xe,blockNumber:Ue,showWaitingIconInChip:ke,showAssignSection:Pe=!1,disableAssignSection:Re=!1,onAssignSectionClick:_e})=>{var Me,Le,We,Oe,ze,Ve,je,Ge,$e,He,Fe,qe,Qe,Ye,Ze,Je,Ke,Xe,et,tt,lt,nt,ot,it;const{isLoadingSectionData:at=!1,onLoadSectionData:st,status:rt,onStatusClick:dt,completedCount:ut,totalCount:ct,isNoDataAvailable:vt=!1}=null!=be?be:{},{searchQueryList:pt,citations:mt,customStyles:yt,onEditBlocked:ht,redlineDcoumentId:gt,redlineConfig:St,customSectionConfig:Ct,updateRedlineDataParent:ft,aiReasoning:It}=z(),bt=null==yt?void 0:yt.userStoryCardStyles,Nt=null==bt?void 0:bt.customSectionEditButton,wt=null==bt?void 0:bt.statusStyles,Et=null===(Me=null==yt?void 0:yt.userStoryCardStyles)||void 0===Me?void 0:Me.userStoryEditStyles,Dt=null===(Le=null==yt?void 0:yt.userStoryScreenStyles)||void 0===Le?void 0:Le.userStoryContentStyles,Bt=null==bt?void 0:bt.progressHeaderStyles,At=null==bt?void 0:bt.clinicalTrialSectionStyles,Tt=null==bt?void 0:bt.CompletionStyles,xt=null==bt?void 0:bt.noDataStyles,Ut=null==bt?void 0:bt.approveButtonStyles,kt=null!==(Oe=null===(We=null==Ct?void 0:Ct.shouldRender)||void 0===We?void 0:We.call(Ct,$))&&void 0!==Oe&&Oe,Pt=null===(ze=null==Ct?void 0:Ct.getValue)||void 0===ze?void 0:ze.call(Ct,$),Rt=null!==(je=null===(Ve=null==Ct?void 0:Ct.getFields)||void 0===Ve?void 0:Ve.call(Ct,$))&&void 0!==je?je:[],_t=null!==(Ge=null==Ct?void 0:Ct.isEditDisabled)&&void 0!==Ge&&Ge,Mt=null!==(He=null===($e=null==Ct?void 0:Ct.isSaving)||void 0===$e?void 0:$e.call(Ct,$))&&void 0!==He&&He,Lt=((e,t)=>e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion)(null!==(Fe=$.completion_percentage)&&void 0!==Fe?Fe:0,Tt),Wt={[O.WAITING]:null==wt?void 0:wt.waiting,[O.IN_PROGRESS]:null==wt?void 0:wt.inProgress,[O.GENERATED]:null==wt?void 0:wt.generated,[O.FAILED]:null==wt?void 0:wt.failed,[O.GENERATE]:null==wt?void 0:wt.generate,[O.APPROVED]:null==wt?void 0:wt.approved},[Ot,zt]=n({...structuredClone($),value:k($.value)||""}),[Vt,jt]=n({userStory:!!$.isDefaultEdit}),[Gt,$t]=n(!1),[Ht,Ft]=n(!1),[qt,Qt]=n(null),[Yt,Zt]=n(null),{userStory:Jt,customIcons:Kt}=z(),[Xt,el]=n(null!=pe?pe:""===ee||re===$.artifactId||!!$.isDefaultOpen),[tl,ll]=n(!1),[nl,ol]=n(null),[il,al]=n(null),[sl,rl]=n(!1),dl=o(null),ul=o(null),[cl,vl]=n(!1),[pl,ml]=n(!1),yl=o(null),[hl,gl]=n(!1),[Sl,Cl]=n($.value);i(()=>{I&&el(I)},[I]),i(()=>{zt({...structuredClone($),value:k($.value)||""})},[$]),i(()=>{pt.length>0?el(!0):void 0===pe&&re&&el(re===$.artifactId)},[pt,re,$.artifactId]),i(()=>{ge&&ge.length>0&&el(ge.includes($.artifactId)||""===ee||re===$.artifactId||!!$.isDefaultOpen)},[ge]);const fl=()=>{ol(null)},Il=()=>{al(null)},bl=()=>{Xt&&Vt.userStory&&ul.current&&!ul.current.requestClose()||el(e=>!e)},Nl=async()=>{var e,t;try{"userStory"==="userStory"&&(H(Ot),console.log("I am changing RTE editor values",Ot)),await(null===(e=null==Te?void 0:Te.onSaveEditedSection)||void 0===e?void 0:e.call(Te,Ot)),await se(mt,Jt,b,null===(t=yl.current)||void 0===t?void 0:t.signal)}finally{}};const wl=null!=(null==$?void 0:$.big_enough)&&!Number.isNaN($.big_enough)&&!!(null==$?void 0:$.big_enough_decision_factors),El=null!==(qe=null==$?void 0:$.completion_percentage)&&void 0!==qe?qe:0,Dl=!!(null==$?void 0:$.completion_decision_factors),Bl=""===ee,Al=null!=ce?ce:J(ue,Bl),Tl=!ne&&!oe;i(()=>{if(!Yt)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Yt}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Yt]),i(()=>{$.isDefaultEdit&&jt(e=>({...e,userStory:!0}))},[$.isDefaultEdit]),console.log("block number in userstory card ",Ue),console.log("[TESTING-CURRENT-USER-STORY] \n",$,"\n[TESTING-USER-STORY] \n",Jt);return i(()=>Cl($.value),[$.value]),e("div",{className:U.card,"data-block-id":"user-story-card-wrapper-"+Ue,style:null==bt?void 0:bt.cardStyle,id:`story-card-${$.title}`,"data-expanded":Xt,children:[e("div",{className:U.titleSection,style:null==bt?void 0:bt.titleSection,children:[e("div",{className:U.titleRow,style:null==bt?void 0:bt.titleRow,onClick:bl,children:[e("div",{className:U.titleLeft,style:null==bt?void 0:bt.titleLeft,onMouseEnter:()=>vl(!0),onMouseLeave:()=>vl(!1),children:[Se&&t(K,{displayName:N}),Gt&&Tl?t(j,{title:$.title,onSave:e=>(async(e,t)=>{var l;try{let n={...$};$.artifactId===t?n.title=e:n.sub_features=(null===(l=$.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],zt(n),H(n),$t(!1)}catch(e){console.error("Failed to save title",e)}})(e,$.artifactId),onCancel:()=>{$t(!1)},inputStyle:null==Et?void 0:Et.inlineTitleInput,confirmButtonStyle:null==Et?void 0:Et.inlineTitleConfirm,cancelButtonStyle:null==Et?void 0:Et.inlineTitleCancel},"inline-title-editor"):e("div",{className:U.storyTitleWrapper,children:[t(D,{title:Z($.title),arrow:!0,children:t("h2",{title:Be?void 0:$.title,className:U.storyTitle,style:null==bt?void 0:bt.storyTitle,children:Z($.title)},$.artifactId)}),Ne&&(Dl?t(q,{customIcons:null==Kt?void 0:Kt.userStoryIcons,customStyles:null==bt?void 0:bt.aiReasoningCitaionStyles,currentUserStory:$,panelStyles:null==bt?void 0:bt.CompletionStyles,onToggleStateChange:ml,completionPanelConfig:we,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Tt?void 0:Tt.badge,...Lt},children:[e("span",{children:[El,"% Completed"]}),t("span",{style:{display:"flex",alignItems:"center"},children:t(Q,{color:"currentColor"})}),t(pl?a:s,{size:14,style:null==Tt?void 0:Tt.chevronStyle})]})}):t("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Tt?void 0:Tt.badge,...Lt},children:e("span",{children:[El,"% Completed"]})})),Ce&&t("button",{type:"button",className:U.titleEditButton,style:null==Et?void 0:Et.titleEditButton,onClick:e=>{e.stopPropagation(),$t(!0),Xt||el(!0)},"aria-label":"Edit title",title:"Edit title",children:t("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),(rt||void 0!==ut&&void 0!==ct)&&e("div",{className:U.statusContainer,children:[void 0!==ut&&void 0!==ct&&e("div",{className:U.completedBadge,children:["Completed: ",ut,"/",ct]}),rt&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==dt||dt()},onMouseEnter:()=>gl(!0),onMouseLeave:()=>gl(!1),className:U.statusButton,style:{...null===(Qe=Wt[rt])||void 0===Qe?void 0:Qe.default,...hl&&(null===(Ye=Wt[rt])||void 0===Ye?void 0:Ye.hover)},children:Y[rt]})]}),e("div",{className:U.titleActions,style:null==bt?void 0:bt.titleActions,onClick:e=>e.stopPropagation(),children:[(Al.showProgressPercentage||Al.showGapBox)&&ve&&e("div",{className:U.progressHeader,style:null==Bt?void 0:Bt.wrapper,children:[Al.showProgressPercentage&&e("div",{className:U.progressPercentage,style:null==Bt?void 0:Bt.percentage,children:[null!==(Je=null!==(Ze=null==$?void 0:$.confidenceScore)&&void 0!==Ze?Ze:null==Al?void 0:Al.confidenceValue)&&void 0!==Je?Je:"0","%"]}),Al.showGapBox&&e("div",{className:U.gapBox,style:null==Bt?void 0:Bt.gapBox,children:[null!==(Xe=null!==(Ke=null==$?void 0:$.gapValue)&&void 0!==Ke?Ke:null==Al?void 0:Al.gapBoxValue)&&void 0!==Xe?Xe:"2"," ","Gaps"]})]}),wl&&t(V,{customIcons:null==Kt?void 0:Kt.userStoryIcons,customStyles:null==bt?void 0:bt.aiReasoningCitaionStyles,currentUserStory:$,panelStyles:null==bt?void 0:bt.BigEnoughStyles}),Pe&&t("button",{type:"button",className:U.iconButton,style:null==bt?void 0:bt.iconButton,disabled:Re,onClick:e=>{e.stopPropagation(),null==_e||_e($)},"aria-label":"Assign section users",title:"Assign section users",children:t(r,{size:16})}),!Vt.userStory&&e(l,{children:[!1!==(null==Al?void 0:Al.showShareButton)&&t("button",{className:U.iconButton,style:null==bt?void 0:bt.iconButton,onClick:e=>{ol(e.currentTarget)},children:t(d,{size:16})}),e(B,{id:"user-story-share-menu",anchorEl:nl,open:!!nl,onClose:()=>ol(null),style:null==bt?void 0:bt.userStoryShareMenu,children:[le&&t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:async()=>{ll(!0),ie&&(await Promise.all([ie("pdf"),ie("doc")]),ll(!1))},children:e("div",{ref:dl,className:U.menuItemContent,style:null==bt?void 0:bt.menuItemContent,children:[t(u,{size:16,color:null==bt?void 0:bt.menuIconColor}),t("p",{style:null==bt?void 0:bt.menuLabel,children:"Download"})]})}),t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:async()=>{let e=$;w&&(e={...$,value:`${R(null==w?void 0:w.value,$.title)} \n${$.value}`}),null==ae||ae(!0,[e],$.artifactId),fl()},children:e("div",{style:null==bt?void 0:bt.menuItemContent,className:U.menuItemContentPadded,children:[t(c,{size:16,color:null==bt?void 0:bt.menuIconColor}),t("p",{style:null==bt?void 0:bt.menuLabel,children:"Send"})]})}),t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:async()=>{const e=(new E.Converter).makeHtml(k($.value)||$.value),t=function(e){const t=(new E.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(k($.value)||$.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{fl()}},children:e("div",{style:null==bt?void 0:bt.menuItemContent,className:U.menuItemContentPadded,children:[t(v,{size:16,color:null==bt?void 0:bt.menuIconColor}),t("p",{style:null==bt?void 0:bt.menuLabel,children:"Copy"})]})})]})]}),!sl&&Vt.userStory&&Xt?t(M,{type:"outline",children:"Cancel",style:null==bt?void 0:bt.cancelButton,onClick:()=>{var e;null===(e=yl.current)||void 0===e||e.abort(),jt(e=>({...e,userStory:!1}))}}):t(l,{}),Vt.userStory&&Xt?t(M,{type:"fill",children:sl?e("span",{className:U.savingSpinner,style:null==bt?void 0:bt.savingSpinner,children:[t(p,{className:U.spinAnimation,style:null==bt?void 0:bt.spinAnimation}),t("span",{children:"Saving..."})]}):"Save",isDisable:sl,style:sl?null==bt?void 0:bt.savingButton:null==bt?void 0:bt.saveButton,onClick:async()=>{rl(!0),await Nl();let e=await(async()=>{var e,t,l,n,o;let i=Ot.value;console.log("[V] valueToUpdate before",i),i=i.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",i);try{if(null==St?void 0:St.callUpdateDocument){const{updated_reqai:a}=await G({documentId:gt,sectionId:$.artifactId,baseApiUrl:null==St?void 0:St.baseApiUrl,updatedContent:i,userEmail:St.userEmail,userName:St.userName,redlineConfigId:null!==(e=St.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==St?void 0:St.token)&&void 0!==t?t:"");i=null===(o=null===(n=null===(l=null==a?void 0:a.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==ft?void 0:ft(a))}}catch(e){console.error("failed to update redline document",e),i=Sl}return i=i.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),i})();const t={...Ot,value:e};H({...t,isDefaultEdit:!1}),Cl(t.value),jt(e=>({...e,userStory:!1})),rl(!1)}}):!ne&&!oe&&!De&&Xt&&!1!==(null==Al?void 0:Al.showEditButton)&&t("button",{className:U.iconButton,style:null==bt?void 0:bt.editButton,onClick:()=>jt(e=>({...e,userStory:!0})),children:t(m,{color:null==bt?void 0:bt.pencilIconColor,size:16})}),Ee&&Bl&&Xt&&!ne&&!oe&&!1!==(null==Al?void 0:Al.showEditButton)&&e("button",{type:"button",className:U.addSectionButton,style:null==Et?void 0:Et.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=$.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:x(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...$,sub_features:[...null!==(n=$.sub_features)&&void 0!==n?n:[],i]};zt(a),H(a),el(!0),Zt(i.title)},"aria-label":"Add section",title:"Add section",children:[t(y,{size:14}),t("span",{className:U.addSectionLabel,children:"Add Section"})]}),!Bl&&!ne&&!De&&!oe&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==ye||ye()},className:U.iconButton,style:null==Et?void 0:Et.deleteButton,"aria-label":"Delete section",title:"Delete section",children:t(h,{size:16})}),kt&&t("button",{type:"button",className:U.iconButton,style:null==Nt?void 0:Nt.button,disabled:_t,onClick:e=>{if(e.stopPropagation(),Ht)return Qt(null),void Ft(!1);Qt(structuredClone(null!=Pt?Pt:{})),el(!0),Ft(!0)},children:Ht?t(g,{size:16,color:null==bt?void 0:bt.pencilIconColor,style:null==Nt?void 0:Nt.cancelIcon}):t(m,{size:16,color:null==bt?void 0:bt.pencilIconColor,style:null==Nt?void 0:Nt.editIcon})}),(null==Al?void 0:Al.actionItemsButton)&&e(l,{children:[t("span",{className:U.actionItemBtn,style:null==bt?void 0:bt.actionItemBtn,onClick:e=>{e.stopPropagation(),al(e.currentTarget)},children:t(S,{})}),t(B,{id:"user-story-action-menu",anchorEl:il,open:!!il,onClose:Il,style:null==bt?void 0:bt.userStoryShareMenu,children:null==me?void 0:me.items.map((l,n)=>t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:()=>{l.onclick($),Il()},children:e("div",{className:U.menuItemContent,style:{...null==bt?void 0:bt.menuItemContent,...!l.isActive&&{cursor:"not-allowed",opacity:.5}},children:[t("span",{className:U.menuItemIcon,style:null==bt?void 0:bt.menuItemIcon,children:l.icon}),t("p",{style:null==bt?void 0:bt.menuLabel,children:l.name}),t("span",{className:U.menuItemRight,style:null==bt?void 0:bt.menuItemRight})]})},`action-item-${n}-${l.name}`))})]}),t("button",{type:"button",onClick:e=>{e.stopPropagation(),bl()},style:null==bt?void 0:bt.chevronButton,className:U.chevronButton,children:t(Xt?a:s,{className:U.chevronIcon,color:null==bt?void 0:bt.chevronIconColor})})]})]}),t("div",{className:U.divider,style:null==bt?void 0:bt.dividerStyle})]}),Xt&&t("div",{className:U.cardContent,style:{...null==bt?void 0:bt.cardContentStyle,borderTop:Ie?"1px solid #E5E5E5":"none"},children:e("div",at?{className:U.loadingContainer,children:[t("div",{className:U.loadingIconWrapper,children:t(C,{size:28,color:"#5B3DF5",className:U.spinAnimation})}),e("div",{children:[t("h3",{className:U.loadingTitle,children:"Section generation in progress.."}),t("p",{className:U.loadingSubtitle,children:"This may take a few minutes"})]}),t("button",{type:"button",onClick:()=>null==st?void 0:st(),className:U.viewStatusButton,children:"View Status"})]}:vt?{className:U.noDataContainer,style:null==xt?void 0:xt.container,children:[t("img",{src:T,alt:"No data available",className:U.noDataIllustration,style:null==xt?void 0:xt.illustration}),t("h3",{className:U.noDataTitle,style:null==xt?void 0:xt.title,children:"No Data Available for This Section"}),t("p",{className:U.noDataSubtitle,style:null==xt?void 0:xt.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}:{className:U.contentInner,style:null==bt?void 0:bt.contentInner,children:[e("div",{className:U.descriptionSection,style:null==bt?void 0:bt.descriptionSection,children:[t("div",{className:U.justifyBetween,style:null==bt?void 0:bt.justifyBetween}),Vt.userStory?t(L,{ref:ul,minHeight:"100%",height:"100%",type:"string",value:k(Sl)||"",handleUpdateState:(e,t)=>{const l=_(P(t));zt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:Vt.userStory?"edit":"readOnly",onEditBlocked:ht,onSaveUnsavedChanges:async()=>{await Nl(),el(!1)},onDiscardUnsavedChanges:()=>{zt({...structuredClone($),value:k($.value)||""}),jt(e=>({...e,userStory:!1})),el(!1)},isSavingUnsavedChanges:sl}):kt?t(F,{styles:At,fields:Rt,readonly:!Ht,isSaving:Mt,value:null!==(et=null!=qt?qt:Pt)&&void 0!==et?et:{},onChange:Qt,onSave:async()=>{var e;qt&&(await(null===(e=null==Ct?void 0:Ct.onSave)||void 0===e?void 0:e.call(Ct,$,qt)),Qt(null),Ft(!1))},onCancel:()=>{Qt(null),Ft(!1)}}):e(l,{children:[t(W,{showUserStoryDiff:oe,isParent:""===ee,message:k($.value)||"",artifactId:$.artifactId,customStyles:Dt,isDisplayHighlightControl:de,contextVariant:he,showConfidenceScore:fe,CDNeededInChip:xe,blockId:Ue,showWaitingIconInChip:ke}),(Ae||Te)&&e("div",{className:U.actionButtonsContainer,style:null==Ut?void 0:Ut.container,children:[Te&&!Vt.userStory&&e(l,{children:[t("button",{type:"button",className:U.actionButton,style:null==Ut?void 0:Ut.button,disabled:Te.disabled||Te.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Te.onClick)||void 0===t||t.call(Te),jt(e=>({...e,userStory:!0})),el(!0)},children:Te.isLoading?e(l,{children:[t(p,{size:16,className:U.actionButtonSpinner,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(tt=Te.label)&&void 0!==tt?tt:"Edit"})]}):e(l,{children:[t(m,{size:16,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(lt=Te.label)&&void 0!==lt?lt:"Edit"})]})}),Ae&&t("span",{className:U.actionButtonDivider})]}),Ae&&t("button",{type:"button",className:U.actionButton,style:null==Ut?void 0:Ut.button,disabled:Ae.disabled||Ae.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Ae.onClick)||void 0===t||t.call(Ae)},children:Ae.isLoading?e(l,{children:[t(p,{size:16,className:U.actionButtonSpinner,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(nt=Ae.label)&&void 0!==nt?nt:"Approve"})]}):e(l,{children:[t(f,{size:16,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(ot=Ae.label)&&void 0!==ot?ot:"Approve"})]})})]})]})]}),null===(it=Ot.sub_features)||void 0===it?void 0:it.map((e,l)=>{console.log("UserStoryCardWrapper: sub",e);const n=J(ue,!1,e.artifactId);return t(X,{artifactId:b,isUserStoryCurrentlyUpdated:I,artifactTitleId:`${N}-${String.fromCharCode(65+l)}`,parentUserStory:$,parentIndex:`${ee}${ee&&"."}${te}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...$.sub_features||[]];l[e]=t,H({...$,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:oe,updateUserStoryArtifact:se,handleDownloadUserStory:ie,handleOpenSendDialog:ae,isDisplayHighlightControl:de,elementDisplayConfig:ue,_resolvedConfig:n,actionItemsConfig:me,onDelete:()=>(e=>{const t=($.sub_features||[]).filter((t,l)=>l!==e),l={...$,sub_features:t};zt(l),H(l)})(l),expandedSubFeatures:ge,disableEditPlan:De,useMuiTooltip:Be,blockNumber:e.blockNumber,showAssignSection:Pe,onAssignSectionClick:_e},e.artifactId)})]})})]})},ee=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:y,showWrapper:h,actionItemsConfig:g,contextVariant:S,showDisplayName:C,allowTitleEdit:f,showConfidenceScore:N,showBorderTop:w,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:x=!1,approveButtonConfig:k,editButtonConfig:P,CDNeededInChip:R,showWaitingIconInChip:_,setRedlineDocumentIdParent:M,showAssignSection:L,onAssignSectionClick:W,disableAssignSection:O})=>{const{userStory:V,setUserStory:j,customStyles:G,searchQueryList:F,currentHighlightIndex:q,setCurrentHighlightIndex:Q,segmentComponentConfig:Y,sectionStatusConfig:Z,redlineConfig:K,setRedlineDocumentId:ee}=z(),te=null==G?void 0:G.userStoryCardStyles,le=0===q,ne=q===F.length-1;return i(()=>{if(!(null==K?void 0:K.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await $({baseApiUrl:K.documentBaseApiUrl||"",comparisonId:K.documentComparisonId||""});if(t)ee(t);else{const{document_id:t}=await H({baseApiUrl:K.baseApiUrl,changelogConfigId:K.changelogConfigId,comparisonId:K.documentComparisonId,artifactId:K.artifactId,inputData:K.inputData,redlineConfigId:K.redlineConfigId,userEmail:K.userEmail,userName:K.userName},null!==(e=null==K?void 0:K.token)&&void 0!==e?e:"");t&&(ee(t),null==M||M(t))}})()},[]),e("div",{className:U.userStoryCardWrapper,style:m?{...null==te?void 0:te.userStoryCardWrapper,position:"relative"}:null==te?void 0:te.userStoryCardWrapper,children:[m&&t(l,{children:F.length>0&&t("div",{className:U.wrapper,children:t("div",{className:U.highlightNavigation,children:e("div",{className:U.navigationContainer,children:[e("span",{className:U.navCounter,children:[q+1," of ",F.length]}),e("div",{className:U.navButtons,children:[t("button",{onClick:()=>{q>0&&Q(e=>e-1)},className:U.navButton,disabled:le,children:t(I,{size:20,className:U.navIcon})}),t("button",{onClick:()=>{q<F.length-1&&Q(e=>e+1)},className:U.navButton,disabled:ne,children:t(b,{size:20,className:U.navIcon})})]})]})})})}),V.map((e,l)=>{console.log("UserStoryCardWrapper: userstory",e);const i=J(y,!0);return t(X,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:e,onUserStoryChange:e=>{j(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:y,_resolvedConfig:i,showWrapper:h,defaultExpanded:E,actionItemsConfig:g,contextVariant:S,showDisplayName:C,allowTitleEdit:f,showConfidenceScore:N,showBorderTop:w,sectionStatusConfig:Z,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:x,approveButtonConfig:k,CDNeededInChip:R,editButtonConfig:P,showWaitingIconInChip:_,showAssignSection:L,disableAssignSection:O,onAssignSectionClick:W},e.artifactId)})]})};export{X as StoryCard,ee as UserStoryCardWrapper,X as default,Z as replaceLearnedTagsWithInfo};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"axios";const n=async n=>{try{console.log("[getRedlineDocumentId] Request:",n);const{data:o}=await e.get(`${n.baseApiUrl}/book-finder-mode/get_comparison/${n.comparisonId}`);return console.log("[getRedlineDocumentId] Response:",o),o}catch(e){console.log("[getRedlineDocumentId] Error:",e)}return null},o=async(n,o)=>{try{console.log("[createRedlineDocument] Request:",n);const{data:
|
|
1
|
+
import e from"axios";const n=async n=>{try{console.log("[getRedlineDocumentId] Request:",n);const{data:o}=await e.get(`${n.baseApiUrl}/book-finder-mode/get_comparison/${n.comparisonId}`);return console.log("[getRedlineDocumentId] Response:",o),o}catch(e){console.log("[getRedlineDocumentId] Error:",e)}return null},o=async(n,o)=>{try{console.log("[createRedlineDocument] Request:",n);const{data:a}=await e.post(`${t}/redlining/create`,{user_name:n.userName,user_email:n.userEmail,redline_config_id:n.redlineConfigId,changelog_config_id:n.changelogConfigId,artifact_id:n.artifactId,input_data:n.inputData,document_metadata:{comparison_id:n.comparisonId}},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[createRedlineDocument] Response:",a),a}catch(e){console.log("[createRedlineDocument] Error:",e)}return null},t="https://dev.appmod.ai/backend/legal_mode",a=async(n,o)=>{try{console.log("[updateRedlineDocument] Request:",n);const{data:a}=await e.put(`${t}/redlining/update-manual`,{document_id:n.documentId,segment_id:n.sectionId,user_name:n.userName,user_email:n.userEmail,new_plain_content:n.updatedContent,redline_config_id:n.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[updateRedlineDocument] Response:",a),a}catch(e){console.log("[updateRedlineDocument] Error:",e)}return null},r=async(n,o)=>{try{console.log("[resolveRedline] Request:",n);const{data:a}=await e.post(`${t}/redlining/resolve`,{document_id:n.documentId,user_name:n.userName,user_email:n.userEmail,redline_id:n.redlineId,action:n.action,redline_config_id:n.redlineConfigId},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});return console.log("[resolveRedline] Response:",a),a}catch(e){console.log("[resolveRedline] Error:",e)}return null};export{o as createRedlineDocument,n as getRedlineDocumentId,r as resolveRedline,a as updateRedlineDocument};
|
|
2
2
|
//# sourceMappingURL=redlineService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=RedlineApprovalCardTest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedlineApprovalCardTest.d.ts","sourceRoot":"","sources":["../../../src/RedlineApprovalCardTest.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedlineEditorTest.d.ts","sourceRoot":"","sources":["../../../src/RedlineEditorTest.tsx"],"names":[],"mappings":"AA6BA,iBAAS,iBAAiB,
|
|
1
|
+
{"version":3,"file":"RedlineEditorTest.d.ts","sourceRoot":"","sources":["../../../src/RedlineEditorTest.tsx"],"names":[],"mappings":"AA6BA,iBAAS,iBAAiB,4CAg3BzB;AAED,eAAe,iBAAiB,CAAA"}
|