import{r as e,j as t}from"./vendor-react-RSDKEZ60.js";import{dp as a,dq as s,bi as r,dr as o,ds as n,dt as c,du as d,bN as i,N as l,dv as u,dw as f,dx as m,a5 as g,dy as p,dz as h,I as j,dA as y,a9 as M,y as v,dB as b,dC as C,dD as k,dE as w,dF as x,dG as _,dH as A,dI as S,dJ as N}from"./c818056db-BBpc4u6S.js";import{u as P,M as z}from"./vendor-intl-BNW8a19h.js";import{a as D}from"./vendor-icons-CjJMeNuY.js";import{T as E,D as I,B as T}from"./vendor-ant-cds-CBh5POw1.js";function U(t,r,o={}){const{route:n,renderMode:c,artifactType:d,artifactId:i,immediate:l,messageCount:u,conversationUuid:f,virtualized:m,key:g}=o,p=e.useRef({messageCount:u,conversationUuid:f,virtualized:m});p.current={messageCount:u,conversationUuid:f,virtualized:m},e.useEffect(()=>{if("failed"!==r)return"ready"===r?s(t,{route:n,renderMode:c,artifactType:d,artifactId:i,immediate:l,messageCount:p.current.messageCount,conversationUuid:p.current.conversationUuid,virtualized:p.current.virtualized})??void 0:void 0;a(t)},[t,r,n,c,d,i,l,g])}function R({intl:e}){return t.jsx(E,{multiline:!0,content:e.formatMessage({defaultMessage:"Claude will guide your learning process instead of just giving answers. You can adjust these instructions in the project anytime.",id:"X9ioIsDrqe"}),side:"right",align:"end",children:t.jsx(D,{size:16,className:"shrink-0"})})}function H(e,a){const s=r(),d=P(),i=o();e=e??i?.type,a=a??i?.subtype;const l={};return s&&(l.createProjectTitle=d.formatMessage({defaultMessage:"Create a project",id:"HR5A+UPiIu"})),e===n.Student&&(a===c.Study&&(l.createProjectTitle=d.formatMessage({defaultMessage:"Create a study project",id:"aM+8eAE0xv"}),l.createProjectNameLabel=t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx(z,{defaultMessage:"What course are you studying?",id:"v36OurBGgA"}),t.jsx(R,{intl:d})]}),l.createProjectDescriptionDefault=d.formatMessage({defaultMessage:"A project for studying your course materials, where Claude helps visualize key concepts, build comprehensive study guides, and tutor you according to your learning needs.",id:"KXxo+Xoski"})),a===c.Career&&(l.createProjectTitle=d.formatMessage({defaultMessage:"Create a career project",id:"so02zrH0dG"}),l.createProjectNameLabel=d.formatMessage({defaultMessage:"What are you working towards?",id:"lqTAz2gpwu"}),l.createProjectDescriptionDefault=d.formatMessage({defaultMessage:"A project for exploring career opportunities, where Claude helps match your skills to potential careers, improve your resume, and develop personalized roadmaps for professional growth.",id:"JlrkubQL9D"})),a===c.Research&&(l.createProjectTitle=d.formatMessage({defaultMessage:"Create a research project",id:"L9PkdSYTu+"}),l.createProjectNameLabel=d.formatMessage({defaultMessage:"What are you researching?",id:"gsRiHcI+J7"}),l.createProjectDescriptionDefault=d.formatMessage({defaultMessage:"A project for developing academic research, where Claude helps identify key themes in your research, create structured outlines, and provide feedback to improve your drafts.",id:"WI7ROAQaAW"}))),l}function K(e){const t=P();if(!e)return{};const a=e.type,s=e.subtype,r={};return a===n.Student&&(r.projectKnowledgeTitle=t.formatMessage({defaultMessage:"Reference materials",id:"IAK8rLiiAO"}),r.projectNoChatsMessage=t.formatMessage({defaultMessage:"Start a chat to keep conversations organized and re-use reference materials.",id:"ShAr8vcP2v"}),r.projectNoKnowledgeCantAddMessage=t.formatMessage({defaultMessage:"No reference materials added yet.",id:"2Gz7oaDTj0"}),r.projectKnowledgeDragDropMessage=t.formatMessage({defaultMessage:"Drop files here to add to reference materials",id:"hNUGHHYeEK"}),s===c.Study&&(r.projectNoKnowledgeCanAddMessage=t.formatMessage({defaultMessage:"Drag and drop course materials like syllabi, lecture notes, or text-book excerpts so Claude can help you learn.",id:"hlIot3aXce"})),s===c.Career&&(r.projectNoKnowledgeCanAddMessage=t.formatMessage({defaultMessage:"Drag and drop career materials like your resume, cover letters, or job descriptions to help Claude provide personalized professional advice.",id:"LXnjolwaEB"})),s===c.Research&&(r.projectNoKnowledgeCanAddMessage=t.formatMessage({defaultMessage:"Drag and drop research materials like draft papers, source notes, or literature reviews to help Claude provide targeted academic guidance.",id:"c5oBAmpUAc"}))),r}const O=["chat","cowork","code"];function F(e){return O.includes(e)}const L="chorus-composer-surface-kind";function G(){const e=h().getItem(L);return F(e)?e:null}let B=G();const W=new Set;function X(e){return W.add(e),()=>W.delete(e)}function Y(){return B}function q(){return null}function J(e){h().setItem(L,e),B!==e&&(B=e,W.forEach(e=>e()))}function Q(){return e.useSyncExternalStore(X,Y,q)}function V(){const e=j(),t=l();return e&&!t.loading&&"supported"!==t.status}function Z(){const e=j(),t=i("dramatic_shrimp");return e||t.isAvailable}function $(t=!1){const a=d(),s=a.isAvailable,r=Z(),o=i("cowork"),n=l(),c=u(),h=f(),j=m();i("claude_code_web");const M=j,v=r&&h&&!!n.featureGateEnabled&&!c,b=v?"available":n.loading||o.isAvailable?"blocked_by_platform":o.status,C=g(),k="redirect"===p("claude_cowork_activations","chorus_free_cowork_upsell","modal",y)?"redirect":"modal",w=V(),x=!(!h||n.loading||v||w||C)&&k,_=s||"blocked_by_entitlement"===a.status,A=v||!!x||!!c||"blocked_by_entitlement"===b,S=_&&A?"both":_?"chat-only":A?"cowork-only":"neither";return e.useMemo(()=>({chat:s,chatStatus:a.status,chatHostLocked:t,cowork:v,coworkStatus:b,coworkUpsell:x,coworkDisabled:c,code:M,presentation:S,clamp:e=>"cowork"===e&&v?"cowork":s&&!t?"chat":"cowork"}),[s,a.status,t,v,b,x,c,M,S])}const ee={both:"both","chat-only":"chats","cowork-only":"tasks",neither:"both"};function te(){const e=$();return l().loading?"both":ee[e.presentation]}const ae=[];function se(){w("project_create",{trigger:"modal_open",route:"/projects/create"})}function re({source:a,moveAttachments:s=!1,handleProjectCreated:r,isOpen:o,handleClose:n,syncSources:c=[],attachments:d=[],setSyncSourceUuids:i,setAttachments:u,withLocalFolder:f=!1}){const[m,p]=e.useState(null),[h,j]=e.useState(""),{addError:y}=M(),{track:w}=v(),D=g(),E=l(),R=V(),K=f&&!R&&(!D||!!E.featureGateEnabled),O=K&&!D&&(E.loading||!E.featureGateEnabled),[F,L]=e.useState(!1),G=e.useCallback(()=>{w({event_key:"chorus.cowork_upsell.add_folder_blocked",source:a}),n(),L(!0)},[w,a,n]);U("project_create",o?"ready":"pending");const B=H();!function({project:t,syncSources:a,attachments:s,setSyncSourceUuids:r,setAttachments:o}){const n=e.useRef(!1),{addSuccess:c}=M(),d=P(),{mutate:i}=x(t?.uuid),{mutate:l}=_(t?.uuid,{trigger:"project_create"}),u=A(),f=e.useCallback(()=>{if(t&&(s.length||a.length&&t.is_private)){let e=s.length>0;s.forEach(({file_name:e,extracted_content:t})=>{i({file_name:e,content:t})}),t.is_private&&(a.forEach(t=>{const a=S(t,u);a&&(l(a),e=!0)}),r?.([])),o?.([]),e&&c(d.formatMessage({defaultMessage:"Attachments added to {projectName}",id:"dodZw3agKz"},{projectName:t.name||"your project"}))}},[t,c,s,i,o,l,r,a,d,u]);e.useEffect(()=>{t&&!n.current&&(n.current=!0,f())},[t,f])}({project:m,syncSources:c,attachments:d,setSyncSourceUuids:i,setAttachments:u});const W=P();e.useEffect(()=>{o||j("")},[o]);const X=e.useCallback(e=>{e||n()},[n]),Y=e.useCallback(e=>j(e[0]??""),[]),q=e.useCallback(()=>j(""),[]),J=t.jsx(z,{defaultMessage:"Add folder",id:"lhYeghbH/7"}),Q=!K||h?void 0:t.jsx("div",{className:"flex h-control items-center",children:O?t.jsx(T,{icon:"Folder",variant:"secondary",size:"sm",onClick:G,children:J}):t.jsx(N,{selectedFolders:ae,onSelectedFoldersChange:Y,renderTrigger:t.jsx(T,{icon:"Folder",variant:"secondary",size:"sm",children:J})})});return t.jsxs(t.Fragment,{children:[t.jsx(I.Root,{open:o,onOpenChange:X,children:t.jsxs(I.Popup,{children:[t.jsx(I.Header,{className:"pt-sm",actions:Q,children:s?W.formatMessage({defaultMessage:"Create a project with attachments",id:"wSxz4Q9mjA"}):W.formatMessage({defaultMessage:"Create a project",id:"HR5A+UPiIu"})}),K&&h?t.jsxs("div",{children:[t.jsx("p",{className:"-mt-xs mb-lg text-body text-secondary",children:t.jsx(z,{defaultMessage:"This project stays on this computer and won't sync or share. Claude reads files in this folder as context.",id:"ROIVssrlat"})}),t.jsx(b,{initialFolder:h,onClearFolder:q,onClose:n},h)]}):t.jsx(C,{source:a,className:"pt-md",syncSources:s?c:void 0,onProjectCreated:e=>{s&&p(e),r(e)},onError:e=>y(e.message,{error:e,errorContext:{tags:{source:"create_project_modal"}}}),onCancel:n,strings:B})]})}),t.jsx(k,{isOpen:F,onDismiss:()=>L(!1),variant:"chorus_add_folder"})]})}const oe=Object.freeze(Object.defineProperty({__proto__:null,CreateProjectModal:re,armCreateProjectModalOpen:se},Symbol.toStringTag,{value:"Module"}));export{re as C,se as a,Z as b,V as c,$ as d,U as e,Q as f,K as g,H as h,F as i,oe as j,G as r,te as u,J as w};
