@e-llm-studio/citation 0.0.241 → 0.0.243
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/cjs/features/CodeCitation/CodeCitation.js +1 -1
- package/dist/cjs/features/CodeCitation/_components/CodeCitationPopup.js +1 -1
- package/dist/cjs/features/CodeCitation/_components/RepoAndBranchTag.js +2 -0
- package/dist/cjs/features/CodeCitation/_components/RepoAndBranchTag.js.map +1 -0
- package/dist/cjs/features/SPBAnalysisPanel/Spbanalysispanel.js +1 -1
- package/dist/features/CodeCitation/CodeCitation.js +1 -1
- package/dist/features/CodeCitation/_components/CodeCitationPopup.js +1 -1
- package/dist/features/CodeCitation/_components/RepoAndBranchTag.js +2 -0
- package/dist/features/CodeCitation/_components/RepoAndBranchTag.js.map +1 -0
- package/dist/features/SPBAnalysisPanel/Spbanalysispanel.js +1 -1
- package/dist/types/src/CodeCitationTest.d.ts.map +1 -1
- package/dist/types/src/features/CodeCitation/CodeCitation.d.ts +2 -0
- package/dist/types/src/features/CodeCitation/CodeCitation.d.ts.map +1 -1
- package/dist/types/src/features/CodeCitation/_components/CodeCitationPopup.d.ts +3 -0
- package/dist/types/src/features/CodeCitation/_components/CodeCitationPopup.d.ts.map +1 -1
- package/dist/types/src/features/CodeCitation/_components/RepoAndBranchTag.d.ts +8 -0
- package/dist/types/src/features/CodeCitation/_components/RepoAndBranchTag.d.ts.map +1 -0
- package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts +2 -1
- package/dist/types/src/features/SPBAnalysisPanel/Spbanalysispanel.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1232,6 +1232,8 @@ import { CodeCitation } from '@e-llm-studio/citation/CodeCitation'
|
|
|
1232
1232
|
isDarkModeEnabled={false}
|
|
1233
1233
|
showThemeToggle={true}
|
|
1234
1234
|
editorHeight={400}
|
|
1235
|
+
repoName="ExampleCodeRepo"
|
|
1236
|
+
branchName="dev"
|
|
1235
1237
|
/>
|
|
1236
1238
|
```
|
|
1237
1239
|
|
|
@@ -1287,6 +1289,8 @@ const highlightRanges = [
|
|
|
1287
1289
|
| `showFullscreenIcon` | `boolean` | Display fullscreen toggle button |
|
|
1288
1290
|
| `showFileSummaryIButton` | `boolean` | Display file summary info button |
|
|
1289
1291
|
| `isHighlightingEnabled` | `boolean` | Enable code highlighting |
|
|
1292
|
+
| `repoName` | `string` | used to show the repo name in the codecitation popup |
|
|
1293
|
+
| `branchName` | `string` | used to show the branch name in the codecitation popup |
|
|
1290
1294
|
|
|
1291
1295
|
---
|
|
1292
1296
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("./CodeCitation.module.css.js"),a=require("./_components/CodeEditor.js"),s=require("../../utils/codeCitations.utils.js"),o=require("./_components/ThemeToggle.js"),r=require("./_components/CodeCitationPopup.js"),l=require("./_components/HighlightedCodeDetails.js"),d=require("axios"),u=require("./_components/Spinner.js"),c=require("../../constants/diagnosticStylesBySeverity.js"),g=require("../../utils/themeManager.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=h(n),m=h(d);exports.default=function(d){var h=d.baseUrlForCodeRetrieval,p=d.assistantName,x=d.organizationName,S=d.userId,v=d.taskId,_=d.repoUrl,I=d.inLineCitation,C=d.citationTitle,y=d.filename,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("./CodeCitation.module.css.js"),a=require("./_components/CodeEditor.js"),s=require("../../utils/codeCitations.utils.js"),o=require("./_components/ThemeToggle.js"),r=require("./_components/CodeCitationPopup.js"),l=require("./_components/HighlightedCodeDetails.js"),d=require("axios"),u=require("./_components/Spinner.js"),c=require("../../constants/diagnosticStylesBySeverity.js"),g=require("../../utils/themeManager.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=h(n),m=h(d);exports.default=function(d){var h=d.baseUrlForCodeRetrieval,p=d.assistantName,x=d.organizationName,S=d.userId,v=d.taskId,_=d.repoUrl,I=d.inLineCitation,C=d.citationTitle,y=d.filename,b=d.filepath,j=d.citationContainerTitle,F=d.showThemeToggle,T=d.customCode,k=d.isDarkModeEnabled,D=d.chevronUpComponent,P=d.chevronDownComponent,w=d.isHighlightingEnabled,E=d.FileDetailsComponent,L=d.additionalCallbackForPillButton,H=d.CustomCodeRenderComponent,N=d.fileSummarySectionTitle,q=d.showFullscreenIcon,M=d.showFileSummaryIButton,B=d.editorHeight,W=d.editorWidth,z=d.styles,V=void 0===z?{}:z,R=d.diagnostics,U=d.diagnosticStylesBySeverity,J=d.datasource,A=void 0===J?"codebase":J,O=d.externalFilesData,Y=d.startIndex,G=d.endIndex,K=d.repoName,Q=d.branchName,X=n.useRef(!1),Z=s.getLanguageFromFileName(y),$=n.useState(!1),ee=$[0],te=$[1],ne=n.useState(function(){return g.themeManager.getTheme(k)}),ie=ne[0],ae=ne[1];n.useEffect(function(){return g.themeManager.subscribe(ae)},[]);var se=n.useState(!1),oe=se[0],re=se[1],le=n.useState(!1),de=le[0],ue=le[1],ce=n.useState(!1),ge=ce[0],he=ce[1],fe=n.useState(!1),me=fe[0],pe=fe[1],xe=n.useState(null),Se=xe[0],ve=xe[1],_e=n.useState(""),Ie=_e[0],Ce=_e[1],ye=n.useState(""),be=ye[0],je=ye[1],Fe=n.useState({startIndex:-1,endIndex:-1}),Te=Fe[0],ke=Fe[1],De=n.useState({}),Pe=De[0],we=De[1],Ee=n.useState(!1),Le=Ee[0],He=Ee[1],Ne=n.useState(!1),qe=Ne[0],Me=Ne[1],Be=n.useState({startIndex:-1,endIndex:-1}),We=Be[0],ze=Be[1],Ve=n.useState({startIndex:-1,endIndex:-1}),Re=Ve[0],Ue=Ve[1],Je=f.default.useMemo(function(){return e.__assign(e.__assign({},c.DEFAULT_DIAGNOSTIC_STYLES_BY_SEVERITY),U)},[U]);n.useEffect(function(){Ue({startIndex:null!=Y?Y:-1,endIndex:null!=G?G:-1})},[Y,G]),n.useEffect(function(){O&&T&&(ve(O),X.current=!0)},[O,T]),n.useEffect(function(){if("undefined"!=typeof window&&!X.current){X.current=!0;var t=new URL(b,"http://example.com"),n=t.searchParams,i=void 0!==Y?Y:n.has("startLine")?Number(n.get("startLine")):-1,a=void 0!==G?G:n.has("endLine")?Number(n.get("endLine")):-1;Ue({startIndex:i,endIndex:a}),ke({startIndex:i,endIndex:a}),ze({startIndex:i,endIndex:a}),t.searchParams.delete("startLine"),t.searchParams.delete("endLine"),t.searchParams.delete("validation");var s=t.pathname+t.search,o=null==s?void 0:s.replace(/^\//,"");je(o),console.log("Params going to API:",{file_path:o,assistant_name:p,organization_name:x,user_id:S,task_id:v,chunks_search:!1,technical_details_only:!0,repo_url:_});T||Le||e.__awaiter(void 0,void 0,void 0,function(){var t,n,i,a,s,r;return e.__generator(this,function(l){switch(l.label){case 0:Me(!1),He(!0),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,m.default.get("".concat(h,"/analyzer/get_file_details"),{params:e.__assign({file_path:String(o),assistant_name:String(p),organization_name:String(x),user_id:String(S),task_id:String(v),repo_url:String(_),chunks_search:!1,technical_details_only:!0},"codebase"!==A&&{datasource:A})})];case 2:return t=l.sent(),n=(null==t?void 0:t.data[0])||(null==t?void 0:t.data),!Se&&n&&(ve(n),Object.keys(null==t?void 0:t.data)&&(i=(null===(r=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s[0])||void 0===r?void 0:r.content)||(null==t?void 0:t.data.content),Ce(i))),He(!1),[2,t.data];case 3:return a=l.sent(),Me(!0),console.error("Error in retrieving file details: ",a),[3,4];case 4:return He(!1),[2]}})})}},[]);return t.jsxs(t.Fragment,{children:[t.jsxs("span",e.__assign({onClick:function(e){return function(e){e.preventDefault(),e.stopPropagation(),L&&L(),te(function(e){return!e}),re(function(e){return!e})}(e)},className:i.default.pillButton,style:V.pillButton},{children:[t.jsx("span",e.__assign({style:V.citationTitle},{children:C})),I&&(ee?D:P)]})),(!I||de)&&t.jsx(r.default,{open:oe,onClose:function(){Ue({startIndex:null==We?void 0:We.startIndex,endIndex:null==We?void 0:We.endIndex}),ue(!1),re(!1),ke({startIndex:-1,endIndex:-1}),we({})},title:C,repoName:K,branchName:Q,repoUrl:_,customStyles:{popupContainer:{width:"100vw",height:"100vh",borderRadius:"0.75rem",fontFamily:"Plus Jakarta Sans, sans-serif"},popupTitleContainer:{color:"#d63384",fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"700"},topLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"},bottomLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"}},editorChildren:t.jsx(a.default,{startIndex:null==Re?void 0:Re.startIndex,endIndex:null==Re?void 0:Re.endIndex,language:Z,editorHeight:B,editorWidth:W,code:T||Ie,isHighlightingEnabled:w,isDarkModeEnabled:ie,highlightCodeStatsLine:Te,setHighlightCodeStatsLine:ke,highlightCodeStatsVariable:Pe,setHighlightCodeStatsVariable:we,isExpanded:ee,highlightIndexes:Re,diagnostics:R,diagnosticStylesBySeverity:Je}),fileDetails:Se,setHighlightIndexes:Ue,highlightCodeStatsLine:Te,setHighlightCodeStatsLine:ke,highlightCodeStatsVariable:Pe,setHighlightCodeStatsVariable:we,filepath:be,datasource:A}),I&&ee&&t.jsx("div",e.__assign({className:i.default.citationWrapper,style:V.citationWrapper},{children:t.jsxs("div",e.__assign({className:i.default.citationContent,style:V.citationContent},{children:[!ge&&j?t.jsxs("div",e.__assign({className:i.default.citationContainerTitle,style:V.citationContainerTitle},{children:[t.jsx("span",{children:j}),F?t.jsx(o.default,{darkMode:ie,onToggle:function(e){return function(e){e.stopPropagation(),e.preventDefault(),g.themeManager.setTheme(!ie)}(e)},toggleFullscreen:function(e){e.stopPropagation(),e.preventDefault(),re(!0),ue(!0)},handleOpenFileDetailSection:function(e){e.stopPropagation(),e.preventDefault(),pe(!0)},showFullscreenIcon:q,showFileSummaryIButton:M}):t.jsx(t.Fragment,{})]})):t.jsx(t.Fragment,{}),t.jsxs("div",e.__assign({style:{zIndex:-1e3,color:"#000",overflow:"hidden",display:"flex",flexDirection:"column",height:B,width:W,fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[!ge&&!me&&H,Le?t.jsx(u.default,{}):t.jsx(t.Fragment,{}),qe?t.jsx("div",e.__assign({style:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",color:"#242424"}},{children:"Something went wrong"})):t.jsx(t.Fragment,{}),!ge&&!me&&!H&&!Le&&!qe&&t.jsx(a.default,{startIndex:null==Re?void 0:Re.startIndex,endIndex:null==Re?void 0:Re.endIndex,language:Z,editorHeight:B,editorWidth:W,code:null!=T?T:Ie,isHighlightingEnabled:w,isDarkModeEnabled:ie,openHighlightedCodeDetails:function(){he(!0)},highlightCodeStatsVariable:Pe,setHighlightCodeStatsVariable:we,isExpanded:ee,highlightIndexes:Re,diagnostics:R,diagnosticStylesBySeverity:Je}),me&&t.jsx(l.default,{FileDetailsComponent:E,fileSummarySectionTitle:N,isDarkMode:ie,editorHeight:B,editorWidth:W,code:null==Se?void 0:Se.content.split("\n").slice((null==Re?void 0:Re.startIndex)-1,null==Re?void 0:Re.endIndex).join("\n"),language:Z,onClose:function(e){e.stopPropagation(),e.preventDefault(),pe(!1)},summary:null==Se?void 0:Se.summary,filepath:be,citationTitle:C})]}))]}))}))]})};
|
|
2
2
|
//# sourceMappingURL=CodeCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@mui/icons-material"),s=require("./CodeCitationsStats.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@mui/icons-material"),s=require("./CodeCitationsStats.js"),a=require("../../../utils/codeCitations.utils.js"),l=require("@mui/material/Dialog"),n=require("@mui/material/IconButton"),r=require("@mui/material/DialogContent"),o=require("@mui/material/DialogTitle"),d=require("./RepoAndBranchTag.js");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=f(l),g=f(n),u=f(r),c=f(o),p={body:{backgroundColor:"#fff",display:"flex",gap:"1rem",flexDirection:"row",paddingTop:"1rem",paddingRight:"1rem",paddingLeft:"1rem",minHeight:"60vh",maxWidth:"100%",overflow:"hidden"},leftSection:{display:"flex",flexDirection:"column",width:"50%",background:"#f6f6f6",borderRadius:"0.375rem",fontFamily:"Plus Jakarta Sans, sans-serif",overflowY:"scroll"},topLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},bottomLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},rightSection:{width:"50%",minHeight:"70vh",paddingLeft:"10px",backgroundColor:"#fff",zIndex:30}};exports.default=function(l){var n=l.open,r=l.onClose,o=l.title,f=l.customStyles,m=l.editorChildren,x=l.fileDetails,_=l.setHighlightIndexes,y=l.highlightCodeStatsLine,b=l.setHighlightCodeStatsLine,v=l.highlightCodeStatsVariable,C=l.setHighlightCodeStatsVariable,j=l.filepath,S=l.datasource,k=void 0===S?"codebase":S,D=l.repoName,q=l.branchName,w=l.repoUrl;return i.jsxs(h.default,e.__assign({open:n,onClose:r,maxWidth:"xl",fullWidth:!0,PaperProps:{style:e.__assign({},null==f?void 0:f.popupContainer)}},{children:[i.jsxs(c.default,e.__assign({style:(null==f?void 0:f.popupTitleContainer)||{fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"bold"}},{children:[i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[i.jsx("span",e.__assign({style:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:o})),D&&q&&w&&i.jsx(d.RepoAndBranchTag,{repoName:D,branchName:q,repoUrl:w}),i.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"row",gap:"5px",fontSize:"0.875rem",color:"#666",marginTop:"0.25rem"}},{children:[i.jsx("span",e.__assign({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:"File path: "})),i.jsxs("span",e.__assign({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[" ",a.returnCitationTitle(j,k)]}))]}))]})),i.jsx(g.default,e.__assign({edge:"end",onClick:r,"aria-label":"close",style:{position:"absolute",top:5,right:16},size:"large"},{children:i.jsx(t.Close,{})}))]})),i.jsxs(u.default,e.__assign({style:e.__assign(e.__assign({},p.body),null==f?void 0:f.body)},{children:[i.jsx("div",e.__assign({style:(null==f?void 0:f.leftSection)||p.leftSection},{children:i.jsx(s.default,{datasource:k,fileDetails:x,setHighlightIndexes:_,highlightCodeStatsLine:y,setHighlightCodeStatsLine:b,highlightCodeStatsVariable:v,setHighlightCodeStatsVariable:C})})),i.jsxs("div",e.__assign({style:p.rightSection},{children:[i.jsx("div",e.__assign({style:{minHeight:"4vh",fontWeight:"700",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:a.returnCodeTitle(k)})),i.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:m}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=CodeCitationPopup.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(require("@mui/icons-material/GitHub")),o={display:"inline-flex",flexDirection:"column",gap:4,padding:"6px 12px",paddingLeft:0,borderRadius:8,fontSize:13},a={display:"flex",alignItems:"center",gap:6},l={position:"absolute",top:22,left:0,zIndex:10,background:"#fff",border:"0.5px solid #D3D1C7",borderRadius:8,padding:"8px 10px",boxShadow:"0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08)",whiteSpace:"nowrap"};exports.RepoAndBranchTag=function(t){var c=t.repoName,u=t.branchName,d=t.repoUrl,p=n.useState(!1),x=p[0],f=p[1],g=n.useRef(),_=function(){clearTimeout(g.current),f(!0)},b=function(){g.current=setTimeout(function(){return f(!1)},150)};return r.jsxs("div",e.__assign({style:o},{children:[r.jsxs("div",e.__assign({style:e.__assign(e.__assign({},a),{position:"relative",color:"#5F5E5A"}),onMouseEnter:_,onMouseLeave:b},{children:[r.jsx(s.default,{sx:{fontSize:14}}),r.jsx("span",e.__assign({style:{cursor:"pointer",textDecoration:"underline dotted",textUnderlineOffset:2,color:"black"}},{children:c})),x&&r.jsx("div",e.__assign({style:l,onMouseEnter:_,onMouseLeave:b},{children:r.jsxs("a",e.__assign({href:d,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:"#185FA5",textDecoration:"none"}},{children:[r.jsx(i.ExternalLink,{size:13}),d.replace("https://","")]}))}))]})),r.jsxs("div",e.__assign({style:e.__assign(e.__assign({},a),{color:"#888780"})},{children:[r.jsx(i.GitBranch,{size:14}),u]}))]}))};
|
|
2
|
+
//# sourceMappingURL=RepoAndBranchTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepoAndBranchTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("@mui/icons-material/ExpandMore"),s=require("@mui/icons-material/Fullscreen"),r=require("@mui/icons-material/Close"),l=require("@mui/icons-material/NearMeOutlined"),a=require("@mui/icons-material/ChevronLeft"),d=require("@mui/icons-material/ChevronRight"),c=require("./DependencyGraph.js"),x=require("./Markdownrenderer.js"),p=require("./Internaleditor.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=g(t),u=g(s),f=g(r),_=g(l),m=g(a),y=g(d),v=function(t){var s=t.text,r=t.detailedSummary,l=t.extraMetaData,a=t.isDarkMode,d=void 0!==a&&a,c=t.markdownRendererStyle,p=t.cognitiveDecisioningStyles,g=n.useState(!1),h=g[0],u=g[1],f=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var o=n.slice(0,i),t=o.lastIndexOf(" ");return{preview:(t>0?o.slice(0,t):o).trim(),truncated:!0}}(s),_=f.preview,m=f.truncated;return i.jsx(o.Box,{children:h?i.jsxs(o.Box,{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,cognitiveDecisioningStyles:p,style:c}),(null==r?void 0:r.trim())&&i.jsx(x.MarkdownRenderer,{message:r,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,cognitiveDecisioningStyles:p,style:c}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:d?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[_,m&&"…"]})),(m||(null==r?void 0:r.trim()))&&i.jsx(o.Box,e.__assign({sx:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},j=function(t){var s=t.text,r=t.extraMetaData,l=t.cognitiveDecisioningStyles,a=n.useState(!1),d=a[0],c=a[1],p=n.useState(!1),g=p[0],h=p[1],u=n.useRef(null);return n.useEffect(function(){var e=u.current;e&&h(e.scrollWidth>e.clientWidth)},[s]),i.jsx(o.Box,e.__assign({sx:{pl:1}},{children:d?i.jsxs(o.Box,e.__assign({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.68rem",extraMetaData:r,cognitiveDecisioningStyles:l}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return c(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]})):i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({ref:u,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:s})),g&&i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return c(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))};exports.default=function(t){var s,r=t.promptContent,l=t.promptTitle,a=t.isLoading,d=void 0!==a&&a,g=t.overviewSummary,b=t.functionalityOfSPB,S=void 0===b?[]:b,w=t.spbAdditionalInfo,B=t.extraMetaData,D=t.showCodePanel,k=void 0===D||D,E=t.showInlineApbEditor,z=void 0===E||E,M=t.disableApbNavigation,T=void 0!==M&&M,A=t.showCollapseStrip,R=void 0===A||A,C=t.showFullscreenButton,I=void 0===C||C,F=t.showFullscreenModal,W=void 0===F||F,P=t.showThemeToggle,H=void 0===P||P,L=t.isDarkMode,q=void 0===L||L,O=t.styles,G=t.className,N=t.style,X=t.sx,Y=n.useState(null),J=Y[0],K=Y[1],Q=n.useState(null),U=Q[0],V=Q[1],Z=n.useState(""),$=Z[0],ee=Z[1],ie=void 0!==(null==O?void 0:O.isDarkMode)?O.isDarkMode:q,ne=n.useState(ie),oe=ne[0],te=ne[1],se=n.useState(null),re=se[0],le=se[1];n.useEffect(function(){void 0!==(null==O?void 0:O.isDarkMode)&&te(O.isDarkMode)},[null==O?void 0:O.isDarkMode]);var ae=n.useState(!1),de=ae[0],ce=ae[1],xe=n.useState(480),pe=xe[0],ge=xe[1],he=n.useRef(!1),ue=n.useRef(null);n.useEffect(function(){var e,i,n;S.length>0&&K((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[S]),n.useEffect(function(){d&&K(null)},[d]),n.useEffect(function(){re&&(ee(""),setTimeout(function(){return ee(re.ref)},500))},[re]);return i.jsxs(o.Box,e.__assign({className:G,style:e.__assign(e.__assign({},null==O?void 0:O.root),N),sx:e.__assign({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},X)},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==O?void 0:O.header)},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==O?void 0:O.headerTitle)},{children:l||"SPB Analysis"})),i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:"0.7rem",color:"#9CA3AF"},null==O?void 0:O.headerSubtitle)},{children:J?"Last Analyzed at ".concat(J):""}))]}))})),i.jsxs(o.Box,e.__assign({ref:ue,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({width:k?de&&R?0:pe:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:he.current?"none":"width 0.15s",borderRight:!k||de&&R?"none":"1px solid #e5e7eb"},null==O?void 0:O.leftPanel)},{children:i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==O?void 0:O.overviewSection)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==O?void 0:O.overviewTitle)},{children:"Overview"})),i.jsx(o.Box,e.__assign({sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==O?void 0:O.overviewContent)},{children:(null===(s=null==g?void 0:g.overallSummary)||void 0===s?void 0:s.trim())?i.jsx(v,{text:g.overallSummary,detailedSummary:g.detailedSummary,extraMetaData:B,isDarkMode:oe,markdownRendererStyle:null==O?void 0:O.markdownRenderer,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"95%",height:14})]}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==O?void 0:O.functionalitySection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.functionalityTitle)},{children:"Functionality of SPB"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:S.length>0?S.map(function(n,t){return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:0===t,sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==O?void 0:O.functionalityItem)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i.jsxs(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[t+1,". ",n.name||n.section_name]}))})),i.jsxs(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[i.jsx(x.MarkdownRenderer,{fontSize:"0.74rem",message:n.description||n.reason_for_inclusion||"",extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,t){var s="string"==typeof n?n:n.apb_name,l=U===s;return i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i.jsxs(o.Box,e.__assign({onClick:T?void 0:function(){return function(e){U===e?(V(null),ee("")):(V(e),ee(""),setTimeout(function(){return ee(e)},50))}(s)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:T?"default":"pointer"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[t+1,". ",s]})),!T&&i.jsx(_.default,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&i.jsx(j,{text:n.description||n.context||"",extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}),z&&l&&i.jsx(o.Box,e.__assign({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:$,isDarkMode:oe,height:"100%",fontSize:12})}))]}),t)})}))]}))]}),t)}):i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"40%",height:16}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==O?void 0:O.applicabilitySection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.applicabilityTitle)},{children:"Applicability"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:i.jsx(o.Box,e.__assign({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==w?void 0:w.when_to_apply},{label:"When NOT to apply",content:null==w?void 0:w.when_not_to_apply}].map(function(n){var t=n.label,s=n.content;return i.jsxs(o.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:t})),s?i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:s,isDarkMode:oe,style:null==O?void 0:O.markdownRenderer,extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),t)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==O?void 0:O.specificationsSection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.specificationsTitle)},{children:"Specifications"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==w?void 0:w.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==w?void 0:w.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==w?void 0:w.output_analysis}].map(function(n){var t=n.label,s=n.tooltip,r=n.content,l="Output"===t,a=l&&r?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(r):null,c=a?a.text:r,g=a?a.code:"";return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===t,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:t})),s&&i.jsx(o.Tooltip,e.__assign({title:s,placement:"top"},{children:i.jsx(o.Box,e.__assign({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.25,pb:1.25,pt:0}},{children:r?i.jsxs(i.Fragment,{children:[c&&i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:c,isDarkMode:oe,style:null==O?void 0:O.markdownRenderer,extraMetaData:B,cognitiveDecisioningStyles:null==O?void 0:O.cognitiveDecisioning}),l&&g&&i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i.jsxs(o.Box,e.__assign({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i.jsx(o.Typography,e.__assign({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),i.jsx(o.Tooltip,e.__assign({title:"Copy Code to clipboard"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return e=g,navigator.clipboard.writeText(e);var e}},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),i.jsx(o.Box,e.__assign({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:g,isDarkMode:oe,height:"100%",fontSize:10})}))]}))]}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"75%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),t)})}))]})),i.jsxs(o.Accordion,e.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==O?void 0:O.dependencyGraphSection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==O?void 0:O.dependencyGraphTitle)},{children:"Dependency Graph"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:0,pb:0,pt:0}},{children:(null==w?void 0:w.dependency_graph)?i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[i.jsx(o.Box,e.__assign({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(c.default,{data:w.dependency_graph,isDarkMode:oe,style:null==O?void 0:O.dependencyGraph})})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[i.jsx(o.Skeleton,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),k&&R&&i.jsx(o.Box,e.__assign({onClick:function(){return ce(function(e){return!e})},sx:e.__assign({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==O?void 0:O.collapseStrip)},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),k&&R&&i.jsx(o.Box,e.__assign({onClick:function(){return ce(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),he.current=!0;var i=function(e){if(he.current&&ue.current){var o=ue.current.getBoundingClientRect(),t=o.left,s=o.width,r=e.clientX-t;if(r<200)return ce(!0),he.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);r>.7*s||(ce(!1),ge(r))}},n=function(){he.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e.__assign({position:"absolute",left:de?20:pe+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==O?void 0:O.dragHandle)},{children:de?i.jsx(y.default,{sx:{fontSize:12,color:"#6b7280"}}):i.jsx(m.default,{sx:{fontSize:12,color:"#6b7280"}})})),k&&i.jsxs(o.Box,e.__assign({sx:e.__assign({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==O?void 0:O.codePanel)},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==O?void 0:O.codePanelHeader)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:13,fontWeight:600,color:"#374151"},null==O?void 0:O.codePanelTitle)},{children:l||"SPB Analysis"})),i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[H&&i.jsx(o.Switch,{checked:oe,onChange:function(e){return te(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),I&&W&&i.jsx(o.Tooltip,e.__assign({title:"Fullscreen",placement:"top"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return le({ref:$||"",description:""})},sx:{color:"#6b7280"}},{children:i.jsx(u.default,{sx:{fontSize:16}})}))}))]}))]})),i.jsx(o.Box,e.__assign({sx:e.__assign({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==O?void 0:O.editorContainer)},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:$,isDarkMode:oe,height:"100%",fontSize:13})}))]}))]})),W&&i.jsxs(o.Dialog,e.__assign({open:!!re,onClose:function(){return le(null)},maxWidth:!1,PaperProps:{sx:e.__assign({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==O?void 0:O.fullscreenModal)}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return le(null)}},{children:i.jsx(f.default,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i.jsxs(o.Box,e.__assign({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(o.Tooltip,e.__assign({title:"Atomic Prompt Block",placement:"top"},{children:i.jsx(o.Chip,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==re?void 0:re.ref}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==re?void 0:re.description}))]})),i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:r.split("\n").length}))]}))]}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),i.jsx(o.Switch,{checked:oe,onChange:function(e){return te(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),i.jsx(o.Box,e.__assign({sx:{flex:1,minHeight:0,p:1.5}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:$,isDarkMode:oe,height:"100%",fontSize:13})}))]}))]}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("@mui/icons-material/ExpandMore"),s=require("@mui/icons-material/Fullscreen"),r=require("@mui/icons-material/Close"),l=require("@mui/icons-material/NearMeOutlined"),a=require("@mui/icons-material/ChevronLeft"),d=require("@mui/icons-material/ChevronRight"),c=require("./DependencyGraph.js"),x=require("./Markdownrenderer.js"),p=require("./Internaleditor.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=g(t),u=g(s),f=g(r),_=g(l),m=g(a),y=g(d),v=function(t){var s=t.text,r=t.detailedSummary,l=t.extraMetaData,a=t.isDarkMode,d=void 0!==a&&a,c=t.markdownRendererStyle,p=t.cognitiveDecisioningStyles,g=n.useState(!1),h=g[0],u=g[1],f=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var o=n.slice(0,i),t=o.lastIndexOf(" ");return{preview:(t>0?o.slice(0,t):o).trim(),truncated:!0}}(s),_=f.preview,m=f.truncated;return i.jsx(o.Box,{children:h?i.jsxs(o.Box,{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,cognitiveDecisioningStyles:p,style:c}),(null==r?void 0:r.trim())&&i.jsx(x.MarkdownRenderer,{message:r,fontSize:"0.8rem",extraMetaData:l,isDarkMode:d,cognitiveDecisioningStyles:p,style:c}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:d?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[_,m&&"…"]})),(m||(null==r?void 0:r.trim()))&&i.jsx(o.Box,e.__assign({sx:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.72rem",color:d?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},j=function(t){var s=t.text,r=t.extraMetaData,l=t.cognitiveDecisioningStyles,a=n.useState(!1),d=a[0],c=a[1],p=n.useState(!1),g=p[0],h=p[1],u=n.useRef(null);return n.useEffect(function(){var e=u.current;e&&h(e.scrollWidth>e.clientWidth)},[s]),i.jsx(o.Box,e.__assign({sx:{pl:1}},{children:d?i.jsxs(o.Box,e.__assign({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[i.jsx(x.MarkdownRenderer,{message:s,fontSize:"0.68rem",extraMetaData:r,cognitiveDecisioningStyles:l}),i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return c(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]})):i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({ref:u,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:s})),g&&i.jsx(o.Typography,e.__assign({component:"span",onClick:function(){return c(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))};exports.default=function(t){var s,r=t.promptContent,l=t.promptTitle,a=t.isLoading,d=void 0!==a&&a,g=t.overviewSummary,b=t.functionalityOfSPB,S=void 0===b?[]:b,w=t.spbAdditionalInfo,B=t.lastAnalyzedAt,D=t.extraMetaData,k=t.showCodePanel,E=void 0===k||k,z=t.showInlineApbEditor,M=void 0===z||z,A=t.disableApbNavigation,T=void 0!==A&&A,R=t.showCollapseStrip,C=void 0===R||R,I=t.showFullscreenButton,F=void 0===I||I,W=t.showFullscreenModal,P=void 0===W||W,H=t.showThemeToggle,L=void 0===H||H,q=t.isDarkMode,O=void 0===q||q,G=t.styles,N=t.className,X=t.style,Y=t.sx,J=n.useState(null),K=J[0],Q=J[1],U=n.useState(null),V=U[0],Z=U[1],$=n.useState(""),ee=$[0],ie=$[1],ne=void 0!==(null==G?void 0:G.isDarkMode)?G.isDarkMode:O,oe=n.useState(ne),te=oe[0],se=oe[1],re=n.useState(null),le=re[0],ae=re[1];n.useEffect(function(){void 0!==(null==G?void 0:G.isDarkMode)&&se(G.isDarkMode)},[null==G?void 0:G.isDarkMode]);var de=n.useState(!1),ce=de[0],xe=de[1],pe=n.useState(480),ge=pe[0],he=pe[1],ue=n.useRef(!1),fe=n.useRef(null);n.useEffect(function(){var e,i,n;B?Q(B):S.length>0&&Q((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[S,B]),n.useEffect(function(){d&&Q(null)},[d]),n.useEffect(function(){le&&(ie(""),setTimeout(function(){return ie(le.ref)},500))},[le]);return i.jsxs(o.Box,e.__assign({className:N,style:e.__assign(e.__assign({},null==G?void 0:G.root),X),sx:e.__assign({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},Y)},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==G?void 0:G.header)},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==G?void 0:G.headerTitle)},{children:l||"SPB Analysis"})),i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:"0.7rem",color:"#9CA3AF"},null==G?void 0:G.headerSubtitle)},{children:K?"Last Analyzed at ".concat(K):""}))]}))})),i.jsxs(o.Box,e.__assign({ref:fe,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[i.jsx(o.Box,e.__assign({sx:e.__assign({width:E?ce&&C?0:ge:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:ue.current?"none":"width 0.15s",borderRight:!E||ce&&C?"none":"1px solid #e5e7eb"},null==G?void 0:G.leftPanel)},{children:i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==G?void 0:G.overviewSection)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==G?void 0:G.overviewTitle)},{children:"Overview"})),i.jsx(o.Box,e.__assign({sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==G?void 0:G.overviewContent)},{children:(null===(s=null==g?void 0:g.overallSummary)||void 0===s?void 0:s.trim())?i.jsx(v,{text:g.overallSummary,detailedSummary:g.detailedSummary,extraMetaData:D,isDarkMode:te,markdownRendererStyle:null==G?void 0:G.markdownRenderer,cognitiveDecisioningStyles:null==G?void 0:G.cognitiveDecisioning}):i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"95%",height:14})]}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==G?void 0:G.functionalitySection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==G?void 0:G.functionalityTitle)},{children:"Functionality of SPB"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:S.length>0?S.map(function(n,t){return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:0===t,sx:e.__assign({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==G?void 0:G.functionalityItem)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i.jsxs(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[t+1,". ",n.name||n.section_name]}))})),i.jsxs(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[i.jsx(x.MarkdownRenderer,{fontSize:"0.74rem",message:n.description||n.reason_for_inclusion||"",extraMetaData:D,cognitiveDecisioningStyles:null==G?void 0:G.cognitiveDecisioning}),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:n.apb_references.map(function(n,t){var s="string"==typeof n?n:n.apb_name,l=V===s;return i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i.jsxs(o.Box,e.__assign({onClick:T?void 0:function(){return function(e){V===e?(Z(null),ie("")):(Z(e),ie(""),setTimeout(function(){return ie(e)},50))}(s)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:T?"default":"pointer"}},{children:[i.jsxs(o.Typography,e.__assign({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[t+1,". ",s]})),!T&&i.jsx(_.default,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof n&&(n.description||n.context)&&i.jsx(j,{text:n.description||n.context||"",extraMetaData:D,cognitiveDecisioningStyles:null==G?void 0:G.cognitiveDecisioning}),M&&l&&i.jsx(o.Box,e.__assign({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:ee,isDarkMode:te,height:"100%",fontSize:12})}))]}),t)})}))]}))]}),t)}):i.jsx(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(n){return i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"40%",height:16}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"30%",height:14})]}),n)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==G?void 0:G.applicabilitySection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==G?void 0:G.applicabilityTitle)},{children:"Applicability"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:i.jsx(o.Box,e.__assign({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==w?void 0:w.when_to_apply},{label:"When NOT to apply",content:null==w?void 0:w.when_not_to_apply}].map(function(n){var t=n.label,s=n.content;return i.jsxs(o.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:t})),s?i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:s,isDarkMode:te,style:null==G?void 0:G.markdownRenderer,extraMetaData:D,cognitiveDecisioningStyles:null==G?void 0:G.cognitiveDecisioning}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),t)})}))}))]})),i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==G?void 0:G.specificationsSection)},{children:[i.jsxs(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==G?void 0:G.specificationsTitle)},{children:"Specifications"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==w?void 0:w.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==w?void 0:w.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==w?void 0:w.output_analysis}].map(function(n){var t=n.label,s=n.tooltip,r=n.content,l="Output"===t,a=l&&r?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(r):null,c=a?a.text:r,g=a?a.code:"";return i.jsxs(o.Accordion,e.__assign({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===t,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:t})),s&&i.jsx(o.Tooltip,e.__assign({title:s,placement:"top"},{children:i.jsx(o.Box,e.__assign({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:1.25,pb:1.25,pt:0}},{children:r?i.jsxs(i.Fragment,{children:[c&&i.jsx(x.MarkdownRenderer,{fontSize:"0.8rem",message:c,isDarkMode:te,style:null==G?void 0:G.markdownRenderer,extraMetaData:D,cognitiveDecisioningStyles:null==G?void 0:G.cognitiveDecisioning}),l&&g&&i.jsxs(o.Box,e.__assign({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i.jsxs(o.Box,e.__assign({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i.jsx(o.Typography,e.__assign({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),i.jsx(o.Tooltip,e.__assign({title:"Copy Code to clipboard"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return e=g,navigator.clipboard.writeText(e);var e}},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),i.jsx(o.Box,e.__assign({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:i.jsx(p.InternalEditor,{content:g,isDarkMode:te,height:"100%",fontSize:10})}))]}))]}):d?i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"90%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"75%",height:14})]})):i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),t)})}))]})),i.jsxs(o.Accordion,e.__assign({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e.__assign({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==G?void 0:G.dependencyGraphSection)},{children:[i.jsx(o.AccordionSummary,e.__assign({expandIcon:i.jsx(h.default,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:i.jsx(o.Typography,e.__assign({sx:e.__assign({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==G?void 0:G.dependencyGraphTitle)},{children:"Dependency Graph"}))})),i.jsx(o.AccordionDetails,e.__assign({sx:{px:0,pb:0,pt:0}},{children:(null==w?void 0:w.dependency_graph)?i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[i.jsx(o.Box,e.__assign({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:i.jsx(c.default,{data:w.dependency_graph,isDarkMode:te,style:null==G?void 0:G.dependencyGraph})})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i.jsxs(o.Box,e.__assign({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[i.jsx(o.Skeleton,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),i.jsx(o.Skeleton,{variant:"text",width:"100%",height:14}),i.jsx(o.Skeleton,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),E&&C&&i.jsx(o.Box,e.__assign({onClick:function(){return xe(function(e){return!e})},sx:e.__assign({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==G?void 0:G.collapseStrip)},{children:i.jsx(o.Typography,e.__assign({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),E&&C&&i.jsx(o.Box,e.__assign({onClick:function(){return xe(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),ue.current=!0;var i=function(e){if(ue.current&&fe.current){var o=fe.current.getBoundingClientRect(),t=o.left,s=o.width,r=e.clientX-t;if(r<200)return xe(!0),ue.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);r>.7*s||(xe(!1),he(r))}},n=function(){ue.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e.__assign({position:"absolute",left:ce?20:ge+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==G?void 0:G.dragHandle)},{children:ce?i.jsx(y.default,{sx:{fontSize:12,color:"#6b7280"}}):i.jsx(m.default,{sx:{fontSize:12,color:"#6b7280"}})})),E&&i.jsxs(o.Box,e.__assign({sx:e.__assign({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==G?void 0:G.codePanel)},{children:[i.jsxs(o.Box,e.__assign({sx:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==G?void 0:G.codePanelHeader)},{children:[i.jsx(o.Typography,e.__assign({sx:e.__assign({fontSize:13,fontWeight:600,color:"#374151"},null==G?void 0:G.codePanelTitle)},{children:l||"SPB Analysis"})),i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[L&&i.jsx(o.Switch,{checked:te,onChange:function(e){return se(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),F&&P&&i.jsx(o.Tooltip,e.__assign({title:"Fullscreen",placement:"top"},{children:i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return ae({ref:ee||"",description:""})},sx:{color:"#6b7280"}},{children:i.jsx(u.default,{sx:{fontSize:16}})}))}))]}))]})),i.jsx(o.Box,e.__assign({sx:e.__assign({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==G?void 0:G.editorContainer)},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:ee,isDarkMode:te,height:"100%",fontSize:13})}))]}))]})),P&&i.jsxs(o.Dialog,e.__assign({open:!!le,onClose:function(){return ae(null)},maxWidth:!1,PaperProps:{sx:e.__assign({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==G?void 0:G.fullscreenModal)}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),i.jsx(o.IconButton,e.__assign({size:"small",onClick:function(){return ae(null)}},{children:i.jsx(f.default,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i.jsxs(o.Box,e.__assign({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(o.Tooltip,e.__assign({title:"Atomic Prompt Block",placement:"top"},{children:i.jsx(o.Chip,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==le?void 0:le.ref}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==le?void 0:le.description}))]})),i.jsxs(o.Box,e.__assign({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),i.jsx(o.Typography,e.__assign({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:r.split("\n").length}))]}))]}))]})),i.jsxs(o.Box,e.__assign({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i.jsxs(o.Box,e.__assign({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[i.jsx(o.Typography,e.__assign({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),i.jsx(o.Switch,{checked:te,onChange:function(e){return se(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),i.jsx(o.Box,e.__assign({sx:{flex:1,minHeight:0,p:1.5}},{children:i.jsx(p.InternalEditor,{content:r,selectedTag:ee,isDarkMode:te,height:"100%",fontSize:13})}))]}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=Spbanalysispanel.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as a}from"react/jsx-runtime";import r,{useRef as l,useState as s,useEffect as d}from"react";import c from"./CodeCitation.module.css.js";import u from"./_components/CodeEditor.js";import{getLanguageFromFileName as h}from"../../utils/codeCitations.utils.js";import g from"./_components/ThemeToggle.js";import m from"./_components/CodeCitationPopup.js";import p from"./_components/HighlightedCodeDetails.js";import f from"axios";import v from"./_components/Spinner.js";import{DEFAULT_DIAGNOSTIC_STYLES_BY_SEVERITY as x}from"../../constants/diagnosticStylesBySeverity.js";import{themeManager as I}from"../../utils/themeManager.js";var C=function(C){var y=C.baseUrlForCodeRetrieval,S=C.assistantName,b=C.organizationName,_=C.userId,k=C.taskId,D=C.repoUrl,P=C.inLineCitation,T=C.citationTitle,w=C.filename,F=C.filepath,H=C.citationContainerTitle,L=C.showThemeToggle,j=C.customCode,
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as a}from"react/jsx-runtime";import r,{useRef as l,useState as s,useEffect as d}from"react";import c from"./CodeCitation.module.css.js";import u from"./_components/CodeEditor.js";import{getLanguageFromFileName as h}from"../../utils/codeCitations.utils.js";import g from"./_components/ThemeToggle.js";import m from"./_components/CodeCitationPopup.js";import p from"./_components/HighlightedCodeDetails.js";import f from"axios";import v from"./_components/Spinner.js";import{DEFAULT_DIAGNOSTIC_STYLES_BY_SEVERITY as x}from"../../constants/diagnosticStylesBySeverity.js";import{themeManager as I}from"../../utils/themeManager.js";var C=function(C){var y=C.baseUrlForCodeRetrieval,S=C.assistantName,b=C.organizationName,_=C.userId,k=C.taskId,D=C.repoUrl,P=C.inLineCitation,T=C.citationTitle,w=C.filename,F=C.filepath,H=C.citationContainerTitle,L=C.showThemeToggle,j=C.customCode,N=C.isDarkModeEnabled,E=C.chevronUpComponent,B=C.chevronDownComponent,W=C.isHighlightingEnabled,z=C.FileDetailsComponent,M=C.additionalCallbackForPillButton,V=C.CustomCodeRenderComponent,J=C.fileSummarySectionTitle,U=C.showFullscreenIcon,R=C.showFileSummaryIButton,A=C.editorHeight,O=C.editorWidth,q=C.styles,G=void 0===q?{}:q,K=C.diagnostics,Q=C.diagnosticStylesBySeverity,X=C.datasource,Y=void 0===X?"codebase":X,Z=C.externalFilesData,$=C.startIndex,ee=C.endIndex,te=C.repoName,ne=C.branchName,ie=l(!1),oe=h(w),ae=s(!1),re=ae[0],le=ae[1],se=s(function(){return I.getTheme(N)}),de=se[0],ce=se[1];d(function(){return I.subscribe(ce)},[]);var ue=s(!1),he=ue[0],ge=ue[1],me=s(!1),pe=me[0],fe=me[1],ve=s(!1),xe=ve[0],Ie=ve[1],Ce=s(!1),ye=Ce[0],Se=Ce[1],be=s(null),_e=be[0],ke=be[1],De=s(""),Pe=De[0],Te=De[1],we=s(""),Fe=we[0],He=we[1],Le=s({startIndex:-1,endIndex:-1}),je=Le[0],Ne=Le[1],Ee=s({}),Be=Ee[0],We=Ee[1],ze=s(!1),Me=ze[0],Ve=ze[1],Je=s(!1),Ue=Je[0],Re=Je[1],Ae=s({startIndex:-1,endIndex:-1}),Oe=Ae[0],qe=Ae[1],Ge=s({startIndex:-1,endIndex:-1}),Ke=Ge[0],Qe=Ge[1],Xe=r.useMemo(function(){return e(e({},x),Q)},[Q]);d(function(){Qe({startIndex:null!=$?$:-1,endIndex:null!=ee?ee:-1})},[$,ee]),d(function(){Z&&j&&(ke(Z),ie.current=!0)},[Z,j]),d(function(){if("undefined"!=typeof window&&!ie.current){ie.current=!0;var i=new URL(F,"http://example.com"),o=i.searchParams,a=void 0!==$?$:o.has("startLine")?Number(o.get("startLine")):-1,r=void 0!==ee?ee:o.has("endLine")?Number(o.get("endLine")):-1;Qe({startIndex:a,endIndex:r}),Ne({startIndex:a,endIndex:r}),qe({startIndex:a,endIndex:r}),i.searchParams.delete("startLine"),i.searchParams.delete("endLine"),i.searchParams.delete("validation");var l=i.pathname+i.search,s=null==l?void 0:l.replace(/^\//,"");He(s),console.log("Params going to API:",{file_path:s,assistant_name:S,organization_name:b,user_id:_,task_id:k,chunks_search:!1,technical_details_only:!0,repo_url:D});j||Me||t(void 0,void 0,void 0,function(){var t,i,o,a,r,l;return n(this,function(n){switch(n.label){case 0:Re(!1),Ve(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,f.get("".concat(y,"/analyzer/get_file_details"),{params:e({file_path:String(s),assistant_name:String(S),organization_name:String(b),user_id:String(_),task_id:String(k),repo_url:String(D),chunks_search:!1,technical_details_only:!0},"codebase"!==Y&&{datasource:Y})})];case 2:return t=n.sent(),i=(null==t?void 0:t.data[0])||(null==t?void 0:t.data),!_e&&i&&(ke(i),Object.keys(null==t?void 0:t.data)&&(o=(null===(l=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r[0])||void 0===l?void 0:l.content)||(null==t?void 0:t.data.content),Te(o))),Ve(!1),[2,t.data];case 3:return a=n.sent(),Re(!0),console.error("Error in retrieving file details: ",a),[3,4];case 4:return Ve(!1),[2]}})})}},[]);return i(o,{children:[i("span",e({onClick:function(e){return function(e){e.preventDefault(),e.stopPropagation(),M&&M(),le(function(e){return!e}),ge(function(e){return!e})}(e)},className:c.pillButton,style:G.pillButton},{children:[a("span",e({style:G.citationTitle},{children:T})),P&&(re?E:B)]})),(!P||pe)&&a(m,{open:he,onClose:function(){Qe({startIndex:null==Oe?void 0:Oe.startIndex,endIndex:null==Oe?void 0:Oe.endIndex}),fe(!1),ge(!1),Ne({startIndex:-1,endIndex:-1}),We({})},title:T,repoName:te,branchName:ne,repoUrl:D,customStyles:{popupContainer:{width:"100vw",height:"100vh",borderRadius:"0.75rem",fontFamily:"Plus Jakarta Sans, sans-serif"},popupTitleContainer:{color:"#d63384",fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"700"},topLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"},bottomLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"}},editorChildren:a(u,{startIndex:null==Ke?void 0:Ke.startIndex,endIndex:null==Ke?void 0:Ke.endIndex,language:oe,editorHeight:A,editorWidth:O,code:j||Pe,isHighlightingEnabled:W,isDarkModeEnabled:de,highlightCodeStatsLine:je,setHighlightCodeStatsLine:Ne,highlightCodeStatsVariable:Be,setHighlightCodeStatsVariable:We,isExpanded:re,highlightIndexes:Ke,diagnostics:K,diagnosticStylesBySeverity:Xe}),fileDetails:_e,setHighlightIndexes:Qe,highlightCodeStatsLine:je,setHighlightCodeStatsLine:Ne,highlightCodeStatsVariable:Be,setHighlightCodeStatsVariable:We,filepath:Fe,datasource:Y}),P&&re&&a("div",e({className:c.citationWrapper,style:G.citationWrapper},{children:i("div",e({className:c.citationContent,style:G.citationContent},{children:[!xe&&H?i("div",e({className:c.citationContainerTitle,style:G.citationContainerTitle},{children:[a("span",{children:H}),L?a(g,{darkMode:de,onToggle:function(e){return function(e){e.stopPropagation(),e.preventDefault(),I.setTheme(!de)}(e)},toggleFullscreen:function(e){e.stopPropagation(),e.preventDefault(),ge(!0),fe(!0)},handleOpenFileDetailSection:function(e){e.stopPropagation(),e.preventDefault(),Se(!0)},showFullscreenIcon:U,showFileSummaryIButton:R}):a(o,{})]})):a(o,{}),i("div",e({style:{zIndex:-1e3,color:"#000",overflow:"hidden",display:"flex",flexDirection:"column",height:A,width:O,fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[!xe&&!ye&&V,a(Me?v:o,{}),Ue?a("div",e({style:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",color:"#242424"}},{children:"Something went wrong"})):a(o,{}),!xe&&!ye&&!V&&!Me&&!Ue&&a(u,{startIndex:null==Ke?void 0:Ke.startIndex,endIndex:null==Ke?void 0:Ke.endIndex,language:oe,editorHeight:A,editorWidth:O,code:null!=j?j:Pe,isHighlightingEnabled:W,isDarkModeEnabled:de,openHighlightedCodeDetails:function(){Ie(!0)},highlightCodeStatsVariable:Be,setHighlightCodeStatsVariable:We,isExpanded:re,highlightIndexes:Ke,diagnostics:K,diagnosticStylesBySeverity:Xe}),ye&&a(p,{FileDetailsComponent:z,fileSummarySectionTitle:J,isDarkMode:de,editorHeight:A,editorWidth:O,code:null==_e?void 0:_e.content.split("\n").slice((null==Ke?void 0:Ke.startIndex)-1,null==Ke?void 0:Ke.endIndex).join("\n"),language:oe,onClose:function(e){e.stopPropagation(),e.preventDefault(),Se(!1)},summary:null==_e?void 0:_e.summary,filepath:Fe,citationTitle:T})]}))]}))}))]})};export{C as default};
|
|
2
2
|
//# sourceMappingURL=CodeCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Close as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Close as o}from"@mui/icons-material";import l from"./CodeCitationsStats.js";import{returnCitationTitle as a,returnCodeTitle as r}from"../../../utils/codeCitations.utils.js";import n from"@mui/material/Dialog";import s from"@mui/material/IconButton";import d from"@mui/material/DialogContent";import f from"@mui/material/DialogTitle";import{RepoAndBranchTag as h}from"./RepoAndBranchTag.js";var m=function(m){var p=m.open,c=m.onClose,u=m.title,y=m.customStyles,b=m.editorChildren,x=m.fileDetails,S=m.setHighlightIndexes,v=m.highlightCodeStatsLine,C=m.setHighlightCodeStatsLine,k=m.highlightCodeStatsVariable,D=m.setHighlightCodeStatsVariable,w=m.filepath,H=m.datasource,L=void 0===H?"codebase":H,P=m.repoName,F=m.branchName,J=m.repoUrl;return e(n,i({open:p,onClose:c,maxWidth:"xl",fullWidth:!0,PaperProps:{style:i({},null==y?void 0:y.popupContainer)}},{children:[e(f,i({style:(null==y?void 0:y.popupTitleContainer)||{fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"bold"}},{children:[e("div",i({style:{display:"flex",flexDirection:"column"}},{children:[t("span",i({style:{fontWeight:"bold",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:u})),P&&F&&J&&t(h,{repoName:P,branchName:F,repoUrl:J}),e("div",i({style:{display:"flex",flexDirection:"row",gap:"5px",fontSize:"0.875rem",color:"#666",marginTop:"0.25rem"}},{children:[t("span",i({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:"File path: "})),e("span",i({style:{fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[" ",a(w,L)]}))]}))]})),t(s,i({edge:"end",onClick:c,"aria-label":"close",style:{position:"absolute",top:5,right:16},size:"large"},{children:t(o,{})}))]})),e(d,i({style:i(i({},g.body),null==y?void 0:y.body)},{children:[t("div",i({style:(null==y?void 0:y.leftSection)||g.leftSection},{children:t(l,{datasource:L,fileDetails:x,setHighlightIndexes:S,highlightCodeStatsLine:v,setHighlightCodeStatsLine:C,highlightCodeStatsVariable:k,setHighlightCodeStatsVariable:D})})),e("div",i({style:g.rightSection},{children:[t("div",i({style:{minHeight:"4vh",fontWeight:"700",fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:r(L)})),t("div",i({style:{width:"100%",height:"100%"}},{children:b}))]}))]}))]}))},g={body:{backgroundColor:"#fff",display:"flex",gap:"1rem",flexDirection:"row",paddingTop:"1rem",paddingRight:"1rem",paddingLeft:"1rem",minHeight:"60vh",maxWidth:"100%",overflow:"hidden"},leftSection:{display:"flex",flexDirection:"column",width:"50%",background:"#f6f6f6",borderRadius:"0.375rem",fontFamily:"Plus Jakarta Sans, sans-serif",overflowY:"scroll"},topLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},bottomLeft:{height:"50%",background:"#f9f9f9",display:"flex",flexDirection:"column",overflowY:"auto",borderRadius:"0.375rem"},rightSection:{width:"50%",minHeight:"70vh",paddingLeft:"10px",backgroundColor:"#fff",zIndex:30}};export{m as default};
|
|
2
2
|
//# sourceMappingURL=CodeCitationPopup.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useState as t,useRef as n}from"react";import{ExternalLink as i,GitBranch as a}from"lucide-react";import l from"@mui/icons-material/GitHub";var p={display:"inline-flex",flexDirection:"column",gap:4,padding:"6px 12px",paddingLeft:0,borderRadius:8,fontSize:13},c={display:"flex",alignItems:"center",gap:6},d={position:"absolute",top:22,left:0,zIndex:10,background:"#fff",border:"0.5px solid #D3D1C7",borderRadius:8,padding:"8px 10px",boxShadow:"0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08)",whiteSpace:"nowrap"};function s(s){var f=s.repoName,u=s.branchName,x=s.repoUrl,m=t(!1),b=m[0],g=m[1],h=n(),v=function(){clearTimeout(h.current),g(!0)},y=function(){h.current=setTimeout(function(){return g(!1)},150)};return r("div",e({style:p},{children:[r("div",e({style:e(e({},c),{position:"relative",color:"#5F5E5A"}),onMouseEnter:v,onMouseLeave:y},{children:[o(l,{sx:{fontSize:14}}),o("span",e({style:{cursor:"pointer",textDecoration:"underline dotted",textUnderlineOffset:2,color:"black"}},{children:f})),b&&o("div",e({style:d,onMouseEnter:v,onMouseLeave:y},{children:r("a",e({href:x,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:"#185FA5",textDecoration:"none"}},{children:[o(i,{size:13}),x.replace("https://","")]}))}))]})),r("div",e({style:e(e({},c),{color:"#888780"})},{children:[o(a,{size:14}),u]}))]}))}export{s as RepoAndBranchTag};
|
|
2
|
+
//# sourceMappingURL=RepoAndBranchTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepoAndBranchTag.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as i,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useRef as l}from"react";import{Box as d,Typography as c,Skeleton as a,Accordion as s,AccordionSummary as h,AccordionDetails as p,Tooltip as f,IconButton as u,Switch as x,Dialog as m,Chip as g}from"@mui/material";import v from"@mui/icons-material/ExpandMore";import b from"@mui/icons-material/Fullscreen";import y from"@mui/icons-material/Close";import S from"@mui/icons-material/NearMeOutlined";import w from"@mui/icons-material/ChevronLeft";import D from"@mui/icons-material/ChevronRight";import z from"./DependencyGraph.js";import{MarkdownRenderer as E}from"./Markdownrenderer.js";import{InternalEditor as k}from"./Internaleditor.js";var B=function(t){var r=t.text,l=t.detailedSummary,a=t.extraMetaData,s=t.isDarkMode,h=void 0!==s&&s,p=t.markdownRendererStyle,f=t.cognitiveDecisioningStyles,u=o(!1),x=u[0],m=u[1],g=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var t=n.slice(0,i),o=t.lastIndexOf(" ");return{preview:(o>0?t.slice(0,o):t).trim(),truncated:!0}}(r),v=g.preview,b=g.truncated;return n(d,{children:i(d,x?{children:[n(E,{message:r,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,cognitiveDecisioningStyles:f,style:p}),(null==l?void 0:l.trim())&&n(E,{message:l,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,cognitiveDecisioningStyles:f,style:p}),n(c,e({component:"span",onClick:function(){return m(!1)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}:e({sx:{display:"flex",flexDirection:"column"}},{children:[i(c,e({sx:{fontSize:"0.8rem",color:h?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[v,b&&"…"]})),(b||(null==l?void 0:l.trim()))&&n(d,e({sx:{display:"flex",justifyContent:"flex-end"}},{children:n(c,e({component:"span",onClick:function(){return m(!0)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},M=function(t){var a=t.text,s=t.extraMetaData,h=t.cognitiveDecisioningStyles,p=o(!1),f=p[0],u=p[1],x=o(!1),m=x[0],g=x[1],v=l(null);return r(function(){var e=v.current;e&&g(e.scrollWidth>e.clientWidth)},[a]),n(d,e({sx:{pl:1}},{children:i(d,f?e({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[n(E,{message:a,fontSize:"0.68rem",extraMetaData:s,cognitiveDecisioningStyles:h}),n(c,e({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]}):e({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[n(c,e({ref:v,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:a})),m&&n(c,e({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))},C=function(C){var R,A=C.promptContent,F=C.promptTitle,W=C.isLoading,I=void 0!==W&&W,H=C.overviewSummary,P=C.functionalityOfSPB,T=void 0===P?[]:P,_=C.spbAdditionalInfo,L=C.extraMetaData,j=C.showCodePanel,O=void 0===j||j,G=C.showInlineApbEditor,N=void 0===G||G,X=C.disableApbNavigation,Y=void 0!==X&&X,q=C.showCollapseStrip,J=void 0===q||q,K=C.showFullscreenButton,Q=void 0===K||K,U=C.showFullscreenModal,V=void 0===U||U,Z=C.showThemeToggle,$=void 0===Z||Z,ee=C.isDarkMode,ie=void 0===ee||ee,ne=C.styles,te=C.className,oe=C.style,re=C.sx,le=o(null),de=le[0],ce=le[1],ae=o(null),se=ae[0],he=ae[1],pe=o(""),fe=pe[0],ue=pe[1],xe=void 0!==(null==ne?void 0:ne.isDarkMode)?ne.isDarkMode:ie,me=o(xe),ge=me[0],ve=me[1],be=o(null),ye=be[0],Se=be[1];r(function(){void 0!==(null==ne?void 0:ne.isDarkMode)&&ve(ne.isDarkMode)},[null==ne?void 0:ne.isDarkMode]);var we=o(!1),De=we[0],ze=we[1],Ee=o(480),ke=Ee[0],Be=Ee[1],Me=l(!1),Ce=l(null);r(function(){var e,i,n;T.length>0&&ce((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[T]),r(function(){I&&ce(null)},[I]),r(function(){ye&&(ue(""),setTimeout(function(){return ue(ye.ref)},500))},[ye]);return i(d,e({className:te,style:e(e({},null==ne?void 0:ne.root),oe),sx:e({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},re)},{children:[n(d,e({sx:e({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==ne?void 0:ne.header)},{children:i(d,e({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[n(c,e({sx:e({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==ne?void 0:ne.headerTitle)},{children:F||"SPB Analysis"})),n(c,e({sx:e({fontSize:"0.7rem",color:"#9CA3AF"},null==ne?void 0:ne.headerSubtitle)},{children:de?"Last Analyzed at ".concat(de):""}))]}))})),i(d,e({ref:Ce,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[n(d,e({sx:e({width:O?De&&J?0:ke:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:Me.current?"none":"width 0.15s",borderRight:!O||De&&J?"none":"1px solid #e5e7eb"},null==ne?void 0:ne.leftPanel)},{children:i(d,e({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i(d,e({sx:e({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==ne?void 0:ne.overviewSection)},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==ne?void 0:ne.overviewTitle)},{children:"Overview"})),n(d,e({sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==ne?void 0:ne.overviewContent)},{children:(null===(R=null==H?void 0:H.overallSummary)||void 0===R?void 0:R.trim())?n(B,{text:H.overallSummary,detailedSummary:H.detailedSummary,extraMetaData:L,isDarkMode:ge,markdownRendererStyle:null==ne?void 0:ne.markdownRenderer,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}):i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"95%",height:14})]}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ne?void 0:ne.functionalitySection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.functionalityTitle)},{children:"Functionality of SPB"}))})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:T.length>0?T.map(function(t,o){return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:0===o,sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==ne?void 0:ne.functionalityItem)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[o+1,". ",t.name||t.section_name]}))})),i(p,e({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[n(E,{fontSize:"0.74rem",message:t.description||t.reason_for_inclusion||"",extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}),n(c,e({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),n(d,e({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:t.apb_references.map(function(t,o){var r="string"==typeof t?t:t.apb_name,l=se===r;return i(d,e({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i(d,e({onClick:Y?void 0:function(){return function(e){se===e?(he(null),ue("")):(he(e),ue(""),setTimeout(function(){return ue(e)},50))}(r)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:Y?"default":"pointer"}},{children:[i(c,e({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[o+1,". ",r]})),!Y&&n(S,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof t&&(t.description||t.context)&&n(M,{text:t.description||t.context||"",extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}),N&&l&&n(d,e({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:n(k,{content:A,selectedTag:fe,isDarkMode:ge,height:"100%",fontSize:12})}))]}),o)})}))]}))]}),o)}):n(d,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(t){return i(d,e({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"40%",height:16}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"30%",height:14})]}),t)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ne?void 0:ne.applicabilitySection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.applicabilityTitle)},{children:"Applicability"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:n(d,e({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==_?void 0:_.when_to_apply},{label:"When NOT to apply",content:null==_?void 0:_.when_not_to_apply}].map(function(t){var o=t.label,r=t.content;return i(d,e({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:o})),r?n(E,{fontSize:"0.8rem",message:r,isDarkMode:ge,style:null==ne?void 0:ne.markdownRenderer,extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"90%",height:14})]})):n(c,e({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),o)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==ne?void 0:ne.specificationsSection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.specificationsTitle)},{children:"Specifications"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==_?void 0:_.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==_?void 0:_.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==_?void 0:_.output_analysis}].map(function(o){var r=o.label,l=o.tooltip,x=o.content,m="Output"===r,g=m&&x?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(x):null,b=g?g.text:x,y=g?g.code:"";return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===r,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i(d,e({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:r})),l&&n(f,e({title:l,placement:"top"},{children:n(d,e({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),n(p,e({sx:{px:1.25,pb:1.25,pt:0}},{children:x?i(t,{children:[b&&n(E,{fontSize:"0.8rem",message:b,isDarkMode:ge,style:null==ne?void 0:ne.markdownRenderer,extraMetaData:L,cognitiveDecisioningStyles:null==ne?void 0:ne.cognitiveDecisioning}),m&&y&&i(d,e({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i(d,e({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[n(c,e({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),n(f,e({title:"Copy Code to clipboard"},{children:n(u,e({size:"small",onClick:function(){return e=y,navigator.clipboard.writeText(e);var e}},{children:n(c,e({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),n(d,e({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:n(k,{content:y,isDarkMode:ge,height:"100%",fontSize:10})}))]}))]}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"75%",height:14})]})):n(c,e({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),r)})}))]})),i(s,e({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==ne?void 0:ne.dependencyGraphSection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==ne?void 0:ne.dependencyGraphTitle)},{children:"Dependency Graph"}))})),n(p,e({sx:{px:0,pb:0,pt:0}},{children:(null==_?void 0:_.dependency_graph)?i(d,e({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[n(d,e({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:n(z,{data:_.dependency_graph,isDarkMode:ge,style:null==ne?void 0:ne.dependencyGraph})})),n(c,e({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i(d,e({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[n(a,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),O&&J&&n(d,e({onClick:function(){return ze(function(e){return!e})},sx:e({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==ne?void 0:ne.collapseStrip)},{children:n(c,e({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),O&&J&&n(d,e({onClick:function(){return ze(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),Me.current=!0;var i=function(e){if(Me.current&&Ce.current){var t=Ce.current.getBoundingClientRect(),o=t.left,r=t.width,l=e.clientX-o;if(l<200)return ze(!0),Me.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);l>.7*r||(ze(!1),Be(l))}},n=function(){Me.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e({position:"absolute",left:De?20:ke+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==ne?void 0:ne.dragHandle)},{children:n(De?D:w,{sx:{fontSize:12,color:"#6b7280"}})})),O&&i(d,e({sx:e({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==ne?void 0:ne.codePanel)},{children:[i(d,e({sx:e({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==ne?void 0:ne.codePanelHeader)},{children:[n(c,e({sx:e({fontSize:13,fontWeight:600,color:"#374151"},null==ne?void 0:ne.codePanelTitle)},{children:F||"SPB Analysis"})),i(d,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[$&&n(x,{checked:ge,onChange:function(e){return ve(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),Q&&V&&n(f,e({title:"Fullscreen",placement:"top"},{children:n(u,e({size:"small",onClick:function(){return Se({ref:fe||"",description:""})},sx:{color:"#6b7280"}},{children:n(b,{sx:{fontSize:16}})}))}))]}))]})),n(d,e({sx:e({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==ne?void 0:ne.editorContainer)},{children:n(k,{content:A,selectedTag:fe,isDarkMode:ge,height:"100%",fontSize:13})}))]}))]})),V&&i(m,e({open:!!ye,onClose:function(){return Se(null)},maxWidth:!1,PaperProps:{sx:e({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==ne?void 0:ne.fullscreenModal)}},{children:[i(d,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[n(c,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),n(u,e({size:"small",onClick:function(){return Se(null)}},{children:n(y,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i(d,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i(d,e({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[n(f,e({title:"Atomic Prompt Block",placement:"top"},{children:n(g,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),n(c,e({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==ye?void 0:ye.ref}))]})),i(d,e({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==ye?void 0:ye.description}))]})),i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),n(c,e({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:A.split("\n").length}))]}))]}))]})),i(d,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),n(x,{checked:ge,onChange:function(e){return ve(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),n(d,e({sx:{flex:1,minHeight:0,p:1.5}},{children:n(k,{content:A,selectedTag:fe,isDarkMode:ge,height:"100%",fontSize:13})}))]}))]}))]}))]}))};export{C as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useRef as l}from"react";import{Box as d,Typography as c,Skeleton as a,Accordion as s,AccordionSummary as h,AccordionDetails as p,Tooltip as f,IconButton as u,Switch as x,Dialog as m,Chip as g}from"@mui/material";import v from"@mui/icons-material/ExpandMore";import b from"@mui/icons-material/Fullscreen";import y from"@mui/icons-material/Close";import S from"@mui/icons-material/NearMeOutlined";import w from"@mui/icons-material/ChevronLeft";import D from"@mui/icons-material/ChevronRight";import z from"./DependencyGraph.js";import{MarkdownRenderer as E}from"./Markdownrenderer.js";import{InternalEditor as k}from"./Internaleditor.js";var B=function(t){var r=t.text,l=t.detailedSummary,a=t.extraMetaData,s=t.isDarkMode,h=void 0!==s&&s,p=t.markdownRendererStyle,f=t.cognitiveDecisioningStyles,u=o(!1),x=u[0],m=u[1],g=function(e,i){void 0===i&&(i=220);var n=e.replace(/<!--\s*<ai_reasoning>[\s\S]*?<\/ai_reasoning>\s*-->/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();if(n.length<=i)return{preview:n,truncated:!1};var t=n.slice(0,i),o=t.lastIndexOf(" ");return{preview:(o>0?t.slice(0,o):t).trim(),truncated:!0}}(r),v=g.preview,b=g.truncated;return n(d,{children:i(d,x?{children:[n(E,{message:r,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,cognitiveDecisioningStyles:f,style:p}),(null==l?void 0:l.trim())&&n(E,{message:l,fontSize:"0.8rem",extraMetaData:a,isDarkMode:h,cognitiveDecisioningStyles:f,style:p}),n(c,e({component:"span",onClick:function(){return m(!1)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"view less"}))]}:e({sx:{display:"flex",flexDirection:"column"}},{children:[i(c,e({sx:{fontSize:"0.8rem",color:h?"#cbd5e1":"#4B5563",lineHeight:1.6}},{children:[v,b&&"…"]})),(b||(null==l?void 0:l.trim()))&&n(d,e({sx:{display:"flex",justifyContent:"flex-end"}},{children:n(c,e({component:"span",onClick:function(){return m(!0)},sx:{fontSize:"0.72rem",color:h?"#a78bfa":"#5928ed",fontWeight:600,cursor:"pointer"}},{children:"...view more"}))}))]}))})},M=function(t){var a=t.text,s=t.extraMetaData,h=t.cognitiveDecisioningStyles,p=o(!1),f=p[0],u=p[1],x=o(!1),m=x[0],g=x[1],v=l(null);return r(function(){var e=v.current;e&&g(e.scrollWidth>e.clientWidth)},[a]),n(d,e({sx:{pl:1}},{children:i(d,f?e({sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4}},{children:[n(E,{message:a,fontSize:"0.68rem",extraMetaData:s,cognitiveDecisioningStyles:h}),n(c,e({component:"span",onClick:function(){return u(!1)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600}},{children:"view less"}))]}):e({sx:{display:"flex",alignItems:"baseline",gap:.5}},{children:[n(c,e({ref:v,sx:{fontSize:"0.68rem",color:"#9CA3AF",lineHeight:1.4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,minWidth:0}},{children:a})),m&&n(c,e({component:"span",onClick:function(){return u(!0)},sx:{fontSize:"0.65rem",color:"#5928ed",cursor:"pointer",fontWeight:600,flexShrink:0}},{children:"view more"}))]}))}))},C=function(C){var R,A=C.promptContent,F=C.promptTitle,W=C.isLoading,I=void 0!==W&&W,H=C.overviewSummary,P=C.functionalityOfSPB,T=void 0===P?[]:P,_=C.spbAdditionalInfo,L=C.lastAnalyzedAt,j=C.extraMetaData,O=C.showCodePanel,G=void 0===O||O,N=C.showInlineApbEditor,X=void 0===N||N,Y=C.disableApbNavigation,q=void 0!==Y&&Y,J=C.showCollapseStrip,K=void 0===J||J,Q=C.showFullscreenButton,U=void 0===Q||Q,V=C.showFullscreenModal,Z=void 0===V||V,$=C.showThemeToggle,ee=void 0===$||$,ie=C.isDarkMode,ne=void 0===ie||ie,te=C.styles,oe=C.className,re=C.style,le=C.sx,de=o(null),ce=de[0],ae=de[1],se=o(null),he=se[0],pe=se[1],fe=o(""),ue=fe[0],xe=fe[1],me=void 0!==(null==te?void 0:te.isDarkMode)?te.isDarkMode:ne,ge=o(me),ve=ge[0],be=ge[1],ye=o(null),Se=ye[0],we=ye[1];r(function(){void 0!==(null==te?void 0:te.isDarkMode)&&be(te.isDarkMode)},[null==te?void 0:te.isDarkMode]);var De=o(!1),ze=De[0],Ee=De[1],ke=o(480),Be=ke[0],Me=ke[1],Ce=l(!1),Re=l(null);r(function(){var e,i,n;L?ae(L):T.length>0&&ae((e=new Date,i=e.toLocaleTimeString("en-IN",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),n=e.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),"".concat(i||""," | ").concat(n||"")))},[T,L]),r(function(){I&&ae(null)},[I]),r(function(){Se&&(xe(""),setTimeout(function(){return xe(Se.ref)},500))},[Se]);return i(d,e({className:oe,style:e(e({},null==te?void 0:te.root),re),sx:e({height:"100%",display:"flex",flexDirection:"column",width:"100%",minHeight:0,overflow:"hidden"},le)},{children:[n(d,e({sx:e({px:2.5,py:1.5,borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#fff",flexShrink:0},null==te?void 0:te.header)},{children:i(d,e({sx:{display:"flex",flexDirection:"column",gap:.25}},{children:[n(c,e({sx:e({fontWeight:700,fontSize:"0.9rem",color:"#111827"},null==te?void 0:te.headerTitle)},{children:F||"SPB Analysis"})),n(c,e({sx:e({fontSize:"0.7rem",color:"#9CA3AF"},null==te?void 0:te.headerSubtitle)},{children:ce?"Last Analyzed at ".concat(ce):""}))]}))})),i(d,e({ref:Re,sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden",position:"relative"}},{children:[n(d,e({sx:e({width:G?ze&&K?0:Be:"100%",flexShrink:0,minHeight:0,overflow:"hidden",transition:Ce.current?"none":"width 0.15s",borderRight:!G||ze&&K?"none":"1px solid #e5e7eb"},null==te?void 0:te.leftPanel)},{children:i(d,e({sx:{width:"100%",height:"100%",minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,px:1.25,py:1.25,pb:2}},{children:[i(d,e({sx:e({border:"1px solid #E5E7EB",borderRadius:"8px",bgcolor:"#F8FAFC",p:1.5},null==te?void 0:te.overviewSection)},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827",mb:1},null==te?void 0:te.overviewTitle)},{children:"Overview"})),n(d,e({sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5},null==te?void 0:te.overviewContent)},{children:(null===(R=null==H?void 0:H.overallSummary)||void 0===R?void 0:R.trim())?n(B,{text:H.overallSummary,detailedSummary:H.detailedSummary,extraMetaData:j,isDarkMode:ve,markdownRendererStyle:null==te?void 0:te.markdownRenderer,cognitiveDecisioningStyles:null==te?void 0:te.cognitiveDecisioning}):i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"95%",height:14})]}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==te?void 0:te.functionalitySection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==te?void 0:te.functionalityTitle)},{children:"Functionality of SPB"}))})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:T.length>0?T.map(function(t,o){return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:0===o,sx:e({bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},overflow:"hidden"},null==te?void 0:te.functionalityItem)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:38,"& .MuiAccordionSummary-content":{my:.5}}},{children:i(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827"}},{children:[o+1,". ",t.name||t.section_name]}))})),i(p,e({sx:{px:1.5,pb:1.5,pt:0,display:"flex",flexDirection:"column",gap:.75}},{children:[n(E,{fontSize:"0.74rem",message:t.description||t.reason_for_inclusion||"",extraMetaData:j,cognitiveDecisioningStyles:null==te?void 0:te.cognitiveDecisioning}),n(c,e({sx:{fontSize:"0.72rem",color:"#9CA3AF",fontWeight:500,mt:.25}},{children:"APB References"})),n(d,e({sx:{display:"flex",flexDirection:"column",gap:.75}},{children:t.apb_references.map(function(t,o){var r="string"==typeof t?t:t.apb_name,l=he===r;return i(d,e({sx:{display:"flex",flexDirection:"column",gap:.15}},{children:[i(d,e({onClick:q?void 0:function(){return function(e){he===e?(pe(null),xe("")):(pe(e),xe(""),setTimeout(function(){return xe(e)},50))}(r)},sx:{display:"flex",alignItems:"center",gap:.25,cursor:q?"default":"pointer"}},{children:[i(c,e({sx:{fontSize:"0.78rem",color:l?"#5928ed":"#DB2877",fontWeight:500}},{children:[o+1,". ",r]})),!q&&n(S,{sx:{fontSize:"0.75rem",color:l?"#5928ed":"#DB2877"}})]})),"string"!=typeof t&&(t.description||t.context)&&n(M,{text:t.description||t.context||"",extraMetaData:j,cognitiveDecisioningStyles:null==te?void 0:te.cognitiveDecisioning}),X&&l&&n(d,e({sx:{mt:1,height:260,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"}},{children:n(k,{content:A,selectedTag:ue,isDarkMode:ve,height:"100%",fontSize:12})}))]}),o)})}))]}))]}),o)}):n(d,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[1,2,3].map(function(t){return i(d,e({sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5,display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"40%",height:16}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"30%",height:14})]}),t)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==te?void 0:te.applicabilitySection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==te?void 0:te.applicabilityTitle)},{children:"Applicability"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"When to Apply this SPB / When Not Apply"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC"}},{children:n(d,e({sx:{display:"flex",gap:1}},{children:[{label:"When to apply",content:null==_?void 0:_.when_to_apply},{label:"When NOT to apply",content:null==_?void 0:_.when_not_to_apply}].map(function(t){var o=t.label,r=t.content;return i(d,e({sx:{flex:1,bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px",p:1.25}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151",mb:.75}},{children:o})),r?n(E,{fontSize:"0.8rem",message:r,isDarkMode:ve,style:null==te?void 0:te.markdownRenderer,extraMetaData:j,cognitiveDecisioningStyles:null==te?void 0:te.cognitiveDecisioning}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14}),n(a,{variant:"text",width:"90%",height:14})]})):n(c,e({sx:{fontSize:"0.8rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))]}),o)})}))}))]})),i(s,e({disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{bgcolor:"#F8FAFC"},bgcolor:"#fff"},null==te?void 0:te.specificationsSection)},{children:[i(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75,alignItems:"center",gap:1}}},{children:[n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==te?void 0:te.specificationsTitle)},{children:"Specifications"})),n(c,e({sx:{fontSize:"0.7rem",color:"#9CA3AF"}},{children:"Strict Rules / Input / Output"}))]})),n(p,e({sx:{px:1.5,pb:1.5,pt:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"column",gap:1}},{children:[{label:"Strict Rules",tooltip:null,content:null==_?void 0:_.constraints_and_rules},{label:"Input",tooltip:"Input specification for this SPB",content:null==_?void 0:_.input_analysis},{label:"Output",tooltip:"Output specification for this SPB",content:null==_?void 0:_.output_analysis}].map(function(o){var r=o.label,l=o.tooltip,x=o.content,m="Output"===r,g=m&&x?function(e){var i=[];return{text:e.replace(/<code>([\s\S]*?)<\/code>/g,function(e,n){return i.push(n.trim()),""}).trim(),code:i.join("\n\n")}}(x):null,b=g?g.text:x,y=g?g.code:"";return i(s,e({disableGutters:!0,elevation:0,defaultExpanded:"Strict Rules"===r,sx:{bgcolor:"#fff",border:"1px solid #E5E7EB",borderRadius:"6px !important","&:before":{display:"none"},overflow:"hidden"}},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem"}}),sx:{minHeight:34,px:1.25,"& .MuiAccordionSummary-content":{my:.4}}},{children:i(d,e({sx:{display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.76rem",color:"#374151"}},{children:r})),l&&n(f,e({title:l,placement:"top"},{children:n(d,e({component:"span",sx:{width:13,height:13,borderRadius:"50%",background:"#E5E7EB",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"0.58rem",color:"#6B7280",fontWeight:700,cursor:"default",flexShrink:0}},{children:"i"}))}))]}))})),n(p,e({sx:{px:1.25,pb:1.25,pt:0}},{children:x?i(t,{children:[b&&n(E,{fontSize:"0.8rem",message:b,isDarkMode:ve,style:null==te?void 0:te.markdownRenderer,extraMetaData:j,cognitiveDecisioningStyles:null==te?void 0:te.cognitiveDecisioning}),m&&y&&i(d,e({sx:{width:"100%",height:"35vh",mt:1.5}},{children:[i(d,e({sx:{display:"flex",gap:.1,backgroundColor:"black",flexDirection:"row",alignItems:"center",justifyContent:"space-between",p:1,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[n(c,e({sx:{color:"white",fontWeight:500,fontSize:"0.8rem"}},{children:"Output preview"})),n(f,e({title:"Copy Code to clipboard"},{children:n(u,e({size:"small",onClick:function(){return e=y,navigator.clipboard.writeText(e);var e}},{children:n(c,e({sx:{fontSize:"0.7rem",color:"white"}},{children:"Copy"}))}))}))]})),n(d,e({sx:{mt:-1,height:"calc(100% - 40px)",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",overflow:"hidden"}},{children:n(k,{content:y,isDarkMode:ve,height:"100%",fontSize:10})}))]}))]}):I?i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"90%",height:14}),n(a,{variant:"text",width:"75%",height:14})]})):n(c,e({sx:{fontSize:"0.74rem",color:"#6B7280",lineHeight:1.5}},{children:"— Not yet available"}))}))]}),r)})}))]})),i(s,e({defaultExpanded:!0,disableGutters:!0,elevation:0,sx:e({border:"1px solid #E5E7EB",borderRadius:"8px !important","&:before":{display:"none"},bgcolor:"#fff"},null==te?void 0:te.dependencyGraphSection)},{children:[n(h,e({expandIcon:n(v,{sx:{fontSize:"1rem",color:"#6B7280"}}),sx:{px:1.5,minHeight:"unset","& .MuiAccordionSummary-content":{my:.75},"&.Mui-expanded":{bgcolor:"#F8FAFC",borderRadius:"8px 8px 0 0"}}},{children:n(c,e({sx:e({fontWeight:600,fontSize:"0.85rem",color:"#111827"},null==te?void 0:te.dependencyGraphTitle)},{children:"Dependency Graph"}))})),n(p,e({sx:{px:0,pb:0,pt:0}},{children:(null==_?void 0:_.dependency_graph)?i(d,e({sx:{bgcolor:"#F8FAFC",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1.5}},{children:[n(d,e({sx:{height:500,borderRadius:"8px",overflow:"hidden"}},{children:n(z,{data:_.dependency_graph,isDarkMode:ve,style:null==te?void 0:te.dependencyGraph})})),n(c,e({sx:{fontSize:"0.72rem",color:"#64748B",lineHeight:1.6}},{children:"This graph visualises how Atomic Prompt Blocks (APBs) depend on, influence, or exchange information with one another within the prompt architecture."}))]})):i(d,e({sx:{bgcolor:"#fff",borderRadius:"0 0 8px 8px",p:1.5,display:"flex",flexDirection:"column",gap:1}},{children:[n(a,{variant:"rectangular",width:"100%",height:400,sx:{borderRadius:"8px"}}),n(a,{variant:"text",width:"100%",height:14}),n(a,{variant:"text",width:"80%",height:14})]}))}))]}))]}))})),G&&K&&n(d,e({onClick:function(){return Ee(function(e){return!e})},sx:e({width:20,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRight:"1px solid #e5e7eb",borderLeft:"1px solid #e5e7eb",bgcolor:"#f9fafb",position:"relative",py:2,"&:hover":{bgcolor:"#f0f0f0"}},null==te?void 0:te.collapseStrip)},{children:n(c,e({sx:{fontSize:10,fontWeight:600,color:"#6b7280",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(180deg)",letterSpacing:"0.05em",userSelect:"none"}},{children:"SPB Details"}))})),G&&K&&n(d,e({onClick:function(){return Ee(function(e){return!e})},onMouseDown:function(e){e.preventDefault(),Ce.current=!0;var i=function(e){if(Ce.current&&Re.current){var t=Re.current.getBoundingClientRect(),o=t.left,r=t.width,l=e.clientX-o;if(l<200)return Ee(!0),Ce.current=!1,document.removeEventListener("mousemove",i),void document.removeEventListener("mouseup",n);l>.7*r||(Ee(!1),Me(l))}},n=function(){Ce.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)},sx:e({position:"absolute",left:ze?20:Be+20,top:"50%",transform:"translateY(-50%)",width:18,height:28,bgcolor:"#fff",border:"1px solid #e5e7eb",borderRadius:"0 6px 6px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:"col-resize",zIndex:5,boxShadow:"2px 0 4px rgba(0,0,0,0.06)","&:hover":{bgcolor:"#f9fafb"}},null==te?void 0:te.dragHandle)},{children:n(ze?D:w,{sx:{fontSize:12,color:"#6b7280"}})})),G&&i(d,e({sx:e({flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2,gap:1.5,bgcolor:"#f8fafc"},null==te?void 0:te.codePanel)},{children:[i(d,e({sx:e({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},null==te?void 0:te.codePanelHeader)},{children:[n(c,e({sx:e({fontSize:13,fontWeight:600,color:"#374151"},null==te?void 0:te.codePanelTitle)},{children:F||"SPB Analysis"})),i(d,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:[ee&&n(x,{checked:ve,onChange:function(e){return be(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}}),U&&Z&&n(f,e({title:"Fullscreen",placement:"top"},{children:n(u,e({size:"small",onClick:function(){return we({ref:ue||"",description:""})},sx:{color:"#6b7280"}},{children:n(b,{sx:{fontSize:16}})}))}))]}))]})),n(d,e({sx:e({flex:1,minHeight:0,border:"1px solid #30363d",borderRadius:1,overflow:"hidden"},null==te?void 0:te.editorContainer)},{children:n(k,{content:A,selectedTag:ue,isDarkMode:ve,height:"100%",fontSize:13})}))]}))]})),Z&&i(m,e({open:!!Se,onClose:function(){return we(null)},maxWidth:!1,PaperProps:{sx:e({width:"82vw",height:"80vh",maxWidth:"none",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},null==te?void 0:te.fullscreenModal)}},{children:[i(d,e({sx:{px:2.5,py:1.5,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0}},{children:[n(c,e({sx:{fontWeight:700,fontSize:"1rem",color:"#111827"}},{children:"Promptemon"})),n(u,e({size:"small",onClick:function(){return we(null)}},{children:n(y,{sx:{fontSize:"1.1rem",color:"#6B7280"}})}))]})),i(d,e({sx:{flex:1,display:"flex",overflow:"hidden",minHeight:0}},{children:[i(d,e({sx:{width:"40%",flexShrink:0,borderRight:"1px solid #E5E7EB",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",gap:1}},{children:[n(f,e({title:"Atomic Prompt Block",placement:"top"},{children:n(g,{label:"APB",size:"small",sx:{bgcolor:"#f1f5f9",color:"#475569",fontWeight:700,fontSize:10,height:20,borderRadius:1}})})),n(c,e({sx:{fontWeight:600,fontSize:"0.9rem",color:"#111827"}},{children:null==Se?void 0:Se.ref}))]})),i(d,e({sx:{flex:1,p:2,display:"flex",flexDirection:"column",gap:1.5,overflowY:"auto"}},{children:[i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.5}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.8rem",color:"#111827",mb:.75}},{children:"Description"})),n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280",lineHeight:1.6}},{children:null==Se?void 0:Se.description}))]})),i(d,e({sx:{border:"1px solid #E5E7EB",borderRadius:"8px",p:1.25,display:"flex",alignItems:"center",gap:.5}},{children:[n(c,e({sx:{fontSize:"0.73rem",color:"#6B7280"}},{children:"Total Lines"})),n(c,e({sx:{fontSize:"0.73rem",fontWeight:700,color:"#111827"}},{children:A.split("\n").length}))]}))]}))]})),i(d,e({sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[i(d,e({sx:{px:2,py:1.25,borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n(c,e({sx:{fontWeight:600,fontSize:"0.85rem",color:"#111827"}},{children:"Prompt Preview"})),n(x,{checked:ve,onChange:function(e){return be(e.target.checked)},size:"small",sx:{width:36,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{bgcolor:"#5928ed",opacity:1}}},"& .MuiSwitch-thumb":{width:16,height:16,bgcolor:"#fff"},"& .MuiSwitch-track":{borderRadius:10,bgcolor:"#d1d5db",opacity:1}}})]})),n(d,e({sx:{flex:1,minHeight:0,p:1.5}},{children:n(k,{content:A,selectedTag:ue,isDarkMode:ve,height:"100%",fontSize:13})}))]}))]}))]}))]}))};export{C as default};
|
|
2
2
|
//# sourceMappingURL=Spbanalysispanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeCitationTest.d.ts","sourceRoot":"","sources":["../../../src/CodeCitationTest.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB,+
|
|
1
|
+
{"version":3,"file":"CodeCitationTest.d.ts","sourceRoot":"","sources":["../../../src/CodeCitationTest.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,gBAAgB,+CAmFrB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -31,6 +31,8 @@ interface CodeCitationProps {
|
|
|
31
31
|
editorWidth: number | string;
|
|
32
32
|
diagnostics?: IDiagnostic[];
|
|
33
33
|
diagnosticStylesBySeverity?: IDiagnosticStylesBySeverity;
|
|
34
|
+
repoName?: string;
|
|
35
|
+
branchName?: string;
|
|
34
36
|
styles?: {
|
|
35
37
|
root?: CSSProperties;
|
|
36
38
|
pillButton?: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeCitation.d.ts","sourceRoot":"","sources":["../../../../../src/features/CodeCitation/CodeCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoB,aAAa,EAAa,MAAM,OAAO,CAAC;AAS1E,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAIhH,UAAU,iBAAiB;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,aAAa,EAAE,MAAM,CA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|
|
28
|
+
repoName?: string;
|
|
29
|
+
branchName?: string;
|
|
30
|
+
repoUrl?: string;
|
|
28
31
|
}
|
|
29
32
|
declare const CodeCitationPopup: React.FC<CodeCitationPopupProps>;
|
|
30
33
|
export default CodeCitationPopup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeCitationPopup.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CodeCitation/_components/CodeCitationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeCitationPopup.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CodeCitation/_components/CodeCitationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC,UAAU,sBAAsB;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE;QACX,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,WAAW,CAAC,EAAE,aAAa,CAAC;QAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,YAAY,CAAC,EAAE,aAAa,CAAC;QAC7B,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,YAAY,CAAC,EAAE,aAAa,CAAC;KAChC,CAAC;IACF,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,GAAG,CAAA;IACjB,sBAAsB,CAAC,EAAE,GAAG,CAAC;IAC7B,mBAAmB,EAAE,GAAG,CAAC;IACzB,sBAAsB,EAAE,GAAG,CAAC;IAC5B,yBAAyB,EAAE,GAAG,CAAA;IAC9B,0BAA0B,EAAE,GAAG,CAAA;IAC/B,6BAA6B,EAAE,GAAG,CAAA;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwDvD,CAAC;AAiDF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface RepoTagProps {
|
|
2
|
+
repoName: string;
|
|
3
|
+
branchName: string;
|
|
4
|
+
repoUrl: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function RepoAndBranchTag({ repoName, branchName, repoUrl }: RepoTagProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=RepoAndBranchTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepoAndBranchTag.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CodeCitation/_components/RepoAndBranchTag.tsx"],"names":[],"mappings":"AAKA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAgCD,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,YAAY,2CA+D/E"}
|
|
@@ -91,6 +91,7 @@ export interface SPBAnalysisPanelProps {
|
|
|
91
91
|
overviewSummary?: SPBOverviewSummary | null;
|
|
92
92
|
functionalityOfSPB?: SPBFunctionalityItem[];
|
|
93
93
|
spbAdditionalInfo?: SPBAdditionalInfo | null;
|
|
94
|
+
lastAnalyzedAt?: string;
|
|
94
95
|
/** Shared citation/reasoning map keyed by the id referenced in data-cognitive-reasoning anchors across ALL sections (overview, functionality, applicability, specifications, APB references) */
|
|
95
96
|
extraMetaData?: Record<string, any> | null;
|
|
96
97
|
/** Show the persistent right-side code editor panel. Defaults to true. */
|
|
@@ -118,6 +119,6 @@ export interface SPBAnalysisPanelProps {
|
|
|
118
119
|
/** Optional MUI sx prop overrides for the root container */
|
|
119
120
|
sx?: any;
|
|
120
121
|
}
|
|
121
|
-
declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, extraMetaData, showCodePanel, showInlineApbEditor, disableApbNavigation, showCollapseStrip, showFullscreenButton, showFullscreenModal, showThemeToggle, isDarkMode: isDarkModeProp, styles, className, style, sx, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
122
|
+
declare const SPBAnalysisPanel: ({ promptContent, promptTitle, isLoading, overviewSummary, functionalityOfSPB, spbAdditionalInfo, lastAnalyzedAt: lastAnalyzedAtProp, extraMetaData, showCodePanel, showInlineApbEditor, disableApbNavigation, showCollapseStrip, showFullscreenButton, showFullscreenModal, showThemeToggle, isDarkMode: isDarkModeProp, styles, className, style, sx, }: SPBAnalysisPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
122
123
|
export default SPBAnalysisPanel;
|
|
123
124
|
//# sourceMappingURL=Spbanalysispanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spbanalysispanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/SPBAnalysisPanel/Spbanalysispanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAc3D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAO/E,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC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