@zenith-open/zenithcms-admin 1.0.0-beta.8 → 1.0.1-beta.1

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 (39) hide show
  1. package/dist/assets/{ApiExplorerPage-DhdnjvFP.js → ApiExplorerPage-85UWt1EW.js} +1 -1
  2. package/dist/assets/{ApiExplorerPage-DhdnjvFP.js.map → ApiExplorerPage-85UWt1EW.js.map} +1 -1
  3. package/dist/assets/{AuditLogPage-TYWW1lG9.js → AuditLogPage-CwULx1tr.js} +1 -1
  4. package/dist/assets/{AuditLogPage-TYWW1lG9.js.map → AuditLogPage-CwULx1tr.js.map} +1 -1
  5. package/dist/assets/{BlockBuilderPage-CdheJ_nw.js → BlockBuilderPage-XD1IjOgx.js} +1 -1
  6. package/dist/assets/{BlockBuilderPage-CdheJ_nw.js.map → BlockBuilderPage-XD1IjOgx.js.map} +1 -1
  7. package/dist/assets/{CollectionHooksPage-CbnXaL4D.js → CollectionHooksPage-DIaSrKDj.js} +1 -1
  8. package/dist/assets/{CollectionHooksPage-CbnXaL4D.js.map → CollectionHooksPage-DIaSrKDj.js.map} +1 -1
  9. package/dist/assets/{CollectionsPage-PZFwuhHd.js → CollectionsPage-CL_t5JRI.js} +1 -1
  10. package/dist/assets/{CollectionsPage-PZFwuhHd.js.map → CollectionsPage-CL_t5JRI.js.map} +1 -1
  11. package/dist/assets/{ComponentBuilderPage-BC4Ea9AX.js → ComponentBuilderPage-C58Rr1cu.js} +1 -1
  12. package/dist/assets/{ComponentBuilderPage-BC4Ea9AX.js.map → ComponentBuilderPage-C58Rr1cu.js.map} +1 -1
  13. package/dist/assets/{DashboardBuilder-C9W1ggsK.js → DashboardBuilder-Chjyqyb7.js} +1 -1
  14. package/dist/assets/{DashboardBuilder-C9W1ggsK.js.map → DashboardBuilder-Chjyqyb7.js.map} +1 -1
  15. package/dist/assets/{PluginsPage-jOgKwIzK.js → PluginsPage-DAR4Fsz-.js} +1 -1
  16. package/dist/assets/{PluginsPage-jOgKwIzK.js.map → PluginsPage-DAR4Fsz-.js.map} +1 -1
  17. package/dist/assets/{RedirectsPage-CpZ6qVGA.js → RedirectsPage-DfMTJsac.js} +1 -1
  18. package/dist/assets/{RedirectsPage-CpZ6qVGA.js.map → RedirectsPage-DfMTJsac.js.map} +1 -1
  19. package/dist/assets/{SchemaBuilderPage-D6jCyURY.js → SchemaBuilderPage-BYprOkEv.js} +1 -1
  20. package/dist/assets/{SchemaBuilderPage-D6jCyURY.js.map → SchemaBuilderPage-BYprOkEv.js.map} +1 -1
  21. package/dist/assets/{SettingsPage-BZn_S20X.js → SettingsPage-B2r_uNVc.js} +1 -1
  22. package/dist/assets/{SettingsPage-BZn_S20X.js.map → SettingsPage-B2r_uNVc.js.map} +1 -1
  23. package/dist/assets/{SpatialEditor-PCM56yAC.js → SpatialEditor-BohlovfE.js} +1 -1
  24. package/dist/assets/{SpatialEditor-PCM56yAC.js.map → SpatialEditor-BohlovfE.js.map} +1 -1
  25. package/dist/assets/{TemplatesPage-CaZgoHEq.js → TemplatesPage-BplB2ksb.js} +1 -1
  26. package/dist/assets/{TemplatesPage-CaZgoHEq.js.map → TemplatesPage-BplB2ksb.js.map} +1 -1
  27. package/dist/assets/{TrashPage-BYiY8Xrn.js → TrashPage-BIhKrs5x.js} +1 -1
  28. package/dist/assets/{TrashPage-BYiY8Xrn.js.map → TrashPage-BIhKrs5x.js.map} +1 -1
  29. package/dist/assets/{index-BkjytCms.js → index-yE_3fruG.js} +3 -3
  30. package/dist/assets/index-yE_3fruG.js.map +1 -0
  31. package/dist/index.html +4 -4
  32. package/dist/manifest.webmanifest +1 -0
  33. package/dist/sw.js +1 -1
  34. package/dist/sw.js.map +1 -1
  35. package/dist/{workbox-9c191d2f.js → workbox-2fbc6a65.js} +3 -3
  36. package/dist/workbox-2fbc6a65.js.map +1 -0
  37. package/package.json +3 -3
  38. package/dist/assets/index-BkjytCms.js.map +0 -1
  39. package/dist/workbox-9c191d2f.js.map +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{B as t,E as n,Fn as r,H as i,Ht as a,Jn as o,Jt as s,Mn as c,Mt as l,Nt as u,Pt as d,Qt as f,Rn as p,Ut as m,_n as h,cn as g,ir as _,l as v,rr as y,vr as b,wn as x,xr as S}from"./vendor-react-DQVTOTFO.js";import{a as C,o as w,t as T}from"./utils-fgvbH6CB.js";import{d as E,f as D,p as O}from"./index-BkjytCms.js";var k=e(S(),1),A=b(),j=()=>{let[e,b]=(0,k.useState)([]),{theme:S}=C(),j=localStorage.getItem(`activeSiteSlug`)||``,[M,ee]=(0,k.useState)(``),[N,P]=(0,k.useState)(`All`),[F,I]=(0,k.useState)(null),[L,R]=(0,k.useState)(!1),[z,B]=(0,k.useState)(`vercel`),[V,H]=(0,k.useState)(0),[U,W]=(0,k.useState)([]),[G,K]=(0,k.useState)(``),[q,J]=(0,k.useState)(!1),Y=(0,k.useRef)(null),X=(0,k.useRef)(null),Z=(0,k.useRef)(null);(0,k.useEffect)(()=>(w.get(`/system/templates`).then(e=>{b(e.data.templates||[])}).catch(e=>console.error(`Failed to load templates`,e)),()=>{Y.current&&clearInterval(Y.current),X.current&&clearInterval(X.current),Z.current&&clearInterval(Z.current)}),[]);let Q=[`All`,`E-Commerce / Portfolio`,`Editorial / Blog`],$=e.filter(e=>{let t=e.name.toLowerCase().includes(M.toLowerCase())||e.description.toLowerCase().includes(M.toLowerCase())||e.tags.some(e=>e.toLowerCase().includes(M.toLowerCase())),n=N===`All`||e.category===N;return t&&n}),te=()=>{if(!F)return;H(1),W([]);let e=[`[system] Initializing deployment protocol for @zenith-open/${F.slug}...`,`[system] Selected target provider: ${z.toUpperCase()}`,`[git] Cloning repository from ${F.gitUrl}...`,`[git] Branch: main (HEAD resolved to latest secure release v${F.version})`,`[system] Provisioning sandbox container on global edge node...`,`[system] Installing workspace dependencies via pnpm...`,`[build] Resolving node modules: 173 packages successfully installed.`,`[build] Starting project compile step: "pnpm run build"...`,`[build] vite v1.0.0-beta building for production...`,`[build] 42 modules transformed.`,`[build] dist/assets/index-D8g9sK.js 142.64 kB │ gzip: 43.12 kB`,`[build] dist/assets/index-C1h8aD.css 31.42 kB │ gzip: 8.94 kB`,`[build] built in 1.48s`,`[system] Bundle generated successfully!`,`[network] Uploading assets to global Edge CDN caching layers...`,`[network] Synchronizing routing configurations & static revalidation rules...`,`[network] Activating secure SameSite=Strict endpoints and HTTPS configurations...`,`[system] Deployment completed. SSL handshake verified!`],t=0,n=setInterval(()=>{if(t<6)W(n=>[...n,e[t]]),t++;else{clearInterval(n),Y.current=null,H(2);let t=6,r=setInterval(()=>{if(t<13)W(n=>[...n,e[t]]),t++;else{clearInterval(r),X.current=null,H(3);let t=13,n=setInterval(()=>{t<e.length?(W(n=>[...n,e[t]]),t++):(clearInterval(n),Z.current=null,H(4),K(`https://zenith-${F.slug}.${z}.app`),v.success(`Storefront successfully deployed!`))},800);Z.current=n}},600);X.current=r}},450);Y.current=n},ne=e=>{navigator.clipboard.writeText(e),J(!0),v.success(`Live URL copied to clipboard!`),setTimeout(()=>J(!1),2e3)};return(0,A.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-64px)] overflow-hidden`,children:[(0,A.jsx)(O,{title:`Templates`,actions:(0,A.jsx)(`div`,{className:T(`p-1 rounded-none-none border flex items-center shadow-sm backdrop-blur-xl`,`bg-z-panel border-z-border shadow-sm`),children:Q.map(e=>(0,A.jsx)(`button`,{onClick:()=>P(e),className:T(`px-4 py-2 text-sm font-semibold rounded-none-none transition-all leading-none whitespace-nowrap`,N===e?S===`dark`?`bg-z-panel text-z-primary shadow-lg`:`bg-z-accent text-z-primary shadow-lg`:`text-z-secondary hover:text-z-primary`),children:e},e))})}),(0,A.jsxs)(`div`,{className:T(`flex-1 overflow-y-auto p-6 md:p-10 space-y-8 transition-colors duration-500 relative pb-12`,S===`dark`?`bg-app text-z-primary`:`bg-[#fafafa] text-z-primary`),children:[(0,A.jsxs)(`div`,{className:T(`relative p-6 md:p-8 overflow-hidden border backdrop-blur-xl shadow-xl flex flex-col md:flex-row md:items-center md:justify-between gap-6 transition-all`,S===`dark`?`bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-[var(--z-border)]`:`bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-sm`),children:[(0,A.jsx)(`div`,{className:`absolute top-0 right-0 w-80 h-80 bg-z-panel blur-[100px] pointer-events-none rounded-none-none`}),(0,A.jsx)(`div`,{className:`absolute bottom-0 left-0 w-80 h-80 bg-z-hover blur-[100px] pointer-events-none rounded-none-none`}),(0,A.jsxs)(`div`,{className:`flex-1 space-y-2 z-10`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-z-secondary `,children:[(0,A.jsx)(c,{size:16,className:`animate-pulse`}),(0,A.jsx)(`span`,{className:`text-sm font-semibold`,children:`Sandbox`})]}),(0,A.jsx)(`h2`,{className:`text-2xl font-semibold leading-tight`,children:`Deploy Templates`})]}),(0,A.jsxs)(`div`,{className:T(`flex items-center gap-4 px-5 py-3 rounded-none-none border shadow-inner w-full md:max-w-xs transition-all group z-10 shrink-0 self-start md:self-auto`,S===`dark`?`bg-z-hover border-z-border`:`bg-z-panel border-z-border shadow-sm shadow-sm`),children:[(0,A.jsx)(i,{size:14,className:`text-z-secondary group-focus-within:text-z-secondary transition-colors`}),(0,A.jsx)(`input`,{type:`text`,placeholder:`Filter by tech or tags...`,value:M,onChange:e=>ee(e.target.value),className:`bg-transparent border-none outline-none focus-visible:ring-2 focus-visible:ring-z-active-border focus-visible:ring-offset-1 focus-visible:ring-offset-black text-sm font-semibold text-z-muted w-full placeholder:text-z-secondary`})]})]}),$.length===0?(0,A.jsxs)(`div`,{className:`py-24 flex flex-col items-center justify-center gap-4 opacity-30 border border-dashed border-z-border`,children:[(0,A.jsx)(r,{size:40,strokeWidth:1,className:`text-z-secondary animate-pulse`}),(0,A.jsx)(`p`,{className:`text-sm font-semibold`,children:`No templates matching filters found`})]}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:(0,A.jsx)(_,{mode:`popLayout`,children:$.map(e=>(0,A.jsx)(E,{interactive:!0,padding:`none`,className:`flex flex-col relative group`,children:(0,A.jsxs)(D,{className:`flex flex-col flex-1 gap-6`,children:[(0,A.jsx)(`div`,{className:T(`absolute top-0 left-0 right-0 h-1 bg-gradient-to-r opacity-60 group-hover:opacity-100 transition-opacity`,e.primaryColor)}),(0,A.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary`,children:e.category}),(0,A.jsx)(`span`,{className:`w-1 h-1 bg-z-border rounded-none-none`}),(0,A.jsxs)(`span`,{className:`text-sm font-mono font-semibold text-z-secondary`,children:[`v`,e.version]}),e.slug===j&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 bg-z-panel text-z-secondary border border-z-border/20 text-sm font-semibold leading-none`,children:[(0,A.jsx)(x,{size:8}),`Active Workspace / Site`]})]}),(0,A.jsx)(`h3`,{className:`text-xl font-semibold leading-none group-hover:text-z-secondary transition-colors mt-1.5`,children:e.name})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary leading-none`,children:`Lighthouse`}),(0,A.jsxs)(`span`,{className:`text-lg font-semibold text-z-secondary mt-1`,children:[e.performanceScore,`%`]})]}),(0,A.jsx)(`div`,{className:`w-9 h-9 rounded-none-none border border-z-border/20 bg-z-hover flex items-center justify-center text-z-secondary font-bold text-xs`,children:e.performanceScore})]})]}),(0,A.jsxs)(`div`,{className:T(`w-full h-40 rounded-none-none relative overflow-hidden border transition-all duration-500 flex items-center justify-center group-hover:scale-[1.01]`,S===`dark`?`bg-app border-z-border`:`bg-z-input border-z-border shadow-sm`),children:[(0,A.jsx)(`div`,{className:`absolute inset-0 bg-grid-pattern opacity-[0.03] pointer-events-none`}),(0,A.jsx)(`div`,{className:T(`absolute w-48 h-48 rounded-none-none blur-[60px] opacity-20 bg-gradient-to-br`,e.primaryColor)}),(0,A.jsxs)(`div`,{className:`w-5/6 h-2/3 border border-z-border rounded-none-none bg-z-panel backdrop-blur-md p-4 flex flex-col justify-between shadow-2xl relative overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,A.jsx)(`div`,{className:`w-2 h-2 rounded-none-none bg-red-500/40`}),(0,A.jsx)(`div`,{className:`w-2 h-2 rounded-none-none bg-yellow-500/40`}),(0,A.jsx)(`div`,{className:`w-2 h-2 rounded-none-none bg-green-500/40`})]}),(0,A.jsx)(`div`,{className:`px-2 py-0.5 bg-z-hover border border-z-border rounded-none-none text-sm font-mono text-z-secondary`,children:`SECURE_SSL`})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5 my-2`,children:[(0,A.jsx)(`div`,{className:`h-2 w-1/3 bg-z-hover rounded-none-none`}),(0,A.jsx)(`div`,{className:`h-1.5 w-2/3 bg-z-hover rounded-none-none`}),(0,A.jsx)(`div`,{className:`h-1.5 w-1/2 bg-z-hover rounded-none-none`})]}),(0,A.jsxs)(`div`,{className:`flex justify-between items-center pt-2 border-t border-z-border`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1 text-z-secondary text-sm font-semibold`,children:[(0,A.jsx)(p,{size:8}),` `,e.id===`storefront-glass`?`Glassmorphism`:e.id===`storefront-editorial`?`Editorial`:e.id===`blog-demo`?`Dev Blog`:`E-Commerce`]}),(0,A.jsx)(`div`,{className:`w-8 h-3 bg-z-hover rounded-none-none`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary leading-none`,children:`Core Specifications`}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 mt-1`,children:e.features.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-z-secondary`,children:[(0,A.jsx)(`div`,{className:`w-1.5 h-1.5 bg-z-border/40 border border-z-border rounded-none-none shrink-0`}),(0,A.jsx)(`span`,{className:`truncate`,children:e})]},t))})]}),(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.tags.map(e=>(0,A.jsx)(`span`,{className:T(`px-2 py-1 text-sm font-mono font-semibold border rounded-none-none shadow-sm`,S===`dark`?`bg-z-hover border-z-border text-z-secondary`:`bg-[var(--z-bg-hover)] border-z-border text-z-secondary`),children:e},e))}),(0,A.jsxs)(`div`,{className:T(`p-3 border rounded-none-none flex items-center justify-between gap-3 text-sm font-mono`,S===`dark`?`bg-app border-z-border text-z-muted`:`bg-z-input border-z-border text-z-secondary`),children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 truncate`,children:[(0,A.jsx)(n,{size:10,className:`text-z-secondary`}),(0,A.jsxs)(`span`,{className:`truncate select-all`,children:[`git clone `,e.gitUrl,`.git`]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,A.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(`git clone ${e.gitUrl}.git`),v.success(`Clone command copied!`)},className:T(`p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95`,S===`dark`?`border-z-border bg-z-hover hover:text-z-primary`:`border-z-border bg-z-panel hover:text-z-primary`),title:`Copy clone command`,children:(0,A.jsx)(s,{size:10})}),(0,A.jsx)(`a`,{href:`${e.gitUrl}/archive/refs/heads/main.zip`,className:T(`p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95`,S===`dark`?`border-z-border bg-z-hover text-z-muted hover:text-z-primary`:`border-z-border bg-z-panel text-z-secondary hover:text-z-primary`),title:`Download ZIP`,children:(0,A.jsx)(m,{size:10})})]})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-z-border mt-auto flex items-center justify-between gap-4`,children:[(0,A.jsxs)(`a`,{href:e.gitUrl,target:`_blank`,rel:`noreferrer`,className:T(`px-4 py-3 border rounded-none-none text-sm font-semibold transition-all leading-none flex items-center gap-2 group/git`,S===`dark`?`border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border`:`border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong shadow-sm`),children:[(0,A.jsx)(u,{size:12,className:`group-hover/git:rotate-12 transition-transform`}),`Git Repository`,(0,A.jsx)(a,{size:10,className:`opacity-40 group-hover/git:opacity-100 transition-opacity`})]}),(0,A.jsxs)(`button`,{onClick:()=>{I(e),H(0),R(!0)},className:T(`px-5 py-3 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary`,e.primaryColor),style:{boxShadow:`0 4px 15px -4px ${e.accentColor}33`},children:[(0,A.jsx)(f,{size:12,className:`animate-bounce`}),`Deploy Instance`,(0,A.jsx)(h,{size:10,className:`group-hover:translate-x-0.5 transition-transform`})]})]})]})},e.id))})}),(0,A.jsx)(_,{children:L&&F&&(0,A.jsxs)(`div`,{className:`fixed inset-0 z-55 flex items-center justify-center p-4`,children:[(0,A.jsx)(y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>{V===0||V===4?R(!1):v.error(`Build sequence in progress. Please wait for termination.`)},className:`absolute inset-0 bg-[var(--z-bg-modal)] backdrop-blur-xl`}),(0,A.jsxs)(y.div,{initial:{scale:.95,opacity:0,y:10},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:10},transition:{duration:.35,ease:[.16,1,.3,1]},className:T(`w-full max-w-2xl border rounded-none-none p-6 md:p-8 flex flex-col gap-6 relative shadow-2xl overflow-hidden z-10`,S===`dark`?`bg-app border-z-border`:`bg-z-panel border-z-border`),children:[(0,A.jsx)(`div`,{className:T(`absolute top-0 left-0 right-0 h-1.5 bg-gradient-to-r`,F.primaryColor)}),(V===0||V===4)&&(0,A.jsx)(`button`,{onClick:()=>R(!1),className:T(`absolute top-6 right-6 w-8 h-8 rounded-none-none border flex items-center justify-center text-z-secondary hover:text-z-primary transition-all`,S===`dark`?`bg-z-hover border-z-border`:`bg-z-input border-z-border`)}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsx)(`div`,{className:T(`w-10 h-10 rounded-none-none flex items-center justify-center text-z-primary`,F.primaryColor),children:(0,A.jsx)(t,{size:18})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary block`,children:`Zero-Config Handshake`}),(0,A.jsx)(`h3`,{className:`text-xl font-semibold leading-none mt-1`,children:V===4?`Deploy Successful!`:`Deploying ${F.name}`})]})]}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-2 border-b border-z-border pb-5`,children:[{label:`Configure`,activeStep:0},{label:`Connect Repo`,activeStep:1},{label:`Compile Code`,activeStep:2},{label:`Route Domain`,activeStep:3}].map((e,t)=>{let n=V>e.activeStep||V===4,r=V===e.activeStep;return(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`div`,{className:T(`h-1 w-full rounded-none-none transition-all duration-500`,n?`bg-z-border shadow-sm`:r?`bg-amber-500 animate-pulse`:`bg-z-hover`)}),(0,A.jsxs)(`span`,{className:T(`text-sm font-semibold leading-none mt-0.5`,n||r?`text-z-primary`:`text-z-secondary`),children:[t+1,`. `,e.label]})]},t)})}),(0,A.jsxs)(`div`,{className:`min-h-[220px] flex flex-col justify-between gap-5`,children:[V===0&&(0,A.jsxs)(`div`,{className:`space-y-5`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`label`,{className:`text-sm font-semibold text-z-secondary leading-none`,children:`1. Select Cloud Deployment Target`}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[{id:`vercel`,name:`Vercel Edge`,latency:`Fastest`},{id:`netlify`,name:`Netlify CDN`,latency:`Stable`},{id:`cloudflare`,name:`Cloudflare Pages`,latency:`Zero-Lag`}].map(e=>(0,A.jsxs)(`button`,{onClick:()=>B(e.id),className:T(`border p-3 flex flex-col items-center justify-center gap-2 rounded-none-none transition-all group relative`,z===e.id?`bg-z-panel border-z-border text-z-primary shadow-sm`:`bg-z-panel border-z-border text-z-secondary hover:text-z-secondary hover:border-z-border`),children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold`,children:e.name}),(0,A.jsx)(`span`,{className:T(`text-sm font-mono px-1.5 py-0.5 rounded-none-none border`,z===e.id?`border-z-border/30 text-z-secondary bg-z-hover`:`border-z-border text-z-secondary bg-z-hover`),children:e.latency})]},e.id))})]}),(0,A.jsxs)(`div`,{className:T(`p-4 border rounded-none-none flex items-center justify-between gap-4`,S===`dark`?`bg-z-panel/5 border-z-border`:`bg-z-input border-z-border shadow-sm`),children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(d,{size:16,className:`text-z-secondary`}),(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[(0,A.jsxs)(`span`,{className:`text-sm font-semibold leading-none text-z-primary`,children:[`AmanTShekar/`,F.slug]}),(0,A.jsx)(`span`,{className:`text-sm font-bold text-z-secondary mt-1`,children:`GitHub Repository Handshake`})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1 text-sm font-mono text-z-secondary px-2 py-1 bg-z-hover border border-z-border/20`,children:`● CONNECTED`})]}),(0,A.jsx)(`div`,{className:`pt-4 border-t border-z-border flex justify-end`,children:(0,A.jsxs)(`button`,{onClick:te,className:T(`px-8 py-3.5 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary`,F.primaryColor),children:[(0,A.jsx)(f,{size:12}),`Trigger Pipeline`]})})]}),(V===1||V===2||V===3)&&(0,A.jsxs)(`div`,{className:`space-y-4 flex-1 flex flex-col`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsx)(n,{size:14,className:`text-z-secondary`}),(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary`,children:`Simulated Edge Console Output`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-none-none bg-amber-500 animate-ping`}),(0,A.jsx)(`span`,{className:`text-sm font-mono text-amber-500 font-semibold`,children:V===1?`GIT_FETCH`:V===2?`COMPILING`:`EDGE_ROUTING`})]})]}),(0,A.jsxs)(`div`,{className:`flex-1 min-h-[160px] bg-app border border-z-border p-4 font-mono text-sm text-z-muted overflow-y-auto space-y-1.5 scroll-smooth`,children:[U.map((e,t)=>(0,A.jsxs)(`div`,{className:T(`leading-relaxed `,e.startsWith(`[error]`)?`text-red-500`:e.startsWith(`[build]`)?`text-z-secondary`:e.startsWith(`[network]`)?`text-z-active-text`:`text-z-secondary`),children:[(0,A.jsxs)(`span`,{className:`text-z-secondary mr-2`,children:[`[`,t+1,`]`]}),e]},t)),(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,A.jsxs)(`span`,{className:`text-z-secondary mr-2`,children:[`[`,U.length+1,`]`]}),(0,A.jsx)(`div`,{className:`w-1.5 h-3 bg-z-border animate-pulse`})]})]})]}),V===4&&(0,A.jsxs)(`div`,{className:`space-y-6 text-center py-4`,children:[(0,A.jsx)(y.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{type:`spring`,stiffness:200,damping:15},className:`w-16 h-16 bg-z-panel border border-z-border/30 rounded-none-none flex items-center justify-center mx-auto text-z-secondary shadow-sm`,children:(0,A.jsx)(o,{size:32,strokeWidth:2.5})}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h4`,{className:`text-lg font-semibold leading-none text-z-primary`,children:`Production Live Ready`}),(0,A.jsx)(`p`,{className:`text-sm text-z-secondary max-w-sm mx-auto leading-relaxed`,children:`Continuous deployment webhook registered. Updates pushed to git main will trigger regenerations.`})]}),(0,A.jsxs)(`div`,{className:T(`max-w-md mx-auto p-4 border rounded-none-none flex items-center justify-between gap-4 bg-z-panel`,S===`dark`?`border-z-border`:`border-z-border shadow-sm`),children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,A.jsx)(l,{size:16,className:`text-z-secondary shrink-0`}),(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-primary truncate font-mono`,children:G})]}),(0,A.jsx)(`button`,{onClick:()=>ne(G),className:T(`p-2.5 rounded-none-none border transition-all flex items-center justify-center shrink-0`,q?`bg-z-panel border-z-border/30 text-z-secondary`:`bg-z-hover border-z-border text-z-muted hover:text-z-primary`),children:q?(0,A.jsx)(g,{size:14}):(0,A.jsx)(s,{size:14})})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-z-border flex items-center justify-between gap-4 max-w-md mx-auto`,children:[(0,A.jsx)(`button`,{onClick:()=>R(!1),className:T(`w-full py-3.5 border rounded-none-none text-sm font-semibold transition-all leading-none`,S===`dark`?`border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border`:`border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong`),children:`Dismiss Console`}),(0,A.jsxs)(`a`,{href:G,target:`_blank`,rel:`noreferrer`,className:T(`w-full py-3.5 rounded-none-none text-sm font-semibold transition-all leading-none flex items-center justify-center gap-2 text-z-primary`,F.primaryColor),children:[`Launch Storefront`,(0,A.jsx)(a,{size:10})]})]})]})]})]})]})})]})]})};export{j as default};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{B as t,E as n,Fn as r,H as i,Ht as a,Jn as o,Jt as s,Mn as c,Mt as l,Nt as u,Pt as d,Qt as f,Rn as p,Ut as m,_n as h,cn as g,ir as _,l as v,rr as y,vr as b,wn as x,xr as S}from"./vendor-react-DQVTOTFO.js";import{a as C,o as w,t as T}from"./utils-fgvbH6CB.js";import{d as E,f as D,p as O}from"./index-yE_3fruG.js";var k=e(S(),1),A=b(),j=()=>{let[e,b]=(0,k.useState)([]),{theme:S}=C(),j=localStorage.getItem(`activeSiteSlug`)||``,[M,ee]=(0,k.useState)(``),[N,P]=(0,k.useState)(`All`),[F,I]=(0,k.useState)(null),[L,R]=(0,k.useState)(!1),[z,B]=(0,k.useState)(`vercel`),[V,H]=(0,k.useState)(0),[U,W]=(0,k.useState)([]),[G,K]=(0,k.useState)(``),[q,J]=(0,k.useState)(!1),Y=(0,k.useRef)(null),X=(0,k.useRef)(null),Z=(0,k.useRef)(null);(0,k.useEffect)(()=>(w.get(`/system/templates`).then(e=>{b(e.data.templates||[])}).catch(e=>console.error(`Failed to load templates`,e)),()=>{Y.current&&clearInterval(Y.current),X.current&&clearInterval(X.current),Z.current&&clearInterval(Z.current)}),[]);let Q=[`All`,`E-Commerce / Portfolio`,`Editorial / Blog`],$=e.filter(e=>{let t=e.name.toLowerCase().includes(M.toLowerCase())||e.description.toLowerCase().includes(M.toLowerCase())||e.tags.some(e=>e.toLowerCase().includes(M.toLowerCase())),n=N===`All`||e.category===N;return t&&n}),te=()=>{if(!F)return;H(1),W([]);let e=[`[system] Initializing deployment protocol for @zenith-open/${F.slug}...`,`[system] Selected target provider: ${z.toUpperCase()}`,`[git] Cloning repository from ${F.gitUrl}...`,`[git] Branch: main (HEAD resolved to latest secure release v${F.version})`,`[system] Provisioning sandbox container on global edge node...`,`[system] Installing workspace dependencies via pnpm...`,`[build] Resolving node modules: 173 packages successfully installed.`,`[build] Starting project compile step: "pnpm run build"...`,`[build] vite v1.0.0-beta building for production...`,`[build] 42 modules transformed.`,`[build] dist/assets/index-D8g9sK.js 142.64 kB │ gzip: 43.12 kB`,`[build] dist/assets/index-C1h8aD.css 31.42 kB │ gzip: 8.94 kB`,`[build] built in 1.48s`,`[system] Bundle generated successfully!`,`[network] Uploading assets to global Edge CDN caching layers...`,`[network] Synchronizing routing configurations & static revalidation rules...`,`[network] Activating secure SameSite=Strict endpoints and HTTPS configurations...`,`[system] Deployment completed. SSL handshake verified!`],t=0,n=setInterval(()=>{if(t<6)W(n=>[...n,e[t]]),t++;else{clearInterval(n),Y.current=null,H(2);let t=6,r=setInterval(()=>{if(t<13)W(n=>[...n,e[t]]),t++;else{clearInterval(r),X.current=null,H(3);let t=13,n=setInterval(()=>{t<e.length?(W(n=>[...n,e[t]]),t++):(clearInterval(n),Z.current=null,H(4),K(`https://zenith-${F.slug}.${z}.app`),v.success(`Storefront successfully deployed!`))},800);Z.current=n}},600);X.current=r}},450);Y.current=n},ne=e=>{navigator.clipboard.writeText(e),J(!0),v.success(`Live URL copied to clipboard!`),setTimeout(()=>J(!1),2e3)};return(0,A.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-64px)] overflow-hidden`,children:[(0,A.jsx)(O,{title:`Templates`,actions:(0,A.jsx)(`div`,{className:T(`p-1 rounded-none-none border flex items-center shadow-sm backdrop-blur-xl`,`bg-z-panel border-z-border shadow-sm`),children:Q.map(e=>(0,A.jsx)(`button`,{onClick:()=>P(e),className:T(`px-4 py-2 text-sm font-semibold rounded-none-none transition-all leading-none whitespace-nowrap`,N===e?S===`dark`?`bg-z-panel text-z-primary shadow-lg`:`bg-z-accent text-z-primary shadow-lg`:`text-z-secondary hover:text-z-primary`),children:e},e))})}),(0,A.jsxs)(`div`,{className:T(`flex-1 overflow-y-auto p-6 md:p-10 space-y-8 transition-colors duration-500 relative pb-12`,S===`dark`?`bg-app text-z-primary`:`bg-[#fafafa] text-z-primary`),children:[(0,A.jsxs)(`div`,{className:T(`relative p-6 md:p-8 overflow-hidden border backdrop-blur-xl shadow-xl flex flex-col md:flex-row md:items-center md:justify-between gap-6 transition-all`,S===`dark`?`bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-[var(--z-border)]`:`bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-sm`),children:[(0,A.jsx)(`div`,{className:`absolute top-0 right-0 w-80 h-80 bg-z-panel blur-[100px] pointer-events-none rounded-none-none`}),(0,A.jsx)(`div`,{className:`absolute bottom-0 left-0 w-80 h-80 bg-z-hover blur-[100px] pointer-events-none rounded-none-none`}),(0,A.jsxs)(`div`,{className:`flex-1 space-y-2 z-10`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-z-secondary `,children:[(0,A.jsx)(c,{size:16,className:`animate-pulse`}),(0,A.jsx)(`span`,{className:`text-sm font-semibold`,children:`Sandbox`})]}),(0,A.jsx)(`h2`,{className:`text-2xl font-semibold leading-tight`,children:`Deploy Templates`})]}),(0,A.jsxs)(`div`,{className:T(`flex items-center gap-4 px-5 py-3 rounded-none-none border shadow-inner w-full md:max-w-xs transition-all group z-10 shrink-0 self-start md:self-auto`,S===`dark`?`bg-z-hover border-z-border`:`bg-z-panel border-z-border shadow-sm shadow-sm`),children:[(0,A.jsx)(i,{size:14,className:`text-z-secondary group-focus-within:text-z-secondary transition-colors`}),(0,A.jsx)(`input`,{type:`text`,placeholder:`Filter by tech or tags...`,value:M,onChange:e=>ee(e.target.value),className:`bg-transparent border-none outline-none focus-visible:ring-2 focus-visible:ring-z-active-border focus-visible:ring-offset-1 focus-visible:ring-offset-black text-sm font-semibold text-z-muted w-full placeholder:text-z-secondary`})]})]}),$.length===0?(0,A.jsxs)(`div`,{className:`py-24 flex flex-col items-center justify-center gap-4 opacity-30 border border-dashed border-z-border`,children:[(0,A.jsx)(r,{size:40,strokeWidth:1,className:`text-z-secondary animate-pulse`}),(0,A.jsx)(`p`,{className:`text-sm font-semibold`,children:`No templates matching filters found`})]}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:(0,A.jsx)(_,{mode:`popLayout`,children:$.map(e=>(0,A.jsx)(E,{interactive:!0,padding:`none`,className:`flex flex-col relative group`,children:(0,A.jsxs)(D,{className:`flex flex-col flex-1 gap-6`,children:[(0,A.jsx)(`div`,{className:T(`absolute top-0 left-0 right-0 h-1 bg-gradient-to-r opacity-60 group-hover:opacity-100 transition-opacity`,e.primaryColor)}),(0,A.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary`,children:e.category}),(0,A.jsx)(`span`,{className:`w-1 h-1 bg-z-border rounded-none-none`}),(0,A.jsxs)(`span`,{className:`text-sm font-mono font-semibold text-z-secondary`,children:[`v`,e.version]}),e.slug===j&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 bg-z-panel text-z-secondary border border-z-border/20 text-sm font-semibold leading-none`,children:[(0,A.jsx)(x,{size:8}),`Active Workspace / Site`]})]}),(0,A.jsx)(`h3`,{className:`text-xl font-semibold leading-none group-hover:text-z-secondary transition-colors mt-1.5`,children:e.name})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary leading-none`,children:`Lighthouse`}),(0,A.jsxs)(`span`,{className:`text-lg font-semibold text-z-secondary mt-1`,children:[e.performanceScore,`%`]})]}),(0,A.jsx)(`div`,{className:`w-9 h-9 rounded-none-none border border-z-border/20 bg-z-hover flex items-center justify-center text-z-secondary font-bold text-xs`,children:e.performanceScore})]})]}),(0,A.jsxs)(`div`,{className:T(`w-full h-40 rounded-none-none relative overflow-hidden border transition-all duration-500 flex items-center justify-center group-hover:scale-[1.01]`,S===`dark`?`bg-app border-z-border`:`bg-z-input border-z-border shadow-sm`),children:[(0,A.jsx)(`div`,{className:`absolute inset-0 bg-grid-pattern opacity-[0.03] pointer-events-none`}),(0,A.jsx)(`div`,{className:T(`absolute w-48 h-48 rounded-none-none blur-[60px] opacity-20 bg-gradient-to-br`,e.primaryColor)}),(0,A.jsxs)(`div`,{className:`w-5/6 h-2/3 border border-z-border rounded-none-none bg-z-panel backdrop-blur-md p-4 flex flex-col justify-between shadow-2xl relative overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,A.jsx)(`div`,{className:`w-2 h-2 rounded-none-none bg-red-500/40`}),(0,A.jsx)(`div`,{className:`w-2 h-2 rounded-none-none bg-yellow-500/40`}),(0,A.jsx)(`div`,{className:`w-2 h-2 rounded-none-none bg-green-500/40`})]}),(0,A.jsx)(`div`,{className:`px-2 py-0.5 bg-z-hover border border-z-border rounded-none-none text-sm font-mono text-z-secondary`,children:`SECURE_SSL`})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5 my-2`,children:[(0,A.jsx)(`div`,{className:`h-2 w-1/3 bg-z-hover rounded-none-none`}),(0,A.jsx)(`div`,{className:`h-1.5 w-2/3 bg-z-hover rounded-none-none`}),(0,A.jsx)(`div`,{className:`h-1.5 w-1/2 bg-z-hover rounded-none-none`})]}),(0,A.jsxs)(`div`,{className:`flex justify-between items-center pt-2 border-t border-z-border`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1 text-z-secondary text-sm font-semibold`,children:[(0,A.jsx)(p,{size:8}),` `,e.id===`storefront-glass`?`Glassmorphism`:e.id===`storefront-editorial`?`Editorial`:e.id===`blog-demo`?`Dev Blog`:`E-Commerce`]}),(0,A.jsx)(`div`,{className:`w-8 h-3 bg-z-hover rounded-none-none`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary leading-none`,children:`Core Specifications`}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 mt-1`,children:e.features.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-z-secondary`,children:[(0,A.jsx)(`div`,{className:`w-1.5 h-1.5 bg-z-border/40 border border-z-border rounded-none-none shrink-0`}),(0,A.jsx)(`span`,{className:`truncate`,children:e})]},t))})]}),(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.tags.map(e=>(0,A.jsx)(`span`,{className:T(`px-2 py-1 text-sm font-mono font-semibold border rounded-none-none shadow-sm`,S===`dark`?`bg-z-hover border-z-border text-z-secondary`:`bg-[var(--z-bg-hover)] border-z-border text-z-secondary`),children:e},e))}),(0,A.jsxs)(`div`,{className:T(`p-3 border rounded-none-none flex items-center justify-between gap-3 text-sm font-mono`,S===`dark`?`bg-app border-z-border text-z-muted`:`bg-z-input border-z-border text-z-secondary`),children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 truncate`,children:[(0,A.jsx)(n,{size:10,className:`text-z-secondary`}),(0,A.jsxs)(`span`,{className:`truncate select-all`,children:[`git clone `,e.gitUrl,`.git`]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,A.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(`git clone ${e.gitUrl}.git`),v.success(`Clone command copied!`)},className:T(`p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95`,S===`dark`?`border-z-border bg-z-hover hover:text-z-primary`:`border-z-border bg-z-panel hover:text-z-primary`),title:`Copy clone command`,children:(0,A.jsx)(s,{size:10})}),(0,A.jsx)(`a`,{href:`${e.gitUrl}/archive/refs/heads/main.zip`,className:T(`p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95`,S===`dark`?`border-z-border bg-z-hover text-z-muted hover:text-z-primary`:`border-z-border bg-z-panel text-z-secondary hover:text-z-primary`),title:`Download ZIP`,children:(0,A.jsx)(m,{size:10})})]})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-z-border mt-auto flex items-center justify-between gap-4`,children:[(0,A.jsxs)(`a`,{href:e.gitUrl,target:`_blank`,rel:`noreferrer`,className:T(`px-4 py-3 border rounded-none-none text-sm font-semibold transition-all leading-none flex items-center gap-2 group/git`,S===`dark`?`border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border`:`border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong shadow-sm`),children:[(0,A.jsx)(u,{size:12,className:`group-hover/git:rotate-12 transition-transform`}),`Git Repository`,(0,A.jsx)(a,{size:10,className:`opacity-40 group-hover/git:opacity-100 transition-opacity`})]}),(0,A.jsxs)(`button`,{onClick:()=>{I(e),H(0),R(!0)},className:T(`px-5 py-3 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary`,e.primaryColor),style:{boxShadow:`0 4px 15px -4px ${e.accentColor}33`},children:[(0,A.jsx)(f,{size:12,className:`animate-bounce`}),`Deploy Instance`,(0,A.jsx)(h,{size:10,className:`group-hover:translate-x-0.5 transition-transform`})]})]})]})},e.id))})}),(0,A.jsx)(_,{children:L&&F&&(0,A.jsxs)(`div`,{className:`fixed inset-0 z-55 flex items-center justify-center p-4`,children:[(0,A.jsx)(y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>{V===0||V===4?R(!1):v.error(`Build sequence in progress. Please wait for termination.`)},className:`absolute inset-0 bg-[var(--z-bg-modal)] backdrop-blur-xl`}),(0,A.jsxs)(y.div,{initial:{scale:.95,opacity:0,y:10},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:10},transition:{duration:.35,ease:[.16,1,.3,1]},className:T(`w-full max-w-2xl border rounded-none-none p-6 md:p-8 flex flex-col gap-6 relative shadow-2xl overflow-hidden z-10`,S===`dark`?`bg-app border-z-border`:`bg-z-panel border-z-border`),children:[(0,A.jsx)(`div`,{className:T(`absolute top-0 left-0 right-0 h-1.5 bg-gradient-to-r`,F.primaryColor)}),(V===0||V===4)&&(0,A.jsx)(`button`,{onClick:()=>R(!1),className:T(`absolute top-6 right-6 w-8 h-8 rounded-none-none border flex items-center justify-center text-z-secondary hover:text-z-primary transition-all`,S===`dark`?`bg-z-hover border-z-border`:`bg-z-input border-z-border`)}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsx)(`div`,{className:T(`w-10 h-10 rounded-none-none flex items-center justify-center text-z-primary`,F.primaryColor),children:(0,A.jsx)(t,{size:18})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary block`,children:`Zero-Config Handshake`}),(0,A.jsx)(`h3`,{className:`text-xl font-semibold leading-none mt-1`,children:V===4?`Deploy Successful!`:`Deploying ${F.name}`})]})]}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-2 border-b border-z-border pb-5`,children:[{label:`Configure`,activeStep:0},{label:`Connect Repo`,activeStep:1},{label:`Compile Code`,activeStep:2},{label:`Route Domain`,activeStep:3}].map((e,t)=>{let n=V>e.activeStep||V===4,r=V===e.activeStep;return(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`div`,{className:T(`h-1 w-full rounded-none-none transition-all duration-500`,n?`bg-z-border shadow-sm`:r?`bg-amber-500 animate-pulse`:`bg-z-hover`)}),(0,A.jsxs)(`span`,{className:T(`text-sm font-semibold leading-none mt-0.5`,n||r?`text-z-primary`:`text-z-secondary`),children:[t+1,`. `,e.label]})]},t)})}),(0,A.jsxs)(`div`,{className:`min-h-[220px] flex flex-col justify-between gap-5`,children:[V===0&&(0,A.jsxs)(`div`,{className:`space-y-5`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`label`,{className:`text-sm font-semibold text-z-secondary leading-none`,children:`1. Select Cloud Deployment Target`}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[{id:`vercel`,name:`Vercel Edge`,latency:`Fastest`},{id:`netlify`,name:`Netlify CDN`,latency:`Stable`},{id:`cloudflare`,name:`Cloudflare Pages`,latency:`Zero-Lag`}].map(e=>(0,A.jsxs)(`button`,{onClick:()=>B(e.id),className:T(`border p-3 flex flex-col items-center justify-center gap-2 rounded-none-none transition-all group relative`,z===e.id?`bg-z-panel border-z-border text-z-primary shadow-sm`:`bg-z-panel border-z-border text-z-secondary hover:text-z-secondary hover:border-z-border`),children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold`,children:e.name}),(0,A.jsx)(`span`,{className:T(`text-sm font-mono px-1.5 py-0.5 rounded-none-none border`,z===e.id?`border-z-border/30 text-z-secondary bg-z-hover`:`border-z-border text-z-secondary bg-z-hover`),children:e.latency})]},e.id))})]}),(0,A.jsxs)(`div`,{className:T(`p-4 border rounded-none-none flex items-center justify-between gap-4`,S===`dark`?`bg-z-panel/5 border-z-border`:`bg-z-input border-z-border shadow-sm`),children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(d,{size:16,className:`text-z-secondary`}),(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[(0,A.jsxs)(`span`,{className:`text-sm font-semibold leading-none text-z-primary`,children:[`AmanTShekar/`,F.slug]}),(0,A.jsx)(`span`,{className:`text-sm font-bold text-z-secondary mt-1`,children:`GitHub Repository Handshake`})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1 text-sm font-mono text-z-secondary px-2 py-1 bg-z-hover border border-z-border/20`,children:`● CONNECTED`})]}),(0,A.jsx)(`div`,{className:`pt-4 border-t border-z-border flex justify-end`,children:(0,A.jsxs)(`button`,{onClick:te,className:T(`px-8 py-3.5 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary`,F.primaryColor),children:[(0,A.jsx)(f,{size:12}),`Trigger Pipeline`]})})]}),(V===1||V===2||V===3)&&(0,A.jsxs)(`div`,{className:`space-y-4 flex-1 flex flex-col`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsx)(n,{size:14,className:`text-z-secondary`}),(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-secondary`,children:`Simulated Edge Console Output`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-none-none bg-amber-500 animate-ping`}),(0,A.jsx)(`span`,{className:`text-sm font-mono text-amber-500 font-semibold`,children:V===1?`GIT_FETCH`:V===2?`COMPILING`:`EDGE_ROUTING`})]})]}),(0,A.jsxs)(`div`,{className:`flex-1 min-h-[160px] bg-app border border-z-border p-4 font-mono text-sm text-z-muted overflow-y-auto space-y-1.5 scroll-smooth`,children:[U.map((e,t)=>(0,A.jsxs)(`div`,{className:T(`leading-relaxed `,e.startsWith(`[error]`)?`text-red-500`:e.startsWith(`[build]`)?`text-z-secondary`:e.startsWith(`[network]`)?`text-z-active-text`:`text-z-secondary`),children:[(0,A.jsxs)(`span`,{className:`text-z-secondary mr-2`,children:[`[`,t+1,`]`]}),e]},t)),(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,A.jsxs)(`span`,{className:`text-z-secondary mr-2`,children:[`[`,U.length+1,`]`]}),(0,A.jsx)(`div`,{className:`w-1.5 h-3 bg-z-border animate-pulse`})]})]})]}),V===4&&(0,A.jsxs)(`div`,{className:`space-y-6 text-center py-4`,children:[(0,A.jsx)(y.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{type:`spring`,stiffness:200,damping:15},className:`w-16 h-16 bg-z-panel border border-z-border/30 rounded-none-none flex items-center justify-center mx-auto text-z-secondary shadow-sm`,children:(0,A.jsx)(o,{size:32,strokeWidth:2.5})}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h4`,{className:`text-lg font-semibold leading-none text-z-primary`,children:`Production Live Ready`}),(0,A.jsx)(`p`,{className:`text-sm text-z-secondary max-w-sm mx-auto leading-relaxed`,children:`Continuous deployment webhook registered. Updates pushed to git main will trigger regenerations.`})]}),(0,A.jsxs)(`div`,{className:T(`max-w-md mx-auto p-4 border rounded-none-none flex items-center justify-between gap-4 bg-z-panel`,S===`dark`?`border-z-border`:`border-z-border shadow-sm`),children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,A.jsx)(l,{size:16,className:`text-z-secondary shrink-0`}),(0,A.jsx)(`span`,{className:`text-sm font-semibold text-z-primary truncate font-mono`,children:G})]}),(0,A.jsx)(`button`,{onClick:()=>ne(G),className:T(`p-2.5 rounded-none-none border transition-all flex items-center justify-center shrink-0`,q?`bg-z-panel border-z-border/30 text-z-secondary`:`bg-z-hover border-z-border text-z-muted hover:text-z-primary`),children:q?(0,A.jsx)(g,{size:14}):(0,A.jsx)(s,{size:14})})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-z-border flex items-center justify-between gap-4 max-w-md mx-auto`,children:[(0,A.jsx)(`button`,{onClick:()=>R(!1),className:T(`w-full py-3.5 border rounded-none-none text-sm font-semibold transition-all leading-none`,S===`dark`?`border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border`:`border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong`),children:`Dismiss Console`}),(0,A.jsxs)(`a`,{href:G,target:`_blank`,rel:`noreferrer`,className:T(`w-full py-3.5 rounded-none-none text-sm font-semibold transition-all leading-none flex items-center justify-center gap-2 text-z-primary`,F.primaryColor),children:[`Launch Storefront`,(0,A.jsx)(a,{size:10})]})]})]})]})]})]})})]})]})};export{j as default};
@@ -1 +1 @@
1
- {"version":3,"file":"TemplatesPage-CaZgoHEq.js","names":[],"sources":["../../src/pages/TemplatesPage.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\nimport {\n Layout,\n GitBranch,\n GitFork,\n ExternalLink,\n Globe,\n Server,\n CheckCircle2,\n ArrowRight,\n Terminal,\n CloudLightning,\n Sparkles,\n Search,\n Layers,\n Activity,\n Copy,\n Check,\n Download,\n} from 'lucide-react'\nimport { motion, AnimatePresence } from 'framer-motion'\nimport { cn } from '../lib/utils'\nimport { useTheme } from '../context/ThemeContext'\nimport toast from 'react-hot-toast'\nimport { PageHeader } from '../components/ui/PageHeader'\nimport { Card, CardContent } from '../components/ui/Card'\nimport api from '../lib/api'\n\ninterface Template {\n id: string\n name: string\n version: string\n description: string\n gitUrl: string\n tags: string[]\n stars: number\n performanceScore: number\n primaryColor: string\n accentColor: string\n features: string[]\n category: string\n slug: string\n}\n\nconst TemplatesPage: React.FC = () => {\n const [templates, setTemplates] = useState<Template[]>([])\n const { theme } = useTheme()\n const activeSiteSlug = localStorage.getItem('activeSiteSlug') || ''\n const [searchQuery, setSearchQuery] = useState('')\n const [activeCategory, setActiveCategory] = useState<string>('All')\n const [selectedTemplate, setSelectedTemplate] = useState<Template | null>(null)\n const [isDeployModalOpen, setIsDeployModalOpen] = useState(false)\n const [provider, setProvider] = useState<'vercel' | 'netlify' | 'cloudflare'>('vercel')\n const [deployStep, setDeployStep] = useState<number>(0) // 0: Config, 1: Connecting, 2: Building, 3: Routing, 4: Success\n const [terminalLogs, setTerminalLogs] = useState<string[]>([])\n const [liveUrl, setLiveUrl] = useState('')\n const [copied, setCopied] = useState(false)\n\n const logIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null)\n const buildIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null)\n const networkIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null)\n\n useEffect(() => {\n api.get('/system/templates').then(res => {\n setTemplates(res.data.templates || [])\n }).catch(err => console.error('Failed to load templates', err))\n\n return () => {\n if (logIntervalRef.current) clearInterval(logIntervalRef.current)\n if (buildIntervalRef.current) clearInterval(buildIntervalRef.current)\n if (networkIntervalRef.current) clearInterval(networkIntervalRef.current)\n }\n }, [])\n\n // Filter Categories\n const categories = ['All', 'E-Commerce / Portfolio', 'Editorial / Blog']\n\n const filteredTemplates = templates.filter((template) => {\n const matchesSearch =\n template.name.toLowerCase().includes(searchQuery.toLowerCase()) ||\n template.description.toLowerCase().includes(searchQuery.toLowerCase()) ||\n template.tags.some((tag) => tag.toLowerCase().includes(searchQuery.toLowerCase()))\n const matchesCategory = activeCategory === 'All' || template.category === activeCategory\n return matchesSearch && matchesCategory\n })\n\n // Start continuous deployment simulation\n const handleStartDeployment = () => {\n if (!selectedTemplate) return\n setDeployStep(1)\n setTerminalLogs([])\n \n // Simulate terminal logs generator\n const logs = [\n `[system] Initializing deployment protocol for @zenith-open/${selectedTemplate.slug}...`,\n `[system] Selected target provider: ${provider.toUpperCase()}`,\n `[git] Cloning repository from ${selectedTemplate.gitUrl}...`,\n `[git] Branch: main (HEAD resolved to latest secure release v${selectedTemplate.version})`,\n `[system] Provisioning sandbox container on global edge node...`,\n `[system] Installing workspace dependencies via pnpm...`,\n `[build] Resolving node modules: 173 packages successfully installed.`,\n `[build] Starting project compile step: \"pnpm run build\"...`,\n `[build] vite v1.0.0-beta building for production...`,\n `[build] 42 modules transformed.`,\n `[build] dist/assets/index-D8g9sK.js 142.64 kB │ gzip: 43.12 kB`,\n `[build] dist/assets/index-C1h8aD.css 31.42 kB │ gzip: 8.94 kB`,\n `[build] built in 1.48s`,\n `[system] Bundle generated successfully!`,\n `[network] Uploading assets to global Edge CDN caching layers...`,\n `[network] Synchronizing routing configurations & static revalidation rules...`,\n `[network] Activating secure SameSite=Strict endpoints and HTTPS configurations...`,\n `[system] Deployment completed. SSL handshake verified!`,\n ]\n\n let logIndex = 0\n const logInterval = setInterval(() => {\n if (logIndex < 6) {\n setTerminalLogs((prev) => [...prev, logs[logIndex]])\n logIndex++\n } else {\n clearInterval(logInterval)\n logIntervalRef.current = null\n setDeployStep(2) // Move to Building state\n \n let buildLogIndex = 6\n const buildInterval = setInterval(() => {\n if (buildLogIndex < 13) {\n setTerminalLogs((prev) => [...prev, logs[buildLogIndex]])\n buildLogIndex++\n } else {\n clearInterval(buildInterval)\n buildIntervalRef.current = null\n setDeployStep(3) // Move to Edge Routing state\n \n let networkLogIndex = 13\n const networkInterval = setInterval(() => {\n if (networkLogIndex < logs.length) {\n setTerminalLogs((prev) => [...prev, logs[networkLogIndex]])\n networkLogIndex++\n } else {\n clearInterval(networkInterval)\n networkIntervalRef.current = null\n setDeployStep(4) // Success!\n setLiveUrl(`https://zenith-${selectedTemplate.slug}.${provider}.app`)\n toast.success('Storefront successfully deployed!')\n }\n }, 800)\n networkIntervalRef.current = networkInterval\n }\n }, 600)\n buildIntervalRef.current = buildInterval\n }\n }, 450)\n logIntervalRef.current = logInterval\n }\n\n const copyToClipboard = (text: string) => {\n navigator.clipboard.writeText(text)\n setCopied(true)\n toast.success('Live URL copied to clipboard!')\n setTimeout(() => setCopied(false), 2000)\n }\n\n return (\n <div className=\"flex flex-col h-[calc(100vh-64px)] overflow-hidden\">\n <PageHeader\n title=\"Templates\"\n actions={\n <div\n className={cn(\n 'p-1 rounded-none-none border flex items-center shadow-sm backdrop-blur-xl',\n 'bg-z-panel border-z-border shadow-sm'\n )}\n >\n {categories.map((cat) => (\n <button\n key={cat}\n onClick={() => setActiveCategory(cat)}\n className={cn(\n 'px-4 py-2 text-sm font-semibold rounded-none-none transition-all leading-none whitespace-nowrap',\n activeCategory === cat\n ? theme === 'dark'\n ? 'bg-z-panel text-z-primary shadow-lg'\n : 'bg-z-accent text-z-primary shadow-lg'\n : 'text-z-secondary hover:text-z-primary'\n )}\n >\n {cat}\n </button>\n ))}\n </div>\n }\n />\n\n <div className={cn(\n 'flex-1 overflow-y-auto p-6 md:p-10 space-y-8 transition-colors duration-500 relative pb-12',\n theme === 'dark' ? 'bg-app text-z-primary' : 'bg-[#fafafa] text-z-primary'\n )}>\n {/* High-Tech Glassmorphic Hero Panel */}\n <div\n className={cn(\n 'relative p-6 md:p-8 overflow-hidden border backdrop-blur-xl shadow-xl flex flex-col md:flex-row md:items-center md:justify-between gap-6 transition-all',\n theme === 'dark'\n ? 'bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-[var(--z-border)]'\n : 'bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-sm'\n )}\n >\n <div className=\"absolute top-0 right-0 w-80 h-80 bg-z-panel blur-[100px] pointer-events-none rounded-none-none\" />\n <div className=\"absolute bottom-0 left-0 w-80 h-80 bg-z-hover blur-[100px] pointer-events-none rounded-none-none\" />\n\n <div className=\"flex-1 space-y-2 z-10\">\n <div className=\"flex items-center gap-2 text-z-secondary \">\n <Sparkles size={16} className=\"animate-pulse\" />\n <span className=\"text-sm font-semibold\">\n Sandbox\n </span>\n </div>\n <h2 className=\"text-2xl font-semibold leading-tight\">\n Deploy Templates\n </h2>\n </div>\n\n {/* Search Input Box */}\n <div\n className={cn(\n 'flex items-center gap-4 px-5 py-3 rounded-none-none border shadow-inner w-full md:max-w-xs transition-all group z-10 shrink-0 self-start md:self-auto',\n theme === 'dark' ? 'bg-z-hover border-z-border' : 'bg-z-panel border-z-border shadow-sm shadow-sm'\n )}\n >\n <Search\n size={14}\n className=\"text-z-secondary group-focus-within:text-z-secondary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder=\"Filter by tech or tags...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"bg-transparent border-none outline-none focus-visible:ring-2 focus-visible:ring-z-active-border focus-visible:ring-offset-1 focus-visible:ring-offset-black text-sm font-semibold text-z-muted w-full placeholder:text-z-secondary\"\n />\n </div>\n </div>\n\n {/* Showcase Cards Grid */}\n {filteredTemplates.length === 0 ? (\n <div className=\"py-24 flex flex-col items-center justify-center gap-4 opacity-30 border border-dashed border-z-border\">\n <Layout size={40} strokeWidth={1} className=\"text-z-secondary animate-pulse\" />\n <p className=\"text-sm font-semibold\">\n No templates matching filters found\n </p>\n </div>\n ) : (\n <div className=\"grid grid-cols-1 xl:grid-cols-2 gap-6\">\n <AnimatePresence mode=\"popLayout\">\n {filteredTemplates.map((template) => (\n <Card\n key={template.id}\n interactive\n padding=\"none\"\n className=\"flex flex-col relative group\"\n >\n <CardContent className=\"flex flex-col flex-1 gap-6\">\n {/* Accent Highlight Bar */}\n <div\n className={cn(\n 'absolute top-0 left-0 right-0 h-1 bg-gradient-to-r opacity-60 group-hover:opacity-100 transition-opacity',\n template.primaryColor\n )}\n />\n\n {/* Card Title Header */}\n <div className=\"flex flex-col sm:flex-row sm:items-start justify-between gap-4\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2.5\">\n <span className=\"text-sm font-semibold text-z-secondary\">\n {template.category}\n </span>\n <span className=\"w-1 h-1 bg-z-border rounded-none-none\" />\n <span className=\"text-sm font-mono font-semibold text-z-secondary\">\n v{template.version}\n </span>\n {template.slug === activeSiteSlug && (\n <div className=\"flex items-center gap-1.5 px-2 py-0.5 bg-z-panel text-z-secondary border border-z-border/20 text-sm font-semibold leading-none\">\n <Activity size={8} />\n Active Workspace / Site\n </div>\n )}\n </div>\n <h3 className=\"text-xl font-semibold leading-none group-hover:text-z-secondary transition-colors mt-1.5\">\n {template.name}\n </h3>\n </div>\n\n {/* Performance Matrix */}\n <div className=\"flex items-center gap-3 shrink-0\">\n <div className=\"flex flex-col items-end\">\n <span className=\"text-sm font-semibold text-z-secondary leading-none\">\n Lighthouse\n </span>\n <span className=\"text-lg font-semibold text-z-secondary mt-1\">\n {template.performanceScore}%\n </span>\n </div>\n <div className=\"w-9 h-9 rounded-none-none border border-z-border/20 bg-z-hover flex items-center justify-center text-z-secondary font-bold text-xs\">\n {template.performanceScore}\n </div>\n </div>\n </div>\n\n {/* Custom Gradient Mock Image Area */}\n <div\n className={cn(\n 'w-full h-40 rounded-none-none relative overflow-hidden border transition-all duration-500 flex items-center justify-center group-hover:scale-[1.01]',\n theme === 'dark' ? 'bg-app border-z-border' : 'bg-z-input border-z-border shadow-sm'\n )}\n >\n {/* Glass Card Vector Grid Backdrop */}\n <div className=\"absolute inset-0 bg-grid-pattern opacity-[0.03] pointer-events-none\" />\n <div\n className={cn(\n 'absolute w-48 h-48 rounded-none-none blur-[60px] opacity-20 bg-gradient-to-br',\n template.primaryColor\n )}\n />\n\n {/* Decorative Elements mimicking UI */}\n <div className=\"w-5/6 h-2/3 border border-z-border rounded-none-none bg-z-panel backdrop-blur-md p-4 flex flex-col justify-between shadow-2xl relative overflow-hidden\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex gap-1.5\">\n <div className=\"w-2 h-2 rounded-none-none bg-red-500/40\" />\n <div className=\"w-2 h-2 rounded-none-none bg-yellow-500/40\" />\n <div className=\"w-2 h-2 rounded-none-none bg-green-500/40\" />\n </div>\n <div className=\"px-2 py-0.5 bg-z-hover border border-z-border rounded-none-none text-sm font-mono text-z-secondary\">\n SECURE_SSL\n </div>\n </div>\n\n <div className=\"space-y-1.5 my-2\">\n <div className=\"h-2 w-1/3 bg-z-hover rounded-none-none\" />\n <div className=\"h-1.5 w-2/3 bg-z-hover rounded-none-none\" />\n <div className=\"h-1.5 w-1/2 bg-z-hover rounded-none-none\" />\n </div>\n\n <div className=\"flex justify-between items-center pt-2 border-t border-z-border\">\n <div className=\"flex items-center gap-1 text-z-secondary text-sm font-semibold\">\n <Layers size={8} /> {template.id === 'storefront-glass' ? 'Glassmorphism' : template.id === 'storefront-editorial' ? 'Editorial' : template.id === 'blog-demo' ? 'Dev Blog' : 'E-Commerce'}\n </div>\n <div className=\"w-8 h-3 bg-z-hover rounded-none-none\" />\n </div>\n </div>\n </div>\n\n {/* Features Highlights */}\n <div className=\"space-y-2\">\n <span className=\"text-sm font-semibold text-z-secondary leading-none\">\n Core Specifications\n </span>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-2 mt-1\">\n {template.features.map((feat, idx) => (\n <div key={idx} className=\"flex items-center gap-2 text-xs text-z-secondary\">\n <div className=\"w-1.5 h-1.5 bg-z-border/40 border border-z-border rounded-none-none shrink-0\" />\n <span className=\"truncate\">{feat}</span>\n </div>\n ))}\n </div>\n </div>\n\n {/* Tags */}\n <div className=\"flex flex-wrap gap-1.5\">\n {template.tags.map((tag) => (\n <span\n key={tag}\n className={cn(\n 'px-2 py-1 text-sm font-mono font-semibold border rounded-none-none shadow-sm',\n theme === 'dark'\n ? 'bg-z-hover border-z-border text-z-secondary'\n : 'bg-[var(--z-bg-hover)] border-z-border text-z-secondary'\n )}\n >\n {tag}\n </span>\n ))}\n </div>\n\n {/* Clone Command & Zip Download */}\n <div className={cn(\n 'p-3 border rounded-none-none flex items-center justify-between gap-3 text-sm font-mono',\n theme === 'dark' ? 'bg-app border-z-border text-z-muted' : 'bg-z-input border-z-border text-z-secondary'\n )}>\n <div className=\"flex items-center gap-1.5 truncate\">\n <Terminal size={10} className=\"text-z-secondary\" />\n <span className=\"truncate select-all\">git clone {template.gitUrl}.git</span>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <button\n onClick={() => {\n navigator.clipboard.writeText(`git clone ${template.gitUrl}.git`)\n toast.success('Clone command copied!')\n }}\n className={cn(\n 'p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95',\n theme === 'dark' ? 'border-z-border bg-z-hover hover:text-z-primary' : 'border-z-border bg-z-panel hover:text-z-primary'\n )}\n title=\"Copy clone command\"\n >\n <Copy size={10} />\n </button>\n <a\n href={`${template.gitUrl}/archive/refs/heads/main.zip`}\n className={cn(\n 'p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95',\n theme === 'dark' ? 'border-z-border bg-z-hover text-z-muted hover:text-z-primary' : 'border-z-border bg-z-panel text-z-secondary hover:text-z-primary'\n )}\n title=\"Download ZIP\"\n >\n <Download size={10} />\n </a>\n </div>\n </div>\n\n {/* Git Action Panel */}\n <div className=\"pt-4 border-t border-z-border mt-auto flex items-center justify-between gap-4\">\n <a\n href={template.gitUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className={cn(\n 'px-4 py-3 border rounded-none-none text-sm font-semibold transition-all leading-none flex items-center gap-2 group/git',\n theme === 'dark'\n ? 'border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border'\n : 'border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong shadow-sm'\n )}\n >\n <GitFork size={12} className=\"group-hover/git:rotate-12 transition-transform\" />\n Git Repository\n <ExternalLink size={10} className=\"opacity-40 group-hover/git:opacity-100 transition-opacity\" />\n </a>\n\n <button\n onClick={() => {\n setSelectedTemplate(template)\n setDeployStep(0)\n setIsDeployModalOpen(true)\n }}\n className={cn(\n 'px-5 py-3 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary',\n template.primaryColor\n )}\n style={{\n boxShadow: `0 4px 15px -4px ${template.accentColor}33`,\n }}\n >\n <CloudLightning size={12} className=\"animate-bounce\" />\n Deploy Instance\n <ArrowRight size={10} className=\"group-hover:translate-x-0.5 transition-transform\" />\n </button>\n </div>\n </CardContent>\n </Card>\n ))}\n </AnimatePresence>\n </div>\n )}\n\n {/* Tactical Continuous Deployment Overlay Modal */}\n <AnimatePresence>\n {isDeployModalOpen && selectedTemplate && (\n <div className=\"fixed inset-0 z-55 flex items-center justify-center p-4\">\n {/* Backdrop blur overlay */}\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n onClick={() => {\n // Prevent accidental closure during deployment build sequence\n if (deployStep === 0 || deployStep === 4) {\n setIsDeployModalOpen(false)\n } else {\n toast.error('Build sequence in progress. Please wait for termination.')\n }\n }}\n className=\"absolute inset-0 bg-[var(--z-bg-modal)] backdrop-blur-xl\"\n />\n\n {/* Modal Box */}\n <motion.div\n initial={{ scale: 0.95, opacity: 0, y: 10 }}\n animate={{ scale: 1, opacity: 1, y: 0 }}\n exit={{ scale: 0.95, opacity: 0, y: 10 }}\n transition={{ duration: 0.35, ease: [0.16, 1, 0.3, 1] }}\n className={cn(\n 'w-full max-w-2xl border rounded-none-none p-6 md:p-8 flex flex-col gap-6 relative shadow-2xl overflow-hidden z-10',\n theme === 'dark' ? 'bg-app border-z-border' : 'bg-z-panel border-z-border'\n )}\n >\n {/* Top Accent Gradient Bar */}\n <div\n className={cn(\n 'absolute top-0 left-0 right-0 h-1.5 bg-gradient-to-r',\n selectedTemplate.primaryColor\n )}\n />\n\n {/* Close Panel Button */}\n {(deployStep === 0 || deployStep === 4) && (\n <button\n onClick={() => setIsDeployModalOpen(false)}\n className={cn(\n 'absolute top-6 right-6 w-8 h-8 rounded-none-none border flex items-center justify-center text-z-secondary hover:text-z-primary transition-all',\n theme === 'dark' ? 'bg-z-hover border-z-border' : 'bg-z-input border-z-border'\n )}\n >\n \n </button>\n )}\n\n {/* Step Title Header */}\n <div className=\"flex items-center gap-4\">\n <div\n className={cn(\n 'w-10 h-10 rounded-none-none flex items-center justify-center text-z-primary',\n selectedTemplate.primaryColor\n )}\n >\n <Server size={18} />\n </div>\n <div>\n <span className=\"text-sm font-semibold text-z-secondary block\">\n Zero-Config Handshake\n </span>\n <h3 className=\"text-xl font-semibold leading-none mt-1\">\n {deployStep === 4 ? 'Deploy Successful!' : `Deploying ${selectedTemplate.name}`}\n </h3>\n </div>\n </div>\n\n {/* Active Deployment Stepper */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-2 border-b border-z-border pb-5\">\n {[\n { label: 'Configure', activeStep: 0 },\n { label: 'Connect Repo', activeStep: 1 },\n { label: 'Compile Code', activeStep: 2 },\n { label: 'Route Domain', activeStep: 3 },\n ].map((s, idx) => {\n const isCompleted = deployStep > s.activeStep || deployStep === 4\n const isActive = deployStep === s.activeStep\n return (\n <div key={idx} className=\"flex flex-col gap-1.5\">\n <div\n className={cn(\n 'h-1 w-full rounded-none-none transition-all duration-500',\n isCompleted\n ? 'bg-z-border shadow-sm'\n : isActive\n ? 'bg-amber-500 animate-pulse'\n : 'bg-z-hover'\n )}\n />\n <span\n className={cn(\n 'text-sm font-semibold leading-none mt-0.5',\n isCompleted || isActive ? 'text-z-primary' : 'text-z-secondary'\n )}\n >\n {idx + 1}. {s.label}\n </span>\n </div>\n )\n })}\n </div>\n\n {/* STEP CONTENT SWITCHER */}\n <div className=\"min-h-[220px] flex flex-col justify-between gap-5\">\n {deployStep === 0 && (\n <div className=\"space-y-5\">\n {/* Provider Select Cards */}\n <div className=\"space-y-2\">\n <label className=\"text-sm font-semibold text-z-secondary leading-none\">\n 1. Select Cloud Deployment Target\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {[\n { id: 'vercel', name: 'Vercel Edge', latency: 'Fastest' },\n { id: 'netlify', name: 'Netlify CDN', latency: 'Stable' },\n { id: 'cloudflare', name: 'Cloudflare Pages', latency: 'Zero-Lag' },\n ].map((prov) => (\n <button\n key={prov.id}\n onClick={() => setProvider(prov.id as any)}\n className={cn(\n 'border p-3 flex flex-col items-center justify-center gap-2 rounded-none-none transition-all group relative',\n provider === prov.id\n ? 'bg-z-panel border-z-border text-z-primary shadow-sm'\n : 'bg-z-panel border-z-border text-z-secondary hover:text-z-secondary hover:border-z-border'\n )}\n >\n <span className=\"text-xs font-semibold\">\n {prov.name}\n </span>\n <span\n className={cn(\n 'text-sm font-mono px-1.5 py-0.5 rounded-none-none border',\n provider === prov.id\n ? 'border-z-border/30 text-z-secondary bg-z-hover'\n : 'border-z-border text-z-secondary bg-z-hover'\n )}\n >\n {prov.latency}\n </span>\n </button>\n ))}\n </div>\n </div>\n\n {/* Repo Metadata display */}\n <div\n className={cn(\n 'p-4 border rounded-none-none flex items-center justify-between gap-4',\n theme === 'dark' ? 'bg-z-panel/5 border-z-border' : 'bg-z-input border-z-border shadow-sm'\n )}\n >\n <div className=\"flex items-center gap-3\">\n <GitBranch size={16} className=\"text-z-secondary\" />\n <div className=\"flex flex-col\">\n <span className=\"text-sm font-semibold leading-none text-z-primary\">\n AmanTShekar/{selectedTemplate.slug}\n </span>\n <span className=\"text-sm font-bold text-z-secondary mt-1\">\n GitHub Repository Handshake\n </span>\n </div>\n </div>\n <div className=\"flex items-center gap-1 text-sm font-mono text-z-secondary px-2 py-1 bg-z-hover border border-z-border/20\">\n ● CONNECTED\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"pt-4 border-t border-z-border flex justify-end\">\n <button\n onClick={handleStartDeployment}\n className={cn(\n 'px-8 py-3.5 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary',\n selectedTemplate.primaryColor\n )}\n >\n <CloudLightning size={12} />\n Trigger Pipeline\n </button>\n </div>\n </div>\n )}\n\n {/* SIMULATED ANIMATED TERMINAL / PROGRESS LOGS */}\n {(deployStep === 1 || deployStep === 2 || deployStep === 3) && (\n <div className=\"space-y-4 flex-1 flex flex-col\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2.5\">\n <Terminal size={14} className=\"text-z-secondary\" />\n <span className=\"text-sm font-semibold text-z-secondary\">\n Simulated Edge Console Output\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"w-1.5 h-1.5 rounded-none-none bg-amber-500 animate-ping\" />\n <span className=\"text-sm font-mono text-amber-500 font-semibold\">\n {deployStep === 1\n ? 'GIT_FETCH'\n : deployStep === 2\n ? 'COMPILING'\n : 'EDGE_ROUTING'}\n </span>\n </div>\n </div>\n\n {/* Console Logger */}\n <div className=\"flex-1 min-h-[160px] bg-app border border-z-border p-4 font-mono text-sm text-z-muted overflow-y-auto space-y-1.5 scroll-smooth\">\n {terminalLogs.map((log, idx) => (\n <div\n key={idx}\n className={cn(\n 'leading-relaxed ',\n log.startsWith('[error]')\n ? 'text-red-500'\n : log.startsWith('[build]')\n ? 'text-z-secondary'\n : log.startsWith('[network]')\n ? 'text-z-active-text'\n : 'text-z-secondary'\n )}\n >\n <span className=\"text-z-secondary mr-2\">[{idx + 1}]</span>\n {log}\n </div>\n ))}\n {/* Interactive Cursor */}\n <div className=\"flex items-center gap-1\">\n <span className=\"text-z-secondary mr-2\">[{terminalLogs.length + 1}]</span>\n <div className=\"w-1.5 h-3 bg-z-border animate-pulse\" />\n </div>\n </div>\n </div>\n )}\n\n {/* SUCCESS STAGE */}\n {deployStep === 4 && (\n <div className=\"space-y-6 text-center py-4\">\n <motion.div\n initial={{ scale: 0.5, opacity: 0 }}\n animate={{ scale: 1, opacity: 1 }}\n transition={{ type: 'spring', stiffness: 200, damping: 15 }}\n className=\"w-16 h-16 bg-z-panel border border-z-border/30 rounded-none-none flex items-center justify-center mx-auto text-z-secondary shadow-sm\"\n >\n <CheckCircle2 size={32} strokeWidth={2.5} />\n </motion.div>\n\n <div className=\"space-y-2\">\n <h4 className=\"text-lg font-semibold leading-none text-z-primary\">\n Production Live Ready\n </h4>\n <p className=\"text-sm text-z-secondary max-w-sm mx-auto leading-relaxed\">\n Continuous deployment webhook registered. Updates pushed to git main will trigger\n regenerations.\n </p>\n </div>\n\n {/* Clipboard copy container */}\n <div\n className={cn(\n 'max-w-md mx-auto p-4 border rounded-none-none flex items-center justify-between gap-4 bg-z-panel',\n theme === 'dark' ? 'border-z-border' : 'border-z-border shadow-sm'\n )}\n >\n <div className=\"flex items-center gap-3 min-w-0\">\n <Globe size={16} className=\"text-z-secondary shrink-0\" />\n <span className=\"text-sm font-semibold text-z-primary truncate font-mono\">\n {liveUrl}\n </span>\n </div>\n <button\n onClick={() => copyToClipboard(liveUrl)}\n className={cn(\n 'p-2.5 rounded-none-none border transition-all flex items-center justify-center shrink-0',\n copied\n ? 'bg-z-panel border-z-border/30 text-z-secondary'\n : 'bg-z-hover border-z-border text-z-muted hover:text-z-primary'\n )}\n >\n {copied ? <Check size={14} /> : <Copy size={14} />}\n </button>\n </div>\n\n <div className=\"pt-4 border-t border-z-border flex items-center justify-between gap-4 max-w-md mx-auto\">\n <button\n onClick={() => setIsDeployModalOpen(false)}\n className={cn(\n 'w-full py-3.5 border rounded-none-none text-sm font-semibold transition-all leading-none',\n theme === 'dark'\n ? 'border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border'\n : 'border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong'\n )}\n >\n Dismiss Console\n </button>\n <a\n href={liveUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className={cn(\n 'w-full py-3.5 rounded-none-none text-sm font-semibold transition-all leading-none flex items-center justify-center gap-2 text-z-primary',\n selectedTemplate.primaryColor\n )}\n >\n Launch Storefront\n <ExternalLink size={10} />\n </a>\n </div>\n </div>\n )}\n </div>\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n </div>\n </div>\n )\n}\n\nexport default TemplatesPage\n"],"mappings":"wYA4CM,MAAgC,CACrC,GAAM,CAAC,EAAW,IAAA,EAAA,EAAA,SAAA,CAAqC,CAAC,CAAC,EACnD,CAAE,SAAU,EAAS,EACrB,EAAiB,aAAa,QAAQ,gBAAgB,GAAK,GAC3D,CAAC,EAAa,KAAA,EAAA,EAAA,SAAA,CAA2B,EAAE,EAC3C,CAAC,EAAgB,IAAA,EAAA,EAAA,SAAA,CAAsC,KAAK,EAC5D,CAAC,EAAkB,IAAA,EAAA,EAAA,SAAA,CAAiD,IAAI,EACxE,CAAC,EAAmB,IAAA,EAAA,EAAA,SAAA,CAAiC,EAAK,EAC1D,CAAC,EAAU,IAAA,EAAA,EAAA,SAAA,CAA6D,QAAQ,EAChF,CAAC,EAAY,IAAA,EAAA,EAAA,SAAA,CAAkC,CAAC,EAChD,CAAC,EAAc,IAAA,EAAA,EAAA,SAAA,CAAsC,CAAC,CAAC,EACvD,CAAC,EAAS,IAAA,EAAA,EAAA,SAAA,CAAuB,EAAE,EACnC,CAAC,EAAQ,IAAA,EAAA,EAAA,SAAA,CAAsB,EAAK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L,EAAA,EAAA,KAAA,CAAC,MAAD,CACE,UAAW,EACT,mGACA,IAAU,OAAS,kBAAoB,2BACzC,WAJF,EAME,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,2CAAf,EACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAO,KAAM,GAAI,UAAU,2BAA6B,CAAA,GACxD,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mEACb,CACG,CAAA,CACH,KACL,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,YAAe,GAAgB,CAAO,EACtC,UAAW,EACT,0FACA,EACI,iDACA,8DACN,WAEC,GAAS,EAAA,EAAA,IAAA,CAAC,EAAD,CAAO,KAAM,EAAK,CAAA,GAAI,EAAA,EAAA,IAAA,CAAC,EAAD,CAAM,KAAM,EAAK,CAAA,CAC3C,CAAA,CACL,KAEL,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,kGAAf,EACE,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,YAAe,EAAqB,EAAK,EACzC,UAAW,EACT,6FACA,IAAU,OACN,qFACA,+FACN,WACD,iBAEO,CAAA,GACR,EAAA,EAAA,KAAA,CAAC,IAAD,CACE,KAAM,EACN,OAAO,SACP,IAAI,aACJ,UAAW,EACT,4IACA,EAAiB,YACnB,WAPF,CAQC,qBAEC,EAAA,EAAA,IAAA,CAAC,EAAD,CAAc,KAAM,EAAK,CAAA,CACxB,GACA,GACF,GAEJ,GACK,GACT,GAEQ,CAAA,CACd,GACF,GAET"}
1
+ {"version":3,"file":"TemplatesPage-BplB2ksb.js","names":[],"sources":["../../src/pages/TemplatesPage.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\nimport {\n Layout,\n GitBranch,\n GitFork,\n ExternalLink,\n Globe,\n Server,\n CheckCircle2,\n ArrowRight,\n Terminal,\n CloudLightning,\n Sparkles,\n Search,\n Layers,\n Activity,\n Copy,\n Check,\n Download,\n} from 'lucide-react'\nimport { motion, AnimatePresence } from 'framer-motion'\nimport { cn } from '../lib/utils'\nimport { useTheme } from '../context/ThemeContext'\nimport toast from 'react-hot-toast'\nimport { PageHeader } from '../components/ui/PageHeader'\nimport { Card, CardContent } from '../components/ui/Card'\nimport api from '../lib/api'\n\ninterface Template {\n id: string\n name: string\n version: string\n description: string\n gitUrl: string\n tags: string[]\n stars: number\n performanceScore: number\n primaryColor: string\n accentColor: string\n features: string[]\n category: string\n slug: string\n}\n\nconst TemplatesPage: React.FC = () => {\n const [templates, setTemplates] = useState<Template[]>([])\n const { theme } = useTheme()\n const activeSiteSlug = localStorage.getItem('activeSiteSlug') || ''\n const [searchQuery, setSearchQuery] = useState('')\n const [activeCategory, setActiveCategory] = useState<string>('All')\n const [selectedTemplate, setSelectedTemplate] = useState<Template | null>(null)\n const [isDeployModalOpen, setIsDeployModalOpen] = useState(false)\n const [provider, setProvider] = useState<'vercel' | 'netlify' | 'cloudflare'>('vercel')\n const [deployStep, setDeployStep] = useState<number>(0) // 0: Config, 1: Connecting, 2: Building, 3: Routing, 4: Success\n const [terminalLogs, setTerminalLogs] = useState<string[]>([])\n const [liveUrl, setLiveUrl] = useState('')\n const [copied, setCopied] = useState(false)\n\n const logIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null)\n const buildIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null)\n const networkIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null)\n\n useEffect(() => {\n api.get('/system/templates').then(res => {\n setTemplates(res.data.templates || [])\n }).catch(err => console.error('Failed to load templates', err))\n\n return () => {\n if (logIntervalRef.current) clearInterval(logIntervalRef.current)\n if (buildIntervalRef.current) clearInterval(buildIntervalRef.current)\n if (networkIntervalRef.current) clearInterval(networkIntervalRef.current)\n }\n }, [])\n\n // Filter Categories\n const categories = ['All', 'E-Commerce / Portfolio', 'Editorial / Blog']\n\n const filteredTemplates = templates.filter((template) => {\n const matchesSearch =\n template.name.toLowerCase().includes(searchQuery.toLowerCase()) ||\n template.description.toLowerCase().includes(searchQuery.toLowerCase()) ||\n template.tags.some((tag) => tag.toLowerCase().includes(searchQuery.toLowerCase()))\n const matchesCategory = activeCategory === 'All' || template.category === activeCategory\n return matchesSearch && matchesCategory\n })\n\n // Start continuous deployment simulation\n const handleStartDeployment = () => {\n if (!selectedTemplate) return\n setDeployStep(1)\n setTerminalLogs([])\n \n // Simulate terminal logs generator\n const logs = [\n `[system] Initializing deployment protocol for @zenith-open/${selectedTemplate.slug}...`,\n `[system] Selected target provider: ${provider.toUpperCase()}`,\n `[git] Cloning repository from ${selectedTemplate.gitUrl}...`,\n `[git] Branch: main (HEAD resolved to latest secure release v${selectedTemplate.version})`,\n `[system] Provisioning sandbox container on global edge node...`,\n `[system] Installing workspace dependencies via pnpm...`,\n `[build] Resolving node modules: 173 packages successfully installed.`,\n `[build] Starting project compile step: \"pnpm run build\"...`,\n `[build] vite v1.0.0-beta building for production...`,\n `[build] 42 modules transformed.`,\n `[build] dist/assets/index-D8g9sK.js 142.64 kB │ gzip: 43.12 kB`,\n `[build] dist/assets/index-C1h8aD.css 31.42 kB │ gzip: 8.94 kB`,\n `[build] built in 1.48s`,\n `[system] Bundle generated successfully!`,\n `[network] Uploading assets to global Edge CDN caching layers...`,\n `[network] Synchronizing routing configurations & static revalidation rules...`,\n `[network] Activating secure SameSite=Strict endpoints and HTTPS configurations...`,\n `[system] Deployment completed. SSL handshake verified!`,\n ]\n\n let logIndex = 0\n const logInterval = setInterval(() => {\n if (logIndex < 6) {\n setTerminalLogs((prev) => [...prev, logs[logIndex]])\n logIndex++\n } else {\n clearInterval(logInterval)\n logIntervalRef.current = null\n setDeployStep(2) // Move to Building state\n \n let buildLogIndex = 6\n const buildInterval = setInterval(() => {\n if (buildLogIndex < 13) {\n setTerminalLogs((prev) => [...prev, logs[buildLogIndex]])\n buildLogIndex++\n } else {\n clearInterval(buildInterval)\n buildIntervalRef.current = null\n setDeployStep(3) // Move to Edge Routing state\n \n let networkLogIndex = 13\n const networkInterval = setInterval(() => {\n if (networkLogIndex < logs.length) {\n setTerminalLogs((prev) => [...prev, logs[networkLogIndex]])\n networkLogIndex++\n } else {\n clearInterval(networkInterval)\n networkIntervalRef.current = null\n setDeployStep(4) // Success!\n setLiveUrl(`https://zenith-${selectedTemplate.slug}.${provider}.app`)\n toast.success('Storefront successfully deployed!')\n }\n }, 800)\n networkIntervalRef.current = networkInterval\n }\n }, 600)\n buildIntervalRef.current = buildInterval\n }\n }, 450)\n logIntervalRef.current = logInterval\n }\n\n const copyToClipboard = (text: string) => {\n navigator.clipboard.writeText(text)\n setCopied(true)\n toast.success('Live URL copied to clipboard!')\n setTimeout(() => setCopied(false), 2000)\n }\n\n return (\n <div className=\"flex flex-col h-[calc(100vh-64px)] overflow-hidden\">\n <PageHeader\n title=\"Templates\"\n actions={\n <div\n className={cn(\n 'p-1 rounded-none-none border flex items-center shadow-sm backdrop-blur-xl',\n 'bg-z-panel border-z-border shadow-sm'\n )}\n >\n {categories.map((cat) => (\n <button\n key={cat}\n onClick={() => setActiveCategory(cat)}\n className={cn(\n 'px-4 py-2 text-sm font-semibold rounded-none-none transition-all leading-none whitespace-nowrap',\n activeCategory === cat\n ? theme === 'dark'\n ? 'bg-z-panel text-z-primary shadow-lg'\n : 'bg-z-accent text-z-primary shadow-lg'\n : 'text-z-secondary hover:text-z-primary'\n )}\n >\n {cat}\n </button>\n ))}\n </div>\n }\n />\n\n <div className={cn(\n 'flex-1 overflow-y-auto p-6 md:p-10 space-y-8 transition-colors duration-500 relative pb-12',\n theme === 'dark' ? 'bg-app text-z-primary' : 'bg-[#fafafa] text-z-primary'\n )}>\n {/* High-Tech Glassmorphic Hero Panel */}\n <div\n className={cn(\n 'relative p-6 md:p-8 overflow-hidden border backdrop-blur-xl shadow-xl flex flex-col md:flex-row md:items-center md:justify-between gap-6 transition-all',\n theme === 'dark'\n ? 'bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-[var(--z-border)]'\n : 'bg-gradient-to-r from-[var(--z-bg-panel)] via-[var(--z-bg-base)] to-[var(--z-bg-panel)] border-z-border shadow-sm'\n )}\n >\n <div className=\"absolute top-0 right-0 w-80 h-80 bg-z-panel blur-[100px] pointer-events-none rounded-none-none\" />\n <div className=\"absolute bottom-0 left-0 w-80 h-80 bg-z-hover blur-[100px] pointer-events-none rounded-none-none\" />\n\n <div className=\"flex-1 space-y-2 z-10\">\n <div className=\"flex items-center gap-2 text-z-secondary \">\n <Sparkles size={16} className=\"animate-pulse\" />\n <span className=\"text-sm font-semibold\">\n Sandbox\n </span>\n </div>\n <h2 className=\"text-2xl font-semibold leading-tight\">\n Deploy Templates\n </h2>\n </div>\n\n {/* Search Input Box */}\n <div\n className={cn(\n 'flex items-center gap-4 px-5 py-3 rounded-none-none border shadow-inner w-full md:max-w-xs transition-all group z-10 shrink-0 self-start md:self-auto',\n theme === 'dark' ? 'bg-z-hover border-z-border' : 'bg-z-panel border-z-border shadow-sm shadow-sm'\n )}\n >\n <Search\n size={14}\n className=\"text-z-secondary group-focus-within:text-z-secondary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder=\"Filter by tech or tags...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"bg-transparent border-none outline-none focus-visible:ring-2 focus-visible:ring-z-active-border focus-visible:ring-offset-1 focus-visible:ring-offset-black text-sm font-semibold text-z-muted w-full placeholder:text-z-secondary\"\n />\n </div>\n </div>\n\n {/* Showcase Cards Grid */}\n {filteredTemplates.length === 0 ? (\n <div className=\"py-24 flex flex-col items-center justify-center gap-4 opacity-30 border border-dashed border-z-border\">\n <Layout size={40} strokeWidth={1} className=\"text-z-secondary animate-pulse\" />\n <p className=\"text-sm font-semibold\">\n No templates matching filters found\n </p>\n </div>\n ) : (\n <div className=\"grid grid-cols-1 xl:grid-cols-2 gap-6\">\n <AnimatePresence mode=\"popLayout\">\n {filteredTemplates.map((template) => (\n <Card\n key={template.id}\n interactive\n padding=\"none\"\n className=\"flex flex-col relative group\"\n >\n <CardContent className=\"flex flex-col flex-1 gap-6\">\n {/* Accent Highlight Bar */}\n <div\n className={cn(\n 'absolute top-0 left-0 right-0 h-1 bg-gradient-to-r opacity-60 group-hover:opacity-100 transition-opacity',\n template.primaryColor\n )}\n />\n\n {/* Card Title Header */}\n <div className=\"flex flex-col sm:flex-row sm:items-start justify-between gap-4\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2.5\">\n <span className=\"text-sm font-semibold text-z-secondary\">\n {template.category}\n </span>\n <span className=\"w-1 h-1 bg-z-border rounded-none-none\" />\n <span className=\"text-sm font-mono font-semibold text-z-secondary\">\n v{template.version}\n </span>\n {template.slug === activeSiteSlug && (\n <div className=\"flex items-center gap-1.5 px-2 py-0.5 bg-z-panel text-z-secondary border border-z-border/20 text-sm font-semibold leading-none\">\n <Activity size={8} />\n Active Workspace / Site\n </div>\n )}\n </div>\n <h3 className=\"text-xl font-semibold leading-none group-hover:text-z-secondary transition-colors mt-1.5\">\n {template.name}\n </h3>\n </div>\n\n {/* Performance Matrix */}\n <div className=\"flex items-center gap-3 shrink-0\">\n <div className=\"flex flex-col items-end\">\n <span className=\"text-sm font-semibold text-z-secondary leading-none\">\n Lighthouse\n </span>\n <span className=\"text-lg font-semibold text-z-secondary mt-1\">\n {template.performanceScore}%\n </span>\n </div>\n <div className=\"w-9 h-9 rounded-none-none border border-z-border/20 bg-z-hover flex items-center justify-center text-z-secondary font-bold text-xs\">\n {template.performanceScore}\n </div>\n </div>\n </div>\n\n {/* Custom Gradient Mock Image Area */}\n <div\n className={cn(\n 'w-full h-40 rounded-none-none relative overflow-hidden border transition-all duration-500 flex items-center justify-center group-hover:scale-[1.01]',\n theme === 'dark' ? 'bg-app border-z-border' : 'bg-z-input border-z-border shadow-sm'\n )}\n >\n {/* Glass Card Vector Grid Backdrop */}\n <div className=\"absolute inset-0 bg-grid-pattern opacity-[0.03] pointer-events-none\" />\n <div\n className={cn(\n 'absolute w-48 h-48 rounded-none-none blur-[60px] opacity-20 bg-gradient-to-br',\n template.primaryColor\n )}\n />\n\n {/* Decorative Elements mimicking UI */}\n <div className=\"w-5/6 h-2/3 border border-z-border rounded-none-none bg-z-panel backdrop-blur-md p-4 flex flex-col justify-between shadow-2xl relative overflow-hidden\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex gap-1.5\">\n <div className=\"w-2 h-2 rounded-none-none bg-red-500/40\" />\n <div className=\"w-2 h-2 rounded-none-none bg-yellow-500/40\" />\n <div className=\"w-2 h-2 rounded-none-none bg-green-500/40\" />\n </div>\n <div className=\"px-2 py-0.5 bg-z-hover border border-z-border rounded-none-none text-sm font-mono text-z-secondary\">\n SECURE_SSL\n </div>\n </div>\n\n <div className=\"space-y-1.5 my-2\">\n <div className=\"h-2 w-1/3 bg-z-hover rounded-none-none\" />\n <div className=\"h-1.5 w-2/3 bg-z-hover rounded-none-none\" />\n <div className=\"h-1.5 w-1/2 bg-z-hover rounded-none-none\" />\n </div>\n\n <div className=\"flex justify-between items-center pt-2 border-t border-z-border\">\n <div className=\"flex items-center gap-1 text-z-secondary text-sm font-semibold\">\n <Layers size={8} /> {template.id === 'storefront-glass' ? 'Glassmorphism' : template.id === 'storefront-editorial' ? 'Editorial' : template.id === 'blog-demo' ? 'Dev Blog' : 'E-Commerce'}\n </div>\n <div className=\"w-8 h-3 bg-z-hover rounded-none-none\" />\n </div>\n </div>\n </div>\n\n {/* Features Highlights */}\n <div className=\"space-y-2\">\n <span className=\"text-sm font-semibold text-z-secondary leading-none\">\n Core Specifications\n </span>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-2 mt-1\">\n {template.features.map((feat, idx) => (\n <div key={idx} className=\"flex items-center gap-2 text-xs text-z-secondary\">\n <div className=\"w-1.5 h-1.5 bg-z-border/40 border border-z-border rounded-none-none shrink-0\" />\n <span className=\"truncate\">{feat}</span>\n </div>\n ))}\n </div>\n </div>\n\n {/* Tags */}\n <div className=\"flex flex-wrap gap-1.5\">\n {template.tags.map((tag) => (\n <span\n key={tag}\n className={cn(\n 'px-2 py-1 text-sm font-mono font-semibold border rounded-none-none shadow-sm',\n theme === 'dark'\n ? 'bg-z-hover border-z-border text-z-secondary'\n : 'bg-[var(--z-bg-hover)] border-z-border text-z-secondary'\n )}\n >\n {tag}\n </span>\n ))}\n </div>\n\n {/* Clone Command & Zip Download */}\n <div className={cn(\n 'p-3 border rounded-none-none flex items-center justify-between gap-3 text-sm font-mono',\n theme === 'dark' ? 'bg-app border-z-border text-z-muted' : 'bg-z-input border-z-border text-z-secondary'\n )}>\n <div className=\"flex items-center gap-1.5 truncate\">\n <Terminal size={10} className=\"text-z-secondary\" />\n <span className=\"truncate select-all\">git clone {template.gitUrl}.git</span>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <button\n onClick={() => {\n navigator.clipboard.writeText(`git clone ${template.gitUrl}.git`)\n toast.success('Clone command copied!')\n }}\n className={cn(\n 'p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95',\n theme === 'dark' ? 'border-z-border bg-z-hover hover:text-z-primary' : 'border-z-border bg-z-panel hover:text-z-primary'\n )}\n title=\"Copy clone command\"\n >\n <Copy size={10} />\n </button>\n <a\n href={`${template.gitUrl}/archive/refs/heads/main.zip`}\n className={cn(\n 'p-1.5 rounded-none-none border transition-all flex items-center justify-center hover:scale-105 active:scale-95',\n theme === 'dark' ? 'border-z-border bg-z-hover text-z-muted hover:text-z-primary' : 'border-z-border bg-z-panel text-z-secondary hover:text-z-primary'\n )}\n title=\"Download ZIP\"\n >\n <Download size={10} />\n </a>\n </div>\n </div>\n\n {/* Git Action Panel */}\n <div className=\"pt-4 border-t border-z-border mt-auto flex items-center justify-between gap-4\">\n <a\n href={template.gitUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className={cn(\n 'px-4 py-3 border rounded-none-none text-sm font-semibold transition-all leading-none flex items-center gap-2 group/git',\n theme === 'dark'\n ? 'border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border'\n : 'border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong shadow-sm'\n )}\n >\n <GitFork size={12} className=\"group-hover/git:rotate-12 transition-transform\" />\n Git Repository\n <ExternalLink size={10} className=\"opacity-40 group-hover/git:opacity-100 transition-opacity\" />\n </a>\n\n <button\n onClick={() => {\n setSelectedTemplate(template)\n setDeployStep(0)\n setIsDeployModalOpen(true)\n }}\n className={cn(\n 'px-5 py-3 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary',\n template.primaryColor\n )}\n style={{\n boxShadow: `0 4px 15px -4px ${template.accentColor}33`,\n }}\n >\n <CloudLightning size={12} className=\"animate-bounce\" />\n Deploy Instance\n <ArrowRight size={10} className=\"group-hover:translate-x-0.5 transition-transform\" />\n </button>\n </div>\n </CardContent>\n </Card>\n ))}\n </AnimatePresence>\n </div>\n )}\n\n {/* Tactical Continuous Deployment Overlay Modal */}\n <AnimatePresence>\n {isDeployModalOpen && selectedTemplate && (\n <div className=\"fixed inset-0 z-55 flex items-center justify-center p-4\">\n {/* Backdrop blur overlay */}\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n onClick={() => {\n // Prevent accidental closure during deployment build sequence\n if (deployStep === 0 || deployStep === 4) {\n setIsDeployModalOpen(false)\n } else {\n toast.error('Build sequence in progress. Please wait for termination.')\n }\n }}\n className=\"absolute inset-0 bg-[var(--z-bg-modal)] backdrop-blur-xl\"\n />\n\n {/* Modal Box */}\n <motion.div\n initial={{ scale: 0.95, opacity: 0, y: 10 }}\n animate={{ scale: 1, opacity: 1, y: 0 }}\n exit={{ scale: 0.95, opacity: 0, y: 10 }}\n transition={{ duration: 0.35, ease: [0.16, 1, 0.3, 1] }}\n className={cn(\n 'w-full max-w-2xl border rounded-none-none p-6 md:p-8 flex flex-col gap-6 relative shadow-2xl overflow-hidden z-10',\n theme === 'dark' ? 'bg-app border-z-border' : 'bg-z-panel border-z-border'\n )}\n >\n {/* Top Accent Gradient Bar */}\n <div\n className={cn(\n 'absolute top-0 left-0 right-0 h-1.5 bg-gradient-to-r',\n selectedTemplate.primaryColor\n )}\n />\n\n {/* Close Panel Button */}\n {(deployStep === 0 || deployStep === 4) && (\n <button\n onClick={() => setIsDeployModalOpen(false)}\n className={cn(\n 'absolute top-6 right-6 w-8 h-8 rounded-none-none border flex items-center justify-center text-z-secondary hover:text-z-primary transition-all',\n theme === 'dark' ? 'bg-z-hover border-z-border' : 'bg-z-input border-z-border'\n )}\n >\n \n </button>\n )}\n\n {/* Step Title Header */}\n <div className=\"flex items-center gap-4\">\n <div\n className={cn(\n 'w-10 h-10 rounded-none-none flex items-center justify-center text-z-primary',\n selectedTemplate.primaryColor\n )}\n >\n <Server size={18} />\n </div>\n <div>\n <span className=\"text-sm font-semibold text-z-secondary block\">\n Zero-Config Handshake\n </span>\n <h3 className=\"text-xl font-semibold leading-none mt-1\">\n {deployStep === 4 ? 'Deploy Successful!' : `Deploying ${selectedTemplate.name}`}\n </h3>\n </div>\n </div>\n\n {/* Active Deployment Stepper */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-2 border-b border-z-border pb-5\">\n {[\n { label: 'Configure', activeStep: 0 },\n { label: 'Connect Repo', activeStep: 1 },\n { label: 'Compile Code', activeStep: 2 },\n { label: 'Route Domain', activeStep: 3 },\n ].map((s, idx) => {\n const isCompleted = deployStep > s.activeStep || deployStep === 4\n const isActive = deployStep === s.activeStep\n return (\n <div key={idx} className=\"flex flex-col gap-1.5\">\n <div\n className={cn(\n 'h-1 w-full rounded-none-none transition-all duration-500',\n isCompleted\n ? 'bg-z-border shadow-sm'\n : isActive\n ? 'bg-amber-500 animate-pulse'\n : 'bg-z-hover'\n )}\n />\n <span\n className={cn(\n 'text-sm font-semibold leading-none mt-0.5',\n isCompleted || isActive ? 'text-z-primary' : 'text-z-secondary'\n )}\n >\n {idx + 1}. {s.label}\n </span>\n </div>\n )\n })}\n </div>\n\n {/* STEP CONTENT SWITCHER */}\n <div className=\"min-h-[220px] flex flex-col justify-between gap-5\">\n {deployStep === 0 && (\n <div className=\"space-y-5\">\n {/* Provider Select Cards */}\n <div className=\"space-y-2\">\n <label className=\"text-sm font-semibold text-z-secondary leading-none\">\n 1. Select Cloud Deployment Target\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {[\n { id: 'vercel', name: 'Vercel Edge', latency: 'Fastest' },\n { id: 'netlify', name: 'Netlify CDN', latency: 'Stable' },\n { id: 'cloudflare', name: 'Cloudflare Pages', latency: 'Zero-Lag' },\n ].map((prov) => (\n <button\n key={prov.id}\n onClick={() => setProvider(prov.id as any)}\n className={cn(\n 'border p-3 flex flex-col items-center justify-center gap-2 rounded-none-none transition-all group relative',\n provider === prov.id\n ? 'bg-z-panel border-z-border text-z-primary shadow-sm'\n : 'bg-z-panel border-z-border text-z-secondary hover:text-z-secondary hover:border-z-border'\n )}\n >\n <span className=\"text-xs font-semibold\">\n {prov.name}\n </span>\n <span\n className={cn(\n 'text-sm font-mono px-1.5 py-0.5 rounded-none-none border',\n provider === prov.id\n ? 'border-z-border/30 text-z-secondary bg-z-hover'\n : 'border-z-border text-z-secondary bg-z-hover'\n )}\n >\n {prov.latency}\n </span>\n </button>\n ))}\n </div>\n </div>\n\n {/* Repo Metadata display */}\n <div\n className={cn(\n 'p-4 border rounded-none-none flex items-center justify-between gap-4',\n theme === 'dark' ? 'bg-z-panel/5 border-z-border' : 'bg-z-input border-z-border shadow-sm'\n )}\n >\n <div className=\"flex items-center gap-3\">\n <GitBranch size={16} className=\"text-z-secondary\" />\n <div className=\"flex flex-col\">\n <span className=\"text-sm font-semibold leading-none text-z-primary\">\n AmanTShekar/{selectedTemplate.slug}\n </span>\n <span className=\"text-sm font-bold text-z-secondary mt-1\">\n GitHub Repository Handshake\n </span>\n </div>\n </div>\n <div className=\"flex items-center gap-1 text-sm font-mono text-z-secondary px-2 py-1 bg-z-hover border border-z-border/20\">\n ● CONNECTED\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"pt-4 border-t border-z-border flex justify-end\">\n <button\n onClick={handleStartDeployment}\n className={cn(\n 'px-8 py-3.5 rounded-none-none text-sm font-semibold shadow-lg transition-all leading-none flex items-center gap-2 active:scale-95 text-z-primary',\n selectedTemplate.primaryColor\n )}\n >\n <CloudLightning size={12} />\n Trigger Pipeline\n </button>\n </div>\n </div>\n )}\n\n {/* SIMULATED ANIMATED TERMINAL / PROGRESS LOGS */}\n {(deployStep === 1 || deployStep === 2 || deployStep === 3) && (\n <div className=\"space-y-4 flex-1 flex flex-col\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2.5\">\n <Terminal size={14} className=\"text-z-secondary\" />\n <span className=\"text-sm font-semibold text-z-secondary\">\n Simulated Edge Console Output\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"w-1.5 h-1.5 rounded-none-none bg-amber-500 animate-ping\" />\n <span className=\"text-sm font-mono text-amber-500 font-semibold\">\n {deployStep === 1\n ? 'GIT_FETCH'\n : deployStep === 2\n ? 'COMPILING'\n : 'EDGE_ROUTING'}\n </span>\n </div>\n </div>\n\n {/* Console Logger */}\n <div className=\"flex-1 min-h-[160px] bg-app border border-z-border p-4 font-mono text-sm text-z-muted overflow-y-auto space-y-1.5 scroll-smooth\">\n {terminalLogs.map((log, idx) => (\n <div\n key={idx}\n className={cn(\n 'leading-relaxed ',\n log.startsWith('[error]')\n ? 'text-red-500'\n : log.startsWith('[build]')\n ? 'text-z-secondary'\n : log.startsWith('[network]')\n ? 'text-z-active-text'\n : 'text-z-secondary'\n )}\n >\n <span className=\"text-z-secondary mr-2\">[{idx + 1}]</span>\n {log}\n </div>\n ))}\n {/* Interactive Cursor */}\n <div className=\"flex items-center gap-1\">\n <span className=\"text-z-secondary mr-2\">[{terminalLogs.length + 1}]</span>\n <div className=\"w-1.5 h-3 bg-z-border animate-pulse\" />\n </div>\n </div>\n </div>\n )}\n\n {/* SUCCESS STAGE */}\n {deployStep === 4 && (\n <div className=\"space-y-6 text-center py-4\">\n <motion.div\n initial={{ scale: 0.5, opacity: 0 }}\n animate={{ scale: 1, opacity: 1 }}\n transition={{ type: 'spring', stiffness: 200, damping: 15 }}\n className=\"w-16 h-16 bg-z-panel border border-z-border/30 rounded-none-none flex items-center justify-center mx-auto text-z-secondary shadow-sm\"\n >\n <CheckCircle2 size={32} strokeWidth={2.5} />\n </motion.div>\n\n <div className=\"space-y-2\">\n <h4 className=\"text-lg font-semibold leading-none text-z-primary\">\n Production Live Ready\n </h4>\n <p className=\"text-sm text-z-secondary max-w-sm mx-auto leading-relaxed\">\n Continuous deployment webhook registered. Updates pushed to git main will trigger\n regenerations.\n </p>\n </div>\n\n {/* Clipboard copy container */}\n <div\n className={cn(\n 'max-w-md mx-auto p-4 border rounded-none-none flex items-center justify-between gap-4 bg-z-panel',\n theme === 'dark' ? 'border-z-border' : 'border-z-border shadow-sm'\n )}\n >\n <div className=\"flex items-center gap-3 min-w-0\">\n <Globe size={16} className=\"text-z-secondary shrink-0\" />\n <span className=\"text-sm font-semibold text-z-primary truncate font-mono\">\n {liveUrl}\n </span>\n </div>\n <button\n onClick={() => copyToClipboard(liveUrl)}\n className={cn(\n 'p-2.5 rounded-none-none border transition-all flex items-center justify-center shrink-0',\n copied\n ? 'bg-z-panel border-z-border/30 text-z-secondary'\n : 'bg-z-hover border-z-border text-z-muted hover:text-z-primary'\n )}\n >\n {copied ? <Check size={14} /> : <Copy size={14} />}\n </button>\n </div>\n\n <div className=\"pt-4 border-t border-z-border flex items-center justify-between gap-4 max-w-md mx-auto\">\n <button\n onClick={() => setIsDeployModalOpen(false)}\n className={cn(\n 'w-full py-3.5 border rounded-none-none text-sm font-semibold transition-all leading-none',\n theme === 'dark'\n ? 'border-z-border bg-z-panel text-z-muted hover:text-z-primary hover:border-z-border'\n : 'border-z-border bg-z-panel text-z-secondary hover:text-z-primary hover:border-z-border-strong'\n )}\n >\n Dismiss Console\n </button>\n <a\n href={liveUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className={cn(\n 'w-full py-3.5 rounded-none-none text-sm font-semibold transition-all leading-none flex items-center justify-center gap-2 text-z-primary',\n selectedTemplate.primaryColor\n )}\n >\n Launch Storefront\n <ExternalLink size={10} />\n </a>\n </div>\n </div>\n )}\n </div>\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n </div>\n </div>\n )\n}\n\nexport default TemplatesPage\n"],"mappings":"wYA4CM,MAAgC,CACrC,GAAM,CAAC,EAAW,IAAA,EAAA,EAAA,SAAA,CAAqC,CAAC,CAAC,EACnD,CAAE,SAAU,EAAS,EACrB,EAAiB,aAAa,QAAQ,gBAAgB,GAAK,GAC3D,CAAC,EAAa,KAAA,EAAA,EAAA,SAAA,CAA2B,EAAE,EAC3C,CAAC,EAAgB,IAAA,EAAA,EAAA,SAAA,CAAsC,KAAK,EAC5D,CAAC,EAAkB,IAAA,EAAA,EAAA,SAAA,CAAiD,IAAI,EACxE,CAAC,EAAmB,IAAA,EAAA,EAAA,SAAA,CAAiC,EAAK,EAC1D,CAAC,EAAU,IAAA,EAAA,EAAA,SAAA,CAA6D,QAAQ,EAChF,CAAC,EAAY,IAAA,EAAA,EAAA,SAAA,CAAkC,CAAC,EAChD,CAAC,EAAc,IAAA,EAAA,EAAA,SAAA,CAAsC,CAAC,CAAC,EACvD,CAAC,EAAS,IAAA,EAAA,EAAA,SAAA,CAAuB,EAAE,EACnC,CAAC,EAAQ,IAAA,EAAA,EAAA,SAAA,CAAsB,EAAK,EAEpC,GAAA,EAAA,EAAA,OAAA,CAA+D,IAAI,EACnE,GAAA,EAAA,EAAA,OAAA,CAAiE,IAAI,EACrE,GAAA,EAAA,EAAA,OAAA,CAAmE,IAAI,GAE5E,EAAA,EAAA,UAAA,MACE,EAAI,IAAI,mBAAmB,CAAC,CAAC,KAAK,GAAO,CACvC,EAAa,EAAI,KAAK,WAAa,CAAC,CAAC,CACvC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AM,UAAU,mEACb,CACG,CAAA,CACH,KACL,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,YAAe,GAAgB,CAAO,EACtC,UAAW,EACT,0FACA,EACI,iDACA,8DACN,WAEC,GAAS,EAAA,EAAA,IAAA,CAAC,EAAD,CAAO,KAAM,EAAK,CAAA,GAAI,EAAA,EAAA,IAAA,CAAC,EAAD,CAAM,KAAM,EAAK,CAAA,CAC3C,CAAA,CACL,KAEL,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,kGAAf,EACE,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,YAAe,EAAqB,EAAK,EACzC,UAAW,EACT,6FACA,IAAU,OACN,qFACA,+FACN,WACD,iBAEO,CAAA,GACR,EAAA,EAAA,KAAA,CAAC,IAAD,CACE,KAAM,EACN,OAAO,SACP,IAAI,aACJ,UAAW,EACT,4IACA,EAAiB,YACnB,WAPF,CAQC,qBAEC,EAAA,EAAA,IAAA,CAAC,EAAD,CAAc,KAAM,EAAK,CAAA,CACxB,GACA,GACF,GAEJ,GACK,GACT,GAEQ,CAAA,CACd,GACF,GAET"}
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{C as t,En as n,H as r,K as i,Ln as a,Wt as o,ir as s,l as c,rr as l,vr as u,xr as d}from"./vendor-react-DQVTOTFO.js";import{a as f,o as p,t as m}from"./utils-fgvbH6CB.js";import{d as h,f as g,p as _}from"./index-BkjytCms.js";var v=e(d(),1),y=u(),b=()=>{let{theme:e}=f(),u=e===`dark`,[d,b]=(0,v.useState)([]),[x,S]=(0,v.useState)([]),[C,w]=(0,v.useState)(!0),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(1),[k,A]=(0,v.useState)(1),[j,M]=(0,v.useState)(0),[N,P]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),[L,R]=(0,v.useState)(!1),[z,B]=(0,v.useState)(!1),[V,H]=(0,v.useState)(!1),[U,W]=(0,v.useState)(!1),G=(0,v.useCallback)(async()=>{w(!0);try{let e=(await p.get(`/trash`,{params:{page:D,limit:20,search:T||void 0}})).data;b(e.data||[]),A(e.meta?.pagination?.totalPages||1),M(e.meta?.pagination?.total||0),S(e.meta?.collections||[])}catch{c.error(`Failed to load trash`)}finally{w(!1)}},[D,T]);(0,v.useEffect)(()=>{G()},[G]);let K=async()=>{if(N){B(!0);try{await p.post(`/trash/restore`,{collection:N.collectionSlug,id:N._id}),c.success(`Document restored`),P(null),G()}catch(e){let t=e.response?.data?.error?.message||(e instanceof Error?e.message:String(e))||`Failed to restore`;c.error(t)}finally{B(!1)}}},q=async()=>{if(F){H(!0);try{await p.post(`/trash/purge`,{collection:F.collectionSlug,id:F._id}),c.success(`Document permanently deleted`),I(null),G()}catch(e){let t=e.response?.data?.error?.message||(e instanceof Error?e.message:String(e))||`Failed to purge`;c.error(t)}finally{H(!1)}}},J=async()=>{W(!0);try{await p.delete(`/trash?confirm=true`),c.success(`Trash emptied`),R(!1),G()}catch(e){let t=e.response?.data?.error?.message||(e instanceof Error?e.message:String(e))||`Failed to empty trash`;c.error(t)}finally{W(!1)}},Y=e=>{try{return new Date(e).toLocaleString()}catch{return e}};return(0,y.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-64px)] overflow-hidden`,children:[(0,y.jsx)(_,{title:`Trash / Graveyard`,description:`Recover deleted documents.`,icon:(0,y.jsx)(t,{size:24,className:`text-red-500`}),backLink:{to:`/`,label:`Dashboard`},actions:j>0&&(0,y.jsxs)(`button`,{onClick:()=>R(!0),className:`flex items-center gap-2 px-6 py-2.5 bg-red-600 hover:bg-red-500 shadow-sm text-z-primary text-sm font-semibold transition-all rounded-none`,children:[(0,y.jsx)(t,{size:14}),`Empty Trash`]})}),(0,y.jsxs)(`div`,{className:`flex-1 overflow-auto p-6 md:p-8 space-y-6`,children:[(0,y.jsxs)(`div`,{className:`max-w-md relative`,children:[(0,y.jsx)(r,{size:14,className:m(`absolute left-4 top-1/2 -translate-y-1/2`,u?`text-z-secondary`:`text-z-muted`)}),(0,y.jsx)(`input`,{type:`text`,value:T,onChange:e=>{E(e.target.value),O(1)},placeholder:`Search trashed items...`,className:m(`w-full pl-10 pr-4 py-2.5 text-sm font-semibold border outline-none focus-visible:ring-2 focus-visible:ring-red-500/50 transition-colors rounded-none shadow-sm`,`z-input`)})]}),(0,y.jsxs)(h,{children:[C?(0,y.jsx)(`div`,{className:`flex items-center justify-center py-20 gap-3`,children:(0,y.jsx)(a,{size:20,className:`animate-spin text-z-secondary`})}):d.length===0?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 gap-4 opacity-50`,children:[(0,y.jsx)(t,{size:32,className:`text-z-secondary`}),(0,y.jsx)(`p`,{className:`text-sm font-semibold text-z-secondary`,children:T?`No matching items`:`Trash is empty`})]}):(0,y.jsx)(`div`,{className:`overflow-x-auto min-w-full`,children:(0,y.jsxs)(`table`,{className:`w-full text-left border-collapse`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{className:m(`text-sm font-semibold border-b`,`text-z-secondary border-z-border`),children:[(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal`,children:`Title`}),(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal w-40 hidden sm:table-cell`,children:`Collection`}),(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal w-44 hidden md:table-cell`,children:`Deleted At`}),(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal w-32`})]})}),(0,y.jsx)(`tbody`,{children:d.map(e=>(0,y.jsxs)(`tr`,{className:m(`text-xs border-b transition-colors`,u?`border-z-border hover:bg-z-panel`:`border-z-border hover:bg-[var(--z-bg-input)]`),children:[(0,y.jsx)(`td`,{className:`px-5 py-4`,children:(0,y.jsx)(`span`,{className:m(`font-bold`,`text-z-primary`),children:e.title})}),(0,y.jsx)(`td`,{className:`px-5 py-4 hidden sm:table-cell`,children:(0,y.jsxs)(`span`,{className:m(`inline-flex items-center gap-1.5 px-2 py-1 text-sm font-semibold `,u?`bg-z-hover text-z-muted`:`bg-[var(--z-bg-hover)] text-z-secondary`),children:[(0,y.jsx)(o,{size:10}),e.collectionName]})}),(0,y.jsx)(`td`,{className:`px-5 py-4 hidden md:table-cell`,children:(0,y.jsx)(`span`,{className:m(`text-sm font-mono`,u?`text-z-secondary`:`text-z-muted`),children:Y(e.deletedAt)})}),(0,y.jsx)(`td`,{className:`px-5 py-4`,children:(0,y.jsxs)(`div`,{className:`flex items-center gap-2 justify-end`,children:[(0,y.jsx)(`button`,{onClick:()=>P(e),className:m(`p-1.5 border transition-all rounded-none`,`border-z-border text-z-secondary hover:text-z-primary`),title:`Restore`,children:(0,y.jsx)(i,{size:12})}),(0,y.jsx)(`button`,{onClick:()=>I(e),className:`p-1.5 border rounded-none border-red-500/20 text-red-500 hover:bg-red-500/10 transition-all`,title:`Permanently delete`,children:(0,y.jsx)(t,{size:12})})]})})]},`${e.collectionSlug}-${e._id}`))})]})}),k>1&&(0,y.jsxs)(`div`,{className:m(`flex items-center justify-between px-5 py-4 border-t`,`border-z-border`),children:[(0,y.jsxs)(`span`,{className:m(`text-sm font-bold`,`text-z-secondary`),children:[`Page `,D,` of `,k]}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(`button`,{onClick:()=>O(e=>Math.max(1,e-1)),disabled:D<=1,className:m(`px-4 py-2 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30`),children:`Prev`}),(0,y.jsx)(`button`,{onClick:()=>O(e=>Math.min(k,e+1)),disabled:D>=k,className:m(`px-4 py-2 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30`),children:`Next`})]})]})]}),(0,y.jsx)(s,{children:N&&(0,y.jsx)(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4`,children:(0,y.jsx)(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`w-full max-w-sm`,children:(0,y.jsx)(h,{children:(0,y.jsxs)(g,{className:`p-8 text-center`,children:[(0,y.jsx)(i,{size:32,className:`mx-auto mb-4 text-z-active-text`}),(0,y.jsx)(`h3`,{className:`text-sm font-semibold mb-2 text-z-primary`,children:`Restore Document?`}),(0,y.jsx)(`p`,{className:`text-sm font-bold text-z-secondary mb-6`,children:N.title}),(0,y.jsxs)(`div`,{className:`flex gap-3 justify-center`,children:[(0,y.jsx)(`button`,{onClick:()=>P(null),className:m(`px-5 py-2.5 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary`),children:`Cancel`}),(0,y.jsxs)(`button`,{onClick:K,disabled:z,className:`px-5 py-2.5 bg-z-accent hover:brightness-110 text-z-logo-text text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2`,children:[z&&(0,y.jsx)(a,{size:12,className:`animate-spin`}),`Restore`]})]})]})})})})}),(0,y.jsx)(s,{children:F&&(0,y.jsx)(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4`,children:(0,y.jsx)(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`w-full max-w-sm`,children:(0,y.jsx)(h,{children:(0,y.jsxs)(g,{className:`p-8 text-center`,children:[(0,y.jsx)(n,{size:32,className:`mx-auto mb-4 text-red-500`}),(0,y.jsx)(`h3`,{className:`text-sm font-semibold mb-2 text-z-primary`,children:`Permanently Delete?`}),(0,y.jsx)(`p`,{className:`text-sm font-bold text-z-secondary mb-6`,children:F.title}),(0,y.jsxs)(`div`,{className:`flex gap-3 justify-center`,children:[(0,y.jsx)(`button`,{onClick:()=>I(null),className:m(`px-5 py-2.5 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary`),children:`Cancel`}),(0,y.jsxs)(`button`,{onClick:q,disabled:V,className:`px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2`,children:[V&&(0,y.jsx)(a,{size:12,className:`animate-spin`}),`Delete`]})]})]})})})})}),(0,y.jsx)(s,{children:L&&(0,y.jsx)(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4`,children:(0,y.jsx)(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`w-full max-w-sm`,children:(0,y.jsx)(h,{children:(0,y.jsxs)(g,{className:`p-8 text-center`,children:[(0,y.jsx)(n,{size:32,className:`mx-auto mb-4 text-red-500`}),(0,y.jsx)(`h3`,{className:`text-sm font-semibold mb-2 text-z-primary`,children:`Empty Trash?`}),(0,y.jsxs)(`p`,{className:`text-sm font-bold text-z-secondary mb-6`,children:[`Delete all `,j,` items permanently.`]}),(0,y.jsxs)(`div`,{className:`flex gap-3 justify-center`,children:[(0,y.jsx)(`button`,{onClick:()=>R(!1),className:m(`px-5 py-2.5 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary`),children:`Cancel`}),(0,y.jsxs)(`button`,{onClick:J,disabled:U,className:`px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2`,children:[U&&(0,y.jsx)(a,{size:12,className:`animate-spin`}),`Delete All`]})]})]})})})})})]})]})};export{b as default};
1
+ import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{C as t,En as n,H as r,K as i,Ln as a,Wt as o,ir as s,l as c,rr as l,vr as u,xr as d}from"./vendor-react-DQVTOTFO.js";import{a as f,o as p,t as m}from"./utils-fgvbH6CB.js";import{d as h,f as g,p as _}from"./index-yE_3fruG.js";var v=e(d(),1),y=u(),b=()=>{let{theme:e}=f(),u=e===`dark`,[d,b]=(0,v.useState)([]),[x,S]=(0,v.useState)([]),[C,w]=(0,v.useState)(!0),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(1),[k,A]=(0,v.useState)(1),[j,M]=(0,v.useState)(0),[N,P]=(0,v.useState)(null),[F,I]=(0,v.useState)(null),[L,R]=(0,v.useState)(!1),[z,B]=(0,v.useState)(!1),[V,H]=(0,v.useState)(!1),[U,W]=(0,v.useState)(!1),G=(0,v.useCallback)(async()=>{w(!0);try{let e=(await p.get(`/trash`,{params:{page:D,limit:20,search:T||void 0}})).data;b(e.data||[]),A(e.meta?.pagination?.totalPages||1),M(e.meta?.pagination?.total||0),S(e.meta?.collections||[])}catch{c.error(`Failed to load trash`)}finally{w(!1)}},[D,T]);(0,v.useEffect)(()=>{G()},[G]);let K=async()=>{if(N){B(!0);try{await p.post(`/trash/restore`,{collection:N.collectionSlug,id:N._id}),c.success(`Document restored`),P(null),G()}catch(e){let t=e.response?.data?.error?.message||(e instanceof Error?e.message:String(e))||`Failed to restore`;c.error(t)}finally{B(!1)}}},q=async()=>{if(F){H(!0);try{await p.post(`/trash/purge`,{collection:F.collectionSlug,id:F._id}),c.success(`Document permanently deleted`),I(null),G()}catch(e){let t=e.response?.data?.error?.message||(e instanceof Error?e.message:String(e))||`Failed to purge`;c.error(t)}finally{H(!1)}}},J=async()=>{W(!0);try{await p.delete(`/trash?confirm=true`),c.success(`Trash emptied`),R(!1),G()}catch(e){let t=e.response?.data?.error?.message||(e instanceof Error?e.message:String(e))||`Failed to empty trash`;c.error(t)}finally{W(!1)}},Y=e=>{try{return new Date(e).toLocaleString()}catch{return e}};return(0,y.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-64px)] overflow-hidden`,children:[(0,y.jsx)(_,{title:`Trash / Graveyard`,description:`Recover deleted documents.`,icon:(0,y.jsx)(t,{size:24,className:`text-red-500`}),backLink:{to:`/`,label:`Dashboard`},actions:j>0&&(0,y.jsxs)(`button`,{onClick:()=>R(!0),className:`flex items-center gap-2 px-6 py-2.5 bg-red-600 hover:bg-red-500 shadow-sm text-z-primary text-sm font-semibold transition-all rounded-none`,children:[(0,y.jsx)(t,{size:14}),`Empty Trash`]})}),(0,y.jsxs)(`div`,{className:`flex-1 overflow-auto p-6 md:p-8 space-y-6`,children:[(0,y.jsxs)(`div`,{className:`max-w-md relative`,children:[(0,y.jsx)(r,{size:14,className:m(`absolute left-4 top-1/2 -translate-y-1/2`,u?`text-z-secondary`:`text-z-muted`)}),(0,y.jsx)(`input`,{type:`text`,value:T,onChange:e=>{E(e.target.value),O(1)},placeholder:`Search trashed items...`,className:m(`w-full pl-10 pr-4 py-2.5 text-sm font-semibold border outline-none focus-visible:ring-2 focus-visible:ring-red-500/50 transition-colors rounded-none shadow-sm`,`z-input`)})]}),(0,y.jsxs)(h,{children:[C?(0,y.jsx)(`div`,{className:`flex items-center justify-center py-20 gap-3`,children:(0,y.jsx)(a,{size:20,className:`animate-spin text-z-secondary`})}):d.length===0?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 gap-4 opacity-50`,children:[(0,y.jsx)(t,{size:32,className:`text-z-secondary`}),(0,y.jsx)(`p`,{className:`text-sm font-semibold text-z-secondary`,children:T?`No matching items`:`Trash is empty`})]}):(0,y.jsx)(`div`,{className:`overflow-x-auto min-w-full`,children:(0,y.jsxs)(`table`,{className:`w-full text-left border-collapse`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{className:m(`text-sm font-semibold border-b`,`text-z-secondary border-z-border`),children:[(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal`,children:`Title`}),(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal w-40 hidden sm:table-cell`,children:`Collection`}),(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal w-44 hidden md:table-cell`,children:`Deleted At`}),(0,y.jsx)(`th`,{className:`px-5 py-4 font-normal w-32`})]})}),(0,y.jsx)(`tbody`,{children:d.map(e=>(0,y.jsxs)(`tr`,{className:m(`text-xs border-b transition-colors`,u?`border-z-border hover:bg-z-panel`:`border-z-border hover:bg-[var(--z-bg-input)]`),children:[(0,y.jsx)(`td`,{className:`px-5 py-4`,children:(0,y.jsx)(`span`,{className:m(`font-bold`,`text-z-primary`),children:e.title})}),(0,y.jsx)(`td`,{className:`px-5 py-4 hidden sm:table-cell`,children:(0,y.jsxs)(`span`,{className:m(`inline-flex items-center gap-1.5 px-2 py-1 text-sm font-semibold `,u?`bg-z-hover text-z-muted`:`bg-[var(--z-bg-hover)] text-z-secondary`),children:[(0,y.jsx)(o,{size:10}),e.collectionName]})}),(0,y.jsx)(`td`,{className:`px-5 py-4 hidden md:table-cell`,children:(0,y.jsx)(`span`,{className:m(`text-sm font-mono`,u?`text-z-secondary`:`text-z-muted`),children:Y(e.deletedAt)})}),(0,y.jsx)(`td`,{className:`px-5 py-4`,children:(0,y.jsxs)(`div`,{className:`flex items-center gap-2 justify-end`,children:[(0,y.jsx)(`button`,{onClick:()=>P(e),className:m(`p-1.5 border transition-all rounded-none`,`border-z-border text-z-secondary hover:text-z-primary`),title:`Restore`,children:(0,y.jsx)(i,{size:12})}),(0,y.jsx)(`button`,{onClick:()=>I(e),className:`p-1.5 border rounded-none border-red-500/20 text-red-500 hover:bg-red-500/10 transition-all`,title:`Permanently delete`,children:(0,y.jsx)(t,{size:12})})]})})]},`${e.collectionSlug}-${e._id}`))})]})}),k>1&&(0,y.jsxs)(`div`,{className:m(`flex items-center justify-between px-5 py-4 border-t`,`border-z-border`),children:[(0,y.jsxs)(`span`,{className:m(`text-sm font-bold`,`text-z-secondary`),children:[`Page `,D,` of `,k]}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(`button`,{onClick:()=>O(e=>Math.max(1,e-1)),disabled:D<=1,className:m(`px-4 py-2 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30`),children:`Prev`}),(0,y.jsx)(`button`,{onClick:()=>O(e=>Math.min(k,e+1)),disabled:D>=k,className:m(`px-4 py-2 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30`),children:`Next`})]})]})]}),(0,y.jsx)(s,{children:N&&(0,y.jsx)(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4`,children:(0,y.jsx)(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`w-full max-w-sm`,children:(0,y.jsx)(h,{children:(0,y.jsxs)(g,{className:`p-8 text-center`,children:[(0,y.jsx)(i,{size:32,className:`mx-auto mb-4 text-z-active-text`}),(0,y.jsx)(`h3`,{className:`text-sm font-semibold mb-2 text-z-primary`,children:`Restore Document?`}),(0,y.jsx)(`p`,{className:`text-sm font-bold text-z-secondary mb-6`,children:N.title}),(0,y.jsxs)(`div`,{className:`flex gap-3 justify-center`,children:[(0,y.jsx)(`button`,{onClick:()=>P(null),className:m(`px-5 py-2.5 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary`),children:`Cancel`}),(0,y.jsxs)(`button`,{onClick:K,disabled:z,className:`px-5 py-2.5 bg-z-accent hover:brightness-110 text-z-logo-text text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2`,children:[z&&(0,y.jsx)(a,{size:12,className:`animate-spin`}),`Restore`]})]})]})})})})}),(0,y.jsx)(s,{children:F&&(0,y.jsx)(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4`,children:(0,y.jsx)(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`w-full max-w-sm`,children:(0,y.jsx)(h,{children:(0,y.jsxs)(g,{className:`p-8 text-center`,children:[(0,y.jsx)(n,{size:32,className:`mx-auto mb-4 text-red-500`}),(0,y.jsx)(`h3`,{className:`text-sm font-semibold mb-2 text-z-primary`,children:`Permanently Delete?`}),(0,y.jsx)(`p`,{className:`text-sm font-bold text-z-secondary mb-6`,children:F.title}),(0,y.jsxs)(`div`,{className:`flex gap-3 justify-center`,children:[(0,y.jsx)(`button`,{onClick:()=>I(null),className:m(`px-5 py-2.5 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary`),children:`Cancel`}),(0,y.jsxs)(`button`,{onClick:q,disabled:V,className:`px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2`,children:[V&&(0,y.jsx)(a,{size:12,className:`animate-spin`}),`Delete`]})]})]})})})})}),(0,y.jsx)(s,{children:L&&(0,y.jsx)(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4`,children:(0,y.jsx)(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`w-full max-w-sm`,children:(0,y.jsx)(h,{children:(0,y.jsxs)(g,{className:`p-8 text-center`,children:[(0,y.jsx)(n,{size:32,className:`mx-auto mb-4 text-red-500`}),(0,y.jsx)(`h3`,{className:`text-sm font-semibold mb-2 text-z-primary`,children:`Empty Trash?`}),(0,y.jsxs)(`p`,{className:`text-sm font-bold text-z-secondary mb-6`,children:[`Delete all `,j,` items permanently.`]}),(0,y.jsxs)(`div`,{className:`flex gap-3 justify-center`,children:[(0,y.jsx)(`button`,{onClick:()=>R(!1),className:m(`px-5 py-2.5 text-sm font-semibold border rounded-none transition-all`,`border-z-border text-z-secondary hover:text-z-primary`),children:`Cancel`}),(0,y.jsxs)(`button`,{onClick:J,disabled:U,className:`px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2`,children:[U&&(0,y.jsx)(a,{size:12,className:`animate-spin`}),`Delete All`]})]})]})})})})})]})]})};export{b as default};
@@ -1 +1 @@
1
- {"version":3,"file":"TrashPage-BYiY8Xrn.js","names":[],"sources":["../../src/pages/TrashPage.tsx"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport {\n Trash2,\n RotateCcw,\n Search,\n Loader2,\n AlertTriangle,\n Database,\n} from 'lucide-react'\nimport { motion, AnimatePresence } from 'framer-motion'\nimport { cn } from '../lib/utils'\nimport { useTheme } from '../context/ThemeContext'\nimport toast from 'react-hot-toast'\nimport api from '../lib/api'\nimport { PageHeader } from '../components/ui/PageHeader'\nimport { Card, CardContent } from '../components/ui/Card'\n\ninterface TrashItem {\n _id: string\n collectionSlug: string\n collectionName: string\n title: string\n deletedAt: string\n siteId?: string\n}\n\ninterface CollectionMeta {\n slug: string\n name: string\n}\n\nconst TrashPage = () => {\n const { theme } = useTheme()\n const dark = theme === 'dark'\n\n const [items, setItems] = useState<TrashItem[]>([])\n const [collections, setCollections] = useState<CollectionMeta[]>([])\n const [loading, setLoading] = useState(true)\n const [search, setSearch] = useState('')\n const [page, setPage] = useState(1)\n const [totalPages, setTotalPages] = useState(1)\n const [total, setTotal] = useState(0)\n\n const [restoreConfirm, setRestoreConfirm] = useState<TrashItem | null>(null)\n const [purgeConfirm, setPurgeConfirm] = useState<TrashItem | null>(null)\n const [emptyConfirm, setEmptyConfirm] = useState(false)\n const [restoreLoading, setRestoreLoading] = useState(false)\n const [purgeLoading, setPurgeLoading] = useState(false)\n const [emptyLoading, setEmptyLoading] = useState(false)\n\n const fetchTrash = useCallback(async () => {\n setLoading(true)\n try {\n const res = await api.get('/trash', {\n params: { page, limit: 20, search: search || undefined },\n })\n const data = res.data\n setItems(data.data || [])\n setTotalPages(data.meta?.pagination?.totalPages || 1)\n setTotal(data.meta?.pagination?.total || 0)\n setCollections(data.meta?.collections || [])\n } catch {\n toast.error('Failed to load trash')\n } finally {\n setLoading(false)\n }\n }, [page, search])\n\n useEffect(() => {\n fetchTrash()\n }, [fetchTrash])\n\n const handleRestore = async () => {\n if (!restoreConfirm) return\n setRestoreLoading(true)\n try {\n await api.post('/trash/restore', {\n collection: restoreConfirm.collectionSlug,\n id: restoreConfirm._id,\n })\n toast.success('Document restored')\n setRestoreConfirm(null)\n fetchTrash()\n } catch (err: any) {\n const msg = err.response?.data?.error?.message || (err instanceof Error ? err.message : String(err)) || 'Failed to restore'\n toast.error(msg)\n } finally {\n setRestoreLoading(false)\n }\n }\n\n const handlePurge = async () => {\n if (!purgeConfirm) return\n setPurgeLoading(true)\n try {\n await api.post('/trash/purge', {\n collection: purgeConfirm.collectionSlug,\n id: purgeConfirm._id,\n })\n toast.success('Document permanently deleted')\n setPurgeConfirm(null)\n fetchTrash()\n } catch (err: any) {\n const msg = err.response?.data?.error?.message || (err instanceof Error ? err.message : String(err)) || 'Failed to purge'\n toast.error(msg)\n } finally {\n setPurgeLoading(false)\n }\n }\n\n const handleEmptyTrash = async () => {\n setEmptyLoading(true)\n try {\n await api.delete('/trash?confirm=true')\n toast.success('Trash emptied')\n setEmptyConfirm(false)\n fetchTrash()\n } catch (err: any) {\n const msg = err.response?.data?.error?.message || (err instanceof Error ? err.message : String(err)) || 'Failed to empty trash'\n toast.error(msg)\n } finally {\n setEmptyLoading(false)\n }\n }\n\n const formatDate = (dateStr: string) => {\n try {\n return new Date(dateStr).toLocaleString()\n } catch {\n return dateStr\n }\n }\n\n return (\n <div className=\"flex flex-col h-[calc(100vh-64px)] overflow-hidden\">\n <PageHeader\n title=\"Trash / Graveyard\"\n description=\"Recover deleted documents.\"\n icon={<Trash2 size={24} className=\"text-red-500\" />}\n backLink={{ to: '/', label: 'Dashboard' }}\n actions={\n total > 0 && (\n <button\n onClick={() => setEmptyConfirm(true)}\n className=\"flex items-center gap-2 px-6 py-2.5 bg-red-600 hover:bg-red-500 shadow-sm text-z-primary text-sm font-semibold transition-all rounded-none\"\n >\n <Trash2 size={14} />\n Empty Trash\n </button>\n )\n }\n />\n\n <div className=\"flex-1 overflow-auto p-6 md:p-8 space-y-6\">\n <div className=\"max-w-md relative\">\n <Search size={14} className={cn('absolute left-4 top-1/2 -translate-y-1/2', dark ? 'text-z-secondary' : 'text-z-muted')} />\n <input\n type=\"text\"\n value={search}\n onChange={(e) => { setSearch(e.target.value); setPage(1) }}\n placeholder=\"Search trashed items...\"\n className={cn(\n 'w-full pl-10 pr-4 py-2.5 text-sm font-semibold border outline-none focus-visible:ring-2 focus-visible:ring-red-500/50 transition-colors rounded-none shadow-sm',\n 'z-input'\n )}\n />\n </div>\n\n <Card>\n {loading ? (\n <div className=\"flex items-center justify-center py-20 gap-3\">\n <Loader2 size={20} className=\"animate-spin text-z-secondary\" />\n </div>\n ) : items.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-20 gap-4 opacity-50\">\n <Trash2 size={32} className=\"text-z-secondary\" />\n <p className=\"text-sm font-semibold text-z-secondary\">\n {search ? 'No matching items' : 'Trash is empty'}\n </p>\n </div>\n ) : (\n <div className=\"overflow-x-auto min-w-full\">\n <table className=\"w-full text-left border-collapse\">\n <thead>\n <tr className={cn(\n 'text-sm font-semibold border-b',\n 'text-z-secondary border-z-border'\n )}>\n <th className=\"px-5 py-4 font-normal\">Title</th>\n <th className=\"px-5 py-4 font-normal w-40 hidden sm:table-cell\">Collection</th>\n <th className=\"px-5 py-4 font-normal w-44 hidden md:table-cell\">Deleted At</th>\n <th className=\"px-5 py-4 font-normal w-32\" />\n </tr>\n </thead>\n <tbody>\n {items.map((item) => (\n <tr\n key={`${item.collectionSlug}-${item._id}`}\n className={cn(\n 'text-xs border-b transition-colors',\n dark ? 'border-z-border hover:bg-z-panel' : 'border-z-border hover:bg-[var(--z-bg-input)]'\n )}\n >\n <td className=\"px-5 py-4\">\n <span className={cn('font-bold', dark ? 'text-z-primary' : 'text-z-primary')}>\n {item.title}\n </span>\n </td>\n <td className=\"px-5 py-4 hidden sm:table-cell\">\n <span className={cn(\n 'inline-flex items-center gap-1.5 px-2 py-1 text-sm font-semibold ',\n dark ? 'bg-z-hover text-z-muted' : 'bg-[var(--z-bg-hover)] text-z-secondary'\n )}>\n <Database size={10} />\n {item.collectionName}\n </span>\n </td>\n <td className=\"px-5 py-4 hidden md:table-cell\">\n <span className={cn('text-sm font-mono', dark ? 'text-z-secondary' : 'text-z-muted')}>\n {formatDate(item.deletedAt)}\n </span>\n </td>\n <td className=\"px-5 py-4\">\n <div className=\"flex items-center gap-2 justify-end\">\n <button\n onClick={() => setRestoreConfirm(item)}\n className={cn('p-1.5 border transition-all rounded-none', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n title=\"Restore\"\n >\n <RotateCcw size={12} />\n </button>\n <button\n onClick={() => setPurgeConfirm(item)}\n className=\"p-1.5 border rounded-none border-red-500/20 text-red-500 hover:bg-red-500/10 transition-all\"\n title=\"Permanently delete\"\n >\n <Trash2 size={12} />\n </button>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n\n {totalPages > 1 && (\n <div className={cn('flex items-center justify-between px-5 py-4 border-t', 'border-z-border')}>\n <span className={cn('text-sm font-bold', 'text-z-secondary')}>\n Page {page} of {totalPages}\n </span>\n <div className=\"flex gap-2\">\n <button\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={page <= 1}\n className={cn('px-4 py-2 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30' : 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30')}\n >\n Prev\n </button>\n <button\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={page >= totalPages}\n className={cn('px-4 py-2 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30' : 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30')}\n >\n Next\n </button>\n </div>\n </div>\n )}\n </Card>\n\n {/* Restore Confirmation */}\n <AnimatePresence>\n {restoreConfirm && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4\"\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n className=\"w-full max-w-sm\"\n >\n <Card>\n <CardContent className=\"p-8 text-center\">\n <RotateCcw size={32} className=\"mx-auto mb-4 text-z-active-text\" />\n <h3 className=\"text-sm font-semibold mb-2 text-z-primary\">Restore Document?</h3>\n <p className=\"text-sm font-bold text-z-secondary mb-6\">\n {restoreConfirm.title}\n </p>\n <div className=\"flex gap-3 justify-center\">\n <button\n onClick={() => setRestoreConfirm(null)}\n className={cn('px-5 py-2.5 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n >\n Cancel\n </button>\n <button\n onClick={handleRestore}\n disabled={restoreLoading}\n className=\"px-5 py-2.5 bg-z-accent hover:brightness-110 text-z-logo-text text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2\"\n >\n {restoreLoading && <Loader2 size={12} className=\"animate-spin\" />}\n Restore\n </button>\n </div>\n </CardContent>\n </Card>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Permanent Delete Confirmation */}\n <AnimatePresence>\n {purgeConfirm && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4\"\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n className=\"w-full max-w-sm\"\n >\n <Card>\n <CardContent className=\"p-8 text-center\">\n <AlertTriangle size={32} className=\"mx-auto mb-4 text-red-500\" />\n <h3 className=\"text-sm font-semibold mb-2 text-z-primary\">Permanently Delete?</h3>\n <p className=\"text-sm font-bold text-z-secondary mb-6\">\n {purgeConfirm.title}\n </p>\n <div className=\"flex gap-3 justify-center\">\n <button\n onClick={() => setPurgeConfirm(null)}\n className={cn('px-5 py-2.5 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n >\n Cancel\n </button>\n <button\n onClick={handlePurge}\n disabled={purgeLoading}\n className=\"px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2\"\n >\n {purgeLoading && <Loader2 size={12} className=\"animate-spin\" />}\n Delete\n </button>\n </div>\n </CardContent>\n </Card>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Empty Trash Confirmation */}\n <AnimatePresence>\n {emptyConfirm && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4\"\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n className=\"w-full max-w-sm\"\n >\n <Card>\n <CardContent className=\"p-8 text-center\">\n <AlertTriangle size={32} className=\"mx-auto mb-4 text-red-500\" />\n <h3 className=\"text-sm font-semibold mb-2 text-z-primary\">Empty Trash?</h3>\n <p className=\"text-sm font-bold text-z-secondary mb-6\">\n Delete all {total} items permanently.\n </p>\n <div className=\"flex gap-3 justify-center\">\n <button\n onClick={() => setEmptyConfirm(false)}\n className={cn('px-5 py-2.5 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n >\n Cancel\n </button>\n <button\n onClick={handleEmptyTrash}\n disabled={emptyLoading}\n className=\"px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2\"\n >\n {emptyLoading && <Loader2 size={12} className=\"animate-spin\" />}\n Delete All\n </button>\n </div>\n </CardContent>\n </Card>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n </div>\n )\n}\n\nexport default TrashPage\n"],"mappings":"gTA+BM,MAAkB,CACtB,GAAM,CAAE,SAAU,EAAS,EACrB,EAAO,IAAU,OAEjB,CAAC,EAAO,IAAA,EAAA,EAAA,SAAA,CAAkC,CAAC,CAAC,EAC5C,CAAC,EAAa,IAAA,EAAA,EAAA,SAAA,CAA6C,CAAC,CAAC,EAC7D,CAAC,EAAS,IAAA,EAAA,EAAA,SAAA,CAAuB,EAAI,EACrC,CAAC,EAAQ,IAAA,EAAA,EAAA,SAAA,CAAsB,EAAE,EACjC,CAAC,EAAM,IAAA,EAAA,EAAA,SAAA,CAAoB,CAAC,EAC5B,CAAC,EAAY,IAAA,EAAA,EAAA,SAAA,CAA0B,CAAC,EACxC,CAAC,EAAO,IAAA,EAAA,EAAA,SAAA,CAAqB,CAAC,EAE9B,CAAC,EAAgB,IAAA,EAAA,EAAA,SAAA,CAAgD,IAAI,EACrE,CAAC,EAAc,IAAA,EAAA,EAAA,SAAA,CAA8C,IAAI,EACjE,CAAC,EAAc,IAAA,EAAA,EAAA,SAAA,CAA4B,EAAK,EAChD,CAAC,EAAgB,IAAA,EAAA,EAAA,SAAA,CAA8B,EAAK,EACpD,CAAC,EAAc,IAAA,EAAA,EAAA,SAAA,CAA4B,EAAK,EAChD,CAAC,EAAc,IAAA,EAAA,EAAA,SAAA,CAA4B,EAAK,EAEhD,GAAA,EAAA,EAAA,YAAA,CAAyB,SAAY,CACzC,EAAW,EAAI,EACf,GAAI,CAIF,IAAM,GAAO,MAHK,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,CAAA,GAGjB,EAAA,EAAA,IAAA,CAAC,EAAD,CAAA,SACG,IACC,EAAA,EAAA,IAAA,CAAC,EAAO,IAAR,CACE,QAAS,CAAE,QAAS,CAAE,EACtB,QAAS,CAAE,QAAS,CAAE,EACtB,KAAM,CAAE,QAAS,CAAE,EACnB,UAAU,4GAEV,EAAA,EAAA,IAAA,CAAC,EAAO,IAAR,CACE,QAAS,CAAE,QAAS,EAAG,MAAO,GAAK,EACnC,QAAS,CAAE,QAAS,EAAG,MAAO,CAAE,EAChC,KAAM,CAAE,QAAS,EAAG,MAAO,GAAK,EAChC,UAAU,4BAEV,EAAA,EAAA,IAAA,CAAC,EAAD,CAAA,UACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAa,UAAU,2BAAvB,EACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAe,KAAM,GAAI,UAAU,2BAA6B,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,qDAA4C,cAAgB,CAAA,GAC1E,EAAA,EAAA,KAAA,CAAC,IAAD,CAAG,UAAU,mDAAb,CAAuD,cACzC,EAAM,qBACjB,KACH,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,qCAAf,EACE,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,YAAe,EAAgB,EAAK,EACpC,UAAW,EAAG,yEAAiF,uDAAiH,WACjN,QAEO,CAAA,GACR,EAAA,EAAA,KAAA,CAAC,SAAD,CACE,QAAS,EACT,SAAU,EACV,UAAU,sJAHZ,CAKG,IAAgB,EAAA,EAAA,IAAA,CAAC,EAAD,CAAS,KAAM,GAAI,UAAU,cAAgB,CAAA,EAAE,YAE1D,GACL,GACM,GACT,CAAA,CACI,CAAA,CACF,CAAA,CAEC,CAAA,CACd,GACF,GAET"}
1
+ {"version":3,"file":"TrashPage-BIhKrs5x.js","names":[],"sources":["../../src/pages/TrashPage.tsx"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport {\n Trash2,\n RotateCcw,\n Search,\n Loader2,\n AlertTriangle,\n Database,\n} from 'lucide-react'\nimport { motion, AnimatePresence } from 'framer-motion'\nimport { cn } from '../lib/utils'\nimport { useTheme } from '../context/ThemeContext'\nimport toast from 'react-hot-toast'\nimport api from '../lib/api'\nimport { PageHeader } from '../components/ui/PageHeader'\nimport { Card, CardContent } from '../components/ui/Card'\n\ninterface TrashItem {\n _id: string\n collectionSlug: string\n collectionName: string\n title: string\n deletedAt: string\n siteId?: string\n}\n\ninterface CollectionMeta {\n slug: string\n name: string\n}\n\nconst TrashPage = () => {\n const { theme } = useTheme()\n const dark = theme === 'dark'\n\n const [items, setItems] = useState<TrashItem[]>([])\n const [collections, setCollections] = useState<CollectionMeta[]>([])\n const [loading, setLoading] = useState(true)\n const [search, setSearch] = useState('')\n const [page, setPage] = useState(1)\n const [totalPages, setTotalPages] = useState(1)\n const [total, setTotal] = useState(0)\n\n const [restoreConfirm, setRestoreConfirm] = useState<TrashItem | null>(null)\n const [purgeConfirm, setPurgeConfirm] = useState<TrashItem | null>(null)\n const [emptyConfirm, setEmptyConfirm] = useState(false)\n const [restoreLoading, setRestoreLoading] = useState(false)\n const [purgeLoading, setPurgeLoading] = useState(false)\n const [emptyLoading, setEmptyLoading] = useState(false)\n\n const fetchTrash = useCallback(async () => {\n setLoading(true)\n try {\n const res = await api.get('/trash', {\n params: { page, limit: 20, search: search || undefined },\n })\n const data = res.data\n setItems(data.data || [])\n setTotalPages(data.meta?.pagination?.totalPages || 1)\n setTotal(data.meta?.pagination?.total || 0)\n setCollections(data.meta?.collections || [])\n } catch {\n toast.error('Failed to load trash')\n } finally {\n setLoading(false)\n }\n }, [page, search])\n\n useEffect(() => {\n fetchTrash()\n }, [fetchTrash])\n\n const handleRestore = async () => {\n if (!restoreConfirm) return\n setRestoreLoading(true)\n try {\n await api.post('/trash/restore', {\n collection: restoreConfirm.collectionSlug,\n id: restoreConfirm._id,\n })\n toast.success('Document restored')\n setRestoreConfirm(null)\n fetchTrash()\n } catch (err: any) {\n const msg = err.response?.data?.error?.message || (err instanceof Error ? err.message : String(err)) || 'Failed to restore'\n toast.error(msg)\n } finally {\n setRestoreLoading(false)\n }\n }\n\n const handlePurge = async () => {\n if (!purgeConfirm) return\n setPurgeLoading(true)\n try {\n await api.post('/trash/purge', {\n collection: purgeConfirm.collectionSlug,\n id: purgeConfirm._id,\n })\n toast.success('Document permanently deleted')\n setPurgeConfirm(null)\n fetchTrash()\n } catch (err: any) {\n const msg = err.response?.data?.error?.message || (err instanceof Error ? err.message : String(err)) || 'Failed to purge'\n toast.error(msg)\n } finally {\n setPurgeLoading(false)\n }\n }\n\n const handleEmptyTrash = async () => {\n setEmptyLoading(true)\n try {\n await api.delete('/trash?confirm=true')\n toast.success('Trash emptied')\n setEmptyConfirm(false)\n fetchTrash()\n } catch (err: any) {\n const msg = err.response?.data?.error?.message || (err instanceof Error ? err.message : String(err)) || 'Failed to empty trash'\n toast.error(msg)\n } finally {\n setEmptyLoading(false)\n }\n }\n\n const formatDate = (dateStr: string) => {\n try {\n return new Date(dateStr).toLocaleString()\n } catch {\n return dateStr\n }\n }\n\n return (\n <div className=\"flex flex-col h-[calc(100vh-64px)] overflow-hidden\">\n <PageHeader\n title=\"Trash / Graveyard\"\n description=\"Recover deleted documents.\"\n icon={<Trash2 size={24} className=\"text-red-500\" />}\n backLink={{ to: '/', label: 'Dashboard' }}\n actions={\n total > 0 && (\n <button\n onClick={() => setEmptyConfirm(true)}\n className=\"flex items-center gap-2 px-6 py-2.5 bg-red-600 hover:bg-red-500 shadow-sm text-z-primary text-sm font-semibold transition-all rounded-none\"\n >\n <Trash2 size={14} />\n Empty Trash\n </button>\n )\n }\n />\n\n <div className=\"flex-1 overflow-auto p-6 md:p-8 space-y-6\">\n <div className=\"max-w-md relative\">\n <Search size={14} className={cn('absolute left-4 top-1/2 -translate-y-1/2', dark ? 'text-z-secondary' : 'text-z-muted')} />\n <input\n type=\"text\"\n value={search}\n onChange={(e) => { setSearch(e.target.value); setPage(1) }}\n placeholder=\"Search trashed items...\"\n className={cn(\n 'w-full pl-10 pr-4 py-2.5 text-sm font-semibold border outline-none focus-visible:ring-2 focus-visible:ring-red-500/50 transition-colors rounded-none shadow-sm',\n 'z-input'\n )}\n />\n </div>\n\n <Card>\n {loading ? (\n <div className=\"flex items-center justify-center py-20 gap-3\">\n <Loader2 size={20} className=\"animate-spin text-z-secondary\" />\n </div>\n ) : items.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-20 gap-4 opacity-50\">\n <Trash2 size={32} className=\"text-z-secondary\" />\n <p className=\"text-sm font-semibold text-z-secondary\">\n {search ? 'No matching items' : 'Trash is empty'}\n </p>\n </div>\n ) : (\n <div className=\"overflow-x-auto min-w-full\">\n <table className=\"w-full text-left border-collapse\">\n <thead>\n <tr className={cn(\n 'text-sm font-semibold border-b',\n 'text-z-secondary border-z-border'\n )}>\n <th className=\"px-5 py-4 font-normal\">Title</th>\n <th className=\"px-5 py-4 font-normal w-40 hidden sm:table-cell\">Collection</th>\n <th className=\"px-5 py-4 font-normal w-44 hidden md:table-cell\">Deleted At</th>\n <th className=\"px-5 py-4 font-normal w-32\" />\n </tr>\n </thead>\n <tbody>\n {items.map((item) => (\n <tr\n key={`${item.collectionSlug}-${item._id}`}\n className={cn(\n 'text-xs border-b transition-colors',\n dark ? 'border-z-border hover:bg-z-panel' : 'border-z-border hover:bg-[var(--z-bg-input)]'\n )}\n >\n <td className=\"px-5 py-4\">\n <span className={cn('font-bold', dark ? 'text-z-primary' : 'text-z-primary')}>\n {item.title}\n </span>\n </td>\n <td className=\"px-5 py-4 hidden sm:table-cell\">\n <span className={cn(\n 'inline-flex items-center gap-1.5 px-2 py-1 text-sm font-semibold ',\n dark ? 'bg-z-hover text-z-muted' : 'bg-[var(--z-bg-hover)] text-z-secondary'\n )}>\n <Database size={10} />\n {item.collectionName}\n </span>\n </td>\n <td className=\"px-5 py-4 hidden md:table-cell\">\n <span className={cn('text-sm font-mono', dark ? 'text-z-secondary' : 'text-z-muted')}>\n {formatDate(item.deletedAt)}\n </span>\n </td>\n <td className=\"px-5 py-4\">\n <div className=\"flex items-center gap-2 justify-end\">\n <button\n onClick={() => setRestoreConfirm(item)}\n className={cn('p-1.5 border transition-all rounded-none', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n title=\"Restore\"\n >\n <RotateCcw size={12} />\n </button>\n <button\n onClick={() => setPurgeConfirm(item)}\n className=\"p-1.5 border rounded-none border-red-500/20 text-red-500 hover:bg-red-500/10 transition-all\"\n title=\"Permanently delete\"\n >\n <Trash2 size={12} />\n </button>\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n\n {totalPages > 1 && (\n <div className={cn('flex items-center justify-between px-5 py-4 border-t', 'border-z-border')}>\n <span className={cn('text-sm font-bold', 'text-z-secondary')}>\n Page {page} of {totalPages}\n </span>\n <div className=\"flex gap-2\">\n <button\n onClick={() => setPage((p) => Math.max(1, p - 1))}\n disabled={page <= 1}\n className={cn('px-4 py-2 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30' : 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30')}\n >\n Prev\n </button>\n <button\n onClick={() => setPage((p) => Math.min(totalPages, p + 1))}\n disabled={page >= totalPages}\n className={cn('px-4 py-2 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30' : 'border-z-border text-z-secondary hover:text-z-primary disabled:opacity-30')}\n >\n Next\n </button>\n </div>\n </div>\n )}\n </Card>\n\n {/* Restore Confirmation */}\n <AnimatePresence>\n {restoreConfirm && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4\"\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n className=\"w-full max-w-sm\"\n >\n <Card>\n <CardContent className=\"p-8 text-center\">\n <RotateCcw size={32} className=\"mx-auto mb-4 text-z-active-text\" />\n <h3 className=\"text-sm font-semibold mb-2 text-z-primary\">Restore Document?</h3>\n <p className=\"text-sm font-bold text-z-secondary mb-6\">\n {restoreConfirm.title}\n </p>\n <div className=\"flex gap-3 justify-center\">\n <button\n onClick={() => setRestoreConfirm(null)}\n className={cn('px-5 py-2.5 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n >\n Cancel\n </button>\n <button\n onClick={handleRestore}\n disabled={restoreLoading}\n className=\"px-5 py-2.5 bg-z-accent hover:brightness-110 text-z-logo-text text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2\"\n >\n {restoreLoading && <Loader2 size={12} className=\"animate-spin\" />}\n Restore\n </button>\n </div>\n </CardContent>\n </Card>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Permanent Delete Confirmation */}\n <AnimatePresence>\n {purgeConfirm && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4\"\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n className=\"w-full max-w-sm\"\n >\n <Card>\n <CardContent className=\"p-8 text-center\">\n <AlertTriangle size={32} className=\"mx-auto mb-4 text-red-500\" />\n <h3 className=\"text-sm font-semibold mb-2 text-z-primary\">Permanently Delete?</h3>\n <p className=\"text-sm font-bold text-z-secondary mb-6\">\n {purgeConfirm.title}\n </p>\n <div className=\"flex gap-3 justify-center\">\n <button\n onClick={() => setPurgeConfirm(null)}\n className={cn('px-5 py-2.5 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n >\n Cancel\n </button>\n <button\n onClick={handlePurge}\n disabled={purgeLoading}\n className=\"px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2\"\n >\n {purgeLoading && <Loader2 size={12} className=\"animate-spin\" />}\n Delete\n </button>\n </div>\n </CardContent>\n </Card>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Empty Trash Confirmation */}\n <AnimatePresence>\n {emptyConfirm && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-[var(--z-bg-modal)] backdrop-blur-sm p-4\"\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.95 }}\n className=\"w-full max-w-sm\"\n >\n <Card>\n <CardContent className=\"p-8 text-center\">\n <AlertTriangle size={32} className=\"mx-auto mb-4 text-red-500\" />\n <h3 className=\"text-sm font-semibold mb-2 text-z-primary\">Empty Trash?</h3>\n <p className=\"text-sm font-bold text-z-secondary mb-6\">\n Delete all {total} items permanently.\n </p>\n <div className=\"flex gap-3 justify-center\">\n <button\n onClick={() => setEmptyConfirm(false)}\n className={cn('px-5 py-2.5 text-sm font-semibold border rounded-none transition-all', dark ? 'border-z-border text-z-secondary hover:text-z-primary' : 'border-z-border text-z-secondary hover:text-z-primary')}\n >\n Cancel\n </button>\n <button\n onClick={handleEmptyTrash}\n disabled={emptyLoading}\n className=\"px-5 py-2.5 bg-red-600 hover:bg-red-500 text-z-primary text-sm font-semibold transition-all rounded-none shadow-sm flex items-center gap-2\"\n >\n {emptyLoading && <Loader2 size={12} className=\"animate-spin\" />}\n Delete All\n </button>\n </div>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