@e-llm-studio/requirement-ai 0.0.336 → 0.0.338

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),i=require("../../icons/BigEnoughIcon.js"),n=require("../ai-reasoning/AiReasoningCitationContent.js"),l=require("../RequirementAIWrapper/RequirementAIWrapper.js"),s=require("./BigEnoughPanel.module.css.js");exports.BigEnoughPanel=({customIcons:r,customStyles:t,currentUserStory:c,panelStyles:a,showPanel:u=!1})=>{var d,v,g,_,p,h;l.useRequirementAI();const[y,m]=o.useState(!!u),f=o.useRef(null);return e.jsxs("div",{onClick:e=>e.stopPropagation(),children:[!u&&e.jsx("button",{ref:f,className:s.default.developerEffortButton,style:null==a?void 0:a.buttonStyle,onClick:e=>{e.stopPropagation(),m(e=>!e)},children:e.jsx(i.default,{color:null==a?void 0:a.iconColor,size:null==a?void 0:a.iconSize})}),y&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:null===s.default||void 0===s.default?void 0:s.default.backdrop,style:u?null==a?void 0:a.showPanelBackdropStyles:null==a?void 0:a.backdropStyle,onClick:e=>{e.stopPropagation(),m(!1)},onWheel:e=>e.stopPropagation()}),e.jsxs("div",{className:`${s.default.dropdown} ${u?s.default.showPanelDropdown:""}`,style:{...null==a?void 0:a.dropdownStyle,...u?null==a?void 0:a.showPanelDropdownStyle:{}},children:[e.jsx(n.default,{cognitiveDecisionHeaders:{mainHeader:`Feature Implementation Score - ${(null==c?void 0:c.big_enough)||0}`},big_enough_block:null===(d=c.big_enough_decision_factors)||void 0===d?void 0:d.big_enough_block,aiReason:{relevance_score:(null===(v=null==c?void 0:c.big_enough_decision_factors)||void 0===v?void 0:v.relevance_score)||0,reason:(null===(g=null==c?void 0:c.big_enough_decision_factors)||void 0===g?void 0:g.score_reason)||"",gap:(null===(_=null==c?void 0:c.big_enough_decision_factors)||void 0===_?void 0:_.gap)||"",id:"big-enough-cd"},customIcons:r,customStyles:t}),(null==c?void 0:c.technicality_score)&&e.jsx(n.default,{cognitiveDecisionHeaders:{mainHeader:`Technicality Score - ${(null==c?void 0:c.technicality_score.score)||0}`},scenario:"technicality_score",aiReason:{relevance_score:Number((null===(p=null==c?void 0:c.technicality_score)||void 0===p?void 0:p.relevance_score)||-1),reason:(null==c?void 0:c.technicality_score.reasoning)||"",gap:(null===(h=null==c?void 0:c.technicality_score)||void 0===h?void 0:h.gap)||"",id:"big-enough-cd"},customIcons:r,customStyles:t})]})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),i=require("../../icons/BigEnoughIcon.js"),n=require("../ai-reasoning/AiReasoningCitationContent.js"),l=require("../RequirementAIWrapper/RequirementAIWrapper.js"),s=require("./BigEnoughPanel.module.css.js");exports.BigEnoughPanel=({customIcons:r,customStyles:t,currentUserStory:c,panelStyles:a,showPanel:u=!1})=>{var d,v,g,_,h,p;l.useRequirementAI();const[m,y]=o.useState(!!u),f=o.useRef(null);return e.jsxs("div",{onClick:e=>e.stopPropagation(),children:[!u&&e.jsx("button",{ref:f,className:s.default.developerEffortButton,style:null==a?void 0:a.buttonStyle,onClick:e=>{e.stopPropagation(),y(e=>!e)},children:e.jsx(i.default,{color:null==a?void 0:a.iconColor,size:null==a?void 0:a.iconSize})}),m&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:null===s.default||void 0===s.default?void 0:s.default.backdrop,style:u?null==a?void 0:a.showPanelBackdropStyles:null==a?void 0:a.backdropStyle,onClick:e=>{e.stopPropagation(),y(!1)},onWheel:e=>e.stopPropagation()}),e.jsx("div",{className:`${s.default.dropdown} ${u?s.default.showPanelDropdown:""}`,style:{...null==a?void 0:a.dropdownStyle,...u?null==a?void 0:a.showPanelDropdownStyle:{}},children:e.jsxs("div",{className:s.default.scoreContent,children:[e.jsx(n.default,{cognitiveDecisionHeaders:{mainHeader:`Feature Implementation Score - ${(null==c?void 0:c.big_enough)||0}`},big_enough_block:null===(d=c.big_enough_decision_factors)||void 0===d?void 0:d.big_enough_block,aiReason:{relevance_score:(null===(v=null==c?void 0:c.big_enough_decision_factors)||void 0===v?void 0:v.relevance_score)||0,reason:(null===(g=null==c?void 0:c.big_enough_decision_factors)||void 0===g?void 0:g.score_reason)||"",gap:(null===(_=null==c?void 0:c.big_enough_decision_factors)||void 0===_?void 0:_.gap)||"",id:"big-enough-cd"},customIcons:r,customStyles:t}),(null==c?void 0:c.technicality_score)&&e.jsx(n.default,{cognitiveDecisionHeaders:{mainHeader:`Technicality Score - ${(null==c?void 0:c.technicality_score.score)||0}`},scenario:"technicality_score",aiReason:{relevance_score:Number((null===(h=null==c?void 0:c.technicality_score)||void 0===h?void 0:h.relevance_score)||-1),reason:(null==c?void 0:c.technicality_score.reasoning)||"",gap:(null===(p=null==c?void 0:c.technicality_score)||void 0===p?void 0:p.gap)||"",id:"big-enough-cd"},customIcons:r,customStyles:t})]})})]})]})};
2
2
  //# sourceMappingURL=BigEnoughPanel.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".BigEnoughPanel-module_developerEffortButton__KLQ-Z{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.BigEnoughPanel-module_backdrop__J0KVD{height:100vh;inset:0;position:absolute;width:100vw;z-index:40}.BigEnoughPanel-module_dropdown__mlBHL.BigEnoughPanel-module_showPanelDropdown__qz6dk{max-height:70vh;overflow-y:scroll;top:10px}.BigEnoughPanel-module_dropdown__mlBHL{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;left:20px;margin-top:1.25rem;position:absolute;top:100%;width:91.666667%;z-index:40}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={developerEffortButton:"BigEnoughPanel-module_developerEffortButton__KLQ-Z",backdrop:"BigEnoughPanel-module_backdrop__J0KVD",dropdown:"BigEnoughPanel-module_dropdown__mlBHL",showPanelDropdown:"BigEnoughPanel-module_showPanelDropdown__qz6dk"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".BigEnoughPanel-module_developerEffortButton__KLQ-Z{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.BigEnoughPanel-module_backdrop__J0KVD{height:100vh;inset:0;position:absolute;width:100vw;z-index:40}.BigEnoughPanel-module_dropdown__mlBHL.BigEnoughPanel-module_showPanelDropdown__qz6dk{max-height:70vh;overflow-y:scroll;top:10px}.BigEnoughPanel-module_dropdown__mlBHL{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;left:20px;margin-top:1.25rem;position:absolute;top:100%;width:91.666667%;z-index:40}.BigEnoughPanel-module_scoreContent__LF08L{max-height:70vh;overflow-x:hidden;overflow-y:auto;padding-right:4px}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={developerEffortButton:"BigEnoughPanel-module_developerEffortButton__KLQ-Z",backdrop:"BigEnoughPanel-module_backdrop__J0KVD",dropdown:"BigEnoughPanel-module_dropdown__mlBHL",showPanelDropdown:"BigEnoughPanel-module_showPanelDropdown__qz6dk",scoreContent:"BigEnoughPanel-module_scoreContent__LF08L"};
2
2
  //# sourceMappingURL=BigEnoughPanel.module.css.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("showdown"),o=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),r=require("../../utils/userstory-approval.utils.js"),a=require("../../hooks/useApprovalStatus.js"),i=require("./components/ContentSegment/ContentSegment.js"),s=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),u=require("../../icons/CheckIcon.js"),c=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),h=require("../story-screen/BigEnoughPanel.js"),m=require("../../icons/BigEnoughIcon.js"),y=require("@mui/material"),f=require("../../utils/helpers.js"),g=require("../../utils/user-story.utils.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=b(l);const x={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},A={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},C=Object.assign(({artifactTitleIds:l,config:i={},callbacks:s={},labels:u={},isDisabled:c=!1,disabledReason:v="",children:p,classNames:h,selectedArtifactId:m})=>{var y;const{userStory:f,customStyles:g}=o.useRequirementAI(),b={...x,...i},I={...A,...u},[C,j]=t.useState([]),[w,E]=t.useState(""),[k,U]=t.useState(""),[N,q]=t.useState(!1),[T,B]=t.useState(!0),F=t.useRef(void 0),D=t.useCallback((e,t,l,o)=>{s.onShowNotification?s.onShowNotification(e,t,l,o):console.log(`[${e.toUpperCase()}] ${t}: ${l}`)},[s]),M=t.useCallback(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),R=t.useMemo(()=>{const e=C.findIndex(e=>e.artifactId===w);return e>=0?e:0},[C,w]),P=C[R];t.useEffect(()=>{F.current=P},[P]),t.useEffect(()=>{var e;if(!(null==f?void 0:f.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===f.length&&B(!1),f.length>0&&!w&&E(m||f[0].artifactId);const t=n.createUserStoriesForApproval(n.cloneUserStories(f));j(t)},[f,m]),t.useEffect(()=>{m&&m!==w&&E(m)},[m,w]),t.useEffect(()=>{if(!P)return;const e=r.getFirstNonApprovedSegmentId(P,"");U(e)},[null==P?void 0:P.artifactId]);const _=t.useCallback((e,t)=>{j(l=>{const o=[...l];if("APPROVED"===t.approval_status&&"APPROVED"!==l[e].approval_status){const e=r.getFirstUnapprovedStoryId(l,t.artifactId);e&&E(e)}return o[e]=t,o})},[]),z=t.useCallback(e=>{const t=F.current;if(!t)return;const l=r.getFirstNonApprovedSegmentId(t,e);"NA"!==l&&(U(""),setTimeout(()=>{U(l)},0))},[]);a.useApprovalStatus({userStoryForApproval:C,selectedUserStoryForApproval:P,userStoryIndex:R,callbacks:s,labels:I,onSaveUserStory:_});const O={height:b.containerHeight,...b.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},W={userStoryForApproval:C,setUserStoryForApproval:j,selectedStoryArtifactId:w,setSelectedStoryArtifactId:E,selectedUserStoryIndex:R,selectedUserStoryForApproval:P,currentContentId:k,setCurrentContentId:U,isEditingSegment:N,setIsEditingSegment:q,isSidebarExpanded:T,setIsSidebarExpanded:B,artifactTitleIds:l,config:b,labels:I,callbacks:s,isDisabled:c,disabledReason:v,handleSaveUserStory:_,handleUpdateContentId:z,showNotification:D,scrollToElement:M};return e.jsx(S.UserStoryApprovalScreenContext.Provider,{value:W,children:e.jsx("div",{className:`${d.default.container} ${(null==h?void 0:h.container)||""}`,style:{...O,...null===(y=null==g?void 0:g.approvalScreen)||void 0===y?void 0:y.wrapperContainer},children:p})})},{Sidebar:({Component:t,config:l,className:o})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingSegment:s,artifactTitleIds:d}=S.useUserStoryApprovalScreen();return t?e.jsx(t,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e.jsx(v.ApprovalSidebar,{config:l,className:o})},SidebarToggle:({OpenIcon:t,CloseIcon:l,className:o=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=S.useUserStoryApprovalScreen(),a=t||p.SidebarOpenIcon,i=l||p.SidebarCloseIcon;return e.jsx("div",{className:`${d.default.sidebarToggleWrapper} ${o}`,children:e.jsx("button",{onClick:()=>r(e=>!e),className:d.default.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:n?e.jsx(i,{}):e.jsx(a,{})})})},Content:({children:l,ButtonComponent:n,hideApproveAll:a=!1,pageTitle:i="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:b,handleOpenSendDialog:x,pageDescription:A="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var C,j,w,E,k,U,N,q,T,B,F,D,M,R,P,_,z,O,W,L,$,V,H,G,Y,J,K,Q,X,Z,ee;const{selectedUserStoryForApproval:te,selectedUserStoryIndex:le,artifactTitleIds:oe,labels:ne,config:re,isDisabled:ae,disabledReason:ie,isEditingSegment:se,handleSaveUserStory:de,setCurrentContentId:ue,showNotification:ce}=S.useUserStoryApprovalScreen(),{userStory:ve,setUserStory:pe}=o.useRequirementAI(),Se=ve[0],[he,me]=t.useState(null),ye=()=>{me(null)},fe=t.useRef(null),[ge,be]=t.useState(!1),{customStyles:Ie,customIcons:xe}=o.useRequirementAI(),Ae=null==Ie?void 0:Ie.userStoryCardStyles,[Ce,je]=t.useState(!1),we=t.useCallback(()=>{if(!te)return;if(se)return void ce("warn","Warning!",ne.unsavedChangesWarning,3e3);const e=r.approveAllSegments(te);de(le,e),ue("")},[te,le,se,ne,de,ue,ce]);if(!te)return null;const Ee=oe[le]||"",ke="APPROVED"===te.approval_status,Ue=ae?ie:"",Ne=null!=(null==te?void 0:te.big_enough)&&!Number.isNaN(te.big_enough)&&!!(null==te?void 0:te.big_enough_decision_factors);return e.jsxs("div",{className:d.default.content,style:{...null===(j=null===(C=null==Ie?void 0:Ie.approvalScreen)||void 0===C?void 0:C.content)||void 0===j?void 0:j.content},"data-lsc-ui-page-title":i,"data-lsc-ui-page-description":A,children:[e.jsxs("div",{className:d.default.header,style:{...null===(k=null===(E=null===(w=null==Ie?void 0:Ie.approvalScreen)||void 0===w?void 0:w.body)||void 0===E?void 0:E.contentSegment)||void 0===k?void 0:k.header},children:[e.jsxs("div",{className:d.default.headerLeft,style:{...null===(N=null===(U=null==Ie?void 0:Ie.approvalScreen)||void 0===U?void 0:U.content)||void 0===N?void 0:N.headerLeft},children:[e.jsxs("div",{className:d.default.headerMeta,style:{...null===(B=null===(T=null===(q=null==Ie?void 0:Ie.approvalScreen)||void 0===q?void 0:q.body)||void 0===T?void 0:T.contentSegment)||void 0===B?void 0:B.headerMeta},children:[e.jsx(c.BookmarkIcon,{size:16,color:(null===(M=null===(D=null===(F=null==Ie?void 0:Ie.approvalScreen)||void 0===F?void 0:F.body)||void 0===D?void 0:D.contentSegment)||void 0===M?void 0:M.bookMarkColor)||"#8C8C8C"}),e.jsx("h2",{className:d.default.headerArtifactId,style:{...null===(_=null===(P=null===(R=null==Ie?void 0:Ie.approvalScreen)||void 0===R?void 0:R.body)||void 0===P?void 0:P.contentSegment)||void 0===_?void 0:_.headerArtifactId},children:Ee})]}),e.jsx("p",{className:d.default.headerTitle,style:{...null===(W=null===(O=null===(z=null==Ie?void 0:Ie.approvalScreen)||void 0===z?void 0:z.body)||void 0===O?void 0:O.contentSegment)||void 0===W?void 0:W.headerTitle},children:null==te?void 0:te.title})]}),e.jsxs("div",{className:null===d.default||void 0===d.default?void 0:d.default.containerStyle,style:null===($=null===(L=null==Ie?void 0:Ie.approvalScreen)||void 0===L?void 0:L.BigEnoughStyles)||void 0===$?void 0:$.containerStyle,children:[Ne&&e.jsx("button",{className:d.default.developerEffortButton,style:null===(H=null===(V=null==Ie?void 0:Ie.approvalScreen)||void 0===V?void 0:V.BigEnoughStyles)||void 0===H?void 0:H.buttonStyle,onClick:()=>je(!Ce),children:e.jsx(m.default,{color:null===(Y=null===(G=null==Ie?void 0:Ie.approvalScreen)||void 0===G?void 0:G.BigEnoughStyles)||void 0===Y?void 0:Y.iconColor,size:null===(K=null===(J=null==Ie?void 0:Ie.approvalScreen)||void 0===J?void 0:J.BigEnoughStyles)||void 0===K?void 0:K.iconSize})}),v&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:d.default.iconButton,style:null==Ae?void 0:Ae.iconButton,onClick:e=>{me(e.currentTarget)},children:e.jsx(p.ExternalLink,{size:16})}),e.jsxs(y.Menu,{id:"user-story-share-menu",anchorEl:he,open:!!he,onClose:()=>me(null),style:null==Ae?void 0:Ae.userStoryShareMenu,children:[e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{be(!0),b&&(await Promise.all([b("pdf"),b("doc")]),be(!1))},children:e.jsxs("div",{ref:fe,className:d.default.menuItemContent,style:null==Ae?void 0:Ae.menuItemContent,children:[e.jsx(p.Download,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Download"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{let e=Se;e={...Se,value:`${g.replaceTitleSection(null==Se?void 0:Se.value,Se.title)}`},null==x||x(!0,[e],Se.artifactId),ye()},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Share2,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Send"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{const e=(new I.default.Converter).makeHtml(f.formatMarkdown(Se.value)||Se.value),t=function(e){const t=(new I.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(f.formatMarkdown(Se.value)||Se.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{ye()}},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Copy,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Copy"})]})})]})]}),!a&&re.showApproveAllButton&&e.jsx("div",{className:d.default.headerRight,children:ke?e.jsx(s.ApprovalBadge,{status:"APPROVED",label:ne.approved}):n?e.jsx(y.Tooltip,{title:Ue,children:e.jsx("span",{children:e.jsx(n,{type:"fill",onClick:we,isDisable:ae,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ne.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:e.jsxs("div",{className:d.default.approveAllContent,children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})})}):e.jsx(y.Tooltip,{title:Ue,children:e.jsx("span",{children:e.jsxs("button",{onClick:we,disabled:ae,className:d.default.approveAllButtonDefault,style:{...null===(X=null===(Q=null==Ie?void 0:Ie.approvalScreen)||void 0===Q?void 0:Q.content)||void 0===X?void 0:X.approveAllButtonDefault},children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})})})]})]}),Ce&&Ne&&e.jsx("div",{className:d.default.bigEnoughWrapper,children:e.jsx(h.BigEnoughPanel,{customIcons:null==xe?void 0:xe.userStoryIcons,customStyles:null===(Z=null==Ie?void 0:Ie.approvalScreen)||void 0===Z?void 0:Z.aiReasoningCitaionStyles,currentUserStory:te,panelStyles:null===(ee=null==Ie?void 0:Ie.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles,showPanel:Ce})}),l]})},Body:({children:l,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u=!1})=>{var c,v,p;const{selectedUserStoryForApproval:h,selectedUserStoryIndex:m,artifactTitleIds:y,handleSaveUserStory:f}=S.useUserStoryApprovalScreen(),{customStyles:g}=o.useRequirementAI(),b=t.useCallback(e=>{f(m,e)},[m,f]),I=t.useCallback((e,t)=>{var l;if(!h)return;const o={...h,sub_features:null===(l=h.sub_features)||void 0===l?void 0:l.map((l,o)=>o===e?t:l)};f(m,o)},[h,m,f]),x=t.useCallback(e=>{var t;if(!h)return;const l={...h,sub_features:null===(t=h.sub_features)||void 0===t?void 0:t.filter((t,l)=>l!==e)};f(m,l)},[h,m,f]);if(!h)return null;const A=y[m]||"";return e.jsxs("div",{className:d.default.body,style:{...null===(v=null===(c=null==g?void 0:g.approvalScreen)||void 0===c?void 0:c.body)||void 0===v?void 0:v.container},children:[e.jsx(i.ContentSegment,{userStoryForApproval:h,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:n,ViewerComponent:r}),null===(p=h.sub_features)||void 0===p?void 0:p.map((t,l)=>e.jsx(i.ContentSegment,{userStoryForApproval:t,artifactTitleId:`${A} - ${String.fromCharCode(65+l)}`,isSubFeature:!0,subFeatureIndex:l,onSaveSubFeature:I,onDeleteSubFeature:x,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u},t.artifactId)),l]})}});exports.default=C;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("showdown"),o=require("../RequirementAIWrapper/RequirementAIWrapper.js"),r=require("../../utils/userstory-approval-transform.utils.js"),n=require("../../utils/userstory-approval.utils.js"),a=require("../../hooks/useApprovalStatus.js"),s=require("./components/ContentSegment/ContentSegment.js"),i=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),u=require("../../icons/CheckIcon.js"),c=require("../../icons/BookmarkIcon.js"),p=require("./components/ApprovalSidebar/ApprovalSidebar.js"),v=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),h=require("../story-screen/BigEnoughPanel.js"),m=require("@mui/material"),y=require("../../utils/helpers.js"),f=require("../../utils/user-story.utils.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(l);const I={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},x={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},A=Object.assign(({artifactTitleIds:l,config:s={},callbacks:i={},labels:u={},isDisabled:c=!1,disabledReason:p="",children:v,classNames:h,selectedArtifactId:m})=>{var y;const{userStory:f,customStyles:g}=o.useRequirementAI(),b={...I,...s},A={...x,...u},[C,j]=t.useState([]),[w,k]=t.useState(""),[U,E]=t.useState(""),[N,q]=t.useState(!1),[T,F]=t.useState(!0),D=t.useRef(void 0),M=t.useCallback((e,t,l,o)=>{i.onShowNotification?i.onShowNotification(e,t,l,o):console.log(`[${e.toUpperCase()}] ${t}: ${l}`)},[i]),B=t.useCallback(e=>{i.onScrollToElement?i.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[i]),R=t.useMemo(()=>{const e=C.findIndex(e=>e.artifactId===w);return e>=0?e:0},[C,w]),P=C[R];t.useEffect(()=>{D.current=P},[P]),t.useEffect(()=>{var e;if(!(null==f?void 0:f.length))return;null===(e=i.onInitialize)||void 0===e||e.call(i),1===f.length&&F(!1),f.length>0&&!w&&k(m||f[0].artifactId);const t=r.createUserStoriesForApproval(r.cloneUserStories(f));j(t)},[f,m]),t.useEffect(()=>{m&&m!==w&&k(m)},[m,w]),t.useEffect(()=>{if(!P)return;const e=n.getFirstNonApprovedSegmentId(P,"");E(e)},[null==P?void 0:P.artifactId]);const _=t.useCallback((e,t)=>{j(l=>{const o=[...l];if("APPROVED"===t.approval_status&&"APPROVED"!==l[e].approval_status){const e=n.getFirstUnapprovedStoryId(l,t.artifactId);e&&k(e)}return o[e]=t,o})},[]),O=t.useCallback(e=>{const t=D.current;if(!t)return;const l=n.getFirstNonApprovedSegmentId(t,e);"NA"!==l&&(E(""),setTimeout(()=>{E(l)},0))},[]);a.useApprovalStatus({userStoryForApproval:C,selectedUserStoryForApproval:P,userStoryIndex:R,callbacks:i,labels:A,onSaveUserStory:_});const L={height:b.containerHeight,...b.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},W={userStoryForApproval:C,setUserStoryForApproval:j,selectedStoryArtifactId:w,setSelectedStoryArtifactId:k,selectedUserStoryIndex:R,selectedUserStoryForApproval:P,currentContentId:U,setCurrentContentId:E,isEditingSegment:N,setIsEditingSegment:q,isSidebarExpanded:T,setIsSidebarExpanded:F,artifactTitleIds:l,config:b,labels:A,callbacks:i,isDisabled:c,disabledReason:p,handleSaveUserStory:_,handleUpdateContentId:O,showNotification:M,scrollToElement:B};return e.jsx(S.UserStoryApprovalScreenContext.Provider,{value:W,children:e.jsx("div",{className:`${d.default.container} ${(null==h?void 0:h.container)||""}`,style:{...L,...null===(y=null==g?void 0:g.approvalScreen)||void 0===y?void 0:y.wrapperContainer},children:v})})},{Sidebar:({Component:t,config:l,className:o})=>{const{isSidebarExpanded:r,selectedStoryArtifactId:n,setSelectedStoryArtifactId:a,userStoryForApproval:s,isEditingSegment:i,artifactTitleIds:d}=S.useUserStoryApprovalScreen();return t?e.jsx(t,{isSidebarExpanded:r,selectedStoryArtifactId:n,setSelectedStoryArtifactId:a,userStoryForApproval:s,isEditingAnUserStorySegment:i,artifactTitleIds:d}):e.jsx(p.ApprovalSidebar,{config:l,className:o})},SidebarToggle:({OpenIcon:t,CloseIcon:l,className:o=""})=>{const{isSidebarExpanded:r,setIsSidebarExpanded:n}=S.useUserStoryApprovalScreen(),a=t||v.SidebarOpenIcon,s=l||v.SidebarCloseIcon;return e.jsx("div",{className:`${d.default.sidebarToggleWrapper} ${o}`,children:e.jsx("button",{onClick:()=>n(e=>!e),className:d.default.sidebarToggleBtn,"aria-label":r?"Collapse sidebar":"Expand sidebar",type:"button",children:r?e.jsx(s,{}):e.jsx(a,{})})})},Content:({children:l,ButtonComponent:r,hideApproveAll:a=!1,pageTitle:s="Review Generated Requirements",showShareIcon:p=!1,handleDownloadUserStory:g,handleOpenSendDialog:I,pageDescription:x="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var A,C,j,w,k,U,E,N,q,T,F,D,M,B,R,P,_,O,L,W,$,z,V,H,G;const{selectedUserStoryForApproval:Y,selectedUserStoryIndex:J,artifactTitleIds:K,labels:Q,config:X,isDisabled:Z,disabledReason:ee,isEditingSegment:te,handleSaveUserStory:le,setCurrentContentId:oe,showNotification:re}=S.useUserStoryApprovalScreen(),{userStory:ne,setUserStory:ae}=o.useRequirementAI(),se=ne[0],[ie,de]=t.useState(null),ue=()=>{de(null)},ce=t.useRef(null),[pe,ve]=t.useState(!1),{customStyles:Se,customIcons:he}=o.useRequirementAI(),me=null==Se?void 0:Se.userStoryCardStyles,ye=t.useCallback(()=>{if(!Y)return;if(te)return void re("warn","Warning!",Q.unsavedChangesWarning,3e3);const e=n.approveAllSegments(Y);le(J,e),oe("")},[Y,J,te,Q,le,oe,re]);if(!Y)return null;const fe=K[J]||"",ge="APPROVED"===Y.approval_status,be=Z?ee:"",Ie=null!=(null==Y?void 0:Y.big_enough)&&!Number.isNaN(Y.big_enough)&&!!(null==Y?void 0:Y.big_enough_decision_factors);return e.jsxs("div",{className:d.default.content,style:{...null===(C=null===(A=null==Se?void 0:Se.approvalScreen)||void 0===A?void 0:A.content)||void 0===C?void 0:C.content},"data-lsc-ui-page-title":s,"data-lsc-ui-page-description":x,children:[e.jsxs("div",{className:d.default.header,style:{...null===(k=null===(w=null===(j=null==Se?void 0:Se.approvalScreen)||void 0===j?void 0:j.body)||void 0===w?void 0:w.contentSegment)||void 0===k?void 0:k.header},children:[e.jsxs("div",{className:d.default.headerLeft,style:{...null===(E=null===(U=null==Se?void 0:Se.approvalScreen)||void 0===U?void 0:U.content)||void 0===E?void 0:E.headerLeft},children:[e.jsxs("div",{className:d.default.headerMeta,style:{...null===(T=null===(q=null===(N=null==Se?void 0:Se.approvalScreen)||void 0===N?void 0:N.body)||void 0===q?void 0:q.contentSegment)||void 0===T?void 0:T.headerMeta},children:[e.jsx(c.BookmarkIcon,{size:16,color:(null===(M=null===(D=null===(F=null==Se?void 0:Se.approvalScreen)||void 0===F?void 0:F.body)||void 0===D?void 0:D.contentSegment)||void 0===M?void 0:M.bookMarkColor)||"#8C8C8C"}),e.jsx("h2",{className:d.default.headerArtifactId,style:{...null===(P=null===(R=null===(B=null==Se?void 0:Se.approvalScreen)||void 0===B?void 0:B.body)||void 0===R?void 0:R.contentSegment)||void 0===P?void 0:P.headerArtifactId},children:fe})]}),e.jsx("p",{className:d.default.headerTitle,style:{...null===(L=null===(O=null===(_=null==Se?void 0:Se.approvalScreen)||void 0===_?void 0:_.body)||void 0===O?void 0:O.contentSegment)||void 0===L?void 0:L.headerTitle},children:null==Y?void 0:Y.title})]}),e.jsxs("div",{className:null===d.default||void 0===d.default?void 0:d.default.containerStyle,style:null===($=null===(W=null==Se?void 0:Se.approvalScreen)||void 0===W?void 0:W.BigEnoughStyles)||void 0===$?void 0:$.containerStyle,children:[Ie&&e.jsx(h.BigEnoughPanel,{customIcons:null==he?void 0:he.userStoryIcons,customStyles:null===(z=null==Se?void 0:Se.approvalScreen)||void 0===z?void 0:z.aiReasoningCitaionStyles,currentUserStory:Y,panelStyles:null===(V=null==Se?void 0:Se.approvalScreen)||void 0===V?void 0:V.BigEnoughStyles}),p&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:d.default.iconButton,style:null==me?void 0:me.iconButton,onClick:e=>{de(e.currentTarget)},children:e.jsx(v.ExternalLink,{size:16})}),e.jsxs(m.Menu,{id:"user-story-share-menu",anchorEl:ie,open:!!ie,onClose:()=>de(null),style:null==me?void 0:me.userStoryShareMenu,children:[e.jsx(m.MenuItem,{style:null==me?void 0:me.userStoryMenuItem,onClick:async()=>{ve(!0),g&&(await Promise.all([g("pdf"),g("doc")]),ve(!1))},children:e.jsxs("div",{ref:ce,className:d.default.menuItemContent,style:null==me?void 0:me.menuItemContent,children:[e.jsx(v.Download,{size:16,color:null==me?void 0:me.menuIconColor}),e.jsx("p",{style:null==me?void 0:me.menuLabel,children:"Download"})]})}),e.jsx(m.MenuItem,{style:null==me?void 0:me.userStoryMenuItem,onClick:async()=>{let e=se;e={...se,value:`${f.replaceTitleSection(null==se?void 0:se.value,se.title)}`},null==I||I(!0,[e],se.artifactId),ue()},children:e.jsxs("div",{style:null==me?void 0:me.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(v.Share2,{size:16,color:null==me?void 0:me.menuIconColor}),e.jsx("p",{style:null==me?void 0:me.menuLabel,children:"Send"})]})}),e.jsx(m.MenuItem,{style:null==me?void 0:me.userStoryMenuItem,onClick:async()=>{const e=(new b.default.Converter).makeHtml(y.formatMarkdown(se.value)||se.value),t=function(e){const t=(new b.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(y.formatMarkdown(se.value)||se.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{ue()}},children:e.jsxs("div",{style:null==me?void 0:me.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(v.Copy,{size:16,color:null==me?void 0:me.menuIconColor}),e.jsx("p",{style:null==me?void 0:me.menuLabel,children:"Copy"})]})})]})]}),!a&&X.showApproveAllButton&&e.jsx("div",{className:d.default.headerRight,children:ge?e.jsx(i.ApprovalBadge,{status:"APPROVED",label:Q.approved}):r?e.jsx(m.Tooltip,{title:be,children:e.jsx("span",{children:e.jsx(r,{type:"fill",onClick:ye,isDisable:Z,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:Q.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:e.jsxs("div",{className:d.default.approveAllContent,children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:Q.approveAll})]})})})}):e.jsx(m.Tooltip,{title:be,children:e.jsx("span",{children:e.jsxs("button",{onClick:ye,disabled:Z,className:d.default.approveAllButtonDefault,style:{...null===(G=null===(H=null==Se?void 0:Se.approvalScreen)||void 0===H?void 0:H.content)||void 0===G?void 0:G.approveAllButtonDefault},children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:Q.approveAll})]})})})})]})]}),l]})},Body:({children:l,EditorComponent:r,ViewerComponent:n,handleDownloadUserStory:a,handleOpenSendDialog:i,showShareIcon:u=!1})=>{var c,p,v;const{selectedUserStoryForApproval:h,selectedUserStoryIndex:m,artifactTitleIds:y,handleSaveUserStory:f}=S.useUserStoryApprovalScreen(),{customStyles:g}=o.useRequirementAI(),b=t.useCallback(e=>{f(m,e)},[m,f]),I=t.useCallback((e,t)=>{var l;if(!h)return;const o={...h,sub_features:null===(l=h.sub_features)||void 0===l?void 0:l.map((l,o)=>o===e?t:l)};f(m,o)},[h,m,f]),x=t.useCallback(e=>{var t;if(!h)return;const l={...h,sub_features:null===(t=h.sub_features)||void 0===t?void 0:t.filter((t,l)=>l!==e)};f(m,l)},[h,m,f]);if(!h)return null;const A=y[m]||"";return e.jsxs("div",{className:d.default.body,style:{...null===(p=null===(c=null==g?void 0:g.approvalScreen)||void 0===c?void 0:c.body)||void 0===p?void 0:p.container},children:[e.jsx(s.ContentSegment,{userStoryForApproval:h,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:r,ViewerComponent:n}),null===(v=h.sub_features)||void 0===v?void 0:v.map((t,l)=>e.jsx(s.ContentSegment,{userStoryForApproval:t,artifactTitleId:`${A} - ${String.fromCharCode(65+l)}`,isSubFeature:!0,subFeatureIndex:l,onSaveSubFeature:I,onDeleteSubFeature:x,EditorComponent:r,ViewerComponent:n,handleDownloadUserStory:a,handleOpenSendDialog:i,showShareIcon:u},t.artifactId)),l]})}});exports.default=A;
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../utils/proccess-stream.utils.js");exports.useStreamContentHandler=function({setUserStory:i,setAiReasoning:o,setUserStoryCitations:n,onStreamingCompleted:s,isGraphQLCallInProgress:r,knowledgeBase:a,projectAnalyserSummary:l,dataSourceFiles:c,aiReasoning:u,setRedisValue:d,fetchCitationByBlock:p,isOnDemandCitation:_}){const[m,g]=e.useState({finalGap:"",finalRisk:"",status:"in-progress"}),f=e.useRef(new Set),b=e.useRef(new Set),v=e.useRef(null),h=e.useRef(null),y=e.useRef({gap_items_prompt:"",risk_items_prompt:""}),k=e.useRef(new Set);return e.useEffect(()=>{"complete"!==m.status||r||(console.log("streaming::userstory::onStreamingCompleted"),s(m.finalGap,m.finalRisk),f.current.clear(),b.current.clear(),v.current=null,h.current=null,y.current={gap_items_prompt:"",risk_items_prompt:""},k.current.clear(),g({finalGap:"",finalRisk:"",status:"in-progress"}))},[m,r]),{processStreamContent:function(e,s,r,m){try{console.log("streaming::userstory::completed",m,_),m&&_&&(console.log("streaming::userstory::completed::lib"),g({finalGap:"",finalRisk:"",status:"complete"}));const R=JSON.stringify(e);if(h.current===R)return;h.current=R;let N=[],S=[];e=e.map(e=>{var i;const r=`${(e={...e,subBlockNumber:null!==(i=e.subBlockNumber)&&void 0!==i?i:"1"}).storyNumber}-${e.blockNumber}-${e.subBlockNumber}`;if(k.current.has(r))return null;k.current.add(r);let{outputText:a,reasonings:l,gpt_citation:c,processedDescription:u}=t.processAIReasoningFromBlocks(e.value,e.blockNumber,e.storyNumber,e.description);n(e=>{var t;return c.length>0&&((null==e?void 0:e.gpt_citations)||(e.gpt_citations=[]),null===(t=e.gpt_citations)||void 0===t||t.push(...c)),{...e}}),N.push(...l),S.push([...l]);const d=l.filter(e=>e.on_demand).flatMap(e=>[...e.reason.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g),...e.gap.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g)].map(e=>{const[t,i]=e[1].split("$");return"book_citation_doc"!==t&&"book_citation_pdf"!==t&&"document_citation"!==t?null:{citation_number:i,customMetadata:{type:"document_citation"===t?"book_citation_pdf":t,file_name:"",fileType:"",gcs_upload_url:""}}}).filter(Boolean));d.length&&n(e=>{var t;return{...e,file_citations:[...null!==(t=e.file_citations)&&void 0!==t?t:[],...d]}});let m=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}<SUB_BLOCK>${e.subBlockNumber}`;return _||f.current.has(m)||(!async function(e,t,i){var s,r;let a="",l="";try{const c=await p(e,i,t);o(e=>{var t;const i=[...e];return null===(t=c.response.ai_reasonings)||void 0===t||t.forEach(e=>{const t=i.findIndex(t=>t.id===e.id);-1!==t&&e.gap.length>0&&e.reason.length>0&&(i[t]={...e})}),i}),a=(null===(s=c.response)||void 0===s?void 0:s.gap_items_prompt)||"",l=(null===(r=c.response)||void 0===r?void 0:r.risk_items_prompt)||"",(a||l)&&(y.current={gap_items_prompt:a,risk_items_prompt:l}),n(e=>{var t,i,o,n,s,r,a,l,u,d,p,_,m,g;return{...e,appmod_citations:[...null!==(t=e.appmod_citations)&&void 0!==t?t:[],...null!==(i=c.response.appmod_citations)&&void 0!==i?i:[]],audio_citations:[...null!==(o=e.audio_citations)&&void 0!==o?o:[],...null!==(n=c.response.audio_citations)&&void 0!==n?n:[]],file_citations:[...null!==(s=e.file_citations)&&void 0!==s?s:[],...null!==(r=c.response.file_citations)&&void 0!==r?r:[]],image_citations:[...null!==(a=e.image_citations)&&void 0!==a?a:[],...null!==(l=c.response.image_citations)&&void 0!==l?l:[]],rca_citations:[...null!==(u=e.rca_citations)&&void 0!==u?u:[],...null!==(d=c.response.rca_citations)&&void 0!==d?d:[]],web_citations:[...null!==(p=e.web_citations)&&void 0!==p?p:[],...null!==(_=c.response.web_citations)&&void 0!==_?_:[]],readfile_citations:[...null!==(m=e.readfile_citations)&&void 0!==m?m:[],...null!==(g=c.response.readfile_citations)&&void 0!==g?g:[]]}})}catch(t){console.error("[liblogs] processCitationsByBlock error — story:%s block:%s",e.storyNumber,e.blockNumber,t)}finally{let t=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}`;if(b.current.add(t),b.current.size===f.current.size){const e=a||y.current.gap_items_prompt,t=l||y.current.risk_items_prompt;g({finalGap:e,finalRisk:t,status:"complete"})}}}({...e,value:a,description:u},l,s),f.current.add(m)),{...e,value:a,description:u}}).filter(Boolean),N.forEach(e=>{o(t=>(t.find(t=>t.id===e.id)||t.push(e),[...t]))}),e.length>0&&e.map(({title:e,section:t,value:o,storyNumber:n,description:s,blockNumber:p,big_enough:_,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:h},y)=>{i(i=>{var k,R,N,B,$,C,O,w;const E=i.findIndex(e=>e.storyNumber===n);if("intro"===t)console.log("testing::intro",g),-1===E?i.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,description:s,storyNumber:n,sub_features:[],section:t,blockNumber:p,aiReasoning:S[y],big_enough:_,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:h}):(i[E].value+=o,i[E].aiReasoning=i[E].aiReasoning||[],null===(R=null===(k=i[E])||void 0===k?void 0:k.aiReasoning)||void 0===R||R.push(...S[y]),i[E].big_enough=_,i[E].big_enough_decision_factors=m,i[E].technicality_score=g,i[E].gapValue=f,i[E].confidenceScore=b,i[E].metadata=h);else{i[E].sub_features||(i[E].sub_features=[]);const s=(null===(B=null===(N=i[E])||void 0===N?void 0:N.sub_features)||void 0===B?void 0:B.findIndex(e=>e.blockNumber===p))||-1;if(-1===s)null===(C=null===($=i[E])||void 0===$?void 0:$.sub_features)||void 0===C||C.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,storyNumber:n,blockNumber:p,section:t,aiReasoning:S[y],big_enough:_,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:h});else{let e=null===(w=null===(O=null==i?void 0:i[E])||void 0===O?void 0:O.sub_features)||void 0===w?void 0:w[s];e.value=(e.value||"")+o,e.aiReasoning=e.aiReasoning||[],e.aiReasoning.push(...S[y]),e.big_enough=_,e.big_enough_decision_factors=m,e.technicality_score=g,e.gapValue=f,e.confidenceScore=b,e.metadata=h}}const I=JSON.stringify(i);return v.current!==I&&(d({key:`streaming-redis-key-${r}`,value:{mmvf_list:i,knowledgeBase:a,projectAnalyserSummary:l,dataSources_files:c,ai_reasonings:u}}),v.current=I),[...i]})})}catch(e){console.error("Error in processing Stream Content",e)}}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../utils/proccess-stream.utils.js");exports.useStreamContentHandler=function({setUserStory:i,setAiReasoning:o,setUserStoryCitations:n,onStreamingCompleted:s,isGraphQLCallInProgress:r,knowledgeBase:a,projectAnalyserSummary:l,dataSourceFiles:c,aiReasoning:u,setRedisValue:d,fetchCitationByBlock:p,isOnDemandCitation:_}){const[m,g]=e.useState({finalGap:"",finalRisk:"",status:"in-progress"}),f=e.useRef(new Set),b=e.useRef(new Set),v=e.useRef(null),h=e.useRef(null),y=e.useRef({gap_items_prompt:"",risk_items_prompt:""}),k=e.useRef(new Set);return e.useEffect(()=>{"complete"!==m.status||r||(console.log("streaming::userstory::onStreamingCompleted"),s(m.finalGap,m.finalRisk),f.current.clear(),b.current.clear(),v.current=null,h.current=null,y.current={gap_items_prompt:"",risk_items_prompt:""},k.current.clear(),g({finalGap:"",finalRisk:"",status:"in-progress"}))},[m,r]),{processStreamContent:function(e,s,r,m){try{console.log("streaming::userstory::completed",m,_),m&&_&&(console.log("streaming::userstory::completed::lib"),g({finalGap:"",finalRisk:"",status:"complete"}));const R=JSON.stringify(e);if(h.current===R)return;h.current=R;let N=[],S=[];e=e.map(e=>{var i;const r=`${(e={...e,subBlockNumber:null!==(i=e.subBlockNumber)&&void 0!==i?i:"1"}).storyNumber}-${e.blockNumber}-${e.subBlockNumber}`;if(k.current.has(r))return null;k.current.add(r);let{outputText:a,reasonings:l,gpt_citation:c,processedDescription:u}=t.processAIReasoningFromBlocks(e.value,e.blockNumber,e.storyNumber,e.description);n(e=>{var t;return c.length>0&&((null==e?void 0:e.gpt_citations)||(e.gpt_citations=[]),null===(t=e.gpt_citations)||void 0===t||t.push(...c)),{...e}}),N.push(...l),S.push([...l]);const d=l.filter(e=>e.on_demand).flatMap(e=>[...e.reason.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g),...e.gap.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g)].map(e=>{const[t,i]=e[1].split("$");return"book_citation_doc"!==t&&"book_citation_pdf"!==t&&"document_citation"!==t?null:{citation_number:i,customMetadata:{type:"document_citation"===t?"book_citation_pdf":t,file_name:"",fileType:"",gcs_upload_url:""}}}).filter(Boolean));d.length&&n(e=>{var t;return{...e,file_citations:[...null!==(t=e.file_citations)&&void 0!==t?t:[],...d]}});let m=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}<SUB_BLOCK>${e.subBlockNumber}`;return _||f.current.has(m)||(!async function(e,t,i){var s,r;let a="",l="";try{const c=await p(e,i,t);o(e=>{var t;const i=[...e];return null===(t=c.response.ai_reasonings)||void 0===t||t.forEach(e=>{const t=i.findIndex(t=>t.id===e.id);-1!==t&&e.gap.length>0&&e.reason.length>0&&(i[t]={...e})}),i}),a=(null===(s=c.response)||void 0===s?void 0:s.gap_items_prompt)||"",l=(null===(r=c.response)||void 0===r?void 0:r.risk_items_prompt)||"",(a||l)&&(y.current={gap_items_prompt:a,risk_items_prompt:l}),n(e=>{var t,i,o,n,s,r,a,l,u,d,p,_,m,g;return{...e,appmod_citations:[...null!==(t=e.appmod_citations)&&void 0!==t?t:[],...null!==(i=c.response.appmod_citations)&&void 0!==i?i:[]],audio_citations:[...null!==(o=e.audio_citations)&&void 0!==o?o:[],...null!==(n=c.response.audio_citations)&&void 0!==n?n:[]],file_citations:[...null!==(s=e.file_citations)&&void 0!==s?s:[],...null!==(r=c.response.file_citations)&&void 0!==r?r:[]],image_citations:[...null!==(a=e.image_citations)&&void 0!==a?a:[],...null!==(l=c.response.image_citations)&&void 0!==l?l:[]],rca_citations:[...null!==(u=e.rca_citations)&&void 0!==u?u:[],...null!==(d=c.response.rca_citations)&&void 0!==d?d:[]],web_citations:[...null!==(p=e.web_citations)&&void 0!==p?p:[],...null!==(_=c.response.web_citations)&&void 0!==_?_:[]],readfile_citations:[...null!==(m=e.readfile_citations)&&void 0!==m?m:[],...null!==(g=c.response.readfile_citations)&&void 0!==g?g:[]]}})}catch(t){console.error("[liblogs] processCitationsByBlock error — story:%s block:%s",e.storyNumber,e.blockNumber,t)}finally{let t=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}`;if(b.current.add(t),b.current.size===f.current.size){const e=a||y.current.gap_items_prompt,t=l||y.current.risk_items_prompt;g({finalGap:e,finalRisk:t,status:"complete"})}}}({...e,value:a,description:u},l,s),f.current.add(m)),{...e,value:a,description:u}}).filter(Boolean),N.forEach(e=>{o(t=>(t.find(t=>t.id===e.id)||t.push(e),[...t]))}),e.length>0&&e.map(({title:e,section:t,value:o,storyNumber:n,description:s,blockNumber:p,big_enough:_,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:h},y)=>{i(i=>{var k,R,N,B,$,C,O,w;const E=i.findIndex(e=>e.storyNumber===n);if("intro"===t)-1===E?i.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,description:s,storyNumber:n,sub_features:[],section:t,blockNumber:p,aiReasoning:S[y],big_enough:_,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:h}):(i[E].value+=o,i[E].aiReasoning=i[E].aiReasoning||[],null===(R=null===(k=i[E])||void 0===k?void 0:k.aiReasoning)||void 0===R||R.push(...S[y]),i[E].big_enough=_,i[E].big_enough_decision_factors=m,i[E].technicality_score=g,i[E].gapValue=f,i[E].confidenceScore=b,i[E].metadata=h);else{i[E].sub_features||(i[E].sub_features=[]);const s=(null===(B=null===(N=i[E])||void 0===N?void 0:N.sub_features)||void 0===B?void 0:B.findIndex(e=>e.blockNumber===p))||-1;if(-1===s)null===(C=null===($=i[E])||void 0===$?void 0:$.sub_features)||void 0===C||C.push({artifactId:`STORY-${n}-${p}`,title:e,value:o,storyNumber:n,blockNumber:p,section:t,aiReasoning:S[y],big_enough:_,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:h});else{let e=null===(w=null===(O=null==i?void 0:i[E])||void 0===O?void 0:O.sub_features)||void 0===w?void 0:w[s];e.value=(e.value||"")+o,e.aiReasoning=e.aiReasoning||[],e.aiReasoning.push(...S[y]),e.big_enough=_,e.big_enough_decision_factors=m,e.technicality_score=g,e.gapValue=f,e.confidenceScore=b,e.metadata=h}}const I=JSON.stringify(i);return v.current!==I&&(d({key:`streaming-redis-key-${r}`,value:{mmvf_list:i,knowledgeBase:a,projectAnalyserSummary:l,dataSources_files:c,ai_reasonings:u}}),v.current=I),[...i]})})}catch(e){console.error("Error in processing Stream Content",e)}}}};
2
2
  //# sourceMappingURL=useStreamContentHandler.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as o,jsx as e,Fragment as i}from"react/jsx-runtime";import{useState as n,useRef as l}from"react";import r from"../../icons/BigEnoughIcon.js";import c from"../ai-reasoning/AiReasoningCitationContent.js";import{useRequirementAI as s}from"../RequirementAIWrapper/RequirementAIWrapper.js";import t from"./BigEnoughPanel.module.css.js";const a=({customIcons:a,customStyles:d,currentUserStory:u,panelStyles:v,showPanel:g=!1})=>{var p,m,_,h,y,b;s();const[f,S]=n(!!g),P=l(null);return o("div",{onClick:o=>o.stopPropagation(),children:[!g&&e("button",{ref:P,className:t.developerEffortButton,style:null==v?void 0:v.buttonStyle,onClick:o=>{o.stopPropagation(),S(o=>!o)},children:e(r,{color:null==v?void 0:v.iconColor,size:null==v?void 0:v.iconSize})}),f&&o(i,{children:[e("div",{className:null==t?void 0:t.backdrop,style:g?null==v?void 0:v.showPanelBackdropStyles:null==v?void 0:v.backdropStyle,onClick:o=>{o.stopPropagation(),S(!1)},onWheel:o=>o.stopPropagation()}),o("div",{className:`${t.dropdown} ${g?t.showPanelDropdown:""}`,style:{...null==v?void 0:v.dropdownStyle,...g?null==v?void 0:v.showPanelDropdownStyle:{}},children:[e(c,{cognitiveDecisionHeaders:{mainHeader:`Feature Implementation Score - ${(null==u?void 0:u.big_enough)||0}`},big_enough_block:null===(p=u.big_enough_decision_factors)||void 0===p?void 0:p.big_enough_block,aiReason:{relevance_score:(null===(m=null==u?void 0:u.big_enough_decision_factors)||void 0===m?void 0:m.relevance_score)||0,reason:(null===(_=null==u?void 0:u.big_enough_decision_factors)||void 0===_?void 0:_.score_reason)||"",gap:(null===(h=null==u?void 0:u.big_enough_decision_factors)||void 0===h?void 0:h.gap)||"",id:"big-enough-cd"},customIcons:a,customStyles:d}),(null==u?void 0:u.technicality_score)&&e(c,{cognitiveDecisionHeaders:{mainHeader:`Technicality Score - ${(null==u?void 0:u.technicality_score.score)||0}`},scenario:"technicality_score",aiReason:{relevance_score:Number((null===(y=null==u?void 0:u.technicality_score)||void 0===y?void 0:y.relevance_score)||-1),reason:(null==u?void 0:u.technicality_score.reasoning)||"",gap:(null===(b=null==u?void 0:u.technicality_score)||void 0===b?void 0:b.gap)||"",id:"big-enough-cd"},customIcons:a,customStyles:d})]})]})]})};export{a as BigEnoughPanel};
1
+ import{jsxs as o,jsx as e,Fragment as i}from"react/jsx-runtime";import{useState as n,useRef as l}from"react";import c from"../../icons/BigEnoughIcon.js";import r from"../ai-reasoning/AiReasoningCitationContent.js";import{useRequirementAI as s}from"../RequirementAIWrapper/RequirementAIWrapper.js";import t from"./BigEnoughPanel.module.css.js";const a=({customIcons:a,customStyles:d,currentUserStory:u,panelStyles:v,showPanel:g=!1})=>{var p,m,h,_,y,b;s();const[f,S]=n(!!g),P=l(null);return o("div",{onClick:o=>o.stopPropagation(),children:[!g&&e("button",{ref:P,className:t.developerEffortButton,style:null==v?void 0:v.buttonStyle,onClick:o=>{o.stopPropagation(),S(o=>!o)},children:e(c,{color:null==v?void 0:v.iconColor,size:null==v?void 0:v.iconSize})}),f&&o(i,{children:[e("div",{className:null==t?void 0:t.backdrop,style:g?null==v?void 0:v.showPanelBackdropStyles:null==v?void 0:v.backdropStyle,onClick:o=>{o.stopPropagation(),S(!1)},onWheel:o=>o.stopPropagation()}),e("div",{className:`${t.dropdown} ${g?t.showPanelDropdown:""}`,style:{...null==v?void 0:v.dropdownStyle,...g?null==v?void 0:v.showPanelDropdownStyle:{}},children:o("div",{className:t.scoreContent,children:[e(r,{cognitiveDecisionHeaders:{mainHeader:`Feature Implementation Score - ${(null==u?void 0:u.big_enough)||0}`},big_enough_block:null===(p=u.big_enough_decision_factors)||void 0===p?void 0:p.big_enough_block,aiReason:{relevance_score:(null===(m=null==u?void 0:u.big_enough_decision_factors)||void 0===m?void 0:m.relevance_score)||0,reason:(null===(h=null==u?void 0:u.big_enough_decision_factors)||void 0===h?void 0:h.score_reason)||"",gap:(null===(_=null==u?void 0:u.big_enough_decision_factors)||void 0===_?void 0:_.gap)||"",id:"big-enough-cd"},customIcons:a,customStyles:d}),(null==u?void 0:u.technicality_score)&&e(r,{cognitiveDecisionHeaders:{mainHeader:`Technicality Score - ${(null==u?void 0:u.technicality_score.score)||0}`},scenario:"technicality_score",aiReason:{relevance_score:Number((null===(y=null==u?void 0:u.technicality_score)||void 0===y?void 0:y.relevance_score)||-1),reason:(null==u?void 0:u.technicality_score.reasoning)||"",gap:(null===(b=null==u?void 0:u.technicality_score)||void 0===b?void 0:b.gap)||"",id:"big-enough-cd"},customIcons:a,customStyles:d})]})})]})]})};export{a as BigEnoughPanel};
2
2
  //# sourceMappingURL=BigEnoughPanel.js.map
@@ -1,2 +1,2 @@
1
- var e={developerEffortButton:"BigEnoughPanel-module_developerEffortButton__KLQ-Z",backdrop:"BigEnoughPanel-module_backdrop__J0KVD",dropdown:"BigEnoughPanel-module_dropdown__mlBHL",showPanelDropdown:"BigEnoughPanel-module_showPanelDropdown__qz6dk"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".BigEnoughPanel-module_developerEffortButton__KLQ-Z{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.BigEnoughPanel-module_backdrop__J0KVD{height:100vh;inset:0;position:absolute;width:100vw;z-index:40}.BigEnoughPanel-module_dropdown__mlBHL.BigEnoughPanel-module_showPanelDropdown__qz6dk{max-height:70vh;overflow-y:scroll;top:10px}.BigEnoughPanel-module_dropdown__mlBHL{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;left:20px;margin-top:1.25rem;position:absolute;top:100%;width:91.666667%;z-index:40}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
1
+ var e={developerEffortButton:"BigEnoughPanel-module_developerEffortButton__KLQ-Z",backdrop:"BigEnoughPanel-module_backdrop__J0KVD",dropdown:"BigEnoughPanel-module_dropdown__mlBHL",showPanelDropdown:"BigEnoughPanel-module_showPanelDropdown__qz6dk",scoreContent:"BigEnoughPanel-module_scoreContent__LF08L"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".BigEnoughPanel-module_developerEffortButton__KLQ-Z{background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;margin-right:3px;padding:.4rem .8rem}.BigEnoughPanel-module_backdrop__J0KVD{height:100vh;inset:0;position:absolute;width:100vw;z-index:40}.BigEnoughPanel-module_dropdown__mlBHL.BigEnoughPanel-module_showPanelDropdown__qz6dk{max-height:70vh;overflow-y:scroll;top:10px}.BigEnoughPanel-module_dropdown__mlBHL{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;left:20px;margin-top:1.25rem;position:absolute;top:100%;width:91.666667%;z-index:40}.BigEnoughPanel-module_scoreContent__LF08L{max-height:70vh;overflow-x:hidden;overflow-y:auto;padding-right:4px}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
2
2
  //# sourceMappingURL=BigEnoughPanel.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{useState as l,useRef as n,useCallback as r,useMemo as i,useEffect as a}from"react";import s from"showdown";import{useRequirementAI as d}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as u}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as v,getFirstUnapprovedStoryId as p,approveAllSegments as m}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as h}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as y}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as f}from"../../icons/CheckIcon.js";import{BookmarkIcon as b}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as I}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{ExternalLink as C,Download as A,Share2 as w,Copy as E,SidebarOpenIcon as N,SidebarCloseIcon as U}from"lucide-react";import{UserStoryApprovalScreenContext as x,useUserStoryApprovalScreen as T}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as k}from"../story-screen/BigEnoughPanel.js";import B from"../../icons/BigEnoughIcon.js";import{Menu as D,MenuItem as F,Tooltip as j}from"@mui/material";import{formatMarkdown as P}from"../../utils/helpers.js";import{replaceTitleSection as R}from"../../utils/user-story.utils.js";const M={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},_={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},z=Object.assign(({artifactTitleIds:o,config:t={},callbacks:s={},labels:m={},isDisabled:S=!1,disabledReason:y="",children:f,classNames:b,selectedArtifactId:I})=>{var C;const{userStory:A,customStyles:w}=d(),E={...M,...t},N={..._,...m},[U,T]=l([]),[k,B]=l(""),[D,F]=l(""),[j,P]=l(!1),[R,z]=l(!0),W=n(void 0),$=r((e,o,t,l)=>{s.onShowNotification?s.onShowNotification(e,o,t,l):console.log(`[${e.toUpperCase()}] ${o}: ${t}`)},[s]),L=r(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),O=i(()=>{const e=U.findIndex(e=>e.artifactId===k);return e>=0?e:0},[U,k]),V=U[O];a(()=>{W.current=V},[V]),a(()=>{var e;if(!(null==A?void 0:A.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===A.length&&z(!1),A.length>0&&!k&&B(I||A[0].artifactId);const o=c(u(A));T(o)},[A,I]),a(()=>{I&&I!==k&&B(I)},[I,k]),a(()=>{if(!V)return;const e=v(V,"");F(e)},[null==V?void 0:V.artifactId]);const q=r((e,o)=>{T(t=>{const l=[...t];if("APPROVED"===o.approval_status&&"APPROVED"!==t[e].approval_status){const e=p(t,o.artifactId);e&&B(e)}return l[e]=o,l})},[]),H=r(e=>{const o=W.current;if(!o)return;const t=v(o,e);"NA"!==t&&(F(""),setTimeout(()=>{F(t)},0))},[]);h({userStoryForApproval:U,selectedUserStoryForApproval:V,userStoryIndex:O,callbacks:s,labels:N,onSaveUserStory:q});const G={height:E.containerHeight,...E.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},Y={userStoryForApproval:U,setUserStoryForApproval:T,selectedStoryArtifactId:k,setSelectedStoryArtifactId:B,selectedUserStoryIndex:O,selectedUserStoryForApproval:V,currentContentId:D,setCurrentContentId:F,isEditingSegment:j,setIsEditingSegment:P,isSidebarExpanded:R,setIsSidebarExpanded:z,artifactTitleIds:o,config:E,labels:N,callbacks:s,isDisabled:S,disabledReason:y,handleSaveUserStory:q,handleUpdateContentId:H,showNotification:$,scrollToElement:L};return e(x.Provider,{value:Y,children:e("div",{className:`${g.container} ${(null==b?void 0:b.container)||""}`,style:{...G,...null===(C=null==w?void 0:w.approvalScreen)||void 0===C?void 0:C.wrapperContainer},children:f})})},{Sidebar:({Component:o,config:t,className:l})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingSegment:s,artifactTitleIds:d}=T();return o?e(o,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e(I,{config:t,className:l})},SidebarToggle:({OpenIcon:o,CloseIcon:t,className:l=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=T(),i=o||N,a=t||U;return e("div",{className:`${g.sidebarToggleWrapper} ${l}`,children:e("button",{onClick:()=>r(e=>!e),className:g.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:e(n?a:i,{})})})},Content:({children:i,ButtonComponent:a,hideApproveAll:c=!1,pageTitle:u="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:p,handleOpenSendDialog:h,pageDescription:S="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var I,N,U,x,M,_,z,W,$,L,O,V,q,H,G,Y,J,K,Q,X,Z,ee,oe,te,le,ne,re,ie,ae,se,de;const{selectedUserStoryForApproval:ce,selectedUserStoryIndex:ue,artifactTitleIds:ve,labels:pe,config:me,isDisabled:he,disabledReason:Se,isEditingSegment:ye,handleSaveUserStory:ge,setCurrentContentId:fe,showNotification:be}=T(),{userStory:Ie,setUserStory:Ce}=d(),Ae=Ie[0],[we,Ee]=l(null),Ne=()=>{Ee(null)},Ue=n(null),[xe,Te]=l(!1),{customStyles:ke,customIcons:Be}=d(),De=null==ke?void 0:ke.userStoryCardStyles,[Fe,je]=l(!1),Pe=r(()=>{if(!ce)return;if(ye)return void be("warn","Warning!",pe.unsavedChangesWarning,3e3);const e=m(ce);ge(ue,e),fe("")},[ce,ue,ye,pe,ge,fe,be]);if(!ce)return null;const Re=ve[ue]||"",Me="APPROVED"===ce.approval_status,_e=he?Se:"",ze=null!=(null==ce?void 0:ce.big_enough)&&!Number.isNaN(ce.big_enough)&&!!(null==ce?void 0:ce.big_enough_decision_factors);return o("div",{className:g.content,style:{...null===(N=null===(I=null==ke?void 0:ke.approvalScreen)||void 0===I?void 0:I.content)||void 0===N?void 0:N.content},"data-lsc-ui-page-title":u,"data-lsc-ui-page-description":S,children:[o("div",{className:g.header,style:{...null===(M=null===(x=null===(U=null==ke?void 0:ke.approvalScreen)||void 0===U?void 0:U.body)||void 0===x?void 0:x.contentSegment)||void 0===M?void 0:M.header},children:[o("div",{className:g.headerLeft,style:{...null===(z=null===(_=null==ke?void 0:ke.approvalScreen)||void 0===_?void 0:_.content)||void 0===z?void 0:z.headerLeft},children:[o("div",{className:g.headerMeta,style:{...null===(L=null===($=null===(W=null==ke?void 0:ke.approvalScreen)||void 0===W?void 0:W.body)||void 0===$?void 0:$.contentSegment)||void 0===L?void 0:L.headerMeta},children:[e(b,{size:16,color:(null===(q=null===(V=null===(O=null==ke?void 0:ke.approvalScreen)||void 0===O?void 0:O.body)||void 0===V?void 0:V.contentSegment)||void 0===q?void 0:q.bookMarkColor)||"#8C8C8C"}),e("h2",{className:g.headerArtifactId,style:{...null===(Y=null===(G=null===(H=null==ke?void 0:ke.approvalScreen)||void 0===H?void 0:H.body)||void 0===G?void 0:G.contentSegment)||void 0===Y?void 0:Y.headerArtifactId},children:Re})]}),e("p",{className:g.headerTitle,style:{...null===(Q=null===(K=null===(J=null==ke?void 0:ke.approvalScreen)||void 0===J?void 0:J.body)||void 0===K?void 0:K.contentSegment)||void 0===Q?void 0:Q.headerTitle},children:null==ce?void 0:ce.title})]}),o("div",{className:null==g?void 0:g.containerStyle,style:null===(Z=null===(X=null==ke?void 0:ke.approvalScreen)||void 0===X?void 0:X.BigEnoughStyles)||void 0===Z?void 0:Z.containerStyle,children:[ze&&e("button",{className:g.developerEffortButton,style:null===(oe=null===(ee=null==ke?void 0:ke.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles)||void 0===oe?void 0:oe.buttonStyle,onClick:()=>je(!Fe),children:e(B,{color:null===(le=null===(te=null==ke?void 0:ke.approvalScreen)||void 0===te?void 0:te.BigEnoughStyles)||void 0===le?void 0:le.iconColor,size:null===(re=null===(ne=null==ke?void 0:ke.approvalScreen)||void 0===ne?void 0:ne.BigEnoughStyles)||void 0===re?void 0:re.iconSize})}),v&&o(t,{children:[e("button",{className:g.iconButton,style:null==De?void 0:De.iconButton,onClick:e=>{Ee(e.currentTarget)},children:e(C,{size:16})}),o(D,{id:"user-story-share-menu",anchorEl:we,open:!!we,onClose:()=>Ee(null),style:null==De?void 0:De.userStoryShareMenu,children:[e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{Te(!0),p&&(await Promise.all([p("pdf"),p("doc")]),Te(!1))},children:o("div",{ref:Ue,className:g.menuItemContent,style:null==De?void 0:De.menuItemContent,children:[e(A,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Download"})]})}),e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{let e=Ae;e={...Ae,value:`${R(null==Ae?void 0:Ae.value,Ae.title)}`},null==h||h(!0,[e],Ae.artifactId),Ne()},children:o("div",{style:null==De?void 0:De.menuItemContent,className:g.menuItemContentPadded,children:[e(w,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Send"})]})}),e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{const e=(new s.Converter).makeHtml(P(Ae.value)||Ae.value),o=function(e){const o=(new s.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=o,t.textContent||t.innerText||""}(P(Ae.value)||Ae.value),t=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([t]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Ne()}},children:o("div",{style:null==De?void 0:De.menuItemContent,className:g.menuItemContentPadded,children:[e(E,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Copy"})]})})]})]}),!c&&me.showApproveAllButton&&e("div",{className:g.headerRight,children:Me?e(y,{status:"APPROVED",label:pe.approved}):e(j,a?{title:_e,children:e("span",{children:e(a,{type:"fill",onClick:Pe,isDisable:he,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:pe.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:o("div",{className:g.approveAllContent,children:[e(f,{size:16,color:"white"}),e("span",{children:pe.approveAll})]})})})}:{title:_e,children:e("span",{children:o("button",{onClick:Pe,disabled:he,className:g.approveAllButtonDefault,style:{...null===(ae=null===(ie=null==ke?void 0:ke.approvalScreen)||void 0===ie?void 0:ie.content)||void 0===ae?void 0:ae.approveAllButtonDefault},children:[e(f,{size:16,color:"white"}),e("span",{children:pe.approveAll})]})})})})]})]}),Fe&&ze&&e("div",{className:g.bigEnoughWrapper,children:e(k,{customIcons:null==Be?void 0:Be.userStoryIcons,customStyles:null===(se=null==ke?void 0:ke.approvalScreen)||void 0===se?void 0:se.aiReasoningCitaionStyles,currentUserStory:ce,panelStyles:null===(de=null==ke?void 0:ke.approvalScreen)||void 0===de?void 0:de.BigEnoughStyles,showPanel:Fe})}),i]})},Body:({children:t,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s=!1})=>{var c,u,v;const{selectedUserStoryForApproval:p,selectedUserStoryIndex:m,artifactTitleIds:h,handleSaveUserStory:y}=T(),{customStyles:f}=d(),b=r(e=>{y(m,e)},[m,y]),I=r((e,o)=>{var t;if(!p)return;const l={...p,sub_features:null===(t=p.sub_features)||void 0===t?void 0:t.map((t,l)=>l===e?o:t)};y(m,l)},[p,m,y]),C=r(e=>{var o;if(!p)return;const t={...p,sub_features:null===(o=p.sub_features)||void 0===o?void 0:o.filter((o,t)=>t!==e)};y(m,t)},[p,m,y]);if(!p)return null;const A=h[m]||"";return o("div",{className:g.body,style:{...null===(u=null===(c=null==f?void 0:f.approvalScreen)||void 0===c?void 0:c.body)||void 0===u?void 0:u.container},children:[e(S,{userStoryForApproval:p,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:l,ViewerComponent:n}),null===(v=p.sub_features)||void 0===v?void 0:v.map((o,t)=>e(S,{userStoryForApproval:o,artifactTitleId:`${A} - ${String.fromCharCode(65+t)}`,isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:I,onDeleteSubFeature:C,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s},o.artifactId)),t]})}});export{z as default};
1
+ import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{useState as l,useRef as n,useCallback as r,useMemo as i,useEffect as a}from"react";import s from"showdown";import{useRequirementAI as d}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as u}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as p,getFirstUnapprovedStoryId as v,approveAllSegments as m}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as h}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as y}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as f}from"../../icons/CheckIcon.js";import{BookmarkIcon as b}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as I}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{ExternalLink as A,Download as C,Share2 as w,Copy as N,SidebarOpenIcon as U,SidebarCloseIcon as E}from"lucide-react";import{UserStoryApprovalScreenContext as x,useUserStoryApprovalScreen as T}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as k}from"../story-screen/BigEnoughPanel.js";import{Menu as D,MenuItem as F,Tooltip as B}from"@mui/material";import{formatMarkdown as j}from"../../utils/helpers.js";import{replaceTitleSection as R}from"../../utils/user-story.utils.js";const M={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},P={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},_=Object.assign(({artifactTitleIds:o,config:t={},callbacks:s={},labels:m={},isDisabled:S=!1,disabledReason:y="",children:f,classNames:b,selectedArtifactId:I})=>{var A;const{userStory:C,customStyles:w}=d(),N={...M,...t},U={...P,...m},[E,T]=l([]),[k,D]=l(""),[F,B]=l(""),[j,R]=l(!1),[_,W]=l(!0),$=n(void 0),z=r((e,o,t,l)=>{s.onShowNotification?s.onShowNotification(e,o,t,l):console.log(`[${e.toUpperCase()}] ${o}: ${t}`)},[s]),L=r(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),O=i(()=>{const e=E.findIndex(e=>e.artifactId===k);return e>=0?e:0},[E,k]),V=E[O];a(()=>{$.current=V},[V]),a(()=>{var e;if(!(null==C?void 0:C.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===C.length&&W(!1),C.length>0&&!k&&D(I||C[0].artifactId);const o=c(u(C));T(o)},[C,I]),a(()=>{I&&I!==k&&D(I)},[I,k]),a(()=>{if(!V)return;const e=p(V,"");B(e)},[null==V?void 0:V.artifactId]);const q=r((e,o)=>{T(t=>{const l=[...t];if("APPROVED"===o.approval_status&&"APPROVED"!==t[e].approval_status){const e=v(t,o.artifactId);e&&D(e)}return l[e]=o,l})},[]),H=r(e=>{const o=$.current;if(!o)return;const t=p(o,e);"NA"!==t&&(B(""),setTimeout(()=>{B(t)},0))},[]);h({userStoryForApproval:E,selectedUserStoryForApproval:V,userStoryIndex:O,callbacks:s,labels:U,onSaveUserStory:q});const G={height:N.containerHeight,...N.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},Y={userStoryForApproval:E,setUserStoryForApproval:T,selectedStoryArtifactId:k,setSelectedStoryArtifactId:D,selectedUserStoryIndex:O,selectedUserStoryForApproval:V,currentContentId:F,setCurrentContentId:B,isEditingSegment:j,setIsEditingSegment:R,isSidebarExpanded:_,setIsSidebarExpanded:W,artifactTitleIds:o,config:N,labels:U,callbacks:s,isDisabled:S,disabledReason:y,handleSaveUserStory:q,handleUpdateContentId:H,showNotification:z,scrollToElement:L};return e(x.Provider,{value:Y,children:e("div",{className:`${g.container} ${(null==b?void 0:b.container)||""}`,style:{...G,...null===(A=null==w?void 0:w.approvalScreen)||void 0===A?void 0:A.wrapperContainer},children:f})})},{Sidebar:({Component:o,config:t,className:l})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingSegment:s,artifactTitleIds:d}=T();return o?e(o,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e(I,{config:t,className:l})},SidebarToggle:({OpenIcon:o,CloseIcon:t,className:l=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=T(),i=o||U,a=t||E;return e("div",{className:`${g.sidebarToggleWrapper} ${l}`,children:e("button",{onClick:()=>r(e=>!e),className:g.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:e(n?a:i,{})})})},Content:({children:i,ButtonComponent:a,hideApproveAll:c=!1,pageTitle:u="Review Generated Requirements",showShareIcon:p=!1,handleDownloadUserStory:v,handleOpenSendDialog:h,pageDescription:S="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var I,U,E,x,M,P,_,W,$,z,L,O,V,q,H,G,Y,J,K,Q,X,Z,ee,oe,te;const{selectedUserStoryForApproval:le,selectedUserStoryIndex:ne,artifactTitleIds:re,labels:ie,config:ae,isDisabled:se,disabledReason:de,isEditingSegment:ce,handleSaveUserStory:ue,setCurrentContentId:pe,showNotification:ve}=T(),{userStory:me,setUserStory:he}=d(),Se=me[0],[ye,ge]=l(null),fe=()=>{ge(null)},be=n(null),[Ie,Ae]=l(!1),{customStyles:Ce,customIcons:we}=d(),Ne=null==Ce?void 0:Ce.userStoryCardStyles,Ue=r(()=>{if(!le)return;if(ce)return void ve("warn","Warning!",ie.unsavedChangesWarning,3e3);const e=m(le);ue(ne,e),pe("")},[le,ne,ce,ie,ue,pe,ve]);if(!le)return null;const Ee=re[ne]||"",xe="APPROVED"===le.approval_status,Te=se?de:"",ke=null!=(null==le?void 0:le.big_enough)&&!Number.isNaN(le.big_enough)&&!!(null==le?void 0:le.big_enough_decision_factors);return o("div",{className:g.content,style:{...null===(U=null===(I=null==Ce?void 0:Ce.approvalScreen)||void 0===I?void 0:I.content)||void 0===U?void 0:U.content},"data-lsc-ui-page-title":u,"data-lsc-ui-page-description":S,children:[o("div",{className:g.header,style:{...null===(M=null===(x=null===(E=null==Ce?void 0:Ce.approvalScreen)||void 0===E?void 0:E.body)||void 0===x?void 0:x.contentSegment)||void 0===M?void 0:M.header},children:[o("div",{className:g.headerLeft,style:{...null===(_=null===(P=null==Ce?void 0:Ce.approvalScreen)||void 0===P?void 0:P.content)||void 0===_?void 0:_.headerLeft},children:[o("div",{className:g.headerMeta,style:{...null===(z=null===($=null===(W=null==Ce?void 0:Ce.approvalScreen)||void 0===W?void 0:W.body)||void 0===$?void 0:$.contentSegment)||void 0===z?void 0:z.headerMeta},children:[e(b,{size:16,color:(null===(V=null===(O=null===(L=null==Ce?void 0:Ce.approvalScreen)||void 0===L?void 0:L.body)||void 0===O?void 0:O.contentSegment)||void 0===V?void 0:V.bookMarkColor)||"#8C8C8C"}),e("h2",{className:g.headerArtifactId,style:{...null===(G=null===(H=null===(q=null==Ce?void 0:Ce.approvalScreen)||void 0===q?void 0:q.body)||void 0===H?void 0:H.contentSegment)||void 0===G?void 0:G.headerArtifactId},children:Ee})]}),e("p",{className:g.headerTitle,style:{...null===(K=null===(J=null===(Y=null==Ce?void 0:Ce.approvalScreen)||void 0===Y?void 0:Y.body)||void 0===J?void 0:J.contentSegment)||void 0===K?void 0:K.headerTitle},children:null==le?void 0:le.title})]}),o("div",{className:null==g?void 0:g.containerStyle,style:null===(X=null===(Q=null==Ce?void 0:Ce.approvalScreen)||void 0===Q?void 0:Q.BigEnoughStyles)||void 0===X?void 0:X.containerStyle,children:[ke&&e(k,{customIcons:null==we?void 0:we.userStoryIcons,customStyles:null===(Z=null==Ce?void 0:Ce.approvalScreen)||void 0===Z?void 0:Z.aiReasoningCitaionStyles,currentUserStory:le,panelStyles:null===(ee=null==Ce?void 0:Ce.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles}),p&&o(t,{children:[e("button",{className:g.iconButton,style:null==Ne?void 0:Ne.iconButton,onClick:e=>{ge(e.currentTarget)},children:e(A,{size:16})}),o(D,{id:"user-story-share-menu",anchorEl:ye,open:!!ye,onClose:()=>ge(null),style:null==Ne?void 0:Ne.userStoryShareMenu,children:[e(F,{style:null==Ne?void 0:Ne.userStoryMenuItem,onClick:async()=>{Ae(!0),v&&(await Promise.all([v("pdf"),v("doc")]),Ae(!1))},children:o("div",{ref:be,className:g.menuItemContent,style:null==Ne?void 0:Ne.menuItemContent,children:[e(C,{size:16,color:null==Ne?void 0:Ne.menuIconColor}),e("p",{style:null==Ne?void 0:Ne.menuLabel,children:"Download"})]})}),e(F,{style:null==Ne?void 0:Ne.userStoryMenuItem,onClick:async()=>{let e=Se;e={...Se,value:`${R(null==Se?void 0:Se.value,Se.title)}`},null==h||h(!0,[e],Se.artifactId),fe()},children:o("div",{style:null==Ne?void 0:Ne.menuItemContent,className:g.menuItemContentPadded,children:[e(w,{size:16,color:null==Ne?void 0:Ne.menuIconColor}),e("p",{style:null==Ne?void 0:Ne.menuLabel,children:"Send"})]})}),e(F,{style:null==Ne?void 0:Ne.userStoryMenuItem,onClick:async()=>{const e=(new s.Converter).makeHtml(j(Se.value)||Se.value),o=function(e){const o=(new s.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=o,t.textContent||t.innerText||""}(j(Se.value)||Se.value),t=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([t]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{fe()}},children:o("div",{style:null==Ne?void 0:Ne.menuItemContent,className:g.menuItemContentPadded,children:[e(N,{size:16,color:null==Ne?void 0:Ne.menuIconColor}),e("p",{style:null==Ne?void 0:Ne.menuLabel,children:"Copy"})]})})]})]}),!c&&ae.showApproveAllButton&&e("div",{className:g.headerRight,children:xe?e(y,{status:"APPROVED",label:ie.approved}):e(B,a?{title:Te,children:e("span",{children:e(a,{type:"fill",onClick:Ue,isDisable:se,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ie.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:o("div",{className:g.approveAllContent,children:[e(f,{size:16,color:"white"}),e("span",{children:ie.approveAll})]})})})}:{title:Te,children:e("span",{children:o("button",{onClick:Ue,disabled:se,className:g.approveAllButtonDefault,style:{...null===(te=null===(oe=null==Ce?void 0:Ce.approvalScreen)||void 0===oe?void 0:oe.content)||void 0===te?void 0:te.approveAllButtonDefault},children:[e(f,{size:16,color:"white"}),e("span",{children:ie.approveAll})]})})})})]})]}),i]})},Body:({children:t,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s=!1})=>{var c,u,p;const{selectedUserStoryForApproval:v,selectedUserStoryIndex:m,artifactTitleIds:h,handleSaveUserStory:y}=T(),{customStyles:f}=d(),b=r(e=>{y(m,e)},[m,y]),I=r((e,o)=>{var t;if(!v)return;const l={...v,sub_features:null===(t=v.sub_features)||void 0===t?void 0:t.map((t,l)=>l===e?o:t)};y(m,l)},[v,m,y]),A=r(e=>{var o;if(!v)return;const t={...v,sub_features:null===(o=v.sub_features)||void 0===o?void 0:o.filter((o,t)=>t!==e)};y(m,t)},[v,m,y]);if(!v)return null;const C=h[m]||"";return o("div",{className:g.body,style:{...null===(u=null===(c=null==f?void 0:f.approvalScreen)||void 0===c?void 0:c.body)||void 0===u?void 0:u.container},children:[e(S,{userStoryForApproval:v,artifactTitleId:C,onSaveMainStoryContent:b,EditorComponent:l,ViewerComponent:n}),null===(p=v.sub_features)||void 0===p?void 0:p.map((o,t)=>e(S,{userStoryForApproval:o,artifactTitleId:`${C} - ${String.fromCharCode(65+t)}`,isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:I,onDeleteSubFeature:A,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s},o.artifactId)),t]})}});export{_ as default};
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- import{useState as e,useRef as t,useEffect as i}from"react";import{processAIReasoningFromBlocks as o}from"../utils/proccess-stream.utils.js";function n({setUserStory:n,setAiReasoning:r,setUserStoryCitations:s,onStreamingCompleted:a,isGraphQLCallInProgress:l,knowledgeBase:c,projectAnalyserSummary:u,dataSourceFiles:d,aiReasoning:p,setRedisValue:_,fetchCitationByBlock:m,isOnDemandCitation:g}){const[f,b]=e({finalGap:"",finalRisk:"",status:"in-progress"}),v=t(new Set),h=t(new Set),y=t(null),k=t(null),N=t({gap_items_prompt:"",risk_items_prompt:""}),S=t(new Set);return i(()=>{"complete"!==f.status||l||(console.log("streaming::userstory::onStreamingCompleted"),a(f.finalGap,f.finalRisk),v.current.clear(),h.current.clear(),y.current=null,k.current=null,N.current={gap_items_prompt:"",risk_items_prompt:""},S.current.clear(),b({finalGap:"",finalRisk:"",status:"in-progress"}))},[f,l]),{processStreamContent:function(e,t,i,a){try{console.log("streaming::userstory::completed",a,g),a&&g&&(console.log("streaming::userstory::completed::lib"),b({finalGap:"",finalRisk:"",status:"complete"}));const l=JSON.stringify(e);if(k.current===l)return;k.current=l;let f=[],R=[];e=e.map(e=>{var i;const n=`${(e={...e,subBlockNumber:null!==(i=e.subBlockNumber)&&void 0!==i?i:"1"}).storyNumber}-${e.blockNumber}-${e.subBlockNumber}`;if(S.current.has(n))return null;S.current.add(n);let{outputText:a,reasonings:l,gpt_citation:c,processedDescription:u}=o(e.value,e.blockNumber,e.storyNumber,e.description);s(e=>{var t;return c.length>0&&((null==e?void 0:e.gpt_citations)||(e.gpt_citations=[]),null===(t=e.gpt_citations)||void 0===t||t.push(...c)),{...e}}),f.push(...l),R.push([...l]);const d=l.filter(e=>e.on_demand).flatMap(e=>[...e.reason.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g),...e.gap.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g)].map(e=>{const[t,i]=e[1].split("$");return"book_citation_doc"!==t&&"book_citation_pdf"!==t&&"document_citation"!==t?null:{citation_number:i,customMetadata:{type:"document_citation"===t?"book_citation_pdf":t,file_name:"",fileType:"",gcs_upload_url:""}}}).filter(Boolean));d.length&&s(e=>{var t;return{...e,file_citations:[...null!==(t=e.file_citations)&&void 0!==t?t:[],...d]}});let p=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}<SUB_BLOCK>${e.subBlockNumber}`;return g||v.current.has(p)||(!async function(e,t,i){var o,n;let a="",l="";try{const c=await m(e,i,t);r(e=>{var t;const i=[...e];return null===(t=c.response.ai_reasonings)||void 0===t||t.forEach(e=>{const t=i.findIndex(t=>t.id===e.id);-1!==t&&e.gap.length>0&&e.reason.length>0&&(i[t]={...e})}),i}),a=(null===(o=c.response)||void 0===o?void 0:o.gap_items_prompt)||"",l=(null===(n=c.response)||void 0===n?void 0:n.risk_items_prompt)||"",(a||l)&&(N.current={gap_items_prompt:a,risk_items_prompt:l}),s(e=>{var t,i,o,n,r,s,a,l,u,d,p,_,m,g;return{...e,appmod_citations:[...null!==(t=e.appmod_citations)&&void 0!==t?t:[],...null!==(i=c.response.appmod_citations)&&void 0!==i?i:[]],audio_citations:[...null!==(o=e.audio_citations)&&void 0!==o?o:[],...null!==(n=c.response.audio_citations)&&void 0!==n?n:[]],file_citations:[...null!==(r=e.file_citations)&&void 0!==r?r:[],...null!==(s=c.response.file_citations)&&void 0!==s?s:[]],image_citations:[...null!==(a=e.image_citations)&&void 0!==a?a:[],...null!==(l=c.response.image_citations)&&void 0!==l?l:[]],rca_citations:[...null!==(u=e.rca_citations)&&void 0!==u?u:[],...null!==(d=c.response.rca_citations)&&void 0!==d?d:[]],web_citations:[...null!==(p=e.web_citations)&&void 0!==p?p:[],...null!==(_=c.response.web_citations)&&void 0!==_?_:[]],readfile_citations:[...null!==(m=e.readfile_citations)&&void 0!==m?m:[],...null!==(g=c.response.readfile_citations)&&void 0!==g?g:[]]}})}catch(t){console.error("[liblogs] processCitationsByBlock error — story:%s block:%s",e.storyNumber,e.blockNumber,t)}finally{let t=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}`;if(h.current.add(t),h.current.size===v.current.size){const e=a||N.current.gap_items_prompt,t=l||N.current.risk_items_prompt;b({finalGap:e,finalRisk:t,status:"complete"})}}}({...e,value:a,description:u},l,t),v.current.add(p)),{...e,value:a,description:u}}).filter(Boolean),f.forEach(e=>{r(t=>(t.find(t=>t.id===e.id)||t.push(e),[...t]))}),e.length>0&&e.map(({title:e,section:t,value:o,storyNumber:r,description:s,blockNumber:a,big_enough:l,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:v},h)=>{n(n=>{var k,N,S,B,$,C,O,w;const E=n.findIndex(e=>e.storyNumber===r);if("intro"===t)console.log("testing::intro",g),-1===E?n.push({artifactId:`STORY-${r}-${a}`,title:e,value:o,description:s,storyNumber:r,sub_features:[],section:t,blockNumber:a,aiReasoning:R[h],big_enough:l,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:v}):(n[E].value+=o,n[E].aiReasoning=n[E].aiReasoning||[],null===(N=null===(k=n[E])||void 0===k?void 0:k.aiReasoning)||void 0===N||N.push(...R[h]),n[E].big_enough=l,n[E].big_enough_decision_factors=m,n[E].technicality_score=g,n[E].gapValue=f,n[E].confidenceScore=b,n[E].metadata=v);else{n[E].sub_features||(n[E].sub_features=[]);const i=(null===(B=null===(S=n[E])||void 0===S?void 0:S.sub_features)||void 0===B?void 0:B.findIndex(e=>e.blockNumber===a))||-1;if(-1===i)null===(C=null===($=n[E])||void 0===$?void 0:$.sub_features)||void 0===C||C.push({artifactId:`STORY-${r}-${a}`,title:e,value:o,storyNumber:r,blockNumber:a,section:t,aiReasoning:R[h],big_enough:l,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:v});else{let e=null===(w=null===(O=null==n?void 0:n[E])||void 0===O?void 0:O.sub_features)||void 0===w?void 0:w[i];e.value=(e.value||"")+o,e.aiReasoning=e.aiReasoning||[],e.aiReasoning.push(...R[h]),e.big_enough=l,e.big_enough_decision_factors=m,e.technicality_score=g,e.gapValue=f,e.confidenceScore=b,e.metadata=v}}const U=JSON.stringify(n);return y.current!==U&&(_({key:`streaming-redis-key-${i}`,value:{mmvf_list:n,knowledgeBase:c,projectAnalyserSummary:u,dataSources_files:d,ai_reasonings:p}}),y.current=U),[...n]})})}catch(e){console.error("Error in processing Stream Content",e)}}}}export{n as useStreamContentHandler};
1
+ import{useState as e,useRef as t,useEffect as i}from"react";import{processAIReasoningFromBlocks as o}from"../utils/proccess-stream.utils.js";function n({setUserStory:n,setAiReasoning:r,setUserStoryCitations:s,onStreamingCompleted:a,isGraphQLCallInProgress:l,knowledgeBase:c,projectAnalyserSummary:u,dataSourceFiles:d,aiReasoning:p,setRedisValue:_,fetchCitationByBlock:m,isOnDemandCitation:g}){const[f,b]=e({finalGap:"",finalRisk:"",status:"in-progress"}),v=t(new Set),h=t(new Set),y=t(null),k=t(null),N=t({gap_items_prompt:"",risk_items_prompt:""}),S=t(new Set);return i(()=>{"complete"!==f.status||l||(console.log("streaming::userstory::onStreamingCompleted"),a(f.finalGap,f.finalRisk),v.current.clear(),h.current.clear(),y.current=null,k.current=null,N.current={gap_items_prompt:"",risk_items_prompt:""},S.current.clear(),b({finalGap:"",finalRisk:"",status:"in-progress"}))},[f,l]),{processStreamContent:function(e,t,i,a){try{console.log("streaming::userstory::completed",a,g),a&&g&&(console.log("streaming::userstory::completed::lib"),b({finalGap:"",finalRisk:"",status:"complete"}));const l=JSON.stringify(e);if(k.current===l)return;k.current=l;let f=[],R=[];e=e.map(e=>{var i;const n=`${(e={...e,subBlockNumber:null!==(i=e.subBlockNumber)&&void 0!==i?i:"1"}).storyNumber}-${e.blockNumber}-${e.subBlockNumber}`;if(S.current.has(n))return null;S.current.add(n);let{outputText:a,reasonings:l,gpt_citation:c,processedDescription:u}=o(e.value,e.blockNumber,e.storyNumber,e.description);s(e=>{var t;return c.length>0&&((null==e?void 0:e.gpt_citations)||(e.gpt_citations=[]),null===(t=e.gpt_citations)||void 0===t||t.push(...c)),{...e}}),f.push(...l),R.push([...l]);const d=l.filter(e=>e.on_demand).flatMap(e=>[...e.reason.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g),...e.gap.matchAll(/<a[^>]*href="([^"]+)\?type=on_demand"/g)].map(e=>{const[t,i]=e[1].split("$");return"book_citation_doc"!==t&&"book_citation_pdf"!==t&&"document_citation"!==t?null:{citation_number:i,customMetadata:{type:"document_citation"===t?"book_citation_pdf":t,file_name:"",fileType:"",gcs_upload_url:""}}}).filter(Boolean));d.length&&s(e=>{var t;return{...e,file_citations:[...null!==(t=e.file_citations)&&void 0!==t?t:[],...d]}});let p=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}<SUB_BLOCK>${e.subBlockNumber}`;return g||v.current.has(p)||(!async function(e,t,i){var o,n;let a="",l="";try{const c=await m(e,i,t);r(e=>{var t;const i=[...e];return null===(t=c.response.ai_reasonings)||void 0===t||t.forEach(e=>{const t=i.findIndex(t=>t.id===e.id);-1!==t&&e.gap.length>0&&e.reason.length>0&&(i[t]={...e})}),i}),a=(null===(o=c.response)||void 0===o?void 0:o.gap_items_prompt)||"",l=(null===(n=c.response)||void 0===n?void 0:n.risk_items_prompt)||"",(a||l)&&(N.current={gap_items_prompt:a,risk_items_prompt:l}),s(e=>{var t,i,o,n,r,s,a,l,u,d,p,_,m,g;return{...e,appmod_citations:[...null!==(t=e.appmod_citations)&&void 0!==t?t:[],...null!==(i=c.response.appmod_citations)&&void 0!==i?i:[]],audio_citations:[...null!==(o=e.audio_citations)&&void 0!==o?o:[],...null!==(n=c.response.audio_citations)&&void 0!==n?n:[]],file_citations:[...null!==(r=e.file_citations)&&void 0!==r?r:[],...null!==(s=c.response.file_citations)&&void 0!==s?s:[]],image_citations:[...null!==(a=e.image_citations)&&void 0!==a?a:[],...null!==(l=c.response.image_citations)&&void 0!==l?l:[]],rca_citations:[...null!==(u=e.rca_citations)&&void 0!==u?u:[],...null!==(d=c.response.rca_citations)&&void 0!==d?d:[]],web_citations:[...null!==(p=e.web_citations)&&void 0!==p?p:[],...null!==(_=c.response.web_citations)&&void 0!==_?_:[]],readfile_citations:[...null!==(m=e.readfile_citations)&&void 0!==m?m:[],...null!==(g=c.response.readfile_citations)&&void 0!==g?g:[]]}})}catch(t){console.error("[liblogs] processCitationsByBlock error — story:%s block:%s",e.storyNumber,e.blockNumber,t)}finally{let t=`<STORY_NUMBER>${e.storyNumber}<BLOCK_NUMBER>${e.blockNumber}`;if(h.current.add(t),h.current.size===v.current.size){const e=a||N.current.gap_items_prompt,t=l||N.current.risk_items_prompt;b({finalGap:e,finalRisk:t,status:"complete"})}}}({...e,value:a,description:u},l,t),v.current.add(p)),{...e,value:a,description:u}}).filter(Boolean),f.forEach(e=>{r(t=>(t.find(t=>t.id===e.id)||t.push(e),[...t]))}),e.length>0&&e.map(({title:e,section:t,value:o,storyNumber:r,description:s,blockNumber:a,big_enough:l,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:v},h)=>{n(n=>{var k,N,S,B,$,C,O,w;const E=n.findIndex(e=>e.storyNumber===r);if("intro"===t)-1===E?n.push({artifactId:`STORY-${r}-${a}`,title:e,value:o,description:s,storyNumber:r,sub_features:[],section:t,blockNumber:a,aiReasoning:R[h],big_enough:l,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:v}):(n[E].value+=o,n[E].aiReasoning=n[E].aiReasoning||[],null===(N=null===(k=n[E])||void 0===k?void 0:k.aiReasoning)||void 0===N||N.push(...R[h]),n[E].big_enough=l,n[E].big_enough_decision_factors=m,n[E].technicality_score=g,n[E].gapValue=f,n[E].confidenceScore=b,n[E].metadata=v);else{n[E].sub_features||(n[E].sub_features=[]);const i=(null===(B=null===(S=n[E])||void 0===S?void 0:S.sub_features)||void 0===B?void 0:B.findIndex(e=>e.blockNumber===a))||-1;if(-1===i)null===(C=null===($=n[E])||void 0===$?void 0:$.sub_features)||void 0===C||C.push({artifactId:`STORY-${r}-${a}`,title:e,value:o,storyNumber:r,blockNumber:a,section:t,aiReasoning:R[h],big_enough:l,big_enough_decision_factors:m,technicality_score:g,gapValue:f,confidenceScore:b,metadata:v});else{let e=null===(w=null===(O=null==n?void 0:n[E])||void 0===O?void 0:O.sub_features)||void 0===w?void 0:w[i];e.value=(e.value||"")+o,e.aiReasoning=e.aiReasoning||[],e.aiReasoning.push(...R[h]),e.big_enough=l,e.big_enough_decision_factors=m,e.technicality_score=g,e.gapValue=f,e.confidenceScore=b,e.metadata=v}}const U=JSON.stringify(n);return y.current!==U&&(_({key:`streaming-redis-key-${i}`,value:{mmvf_list:n,knowledgeBase:c,projectAnalyserSummary:u,dataSources_files:d,ai_reasonings:p}}),y.current=U),[...n]})})}catch(e){console.error("Error in processing Stream Content",e)}}}}export{n as useStreamContentHandler};
2
2
  //# sourceMappingURL=useStreamContentHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BigEnoughPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/story-screen/BigEnoughPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAA4B,uBAAuB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEjH,OAA6B,EAAE,0BAA0B,EAAoB,MAAM,8CAA8C,CAAC;AAIlI,eAAO,MAAM,cAAc;iBAEX,cAAc;kBACZ,uBAAuB;sBACpB,qBAAqB,GAAG,UAAU;;;6CAkGtD,CAAC"}
1
+ {"version":3,"file":"BigEnoughPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/story-screen/BigEnoughPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAA4B,uBAAuB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEjH,OAA6B,EAAE,0BAA0B,EAAoB,MAAM,8CAA8C,CAAC;AAIlI,eAAO,MAAM,cAAc;iBAEX,cAAc;kBACZ,uBAAuB;sBACpB,qBAAqB,GAAG,UAAU;;;6CAoGtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryApprovalScreen.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EAEjC,qBAAqB,EACrB,UAAU,EACX,MAAM,sCAAsC,CAAC;AA4E9C,UAAU,SAAS;IACjB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,mEAAmE;IACnE,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB;IACzB,UAAU,CAAC,EAAE,iCAAiC,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AA6OD,UAAU,YAAY;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD,UAAU,kBAAkB;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,mDAAmD;IACnD,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAqVD,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAC,OAAO,CAAC;CACxB;AAmGD,QAAA,MAAM,uBAAuB;;;;;CAK3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"UserStoryApprovalScreen.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EAEjC,qBAAqB,EACrB,UAAU,EACX,MAAM,sCAAsC,CAAC;AA4E9C,UAAU,SAAS;IACjB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,mEAAmE;IACnE,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB;IACzB,UAAU,CAAC,EAAE,iCAAiC,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AA6OD,UAAU,YAAY;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD,UAAU,kBAAkB;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,mDAAmD;IACnD,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAqUD,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAC,OAAO,CAAC;CACxB;AAmGD,QAAA,MAAM,uBAAuB;;;;;CAK3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useStreamContentHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/hooks/useStreamContentHandler.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGrF,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,GAAG,YAAY,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B,CAAC,EAAE,wBAAwB,CAAC;IACvD,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF,UAAU,MAAM;IACZ,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACrE,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACjE,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACrE,qBAAqB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAChF,oBAAoB,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,uBAAuB,EAAE,OAAO,CAAC;IACjC,aAAa,EAAE,GAAG,CAAC;IACnB,sBAAsB,EAAE,GAAG,CAAC;IAC5B,eAAe,EAAE;QACb,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,gBAAgB,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;IACF,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,oBAAoB,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9H,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,aAAa,EAAE,sBAAsB,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,EAAE,MAAM;sCAkFjQ,eAAe,EAAE,kBACZ,GAAG,mBACF,MAAM,8BACK,OAAO;EA4O1C"}
1
+ {"version":3,"file":"useStreamContentHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/hooks/useStreamContentHandler.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGrF,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,GAAG,YAAY,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B,CAAC,EAAE,wBAAwB,CAAC;IACvD,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF,UAAU,MAAM;IACZ,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACrE,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACjE,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACrE,qBAAqB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAChF,oBAAoB,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,uBAAuB,EAAE,OAAO,CAAC;IACjC,aAAa,EAAE,GAAG,CAAC;IACnB,sBAAsB,EAAE,GAAG,CAAC;IAC5B,eAAe,EAAE;QACb,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,gBAAgB,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;IACF,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,oBAAoB,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9H,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,aAAa,EAAE,sBAAsB,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,EAAE,MAAM;sCAkFjQ,eAAe,EAAE,kBACZ,GAAG,mBACF,MAAM,8BACK,OAAO;EA0O1C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.336",
3
+ "version": "0.0.338",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",