loki-mode 9.53.0 → 9.54.2

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.
Files changed (119) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/completion-council.sh +28 -5
  4. package/autonomy/council-v2.sh +13 -7
  5. package/autonomy/lib/done-recognition.sh +24 -16
  6. package/autonomy/lib/proof-check.sh +11 -3
  7. package/autonomy/lib/proof-generator.py +36 -5
  8. package/autonomy/lib/voter-agents.sh +8 -3
  9. package/autonomy/lib/workspace_diff.py +106 -12
  10. package/autonomy/prd-checklist.sh +19 -11
  11. package/autonomy/run.sh +503 -52
  12. package/dashboard/__init__.py +1 -1
  13. package/dashboard/api_v2.py +4 -0
  14. package/dashboard/audit.py +9 -1
  15. package/dashboard/auth.py +16 -4
  16. package/dashboard/registry.py +34 -12
  17. package/dashboard/rigour_integration.py +25 -17
  18. package/dashboard/server.py +252 -104
  19. package/dashboard/static/cost.html +55 -26
  20. package/dashboard/static/index.html +475 -1544
  21. package/dashboard/static/proofs.html +1 -1
  22. package/docs/INSTALLATION.md +1 -1
  23. package/docs/air-gapped.md +7 -2
  24. package/docs/image-provenance.md +4 -2
  25. package/docs/v10/BACKLOG.md +82 -2
  26. package/docs/v10/BOARD.md +105 -0
  27. package/docs/v10/DECISIONS.md +71 -0
  28. package/docs/v10/METRICS.md +2 -1
  29. package/docs/v10/PROGRESS.md +60 -0
  30. package/docs/v10/SWARM-PROMPT.md +98 -0
  31. package/docs/v10/SWARM.md +237 -0
  32. package/loki-ts/dist/loki.js +323 -322
  33. package/mcp/__init__.py +1 -1
  34. package/package.json +1 -1
  35. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  36. package/providers/aider.sh +8 -0
  37. package/providers/cline.sh +8 -0
  38. package/providers/codex.sh +9 -0
  39. package/providers/opencode.sh +9 -0
  40. package/web-app/dist/assets/AdminPage-CZrBkzRF.js +32 -0
  41. package/web-app/dist/assets/Avatar-gQIp6FBI.js +11 -0
  42. package/web-app/dist/assets/{Badge-BF3mhT57.js → Badge-D2_fBTFY.js} +1 -1
  43. package/web-app/dist/assets/{Button-BDp9aJ9q.js → Button-D5qDd2ef.js} +1 -1
  44. package/web-app/dist/assets/CockpitPage-DVMk2RUK.js +47 -0
  45. package/web-app/dist/assets/ComparePage-NMLyE1xL.js +1 -0
  46. package/web-app/dist/assets/{ErrorBoundary-ut3wrUmu.js → ErrorBoundary-BRABI-BT.js} +1 -1
  47. package/web-app/dist/assets/EvidenceReceiptPanel-D2LNKqUx.js +1 -0
  48. package/web-app/dist/assets/GitHubIssuesPanel-BC5GzKUN.js +7 -0
  49. package/web-app/dist/assets/{GitHubPRsPanel-DurZgSaj.js → GitHubPRsPanel-BSlmoVTS.js} +3 -3
  50. package/web-app/dist/assets/HomePage-D_CDMoen.js +12 -0
  51. package/web-app/dist/assets/{LoginPage-HeRGJeZy.js → LoginPage-BBNA_N9t.js} +1 -1
  52. package/web-app/dist/assets/{MagicPage-CUKrqsZs.js → MagicPage-CnFRZCMx.js} +1 -1
  53. package/web-app/dist/assets/MetricsPage-CPfLMRlh.js +6 -0
  54. package/web-app/dist/assets/{NotFoundPage-BZDZ-B77.js → NotFoundPage-lA0XSGTz.js} +1 -1
  55. package/web-app/dist/assets/ProjectPage-CNAPbr9z.js +256 -0
  56. package/web-app/dist/assets/ProjectsPage-CMtm8goN.js +6 -0
  57. package/web-app/dist/assets/SettingsPage-BhIjVMYE.js +10 -0
  58. package/web-app/dist/assets/{ShowcasePage-BGS2jTGH.js → ShowcasePage-BndtGeYo.js} +1 -1
  59. package/web-app/dist/assets/SystemSettingsPage-euXI-KXE.js +1 -0
  60. package/web-app/dist/assets/TeamsPage-ClUKecun.js +11 -0
  61. package/web-app/dist/assets/TemplatesPage-BWHWVk0L.js +29 -0
  62. package/web-app/dist/assets/{TerminalOutput-togzv9Zl.js → TerminalOutput-Cv3N3Szf.js} +1 -1
  63. package/web-app/dist/assets/{activity-Dreyb_Kr.js → activity-dEhz-bXR.js} +1 -1
  64. package/web-app/dist/assets/{bell-DWH0drES.js → bell-B3XUMq1t.js} +1 -1
  65. package/web-app/dist/assets/{bot-78MoCuDl.js → bot-X-ssNlwR.js} +1 -1
  66. package/web-app/dist/assets/{check-ikfylPst.js → check-C_9Nx7kb.js} +1 -1
  67. package/web-app/dist/assets/{chevron-left-DXUqkd8J.js → chevron-left-tvNswo3A.js} +1 -1
  68. package/web-app/dist/assets/{circle-alert-Da74VO8P.js → circle-alert-CSB88nEs.js} +1 -1
  69. package/web-app/dist/assets/{clock-mlGCFq8l.js → clock-C8p2e4NI.js} +1 -1
  70. package/web-app/dist/assets/{cloud-B_Y5ZrIO.js → cloud-CKp2ZvhG.js} +1 -1
  71. package/web-app/dist/assets/{code-xml-Bbom7YWV.js → code-xml-dY70LCHD.js} +1 -1
  72. package/web-app/dist/assets/{database-CLcofiVp.js → database-DObn5fmn.js} +1 -1
  73. package/web-app/dist/assets/{dollar-sign-C5mkjXIM.js → dollar-sign-DSu6n3K3.js} +1 -1
  74. package/web-app/dist/assets/{file-code-corner-CVrkaOQP.js → file-code-corner-DpCnS73z.js} +1 -1
  75. package/web-app/dist/assets/{file-plus-BV9240gX.js → file-plus-D3IPKCf1.js} +1 -1
  76. package/web-app/dist/assets/{globe-aZ0Zso4I.js → globe-C9QXkgH_.js} +1 -1
  77. package/web-app/dist/assets/{hammer-EgOQNukG.js → hammer-D_FtWe1y.js} +1 -1
  78. package/web-app/dist/assets/index-CI54rara.css +1 -0
  79. package/web-app/dist/assets/{index-DvZ0Kk2x.js → index-Cz7q1bvC.js} +2 -2
  80. package/web-app/dist/assets/{layers-BOVKmepE.js → layers-DsW7jnJX.js} +1 -1
  81. package/web-app/dist/assets/{loader-circle-0K8yLgHl.js → loader-circle-B3HspjKR.js} +1 -1
  82. package/web-app/dist/assets/{lock-XzlDMy8M.js → lock-DSI29pct.js} +1 -1
  83. package/web-app/dist/assets/{package-BtXTKusI.js → package-CLNxtA2x.js} +1 -1
  84. package/web-app/dist/assets/{plus-PxeiD8ju.js → plus-DyI4WC4_.js} +1 -1
  85. package/web-app/dist/assets/{refresh-cw-CjqzYczt.js → refresh-cw-D2dv0xA0.js} +1 -1
  86. package/web-app/dist/assets/{rotate-ccw-CY0os4DH.js → rotate-ccw-CBvihA-a.js} +1 -1
  87. package/web-app/dist/assets/scroll-text-DvoOvAl_.js +6 -0
  88. package/web-app/dist/assets/{server-pIIs9vNp.js → server-DenWvSUt.js} +1 -1
  89. package/web-app/dist/assets/{shield-alert-CsDqKXwA.js → shield-alert-40cX_FvG.js} +1 -1
  90. package/web-app/dist/assets/{thumbs-up-CAh3HVzH.js → thumbs-up-BrjZ6QuV.js} +12 -7
  91. package/web-app/dist/assets/trash-2-C6evwkEH.js +16 -0
  92. package/web-app/dist/assets/{trending-down-DrtBd_C9.js → trending-down-CfbZis3O.js} +1 -1
  93. package/web-app/dist/assets/{trending-up-D-DbCHXm.js → trending-up-DWuEK3WC.js} +1 -1
  94. package/web-app/dist/assets/{upload-D4l6DCOt.js → upload-B9DFBcPG.js} +1 -1
  95. package/web-app/dist/assets/{usePolling-D0aoTX80.js → usePolling-BryVC-T1.js} +1 -1
  96. package/web-app/dist/assets/{user-BQf_XJO_.js → user-DMRXwZiw.js} +1 -1
  97. package/web-app/dist/index.html +2 -2
  98. package/web-app/server.py +122 -47
  99. package/web-app/dist/assets/AdminPage-y6_b2Xo4.js +0 -32
  100. package/web-app/dist/assets/Avatar-BFPkXhIJ.js +0 -6
  101. package/web-app/dist/assets/CockpitPage-5TKICCoA.js +0 -47
  102. package/web-app/dist/assets/ComparePage-BSuNsUHy.js +0 -1
  103. package/web-app/dist/assets/EvidenceReceiptPanel-CcaBwEI-.js +0 -1
  104. package/web-app/dist/assets/GitHubIssuesPanel-DJeYgzAa.js +0 -12
  105. package/web-app/dist/assets/HomePage-Bs451LAy.js +0 -28
  106. package/web-app/dist/assets/MetricsPage-DvY1csgz.js +0 -6
  107. package/web-app/dist/assets/ProjectPage-CqHkEZkl.js +0 -257
  108. package/web-app/dist/assets/ProjectsPage-CLvCK1Y8.js +0 -6
  109. package/web-app/dist/assets/SettingsPage-DP7OmdwP.js +0 -10
  110. package/web-app/dist/assets/SystemSettingsPage-P_rlLh0x.js +0 -1
  111. package/web-app/dist/assets/TeamsPage-DxtBDcBC.js +0 -11
  112. package/web-app/dist/assets/TemplatesPage-5e-faH3W.js +0 -29
  113. package/web-app/dist/assets/folder-open-D_6yV78G.js +0 -11
  114. package/web-app/dist/assets/index-BSgmPwC0.css +0 -1
  115. package/web-app/dist/assets/lightbulb-DdASgqOG.js +0 -6
  116. package/web-app/dist/assets/mail-COu670_W.js +0 -6
  117. package/web-app/dist/assets/minus-bQpUt9ff.js +0 -6
  118. package/web-app/dist/assets/save-v8qep5cY.js +0 -6
  119. package/web-app/dist/assets/trash-2-Dt6urTyY.js +0 -6
@@ -1,6 +0,0 @@
1
- import{c as $,j as e,r as u,x as D,h as P,i as R,u as z,a as E,n as L,l as M,E as A,f as _}from"./index-DvZ0Kk2x.js";import{B as C}from"./Button-BDp9aJ9q.js";import{B as U}from"./Badge-BF3mhT57.js";import{L as I}from"./lightbulb-DdASgqOG.js";import{T as O}from"./trending-up-D-DbCHXm.js";import{T as H}from"./trending-down-DrtBd_C9.js";import{M as Y}from"./minus-bQpUt9ff.js";import{u as q}from"./usePolling-D0aoTX80.js";import{R as G}from"./refresh-cw-CjqzYczt.js";import{P as S}from"./plus-PxeiD8ju.js";import{F as K,C as Q}from"./folder-open-D_6yV78G.js";import{T as V}from"./trash-2-Dt6urTyY.js";import"./clock-mlGCFq8l.js";import"./circle-alert-Da74VO8P.js";import"./check-ikfylPst.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const W=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],X=$("ellipsis-vertical",W),J={none:"p-0",sm:"p-3",md:"p-4",lg:"p-6"};function Z({hover:t=!1,padding:r="md",className:n="",children:a,onClick:d}){return e.jsx("div",{role:d?"button":void 0,tabIndex:d?0:void 0,onClick:d,onKeyDown:d?l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),d())}:void 0,className:["bg-white border border-[#ECEAE3] rounded-[5px] shadow-card group",t&&"hover:shadow-card-hover transition-shadow duration-200",d&&"cursor-pointer",J[r],n].filter(Boolean).join(" "),children:a})}const y={"A+":{color:"text-success",bg:"bg-success/10",border:"border-success/20"},A:{color:"text-success",bg:"bg-success/10",border:"border-success/20"},"A-":{color:"text-success",bg:"bg-success/8",border:"border-success/15"},"B+":{color:"text-teal",bg:"bg-teal/10",border:"border-teal/20"},B:{color:"text-teal",bg:"bg-teal/8",border:"border-teal/15"},"B-":{color:"text-info",bg:"bg-info/8",border:"border-info/15"},"C+":{color:"text-warning",bg:"bg-warning/10",border:"border-warning/20"},C:{color:"text-warning",bg:"bg-warning/8",border:"border-warning/15"},"C-":{color:"text-warning",bg:"bg-warning/8",border:"border-warning/15"},D:{color:"text-danger",bg:"bg-danger/10",border:"border-danger/20"},F:{color:"text-danger",bg:"bg-danger/15",border:"border-danger/25"}};function ee(t){const r=[],n=[],a=Math.min(t.testCoverage,100);r.push({label:"Test Coverage",score:a,weight:.3,description:`${Math.round(a)}% of code covered`}),a<60&&n.push(`Add tests to increase coverage from ${Math.round(a)}% to 80%+`);const d=t.lintErrors===0?100:Math.max(0,100-t.lintErrors*5);r.push({label:"Code Quality",score:d,weight:.25,description:t.lintErrors===0?"No lint errors":`${t.lintErrors} lint error${t.lintErrors!==1?"s":""} found`}),t.lintErrors>0&&n.push(`Fix ${t.lintErrors} lint error${t.lintErrors!==1?"s":""} to improve code quality`);const l=Math.round(t.buildSuccessRate*100);r.push({label:"Build Reliability",score:l,weight:.25,description:`${l}% of recent builds succeeded`}),l<80&&n.push("Investigate build failures to improve reliability");const m=Math.max(0,100-t.codeComplexity);r.push({label:"Simplicity",score:m,weight:.2,description:m>=70?"Code is well-structured":"Some files could benefit from refactoring"}),m<50&&n.push("Refactor complex files to reduce cognitive load");const i=Math.round(r.reduce((o,x)=>o+x.score*x.weight,0));let s;if(i>=95?s="A+":i>=90?s="A":i>=85?s="A-":i>=80?s="B+":i>=75?s="B":i>=70?s="B-":i>=65?s="C+":i>=60?s="C":i>=55?s="C-":i>=40?s="D":s="F",n.length===0&&i<95){const o=r.reduce((x,f)=>f.score<x.score?f:x,r[0]);n.push(`Improve ${o.label.toLowerCase()} to reach the next grade`)}return{score:i,grade:s,factors:r,recommendations:n}}function te({history:t}){if(t.length<2)return null;const r=t[t.length-1].score,n=t[t.length-2].score,a=r-n;return a>2?e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-success text-[11px] font-medium",children:[e.jsx(O,{size:11})," +",a]}):a<-2?e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-danger text-[11px] font-medium",children:[e.jsx(H,{size:11})," ",a]}):e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-muted text-[11px]",children:[e.jsx(Y,{size:11})," Stable"]})}function se({history:t}){if(t.length===0)return null;const r=100;return 100/t.length,e.jsx("div",{className:"flex items-end gap-0.5 h-8",children:t.map((n,a)=>{const d=n.score/r*100,l=y[n.grade]||y.C;return e.jsx("div",{className:`flex-1 rounded-t-sm transition-all duration-300 ${l.bg}`,style:{height:`${d}%`,minWidth:"4px"},title:`Build #${n.buildNumber}: ${n.grade} (${n.score})`},a)})})}function re(t){const[r,n]=u.useState(!1),{score:a,grade:d,factors:l,recommendations:m}=ee(t),i=y[d]||y.C,s=t.history||[];return t.badge?e.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-pill border text-xs font-bold ${i.color} ${i.bg} ${i.border}`,children:[e.jsx(D,{size:12}),d]}):e.jsxs("div",{className:"card overflow-hidden",children:[e.jsxs("button",{onClick:()=>n(!r),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-hover/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`flex items-center justify-center w-10 h-10 rounded-lg ${i.bg} ${i.border} border`,children:e.jsx("span",{className:`text-lg font-bold font-mono ${i.color}`,children:d})}),e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Project Health"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-muted font-mono",children:[a,"/100"]}),s.length>=2&&e.jsx(te,{history:s})]})]})]}),e.jsx("span",{className:"text-muted",children:r?e.jsx(P,{size:16}):e.jsx(R,{size:16})})]}),r&&e.jsxs("div",{className:"px-4 pb-4 space-y-4",children:[e.jsx("div",{className:"space-y-3",children:l.map(o=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-medium text-secondary",children:o.label}),e.jsxs("span",{className:`text-xs font-mono font-semibold ${o.score>=80?"text-success":o.score>=60?"text-warning":"text-danger"}`,children:[Math.round(o.score),"%"]})]}),e.jsx("div",{className:"w-full h-1.5 bg-border rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-700 ease-out ${o.score>=80?"bg-success":o.score>=60?"bg-warning":"bg-danger"}`,style:{width:`${Math.min(o.score,100)}%`}})}),e.jsx("p",{className:"text-[11px] text-muted mt-0.5",children:o.description})]},o.label))}),s.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider mb-2",children:"Recent Builds"}),e.jsx(se,{history:s})]}),m.length>0&&e.jsxs("div",{className:"bg-primary/5 border border-primary/10 rounded-card p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(I,{size:12,className:"text-primary"}),e.jsx("span",{className:"text-[11px] font-semibold text-primary uppercase tracking-wider",children:"Recommendations"})]}),e.jsx("ul",{className:"space-y-1",children:m.map((o,x)=>e.jsxs("li",{className:"text-xs text-secondary flex items-start gap-1.5",children:[e.jsx("span",{className:"text-primary mt-0.5 flex-shrink-0",children:"--"}),o]},x))})]})]})]})}function ne({onRefresh:t,threshold:r=80,enabled:n=!0}){const a=u.useRef(null),[d,l]=u.useState(!1),[m,i]=u.useState(!1),[s,o]=u.useState(0),x=u.useRef(0),f=u.useRef(!1),g=u.useCallback(p=>{if(!n||m)return;const h=a.current;h&&h.scrollTop<=0&&(x.current=p.touches[0].clientY,f.current=!0)},[n,m]),b=u.useCallback(p=>{if(!n||!f.current||m)return;const h=p.touches[0].clientY-x.current;if(h>0){const v=Math.min(h*.5,120);o(v),l(!0)}else f.current=!1,l(!1),o(0)},[n,m]),j=u.useCallback(async()=>{if(!(!n||!f.current))if(f.current=!1,s>=r){i(!0),o(0),l(!1);try{await t()}finally{i(!1)}}else o(0),l(!1)},[n,s,r,t]);return u.useEffect(()=>{const p=a.current;if(!(!p||!n))return p.addEventListener("touchstart",g,{passive:!0}),p.addEventListener("touchmove",b,{passive:!0}),p.addEventListener("touchend",j,{passive:!0}),()=>{p.removeEventListener("touchstart",g),p.removeEventListener("touchmove",b),p.removeEventListener("touchend",j)}},[n,g,b,j]),{ref:a,pulling:d,refreshing:m,pullDistance:s}}function le(t){const r=k(t);return r==="completed"?"completed":r==="running"?"running":r==="failed"?"failed":r==="started"?"started":"empty"}const ie={completed:"Completed",complete:"Completed",done:"Completed",completion_promise_fulfilled:"Completed",running:"Running",in_progress:"Running",planning:"Planning",started:"Started",error:"Failed",failed:"Failed",empty:"Empty"};function k(t){return{completion_promise_fulfilled:"completed",complete:"completed",done:"completed",in_progress:"running",planning:"running",error:"failed"}[t]||t}const ae=[{key:"all",label:"All"},{key:"running",label:"Running"},{key:"completed",label:"Completed"},{key:"failed",label:"Failed"}];function Ee(){const t=z(),[r,n]=u.useState(""),[a,d]=u.useState("all"),[l,m]=u.useState(null),[i,s]=u.useState(!1),[o,x]=u.useState(null),f=u.useCallback(()=>E.getSessionsHistory(),[]),{data:g,refresh:b}=q(f,15e3,!0),{ref:j,pulling:p,refreshing:h,pullDistance:v}=ne({onRefresh:async()=>{b()},enabled:!0}),w=u.useMemo(()=>{if(!g)return[];let c=g;if(a!=="all"&&(c=c.filter(N=>N.status===a)),r.trim()){const N=r.trim().toLowerCase();c=c.filter(T=>T.prd_snippet.toLowerCase().includes(N))}return c},[g,a,r]),B=c=>{navigator.clipboard.writeText(c),x("Path copied"),setTimeout(()=>x(null),2e3)},F=async()=>{if(l){s(!0);try{await E.deleteSession(l.id),m(null),x("Project deleted"),setTimeout(()=>x(null),3e3),b()}catch(c){x(`Delete failed: ${c instanceof Error?c.message:"Unknown error"}`),setTimeout(()=>x(null),5e3)}finally{s(!1)}}};return e.jsxs("div",{ref:j,className:"max-w-[1400px] mx-auto px-6 max-md:px-4 py-8 overflow-auto h-full",children:[(p||h)&&e.jsx("div",{className:"flex items-center justify-center py-3",children:h?e.jsx("div",{className:"ptr-spinner"}):e.jsx(G,{size:20,className:"text-[#553DE9] transition-transform",style:{transform:`rotate(${Math.min(v*3,360)}deg)`,opacity:Math.min(v/80,1)}})}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h1",{className:"font-heading text-h1 max-md:text-h2 text-[#36342E]",children:"Projects"}),e.jsx(C,{icon:S,onClick:()=>t("/"),children:"New Project"})]}),e.jsxs("div",{className:"flex items-center max-md:flex-col gap-4 max-md:gap-3 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(L,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#6B6960]"}),e.jsx("input",{type:"text",placeholder:"Search projects...","aria-label":"Search projects",value:r,onChange:c=>n(c.target.value),className:"w-full pl-9 pr-3 py-2 text-sm border border-[#ECEAE3] rounded-[5px] bg-white text-[#36342E] placeholder:text-[#939084] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/20 focus:border-[#553DE9]"})]}),e.jsx("div",{className:"flex items-center gap-1",role:"tablist",children:ae.map(c=>e.jsx("button",{role:"tab","aria-selected":a===c.key,onClick:()=>d(c.key),className:`px-3 py-1.5 text-xs font-semibold rounded-[3px] transition-colors ${a===c.key?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:c.label},c.key))})]}),w.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx("p",{className:"text-[#6B6960] text-sm mb-4",children:"No projects yet. Start building."}),e.jsx(C,{icon:S,onClick:()=>t("/"),children:"New Project"})]}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:w.map(c=>e.jsx(oe,{session:c,onOpen:()=>t(`/project/${c.id}`),onDelete:()=>m(c),onCopyPath:()=>B(c.path)},c.id))}),l&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6",children:[e.jsxs("h2",{className:"text-base font-semibold text-[#36342E] mb-2",children:["Delete ",l.prd_snippet||"Untitled project","?"]}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"This will remove all files, dependencies, and state. This cannot be undone."}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>m(null),disabled:i,className:"px-4 py-2 text-sm font-medium text-[#6B6960] hover:text-[#36342E] rounded-[5px] hover:bg-[#F8F4F0] transition-colors disabled:opacity-50",children:"Cancel"}),e.jsx("button",{onClick:F,disabled:i,className:"px-4 py-2 text-sm font-medium text-white bg-red-600 hover:bg-red-700 rounded-[5px] transition-colors disabled:opacity-50",children:i?"Deleting...":"Delete"})]})]})}),o&&e.jsxs("div",{className:"fixed bottom-6 right-6 z-50 px-4 py-3 bg-[#36342E] text-white text-sm rounded-[5px] shadow-lg flex items-center gap-2",children:[o,e.jsx("button",{onClick:()=>x(null),className:"text-white/60 hover:text-white",children:e.jsx(M,{size:14})})]})]})}function oe({session:t,onOpen:r,onDelete:n,onCopyPath:a}){const[d,l]=u.useState(!1),m=u.useRef(null);u.useEffect(()=>{if(!d)return;const s=o=>{m.current&&!m.current.contains(o.target)&&l(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[d]);const i=new Date(t.date).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});return e.jsxs(Z,{hover:!0,onClick:r,className:"relative",children:[e.jsxs("div",{className:"absolute top-2.5 right-2.5 z-10",ref:m,children:[e.jsx("button",{onClick:s=>{s.stopPropagation(),l(!d)},"aria-label":"Project options",className:"p-1 rounded-[3px] text-[#B8B5AD] hover:text-[#36342E] hover:bg-[#F8F4F0] transition-colors",children:e.jsx(X,{size:16})}),d&&e.jsxs("div",{className:"absolute right-0 top-8 w-44 bg-white border border-[#ECEAE3] rounded-[5px] shadow-lg py-1 z-20",children:[e.jsxs("button",{onClick:s=>{s.stopPropagation(),l(!1),r()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-[#36342E] hover:bg-[#F8F4F0] transition-colors text-left",children:[e.jsx(K,{size:14,className:"text-[#6B6960]"}),"Open project"]}),e.jsxs("button",{onClick:s=>{s.stopPropagation(),l(!1),window.open(`${_}/project/${t.id}`,"_blank")},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-[#36342E] hover:bg-[#F8F4F0] transition-colors text-left",children:[e.jsx(A,{size:14,className:"text-[#6B6960]"}),"Open in new tab"]}),e.jsxs("button",{onClick:s=>{s.stopPropagation(),l(!1),a()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-[#36342E] hover:bg-[#F8F4F0] transition-colors text-left",children:[e.jsx(Q,{size:14,className:"text-[#6B6960]"}),"Copy path"]}),e.jsx("div",{className:"border-t border-[#ECEAE3] my-1"}),e.jsxs("button",{onClick:s=>{s.stopPropagation(),l(!1),n()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-red-600 hover:bg-red-50 transition-colors text-left",children:[e.jsx(V,{size:14}),"Delete project"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2 pr-6",children:[e.jsx("span",{className:"text-xs text-[#6B6960]",children:i}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(re,{testCoverage:72,lintErrors:0,buildSuccessRate:k(t.status)==="completed"?1:.8,codeComplexity:25,badge:!0}),e.jsx(U,{status:le(t.status),children:ie[t.status]||t.status})]})]}),e.jsx("h3",{className:"text-sm font-medium text-[#36342E] line-clamp-2 mb-2",children:t.prd_snippet||"Untitled project"}),e.jsx("p",{className:"text-xs text-[#6B6960] truncate",children:t.path})]})}export{Ee as default};
@@ -1,10 +0,0 @@
1
- import{c as tt,j as e,r as t,y as fe,a as se,z as st,$ as at,K as nt,I as ot,n as it,E as lt}from"./index-DvZ0Kk2x.js";import{E as rt,R as ct}from"./rotate-ccw-CY0os4DH.js";import{H as dt}from"./hammer-EgOQNukG.js";import{C as ut}from"./cloud-B_Y5ZrIO.js";import{L as xt}from"./loader-circle-0K8yLgHl.js";import{C as mt}from"./check-ikfylPst.js";import{C as pt}from"./circle-alert-Da74VO8P.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ft=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ht=tt("code",ft);function j({label:n,description:r,value:l,onChange:f,disabled:x=!1}){const b=`toggle-${n.replace(/\s+/g,"-").toLowerCase()}`;return e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsxs("div",{className:"flex-1 mr-4",children:[e.jsx("label",{htmlFor:b,className:"text-sm font-medium text-[#36342E] cursor-pointer",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsx("button",{id:b,type:"button",role:"switch","aria-checked":l,"aria-label":n,disabled:x,onClick:()=>f(!l),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#553DE9]",l?"bg-[#553DE9]":"bg-[#ECEAE3]",x?"opacity-50 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" "),children:e.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transform transition-transform duration-200",l?"translate-x-5":"translate-x-0"].join(" ")})})]})}function p({label:n,description:r,options:l,value:f,onChange:x,disabled:b=!1}){const g=`select-${n.replace(/\s+/g,"-").toLowerCase()}`;return e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsxs("div",{className:"flex-1 mr-4",children:[e.jsx("label",{htmlFor:g,className:"text-sm font-medium text-[#36342E]",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsx("select",{id:g,value:f,onChange:m=>x(m.target.value),disabled:b,"aria-label":n,className:["px-3 py-1.5 text-sm border border-[#ECEAE3] rounded-lg bg-white text-[#36342E] focus:border-[#553DE9] focus:outline-none focus:ring-1 focus:ring-[#553DE9] min-w-[140px]",b?"opacity-50 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" "),children:l.map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))})]})}function ue({label:n,description:r,min:l,max:f,value:x,onChange:b,step:g=1,unit:m="",disabled:E=!1}){const S=`slider-${n.replace(/\s+/g,"-").toLowerCase()}`,y=(x-l)/(f-l)*100;return e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:S,className:"text-sm font-medium text-[#36342E]",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsxs("span",{className:"text-sm font-mono text-[#553DE9] min-w-[48px] text-right",children:[x,m]})]}),e.jsx("input",{id:S,type:"range",min:l,max:f,step:g,value:x,onChange:A=>b(Number(A.target.value)),disabled:E,"aria-label":n,"aria-valuemin":l,"aria-valuemax":f,"aria-valuenow":x,className:"w-full h-2 rounded-full appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{background:`linear-gradient(to right, #553DE9 0%, #553DE9 ${y}%, #ECEAE3 ${y}%, #ECEAE3 100%)`}}),e.jsxs("div",{className:"flex justify-between mt-1",children:[e.jsxs("span",{className:"text-[11px] text-[#939084]",children:[l,m]}),e.jsxs("span",{className:"text-[11px] text-[#939084]",children:[f,m]})]})]})}function ae({label:n,description:r,type:l="text",value:f,onChange:x,placeholder:b,disabled:g=!1}){const m=`input-${n.replace(/\s+/g,"-").toLowerCase()}`,[E,S]=t.useState(!1),y=l==="password",A=y&&E?"text":l;return e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"mb-1.5",children:[e.jsx("label",{htmlFor:m,className:"text-sm font-medium text-[#36342E]",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:m,type:A,value:f,onChange:C=>x(C.target.value),placeholder:b,disabled:g,"aria-label":n,className:["w-full px-3 py-2 text-sm border border-[#ECEAE3] rounded-lg bg-white text-[#36342E] focus:border-[#553DE9] focus:outline-none focus:ring-1 focus:ring-[#553DE9] placeholder:text-[#939084]",y&&"pr-10",g?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" ")}),y&&e.jsx("button",{type:"button",onClick:()=>S(!E),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-[#939084] hover:text-[#36342E] transition-colors","aria-label":E?"Hide password":"Show password",children:E?e.jsx(rt,{size:16}):e.jsx(fe,{size:16})})]})]})}function bt({label:n,className:r=""}){return n?e.jsxs("div",{className:`flex items-center gap-3 ${r}`,children:[e.jsx("span",{className:"flex-1 border-t border-[#ECEAE3] dark:border-[#2A2A30]"}),e.jsx("span",{className:"text-xs text-muted font-medium",children:n}),e.jsx("span",{className:"flex-1 border-t border-[#ECEAE3] dark:border-[#2A2A30]"})]}):e.jsx("hr",{className:`border-t border-[#ECEAE3] dark:border-[#2A2A30] ${r}`})}const he="pl_settings_";function o(n,r){try{const l=localStorage.getItem(`${he}${n}`);return l===null?r:JSON.parse(l)}catch{return r}}function i(n,r){try{localStorage.setItem(`${he}${n}`,JSON.stringify(r))}catch{}}const xe=[{id:"general",label:"General",icon:st},{id:"appearance",label:"Appearance",icon:at},{id:"editor",label:"Editor",icon:ht},{id:"build",label:"Build",icon:dt},{id:"providers",label:"Providers",icon:ut},{id:"shortcuts",label:"Keyboard Shortcuts",icon:nt},{id:"accessibility",label:"Accessibility",icon:fe},{id:"about",label:"About",icon:ot}],me=[{id:"claude",name:"Claude",description:"Anthropic Claude Code -- full features (Opus 4.7 default, 1M context)",models:["claude-opus-4-7","claude-sonnet-4-6","claude-haiku-4-5-20251001"],defaultModel:"claude-opus-4-7"},{id:"codex",name:"Codex",description:"OpenAI Codex CLI -- degraded mode",models:["gpt-5.3-codex","o3","o4-mini"],defaultModel:"gpt-5.3-codex"},{id:"gemini",name:"Gemini",description:"Google Gemini CLI -- degraded mode",models:["gemini-3-pro-medium","gemini-2.5-flash","gemini-2.5-pro"],defaultModel:"gemini-3-pro-medium"},{id:"cline",name:"Cline",description:"VS Code extension -- sequential mode",models:["claude-opus-4-7","claude-sonnet-4-6","gpt-4.1"],defaultModel:"claude-opus-4-7"},{id:"aider",name:"Aider",description:"Terminal-based pair programming",models:["claude-opus-4-7","claude-sonnet-4-6","gpt-4.1","ollama_chat/deepseek-coder"],defaultModel:"claude-opus-4-7"}],gt=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),v=gt?"Cmd":"Ctrl",pe=[{action:"Save file",keys:`${v}+S`,category:"File"},{action:"Quick open file",keys:`${v}+P`,category:"File"},{action:"Command palette",keys:`${v}+K`,category:"Navigation"},{action:"Toggle terminal",keys:`${v}+\``,category:"Navigation"},{action:"Start / stop build",keys:`${v}+B`,category:"Build"},{action:"Show keyboard shortcuts",keys:`${v}+?`,category:"Help"},{action:"Close modals",keys:"Escape",category:"Navigation"},{action:"Focus search",keys:`${v}+F`,category:"Navigation"},{action:"Toggle sidebar",keys:`${v}+\\`,category:"Navigation"},{action:"New project",keys:`${v}+N`,category:"File"},{action:"Go to settings",keys:`${v}+,`,category:"Navigation"}];function d({children:n}){return e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-[#939084] mb-3 mt-6 first:mt-0",children:n})}function h(){return e.jsx(bt,{className:"my-1"})}function wt(){var de;const[n,r]=t.useState("general"),[l,f]=t.useState(()=>o("projectDir","~/projects")),[x,b]=t.useState(()=>o("autoSave",!0)),[g,m]=t.useState(()=>o("autoSaveInterval","15")),[E,S]=t.useState(()=>o("language","en")),[y,A]=t.useState(()=>o("telemetry",!1)),[C,be]=t.useState(()=>{const a=localStorage.getItem("pl_theme");return a==="light"||a==="dark"?a:"system"}),[M,ge]=t.useState(()=>o("accentColor","purple")),[B,je]=t.useState(()=>o("fontSize","medium")),[T,ve]=t.useState(()=>o("sidebarPosition","left")),[H,Ee]=t.useState(()=>o("compactMode",!1)),[G,ye]=t.useState(()=>o("animationLevel","full")),[I,Ce]=t.useState(()=>o("editorFont","JetBrains Mono")),[$,Ne]=t.useState(()=>o("editorFontSize",14)),[O,Se]=t.useState(()=>o("tabSize","2")),[_,we]=t.useState(()=>o("wordWrap",!0)),[V,Ae]=t.useState(()=>o("lineNumbers",!0)),[K,ke]=t.useState(()=>o("minimap",!0)),[W,Fe]=t.useState(()=>o("bracketMatching",!0)),[q,Pe]=t.useState(()=>o("defaultProvider","claude")),[U,De]=t.useState(()=>o("maxIterations",25)),[J,Le]=t.useState(()=>o("qualityStrictness","standard")),[Q,Me]=t.useState(()=>o("autoDeploy",!1)),[X,Be]=t.useState(()=>o("budgetLimit","")),[Y,Ie]=t.useState(()=>o("buildNotifications",!0)),[Z,$e]=t.useState(()=>o("providerKeys",{})),[ee,ze]=t.useState(()=>o("providerModels",{})),[z,Re]=t.useState(()=>o("providerPriority",["claude","codex","gemini","cline","aider"])),[ne,oe]=t.useState(null),[ie,R]=t.useState({}),[k,Te]=t.useState(()=>o("highContrast",!1)),[F,He]=t.useState(()=>o("focusIndicator","default")),[w,Ge]=t.useState(()=>o("motionPref","full")),[te,Oe]=t.useState(()=>o("screenReaderAnnouncements",!0)),[P,_e]=t.useState(()=>o("fontScaling","100")),[le,Ve]=t.useState(""),[D,re]=t.useState("");t.useEffect(()=>{i("projectDir",l)},[l]),t.useEffect(()=>{i("autoSave",x)},[x]),t.useEffect(()=>{i("autoSaveInterval",g)},[g]),t.useEffect(()=>{i("language",E)},[E]),t.useEffect(()=>{i("telemetry",y)},[y]),t.useEffect(()=>{if(C==="system"){const a=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle("dark",a),localStorage.removeItem("pl_theme")}else document.documentElement.classList.toggle("dark",C==="dark"),localStorage.setItem("pl_theme",C)},[C]),t.useEffect(()=>{i("accentColor",M)},[M]),t.useEffect(()=>{i("fontSize",B)},[B]),t.useEffect(()=>{i("sidebarPosition",T)},[T]),t.useEffect(()=>{i("compactMode",H)},[H]),t.useEffect(()=>{i("animationLevel",G)},[G]),t.useEffect(()=>{i("editorFont",I)},[I]),t.useEffect(()=>{i("editorFontSize",$)},[$]),t.useEffect(()=>{i("tabSize",O)},[O]),t.useEffect(()=>{i("wordWrap",_)},[_]),t.useEffect(()=>{i("lineNumbers",V)},[V]),t.useEffect(()=>{i("minimap",K)},[K]),t.useEffect(()=>{i("bracketMatching",W)},[W]),t.useEffect(()=>{i("defaultProvider",q)},[q]),t.useEffect(()=>{i("maxIterations",U)},[U]),t.useEffect(()=>{i("qualityStrictness",J)},[J]),t.useEffect(()=>{i("autoDeploy",Q)},[Q]),t.useEffect(()=>{i("budgetLimit",X)},[X]),t.useEffect(()=>{i("buildNotifications",Y)},[Y]),t.useEffect(()=>{i("providerKeys",Z)},[Z]),t.useEffect(()=>{i("providerModels",ee)},[ee]),t.useEffect(()=>{i("providerPriority",z)},[z]),t.useEffect(()=>{i("highContrast",k)},[k]),t.useEffect(()=>{i("focusIndicator",F)},[F]),t.useEffect(()=>{i("motionPref",w)},[w]),t.useEffect(()=>{i("screenReaderAnnouncements",te)},[te]),t.useEffect(()=>{i("fontScaling",P)},[P]),t.useEffect(()=>{const a=parseInt(P,10);return document.documentElement.style.fontSize=`${15*a/100}px`,()=>{document.documentElement.style.fontSize=""}},[P]),t.useEffect(()=>{document.documentElement.classList.toggle("high-contrast",k)},[k]),t.useEffect(()=>{document.documentElement.classList.toggle("reduce-motion",w==="reduced"),document.documentElement.classList.toggle("no-motion",w==="none")},[w]),t.useEffect(()=>{document.documentElement.classList.toggle("enhanced-focus",F==="enhanced")},[F]),t.useEffect(()=>{se.getStatus().then(a=>Ve(a.version||"")).catch(()=>{})},[]);const Ke=t.useCallback(async a=>{oe(a),R(u=>{const s={...u};return delete s[a],s});try{await se.setProvider(a),(await se.getCurrentProvider()).provider===a?R(s=>({...s,[a]:"success"})):R(s=>({...s,[a]:"error"}))}catch{R(u=>({...u,[a]:"error"}))}finally{oe(null)}},[]),ce=t.useCallback((a,u)=>{Re(s=>{const c=s.indexOf(a);if(c===-1)return s;const N=u==="up"?c-1:c+1;if(N<0||N>=s.length)return s;const L=[...s];return[L[c],L[N]]=[L[N],L[c]],L})},[]);function We(){switch(n){case"general":return e.jsx(qe,{});case"appearance":return e.jsx(Ue,{});case"editor":return e.jsx(Je,{});case"build":return e.jsx(Qe,{});case"providers":return e.jsx(Xe,{});case"shortcuts":return e.jsx(Ye,{});case"accessibility":return e.jsx(Ze,{});case"about":return e.jsx(et,{});default:return null}}function qe(){return e.jsxs("div",{children:[e.jsx(d,{children:"Project"}),e.jsx(ae,{label:"Default project directory",description:"New projects will be created in this directory",value:l,onChange:f,placeholder:"~/projects"}),e.jsx(h,{}),e.jsx(d,{children:"Saving"}),e.jsx(j,{label:"Auto-save",description:"Automatically save files when modified",value:x,onChange:b}),e.jsx(p,{label:"Auto-save interval",description:"How often to auto-save open files",options:[{value:"5",label:"5 seconds"},{value:"15",label:"15 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"}],value:g,onChange:m,disabled:!x}),e.jsx(h,{}),e.jsx(d,{children:"Preferences"}),e.jsx(p,{label:"Language",description:"Interface language",options:[{value:"en",label:"English"}],value:E,onChange:S}),e.jsx(j,{label:"Telemetry",description:"Help improve Purple Lab by sending anonymous usage data",value:y,onChange:A})]})}function Ue(){const a=[{id:"purple",color:"#553DE9",label:"Purple"},{id:"blue",color:"#2563EB",label:"Blue"},{id:"green",color:"#059669",label:"Green"},{id:"orange",color:"#D97706",label:"Orange"},{id:"pink",color:"#DB2777",label:"Pink"}],u={small:"text-xs",medium:"text-sm",large:"text-base"};return e.jsxs("div",{children:[e.jsx(d,{children:"Theme"}),e.jsxs("div",{className:"py-3",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E] block mb-3",children:"Color theme"}),e.jsx("div",{className:"flex gap-3",children:["light","dark","system"].map(s=>e.jsxs("button",{type:"button",onClick:()=>be(s),className:["flex-1 flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-colors",C===s?"border-[#553DE9] bg-[#553DE9]/5":"border-[#ECEAE3] hover:border-[#553DE9]/30"].join(" "),"aria-pressed":C===s,children:[e.jsxs("div",{className:["w-full h-12 rounded border flex items-end px-1.5 pb-1.5 gap-1",s==="dark"?"bg-[#1A1A1E] border-[#2A2A30]":s==="light"?"bg-white border-[#ECEAE3]":"bg-gradient-to-r from-white to-[#1A1A1E] border-[#ECEAE3]"].join(" "),children:[e.jsx("div",{className:`w-2 h-4 rounded-sm ${s==="dark"?"bg-[#2A2A30]":"bg-[#ECEAE3]"}`}),e.jsx("div",{className:`w-4 h-3 rounded-sm ${s==="dark"?"bg-[#2A2A30]":"bg-[#ECEAE3]"}`}),e.jsx("div",{className:`w-3 h-5 rounded-sm ${s==="dark"?"bg-[#2A2A30]":"bg-[#ECEAE3]"}`})]}),e.jsx("span",{className:"text-xs font-medium text-[#36342E] capitalize",children:s})]},s))})]}),e.jsx(h,{}),e.jsx(d,{children:"Accent color"}),e.jsx("div",{className:"py-3",children:e.jsx("div",{className:"flex gap-3",children:a.map(s=>e.jsxs("button",{type:"button",onClick:()=>ge(s.id),className:"flex flex-col items-center gap-1.5 group","aria-label":s.label,"aria-pressed":M===s.id,children:[e.jsx("div",{className:["w-8 h-8 rounded-full transition-all",M===s.id?"ring-2 ring-offset-2 ring-[#553DE9] scale-110":"group-hover:scale-105"].join(" "),style:{backgroundColor:s.color}}),e.jsx("span",{className:"text-[11px] text-[#6B6960]",children:s.label})]},s.id))})}),e.jsx(h,{}),e.jsx(d,{children:"Layout"}),e.jsx(p,{label:"Font size",description:"Base font size for the interface",options:[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],value:B,onChange:je}),e.jsx("div",{className:"pl-4 pb-2",children:e.jsx("span",{className:`${u[B]} text-[#6B6960] italic`,children:"The quick brown fox jumps over the lazy dog."})}),e.jsx(p,{label:"Sidebar position",description:"Which side the navigation sidebar appears on",options:[{value:"left",label:"Left"},{value:"right",label:"Right"}],value:T,onChange:ve}),e.jsx(j,{label:"Compact mode",description:"Reduce padding and spacing throughout the interface",value:H,onChange:Ee}),e.jsx(p,{label:"Animations",description:"Control interface transition animations",options:[{value:"full",label:"Full"},{value:"reduced",label:"Reduced"},{value:"none",label:"None"}],value:G,onChange:ye})]})}function Je(){return e.jsxs("div",{children:[e.jsx(d,{children:"Font"}),e.jsx(p,{label:"Font family",description:"Font used in the code editor",options:[{value:"JetBrains Mono",label:"JetBrains Mono"},{value:"Fira Code",label:"Fira Code"},{value:"Source Code Pro",label:"Source Code Pro"},{value:"Consolas",label:"Consolas"}],value:I,onChange:Ce}),e.jsx(ue,{label:"Font size",description:"Size of text in the code editor",min:12,max:24,value:$,onChange:Ne,unit:"px"}),e.jsxs("div",{className:"my-3 rounded-lg border border-[#ECEAE3] overflow-hidden",children:[e.jsx("div",{className:"bg-[#FAF9F6] px-3 py-1.5 border-b border-[#ECEAE3]",children:e.jsx("span",{className:"text-[11px] text-[#939084]",children:"Preview"})}),e.jsx("div",{className:"bg-white p-4",children:e.jsx("pre",{className:"text-[#36342E] leading-relaxed",style:{fontFamily:`"${I}", monospace`,fontSize:`${$}px`},children:`function greet(name) {
7
- return \`Hello, \${name}!\`;
8
- }
9
-
10
- greet("world");`})})]}),e.jsx(h,{}),e.jsx(d,{children:"Formatting"}),e.jsx(p,{label:"Tab size",description:"Number of spaces per tab",options:[{value:"2",label:"2 spaces"},{value:"4",label:"4 spaces"},{value:"8",label:"8 spaces"}],value:O,onChange:Se}),e.jsx(j,{label:"Word wrap",description:"Wrap long lines to fit the editor width",value:_,onChange:we}),e.jsx(h,{}),e.jsx(d,{children:"Display"}),e.jsx(j,{label:"Line numbers",description:"Show line numbers in the gutter",value:V,onChange:Ae}),e.jsx(j,{label:"Minimap",description:"Show a miniature overview of the file",value:K,onChange:ke}),e.jsx(j,{label:"Bracket matching",description:"Highlight matching brackets",value:W,onChange:Fe})]})}function Qe(){return e.jsxs("div",{children:[e.jsx(d,{children:"Provider"}),e.jsx(p,{label:"Default provider",description:"AI provider to use for new builds",options:me.map(a=>({value:a.id,label:a.name})),value:q,onChange:Pe}),e.jsx(h,{}),e.jsx(d,{children:"Execution"}),e.jsx(ue,{label:"Max iterations",description:"Maximum number of RARV iterations per build",min:5,max:50,value:U,onChange:De,step:5}),e.jsx(p,{label:"Quality gate strictness",description:"How strict the quality gates are during builds",options:[{value:"relaxed",label:"Relaxed"},{value:"standard",label:"Standard"},{value:"strict",label:"Strict"}],value:J,onChange:Le}),e.jsx(h,{}),e.jsx(d,{children:"Automation"}),e.jsx(j,{label:"Auto-deploy on success",description:"Automatically deploy when build completes successfully",value:Q,onChange:Me}),e.jsx(ae,{label:"Budget limit",description:"Maximum spend per build (leave empty for unlimited)",type:"number",value:X,onChange:Be,placeholder:"e.g. 10.00"}),e.jsx(j,{label:"Build notifications",description:"Show browser notifications for build events",value:Y,onChange:Ie})]})}function Xe(){return e.jsxs("div",{children:[e.jsx(d,{children:"Configured providers"}),e.jsx("div",{className:"flex flex-col gap-4 mt-2",children:z.map((a,u)=>{const s=me.find(c=>c.id===a);return s?e.jsxs("div",{className:"border border-[#ECEAE3] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-full bg-[#553DE9]/10 text-[#553DE9] text-xs font-bold",children:u+1}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-[#36342E]",children:s.name}),e.jsx("p",{className:"text-xs text-[#6B6960]",children:s.description})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>ce(s.id,"up"),disabled:u===0,className:"px-2 py-1 text-xs text-[#6B6960] hover:text-[#36342E] disabled:opacity-30 disabled:cursor-not-allowed","aria-label":`Move ${s.name} up`,children:"Up"}),e.jsx("button",{type:"button",onClick:()=>ce(s.id,"down"),disabled:u===z.length-1,className:"px-2 py-1 text-xs text-[#6B6960] hover:text-[#36342E] disabled:opacity-30 disabled:cursor-not-allowed","aria-label":`Move ${s.name} down`,children:"Down"})]})]}),e.jsx(ae,{label:"API key",type:"password",value:Z[s.id]||"",onChange:c=>$e(N=>({...N,[s.id]:c})),placeholder:`Enter ${s.name} API key`}),e.jsx(p,{label:"Model",options:s.models.map(c=>({value:c,label:c})),value:ee[s.id]||s.defaultModel,onChange:c=>ze(N=>({...N,[s.id]:c}))}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[e.jsxs("button",{type:"button",onClick:()=>Ke(s.id),disabled:ne!==null,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] rounded-lg transition-colors disabled:opacity-50",children:[ne===s.id?e.jsx(xt,{size:12,className:"animate-spin"}):null,"Test Connection"]}),ie[s.id]==="success"&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-[#059669]",children:[e.jsx(mt,{size:12})," Connected"]}),ie[s.id]==="error"&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-[#C45B5B]",children:[e.jsx(pt,{size:12})," Connection failed"]})]})]},s.id):null})}),e.jsx("div",{className:"mt-4 p-3 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Priority order determines the fallback chain. If the primary provider fails, the next one in order will be used. Use the Up/Down buttons to reorder."})})]})}function Ye(){const a=D?pe.filter(s=>s.action.toLowerCase().includes(D.toLowerCase())||s.keys.toLowerCase().includes(D.toLowerCase())||s.category.toLowerCase().includes(D.toLowerCase())):pe,u=[...new Set(a.map(s=>s.category))];return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(it,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#939084]"}),e.jsx("input",{type:"text",value:D,onChange:s=>re(s.target.value),placeholder:"Search shortcuts...",className:"w-full pl-8 pr-3 py-2 text-sm border border-[#ECEAE3] rounded-lg bg-white text-[#36342E] focus:border-[#553DE9] focus:outline-none focus:ring-1 focus:ring-[#553DE9] placeholder:text-[#939084]","aria-label":"Search keyboard shortcuts"})]}),e.jsxs("button",{type:"button",onClick:()=>re(""),className:"inline-flex items-center gap-1.5 px-3 py-2 text-xs text-[#6B6960] hover:text-[#36342E] border border-[#ECEAE3] rounded-lg hover:bg-[#F8F4F0] transition-colors",children:[e.jsx(ct,{size:12}),"Reset to defaults"]})]}),u.map(s=>e.jsxs("div",{children:[e.jsx(d,{children:s}),e.jsx("div",{className:"flex flex-col",children:a.filter(c=>c.category===s).map(c=>e.jsxs("div",{className:"flex items-center justify-between py-2.5 px-2 rounded-lg hover:bg-[#FAF9F6]",children:[e.jsx("span",{className:"text-sm text-[#36342E]",children:c.action}),e.jsx("kbd",{className:"px-2.5 py-1 text-xs font-mono bg-[#FAF9F6] border border-[#ECEAE3] rounded-md text-[#6B6960]",children:c.keys})]},c.action))})]},s)),e.jsx("div",{className:"mt-6 p-3 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsxs("p",{className:"text-xs text-[#6B6960]",children:["Press ",e.jsxs("kbd",{className:"px-1.5 py-0.5 text-[11px] font-mono bg-white border border-[#ECEAE3] rounded",children:[v,"+?"]})," anywhere to see keyboard shortcuts."]})})]})}function Ze(){return e.jsxs("div",{children:[e.jsx(d,{children:"Vision"}),e.jsx(j,{label:"High contrast mode",description:"Increase contrast for text and UI elements",value:k,onChange:Te}),e.jsx(p,{label:"Focus indicators",description:"Visibility of keyboard focus outlines",options:[{value:"default",label:"Default"},{value:"enhanced",label:"Enhanced (thicker, more visible)"}],value:F,onChange:He}),e.jsx(p,{label:"Font scaling",description:"Scale all text in the interface",options:[{value:"100",label:"100%"},{value:"125",label:"125%"},{value:"150",label:"150%"}],value:P,onChange:_e}),e.jsx(h,{}),e.jsx(d,{children:"Motion"}),e.jsx(p,{label:"Motion preference",description:"Control animations and transitions",options:[{value:"full",label:"Full -- all animations enabled"},{value:"reduced",label:"Reduced -- minimal animations"},{value:"none",label:"None -- no animations"}],value:w,onChange:Ge}),e.jsx(h,{}),e.jsx(d,{children:"Screen reader"}),e.jsx(j,{label:"Screen reader announcements",description:"Enable additional ARIA live region announcements",value:te,onChange:Oe}),e.jsx("div",{className:"mt-6 p-3 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Purple Lab is designed to work with assistive technologies. All interactive elements include proper ARIA labels and keyboard navigation support. If you encounter accessibility issues, please report them via the About section."})})]})}function et(){return e.jsxs("div",{children:[e.jsx(d,{children:"Purple Lab"}),e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#553DE9] flex items-center justify-center",children:e.jsx("span",{className:"text-white font-heading font-bold text-lg",children:"PL"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-heading font-bold text-[#36342E]",children:"Purple Lab"}),e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Powered by Loki Mode"})]})]}),e.jsxs("div",{className:"border border-[#ECEAE3] rounded-lg divide-y divide-[#ECEAE3]",children:[le&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("span",{className:"text-sm text-[#6B6960]",children:"Version"}),e.jsxs("span",{className:"text-sm font-mono font-medium text-[#36342E]",children:["v",le]})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("span",{className:"text-sm text-[#6B6960]",children:"Build date"}),e.jsx("span",{className:"text-sm font-mono text-[#36342E]",children:"2026-03-24"})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("span",{className:"text-sm text-[#6B6960]",children:"License"}),e.jsx("span",{className:"text-sm text-[#36342E]",children:"MIT"})]})]})]}),e.jsx(h,{}),e.jsx(d,{children:"Links"}),e.jsx("div",{className:"flex flex-col gap-1 py-2",children:[{label:"Documentation",href:"https://www.autonomi.dev/docs"},{label:"GitHub",href:"https://github.com/asklokesh/loki-mode"},{label:"Changelog",href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md"},{label:"Report a bug",href:"https://github.com/asklokesh/loki-mode/issues/new"}].map(a=>e.jsxs("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between px-3 py-2.5 rounded-lg text-sm text-[#36342E] hover:bg-[#FAF9F6] transition-colors group",children:[e.jsx("span",{children:a.label}),e.jsx(lt,{size:14,className:"text-[#939084] group-hover:text-[#553DE9] transition-colors"})]},a.label))}),e.jsx(h,{}),e.jsx(d,{children:"Updates"}),e.jsx("div",{className:"py-3",children:e.jsx("button",{type:"button",onClick:()=>{window.open("https://github.com/asklokesh/loki-mode/releases","_blank")},className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] rounded-lg transition-colors",children:"Check for updates"})})]})}return e.jsxs("div",{className:"flex h-full min-h-0",children:[e.jsx("nav",{className:"w-56 flex-shrink-0 border-r border-[#ECEAE3] bg-[#FAF9F6] overflow-y-auto","aria-label":"Settings categories",children:e.jsxs("div",{className:"px-4 py-5",children:[e.jsx("h1",{className:"font-heading text-lg font-bold text-[#36342E] mb-4",children:"Settings"}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:xe.map(a=>{const u=n===a.id;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>r(a.id),className:["flex items-center gap-2.5 w-full px-3 py-2 text-sm rounded-lg transition-colors text-left",u?"bg-[#553DE9]/10 text-[#553DE9] font-medium":"text-[#36342E] hover:bg-[#F8F4F0]"].join(" "),"aria-current":u?"page":void 0,children:[e.jsx(a.icon,{size:16}),e.jsx("span",{children:a.label})]})},a.id)})})]})}),e.jsx("main",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-[640px] mx-auto px-8 py-6",children:[e.jsx("h2",{className:"font-heading text-base font-bold text-[#36342E] mb-1",children:(de=xe.find(a=>a.id===n))==null?void 0:de.label}),e.jsxs("p",{className:"text-xs text-[#6B6960] mb-6",children:[n==="general"&&"Manage general application preferences",n==="appearance"&&"Customize the look and feel of Purple Lab",n==="editor"&&"Configure the code editor behavior and display",n==="build"&&"Control build execution and automation settings",n==="providers"&&"Configure AI provider connections and fallback chain",n==="shortcuts"&&"View and manage keyboard shortcuts",n==="accessibility"&&"Adjust accessibility and assistive technology options",n==="about"&&"Version information and useful links"]}),We()]})})]})}export{wt as default};
@@ -1 +0,0 @@
1
- import{a0 as p,r as c,j as e,x as g,y as f,T as j}from"./index-DvZ0Kk2x.js";import{B as u}from"./Button-BDp9aJ9q.js";import{S as k}from"./server-pIIs9vNp.js";import{H as A}from"./hammer-EgOQNukG.js";import{B as v}from"./bell-DWH0drES.js";import{D as y}from"./database-CLcofiVp.js";import{S as N}from"./shield-alert-CsDqKXwA.js";import{E as C,R as S}from"./rotate-ccw-CY0os4DH.js";import{C as E}from"./check-ikfylPst.js";import{S as h}from"./save-v8qep5cY.js";const w=[{id:"claude",name:"Claude",apiKeySet:!0,model:"claude-opus-4-7",fallbackOrder:1,enabled:!0},{id:"codex",name:"Codex",apiKeySet:!1,model:"gpt-5.3-codex",fallbackOrder:2,enabled:!0},{id:"gemini",name:"Gemini",apiKeySet:!1,model:"gemini-3-pro-medium",fallbackOrder:3,enabled:!1}],D={maxIterations:25,timeoutMinutes:60,qualityGateThreshold:80,autoReview:!0,parallelAgents:3},B={sessionTimeoutMinutes:30,allowedOrigins:"*",rateLimitPerMinute:100,requireMFA:!1,ipAllowlist:""},T={emailEnabled:!1,emailAddress:"",browserEnabled:!0,slackEnabled:!1,slackWebhookUrl:"",notifyOnBuildComplete:!0,notifyOnBuildFailure:!0,notifyOnBudgetAlert:!0,notifyOnSecurityEvent:!0},I={logRetentionDays:30,auditRetentionDays:365,sessionRetentionDays:90,autoCleanupEnabled:!0,lastCleanup:new Date(Date.now()-864e5).toISOString()};function R(){const[s,o]=c.useState(w),[n,r]=c.useState({}),[l,d]=c.useState(!1),t=()=>{d(!0),setTimeout(()=>d(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure AI provider API keys, model preferences, and fallback chain."}),s.map((a,i)=>e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-[#553DE9]/10 flex items-center justify-center text-xs font-bold text-[#553DE9]",children:a.fallbackOrder}),e.jsx("span",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:a.name}),a.apiKeySet&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-[#1FC5A8]/10 text-[#1FC5A8]",children:"Configured"})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("span",{className:"text-xs text-[#939084]",children:a.enabled?"Enabled":"Disabled"}),e.jsx("input",{type:"checkbox",checked:a.enabled,onChange:m=>{const x=[...s];x[i]={...x[i],enabled:m.target.checked},o(x)},className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:n[a.id]?"text":"password",value:a.apiKeySet?"sk-****************************":"",placeholder:"Enter API key...",className:"w-full px-3 py-2 pr-10 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono",readOnly:!0}),e.jsx("button",{onClick:()=>r(m=>({...m,[a.id]:!m[a.id]})),className:"absolute right-3 top-1/2 -translate-y-1/2 text-[#939084] hover:text-[#36342E]",children:n[a.id]?e.jsx(C,{size:14}):e.jsx(f,{size:14})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Model"}),e.jsx("input",{value:a.model,onChange:m=>{const x=[...s];x[i]={...x[i],model:m.target.value},o(x)},className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] font-mono"})]})]})]},a.id)),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(u,{size:"sm",icon:l?E:h,onClick:t,children:l?"Saved":"Save Provider Config"})})]})}function F(){const[s,o]=c.useState(D),[n,r]=c.useState(!1),l=(t,a)=>{o(i=>({...i,[t]:a}))},d=()=>{r(!0),setTimeout(()=>r(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Default settings for new builds. Individual projects can override these."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Max Iterations"}),e.jsx("input",{type:"number",value:s.maxIterations,onChange:t=>l("maxIterations",parseInt(t.target.value)||0),min:1,max:100,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Timeout (minutes)"}),e.jsx("input",{type:"number",value:s.timeoutMinutes,onChange:t=>l("timeoutMinutes",parseInt(t.target.value)||0),min:5,max:480,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Quality Gate Threshold (%)"}),e.jsx("input",{type:"number",value:s.qualityGateThreshold,onChange:t=>l("qualityGateThreshold",parseInt(t.target.value)||0),min:0,max:100,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"}),e.jsx("div",{className:"mt-1 h-1.5 bg-[#F8F4F0] dark:bg-[#1A1A1E] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${s.qualityGateThreshold}%`,background:s.qualityGateThreshold>=80?"#1FC5A8":s.qualityGateThreshold>=60?"#F59E0B":"#C45B5B"}})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Parallel Agents"}),e.jsx("input",{type:"number",value:s.parallelAgents,onChange:t=>l("parallelAgents",parseInt(t.target.value)||1),min:1,max:10,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.autoReview,onChange:t=>l("autoReview",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Auto-run code review after each build"})]}),e.jsx(u,{size:"sm",icon:n?E:h,onClick:d,children:n?"Saved":"Save Build Defaults"})]})}function O(){const[s,o]=c.useState(B),[n,r]=c.useState(!1),l=(t,a)=>{o(i=>({...i,[t]:a}))},d=()=>{r(!0),setTimeout(()=>r(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Security settings for session management, rate limiting, and access control."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Session Timeout (minutes)"}),e.jsx("input",{type:"number",value:s.sessionTimeoutMinutes,onChange:t=>l("sessionTimeoutMinutes",parseInt(t.target.value)||0),min:5,max:1440,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Rate Limit (requests/minute)"}),e.jsx("input",{type:"number",value:s.rateLimitPerMinute,onChange:t=>l("rateLimitPerMinute",parseInt(t.target.value)||0),min:10,max:1e4,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Allowed Origins"}),e.jsx("input",{type:"text",value:s.allowedOrigins,onChange:t=>l("allowedOrigins",t.target.value),placeholder:"* or comma-separated origins",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"IP Allowlist"}),e.jsx("input",{type:"text",value:s.ipAllowlist,onChange:t=>l("ipAllowlist",t.target.value),placeholder:"Leave empty for no restriction",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.requireMFA,onChange:t=>l("requireMFA",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Require MFA for all users"}),!s.requireMFA&&e.jsxs("span",{className:"text-xs text-[#F59E0B] flex items-center gap-1",children:[e.jsx(j,{size:12}),"Not recommended for production"]})]}),e.jsx(u,{size:"sm",icon:n?E:h,onClick:d,children:n?"Saved":"Save Security Settings"})]})}function M(){const[s,o]=c.useState(T),[n,r]=c.useState(!1),l=(t,a)=>{o(i=>({...i,[t]:a}))},d=()=>{r(!0),setTimeout(()=>r(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure how and when you receive notifications about system events."}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Channels"}),e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg divide-y divide-[#ECEAE3] dark:divide-[#2A2A30]",children:[e.jsxs("div",{className:"p-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Browser Notifications"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Show desktop notifications"})]}),e.jsx("input",{type:"checkbox",checked:s.browserEnabled,onChange:t=>l("browserEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Email Notifications"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Send email for important events"})]}),e.jsx("input",{type:"checkbox",checked:s.emailEnabled,onChange:t=>l("emailEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),s.emailEnabled&&e.jsx("input",{type:"email",value:s.emailAddress,onChange:t=>l("emailAddress",t.target.value),placeholder:"notifications@company.com",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084]"})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Slack Webhook"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Post to a Slack channel"})]}),e.jsx("input",{type:"checkbox",checked:s.slackEnabled,onChange:t=>l("slackEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),s.slackEnabled&&e.jsx("input",{type:"url",value:s.slackWebhookUrl,onChange:t=>l("slackWebhookUrl",t.target.value),placeholder:"https://hooks.slack.com/services/...",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Events"}),e.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg divide-y divide-[#ECEAE3] dark:divide-[#2A2A30]",children:[{key:"notifyOnBuildComplete",label:"Build Complete",desc:"When a build finishes successfully"},{key:"notifyOnBuildFailure",label:"Build Failure",desc:"When a build fails or times out"},{key:"notifyOnBudgetAlert",label:"Budget Alert",desc:"When spending approaches the limit"},{key:"notifyOnSecurityEvent",label:"Security Event",desc:"Login from new device, key rotation, etc."}].map(t=>e.jsxs("div",{className:"p-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:t.label}),e.jsx("p",{className:"text-xs text-[#939084]",children:t.desc})]}),e.jsx("input",{type:"checkbox",checked:s[t.key],onChange:a=>l(t.key,a.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]},t.key))})]}),e.jsx(u,{size:"sm",icon:n?E:h,onClick:d,children:n?"Saved":"Save Notifications"})]})}function L(){const[s,o]=c.useState(I),[n,r]=c.useState(!1),l=(t,a)=>{o(i=>({...i,[t]:a}))},d=()=>{r(!0),setTimeout(()=>r(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure how long different types of data are retained before automatic cleanup."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Log Retention (days)"}),e.jsx("input",{type:"number",value:s.logRetentionDays,onChange:t=>l("logRetentionDays",parseInt(t.target.value)||0),min:7,max:365,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Audit Retention (days)"}),e.jsx("input",{type:"number",value:s.auditRetentionDays,onChange:t=>l("auditRetentionDays",parseInt(t.target.value)||0),min:30,max:3650,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Session Retention (days)"}),e.jsx("input",{type:"number",value:s.sessionRetentionDays,onChange:t=>l("sessionRetentionDays",parseInt(t.target.value)||0),min:7,max:365,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.autoCleanupEnabled,onChange:t=>l("autoCleanupEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Enable automatic cleanup"})]}),s.lastCleanup&&e.jsxs("p",{className:"text-xs text-[#939084]",children:["Last cleanup: ",new Date(s.lastCleanup).toLocaleString()]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{size:"sm",icon:n?E:h,onClick:d,children:n?"Saved":"Save Retention Settings"}),e.jsx(u,{size:"sm",variant:"ghost",icon:S,children:"Run Cleanup Now"})]})]})}const b=[{id:"providers",label:"Providers",icon:k},{id:"builds",label:"Build Defaults",icon:A},{id:"security",label:"Security",icon:g},{id:"notifications",label:"Notifications",icon:v},{id:"retention",label:"Data Retention",icon:y}];function P(){return e.jsxs("div",{className:"max-w-[500px] mx-auto px-6 py-20 text-center",children:[e.jsx(N,{size:48,className:"mx-auto text-[#C45B5B] mb-4"}),e.jsx("h1",{className:"font-heading text-h1 text-[#36342E] dark:text-[#E8E6E3] mb-2",children:"Access Denied"}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:"You do not have permission to access system settings. Contact your organization administrator for access."})]})}function Q(){var d,t;const{user:s,isLocalMode:o}=p(),[n,r]=c.useState("providers");return o||(s==null?void 0:s.authenticated)===!0?e.jsxs("div",{className:"max-w-[1000px] mx-auto px-6 py-8",children:[e.jsx("h1",{className:"font-heading text-h1 text-[#36342E] dark:text-[#E8E6E3] mb-6",children:"System Settings"}),e.jsxs("div",{className:"flex gap-6",children:[e.jsx("nav",{className:"w-48 flex-shrink-0 space-y-1",children:b.map(a=>e.jsxs("button",{onClick:()=>r(a.id),className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg text-left transition-colors ${n===a.id?"bg-[#553DE9]/8 text-[#553DE9] font-medium":"text-[#6B6960] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(a.icon,{size:16}),a.label]},a.id))}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[((d=b.find(a=>a.id===n))==null?void 0:d.icon)&&(()=>{const a=b.find(i=>i.id===n).icon;return e.jsx(a,{size:18,className:"text-[#553DE9]"})})(),e.jsx("h2",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:(t=b.find(a=>a.id===n))==null?void 0:t.label})]}),n==="providers"&&e.jsx(R,{}),n==="builds"&&e.jsx(F,{}),n==="security"&&e.jsx(O,{}),n==="notifications"&&e.jsx(M,{}),n==="retention"&&e.jsx(L,{})]})})]})]}):e.jsx(P,{})}export{Q as default};
@@ -1,11 +0,0 @@
1
- import{c as P,r,j as e,U as w,X as B,i as z,y as U,a as F,x as O,b as V,h as H,M as q,R as K,m as G,a1 as X,a2 as Y}from"./index-DvZ0Kk2x.js";import{B as N}from"./Button-BDp9aJ9q.js";import{U as M,A as D}from"./Avatar-BFPkXhIJ.js";import{M as J}from"./mail-COu670_W.js";import{L as Q}from"./lock-XzlDMy8M.js";import{A as k}from"./activity-Dreyb_Kr.js";import{P as _}from"./plus-PxeiD8ju.js";import{S as W}from"./save-v8qep5cY.js";import{T as Z}from"./trash-2-Dt6urTyY.js";import{U as ee}from"./user-BQf_XJO_.js";import{C as $}from"./clock-mlGCFq8l.js";import{F as te}from"./file-code-corner-CVrkaOQP.js";import{F as se}from"./file-plus-BV9240gX.js";import{H as ae}from"./hammer-EgOQNukG.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ie=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],re=P("crown",ie);/**
7
- * @license lucide-react v0.577.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const ne=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],le=P("pen-line",ne),de={admin:{label:"Admin",color:"bg-[#553DE9]/10 text-[#553DE9] border-[#553DE9]/20",Icon:re},editor:{label:"Editor",color:"bg-[#1FC5A8]/10 text-[#1FC5A8] border-[#1FC5A8]/20",Icon:le},viewer:{label:"Viewer",color:"bg-[#6B6960]/10 text-[#6B6960] border-[#6B6960]/20",Icon:U}};function ce({role:s}){const n=de[s];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium border ${n.color}`,children:[e.jsx(n.Icon,{size:12}),n.label]})}function oe({onInvite:s,onCancel:n}){const[a,l]=r.useState(""),[o,m]=r.useState("viewer"),u=x=>{x.preventDefault(),a.trim()&&(s(a.trim(),o),l(""))};return e.jsxs("form",{onSubmit:u,className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:"Invite Member"}),e.jsx("button",{type:"button",onClick:n,className:"text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]",children:e.jsx(B,{size:14})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(J,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#939084]"}),e.jsx("input",{type:"email",value:a,onChange:x=>l(x.target.value),placeholder:"colleague@example.com",className:"w-full pl-9 pr-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30",required:!0})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:o,onChange:x=>m(x.target.value),className:"appearance-none pl-3 pr-8 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30",children:[e.jsx("option",{value:"viewer",children:"Viewer"}),e.jsx("option",{value:"editor",children:"Editor"}),e.jsx("option",{value:"admin",children:"Admin"})]}),e.jsx(z,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-[#939084] pointer-events-none"})]})]}),e.jsx(N,{type:"submit",size:"sm",icon:M,disabled:!a.trim(),children:"Send Invite"})]})}function xe({team:s,onInviteMember:n,onRemoveMember:a,onChangeRole:l,loading:o}){const[m,u]=r.useState(!1),x=r.useCallback((i,h)=>{n==null||n(i,h),u(!1)},[n]);return o?e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(w,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Team"})]}),e.jsx("div",{className:"text-center py-8 text-[#939084] text-sm",children:"Loading team data..."})]}):e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Team"}),s&&e.jsxs("span",{className:"text-xs text-[#939084] font-mono",children:[s.members.length," member",s.members.length!==1?"s":""]})]}),!m&&n&&e.jsx(N,{size:"sm",variant:"secondary",icon:M,onClick:()=>u(!0),children:"Invite"})]}),m&&e.jsx("div",{className:"mb-4",children:e.jsx(oe,{onInvite:x,onCancel:()=>u(!1)})}),!s&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-[#939084] text-sm",children:"No team configured"}),e.jsx("p",{className:"text-[#553DE9]/60 text-xs mt-1",children:"Create a team to start collaborating"})]}),s&&e.jsx("div",{className:"space-y-2",children:s.members.map(i=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[i.avatar_url?e.jsx("img",{src:i.avatar_url,alt:"",className:"w-8 h-8 rounded-full flex-shrink-0"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#553DE9] flex items-center justify-center text-white text-xs font-bold flex-shrink-0",children:(i.name||i.email)[0].toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3] truncate",children:i.name||i.email}),e.jsx("p",{className:"text-xs text-[#939084] truncate",children:i.email})]}),e.jsx(ce,{role:i.role}),l&&i.role!=="admin"&&e.jsxs("select",{value:i.role,onChange:h=>l(i.id,h.target.value),className:"text-xs border border-[#ECEAE3] dark:border-[#2A2A30] rounded px-1.5 py-1 bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]","aria-label":`Change role for ${i.name||i.email}`,children:[e.jsx("option",{value:"viewer",children:"Viewer"}),e.jsx("option",{value:"editor",children:"Editor"}),e.jsx("option",{value:"admin",children:"Admin"})]}),a&&i.role!=="admin"&&e.jsx("button",{onClick:()=>a(i.id),className:"text-[#939084] hover:text-[#C45B5B] transition-colors",title:`Remove ${i.name||i.email}`,children:e.jsx(B,{size:14})})]},i.id))}),s&&e.jsxs("div",{className:"mt-6 pt-4 border-t border-[#ECEAE3] dark:border-[#2A2A30]",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider mb-3",children:"Project Sharing"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-[#F8F4F0] dark:hover:bg-[#222228] cursor-pointer transition-colors",children:[e.jsx("input",{type:"checkbox",defaultChecked:!0,className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Allow editors to share projects"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Editors can invite new viewers"})]})]}),e.jsxs("label",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-[#F8F4F0] dark:hover:bg-[#222228] cursor-pointer transition-colors",children:[e.jsx("input",{type:"checkbox",className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Public link sharing"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Anyone with the link can view"})]})]})]})]})]})}const R=[{id:"project.create",label:"Create Projects",description:"Create new projects"},{id:"project.edit",label:"Edit Projects",description:"Modify project files and settings"},{id:"project.delete",label:"Delete Projects",description:"Delete projects permanently"},{id:"project.view",label:"View Projects",description:"View project files and status"},{id:"project.deploy",label:"Deploy Projects",description:"Trigger deployments"},{id:"team.manage",label:"Manage Team",description:"Add/remove team members"},{id:"team.invite",label:"Invite Members",description:"Send team invitations"},{id:"role.manage",label:"Manage Roles",description:"Create and modify roles"},{id:"audit.view",label:"View Audit Log",description:"Access audit history"},{id:"settings.edit",label:"Edit Settings",description:"Modify team settings"}],me=[{id:"admin",name:"Admin",description:"Full access to all features",permissions:R.map(s=>s.id),isSystem:!0},{id:"editor",name:"Editor",description:"Can create and edit projects",permissions:["project.create","project.edit","project.view","project.deploy","team.invite"],isSystem:!0},{id:"viewer",name:"Viewer",description:"Read-only access",permissions:["project.view"],isSystem:!0}];function pe({role:s,permissions:n,onSave:a,onDelete:l,onCancel:o}){const[m,u]=r.useState((s==null?void 0:s.name)||""),[x,i]=r.useState((s==null?void 0:s.description)||""),[h,b]=r.useState(new Set((s==null?void 0:s.permissions)||[])),E=p=>{b(f=>{const v=new Set(f);return v.has(p)?v.delete(p):v.add(p),v})},y=()=>{m.trim()&&a({id:(s==null?void 0:s.id)||`role-${Date.now()}`,name:m.trim(),description:x.trim(),permissions:Array.from(h)})};return e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3]",children:s?"Edit Role":"Create Role"}),e.jsx("button",{onClick:o,className:"text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]",children:e.jsx("span",{className:"text-xs",children:"Cancel"})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Role Name"}),e.jsx("input",{value:m,onChange:p=>u(p.target.value),placeholder:"e.g. Deployer",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084]",disabled:s==null?void 0:s.isSystem})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Description"}),e.jsx("input",{value:x,onChange:p=>i(p.target.value),placeholder:"Brief description",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-2",children:"Permissions"}),e.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#F8F4F0] dark:bg-[#222228]",children:[e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"Permission"}),e.jsx("th",{className:"text-center px-3 py-2 text-xs font-medium text-[#6B6960] w-20",children:"Granted"})]})}),e.jsx("tbody",{children:n.map(p=>e.jsxs("tr",{className:"border-t border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:p.label}),e.jsx("p",{className:"text-xs text-[#939084]",children:p.description})]}),e.jsx("td",{className:"text-center px-3 py-2",children:e.jsx("input",{type:"checkbox",checked:h.has(p.id),onChange:()=>E(p.id),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]",disabled:s==null?void 0:s.isSystem})})]},p.id))})]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!(s!=null&&s.isSystem)&&e.jsx(N,{size:"sm",icon:W,onClick:y,disabled:!m.trim(),children:s?"Update Role":"Create Role"}),s&&!s.isSystem&&l&&e.jsx(N,{size:"sm",variant:"danger",icon:Z,onClick:()=>l(s.id),children:"Delete"})]})]})}function he({entries:s,loading:n}){return n?e.jsx("div",{className:"text-center py-8 text-[#939084] text-sm",children:"Loading audit log..."}):s.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-[#939084] text-sm",children:"No audit entries"}),e.jsx("p",{className:"text-[#553DE9]/60 text-xs mt-1",children:"Actions will appear here as they occur"})]}):e.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#F8F4F0] dark:bg-[#222228]",children:[e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"Action"}),e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"User"}),e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"Target"}),e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"Timestamp"})]})}),e.jsx("tbody",{children:s.map(a=>e.jsxs("tr",{className:"border-t border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(k,{size:12,className:"text-[#553DE9]"}),e.jsx("span",{className:"text-[#201515] dark:text-[#E8E6E3] font-medium",children:a.action})]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ee,{size:12,className:"text-[#939084]"}),e.jsx("span",{className:"text-[#201515] dark:text-[#E8E6E3]",children:a.user})]})}),e.jsx("td",{className:"px-3 py-2 text-[#6B6960]",children:a.target||"--"}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-[#939084]",children:[e.jsx($,{size:12}),e.jsx("span",{className:"text-xs font-mono",children:a.timestamp})]})})]},a.id))})]})})}function ue({teamId:s}){const[n,a]=r.useState(me),[l,o]=r.useState([]),[m,u]=r.useState(!1),[x,i]=r.useState(null),[h,b]=r.useState(!1),[E,y]=r.useState("roles"),[p,f]=r.useState(new Set);r.useEffect(()=>{E==="audit"&&(u(!0),F.getAuditLog().then(d=>o(d)).catch(()=>{o([{id:"1",action:"member.invited",user:"admin@example.com",target:"dev@example.com",timestamp:new Date().toISOString(),details:"Invited as editor"},{id:"2",action:"role.created",user:"admin@example.com",target:"Deployer",timestamp:new Date(Date.now()-36e5).toISOString()},{id:"3",action:"project.created",user:"editor@example.com",target:"my-app",timestamp:new Date(Date.now()-72e5).toISOString()}])}).finally(()=>u(!1)))},[E,s]);const v=r.useCallback(d=>{a(t=>{const c=t.findIndex(j=>j.id===d.id);if(c>=0){const j=[...t];return j[c]=d,j}return[...t,d]}),i(null),b(!1)},[]),C=r.useCallback(d=>{a(t=>t.filter(c=>c.id!==d)),i(null)},[]),S=d=>{f(t=>{const c=new Set(t);return c.has(d)?c.delete(d):c.add(d),c})};return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(O,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Access Control"})]}),e.jsxs("div",{className:"flex items-center gap-1 border-b border-[#ECEAE3] dark:border-[#2A2A30] mb-4",children:[e.jsxs("button",{onClick:()=>y("roles"),className:`flex items-center gap-1.5 px-3 py-2 text-xs font-medium border-b-2 transition-colors ${E==="roles"?"border-[#553DE9] text-[#553DE9]":"border-transparent text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(Q,{size:14}),"Roles & Permissions"]}),e.jsxs("button",{onClick:()=>y("audit"),className:`flex items-center gap-1.5 px-3 py-2 text-xs font-medium border-b-2 transition-colors ${E==="audit"?"border-[#553DE9] text-[#553DE9]":"border-transparent text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(k,{size:14}),"Audit Log"]})]}),E==="roles"&&e.jsxs("div",{className:"space-y-3",children:[(x||h)&&e.jsx(pe,{role:x,permissions:R,onSave:v,onDelete:x?C:void 0,onCancel:()=>{i(null),b(!1)}}),!x&&!h&&e.jsx("div",{className:"flex justify-end mb-2",children:e.jsx(N,{size:"sm",variant:"secondary",icon:_,onClick:()=>b(!0),children:"New Role"})}),n.map(d=>e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:[e.jsxs("button",{onClick:()=>S(d.id),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[p.has(d.id)?e.jsx(z,{size:14,className:"text-[#939084]"}):e.jsx(V,{size:14,className:"text-[#939084]"}),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-[#201515] dark:text-[#E8E6E3]",children:d.name}),d.isSystem&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[#F8F4F0] dark:bg-[#2A2A30] text-[#939084]",children:"System"})]}),e.jsx("p",{className:"text-xs text-[#939084]",children:d.description})]}),e.jsxs("span",{className:"text-xs text-[#939084] font-mono",children:[d.permissions.length," permissions"]}),!d.isSystem&&e.jsx("button",{onClick:t=>{t.stopPropagation(),i(d)},className:"text-xs text-[#553DE9] hover:underline",children:"Edit"})]}),p.has(d.id)&&e.jsx("div",{className:"px-4 pb-3 border-t border-[#ECEAE3] dark:border-[#2A2A30]",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:d.permissions.map(t=>{const c=R.find(j=>j.id===t);return c?e.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-[#553DE9]/10 text-[#553DE9]",title:c.description,children:c.label},t):null})})})]},d.id))]}),E==="audit"&&e.jsx(he,{entries:l,loading:m})]})}const I={build_started:{icon:ae,color:"text-primary",dotColor:"bg-primary"},build_completed:{icon:G,color:"text-success",dotColor:"bg-success"},file_created:{icon:se,color:"text-blue-500",dotColor:"bg-blue-500"},file_modified:{icon:te,color:"text-blue-400",dotColor:"bg-blue-400"},deploy:{icon:K,color:"text-green-500",dotColor:"bg-green-500"},chat_sent:{icon:q,color:"text-primary",dotColor:"bg-primary"},system:{icon:k,color:"text-muted",dotColor:"bg-muted"}};function je(s){const n=Date.now(),a=new Date(s).getTime(),l=Math.floor((n-a)/1e3);if(l<5)return"just now";if(l<60)return`${l}s ago`;const o=Math.floor(l/60);if(o<60)return`${o}m ago`;const m=Math.floor(o/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`}let L=[];function be({maxItems:s=20,collapsible:n=!0}){const[a,l]=r.useState(L),[o,m]=r.useState(!1);r.useEffect(()=>{const i=()=>l([...L]);return window.addEventListener("pl_activity",i),()=>window.removeEventListener("pl_activity",i)},[]);const[,u]=r.useState(0);r.useEffect(()=>{const i=setInterval(()=>u(h=>h+1),3e4);return()=>clearInterval(i)},[]);const x=a.slice(0,s);return e.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[n?e.jsxs("button",{onClick:()=>m(!o),className:"w-full flex items-center gap-2 px-4 py-3 text-left hover:bg-hover transition-colors",children:[e.jsx(k,{size:14,className:"text-primary flex-shrink-0"}),e.jsx("span",{className:"text-sm font-heading font-bold text-ink flex-1",children:"Activity"}),a.length>0&&e.jsx("span",{className:"text-[11px] text-muted-accessible font-mono mr-2",children:a.length}),o?e.jsx(z,{size:14,className:"text-muted"}):e.jsx(H,{size:14,className:"text-muted"})]}):e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[e.jsx(k,{size:14,className:"text-primary"}),e.jsx("span",{className:"text-sm font-heading font-bold text-ink",children:"Activity"})]}),!o&&e.jsx("div",{className:"max-h-[300px] overflow-y-auto terminal-scroll",children:x.length===0?e.jsxs("div",{className:"px-4 py-6 text-center",children:[e.jsx($,{size:20,className:"text-muted/30 mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-muted",children:"No activity yet"}),e.jsx("p",{className:"text-[11px] text-muted/70 mt-0.5",children:"Actions you take will appear here."})]}):e.jsx("div",{className:"px-3 py-2",children:x.map(i=>{const h=I[i.type]||I.system,b=h.icon;return e.jsxs("div",{className:"flex items-start gap-3 py-2 group",children:[e.jsx("div",{className:"flex flex-col items-center flex-shrink-0 pt-0.5",children:e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center ${h.color} bg-hover`,children:e.jsx(b,{size:12})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-ink leading-relaxed",children:i.message}),e.jsx("span",{className:"text-[11px] text-muted",children:je(i.timestamp)})]})]},i.id)})})})]})}function ze(){const[s,n]=r.useState([]),[a,l]=r.useState(null),[o,m]=r.useState(!0),[u,x]=r.useState(!1),[i,h]=r.useState(""),[b,E]=r.useState("members"),[y,p]=r.useState([]),{notify:f}=X();r.useEffect(()=>{m(!0),F.getTeams().then(t=>{n(t),t.length>0&&!a&&l(t[0])}).catch(()=>{const t=[{id:"team-1",name:"Engineering",created_at:new Date().toISOString(),members:[{id:"m1",email:"admin@example.com",name:"Team Admin",role:"admin",joined_at:new Date().toISOString()},{id:"m2",email:"dev@example.com",name:"Developer",role:"editor",joined_at:new Date().toISOString()},{id:"m3",email:"viewer@example.com",name:"Viewer",role:"viewer",joined_at:new Date().toISOString()}]}];n(t),a||l(t[0])}).finally(()=>m(!1))},[]),r.useEffect(()=>{a&&p([{id:"a1",action:'Created project "my-app"',user:"Developer",timestamp:"2 hours ago"},{id:"a2",action:"Deployed to production",user:"Team Admin",timestamp:"5 hours ago"},{id:"a3",action:"Invited viewer@example.com",user:"Team Admin",timestamp:"1 day ago"},{id:"a4",action:"Updated RBAC settings",user:"Team Admin",timestamp:"2 days ago"}])},[a]);const v=r.useCallback(()=>{if(!i.trim())return;const t={id:`team-${Date.now()}`,name:i.trim(),created_at:new Date().toISOString(),members:[]};F.createTeam(i.trim()).catch(()=>{}),n(c=>[...c,t]),l(t),h(""),x(!1),f({type:"success",title:"Team created",message:`"${t.name}" is ready`})},[i,f]),C=r.useCallback((t,c)=>{if(!a)return;const j={id:`m-${Date.now()}`,email:t,name:t.split("@")[0],role:c,joined_at:new Date().toISOString()},g={...a,members:[...a.members,j]};l(g),n(A=>A.map(T=>T.id===g.id?g:T)),f({type:"success",title:"Invite sent",message:`${t} invited as ${c}`})},[a,f]),S=r.useCallback(t=>{if(!a)return;const c={...a,members:a.members.filter(j=>j.id!==t)};l(c),n(j=>j.map(g=>g.id===c.id?c:g)),f({type:"info",title:"Member removed"})},[a,f]),d=r.useCallback((t,c)=>{if(!a)return;const j={...a,members:a.members.map(g=>g.id===t?{...g,role:c}:g)};l(j),n(g=>g.map(A=>A.id===j.id?j:A)),f({type:"success",title:"Role updated"})},[a,f]);return e.jsxs("div",{className:"max-w-6xl mx-auto px-6 max-md:px-4 py-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-[#201515] dark:text-[#E8E6E3]",children:"Teams"}),e.jsx("p",{className:"text-sm text-[#939084] mt-1",children:"Manage team members, roles, and access control"})]}),!u&&e.jsx(N,{icon:_,onClick:()=>x(!0),children:"New Team"})]}),u&&e.jsxs("div",{className:"card p-4 mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3] mb-3",children:"Create Team"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"text",value:i,onChange:t=>h(t.target.value),placeholder:"Team name",className:"flex-1 px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30",autoFocus:!0,onKeyDown:t=>{t.key==="Enter"&&v()}}),e.jsx(N,{size:"sm",onClick:v,disabled:!i.trim(),children:"Create"}),e.jsx(N,{size:"sm",variant:"ghost",onClick:()=>x(!1),children:"Cancel"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 max-md:gap-4",children:[e.jsx("div",{className:"md:col-span-1",children:e.jsxs("div",{className:"card p-4",children:[e.jsx("h3",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider mb-3",children:"Your Teams"}),o&&e.jsx("div",{className:"text-center py-4 text-[#939084] text-sm",children:"Loading..."}),!o&&s.length===0&&e.jsx("div",{className:"text-center py-4 text-[#939084] text-sm",children:"No teams yet"}),e.jsx("div",{className:"space-y-1",children:s.map(t=>e.jsxs("button",{onClick:()=>l(t),className:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm rounded-lg transition-colors ${(a==null?void 0:a.id)===t.id?"bg-[#553DE9]/10 text-[#553DE9] font-medium":"text-[#36342E] dark:text-[#C5C0B8] hover:bg-[#F8F4F0] dark:hover:bg-[#222228]"}`,children:[e.jsx(D,{name:t.name,size:"sm"}),e.jsx("span",{className:"truncate flex-1",children:t.name}),e.jsx("span",{className:"text-xs text-[#939084]",children:t.members.length})]},t.id))})]})}),e.jsxs("div",{className:"md:col-span-3 space-y-6",children:[a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"card p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(D,{name:a.name,size:"lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#201515] dark:text-[#E8E6E3]",children:a.name}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-[#939084] mt-0.5",children:[e.jsxs("span",{children:[a.members.length," members"]}),e.jsxs("span",{children:["Created ",new Date(a.created_at).toLocaleDateString()]})]})]})]})}),e.jsx("div",{className:"flex items-center gap-1 border-b border-[#ECEAE3] dark:border-[#2A2A30]",children:[{id:"members",label:"Members",icon:w},{id:"roles",label:"Roles & Permissions",icon:Y},{id:"activity",label:"Activity",icon:k}].map(t=>e.jsxs("button",{onClick:()=>E(t.id),className:`flex items-center gap-1.5 px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${b===t.id?"border-[#553DE9] text-[#553DE9]":"border-transparent text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(t.icon,{size:16}),t.label]},t.id))}),b==="members"&&e.jsx(xe,{team:a,onInviteMember:C,onRemoveMember:S,onChangeRole:d,loading:o}),b==="roles"&&e.jsx(ue,{teamId:a.id}),b==="activity"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(k,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Recent Activity"})]}),y.length===0?e.jsx("div",{className:"text-center py-8 text-[#939084] text-sm",children:"No recent activity"}):e.jsx("div",{className:"space-y-3",children:y.map(t=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[e.jsx(D,{name:t.user,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:t.action}),e.jsx("p",{className:"text-xs text-[#939084]",children:t.user})]}),e.jsx("span",{className:"text-xs text-[#939084] flex-shrink-0",children:t.timestamp})]},t.id))})]}),e.jsx(be,{maxItems:10,collapsible:!0})]})]}),!a&&!o&&e.jsxs("div",{className:"text-center py-16",children:[e.jsx(w,{size:48,className:"mx-auto text-[#939084]/40 mb-4"}),e.jsx("p",{className:"text-[#939084] text-sm",children:"Select a team or create a new one"})]})]})]})]})}export{ze as default};
@@ -1,29 +0,0 @@
1
- import{c as F,r as o,j as e,b as q,U as V,d as O,w as B,R as D,u as z,a as J,X as P,y as K,F as T,v as Z,J as X,A as ee,n as W,k as te}from"./index-DvZ0Kk2x.js";import{B as N}from"./Button-BDp9aJ9q.js";import{u as se}from"./usePolling-D0aoTX80.js";import{C as ie}from"./chevron-left-DXUqkd8J.js";import{C as I}from"./clock-mlGCFq8l.js";import{L as ae}from"./lightbulb-DdASgqOG.js";import{L as le}from"./layers-BOVKmepE.js";import{C as S}from"./check-ikfylPst.js";import{P as L}from"./package-BtXTKusI.js";import{G as re}from"./globe-aZ0Zso4I.js";import{S as ne}from"./server-pIIs9vNp.js";import{B as oe}from"./bot-78MoCuDl.js";import{D as ce}from"./database-CLcofiVp.js";import{P as de}from"./plus-PxeiD8ju.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const xe=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],R=F("award",xe);/**
7
- * @license lucide-react v0.577.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const me=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],he=F("folder-tree",me);/**
12
- * @license lucide-react v0.577.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const pe=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],fe=F("settings",pe),A={"saas-starter.md":{uses:2847,rating:4.9,avgTime:"12 min"},"rest-api-auth.md":{uses:1923,rating:4.8,avgTime:"8 min"},"discord-bot.md":{uses:1654,rating:4.7,avgTime:"6 min"},"full-stack-demo.md":{uses:1432,rating:4.8,avgTime:"15 min"},"data-pipeline.md":{uses:1198,rating:4.6,avgTime:"10 min"},"cli-tool.md":{uses:987,rating:4.7,avgTime:"7 min"},"e-commerce.md":{uses:2156,rating:4.8,avgTime:"18 min"},"blog-platform.md":{uses:1345,rating:4.5,avgTime:"11 min"}},_={Website:"from-violet-600 via-purple-500 to-indigo-500",API:"from-teal-600 via-emerald-500 to-cyan-500",CLI:"from-slate-600 via-gray-500 to-blue-500",Bot:"from-orange-500 via-rose-500 to-pink-500",Data:"from-blue-600 via-indigo-500 to-purple-500",Other:"from-gray-500 via-slate-500 to-zinc-500"};function ue(i){return i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i)}function ge(i){return i.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function be({templates:i,onSelect:r,onPreview:c}){const p=o.useRef(null),[g,w]=o.useState(!1),[h,E]=o.useState(!0),d=i.filter(l=>l.filename in A).slice(0,6),v=d.length>=4?d:[...d,...i.filter(l=>!(l.filename in A))].slice(0,6),x=()=>{const l=p.current;l&&(w(l.scrollLeft>10),E(l.scrollLeft<l.scrollWidth-l.clientWidth-10))};o.useEffect(()=>{const l=p.current;if(l)return x(),l.addEventListener("scroll",x,{passive:!0}),()=>l.removeEventListener("scroll",x)},[v]);const f=l=>{const a=p.current;if(!a)return;const s=340;a.scrollBy({left:l==="left"?-s:s,behavior:"smooth"})};return v.length===0?null:e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{size:18,className:"text-[#D4A03C]"}),e.jsx("h2",{className:"text-lg font-bold text-[#36342E]",children:"Staff Picks"}),e.jsx("span",{className:"text-xs text-[#6B6960] bg-[#D4A03C]/10 text-[#D4A03C] font-semibold px-2 py-0.5 rounded",children:"Featured"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>f("left"),disabled:!g,className:`p-1.5 rounded-lg transition-colors ${g?"hover:bg-[#F8F4F0] text-[#6B6960]":"text-[#ECEAE3] cursor-not-allowed"}`,"aria-label":"Scroll left",children:e.jsx(ie,{size:18})}),e.jsx("button",{onClick:()=>f("right"),disabled:!h,className:`p-1.5 rounded-lg transition-colors ${h?"hover:bg-[#F8F4F0] text-[#6B6960]":"text-[#ECEAE3] cursor-not-allowed"}`,"aria-label":"Scroll right",children:e.jsx(q,{size:18})})]})]}),e.jsx("div",{ref:p,className:"flex gap-4 overflow-x-auto pb-2 scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:v.map(l=>{const a=l.category||"Other",s=_[a]||_.Other,u=A[l.filename]||{uses:Math.floor(Math.random()*1500)+200,rating:4.5,avgTime:l.build_time||"8 min"},j=l.tech_stack||[];return e.jsxs("div",{className:"flex-shrink-0 w-[320px] bg-white border border-[#ECEAE3] rounded-xl shadow-card hover:shadow-card-hover transition-all duration-200 overflow-hidden cursor-pointer group",onClick:()=>c(l),children:[e.jsxs("div",{className:`h-36 bg-gradient-to-br ${s} relative overflow-hidden`,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.12]",viewBox:"0 0 320 144",children:[e.jsx("circle",{cx:"60",cy:"40",r:"25",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"260",cy:"110",r:"35",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"180",cy:"25",r:"10",fill:"white"}),e.jsx("rect",{x:"220",y:"15",width:"30",height:"30",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5",transform:"rotate(20 235 30)"}),e.jsx("line",{x1:"40",y1:"120",x2:"120",y2:"80",stroke:"white",strokeWidth:"1"}),e.jsx("circle",{cx:"100",cy:"100",r:"6",fill:"white",fillOpacity:"0.4"}),e.jsx("circle",{cx:"280",cy:"50",r:"15",fill:"none",stroke:"white",strokeWidth:"1",strokeDasharray:"3 3"})]}),e.jsx("div",{className:"absolute top-3 left-3",children:e.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-white bg-white/25 backdrop-blur-sm px-2.5 py-1 rounded-full uppercase tracking-wider",children:[e.jsx(R,{size:11}),"Featured"]})}),e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:a})}),j.length>0&&e.jsx("div",{className:"absolute bottom-3 left-3 right-3 flex flex-wrap gap-1",children:j.slice(0,4).map(t=>e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:t},t))})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1 group-hover:text-[#553DE9] transition-colors",children:ge(l.name)}),e.jsx("p",{className:"text-xs text-[#6B6960] line-clamp-2 mb-3 min-h-[2.4em]",children:l.description||l.filename}),e.jsxs("div",{className:"flex items-center gap-3 mb-3 text-[10px] text-[#6B6960]",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(V,{size:11,className:"text-[#553DE9]"}),ue(u.uses)," uses"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{size:11,className:"text-[#D4A03C]",fill:"#D4A03C"}),u.rating]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(I,{size:11}),u.avgTime]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(B,{size:12,className:l.difficulty==="beginner"?"text-green-500":l.difficulty==="advanced"?"text-red-400":"text-yellow-500"}),e.jsx("span",{className:`text-[10px] font-medium capitalize ${l.difficulty==="beginner"?"text-green-500":l.difficulty==="advanced"?"text-red-400":"text-yellow-500"}`,children:l.difficulty||"Intermediate"})]}),e.jsx(N,{size:"sm",icon:D,onClick:t=>{t.stopPropagation(),r(l.filename)},className:"opacity-0 group-hover:opacity-100 transition-opacity",children:"Use"})]})]})]},l.filename)})})]})}const $={Website:"from-violet-600 via-purple-500 to-indigo-600",API:"from-teal-600 via-emerald-500 to-cyan-600",CLI:"from-slate-600 via-gray-500 to-blue-600",Bot:"from-orange-500 via-rose-500 to-pink-600",Data:"from-blue-600 via-indigo-500 to-purple-600",Other:"from-slate-500 via-gray-500 to-zinc-600"},ye={React:"Component-based UI library","Node.js":"Server-side JavaScript runtime",Python:"General-purpose programming language",TypeScript:"Type-safe JavaScript superset",PostgreSQL:"Advanced relational database",MongoDB:"Document-oriented NoSQL database",Docker:"Container platform",Redis:"In-memory data store",Express:"Minimal Node.js web framework",FastAPI:"Modern async Python web framework",SQLite:"Lightweight embedded database",Tailwind:"Utility-first CSS framework",Discord:"Discord API integration",Slack:"Slack API integration",CLI:"Command-line interface tooling",Playwright:"End-to-end testing framework",Vite:"Next-gen frontend build tool",Next:"React framework with SSR/SSG",Prisma:"Type-safe ORM for Node.js",Stripe:"Payment processing platform"},M={beginner:{label:"Beginner",color:"text-green-500",bars:1,description:"Suitable for developers new to this stack. Simple setup and straightforward concepts."},intermediate:{label:"Intermediate",color:"text-yellow-500",bars:2,description:"Assumes familiarity with the core technologies. Moderate complexity with several integrated features."},advanced:{label:"Advanced",color:"text-red-400",bars:3,description:"Complex architecture with multiple services. Best for experienced developers comfortable with infrastructure."}},U={Website:["src/"," app/"," layout.tsx"," page.tsx"," globals.css"," components/"," Header.tsx"," Footer.tsx"," lib/"," utils.ts","public/"," favicon.ico","package.json","tailwind.config.ts","tsconfig.json"],API:["src/"," routes/"," index.ts"," users.ts"," auth.ts"," middleware/"," auth.ts"," validation.ts"," models/"," user.ts"," config/"," database.ts","tests/"," api.test.ts","package.json","Dockerfile"],CLI:["src/"," commands/"," init.ts"," run.ts"," config.ts"," utils/"," logger.ts"," parser.ts"," index.ts","bin/"," cli.js","tests/"," cli.test.ts","package.json","tsconfig.json"],Bot:["src/"," commands/"," help.ts"," moderate.ts"," settings.ts"," events/"," ready.ts"," messageCreate.ts"," utils/"," embed.ts"," permissions.ts"," index.ts",".env.example","package.json","Dockerfile"],Data:["src/"," pipelines/"," extract.py"," transform.py"," load.py"," models/"," schema.py"," utils/"," database.py"," logger.py","tests/"," test_pipeline.py","config.yaml","requirements.txt","Dockerfile"],Other:["src/"," main.ts"," config.ts"," utils/"," helpers.ts","tests/"," main.test.ts","package.json","tsconfig.json","README.md"]},G={Website:["Responsive layout with mobile-first design","SEO-optimized pages with meta tags","Modern component architecture","Production build configuration","Styling system with design tokens","Type-safe development setup"],API:["RESTful endpoint structure","Authentication and authorization middleware","Database models and migrations","Input validation and error handling","API documentation generation","Docker deployment configuration"],CLI:["Subcommand architecture with help text","Configuration file management","Colored terminal output","Progress indicators and spinners","Error handling with helpful messages","Cross-platform compatibility"],Bot:["Slash command registration and handling","Event-driven architecture","Permissions and role checking","Rich embed message formatting","Configuration persistence","Graceful shutdown handling"],Data:["Extract-Transform-Load pipeline","Data validation and cleaning","Database connection pooling","Logging and monitoring","Scheduled job execution","Error recovery and retry logic"],Other:["Clean project structure","Type-safe configuration","Comprehensive test setup","Build and deployment scripts","Documentation templates","Linting and formatting rules"]};function je({template:i,onClose:r}){const c=z(),[p,g]=o.useState(null),[w,h]=o.useState(!1);o.useEffect(()=>{J.getTemplateContent(i.filename).then(a=>g(a.content)).catch(()=>g(null))},[i.filename]);const E=o.useCallback(()=>{sessionStorage.setItem("pl_template",i.filename),c("/"),r()},[i.filename,c,r]);o.useEffect(()=>{const a=s=>{s.key==="Escape"&&r()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[r]),o.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const d=i.category||"Other",v=$[d]||$.Other,x=M[i.difficulty]||M.intermediate,f=U[d]||U.Other,l=G[d]||G.Other;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:a=>{a.target===a.currentTarget&&r()},children:[e.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-[95vw] max-w-[1100px] max-h-[90vh] overflow-hidden animate-in",style:{animation:"modal-enter 0.25s ease-out"},children:[e.jsx("button",{onClick:r,className:"absolute top-4 right-4 z-10 p-2 rounded-lg bg-white/90 hover:bg-white text-[#6B6960] hover:text-[#36342E] shadow-sm","aria-label":"Close preview",children:e.jsx(P,{size:18})}),e.jsxs("div",{className:"flex flex-col lg:flex-row h-full max-h-[90vh]",children:[e.jsxs("div",{className:"flex-1 lg:w-[60%] overflow-y-auto p-6 lg:p-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-[#553DE9] bg-[#553DE9]/10 px-2 py-0.5 rounded",children:d})}),e.jsx("h2",{className:"text-2xl font-bold text-[#36342E] mb-2",children:i.name.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase())}),e.jsx("p",{className:"text-[#6B6960] leading-relaxed",children:i.description||"A ready-to-use template to kickstart your project."})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-[#36342E] mb-3",children:[e.jsx(O,{size:15,className:"text-[#553DE9]"}),"What You Get"]}),e.jsx("ul",{className:"space-y-2",children:l.map((a,s)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-[#6B6960]",children:[e.jsx(q,{size:14,className:"text-[#553DE9] mt-0.5 flex-shrink-0"}),e.jsx("span",{children:a})]},s))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-[#36342E] mb-3",children:[e.jsx(he,{size:15,className:"text-[#553DE9]"}),"Project Structure"]}),e.jsx("div",{className:"bg-[#FAF9F6] rounded-lg border border-[#ECEAE3] p-4 font-mono text-xs text-[#6B6960] leading-relaxed",children:f.map((a,s)=>e.jsx("div",{className:a.startsWith(" ")?"ml-4":"",children:a.includes("/")&&!a.includes(".")?e.jsx("span",{className:"text-[#553DE9]",children:a}):a.includes(".")?e.jsx("span",{className:"text-[#36342E]",children:a}):a},s))})]}),e.jsxs("div",{className:"bg-[#553DE9]/5 rounded-lg border border-[#553DE9]/10 p-4",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-[#553DE9] mb-2",children:[e.jsx(ae,{size:15}),"How to Customize"]}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:'After selecting this template, describe your specific requirements in the prompt. For example: "Add user authentication with Google OAuth" or "Change the database to MongoDB". The AI will adapt the template to your needs.'})]})]}),e.jsxs("div",{className:"lg:w-[40%] bg-[#FAF9F6] border-t lg:border-t-0 lg:border-l border-[#ECEAE3] p-6 lg:p-8 overflow-y-auto flex flex-col",children:[e.jsxs("div",{className:`h-40 rounded-xl bg-gradient-to-br ${v} relative overflow-hidden mb-6 shadow-lg`,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-10",viewBox:"0 0 400 200",children:[e.jsx("circle",{cx:"50",cy:"50",r:"30",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"350",cy:"150",r:"45",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"200",cy:"30",r:"15",fill:"white"}),e.jsx("rect",{x:"300",y:"20",width:"40",height:"40",rx:"8",fill:"none",stroke:"white",strokeWidth:"2",transform:"rotate(15 320 40)"}),e.jsx("line",{x1:"50",y1:"180",x2:"150",y2:"120",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"100",cy:"140",r:"8",fill:"white",fillOpacity:"0.5"}),e.jsx("circle",{cx:"250",cy:"100",r:"20",fill:"none",stroke:"white",strokeWidth:"1.5",strokeDasharray:"4 4"})]}),e.jsx("div",{className:"absolute bottom-3 left-4 right-4",children:e.jsxs("span",{className:"text-white/90 text-xs font-semibold bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full",children:[d," Template"]})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#36342E] uppercase tracking-wider mb-3",children:"Tech Stack"}),e.jsxs("div",{className:"space-y-2",children:[(i.tech_stack||[]).map(a=>e.jsxs("div",{className:"flex items-center justify-between bg-white rounded-lg border border-[#ECEAE3] px-3 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[#36342E]",children:a}),e.jsx("span",{className:"text-xs text-[#6B6960]",children:ye[a]||"Development tool"})]},a)),(!i.tech_stack||i.tech_stack.length===0)&&e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Tech stack details available after selection"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 bg-white rounded-lg border border-[#ECEAE3] px-4 py-3 mb-3",children:[e.jsx(I,{size:16,className:"text-[#553DE9]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[#6B6960]",children:"Estimated Build Time"}),e.jsx("div",{className:"text-sm font-semibold text-[#36342E]",children:i.build_time||"5-10 min"})]})]}),e.jsxs("div",{className:"bg-white rounded-lg border border-[#ECEAE3] px-4 py-3 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(B,{size:16,className:x.color}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[#6B6960]",children:"Difficulty"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-sm font-semibold ${x.color}`,children:x.label}),e.jsx("div",{className:"flex gap-0.5",children:[1,2,3].map(a=>e.jsx("div",{className:`w-2 h-4 rounded-sm ${a<=x.bars?"bg-current "+x.color:"bg-[#ECEAE3]"}`},a))})]})]})]}),e.jsx("p",{className:"text-xs text-[#6B6960] leading-relaxed",children:x.description})]}),e.jsxs("div",{className:"mt-auto space-y-3",children:[e.jsx(N,{variant:"primary",size:"lg",icon:D,onClick:E,className:"w-full justify-center text-base",children:"Use This Template"}),e.jsx(N,{variant:"secondary",size:"md",icon:w?K:T,onClick:()=>h(!w),className:"w-full justify-center",children:w?"Hide Spec":"View Spec"})]})]})]}),w&&e.jsxs("div",{className:"absolute inset-0 bg-white z-20 overflow-y-auto",children:[e.jsxs("div",{className:"sticky top-0 bg-white border-b border-[#ECEAE3] px-6 py-4 flex items-center justify-between z-10",children:[e.jsxs("h3",{className:"text-lg font-semibold text-[#36342E]",children:["Template Spec: ",i.name.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase())]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>h(!1),children:"Back to Preview"}),e.jsx("button",{onClick:r,className:"p-2 rounded-lg hover:bg-[#F8F4F0] text-[#6B6960]","aria-label":"Close",children:e.jsx(P,{size:18})})]})]}),e.jsx("div",{className:"p-6 lg:p-8 max-w-4xl mx-auto",children:p?e.jsx("pre",{className:"whitespace-pre-wrap text-sm text-[#36342E] font-mono leading-relaxed",children:p}):e.jsxs("div",{className:"text-center py-12 text-[#6B6960]",children:[e.jsx(T,{size:32,className:"mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-sm",children:"Loading template content..."})]})})]})]}),e.jsx("style",{children:`
17
- @keyframes modal-enter {
18
- from { opacity: 0; transform: scale(0.95) translateY(10px); }
19
- to { opacity: 1; transform: scale(1) translateY(0); }
20
- }
21
- `})]})}const Y=[{label:"Basics",icon:T},{label:"Tech Stack",icon:le},{label:"Features",icon:fe},{label:"Review",icon:S}],k=[{id:"react",label:"React",group:"Frontend"},{id:"nextjs",label:"Next.js",group:"Frontend"},{id:"vue",label:"Vue",group:"Frontend"},{id:"svelte",label:"Svelte",group:"Frontend"},{id:"tailwind",label:"Tailwind CSS",group:"Frontend"},{id:"nodejs",label:"Node.js",group:"Backend"},{id:"python",label:"Python",group:"Backend"},{id:"fastapi",label:"FastAPI",group:"Backend"},{id:"express",label:"Express",group:"Backend"},{id:"typescript",label:"TypeScript",group:"Language"},{id:"postgresql",label:"PostgreSQL",group:"Database"},{id:"mongodb",label:"MongoDB",group:"Database"},{id:"sqlite",label:"SQLite",group:"Database"},{id:"redis",label:"Redis",group:"Database"},{id:"docker",label:"Docker",group:"DevOps"},{id:"prisma",label:"Prisma",group:"ORM"}],C=[{id:"auth",label:"Authentication",description:"Email/password and OAuth login"},{id:"database",label:"Database",description:"Schema, models, and migrations"},{id:"api",label:"REST API",description:"CRUD endpoints with validation"},{id:"tests",label:"Tests",description:"Unit and integration test setup"},{id:"docker",label:"Docker",description:"Dockerfile and compose setup"},{id:"ci",label:"CI/CD",description:"GitHub Actions workflow"},{id:"websockets",label:"WebSockets",description:"Real-time communication"},{id:"fileupload",label:"File Upload",description:"Image and document handling"},{id:"email",label:"Email",description:"Transactional email sending"},{id:"payments",label:"Payments",description:"Stripe payment integration"},{id:"admin",label:"Admin Panel",description:"Dashboard for management"},{id:"i18n",label:"Internationalization",description:"Multi-language support"}];function we({onClose:i}){const r=z(),[c,p]=o.useState(0),[g,w]=o.useState(""),[h,E]=o.useState(""),[d,v]=o.useState(new Set),[x,f]=o.useState(new Set),l=o.useCallback(t=>{v(n=>{const m=new Set(n);return m.has(t)?m.delete(t):m.add(t),m})},[]),a=o.useCallback(t=>{f(n=>{const m=new Set(n);return m.has(t)?m.delete(t):m.add(t),m})},[]),s=()=>{switch(c){case 0:return g.trim().length>0;case 1:return d.size>0;case 2:return!0;case 3:return!0;default:return!1}},u=o.useCallback(()=>{const t=k.filter(b=>d.has(b.id)).map(b=>b.label),n=C.filter(b=>x.has(b.id)).map(b=>b.label),m=[`Build a project called "${g}"`,h?`: ${h}`:"",t.length?`
22
-
23
- Tech stack: ${t.join(", ")}`:"",n.length?`
24
- Features: ${n.join(", ")}`:""].join("");sessionStorage.setItem("pl_custom_prompt",m),r("/"),i()},[g,h,d,x,r,i]),j=k.reduce((t,n)=>(t[n.group]||(t[n.group]=[]),t[n.group].push(n),t),{});return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:t=>{t.target===t.currentTarget&&i()},children:[e.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-[95vw] max-w-[700px] overflow-hidden",style:{animation:"modal-enter 0.25s ease-out"},children:[e.jsxs("div",{className:"bg-[#FAF9F6] border-b border-[#ECEAE3] px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-lg font-bold text-[#36342E]",children:"Create Custom Template"}),e.jsx("button",{onClick:i,className:"text-[#6B6960] hover:text-[#36342E] text-sm",children:"Cancel"})]}),e.jsx("div",{className:"flex items-center gap-2",children:Y.map((t,n)=>{const m=t.icon,b=n===c,y=n<c;return e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors ${b?"bg-[#553DE9] text-white":y?"bg-[#1FC5A8]/10 text-[#1FC5A8]":"bg-[#F8F4F0] text-[#6B6960]"}`,children:[y?e.jsx(S,{size:12}):e.jsx(m,{size:12}),e.jsx("span",{className:"hidden sm:inline",children:t.label})]}),n<Y.length-1&&e.jsx("div",{className:`flex-1 h-0.5 rounded ${y?"bg-[#1FC5A8]":"bg-[#ECEAE3]"}`})]},n)})})]}),e.jsxs("div",{className:"p-6 min-h-[320px]",children:[c===0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-[#36342E] mb-1.5",children:["Project Name ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:g,onChange:t=>w(t.target.value),placeholder:"My Awesome App",className:"w-full px-4 py-2.5 text-sm bg-white border border-[#ECEAE3] rounded-lg outline-none focus:border-[#553DE9] transition-colors",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-[#36342E] mb-1.5",children:["Description ",e.jsx("span",{className:"text-xs text-[#6B6960]",children:"(optional)"})]}),e.jsx("textarea",{value:h,onChange:t=>E(t.target.value),placeholder:"Describe what your project does...",rows:4,className:"w-full px-4 py-2.5 text-sm bg-white border border-[#ECEAE3] rounded-lg outline-none focus:border-[#553DE9] transition-colors resize-none"})]})]}),c===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-[#6B6960]",children:"Select the technologies for your project."}),Object.entries(j).map(([t,n])=>e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider mb-2",children:t}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(m=>{const b=d.has(m.id);return e.jsxs("button",{onClick:()=>l(m.id),className:`px-3 py-1.5 text-sm rounded-lg border transition-colors ${b?"border-[#553DE9] bg-[#553DE9]/10 text-[#553DE9] font-medium":"border-[#ECEAE3] text-[#6B6960] hover:border-[#553DE9]/30 hover:text-[#36342E]"}`,children:[b&&e.jsx(S,{size:12,className:"inline mr-1"}),m.label]},m.id)})})]},t))]}),c===2&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-[#6B6960] mb-2",children:"Select features to include. All are optional."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:C.map(t=>{const n=x.has(t.id);return e.jsxs("button",{onClick:()=>a(t.id),className:`text-left p-3 rounded-lg border transition-colors ${n?"border-[#553DE9] bg-[#553DE9]/5":"border-[#ECEAE3] hover:border-[#553DE9]/30"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${n?"bg-[#553DE9] border-[#553DE9]":"border-[#ECEAE3]"}`,children:n&&e.jsx(S,{size:10,className:"text-white"})}),e.jsx("span",{className:`text-sm font-medium ${n?"text-[#553DE9]":"text-[#36342E]"}`,children:t.label})]}),e.jsx("p",{className:"text-xs text-[#6B6960] ml-6",children:t.description})]},t.id)})})]}),c===3&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-[#FAF9F6] rounded-lg border border-[#ECEAE3] p-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-[#36342E] mb-1",children:g||"Untitled Project"}),h&&e.jsx("p",{className:"text-xs text-[#6B6960] mb-3",children:h}),d.size>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("span",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Tech Stack"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:k.filter(t=>d.has(t.id)).map(t=>e.jsx("span",{className:"text-xs bg-[#553DE9]/10 text-[#553DE9] px-2 py-0.5 rounded font-medium",children:t.label},t.id))})]}),x.size>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Features"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:C.filter(t=>x.has(t.id)).map(t=>e.jsx("span",{className:"text-xs bg-[#1FC5A8]/10 text-[#1FC5A8] px-2 py-0.5 rounded font-medium",children:t.label},t.id))})]})]}),e.jsxs("div",{className:"bg-[#553DE9]/5 rounded-lg border border-[#553DE9]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Z,{size:15,className:"text-[#553DE9]"}),e.jsx("span",{className:"text-sm font-semibold text-[#553DE9]",children:"Generated Prompt"})]}),e.jsxs("p",{className:"text-sm text-[#6B6960] font-mono bg-white rounded border border-[#ECEAE3] p-3 text-xs leading-relaxed",children:['Build a project called "',g,'"',h?`: ${h}`:"",d.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Tech stack: ",k.filter(t=>d.has(t.id)).map(t=>t.label).join(", ")]}),x.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),"Features: ",C.filter(t=>x.has(t.id)).map(t=>t.label).join(", ")]})]})]})]})]}),e.jsxs("div",{className:"border-t border-[#ECEAE3] px-6 py-4 flex items-center justify-between",children:[e.jsx(N,{variant:"ghost",size:"md",icon:X,onClick:()=>c>0?p(c-1):i(),children:c===0?"Cancel":"Back"}),c<3?e.jsx(N,{variant:"primary",size:"md",iconRight:ee,onClick:()=>p(c+1),disabled:!s(),children:"Next"}):e.jsx(N,{variant:"primary",size:"md",icon:D,onClick:u,children:"Generate Template"})]})]}),e.jsx("style",{children:`
25
- @keyframes modal-enter {
26
- from { opacity: 0; transform: scale(0.95) translateY(10px); }
27
- to { opacity: 1; transform: scale(1) translateY(0); }
28
- }
29
- `})]})}const ve=[{key:"all",label:"All",icon:L},{key:"Website",label:"Web Apps",icon:re},{key:"API",label:"APIs",icon:ne},{key:"CLI",label:"CLIs",icon:te},{key:"Bot",label:"Bots",icon:oe},{key:"Data",label:"Data",icon:ce},{key:"Other",label:"Other",icon:L}],Q={Website:"from-violet-500 via-purple-500 to-indigo-500",API:"from-teal-500 via-emerald-500 to-cyan-500",CLI:"from-slate-500 via-gray-500 to-blue-500",Bot:"from-orange-500 via-rose-500 to-pink-500",Data:"from-blue-500 via-indigo-500 to-purple-500",Other:"from-slate-400 via-gray-400 to-zinc-500"},Ne={React:"bg-sky-500/10 text-sky-600","Node.js":"bg-green-500/10 text-green-600",Python:"bg-yellow-500/10 text-yellow-700",TypeScript:"bg-blue-500/10 text-blue-600",PostgreSQL:"bg-indigo-500/10 text-indigo-600",MongoDB:"bg-green-600/10 text-green-700",Docker:"bg-cyan-500/10 text-cyan-600",Redis:"bg-red-500/10 text-red-600",Express:"bg-gray-500/10 text-gray-600",FastAPI:"bg-teal-500/10 text-teal-600",SQLite:"bg-blue-400/10 text-blue-500",Tailwind:"bg-cyan-400/10 text-cyan-600",Discord:"bg-indigo-400/10 text-indigo-500",Slack:"bg-purple-500/10 text-purple-600",CLI:"bg-amber-500/10 text-amber-600",Playwright:"bg-green-500/10 text-green-600",Vite:"bg-purple-400/10 text-purple-500",Next:"bg-gray-600/10 text-gray-700"},H={beginner:{label:"Beginner",color:"text-green-500",bars:1},intermediate:{label:"Intermediate",color:"text-yellow-500",bars:2},advanced:{label:"Advanced",color:"text-red-400",bars:3}},Ee={"saas-starter.md":{uses:2847,rating:4.9},"rest-api-auth.md":{uses:1923,rating:4.8},"discord-bot.md":{uses:1654,rating:4.7},"full-stack-demo.md":{uses:1432,rating:4.8},"data-pipeline.md":{uses:1198,rating:4.6},"cli-tool.md":{uses:987,rating:4.7},"e-commerce.md":{uses:2156,rating:4.8},"blog-platform.md":{uses:1345,rating:4.5},"rest-api.md":{uses:1567,rating:4.6},"slack-bot.md":{uses:876,rating:4.4},"dashboard.md":{uses:1789,rating:4.7},"web-scraper.md":{uses:654,rating:4.3},"chrome-extension.md":{uses:543,rating:4.5},"microservice.md":{uses:1123,rating:4.6},"mobile-app.md":{uses:932,rating:4.4},"game.md":{uses:765,rating:4.5},"npm-library.md":{uses:445,rating:4.3},"static-landing-page.md":{uses:1876,rating:4.6},"simple-todo-app.md":{uses:2345,rating:4.7},"ai-chatbot.md":{uses:1234,rating:4.8}};function ke(i){return i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i)}function Ce({category:i}){switch(i){case"Website":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"40",y:"15",width:"160",height:"90",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"40",y1:"30",x2:"200",y2:"30",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"52",cy:"22",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"62",cy:"22",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"72",cy:"22",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("rect",{x:"50",y:"38",width:"80",height:"8",rx:"2",fill:"white",fillOpacity:"0.4"}),e.jsx("rect",{x:"50",y:"52",width:"140",height:"5",rx:"1.5",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"50",y:"62",width:"120",height:"5",rx:"1.5",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"50",y:"78",width:"45",height:"16",rx:"4",fill:"white",fillOpacity:"0.35"}),e.jsx("circle",{cx:"300",cy:"30",r:"20",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("rect",{x:"270",y:"70",width:"25",height:"25",rx:"5",fill:"none",stroke:"white",strokeWidth:"1",transform:"rotate(15 282 82)"}),e.jsx("circle",{cx:"350",cy:"90",r:"8",fill:"white",fillOpacity:"0.3"})]});case"API":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"30",y:"10",width:"180",height:"100",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"30",y1:"25",x2:"210",y2:"25",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"42",cy:"17",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"52",cy:"17",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("text",{x:"40",y:"42",fill:"white",fillOpacity:"0.5",fontSize:"8",fontFamily:"monospace",children:"{"}),e.jsx("text",{x:"48",y:"54",fill:"white",fillOpacity:"0.4",fontSize:"7",fontFamily:"monospace",children:'"status": 200,'}),e.jsx("text",{x:"48",y:"66",fill:"white",fillOpacity:"0.4",fontSize:"7",fontFamily:"monospace",children:'"data": [...]'}),e.jsx("text",{x:"40",y:"80",fill:"white",fillOpacity:"0.5",fontSize:"8",fontFamily:"monospace",children:"}"}),e.jsx("circle",{cx:"290",cy:"35",r:"12",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"340",cy:"60",r:"12",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"290",cy:"85",r:"12",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"302",y1:"35",x2:"328",y2:"60",stroke:"white",strokeWidth:"1"}),e.jsx("line",{x1:"302",y1:"85",x2:"328",y2:"60",stroke:"white",strokeWidth:"1"}),e.jsx("circle",{cx:"290",cy:"35",r:"4",fill:"white",fillOpacity:"0.4"}),e.jsx("circle",{cx:"340",cy:"60",r:"4",fill:"white",fillOpacity:"0.4"}),e.jsx("circle",{cx:"290",cy:"85",r:"4",fill:"white",fillOpacity:"0.4"})]});case"CLI":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"40",y:"12",width:"170",height:"96",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"40",y1:"27",x2:"210",y2:"27",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"52",cy:"19",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"62",cy:"19",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("text",{x:"50",y:"42",fill:"white",fillOpacity:"0.5",fontSize:"7",fontFamily:"monospace",children:"$ myapp --help"}),e.jsx("text",{x:"50",y:"54",fill:"white",fillOpacity:"0.35",fontSize:"7",fontFamily:"monospace",children:"Usage: myapp [cmd]"}),e.jsx("text",{x:"50",y:"66",fill:"white",fillOpacity:"0.35",fontSize:"7",fontFamily:"monospace",children:" init Setup"}),e.jsx("text",{x:"50",y:"78",fill:"white",fillOpacity:"0.35",fontSize:"7",fontFamily:"monospace",children:" run Execute"}),e.jsx("rect",{x:"50",y:"88",width:"6",height:"10",fill:"white",fillOpacity:"0.6"}),e.jsx("text",{x:"270",y:"50",fill:"white",fillOpacity:"0.3",fontSize:"24",fontFamily:"monospace",children:">_"}),e.jsx("circle",{cx:"350",cy:"80",r:"15",fill:"none",stroke:"white",strokeWidth:"1",strokeDasharray:"4 4"})]});case"Bot":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"40",y:"15",width:"120",height:"28",rx:"14",fill:"white",fillOpacity:"0.2"}),e.jsx("rect",{x:"50",y:"22",width:"60",height:"5",rx:"2",fill:"white",fillOpacity:"0.4"}),e.jsx("rect",{x:"80",y:"55",width:"130",height:"28",rx:"14",fill:"white",fillOpacity:"0.3"}),e.jsx("rect",{x:"90",y:"62",width:"80",height:"5",rx:"2",fill:"white",fillOpacity:"0.4"}),e.jsx("rect",{x:"50",y:"93",width:"100",height:"20",rx:"10",fill:"white",fillOpacity:"0.15"}),e.jsx("rect",{x:"60",y:"99",width:"50",height:"5",rx:"2",fill:"white",fillOpacity:"0.35"}),e.jsx("circle",{cx:"310",cy:"55",r:"25",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"302",cy:"50",r:"4",fill:"white",fillOpacity:"0.5"}),e.jsx("circle",{cx:"318",cy:"50",r:"4",fill:"white",fillOpacity:"0.5"}),e.jsx("path",{d:"M300 62 Q310 70 320 62",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"310",y1:"30",x2:"310",y2:"22",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"310",cy:"20",r:"3",fill:"white",fillOpacity:"0.5"})]});case"Data":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("ellipse",{cx:"80",cy:"30",rx:"35",ry:"10",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"45",y1:"30",x2:"45",y2:"85",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"115",y1:"30",x2:"115",y2:"85",stroke:"white",strokeWidth:"1.5"}),e.jsx("ellipse",{cx:"80",cy:"85",rx:"35",ry:"10",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("ellipse",{cx:"80",cy:"55",rx:"35",ry:"10",fill:"none",stroke:"white",strokeWidth:"0.8",strokeDasharray:"3 3"}),e.jsx("line",{x1:"140",y1:"55",x2:"200",y2:"55",stroke:"white",strokeWidth:"1.5"}),e.jsx("polygon",{points:"200,50 210,55 200,60",fill:"white",fillOpacity:"0.5"}),e.jsx("rect",{x:"230",y:"70",width:"15",height:"35",rx:"3",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"255",y:"50",width:"15",height:"55",rx:"3",fill:"white",fillOpacity:"0.3"}),e.jsx("rect",{x:"280",y:"60",width:"15",height:"45",rx:"3",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"305",y:"40",width:"15",height:"65",rx:"3",fill:"white",fillOpacity:"0.35"}),e.jsx("rect",{x:"330",y:"55",width:"15",height:"50",rx:"3",fill:"white",fillOpacity:"0.2"})]});default:return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.12]",viewBox:"0 0 400 120",children:[e.jsx("circle",{cx:"60",cy:"40",r:"25",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"340",cy:"80",r:"30",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("rect",{x:"170",y:"20",width:"35",height:"35",rx:"8",fill:"none",stroke:"white",strokeWidth:"1.5",transform:"rotate(15 187 37)"}),e.jsx("circle",{cx:"260",cy:"30",r:"10",fill:"white",fillOpacity:"0.3"}),e.jsx("circle",{cx:"120",cy:"90",r:"15",fill:"none",stroke:"white",strokeWidth:"1",strokeDasharray:"4 4"})]})}}function Se({level:i}){const r=H[i]||H.intermediate;return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(B,{size:12,className:r.color}),e.jsx("div",{className:"flex gap-0.5",children:[1,2,3].map(c=>e.jsx("div",{className:`w-1.5 h-3 rounded-sm ${c<=r.bars?"bg-current "+r.color:"bg-[#ECEAE3]"}`},c))}),e.jsx("span",{className:`text-[10px] font-medium ${r.color}`,children:r.label})]})}function De(i){return i.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function Ue(){const i=z(),[r,c]=o.useState("all"),[p,g]=o.useState(""),[w,h]=o.useState(null),[E,d]=o.useState(!1),v=o.useCallback(()=>J.getTemplates(),[]),{data:x}=se(v,6e4,!0),f=x,l=o.useMemo(()=>{if(!f)return[];let s=f;if(r!=="all"&&(s=s.filter(u=>(u.category||"Other")===r)),p.trim()){const u=p.toLowerCase();s=s.filter(j=>j.name.toLowerCase().includes(u)||(j.description||"").toLowerCase().includes(u)||(j.tech_stack||[]).some(t=>t.toLowerCase().includes(u)))}return s},[f,r,p]),a=s=>{sessionStorage.setItem("pl_template",s),i("/")};return e.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold mb-2",children:e.jsx("span",{className:"bg-gradient-to-r from-[#553DE9] via-[#7B6BEF] to-[#553DE9] bg-clip-text text-transparent",children:"Start with a Template"})}),e.jsx("p",{className:"text-[#6B6960] text-sm max-w-lg mx-auto mb-6",children:"Choose a starting point and customize with AI. Each template is a complete spec ready to become your next project."}),e.jsxs("div",{className:"relative max-w-xl mx-auto mb-5",children:[e.jsx(W,{size:18,className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#6B6960]"}),e.jsx("input",{type:"text",value:p,onChange:s=>g(s.target.value),placeholder:"Search templates by name, tech, or category...",className:"w-full pl-11 pr-4 py-3 text-sm bg-white border border-[#ECEAE3] rounded-xl outline-none focus:border-[#553DE9] focus:ring-2 focus:ring-[#553DE9]/10 transition-all shadow-sm"}),p&&e.jsx("button",{onClick:()=>g(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-[#6B6960] hover:text-[#36342E] bg-[#F8F4F0] px-2 py-0.5 rounded",children:"Clear"})]}),e.jsx("div",{className:"flex items-center justify-center gap-1.5 flex-wrap",role:"tablist",children:ve.map(s=>{const u=s.icon,j=f?s.key==="all"?f.length:f.filter(t=>(t.category||"Other")===s.key).length:0;return e.jsxs("button",{role:"tab","aria-selected":r===s.key,onClick:()=>c(s.key),className:`flex items-center gap-1.5 px-3.5 py-2 text-xs font-semibold rounded-lg transition-all whitespace-nowrap ${r===s.key?"bg-[#553DE9] text-white shadow-sm":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0] bg-white border border-[#ECEAE3]"}`,children:[e.jsx(u,{size:14}),s.label,f&&e.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded-full ${r===s.key?"bg-white/20 text-white":"bg-[#F8F4F0] text-[#6B6960]"}`,children:j})]},s.key)})})]}),!p&&r==="all"&&f&&f.length>0&&e.jsx(be,{templates:f,onSelect:a,onPreview:h}),f?l.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(W,{size:32,className:"mx-auto text-[#ECEAE3] mb-3"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-1",children:"No templates match your search."}),e.jsx("p",{className:"text-xs text-[#939084] mb-3",children:"Try different keywords or browse a category."}),p&&e.jsx("button",{onClick:()=>{g(""),c("all")},className:"text-xs text-[#553DE9] hover:underline font-medium",children:"Clear all filters"})]}):e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:[l.map(s=>{const u=s.category||"Other",j=Q[u]||Q.Other,t=s.tech_stack||[],n=s.difficulty||"intermediate",m=s.build_time||"5-10 min",b=Ee[s.filename]||{uses:Math.floor(Math.random()*800)+100,rating:(Math.random()*.7+4).toFixed(1)};return e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>h(s),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(s))},className:"bg-white border border-[#ECEAE3] rounded-xl shadow-card hover:shadow-card-hover hover:-translate-y-0.5 transition-all duration-200 cursor-pointer overflow-hidden group",children:[e.jsxs("div",{className:`h-32 bg-gradient-to-br ${j} relative overflow-hidden`,children:[e.jsx(Ce,{category:u}),e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:u})}),t.length>0&&e.jsxs("div",{className:"absolute bottom-3 left-3 right-3 flex items-center gap-1.5",children:[t.slice(0,3).map(y=>e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:y},y)),t.length>3&&e.jsxs("span",{className:"text-[10px] text-white/70 bg-white/15 backdrop-blur-sm px-1.5 py-0.5 rounded",children:["+",t.length-3]})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-sm font-bold text-[#36342E] mb-1 group-hover:text-[#553DE9] transition-colors",children:De(s.name)}),e.jsx("p",{className:"text-xs text-[#6B6960] line-clamp-2 mb-3 min-h-[2.4em]",children:s.description||s.filename}),t.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.map(y=>e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 text-[10px] font-medium rounded ${Ne[y]||"bg-[#F8F4F0] text-[#6B6960]"}`,children:y},y))}),e.jsxs("div",{className:"flex items-center gap-3 mb-3 text-[10px] text-[#6B6960]",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(V,{size:10}),ke(typeof b.uses=="number"?b.uses:0)," uses"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{size:10,className:"text-[#D4A03C]",fill:"#D4A03C"}),b.rating]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Se,{level:n}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#6B6960]",children:[e.jsx(I,{size:11}),e.jsx("span",{children:m})]})]}),e.jsx(N,{size:"sm",icon:D,onClick:y=>{y.stopPropagation(),a(s.filename)},className:"opacity-0 group-hover:opacity-100 transition-opacity",children:"Use"})]})]})]},s.filename)}),e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>d(!0),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),d(!0))},className:"bg-white border-2 border-dashed border-[#ECEAE3] rounded-xl hover:border-[#553DE9]/30 hover:bg-[#553DE9]/[0.02] transition-all duration-200 cursor-pointer overflow-hidden group flex flex-col items-center justify-center min-h-[320px]",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-[#553DE9]/10 flex items-center justify-center mb-4 group-hover:bg-[#553DE9]/15 transition-colors",children:e.jsx(de,{size:28,className:"text-[#553DE9]"})}),e.jsx("h3",{className:"text-sm font-bold text-[#36342E] mb-1 group-hover:text-[#553DE9] transition-colors",children:"Create Your Own"}),e.jsx("p",{className:"text-xs text-[#6B6960] text-center px-6 max-w-[200px]",children:"Design a custom template with your preferred stack and features"})]})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:[1,2,3,4,5,6].map(s=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl shadow-card overflow-hidden animate-pulse",children:[e.jsx("div",{className:"h-32 bg-gradient-to-br from-[#ECEAE3]/30 to-[#ECEAE3]/10"}),e.jsxs("div",{className:"p-4 space-y-2",children:[e.jsx("div",{className:"h-4 bg-[#ECEAE3]/40 rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-[#ECEAE3]/30 rounded w-full"}),e.jsx("div",{className:"h-3 bg-[#ECEAE3]/20 rounded w-1/2"}),e.jsxs("div",{className:"flex gap-1 mt-2",children:[e.jsx("div",{className:"h-5 w-14 bg-[#ECEAE3]/30 rounded"}),e.jsx("div",{className:"h-5 w-14 bg-[#ECEAE3]/30 rounded"})]})]})]},s))}),w&&e.jsx(je,{template:w,onClose:()=>h(null)}),E&&e.jsx(we,{onClose:()=>d(!1)})]})}export{Ue as default};
@@ -1,11 +0,0 @@
1
- import{c as o}from"./index-DvZ0Kk2x.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],t=o("copy",e);/**
7
- * @license lucide-react v0.577.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const a=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],d=o("folder-open",a);export{t as C,d as F};