claudeship 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/server/dist/chat/prompts/fullstack-express-prompt.d.ts +1 -1
- package/apps/server/dist/chat/prompts/fullstack-express-prompt.js +16 -0
- package/apps/server/dist/chat/prompts/fullstack-express-prompt.js.map +1 -1
- package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.d.ts +1 -1
- package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.js +16 -0
- package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.js.map +1 -1
- package/apps/server/dist/chat/prompts/web-system-prompt.d.ts +1 -1
- package/apps/server/dist/chat/prompts/web-system-prompt.js +15 -0
- package/apps/server/dist/chat/prompts/web-system-prompt.js.map +1 -1
- 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 +2 -2
- 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 +1 -1
- 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/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-6f3d6b321c288cd3.js +1 -0
- package/apps/web/.next/static/chunks/app/project/[id]/page-e5cda6f9050b0a52.js +1 -0
- 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/useChatStore.ts +34 -9
- 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/project/[id]/page-4c15c33bf78552cb.js +0 -1
- /package/apps/web/.next/static/{yVw9J0lkf1zLx2qq5O3Tu → zw4FcukMOho6_dzgpEdNW}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{yVw9J0lkf1zLx2qq5O3Tu → zw4FcukMOho6_dzgpEdNW}/_ssgManifest.js +0 -0
|
@@ -0,0 +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:()=>eq});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);let E=(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})}));var P=s(5603);let C=/<restart-preview\s*\/>/g,R=0,B=(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(P.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(P.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:r}=await o.read();if(t)break;let a=(d+=c.decode(r,{stream:!0})).split("\n");for(let t of(d=a.pop()||"",a))if(t.startsWith("data: "))try{let r=JSON.parse(t.slice(6));if(console.log("[SSE Event]",r.type,r),"text"===r.type&&r.content){let t=C.test(r.content);C.lastIndex=0;let a=r.content.replace(C,"").trim();if(t){let e=Date.now();e-R>3e3&&(R=e,E.getState().restartPreview(s))}if(a){let t={id:"text-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"text",content:a};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}}else if("tool_use"===r.type&&r.tool){let t={id:"tool-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"tool_use",tool:{name:r.tool.name,input:r.tool.input},status:"running"};e(e=>({streamingBlocks:[...e.streamingBlocks,t]}))}else if("tool_result"===r.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:r.content};break}return{streamingBlocks:t}});else if("ask_user_question"===r.type&&r.askUserQuestion){let t={id:"question-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"ask_user_question",askUserQuestion:r.askUserQuestion,status:"waiting"};e(e=>({streamingBlocks:[...e.streamingBlocks,t],pendingQuestion:r.askUserQuestion}))}else"error"===r.type&&e({error:r.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 T=s(8031),L=s(6569),I=s(6776),_=s(5594),q=s(4660),U=s(3527);let D=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(q.bL,{className:(0,i.cn)("grid gap-2",s),...a,ref:t})});D.displayName=q.bL.displayName;let Q=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(q.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)(q.C1,{className:"flex items-center justify-center",children:(0,r.jsx)(U.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});Q.displayName=q.q7.displayName;var z=s(8367);let O=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(z.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)(z.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(L.A,{className:"h-4 w-4"})})})});O.displayName=z.bL.displayName;var M=s(2731);let W=(0,s(4176).F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(M.b,{ref:t,className:(0,i.cn)(W(),s),...a})});$.displayName=M.b.displayName;var J=s(5338);function G(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)(I.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)(O,{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)($,{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)(D,{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)($,{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)(J.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)(_.$,{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)(L.A,{className:"h-4 w-4 text-green-600"}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[(0,r.jsx)(I.A,{className:"h-4 w-4 inline mr-1"}),"질문 응답 완료"]})]})}let X={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 H(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 V(e){let{content:t}=e;return(0,r.jsx)(v,{content:t})}function K(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)(T.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:X[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}),H(s)&&(0,r.jsx)("span",{className:"truncate ".concat(a?"text-blue-600 dark:text-blue-400":"text-muted-foreground"),children:H(s)})]})}function Y(e){let{blocks:t,isStreaming:s=!0,projectId:a}=e,n=t.length>0,{respondToQuestion:l,pendingQuestion:i}=B(),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)(V,{content:e.content||""},e.id):"tool_use"===e.type?(0,r.jsx)(K,{block:e},e.id):"ask_user_question"===e.type&&e.askUserQuestion?(0,r.jsx)(G,{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)(T.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 Z(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)(Y,{blocks:s,isStreaming:n,projectId:l}),(0,r.jsx)("div",{ref:i})]})}var ee=s(7793),et=s(3113),es=s(219),er=s(9426),ea=s(2881);function en(){let{t:e}=(0,er.B)(),{mode:t,setMode:s,isStreaming:a}=B();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)(I.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)(ea.A,{className:"h-4 w-4"}),e("chat.modeBuild")]})]})}var el=s(6241);function ei(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)(T.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)(el.A,{className:"h-3 w-3"})})]},e.id)})})}let eo=["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 ec(e){let{onSend:t,projectId:s,disabled:n,isStreaming:l,queueCount:i=0}=e,{t:o}=(0,er.B)(),{mode:c,attachedFiles:d,addFiles:u,removeFile:m,uploadFiles:h,isUploading:p}=B(),[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=>eo.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)(en,{})}),(0,r.jsx)(ei,{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:eo.join(","),onChange:e=>{e.target.files&&(v(Array.from(e.target.files)),e.target.value="")},className:"hidden"}),(0,r.jsx)(_.$,{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)(ee.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)(_.$,{onClick:w,disabled:!x.trim()&&0===d.length||n||p,size:"icon",className:"h-10 w-10 shrink-0",children:(0,r.jsx)(et.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)(es.A,{className:"h-3 w-3"}),o("chat.queueCount",{count:i})]})]})]})}var ed=s(4025);function eu(e){let{projectId:t}=e,{t:s}=(0,er.B)(),[n,l]=(0,a.useState)(!1),{messages:i,isStreaming:o,streamingBlocks:c,messageQueue:d,fetchMessages:u,fetchActiveSession:m,sendMessage:h,clearMessages:p}=B();(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)(_.$,{variant:"ghost",size:"sm",onClick:x,disabled:n||o,title:s("chat.newConversation"),className:"gap-1.5",children:[(0,r.jsx)(ed.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:s("chat.newConversation")})]})]}),(0,r.jsx)(Z,{messages:i,streamingBlocks:c,isStreaming:o,projectId:t}),(0,r.jsx)(ec,{onSend:e=>{h(t,e)},projectId:t,isStreaming:o,queueCount:d.length})]})}var em=s(3774),eh=s(3787),ep=s(4246),ex=s(5471),eg=s(7604),ef=s(6021),ej=s(9085);let eb=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000";function eN(e){let{projectId:t}=e,{t:s}=(0,er.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}=E(),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(eb,"/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(eb,"/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 P=()=>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)(_.$,{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)(em.A,{className:"h-4 w-4"})}),(0,r.jsx)(_.$,{variant:"ghost",size:"sm",onClick:()=>v(),disabled:g,className:"h-8 w-8 p-0",title:"Refresh",children:(0,r.jsx)(eh.A,{className:"h-4 w-4"})}),(0,r.jsx)(_.$,{variant:"ghost",size:"sm",onClick:()=>N(t),disabled:g,className:"h-8 w-8 p-0",title:"Restart server",children:(0,r.jsx)(ep.A,{className:"h-4 w-4"})}),(0,r.jsx)(_.$,{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)(ex.A,{className:"h-4 w-4"})}),(0,r.jsx)(_.$,{variant:"ghost",size:"sm",onClick:()=>b(t),disabled:g,className:"h-8 w-8 p-0",title:"Stop",children:(0,r.jsx)(eg.A,{className:"h-4 w-4"})})]}):(0,r.jsx)(_.$,{variant:"ghost",size:"sm",onClick:P,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)(ef.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)(em.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)(eh.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)(_.$,{variant:"outline",size:"sm",onClick:P,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)(ef.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)(ej.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)(T.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})})})]})}var ev=s(794),ew=s(2475),ey=s(4373),ek=s(4309),eA=s(6925);let eS=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:3000";function eF(e){let{projectId:t,onFileSelect:s}=e,{t:n}=(0,er.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(eS,"/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(eS,"/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)(_.$,{variant:"outline",size:"sm",onClick:m,children:[(0,r.jsx)(eh.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)(_.$,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,title:n("common.refresh"),children:(0,r.jsx)(eh.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)(eE,{nodes:l,onFileClick:h})})]})}function eE(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)(eP,{node:e,onFileClick:s,level:a},e.path))})}function eP(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)(ek.A,{className:"h-3 w-3"}):(0,r.jsx)(eA.A,{className:"h-3 w-3"})}),!c&&(0,r.jsx)("span",{className:"w-4 flex-shrink-0"}),(()=>{if(c)return l?(0,r.jsx)(ev.A,{className:"h-4 w-4 text-blue-400 flex-shrink-0"}):(0,r.jsx)(ew.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)(ey.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)(eE,{nodes:t.children,onFileClick:s,level:n+1})]})}var eC=s(262);let eR={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 eB(e){let{path:t,content:s,language:n,onClose:l}=e,{t:i}=(0,er.B)(),[o,c]=(0,a.useState)(!1),d=t.split("/").pop()||t,u=eR[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)(_.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:h,title:o?"Copied!":"Copy",children:o?(0,r.jsx)(L.A,{className:"h-4 w-4 text-green-500"}):(0,r.jsx)(eC.A,{className:"h-4 w-4"})}),(0,r.jsx)(_.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:l,title:i("common.close"),children:(0,r.jsx)(el.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 eT=s(2858);function eL(e){let{projectId:t}=e,{t:s}=(0,er.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)(_.$,{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)(el.A,{className:"h-4 w-4"}):(0,r.jsx)(eT.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)(eF,{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)(eu,{projectId:t})}),(0,r.jsx)("div",{className:"flex-1",style:{width:n?"calc(70%)":"70%"},children:(0,r.jsx)(eN,{projectId:t})}),i&&(0,r.jsx)(eB,{path:i.path,content:i.content,language:i.extension,onClose:()=>{o(null)}})]})}var eI=s(4264),e_=s(9696);function eq(){let e=(0,n.useParams)(),t=(0,n.useRouter)(),s=e.id,{currentProject:i,fetchProject:o,isLoading:c,error:d}=(0,eI.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)(e_.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)(_.$,{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)(eL,{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()}]);
|