@e-llm-studio/requirement-ai 0.0.311 → 0.0.312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react"),l=require("../../utils/user-story.utils.js"),n=require("../userstory-with-citation/UserStoryWithCitation.js"),o=require("./PartialRequirementContent.module.css.js"),r=require("@mui/material"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),s=require("../RichTextEditor/RichTextEditor.js");const d=({loadingPartialRequirements:d,localUserStory:u,setLocalUserStory:v,onCraFlowDiffAgentAction:c,disableEditing:m,isCraflow:y=!0,onCraAccept:p,onCraReject:C,CDNeededInChip:f})=>{var S,q,h,j,x,R,P,g,w,B,N,b,A,E,D,k,U,T;const[I,W]=t.useState(!1),[F,M]=t.useState(""),{customStyles:z,segmentComponentConfig:L}=a.useRequirementAI();t.useEffect(()=>{m&&W(!1)},[m]),t.useEffect(()=>{var e;M(null===(e=null==u?void 0:u[0])||void 0===e?void 0:e.value)},[u]);if(d)return e.jsx("div",{className:o.default.skeletonWrapper,style:null===(S=null==z?void 0:z.PartialRequirementContentStyles)||void 0===S?void 0:S.skeletonWrapper,children:[1,2,3,4,5].map(t=>{var i;return e.jsx("div",{className:o.default.skeletonLine,style:null===(i=null==z?void 0:z.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},t)})});const _=!F||""===F.trim();return e.jsxs("div",{className:o.default.wrapper,style:null===(q=null==z?void 0:z.PartialRequirementContentStyles)||void 0===q?void 0:q.wrapper,children:[e.jsx("div",{className:o.default.actionBar,style:null===(h=null==z?void 0:z.PartialRequirementContentStyles)||void 0===h?void 0:h.actionBar,children:I?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:o.default.editingBadge,style:null===(P=null==z?void 0:z.PartialRequirementContentStyles)||void 0===P?void 0:P.editingBadge,children:[e.jsx("span",{className:o.default.editingDot,style:null===(g=null==z?void 0:z.PartialRequirementContentStyles)||void 0===g?void 0:g.editingDot}),"Editing"]}),e.jsx("div",{className:o.default.btnDivider,style:null===(w=null==z?void 0:z.PartialRequirementContentStyles)||void 0===w?void 0:w.btnDivider}),e.jsx(r.Tooltip,{title:_?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:{...null===(B=null==z?void 0:z.PartialRequirementContentStyles)||void 0===B?void 0:B.headerTooltip}}},children:e.jsx("span",{children:e.jsx("button",{className:o.default.saveBtn,style:{...null===(N=null==z?void 0:z.PartialRequirementContentStyles)||void 0===N?void 0:N.actionBtn,...null===(b=null==z?void 0:z.PartialRequirementContentStyles)||void 0===b?void 0:b.saveBtn,opacity:_?.5:1,cursor:_?"not-allowed":"pointer"},onClick:()=>{_||(v(e=>{const t={...e[0],value:l.postprocessUserStoryAfterEdit(F)};return null==c||c("accept",[t]),[t]}),W(!1))},disabled:_,children:e.jsx(i.Save,{size:16})})})}),e.jsx("button",{className:o.default.cancelBtn,style:{...null===(A=null==z?void 0:z.PartialRequirementContentStyles)||void 0===A?void 0:A.actionBtn,...null===(E=null==z?void 0:z.PartialRequirementContentStyles)||void 0===E?void 0:E.cancelBtn},onClick:()=>{var e;M(null===(e=null==u?void 0:u[0])||void 0===e?void 0:e.value),W(!1)},title:"Discard changes","aria-label":"Discard changes",children:e.jsx(i.X,{size:16})})]}):e.jsx(r.Tooltip,{title:m?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:{...null===(j=null==z?void 0:z.PartialRequirementContentStyles)||void 0===j?void 0:j.headerTooltip}}},children:e.jsx("span",{children:e.jsx("button",{className:o.default.editBtn,style:{...null===(x=null==z?void 0:z.PartialRequirementContentStyles)||void 0===x?void 0:x.actionBtn,...null===(R=null==z?void 0:z.PartialRequirementContentStyles)||void 0===R?void 0:R.editBtn,opacity:m?.5:1,cursor:m?"not-allowed":"pointer"},onClick:()=>{m||W(!0)},disabled:m,"aria-label":"Edit requirement",children:e.jsx(i.Pencil,{size:16})})})})}),I?e.jsx("div",{className:o.default.editorContainer,style:null===(D=null==z?void 0:z.PartialRequirementContentStyles)||void 0===D?void 0:D.editorContainer,children:e.jsx(s.default,{minHeight:"100%",height:"100%",type:"string",value:l.preprocessUserStoryForEdit(l.formatMarkdown((null===(k=null==u?void 0:u[0])||void 0===k?void 0:k.value)||"")||""),handleUpdateState:(e,t)=>{M(t)},doNotShowBorderInViewMode:!1,mode:"edit"})}):e.jsx("div",{className:o.default.viewContainer,style:null===(U=null==z?void 0:z.PartialRequirementContentStyles)||void 0===U?void 0:U.viewContainer,children:e.jsx(n.default,{message:l.formatMarkdown((null===(T=null==u?void 0:u[0])||void 0===T?void 0:T.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:u,setCraUserStory:v,onCraFlowDiffAgentAction:c,displayActionButtons:!I},isCraflow:y,onCraAccept:p,onCraReject:C,customStyles:null==z?void 0:z.UserStoryWithCitationCustomStyles,CDNeededInChip:f})})]})};exports.PartialRequirementContent=d,exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react"),l=require("../../utils/user-story.utils.js"),n=require("../userstory-with-citation/UserStoryWithCitation.js"),o=require("./PartialRequirementContent.module.css.js"),r=require("@mui/material"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),s=require("../RichTextEditor/RichTextEditor.js");const d=({loadingPartialRequirements:d,localUserStory:u,setLocalUserStory:v,onCraFlowDiffAgentAction:c,disableEditing:m,isCraflow:C=!0,onCraAccept:y,onCraReject:p,CDNeededInChip:f,onCitationLinkClick:S})=>{var q,h,j,x,R,P,g,w,B,N,b,k,A,E,D,U,T,I;const[W,F]=t.useState(!1),[L,M]=t.useState(""),{customStyles:z,segmentComponentConfig:_}=a.useRequirementAI();t.useEffect(()=>{m&&F(!1)},[m]),t.useEffect(()=>{var e;M(null===(e=null==u?void 0:u[0])||void 0===e?void 0:e.value)},[u]);if(d)return e.jsx("div",{className:o.default.skeletonWrapper,style:null===(q=null==z?void 0:z.PartialRequirementContentStyles)||void 0===q?void 0:q.skeletonWrapper,children:[1,2,3,4,5].map(t=>{var i;return e.jsx("div",{className:o.default.skeletonLine,style:null===(i=null==z?void 0:z.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},t)})});const H=!L||""===L.trim();return e.jsxs("div",{className:o.default.wrapper,style:null===(h=null==z?void 0:z.PartialRequirementContentStyles)||void 0===h?void 0:h.wrapper,children:[e.jsx("div",{className:o.default.actionBar,style:null===(j=null==z?void 0:z.PartialRequirementContentStyles)||void 0===j?void 0:j.actionBar,children:W?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:o.default.editingBadge,style:null===(g=null==z?void 0:z.PartialRequirementContentStyles)||void 0===g?void 0:g.editingBadge,children:[e.jsx("span",{className:o.default.editingDot,style:null===(w=null==z?void 0:z.PartialRequirementContentStyles)||void 0===w?void 0:w.editingDot}),"Editing"]}),e.jsx("div",{className:o.default.btnDivider,style:null===(B=null==z?void 0:z.PartialRequirementContentStyles)||void 0===B?void 0:B.btnDivider}),e.jsx(r.Tooltip,{title:H?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:{...null===(N=null==z?void 0:z.PartialRequirementContentStyles)||void 0===N?void 0:N.headerTooltip}}},children:e.jsx("span",{children:e.jsx("button",{className:o.default.saveBtn,style:{...null===(b=null==z?void 0:z.PartialRequirementContentStyles)||void 0===b?void 0:b.actionBtn,...null===(k=null==z?void 0:z.PartialRequirementContentStyles)||void 0===k?void 0:k.saveBtn,opacity:H?.5:1,cursor:H?"not-allowed":"pointer"},onClick:()=>{H||(v(e=>{const t={...e[0],value:l.postprocessUserStoryAfterEdit(L)};return null==c||c("accept",[t]),[t]}),F(!1))},disabled:H,children:e.jsx(i.Save,{size:16})})})}),e.jsx("button",{className:o.default.cancelBtn,style:{...null===(A=null==z?void 0:z.PartialRequirementContentStyles)||void 0===A?void 0:A.actionBtn,...null===(E=null==z?void 0:z.PartialRequirementContentStyles)||void 0===E?void 0:E.cancelBtn},onClick:()=>{var e;M(null===(e=null==u?void 0:u[0])||void 0===e?void 0:e.value),F(!1)},title:"Discard changes","aria-label":"Discard changes",children:e.jsx(i.X,{size:16})})]}):e.jsx(r.Tooltip,{title:m?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:{...null===(x=null==z?void 0:z.PartialRequirementContentStyles)||void 0===x?void 0:x.headerTooltip}}},children:e.jsx("span",{children:e.jsx("button",{className:o.default.editBtn,style:{...null===(R=null==z?void 0:z.PartialRequirementContentStyles)||void 0===R?void 0:R.actionBtn,...null===(P=null==z?void 0:z.PartialRequirementContentStyles)||void 0===P?void 0:P.editBtn,opacity:m?.5:1,cursor:m?"not-allowed":"pointer"},onClick:()=>{m||F(!0)},disabled:m,"aria-label":"Edit requirement",children:e.jsx(i.Pencil,{size:16})})})})}),W?e.jsx("div",{className:o.default.editorContainer,style:null===(D=null==z?void 0:z.PartialRequirementContentStyles)||void 0===D?void 0:D.editorContainer,children:e.jsx(s.default,{minHeight:"100%",height:"100%",type:"string",value:l.preprocessUserStoryForEdit(l.formatMarkdown((null===(U=null==u?void 0:u[0])||void 0===U?void 0:U.value)||"")||""),handleUpdateState:(e,t)=>{M(t)},doNotShowBorderInViewMode:!1,mode:"edit"})}):e.jsx("div",{className:o.default.viewContainer,style:null===(T=null==z?void 0:z.PartialRequirementContentStyles)||void 0===T?void 0:T.viewContainer,children:e.jsx(n.default,{message:l.formatMarkdown((null===(I=null==u?void 0:u[0])||void 0===I?void 0:I.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:u,setCraUserStory:v,onCraFlowDiffAgentAction:c,displayActionButtons:!W},isCraflow:C,onCraAccept:y,onCraReject:p,customStyles:null==z?void 0:z.UserStoryWithCitationCustomStyles,CDNeededInChip:f,onCitationLinkClick:S})})]})};exports.PartialRequirementContent=d,exports.default=d;
2
2
  //# sourceMappingURL=PartialRequirementContent.js.map
@@ -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"),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"),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(a);const q=n.createContext(!1),E=n.createContext({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),L=n.createContext({rowId:""}),M=({aiReason:t,isHighConfidence:i,customStyle:o,customIcons:r})=>{var d;const{expandedInfo:a,setExpanded:s,reasonToRow:c}=n.useContext(E),{rowId:u}=n.useContext(L),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}`})]})},T=({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(L.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 _=["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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</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 d=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 d&&0!==d.length?$.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:R,isCitationLoadingDisplay:L=!1,className:_,highConfidenceIcon:U,lowConfidenceIcon:O,customStyles:W,customIcons:B,contextVariant:z,aiReasoningDiffView:Q,userStoryCitations:J,artifactId:K,isCraflow:X,onCraAccept:Y,onCraReject:Z,craFlowConfig:ee,isDisplayHighlightControl:ne=!1,showConfidenceScore:te=!0,CDNeededInChip:ie,blockId:le,storyId:oe,showWaitingIconInChip:re})=>{var de;console.log("userstorywithcitation blockid ",le);const ae=n.useRef(null),{userStory:se,inlineUpdateComponentConfig:ce,getAvgScoreForStory:ue,setUserStory:ge,aiReasoning:he,setAiReasoning:pe,customIcons:ve,searchQueryList:me,searchQueryReasoningIdList:fe,currentHighlightIndex:Ce,segmentComponentConfig:xe,inlineManualComponentConfig:je,diffEditConfig:ye,customSectionConfig:Se}=g.useRequirementAI(),Ie=null!=B?B:null==ve?void 0:ve.userStoryIcons;null==W||W.searchHighlight;const{search:be,clear:we}=o.useMarkdownSearch(ae),[Re,$e]=n.useState("1"),[Ne,ke]=n.useState(null),Ae=n.useRef(new Map),[qe,Ee]=n.useState(new Set),Le=n.useCallback((e,n)=>{ke(e&&n?{rowId:e,aiReason:n}:null)},[]),Me=K?ue(K):0,[Te,_e]=n.useState([]),Ue=n.useCallback(e=>{Ee(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},[]),He=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(He).join(""):$.default.isValidElement(e)?He(e.props.children):"",Pe=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),d=[];for(e+=2;e<n.length&&D(n[e])&&!F(n[e]);)d.push(P(n[e])),e++;e--,t.push(V(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=H(n),n},De=n.useMemo(()=>t?Pe(t):t,[t]);n.useEffect(()=>{_e(R||he)},[R,he]);const Fe=n.useMemo(()=>{const t=Boolean(null==Se?void 0:Se.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,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&&qe.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==W?void 0:W.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:Ue,icon:"web"===g?null==Ie?void 0:Ie.webCitationIcon:"doc"===g?null==Ie?void 0:Ie.fileCitationIcon:e.jsx(e.Fragment,{}),customStyles:"web"===g?null==W?void 0:W.webButton:"doc"===g?null==W?void 0:W.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=he.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(j.default,{aiReason:a,customStyles:null==W?void 0:W.inlineUpdatedComponent,handleClickCognitiveDecision:null==ce?void 0:ce.handleClickCognitiveDecision,handleClickUpdatedPill:null==ce?void 0:ce.handleClickUpdatedPill,handleClickOutputValue:null==ce?void 0:ce.handleClickOutputValue,customIcons:null==ce?void 0:ce.customIcons,CDNeededInChip:ie,showWaitingIconInChip:re,showChip:s,status:c,containerRef:ae,children:t||e.jsx(e.Fragment,{})})})},del:({node:n,children:t,...i})=>{var o;const{cleanedChildren:r,extractedNodes:d}=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}),d]})},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=he.find(e=>e.id.toString()===l),r=t["data-status"];return o?e.jsx(I.default,{aiReason:o,handleClick:null==je?void 0:je.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:Re,setCurrentUpdatedTagId:$e,userStory:se,setUserStory:ge,setAiReasoning:pe,node:n,isCraflow:X,onCraAccept:Y,onCraReject:Z,diffEditConfig:ye,customStyles:null==W?void 0:W.updatedContent,craFlowConfig:ee}),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==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:l,...o})=>{var r;const d=n.useContext(q)||"true"===(null==o?void 0:o.table),a=`${null==o?void 0:o.href}`,[s,c]=a.split("$"),u=null==c?void 0:c.split("?")[0];if("ai_reasoning"===s){const n=(null!==(r=x?Q:he)&&void 0!==r?r:[]).find(e=>e.id.toString()===decodeURIComponent(u)),t=fe.includes(u);if(n){if(d)return e.jsx(M,{aiReason:n,customStyle:null==W?void 0:W.tableAiReasoning,customIcons:Ie,isHighConfidence:n.relevance_score>=v.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});const l=He(i),o="source"!==l.trim().toLowerCase();return e.jsx(v.default,{aiReason:n,isSourceHasHighlight:t,inlineLabel:l,isInlineCitation:o,customIcons:Ie,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 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(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==W?void 0:W.generatedCodePill,content:null==W?void 0:W.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:A.default.sanitize(s)}}):e.jsx("div",{children:t});return e.jsx(y.default,{id:a,node:n,children:c,props:i,segmentComponentConfig:xe,customStyles:W,customIcons:B,extractText:He,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(y.default,{id:a,node:n,children:t,props:i,segmentComponentConfig:xe,customStyles:W,customIcons:B,extractText:He,blockId:le,storyId:oe})}}},[Te,ee,he,J,Re,x,t,B,me,fe,W,xe,qe,Ue,le,oe,null==Se?void 0:Se.negateList]),Oe=n.useMemo(()=>{let e=w.escapeTagIds(De,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=w.splitTagAcrossParagraphs(e,n,"upt"===n)}),e},[De]);return n.useEffect(()=>{if(!ae.current)return;if(!me.length)return void we();const e=ae.current,n=Math.min(Ce,me.length-1);let t;const i=()=>{requestAnimationFrame(()=>{be([me[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)}},[me,fe,Ce,ne]),e.jsx(E.Provider,{value:{expandedInfo:Ne,setExpanded:Le,reasonToRow:Ae},children:e.jsxs("div",{ref:ae,className:`${l.default.container} ${"approving"!==p?l.default.wrapper:""} ${_||""}`,style:null==W?void 0:W.container,children:[a?e.jsx(S.MarkdownContextProvider,{children:e.jsx(N.default,{components:Fe,rehypePlugins:[k.default],children:Oe})}):i,Me>0&&te&&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"}),Me,"%"]})}),L&&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}})}),h&&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"),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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</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;
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}[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",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}'));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"};
2
2
  //# sourceMappingURL=UserStoryWithCitation.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useState as l,useEffect as n}from"react";import{Pencil as o,Save as r,X as a}from"lucide-react";import{preprocessUserStoryForEdit as d,formatMarkdown as s,postprocessUserStoryAfterEdit as u}from"../../utils/user-story.utils.js";import v from"../userstory-with-citation/UserStoryWithCitation.js";import c from"./PartialRequirementContent.module.css.js";import{Tooltip as m}from"@mui/material";import{useRequirementAI as p}from"../RequirementAIWrapper/RequirementAIWrapper.js";import y from"../RichTextEditor/RichTextEditor.js";const C=({loadingPartialRequirements:C,localUserStory:h,setLocalUserStory:S,onCraFlowDiffAgentAction:R,disableEditing:g,isCraflow:q=!0,onCraAccept:f,onCraReject:P,CDNeededInChip:w})=>{var B,N,b,D,A,j,k,E,U,x,W,I,T,z,F,L,H,M;const[V,G]=l(!1),[J,K]=l(""),{customStyles:O,segmentComponentConfig:Q}=p();n(()=>{g&&G(!1)},[g]),n(()=>{var e;K(null===(e=null==h?void 0:h[0])||void 0===e?void 0:e.value)},[h]);if(C)return e("div",{className:c.skeletonWrapper,style:null===(B=null==O?void 0:O.PartialRequirementContentStyles)||void 0===B?void 0:B.skeletonWrapper,children:[1,2,3,4,5].map(t=>{var i;return e("div",{className:c.skeletonLine,style:null===(i=null==O?void 0:O.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},t)})});const X=!J||""===J.trim();return t("div",{className:c.wrapper,style:null===(N=null==O?void 0:O.PartialRequirementContentStyles)||void 0===N?void 0:N.wrapper,children:[e("div",{className:c.actionBar,style:null===(b=null==O?void 0:O.PartialRequirementContentStyles)||void 0===b?void 0:b.actionBar,children:V?t(i,{children:[t("span",{className:c.editingBadge,style:null===(k=null==O?void 0:O.PartialRequirementContentStyles)||void 0===k?void 0:k.editingBadge,children:[e("span",{className:c.editingDot,style:null===(E=null==O?void 0:O.PartialRequirementContentStyles)||void 0===E?void 0:E.editingDot}),"Editing"]}),e("div",{className:c.btnDivider,style:null===(U=null==O?void 0:O.PartialRequirementContentStyles)||void 0===U?void 0:U.btnDivider}),e(m,{title:X?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:{...null===(x=null==O?void 0:O.PartialRequirementContentStyles)||void 0===x?void 0:x.headerTooltip}}},children:e("span",{children:e("button",{className:c.saveBtn,style:{...null===(W=null==O?void 0:O.PartialRequirementContentStyles)||void 0===W?void 0:W.actionBtn,...null===(I=null==O?void 0:O.PartialRequirementContentStyles)||void 0===I?void 0:I.saveBtn,opacity:X?.5:1,cursor:X?"not-allowed":"pointer"},onClick:()=>{X||(S(e=>{const t={...e[0],value:u(J)};return null==R||R("accept",[t]),[t]}),G(!1))},disabled:X,children:e(r,{size:16})})})}),e("button",{className:c.cancelBtn,style:{...null===(T=null==O?void 0:O.PartialRequirementContentStyles)||void 0===T?void 0:T.actionBtn,...null===(z=null==O?void 0:O.PartialRequirementContentStyles)||void 0===z?void 0:z.cancelBtn},onClick:()=>{var e;K(null===(e=null==h?void 0:h[0])||void 0===e?void 0:e.value),G(!1)},title:"Discard changes","aria-label":"Discard changes",children:e(a,{size:16})})]}):e(m,{title:g?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:{...null===(D=null==O?void 0:O.PartialRequirementContentStyles)||void 0===D?void 0:D.headerTooltip}}},children:e("span",{children:e("button",{className:c.editBtn,style:{...null===(A=null==O?void 0:O.PartialRequirementContentStyles)||void 0===A?void 0:A.actionBtn,...null===(j=null==O?void 0:O.PartialRequirementContentStyles)||void 0===j?void 0:j.editBtn,opacity:g?.5:1,cursor:g?"not-allowed":"pointer"},onClick:()=>{g||G(!0)},disabled:g,"aria-label":"Edit requirement",children:e(o,{size:16})})})})}),e("div",V?{className:c.editorContainer,style:null===(F=null==O?void 0:O.PartialRequirementContentStyles)||void 0===F?void 0:F.editorContainer,children:e(y,{minHeight:"100%",height:"100%",type:"string",value:d(s((null===(L=null==h?void 0:h[0])||void 0===L?void 0:L.value)||"")||""),handleUpdateState:(e,t)=>{K(t)},doNotShowBorderInViewMode:!1,mode:"edit"})}:{className:c.viewContainer,style:null===(H=null==O?void 0:O.PartialRequirementContentStyles)||void 0===H?void 0:H.viewContainer,children:e(v,{message:s((null===(M=null==h?void 0:h[0])||void 0===M?void 0:M.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:h,setCraUserStory:S,onCraFlowDiffAgentAction:R,displayActionButtons:!V},isCraflow:q,onCraAccept:f,onCraReject:P,customStyles:null==O?void 0:O.UserStoryWithCitationCustomStyles,CDNeededInChip:w})})]})};export{C as PartialRequirementContent,C as default};
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useState as l,useEffect as n}from"react";import{Pencil as o,Save as r,X as a}from"lucide-react";import{preprocessUserStoryForEdit as d,formatMarkdown as s,postprocessUserStoryAfterEdit as u}from"../../utils/user-story.utils.js";import v from"../userstory-with-citation/UserStoryWithCitation.js";import c from"./PartialRequirementContent.module.css.js";import{Tooltip as m}from"@mui/material";import{useRequirementAI as C}from"../RequirementAIWrapper/RequirementAIWrapper.js";import p from"../RichTextEditor/RichTextEditor.js";const y=({loadingPartialRequirements:y,localUserStory:h,setLocalUserStory:S,onCraFlowDiffAgentAction:R,disableEditing:g,isCraflow:q=!0,onCraAccept:f,onCraReject:P,CDNeededInChip:w,onCitationLinkClick:B})=>{var N,b,k,D,A,j,E,U,x,W,I,L,T,z,F,H,M,V;const[G,J]=l(!1),[K,O]=l(""),{customStyles:Q,segmentComponentConfig:X}=C();n(()=>{g&&J(!1)},[g]),n(()=>{var e;O(null===(e=null==h?void 0:h[0])||void 0===e?void 0:e.value)},[h]);if(y)return e("div",{className:c.skeletonWrapper,style:null===(N=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===N?void 0:N.skeletonWrapper,children:[1,2,3,4,5].map(t=>{var i;return e("div",{className:c.skeletonLine,style:null===(i=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},t)})});const Y=!K||""===K.trim();return t("div",{className:c.wrapper,style:null===(b=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===b?void 0:b.wrapper,children:[e("div",{className:c.actionBar,style:null===(k=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===k?void 0:k.actionBar,children:G?t(i,{children:[t("span",{className:c.editingBadge,style:null===(E=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===E?void 0:E.editingBadge,children:[e("span",{className:c.editingDot,style:null===(U=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===U?void 0:U.editingDot}),"Editing"]}),e("div",{className:c.btnDivider,style:null===(x=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===x?void 0:x.btnDivider}),e(m,{title:Y?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:{...null===(W=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===W?void 0:W.headerTooltip}}},children:e("span",{children:e("button",{className:c.saveBtn,style:{...null===(I=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===I?void 0:I.actionBtn,...null===(L=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===L?void 0:L.saveBtn,opacity:Y?.5:1,cursor:Y?"not-allowed":"pointer"},onClick:()=>{Y||(S(e=>{const t={...e[0],value:u(K)};return null==R||R("accept",[t]),[t]}),J(!1))},disabled:Y,children:e(r,{size:16})})})}),e("button",{className:c.cancelBtn,style:{...null===(T=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===T?void 0:T.actionBtn,...null===(z=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===z?void 0:z.cancelBtn},onClick:()=>{var e;O(null===(e=null==h?void 0:h[0])||void 0===e?void 0:e.value),J(!1)},title:"Discard changes","aria-label":"Discard changes",children:e(a,{size:16})})]}):e(m,{title:g?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:{...null===(D=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===D?void 0:D.headerTooltip}}},children:e("span",{children:e("button",{className:c.editBtn,style:{...null===(A=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===A?void 0:A.actionBtn,...null===(j=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===j?void 0:j.editBtn,opacity:g?.5:1,cursor:g?"not-allowed":"pointer"},onClick:()=>{g||J(!0)},disabled:g,"aria-label":"Edit requirement",children:e(o,{size:16})})})})}),e("div",G?{className:c.editorContainer,style:null===(F=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===F?void 0:F.editorContainer,children:e(p,{minHeight:"100%",height:"100%",type:"string",value:d(s((null===(H=null==h?void 0:h[0])||void 0===H?void 0:H.value)||"")||""),handleUpdateState:(e,t)=>{O(t)},doNotShowBorderInViewMode:!1,mode:"edit"})}:{className:c.viewContainer,style:null===(M=null==Q?void 0:Q.PartialRequirementContentStyles)||void 0===M?void 0:M.viewContainer,children:e(v,{message:s((null===(V=null==h?void 0:h[0])||void 0===V?void 0:V.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:h,setCraUserStory:S,onCraFlowDiffAgentAction:R,displayActionButtons:!G},isCraflow:q,onCraAccept:f,onCraReject:P,customStyles:null==Q?void 0:Q.UserStoryWithCitationCustomStyles,CDNeededInChip:w,onCitationLinkClick:B})})]})};export{y as PartialRequirementContent,y as default};
2
2
  //# sourceMappingURL=PartialRequirementContent.js.map
@@ -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 x from"../../icons/RelevanceScoreIcon.js";import k 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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</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,craFlowConfig:ce,isDisplayHighlightControl:ue=!1,showConfidenceScore:he=!0,CDNeededInChip:pe,blockId:ge,storyId:me,showWaitingIconInChip:ve})=>{var Ce;console.log("userstorywithcitation blockid ",ge);const fe=l(null),{userStory:ye,inlineUpdateComponentConfig:we,getAvgScoreForStory:be,setUserStory:Ie,aiReasoning:Se,setAiReasoning:$e,customIcons:Re,searchQueryList:Ne,searchQueryReasoningIdList:xe,currentHighlightIndex:ke,segmentComponentConfig:Ae,inlineManualComponentConfig:je,diffEditConfig:Le,customSectionConfig:Ee}=I(),Ue=null!=ie?ie:null==Re?void 0:Re.userStoryIcons;null==ne||ne.searchHighlight;const{search:Me,clear:Te}=g(fe),[Pe,De]=r("1"),[_e,He]=r(null),We=l(new Map),[Be,Fe]=r(new Set),Oe=d((e,n)=>{He(e&&n?{rowId:e,aiReason:n}:null)},[]),Ve=re?be(re):0,[qe,ze]=r([]),Ge=d(e=>{Fe(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Qe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Qe).join(""):t.isValidElement(e)?Qe(e.props.children):"",Je=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},Ke=a(()=>o?Je(o):o,[o]);s(()=>{ze(V||Se)},[V,Se]);const Xe=a(()=>{const o=Boolean(null==Ee?void 0:Ee.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&&Be.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:Ge,icon:"web"===p?null==Ue?void 0:Ue.webCitationIcon:"doc"===p?null==Ue?void 0:Ue.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=Se.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==we?void 0:we.handleClickCognitiveDecision,handleClickUpdatedPill:null==we?void 0:we.handleClickUpdatedPill,handleClickOutputValue:null==we?void 0:we.handleClickOutputValue,customIcons:null==we?void 0:we.customIcons,CDNeededInChip:pe,showWaitingIconInChip:ve,showChip:c,status:u,containerRef:fe,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=Se.find(e=>e.id.toString()===l),d=t["data-status"];return r?e(M,{aiReason:r,handleClick:null==je?void 0:je.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:Pe,setCurrentUpdatedTagId:De,userStory:ye,setUserStory:Ie,setAiReasoning:$e,node:n,isCraflow:de,onCraAccept:ae,onCraReject:se,diffEditConfig:Le,customStyles:null==ne?void 0:ne.updatedContent,craFlowConfig:ce}),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(k,{...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:Se)&&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:Ue,isHighConfidence:n.relevance_score>=N});const o=Qe(i),l="source"!==o.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:t,inlineLabel:o,isInlineCitation:l,customIcons:Ue,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 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:Ae,customStyles:ne,customIcons:ie,extractText:Qe,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:Ae,customStyles:ne,customIcons:ie,extractText:Qe,blockId:ge,storyId:me})}}},[qe,ce,Se,le,Pe,O,o,ie,Ne,xe,ne,Ae,Be,Ge,ge,me,null==Ee?void 0:Ee.negateList]),Ye=a(()=>{let e=P(Ke,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=D(e,n,"upt"===n)}),e},[Ke]);return s(()=>{if(!fe.current)return;if(!Ne.length)return void Te();const e=fe.current,n=Math.min(ke,Ne.length-1);let i;const t=()=>{requestAnimationFrame(()=>{Me([Ne[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)}},[Ne,xe,ke,ue]),e(H.Provider,{value:{expandedInfo:_e,setExpanded:Oe,reasonToRow:We},children:i("div",{ref:fe,className:`${p.container} ${"approving"!==W?p.wrapper:""} ${K||""}`,style:null==ne?void 0:ne.container,children:[$?e(U,{children:e(u,{components:Xe,rehypePlugins:[h],children:Ye})}):S,Ve>0&&he&&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(x,{size:14,color:(null==ne?void 0:ne.confidenceScoreIconColor)||"#166534"}),Ve,"%"]})}),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===(Ce=null==ne?void 0:ne.attachedContext)||void 0===Ce?void 0:Ce.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 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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</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};
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",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}[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"};!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};
2
2
  //# sourceMappingURL=UserStoryWithCitation.module.css.js.map
@@ -10,6 +10,7 @@ export type PartialRequirementContentProps = {
10
10
  isCraflow?: boolean;
11
11
  onCraAccept?: (updatedId: string) => void;
12
12
  onCraReject?: (updatedId: string) => void;
13
+ onCitationLinkClick?: (href: string) => void;
13
14
  userStoryStyles?: UserStoryWithCitationCustomStyles;
14
15
  CDNeededInChip?: boolean;
15
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PartialRequirementContent.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/cra/PartialRequirementContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAG7E,OAA+B,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AAG7H,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAIlE,MAAM,MAAM,8BAA8B,GAAG;IACzC,0BAA0B,EAAE,OAAO,CAAC;IACpC,cAAc,EAAE,UAAU,EAAE,CAAC;IAC7B,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1D,wBAAwB,CAAC,EAAE,CACvB,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAC3B,WAAW,EAAE,UAAU,EAAE,KACxB,IAAI,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,eAAe,CAAC,EAAE,iCAAiC,CAAC;IACpD,cAAc,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAC5C,8BAA8B,CA0M7B,CAAC;AAEN,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"PartialRequirementContent.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/cra/PartialRequirementContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAG7E,OAA+B,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AAG7H,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAIlE,MAAM,MAAM,8BAA8B,GAAG;IACzC,0BAA0B,EAAE,OAAO,CAAC;IACpC,cAAc,EAAE,UAAU,EAAE,CAAC;IAC7B,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1D,wBAAwB,CAAC,EAAE,CACvB,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAC3B,WAAW,EAAE,UAAU,EAAE,KACxB,IAAI,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,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;IAC7C,eAAe,CAAC,EAAE,iCAAiC,CAAC;IACpD,cAAc,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAC5C,8BAA8B,CA4M7B,CAAC;AAEN,eAAe,yBAAyB,CAAC"}
@@ -87,6 +87,7 @@ export interface UserStoryWithCitationCustomStyles {
87
87
  };
88
88
  bigEnoughCitation?: BigEnoughCitationStyles;
89
89
  segment?: SegmentStyles;
90
+ citationLink?: React.CSSProperties;
90
91
  }
91
92
  interface UserStoryWithCitationsProps {
92
93
  message: string;
@@ -110,6 +111,7 @@ interface UserStoryWithCitationsProps {
110
111
  isCraflow?: boolean;
111
112
  onCraAccept?: (updatedId: string) => void;
112
113
  onCraReject?: (updatedId: string) => void;
114
+ onCitationLinkClick?: (href: string) => void;
113
115
  isDisplayHighlightControl?: boolean;
114
116
  craFlowConfig?: {
115
117
  isCraflow: boolean;
@@ -127,6 +129,6 @@ export declare function splitNestedDiffNodes(children: React.ReactNode, nestedTa
127
129
  cleanedChildren: React.ReactNode;
128
130
  extractedNodes: React.ReactNode[];
129
131
  };
130
- declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, contextVariant, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, showConfidenceScore, CDNeededInChip, blockId, storyId, showWaitingIconInChip, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
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;
131
133
  export default UserStoryWithCitations;
132
134
  //# 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":"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"}
1
+ {"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.311",
3
+ "version": "0.0.312",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",