@flamingo-stack/openframe-frontend-core 0.0.642 → 0.0.643-snapshot.20260916153353

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 (201) hide show
  1. package/dist/chat-protocol/index.cjs +6 -3
  2. package/dist/chat-protocol/index.cjs.map +1 -1
  3. package/dist/chat-protocol/index.js +6 -3
  4. package/dist/chat-protocol/index.js.map +1 -1
  5. package/dist/chat-protocol/source-metadata.d.ts +16 -1
  6. package/dist/chat-protocol/source-metadata.d.ts.map +1 -1
  7. package/dist/{chunk-YM6L3WM5.js → chunk-27RD5XTP.js} +3 -3
  8. package/dist/{chunk-POPL3W2S.js → chunk-3DGRXC74.js} +3 -3
  9. package/dist/{chunk-2Z5FPHOL.cjs → chunk-3UBT2OIX.cjs} +20 -20
  10. package/dist/{chunk-2Z5FPHOL.cjs.map → chunk-3UBT2OIX.cjs.map} +1 -1
  11. package/dist/{chunk-6GY6DFIH.js → chunk-4WVWRFGP.js} +6 -6
  12. package/dist/{chunk-OYI3K5R6.cjs → chunk-65EVGKFV.cjs} +8 -14
  13. package/dist/chunk-65EVGKFV.cjs.map +1 -0
  14. package/dist/{chunk-6NHLZORM.js → chunk-7Q5XXPCB.js} +6 -6
  15. package/dist/{chunk-2NRLRRMR.cjs → chunk-7R2DIGG4.cjs} +319 -293
  16. package/dist/chunk-7R2DIGG4.cjs.map +1 -0
  17. package/dist/{chunk-3LXJEXPH.js → chunk-B3Z3RJRW.js} +2 -2
  18. package/dist/{chunk-N5C5P2LM.cjs → chunk-B5IFXCRF.cjs} +22 -22
  19. package/dist/{chunk-N5C5P2LM.cjs.map → chunk-B5IFXCRF.cjs.map} +1 -1
  20. package/dist/{chunk-YRSRP4U3.cjs → chunk-C5Y5T6GC.cjs} +15 -15
  21. package/dist/{chunk-YRSRP4U3.cjs.map → chunk-C5Y5T6GC.cjs.map} +1 -1
  22. package/dist/{chunk-VHB3I6F3.cjs → chunk-CBXZSTAG.cjs} +419 -445
  23. package/dist/chunk-CBXZSTAG.cjs.map +1 -0
  24. package/dist/{chunk-VKPTN5MT.cjs → chunk-DCCY54LU.cjs} +6 -6
  25. package/dist/{chunk-VKPTN5MT.cjs.map → chunk-DCCY54LU.cjs.map} +1 -1
  26. package/dist/{chunk-WL3PNUNY.cjs → chunk-FAD5WURS.cjs} +81 -81
  27. package/dist/{chunk-WL3PNUNY.cjs.map → chunk-FAD5WURS.cjs.map} +1 -1
  28. package/dist/{chunk-3IPL6G7S.js → chunk-FOSIR4QF.js} +260 -234
  29. package/dist/chunk-FOSIR4QF.js.map +1 -0
  30. package/dist/{chunk-MJ424FEC.js → chunk-HOGOQA2X.js} +2 -2
  31. package/dist/{chunk-SDGMLXIP.js → chunk-HPWLIYRL.js} +12 -25
  32. package/dist/chunk-HPWLIYRL.js.map +1 -0
  33. package/dist/{chunk-3I6XHQUD.js → chunk-I57XLISO.js} +54 -80
  34. package/dist/chunk-I57XLISO.js.map +1 -0
  35. package/dist/{chunk-FRCUUK5X.cjs → chunk-IIXB5REN.cjs} +3 -3
  36. package/dist/{chunk-FRCUUK5X.cjs.map → chunk-IIXB5REN.cjs.map} +1 -1
  37. package/dist/{chunk-HW7BLVQH.js → chunk-IXD6SHQ6.js} +4 -4
  38. package/dist/{chunk-XFLJC2WR.cjs → chunk-LZYPSDFE.cjs} +59 -59
  39. package/dist/{chunk-XFLJC2WR.cjs.map → chunk-LZYPSDFE.cjs.map} +1 -1
  40. package/dist/{chunk-QY25ZP2V.cjs → chunk-MCQAOIUK.cjs} +28 -28
  41. package/dist/{chunk-QY25ZP2V.cjs.map → chunk-MCQAOIUK.cjs.map} +1 -1
  42. package/dist/{chunk-S254VEDE.js → chunk-MRIOYSXH.js} +3 -3
  43. package/dist/{chunk-OOOOC5O5.cjs → chunk-OMSUWB6A.cjs} +29 -29
  44. package/dist/{chunk-OOOOC5O5.cjs.map → chunk-OMSUWB6A.cjs.map} +1 -1
  45. package/dist/{chunk-GEIHTN6J.cjs → chunk-OVXYX47B.cjs} +10 -10
  46. package/dist/{chunk-GEIHTN6J.cjs.map → chunk-OVXYX47B.cjs.map} +1 -1
  47. package/dist/{chunk-XWGHLSAL.js → chunk-PFV4DAX5.js} +4 -4
  48. package/dist/{chunk-O4LL7RQV.cjs → chunk-RB6L5EGM.cjs} +208 -221
  49. package/dist/chunk-RB6L5EGM.cjs.map +1 -0
  50. package/dist/{chunk-M4PJVFBF.cjs → chunk-RFFF2EYD.cjs} +11 -11
  51. package/dist/{chunk-M4PJVFBF.cjs.map → chunk-RFFF2EYD.cjs.map} +1 -1
  52. package/dist/{chunk-UFBWNVZZ.js → chunk-RNMGKAS6.js} +7 -7
  53. package/dist/{chunk-SE6YRE3R.cjs → chunk-RWURXICE.cjs} +32 -32
  54. package/dist/{chunk-SE6YRE3R.cjs.map → chunk-RWURXICE.cjs.map} +1 -1
  55. package/dist/{chunk-ZAIYD3MZ.js → chunk-S2KMNFFN.js} +3 -3
  56. package/dist/{chunk-ZGPJ3NVF.js → chunk-SKABQX44.js} +3 -3
  57. package/dist/{chunk-YE3TFNW6.cjs → chunk-TGUA3C4U.cjs} +5 -5
  58. package/dist/{chunk-YE3TFNW6.cjs.map → chunk-TGUA3C4U.cjs.map} +1 -1
  59. package/dist/{chunk-ORFJVMAL.js → chunk-TTVOBWAH.js} +5 -11
  60. package/dist/chunk-TTVOBWAH.js.map +1 -0
  61. package/dist/{chunk-M7QROULE.js → chunk-UEXIMEVU.js} +5 -5
  62. package/dist/{chunk-EW3MSJOE.cjs → chunk-UKV52KAP.cjs} +33 -33
  63. package/dist/{chunk-EW3MSJOE.cjs.map → chunk-UKV52KAP.cjs.map} +1 -1
  64. package/dist/{chunk-J4RZVLLQ.js → chunk-VE52MSYC.js} +5 -5
  65. package/dist/components/case-studies/index.cjs +16 -16
  66. package/dist/components/case-studies/index.js +4 -4
  67. package/dist/components/chat/chat-sidebar.d.ts.map +1 -1
  68. package/dist/components/chat/entity-cards/blog-card.d.ts.map +1 -1
  69. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  70. package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
  71. package/dist/components/chat/index.cjs +3 -9
  72. package/dist/components/chat/index.cjs.map +1 -1
  73. package/dist/components/chat/index.js +2 -8
  74. package/dist/components/chat/types/entities/investor-update.d.ts.map +1 -1
  75. package/dist/components/chat/types/entities/program-types.d.ts +8 -18
  76. package/dist/components/chat/types/entities/program-types.d.ts.map +1 -1
  77. package/dist/components/chat/utils/compact-card-classes.d.ts.map +1 -1
  78. package/dist/components/contact/index.cjs +5 -5
  79. package/dist/components/contact/index.js +4 -4
  80. package/dist/components/docs/index.cjs +8 -8
  81. package/dist/components/docs/index.js +7 -7
  82. package/dist/components/embeds/index.cjs +5 -5
  83. package/dist/components/embeds/index.js +4 -4
  84. package/dist/components/faq/index.cjs +5 -5
  85. package/dist/components/faq/index.js +4 -4
  86. package/dist/components/features/index.cjs +4 -4
  87. package/dist/components/features/index.js +3 -3
  88. package/dist/components/help-center-pages/index.cjs +24 -24
  89. package/dist/components/help-center-pages/index.js +15 -15
  90. package/dist/components/index.cjs +53 -59
  91. package/dist/components/index.cjs.map +1 -1
  92. package/dist/components/index.js +15 -21
  93. package/dist/components/index.js.map +1 -1
  94. package/dist/components/logs-list.d.ts.map +1 -1
  95. package/dist/components/meeting-scheduler/confirmation.d.ts.map +1 -1
  96. package/dist/components/meeting-scheduler/directory.d.ts.map +1 -1
  97. package/dist/components/meeting-scheduler/index.cjs +47 -72
  98. package/dist/components/meeting-scheduler/index.cjs.map +1 -1
  99. package/dist/components/meeting-scheduler/index.d.ts.map +1 -1
  100. package/dist/components/meeting-scheduler/index.js +16 -41
  101. package/dist/components/meeting-scheduler/index.js.map +1 -1
  102. package/dist/components/meeting-scheduler/slot-picker.d.ts.map +1 -1
  103. package/dist/components/navigation/index.cjs +7 -7
  104. package/dist/components/navigation/index.js +6 -6
  105. package/dist/components/onboarding-guides/index.cjs +7 -7
  106. package/dist/components/onboarding-guides/index.js +6 -6
  107. package/dist/components/related-content/index.cjs +3 -3
  108. package/dist/components/related-content/index.js +2 -2
  109. package/dist/components/shared/article-author-byline.d.ts.map +1 -1
  110. package/dist/components/tickets/index.cjs +8 -8
  111. package/dist/components/tickets/index.js +7 -7
  112. package/dist/components/ui/date-picker.d.ts.map +1 -1
  113. package/dist/components/ui/device-card.d.ts.map +1 -1
  114. package/dist/components/ui/drawer.d.ts +19 -5
  115. package/dist/components/ui/drawer.d.ts.map +1 -1
  116. package/dist/components/ui/index.cjs +4 -10
  117. package/dist/components/ui/index.cjs.map +1 -1
  118. package/dist/components/ui/index.js +3 -9
  119. package/dist/components/ui/table/table-timestamp-cell.d.ts.map +1 -1
  120. package/dist/index.cjs +29 -17
  121. package/dist/index.cjs.map +1 -1
  122. package/dist/index.js +35 -23
  123. package/dist/index.js.map +1 -1
  124. package/dist/utils/date-formatters.d.ts +7 -2
  125. package/dist/utils/date-formatters.d.ts.map +1 -1
  126. package/dist/utils/date-utils.d.ts +4 -1
  127. package/dist/utils/date-utils.d.ts.map +1 -1
  128. package/dist/utils/format-date.d.ts.map +1 -1
  129. package/dist/utils/format.d.ts +155 -11
  130. package/dist/utils/format.d.ts.map +1 -1
  131. package/dist/utils/index.cjs +223 -109
  132. package/dist/utils/index.cjs.map +1 -1
  133. package/dist/utils/index.d.ts +4 -1
  134. package/dist/utils/index.d.ts.map +1 -1
  135. package/dist/utils/index.js +211 -110
  136. package/dist/utils/index.js.map +1 -1
  137. package/dist/utils/program-instant.d.ts +145 -0
  138. package/dist/utils/program-instant.d.ts.map +1 -0
  139. package/dist/utils/program-meta-renderers.d.ts +3 -0
  140. package/dist/utils/program-meta-renderers.d.ts.map +1 -0
  141. package/dist/utils/url-safety.d.ts +33 -0
  142. package/dist/utils/url-safety.d.ts.map +1 -0
  143. package/package.json +1 -1
  144. package/src/chat-protocol/__tests__/source-metadata.test.ts +70 -3
  145. package/src/chat-protocol/source-metadata.ts +22 -6
  146. package/src/components/chat/chat-sidebar.tsx +4 -11
  147. package/src/components/chat/entity-cards/.program-card.md +1 -1
  148. package/src/components/chat/entity-cards/blog-card.tsx +4 -24
  149. package/src/components/chat/entity-cards/dispatch.tsx +9 -27
  150. package/src/components/chat/entity-cards/program-card.tsx +42 -81
  151. package/src/components/chat/types/entities/investor-update.ts +4 -6
  152. package/src/components/chat/types/entities/program-types.ts +8 -89
  153. package/src/components/chat/utils/.compact-card-classes.md +1 -1
  154. package/src/components/chat/utils/compact-card-classes.ts +5 -3
  155. package/src/components/logs-list.tsx +4 -13
  156. package/src/components/meeting-scheduler/confirmation.tsx +6 -10
  157. package/src/components/meeting-scheduler/directory.tsx +2 -12
  158. package/src/components/meeting-scheduler/index.tsx +3 -11
  159. package/src/components/meeting-scheduler/slot-picker.tsx +4 -7
  160. package/src/components/shared/article-author-byline.tsx +4 -13
  161. package/src/components/ui/.drawer.md +1 -0
  162. package/src/components/ui/__tests__/drawer-size.test.tsx +38 -0
  163. package/src/components/ui/date-picker.tsx +6 -13
  164. package/src/components/ui/device-card.tsx +4 -10
  165. package/src/components/ui/drawer.tsx +44 -9
  166. package/src/components/ui/table/table-timestamp-cell.tsx +8 -2
  167. package/src/utils/.format.md +5 -2
  168. package/src/utils/__tests__/date-rendering.test.ts +118 -0
  169. package/src/utils/__tests__/format-program-dates.test.ts +148 -0
  170. package/src/utils/__tests__/program-instant.test.ts +125 -0
  171. package/src/utils/__tests__/url-safety.test.ts +44 -0
  172. package/src/utils/date-formatters.ts +18 -29
  173. package/src/utils/date-utils.ts +27 -40
  174. package/src/utils/format-date.ts +14 -16
  175. package/src/utils/format.ts +367 -66
  176. package/src/utils/index.ts +24 -0
  177. package/src/utils/program-instant.ts +180 -0
  178. package/src/utils/program-meta-renderers.ts +18 -0
  179. package/src/utils/url-safety.ts +43 -0
  180. package/dist/chunk-2NRLRRMR.cjs.map +0 -1
  181. package/dist/chunk-3I6XHQUD.js.map +0 -1
  182. package/dist/chunk-3IPL6G7S.js.map +0 -1
  183. package/dist/chunk-O4LL7RQV.cjs.map +0 -1
  184. package/dist/chunk-ORFJVMAL.js.map +0 -1
  185. package/dist/chunk-OYI3K5R6.cjs.map +0 -1
  186. package/dist/chunk-SDGMLXIP.js.map +0 -1
  187. package/dist/chunk-VHB3I6F3.cjs.map +0 -1
  188. /package/dist/{chunk-YM6L3WM5.js.map → chunk-27RD5XTP.js.map} +0 -0
  189. /package/dist/{chunk-POPL3W2S.js.map → chunk-3DGRXC74.js.map} +0 -0
  190. /package/dist/{chunk-6GY6DFIH.js.map → chunk-4WVWRFGP.js.map} +0 -0
  191. /package/dist/{chunk-6NHLZORM.js.map → chunk-7Q5XXPCB.js.map} +0 -0
  192. /package/dist/{chunk-3LXJEXPH.js.map → chunk-B3Z3RJRW.js.map} +0 -0
  193. /package/dist/{chunk-MJ424FEC.js.map → chunk-HOGOQA2X.js.map} +0 -0
  194. /package/dist/{chunk-HW7BLVQH.js.map → chunk-IXD6SHQ6.js.map} +0 -0
  195. /package/dist/{chunk-S254VEDE.js.map → chunk-MRIOYSXH.js.map} +0 -0
  196. /package/dist/{chunk-XWGHLSAL.js.map → chunk-PFV4DAX5.js.map} +0 -0
  197. /package/dist/{chunk-UFBWNVZZ.js.map → chunk-RNMGKAS6.js.map} +0 -0
  198. /package/dist/{chunk-ZAIYD3MZ.js.map → chunk-S2KMNFFN.js.map} +0 -0
  199. /package/dist/{chunk-ZGPJ3NVF.js.map → chunk-SKABQX44.js.map} +0 -0
  200. /package/dist/{chunk-M7QROULE.js.map → chunk-UEXIMEVU.js.map} +0 -0
  201. /package/dist/{chunk-J4RZVLLQ.js.map → chunk-VE52MSYC.js.map} +0 -0
@@ -181,7 +181,7 @@ function formatDate(date, options = {
181
181
  console.warn("Invalid date provided to formatDate:", date);
182
182
  return "Invalid Date";
183
183
  }
184
- return dateObj.toLocaleDateString("en-US", { timeZone: "UTC", ...options });
184
+ return formatDateWithTimezone(dateObj, options.timeZone ?? null, options);
185
185
  }
186
186
  function formatNumber(num) {
187
187
  return num.toLocaleString();
@@ -282,27 +282,130 @@ function formatDurationCompact(seconds) {
282
282
  }
283
283
  return `${minutes} min`;
284
284
  }
285
- function formatTimeWithTimezone(date, timezone) {
286
- if (!date) return "";
287
- const dateObj = typeof date === "string" ? new Date(date) : date;
288
- const opts = {
285
+ var VIEWER_TIMEZONE = "viewer";
286
+ var ZONED_DATE_STYLES = {
287
+ /** Mar 19, 2026 */
288
+ medium: { year: "numeric", month: "short", day: "numeric" },
289
+ /** Thursday, March 19 */
290
+ weekday: { weekday: "long", day: "numeric", month: "long" },
291
+ /** March 19, 2026 */
292
+ long: { year: "numeric", month: "long", day: "numeric" },
293
+ /** 03/19/2026 */
294
+ numeric: { year: "numeric", month: "2-digit", day: "2-digit" },
295
+ /** March 2026 */
296
+ monthYear: { year: "numeric", month: "long" },
297
+ /** Mar 2026 */
298
+ monthYearShort: { year: "numeric", month: "short" },
299
+ /** 03/19/2026, 9:18 PM */
300
+ numericDateTime: {
301
+ year: "numeric",
302
+ month: "2-digit",
303
+ day: "2-digit",
289
304
  hour: "numeric",
290
305
  minute: "2-digit",
291
- hour12: true,
292
- timeZone: timezone || "UTC"
293
- };
306
+ hour12: true
307
+ },
308
+ /** Mar 19, 2026, 9:18 PM */
309
+ mediumDateTime: { year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "2-digit" },
310
+ /** Thursday, March 19 at 9:18 PM EDT */
311
+ weekdayDateTimeZoned: {
312
+ weekday: "long",
313
+ month: "long",
314
+ day: "numeric",
315
+ hour: "numeric",
316
+ minute: "2-digit",
317
+ timeZoneName: "short"
318
+ },
319
+ /** Thu, Mar 19, 9:18 PM */
320
+ shortWeekdayDateTime: { weekday: "short", month: "short", day: "numeric", hour: "numeric", minute: "2-digit" },
321
+ /** 03/19/2026, 21:18 */
322
+ numericDateTime24h: {
323
+ year: "numeric",
324
+ month: "2-digit",
325
+ day: "2-digit",
326
+ hour: "2-digit",
327
+ minute: "2-digit",
328
+ hour12: false
329
+ },
330
+ /** 3/19/2026, 9:18:00 PM — the runtime's own default date-time shape */
331
+ localeDateTime: {
332
+ year: "numeric",
333
+ month: "numeric",
334
+ day: "numeric",
335
+ hour: "numeric",
336
+ minute: "2-digit",
337
+ second: "2-digit"
338
+ }
339
+ };
340
+ var FORMATTERS = /* @__PURE__ */ new Map();
341
+ function zonedFormatter(locale, fields, timeZone) {
342
+ const key = JSON.stringify([locale ?? null, timeZone ?? null, fields]);
343
+ let fmt = FORMATTERS.get(key);
344
+ if (!fmt) {
345
+ fmt = new Intl.DateTimeFormat(locale, { ...fields, timeZone });
346
+ FORMATTERS.set(key, fmt);
347
+ }
348
+ return fmt;
349
+ }
350
+ function formatterFor(timezone, fields, locale) {
351
+ const zone = timezone === VIEWER_TIMEZONE ? void 0 : timezone || "UTC";
294
352
  try {
295
- return dateObj.toLocaleTimeString("en-US", opts);
353
+ return zonedFormatter(locale, fields, zone);
296
354
  } catch {
297
- return dateObj.toLocaleTimeString("en-US", { ...opts, timeZone: "UTC" });
298
- }
355
+ return zonedFormatter(locale, fields, "UTC");
356
+ }
357
+ }
358
+ function toValidDate(date) {
359
+ if (date === null || date === void 0 || date === "") return null;
360
+ const d = date instanceof Date ? date : new Date(date);
361
+ return Number.isNaN(d.getTime()) ? null : d;
362
+ }
363
+ function formatDateWithTimezone(date, timezone, style = "medium", options) {
364
+ const dateObj = toValidDate(date);
365
+ if (!dateObj) return "";
366
+ const { timeZone: _ignored, ...fields } = typeof style === "string" ? ZONED_DATE_STYLES[style] : style;
367
+ return formatterFor(timezone, fields, options?.viewerLocale ? void 0 : "en-US").format(dateObj);
368
+ }
369
+ function formatDateTimeYmd(date, timezone, options) {
370
+ const dateObj = toValidDate(date);
371
+ if (!dateObj) return "";
372
+ const parts = formatterFor(
373
+ timezone,
374
+ { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", hourCycle: "h23" },
375
+ "en-US"
376
+ ).formatToParts(dateObj);
377
+ const part = (type) => parts.find((p) => p.type === type)?.value ?? "";
378
+ return `${part("year")}/${part("month")}/${part("day")}${options?.separator ?? ", "}${part("hour")}:${part("minute")}`;
379
+ }
380
+ function formatTimeWithTimezone(date, timezone, options) {
381
+ return formatDateWithTimezone(
382
+ date,
383
+ timezone,
384
+ {
385
+ hour: "numeric",
386
+ minute: "2-digit",
387
+ // A viewer-locale clock uses the locale's own 12/24h convention.
388
+ ...options?.viewerLocale ? {} : { hour12: true },
389
+ ...options?.withZoneLabel ? { timeZoneName: "short" } : {}
390
+ },
391
+ { viewerLocale: options?.viewerLocale }
392
+ );
393
+ }
394
+ function formatProgramDate(at, style = "medium") {
395
+ return formatDateWithTimezone(at.instant ?? at.utcDate, at.timezone, style);
396
+ }
397
+ function isOrderedRange(from, to) {
398
+ if (!from || !to) return false;
399
+ const a = (typeof from === "string" ? new Date(from) : from).getTime();
400
+ const b = (typeof to === "string" ? new Date(to) : to).getTime();
401
+ return Number.isFinite(a) && Number.isFinite(b) && b > a;
299
402
  }
300
403
  function formatDurationFromRange(startAt, endAt) {
301
- if (!startAt || !endAt) return "";
404
+ if (!isOrderedRange(startAt, endAt)) return "";
302
405
  const start = typeof startAt === "string" ? new Date(startAt) : startAt;
303
406
  const end = typeof endAt === "string" ? new Date(endAt) : endAt;
304
- const durationMs = end.getTime() - start.getTime();
305
- const minutes = Math.round(durationMs / 6e4);
407
+ const minutes = Math.round((end.getTime() - start.getTime()) / 6e4);
408
+ if (minutes <= 0) return "";
306
409
  if (minutes >= 60) {
307
410
  const hours = Math.floor(minutes / 60);
308
411
  const mins = minutes % 60;
@@ -325,23 +428,14 @@ function formatDateUTC(value, options = {}) {
325
428
  }
326
429
  }
327
430
  if (!Number.isFinite(ms)) return fallback;
328
- return new Date(ms).toLocaleDateString("en-US", {
329
- year: "numeric",
330
- month: "short",
331
- day: "numeric",
332
- timeZone: timezone === "local" ? void 0 : "UTC"
333
- });
431
+ return formatDateWithTimezone(ms, timezone === "local" ? VIEWER_TIMEZONE : null, "medium");
334
432
  }
335
433
  function formatEntryMonthUTC(entryMonth, style = "short") {
336
434
  if (!entryMonth) return null;
337
- return new Date(entryMonth).toLocaleDateString("en-US", { month: style, year: "numeric", timeZone: "UTC" });
435
+ return formatDateWithTimezone(entryMonth, null, style === "long" ? "monthYear" : "monthYearShort");
338
436
  }
339
437
  function formatLegalDate(dateInput) {
340
- return new Intl.DateTimeFormat("en-US", {
341
- year: "numeric",
342
- month: "2-digit",
343
- day: "2-digit"
344
- }).format(new Date(dateInput));
438
+ return formatDateWithTimezone(dateInput, null, "numeric");
345
439
  }
346
440
  function formatCurrency(value) {
347
441
  if (value == null) return "N/A";
@@ -415,31 +509,13 @@ function getTrendColors(direction, polarity = "positive") {
415
509
  }
416
510
  function formatDateRange(start, end) {
417
511
  if (!start || !end) return "";
418
- const fmt = (s) => {
419
- const bareMatch = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s);
420
- const d = bareMatch ? new Date(Number(bareMatch[1]), Number(bareMatch[2]) - 1, Number(bareMatch[3])) : new Date(s);
421
- if (Number.isNaN(d.getTime())) return s;
422
- return d.toLocaleDateString(void 0, {
423
- month: "short",
424
- day: "numeric",
425
- year: "numeric"
426
- });
427
- };
512
+ const fmt = (s) => formatDateWithTimezone(s, /^\d{4}-\d{2}-\d{2}$/.test(s) ? null : VIEWER_TIMEZONE, "medium") || s;
428
513
  return `${fmt(start)} \u2014 ${fmt(end)}`;
429
514
  }
430
515
  function formatDateTimeAt(dateString) {
431
- const date = new Date(dateString);
432
- const dateStr = date.toLocaleDateString("en-US", {
433
- month: "short",
434
- day: "numeric",
435
- year: "numeric"
436
- });
437
- const timeStr = date.toLocaleTimeString("en-US", {
438
- hour: "numeric",
439
- minute: "2-digit",
440
- hour12: true
441
- });
442
- return `${dateStr} at ${timeStr}`;
516
+ const dateStr = formatDateWithTimezone(dateString, VIEWER_TIMEZONE, "medium");
517
+ const timeStr = formatTimeWithTimezone(dateString, VIEWER_TIMEZONE);
518
+ return dateStr && timeStr ? `${dateStr} at ${timeStr}` : "";
443
519
  }
444
520
  function formatDurationFromMs(ms) {
445
521
  if (!ms || isNaN(ms) || ms < 0) return "0ms";
@@ -491,6 +567,21 @@ function formatBioText(aboutHtml, fallback = "") {
491
567
  }
492
568
  return stripHtml(aboutHtml).trim() || fallback;
493
569
  }
570
+ function formatProgramTimeRange(at, opts = {}) {
571
+ const source = at.instant ?? at.utcDate ?? opts.startAt;
572
+ const label = opts.withZoneLabel === true;
573
+ const bare = formatTimeWithTimezone(source, at.timezone);
574
+ const labelled = label ? formatTimeWithTimezone(source, at.timezone, { withZoneLabel: true }) : bare;
575
+ const ordered = isOrderedRange(source, opts.endAt);
576
+ const end = ordered && opts.endAt ? formatTimeWithTimezone(opts.endAt, at.timezone, { withZoneLabel: label }) : "";
577
+ if (!bare) return "";
578
+ return end ? `${bare} - ${end}` : labelled;
579
+ }
580
+ function formatWebinarTimeMeta(at, opts) {
581
+ const duration = formatDurationFromRange(opts.startAt, opts.endAt);
582
+ const time = formatProgramTimeRange(at, { startAt: opts.startAt, withZoneLabel: opts.withZoneLabel });
583
+ return [time, duration].filter(Boolean).join(" \xB7 ");
584
+ }
494
585
  var PLAY_ICON_PATH = "M4.875 5.006c0-2.501 2.793-3.989 4.87-2.592l9.78 6.578c2.135 1.437 2.135 4.58 0 6.016l-9.78 6.579c-2.077 1.396-4.87-.091-4.87-2.593zm2.25 13.988c0 .7.783 1.118 1.364.727l9.78-6.58c.81-.545.81-1.738 0-2.283L8.488 4.28a.875.875 0 0 0-1.364.726v13.988Z";
495
586
 
496
587
  // src/utils/color-analysis.ts
@@ -1959,21 +2050,11 @@ function getConfidenceLabel(confidence) {
1959
2050
  }
1960
2051
 
1961
2052
  // src/utils/date-formatters.ts
1962
- var MONTHS_LONG = [
1963
- "January",
1964
- "February",
1965
- "March",
1966
- "April",
1967
- "May",
1968
- "June",
1969
- "July",
1970
- "August",
1971
- "September",
1972
- "October",
1973
- "November",
1974
- "December"
1975
- ];
1976
- var MONTHS_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
2053
+ function formatDayHead(dateString, style) {
2054
+ const ymd = splitYmd(dateString);
2055
+ if (!ymd) return dateString;
2056
+ return formatDateWithTimezone(ymd.join("-"), null, style) || dateString;
2057
+ }
1977
2058
  function splitYmd(dateString) {
1978
2059
  const head = dateString.split("T")[0];
1979
2060
  const parts = head.split("-");
@@ -1981,22 +2062,13 @@ function splitYmd(dateString) {
1981
2062
  return [parts[0], parts[1], parts[2]];
1982
2063
  }
1983
2064
  function formatReleaseDate(dateString) {
1984
- const ymd = splitYmd(dateString);
1985
- if (!ymd) return dateString;
1986
- const [year, month, day] = ymd;
1987
- return `${MONTHS_LONG[parseInt(month) - 1]} ${parseInt(day)}, ${year}`;
2065
+ return formatDayHead(dateString, "long");
1988
2066
  }
1989
2067
  function formatDateShort(dateString) {
1990
- const ymd = splitYmd(dateString);
1991
- if (!ymd) return dateString;
1992
- const [year, month, day] = ymd;
1993
- return `${MONTHS_SHORT[parseInt(month) - 1]} ${parseInt(day)}, ${year}`;
2068
+ return formatDayHead(dateString, "medium");
1994
2069
  }
1995
2070
  function formatDateSlashUTC(dateString) {
1996
- const ymd = splitYmd(dateString);
1997
- if (!ymd) return dateString;
1998
- const [year, month, day] = ymd;
1999
- return `${month}/${day}/${year}`;
2071
+ return formatDayHead(dateString, "numeric");
2000
2072
  }
2001
2073
 
2002
2074
  // src/utils/release-badge.ts
@@ -2948,6 +3020,13 @@ function generateImageSizes(_url) {
2948
3020
  }
2949
3021
 
2950
3022
  // src/utils/date-utils.ts
3023
+ var ZONED_DATE_FIELDS_MEDIUM_DATETIME = {
3024
+ year: "numeric",
3025
+ month: "short",
3026
+ day: "numeric",
3027
+ hour: "numeric",
3028
+ minute: "2-digit"
3029
+ };
2951
3030
  function formatTicketRelativeTime(iso) {
2952
3031
  const now = /* @__PURE__ */ new Date();
2953
3032
  const date = new Date(iso);
@@ -2958,22 +3037,10 @@ function formatTicketRelativeTime(iso) {
2958
3037
  if (diffMin < 60) return `${diffMin} min ago`;
2959
3038
  const diffHours = Math.floor(diffMin / 60);
2960
3039
  if (diffHours < 24) return diffHours === 1 ? "1 hour ago" : `${diffHours} hours ago`;
2961
- const mm = String(date.getUTCMonth() + 1).padStart(2, "0");
2962
- const dd = String(date.getUTCDate()).padStart(2, "0");
2963
- const yyyy = date.getUTCFullYear();
2964
- return `${mm}/${dd}/${yyyy}`;
3040
+ return formatDateWithTimezone(date, null, "numeric");
2965
3041
  }
2966
3042
  function formatTicketFullTimestamp(iso) {
2967
- const date = new Date(iso);
2968
- if (Number.isNaN(date.getTime())) return "";
2969
- const mm = String(date.getUTCMonth() + 1).padStart(2, "0");
2970
- const dd = String(date.getUTCDate()).padStart(2, "0");
2971
- const yyyy = date.getUTCFullYear();
2972
- let hours = date.getUTCHours();
2973
- const minutes = String(date.getUTCMinutes()).padStart(2, "0");
2974
- const ampm = hours >= 12 ? "PM" : "AM";
2975
- hours = hours % 12 || 12;
2976
- return `${mm}/${dd}/${yyyy}, ${hours}:${minutes} ${ampm}`;
3043
+ return formatDateWithTimezone(iso, null, "numericDateTime");
2977
3044
  }
2978
3045
  function formatRelativeTime(timestamp) {
2979
3046
  const now = /* @__PURE__ */ new Date();
@@ -2997,11 +3064,10 @@ function formatRelativeTime(timestamp) {
2997
3064
  const weeks = Math.floor(diffInDays / 7);
2998
3065
  return `${weeks}w ago`;
2999
3066
  }
3000
- return targetTime.toLocaleDateString("en-US", {
3067
+ return formatDateWithTimezone(targetTime, null, {
3001
3068
  month: "short",
3002
3069
  day: "numeric",
3003
- year: targetTime.getUTCFullYear() !== now.getUTCFullYear() ? "numeric" : void 0,
3004
- timeZone: "UTC"
3070
+ year: targetTime.getUTCFullYear() !== now.getUTCFullYear() ? "numeric" : void 0
3005
3071
  });
3006
3072
  }
3007
3073
  function formatAbsoluteDate(timestamp, options = {}) {
@@ -3010,16 +3076,12 @@ function formatAbsoluteDate(timestamp, options = {}) {
3010
3076
  console.warn("\u26A0\uFE0F Invalid timestamp in formatAbsoluteDate:", timestamp);
3011
3077
  return "Invalid date";
3012
3078
  }
3013
- const defaultOptions = {
3079
+ return formatDateWithTimezone(targetTime, options.timeZone ?? null, {
3014
3080
  year: "numeric",
3015
3081
  month: "short",
3016
3082
  day: "numeric",
3017
- // Pin to UTC so SSR (Vercel = UTC) and the client agree (React #418).
3018
- // Caller can override via `options`.
3019
- timeZone: "UTC",
3020
3083
  ...options
3021
- };
3022
- return targetTime.toLocaleDateString("en-US", defaultOptions);
3084
+ });
3023
3085
  }
3024
3086
  function formatDateTime(timestamp, options = {}) {
3025
3087
  const targetTime = typeof timestamp === "string" ? new Date(timestamp) : timestamp;
@@ -3027,18 +3089,10 @@ function formatDateTime(timestamp, options = {}) {
3027
3089
  console.warn("\u26A0\uFE0F Invalid timestamp in formatDateTime:", timestamp);
3028
3090
  return "Invalid date";
3029
3091
  }
3030
- const defaultOptions = {
3031
- year: "numeric",
3032
- month: "short",
3033
- day: "numeric",
3034
- hour: "numeric",
3035
- minute: "2-digit",
3036
- // Pin to UTC so SSR (Vercel = UTC) and the client agree (React #418).
3037
- // Caller can override via `options`.
3038
- timeZone: "UTC",
3092
+ return formatDateWithTimezone(targetTime, options.timeZone ?? null, {
3093
+ ...ZONED_DATE_FIELDS_MEDIUM_DATETIME,
3039
3094
  ...options
3040
- };
3041
- return targetTime.toLocaleDateString("en-US", defaultOptions);
3095
+ });
3042
3096
  }
3043
3097
  function getDetailedTimeDifference(timestamp) {
3044
3098
  const now = /* @__PURE__ */ new Date();
@@ -5473,6 +5527,53 @@ function pickBadgePaletteColor({
5473
5527
  return pool[Math.floor(random() * pool.length) % pool.length];
5474
5528
  }
5475
5529
 
5530
+ // src/utils/program-instant.ts
5531
+ var programStr = (value) => typeof value === "string" && value ? value : null;
5532
+ function programDateInstant(item) {
5533
+ const timezone = programStr(item.timezone);
5534
+ const date = programStr(item.date);
5535
+ const startAt = programStr(item.start_at);
5536
+ return {
5537
+ instant: timezone ? date ?? startAt : null,
5538
+ timezone,
5539
+ utcDate: date ?? startAt
5540
+ };
5541
+ }
5542
+ function webinarTiming(item) {
5543
+ return { startAt: programStr(item.start_at), endAt: programStr(item.end_at) };
5544
+ }
5545
+ function programMetaLine(item, kind, fmt) {
5546
+ const at = programDateInstant(item);
5547
+ const isScheduled = item.status === "scheduled";
5548
+ let typeMeta = null;
5549
+ if (kind === "podcast" && typeof item.duration_seconds === "number" && item.duration_seconds > 0 && !isScheduled) {
5550
+ typeMeta = fmt.duration(item.duration_seconds);
5551
+ } else if (kind === "event" && typeof item.location_name === "string" && item.location_name.trim().length > 0) {
5552
+ typeMeta = item.location_name;
5553
+ } else if (kind === "webinar" && programStr(item.start_at)) {
5554
+ typeMeta = fmt.webinarMeta(at, webinarTiming(item)) || null;
5555
+ }
5556
+ return { at, typeMeta, line: [fmt.date(at), typeMeta].filter(Boolean).join(" \xB7 ") };
5557
+ }
5558
+ function programMetaFormatters(fmt, opts = {}) {
5559
+ const withZoneLabel = opts.withZoneLabel !== false;
5560
+ return {
5561
+ // The meta line always renders the compact day; the one surface that wants
5562
+ // the weekday form renders it in its own slot, so a `dateStyle` option here
5563
+ // would exist for no caller.
5564
+ date: (at) => fmt.date(at, "medium"),
5565
+ duration: fmt.duration,
5566
+ webinarMeta: (at, o) => fmt.webinarMeta(at, { ...o, withZoneLabel })
5567
+ };
5568
+ }
5569
+
5570
+ // src/utils/program-meta-renderers.ts
5571
+ var PROGRAM_META_RENDERERS = {
5572
+ date: formatProgramDate,
5573
+ duration: formatDurationCompact,
5574
+ webinarMeta: formatWebinarTimeMeta
5575
+ };
5576
+
5476
5577
  exports.ANTHROPIC_SUPPORTED_IMAGE_MIME = ANTHROPIC_SUPPORTED_IMAGE_MIME;
5477
5578
  exports.AUTO_CONTINUATION_DIRECTIVE_PREFIX = AUTO_CONTINUATION_DIRECTIVE_PREFIX;
5478
5579
  exports.BADGE_PALETTE = BADGE_PALETTE;
@@ -5518,6 +5619,7 @@ exports.PLATFORM_BRAND = PLATFORM_BRAND;
5518
5619
  exports.PLATFORM_SURFACE = PLATFORM_SURFACE;
5519
5620
  exports.PLATFORM_THEME = PLATFORM_THEME;
5520
5621
  exports.PLAY_ICON_PATH = PLAY_ICON_PATH;
5622
+ exports.PROGRAM_META_RENDERERS = PROGRAM_META_RENDERERS;
5521
5623
  exports.ROADMAP_STATUS_OPTIONS = ROADMAP_STATUS_OPTIONS;
5522
5624
  exports.SCHEDULING_SLUG_SHAPE = SCHEDULING_SLUG_SHAPE;
5523
5625
  exports.SCROLL_ANCHOR = SCROLL_ANCHOR;
@@ -5533,6 +5635,7 @@ exports.STICKY_HEADER_OFFSET_PX = STICKY_HEADER_OFFSET_PX;
5533
5635
  exports.TAILWIND_STEP_TO_ODS_TOKEN = TAILWIND_STEP_TO_ODS_TOKEN;
5534
5636
  exports.TICKET_OPEN_PARAM = TICKET_OPEN_PARAM;
5535
5637
  exports.TICKET_STATUS_OPTIONS = TICKET_STATUS_OPTIONS;
5638
+ exports.VIEWER_TIMEZONE = VIEWER_TIMEZONE;
5536
5639
  exports.WALKTHROUGH_OPEN_QUERY_PARAM = WALKTHROUGH_OPEN_QUERY_PARAM;
5537
5640
  exports.WALKTHROUGH_VIDEO_DISMISS_KEY = WALKTHROUGH_VIDEO_DISMISS_KEY;
5538
5641
  exports.analyzeImageColor = analyzeImageColor;
@@ -5613,7 +5716,9 @@ exports.formatDateShort = formatDateShort;
5613
5716
  exports.formatDateSlashUTC = formatDateSlashUTC;
5614
5717
  exports.formatDateTime = formatDateTime;
5615
5718
  exports.formatDateTimeAt = formatDateTimeAt;
5719
+ exports.formatDateTimeYmd = formatDateTimeYmd;
5616
5720
  exports.formatDateUTC = formatDateUTC;
5721
+ exports.formatDateWithTimezone = formatDateWithTimezone;
5617
5722
  exports.formatDocName = formatDocName;
5618
5723
  exports.formatDuration = formatDuration;
5619
5724
  exports.formatDurationCompact = formatDurationCompact;
@@ -5629,6 +5734,8 @@ exports.formatPercent = formatPercent;
5629
5734
  exports.formatPhoneE164 = formatPhoneE164;
5630
5735
  exports.formatPrice = formatPrice;
5631
5736
  exports.formatPricingModel = formatPricingModel;
5737
+ exports.formatProgramDate = formatProgramDate;
5738
+ exports.formatProgramTimeRange = formatProgramTimeRange;
5632
5739
  exports.formatRelativeTime = formatRelativeTime;
5633
5740
  exports.formatReleaseDate = formatReleaseDate;
5634
5741
  exports.formatSingularLookupInvocation = formatSingularLookupInvocation;
@@ -5636,6 +5743,7 @@ exports.formatTicketFullTimestamp = formatTicketFullTimestamp;
5636
5743
  exports.formatTicketRelativeTime = formatTicketRelativeTime;
5637
5744
  exports.formatTimeWithTimezone = formatTimeWithTimezone;
5638
5745
  exports.formatUnderscoreText = formatUnderscoreText;
5746
+ exports.formatWebinarTimeMeta = formatWebinarTimeMeta;
5639
5747
  exports.formatWholeDollars = formatWholeDollars;
5640
5748
  exports.fromKeys = fromKeys;
5641
5749
  exports.generateBiteId = generateBiteId;
@@ -5716,6 +5824,7 @@ exports.isHumanitySignalKey = isHumanitySignalKey;
5716
5824
  exports.isImageMedia = isImageMedia;
5717
5825
  exports.isListedSchedulingName = isListedSchedulingName;
5718
5826
  exports.isOSPlatform = isOSPlatform;
5827
+ exports.isOrderedRange = isOrderedRange;
5719
5828
  exports.isPublishableMediaType = isPublishableMediaType;
5720
5829
  exports.isToday = isToday;
5721
5830
  exports.isValidEmailDomain = isValidEmailDomain;
@@ -5768,6 +5877,10 @@ exports.platformSecondaryVarName = platformSecondaryVarName;
5768
5877
  exports.platformShortNames = platformShortNames;
5769
5878
  exports.platformSlogans = platformSlogans;
5770
5879
  exports.positiveInt = positiveInt;
5880
+ exports.programDateInstant = programDateInstant;
5881
+ exports.programMetaFormatters = programMetaFormatters;
5882
+ exports.programMetaLine = programMetaLine;
5883
+ exports.programStr = programStr;
5771
5884
  exports.readDismissCookie = readDismissCookie;
5772
5885
  exports.readLeadingDecisionFrame = readLeadingDecisionFrame;
5773
5886
  exports.releaseTypeToBadgeColor = releaseTypeToBadgeColor;
@@ -5817,6 +5930,7 @@ exports.validateEmailDomain = validateEmailDomain;
5817
5930
  exports.validateEmailDomainList = validateEmailDomainList;
5818
5931
  exports.validatePhoneNumber = validatePhoneNumber;
5819
5932
  exports.walkthroughDismissCookieName = walkthroughDismissCookieName;
5933
+ exports.webinarTiming = webinarTiming;
5820
5934
  exports.withFirstTouchAttribution = withFirstTouchAttribution;
5821
5935
  exports.withQuery = withQuery;
5822
5936
  exports.withWalkthroughOpenParam = withWalkthroughOpenParam;