@e-llm-studio/requirement-ai 0.0.215 → 0.0.216

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),l=require("./UserStoryWithCitation.module.css.js"),r=require("../../shared/useMarkdownSearch.js"),a=require("lucide-react"),d=require("@mui/material"),s=require("dompurify"),c=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),v=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),h=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),p=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),y=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),w=require("./components/HighlightButtonComponent.js");function I(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=I(i),R=I(t),N=I(o),A=I(s),k=i.createContext(!1),q=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=i.createContext({rowId:""}),M=function(t){var o,r=t.aiReason,a=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(q),u=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=i.useContext(E).rowId,m=String(r.id);p&&g.current.set(m,p);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===r.id,_=a?(null==s?void 0:s.highConfidence)||n.jsx(h.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:l.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),v(C?null:p,C?null:r)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(a?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(a?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)})]}))},U=function(t){var o,r,a=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,v=i.useContext(q).expandedInfo,g=(null==v?void 0:v.rowId)===u,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,f=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return n.jsxs(E.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:f?{cssText:f}:void 0},{children:a})),g&&(null==v?void 0:v.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:h||1,className:l.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellContent},{children:n.jsx(x.default,{aiReason:v.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==s?void 0:s.aiReasoningContent,aiReasoningAccordion:null==s?void 0:s.aiReasoningAccordion,aiReasoningMarkdown:null==s?void 0:s.aiReasoningMarkdown,aiReasoningPill:null==s?void 0:s.aiReasoningPill,webCitation:null==s?void 0:s.webCitation,stormeeCitation:null==s?void 0:s.stormeeCitation,waveformCitation:null==s?void 0:s.waveformCitation,imageCitation:null==s?void 0:s.imageCitation,fileCitation:null==s?void 0:s.fileCitation,appModCitation:null==s?void 0:s.appModCitation,rcaCitation:null==s?void 0:s.rcaCitation,readFileCitation:null==s?void 0:s.readFileCitation,loadingCitations:null==s?void 0:s.loadingCitations,chatCitation:null==s?void 0:s.chatCitation}})}))}))}))}))]}))};var L=["del","ins"];function T(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,L,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(e)}).join("")})}function P(e,n){var i=[],t=new Set(n.map(function(e){return e.toLowerCase()})),o=function(e){var n;if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.flatMap(function(e){var n=o(e);return null==n||!1===n?[]:Array.isArray(n)?n:[n]});if(!b.default.isValidElement(e))return e;var l="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(l))return i.push(e),null;var r=b.default.Children.toArray(null===(n=e.props)||void 0===n?void 0:n.children).flatMap(function(e){var n=o(e);return null==n||!1===n?[]:Array.isArray(n)?n:[n]});return b.default.cloneElement(e,e.props,r)};return{cleanedChildren:o(e),extractedNodes:i}}exports.default=function(t){var o,s=t.message,h=t.noMarkdownContent,f=t.useMarkdown,x=void 0===f||f,I=t.isParent,E=t.scenario,L=t.showUserStoryDiff,D=void 0!==L&&L,F=t.aiReasoningsForBlock,H=t.isCitationLoadingDisplay,$=void 0!==H&&H,O=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var B=t.customStyles,V=t.customIcons,W=t.contextVariant,z=t.aiReasoningDiffView,G=t.userStoryCitations,Q=t.artifactId,J=t.isCraflow,K=t.onCraAccept,X=t.onCraReject,Y=t.craFlowConfig,Z=t.isDisplayHighlightControl,ee=void 0!==Z&&Z,ne=t.showConfidenceScore,ie=void 0===ne||ne,te=t.CDNeededInChip,oe=i.useRef(null),le=g.useRequirementAI(),re=le.userStory,ae=le.inlineUpdateComponentConfig,de=le.getAvgScoreForStory,se=le.setUserStory,ce=le.aiReasoning,ue=le.setAiReasoning,ve=le.customIcons,ge=le.searchQueryList,he=le.searchQueryReasoningIdList,fe=le.currentHighlightIndex,pe=le.segmentComponentConfig,me=le.diffEditConfig,Ce=null!=V?V:null==ve?void 0:ve.userStoryIcons;null==B||B.searchHighlight;var _e=r.useMarkdownSearch(oe),xe=_e.search,ye=_e.clear,je=i.useState("1"),Se=je[0],we=je[1],Ie=i.useState(null),be=Ie[0],Re=Ie[1],Ne=i.useRef(new Map),Ae=i.useState(new Set),ke=Ae[0],qe=Ae[1],Ee=i.useCallback(function(e,n){Re(e&&n?{rowId:e,aiReason:n}:null)},[]),Me=Q?de(Q):0,Ue=i.useState([]),Le=Ue[0],Te=Ue[1],Pe=i.useCallback(function(e){qe(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),De=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(De).join(""):b.default.isValidElement(e)?De(e.props.children):""},Fe=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var l=n[0],r=l.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=l.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:d((null==r?void 0:r[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===t.length)return e;for(var s=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,l=0,r=s.substring(0,n.index).split("\n").reverse();l<r.length;l++){var a=r[l].trim();if(""!==a){/^\d+\.\s/.test(a)&&(o=!0);break}}if(!o)return"continue";var d=n.endIndex,c=e+1<t.length?t[e+1].index:s.length,u=s.substring(d,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),s=s.substring(0,d)+u+s.substring(c)},u=t.length-1;u>=0;u--)c(u);return s}(n=(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var l=t.match(/<table[\s\S]*?<\/table>/i);if(l){var r=btoa(encodeURIComponent(l[0]));return"<segment".concat(i,' data-table="').concat(r,'"></segment>')}return e})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(e,n,i){if(/<table[\s>]/i.test(i)){var t=btoa(encodeURIComponent(i));return"<updatedsegment".concat(n,' data-raw="').concat(t,'"></updatedsegment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var l=n.substring(0,o),r=l.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(a||d){var s=t;return s=(s=(s=(s=s.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(s,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=T(n)},He=i.useMemo(function(){return s?Fe(s):s},[s]);i.useEffect(function(){Te(F||ce)},[F,ce]);var $e=i.useMemo(function(){return{span:function(i){var t,o,l,r,a,d=i.node,s=i.children,c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==o?o:null==c?void 0:c["highlight-id"],v="string"==typeof u&&ke.has(u),g=null!==(r=null===(l=null==d?void 0:d.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==r?r:null==c?void 0:c["highlight-color"];return n.jsx("span",e.__assign({style:e.__assign(e.__assign({},null!==(a=null==B?void 0:B.span)&&void 0!==a?a:{}),v?{backgroundColor:g||"#fef08a"}:{})},{children:s}))},button:function(i){var t,o,l,r,a,d,s=i.node;i.children;var c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==o?o:null==c?void 0:c.action,v=null!==(r=null===(l=null==s?void 0:s.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==r?r:null==c?void 0:c["highlight-id"],g=null!==(d=null===(a=null==s?void 0:s.properties)||void 0===a?void 0:a["highlight-type"])&&void 0!==d?d:null==c?void 0:c["highlight-type"];return"highlight"===u?n.jsx(w.default,{highlightId:v,handleHighlightSpan:Pe,icon:"web"===g?null==Ce?void 0:Ce.webCitationIcon:"doc"===g?null==Ce?void 0:Ce.fileCitationIcon:n.jsx(n.Fragment,{}),customStyles:"web"===g?null==B?void 0:B.webButton:"doc"===g?null==B?void 0:B.docButton:{}}):null},upt:function(i){var t;i.node;var o=i.children,l=e.__rest(i,["node","children"]),r=null==l?void 0:l.id,a=r?null===(t=r.split("$"))||void 0===t?void 0:t[1]:null,d=ce.find(function(e){return e.id.toString()===a});return d?n.jsx(n.Fragment,{children:n.jsx(y.default,e.__assign({aiReason:d,customStyles:null==B?void 0:B.inlineUpdatedComponent,handleClickCognitiveDecision:null==ae?void 0:ae.handleClickCognitiveDecision,handleClickUpdatedPill:null==ae?void 0:ae.handleClickUpdatedPill,handleClickOutputValue:null==ae?void 0:ae.handleClickOutputValue,customIcons:null==ae?void 0:ae.customIcons,CDNeededInChip:te},{children:o}))}):o},del:function(i){var t,o,r,a;i.node;var d=i.children,s=e.__rest(i,["node","children"]),c=s.aireason,u=c&&(null===(t=c.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(o=c.deviation_details)||void 0===o?void 0:o.resolved)||"reverted"===(null===(r=c.deviation_details)||void 0===r?void 0:r.resolved)),v=P(d,["ins"]),g=v.cleanedChildren,h=v.extractedNodes;return n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:l.default.deleted,style:e.__assign(e.__assign({},null!==(a=null==B?void 0:B.deleted)&&void 0!==a?a:{}),{textDecoration:u?"none":"line-through"})},s,{onClick:s.onclick},{children:g})),h]})},ins:function(i){var t=i.children,o=e.__rest(i,["children"]),r=P(t,["del"]),a=r.cleanedChildren,d=r.extractedNodes;return n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:l.default.inserted,style:null==B?void 0:B.inserted},o,{onClick:o.onclick},{children:a})),d]})},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:l.default.preserved,style:null==B?void 0:B.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:l.default.heading1,style:null==B?void 0:B.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:l.default.heading2,style:null==B?void 0:B.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:l.default.heading3,style:null==B?void 0:B.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:l.default.bold,style:null==B?void 0:B.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:l.default.paragraph,style:null==B?void 0:B.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(c.default,e.__assign({},o,{showUserStoryDiff:D,currentUpdatedTagId:Se,setCurrentUpdatedTagId:we,userStory:re,setUserStory:se,setAiReasoning:ue,node:t,isCraflow:J,onCraAccept:K,onCraReject:X,diffEditConfig:me,customStyles:null==B?void 0:B.updatedContent,craFlowConfig:Y}))},ol:function(i){var t,o,r,a=i.node,d=e.__rest(i,["node"]),s=null!==(r=null!==(o=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==r?r:void 0;return n.jsx("ol",e.__assign({className:l.default.orderedList,style:null==B?void 0:B.olist},s?{start:Number(s)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:l.default.unorderedList,style:null==B?void 0:B.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:l.default.tableWrapper},{children:n.jsx("table",e.__assign({className:l.default.table,style:null==B?void 0:B.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(U,{node:i,children:t,customStyles:B})},td:function(i){var t,o=i.node,l=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},a=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:a?{cssText:a}:void 0},{children:l}))}))},th:function(i){var t,o=i.node,l=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},a=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:a?{cssText:a}:void 0},{children:l}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(C.default,e.__assign({},o,{customStyles:null==B?void 0:B.recommendationBlock,label:l}))},a:function(t){var o,l,r;t.inline;var a=t.children;t.node;var d=e.__rest(t,["inline","children","node"]),s=i.useContext(k)||"true"==(null==d?void 0:d.table),c="".concat(null==d?void 0:d.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],v=null===(l=c.split("$"))||void 0===l?void 0:l[1];if("ai_reasoning"===u){var g=(null!==(r=D?z:ce)&&void 0!==r?r:[]).find(function(e){return e.id.toString()===decodeURIComponent(v)}),h=he.includes(v);if(g){if(s)return n.jsx(M,{aiReason:g,customStyle:null==B?void 0:B.tableAiReasoning,customIcons:Ce,isHighConfidence:g.relevance_score>=p.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var f=De(a),m="source"!==f.trim().toLowerCase();return n.jsx(p.default,{aiReason:g,isSourceHasHighlight:h,inlineLabel:f,isInlineCitation:m,customIcons:Ce,customStyles:{aiReasoningContent:null==B?void 0:B.aiReasoningContent,aiReasoningAccordion:null==B?void 0:B.aiReasoningAccordion,aiReasoningMarkdown:null==B?void 0:B.aiReasoningMarkdown,aiReasoningPill:null==B?void 0:B.aiReasoningPill,webCitation:null==B?void 0:B.webCitation,stormeeCitation:null==B?void 0:B.stormeeCitation,waveformCitation:null==B?void 0:B.waveformCitation,imageCitation:null==B?void 0:B.imageCitation,fileCitation:null==B?void 0:B.fileCitation,appModCitation:null==B?void 0:B.appModCitation,rcaCitation:null==B?void 0:B.rcaCitation,readFileCitation:null==B?void 0:B.readFileCitation,loadingCitations:null==B?void 0:B.loadingCitations,chatCitation:null==B?void 0:B.chatCitation,bigEnoughCitation:null==B?void 0:B.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:l.default.blockCode,style:null==B?void 0:B.code},{children:t}))}):n.jsx("code",e.__assign({className:l.default.inlineCode,style:null==B?void 0:B.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(a.Info,{size:16,className:l.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",l=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(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}(t);return n.jsx(u.default,{title:"Generated Code",code:l,language:o,customStyles:{pill:null==B?void 0:B.generatedCodePill,content:null==B?void 0:B.generatedCodeContent}})},updatedsegment:function(i){var t,o,l,r,a=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=a.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=a.position)||void 0===o?void 0:o.start.column,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column),u=function(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}}(s),v=u?n.jsx("div",{dangerouslySetInnerHTML:{__html:A.default.sanitize(u)}}):n.jsx("div",{children:d});return n.jsx(j.default,{id:c,node:a,children:v,props:s,segmentComponentConfig:pe,customStyles:B,customIcons:V,extractText:De,isUpdatedSegment:!0})},segment:function(i){var t,o,l,r,a=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=a.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=a.position)||void 0===o?void 0:o.start.column,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column);return n.jsx(j.default,{id:c,node:a,children:d,props:s,segmentComponentConfig:pe,customStyles:B,customIcons:V,extractText:De})}}},[Le,Y,ce,G,Se,D,s,V,ge,he,B,pe,ke,Pe]);return i.useEffect(function(){if(oe.current){if(ge.length){var e;if(0===he.length||ee)requestAnimationFrame(function(){xe([ge[fe].replace(/\*/g,"")])});else{var n=oe.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){xe([ge[fe].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ye()}},[ge,he,fe,ee]),n.jsx(q.Provider,e.__assign({value:{expandedInfo:be,setExpanded:Ee,reasonToRow:Ne}},{children:n.jsxs("div",e.__assign({ref:oe,className:"".concat(l.default.container," ").concat("approving"!==E?l.default.wrapper:""," ").concat(O||""),style:null==B?void 0:B.container},{children:[x?n.jsx(S.MarkdownContextProvider,{children:n.jsx(R.default,e.__assign({components:$e,rehypePlugins:[N.default]},{children:He}))}):h,Me>0&&ie&&n.jsx("div",e.__assign({className:l.default.confidenceScoreContainer,style:null==B?void 0:B.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:l.default.confidenceScore,style:null==B?void 0:B.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==B?void 0:B.confidenceScoreIconColor)||"#166534"}),Me,"%"]}))})),$&&n.jsx("div",e.__assign({className:l.default.citationLoader,style:null==B?void 0:B.citationLoaderContainer},{children:n.jsx(v.default,{customStyles:{container:null==B?void 0:B.citationLoadingContainer,icon:null==B?void 0:B.citationLoadingIcon,text:null==B?void 0:B.citationLoadingText}})})),I&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==B?void 0:B.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(_.default,{customStyles:null==B?void 0:B.attachedContext,variant:W})}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),l=require("./UserStoryWithCitation.module.css.js"),r=require("../../shared/useMarkdownSearch.js"),a=require("lucide-react"),d=require("@mui/material"),s=require("dompurify"),c=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),v=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../../icons/CognitiveDecision.js"),h=require("../../icons/BrainRed.js"),p=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),y=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),w=require("./components/HighlightButtonComponent.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=b(i),R=b(t),N=b(o),k=b(s),A=i.createContext(!1),q=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=i.createContext({rowId:""}),M=function(t){var o,r=t.aiReason,a=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(q),u=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=i.useContext(E).rowId,m=String(r.id);p&&g.current.set(m,p);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===r.id,_=a?(null==s?void 0:s.highConfidence)||n.jsx(f.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(h.default,{});return n.jsxs("button",e.__assign({className:l.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),v(C?null:p,C?null:r)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(a?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(a?l.default.aiReasoningIconHighConfidence:l.default.aiReasoningIconLowConfidence)})]}))},U=function(t){var o,r,a=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,v=i.useContext(q).expandedInfo,g=(null==v?void 0:v.rowId)===u,f=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,h=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return n.jsxs(E.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:h?{cssText:h}:void 0},{children:a})),g&&(null==v?void 0:v.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:l.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:l.default.tableExpandedCellContent},{children:n.jsx(x.default,{aiReason:v.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==s?void 0:s.aiReasoningContent,aiReasoningAccordion:null==s?void 0:s.aiReasoningAccordion,aiReasoningMarkdown:null==s?void 0:s.aiReasoningMarkdown,aiReasoningPill:null==s?void 0:s.aiReasoningPill,webCitation:null==s?void 0:s.webCitation,stormeeCitation:null==s?void 0:s.stormeeCitation,waveformCitation:null==s?void 0:s.waveformCitation,imageCitation:null==s?void 0:s.imageCitation,fileCitation:null==s?void 0:s.fileCitation,appModCitation:null==s?void 0:s.appModCitation,rcaCitation:null==s?void 0:s.rcaCitation,readFileCitation:null==s?void 0:s.readFileCitation,loadingCitations:null==s?void 0:s.loadingCitations,chatCitation:null==s?void 0:s.chatCitation}})}))}))}))}))]}))};var L=["del","ins"];function T(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,L,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(e)}).join("")})}var D=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function P(e,n){var i=[],t=new Set(n.map(function(e){return e.toLowerCase()})),o=function(e){var n,l;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(function(e){return o(e)}).flat().filter(function(e){return null!=e});if(!I.default.isValidElement(e))return e;var r="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(r))return i.push(e),null;if(D.has(r))return e;var a=null===(l=I.default.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,o))||void 0===l?void 0:l.flat().filter(function(e){return null!=e});return a&&0!==a.length?I.default.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:o(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}exports.default=function(t){var o,s=t.message,f=t.noMarkdownContent,h=t.useMarkdown,x=void 0===h||h,b=t.isParent,E=t.scenario,L=t.showUserStoryDiff,D=void 0!==L&&L,F=t.aiReasoningsForBlock,H=t.isCitationLoadingDisplay,$=void 0!==H&&H,O=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var B=t.customStyles,V=t.customIcons,W=t.contextVariant,z=t.aiReasoningDiffView,G=t.userStoryCitations,Q=t.artifactId,J=t.isCraflow,K=t.onCraAccept,X=t.onCraReject,Y=t.craFlowConfig,Z=t.isDisplayHighlightControl,ee=void 0!==Z&&Z,ne=t.showConfidenceScore,ie=void 0===ne||ne,te=t.CDNeededInChip,oe=i.useRef(null),le=g.useRequirementAI(),re=le.userStory,ae=le.inlineUpdateComponentConfig,de=le.getAvgScoreForStory,se=le.setUserStory,ce=le.aiReasoning,ue=le.setAiReasoning,ve=le.customIcons,ge=le.searchQueryList,fe=le.searchQueryReasoningIdList,he=le.currentHighlightIndex,pe=le.segmentComponentConfig,me=le.diffEditConfig,Ce=null!=V?V:null==ve?void 0:ve.userStoryIcons;null==B||B.searchHighlight;var _e=r.useMarkdownSearch(oe),xe=_e.search,ye=_e.clear,je=i.useState("1"),Se=je[0],we=je[1],be=i.useState(null),Ie=be[0],Re=be[1],Ne=i.useRef(new Map),ke=i.useState(new Set),Ae=ke[0],qe=ke[1],Ee=i.useCallback(function(e,n){Re(e&&n?{rowId:e,aiReason:n}:null)},[]),Me=Q?de(Q):0,Ue=i.useState([]),Le=Ue[0],Te=Ue[1],De=i.useCallback(function(e){qe(function(n){var i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Pe=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Pe).join(""):I.default.isValidElement(e)?Pe(e.props.children):""},Fe=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var l=n[0],r=l.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=l.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:d((null==r?void 0:r[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===t.length)return e;for(var s=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,l=0,r=s.substring(0,n.index).split("\n").reverse();l<r.length;l++){var a=r[l].trim();if(""!==a){/^\d+\.\s/.test(a)&&(o=!0);break}}if(!o)return"continue";var d=n.endIndex,c=e+1<t.length?t[e+1].index:s.length,u=s.substring(d,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),s=s.substring(0,d)+u+s.substring(c)},u=t.length-1;u>=0;u--)c(u);return s}(n=(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var l=t.match(/<table[\s\S]*?<\/table>/i);if(l){var r=btoa(encodeURIComponent(l[0]));return"<segment".concat(i,' data-table="').concat(r,'"></segment>')}return e})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(e,n,i){if(/<table[\s>]/i.test(i)){var t=btoa(encodeURIComponent(i));return"<updatedsegment".concat(n,' data-raw="').concat(t,'"></updatedsegment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var l=n.substring(0,o),r=l.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(a||d){var s=t;return s=(s=(s=(s=s.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(s,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=T(n)},He=i.useMemo(function(){return s?Fe(s):s},[s]);i.useEffect(function(){Te(F||ce)},[F,ce]);var $e=i.useMemo(function(){return{span:function(i){var t,o,l,r,a,d=i.node,s=i.children,c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==o?o:null==c?void 0:c["highlight-id"],v="string"==typeof u&&Ae.has(u),g=null!==(r=null===(l=null==d?void 0:d.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==r?r:null==c?void 0:c["highlight-color"];return n.jsx("span",e.__assign({style:e.__assign(e.__assign({},null!==(a=null==B?void 0:B.span)&&void 0!==a?a:{}),v?{backgroundColor:g||"#fef08a"}:{})},{children:s}))},button:function(i){var t,o,l,r,a,d,s=i.node;i.children;var c=e.__rest(i,["node","children"]),u=null!==(o=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==o?o:null==c?void 0:c.action,v=null!==(r=null===(l=null==s?void 0:s.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==r?r:null==c?void 0:c["highlight-id"],g=null!==(d=null===(a=null==s?void 0:s.properties)||void 0===a?void 0:a["highlight-type"])&&void 0!==d?d:null==c?void 0:c["highlight-type"];return"highlight"===u?n.jsx(w.default,{highlightId:v,handleHighlightSpan:De,icon:"web"===g?null==Ce?void 0:Ce.webCitationIcon:"doc"===g?null==Ce?void 0:Ce.fileCitationIcon:n.jsx(n.Fragment,{}),customStyles:"web"===g?null==B?void 0:B.webButton:"doc"===g?null==B?void 0:B.docButton:{}}):null},upt:function(i){var t;i.node;var o=i.children,l=e.__rest(i,["node","children"]),r=null==l?void 0:l.id,a=r?null===(t=r.split("$"))||void 0===t?void 0:t[1]:null,d=ce.find(function(e){return e.id.toString()===a});return d?n.jsx(n.Fragment,{children:n.jsx(y.default,e.__assign({aiReason:d,customStyles:null==B?void 0:B.inlineUpdatedComponent,handleClickCognitiveDecision:null==ae?void 0:ae.handleClickCognitiveDecision,handleClickUpdatedPill:null==ae?void 0:ae.handleClickUpdatedPill,handleClickOutputValue:null==ae?void 0:ae.handleClickOutputValue,customIcons:null==ae?void 0:ae.customIcons,CDNeededInChip:te},{children:o}))}):o},del:function(i){var t,o,r,a;i.node;var d=i.children,s=e.__rest(i,["node","children"]),c=s.aireason,u=c&&(null===(t=c.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(o=c.deviation_details)||void 0===o?void 0:o.resolved)||"reverted"===(null===(r=c.deviation_details)||void 0===r?void 0:r.resolved)),v=P(d,["ins"]),g=v.cleanedChildren,f=v.extractedNodes;return n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:l.default.deleted,style:e.__assign(e.__assign({},null!==(a=null==B?void 0:B.deleted)&&void 0!==a?a:{}),{textDecoration:u?"none":"line-through"})},s,{onClick:s.onclick},{children:g})),f]})},ins:function(i){var t=i.children,o=e.__rest(i,["children"]),r=P(t,["del"]),a=r.cleanedChildren,d=r.extractedNodes;return n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({className:l.default.inserted,style:null==B?void 0:B.inserted},o,{onClick:o.onclick},{children:a})),d]})},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:l.default.preserved,style:null==B?void 0:B.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:l.default.heading1,style:null==B?void 0:B.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:l.default.heading2,style:null==B?void 0:B.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:l.default.heading3,style:null==B?void 0:B.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:l.default.bold,style:null==B?void 0:B.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:l.default.paragraph,style:null==B?void 0:B.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(c.default,e.__assign({},o,{showUserStoryDiff:D,currentUpdatedTagId:Se,setCurrentUpdatedTagId:we,userStory:re,setUserStory:se,setAiReasoning:ue,node:t,isCraflow:J,onCraAccept:K,onCraReject:X,diffEditConfig:me,customStyles:null==B?void 0:B.updatedContent,craFlowConfig:Y}))},ol:function(i){var t,o,r,a=i.node,d=e.__rest(i,["node"]),s=null!==(r=null!==(o=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==r?r:void 0;return n.jsx("ol",e.__assign({className:l.default.orderedList,style:null==B?void 0:B.olist},s?{start:Number(s)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:l.default.unorderedList,style:null==B?void 0:B.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:l.default.tableWrapper},{children:n.jsx("table",e.__assign({className:l.default.table,style:null==B?void 0:B.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(U,{node:i,children:t,customStyles:B})},td:function(i){var t,o=i.node,l=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},a=r.style,d=e.__rest(r,["style"]);return n.jsx(A.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:a?{cssText:a}:void 0},{children:l}))}))},th:function(i){var t,o=i.node,l=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},a=r.style,d=e.__rest(r,["style"]);return n.jsx(A.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:a?{cssText:a}:void 0},{children:l}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(C.default,e.__assign({},o,{customStyles:null==B?void 0:B.recommendationBlock,label:l}))},a:function(t){var o,l,r;t.inline;var a=t.children;t.node;var d=e.__rest(t,["inline","children","node"]),s=i.useContext(A)||"true"==(null==d?void 0:d.table),c="".concat(null==d?void 0:d.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],v=null===(l=c.split("$"))||void 0===l?void 0:l[1];if("ai_reasoning"===u){var g=(null!==(r=D?z:ce)&&void 0!==r?r:[]).find(function(e){return e.id.toString()===decodeURIComponent(v)}),f=fe.includes(v);if(g){if(s)return n.jsx(M,{aiReason:g,customStyle:null==B?void 0:B.tableAiReasoning,customIcons:Ce,isHighConfidence:g.relevance_score>=p.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var h=Pe(a),m="source"!==h.trim().toLowerCase();return n.jsx(p.default,{aiReason:g,isSourceHasHighlight:f,inlineLabel:h,isInlineCitation:m,customIcons:Ce,customStyles:{aiReasoningContent:null==B?void 0:B.aiReasoningContent,aiReasoningAccordion:null==B?void 0:B.aiReasoningAccordion,aiReasoningMarkdown:null==B?void 0:B.aiReasoningMarkdown,aiReasoningPill:null==B?void 0:B.aiReasoningPill,webCitation:null==B?void 0:B.webCitation,stormeeCitation:null==B?void 0:B.stormeeCitation,waveformCitation:null==B?void 0:B.waveformCitation,imageCitation:null==B?void 0:B.imageCitation,fileCitation:null==B?void 0:B.fileCitation,appModCitation:null==B?void 0:B.appModCitation,rcaCitation:null==B?void 0:B.rcaCitation,readFileCitation:null==B?void 0:B.readFileCitation,loadingCitations:null==B?void 0:B.loadingCitations,chatCitation:null==B?void 0:B.chatCitation,bigEnoughCitation:null==B?void 0:B.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:l.default.blockCode,style:null==B?void 0:B.code},{children:t}))}):n.jsx("code",e.__assign({className:l.default.inlineCode,style:null==B?void 0:B.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(a.Info,{size:16,className:l.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",l=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(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}(t);return n.jsx(u.default,{title:"Generated Code",code:l,language:o,customStyles:{pill:null==B?void 0:B.generatedCodePill,content:null==B?void 0:B.generatedCodeContent}})},updatedsegment:function(i){var t,o,l,r,a=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=a.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=a.position)||void 0===o?void 0:o.start.column,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column),u=function(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}}(s),v=u?n.jsx("div",{dangerouslySetInnerHTML:{__html:k.default.sanitize(u)}}):n.jsx("div",{children:d});return n.jsx(j.default,{id:c,node:a,children:v,props:s,segmentComponentConfig:pe,customStyles:B,customIcons:V,extractText:Pe,isUpdatedSegment:!0})},segment:function(i){var t,o,l,r,a=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=a.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=a.position)||void 0===o?void 0:o.start.column,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.line,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.column);return n.jsx(j.default,{id:c,node:a,children:d,props:s,segmentComponentConfig:pe,customStyles:B,customIcons:V,extractText:Pe})}}},[Le,Y,ce,G,Se,D,s,V,ge,fe,B,pe,Ae,De]);return i.useEffect(function(){if(oe.current){if(ge.length){var e;if(0===fe.length||ee)requestAnimationFrame(function(){xe([ge[he].replace(/\*/g,"")])});else{var n=oe.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){xe([ge[he].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ye()}},[ge,fe,he,ee]),n.jsx(q.Provider,e.__assign({value:{expandedInfo:Ie,setExpanded:Ee,reasonToRow:Ne}},{children:n.jsxs("div",e.__assign({ref:oe,className:"".concat(l.default.container," ").concat("approving"!==E?l.default.wrapper:""," ").concat(O||""),style:null==B?void 0:B.container},{children:[x?n.jsx(S.MarkdownContextProvider,{children:n.jsx(R.default,e.__assign({components:$e,rehypePlugins:[N.default]},{children:He}))}):f,Me>0&&ie&&n.jsx("div",e.__assign({className:l.default.confidenceScoreContainer,style:null==B?void 0:B.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:l.default.confidenceScore,style:null==B?void 0:B.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==B?void 0:B.confidenceScoreIconColor)||"#166534"}),Me,"%"]}))})),$&&n.jsx("div",e.__assign({className:l.default.citationLoader,style:null==B?void 0:B.citationLoaderContainer},{children:n.jsx(v.default,{customStyles:{container:null==B?void 0:B.citationLoadingContainer,icon:null==B?void 0:B.citationLoadingIcon,text:null==B?void 0:B.citationLoadingText}})})),b&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==B?void 0:B.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(_.default,{customStyles:null==B?void 0:B.attachedContext,variant:W})}))]}))}))},exports.splitNestedDiffNodes=P;
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as n,__assign as e}from"tslib";import{jsx as i,Fragment as o,jsxs as t}from"react/jsx-runtime";import r,{createContext as l,useRef as a,useState as d,useCallback as c,useMemo as s,useEffect as u,useContext as v}from"react";import g from"react-markdown";import p from"rehype-raw";import h from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as m}from"../../shared/useMarkdownSearch.js";import{Info as f}from"lucide-react";import{Tooltip as C}from"@mui/material";import y from"dompurify";import w from"../../shared/UpdatedAnimationContent.js";import S from"../../shared/GeneratedCodeCitation.js";import I from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as b}from"../RequirementAIWrapper/RequirementAIWrapper.js";import R from"../../icons/CognitiveDecision.js";import x from"../../icons/BrainRed.js";import N,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as A}from"../ai-reasoning/AiReasoningCitation.js";import k from"../../icons/RelevanceScoreIcon.js";import j from"../RecommendationBlock/RecommendationBlock.js";import U from"../UserStoryCard/AttachedContext.js";import E from"../ai-reasoning/AiReasoningCitationContent.js";import L from"./components/InlineUpdatedComponent.js";import M from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as T}from"../../store/markdown-context.js";import _ from"./components/HighlightButtonComponent.js";var P=l(!1),$=l({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),D=l({rowId:""}),H=function(n){var o,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=v($),s=c.expandedInfo,u=c.setExpanded,g=c.reasonToRow,p=v(D).rowId,m=String(r.id);p&&g.current.set(m,p);var f=(null===(o=null==s?void 0:s.aiReason)||void 0===o?void 0:o.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(R,{}):(null==d?void 0:d.lowConfidence)||i(x,{});return t("button",e({className:h.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),u(f?null:p,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)})]}))},F=function(n){var o,r,l=n.children,d=n.node,c=n.customStyles,s=n.customIcons,u=a(Math.random().toString(36).slice(2)).current,g=v($).expandedInfo,p=(null==g?void 0:g.rowId)===u,m=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return t(D.Provider,e({value:{rowId:u}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:l})),p&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:m||1,className:h.tableExpandedCell},{children:i("div",e({className:h.tableExpandedCellInner},{children:i("div",e({className:h.tableExpandedCellContent},{children:i(E,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var B=["del","ins"];function O(n){return function(n,e,i){var o=e.join("|");return n.replace(new RegExp("<(".concat(o,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,o){return"<".concat(e,">").concat(i(o),"</").concat(e,">")})}(n,B,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,i){var o=e.push(i)-1;return"@@CODE_SPAN_".concat(o,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,i){var o,t=null!==(o=e[Number(i)])&&void 0!==o?o:"";return"<code>".concat(t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(n)}).join("")})}function V(n,e){var i=[],o=new Set(e.map(function(n){return n.toLowerCase()})),t=function(n){var e;if(null==n||"boolean"==typeof n)return null;if("string"==typeof n||"number"==typeof n)return n;if(Array.isArray(n))return n.flatMap(function(n){var e=t(n);return null==e||!1===e?[]:Array.isArray(e)?e:[e]});if(!r.isValidElement(n))return n;var l="string"==typeof n.type?n.type.toLowerCase():"";if(o.has(l))return i.push(n),null;var a=r.Children.toArray(null===(e=n.props)||void 0===e?void 0:e.children).flatMap(function(n){var e=t(n);return null==e||!1===e?[]:Array.isArray(e)?e:[e]});return r.cloneElement(n,n.props,a)};return{cleanedChildren:t(n),extractedNodes:i}}var q=function(l){var R,x=l.message,E=l.noMarkdownContent,D=l.useMarkdown,B=void 0===D||D,q=l.isParent,z=l.scenario,W=l.showUserStoryDiff,G=void 0!==W&&W,Q=l.aiReasoningsForBlock,J=l.isCitationLoadingDisplay,K=void 0!==J&&J,X=l.className;l.highConfidenceIcon,l.lowConfidenceIcon;var Y=l.customStyles,Z=l.customIcons,nn=l.contextVariant,en=l.aiReasoningDiffView,on=l.userStoryCitations,tn=l.artifactId,rn=l.isCraflow,ln=l.onCraAccept,an=l.onCraReject,dn=l.craFlowConfig,cn=l.isDisplayHighlightControl,sn=void 0!==cn&&cn,un=l.showConfidenceScore,vn=void 0===un||un,gn=l.CDNeededInChip,pn=a(null),hn=b(),mn=hn.userStory,fn=hn.inlineUpdateComponentConfig,Cn=hn.getAvgScoreForStory,yn=hn.setUserStory,wn=hn.aiReasoning,Sn=hn.setAiReasoning,In=hn.customIcons,bn=hn.searchQueryList,Rn=hn.searchQueryReasoningIdList,xn=hn.currentHighlightIndex,Nn=hn.segmentComponentConfig,An=hn.diffEditConfig,kn=null!=Z?Z:null==In?void 0:In.userStoryIcons;null==Y||Y.searchHighlight;var jn=m(pn),Un=jn.search,En=jn.clear,Ln=d("1"),Mn=Ln[0],Tn=Ln[1],_n=d(null),Pn=_n[0],$n=_n[1],Dn=a(new Map),Hn=d(new Set),Fn=Hn[0],Bn=Hn[1],On=c(function(n,e){$n(n&&e?{rowId:n,aiReason:e}:null)},[]),Vn=tn?Cn(tn):0,qn=d([]),zn=qn[0],Wn=qn[1],Gn=c(function(n){Bn(function(e){var i=new Set(e);return i.has(n)?i.delete(n):i.add(n),i})},[]),Qn=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(Qn).join(""):r.isValidElement(n)?Qn(n.props.children):""},Jn=function(n){var e=n;return e=function(n){for(var e,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,o=[],t=new RegExp(i.source,i.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};o.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===o.length)return n;for(var c=n,s=function(n){var e=o[n],i=e.changedItemCount-e.deletedItemCount;if(0===i)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<o.length?o[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,o){return"".concat(e).concat(parseInt(o,10)+i,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=o.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,i){var o=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(o,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,i,o,t){var r=o.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(n,e,i){if(/<table[\s>]/i.test(i)){var o=btoa(encodeURIComponent(i));return"<updatedsegment".concat(e,' data-raw="').concat(o,'"></updatedsegment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=o;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==e}),"<deleted>".concat(i,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==e,preview:e.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(e),e=O(e)},Kn=s(function(){return x?Jn(x):x},[x]);u(function(){Wn(Q||wn)},[Q,wn]);var Xn=s(function(){return{span:function(o){var t,r,l,a,d,c=o.node,s=o.children,u=n(o,["node","children"]),v=null!==(r=null===(t=null==c?void 0:c.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==r?r:null==u?void 0:u["highlight-id"],g="string"==typeof v&&Fn.has(v),p=null!==(a=null===(l=null==c?void 0:c.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==a?a:null==u?void 0:u["highlight-color"];return i("span",e({style:e(e({},null!==(d=null==Y?void 0:Y.span)&&void 0!==d?d:{}),g?{backgroundColor:p||"#fef08a"}:{})},{children:s}))},button:function(e){var t,r,l,a,d,c,s=e.node;e.children;var u=n(e,["node","children"]),v=null!==(r=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==r?r:null==u?void 0:u.action,g=null!==(a=null===(l=null==s?void 0:s.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==a?a:null==u?void 0:u["highlight-id"],p=null!==(c=null===(d=null==s?void 0:s.properties)||void 0===d?void 0:d["highlight-type"])&&void 0!==c?c:null==u?void 0:u["highlight-type"];return"highlight"===v?i(_,{highlightId:g,handleHighlightSpan:Gn,icon:"web"===p?null==kn?void 0:kn.webCitationIcon:"doc"===p?null==kn?void 0:kn.fileCitationIcon:i(o,{}),customStyles:"web"===p?null==Y?void 0:Y.webButton:"doc"===p?null==Y?void 0:Y.docButton:{}}):null},upt:function(t){var r;t.node;var l=t.children,a=n(t,["node","children"]),d=null==a?void 0:a.id,c=d?null===(r=d.split("$"))||void 0===r?void 0:r[1]:null,s=wn.find(function(n){return n.id.toString()===c});return s?i(o,{children:i(L,e({aiReason:s,customStyles:null==Y?void 0:Y.inlineUpdatedComponent,handleClickCognitiveDecision:null==fn?void 0:fn.handleClickCognitiveDecision,handleClickUpdatedPill:null==fn?void 0:fn.handleClickUpdatedPill,handleClickOutputValue:null==fn?void 0:fn.handleClickOutputValue,customIcons:null==fn?void 0:fn.customIcons,CDNeededInChip:gn},{children:l}))}):l},del:function(r){var l,a,d,c;r.node;var s=r.children,u=n(r,["node","children"]),v=u.aireason,g=v&&(null===(l=v.deviation_details)||void 0===l?void 0:l.resolved)&&("rejected"===(null===(a=v.deviation_details)||void 0===a?void 0:a.resolved)||"reverted"===(null===(d=v.deviation_details)||void 0===d?void 0:d.resolved)),p=V(s,["ins"]),m=p.cleanedChildren,f=p.extractedNodes;return t(o,{children:[i("span",e({className:h.deleted,style:e(e({},null!==(c=null==Y?void 0:Y.deleted)&&void 0!==c?c:{}),{textDecoration:g?"none":"line-through"})},u,{onClick:u.onclick},{children:m})),f]})},ins:function(r){var l=r.children,a=n(r,["children"]),d=V(l,["del"]),c=d.cleanedChildren,s=d.extractedNodes;return t(o,{children:[i("span",e({className:h.inserted,style:null==Y?void 0:Y.inserted},a,{onClick:a.onclick},{children:c})),s]})},preserved:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:h.preserved,style:null==Y?void 0:Y.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:h.heading1,style:null==Y?void 0:Y.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:h.heading2,style:null==Y?void 0:Y.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:h.heading3,style:null==Y?void 0:Y.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:h.bold,style:null==Y?void 0:Y.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:h.paragraph,style:null==Y?void 0:Y.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(w,e({},r,{showUserStoryDiff:G,currentUpdatedTagId:Mn,setCurrentUpdatedTagId:Tn,userStory:mn,setUserStory:yn,setAiReasoning:Sn,node:t,isCraflow:rn,onCraAccept:ln,onCraReject:an,diffEditConfig:An,customStyles:null==Y?void 0:Y.updatedContent,craFlowConfig:dn}))},ol:function(o){var t,r,l,a=o.node,d=n(o,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return i("ol",e({className:h.orderedList,style:null==Y?void 0:Y.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(o){o.node;var t=n(o,["node"]);return i("ul",e({className:h.unorderedList,style:null==Y?void 0:Y.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:h.tableWrapper},{children:i("table",e({className:h.table,style:null==Y?void 0:Y.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(F,{node:e,children:o,customStyles:Y})},td:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(P.Provider,e({value:!0},{children:i("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(P.Provider,e({value:!0},{children:i("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(o){var t;o.node;var r=n(o,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return i(j,e({},r,{customStyles:null==Y?void 0:Y.recommendationBlock,label:l}))},a:function(e){var o,t,r;e.inline;var l=e.children;e.node;var a=n(e,["inline","children","node"]),d=v(P)||"true"==(null==a?void 0:a.table),c="".concat(null==a?void 0:a.href),s=null===(o=c.split("$"))||void 0===o?void 0:o[0],u=null===(t=c.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===s){var g=(null!==(r=G?en:wn)&&void 0!==r?r:[]).find(function(n){return n.id.toString()===decodeURIComponent(u)}),p=Rn.includes(u);if(g){if(d)return i(H,{aiReason:g,customStyle:null==Y?void 0:Y.tableAiReasoning,customIcons:kn,isHighConfidence:g.relevance_score>=A});var h=Qn(l),m="source"!==h.trim().toLowerCase();return i(N,{aiReason:g,isSourceHasHighlight:p,inlineLabel:h,isInlineCitation:m,customIcons:kn,customStyles:{aiReasoningContent:null==Y?void 0:Y.aiReasoningContent,aiReasoningAccordion:null==Y?void 0:Y.aiReasoningAccordion,aiReasoningMarkdown:null==Y?void 0:Y.aiReasoningMarkdown,aiReasoningPill:null==Y?void 0:Y.aiReasoningPill,webCitation:null==Y?void 0:Y.webCitation,stormeeCitation:null==Y?void 0:Y.stormeeCitation,waveformCitation:null==Y?void 0:Y.waveformCitation,imageCitation:null==Y?void 0:Y.imageCitation,fileCitation:null==Y?void 0:Y.fileCitation,appModCitation:null==Y?void 0:Y.appModCitation,rcaCitation:null==Y?void 0:Y.rcaCitation,readFileCitation:null==Y?void 0:Y.readFileCitation,loadingCitations:null==Y?void 0:Y.loadingCitations,chatCitation:null==Y?void 0:Y.chatCitation,bigEnoughCitation:null==Y?void 0:Y.bigEnoughCitation}})}}return null},code:function(o){o.inline;var t=o.children,r=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?i("div",{children:i("code",e({className:h.blockCode,style:null==Y?void 0:Y.code},{children:t}))}):i("code",e({className:h.inlineCode,style:null==Y?void 0:Y.code},{children:t}))},learned:function(n){var o=n.children;return i(C,e({title:o,placement:"top"},{children:i(f,{size:16,className:h.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var i=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(i).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?i(n.props.children):""};e=i(n.children)}}catch(i){console.error("Error decoding generated code:",i),e=String(n.children)}return e}(o);return i(S,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==Y?void 0:Y.generatedCodePill,content:null==Y?void 0:Y.generatedCodeContent}})},updatedsegment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column),u=function(n){if(!n["data-raw"])return null;try{return decodeURIComponent(atob(n["data-raw"]))}catch(n){return console.error("Error decoding segment raw content:",n),null}}(c),v=i("div",u?{dangerouslySetInnerHTML:{__html:y.sanitize(u)}}:{children:d});return i(M,{id:s,node:a,children:v,props:c,segmentComponentConfig:Nn,customStyles:Y,customIcons:Z,extractText:Qn,isUpdatedSegment:!0})},segment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(M,{id:s,node:a,children:d,props:c,segmentComponentConfig:Nn,customStyles:Y,customIcons:Z,extractText:Qn})}}},[zn,dn,wn,on,Mn,G,x,Z,bn,Rn,Y,Nn,Fn,Gn]);return u(function(){if(pn.current){if(bn.length){var n;if(0===Rn.length||sn)requestAnimationFrame(function(){Un([bn[xn].replace(/\*/g,"")])});else{var e=pn.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Un([bn[xn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}En()}},[bn,Rn,xn,sn]),i($.Provider,e({value:{expandedInfo:Pn,setExpanded:On,reasonToRow:Dn}},{children:t("div",e({ref:pn,className:"".concat(h.container," ").concat("approving"!==z?h.wrapper:""," ").concat(X||""),style:null==Y?void 0:Y.container},{children:[B?i(T,{children:i(g,e({components:Xn,rehypePlugins:[p]},{children:Kn}))}):E,Vn>0&&vn&&i("div",e({className:h.confidenceScoreContainer,style:null==Y?void 0:Y.confidenceScoreContainer},{children:t("span",e({className:h.confidenceScore,style:null==Y?void 0:Y.confidenceScore},{children:[i(k,{size:14,color:(null==Y?void 0:Y.confidenceScoreIconColor)||"#166534"}),Vn,"%"]}))})),K&&i("div",e({className:h.citationLoader,style:null==Y?void 0:Y.citationLoaderContainer},{children:i(I,{customStyles:{container:null==Y?void 0:Y.citationLoadingContainer,icon:null==Y?void 0:Y.citationLoadingIcon,text:null==Y?void 0:Y.citationLoadingText}})})),q&&i("div",e({style:e({},null===(R=null==Y?void 0:Y.attachedContext)||void 0===R?void 0:R.wrapper),className:"flex mt-5"},{children:i(U,{customStyles:null==Y?void 0:Y.attachedContext,variant:nn})}))]}))}))};export{q as default};
1
+ import{__rest as n,__assign as e}from"tslib";import{jsx as i,Fragment as o,jsxs as t}from"react/jsx-runtime";import r,{createContext as l,useRef as a,useState as d,useCallback as c,useMemo as s,useEffect as u,useContext as v}from"react";import g from"react-markdown";import p from"rehype-raw";import h from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as m}from"../../shared/useMarkdownSearch.js";import{Info as f}from"lucide-react";import{Tooltip as C}from"@mui/material";import y from"dompurify";import w from"../../shared/UpdatedAnimationContent.js";import S from"../../shared/GeneratedCodeCitation.js";import b from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as I}from"../RequirementAIWrapper/RequirementAIWrapper.js";import R from"../../icons/CognitiveDecision.js";import x from"../../icons/BrainRed.js";import N,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as k}from"../ai-reasoning/AiReasoningCitation.js";import A from"../../icons/RelevanceScoreIcon.js";import j from"../RecommendationBlock/RecommendationBlock.js";import U from"../UserStoryCard/AttachedContext.js";import E from"../ai-reasoning/AiReasoningCitationContent.js";import L from"./components/InlineUpdatedComponent.js";import T from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as _}from"../../store/markdown-context.js";import D from"./components/HighlightButtonComponent.js";var M=l(!1),P=l({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),$=l({rowId:""}),H=function(n){var o,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=v(P),s=c.expandedInfo,u=c.setExpanded,g=c.reasonToRow,p=v($).rowId,m=String(r.id);p&&g.current.set(m,p);var f=(null===(o=null==s?void 0:s.aiReason)||void 0===o?void 0:o.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(R,{}):(null==d?void 0:d.lowConfidence)||i(x,{});return t("button",e({className:h.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),u(f?null:p,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?h.aiReasoningIconHighConfidence:h.aiReasoningIconLowConfidence)})]}))},F=function(n){var o,r,l=n.children,d=n.node,c=n.customStyles,s=n.customIcons,u=a(Math.random().toString(36).slice(2)).current,g=v(P).expandedInfo,p=(null==g?void 0:g.rowId)===u,m=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return t($.Provider,e({value:{rowId:u}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:l})),p&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:m||1,className:h.tableExpandedCell},{children:i("div",e({className:h.tableExpandedCellInner},{children:i("div",e({className:h.tableExpandedCellContent},{children:i(E,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var B=["del","ins"];function O(n){return function(n,e,i){var o=e.join("|");return n.replace(new RegExp("<(".concat(o,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,o){return"<".concat(e,">").concat(i(o),"</").concat(e,">")})}(n,B,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,i){var o=e.push(i)-1;return"@@CODE_SPAN_".concat(o,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,i){var o,t=null!==(o=e[Number(i)])&&void 0!==o?o:"";return"<code>".concat(t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(n)}).join("")})}var V=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function q(n,e){var i=[],o=new Set(e.map(function(n){return n.toLowerCase()})),t=function(n){var e,l;try{if(null==n||"boolean"==typeof n)return null;if("string"==typeof n||"number"==typeof n)return n;if(Array.isArray(n))return n.map(function(n){return t(n)}).flat().filter(function(n){return null!=n});if(!r.isValidElement(n))return n;var a="string"==typeof n.type?n.type.toLowerCase():"";if(o.has(a))return i.push(n),null;if(V.has(a))return n;var d=null===(l=r.Children.map(null===(e=n.props)||void 0===e?void 0:e.children,t))||void 0===l?void 0:l.flat().filter(function(n){return null!=n});return d&&0!==d.length?r.cloneElement(n,void 0,d):null}catch(e){return console.error("splitNestedDiffNodes failed while processing node:",e),n}};try{return{cleanedChildren:t(n),extractedNodes:i}}catch(e){return console.error("splitNestedDiffNodes failed:",e),{cleanedChildren:n,extractedNodes:[]}}}var z=function(l){var R,x=l.message,E=l.noMarkdownContent,$=l.useMarkdown,B=void 0===$||$,V=l.isParent,z=l.scenario,W=l.showUserStoryDiff,G=void 0!==W&&W,Q=l.aiReasoningsForBlock,J=l.isCitationLoadingDisplay,K=void 0!==J&&J,X=l.className;l.highConfidenceIcon,l.lowConfidenceIcon;var Y=l.customStyles,Z=l.customIcons,nn=l.contextVariant,en=l.aiReasoningDiffView,on=l.userStoryCitations,tn=l.artifactId,rn=l.isCraflow,ln=l.onCraAccept,an=l.onCraReject,dn=l.craFlowConfig,cn=l.isDisplayHighlightControl,sn=void 0!==cn&&cn,un=l.showConfidenceScore,vn=void 0===un||un,gn=l.CDNeededInChip,pn=a(null),hn=I(),mn=hn.userStory,fn=hn.inlineUpdateComponentConfig,Cn=hn.getAvgScoreForStory,yn=hn.setUserStory,wn=hn.aiReasoning,Sn=hn.setAiReasoning,bn=hn.customIcons,In=hn.searchQueryList,Rn=hn.searchQueryReasoningIdList,xn=hn.currentHighlightIndex,Nn=hn.segmentComponentConfig,kn=hn.diffEditConfig,An=null!=Z?Z:null==bn?void 0:bn.userStoryIcons;null==Y||Y.searchHighlight;var jn=m(pn),Un=jn.search,En=jn.clear,Ln=d("1"),Tn=Ln[0],_n=Ln[1],Dn=d(null),Mn=Dn[0],Pn=Dn[1],$n=a(new Map),Hn=d(new Set),Fn=Hn[0],Bn=Hn[1],On=c(function(n,e){Pn(n&&e?{rowId:n,aiReason:e}:null)},[]),Vn=tn?Cn(tn):0,qn=d([]),zn=qn[0],Wn=qn[1],Gn=c(function(n){Bn(function(e){var i=new Set(e);return i.has(n)?i.delete(n):i.add(n),i})},[]),Qn=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(Qn).join(""):r.isValidElement(n)?Qn(n.props.children):""},Jn=function(n){var e=n;return e=function(n){for(var e,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,o=[],t=new RegExp(i.source,i.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};o.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===o.length)return n;for(var c=n,s=function(n){var e=o[n],i=e.changedItemCount-e.deletedItemCount;if(0===i)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<o.length?o[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,o){return"".concat(e).concat(parseInt(o,10)+i,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=o.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,i){var o=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(o,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,i,o,t){var r=o.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(n,e,i){if(/<table[\s>]/i.test(i)){var o=btoa(encodeURIComponent(i));return"<updatedsegment".concat(e,' data-raw="').concat(o,'"></updatedsegment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=o;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==e}),"<deleted>".concat(i,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==e,preview:e.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(e),e=O(e)},Kn=s(function(){return x?Jn(x):x},[x]);u(function(){Wn(Q||wn)},[Q,wn]);var Xn=s(function(){return{span:function(o){var t,r,l,a,d,c=o.node,s=o.children,u=n(o,["node","children"]),v=null!==(r=null===(t=null==c?void 0:c.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==r?r:null==u?void 0:u["highlight-id"],g="string"==typeof v&&Fn.has(v),p=null!==(a=null===(l=null==c?void 0:c.properties)||void 0===l?void 0:l["highlight-color"])&&void 0!==a?a:null==u?void 0:u["highlight-color"];return i("span",e({style:e(e({},null!==(d=null==Y?void 0:Y.span)&&void 0!==d?d:{}),g?{backgroundColor:p||"#fef08a"}:{})},{children:s}))},button:function(e){var t,r,l,a,d,c,s=e.node;e.children;var u=n(e,["node","children"]),v=null!==(r=null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t.action)&&void 0!==r?r:null==u?void 0:u.action,g=null!==(a=null===(l=null==s?void 0:s.properties)||void 0===l?void 0:l["highlight-id"])&&void 0!==a?a:null==u?void 0:u["highlight-id"],p=null!==(c=null===(d=null==s?void 0:s.properties)||void 0===d?void 0:d["highlight-type"])&&void 0!==c?c:null==u?void 0:u["highlight-type"];return"highlight"===v?i(D,{highlightId:g,handleHighlightSpan:Gn,icon:"web"===p?null==An?void 0:An.webCitationIcon:"doc"===p?null==An?void 0:An.fileCitationIcon:i(o,{}),customStyles:"web"===p?null==Y?void 0:Y.webButton:"doc"===p?null==Y?void 0:Y.docButton:{}}):null},upt:function(t){var r;t.node;var l=t.children,a=n(t,["node","children"]),d=null==a?void 0:a.id,c=d?null===(r=d.split("$"))||void 0===r?void 0:r[1]:null,s=wn.find(function(n){return n.id.toString()===c});return s?i(o,{children:i(L,e({aiReason:s,customStyles:null==Y?void 0:Y.inlineUpdatedComponent,handleClickCognitiveDecision:null==fn?void 0:fn.handleClickCognitiveDecision,handleClickUpdatedPill:null==fn?void 0:fn.handleClickUpdatedPill,handleClickOutputValue:null==fn?void 0:fn.handleClickOutputValue,customIcons:null==fn?void 0:fn.customIcons,CDNeededInChip:gn},{children:l}))}):l},del:function(r){var l,a,d,c;r.node;var s=r.children,u=n(r,["node","children"]),v=u.aireason,g=v&&(null===(l=v.deviation_details)||void 0===l?void 0:l.resolved)&&("rejected"===(null===(a=v.deviation_details)||void 0===a?void 0:a.resolved)||"reverted"===(null===(d=v.deviation_details)||void 0===d?void 0:d.resolved)),p=q(s,["ins"]),m=p.cleanedChildren,f=p.extractedNodes;return t(o,{children:[i("span",e({className:h.deleted,style:e(e({},null!==(c=null==Y?void 0:Y.deleted)&&void 0!==c?c:{}),{textDecoration:g?"none":"line-through"})},u,{onClick:u.onclick},{children:m})),f]})},ins:function(r){var l=r.children,a=n(r,["children"]),d=q(l,["del"]),c=d.cleanedChildren,s=d.extractedNodes;return t(o,{children:[i("span",e({className:h.inserted,style:null==Y?void 0:Y.inserted},a,{onClick:a.onclick},{children:c})),s]})},preserved:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:h.preserved,style:null==Y?void 0:Y.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:h.heading1,style:null==Y?void 0:Y.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:h.heading2,style:null==Y?void 0:Y.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:h.heading3,style:null==Y?void 0:Y.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:h.bold,style:null==Y?void 0:Y.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:h.paragraph,style:null==Y?void 0:Y.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(w,e({},r,{showUserStoryDiff:G,currentUpdatedTagId:Tn,setCurrentUpdatedTagId:_n,userStory:mn,setUserStory:yn,setAiReasoning:Sn,node:t,isCraflow:rn,onCraAccept:ln,onCraReject:an,diffEditConfig:kn,customStyles:null==Y?void 0:Y.updatedContent,craFlowConfig:dn}))},ol:function(o){var t,r,l,a=o.node,d=n(o,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return i("ol",e({className:h.orderedList,style:null==Y?void 0:Y.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(o){o.node;var t=n(o,["node"]);return i("ul",e({className:h.unorderedList,style:null==Y?void 0:Y.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:h.tableWrapper},{children:i("table",e({className:h.table,style:null==Y?void 0:Y.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(F,{node:e,children:o,customStyles:Y})},td:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(M.Provider,e({value:!0},{children:i("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(M.Provider,e({value:!0},{children:i("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(o){var t;o.node;var r=n(o,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return i(j,e({},r,{customStyles:null==Y?void 0:Y.recommendationBlock,label:l}))},a:function(e){var o,t,r;e.inline;var l=e.children;e.node;var a=n(e,["inline","children","node"]),d=v(M)||"true"==(null==a?void 0:a.table),c="".concat(null==a?void 0:a.href),s=null===(o=c.split("$"))||void 0===o?void 0:o[0],u=null===(t=c.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===s){var g=(null!==(r=G?en:wn)&&void 0!==r?r:[]).find(function(n){return n.id.toString()===decodeURIComponent(u)}),p=Rn.includes(u);if(g){if(d)return i(H,{aiReason:g,customStyle:null==Y?void 0:Y.tableAiReasoning,customIcons:An,isHighConfidence:g.relevance_score>=k});var h=Qn(l),m="source"!==h.trim().toLowerCase();return i(N,{aiReason:g,isSourceHasHighlight:p,inlineLabel:h,isInlineCitation:m,customIcons:An,customStyles:{aiReasoningContent:null==Y?void 0:Y.aiReasoningContent,aiReasoningAccordion:null==Y?void 0:Y.aiReasoningAccordion,aiReasoningMarkdown:null==Y?void 0:Y.aiReasoningMarkdown,aiReasoningPill:null==Y?void 0:Y.aiReasoningPill,webCitation:null==Y?void 0:Y.webCitation,stormeeCitation:null==Y?void 0:Y.stormeeCitation,waveformCitation:null==Y?void 0:Y.waveformCitation,imageCitation:null==Y?void 0:Y.imageCitation,fileCitation:null==Y?void 0:Y.fileCitation,appModCitation:null==Y?void 0:Y.appModCitation,rcaCitation:null==Y?void 0:Y.rcaCitation,readFileCitation:null==Y?void 0:Y.readFileCitation,loadingCitations:null==Y?void 0:Y.loadingCitations,chatCitation:null==Y?void 0:Y.chatCitation,bigEnoughCitation:null==Y?void 0:Y.bigEnoughCitation}})}}return null},code:function(o){o.inline;var t=o.children,r=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?i("div",{children:i("code",e({className:h.blockCode,style:null==Y?void 0:Y.code},{children:t}))}):i("code",e({className:h.inlineCode,style:null==Y?void 0:Y.code},{children:t}))},learned:function(n){var o=n.children;return i(C,e({title:o,placement:"top"},{children:i(f,{size:16,className:h.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var i=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(i).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?i(n.props.children):""};e=i(n.children)}}catch(i){console.error("Error decoding generated code:",i),e=String(n.children)}return e}(o);return i(S,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==Y?void 0:Y.generatedCodePill,content:null==Y?void 0:Y.generatedCodeContent}})},updatedsegment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column),u=function(n){if(!n["data-raw"])return null;try{return decodeURIComponent(atob(n["data-raw"]))}catch(n){return console.error("Error decoding segment raw content:",n),null}}(c),v=i("div",u?{dangerouslySetInnerHTML:{__html:y.sanitize(u)}}:{children:d});return i(T,{id:s,node:a,children:v,props:c,segmentComponentConfig:Nn,customStyles:Y,customIcons:Z,extractText:Qn,isUpdatedSegment:!0})},segment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:Nn,customStyles:Y,customIcons:Z,extractText:Qn})}}},[zn,dn,wn,on,Tn,G,x,Z,In,Rn,Y,Nn,Fn,Gn]);return u(function(){if(pn.current){if(In.length){var n;if(0===Rn.length||sn)requestAnimationFrame(function(){Un([In[xn].replace(/\*/g,"")])});else{var e=pn.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Un([In[xn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}En()}},[In,Rn,xn,sn]),i(P.Provider,e({value:{expandedInfo:Mn,setExpanded:On,reasonToRow:$n}},{children:t("div",e({ref:pn,className:"".concat(h.container," ").concat("approving"!==z?h.wrapper:""," ").concat(X||""),style:null==Y?void 0:Y.container},{children:[B?i(_,{children:i(g,e({components:Xn,rehypePlugins:[p]},{children:Kn}))}):E,Vn>0&&vn&&i("div",e({className:h.confidenceScoreContainer,style:null==Y?void 0:Y.confidenceScoreContainer},{children:t("span",e({className:h.confidenceScore,style:null==Y?void 0:Y.confidenceScore},{children:[i(A,{size:14,color:(null==Y?void 0:Y.confidenceScoreIconColor)||"#166534"}),Vn,"%"]}))})),K&&i("div",e({className:h.citationLoader,style:null==Y?void 0:Y.citationLoaderContainer},{children:i(b,{customStyles:{container:null==Y?void 0:Y.citationLoadingContainer,icon:null==Y?void 0:Y.citationLoadingIcon,text:null==Y?void 0:Y.citationLoadingText}})})),V&&i("div",e({style:e({},null===(R=null==Y?void 0:Y.attachedContext)||void 0===R?void 0:R.wrapper),className:"flex mt-5"},{children:i(U,{customStyles:null==Y?void 0:Y.attachedContext,variant:nn})}))]}))}))};export{z as default,q as splitNestedDiffNodes};
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -116,6 +116,10 @@ interface UserStoryWithCitationsProps {
116
116
  };
117
117
  CDNeededInChip?: boolean;
118
118
  }
119
+ export declare function splitNestedDiffNodes(children: React.ReactNode, nestedTagNames: string[]): {
120
+ cleanedChildren: React.ReactNode;
121
+ extractedNodes: React.ReactNode[];
122
+ };
119
123
  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 }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
120
124
  export default UserStoryWithCitations;
121
125
  //# sourceMappingURL=UserStoryWithCitation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;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CAAC;QACpE,wBAAwB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;QAC5F,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,CAAA;CAEzB;AA+XD,QAAA,MAAM,sBAAsB,6YAgCzB,2BAA2B,4CAsqB7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;AAW5G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC7Y,OAA+B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AASzI,OAAwB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AA2BlE,MAAM,WAAW,iCAAiC;IAChD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACxC,aAAa,CAAC,EAAE,KAAK,CAAC,a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EAAE,YAAY,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,GAAG,CAAC;IAKzB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAE1C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC,aAAa,CAAC,EAAE;QACd,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,UAAU,EAAE,CAAC;QAC3B,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACpE,wBAAwB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;QAC5F,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,CAAA;CAEzB;AAkWD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,cAAc,EAAE,MAAM,EAAE;;;EAoEzB;AAED,QAAA,MAAM,sBAAsB,6YAgCzB,2BAA2B,4CAsqB7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.215",
3
+ "version": "0.0.216",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",