@e-llm-studio/requirement-ai 0.0.359 → 0.0.360
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/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/common/TableWrapper.js +2 -0
- package/dist/cjs/features/RequirementAI/components/common/TableWrapper.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/cjs/utils/helperFunctions.js +2 -0
- package/dist/cjs/utils/helperFunctions.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/common/TableWrapper.js +2 -0
- package/dist/features/RequirementAI/components/common/TableWrapper.js.map +1 -0
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +5 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/common/TableWrapper.d.ts +13 -0
- package/dist/types/src/features/RequirementAI/components/common/TableWrapper.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +4 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/menuAction.type.d.ts +32 -0
- package/dist/types/src/features/RequirementAI/types/menuAction.type.d.ts.map +1 -0
- package/dist/types/src/utils/helperFunctions.d.ts +3 -0
- package/dist/types/src/utils/helperFunctions.d.ts.map +1 -1
- package/dist/utils/helperFunctions.js +2 -0
- package/dist/utils/helperFunctions.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("lucide-react"),n=require("showdown"),o=require("@mui/material"),i=require("../../icons/Illustration.svg.js"),s=require("uuid"),a=require("./UserStoryCard.module.css.js"),r=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),u=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),v=require("../userstory-with-citation/UserStoryWithCitation.js"),p=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../story-screen/BigEnoughPanel.js"),m=require("./TitleEditor/TitleEditor.js"),h=require("../../../../service/redlineService.js"),y=require("./ClinicalTrialSection.js"),g=require("../story-screen/CompletionPanel.js"),S=require("../../icons/CDIcon.js"),C=require("./cws/CwsEvent.js"),x=require("./cws/useCwsEvent.js"),I=require("react-hot-toast"),j=require("./Popups/RedlineToast.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=b(n),N=b(I);const E={[p.SectionStatus.WAITING]:"WAITING TO GENERATE",[p.SectionStatus.IN_PROGRESS]:"IN PROGRESS",[p.SectionStatus.GENERATED]:"GENERATED",[p.SectionStatus.FAILED]:"FAILED",[p.SectionStatus.GENERATE]:"GENERATE",[p.SectionStatus.APPROVED]:"APPROVED"};function D(t){const n=[],i=/<learned>(.*?)<\/learned>/g;let a,r=0,d=0;for(;null!==(a=i.exec(t));){const[,u]=a,c=a.index;c>r&&n.push(e.jsx("span",{children:t.slice(r,c)},"text-pre-"+d++)),n.push(e.jsx(o.Tooltip,{title:u,placement:"top",children:e.jsx(l.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${s.v4()}`)),r=i.lastIndex}return r<(null==t?void 0:t.length)&&n.push(e.jsx("span",{children:t.slice(r)},"text-post-"+d++)),n}function B(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 A=({displayName:t})=>{var n;const{customStyles:o}=p.useRequirementAI(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e.jsxs("div",{className:a.default.displayName,style:null==i?void 0:i.wrapper,children:[e.jsx(l.Bookmark,{className:a.default.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e.jsxs("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},T=({isUserStoryCurrentlyUpdated:n,artifactId:I,artifactTitleId:b,parentUserStory:k,currentUserStory:U,onUserStoryChange:P,parentIndex:R,currentIndex:M,enableDownload:F,isDiffEditReviewMode:L,showUserStoryDiff:q,handleDownloadUserStory:_,handleOpenSendDialog:$,updateUserStoryArtifact:W,selectedArtifactId:z,isDisplayHighlightControl:O,elementDisplayConfig:V,_resolvedConfig:G,showWrapper:H=!1,defaultExpanded:Y,actionItemsConfig:Q,onDelete:X,contextVariant:Z,expandedSubFeatures:J,showDisplayName:K=!0,allowTitleEdit:ee=!0,showConfidenceScore:te=!0,showBorderTop:le=!0,sectionStatusConfig:ne,showCompletionPanel:oe=!1,completionPanelConfig:ie,showAddSectionButton:se=!1,disableEditPlan:ae=!1,useMuiTooltip:re=!1,approveButtonConfig:de,editButtonConfig:ue,CDNeededInChip:ce,blockNumber:ve,storyNumber:pe,showWaitingIconInChip:fe,showAssignSection:me=!1,disableAssignSection:he=!1,onAssignSectionClick:ye,onSave:ge,onUserStoryAccordionStateChange:Se,showSuggestedFilesInfo:Ce=!1,suggestedFilesConfig:xe})=>{var Ie,je,be,we,Ne,Ee,De,Be,Ae,Te,ke,Ue,Pe,Re,Me,Fe,Le,qe,_e,$e,We,ze,Oe,Ve,Ge,He,Ye,Qe,Xe,Ze,Je;const{isLoadingSectionData:Ke=!1,onLoadSectionData:et,status:tt,onStatusClick:lt,completedCount:nt,totalCount:ot,isNoDataAvailable:it=!1}=null!=ne?ne:{},{searchQueryList:st,citations:at,customStyles:rt,onEditBlocked:dt,redlineDcoumentId:ut,redlineConfig:ct,customSectionConfig:vt,updateRedlineDataParent:pt,aiReasoning:ft,redlineCollaborativeConfig:mt,selectedSectionToEdit:ht,setSelectedSectionToEdit:yt}=p.useRequirementAI(),gt=null==rt?void 0:rt.userStoryCardStyles,St=null==gt?void 0:gt.customSectionEditButton,Ct=null==gt?void 0:gt.statusStyles,xt=null===(Ie=null==rt?void 0:rt.userStoryCardStyles)||void 0===Ie?void 0:Ie.userStoryEditStyles,It=null===(je=null==rt?void 0:rt.userStoryScreenStyles)||void 0===je?void 0:je.userStoryContentStyles,jt=null==gt?void 0:gt.progressHeaderStyles,bt=null==gt?void 0:gt.clinicalTrialSectionStyles,wt=null==gt?void 0:gt.CompletionStyles,Nt=null==gt?void 0:gt.noDataStyles,Et=null==gt?void 0:gt.approveButtonStyles;null==gt||gt.suggestedFilesStyles;const Dt=null!==(we=null===(be=null==vt?void 0:vt.shouldRender)||void 0===be?void 0:be.call(vt,U))&&void 0!==we&&we,Bt=null===(Ne=null==vt?void 0:vt.getValue)||void 0===Ne?void 0:Ne.call(vt,U),At=null!==(De=null===(Ee=null==vt?void 0:vt.getFields)||void 0===Ee?void 0:Ee.call(vt,U))&&void 0!==De?De:[],Tt=null!==(Be=null==vt?void 0:vt.isEditDisabled)&&void 0!==Be&&Be,kt=null!==(Te=null===(Ae=null==vt?void 0:vt.isSaving)||void 0===Ae?void 0:Ae.call(vt,U))&&void 0!==Te&&Te,Ut=(Pt=null!==(ke=U.completion_percentage)&&void 0!==ke?ke:0,Rt=wt,Pt>=80?null==Rt?void 0:Rt.highCompletion:Pt>=50?null==Rt?void 0:Rt.mediumCompletion:null==Rt?void 0:Rt.lowCompletion);var Pt,Rt;const Mt={[p.SectionStatus.WAITING]:null==Ct?void 0:Ct.waiting,[p.SectionStatus.IN_PROGRESS]:null==Ct?void 0:Ct.inProgress,[p.SectionStatus.GENERATED]:null==Ct?void 0:Ct.generated,[p.SectionStatus.FAILED]:null==Ct?void 0:Ct.failed,[p.SectionStatus.GENERATE]:null==Ct?void 0:Ct.generate,[p.SectionStatus.APPROVED]:null==Ct?void 0:Ct.approved},[Ft,Lt]=t.useState({...structuredClone(U),value:r.formatMarkdown(U.value)||""}),[qt,_t]=t.useState({userStory:!!U.isDefaultEdit}),[$t,Wt]=t.useState(!1),[zt,Ot]=t.useState(!1),[Vt,Gt]=t.useState(null),[Ht,Yt]=t.useState(null),{userStory:Qt,customIcons:Xt}=p.useRequirementAI(),[Zt,Jt]=t.useState(null!=Y?Y:""===R||z===U.artifactId||!!U.isDefaultOpen),[Kt,el]=t.useState(!1),[tl,ll]=t.useState(null),[nl,ol]=t.useState(null),[il,sl]=t.useState(!1),al=t.useRef(null),rl=t.useRef(null),dl=t.useRef(null),[ul,cl]=t.useState(!1),[vl,pl]=t.useState(!1),fl=t.useRef(null),[ml,hl]=t.useState(!1),[yl,gl]=t.useState(!1),[Sl,Cl]=t.useState(U.value);t.useEffect(()=>{n&&Jt(n)},[n]),t.useEffect(()=>{Lt({...structuredClone(U),value:r.formatMarkdown(U.value)||""})},[U]),t.useEffect(()=>{st.length>0?Jt(!0):void 0===Y&&z&&Jt(z===U.artifactId)},[st,z,U.artifactId]),t.useEffect(()=>{J&&J.length>0&&pe&&ve&&Jt(J.includes(`${pe}-${ve}`)||""===R||z===U.artifactId||!!U.isDefaultOpen)},[J,pe,ve]),t.useEffect(()=>{if(!yl)return;const e=e=>{rl.current&&!rl.current.contains(e.target)&&gl(!1)};return document.addEventListener("mousedown",e,!0),()=>{document.removeEventListener("mousedown",e,!0)}},[yl]);const xl=()=>{ll(null)},Il=()=>{ol(null)},jl=()=>{if(Zt&&qt.userStory&&dl.current&&!dl.current.requestClose())return;const e=!Zt;Jt(e),null==Se||Se(U,e)},bl=async()=>{var e,t;try{"userStory"==="userStory"&&(P(Ft),console.log("I am changing RTE editor values",Ft)),await(null===(e=null==ue?void 0:ue.onSaveEditedSection)||void 0===e?void 0:e.call(ue,Ft)),await W(at,Qt,I,null===(t=fl.current)||void 0===t?void 0:t.signal)}finally{}};const wl=null!=(null==U?void 0:U.big_enough)&&!Number.isNaN(U.big_enough)&&!!(null==U?void 0:U.big_enough_decision_factors),Nl=null!==(Ue=null==U?void 0:U.completion_percentage)&&void 0!==Ue?Ue:0,El=!!(null==U?void 0:U.completion_decision_factors),Dl=""===R,Bl=null!=G?G:B(V,Dl),Al=!L&&!q;t.useEffect(()=>{if(!Ht)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Ht}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Ht]);const[Tl,kl]=t.useState(0),[Ul,Pl]=t.useState(!1),Rl=async()=>{var e,t;let l=!0;if(Pl(e=>(l=!e,!0)),l){let l;kl(e=>(l=e,e));try{const{updated_reqai:n}=await h.fetchRedlineDocumentSection({documentId:ut,sectionId:U.artifactId,baseApiUrl:null==ct?void 0:ct.editorBaseApiUrl,redlineConfigId:null!==(e=null==ct?void 0:ct.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==ct?void 0:ct.token)&&void 0!==t?t:"");await(null==pt?void 0:pt(n)),kl(e=>l===e?0:1)}catch(e){console.error("failed to fetch latest user story: ",e),N.default.error("Failed to fetch the latest user story. Please try again.")}Pl(!1)}};t.useEffect(()=>{U.isDefaultEdit&&_t(e=>({...e,userStory:!0}))},[U.isDefaultEdit]),console.log("block number in userstory card ",ve),console.log("[TESTING-CURRENT-USER-STORY] \n",U,"\n[TESTING-USER-STORY] \n",Qt),x.default(`redline-edit:${ut}:${U.artifactId}`,async({updatedBy:t})=>{var l;null===(l=fl.current)||void 0===l||l.abort(),kl(e=>e+1),_t(l=>l.userStory?(N.default.custom(l=>e.jsxs(j.default,{onCancel:()=>N.default.dismiss(l.id),onRefresh:()=>{N.default.dismiss(l.id),Rl()},children:["This ",e.jsx("span",{style:{fontWeight:600},children:U.title})," section has been updated by ",e.jsx("span",{style:{fontWeight:600},children:t})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:p.ToasterId}),{...Qt,userStory:!1}):(Rl().then(()=>{N.default.custom(l=>e.jsxs(j.default,{onCancel:()=>N.default.dismiss(l.id),title:e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontWeight:600},children:U.title})," updated,",e.jsx("br",{})]}),children:[t," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:p.ToasterId})}),l))});return t.useEffect(()=>Cl(U.value),[U.value]),e.jsxs("div",{className:a.default.card,"data-block-id":`user-story-card-wrapper-${pe}-${ve}`,style:null==gt?void 0:gt.cardStyle,id:`story-card-${U.title}`,"data-expanded":Zt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==gt?void 0:gt.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==gt?void 0:gt.titleRow,onClick:jl,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==gt?void 0:gt.titleLeft,onMouseEnter:()=>cl(!0),onMouseLeave:()=>cl(!1),children:[K&&e.jsx(A,{displayName:b}),$t&&Al?e.jsx(m.InlineTitleEditor,{title:U.title,onSave:e=>(async(e,t)=>{var l;try{let n={...U};U.artifactId===t?n.title=e:n.sub_features=(null===(l=U.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],Lt(n),P(n),Wt(!1)}catch(e){console.error("Failed to save title",e)}})(e,U.artifactId),onCancel:()=>{Wt(!1)},inputStyle:null==xt?void 0:xt.inlineTitleInput,confirmButtonStyle:null==xt?void 0:xt.inlineTitleConfirm,cancelButtonStyle:null==xt?void 0:xt.inlineTitleCancel},"inline-title-editor"):e.jsxs("div",{className:a.default.storyTitleWrapper,children:[e.jsx(o.Tooltip,{title:D(U.title),arrow:!0,children:e.jsx("h2",{title:re?void 0:U.title,className:a.default.storyTitle,style:null==gt?void 0:gt.storyTitle,children:D(U.title)},U.artifactId)}),Ce&&!Dt&&e.jsx("div",{ref:rl,style:{display:"inline-flex"},children:e.jsx(o.Tooltip,{open:yl&&!(null==xe?void 0:xe.isLoading)&&!!(null===(Pe=null==xe?void 0:xe.files)||void 0===Pe?void 0:Pe.length),disableHoverListener:!0,disableFocusListener:!0,disableTouchListener:!0,placement:"bottom",PopperProps:{disablePortal:!0},arrow:!0,componentsProps:{tooltip:{className:a.default.suggestedFilesTooltip,sx:{backgroundColor:"#334155",color:"#fff",maxWidth:400,padding:0,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},arrow:{sx:{color:"#334155"}}},title:e.jsxs("div",{onClick:e=>e.stopPropagation(),children:[e.jsxs("div",{style:{fontWeight:700,fontSize:15,color:"#fff",padding:"12px 14px 10px 14px",borderBottom:"1px solid rgba(255,255,255,0.15)",whiteSpace:"nowrap"},children:[null!==(Re=null==xe?void 0:xe.title)&&void 0!==Re?Re:"Suggested files to generate this section"," ","(",null!==(Fe=null===(Me=null==xe?void 0:xe.files)||void 0===Me?void 0:Me.length)&&void 0!==Fe?Fe:0,")"]}),e.jsx("ol",{className:a.default.suggestedFilesList,style:{margin:0,padding:"8px 14px 10px 14px",maxHeight:180,overflowY:"auto",listStyle:"none"},children:null===(Le=null==xe?void 0:xe.files)||void 0===Le?void 0:Le.map((t,l)=>e.jsxs("li",{style:{fontSize:14,color:"#CBD5E1",padding:"6px 0",whiteSpace:"nowrap"},children:[l+1,". ",t]},l))})]}),children:e.jsx(l.Info,{size:16,style:{cursor:(null==xe?void 0:xe.isLoading)||!(null===(qe=null==xe?void 0:xe.files)||void 0===qe?void 0:qe.length)?"not-allowed":"pointer",color:"#94A3B8",marginLeft:4,opacity:(null==xe?void 0:xe.isLoading)||!(null===(_e=null==xe?void 0:xe.files)||void 0===_e?void 0:_e.length)?.4:1,transition:"opacity 0.15s ease"},onClick:e=>{var t;e.stopPropagation(),!(null==xe?void 0:xe.isLoading)&&(null===(t=null==xe?void 0:xe.files)||void 0===t?void 0:t.length)&&gl(e=>!e)}})})}),oe&&(El?e.jsx(g.CompletionPanel,{customIcons:null==Xt?void 0:Xt.userStoryIcons,customStyles:null==gt?void 0:gt.aiReasoningCitaionStyles,currentUserStory:U,panelStyles:null==gt?void 0:gt.CompletionStyles,onToggleStateChange:pl,completionPanelConfig:ie,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==wt?void 0:wt.badge,...Ut},children:[e.jsxs("span",{children:[Nl,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(S.default,{color:"currentColor"})}),vl?e.jsx(l.ChevronUp,{size:14,style:null==wt?void 0:wt.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==wt?void 0:wt.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==wt?void 0:wt.badge,...Ut},children:e.jsxs("span",{children:[Nl,"% Completed"]})})),ee&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==xt?void 0:xt.titleEditButton,onClick:e=>{e.stopPropagation(),Wt(!0),Zt||Jt(!0)},"aria-label":"Edit title",title:"Edit title",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("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"})})})]})]}),(tt||void 0!==nt&&void 0!==ot)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==nt&&void 0!==ot&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",nt,"/",ot]}),tt&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==lt||lt()},onMouseEnter:()=>hl(!0),onMouseLeave:()=>hl(!1),className:a.default.statusButton,style:{...null===($e=Mt[tt])||void 0===$e?void 0:$e.default,...ml&&(null===(We=Mt[tt])||void 0===We?void 0:We.hover)},children:E[tt]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==gt?void 0:gt.titleActions,onClick:e=>e.stopPropagation(),children:[(Bl.showProgressPercentage||Bl.showGapBox)&&H&&e.jsxs("div",{className:a.default.progressHeader,style:null==jt?void 0:jt.wrapper,children:[Bl.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==jt?void 0:jt.percentage,children:[null!==(Oe=null!==(ze=null==U?void 0:U.confidenceScore)&&void 0!==ze?ze:null==Bl?void 0:Bl.confidenceValue)&&void 0!==Oe?Oe:"0","%"]}),Bl.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==jt?void 0:jt.gapBox,children:[null!==(Ge=null!==(Ve=null==U?void 0:U.gapValue)&&void 0!==Ve?Ve:null==Bl?void 0:Bl.gapBoxValue)&&void 0!==Ge?Ge:"2"," ","Gaps"]})]}),wl&&e.jsx(f.BigEnoughPanel,{customIcons:null==Xt?void 0:Xt.userStoryIcons,customStyles:null==gt?void 0:gt.aiReasoningCitaionStyles,currentUserStory:U,panelStyles:null==gt?void 0:gt.BigEnoughStyles}),me&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==gt?void 0:gt.iconButton,disabled:he,onClick:e=>{e.stopPropagation(),null==ye||ye(U)},"aria-label":"Assign section users",title:"Assign section users",children:e.jsx(l.Users,{size:16})}),!qt.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==Bl?void 0:Bl.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==gt?void 0:gt.iconButton,onClick:e=>{ll(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:tl,open:!!tl,onClose:()=>ll(null),style:null==gt?void 0:gt.userStoryShareMenu,children:[F&&e.jsx(o.MenuItem,{style:null==gt?void 0:gt.userStoryMenuItem,onClick:async()=>{el(!0),_&&(await Promise.all([_("pdf"),_("doc")]),el(!1))},children:e.jsxs("div",{ref:al,className:a.default.menuItemContent,style:null==gt?void 0:gt.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==gt?void 0:gt.menuIconColor}),e.jsx("p",{style:null==gt?void 0:gt.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==gt?void 0:gt.userStoryMenuItem,onClick:async()=>{let e=U;k&&(e={...U,value:`${d.replaceTitleSection(null==k?void 0:k.value,U.title)} \n${U.value}`}),null==$||$(!0,[e],U.artifactId),xl()},children:e.jsxs("div",{style:null==gt?void 0:gt.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==gt?void 0:gt.menuIconColor}),e.jsx("p",{style:null==gt?void 0:gt.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==gt?void 0:gt.userStoryMenuItem,onClick:async()=>{const e=(new w.default.Converter).makeHtml(r.formatMarkdown(U.value)||U.value),t=function(e){const t=(new w.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(r.formatMarkdown(U.value)||U.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{xl()}},children:e.jsxs("div",{style:null==gt?void 0:gt.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==gt?void 0:gt.menuIconColor}),e.jsx("p",{style:null==gt?void 0:gt.menuLabel,children:"Copy"})]})})]})]}),!il&&qt.userStory&&Zt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==gt?void 0:gt.cancelButton,onClick:()=>{var e,t;if(null===(e=fl.current)||void 0===e||e.abort(),_t(e=>({...e,userStory:!1})),null==mt?void 0:mt.initiateCollaborativeFlow){yt(null);const e={email:(null==ct?void 0:ct.userEmail)||"",operation:"end"};null===(t=null==mt?void 0:mt.onChangeActiveSectionMember)||void 0===t||t.call(mt,e),C.default.emit(`redline-document-edit:${ut}`,e)}}}):e.jsx(e.Fragment,{}),qt.userStory&&Zt?e.jsx(u.default,{type:"fill",children:il?e.jsxs("span",{className:a.default.savingSpinner,style:null==gt?void 0:gt.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==gt?void 0:gt.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:il,style:il?null==gt?void 0:gt.savingButton:null==gt?void 0:gt.saveButton,onClick:async()=>{var e;sl(!0),await bl();let t=await(async()=>{var e,t,l,n,o,i,s,a;let r=Ft.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{await(null==ge?void 0:ge(r,U.artifactId))}catch(e){}try{if(null==ct?void 0:ct.callUpdateDocument){const{updated_reqai:d}=await h.updateRedlineDocument({documentId:ut,sectionId:U.artifactId,baseApiUrl:null==ct?void 0:ct.baseApiUrl,updatedContent:r,userEmail:ct.userEmail,userName:ct.userName,redlineConfigId:null!==(e=ct.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==ct?void 0:ct.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==pt?void 0:pt(d));const u=null===(a=null===(s=null===(i=null==d?void 0:d.artifactData)||void 0===i?void 0:i.userStorySnapshot)||void 0===s?void 0:s[0])||void 0===a?void 0:a.artifactId;"string"==typeof u&&u.trim()&&"string"==typeof ut&&ut.trim()&&"string"==typeof(null==ct?void 0:ct.userName)&&(null==ct?void 0:ct.userName.trim())?C.default.emit(`redline-edit:${ut}:${u}`,{updatedBy:null==ct?void 0:ct.userName}):console.error("invalid cwsEvent name or payload")}}catch(e){console.error("failed to update redline document",e),r=Sl}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 l={...Ft,value:t};if(P({...l,isDefaultEdit:!1}),Cl(l.value),_t(e=>({...e,userStory:!1})),sl(!1),null==mt?void 0:mt.initiateCollaborativeFlow){yt(null);const t={email:(null==ct?void 0:ct.userEmail)||"",operation:"end"};null===(e=null==mt?void 0:mt.onChangeActiveSectionMember)||void 0===e||e.call(mt,t),C.default.emit(`redline-document-edit:${ut}`,t)}}}):!Tl&&!L&&!q&&!ae&&Zt&&!1!==(null==Bl?void 0:Bl.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==gt?void 0:gt.editButton,onClick:()=>{var e;if(null==mt?void 0:mt.initiateCollaborativeFlow){if(ht)return void N.default.error("Please save or cancel current editing section first");{yt(U.artifactId);const t={sectionTitle:U.title,email:(null==ct?void 0:ct.userEmail)||"",operation:"start"};null===(e=null==mt?void 0:mt.onChangeActiveSectionMember)||void 0===e||e.call(mt,t),C.default.emit(`redline-document-edit:${ut}`,t)}}_t(e=>({...e,userStory:!0}))},children:e.jsx(l.PencilIcon,{color:null==gt?void 0:gt.pencilIconColor,size:16})}),(null==mt?void 0:mt.initiateCollaborativeFlow)&&!!Tl&&e.jsx(o.Tooltip,{title:"Fetch latest section",children:e.jsx(l.RefreshCw,{color:Ul?"#d3d3d3":"black",onClick:Rl})}),se&&Dl&&Zt&&!L&&!q&&!1!==(null==Bl?void 0:Bl.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==xt?void 0:xt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=U.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:s.v4(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...U,sub_features:[...null!==(n=U.sub_features)&&void 0!==n?n:[],i]};Lt(a),P(a),Jt(!0),Yt(i.title)},"aria-label":"Add section",title:"Add section",children:[e.jsx(l.Plus,{size:14}),e.jsx("span",{className:a.default.addSectionLabel,children:"Add Section"})]}),!Dl&&!L&&!ae&&!q&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==X||X()},className:a.default.iconButton,style:null==xt?void 0:xt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),Dt&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==St?void 0:St.button,disabled:Tt,onClick:e=>{if(e.stopPropagation(),zt)return Gt(null),void Ot(!1);Gt(structuredClone(null!=Bt?Bt:{})),Jt(!0),Ot(!0)},children:zt?e.jsx(l.X,{size:16,color:null==gt?void 0:gt.pencilIconColor,style:null==St?void 0:St.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==gt?void 0:gt.pencilIconColor,style:null==St?void 0:St.editIcon})}),(null==Bl?void 0:Bl.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==gt?void 0:gt.actionItemBtn,onClick:e=>{e.stopPropagation(),ol(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:nl,open:!!nl,onClose:Il,style:null==gt?void 0:gt.userStoryShareMenu,children:null==Q?void 0:Q.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==gt?void 0:gt.userStoryMenuItem,onClick:()=>{t.onclick(U),Il()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==gt?void 0:gt.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==gt?void 0:gt.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==gt?void 0:gt.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==gt?void 0:gt.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),jl()},style:null==gt?void 0:gt.chevronButton,className:a.default.chevronButton,children:Zt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==gt?void 0:gt.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==gt?void 0:gt.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==gt?void 0:gt.dividerStyle})]}),Zt&&e.jsx("div",{className:a.default.cardContent,style:{...null==gt?void 0:gt.cardContentStyle,borderTop:le?"1px solid #E5E5E5":"none"},children:Ke?e.jsxs("div",{className:a.default.loadingContainer,children:[e.jsx("div",{className:a.default.loadingIconWrapper,children:e.jsx(l.Hourglass,{size:28,color:"#5B3DF5",className:a.default.spinAnimation})}),e.jsxs("div",{children:[e.jsx("h3",{className:a.default.loadingTitle,children:"Section generation in progress.."}),e.jsx("p",{className:a.default.loadingSubtitle,children:"This may take a few minutes"})]}),e.jsx("button",{type:"button",onClick:()=>null==et?void 0:et(),className:a.default.viewStatusButton,children:"View Status"})]}):it?e.jsxs("div",{className:a.default.noDataContainer,style:null==Nt?void 0:Nt.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==Nt?void 0:Nt.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==Nt?void 0:Nt.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==Nt?void 0:Nt.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}):e.jsxs("div",{className:a.default.contentInner,style:null==gt?void 0:gt.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==gt?void 0:gt.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==gt?void 0:gt.justifyBetween}),qt.userStory?e.jsx(c.default,{ref:dl,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(Sl)||"",handleUpdateState:(e,t)=>{const l=d.postprocessUserStoryAfterEdit(r.indentMarkdown(t));Lt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:qt.userStory?"edit":"readOnly",onEditBlocked:dt,onSaveUnsavedChanges:async()=>{await bl(),Jt(!1)},onDiscardUnsavedChanges:()=>{Lt({...structuredClone(U),value:r.formatMarkdown(U.value)||""}),_t(e=>({...e,userStory:!1})),Jt(!1)},isSavingUnsavedChanges:il}):Dt?e.jsx(y.default,{styles:bt,fields:At,readonly:!zt,isSaving:kt,value:null!==(He=null!=Vt?Vt:Bt)&&void 0!==He?He:{},onChange:Gt,onSave:async()=>{var e;Vt&&(await(null===(e=null==vt?void 0:vt.onSave)||void 0===e?void 0:e.call(vt,U,Vt)),Gt(null),Ot(!1))},onCancel:()=>{Gt(null),Ot(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:q,isParent:""===R,message:r.formatMarkdown(U.value)||"",artifactId:U.artifactId,customStyles:It,isDisplayHighlightControl:O,contextVariant:Z,showConfidenceScore:te,CDNeededInChip:ce,blockId:ve,storyId:pe,showWaitingIconInChip:fe}),(de||ue)&&e.jsxs("div",{className:a.default.actionButtonsContainer,style:null==Et?void 0:Et.container,children:[ue&&!qt.userStory&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:a.default.actionButton,style:null==Et?void 0:Et.button,disabled:ue.disabled||ue.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=ue.onClick)||void 0===t||t.call(ue),_t(e=>({...e,userStory:!0})),Jt(!0)},children:ue.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==Et?void 0:Et.icon}),e.jsx("span",{style:null==Et?void 0:Et.text,children:null!==(Ye=ue.label)&&void 0!==Ye?Ye:"Edit"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.PencilIcon,{size:16,style:null==Et?void 0:Et.icon}),e.jsx("span",{style:null==Et?void 0:Et.text,children:null!==(Qe=ue.label)&&void 0!==Qe?Qe:"Edit"})]})}),de&&e.jsx("span",{className:a.default.actionButtonDivider})]}),de&&e.jsx("button",{type:"button",className:a.default.actionButton,style:null==Et?void 0:Et.button,disabled:de.disabled||de.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=de.onClick)||void 0===t||t.call(de)},children:de.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==Et?void 0:Et.icon}),e.jsx("span",{style:null==Et?void 0:Et.text,children:null!==(Xe=de.label)&&void 0!==Xe?Xe:"Approve"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Check,{size:16,style:null==Et?void 0:Et.icon}),e.jsx("span",{style:null==Et?void 0:Et.text,children:null!==(Ze=de.label)&&void 0!==Ze?Ze:"Approve"})]})})]})]})]}),null===(Je=Ft.sub_features)||void 0===Je?void 0:Je.map((t,l)=>{console.log("UserStoryCardWrapper: sub",t);const o=B(V,!1,t.artifactId);return e.jsx(T,{artifactId:I,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${b}-${String.fromCharCode(65+l)}`,parentUserStory:U,parentIndex:`${R}${R&&"."}${M}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...U.sub_features||[]];l[e]=t,P({...U,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:L,showUserStoryDiff:q,updateUserStoryArtifact:W,handleDownloadUserStory:_,handleOpenSendDialog:$,isDisplayHighlightControl:O,elementDisplayConfig:V,_resolvedConfig:o,actionItemsConfig:Q,onDelete:()=>(e=>{const t=(U.sub_features||[]).filter((t,l)=>l!==e),l={...U,sub_features:t};Lt(l),P(l)})(l),expandedSubFeatures:J,disableEditPlan:ae,useMuiTooltip:re,storyNumber:t.storyNumber,blockNumber:t.blockNumber,onUserStoryAccordionStateChange:Se,showAssignSection:me,onAssignSectionClick:ye,onSave:ge},t.artifactId)})]})})]})};exports.StoryCard=T,exports.UserStoryCardWrapper=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:y,showWrapper:g,actionItemsConfig:S,contextVariant:C,showDisplayName:I,allowTitleEdit:j,showConfidenceScore:b,showBorderTop:w,defaultExpanded:N,showCompletionPanel:E=!1,completionPanelConfig:D,showAddSectionButton:A=!1,disableEditPlan:k=!1,useMuiTooltip:U=!1,approveButtonConfig:P,editButtonConfig:R,CDNeededInChip:M,showWaitingIconInChip:F,setRedlineDocumentIdParent:L,showAssignSection:q,onAssignSectionClick:_,disableAssignSection:$,onSave:W,onUserStoryAccordionStateChange:z,showSuggestedFilesInfo:O,suggestedFilesConfig:V,onChangeActiveDocumentMembers:G})=>{const{userStory:H,setUserStory:Y,customStyles:Q,searchQueryList:X,currentHighlightIndex:Z,setCurrentHighlightIndex:J,segmentComponentConfig:K,sectionStatusConfig:ee,redlineConfig:te,setRedlineDocumentId:le,redlineDcoumentId:ne,redlineCollaborativeConfig:oe}=p.useRequirementAI(),ie=null==Q?void 0:Q.userStoryCardStyles,se=0===Z,ae=Z===X.length-1;return t.useEffect(()=>{if(!(null==te?void 0:te.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await h.getRedlineDocumentId({baseApiUrl:te.documentBaseApiUrl||"",comparisonId:te.documentComparisonId||""});if(t)le(t);else{const{document_id:t}=await h.createRedlineDocument({baseApiUrl:te.baseApiUrl,changelogConfigId:te.changelogConfigId,comparisonId:te.documentComparisonId,artifactId:te.artifactId,inputData:te.inputData,redlineConfigId:te.redlineConfigId,userEmail:te.userEmail,userName:te.userName},null!==(e=null==te?void 0:te.token)&&void 0!==e?e:"");t&&(le(t),null==L||L(t))}})()},[]),x.default(`redline-document-edit:${ne}`,({sectionTitle:e,email:t,operation:l})=>{var n;null===(n=null==oe?void 0:oe.onChangeActiveSectionMember)||void 0===n||n.call(oe,{email:t,operation:l,sectionTitle:e})},({activeMembers:e})=>null==G?void 0:G(e)),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:m?{...null==ie?void 0:ie.userStoryCardWrapper,position:"relative"}:null==ie?void 0:ie.userStoryCardWrapper,children:[m&&e.jsx(e.Fragment,{children:X.length>0&&e.jsx("div",{className:a.default.wrapper,children:e.jsx("div",{className:a.default.highlightNavigation,children:e.jsxs("div",{className:a.default.navigationContainer,children:[e.jsxs("span",{className:a.default.navCounter,children:[Z+1," of ",X.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{Z>0&&J(e=>e-1)},className:a.default.navButton,disabled:se,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{Z<X.length-1&&J(e=>e+1)},className:a.default.navButton,disabled:ae,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),H.map((t,l)=>{console.log("UserStoryCardWrapper: userstory",t);const a=B(y,!0);return e.jsx(T,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{Y(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:y,_resolvedConfig:a,showWrapper:g,defaultExpanded:N,actionItemsConfig:S,contextVariant:C,showDisplayName:I,allowTitleEdit:j,showConfidenceScore:b,showBorderTop:w,sectionStatusConfig:ee,showCompletionPanel:E,completionPanelConfig:D,showAddSectionButton:A,disableEditPlan:k,useMuiTooltip:U,approveButtonConfig:P,CDNeededInChip:M,editButtonConfig:R,storyNumber:t.storyNumber,blockNumber:t.blockNumber,onUserStoryAccordionStateChange:z,showSuggestedFilesInfo:O,suggestedFilesConfig:V,showWaitingIconInChip:F,showAssignSection:q,disableAssignSection:$,onAssignSectionClick:_,onSave:W},t.artifactId)})]})},exports.default=T,exports.replaceLearnedTagsWithInfo=D;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("lucide-react"),n=require("showdown"),o=require("@mui/material"),i=require("../../icons/Illustration.svg.js"),s=require("uuid"),a=require("./UserStoryCard.module.css.js"),r=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),u=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),v=require("../userstory-with-citation/UserStoryWithCitation.js"),p=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../story-screen/BigEnoughPanel.js"),m=require("./TitleEditor/TitleEditor.js"),h=require("../../../../service/redlineService.js"),y=require("./ClinicalTrialSection.js"),g=require("../story-screen/CompletionPanel.js"),S=require("../../icons/CDIcon.js"),C=require("./cws/CwsEvent.js"),x=require("./cws/useCwsEvent.js"),I=require("react-hot-toast"),j=require("./Popups/RedlineToast.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=b(n),N=b(I);const E={[p.SectionStatus.WAITING]:"WAITING TO GENERATE",[p.SectionStatus.IN_PROGRESS]:"IN PROGRESS",[p.SectionStatus.GENERATED]:"GENERATED",[p.SectionStatus.FAILED]:"FAILED",[p.SectionStatus.GENERATE]:"GENERATE",[p.SectionStatus.APPROVED]:"APPROVED"};function D(t){const n=[],i=/<learned>(.*?)<\/learned>/g;let a,r=0,d=0;for(;null!==(a=i.exec(t));){const[,u]=a,c=a.index;c>r&&n.push(e.jsx("span",{children:t.slice(r,c)},"text-pre-"+d++)),n.push(e.jsx(o.Tooltip,{title:u,placement:"top",children:e.jsx(l.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${s.v4()}`)),r=i.lastIndex}return r<(null==t?void 0:t.length)&&n.push(e.jsx("span",{children:t.slice(r)},"text-post-"+d++)),n}function A(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 B=({displayName:t})=>{var n;const{customStyles:o}=p.useRequirementAI(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e.jsxs("div",{className:a.default.displayName,style:null==i?void 0:i.wrapper,children:[e.jsx(l.Bookmark,{className:a.default.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e.jsxs("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},T=({isUserStoryCurrentlyUpdated:n,artifactId:I,artifactTitleId:b,parentUserStory:k,currentUserStory:U,onUserStoryChange:P,parentIndex:R,currentIndex:M,enableDownload:F,isDiffEditReviewMode:L,showUserStoryDiff:q,handleDownloadUserStory:_,handleOpenSendDialog:$,updateUserStoryArtifact:W,selectedArtifactId:z,isDisplayHighlightControl:O,elementDisplayConfig:V,_resolvedConfig:G,showWrapper:H=!1,defaultExpanded:Y,actionItemsConfig:Q,onDelete:X,contextVariant:Z,expandedSubFeatures:J,showDisplayName:K=!0,allowTitleEdit:ee=!0,showConfidenceScore:te=!0,showBorderTop:le=!0,sectionStatusConfig:ne,showCompletionPanel:oe=!1,completionPanelConfig:ie,showAddSectionButton:se=!1,disableEditPlan:ae=!1,useMuiTooltip:re=!1,approveButtonConfig:de,editButtonConfig:ue,CDNeededInChip:ce,blockNumber:ve,storyNumber:pe,showWaitingIconInChip:fe,showAssignSection:me=!1,disableAssignSection:he=!1,onAssignSectionClick:ye,onSave:ge,onUserStoryAccordionStateChange:Se,showSuggestedFilesInfo:Ce=!1,suggestedFilesConfig:xe,menuActions:Ie})=>{var je,be,we,Ne,Ee,De,Ae,Be,Te,ke,Ue,Pe,Re,Me,Fe,Le,qe,_e,$e,We,ze,Oe,Ve,Ge,He,Ye,Qe,Xe,Ze,Je,Ke;const{isLoadingSectionData:et=!1,onLoadSectionData:tt,status:lt,onStatusClick:nt,completedCount:ot,totalCount:it,isNoDataAvailable:st=!1}=null!=ne?ne:{},{searchQueryList:at,citations:rt,customStyles:dt,onEditBlocked:ut,redlineDcoumentId:ct,redlineConfig:vt,customSectionConfig:pt,updateRedlineDataParent:ft,aiReasoning:mt,redlineCollaborativeConfig:ht,selectedSectionToEdit:yt,setSelectedSectionToEdit:gt}=p.useRequirementAI(),St=null==dt?void 0:dt.userStoryCardStyles,Ct=null==St?void 0:St.customSectionEditButton,xt=null==St?void 0:St.statusStyles,It=null===(je=null==dt?void 0:dt.userStoryCardStyles)||void 0===je?void 0:je.userStoryEditStyles,jt=null===(be=null==dt?void 0:dt.userStoryScreenStyles)||void 0===be?void 0:be.userStoryContentStyles,bt=null==St?void 0:St.progressHeaderStyles,wt=null==St?void 0:St.clinicalTrialSectionStyles,Nt=null==St?void 0:St.CompletionStyles,Et=null==St?void 0:St.noDataStyles,Dt=null==St?void 0:St.approveButtonStyles;null==St||St.suggestedFilesStyles;const At=null!==(Ne=null===(we=null==pt?void 0:pt.shouldRender)||void 0===we?void 0:we.call(pt,U))&&void 0!==Ne&&Ne,Bt=null===(Ee=null==pt?void 0:pt.getValue)||void 0===Ee?void 0:Ee.call(pt,U),Tt=null!==(Ae=null===(De=null==pt?void 0:pt.getFields)||void 0===De?void 0:De.call(pt,U))&&void 0!==Ae?Ae:[],kt=null!==(Be=null==pt?void 0:pt.isEditDisabled)&&void 0!==Be&&Be,Ut=null!==(ke=null===(Te=null==pt?void 0:pt.isSaving)||void 0===Te?void 0:Te.call(pt,U))&&void 0!==ke&&ke,Pt=(Rt=null!==(Ue=U.completion_percentage)&&void 0!==Ue?Ue:0,Mt=Nt,Rt>=80?null==Mt?void 0:Mt.highCompletion:Rt>=50?null==Mt?void 0:Mt.mediumCompletion:null==Mt?void 0:Mt.lowCompletion);var Rt,Mt;const Ft={[p.SectionStatus.WAITING]:null==xt?void 0:xt.waiting,[p.SectionStatus.IN_PROGRESS]:null==xt?void 0:xt.inProgress,[p.SectionStatus.GENERATED]:null==xt?void 0:xt.generated,[p.SectionStatus.FAILED]:null==xt?void 0:xt.failed,[p.SectionStatus.GENERATE]:null==xt?void 0:xt.generate,[p.SectionStatus.APPROVED]:null==xt?void 0:xt.approved},[Lt,qt]=t.useState({...structuredClone(U),value:r.formatMarkdown(U.value)||""}),[_t,$t]=t.useState({userStory:!!U.isDefaultEdit}),[Wt,zt]=t.useState(!1),[Ot,Vt]=t.useState(!1),[Gt,Ht]=t.useState(null),[Yt,Qt]=t.useState(null),{userStory:Xt,customIcons:Zt}=p.useRequirementAI(),[Jt,Kt]=t.useState(null!=Y?Y:""===R||z===U.artifactId||!!U.isDefaultOpen),[el,tl]=t.useState(!1),[ll,nl]=t.useState(null),[ol,il]=t.useState(null),[sl,al]=t.useState(!1),rl=t.useRef(null),dl=t.useRef(null),ul=t.useRef(null),[cl,vl]=t.useState(!1),[pl,fl]=t.useState(!1),ml=t.useRef(null),[hl,yl]=t.useState(!1),[gl,Sl]=t.useState(!1),[Cl,xl]=t.useState(U.value);t.useEffect(()=>{n&&Kt(n)},[n]),t.useEffect(()=>{qt({...structuredClone(U),value:r.formatMarkdown(U.value)||""})},[U]),t.useEffect(()=>{at.length>0?Kt(!0):void 0===Y&&z&&Kt(z===U.artifactId)},[at,z,U.artifactId]),t.useEffect(()=>{J&&J.length>0&&pe&&ve&&Kt(J.includes(`${pe}-${ve}`)||""===R||z===U.artifactId||!!U.isDefaultOpen)},[J,pe,ve]),t.useEffect(()=>{if(!gl)return;const e=e=>{dl.current&&!dl.current.contains(e.target)&&Sl(!1)};return document.addEventListener("mousedown",e,!0),()=>{document.removeEventListener("mousedown",e,!0)}},[gl]);const Il=()=>{nl(null)},jl=()=>{il(null)},bl=()=>{if(Jt&&_t.userStory&&ul.current&&!ul.current.requestClose())return;const e=!Jt;Kt(e),null==Se||Se(U,e)},wl=async()=>{var e,t;try{"userStory"==="userStory"&&(P(Lt),console.log("I am changing RTE editor values",Lt)),await(null===(e=null==ue?void 0:ue.onSaveEditedSection)||void 0===e?void 0:e.call(ue,Lt)),await W(rt,Xt,I,null===(t=ml.current)||void 0===t?void 0:t.signal)}finally{}};const Nl=null!=(null==U?void 0:U.big_enough)&&!Number.isNaN(U.big_enough)&&!!(null==U?void 0:U.big_enough_decision_factors),El=null!==(Pe=null==U?void 0:U.completion_percentage)&&void 0!==Pe?Pe:0,Dl=!!(null==U?void 0:U.completion_decision_factors),Al=""===R,Bl=null!=G?G:A(V,Al),Tl=!L&&!q;t.useEffect(()=>{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]);const[kl,Ul]=t.useState(0),[Pl,Rl]=t.useState(!1),Ml=async()=>{var e,t;let l=!0;if(Rl(e=>(l=!e,!0)),l){let l;Ul(e=>(l=e,e));try{const{updated_reqai:n}=await h.fetchRedlineDocumentSection({documentId:ct,sectionId:U.artifactId,baseApiUrl:null==vt?void 0:vt.editorBaseApiUrl,redlineConfigId:null!==(e=null==vt?void 0:vt.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==vt?void 0:vt.token)&&void 0!==t?t:"");await(null==ft?void 0:ft(n)),Ul(e=>l===e?0:1)}catch(e){console.error("failed to fetch latest user story: ",e),N.default.error("Failed to fetch the latest user story. Please try again.")}Rl(!1)}};t.useEffect(()=>{U.isDefaultEdit&&$t(e=>({...e,userStory:!0}))},[U.isDefaultEdit]),console.log("block number in userstory card ",ve),console.log("[TESTING-CURRENT-USER-STORY] \n",U,"\n[TESTING-USER-STORY] \n",Xt),x.default(`redline-edit:${ct}:${U.artifactId}`,async({updatedBy:t})=>{var l;null===(l=ml.current)||void 0===l||l.abort(),Ul(e=>e+1),$t(l=>l.userStory?(N.default.custom(l=>e.jsxs(j.default,{onCancel:()=>N.default.dismiss(l.id),onRefresh:()=>{N.default.dismiss(l.id),Ml()},children:["This ",e.jsx("span",{style:{fontWeight:600},children:U.title})," section has been updated by ",e.jsx("span",{style:{fontWeight:600},children:t})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:p.ToasterId}),{...Xt,userStory:!1}):(Ml().then(()=>{N.default.custom(l=>e.jsxs(j.default,{onCancel:()=>N.default.dismiss(l.id),title:e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontWeight:600},children:U.title})," updated,",e.jsx("br",{})]}),children:[t," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:p.ToasterId})}),l))});return t.useEffect(()=>xl(U.value),[U.value]),e.jsxs("div",{className:a.default.card,"data-block-id":`user-story-card-wrapper-${pe}-${ve}`,style:null==St?void 0:St.cardStyle,id:`story-card-${U.title}`,"data-expanded":Jt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==St?void 0:St.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==St?void 0:St.titleRow,onClick:bl,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==St?void 0:St.titleLeft,onMouseEnter:()=>vl(!0),onMouseLeave:()=>vl(!1),children:[K&&e.jsx(B,{displayName:b}),Wt&&Tl?e.jsx(m.InlineTitleEditor,{title:U.title,onSave:e=>(async(e,t)=>{var l;try{let n={...U};U.artifactId===t?n.title=e:n.sub_features=(null===(l=U.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],qt(n),P(n),zt(!1)}catch(e){console.error("Failed to save title",e)}})(e,U.artifactId),onCancel:()=>{zt(!1)},inputStyle:null==It?void 0:It.inlineTitleInput,confirmButtonStyle:null==It?void 0:It.inlineTitleConfirm,cancelButtonStyle:null==It?void 0:It.inlineTitleCancel},"inline-title-editor"):e.jsxs("div",{className:a.default.storyTitleWrapper,children:[e.jsx(o.Tooltip,{title:D(U.title),arrow:!0,children:e.jsx("h2",{title:re?void 0:U.title,className:a.default.storyTitle,style:null==St?void 0:St.storyTitle,children:D(U.title)},U.artifactId)}),Ce&&!At&&e.jsx("div",{ref:dl,style:{display:"inline-flex"},children:e.jsx(o.Tooltip,{open:gl&&!(null==xe?void 0:xe.isLoading)&&!!(null===(Re=null==xe?void 0:xe.files)||void 0===Re?void 0:Re.length),disableHoverListener:!0,disableFocusListener:!0,disableTouchListener:!0,placement:"bottom",PopperProps:{disablePortal:!0},arrow:!0,componentsProps:{tooltip:{className:a.default.suggestedFilesTooltip,sx:{backgroundColor:"#334155",color:"#fff",maxWidth:400,padding:0,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},arrow:{sx:{color:"#334155"}}},title:e.jsxs("div",{onClick:e=>e.stopPropagation(),children:[e.jsxs("div",{style:{fontWeight:700,fontSize:15,color:"#fff",padding:"12px 14px 10px 14px",borderBottom:"1px solid rgba(255,255,255,0.15)",whiteSpace:"nowrap"},children:[null!==(Me=null==xe?void 0:xe.title)&&void 0!==Me?Me:"Suggested files to generate this section"," ","(",null!==(Le=null===(Fe=null==xe?void 0:xe.files)||void 0===Fe?void 0:Fe.length)&&void 0!==Le?Le:0,")"]}),e.jsx("ol",{className:a.default.suggestedFilesList,style:{margin:0,padding:"8px 14px 10px 14px",maxHeight:180,overflowY:"auto",listStyle:"none"},children:null===(qe=null==xe?void 0:xe.files)||void 0===qe?void 0:qe.map((t,l)=>e.jsxs("li",{style:{fontSize:14,color:"#CBD5E1",padding:"6px 0",whiteSpace:"nowrap"},children:[l+1,". ",t]},l))})]}),children:e.jsx(l.Info,{size:16,style:{cursor:(null==xe?void 0:xe.isLoading)||!(null===(_e=null==xe?void 0:xe.files)||void 0===_e?void 0:_e.length)?"not-allowed":"pointer",color:"#94A3B8",marginLeft:4,opacity:(null==xe?void 0:xe.isLoading)||!(null===($e=null==xe?void 0:xe.files)||void 0===$e?void 0:$e.length)?.4:1,transition:"opacity 0.15s ease"},onClick:e=>{var t;e.stopPropagation(),!(null==xe?void 0:xe.isLoading)&&(null===(t=null==xe?void 0:xe.files)||void 0===t?void 0:t.length)&&Sl(e=>!e)}})})}),oe&&(Dl?e.jsx(g.CompletionPanel,{customIcons:null==Zt?void 0:Zt.userStoryIcons,customStyles:null==St?void 0:St.aiReasoningCitaionStyles,currentUserStory:U,panelStyles:null==St?void 0:St.CompletionStyles,onToggleStateChange:fl,completionPanelConfig:ie,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Nt?void 0:Nt.badge,...Pt},children:[e.jsxs("span",{children:[El,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(S.default,{color:"currentColor"})}),pl?e.jsx(l.ChevronUp,{size:14,style:null==Nt?void 0:Nt.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==Nt?void 0:Nt.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Nt?void 0:Nt.badge,...Pt},children:e.jsxs("span",{children:[El,"% Completed"]})})),ee&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==It?void 0:It.titleEditButton,onClick:e=>{e.stopPropagation(),zt(!0),Jt||Kt(!0)},"aria-label":"Edit title",title:"Edit title",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("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"})})})]})]}),(lt||void 0!==ot&&void 0!==it)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==ot&&void 0!==it&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",ot,"/",it]}),lt&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==nt||nt()},onMouseEnter:()=>yl(!0),onMouseLeave:()=>yl(!1),className:a.default.statusButton,style:{...null===(We=Ft[lt])||void 0===We?void 0:We.default,...hl&&(null===(ze=Ft[lt])||void 0===ze?void 0:ze.hover)},children:E[lt]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==St?void 0:St.titleActions,onClick:e=>e.stopPropagation(),children:[(Bl.showProgressPercentage||Bl.showGapBox)&&H&&e.jsxs("div",{className:a.default.progressHeader,style:null==bt?void 0:bt.wrapper,children:[Bl.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==bt?void 0:bt.percentage,children:[null!==(Ve=null!==(Oe=null==U?void 0:U.confidenceScore)&&void 0!==Oe?Oe:null==Bl?void 0:Bl.confidenceValue)&&void 0!==Ve?Ve:"0","%"]}),Bl.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==bt?void 0:bt.gapBox,children:[null!==(He=null!==(Ge=null==U?void 0:U.gapValue)&&void 0!==Ge?Ge:null==Bl?void 0:Bl.gapBoxValue)&&void 0!==He?He:"2"," ","Gaps"]})]}),Nl&&e.jsx(f.BigEnoughPanel,{customIcons:null==Zt?void 0:Zt.userStoryIcons,customStyles:null==St?void 0:St.aiReasoningCitaionStyles,currentUserStory:U,panelStyles:null==St?void 0:St.BigEnoughStyles}),me&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==St?void 0:St.iconButton,disabled:he,onClick:e=>{e.stopPropagation(),null==ye||ye(U)},"aria-label":"Assign section users",title:"Assign section users",children:e.jsx(l.Users,{size:16})}),!_t.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==Bl?void 0:Bl.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==St?void 0:St.iconButton,onClick:e=>{nl(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:ll,open:!!ll,onClose:()=>nl(null),style:null==St?void 0:St.userStoryShareMenu,children:[F&&e.jsx(o.MenuItem,{style:null==St?void 0:St.userStoryMenuItem,onClick:async()=>{tl(!0),_&&(await Promise.all([_("pdf"),_("doc")]),tl(!1))},children:e.jsxs("div",{ref:rl,className:a.default.menuItemContent,style:null==St?void 0:St.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==St?void 0:St.menuIconColor}),e.jsx("p",{style:null==St?void 0:St.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==St?void 0:St.userStoryMenuItem,onClick:async()=>{let e=U;k&&(e={...U,value:`${d.replaceTitleSection(null==k?void 0:k.value,U.title)} \n${U.value}`}),null==$||$(!0,[e],U.artifactId),Il()},children:e.jsxs("div",{style:null==St?void 0:St.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==St?void 0:St.menuIconColor}),e.jsx("p",{style:null==St?void 0:St.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==St?void 0:St.userStoryMenuItem,onClick:async()=>{const e=(new w.default.Converter).makeHtml(r.formatMarkdown(U.value)||U.value),t=function(e){const t=(new w.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(r.formatMarkdown(U.value)||U.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{Il()}},children:e.jsxs("div",{style:null==St?void 0:St.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==St?void 0:St.menuIconColor}),e.jsx("p",{style:null==St?void 0:St.menuLabel,children:"Copy"})]})})]})]}),!sl&&_t.userStory&&Jt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==St?void 0:St.cancelButton,onClick:()=>{var e,t;if(null===(e=ml.current)||void 0===e||e.abort(),$t(e=>({...e,userStory:!1})),null==ht?void 0:ht.initiateCollaborativeFlow){gt(null);const e={email:(null==vt?void 0:vt.userEmail)||"",operation:"end"};null===(t=null==ht?void 0:ht.onChangeActiveSectionMember)||void 0===t||t.call(ht,e),C.default.emit(`redline-document-edit:${ct}`,e)}}}):e.jsx(e.Fragment,{}),_t.userStory&&Jt?e.jsx(u.default,{type:"fill",children:sl?e.jsxs("span",{className:a.default.savingSpinner,style:null==St?void 0:St.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==St?void 0:St.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:sl,style:sl?null==St?void 0:St.savingButton:null==St?void 0:St.saveButton,onClick:async()=>{var e;al(!0),await wl();let t=await(async()=>{var e,t,l,n,o,i,s,a;let r=Lt.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{await(null==ge?void 0:ge(r,U.artifactId))}catch(e){}try{if(null==vt?void 0:vt.callUpdateDocument){const{updated_reqai:d}=await h.updateRedlineDocument({documentId:ct,sectionId:U.artifactId,baseApiUrl:null==vt?void 0:vt.baseApiUrl,updatedContent:r,userEmail:vt.userEmail,userName:vt.userName,redlineConfigId:null!==(e=vt.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==vt?void 0:vt.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==ft?void 0:ft(d));const u=null===(a=null===(s=null===(i=null==d?void 0:d.artifactData)||void 0===i?void 0:i.userStorySnapshot)||void 0===s?void 0:s[0])||void 0===a?void 0:a.artifactId;"string"==typeof u&&u.trim()&&"string"==typeof ct&&ct.trim()&&"string"==typeof(null==vt?void 0:vt.userName)&&(null==vt?void 0:vt.userName.trim())?C.default.emit(`redline-edit:${ct}:${u}`,{updatedBy:null==vt?void 0:vt.userName}):console.error("invalid cwsEvent name or payload")}}catch(e){console.error("failed to update redline document",e),r=Cl}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 l={...Lt,value:t};if(P({...l,isDefaultEdit:!1}),xl(l.value),$t(e=>({...e,userStory:!1})),al(!1),null==ht?void 0:ht.initiateCollaborativeFlow){gt(null);const t={email:(null==vt?void 0:vt.userEmail)||"",operation:"end"};null===(e=null==ht?void 0:ht.onChangeActiveSectionMember)||void 0===e||e.call(ht,t),C.default.emit(`redline-document-edit:${ct}`,t)}}}):!kl&&!L&&!q&&!ae&&Jt&&!1!==(null==Bl?void 0:Bl.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==St?void 0:St.editButton,onClick:()=>{var e;if(null==ht?void 0:ht.initiateCollaborativeFlow){if(yt)return void N.default.error("Please save or cancel current editing section first");{gt(U.artifactId);const t={sectionTitle:U.title,email:(null==vt?void 0:vt.userEmail)||"",operation:"start"};null===(e=null==ht?void 0:ht.onChangeActiveSectionMember)||void 0===e||e.call(ht,t),C.default.emit(`redline-document-edit:${ct}`,t)}}$t(e=>({...e,userStory:!0}))},children:e.jsx(l.PencilIcon,{color:null==St?void 0:St.pencilIconColor,size:16})}),(null==ht?void 0:ht.initiateCollaborativeFlow)&&!!kl&&e.jsx(o.Tooltip,{title:"Fetch latest section",children:e.jsx(l.RefreshCw,{color:Pl?"#d3d3d3":"black",onClick:Ml})}),se&&Al&&Jt&&!L&&!q&&!1!==(null==Bl?void 0:Bl.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==It?void 0:It.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=U.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:s.v4(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...U,sub_features:[...null!==(n=U.sub_features)&&void 0!==n?n:[],i]};qt(a),P(a),Kt(!0),Qt(i.title)},"aria-label":"Add section",title:"Add section",children:[e.jsx(l.Plus,{size:14}),e.jsx("span",{className:a.default.addSectionLabel,children:"Add Section"})]}),!Al&&!L&&!ae&&!q&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==X||X()},className:a.default.iconButton,style:null==It?void 0:It.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),At&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==Ct?void 0:Ct.button,disabled:kt,onClick:e=>{if(e.stopPropagation(),Ot)return Ht(null),void Vt(!1);Ht(structuredClone(null!=Bt?Bt:{})),Kt(!0),Vt(!0)},children:Ot?e.jsx(l.X,{size:16,color:null==St?void 0:St.pencilIconColor,style:null==Ct?void 0:Ct.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==St?void 0:St.pencilIconColor,style:null==Ct?void 0:Ct.editIcon})}),(null==Bl?void 0:Bl.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==St?void 0:St.actionItemBtn,onClick:e=>{e.stopPropagation(),il(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:ol,open:!!ol,onClose:jl,style:null==St?void 0:St.userStoryShareMenu,children:null==Q?void 0:Q.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==St?void 0:St.userStoryMenuItem,onClick:()=>{t.onclick(U),jl()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==St?void 0:St.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==St?void 0:St.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==St?void 0:St.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==St?void 0:St.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),bl()},style:null==St?void 0:St.chevronButton,className:a.default.chevronButton,children:Jt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==St?void 0:St.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==St?void 0:St.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==St?void 0:St.dividerStyle})]}),Jt&&e.jsx("div",{className:a.default.cardContent,style:{...null==St?void 0:St.cardContentStyle,borderTop:le?"1px solid #E5E5E5":"none"},children:et?e.jsxs("div",{className:a.default.loadingContainer,children:[e.jsx("div",{className:a.default.loadingIconWrapper,children:e.jsx(l.Hourglass,{size:28,color:"#5B3DF5",className:a.default.spinAnimation})}),e.jsxs("div",{children:[e.jsx("h3",{className:a.default.loadingTitle,children:"Section generation in progress.."}),e.jsx("p",{className:a.default.loadingSubtitle,children:"This may take a few minutes"})]}),e.jsx("button",{type:"button",onClick:()=>null==tt?void 0:tt(),className:a.default.viewStatusButton,children:"View Status"})]}):st?e.jsxs("div",{className:a.default.noDataContainer,style:null==Et?void 0:Et.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==Et?void 0:Et.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==Et?void 0:Et.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==Et?void 0:Et.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}):e.jsxs("div",{className:a.default.contentInner,style:null==St?void 0:St.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==St?void 0:St.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==St?void 0:St.justifyBetween}),_t.userStory?e.jsx(c.default,{ref:ul,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(Cl)||"",handleUpdateState:(e,t)=>{const l=d.postprocessUserStoryAfterEdit(r.indentMarkdown(t));qt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:_t.userStory?"edit":"readOnly",onEditBlocked:ut,onSaveUnsavedChanges:async()=>{await wl(),Kt(!1)},onDiscardUnsavedChanges:()=>{qt({...structuredClone(U),value:r.formatMarkdown(U.value)||""}),$t(e=>({...e,userStory:!1})),Kt(!1)},isSavingUnsavedChanges:sl}):At?e.jsx(y.default,{styles:wt,fields:Tt,readonly:!Ot,isSaving:Ut,value:null!==(Ye=null!=Gt?Gt:Bt)&&void 0!==Ye?Ye:{},onChange:Ht,onSave:async()=>{var e;Gt&&(await(null===(e=null==pt?void 0:pt.onSave)||void 0===e?void 0:e.call(pt,U,Gt)),Ht(null),Vt(!1))},onCancel:()=>{Ht(null),Vt(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:q,isParent:""===R,message:r.formatMarkdown(U.value)||"",artifactId:U.artifactId,customStyles:jt,isDisplayHighlightControl:O,contextVariant:Z,showConfidenceScore:te,CDNeededInChip:ce,blockId:ve,storyId:pe,showWaitingIconInChip:fe,menuActions:Ie}),(de||ue)&&e.jsxs("div",{className:a.default.actionButtonsContainer,style:null==Dt?void 0:Dt.container,children:[ue&&!_t.userStory&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:a.default.actionButton,style:null==Dt?void 0:Dt.button,disabled:ue.disabled||ue.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=ue.onClick)||void 0===t||t.call(ue),$t(e=>({...e,userStory:!0})),Kt(!0)},children:ue.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==Dt?void 0:Dt.icon}),e.jsx("span",{style:null==Dt?void 0:Dt.text,children:null!==(Qe=ue.label)&&void 0!==Qe?Qe:"Edit"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.PencilIcon,{size:16,style:null==Dt?void 0:Dt.icon}),e.jsx("span",{style:null==Dt?void 0:Dt.text,children:null!==(Xe=ue.label)&&void 0!==Xe?Xe:"Edit"})]})}),de&&e.jsx("span",{className:a.default.actionButtonDivider})]}),de&&e.jsx("button",{type:"button",className:a.default.actionButton,style:null==Dt?void 0:Dt.button,disabled:de.disabled||de.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=de.onClick)||void 0===t||t.call(de)},children:de.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==Dt?void 0:Dt.icon}),e.jsx("span",{style:null==Dt?void 0:Dt.text,children:null!==(Ze=de.label)&&void 0!==Ze?Ze:"Approve"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Check,{size:16,style:null==Dt?void 0:Dt.icon}),e.jsx("span",{style:null==Dt?void 0:Dt.text,children:null!==(Je=de.label)&&void 0!==Je?Je:"Approve"})]})})]})]})]}),null===(Ke=Lt.sub_features)||void 0===Ke?void 0:Ke.map((t,l)=>{console.log("UserStoryCardWrapper: sub",t);const o=A(V,!1,t.artifactId);return e.jsx(T,{artifactId:I,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${b}-${String.fromCharCode(65+l)}`,parentUserStory:U,parentIndex:`${R}${R&&"."}${M}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...U.sub_features||[]];l[e]=t,P({...U,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:L,showUserStoryDiff:q,updateUserStoryArtifact:W,handleDownloadUserStory:_,handleOpenSendDialog:$,isDisplayHighlightControl:O,elementDisplayConfig:V,_resolvedConfig:o,actionItemsConfig:Q,onDelete:()=>(e=>{const t=(U.sub_features||[]).filter((t,l)=>l!==e),l={...U,sub_features:t};qt(l),P(l)})(l),expandedSubFeatures:J,disableEditPlan:ae,useMuiTooltip:re,storyNumber:t.storyNumber,blockNumber:t.blockNumber,onUserStoryAccordionStateChange:Se,showAssignSection:me,onAssignSectionClick:ye,onSave:ge,menuActions:Ie},t.artifactId)})]})})]})};exports.StoryCard=T,exports.UserStoryCardWrapper=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:y,showWrapper:g,actionItemsConfig:S,contextVariant:C,showDisplayName:I,allowTitleEdit:j,showConfidenceScore:b,showBorderTop:w,defaultExpanded:N,showCompletionPanel:E=!1,completionPanelConfig:D,showAddSectionButton:B=!1,disableEditPlan:k=!1,useMuiTooltip:U=!1,approveButtonConfig:P,editButtonConfig:R,CDNeededInChip:M,showWaitingIconInChip:F,setRedlineDocumentIdParent:L,showAssignSection:q,onAssignSectionClick:_,disableAssignSection:$,onSave:W,onUserStoryAccordionStateChange:z,showSuggestedFilesInfo:O,suggestedFilesConfig:V,onChangeActiveDocumentMembers:G,menuActions:H})=>{const{userStory:Y,setUserStory:Q,customStyles:X,searchQueryList:Z,currentHighlightIndex:J,setCurrentHighlightIndex:K,segmentComponentConfig:ee,sectionStatusConfig:te,redlineConfig:le,setRedlineDocumentId:ne,redlineDcoumentId:oe,redlineCollaborativeConfig:ie}=p.useRequirementAI(),se=null==X?void 0:X.userStoryCardStyles,ae=0===J,re=J===Z.length-1;return t.useEffect(()=>{if(!(null==le?void 0:le.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await h.getRedlineDocumentId({baseApiUrl:le.documentBaseApiUrl||"",comparisonId:le.documentComparisonId||""});if(t)ne(t);else{const{document_id:t}=await h.createRedlineDocument({baseApiUrl:le.baseApiUrl,changelogConfigId:le.changelogConfigId,comparisonId:le.documentComparisonId,artifactId:le.artifactId,inputData:le.inputData,redlineConfigId:le.redlineConfigId,userEmail:le.userEmail,userName:le.userName},null!==(e=null==le?void 0:le.token)&&void 0!==e?e:"");t&&(ne(t),null==L||L(t))}})()},[]),x.default(`redline-document-edit:${oe}`,({sectionTitle:e,email:t,operation:l})=>{var n;null===(n=null==ie?void 0:ie.onChangeActiveSectionMember)||void 0===n||n.call(ie,{email:t,operation:l,sectionTitle:e})},({activeMembers:e})=>null==G?void 0:G(e)),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:m?{...null==se?void 0:se.userStoryCardWrapper,position:"relative"}:null==se?void 0:se.userStoryCardWrapper,children:[m&&e.jsx(e.Fragment,{children:Z.length>0&&e.jsx("div",{className:a.default.wrapper,children:e.jsx("div",{className:a.default.highlightNavigation,children:e.jsxs("div",{className:a.default.navigationContainer,children:[e.jsxs("span",{className:a.default.navCounter,children:[J+1," of ",Z.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{J>0&&K(e=>e-1)},className:a.default.navButton,disabled:ae,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{J<Z.length-1&&K(e=>e+1)},className:a.default.navButton,disabled:re,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),Y.map((t,l)=>{console.log("UserStoryCardWrapper: userstory",t);const a=A(y,!0);return e.jsx(T,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{Q(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:y,_resolvedConfig:a,showWrapper:g,defaultExpanded:N,actionItemsConfig:S,contextVariant:C,showDisplayName:I,allowTitleEdit:j,showConfidenceScore:b,showBorderTop:w,sectionStatusConfig:te,showCompletionPanel:E,completionPanelConfig:D,showAddSectionButton:B,disableEditPlan:k,useMuiTooltip:U,approveButtonConfig:P,CDNeededInChip:M,editButtonConfig:R,storyNumber:t.storyNumber,blockNumber:t.blockNumber,onUserStoryAccordionStateChange:z,showSuggestedFilesInfo:O,suggestedFilesConfig:V,showWaitingIconInChip:F,showAssignSection:q,disableAssignSection:$,onAssignSectionClick:_,onSave:W,menuActions:H},t.artifactId)})]})},exports.default=T,exports.replaceLearnedTagsWithInfo=D;
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("@mui/material"),r=require("lucide-react"),n=require("../../../../utils/helperFunctions.js"),i=require("../userstory-with-citation/UserStoryWithCitation.module.css.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(l);exports.default=({children:o,tableStyle:a,menuConfig:s,menuStyles:d,blockId:c,storyId:v})=>{var f,b,p,h,m;const y=null==s?void 0:s.elements,x=!!(null==y?void 0:y.length),j=l.useRef(null),[g,E]=l.useState(null),[M,S]=l.useState(40);if(l.useEffect(()=>{var e,l,t;if(!x)return;const r=null!==(l=null===(e=j.current)||void 0===e?void 0:e.querySelector("thead tr"))&&void 0!==l?l:null===(t=j.current)||void 0===t?void 0:t.querySelector("tr");if(!r)return;const n=()=>S(r.offsetHeight);n();const i=new ResizeObserver(n);return i.observe(r),()=>i.disconnect()},[x,o]),!x)return e.jsx("div",{className:i.default.tableWrapper,children:e.jsx("table",{className:i.default.table,style:a,children:o})});const R=()=>E(null),q=()=>{var e,l,t,r;const i=j.current;if(!i)return null;const o=n.serializeTable(i),u=i.closest(n.BLOCK_SELECTOR),a=Array.from(null!==(e=null==u?void 0:u.querySelectorAll(`table[${n.TABLE_MARKER}]`))&&void 0!==e?e:[]).filter(e=>e.closest(n.BLOCK_SELECTOR)===u&&n.serializeTable(e)===o),s=Math.max(a.indexOf(i)+1,1),[d,f]=(null!==(l=null==u?void 0:u.getAttribute("data-block-id"))&&void 0!==l?l:"").replace("user-story-card-wrapper-","").split("-");return{html:o,storyId:null!==(t=null!=v?v:d)&&void 0!==t?t:"1",blockId:null!==(r=null!=c?c:f)&&void 0!==r?r:"1",occurrence:s,element:i}},A=!!g,C=null!==(b=null===(f=null==d?void 0:d.icon)||void 0===f?void 0:f.size)&&void 0!==b?b:18,O=null!==(p=null==s?void 0:s.icon)&&void 0!==p?p:e.jsx(r.MoreVertical,{size:C,color:null===(h=null==d?void 0:d.icon)||void 0===h?void 0:h.color});return e.jsxs("div",{className:i.default.tableMenuWrapper,style:{...null==d?void 0:d.wrapper,"--table-menu-reserved":`${null!==(m=null==d?void 0:d.headerReservedSpace)&&void 0!==m?m:40}px`},children:[e.jsx("button",{type:"button","aria-label":"Table actions",className:`${i.default.tableMenuButton} ${A?i.default.tableMenuButtonActive:""}`,style:{height:M-1,...null==d?void 0:d.button,...A?null==d?void 0:d.buttonActive:{}},onClick:e=>{e.stopPropagation(),E(e.currentTarget)},children:O}),e.jsx(t.Menu,{anchorEl:g,open:A,onClose:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:190,p:"5px",border:"1px solid #e2e8f0",borderRadius:"10px",backgroundColor:"#ffffff",...null==d?void 0:d.menuPaper}}},children:y.map((l,t)=>{var r;return u.default.isValidElement(l)?e.jsx("div",{style:null==d?void 0:d.menuItem,children:u.default.cloneElement(l,{getTableData:q,closeMenu:R})},null!==(r=l.key)&&void 0!==r?r:t):null})}),e.jsx("div",{className:i.default.tableWrapper,children:e.jsx("table",{ref:j,[n.TABLE_MARKER]:"true",className:`${i.default.table} ${i.default.tableWithMenu}`,style:a,children:o})})]})};
|
|
2
|
+
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("react-markdown"),i=require("rehype-raw"),l=require("./UserStoryWithCitation.module.css.js"),o=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),a=require("@mui/material"),d=require("dompurify"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),h=require("../RequirementAIWrapper/RequirementAIWrapper.js"),g=require("../../icons/CognitiveDecision.js"),p=require("../../icons/BrainRed.js"),v=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),f=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),I=require("./components/InlineManualComponent.js"),b=require("./components/HighlightButtonComponent.js"),w=require("../../../../utils/tagHelper.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var $=R(n),N=R(t),k=R(i),A=R(d);const q=n.createContext(!1),L=n.createContext({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),E=n.createContext({rowId:""}),M=({aiReason:t,isHighConfidence:i,customStyle:o,customIcons:r})=>{var a;const{expandedInfo:d,setExpanded:s,reasonToRow:c}=n.useContext(L),{rowId:u}=n.useContext(E),h=String(t.id);u&&c.current.set(h,u);const v=(null===(a=null==d?void 0:d.aiReason)||void 0===a?void 0:a.id)===t.id,m=i?(null==r?void 0:r.highConfidence)||e.jsx(g.default,{}):(null==r?void 0:r.lowConfidence)||e.jsx(p.default,{});return e.jsxs("button",{className:l.default.aiReasoningButton,style:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),s(v?null:u,v?null:t)},children:[m,v?e.jsx("i",{className:`pi pi-angle-up ${i?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence}`}):e.jsx("i",{className:`pi pi-angle-down ${i?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence}`})]})},T=({children:t,node:i,customStyles:o,customIcons:r})=>{var a,d;const s=n.useRef(Math.random().toString(36).slice(2)).current,{expandedInfo:c}=n.useContext(L),u=(null==c?void 0:c.rowId)===s,h=Array.isArray(null==i?void 0:i.children)?i.children.filter(e=>"element"===e.type).length:1,g=null!==(d=null===(a=null==i?void 0:i.properties)||void 0===a?void 0:a.style)&&void 0!==d?d:void 0;return e.jsxs(E.Provider,{value:{rowId:s},children:[e.jsx("tr",{style:g?{cssText:g}:void 0,children:t}),u&&(null==c?void 0:c.aiReason)&&e.jsx("tr",{style:{width:"100%"},children:e.jsx("td",{colSpan:h||1,className:l.default.tableExpandedCell,children:e.jsx("div",{className:l.default.tableExpandedCellInner,children:e.jsx("div",{className:l.default.tableExpandedCellContent,children:e.jsx(x.default,{aiReason:c.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==o?void 0:o.aiReasoningContent,aiReasoningAccordion:null==o?void 0:o.aiReasoningAccordion,aiReasoningMarkdown:null==o?void 0:o.aiReasoningMarkdown,aiReasoningPill:null==o?void 0:o.aiReasoningPill,webCitation:null==o?void 0:o.webCitation,stormeeCitation:null==o?void 0:o.stormeeCitation,waveformCitation:null==o?void 0:o.waveformCitation,imageCitation:null==o?void 0:o.imageCitation,fileCitation:null==o?void 0:o.fileCitation,appModCitation:null==o?void 0:o.appModCitation,rcaCitation:null==o?void 0:o.rcaCitation,readFileCitation:null==o?void 0:o.readFileCitation,loadingCitations:null==o?void 0:o.loadingCitations,chatCitation:null==o?void 0:o.chatCitation}})})})})})]})};const _=["del","ins"];function U(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,t)=>`@@CODE_SPAN_${n.push(t)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,t)=>{var i;const l=null!==(i=n[Number(t)])&&void 0!==i?i:"";return`<code>${o=l,o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var o})}function H(e){return function(e,n,t){const i=n.join("|");return e.replace(new RegExp(`<(${i})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,i)=>`<${n}>${t(i)}</${n}>`)}(e,_,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:U(e)).join(""))}function P(e){let n=e.trim();n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const t=[];let i="",l=!1;for(const e of n)l?(i+=e,l=!1):"\\"!==e?"|"!==e?i+=e:(t.push(i.trim()),i=""):(i+=e,l=!0);return t.push(i.trim()),t}function D(e){return e.trim().includes("|")&&P(e).length>1}function F(e){const n=P(e);return n.length>1&&n.every(e=>/^:?-{3,}:?$/.test(e.replace(/\s+/g,"")))}function O(e){if(!e)return;const n=e.replace(/\s+/g,"");return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":"left"}function W(e,n){return Array.from({length:n},(n,t)=>{var i;return null!==(i=e[t])&&void 0!==i?i:""})}function B(e,n,t){return`<${e}${function(e){return e?` align="${e}"`:""}(t)}>${U(n)}</${e}>`}function V(e,n,t){const i=Math.max(e.length,n.length,...t.map(e=>e.length)),l=W(e,i),o=W(n,i).map(O);return`\n\n<table>${`<thead><tr>${l.map((e,n)=>B("th",e,o[n])).join("")}</tr></thead>`}${t.length?`<tbody>${t.map(e=>`<tr>${W(e,i).map((e,n)=>B("td",e,o[n])).join("")}</tr>`).join("")}</tbody>`:""}</table>\n\n`}const z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function G(e,n){const t=[],i=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,o;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!$.default.isValidElement(e))return e;const r="string"==typeof e.type?e.type.toLowerCase():"";if(i.has(r))return t.push(e),null;if(z.has(r))return e;const a=null===(o=$.default.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===o?void 0:o.flat().filter(e=>null!=e);return a&&0!==a.length?$.default.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:t}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}exports.default=({message:t,noMarkdownContent:i,useMarkdown:d=!0,isParent:g,scenario:p,showUserStoryDiff:x=!1,aiReasoningsForBlock:R,isCitationLoadingDisplay:E=!1,className:_,highConfidenceIcon:U,lowConfidenceIcon:O,customStyles:W,customIcons:B,contextVariant:z,aiReasoningDiffView:Q,userStoryCitations:J,artifactId:K,isCraflow:X,onCraAccept:Y,onCraReject:Z,onCitationLinkClick:ee,craFlowConfig:ne,isDisplayHighlightControl:te=!1,showConfidenceScore:ie=!0,CDNeededInChip:le,blockId:oe,storyId:re,showWaitingIconInChip:ae})=>{var de;console.log("userstorywithcitation blockid ",oe);const se=n.useRef(null),{userStory:ce,inlineUpdateComponentConfig:ue,getAvgScoreForStory:he,setUserStory:ge,aiReasoning:pe,setAiReasoning:ve,customIcons:me,searchQueryList:fe,searchQueryReasoningIdList:Ce,currentHighlightIndex:xe,segmentComponentConfig:je,inlineManualComponentConfig:ye,diffEditConfig:Se,customSectionConfig:Ie}=h.useRequirementAI(),be=null!=B?B:null==me?void 0:me.userStoryIcons;null==W||W.searchHighlight;const{search:we,clear:Re}=o.useMarkdownSearch(se),[$e,Ne]=n.useState("1"),[ke,Ae]=n.useState(null),qe=n.useRef(new Map),[Le,Ee]=n.useState(new Set),Me=n.useCallback((e,n)=>{Ae(e&&n?{rowId:e,aiReason:n}:null)},[]),Te=K?he(K):0,[_e,Ue]=n.useState([]),He=n.useCallback(e=>{Ee(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},[]),Pe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Pe).join(""):$.default.isValidElement(e)?Pe(e.props.children):"",De=e=>{let n=function(e){const n=e.split("\n"),t=[];let i=!1;for(let e=0;e<n.length;e++){const l=n[e];if(/^\s*(```|~~~)/.test(l)){i=!i,t.push(l);continue}const o=n[e+1];if(!i&&void 0!==o&&D(l)&&F(o)){const i=P(l),r=P(o),a=[];for(e+=2;e<n.length&&D(n[e])&&!F(n[e]);)a.push(P(n[e])),e++;e--,t.push(V(i,r,a));continue}t.push(l)}return t.join("\n")}(function(e){return e.replace(/\\r\\n|\\n|\\r/g,"\n")}(e));return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,t)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(t.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,t,i,l)=>{const o=i.match(/<table[\s\S]*?<\/table>/i);if(o){return`<segment${t} data-table="${btoa(encodeURIComponent(o[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,t)=>{if(/<table[\s>]/i.test(t)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(t))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,t,i,l)=>{const o=n.substring(0,l),r=o.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(o.substring(r+1))||/^\s+\d+\.\s/.test(o.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(o.substring(r+1));if(a||d){let e=i;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${t}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[];let i;const l=new RegExp(n.source,n.flags);for(;null!==(i=l.exec(e));){const e=i[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),l=e.match(/<changed>([\s\S]*?)<\/changed>/i),o=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;t.push({index:i.index,endIndex:i.index+i[0].length,deletedItemCount:o((null==n?void 0:n[1])||""),changedItemCount:o((null==l?void 0:l[1])||"")})}if(0===t.length)return e;let o=e;for(let e=t.length-1;e>=0;e--){const n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)continue;const l=o.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of l){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const a=n.endIndex,d=e+1<t.length?t[e+1].index:o.length;let s=o.substring(a,d);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,t)=>`${n}${parseInt(t,10)+i}. `),o=o.substring(0,a)+s+o.substring(d)}return o}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const t=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:t!==n}),`<deleted>${t}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const t=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:t!==n,preview:n.substring(0,120)}),`<changed>${t}</changed>`}),n}(n),n=H(n),n},Fe=n.useMemo(()=>t?De(t):t,[t]);n.useEffect(()=>{Ue(R||pe)},[R,pe]);const Oe=n.useMemo(()=>{const t=Boolean(null==Ie?void 0:Ie.negateList),i=(e,n)=>{let t=0;return $.default.Children.map(e,e=>{if(!$.default.isValidElement(e))return e;const i=n(t);return t+=1,$.default.cloneElement(e,{"data-list-marker":i})})};return{span:({node:n,children:t,...i})=>{var l,o,r,a,d;const s=null!==(o=null===(l=null==n?void 0:n.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==o?o:null==i?void 0:i["highlight-id"],c="string"==typeof s&&Le.has(s),u=null!==(a=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==a?a:null==i?void 0:i["highlight-color"];return e.jsx("span",{style:{...null!==(d=null==W?void 0:W.span)&&void 0!==d?d:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:t})},button:({node:n,children:t,...i})=>{var l,o,r,a,d,s;const c=null!==(o=null===(l=null==n?void 0:n.properties)||void 0===l?void 0:l.action)&&void 0!==o?o:null==i?void 0:i.action,u=null!==(a=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-id"])&&void 0!==a?a:null==i?void 0:i["highlight-id"],h=null!==(s=null===(d=null==n?void 0:n.properties)||void 0===d?void 0:d["highlight-type"])&&void 0!==s?s:null==i?void 0:i["highlight-type"];return"highlight"===c?e.jsx(b.default,{highlightId:u,handleHighlightSpan:He,icon:"web"===h?null==be?void 0:be.webCitationIcon:"doc"===h?null==be?void 0:be.fileCitationIcon:e.jsx(e.Fragment,{}),customStyles:"web"===h?null==W?void 0:W.webButton:"doc"===h?null==W?void 0:W.docButton:{}}):null},upt:({node:n,children:t,...i})=>{var l,o;const r=null==i?void 0:i.id,a=r?null===(o=null===(l=r.split("$"))||void 0===l?void 0:l[1])||void 0===o?void 0:o.replaceAll("@","<").replaceAll("#",">"):null,d=pe.find(e=>e.id.toString()===a);if(!d)return t||e.jsx(e.Fragment,{});const s="data-main"in i,c=i["data-status"];return e.jsx(e.Fragment,{children:e.jsx(j.default,{aiReason:d,customStyles:null==W?void 0:W.inlineUpdatedComponent,handleClickCognitiveDecision:null==ue?void 0:ue.handleClickCognitiveDecision,handleClickUpdatedPill:null==ue?void 0:ue.handleClickUpdatedPill,handleClickOutputValue:null==ue?void 0:ue.handleClickOutputValue,customIcons:null==ue?void 0:ue.customIcons,CDNeededInChip:le,showWaitingIconInChip:ae,showChip:s,status:c,containerRef:se,children:t||e.jsx(e.Fragment,{})})})},del:({node:n,children:t,...i})=>{var o;const{cleanedChildren:r,extractedNodes:a}=G(t,["ins"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.default.deleted,style:null!==(o=null==W?void 0:W.deleted)&&void 0!==o?o:{},...i,onClick:()=>{i.onclick&&i.onclick()},children:r}),a]})},ins:({children:n,...t})=>{var i;const{cleanedChildren:o,extractedNodes:r}=G(n,["del"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.default.inserted,style:null!==(i=null==W?void 0:W.inserted)&&void 0!==i?i:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:o}),r]})},preserved:({children:n,...t})=>e.jsx("span",{className:l.default.preserved,style:null==W?void 0:W.preserved,...t,children:n}),manual:({children:n,...t})=>{var i;const l=null===(i=null==t?void 0:t.id)||void 0===i?void 0:i.replaceAll("@","<").replaceAll("#",">"),o=pe.find(e=>e.id.toString()===l),r=t["data-status"];return o?e.jsx(I.default,{aiReason:o,handleClick:null==ye?void 0:ye.handleClick,status:r,children:n}):n||e.jsx(e.Fragment,{})},invisible:({children:n,...t})=>e.jsx(e.Fragment,{}),h1:({node:n,...t})=>e.jsx("h1",{className:l.default.heading1,style:null==W?void 0:W.heading1,children:t.children}),h2:({node:n,...t})=>e.jsx("h2",{className:l.default.heading2,style:null==W?void 0:W.heading2,children:t.children}),h3:({node:n,...t})=>e.jsx("h3",{className:l.default.heading3,style:null==W?void 0:W.heading3,children:t.children}),b:({node:n,...t})=>e.jsx("b",{className:l.default.bold,style:null==W?void 0:W.bold,children:null==t?void 0:t.children}),p:({node:n,...t})=>e.jsx("p",{...t,className:l.default.paragraph,style:null==W?void 0:W.paragraph,children:t.children}),updated:({node:n,...t})=>e.jsx(s.default,{...t,showUserStoryDiff:x,currentUpdatedTagId:$e,setCurrentUpdatedTagId:Ne,userStory:ce,setUserStory:ge,setAiReasoning:ve,node:n,isCraflow:X,onCraAccept:Y,onCraReject:Z,diffEditConfig:Se,customStyles:null==W?void 0:W.updatedContent,craFlowConfig:ne}),ol:({node:n,...o})=>{var r,a,d;const s=null!==(d=null!==(a=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r.start)&&void 0!==a?a:null==o?void 0:o.start)&&void 0!==d?d:void 0,c=Number(null!=s?s:1);return t?e.jsx("div",{role:"list",className:l.default.negatedOrderedList,style:null==W?void 0:W.olist,children:i(o.children,e=>`${c+e}.`)}):e.jsx("ol",{className:l.default.orderedList,style:null==W?void 0:W.olist,...s?{start:Number(s)}:{},children:null==o?void 0:o.children})},ul:({node:n,...o})=>t?e.jsx("div",{role:"list",className:l.default.negatedUnorderedList,style:null==W?void 0:W.ulist,children:i(o.children,()=>"•")}):e.jsx("ul",{className:l.default.unorderedList,style:null==W?void 0:W.ulist,children:null==o?void 0:o.children}),li:({node:n,...i})=>{if(t){const n=i["data-list-marker"],{children:t,"data-list-marker":o,...r}=i;return e.jsxs("div",{...r,role:"listitem",className:`${l.default.paragraph} ${l.default.negatedListItem}`,style:null==W?void 0:W.paragraph,children:[n&&e.jsxs("span",{className:l.default.negatedListMarker,children:[n," "]}),t]})}return e.jsx("li",{children:null==i?void 0:i.children})},table:({children:n})=>e.jsx("div",{className:l.default.tableWrapper,children:e.jsx("table",{className:l.default.table,style:null==W?void 0:W.table,children:n})}),tr:({node:n,children:t})=>e.jsx(T,{node:n,children:t,customStyles:W}),td:({node:n,children:t})=>{var i;const{style:l,...o}=null!==(i=null==n?void 0:n.properties)&&void 0!==i?i:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("td",{...o,style:l?{cssText:l}:void 0,children:t})})},th:({node:n,children:t})=>{var i;const{style:l,...o}=null!==(i=null==n?void 0:n.properties)&&void 0!==i?i:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("th",{...o,style:l?{cssText:l}:void 0,children:t})})},recommendation:({node:n,...t})=>{var i;const l=`The AI has selected this content based on: ${(null===(i=null==t?void 0:t.children)||void 0===i?void 0:i[0])||""}`;return e.jsx(f.default,{...t,customStyles:null==W?void 0:W.recommendationBlock,label:l})},a:({inline:t,children:i,node:o,...r})=>{var a;const d=n.useContext(q)||"true"===(null==r?void 0:r.table),s=`${null==r?void 0:r.href}`,[c,u]=s.split("$"),h=null==u?void 0:u.split("?")[0];if("ai_reasoning"===c){const n=(null!==(a=x?Q:pe)&&void 0!==a?a:[]).find(e=>e.id.toString()===decodeURIComponent(h)),t=Ce.includes(h);if(n){if(d)return e.jsx(M,{aiReason:n,customStyle:null==W?void 0:W.tableAiReasoning,customIcons:be,isHighConfidence:n.relevance_score>=v.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});const l=Pe(i),o="source"!==l.trim().toLowerCase();return e.jsx(v.default,{aiReason:n,isSourceHasHighlight:t,inlineLabel:l,isInlineCitation:o,customIcons:be,customStyles:{aiReasoningContent:null==W?void 0:W.aiReasoningContent,aiReasoningAccordion:null==W?void 0:W.aiReasoningAccordion,aiReasoningMarkdown:null==W?void 0:W.aiReasoningMarkdown,aiReasoningPill:null==W?void 0:W.aiReasoningPill,webCitation:null==W?void 0:W.webCitation,stormeeCitation:null==W?void 0:W.stormeeCitation,waveformCitation:null==W?void 0:W.waveformCitation,imageCitation:null==W?void 0:W.imageCitation,fileCitation:null==W?void 0:W.fileCitation,appModCitation:null==W?void 0:W.appModCitation,rcaCitation:null==W?void 0:W.rcaCitation,readFileCitation:null==W?void 0:W.readFileCitation,loadingCitations:null==W?void 0:W.loadingCitations,chatCitation:null==W?void 0:W.chatCitation,bigEnoughCitation:null==W?void 0:W.bigEnoughCitation}})}}return ee?e.jsx("button",{className:l.default.citationLink,style:null==W?void 0:W.citationLink,onClick:()=>ee((null==r?void 0:r.href)||""),children:i}):null},code:({inline:n,children:t,className:i,node:o,...r})=>/language-(\w+)/.exec(i||"")||(null==i?void 0:i.includes("language-"))?e.jsx("div",{children:e.jsx("code",{className:l.default.blockCode,style:null==W?void 0:W.code,children:t})}):e.jsx("code",{className:l.default.inlineCode,style:null==W?void 0:W.code,children:t}),learned:({children:n})=>e.jsx(a.Tooltip,{title:n,placement:"top",children:e.jsx(r.Info,{size:16,className:l.default.learned})}),generatedcode:({node:n,...t})=>{const i=(null==t?void 0:t.language)||"python",l=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const t=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(t).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?t(e.props.children):""};n=t(e.children)}}catch(t){console.error("Error decoding generated code:",t),n=String(e.children)}return n})(t);return e.jsx(c.default,{title:"Generated Code",code:l,language:i,customStyles:{pill:null==W?void 0:W.generatedCodePill,content:null==W?void 0:W.generatedCodeContent}})},updatedsegment:({node:n,children:t,...i})=>{var l,o,r,a;const d=`${null===(l=n.position)||void 0===l?void 0:l.start.line}-${null===(o=n.position)||void 0===o?void 0:o.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(i),c=s?e.jsx("div",{dangerouslySetInnerHTML:{__html:A.default.sanitize(s)}}):e.jsx("div",{children:t});return e.jsx(y.default,{id:d,node:n,children:c,props:i,segmentComponentConfig:je,customStyles:W,customIcons:B,extractText:Pe,isUpdatedSegment:!0})},segment:({node:n,children:t,...i})=>{var l,o,r,a;const d=`${null===(l=n.position)||void 0===l?void 0:l.start.line}-${null===(o=n.position)||void 0===o?void 0:o.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`;return e.jsx(y.default,{id:d,node:n,children:t,props:i,segmentComponentConfig:je,customStyles:W,customIcons:B,extractText:Pe,blockId:oe,storyId:re})}}},[_e,ne,pe,J,$e,x,t,B,fe,Ce,W,je,Le,He,oe,re,null==Ie?void 0:Ie.negateList,ee]),We=n.useMemo(()=>{let e=w.escapeTagIds(Fe,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=w.splitTagAcrossParagraphs(e,n,"upt"===n)}),e},[Fe]);return n.useEffect(()=>{if(!se.current)return;if(!fe.length)return void Re();const e=se.current,n=Math.min(xe,fe.length-1);let t;const i=()=>{requestAnimationFrame(()=>{we([fe[n].replace(/\*/g,"")])})};i();const l=new MutationObserver(()=>{clearTimeout(t),t=setTimeout(()=>{e.querySelector(`.${o.HIGHLIGHT_CLASS}`)||i()},50)});return l.observe(e,{childList:!0,subtree:!0}),()=>{l.disconnect(),clearTimeout(t)}},[fe,Ce,xe,te]),e.jsx(L.Provider,{value:{expandedInfo:ke,setExpanded:Me,reasonToRow:qe},children:e.jsxs("div",{ref:se,className:`${l.default.container} ${"approving"!==p?l.default.wrapper:""} ${_||""}`,style:null==W?void 0:W.container,children:[d?e.jsx(S.MarkdownContextProvider,{children:e.jsx(N.default,{components:Oe,rehypePlugins:[k.default],children:We})}):i,Te>0&&ie&&e.jsx("div",{className:l.default.confidenceScoreContainer,style:null==W?void 0:W.confidenceScoreContainer,children:e.jsxs("span",{className:l.default.confidenceScore,style:null==W?void 0:W.confidenceScore,children:[e.jsx(m.default,{size:14,color:(null==W?void 0:W.confidenceScoreIconColor)||"#166534"}),Te,"%"]})}),E&&e.jsx("div",{className:l.default.citationLoader,style:null==W?void 0:W.citationLoaderContainer,children:e.jsx(u.default,{customStyles:{container:null==W?void 0:W.citationLoadingContainer,icon:null==W?void 0:W.citationLoadingIcon,text:null==W?void 0:W.citationLoadingText}})}),g&&e.jsx("div",{style:{...null===(de=null==W?void 0:W.attachedContext)||void 0===de?void 0:de.wrapper},className:"flex mt-5",children:e.jsx(C.default,{customStyles:null==W?void 0:W.attachedContext,variant:z})})]})})},exports.splitNestedDiffNodes=G;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("react-markdown"),i=require("rehype-raw"),l=require("./UserStoryWithCitation.module.css.js"),o=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),d=require("@mui/material"),a=require("dompurify"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),h=require("../../icons/CognitiveDecision.js"),p=require("../../icons/BrainRed.js"),v=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),f=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),y=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),I=require("./components/InlineManualComponent.js"),b=require("./components/HighlightButtonComponent.js"),w=require("../../../../utils/tagHelper.js"),R=require("../common/TableWrapper.js");function $(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=$(n),k=$(t),A=$(i),q=$(a);const L=n.createContext(!1),E=n.createContext({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),M=n.createContext({rowId:""}),T=({aiReason:t,isHighConfidence:i,customStyle:o,customIcons:r})=>{var d;const{expandedInfo:a,setExpanded:s,reasonToRow:c}=n.useContext(E),{rowId:u}=n.useContext(M),g=String(t.id);u&&c.current.set(g,u);const v=(null===(d=null==a?void 0:a.aiReason)||void 0===d?void 0:d.id)===t.id,m=i?(null==r?void 0:r.highConfidence)||e.jsx(h.default,{}):(null==r?void 0:r.lowConfidence)||e.jsx(p.default,{});return e.jsxs("button",{className:l.default.aiReasoningButton,style:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),s(v?null:u,v?null:t)},children:[m,v?e.jsx("i",{className:`pi pi-angle-up ${i?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence}`}):e.jsx("i",{className:`pi pi-angle-down ${i?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence}`})]})},_=({children:t,node:i,customStyles:o,customIcons:r})=>{var d,a;const s=n.useRef(Math.random().toString(36).slice(2)).current,{expandedInfo:c}=n.useContext(E),u=(null==c?void 0:c.rowId)===s,g=Array.isArray(null==i?void 0:i.children)?i.children.filter(e=>"element"===e.type).length:1,h=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return e.jsxs(M.Provider,{value:{rowId:s},children:[e.jsx("tr",{style:h?{cssText:h}:void 0,children:t}),u&&(null==c?void 0:c.aiReason)&&e.jsx("tr",{style:{width:"100%"},children:e.jsx("td",{colSpan:g||1,className:l.default.tableExpandedCell,children:e.jsx("div",{className:l.default.tableExpandedCellInner,children:e.jsx("div",{className:l.default.tableExpandedCellContent,children:e.jsx(x.default,{aiReason:c.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==o?void 0:o.aiReasoningContent,aiReasoningAccordion:null==o?void 0:o.aiReasoningAccordion,aiReasoningMarkdown:null==o?void 0:o.aiReasoningMarkdown,aiReasoningPill:null==o?void 0:o.aiReasoningPill,webCitation:null==o?void 0:o.webCitation,stormeeCitation:null==o?void 0:o.stormeeCitation,waveformCitation:null==o?void 0:o.waveformCitation,imageCitation:null==o?void 0:o.imageCitation,fileCitation:null==o?void 0:o.fileCitation,appModCitation:null==o?void 0:o.appModCitation,rcaCitation:null==o?void 0:o.rcaCitation,readFileCitation:null==o?void 0:o.readFileCitation,loadingCitations:null==o?void 0:o.loadingCitations,chatCitation:null==o?void 0:o.chatCitation}})})})})})]})};const U=["del","ins"];function H(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,t)=>`@@CODE_SPAN_${n.push(t)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,t)=>{var i;const l=null!==(i=n[Number(t)])&&void 0!==i?i:"";return`<code>${o=l,o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var o})}function P(e){return function(e,n,t){const i=n.join("|");return e.replace(new RegExp(`<(${i})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,i)=>`<${n}>${t(i)}</${n}>`)}(e,U,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:H(e)).join(""))}function D(e){let n=e.trim();n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const t=[];let i="",l=!1;for(const e of n)l?(i+=e,l=!1):"\\"!==e?"|"!==e?i+=e:(t.push(i.trim()),i=""):(i+=e,l=!0);return t.push(i.trim()),t}function F(e){return e.trim().includes("|")&&D(e).length>1}function O(e){const n=D(e);return n.length>1&&n.every(e=>/^:?-{3,}:?$/.test(e.replace(/\s+/g,"")))}function W(e){if(!e)return;const n=e.replace(/\s+/g,"");return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":"left"}function B(e,n){return Array.from({length:n},(n,t)=>{var i;return null!==(i=e[t])&&void 0!==i?i:""})}function V(e,n,t){return`<${e}${function(e){return e?` align="${e}"`:""}(t)}>${H(n)}</${e}>`}function z(e,n,t){const i=Math.max(e.length,n.length,...t.map(e=>e.length)),l=B(e,i),o=B(n,i).map(W);return`\n\n<table>${`<thead><tr>${l.map((e,n)=>V("th",e,o[n])).join("")}</tr></thead>`}${t.length?`<tbody>${t.map(e=>`<tr>${B(e,i).map((e,n)=>V("td",e,o[n])).join("")}</tr>`).join("")}</tbody>`:""}</table>\n\n`}const G=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Q(e,n){const t=[],i=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,o;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!N.default.isValidElement(e))return e;const r="string"==typeof e.type?e.type.toLowerCase():"";if(i.has(r))return t.push(e),null;if(G.has(r))return e;const d=null===(o=N.default.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===o?void 0:o.flat().filter(e=>null!=e);return d&&0!==d.length?N.default.cloneElement(e,void 0,d):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:t}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}exports.default=({message:t,noMarkdownContent:i,useMarkdown:a=!0,isParent:h,scenario:p,showUserStoryDiff:x=!1,aiReasoningsForBlock:$,isCitationLoadingDisplay:M=!1,className:U,highConfidenceIcon:H,lowConfidenceIcon:W,customStyles:B,customIcons:V,contextVariant:G,aiReasoningDiffView:J,userStoryCitations:K,artifactId:X,isCraflow:Y,onCraAccept:Z,onCraReject:ee,onCitationLinkClick:ne,craFlowConfig:te,isDisplayHighlightControl:ie=!1,showConfidenceScore:le=!0,CDNeededInChip:oe,blockId:re,storyId:de,showWaitingIconInChip:ae,menuActions:se})=>{var ce;console.log("userstorywithcitation blockid ",re,se);const ue=n.useRef(null),{userStory:ge,inlineUpdateComponentConfig:he,getAvgScoreForStory:pe,setUserStory:ve,aiReasoning:me,setAiReasoning:fe,customIcons:Ce,searchQueryList:xe,searchQueryReasoningIdList:ye,currentHighlightIndex:je,segmentComponentConfig:Se,inlineManualComponentConfig:Ie,diffEditConfig:be,customSectionConfig:we}=g.useRequirementAI(),Re=null!=V?V:null==Ce?void 0:Ce.userStoryIcons;null==B||B.searchHighlight;const{search:$e,clear:Ne}=o.useMarkdownSearch(ue),[ke,Ae]=n.useState("1"),[qe,Le]=n.useState(null),Ee=n.useRef(new Map),[Me,Te]=n.useState(new Set),_e=n.useCallback((e,n)=>{Le(e&&n?{rowId:e,aiReason:n}:null)},[]),Ue=X?pe(X):0,[He,Pe]=n.useState([]),De=n.useCallback(e=>{Te(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},[]),Fe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Fe).join(""):N.default.isValidElement(e)?Fe(e.props.children):"",Oe=e=>{let n=function(e){const n=e.split("\n"),t=[];let i=!1;for(let e=0;e<n.length;e++){const l=n[e];if(/^\s*(```|~~~)/.test(l)){i=!i,t.push(l);continue}const o=n[e+1];if(!i&&void 0!==o&&F(l)&&O(o)){const i=D(l),r=D(o),d=[];for(e+=2;e<n.length&&F(n[e])&&!O(n[e]);)d.push(D(n[e])),e++;e--,t.push(z(i,r,d));continue}t.push(l)}return t.join("\n")}(function(e){return e.replace(/\\r\\n|\\n|\\r/g,"\n")}(e));return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,t)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(t.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,t,i,l)=>{const o=i.match(/<table[\s\S]*?<\/table>/i);if(o){return`<segment${t} data-table="${btoa(encodeURIComponent(o[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,t)=>{if(/<table[\s>]/i.test(t)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(t))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,t,i,l)=>{const o=n.substring(0,l),r=o.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(o.substring(r+1))||/^\s+\d+\.\s/.test(o.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(o.substring(r+1));if(d||a){let e=i;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${t}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[];let i;const l=new RegExp(n.source,n.flags);for(;null!==(i=l.exec(e));){const e=i[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),l=e.match(/<changed>([\s\S]*?)<\/changed>/i),o=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;t.push({index:i.index,endIndex:i.index+i[0].length,deletedItemCount:o((null==n?void 0:n[1])||""),changedItemCount:o((null==l?void 0:l[1])||"")})}if(0===t.length)return e;let o=e;for(let e=t.length-1;e>=0;e--){const n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)continue;const l=o.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of l){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<t.length?t[e+1].index:o.length;let s=o.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,t)=>`${n}${parseInt(t,10)+i}. `),o=o.substring(0,d)+s+o.substring(a)}return o}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const t=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:t!==n}),`<deleted>${t}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const t=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:t!==n,preview:n.substring(0,120)}),`<changed>${t}</changed>`}),n}(n),n=P(n),n},We=n.useMemo(()=>t?Oe(t):t,[t]);n.useEffect(()=>{Pe($||me)},[$,me]);const Be=n.useMemo(()=>{const t=Boolean(null==we?void 0:we.negateList),i=(e,n)=>{let t=0;return N.default.Children.map(e,e=>{if(!N.default.isValidElement(e))return e;const i=n(t);return t+=1,N.default.cloneElement(e,{"data-list-marker":i})})};return{span:({node:n,children:t,...i})=>{var l,o,r,d,a;const s=null!==(o=null===(l=null==n?void 0:n.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==o?o:null==i?void 0:i["highlight-id"],c="string"==typeof s&&Me.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==i?void 0:i["highlight-color"];return e.jsx("span",{style:{...null!==(a=null==B?void 0:B.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:t})},button:({node:n,children:t,...i})=>{var l,o,r,d,a,s;const c=null!==(o=null===(l=null==n?void 0:n.properties)||void 0===l?void 0:l.action)&&void 0!==o?o:null==i?void 0:i.action,u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-id"])&&void 0!==d?d:null==i?void 0:i["highlight-id"],g=null!==(s=null===(a=null==n?void 0:n.properties)||void 0===a?void 0:a["highlight-type"])&&void 0!==s?s:null==i?void 0:i["highlight-type"];return"highlight"===c?e.jsx(b.default,{highlightId:u,handleHighlightSpan:De,icon:"web"===g?null==Re?void 0:Re.webCitationIcon:"doc"===g?null==Re?void 0:Re.fileCitationIcon:e.jsx(e.Fragment,{}),customStyles:"web"===g?null==B?void 0:B.webButton:"doc"===g?null==B?void 0:B.docButton:{}}):null},upt:({node:n,children:t,...i})=>{var l,o;const r=null==i?void 0:i.id,d=r?null===(o=null===(l=r.split("$"))||void 0===l?void 0:l[1])||void 0===o?void 0:o.replaceAll("@","<").replaceAll("#",">"):null,a=me.find(e=>e.id.toString()===d);if(!a)return t||e.jsx(e.Fragment,{});const s="data-main"in i,c=i["data-status"];return e.jsx(e.Fragment,{children:e.jsx(y.default,{aiReason:a,customStyles:null==B?void 0:B.inlineUpdatedComponent,handleClickCognitiveDecision:null==he?void 0:he.handleClickCognitiveDecision,handleClickUpdatedPill:null==he?void 0:he.handleClickUpdatedPill,handleClickOutputValue:null==he?void 0:he.handleClickOutputValue,customIcons:null==he?void 0:he.customIcons,CDNeededInChip:oe,showWaitingIconInChip:ae,showChip:s,status:c,containerRef:ue,children:t||e.jsx(e.Fragment,{})})})},del:({node:n,children:t,...i})=>{var o;const{cleanedChildren:r,extractedNodes:d}=Q(t,["ins"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.default.deleted,style:null!==(o=null==B?void 0:B.deleted)&&void 0!==o?o:{},...i,onClick:()=>{i.onclick&&i.onclick()},children:r}),d]})},ins:({children:n,...t})=>{var i;const{cleanedChildren:o,extractedNodes:r}=Q(n,["del"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:l.default.inserted,style:null!==(i=null==B?void 0:B.inserted)&&void 0!==i?i:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:o}),r]})},preserved:({children:n,...t})=>e.jsx("span",{className:l.default.preserved,style:null==B?void 0:B.preserved,...t,children:n}),manual:({children:n,...t})=>{var i;const l=null===(i=null==t?void 0:t.id)||void 0===i?void 0:i.replaceAll("@","<").replaceAll("#",">"),o=me.find(e=>e.id.toString()===l),r=t["data-status"];return o?e.jsx(I.default,{aiReason:o,handleClick:null==Ie?void 0:Ie.handleClick,status:r,children:n}):n||e.jsx(e.Fragment,{})},invisible:({children:n,...t})=>e.jsx(e.Fragment,{}),h1:({node:n,...t})=>e.jsx("h1",{className:l.default.heading1,style:null==B?void 0:B.heading1,children:t.children}),h2:({node:n,...t})=>e.jsx("h2",{className:l.default.heading2,style:null==B?void 0:B.heading2,children:t.children}),h3:({node:n,...t})=>e.jsx("h3",{className:l.default.heading3,style:null==B?void 0:B.heading3,children:t.children}),b:({node:n,...t})=>e.jsx("b",{className:l.default.bold,style:null==B?void 0:B.bold,children:null==t?void 0:t.children}),p:({node:n,...t})=>e.jsx("p",{...t,className:l.default.paragraph,style:null==B?void 0:B.paragraph,children:t.children}),updated:({node:n,...t})=>e.jsx(s.default,{...t,showUserStoryDiff:x,currentUpdatedTagId:ke,setCurrentUpdatedTagId:Ae,userStory:ge,setUserStory:ve,setAiReasoning:fe,node:n,isCraflow:Y,onCraAccept:Z,onCraReject:ee,diffEditConfig:be,customStyles:null==B?void 0:B.updatedContent,craFlowConfig:te}),ol:({node:n,...o})=>{var r,d,a;const s=null!==(a=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r.start)&&void 0!==d?d:null==o?void 0:o.start)&&void 0!==a?a:void 0,c=Number(null!=s?s:1);return t?e.jsx("div",{role:"list",className:l.default.negatedOrderedList,style:null==B?void 0:B.olist,children:i(o.children,e=>`${c+e}.`)}):e.jsx("ol",{className:l.default.orderedList,style:null==B?void 0:B.olist,...s?{start:Number(s)}:{},children:null==o?void 0:o.children})},ul:({node:n,...o})=>t?e.jsx("div",{role:"list",className:l.default.negatedUnorderedList,style:null==B?void 0:B.ulist,children:i(o.children,()=>"•")}):e.jsx("ul",{className:l.default.unorderedList,style:null==B?void 0:B.ulist,children:null==o?void 0:o.children}),li:({node:n,...i})=>{if(t){const n=i["data-list-marker"],{children:t,"data-list-marker":o,...r}=i;return e.jsxs("div",{...r,role:"listitem",className:`${l.default.paragraph} ${l.default.negatedListItem}`,style:null==B?void 0:B.paragraph,children:[n&&e.jsxs("span",{className:l.default.negatedListMarker,children:[n," "]}),t]})}return e.jsx("li",{children:null==i?void 0:i.children})},table:({children:n})=>e.jsx(R.default,{menuConfig:null==se?void 0:se.table,menuStyles:null==B?void 0:B.tableMenu,tableStyle:null==B?void 0:B.table,blockId:re,storyId:de,children:n}),tr:({node:n,children:t})=>e.jsx(_,{node:n,children:t,customStyles:B}),td:({node:n,children:t})=>{var i;const{style:l,...o}=null!==(i=null==n?void 0:n.properties)&&void 0!==i?i:{};return e.jsx(L.Provider,{value:!0,children:e.jsx("td",{...o,style:l?{cssText:l}:void 0,children:t})})},th:({node:n,children:t})=>{var i;const{style:l,...o}=null!==(i=null==n?void 0:n.properties)&&void 0!==i?i:{};return e.jsx(L.Provider,{value:!0,children:e.jsx("th",{...o,style:l?{cssText:l}:void 0,children:t})})},recommendation:({node:n,...t})=>{var i;const l=`The AI has selected this content based on: ${(null===(i=null==t?void 0:t.children)||void 0===i?void 0:i[0])||""}`;return e.jsx(f.default,{...t,customStyles:null==B?void 0:B.recommendationBlock,label:l})},a:({inline:t,children:i,node:o,...r})=>{var d;const a=n.useContext(L)||"true"===(null==r?void 0:r.table),s=`${null==r?void 0:r.href}`,[c,u]=s.split("$"),g=null==u?void 0:u.split("?")[0];if("ai_reasoning"===c){const n=(null!==(d=x?J:me)&&void 0!==d?d:[]).find(e=>e.id.toString()===decodeURIComponent(g)),t=ye.includes(g);if(n){if(a)return e.jsx(T,{aiReason:n,customStyle:null==B?void 0:B.tableAiReasoning,customIcons:Re,isHighConfidence:n.relevance_score>=v.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});const l=Fe(i),o="source"!==l.trim().toLowerCase();return e.jsx(v.default,{aiReason:n,isSourceHasHighlight:t,inlineLabel:l,isInlineCitation:o,customIcons:Re,customStyles:{aiReasoningContent:null==B?void 0:B.aiReasoningContent,aiReasoningAccordion:null==B?void 0:B.aiReasoningAccordion,aiReasoningMarkdown:null==B?void 0:B.aiReasoningMarkdown,aiReasoningPill:null==B?void 0:B.aiReasoningPill,webCitation:null==B?void 0:B.webCitation,stormeeCitation:null==B?void 0:B.stormeeCitation,waveformCitation:null==B?void 0:B.waveformCitation,imageCitation:null==B?void 0:B.imageCitation,fileCitation:null==B?void 0:B.fileCitation,appModCitation:null==B?void 0:B.appModCitation,rcaCitation:null==B?void 0:B.rcaCitation,readFileCitation:null==B?void 0:B.readFileCitation,loadingCitations:null==B?void 0:B.loadingCitations,chatCitation:null==B?void 0:B.chatCitation,bigEnoughCitation:null==B?void 0:B.bigEnoughCitation}})}}return ne?e.jsx("button",{className:l.default.citationLink,style:null==B?void 0:B.citationLink,onClick:()=>ne((null==r?void 0:r.href)||""),children:i}):null},code:({inline:n,children:t,className:i,node:o,...r})=>/language-(\w+)/.exec(i||"")||(null==i?void 0:i.includes("language-"))?e.jsx("div",{children:e.jsx("code",{className:l.default.blockCode,style:null==B?void 0:B.code,children:t})}):e.jsx("code",{className:l.default.inlineCode,style:null==B?void 0:B.code,children:t}),learned:({children:n})=>e.jsx(d.Tooltip,{title:n,placement:"top",children:e.jsx(r.Info,{size:16,className:l.default.learned})}),generatedcode:({node:n,...t})=>{const i=(null==t?void 0:t.language)||"python",l=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const t=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(t).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?t(e.props.children):""};n=t(e.children)}}catch(t){console.error("Error decoding generated code:",t),n=String(e.children)}return n})(t);return e.jsx(c.default,{title:"Generated Code",code:l,language:i,customStyles:{pill:null==B?void 0:B.generatedCodePill,content:null==B?void 0:B.generatedCodeContent}})},updatedsegment:({node:n,children:t,...i})=>{var l,o,r,d;const a=`${null===(l=n.position)||void 0===l?void 0:l.start.line}-${null===(o=n.position)||void 0===o?void 0:o.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(i),c=s?e.jsx("div",{dangerouslySetInnerHTML:{__html:q.default.sanitize(s)}}):e.jsx("div",{children:t});return e.jsx(j.default,{id:a,node:n,children:c,props:i,segmentComponentConfig:Se,customStyles:B,customIcons:V,extractText:Fe,isUpdatedSegment:!0})},segment:({node:n,children:t,...i})=>{var l,o,r,d;const a=`${null===(l=n.position)||void 0===l?void 0:l.start.line}-${null===(o=n.position)||void 0===o?void 0:o.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e.jsx(j.default,{id:a,node:n,children:t,props:i,segmentComponentConfig:Se,customStyles:B,customIcons:V,extractText:Fe,blockId:re,storyId:de})}}},[He,te,me,K,ke,x,t,V,xe,ye,B,Se,Me,De,re,de,null==we?void 0:we.negateList,ne]),Ve=n.useMemo(()=>{let e=w.escapeTagIds(We,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=w.splitTagAcrossParagraphs(e,n,"upt"===n)}),e},[We]);return n.useEffect(()=>{if(!ue.current)return;if(!xe.length)return void Ne();const e=ue.current,n=Math.min(je,xe.length-1);let t;const i=()=>{requestAnimationFrame(()=>{$e([xe[n].replace(/\*/g,"")])})};i();const l=new MutationObserver(()=>{clearTimeout(t),t=setTimeout(()=>{e.querySelector(`.${o.HIGHLIGHT_CLASS}`)||i()},50)});return l.observe(e,{childList:!0,subtree:!0}),()=>{l.disconnect(),clearTimeout(t)}},[xe,ye,je,ie]),e.jsx(E.Provider,{value:{expandedInfo:qe,setExpanded:_e,reasonToRow:Ee},children:e.jsxs("div",{ref:ue,className:`${l.default.container} ${"approving"!==p?l.default.wrapper:""} ${U||""}`,style:null==B?void 0:B.container,children:[a?e.jsx(S.MarkdownContextProvider,{children:e.jsx(k.default,{components:Be,rehypePlugins:[A.default],children:Ve})}):i,Ue>0&&le&&e.jsx("div",{className:l.default.confidenceScoreContainer,style:null==B?void 0:B.confidenceScoreContainer,children:e.jsxs("span",{className:l.default.confidenceScore,style:null==B?void 0:B.confidenceScore,children:[e.jsx(m.default,{size:14,color:(null==B?void 0:B.confidenceScoreIconColor)||"#166534"}),Ue,"%"]})}),M&&e.jsx("div",{className:l.default.citationLoader,style:null==B?void 0:B.citationLoaderContainer,children:e.jsx(u.default,{customStyles:{container:null==B?void 0:B.citationLoadingContainer,icon:null==B?void 0:B.citationLoadingIcon,text:null==B?void 0:B.citationLoadingText}})}),h&&e.jsx("div",{style:{...null===(ce=null==B?void 0:B.attachedContext)||void 0===ce?void 0:ce.wrapper},className:"flex mt-5",children:e.jsx(C.default,{customStyles:null==B?void 0:B.attachedContext,variant:G})})]})})},exports.splitNestedDiffNodes=Q;
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const e=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode('.UserStoryWithCitation-module_container__YRdbR{box-sizing:border-box;position:relative;width:100%}.UserStoryWithCitation-module_wrapper__wbnqg{border:1px solid #d5d5d5;border-radius:16px;padding:20px}.UserStoryWithCitation-module_heading1__KsWUO{color:#000;font-family:Inter,sans-serif;font-size:1.5rem;margin:.75rem 0 .25rem;padding:0}.UserStoryWithCitation-module_heading2__GHshw{color:#000;font-family:Inter,sans-serif;font-size:1.25rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_heading3__Jm9Xb{color:#000;font-family:Inter,sans-serif;font-size:1.125rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_bold__HenfX{font-family:Inter,sans-serif;font-weight:700}.UserStoryWithCitation-module_paragraph__a1-pc{word-wrap:break-word;display:block;flex-wrap:wrap;font-family:Inter,sans-serif;font-size:1rem;line-height:1.75rem;margin:0;max-width:100%;overflow:hidden;overflow:visible;overflow-wrap:break-word;text-align:justify;white-space:normal;word-break:break-word}.UserStoryWithCitation-module_orderedList__E5PQa{font-family:Inter,sans-serif;list-style-type:decimal;margin-left:1rem}.UserStoryWithCitation-module_unorderedList__SFvpc{font-family:Inter,sans-serif;list-style-type:disc;margin-left:1rem}.UserStoryWithCitation-module_inlineCode__5014y{background-color:#f0f2f5;border-radius:.3rem;box-sizing:border-box;color:#323232;font-family:Source Code Pro,monospace;font-size:.95em;overflow-wrap:break-word;padding:.2rem .5rem;white-space:pre-wrap;width:100%;word-break:break-word}.UserStoryWithCitation-module_blockCode__pmHG5{color:#d63384;display:block;overflow:hidden;white-space:pre-wrap;word-break:break-words}.UserStoryWithCitation-module_learned__0US6d{color:#3b82f6;cursor:pointer;display:inline-block;margin-left:.25rem;margin-right:.25rem}.UserStoryWithCitation-module_linkText__5kBNv:hover{color:#1d4ed8}.UserStoryWithCitation-module_tableWrapper__r94Fx{-webkit-overflow-scrolling:touch;box-sizing:border-box;margin:16px 0;max-width:100%;overflow-x:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd{border:1px solid #d1d5db;border-collapse:collapse;box-sizing:border-box;font-family:Inter,sans-serif;font-size:.95rem;line-height:1.45rem;margin:0;min-width:100%;table-layout:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd td,.UserStoryWithCitation-module_table__tEyKd th{border:1px solid #d1d5db;color:#111827;overflow-wrap:break-word;padding:8px 10px;vertical-align:top;white-space:normal;word-break:normal}.UserStoryWithCitation-module_table__tEyKd th{background:#f3f4f6;font-weight:700;white-space:nowrap}.UserStoryWithCitation-module_table__tEyKd td[align=center],.UserStoryWithCitation-module_table__tEyKd th[align=center]{text-align:center}.UserStoryWithCitation-module_table__tEyKd td[align=right],.UserStoryWithCitation-module_table__tEyKd th[align=right]{text-align:right}.UserStoryWithCitation-module_table__tEyKd tr:nth-child(2n) td{background:#fafafa}.UserStoryWithCitation-module_table__tEyKd p{margin:0}.UserStoryWithCitation-module_scrollContainer__S-BtW{overflow:hidden}.UserStoryWithCitation-module_citationLoader__Op7Sm{bottom:0;left:0;margin-top:12px}.UserStoryWithCitation-module_aiReasoningButton__-tprH{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;gap:2px;padding:2px 4px;vertical-align:middle}.UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6{color:#4b5563;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz{color:#cf4343;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_confidenceScoreContainer__zOE-E{position:absolute;right:12px;top:12px;z-index:10}.UserStoryWithCitation-module_confidenceScore__lhT4p{align-items:center;background-color:#f0fdf4;border:1px solid #bbf7d0;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#166534;display:inline-flex;font-family:Inter,sans-serif;font-size:12px;font-weight:700;gap:4px;padding:4px 8px}.UserStoryWithCitation-module_orderedList__E5PQa{counter-reset:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa>li{counter-increment:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:childItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:childItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:grandchildItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:grandchildItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) "." counter(grandchildItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_inserted__66gBL{background-color:#8cbeff}.UserStoryWithCitation-module_deleted__mzR4t{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}.UserStoryWithCitation-module_preserved__ND8uC{background-color:#fff;text-decoration:underline;text-decoration-color:#d3d3d3}.UserStoryWithCitation-module_citationLink__lHa9C{background:none;border:none;color:inherit;cursor:pointer;font:inherit;padding:0;text-decoration:underline}[class*=_upt-]>[class*=_inserted_]{background-color:#f3e8ff}[class^=_manual-]>[class^=_inserted_]{background-color:#8cbeff}.UserStoryWithCitation-module_negatedOrderedList__RZDGe,.UserStoryWithCitation-module_negatedUnorderedList__ZTOPu{margin:0;padding:0}.UserStoryWithCitation-module_negatedListItem__pcJY9{display:block;margin:0;padding:0}.UserStoryWithCitation-module_negatedListMarker__yWtUn{display:inline;font:inherit}.UserStoryWithCitation-module_negatedListItem__pcJY9>p:first-of-type{display:inline;margin:0}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span{display:inline!important;margin:0!important;width:auto!important}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span>span:not([class*=_hoverActions_]){display:inline!important;width:auto!important}'));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(t)}(),exports.default={container:"UserStoryWithCitation-module_container__YRdbR",wrapper:"UserStoryWithCitation-module_wrapper__wbnqg",heading1:"UserStoryWithCitation-module_heading1__KsWUO",heading2:"UserStoryWithCitation-module_heading2__GHshw",heading3:"UserStoryWithCitation-module_heading3__Jm9Xb",bold:"UserStoryWithCitation-module_bold__HenfX",paragraph:"UserStoryWithCitation-module_paragraph__a1-pc",orderedList:"UserStoryWithCitation-module_orderedList__E5PQa",unorderedList:"UserStoryWithCitation-module_unorderedList__SFvpc",inlineCode:"UserStoryWithCitation-module_inlineCode__5014y",blockCode:"UserStoryWithCitation-module_blockCode__pmHG5",learned:"UserStoryWithCitation-module_learned__0US6d",linkText:"UserStoryWithCitation-module_linkText__5kBNv",tableWrapper:"UserStoryWithCitation-module_tableWrapper__r94Fx",table:"UserStoryWithCitation-module_table__tEyKd",scrollContainer:"UserStoryWithCitation-module_scrollContainer__S-BtW",citationLoader:"UserStoryWithCitation-module_citationLoader__Op7Sm",aiReasoningButton:"UserStoryWithCitation-module_aiReasoningButton__-tprH",aiReasoningIconHighConfidence:"UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6",aiReasoningIconLowConfidence:"UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz",confidenceScoreContainer:"UserStoryWithCitation-module_confidenceScoreContainer__zOE-E",confidenceScore:"UserStoryWithCitation-module_confidenceScore__lhT4p",inserted:"UserStoryWithCitation-module_inserted__66gBL",deleted:"UserStoryWithCitation-module_deleted__mzR4t",preserved:"UserStoryWithCitation-module_preserved__ND8uC",citationLink:"UserStoryWithCitation-module_citationLink__lHa9C",negatedOrderedList:"UserStoryWithCitation-module_negatedOrderedList__RZDGe",negatedUnorderedList:"UserStoryWithCitation-module_negatedUnorderedList__ZTOPu",negatedListItem:"UserStoryWithCitation-module_negatedListItem__pcJY9",negatedListMarker:"UserStoryWithCitation-module_negatedListMarker__yWtUn"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const e=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode('.UserStoryWithCitation-module_container__YRdbR{box-sizing:border-box;position:relative;width:100%}.UserStoryWithCitation-module_wrapper__wbnqg{border:1px solid #d5d5d5;border-radius:16px;padding:20px}.UserStoryWithCitation-module_heading1__KsWUO{color:#000;font-family:Inter,sans-serif;font-size:1.5rem;margin:.75rem 0 .25rem;padding:0}.UserStoryWithCitation-module_heading2__GHshw{color:#000;font-family:Inter,sans-serif;font-size:1.25rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_heading3__Jm9Xb{color:#000;font-family:Inter,sans-serif;font-size:1.125rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_bold__HenfX{font-family:Inter,sans-serif;font-weight:700}.UserStoryWithCitation-module_paragraph__a1-pc{word-wrap:break-word;display:block;flex-wrap:wrap;font-family:Inter,sans-serif;font-size:1rem;line-height:1.75rem;margin:0;max-width:100%;overflow:hidden;overflow:visible;overflow-wrap:break-word;text-align:justify;white-space:normal;word-break:break-word}.UserStoryWithCitation-module_orderedList__E5PQa{font-family:Inter,sans-serif;list-style-type:decimal;margin-left:1rem}.UserStoryWithCitation-module_unorderedList__SFvpc{font-family:Inter,sans-serif;list-style-type:disc;margin-left:1rem}.UserStoryWithCitation-module_inlineCode__5014y{background-color:#f0f2f5;border-radius:.3rem;box-sizing:border-box;color:#323232;font-family:Source Code Pro,monospace;font-size:.95em;overflow-wrap:break-word;padding:.2rem .5rem;white-space:pre-wrap;width:100%;word-break:break-word}.UserStoryWithCitation-module_blockCode__pmHG5{color:#d63384;display:block;overflow:hidden;white-space:pre-wrap;word-break:break-words}.UserStoryWithCitation-module_learned__0US6d{color:#3b82f6;cursor:pointer;display:inline-block;margin-left:.25rem;margin-right:.25rem}.UserStoryWithCitation-module_linkText__5kBNv:hover{color:#1d4ed8}.UserStoryWithCitation-module_tableWrapper__r94Fx{-webkit-overflow-scrolling:touch;box-sizing:border-box;margin:16px 0;max-width:100%;overflow-x:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd{border:1px solid #d1d5db;border-collapse:collapse;box-sizing:border-box;font-family:Inter,sans-serif;font-size:.95rem;line-height:1.45rem;margin:0;min-width:100%;table-layout:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd td,.UserStoryWithCitation-module_table__tEyKd th{border:1px solid #d1d5db;color:#111827;overflow-wrap:break-word;padding:8px 10px;vertical-align:top;white-space:normal;word-break:normal}.UserStoryWithCitation-module_table__tEyKd th{background:#f3f4f6;font-weight:700;white-space:nowrap}.UserStoryWithCitation-module_table__tEyKd td[align=center],.UserStoryWithCitation-module_table__tEyKd th[align=center]{text-align:center}.UserStoryWithCitation-module_table__tEyKd td[align=right],.UserStoryWithCitation-module_table__tEyKd th[align=right]{text-align:right}.UserStoryWithCitation-module_table__tEyKd tr:nth-child(2n) td{background:#fafafa}.UserStoryWithCitation-module_table__tEyKd p{margin:0}.UserStoryWithCitation-module_scrollContainer__S-BtW{overflow:hidden}.UserStoryWithCitation-module_citationLoader__Op7Sm{bottom:0;left:0;margin-top:12px}.UserStoryWithCitation-module_aiReasoningButton__-tprH{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;gap:2px;padding:2px 4px;vertical-align:middle}.UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6{color:#4b5563;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz{color:#cf4343;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_confidenceScoreContainer__zOE-E{position:absolute;right:12px;top:12px;z-index:10}.UserStoryWithCitation-module_confidenceScore__lhT4p{align-items:center;background-color:#f0fdf4;border:1px solid #bbf7d0;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#166534;display:inline-flex;font-family:Inter,sans-serif;font-size:12px;font-weight:700;gap:4px;padding:4px 8px}.UserStoryWithCitation-module_orderedList__E5PQa{counter-reset:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa>li{counter-increment:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:childItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:childItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:grandchildItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:grandchildItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) "." counter(grandchildItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_inserted__66gBL{background-color:#8cbeff}.UserStoryWithCitation-module_deleted__mzR4t{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}.UserStoryWithCitation-module_preserved__ND8uC{background-color:#fff;text-decoration:underline;text-decoration-color:#d3d3d3}.UserStoryWithCitation-module_citationLink__lHa9C{background:none;border:none;color:inherit;cursor:pointer;font:inherit;padding:0;text-decoration:underline}[class*=_upt-]>[class*=_inserted_]{background-color:#f3e8ff}[class^=_manual-]>[class^=_inserted_]{background-color:#8cbeff}.UserStoryWithCitation-module_negatedOrderedList__RZDGe,.UserStoryWithCitation-module_negatedUnorderedList__ZTOPu{margin:0;padding:0}.UserStoryWithCitation-module_negatedListItem__pcJY9{display:block;margin:0;padding:0}.UserStoryWithCitation-module_negatedListMarker__yWtUn{display:inline;font:inherit}.UserStoryWithCitation-module_negatedListItem__pcJY9>p:first-of-type{display:inline;margin:0}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span{display:inline!important;margin:0!important;width:auto!important}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span>span:not([class*=_hoverActions_]){display:inline!important;width:auto!important}.UserStoryWithCitation-module_tableMenuWrapper__QdxLp{isolation:isolate;position:relative}.UserStoryWithCitation-module_tableMenuButton__MBrVD{align-items:center;background:#0000;border:1px solid #0000;border-radius:6px;color:#475569;cursor:pointer;display:flex;justify-content:center;position:absolute;right:1px;top:1px;transition:background-color .18s ease,border-color .18s ease,color .18s ease;width:38px;z-index:2}.UserStoryWithCitation-module_tableMenuButtonActive__a7LxI,.UserStoryWithCitation-module_tableMenuButton__MBrVD:hover{background:#f1f5f9;border-color:#e2e8f0;color:#0f172a}.UserStoryWithCitation-module_tableMenuButton__MBrVD:focus-visible{outline:2px solid #183ec2;outline-offset:2px}.UserStoryWithCitation-module_tableWithMenu__ZBwbB th:last-child{padding-right:var(--table-menu-reserved,44px)}'));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(t)}(),exports.default={container:"UserStoryWithCitation-module_container__YRdbR",wrapper:"UserStoryWithCitation-module_wrapper__wbnqg",heading1:"UserStoryWithCitation-module_heading1__KsWUO",heading2:"UserStoryWithCitation-module_heading2__GHshw",heading3:"UserStoryWithCitation-module_heading3__Jm9Xb",bold:"UserStoryWithCitation-module_bold__HenfX",paragraph:"UserStoryWithCitation-module_paragraph__a1-pc",orderedList:"UserStoryWithCitation-module_orderedList__E5PQa",unorderedList:"UserStoryWithCitation-module_unorderedList__SFvpc",inlineCode:"UserStoryWithCitation-module_inlineCode__5014y",blockCode:"UserStoryWithCitation-module_blockCode__pmHG5",learned:"UserStoryWithCitation-module_learned__0US6d",linkText:"UserStoryWithCitation-module_linkText__5kBNv",tableWrapper:"UserStoryWithCitation-module_tableWrapper__r94Fx",table:"UserStoryWithCitation-module_table__tEyKd",scrollContainer:"UserStoryWithCitation-module_scrollContainer__S-BtW",citationLoader:"UserStoryWithCitation-module_citationLoader__Op7Sm",aiReasoningButton:"UserStoryWithCitation-module_aiReasoningButton__-tprH",aiReasoningIconHighConfidence:"UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6",aiReasoningIconLowConfidence:"UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz",confidenceScoreContainer:"UserStoryWithCitation-module_confidenceScoreContainer__zOE-E",confidenceScore:"UserStoryWithCitation-module_confidenceScore__lhT4p",inserted:"UserStoryWithCitation-module_inserted__66gBL",deleted:"UserStoryWithCitation-module_deleted__mzR4t",preserved:"UserStoryWithCitation-module_preserved__ND8uC",citationLink:"UserStoryWithCitation-module_citationLink__lHa9C",negatedOrderedList:"UserStoryWithCitation-module_negatedOrderedList__RZDGe",negatedUnorderedList:"UserStoryWithCitation-module_negatedUnorderedList__ZTOPu",negatedListItem:"UserStoryWithCitation-module_negatedListItem__pcJY9",negatedListMarker:"UserStoryWithCitation-module_negatedListMarker__yWtUn",tableMenuWrapper:"UserStoryWithCitation-module_tableMenuWrapper__QdxLp",tableMenuButton:"UserStoryWithCitation-module_tableMenuButton__MBrVD",tableMenuButtonActive:"UserStoryWithCitation-module_tableMenuButtonActive__a7LxI",tableWithMenu:"UserStoryWithCitation-module_tableWithMenu__ZBwbB"};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.module.css.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="data-menu-table";exports.BLOCK_SELECTOR='[data-block-id^="user-story-card-wrapper-"]',exports.TABLE_MARKER=e,exports.serializeTable=t=>{const r=t.cloneNode(!0);return r.removeAttribute(e),r.outerHTML};
|
|
2
|
+
//# sourceMappingURL=helperFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helperFunctions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as l}from"react/jsx-runtime";import{useState as o,useRef as n,useEffect as i}from"react";import{Info as a,ChevronUp as s,ChevronDown as r,Users as d,ExternalLink as u,Download as c,Share2 as v,Copy as p,LoaderCircle as m,PencilIcon as h,RefreshCw as y,Plus as g,Trash2 as f,X as S,Ellipsis as C,Hourglass as b,Check as I,ChevronUpIcon as w,ChevronDownIcon as N,Bookmark as E}from"lucide-react";import D from"showdown";import{Tooltip as B,Menu as x,MenuItem as A}from"@mui/material";import T 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 L,postprocessUserStoryAfterEdit as M}from"../../utils/user-story.utils.js";import F from"../../shared/AtomicButton.js";import $ from"../RichTextEditor/RichTextEditor.js";import _ from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as W,useRequirementAI as z,ToasterId as j}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as O}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as V}from"./TitleEditor/TitleEditor.js";import{fetchRedlineDocumentSection as G,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={[W.WAITING]:"WAITING TO GENERATE",[W.IN_PROGRESS]:"IN PROGRESS",[W.GENERATED]:"GENERATED",[W.FAILED]:"FAILED",[W.GENERATE]:"GENERATE",[W.APPROVED]:"APPROVED"};function oe(e){const t=[],o=/<learned>(.*?)<\/learned>/g;let n,i=0,s=0;for(;null!==(n=o.exec(e));){const[,r]=n,d=n.index;d>i&&t.push(l("span",{children:e.slice(i,d)},"text-pre-"+s++)),t.push(l(B,{title:r,placement:"top",children:l(a,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${U()}`)),i=o.lastIndex}return i<(null==e?void 0:e.length)&&t.push(l("span",{children:e.slice(i)},"text-post-"+s++)),t}function ne(e,t,l){var o;if(!e)return{};if(t)return{...e.parentConfig};const n={...e.childConfig};return l&&(null===(o=e.subFeatureOverrides)||void 0===o?void 0:o[l])?{...n,...e.subFeatureOverrides[l]}:n}const ie=({displayName:t})=>{var o;const{customStyles:n}=z(),i=null===(o=null==n?void 0:n.userStoryCardStyles)||void 0===o?void 0:o.showDisplayName;return e("div",{className:k.displayName,style:null==i?void 0:i.wrapper,children:[l(E,{className:k.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},ae=({isUserStoryCurrentlyUpdated:w,artifactId:N,artifactTitleId:E,parentUserStory:q,currentUserStory:Y,onUserStoryChange:se,parentIndex:re,currentIndex:de,enableDownload:ue,isDiffEditReviewMode:ce,showUserStoryDiff:ve,handleDownloadUserStory:pe,handleOpenSendDialog:me,updateUserStoryArtifact:he,selectedArtifactId:ye,isDisplayHighlightControl:ge,elementDisplayConfig:fe,_resolvedConfig:Se,showWrapper:Ce=!1,defaultExpanded:be,actionItemsConfig:Ie,onDelete:we,contextVariant:Ne,expandedSubFeatures:Ee,showDisplayName:De=!0,allowTitleEdit:Be=!0,showConfidenceScore:xe=!0,showBorderTop:Ae=!0,sectionStatusConfig:Te,showCompletionPanel:Ue=!1,completionPanelConfig:ke,showAddSectionButton:Pe=!1,disableEditPlan:Re=!1,useMuiTooltip:Le=!1,approveButtonConfig:Me,editButtonConfig:Fe,CDNeededInChip:$e,blockNumber:_e,storyNumber:We,showWaitingIconInChip:ze,showAssignSection:je=!1,disableAssignSection:Oe=!1,onAssignSectionClick:Ve,onSave:Ge,onUserStoryAccordionStateChange:He,showSuggestedFilesInfo:qe=!1,suggestedFilesConfig:Ye})=>{var Qe,Ze,Je,Ke,Xe,et,tt,lt,ot,nt,it,at,st,rt,dt,ut,ct,vt,pt,mt,ht,yt,gt,ft,St,Ct,bt,It,wt,Nt,Et;const{isLoadingSectionData:Dt=!1,onLoadSectionData:Bt,status:xt,onStatusClick:At,completedCount:Tt,totalCount:Ut,isNoDataAvailable:kt=!1}=null!=Te?Te:{},{searchQueryList:Pt,citations:Rt,customStyles:Lt,onEditBlocked:Mt,redlineDcoumentId:Ft,redlineConfig:$t,customSectionConfig:_t,updateRedlineDataParent:Wt,aiReasoning:zt,redlineCollaborativeConfig:jt,selectedSectionToEdit:Ot,setSelectedSectionToEdit:Vt}=z(),Gt=null==Lt?void 0:Lt.userStoryCardStyles,Ht=null==Gt?void 0:Gt.customSectionEditButton,qt=null==Gt?void 0:Gt.statusStyles,Yt=null===(Qe=null==Lt?void 0:Lt.userStoryCardStyles)||void 0===Qe?void 0:Qe.userStoryEditStyles,Qt=null===(Ze=null==Lt?void 0:Lt.userStoryScreenStyles)||void 0===Ze?void 0:Ze.userStoryContentStyles,Zt=null==Gt?void 0:Gt.progressHeaderStyles,Jt=null==Gt?void 0:Gt.clinicalTrialSectionStyles,Kt=null==Gt?void 0:Gt.CompletionStyles,Xt=null==Gt?void 0:Gt.noDataStyles,el=null==Gt?void 0:Gt.approveButtonStyles;null==Gt||Gt.suggestedFilesStyles;const tl=null!==(Ke=null===(Je=null==_t?void 0:_t.shouldRender)||void 0===Je?void 0:Je.call(_t,Y))&&void 0!==Ke&&Ke,ll=null===(Xe=null==_t?void 0:_t.getValue)||void 0===Xe?void 0:Xe.call(_t,Y),ol=null!==(tt=null===(et=null==_t?void 0:_t.getFields)||void 0===et?void 0:et.call(_t,Y))&&void 0!==tt?tt:[],nl=null!==(lt=null==_t?void 0:_t.isEditDisabled)&&void 0!==lt&<,il=null!==(nt=null===(ot=null==_t?void 0:_t.isSaving)||void 0===ot?void 0:ot.call(_t,Y))&&void 0!==nt&&nt,al=((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!==(it=Y.completion_percentage)&&void 0!==it?it:0,Kt),sl={[W.WAITING]:null==qt?void 0:qt.waiting,[W.IN_PROGRESS]:null==qt?void 0:qt.inProgress,[W.GENERATED]:null==qt?void 0:qt.generated,[W.FAILED]:null==qt?void 0:qt.failed,[W.GENERATE]:null==qt?void 0:qt.generate,[W.APPROVED]:null==qt?void 0:qt.approved},[rl,dl]=o({...structuredClone(Y),value:P(Y.value)||""}),[ul,cl]=o({userStory:!!Y.isDefaultEdit}),[vl,pl]=o(!1),[ml,hl]=o(!1),[yl,gl]=o(null),[fl,Sl]=o(null),{userStory:Cl,customIcons:bl}=z(),[Il,wl]=o(null!=be?be:""===re||ye===Y.artifactId||!!Y.isDefaultOpen),[Nl,El]=o(!1),[Dl,Bl]=o(null),[xl,Al]=o(null),[Tl,Ul]=o(!1),kl=n(null),Pl=n(null),Rl=n(null),[Ll,Ml]=o(!1),[Fl,$l]=o(!1),_l=n(null),[Wl,zl]=o(!1),[jl,Ol]=o(!1),[Vl,Gl]=o(Y.value);i(()=>{w&&wl(w)},[w]),i(()=>{dl({...structuredClone(Y),value:P(Y.value)||""})},[Y]),i(()=>{Pt.length>0?wl(!0):void 0===be&&ye&&wl(ye===Y.artifactId)},[Pt,ye,Y.artifactId]),i(()=>{Ee&&Ee.length>0&&We&&_e&&wl(Ee.includes(`${We}-${_e}`)||""===re||ye===Y.artifactId||!!Y.isDefaultOpen)},[Ee,We,_e]),i(()=>{if(!jl)return;const e=e=>{Pl.current&&!Pl.current.contains(e.target)&&Ol(!1)};return document.addEventListener("mousedown",e,!0),()=>{document.removeEventListener("mousedown",e,!0)}},[jl]);const Hl=()=>{Bl(null)},ql=()=>{Al(null)},Yl=()=>{if(Il&&ul.userStory&&Rl.current&&!Rl.current.requestClose())return;const e=!Il;wl(e),null==He||He(Y,e)},Ql=async()=>{var e,t;try{"userStory"==="userStory"&&(se(rl),console.log("I am changing RTE editor values",rl)),await(null===(e=null==Fe?void 0:Fe.onSaveEditedSection)||void 0===e?void 0:e.call(Fe,rl)),await he(Rt,Cl,N,null===(t=_l.current)||void 0===t?void 0:t.signal)}finally{}};const Zl=null!=(null==Y?void 0:Y.big_enough)&&!Number.isNaN(Y.big_enough)&&!!(null==Y?void 0:Y.big_enough_decision_factors),Jl=null!==(at=null==Y?void 0:Y.completion_percentage)&&void 0!==at?at:0,Kl=!!(null==Y?void 0:Y.completion_decision_factors),Xl=""===re,eo=null!=Se?Se:ne(fe,Xl),to=!ce&&!ve;i(()=>{if(!fl)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${fl}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[fl]);const[lo,oo]=o(0),[no,io]=o(!1),ao=async()=>{var e,t;let l=!0;if(io(e=>(l=!e,!0)),l){let l;oo(e=>(l=e,e));try{const{updated_reqai:o}=await G({documentId:Ft,sectionId:Y.artifactId,baseApiUrl:null==$t?void 0:$t.editorBaseApiUrl,redlineConfigId:null!==(e=null==$t?void 0:$t.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==$t?void 0:$t.token)&&void 0!==t?t:"");await(null==Wt?void 0:Wt(o)),oo(e=>l===e?0:1)}catch(e){console.error("failed to fetch latest user story: ",e),ee.error("Failed to fetch the latest user story. Please try again.")}io(!1)}};i(()=>{Y.isDefaultEdit&&cl(e=>({...e,userStory:!0}))},[Y.isDefaultEdit]),console.log("block number in userstory card ",_e),console.log("[TESTING-CURRENT-USER-STORY] \n",Y,"\n[TESTING-USER-STORY] \n",Cl),X(`redline-edit:${Ft}:${Y.artifactId}`,async({updatedBy:o})=>{var n;null===(n=_l.current)||void 0===n||n.abort(),oo(e=>e+1),cl(n=>n.userStory?(ee.custom(t=>e(te,{onCancel:()=>ee.dismiss(t.id),onRefresh:()=>{ee.dismiss(t.id),ao()},children:["This ",l("span",{style:{fontWeight:600},children:Y.title})," section has been updated by ",l("span",{style:{fontWeight:600},children:o})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:j}),{...Cl,userStory:!1}):(ao().then(()=>{ee.custom(n=>e(te,{onCancel:()=>ee.dismiss(n.id),title:e(t,{children:[l("span",{style:{fontWeight:600},children:Y.title})," updated,",l("br",{})]}),children:[o," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:j})}),n))});return i(()=>Gl(Y.value),[Y.value]),e("div",{className:k.card,"data-block-id":`user-story-card-wrapper-${We}-${_e}`,style:null==Gt?void 0:Gt.cardStyle,id:`story-card-${Y.title}`,"data-expanded":Il,children:[e("div",{className:k.titleSection,style:null==Gt?void 0:Gt.titleSection,children:[e("div",{className:k.titleRow,style:null==Gt?void 0:Gt.titleRow,onClick:Yl,children:[e("div",{className:k.titleLeft,style:null==Gt?void 0:Gt.titleLeft,onMouseEnter:()=>Ml(!0),onMouseLeave:()=>Ml(!1),children:[De&&l(ie,{displayName:E}),vl&&to?l(V,{title:Y.title,onSave:e=>(async(e,t)=>{var l;try{let o={...Y};Y.artifactId===t?o.title=e:o.sub_features=(null===(l=Y.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],dl(o),se(o),pl(!1)}catch(e){console.error("Failed to save title",e)}})(e,Y.artifactId),onCancel:()=>{pl(!1)},inputStyle:null==Yt?void 0:Yt.inlineTitleInput,confirmButtonStyle:null==Yt?void 0:Yt.inlineTitleConfirm,cancelButtonStyle:null==Yt?void 0:Yt.inlineTitleCancel},"inline-title-editor"):e("div",{className:k.storyTitleWrapper,children:[l(B,{title:oe(Y.title),arrow:!0,children:l("h2",{title:Le?void 0:Y.title,className:k.storyTitle,style:null==Gt?void 0:Gt.storyTitle,children:oe(Y.title)},Y.artifactId)}),qe&&!tl&&l("div",{ref:Pl,style:{display:"inline-flex"},children:l(B,{open:jl&&!(null==Ye?void 0:Ye.isLoading)&&!!(null===(st=null==Ye?void 0:Ye.files)||void 0===st?void 0:st.length),disableHoverListener:!0,disableFocusListener:!0,disableTouchListener:!0,placement:"bottom",PopperProps:{disablePortal:!0},arrow:!0,componentsProps:{tooltip:{className:k.suggestedFilesTooltip,sx:{backgroundColor:"#334155",color:"#fff",maxWidth:400,padding:0,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},arrow:{sx:{color:"#334155"}}},title:e("div",{onClick:e=>e.stopPropagation(),children:[e("div",{style:{fontWeight:700,fontSize:15,color:"#fff",padding:"12px 14px 10px 14px",borderBottom:"1px solid rgba(255,255,255,0.15)",whiteSpace:"nowrap"},children:[null!==(rt=null==Ye?void 0:Ye.title)&&void 0!==rt?rt:"Suggested files to generate this section"," ","(",null!==(ut=null===(dt=null==Ye?void 0:Ye.files)||void 0===dt?void 0:dt.length)&&void 0!==ut?ut:0,")"]}),l("ol",{className:k.suggestedFilesList,style:{margin:0,padding:"8px 14px 10px 14px",maxHeight:180,overflowY:"auto",listStyle:"none"},children:null===(ct=null==Ye?void 0:Ye.files)||void 0===ct?void 0:ct.map((t,l)=>e("li",{style:{fontSize:14,color:"#CBD5E1",padding:"6px 0",whiteSpace:"nowrap"},children:[l+1,". ",t]},l))})]}),children:l(a,{size:16,style:{cursor:(null==Ye?void 0:Ye.isLoading)||!(null===(vt=null==Ye?void 0:Ye.files)||void 0===vt?void 0:vt.length)?"not-allowed":"pointer",color:"#94A3B8",marginLeft:4,opacity:(null==Ye?void 0:Ye.isLoading)||!(null===(pt=null==Ye?void 0:Ye.files)||void 0===pt?void 0:pt.length)?.4:1,transition:"opacity 0.15s ease"},onClick:e=>{var t;e.stopPropagation(),!(null==Ye?void 0:Ye.isLoading)&&(null===(t=null==Ye?void 0:Ye.files)||void 0===t?void 0:t.length)&&Ol(e=>!e)}})})}),Ue&&(Kl?l(Z,{customIcons:null==bl?void 0:bl.userStoryIcons,customStyles:null==Gt?void 0:Gt.aiReasoningCitaionStyles,currentUserStory:Y,panelStyles:null==Gt?void 0:Gt.CompletionStyles,onToggleStateChange:$l,completionPanelConfig:ke,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Kt?void 0:Kt.badge,...al},children:[e("span",{children:[Jl,"% Completed"]}),l("span",{style:{display:"flex",alignItems:"center"},children:l(J,{color:"currentColor"})}),l(Fl?s:r,{size:14,style:null==Kt?void 0:Kt.chevronStyle})]})}):l("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Kt?void 0:Kt.badge,...al},children:e("span",{children:[Jl,"% Completed"]})})),Be&&l("button",{type:"button",className:k.titleEditButton,style:null==Yt?void 0:Yt.titleEditButton,onClick:e=>{e.stopPropagation(),pl(!0),Il||wl(!0)},"aria-label":"Edit title",title:"Edit title",children:l("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("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"})})})]})]}),(xt||void 0!==Tt&&void 0!==Ut)&&e("div",{className:k.statusContainer,children:[void 0!==Tt&&void 0!==Ut&&e("div",{className:k.completedBadge,children:["Completed: ",Tt,"/",Ut]}),xt&&l("button",{type:"button",onClick:e=>{e.stopPropagation(),null==At||At()},onMouseEnter:()=>zl(!0),onMouseLeave:()=>zl(!1),className:k.statusButton,style:{...null===(mt=sl[xt])||void 0===mt?void 0:mt.default,...Wl&&(null===(ht=sl[xt])||void 0===ht?void 0:ht.hover)},children:le[xt]})]}),e("div",{className:k.titleActions,style:null==Gt?void 0:Gt.titleActions,onClick:e=>e.stopPropagation(),children:[(eo.showProgressPercentage||eo.showGapBox)&&Ce&&e("div",{className:k.progressHeader,style:null==Zt?void 0:Zt.wrapper,children:[eo.showProgressPercentage&&e("div",{className:k.progressPercentage,style:null==Zt?void 0:Zt.percentage,children:[null!==(gt=null!==(yt=null==Y?void 0:Y.confidenceScore)&&void 0!==yt?yt:null==eo?void 0:eo.confidenceValue)&&void 0!==gt?gt:"0","%"]}),eo.showGapBox&&e("div",{className:k.gapBox,style:null==Zt?void 0:Zt.gapBox,children:[null!==(St=null!==(ft=null==Y?void 0:Y.gapValue)&&void 0!==ft?ft:null==eo?void 0:eo.gapBoxValue)&&void 0!==St?St:"2"," ","Gaps"]})]}),Zl&&l(O,{customIcons:null==bl?void 0:bl.userStoryIcons,customStyles:null==Gt?void 0:Gt.aiReasoningCitaionStyles,currentUserStory:Y,panelStyles:null==Gt?void 0:Gt.BigEnoughStyles}),je&&l("button",{type:"button",className:k.iconButton,style:null==Gt?void 0:Gt.iconButton,disabled:Oe,onClick:e=>{e.stopPropagation(),null==Ve||Ve(Y)},"aria-label":"Assign section users",title:"Assign section users",children:l(d,{size:16})}),!ul.userStory&&e(t,{children:[!1!==(null==eo?void 0:eo.showShareButton)&&l("button",{className:k.iconButton,style:null==Gt?void 0:Gt.iconButton,onClick:e=>{Bl(e.currentTarget)},children:l(u,{size:16})}),e(x,{id:"user-story-share-menu",anchorEl:Dl,open:!!Dl,onClose:()=>Bl(null),style:null==Gt?void 0:Gt.userStoryShareMenu,children:[ue&&l(A,{style:null==Gt?void 0:Gt.userStoryMenuItem,onClick:async()=>{El(!0),pe&&(await Promise.all([pe("pdf"),pe("doc")]),El(!1))},children:e("div",{ref:kl,className:k.menuItemContent,style:null==Gt?void 0:Gt.menuItemContent,children:[l(c,{size:16,color:null==Gt?void 0:Gt.menuIconColor}),l("p",{style:null==Gt?void 0:Gt.menuLabel,children:"Download"})]})}),l(A,{style:null==Gt?void 0:Gt.userStoryMenuItem,onClick:async()=>{let e=Y;q&&(e={...Y,value:`${L(null==q?void 0:q.value,Y.title)} \n${Y.value}`}),null==me||me(!0,[e],Y.artifactId),Hl()},children:e("div",{style:null==Gt?void 0:Gt.menuItemContent,className:k.menuItemContentPadded,children:[l(v,{size:16,color:null==Gt?void 0:Gt.menuIconColor}),l("p",{style:null==Gt?void 0:Gt.menuLabel,children:"Send"})]})}),l(A,{style:null==Gt?void 0:Gt.userStoryMenuItem,onClick:async()=>{const e=(new D.Converter).makeHtml(P(Y.value)||Y.value),t=function(e){const t=(new D.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(P(Y.value)||Y.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{Hl()}},children:e("div",{style:null==Gt?void 0:Gt.menuItemContent,className:k.menuItemContentPadded,children:[l(p,{size:16,color:null==Gt?void 0:Gt.menuIconColor}),l("p",{style:null==Gt?void 0:Gt.menuLabel,children:"Copy"})]})})]})]}),!Tl&&ul.userStory&&Il?l(F,{type:"outline",children:"Cancel",style:null==Gt?void 0:Gt.cancelButton,onClick:()=>{var e,t;if(null===(e=_l.current)||void 0===e||e.abort(),cl(e=>({...e,userStory:!1})),null==jt?void 0:jt.initiateCollaborativeFlow){Vt(null);const e={email:(null==$t?void 0:$t.userEmail)||"",operation:"end"};null===(t=null==jt?void 0:jt.onChangeActiveSectionMember)||void 0===t||t.call(jt,e),K.emit(`redline-document-edit:${Ft}`,e)}}}):l(t,{}),ul.userStory&&Il?l(F,{type:"fill",children:Tl?e("span",{className:k.savingSpinner,style:null==Gt?void 0:Gt.savingSpinner,children:[l(m,{className:k.spinAnimation,style:null==Gt?void 0:Gt.spinAnimation}),l("span",{children:"Saving..."})]}):"Save",isDisable:Tl,style:Tl?null==Gt?void 0:Gt.savingButton:null==Gt?void 0:Gt.saveButton,onClick:async()=>{var e;Ul(!0),await Ql();let t=await(async()=>{var e,t,l,o,n,i,a,s;let r=rl.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{await(null==Ge?void 0:Ge(r,Y.artifactId))}catch(e){}try{if(null==$t?void 0:$t.callUpdateDocument){const{updated_reqai:d}=await H({documentId:Ft,sectionId:Y.artifactId,baseApiUrl:null==$t?void 0:$t.baseApiUrl,updatedContent:r,userEmail:$t.userEmail,userName:$t.userName,redlineConfigId:null!==(e=$t.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==$t?void 0:$t.token)&&void 0!==t?t:"");r=null===(n=null===(o=null===(l=null==d?void 0:d.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===o?void 0:o[0])||void 0===n?void 0:n.value,await(null==Wt?void 0:Wt(d));const u=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;"string"==typeof u&&u.trim()&&"string"==typeof Ft&&Ft.trim()&&"string"==typeof(null==$t?void 0:$t.userName)&&(null==$t?void 0:$t.userName.trim())?K.emit(`redline-edit:${Ft}:${u}`,{updatedBy:null==$t?void 0:$t.userName}):console.error("invalid cwsEvent name or payload")}}catch(e){console.error("failed to update redline document",e),r=Vl}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 l={...rl,value:t};if(se({...l,isDefaultEdit:!1}),Gl(l.value),cl(e=>({...e,userStory:!1})),Ul(!1),null==jt?void 0:jt.initiateCollaborativeFlow){Vt(null);const t={email:(null==$t?void 0:$t.userEmail)||"",operation:"end"};null===(e=null==jt?void 0:jt.onChangeActiveSectionMember)||void 0===e||e.call(jt,t),K.emit(`redline-document-edit:${Ft}`,t)}}}):!lo&&!ce&&!ve&&!Re&&Il&&!1!==(null==eo?void 0:eo.showEditButton)&&l("button",{className:k.iconButton,style:null==Gt?void 0:Gt.editButton,onClick:()=>{var e;if(null==jt?void 0:jt.initiateCollaborativeFlow){if(Ot)return void ee.error("Please save or cancel current editing section first");{Vt(Y.artifactId);const t={sectionTitle:Y.title,email:(null==$t?void 0:$t.userEmail)||"",operation:"start"};null===(e=null==jt?void 0:jt.onChangeActiveSectionMember)||void 0===e||e.call(jt,t),K.emit(`redline-document-edit:${Ft}`,t)}}cl(e=>({...e,userStory:!0}))},children:l(h,{color:null==Gt?void 0:Gt.pencilIconColor,size:16})}),(null==jt?void 0:jt.initiateCollaborativeFlow)&&!!lo&&l(B,{title:"Fetch latest section",children:l(y,{color:no?"#d3d3d3":"black",onClick:ao})}),Pe&&Xl&&Il&&!ce&&!ve&&!1!==(null==eo?void 0:eo.showEditButton)&&e("button",{type:"button",className:k.addSectionButton,style:null==Yt?void 0:Yt.addSectionButton,onClick:e=>{var t,l,o;e.stopPropagation();const n=(null!==(l=null===(t=Y.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:U(),title:`New Section ${n}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...Y,sub_features:[...null!==(o=Y.sub_features)&&void 0!==o?o:[],i]};dl(a),se(a),wl(!0),Sl(i.title)},"aria-label":"Add section",title:"Add section",children:[l(g,{size:14}),l("span",{className:k.addSectionLabel,children:"Add Section"})]}),!Xl&&!ce&&!Re&&!ve&&l("button",{type:"button",onClick:e=>{e.stopPropagation(),null==we||we()},className:k.iconButton,style:null==Yt?void 0:Yt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:l(f,{size:16})}),tl&&l("button",{type:"button",className:k.iconButton,style:null==Ht?void 0:Ht.button,disabled:nl,onClick:e=>{if(e.stopPropagation(),ml)return gl(null),void hl(!1);gl(structuredClone(null!=ll?ll:{})),wl(!0),hl(!0)},children:ml?l(S,{size:16,color:null==Gt?void 0:Gt.pencilIconColor,style:null==Ht?void 0:Ht.cancelIcon}):l(h,{size:16,color:null==Gt?void 0:Gt.pencilIconColor,style:null==Ht?void 0:Ht.editIcon})}),(null==eo?void 0:eo.actionItemsButton)&&e(t,{children:[l("span",{className:k.actionItemBtn,style:null==Gt?void 0:Gt.actionItemBtn,onClick:e=>{e.stopPropagation(),Al(e.currentTarget)},children:l(C,{})}),l(x,{id:"user-story-action-menu",anchorEl:xl,open:!!xl,onClose:ql,style:null==Gt?void 0:Gt.userStoryShareMenu,children:null==Ie?void 0:Ie.items.map((t,o)=>l(A,{style:null==Gt?void 0:Gt.userStoryMenuItem,onClick:()=>{t.onclick(Y),ql()},children:e("div",{className:k.menuItemContent,style:{...null==Gt?void 0:Gt.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[l("span",{className:k.menuItemIcon,style:null==Gt?void 0:Gt.menuItemIcon,children:t.icon}),l("p",{style:null==Gt?void 0:Gt.menuLabel,children:t.name}),l("span",{className:k.menuItemRight,style:null==Gt?void 0:Gt.menuItemRight})]})},`action-item-${o}-${t.name}`))})]}),l("button",{type:"button",onClick:e=>{e.stopPropagation(),Yl()},style:null==Gt?void 0:Gt.chevronButton,className:k.chevronButton,children:l(Il?s:r,{className:k.chevronIcon,color:null==Gt?void 0:Gt.chevronIconColor})})]})]}),l("div",{className:k.divider,style:null==Gt?void 0:Gt.dividerStyle})]}),Il&&l("div",{className:k.cardContent,style:{...null==Gt?void 0:Gt.cardContentStyle,borderTop:Ae?"1px solid #E5E5E5":"none"},children:e("div",Dt?{className:k.loadingContainer,children:[l("div",{className:k.loadingIconWrapper,children:l(b,{size:28,color:"#5B3DF5",className:k.spinAnimation})}),e("div",{children:[l("h3",{className:k.loadingTitle,children:"Section generation in progress.."}),l("p",{className:k.loadingSubtitle,children:"This may take a few minutes"})]}),l("button",{type:"button",onClick:()=>null==Bt?void 0:Bt(),className:k.viewStatusButton,children:"View Status"})]}:kt?{className:k.noDataContainer,style:null==Xt?void 0:Xt.container,children:[l("img",{src:T,alt:"No data available",className:k.noDataIllustration,style:null==Xt?void 0:Xt.illustration}),l("h3",{className:k.noDataTitle,style:null==Xt?void 0:Xt.title,children:"No Data Available for This Section"}),l("p",{className:k.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:k.contentInner,style:null==Gt?void 0:Gt.contentInner,children:[e("div",{className:k.descriptionSection,style:null==Gt?void 0:Gt.descriptionSection,children:[l("div",{className:k.justifyBetween,style:null==Gt?void 0:Gt.justifyBetween}),ul.userStory?l($,{ref:Rl,minHeight:"100%",height:"100%",type:"string",value:P(Vl)||"",handleUpdateState:(e,t)=>{const l=M(R(t));dl(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:ul.userStory?"edit":"readOnly",onEditBlocked:Mt,onSaveUnsavedChanges:async()=>{await Ql(),wl(!1)},onDiscardUnsavedChanges:()=>{dl({...structuredClone(Y),value:P(Y.value)||""}),cl(e=>({...e,userStory:!1})),wl(!1)},isSavingUnsavedChanges:Tl}):tl?l(Q,{styles:Jt,fields:ol,readonly:!ml,isSaving:il,value:null!==(Ct=null!=yl?yl:ll)&&void 0!==Ct?Ct:{},onChange:gl,onSave:async()=>{var e;yl&&(await(null===(e=null==_t?void 0:_t.onSave)||void 0===e?void 0:e.call(_t,Y,yl)),gl(null),hl(!1))},onCancel:()=>{gl(null),hl(!1)}}):e(t,{children:[l(_,{showUserStoryDiff:ve,isParent:""===re,message:P(Y.value)||"",artifactId:Y.artifactId,customStyles:Qt,isDisplayHighlightControl:ge,contextVariant:Ne,showConfidenceScore:xe,CDNeededInChip:$e,blockId:_e,storyId:We,showWaitingIconInChip:ze}),(Me||Fe)&&e("div",{className:k.actionButtonsContainer,style:null==el?void 0:el.container,children:[Fe&&!ul.userStory&&e(t,{children:[l("button",{type:"button",className:k.actionButton,style:null==el?void 0:el.button,disabled:Fe.disabled||Fe.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Fe.onClick)||void 0===t||t.call(Fe),cl(e=>({...e,userStory:!0})),wl(!0)},children:Fe.isLoading?e(t,{children:[l(m,{size:16,className:k.actionButtonSpinner,style:null==el?void 0:el.icon}),l("span",{style:null==el?void 0:el.text,children:null!==(bt=Fe.label)&&void 0!==bt?bt:"Edit"})]}):e(t,{children:[l(h,{size:16,style:null==el?void 0:el.icon}),l("span",{style:null==el?void 0:el.text,children:null!==(It=Fe.label)&&void 0!==It?It:"Edit"})]})}),Me&&l("span",{className:k.actionButtonDivider})]}),Me&&l("button",{type:"button",className:k.actionButton,style:null==el?void 0:el.button,disabled:Me.disabled||Me.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Me.onClick)||void 0===t||t.call(Me)},children:Me.isLoading?e(t,{children:[l(m,{size:16,className:k.actionButtonSpinner,style:null==el?void 0:el.icon}),l("span",{style:null==el?void 0:el.text,children:null!==(wt=Me.label)&&void 0!==wt?wt:"Approve"})]}):e(t,{children:[l(I,{size:16,style:null==el?void 0:el.icon}),l("span",{style:null==el?void 0:el.text,children:null!==(Nt=Me.label)&&void 0!==Nt?Nt:"Approve"})]})})]})]})]}),null===(Et=rl.sub_features)||void 0===Et?void 0:Et.map((e,t)=>{console.log("UserStoryCardWrapper: sub",e);const o=ne(fe,!1,e.artifactId);return l(ae,{artifactId:N,isUserStoryCurrentlyUpdated:w,artifactTitleId:`${E}-${String.fromCharCode(65+t)}`,parentUserStory:Y,parentIndex:`${re}${re&&"."}${de}`,currentIndex:`${t+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...Y.sub_features||[]];l[e]=t,se({...Y,sub_features:l})})(t,e),enableDownload:!0,isDiffEditReviewMode:ce,showUserStoryDiff:ve,updateUserStoryArtifact:he,handleDownloadUserStory:pe,handleOpenSendDialog:me,isDisplayHighlightControl:ge,elementDisplayConfig:fe,_resolvedConfig:o,actionItemsConfig:Ie,onDelete:()=>(e=>{const t=(Y.sub_features||[]).filter((t,l)=>l!==e),l={...Y,sub_features:t};dl(l),se(l)})(t),expandedSubFeatures:Ee,disableEditPlan:Re,useMuiTooltip:Le,storyNumber:e.storyNumber,blockNumber:e.blockNumber,onUserStoryAccordionStateChange:He,showAssignSection:je,onAssignSectionClick:Ve,onSave:Ge},e.artifactId)})]})})]})},se=({artifactTitleIDs:o,expandedSubFeatures:n,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:S,allowTitleEdit:C,showConfidenceScore:b,showBorderTop:I,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:x=!1,disableEditPlan:A=!1,useMuiTooltip:T=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,showWaitingIconInChip:L,setRedlineDocumentIdParent:M,showAssignSection:F,onAssignSectionClick:$,disableAssignSection:_,onSave:W,onUserStoryAccordionStateChange:j,showSuggestedFilesInfo:O,suggestedFilesConfig:V,onChangeActiveDocumentMembers:G})=>{const{userStory:H,setUserStory:Q,customStyles:Z,searchQueryList:J,currentHighlightIndex:K,setCurrentHighlightIndex:ee,segmentComponentConfig:te,sectionStatusConfig:le,redlineConfig:oe,setRedlineDocumentId:ie,redlineDcoumentId:se,redlineCollaborativeConfig:re}=z(),de=null==Z?void 0:Z.userStoryCardStyles,ue=0===K,ce=K===J.length-1;return i(()=>{if(!(null==oe?void 0:oe.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await q({baseApiUrl:oe.documentBaseApiUrl||"",comparisonId:oe.documentComparisonId||""});if(t)ie(t);else{const{document_id:t}=await Y({baseApiUrl:oe.baseApiUrl,changelogConfigId:oe.changelogConfigId,comparisonId:oe.documentComparisonId,artifactId:oe.artifactId,inputData:oe.inputData,redlineConfigId:oe.redlineConfigId,userEmail:oe.userEmail,userName:oe.userName},null!==(e=null==oe?void 0:oe.token)&&void 0!==e?e:"");t&&(ie(t),null==M||M(t))}})()},[]),X(`redline-document-edit:${se}`,({sectionTitle:e,email:t,operation:l})=>{var o;null===(o=null==re?void 0:re.onChangeActiveSectionMember)||void 0===o||o.call(re,{email:t,operation:l,sectionTitle:e})},({activeMembers:e})=>null==G?void 0:G(e)),e("div",{className:k.userStoryCardWrapper,style:m?{...null==de?void 0:de.userStoryCardWrapper,position:"relative"}:null==de?void 0:de.userStoryCardWrapper,children:[m&&l(t,{children:J.length>0&&l("div",{className:k.wrapper,children:l("div",{className:k.highlightNavigation,children:e("div",{className:k.navigationContainer,children:[e("span",{className:k.navCounter,children:[K+1," of ",J.length]}),e("div",{className:k.navButtons,children:[l("button",{onClick:()=>{K>0&&ee(e=>e-1)},className:k.navButton,disabled:ue,children:l(w,{size:20,className:k.navIcon})}),l("button",{onClick:()=>{K<J.length-1&&ee(e=>e+1)},className:k.navButton,disabled:ce,children:l(N,{size:20,className:k.navIcon})})]})]})})})}),H.map((e,t)=>{console.log("UserStoryCardWrapper: userstory",e);const i=ne(h,!0);return l(ae,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:o[t]||"",expandedSubFeatures:n,currentUserStory:e,onUserStoryChange:e=>{Q(l=>(l[t]=e,[...l]))},parentIndex:"",currentIndex:`${t+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:S,allowTitleEdit:C,showConfidenceScore:b,showBorderTop:I,sectionStatusConfig:le,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:x,disableEditPlan:A,useMuiTooltip:T,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,storyNumber:e.storyNumber,blockNumber:e.blockNumber,onUserStoryAccordionStateChange:j,showSuggestedFilesInfo:O,suggestedFilesConfig:V,showWaitingIconInChip:L,showAssignSection:F,disableAssignSection:_,onAssignSectionClick:$,onSave:W},e.artifactId)})]})};export{ae as StoryCard,se as UserStoryCardWrapper,ae as default,oe as replaceLearnedTagsWithInfo};
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as l}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as i}from"react";import{Info as a,ChevronUp as s,ChevronDown as r,Users as d,ExternalLink as u,Download as c,Share2 as v,Copy as p,LoaderCircle as m,PencilIcon as h,RefreshCw as y,Plus as g,Trash2 as f,X as S,Ellipsis as C,Hourglass as b,Check as I,ChevronUpIcon as w,ChevronDownIcon as N,Bookmark as E}from"lucide-react";import D from"showdown";import{Tooltip as B,Menu as A,MenuItem as x}from"@mui/material";import T 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 L,postprocessUserStoryAfterEdit as M}from"../../utils/user-story.utils.js";import F from"../../shared/AtomicButton.js";import $ from"../RichTextEditor/RichTextEditor.js";import _ from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as W,useRequirementAI as z,ToasterId as j}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as O}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as V}from"./TitleEditor/TitleEditor.js";import{fetchRedlineDocumentSection as G,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={[W.WAITING]:"WAITING TO GENERATE",[W.IN_PROGRESS]:"IN PROGRESS",[W.GENERATED]:"GENERATED",[W.FAILED]:"FAILED",[W.GENERATE]:"GENERATE",[W.APPROVED]:"APPROVED"};function ne(e){const t=[],n=/<learned>(.*?)<\/learned>/g;let o,i=0,s=0;for(;null!==(o=n.exec(e));){const[,r]=o,d=o.index;d>i&&t.push(l("span",{children:e.slice(i,d)},"text-pre-"+s++)),t.push(l(B,{title:r,placement:"top",children:l(a,{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)&&t.push(l("span",{children:e.slice(i)},"text-post-"+s++)),t}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:t})=>{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:k.displayName,style:null==i?void 0:i.wrapper,children:[l(E,{className:k.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},ae=({isUserStoryCurrentlyUpdated:w,artifactId:N,artifactTitleId:E,parentUserStory:q,currentUserStory:Y,onUserStoryChange:se,parentIndex:re,currentIndex:de,enableDownload:ue,isDiffEditReviewMode:ce,showUserStoryDiff:ve,handleDownloadUserStory:pe,handleOpenSendDialog:me,updateUserStoryArtifact:he,selectedArtifactId:ye,isDisplayHighlightControl:ge,elementDisplayConfig:fe,_resolvedConfig:Se,showWrapper:Ce=!1,defaultExpanded:be,actionItemsConfig:Ie,onDelete:we,contextVariant:Ne,expandedSubFeatures:Ee,showDisplayName:De=!0,allowTitleEdit:Be=!0,showConfidenceScore:Ae=!0,showBorderTop:xe=!0,sectionStatusConfig:Te,showCompletionPanel:Ue=!1,completionPanelConfig:ke,showAddSectionButton:Pe=!1,disableEditPlan:Re=!1,useMuiTooltip:Le=!1,approveButtonConfig:Me,editButtonConfig:Fe,CDNeededInChip:$e,blockNumber:_e,storyNumber:We,showWaitingIconInChip:ze,showAssignSection:je=!1,disableAssignSection:Oe=!1,onAssignSectionClick:Ve,onSave:Ge,onUserStoryAccordionStateChange:He,showSuggestedFilesInfo:qe=!1,suggestedFilesConfig:Ye,menuActions:Qe})=>{var Ze,Je,Ke,Xe,et,tt,lt,nt,ot,it,at,st,rt,dt,ut,ct,vt,pt,mt,ht,yt,gt,ft,St,Ct,bt,It,wt,Nt,Et,Dt;const{isLoadingSectionData:Bt=!1,onLoadSectionData:At,status:xt,onStatusClick:Tt,completedCount:Ut,totalCount:kt,isNoDataAvailable:Pt=!1}=null!=Te?Te:{},{searchQueryList:Rt,citations:Lt,customStyles:Mt,onEditBlocked:Ft,redlineDcoumentId:$t,redlineConfig:_t,customSectionConfig:Wt,updateRedlineDataParent:zt,aiReasoning:jt,redlineCollaborativeConfig:Ot,selectedSectionToEdit:Vt,setSelectedSectionToEdit:Gt}=z(),Ht=null==Mt?void 0:Mt.userStoryCardStyles,qt=null==Ht?void 0:Ht.customSectionEditButton,Yt=null==Ht?void 0:Ht.statusStyles,Qt=null===(Ze=null==Mt?void 0:Mt.userStoryCardStyles)||void 0===Ze?void 0:Ze.userStoryEditStyles,Zt=null===(Je=null==Mt?void 0:Mt.userStoryScreenStyles)||void 0===Je?void 0:Je.userStoryContentStyles,Jt=null==Ht?void 0:Ht.progressHeaderStyles,Kt=null==Ht?void 0:Ht.clinicalTrialSectionStyles,Xt=null==Ht?void 0:Ht.CompletionStyles,el=null==Ht?void 0:Ht.noDataStyles,tl=null==Ht?void 0:Ht.approveButtonStyles;null==Ht||Ht.suggestedFilesStyles;const ll=null!==(Xe=null===(Ke=null==Wt?void 0:Wt.shouldRender)||void 0===Ke?void 0:Ke.call(Wt,Y))&&void 0!==Xe&&Xe,nl=null===(et=null==Wt?void 0:Wt.getValue)||void 0===et?void 0:et.call(Wt,Y),ol=null!==(lt=null===(tt=null==Wt?void 0:Wt.getFields)||void 0===tt?void 0:tt.call(Wt,Y))&&void 0!==lt?lt:[],il=null!==(nt=null==Wt?void 0:Wt.isEditDisabled)&&void 0!==nt&&nt,al=null!==(it=null===(ot=null==Wt?void 0:Wt.isSaving)||void 0===ot?void 0:ot.call(Wt,Y))&&void 0!==it&&it,sl=((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!==(at=Y.completion_percentage)&&void 0!==at?at:0,Xt),rl={[W.WAITING]:null==Yt?void 0:Yt.waiting,[W.IN_PROGRESS]:null==Yt?void 0:Yt.inProgress,[W.GENERATED]:null==Yt?void 0:Yt.generated,[W.FAILED]:null==Yt?void 0:Yt.failed,[W.GENERATE]:null==Yt?void 0:Yt.generate,[W.APPROVED]:null==Yt?void 0:Yt.approved},[dl,ul]=n({...structuredClone(Y),value:P(Y.value)||""}),[cl,vl]=n({userStory:!!Y.isDefaultEdit}),[pl,ml]=n(!1),[hl,yl]=n(!1),[gl,fl]=n(null),[Sl,Cl]=n(null),{userStory:bl,customIcons:Il}=z(),[wl,Nl]=n(null!=be?be:""===re||ye===Y.artifactId||!!Y.isDefaultOpen),[El,Dl]=n(!1),[Bl,Al]=n(null),[xl,Tl]=n(null),[Ul,kl]=n(!1),Pl=o(null),Rl=o(null),Ll=o(null),[Ml,Fl]=n(!1),[$l,_l]=n(!1),Wl=o(null),[zl,jl]=n(!1),[Ol,Vl]=n(!1),[Gl,Hl]=n(Y.value);i(()=>{w&&Nl(w)},[w]),i(()=>{ul({...structuredClone(Y),value:P(Y.value)||""})},[Y]),i(()=>{Rt.length>0?Nl(!0):void 0===be&&ye&&Nl(ye===Y.artifactId)},[Rt,ye,Y.artifactId]),i(()=>{Ee&&Ee.length>0&&We&&_e&&Nl(Ee.includes(`${We}-${_e}`)||""===re||ye===Y.artifactId||!!Y.isDefaultOpen)},[Ee,We,_e]),i(()=>{if(!Ol)return;const e=e=>{Rl.current&&!Rl.current.contains(e.target)&&Vl(!1)};return document.addEventListener("mousedown",e,!0),()=>{document.removeEventListener("mousedown",e,!0)}},[Ol]);const ql=()=>{Al(null)},Yl=()=>{Tl(null)},Ql=()=>{if(wl&&cl.userStory&&Ll.current&&!Ll.current.requestClose())return;const e=!wl;Nl(e),null==He||He(Y,e)},Zl=async()=>{var e,t;try{"userStory"==="userStory"&&(se(dl),console.log("I am changing RTE editor values",dl)),await(null===(e=null==Fe?void 0:Fe.onSaveEditedSection)||void 0===e?void 0:e.call(Fe,dl)),await he(Lt,bl,N,null===(t=Wl.current)||void 0===t?void 0:t.signal)}finally{}};const Jl=null!=(null==Y?void 0:Y.big_enough)&&!Number.isNaN(Y.big_enough)&&!!(null==Y?void 0:Y.big_enough_decision_factors),Kl=null!==(st=null==Y?void 0:Y.completion_percentage)&&void 0!==st?st:0,Xl=!!(null==Y?void 0:Y.completion_decision_factors),en=""===re,tn=null!=Se?Se:oe(fe,en),ln=!ce&&!ve;i(()=>{if(!Sl)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Sl}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Sl]);const[nn,on]=n(0),[an,sn]=n(!1),rn=async()=>{var e,t;let l=!0;if(sn(e=>(l=!e,!0)),l){let l;on(e=>(l=e,e));try{const{updated_reqai:n}=await G({documentId:$t,sectionId:Y.artifactId,baseApiUrl:null==_t?void 0:_t.editorBaseApiUrl,redlineConfigId:null!==(e=null==_t?void 0:_t.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==_t?void 0:_t.token)&&void 0!==t?t:"");await(null==zt?void 0:zt(n)),on(e=>l===e?0:1)}catch(e){console.error("failed to fetch latest user story: ",e),ee.error("Failed to fetch the latest user story. Please try again.")}sn(!1)}};i(()=>{Y.isDefaultEdit&&vl(e=>({...e,userStory:!0}))},[Y.isDefaultEdit]),console.log("block number in userstory card ",_e),console.log("[TESTING-CURRENT-USER-STORY] \n",Y,"\n[TESTING-USER-STORY] \n",bl),X(`redline-edit:${$t}:${Y.artifactId}`,async({updatedBy:n})=>{var o;null===(o=Wl.current)||void 0===o||o.abort(),on(e=>e+1),vl(o=>o.userStory?(ee.custom(t=>e(te,{onCancel:()=>ee.dismiss(t.id),onRefresh:()=>{ee.dismiss(t.id),rn()},children:["This ",l("span",{style:{fontWeight:600},children:Y.title})," section has been updated by ",l("span",{style:{fontWeight:600},children:n})," while you were editing. Please refresh to view the latest version."]}),{duration:1e4,toasterId:j}),{...bl,userStory:!1}):(rn().then(()=>{ee.custom(o=>e(te,{onCancel:()=>ee.dismiss(o.id),title:e(t,{children:[l("span",{style:{fontWeight:600},children:Y.title})," updated,",l("br",{})]}),children:[n," saved changes. Your unsaved edits are untouched."]}),{duration:1e4,toasterId:j})}),o))});return i(()=>Hl(Y.value),[Y.value]),e("div",{className:k.card,"data-block-id":`user-story-card-wrapper-${We}-${_e}`,style:null==Ht?void 0:Ht.cardStyle,id:`story-card-${Y.title}`,"data-expanded":wl,children:[e("div",{className:k.titleSection,style:null==Ht?void 0:Ht.titleSection,children:[e("div",{className:k.titleRow,style:null==Ht?void 0:Ht.titleRow,onClick:Ql,children:[e("div",{className:k.titleLeft,style:null==Ht?void 0:Ht.titleLeft,onMouseEnter:()=>Fl(!0),onMouseLeave:()=>Fl(!1),children:[De&&l(ie,{displayName:E}),pl&&ln?l(V,{title:Y.title,onSave:e=>(async(e,t)=>{var l;try{let n={...Y};Y.artifactId===t?n.title=e:n.sub_features=(null===(l=Y.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],ul(n),se(n),ml(!1)}catch(e){console.error("Failed to save title",e)}})(e,Y.artifactId),onCancel:()=>{ml(!1)},inputStyle:null==Qt?void 0:Qt.inlineTitleInput,confirmButtonStyle:null==Qt?void 0:Qt.inlineTitleConfirm,cancelButtonStyle:null==Qt?void 0:Qt.inlineTitleCancel},"inline-title-editor"):e("div",{className:k.storyTitleWrapper,children:[l(B,{title:ne(Y.title),arrow:!0,children:l("h2",{title:Le?void 0:Y.title,className:k.storyTitle,style:null==Ht?void 0:Ht.storyTitle,children:ne(Y.title)},Y.artifactId)}),qe&&!ll&&l("div",{ref:Rl,style:{display:"inline-flex"},children:l(B,{open:Ol&&!(null==Ye?void 0:Ye.isLoading)&&!!(null===(rt=null==Ye?void 0:Ye.files)||void 0===rt?void 0:rt.length),disableHoverListener:!0,disableFocusListener:!0,disableTouchListener:!0,placement:"bottom",PopperProps:{disablePortal:!0},arrow:!0,componentsProps:{tooltip:{className:k.suggestedFilesTooltip,sx:{backgroundColor:"#334155",color:"#fff",maxWidth:400,padding:0,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},arrow:{sx:{color:"#334155"}}},title:e("div",{onClick:e=>e.stopPropagation(),children:[e("div",{style:{fontWeight:700,fontSize:15,color:"#fff",padding:"12px 14px 10px 14px",borderBottom:"1px solid rgba(255,255,255,0.15)",whiteSpace:"nowrap"},children:[null!==(dt=null==Ye?void 0:Ye.title)&&void 0!==dt?dt:"Suggested files to generate this section"," ","(",null!==(ct=null===(ut=null==Ye?void 0:Ye.files)||void 0===ut?void 0:ut.length)&&void 0!==ct?ct:0,")"]}),l("ol",{className:k.suggestedFilesList,style:{margin:0,padding:"8px 14px 10px 14px",maxHeight:180,overflowY:"auto",listStyle:"none"},children:null===(vt=null==Ye?void 0:Ye.files)||void 0===vt?void 0:vt.map((t,l)=>e("li",{style:{fontSize:14,color:"#CBD5E1",padding:"6px 0",whiteSpace:"nowrap"},children:[l+1,". ",t]},l))})]}),children:l(a,{size:16,style:{cursor:(null==Ye?void 0:Ye.isLoading)||!(null===(pt=null==Ye?void 0:Ye.files)||void 0===pt?void 0:pt.length)?"not-allowed":"pointer",color:"#94A3B8",marginLeft:4,opacity:(null==Ye?void 0:Ye.isLoading)||!(null===(mt=null==Ye?void 0:Ye.files)||void 0===mt?void 0:mt.length)?.4:1,transition:"opacity 0.15s ease"},onClick:e=>{var t;e.stopPropagation(),!(null==Ye?void 0:Ye.isLoading)&&(null===(t=null==Ye?void 0:Ye.files)||void 0===t?void 0:t.length)&&Vl(e=>!e)}})})}),Ue&&(Xl?l(Z,{customIcons:null==Il?void 0:Il.userStoryIcons,customStyles:null==Ht?void 0:Ht.aiReasoningCitaionStyles,currentUserStory:Y,panelStyles:null==Ht?void 0:Ht.CompletionStyles,onToggleStateChange:_l,completionPanelConfig:ke,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Xt?void 0:Xt.badge,...sl},children:[e("span",{children:[Kl,"% Completed"]}),l("span",{style:{display:"flex",alignItems:"center"},children:l(J,{color:"currentColor"})}),l($l?s:r,{size:14,style:null==Xt?void 0:Xt.chevronStyle})]})}):l("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Xt?void 0:Xt.badge,...sl},children:e("span",{children:[Kl,"% Completed"]})})),Be&&l("button",{type:"button",className:k.titleEditButton,style:null==Qt?void 0:Qt.titleEditButton,onClick:e=>{e.stopPropagation(),ml(!0),wl||Nl(!0)},"aria-label":"Edit title",title:"Edit title",children:l("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("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"})})})]})]}),(xt||void 0!==Ut&&void 0!==kt)&&e("div",{className:k.statusContainer,children:[void 0!==Ut&&void 0!==kt&&e("div",{className:k.completedBadge,children:["Completed: ",Ut,"/",kt]}),xt&&l("button",{type:"button",onClick:e=>{e.stopPropagation(),null==Tt||Tt()},onMouseEnter:()=>jl(!0),onMouseLeave:()=>jl(!1),className:k.statusButton,style:{...null===(ht=rl[xt])||void 0===ht?void 0:ht.default,...zl&&(null===(yt=rl[xt])||void 0===yt?void 0:yt.hover)},children:le[xt]})]}),e("div",{className:k.titleActions,style:null==Ht?void 0:Ht.titleActions,onClick:e=>e.stopPropagation(),children:[(tn.showProgressPercentage||tn.showGapBox)&&Ce&&e("div",{className:k.progressHeader,style:null==Jt?void 0:Jt.wrapper,children:[tn.showProgressPercentage&&e("div",{className:k.progressPercentage,style:null==Jt?void 0:Jt.percentage,children:[null!==(ft=null!==(gt=null==Y?void 0:Y.confidenceScore)&&void 0!==gt?gt:null==tn?void 0:tn.confidenceValue)&&void 0!==ft?ft:"0","%"]}),tn.showGapBox&&e("div",{className:k.gapBox,style:null==Jt?void 0:Jt.gapBox,children:[null!==(Ct=null!==(St=null==Y?void 0:Y.gapValue)&&void 0!==St?St:null==tn?void 0:tn.gapBoxValue)&&void 0!==Ct?Ct:"2"," ","Gaps"]})]}),Jl&&l(O,{customIcons:null==Il?void 0:Il.userStoryIcons,customStyles:null==Ht?void 0:Ht.aiReasoningCitaionStyles,currentUserStory:Y,panelStyles:null==Ht?void 0:Ht.BigEnoughStyles}),je&&l("button",{type:"button",className:k.iconButton,style:null==Ht?void 0:Ht.iconButton,disabled:Oe,onClick:e=>{e.stopPropagation(),null==Ve||Ve(Y)},"aria-label":"Assign section users",title:"Assign section users",children:l(d,{size:16})}),!cl.userStory&&e(t,{children:[!1!==(null==tn?void 0:tn.showShareButton)&&l("button",{className:k.iconButton,style:null==Ht?void 0:Ht.iconButton,onClick:e=>{Al(e.currentTarget)},children:l(u,{size:16})}),e(A,{id:"user-story-share-menu",anchorEl:Bl,open:!!Bl,onClose:()=>Al(null),style:null==Ht?void 0:Ht.userStoryShareMenu,children:[ue&&l(x,{style:null==Ht?void 0:Ht.userStoryMenuItem,onClick:async()=>{Dl(!0),pe&&(await Promise.all([pe("pdf"),pe("doc")]),Dl(!1))},children:e("div",{ref:Pl,className:k.menuItemContent,style:null==Ht?void 0:Ht.menuItemContent,children:[l(c,{size:16,color:null==Ht?void 0:Ht.menuIconColor}),l("p",{style:null==Ht?void 0:Ht.menuLabel,children:"Download"})]})}),l(x,{style:null==Ht?void 0:Ht.userStoryMenuItem,onClick:async()=>{let e=Y;q&&(e={...Y,value:`${L(null==q?void 0:q.value,Y.title)} \n${Y.value}`}),null==me||me(!0,[e],Y.artifactId),ql()},children:e("div",{style:null==Ht?void 0:Ht.menuItemContent,className:k.menuItemContentPadded,children:[l(v,{size:16,color:null==Ht?void 0:Ht.menuIconColor}),l("p",{style:null==Ht?void 0:Ht.menuLabel,children:"Send"})]})}),l(x,{style:null==Ht?void 0:Ht.userStoryMenuItem,onClick:async()=>{const e=(new D.Converter).makeHtml(P(Y.value)||Y.value),t=function(e){const t=(new D.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(P(Y.value)||Y.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{ql()}},children:e("div",{style:null==Ht?void 0:Ht.menuItemContent,className:k.menuItemContentPadded,children:[l(p,{size:16,color:null==Ht?void 0:Ht.menuIconColor}),l("p",{style:null==Ht?void 0:Ht.menuLabel,children:"Copy"})]})})]})]}),!Ul&&cl.userStory&&wl?l(F,{type:"outline",children:"Cancel",style:null==Ht?void 0:Ht.cancelButton,onClick:()=>{var e,t;if(null===(e=Wl.current)||void 0===e||e.abort(),vl(e=>({...e,userStory:!1})),null==Ot?void 0:Ot.initiateCollaborativeFlow){Gt(null);const e={email:(null==_t?void 0:_t.userEmail)||"",operation:"end"};null===(t=null==Ot?void 0:Ot.onChangeActiveSectionMember)||void 0===t||t.call(Ot,e),K.emit(`redline-document-edit:${$t}`,e)}}}):l(t,{}),cl.userStory&&wl?l(F,{type:"fill",children:Ul?e("span",{className:k.savingSpinner,style:null==Ht?void 0:Ht.savingSpinner,children:[l(m,{className:k.spinAnimation,style:null==Ht?void 0:Ht.spinAnimation}),l("span",{children:"Saving..."})]}):"Save",isDisable:Ul,style:Ul?null==Ht?void 0:Ht.savingButton:null==Ht?void 0:Ht.saveButton,onClick:async()=>{var e;kl(!0),await Zl();let t=await(async()=>{var e,t,l,n,o,i,a,s;let r=dl.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{await(null==Ge?void 0:Ge(r,Y.artifactId))}catch(e){}try{if(null==_t?void 0:_t.callUpdateDocument){const{updated_reqai:d}=await H({documentId:$t,sectionId:Y.artifactId,baseApiUrl:null==_t?void 0:_t.baseApiUrl,updatedContent:r,userEmail:_t.userEmail,userName:_t.userName,redlineConfigId:null!==(e=_t.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==_t?void 0:_t.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==zt?void 0:zt(d));const u=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;"string"==typeof u&&u.trim()&&"string"==typeof $t&&$t.trim()&&"string"==typeof(null==_t?void 0:_t.userName)&&(null==_t?void 0:_t.userName.trim())?K.emit(`redline-edit:${$t}:${u}`,{updatedBy:null==_t?void 0:_t.userName}):console.error("invalid cwsEvent name or payload")}}catch(e){console.error("failed to update redline document",e),r=Gl}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 l={...dl,value:t};if(se({...l,isDefaultEdit:!1}),Hl(l.value),vl(e=>({...e,userStory:!1})),kl(!1),null==Ot?void 0:Ot.initiateCollaborativeFlow){Gt(null);const t={email:(null==_t?void 0:_t.userEmail)||"",operation:"end"};null===(e=null==Ot?void 0:Ot.onChangeActiveSectionMember)||void 0===e||e.call(Ot,t),K.emit(`redline-document-edit:${$t}`,t)}}}):!nn&&!ce&&!ve&&!Re&&wl&&!1!==(null==tn?void 0:tn.showEditButton)&&l("button",{className:k.iconButton,style:null==Ht?void 0:Ht.editButton,onClick:()=>{var e;if(null==Ot?void 0:Ot.initiateCollaborativeFlow){if(Vt)return void ee.error("Please save or cancel current editing section first");{Gt(Y.artifactId);const t={sectionTitle:Y.title,email:(null==_t?void 0:_t.userEmail)||"",operation:"start"};null===(e=null==Ot?void 0:Ot.onChangeActiveSectionMember)||void 0===e||e.call(Ot,t),K.emit(`redline-document-edit:${$t}`,t)}}vl(e=>({...e,userStory:!0}))},children:l(h,{color:null==Ht?void 0:Ht.pencilIconColor,size:16})}),(null==Ot?void 0:Ot.initiateCollaborativeFlow)&&!!nn&&l(B,{title:"Fetch latest section",children:l(y,{color:an?"#d3d3d3":"black",onClick:rn})}),Pe&&en&&wl&&!ce&&!ve&&!1!==(null==tn?void 0:tn.showEditButton)&&e("button",{type:"button",className:k.addSectionButton,style:null==Qt?void 0:Qt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=Y.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={...Y,sub_features:[...null!==(n=Y.sub_features)&&void 0!==n?n:[],i]};ul(a),se(a),Nl(!0),Cl(i.title)},"aria-label":"Add section",title:"Add section",children:[l(g,{size:14}),l("span",{className:k.addSectionLabel,children:"Add Section"})]}),!en&&!ce&&!Re&&!ve&&l("button",{type:"button",onClick:e=>{e.stopPropagation(),null==we||we()},className:k.iconButton,style:null==Qt?void 0:Qt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:l(f,{size:16})}),ll&&l("button",{type:"button",className:k.iconButton,style:null==qt?void 0:qt.button,disabled:il,onClick:e=>{if(e.stopPropagation(),hl)return fl(null),void yl(!1);fl(structuredClone(null!=nl?nl:{})),Nl(!0),yl(!0)},children:hl?l(S,{size:16,color:null==Ht?void 0:Ht.pencilIconColor,style:null==qt?void 0:qt.cancelIcon}):l(h,{size:16,color:null==Ht?void 0:Ht.pencilIconColor,style:null==qt?void 0:qt.editIcon})}),(null==tn?void 0:tn.actionItemsButton)&&e(t,{children:[l("span",{className:k.actionItemBtn,style:null==Ht?void 0:Ht.actionItemBtn,onClick:e=>{e.stopPropagation(),Tl(e.currentTarget)},children:l(C,{})}),l(A,{id:"user-story-action-menu",anchorEl:xl,open:!!xl,onClose:Yl,style:null==Ht?void 0:Ht.userStoryShareMenu,children:null==Ie?void 0:Ie.items.map((t,n)=>l(x,{style:null==Ht?void 0:Ht.userStoryMenuItem,onClick:()=>{t.onclick(Y),Yl()},children:e("div",{className:k.menuItemContent,style:{...null==Ht?void 0:Ht.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[l("span",{className:k.menuItemIcon,style:null==Ht?void 0:Ht.menuItemIcon,children:t.icon}),l("p",{style:null==Ht?void 0:Ht.menuLabel,children:t.name}),l("span",{className:k.menuItemRight,style:null==Ht?void 0:Ht.menuItemRight})]})},`action-item-${n}-${t.name}`))})]}),l("button",{type:"button",onClick:e=>{e.stopPropagation(),Ql()},style:null==Ht?void 0:Ht.chevronButton,className:k.chevronButton,children:l(wl?s:r,{className:k.chevronIcon,color:null==Ht?void 0:Ht.chevronIconColor})})]})]}),l("div",{className:k.divider,style:null==Ht?void 0:Ht.dividerStyle})]}),wl&&l("div",{className:k.cardContent,style:{...null==Ht?void 0:Ht.cardContentStyle,borderTop:xe?"1px solid #E5E5E5":"none"},children:e("div",Bt?{className:k.loadingContainer,children:[l("div",{className:k.loadingIconWrapper,children:l(b,{size:28,color:"#5B3DF5",className:k.spinAnimation})}),e("div",{children:[l("h3",{className:k.loadingTitle,children:"Section generation in progress.."}),l("p",{className:k.loadingSubtitle,children:"This may take a few minutes"})]}),l("button",{type:"button",onClick:()=>null==At?void 0:At(),className:k.viewStatusButton,children:"View Status"})]}:Pt?{className:k.noDataContainer,style:null==el?void 0:el.container,children:[l("img",{src:T,alt:"No data available",className:k.noDataIllustration,style:null==el?void 0:el.illustration}),l("h3",{className:k.noDataTitle,style:null==el?void 0:el.title,children:"No Data Available for This Section"}),l("p",{className:k.noDataSubtitle,style:null==el?void 0:el.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==Ht?void 0:Ht.contentInner,children:[e("div",{className:k.descriptionSection,style:null==Ht?void 0:Ht.descriptionSection,children:[l("div",{className:k.justifyBetween,style:null==Ht?void 0:Ht.justifyBetween}),cl.userStory?l($,{ref:Ll,minHeight:"100%",height:"100%",type:"string",value:P(Gl)||"",handleUpdateState:(e,t)=>{const l=M(R(t));ul(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:cl.userStory?"edit":"readOnly",onEditBlocked:Ft,onSaveUnsavedChanges:async()=>{await Zl(),Nl(!1)},onDiscardUnsavedChanges:()=>{ul({...structuredClone(Y),value:P(Y.value)||""}),vl(e=>({...e,userStory:!1})),Nl(!1)},isSavingUnsavedChanges:Ul}):ll?l(Q,{styles:Kt,fields:ol,readonly:!hl,isSaving:al,value:null!==(bt=null!=gl?gl:nl)&&void 0!==bt?bt:{},onChange:fl,onSave:async()=>{var e;gl&&(await(null===(e=null==Wt?void 0:Wt.onSave)||void 0===e?void 0:e.call(Wt,Y,gl)),fl(null),yl(!1))},onCancel:()=>{fl(null),yl(!1)}}):e(t,{children:[l(_,{showUserStoryDiff:ve,isParent:""===re,message:P(Y.value)||"",artifactId:Y.artifactId,customStyles:Zt,isDisplayHighlightControl:ge,contextVariant:Ne,showConfidenceScore:Ae,CDNeededInChip:$e,blockId:_e,storyId:We,showWaitingIconInChip:ze,menuActions:Qe}),(Me||Fe)&&e("div",{className:k.actionButtonsContainer,style:null==tl?void 0:tl.container,children:[Fe&&!cl.userStory&&e(t,{children:[l("button",{type:"button",className:k.actionButton,style:null==tl?void 0:tl.button,disabled:Fe.disabled||Fe.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Fe.onClick)||void 0===t||t.call(Fe),vl(e=>({...e,userStory:!0})),Nl(!0)},children:Fe.isLoading?e(t,{children:[l(m,{size:16,className:k.actionButtonSpinner,style:null==tl?void 0:tl.icon}),l("span",{style:null==tl?void 0:tl.text,children:null!==(It=Fe.label)&&void 0!==It?It:"Edit"})]}):e(t,{children:[l(h,{size:16,style:null==tl?void 0:tl.icon}),l("span",{style:null==tl?void 0:tl.text,children:null!==(wt=Fe.label)&&void 0!==wt?wt:"Edit"})]})}),Me&&l("span",{className:k.actionButtonDivider})]}),Me&&l("button",{type:"button",className:k.actionButton,style:null==tl?void 0:tl.button,disabled:Me.disabled||Me.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Me.onClick)||void 0===t||t.call(Me)},children:Me.isLoading?e(t,{children:[l(m,{size:16,className:k.actionButtonSpinner,style:null==tl?void 0:tl.icon}),l("span",{style:null==tl?void 0:tl.text,children:null!==(Nt=Me.label)&&void 0!==Nt?Nt:"Approve"})]}):e(t,{children:[l(I,{size:16,style:null==tl?void 0:tl.icon}),l("span",{style:null==tl?void 0:tl.text,children:null!==(Et=Me.label)&&void 0!==Et?Et:"Approve"})]})})]})]})]}),null===(Dt=dl.sub_features)||void 0===Dt?void 0:Dt.map((e,t)=>{console.log("UserStoryCardWrapper: sub",e);const n=oe(fe,!1,e.artifactId);return l(ae,{artifactId:N,isUserStoryCurrentlyUpdated:w,artifactTitleId:`${E}-${String.fromCharCode(65+t)}`,parentUserStory:Y,parentIndex:`${re}${re&&"."}${de}`,currentIndex:`${t+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...Y.sub_features||[]];l[e]=t,se({...Y,sub_features:l})})(t,e),enableDownload:!0,isDiffEditReviewMode:ce,showUserStoryDiff:ve,updateUserStoryArtifact:he,handleDownloadUserStory:pe,handleOpenSendDialog:me,isDisplayHighlightControl:ge,elementDisplayConfig:fe,_resolvedConfig:n,actionItemsConfig:Ie,onDelete:()=>(e=>{const t=(Y.sub_features||[]).filter((t,l)=>l!==e),l={...Y,sub_features:t};ul(l),se(l)})(t),expandedSubFeatures:Ee,disableEditPlan:Re,useMuiTooltip:Le,storyNumber:e.storyNumber,blockNumber:e.blockNumber,onUserStoryAccordionStateChange:He,showAssignSection:je,onAssignSectionClick:Ve,onSave:Ge,menuActions:Qe},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:S,allowTitleEdit:C,showConfidenceScore:b,showBorderTop:I,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:x=!1,useMuiTooltip:T=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,showWaitingIconInChip:L,setRedlineDocumentIdParent:M,showAssignSection:F,onAssignSectionClick:$,disableAssignSection:_,onSave:W,onUserStoryAccordionStateChange:j,showSuggestedFilesInfo:O,suggestedFilesConfig:V,onChangeActiveDocumentMembers:G,menuActions:H})=>{const{userStory:Q,setUserStory:Z,customStyles:J,searchQueryList:K,currentHighlightIndex:ee,setCurrentHighlightIndex:te,segmentComponentConfig:le,sectionStatusConfig:ne,redlineConfig:ie,setRedlineDocumentId:se,redlineDcoumentId:re,redlineCollaborativeConfig:de}=z(),ue=null==J?void 0:J.userStoryCardStyles,ce=0===ee,ve=ee===K.length-1;return i(()=>{if(!(null==ie?void 0:ie.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await q({baseApiUrl:ie.documentBaseApiUrl||"",comparisonId:ie.documentComparisonId||""});if(t)se(t);else{const{document_id:t}=await Y({baseApiUrl:ie.baseApiUrl,changelogConfigId:ie.changelogConfigId,comparisonId:ie.documentComparisonId,artifactId:ie.artifactId,inputData:ie.inputData,redlineConfigId:ie.redlineConfigId,userEmail:ie.userEmail,userName:ie.userName},null!==(e=null==ie?void 0:ie.token)&&void 0!==e?e:"");t&&(se(t),null==M||M(t))}})()},[]),X(`redline-document-edit:${re}`,({sectionTitle:e,email:t,operation:l})=>{var n;null===(n=null==de?void 0:de.onChangeActiveSectionMember)||void 0===n||n.call(de,{email:t,operation:l,sectionTitle:e})},({activeMembers:e})=>null==G?void 0:G(e)),e("div",{className:k.userStoryCardWrapper,style:m?{...null==ue?void 0:ue.userStoryCardWrapper,position:"relative"}:null==ue?void 0:ue.userStoryCardWrapper,children:[m&&l(t,{children:K.length>0&&l("div",{className:k.wrapper,children:l("div",{className:k.highlightNavigation,children:e("div",{className:k.navigationContainer,children:[e("span",{className:k.navCounter,children:[ee+1," of ",K.length]}),e("div",{className:k.navButtons,children:[l("button",{onClick:()=>{ee>0&&te(e=>e-1)},className:k.navButton,disabled:ce,children:l(w,{size:20,className:k.navIcon})}),l("button",{onClick:()=>{ee<K.length-1&&te(e=>e+1)},className:k.navButton,disabled:ve,children:l(N,{size:20,className:k.navIcon})})]})]})})})}),Q.map((e,t)=>{console.log("UserStoryCardWrapper: userstory",e);const i=oe(h,!0);return l(ae,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[t]||"",expandedSubFeatures:o,currentUserStory:e,onUserStoryChange:e=>{Z(l=>(l[t]=e,[...l]))},parentIndex:"",currentIndex:`${t+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:S,allowTitleEdit:C,showConfidenceScore:b,showBorderTop:I,sectionStatusConfig:ne,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:x,useMuiTooltip:T,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,storyNumber:e.storyNumber,blockNumber:e.blockNumber,onUserStoryAccordionStateChange:j,showSuggestedFilesInfo:O,suggestedFilesConfig:V,showWaitingIconInChip:L,showAssignSection:F,disableAssignSection:_,onAssignSectionClick:$,onSave:W,menuActions:H},e.artifactId)})]})};export{ae as StoryCard,se as UserStoryCardWrapper,ae as default,ne as replaceLearnedTagsWithInfo};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import t,{useRef as r,useState as o,useEffect as n}from"react";import{Menu as i}from"@mui/material";import{MoreVertical as u}from"lucide-react";import{TABLE_MARKER as a,serializeTable as s,BLOCK_SELECTOR as c}from"../../../../utils/helperFunctions.js";import d from"../userstory-with-citation/UserStoryWithCitation.module.css.js";const v=({children:v,tableStyle:m,menuConfig:p,menuStyles:b,blockId:h,storyId:f})=>{var y,g,x,S,k;const M=null==p?void 0:p.elements,N=!!(null==M?void 0:M.length),W=r(null),[$,z]=o(null),[A,C]=o(40);if(n(()=>{var e,l,t;if(!N)return;const r=null!==(l=null===(e=W.current)||void 0===e?void 0:e.querySelector("thead tr"))&&void 0!==l?l:null===(t=W.current)||void 0===t?void 0:t.querySelector("tr");if(!r)return;const o=()=>C(r.offsetHeight);o();const n=new ResizeObserver(o);return n.observe(r),()=>n.disconnect()},[N,v]),!N)return e("div",{className:d.tableWrapper,children:e("table",{className:d.table,style:m,children:v})});const I=()=>z(null),w=()=>{var e,l,t,r;const o=W.current;if(!o)return null;const n=s(o),i=o.closest(c),u=Array.from(null!==(e=null==i?void 0:i.querySelectorAll(`table[${a}]`))&&void 0!==e?e:[]).filter(e=>e.closest(c)===i&&s(e)===n),d=Math.max(u.indexOf(o)+1,1),[v,m]=(null!==(l=null==i?void 0:i.getAttribute("data-block-id"))&&void 0!==l?l:"").replace("user-story-card-wrapper-","").split("-");return{html:n,storyId:null!==(t=null!=f?f:v)&&void 0!==t?t:"1",blockId:null!==(r=null!=h?h:m)&&void 0!==r?r:"1",occurrence:d,element:o}},O=!!$,j=null!==(g=null===(y=null==b?void 0:b.icon)||void 0===y?void 0:y.size)&&void 0!==g?g:18,q=null!==(x=null==p?void 0:p.icon)&&void 0!==x?x:e(u,{size:j,color:null===(S=null==b?void 0:b.icon)||void 0===S?void 0:S.color});return l("div",{className:d.tableMenuWrapper,style:{...null==b?void 0:b.wrapper,"--table-menu-reserved":`${null!==(k=null==b?void 0:b.headerReservedSpace)&&void 0!==k?k:40}px`},children:[e("button",{type:"button","aria-label":"Table actions",className:`${d.tableMenuButton} ${O?d.tableMenuButtonActive:""}`,style:{height:A-1,...null==b?void 0:b.button,...O?null==b?void 0:b.buttonActive:{}},onClick:e=>{e.stopPropagation(),z(e.currentTarget)},children:q}),e(i,{anchorEl:$,open:O,onClose:I,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:190,p:"5px",border:"1px solid #e2e8f0",borderRadius:"10px",backgroundColor:"#ffffff",...null==b?void 0:b.menuPaper}}},children:M.map((l,r)=>{var o;return t.isValidElement(l)?e("div",{style:null==b?void 0:b.menuItem,children:t.cloneElement(l,{getTableData:w,closeMenu:I})},null!==(o=l.key)&&void 0!==o?o:r):null})}),e("div",{className:d.tableWrapper,children:e("table",{ref:W,[a]:"true",className:`${d.table} ${d.tableWithMenu}`,style:m,children:v})})]})};export{v as default};
|
|
2
|
+
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import t,{createContext as o,useRef as l,useState as r,useCallback as d,useMemo as a,useEffect as s,useContext as c}from"react";import u from"react-markdown";import h from"rehype-raw";import p from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as g,HIGHLIGHT_CLASS as m}from"../../shared/useMarkdownSearch.js";import{Info as v}from"lucide-react";import{Tooltip as C}from"@mui/material";import f from"dompurify";import y from"../../shared/UpdatedAnimationContent.js";import w from"../../shared/GeneratedCodeCitation.js";import b from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as I}from"../RequirementAIWrapper/RequirementAIWrapper.js";import S from"../../icons/CognitiveDecision.js";import $ from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as N}from"../ai-reasoning/AiReasoningCitation.js";import k from"../../icons/RelevanceScoreIcon.js";import x from"../RecommendationBlock/RecommendationBlock.js";import A from"../UserStoryCard/AttachedContext.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import L from"./components/InlineUpdatedComponent.js";import E from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as U}from"../../store/markdown-context.js";import M from"./components/InlineManualComponent.js";import T from"./components/HighlightButtonComponent.js";import{escapeTagIds as P,splitTagAcrossParagraphs as D}from"../../../../utils/tagHelper.js";const _=o(!1),H=o({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),W=o({rowId:""}),B=({aiReason:n,isHighConfidence:t,customStyle:o,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=c(H),{rowId:u}=c(W),h=String(n.id);u&&s.current.set(h,u);const g=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===n.id,m=t?(null==l?void 0:l.highConfidence)||e(S,{}):(null==l?void 0:l.lowConfidence)||e($,{});return i("button",{className:p.aiReasoningButton,style:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(g?null:u,g?null:n)},children:[m,e("i",g?{className:`pi pi-angle-up ${t?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${t?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence}`})]})},F=({children:n,node:t,customStyles:o,customIcons:r})=>{var d,a;const s=l(Math.random().toString(36).slice(2)).current,{expandedInfo:u}=c(H),h=(null==u?void 0:u.rowId)===s,g=Array.isArray(null==t?void 0:t.children)?t.children.filter(e=>"element"===e.type).length:1,m=null!==(a=null===(d=null==t?void 0:t.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return i(W.Provider,{value:{rowId:s},children:[e("tr",{style:m?{cssText:m}:void 0,children:n}),h&&(null==u?void 0:u.aiReason)&&e("tr",{style:{width:"100%"},children:e("td",{colSpan:g||1,className:p.tableExpandedCell,children:e("div",{className:p.tableExpandedCellInner,children:e("div",{className:p.tableExpandedCellContent,children:e(j,{aiReason:u.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==o?void 0:o.aiReasoningContent,aiReasoningAccordion:null==o?void 0:o.aiReasoningAccordion,aiReasoningMarkdown:null==o?void 0:o.aiReasoningMarkdown,aiReasoningPill:null==o?void 0:o.aiReasoningPill,webCitation:null==o?void 0:o.webCitation,stormeeCitation:null==o?void 0:o.stormeeCitation,waveformCitation:null==o?void 0:o.waveformCitation,imageCitation:null==o?void 0:o.imageCitation,fileCitation:null==o?void 0:o.fileCitation,appModCitation:null==o?void 0:o.appModCitation,rcaCitation:null==o?void 0:o.rcaCitation,readFileCitation:null==o?void 0:o.readFileCitation,loadingCitations:null==o?void 0:o.loadingCitations,chatCitation:null==o?void 0:o.chatCitation}})})})})})]})};const O=["del","ins"];function V(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var t;const o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return`<code>${l=o,l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var l})}function q(e){return function(e,n,i){const t=n.join("|");return e.replace(new RegExp(`<(${t})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,t)=>`<${n}>${i(t)}</${n}>`)}(e,O,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:V(e)).join(""))}function z(e){let n=e.trim();n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const i=[];let t="",o=!1;for(const e of n)o?(t+=e,o=!1):"\\"!==e?"|"!==e?t+=e:(i.push(t.trim()),t=""):(t+=e,o=!0);return i.push(t.trim()),i}function G(e){return e.trim().includes("|")&&z(e).length>1}function Q(e){const n=z(e);return n.length>1&&n.every(e=>/^:?-{3,}:?$/.test(e.replace(/\s+/g,"")))}function J(e){if(!e)return;const n=e.replace(/\s+/g,"");return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":"left"}function K(e,n){return Array.from({length:n},(n,i)=>{var t;return null!==(t=e[i])&&void 0!==t?t:""})}function X(e,n,i){return`<${e}${function(e){return e?` align="${e}"`:""}(i)}>${V(n)}</${e}>`}function Y(e,n,i){const t=Math.max(e.length,n.length,...i.map(e=>e.length)),o=K(e,t),l=K(n,t).map(J);return`\n\n<table>${`<thead><tr>${o.map((e,n)=>X("th",e,l[n])).join("")}</tr></thead>`}${i.length?`<tbody>${i.map(e=>`<tr>${K(e,t).map((e,n)=>X("td",e,l[n])).join("")}</tr>`).join("")}</tbody>`:""}</table>\n\n`}const Z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ee(e,n){const i=[],o=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!t.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(o.has(d))return i.push(e),null;if(Z.has(d))return e;const a=null===(r=t.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?t.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const ne=({message:o,noMarkdownContent:S,useMarkdown:$=!0,isParent:j,scenario:W,showUserStoryDiff:O=!1,aiReasoningsForBlock:V,isCitationLoadingDisplay:J=!1,className:K,highConfidenceIcon:X,lowConfidenceIcon:Z,customStyles:ne,customIcons:ie,contextVariant:te,aiReasoningDiffView:oe,userStoryCitations:le,artifactId:re,isCraflow:de,onCraAccept:ae,onCraReject:se,onCitationLinkClick:ce,craFlowConfig:ue,isDisplayHighlightControl:he=!1,showConfidenceScore:pe=!0,CDNeededInChip:ge,blockId:me,storyId:ve,showWaitingIconInChip:Ce})=>{var fe;console.log("userstorywithcitation blockid ",me);const ye=l(null),{userStory:we,inlineUpdateComponentConfig:be,getAvgScoreForStory:Ie,setUserStory:Se,aiReasoning:$e,setAiReasoning:Re,customIcons:Ne,searchQueryList:ke,searchQueryReasoningIdList:xe,currentHighlightIndex:Ae,segmentComponentConfig:je,inlineManualComponentConfig:Le,diffEditConfig:Ee,customSectionConfig:Ue}=I(),Me=null!=ie?ie:null==Ne?void 0:Ne.userStoryIcons;null==ne||ne.searchHighlight;const{search:Te,clear:Pe}=g(ye),[De,_e]=r("1"),[He,We]=r(null),Be=l(new Map),[Fe,Oe]=r(new Set),Ve=d((e,n)=>{We(e&&n?{rowId:e,aiReason:n}:null)},[]),qe=re?Ie(re):0,[ze,Ge]=r([]),Qe=d(e=>{Oe(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Je=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Je).join(""):t.isValidElement(e)?Je(e.props.children):"",Ke=e=>{let n=function(e){const n=e.split("\n"),i=[];let t=!1;for(let e=0;e<n.length;e++){const o=n[e];if(/^\s*(```|~~~)/.test(o)){t=!t,i.push(o);continue}const l=n[e+1];if(!t&&void 0!==l&&G(o)&&Q(l)){const t=z(o),r=z(l),d=[];for(e+=2;e<n.length&&G(n[e])&&!Q(n[e]);)d.push(z(n[e])),e++;e--,i.push(Y(t,r,d));continue}i.push(o)}return i.join("\n")}(function(e){return e.replace(/\\r\\n|\\n|\\r/g,"\n")}(e));return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,t,o)=>{const l=t.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,t,o)=>{const l=n.substring(0,o),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=t;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let t;const o=new RegExp(n.source,n.flags);for(;null!==(t=o.exec(e));){const e=t[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),o=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:t.index,endIndex:t.index+t[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==o?void 0:o[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],t=n.changedItemCount-n.deletedItemCount;if(0===t)continue;const o=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of o){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+t}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=q(n),n},Xe=a(()=>o?Ke(o):o,[o]);s(()=>{Ge(V||$e)},[V,$e]);const Ye=a(()=>{const o=Boolean(null==Ue?void 0:Ue.negateList),l=(e,n)=>{let i=0;return t.Children.map(e,e=>{if(!t.isValidElement(e))return e;const o=n(i);return i+=1,t.cloneElement(e,{"data-list-marker":o})})};return{span:({node:n,children:i,...t})=>{var o,l,r,d,a;const s=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o["highlight-id"])&&void 0!==l?l:null==t?void 0:t["highlight-id"],c="string"==typeof s&&Fe.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==t?void 0:t["highlight-color"];return e("span",{style:{...null!==(a=null==ne?void 0:ne.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:i,children:t,...o})=>{var l,r,d,a,s,c;const u=null!==(r=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.action)&&void 0!==r?r:null==o?void 0:o.action,h=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==o?void 0:o["highlight-id"],p=null!==(c=null===(s=null==i?void 0:i.properties)||void 0===s?void 0:s["highlight-type"])&&void 0!==c?c:null==o?void 0:o["highlight-type"];return"highlight"===u?e(T,{highlightId:h,handleHighlightSpan:Qe,icon:"web"===p?null==Me?void 0:Me.webCitationIcon:"doc"===p?null==Me?void 0:Me.fileCitationIcon:e(n,{}),customStyles:"web"===p?null==ne?void 0:ne.webButton:"doc"===p?null==ne?void 0:ne.docButton:{}}):null},upt:({node:i,children:t,...o})=>{var l,r;const d=null==o?void 0:o.id,a=d?null===(r=null===(l=d.split("$"))||void 0===l?void 0:l[1])||void 0===r?void 0:r.replaceAll("@","<").replaceAll("#",">"):null,s=$e.find(e=>e.id.toString()===a);if(!s)return t||e(n,{});const c="data-main"in o,u=o["data-status"];return e(n,{children:e(L,{aiReason:s,customStyles:null==ne?void 0:ne.inlineUpdatedComponent,handleClickCognitiveDecision:null==be?void 0:be.handleClickCognitiveDecision,handleClickUpdatedPill:null==be?void 0:be.handleClickUpdatedPill,handleClickOutputValue:null==be?void 0:be.handleClickOutputValue,customIcons:null==be?void 0:be.customIcons,CDNeededInChip:ge,showWaitingIconInChip:Ce,showChip:c,status:u,containerRef:ye,children:t||e(n,{})})})},del:({node:t,children:o,...l})=>{var r;const{cleanedChildren:d,extractedNodes:a}=ee(o,["ins"]);return i(n,{children:[e("span",{className:p.deleted,style:null!==(r=null==ne?void 0:ne.deleted)&&void 0!==r?r:{},...l,onClick:()=>{l.onclick&&l.onclick()},children:d}),a]})},ins:({children:t,...o})=>{var l;const{cleanedChildren:r,extractedNodes:d}=ee(t,["del"]);return i(n,{children:[e("span",{className:p.inserted,style:null!==(l=null==ne?void 0:ne.inserted)&&void 0!==l?l:{},...o,onClick:()=>{o.onclick&&o.onclick()},children:r}),d]})},preserved:({children:n,...i})=>e("span",{className:p.preserved,style:null==ne?void 0:ne.preserved,...i,children:n}),manual:({children:i,...t})=>{var o;const l=null===(o=null==t?void 0:t.id)||void 0===o?void 0:o.replaceAll("@","<").replaceAll("#",">"),r=$e.find(e=>e.id.toString()===l),d=t["data-status"];return r?e(M,{aiReason:r,handleClick:null==Le?void 0:Le.handleClick,status:d,children:i}):i||e(n,{})},invisible:({children:i,...t})=>e(n,{}),h1:({node:n,...i})=>e("h1",{className:p.heading1,style:null==ne?void 0:ne.heading1,children:i.children}),h2:({node:n,...i})=>e("h2",{className:p.heading2,style:null==ne?void 0:ne.heading2,children:i.children}),h3:({node:n,...i})=>e("h3",{className:p.heading3,style:null==ne?void 0:ne.heading3,children:i.children}),b:({node:n,...i})=>e("b",{className:p.bold,style:null==ne?void 0:ne.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e("p",{...i,className:p.paragraph,style:null==ne?void 0:ne.paragraph,children:i.children}),updated:({node:n,...i})=>e(y,{...i,showUserStoryDiff:O,currentUpdatedTagId:De,setCurrentUpdatedTagId:_e,userStory:we,setUserStory:Se,setAiReasoning:Re,node:n,isCraflow:de,onCraAccept:ae,onCraReject:se,diffEditConfig:Ee,customStyles:null==ne?void 0:ne.updatedContent,craFlowConfig:ue}),ol:({node:n,...i})=>{var t,r,d;const a=null!==(d=null!==(r=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==i?void 0:i.start)&&void 0!==d?d:void 0,s=Number(null!=a?a:1);return o?e("div",{role:"list",className:p.negatedOrderedList,style:null==ne?void 0:ne.olist,children:l(i.children,e=>`${s+e}.`)}):e("ol",{className:p.orderedList,style:null==ne?void 0:ne.olist,...a?{start:Number(a)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>o?e("div",{role:"list",className:p.negatedUnorderedList,style:null==ne?void 0:ne.ulist,children:l(i.children,()=>"•")}):e("ul",{className:p.unorderedList,style:null==ne?void 0:ne.ulist,children:null==i?void 0:i.children}),li:({node:n,...t})=>{if(o){const e=t["data-list-marker"],{children:n,"data-list-marker":o,...l}=t;return i("div",{...l,role:"listitem",className:`${p.paragraph} ${p.negatedListItem}`,style:null==ne?void 0:ne.paragraph,children:[e&&i("span",{className:p.negatedListMarker,children:[e," "]}),n]})}return e("li",{children:null==t?void 0:t.children})},table:({children:n})=>e("div",{className:p.tableWrapper,children:e("table",{className:p.table,style:null==ne?void 0:ne.table,children:n})}),tr:({node:n,children:i})=>e(F,{node:n,children:i,customStyles:ne}),td:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e(_.Provider,{value:!0,children:e("td",{...l,style:o?{cssText:o}:void 0,children:i})})},th:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e(_.Provider,{value:!0,children:e("th",{...l,style:o?{cssText:o}:void 0,children:i})})},recommendation:({node:n,...i})=>{var t;const o=`The AI has selected this content based on: ${(null===(t=null==i?void 0:i.children)||void 0===t?void 0:t[0])||""}`;return e(x,{...i,customStyles:null==ne?void 0:ne.recommendationBlock,label:o})},a:({inline:n,children:i,node:t,...o})=>{var l;const r=c(_)||"true"===(null==o?void 0:o.table),d=`${null==o?void 0:o.href}`,[a,s]=d.split("$"),u=null==s?void 0:s.split("?")[0];if("ai_reasoning"===a){const n=(null!==(l=O?oe:$e)&&void 0!==l?l:[]).find(e=>e.id.toString()===decodeURIComponent(u)),t=xe.includes(u);if(n){if(r)return e(B,{aiReason:n,customStyle:null==ne?void 0:ne.tableAiReasoning,customIcons:Me,isHighConfidence:n.relevance_score>=N});const o=Je(i),l="source"!==o.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:t,inlineLabel:o,isInlineCitation:l,customIcons:Me,customStyles:{aiReasoningContent:null==ne?void 0:ne.aiReasoningContent,aiReasoningAccordion:null==ne?void 0:ne.aiReasoningAccordion,aiReasoningMarkdown:null==ne?void 0:ne.aiReasoningMarkdown,aiReasoningPill:null==ne?void 0:ne.aiReasoningPill,webCitation:null==ne?void 0:ne.webCitation,stormeeCitation:null==ne?void 0:ne.stormeeCitation,waveformCitation:null==ne?void 0:ne.waveformCitation,imageCitation:null==ne?void 0:ne.imageCitation,fileCitation:null==ne?void 0:ne.fileCitation,appModCitation:null==ne?void 0:ne.appModCitation,rcaCitation:null==ne?void 0:ne.rcaCitation,readFileCitation:null==ne?void 0:ne.readFileCitation,loadingCitations:null==ne?void 0:ne.loadingCitations,chatCitation:null==ne?void 0:ne.chatCitation,bigEnoughCitation:null==ne?void 0:ne.bigEnoughCitation}})}}return ce?e("button",{className:p.citationLink,style:null==ne?void 0:ne.citationLink,onClick:()=>ce((null==o?void 0:o.href)||""),children:i}):null},code:({inline:n,children:i,className:t,node:o,...l})=>/language-(\w+)/.exec(t||"")||(null==t?void 0:t.includes("language-"))?e("div",{children:e("code",{className:p.blockCode,style:null==ne?void 0:ne.code,children:i})}):e("code",{className:p.inlineCode,style:null==ne?void 0:ne.code,children:i}),learned:({children:n})=>e(C,{title:n,placement:"top",children:e(v,{size:16,className:p.learned})}),generatedcode:({node:n,...i})=>{const t=(null==i?void 0:i.language)||"python",o=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n})(i);return e(w,{title:"Generated Code",code:o,language:t,customStyles:{pill:null==ne?void 0:ne.generatedCodePill,content:null==ne?void 0:ne.generatedCodeContent}})},updatedsegment:({node:n,children:i,...t})=>{var o,l,r,d;const a=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(t),c=e("div",s?{dangerouslySetInnerHTML:{__html:f.sanitize(s)}}:{children:i});return e(E,{id:a,node:n,children:c,props:t,segmentComponentConfig:je,customStyles:ne,customIcons:ie,extractText:Je,isUpdatedSegment:!0})},segment:({node:n,children:i,...t})=>{var o,l,r,d;const a=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e(E,{id:a,node:n,children:i,props:t,segmentComponentConfig:je,customStyles:ne,customIcons:ie,extractText:Je,blockId:me,storyId:ve})}}},[ze,ue,$e,le,De,O,o,ie,ke,xe,ne,je,Fe,Qe,me,ve,null==Ue?void 0:Ue.negateList,ce]),Ze=a(()=>{let e=P(Xe,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=D(e,n,"upt"===n)}),e},[Xe]);return s(()=>{if(!ye.current)return;if(!ke.length)return void Pe();const e=ye.current,n=Math.min(Ae,ke.length-1);let i;const t=()=>{requestAnimationFrame(()=>{Te([ke[n].replace(/\*/g,"")])})};t();const o=new MutationObserver(()=>{clearTimeout(i),i=setTimeout(()=>{e.querySelector(`.${m}`)||t()},50)});return o.observe(e,{childList:!0,subtree:!0}),()=>{o.disconnect(),clearTimeout(i)}},[ke,xe,Ae,he]),e(H.Provider,{value:{expandedInfo:He,setExpanded:Ve,reasonToRow:Be},children:i("div",{ref:ye,className:`${p.container} ${"approving"!==W?p.wrapper:""} ${K||""}`,style:null==ne?void 0:ne.container,children:[$?e(U,{children:e(u,{components:Ye,rehypePlugins:[h],children:Ze})}):S,qe>0&&pe&&e("div",{className:p.confidenceScoreContainer,style:null==ne?void 0:ne.confidenceScoreContainer,children:i("span",{className:p.confidenceScore,style:null==ne?void 0:ne.confidenceScore,children:[e(k,{size:14,color:(null==ne?void 0:ne.confidenceScoreIconColor)||"#166534"}),qe,"%"]})}),J&&e("div",{className:p.citationLoader,style:null==ne?void 0:ne.citationLoaderContainer,children:e(b,{customStyles:{container:null==ne?void 0:ne.citationLoadingContainer,icon:null==ne?void 0:ne.citationLoadingIcon,text:null==ne?void 0:ne.citationLoadingText}})}),j&&e("div",{style:{...null===(fe=null==ne?void 0:ne.attachedContext)||void 0===fe?void 0:fe.wrapper},className:"flex mt-5",children:e(A,{customStyles:null==ne?void 0:ne.attachedContext,variant:te})})]})})};export{ne as default,ee as splitNestedDiffNodes};
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import t,{createContext as o,useRef as l,useState as r,useCallback as d,useMemo as a,useEffect as s,useContext as c}from"react";import u from"react-markdown";import h from"rehype-raw";import p from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as g,HIGHLIGHT_CLASS as m}from"../../shared/useMarkdownSearch.js";import{Info as v}from"lucide-react";import{Tooltip as C}from"@mui/material";import f from"dompurify";import y from"../../shared/UpdatedAnimationContent.js";import b from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as I}from"../RequirementAIWrapper/RequirementAIWrapper.js";import S from"../../icons/CognitiveDecision.js";import $ from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as N}from"../ai-reasoning/AiReasoningCitation.js";import k from"../../icons/RelevanceScoreIcon.js";import x from"../RecommendationBlock/RecommendationBlock.js";import A from"../UserStoryCard/AttachedContext.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import L from"./components/InlineUpdatedComponent.js";import E from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as M}from"../../store/markdown-context.js";import U from"./components/InlineManualComponent.js";import T from"./components/HighlightButtonComponent.js";import{escapeTagIds as P,splitTagAcrossParagraphs as D}from"../../../../utils/tagHelper.js";import _ from"../common/TableWrapper.js";const H=o(!1),W=o({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),B=o({rowId:""}),F=({aiReason:n,isHighConfidence:t,customStyle:o,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=c(W),{rowId:u}=c(B),h=String(n.id);u&&s.current.set(h,u);const g=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===n.id,m=t?(null==l?void 0:l.highConfidence)||e(S,{}):(null==l?void 0:l.lowConfidence)||e($,{});return i("button",{className:p.aiReasoningButton,style:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(g?null:u,g?null:n)},children:[m,e("i",g?{className:`pi pi-angle-up ${t?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${t?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence}`})]})},O=({children:n,node:t,customStyles:o,customIcons:r})=>{var d,a;const s=l(Math.random().toString(36).slice(2)).current,{expandedInfo:u}=c(W),h=(null==u?void 0:u.rowId)===s,g=Array.isArray(null==t?void 0:t.children)?t.children.filter(e=>"element"===e.type).length:1,m=null!==(a=null===(d=null==t?void 0:t.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return i(B.Provider,{value:{rowId:s},children:[e("tr",{style:m?{cssText:m}:void 0,children:n}),h&&(null==u?void 0:u.aiReason)&&e("tr",{style:{width:"100%"},children:e("td",{colSpan:g||1,className:p.tableExpandedCell,children:e("div",{className:p.tableExpandedCellInner,children:e("div",{className:p.tableExpandedCellContent,children:e(j,{aiReason:u.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==o?void 0:o.aiReasoningContent,aiReasoningAccordion:null==o?void 0:o.aiReasoningAccordion,aiReasoningMarkdown:null==o?void 0:o.aiReasoningMarkdown,aiReasoningPill:null==o?void 0:o.aiReasoningPill,webCitation:null==o?void 0:o.webCitation,stormeeCitation:null==o?void 0:o.stormeeCitation,waveformCitation:null==o?void 0:o.waveformCitation,imageCitation:null==o?void 0:o.imageCitation,fileCitation:null==o?void 0:o.fileCitation,appModCitation:null==o?void 0:o.appModCitation,rcaCitation:null==o?void 0:o.rcaCitation,readFileCitation:null==o?void 0:o.readFileCitation,loadingCitations:null==o?void 0:o.loadingCitations,chatCitation:null==o?void 0:o.chatCitation}})})})})})]})};const V=["del","ins"];function q(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var t;const o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return`<code>${l=o,l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var l})}function z(e){return function(e,n,i){const t=n.join("|");return e.replace(new RegExp(`<(${t})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,t)=>`<${n}>${i(t)}</${n}>`)}(e,V,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:q(e)).join(""))}function G(e){let n=e.trim();n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const i=[];let t="",o=!1;for(const e of n)o?(t+=e,o=!1):"\\"!==e?"|"!==e?t+=e:(i.push(t.trim()),t=""):(t+=e,o=!0);return i.push(t.trim()),i}function Q(e){return e.trim().includes("|")&&G(e).length>1}function J(e){const n=G(e);return n.length>1&&n.every(e=>/^:?-{3,}:?$/.test(e.replace(/\s+/g,"")))}function K(e){if(!e)return;const n=e.replace(/\s+/g,"");return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":"left"}function X(e,n){return Array.from({length:n},(n,i)=>{var t;return null!==(t=e[i])&&void 0!==t?t:""})}function Y(e,n,i){return`<${e}${function(e){return e?` align="${e}"`:""}(i)}>${q(n)}</${e}>`}function Z(e,n,i){const t=Math.max(e.length,n.length,...i.map(e=>e.length)),o=X(e,t),l=X(n,t).map(K);return`\n\n<table>${`<thead><tr>${o.map((e,n)=>Y("th",e,l[n])).join("")}</tr></thead>`}${i.length?`<tbody>${i.map(e=>`<tr>${X(e,t).map((e,n)=>Y("td",e,l[n])).join("")}</tr>`).join("")}</tbody>`:""}</table>\n\n`}const ee=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ne(e,n){const i=[],o=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!t.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(o.has(d))return i.push(e),null;if(ee.has(d))return e;const a=null===(r=t.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?t.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const ie=({message:o,noMarkdownContent:S,useMarkdown:$=!0,isParent:j,scenario:B,showUserStoryDiff:V=!1,aiReasoningsForBlock:q,isCitationLoadingDisplay:K=!1,className:X,highConfidenceIcon:Y,lowConfidenceIcon:ee,customStyles:ie,customIcons:te,contextVariant:oe,aiReasoningDiffView:le,userStoryCitations:re,artifactId:de,isCraflow:ae,onCraAccept:se,onCraReject:ce,onCitationLinkClick:ue,craFlowConfig:he,isDisplayHighlightControl:pe=!1,showConfidenceScore:ge=!0,CDNeededInChip:me,blockId:ve,storyId:Ce,showWaitingIconInChip:fe,menuActions:ye})=>{var be;console.log("userstorywithcitation blockid ",ve,ye);const we=l(null),{userStory:Ie,inlineUpdateComponentConfig:Se,getAvgScoreForStory:$e,setUserStory:Re,aiReasoning:Ne,setAiReasoning:ke,customIcons:xe,searchQueryList:Ae,searchQueryReasoningIdList:je,currentHighlightIndex:Le,segmentComponentConfig:Ee,inlineManualComponentConfig:Me,diffEditConfig:Ue,customSectionConfig:Te}=I(),Pe=null!=te?te:null==xe?void 0:xe.userStoryIcons;null==ie||ie.searchHighlight;const{search:De,clear:_e}=g(we),[He,We]=r("1"),[Be,Fe]=r(null),Oe=l(new Map),[Ve,qe]=r(new Set),ze=d((e,n)=>{Fe(e&&n?{rowId:e,aiReason:n}:null)},[]),Ge=de?$e(de):0,[Qe,Je]=r([]),Ke=d(e=>{qe(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Xe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Xe).join(""):t.isValidElement(e)?Xe(e.props.children):"",Ye=e=>{let n=function(e){const n=e.split("\n"),i=[];let t=!1;for(let e=0;e<n.length;e++){const o=n[e];if(/^\s*(```|~~~)/.test(o)){t=!t,i.push(o);continue}const l=n[e+1];if(!t&&void 0!==l&&Q(o)&&J(l)){const t=G(o),r=G(l),d=[];for(e+=2;e<n.length&&Q(n[e])&&!J(n[e]);)d.push(G(n[e])),e++;e--,i.push(Z(t,r,d));continue}i.push(o)}return i.join("\n")}(function(e){return e.replace(/\\r\\n|\\n|\\r/g,"\n")}(e));return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,t,o)=>{const l=t.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,t,o)=>{const l=n.substring(0,o),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=t;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let t;const o=new RegExp(n.source,n.flags);for(;null!==(t=o.exec(e));){const e=t[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),o=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:t.index,endIndex:t.index+t[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==o?void 0:o[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],t=n.changedItemCount-n.deletedItemCount;if(0===t)continue;const o=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of o){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+t}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=z(n),n},Ze=a(()=>o?Ye(o):o,[o]);s(()=>{Je(q||Ne)},[q,Ne]);const en=a(()=>{const o=Boolean(null==Te?void 0:Te.negateList),l=(e,n)=>{let i=0;return t.Children.map(e,e=>{if(!t.isValidElement(e))return e;const o=n(i);return i+=1,t.cloneElement(e,{"data-list-marker":o})})};return{span:({node:n,children:i,...t})=>{var o,l,r,d,a;const s=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o["highlight-id"])&&void 0!==l?l:null==t?void 0:t["highlight-id"],c="string"==typeof s&&Ve.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==t?void 0:t["highlight-color"];return e("span",{style:{...null!==(a=null==ie?void 0:ie.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:i,children:t,...o})=>{var l,r,d,a,s,c;const u=null!==(r=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.action)&&void 0!==r?r:null==o?void 0:o.action,h=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==o?void 0:o["highlight-id"],p=null!==(c=null===(s=null==i?void 0:i.properties)||void 0===s?void 0:s["highlight-type"])&&void 0!==c?c:null==o?void 0:o["highlight-type"];return"highlight"===u?e(T,{highlightId:h,handleHighlightSpan:Ke,icon:"web"===p?null==Pe?void 0:Pe.webCitationIcon:"doc"===p?null==Pe?void 0:Pe.fileCitationIcon:e(n,{}),customStyles:"web"===p?null==ie?void 0:ie.webButton:"doc"===p?null==ie?void 0:ie.docButton:{}}):null},upt:({node:i,children:t,...o})=>{var l,r;const d=null==o?void 0:o.id,a=d?null===(r=null===(l=d.split("$"))||void 0===l?void 0:l[1])||void 0===r?void 0:r.replaceAll("@","<").replaceAll("#",">"):null,s=Ne.find(e=>e.id.toString()===a);if(!s)return t||e(n,{});const c="data-main"in o,u=o["data-status"];return e(n,{children:e(L,{aiReason:s,customStyles:null==ie?void 0:ie.inlineUpdatedComponent,handleClickCognitiveDecision:null==Se?void 0:Se.handleClickCognitiveDecision,handleClickUpdatedPill:null==Se?void 0:Se.handleClickUpdatedPill,handleClickOutputValue:null==Se?void 0:Se.handleClickOutputValue,customIcons:null==Se?void 0:Se.customIcons,CDNeededInChip:me,showWaitingIconInChip:fe,showChip:c,status:u,containerRef:we,children:t||e(n,{})})})},del:({node:t,children:o,...l})=>{var r;const{cleanedChildren:d,extractedNodes:a}=ne(o,["ins"]);return i(n,{children:[e("span",{className:p.deleted,style:null!==(r=null==ie?void 0:ie.deleted)&&void 0!==r?r:{},...l,onClick:()=>{l.onclick&&l.onclick()},children:d}),a]})},ins:({children:t,...o})=>{var l;const{cleanedChildren:r,extractedNodes:d}=ne(t,["del"]);return i(n,{children:[e("span",{className:p.inserted,style:null!==(l=null==ie?void 0:ie.inserted)&&void 0!==l?l:{},...o,onClick:()=>{o.onclick&&o.onclick()},children:r}),d]})},preserved:({children:n,...i})=>e("span",{className:p.preserved,style:null==ie?void 0:ie.preserved,...i,children:n}),manual:({children:i,...t})=>{var o;const l=null===(o=null==t?void 0:t.id)||void 0===o?void 0:o.replaceAll("@","<").replaceAll("#",">"),r=Ne.find(e=>e.id.toString()===l),d=t["data-status"];return r?e(U,{aiReason:r,handleClick:null==Me?void 0:Me.handleClick,status:d,children:i}):i||e(n,{})},invisible:({children:i,...t})=>e(n,{}),h1:({node:n,...i})=>e("h1",{className:p.heading1,style:null==ie?void 0:ie.heading1,children:i.children}),h2:({node:n,...i})=>e("h2",{className:p.heading2,style:null==ie?void 0:ie.heading2,children:i.children}),h3:({node:n,...i})=>e("h3",{className:p.heading3,style:null==ie?void 0:ie.heading3,children:i.children}),b:({node:n,...i})=>e("b",{className:p.bold,style:null==ie?void 0:ie.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e("p",{...i,className:p.paragraph,style:null==ie?void 0:ie.paragraph,children:i.children}),updated:({node:n,...i})=>e(y,{...i,showUserStoryDiff:V,currentUpdatedTagId:He,setCurrentUpdatedTagId:We,userStory:Ie,setUserStory:Re,setAiReasoning:ke,node:n,isCraflow:ae,onCraAccept:se,onCraReject:ce,diffEditConfig:Ue,customStyles:null==ie?void 0:ie.updatedContent,craFlowConfig:he}),ol:({node:n,...i})=>{var t,r,d;const a=null!==(d=null!==(r=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==i?void 0:i.start)&&void 0!==d?d:void 0,s=Number(null!=a?a:1);return o?e("div",{role:"list",className:p.negatedOrderedList,style:null==ie?void 0:ie.olist,children:l(i.children,e=>`${s+e}.`)}):e("ol",{className:p.orderedList,style:null==ie?void 0:ie.olist,...a?{start:Number(a)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>o?e("div",{role:"list",className:p.negatedUnorderedList,style:null==ie?void 0:ie.ulist,children:l(i.children,()=>"•")}):e("ul",{className:p.unorderedList,style:null==ie?void 0:ie.ulist,children:null==i?void 0:i.children}),li:({node:n,...t})=>{if(o){const e=t["data-list-marker"],{children:n,"data-list-marker":o,...l}=t;return i("div",{...l,role:"listitem",className:`${p.paragraph} ${p.negatedListItem}`,style:null==ie?void 0:ie.paragraph,children:[e&&i("span",{className:p.negatedListMarker,children:[e," "]}),n]})}return e("li",{children:null==t?void 0:t.children})},table:({children:n})=>e(_,{menuConfig:null==ye?void 0:ye.table,menuStyles:null==ie?void 0:ie.tableMenu,tableStyle:null==ie?void 0:ie.table,blockId:ve,storyId:Ce,children:n}),tr:({node:n,children:i})=>e(O,{node:n,children:i,customStyles:ie}),td:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e(H.Provider,{value:!0,children:e("td",{...l,style:o?{cssText:o}:void 0,children:i})})},th:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e(H.Provider,{value:!0,children:e("th",{...l,style:o?{cssText:o}:void 0,children:i})})},recommendation:({node:n,...i})=>{var t;const o=`The AI has selected this content based on: ${(null===(t=null==i?void 0:i.children)||void 0===t?void 0:t[0])||""}`;return e(x,{...i,customStyles:null==ie?void 0:ie.recommendationBlock,label:o})},a:({inline:n,children:i,node:t,...o})=>{var l;const r=c(H)||"true"===(null==o?void 0:o.table),d=`${null==o?void 0:o.href}`,[a,s]=d.split("$"),u=null==s?void 0:s.split("?")[0];if("ai_reasoning"===a){const n=(null!==(l=V?le:Ne)&&void 0!==l?l:[]).find(e=>e.id.toString()===decodeURIComponent(u)),t=je.includes(u);if(n){if(r)return e(F,{aiReason:n,customStyle:null==ie?void 0:ie.tableAiReasoning,customIcons:Pe,isHighConfidence:n.relevance_score>=N});const o=Xe(i),l="source"!==o.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:t,inlineLabel:o,isInlineCitation:l,customIcons:Pe,customStyles:{aiReasoningContent:null==ie?void 0:ie.aiReasoningContent,aiReasoningAccordion:null==ie?void 0:ie.aiReasoningAccordion,aiReasoningMarkdown:null==ie?void 0:ie.aiReasoningMarkdown,aiReasoningPill:null==ie?void 0:ie.aiReasoningPill,webCitation:null==ie?void 0:ie.webCitation,stormeeCitation:null==ie?void 0:ie.stormeeCitation,waveformCitation:null==ie?void 0:ie.waveformCitation,imageCitation:null==ie?void 0:ie.imageCitation,fileCitation:null==ie?void 0:ie.fileCitation,appModCitation:null==ie?void 0:ie.appModCitation,rcaCitation:null==ie?void 0:ie.rcaCitation,readFileCitation:null==ie?void 0:ie.readFileCitation,loadingCitations:null==ie?void 0:ie.loadingCitations,chatCitation:null==ie?void 0:ie.chatCitation,bigEnoughCitation:null==ie?void 0:ie.bigEnoughCitation}})}}return ue?e("button",{className:p.citationLink,style:null==ie?void 0:ie.citationLink,onClick:()=>ue((null==o?void 0:o.href)||""),children:i}):null},code:({inline:n,children:i,className:t,node:o,...l})=>/language-(\w+)/.exec(t||"")||(null==t?void 0:t.includes("language-"))?e("div",{children:e("code",{className:p.blockCode,style:null==ie?void 0:ie.code,children:i})}):e("code",{className:p.inlineCode,style:null==ie?void 0:ie.code,children:i}),learned:({children:n})=>e(C,{title:n,placement:"top",children:e(v,{size:16,className:p.learned})}),generatedcode:({node:n,...i})=>{const t=(null==i?void 0:i.language)||"python",o=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=e=>{var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n})(i);return e(b,{title:"Generated Code",code:o,language:t,customStyles:{pill:null==ie?void 0:ie.generatedCodePill,content:null==ie?void 0:ie.generatedCodeContent}})},updatedsegment:({node:n,children:i,...t})=>{var o,l,r,d;const a=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(t),c=e("div",s?{dangerouslySetInnerHTML:{__html:f.sanitize(s)}}:{children:i});return e(E,{id:a,node:n,children:c,props:t,segmentComponentConfig:Ee,customStyles:ie,customIcons:te,extractText:Xe,isUpdatedSegment:!0})},segment:({node:n,children:i,...t})=>{var o,l,r,d;const a=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e(E,{id:a,node:n,children:i,props:t,segmentComponentConfig:Ee,customStyles:ie,customIcons:te,extractText:Xe,blockId:ve,storyId:Ce})}}},[Qe,he,Ne,re,He,V,o,te,Ae,je,ie,Ee,Ve,Ke,ve,Ce,null==Te?void 0:Te.negateList,ue]),nn=a(()=>{let e=P(Ze,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=D(e,n,"upt"===n)}),e},[Ze]);return s(()=>{if(!we.current)return;if(!Ae.length)return void _e();const e=we.current,n=Math.min(Le,Ae.length-1);let i;const t=()=>{requestAnimationFrame(()=>{De([Ae[n].replace(/\*/g,"")])})};t();const o=new MutationObserver(()=>{clearTimeout(i),i=setTimeout(()=>{e.querySelector(`.${m}`)||t()},50)});return o.observe(e,{childList:!0,subtree:!0}),()=>{o.disconnect(),clearTimeout(i)}},[Ae,je,Le,pe]),e(W.Provider,{value:{expandedInfo:Be,setExpanded:ze,reasonToRow:Oe},children:i("div",{ref:we,className:`${p.container} ${"approving"!==B?p.wrapper:""} ${X||""}`,style:null==ie?void 0:ie.container,children:[$?e(M,{children:e(u,{components:en,rehypePlugins:[h],children:nn})}):S,Ge>0&&ge&&e("div",{className:p.confidenceScoreContainer,style:null==ie?void 0:ie.confidenceScoreContainer,children:i("span",{className:p.confidenceScore,style:null==ie?void 0:ie.confidenceScore,children:[e(k,{size:14,color:(null==ie?void 0:ie.confidenceScoreIconColor)||"#166534"}),Ge,"%"]})}),K&&e("div",{className:p.citationLoader,style:null==ie?void 0:ie.citationLoaderContainer,children:e(w,{customStyles:{container:null==ie?void 0:ie.citationLoadingContainer,icon:null==ie?void 0:ie.citationLoadingIcon,text:null==ie?void 0:ie.citationLoadingText}})}),j&&e("div",{style:{...null===(be=null==ie?void 0:ie.attachedContext)||void 0===be?void 0:be.wrapper},className:"flex mt-5",children:e(A,{customStyles:null==ie?void 0:ie.attachedContext,variant:oe})})]})})};export{ie as default,ne as splitNestedDiffNodes};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t={container:"UserStoryWithCitation-module_container__YRdbR",wrapper:"UserStoryWithCitation-module_wrapper__wbnqg",heading1:"UserStoryWithCitation-module_heading1__KsWUO",heading2:"UserStoryWithCitation-module_heading2__GHshw",heading3:"UserStoryWithCitation-module_heading3__Jm9Xb",bold:"UserStoryWithCitation-module_bold__HenfX",paragraph:"UserStoryWithCitation-module_paragraph__a1-pc",orderedList:"UserStoryWithCitation-module_orderedList__E5PQa",unorderedList:"UserStoryWithCitation-module_unorderedList__SFvpc",inlineCode:"UserStoryWithCitation-module_inlineCode__5014y",blockCode:"UserStoryWithCitation-module_blockCode__pmHG5",learned:"UserStoryWithCitation-module_learned__0US6d",linkText:"UserStoryWithCitation-module_linkText__5kBNv",tableWrapper:"UserStoryWithCitation-module_tableWrapper__r94Fx",table:"UserStoryWithCitation-module_table__tEyKd",scrollContainer:"UserStoryWithCitation-module_scrollContainer__S-BtW",citationLoader:"UserStoryWithCitation-module_citationLoader__Op7Sm",aiReasoningButton:"UserStoryWithCitation-module_aiReasoningButton__-tprH",aiReasoningIconHighConfidence:"UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6",aiReasoningIconLowConfidence:"UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz",confidenceScoreContainer:"UserStoryWithCitation-module_confidenceScoreContainer__zOE-E",confidenceScore:"UserStoryWithCitation-module_confidenceScore__lhT4p",inserted:"UserStoryWithCitation-module_inserted__66gBL",deleted:"UserStoryWithCitation-module_deleted__mzR4t",preserved:"UserStoryWithCitation-module_preserved__ND8uC",citationLink:"UserStoryWithCitation-module_citationLink__lHa9C",negatedOrderedList:"UserStoryWithCitation-module_negatedOrderedList__RZDGe",negatedUnorderedList:"UserStoryWithCitation-module_negatedUnorderedList__ZTOPu",negatedListItem:"UserStoryWithCitation-module_negatedListItem__pcJY9",negatedListMarker:"UserStoryWithCitation-module_negatedListMarker__yWtUn"};!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const e=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode('.UserStoryWithCitation-module_container__YRdbR{box-sizing:border-box;position:relative;width:100%}.UserStoryWithCitation-module_wrapper__wbnqg{border:1px solid #d5d5d5;border-radius:16px;padding:20px}.UserStoryWithCitation-module_heading1__KsWUO{color:#000;font-family:Inter,sans-serif;font-size:1.5rem;margin:.75rem 0 .25rem;padding:0}.UserStoryWithCitation-module_heading2__GHshw{color:#000;font-family:Inter,sans-serif;font-size:1.25rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_heading3__Jm9Xb{color:#000;font-family:Inter,sans-serif;font-size:1.125rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_bold__HenfX{font-family:Inter,sans-serif;font-weight:700}.UserStoryWithCitation-module_paragraph__a1-pc{word-wrap:break-word;display:block;flex-wrap:wrap;font-family:Inter,sans-serif;font-size:1rem;line-height:1.75rem;margin:0;max-width:100%;overflow:hidden;overflow:visible;overflow-wrap:break-word;text-align:justify;white-space:normal;word-break:break-word}.UserStoryWithCitation-module_orderedList__E5PQa{font-family:Inter,sans-serif;list-style-type:decimal;margin-left:1rem}.UserStoryWithCitation-module_unorderedList__SFvpc{font-family:Inter,sans-serif;list-style-type:disc;margin-left:1rem}.UserStoryWithCitation-module_inlineCode__5014y{background-color:#f0f2f5;border-radius:.3rem;box-sizing:border-box;color:#323232;font-family:Source Code Pro,monospace;font-size:.95em;overflow-wrap:break-word;padding:.2rem .5rem;white-space:pre-wrap;width:100%;word-break:break-word}.UserStoryWithCitation-module_blockCode__pmHG5{color:#d63384;display:block;overflow:hidden;white-space:pre-wrap;word-break:break-words}.UserStoryWithCitation-module_learned__0US6d{color:#3b82f6;cursor:pointer;display:inline-block;margin-left:.25rem;margin-right:.25rem}.UserStoryWithCitation-module_linkText__5kBNv:hover{color:#1d4ed8}.UserStoryWithCitation-module_tableWrapper__r94Fx{-webkit-overflow-scrolling:touch;box-sizing:border-box;margin:16px 0;max-width:100%;overflow-x:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd{border:1px solid #d1d5db;border-collapse:collapse;box-sizing:border-box;font-family:Inter,sans-serif;font-size:.95rem;line-height:1.45rem;margin:0;min-width:100%;table-layout:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd td,.UserStoryWithCitation-module_table__tEyKd th{border:1px solid #d1d5db;color:#111827;overflow-wrap:break-word;padding:8px 10px;vertical-align:top;white-space:normal;word-break:normal}.UserStoryWithCitation-module_table__tEyKd th{background:#f3f4f6;font-weight:700;white-space:nowrap}.UserStoryWithCitation-module_table__tEyKd td[align=center],.UserStoryWithCitation-module_table__tEyKd th[align=center]{text-align:center}.UserStoryWithCitation-module_table__tEyKd td[align=right],.UserStoryWithCitation-module_table__tEyKd th[align=right]{text-align:right}.UserStoryWithCitation-module_table__tEyKd tr:nth-child(2n) td{background:#fafafa}.UserStoryWithCitation-module_table__tEyKd p{margin:0}.UserStoryWithCitation-module_scrollContainer__S-BtW{overflow:hidden}.UserStoryWithCitation-module_citationLoader__Op7Sm{bottom:0;left:0;margin-top:12px}.UserStoryWithCitation-module_aiReasoningButton__-tprH{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;gap:2px;padding:2px 4px;vertical-align:middle}.UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6{color:#4b5563;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz{color:#cf4343;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_confidenceScoreContainer__zOE-E{position:absolute;right:12px;top:12px;z-index:10}.UserStoryWithCitation-module_confidenceScore__lhT4p{align-items:center;background-color:#f0fdf4;border:1px solid #bbf7d0;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#166534;display:inline-flex;font-family:Inter,sans-serif;font-size:12px;font-weight:700;gap:4px;padding:4px 8px}.UserStoryWithCitation-module_orderedList__E5PQa{counter-reset:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa>li{counter-increment:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:childItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:childItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:grandchildItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:grandchildItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) "." counter(grandchildItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_inserted__66gBL{background-color:#8cbeff}.UserStoryWithCitation-module_deleted__mzR4t{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}.UserStoryWithCitation-module_preserved__ND8uC{background-color:#fff;text-decoration:underline;text-decoration-color:#d3d3d3}.UserStoryWithCitation-module_citationLink__lHa9C{background:none;border:none;color:inherit;cursor:pointer;font:inherit;padding:0;text-decoration:underline}[class*=_upt-]>[class*=_inserted_]{background-color:#f3e8ff}[class^=_manual-]>[class^=_inserted_]{background-color:#8cbeff}.UserStoryWithCitation-module_negatedOrderedList__RZDGe,.UserStoryWithCitation-module_negatedUnorderedList__ZTOPu{margin:0;padding:0}.UserStoryWithCitation-module_negatedListItem__pcJY9{display:block;margin:0;padding:0}.UserStoryWithCitation-module_negatedListMarker__yWtUn{display:inline;font:inherit}.UserStoryWithCitation-module_negatedListItem__pcJY9>p:first-of-type{display:inline;margin:0}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span{display:inline!important;margin:0!important;width:auto!important}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span>span:not([class*=_hoverActions_]){display:inline!important;width:auto!important}'));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(t)}();export{t as default};
|
|
1
|
+
var t={container:"UserStoryWithCitation-module_container__YRdbR",wrapper:"UserStoryWithCitation-module_wrapper__wbnqg",heading1:"UserStoryWithCitation-module_heading1__KsWUO",heading2:"UserStoryWithCitation-module_heading2__GHshw",heading3:"UserStoryWithCitation-module_heading3__Jm9Xb",bold:"UserStoryWithCitation-module_bold__HenfX",paragraph:"UserStoryWithCitation-module_paragraph__a1-pc",orderedList:"UserStoryWithCitation-module_orderedList__E5PQa",unorderedList:"UserStoryWithCitation-module_unorderedList__SFvpc",inlineCode:"UserStoryWithCitation-module_inlineCode__5014y",blockCode:"UserStoryWithCitation-module_blockCode__pmHG5",learned:"UserStoryWithCitation-module_learned__0US6d",linkText:"UserStoryWithCitation-module_linkText__5kBNv",tableWrapper:"UserStoryWithCitation-module_tableWrapper__r94Fx",table:"UserStoryWithCitation-module_table__tEyKd",scrollContainer:"UserStoryWithCitation-module_scrollContainer__S-BtW",citationLoader:"UserStoryWithCitation-module_citationLoader__Op7Sm",aiReasoningButton:"UserStoryWithCitation-module_aiReasoningButton__-tprH",aiReasoningIconHighConfidence:"UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6",aiReasoningIconLowConfidence:"UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz",confidenceScoreContainer:"UserStoryWithCitation-module_confidenceScoreContainer__zOE-E",confidenceScore:"UserStoryWithCitation-module_confidenceScore__lhT4p",inserted:"UserStoryWithCitation-module_inserted__66gBL",deleted:"UserStoryWithCitation-module_deleted__mzR4t",preserved:"UserStoryWithCitation-module_preserved__ND8uC",citationLink:"UserStoryWithCitation-module_citationLink__lHa9C",negatedOrderedList:"UserStoryWithCitation-module_negatedOrderedList__RZDGe",negatedUnorderedList:"UserStoryWithCitation-module_negatedUnorderedList__ZTOPu",negatedListItem:"UserStoryWithCitation-module_negatedListItem__pcJY9",negatedListMarker:"UserStoryWithCitation-module_negatedListMarker__yWtUn",tableMenuWrapper:"UserStoryWithCitation-module_tableMenuWrapper__QdxLp",tableMenuButton:"UserStoryWithCitation-module_tableMenuButton__MBrVD",tableMenuButtonActive:"UserStoryWithCitation-module_tableMenuButtonActive__a7LxI",tableWithMenu:"UserStoryWithCitation-module_tableWithMenu__ZBwbB"};!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const e=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode('.UserStoryWithCitation-module_container__YRdbR{box-sizing:border-box;position:relative;width:100%}.UserStoryWithCitation-module_wrapper__wbnqg{border:1px solid #d5d5d5;border-radius:16px;padding:20px}.UserStoryWithCitation-module_heading1__KsWUO{color:#000;font-family:Inter,sans-serif;font-size:1.5rem;margin:.75rem 0 .25rem;padding:0}.UserStoryWithCitation-module_heading2__GHshw{color:#000;font-family:Inter,sans-serif;font-size:1.25rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_heading3__Jm9Xb{color:#000;font-family:Inter,sans-serif;font-size:1.125rem;margin:10px 0 0;padding:0}.UserStoryWithCitation-module_bold__HenfX{font-family:Inter,sans-serif;font-weight:700}.UserStoryWithCitation-module_paragraph__a1-pc{word-wrap:break-word;display:block;flex-wrap:wrap;font-family:Inter,sans-serif;font-size:1rem;line-height:1.75rem;margin:0;max-width:100%;overflow:hidden;overflow:visible;overflow-wrap:break-word;text-align:justify;white-space:normal;word-break:break-word}.UserStoryWithCitation-module_orderedList__E5PQa{font-family:Inter,sans-serif;list-style-type:decimal;margin-left:1rem}.UserStoryWithCitation-module_unorderedList__SFvpc{font-family:Inter,sans-serif;list-style-type:disc;margin-left:1rem}.UserStoryWithCitation-module_inlineCode__5014y{background-color:#f0f2f5;border-radius:.3rem;box-sizing:border-box;color:#323232;font-family:Source Code Pro,monospace;font-size:.95em;overflow-wrap:break-word;padding:.2rem .5rem;white-space:pre-wrap;width:100%;word-break:break-word}.UserStoryWithCitation-module_blockCode__pmHG5{color:#d63384;display:block;overflow:hidden;white-space:pre-wrap;word-break:break-words}.UserStoryWithCitation-module_learned__0US6d{color:#3b82f6;cursor:pointer;display:inline-block;margin-left:.25rem;margin-right:.25rem}.UserStoryWithCitation-module_linkText__5kBNv:hover{color:#1d4ed8}.UserStoryWithCitation-module_tableWrapper__r94Fx{-webkit-overflow-scrolling:touch;box-sizing:border-box;margin:16px 0;max-width:100%;overflow-x:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd{border:1px solid #d1d5db;border-collapse:collapse;box-sizing:border-box;font-family:Inter,sans-serif;font-size:.95rem;line-height:1.45rem;margin:0;min-width:100%;table-layout:auto;width:100%}.UserStoryWithCitation-module_table__tEyKd td,.UserStoryWithCitation-module_table__tEyKd th{border:1px solid #d1d5db;color:#111827;overflow-wrap:break-word;padding:8px 10px;vertical-align:top;white-space:normal;word-break:normal}.UserStoryWithCitation-module_table__tEyKd th{background:#f3f4f6;font-weight:700;white-space:nowrap}.UserStoryWithCitation-module_table__tEyKd td[align=center],.UserStoryWithCitation-module_table__tEyKd th[align=center]{text-align:center}.UserStoryWithCitation-module_table__tEyKd td[align=right],.UserStoryWithCitation-module_table__tEyKd th[align=right]{text-align:right}.UserStoryWithCitation-module_table__tEyKd tr:nth-child(2n) td{background:#fafafa}.UserStoryWithCitation-module_table__tEyKd p{margin:0}.UserStoryWithCitation-module_scrollContainer__S-BtW{overflow:hidden}.UserStoryWithCitation-module_citationLoader__Op7Sm{bottom:0;left:0;margin-top:12px}.UserStoryWithCitation-module_aiReasoningButton__-tprH{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;gap:2px;padding:2px 4px;vertical-align:middle}.UserStoryWithCitation-module_aiReasoningIconHighConfidence__FmXx6{color:#4b5563;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_aiReasoningIconLowConfidence__TfkJz{color:#cf4343;font-size:12px;transform:translateY(5px)}.UserStoryWithCitation-module_confidenceScoreContainer__zOE-E{position:absolute;right:12px;top:12px;z-index:10}.UserStoryWithCitation-module_confidenceScore__lhT4p{align-items:center;background-color:#f0fdf4;border:1px solid #bbf7d0;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#166534;display:inline-flex;font-family:Inter,sans-serif;font-size:12px;font-weight:700;gap:4px;padding:4px 8px}.UserStoryWithCitation-module_orderedList__E5PQa{counter-reset:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa>li{counter-increment:parentItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:childItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:childItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc{counter-reset:grandchildItem;list-style-type:none!important}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li{align-items:baseline;counter-increment:grandchildItem}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li:before{content:counter(parentItem) "." counter(childItem) "." counter(grandchildItem) " ";flex-shrink:0;margin-right:4px}.UserStoryWithCitation-module_orderedList__E5PQa li>.UserStoryWithCitation-module_unorderedList__SFvpc li>.UserStoryWithCitation-module_unorderedList__SFvpc>li>.UserStoryWithCitation-module_paragraph__a1-pc{display:inline}.UserStoryWithCitation-module_inserted__66gBL{background-color:#8cbeff}.UserStoryWithCitation-module_deleted__mzR4t{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}.UserStoryWithCitation-module_preserved__ND8uC{background-color:#fff;text-decoration:underline;text-decoration-color:#d3d3d3}.UserStoryWithCitation-module_citationLink__lHa9C{background:none;border:none;color:inherit;cursor:pointer;font:inherit;padding:0;text-decoration:underline}[class*=_upt-]>[class*=_inserted_]{background-color:#f3e8ff}[class^=_manual-]>[class^=_inserted_]{background-color:#8cbeff}.UserStoryWithCitation-module_negatedOrderedList__RZDGe,.UserStoryWithCitation-module_negatedUnorderedList__ZTOPu{margin:0;padding:0}.UserStoryWithCitation-module_negatedListItem__pcJY9{display:block;margin:0;padding:0}.UserStoryWithCitation-module_negatedListMarker__yWtUn{display:inline;font:inherit}.UserStoryWithCitation-module_negatedListItem__pcJY9>p:first-of-type{display:inline;margin:0}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span{display:inline!important;margin:0!important;width:auto!important}.UserStoryWithCitation-module_negatedListItem__pcJY9>.UserStoryWithCitation-module_negatedListMarker__yWtUn+span>span:not([class*=_hoverActions_]){display:inline!important;width:auto!important}.UserStoryWithCitation-module_tableMenuWrapper__QdxLp{isolation:isolate;position:relative}.UserStoryWithCitation-module_tableMenuButton__MBrVD{align-items:center;background:#0000;border:1px solid #0000;border-radius:6px;color:#475569;cursor:pointer;display:flex;justify-content:center;position:absolute;right:1px;top:1px;transition:background-color .18s ease,border-color .18s ease,color .18s ease;width:38px;z-index:2}.UserStoryWithCitation-module_tableMenuButtonActive__a7LxI,.UserStoryWithCitation-module_tableMenuButton__MBrVD:hover{background:#f1f5f9;border-color:#e2e8f0;color:#0f172a}.UserStoryWithCitation-module_tableMenuButton__MBrVD:focus-visible{outline:2px solid #183ec2;outline-offset:2px}.UserStoryWithCitation-module_tableWithMenu__ZBwbB th:last-child{padding-right:var(--table-menu-reserved,44px)}'));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(t)}();export{t as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.module.css.js.map
|
|
@@ -3,6 +3,7 @@ import { IUserStory } from "../../interfaces/userstory.interface";
|
|
|
3
3
|
import { SectionStatusConfig } from "../RequirementAIWrapper/RequirementAIWrapper";
|
|
4
4
|
import { UserStoryCitations } from "../../interfaces/citation.interface";
|
|
5
5
|
import { ActiveMember } from "./cws/SocketManager";
|
|
6
|
+
import { MenuActions } from "../../types/menuAction.type";
|
|
6
7
|
interface CardDisplayConfig {
|
|
7
8
|
showShareButton?: boolean;
|
|
8
9
|
showEditButton?: boolean;
|
|
@@ -99,10 +100,11 @@ interface StoryCardProps {
|
|
|
99
100
|
onUserStoryAccordionStateChange?: (userStoryItem: IUserStory, updatedState: boolean) => void;
|
|
100
101
|
showSuggestedFilesInfo?: boolean;
|
|
101
102
|
suggestedFilesConfig?: SuggestedFilesConfig;
|
|
103
|
+
menuActions?: MenuActions;
|
|
102
104
|
}
|
|
103
105
|
export declare function replaceLearnedTagsWithInfo(content: string): React.ReactNode[];
|
|
104
106
|
type UserStoryOnSave = (content: string, storyId: string) => Promise<void>;
|
|
105
|
-
export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, defaultExpanded, actionItemsConfig, onDelete, contextVariant, expandedSubFeatures, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, sectionStatusConfig, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, blockNumber, storyNumber, showWaitingIconInChip, showAssignSection, disableAssignSection, onAssignSectionClick, onSave, onUserStoryAccordionStateChange, showSuggestedFilesInfo, suggestedFilesConfig, }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, defaultExpanded, actionItemsConfig, onDelete, contextVariant, expandedSubFeatures, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, sectionStatusConfig, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, blockNumber, storyNumber, showWaitingIconInChip, showAssignSection, disableAssignSection, onAssignSectionClick, onSave, onUserStoryAccordionStateChange, showSuggestedFilesInfo, suggestedFilesConfig, menuActions }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
106
108
|
interface IProps {
|
|
107
109
|
isUserStoryCurrentlyUpdated?: boolean;
|
|
108
110
|
artifactId: string;
|
|
@@ -142,7 +144,8 @@ interface IProps {
|
|
|
142
144
|
showSuggestedFilesInfo?: boolean;
|
|
143
145
|
suggestedFilesConfig?: SuggestedFilesConfig;
|
|
144
146
|
onChangeActiveDocumentMembers?: (activeMembers: ActiveMember[]) => void;
|
|
147
|
+
menuActions?: MenuActions;
|
|
145
148
|
}
|
|
146
|
-
export declare const UserStoryCardWrapper: ({ artifactTitleIDs, expandedSubFeatures, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig, contextVariant, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, defaultExpanded, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, showWaitingIconInChip, setRedlineDocumentIdParent, showAssignSection, onAssignSectionClick, disableAssignSection, onSave, onUserStoryAccordionStateChange, showSuggestedFilesInfo, suggestedFilesConfig, onChangeActiveDocumentMembers, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
export declare const UserStoryCardWrapper: ({ artifactTitleIDs, expandedSubFeatures, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig, contextVariant, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, defaultExpanded, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, showWaitingIconInChip, setRedlineDocumentIdParent, showAssignSection, onAssignSectionClick, disableAssignSection, onSave, onUserStoryAccordionStateChange, showSuggestedFilesInfo, suggestedFilesConfig, onChangeActiveDocumentMembers, menuActions }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
147
150
|
export default StoryCard;
|
|
148
151
|
//# sourceMappingURL=UserStoryCard.d.ts.map
|
package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAmC,MAAM,OAAO,CAAC;AA4BhG,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAMlE,OAAQ,EAA8C,mBAAmB,EAA+B,MAAM,8CAA8C,CAAC;AAC7J,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAYzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAmC,MAAM,OAAO,CAAC;AA4BhG,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAMlE,OAAQ,EAA8C,mBAAmB,EAA+B,MAAM,8CAA8C,CAAC;AAC7J,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAYzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAK1D,UAAU,iBAAiB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,qBAAqB;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAGD,MAAM,WAAW,oBAAoB;IACjC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,gBAAgB,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,cAAc;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,iBAAiB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAEpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnK,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAC,UAAU,GAAG,QAAQ,CAAC;IACtC,eAAe,CAAC,EAAC,OAAO,CAAC;IACzB,cAAc,CAAC,EAAC,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAC,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAC,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAC,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IACrD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,+BAA+B,CAAC,EAAC,CAAC,aAAa,EAAC,UAAU,EAAC,YAAY,EAAC,OAAO,KAAG,IAAI,CAAA;IACtF,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,WAAW,CAAC,EAAC,WAAW,CAAC;CAC5B;AA+BD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAwC7E;AA2ED,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAG1E,eAAO,MAAM,SAAS,g5BAiDnB,cAAc,4CA0yChB,CAAC;AAEF,UAAU,MAAM;IACZ,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAG,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACpK,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAC,UAAU,GAAG,QAAQ,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAC,OAAO,CAAC;IACvB,eAAe,CAAC,EAAC,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0BAA0B,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAElD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IACrD,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,+BAA+B,CAAC,EAAC,CAAC,aAAa,EAAC,UAAU,EAAC,UAAU,EAAC,OAAO,KAAG,IAAI,CAAA;IACpF,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,6BAA6B,CAAC,EAAE,CAAC,aAAa,EAAE,YAAY,EAAE,KAAG,IAAI,CAAC;IACtE,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B;AAED,eAAO,MAAM,oBAAoB,iyBAA4zB,MAAM,4CAmKl2B,CAAA;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableMenuConfig, TableMenuStyles } from "../../types/menuAction.type";
|
|
3
|
+
interface TableWithMenuProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
tableStyle?: React.CSSProperties;
|
|
6
|
+
menuConfig?: TableMenuConfig;
|
|
7
|
+
menuStyles?: TableMenuStyles;
|
|
8
|
+
blockId?: string;
|
|
9
|
+
storyId?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const TableWithMenu: ({ children, tableStyle, menuConfig, menuStyles, blockId, storyId, }: TableWithMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default TableWithMenu;
|
|
13
|
+
//# sourceMappingURL=TableWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/common/TableWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAEL,eAAe,EAEf,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAIrC,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,aAAa,wEAOhB,kBAAkB,4CAkIpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { AiReasonAccordionStyles, AiReasoningContentStyles, AppModCitationStyleG
|
|
|
3
3
|
import { UpdatedAnimatedContentIcons, UpdatedAnimatedContentStyles } from "../../shared/UpdatedAnimationContent";
|
|
4
4
|
import { IContextItemStyles } from "../UserStoryCard/AttachedContext";
|
|
5
5
|
import { IUserStory } from "../../interfaces/userstory.interface";
|
|
6
|
+
import { MenuActions, TableMenuStyles } from "../../types/menuAction.type";
|
|
6
7
|
export interface UserStoryWithCitationCustomStyles {
|
|
7
8
|
searchHighlight?: React.CSSProperties;
|
|
8
9
|
container?: React.CSSProperties;
|
|
@@ -88,6 +89,7 @@ export interface UserStoryWithCitationCustomStyles {
|
|
|
88
89
|
bigEnoughCitation?: BigEnoughCitationStyles;
|
|
89
90
|
segment?: SegmentStyles;
|
|
90
91
|
citationLink?: React.CSSProperties;
|
|
92
|
+
tableMenu?: TableMenuStyles;
|
|
91
93
|
}
|
|
92
94
|
interface UserStoryWithCitationsProps {
|
|
93
95
|
message: string;
|
|
@@ -124,11 +126,12 @@ interface UserStoryWithCitationsProps {
|
|
|
124
126
|
blockId?: string;
|
|
125
127
|
storyId?: string;
|
|
126
128
|
showWaitingIconInChip?: boolean;
|
|
129
|
+
menuActions?: MenuActions;
|
|
127
130
|
}
|
|
128
131
|
export declare function splitNestedDiffNodes(children: React.ReactNode, nestedTagNames: string[]): {
|
|
129
132
|
cleanedChildren: React.ReactNode;
|
|
130
133
|
extractedNodes: React.ReactNode[];
|
|
131
134
|
};
|
|
132
|
-
declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, contextVariant, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, onCitationLinkClick, craFlowConfig, isDisplayHighlightControl, showConfidenceScore, CDNeededInChip, blockId, storyId, showWaitingIconInChip, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
135
|
+
declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, contextVariant, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, onCitationLinkClick, craFlowConfig, isDisplayHighlightControl, showConfidenceScore, CDNeededInChip, blockId, storyId, showWaitingIconInChip, menuActions }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
133
136
|
export default UserStoryWithCitations;
|
|
134
137
|
//# sourceMappingURL=UserStoryWithCitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;AAW5G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC7Y,OAA+B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AASzI,OAAwB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;AAW5G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC7Y,OAA+B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AASzI,OAAwB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAclE,OAAO,EAAE,WAAW,EAAwB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAiBjG,MAAM,WAAW,iCAAiC;IAChD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACxC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAClC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,WAAW,CAAC,EAAE,kBAAkB,CAAA;KACjC,CAAC;IACF,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACvC,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,sBAAsB,CAAC,EAAE;QACvB,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAChC,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,aAAa,CAAC,EAAE;YACd,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;SACnC,CAAA;QACD,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;YAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,qBAAqB,CAAC,EAAE;YACtB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;YAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,MAAM,CAAC,EAAE;YACP,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAC;KACH,CAAA;IACD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,cAAc,CAAC,EAAE,4BAA4B,CAAC;IAC9C,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAClD,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC1C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,kBAAkB,CAAC,EAAG,wBAAwB,CAAC;IAC/C,oBAAoB,CAAC,EAAE,uBAAuB,CAAC;IAC/C,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;IAC3C,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACxC,oBAAoB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3C,wBAAwB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/C,uBAAuB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9C,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC1C,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC1C,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAC1C,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;IAC9C,wBAAwB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,mBAAmB,CAAC,EAAE;QACpB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KACjC,CAAC;IACF,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,UAAU,2BAA2B;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAC,KAAK,CAAC,SAAS,CAAC;IACnC,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;IACtC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,iCAAiC,CAAC;IACjD,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,cAAc,CAAC,EAAC,UAAU,GAAG,QAAQ,CAAC;IACtC,mBAAmB,CAAC,EAAC,OAAO,CAAC;IAI7B,mBAAmB,CAAC,EAAE,YAAY,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,GAAG,CAAC;IAKzB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC,aAAa,CAAC,EAAE;QACd,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,UAAU,EAAE,CAAC;QAC3B,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACpE,wBAAwB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;QAC5F,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAC,MAAM,CAAA;IACf,OAAO,CAAC,EAAC,MAAM,CAAA;IACf,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAE/B,WAAW,CAAC,EAAC,WAAW,CAAC;CAE1B;AAgfD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,cAAc,EAAE,MAAM,EAAE;;;EAoEzB;AAED,QAAA,MAAM,sBAAsB,wdAqCzB,2BAA2B,4CA+zB7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface TableMenuData {
|
|
3
|
+
html: string;
|
|
4
|
+
storyId: string;
|
|
5
|
+
blockId: string;
|
|
6
|
+
occurrence: number;
|
|
7
|
+
element: HTMLTableElement;
|
|
8
|
+
}
|
|
9
|
+
export interface TableMenuActionProps {
|
|
10
|
+
getTableData?: () => TableMenuData | null;
|
|
11
|
+
closeMenu?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export interface TableMenuConfig {
|
|
14
|
+
elements?: React.ReactElement<TableMenuActionProps>[];
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface MenuActions {
|
|
18
|
+
table?: TableMenuConfig;
|
|
19
|
+
}
|
|
20
|
+
export interface TableMenuStyles {
|
|
21
|
+
wrapper?: React.CSSProperties;
|
|
22
|
+
button?: React.CSSProperties;
|
|
23
|
+
buttonActive?: React.CSSProperties;
|
|
24
|
+
icon?: {
|
|
25
|
+
size?: number;
|
|
26
|
+
color?: string;
|
|
27
|
+
};
|
|
28
|
+
menuPaper?: React.CSSProperties;
|
|
29
|
+
menuItem?: React.CSSProperties;
|
|
30
|
+
headerReservedSpace?: number;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=menuAction.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuAction.type.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/types/menuAction.type.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAC,MAAM,CAAC;IACZ,OAAO,EAAC,MAAM,CAAC;IACf,OAAO,EAAC,MAAM,CAAC;IACf,UAAU,EAAC,MAAM,CAAC;IAClB,OAAO,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC;IACtD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -3,4 +3,7 @@ export declare function transformToArrayOfArrays(data: Record<string, any>[]): a
|
|
|
3
3
|
export declare function mapColumnsToValues(columns: string[], valuesArray: string[][]): {
|
|
4
4
|
[k: string]: string;
|
|
5
5
|
}[];
|
|
6
|
+
export declare const TABLE_MARKER = "data-menu-table";
|
|
7
|
+
export declare const BLOCK_SELECTOR = "[data-block-id^=\"user-story-card-wrapper-\"]";
|
|
8
|
+
export declare const serializeTable: (el: HTMLElement) => string;
|
|
6
9
|
//# sourceMappingURL=helperFunctions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helperFunctions.d.ts","sourceRoot":"","sources":["../../../../src/utils/helperFunctions.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,cAAe,MAAM,WAqBjD,CAAA;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,CAO7E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,CASxG"}
|
|
1
|
+
{"version":3,"file":"helperFunctions.d.ts","sourceRoot":"","sources":["../../../../src/utils/helperFunctions.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,cAAe,MAAM,WAqBjD,CAAA;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,CAO7E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,CASxG;AACD,eAAO,MAAM,YAAY,oBAAoB,CAAC;AAC9C,eAAO,MAAM,cAAc,kDAAgD,CAAC;AAE5E,eAAO,MAAM,cAAc,OAAQ,WAAW,WAI7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helperFunctions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|