import{r as e,j as s}from"./vendor-react-Dp9pL_Wn.js";import{w as a,n as i,O as t,z as o,A as n,S as d}from"./c4b350ac1-KLFM4jkb.js";import{u as r,M as c}from"./vendor-intl-BDR1NhN_.js";import{U as l}from"./c97b955f1-DTiuSfBp.js";import{a as u,b as m,c as p,S as k}from"./c40b9b8f5-CcFpJKg-.js";import{f as j,B as h}from"./vendor-ant-cds-DvTmcYA1.js";import"./vendor-base-ui-CdQU4JQh.js";import"./vendor-radix-D3USJ4lr.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-zod-DIcz3Rbr.js";import"./vendor-zustand-CI9omAwJ.js";import"./vendor-icons-BBStP_8q.js";import"./vendor-lodash-CIro4mst.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-DgCRID2b.js";import"./vendor-motion-D7Z1qgzM.js";import"./vendor-luxon-Y8l99kBI.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-growthbook-C66YtMMX.js";import"./cc2095605-BFatOO3O.js";import"./c4fba3bc0-G6nDk6J7.js";import"./c393cb7f5-HUvLXarC.js";import"./vendor-virtual-DRz8lJfQ.js";const v=e.memo(({conversationUuid:v})=>{const f=a(),g=r(),x=i(),_=t(v),b=u(_?.project_uuid??void 0),M=m(e=>e.tip),y=m(e=>e.dismissed),C=m(e=>e.dismiss),w=m(e=>e.clearIfNotConversation);e.useEffect(()=>{w(v)},[w,v]);const{scheduledTasks:N}=p("schedule"===M?.ctaMode),S=e.useMemo(()=>new Set(N.map(e=>e.displayName??e.id)),[N]),[z,q]=e.useState(!1),[F,O]=e.useState(null);e.useEffect(()=>{o().then(O)},[]);const{downloadAndOpenModal:T,modal:D}=n("schedule_cowork_task_tip"),U=M?.cadenceForAnalytics??"other",A=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"schedule",suggested_cadence:U,variant:"tip"}),q(!0)},[f,U]),G=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"upgrade",suggested_cadence:U,variant:"tip"}),x.push(k)},[f,U,x]),I=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"get_desktop",suggested_cadence:U,variant:"tip"}),T(F)},[f,U,T,F]),P=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.dismissed",variant:"tip"}),C(v)},[f,C,v]),W=e.useCallback(e=>{x.push(`${d}/${encodeURIComponent(e.id)}`)},[x]),E=e.useMemo(()=>M?{prompt:M.prompt||void 0,isModelSuggested:!0,name:M.initialName,localNameFallback:M.localNameFallback,description:M.initialDescription,frequency:M.initialFrequency,hour:M.initialHour,minute:M.initialMinute,dayOfWeek:M.initialDayOfWeek}:void 0,[M]);return!M||M.conversationUuid!==v||y.has(v)?null:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex min-h-11 w-full items-center gap-sm rounded-xl bg-surface-1 py-xs pl-md pr-sm shadow-card-ring",children:[s.jsx(j,{variant:"neutral",icon:"Calendar",className:"shrink-0",children:s.jsx(c,{defaultMessage:"Tip",id:"4j1TGZubAJ"})}),s.jsx("span",{className:"text-caption text-primary line-clamp-2 min-w-0 flex-1 leading-4",children:s.jsx(c,{defaultMessage:"Want this every morning? Claude can run it on a schedule.",id:"IfGbKXDlq/"})}),s.jsxs("div",{className:"flex shrink-0 items-center gap-xs",children:["schedule"===M.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:A,children:s.jsx(c,{defaultMessage:"Schedule it",id:"Pi+HE5pWni"})}):"upgrade"===M.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:G,children:s.jsx(c,{defaultMessage:"Upgrade",id:"0h/lPMeYkq"})}):"download"===M.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:I,children:s.jsx(c,{defaultMessage:"Get desktop",id:"87RqeXlPL6"})}):null,s.jsx(h,{variant:"ghost",size:"sm",iconOnly:!0,icon:"X","aria-label":g.formatMessage({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:P})]})]}),"schedule"===M.ctaMode?s.jsx(l,{isOpen:z,onClose:()=>q(!1),onCreated:W,existingNames:S,entryPoint:"schedule_upsell_tip",initialValues:E,spaceId:b?.id}):D]})});v.displayName="ScheduleCoworkTaskTipBand";export{v as ScheduleCoworkTaskTipBand,v as default};
