import{r as e,j as s}from"./vendor-react-Dp9pL_Wn.js";import{w as a,o as i,F as t,ag as o,S as n}from"./c6eedc03a-CsEFTfjy.js";import{u as r,M as d}from"./vendor-intl-D2wGIp4M.js";import{aA as c,aB as l,aC as m,R as u,T as p,aD as j}from"./index-DhMXk6CR.js";import{U as k}from"./c97b955f1-BKSV6WNS.js";import{f as v,B as h}from"./vendor-ant-cds-bBedrtIN.js";import"./vendor-base-ui-DNypCIlh.js";import"./vendor-radix-Ch96tRrt.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-zod-0xcuG3aM.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-CokWnmlw.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-BwvgHhJ1.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-motion-EDlUw66k.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-growthbook-C66YtMMX.js";import"./vendor-infra-DayZK7Ds.js";import"./caf7c7e06-DJYXCm3T.js";import"./c5669b8e4-DFSq88jr.js";import"./c5f4e1303-CiyIFgnl.js";import"./cbaad2c48-DaP34LG2.js";import"./vendor-virtual-DRz8lJfQ.js";import"./cc2095605-Zo4an53U.js";import"./c4fba3bc0-C5Bz6sFm.js";const f=e.memo(({conversationUuid:f})=>{const g=a(),x=r(),_=i(),b=t(f),M=c(b?.project_uuid??void 0),y=l(e=>e.tip),C=l(e=>e.dismissed),w=l(e=>e.dismiss),N=l(e=>e.clearIfNotConversation);e.useEffect(()=>{N(f)},[N,f]);const{scheduledTasks:z}=m("schedule"===y?.ctaMode),F=e.useMemo(()=>new Set(z.map(o)),[z]),[S,T]=e.useState(!1),[q,D]=e.useState(null);e.useEffect(()=>{u().then(D)},[]);const{downloadAndOpenModal:A,modal:O}=p("schedule_cowork_task_tip"),U=y?.cadenceForAnalytics??"other",G=e.useCallback(()=>{g.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"schedule",suggested_cadence:U,variant:"tip"}),T(!0)},[g,U]),I=e.useCallback(()=>{g.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"upgrade",suggested_cadence:U,variant:"tip"}),_.push(j)},[g,U,_]),P=e.useCallback(()=>{g.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"get_desktop",suggested_cadence:U,variant:"tip"}),A(q)},[g,U,A,q]),W=e.useCallback(()=>{g.track({event_key:"claudeai.schedule_cowork_task.dismissed",variant:"tip"}),w(f)},[g,w,f]),B=e.useCallback(e=>{_.push(`${n}/${encodeURIComponent(e.id)}`)},[_]),E=e.useMemo(()=>y?{prompt:y.prompt||void 0,isModelSuggested:!0,name:y.initialName,localNameFallback:y.localNameFallback,description:y.initialDescription,frequency:y.initialFrequency,hour:y.initialHour,minute:y.initialMinute,dayOfWeek:y.initialDayOfWeek}:void 0,[y]);return!y||y.conversationUuid!==f||C.has(f)?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(v,{variant:"neutral",icon:"Calendar",className:"shrink-0",children:s.jsx(d,{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(d,{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"===y.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:G,children:s.jsx(d,{defaultMessage:"Schedule it",id:"Pi+HE5pWni"})}):"upgrade"===y.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:I,children:s.jsx(d,{defaultMessage:"Upgrade",id:"0h/lPMeYkq"})}):"download"===y.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:P,children:s.jsx(d,{defaultMessage:"Get desktop",id:"87RqeXlPL6"})}):null,s.jsx(h,{variant:"ghost",size:"sm",iconOnly:!0,icon:"X","aria-label":x.formatMessage({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:W})]})]}),"schedule"===y.ctaMode?s.jsx(k,{isOpen:S,onClose:()=>T(!1),onCreated:B,existingNames:F,entryPoint:"schedule_upsell_tip",initialValues:E,spaceId:M?.id}):O]})});f.displayName="ScheduleCoworkTaskTipBand";export{f as ScheduleCoworkTaskTipBand,f as default};
