claudeship 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/server/dist/preview/preview.controller.d.ts +1 -0
- package/apps/server/dist/preview/preview.controller.js +10 -0
- package/apps/server/dist/preview/preview.controller.js.map +1 -1
- package/apps/server/dist/preview/preview.service.d.ts +1 -0
- package/apps/server/dist/preview/preview.service.js +26 -2
- package/apps/server/dist/preview/preview.service.js.map +1 -1
- package/apps/server/dist/tsconfig.tsbuildinfo +1 -1
- package/apps/server/package.json +1 -1
- package/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/app-build-manifest.json +5 -5
- package/apps/web/.next/app-path-routes-manifest.json +1 -1
- package/apps/web/.next/build-manifest.json +2 -2
- package/apps/web/.next/cache/.previewinfo +1 -1
- package/apps/web/.next/cache/.rscinfo +1 -1
- package/apps/web/.next/cache/.tsbuildinfo +1 -1
- package/apps/web/.next/cache/config.json +3 -3
- package/apps/web/.next/cache/eslint/.cache_j3uhuz +1 -1
- package/apps/web/.next/cache/webpack/client-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/client-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/index.pack +0 -0
- package/apps/web/.next/prerender-manifest.json +10 -10
- package/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/_not-found.html +1 -1
- package/apps/web/.next/server/app/_not-found.rsc +1 -1
- package/apps/web/.next/server/app/index.html +1 -1
- package/apps/web/.next/server/app/index.rsc +2 -2
- package/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/project/[id]/page.js +2 -2
- package/apps/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings.html +1 -1
- package/apps/web/.next/server/app/settings.rsc +1 -1
- package/apps/web/.next/server/app-paths-manifest.json +1 -1
- package/apps/web/.next/server/pages/404.html +1 -1
- package/apps/web/.next/server/pages/500.html +1 -1
- package/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/apps/web/.next/static/chunks/298-0052659e33e4d728.js +1 -0
- package/apps/web/.next/static/chunks/app/page-38144e6d92a7262e.js +1 -0
- package/apps/web/.next/static/chunks/app/project/[id]/{page-4c15c33bf78552cb.js → page-fda0243fd985a398.js} +1 -1
- package/apps/web/.next/trace +17 -17
- package/apps/web/package.json +1 -1
- package/apps/web/src/components/preview/PreviewPanel.tsx +16 -1
- package/apps/web/src/components/workspace/WorkspaceLayout.tsx +5 -5
- package/apps/web/src/stores/usePreviewStore.ts +22 -0
- package/package.json +1 -1
- package/apps/web/.next/static/chunks/595-00a84eeccb7bfc27.js +0 -1
- package/apps/web/.next/static/chunks/app/page-3d093f7f480a8599.js +0 -1
- /package/apps/web/.next/static/{yVw9J0lkf1zLx2qq5O3Tu → BkxwYU6TU6sW5wqk0e_iF}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{yVw9J0lkf1zLx2qq5O3Tu → BkxwYU6TU6sW5wqk0e_iF}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{660:(e,t,r)=>{"use strict";r.d(t,{F:()=>o});let a=r(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api";async function s(e,t){let r="".concat(a).concat(e),s=await fetch(r,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!s.ok)throw Error((await s.json().catch(()=>({message:"Request failed"}))).message||"HTTP error! status: ".concat(s.status));if(204!==s.status)return s.json()}let o={get:e=>s(e),post:(e,t)=>s(e,{method:"POST",body:t?JSON.stringify(t):void 0}),put:(e,t)=>s(e,{method:"PUT",body:t?JSON.stringify(t):void 0}),delete:e=>s(e,{method:"DELETE"}),uploadFiles:async(e,t)=>{let r=new FormData;t.forEach(e=>r.append("files",e));let s="".concat(a,"/projects/").concat(e,"/files/upload"),o=await fetch(s,{method:"POST",body:r});if(!o.ok)throw Error((await o.json().catch(()=>({message:"Upload failed"}))).message||"HTTP error! status: ".concat(o.status));return o.json()}}},882:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>R});var a=r(8481),s=r(8526),o=r(3973),n=r(7176),i=r(4816),l=r.n(i),c=r(6224),d=r(8964);let p=(0,d.A)("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),u=(0,d.A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),m=(0,d.A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var h=r(9049);let g=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("rounded-xl border bg-card text-card-foreground shadow",r),...s})});g.displayName="Card",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("flex flex-col space-y-1.5 p-6",r),...s})}).displayName="CardHeader",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("h3",{ref:t,className:(0,h.cn)("font-semibold leading-none tracking-tight",r),...s})}).displayName="CardTitle",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("p",{ref:t,className:(0,h.cn)("text-sm text-muted-foreground",r),...s})}).displayName="CardDescription",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("p-6 pt-0",r),...s})}).displayName="CardContent",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("flex items-center p-6 pt-0",r),...s})}).displayName="CardFooter";var x=r(5594),f=r(4859),j=r(9426);function y(e){var t;let{project:r,onDelete:s}=e,{locale:o}=(0,j.B)(),n=(r.projectType,(t=r.backendFramework)===f.V_.EXPRESS?"from-green-500/20 to-emerald-500/5":t===f.V_.FASTAPI?"from-teal-500/20 to-cyan-500/5":"from-blue-500/20 to-indigo-500/5");return(0,a.jsx)(l(),{href:"/project/".concat(r.id),children:(0,a.jsxs)(g,{className:"group relative cursor-pointer overflow-hidden border transition-all hover:border-primary/50 hover:shadow-lg",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br ".concat(n," opacity-0 transition-opacity group-hover:opacity-100")}),(0,a.jsxs)("div",{className:"relative p-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:function(e){switch(e){case f.gM.WEB:return(0,a.jsx)(c.A,{className:"h-5 w-5"});case f.gM.NATIVE:return(0,a.jsx)(p,{className:"h-5 w-5"});default:return(0,a.jsx)(c.A,{className:"h-5 w-5"})}}(r.projectType)}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:r.name}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:function(e,t){let r=new Date().getTime()-new Date(e).getTime(),a=Math.floor(r/6e4),s=Math.floor(r/36e5),o=Math.floor(r/864e5);return"ko"===t?a<1?"방금 전":a<60?"".concat(a,"분 전"):s<24?"".concat(s,"시간 전"):o<7?"".concat(o,"일 전"):new Date(e).toLocaleDateString("ko-KR"):a<1?"Just now":a<60?"".concat(a,"m ago"):s<24?"".concat(s,"h ago"):o<7?"".concat(o,"d ago"):new Date(e).toLocaleDateString("en-US")}(r.updatedAt,o)})]})]}),s&&(0,a.jsx)(x.$,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),s(r.id)},children:(0,a.jsx)(u,{className:"h-4 w-4 text-destructive"})})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.backendFramework!==f.V_.NONE&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium",children:[(0,a.jsx)(m,{className:"h-3 w-3"}),r.backendFramework===f.V_.EXPRESS?"Express":"FastAPI"]}),(0,a.jsx)("span",{className:"rounded-full bg-secondary px-2.5 py-0.5 text-xs text-muted-foreground",children:r.projectType===f.gM.WEB?"Web":"Native"})]})]})]})})}let N=(0,d.A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),v=(0,d.A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);function b(e){let{onClick:t}=e,{t:r}=(0,j.B)();return(0,a.jsxs)(g,{className:"group relative cursor-pointer overflow-hidden border-2 border-dashed transition-all hover:border-primary hover:shadow-lg",onClick:t,children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/10 to-primary/5 opacity-0 transition-opacity group-hover:opacity-100"}),(0,a.jsxs)("div",{className:"relative flex h-full min-h-[140px] flex-col items-center justify-center gap-3 p-6",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10 transition-colors group-hover:bg-primary/20",children:(0,a.jsx)(N,{className:"h-6 w-6 text-primary transition-transform group-hover:scale-110"})}),(0,a.jsx)(v,{className:"absolute -right-1 -top-1 h-4 w-4 text-primary opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("span",{className:"font-medium text-muted-foreground transition-colors group-hover:text-foreground",children:r("project.create")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground/70",children:r("project.createDescription")})]})]})]})}function w(e){let{projects:t,onCreateClick:r,onDelete:s}=e;return(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[t.map(e=>(0,a.jsx)(y,{project:e,onDelete:s},e.id)),(0,a.jsx)(b,{onClick:r})]})}let k=e=>{let{open:t,onOpenChange:r,children:s}=e;return t?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black/80",onClick:()=>null==r?void 0:r(!1)}),s]}):null},E=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:rounded-lg",r),onClick:e=>e.stopPropagation(),...o,children:s})});E.displayName="DialogContent";let S=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,h.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};S.displayName="DialogHeader";let P=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,h.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};P.displayName="DialogFooter";let A=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("h2",{ref:t,className:(0,h.cn)("text-lg font-semibold leading-none tracking-tight",r),...s})});A.displayName="DialogTitle";let C=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("p",{ref:t,className:(0,h.cn)("text-sm text-muted-foreground",r),...s})});C.displayName="DialogDescription";var F=r(5338);function T(e){let{open:t,onOpenChange:r,onSubmit:o,isLoading:n}=e,{t:i}=(0,j.B)(),[l,c]=(0,s.useState)(""),[d,p]=(0,s.useState)(f.gM.WEB),[u,m]=(0,s.useState)(f.V_.NONE);return(0,a.jsx)(k,{open:t,onOpenChange:r,children:(0,a.jsx)(E,{className:"max-w-lg",children:(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),l.trim()&&(o({name:l.trim(),projectType:d,backendFramework:u}),c(""),p(f.gM.WEB),m(f.V_.NONE))},children:[(0,a.jsxs)(S,{children:[(0,a.jsx)(A,{children:i("project.createTitle")}),(0,a.jsx)(C,{children:i("project.name")})]}),(0,a.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("label",{htmlFor:"name",className:"text-sm font-medium",children:i("project.name")}),(0,a.jsx)(F.p,{id:"name",value:l,onChange:e=>c(e.target.value),placeholder:i("project.namePlaceholder"),autoFocus:!0})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:i("project.type")}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)(x.$,{type:"button",variant:d===f.gM.WEB?"default":"outline",className:"h-16 flex-col gap-1",onClick:()=>p(f.gM.WEB),children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83C\uDF10"}),(0,a.jsx)("span",{className:"text-xs",children:i("project.typeWeb")})]}),(0,a.jsxs)(x.$,{type:"button",variant:d===f.gM.NATIVE?"default":"outline",className:"h-16 flex-col gap-1",onClick:()=>p(f.gM.NATIVE),children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDCF1"}),(0,a.jsx)("span",{className:"text-xs",children:i("project.typeNative")})]})]})]}),d===f.gM.WEB&&(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:i("project.backendStack")}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,a.jsxs)(x.$,{type:"button",variant:u===f.V_.NONE?"default":"outline",className:"h-20 flex-col gap-1",onClick:()=>m(f.V_.NONE),children:[(0,a.jsx)("span",{className:"text-lg",children:"⚡"}),(0,a.jsx)("span",{className:"text-xs text-center leading-tight",children:i("project.backendNone")})]}),(0,a.jsxs)(x.$,{type:"button",variant:u===f.V_.EXPRESS?"default":"outline",className:"h-20 flex-col gap-1",onClick:()=>m(f.V_.EXPRESS),children:[(0,a.jsx)("span",{className:"text-lg",children:"\uD83D\uDFE2"}),(0,a.jsxs)("span",{className:"text-xs text-center leading-tight",children:["Express",(0,a.jsx)("br",{}),"(Node.js)"]})]}),(0,a.jsxs)(x.$,{type:"button",variant:u===f.V_.FASTAPI?"default":"outline",className:"h-20 flex-col gap-1",onClick:()=>m(f.V_.FASTAPI),children:[(0,a.jsx)("span",{className:"text-lg",children:"\uD83D\uDC0D"}),(0,a.jsxs)("span",{className:"text-xs text-center leading-tight",children:["FastAPI",(0,a.jsx)("br",{}),"(Python)"]})]})]})]})]}),(0,a.jsxs)(P,{children:[(0,a.jsx)(x.$,{type:"button",variant:"outline",onClick:()=>r(!1),children:i("common.cancel")}),(0,a.jsx)(x.$,{type:"submit",disabled:!l.trim()||n,children:i(n?"common.loading":"common.create")})]})]})})})}var D=r(4264);function R(){let e=(0,o.useRouter)(),{t}=(0,j.B)(),[r,i]=(0,s.useState)(!1),{projects:l,isLoading:c,fetchProjects:d,createProject:p,deleteProject:u}=(0,D.I)();(0,s.useEffect)(()=>{d()},[d]);let m=async t=>{try{let r=await p(t);i(!1),e.push("/project/".concat(r.id))}catch(e){console.error("Failed to create project:",e)}},h=async e=>{if(confirm(t("project.deleteConfirm")))try{await u(e)}catch(e){console.error("Failed to delete project:",e)}};return(0,a.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,a.jsx)(n.Y,{}),(0,a.jsxs)("main",{className:"container px-4 py-8",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold",children:t("home.title")}),(0,a.jsx)("p",{className:"mt-1 text-muted-foreground",children:0===l.length?t("home.createFirst"):"".concat(l.length," ").concat(1===l.length?"project":"projects")})]}),c&&0===l.length?(0,a.jsx)("div",{className:"flex h-40 items-center justify-center text-muted-foreground",children:t("common.loading")}):(0,a.jsx)(w,{projects:l,onCreateClick:()=>i(!0),onDelete:h})]}),(0,a.jsx)(T,{open:r,onOpenChange:i,onSubmit:m,isLoading:c})]})}},2940:(e,t,r)=>{Promise.resolve().then(r.bind(r,882))},3973:(e,t,r)=>{"use strict";var a=r(6145);r.o(a,"useParams")&&r.d(t,{useParams:function(){return a.useParams}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}})},4264:(e,t,r)=>{"use strict";r.d(t,{I:()=>o});var a=r(4876),s=r(660);let o=(0,a.v)((e,t)=>({projects:[],currentProject:null,isLoading:!1,error:null,fetchProjects:async()=>{e({isLoading:!0,error:null});try{let t=await s.F.get("/projects");e({projects:t,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch projects",isLoading:!1})}},createProject:async t=>{e({isLoading:!0,error:null});try{let r=await s.F.post("/projects",t);return e(e=>({projects:[{id:r.id,name:r.name,projectType:r.projectType,backendFramework:r.backendFramework,updatedAt:r.updatedAt},...e.projects],isLoading:!1})),r}catch(t){throw e({error:t instanceof Error?t.message:"Failed to create project",isLoading:!1}),t}},deleteProject:async t=>{e({isLoading:!0,error:null});try{await s.F.delete("/projects/".concat(t)),e(e=>({projects:e.projects.filter(e=>e.id!==t),isLoading:!1}))}catch(t){throw e({error:t instanceof Error?t.message:"Failed to delete project",isLoading:!1}),t}},fetchProject:async t=>{e({isLoading:!0,error:null});try{let r=await s.F.get("/projects/".concat(t));e({currentProject:r,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch project",isLoading:!1})}},setCurrentProject:t=>e({currentProject:t}),clearError:()=>e({error:null})}))},4859:(e,t,r)=>{"use strict";r.d(t,{V_:()=>s,gM:()=>a,Xh:()=>o});var a=function(e){return e.WEB="WEB",e.NATIVE="NATIVE",e}({}),s=function(e){return e.NONE="NONE",e.EXPRESS="EXPRESS",e.FASTAPI="FASTAPI",e}({}),o=function(e){return e.USER="USER",e.ASSISTANT="ASSISTANT",e.SYSTEM="SYSTEM",e}({})},5338:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var a=r(8481),s=r(8526),o=r(9049);let n=s.forwardRef((e,t)=>{let{className:r,type:s,...n}=e;return(0,a.jsx)("input",{type:s,className:(0,o.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...n})});n.displayName="Input"},5594:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var a=r(8481),s=r(8526),o=r(4176),n=r(9049);let i=(0,o.F)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),l=s.forwardRef((e,t)=>{let{className:r,variant:s,size:o,...l}=e;return(0,a.jsx)("button",{className:(0,n.cn)(i({variant:s,size:o,className:r})),ref:t,...l})});l.displayName="Button"},6224:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(8964).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},7176:(e,t,r)=>{"use strict";r.d(t,{Y:()=>u});var a=r(8481),s=r(4816),o=r.n(s),n=r(9432),i=r(9150),l=r(7746),c=r(5594),d=r(9426);function p(){let{locale:e,setLocale:t,t:r}=(0,d.B)();return(0,a.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>{t("en"===e?"ko":"en")},className:"h-9 w-9 text-xs font-medium",title:r("language.select"),children:"en"===e?"EN":"KO"})}function u(e){let{title:t,showBack:r,backHref:s="/"}=e,{t:u}=(0,d.B)(),m=t||u("common.appName");return(0,a.jsx)("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,a.jsxs)("div",{className:"flex h-14 w-full items-center justify-between px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[r?(0,a.jsx)(o(),{href:s,children:(0,a.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})})}):(0,a.jsx)(n.default,{src:"/logo.svg",alt:"ClaudeShip",width:36,height:36,className:"rounded-lg"}),(0,a.jsx)("h1",{className:"text-lg font-semibold",children:m})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(p,{}),(0,a.jsx)(o(),{href:"/settings",children:(0,a.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",title:u("header.settings"),children:(0,a.jsx)(l.A,{className:"h-5 w-5"})})})]})]})})}},9049:(e,t,r)=>{"use strict";r.d(t,{cn:()=>o});var a=r(5806),s=r(4159);function o(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.QP)((0,a.$)(t))}},9426:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var a=r(4876),s=r(1203);let o={en:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"Loading...","error":"Error","save":"Save","cancel":"Cancel","delete":"Delete","create":"Create","close":"Close","refresh":"Refresh","settings":"Settings"},"header":{"home":"Home","settings":"Settings"},"home":{"title":"My Projects","noProjects":"No projects yet","createFirst":"Create your first project to get started"},"project":{"create":"New Project","createDescription":"Build with AI","createTitle":"Create New Project","name":"Project Name","namePlaceholder":"my-awesome-app","type":"Project Type","typeWeb":"Web App","typeNative":"Native App","backendStack":"Backend Stack","backendNone":"Frontend Only","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"Delete Project","deleteConfirm":"Are you sure you want to delete this project?","updated":"Updated"},"chat":{"title":"Chat","placeholder":"Describe what you want to build...","askPlaceholder":"Ask a question about your project...","queuePlaceholder":"Queue another message...","send":"Send","thinking":"AI is thinking...","uploading":"Uploading files...","queueCount":"{count} message(s) queued","toolRunning":"Running","toolCompleted":"Completed","newConversation":"New Chat","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"Preview","start":"Start Preview","stop":"Stop Preview","starting":"Starting...","notReady":"Project not ready for preview","waitForAI":"Wait for AI to create the project files","openInNewTab":"Open in New Tab"},"fileExplorer":{"title":"Files","empty":"No files yet","loading":"Loading files...","error":"Failed to load files","open":"Open File Explorer","close":"Close File Explorer"},"language":{"select":"Language","en":"English","ko":"한국어"},"settings":{"title":"Settings","projectsPath":{"title":"Projects Folder","description":"Location where your projects are stored","saved":"Settings saved successfully","note":"New projects will be created in this folder. Existing projects are not affected."}}}'),ko:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"로딩 중...","error":"오류","save":"저장","cancel":"취소","delete":"삭제","create":"생성","close":"닫기","refresh":"새로고침","settings":"설정"},"header":{"home":"홈","settings":"설정"},"home":{"title":"내 프로젝트","noProjects":"프로젝트가 없습니다","createFirst":"첫 번째 프로젝트를 만들어 시작하세요"},"project":{"create":"새 프로젝트","createDescription":"AI와 함께 만들기","createTitle":"새 프로젝트 생성","name":"프로젝트 이름","namePlaceholder":"my-awesome-app","type":"프로젝트 유형","typeWeb":"웹 앱","typeNative":"네이티브 앱","backendStack":"백엔드 스택","backendNone":"프론트엔드 전용","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"프로젝트 삭제","deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","updated":"업데이트"},"chat":{"title":"채팅","placeholder":"만들고 싶은 것을 설명하세요...","askPlaceholder":"프로젝트에 대해 질문하세요...","queuePlaceholder":"다음 메시지를 입력하세요...","send":"전송","thinking":"AI가 생각 중...","uploading":"파일 업로드 중...","queueCount":"{count}개의 메시지가 대기 중","toolRunning":"실행 중","toolCompleted":"완료","newConversation":"새 대화","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"미리보기","start":"미리보기 시작","stop":"미리보기 중지","starting":"시작 중...","notReady":"프로젝트가 미리보기 준비가 되지 않았습니다","waitForAI":"AI가 프로젝트 파일을 생성할 때까지 기다려주세요","openInNewTab":"새 탭에서 열기"},"fileExplorer":{"title":"파일","empty":"파일이 없습니다","loading":"파일 로딩 중...","error":"파일 로드 실패","open":"파일 탐색기 열기","close":"파일 탐색기 닫기"},"language":{"select":"언어","en":"English","ko":"한국어"},"settings":{"title":"설정","projectsPath":{"title":"프로젝트 폴더","description":"프로젝트가 저장되는 위치","saved":"설정이 저장되었습니다","note":"새 프로젝트는 이 폴더에 생성됩니다. 기존 프로젝트에는 영향을 주지 않습니다."}}}')},n=(0,a.v)()((0,s.Zr)(e=>({locale:"ko",setLocale:t=>e({locale:t})}),{name:"claudeship-locale"}));function i(){let e=n(e=>e.locale);return{t:(t,r)=>(function(e,t,r){let a=t||n.getState().locale,s=e.split("."),i=o[a];for(let t of s)if(i&&"object"==typeof i&&t in i)i=i[t];else{for(let t of(i=o.en,s))if(!i||"object"!=typeof i||!(t in i))return e;else i=i[t];break}let l="string"==typeof i?i:e;if(r)for(let[e,t]of Object.entries(r))l=l.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(t));return l})(t,e,r),locale:e,setLocale:n(e=>e.setLocale)}}}},e=>{e.O(0,[992,59,498,358],()=>e(e.s=2940)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78],{660:(e,t,s)=>{"use strict";s.d(t,{F:()=>n});let r=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api";async function a(e,t){let s="".concat(r).concat(e),a=await fetch(s,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({message:"Request failed"}))).message||"HTTP error! status: ".concat(a.status));if(204!==a.status)return a.json()}let n={get:e=>a(e),post:(e,t)=>a(e,{method:"POST",body:t?JSON.stringify(t):void 0}),put:(e,t)=>a(e,{method:"PUT",body:t?JSON.stringify(t):void 0}),delete:e=>a(e,{method:"DELETE"}),uploadFiles:async(e,t)=>{let s=new FormData;t.forEach(e=>s.append("files",e));let a="".concat(r,"/projects/").concat(e,"/files/upload"),n=await fetch(a,{method:"POST",body:s});if(!n.ok)throw Error((await n.json().catch(()=>({message:"Upload failed"}))).message||"HTTP error! status: ".concat(n.status));return n.json()}}},4264:(e,t,s)=>{"use strict";s.d(t,{I:()=>n});var r=s(4876),a=s(660);let n=(0,r.v)((e,t)=>({projects:[],currentProject:null,isLoading:!1,error:null,fetchProjects:async()=>{e({isLoading:!0,error:null});try{let t=await a.F.get("/projects");e({projects:t,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch projects",isLoading:!1})}},createProject:async t=>{e({isLoading:!0,error:null});try{let s=await a.F.post("/projects",t);return e(e=>({projects:[{id:s.id,name:s.name,projectType:s.projectType,backendFramework:s.backendFramework,updatedAt:s.updatedAt},...e.projects],isLoading:!1})),s}catch(t){throw e({error:t instanceof Error?t.message:"Failed to create project",isLoading:!1}),t}},deleteProject:async t=>{e({isLoading:!0,error:null});try{await a.F.delete("/projects/".concat(t)),e(e=>({projects:e.projects.filter(e=>e.id!==t),isLoading:!1}))}catch(t){throw e({error:t instanceof Error?t.message:"Failed to delete project",isLoading:!1}),t}},fetchProject:async t=>{e({isLoading:!0,error:null});try{let s=await a.F.get("/projects/".concat(t));e({currentProject:s,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch project",isLoading:!1})}},setCurrentProject:t=>e({currentProject:t}),clearError:()=>e({error:null})}))},4859:(e,t,s)=>{"use strict";s.d(t,{V_:()=>a,gM:()=>r,Xh:()=>n});var r=function(e){return e.WEB="WEB",e.NATIVE="NATIVE",e}({}),a=function(e){return e.NONE="NONE",e.EXPRESS="EXPRESS",e.FASTAPI="FASTAPI",e}({}),n=function(e){return e.USER="USER",e.ASSISTANT="ASSISTANT",e.SYSTEM="SYSTEM",e}({})},5006:(e,t,s)=>{Promise.resolve().then(s.bind(s,7275))},5338:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var r=s(8481),a=s(8526),n=s(9049);let l=a.forwardRef((e,t)=>{let{className:s,type:a,...l}=e;return(0,r.jsx)("input",{type:a,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...l})});l.displayName="Input"},5594:(e,t,s)=>{"use strict";s.d(t,{$:()=>o});var r=s(8481),a=s(8526),n=s(4176),l=s(9049);let i=(0,n.F)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=a.forwardRef((e,t)=>{let{className:s,variant:a,size:n,...o}=e;return(0,r.jsx)("button",{className:(0,l.cn)(i({variant:a,size:n,className:s})),ref:t,...o})});o.displayName="Button"},7176:(e,t,s)=>{"use strict";s.d(t,{Y:()=>m});var r=s(8481),a=s(4816),n=s.n(a),l=s(9432),i=s(9150),o=s(7746),c=s(5594),d=s(9426);function u(){let{locale:e,setLocale:t,t:s}=(0,d.B)();return(0,r.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>{t("en"===e?"ko":"en")},className:"h-9 w-9 text-xs font-medium",title:s("language.select"),children:"en"===e?"EN":"KO"})}function m(e){let{title:t,showBack:s,backHref:a="/"}=e,{t:m}=(0,d.B)(),h=t||m("common.appName");return(0,r.jsx)("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,r.jsxs)("div",{className:"flex h-14 w-full items-center justify-between px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,r.jsx)(n(),{href:a,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",children:(0,r.jsx)(i.A,{className:"h-5 w-5"})})}):(0,r.jsx)(l.default,{src:"/logo.svg",alt:"ClaudeShip",width:36,height:36,className:"rounded-lg"}),(0,r.jsx)("h1",{className:"text-lg font-semibold",children:h})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(u,{}),(0,r.jsx)(n(),{href:"/settings",children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",title:m("header.settings"),children:(0,r.jsx)(o.A,{className:"h-5 w-5"})})})]})]})})}},7275:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eL});var r=s(8481),a=s(8526),n=s(3973),l=s(7176),i=s(9049),o=s(5119),c=s(8630),d=s(4415),u=s(2839),m=s(4779),h=s(6224),p=s(6230),x=s(7060),g=s(9358),f=s(1627),j=s(4739),b=s(8756);function N(e){let{children:t,className:s}=e,a=(null==s?void 0:s.replace(/language-/,""))||"text";return(0,r.jsx)(b.f4,{theme:b.Zj.vsDark,code:t.trim(),language:a,children:e=>{let{className:t,style:s,tokens:a,getLineProps:n,getTokenProps:l}=e;return(0,r.jsx)("pre",{className:(0,i.cn)("rounded-lg p-4 overflow-x-auto text-sm my-3",t),style:s,children:(0,r.jsx)("code",{children:a.map((e,t)=>(0,r.jsxs)("div",{...n({line:e}),children:[(0,r.jsx)("span",{className:"inline-block w-8 text-right mr-4 text-gray-500 select-none text-xs",children:t+1}),e.map((e,t)=>(0,r.jsx)("span",{...l({token:e})},t))]},t))})})}})}function v(e){let{content:t,className:s}=e;return(0,r.jsx)("div",{className:(0,i.cn)("markdown-body",s),children:(0,r.jsx)(f.oz,{remarkPlugins:[j.A],components:{h1:e=>{let{children:t}=e;return(0,r.jsx)("h1",{className:"text-2xl font-bold mt-6 mb-4 pb-2 border-b border-border first:mt-0",children:t})},h2:e=>{let{children:t}=e;return(0,r.jsx)("h2",{className:"text-xl font-semibold mt-5 mb-3 pb-1.5 border-b border-border/50",children:t})},h3:e=>{let{children:t}=e;return(0,r.jsx)("h3",{className:"text-lg font-semibold mt-4 mb-2",children:t})},h4:e=>{let{children:t}=e;return(0,r.jsx)("h4",{className:"text-base font-semibold mt-3 mb-2",children:t})},p:e=>{let{children:t}=e;return(0,r.jsx)("p",{className:"my-2 leading-7",children:t})},ul:e=>{let{children:t}=e;return(0,r.jsx)("ul",{className:"my-3 ml-6 list-disc space-y-1.5",children:t})},ol:e=>{let{children:t}=e;return(0,r.jsx)("ol",{className:"my-3 ml-6 list-decimal space-y-1.5",children:t})},li:e=>{let{children:t}=e;return(0,r.jsx)("li",{className:"leading-7",children:t})},table:e=>{let{children:t}=e;return(0,r.jsx)("div",{className:"my-4 overflow-x-auto rounded-lg border border-border",children:(0,r.jsx)("table",{className:"w-full border-collapse text-sm",children:t})})},thead:e=>{let{children:t}=e;return(0,r.jsx)("thead",{className:"bg-muted/50",children:t})},tbody:e=>{let{children:t}=e;return(0,r.jsx)("tbody",{className:"divide-y divide-border",children:t})},tr:e=>{let{children:t}=e;return(0,r.jsx)("tr",{className:"border-b border-border last:border-0",children:t})},th:e=>{let{children:t}=e;return(0,r.jsx)("th",{className:"px-4 py-2.5 text-left font-semibold text-foreground",children:t})},td:e=>{let{children:t}=e;return(0,r.jsx)("td",{className:"px-4 py-2.5 text-muted-foreground",children:t})},pre:e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})},code:e=>{let{className:t,children:s,...a}=e,n=null==t?void 0:t.includes("language-"),l=String(s).replace(/\n$/,"");return n?(0,r.jsx)(N,{className:t,children:l}):(0,r.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono text-primary",...a,children:s})},blockquote:e=>{let{children:t}=e;return(0,r.jsx)("blockquote",{className:"my-4 pl-4 border-l-4 border-primary/30 italic text-muted-foreground",children:t})},hr:()=>(0,r.jsx)("hr",{className:"my-6 border-border"}),a:e=>{let{href:t,children:s}=e;return(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:s})},strong:e=>{let{children:t}=e;return(0,r.jsx)("strong",{className:"font-semibold text-foreground",children:t})},em:e=>{let{children:t}=e;return(0,r.jsx)("em",{className:"italic",children:t})},img:e=>{let{src:t,alt:s}=e;return(0,r.jsx)("img",{src:t,alt:s,className:"my-4 max-w-full rounded-lg border border-border"})}},children:t})})}let y={Read:(0,r.jsx)(o.A,{className:"h-3 w-3"}),Glob:(0,r.jsx)(c.A,{className:"h-3 w-3"}),Grep:(0,r.jsx)(d.A,{className:"h-3 w-3"}),Bash:(0,r.jsx)(u.A,{className:"h-3 w-3"}),Edit:(0,r.jsx)(m.A,{className:"h-3 w-3"}),Write:(0,r.jsx)(m.A,{className:"h-3 w-3"}),WebFetch:(0,r.jsx)(h.A,{className:"h-3 w-3"}),WebSearch:(0,r.jsx)(h.A,{className:"h-3 w-3"}),TodoWrite:(0,r.jsx)(p.A,{className:"h-3 w-3"}),Task:(0,r.jsx)(x.A,{className:"h-3 w-3"})},w={Read:"파일 읽기",Glob:"파일 검색",Grep:"내용 검색",Bash:"명령어 실행",Edit:"파일 수정",Write:"파일 생성",WebFetch:"웹 페이지",WebSearch:"웹 검색",Task:"에이전트",TodoWrite:"작업 목록"};function k(e){let{message:t}=e,s="USER"===t.role,a=[];if(!s&&t.metadata)try{a=("string"==typeof t.metadata?JSON.parse(t.metadata):t.metadata).toolActivities||[]}catch(e){}return(0,r.jsxs)("div",{className:(0,i.cn)("flex gap-3 p-4 rounded-lg",s?"bg-muted/50":"bg-background"),children:[(0,r.jsx)("div",{className:(0,i.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-medium",s?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground"),children:s?"U":"AI"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2 overflow-hidden",children:[a.length>0&&(0,r.jsxs)("div",{className:"flex flex-wrap gap-1 mb-2",children:[a.slice(0,10).map((e,t)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted text-xs text-muted-foreground",children:[(0,r.jsx)(g.A,{className:"h-3 w-3 text-green-600"}),y[e.name]||(0,r.jsx)(u.A,{className:"h-3 w-3"}),w[e.name]||e.name]},t)),a.length>10&&(0,r.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-xs text-muted-foreground",children:["+",a.length-10,"개"]})]}),(0,r.jsx)("div",{className:"max-w-none",children:s?(0,r.jsx)("div",{className:"whitespace-pre-wrap break-words leading-7",children:t.content}):(0,r.jsx)(v,{content:t.content})})]})]})}var A=s(4876),S=s(660),F=s(4859),E=s(5603);let P=(0,A.v)((e,t)=>({messages:[],isStreaming:!1,streamingBlocks:[],error:null,messageQueue:[],isProcessingQueue:!1,mode:"build",pendingQuestion:null,attachedFiles:[],isUploading:!1,setMode:t=>e({mode:t}),addFiles:t=>{let s=t.map(e=>({id:"file-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),file:e,preview:e.type.startsWith("image/")?URL.createObjectURL(e):void 0,status:"pending"}));e(e=>({attachedFiles:[...e.attachedFiles,...s]}))},removeFile:t=>{e(e=>{let s=e.attachedFiles.find(e=>e.id===t);return(null==s?void 0:s.preview)&&URL.revokeObjectURL(s.preview),{attachedFiles:e.attachedFiles.filter(e=>e.id!==t)}})},clearFiles:()=>{t().attachedFiles.forEach(e=>{e.preview&&URL.revokeObjectURL(e.preview)}),e({attachedFiles:[]})},uploadFiles:async s=>{let r=t().attachedFiles.filter(e=>"pending"===e.status);if(0===r.length)return t().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath);e({isUploading:!0});try{e(e=>({attachedFiles:e.attachedFiles.map(e=>"pending"===e.status?{...e,status:"uploading"}:e)}));let a=await S.F.uploadFiles(s,r.map(e=>e.file)),n=[];return e(e=>({attachedFiles:e.attachedFiles.map(e=>{if("uploading"===e.status){let t=a.files.find(t=>t.originalName===e.file.name);if(t)return n.push(t.path),{...e,status:"uploaded",uploadedPath:t.path}}return e})})),[...t().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath)]}catch(t){return e(e=>({attachedFiles:e.attachedFiles.map(e=>"uploading"===e.status?{...e,status:"error",error:t.message}:e),error:t instanceof Error?t.message:"Failed to upload files"})),[]}finally{e({isUploading:!1})}},fetchMessages:async t=>{try{let s=await S.F.get("/projects/".concat(t,"/messages"));e({messages:s,error:null})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch messages"})}},fetchActiveSession:async s=>{try{let a=await S.F.get("/projects/".concat(s,"/chat/status")),n=t();if(a.isStreaming){if(!n.isStreaming){var r;e({isStreaming:!0,streamingBlocks:[]});let a=await fetch("".concat(E.env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api","/projects/").concat(s,"/chat/subscribe"));if(!a.ok)throw Error("Failed to subscribe to session");let n=null==(r=a.body)?void 0:r.getReader();if(!n)throw Error("No response body");let l=new TextDecoder,i="";(async()=>{try{for(;;){let{done:t,value:s}=await n.read();if(t)break;let r=(i+=l.decode(s,{stream:!0})).split("\n");for(let t of(i=r.pop()||"",r))if(t.startsWith("data: "))try{let s=JSON.parse(t.slice(6));if(console.log("[SSE Subscribe Event]",s.type,s),"no_active_session"===s.type)break;if("text"===s.type&&s.content){let t={id:"text-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"text",content:s.content};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else if("tool_use"===s.type&&s.tool){let t={id:"tool-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"tool_use",tool:{name:s.tool.name,input:s.tool.input},status:"running"};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else"tool_result"===s.type?e(e=>{let t=[...e.streamingBlocks];for(let e=t.length-1;e>=0;e--)if("tool_use"===t[e].type&&"running"===t[e].status){t[e]={...t[e],status:"completed",result:s.content};break}return{streamingBlocks:t}}):"error"===s.type&&e({error:s.error})}catch(e){}}}finally{await t().fetchMessages(s),e({isStreaming:!1})}})()}}else n.isStreaming&&(await t().fetchMessages(s),e({isStreaming:!1,streamingBlocks:[]}))}catch(e){console.error("Failed to fetch active session:",e)}},queueMessage:(t,s)=>{let r={id:"queue-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),content:s,status:"queued"},a={id:"temp-".concat(Date.now()),projectId:t,role:F.Xh.USER,content:s,createdAt:new Date};e(e=>({messageQueue:[...e.messageQueue,r],messages:[...e.messages,a]}))},processQueue:async s=>{let r=t();if(!r.isProcessingQueue&&0!==r.messageQueue.length){for(e({isProcessingQueue:!0});t().messageQueue.length>0;){let r=t().messageQueue[0];e(e=>({messageQueue:e.messageQueue.map((e,t)=>0===t?{...e,status:"processing"}:e)})),await t().sendMessage(s,r.content,!0),e(e=>({messageQueue:e.messageQueue.slice(1)}))}e({isProcessingQueue:!1})}},sendMessage:async function(s,r){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t().isStreaming&&!a)return void t().queueMessage(s,r);if(!a){let t={id:"temp-".concat(Date.now()),projectId:s,role:F.Xh.USER,content:r,createdAt:new Date};e(e=>({messages:[...e.messages,t]}))}e({isStreaming:!0,streamingBlocks:[],error:null});try{var n;let a=t().mode,l=t().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath),i=await fetch("".concat(E.env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api","/projects/").concat(s,"/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r,mode:a,attachments:l.length>0?l:void 0})});if(l.length>0&&t().clearFiles(),!i.ok)throw Error("Failed to send message");let o=null==(n=i.body)?void 0:n.getReader();if(!o)throw Error("No response body");let c=new TextDecoder,d="";for(;;){let{done:t,value:s}=await o.read();if(t)break;let r=(d+=c.decode(s,{stream:!0})).split("\n");for(let t of(d=r.pop()||"",r))if(t.startsWith("data: "))try{let s=JSON.parse(t.slice(6));if(console.log("[SSE Event]",s.type,s),"text"===s.type&&s.content){let t={id:"text-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"text",content:s.content};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else if("tool_use"===s.type&&s.tool){let t={id:"tool-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"tool_use",tool:{name:s.tool.name,input:s.tool.input},status:"running"};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else if("tool_result"===s.type)e(e=>{let t=[...e.streamingBlocks];for(let e=t.length-1;e>=0;e--)if("tool_use"===t[e].type&&"running"===t[e].status){t[e]={...t[e],status:"completed",result:s.content};break}return{streamingBlocks:t}});else if("ask_user_question"===s.type&&s.askUserQuestion){let t={id:"question-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"ask_user_question",askUserQuestion:s.askUserQuestion,status:"waiting"};e(e=>({streamingBlocks:[...e.streamingBlocks,t],pendingQuestion:s.askUserQuestion}))}else"error"===s.type&&e({error:s.error})}catch(e){}}await t().fetchMessages(s)}catch(t){e({error:t instanceof Error?t.message:"Failed to send message"})}finally{e({isStreaming:!1}),t().messageQueue.length>0&&setTimeout(()=>t().processQueue(s),100)}},addMessage:t=>{e(e=>({messages:[...e.messages,t]}))},clearMessages:()=>{e({messages:[],streamingBlocks:[],messageQueue:[]})},clearError:()=>{e({error:null})},respondToQuestion:async(s,r)=>{if(!t().pendingQuestion)return;let a=Object.entries(r).map(e=>{let[t,s]=e;return"".concat(t,": ").concat(s)}).join("\n");e(e=>{let t=[...e.streamingBlocks];for(let e=t.length-1;e>=0;e--)if("ask_user_question"===t[e].type&&"waiting"===t[e].status){t[e]={...t[e],status:"completed"};break}return{streamingBlocks:t,pendingQuestion:null}}),await t().sendMessage(s,a)}}));var C=s(8031),B=s(6569),R=s(6776),T=s(5594),L=s(4660),I=s(3527);let _=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(L.bL,{className:(0,i.cn)("grid gap-2",s),...a,ref:t})});_.displayName=L.bL.displayName;let q=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(L.q7,{ref:t,className:(0,i.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:(0,r.jsx)(L.C1,{className:"flex items-center justify-center",children:(0,r.jsx)(I.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});q.displayName=L.q7.displayName;var U=s(8367);let D=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(U.bL,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...a,children:(0,r.jsx)(U.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(B.A,{className:"h-4 w-4"})})})});D.displayName=U.bL.displayName;var Q=s(2731);let W=(0,s(4176).F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),z=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(Q.b,{ref:t,className:(0,i.cn)(W(),s),...a})});z.displayName=Q.b.displayName;var M=s(5338);function O(e){let{data:t,isWaiting:s,onSubmit:n}=e,[l,i]=(0,a.useState)({}),[o,c]=(0,a.useState)({}),d=t.questions.every((e,t)=>l[t]||o[t]);return s?(0,r.jsxs)("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-primary",children:[(0,r.jsx)(R.A,{className:"h-5 w-5"}),(0,r.jsx)("span",{className:"font-medium",children:"AI의 질문"})]}),t.questions.map((e,t)=>(0,r.jsxs)("div",{className:"space-y-3",children:[e.header&&(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-medium bg-primary/10 text-primary rounded",children:e.header}),(0,r.jsx)("p",{className:"text-sm font-medium",children:e.question}),e.multiSelect?(0,r.jsx)("div",{className:"space-y-2",children:e.options.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,r.jsx)(D,{id:"q".concat(t,"-o").concat(s),checked:(l[t]||[]).includes(e.label),onCheckedChange:s=>{var r,a;return r=e.label,a=!0===s,void i(e=>{let s=e[t]||[];return a?{...e,[t]:[...s,r]}:{...e,[t]:s.filter(e=>e!==r)}})}}),(0,r.jsxs)("div",{className:"grid gap-0.5 leading-none",children:[(0,r.jsx)(z,{htmlFor:"q".concat(t,"-o").concat(s),className:"text-sm cursor-pointer",children:e.label}),e.description&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})]},s))}):(0,r.jsx)(_,{value:l[t],onValueChange:e=>{i(s=>({...s,[t]:e}))},className:"space-y-2",children:e.options.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,r.jsx)(q,{value:e.label,id:"q".concat(t,"-o").concat(s)}),(0,r.jsxs)("div",{className:"grid gap-0.5 leading-none",children:[(0,r.jsx)(z,{htmlFor:"q".concat(t,"-o").concat(s),className:"text-sm cursor-pointer",children:e.label}),e.description&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})]},s))}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"또는 직접 입력:"}),(0,r.jsx)(M.p,{placeholder:"다른 답변...",value:o[t]||"",onChange:e=>{var s;return s=e.target.value,void c(e=>({...e,[t]:s}))},className:"h-8 text-sm flex-1"})]})]},t)),(0,r.jsx)(T.$,{onClick:()=>{let e={};t.questions.forEach((t,s)=>{let r=l[s],a=o[s];a?e[t.question]=a:Array.isArray(r)?e[t.question]=r.join(", "):r&&(e[t.question]=r)}),n(e)},disabled:!d,className:"w-full",size:"sm",children:"답변 제출"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md text-sm bg-muted border border-border",children:[(0,r.jsx)(B.A,{className:"h-4 w-4 text-green-600"}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[(0,r.jsx)(R.A,{className:"h-4 w-4 inline mr-1"}),"질문 응답 완료"]})]})}let $={Read:(0,r.jsx)(o.A,{className:"h-4 w-4"}),Glob:(0,r.jsx)(c.A,{className:"h-4 w-4"}),Grep:(0,r.jsx)(d.A,{className:"h-4 w-4"}),Bash:(0,r.jsx)(u.A,{className:"h-4 w-4"}),Edit:(0,r.jsx)(m.A,{className:"h-4 w-4"}),Write:(0,r.jsx)(m.A,{className:"h-4 w-4"}),WebFetch:(0,r.jsx)(h.A,{className:"h-4 w-4"}),WebSearch:(0,r.jsx)(h.A,{className:"h-4 w-4"}),TodoWrite:(0,r.jsx)(p.A,{className:"h-4 w-4"}),Task:(0,r.jsx)(x.A,{className:"h-4 w-4"})};function J(e){var t,s;let r=null==(t=e.tool)?void 0:t.input,a=null==(s=e.tool)?void 0:s.name;if(!r||!a)return"";if("Read"===a&&r.file_path)return r.file_path.split("/").pop()||"";if("Glob"===a&&r.pattern||"Grep"===a&&r.pattern)return r.pattern;if("Bash"===a&&r.command){let e=r.command;return e.length>50?e.substring(0,50)+"...":e}return("Edit"===a||"Write"===a)&&r.file_path&&r.file_path.split("/").pop()||""}function G(e){let{content:t}=e;return(0,r.jsx)(v,{content:t})}function X(e){var t;let{block:s}=e,a="running"===s.status,n=(null==(t=s.tool)?void 0:t.name)||"Unknown";return(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md text-sm ".concat(a?"bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800":"bg-muted border border-border"),children:[a?(0,r.jsx)(C.A,{className:"h-4 w-4 animate-spin text-blue-600 dark:text-blue-400"}):(0,r.jsx)(g.A,{className:"h-4 w-4 text-green-600"}),(0,r.jsx)("span",{className:a?"text-blue-700 dark:text-blue-300":"text-muted-foreground",children:$[n]||(0,r.jsx)(u.A,{className:"h-4 w-4"})}),(0,r.jsx)("span",{className:"font-medium ".concat(a?"text-blue-800 dark:text-blue-200":""),children:{Read:"파일 읽기",Glob:"파일 검색",Grep:"내용 검색",Bash:"명령어 실행",Edit:"파일 수정",Write:"파일 생성",WebFetch:"웹 페이지 가져오기",WebSearch:"웹 검색",Task:"에이전트 실행",TodoWrite:"작업 목록 업데이트"}[n]||n}),J(s)&&(0,r.jsx)("span",{className:"truncate ".concat(a?"text-blue-600 dark:text-blue-400":"text-muted-foreground"),children:J(s)})]})}function H(e){let{blocks:t,isStreaming:s=!0,projectId:a}=e,n=t.length>0,{respondToQuestion:l,pendingQuestion:i}=P(),o=e=>{l(a,e)};return(0,r.jsxs)("div",{className:"flex gap-3 p-4 rounded-lg bg-background",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-secondary text-secondary-foreground text-sm font-medium",children:"AI"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2 overflow-hidden",children:[t.map(e=>"text"===e.type?(0,r.jsx)(G,{content:e.content||""},e.id):"tool_use"===e.type?(0,r.jsx)(X,{block:e},e.id):"ask_user_question"===e.type&&e.askUserQuestion?(0,r.jsx)(O,{data:e.askUserQuestion,isWaiting:"waiting"===e.status,onSubmit:o},e.id):null),s&&!n&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,r.jsx)(C.A,{className:"h-4 w-4 animate-spin"}),(0,r.jsx)("span",{className:"text-sm",children:"AI가 생각 중..."})]}),s&&n&&(0,r.jsx)("span",{className:"inline-block w-2 h-4 bg-primary animate-pulse"})]})]})}function V(e){let{messages:t,streamingBlocks:s=[],isStreaming:n,projectId:l}=e,i=(0,a.useRef)(null);return(0,a.useEffect)(()=>{var e;null==(e=i.current)||e.scrollIntoView({behavior:"smooth"})},[t,s]),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[0===t.length&&!n&&(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-lg font-medium",children:"안녕하세요!"}),(0,r.jsx)("p",{className:"text-sm",children:"무엇을 만들어 드릴까요?"})]})}),t.map(e=>(0,r.jsx)(k,{message:e},e.id)),s.length>0&&(0,r.jsx)(H,{blocks:s,isStreaming:n,projectId:l}),(0,r.jsx)("div",{ref:i})]})}var K=s(7793),Y=s(3113),Z=s(219),ee=s(9426),et=s(2881);function es(){let{t:e}=(0,ee.B)(),{mode:t,setMode:s,isStreaming:a}=P();return(0,r.jsxs)("div",{className:"flex gap-1 p-1 bg-muted rounded-lg w-fit",children:[(0,r.jsxs)("button",{onClick:()=>s("ask"),disabled:a,className:(0,i.cn)("flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-colors","ask"===t?"bg-blue-500 text-white":"text-muted-foreground hover:text-foreground hover:bg-muted-foreground/10",a&&"opacity-50 cursor-not-allowed"),children:[(0,r.jsx)(R.A,{className:"h-4 w-4"}),e("chat.modeAsk")]}),(0,r.jsxs)("button",{onClick:()=>s("build"),disabled:a,className:(0,i.cn)("flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-colors","build"===t?"bg-green-500 text-white":"text-muted-foreground hover:text-foreground hover:bg-muted-foreground/10",a&&"opacity-50 cursor-not-allowed"),children:[(0,r.jsx)(et.A,{className:"h-4 w-4"}),e("chat.modeBuild")]})]})}var er=s(6241);function ea(e){let{files:t,onRemove:s}=e;return 0===t.length?null:(0,r.jsx)("div",{className:"flex flex-wrap gap-2 px-4 pb-2",children:t.map(e=>{var t;return(0,r.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-lg border bg-muted/50 p-2",children:[e.preview?(0,r.jsx)("img",{src:e.preview,alt:e.file.name,className:"h-12 w-12 rounded object-cover"}):(0,r.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded bg-muted",children:(0,r.jsx)(o.A,{className:"h-6 w-6 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"max-w-[120px] truncate text-xs font-medium",children:e.file.name}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:(t=e.file.size)<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")})]}),"uploading"===e.status&&(0,r.jsx)(C.A,{className:"h-4 w-4 animate-spin text-muted-foreground"}),"error"===e.status&&(0,r.jsx)("span",{className:"text-xs text-destructive",children:e.error}),(0,r.jsx)("button",{onClick:()=>s(e.id),className:"absolute -right-2 -top-2 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-destructive-foreground opacity-0 transition-opacity group-hover:opacity-100",children:(0,r.jsx)(er.A,{className:"h-3 w-3"})})]},e.id)})})}let en=["image/png","image/jpeg","image/gif","image/webp","application/pdf","text/plain","text/markdown","text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function el(e){let{onSend:t,projectId:s,disabled:n,isStreaming:l,queueCount:i=0}=e,{t:o}=(0,ee.B)(),{mode:c,attachedFiles:d,addFiles:u,removeFile:m,uploadFiles:h,isUploading:p}=P(),[x,g]=(0,a.useState)(""),[f,j]=(0,a.useState)(!1),b=(0,a.useRef)(null),N=(0,a.useRef)(null),v=e=>{let t=e.filter(e=>en.includes(e.type)?!(e.size>0x6400000)||(console.warn("File too large: ".concat(e.name)),!1):(console.warn("File type not allowed: ".concat(e.type)),!1)),s=5-d.length;s<=0||u(t.slice(0,s))},y=async()=>{if(!x.trim()&&0===d.length||n||p)return;let e=[];d.length>0&&(e=await h(s)),t(x.trim(),e.length>0?e:void 0),g(""),b.current&&(b.current.style.height="auto")};return(0,r.jsxs)("div",{className:"border-t bg-background ".concat(f?"ring-2 ring-ring ring-offset-2":""),onDragOver:e=>{e.preventDefault(),j(!0)},onDragLeave:e=>{e.preventDefault(),j(!1)},onDrop:e=>{e.preventDefault(),j(!1),e.dataTransfer.files&&v(Array.from(e.dataTransfer.files))},children:[(0,r.jsx)("div",{className:"p-4 pb-2",children:(0,r.jsx)(es,{})}),(0,r.jsx)(ea,{files:d,onRemove:m}),(0,r.jsxs)("div",{className:"flex items-end gap-2 px-4 pb-4",children:[(0,r.jsx)("input",{ref:N,type:"file",multiple:!0,accept:en.join(","),onChange:e=>{e.target.files&&(v(Array.from(e.target.files)),e.target.value="")},className:"hidden"}),(0,r.jsx)(T.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>{var e;return null==(e=N.current)?void 0:e.click()},disabled:n||d.length>=5,className:"h-10 w-10 shrink-0",children:(0,r.jsx)(K.A,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:"relative flex-1",children:(0,r.jsx)("textarea",{ref:b,value:x,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),y())},onInput:()=>{let e=b.current;e&&(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,200),"px"))},placeholder:o(l?"chat.queuePlaceholder":"ask"===c?"chat.askPlaceholder":"chat.placeholder"),disabled:n,rows:1,className:"w-full resize-none rounded-lg border border-input bg-background px-4 py-3 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})}),(0,r.jsx)(T.$,{onClick:y,disabled:!x.trim()&&0===d.length||n||p,size:"icon",className:"h-10 w-10 shrink-0",children:(0,r.jsx)(Y.A,{className:"h-4 w-4"})})]}),(l||p)&&(0,r.jsxs)("div",{className:"px-4 pb-4 flex items-center gap-2 text-xs text-muted-foreground",children:[p?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"}),o("chat.uploading")]}):(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-yellow-500"}),o("chat.thinking")]}),i>0&&(0,r.jsxs)("span",{className:"flex items-center gap-1 text-blue-500",children:[(0,r.jsx)(Z.A,{className:"h-3 w-3"}),o("chat.queueCount",{count:i})]})]})]})}var ei=s(4025);function eo(e){let{projectId:t}=e,{t:s}=(0,ee.B)(),[n,l]=(0,a.useState)(!1),{messages:i,isStreaming:o,streamingBlocks:c,messageQueue:d,fetchMessages:u,fetchActiveSession:m,sendMessage:h,clearMessages:p}=P();(0,a.useEffect)(()=>{p(),u(t),m(t)},[t,u,m,p]);let x=async()=>{if(!n&&!o){l(!0);try{await S.F.post("/projects/".concat(t,"/chat/reset"))}catch(e){console.error("Failed to reset session:",e)}finally{l(!1)}}};return(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsxs)("div",{className:"flex h-12 items-center justify-between border-b px-4",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:s("chat.title")}),(0,r.jsxs)(T.$,{variant:"ghost",size:"sm",onClick:x,disabled:n||o,title:s("chat.newConversation"),className:"gap-1.5",children:[(0,r.jsx)(ei.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:s("chat.newConversation")})]})]}),(0,r.jsx)(V,{messages:i,streamingBlocks:c,isStreaming:o,projectId:t}),(0,r.jsx)(el,{onSend:e=>{h(t,e)},projectId:t,isStreaming:o,queueCount:d.length})]})}var ec=s(3774),ed=s(3787),eu=s(5471),em=s(7604),eh=s(6021),ep=s(9085);let ex=(0,A.v)((e,t)=>({status:"stopped",url:null,error:null,isLoading:!1,projectReady:{ready:!1,isFullstack:!1,frontend:{hasPackageJson:!1,hasNodeModules:!1,hasDevScript:!1}},startPreview:async t=>{e({isLoading:!0,error:null,status:"starting"});try{let s=await S.F.post("/projects/".concat(t,"/preview/start"));e({status:s.status,url:s.url||null,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to start preview",status:"error",isLoading:!1})}},stopPreview:async t=>{e({isLoading:!0,error:null});try{await S.F.post("/projects/".concat(t,"/preview/stop")),e({status:"stopped",url:null,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to stop preview",isLoading:!1})}},refreshPreview:()=>{let s=t().url;s&&e({url:"".concat(s.split("?")[0],"?t=").concat(Date.now())})},fetchStatus:async t=>{try{let s=await S.F.get("/projects/".concat(t,"/preview/status"));e({status:s.status,url:s.url||null})}catch(t){e({status:"stopped",url:null})}},checkProjectReady:async t=>{try{let s=await S.F.get("/projects/".concat(t,"/preview/ready"));e({projectReady:s})}catch(t){e({projectReady:{ready:!1,isFullstack:!1,frontend:{hasPackageJson:!1,hasNodeModules:!1,hasDevScript:!1}}})}},clearError:()=>e({error:null})})),eg=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000";function ef(e){let{projectId:t}=e,{t:s}=(0,ee.B)(),[n,l]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!0),[c,d]=(0,a.useState)(null),u=(0,a.useRef)(null),m=(0,a.useRef)(null),{status:h,url:p,error:x,isLoading:g,projectReady:f,startPreview:j,stopPreview:b,refreshPreview:N,fetchStatus:v,checkProjectReady:y,clearError:w}=ex(),k=(0,a.useRef)(!1),A=(0,a.useRef)(0);(0,a.useRef)(h).current=h;let S=(0,a.useCallback)(e=>{i&&"running"===h&&(d(e.split("/").pop()||e),setTimeout(()=>d(null),2e3),m.current&&(m.current.src=m.current.src))},[i,h]);(0,a.useEffect)(()=>{if(!n||"running"!==h){u.current&&(u.current.close(),u.current=null);return}let e=new EventSource("".concat(eg,"/projects/").concat(t,"/preview/watch"));return e.onmessage=e=>{try{let t=JSON.parse(e.data);"file-change"===t.type&&S(t.path)}catch(e){}},e.onerror=()=>{e.close(),u.current=null},u.current=e,()=>{e.close(),u.current=null}},[n,h,t,S]),(0,a.useEffect)(()=>{l(!0)},[]),(0,a.useEffect)(()=>{let e=()=>{let e="".concat(eg,"/projects/").concat(t,"/preview/stop");navigator.sendBeacon(e)};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[t]),(0,a.useEffect)(()=>{k.current=!1,A.current=0,w()},[t,w]),(0,a.useEffect)(()=>{if(!n)return;v(t),y(t);let e=setInterval(()=>{v(t),"running"!==h&&"starting"!==h&&y(t)},2e3);return()=>clearInterval(e)},[t,v,y,h,n]),(0,a.useEffect)(()=>{if(!n||g||"starting"===h)return;let e=k.current,s=f.ready;if(!e&&s&&(A.current=0),k.current=s,s&&"stopped"===h&&A.current<3&&(A.current++,j(t)),s&&"error"===h&&A.current<3){let e=setTimeout(()=>{f.ready&&A.current<3&&(A.current++,w(),j(t))},3e3);return()=>clearTimeout(e)}},[n,f.ready,h,g,t,j,w]);let F=()=>j(t);return(0,r.jsxs)("div",{className:"flex h-full flex-col border-l",children:[(0,r.jsxs)("div",{className:"flex h-12 items-center justify-between border-b px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(n?"running"===h?"bg-green-500":"starting"===h?"bg-yellow-500 animate-pulse":"error"===h?"bg-red-500":"bg-gray-400":"bg-gray-400")}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:s(n?"running"===h?"preview.title":"starting"===h?"preview.starting":"error"===h?"common.error":"preview.stop":"common.loading")})]}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:"running"===h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>o(!i),className:"h-8 w-8 p-0 ".concat(i?"text-green-500":"text-muted-foreground"),title:i?"Auto-refresh ON":"Auto-refresh OFF",children:(0,r.jsx)(ec.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>N(),disabled:g,className:"h-8 w-8 p-0",children:(0,r.jsx)(ed.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>{p&&window.open(p,"_blank")},className:"h-8 w-8 p-0",children:(0,r.jsx)(eu.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>b(t),disabled:g,className:"h-8 w-8 p-0",children:(0,r.jsx)(em.A,{className:"h-4 w-4"})})]}):(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:F,disabled:!n||g||"starting"===h||!f.ready,title:s(f.ready?"preview.start":"preview.notReady"),className:"h-8 w-8 p-0",children:(0,r.jsx)(eh.A,{className:"h-4 w-4"})})})]}),(0,r.jsx)("div",{className:"flex-1 bg-muted/30",children:n?"running"===h&&p?(0,r.jsxs)("div",{className:"relative h-full w-full",children:[(0,r.jsx)("iframe",{ref:m,src:p,className:"h-full w-full border-0"},p),c&&(0,r.jsxs)("div",{className:"absolute bottom-4 right-4 flex items-center gap-2 px-3 py-2 bg-green-500/90 text-white text-xs rounded-lg shadow-lg animate-pulse",children:[(0,r.jsx)(ec.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{children:c})]})]}):"starting"===h?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,r.jsx)(ed.A,{className:"mx-auto h-8 w-8 animate-spin mb-2"}),(0,r.jsx)("p",{children:s("preview.starting")})]})}):x?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-destructive",children:[(0,r.jsx)("p",{className:"font-medium",children:s("common.error")}),(0,r.jsx)("p",{className:"text-sm",children:x}),(0,r.jsx)(T.$,{variant:"outline",size:"sm",onClick:F,className:"mt-4",children:s("common.refresh")})]})}):f.ready?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,r.jsx)(eh.A,{className:"mx-auto h-8 w-8 mb-2"}),(0,r.jsx)("p",{children:s("preview.start")})]})}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-muted-foreground max-w-sm",children:[(0,r.jsx)(ep.A,{className:"mx-auto h-8 w-8 mb-3 text-muted-foreground/50"}),(0,r.jsx)("p",{className:"font-medium mb-3",children:s("preview.notReady")}),(0,r.jsxs)("div",{className:"text-xs space-y-3",children:[(0,r.jsxs)("div",{className:"border rounded-lg p-2",children:[(0,r.jsx)("p",{className:"font-medium mb-1.5 text-foreground",children:f.isFullstack?"Frontend":"Project"}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.frontend.hasPackageJson?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,r.jsx)("span",{children:"package.json"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.frontend.hasDevScript?"bg-green-500":"bg-gray-300")}),(0,r.jsx)("span",{children:"dev script"})]})]})]}),f.isFullstack&&f.backend&&(0,r.jsxs)("div",{className:"border rounded-lg p-2",children:[(0,r.jsxs)("p",{className:"font-medium mb-1.5 text-foreground",children:["Backend ","FASTAPI"===f.backendFramework?"(Python)":"(Node.js)"]}),(0,r.jsx)("div",{className:"space-y-1",children:"FASTAPI"===f.backendFramework?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasRequirementsTxt?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,r.jsx)("span",{children:"requirements.txt"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasMainPy?"bg-green-500":"bg-gray-300")}),(0,r.jsx)("span",{children:"main.py"})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasPackageJson?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,r.jsx)("span",{children:"package.json"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasDevScript?"bg-green-500":"bg-gray-300")}),(0,r.jsx)("span",{children:"dev script"})]})]})})]})]}),(0,r.jsx)("p",{className:"text-xs mt-4",children:s("preview.waitForAI")})]})}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(C.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})})})]})}var ej=s(794),eb=s(2475),eN=s(4373),ev=s(4309),ey=s(6925);let ew=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:3000";function ek(e){let{projectId:t,onFileSelect:s}=e,{t:n}=(0,ee.B)(),[l,i]=(0,a.useState)([]),[o,c]=(0,a.useState)(!0),[d,u]=(0,a.useState)(!1),m=(0,a.useCallback)(async()=>{try{c(!0),u(!1);let e=await fetch("".concat(ew,"/projects/").concat(t,"/files"));if(!e.ok)throw Error("Failed to load files");let s=await e.json();i(s)}catch(e){u(!0)}finally{c(!1)}},[t]);(0,a.useEffect)(()=>{m()},[m]);let h=async e=>{if(s)try{let r=await fetch("".concat(ew,"/projects/").concat(t,"/files/content?path=").concat(encodeURIComponent(e)));if(!r.ok)throw Error("Failed to load file");let a=await r.json();s(e,a.content)}catch(e){}};return o?(0,r.jsx)("div",{className:"p-4 text-sm text-muted-foreground",children:n("fileExplorer.loading")}):d?(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)("p",{className:"text-sm text-destructive mb-2",children:n("fileExplorer.error")}),(0,r.jsxs)(T.$,{variant:"outline",size:"sm",onClick:m,children:[(0,r.jsx)(ed.A,{className:"h-3 w-3 mr-1"}),n("common.refresh")]})]}):(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"flex h-12 items-center justify-between px-4 border-b",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:n("fileExplorer.title")}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,title:n("common.refresh"),children:(0,r.jsx)(ed.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto p-2",children:0===l.length?(0,r.jsx)("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:n("fileExplorer.empty")}):(0,r.jsx)(eA,{nodes:l,onFileClick:h})})]})}function eA(e){let{nodes:t,onFileClick:s,level:a=0}=e;return(0,r.jsx)("ul",{className:"space-y-0.5",children:t.map(e=>(0,r.jsx)(eS,{node:e,onFileClick:s,level:a},e.path))})}function eS(e){let{node:t,onFileClick:s,level:n}=e,[l,o]=(0,a.useState)(n<1),c="directory"===t.type;return(0,r.jsxs)("li",{children:[(0,r.jsxs)("div",{className:(0,i.cn)("flex items-center gap-1 px-2 py-1 rounded-sm cursor-pointer","hover:bg-accent text-sm"),style:{paddingLeft:"".concat(12*n+8,"px")},onClick:()=>{c?o(!l):s(t.path)},children:[c&&(0,r.jsx)("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:l?(0,r.jsx)(ev.A,{className:"h-3 w-3"}):(0,r.jsx)(ey.A,{className:"h-3 w-3"})}),!c&&(0,r.jsx)("span",{className:"w-4 flex-shrink-0"}),(()=>{if(c)return l?(0,r.jsx)(ej.A,{className:"h-4 w-4 text-blue-400 flex-shrink-0"}):(0,r.jsx)(eb.A,{className:"h-4 w-4 text-blue-400 flex-shrink-0"});let e={ts:"text-blue-400",tsx:"text-blue-400",js:"text-yellow-400",jsx:"text-yellow-400",py:"text-green-400",json:"text-yellow-600",md:"text-gray-400",css:"text-purple-400",scss:"text-pink-400",html:"text-orange-400",prisma:"text-teal-400"}[t.extension||""]||"text-muted-foreground";return(0,r.jsx)(eN.A,{className:(0,i.cn)("h-4 w-4 flex-shrink-0",e)})})(),(0,r.jsx)("span",{className:"truncate",children:t.name})]}),c&&l&&t.children&&(0,r.jsx)(eA,{nodes:t.children,onFileClick:s,level:n+1})]})}var eF=s(262);let eE={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",json:"json",md:"markdown",css:"css",scss:"scss",html:"markup",prisma:"graphql",sql:"sql",sh:"bash",bash:"bash",yml:"yaml",yaml:"yaml",env:"bash",gitignore:"bash"};function eP(e){let{path:t,content:s,language:n,onClose:l}=e,{t:i}=(0,ee.B)(),[o,c]=(0,a.useState)(!1),d=t.split("/").pop()||t,u=eE[n]||"typescript",m=s.split("\n"),h=async()=>{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)};return(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"fixed inset-4 z-50 flex flex-col rounded-lg border bg-background shadow-lg md:inset-8 lg:inset-16",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-mono text-sm font-medium",children:d}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:t})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground mr-2",children:[m.length," lines"]}),(0,r.jsx)(T.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:h,title:o?"Copied!":"Copy",children:o?(0,r.jsx)(B.A,{className:"h-4 w-4 text-green-500"}):(0,r.jsx)(eF.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:l,title:i("common.close"),children:(0,r.jsx)(er.A,{className:"h-4 w-4"})})]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto bg-[#1e1e1e]",children:(0,r.jsx)(b.f4,{theme:b.Zj.vsDark,code:s,language:u,children:e=>{let{className:t,style:s,tokens:a,getLineProps:n,getTokenProps:l}=e;return(0,r.jsx)("pre",{className:"text-sm leading-relaxed",style:{...s,margin:0,padding:"1rem",background:"#1e1e1e",minHeight:"100%"},children:(0,r.jsx)("code",{className:t,children:a.map((e,t)=>{let{key:s,...a}=n({line:e});return(0,r.jsxs)("div",{...a,className:"table-row hover:bg-white/5",children:[(0,r.jsx)("span",{className:"table-cell select-none pr-4 text-right text-gray-500 w-12",children:t+1}),(0,r.jsx)("span",{className:"table-cell",children:e.map((e,t)=>{let{key:s,...a}=l({token:e});return(0,r.jsx)("span",{...a},t)})})]},t)})})})}})})]})})}var eC=s(2858);function eB(e){let{projectId:t}=e,{t:s}=(0,ee.B)(),[n,l]=(0,a.useState)(!1),[i,o]=(0,a.useState)(null);return(0,r.jsxs)("div",{className:"flex h-[calc(100vh-3.5rem)]",children:[(0,r.jsx)(T.$,{variant:"outline",size:"sm",onClick:()=>l(!n),className:"absolute left-4 top-16 z-10 h-8 w-8 p-0",title:s(n?"fileExplorer.close":"fileExplorer.open"),children:n?(0,r.jsx)(er.A,{className:"h-4 w-4"}):(0,r.jsx)(eC.A,{className:"h-4 w-4"})}),n&&(0,r.jsx)("div",{className:"w-64 border-r bg-muted/30 flex-shrink-0",children:(0,r.jsx)(ek,{projectId:t,onFileSelect:(e,t)=>{let s=e.split(".").pop()||"";o({path:e,content:t,extension:s})}})}),(0,r.jsx)("div",{className:"border-r flex-1",style:{maxWidth:n?"calc(50% - 8rem)":"50%"},children:(0,r.jsx)(eo,{projectId:t})}),(0,r.jsx)("div",{className:"flex-1",style:{maxWidth:n?"calc(50% - 8rem)":"50%"},children:(0,r.jsx)(ef,{projectId:t})}),i&&(0,r.jsx)(eP,{path:i.path,content:i.content,language:i.extension,onClose:()=>{o(null)}})]})}var eR=s(4264),eT=s(9696);function eL(){let e=(0,n.useParams)(),t=(0,n.useRouter)(),s=e.id,{currentProject:i,fetchProject:o,isLoading:c,error:d}=(0,eR.I)();return((0,a.useEffect)(()=>{s&&o(s)},[s,o]),c&&!i)?(0,r.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,r.jsx)("p",{className:"text-muted-foreground",children:"로딩 중..."})}):d||!i?(0,r.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center gap-4",children:[(0,r.jsx)(eT.A,{className:"h-12 w-12 text-destructive"}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-lg font-medium",children:"프로젝트를 찾을 수 없습니다"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:d||"프로젝트가 삭제되었거나 존재하지 않습니다."})]}),(0,r.jsx)(T.$,{onClick:()=>t.push("/"),variant:"outline",children:"홈으로 돌아가기"})]}):(0,r.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,r.jsx)(l.Y,{title:i.name,showBack:!0,backHref:"/"}),(0,r.jsx)(eB,{projectId:s})]})}},9049:(e,t,s)=>{"use strict";s.d(t,{cn:()=>n});var r=s(5806),a=s(4159);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,r.$)(t))}},9426:(e,t,s)=>{"use strict";s.d(t,{B:()=>i});var r=s(4876),a=s(1203);let n={en:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"Loading...","error":"Error","save":"Save","cancel":"Cancel","delete":"Delete","create":"Create","close":"Close","refresh":"Refresh","settings":"Settings"},"header":{"home":"Home","settings":"Settings"},"home":{"title":"My Projects","noProjects":"No projects yet","createFirst":"Create your first project to get started"},"project":{"create":"New Project","createDescription":"Build with AI","createTitle":"Create New Project","name":"Project Name","namePlaceholder":"my-awesome-app","type":"Project Type","typeWeb":"Web App","typeNative":"Native App","backendStack":"Backend Stack","backendNone":"Frontend Only","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"Delete Project","deleteConfirm":"Are you sure you want to delete this project?","updated":"Updated"},"chat":{"title":"Chat","placeholder":"Describe what you want to build...","askPlaceholder":"Ask a question about your project...","queuePlaceholder":"Queue another message...","send":"Send","thinking":"AI is thinking...","uploading":"Uploading files...","queueCount":"{count} message(s) queued","toolRunning":"Running","toolCompleted":"Completed","newConversation":"New Chat","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"Preview","start":"Start Preview","stop":"Stop Preview","starting":"Starting...","notReady":"Project not ready for preview","waitForAI":"Wait for AI to create the project files","openInNewTab":"Open in New Tab"},"fileExplorer":{"title":"Files","empty":"No files yet","loading":"Loading files...","error":"Failed to load files","open":"Open File Explorer","close":"Close File Explorer"},"language":{"select":"Language","en":"English","ko":"한국어"},"settings":{"title":"Settings","projectsPath":{"title":"Projects Folder","description":"Location where your projects are stored","saved":"Settings saved successfully","note":"New projects will be created in this folder. Existing projects are not affected."}}}'),ko:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"로딩 중...","error":"오류","save":"저장","cancel":"취소","delete":"삭제","create":"생성","close":"닫기","refresh":"새로고침","settings":"설정"},"header":{"home":"홈","settings":"설정"},"home":{"title":"내 프로젝트","noProjects":"프로젝트가 없습니다","createFirst":"첫 번째 프로젝트를 만들어 시작하세요"},"project":{"create":"새 프로젝트","createDescription":"AI와 함께 만들기","createTitle":"새 프로젝트 생성","name":"프로젝트 이름","namePlaceholder":"my-awesome-app","type":"프로젝트 유형","typeWeb":"웹 앱","typeNative":"네이티브 앱","backendStack":"백엔드 스택","backendNone":"프론트엔드 전용","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"프로젝트 삭제","deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","updated":"업데이트"},"chat":{"title":"채팅","placeholder":"만들고 싶은 것을 설명하세요...","askPlaceholder":"프로젝트에 대해 질문하세요...","queuePlaceholder":"다음 메시지를 입력하세요...","send":"전송","thinking":"AI가 생각 중...","uploading":"파일 업로드 중...","queueCount":"{count}개의 메시지가 대기 중","toolRunning":"실행 중","toolCompleted":"완료","newConversation":"새 대화","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"미리보기","start":"미리보기 시작","stop":"미리보기 중지","starting":"시작 중...","notReady":"프로젝트가 미리보기 준비가 되지 않았습니다","waitForAI":"AI가 프로젝트 파일을 생성할 때까지 기다려주세요","openInNewTab":"새 탭에서 열기"},"fileExplorer":{"title":"파일","empty":"파일이 없습니다","loading":"파일 로딩 중...","error":"파일 로드 실패","open":"파일 탐색기 열기","close":"파일 탐색기 닫기"},"language":{"select":"언어","en":"English","ko":"한국어"},"settings":{"title":"설정","projectsPath":{"title":"프로젝트 폴더","description":"프로젝트가 저장되는 위치","saved":"설정이 저장되었습니다","note":"새 프로젝트는 이 폴더에 생성됩니다. 기존 프로젝트에는 영향을 주지 않습니다."}}}')},l=(0,r.v)()((0,a.Zr)(e=>({locale:"ko",setLocale:t=>e({locale:t})}),{name:"claudeship-locale"}));function i(){let e=l(e=>e.locale);return{t:(t,s)=>(function(e,t,s){let r=t||l.getState().locale,a=e.split("."),i=n[r];for(let t of a)if(i&&"object"==typeof i&&t in i)i=i[t];else{for(let t of(i=n.en,a))if(!i||"object"!=typeof i||!(t in i))return e;else i=i[t];break}let o="string"==typeof i?i:e;if(s)for(let[e,t]of Object.entries(s))o=o.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(t));return o})(t,e,s),locale:e,setLocale:l(e=>e.setLocale)}}}},e=>{e.O(0,[992,595,59,498,358],()=>e(e.s=5006)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78],{660:(e,t,s)=>{"use strict";s.d(t,{F:()=>n});let r=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api";async function a(e,t){let s="".concat(r).concat(e),a=await fetch(s,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({message:"Request failed"}))).message||"HTTP error! status: ".concat(a.status));if(204!==a.status)return a.json()}let n={get:e=>a(e),post:(e,t)=>a(e,{method:"POST",body:t?JSON.stringify(t):void 0}),put:(e,t)=>a(e,{method:"PUT",body:t?JSON.stringify(t):void 0}),delete:e=>a(e,{method:"DELETE"}),uploadFiles:async(e,t)=>{let s=new FormData;t.forEach(e=>s.append("files",e));let a="".concat(r,"/projects/").concat(e,"/files/upload"),n=await fetch(a,{method:"POST",body:s});if(!n.ok)throw Error((await n.json().catch(()=>({message:"Upload failed"}))).message||"HTTP error! status: ".concat(n.status));return n.json()}}},4264:(e,t,s)=>{"use strict";s.d(t,{I:()=>n});var r=s(4876),a=s(660);let n=(0,r.v)((e,t)=>({projects:[],currentProject:null,isLoading:!1,error:null,fetchProjects:async()=>{e({isLoading:!0,error:null});try{let t=await a.F.get("/projects");e({projects:t,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch projects",isLoading:!1})}},createProject:async t=>{e({isLoading:!0,error:null});try{let s=await a.F.post("/projects",t);return e(e=>({projects:[{id:s.id,name:s.name,projectType:s.projectType,backendFramework:s.backendFramework,updatedAt:s.updatedAt},...e.projects],isLoading:!1})),s}catch(t){throw e({error:t instanceof Error?t.message:"Failed to create project",isLoading:!1}),t}},deleteProject:async t=>{e({isLoading:!0,error:null});try{await a.F.delete("/projects/".concat(t)),e(e=>({projects:e.projects.filter(e=>e.id!==t),isLoading:!1}))}catch(t){throw e({error:t instanceof Error?t.message:"Failed to delete project",isLoading:!1}),t}},fetchProject:async t=>{e({isLoading:!0,error:null});try{let s=await a.F.get("/projects/".concat(t));e({currentProject:s,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch project",isLoading:!1})}},setCurrentProject:t=>e({currentProject:t}),clearError:()=>e({error:null})}))},4859:(e,t,s)=>{"use strict";s.d(t,{V_:()=>a,gM:()=>r,Xh:()=>n});var r=function(e){return e.WEB="WEB",e.NATIVE="NATIVE",e}({}),a=function(e){return e.NONE="NONE",e.EXPRESS="EXPRESS",e.FASTAPI="FASTAPI",e}({}),n=function(e){return e.USER="USER",e.ASSISTANT="ASSISTANT",e.SYSTEM="SYSTEM",e}({})},5006:(e,t,s)=>{Promise.resolve().then(s.bind(s,7275))},5338:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var r=s(8481),a=s(8526),n=s(9049);let l=a.forwardRef((e,t)=>{let{className:s,type:a,...l}=e;return(0,r.jsx)("input",{type:a,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...l})});l.displayName="Input"},5594:(e,t,s)=>{"use strict";s.d(t,{$:()=>o});var r=s(8481),a=s(8526),n=s(4176),l=s(9049);let i=(0,n.F)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=a.forwardRef((e,t)=>{let{className:s,variant:a,size:n,...o}=e;return(0,r.jsx)("button",{className:(0,l.cn)(i({variant:a,size:n,className:s})),ref:t,...o})});o.displayName="Button"},7176:(e,t,s)=>{"use strict";s.d(t,{Y:()=>m});var r=s(8481),a=s(4816),n=s.n(a),l=s(9432),i=s(9150),o=s(7746),c=s(5594),d=s(9426);function u(){let{locale:e,setLocale:t,t:s}=(0,d.B)();return(0,r.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>{t("en"===e?"ko":"en")},className:"h-9 w-9 text-xs font-medium",title:s("language.select"),children:"en"===e?"EN":"KO"})}function m(e){let{title:t,showBack:s,backHref:a="/"}=e,{t:m}=(0,d.B)(),h=t||m("common.appName");return(0,r.jsx)("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,r.jsxs)("div",{className:"flex h-14 w-full items-center justify-between px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,r.jsx)(n(),{href:a,children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",children:(0,r.jsx)(i.A,{className:"h-5 w-5"})})}):(0,r.jsx)(l.default,{src:"/logo.svg",alt:"ClaudeShip",width:36,height:36,className:"rounded-lg"}),(0,r.jsx)("h1",{className:"text-lg font-semibold",children:h})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(u,{}),(0,r.jsx)(n(),{href:"/settings",children:(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",title:m("header.settings"),children:(0,r.jsx)(o.A,{className:"h-5 w-5"})})})]})]})})}},7275:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eI});var r=s(8481),a=s(8526),n=s(3973),l=s(7176),i=s(9049),o=s(5119),c=s(8630),d=s(4415),u=s(2839),m=s(4779),h=s(6224),p=s(6230),x=s(7060),g=s(9358),f=s(1627),j=s(4739),b=s(8756);function N(e){let{children:t,className:s}=e,a=(null==s?void 0:s.replace(/language-/,""))||"text";return(0,r.jsx)(b.f4,{theme:b.Zj.vsDark,code:t.trim(),language:a,children:e=>{let{className:t,style:s,tokens:a,getLineProps:n,getTokenProps:l}=e;return(0,r.jsx)("pre",{className:(0,i.cn)("rounded-lg p-4 overflow-x-auto text-sm my-3",t),style:s,children:(0,r.jsx)("code",{children:a.map((e,t)=>(0,r.jsxs)("div",{...n({line:e}),children:[(0,r.jsx)("span",{className:"inline-block w-8 text-right mr-4 text-gray-500 select-none text-xs",children:t+1}),e.map((e,t)=>(0,r.jsx)("span",{...l({token:e})},t))]},t))})})}})}function v(e){let{content:t,className:s}=e;return(0,r.jsx)("div",{className:(0,i.cn)("markdown-body",s),children:(0,r.jsx)(f.oz,{remarkPlugins:[j.A],components:{h1:e=>{let{children:t}=e;return(0,r.jsx)("h1",{className:"text-2xl font-bold mt-6 mb-4 pb-2 border-b border-border first:mt-0",children:t})},h2:e=>{let{children:t}=e;return(0,r.jsx)("h2",{className:"text-xl font-semibold mt-5 mb-3 pb-1.5 border-b border-border/50",children:t})},h3:e=>{let{children:t}=e;return(0,r.jsx)("h3",{className:"text-lg font-semibold mt-4 mb-2",children:t})},h4:e=>{let{children:t}=e;return(0,r.jsx)("h4",{className:"text-base font-semibold mt-3 mb-2",children:t})},p:e=>{let{children:t}=e;return(0,r.jsx)("p",{className:"my-2 leading-7",children:t})},ul:e=>{let{children:t}=e;return(0,r.jsx)("ul",{className:"my-3 ml-6 list-disc space-y-1.5",children:t})},ol:e=>{let{children:t}=e;return(0,r.jsx)("ol",{className:"my-3 ml-6 list-decimal space-y-1.5",children:t})},li:e=>{let{children:t}=e;return(0,r.jsx)("li",{className:"leading-7",children:t})},table:e=>{let{children:t}=e;return(0,r.jsx)("div",{className:"my-4 overflow-x-auto rounded-lg border border-border",children:(0,r.jsx)("table",{className:"w-full border-collapse text-sm",children:t})})},thead:e=>{let{children:t}=e;return(0,r.jsx)("thead",{className:"bg-muted/50",children:t})},tbody:e=>{let{children:t}=e;return(0,r.jsx)("tbody",{className:"divide-y divide-border",children:t})},tr:e=>{let{children:t}=e;return(0,r.jsx)("tr",{className:"border-b border-border last:border-0",children:t})},th:e=>{let{children:t}=e;return(0,r.jsx)("th",{className:"px-4 py-2.5 text-left font-semibold text-foreground",children:t})},td:e=>{let{children:t}=e;return(0,r.jsx)("td",{className:"px-4 py-2.5 text-muted-foreground",children:t})},pre:e=>{let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})},code:e=>{let{className:t,children:s,...a}=e,n=null==t?void 0:t.includes("language-"),l=String(s).replace(/\n$/,"");return n?(0,r.jsx)(N,{className:t,children:l}):(0,r.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono text-primary",...a,children:s})},blockquote:e=>{let{children:t}=e;return(0,r.jsx)("blockquote",{className:"my-4 pl-4 border-l-4 border-primary/30 italic text-muted-foreground",children:t})},hr:()=>(0,r.jsx)("hr",{className:"my-6 border-border"}),a:e=>{let{href:t,children:s}=e;return(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:s})},strong:e=>{let{children:t}=e;return(0,r.jsx)("strong",{className:"font-semibold text-foreground",children:t})},em:e=>{let{children:t}=e;return(0,r.jsx)("em",{className:"italic",children:t})},img:e=>{let{src:t,alt:s}=e;return(0,r.jsx)("img",{src:t,alt:s,className:"my-4 max-w-full rounded-lg border border-border"})}},children:t})})}let w={Read:(0,r.jsx)(o.A,{className:"h-3 w-3"}),Glob:(0,r.jsx)(c.A,{className:"h-3 w-3"}),Grep:(0,r.jsx)(d.A,{className:"h-3 w-3"}),Bash:(0,r.jsx)(u.A,{className:"h-3 w-3"}),Edit:(0,r.jsx)(m.A,{className:"h-3 w-3"}),Write:(0,r.jsx)(m.A,{className:"h-3 w-3"}),WebFetch:(0,r.jsx)(h.A,{className:"h-3 w-3"}),WebSearch:(0,r.jsx)(h.A,{className:"h-3 w-3"}),TodoWrite:(0,r.jsx)(p.A,{className:"h-3 w-3"}),Task:(0,r.jsx)(x.A,{className:"h-3 w-3"})},y={Read:"파일 읽기",Glob:"파일 검색",Grep:"내용 검색",Bash:"명령어 실행",Edit:"파일 수정",Write:"파일 생성",WebFetch:"웹 페이지",WebSearch:"웹 검색",Task:"에이전트",TodoWrite:"작업 목록"};function k(e){let{message:t}=e,s="USER"===t.role,a=[];if(!s&&t.metadata)try{a=("string"==typeof t.metadata?JSON.parse(t.metadata):t.metadata).toolActivities||[]}catch(e){}return(0,r.jsxs)("div",{className:(0,i.cn)("flex gap-3 p-4 rounded-lg",s?"bg-muted/50":"bg-background"),children:[(0,r.jsx)("div",{className:(0,i.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-medium",s?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground"),children:s?"U":"AI"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2 overflow-hidden",children:[a.length>0&&(0,r.jsxs)("div",{className:"flex flex-wrap gap-1 mb-2",children:[a.slice(0,10).map((e,t)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted text-xs text-muted-foreground",children:[(0,r.jsx)(g.A,{className:"h-3 w-3 text-green-600"}),w[e.name]||(0,r.jsx)(u.A,{className:"h-3 w-3"}),y[e.name]||e.name]},t)),a.length>10&&(0,r.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-xs text-muted-foreground",children:["+",a.length-10,"개"]})]}),(0,r.jsx)("div",{className:"max-w-none",children:s?(0,r.jsx)("div",{className:"whitespace-pre-wrap break-words leading-7",children:t.content}):(0,r.jsx)(v,{content:t.content})})]})]})}var A=s(4876),S=s(660),F=s(4859),E=s(5603);let P=(0,A.v)((e,t)=>({messages:[],isStreaming:!1,streamingBlocks:[],error:null,messageQueue:[],isProcessingQueue:!1,mode:"build",pendingQuestion:null,attachedFiles:[],isUploading:!1,setMode:t=>e({mode:t}),addFiles:t=>{let s=t.map(e=>({id:"file-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),file:e,preview:e.type.startsWith("image/")?URL.createObjectURL(e):void 0,status:"pending"}));e(e=>({attachedFiles:[...e.attachedFiles,...s]}))},removeFile:t=>{e(e=>{let s=e.attachedFiles.find(e=>e.id===t);return(null==s?void 0:s.preview)&&URL.revokeObjectURL(s.preview),{attachedFiles:e.attachedFiles.filter(e=>e.id!==t)}})},clearFiles:()=>{t().attachedFiles.forEach(e=>{e.preview&&URL.revokeObjectURL(e.preview)}),e({attachedFiles:[]})},uploadFiles:async s=>{let r=t().attachedFiles.filter(e=>"pending"===e.status);if(0===r.length)return t().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath);e({isUploading:!0});try{e(e=>({attachedFiles:e.attachedFiles.map(e=>"pending"===e.status?{...e,status:"uploading"}:e)}));let a=await S.F.uploadFiles(s,r.map(e=>e.file)),n=[];return e(e=>({attachedFiles:e.attachedFiles.map(e=>{if("uploading"===e.status){let t=a.files.find(t=>t.originalName===e.file.name);if(t)return n.push(t.path),{...e,status:"uploaded",uploadedPath:t.path}}return e})})),[...t().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath)]}catch(t){return e(e=>({attachedFiles:e.attachedFiles.map(e=>"uploading"===e.status?{...e,status:"error",error:t.message}:e),error:t instanceof Error?t.message:"Failed to upload files"})),[]}finally{e({isUploading:!1})}},fetchMessages:async t=>{try{let s=await S.F.get("/projects/".concat(t,"/messages"));e({messages:s,error:null})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch messages"})}},fetchActiveSession:async s=>{try{let a=await S.F.get("/projects/".concat(s,"/chat/status")),n=t();if(a.isStreaming){if(!n.isStreaming){var r;e({isStreaming:!0,streamingBlocks:[]});let a=await fetch("".concat(E.env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api","/projects/").concat(s,"/chat/subscribe"));if(!a.ok)throw Error("Failed to subscribe to session");let n=null==(r=a.body)?void 0:r.getReader();if(!n)throw Error("No response body");let l=new TextDecoder,i="";(async()=>{try{for(;;){let{done:t,value:s}=await n.read();if(t)break;let r=(i+=l.decode(s,{stream:!0})).split("\n");for(let t of(i=r.pop()||"",r))if(t.startsWith("data: "))try{let s=JSON.parse(t.slice(6));if(console.log("[SSE Subscribe Event]",s.type,s),"no_active_session"===s.type)break;if("text"===s.type&&s.content){let t={id:"text-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"text",content:s.content};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else if("tool_use"===s.type&&s.tool){let t={id:"tool-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"tool_use",tool:{name:s.tool.name,input:s.tool.input},status:"running"};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else"tool_result"===s.type?e(e=>{let t=[...e.streamingBlocks];for(let e=t.length-1;e>=0;e--)if("tool_use"===t[e].type&&"running"===t[e].status){t[e]={...t[e],status:"completed",result:s.content};break}return{streamingBlocks:t}}):"error"===s.type&&e({error:s.error})}catch(e){}}}finally{await t().fetchMessages(s),e({isStreaming:!1})}})()}}else n.isStreaming&&(await t().fetchMessages(s),e({isStreaming:!1,streamingBlocks:[]}))}catch(e){console.error("Failed to fetch active session:",e)}},queueMessage:(t,s)=>{let r={id:"queue-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),content:s,status:"queued"},a={id:"temp-".concat(Date.now()),projectId:t,role:F.Xh.USER,content:s,createdAt:new Date};e(e=>({messageQueue:[...e.messageQueue,r],messages:[...e.messages,a]}))},processQueue:async s=>{let r=t();if(!r.isProcessingQueue&&0!==r.messageQueue.length){for(e({isProcessingQueue:!0});t().messageQueue.length>0;){let r=t().messageQueue[0];e(e=>({messageQueue:e.messageQueue.map((e,t)=>0===t?{...e,status:"processing"}:e)})),await t().sendMessage(s,r.content,!0),e(e=>({messageQueue:e.messageQueue.slice(1)}))}e({isProcessingQueue:!1})}},sendMessage:async function(s,r){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t().isStreaming&&!a)return void t().queueMessage(s,r);if(!a){let t={id:"temp-".concat(Date.now()),projectId:s,role:F.Xh.USER,content:r,createdAt:new Date};e(e=>({messages:[...e.messages,t]}))}e({isStreaming:!0,streamingBlocks:[],error:null});try{var n;let a=t().mode,l=t().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath),i=await fetch("".concat(E.env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api","/projects/").concat(s,"/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r,mode:a,attachments:l.length>0?l:void 0})});if(l.length>0&&t().clearFiles(),!i.ok)throw Error("Failed to send message");let o=null==(n=i.body)?void 0:n.getReader();if(!o)throw Error("No response body");let c=new TextDecoder,d="";for(;;){let{done:t,value:s}=await o.read();if(t)break;let r=(d+=c.decode(s,{stream:!0})).split("\n");for(let t of(d=r.pop()||"",r))if(t.startsWith("data: "))try{let s=JSON.parse(t.slice(6));if(console.log("[SSE Event]",s.type,s),"text"===s.type&&s.content){let t={id:"text-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"text",content:s.content};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else if("tool_use"===s.type&&s.tool){let t={id:"tool-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"tool_use",tool:{name:s.tool.name,input:s.tool.input},status:"running"};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else if("tool_result"===s.type)e(e=>{let t=[...e.streamingBlocks];for(let e=t.length-1;e>=0;e--)if("tool_use"===t[e].type&&"running"===t[e].status){t[e]={...t[e],status:"completed",result:s.content};break}return{streamingBlocks:t}});else if("ask_user_question"===s.type&&s.askUserQuestion){let t={id:"question-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"ask_user_question",askUserQuestion:s.askUserQuestion,status:"waiting"};e(e=>({streamingBlocks:[...e.streamingBlocks,t],pendingQuestion:s.askUserQuestion}))}else"error"===s.type&&e({error:s.error})}catch(e){}}await t().fetchMessages(s)}catch(t){e({error:t instanceof Error?t.message:"Failed to send message"})}finally{e({isStreaming:!1}),t().messageQueue.length>0&&setTimeout(()=>t().processQueue(s),100)}},addMessage:t=>{e(e=>({messages:[...e.messages,t]}))},clearMessages:()=>{e({messages:[],streamingBlocks:[],messageQueue:[]})},clearError:()=>{e({error:null})},respondToQuestion:async(s,r)=>{if(!t().pendingQuestion)return;let a=Object.entries(r).map(e=>{let[t,s]=e;return"".concat(t,": ").concat(s)}).join("\n");e(e=>{let t=[...e.streamingBlocks];for(let e=t.length-1;e>=0;e--)if("ask_user_question"===t[e].type&&"waiting"===t[e].status){t[e]={...t[e],status:"completed"};break}return{streamingBlocks:t,pendingQuestion:null}}),await t().sendMessage(s,a)}}));var C=s(8031),R=s(6569),B=s(6776),T=s(5594),L=s(4660),I=s(3527);let _=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(L.bL,{className:(0,i.cn)("grid gap-2",s),...a,ref:t})});_.displayName=L.bL.displayName;let q=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(L.q7,{ref:t,className:(0,i.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:(0,r.jsx)(L.C1,{className:"flex items-center justify-center",children:(0,r.jsx)(I.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});q.displayName=L.q7.displayName;var U=s(8367);let D=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(U.bL,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...a,children:(0,r.jsx)(U.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(R.A,{className:"h-4 w-4"})})})});D.displayName=U.bL.displayName;var Q=s(2731);let z=(0,s(4176).F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),O=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(Q.b,{ref:t,className:(0,i.cn)(z(),s),...a})});O.displayName=Q.b.displayName;var M=s(5338);function W(e){let{data:t,isWaiting:s,onSubmit:n}=e,[l,i]=(0,a.useState)({}),[o,c]=(0,a.useState)({}),d=t.questions.every((e,t)=>l[t]||o[t]);return s?(0,r.jsxs)("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-primary",children:[(0,r.jsx)(B.A,{className:"h-5 w-5"}),(0,r.jsx)("span",{className:"font-medium",children:"AI의 질문"})]}),t.questions.map((e,t)=>(0,r.jsxs)("div",{className:"space-y-3",children:[e.header&&(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-medium bg-primary/10 text-primary rounded",children:e.header}),(0,r.jsx)("p",{className:"text-sm font-medium",children:e.question}),e.multiSelect?(0,r.jsx)("div",{className:"space-y-2",children:e.options.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,r.jsx)(D,{id:"q".concat(t,"-o").concat(s),checked:(l[t]||[]).includes(e.label),onCheckedChange:s=>{var r,a;return r=e.label,a=!0===s,void i(e=>{let s=e[t]||[];return a?{...e,[t]:[...s,r]}:{...e,[t]:s.filter(e=>e!==r)}})}}),(0,r.jsxs)("div",{className:"grid gap-0.5 leading-none",children:[(0,r.jsx)(O,{htmlFor:"q".concat(t,"-o").concat(s),className:"text-sm cursor-pointer",children:e.label}),e.description&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})]},s))}):(0,r.jsx)(_,{value:l[t],onValueChange:e=>{i(s=>({...s,[t]:e}))},className:"space-y-2",children:e.options.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,r.jsx)(q,{value:e.label,id:"q".concat(t,"-o").concat(s)}),(0,r.jsxs)("div",{className:"grid gap-0.5 leading-none",children:[(0,r.jsx)(O,{htmlFor:"q".concat(t,"-o").concat(s),className:"text-sm cursor-pointer",children:e.label}),e.description&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})]},s))}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"또는 직접 입력:"}),(0,r.jsx)(M.p,{placeholder:"다른 답변...",value:o[t]||"",onChange:e=>{var s;return s=e.target.value,void c(e=>({...e,[t]:s}))},className:"h-8 text-sm flex-1"})]})]},t)),(0,r.jsx)(T.$,{onClick:()=>{let e={};t.questions.forEach((t,s)=>{let r=l[s],a=o[s];a?e[t.question]=a:Array.isArray(r)?e[t.question]=r.join(", "):r&&(e[t.question]=r)}),n(e)},disabled:!d,className:"w-full",size:"sm",children:"답변 제출"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md text-sm bg-muted border border-border",children:[(0,r.jsx)(R.A,{className:"h-4 w-4 text-green-600"}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[(0,r.jsx)(B.A,{className:"h-4 w-4 inline mr-1"}),"질문 응답 완료"]})]})}let $={Read:(0,r.jsx)(o.A,{className:"h-4 w-4"}),Glob:(0,r.jsx)(c.A,{className:"h-4 w-4"}),Grep:(0,r.jsx)(d.A,{className:"h-4 w-4"}),Bash:(0,r.jsx)(u.A,{className:"h-4 w-4"}),Edit:(0,r.jsx)(m.A,{className:"h-4 w-4"}),Write:(0,r.jsx)(m.A,{className:"h-4 w-4"}),WebFetch:(0,r.jsx)(h.A,{className:"h-4 w-4"}),WebSearch:(0,r.jsx)(h.A,{className:"h-4 w-4"}),TodoWrite:(0,r.jsx)(p.A,{className:"h-4 w-4"}),Task:(0,r.jsx)(x.A,{className:"h-4 w-4"})};function J(e){var t,s;let r=null==(t=e.tool)?void 0:t.input,a=null==(s=e.tool)?void 0:s.name;if(!r||!a)return"";if("Read"===a&&r.file_path)return r.file_path.split("/").pop()||"";if("Glob"===a&&r.pattern||"Grep"===a&&r.pattern)return r.pattern;if("Bash"===a&&r.command){let e=r.command;return e.length>50?e.substring(0,50)+"...":e}return("Edit"===a||"Write"===a)&&r.file_path&&r.file_path.split("/").pop()||""}function G(e){let{content:t}=e;return(0,r.jsx)(v,{content:t})}function X(e){var t;let{block:s}=e,a="running"===s.status,n=(null==(t=s.tool)?void 0:t.name)||"Unknown";return(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md text-sm ".concat(a?"bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800":"bg-muted border border-border"),children:[a?(0,r.jsx)(C.A,{className:"h-4 w-4 animate-spin text-blue-600 dark:text-blue-400"}):(0,r.jsx)(g.A,{className:"h-4 w-4 text-green-600"}),(0,r.jsx)("span",{className:a?"text-blue-700 dark:text-blue-300":"text-muted-foreground",children:$[n]||(0,r.jsx)(u.A,{className:"h-4 w-4"})}),(0,r.jsx)("span",{className:"font-medium ".concat(a?"text-blue-800 dark:text-blue-200":""),children:{Read:"파일 읽기",Glob:"파일 검색",Grep:"내용 검색",Bash:"명령어 실행",Edit:"파일 수정",Write:"파일 생성",WebFetch:"웹 페이지 가져오기",WebSearch:"웹 검색",Task:"에이전트 실행",TodoWrite:"작업 목록 업데이트"}[n]||n}),J(s)&&(0,r.jsx)("span",{className:"truncate ".concat(a?"text-blue-600 dark:text-blue-400":"text-muted-foreground"),children:J(s)})]})}function H(e){let{blocks:t,isStreaming:s=!0,projectId:a}=e,n=t.length>0,{respondToQuestion:l,pendingQuestion:i}=P(),o=e=>{l(a,e)};return(0,r.jsxs)("div",{className:"flex gap-3 p-4 rounded-lg bg-background",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-secondary text-secondary-foreground text-sm font-medium",children:"AI"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2 overflow-hidden",children:[t.map(e=>"text"===e.type?(0,r.jsx)(G,{content:e.content||""},e.id):"tool_use"===e.type?(0,r.jsx)(X,{block:e},e.id):"ask_user_question"===e.type&&e.askUserQuestion?(0,r.jsx)(W,{data:e.askUserQuestion,isWaiting:"waiting"===e.status,onSubmit:o},e.id):null),s&&!n&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,r.jsx)(C.A,{className:"h-4 w-4 animate-spin"}),(0,r.jsx)("span",{className:"text-sm",children:"AI가 생각 중..."})]}),s&&n&&(0,r.jsx)("span",{className:"inline-block w-2 h-4 bg-primary animate-pulse"})]})]})}function V(e){let{messages:t,streamingBlocks:s=[],isStreaming:n,projectId:l}=e,i=(0,a.useRef)(null);return(0,a.useEffect)(()=>{var e;null==(e=i.current)||e.scrollIntoView({behavior:"smooth"})},[t,s]),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[0===t.length&&!n&&(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-lg font-medium",children:"안녕하세요!"}),(0,r.jsx)("p",{className:"text-sm",children:"무엇을 만들어 드릴까요?"})]})}),t.map(e=>(0,r.jsx)(k,{message:e},e.id)),s.length>0&&(0,r.jsx)(H,{blocks:s,isStreaming:n,projectId:l}),(0,r.jsx)("div",{ref:i})]})}var K=s(7793),Y=s(3113),Z=s(219),ee=s(9426),et=s(2881);function es(){let{t:e}=(0,ee.B)(),{mode:t,setMode:s,isStreaming:a}=P();return(0,r.jsxs)("div",{className:"flex gap-1 p-1 bg-muted rounded-lg w-fit",children:[(0,r.jsxs)("button",{onClick:()=>s("ask"),disabled:a,className:(0,i.cn)("flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-colors","ask"===t?"bg-blue-500 text-white":"text-muted-foreground hover:text-foreground hover:bg-muted-foreground/10",a&&"opacity-50 cursor-not-allowed"),children:[(0,r.jsx)(B.A,{className:"h-4 w-4"}),e("chat.modeAsk")]}),(0,r.jsxs)("button",{onClick:()=>s("build"),disabled:a,className:(0,i.cn)("flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-colors","build"===t?"bg-green-500 text-white":"text-muted-foreground hover:text-foreground hover:bg-muted-foreground/10",a&&"opacity-50 cursor-not-allowed"),children:[(0,r.jsx)(et.A,{className:"h-4 w-4"}),e("chat.modeBuild")]})]})}var er=s(6241);function ea(e){let{files:t,onRemove:s}=e;return 0===t.length?null:(0,r.jsx)("div",{className:"flex flex-wrap gap-2 px-4 pb-2",children:t.map(e=>{var t;return(0,r.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-lg border bg-muted/50 p-2",children:[e.preview?(0,r.jsx)("img",{src:e.preview,alt:e.file.name,className:"h-12 w-12 rounded object-cover"}):(0,r.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded bg-muted",children:(0,r.jsx)(o.A,{className:"h-6 w-6 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"max-w-[120px] truncate text-xs font-medium",children:e.file.name}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:(t=e.file.size)<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")})]}),"uploading"===e.status&&(0,r.jsx)(C.A,{className:"h-4 w-4 animate-spin text-muted-foreground"}),"error"===e.status&&(0,r.jsx)("span",{className:"text-xs text-destructive",children:e.error}),(0,r.jsx)("button",{onClick:()=>s(e.id),className:"absolute -right-2 -top-2 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-destructive-foreground opacity-0 transition-opacity group-hover:opacity-100",children:(0,r.jsx)(er.A,{className:"h-3 w-3"})})]},e.id)})})}let en=["image/png","image/jpeg","image/gif","image/webp","application/pdf","text/plain","text/markdown","text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function el(e){let{onSend:t,projectId:s,disabled:n,isStreaming:l,queueCount:i=0}=e,{t:o}=(0,ee.B)(),{mode:c,attachedFiles:d,addFiles:u,removeFile:m,uploadFiles:h,isUploading:p}=P(),[x,g]=(0,a.useState)(""),[f,j]=(0,a.useState)(!1),b=(0,a.useRef)(null),N=(0,a.useRef)(null),v=e=>{let t=e.filter(e=>en.includes(e.type)?!(e.size>0x6400000)||(console.warn("File too large: ".concat(e.name)),!1):(console.warn("File type not allowed: ".concat(e.type)),!1)),s=5-d.length;s<=0||u(t.slice(0,s))},w=async()=>{if(!x.trim()&&0===d.length||n||p)return;let e=[];d.length>0&&(e=await h(s)),t(x.trim(),e.length>0?e:void 0),g(""),b.current&&(b.current.style.height="auto")};return(0,r.jsxs)("div",{className:"border-t bg-background ".concat(f?"ring-2 ring-ring ring-offset-2":""),onDragOver:e=>{e.preventDefault(),j(!0)},onDragLeave:e=>{e.preventDefault(),j(!1)},onDrop:e=>{e.preventDefault(),j(!1),e.dataTransfer.files&&v(Array.from(e.dataTransfer.files))},children:[(0,r.jsx)("div",{className:"p-4 pb-2",children:(0,r.jsx)(es,{})}),(0,r.jsx)(ea,{files:d,onRemove:m}),(0,r.jsxs)("div",{className:"flex items-end gap-2 px-4 pb-4",children:[(0,r.jsx)("input",{ref:N,type:"file",multiple:!0,accept:en.join(","),onChange:e=>{e.target.files&&(v(Array.from(e.target.files)),e.target.value="")},className:"hidden"}),(0,r.jsx)(T.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>{var e;return null==(e=N.current)?void 0:e.click()},disabled:n||d.length>=5,className:"h-10 w-10 shrink-0",children:(0,r.jsx)(K.A,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:"relative flex-1",children:(0,r.jsx)("textarea",{ref:b,value:x,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w())},onInput:()=>{let e=b.current;e&&(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,200),"px"))},placeholder:o(l?"chat.queuePlaceholder":"ask"===c?"chat.askPlaceholder":"chat.placeholder"),disabled:n,rows:1,className:"w-full resize-none rounded-lg border border-input bg-background px-4 py-3 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})}),(0,r.jsx)(T.$,{onClick:w,disabled:!x.trim()&&0===d.length||n||p,size:"icon",className:"h-10 w-10 shrink-0",children:(0,r.jsx)(Y.A,{className:"h-4 w-4"})})]}),(l||p)&&(0,r.jsxs)("div",{className:"px-4 pb-4 flex items-center gap-2 text-xs text-muted-foreground",children:[p?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"}),o("chat.uploading")]}):(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-yellow-500"}),o("chat.thinking")]}),i>0&&(0,r.jsxs)("span",{className:"flex items-center gap-1 text-blue-500",children:[(0,r.jsx)(Z.A,{className:"h-3 w-3"}),o("chat.queueCount",{count:i})]})]})]})}var ei=s(4025);function eo(e){let{projectId:t}=e,{t:s}=(0,ee.B)(),[n,l]=(0,a.useState)(!1),{messages:i,isStreaming:o,streamingBlocks:c,messageQueue:d,fetchMessages:u,fetchActiveSession:m,sendMessage:h,clearMessages:p}=P();(0,a.useEffect)(()=>{p(),u(t),m(t)},[t,u,m,p]);let x=async()=>{if(!n&&!o){l(!0);try{await S.F.post("/projects/".concat(t,"/chat/reset"))}catch(e){console.error("Failed to reset session:",e)}finally{l(!1)}}};return(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsxs)("div",{className:"flex h-12 items-center justify-between border-b px-4",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:s("chat.title")}),(0,r.jsxs)(T.$,{variant:"ghost",size:"sm",onClick:x,disabled:n||o,title:s("chat.newConversation"),className:"gap-1.5",children:[(0,r.jsx)(ei.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:s("chat.newConversation")})]})]}),(0,r.jsx)(V,{messages:i,streamingBlocks:c,isStreaming:o,projectId:t}),(0,r.jsx)(el,{onSend:e=>{h(t,e)},projectId:t,isStreaming:o,queueCount:d.length})]})}var ec=s(3774),ed=s(3787),eu=s(4246),em=s(5471),eh=s(7604),ep=s(6021),ex=s(9085);let eg=(0,A.v)((e,t)=>({status:"stopped",url:null,error:null,isLoading:!1,projectReady:{ready:!1,isFullstack:!1,frontend:{hasPackageJson:!1,hasNodeModules:!1,hasDevScript:!1}},startPreview:async t=>{e({isLoading:!0,error:null,status:"starting"});try{let s=await S.F.post("/projects/".concat(t,"/preview/start"));e({status:s.status,url:s.url||null,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to start preview",status:"error",isLoading:!1})}},stopPreview:async t=>{e({isLoading:!0,error:null});try{await S.F.post("/projects/".concat(t,"/preview/stop")),e({status:"stopped",url:null,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to stop preview",isLoading:!1})}},restartPreview:async t=>{e({isLoading:!0,error:null,status:"starting"});try{let s=await S.F.post("/projects/".concat(t,"/preview/restart"));e({status:s.status,url:s.url||null,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to restart preview",status:"error",isLoading:!1})}},refreshPreview:()=>{let s=t().url;s&&e({url:"".concat(s.split("?")[0],"?t=").concat(Date.now())})},fetchStatus:async t=>{try{let s=await S.F.get("/projects/".concat(t,"/preview/status"));e({status:s.status,url:s.url||null})}catch(t){e({status:"stopped",url:null})}},checkProjectReady:async t=>{try{let s=await S.F.get("/projects/".concat(t,"/preview/ready"));e({projectReady:s})}catch(t){e({projectReady:{ready:!1,isFullstack:!1,frontend:{hasPackageJson:!1,hasNodeModules:!1,hasDevScript:!1}}})}},clearError:()=>e({error:null})})),ef=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000";function ej(e){let{projectId:t}=e,{t:s}=(0,ee.B)(),[n,l]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!0),[c,d]=(0,a.useState)(null),u=(0,a.useRef)(null),m=(0,a.useRef)(null),{status:h,url:p,error:x,isLoading:g,projectReady:f,startPreview:j,stopPreview:b,restartPreview:N,refreshPreview:v,fetchStatus:w,checkProjectReady:y,clearError:k}=eg(),A=(0,a.useRef)(!1),S=(0,a.useRef)(0);(0,a.useRef)(h).current=h;let F=(0,a.useCallback)(e=>{i&&"running"===h&&(d(e.split("/").pop()||e),setTimeout(()=>d(null),2e3),m.current&&(m.current.src=m.current.src))},[i,h]);(0,a.useEffect)(()=>{if(!n||"running"!==h){u.current&&(u.current.close(),u.current=null);return}let e=new EventSource("".concat(ef,"/projects/").concat(t,"/preview/watch"));return e.onmessage=e=>{try{let t=JSON.parse(e.data);"file-change"===t.type&&F(t.path)}catch(e){}},e.onerror=()=>{e.close(),u.current=null},u.current=e,()=>{e.close(),u.current=null}},[n,h,t,F]),(0,a.useEffect)(()=>{l(!0)},[]),(0,a.useEffect)(()=>{let e=()=>{let e="".concat(ef,"/projects/").concat(t,"/preview/stop");navigator.sendBeacon(e)};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[t]),(0,a.useEffect)(()=>{A.current=!1,S.current=0,k()},[t,k]),(0,a.useEffect)(()=>{if(!n)return;w(t),y(t);let e=setInterval(()=>{w(t),"running"!==h&&"starting"!==h&&y(t)},2e3);return()=>clearInterval(e)},[t,w,y,h,n]),(0,a.useEffect)(()=>{if(!n||g||"starting"===h)return;let e=A.current,s=f.ready;if(!e&&s&&(S.current=0),A.current=s,s&&"stopped"===h&&S.current<3&&(S.current++,j(t)),s&&"error"===h&&S.current<3){let e=setTimeout(()=>{f.ready&&S.current<3&&(S.current++,k(),j(t))},3e3);return()=>clearTimeout(e)}},[n,f.ready,h,g,t,j,k]);let E=()=>j(t);return(0,r.jsxs)("div",{className:"flex h-full flex-col border-l",children:[(0,r.jsxs)("div",{className:"flex h-12 items-center justify-between border-b px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(n?"running"===h?"bg-green-500":"starting"===h?"bg-yellow-500 animate-pulse":"error"===h?"bg-red-500":"bg-gray-400":"bg-gray-400")}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:s(n?"running"===h?"preview.title":"starting"===h?"preview.starting":"error"===h?"common.error":"preview.stop":"common.loading")})]}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:"running"===h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>o(!i),className:"h-8 w-8 p-0 ".concat(i?"text-green-500":"text-muted-foreground"),title:i?"Auto-refresh ON":"Auto-refresh OFF",children:(0,r.jsx)(ec.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>v(),disabled:g,className:"h-8 w-8 p-0",title:"Refresh",children:(0,r.jsx)(ed.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>N(t),disabled:g,className:"h-8 w-8 p-0",title:"Restart server",children:(0,r.jsx)(eu.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>{p&&window.open(p,"_blank")},className:"h-8 w-8 p-0",title:"Open in new tab",children:(0,r.jsx)(em.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:()=>b(t),disabled:g,className:"h-8 w-8 p-0",title:"Stop",children:(0,r.jsx)(eh.A,{className:"h-4 w-4"})})]}):(0,r.jsx)(T.$,{variant:"ghost",size:"sm",onClick:E,disabled:!n||g||"starting"===h||!f.ready,title:s(f.ready?"preview.start":"preview.notReady"),className:"h-8 w-8 p-0",children:(0,r.jsx)(ep.A,{className:"h-4 w-4"})})})]}),(0,r.jsx)("div",{className:"flex-1 bg-muted/30",children:n?"running"===h&&p?(0,r.jsxs)("div",{className:"relative h-full w-full",children:[(0,r.jsx)("iframe",{ref:m,src:p,className:"h-full w-full border-0"},p),c&&(0,r.jsxs)("div",{className:"absolute bottom-4 right-4 flex items-center gap-2 px-3 py-2 bg-green-500/90 text-white text-xs rounded-lg shadow-lg animate-pulse",children:[(0,r.jsx)(ec.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{children:c})]})]}):"starting"===h?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,r.jsx)(ed.A,{className:"mx-auto h-8 w-8 animate-spin mb-2"}),(0,r.jsx)("p",{children:s("preview.starting")})]})}):x?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-destructive",children:[(0,r.jsx)("p",{className:"font-medium",children:s("common.error")}),(0,r.jsx)("p",{className:"text-sm",children:x}),(0,r.jsx)(T.$,{variant:"outline",size:"sm",onClick:E,className:"mt-4",children:s("common.refresh")})]})}):f.ready?(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,r.jsx)(ep.A,{className:"mx-auto h-8 w-8 mb-2"}),(0,r.jsx)("p",{children:s("preview.start")})]})}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-muted-foreground max-w-sm",children:[(0,r.jsx)(ex.A,{className:"mx-auto h-8 w-8 mb-3 text-muted-foreground/50"}),(0,r.jsx)("p",{className:"font-medium mb-3",children:s("preview.notReady")}),(0,r.jsxs)("div",{className:"text-xs space-y-3",children:[(0,r.jsxs)("div",{className:"border rounded-lg p-2",children:[(0,r.jsx)("p",{className:"font-medium mb-1.5 text-foreground",children:f.isFullstack?"Frontend":"Project"}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.frontend.hasPackageJson?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,r.jsx)("span",{children:"package.json"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.frontend.hasDevScript?"bg-green-500":"bg-gray-300")}),(0,r.jsx)("span",{children:"dev script"})]})]})]}),f.isFullstack&&f.backend&&(0,r.jsxs)("div",{className:"border rounded-lg p-2",children:[(0,r.jsxs)("p",{className:"font-medium mb-1.5 text-foreground",children:["Backend ","FASTAPI"===f.backendFramework?"(Python)":"(Node.js)"]}),(0,r.jsx)("div",{className:"space-y-1",children:"FASTAPI"===f.backendFramework?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasRequirementsTxt?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,r.jsx)("span",{children:"requirements.txt"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasMainPy?"bg-green-500":"bg-gray-300")}),(0,r.jsx)("span",{children:"main.py"})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasPackageJson?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,r.jsx)("span",{children:"package.json"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(f.backend.hasDevScript?"bg-green-500":"bg-gray-300")}),(0,r.jsx)("span",{children:"dev script"})]})]})})]})]}),(0,r.jsx)("p",{className:"text-xs mt-4",children:s("preview.waitForAI")})]})}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(C.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})})})]})}var eb=s(794),eN=s(2475),ev=s(4373),ew=s(4309),ey=s(6925);let ek=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:3000";function eA(e){let{projectId:t,onFileSelect:s}=e,{t:n}=(0,ee.B)(),[l,i]=(0,a.useState)([]),[o,c]=(0,a.useState)(!0),[d,u]=(0,a.useState)(!1),m=(0,a.useCallback)(async()=>{try{c(!0),u(!1);let e=await fetch("".concat(ek,"/projects/").concat(t,"/files"));if(!e.ok)throw Error("Failed to load files");let s=await e.json();i(s)}catch(e){u(!0)}finally{c(!1)}},[t]);(0,a.useEffect)(()=>{m()},[m]);let h=async e=>{if(s)try{let r=await fetch("".concat(ek,"/projects/").concat(t,"/files/content?path=").concat(encodeURIComponent(e)));if(!r.ok)throw Error("Failed to load file");let a=await r.json();s(e,a.content)}catch(e){}};return o?(0,r.jsx)("div",{className:"p-4 text-sm text-muted-foreground",children:n("fileExplorer.loading")}):d?(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)("p",{className:"text-sm text-destructive mb-2",children:n("fileExplorer.error")}),(0,r.jsxs)(T.$,{variant:"outline",size:"sm",onClick:m,children:[(0,r.jsx)(ed.A,{className:"h-3 w-3 mr-1"}),n("common.refresh")]})]}):(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"flex h-12 items-center justify-between px-4 border-b",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:n("fileExplorer.title")}),(0,r.jsx)(T.$,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,title:n("common.refresh"),children:(0,r.jsx)(ed.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto p-2",children:0===l.length?(0,r.jsx)("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:n("fileExplorer.empty")}):(0,r.jsx)(eS,{nodes:l,onFileClick:h})})]})}function eS(e){let{nodes:t,onFileClick:s,level:a=0}=e;return(0,r.jsx)("ul",{className:"space-y-0.5",children:t.map(e=>(0,r.jsx)(eF,{node:e,onFileClick:s,level:a},e.path))})}function eF(e){let{node:t,onFileClick:s,level:n}=e,[l,o]=(0,a.useState)(n<1),c="directory"===t.type;return(0,r.jsxs)("li",{children:[(0,r.jsxs)("div",{className:(0,i.cn)("flex items-center gap-1 px-2 py-1 rounded-sm cursor-pointer","hover:bg-accent text-sm"),style:{paddingLeft:"".concat(12*n+8,"px")},onClick:()=>{c?o(!l):s(t.path)},children:[c&&(0,r.jsx)("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:l?(0,r.jsx)(ew.A,{className:"h-3 w-3"}):(0,r.jsx)(ey.A,{className:"h-3 w-3"})}),!c&&(0,r.jsx)("span",{className:"w-4 flex-shrink-0"}),(()=>{if(c)return l?(0,r.jsx)(eb.A,{className:"h-4 w-4 text-blue-400 flex-shrink-0"}):(0,r.jsx)(eN.A,{className:"h-4 w-4 text-blue-400 flex-shrink-0"});let e={ts:"text-blue-400",tsx:"text-blue-400",js:"text-yellow-400",jsx:"text-yellow-400",py:"text-green-400",json:"text-yellow-600",md:"text-gray-400",css:"text-purple-400",scss:"text-pink-400",html:"text-orange-400",prisma:"text-teal-400"}[t.extension||""]||"text-muted-foreground";return(0,r.jsx)(ev.A,{className:(0,i.cn)("h-4 w-4 flex-shrink-0",e)})})(),(0,r.jsx)("span",{className:"truncate",children:t.name})]}),c&&l&&t.children&&(0,r.jsx)(eS,{nodes:t.children,onFileClick:s,level:n+1})]})}var eE=s(262);let eP={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",json:"json",md:"markdown",css:"css",scss:"scss",html:"markup",prisma:"graphql",sql:"sql",sh:"bash",bash:"bash",yml:"yaml",yaml:"yaml",env:"bash",gitignore:"bash"};function eC(e){let{path:t,content:s,language:n,onClose:l}=e,{t:i}=(0,ee.B)(),[o,c]=(0,a.useState)(!1),d=t.split("/").pop()||t,u=eP[n]||"typescript",m=s.split("\n"),h=async()=>{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)};return(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"fixed inset-4 z-50 flex flex-col rounded-lg border bg-background shadow-lg md:inset-8 lg:inset-16",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-mono text-sm font-medium",children:d}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:t})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground mr-2",children:[m.length," lines"]}),(0,r.jsx)(T.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:h,title:o?"Copied!":"Copy",children:o?(0,r.jsx)(R.A,{className:"h-4 w-4 text-green-500"}):(0,r.jsx)(eE.A,{className:"h-4 w-4"})}),(0,r.jsx)(T.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:l,title:i("common.close"),children:(0,r.jsx)(er.A,{className:"h-4 w-4"})})]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto bg-[#1e1e1e]",children:(0,r.jsx)(b.f4,{theme:b.Zj.vsDark,code:s,language:u,children:e=>{let{className:t,style:s,tokens:a,getLineProps:n,getTokenProps:l}=e;return(0,r.jsx)("pre",{className:"text-sm leading-relaxed",style:{...s,margin:0,padding:"1rem",background:"#1e1e1e",minHeight:"100%"},children:(0,r.jsx)("code",{className:t,children:a.map((e,t)=>{let{key:s,...a}=n({line:e});return(0,r.jsxs)("div",{...a,className:"table-row hover:bg-white/5",children:[(0,r.jsx)("span",{className:"table-cell select-none pr-4 text-right text-gray-500 w-12",children:t+1}),(0,r.jsx)("span",{className:"table-cell",children:e.map((e,t)=>{let{key:s,...a}=l({token:e});return(0,r.jsx)("span",{...a},t)})})]},t)})})})}})})]})})}var eR=s(2858);function eB(e){let{projectId:t}=e,{t:s}=(0,ee.B)(),[n,l]=(0,a.useState)(!1),[i,o]=(0,a.useState)(null);return(0,r.jsxs)("div",{className:"flex h-[calc(100vh-3.5rem)]",children:[(0,r.jsx)(T.$,{variant:"outline",size:"sm",onClick:()=>l(!n),className:"absolute left-4 top-16 z-10 h-8 w-8 p-0",title:s(n?"fileExplorer.close":"fileExplorer.open"),children:n?(0,r.jsx)(er.A,{className:"h-4 w-4"}):(0,r.jsx)(eR.A,{className:"h-4 w-4"})}),n&&(0,r.jsx)("div",{className:"w-64 border-r bg-muted/30 flex-shrink-0",children:(0,r.jsx)(eA,{projectId:t,onFileSelect:(e,t)=>{let s=e.split(".").pop()||"";o({path:e,content:t,extension:s})}})}),(0,r.jsx)("div",{className:"border-r flex-shrink-0",style:{width:n?"calc(30% - 8rem)":"30%"},children:(0,r.jsx)(eo,{projectId:t})}),(0,r.jsx)("div",{className:"flex-1",style:{width:n?"calc(70%)":"70%"},children:(0,r.jsx)(ej,{projectId:t})}),i&&(0,r.jsx)(eC,{path:i.path,content:i.content,language:i.extension,onClose:()=>{o(null)}})]})}var eT=s(4264),eL=s(9696);function eI(){let e=(0,n.useParams)(),t=(0,n.useRouter)(),s=e.id,{currentProject:i,fetchProject:o,isLoading:c,error:d}=(0,eT.I)();return((0,a.useEffect)(()=>{s&&o(s)},[s,o]),c&&!i)?(0,r.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,r.jsx)("p",{className:"text-muted-foreground",children:"로딩 중..."})}):d||!i?(0,r.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center gap-4",children:[(0,r.jsx)(eL.A,{className:"h-12 w-12 text-destructive"}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-lg font-medium",children:"프로젝트를 찾을 수 없습니다"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:d||"프로젝트가 삭제되었거나 존재하지 않습니다."})]}),(0,r.jsx)(T.$,{onClick:()=>t.push("/"),variant:"outline",children:"홈으로 돌아가기"})]}):(0,r.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,r.jsx)(l.Y,{title:i.name,showBack:!0,backHref:"/"}),(0,r.jsx)(eB,{projectId:s})]})}},9049:(e,t,s)=>{"use strict";s.d(t,{cn:()=>n});var r=s(5806),a=s(4159);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,r.$)(t))}},9426:(e,t,s)=>{"use strict";s.d(t,{B:()=>i});var r=s(4876),a=s(1203);let n={en:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"Loading...","error":"Error","save":"Save","cancel":"Cancel","delete":"Delete","create":"Create","close":"Close","refresh":"Refresh","settings":"Settings"},"header":{"home":"Home","settings":"Settings"},"home":{"title":"My Projects","noProjects":"No projects yet","createFirst":"Create your first project to get started"},"project":{"create":"New Project","createDescription":"Build with AI","createTitle":"Create New Project","name":"Project Name","namePlaceholder":"my-awesome-app","type":"Project Type","typeWeb":"Web App","typeNative":"Native App","backendStack":"Backend Stack","backendNone":"Frontend Only","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"Delete Project","deleteConfirm":"Are you sure you want to delete this project?","updated":"Updated"},"chat":{"title":"Chat","placeholder":"Describe what you want to build...","askPlaceholder":"Ask a question about your project...","queuePlaceholder":"Queue another message...","send":"Send","thinking":"AI is thinking...","uploading":"Uploading files...","queueCount":"{count} message(s) queued","toolRunning":"Running","toolCompleted":"Completed","newConversation":"New Chat","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"Preview","start":"Start Preview","stop":"Stop Preview","starting":"Starting...","notReady":"Project not ready for preview","waitForAI":"Wait for AI to create the project files","openInNewTab":"Open in New Tab"},"fileExplorer":{"title":"Files","empty":"No files yet","loading":"Loading files...","error":"Failed to load files","open":"Open File Explorer","close":"Close File Explorer"},"language":{"select":"Language","en":"English","ko":"한국어"},"settings":{"title":"Settings","projectsPath":{"title":"Projects Folder","description":"Location where your projects are stored","saved":"Settings saved successfully","note":"New projects will be created in this folder. Existing projects are not affected."}}}'),ko:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"로딩 중...","error":"오류","save":"저장","cancel":"취소","delete":"삭제","create":"생성","close":"닫기","refresh":"새로고침","settings":"설정"},"header":{"home":"홈","settings":"설정"},"home":{"title":"내 프로젝트","noProjects":"프로젝트가 없습니다","createFirst":"첫 번째 프로젝트를 만들어 시작하세요"},"project":{"create":"새 프로젝트","createDescription":"AI와 함께 만들기","createTitle":"새 프로젝트 생성","name":"프로젝트 이름","namePlaceholder":"my-awesome-app","type":"프로젝트 유형","typeWeb":"웹 앱","typeNative":"네이티브 앱","backendStack":"백엔드 스택","backendNone":"프론트엔드 전용","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"프로젝트 삭제","deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","updated":"업데이트"},"chat":{"title":"채팅","placeholder":"만들고 싶은 것을 설명하세요...","askPlaceholder":"프로젝트에 대해 질문하세요...","queuePlaceholder":"다음 메시지를 입력하세요...","send":"전송","thinking":"AI가 생각 중...","uploading":"파일 업로드 중...","queueCount":"{count}개의 메시지가 대기 중","toolRunning":"실행 중","toolCompleted":"완료","newConversation":"새 대화","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"미리보기","start":"미리보기 시작","stop":"미리보기 중지","starting":"시작 중...","notReady":"프로젝트가 미리보기 준비가 되지 않았습니다","waitForAI":"AI가 프로젝트 파일을 생성할 때까지 기다려주세요","openInNewTab":"새 탭에서 열기"},"fileExplorer":{"title":"파일","empty":"파일이 없습니다","loading":"파일 로딩 중...","error":"파일 로드 실패","open":"파일 탐색기 열기","close":"파일 탐색기 닫기"},"language":{"select":"언어","en":"English","ko":"한국어"},"settings":{"title":"설정","projectsPath":{"title":"프로젝트 폴더","description":"프로젝트가 저장되는 위치","saved":"설정이 저장되었습니다","note":"새 프로젝트는 이 폴더에 생성됩니다. 기존 프로젝트에는 영향을 주지 않습니다."}}}')},l=(0,r.v)()((0,a.Zr)(e=>({locale:"ko",setLocale:t=>e({locale:t})}),{name:"claudeship-locale"}));function i(){let e=l(e=>e.locale);return{t:(t,s)=>(function(e,t,s){let r=t||l.getState().locale,a=e.split("."),i=n[r];for(let t of a)if(i&&"object"==typeof i&&t in i)i=i[t];else{for(let t of(i=n.en,a))if(!i||"object"!=typeof i||!(t in i))return e;else i=i[t];break}let o="string"==typeof i?i:e;if(s)for(let[e,t]of Object.entries(s))o=o.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(t));return o})(t,e,s),locale:e,setLocale:l(e=>e.setLocale)}}}},e=>{e.O(0,[992,298,59,498,358],()=>e(e.s=5006)),_N_E=e.O()}]);
|