@innosolutions/inno-calendar 1.0.72 → 2.0.0

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.
Files changed (198) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/LICENSE +48 -48
  3. package/README.md +333 -305
  4. package/dist/components/event/event-card.d.ts +3 -27
  5. package/dist/components/event/event-card.d.ts.map +1 -1
  6. package/dist/components/header/calendar-header.d.ts +14 -3
  7. package/dist/components/header/calendar-header.d.ts.map +1 -1
  8. package/dist/components/index.cjs +1 -1
  9. package/dist/components/index.d.ts +7 -6
  10. package/dist/components/index.d.ts.map +1 -1
  11. package/dist/components/index.mjs +48 -57
  12. package/dist/components/index.mjs.map +1 -1
  13. package/dist/components/inno-calendar.d.ts +139 -72
  14. package/dist/components/inno-calendar.d.ts.map +1 -1
  15. package/dist/components/primitives/field-layer.d.ts +12 -0
  16. package/dist/components/primitives/field-layer.d.ts.map +1 -0
  17. package/dist/components/primitives/index.d.ts +3 -0
  18. package/dist/components/primitives/index.d.ts.map +1 -1
  19. package/dist/components/primitives/quick-create.d.ts +44 -0
  20. package/dist/components/primitives/quick-create.d.ts.map +1 -0
  21. package/dist/components/primitives/recurrence-field.d.ts +102 -0
  22. package/dist/components/primitives/recurrence-field.d.ts.map +1 -0
  23. package/dist/components/primitives/when-row.d.ts +41 -0
  24. package/dist/components/primitives/when-row.d.ts.map +1 -0
  25. package/dist/components/shell/calendar-settings.d.ts +28 -0
  26. package/dist/components/shell/calendar-settings.d.ts.map +1 -0
  27. package/dist/components/shell/calendar-sidebar.d.ts +27 -0
  28. package/dist/components/shell/calendar-sidebar.d.ts.map +1 -0
  29. package/dist/components/shell/filter-panel.d.ts +10 -0
  30. package/dist/components/shell/filter-panel.d.ts.map +1 -0
  31. package/dist/components/shell/index.d.ts +5 -0
  32. package/dist/components/shell/index.d.ts.map +1 -0
  33. package/dist/components/shell/mini-month.d.ts +16 -0
  34. package/dist/components/shell/mini-month.d.ts.map +1 -0
  35. package/dist/components/ui/index.d.ts +0 -2
  36. package/dist/components/ui/index.d.ts.map +1 -1
  37. package/dist/components/views/agenda-view.d.ts +14 -15
  38. package/dist/components/views/agenda-view.d.ts.map +1 -1
  39. package/dist/components/views/day-events-expansion.d.ts +1 -1
  40. package/dist/components/views/day-events-expansion.d.ts.map +1 -1
  41. package/dist/components/views/day-view.d.ts +2 -6
  42. package/dist/components/views/day-view.d.ts.map +1 -1
  43. package/dist/components/views/index.d.ts +2 -1
  44. package/dist/components/views/index.d.ts.map +1 -1
  45. package/dist/components/views/month-view.d.ts +2 -12
  46. package/dist/components/views/month-view.d.ts.map +1 -1
  47. package/dist/components/views/resource-columns-view.d.ts +23 -0
  48. package/dist/components/views/resource-columns-view.d.ts.map +1 -0
  49. package/dist/components/views/timeline-view.d.ts +2 -6
  50. package/dist/components/views/timeline-view.d.ts.map +1 -1
  51. package/dist/components/views/week-view.d.ts +10 -6
  52. package/dist/components/views/week-view.d.ts.map +1 -1
  53. package/dist/components/views/year-view.d.ts +2 -6
  54. package/dist/components/views/year-view.d.ts.map +1 -1
  55. package/dist/core/constants.d.ts +32 -1
  56. package/dist/core/constants.d.ts.map +1 -1
  57. package/dist/core/context/drag-drop-context.d.ts +15 -1
  58. package/dist/core/context/drag-drop-context.d.ts.map +1 -1
  59. package/dist/core/context/event-card-context.d.ts +16 -0
  60. package/dist/core/context/event-card-context.d.ts.map +1 -0
  61. package/dist/core/context/inno-calendar-provider.d.ts +10 -1
  62. package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
  63. package/dist/core/context/slot-selection-context.d.ts +16 -0
  64. package/dist/core/context/slot-selection-context.d.ts.map +1 -1
  65. package/dist/core/index.cjs +1 -1
  66. package/dist/core/index.d.ts +3 -1
  67. package/dist/core/index.d.ts.map +1 -1
  68. package/dist/core/index.mjs +160 -155
  69. package/dist/core/index.mjs.map +1 -1
  70. package/dist/core/types.d.ts +44 -514
  71. package/dist/core/types.d.ts.map +1 -1
  72. package/dist/core/utils/date-input.d.ts +8 -0
  73. package/dist/core/utils/date-input.d.ts.map +1 -0
  74. package/dist/core/utils/grid-utils.d.ts.map +1 -1
  75. package/dist/core/utils/index.d.ts +1 -0
  76. package/dist/core/utils/index.d.ts.map +1 -1
  77. package/dist/core/utils/time-format.d.ts +24 -0
  78. package/dist/core/utils/time-format.d.ts.map +1 -0
  79. package/dist/core/utils/view-storage.d.ts +2 -2
  80. package/dist/core/utils/view-storage.d.ts.map +1 -1
  81. package/dist/core/z-layers.d.ts +21 -0
  82. package/dist/core/z-layers.d.ts.map +1 -0
  83. package/dist/index.cjs +1 -1
  84. package/dist/index.d.ts +0 -1
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.mjs +227 -234
  87. package/dist/index.mjs.map +1 -1
  88. package/dist/inno-calendar-B6qXIqxY.js +7433 -0
  89. package/dist/inno-calendar-B6qXIqxY.js.map +1 -0
  90. package/dist/inno-calendar-BnCt65PZ.cjs +11 -0
  91. package/dist/inno-calendar-BnCt65PZ.cjs.map +1 -0
  92. package/dist/lib/index.cjs +1 -1
  93. package/dist/lib/index.mjs +1 -1
  94. package/dist/position-utils-BzSoogFQ.cjs +2 -0
  95. package/dist/position-utils-BzSoogFQ.cjs.map +1 -0
  96. package/dist/position-utils-CBSmf90e.js +1106 -0
  97. package/dist/position-utils-CBSmf90e.js.map +1 -0
  98. package/dist/styles/index.css +1 -1
  99. package/dist/use-slot-selection-CxPvMluJ.cjs +2 -0
  100. package/dist/use-slot-selection-CxPvMluJ.cjs.map +1 -0
  101. package/dist/use-slot-selection-IXHnP8C1.js +357 -0
  102. package/dist/use-slot-selection-IXHnP8C1.js.map +1 -0
  103. package/dist/utils-B6yFEsav.js +9 -0
  104. package/dist/utils-B6yFEsav.js.map +1 -0
  105. package/dist/utils-IjLH3w2e.cjs +2 -0
  106. package/dist/utils-IjLH3w2e.cjs.map +1 -0
  107. package/dist/utils.cjs +1 -1
  108. package/dist/utils.d.ts +1 -1
  109. package/dist/utils.d.ts.map +1 -1
  110. package/dist/utils.mjs +99 -96
  111. package/dist/z-layers-Bavypndz.cjs +2 -0
  112. package/dist/z-layers-Bavypndz.cjs.map +1 -0
  113. package/dist/z-layers-r5PdtThu.js +637 -0
  114. package/dist/z-layers-r5PdtThu.js.map +1 -0
  115. package/package.json +117 -138
  116. package/AGENT.md +0 -1783
  117. package/dist/agenda-widget-B0t3TCcV.js +0 -4141
  118. package/dist/agenda-widget-B0t3TCcV.js.map +0 -1
  119. package/dist/agenda-widget-i2tjGr5U.cjs +0 -2
  120. package/dist/agenda-widget-i2tjGr5U.cjs.map +0 -1
  121. package/dist/components/calendar.d.ts +0 -45
  122. package/dist/components/calendar.d.ts.map +0 -1
  123. package/dist/components/event/event-page-transition.d.ts +0 -32
  124. package/dist/components/event/event-page-transition.d.ts.map +0 -1
  125. package/dist/components/filters/calendar-filter-sidebar.d.ts +0 -54
  126. package/dist/components/filters/calendar-filter-sidebar.d.ts.map +0 -1
  127. package/dist/components/filters/index.d.ts +0 -9
  128. package/dist/components/filters/index.d.ts.map +0 -1
  129. package/dist/components/filters/schedule-type-filter.d.ts +0 -31
  130. package/dist/components/filters/schedule-type-filter.d.ts.map +0 -1
  131. package/dist/components/filters/user-filter.d.ts +0 -31
  132. package/dist/components/filters/user-filter.d.ts.map +0 -1
  133. package/dist/components/header/components/index.d.ts +0 -8
  134. package/dist/components/header/components/index.d.ts.map +0 -1
  135. package/dist/components/integrated-calendar.d.ts +0 -37
  136. package/dist/components/integrated-calendar.d.ts.map +0 -1
  137. package/dist/components/settings/badge-variant-setting.d.ts +0 -25
  138. package/dist/components/settings/badge-variant-setting.d.ts.map +0 -1
  139. package/dist/components/settings/index.d.ts +0 -10
  140. package/dist/components/settings/index.d.ts.map +0 -1
  141. package/dist/components/settings/slot-duration-setting.d.ts +0 -20
  142. package/dist/components/settings/slot-duration-setting.d.ts.map +0 -1
  143. package/dist/components/settings/visible-hours-setting.d.ts +0 -23
  144. package/dist/components/settings/visible-hours-setting.d.ts.map +0 -1
  145. package/dist/components/settings/working-hours-setting.d.ts +0 -41
  146. package/dist/components/settings/working-hours-setting.d.ts.map +0 -1
  147. package/dist/components/ui/dialog.d.ts +0 -35
  148. package/dist/components/ui/dialog.d.ts.map +0 -1
  149. package/dist/components/ui/select.d.ts +0 -12
  150. package/dist/components/ui/select.d.ts.map +0 -1
  151. package/dist/components/widget/agenda-dropdown.d.ts +0 -20
  152. package/dist/components/widget/agenda-dropdown.d.ts.map +0 -1
  153. package/dist/components/widget/agenda-widget.d.ts +0 -27
  154. package/dist/components/widget/agenda-widget.d.ts.map +0 -1
  155. package/dist/components/widget/index.d.ts +0 -6
  156. package/dist/components/widget/index.d.ts.map +0 -1
  157. package/dist/index-D2U2F80P.cjs +0 -2
  158. package/dist/index-D2U2F80P.cjs.map +0 -1
  159. package/dist/index-DtaLkIY8.js +0 -2777
  160. package/dist/index-DtaLkIY8.js.map +0 -1
  161. package/dist/position-utils-D_KpwRus.js +0 -1053
  162. package/dist/position-utils-D_KpwRus.js.map +0 -1
  163. package/dist/position-utils-ksZ_IjXC.cjs +0 -2
  164. package/dist/position-utils-ksZ_IjXC.cjs.map +0 -1
  165. package/dist/presets/default/default-calendar.d.ts +0 -44
  166. package/dist/presets/default/default-calendar.d.ts.map +0 -1
  167. package/dist/presets/default/index.d.ts +0 -2
  168. package/dist/presets/default/index.d.ts.map +0 -1
  169. package/dist/presets/index.cjs +0 -2
  170. package/dist/presets/index.cjs.map +0 -1
  171. package/dist/presets/index.d.ts +0 -3
  172. package/dist/presets/index.d.ts.map +0 -1
  173. package/dist/presets/index.mjs +0 -6
  174. package/dist/presets/index.mjs.map +0 -1
  175. package/dist/presets/tailwind/index.d.ts +0 -2
  176. package/dist/presets/tailwind/index.d.ts.map +0 -1
  177. package/dist/presets/tailwind/tailwind-calendar.d.ts +0 -122
  178. package/dist/presets/tailwind/tailwind-calendar.d.ts.map +0 -1
  179. package/dist/slot-selection-context-CLYZU6ul.cjs +0 -2
  180. package/dist/slot-selection-context-CLYZU6ul.cjs.map +0 -1
  181. package/dist/slot-selection-context-Ct5cVcKW.js +0 -611
  182. package/dist/slot-selection-context-Ct5cVcKW.js.map +0 -1
  183. package/dist/tailwind-calendar-BbUb61uY.cjs +0 -2
  184. package/dist/tailwind-calendar-BbUb61uY.cjs.map +0 -1
  185. package/dist/tailwind-calendar-DrwGVSF-.js +0 -400
  186. package/dist/tailwind-calendar-DrwGVSF-.js.map +0 -1
  187. package/dist/use-calendar-BK0nQYJq.cjs +0 -2
  188. package/dist/use-calendar-BK0nQYJq.cjs.map +0 -1
  189. package/dist/use-calendar-DJI35SSd.js +0 -175
  190. package/dist/use-calendar-DJI35SSd.js.map +0 -1
  191. package/dist/use-slot-selection-CCE11R4j.cjs +0 -2
  192. package/dist/use-slot-selection-CCE11R4j.cjs.map +0 -1
  193. package/dist/use-slot-selection-CX1w8EdM.js +0 -188
  194. package/dist/use-slot-selection-CX1w8EdM.js.map +0 -1
  195. package/dist/week-view-BXmaRChB.cjs +0 -11
  196. package/dist/week-view-BXmaRChB.cjs.map +0 -1
  197. package/dist/week-view-BeasFcyR.js +0 -3520
  198. package/dist/week-view-BeasFcyR.js.map +0 -1
@@ -0,0 +1,11 @@
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("react"),c=require("./utils-IjLH3w2e.cjs"),j=require("./position-utils-BzSoogFQ.cjs"),cn=require("class-variance-authority"),Le=require("lucide-react"),St=require("react-dom"),ue=require("./z-layers-Bavypndz.cjs"),Pn=require("@radix-ui/react-dropdown-menu"),$n=require("@radix-ui/react-popover"),Fn=require("@radix-ui/react-dialog"),Un=require("@radix-ui/react-tooltip");function Je(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return n.default=t,Object.freeze(n)}const ye=Je(o),me=Je(Pn),We=Je($n),ve=Je(Fn),Qe=Je(Un),dn=o.createContext(null);function Bn({render:t,children:n}){return e.jsx(dn.Provider,{value:t,children:n})}function qn(){return o.useContext(dn)}const Ie=We.Root,Re=We.Trigger,Vn=We.Anchor,Te=ye.forwardRef(({className:t,align:n="center",sideOffset:s=4,...r},a)=>e.jsx(We.Portal,{children:e.jsx(We.Content,{ref:a,align:n,sideOffset:s,className:c.cn("z-50 w-72 rounded-xl border bg-white text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Te.displayName=We.Content.displayName;const Tt=ve.Root,Lt=ve.Trigger,Yn=ve.Close,Gn=ve.Portal,un=ye.forwardRef(({className:t,...n},s)=>e.jsx(ve.Overlay,{className:c.cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n,ref:s}));un.displayName=ve.Overlay.displayName;const xt=ye.forwardRef(({className:t,children:n,...s},r)=>e.jsxs(Gn,{children:[e.jsx(un,{}),e.jsxs(ve.Content,{ref:r,className:c.cn("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500","inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",t),...s,children:[n,e.jsxs(ve.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(Le.X,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xt.displayName="SheetContent";const mn=({className:t,...n})=>e.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",t),...n});mn.displayName="SheetHeader";const ht=ye.forwardRef(({className:t,...n},s)=>e.jsx(ve.Title,{ref:s,className:c.cn("text-lg font-semibold text-foreground",t),...n}));ht.displayName=ve.Title.displayName;const xn=ye.forwardRef(({className:t,...n},s)=>e.jsx(ve.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",t),...n}));xn.displayName=ve.Description.displayName;const Se=Qe.Provider,De=Qe.Root,Ce=Qe.Trigger,be=ye.forwardRef(({className:t,sideOffset:n=4,...s},r)=>e.jsx(Qe.Content,{ref:r,sideOffset:n,className:c.cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));be.displayName=Qe.Content.displayName;const Kn="Event details";function Xn(){const[t,n]=o.useState(typeof window<"u"&&window.innerWidth<j.COMPACT_WIDTH);return o.useEffect(()=>{const s=()=>n(window.innerWidth<j.COMPACT_WIDTH);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),t}const Ot=t=>{t.target?.closest?.(j.PORTALLED)&&t.preventDefault()};function It({open:t,onOpenChange:n,trigger:s,children:r}){return Xn()?e.jsxs(Tt,{open:t,onOpenChange:n,children:[e.jsx(Lt,{asChild:!0,children:s}),e.jsxs(xt,{className:c.cn("inset-x-0 inset-y-auto bottom-0 flex h-auto max-h-[85dvh] w-full","max-w-none flex-col rounded-t-xl border-l-0 border-t p-0","data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"),children:[e.jsx(ht,{className:"sr-only",children:Kn}),r]})]}):e.jsxs(Ie,{open:t,onOpenChange:n,children:[e.jsx(Re,{asChild:!0,children:s}),e.jsx(Te,{side:"right",align:"start",sideOffset:8,collisionPadding:12,onFocusOutside:Ot,onPointerDownOutside:Ot,className:c.cn("flex max-h-[var(--radix-popover-content-available-height)] w-96","max-w-[calc(100vw-1.5rem)] flex-col overflow-hidden p-0"),children:r})]})}function Jn(t,n){return j.formatClockCompact(t,{locale:n})}function Ae(t){return{blue:{bg:"bg-blue-50 dark:bg-blue-950/30",text:"text-blue-700 dark:text-blue-300",dot:"bg-blue-500",dotFill:"fill-blue-600 dark:fill-blue-500",border:"border-blue-400 dark:border-blue-600"},green:{bg:"bg-green-50 dark:bg-green-950/30",text:"text-green-700 dark:text-green-300",dot:"bg-green-500",dotFill:"fill-green-600 dark:fill-green-500",border:"border-green-400 dark:border-green-600"},red:{bg:"bg-red-50 dark:bg-red-950/30",text:"text-red-700 dark:text-red-300",dot:"bg-red-500",dotFill:"fill-red-600 dark:fill-red-500",border:"border-red-400 dark:border-red-600"},yellow:{bg:"bg-yellow-50 dark:bg-yellow-950/30",text:"text-yellow-700 dark:text-yellow-300",dot:"bg-yellow-500",dotFill:"fill-yellow-600 dark:fill-yellow-500",border:"border-yellow-400 dark:border-yellow-600"},purple:{bg:"bg-purple-50 dark:bg-purple-950/30",text:"text-purple-700 dark:text-purple-300",dot:"bg-purple-500",dotFill:"fill-purple-600 dark:fill-purple-500",border:"border-purple-400 dark:border-purple-600"},orange:{bg:"bg-orange-50 dark:bg-orange-950/30",text:"text-orange-700 dark:text-orange-300",dot:"bg-orange-500",dotFill:"fill-orange-600 dark:fill-orange-500",border:"border-orange-400 dark:border-orange-600"},pink:{bg:"bg-pink-50 dark:bg-pink-950/30",text:"text-pink-700 dark:text-pink-300",dot:"bg-pink-500",dotFill:"fill-pink-600 dark:fill-pink-500",border:"border-pink-400 dark:border-pink-600"},teal:{bg:"bg-teal-50 dark:bg-teal-950/30",text:"text-teal-700 dark:text-teal-300",dot:"bg-teal-500",dotFill:"fill-teal-600 dark:fill-teal-500",border:"border-teal-400 dark:border-teal-600"},gray:{bg:"bg-gray-50 dark:bg-gray-950/30",text:"text-gray-700 dark:text-gray-300",dot:"bg-gray-500",dotFill:"fill-gray-600 dark:fill-gray-500",border:"border-gray-400 dark:border-gray-600"},indigo:{bg:"bg-indigo-50 dark:bg-indigo-950/30",text:"text-indigo-700 dark:text-indigo-300",dot:"bg-indigo-500",dotFill:"fill-indigo-600 dark:fill-indigo-500",border:"border-indigo-400 dark:border-indigo-600"}}[t??"blue"]}function hn(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function Xe({event:t,variant:n="full",badgeVariant:s="colored",onClick:r,className:a,showTime:l=!0,showDescription:i=!1,showParticipants:h=!1,style:d,disablePopover:x=!1,renderPopover:g,enableDrag:m=!1,enablePageTransition:b=!1,pageTransitionDuration:C=400}){const k=Ae(t.color),[M,E]=o.useState(!1),[L,S]=o.useState(!1),[w,H]=o.useState(!1),[z,N]=o.useState(null),D=o.useRef(null),y=ue.useOptionalDragDrop(),T=ue.useOptionalInnoCalendar();o.useEffect(()=>{if(!x&&T?.focusEventId&&T.focusEventId===t.id){const Q=setTimeout(()=>{E(!0),T.clearFocusEventId()},300);return()=>clearTimeout(Q)}},[T?.focusEventId,t.id,x]);const V=t.endDate<hn(new Date),I=t.isCanceled??!1,W=m&&y&&!I&&!V,P=t.data,R=P?.meetingTookPlace??t.meetingTookPlace??!1,u=I?e.jsx(Zn,{className:"h-3 w-3 text-zinc-800 dark:text-zinc-200"}):R?e.jsx(Qn,{className:c.cn("h-3 w-3",k.text)}):null,$=P?.productName,f=P?.extendedProps,_=P?.nrParticipant,U=P?.siteName,F=P?.siteCity,Y=!!U||!!F,se=o.useCallback(()=>{if(!L){if(x&&r){r(t);return}if(b&&D.current){const Q=D.current.getBoundingClientRect();N(Q),H(!0)}else x||E(!0)}},[L,x,r,t,b]);o.useCallback(()=>{H(!1),N(null),x||E(!0)},[x]);const J=o.useCallback(()=>{E(!1)},[]),K=o.useCallback(Q=>{W&&(Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",t.id),S(!0),y?.startDrag?.(t))},[W,t,y]),ne=o.useCallback(()=>{S(!1),y?.isDragging&&y.endDrag?.()},[y]),oe=g?.({event:t,onClose:J}),ee=Q=>e.jsx(It,{open:M,onOpenChange:E,trigger:Q,children:e.jsx("div",{className:c.cn("flex min-h-0 flex-1 flex-col",!g&&"p-4"),children:oe})});if(n==="dot"){const Q=e.jsx("button",{type:"button",onClick:se,className:c.cn("size-2 rounded-full cursor-pointer transition-opacity",k.dot,t.isCanceled&&"opacity-50",a),style:d,"aria-label":j.reactNodeToText(t.title)});return x?e.jsx(Se,{delayDuration:300,children:e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:Q}),e.jsx(be,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs opacity-80",children:j.formatEventTimeDisplay(t)})]})})]})}):ee(e.jsx(Se,{delayDuration:300,children:e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:Q}),e.jsx(be,{children:e.jsx("div",{className:"font-medium",children:t.title})})]})}))}if(n==="compact"){const Q=e.jsxs("div",{role:"button",tabIndex:0,draggable:!!W,onDragStart:K,onDragEnd:ne,onClick:x?se:void 0,onKeyDown:le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),se())},className:c.cn("group flex w-full relative items-center shadow-[0_0_1px_rgba(0,0,0,0.3)] gap-0 rounded px-1.5 py-1 text-left text-xs transition-colors hover:opacity-80",W?"cursor-grab active:cursor-grabbing":"cursor-pointer",L&&"opacity-50",I?"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through":[s==="colored"&&[k.bg,k.text],s==="mixed"&&[k.bg,k.text],s==="dot"&&"bg-muted/50"],a),style:d,children:[["dot","mixed"].includes(s)&&!I&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot absolute -top-1 -left-1 shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:k.dotFill})}),e.jsx("span",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsxs("span",{className:"",children:[e.jsx("span",{className:"relative block overflow-hidden whitespace-nowrap text-xs leading-tight",style:{maskImage:"linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)",WebkitMaskImage:"linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)"},children:e.jsxs("span",{className:"inline-flex event-marquee",children:[e.jsx("span",{className:"shrink-0 px-1",children:t.title}),e.jsx("span",{className:"shrink-0 px-1",children:"•"}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 px-1",children:t.title}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 px-1",children:"•"})]})}),e.jsx("div",{className:c.cn("w-fit mt-0.5 text-[10px] px-1 py-0.5 border border-dashed rounded-full font-medium",k.border),children:j.formatEventTimeDisplay(t)})]})}),e.jsx("div",{className:"flex gap-0.5",children:u})]});return x?e.jsx(Se,{delayDuration:300,children:e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:Q}),e.jsx(be,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:j.formatEventTimeDisplay(t)})]})})]})}):ee(Q)}const he=e.jsxs("button",{type:"button",onClick:se,className:c.cn("group relative flex w-full flex-col gap-1 rounded-md px-2 py-1.5 text-left","ring-1 ring-inset ring-black/[0.06] dark:ring-white/10","transition-shadow hover:shadow-[0_1px_4px_rgba(0,0,0,0.12)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",I?"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through":[s==="colored"&&[k.bg,k.text],s==="mixed"&&[k.bg,k.text],s==="dot"&&"bg-muted/50"],a),style:d,children:[e.jsxs("div",{className:"flex items-start justify-between gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[["dot","mixed"].includes(s)&&!I&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:k.dotFill})}),e.jsx("span",{className:c.cn("text-sm font-medium truncate",!I&&s!=="dot"&&k.text,I&&"line-through"),children:t.title})]}),u]}),$&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:$}),f&&f.length>0&&e.jsx("div",{className:"flex flex-col text-xs text-muted-foreground",children:f.map((Q,le)=>e.jsx("div",{children:Q},le))}),_!=null&&_>0&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Dt,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{children:[_," participant",_!==1?"s":""]})]}),l&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(fn,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:j.formatEventTimeDisplay(t)})]}),Y&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(pn,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{className:"truncate",children:[U,U&&F?", ":"",F]})]}),i&&t.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:t.description}),h&&t.participants&&t.participants.length>0&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Dt,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:t.participants.map(Q=>Q.name).join(", ")})]})]});return x?e.jsx(Se,{delayDuration:300,children:e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:he}),e.jsx(be,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:j.formatEventTimeDisplay(t)})]})})]})}):ee(he)}function fn({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("polyline",{points:"12 6 12 12 16 14"})]})}function Qn({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 Zn({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 Dt({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 pn({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 ft({event:t,position:n,hourHeight:s=j.DEFAULT_HOUR_HEIGHT,badgeVariant:r="colored",onClick:a,className:l,disablePopover:i=!1,renderPopover:h,enableDrag:d=!0}){const x=Ae(t.color),[g,m]=o.useState(!1),[b,C]=o.useState(!1),k=ue.useOptionalDragDrop(),M=ue.useOptionalInnoCalendar();o.useEffect(()=>{if(!i&&M?.focusEventId&&M.focusEventId===t.id){const re=setTimeout(()=>{m(!0),M.clearFocusEventId()},300);return()=>clearTimeout(re)}},[M?.focusEventId,t.id,i]);const E=(t.endDate.getTime()-t.startDate.getTime())/(1e3*60),L=E/60*s-8,S=t.endDate<hn(new Date),w=t.isCanceled??!1,H=d&&k&&!w&&!S,z=L<32,N=E<35,D=E>20,y=E>=45,T=t.data,V=T?.productName,I=T?.extendedProps,W=T?.nrParticipant,P=T?.siteName,R=T?.siteCity,u=!!P||!!R,$=r==="dot",f=o.useCallback(()=>{b||(i&&a?a(t):i||m(!0))},[b,i,a,t]),_=o.useCallback(()=>{m(!1)},[]),U=o.useCallback(re=>{if(!H)return;re.dataTransfer.effectAllowed="move",re.dataTransfer.setData("text/plain",t.id);const ce=re.currentTarget,we=ce.getBoundingClientRect();re.dataTransfer.setDragImage(ce,re.clientX-we.left,re.clientY-we.top),C(!0),k?.startDrag?.(t)},[H,t,k]),F=o.useCallback(()=>{C(!1),k?.isDragging&&k.endDrag?.()},[k]),[Y,se]=o.useState(null),J=Y!==null,K=M?.slotDuration??15,ne=H&&!!k?.resizeEvent,oe=o.useCallback(re=>{if(!ne)return;re.preventDefault(),re.stopPropagation();const ce=re.currentTarget;ce.setPointerCapture(re.pointerId);const we=re.clientY,p=t.endDate,A=new Date(t.startDate.getTime()+K*6e4);let O=p;const B=te=>{const ae=(te.clientY-we)/s*60,xe=Math.round(ae/K)*K,de=new Date(p.getTime()+xe*6e4);O=de<A?A:de,se((O.getTime()-p.getTime())/36e5*s)},q=()=>{ce.removeEventListener("pointermove",B),ce.removeEventListener("pointerup",q),ce.removeEventListener("pointercancel",X),se(null),O.getTime()!==p.getTime()&&k?.resizeEvent?.(t,O)},X=()=>{ce.removeEventListener("pointermove",B),ce.removeEventListener("pointerup",q),ce.removeEventListener("pointercancel",X),se(null)};ce.addEventListener("pointermove",B),ce.addEventListener("pointerup",q),ce.addEventListener("pointercancel",X)},[ne,t,s,K,k]),ee=ue.useOptionalInnoCalendar(),Q=qn()?.(t,{view:ee?.view??"week",compact:z}),le=o.useCallback(re=>{(re.key==="Enter"||re.key===" ")&&(re.preventDefault(),f())},[f]),ie=e.jsxs("div",{role:"button",tabIndex:0,draggable:!!H,onDragStart:U,onDragEnd:F,onKeyDown:le,onClick:b||J?void 0:f,className:c.cn("group relative flex w-full select-none overflow-hidden rounded-md text-xs text-left","ring-1 ring-inset ring-black/[0.06] dark:ring-white/10","transition-shadow hover:shadow-[0_1px_4px_rgba(0,0,0,0.12)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",H?"cursor-grab active:cursor-grabbing":"cursor-pointer",b&&"opacity-50",w?"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through":[!$&&[x.bg,x.text],$&&"bg-neutral-50 dark:bg-neutral-900"],z?"flex-row items-center gap-1.5 px-2 py-0":N?"flex-col gap-0.5 px-2 py-0 justify-center":"flex-col gap-0.5 px-2 py-1.5",l),style:{height:`${Math.max(L+(Y??0),20)}px`},children:[ne&&e.jsx("div",{role:"separator","aria-label":"Resize event",onPointerDown:oe,onClick:re=>re.stopPropagation(),className:c.cn("absolute inset-x-0 bottom-0 z-10 cursor-ns-resize","opacity-0 transition-opacity group-hover:opacity-100",z?"h-1.5":"h-2",J&&"opacity-100"),children:e.jsx("span",{className:c.cn("mx-auto block h-0.5 w-6 rounded-full bg-current opacity-40",z?"mt-px":"mt-0.5")})}),Q,!Q&&(z?e.jsxs(e.Fragment,{children:[["mixed","dot"].includes(r)&&!w&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:x.dotFill})}),e.jsxs("span",{className:c.cn("truncate leading-none text-[11px]",!w&&$&&"text-foreground"),children:[e.jsx("span",{className:"font-semibold",children:t.title}),!t.isAllDay&&e.jsxs("span",{className:"opacity-75",children:[", ",Jn(t.startDate)]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start gap-1.5 min-w-0",children:[["mixed","dot"].includes(r)&&!w&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:x.dotFill})}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsx("p",{className:c.cn("font-semibold truncate leading-tight",!w&&$&&"text-foreground"),children:t.title})})]}),y&&V&&e.jsx("p",{className:c.cn("text-[11px] truncate leading-tight",$?"text-muted-foreground":"opacity-80"),children:V}),y&&I&&I.length>0&&e.jsx("div",{className:c.cn("flex flex-col text-[11px] leading-tight",$?"text-muted-foreground":"opacity-80"),children:I.map((re,ce)=>e.jsx("div",{children:re},ce))}),(y||t.isAllDay)&&W!=null&&W>0&&e.jsxs("div",{className:c.cn("flex items-center gap-1 text-[11px] leading-tight",$?"text-muted-foreground":"opacity-80"),children:[e.jsx(Dt,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{children:[W," participant",W!==1?"s":""]})]}),D&&e.jsxs("div",{className:c.cn("flex items-center gap-1 text-[11px] tabular-nums leading-tight",$?"text-muted-foreground":"opacity-90"),children:[e.jsx(fn,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:j.formatEventTimeDisplay(t)})]}),y&&u&&e.jsxs("div",{className:c.cn("flex items-center gap-1 text-[11px] truncate leading-tight",$?"text-muted-foreground":"opacity-80"),children:[e.jsx(pn,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{className:"truncate",children:[P,P&&R?", ":"",R]})]})]}))]}),Me=e.jsx(be,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),V&&e.jsx("div",{className:"text-xs text-muted-foreground",children:V}),I&&I.length>0&&I.map((re,ce)=>e.jsx("div",{className:"text-xs text-muted-foreground",children:re},ce)),W!=null&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[W," participant",W!==1?"s":""]}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:j.formatEventTimeDisplay(t)}),u&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[P,P&&R?", ":"",R]})]})});return i?e.jsx("div",{className:"absolute p-0.5",style:{top:`${n.top}px`,left:`${n.left}%`,width:n.minWidth?`max(${n.minWidth}px, ${n.width}%)`:`${n.width}%`,minWidth:n.minWidth?`${n.minWidth}px`:void 0},children:e.jsx(Se,{delayDuration:300,children:e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:ie}),Me]})})}):e.jsx("div",{className:"absolute p-0.5",style:{top:`${n.top}px`,left:`${n.left}%`,width:n.minWidth?`max(${n.minWidth}px, ${n.width}%)`:`${n.width}%`,minWidth:n.minWidth?`${n.minWidth}px`:void 0},children:e.jsx(It,{open:g,onOpenChange:m,trigger:ie,children:e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:h?.({event:t,onClose:_})})})})}function es({event:t,spanDays:n,isStart:s,isEnd:r,onClick:a,className:l,disablePopover:i=!1,renderPopover:h}){const d=Ae(t.color),[x,g]=o.useState(!1),m=t.isCanceled??!1,b=o.useCallback(()=>{i&&a?a(t):i||g(!0)},[i,a,t]),C=o.useCallback(()=>{g(!1)},[]),k=e.jsx("button",{type:"button",onClick:b,className:c.cn("flex h-5 items-center px-1.5 text-xs font-medium transition-opacity hover:opacity-80",m?"bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through":[d.dot,"text-white"],s&&"rounded-l",r&&"rounded-r",l),style:{width:`${n*100}%`},children:s&&e.jsx("span",{className:"truncate",children:t.title})}),M=e.jsx(be,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:j.formatEventTimeDisplay(t)})]})});return i?e.jsx(Se,{delayDuration:300,children:e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:k}),M]})}):e.jsx(It,{open:x,onOpenChange:g,trigger:k,children:e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:h?.({event:t,onClose:C})})})}if(typeof window<"u"&&!document.getElementById("inno-calendar-event-marquee-style")){const t=document.createElement("style");t.id="inno-calendar-event-marquee-style",t.innerHTML=`
2
+ @keyframes event-marquee {
3
+ 0% { transform: translateX(0); }
4
+ 100% { transform: translateX(-50%); }
5
+ }
6
+ .event-marquee {
7
+ animation: event-marquee 28s linear infinite;
8
+ will-change: transform;
9
+ }
10
+ `,document.head.appendChild(t)}const gn=cn.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input active:!bg-zinc-100 hover:!bg-zinc-50 active:bg-white !bg-white hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),je=o.forwardRef(({className:t,variant:n,size:s,loading:r,disabled:a,children:l,...i},h)=>e.jsxs("button",{className:c.cn(gn({variant:n,size:s,className:t})),ref:h,disabled:a||r,...i,children:[r&&e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 size-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l]}));je.displayName="Button";const yn=me.Root,vn=me.Trigger,ts=ye.forwardRef(({className:t,inset:n,children:s,...r},a)=>e.jsxs(me.SubTrigger,{ref:a,className:c.cn("flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",t),...r,children:[s,e.jsx(Le.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ts.displayName=me.SubTrigger.displayName;const ns=ye.forwardRef(({className:t,...n},s)=>e.jsx(me.SubContent,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));ns.displayName=me.SubContent.displayName;const Rt=ye.forwardRef(({className:t,sideOffset:n=4,...s},r)=>e.jsx(me.Portal,{children:e.jsx(me.Content,{ref:r,sideOffset:n,className:c.cn("z-50 rounded-xl border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));Rt.displayName=me.Content.displayName;const ut=ye.forwardRef(({className:t,inset:n,...s},r)=>e.jsx(me.Item,{ref:r,className:c.cn("relative flex cursor-pointer select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",t),...s}));ut.displayName=me.Item.displayName;const ss=ye.forwardRef(({className:t,children:n,checked:s=!1,...r},a)=>e.jsxs(me.CheckboxItem,{ref:a,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:s,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(me.ItemIndicator,{children:e.jsx(Le.Check,{className:"h-4 w-4"})})}),n]}));ss.displayName=me.CheckboxItem.displayName;const rs=ye.forwardRef(({className:t,children:n,...s},r)=>e.jsxs(me.RadioItem,{ref:r,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(me.ItemIndicator,{children:e.jsx(Le.Circle,{className:"h-2 w-2 fill-current"})})}),n]}));rs.displayName=me.RadioItem.displayName;const os=ye.forwardRef(({className:t,inset:n,...s},r)=>e.jsx(me.Label,{ref:r,className:c.cn("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...s}));os.displayName=me.Label.displayName;const as=ye.forwardRef(({className:t,...n},s)=>e.jsx(me.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",t),...n}));as.displayName=me.Separator.displayName;function is({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 jn({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 lt({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 ls({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 Ye({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 cs({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 ds({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 us({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 ms({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 xs({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 hs({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 _e({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:c.cn("animate-spin",t),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}const fs={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."},Ge=o.forwardRef(({onClick:t,label:n,children:s,className:r,variant:a="ghost",...l},i)=>e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:e.jsx("button",{type:"button",ref:i,onClick:t,className:c.cn("h-8 w-8 rounded-full flex items-center justify-center transition-colors",a==="ghost"&&"hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",a==="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":n,...l,children:s})}),e.jsx(be,{side:"bottom",className:"text-xs",children:n})]}));Ge.displayName="IconButton";function ps({src:t,alt:n,initials:s,className:r,isClient:a}){const[l,i]=o.useState(!1);return e.jsx("div",{className:c.cn("relative h-7 w-7 rounded-full overflow-hidden shrink-0",r),children:t&&!l?e.jsx("img",{src:t,alt:n,className:"h-full w-full object-cover",onError:()=>i(!0)}):e.jsx("div",{className:c.cn("h-full w-full flex items-center justify-center text-[10px] font-medium",a?"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:s})})}function _t({participant:t,isEventCanceled:n=!1,labels:s}){const r=t.name||"Unknown",a=r.split(" ").map(b=>b[0]).join("").toUpperCase().slice(0,2),l=t.isOrganizer??!1,i=t.isConfirmed,h=i===!0,d=i===!1,x=t.isClient??!1,g=t.profilePicture||t.avatar,m=n;return e.jsxs("div",{className:c.cn("flex items-center gap-3 py-0",m&&"opacity-60"),children:[e.jsxs("div",{className:"relative",children:[e.jsx(ps,{src:g,alt:r,initials:a,isClient:x,className:c.cn(m&&"grayscale")}),m||d?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(lt,{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(Ye,{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:c.cn("text-sm text-zinc-900 dark:text-zinc-100 truncate",m&&"line-through text-zinc-500 dark:text-zinc-500"),children:r})}),x&&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:s.client}),l&&!m&&e.jsx("div",{className:"text-xs text-zinc-500",children:s.organizer})]})]})}function gs({open:t,onOpenChange:n,title:s,children:r}){return o.useEffect(()=>{if(!t)return;const a=l=>{l.key==="Escape"&&n(!1)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,n]),o.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:()=>n(!1),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&n(!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:[s&&e.jsx("div",{className:"sr-only",children:s}),r]})})]}):null}function ys({open:t,onOpenChange:n,title:s,description:r,cancelLabel:a,confirmLabel:l,onConfirm:i,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:()=>n(!1),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&n(!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:s}),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(je,{variant:"outline",size:"sm",onClick:()=>n(!1),children:a}),e.jsxs(je,{variant:"destructive",size:"sm",onClick:i,disabled:h,children:[h&&e.jsx(_e,{className:"h-4 w-4 mr-2"}),e.jsx(jn,{className:"h-4 w-4 mr-2"}),l]})]})]})})]}):null}function vs(t,n){return t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}function js(t,n){const s={hour:"2-digit",minute:"2-digit",hour12:!1};return`${t.toLocaleTimeString(void 0,s)} – ${n.toLocaleTimeString(void 0,s)}`}function bs(t){return t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function ws(t){const[n,s]=o.useState(()=>typeof window<"u"?window.matchMedia(t).matches:!1);return o.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(t),a=l=>s(l.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[t]),n}function Wt({event:t,labels:n,isLoading:s,onClose:r,onEdit:a,onDelete:l,onCancel:i,onAccept:h,onDecline:d,onConfirmMeeting:x,canEdit:g=!0,canDelete:m=!1,canCancel:b=!0,isCurrentUserParticipant:C=!1,isCurrentUserClient:k=!1,currentUserAcceptStatus:M,isAcceptLoading:E=!1,isDeclineLoading:L=!1,isConfirmLoading:S=!1,isDeleteLoading:w=!1,renderParticipant:H,renderHeaderActions:z,renderCancelReason:N,renderDeleteConfirmation:D,formatDate:y=vs,formatTimeRange:T=js}){const[V,I]=o.useState(!1),W=!(t.isCanceled||t.meetingTookPlace),P=t.isRecurring??!1,R=t.participantDetails,u=t.participantsNames||[],$=R&&R.length>0,f=M===!0,_=M===!1,U=C&&!k&&W,F=$?R.filter(Q=>Q.isConfirmed).length:t.isAccepted?u.length:0,Y=$?R.length:u.length,se=t.scheduleTypeColor||t.hexColor||"#039BE5",J=o.useCallback(()=>t.startDate?y(t.startDate):n.noDateProvided,[t.startDate,y,n.noDateProvided]),K=o.useCallback(()=>t.startDate&&t.endDate?T(t.startDate,t.endDate):null,[t.startDate,t.endDate,T]),ne=()=>{r(),a?.(t)},oe=()=>{r(),i?.(t)},ee=()=>{I(!0)},he=()=>{l?.(t),I(!1)};return s?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(_e,{className:"h-6 w-6 text-zinc-400"})}):e.jsxs(Se,{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:z?z({onClose:r}):e.jsxs(e.Fragment,{children:[W&&g&&a&&e.jsx(Ge,{onClick:ne,label:n.edit,children:e.jsx(is,{className:"h-[18px] w-[18px]"})}),W&&b&&i&&e.jsx(Ge,{onClick:oe,label:n.cancel,children:e.jsx(ls,{className:"h-[18px] w-[18px]"})}),m&&l&&e.jsx(Ge,{onClick:ee,label:n.delete,variant:"destructive",children:e.jsx(jn,{className:"h-[18px] w-[18px]"})}),e.jsx(Ge,{onClick:r,label:n.close,children:e.jsx(lt,{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:se}}),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:c.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(cs,{className:"h-3 w-3"}),n.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(lt,{className:"h-3 w-3"}),n.canceled]})]}),e.jsxs("div",{className:"mt-1 text-sm text-zinc-600 dark:text-zinc-400",children:[e.jsx("span",{children:J()}),K()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1.5",children:"·"}),e.jsx("span",{children:K()})]})]}),P&&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:N?N(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:n.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:[n.canceledOn," ",bs(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(ms,{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})]}),($||u.length>0)&&e.jsxs("div",{className:"flex items-start gap-2 py-0",children:[e.jsx(us,{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:[Y," ",Y!==1?n.guests:n.guest]}),Y>0&&e.jsxs("span",{className:"text-xs text-zinc-500",children:["(",F," ",n.confirmed,")"]})]}),e.jsxs("div",{className:"mt-2 space-y-2",children:[$?R.slice(0,6).map((Q,le)=>H?H(Q,le):e.jsx(_t,{participant:Q,isEventCanceled:t.isCanceled,labels:n},Q.id)):u.slice(0,6).map((Q,le)=>{const ie={id:String(le),name:Q,email:"",isConfirmed:t.isAccepted,isOrganizer:le===0,isClient:!1};return H?H(ie,le):e.jsx(_t,{participant:ie,isEventCanceled:t.isCanceled,labels:n},Q)}),Y>6&&e.jsxs("div",{className:"text-xs text-zinc-500 py-1.5 pl-10",children:["+",Y-6," ",n.more]})]})]})]}),t.description&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(hs,{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(xs,{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:$&&R.find(Q=>Q.isOrganizer)?.name||u[0]||"Calendar"})]})]}),U&&h&&d&&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:[P?e.jsxs(yn,{children:[e.jsx(vn,{asChild:!0,children:e.jsxs("div",{className:"flex",children:[e.jsx(je,{size:"sm",variant:"outline",className:c.cn("rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",f&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:Q=>{Q.stopPropagation(),f||h(t)},disabled:E,children:E?e.jsx(_e,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[f&&e.jsx(Ye,{className:"h-3.5 w-3.5"}),n.going]})}),e.jsx(je,{size:"sm",variant:"outline",className:c.cn("rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",f&&"!bg-green-700 !text-white hover:!bg-green-700"),children:e.jsx(ds,{className:"h-3.5 w-3.5"})})]})}),e.jsxs(Rt,{align:"start",children:[e.jsxs(ut,{className:c.cn("gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",f&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>h(t),children:[e.jsx(Ye,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),n.acceptThisEvent]}),e.jsxs(ut,{onClick:()=>h(t),children:[e.jsx(Ye,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),n.acceptAllEvents]})]})]}):e.jsx(je,{size:"sm",variant:"outline",className:c.cn("gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",f&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>{f||h(t)},disabled:E,children:E?e.jsx(_e,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[f&&e.jsx(Ye,{className:"h-3.5 w-3.5"}),n.going]})}),e.jsx(je,{size:"sm",variant:"outline",className:c.cn("gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",_&&"!bg-rose-700 !text-white hover:!bg-rose-700"),onClick:()=>{_||d(t)},disabled:L,children:L?e.jsx(_e,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[_&&e.jsx(lt,{className:"h-3.5 w-3.5"}),n.notGoing]})})]})}),C&&f&&!t.meetingTookPlace&&!t.isCanceled&&x&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 py-3",children:e.jsxs(je,{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:()=>x(t),disabled:S,children:[S&&e.jsx(_e,{className:"h-4 w-4 mr-2"}),n.confirmMeeting]})})]}),D?V&&D({onConfirm:he,onCancel:()=>I(!1),isLoading:w}):e.jsx(ys,{open:V,onOpenChange:I,title:n.deleteConfirmTitle,description:n.deleteConfirmDescription,cancelLabel:n.cancel,confirmLabel:n.delete,onConfirm:he,isLoading:w})]})}function Ns({event:t,children:n,open:s,onOpenChange:r,isLoading:a,labels:l,onEdit:i,onDelete:h,onCancel:d,onAccept:x,onDecline:g,onConfirmMeeting:m,canEdit:b=!0,canDelete:C=!1,canCancel:k=!0,isCurrentUserParticipant:M,isCurrentUserClient:E,currentUserAcceptStatus:L,isAcceptLoading:S,isDeclineLoading:w,isConfirmLoading:H,isDeleteLoading:z,renderParticipant:N,renderHeaderActions:D,renderCancelReason:y,renderDeleteConfirmation:T,formatDate:V,formatTimeRange:I,className:W,width:P=360}){const R=ws("(min-width: 768px)"),u={...fs,...l},$=o.useCallback(()=>{r?.(!1)},[r]),f={event:t,labels:u,isLoading:a,onClose:$,onEdit:i,onDelete:h,onCancel:d,onAccept:x,onDecline:g,onConfirmMeeting:m,canEdit:b,canDelete:C,canCancel:k,isCurrentUserParticipant:M,isCurrentUserClient:E,currentUserAcceptStatus:L,isAcceptLoading:S,isDeclineLoading:w,isConfirmLoading:H,isDeleteLoading:z,renderParticipant:N,renderHeaderActions:D,renderCancelReason:y,renderDeleteConfirmation:T,formatDate:V,formatTimeRange:I};return R?e.jsxs(Ie,{open:s??!1,onOpenChange:r??(()=>{}),children:[e.jsx(Re,{asChild:!0,children:n}),e.jsx(Te,{className:c.cn("p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",W),style:{width:P},align:"center",side:"bottom",sideOffset:4,children:e.jsx(Wt,{...f})})]}):e.jsxs(e.Fragment,{children:[n,e.jsx(gs,{open:s??!1,onOpenChange:r??(()=>{}),title:t.title,children:e.jsx(Wt,{...f})})]})}const ks={title:"Calendar settings",interval:"Time interval",dayStart:"Day starts",dayEnd:"Day ends",workingHoursOnly:"Working hours only",eventStyle:"Event style",badgeDot:"Dot",badgeColored:"Colour",badgeMixed:"Mixed",minutes:"min"},Ds=[15,30,60],Cs=Array.from({length:25},(t,n)=>n);function $e({label:t,children:n}){return e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm text-foreground",children:t}),n]})}function Pt({options:t,value:n,onChange:s}){return e.jsx("div",{className:"flex overflow-hidden rounded-md border border-border",children:t.map(r=>e.jsx("button",{type:"button",onClick:()=>s(r.value),className:c.cn("px-2.5 py-1 text-xs",r.value===n?"bg-primary text-primary-foreground":"bg-background hover:bg-accent hover:text-accent-foreground"),children:r.label},String(r.value)))})}function $t({value:t,onChange:n,label:s}){return e.jsx("select",{"aria-label":s,value:t,onChange:r=>n(Number(r.target.value)),className:c.cn("rounded-md border border-border bg-background px-2 py-1 text-xs","focus:outline-none focus:ring-1 focus:ring-ring"),children:Cs.map(r=>e.jsxs("option",{value:r,children:[String(r).padStart(2,"0"),":00"]},r))})}function bn({labels:t}){const n=ue.useOptionalInnoCalendar(),s={...ks,...t};if(!n)return null;const{slotDuration:r,setSlotDuration:a,visibleHours:l,setVisibleHours:i,showWorkingHoursOnly:h,setShowWorkingHoursOnly:d,badgeVariant:x,setBadgeVariant:g,isPreferenceLocked:m}=n,b=C=>m(C);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm font-medium",children:s.title}),!b("slotDuration")&&e.jsx($e,{label:s.interval,children:e.jsx(Pt,{value:r,onChange:C=>a(C),options:Ds.map(C=>({value:C,label:`${C} ${s.minutes}`}))})}),!b("visibleHours")&&e.jsxs(e.Fragment,{children:[e.jsx($e,{label:s.dayStart,children:e.jsx($t,{label:s.dayStart,value:l.start,onChange:C=>i(k=>({...k,start:Math.min(C,k.end-1)}))})}),e.jsx($e,{label:s.dayEnd,children:e.jsx($t,{label:s.dayEnd,value:l.end,onChange:C=>i(k=>({...k,end:Math.max(C,k.start+1)}))})})]}),!b("showWorkingHoursOnly")&&e.jsx($e,{label:s.workingHoursOnly,children:e.jsx("button",{type:"button",role:"switch","aria-checked":h,onClick:()=>d(!h),className:c.cn("relative h-5 w-9 rounded-full transition-colors",h?"bg-primary":"bg-muted"),children:e.jsx("span",{className:c.cn("absolute top-0.5 size-4 rounded-full bg-background transition-all",h?"left-[18px]":"left-0.5")})})}),!b("badgeVariant")&&e.jsx($e,{label:s.eventStyle,children:e.jsx(Pt,{value:x,onChange:C=>g(C),options:[{value:"dot",label:s.badgeDot},{value:"colored",label:s.badgeColored},{value:"mixed",label:s.badgeMixed}]})})]})}function Ke({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M9 8h7"}),e.jsx("path",{d:"M8 12h6"}),e.jsx("path",{d:"M11 16h5"})]})}function Ms({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:"m6 9 6 6 6-6"})})}function Es({className:t}){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Ss({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:"7",height:"7",x:"3",y:"3",rx:"1"}),e.jsx("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),e.jsx("path",{d:"M14 4h7"}),e.jsx("path",{d:"M14 9h7"}),e.jsx("path",{d:"M14 15h7"}),e.jsx("path",{d:"M14 20h7"})]})}function Ts({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M8 3v18"}),e.jsx("path",{d:"M12 3v18"}),e.jsx("path",{d:"M16 3v18"})]})}function Ls({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:"M8 6h13"}),e.jsx("path",{d:"M8 12h13"}),e.jsx("path",{d:"M8 18h13"}),e.jsx("path",{d:"M3 6h.01"}),e.jsx("path",{d:"M3 12h.01"}),e.jsx("path",{d:"M3 18h.01"})]})}function Is({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M12 3v18"})]})}function Rs({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M3 12h18"}),e.jsx("path",{d:"M12 3v18"})]})}function As({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M3 9h18"}),e.jsx("path",{d:"M3 15h18"}),e.jsx("path",{d:"M9 3v18"}),e.jsx("path",{d:"M15 3v18"})]})}const Ft=[{value:"day",label:"Day",icon:Ss},{value:"4day",label:"4 days",icon:Ts},{value:"week",label:"Week",icon:Is},{value:"month",label:"Month",icon:Rs},{value:"year",label:"Year",icon:As},{value:"agenda",label:"Schedule",icon:Ls}],Ut={day:"D","4day":"X",week:"W",month:"M",year:"Y",agenda:"A"},Hs=[{value:"timeline-3day",label:"3 Days",icon:Ke},{value:"timeline-week",label:"Week",icon:Ke}],zs=[{value:"timeline-day",label:"Day",icon:Ke},{value:"resource-day",label:"Day",icon:Ke},{value:"resource-week",label:"Week",icon:Ke}];function Os(t,n,s,r){const a=d=>new Intl.DateTimeFormat(r,{month:"long",year:"numeric"}).format(d);if(n==="day"||n==="timeline-day"||n==="resource-day")return new Intl.DateTimeFormat(r,{month:"long",day:"numeric",year:"numeric"}).format(t);if(n==="year")return new Intl.DateTimeFormat(r,{year:"numeric"}).format(t);const l=j.startOfWeek(t,s),i=j.endOfWeek(t,s);if(n==="month"||l.getMonth()===i.getMonth())return a(t);const h=d=>new Intl.DateTimeFormat(r,{month:"short"}).format(d);return`${h(l)} – ${h(i)} ${i.getFullYear()}`}function Bt({dir:t}){return e.jsx("svg",{viewBox:"0 0 24 24",className:"size-5",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:t==="prev"?"M15 18L9 12l6-6":"M9 18l6-6-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function _s(t){return`People · ${t.label}`}function wn({currentDate:t,view:n,onNavigateToday:s,onNavigatePrev:r,onNavigateNext:a,onNavigate:l,onViewChange:i,onAddEvent:h,availableViews:d=["day","4day","week","month","agenda"],showTimelineViews:x=!1,timelineViews:g,settingsContent:m,showSettings:b=!0,filterContent:C,leadingAction:k,actions:M,className:E,weekStartsOn:L=1,locale:S,todayLabel:w="Today",headerConfig:H,labels:z={}}){const N=H?.showSettings??b,D=Os(t,n,L,S),y=H?.showToday??!0,T=H?.showDateNavigator??!0,V=H?.showCalendarViews??!0,I=H?.showFilters??!0,W=o.useMemo(()=>({today:"Today",addEvent:"Add Event",settings:"Settings",calendarView:"Calendar View",resourceView:"Resource View",...z}),[z]),P=()=>{s?.(),l?.("today")},R=()=>{r?.(),l?.("prev")},u=()=>{a?.(),l?.("next")},$=F=>W[F.value]??F.label,f=Ft.filter(F=>d.includes(F.value)),_=Ft.find(F=>F.value===n),U=(_&&$(_))??(()=>{const F=[...Hs,...zs].find(Y=>Y.value===n);return F?_s(F):n})();return e.jsxs("div",{className:c.cn("flex flex-col w-full gap-3 mb-2",E),children:[e.jsxs("div",{className:"flex lg:flex-row flex-col w-full justify-between gap-3",children:[e.jsx("div",{className:"flex items-center justify-between gap-2",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,y&&e.jsx("button",{type:"button",onClick:P,className:j.CONTROL,children:w}),T&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex shrink-0 items-center",children:[e.jsx("button",{type:"button","aria-label":"Previous",onClick:R,className:j.CONTROL_ICON,children:e.jsx(Bt,{dir:"prev"})}),e.jsx("button",{type:"button","aria-label":"Next",onClick:u,className:j.CONTROL_ICON,children:e.jsx(Bt,{dir:"next"})})]}),e.jsx("h2",{className:"truncate text-[22px] font-normal leading-tight",children:D})]})]})}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-none",children:[i&&V&&e.jsxs(yn,{children:[e.jsxs(vn,{className:c.cn(j.CONTROL,"gap-1.5"),children:[e.jsx("span",{children:U}),e.jsx(Ms,{className:"size-3.5 opacity-60"})]}),e.jsx(Rt,{align:"end",className:"min-w-[220px]",children:V&&f.map(F=>e.jsxs(ut,{onClick:()=>i(F.value),className:c.cn(n===F.value&&"bg-accent"),children:[e.jsx("span",{children:$(F)}),Ut[F.value]&&e.jsx("span",{className:"ml-auto pl-6 text-xs text-muted-foreground",children:Ut[F.value]})]},F.value))})]}),M,N&&e.jsxs(Ie,{children:[e.jsx(Re,{"aria-label":W.settings??"Settings",className:j.CONTROL_ICON,children:e.jsx(Es,{className:"size-5"})}),e.jsx(Te,{align:"end",className:"w-80 p-4",children:m??e.jsx(bn,{})})]})]})]}),I&&C&&e.jsx("div",{className:"flex items-center gap-2 pb-1 -mb-1 scrollbar-none",children:C})]})}const Ws=cn.cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ps({className:t,variant:n,...s}){return e.jsx("div",{className:c.cn(Ws({variant:n}),t),...s})}function $s({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:"m15 18-6-6 6-6"})})}function Fs({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:"m9 18 6-6-6-6"})})}const Us=["January","February","March","April","May","June","July","August","September","October","November","December"];function Bs({date:t,view:n,events:s=[],onNavigatePrev:r,onNavigateNext:a,weekStartsOn:l=1,showEventCount:i=!0,className:h}){const d=Us[t.getMonth()],x=t.getFullYear(),g=i?j.getEventsCountInView(s,t,n,l):0,m=j.getRangeText(t,n);return e.jsxs("div",{className:c.cn("min-w-0 flex-1",h),children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-wrap",children:[e.jsxs("span",{className:"text-base sm:text-lg font-semibold truncate",children:[d," ",x]}),i&&e.jsx(Ps,{variant:"outline",className:"px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0",children:g})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsx(je,{variant:"outline",size:"icon",className:"size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",onClick:r,children:e.jsx($s,{})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:m}),e.jsx(je,{variant:"outline",size:"icon",className:"size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",onClick:a,children:e.jsx(Fs,{})})]})]})}const qs=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function Vs({onClick:t,className:n}){const s=new Date;return e.jsxs("button",{type:"button",className:c.cn("flex size-11 sm:size-14 flex-col items-start overflow-hidden rounded-lg border shrink-0","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","hover:bg-accent/50 transition-colors",n),onClick:t,children:[e.jsx("p",{className:"flex h-4 sm:h-6 w-full items-center justify-center bg-primary text-center text-[10px] sm:text-xs font-semibold text-primary-foreground",children:qs[s.getMonth()]}),e.jsx("p",{className:"flex w-full flex-1 items-center justify-center text-sm sm:text-lg font-bold",children:s.getDate()})]})}const Ys=380,Gs=520,pe=12,Ze=8;function Nn({args:t,anchor:n,render:s,closeLabel:r="Close",onClose:a}){const[l,i]=o.useState(!1),h=o.useRef(null),[d,x]=o.useState(()=>typeof window>"u"?{width:1024,height:768}:{width:window.innerWidth,height:window.innerHeight});o.useEffect(()=>{const E=()=>x({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]);const g=d.width<j.COMPACT_WIDTH,m=g?d.width-pe*2:Math.min(l?Gs:Ys,d.width-pe*2),[b,C]=o.useState({left:n?.x??0,top:n?.y??0,maxHeight:0});o.useLayoutEffect(()=>{const E=h.current;if(!E||g)return;const L=()=>{const{innerHeight:w,innerWidth:H}=window,z=w-pe*2,N=Math.min(E.scrollHeight,z),D=n?n.y-40:96,y=Math.min(Math.max(pe,D),Math.max(pe,w-N-pe)),T=n?n.align==="end"?[n.x-m-Ze,n.x+Ze]:n.align==="start"?[n.x+Ze,n.x-m-Ze]:[n.x-m/2]:[(H-m)/2],V=R=>R>=pe&&R+m<=H-pe,I=T.find(V)??T[0]??pe,P={left:Math.min(Math.max(pe,I),H-m-pe),top:y,maxHeight:w-y-pe};C(R=>R.left===P.left&&R.top===P.top&&R.maxHeight===P.maxHeight?R:P)};if(L(),typeof ResizeObserver>"u")return;const S=new ResizeObserver(L);return S.observe(E),()=>S.disconnect()},[n,m,g,d.height]),o.useEffect(()=>{const E=w=>{w.key==="Escape"&&(w.stopPropagation(),a())},L=w=>{const H=w.target;!H||H===document.body||H===document.documentElement||h.current?.contains(H)||H?.closest?.(j.PORTALLED)||a()};document.addEventListener("keydown",E,!0);const S=window.setTimeout(()=>document.addEventListener("pointerdown",L),0);return()=>{document.removeEventListener("keydown",E,!0),document.removeEventListener("pointerdown",L),window.clearTimeout(S)}},[a]);const k=o.useCallback(E=>{const L=E.clientX,S=E.clientY;let w={left:0,top:0};C(N=>(w=N,N));const H=N=>{const D=w.top+(N.clientY-S);C({left:w.left+(N.clientX-L),top:D,maxHeight:window.innerHeight-D-pe})},z=()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",z)};document.addEventListener("pointermove",H),document.addEventListener("pointerup",z)},[]);if(typeof document>"u")return null;const M=e.jsxs("div",{ref:h,role:"dialog",className:c.cn("ic-quick-create fixed flex flex-col overflow-hidden rounded-2xl","bg-popover text-popover-foreground shadow-2xl ring-1 ring-border"),style:g?{left:pe,right:pe,bottom:pe,zIndex:ue.IC_Z_CARD,maxHeight:`calc(100dvh - ${pe*2}px)`}:{left:b.left,top:b.top,width:m,zIndex:ue.IC_Z_CARD,maxHeight:b.maxHeight||void 0},onPointerDown:E=>E.stopPropagation(),children:[e.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 pt-2",children:[e.jsx("button",{type:"button","aria-label":"Move",onPointerDown:k,className:c.cn("flex size-7 cursor-grab items-center justify-center rounded-full","text-muted-foreground active:cursor-grabbing","hover:bg-accent hover:text-accent-foreground"),children:e.jsxs("span",{className:"flex flex-col gap-[3px]",children:[e.jsx("span",{className:"block h-[1.5px] w-3.5 rounded bg-current"}),e.jsx("span",{className:"block h-[1.5px] w-3.5 rounded bg-current"})]})}),e.jsx("button",{type:"button","aria-label":r,onClick:a,className:c.cn("flex size-7 items-center justify-center rounded-full","text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e.jsx(Le.X,{className:"size-4"})})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:s(t,{close:a,expand:i})})]});return St.createPortal(M,document.body)}const et=200,Ks=60,Xs=300,Js=7,qt=2,gt=40,Qs=18;function Zs(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m18 15-6-6-6 6"})})}function er(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function tr(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m15 18-6-6 6-6"})})}function nr(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function sr({containerRef:t,currentDate:n,className:s}){const[r,a]=o.useState({canUp:!1,canDown:!1,canLeft:!1,canRight:!1}),[l,i]=o.useState({x:0,y:0}),[h,d]=o.useState(!1),x=r.canUp||r.canDown||r.canLeft||r.canRight,g=o.useRef(null),m=o.useRef(null),b=o.useRef(null),C=o.useRef(!1),k=o.useRef({x:0,y:0}),M=o.useRef({x:0,y:0}),E=o.useRef(0),L=o.useRef(null),S=o.useCallback(()=>{const u=t.current;if(!u)return;const $=4;a({canUp:u.scrollTop>$,canDown:u.scrollTop+u.clientHeight<u.scrollHeight-$,canLeft:u.scrollLeft>$,canRight:u.scrollLeft+u.clientWidth<u.scrollWidth-$})},[t]);o.useEffect(()=>{const u=t.current;if(!u)return;S(),u.addEventListener("scroll",S,{passive:!0});const $=new ResizeObserver(S);$.observe(u);const f=new MutationObserver(S);return f.observe(u,{childList:!0,subtree:!0}),()=>{u.removeEventListener("scroll",S),$.disconnect(),f.disconnect()}},[t,S]);const w=o.useCallback((u,$)=>{t.current?.scrollBy({left:u,top:$,behavior:"smooth"})},[t]),H=o.useCallback(()=>w(0,-et),[w]),z=o.useCallback(()=>w(0,et),[w]),N=o.useCallback(()=>w(-et,0),[w]),D=o.useCallback(()=>w(et,0),[w]),y=o.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null),m.current&&(clearInterval(m.current),m.current=null)},[]),T=o.useCallback(u=>{u(),g.current=setTimeout(()=>{m.current=setInterval(u,Ks)},Xs)},[]);o.useEffect(()=>y,[y]),o.useEffect(()=>{const u=t.current;if(!u)return;const $=f=>{if(f.ctrlKey||f.metaKey||f.altKey)return;const _=f.target.tagName;if(!(_==="INPUT"||_==="TEXTAREA"||f.target.isContentEditable))switch(f.key){case"ArrowUp":f.preventDefault(),H();break;case"ArrowDown":f.preventDefault(),z();break;case"ArrowLeft":f.preventDefault(),N();break;case"ArrowRight":f.preventDefault(),D();break}};return u.addEventListener("keydown",$),()=>u.removeEventListener("keydown",$)},[t,H,z,N,D]),o.useEffect(()=>{if(!x)return;const u=L.current;if(!u)return;let $=0;const f=()=>{const Y=u.offsetParent;if(!Y)return;const se=Y.getBoundingClientRect(),J=window.innerHeight;if(se.height<=J){u.style.removeProperty("top"),u.style.removeProperty("bottom");return}const ne=Math.min(se.bottom,J)-se.top,oe=u.offsetHeight,ee=ne-oe-12,he=12,Q=Y.clientHeight-oe-12,le=Math.max(he,Math.min(ee,Q));u.style.top=`${le}px`,u.style.bottom="auto"},_=()=>{cancelAnimationFrame($),$=requestAnimationFrame(f)},U=[window];let F=u.parentElement;for(;F;){const Y=getComputedStyle(F);/(auto|scroll)/.test(Y.overflow+Y.overflowY)&&U.push(F),F=F.parentElement}for(const Y of U)Y.addEventListener("scroll",_,{passive:!0});return window.addEventListener("resize",_,{passive:!0}),f(),()=>{cancelAnimationFrame($);for(const Y of U)Y.removeEventListener("scroll",_);window.removeEventListener("resize",_)}},[x]);const V=o.useCallback(()=>{C.current=!1,d(!1),i({x:0,y:0}),M.current={x:0,y:0},E.current&&cancelAnimationFrame(E.current)},[]),I=o.useCallback(u=>{u.preventDefault(),C.current=!0,d(!0),k.current={x:u.clientX,y:u.clientY},M.current={x:0,y:0},u.target.setPointerCapture(u.pointerId);const $=()=>{if(!C.current)return;const f=t.current;if(f){const{x:_,y:U}=M.current,F=Math.sqrt(_*_+U*U);if(F>qt){const se=Math.min(F/gt,1)*Qs;f.scrollLeft+=_/F*se,f.scrollTop+=U/F*se}}E.current=requestAnimationFrame($)};E.current=requestAnimationFrame($)},[t]),W=o.useCallback(u=>{if(!C.current)return;const $=u.clientX-k.current.x,f=u.clientY-k.current.y;M.current={x:$,y:f};const _=Math.sqrt($*$+f*f);if(_<qt)i({x:0,y:0});else{const F=Math.min(_,gt)/gt*Js;i({x:$/_*F,y:f/_*F})}},[]),P=o.useCallback(u=>{switch(u.key){case"ArrowUp":u.preventDefault(),H();break;case"ArrowDown":u.preventDefault(),z();break;case"ArrowLeft":u.preventDefault(),N();break;case"ArrowRight":u.preventDefault(),D();break}},[H,z,N,D]);if(!x)return null;const R=n?n.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):null;return e.jsxs("div",{ref:L,className:`inno-scroll-nav-wrapper ${s??""}`,role:"toolbar","aria-label":"Scroll navigation",onKeyDown:P,children:[R&&e.jsx("div",{className:"inno-scroll-nav-date","aria-live":"polite",children:R}),e.jsxs("div",{className:"inno-scroll-nav",children:[e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-up ${r.canUp?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll up",disabled:!r.canUp,onPointerDown:()=>T(H),onPointerUp:y,onPointerLeave:y,tabIndex:r.canUp?0:-1,children:e.jsx(Zs,{})}),e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-left ${r.canLeft?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll left",disabled:!r.canLeft,onPointerDown:()=>T(N),onPointerUp:y,onPointerLeave:y,tabIndex:r.canLeft?0:-1,children:e.jsx(tr,{})}),e.jsx("button",{ref:b,type:"button",className:`inno-scroll-nav-joystick ${h?"inno-scroll-nav-joystick-active":""}`,"aria-label":"Drag to scroll freely",onPointerDown:I,onPointerMove:W,onPointerUp:V,onPointerCancel:V,tabIndex:0,children:e.jsx("span",{className:"inno-scroll-nav-joystick-dot",style:{transform:`translate(${l.x}px, ${l.y}px)`}})}),e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-right ${r.canRight?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll right",disabled:!r.canRight,onPointerDown:()=>T(D),onPointerUp:y,onPointerLeave:y,tabIndex:r.canRight?0:-1,children:e.jsx(nr,{})}),e.jsx("button",{type:"button",className:`inno-scroll-nav-btn inno-scroll-nav-down ${r.canDown?"":"inno-scroll-nav-btn-disabled"}`,"aria-label":"Scroll down",disabled:!r.canDown,onPointerDown:()=>T(z),onPointerUp:y,onPointerLeave:y,tabIndex:r.canDown?0:-1,children:e.jsx(er,{})})]})]})}function Vt({dir:t}){return e.jsx("svg",{viewBox:"0 0 24 24",className:"size-4",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:t==="prev"?"M15 18L9 12l6-6":"M9 18l6-6-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function At({selected:t,onSelect:n,locale:s,weekStartsOn:r=1,className:a}){const[l,i]=o.useState(()=>j.startOfMonth(t)),h=o.useMemo(()=>{const g=j.startOfWeek(j.startOfMonth(l),r);return Array.from({length:6},(m,b)=>Array.from({length:7},(C,k)=>{const M=new Date(g);return M.setDate(g.getDate()+b*7+k),M}))},[l,r]),d=o.useMemo(()=>{const g=j.startOfWeek(new Date,r),m=new Intl.DateTimeFormat(s,{weekday:"narrow"});return Array.from({length:7},(b,C)=>{const k=new Date(g);return k.setDate(g.getDate()+C),m.format(k)})},[s,r]),x=new Intl.DateTimeFormat(s,{month:"long",year:"numeric"}).format(l);return e.jsxs("div",{className:c.cn("select-none",a),children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between pl-2",children:[e.jsx("span",{className:"text-sm font-medium",children:x}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{type:"button","aria-label":"Previous month",onClick:()=>i(g=>j.addMonths(g,-1)),className:"flex size-7 items-center justify-center rounded-full text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:e.jsx(Vt,{dir:"prev"})}),e.jsx("button",{type:"button","aria-label":"Next month",onClick:()=>i(g=>j.addMonths(g,1)),className:"flex size-7 items-center justify-center rounded-full text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:e.jsx(Vt,{dir:"next"})})]})]}),e.jsxs("div",{className:"grid grid-cols-7",children:[d.map((g,m)=>e.jsx("span",{className:"flex h-7 items-center justify-center text-[10px] text-muted-foreground",children:g},m)),h.flat().map(g=>{const m=!j.isSameMonth(g,l),b=j.isToday(g),C=j.isSameDay(g,t);return e.jsx("button",{type:"button",onClick:()=>n(g),className:c.cn("flex h-7 items-center justify-center rounded-full text-xs","hover:bg-accent hover:text-accent-foreground",m&&"text-muted-foreground/60",C&&!b&&"bg-accent font-medium text-accent-foreground",b&&"bg-primary font-medium text-primary-foreground hover:bg-primary"),children:g.getDate()},g.toISOString())})]})]})}function rr(){return e.jsx("svg",{viewBox:"0 0 24 24",className:"size-4",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function kn({selected:t,onSelect:n,locale:s,weekStartsOn:r,onCreate:a,createLabel:l="Create",children:i,className:h}){return e.jsx("aside",{className:c.cn("ic-sidebar hidden w-64 shrink-0 flex-col gap-5 overflow-y-auto","py-2 pr-3 lg:flex",h),children:e.jsx(Dn,{selected:t,onSelect:n,...s&&{locale:s},...r!==void 0&&{weekStartsOn:r},...a&&{onCreate:a},...l&&{createLabel:l},children:i})})}function Dn({selected:t,onSelect:n,onCreate:s,createLabel:r="Create",locale:a,weekStartsOn:l,children:i}){return e.jsxs(e.Fragment,{children:[s&&e.jsxs("button",{type:"button",onClick:s,className:c.cn(j.CONTROL,"w-fit gap-2 bg-popover shadow-sm"),children:[e.jsx(rr,{}),e.jsx("span",{children:r})]}),e.jsx(At,{selected:t,onSelect:n,...a&&{locale:a},...l!==void 0&&{weekStartsOn:l}}),i&&e.jsx("div",{className:"@container min-w-0",children:i})]})}function Cn({label:t="Filters",open:n,onOpenChange:s,...r}){return e.jsxs(Tt,{...n!==void 0&&{open:n},...s&&{onOpenChange:s},children:[e.jsx(Lt,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":t,className:c.cn(j.CONTROL_ICON,"lg:hidden"),children:e.jsx(Le.SlidersHorizontal,{className:"size-4"})})}),e.jsxs(xt,{className:c.cn("left-0 right-auto w-72 max-w-[85vw] overflow-y-auto border-l-0 border-r p-4","data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left"),children:[e.jsx(ht,{className:"sr-only",children:t}),e.jsx("div",{className:"@container flex flex-col gap-5",children:e.jsx(Dn,{...r})})]})]})}function Mn({children:t,title:n,className:s}){return e.jsxs("div",{className:c.cn("flex flex-col gap-4",s),children:[n&&e.jsx("div",{className:"px-1 text-sm font-medium",children:n}),t]})}const or={allDay:"All day",empty:"Nothing scheduled"},ar=t=>t.data?.isAccepted??t.isAccepted??!0;function ir({event:t}){const n=t.hexColor??"var(--primary)";return e.jsx("span",{"aria-hidden":"true",className:"size-2.5 shrink-0 rounded-full",style:ar(t)?{background:n}:{border:`2px solid ${n}`,background:"transparent"}})}function Yt(){return e.jsx("div",{className:"relative my-0.5 h-0","aria-hidden":"true",children:e.jsxs("div",{className:"absolute inset-x-0 flex items-center",children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full bg-red-500"}),e.jsx("span",{className:"h-px flex-1 bg-red-500"})]})})}function lr({event:t,time:n,owners:s,onEventClick:r,renderPopover:a}){const l=e.jsxs("span",{className:c.cn("flex w-full items-center gap-3 rounded px-2 py-1.5 text-left","hover:bg-accent hover:text-accent-foreground",t.isCanceled&&"text-muted-foreground line-through"),children:[e.jsx(ir,{event:t}),e.jsx("span",{className:"w-28 shrink-0 text-sm tabular-nums text-muted-foreground",children:n}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:t.title}),s&&e.jsx("span",{className:"max-w-[35%] shrink-0 truncate text-xs text-muted-foreground",children:s})]});return a?e.jsxs(Ie,{children:[e.jsx(Re,{asChild:!0,children:e.jsx("button",{type:"button",className:"w-full",children:l})}),e.jsx(Te,{className:"w-96 p-0",align:"start",children:a({event:t,onClose:()=>document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0}))})})]}):e.jsx("button",{type:"button",className:"w-full",onClick:i=>r?.(t,i),children:l})}function En({events:t,date:n,daysAhead:s,locale:r,hour12:a,labels:l,emptyState:i,onEventClick:h,className:d,renderEvent:x,renderPopover:g}){const m={...or,...l},b=o.useMemo(()=>{const S=j.getViewDateRange(n,"agenda"),w=new Date(S.startDate);w.setHours(0,0,0,0);const H=s===void 0?S.endDate:new Date(w.getTime()+s*864e5),z=new Map;for(const N of t){if(N.endDate<w||N.startDate>H)continue;const D=new Date(N.startDate);D.setHours(0,0,0,0),D<w&&D.setTime(w.getTime());const y=D.toDateString(),T=z.get(y)??{day:D,events:[]};T.events.push(N),z.set(y,T)}return[...z.values()].sort((N,D)=>N.day.getTime()-D.day.getTime()).map(N=>({...N,events:N.events.sort((D,y)=>D.startDate.getTime()-y.startDate.getTime())}))},[t,n,s]);if(b.length===0)return e.jsx("div",{className:c.cn("flex h-full flex-col items-center justify-center py-12",d),children:i??e.jsx("p",{className:"text-sm text-muted-foreground",children:m.empty})});const C=new Date,k=new Set;for(const S of b)for(const w of S.events)for(const H of w.participants??[])k.add(H.id);const M=k.size>1,E=S=>M?(S.participants??[]).map(w=>w.name).filter(Boolean).join(", "):void 0,L=S=>{if(S.isAllDay)return m.allDay;const w=j.formatClock(S.startDate,{locale:r,hour12:a});return j.isSameDay(S.startDate,S.endDate)?`${w} – ${j.formatClock(S.endDate,{locale:r,hour12:a})}`:w};return e.jsx("div",{className:c.cn("flex h-full flex-col overflow-auto",d),children:b.map(({day:S,events:w})=>{const H=j.isToday(S),z=H?w.findIndex(N=>N.endDate>C):-1;return e.jsxs("div",{className:c.cn("flex border-b last:border-b-0"),children:[e.jsxs("div",{className:c.cn("flex w-32 shrink-0 items-center gap-2 py-3 pl-4"),children:[e.jsx("span",{className:c.cn("flex size-9 items-center justify-center rounded-full text-xl",H?"bg-primary font-medium text-primary-foreground":"text-foreground"),children:S.getDate()}),e.jsx("span",{className:c.cn("text-[11px] font-medium uppercase tracking-wide",H?"text-primary":"text-muted-foreground"),children:new Intl.DateTimeFormat(r,{month:"short",weekday:"short"}).format(S)})]}),e.jsxs("div",{className:"min-w-0 flex-1 py-2 pr-4",children:[w.map((N,D)=>e.jsxs("div",{children:[D===z&&e.jsx(Yt,{}),x?x({event:N,variant:"full"}):e.jsx(lr,{event:N,time:L(N),owners:E(N)||void 0,onEventClick:h,renderPopover:g})]},N.id)),H&&z===-1&&e.jsx(Yt,{})]})]},S.toDateString())})})}const tt=360,nt=480,yt=280;function Sn({isOpen:t,onClose:n,date:s,events:r,anchorRect:a,badgeVariant:l="colored",onEventClick:i,renderEvent:h,renderPopover:d,className:x}){const g=o.useRef(null),m=o.useRef(null),[b,C]=o.useState("closed"),k=o.useRef(null);a&&(k.current=a);const M=a??k.current,E=o.useMemo(()=>[...r].sort((y,T)=>y.startDate.getTime()-T.startDate.getTime()),[r]),L=o.useMemo(()=>{const y=M;if(!y)return{top:0,left:0,width:tt,maxHeight:nt};const T=typeof window<"u"?window.innerWidth:1200,V=typeof window<"u"?window.innerHeight:800;let I=y.left+y.width/2-tt/2;I=Math.max(16,Math.min(I,T-tt-16));const W=Math.min(r.length*68+80,nt);let P=y.top+y.height/2-W/2;return P=Math.max(16,Math.min(P,V-W-16)),{top:P,left:I,width:tt,maxHeight:nt}},[M,r.length]);o.useLayoutEffect(()=>{if(t&&M)C("entering"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{C("open")})});else if(!t&&(b==="open"||b==="entering")){C("exiting");const y=setTimeout(()=>{C("closed"),k.current=null},yt);return()=>clearTimeout(y)}},[t,M]),o.useEffect(()=>{if(b==="closed")return;const y=T=>{T.key==="Escape"&&(T.stopPropagation(),n())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[b,n]),o.useEffect(()=>{b==="open"&&m.current&&m.current.focus()},[b]);const S=o.useCallback(y=>{y.target===g.current&&n()},[n]);if(b==="closed")return null;const w=b==="entering"||b==="exiting",H=M,z=w&&H?{position:"fixed",top:H.top,left:H.left,width:H.width,height:H.height,maxHeight:H.height,opacity:b==="entering"?.7:0,transform:"scale(1)",borderRadius:"8px"}:{position:"fixed",top:L.top,left:L.left,width:L.width,maxHeight:L.maxHeight,opacity:1,transform:"scale(1)",borderRadius:"12px"},N=w?0:1,D=s.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"});return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:g,role:"presentation",onClick:S,className:"ic-expansion-backdrop",style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:N,transition:`opacity ${yt}ms cubic-bezier(0.32, 0.72, 0, 1)`}}),e.jsxs("div",{ref:m,role:"dialog","aria-modal":"true","aria-label":`Events for ${D}`,tabIndex:-1,className:c.cn("ic-expansion-panel","!bg-white border border-border shadow-2xl overflow-hidden","focus:outline-none",x),style:{...z,zIndex:41,transition:`all ${yt}ms cubic-bezier(0.32, 0.72, 0, 1)`,willChange:"top, left, width, height, max-height, opacity, border-radius"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-muted/30",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:D}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.length," event",r.length!==1?"s":""]})]}),e.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center size-7 rounded-full hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":"Close",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})})]}),e.jsxs("div",{className:"overflow-y-auto px-3 py-2 space-y-1.5",style:{maxHeight:`${nt-64}px`},children:[E.map(y=>e.jsx("div",{onPointerDown:T=>T.stopPropagation(),children:h?h({event:y,variant:"compact"}):e.jsx(Xe,{event:y,variant:"compact",badgeVariant:l,onClick:i,renderPopover:d,showTime:!0})},y.id)),r.length===0&&e.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No events"})]})]})]})}function cr({event:t,date:n,onEventClick:s,disablePopover:r,renderPopover:a}){const[l,i]=o.useState(!1),h=Ae(t.color),d=j.detectAllDayEvent(t),x=j.isSameDay(t.startDate,n),g=j.isSameDay(t.endDate,n),m=d&&j.isSameDay(t.startDate,t.endDate),b=o.useCallback(()=>{r&&s?s(t):r||i(!0)},[r,s,t]),C=o.useCallback(()=>{i(!1)},[]),k=e.jsxs("button",{type:"button",onClick:b,title:j.formatEventTimeDisplay(t),className:c.cn("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80","sm:px-2 sm:py-1 sm:text-xs",h.bg,h.text,t.isCanceled&&"opacity-60 line-through"),children:[!m&&x&&!g&&"→ ",!m&&!x&&g&&" ←",!m&&!x&&!g&&"↔ ",e.jsx("span",{className:"truncate max-w-24 sm:max-w-32",children:t.title}),m&&e.jsx("span",{className:"text-[9px] opacity-70 sm:text-[10px]",children:"All day"})]}),M=e.jsx(be,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:j.formatEventTimeDisplay(t)})]})});return r?e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:k}),M]}):e.jsxs(Ie,{open:l,onOpenChange:i,children:[e.jsx(Re,{asChild:!0,children:k}),e.jsx(Te,{className:"w-80",children:a?a({event:t,onClose:C}):e.jsx(dr,{event:t,onClose:C})})]})}function dr({event:t,onClose:n}){const s=Ae(t.color),r=t.isCanceled??!1;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:c.cn("size-4 rounded shrink-0 mt-0.5",s.dot)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:c.cn("font-semibold text-lg",r&&"line-through opacity-50"),children:t.title}),e.jsx("div",{className:"flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums",children:j.formatEventTimeDisplay(t)})]})]}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.isAllDay&&e.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded-full font-medium",children:"All day"}),r&&e.jsx("span",{className:"text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium",children:"Canceled"})]}),e.jsx("div",{className:"flex justify-end pt-2 border-t",children:e.jsx("button",{type:"button",onClick:n,className:"text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",children:"Close"})})]})}function Tn({events:t,date:n,onEventClick:s,disablePopover:r=!1,renderPopover:a,className:l}){if(t.length===0)return null;const i=t.some(x=>j.detectAllDayEvent(x)&&j.isSameDay(x.startDate,x.endDate)),h=t.some(x=>!j.isSameDay(x.startDate,x.endDate)||j.detectAllDayEvent(x)&&!j.isSameDay(x.startDate,x.endDate)),d=i&&h?"All day / Multi-day":i?"All day":"Multi-day";return e.jsxs("div",{className:c.cn("border-b bg-muted/20 px-2 py-1.5 space-y-1","sm:px-4 sm:py-2",l),children:[e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground sm:text-xs",children:d}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(x=>e.jsx(cr,{event:x,date:n,onEventClick:s,disablePopover:r,renderPopover:a},x.id))})]})}const ur=5;function Ln({slot:t,onSelectionStart:n,onSelectionMove:s,onSelectionEnd:r,isSelected:a=!1,isSelecting:l=!1,disabled:i=!1,ariaLabel:h,children:d,className:x,height:g,style:m,dataAttributes:b}){const C=o.useRef(null),k=o.useRef(!1),M=o.useRef(!1),E=o.useRef(null),[L,S]=o.useState(!1),w=ue.useOptionalDragDrop(),H=o.useCallback(W=>{i||W.button!==0&&W.pointerType==="mouse"||(W.preventDefault(),C.current={x:W.clientX,y:W.clientY},k.current=!1,M.current=!0,n?.(t))},[i,t,n]),z=o.useCallback(W=>{if(!(C.current&&M.current&&!i))return;const P=W.clientX-C.current.x,R=W.clientY-C.current.y;Math.sqrt(P*P+R*R)>=ur&&(k.current=!0)},[i]),N=o.useCallback(W=>{i||(W.buttons>0||l)&&s?.(t)},[i,l,t,s]),D=o.useCallback(()=>{i||(r?.(),C.current=null,k.current=!1,M.current=!1)},[i,r]),y=o.useCallback(W=>{if(!w?.isDragging||i)return;W.preventDefault(),W.dataTransfer.dropEffect="move",S(!0);const P=new Date,R=t.hour??P.getHours(),u=t.minute??(P.getMinutes()>=30?30:0);w.updateDragPreview?.(t.date,R,u)},[w,i,t]),T=o.useCallback(()=>{S(!1)},[]),V=o.useCallback(W=>{W.preventDefault(),S(!1),!(!w?.isDragging||i)&&w.endDrag?.()},[w,i]);o.useEffect(()=>{const W=()=>{M.current&&(M.current=!1,C.current=null,k.current=!1)};return window.addEventListener("pointerup",W),window.addEventListener("pointercancel",W),()=>{window.removeEventListener("pointerup",W),window.removeEventListener("pointercancel",W)}},[]);const I=o.useCallback(W=>{i||(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),n?.(t),r?.())},[i,t,n,r]);return e.jsx("button",{ref:E,type:"button","aria-label":h,"aria-disabled":i,"aria-pressed":a,disabled:i,onPointerDown:H,onPointerMove:z,onPointerUp:D,onPointerEnter:N,onKeyDown:I,onDragOver:y,onDragLeave:T,onDrop:V,className:c.cn("select-none touch-none cursor-pointer transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",!(l||i)&&"hover:bg-blue-50/60",a&&"bg-blue-100/70",L&&"bg-primary/20 ring-2 ring-primary ring-inset",i&&"cursor-not-allowed opacity-50",x),style:{height:g,...m},...b,children:d})}function pt({slot:t,date:n,hour:s,minute:r,ariaLabel:a,...l}){const i=t??{date:n,hour:s??0,minute:r??0},h=a??`Add event at ${(i.hour??0).toString().padStart(2,"0")}:${(i.minute??0).toString().padStart(2,"0")} on ${i.date.toLocaleDateString()}`;return e.jsx(Ln,{slot:i,ariaLabel:h,...l})}function In({slot:t,date:n,ariaLabel:s,...r}){const a=t??{date:n},l=s??`Select ${a.date.toLocaleDateString()}`;return e.jsx(Ln,{slot:a,ariaLabel:l,...r})}const Fe=j.DEFAULT_HOUR_HEIGHT,vt=72,jt=80;function Rn({events:t,date:n,visibleHours:s={startHour:0,endHour:24},workingHours:r,slotDuration:a=30,badgeVariant:l="colored",onEventClick:i,onSlotSelect:h,className:d,renderEvent:x,renderPopover:g}){const m=60/a,b=100/m,C=o.useMemo(()=>{const u=[];for(let $=0;$<m;$++)u.push($*a);return u},[m,a]),k=o.useMemo(()=>j.getEventsForDay(t,n),[t,n]),{singleDay:M,multiDay:E}=o.useMemo(()=>j.separateEventsByDuration(k),[k]),L=o.useMemo(()=>{const u=j.calculateOverlappingPositions(M,n,s,Fe),$=new Map;for(const f of u)$.set(f.event.id,f.position);return $},[M,n,s]),S=o.useMemo(()=>j.getVisibleHoursArray(s),[s]),w=new Date,H=j.isToday(n),z=o.useMemo(()=>{if(!H)return 0;const u=w.getHours()+w.getMinutes()/60;return u<s.startHour||u>s.endHour?-1:(u-s.startHour)*Fe},[H,s,w]),N=o.useRef(null);o.useLayoutEffect(()=>{const u=N.current;if(!u)return;const $=()=>{let f;if(H){const U=new Date().getHours();f=Math.max(U-1,s.startHour)}else{const U=n.getDay(),F=r?.[U];F?.enabled&&F.from>0?f=Math.max(F.from-1,s.startHour):f=Math.max(7,s.startHour)}const _=(f-s.startHour)*Fe;u.scrollTo({top:_,behavior:"instant"})};requestAnimationFrame(()=>{requestAnimationFrame($)})},[n,r,s,H]);const D=ue.useOptionalSlotSelection(),y=o.useCallback(u=>{D?.startSelection(u)},[D]),T=o.useCallback(u=>{D?.updateSelection(u)},[D]),V=o.useCallback(()=>{D?.endSelection()},[D]),I=o.useCallback(u=>{i?.(u)},[i]),W=n.toLocaleDateString([],{weekday:"short"}),P=n.getDate(),R=j.isToday(n);return e.jsxs("div",{className:c.cn("flex flex-col h-full",d),children:[e.jsx("div",{className:c.cn("flex items-center gap-3 border-b px-4 py-3",R&&void 0),children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("span",{className:c.cn("text-[11px] font-medium uppercase tracking-wide",R?"text-primary":"text-muted-foreground"),children:W}),e.jsx("span",{className:c.cn("flex items-center justify-center rounded-full mt-0.5","size-12 text-3xl font-normal",R?"bg-primary text-primary-foreground":"text-foreground"),children:P})]})}),E.length>0&&e.jsx(Tn,{events:E,date:n,onEventClick:I,disablePopover:!!i&&!g,renderPopover:g}),e.jsx("div",{ref:N,className:c.cn("flex-1"),children:e.jsxs("div",{className:"relative min-h-full",children:[S.map((u,$)=>{const _=!j.isWorkingHour(n,u,r);return e.jsxs("div",{className:c.cn("relative flex",_&&"bg-calendar-disabled-hour",void 0),style:{height:Fe},children:[e.jsx("div",{className:c.cn("relative flex-shrink-0 border-r border-border/50 bg-background"),style:{width:vt},children:e.jsx("div",{className:"absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center",children:$!==0&&e.jsx("span",{className:c.cn("text-[10px] sm:text-xs text-muted-foreground"),children:j.formatHourLabel(u)})})}),e.jsxs("div",{className:"relative flex-1",children:[H&&!_&&e.jsx("div",{className:"absolute inset-0 bg-primary/5"}),$!==0&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 border-b border-border/50"}),C.slice(1).map(U=>e.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",style:{top:`${U/60*100}%`}},U)),C.map((U,F)=>{const Y={date:n,hour:u,minute:U};return e.jsx(pt,{slot:Y,onSelectionStart:y,onSelectionMove:T,onSelectionEnd:V,isSelected:D?.isSlotSelected(Y)??!1,isSelecting:D?.isSelecting??!1,disabled:_,className:"absolute inset-x-0",style:{top:`${F*b}%`,height:`${b}%`},ariaLabel:`Add event at ${j.formatHourLabel(u)}:${String(U).padStart(2,"0")}`},U)})]})]},u)}),e.jsx("div",{className:"absolute top-0 bottom-0 right-0 pointer-events-none",style:{left:vt},children:M.map(u=>{const $=L.get(u.id);if(!$)return null;const f=`calc(${$.width}% - 2px)`,_=`max(${jt}px, ${f})`;return x?e.jsx("div",{className:"absolute pointer-events-auto p-0.5",style:{top:`${$.top}px`,left:`${$.left}%`,width:_,minWidth:`${jt}px`},children:x({event:u,position:$})},u.id):e.jsx(ft,{event:u,position:{top:$.top,left:$.left,width:$.width,minWidth:jt},hourHeight:Fe,badgeVariant:l,onClick:i,disablePopover:!!i&&!g,renderPopover:g,className:c.cn("pointer-events-auto")},u.id)})}),H&&z>=0&&e.jsxs("div",{"data-ic-now":"",className:c.cn("absolute left-0 right-0 z-20 flex items-center pointer-events-none"),style:{top:z,left:vt},children:[e.jsx("div",{className:"h-2.5 w-2.5 -ml-1 rounded-full bg-red-500"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]})]})})]})}const mr=[{full:"Monday",short:"Mon",tiny:"M"},{full:"Tuesday",short:"Tue",tiny:"T"},{full:"Wednesday",short:"Wed",tiny:"W"},{full:"Thursday",short:"Thu",tiny:"T"},{full:"Friday",short:"Fri",tiny:"F"},{full:"Saturday",short:"Sat",tiny:"S"},{full:"Sunday",short:"Sun",tiny:"S"}],xr=[{full:"Sunday",short:"Sun",tiny:"S"},{full:"Monday",short:"Mon",tiny:"M"},{full:"Tuesday",short:"Tue",tiny:"T"},{full:"Wednesday",short:"Wed",tiny:"W"},{full:"Thursday",short:"Thu",tiny:"T"},{full:"Friday",short:"Fri",tiny:"F"},{full:"Saturday",short:"Sat",tiny:"S"}],Ue=3;function Ct({events:t,date:n,weekStartsOn:s=1,badgeVariant:r="colored",onEventClick:a,onSlotSelect:l,onDayClick:i,className:h,renderEvent:d,renderPopover:x,showMoreMode:g}){const m=g??"expand",[b,C]=o.useState(null),[k,M]=o.useState(null),E=o.useMemo(()=>j.generateMonthGrid(n,s),[n,s]),L=o.useMemo(()=>{const y=new Map;for(const T of E){const V=T.date.toDateString(),I=j.getEventsForDay(t,T.date);I.sort((W,P)=>W.startDate.getTime()-P.startDate.getTime()),y.set(V,I)}return y},[E,t]),S=ue.useOptionalSlotSelection(),w=o.useCallback(y=>{S?.startSelection(y)},[S]),H=o.useCallback(y=>{S?.updateSelection(y)},[S]),z=o.useCallback(()=>{S?.endSelection()},[S]),N=o.useCallback(y=>{i?.(y)},[i]),D=s===0?xr:mr;return e.jsxs("div",{className:c.cn("flex flex-col h-full overflow-hidden",h),children:[e.jsx("div",{className:"flex flex-col flex-1 overflow-auto",children:e.jsxs("div",{className:"flex flex-col flex-1 min-w-[560px] sm:min-w-0",children:[e.jsx("div",{className:c.cn("grid grid-cols-7 border-b !sticky !top-0 bg-background z-10"),children:D.map((y,T)=>e.jsxs("div",{className:c.cn("py-2 sm:py-2.5 text-center text-[11px] uppercase font-medium tracking-wide text-muted-foreground",T>=5&&"text-muted-foreground/70",void 0),children:[e.jsx("span",{className:"sm:hidden",children:y.short}),e.jsx("span",{className:"hidden sm:inline",children:y.short})]},y.full))}),e.jsx("div",{className:c.cn("grid grid-cols-7 auto-rows-min"),children:E.map(y=>{const T=y.date.toDateString(),V=L.get(T)||[],I=j.isToday(y.date),W=y.date.getDay()===0||y.date.getDay()===6,P=V.length>Ue;return e.jsxs(In,{date:y.date,dataAttributes:{"data-day-key":T,...I&&{"data-ic-today":""}},onSelectionStart:w,onSelectionMove:H,onSelectionEnd:z,isSelected:S?.isSlotSelected({date:y.date})??!1,isSelecting:S?.isSelecting??!1,className:c.cn("relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden","[&:nth-child(7n)]:border-r-0",!y.isCurrentMonth&&"bg-muted/20",W&&y.isCurrentMonth&&"bg-muted/10",I&&!y.isCurrentMonth&&W&&void 0),ariaLabel:`${y.date.toLocaleDateString()} - ${V.length} events. Click to create event, double-click to view day.`,children:[e.jsx("div",{className:c.cn("flex items-center justify-center p-1",!y.isCurrentMonth&&"text-muted-foreground/40"),children:e.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),N(y.date)},className:c.cn("flex items-center justify-center rounded-full transition-colors","size-7 text-sm font-normal",I?"bg-primary text-primary-foreground":"hover:bg-muted"),children:y.date.getDate()})}),e.jsxs("div",{className:c.cn("flex-1 overflow-hidden px-2 pt-1 pb-1 space-y-1"),children:[V.slice(0,Ue).map(R=>e.jsx("div",{onPointerDown:u=>{u.stopPropagation()},children:d?d({event:R,variant:"compact"}):e.jsx(Xe,{event:R,variant:"compact",badgeVariant:r,onClick:a,disablePopover:!!a&&!x,renderPopover:x,showTime:!1,enableDrag:!0})},R.id)),P&&m==="expand"&&e.jsxs("button",{type:"button",onPointerDown:R=>R.stopPropagation(),onClick:R=>{R.stopPropagation();const u=document.querySelector(`[data-day-key="${T}"]`);M({date:y.date,events:V,rect:u?.getBoundingClientRect()??new DOMRect(window.innerWidth/2-180,window.innerHeight/2-240,0,0)})},className:c.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer"),children:["+",V.length-Ue," more"]}),P&&m==="popover"&&e.jsxs(Ie,{open:b===T,onOpenChange:R=>C(R?T:null),children:[e.jsx(Re,{asChild:!0,children:e.jsxs("button",{type:"button",onPointerDown:R=>R.stopPropagation(),onClick:R=>{R.stopPropagation(),C(T)},className:c.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer"),children:["+",V.length-Ue," more"]})}),e.jsxs(Te,{align:"start",side:"right",sideOffset:8,className:"w-72 max-h-80 overflow-y-auto p-2",onPointerDown:R=>R.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 pb-2 border-b",children:[e.jsx("span",{className:"text-sm font-medium",children:y.date.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[V.length," events"]})]}),e.jsx("div",{className:"space-y-1.5",children:V.map(R=>e.jsx("div",{children:d?d({event:R,variant:"compact"}):e.jsx(Xe,{event:R,variant:"compact",badgeVariant:r,onClick:u=>{C(null),a?.(u)},disablePopover:!!a&&!x,renderPopover:x,showTime:!0})},R.id))})]})]}),P&&m==="dayView"&&e.jsxs("div",{onPointerDown:R=>{R.stopPropagation(),N(y.date)},className:c.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer"),children:["+",V.length-Ue," more"]})]})]},T)})})]})}),e.jsx(Sn,{isOpen:k!==null,onClose:()=>M(null),date:k?.date??new Date,events:k?.events??[],anchorRect:k?.rect??null,badgeVariant:r,onEventClick:a,renderEvent:d,renderPopover:x})]})}const mt=26,Gt=2,st=4;function Kt(t,n){const s=j.startOfDay(t);for(let a=0;a<n.length;a++){const l=n[a];if(l&&j.isSameDay(s,l))return a}const r=n[0];return r&&s<j.startOfDay(r)?-1:7}function hr(t){const n=[...t].sort((r,a)=>{const l=r.endCol-r.startCol,i=a.endCol-a.startCol;return i!==l?i-l:r.startCol-a.startCol}),s=[];return n.map(r=>{let a=-1;for(let i=0;i<s.length;i++){const h=s[i];if(!h)continue;let d=!0;for(let x=r.startCol;x<=r.endCol;x++)if(h[x]){d=!1;break}if(d){a=i;break}}a===-1&&(a=s.length,s.push(new Array(7).fill(!1)));const l=s[a];if(l)for(let i=r.startCol;i<=r.endCol;i++)l[i]=!0;return{...r,row:a}})}function fr({pe:t,onEventClick:n,disablePopover:s,renderPopover:r}){const[a,l]=o.useState(!1),i=Ae(t.event.color),h=o.useCallback(()=>{s&&n?n(t.event):s||l(!0)},[s,n,t.event]),d=o.useCallback(()=>{l(!1)},[]),x=e.jsxs("button",{type:"button",onClick:h,className:c.cn("inline-flex items-center gap-1 rounded text-[10px] font-medium transition-opacity hover:opacity-80 mx-0.5 overflow-hidden w-full","sm:text-xs",i.bg,i.text,t.event.isCanceled&&"opacity-60 line-through",t.continuesBefore&&"rounded-l-none -ml-0.5 pl-1",t.continuesAfter&&"rounded-r-none -mr-0.5 pr-1"),style:{height:mt,lineHeight:`${mt}px`,paddingLeft:t.continuesBefore?4:6,paddingRight:t.continuesAfter?4:6},children:[t.continuesBefore&&e.jsx("span",{className:"text-[9px] opacity-60 flex-shrink-0",children:"◂"}),e.jsx("span",{className:"truncate",children:t.event.title}),t.isSingleDayAllDay&&e.jsx("span",{className:"text-[9px] opacity-70 flex-shrink-0 hidden sm:inline",children:"All day"}),t.continuesAfter&&e.jsx("span",{className:"text-[9px] opacity-60 flex-shrink-0",children:"▸"})]}),g=e.jsx(be,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.event.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:j.formatEventTimeDisplay(t.event)})]})}),m={gridColumn:`${t.startCol+2} / ${t.endCol+3}`,gridRow:t.row+1};return s?e.jsx("div",{style:m,children:e.jsxs(De,{children:[e.jsx(Ce,{asChild:!0,children:x}),g]})}):e.jsx("div",{style:m,children:e.jsxs(Ie,{open:a,onOpenChange:l,children:[e.jsx(Re,{asChild:!0,children:x}),e.jsx(Te,{className:"w-80",children:r?r({event:t.event,onClose:d}):e.jsx(pr,{event:t.event,onClose:d})})]})})}function pr({event:t,onClose:n}){const s=Ae(t.color),r=t.isCanceled??!1;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:c.cn("size-4 rounded shrink-0 mt-0.5",s.dot)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:c.cn("font-semibold text-lg",r&&"line-through opacity-50"),children:t.title}),e.jsx("div",{className:"flex items-center gap-1 text-sm text-muted-foreground mt-1 tabular-nums",children:j.formatEventTimeDisplay(t)})]})]}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.isAllDay&&e.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded-full font-medium",children:"All day"}),r&&e.jsx("span",{className:"text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium",children:"Canceled"})]}),e.jsx("div",{className:"flex justify-end pt-2 border-t",children:e.jsx("button",{type:"button",onClick:n,className:"text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",children:"Close"})})]})}function gr({events:t,weekDays:n,hourColumnWidth:s,minDayColumnWidth:r,dayColumnWidths:a,onEventClick:l,disablePopover:i=!1,renderPopover:h,className:d}){const x=o.useMemo(()=>{if(t.length===0)return[];const E=t.map(L=>{const S=Kt(L.startDate,n),w=Kt(L.endDate,n),H=Math.max(0,S),z=Math.min(6,w);if(H>6||z<0)return null;const N=S<0,D=w>6,T=j.detectAllDayEvent(L)&&j.isSameDay(L.startDate,L.endDate);return{event:L,startCol:H,endCol:z,continuesBefore:N,continuesAfter:D,isSingleDayAllDay:T}}).filter(Boolean);return hr(E)},[t,n]);if(x.length===0)return null;const g=Math.max(...x.map(E=>E.row))+1,m=Math.min(g,st),b=g>st,C=b?x.filter(E=>E.row>=st).length:0,k=[`${s}px`,...a.map(E=>E>r?`${E}px`:`minmax(${r}px, 1fr)`)].join(" "),M=m*mt+(m-1)*Gt+8;return e.jsxs("div",{className:c.cn("ic-all-day-row border-b bg-muted/20 relative",d),style:{display:"grid",gridTemplateColumns:k,gridTemplateRows:`repeat(${m}, ${mt}px)`,gap:`${Gt}px 0`,paddingTop:4,paddingBottom:4,minHeight:M},children:[e.jsx("div",{className:"flex items-start justify-center pt-1 text-[10px] font-medium text-muted-foreground",style:{gridColumn:1,gridRow:`1 / span ${m}`},children:e.jsx("span",{className:"hidden sm:inline",children:"All day"})}),n.map((E,L)=>e.jsx("div",{className:"pointer-events-none border-r last:border-r-0",style:{gridColumn:L+2,gridRow:`1 / span ${m}`}},E.toDateString())),x.filter(E=>E.row<st).map(E=>e.jsx(fr,{pe:E,onEventClick:l,disablePopover:i,renderPopover:h},E.event.id)),b&&e.jsxs("div",{className:"text-[10px] text-muted-foreground font-medium px-2 flex items-center",style:{gridColumn:`2 / ${n.length+2}`,gridRow:m},children:["+",C," more"]})]})}const An=["SU","MO","TU","WE","TH","FR","SA"],yr=["first","second","third","fourth","last"],vr={doesNotRepeat:"Does not repeat",daily:"Daily",weeklyOn:t=>`Weekly on ${t}`,monthlyOnWeekday:(t,n)=>`Monthly on the ${yr[t-1]??`${t}th`} ${n}`,monthlyOnDate:t=>`Monthly on day ${t}`,annuallyOn:t=>`Annually on ${t}`,everyWeekday:"Every weekday (Monday to Friday)",custom:"Custom…",summary:t=>`Every ${t.interval>1?`${t.interval} `:""}${{daily:"day",weekly:"week",monthly:"month",yearly:"year"}[t.freq]}`,customTitle:"Custom recurrence",repeatEvery:"Repeat every",repeatOn:"Repeat on",ends:"Ends",never:"Never",endsOn:"On",endsAfter:"After",occurrences:"occurrences",cancel:"Cancel",done:"Done",unit:{daily:"day",weekly:"week",monthly:"month",yearly:"year"}};function jr(t){return Math.floor((t.getDate()-1)/7)+1}const ct=t=>An[t.getDay()],br=t=>t.freq==="weekly"&&t.interval===1&&t.byWeekday?.length===5&&["MO","TU","WE","TH","FR"].every(n=>t.byWeekday?.includes(n)),wr=(t,n)=>JSON.stringify(t??null)===JSON.stringify(n??null);function Nr(t){const n=s=>String(s).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}const Mt=t=>{const n=new Date(t);return n.setFullYear(n.getFullYear()+1),Nr(n)};function Hn(t,n,s,r){const a=r?.freqs??["daily","weekly","monthly","yearly"],l=new Intl.DateTimeFormat(s,{weekday:"long"}).format(t),i=new Intl.DateTimeFormat(s,{day:"numeric",month:"long"}).format(t),h=r?.requireEnd?{until:(r.defaultUntil??Mt)(t)}:{},d=[{rule:null,label:n.doesNotRepeat}];return a.includes("daily")&&d.push({rule:{freq:"daily",interval:1,...h},label:n.daily}),a.includes("weekly")&&d.push({rule:{freq:"weekly",interval:1,byWeekday:[ct(t)],...h},label:n.weeklyOn(l)}),a.includes("monthly")&&d.push(r?.monthlyByWeekday===!1?{rule:{freq:"monthly",interval:1,monthly:"date",...h},label:n.monthlyOnDate(t.getDate())}:{rule:{freq:"monthly",interval:1,monthly:"weekday",...h},label:n.monthlyOnWeekday(jr(t),l)}),a.includes("yearly")&&d.push({rule:{freq:"yearly",interval:1,...h},label:n.annuallyOn(i)}),a.includes("weekly")&&d.push({rule:{freq:"weekly",interval:1,byWeekday:["MO","TU","WE","TH","FR"],...h},label:n.everyWeekday}),d}const rt=c.cn("rounded-md border border-input bg-background px-2 py-1 text-sm","outline-none focus:border-primary");function kr({value:t,start:n,labels:s,locale:r,weekStartsOn:a=1,supports:l,onCancel:i,onDone:h}){const[d,x]=o.useState(()=>{const M=t??{freq:"weekly",interval:1,byWeekday:[ct(n)]};return!l?.requireEnd||M.until||M.count!=null?M:{...M,until:(l.defaultUntil??Mt)(n)}}),g=M=>x(E=>({...E,...M})),m=l?.freqs??["daily","weekly","monthly","yearly"],b=d.count!=null?"after":d.until?"on":"never",C=Array.from({length:7},(M,E)=>{const L=(a+E)%7,S=new Date(2024,0,7+L);return{key:An[L],letter:new Intl.DateTimeFormat(r,{weekday:"narrow"}).format(S)}}),k=M=>{const E=d.byWeekday??[],L=E.includes(M)?E.filter(S=>S!==M):[...E,M];g({byWeekday:L.length?L:[ct(n)]})};return typeof document>"u"?null:St.createPortal(e.jsx("div",{"data-ic-layer":"",className:"fixed inset-0 flex items-center justify-center bg-black/40",style:{zIndex:ue.IC_Z_MODAL},onPointerDown:M=>{M.target===M.currentTarget&&i()},children:e.jsxs("div",{role:"dialog","aria-label":s.customTitle,className:"w-[340px] rounded-xl bg-popover p-5 text-popover-foreground shadow-2xl",children:[e.jsx("h3",{className:"mb-4 text-base font-medium",children:s.customTitle}),e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"text-sm",children:s.repeatEvery}),e.jsx("input",{type:"number",min:1,max:99,"aria-label":s.repeatEvery,value:d.interval,onChange:M=>g({interval:Math.max(1,Number(M.target.value)||1)}),className:c.cn(rt,"w-16")}),e.jsx("select",{"aria-label":s.repeatEvery,value:d.freq,onChange:M=>{const E=M.target.value;g({freq:E,...E==="weekly"&&!d.byWeekday?.length?{byWeekday:[ct(n)]}:{},...E==="monthly"&&!d.monthly?{monthly:l?.monthlyByWeekday===!1?"date":"weekday"}:{}})},className:c.cn(rt,"flex-1"),children:m.map(M=>e.jsx("option",{value:M,children:s.unit[M]},M))})]}),d.freq==="weekly"&&e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"mb-2 text-sm",children:s.repeatOn}),e.jsx("div",{className:"flex gap-1.5",children:C.map(({key:M,letter:E})=>{const L=d.byWeekday?.includes(M);return e.jsx("button",{type:"button","aria-pressed":L,"aria-label":M,onClick:()=>k(M),className:c.cn("size-8 rounded-full text-xs font-medium",L?"bg-primary text-primary-foreground":"bg-muted hover:bg-accent"),children:E},M)})})]}),e.jsxs("fieldset",{className:"mb-5",children:[e.jsx("legend",{className:"mb-2 text-sm",children:s.ends}),e.jsxs("div",{className:"flex flex-col gap-2",children:[!l?.requireEnd&&e.jsxs("label",{className:"flex items-center gap-3 text-sm",children:[e.jsx("input",{type:"radio",name:"ic-recurrence-ends",checked:b==="never",onChange:()=>g({until:null,count:null}),className:"size-4 accent-[var(--primary)]"}),s.never]}),l?.until!==!1&&e.jsxs("label",{className:"flex items-center gap-3 text-sm",children:[e.jsx("input",{type:"radio",name:"ic-recurrence-ends",checked:b==="on",onChange:()=>g({count:null,until:(l?.defaultUntil??Mt)(n)}),className:"size-4 accent-[var(--primary)]"}),e.jsx("span",{className:"w-12",children:s.endsOn}),e.jsx("input",{type:"date","aria-label":s.endsOn,disabled:b!=="on",value:d.until??"",onChange:M=>g({until:M.target.value,count:null}),className:c.cn(rt,"flex-1 disabled:opacity-50")})]}),l?.count!==!1&&e.jsxs("label",{className:"flex items-center gap-3 text-sm",children:[e.jsx("input",{type:"radio",name:"ic-recurrence-ends",checked:b==="after",onChange:()=>g({until:null,count:13}),className:"size-4 accent-[var(--primary)]"}),e.jsx("span",{className:"w-12",children:s.endsAfter}),e.jsx("input",{type:"number",min:1,max:999,"aria-label":s.occurrences,disabled:b!=="after",value:d.count??"",onChange:M=>g({count:Math.max(1,Number(M.target.value)||1),until:null}),className:c.cn(rt,"w-16 disabled:opacity-50")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s.occurrences})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:i,className:"h-9 rounded-md px-3 text-sm font-medium text-primary hover:bg-accent",children:s.cancel}),e.jsx("button",{type:"button",onClick:()=>h(d),className:"h-9 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/80",children:s.done})]})]})}),document.body)}function Dr({value:t,onChange:n,start:s,locale:r,weekStartsOn:a,supports:l,labels:i,disabled:h}){const d={...vr,...i},[x,g]=o.useState(!1),[m,b]=o.useState(!1),C=o.useRef(null),k=Hn(s,d,r,l),M=k.find(L=>wr(L.rule,t)),E=M?.label??(t?br(t)?d.everyWeekday:d.summary(t):d.doesNotRepeat);return o.useEffect(()=>{if(!x)return;const L=w=>{C.current?.contains(w.target)||g(!1)},S=window.setTimeout(()=>document.addEventListener("pointerdown",L),0);return()=>{document.removeEventListener("pointerdown",L),window.clearTimeout(S)}},[x]),e.jsxs("div",{ref:C,className:"relative w-fit",children:[e.jsxs("button",{type:"button",disabled:h,onClick:()=>g(L=>!L),className:c.cn("flex items-center gap-1 rounded-md px-2 py-1 text-sm","hover:bg-accent hover:text-accent-foreground","disabled:cursor-not-allowed disabled:opacity-50",x&&"bg-accent text-accent-foreground"),children:[E,e.jsx(Le.ChevronDown,{className:c.cn("size-4",x&&"rotate-180")})]}),x&&e.jsxs("div",{"data-ic-layer":"",role:"listbox",className:c.cn("absolute left-0 top-full mt-1 w-64 rounded-lg border p-1","bg-popover text-popover-foreground shadow-lg"),style:{zIndex:ue.IC_Z_LAYER},children:[k.map(L=>e.jsx("button",{type:"button",role:"option","aria-selected":L===M,onClick:()=>{n(L.rule),g(!1)},className:c.cn("w-full rounded px-3 py-1.5 text-left text-sm","hover:bg-accent hover:text-accent-foreground",L===M&&"bg-accent font-medium"),children:L.label},L.label)),e.jsx("button",{type:"button",role:"option","aria-selected":!M&&!!t,onClick:()=>{g(!1),b(!0)},className:"w-full rounded px-3 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",children:d.custom})]}),m&&e.jsx(kr,{value:t,start:s,labels:d,...r&&{locale:r},...a!==void 0&&{weekStartsOn:a},...l&&{supports:l},onCancel:()=>b(!1),onDone:L=>{n(L),b(!1)}})]})}function Ht({anchorRef:t,onClose:n,children:s,matchWidth:r,className:a}){const l=o.useRef(null),[i,h]=o.useState(null);return o.useLayoutEffect(()=>{const d=t.current,x=l.current;if(!d||!x)return;const g=d.getBoundingClientRect(),m=x.offsetHeight,b=r?g.width:x.offsetWidth,C=g.bottom+4,k=C+m>window.innerHeight-8?Math.max(8,g.top-m-4):C;h({left:Math.min(Math.max(8,g.left),window.innerWidth-b-8),top:k})},[t,r]),o.useEffect(()=>{const d=m=>{m.key==="Escape"&&(m.stopPropagation(),n())},x=m=>{const b=m.target;l.current?.contains(b)||t.current?.contains(b)||n()};document.addEventListener("keydown",d,!0);const g=window.setTimeout(()=>document.addEventListener("pointerdown",x),0);return()=>{document.removeEventListener("keydown",d,!0),document.removeEventListener("pointerdown",x),window.clearTimeout(g)}},[n,t]),typeof document>"u"?null:St.createPortal(e.jsx("div",{ref:l,"data-ic-layer":"",className:c.cn("fixed rounded-lg border bg-popover p-2 text-popover-foreground shadow-lg",a),style:{left:i?.left??-9999,top:i?.top??-9999,zIndex:ue.IC_Z_LAYER,visibility:i?"visible":"hidden",...r&&{width:t.current?.offsetWidth}},children:s}),document.body)}const ze=6e4,Xt=1440,Cr={allDay:"All day",startDate:"Start date",startTime:"Start time",endTime:"End time",endDate:"End date",duration:t=>{const n=Math.floor(t/60),s=t%60;return n?s?`${n} h ${s}`:`${n} h`:`${s} min`}},bt=t=>{const n=new Date(t);return n.setHours(0,0,0,0),n},ot=t=>{const n=new Date(t);return n.setHours(23,59,59,999),n};function wt(t,n){const s=new Date(n);return s.setHours(t.getHours(),t.getMinutes(),0,0),s}const Mr=(t,n)=>t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),zn=c.cn("rounded-md px-2 py-1 text-sm whitespace-nowrap","hover:bg-accent hover:text-accent-foreground","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50");function Jt({value:t,onSelect:n,label:s,locale:r,weekStartsOn:a,disabled:l}){const i=o.useRef(null),[h,d]=o.useState(!1),x=new Intl.DateTimeFormat(r,{weekday:"short",day:"numeric",month:"short"}).format(t);return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:i,type:"button","aria-label":s,disabled:l,onClick:()=>d(g=>!g),className:c.cn(zn,h&&"bg-accent text-accent-foreground"),children:x}),h&&e.jsx(Ht,{anchorRef:i,onClose:()=>d(!1),className:"w-64",children:e.jsx(At,{selected:t,onSelect:g=>{n(g),d(!1)},...r&&{locale:r},...a!==void 0&&{weekStartsOn:a}})})]})}function Qt({value:t,options:n,onSelect:s,label:r,locale:a,hour12:l,disabled:i}){const h=o.useRef(null),d=o.useRef(null),[x,g]=o.useState(!1);return o.useEffect(()=>{if(!x)return;d.current?.querySelector('[data-current="true"]')?.scrollIntoView?.({block:"center"})},[x]),e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:h,type:"button","aria-label":r,disabled:i,onClick:()=>g(m=>!m),className:c.cn(zn,x&&"bg-accent text-accent-foreground"),children:j.formatClock(t,{locale:a,hour12:l})}),x&&e.jsx(Ht,{anchorRef:h,onClose:()=>g(!1),className:"p-1",children:e.jsx("div",{ref:d,role:"listbox","aria-label":r,className:"max-h-64 w-44 overflow-y-auto",children:n.map(m=>{const b=m.at.getHours()===t.getHours()&&m.at.getMinutes()===t.getMinutes();return e.jsxs("button",{type:"button",role:"option","aria-label":m.hint?`${m.text}, ${m.hint}`:m.text,"aria-selected":b,"data-current":b,onClick:()=>{s(m.at),g(!1)},className:c.cn("flex w-full items-center gap-2 rounded px-2 py-1 text-left text-sm","hover:bg-accent hover:text-accent-foreground",b&&"bg-accent font-medium text-accent-foreground"),children:[e.jsx("span",{children:m.text}),m.hint&&e.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:m.hint})]},m.at.toISOString())})})})]})}function Er({start:t,end:n,allDay:s=!1,onChange:r,locale:a,hour12:l,step:i=15,weekStartsOn:h,labels:d,showAllDay:x=!0,children:g,disabled:m}){const b={...Cr,...d},C=Math.max(i,Math.round((n.getTime()-t.getTime())/ze)),k=Array.from({length:Math.floor(Xt/i)},(z,N)=>{const D=new Date(bt(t).getTime()+N*i*ze);return{at:D,text:j.formatClock(D,{locale:a,hour12:l})}}),M=Array.from({length:Math.floor(Xt/i)},(z,N)=>{const D=(N+1)*i,y=new Date(t.getTime()+D*ze);return{at:y,text:j.formatClock(y,{locale:a,hour12:l}),hint:b.duration(D)}}),E=z=>r({start:z,end:new Date(z.getTime()+C*ze)}),L=z=>{const N=s?bt(z):wt(t,z);r({start:N,end:s?ot(N>n?z:n):new Date(N.getTime()+C*ze)})},S=z=>{const N=s?ot(z):wt(n,z);r({end:N<t?s?ot(t):t:N})},w=()=>{if(s){const z=wt(new Date(t.setHours(9,0,0,0)),t);r({allDay:!1,start:z,end:new Date(z.getTime()+60*ze)});return}r({allDay:!0,start:bt(t),end:ot(n)})},H=s||!Mr(t,n);return e.jsxs("div",{className:"flex items-start px-4 py-1.5",children:[e.jsx("span",{className:"flex w-8 shrink-0 items-start pt-1.5 text-muted-foreground",children:e.jsx(Le.Clock,{className:"size-4"})}),e.jsxs("div",{className:"-ml-2 flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-0.5",children:[e.jsx(Jt,{value:t,onSelect:L,label:b.startDate,...a&&{locale:a},...h!==void 0&&{weekStartsOn:h},...m&&{disabled:m}}),!s&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{value:t,options:k,onSelect:E,label:b.startTime,...a&&{locale:a},...l!==void 0&&{hour12:l},...m&&{disabled:m}}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"–"}),e.jsx(Qt,{value:n,options:M,onSelect:z=>r({end:z}),label:b.endTime,...a&&{locale:a},...l!==void 0&&{hour12:l},...m&&{disabled:m}})]}),H&&e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"–"}),e.jsx(Jt,{value:n,onSelect:S,label:b.endDate,...a&&{locale:a},...h!==void 0&&{weekStartsOn:h},...m&&{disabled:m}})]})]}),x&&e.jsx("div",{className:"py-1 pl-2",children:e.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:s,disabled:m,onChange:w,className:"size-4 shrink-0 accent-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-50"}),b.allDay]})}),g]})]})}const Ee=j.DEFAULT_HOUR_HEIGHT,Zt=64,Sr=76,Tr=140,Lr=96;function en(t){if(t.resourceId)return t.resourceId;const n=t.data;return n?.userId?String(n.userId):n?.user?.id?n.user.id:t.user?.id?t.user.id:t.participants?.[0]?.id}function On(t){return t.getHours()*j.MINUTES_IN_HOUR+t.getMinutes()}function Ir(t,n){const s=[...t].sort((a,l)=>a.startDate.getTime()-l.startDate.getTime()),r=[];for(const a of s){const l=r.at(-1),i=l?.some(h=>h.endDate.getTime()>a.startDate.getTime());l&&i?l.push(a):r.push([a])}return r.flatMap(a=>a.map((l,i)=>{const h=(On(l.startDate)-n*j.MINUTES_IN_HOUR)/j.MINUTES_IN_HOUR*Ee,d=Math.max(18,(l.endDate.getTime()-l.startDate.getTime())/(1e3*60*j.MINUTES_IN_HOUR)*Ee),x=100/a.length;return{event:l,top:h,height:d,left:x*i,width:x}}))}function Be({events:t,dates:n,resources:s,visibleHours:r,badgeVariant:a,slotDuration:l=30,locale:i,onEventClick:h,renderPopover:d,className:x}){const g=o.useMemo(()=>Array.from({length:Math.max(1,r.endHour-r.startHour)},(N,D)=>r.startHour+D),[r.startHour,r.endHour]),m=o.useMemo(()=>n.map(N=>N.toDateString()),[n]),b=o.useMemo(()=>t.filter(N=>m.includes(N.startDate.toDateString())),[t,m]),C=o.useMemo(()=>{const N=new Map(s.map(D=>[D.id,D]));for(const D of b){const y=en(D);if(!y||N.has(y))continue;const T=D.participants?.find(I=>I.id===y),V=D.data?.user;N.set(y,T??V??{id:y,name:y})}return[...N.values()]},[s,b]),k=o.useMemo(()=>{const N=new Map;for(const D of m)for(const y of C)N.set(`${D}|${y.id}`,[]);for(const D of b){const y=en(D);y&&N.get(`${D.startDate.toDateString()}|${y}`)?.push(D)}return N},[b,C,m]),M=o.useMemo(()=>{if(!n.some(j.isToday))return null;const D=(On(new Date)-r.startHour*j.MINUTES_IN_HOUR)/j.MINUTES_IN_HOUR*Ee;return D>=0&&D<=g.length*Ee?D:null},[n,r.startHour,g.length]),E=g.length*Ee;if(C.length===0)return e.jsx("div",{className:c.cn("flex h-full items-center justify-center p-8 text-center","text-sm text-muted-foreground",x),children:"Select at least one person to see their day."});const L=n.length>1,S=ue.useOptionalSlotSelection(),w=Math.max(1,Math.round(j.MINUTES_IN_HOUR/l)),H=Ee/w,z=L?Lr:Tr;return e.jsx("div",{className:c.cn("flex h-full flex-col",x),children:e.jsx("div",{className:"relative flex-1 overflow-auto",children:e.jsxs("div",{className:"min-w-max",children:[e.jsxs("div",{className:"sticky top-0 z-30 flex border-b bg-background",style:{height:Sr},children:[e.jsx("div",{className:"sticky left-0 z-10 flex shrink-0 flex-col items-center justify-center bg-background",style:{width:Zt},children:!L&&n[0]&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:new Intl.DateTimeFormat(i,{weekday:"short"}).format(n[0])}),e.jsx("span",{className:c.cn("mt-0.5 flex size-9 items-center justify-center rounded-full text-xl",j.isToday(n[0])?"bg-primary font-medium text-primary-foreground":"text-foreground"),children:n[0].getDate()})]})}),n.map(N=>e.jsxs("div",{className:"flex flex-1 flex-col border-r last:border-r-0",style:{minWidth:z*C.length},children:[L&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 pt-1",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:new Intl.DateTimeFormat(i,{weekday:"short"}).format(N)}),e.jsx("span",{className:c.cn("flex size-6 items-center justify-center rounded-full text-sm",j.isToday(N)?"bg-primary font-medium text-primary-foreground":"text-foreground"),children:N.getDate()})]}),e.jsx("div",{className:"flex flex-1",children:C.map(D=>e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-center justify-center gap-0.5 px-1",children:[!L&&e.jsx("span",{className:"max-w-full truncate text-[13px]",children:D.name}),D.avatar?e.jsx("img",{src:D.avatar,alt:D.name,title:D.name,className:c.cn("rounded-full object-cover",L?"size-5":"size-7")}):e.jsx("span",{title:D.name,className:c.cn("flex items-center justify-center rounded-full bg-muted font-medium text-muted-foreground",L?"size-5 text-[10px]":"size-7 text-xs"),children:D.name.charAt(0).toUpperCase()}),L&&e.jsx("span",{title:D.name,className:"w-full truncate text-center text-[10px] leading-tight text-muted-foreground",children:D.name})]},D.id))})]},N.toDateString()))]}),e.jsxs("div",{className:"relative flex",style:{height:E},children:[e.jsx("div",{className:c.cn("sticky left-0 z-10 shrink-0 border-r bg-background"),style:{width:Zt},children:g.map((N,D)=>e.jsx("div",{className:"relative",style:{height:Ee},children:D!==0&&e.jsx("span",{className:c.cn("absolute -top-2 right-2 text-[10px] text-muted-foreground"),children:j.formatClock(new Date(2e3,0,1,N),{locale:i})})},N))}),n.map(N=>e.jsx("div",{className:"flex flex-1 border-r last:border-r-0",style:{minWidth:z*C.length},children:C.map(D=>{const y=Ir(k.get(`${N.toDateString()}|${D.id}`)??[],r.startHour);return e.jsxs("div",{className:"relative flex-1 border-r border-border/40 last:border-r-0",children:[g.map(T=>e.jsx("div",{className:c.cn("relative border-b border-border/60"),style:{height:Ee},children:Array.from({length:w},(V,I)=>{const W=I*l,P={date:N,hour:T,minute:W,resourceId:D.id};return e.jsx(pt,{slot:P,onSelectionStart:R=>S?.startSelection(R),onSelectionMove:R=>S?.updateSelection(R),onSelectionEnd:()=>S?.endSelection(),isSelected:S?.isSlotSelected(P)??!1,isSelecting:S?.isSelecting??!1,className:"absolute inset-x-0",style:{top:I*H,height:H}},W)})},T)),y.map(({event:T,top:V,height:I,left:W,width:P})=>e.jsx("div",{className:"pointer-events-none absolute z-10 px-0.5",style:{top:V,height:I,left:`${W}%`,width:`${P}%`},children:e.jsx(ft,{event:T,position:{top:0,left:0,width:100},hourHeight:Ee,...a&&{badgeVariant:a},onClick:h,disablePopover:!!h&&!d,renderPopover:d,className:c.cn("!relative !inset-auto h-full w-full pointer-events-auto")})},T.id))]},D.id)})},N.toDateString())),M!==null&&e.jsxs("div",{"data-ic-now":"",className:"pointer-events-none absolute left-0 right-0 z-20 flex items-center",style:{top:M},children:[e.jsx("span",{className:"ml-[58px] size-3 shrink-0 rounded-full bg-red-500"}),e.jsx("span",{className:"h-0.5 flex-1 bg-red-500"})]})]})]})})})}const Nt=44,tn=4,Rr=56,nn=8,at=80,qe=140,sn=100,rn=2,Ar=8,Hr=18;function zr(t){return t.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2)}function Or(t,n){const s=[];for(let r=0;r<n;r++){const a=new Date(t);a.setDate(a.getDate()+r),s.push(a)}return s}function _r(t,n,s){const r=[];return t.forEach((a,l)=>{for(let i=n;i<s;i++)r.push({hour:i,dayIndex:l,date:a})}),r}function kt(t){return`${t.toString().padStart(2,"0")}:00`}function Wr(t){return t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}function on(t){const n=[...t].sort((a,l)=>a.startCol!==l.startCol?a.startCol-l.startCol:l.spanCols-a.spanCols),s=[],r=[];for(const a of n){let l=0;for(;r[l]!==void 0&&r[l]>a.startCol;)l++;r[l]=a.startCol+a.spanCols,s.push({...a,stackIndex:l})}return s}function Pr(t,n,s,r,a){const l=t.startDate.getHours()+t.startDate.getMinutes()/60,i=t.endDate.getHours()+t.endDate.getMinutes()/60;let h=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let x=0;x<n.length;x++){const g=n[x],m=j.startOfDay(g),b=j.endOfDay(g);if(!(t.startDate<=b&&t.endDate>=m))continue;let C=t.startDate>=m?Math.max(s,l):s,k=t.endDate<=b?Math.min(r,i):r;if(C=Math.max(s,Math.min(r,C)),k=Math.max(s,Math.min(r,k)),k>C){const M=x*a+(C-s),E=x*a+(k-s);h=Math.min(h,M),d=Math.max(d,E)}}return d>h?{startCol:h,spanCols:d-h}:null}function $r({src:t,alt:n,fallback:s,className:r}){return e.jsx("div",{className:c.cn("relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",r),children:t?e.jsx("img",{src:t,alt:n,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:s})})}const Fr=18,Ur=10,Br=32;function qr({text:t,className:n}){const s=o.useRef(null),r=o.useRef(null),[a,l]=o.useState({active:!1,durationSec:0});return o.useLayoutEffect(()=>{const i=s.current,h=r.current;if(!i||!h)return;const d=()=>{const g=h.offsetWidth,m=i.clientWidth;if(g>m+1){const b=g+Br,C=Math.max(Ur,b/Fr);l(k=>k.active&&Math.abs(k.durationSec-C)<.1?k:{active:!0,durationSec:C})}else l(b=>b.active?{active:!1,durationSec:0}:b)};d();const x=new ResizeObserver(d);return x.observe(i),x.observe(h),()=>x.disconnect()},[t]),e.jsx("div",{ref:s,className:c.cn("ic-marquee relative min-w-0 overflow-hidden",a.active&&"ic-marquee--active",n),children:e.jsxs("div",{className:"ic-marquee-track inline-flex whitespace-nowrap will-change-transform",style:a.active?{animationDuration:`${a.durationSec}s`}:void 0,children:[e.jsx("span",{ref:r,className:"ic-marquee-copy",children:t}),a.active&&e.jsx("span",{"aria-hidden":"true",className:"ic-marquee-copy",children:t})]})})}const Vr=7;function dt({daysToShow:t=Vr,events:n,users:s=[],alwaysShowResources:r,selectedDate:a,onDateChange:l,onEventClick:i,onSlotClick:h,onSlotSelect:d,visibleHours:x,className:g,getEventUserId:m,renderPopover:b,enableDrag:C=!0,resourceColumnConfig:k}){const M=k?.variant??"marquee",E=k?.showAvatar??"auto",L=o.useRef(null),S=ue.useOptionalDragDrop(),[w,H]=o.useState(null),z=o.useRef(!1),[N,D]=o.useState(null),y=a??new Date,T=!0,V=x?.from??Ar,I=x?.to??Hr,W=I-V,P=o.useMemo(()=>{const p=new Date(y);if(t===1||t===3)return p.setHours(0,0,0,0),p;const A=p.getDay(),O=A===0?-6:1-A;return p.setDate(p.getDate()+O),p.setHours(0,0,0,0),p},[y,t]),R=o.useMemo(()=>Or(P,t),[P,t]),u=o.useMemo(()=>_r(R,V,I),[T,R,V,I]),f=m??(p=>{if(p.resourceId)return p.resourceId;const A=p.data;if(A?.userId)return String(A.userId);if(A?.user&&typeof A.user=="object"&&A.user.id)return String(A.user.id);if(p.user?.id)return p.user.id;if(p.participants?.[0]?.id)return p.participants[0].id}),_=o.useMemo(()=>{const p=new Map;for(const A of s)p.set(A.id,{id:A.id,name:A.name,avatar:A.avatar??void 0,email:A.email});for(const A of n){const B=A.data?.user;B?.id&&!p.has(B.id)&&p.set(B.id,{id:B.id,name:B.name??"",avatar:B.avatar??void 0,email:B.email}),A.user?.id&&!p.has(A.user.id)&&p.set(A.user.id,{id:A.user.id,name:A.user.name,avatar:A.user.avatar??void 0,email:A.user.email});for(const q of A.participants||[])q.id&&!p.has(q.id)&&p.set(q.id,{id:q.id,name:q.name,avatar:q.avatar??void 0,email:q.email})}return Array.from(p.values())},[s,n]),U=o.useMemo(()=>{const p=[],A=new Map;for(const q of _)A.set(q.id,[]);A.set("unassigned",[]);for(const q of n){const X=f(q)??"unassigned";(A.get(X)??A.get("unassigned")).push(q)}const O=q=>{const X=[];for(const te of q){const ae=Pr(te,R,V,I,W);ae&&X.push({event:te,...ae})}return X};for(const q of _){const X=A.get(q.id)??[],te=O(X),ae=on(te),xe=ae.reduce((de,fe)=>Math.max(de,fe.stackIndex+1),0);p.push({user:q,events:ae,maxStack:Math.max(xe,1)})}const B=A.get("unassigned")??[];if(B.length>0){const q=O(B),X=on(q),te=X.reduce((ae,xe)=>Math.max(ae,xe.stackIndex+1),0);p.push({user:{id:"unassigned",name:"Unassigned",avatar:void 0,email:void 0},events:X,maxStack:Math.max(te,1)})}if(r?.length){const q=new Set(p.map(X=>X.user.id));for(const X of r)q.has(X.id)||(p.push({user:{id:X.id,name:X.name,avatar:X.avatar??void 0,email:X.email},events:[],maxStack:1}),q.add(X.id))}return p},[_,n,R,T,W,V,I,f,r]),F=o.useMemo(()=>{const p=new Map;for(const A of U)for(const O of A.events)if(O.spanCols<=1){const B=Math.floor(O.startCol),q=p.get(B)??0;p.set(B,q+1)}return p},[U]),Y=o.useMemo(()=>{const p=u.length,A=at,O=[];for(let B=0;B<p;B++){const q=F.get(B)??0;q>rn?O.push(sn+(q-rn)*20):q>0?O.push(Math.max(A,sn)):O.push(A)}return O},[T,u.length,R.length,F]),se=p=>Math.max(Rr,p*(Nt+tn)+nn*2),J=qe+Y.reduce((p,A)=>p+A,0),K=o.useMemo(()=>{const p=[0];for(let A=0;A<Y.length;A++)p.push(p[A]+Y[A]);return p},[Y]),ne=o.useCallback(p=>{const A=K.length-1;if(p<=0)return K[0]??0;if(p>=A)return K[A]??0;const O=Math.floor(p),B=K[O]??0,q=K[O+1]??B;return B+(p-O)*(q-B)},[K]);o.useLayoutEffect(()=>{const p=L.current;if(!p)return;const A=()=>{let O=-1;const q=new Date().getHours();{for(let X=0;X<u.length;X++){const te=u[X];if(te&&j.isToday(te.date)&&te.hour<=q&&te.hour+1>q){O=X;break}}if(O===-1)for(let X=0;X<u.length;X++){const te=u[X];if(te&&j.isToday(te.date)){O=X;break}}}if(O!==-1){const X=(K[O]??0)+qe,te=p.clientWidth,ae=Math.max(0,X-te/3);p.scrollTo({left:ae,behavior:"instant"})}};requestAnimationFrame(()=>{requestAnimationFrame(A)})},[y,u,R,K,T]);const oe=o.useCallback((p,A)=>{const O=A.getBoundingClientRect(),B=p-O.left+A.scrollLeft;for(let q=0;q<K.length-1;q++){const X=K[q],te=K[q+1];if(B>=X&&B<te){const ae=(B-X)/(te-X),xe=Math.floor(ae*60),de=Math.round(xe/15)*15;return{colIndex:q,minute:Math.min(de,45)}}}return null},[K]),ee=o.useCallback((p,A)=>{if(u[p]){const O=u[p],B=new Date(O.date);return B.setHours(O.hour,A??0,0,0),{date:B,hour:O.hour}}return{date:new Date}},[T,u,R]),he=o.useCallback((p,A)=>{if(p.preventDefault(),p.dataTransfer.dropEffect="move",!S?.isDragging||!S.dragState)return;const O=p.currentTarget,B=oe(p.clientX,O);if(!B)return;const{colIndex:q,minute:X}=B,{date:te,hour:ae}=ee(q,X);S.updateDragPreview(te,ae,X,A);const{originalStartDate:xe,originalEndDate:de}=S.dragState,fe=de.getTime()-xe.getTime(),Ne=u.length;let v;{const G=fe/36e5;v=Math.max(1,Math.ceil(G))}v=Math.min(v,Ne-q),D({resourceId:A,colIndex:q,spanCols:v})},[S,oe,ee,T,u.length,R.length]),Q=o.useCallback(p=>{const A=p.relatedTarget;p.currentTarget.contains(A)||D(null)},[]),le=o.useCallback((p,A)=>{p.preventDefault(),D(null),S?.isDragging&&S.endDrag()},[S]),ie=o.useCallback((p,A)=>{if(!w||w.resourceId!==p)return!1;const O=Math.min(w.startCol,w.endCol),B=Math.max(w.startCol,w.endCol);return A>=O&&A<=B},[w]),Me=o.useCallback((p,A)=>!N||N.resourceId!==p?!1:A>=N.colIndex&&A<N.colIndex+N.spanCols,[N]),re=o.useCallback((p,A,O)=>{O.button!==0&&O.pointerType==="mouse"||(d||h)&&(O.preventDefault(),z.current=!0,H({resourceId:p,startCol:A,endCol:A,isSelecting:!0}))},[d,h]),ce=o.useCallback((p,A,O)=>{if(z.current&&!(!w||w.resourceId!==p)){if(O.buttons===0){z.current=!1;return}H(B=>B?{...B,endCol:A}:null)}},[w]),we=o.useCallback(()=>{if(!z.current||!w)return;z.current=!1;const p=Math.min(w.startCol,w.endCol),A=Math.max(w.startCol,w.endCol),O=ee(p),B=ee(A),q=new Date(O.date),X=new Date(B.date);B.hour!==void 0&&X.setHours(B.hour+1,0,0,0);const te={startDate:q,endDate:X,resourceId:w.resourceId};p===A&&h&&h(O.date,O.hour,w.resourceId),d?.(te),H(ae=>ae?{...ae,isSelecting:!1}:null),setTimeout(()=>H(null),150)},[w,ee,T,h,d]);return o.useEffect(()=>{const p=()=>{z.current&&we()};return window.addEventListener("pointerup",p),window.addEventListener("pointercancel",p),()=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p)}},[we]),o.useEffect(()=>{S?.isDragging||D(null)},[S?.isDragging]),e.jsx("div",{className:c.cn("flex h-full flex-col",g),children:e.jsx("div",{className:"ic-timeline-scroll-container flex-1",ref:L,children:e.jsxs("div",{className:"relative",style:{minWidth:J},children:[e.jsx("div",{className:"ic-timeline-header sticky top-0 z-20 border-b bg-background",children:t>1?e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex shrink-0 items-center justify-center border-r bg-background px-2 sticky left-0 z-10",style:{width:qe},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("div",{className:"flex border-b",children:R.map((p,A)=>{const O=j.isToday(p),B=A*W,q=Y.slice(B,B+W).reduce((X,te)=>X+te,0);return e.jsx("div",{className:c.cn("flex shrink-0 items-center justify-center border-r py-1.5 font-medium",O?"bg-primary/10 text-primary":"bg-muted/30"),style:{width:q},children:e.jsx("span",{className:"text-xs",children:Wr(p)})},`day-${p.toISOString()}`)})}),e.jsx("div",{className:"flex",children:u.map((p,A)=>{const O=p.hour===V,B=j.isToday(p.date),q=Y[A]??at;return e.jsx("div",{className:c.cn("flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",O&&A>0?"border-l-2 border-l-border":"border-r border-r-border/50",B&&"bg-primary/5"),style:{width:q},children:kt(p.hour)},`hour-${p.dayIndex}-${p.hour}`)})})]})]}):e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex shrink-0 items-center border-r bg-background px-2 py-2",style:{width:qe},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),u.map((p,A)=>{const O=p.hour===V,B=j.isToday(p.date),q=Y[A]??at;return e.jsx("div",{className:c.cn("flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",O&&A>0?"border-l-2 border-l-border":"border-r border-r-border/50",B&&"bg-primary/5"),style:{width:q},children:kt(p.hour)},`hour-${p.dayIndex}-${p.hour}`)})]})}),U.map(p=>{const A=se(p.maxStack);return e.jsxs("div",{className:c.cn("relative flex border-b"),style:{height:A},children:[e.jsx("div",{className:"sticky left-0 z-10",style:{width:qe},children:e.jsxs("div",{className:c.cn("flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4"),children:[(()=>{const O=!!p.user.avatar;return E===!0||E==="auto"&&O?e.jsx($r,{className:"size-7",src:p.user.avatar,alt:p.user.name,fallback:zr(p.user.name)}):null})(),M==="marquee"?e.jsx(qr,{text:p.user.name,className:"flex-1 text-xs sm:text-sm font-medium"}):e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs sm:text-sm font-medium",children:p.user.name})]})}),e.jsxs("div",{className:"ic-timeline-grid relative flex",onDragOver:O=>he(O,p.user.id),onDragLeave:Q,onDrop:O=>le(O,p.user.id),children:[u.map((O,B)=>{const q=O.hour===V&&B>0,X=Y[B]??at,te=ie(p.user.id,B),ae=Me(p.user.id,B),xe=!!(d||h);return e.jsx("div",{role:xe?"button":void 0,tabIndex:xe?0:void 0,"aria-label":xe?`Select ${kt(O.hour)} on ${O.date.toLocaleDateString()} for ${p.user.name}`:void 0,onPointerDown:de=>re(p.user.id,B,de),onPointerEnter:de=>ce(p.user.id,B,de),onPointerUp:we,onKeyDown:de=>{if(xe&&(de.key==="Enter"||de.key===" ")){de.preventDefault();const fe=ee(B);h?.(fe.date,fe.hour,p.user.id),d?.({startDate:fe.date,endDate:(()=>{const Ne=new Date(fe.date);return fe.hour!==void 0&&Ne.setHours(fe.hour+1,0,0,0),Ne})(),resourceId:p.user.id})}},className:c.cn("shrink-0 select-none touch-none transition-colors",xe&&"cursor-pointer",q?"border-l-2 border-l-border":"border-r border-r-border/50",j.isToday(O.date)&&"bg-primary/5",xe&&!w?.isSelecting&&!S?.isDragging&&"hover:bg-blue-50/60",te&&"bg-blue-100/70",ae&&"bg-primary/20 ring-2 ring-primary ring-inset"),style:{width:X}},`cell-${O.dayIndex}-${O.hour}`)}),p.events.map(O=>{const B=ne(O.startCol),q=ne(O.startCol+O.spanCols),X=B+2,te=q-B-4,ae=nn+O.stackIndex*(Nt+tn),xe=O.event.data?.isPlaceholder===!0,de=O.event.endDate<j.startOfDay(new Date),fe=C&&!!S&&!O.event.isCanceled&&!de&&!xe;return e.jsx("div",{className:c.cn("absolute",fe&&"cursor-grab active:cursor-grabbing"),style:{left:X,width:Math.max(te,0),top:ae,height:Nt},draggable:fe||void 0,onDragStart:fe?Ne=>{Ne.dataTransfer.effectAllowed="move",Ne.dataTransfer.setData("text/plain",O.event.id),S?.startDrag(O.event)}:void 0,children:e.jsx(Xe,{event:O.event,variant:"compact",enableDrag:C,onClick:i,renderPopover:b,className:"h-full w-full"})},O.event.id)})]})]},p.user.id)}),U.length===0&&e.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"No users or events to display"})]})})})}const Oe=j.DEFAULT_HOUR_HEIGHT,Ve=56,an=72,ke=120,it=100,Yr=3;function Et({events:t,date:n,days:s,weekStartsOn:r=1,visibleHours:a={startHour:0,endHour:24},workingHours:l,slotDuration:i=30,badgeVariant:h="colored",onEventClick:d,onSlotSelect:x,onDayClick:g,className:m,renderEvent:b,renderPopover:C}){const k=60/i,M=100/k,E=o.useMemo(()=>{const f=[];for(let _=0;_<k;_++)f.push(_*i);return f},[k,i]),L=o.useMemo(()=>{if(!s)return j.getWeekDays(n,r);const f=new Date(n);return f.setHours(0,0,0,0),Array.from({length:s},(_,U)=>j.addDays(f,U))},[n,r,s]),S=o.useMemo(()=>j.getVisibleHoursArray(a),[a]),w=o.useMemo(()=>{const f=new Map;for(const _ of L){const U=_.toDateString(),F=j.getEventsForDay(t,_),{singleDay:Y,multiDay:se}=j.separateEventsByDuration(F),J=j.calculateOverlappingPositions(Y,_,a,Oe),K=new Map;let ne=1;for(const oe of J)if(K.set(oe.event.id,oe.position),oe.position.width>0){const ee=Math.round(100/oe.position.width);ne=Math.max(ne,ee)}f.set(U,{singleDay:Y,multiDay:se,positions:K,maxOverlapping:ne})}return f},[L,t,a]),H=o.useMemo(()=>{const f=new Map;for(const{multiDay:_}of w.values())for(const U of _)f.set(U.id,U);return Array.from(f.values())},[w]),z=new Date,N=L.findIndex(f=>j.isToday(f)),D=o.useMemo(()=>{if(N<0)return-1;const f=z.getHours()+z.getMinutes()/60;return f<a.startHour||f>a.endHour?-1:(f-a.startHour)*Oe},[N,a,z]),y=o.useRef(null);o.useLayoutEffect(()=>{const f=y.current;if(!f)return;const _=()=>{let U;if(N!==-1){const Y=new Date().getHours();U=Math.max(Y-1,a.startHour)}else{const se=new Date().getDay();let J=l?.[se];if(!J?.enabled||J.from===0){const K=l?.[1];K?.enabled&&(J=K)}J?.enabled&&J.from>0?U=Math.max(J.from-1,a.startHour):U=Math.max(7,a.startHour)}const F=(U-a.startHour)*Oe;f.scrollTo({top:F,behavior:"instant"})};requestAnimationFrame(()=>{requestAnimationFrame(_)})},[n,l,a,N]);const T=ue.useOptionalSlotSelection(),V=o.useCallback(f=>{T?.startSelection(f)},[T]),I=o.useCallback(f=>{T?.updateSelection(f)},[T]),W=o.useCallback(()=>{T?.endSelection()},[T]),P=o.useCallback(f=>{d?.(f)},[d]),R=Ve+7*ke,u=o.useMemo(()=>{const f=[];for(const _ of L){const U=_.toDateString(),Y=w.get(U)?.maxOverlapping??1;Y>Yr?f.push(Math.max(ke,Y*it)):f.push(ke)}return f},[L,w]),$=Ve+u.reduce((f,_)=>f+_,0);return e.jsxs("div",{className:c.cn("ic-week-view flex flex-col h-full",m),children:[H.length>0&&e.jsx(gr,{events:H,weekDays:L,hourColumnWidth:Ve,minDayColumnWidth:ke,dayColumnWidths:u,onEventClick:P,disablePopover:!!d&&!C,renderPopover:C}),e.jsx("div",{ref:y,className:c.cn("ic-week-scroll-container flex-1"),children:e.jsxs("div",{style:{minWidth:Math.max(R,$)},children:[e.jsx("div",{className:"ic-week-header sticky top-0 z-20 border-b bg-background",children:e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",style:{width:Ve,height:an},children:e.jsxs("span",{className:"hidden sm:inline",children:["GMT",(()=>{const f=new Date().getTimezoneOffset(),_=Math.abs(Math.floor(f/60)),U=f<=0?"+":"-";return _>0?`${U}${String(_).padStart(2,"0")}`:""})()]})}),L.map((f,_)=>{const U=j.isToday(f),F=u[_]??ke,Y=F>ke;return e.jsxs("div",{className:c.cn("flex-1 flex flex-col items-center justify-center border-r last:border-r-0 py-2"),style:{height:an,minWidth:Y?F:ke},children:[e.jsx("span",{className:c.cn("text-[11px] font-medium uppercase tracking-wide",U?"text-primary":"text-muted-foreground"),children:f.toLocaleDateString([],{weekday:"short"})}),e.jsx("button",{type:"button",onClick:()=>g?.(f),className:c.cn("flex items-center justify-center rounded-full transition-colors mt-0.5","size-10 text-2xl font-normal",U?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:f.getDate()})]},f.toDateString())})]})}),e.jsxs("div",{className:"relative flex",children:[e.jsx("div",{className:c.cn("ic-hour-column sticky left-0 z-10 bg-background border-r"),style:{width:Ve},children:S.map((f,_)=>e.jsx("div",{className:"relative",style:{height:Oe},children:e.jsx("div",{className:"absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center",children:_!==0&&e.jsx("span",{className:c.cn("text-[10px] sm:text-xs text-muted-foreground"),children:j.formatHourLabel(f)})})},f))}),e.jsx("div",{className:"ic-week-grid relative flex-1",children:e.jsx("div",{className:"flex divide-x",children:L.map((f,_)=>{const U=f.toDateString(),F=w.get(U),Y=u[_]??ke,se=Y>ke;return e.jsxs("div",{className:"ic-day-column relative flex-1",style:{minWidth:se?Y:ke},children:[S.map((J,K)=>{const oe=!j.isWorkingHour(f,J,l);return e.jsxs("div",{className:c.cn("relative",oe&&"bg-calendar-disabled-hour",j.isToday(f)&&!oe&&"bg-primary/5"),style:{height:Oe},children:[K!==0&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 border-b border-border/50"}),E.slice(1).map(ee=>e.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",style:{top:`${ee/60*100}%`}},ee)),E.map((ee,he)=>{const Q={date:f,hour:J,minute:ee};return e.jsx(pt,{slot:Q,onSelectionStart:V,onSelectionMove:I,onSelectionEnd:W,isSelected:T?.isSlotSelected(Q)??!1,isSelecting:T?.isSelecting??!1,disabled:oe,className:"absolute inset-x-0",style:{top:`${he*M}%`,height:`${M}%`},ariaLabel:`Add event on ${f.toLocaleDateString()} at ${j.formatHourLabel(J)}:${String(ee).padStart(2,"0")}`},ee)})]},J)}),F?.singleDay.map(J=>{const K=F.positions.get(J.id);if(!K)return null;const ne=`calc(${K.width}% - 2px)`,oe=`max(${it}px, ${ne})`;return b?e.jsx("div",{className:"absolute pointer-events-auto p-0.5",style:{top:`${K.top}px`,left:`${K.left}%`,width:oe,minWidth:`${it}px`},children:b({event:J,position:K})},J.id):e.jsx(ft,{event:J,position:{top:K.top,left:K.left,width:K.width,minWidth:it},hourHeight:Oe,badgeVariant:h,onClick:d,disablePopover:!!d&&!C,renderPopover:C,className:c.cn("pointer-events-auto")},J.id)}),_===N&&D>=0&&e.jsxs("div",{"data-ic-now":"",className:c.cn("absolute left-0 right-0 z-20 flex items-center pointer-events-none"),style:{top:D},children:[e.jsx("div",{className:"h-2 w-2 -ml-1 rounded-full bg-red-500"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]})]},f.toDateString())})})})]})]})})]})}const Gr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Kr=["January","February","March","April","May","June","July","August","September","October","November","December"];function ln(t){const n=t.hexColor;return n?{backgroundColor:n}:{}}function Xr({day:t,date:n,events:s,isCurrentMonth:r,onDayClick:a}){const l=j.isToday(n),i=3,h=s.length;return e.jsxs("button",{type:"button",onClick:()=>a?.(n),className:c.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:c.cn("flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",l&&"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<=i?s.map(d=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:ln(d)},d.id)):e.jsxs(e.Fragment,{children:[s.slice(0,i).map(d=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:ln(d)},d.id)),e.jsxs("span",{className:"text-[6px] sm:text-[7px] font-medium text-muted-foreground",children:["+",h-i]})]})})]})}function Jr({date:t,events:n,onMonthClick:s,onDayClick:r}){const a=o.useMemo(()=>j.generateMonthGrid(t,0),[t]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("button",{type:"button",onClick:()=>s?.(t),className:c.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:Kr[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:Gr.map((l,i)=>e.jsxs("div",{className:"text-[9px] sm:text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"sm:hidden",children:l[0]}),e.jsx("span",{className:"hidden sm:inline",children:l})]},i))}),e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 gap-y-1",children:a.map((l,i)=>{const h=j.getEventsForDay(n,l.date);return e.jsx(Xr,{day:l.date.getDate(),date:l.date,events:h,isCurrentMonth:l.isCurrentMonth,onDayClick:r},`${i+1}-${l.date.toISOString()}`)})})]})]})}function _n({events:t,year:n,onMonthClick:s,onDayClick:r,className:a}){const l=o.useMemo(()=>j.getYearMonths(n),[n]);return e.jsxs("div",{className:c.cn("flex flex-col h-full",a),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:n})}),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:l.map(i=>e.jsx(Jr,{date:i,events:t,onMonthClick:s,onDayClick:r},i.getMonth()))})})]})}const Qr=[],Zr=[],Wn=["day","4day","week","month","agenda"];function eo(t){switch(t){case"day":case"4day":case"week":return"time";default:return"day"}}function to({onEventClick:t,onSlotClick:n,onSlotSelect:s,onAddEvent:r,alwaysShowResources:a,className:l,showHeader:i=!0,minSelectionMinutes:h=30,showMoreMode:d,showMoreEventsInPopover:x=!1,isLoading:g=!1,eventCard:m,eventForm:b,settingsContent:C,filterContent:k,headerActions:M,eventDetail:E,calendarRef:L,headerConfig:S,resourceColumnConfig:w,filters:H,labels:z,showSidebar:N=!1,sidebarContent:D,createLabel:y,locale:T}){const V=d??(x?"popover":"expand"),{view:I,setView:W,selectedDate:P,setSelectedDate:R,slotDuration:u,filteredEvents:$,users:f,visibleHours:_,workingHours:U,badgeVariant:F,showWorkingHoursOnly:Y,clearFocusEventId:se}=ue.useInnoCalendar(),J=o.useMemo(()=>{if(!Y||!U)return{startHour:_.start,endHour:_.end};let v=24,G=0;for(const Z of Object.keys(U)){const ge=U[Number(Z)];!ge||ge.enabled===!1||(ge.from<v&&(v=ge.from),ge.to>G&&(G=ge.to))}return v>=G?{startHour:_.start,endHour:_.end}:{startHour:v,endHour:G}},[Y,U,_]),K=J,ne=o.useRef(null),oe=o.useRef(null),ee=o.useMemo(()=>({scrollToToday:()=>{const v=new Date;R(v,I),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const G=ne.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!G)return;const Z=v.getHours(),ge=j.DEFAULT_HOUR_HEIGHT,He=(Z-J.startHour)*ge;He>0&&G.scrollTo({top:Math.max(0,He-100),behavior:"smooth"})})})},openForm:v=>{if(!v?.start&&!v?.event)return oe.current?.();const G=v?.start??(v?.event).startDate,Z=v?.end??(v?.event?v.event.endDate:new Date(G.getTime()+30*6e4));Me({selection:{startDate:G,endDate:Z,...v?.resourceId!==void 0&&{resourceId:v.resourceId}},...v?.anchor&&{anchor:v.anchor},...v?.event&&{event:v.event}})},getNowAnchor:()=>{const v=ne.current,G=v?.querySelector("[data-ic-now]")??v?.querySelector("[data-ic-today]");if(!G)return null;const Z=G.getBoundingClientRect();return Z.width===0&&Z.height===0||!(Z.bottom>0&&Z.top<window.innerHeight&&Z.right>0&&Z.left<window.innerWidth)?null:{x:Z.left,y:Z.top+Z.height/2}},scrollToWorkingHours:()=>{let v=8;if(U)for(const G of Object.keys(U)){const Z=U[Number(G)];Z?.enabled&&Z.from<v&&(v=Math.max(Z.from-1,0))}requestAnimationFrame(()=>{requestAnimationFrame(()=>{const G=ne.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!G)return;const Z=j.DEFAULT_HOUR_HEIGHT,ge=(v-J.startHour)*Z;G.scrollTo({top:Math.max(0,ge),behavior:"smooth"})})})},getViewRect:()=>ne.current?.getBoundingClientRect()??null,focusEvent:v=>{se(),requestAnimationFrame(()=>{se()});const G=ne.current?.querySelector(`[data-event-id="${v}"]`);G&&setTimeout(()=>G.click(),150)}}),[R,I,J,U,se]);o.useImperativeHandle(L,()=>ee,[ee]);const he=o.useRef(I);o.useEffect(()=>{if(he.current===I||(he.current=I,I==="month"||I==="year"||I==="agenda"))return;const v=setTimeout(()=>ee.scrollToToday(),300);return()=>clearTimeout(v)},[I,ee]);const Q=o.useMemo(()=>eo(I),[I]),le=o.useRef({x:0,y:0}),[ie,Me]=o.useState(null);o.useEffect(()=>{const v=G=>{le.current={x:G.clientX,y:G.clientY}};return document.addEventListener("pointerdown",v,!0),document.addEventListener("pointerup",v,!0),()=>{document.removeEventListener("pointerdown",v,!0),document.removeEventListener("pointerup",v,!0)}},[]);const re=o.useCallback(v=>{if(s){s(v,{anchor:{...le.current}});return}if(b){Me({selection:v,anchor:{...le.current,align:"start"}});return}if(n){const G=v.startDate.getHours();n(v.startDate,G)}},[s,n,b]),ce=o.useCallback(v=>{W("day"),R(v,"day")},[R,W]),we=o.useCallback(v=>{W("month"),R(v,"month")},[R,W]),p=o.useCallback(v=>{t?.(v)},[t]),A=o.useCallback((v,G,Z)=>{n?.(v,G)},[n]),O=o.useCallback((v,G)=>{Me({selection:{startDate:G?.start??v.startDate,endDate:G?.end??v.endDate},event:v})},[]),B=o.useCallback(()=>{const v=new Date,G=h??30;v.setMinutes(Math.floor(v.getMinutes()/G)*G,0,0);const Z=new Date(v.getTime()+G*6e4),ge=()=>{const Pe=ee.getNowAnchor();return Pe?{...Pe,align:"end"}:void 0},He=Pe=>Me({selection:{startDate:v,endDate:Z},...Pe&&{anchor:Pe}}),zt=ge();if(zt)return He(zt);ee.scrollToToday(),setTimeout(()=>He(ge()),450)},[ee,h]);oe.current=B;const q=r??(b?B:void 0),X=o.useMemo(()=>E?({event:v,onClose:G})=>E(v,{close:G,...b&&{edit:()=>{G(),setTimeout(()=>O(v),0)}}}):void 0,[E,b,O]),te=()=>{const v=$,G=p,Z=X;switch(I){case"day":return f.length>1?e.jsx(Be,{events:v,dates:[P],resources:f,visibleHours:K,slotDuration:u,badgeVariant:F,...T&&{locale:T},onEventClick:G,renderPopover:Z}):e.jsx(Rn,{events:v,date:P,visibleHours:K,workingHours:U,slotDuration:u,badgeVariant:F,onEventClick:G,renderPopover:Z});case"4day":return f.length>1?e.jsx(Be,{events:v,dates:Array.from({length:4},(ge,He)=>j.addDays(P,He)),resources:f,visibleHours:K,slotDuration:u,badgeVariant:F,...T&&{locale:T},onEventClick:G,renderPopover:Z}):e.jsx(Et,{events:v,date:P,days:4,visibleHours:K,workingHours:U,slotDuration:u,badgeVariant:F,onEventClick:G,renderPopover:Z});case"week":return f.length>1?e.jsx(Be,{events:v,dates:j.getWeekDays(P),resources:f,visibleHours:K,slotDuration:u,badgeVariant:F,...T&&{locale:T},onEventClick:G,renderPopover:Z}):e.jsx(Et,{events:v,date:P,visibleHours:K,workingHours:U,slotDuration:u,badgeVariant:F,onEventClick:G,renderPopover:Z});case"month":return e.jsx(Ct,{events:v,date:P,badgeVariant:F,onEventClick:G,onDayClick:ce,renderPopover:Z,showMoreMode:V});case"year":return e.jsx(_n,{events:v,year:P.getFullYear(),onMonthClick:we,onDayClick:ce});case"agenda":return e.jsx(En,{events:v,date:P,onEventClick:G,renderPopover:Z,...T&&{locale:T},...z?.agenda&&{labels:z.agenda}});case"resource-day":return e.jsx(Be,{events:v,dates:[P],resources:f,visibleHours:K,slotDuration:u,badgeVariant:F,...T&&{locale:T},onEventClick:G,renderPopover:Z});case"resource-week":return e.jsx(dt,{daysToShow:7,events:v,users:f,...a&&{alwaysShowResources:a},selectedDate:P,visibleHours:{from:J.startHour,to:J.endHour},onEventClick:G,onSlotSelect:re,onSlotClick:A,renderPopover:Z,...w&&{resourceColumnConfig:w}});case"timeline-day":return e.jsx(Be,{events:v,dates:[P],resources:f,visibleHours:K,slotDuration:u,badgeVariant:F,...T&&{locale:T},onEventClick:G,renderPopover:Z});case"timeline-3day":return e.jsx(dt,{daysToShow:3,events:v,users:f,...a&&{alwaysShowResources:a},selectedDate:P,visibleHours:{from:J.startHour,to:J.endHour},onEventClick:G,onSlotSelect:re,onSlotClick:A,renderPopover:Z,...w&&{resourceColumnConfig:w}});case"timeline-week":return e.jsx(dt,{daysToShow:7,events:v,users:f,...a&&{alwaysShowResources:a},selectedDate:P,visibleHours:{from:J.startHour,to:J.endHour},onEventClick:G,onSlotSelect:re,onSlotClick:A,renderPopover:Z,...w&&{resourceColumnConfig:w}});default:return e.jsx(Ct,{events:v,date:P,badgeVariant:F,onEventClick:G,onDayClick:ce})}},ae=o.useRef(null);o.useEffect(()=>{ne.current=ae.current});const[xe,de]=o.useState(!1),fe=e.jsxs(e.Fragment,{children:[H&&e.jsx(Mn,{...z?.filters&&{title:z.filters},children:H({close:()=>de(!1)})}),D]}),Ne=e.jsx(Se,{delayDuration:300,children:e.jsx(ue.SlotSelectionProvider,{mode:Q,onSelect:re,minDurationMinutes:h,slotDurationMinutes:u,enabled:!!(s||n||b)&&!ie,children:e.jsxs("div",{className:c.cn("inno-calendar-root flex h-full gap-4 p-4",l),children:[N&&e.jsx(kn,{selected:P,onSelect:v=>R(v,I),...T&&{locale:T},...q&&{onCreate:q},...y&&{createLabel:y},children:fe}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[i&&e.jsx(wn,{currentDate:P,view:I,...N&&{leadingAction:e.jsx(Cn,{open:xe,onOpenChange:de,selected:P,onSelect:v=>R(v,I),...T&&{locale:T},...q&&{onCreate:()=>{de(!1),q()}},...y&&{createLabel:y},...z?.filters&&{label:z.filters},children:fe})},...z?.header&&{labels:z.header},events:$,onViewChange:W,onNavigateToday:()=>R(new Date,I),onNavigatePrev:()=>{const v=new Date(P);I==="day"||I==="timeline-day"||I==="resource-day"?v.setDate(v.getDate()-1):I==="timeline-3day"?v.setDate(v.getDate()-3):I==="4day"?v.setDate(v.getDate()-4):I==="week"||I==="timeline-week"||I==="resource-week"?v.setDate(v.getDate()-7):I==="month"?v.setMonth(v.getMonth()-1):I==="year"?v.setFullYear(v.getFullYear()-1):v.setDate(v.getDate()-7),R(v,I)},onNavigateNext:()=>{const v=new Date(P);I==="day"||I==="timeline-day"||I==="resource-day"?v.setDate(v.getDate()+1):I==="timeline-3day"?v.setDate(v.getDate()+3):I==="4day"?v.setDate(v.getDate()+4):I==="week"||I==="timeline-week"||I==="resource-week"?v.setDate(v.getDate()+7):I==="month"?v.setMonth(v.getMonth()+1):I==="year"?v.setFullYear(v.getFullYear()+1):v.setDate(v.getDate()+7),R(v,I)},availableViews:Wn,showTimelineViews:!0,showSettings:!0,...!M&&q&&{onAddEvent:q},actions:M,settingsContent:C,filterContent:k,...S&&{headerConfig:S}}),e.jsxs("div",{className:"relative flex-1 min-h-0",children:[e.jsx("div",{ref:ae,className:c.cn("h-full border rounded-lg bg-white overflow-x-auto"),children:te()}),g&&e.jsx("div",{className:"inno-calendar-loading-overlay",children:e.jsx("div",{className:"inno-calendar-spinner"})}),e.jsx(sr,{containerRef:ae,currentDate:P})]})]}),ie&&b&&e.jsx(Nn,{args:{selection:ie.selection,...ie.event&&{event:ie.event}},...ie.anchor&&{anchor:ie.anchor},render:b,onClose:()=>Me(null)})]})})});return m?e.jsx(Bn,{render:m,children:Ne}):Ne}function no({events:t=Qr,users:n=Zr,alwaysShowResources:s,scheduleTypes:r=[],initialView:a,initialDate:l,initialSelectedUserId:i,initialScheduleTypeIds:h,initialParticipantIds:d,initialWorkingHoursView:x,initialSearchQuery:g,preferencesConfig:m,viewPersistence:b,onEventClick:C,onSlotClick:k,onSlotSelect:M,onAddEvent:E,onEventDrop:L,onDateChange:S,onViewChange:w,className:H,showHeader:z=!0,minSelectionMinutes:N=30,showMoreMode:D,showMoreEventsInPopover:y=!1,isLoading:T=!1,eventDetail:V,settingsContent:I,filterContent:W,headerActions:P,focusEventId:R,headerConfig:u,resourceColumnConfig:$,filters:f,labels:_,eventCard:U,eventForm:F,showSidebar:Y,sidebarContent:se,createLabel:J,locale:K},ne){const oe=o.useRef(null),ee=o.useCallback(ie=>{oe.current=ie,typeof ne=="function"?ne(ie):ne&&(ne.current=ie)},[ne]),he=o.useMemo(()=>{if(L)return L;if(F)return ie=>setTimeout(()=>oe.current?.openForm({event:ie.event,start:ie.newStartDate,end:ie.newEndDate}),0)},[L,F]),Q=e.jsx(to,{...C&&{onEventClick:C},...k&&{onSlotClick:k},...M&&{onSlotSelect:M},...E&&{onAddEvent:E},...s&&{alwaysShowResources:s},...V&&{eventDetail:V},className:H,showHeader:z,minSelectionMinutes:N,...D&&{showMoreMode:D},showMoreEventsInPopover:y,isLoading:T,...U&&{eventCard:U},...F&&{eventForm:F},settingsContent:I,filterContent:W,headerActions:P,calendarRef:ee,...u&&{headerConfig:u},...$&&{resourceColumnConfig:$},...f&&{filters:f},..._&&{labels:_},..._?.agenda&&{agendaLabels:_.agenda},...Y!==void 0&&{showSidebar:Y},sidebarContent:se,...J&&{createLabel:J},...K&&{locale:K}}),le=ie=>e.jsx(ue.InnoCalendarProvider,{initialEvents:t,initialUsers:n,initialScheduleTypes:r,allowedViews:Wn,...a&&{initialView:a},...l&&{initialDate:l},...i&&{initialSelectedUserId:i},...h&&{initialScheduleTypeIds:h},...d&&{initialParticipantIds:d},...x&&{initialWorkingHoursView:x},...g&&{initialSearchQuery:g},...m&&{preferencesConfig:m},...b&&{viewPersistence:b},...S&&{onDateChange:S},...w&&{onViewChange:w},...R&&{initialFocusEventId:R},children:ie});return e.jsx(ue.DragDropProvider,{...he&&{onEventDrop:he},children:le(Q)})}const so=o.forwardRef(no);exports.AgendaView=En;exports.Button=je;exports.CalendarHeader=wn;exports.CalendarSettings=bn;exports.CalendarSidebar=kn;exports.DateNavigator=Bs;exports.DayEventsExpansion=Sn;exports.DaySlot=In;exports.DayView=Rn;exports.EventBlock=ft;exports.EventCard=Xe;exports.EventPopover=Ns;exports.FieldLayer=Ht;exports.FilterPanel=Mn;exports.InnoCalendar=so;exports.MiniMonth=At;exports.MonthView=Ct;exports.MultiDayBanner=Tn;exports.MultiDayEventBar=es;exports.Popover=Ie;exports.PopoverAnchor=Vn;exports.PopoverContent=Te;exports.PopoverTrigger=Re;exports.QuickCreate=Nn;exports.RecurrenceField=Dr;exports.Sheet=Tt;exports.SheetClose=Yn;exports.SheetContent=xt;exports.SheetDescription=xn;exports.SheetHeader=mn;exports.SheetTitle=ht;exports.SheetTrigger=Lt;exports.SidebarSheet=Cn;exports.TimeSlot=pt;exports.TimelineView=dt;exports.TodayButton=Vs;exports.Tooltip=De;exports.TooltipContent=be;exports.TooltipProvider=Se;exports.TooltipTrigger=Ce;exports.WeekView=Et;exports.WhenRow=Er;exports.YearView=_n;exports.buttonVariants=gn;exports.getEventColorClasses=Ae;exports.recurrencePresets=Hn;
11
+ //# sourceMappingURL=inno-calendar-BnCt65PZ.cjs.map