@codeyam/codeyam-cli 0.1.10 → 0.1.11
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/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/codeyam-cli/src/commands/init.js +1 -0
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +58 -1
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +34 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor-16o0AIFV.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-7Uga8I59.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-CXSi2aeZ.js → entity._sha.scenarios._scenarioId.dev-BwKcai0j.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-CQPR0pFR.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{manifest-6134dc40.js → manifest-76e7b62c.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{root-BWAyuj0r.js → root-DBjt6o04.js} +3 -3
- package/codeyam-cli/src/webserver/build/server/assets/{index-ChX0hPcu.js → index-DsZjKspK.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{init-kSNsMjj8.js → init-DdqKD2p4.js} +2 -2
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CKKeWtVK.js +444 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/terminalServer.js +31 -1
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/package.json +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor-COWCNVyV.js +0 -10
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CNB06EIa.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/globals-phvmGvat.css +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Bm2xIhmh.js +0 -439
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aw as Z,ax as _,am as $,an as rr,au as tr,ao as or,aq as ir,ar as pr,at as mr,as as ar,av as sr,ap as er}from"./assets/server-build-
|
|
1
|
+
import{aw as Z,ax as _,am as $,an as rr,au as tr,ao as or,aq as ir,ar as pr,at as mr,as as ar,av as sr,ap as er}from"./assets/server-build-CKKeWtVK.js";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"fetch-retry";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"typescript";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"url";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{Z as allowedActionOrigins,_ as assets,$ as assetsBuildDirectory,rr as basename,tr as entry,or as future,ir as isSpaMode,pr as prerender,mr as publicPath,ar as routeDiscovery,sr as routes,er as ssr};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildTimestamp": "2026-03-
|
|
3
|
-
"buildTime":
|
|
4
|
-
"buildNumber":
|
|
5
|
-
"semanticVersion": "0.1.
|
|
6
|
-
"version": "0.1.
|
|
2
|
+
"buildTimestamp": "2026-03-13T21:45:57.716Z",
|
|
3
|
+
"buildTime": 1773438357716,
|
|
4
|
+
"buildNumber": 1011,
|
|
5
|
+
"semanticVersion": "0.1.1011",
|
|
6
|
+
"version": "0.1.1011 (2026-03-13T21:45)"
|
|
7
7
|
}
|
|
@@ -346,6 +346,8 @@ export function attachTerminalServer(httpServer) {
|
|
|
346
346
|
const projectSlug = url.searchParams.get('projectSlug') || '';
|
|
347
347
|
const editorMode = url.searchParams.get('editorMode') === 'true';
|
|
348
348
|
const reconnectId = url.searchParams.get('reconnectId') || '';
|
|
349
|
+
const claudeStartMode = url.searchParams.get('claudeStartMode') || '';
|
|
350
|
+
const claudeSessionId = url.searchParams.get('claudeSessionId') || '';
|
|
349
351
|
// --- Reconnection: reattach to a detached PTY ---
|
|
350
352
|
if (reconnectId && detachedPtys.has(reconnectId)) {
|
|
351
353
|
const detached = detachedPtys.get(reconnectId);
|
|
@@ -557,9 +559,37 @@ export function attachTerminalServer(httpServer) {
|
|
|
557
559
|
});
|
|
558
560
|
// Start Claude Code with the appropriate skill.
|
|
559
561
|
// Using a skill avoids shell escaping issues and multi-line paste detection.
|
|
562
|
+
//
|
|
563
|
+
// Session recovery modes (editor only):
|
|
564
|
+
// resume + sessionId → claude --resume <uuid> (resumes exact conversation)
|
|
565
|
+
// resume, no sessionId → claude --continue (fallback for pre-existing sessions)
|
|
566
|
+
// fresh → generate UUID, write to .codeyam/claude-session-id.txt,
|
|
567
|
+
// launch claude --session-id <uuid> '/codeyam-editor'
|
|
568
|
+
//
|
|
569
|
+
// The UUID is generated HERE (not in printStep1) so it's available before
|
|
570
|
+
// Claude launches. printStep1 runs inside the session — too late.
|
|
560
571
|
setTimeout(() => {
|
|
561
572
|
if (editorMode && hasContext) {
|
|
562
|
-
|
|
573
|
+
if (claudeStartMode === 'resume' && claudeSessionId) {
|
|
574
|
+
ptyProcess.write(`claude --resume '${claudeSessionId}' 'The session was interrupted. Please continue where you left off.'\r`);
|
|
575
|
+
}
|
|
576
|
+
else if (claudeStartMode === 'resume') {
|
|
577
|
+
// No session ID available — fall back to most recent session
|
|
578
|
+
ptyProcess.write("claude --continue 'The session was interrupted. Please continue where you left off.'\r");
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
// Fresh session: generate a trackable UUID
|
|
582
|
+
const newSessionId = crypto.randomUUID();
|
|
583
|
+
const sessionIdPath = path.join(cwd, '.codeyam', 'claude-session-id.txt');
|
|
584
|
+
try {
|
|
585
|
+
fs.mkdirSync(path.dirname(sessionIdPath), { recursive: true });
|
|
586
|
+
fs.writeFileSync(sessionIdPath, newSessionId, 'utf8');
|
|
587
|
+
}
|
|
588
|
+
catch (err) {
|
|
589
|
+
console.error('[terminalServer] Failed to write claude-session-id.txt:', err);
|
|
590
|
+
}
|
|
591
|
+
ptyProcess.write(`claude --session-id '${newSessionId}' '/codeyam-editor'\r`);
|
|
592
|
+
}
|
|
563
593
|
}
|
|
564
594
|
else if (hasContext) {
|
|
565
595
|
ptyProcess.write("claude '/codeyam-dev-mode'\r");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminalServer.js","sourceRoot":"","sources":["../../../../src/webserver/terminalServer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEhD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,C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AAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,KAAK,EAAE,CAAC;IAEjB,yBAAyB;IACzB,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,YAAY,EAAE,CAAC;QACxC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC;YACH,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACP,eAAe;QACjB,CAAC;IACH,CAAC;IACD,YAAY,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-yHOVb4rc.js","assets/chunk-JZWAC4HX-C4pqxYJB.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Mt=Object.defineProperty;var It=(t,s,a)=>s in t?Mt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a;var qe=(t,s,a)=>It(t,typeof s!="symbol"?s+"":s,a);import{r as n,j as e,w as Et,u as Rt,b as $t}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as Tt,C as Lt}from"./useCustomSizes-C-_hOl_g.js";import{g as Bt,s as At,r as Me,b as ce,c as _t,l as Dt,d as Ot,e as Ut,f as zt,a as Ft,T as Wt,D as Ht}from"./editorPreview-CNB06EIa.js";import{C as Ee}from"./CopyButton-BPXZwM4t.js";import{_ as Gt}from"./preload-helper-ckwbz45p.js";import{c as Jt}from"./cy-logo-cli-DcX-ZS3p.js";import{u as Vt,S as Ke}from"./Spinner-Bb5uFQ5V.js";import"./copy-n2FB0_Sw.js";import"./createLucideIcon-CC6AbExI.js";import"./useLastLogLine-C14nCb1q.js";const xe=[{name:"Desktop",width:1440,height:900},{name:"Laptop",width:1024,height:768},{name:"Tablet",width:768,height:1024},{name:"Mobile",width:375,height:667}];function Yt(t){if(!t)return xe;const s=Object.entries(t).map(([i,h])=>({name:i,width:h.width,height:h.height})),a=new Set(s.map(i=>i.name));return[...s,...xe.filter(i=>!a.has(i.name))]}function Re(t){const[s,a]=n.useState(null),[i,h]=n.useState(!1),d=n.useCallback(()=>{t&&(h(!0),fetch(`/api/editor-test-results?testFile=${encodeURIComponent(t)}`).then(c=>c.json()).then(c=>{a(c),h(!1)}).catch(()=>{a({testFilePath:t,status:"error",testCases:[],errorMessage:"Failed to fetch test results"}),h(!1)}))},[t]);return n.useEffect(()=>{t&&d()},[t,d]),{results:s,isRunning:i,runTests:d}}function Q(t){if(!t||t==="/")return"Home";const s=t.split("?")[0].replace(/^\//,"");if(!s)return"Home";const a=s.split("/")[0];return a.charAt(0).toUpperCase()+a.slice(1)}function $e(t){return t?t.includes("/isolated-components"):!1}function qt(t,s){return!s||Object.keys(s).length===0?t:t.filter(a=>s[a.name])}function ne({imgSrc:t,name:s,isActive:a,onSelect:i}){return e.jsxs("button",{onClick:i,className:"flex flex-col items-center gap-1 cursor-pointer group",title:s,children:[e.jsx("div",{className:`w-32 h-32 rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${a?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:t?e.jsx("img",{src:t,alt:s,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-32 ${a?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:s})]})}function Ie({testFile:t,entityName:s}){const{results:a,isRunning:i,runTests:h}=Re(t);if(i&&!a)return e.jsxs("div",{className:"px-2 pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]});if(!a)return null;if(a.status==="error")return e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-red-400",children:a.errorMessage})});const d=s?a.testCases.filter(u=>u.fullName.startsWith(s)):a.testCases,c=d.length>0?d:a.testCases;if(c.length===0)return null;const x=s?`${s} > `:"";return e.jsxs("div",{className:"px-2 pt-1 space-y-0.5",children:[c.map(u=>{var S;const k=x&&u.fullName.startsWith(x)?u.fullName.slice(x.length):u.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[u.status==="passed"?e.jsx("span",{className:"text-green-400 text-[10px]",children:"✓"}):u.status==="failed"?e.jsx("span",{className:"text-red-400 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-500 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${u.status==="passed"?"text-green-400":u.status==="failed"?"text-red-400":"text-gray-500"}`,children:k})]}),u.status==="failed"&&((S=u.failureMessages)==null?void 0:S.map((N,w)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-300/70 truncate max-w-full",title:N,children:N.split(`
|
|
3
|
-
`)[0]},w)))]},u.fullName)}),e.jsx("button",{onClick:h,disabled:i,className:"mt-1 text-[10px] text-[#00a0c4] hover:text-[#00c4ee] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:i?"Running...":"Re-run"})]})}function Y({filePath:t}){return t?e.jsxs("div",{className:"flex items-center gap-1 px-2 mt-0.5",children:[e.jsxs("a",{href:`/api/editor-file?path=${encodeURIComponent(t)}`,target:"_blank",rel:"noopener noreferrer",title:"Open file",className:"flex items-center gap-1 text-gray-500 hover:text-gray-300 transition-colors min-w-0",children:[e.jsx("span",{className:"text-[9px] truncate",children:t}),e.jsx("svg",{className:"shrink-0",width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx(Ee,{content:t,icon:!0,iconSize:10,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors"})]}):null}function Kt({scenarios:t,projectRoot:s,activeScenarioId:a,onScenarioSelect:i,zoomComponent:h,onZoomChange:d,analyzedEntities:c=[],glossaryFunctions:x=[],activeAnalyzedScenarioId:u,onAnalyzedScenarioSelect:k,entityImports:S,pageFilePaths:N={}}){const{pageGroups:w,componentGroups:E}=n.useMemo(()=>{var m;const f=new Map,l=new Map;for(const p of t)if(p.componentName){const o=l.get(p.componentName)||[];o.push(p),l.set(p.componentName,o)}else if($e(p.url)){const o=(m=p.url)==null?void 0:m.match(/[?&]c=([^&]+)/),y=o?decodeURIComponent(o[1]):"Isolated",C=l.get(y)||[];C.push(p),l.set(y,C)}else{const o=Q(p.url),y=f.get(o)||[];y.push(p),f.set(o,y)}const j=new Map([...l.entries()].sort(([p],[o])=>p.localeCompare(o)));return{pageGroups:f,componentGroups:j}},[t]),v=n.useMemo(()=>{const f=new Set((c||[]).filter(j=>j.entityType==="visual").map(j=>j.name)),l=new Map;for(const[j,m]of E)f.has(j)||l.set(j,m);return l},[E,c]),{visualEntities:D,libraryEntities:O}=n.useMemo(()=>{const f=c.filter(j=>j.entityType==="visual").sort((j,m)=>j.name.localeCompare(m.name)),l=c.filter(j=>j.entityType==="library"||j.entityType==="functionCall").sort((j,m)=>j.name.localeCompare(m.name));return{visualEntities:f,libraryEntities:l}},[c]),R=n.useMemo(()=>{const f=new Set(O.map(l=>l.name));return x.filter(l=>!f.has(l.name)).sort((l,j)=>l.name.localeCompare(j.name))},[x,O]),z=c.some(f=>f.isAnalyzing),P=n.useRef(null),I=n.useRef(0),_=n.useCallback(()=>{P.current&&(I.current=P.current.scrollTop)},[]);if(n.useEffect(()=>{P.current&&I.current>0&&(P.current.scrollTop=I.current)}),t.length===0&&c.length===0&&R.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No scenarios yet"}),e.jsx("p",{className:"text-xs",children:"Scenarios will appear here as Claude creates them alongside your code. Each scenario represents a different state of your app's data."})]})});if(h){const f=E.get(h)||[],l=new Set((S==null?void 0:S[h])||[]),j=l.size>0,m=j?D.filter(o=>l.has(o.name)):[],p=j?O.filter(o=>l.has(o.name)):[];return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-1",children:[e.jsxs("button",{onClick:()=>d(void 0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-400 hover:text-white transition-colors cursor-pointer",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M7.5 9L4.5 6L7.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"All scenarios"]}),e.jsx("div",{className:"px-3 py-1.5",children:e.jsx("span",{className:"text-xs font-semibold text-white uppercase tracking-wider",children:h})}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2",children:f.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No scenarios for this component"}):f.map(o=>e.jsx(ne,{imgSrc:o.screenshotPath?`/api/editor-scenario-image/${o.id}.png${o.updatedAt?`?v=${encodeURIComponent(o.updatedAt)}`:""}`:null,name:o.name,isActive:o.id===a,onSelect:()=>i(o)},o.id))}),m.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),m.map(o=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center gap-2 px-2 py-1",children:e.jsx("button",{onClick:()=>d(o.name),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:o.name})}),e.jsx(Y,{filePath:o.filePath,projectRoot:s}),(o.scenarios.length>0||o.pendingScenarios.length>0)&&e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:o.scenarios.map(y=>e.jsx(ne,{imgSrc:y.screenshotPath?`/api/screenshot/${y.screenshotPath}`:null,name:y.name,isActive:y.id===u,onSelect:()=>k==null?void 0:k({analysisId:o.analysisId,scenarioId:y.id,scenarioName:y.name,entitySha:o.sha,entityName:o.name})},y.id))})]},o.sha))]}),p.length>0&&e.jsxs("div",{className:"pt-2 mt-1",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),p.map(o=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:o.name})}),e.jsx(Y,{filePath:o.filePath,projectRoot:s}),o.testFile&&e.jsx(Ie,{testFile:o.testFile,entityName:o.name})]},o.sha))]})]})})}return e.jsx("div",{ref:P,onScroll:_,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-3",children:[w.size>0&&e.jsxs("div",{children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"})}),[...w.entries()].sort(([f],[l])=>f==="Home"?-1:l==="Home"?1:f.localeCompare(l)).map(([f,l])=>e.jsxs("div",{className:"px-2 pt-1",children:[e.jsx("div",{className:"py-0.5",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:f})}),N[f]&&e.jsx(Y,{filePath:N[f],projectRoot:s}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:l.map(j=>e.jsx(ne,{imgSrc:j.screenshotPath?`/api/editor-scenario-image/${j.id}.png${j.updatedAt?`?v=${encodeURIComponent(j.updatedAt)}`:""}`:null,name:j.name,isActive:j.id===a&&!u,onSelect:()=>i(j)},j.id))})]},f))]}),v.size>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),[...v.entries()].map(([f,l])=>{var j;return e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex items-center justify-between px-2 py-1",children:e.jsx("button",{onClick:()=>d(f),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:f})}),((j=l[0])==null?void 0:j.componentPath)&&e.jsx(Y,{filePath:l[0].componentPath,projectRoot:s}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:l.map(m=>e.jsx(ne,{imgSrc:m.screenshotPath?`/api/editor-scenario-image/${m.id}.png${m.updatedAt?`?v=${encodeURIComponent(m.updatedAt)}`:""}`:null,name:m.name,isActive:m.id===a&&!u,onSelect:()=>i(m)},m.id))})]},f)})]}),D.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),z&&t.length===0&&c.every(f=>f.scenarioCount===0)&&e.jsx("span",{className:"ml-2 text-[10px] text-gray-500",children:"— Entities are being analyzed..."})]}),D.map(f=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[e.jsx("button",{onClick:()=>d(f.name),className:"text-[11px] font-medium text-gray-400 truncate cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:f.name}),f.isAnalyzing&&f.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(Y,{filePath:f.filePath,projectRoot:s}),(f.scenarios.length>0||f.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:[f.scenarios.map(l=>e.jsx(ne,{imgSrc:l.screenshotPath?`/api/screenshot/${l.screenshotPath}`:null,name:l.name,isActive:l.id===u,onSelect:()=>k==null?void 0:k({analysisId:f.analysisId,scenarioId:l.id,scenarioName:l.name,entitySha:f.sha,entityName:f.name})},l.id)),f.pendingScenarios.map(l=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:l,children:l},l))]})]},f.sha))]}),(O.length>0||R.length>0)&&e.jsxs("div",{className:`pt-2 mt-1 ${D.length>0?"":"border-t border-[#3d3d3d]"}`,children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),O.map(f=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:f.name}),f.isAnalyzing&&f.scenarioCount===0&&e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(Y,{filePath:f.filePath,projectRoot:s}),f.testFile?e.jsx(Ie,{testFile:f.testFile,entityName:f.name}):e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-500",children:"No test file"})})]},f.sha)),R.map(f=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:f.name})}),e.jsx(Y,{filePath:f.filePath,projectRoot:s}),e.jsx(Ie,{testFile:f.testFile,entityName:f.name})]},f.name))]})]})})}function Xt(t,s,a=new Date){const i={"1d":1,"3d":3,"7d":7,"30d":30}[s],h=new Date(a);h.setDate(h.getDate()-i);const d=h.toISOString().split("T")[0],c=t.filter(N=>N.date>=d),x=new Set(c.map(N=>N.commitSha).filter(Boolean)),u=new Map;for(const N of c)if(N.scenarioScreenshots)for(const w of N.scenarioScreenshots){u.has(w.name)||u.set(w.name,[]);const E=u.get(w.name);E.some(v=>v.path===w.path)||E.push({path:w.path,time:N.time})}for(const N of u.values())N.sort((w,E)=>w.time.localeCompare(E.time));const k=[],S=new Map;for(const[N,w]of u){const E=N.indexOf(" - ");if(E!==-1){const v=N.slice(0,E);S.has(v)||S.set(v,[]),S.get(v).push({name:N,screenshots:w})}else k.push({name:N,screenshots:w})}return{commitCount:x.size,entryCount:c.length,appScenarios:k,componentGroups:S,totalScenarios:u.size}}function Qt(t){const s=new Map;for(const a of[...t].reverse()){const i=s.get(a.date)||[];i.push(a),s.set(a.date,i)}return s}function Zt(t){const s=new Map;for(const a of t){let i;if("componentName"in a&&a.componentName)i=a.componentName;else if("componentName"in a&&a.componentName===null)i="App";else{const d=a.name.indexOf(" - ");i=d!==-1?a.name.slice(0,d):"App"}const h=s.get(i)||[];h.push(a),s.set(i,h)}return[...s.entries()].sort(([a],[i])=>a==="App"?-1:i==="App"?1:a.localeCompare(i))}const Xe=120;function ot({text:t,theme:s}){const[a,i]=n.useState(!1),h=t.length>Xe,d=h&&!a?t.slice(0,Xe)+"…":t,c=s==="light";return e.jsxs("div",{className:`px-4 py-2 ${c?"border-b border-gray-200 bg-gray-50":"border-b border-[#3d3d3d] bg-[#252525]"}`,children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-gray-500",children:"User Prompt"}),e.jsxs("p",{className:`text-[11px] mt-0.5 mb-0 leading-relaxed ${c?"text-gray-600":"text-gray-400"}`,children:[d,h&&e.jsx("button",{onClick:()=>i(!a),className:`ml-1 text-[11px] font-medium bg-transparent border-none p-0 cursor-pointer ${c?"text-blue-500 hover:text-blue-700":"text-[#00a0c4] hover:text-[#00c0e8]"}`,children:a?"Show less":"Read more…"})]})]})}function Qe({status:t}){const s={new:{label:"New",bg:"bg-green-900/40",text:"text-green-400",border:"border-green-700/50"},edited:{label:"Edited",bg:"bg-blue-900/40",text:"text-blue-400",border:"border-blue-700/50"},impacted:{label:"Impacted",bg:"bg-amber-900/40",text:"text-amber-400",border:"border-amber-700/50"}}[t.status];return e.jsx("span",{className:`${s.bg} ${s.text} ${s.border} border text-[8px] font-bold px-1 py-0 rounded-full uppercase tracking-wider`,children:s.label})}function es({testFile:t,entityName:s}){const{results:a,isRunning:i,runTests:h}=Re(t);if(i&&!a)return e.jsxs("div",{className:"pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#00a0c4] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-500",children:"Running tests..."})]});if(!a)return null;if(a.status==="error")return e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-red-400",children:a.errorMessage})});const d=s?a.testCases.filter(u=>u.fullName.startsWith(s)):a.testCases,c=d.length>0?d:a.testCases;if(c.length===0)return null;const x=s?`${s} > `:"";return e.jsxs("div",{className:"pt-1 space-y-0.5",children:[c.map(u=>{var S;const k=x&&u.fullName.startsWith(x)?u.fullName.slice(x.length):u.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[u.status==="passed"?e.jsx("span",{className:"text-green-400 text-[10px]",children:"✓"}):u.status==="failed"?e.jsx("span",{className:"text-red-400 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-500 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${u.status==="passed"?"text-green-400":u.status==="failed"?"text-red-400":"text-gray-500"}`,children:k})]}),u.status==="failed"&&((S=u.failureMessages)==null?void 0:S.map((N,w)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-400/70 truncate max-w-full",title:N,children:N.split(`
|
|
4
|
-
`)[0]},w)))]},u.fullName)}),e.jsx("button",{onClick:h,disabled:i,className:"mt-1 text-[10px] text-[#00a0c4] hover:text-[#38bdf8] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:i?"Running...":"Re-run"})]})}const ts={added:"text-green-400",untracked:"text-green-400",modified:"text-blue-400",renamed:"text-purple-400"};function ss({files:t}){return e.jsxs("div",{className:"border-t border-[#3d3d3d] pt-2 mt-1",children:[e.jsxs("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:["Modified Files (",t.length,")"]}),e.jsx("div",{className:"mt-1 space-y-0.5 max-h-[150px] overflow-auto",children:t.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold uppercase w-[14px] text-center ${ts[s.status]||"text-gray-500"}`,children:s.status==="added"||s.status==="untracked"?"A":s.status==="modified"?"M":s.status==="renamed"?"R":"?"}),e.jsx("span",{className:"text-[10px] text-gray-400 truncate font-mono",children:s.path})]},s.path))})]})}const as={feature:{label:"Feature",color:"bg-[#005c75]"},fix:{label:"Fix",color:"bg-amber-700"},refactor:{label:"Refactor",color:"bg-purple-700"},scaffold:{label:"Scaffold",color:"bg-green-700"},data:{label:"Data",color:"bg-blue-700"},milestone:{label:"Milestone",color:"bg-yellow-600"}};function ns(t){try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function rs(t){try{return new Date(t+"T00:00:00").toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"})}catch{return t}}const is=[{value:"1d",label:"1 Day"},{value:"3d",label:"3 Days"},{value:"7d",label:"1 Week"},{value:"30d",label:"1 Month"}];function ls({entries:t,onScreenshotClick:s}){const[a,i]=n.useState(!1),[h,d]=n.useState("7d"),c=n.useMemo(()=>Xt(t,h),[t,h]);return e.jsxs("div",{className:"bg-[#2d2d2d] rounded-lg overflow-hidden",children:[e.jsxs("button",{onClick:()=>i(!a),className:"w-full flex items-center justify-between px-3 py-2.5 cursor-pointer bg-transparent border-none text-left hover:bg-[#333] transition-colors",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Timeframe Summary"}),e.jsx("span",{className:`text-gray-500 text-[10px] transition-transform ${a?"rotate-180":""}`,children:"▼"})]}),a&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-[#3d3d3d]",children:[e.jsx("div",{className:"flex gap-1 pt-2.5",children:is.map(x=>e.jsx("button",{onClick:()=>d(x.value),className:`px-2.5 py-1 text-[10px] font-medium rounded transition-colors cursor-pointer border ${h===x.value?"bg-[#005c75] text-white border-[#005c75]":"bg-transparent text-gray-400 border-[#4d4d4d] hover:text-white hover:border-[#005c75]"}`,children:x.label},x.value))}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-400",children:[e.jsxs("span",{children:[e.jsx("span",{className:"text-white font-medium",children:c.commitCount})," ",c.commitCount===1?"commit":"commits"]}),e.jsx("span",{className:"text-[#3d3d3d]",children:"|"}),e.jsxs("span",{children:[e.jsx("span",{className:"text-white font-medium",children:c.totalScenarios})," ",c.totalScenarios===1?"scenario changed":"scenarios changed"]}),e.jsx("span",{className:"text-[#3d3d3d]",children:"|"}),e.jsxs("span",{children:[e.jsx("span",{className:"text-white font-medium",children:c.entryCount})," ",c.entryCount===1?"entry":"entries"]})]}),c.totalScenarios===0?e.jsx("p",{className:"text-[11px] text-gray-500 italic m-0",children:"No scenario changes in this period."}):e.jsxs("div",{className:"space-y-3",children:[c.appScenarios.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Application"}),c.appScenarios.map(x=>e.jsx(Ze,{scenario:x,onScreenshotClick:s},x.name))]}),c.componentGroups.size>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),[...c.componentGroups.entries()].sort(([x],[u])=>x.localeCompare(u)).map(([x,u])=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-medium text-gray-400",children:x}),u.map(k=>e.jsx(Ze,{scenario:k,onScreenshotClick:s},k.name))]},x))]})]})]})]})}function Ze({scenario:t,onScreenshotClick:s}){const a=t.name.indexOf(" - "),i=a!==-1?t.name.slice(a+3):t.name;return e.jsxs("div",{className:"pl-2",children:[e.jsx("span",{className:"text-[10px] text-gray-500 block mb-1",children:i}),e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto",children:t.screenshots.map((h,d)=>e.jsxs("div",{className:"flex items-center shrink-0",children:[d>0&&e.jsx("span",{className:"text-[8px] text-gray-600 mx-0.5",children:"→"}),e.jsx("button",{type:"button",className:"w-16 h-16 rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] shrink-0 flex items-center justify-center cursor-pointer transition-colors",title:`${t.name} (${new Date(h.time).toLocaleDateString()})`,onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${h.path.replace("screenshots/","")}`,commitSha:null,commitMessage:null,scenarioName:t.name}),children:e.jsx("img",{src:`/api/editor-journal-image/${h.path.replace("screenshots/","")}`,alt:t.name,className:"max-w-full max-h-full object-contain",loading:"lazy"})})]},h.path))})]})}function os({isActive:t,onScreenshotClick:s,glossaryFunctions:a=[]}){const[i,h]=n.useState([]),[d,c]=n.useState(!0),[x,u]=n.useState(new Set),k=n.useCallback(w=>{u(E=>{const v=new Set(E);return v.has(w)?v.delete(w):v.add(w),v})},[]),S=n.useCallback(async()=>{try{const w=await fetch("/api/editor-journal");if(w.ok){const E=await w.json();h(E.entries||[])}}catch{}finally{c(!1)}},[]);if(n.useEffect(()=>{S()},[S]),n.useEffect(()=>{t&&S()},[t,S]),n.useEffect(()=>{if(!t)return;const w=setInterval(()=>void S(),5e3);return()=>clearInterval(w)},[t,S]),d)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("span",{className:"text-gray-500 text-sm",children:"Loading journal..."})});if(i.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No journal entries yet"}),e.jsx("p",{className:"text-xs",children:"Journal entries will appear as you build. Claude records features, screenshots, and commits as the project evolves."})]})});const N=Qt(i);return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsx(ls,{entries:i,onScreenshotClick:s}),[...N.entries()].map(([w,E])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 sticky top-0 bg-[#1e1e1e] z-10",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:rs(w)})}),e.jsx("div",{className:"space-y-2",children:E.map((v,D)=>{const O=as[v.type]||{label:v.type,color:"bg-gray-600"},R=`${v.time}-${D}`,z=x.has(R);return e.jsxs("div",{className:"bg-[#2d2d2d] rounded-lg overflow-hidden",children:[e.jsxs("div",{className:`p-3 space-y-2 ${z?"":"max-h-[300px] overflow-y-auto"}`,children:[e.jsx("div",{className:"flex items-start gap-2 cursor-pointer",onClick:()=>k(R),children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white truncate",children:v.title}),e.jsx("span",{className:`${O.color} text-white text-[9px] font-bold px-1.5 py-0.5 rounded uppercase tracking-wider shrink-0`,children:O.label})]}),e.jsx("span",{className:"text-[10px] text-gray-500",children:ns(v.time)}),v.featureName&&e.jsx("span",{className:"text-[10px] text-gray-500 italic truncate",title:v.featureName,children:v.featureName})]})}),v.userPrompt&&e.jsx(ot,{text:v.userPrompt,theme:"dark"}),e.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:v.description}),v.screenshot&&e.jsx("button",{type:"button",className:"rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] flex items-center justify-center p-1 cursor-pointer transition-colors w-full",onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${v.screenshot.replace("screenshots/","")}`,commitSha:v.commitSha,commitMessage:v.commitMessage,scenarioName:v.title}),children:e.jsx("img",{src:`/api/editor-journal-image/${v.screenshot.replace("screenshots/","")}`,alt:v.title,className:"max-w-full max-h-full object-contain",loading:"lazy"})}),v.scenarioScreenshots&&v.scenarioScreenshots.length>0&&(()=>{const P=Zt(v.scenarioScreenshots),I=v.entityChangeStatus,_=P.filter(([p])=>p==="App").flatMap(([,p])=>p),f=P.filter(([p])=>p!=="App"),l=new Map;for(const p of _){const o=Q(p.url??null),y=l.get(o)||[];y.push(p),l.set(o,y)}const j=[...l.entries()],m=p=>e.jsx("button",{type:"button",className:"w-[4.5rem] h-[4.5rem] rounded overflow-hidden border border-[#3d3d3d] hover:border-[#00a0c4] bg-[#1e1e1e] shrink-0 flex items-center justify-center cursor-pointer transition-colors",onClick:()=>s==null?void 0:s({screenshotUrl:`/api/editor-journal-image/${p.path.replace("screenshots/","")}`,commitSha:v.commitSha,commitMessage:v.commitMessage,scenarioName:p.name}),children:e.jsx("img",{src:`/api/editor-journal-image/${p.path.replace("screenshots/","")}`,alt:p.name,title:p.name,className:"max-w-full max-h-full object-contain",loading:"lazy"})},p.path);return e.jsxs("div",{className:"space-y-2",children:[j.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Application"}),j.map(([p,o])=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-medium text-gray-400",children:p}),(I==null?void 0:I[p])&&e.jsx(Qe,{status:I[p]})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:o.map(m)})]},p))]}),f.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),f.map(([p,o])=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-medium text-gray-400",children:p}),(I==null?void 0:I[p])&&e.jsx(Qe,{status:I[p]})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:o.map(m)})]},p))]})]})})(),a.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"}),e.jsx("div",{className:"space-y-2",children:a.map(P=>e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-200",children:P.name}),e.jsx("span",{className:"text-[9px] text-gray-500 truncate block",children:P.filePath}),P.testFile?e.jsx(es,{testFile:P.testFile,entityName:P.name}):e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-500",children:"No test file"})})]},P.name))})]}),v.commitSha&&e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[e.jsx("span",{className:"font-mono text-[#00a0c4] bg-[#00a0c4]/10 px-1.5 py-0.5 rounded",children:v.commitSha.slice(0,7)}),e.jsx("span",{className:"text-gray-500 truncate",children:v.commitMessage})]}),z&&v.modifiedFiles&&v.modifiedFiles.length>0&&e.jsx(ss,{files:v.modifiedFiles})]}),e.jsxs("button",{onClick:()=>k(R),className:"w-full py-1.5 text-[10px] text-gray-500 hover:text-gray-300 border-t border-[#3d3d3d] transition-colors cursor-pointer",children:["——— ",z?"Collapse":"Expand"," ———"]})]},R)})})]},w))]})})}const et=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-gray-500 shrink-0",children:e.jsx("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function cs(t,s){if(t.length<=s)return t;const a=s-2;return[t[0],"ellipsis",...t.slice(t.length-a)]}function ds({items:t,onNavigate:s}){if(t.length===0)return null;const a=cs(t,4);return e.jsx("nav",{className:"flex items-center gap-1 text-xs min-w-0",children:a.map((i,h)=>{if(i==="ellipsis")return e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(et,{}),e.jsx("span",{className:"text-gray-500",children:"..."})]},"ellipsis");const d=h===a.length-1;return e.jsxs("span",{className:"flex items-center gap-1 min-w-0",children:[h>0&&e.jsx(et,{}),d?e.jsx("span",{className:"text-white font-medium truncate",children:i.name}):e.jsx("button",{onClick:()=>s(i.componentName),className:"text-gray-400 hover:text-white transition-colors cursor-pointer bg-transparent border-none p-0 truncate",children:i.name})]},i.componentName||"app")})})}function re({imgSrc:t,name:s,isActive:a,onSelect:i}){return e.jsxs("button",{onClick:i,className:"flex flex-col items-center gap-1 cursor-pointer group w-full",title:s,children:[e.jsx("div",{className:`w-full aspect-square rounded overflow-hidden border-2 transition-all bg-[#1a1a1a] ${a?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:t?e.jsx("img",{src:t,alt:s,className:"w-full h-full object-contain",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-full ${a?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:s})]})}function de({filePath:t}){return t?e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsxs("a",{href:`/api/editor-file?path=${encodeURIComponent(t)}`,target:"_blank",rel:"noopener noreferrer",title:"Open file",className:"flex items-center gap-1 text-gray-500 hover:text-gray-300 transition-colors min-w-0",children:[e.jsx("span",{className:"text-[9px] truncate",children:t}),e.jsx("svg",{className:"shrink-0",width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx(Ee,{content:t,icon:!0,iconSize:10,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors"})]}):null}function xs({hasProject:t,scenarios:s,analyzedEntities:a,glossaryFunctions:i=[],glossaryEntries:h=[],projectRoot:d,activeScenarioId:c,onScenarioSelect:x,onAnalyzedScenarioSelect:u,onSwitchToBuild:k,zoomComponent:S,onZoomChange:N,entityImports:w,pageFilePaths:E={},projectTitle:v,projectDescription:D,breadcrumbItems:O=[]}){const{pageGroups:R,componentGroups:z}=n.useMemo(()=>{var y;const m=new Map,p=new Map;for(const C of s)if(C.componentName){const A=p.get(C.componentName)||[];A.push(C),p.set(C.componentName,A)}else if($e(C.url)){const A=(y=C.url)==null?void 0:y.match(/[?&]c=([^&]+)/),F=A?decodeURIComponent(A[1]):"Isolated",H=p.get(F)||[];H.push(C),p.set(F,H)}else{const A=Q(C.url),F=m.get(A)||[];F.push(C),m.set(A,F)}const o=new Map([...p.entries()].sort(([C],[A])=>C.localeCompare(A)));return{pageGroups:m,componentGroups:o}},[s]),P=n.useMemo(()=>a.filter(m=>m.entityType==="visual").sort((m,p)=>m.name.localeCompare(p.name)),[a]),I=n.useMemo(()=>{const m=new Map;for(const p of i)m.set(p.name,p);return m},[i]),_=n.useRef(null),f=n.useRef(0),l=n.useCallback(()=>{_.current&&(f.current=_.current.scrollTop)},[]);if(n.useEffect(()=>{_.current&&f.current>0&&(_.current.scrollTop=f.current)}),!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Ready to build something?"}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});if(!(s.length>0||P.length>0))return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 px-8 text-center",children:[v?e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:v}),D&&e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed",children:D})]}):e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Your project is ready"}),e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed",children:"Describe what you want to build in the Chat and your pages and components will appear here."}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});if(S){const m=R.get(S)||[],p=z.get(S)||[],o=P.find(g=>g.name===S),y=I.get(S),C=[...m,...p],A=new Set((w==null?void 0:w[S])||[]),F=A.size>0,H=F?[...z.entries()].filter(([g])=>A.has(g)):[],Z=F?P.filter(g=>A.has(g.name)&&!H.some(([T])=>T===g.name)):[],q=F?h.filter(g=>A.has(g.name)&&g.returnType!=="JSX.Element"&&g.returnType!=="React.ReactNode").map(g=>({name:g.name,filePath:g.filePath,description:g.description||"",testFile:g.testFile,feature:g.feature})):[],ie=H.length>0||Z.length>0,le=q.length>0,me=ie||le;return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx(ds,{items:O,onNavigate:N}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-white m-0 font-['IBM_Plex_Sans'] uppercase tracking-wider",children:S}),(()=>{const g=(y==null?void 0:y.filePath)||(o==null?void 0:o.filePath)||E[S];return g?e.jsx(de,{filePath:g,projectRoot:d}):null})()]}),C.length>0&&e.jsx("div",{className:"grid grid-cols-3 gap-2",children:C.map(g=>e.jsx(re,{imgSrc:g.screenshotPath?`/api/editor-scenario-image/${g.id}.png${g.updatedAt?`?v=${encodeURIComponent(g.updatedAt)}`:""}`:null,name:g.name,isActive:g.id===c,onSelect:()=>x(g)},g.id))}),o&&(o.scenarios.length>0||o.pendingScenarios.length>0)&&e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.scenarios.map(g=>e.jsx(re,{imgSrc:g.screenshotPath?`/api/screenshot/${g.screenshotPath}`:null,name:g.name,isActive:!1,onSelect:()=>u({analysisId:o.analysisId,scenarioId:g.id,scenarioName:g.name,entitySha:o.sha,entityName:o.name})},g.id)),o.pendingScenarios.map(g=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:g,children:g},g))]}),y&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] text-gray-500",children:"Tests:"}),e.jsx(de,{filePath:y.testFile,projectRoot:d})]}),C.length===0&&!o&&!y&&e.jsx("div",{className:"text-xs text-gray-500",children:"No scenarios for this entity"}),me&&e.jsxs("div",{className:"pt-3 mt-2 border-t border-[#3d3d3d] space-y-3",children:[ie&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),H.map(([g,T])=>e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>N(g),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:g})}),T.length>0&&e.jsx("div",{className:"grid grid-cols-3 gap-2 pt-1",children:T.map(L=>e.jsx(re,{imgSrc:L.screenshotPath?`/api/editor-scenario-image/${L.id}.png${L.updatedAt?`?v=${encodeURIComponent(L.updatedAt)}`:""}`:null,name:L.name,isActive:L.id===c,onSelect:()=>x(L)},L.id))})]},g)),Z.map(g=>e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>N(g.name),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:g.name})}),(g.scenarios.length>0||g.pendingScenarios.length>0)&&e.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-1",children:[g.scenarios.map(T=>e.jsx(re,{imgSrc:T.screenshotPath?`/api/screenshot/${T.screenshotPath}`:null,name:T.name,isActive:!1,onSelect:()=>u({analysisId:g.analysisId,scenarioId:T.id,scenarioName:T.name,entitySha:g.sha,entityName:g.name})},T.id)),g.pendingScenarios.map(T=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:T,children:T},T))]})]},g.sha))]}),le&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"}),q.map(g=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>N(g.name),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:g.name})}),e.jsx(de,{filePath:g.filePath,projectRoot:d}),g.testFile&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx("span",{className:"text-[9px] text-gray-600",children:"test:"}),e.jsx("span",{className:"text-[9px] text-gray-500 truncate",children:g.testFile})]})]},g.name))]})]})]})})}return e.jsx("div",{ref:_,onScroll:l,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-4",children:[v&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-white m-0 font-['IBM_Plex_Sans']",children:v}),D&&e.jsx("p",{className:"text-xs text-gray-400 m-0 mt-1 font-['IBM_Plex_Sans'] leading-relaxed",children:D})]}),R.size>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"}),e.jsx("button",{onClick:k,className:"px-2.5 py-1 text-[10px] font-medium text-gray-400 bg-[#2a2a2a] border border-[#4d4d4d] rounded hover:bg-[#333] hover:text-white hover:border-[#005c75] transition-colors cursor-pointer",children:"+ New Page"})]}),e.jsxs("p",{className:"text-[11px] text-gray-500 m-0 mt-1.5 font-['IBM_Plex_Sans'] leading-relaxed",children:["Select a page scenario below and switch to"," ",e.jsx("button",{onClick:k,className:"text-[#00a0c4] hover:text-[#00c4eb] bg-transparent border-none p-0 cursor-pointer underline font-inherit text-inherit",children:"Build"})," ","to change or enhance an existing page or"," ",e.jsx("button",{onClick:k,className:"text-[#00a0c4] hover:text-[#00c4eb] bg-transparent border-none p-0 cursor-pointer underline font-inherit text-inherit",children:"create a new page"})]}),[...R.entries()].sort(([m],[p])=>m==="Home"?-1:p==="Home"?1:m.localeCompare(p)).map(([m,p])=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>N(m),className:"text-[11px] font-medium text-gray-400 cursor-pointer hover:text-white transition-colors bg-transparent border-none p-0",children:m})}),E[m]&&e.jsx(de,{filePath:E[m],projectRoot:d}),e.jsx("div",{className:"grid grid-cols-3 gap-2 pt-1",children:p.map(o=>e.jsx(re,{imgSrc:o.screenshotPath?`/api/editor-scenario-image/${o.id}.png${o.updatedAt?`?v=${encodeURIComponent(o.updatedAt)}`:""}`:null,name:o.name,isActive:o.id===c,onSelect:()=>x(o)},o.id))})]},m))]})]})})}const tt={new:0,edited:1,impacted:2};function st({status:t,onClick:s}){const a={new:{label:"New",bg:"bg-green-100",text:"text-green-700",border:"border-green-200"},edited:{label:"Edited",bg:"bg-blue-100",text:"text-blue-700",border:"border-blue-200"},impacted:{label:"Impacted",bg:"bg-amber-100",text:"text-amber-700",border:"border-amber-200"}}[t.status],i=s&&(t.status==="edited"||t.status==="impacted");return e.jsx("button",{onClick:i?s:void 0,className:`${a.bg} ${a.text} ${a.border} border text-[9px] font-bold px-1.5 py-0.5 rounded-full uppercase tracking-wider shrink-0 ${i?"cursor-pointer hover:opacity-80 transition-opacity":"cursor-default"}`,children:a.label})}function at({filePath:t}){const[s,a]=n.useState(null),[i,h]=n.useState(!0),[d,c]=n.useState(null);return n.useEffect(()=>{Gt(()=>import("./index-yHOVb4rc.js"),__vite__mapDeps([0,1])).then(x=>{c(()=>x.default)})},[]),n.useEffect(()=>{h(!0),fetch(`/api/editor-file-diff?path=${encodeURIComponent(t)}`).then(x=>x.json()).then(x=>{a({oldContent:x.oldContent,newContent:x.newContent})}).catch(()=>{a(null)}).finally(()=>h(!1))},[t]),i?e.jsx("div",{className:"p-2 text-[10px] text-gray-400",children:"Loading diff..."}):!s||!d?e.jsx("div",{className:"p-2 text-[10px] text-gray-400",children:"Could not load diff"}):e.jsx("div",{className:"mt-2 border border-gray-200 rounded-lg overflow-hidden max-h-[300px] overflow-auto text-xs",children:e.jsx(d,{oldValue:s.oldContent,newValue:s.newContent,splitView:!1,useDarkTheme:!1,showDiffOnly:!0,styles:{contentText:{fontSize:"11px",lineHeight:"1.4"},line:{padding:"1px 8px",fontSize:"11px"}}})})}function nt({impactedBy:t,changedEntities:s}){return e.jsx("div",{className:"mt-2 bg-amber-50 border border-amber-200 rounded-lg p-2.5",children:t&&t.length>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] font-semibold text-amber-700 uppercase tracking-wider",children:"Re-captured because these dependencies changed"}),e.jsx("ul",{className:"mt-1.5 space-y-1",children:t.map(a=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold px-1 py-0 rounded-full uppercase tracking-wider border ${a.changeType==="new"?"bg-green-100 text-green-700 border-green-200":"bg-blue-100 text-blue-700 border-blue-200"}`,children:a.changeType==="new"?"New":"Edited"}),e.jsx("span",{className:"text-[11px] font-medium text-amber-800",children:a.name}),e.jsx("span",{className:"text-[9px] text-amber-500 truncate",children:a.filePath})]},a.filePath))})]}):s&&s.length>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] font-semibold text-amber-700 uppercase tracking-wider",children:"Unchanged — these entities were modified in this session"}),e.jsx("ul",{className:"mt-1.5 space-y-1",children:s.map(a=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold px-1 py-0 rounded-full uppercase tracking-wider border ${a.status==="new"?"bg-green-100 text-green-700 border-green-200":"bg-blue-100 text-blue-700 border-blue-200"}`,children:a.status==="new"?"New":"Edited"}),e.jsx("span",{className:"text-[11px] font-medium text-amber-800",children:a.name})]},a.name))})]}):e.jsx("span",{className:"text-[10px] text-amber-600",children:"This component was re-captured because a dependency changed"})})}function rt({scenarioId:t,name:s,isActive:a,onSelect:i,updatedAt:h}){const[d,c]=n.useState(!1);n.useEffect(()=>{c(!1)},[t]);const x=`/api/editor-scenario-image/${t}.png${h?`?v=${encodeURIComponent(h)}`:""}`;return e.jsxs("button",{onClick:i,className:"flex flex-col items-center gap-1.5 cursor-pointer group",title:s,children:[e.jsx("div",{className:`w-32 h-32 rounded-lg overflow-hidden border-2 transition-all ${a?"border-[#0ea5e9] ring-2 ring-[#0ea5e9]/40 shadow-lg shadow-[#0ea5e9]/20":"border-gray-200 hover:border-gray-400 shadow-sm"}`,children:d?e.jsx("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center",children:e.jsx("span",{className:"text-[9px] text-gray-400",children:"No preview"})}):e.jsx("img",{src:x,alt:s,className:"w-full h-full object-contain bg-white",loading:"lazy",onError:()=>c(!0)})}),e.jsx("span",{className:`text-[11px] leading-tight text-center truncate w-32 font-medium ${a?"text-gray-900":"text-gray-600 group-hover:text-gray-900"}`,children:s})]})}function ms({filePath:t}){return t?e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsxs("a",{href:`/api/editor-file?path=${encodeURIComponent(t)}`,target:"_blank",rel:"noopener noreferrer",title:"Open file",className:"flex items-center gap-1 text-gray-400 hover:text-gray-600 transition-colors min-w-0",children:[e.jsx("span",{className:"text-[9px] truncate",children:t}),e.jsx("svg",{className:"shrink-0",width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx(Ee,{content:t,icon:!0,iconSize:10,className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors"})]}):null}function ps({testFile:t,entityName:s}){const{results:a,isRunning:i,runTests:h}=Re(t);if(i&&!a)return e.jsxs("div",{className:"pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#0ea5e9] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]});if(!a)return null;if(a.status==="error")return e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-red-500",children:a.errorMessage})});const d=s?a.testCases.filter(u=>u.fullName.startsWith(s)):a.testCases,c=d.length>0?d:a.testCases;if(c.length===0)return null;const x=s?`${s} > `:"";return e.jsxs("div",{className:"pt-1 space-y-0.5",children:[c.map(u=>{var S;const k=x&&u.fullName.startsWith(x)?u.fullName.slice(x.length):u.fullName;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[u.status==="passed"?e.jsx("span",{className:"text-green-600 text-[10px]",children:"✓"}):u.status==="failed"?e.jsx("span",{className:"text-red-500 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-400 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${u.status==="passed"?"text-green-600":u.status==="failed"?"text-red-500":"text-gray-400"}`,children:k})]}),u.status==="failed"&&((S=u.failureMessages)==null?void 0:S.map((N,w)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-400 truncate max-w-full",title:N,children:N.split(`
|
|
5
|
-
`)[0]},w)))]},u.fullName)}),e.jsx("button",{onClick:h,disabled:i,className:"mt-1 text-[10px] text-[#0ea5e9] hover:text-[#38bdf8] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:i?"Running...":"Re-run"})]})}function it(t){const s=t.indexOf(" - ");return s!==-1?t.slice(s+3):t}function lt(t,s){return!s||Object.keys(s).length===0?t:[...t].sort(([a],[i])=>{var x,u;const h=((x=s[a])==null?void 0:x.status)||"impacted",d=((u=s[i])==null?void 0:u.status)||"impacted",c=(tt[h]??2)-(tt[d]??2);return c!==0?c:a.localeCompare(i)})}function us({scenarios:t,allScenarios:s=[],glossaryFunctions:a=[],projectRoot:i,activeScenarioId:h,onScenarioSelect:d,onClose:c,entityChangeStatus:x={},modifiedFiles:u=[],featureName:k,userPrompt:S}){const N=n.useMemo(()=>{if(s.length===0||Object.keys(x).length===0)return t;const l=new Set(t.map(m=>m.id)),j=s.filter(m=>{var o;if(l.has(m.id))return!1;const p=m.componentName||Q(m.url);return((o=x[p])==null?void 0:o.status)==="impacted"});return j.length===0?t:[...t,...j]},[t,s,x]),w=n.useMemo(()=>Object.entries(x).filter(([,l])=>l.status==="new"||l.status==="edited").map(([l,j])=>({name:l,status:j.status})),[x]),[E,v]=n.useState(null),D=n.useCallback(l=>{v(j=>j===l?null:l)},[]),{pageGroups:O,componentGroups:R}=n.useMemo(()=>{var m;const l=new Map,j=new Map;for(const p of N)if(p.componentName){const o=j.get(p.componentName)||[];o.push(p),j.set(p.componentName,o)}else if($e(p.url)){const o=(m=p.url)==null?void 0:m.match(/[?&]c=([^&]+)/),y=o?decodeURIComponent(o[1]):"Isolated",C=j.get(y)||[];C.push(p),j.set(y,C)}else{const o=Q(p.url),y=l.get(o)||[];y.push(p),l.set(o,y)}return{pageGroups:l,componentGroups:j}},[N]),z=n.useMemo(()=>lt([...O.entries()],x),[O,x]),P=n.useMemo(()=>lt([...R.entries()],x),[R,x]),I=z,_=P,f=n.useMemo(()=>qt(a,x),[a,x]);return N.length===0&&a.length===0?e.jsxs("div",{className:"h-full bg-white flex items-center justify-center relative",children:[e.jsx("button",{onClick:c,className:"absolute top-2 right-3 text-gray-400 hover:text-gray-700 text-lg leading-none cursor-pointer bg-transparent border-none",title:"Close results",children:"×"}),e.jsx("span",{className:"text-sm text-gray-400",children:"No scenarios registered yet"})]}):e.jsxs("div",{className:"h-full bg-white flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-gray-200 shrink-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Working Session Results"}),k&&e.jsx("div",{className:"text-[11px] text-gray-400 truncate",title:k,children:k})]}),e.jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-700 text-lg leading-none cursor-pointer bg-transparent border-none shrink-0",title:"Close results",children:"×"})]}),S&&e.jsx(ot,{text:S,theme:"light"}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.jsxs("div",{className:"space-y-5",children:[I.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Application"})}),e.jsx("div",{className:"space-y-3 pl-1",children:I.map(([l,j])=>{var y;const m=x[l],p=E===l,o=(y=j[0])==null?void 0:y.componentPath;return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-600",children:l}),m&&e.jsx(st,{status:m,onClick:()=>D(l)})]}),p&&(m==null?void 0:m.status)==="edited"&&o&&e.jsx(at,{filePath:o}),p&&(m==null?void 0:m.status)==="impacted"&&e.jsx(nt,{impactedBy:m.impactedBy,changedEntities:w}),e.jsx("div",{className:"flex flex-wrap gap-3",children:j.map(C=>e.jsx(rt,{scenarioId:C.id,name:it(C.name),isActive:C.id===h,onSelect:()=>d(C),updatedAt:C.updatedAt},C.id))})]},l)})})]}),_.length>0&&e.jsxs("div",{className:I.length>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Components"})}),e.jsx("div",{className:"space-y-3 pl-1",children:_.map(([l,j])=>{var y;const m=x[l],p=E===l,o=(y=j[0])==null?void 0:y.componentPath;return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-600",children:l}),m&&e.jsx(st,{status:m,onClick:()=>D(l)})]}),p&&(m==null?void 0:m.status)==="edited"&&o&&e.jsx(at,{filePath:o}),p&&(m==null?void 0:m.status)==="impacted"&&e.jsx(nt,{impactedBy:m.impactedBy,changedEntities:w}),e.jsx("div",{className:"flex flex-wrap gap-3",children:j.map(C=>e.jsx(rt,{scenarioId:C.id,name:it(C.name),isActive:C.id===h,onSelect:()=>d(C),updatedAt:C.updatedAt},C.id))})]},l)})})]}),f.length>0&&e.jsxs("div",{className:I.length>0||_.length>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),e.jsx("div",{className:"space-y-2 pl-1",children:f.map(l=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-700",children:l.name})}),e.jsx(ms,{filePath:l.filePath,projectRoot:i}),l.testFile?e.jsx(ps,{testFile:l.testFile,entityName:l.name}):e.jsx("div",{className:"pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-400",children:"No test file"})})]},l.name))})]}),u.length>0&&e.jsxs("div",{className:I.length>0||_.length>0||f.length>0?"pt-3 border-t border-gray-200":"",children:[e.jsx("div",{className:"mb-2",children:e.jsxs("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:["Modified Files (",u.length,")"]})}),e.jsx("div",{className:"space-y-0.5 pl-1 max-h-[200px] overflow-auto",children:u.map(l=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[9px] font-bold uppercase w-[14px] text-center ${l.status==="added"||l.status==="untracked"?"text-green-600":l.status==="modified"?"text-blue-600":l.status==="renamed"?"text-purple-600":"text-gray-400"}`,children:l.status==="added"||l.status==="untracked"?"A":l.status==="modified"?"M":l.status==="renamed"?"R":"?"}),e.jsx("span",{className:"text-[10px] text-gray-500 truncate font-mono",children:l.path})]},l.path))})]})]})})]})}const hs=[{key:"app",label:"App"},{key:"build",label:"Build"},{key:"data",label:"Structure"},{key:"journal",label:"Journal"}];function fs({activeTab:t,onTabChange:s,buildIdle:a,zoomComponent:i,breadcrumbItems:h,onBreadcrumbNavigate:d,panelLayout:c,onToggleExpand:x}){return e.jsxs("div",{className:"bg-[#3d3d3d] h-10 flex items-center px-3 gap-3 shrink-0 z-20 border-b border-[#2d2d2d]",children:[e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("img",{src:Jt,alt:"CodeYam",className:"h-5 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-xs whitespace-nowrap",children:"Codeyam Editor"})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("div",{className:"flex items-center gap-0.5 bg-[#4a3232] rounded-lg p-0.5",children:hs.map(u=>e.jsxs("button",{onClick:()=>s(u.key),className:`px-2.5 py-1 text-xs font-medium rounded-md transition-colors cursor-pointer ${t===u.key?"bg-[#7a4444] text-white":"text-gray-300 hover:text-white"}`,children:[u.label,u.key==="build"&&a&&t!=="build"&&e.jsx("span",{className:"ml-1 inline-block w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"})]},u.key))}),x&&e.jsx("button",{onClick:x,className:"p-1.5 rounded text-gray-400 hover:text-white transition-colors cursor-pointer",title:c==="editor-only"?"Show preview":"Hide preview",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:c==="editor-only"?e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M9 3v18"}),e.jsx("path",{d:"M16 15l-3-3 3-3"})]}):e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M9 3v18"}),e.jsx("path",{d:"M14 9l3 3-3 3"})]})})})]})]})}function gs({preview:t,onDismiss:s,onLoadCommit:a}){return e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-[700px] w-full",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#333] m-0 font-['IBM_Plex_Sans']",children:"Journal Screenshot"}),e.jsx("p",{className:"text-sm text-[#888] mt-1 m-0 font-['IBM_Plex_Sans']",children:"This is a snapshot from a previous version — not a live preview"})]}),e.jsx("div",{className:"rounded-lg overflow-hidden border-2 border-[#ccc] shadow-md max-w-full w-fit",children:e.jsx("img",{src:t.screenshotUrl,alt:t.scenarioName,className:"max-w-full h-auto block"})}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#666]",children:[t.commitSha&&e.jsx("span",{className:"font-mono text-xs text-[#00a0c4] bg-[#00a0c4]/15 px-2 py-0.5 rounded",children:t.commitSha.slice(0,7)}),e.jsxs("span",{className:"truncate",children:[t.scenarioName,t.commitMessage&&` — ${t.commitMessage}`]})]}),e.jsx("div",{className:"flex items-center gap-3",children:t.commitSha&&a&&e.jsx(js,{commitSha:t.commitSha,onLoadCommit:a})})]})}function js({commitSha:t,onLoadCommit:s}){const[a,i]=n.useState(!1),[h,d]=n.useState(null);return e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{i(!0),d(null),s(t).then(c=>{c.success||d(c.error||"Failed to load commit")}).catch(c=>{d(c instanceof Error?c.message:"Network error")}).finally(()=>i(!1))},disabled:a,className:"bg-[#005c75] hover:bg-[#004d63] disabled:opacity-50 text-white text-sm font-medium px-4 py-1.5 rounded transition-colors cursor-pointer",children:a?"Reverting...":"Revert to this code and load this version"}),h&&e.jsx("div",{className:"bg-red-50 border border-red-200 rounded px-4 py-2 text-sm text-red-600 w-full text-center",children:h})]})}function vs({analysisId:t,scenarioId:s,scenarioName:a,entityName:i,projectSlug:h,onStateChange:d}){const{interactiveServerUrl:c,isStarting:x,isLoading:u}=Vt({analysisId:t,scenarioId:s,scenarioName:a,entityName:i,projectSlug:h,enabled:!0});return n.useEffect(()=>{d(c,x||u)},[c,x,u,d]),null}function bs(t,s){return s.status==="error"?{url:null,proxyUrl:null,isStarting:!1,error:s.errorMessage||"Dev server crashed",canStartServer:t.canStartServer,autoStartAttempted:t.autoStartAttempted,shouldAutoStart:!1}:s.url?{url:s.url,proxyUrl:s.proxyUrl||null,isStarting:!1,error:null,canStartServer:!0,autoStartAttempted:t.autoStartAttempted,shouldAutoStart:!1}:s.status==="starting"?{...t,isStarting:!0,error:null,canStartServer:!0,shouldAutoStart:!1}:s.status==="stopped"?t.url?{...t,url:null,isStarting:!1,shouldAutoStart:!1}:t.autoStartAttempted?{...t,isStarting:!1,shouldAutoStart:!1}:{...t,autoStartAttempted:!0,shouldAutoStart:!0}:{...t,shouldAutoStart:!1}}function Ns(){const[t,s]=n.useState({url:null,proxyUrl:null,isStarting:!1,error:null,canStartServer:!0,autoStartAttempted:!1}),a=n.useRef(t);a.current=t,n.useEffect(()=>{let d=!1,c=null;const x=async()=>{try{const u=await fetch("/api/editor-dev-server");if(d)return;const k=await u.json(),S=bs(a.current,k),{shouldAutoStart:N,...w}=S;if(s(w),N)try{const E=await fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})});if(d)return;E.ok?s(v=>({...v,isStarting:!0})):s(v=>({...v,canStartServer:!1}))}catch{}}catch{}};return x(),c=setInterval(()=>void x(),2e3),()=>{d=!0,c&&clearInterval(c)}},[t.url]);const i=n.useCallback(()=>{s(d=>({...d,error:null,isStarting:!0})),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restart"})}).catch(()=>{})},[]),h=n.useCallback(()=>{s(d=>({...d,error:null,isStarting:!0})),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})}).catch(()=>{})},[]);return{devServerUrl:t.url,proxyUrl:t.proxyUrl,isStarting:t.isStarting,error:t.error,canStartServer:t.canStartServer,retryServer:i,startServer:h}}function ys(t){const s=n.useRef(null),a=n.useRef(null);n.useEffect(()=>{if(typeof document>"u")return;a.current||(a.current=document.createElement("canvas"),a.current.width=64,a.current.height=64);const i=document.querySelector('link[rel="icon"]');if(!i)return;if(s.current||(s.current=i.href),!t){i.href=s.current;return}const h=new Image;h.crossOrigin="anonymous",h.onload=()=>{const d=a.current,c=d.getContext("2d");c.clearRect(0,0,64,64),c.drawImage(h,0,0,64,64);const x=18,u=64-x,k=x;c.beginPath(),c.arc(u,k,x+3,0,2*Math.PI),c.fillStyle="#ffffff",c.fill(),c.beginPath(),c.arc(u,k,x,0,2*Math.PI),c.fillStyle="#ef4444",c.fill(),i.href=d.toDataURL("image/png")},h.src=s.current},[t]),n.useEffect(()=>()=>{if(typeof document>"u")return;const i=document.querySelector('link[rel="icon"]');i&&s.current&&(i.href=s.current)},[])}const Bs=()=>[{title:"Editor - CodeYam"},{name:"description",content:"CodeYam Code + Data Editor"}];class ws extends n.Component{constructor(){super(...arguments);qe(this,"state",{error:null,errorInfo:null})}static getDerivedStateFromError(a){return{error:a,errorInfo:null}}componentDidCatch(a,i){console.error("[EditorErrorBoundary] Error:",a.message),console.error("[EditorErrorBoundary] Component stack:",i.componentStack),console.error("[EditorErrorBoundary] Loader snapshot:",JSON.stringify(this.props.loaderSnapshot,null,2)),this.setState({errorInfo:i})}render(){var a;return this.state.error?e.jsx("div",{className:"fixed inset-0 bg-[#1e1e1e] flex items-center justify-center p-8",children:e.jsxs("div",{className:"max-w-[600px] w-full space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-red-400 font-['IBM_Plex_Sans'] m-0",children:"Something went wrong"}),e.jsx("pre",{className:"text-xs text-gray-300 bg-[#2d2d2d] p-3 rounded overflow-auto max-h-[120px]",children:this.state.error.message}),((a=this.state.errorInfo)==null?void 0:a.componentStack)&&e.jsxs("details",{className:"text-xs text-gray-500",children:[e.jsx("summary",{className:"cursor-pointer hover:text-gray-300 transition-colors",children:"Component stack"}),e.jsx("pre",{className:"mt-2 bg-[#2d2d2d] p-3 rounded overflow-auto max-h-[200px] text-yellow-300",children:this.state.errorInfo.componentStack})]}),e.jsx("p",{className:"text-xs text-gray-500 m-0",children:"Full diagnostics are in the browser console."}),e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-[#005c75] text-white text-sm rounded hover:bg-[#004d63] transition-colors cursor-pointer",children:"Reload"})]})}):this.props.children}}const As=Et(function(){const{projectSlug:s,projectRoot:a,hasProject:i,scenarios:h,allScenarios:d,analyzedEntities:c,glossaryFunctions:x,glossaryEntries:u,entityImports:k,pageFilePaths:S,entityChangeStatus:N,modifiedFiles:w,featureName:E,userPrompt:v,projectTitle:D,projectDescription:O,defaultScreenSize:R,screenSizes:z}=Rt(),[P,I]=$t(),_=n.useRef(null),f=n.useRef(null),l=n.useRef(null),j=P.get("zoom")||void 0,m=P.get("scenario")||void 0,[p,o]=n.useState(()=>{if(typeof window>"u")return[];const r=new URLSearchParams(window.location.search).get("zoom");return r?[r]:[]}),y=n.useRef(null),C=n.useRef([]),A=n.useRef(null);n.useEffect(()=>{var B;const r=m||((B=Bt(d))==null?void 0:B.id);if(!At(r,y.current))return;const b=d.find(V=>V.id===r);if(!b)return;y.current=r;const M=Me(b,C.current,A.current);M&&K(M);const $=ce(b.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:$,scenarioId:b.id,scenarioName:b.name,scenarioType:b.type})}).catch(()=>{})},[m,d]),n.useEffect(()=>{const r=new BroadcastChannel("codeyam-editor");return r.onmessage=b=>{var M;if(((M=b.data)==null?void 0:M.type)==="switch-scenario"&&b.data.scenarioId){const $=b.data.scenarioId,B=d.find(Pe=>Pe.id===$);if(!B)return;y.current=$;const V=new URLSearchParams(P);V.set("scenario",$),V.delete("zoom"),I(V),pe(null),oe(null),G(null),J(!0);const Pt=ce(B.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:Pt,scenarioId:$,scenarioType:B.type})}).then(()=>{te(Pe=>Pe+1)}).catch(()=>{J(!1)})}},()=>r.close()},[P,I,d]),n.useEffect(()=>{if(P.get("ref")!=="link"||!m)return;const r=new BroadcastChannel("codeyam-editor");r.postMessage({type:"switch-scenario",scenarioId:m}),r.close(),window.close()},[]);const{devServerUrl:F,proxyUrl:H,isStarting:Z,error:q,canStartServer:ie,retryServer:le,startServer:me}=Ns(),[g,T]=n.useState(!1),[L,pe]=n.useState(null),[Te,oe]=n.useState(null),[ue,Le]=n.useState(!1),[he,G]=n.useState(null),ct=n.useCallback(async r=>{const M=await(await fetch("/api/editor-load-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitSha:r})})).json();return M.success&&(G(null),T(!1)),M},[]),dt=n.useCallback((r,b)=>{oe(M=>(r&&r!==M&&T(!1),r)),!b&&r&&T(!0),Le(b)},[]),Be=n.useCallback(r=>{G(null),pe(M=>(M&&M.analysisId===r.analysisId||(oe(null),te(B=>B+1)),r)),Le(!0),T(!1);const b=new URLSearchParams(P);b.delete("scenario"),b.delete("zoom"),I(b)},[P,I]),[U,K]=n.useState(R?{name:R.name,width:R.width,height:R.height}:{name:"Desktop",width:1440,height:900}),[Ae,_e]=n.useState(!1),De=R?{name:R.name,width:R.width,height:R.height}:null;A.current=De;const[W,fe]=n.useState("app"),xt=n.useCallback(()=>{fe("build"),ge(!0)},[]),[mt,ge]=n.useState(!1),[Oe,je]=n.useState(!1),pt=n.useCallback(r=>{je(r)},[]);ys(Oe);const[ee,Ue]=n.useState("split"),[ve,ze]=n.useState(!1),ut=n.useCallback(()=>{ze(!0),fe("build"),ge(!0)},[]),Fe=n.useCallback(()=>{ze(!1)},[]),ht=n.useCallback(r=>{K(r),fetch("/api/editor-project-info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultScreenSize:r,skipBroadcast:!0})})},[]),[We,He]=n.useState(_t);n.useEffect(()=>{const r=Dt();He(r),r.systemNotification&&typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]);const ft=n.useCallback(r=>{He(r),Ot(r)},[]);n.useEffect(()=>{if(W==="build"){je(!1);const r=setTimeout(()=>{var b,M;(b=_.current)==null||b.scrollToBottom(),(M=_.current)==null||M.focus()},50);return()=>clearTimeout(r)}},[W]),n.useEffect(()=>{function r(){!document.hidden&&W==="build"&&je(!1)}return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[W]);const[be,gt]=n.useState(null);n.useEffect(()=>{const r=l.current;if(!r)return;const b=new ResizeObserver(M=>{const $=M[0];$&>({width:$.contentRect.width,height:$.contentRect.height})});return b.observe(r),()=>b.disconnect()},[]);const X=n.useMemo(()=>be?Ut(be,U):1,[be,U]),[Ne,te]=n.useState(0),[Ge,ye]=n.useState(null),[Je,J]=n.useState(!1),jt=n.useCallback((r,b)=>{if(ye(r||null),b){const M=new URLSearchParams(P);M.set("scenario",b),y.current=b,I(M);const $=d.find(B=>B.id===b);if($){const B=Me($,C.current,A.current);B&&K(B)}}G(null),te(M=>M+1)},[P,I,d]),{customSizes:we,addCustomSize:vt,removeCustomSize:bt}=Tt(s),Se=n.useMemo(()=>Yt(z),[z]),ke=n.useMemo(()=>[...Se,...we],[Se,we]);C.current=ke;const Ve=n.useMemo(()=>{const r=[{name:"App"}];for(const b of p)r.push({name:b,componentName:b});return r},[p]),Ce=n.useCallback(r=>{const b=new URLSearchParams(P);if(r){b.set("zoom",r);const M=p.indexOf(r);M>=0?o(p.slice(0,M+1)):o([...p,r]);const $=d.find(B=>B.componentName===r||B.componentName===null&&Q(B.url)===r);if($){b.set("scenario",$.id),y.current=$.id,J(!0);const B=ce($.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:B,scenarioId:$.id,scenarioType:$.type})}).then(()=>{te(V=>V+1)}).catch(()=>{J(!1)})}else b.delete("scenario")}else b.delete("zoom"),b.delete("scenario"),o([]);I(b)},[P,I,d,p]),se=n.useCallback(r=>{pe(null),oe(null),G(null),ye(null);const b=Me(r,ke,De);b&&K(b),y.current=r.id;const M=new URLSearchParams(P);M.set("scenario",r.id),I(M),J(!0);const $=ce(r.name);fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:$,scenarioId:r.id,scenarioType:r.type,skipBroadcast:!0})}).then(()=>{te(B=>B+1)}).catch(()=>{J(!1)})},[P,I,ke]),Nt=n.useCallback(r=>{if(!r.commitSha){const b=d.find(M=>M.name===r.scenarioName);if(b){se(b);return}}G(r)},[d,se]),yt=r=>{const b={name:r.name,width:r.width,height:r.height};K(b),fetch("/api/editor-project-info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultScreenSize:b,skipBroadcast:!0})})},wt=(r,b,M)=>{vt(r,b,M)},St=r=>{K(r),fetch("/api/editor-project-info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultScreenSize:r,skipBroadcast:!0})})},kt=()=>{L||T(!0),J(!1)},ae=n.useMemo(()=>zt({activeAnalyzedScenario:!!L,analyzedPreviewUrl:Te,activeScenarioId:m||null,scenarios:d,proxyUrl:H,devServerUrl:F,zoomComponent:j||null}),[H,F,j,m,d,L,Te]),Ye=n.useMemo(()=>{const r=Ft(ae,Ge);if(!r)return null;const b=r.includes("?")?"&":"?";return`${r}${b}__cb=${Ne}`},[ae,Ge,Ne]),Ct=n.useMemo(()=>({projectSlug:s,hasProject:i,scenarioCount:h==null?void 0:h.length,allScenarioCount:d==null?void 0:d.length,analyzedEntityCount:c==null?void 0:c.length,glossaryFunctionCount:x==null?void 0:x.length,entityChangeStatusKeys:N?Object.keys(N):[],featureName:E}),[s,i,h,d,c,x,N,E]);return e.jsx(ws,{loaderSnapshot:Ct,children:e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[L&&e.jsx(vs,{analysisId:L.analysisId,scenarioId:L.scenarioId,scenarioName:L.scenarioName,entityName:L.entityName,projectSlug:s,onStateChange:dt},L.analysisId),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:ee==="editor-only"?{display:"none"}:void 0,children:[e.jsxs("div",{className:"bg-[#2d2d2d] border-b border-[#3d3d3d] shrink-0 z-10 h-10 flex items-center px-4 relative",children:[e.jsx("div",{className:"flex items-center gap-1 shrink-0 z-10",children:e.jsx("button",{onClick:()=>Ue(r=>r==="preview-only"?"split":"preview-only"),className:"p-1.5 rounded text-gray-500 hover:text-gray-300 transition-colors cursor-pointer",title:ee==="preview-only"?"Show sidebar":"Hide sidebar",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M9 3v18"})]})})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center gap-1 pointer-events-none",children:e.jsxs("div",{className:"flex items-center gap-1 pointer-events-auto",children:[xe.map(r=>e.jsxs("button",{onClick:()=>yt(r),className:`p-1.5 rounded transition-colors cursor-pointer ${U.name===r.name?"text-white bg-[#555]":"text-gray-500 hover:text-gray-300"}`,title:`${r.name} (${r.width}×${r.height})`,children:[r.name==="Desktop"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8M12 17v4"})]}),r.name==="Laptop"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8H4V6z"}),e.jsx("path",{d:"M2 18h20"})]}),r.name==="Tablet"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2"}),e.jsx("path",{d:"M12 18h.01"})]}),r.name==="Mobile"&&e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"7",y:"2",width:"10",height:"20",rx:"2"}),e.jsx("path",{d:"M12 18h.01"})]})]},r.name)),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>_e(r=>!r),className:`flex items-center gap-1.5 px-2 py-1 rounded transition-colors cursor-pointer ${Ae||!xe.some(r=>r.name===U.name)?"text-white bg-[#555]":"text-gray-400 hover:text-gray-200 hover:bg-[#444]"}`,title:"Custom dimensions",children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})}),e.jsxs("span",{className:"text-xs font-mono",children:[U.width," ×"," ",U.height??900]})]}),Ae&&e.jsx(Lt,{currentWidth:U.width,currentHeight:U.height??900,devicePresets:Se,customSizes:we,onApply:St,onSave:wt,onRemove:bt,onClose:()=>_e(!1)})]})]})}),e.jsx("div",{className:"ml-auto flex items-center gap-1 shrink-0 z-10",children:e.jsx("button",{onClick:()=>{const r=Ye||ae;r&&window.open(r,"_blank")},className:"p-1.5 rounded text-gray-500 hover:text-gray-300 transition-colors cursor-pointer",title:"Open preview in new window",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})})})]}),e.jsx("div",{ref:l,className:"flex-1 flex items-center justify-center overflow-hidden p-8",style:he?{backgroundColor:"#f5f0e8",backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 19px, #e8e0d0 19px, #e8e0d0 20px), repeating-linear-gradient(90deg, transparent, transparent 19px, #e8e0d0 19px, #e8e0d0 20px)"}:{backgroundImage:`
|
|
6
|
-
linear-gradient(45deg, #333 25%, transparent 25%),
|
|
7
|
-
linear-gradient(-45deg, #333 25%, transparent 25%),
|
|
8
|
-
linear-gradient(45deg, transparent 75%, #333 75%),
|
|
9
|
-
linear-gradient(-45deg, transparent 75%, #333 75%)
|
|
10
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#2d2d2d"},children:he?e.jsx(gs,{preview:he,onDismiss:()=>G(null),onLoadCommit:ct}):ae?e.jsx("div",{style:{width:`${U.width*X}px`,height:`${(U.height??900)*X}px`},children:e.jsxs("div",{className:"relative bg-white origin-top-left",style:{width:`${U.width}px`,height:`${U.height??900}px`,transform:X<1?`scale(${X})`:void 0},children:[!g&&!Je&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-[#2a2a2a] rounded-lg p-8 w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(Ke,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-gray-200 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Loading Preview"}),e.jsx("p",{className:"text-sm text-gray-400 leading-5 m-0 font-['IBM_Plex_Sans']",children:"Waiting for the app to render"})]})]})}),Je&&e.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center",style:{backgroundColor:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(1px)",transition:"opacity 200ms ease-out"},children:e.jsxs("div",{className:"flex flex-col items-center gap-3 animate-pulse",children:[e.jsx("svg",{className:"w-6 h-6 text-white/80 animate-spin",viewBox:"0 0 24 24",fill:"none",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"50 100"})}),e.jsx("span",{className:"text-white/70 text-xs font-['IBM_Plex_Sans']",children:"Switching scenario"})]})}),e.jsx("iframe",{ref:f,src:Ye||ae,className:"w-full h-full border-none",title:"Editor preview",onLoad:kt,style:{opacity:g?1:0}},Ne)]})}):e.jsx("div",{className:"bg-[#2a2a2a] rounded-lg flex flex-col items-center justify-center",style:{width:`${U.width*X}px`,height:`${(U.height??900)*X}px`},children:q?e.jsxs("div",{className:"flex flex-col gap-4 text-center px-8 max-w-[600px]",children:[e.jsx("h2",{className:"text-xl font-medium text-red-400 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Dev Server Failed"}),e.jsx("pre",{className:"text-xs text-left bg-[#1e1e1e] text-gray-300 p-4 rounded overflow-auto max-h-[300px] w-full font-mono whitespace-pre-wrap",children:q}),e.jsx("button",{onClick:le,className:"mx-auto px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded hover:bg-[#004d63] transition-colors cursor-pointer",children:"Retry"})]}):Z||ue?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(Ke,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-gray-200 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:ue?"Starting Interactive Mode":"Starting Dev Server"}),e.jsx("p",{className:"text-sm text-gray-400 leading-5 m-0 font-['IBM_Plex_Sans']",children:ue?"Loading component preview...":"Your dev server is starting up..."})]})]}):e.jsxs("div",{className:"flex flex-col gap-3 text-center px-8",children:[e.jsx("h2",{className:"text-xl font-medium text-gray-200 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Live Preview"}),e.jsx("p",{className:"text-sm text-gray-500 leading-5 m-0 font-['IBM_Plex_Sans']",children:"Describe what you want to build in the Build tab"})]})})})]}),e.jsxs("aside",{className:`bg-[#1e1e1e] border-r border-[#3d3d3d] shrink-0 flex flex-col overflow-hidden order-first ${ee==="editor-only"?"w-full max-w-none min-w-0":"w-[50%] min-w-[400px] max-w-[800px]"}`,style:ee==="preview-only"?{display:"none"}:void 0,children:[e.jsx(fs,{activeTab:W,onTabChange:r=>{fe(r),r==="build"&&ge(!0)},buildIdle:Oe,zoomComponent:j,breadcrumbItems:Ve,onBreadcrumbNavigate:Ce,panelLayout:ee,onToggleExpand:()=>Ue(r=>r==="editor-only"?"split":"editor-only")}),e.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[mt&&e.jsxs("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:W==="build"?"visible":"hidden"},children:[e.jsx("div",{className:ve?"flex-1 min-h-0":"flex-1",style:ve?{flex:"1 1 50%"}:void 0,children:e.jsx(Wt,{ref:_,entityName:"Editor",projectSlug:s,entityFilePath:null,scenarioName:null,onRefreshPreview:jt,onShowResults:ut,onHideResults:Fe,onSetViewport:ht,editorMode:!0,onIdleChange:pt,notificationSettings:We})}),ve&&e.jsx("div",{style:{flex:"1 1 50%"},className:"min-h-0 border-t-2 border-gray-300",children:e.jsx(us,{scenarios:h,allScenarios:d,glossaryFunctions:x,projectRoot:a,activeScenarioId:m,onScenarioSelect:se,onClose:Fe,entityChangeStatus:N,modifiedFiles:w,featureName:E,userPrompt:v})})]}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:W==="app"?"visible":"hidden"},children:e.jsx(xs,{hasProject:i,scenarios:d,analyzedEntities:c,glossaryFunctions:x,glossaryEntries:u,projectRoot:a,activeScenarioId:m,onScenarioSelect:se,onAnalyzedScenarioSelect:Be,onSwitchToBuild:xt,zoomComponent:j,onZoomChange:Ce,entityImports:k,pageFilePaths:S,projectTitle:D,projectDescription:O,breadcrumbItems:Ve})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:W==="data"?"visible":"hidden"},children:e.jsx(Kt,{scenarios:d,projectRoot:a,activeScenarioId:m,onScenarioSelect:se,zoomComponent:j,onZoomChange:Ce,analyzedEntities:[],glossaryFunctions:x,activeAnalyzedScenarioId:L==null?void 0:L.scenarioId,onAnalyzedScenarioSelect:Be,entityImports:k,pageFilePaths:S})}),e.jsx("div",{className:"absolute inset-0 flex flex-col overflow-hidden",style:{visibility:W==="journal"?"visible":"hidden"},children:e.jsx(os,{isActive:W==="journal",onScreenshotClick:Nt,glossaryFunctions:x})})]}),e.jsx(Ht,{serverUrl:F,isStarting:Z,projectSlug:s,devServerError:q,onStartServer:ie?me:void 0,notificationSettings:We,onChangeNotificationSettings:ft})]})]})]})})});export{As as default,Bs as meta};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/addon-web-links-Duc5hnl7.js","assets/chunk-JZWAC4HX-C4pqxYJB.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as u,j as a}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{_ as B}from"./preload-helper-ckwbz45p.js";const C={sound:"soft-double-tap",systemNotification:!0},ce=[{id:"soft-double-tap",label:"Soft double tap"},{id:"gentle-chime",label:"Gentle chime"},{id:"warm-ding",label:"Warm ding"},{id:"mellow-two-tone",label:"Mellow two-tone"},{id:"triangle-bell",label:"Triangle bell"},{id:"off",label:"No sound"}],F="codeyam-editor-notifications";function pe(){try{const r=localStorage.getItem(F);if(!r)return C;const n=JSON.parse(r);return typeof n=="string"?n==="true"?C:{...C,sound:"off",systemNotification:!1}:{...C,...n}}catch{return C}}function xe(r){localStorage.setItem(F,JSON.stringify(r))}function ee(r){var n;if(r!=="off")try{const c=new AudioContext,s={"soft-double-tap":e=>{[0,.12].forEach(t=>{const o=e.createOscillator(),y=e.createGain();o.connect(y),y.connect(e.destination),o.type="sine",o.frequency.value=392,y.gain.setValueAtTime(.25,e.currentTime+t),y.gain.exponentialRampToValueAtTime(.01,e.currentTime+t+.1),o.start(e.currentTime+t),o.stop(e.currentTime+t+.1)})},"gentle-chime":e=>{const t=e.createOscillator(),o=e.createGain();t.connect(o),o.connect(e.destination),t.type="sine",t.frequency.setValueAtTime(523,e.currentTime),t.frequency.setValueAtTime(659,e.currentTime+.15),o.gain.setValueAtTime(.3,e.currentTime),o.gain.exponentialRampToValueAtTime(.01,e.currentTime+.4),t.start(),t.stop(e.currentTime+.4)},"warm-ding":e=>{const t=e.createOscillator(),o=e.createGain();t.connect(o),o.connect(e.destination),t.type="sine",t.frequency.value=330,o.gain.setValueAtTime(.35,e.currentTime),o.gain.exponentialRampToValueAtTime(.01,e.currentTime+.6),t.start(),t.stop(e.currentTime+.6)},"mellow-two-tone":e=>{const t=e.createOscillator(),o=e.createGain();t.connect(o),o.connect(e.destination),t.type="sine",t.frequency.setValueAtTime(294,e.currentTime),t.frequency.setValueAtTime(440,e.currentTime+.18),o.gain.setValueAtTime(.3,e.currentTime),o.gain.exponentialRampToValueAtTime(.01,e.currentTime+.5),t.start(),t.stop(e.currentTime+.5)},"triangle-bell":e=>{const t=e.createOscillator(),o=e.createGain();t.connect(o),o.connect(e.destination),t.type="triangle",t.frequency.value=523,o.gain.setValueAtTime(.4,e.currentTime),o.gain.exponentialRampToValueAtTime(.01,e.currentTime+.8),t.start(),t.stop(e.currentTime+.8)}};(n=s[r])==null||n.call(s,c)}catch{}}function he({serverUrl:r,isStarting:n,projectSlug:c,devServerError:s,onStartServer:e,notificationSettings:t,onChangeNotificationSettings:o}){const[y,A]=u.useState(null),[f,w]=u.useState(!1),E=u.useRef(null),_=u.useRef(null);u.useEffect(()=>{if(!c)return;const p=new EventSource("/api/dev-mode-events");return p.onmessage=v=>{try{const R=JSON.parse(v.data);R.type==="file-synced"&&(A(R.fileName),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{A(null)},5e3))}catch{}},()=>{p.close(),_.current&&clearTimeout(_.current)}},[c]),u.useEffect(()=>{if(!f)return;function p(v){E.current&&!E.current.contains(v.target)&&w(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[f]);let N;s?N="error":n?N="starting":r?N="running":N="stopped";const V={starting:"bg-yellow-400",running:"bg-green-400",stopped:"bg-gray-400",error:"bg-red-400"},k={starting:"Starting...",running:r||"Running",stopped:"Stopped",error:"Error"},P=t&&(t.sound!=="off"||t.systemNotification);return a.jsxs("div",{className:"bg-[#1e1e1e] border-t border-[#3d3d3d] h-7 flex items-center px-4 gap-4 shrink-0 text-xs font-mono",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${V[N]}`}),a.jsxs("span",{className:"text-gray-400",children:["Server:"," ",a.jsx("span",{className:"text-gray-300",children:k[N]})]}),(N==="stopped"||N==="error")&&e&&a.jsx("button",{onClick:e,className:"ml-1 px-2.5 py-0.5 bg-[#005c75] hover:bg-[#007a9a] text-white text-[11px] font-medium rounded transition-colors cursor-pointer border-none leading-tight",children:"Start Server"})]}),a.jsx("div",{className:"w-px h-3 bg-[#3d3d3d]"}),y&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4ade80",strokeWidth:"2",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}),a.jsxs("span",{className:"text-green-400",children:["Synced: ",y]})]}),a.jsx("div",{className:"w-px h-3 bg-[#3d3d3d]"})]}),a.jsx("div",{className:"flex-1"}),o&&t&&a.jsxs("div",{className:"relative",ref:E,children:[a.jsx("button",{onClick:()=>w(!f),className:`text-[11px] rounded transition-colors cursor-pointer ${P?"text-green-400 hover:text-green-300":"text-gray-500 hover:text-gray-300"}`,children:P?"Notifications On":"Notifications Off"}),f&&a.jsxs("div",{className:"absolute bottom-full right-0 mb-2 w-56 bg-[#2d2d2d] border border-[#4d4d4d] rounded-lg shadow-xl p-3 flex flex-col gap-3 z-50",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[11px] text-gray-400 mb-1.5",children:"Notification sound"}),a.jsx("div",{className:"flex flex-col gap-0.5",children:ce.map(p=>a.jsx("button",{onClick:()=>{o({...t,sound:p.id}),p.id!=="off"&&ee(p.id)},className:`text-left text-[11px] px-2 py-1 rounded cursor-pointer transition-colors ${t.sound===p.id?"bg-[#444] text-white":"text-gray-300 hover:bg-[#3a3a3a]"}`,children:p.label},p.id))})]}),a.jsxs("div",{className:"border-t border-[#4d4d4d] pt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:t.systemNotification,onChange:p=>{const v=p.target.checked;o({...t,systemNotification:v}),v&&typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},className:"accent-green-500"}),a.jsx("span",{className:"text-[11px] text-gray-300",children:"System notification"})]}),a.jsx("div",{className:"text-[10px] text-gray-500 mt-1 ml-5",children:"Shows when tab is not visible"})]})]})]})]})}async function ae(r,n){try{const{WebglAddon:s}=await B(async()=>{const{WebglAddon:t}=await import("./addon-webgl-DI8QOUvO.js").then(o=>o.a);return{WebglAddon:t}},[]),e=new s;return e.onContextLoss(()=>{n==null||n("webgl","canvas",new Error("WebGL context lost")),e.dispose(),Q(r).then(t=>{t||n==null||n("canvas","dom",new Error("Canvas fallback failed after context loss"))})}),r.loadAddon(e),{type:"webgl",dispose:()=>e.dispose()}}catch(s){n==null||n("webgl","canvas",s)}const c=await Q(r);return c||(n==null||n("canvas","dom",new Error("Canvas addon failed")),{type:"dom",dispose:()=>{}})}async function Q(r){try{const{CanvasAddon:n}=await B(async()=>{const{CanvasAddon:s}=await import("./addon-canvas-DpzMmAy5.js").then(e=>e.a);return{CanvasAddon:s}},[]),c=new n;return r.loadAddon(c),{type:"canvas",dispose:()=>c.dispose()}}catch{return null}}const le=`
|
|
3
|
-
.xterm { cursor: text; position: relative; user-select: none; -ms-user-select: none; -webkit-user-select: none; }
|
|
4
|
-
.xterm.focus, .xterm:focus { outline: none; }
|
|
5
|
-
.xterm .xterm-helpers { position: absolute; top: 0; z-index: 5; }
|
|
6
|
-
.xterm .xterm-helper-textarea { padding: 0; border: 0; margin: 0; position: absolute; opacity: 0; left: -9999em; top: 0; width: 0; height: 0; z-index: -5; white-space: nowrap; overflow: hidden; resize: none; }
|
|
7
|
-
.xterm .composition-view { background: #000; color: #FFF; display: none; position: absolute; white-space: nowrap; z-index: 1; }
|
|
8
|
-
.xterm .composition-view.active { display: block; }
|
|
9
|
-
.xterm .xterm-viewport { background-color: #000; overflow-y: scroll; cursor: default; position: absolute; right: 0; left: 0; top: 0; bottom: 0; }
|
|
10
|
-
.xterm .xterm-screen { position: relative; }
|
|
11
|
-
.xterm .xterm-screen canvas { position: absolute; left: 0; top: 0; }
|
|
12
|
-
.xterm .xterm-scroll-area { visibility: hidden; }
|
|
13
|
-
.xterm-char-measure-element { display: inline-block; visibility: hidden; position: absolute; top: 0; left: -9999em; line-height: normal; }
|
|
14
|
-
.xterm.enable-mouse-events { cursor: default; }
|
|
15
|
-
.xterm.xterm-cursor-pointer, .xterm .xterm-cursor-pointer { cursor: pointer; }
|
|
16
|
-
.xterm.column-select.focus { cursor: crosshair; }
|
|
17
|
-
.xterm .xterm-accessibility:not(.debug), .xterm .xterm-message { position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: 10; color: transparent; pointer-events: none; }
|
|
18
|
-
.xterm .xterm-accessibility-tree:not(.debug) *::selection { color: transparent; }
|
|
19
|
-
.xterm .xterm-accessibility-tree { user-select: text; white-space: pre; }
|
|
20
|
-
.xterm .live-region { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
|
|
21
|
-
.xterm-dim { opacity: 1 !important; }
|
|
22
|
-
.xterm-underline-1 { text-decoration: underline; }
|
|
23
|
-
.xterm-underline-2 { text-decoration: double underline; }
|
|
24
|
-
.xterm-underline-3 { text-decoration: wavy underline; }
|
|
25
|
-
.xterm-underline-4 { text-decoration: dotted underline; }
|
|
26
|
-
.xterm-underline-5 { text-decoration: dashed underline; }
|
|
27
|
-
.xterm-overline { text-decoration: overline; }
|
|
28
|
-
.xterm-strikethrough { text-decoration: line-through; }
|
|
29
|
-
.xterm-screen .xterm-decoration-container .xterm-decoration { z-index: 6; position: absolute; }
|
|
30
|
-
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer { z-index: 7; }
|
|
31
|
-
.xterm-decoration-overview-ruler { z-index: 8; position: absolute; top: 0; right: 0; pointer-events: none; }
|
|
32
|
-
.xterm-decoration-top { z-index: 2; position: relative; }
|
|
33
|
-
`;function ue(){if(document.getElementById("xterm-css"))return;const r=document.createElement("style");r.id="xterm-css",r.textContent=le,document.head.appendChild(r)}const ge=u.forwardRef(function({entityName:n,entityType:c,entitySha:s,entityFilePath:e,scenarioName:t,scenarioDescription:o,analysisId:y,projectSlug:A,onRefreshPreview:f,onShowResults:w,onHideResults:E,onSetViewport:_,editorMode:N,onIdleChange:V,notificationSettings:k},P){const p=u.useRef(null),v=u.useRef(null),R=u.useRef(null),L=u.useRef(null),$=u.useRef(null),I=u.useRef(!1),M=u.useRef(0),G=u.useRef(!1),S=u.useRef(V);S.current=V;const X=u.useRef(k);X.current=k;const O=u.useRef(null);function J(){O.current&&(O.current.close(),O.current=null)}u.useEffect(()=>{function m(){J()}function x(){document.hidden||J()}return window.addEventListener("focus",m),document.addEventListener("visibilitychange",x),()=>{window.removeEventListener("focus",m),document.removeEventListener("visibilitychange",x)}},[]);const te=u.useCallback(()=>{var m;(m=R.current)==null||m.focus()},[]);return u.useImperativeHandle(P,()=>({sendInput(m){const x=L.current;x&&x.readyState===WebSocket.OPEN&&(x.send(JSON.stringify({type:"input",data:m})),setTimeout(()=>{x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({type:"input",data:"\r"}))},100))},focus(){var m;(m=R.current)==null||m.focus()},scrollToBottom(){var x;const m=(x=p.current)==null?void 0:x.querySelector(".xterm-viewport");m&&(m.scrollTop=m.scrollHeight)}})),u.useEffect(()=>{const m=p.current;if(!m)return;let x=!1;return ue(),Promise.all([B(()=>import("./xterm-BqvuqXEL.js"),[]),B(()=>import("./addon-fit-YJmn1quW.js"),[]),B(()=>import("./addon-web-links-Duc5hnl7.js").then(W=>W.a),__vite__mapDeps([0,1]))]).then(([W,re,ne])=>{if(x)return;const l=new W.Terminal({cursorBlink:!0,scrollback:5e3,fontSize:13,fontFamily:"'IBM Plex Mono', 'Menlo', 'Monaco', monospace",theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"},linkHandler:{activate(d,i){try{const h=new URL(i),b=h.searchParams.get("scenario");if(b&&h.pathname==="/editor"){const T=new BroadcastChannel("codeyam-editor");T.postMessage({type:"switch-scenario",scenarioId:b}),T.close();return}}catch{}window.open(i,"_blank")}}}),q=new re.FitAddon;l.loadAddon(q),l.loadAddon(new ne.WebLinksAddon),l.open(m);let D=null;ae(l,(d,i,h)=>{console.warn(`[Terminal] Renderer fallback: ${d} → ${i}`,h)}).then(d=>{if(x){d.dispose();return}console.log(`[Terminal] Using ${d.type} renderer`),D=d.dispose}),requestAnimationFrame(()=>{try{q.fit()}catch{}}),R.current=l,l.focus(),setTimeout(()=>l.focus(),100),setTimeout(()=>l.focus(),500);const oe=window.location.protocol==="https:"?"wss:":"ws:",ie=window.location.host;function se(d){const i=new URLSearchParams;return i.set("entityName",n),c&&i.set("entityType",c),s&&i.set("entitySha",s),e&&i.set("entityFilePath",e),t&&i.set("scenarioName",t),o&&i.set("scenarioDescription",o),y&&i.set("analysisId",y),A&&i.set("projectSlug",A),N&&i.set("editorMode","true"),d&&i.set("reconnectId",d),`${oe}//${ie}/ws/terminal?${i.toString()}`}function H(d){const i=se(d),h=new WebSocket(i);L.current=h,h.onopen=()=>{M.current=0,G.current=!1,h.send(JSON.stringify({type:"resize",cols:l.cols,rows:l.rows}))},h.onmessage=b=>{var T,Y,Z;try{const g=JSON.parse(b.data);if(g.type==="session-id"){$.current=g.sessionId;return}if(g.type==="refresh-preview"){f==null||f(g.path,g.scenarioId);return}if(g.type==="show-results"){w==null||w();return}if(g.type==="hide-results"){E==null||E();return}if(g.type==="set-viewport"){_==null||_({name:g.name,width:g.width,height:g.height});return}if(g.type==="claude-idle"){(T=S.current)==null||T.call(S,!0);const j=X.current;if(j!=null&&j.sound&&j.sound!=="off"&&ee(j.sound),!document.hasFocus()&&(j!=null&&j.systemNotification)&&typeof Notification<"u"&&Notification.permission==="granted"){O.current&&O.current.close();const U=new Notification("Claude is ready for you",{body:"Claude has finished and is waiting for your input.",tag:"claude-idle"});U.onclick=()=>{window.focus(),U.close()},O.current=U}return}if(g.type==="claude-active"){(Y=S.current)==null||Y.call(S,!1),O.current&&(O.current.close(),O.current=null);return}g.type==="output"&&(l.write(g.data),(Z=S.current)==null||Z.call(S,!1))}catch{l.write(b.data)}},h.onclose=()=>{if(I.current){l.write(`\r
|
|
34
|
-
\x1B[90m[Terminal session ended]\x1B[0m\r
|
|
35
|
-
`);return}const b=M.current;if(b<5&&$.current){const T=1e3*Math.pow(2,Math.min(b,3));M.current=b+1,l.write(`\r
|
|
36
|
-
\x1B[33m[Reconnecting...]\x1B[0m\r
|
|
37
|
-
`),setTimeout(()=>{I.current||H($.current)},T)}else G.current?l.write(`\r
|
|
38
|
-
\x1B[90m[Terminal session ended]\x1B[0m\r
|
|
39
|
-
`):(G.current=!0,l.write(`\r
|
|
40
|
-
\x1B[33m[Starting new session...]\x1B[0m\r
|
|
41
|
-
`),$.current=null,M.current=0,H())},h.onerror=()=>{}}H(),l.onData(d=>{const i=L.current;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"input",data:d})),J()});let z=null;const K=new ResizeObserver(()=>{z&&clearTimeout(z),z=setTimeout(()=>{let d;try{d=q.proposeDimensions()}catch{return}if(!d||d.cols===l.cols&&d.rows===l.rows)return;const i=m.querySelector(".xterm-viewport");let h,b=!0;i&&(h=i.scrollTop,b=i.scrollTop+i.clientHeight>=i.scrollHeight-10),q.fit(),i&&h!==void 0&&(b?i.scrollTop=i.scrollHeight:i.scrollTop=h);const T=L.current;T&&T.readyState===WebSocket.OPEN&&T.send(JSON.stringify({type:"resize",cols:l.cols,rows:l.rows}))},150)});K.observe(m),v.current=()=>{var d;z&&clearTimeout(z),K.disconnect(),I.current=!0,(d=L.current)==null||d.close(),L.current=null,D==null||D(),l.dispose(),R.current=null}}),()=>{var W;x=!0,(W=v.current)==null||W.call(v),v.current=null}},[]),a.jsx("div",{ref:p,onClick:te,className:"w-full h-full",style:{padding:"4px 0 0 8px"}})});function de(r){return r.replace(/[^a-zA-Z0-9_]+/g,"_")}function ye(r){const{activeAnalyzedScenario:n,analyzedPreviewUrl:c,activeScenarioId:s,scenarios:e,proxyUrl:t,devServerUrl:o,zoomComponent:y}=r;if(n&&c)return c;if(n&&!c)return null;if(s){const f=e.find(w=>w.id===s);if(f!=null&&f.url){const w=t||o;return w?f.url.startsWith("/")?`${w}${f.url}`:f.url:null}}const A=t||o;if(!A)return null;if(y&&s){const f=e.find(E=>E.id===s),w=f?de(f.name):"Default";return`${A}/__codeyam__/${y}/${w}`}return A}function we(r,n){if(!r||!n)return r;try{const c=new URL(r),s=n.indexOf("?");return s>=0?(c.pathname=n.slice(0,s),c.search=n.slice(s)):(c.pathname=n,c.search=""),c.href}catch{return r}}function ve(r,n){return r?r!==n:!1}function be(r){if(r.length!==0)return r.find(n=>n.type==="application")||r[0]}function Te(r,n,c){if(!r.viewportWidth||!r.viewportHeight)return c??null;const s=n.find(e=>e.width===r.viewportWidth&&e.height===r.viewportHeight);return{name:(s==null?void 0:s.name)||"Custom",width:r.viewportWidth,height:r.viewportHeight}}function Ne(r,n){const c=n.width,s=n.height??900,e=r.width,t=r.height;return c<=e&&s<=t?1:Math.min(e/c,t/s)}export{he as D,ge as T,we as a,de as b,C as c,xe as d,Ne as e,ye as f,be as g,pe as l,Te as r,ve as s};
|