cortex-react-components 3.0.7 → 3.0.9

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 (225) hide show
  1. package/dist/{chunk-LSHBOPCT.mjs → chunk-27NWC2OO.mjs} +6 -3
  2. package/dist/{chunk-6B6BKJIE.mjs → chunk-34R3E2JB.mjs} +1 -1
  3. package/dist/{chunk-2NKCNQ56.mjs → chunk-3YAZKLH3.mjs} +1 -1
  4. package/dist/{chunk-FUNWDVGQ.mjs → chunk-4DNX5IYR.mjs} +1 -1
  5. package/dist/{chunk-HABWABS7.mjs → chunk-4O6ESJYG.mjs} +32 -11
  6. package/dist/{chunk-7H3IRT7K.mjs → chunk-5CQITTLV.mjs} +1 -1
  7. package/dist/{chunk-NAPGIF5D.mjs → chunk-5DYPBHBP.mjs} +3 -3
  8. package/dist/{chunk-DAQOEDAR.mjs → chunk-5NGZXIP7.mjs} +1 -1
  9. package/dist/{chunk-P4DQRHCA.mjs → chunk-6I3O6TVG.mjs} +1 -1
  10. package/dist/{chunk-EDJDHF22.mjs → chunk-6QSVFSOJ.mjs} +1 -1
  11. package/dist/{chunk-R2SJ5TZH.mjs → chunk-6VQJSQRU.mjs} +8 -8
  12. package/dist/{chunk-WMAVH7JO.mjs → chunk-6VQLA4YU.mjs} +2 -2
  13. package/dist/{chunk-GXTF5CHJ.mjs → chunk-7D3SYOXW.mjs} +7 -4
  14. package/dist/{chunk-DO73CLFG.mjs → chunk-AQPLEBKG.mjs} +1 -1
  15. package/dist/{chunk-ZPWWTTFF.mjs → chunk-BPAZFILP.mjs} +1 -1
  16. package/dist/{chunk-K3TF6OWE.mjs → chunk-BVCARDFK.mjs} +5 -5
  17. package/dist/{chunk-ENFQLMV3.mjs → chunk-CKBIYWPM.mjs} +1 -1
  18. package/dist/{chunk-KV5RVOAP.mjs → chunk-DGV5AVAW.mjs} +1 -1
  19. package/dist/{chunk-OS5X3ADZ.mjs → chunk-E5LGE3IW.mjs} +1 -1
  20. package/dist/chunk-F4LCVFZK.mjs +19 -0
  21. package/dist/{chunk-LAJ5FNY4.mjs → chunk-G5N5MCLS.mjs} +1 -1
  22. package/dist/{chunk-HZZWKYB5.mjs → chunk-G7GPQ6BO.mjs} +1 -1
  23. package/dist/{chunk-URCY4KWN.mjs → chunk-G7WAPCKX.mjs} +1 -1
  24. package/dist/{chunk-7OGBZ6QQ.mjs → chunk-ICVTRW5Y.mjs} +1 -1
  25. package/dist/{chunk-AICDXFGU.mjs → chunk-IFEQNYUB.mjs} +2 -2
  26. package/dist/{chunk-LCRSPNPB.mjs → chunk-LELKTN52.mjs} +18 -14
  27. package/dist/{chunk-RKQ4CVVG.mjs → chunk-M7LM5P64.mjs} +1 -1
  28. package/dist/{chunk-DQZO42TD.mjs → chunk-MSAH6P5O.mjs} +1 -1
  29. package/dist/{chunk-GZW77OJM.mjs → chunk-NKHYDT5B.mjs} +1 -1
  30. package/dist/{chunk-TTVOGAI4.mjs → chunk-OFES4YYV.mjs} +2 -2
  31. package/dist/{chunk-LP3K7AVX.mjs → chunk-OYHXC3AT.mjs} +13 -13
  32. package/dist/{chunk-7ZMZT7I6.mjs → chunk-P7BPG7W7.mjs} +1 -1
  33. package/dist/chunk-PIQUYPOZ.mjs +41 -0
  34. package/dist/{chunk-KVULICDA.mjs → chunk-PVI4R7FJ.mjs} +1 -1
  35. package/dist/{chunk-I647IJUG.mjs → chunk-QC2AXU6I.mjs} +2 -2
  36. package/dist/{chunk-M5JROT2X.mjs → chunk-R242HNC3.mjs} +1 -1
  37. package/dist/{chunk-6Q4KYDHK.mjs → chunk-RJRQ3SY5.mjs} +2 -2
  38. package/dist/{chunk-OXZ5QAXQ.mjs → chunk-S4FUSOSS.mjs} +1 -1
  39. package/dist/{chunk-DAGWV4UL.mjs → chunk-SRK3Y7FA.mjs} +1 -1
  40. package/dist/{chunk-2TJ5HOCV.mjs → chunk-UBEWNGCN.mjs} +1 -1
  41. package/dist/{chunk-JBFNSEIJ.mjs → chunk-UETTBM3J.mjs} +1 -1
  42. package/dist/{chunk-DB2F6SID.mjs → chunk-ULYN63F3.mjs} +1 -1
  43. package/dist/{chunk-VNSEHNDX.mjs → chunk-VF2QBVAI.mjs} +1 -1
  44. package/dist/{chunk-EC4N6ZH3.mjs → chunk-WA3OQB7X.mjs} +1 -1
  45. package/dist/{chunk-UDZU3AZC.mjs → chunk-XWYGGWIF.mjs} +4 -4
  46. package/dist/{chunk-2PGER2HM.mjs → chunk-YMXGTNMY.mjs} +1 -1
  47. package/dist/{chunk-G3UZUSQZ.mjs → chunk-ZFWHFUZP.mjs} +4 -4
  48. package/dist/{chunk-HQ2AUN2H.mjs → chunk-ZMITLXFT.mjs} +1 -1
  49. package/dist/{chunk-DRCDP3RU.mjs → chunk-ZXU5T3GV.mjs} +1 -1
  50. package/dist/{chunk-6RAMGDYG.mjs → chunk-ZZ5EM2M4.mjs} +1 -1
  51. package/dist/components/AdvancedComponents/index.mjs +9 -9
  52. package/dist/components/AdvancedComponents/org-chart-component/OrgChart.mjs +4 -4
  53. package/dist/components/AdvancedComponents/org-chart-component/OrgNode.mjs +2 -2
  54. package/dist/components/AdvancedComponents/org-chart-component/OrgTree.mjs +3 -3
  55. package/dist/components/AdvancedComponents/org-chart-component/index.mjs +6 -6
  56. package/dist/components/Blocks/Banner.js +17 -1
  57. package/dist/components/Blocks/Banner.mjs +4 -3
  58. package/dist/components/Blocks/CallToAction.js +17 -1
  59. package/dist/components/Blocks/CallToAction.mjs +4 -3
  60. package/dist/components/Blocks/CollapsibleArea.js +17 -1
  61. package/dist/components/Blocks/CollapsibleArea.mjs +5 -4
  62. package/dist/components/Blocks/Content.js +17 -1
  63. package/dist/components/Blocks/Content.mjs +5 -4
  64. package/dist/components/Blocks/FeaturesBlock.js +17 -1
  65. package/dist/components/Blocks/FeaturesBlock.mjs +4 -3
  66. package/dist/components/Blocks/RelatedPosts.js +17 -1
  67. package/dist/components/Blocks/RelatedPosts.mjs +5 -4
  68. package/dist/components/Blocks/RenderBlocks.js +17 -1
  69. package/dist/components/Blocks/RenderBlocks.mjs +7 -6
  70. package/dist/components/Blocks/ReusableContentBlock.js +17 -1
  71. package/dist/components/Blocks/ReusableContentBlock.mjs +7 -6
  72. package/dist/components/Blocks/index.js +17 -1
  73. package/dist/components/Blocks/index.mjs +13 -12
  74. package/dist/components/CRM/CogeBoard.js +1 -1
  75. package/dist/components/CRM/CogeBoard.mjs +2 -2
  76. package/dist/components/CRM/DealDetails.js +1 -1
  77. package/dist/components/CRM/DealDetails.mjs +1 -1
  78. package/dist/components/CRM/KanbanBoard.js +1 -1
  79. package/dist/components/CRM/KanbanBoard.mjs +2 -2
  80. package/dist/components/CRM/NewDealForm.js +1 -1
  81. package/dist/components/CRM/NewDealForm.mjs +1 -1
  82. package/dist/components/CRM/index.js +2 -2
  83. package/dist/components/CRM/index.mjs +4 -4
  84. package/dist/components/CRM/mockData.js +6 -6
  85. package/dist/components/CRM/mockData.mjs +6 -6
  86. package/dist/components/Cards/ContentCard.js +17 -1
  87. package/dist/components/Cards/ContentCard.mjs +4 -3
  88. package/dist/components/Cards/FeatureCard.js +17 -1
  89. package/dist/components/Cards/FeatureCard.mjs +4 -3
  90. package/dist/components/Cards/index.js +17 -1
  91. package/dist/components/Cards/index.mjs +6 -5
  92. package/dist/components/Chat/ChatInterface.mjs +7 -7
  93. package/dist/components/Chat/CopilotInterface.mjs +8 -8
  94. package/dist/components/Chat/PartTypes/MessageHandler.mjs +6 -6
  95. package/dist/components/Chat/PartTypes/index.mjs +19 -19
  96. package/dist/components/Chat/demo-long-messages.mjs +8 -8
  97. package/dist/components/Chat/demo-tests.mjs +8 -8
  98. package/dist/components/Chat/demo.mjs +8 -8
  99. package/dist/components/Chat/example-usage.mjs +9 -9
  100. package/dist/components/Chat/example-with-vercel-ai.mjs +8 -8
  101. package/dist/components/Chat/index.mjs +11 -11
  102. package/dist/components/DigitalColleagues/MainPage.mjs +4 -4
  103. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +9 -9
  104. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +2 -2
  105. package/dist/components/DigitalColleagues/Views/index.mjs +19 -19
  106. package/dist/components/DigitalColleagues/index.mjs +27 -27
  107. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +2 -2
  108. package/dist/components/Foundary/Knowledge/add-team-context.mjs +2 -2
  109. package/dist/components/Foundary/MainPage.mjs +4 -4
  110. package/dist/components/Foundary/Pages/dashboardpage.mjs +13 -13
  111. package/dist/components/Foundary/RichText/index.mjs +3 -3
  112. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +2 -2
  113. package/dist/components/Foundary/Views/KnowledgeView.mjs +9 -9
  114. package/dist/components/Foundary/Views/index.mjs +21 -21
  115. package/dist/components/Foundary/document-edit.mjs +4 -4
  116. package/dist/components/Foundary/document-preview-examples.mjs +5 -5
  117. package/dist/components/Foundary/document-preview.mjs +5 -5
  118. package/dist/components/Foundary/file-edit.mjs +6 -6
  119. package/dist/components/Foundary/index.mjs +39 -39
  120. package/dist/components/Foundary/knowledge-browser.mjs +6 -6
  121. package/dist/components/HeaderFooter/SectionHeading.js +17 -1
  122. package/dist/components/HeaderFooter/SectionHeading.mjs +5 -4
  123. package/dist/components/HeaderFooter/index.mjs +8 -8
  124. package/dist/components/Heros/HighImpact/index.js +17 -1
  125. package/dist/components/Heros/HighImpact/index.mjs +5 -4
  126. package/dist/components/Heros/LowImpact/index.js +17 -1
  127. package/dist/components/Heros/LowImpact/index.mjs +5 -4
  128. package/dist/components/Heros/MediumImpact/index.js +17 -1
  129. package/dist/components/Heros/MediumImpact/index.mjs +5 -4
  130. package/dist/components/Heros/PostHero/index.mjs +2 -2
  131. package/dist/components/Heros/RenderHero.js +17 -1
  132. package/dist/components/Heros/RenderHero.mjs +8 -7
  133. package/dist/components/Heros/index.js +17 -1
  134. package/dist/components/Heros/index.mjs +12 -11
  135. package/dist/components/Holidays/CalendarView.d.ts +2 -1
  136. package/dist/components/Holidays/CalendarView.js +18 -14
  137. package/dist/components/Holidays/CalendarView.mjs +1 -1
  138. package/dist/components/Holidays/HolidayGrid.js +5 -3
  139. package/dist/components/Holidays/HolidayGrid.mjs +2 -2
  140. package/dist/components/Holidays/HolidayTracker.d.ts +2 -1
  141. package/dist/components/Holidays/HolidayTracker.js +65 -35
  142. package/dist/components/Holidays/HolidayTracker.mjs +5 -5
  143. package/dist/components/Holidays/RequestLeave.js +40 -17
  144. package/dist/components/Holidays/RequestLeave.mjs +2 -2
  145. package/dist/components/Holidays/index.js +65 -35
  146. package/dist/components/Holidays/index.mjs +5 -5
  147. package/dist/components/Layouts/OutputHeaderFooter.js +17 -1
  148. package/dist/components/Layouts/OutputHeaderFooter.mjs +6 -5
  149. package/dist/components/Layouts/Print.js +17 -1
  150. package/dist/components/Layouts/Print.mjs +10 -9
  151. package/dist/components/Layouts/SlideShow.js +17 -1
  152. package/dist/components/Layouts/SlideShow.mjs +12 -11
  153. package/dist/components/Layouts/index.js +17 -1
  154. package/dist/components/Layouts/index.mjs +16 -15
  155. package/dist/components/Menus/index.mjs +3 -3
  156. package/dist/components/Payload/RichText/index.js +17 -1
  157. package/dist/components/Payload/RichText/index.mjs +4 -3
  158. package/dist/components/Payload/RichText/serialize.js +17 -1
  159. package/dist/components/Payload/RichText/serialize.mjs +4 -3
  160. package/dist/components/Payload/index.js +17 -1
  161. package/dist/components/Payload/index.mjs +7 -6
  162. package/dist/components/Projects/EpicsView.mjs +2 -2
  163. package/dist/components/Projects/FileView.mjs +9 -9
  164. package/dist/components/Projects/KanbanBoardView.mjs +12 -12
  165. package/dist/components/Projects/ProjectPage.mjs +16 -16
  166. package/dist/components/Projects/ProjectView.mjs +16 -16
  167. package/dist/components/Projects/TaskDetailsModal.mjs +10 -10
  168. package/dist/components/Projects/file-list.mjs +7 -7
  169. package/dist/components/Projects/index.mjs +15 -15
  170. package/dist/components/dc-temp/index.mjs +9 -9
  171. package/dist/components/index.js +116 -70
  172. package/dist/components/index.mjs +121 -120
  173. package/dist/components/ui/index.mjs +11 -11
  174. package/dist/decorators/Intranet.mjs +73 -72
  175. package/dist/index.js +116 -70
  176. package/dist/index.mjs +134 -133
  177. package/dist/metafile-cjs.json +1 -1
  178. package/dist/metafile-esm.json +1 -1
  179. package/dist/pages/Blog.js +17 -1
  180. package/dist/pages/Blog.mjs +12 -11
  181. package/dist/pages/Documentation.mjs +4 -4
  182. package/dist/pages/IndexPage.mjs +15 -14
  183. package/dist/pages/Intranet.mjs +1 -1
  184. package/dist/pages/LandingPage.js +17 -1
  185. package/dist/pages/LandingPage.mjs +83 -82
  186. package/dist/pages/Page.js +17 -1
  187. package/dist/pages/Page.mjs +15 -14
  188. package/dist/pages/Publish.js +17 -1
  189. package/dist/pages/Publish.mjs +72 -71
  190. package/dist/pages/Website.js +17 -1
  191. package/dist/pages/Website.mjs +17 -16
  192. package/dist/payload-types.d.ts +1 -1
  193. package/dist/sections/AboutSection.js +17 -1
  194. package/dist/sections/AboutSection.mjs +6 -5
  195. package/dist/sections/BlogDetail.js +17 -1
  196. package/dist/sections/BlogDetail.mjs +5 -4
  197. package/dist/sections/BlogList.js +17 -1
  198. package/dist/sections/BlogList.mjs +6 -5
  199. package/dist/sections/BlogListSection.mjs +2 -2
  200. package/dist/sections/ContactSection.js +17 -1
  201. package/dist/sections/ContactSection.mjs +6 -5
  202. package/dist/sections/PageSections.js +17 -1
  203. package/dist/sections/PageSections.mjs +81 -80
  204. package/dist/sections/PricingSection.js +17 -1
  205. package/dist/sections/PricingSection.mjs +6 -5
  206. package/dist/sections/ServiceDetail.js +17 -1
  207. package/dist/sections/ServiceDetail.mjs +5 -4
  208. package/dist/sections/ServiceDetailSection.js +17 -1
  209. package/dist/sections/ServiceDetailSection.mjs +5 -4
  210. package/dist/sections/ServiceSection.js +17 -1
  211. package/dist/sections/ServiceSection.mjs +72 -71
  212. package/dist/sections/index.js +17 -1
  213. package/dist/sections/index.mjs +83 -82
  214. package/dist/utils/DaysUtil.js +9 -7
  215. package/dist/utils/DaysUtil.mjs +1 -1
  216. package/dist/utils/getLinkHref.d.ts +12 -0
  217. package/dist/utils/getLinkHref.js +43 -0
  218. package/dist/utils/getLinkHref.mjs +7 -0
  219. package/package.json +1 -1
  220. package/dist/chunk-I4UOIVSC.mjs +0 -39
  221. package/dist/{chunk-25OSLP2V.mjs → chunk-6TVRFATY.mjs} +3 -3
  222. package/dist/{chunk-EUAUP52U.mjs → chunk-7UMFQPR5.mjs} +3 -3
  223. package/dist/{chunk-ECCJ42NJ.mjs → chunk-L666B5DN.mjs} +14 -14
  224. package/dist/{chunk-DZYAOBGH.mjs → chunk-PXB2ICFA.mjs} +3 -3
  225. package/dist/{chunk-6OFY4WMY.mjs → chunk-RWZ36G7W.mjs} +3 -3
@@ -5643,6 +5643,22 @@ var ImageBlock = (props) => {
5643
5643
  );
5644
5644
  };
5645
5645
 
5646
+ // src/utils/getLinkHref.ts
5647
+ function getLinkHref(link) {
5648
+ if (!link) return "#";
5649
+ if (link.url) return link.url;
5650
+ if (link.reference?.value) {
5651
+ const { relationTo, value } = link.reference;
5652
+ const slug = value?.slug;
5653
+ if (!slug) return "#";
5654
+ if (relationTo === "pages") {
5655
+ return `/${slug}`;
5656
+ }
5657
+ return `/${relationTo}/${slug}`;
5658
+ }
5659
+ return "#";
5660
+ }
5661
+
5646
5662
  // src/components/Blocks/FeaturesBlock.tsx
5647
5663
  var import_jsx_runtime44 = require("react/jsx-runtime");
5648
5664
  var FeaturesBlock = ({ title, description, features, id, nested = false }) => {
@@ -5972,7 +5988,7 @@ function FeatureCard({
5972
5988
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
5973
5989
  "a",
5974
5990
  {
5975
- href: link?.url || "#",
5991
+ href: getLinkHref(link),
5976
5992
  className: cn(
5977
5993
  "min-w-56 max-w-xl h-full flex flex-col group bg-background",
5978
5994
  image ? "p-0" : "p-6 md:p-8",
@@ -10236,7 +10252,6 @@ function ApproveLeave({ leaveRequests, onApprove, onReject }) {
10236
10252
 
10237
10253
  // src/components/Holidays/RequestLeave.tsx
10238
10254
  var import_react30 = require("react");
10239
- var import_date_fns = require("date-fns");
10240
10255
  var import_lucide_react20 = require("lucide-react");
10241
10256
  var import_navigation7 = require("next/navigation");
10242
10257
  var import_sonner3 = require("sonner");
@@ -10281,14 +10296,16 @@ var bankHolidays = [
10281
10296
 
10282
10297
  // src/utils/DaysUtil.ts
10283
10298
  var isDayOff = (date) => {
10284
- const isSunday = date.getDay() === 0;
10285
- const isSaturday = date.getDay() === 6;
10286
- const isBankHoliday = bankHolidays.some((h) => h.toISOString() === date.toISOString());
10299
+ const isSunday = date.getUTCDay() === 0;
10300
+ const isSaturday = date.getUTCDay() === 6;
10301
+ const isBankHoliday = bankHolidays.some(
10302
+ (h) => h.getFullYear() === date.getUTCFullYear() && h.getMonth() === date.getUTCMonth() && h.getDate() === date.getUTCDate()
10303
+ );
10287
10304
  return isSunday || isSaturday || isBankHoliday;
10288
10305
  };
10289
10306
  var getTotalDaysBetween = (startDate, endDate, isHalfDay = false) => {
10290
- const start = new Date(startDate);
10291
- const end = new Date(endDate);
10307
+ let start = new Date(Date.UTC(startDate.getUTCFullYear(), startDate.getUTCMonth(), startDate.getUTCDate()));
10308
+ const end = new Date(Date.UTC(endDate.getUTCFullYear(), endDate.getUTCMonth(), endDate.getUTCDate()));
10292
10309
  let count2 = 0;
10293
10310
  if (isHalfDay && !isDayOff(start)) {
10294
10311
  return 0.5;
@@ -10297,7 +10314,7 @@ var getTotalDaysBetween = (startDate, endDate, isHalfDay = false) => {
10297
10314
  if (!isDayOff(start)) {
10298
10315
  count2++;
10299
10316
  }
10300
- start.setDate(start.getDate() + 1);
10317
+ start = new Date(start.getTime() + 24 * 60 * 60 * 1e3);
10301
10318
  }
10302
10319
  return count2;
10303
10320
  };
@@ -10305,7 +10322,7 @@ var getIsMultipleDays = (startDate, endDate) => {
10305
10322
  if (!startDate || !endDate) {
10306
10323
  return false;
10307
10324
  }
10308
- const isMultipleDays = startDate.toDateString() !== endDate.toDateString();
10325
+ const isMultipleDays = startDate.getUTCFullYear() !== endDate.getUTCFullYear() || startDate.getUTCMonth() !== endDate.getUTCMonth() || startDate.getUTCDate() !== endDate.getUTCDate();
10309
10326
  return isMultipleDays;
10310
10327
  };
10311
10328
 
@@ -10326,11 +10343,26 @@ var ButtonGroup = ({ options, value, onChange, disabled = [] }) => {
10326
10343
  )) });
10327
10344
  };
10328
10345
  function RequestLeave({ remainingDays, submitLeaveRequest }) {
10329
- const [startDate, setStartDate] = (0, import_react30.useState)(/* @__PURE__ */ new Date());
10330
- const [endDate, setEndDate] = (0, import_react30.useState)(/* @__PURE__ */ new Date());
10346
+ const setToMidnightUTC = (date) => {
10347
+ return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0));
10348
+ };
10349
+ const formatDateUTC = (date) => {
10350
+ const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
10351
+ const day = date.getUTCDate();
10352
+ const month = months[date.getUTCMonth()];
10353
+ const year = date.getUTCFullYear();
10354
+ const suffix = day === 1 || day === 21 || day === 31 ? "st" : day === 2 || day === 22 ? "nd" : day === 3 || day === 23 ? "rd" : "th";
10355
+ return `${month} ${day}${suffix}, ${year}`;
10356
+ };
10357
+ const [startDate, setStartDate] = (0, import_react30.useState)(void 0);
10358
+ const [endDate, setEndDate] = (0, import_react30.useState)(void 0);
10359
+ (0, import_react30.useEffect)(() => {
10360
+ if (startDate === void 0) setStartDate(setToMidnightUTC(/* @__PURE__ */ new Date()));
10361
+ if (endDate === void 0) setEndDate(setToMidnightUTC(/* @__PURE__ */ new Date()));
10362
+ }, []);
10331
10363
  const [leaveType, setLeaveType] = (0, import_react30.useState)("Full Day");
10332
10364
  const [isMultipleDays, setIsMultipleDays] = (0, import_react30.useState)(false);
10333
- const [totalDays, setTotalDays] = (0, import_react30.useState)(1);
10365
+ const [totalDays, setTotalDays] = (0, import_react30.useState)(0);
10334
10366
  const router = (0, import_navigation7.useRouter)();
10335
10367
  (0, import_react30.useEffect)(() => {
10336
10368
  const isMultipleDays2 = getIsMultipleDays(startDate, endDate);
@@ -10399,7 +10431,7 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
10399
10431
  ),
10400
10432
  children: [
10401
10433
  /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react20.CalendarIcon, { className: "mr-2 h-4 w-4" }),
10402
- startDate ? (0, import_date_fns.format)(startDate, "PPP") : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: "Pick a date" })
10434
+ startDate ? formatDateUTC(startDate) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: "Pick a date" })
10403
10435
  ]
10404
10436
  }
10405
10437
  ) }),
@@ -10409,9 +10441,12 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
10409
10441
  mode: "single",
10410
10442
  selected: startDate,
10411
10443
  onSelect: (date) => {
10412
- setStartDate(date);
10413
- if (date && (!endDate || date > endDate)) {
10414
- setEndDate(date);
10444
+ if (date) {
10445
+ const dateMidnight = setToMidnightUTC(date);
10446
+ setStartDate(dateMidnight);
10447
+ if (!endDate || date > endDate) {
10448
+ setEndDate(dateMidnight);
10449
+ }
10415
10450
  }
10416
10451
  },
10417
10452
  initialFocus: true
@@ -10432,7 +10467,7 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
10432
10467
  ),
10433
10468
  children: [
10434
10469
  /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react20.CalendarIcon, { className: "mr-2 h-4 w-4" }),
10435
- endDate ? (0, import_date_fns.format)(endDate, "PPP") : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: "Pick a date" })
10470
+ endDate ? formatDateUTC(endDate) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: "Pick a date" })
10436
10471
  ]
10437
10472
  }
10438
10473
  ) }),
@@ -10441,7 +10476,11 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
10441
10476
  {
10442
10477
  mode: "single",
10443
10478
  selected: endDate,
10444
- onSelect: setEndDate,
10479
+ onSelect: (date) => {
10480
+ if (date) {
10481
+ setEndDate(setToMidnightUTC(date));
10482
+ }
10483
+ },
10445
10484
  disabled: (date) => startDate ? date < startDate : false,
10446
10485
  initialFocus: true
10447
10486
  }
@@ -10660,38 +10699,42 @@ function HolidayGrid({
10660
10699
  var import_react31 = require("react");
10661
10700
  var import_lucide_react22 = require("lucide-react");
10662
10701
  var import_jsx_runtime112 = require("react/jsx-runtime");
10663
- function CalendarView({ currentDate, setCurrentDate, holidays }) {
10702
+ function CalendarView({ currentDate, setCurrentDate, holidays, today }) {
10664
10703
  const [selectedDay, setSelectedDay] = (0, import_react31.useState)(null);
10665
- const firstDayOfMonth = (new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).getDay() + 6) % 7;
10704
+ const isSameUtcDay = (a, b) => a.getUTCFullYear() === b.getUTCFullYear() && a.getUTCMonth() === b.getUTCMonth() && a.getUTCDate() === b.getUTCDate();
10705
+ const firstDayOfMonth = (new Date(Date.UTC(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), 1)).getUTCDay() + 6) % 7;
10666
10706
  const days = Array.from({ length: 42 }, (_, i) => {
10667
10707
  const day = new Date(
10668
- currentDate.getFullYear(),
10669
- currentDate.getMonth(),
10670
- i - firstDayOfMonth + 1,
10671
- currentDate.getHours()
10708
+ Date.UTC(
10709
+ currentDate.getUTCFullYear(),
10710
+ currentDate.getUTCMonth(),
10711
+ i - firstDayOfMonth + 1
10712
+ )
10672
10713
  );
10673
10714
  const filteredHolidays = holidays.filter(
10674
10715
  (h) => TimeUtil.toUtcMidnight(new Date(h.startDate)) <= day && TimeUtil.toUtcEndOfDay(new Date(h.endDate)) >= day
10675
10716
  );
10676
10717
  return {
10677
10718
  date: day,
10678
- isCurrentMonth: day.getMonth() === currentDate.getMonth(),
10679
- isToday: day.toDateString() === (/* @__PURE__ */ new Date()).toDateString(),
10719
+ isCurrentMonth: day.getUTCMonth() === currentDate.getUTCMonth(),
10720
+ isToday: isSameUtcDay(day, today),
10680
10721
  holidays: filteredHolidays
10681
10722
  };
10682
10723
  });
10683
10724
  const prevMonth = () => {
10684
- setCurrentDate(new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1));
10725
+ setCurrentDate(new Date(Date.UTC(currentDate.getUTCFullYear(), currentDate.getUTCMonth() - 1, 1)));
10685
10726
  };
10686
10727
  const nextMonth = () => {
10687
- setCurrentDate(new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1));
10728
+ setCurrentDate(new Date(Date.UTC(currentDate.getUTCFullYear(), currentDate.getUTCMonth() + 1, 1)));
10688
10729
  };
10689
10730
  const setToday = () => {
10690
- setCurrentDate(/* @__PURE__ */ new Date());
10731
+ setCurrentDate(TimeUtil.toUtcMidnight(/* @__PURE__ */ new Date()));
10691
10732
  };
10733
+ const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
10734
+ const monthYearDisplay = `${months[currentDate.getUTCMonth()]} ${currentDate.getUTCFullYear()}`;
10692
10735
  return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "lg:flex lg:h-full lg:flex-col", children: [
10693
10736
  /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("header", { className: "flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none", children: [
10694
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("h1", { className: "text-base font-semibold text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("time", { dateTime: currentDate.toISOString(), children: currentDate.toLocaleString("default", { month: "long", year: "numeric" }) }) }),
10737
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("h1", { className: "text-base font-semibold text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("time", { dateTime: currentDate.toISOString(), children: monthYearDisplay }) }),
10695
10738
  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "relative flex items-center rounded-md gap-1 md:items-stretch", children: [
10696
10739
  /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
10697
10740
  Button,
@@ -10778,7 +10821,7 @@ function CalendarView({ currentDate, setCurrentDate, holidays }) {
10778
10821
  "flex h-6 w-6 items-center justify-center rounded-full",
10779
10822
  day.isToday && "bg-indigo-600 font-semibold text-white"
10780
10823
  ),
10781
- children: day.date.getDate()
10824
+ children: day.date.getUTCDate()
10782
10825
  }
10783
10826
  ),
10784
10827
  day.holidays.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("ol", { className: "mt-2 space-y-1 overflow-visible", children: day.holidays.map((holiday) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("li", { className: "overflow-visible", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
@@ -10815,7 +10858,7 @@ function CalendarView({ currentDate, setCurrentDate, holidays }) {
10815
10858
  day.date === selectedDay && day.isToday && "flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",
10816
10859
  day.date === selectedDay && !day.isToday && "flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"
10817
10860
  ),
10818
- children: day.date.getDate()
10861
+ children: day.date.getUTCDate()
10819
10862
  }
10820
10863
  ),
10821
10864
  /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("span", { className: "sr-only", children: [
@@ -10843,7 +10886,7 @@ var import_react32 = require("react");
10843
10886
  var import_lucide_react23 = require("lucide-react");
10844
10887
  var import_lucide_react24 = require("lucide-react");
10845
10888
  var import_navigation8 = require("next/navigation");
10846
- var import_date_fns2 = require("date-fns");
10889
+ var import_date_fns = require("date-fns");
10847
10890
  var import_jsx_runtime113 = require("react/jsx-runtime");
10848
10891
  function classNames2(...classes) {
10849
10892
  return classes.filter(Boolean).join(" ");
@@ -10852,6 +10895,7 @@ function HolidayTracker({
10852
10895
  holidays,
10853
10896
  currentUser,
10854
10897
  currentDate,
10898
+ today,
10855
10899
  leaveApprovals,
10856
10900
  employees,
10857
10901
  submitLeaveRequest,
@@ -10861,9 +10905,10 @@ function HolidayTracker({
10861
10905
  const [currentTab, setCurrentTab] = (0, import_react32.useState)("Calendar View");
10862
10906
  const router = (0, import_navigation8.useRouter)();
10863
10907
  const isLoading = false;
10864
- const parsedCurrentDate = TimeUtil.toUtcMidnight((0, import_date_fns2.parseISO)(currentDate));
10908
+ const parsedCurrentDate = TimeUtil.toUtcMidnight((0, import_date_fns.parseISO)(currentDate));
10909
+ const parsedToday = TimeUtil.toUtcMidnight((0, import_date_fns.parseISO)(today));
10865
10910
  const setCurrentDate = async (date) => {
10866
- const formattedDate = (0, import_date_fns2.format)(date, "dd-MM-yyyy");
10911
+ const formattedDate = (0, import_date_fns.format)(date, "dd-MM-yyyy");
10867
10912
  const url = new URL(window.location.href);
10868
10913
  url.searchParams.set("date", formattedDate);
10869
10914
  router.push(url.toString());
@@ -10943,7 +10988,8 @@ function HolidayTracker({
10943
10988
  {
10944
10989
  currentDate: parsedCurrentDate,
10945
10990
  setCurrentDate,
10946
- holidays
10991
+ holidays,
10992
+ today: parsedToday
10947
10993
  }
10948
10994
  ),
10949
10995
  currentTab === "Request Leave" && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
@@ -11076,7 +11122,7 @@ function DealDetails({
11076
11122
  }
11077
11123
  };
11078
11124
  const getUserById = (userId) => {
11079
- return users?.find((user) => user.id === Number(userId));
11125
+ return users?.find((user) => user.id === userId);
11080
11126
  };
11081
11127
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Dialog, { open: true, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(DialogContent, { className: "max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden", children: [
11082
11128
  /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(DialogHeader, { className: "flex flex-row items-center justify-between", children: [
@@ -11661,7 +11707,7 @@ function NewDealForm({
11661
11707
  }
11662
11708
  };
11663
11709
  const getUserById = (userId) => {
11664
- return users?.find((user) => user.id === Number(userId));
11710
+ return users?.find((user) => user.id === userId);
11665
11711
  };
11666
11712
  const getCustomerById = (customerID) => {
11667
11713
  return customers?.find((customer) => customer.id === Number(customerID));
@@ -11862,7 +11908,7 @@ function CRMCogeBoard({
11862
11908
 
11863
11909
  // src/components/Chat/Components/ChatCardTask.tsx
11864
11910
  var import_lucide_react28 = require("lucide-react");
11865
- var import_date_fns3 = require("date-fns");
11911
+ var import_date_fns2 = require("date-fns");
11866
11912
 
11867
11913
  // src/components/Chat/hooks/useTask.ts
11868
11914
  var import_react38 = require("react");
@@ -11969,7 +12015,7 @@ function ChatCardTask({
11969
12015
  try {
11970
12016
  const date = new Date(taskData?.dateLogged || "");
11971
12017
  if (!isNaN(date.getTime())) {
11972
- formattedDate = (0, import_date_fns3.formatDistanceToNow)(date, { addSuffix: true });
12018
+ formattedDate = (0, import_date_fns2.formatDistanceToNow)(date, { addSuffix: true });
11973
12019
  }
11974
12020
  } catch (e) {
11975
12021
  }
@@ -12469,7 +12515,7 @@ function getAllCapabilities() {
12469
12515
 
12470
12516
  // src/components/Chat/Components/ChatCardArtefact.tsx
12471
12517
  var import_lucide_react29 = require("lucide-react");
12472
- var import_date_fns4 = require("date-fns");
12518
+ var import_date_fns3 = require("date-fns");
12473
12519
  var import_jsx_runtime122 = require("react/jsx-runtime");
12474
12520
  function ChatCardArtefact({
12475
12521
  artefact,
@@ -12490,7 +12536,7 @@ function ChatCardArtefact({
12490
12536
  try {
12491
12537
  const date = new Date(taskData.dateLogged);
12492
12538
  if (!isNaN(date.getTime())) {
12493
- formattedDate = (0, import_date_fns4.formatDistanceToNow)(date, { addSuffix: true });
12539
+ formattedDate = (0, import_date_fns3.formatDistanceToNow)(date, { addSuffix: true });
12494
12540
  }
12495
12541
  } catch (e) {
12496
12542
  }
@@ -20047,8 +20093,8 @@ function ToolbarPlugin() {
20047
20093
  blockNode = curr;
20048
20094
  }
20049
20095
  if (blockNode) {
20050
- const format4 = blockNode.getFormatType();
20051
- setAlignment(format4 || "left");
20096
+ const format3 = blockNode.getFormatType();
20097
+ setAlignment(format3 || "left");
20052
20098
  }
20053
20099
  const tag = anchorNode.getTopLevelElement()?.__tag;
20054
20100
  setBlockType(tag || "p");
@@ -20977,7 +21023,7 @@ var markdownToLexical = (markdown) => {
20977
21023
  var convertFileTypeToKnowledgeDocument = async (file) => {
20978
21024
  let content = "";
20979
21025
  let richTextContent = void 0;
20980
- let format4 = "text";
21026
+ let format3 = "text";
20981
21027
  if (file.url) {
20982
21028
  try {
20983
21029
  let url = file.url;
@@ -20998,18 +21044,18 @@ var convertFileTypeToKnowledgeDocument = async (file) => {
20998
21044
  console.warn("No URL provided for file:", file.name);
20999
21045
  }
21000
21046
  if (file.mimeType === "text/markdown") {
21001
- format4 = "richText";
21047
+ format3 = "richText";
21002
21048
  richTextContent = markdownToLexical(content);
21003
21049
  } else if (file.mimeType?.startsWith("text/")) {
21004
- format4 = "text";
21050
+ format3 = "text";
21005
21051
  }
21006
21052
  return {
21007
21053
  id: file.id.toString(),
21008
21054
  title: file.name,
21009
21055
  description: void 0,
21010
- content: format4 === "richText" ? void 0 : content,
21011
- richTextContent: format4 === "richText" ? richTextContent : void 0,
21012
- format: format4,
21056
+ content: format3 === "richText" ? void 0 : content,
21057
+ richTextContent: format3 === "richText" ? richTextContent : void 0,
21058
+ format: format3,
21013
21059
  metadata: {},
21014
21060
  createdAt: typeof file.createdAt === "string" ? new Date(file.createdAt) : file.createdAt,
21015
21061
  updatedAt: /* @__PURE__ */ new Date()
@@ -21059,8 +21105,8 @@ function FileEdit({ document: document2, onCancel, onSave, onFileUpdate }) {
21059
21105
  setRichTextContent(document2.richTextContent);
21060
21106
  }
21061
21107
  }, [document2]);
21062
- const formatIcon = (format4) => {
21063
- switch (format4) {
21108
+ const formatIcon = (format3) => {
21109
+ switch (format3) {
21064
21110
  case "markdown":
21065
21111
  case "mdx":
21066
21112
  return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_lucide_react68.FileText, { className: "h-6 w-6 text-primary" });
@@ -21072,8 +21118,8 @@ function FileEdit({ document: document2, onCancel, onSave, onFileUpdate }) {
21072
21118
  return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_lucide_react68.File, { className: "h-6 w-6 text-muted-foreground" });
21073
21119
  }
21074
21120
  };
21075
- const formatBadgeColor = (format4) => {
21076
- switch (format4) {
21121
+ const formatBadgeColor = (format3) => {
21122
+ switch (format3) {
21077
21123
  case "markdown":
21078
21124
  return "bg-primary/10 text-primary border-primary/20";
21079
21125
  case "mdx":
@@ -23317,8 +23363,8 @@ function DocumentEdit({
23317
23363
  (0, import_react94.useEffect)(() => {
23318
23364
  setEditedDocument(document2);
23319
23365
  }, [document2]);
23320
- const formatIcon = (format4) => {
23321
- switch (format4) {
23366
+ const formatIcon = (format3) => {
23367
+ switch (format3) {
23322
23368
  case "markdown":
23323
23369
  case "mdx":
23324
23370
  return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_lucide_react76.FileText, { className: "h-6 w-6 text-primary" });
@@ -23330,8 +23376,8 @@ function DocumentEdit({
23330
23376
  return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_lucide_react76.File, { className: "h-6 w-6 text-muted-foreground" });
23331
23377
  }
23332
23378
  };
23333
- const formatBadgeColor = (format4) => {
23334
- switch (format4) {
23379
+ const formatBadgeColor = (format3) => {
23380
+ switch (format3) {
23335
23381
  case "markdown":
23336
23382
  return "bg-primary/10 text-primary border-primary/20";
23337
23383
  case "mdx":
@@ -23655,8 +23701,8 @@ function DocumentPreview({
23655
23701
  (0, import_react96.useEffect)(() => {
23656
23702
  setDocument(initialDocument);
23657
23703
  }, [initialDocument]);
23658
- const formatIcon = (format4) => {
23659
- switch (format4) {
23704
+ const formatIcon = (format3) => {
23705
+ switch (format3) {
23660
23706
  case "markdown":
23661
23707
  case "mdx":
23662
23708
  return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_lucide_react77.FileText, { className: "h-6 w-6 text-primary" });
@@ -23668,8 +23714,8 @@ function DocumentPreview({
23668
23714
  return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_lucide_react77.File, { className: "h-6 w-6 text-muted-foreground" });
23669
23715
  }
23670
23716
  };
23671
- const formatBadgeColor = (format4) => {
23672
- switch (format4) {
23717
+ const formatBadgeColor = (format3) => {
23718
+ switch (format3) {
23673
23719
  case "markdown":
23674
23720
  return "bg-primary/10 text-primary border-primary/20";
23675
23721
  case "mdx":
@@ -23682,15 +23728,15 @@ function DocumentPreview({
23682
23728
  return "bg-muted text-muted-foreground border-border";
23683
23729
  }
23684
23730
  };
23685
- const renderContent = (content, format4) => {
23731
+ const renderContent = (content, format3) => {
23686
23732
  const defaultRenderers = {
23687
23733
  markdown: defaultMarkdownRenderer,
23688
23734
  mdx: defaultMDXRenderer,
23689
23735
  // richText: defaultRichTextRenderer,
23690
23736
  text: defaultTextRenderer
23691
23737
  };
23692
- const renderer = renderers?.[format4] || defaultRenderers[format4];
23693
- if (format4 === "richText" && typeof content === "object") {
23738
+ const renderer = renderers?.[format3] || defaultRenderers[format3];
23739
+ if (format3 === "richText" && typeof content === "object") {
23694
23740
  return defaultRichTextRenderer(content);
23695
23741
  }
23696
23742
  if (renderer) {
@@ -23857,8 +23903,8 @@ function MenuItem({
23857
23903
  const [isExpanded, setIsExpanded] = (0, import_react98.useState)(level === 0);
23858
23904
  const hasChildren = children && Object.keys(children).length > 0;
23859
23905
  const totalDocuments = documents.length + (children ? Object.values(children).reduce((acc, child) => acc + child.documents.length, 0) : 0);
23860
- const formatDocumentIcon = (format4) => {
23861
- switch (format4) {
23906
+ const formatDocumentIcon = (format3) => {
23907
+ switch (format3) {
23862
23908
  case "markdown":
23863
23909
  case "mdx":
23864
23910
  return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_lucide_react78.FileText, { className: "h-3.5 w-3.5 text-muted-foreground" });
@@ -27325,7 +27371,7 @@ var import_lucide_react91 = require("lucide-react");
27325
27371
  // src/components/Projects/AddSprintModal.tsx
27326
27372
  var import_react114 = require("react");
27327
27373
  var import_lucide_react90 = require("lucide-react");
27328
- var import_date_fns5 = require("date-fns");
27374
+ var import_date_fns4 = require("date-fns");
27329
27375
  var import_jsx_runtime212 = require("react/jsx-runtime");
27330
27376
  var AddSprintModal = ({ isOpen, onClose, onAddSprint }) => {
27331
27377
  const [formData, setFormData] = (0, import_react114.useState)({
@@ -27412,7 +27458,7 @@ var AddSprintModal = ({ isOpen, onClose, onAddSprint }) => {
27412
27458
  ),
27413
27459
  children: [
27414
27460
  /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(import_lucide_react90.CalendarIcon, { className: "mr-2 h-4 w-4" }),
27415
- formData.startDate ? (0, import_date_fns5.format)(formData.startDate, "PPP") : "Pick a date"
27461
+ formData.startDate ? (0, import_date_fns4.format)(formData.startDate, "PPP") : "Pick a date"
27416
27462
  ]
27417
27463
  }
27418
27464
  ) }),
@@ -27440,7 +27486,7 @@ var AddSprintModal = ({ isOpen, onClose, onAddSprint }) => {
27440
27486
  ),
27441
27487
  children: [
27442
27488
  /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(import_lucide_react90.CalendarIcon, { className: "mr-2 h-4 w-4" }),
27443
- formData.endDate ? (0, import_date_fns5.format)(formData.endDate, "PPP") : "Pick a date"
27489
+ formData.endDate ? (0, import_date_fns4.format)(formData.endDate, "PPP") : "Pick a date"
27444
27490
  ]
27445
27491
  }
27446
27492
  ) }),