@e-llm-studio/requirement-ai 0.0.31 → 0.0.32

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"),i=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),a=require("./CustomChatCrRedirection.module.css.js"),l=require("../ai-reasoning/AiReasoningCitationContent.js"),t=require("../../icons/CognitiveDecision.js");exports.CustomChatCrRedirection=function(o){var r=o.isCompleted,d=o.mode,c=o.msg,u=o.type,g=o.id,v=o.aiReason,_=o.text,p=o.headerText,f=o.decisionStrength;o.statusUi,o.panelRef;var x=o.onHandleSend,h=o.onRedirectClick,m=o.gapType,j=o.isGenerating,y=void 0!==j&&j,C=o.customStyles,b=o.customIcons,N=n.useState(!1),D=N[0],S=N[1];console.log("testing::reasoning",v);var I=(null==b?void 0:b.highConfidence)||i.jsx(t.default,{}),R=function(){"cra"===d?null==x||x("Discuss ambiguities on ".concat(_)):null==x||x("Deep Dive into ".concat(m," ").concat(p,": ").concat(_))};return console.log("testing::aiReasoning",v),i.jsxs("div",e.__assign({className:[a.default.outerWrapper,y?a.default.outerWrapperDisabled:""].join(" "),style:e.__assign(e.__assign({},null==C?void 0:C.redirectionOuterWrapper),y?null==C?void 0:C.redirectionOuterWrapperDisabled:{})},{children:[i.jsxs("div",e.__assign({className:[a.default.card,y?a.default.cardDisabled:a.default.cardInteractive].join(" "),style:e.__assign(e.__assign({},null==C?void 0:C.redirectionCard),y?null==C?void 0:C.redirectionCardDisabled:null==C?void 0:C.redirectionCardInteractive)},{children:[i.jsxs("div",e.__assign({className:a.default.leftSide,style:null==C?void 0:C.redirectionLeftSide},{children:[i.jsxs("span",e.__assign({className:a.default.textBlock,style:null==C?void 0:C.redirectionTextBlock},{children:[p&&i.jsxs("span",e.__assign({className:a.default.headerText,style:null==C?void 0:C.redirectionHeaderText},{children:[p,_?" ":""]})),_]})),i.jsxs("span",e.__assign({onClick:function(e){e.stopPropagation(),y||S(!D)},className:[a.default.reasoningToggle,y?a.default.reasoningToggleDisabled:a.default.reasoningToggleActive].join(" "),style:e.__assign(e.__assign({},null==C?void 0:C.reasoningToggle),y?null==C?void 0:C.reasoningToggleDisabled:null==C?void 0:C.reasoningToggleActive)},{children:[I,D?i.jsx(s.ChevronUp,{className:a.default.chevronIcon,style:null==C?void 0:C.chevronIcon}):i.jsx(s.ChevronDown,{className:a.default.chevronIcon,style:null==C?void 0:C.chevronIcon})]}))]})),r?i.jsx("div",e.__assign({className:a.default.completeTickWrapper,style:null==C?void 0:C.completeTickWrapper},{children:i.jsx(s.Check,{color:(null==C?void 0:C.checkColor)||"green"})})):i.jsxs(i.Fragment,{children:["risk-gap"===d&&i.jsxs("div",e.__assign({className:a.default.rightSide,style:null==C?void 0:C.redirectionRightSide},{children:[i.jsx("button",e.__assign({disabled:y,className:[a.default.fixButton,y?a.default.fixButtonDisabled:""].join(" "),style:e.__assign(e.__assign({},null==C?void 0:C.redirectionFixButton),y?null==C?void 0:C.fixButtonDisabled:{}),onClick:function(e){e.stopPropagation(),y||R()}},{children:"Fix"})),i.jsx(s.SquareArrowOutUpRight,{onClick:y?void 0:function(){y||null==h||h({type:u,id:g,aiReason:v,msg:c,meta:{headerText:p,decisionStrength:f,text:_}})},size:18,className:[y?a.default.redirectIconDisabled:a.default.redirectIcon].join(" "),style:e.__assign({},y?null==C?void 0:C.redirectIconDisabled:null==C?void 0:C.redirectIcon)})]})),"cra"===d&&i.jsx("div",e.__assign({className:a.default.rightSide,style:null==C?void 0:C.redirectionRightSide},{children:y?i.jsx("div",e.__assign({className:a.default.loaderWrapper,style:null==C?void 0:C.loaderWrapper},{children:i.jsx(s.Loader2,{size:16,className:a.default.loaderIcon,style:e.__assign({animation:"spin 1s linear infinite"},null==C?void 0:C.loaderIcon)})})):i.jsx("button",e.__assign({className:[a.default.clarifyButton].join(" "),style:null==C?void 0:C.redirectionClarifyButton,onClick:function(e){e.stopPropagation(),R()}},{children:"Clarify"}))}))]})]})),D&&i.jsx(l.default,{aiReason:{id:"1",reason:v.Reasoning||"",gap:v.Gap||"",relevance_score:Number(v.Confidence_score),explanation:v.explanation||""},onSelectProceed:R,customStyles:null==C?void 0:C.aiReasoningStyles,customIcons:b})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),a=require("./CustomChatCrRedirection.module.css.js"),l=require("../ai-reasoning/AiReasoningCitationContent.js"),o=require("../../icons/CognitiveDecision.js");exports.CustomChatCrRedirection=function(t){var r=t.processItemId,d=t.isCompleted,c=t.mode,u=t.msg,g=t.type,v=t.id,_=t.aiReason,p=t.text,f=t.headerText,x=t.decisionStrength;t.statusUi,t.panelRef;var m=t.onHandleSend,h=t.onRedirectClick,j=t.gapType,y=t.isGenerating,C=void 0!==y&&y,b=t.customStyles,N=t.customIcons,I=n.useState(!1),D=I[0],S=I[1];console.log("testing::reasoning",_);var R=(null==N?void 0:N.highConfidence)||i.jsx(o.default,{}),T=function(){"cra"===c?null==m||m("Discuss ambiguities on ".concat(p),v):null==m||m("Deep Dive into ".concat(j," ").concat(f,": ").concat(p),v)};return console.log("testing::aiReasoning",_),i.jsxs("div",e.__assign({className:[a.default.outerWrapper,C?a.default.outerWrapperDisabled:""].join(" "),style:e.__assign(e.__assign({},null==b?void 0:b.redirectionOuterWrapper),C?null==b?void 0:b.redirectionOuterWrapperDisabled:{})},{children:[i.jsxs("div",e.__assign({className:[a.default.card,C?a.default.cardDisabled:a.default.cardInteractive].join(" "),style:e.__assign(e.__assign({},null==b?void 0:b.redirectionCard),C?null==b?void 0:b.redirectionCardDisabled:null==b?void 0:b.redirectionCardInteractive)},{children:[i.jsxs("div",e.__assign({className:a.default.leftSide,style:null==b?void 0:b.redirectionLeftSide},{children:[i.jsxs("span",e.__assign({className:a.default.textBlock,style:null==b?void 0:b.redirectionTextBlock},{children:[f&&i.jsxs("span",e.__assign({className:a.default.headerText,style:null==b?void 0:b.redirectionHeaderText},{children:[f,p?" ":""]})),p]})),i.jsxs("span",e.__assign({onClick:function(e){e.stopPropagation(),C||S(!D)},className:[a.default.reasoningToggle,C?a.default.reasoningToggleDisabled:a.default.reasoningToggleActive].join(" "),style:e.__assign(e.__assign({},null==b?void 0:b.reasoningToggle),C?null==b?void 0:b.reasoningToggleDisabled:null==b?void 0:b.reasoningToggleActive)},{children:[R,D?i.jsx(s.ChevronUp,{className:a.default.chevronIcon,style:null==b?void 0:b.chevronIcon}):i.jsx(s.ChevronDown,{className:a.default.chevronIcon,style:null==b?void 0:b.chevronIcon})]}))]})),d?i.jsx("div",e.__assign({className:a.default.completeTickWrapper,style:null==b?void 0:b.completeTickWrapper},{children:i.jsx(s.Check,{color:(null==b?void 0:b.checkColor)||"green"})})):i.jsxs(i.Fragment,{children:["risk-gap"===c&&i.jsxs("div",e.__assign({className:a.default.rightSide,style:null==b?void 0:b.redirectionRightSide},{children:[i.jsx("button",e.__assign({disabled:C,className:[a.default.fixButton,C?a.default.fixButtonDisabled:""].join(" "),style:e.__assign(e.__assign({},null==b?void 0:b.redirectionFixButton),C?null==b?void 0:b.fixButtonDisabled:{}),onClick:function(e){e.stopPropagation(),C||T()}},{children:"Fix"})),i.jsx(s.SquareArrowOutUpRight,{onClick:C?void 0:function(){C||null==h||h({type:g,id:v,aiReason:_,msg:u,meta:{headerText:f,decisionStrength:x,text:p}})},size:18,className:[C?a.default.redirectIconDisabled:a.default.redirectIcon].join(" "),style:e.__assign({},C?null==b?void 0:b.redirectIconDisabled:null==b?void 0:b.redirectIcon)})]})),"cra"===c&&i.jsx("div",e.__assign({className:a.default.rightSide,style:null==b?void 0:b.redirectionRightSide},{children:r===v?i.jsx("div",e.__assign({className:a.default.loaderWrapper,style:null==b?void 0:b.loaderWrapper},{children:i.jsx(s.Loader2,{size:16,className:a.default.loaderIcon,color:"grey",style:e.__assign({animation:"spin 1s linear infinite"},null==b?void 0:b.loaderIcon)})})):i.jsx("button",e.__assign({className:[a.default.clarifyButton].join(" "),style:e.__assign({color:C?"grey":""},null==b?void 0:b.redirectionClarifyButton),disabled:C,onClick:function(e){e.stopPropagation(),T()}},{children:"Clarify"}))}))]})]})),D&&i.jsx(l.default,{aiReason:{id:"1",reason:_.Reasoning||"",gap:_.Gap||"",relevance_score:Number(_.Confidence_score),explanation:_.explanation||""},onSelectProceed:T,customStyles:null==b?void 0:b.aiReasoningStyles,customIcons:N})]}))};
2
2
  //# sourceMappingURL=CustomChatCrRedirection.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("lodash"),n=require("./GapFilterContentWrapper.js"),i=require("./GapFilterItem.js"),a=require("./CustomChatCrRedirection.js"),l=require("./gapFilterSvgs.js"),c=require("./GapFilterBlock.module.css.js");require("react-markdown"),require("rehype-raw"),require("../RequirementAIWrapper/RequirementAIWrapper.js");var d=["critical","recommendation","warning"];function s(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function u(t){return r.Children.toArray(t).filter(function(e){return r.isValidElement(e)}).filter(function(e){var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(function(t){var r,o,n=t.props,i=n.children,a=e.__rest(n,["children"]),l={};Object.keys(a).forEach(function(e){e.startsWith("data-")||(l[e]=a[e])});var c,d,s=(c=a,d={},Object.keys(c).forEach(function(e){e.startsWith("data-")&&(d[e.replace(/^data-/,"")]=c[e])}),d),u=a["decision-strength"],g=a["data-is-completed"];return{text:i,headerText:a.headertext,tags:a.tags,dataAttrs:s,decisionStrength:u,attrs:l,type:"gapfilteritem"===t.type?"gapfilteritem":"crredirection",score:a.score,isCompleted:g,pendingCount:a.pendingcount,question:a.question,components:a.components,showFix:null!==(r=a.showfix)&&void 0!==r&&r,showRedirect:null!==(o=a.showredirect)&&void 0!==o&&o}})}var g={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}};exports.GapFilterBlock=function(p){var m=p.mode;p.node;var f=p.children,C=p.type,v=p.supportedmodes,b=void 0===v?"":v,y=p["decision-strength"],h=void 0===y?"":y,x=p.pendingdata,S=void 0===x?"":x,I=p.isGeneratingGap,j=void 0!==I&&I,k=p.selectedGapItemId,_=void 0===k?"":k,F=p.onItemSelect,R=p.onHandleSend,A=p.onModeAction,B=p.msg,G=p.panelRef,T=p.getAccordionState,q=p.setAccordionState,w=p.registerGapFilterBlockCount,N=p.getShowGapReviewButtonType,E=p.customStyles,W=p.customIcons,D=C,z=s(h),M=r.useState(function(){var e,t=null!==(e=null==T?void 0:T(D))&&void 0!==e?e:"";return"critical"!==D||t?t:D}),U=M[0],H=M[1],O=function(e){H(e),null==q||q(D,e)},L=u(f),J=r.useMemo(function(){return L.reduce(function(e,t){var r,o,n,i=null!==(r=t.tags)&&void 0!==r?r:"Uncategorized",a=null!==(n=null===(o=t.dataAttrs)||void 0===o?void 0:o.categoryid)&&void 0!==n?n:"1",l=e.find(function(e){return e.categoryName===i});return l||(l={categoryName:i,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[])},[L]),P={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:t.jsx(l.SirenIcon,{}),label:"risk-gap"===m?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:t.jsx(l.WarningIcon,{}),label:"risk-gap"===m?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:t.jsx(l.SupportIcon,{}),label:"risk-gap"===m?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:t.jsx(l.SupportIcon,{}),label:"",decisionStrength:""}},V=r.useMemo(function(){return e=D,d.includes(e)?{labelColor:P[D].labelColor,badgeBackgroundColor:P[D].badgeBackgroundColor,badgeTextColor:P[D].badgeTextColor,label:P[D].label,decisionStrength:z||P[D].decisionStrength}:{labelColor:P.default.labelColor,badgeBackgroundColor:P.default.badgeBackgroundColor,badgeTextColor:P.default.badgeTextColor,label:o.capitalize(D),decisionStrength:z||""};var e},[D,z]);r.useEffect(function(){null==w||w(D,L.length)},[D,L.length,w]);var $=function(t,r,o){if(void 0===o&&(o={}),!j){var n="".concat(J[t].categoryId,"-").concat(r);null==F||F(n);var i=e.__assign(e.__assign({},J[t].items[r].dataAttrs),o);null==A||A(b,i)}};return N&&N(),t.jsx(n.GapFilterContentWrapper,e.__assign({mode:m,type:D,config:V,count:L.length,handleReviewClick:function(){L.length>0&&O(D)},openAccordion:U,onAccordionChange:function(e){O(U===e?"":e)},shouldShowReviewButton:!1,pendingData:S,customStyles:E},{children:J.map(function(r,o){return t.jsxs("div",e.__assign({className:c.default.categoryGroup,style:null==E?void 0:E.categoryGroup},{children:["gapfilteritem"===r.type&&"Uncategorized"!==r.categoryName&&t.jsx("p",e.__assign({className:c.default.categoryLabel,style:null==E?void 0:E.categoryLabel},{children:r.categoryName})),r.items.map(function(n,l){var d,s,u,p,f=n.attrs||{},C=null===(d=n.dataAttrs)||void 0===d?void 0:d["cognitive-reasoning"],v=f.id||(null===(s=n.dataAttrs)||void 0===s?void 0:s.id)||"",b="I"===v[0]?"UI_REF":"CHAT_REF",y=null===(u=null==B?void 0:B.contextAwareAgentReasoning)||void 0===u?void 0:u[C],h=n.isCompleted;return"gapfilteritem"===n.type?t.jsx("div",e.__assign({className:[c.default.gapFilterItemWrapper,"Uncategorized"!==r.categoryName?c.default.gapFilterItemWrapperIndented:""].join(" "),style:null==E?void 0:E.blockContainer},{children:t.jsx(i.GapFilterItem,{isCompleted:h,mode:m,index:l,isSelected:_==="".concat(r.categoryId,"-").concat(l),onClick:function(){return $(o,l)},onFixClick:function(){return $(o,l,{triggerFrom:"fix"})},onRedirect:function(){return $(o,l,{triggerFrom:"redirect"})},item:n,isGenerating:j,aiReason:y,panelRef:null!=G?G:{current:null},id:C,customStyles:E,customIcons:W})}),l):(console.log("testing::reasoningId",n.type),t.jsx("div",e.__assign({className:c.default.crRedirectionGroup,style:null==E?void 0:E.crRedirectionGroup},{children:t.jsx("div",e.__assign({className:c.default.crRedirectionInner,style:null==E?void 0:E.crRedirectionInner},{children:t.jsx(a.CustomChatCrRedirection,{isCompleted:h,mode:m,msg:B,type:b,text:n.text,headerText:n.headerText,decisionStrength:n.decisionStrength,id:v,gapType:D,onHandleSend:R,isGenerating:j,aiReason:y,statusUi:null!==(p=g[D])&&void 0!==p?p:g.recommendation,panelRef:null!=G?G:{current:null},customStyles:E,customIcons:W})}))}),l))})]}),"".concat(r.categoryName,"-").concat(o))})}))},exports.normalizeDecisionStrength=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("lodash"),n=require("./GapFilterContentWrapper.js"),i=require("./GapFilterItem.js"),a=require("./CustomChatCrRedirection.js"),l=require("./gapFilterSvgs.js"),c=require("./GapFilterBlock.module.css.js");require("react-markdown"),require("rehype-raw"),require("../RequirementAIWrapper/RequirementAIWrapper.js");var d=["critical","recommendation","warning"];function s(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function u(t){return r.Children.toArray(t).filter(function(e){return r.isValidElement(e)}).filter(function(e){var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(function(t){var r,o,n=t.props,i=n.children,a=e.__rest(n,["children"]),l={};Object.keys(a).forEach(function(e){e.startsWith("data-")||(l[e]=a[e])});var c,d,s=(c=a,d={},Object.keys(c).forEach(function(e){e.startsWith("data-")&&(d[e.replace(/^data-/,"")]=c[e])}),d),u=a["decision-strength"],g=a["data-is-completed"];return{text:i,headerText:a.headertext,tags:a.tags,dataAttrs:s,decisionStrength:u,attrs:l,type:"gapfilteritem"===t.type?"gapfilteritem":"crredirection",score:a.score,isCompleted:g,pendingCount:a.pendingcount,question:a.question,components:a.components,showFix:null!==(r=a.showfix)&&void 0!==r&&r,showRedirect:null!==(o=a.showredirect)&&void 0!==o&&o}})}var g={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}};exports.GapFilterBlock=function(p){var m=p.processItemId,f=p.mode;p.node;var C=p.children,v=p.type,b=p.supportedmodes,h=void 0===b?"":b,y=p["decision-strength"],x=void 0===y?"":y,S=p.pendingdata,I=void 0===S?"":S,j=p.isGeneratingGap,k=void 0!==j&&j,_=p.selectedGapItemId,F=void 0===_?"":_,R=p.onItemSelect,A=p.onHandleSend,B=p.onModeAction,G=p.msg,T=p.panelRef,q=p.getAccordionState,w=p.setAccordionState,N=p.registerGapFilterBlockCount,E=p.getShowGapReviewButtonType,W=p.customStyles,D=p.customIcons,z=v,M=s(x),U=r.useState(function(){var e,t=null!==(e=null==q?void 0:q(z))&&void 0!==e?e:"";return"critical"!==z||t?t:z}),H=U[0],O=U[1],L=function(e){O(e),null==w||w(z,e)},J=u(C),P=r.useMemo(function(){return J.reduce(function(e,t){var r,o,n,i=null!==(r=t.tags)&&void 0!==r?r:"Uncategorized",a=null!==(n=null===(o=t.dataAttrs)||void 0===o?void 0:o.categoryid)&&void 0!==n?n:"1",l=e.find(function(e){return e.categoryName===i});return l||(l={categoryName:i,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[])},[J]),V={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:t.jsx(l.SirenIcon,{}),label:"risk-gap"===f?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:t.jsx(l.WarningIcon,{}),label:"risk-gap"===f?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:t.jsx(l.SupportIcon,{}),label:"risk-gap"===f?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:t.jsx(l.SupportIcon,{}),label:"",decisionStrength:""}},$=r.useMemo(function(){return e=z,d.includes(e)?{labelColor:V[z].labelColor,badgeBackgroundColor:V[z].badgeBackgroundColor,badgeTextColor:V[z].badgeTextColor,label:V[z].label,decisionStrength:M||V[z].decisionStrength}:{labelColor:V.default.labelColor,badgeBackgroundColor:V.default.badgeBackgroundColor,badgeTextColor:V.default.badgeTextColor,label:o.capitalize(z),decisionStrength:M||""};var e},[z,M]);r.useEffect(function(){null==N||N(z,J.length)},[z,J.length,N]);var K=function(t,r,o){if(void 0===o&&(o={}),!k){var n="".concat(P[t].categoryId,"-").concat(r);null==R||R(n);var i=e.__assign(e.__assign({},P[t].items[r].dataAttrs),o);null==B||B(h,i)}};return E&&E(),t.jsx(n.GapFilterContentWrapper,e.__assign({mode:f,type:z,config:$,count:J.length,handleReviewClick:function(){J.length>0&&L(z)},openAccordion:H,onAccordionChange:function(e){L(H===e?"":e)},shouldShowReviewButton:!1,pendingData:I,customStyles:W},{children:P.map(function(r,o){return t.jsxs("div",e.__assign({className:c.default.categoryGroup,style:null==W?void 0:W.categoryGroup},{children:["gapfilteritem"===r.type&&"Uncategorized"!==r.categoryName&&t.jsx("p",e.__assign({className:c.default.categoryLabel,style:null==W?void 0:W.categoryLabel},{children:r.categoryName})),r.items.map(function(n,l){var d,s,u,p,C=n.attrs||{},v=null===(d=n.dataAttrs)||void 0===d?void 0:d["cognitive-reasoning"],b=C.id||(null===(s=n.dataAttrs)||void 0===s?void 0:s.id)||"",h="I"===b[0]?"UI_REF":"CHAT_REF",y=null===(u=null==G?void 0:G.contextAwareAgentReasoning)||void 0===u?void 0:u[v],x=n.isCompleted;return"gapfilteritem"===n.type?t.jsx("div",e.__assign({className:[c.default.gapFilterItemWrapper,"Uncategorized"!==r.categoryName?c.default.gapFilterItemWrapperIndented:""].join(" "),style:null==W?void 0:W.blockContainer},{children:t.jsx(i.GapFilterItem,{isCompleted:x,mode:f,index:l,isSelected:F==="".concat(r.categoryId,"-").concat(l),onClick:function(){return K(o,l)},onFixClick:function(){return K(o,l,{triggerFrom:"fix"})},onRedirect:function(){return K(o,l,{triggerFrom:"redirect"})},item:n,isGenerating:k,aiReason:y,panelRef:null!=T?T:{current:null},id:v,customStyles:W,customIcons:D})}),l):t.jsx("div",e.__assign({className:c.default.crRedirectionGroup,style:null==W?void 0:W.crRedirectionGroup},{children:t.jsx("div",e.__assign({className:c.default.crRedirectionInner,style:null==W?void 0:W.crRedirectionInner},{children:t.jsx(a.CustomChatCrRedirection,{processItemId:m,isCompleted:x,mode:f,msg:G,type:h,text:n.text,headerText:n.headerText,decisionStrength:n.decisionStrength,id:b,gapType:z,onHandleSend:A,isGenerating:k,aiReason:y,statusUi:null!==(p=g[z])&&void 0!==p?p:g.recommendation,panelRef:null!=T?T:{current:null},customStyles:W,customIcons:D})}))}),l)})]}),"".concat(r.categoryName,"-").concat(o))})}))},exports.normalizeDecisionStrength=s;
2
2
  //# sourceMappingURL=GapFilterBlock.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as i,jsxs as n,Fragment as o}from"react/jsx-runtime";import{useState as l}from"react";import{ChevronUp as t,ChevronDown as r,Check as a,SquareArrowOutUpRight as s,Loader2 as c}from"lucide-react";import d from"./CustomChatCrRedirection.module.css.js";import u from"../ai-reasoning/AiReasoningCitationContent.js";import p from"../../icons/CognitiveDecision.js";function g(g){var m=g.isCompleted,v=g.mode,h=g.msg,f=g.type,y=g.id,C=g.aiReason,x=g.text,b=g.headerText,N=g.decisionStrength;g.statusUi,g.panelRef;var D=g.onHandleSend,T=g.onRedirectClick,S=g.gapType,I=g.isGenerating,R=void 0!==I&&I,k=g.customStyles,j=g.customIcons,B=l(!1),W=B[0],P=B[1];console.log("testing::reasoning",C);var A=(null==j?void 0:j.highConfidence)||i(p,{}),z=function(){"cra"===v?null==D||D("Discuss ambiguities on ".concat(x)):null==D||D("Deep Dive into ".concat(S," ").concat(b,": ").concat(x))};return console.log("testing::aiReasoning",C),n("div",e({className:[d.outerWrapper,R?d.outerWrapperDisabled:""].join(" "),style:e(e({},null==k?void 0:k.redirectionOuterWrapper),R?null==k?void 0:k.redirectionOuterWrapperDisabled:{})},{children:[n("div",e({className:[d.card,R?d.cardDisabled:d.cardInteractive].join(" "),style:e(e({},null==k?void 0:k.redirectionCard),R?null==k?void 0:k.redirectionCardDisabled:null==k?void 0:k.redirectionCardInteractive)},{children:[n("div",e({className:d.leftSide,style:null==k?void 0:k.redirectionLeftSide},{children:[n("span",e({className:d.textBlock,style:null==k?void 0:k.redirectionTextBlock},{children:[b&&n("span",e({className:d.headerText,style:null==k?void 0:k.redirectionHeaderText},{children:[b,x?" ":""]})),x]})),n("span",e({onClick:function(e){e.stopPropagation(),R||P(!W)},className:[d.reasoningToggle,R?d.reasoningToggleDisabled:d.reasoningToggleActive].join(" "),style:e(e({},null==k?void 0:k.reasoningToggle),R?null==k?void 0:k.reasoningToggleDisabled:null==k?void 0:k.reasoningToggleActive)},{children:[A,i(W?t:r,{className:d.chevronIcon,style:null==k?void 0:k.chevronIcon})]}))]})),m?i("div",e({className:d.completeTickWrapper,style:null==k?void 0:k.completeTickWrapper},{children:i(a,{color:(null==k?void 0:k.checkColor)||"green"})})):n(o,{children:["risk-gap"===v&&n("div",e({className:d.rightSide,style:null==k?void 0:k.redirectionRightSide},{children:[i("button",e({disabled:R,className:[d.fixButton,R?d.fixButtonDisabled:""].join(" "),style:e(e({},null==k?void 0:k.redirectionFixButton),R?null==k?void 0:k.fixButtonDisabled:{}),onClick:function(e){e.stopPropagation(),R||z()}},{children:"Fix"})),i(s,{onClick:R?void 0:function(){R||null==T||T({type:f,id:y,aiReason:C,msg:h,meta:{headerText:b,decisionStrength:N,text:x}})},size:18,className:[R?d.redirectIconDisabled:d.redirectIcon].join(" "),style:e({},R?null==k?void 0:k.redirectIconDisabled:null==k?void 0:k.redirectIcon)})]})),"cra"===v&&i("div",e({className:d.rightSide,style:null==k?void 0:k.redirectionRightSide},{children:R?i("div",e({className:d.loaderWrapper,style:null==k?void 0:k.loaderWrapper},{children:i(c,{size:16,className:d.loaderIcon,style:e({animation:"spin 1s linear infinite"},null==k?void 0:k.loaderIcon)})})):i("button",e({className:[d.clarifyButton].join(" "),style:null==k?void 0:k.redirectionClarifyButton,onClick:function(e){e.stopPropagation(),z()}},{children:"Clarify"}))}))]})]})),W&&i(u,{aiReason:{id:"1",reason:C.Reasoning||"",gap:C.Gap||"",relevance_score:Number(C.Confidence_score),explanation:C.explanation||""},onSelectProceed:z,customStyles:null==k?void 0:k.aiReasoningStyles,customIcons:j})]}))}export{g as CustomChatCrRedirection};
1
+ import{__assign as e}from"tslib";import{jsx as i,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as l}from"react";import{ChevronUp as r,ChevronDown as t,Check as a,SquareArrowOutUpRight as s,Loader2 as c}from"lucide-react";import d from"./CustomChatCrRedirection.module.css.js";import u from"../ai-reasoning/AiReasoningCitationContent.js";import g from"../../icons/CognitiveDecision.js";function p(p){var m=p.processItemId,v=p.isCompleted,h=p.mode,y=p.msg,f=p.type,C=p.id,b=p.aiReason,x=p.text,N=p.headerText,D=p.decisionStrength;p.statusUi,p.panelRef;var I=p.onHandleSend,T=p.onRedirectClick,S=p.gapType,R=p.isGenerating,k=void 0!==R&&R,j=p.customStyles,B=p.customIcons,W=l(!1),P=W[0],A=W[1];console.log("testing::reasoning",b);var z=(null==B?void 0:B.highConfidence)||i(g,{}),F=function(){"cra"===h?null==I||I("Discuss ambiguities on ".concat(x),C):null==I||I("Deep Dive into ".concat(S," ").concat(N,": ").concat(x),C)};return console.log("testing::aiReasoning",b),o("div",e({className:[d.outerWrapper,k?d.outerWrapperDisabled:""].join(" "),style:e(e({},null==j?void 0:j.redirectionOuterWrapper),k?null==j?void 0:j.redirectionOuterWrapperDisabled:{})},{children:[o("div",e({className:[d.card,k?d.cardDisabled:d.cardInteractive].join(" "),style:e(e({},null==j?void 0:j.redirectionCard),k?null==j?void 0:j.redirectionCardDisabled:null==j?void 0:j.redirectionCardInteractive)},{children:[o("div",e({className:d.leftSide,style:null==j?void 0:j.redirectionLeftSide},{children:[o("span",e({className:d.textBlock,style:null==j?void 0:j.redirectionTextBlock},{children:[N&&o("span",e({className:d.headerText,style:null==j?void 0:j.redirectionHeaderText},{children:[N,x?" ":""]})),x]})),o("span",e({onClick:function(e){e.stopPropagation(),k||A(!P)},className:[d.reasoningToggle,k?d.reasoningToggleDisabled:d.reasoningToggleActive].join(" "),style:e(e({},null==j?void 0:j.reasoningToggle),k?null==j?void 0:j.reasoningToggleDisabled:null==j?void 0:j.reasoningToggleActive)},{children:[z,i(P?r:t,{className:d.chevronIcon,style:null==j?void 0:j.chevronIcon})]}))]})),v?i("div",e({className:d.completeTickWrapper,style:null==j?void 0:j.completeTickWrapper},{children:i(a,{color:(null==j?void 0:j.checkColor)||"green"})})):o(n,{children:["risk-gap"===h&&o("div",e({className:d.rightSide,style:null==j?void 0:j.redirectionRightSide},{children:[i("button",e({disabled:k,className:[d.fixButton,k?d.fixButtonDisabled:""].join(" "),style:e(e({},null==j?void 0:j.redirectionFixButton),k?null==j?void 0:j.fixButtonDisabled:{}),onClick:function(e){e.stopPropagation(),k||F()}},{children:"Fix"})),i(s,{onClick:k?void 0:function(){k||null==T||T({type:f,id:C,aiReason:b,msg:y,meta:{headerText:N,decisionStrength:D,text:x}})},size:18,className:[k?d.redirectIconDisabled:d.redirectIcon].join(" "),style:e({},k?null==j?void 0:j.redirectIconDisabled:null==j?void 0:j.redirectIcon)})]})),"cra"===h&&i("div",e({className:d.rightSide,style:null==j?void 0:j.redirectionRightSide},{children:m===C?i("div",e({className:d.loaderWrapper,style:null==j?void 0:j.loaderWrapper},{children:i(c,{size:16,className:d.loaderIcon,color:"grey",style:e({animation:"spin 1s linear infinite"},null==j?void 0:j.loaderIcon)})})):i("button",e({className:[d.clarifyButton].join(" "),style:e({color:k?"grey":""},null==j?void 0:j.redirectionClarifyButton),disabled:k,onClick:function(e){e.stopPropagation(),F()}},{children:"Clarify"}))}))]})]})),P&&i(u,{aiReason:{id:"1",reason:b.Reasoning||"",gap:b.Gap||"",relevance_score:Number(b.Confidence_score),explanation:b.explanation||""},onSelectProceed:F,customStyles:null==j?void 0:j.aiReasoningStyles,customIcons:B})]}))}export{p as CustomChatCrRedirection};
2
2
  //# sourceMappingURL=CustomChatCrRedirection.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__rest as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as n,useMemo as i,useEffect as a,Children as l,isValidElement as c}from"react";import{capitalize as d}from"lodash";import{GapFilterContentWrapper as s}from"./GapFilterContentWrapper.js";import{GapFilterItem as g}from"./GapFilterItem.js";import{CustomChatCrRedirection as u}from"./CustomChatCrRedirection.js";import{SirenIcon as p,WarningIcon as m,SupportIcon as f}from"./gapFilterSvgs.js";import b from"./GapFilterBlock.module.css.js";import"react-markdown";import"rehype-raw";import"../RequirementAIWrapper/RequirementAIWrapper.js";var v=["critical","recommendation","warning"];function C(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function y(e){return l.toArray(e).filter(function(e){return c(e)}).filter(function(e){var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(function(e){var o,r,n=e.props,i=n.children,a=t(n,["children"]),l={};Object.keys(a).forEach(function(e){e.startsWith("data-")||(l[e]=a[e])});var c,d,s=(c=a,d={},Object.keys(c).forEach(function(e){e.startsWith("data-")&&(d[e.replace(/^data-/,"")]=c[e])}),d),g=a["decision-strength"],u=a["data-is-completed"];return{text:i,headerText:a.headertext,tags:a.tags,dataAttrs:s,decisionStrength:g,attrs:l,type:"gapfilteritem"===e.type?"gapfilteritem":"crredirection",score:a.score,isCompleted:u,pendingCount:a.pendingcount,question:a.question,components:a.components,showFix:null!==(o=a.showfix)&&void 0!==o&&o,showRedirect:null!==(r=a.showredirect)&&void 0!==r&&r}})}var h={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}},x=function(t){var l=t.mode;t.node;var c=t.children,x=t.type,S=t.supportedmodes,k=void 0===S?"":S,I=t["decision-strength"],R=void 0===I?"":I,A=t.pendingdata,F=void 0===A?"":A,B=t.isGeneratingGap,T=void 0!==B&&B,w=t.selectedGapItemId,G=void 0===w?"":w,N=t.onItemSelect,j=t.onHandleSend,E=t.onModeAction,W=t.msg,D=t.panelRef,U=t.getAccordionState,q=t.setAccordionState,z=t.registerGapFilterBlockCount,H=t.getShowGapReviewButtonType,L=t.customStyles,M=t.customIcons,O=x,_=C(R),J=n(function(){var e,t=null!==(e=null==U?void 0:U(O))&&void 0!==e?e:"";return"critical"!==O||t?t:O}),$=J[0],K=J[1],P=function(e){K(e),null==q||q(O,e)},Q=y(c),V=i(function(){return Q.reduce(function(e,t){var o,r,n,i=null!==(o=t.tags)&&void 0!==o?o:"Uncategorized",a=null!==(n=null===(r=t.dataAttrs)||void 0===r?void 0:r.categoryid)&&void 0!==n?n:"1",l=e.find(function(e){return e.categoryName===i});return l||(l={categoryName:i,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[])},[Q]),X={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:o(p,{}),label:"risk-gap"===l?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:o(m,{}),label:"risk-gap"===l?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:o(f,{}),label:"risk-gap"===l?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:o(f,{}),label:"",decisionStrength:""}},Y=i(function(){return e=O,v.includes(e)?{labelColor:X[O].labelColor,badgeBackgroundColor:X[O].badgeBackgroundColor,badgeTextColor:X[O].badgeTextColor,label:X[O].label,decisionStrength:_||X[O].decisionStrength}:{labelColor:X.default.labelColor,badgeBackgroundColor:X.default.badgeBackgroundColor,badgeTextColor:X.default.badgeTextColor,label:d(O),decisionStrength:_||""};var e},[O,_]);a(function(){null==z||z(O,Q.length)},[O,Q.length,z]);var Z=function(t,o,r){if(void 0===r&&(r={}),!T){var n="".concat(V[t].categoryId,"-").concat(o);null==N||N(n);var i=e(e({},V[t].items[o].dataAttrs),r);null==E||E(k,i)}};return H&&H(),o(s,e({mode:l,type:O,config:Y,count:Q.length,handleReviewClick:function(){Q.length>0&&P(O)},openAccordion:$,onAccordionChange:function(e){P($===e?"":e)},shouldShowReviewButton:!1,pendingData:F,customStyles:L},{children:V.map(function(t,n){return r("div",e({className:b.categoryGroup,style:null==L?void 0:L.categoryGroup},{children:["gapfilteritem"===t.type&&"Uncategorized"!==t.categoryName&&o("p",e({className:b.categoryLabel,style:null==L?void 0:L.categoryLabel},{children:t.categoryName})),t.items.map(function(r,i){var a,c,d,s,p=r.attrs||{},m=null===(a=r.dataAttrs)||void 0===a?void 0:a["cognitive-reasoning"],f=p.id||(null===(c=r.dataAttrs)||void 0===c?void 0:c.id)||"",v="I"===f[0]?"UI_REF":"CHAT_REF",C=null===(d=null==W?void 0:W.contextAwareAgentReasoning)||void 0===d?void 0:d[m],y=r.isCompleted;return"gapfilteritem"===r.type?o("div",e({className:[b.gapFilterItemWrapper,"Uncategorized"!==t.categoryName?b.gapFilterItemWrapperIndented:""].join(" "),style:null==L?void 0:L.blockContainer},{children:o(g,{isCompleted:y,mode:l,index:i,isSelected:G==="".concat(t.categoryId,"-").concat(i),onClick:function(){return Z(n,i)},onFixClick:function(){return Z(n,i,{triggerFrom:"fix"})},onRedirect:function(){return Z(n,i,{triggerFrom:"redirect"})},item:r,isGenerating:T,aiReason:C,panelRef:null!=D?D:{current:null},id:m,customStyles:L,customIcons:M})}),i):(console.log("testing::reasoningId",r.type),o("div",e({className:b.crRedirectionGroup,style:null==L?void 0:L.crRedirectionGroup},{children:o("div",e({className:b.crRedirectionInner,style:null==L?void 0:L.crRedirectionInner},{children:o(u,{isCompleted:y,mode:l,msg:W,type:v,text:r.text,headerText:r.headerText,decisionStrength:r.decisionStrength,id:f,gapType:O,onHandleSend:j,isGenerating:T,aiReason:C,statusUi:null!==(s=h[O])&&void 0!==s?s:h.recommendation,panelRef:null!=D?D:{current:null},customStyles:L,customIcons:M})}))}),i))})]}),"".concat(t.categoryName,"-").concat(n))})}))};export{x as GapFilterBlock,C as normalizeDecisionStrength};
1
+ import{__assign as e,__rest as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as n,useMemo as i,useEffect as a,Children as l,isValidElement as c}from"react";import{capitalize as d}from"lodash";import{GapFilterContentWrapper as s}from"./GapFilterContentWrapper.js";import{GapFilterItem as u}from"./GapFilterItem.js";import{CustomChatCrRedirection as g}from"./CustomChatCrRedirection.js";import{SirenIcon as p,WarningIcon as m,SupportIcon as f}from"./gapFilterSvgs.js";import b from"./GapFilterBlock.module.css.js";import"react-markdown";import"rehype-raw";import"../RequirementAIWrapper/RequirementAIWrapper.js";var v=["critical","recommendation","warning"];function C(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function y(e){return l.toArray(e).filter(function(e){return c(e)}).filter(function(e){var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(function(e){var o,r,n=e.props,i=n.children,a=t(n,["children"]),l={};Object.keys(a).forEach(function(e){e.startsWith("data-")||(l[e]=a[e])});var c,d,s=(c=a,d={},Object.keys(c).forEach(function(e){e.startsWith("data-")&&(d[e.replace(/^data-/,"")]=c[e])}),d),u=a["decision-strength"],g=a["data-is-completed"];return{text:i,headerText:a.headertext,tags:a.tags,dataAttrs:s,decisionStrength:u,attrs:l,type:"gapfilteritem"===e.type?"gapfilteritem":"crredirection",score:a.score,isCompleted:g,pendingCount:a.pendingcount,question:a.question,components:a.components,showFix:null!==(o=a.showfix)&&void 0!==o&&o,showRedirect:null!==(r=a.showredirect)&&void 0!==r&&r}})}var h={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}},x=function(t){var l=t.processItemId,c=t.mode;t.node;var x=t.children,S=t.type,I=t.supportedmodes,k=void 0===I?"":I,R=t["decision-strength"],A=void 0===R?"":R,F=t.pendingdata,B=void 0===F?"":F,T=t.isGeneratingGap,w=void 0!==T&&T,G=t.selectedGapItemId,N=void 0===G?"":G,j=t.onItemSelect,E=t.onHandleSend,W=t.onModeAction,D=t.msg,U=t.panelRef,q=t.getAccordionState,z=t.setAccordionState,H=t.registerGapFilterBlockCount,L=t.getShowGapReviewButtonType,M=t.customStyles,O=t.customIcons,_=S,J=C(A),$=n(function(){var e,t=null!==(e=null==q?void 0:q(_))&&void 0!==e?e:"";return"critical"!==_||t?t:_}),K=$[0],P=$[1],Q=function(e){P(e),null==z||z(_,e)},V=y(x),X=i(function(){return V.reduce(function(e,t){var o,r,n,i=null!==(o=t.tags)&&void 0!==o?o:"Uncategorized",a=null!==(n=null===(r=t.dataAttrs)||void 0===r?void 0:r.categoryid)&&void 0!==n?n:"1",l=e.find(function(e){return e.categoryName===i});return l||(l={categoryName:i,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[])},[V]),Y={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:o(p,{}),label:"risk-gap"===c?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:o(m,{}),label:"risk-gap"===c?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:o(f,{}),label:"risk-gap"===c?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:o(f,{}),label:"",decisionStrength:""}},Z=i(function(){return e=_,v.includes(e)?{labelColor:Y[_].labelColor,badgeBackgroundColor:Y[_].badgeBackgroundColor,badgeTextColor:Y[_].badgeTextColor,label:Y[_].label,decisionStrength:J||Y[_].decisionStrength}:{labelColor:Y.default.labelColor,badgeBackgroundColor:Y.default.badgeBackgroundColor,badgeTextColor:Y.default.badgeTextColor,label:d(_),decisionStrength:J||""};var e},[_,J]);a(function(){null==H||H(_,V.length)},[_,V.length,H]);var ee=function(t,o,r){if(void 0===r&&(r={}),!w){var n="".concat(X[t].categoryId,"-").concat(o);null==j||j(n);var i=e(e({},X[t].items[o].dataAttrs),r);null==W||W(k,i)}};return L&&L(),o(s,e({mode:c,type:_,config:Z,count:V.length,handleReviewClick:function(){V.length>0&&Q(_)},openAccordion:K,onAccordionChange:function(e){Q(K===e?"":e)},shouldShowReviewButton:!1,pendingData:B,customStyles:M},{children:X.map(function(t,n){return r("div",e({className:b.categoryGroup,style:null==M?void 0:M.categoryGroup},{children:["gapfilteritem"===t.type&&"Uncategorized"!==t.categoryName&&o("p",e({className:b.categoryLabel,style:null==M?void 0:M.categoryLabel},{children:t.categoryName})),t.items.map(function(r,i){var a,d,s,p,m=r.attrs||{},f=null===(a=r.dataAttrs)||void 0===a?void 0:a["cognitive-reasoning"],v=m.id||(null===(d=r.dataAttrs)||void 0===d?void 0:d.id)||"",C="I"===v[0]?"UI_REF":"CHAT_REF",y=null===(s=null==D?void 0:D.contextAwareAgentReasoning)||void 0===s?void 0:s[f],x=r.isCompleted;return"gapfilteritem"===r.type?o("div",e({className:[b.gapFilterItemWrapper,"Uncategorized"!==t.categoryName?b.gapFilterItemWrapperIndented:""].join(" "),style:null==M?void 0:M.blockContainer},{children:o(u,{isCompleted:x,mode:c,index:i,isSelected:N==="".concat(t.categoryId,"-").concat(i),onClick:function(){return ee(n,i)},onFixClick:function(){return ee(n,i,{triggerFrom:"fix"})},onRedirect:function(){return ee(n,i,{triggerFrom:"redirect"})},item:r,isGenerating:w,aiReason:y,panelRef:null!=U?U:{current:null},id:f,customStyles:M,customIcons:O})}),i):o("div",e({className:b.crRedirectionGroup,style:null==M?void 0:M.crRedirectionGroup},{children:o("div",e({className:b.crRedirectionInner,style:null==M?void 0:M.crRedirectionInner},{children:o(g,{processItemId:l,isCompleted:x,mode:c,msg:D,type:C,text:r.text,headerText:r.headerText,decisionStrength:r.decisionStrength,id:v,gapType:_,onHandleSend:E,isGenerating:w,aiReason:y,statusUi:null!==(p=h[_])&&void 0!==p?p:h.recommendation,panelRef:null!=U?U:{current:null},customStyles:M,customIcons:O})}))}),i)})]}),"".concat(t.categoryName,"-").concat(n))})}))};export{x as GapFilterBlock,C as normalizeDecisionStrength};
2
2
  //# sourceMappingURL=GapFilterBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequirementAiTest.d.ts","sourceRoot":"","sources":["../../../src/RequirementAiTest.tsx"],"names":[],"mappings":"AA4BA,QAAA,MAAM,iBAAiB,+CAszDtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"RequirementAiTest.d.ts","sourceRoot":"","sources":["../../../src/RequirementAiTest.tsx"],"names":[],"mappings":"AA4BA,QAAA,MAAM,iBAAiB,+CAwzDtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -21,12 +21,13 @@ export interface InlineRefIconProps {
21
21
  mode: "cra" | "risk-gap";
22
22
  }
23
23
  interface CustomChatCrRedirectionProps extends InlineRefIconProps {
24
+ processItemId?: string;
24
25
  isCompleted: boolean;
25
26
  statusUi: {
26
27
  badgeBg: string;
27
28
  badgeText: string;
28
29
  };
29
- onHandleSend?: (userMessage: string) => void;
30
+ onHandleSend?: (userMessage: string, id?: string) => void;
30
31
  gapType?: string;
31
32
  isGenerating?: boolean;
32
33
  customStyles?: GapFilterStyles;
@@ -48,6 +49,6 @@ interface CustomChatCrRedirectionProps extends InlineRefIconProps {
48
49
  };
49
50
  }) => void;
50
51
  }
51
- export declare function CustomChatCrRedirection({ isCompleted, mode, msg, type, id, aiReason, text, headerText, decisionStrength, statusUi, panelRef, onHandleSend, onRedirectClick, gapType, isGenerating, customStyles, customIcons }: CustomChatCrRedirectionProps): import("react/jsx-runtime").JSX.Element;
52
+ export declare function CustomChatCrRedirection({ processItemId, isCompleted, mode, msg, type, id, aiReason, text, headerText, decisionStrength, statusUi, panelRef, onHandleSend, onRedirectClick, gapType, isGenerating, customStyles, customIcons }: CustomChatCrRedirectionProps): import("react/jsx-runtime").JSX.Element;
52
53
  export {};
53
54
  //# sourceMappingURL=CustomChatCrRedirection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomChatCrRedirection.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAInE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,EAAE,KAAK,GAAG,UAAU,CAAA;CACzB;AAED,UAAU,4BAA6B,SAAQ,kBAAkB;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,eAAe,CAAA;IAC9B,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE;QAC1B,IAAI,EAAE,OAAO,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,eAAe,CAAC;QAC1B,GAAG,EAAE,GAAG,CAAC;QACT,IAAI,EAAE;YAAE,UAAU,CAAC,EAAE,MAAM,CAAC;YAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxE,KAAK,IAAI,CAAC;CACZ;AAID,wBAAgB,uBAAuB,CAAC,EACtC,WAAW,EACX,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,OAAO,EACP,YAAoB,EACpB,YAAY,EACZ,WAAW,EACZ,EAAE,4BAA4B,2CAsL9B"}
1
+ {"version":3,"file":"CustomChatCrRedirection.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM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CAAC;QACX,QAAQ,EAAE,eAAe,CAAC;QAC1B,GAAG,EAAE,GAAG,CAAC;QACT,IAAI,EAAE;YAAE,UAAU,CAAC,EAAE,MAAM,CAAC;YAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxE,KAAK,IAAI,CAAC;CACZ;AAID,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,WAAW,EACX,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,OAAO,EACP,YAAoB,EACpB,YAAY,EACZ,WAAW,EACZ,EAAE,4BAA4B,2CA4L9B"}
@@ -14,6 +14,7 @@ export interface AIReasoningType {
14
14
  }
15
15
  export declare function normalizeDecisionStrength(raw: string): string;
16
16
  export interface GapFilterBlockProps {
17
+ processItemId?: string;
17
18
  mode: "cra" | "risk-gap";
18
19
  node?: any;
19
20
  children?: React.ReactNode;
@@ -44,6 +45,7 @@ export interface GapFilterMarkdownRendererProps {
44
45
  panelRef?: React.RefObject<any>;
45
46
  customStyles?: GapFilterStyles;
46
47
  customIcons?: UserStoryIcons;
48
+ processItemId?: string;
47
49
  }
48
50
  export declare const GapFilterMarkdownRenderer: React.FC<GapFilterMarkdownRendererProps>;
49
51
  //# sourceMappingURL=GapFilterBlock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GapFilterBlock.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAajF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAgB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAO5E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAA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,CAAC;IAChC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,0BAA0B,CAAC,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC;IACxD,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,WAAW,CAAC,EAAE,cAAc,CAAA;CAC7B;AAID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA2PxD,CAAC;AAIF,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAGjB,GAAG,EAAE,GAAG,CAAC;IACT,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,WAAW,CAAC,EAAE,cAAc,CAAA;CAC7B;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAqH9E,CAAC"}
1
+ {"version":3,"file":"GapFilterBlock.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAajF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAgB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAO5E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,gBAAgB,CAAC;AACtE,MAAM,MAAM,OAAO,GAAG,UAA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,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,0BAA0B,CAAC,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC;IACxD,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,WAAW,CAAC,EAAE,cAAc,CAAA;CAC7B;AAID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4PxD,CAAC;AAIF,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAGjB,GAAG,EAAE,GAAG,CAAC;IACT,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAuH9E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",