@innosolutions/inno-calendar 1.0.24 → 1.0.25
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/dist/agenda-widget-CDJexPK9.cjs +2 -0
- package/dist/agenda-widget-CDJexPK9.cjs.map +1 -0
- package/dist/{agenda-dropdown-BDK-0ji0.js → agenda-widget-DwAEgsqg.js} +2264 -2368
- package/dist/agenda-widget-DwAEgsqg.js.map +1 -0
- package/dist/components/calendar.d.ts +3 -1
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/event/event-card.d.ts.map +1 -1
- package/dist/components/event/event-popover.d.ts.map +1 -1
- package/dist/components/event/index.d.ts +2 -2
- package/dist/components/event/index.d.ts.map +1 -1
- package/dist/components/filters/calendar-filter-sidebar.d.ts +1 -1
- package/dist/components/filters/calendar-filter-sidebar.d.ts.map +1 -1
- package/dist/components/filters/index.d.ts +3 -3
- package/dist/components/filters/index.d.ts.map +1 -1
- package/dist/components/filters/schedule-type-filter.d.ts.map +1 -1
- package/dist/components/filters/user-filter.d.ts.map +1 -1
- package/dist/components/header/calendar-header.d.ts +1 -1
- package/dist/components/header/calendar-header.d.ts.map +1 -1
- package/dist/components/header/components/date-navigator.d.ts +1 -1
- package/dist/components/header/components/date-navigator.d.ts.map +1 -1
- package/dist/components/header/components/index.d.ts +1 -1
- package/dist/components/header/components/index.d.ts.map +1 -1
- package/dist/components/header/components/today-button.d.ts.map +1 -1
- package/dist/components/header/index.d.ts +1 -1
- package/dist/components/header/index.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +9 -11
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/inno-calendar.d.ts +7 -3
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/components/integrated-calendar.d.ts +2 -2
- package/dist/components/integrated-calendar.d.ts.map +1 -1
- package/dist/components/primitives/calendar-timeline.d.ts +1 -1
- package/dist/components/primitives/calendar-timeline.d.ts.map +1 -1
- package/dist/components/primitives/index.d.ts +2 -2
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/multi-day-banner.d.ts.map +1 -1
- package/dist/components/primitives/selectable-slot.d.ts.map +1 -1
- package/dist/components/settings/badge-variant-setting.d.ts.map +1 -1
- package/dist/components/settings/index.d.ts +2 -2
- package/dist/components/settings/index.d.ts.map +1 -1
- package/dist/components/settings/slot-duration-setting.d.ts.map +1 -1
- package/dist/components/settings/visible-hours-setting.d.ts.map +1 -1
- package/dist/components/settings/working-hours-setting.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +3 -3
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/views/agenda-view.d.ts +6 -2
- package/dist/components/views/agenda-view.d.ts.map +1 -1
- package/dist/components/views/day-view.d.ts +6 -2
- package/dist/components/views/day-view.d.ts.map +1 -1
- package/dist/components/views/index.d.ts +3 -3
- package/dist/components/views/index.d.ts.map +1 -1
- package/dist/components/views/month-view.d.ts +6 -2
- package/dist/components/views/month-view.d.ts.map +1 -1
- package/dist/components/views/timeline-view.d.ts +6 -2
- package/dist/components/views/timeline-view.d.ts.map +1 -1
- package/dist/components/views/week-view.d.ts +6 -2
- package/dist/components/views/week-view.d.ts.map +1 -1
- package/dist/components/views/year-view.d.ts +6 -2
- package/dist/components/views/year-view.d.ts.map +1 -1
- package/dist/components/widget/agenda-dropdown.d.ts.map +1 -1
- package/dist/components/widget/agenda-widget.d.ts.map +1 -1
- package/dist/components/widget/index.d.ts +1 -1
- package/dist/components/widget/index.d.ts.map +1 -1
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/context/calendar-context.d.ts.map +1 -1
- package/dist/core/context/drag-drop-context.d.ts.map +1 -1
- package/dist/core/context/index.d.ts +32 -4
- package/dist/core/context/index.d.ts.map +1 -1
- package/dist/core/context/inno-calendar-provider.d.ts +1 -1
- package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
- package/dist/core/context/slot-selection-context.d.ts.map +1 -1
- package/dist/core/hooks/index.d.ts +4 -4
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/use-calendar-time-config.d.ts +1 -1
- package/dist/core/hooks/use-calendar-time-config.d.ts.map +1 -1
- package/dist/core/hooks/use-calendar.d.ts +1 -1
- package/dist/core/hooks/use-calendar.d.ts.map +1 -1
- package/dist/core/hooks/use-preferences.d.ts.map +1 -1
- package/dist/core/hooks/use-slot-selection.d.ts +1 -1
- package/dist/core/hooks/use-slot-selection.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.mjs +3 -3
- package/dist/core/preferences/index.d.ts +1 -1
- package/dist/core/preferences/index.d.ts.map +1 -1
- package/dist/core/preferences/use-preferences.d.ts.map +1 -1
- package/dist/core/types.d.ts +447 -31
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utils/date-utils.d.ts.map +1 -1
- package/dist/core/utils/event-utils.d.ts.map +1 -1
- package/dist/core/utils/grid-utils.d.ts +1 -1
- package/dist/core/utils/grid-utils.d.ts.map +1 -1
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/core/utils/index.d.ts.map +1 -1
- package/dist/core/utils/position-utils.d.ts.map +1 -1
- package/dist/index-D2U2F80P.cjs.map +1 -1
- package/dist/index-DtaLkIY8.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/position-utils-Bi80HkY-.cjs +2 -0
- package/dist/position-utils-Bi80HkY-.cjs.map +1 -0
- package/dist/{slot-selection-context-CMaE5Bc5.js → position-utils-CwX4IQ9m.js} +534 -530
- package/dist/position-utils-CwX4IQ9m.js.map +1 -0
- package/dist/presets/default/default-calendar.d.ts +2 -2
- package/dist/presets/default/default-calendar.d.ts.map +1 -1
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.d.ts +1 -1
- package/dist/presets/index.d.ts.map +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/presets/tailwind/index.d.ts +1 -1
- package/dist/presets/tailwind/index.d.ts.map +1 -1
- package/dist/presets/tailwind/tailwind-calendar.d.ts +1 -1
- package/dist/presets/tailwind/tailwind-calendar.d.ts.map +1 -1
- package/dist/tailwind-calendar-DxOjg158.cjs +2 -0
- package/dist/tailwind-calendar-DxOjg158.cjs.map +1 -0
- package/dist/{tailwind-calendar-BEf7QDjd.js → tailwind-calendar-DyvUGcCA.js} +34 -48
- package/dist/tailwind-calendar-DyvUGcCA.js.map +1 -0
- package/dist/use-calendar-CTYykR0V.cjs +2 -0
- package/dist/use-calendar-CTYykR0V.cjs.map +1 -0
- package/dist/{inno-calendar-provider-CbnwQSuI.js → use-calendar-DZVNN1K8.js} +169 -189
- package/dist/use-calendar-DZVNN1K8.js.map +1 -0
- package/dist/use-slot-selection-8u0Z2jmt.cjs +2 -0
- package/dist/use-slot-selection-8u0Z2jmt.cjs.map +1 -0
- package/dist/{use-calendar-time-config-C_ZU8YAc.js → use-slot-selection-C4dA6jPx.js} +105 -108
- package/dist/use-slot-selection-C4dA6jPx.js.map +1 -0
- package/dist/week-view-CenonWxt.cjs +11 -0
- package/dist/week-view-CenonWxt.cjs.map +1 -0
- package/dist/week-view-D78ZaGY7.js +2550 -0
- package/dist/week-view-D78ZaGY7.js.map +1 -0
- package/package.json +1 -1
- package/dist/agenda-dropdown-BDK-0ji0.js.map +0 -1
- package/dist/agenda-dropdown-CyAJoG_P.cjs +0 -2
- package/dist/agenda-dropdown-CyAJoG_P.cjs.map +0 -1
- package/dist/agenda-view-5sPzr1GA.js +0 -2467
- package/dist/agenda-view-5sPzr1GA.js.map +0 -1
- package/dist/agenda-view-BhD-XJn-.cjs +0 -11
- package/dist/agenda-view-BhD-XJn-.cjs.map +0 -1
- package/dist/inno-calendar-provider-CEO8ZyR2.cjs +0 -2
- package/dist/inno-calendar-provider-CEO8ZyR2.cjs.map +0 -1
- package/dist/inno-calendar-provider-CbnwQSuI.js.map +0 -1
- package/dist/slot-selection-context-BnE5w6aV.cjs +0 -2
- package/dist/slot-selection-context-BnE5w6aV.cjs.map +0 -1
- package/dist/slot-selection-context-CMaE5Bc5.js.map +0 -1
- package/dist/tailwind-calendar-BEf7QDjd.js.map +0 -1
- package/dist/tailwind-calendar-Cur19bSK.cjs +0 -2
- package/dist/tailwind-calendar-Cur19bSK.cjs.map +0 -1
- package/dist/use-calendar-time-config-C_ZU8YAc.js.map +0 -1
- package/dist/use-calendar-time-config-bm7Fn31s.cjs +0 -2
- package/dist/use-calendar-time-config-bm7Fn31s.cjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),Z=require("./use-calendar-CTYykR0V.cjs"),y=require("react"),x=require("./index-D2U2F80P.cjs"),g=require("./week-view-CenonWxt.cjs"),H=require("./position-utils-Bi80HkY-.cjs");function Ee({view:t,className:s=""}){return e.jsx("div",{className:s,style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"400px",backgroundColor:"#f9fafb",borderRadius:"0.5rem",border:"1px dashed #d1d5db"},children:e.jsxs("div",{style:{textAlign:"center",color:"#6b7280"},children:[e.jsxs("p",{style:{fontSize:"1.125rem",fontWeight:500},children:[t.charAt(0).toUpperCase()+t.slice(1)," View"]}),e.jsx("p",{style:{fontSize:"0.875rem"},children:"Implementation pending"})]})})}function he({view:t,className:s}){return e.jsx(Ee,{view:t,className:s})}function ze(t){const{events:s,resources:n,scheduleTypes:r,initialView:o="week",initialDate:i,initialFilters:m,preferences:h,locale:a,slots:d,renderEvent:M,onViewChange:N,onDateChange:C,onEventClick:z,onSlotSelect:j,onFiltersChange:b,className:w,children:k}=t,D=Z.useOptionalCalendarContext();if(D)return e.jsx("div",{className:w,style:{position:"relative"},children:k??e.jsx(he,{view:D.view,className:w})});const E=Z.useCalendar({events:s,resources:n,scheduleTypes:r,initialView:o,initialDate:i,initialFilters:m,preferences:h,locale:a,onViewChange:N,onDateChange:C,onEventClick:z,onSlotSelect:j,onFiltersChange:b});return e.jsx(Z.CalendarProvider,{value:E,children:e.jsx("div",{className:w,style:{position:"relative"},children:k??e.jsx(he,{view:E.view,className:w})})})}function Le({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}),e.jsx("path",{d:"m15 5 4 4"})]})}function Me({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M3 6h18"}),e.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),e.jsx("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),e.jsx("line",{x1:"14",x2:"14",y1:"11",y2:"17"})]})}function oe({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})}function He({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m4.9 4.9 14.2 14.2"})]})}function te({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}function Ie({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m9 12 2 2 4-4"})]})}function We({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Fe({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function Pe({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"}),e.jsx("circle",{cx:"12",cy:"10",r:"3"})]})}function Be({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"})]})}function Ae({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),e.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),e.jsx("path",{d:"M10 9H8"}),e.jsx("path",{d:"M16 13H8"}),e.jsx("path",{d:"M16 17H8"})]})}function Q({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:x.cn("animate-spin",t),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}const _e={edit:"Edit",delete:"Delete",cancel:"Cancel Event",close:"Close",going:"Going",notGoing:"Not Going",confirmMeeting:"Confirm meeting took place",completed:"Completed",canceled:"Canceled",participants:"Participants",guest:"guest",guests:"guests",confirmed:"confirmed",organizer:"Organizer",client:"Client",more:"more",noDateProvided:"No date provided",eventNotFound:"Event not found",cancellationNote:"Cancellation Note",canceledOn:"Canceled on",acceptThisEvent:"Accept this event only",acceptAllEvents:"Accept all events",deleteConfirmTitle:"Delete Event",deleteConfirmDescription:"Are you sure you want to delete this event? This action cannot be undone."},se=y.forwardRef(({onClick:t,label:s,children:n,className:r,variant:o="ghost",...i},m)=>e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{asChild:!0,children:e.jsx("button",{type:"button",ref:m,onClick:t,className:x.cn("h-8 w-8 rounded-full flex items-center justify-center transition-colors",o==="ghost"&&"hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",o==="destructive"&&"hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",r),"aria-label":s,...i,children:n})}),e.jsx(g.TooltipContent,{side:"bottom",className:"text-xs",children:s})]}));se.displayName="IconButton";function Oe({src:t,alt:s,initials:n,className:r,isClient:o}){const[i,m]=y.useState(!1);return e.jsx("div",{className:x.cn("relative h-7 w-7 rounded-full overflow-hidden shrink-0",r),children:t&&!i?e.jsx("img",{src:t,alt:s,className:"h-full w-full object-cover",onError:()=>m(!0)}):e.jsx("div",{className:x.cn("h-full w-full flex items-center justify-center text-[10px] font-medium",o?"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300":"bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"),children:n})})}function me({participant:t,isEventCanceled:s=!1,labels:n}){const r=t.name||"Unknown",o=r.split(" ").map(C=>C[0]).join("").toUpperCase().slice(0,2),i=t.isOrganizer??!1,m=t.isConfirmed,h=m===!0,a=m===!1,d=t.isClient??!1,M=t.profilePicture||t.avatar,N=s;return e.jsxs("div",{className:x.cn("flex items-center gap-3 py-0",N&&"opacity-60"),children:[e.jsxs("div",{className:"relative",children:[e.jsx(Oe,{src:M,alt:r,initials:o,isClient:d,className:x.cn(N&&"grayscale")}),N||a?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center",children:e.jsx("div",{className:"h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center",children:e.jsx(oe,{className:"h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]"})})}):h?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center",children:e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center",children:e.jsx(te,{className:"h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]"})})}):null]}),e.jsxs("div",{className:"!h-fit min-w-0 gap-0",children:[e.jsx("div",{className:"gap-0",children:e.jsx("span",{className:x.cn("text-sm text-zinc-900 dark:text-zinc-100 truncate",N&&"line-through text-zinc-500 dark:text-zinc-500"),children:r})}),d&&e.jsx("div",{className:"text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium",children:n.client}),i&&!N&&e.jsx("div",{className:"text-xs text-zinc-500",children:n.organizer})]})]})}function $e({open:t,onOpenChange:s,title:n,children:r}){return y.useEffect(()=>{if(!t)return;const o=i=>{i.key==="Escape"&&s(!1)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t,s]),y.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),t?e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(!1),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&s(!1)}}),e.jsx("div",{className:"fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden",children:[n&&e.jsx("div",{className:"sr-only",children:n}),r]})})]}):null}function Ve({open:t,onOpenChange:s,title:n,description:r,cancelLabel:o,confirmLabel:i,onConfirm:m,isLoading:h}){return t?e.jsxs("div",{className:"fixed inset-0 z-[60]",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(!1),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&s(!1)}}),e.jsx("div",{className:"fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-100",children:n}),e.jsx("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:r}),e.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[e.jsx(g.Button,{variant:"outline",size:"sm",onClick:()=>s(!1),children:o}),e.jsxs(g.Button,{variant:"destructive",size:"sm",onClick:m,disabled:h,children:[h&&e.jsx(Q,{className:"h-4 w-4 mr-2"}),e.jsx(Me,{className:"h-4 w-4 mr-2"}),i]})]})]})})]}):null}function Re(t,s){return t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}function Ue(t,s){const n={hour:"2-digit",minute:"2-digit",hour12:!1};return`${t.toLocaleTimeString(void 0,n)} – ${s.toLocaleTimeString(void 0,n)}`}function Ye(t){return t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Ge(t){const[s,n]=y.useState(()=>typeof window<"u"?window.matchMedia(t).matches:!1);return y.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(t),o=i=>n(i.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[t]),s}function fe({event:t,labels:s,isLoading:n,onClose:r,onEdit:o,onDelete:i,onCancel:m,onAccept:h,onDecline:a,onConfirmMeeting:d,canEdit:M=!0,canDelete:N=!1,canCancel:C=!0,isCurrentUserParticipant:z=!1,isCurrentUserClient:j=!1,currentUserAcceptStatus:b,isAcceptLoading:w=!1,isDeclineLoading:k=!1,isConfirmLoading:D=!1,isDeleteLoading:E=!1,renderParticipant:L,renderHeaderActions:A,renderCancelReason:I,renderDeleteConfirmation:P,formatDate:B=Re,formatTimeRange:W=Ue}){const[F,O]=y.useState(!1),V=!(t.isCanceled||t.meetingTookPlace),f=t.isRecurring??!1,l=t.participantDetails,u=t.participantsNames||[],p=l&&l.length>0,c=b===!0,v=b===!1,T=z&&!j&&V,S=p?l.filter(_=>_.isConfirmed).length:t.isAccepted?u.length:0,$=p?l.length:u.length,K=t.scheduleTypeColor||t.hexColor||"#039BE5",R=y.useCallback(()=>t.startDate?B(t.startDate):s.noDateProvided,[t.startDate,B,s.noDateProvided]),J=y.useCallback(()=>t.startDate&&t.endDate?W(t.startDate,t.endDate):null,[t.startDate,t.endDate,W]),ne=()=>{r(),o?.(t)},re=()=>{r(),m?.(t)},q=()=>{O(!0)},G=()=>{i?.(t),O(!1)};return n?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(Q,{className:"h-6 w-6 text-zinc-400"})}):e.jsxs(g.TooltipProvider,{delayDuration:300,children:[e.jsxs("div",{className:"flex flex-col gap-0.5 p-3",children:[e.jsx("div",{className:"flex items-start justify-end gap-0.5",children:A?A({onClose:r}):e.jsxs(e.Fragment,{children:[V&&M&&o&&e.jsx(se,{onClick:ne,label:s.edit,children:e.jsx(Le,{className:"h-[18px] w-[18px]"})}),V&&C&&m&&e.jsx(se,{onClick:re,label:s.cancel,children:e.jsx(He,{className:"h-[18px] w-[18px]"})}),N&&i&&e.jsx(se,{onClick:q,label:s.delete,variant:"destructive",children:e.jsx(Me,{className:"h-[18px] w-[18px]"})}),e.jsx(se,{onClick:r,label:s.close,children:e.jsx(oe,{className:"h-[18px] w-[18px]"})})]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded mt-1 shrink-0",style:{backgroundColor:K}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:x.cn("text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",t.isCanceled&&"line-through opacity-60"),children:t.title}),t.meetingTookPlace&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 text-xs font-medium",children:[e.jsx(Ie,{className:"h-3 w-3"}),s.completed]}),t.isCanceled&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 text-xs font-medium",children:[e.jsx(oe,{className:"h-3 w-3"}),s.canceled]})]}),e.jsxs("div",{className:"mt-1 text-sm text-zinc-600 dark:text-zinc-400",children:[e.jsx("span",{children:R()}),J()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1.5",children:"·"}),e.jsx("span",{children:J()})]})]}),f&&t.recurrenceSummary&&e.jsx("div",{className:"text-sm text-zinc-500 dark:text-zinc-500",children:t.recurrenceSummary})]})]})}),t.isCanceled&&e.jsx("div",{className:"mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30",children:I?I(t):e.jsx("div",{className:"flex items-start gap-0",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-red-700 dark:text-red-400",children:s.cancellationNote}),t.cancelReason&&e.jsxs("div",{className:"mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic",children:['"',t.cancelReason,'"']}),t.canceledDate&&e.jsxs("div",{className:"mt-1.5 text-xs text-red-500/70 dark:text-red-400/60",children:[s.canceledOn," ",Ye(t.canceledDate)]})]})})}),e.jsxs("div",{className:"space-y-0.5",children:[t.address&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Pe,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:t.address})]}),(p||u.length>0)&&e.jsxs("div",{className:"flex items-start gap-2 py-0",children:[e.jsx(Fe,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("span",{className:"text-sm text-zinc-900 dark:text-zinc-100 font-medium",children:[$," ",$!==1?s.guests:s.guest]}),$>0&&e.jsxs("span",{className:"text-xs text-zinc-500",children:["(",S," ",s.confirmed,")"]})]}),e.jsxs("div",{className:"mt-2 space-y-2",children:[p?l.slice(0,6).map((_,X)=>L?L(_,X):e.jsx(me,{participant:_,isEventCanceled:t.isCanceled,labels:s},_.id)):u.slice(0,6).map((_,X)=>{const ue={id:String(X),name:_,email:"",isConfirmed:t.isAccepted,isOrganizer:X===0,isClient:!1};return L?L(ue,X):e.jsx(me,{participant:ue,isEventCanceled:t.isCanceled,labels:s},_)}),$>6&&e.jsxs("div",{className:"text-xs text-zinc-500 py-1.5 pl-10",children:["+",$-6," ",s.more]})]})]})]}),t.description&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ae,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm text-zinc-700 dark:text-zinc-300 whitespace-pre-wrap",children:t.description})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Be,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("div",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:p&&l.find(_=>_.isOrganizer)?.name||u[0]||"Calendar"})]})]}),T&&h&&a&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[f?e.jsxs(g.DropdownMenu,{children:[e.jsx(g.DropdownMenuTrigger,{asChild:!0,children:e.jsxs("div",{className:"flex",children:[e.jsx(g.Button,{size:"sm",variant:"outline",className:x.cn("rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",c&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:_=>{_.stopPropagation(),c||h(t)},disabled:w,children:w?e.jsx(Q,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[c&&e.jsx(te,{className:"h-3.5 w-3.5"}),s.going]})}),e.jsx(g.Button,{size:"sm",variant:"outline",className:x.cn("rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",c&&"!bg-green-700 !text-white hover:!bg-green-700"),children:e.jsx(We,{className:"h-3.5 w-3.5"})})]})}),e.jsxs(g.DropdownMenuContent,{align:"start",children:[e.jsxs(g.DropdownMenuItem,{className:x.cn("gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",c&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>h(t),children:[e.jsx(te,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),s.acceptThisEvent]}),e.jsxs(g.DropdownMenuItem,{onClick:()=>h(t),children:[e.jsx(te,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),s.acceptAllEvents]})]})]}):e.jsx(g.Button,{size:"sm",variant:"outline",className:x.cn("gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",c&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>{c||h(t)},disabled:w,children:w?e.jsx(Q,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[c&&e.jsx(te,{className:"h-3.5 w-3.5"}),s.going]})}),e.jsx(g.Button,{size:"sm",variant:"outline",className:x.cn("gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",v&&"!bg-rose-700 !text-white hover:!bg-rose-700"),onClick:()=>{v||a(t)},disabled:k,children:k?e.jsx(Q,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[v&&e.jsx(oe,{className:"h-3.5 w-3.5"}),s.notGoing]})})]})}),z&&c&&!t.meetingTookPlace&&!t.isCanceled&&d&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 py-3",children:e.jsxs(g.Button,{size:"sm",variant:"outline",className:"w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",onClick:()=>d(t),disabled:D,children:[D&&e.jsx(Q,{className:"h-4 w-4 mr-2"}),s.confirmMeeting]})})]}),P?F&&P({onConfirm:G,onCancel:()=>O(!1),isLoading:E}):e.jsx(Ve,{open:F,onOpenChange:O,title:s.deleteConfirmTitle,description:s.deleteConfirmDescription,cancelLabel:s.cancel,confirmLabel:s.delete,onConfirm:G,isLoading:E})]})}function Ke({event:t,children:s,open:n,onOpenChange:r,isLoading:o,labels:i,onEdit:m,onDelete:h,onCancel:a,onAccept:d,onDecline:M,onConfirmMeeting:N,canEdit:C=!0,canDelete:z=!1,canCancel:j=!0,isCurrentUserParticipant:b,isCurrentUserClient:w,currentUserAcceptStatus:k,isAcceptLoading:D,isDeclineLoading:E,isConfirmLoading:L,isDeleteLoading:A,renderParticipant:I,renderHeaderActions:P,renderCancelReason:B,renderDeleteConfirmation:W,formatDate:F,formatTimeRange:O,className:V,width:f=360}){const l=Ge("(min-width: 768px)"),u={..._e,...i},p=y.useCallback(()=>{r?.(!1)},[r]),c={event:t,labels:u,isLoading:o,onClose:p,onEdit:m,onDelete:h,onCancel:a,onAccept:d,onDecline:M,onConfirmMeeting:N,canEdit:C,canDelete:z,canCancel:j,isCurrentUserParticipant:b,isCurrentUserClient:w,currentUserAcceptStatus:k,isAcceptLoading:D,isDeclineLoading:E,isConfirmLoading:L,isDeleteLoading:A,renderParticipant:I,renderHeaderActions:P,renderCancelReason:B,renderDeleteConfirmation:W,formatDate:F,formatTimeRange:O};return l?e.jsxs(g.Popover,{open:n??!1,onOpenChange:r??(()=>{}),children:[e.jsx(g.PopoverTrigger,{asChild:!0,children:s}),e.jsx(g.PopoverContent,{className:x.cn("p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",V),style:{width:f},align:"center",side:"bottom",sideOffset:4,children:e.jsx(fe,{...c})})]}):e.jsxs(e.Fragment,{children:[s,e.jsx($e,{open:n??!1,onOpenChange:r??(()=>{}),title:t.title,children:e.jsx(fe,{...c})})]})}const ae=44,ge=4,Je=56,pe=8,le=80,ee=140,je=100,ve=2,qe=8,Xe=18;function Qe(t){return t.split(" ").map(s=>s[0]).join("").toUpperCase().slice(0,2)}function Ze(t,s){const n=[];for(let r=0;r<s;r++){const o=new Date(t);o.setDate(o.getDate()+r),n.push(o)}return n}function et(t,s,n){const r=[];return t.forEach((o,i)=>{for(let m=s;m<n;m++)r.push({hour:m,dayIndex:i,date:o})}),r}function tt(t){return`${t.toString().padStart(2,"0")}:00`}function st(t){return t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}function we(t){const s=[...t].sort((o,i)=>o.startCol!==i.startCol?o.startCol-i.startCol:i.spanCols-o.spanCols),n=[],r=[];for(const o of s){let i=0;for(;r[i]!==void 0&&r[i]>o.startCol;)i++;r[i]=o.startCol+o.spanCols,n.push({...o,stackIndex:i})}return n}function nt({src:t,alt:s,fallback:n,className:r}){return e.jsx("div",{className:x.cn("relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",r),children:t?e.jsx("img",{src:t,alt:s,className:"aspect-square h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted text-muted-foreground",children:n})})}const rt=7;function ie({daysToShow:t=rt,events:s,users:n=[],selectedDate:r,onDateChange:o,onEventClick:i,visibleHours:m,className:h,getEventUserId:a,renderPopover:d,slots:M,classNames:N}){const C=y.useRef(null),z=r??new Date,j=!0,b=m?.from??qe,w=m?.to??Xe,k=w-b,D=y.useMemo(()=>{const l=new Date(z);if(t===1||t===3)return l.setHours(0,0,0,0),l;const u=l.getDay(),p=u===0?-6:1-u;return l.setDate(l.getDate()+p),l.setHours(0,0,0,0),l},[z,t]),E=y.useMemo(()=>Ze(D,t),[D,t]),L=y.useMemo(()=>et(E,b,w),[j,E,b,w]),I=a??(l=>{if(l.user?.id)return l.user.id;const u=l.data;if(u?.userId)return String(u.userId);if(u?.user&&typeof u.user=="object"&&u.user.id)return String(u.user.id);if(l.participants?.[0]?.id)return l.participants[0].id}),P=y.useMemo(()=>{const l=new Map;for(const u of n)l.set(u.id,{id:u.id,name:u.name,avatar:u.avatar??void 0,email:u.email});for(const u of s){u.user?.id&&!l.has(u.user.id)&&l.set(u.user.id,{id:u.user.id,name:u.user.name,avatar:u.user.avatar??void 0,email:u.user.email});for(const p of u.participants||[])p.id&&!l.has(p.id)&&l.set(p.id,{id:p.id,name:p.name,avatar:p.avatar??void 0,email:p.email})}return Array.from(l.values())},[n,s]),B=y.useMemo(()=>{const l=[],u=new Map;for(const v of P)u.set(v.id,[]);u.set("unassigned",[]);for(const v of s){const T=I(v)??"unassigned";(u.get(T)??u.get("unassigned")).push(v)}const p=v=>{const T=[];for(const S of v){const $=S.startDate.getHours()+S.startDate.getMinutes()/60,K=S.endDate.getHours()+S.endDate.getMinutes()/60;for(let R=0;R<E.length;R++){const J=E[R],ne=H.startOfDay(J),re=H.endOfDay(J);if(S.startDate<=re&&S.endDate>=ne){let q=b,G=w;if(S.startDate>=ne&&(q=Math.max(b,$)),S.endDate<=re&&(G=Math.min(w,K)),q=Math.max(b,Math.min(w,q)),G=Math.max(b,Math.min(w,G)),G>q){const _=R*k+Math.floor(q-b),X=R*k+Math.ceil(G-b);T.push({event:S,startCol:_,spanCols:Math.max(1,X-_)})}}}}return T};for(const v of P){const T=u.get(v.id)??[],S=p(T),$=we(S),K=$.reduce((R,J)=>Math.max(R,J.stackIndex+1),0);l.push({user:v,events:$,maxStack:Math.max(K,1)})}const c=u.get("unassigned")??[];if(c.length>0){const v=p(c),T=we(v),S=T.reduce(($,K)=>Math.max($,K.stackIndex+1),0);l.push({user:{id:"unassigned",name:"Unassigned",avatar:void 0,email:void 0},events:T,maxStack:Math.max(S,1)})}return l.filter(v=>v.events.length>0)},[P,s,E,j,k,b,w,I]),W=y.useMemo(()=>{const l=new Map;for(const u of B)for(const p of u.events)if(p.spanCols===1){const c=l.get(p.startCol)??0;l.set(p.startCol,c+1)}return l},[B]),F=y.useMemo(()=>{const l=L.length,u=le,p=[];for(let c=0;c<l;c++){const v=W.get(c)??0;v>ve?p.push(je+(v-ve)*20):v>0?p.push(Math.max(u,je)):p.push(u)}return p},[j,L.length,E.length,W]),O=l=>Math.max(Je,l*(ae+ge)+pe*2),V=ee+F.reduce((l,u)=>l+u,0),f=y.useMemo(()=>{const l=[0];for(let u=0;u<F.length;u++)l.push(l[u]+F[u]);return l},[F]);return e.jsx("div",{className:x.cn("flex h-full flex-col",h),children:e.jsx("div",{className:"ic-timeline-scroll-container flex-1",ref:C,children:e.jsxs("div",{className:"relative",style:{minWidth:V},children:[e.jsx("div",{className:"ic-timeline-header sticky top-0 z-20 border-b bg-background",children:e.jsxs("div",{className:"flex flex-col",children:[t>1&&e.jsxs("div",{className:"flex border-b",children:[e.jsx("div",{className:"flex shrink-0 items-center border-r bg-background px-2 py-1",style:{width:ee},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),E.map((l,u)=>{const p=H.isToday(l),c=u*k,v=F.slice(c,c+k).reduce((T,S)=>T+S,0);return e.jsx("div",{className:x.cn("flex shrink-0 items-center justify-center border-r py-1.5 font-medium",p?"bg-primary/10 text-primary":"bg-muted/30"),style:{width:v},children:e.jsx("span",{className:"text-xs",children:st(l)})},`day-${l.toISOString()}`)})]}),e.jsxs("div",{className:"flex",children:[t===1&&e.jsx("div",{className:"flex shrink-0 items-center border-r bg-background px-2 py-2",style:{width:ee},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),t>1&&e.jsx("div",{className:"sticky left-0 z-10 border-r bg-background",style:{width:ee}}),L.map((l,u)=>{const p=l.hour===b,c=H.isToday(l.date),v=F[u]??le;return e.jsx("div",{className:x.cn("flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",p&&u>0?"border-l-2 border-l-border":"border-r border-r-border/50",c&&"bg-primary/5"),style:{width:v},children:tt(l.hour)},`hour-${l.dayIndex}-${l.hour}`)})]})]})}),B.map(l=>{const u=O(l.maxStack);return e.jsxs("div",{className:x.cn("relative flex border-b",N?.resourceRow),style:{height:u},children:[e.jsx("div",{className:"sticky left-0 z-10",style:{width:ee},children:e.jsxs("div",{className:x.cn("flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",N?.resourceHeader),children:[e.jsx(nt,{className:"size-7",src:l.user.avatar,alt:l.user.name,fallback:Qe(l.user.name)}),e.jsx("span",{className:"truncate text-xs sm:text-sm font-medium",children:l.user.name})]})}),e.jsxs("div",{className:"relative flex",children:[L.map((p,c)=>{const v=p.hour===b&&c>0,T=F[c]??le;return e.jsx("div",{className:x.cn("shrink-0",v?"border-l-2 border-l-border":"border-r border-r-border/50",H.isToday(p.date)&&"bg-primary/5"),style:{width:T}},`cell-${p.dayIndex}-${p.hour}`)}),l.events.map(p=>{const c=(f[p.startCol]??0)+2,v=f[p.startCol+p.spanCols]??f[f.length-1]??0,T=f[p.startCol]??0,S=v-T-4,$=pe+p.stackIndex*(ae+ge);return e.jsx("div",{className:"absolute",style:{left:c,width:Math.max(S,0),top:$,height:ae},children:e.jsx(g.EventCard,{event:p.event,variant:"compact",onClick:i,renderPopover:d,className:x.cn("h-full w-full",N?.eventCardCompact)})},p.event.id)})]})]},l.user.id)}),B.length===0&&e.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"No users or events to display"})]})})})}const ot=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],it=["January","February","March","April","May","June","July","August","September","October","November","December"];function be(t){const s=t.hexColor;return s?{backgroundColor:s}:{}}function at({day:t,date:s,events:n,isCurrentMonth:r,onDayClick:o}){const i=H.isToday(s),m=3,h=n.length;return e.jsxs("button",{type:"button",onClick:()=>o?.(s),className:x.cn("flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1","hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-colors",!r&&"opacity-40"),children:[e.jsx("div",{className:x.cn("flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",i&&"bg-primary font-semibold text-primary-foreground"),children:t}),h>0&&e.jsx("div",{className:"mt-0.5 flex items-center gap-0.5",children:h<=m?n.map(a=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:be(a)},a.id)):e.jsxs(e.Fragment,{children:[n.slice(0,m).map(a=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:be(a)},a.id)),e.jsxs("span",{className:"text-[6px] sm:text-[7px] font-medium text-muted-foreground",children:["+",h-m]})]})})]})}function lt({date:t,events:s,onMonthClick:n,onDayClick:r}){const o=y.useMemo(()=>H.generateMonthGrid(t,0),[t]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("button",{type:"button",onClick:()=>n?.(t),className:x.cn("w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold","hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-colors"),children:it[t.getMonth()]}),e.jsxs("div",{className:"flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3",children:[e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 text-center",children:ot.map((i,m)=>e.jsxs("div",{className:"text-[9px] sm:text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"sm:hidden",children:i[0]}),e.jsx("span",{className:"hidden sm:inline",children:i})]},m))}),e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 gap-y-1",children:o.map((i,m)=>{const h=H.getEventsForDay(s,i.date);return e.jsx(at,{day:i.date.getDate(),date:i.date,events:h,isCurrentMonth:i.isCurrentMonth,onDayClick:r},`${m+1}-${i.date.toISOString()}`)})})]})]})}function Te({events:t,year:s,onMonthClick:n,onDayClick:r,className:o,slots:i,classNames:m}){const h=y.useMemo(()=>H.getYearMonths(s),[s]);return e.jsxs("div",{className:x.cn("flex flex-col h-full",o),children:[e.jsx("div",{className:"flex items-center justify-center border-b px-4 py-3",children:e.jsx("h2",{className:"text-lg font-semibold",children:s})}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:h.map(a=>e.jsx(lt,{date:a,events:t,onMonthClick:n,onDayClick:r},a.getMonth()))})})]})}function ct(t){switch(t){case"day":case"week":return"time";default:return"day"}}function dt({onEventClick:t,onSlotClick:s,onSlotSelect:n,onAddEvent:r,className:o,showHeader:i=!0,minSelectionMinutes:m=30,showMoreEventsInPopover:h=!1,slots:a,classNames:d,settingsContent:M,filterContent:N,headerActions:C,renderPopover:z}){const{view:j,setView:b,selectedDate:w,setSelectedDate:k,slotDuration:D,filteredEvents:E,users:L,visibleHours:A,workingHours:I,badgeVariant:P,showWorkingHoursOnly:B}=Z.useInnoCalendar(),W=y.useMemo(()=>{if(!B||!I)return{startHour:A.start,endHour:A.end};let c=24,v=0;for(const T of Object.keys(I)){const S=I[Number(T)];!S||S.enabled===!1||(S.from<c&&(c=S.from),S.to>v&&(v=S.to))}return c>=v?{startHour:A.start,endHour:A.end}:{startHour:c,endHour:v}},[B,I,A]),F=W,O=y.useMemo(()=>ct(j),[j]),V=y.useCallback(c=>{if(n){n(c);return}if(s){const v=c.startDate.getHours();s(c.startDate,v)}},[n,s]),f=y.useCallback(c=>{b("day"),k(c,"day")},[k,b]),l=y.useCallback(c=>{b("month"),k(c,"month")},[k,b]),u=y.useCallback(c=>{t?.(c)},[t]),p=()=>{const c=E,v=u,T=z;switch(j){case"day":return e.jsx(g.DayView,{events:c,date:w,visibleHours:F,workingHours:I,slotDuration:D,badgeVariant:P,onEventClick:v,renderPopover:T,...a&&{slots:a},...d&&{classNames:d}});case"week":return e.jsx(g.WeekView,{events:c,date:w,visibleHours:F,workingHours:I,slotDuration:D,badgeVariant:P,onEventClick:v,renderPopover:T,...a&&{slots:a},...d&&{classNames:d}});case"month":return e.jsx(g.MonthView,{events:c,date:w,badgeVariant:P,onEventClick:v,onDayClick:f,renderPopover:T,showMoreEventsInPopover:h,...a&&{slots:a},...d&&{classNames:d}});case"year":return e.jsx(Te,{events:c,year:w.getFullYear(),onMonthClick:l,onDayClick:f,...a&&{slots:a},...d&&{classNames:d}});case"agenda":return e.jsx(g.AgendaView,{events:c,date:w,onEventClick:v,renderPopover:T,...a&&{slots:a},...d&&{classNames:d}});case"timeline-day":return e.jsx(ie,{daysToShow:1,events:c,users:L,selectedDate:w,visibleHours:{from:W.startHour,to:W.endHour},onEventClick:v,renderPopover:T,...a&&{slots:a},...d&&{classNames:d}});case"timeline-3day":return e.jsx(ie,{daysToShow:3,events:c,users:L,selectedDate:w,visibleHours:{from:W.startHour,to:W.endHour},onEventClick:v,renderPopover:T,...a&&{slots:a},...d&&{classNames:d}});case"timeline-week":return e.jsx(ie,{daysToShow:7,events:c,users:L,selectedDate:w,visibleHours:{from:W.startHour,to:W.endHour},onEventClick:v,renderPopover:T,...a&&{slots:a},...d&&{classNames:d}});default:return e.jsx(g.MonthView,{events:c,date:w,badgeVariant:P,onEventClick:v,onDayClick:f,...a&&{slots:a},...d&&{classNames:d}})}};return e.jsx(H.SlotSelectionProvider,{mode:O,onSelect:V,minDurationMinutes:m,slotDurationMinutes:D,enabled:!!(n||s),children:e.jsxs("div",{className:x.cn("flex flex-col h-full p-4",d?.root,o),children:[i&&e.jsx(g.CalendarHeader,{currentDate:w,view:j,events:E,onViewChange:b,onNavigateToday:()=>k(new Date,j),onNavigatePrev:()=>{const c=new Date(w);j==="day"||j==="timeline-day"?c.setDate(c.getDate()-1):j==="timeline-3day"?c.setDate(c.getDate()-3):j==="week"||j==="timeline-week"?c.setDate(c.getDate()-7):j==="month"?c.setMonth(c.getMonth()-1):j==="year"?c.setFullYear(c.getFullYear()-1):c.setDate(c.getDate()-7),k(c,j)},onNavigateNext:()=>{const c=new Date(w);j==="day"||j==="timeline-day"?c.setDate(c.getDate()+1):j==="timeline-3day"?c.setDate(c.getDate()+3):j==="week"||j==="timeline-week"?c.setDate(c.getDate()+7):j==="month"?c.setMonth(c.getMonth()+1):j==="year"?c.setFullYear(c.getFullYear()+1):c.setDate(c.getDate()+7),k(c,j)},availableViews:["day","week","month","agenda"],showTimelineViews:!0,showSettings:!!M,...!C&&r&&{onAddEvent:r},actions:C,settingsContent:M,filterContent:N}),e.jsx("div",{className:x.cn("flex-1 border rounded-lg bg-white overflow-x-auto",d?.viewContainer),children:p()})]})})}function xt({events:t,users:s=[],scheduleTypes:n=[],initialView:r="week",initialDate:o,initialSelectedUserId:i,initialScheduleTypeIds:m,initialParticipantIds:h,initialWorkingHoursView:a,initialSearchQuery:d,preferencesConfig:M,onEventClick:N,onSlotClick:C,onSlotSelect:z,onAddEvent:j,onEventDrop:b,onDateChange:w,onViewChange:k,className:D,showHeader:E=!0,minSelectionMinutes:L=30,showMoreEventsInPopover:A=!1,renderPopover:I,slots:P,classNames:B,settingsContent:W,filterContent:F,headerActions:O}){return e.jsx(H.DragDropProvider,{...b&&{onEventDrop:b},children:e.jsx(Z.InnoCalendarProvider,{initialEvents:t,initialUsers:s,initialScheduleTypes:n,initialView:r,...o&&{initialDate:o},...i&&{initialSelectedUserId:i},...m&&{initialScheduleTypeIds:m},...h&&{initialParticipantIds:h},...a&&{initialWorkingHoursView:a},...d&&{initialSearchQuery:d},...M&&{preferencesConfig:M},...w&&{onDateChange:w},...k&&{onViewChange:k},children:e.jsx(dt,{...N&&{onEventClick:N},...C&&{onSlotClick:C},...z&&{onSlotSelect:z},...j&&{onAddEvent:j},...I&&{renderPopover:I},className:D,showHeader:E,minSelectionMinutes:L,showMoreEventsInPopover:A,...P&&{slots:P},...B&&{classNames:B},settingsContent:W,filterContent:F,headerActions:O})})})}const Y=y.forwardRef(({className:t,children:s,...n},r)=>e.jsx("select",{ref:r,className:x.cn("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm","ring-offset-background","focus:outline-none focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","[&>option]:bg-background",t),...n,children:s}));Y.displayName="Select";const U=y.forwardRef(({className:t,...s},n)=>e.jsx("label",{ref:n,className:x.cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...s}));U.displayName="Label";function ut({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function ht({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}const mt=[{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour"}];function ft({value:t,onChange:s,isLocked:n=!1,className:r,labels:o={}}){const i={title:"Slot duration",lockedMessage:"This setting is locked by the administrator",infoMessage:"Set the time slot duration for day and week calendar views.",...o},m=h=>{n||s(Number(h.target.value))};return e.jsxs("div",{className:x.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"text-sm font-semibold",children:i.title}),n?e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(ht,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(ut,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx(Y,{value:t.toString(),onChange:m,disabled:n,className:"h-9 w-[128px] text-sm",children:mt.map(h=>e.jsx("option",{value:h.value.toString(),children:h.label},h.value))})]})}function gt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function pt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}const jt=[{value:"dot",label:"Dot indicator"},{value:"colored",label:"Full color"},{value:"mixed",label:"Mixed"}];function vt({value:t,onChange:s,isLocked:n=!1,className:r,labels:o={}}){const i={title:"Event display",lockedMessage:"This setting is locked by the administrator",infoMessage:"Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",options:{dot:"Dot indicator",colored:"Full color",mixed:"Mixed"},...o},m=a=>i.options?.[a]??a,h=a=>{n||s(a.target.value)};return e.jsxs("div",{className:x.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"text-sm font-semibold",children:i.title}),n?e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(pt,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(gt,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx(Y,{value:t,onChange:h,disabled:n,className:"h-9 w-[128px] text-sm",children:jt.map(a=>e.jsx("option",{value:a.value,children:m(a.value)},a.value))})]})}function wt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function bt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function yt(){return Array.from({length:25},(t,s)=>({value:s,label:`${String(s).padStart(2,"0")}:00`}))}function kt({value:t,onChange:s,isLocked:n=!1,className:r,labels:o={}}){const i={title:"Visible hours",from:"From",to:"To",lockedMessage:"This setting is locked by the administrator",infoMessage:"Set the visible hour range for day and week views. Hours outside this range will be hidden.",...o},m=yt(),h=d=>{if(n)return;const M=Number(d.target.value);M<t.endHour&&s({...t,startHour:M})},a=d=>{if(n)return;const M=Number(d.target.value);M>t.startHour&&s({...t,endHour:M})};return e.jsxs("div",{className:x.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"text-sm font-semibold",children:i.title}),n?e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(bt,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(wt,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(U,{className:"text-xs text-muted-foreground",children:i.from}),e.jsx(Y,{value:t.startHour.toString(),onChange:h,disabled:n,className:"h-9 w-[88px] text-sm",children:m.map(d=>e.jsx("option",{value:d.value.toString(),disabled:d.value>=t.endHour,children:d.label},d.value))})]}),e.jsx("span",{className:"mt-5 text-muted-foreground",children:"—"}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(U,{className:"text-xs text-muted-foreground",children:i.to}),e.jsx(Y,{value:t.endHour.toString(),onChange:a,disabled:n,className:"h-9 w-[88px] text-sm",children:m.map(d=>e.jsx("option",{value:d.value.toString(),disabled:d.value<=t.startHour,children:d.label},d.value))})]})]})]})}function Nt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function Ct({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Dt({className:t}){return e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}const Mt=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Tt(){return Array.from({length:25},(t,s)=>({value:s,label:`${String(s).padStart(2,"0")}:00`}))}const ye={sunday:"Sun",monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat"};function St({dayLabel:t,config:s,onChange:n,disabled:r,hourOptions:o}){const i=()=>{r||n({...s,enabled:!s.enabled})},m=a=>{if(r)return;const d=Number(a.target.value);d<s.to&&n({...s,from:d})},h=a=>{if(r)return;const d=Number(a.target.value);d>s.from&&n({...s,to:d})};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"checkbox","aria-checked":s.enabled,"aria-label":`Enable ${t}`,onClick:i,disabled:r,className:x.cn("flex size-5 shrink-0 items-center justify-center rounded border transition-colors",s.enabled?"border-primary bg-primary text-primary-foreground":"border-input bg-background",r&&"cursor-not-allowed opacity-50"),children:s.enabled&&e.jsx(Dt,{className:"size-3"})}),e.jsx("span",{className:x.cn("w-10 text-sm",!s.enabled&&"text-muted-foreground"),children:t}),e.jsx(Y,{value:s.from.toString(),onChange:m,disabled:r||!s.enabled,className:"h-8 w-[76px] text-xs",children:o.map(a=>e.jsx("option",{value:a.value.toString(),disabled:a.value>=s.to,children:a.label},a.value))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}),e.jsx(Y,{value:s.to.toString(),onChange:h,disabled:r||!s.enabled,className:"h-8 w-[76px] text-xs",children:o.map(a=>e.jsx("option",{value:a.value.toString(),disabled:a.value<=s.from,children:a.label},a.value))})]})}function Et({value:t,onChange:s,isLocked:n=!1,className:r,labels:o={}}){const i={title:"Working hours",lockedMessage:"This setting is locked by the administrator",infoMessage:"Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",days:ye,...o},m=Tt(),h=(a,d)=>{n||s({...t,[a]:d})};return e.jsxs("div",{className:x.cn("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"text-sm font-semibold",children:i.title}),n?e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(Ct,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(g.TooltipProvider,{delayDuration:100,children:e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{children:e.jsx(Nt,{className:"size-3 text-muted-foreground"})}),e.jsx(g.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx("div",{className:"flex flex-col gap-2",children:Mt.map(a=>e.jsx(St,{dayLabel:i.days?.[a]??ye[a],config:t[a],onChange:d=>h(a,d),disabled:n,hourOptions:m},a))})]})}const zt={sunday:{enabled:!1,from:8,to:18},monday:{enabled:!0,from:8,to:18},tuesday:{enabled:!0,from:8,to:18},wednesday:{enabled:!0,from:8,to:18},thursday:{enabled:!0,from:8,to:18},friday:{enabled:!0,from:8,to:18},saturday:{enabled:!1,from:8,to:18}};function ce({className:t}){return e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Lt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function Ht({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function de({checked:t,onCheckedChange:s,className:n,children:r}){return e.jsx("button",{type:"button",role:"checkbox","aria-checked":t,onClick:()=>s(!t),className:n,children:r})}function It({src:t,alt:s,fallback:n,className:r}){const[o,i]=y.useState(!1);return!t||o?e.jsx("div",{className:x.cn("flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",r),children:n||"?"}):e.jsx("img",{src:t,alt:s||"",className:x.cn("object-cover",r),onError:()=>i(!0)})}function ke({value:t,onChange:s,placeholder:n,className:r}){return e.jsxs("div",{className:x.cn("relative",r),children:[e.jsx(Lt,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{type:"text",value:t,onChange:o=>s(o.target.value),placeholder:n,className:"h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"})]})}function Ne(t,s,n,r=.3){if(!s.trim())return t;const o=s.toLowerCase();return t.filter(i=>n(i).some(h=>h?h.toLowerCase().includes(o):!1))}const Wt={title:"Filters",subtitle:"Filter calendar events",scheduleTypes:"Event Types",participants:"Participants",clearAll:"Clear all",selectAll:"Select all",unselectAll:"Unselect all",searchScheduleTypes:"Search event types...",searchParticipants:"Search participants...",noScheduleTypes:"No event types found",noParticipants:"No participants found"};function Ft({scheduleTypes:t,users:s,selectedScheduleTypeIds:n,onScheduleTypeChange:r,selectedUserIds:o,onUserChange:i,onClearAll:m,className:h,scheduleTypesLoading:a=!1,usersLoading:d=!1,labels:M,getScheduleTypeName:N}){const C={...Wt,...M},[z,j]=y.useState(""),[b,w]=y.useState(""),k=y.useMemo(()=>z.trim()?Ne(t,z,f=>[f.name,N?.(f)||f.name]):t,[t,z,N]),D=y.useMemo(()=>b.trim()?Ne(s,b,f=>[f.name,f.email||""]):s,[s,b]),E=k.length>0&&k.every(f=>n.includes(f.id)),L=D.length>0&&D.every(f=>o.includes(f.id)),A=n.length+o.length,I=(f,l)=>{const u=l?[...n,f]:n.filter(p=>p!==f);r(u)},P=()=>{if(E){const f=new Set(k.map(l=>l.id));r(n.filter(l=>!f.has(l)))}else{const f=new Set([...n,...k.map(l=>l.id)]);r(Array.from(f))}},B=(f,l)=>{const u=l?[...o,f]:o.filter(p=>p!==f);i(u)},W=()=>{if(L){const f=new Set(D.map(l=>l.id));i(o.filter(l=>!f.has(l)))}else{const f=new Set([...o,...D.map(l=>l.id)]);i(Array.from(f))}},F=()=>{r([]),i([]),m?.()},O=f=>N?N(f):f.name,V=f=>f.colorHex||f.color||"#069AD7";return e.jsxs("div",{className:x.cn("flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",h),children:[e.jsxs("header",{className:"flex items-start justify-between gap-2 px-4 pb-2 pt-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:C.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.subtitle})]}),A>0&&e.jsxs("button",{type:"button",onClick:F,className:"flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",children:[e.jsx(Ht,{className:"h-3.5 w-3.5"}),C.clearAll]})]}),e.jsx("div",{className:"h-px w-full bg-border/60"}),e.jsxs("section",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:C.scheduleTypes}),e.jsx("button",{type:"button",onClick:P,className:"text-xs font-medium text-primary transition-colors hover:text-primary/80",children:E?C.unselectAll:C.selectAll})]}),t.length>6&&e.jsx("div",{className:"px-4 pb-3",children:e.jsx(ke,{value:z,onChange:j,placeholder:C.searchScheduleTypes})}),e.jsxs("div",{className:"flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin",children:[a?Array.from({length:4}).map((f,l)=>e.jsxs("div",{className:"flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",children:[e.jsx("div",{className:"h-5 w-5 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-3 w-24 rounded bg-muted-foreground/20"})]},`skeleton-${l}`)):k.map(f=>{const l=n.includes(f.id),u=V(f);return e.jsxs(de,{checked:l,onCheckedChange:p=>I(f.id,p),className:x.cn("relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",l&&"border-primary bg-primary/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:x.cn("flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",l&&"border-primary bg-primary text-primary-foreground"),children:l&&e.jsx(ce,{className:"h-3 w-3"})}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:O(f)})]}),e.jsx("div",{className:"h-4 w-4 rounded-full border",style:{backgroundColor:u,borderColor:u}})]},f.id)}),!a&&k.length===0&&e.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:C.noScheduleTypes})]})]}),e.jsx("div",{className:"h-px w-full bg-border/60"}),e.jsxs("section",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:C.participants}),e.jsx(de,{checked:L,onCheckedChange:()=>W(),className:x.cn("flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",L&&"border-primary bg-primary text-primary-foreground"),children:L&&e.jsx(ce,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"px-4 pb-3",children:e.jsx(ke,{value:b,onChange:w,placeholder:C.searchParticipants})}),e.jsxs("div",{className:"flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin",children:[d?Array.from({length:4}).map((f,l)=>e.jsxs("div",{className:"flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",children:[e.jsx("div",{className:"h-5 w-5 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-10 w-10 rounded-full bg-muted-foreground/20"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-3 w-24 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-2 w-32 rounded bg-muted-foreground/10"})]})]},`p-skeleton-${l}`)):D.map(f=>{const l=o.includes(f.id);return e.jsxs(de,{checked:l,onCheckedChange:u=>B(f.id,u),className:x.cn("relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",l&&"border-primary bg-zinc-50"),children:[e.jsx("span",{className:x.cn("flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",l&&"border-primary bg-primary text-primary-foreground"),children:l&&e.jsx(ce,{className:"h-2.5 w-2.5"})}),e.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[e.jsx(It,{src:f.avatar??null,alt:f.name,fallback:f.name?.[0]?.toUpperCase()??"?",className:"h-10 w-10 rounded-lg"}),e.jsxs("div",{className:"flex max-w-[140px] flex-col gap-0.5 overflow-hidden",children:[e.jsx("span",{className:"line-clamp-1 text-sm font-medium text-foreground",children:f.name}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",title:f.email,children:f.email})]})]})]},f.id)}),!d&&D.length===0&&e.jsx("p",{className:"px-4 text-xs text-muted-foreground",children:C.noParticipants})]})]})]})}function Pt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}),e.jsx("circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"})]})}function Bt({scheduleTypes:t,value:s,onChange:n,allLabel:r="All types",className:o,label:i}){const m=a=>{n(a.target.value)},h=t.find(a=>String(a.id)===s);return e.jsxs("div",{className:x.cn("flex flex-col gap-1",o),children:[i&&e.jsx(U,{className:"text-xs text-muted-foreground",children:i}),e.jsxs("div",{className:"relative",children:[h?e.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",style:{backgroundColor:h.color}}):e.jsx(Pt,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(Y,{value:s,onChange:m,className:"h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",children:[e.jsx("option",{value:"all",children:r}),t.map(a=>e.jsx("option",{value:String(a.id),children:a.label},a.id))]})]})]})}function At({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function _t({users:t,value:s,onChange:n,allLabel:r="All users",className:o,label:i}){const m=h=>{n(h.target.value)};return e.jsxs("div",{className:x.cn("flex flex-col gap-1",o),children:[i&&e.jsx(U,{className:"text-xs text-muted-foreground",children:i}),e.jsxs("div",{className:"relative",children:[e.jsx(At,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(Y,{value:s,onChange:m,className:"h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",children:[e.jsx("option",{value:"all",children:r}),t.map(h=>e.jsx("option",{value:h.id,children:h.name},h.id))]})]})]})}function Ot({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"}),e.jsx("path",{d:"M8 14h.01"}),e.jsx("path",{d:"M12 14h.01"}),e.jsx("path",{d:"M16 14h.01"}),e.jsx("path",{d:"M8 18h.01"}),e.jsx("path",{d:"M12 18h.01"}),e.jsx("path",{d:"M16 18h.01"})]})}function $t({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h5"}),e.jsx("path",{d:"M17.5 17.5 16 16.3V14"}),e.jsx("circle",{cx:"16",cy:"16",r:"6"})]})}function Vt({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function Rt({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"}),e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function Ut(t){const s=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${s}-${n}-${r}`}function Ce(t){const s=t.getHours(),n=t.getMinutes(),r=s>=12?"PM":"AM",o=s%12||12,i=String(n).padStart(2,"0");return`${o}:${i} ${r}`}function Yt(t){const s=Ce(t.startDate),n=Ce(t.endDate);return`${s} - ${n}`}function Gt(t){const s=H.addDays(new Date,1);return t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate()}function Kt(t){if(H.isToday(t))return"Today";if(Gt(t))return"Tomorrow";const s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=s[t.getDay()],o=n[t.getMonth()],i=t.getDate();return`${r}, ${o} ${i}`}function Jt(t,s){const n=new Map;for(const r of t){const o=Ut(r.startDate),i=n.get(o)??[];i.push(r),n.set(o,i)}return Array.from(n.entries()).map(([r,o])=>{const i=[...o].sort((h,a)=>h.startDate.getTime()-a.startDate.getTime()),m=s>0?i.slice(0,s):i;return{date:new Date(r),dateKey:r,events:m,hasMore:s>0&&i.length>s}}).sort((r,o)=>r.date.getTime()-o.date.getTime())}function qt(t){const s=H.startOfDay(new Date),n=H.endOfDay(new Date);return t.filter(r=>r.startDate>=s&&r.startDate<=n).length}function xe({className:t}){return e.jsx("div",{className:x.cn("animate-pulse rounded-md bg-muted",t)})}function Xt({event:t,onClick:s}){return e.jsxs("button",{type:"button",onClick:()=>s?.(t),className:x.cn("w-full text-left rounded-lg transition-colors","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","flex items-start gap-3 p-2"),children:[e.jsx("div",{className:"shrink-0 rounded-full mt-1.5 size-2",style:{backgroundColor:t.color??"#3b82f6"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:Yt(t)})]}),s&&e.jsx(Vt,{className:"shrink-0 size-4 text-muted-foreground/50 mt-1"})]})}function Qt({group:t,onEventClick:s}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[e.jsx("h3",{className:x.cn("text-xs font-semibold",H.isToday(t.date)&&"text-primary"),children:Kt(t.date)}),t.hasMore&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",t.events.length," more"]})]}),e.jsx("div",{className:"space-y-0.5",children:t.events.map(n=>e.jsx(Xt,{event:n,onClick:s},n.id))})]})}function Zt({events:t,isLoading:s=!1,className:n,daysAhead:r=7,maxEventsPerDay:o=3,onEventClick:i,onNavigateToAgenda:m}){const[h,a]=y.useState(!1),d=y.useMemo(()=>{const j=H.startOfDay(new Date),b=H.addDays(j,r);return t.filter(w=>w.endDate>=j&&w.startDate<b)},[t,r]),M=y.useMemo(()=>Jt(d,o),[d,o]),N=y.useMemo(()=>qt(t),[t]),C=j=>{a(!1),i?.(j)},z=()=>{a(!1),m?.()};return e.jsxs(g.Popover,{open:h,onOpenChange:a,children:[e.jsxs(g.PopoverTrigger,{className:x.cn("relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",n),children:[e.jsx(Ot,{className:"h-4 w-4"}),N>0&&e.jsx(g.Badge,{variant:"destructive",className:"absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",children:N>99?"99+":N})]}),e.jsxs(g.PopoverContent,{className:"w-80 rounded-xl p-0",align:"end",side:"bottom",sideOffset:8,children:[e.jsxs("div",{className:"flex items-center justify-between border-b p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Upcoming"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:N>0?`${N} event${N>1?"s":""} today`:"No events today"})]}),m&&e.jsxs("button",{type:"button",onClick:z,className:"text-xs text-primary hover:underline flex items-center gap-1",children:["View all",e.jsx(Rt,{className:"size-3"})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto p-2",children:s?e.jsx("div",{className:"space-y-2 p-2",children:Array.from({length:3}).map((j,b)=>e.jsxs("div",{className:"flex space-x-3",children:[e.jsx(xe,{className:"h-2 w-2 rounded-full mt-2"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(xe,{className:"h-4 w-full"}),e.jsx(xe,{className:"h-3 w-3/4"})]})]},b))}):M.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx($t,{className:"mb-2 h-8 w-8 text-muted-foreground/50"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No upcoming events"}),e.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Your schedule is clear for the next ",r," days"]})]}):e.jsx("div",{className:"space-y-3 divide-y",children:M.map(j=>e.jsx(Qt,{group:j,onEventClick:C},j.dateKey))})})]})]})}function es({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h5"}),e.jsx("path",{d:"M17.5 17.5 16 16.25V14"}),e.jsx("circle",{cx:"16",cy:"16",r:"6"})]})}function Se({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function ts(t){const s=new Date;return s.setDate(s.getDate()+1),t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate()}function De(t){const s=t.getHours(),n=t.getMinutes(),r=s>=12?"PM":"AM";return`${s%12||12}:${n.toString().padStart(2,"0")} ${r}`}function ss(t){return new Intl.DateTimeFormat("en-US",{weekday:"long",month:"short",day:"numeric"}).format(t)}function ns(t){const s=De(t.startDate),n=De(t.endDate);return`${s} - ${n}`}function rs(t){return H.isToday(t)?"Today":ts(t)?"Tomorrow":ss(t)}function os(t,s){const n=new Map;for(const r of t){const o=H.formatDateISO(r.startDate),i=n.get(o)??[];i.push(r),n.set(o,i)}return Array.from(n.entries()).map(([r,o])=>{const i=[...o].sort((h,a)=>h.startDate.getTime()-a.startDate.getTime()),m=s>0?i.slice(0,s):i;return{date:new Date(r),dateKey:r,events:m,hasMore:s>0&&i.length>s}}).sort((r,o)=>r.date.getTime()-o.date.getTime())}function is({event:t,onClick:s,compact:n}){return e.jsxs("button",{type:"button",onClick:()=>s?.(t),className:x.cn("w-full text-left rounded-lg transition-colors","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","flex items-start gap-3",n?"p-2":"p-3"),children:[e.jsx("div",{className:x.cn("shrink-0 rounded-full mt-1",n?"size-2":"size-2.5"),style:{backgroundColor:t.color??"#3b82f6"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:x.cn("font-medium truncate",n?"text-xs":"text-sm"),children:t.title}),e.jsx("p",{className:x.cn("text-muted-foreground truncate",n?"text-[10px]":"text-xs"),children:ns(t)})]}),s&&e.jsx(Se,{className:x.cn("shrink-0 text-muted-foreground/50",n?"size-3":"size-4")})]})}function as({group:t,onEventClick:s,onViewMore:n,compact:r}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:x.cn("flex items-center justify-between px-2",r?"py-1":"py-1.5"),children:[e.jsx("h3",{className:x.cn("font-semibold",r?"text-xs":"text-sm",H.isToday(t.date)&&"text-primary"),children:rs(t.date)}),t.hasMore&&n&&e.jsx("button",{type:"button",onClick:()=>n(t.date),className:x.cn("text-primary hover:underline",r?"text-[10px]":"text-xs"),children:"+more"})]}),e.jsx("div",{className:"space-y-0.5",children:t.events.map(o=>e.jsx(is,{event:o,onClick:s,compact:r},o.id))})]})}function ls({events:t,daysAhead:s=7,maxEventsPerDay:n=3,onEventClick:r,onViewAll:o,className:i,emptyState:m,title:h="Upcoming",showHeader:a=!0,compact:d=!1}){const M=Z.useOptionalCalendarContext(),N=M?.filteredEvents,C=M?.currentDate??new Date,z=t??N??[],j=y.useMemo(()=>{const k=H.startOfDay(C),D=new Date(k);return D.setDate(D.getDate()+s),z.filter(E=>E.endDate>=k&&E.startDate<D)},[z,s,C]),b=y.useMemo(()=>os(j,n),[j,n]),w=j.length;return b.length===0?e.jsxs("div",{className:x.cn("rounded-lg border bg-card",i),children:[a&&e.jsx("div",{className:x.cn("border-b px-4 flex items-center justify-between",d?"py-2":"py-3"),children:e.jsx("h2",{className:x.cn("font-semibold",d?"text-sm":"text-base"),children:h})}),e.jsx("div",{className:x.cn("flex flex-col items-center justify-center text-center",d?"py-6 px-4":"py-10 px-6"),children:m??e.jsxs(e.Fragment,{children:[e.jsx(es,{className:x.cn("text-muted-foreground/50 mb-2",d?"size-8":"size-10")}),e.jsx("p",{className:x.cn("text-muted-foreground",d?"text-xs":"text-sm"),children:"No upcoming events"})]})})]}):e.jsxs("div",{className:x.cn("rounded-lg border bg-card overflow-hidden",i),children:[a&&e.jsxs("div",{className:x.cn("border-b px-4 flex items-center justify-between",d?"py-2":"py-3"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:x.cn("font-semibold",d?"text-sm":"text-base"),children:h}),e.jsx("span",{className:x.cn("text-muted-foreground bg-muted rounded-full px-2",d?"text-[10px] py-0":"text-xs py-0.5"),children:w})]}),o&&e.jsxs("button",{type:"button",onClick:()=>o(),className:x.cn("text-primary hover:underline flex items-center gap-0.5",d?"text-xs":"text-sm"),children:["View all",e.jsx(Se,{className:"size-3"})]})]}),e.jsx("div",{className:x.cn("divide-y overflow-auto",d?"p-2 max-h-[280px]":"p-3 max-h-[400px]"),children:b.map(k=>e.jsx(as,{group:k,onEventClick:r,onViewMore:o?D=>o(D):void 0,compact:d},k.dateKey))})]})}exports.AgendaDropdown=Zt;exports.AgendaWidget=ls;exports.BadgeVariantSetting=vt;exports.Calendar=ze;exports.CalendarFilterSidebar=Ft;exports.DEFAULT_WEEK_WORKING_HOURS=zt;exports.EventPopover=Ke;exports.InnoCalendar=xt;exports.ScheduleTypeFilter=Bt;exports.SlotDurationSetting=ft;exports.TimelineView=ie;exports.UserFilter=_t;exports.VisibleHoursSetting=kt;exports.WorkingHoursSetting=Et;exports.YearView=Te;
|
|
2
|
+
//# sourceMappingURL=agenda-widget-CDJexPK9.cjs.map
|