1import{j as e}from"./ui-vendor-oOQYPoO_.js";import{r as o}from"./react-vendor-w9sjr_jx.js";import{b as Et,u as Mt,f as Dt,s as C,c as m,B as b,S as De,X as St}from"./index-C8RfnG7S.js";import{I as _}from"./input-Cht4tBSW.js";import{T as me}from"./textarea-BoGPzbas.js";import{D as Se,a as Te,b as Ie,c as Oe,f as Ae}from"./dialog-Bkt4UNX1.js";import{a as Tt}from"./checkbox-B7vV4wcm.js";import{u as It,s as Ot,i as Qe,a as At,b as Ht}from"./useHabitsStore-CNX1Zaoq.js";import{S as B,a as F,b as W,c as U,d as v}from"./select-Co4YqM_m.js";import{B as He}from"./badge-B0nDBwCJ.js";import{T as Rt,a as Lt,b as J}from"./tabs-C0JuIkck.js";import{S as ue}from"./scroll-area-BsqGIBuu.js";import{a as Ye,p as D,i as Pt,R as Re,H as $t,b as Vt,c as Bt}from"./Index-CnDo2o34.js";import{a as xe,s as Ft,f as d}from"./format-DYdE4j8n.js";import{t as Xe,g as Wt}from"./en-US-Cw-5BurC.js";import{e as Ut}from"./formatDistanceToNow-DVIUHGFa.js";import{e as Le}from"./eachDayOfInterval-CcQHWkxh.js";import{i as z,a as ae}from"./isToday-CTnh2hJR.js";import{C as q}from"./calendar-bsUKj2k-.js";import{L as Pe}from"./layout-grid-BVjf-OMk.js";import{C as he}from"./clock-D47QNWIb.js";import{C as zt}from"./chevron-left-CEVPys1B.js";import{C as qt}from"./chevron-right-BdXmODde.js";import{C as Kt}from"./columns-2-C96iqk16.js";import{E as Gt}from"./eye-Cd_L_6p1.js";import{L as Qt}from"./list-DspoHsAP.js";import{P as $e}from"./plus-BsegXrII.js";import{S as Yt}from"./search-DyCoLiVZ.js";import{F as Xt}from"./filter-DwQDPc7_.js";import{T as Zt}from"./tag-YHK2x2Tu.js";import{U as Ve}from"./user-S25bn5jX.js";import{M as pe}from"./map-pin-CFOFnXVb.js";import{P as Be}from"./pencil-B2WyRSKP.js";import{C as Fe}from"./copy-i-dxjZXx.js";import{T as We}from"./trash-2-Bh5y78l8.js";import{L as Jt}from"./list-todo-DEYiYkRu.js";import{A as ea}from"./database-v3Meoq9n.js";import{B as Ze}from"./briefcase-CWG5saaT.js";import{V as ta}from"./video-BP0QAO9J.js";import{P as aa}from"./phone-rgavJgC-.js";import{C as sa}from"./circle-alert-C9n2novi.js";import{B as ra}from"./bell-CH0LVsAW.js";import{C as na}from"./check-DcKRSYRG.js";import{a as ee,s as la}from"./subDays-DQQbO2Ek.js";import"./supabase-vendor-Dv1i-10A.js";import"./chart-vendor-0aofaHHw.js";import"./index-BdQq_4o_.js";import"./card-BPImL93T.js";import"./book-open-arFe-Q2q.js";import"./toast-vendor-DgqQvEHx.js";import"./sheet-DtT0kQ5B.js";import"./brain-K4LO95HN.js";import"./sun-CzIv02IR.js";import"./file-text-DaS_cGfH.js";import"./notebook-pen-D8tfqixz.js";import"./square-check-big-Bz7VTZSa.js";import"./quote-5TS_nD1f.js";import"./sticky-note-B7yZG3Sz.js";import"./file-_-LQe2bP.js";import"./useZettelCards-CiZ02Jml.js";import"./useMutation-8Sc3gSV2.js";import"./use-toast-mkxb1iD6.js";import"./purify.es-C5KSVp3G.js";import"./useSubscription-Bn7h6MDn.js";import"./flame-BIJBU9RK.js";import"./timer-BJ6iDpGh.js";import"./send-UrR9WP--.js";import"./triangle-alert-BuKSrbmq.js";import"./refresh-cw-DrVrNnzM.js";import"./external-link-CNucl5Rv.js";import"./star-ogNMb4RL.js";import"./sparkles-CT9cykUn.js";import"./link-zV6gYmm0.js";import"./maximize-2-DNSepj70.js";import"./minimize-2-uV7x29mD.js";import"./dropdown-menu-DFD8tleL.js";import"./WeatherWidget-DLaMS7TQ.js";import"./wind-6QROU_T7.js";import"./save-MbzQxvL-.js";import"./progress-BkpGPUeK.js";import"./popover-C5CwMv-l.js";import"./useNotifications-CSHQG3D1.js";import"./play-C7UGlYgG.js";import"./pause-y6ckJL3I.js";import"./circle-check-DdVJegFS.js";import"./circle-x-O8gZWIIw.js";import"./lock-Dur41FLU.js";import"./pdf-vendor-DDErgEt2.js";import"./palette-BK81Avqi.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ia=Et("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);function oa(r,x){var E,O;const j=Wt(),K=j.weekStartsOn??((O=(E=j.locale)==null?void 0:E.options)==null?void 0:O.weekStartsOn)??0,S=Xe(r),h=S.getDay(),re=(h<K?-7:0)+6-(h-K);return S.setDate(S.getDate()+re),S.setHours(23,59,59,999),S}function Ue(r,x){const j=Xe(r);return j.setHours(x),j}function ca(r,x){return Ye(r,-x)}const se=[{value:"event",label:"Event",icon:q,color:"hsl(var(--primary))"},{value:"appointment",label:"Appointment",icon:Ze,color:"#64748b"}
6,{value:"meeting",label:"Meeting",icon:ta,color:"#3b82f6"},{value:"call",label:"Phone Call",icon:aa,color:"#22c55e"},{value:"personal",label:"Personal",icon:$t,color:"#ec4899"},{value:"deadline",label:"Deadline",icon:sa,color:"#ef4444"},{value:"reminder",label:"Reminder",icon:ra,color:"#f59e0b"}],Je={event:"bg-primary",appointment:"bg-slate-500",meeting:"bg-blue-500",call:"bg-green-500",personal:"bg-pink-500",deadline:"bg-red-500",reminder:"bg-amber-500"},da={event:"border-l-primary",appointment:"border-l-violet-500",meeting:"border-l-blue-500",call:"border-l-green-500",personal:"border-l-pink-500",deadline:"border-l-red-500",reminder:"border-l-amber-500"},ma={zettel_card:"bg-primary",note:"bg-blue-500",scratch_pad:"bg-slate-500",sticky_note:"bg-yellow-500",manual:"bg-orange-500",task:"bg-rose-500",task_done:"bg-green-500",habit:"bg-teal-500"},fe={zettel_card:"border-l-primary",note:"border-l-blue-500",scratch_pad:"border-l-purple-500",sticky_note:"border-l-yellow-500",manual:"border-l-orange-500",task:"border-l-rose-500",task_done:"border-l-green-500",habit:"border-l-teal-500"},ua={zettel_card:"Zettel",note:"Note",scratch_pad:"Scratch Pad",sticky_note:"Sticky",manual:"Event",task:"Task",task_done:"Done",habit:"Habit"},xa=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ze=Array.from({length:24},(r,x)=>x),qe=[{value:"confirmed",label:"Confirmed",color:"bg-green-500"},{value:"pending",label:"Pending",color:"bg-amber-500"},{value:"cancelled",label:"Cancelled",color:"bg-red-500"},{value:"completed",label:"Completed",color:"bg-blue-500"}],ha=[15,30,45,60,90,120,180,240];function te(r){if(!r)return null;try{return d(new Date(`2000-01-01T${r}`),"h:mm a")}catch{return r}}function pa(r){return ae(r)?"Today":Vt(r)?"Tomorrow":Qe(r)?d(r,"EEEE"):d(r,"EEE, MMM d")}function ge(r){return r.source_type==="manual"&&r.event_category?Je[r.event_category]||"bg-orange-500":ma[r.source_type]||"bg-muted-foreground"}function ga(r){return r.source_type==="manual"&&r.event_category?da[r.event_category]||"border-l-orange-500":fe[r.source_type]||"border-l-muted-foreground"}function Ke(r){if(r.source_type==="manual"&&r.event_category){const x=se.find(j=>j.value===r.event_category);return(x==null?void 0:x.label)||"Event"}return ua[r.source_type]||"Event"}function Ge(r){if(r<60)return`${r}m`;const x=Math.floor(r/60),j=r%60;return j>0?`${x}h ${j}m`:`${x}h`}function Zs(){const{user:r}=Mt(),x=Dt(),{habits:j,addHabit:K,reload:S}=It(),[h,re]=o.useState("month"),[E,O]=o.useState(new Date),[P,ne]=o.useState(xe(new Date)),[p,A]=o.useState(new Date),[le,ve]=o.useState([]),[M,et]=o.useState([]),[tt,je]=o.useState(!0),[G,at]=o.useState(""),[H,st]=o.useState("all"),[ie,ye]=o.useState(""),rt=o.useRef(null),[nt,T]=o.useState(!1),[y,lt]=o.useState("event"),[n,f]=o.useState({title:"",description:"",event_time:"",end_time:"",duration_minutes:30,location:"",client_name:"",client_email:"",event_category:"event",reminder_minutes:void 0,is_recurring:!1,recurrence_rule:"",status:"confirmed",is_all_day:!1}),[N,Q]=o.useState({name:"",priority:"medium",notes:""}),[R,oe]=o.useState({name:"",color:"#3b82f6"}),[i,it]=o.useState(null),[ot,$]=o.useState(!1),[ct,Y]=o.useState(null),[I,X]=o.useState({title:"",description:"",event_time:""}),w=o.useCallback(async()=>{if(r)try{je(!0);const{data:t}=await C.from("calendar_events").select("*").eq("user_id",r.id).order("event_date",{ascending:!0}),a=t||[];ve(a);const{data:s}=await C.from("project_tasks").select("id, name, status, due_date, priority, notes").eq("user_id",r.id),g=(s||[]).map(c=>({id:`task-${c.id}`,title:c.name,description:c.notes,event_date:c.due_date,source_type:c.status==="done"?"task_done":"task",taskStatus:c.status,taskId:c.id})),l=[],u=[...a.map(c=>({id:c.id,title:c.title,description:c.description,event_date:c.event_date,event_time:c.event_time,end_time:c.end_time,duration_minutes:c.duration_minutes,location:c.location,client_name:c.client_name,client_email:c.client_email,event_category:c.event_category,color:c.color,status:c.status,is_all_day:c.is_all_day,source_type:c.source_type})),...g,...l];et(u)}catch(t){console.error("Error fetching calendar events:",t),ve([])}finally{je(!1)}},[r]);o.useEffect(()=>{r&&w()},[r,w]);const be=o.useMemo(()=>{const t=[];for(const a of j)for(const s of a.days)s.done&&t.push({id:`habit-${a.id}-${s.date}`,title:a.name,event_date:s.date,source_type:"habit"});return t},[j]),L=o.useMemo(()=>{let t=[...M,...be];
6if(G.trim()){const a=G.toLowerCase();t=t.filter(s=>{var g,l,u;return s.title.toLowerCase().includes(a)||((g=s.description)==null?void 0:g.toLowerCase().includes(a))||((l=s.client_name)==null?void 0:l.toLowerCase().includes(a))||((u=s.location)==null?void 0:u.toLowerCase().includes(a))})}return H!=="all"&&(t=t.filter(a=>H==="tasks"?a.source_type==="task"||a.source_type==="task_done":H==="habits"?a.source_type==="habit":a.event_category===H)),t},[M,be,G,H]),_e=o.useMemo(()=>{const t=new Map;for(const a of L){const s=a.event_date;t.has(s)||t.set(s,[]),t.get(s).push(a)}return t},[L]),dt=o.useMemo(()=>{const t=xe(Ot(E)),a=oa(Ut(E));return Le({start:t,end:a})},[E]),mt=o.useMemo(()=>Le({start:P,end:ee(P,6)}),[P]),k=o.useMemo(()=>L.filter(t=>z(D(t.event_date),p)).sort((t,a)=>t.is_all_day&&!a.is_all_day?-1:!t.is_all_day&&a.is_all_day?1:(t.event_time||"99:99").localeCompare(a.event_time||"99:99")),[L,p]),Ne=o.useMemo(()=>{const t=Ft(new Date),a=L.filter(l=>!Pt(D(l.event_date),t)).sort((l,u)=>l.event_date.localeCompare(u.event_date)||(l.event_time||"").localeCompare(u.event_time||"")),s=[];let g="";for(const l of a){if(l.event_date!==g){g=l.event_date;const u=D(l.event_date);s.push({date:u,label:pa(u),events:[]})}s[s.length-1].events.push(l)}return s.slice(0,14)},[L]),ut=o.useMemo(()=>M.filter(t=>z(D(t.event_date),new Date)).length,[M]),xt=o.useMemo(()=>M.filter(t=>Qe(D(t.event_date))).length,[M]),ht=o.useMemo(()=>M.filter(t=>t.status==="pending"&&t.event_category==="appointment").length,[M]),we=async(t,a)=>{if(!(!r||!t.trim()))try{await C.from("calendar_events").insert({user_id:r.id,title:t.trim(),description:(a==null?void 0:a.description)||"",event_date:d(p,"yyyy-MM-dd"),event_time:(a==null?void 0:a.event_time)||null,end_time:(a==null?void 0:a.end_time)||null,duration_minutes:(a==null?void 0:a.duration_minutes)||30,location:(a==null?void 0:a.location)||null,client_name:(a==null?void 0:a.client_name)||null,client_email:(a==null?void 0:a.client_email)||null,event_category:(a==null?void 0:a.event_category)||"event",color:(a==null?void 0:a.color)||null,reminder_minutes:(a==null?void 0:a.reminder_minutes)??null,is_recurring:(a==null?void 0:a.is_recurring)||!1,recurrence_rule:(a==null?void 0:a.recurrence_rule)||null,status:(a==null?void 0:a.status)||"confirmed",is_all_day:(a==null?void 0:a.is_all_day)||!1,source_type:"manual",source_id:crypto.randomUUID()}),w()}catch(s){console.error("Error adding event:",s)}},ke=async t=>{if(I.title.trim())try{await C.from("calendar_events").update({title:I.title.trim(),description:I.description,event_time:I.event_time||null}).eq("id",t),Y(null),w()}catch(a){console.error("Error updating event:",a)}},pt=async(t,a)=>{try{await C.from("calendar_events").update({status:a}).eq("id",t),w()}catch(s){console.error(s)}},Ce=async t=>{if(!r)return;const a=le.find(g=>g.id===t.id);if(!a)return;const s=d(ee(D(a.event_date),1),"yyyy-MM-dd");await C.from("calendar_events").insert({...a,id:void 0,event_date:s,source_id:crypto.randomUUID(),created_at:void 0}),w()},Ee=async t=>{try{await C.from("calendar_events").delete().eq("id",t),w()}catch(a){console.error("Error deleting event:",a)}},gt=()=>{ie.trim()&&(we(ie),ye(""))},Z=async()=>{if(y==="event")await we(n.title,{description:n.description,event_time:n.event_time||void 0,end_time:n.end_time||void 0,duration_minutes:n.duration_minutes,location:n.location||void 0,client_name:n.client_name||void 0,client_email:n.client_email||void 0,event_category:n.event_category,reminder_minutes:n.reminder_minutes,is_recurring:n.is_recurring,recurrence_rule:n.recurrence_rule||void 0,status:n.status,is_all_day:n.is_all_day}),f({title:"",description:"",event_time:"",end_time:"",duration_minutes:30,location:"",client_name:"",client_email:"",event_category:"event",reminder_minutes:void 0,is_recurring:!1,recurrence_rule:"",status:"confirmed",is_all_day:!1});else if(y==="task"&&r&&N.name.trim())await C.from("project_tasks").insert({user_id:r.id,name:N.name.trim(),priority:N.priority,notes:N.notes||null,due_date:d(p,"yyyy-MM-dd"),status:"todo"}),Q({name:"",priority:"medium",notes:""}),w();else if(y==="habit"&&r&&R.name.trim()){try{await K(R.name.trim())}catch(t){console.error("Failed to create habit",t)}oe({name:"",color:"#3b82f6"}),await S()}T(!1)},Me=t=>
6{Y(t.id),X({title:t.title,description:t.description||"",event_time:t.event_time||""})},ft=()=>{h==="month"?O(t=>At(t,1)):h==="week"?ne(t=>ca(t,1)):A(t=>la(t,1))},vt=()=>{h==="month"?O(t=>Bt(t,1)):h==="week"?ne(t=>Ye(t,1)):A(t=>ee(t,1))},jt=()=>{O(new Date),ne(xe(new Date)),A(new Date)},ce=t=>{it(t),$(!0)};if(tt)return e.jsxs("div",{className:"p-4 space-y-4 animate-pulse",children:[e.jsx("div",{className:"h-8 w-48 bg-muted/40 rounded-lg"}),e.jsx("div",{className:"h-[360px] bg-muted/30 rounded-xl"})]});const V=(t,a=!1)=>{if(t.source_type==="task"||t.source_type==="task_done")return e.jsxs("div",{className:m("flex items-center gap-2 pl-3 pr-2 py-2 rounded-lg border-l-[3px] transition-colors hover:bg-accent/30 cursor-pointer",fe[t.source_type]),onClick:()=>ce(t),children:[e.jsx(Tt,{checked:t.source_type==="task_done",onCheckedChange:async l=>{t.taskId&&(await C.from("project_tasks").update({status:l?"done":"todo"}).eq("id",t.taskId),w())},onClick:l=>l.stopPropagation(),"aria-label":`Toggle task: ${t.title}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:m("text-sm font-medium text-foreground truncate",t.source_type==="task_done"&&"line-through opacity-60"),children:t.title}),!a&&e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"Task"})]})]},t.id);if(t.source_type==="habit")return e.jsxs("div",{className:m("pl-3 pr-2 py-2 rounded-lg border-l-[3px] cursor-pointer hover:bg-accent/30 transition-colors",fe.habit),onClick:()=>ce(t),children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t.title}),!a&&e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"Habit â"})]},t.id);const s=le.find(l=>l.id===t.id);return ct===t.id&&s?e.jsxs("div",{className:"p-2.5 rounded-lg border border-border bg-muted/30 space-y-2",children:[e.jsx(_,{value:I.title,onChange:l=>X(u=>({...u,title:l.target.value})),className:"h-8 text-sm",autoFocus:!0,onKeyDown:l=>{l.key==="Enter"&&ke(s.id),l.key==="Escape"&&Y(null)}}),e.jsx(_,{type:"time",value:I.event_time,onChange:l=>X(u=>({...u,event_time:l.target.value})),className:"h-8 text-sm"}),e.jsx(me,{value:I.description,onChange:l=>X(u=>({...u,description:l.target.value})),className:"text-sm min-h-[48px]",rows:2,placeholder:"Description (optional)"}),e.jsxs("div",{className:"flex gap-1.5 justify-end",children:[e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>Y(null),children:e.jsx(St,{className:"h-3.5 w-3.5"})}),e.jsx(b,{size:"sm",className:"h-7 px-2",onClick:()=>ke(s.id),children:e.jsx(na,{className:"h-3.5 w-3.5"})})]})]},s.id):e.jsx("div",{className:m("group relative pl-3 pr-2 py-2 rounded-lg border-l-[3px] transition-colors cursor-pointer","hover:bg-accent/30",ga(t)),onClick:()=>ce(t),children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:m("text-sm font-medium text-foreground truncate",t.status==="cancelled"&&"line-through opacity-60"),children:t.title}),t.status==="pending"&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 shrink-0"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 flex-wrap",children:[t.event_time&&e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-0.5",children:[e.jsx(he,{className:"h-2.5 w-2.5"}),te(t.event_time),t.end_time&&` â ${te(t.end_time)}`]}),t.is_all_day&&e.jsx(He,{variant:"outline",className:"text-[9px] h-4 px-1",children:"All Day"}),e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:Ke(t)})]}),!a&&t.client_name&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 flex items-center gap-1",children:[e.jsx(Ve,{className:"h-2.5 w-2.5"}),t.client_name]}),!a&&t.location&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 flex items-center gap-1",children:[e.jsx(pe,{className:"h-2.5 w-2.5"}),t.location]}),!a&&t.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:t.description})]}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:l=>l.stopPropagation(),children:[e.jsx(Re,{compact:!0,itemType:t.source_type==="task"?"task":"event",itemId:t.id,itemTitle:t.title,eventTime:(()=>{const l=D(t.event_date);if(t.event_time){const[u,c]=t.event_time.split(":").map(Number);l.setHours(u,c,0,0)}return l})()}),s&&s.source_type==="manual"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>Me(s),className:"p-1 rounded hover:bg-accent","aria-label":"Edit event",children:e.jsx(Be,{className:"h-3 w-3 text-muted-foreground"})}),e.jsx("button",{onClick:()=>Ce(t),className:"p-1 rounded hover:bg-accent","aria-label":"Duplicate event",children:e.jsx(Fe,{className:"h-3 w-3 text-muted-foreground"})}),e.jsx("button",{onClick:()=>Ee(t.id),className:"p-1 rounded hover:bg-destructive/20","aria-label":"Delete event",children:e.jsx(We,{className:"h-3 w-3 text-destructive"})})]})]})]})},t.id)},yt=()=>e.jsxs("div",{className:m("widget-card p-3 sm:p-4",x?"w-full":"flex-1 min-w-0"),children:[e.jsx("div",{className:"grid grid-cols-7 mb-1",children:xa.map(t=>e.jsx("div",{className:"text-center text-[11px] font-medium text-muted-foreground py-1.5",children:t},t))}),e.jsx("div",{className:"grid grid-cols-7 gap-px",children:dt.map(t=>{const a=d(t,"yyyy-MM-dd"),s=_e.get(a)||[],g=z(t,p),l=Ht(t,E),u=ae(t),c=[...new Set(s.map(de=>ge(de)))].slice(0,4);return e.jsxs("button",{onClick:()=>A(t),onDoubleClick:()=>{A(t),T(!0)},className:m("relative flex flex-col items-center justify-start rounded-lg transition-all duration-150","min-h-[44px] sm:min-h-[52px] py-1.5","hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",!l&&"opacity-35",u&&!g&&"bg-accent/60",g&&"ring-2 ring-primary bg-primary/10"),"aria-label":d(t,"EEEE, MMMM d"),children:[e.jsx("span",{className:m("text-sm tabular-nums leading-none",u&&"font-bold text-primary",g&&"font-bold"),children:d(t,"d")}),c.length>0&&e.jsxs("div",{className:"flex items-center gap-[3px] mt-1",children:[c.map((de,Ct)=>e.jsx("span",{className:m("w-[5px] h-[5px] rounded-full",de)},Ct)),s.length>4&&e.jsxs("span",{className:"text-[8px] text-muted-foreground leading-none",children:["+",s.length-4]})]})]},a)})})]}),bt=()=>e.jsxs("div",{className:"widget-card p-3 sm:p-4 flex-1 min-w-0 overflow-hidden",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:mt.map(t=>e.jsxs("button",{onClick:()=>A(t),className:m("text-center py-2 rounded-lg transition-colors","hover:bg-accent/40",z(t,p)&&"bg-primary/10 ring-2 ring-primary",ae(t)&&!z(t,p)&&"bg-accent/60"),children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase",children:d(t,"EEE")}),e.jsx("p",{className:m("text-lg font-semibold tabular-nums",ae(t)&&"text-primary"),children:d(t,"d")}),e.jsx("div",{className:"flex justify-center gap-[2px] mt-1",children:(_e.get(d(t,"yyyy-MM-dd"))||[]).slice(0,3).map((a,s)=>e.jsx("span",{className:m("w-1 h-1 rounded-full",ge(a))},s))})]},d(t,"yyyy-MM-dd")))}),e.jsx(ue,{className:"h-[320px]",children:e.jsx("div",{className:"space-y-1",children:ze.filter(t=>t>=6&&t<=22).map(t=>{`${t.toString().padStart(2,"0")}`;const a=k.filter(s=>s.event_time?parseInt(s.event_time.split(":")[0])===t:!1);return e.jsxs("div",{className:"flex gap-2 min-h-[40px]",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground w-12 shrink-0 pt-1 text-right tabular-nums",children:d(Ue(new Date,t),"h a")}),e.jsx("div",{className:"flex-1 border-t border-border/30 pt-1 space-y-0.5",children:a.map(s=>e.jsx("div",{className:"text-xs",children:V(s,!0)},s.id))})]},t)})})})]}),_t=()=>e.jsxs("div",{className:"widget-card p-3 sm:p-4 flex-1 min-w-0",children:[e.jsxs("div",{className:"mb-3 text-center",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:d(p,"EEEE")}),e.jsx("p",{className:"text-3xl font-bold text-foreground tabular-nums",children:d(p,"d")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d(p,"MMMM yyyy")})]}),e.jsxs(ue,{className:"h-[400px]",children:[k.filter(t=>t.is_all_day).length>0&&e.jsxs("div",{className:"mb-3 pb-3 border-b border-border/50",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase mb-1.5",children:"All Day"}),e.jsx("div",{className:"space-y-1",children:k.filter(t=>t.is_all_day).map(t=>V(t))})]}),e.jsx("div",{className:"space-y-0",children:ze.filter(t=>t>=6&&t<=22).map(t=>{const a=k.filter(s=>!s.event_time||s.is_all_day?!1:parseInt(s.event_time.split(":")[0])===t);return e.jsxs("div",{className:"flex gap-3 min-h-[48px] group/hour",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground w-14 shrink-0 pt-1 text-right tabular-nums font-medium",children:d(Ue(new Date,t),"h:mm a")}),e.jsx("div",{className:m("flex-1 border-t border-border/30 pt-1 space-y-1 min-h-[48px]","hover:bg-accent/10 rounded-r-lg transition-colors cursor-pointer"),onClick:()=>{f(s=>({...s,event_time:`${t.toString().padStart(2,"0")}:00`})),T(!0)},children:a.map(s=>V(s))})]},t)})})]})]}),Nt=()=>e.jsx("div",{className:"widget-card p-4 flex-1 min-w-0",children:Ne.length>0?e.jsx(ue,{className:"h-[500px]",children:e.jsx("div",{className:"space-y-4",children:Ne.map(t=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:t.label}
6),e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:d(t.date,"MMM d")}),e.jsx(He,{variant:"outline",className:"text-[9px] h-4 px-1 ml-auto",children:t.events.length})]}),e.jsx("div",{className:"space-y-1.5",children:t.events.map(a=>V(a))})]},t.label))})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(q,{className:"h-10 w-10 text-muted-foreground/20 mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No upcoming events"}),e.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Add events to see your agenda"})]})}),wt=()=>e.jsxs("div",{className:m("widget-card p-4 flex flex-col",x?"w-full":"w-[340px] shrink-0"),children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:d(p,"EEEE")}),e.jsx("p",{className:"text-2xl font-bold text-foreground tabular-nums leading-tight",children:d(p,"MMMM d")}),k.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[k.length," item",k.length!==1?"s":""]})]}),e.jsx("div",{className:"flex-1 space-y-1.5 overflow-y-auto max-h-[320px] sm:max-h-[400px]",children:k.length>0?k.map(t=>V(t)):e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(q,{className:"h-8 w-8 text-muted-foreground/20 mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No events"}),e.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:"Double-click a date or type below"})]})}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50 flex gap-1.5",children:[e.jsx(_,{ref:rt,value:ie,onChange:t=>ye(t.target.value),onKeyDown:t=>t.key==="Enter"&>(),placeholder:"Quick add eventâ¦",className:"h-8 text-sm flex-1"}),e.jsx(b,{size:"sm",variant:"ghost",className:"h-8 px-2 shrink-0",onClick:()=>T(!0),"aria-label":"Add with details",children:e.jsx($e,{className:"h-4 w-4"})})]})]}),kt=()=>h==="month"?d(E,"MMMM yyyy"):h==="week"?`${d(P,"MMM d")} â ${d(ee(P,6),"MMM d, yyyy")}`:h==="day"?d(p,"EEEE, MMMM d, yyyy"):"Agenda";return e.jsxs("div",{className:"p-3 sm:p-4 space-y-4 animate-fade-in",children:[e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-1",children:[{label:"Today",value:ut,icon:q,accent:"text-primary"},{label:"This Week",value:xt,icon:Pe,accent:"text-blue-500"},{label:"Pending",value:ht,icon:he,accent:"text-amber-500"}].map(t=>e.jsxs("div",{className:"widget-card px-4 py-3 flex items-center gap-3 min-w-[140px]",children:[e.jsx(t.icon,{className:m("h-5 w-5 shrink-0",t.accent)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-bold text-foreground tabular-nums leading-tight",children:t.value}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:t.label})]})]},t.label))}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"ghost",size:"icon",onClick:ft,"aria-label":"Previous",children:e.jsx(zt,{className:"h-5 w-5"})}),e.jsx("h2",{className:"text-lg sm:text-xl font-semibold text-foreground tabular-nums min-w-[180px] text-center",children:kt()}),e.jsx(b,{variant:"ghost",size:"icon",onClick:vt,"aria-label":"Next",children:e.jsx(qt,{className:"h-5 w-5"})}),e.jsx(b,{variant:"outline",size:"sm",className:"text-xs h-7",onClick:jt,children:"Today"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rt,{value:h,onValueChange:t=>re(t),children:e.jsxs(Lt,{className:"h-8",children:[e.jsxs(J,{value:"month",className:"text-xs px-2.5 h-6",children:[e.jsx(Pe,{className:"h-3 w-3 mr-1"}),"Month"]}),e.jsxs(J,{value:"week",className:"text-xs px-2.5 h-6",children:[e.jsx(Kt,{className:"h-3 w-3 mr-1"}),"Week"]}),e.jsxs(J,{value:"day",className:"text-xs px-2.5 h-6",children:[e.jsx(Gt,{className:"h-3 w-3 mr-1"}),"Day"]}),e.jsxs(J,{value:"agenda",className:"text-xs px-2.5 h-6",children:[e.jsx(Qt,{className:"h-3 w-3 mr-1"}),"Agenda"]}
6)]})}),e.jsxs(b,{size:"sm",onClick:()=>T(!0),className:"gap-1.5",children:[e.jsx($e,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Add"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[e.jsx(Yt,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(_,{value:G,onChange:t=>at(t.target.value),placeholder:"Search events, appointments, tasksâ¦",className:"h-8 text-sm pl-8"})]}),e.jsxs(B,{value:H,onValueChange:st,children:[e.jsxs(F,{className:"h-8 w-[140px] text-xs",children:[e.jsx(Xt,{className:"h-3 w-3 mr-1"}),e.jsx(W,{})]}),e.jsxs(U,{children:[e.jsx(v,{value:"all",children:"All Types"}),se.map(t=>e.jsx(v,{value:t.value,children:t.label},t.value)),e.jsx(v,{value:"tasks",children:"Tasks"}),e.jsx(v,{value:"habits",children:"Habits"})]})]})]}),e.jsxs("div",{className:m("flex gap-4",x?"flex-col":"flex-row"),children:[h==="month"&&yt(),h==="week"&&bt(),h==="day"&&_t(),h==="agenda"&&Nt(),h!=="agenda"&&wt()]}),e.jsx("div",{className:"widget-card p-3",children:e.jsxs("div",{className:"flex flex-wrap gap-3",children:[se.map(t=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:m("w-2 h-2 rounded-full",Je[t.value])}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:t.label})]},t.value)),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-rose-500"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Task"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Done"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-teal-500"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Habit"})]})]})}),e.jsx(Se,{open:ot,onOpenChange:$,children:e.jsxs(Te,{className:"sm:max-w-md",children:[e.jsxs(Ie,{children:[e.jsx(Oe,{className:"flex items-center gap-2",children:i&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:m("w-3 h-3 rounded-full shrink-0",ge(i))}),i.title]})}),e.jsxs(Ae,{children:[i&&Ke(i)," â ",i&&d(D(i.event_date),"EEEE, MMMM d, yyyy")]})]}),i&&e.jsxs("div",{className:"space-y-3 pt-2",children:[(i.event_time||i.is_all_day)&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(he,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{children:i.is_all_day?"All Day":e.jsxs(e.Fragment,{children:[te(i.event_time),i.end_time&&` â ${te(i.end_time)}`,i.duration_minutes&&e.jsxs("span",{className:"text-muted-foreground ml-1",children:["(",Ge(i.duration_minutes),")"]})]})})]}),i.status&&i.source_type==="manual"&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Zt,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("div",{className:"flex gap-1.5",children:qe.map(t=>e.jsx("button",{onClick:()=>pt(i.id,t.value),className:m("px-2 py-0.5 rounded-full text-xs transition-colors",i.status===t.value?"bg-primary text-primary-foreground":"bg-muted hover:bg-accent text-muted-foreground"),children:t.label},t.value))})]}),i.client_name&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{children:i.client_name}),i.client_email&&e.jsx("a",{href:`mailto:${i.client_email}`,className:"text-primary text-xs hover:underline",children:i.client_email})]}),i.location&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(pe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{children:i.location})]}),i.description&&e.jsx("div",{className:"text-sm text-muted-foreground bg-muted/30 rounded-lg p-3",children:i.description}),i.source_type==="manual"&&e.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/50",children:[e.jsxs(b,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>{const t=le.find(a=>a.id===i.id);t&&(Me(t),$(!1))},children:[e.jsx(Be,{className:"h-3.5 w-3.5 mr-1"})," Edit"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{Ce(i),$(!1)},children:[e.jsx(Fe,{className:"h-3.5 w-3.5 mr-1"})," Duplicate"]}),e.jsx(b,{variant:"destructive",size:"sm",onClick:()=>{Ee(i.id),$(!1)},children:e.jsx(We,{className:"h-3.5 w-3.5"})})]})]})]})}),e.jsx(Se,{open:nt,onOpenChange:T,children:e.jsxs(Te,{className:"sm:max-w-lg max-h-[85vh] overflow-y-auto",children:[e.jsxs(Ie,{children:[e.jsxs(Oe,{className:"flex items-center gap-2",children:["New Item â ",d(p,"MMM d")]}),e.jsx(Ae,{children:"Create an event, appointment, task, or habit."})]}),e.jsxs("div",{className:"space-y-4 pt-1",children:[e.jsx("div",{className:"flex gap-2",children:[{value:"event",label:"Event",icon:q,color:"bg-orange-500"},{value:"task",label:"Task",icon:Jt,color:"bg-rose-500"},{value:"habit",label:"Habit",icon:ea,color:"bg-teal-500"}].map(t=>e.jsxs("button",{onClick:()=>lt(t.value),className:m("flex-1 flex flex-col items-center gap-1.5 p-3 rounded-lg border-2 transition-all",y===t.value?"border-primary bg-primary/10":"border-border hover:border-muted-foreground
6/30 hover:bg-accent/30"),children:[e.jsx("div",{className:m("w-8 h-8 rounded-full flex items-center justify-center",t.color),children:e.jsx(t.icon,{className:"h-4 w-4 text-white"})}),e.jsx("span",{className:"text-xs font-medium text-foreground",children:t.label})]},t.value))}),y==="event"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Category"}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:se.map(t=>e.jsxs("button",{onClick:()=>f(a=>({...a,event_category:t.value})),className:m("flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs border transition-all",n.event_category===t.value?"border-primary bg-primary/10 font-medium":"border-border hover:bg-accent/30"),children:[e.jsx(t.icon,{className:"h-3 w-3"}),t.label]},t.value))})]}),e.jsx(_,{value:n.title,onChange:t=>f(a=>({...a,title:t.target.value})),placeholder:"Event title",autoFocus:!0,onKeyDown:t=>t.key==="Enter"&&n.title.trim()&&Z()}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm text-foreground",children:"All Day"}),e.jsx(De,{checked:n.is_all_day,onCheckedChange:t=>f(a=>({...a,is_all_day:t}))})]}),!n.is_all_day&&e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Start Time"}),e.jsx(_,{type:"time",value:n.event_time,onChange:t=>f(a=>({...a,event_time:t.target.value})),className:"h-9"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"End Time"}),e.jsx(_,{type:"time",value:n.end_time,onChange:t=>f(a=>({...a,end_time:t.target.value})),className:"h-9"})]})]}),!n.is_all_day&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Duration"}),e.jsxs(B,{value:n.duration_minutes.toString(),onValueChange:t=>f(a=>({...a,duration_minutes:parseInt(t)})),children:[e.jsx(F,{className:"h-9",children:e.jsx(W,{})}),e.jsx(U,{children:ha.map(t=>e.jsx(v,{value:t.toString(),children:Ge(t)},t))})]})]}),(n.event_category==="appointment"||n.event_category==="meeting"||n.event_category==="call")&&e.jsxs("div",{className:"space-y-2 p-3 rounded-lg bg-muted/30 border border-border/50",children:[e.jsxs("p",{className:"text-xs font-medium text-muted-foreground flex items-center gap-1",children:[e.jsx(Ze,{className:"h-3 w-3"})," Client / Contact Details"]}),e.jsx(_,{value:n.client_name,onChange:t=>f(a=>({...a,client_name:t.target.value})),placeholder:"Client name",className:"h-8 text-sm"}),e.jsx(_,{value:n.client_email,onChange:t=>f(a=>({...a,client_email:t.target.value})),placeholder:"Client email",type:"email",className:"h-8 text-sm"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(pe,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(_,{value:n.location,onChange:t=>f(a=>({...a,location:t.target.value})),placeholder:"Location (optional)",className:"pl-8"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Status"}),e.jsxs(B,{value:n.status,onValueChange:t=>f(a=>({...a,status:t})),children:[e.jsx(F,{className:"h-9",children:e.jsx(W,{})}),e.jsx(U,{children:qe.map(t=>e.jsx(v,{value:t.value,children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:m("w-2 h-2 rounded-full",t.color)}),t.label]})},t.value))})]})]}),e.jsx(Re,{itemType:"event",itemId:`new-event-${d(p,"yyyy-MM-dd")}`,itemTitle:n.title||"Untitled Event",eventTime:(()=>{const t=new Date(p);if(n.event_time){const[a,s]=n.event_time.split(":").map(Number);t.setHours(a,s,0,0)}return t})()}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"text-sm text-foreground flex items-center gap-1.5",children:[e.jsx(ia,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Recurring"]}),e.jsx(De,{checked:n.is_recurring,onCheckedChange:t=>f(a=>({...a,is_recurring:t}))})]}),n.is_recurring&&e.jsxs(B,{value:n.recurrence_rule,onValueChange:t=>f(a=>({...a,recurrence_rule:t})),children:[e.jsx(F,{className:"h-9",children:e.jsx(W,{placeholder:"Repeat frequency"})}),e.jsxs(U,{children:[e.jsx(v,{value:"daily",children:"Every Day"}),e.jsx(v,{value:"weekdays",children:"Every Weekday"}),e.jsx(v,{value:"weekly",children:"Every Week"}),e.jsx(v,{value:"biweekly",children:"Every 2 Weeks"}),e.jsx(v,{value:"monthly",children:"Every Month"})]})]}),e.jsx(me,{value:n.description,onChange:t=>f(a=>({...a,description:t.target.value})),placeholder:"Notes or description (optional)",rows:3})]}),y==="task"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(_,{value:N.name,onChange:t=>Q(a=>({...a,name:t.target.value})),placeholder:"Task name",autoFocus:!0,onKeyDown:t=>t.key==="Enter"&&N.name.trim()&&Z()}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Priority"}),e.jsxs(B,{value:N.priority,onValueChange:t=>Q(a=>({...a,priority:t})),children:[e.jsx(F,{className:"h-9",children:e.jsx(W,{})}),e.jsxs(U,{children:[e.jsx(v,{value:"low",children:"Low"}),e.jsx(v,{value:"medium",children:"Medium"}),e.jsx(v,{value:"high",children:"High"}),e.jsx(v,{value:"urgent",children:"Urgent"})]})]})]}),e.jsx(me,{value:N.notes,onChange:t=>Q(a=>({...a,notes:t.target.value})),placeholder:"Notes (optional)",rows:2})]}),y==="habit"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(_,{value:R.name,onChange:t=>oe(a=>({...a,name:t.target.value}
6)),placeholder:"Habit name (e.g. Meditate, Read)",autoFocus:!0,onKeyDown:t=>t.key==="Enter"&&R.name.trim()&&Z()}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Color"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:["#3b82f6","#ef4444","#22c55e","#f59e0b","#64748b","#ec4899","#14b8a6","#f97316"].map(t=>e.jsx("button",{onClick:()=>oe(a=>({...a,color:t})),className:m("w-8 h-8 rounded-full transition-all",R.color===t?"ring-2 ring-offset-2 ring-offset-background ring-primary scale-110":"hover:scale-105"),style:{backgroundColor:t},"aria-label":`Color ${t}`},t))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This creates a new recurring habit. Track it daily from the Habit Studio."})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[e.jsx(b,{variant:"outline",onClick:()=>T(!1),children:"Cancel"}),e.jsx(b,{onClick:Z,disabled:y==="event"&&!n.title.trim()||y==="task"&&!N.name.trim()||y==="habit"&&!R.name.trim(),children:y==="event"?n.event_category==="appointment"?"Book Appointment":"Add Event":y==="task"?"Add Task":"Create Habit"})]})]})]})})]})}export{Zs as Calendar};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.