@flamingo-stack/openframe-frontend-core 0.0.731 → 0.0.733

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 (149) hide show
  1. package/dist/build/export-map.json +1 -1
  2. package/dist/{chunk-RAHRDJBP.cjs → chunk-3HPB4H4C.cjs} +4 -4
  3. package/dist/{chunk-2UNQJVYN.cjs → chunk-3KGICRH7.cjs} +1457 -1187
  4. package/dist/{chunk-A4HNF4MP.cjs → chunk-3UTPZW36.cjs} +89 -89
  5. package/dist/{chunk-GID62YEN.cjs → chunk-AAFW4STC.cjs} +3 -3
  6. package/dist/{chunk-XDBHGWFH.cjs → chunk-ATMBJBOI.cjs} +16 -16
  7. package/dist/{chunk-YDGBRI3Y.cjs → chunk-AV5533DH.cjs} +15 -15
  8. package/dist/{chunk-BFHLGEJK.cjs → chunk-BP6R5WDW.cjs} +63 -60
  9. package/dist/{chunk-CLILWI6O.cjs → chunk-CJVAA7KL.cjs} +32 -32
  10. package/dist/{chunk-YJFN2W7A.cjs → chunk-DUVOQHQI.cjs} +7 -7
  11. package/dist/{chunk-E3N24573.cjs → chunk-DUXLZPMJ.cjs} +9 -9
  12. package/dist/{chunk-TH4N726A.cjs → chunk-E26I4XH6.cjs} +17 -17
  13. package/dist/{chunk-Y4QRK3CB.cjs → chunk-EMG3T55N.cjs} +7 -7
  14. package/dist/{chunk-JK75ZZP3.cjs → chunk-EQORT7NK.cjs} +59 -59
  15. package/dist/chunk-FCGLSWKR.cjs +417 -0
  16. package/dist/{chunk-MANNIJ42.cjs → chunk-FICJS5OA.cjs} +6 -0
  17. package/dist/{chunk-QP6QS3YU.cjs → chunk-FNRMDDVN.cjs} +48 -50
  18. package/dist/{chunk-KLXHCNDC.cjs → chunk-FTTLBMHU.cjs} +3 -3
  19. package/dist/{chunk-JPZ4Y6X3.cjs → chunk-GB3CHAW7.cjs} +93 -93
  20. package/dist/{chunk-7DUXR4HL.cjs → chunk-GVTDVS5U.cjs} +3 -3
  21. package/dist/{chunk-ZV6473Z4.cjs → chunk-HSWHOCZ3.cjs} +20 -20
  22. package/dist/{chunk-53XZ6MJ5.cjs → chunk-IC4FT3A6.cjs} +28 -28
  23. package/dist/{chunk-6V4GEE55.cjs → chunk-J7JKPTGO.cjs} +12 -12
  24. package/dist/{chunk-FKKUQK4C.cjs → chunk-L4ZNR5V7.cjs} +43 -39
  25. package/dist/{chunk-NYY25425.cjs → chunk-MYBTNOS6.cjs} +2 -2
  26. package/dist/chunk-NTJE6SM6.cjs +28 -0
  27. package/dist/{chunk-RBOIGJYF.cjs → chunk-P3R23TOE.cjs} +35 -35
  28. package/dist/chunk-PX7FY655.cjs +114 -0
  29. package/dist/{chunk-YUXRIR45.cjs → chunk-SA7LDEVJ.cjs} +98 -50
  30. package/dist/{chunk-32ENYVFA.cjs → chunk-TIMCHP4X.cjs} +42 -42
  31. package/dist/{chunk-3SWLL4IM.cjs → chunk-U4T5NLZD.cjs} +8 -8
  32. package/dist/{chunk-HI7EFAFQ.cjs → chunk-XDWY6HAW.cjs} +28 -28
  33. package/dist/{chunk-25H2SZH7.cjs → chunk-XY632BCH.cjs} +4 -4
  34. package/dist/{chunk-HY2KTQSL.cjs → chunk-YIXKH2JO.cjs} +236 -236
  35. package/dist/{chunk-4YPV4OI4.cjs → chunk-ZBNA6TCW.cjs} +82 -82
  36. package/dist/{chunk-HLIJ3U2T.cjs → chunk-ZJNYWNCB.cjs} +23 -21
  37. package/dist/{chunk-HEOD765R.cjs → chunk-ZRYKDN2J.cjs} +32 -379
  38. package/dist/{cloud-tenants-SC4FNAC2.cjs → cloud-tenants-3GOGR3EN.cjs} +22 -22
  39. package/dist/components/agent-identity.d.ts +8 -0
  40. package/dist/components/agent-identity.d.ts.map +1 -1
  41. package/dist/components/agent-identity.js +13 -1
  42. package/dist/components/case-studies/index.cjs +35 -35
  43. package/dist/components/chat/embeddable-chat.d.ts +16 -0
  44. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  45. package/dist/components/chat/embeddable-chat.js +5 -2
  46. package/dist/components/chat/index.cjs +16 -16
  47. package/dist/components/chat/utils/icon-library.d.ts.map +1 -1
  48. package/dist/components/chat/utils/icon-library.js +6 -0
  49. package/dist/components/contact/index.cjs +23 -23
  50. package/dist/components/docs/index.cjs +26 -26
  51. package/dist/components/embeds/index.cjs +23 -23
  52. package/dist/components/faq/index.cjs +23 -23
  53. package/dist/components/features/index.cjs +22 -22
  54. package/dist/components/help-center-pages/index.cjs +138 -138
  55. package/dist/components/index.cjs +89 -82
  56. package/dist/components/meeting-scheduler/index.cjs +67 -67
  57. package/dist/components/navigation/index.cjs +25 -25
  58. package/dist/components/onboarding-guides/index.cjs +25 -25
  59. package/dist/components/product-demo/index.cjs +8 -8
  60. package/dist/components/product-demo/screens/remote-desktop-picture.d.ts.map +1 -1
  61. package/dist/components/product-demo/screens/remote-desktop-picture.js +2 -1
  62. package/dist/components/related-content/index.cjs +10 -10
  63. package/dist/components/tickets/index.cjs +26 -26
  64. package/dist/components/ui/device-wallpaper.d.ts +7 -0
  65. package/dist/components/ui/device-wallpaper.d.ts.map +1 -0
  66. package/dist/components/ui/device-wallpaper.js +5 -0
  67. package/dist/components/ui/feature-list.d.ts +9 -4
  68. package/dist/components/ui/feature-list.d.ts.map +1 -1
  69. package/dist/components/ui/feature-list.js +26 -35
  70. package/dist/components/ui/index.cjs +28 -22
  71. package/dist/components/ui/index.d.ts +3 -1
  72. package/dist/components/ui/index.d.ts.map +1 -1
  73. package/dist/components/ui/index.js +3 -1
  74. package/dist/components/ui/notification-stack.d.ts +33 -0
  75. package/dist/components/ui/notification-stack.d.ts.map +1 -0
  76. package/dist/components/ui/notification-stack.js +78 -0
  77. package/dist/components/ui/numbered-step.d.ts +29 -0
  78. package/dist/components/ui/numbered-step.d.ts.map +1 -0
  79. package/dist/components/ui/numbered-step.js +57 -0
  80. package/dist/components/ui/phone-frame.d.ts +14 -9
  81. package/dist/components/ui/phone-frame.d.ts.map +1 -1
  82. package/dist/components/ui/phone-frame.js +50 -6
  83. package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts +5 -0
  84. package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts.map +1 -0
  85. package/dist/components/ui/phone-glyphs/lock-camera-glyph.js +14 -0
  86. package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts +5 -0
  87. package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts.map +1 -0
  88. package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.js +14 -0
  89. package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts +5 -0
  90. package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts.map +1 -0
  91. package/dist/components/ui/phone-glyphs/status-bar-glyphs.js +68 -0
  92. package/dist/components/ui/searchable-select.d.ts +29 -3
  93. package/dist/components/ui/searchable-select.d.ts.map +1 -1
  94. package/dist/components/ui/searchable-select.js +101 -45
  95. package/dist/components/ui/snap-carousel.d.ts +5 -8
  96. package/dist/components/ui/snap-carousel.d.ts.map +1 -1
  97. package/dist/components/ui/snap-carousel.js +2 -27
  98. package/dist/components/ui/tab-navigation.d.ts +8 -1
  99. package/dist/components/ui/tab-navigation.d.ts.map +1 -1
  100. package/dist/components/ui/tab-navigation.js +30 -20
  101. package/dist/{devices-7MHSJNXS.cjs → devices-POZXTP7X.cjs} +23 -23
  102. package/dist/{embeddable-chat-VPIG3F7E.cjs → embeddable-chat-I3Y5GCCR.cjs} +96 -93
  103. package/dist/hooks/index.cjs +9 -9
  104. package/dist/hooks/ui/use-autoplay.d.ts +50 -13
  105. package/dist/hooks/ui/use-autoplay.d.ts.map +1 -1
  106. package/dist/hooks/ui/use-autoplay.js +76 -13
  107. package/dist/hooks/ui/use-in-view.d.ts +8 -0
  108. package/dist/hooks/ui/use-in-view.d.ts.map +1 -1
  109. package/dist/hooks/ui/use-in-view.js +21 -36
  110. package/dist/hooks/use-agent-identities.d.ts +6 -0
  111. package/dist/hooks/use-agent-identities.d.ts.map +1 -1
  112. package/dist/hooks/use-scenario-player.d.ts +26 -9
  113. package/dist/hooks/use-scenario-player.d.ts.map +1 -1
  114. package/dist/hooks/use-scenario-player.js +12 -9
  115. package/dist/index.cjs +58 -51
  116. package/dist/{knowledge-4DREGSOZ.cjs → knowledge-AP34IMXN.cjs} +23 -23
  117. package/dist/{logs-BWXNT2KP.cjs → logs-CEVMIOPW.cjs} +30 -30
  118. package/dist/{policies-MGFUI23M.cjs → policies-AMBMRCGB.cjs} +26 -26
  119. package/dist/{remote-session-O6QGXV2N.cjs → remote-session-Z4YZFG5E.cjs} +10 -9
  120. package/dist/{software-update-7LF7XEYC.cjs → software-update-Z3MWMSHI.cjs} +26 -26
  121. package/dist/{tickets-board-KNXK747O.cjs → tickets-board-JOSYLOS7.cjs} +13 -13
  122. package/package.json +1 -1
  123. package/src/components/agent-identity.tsx +20 -1
  124. package/src/components/chat/embeddable-chat.tsx +29 -2
  125. package/src/components/chat/utils/icon-library.tsx +7 -0
  126. package/src/components/product-demo/screens/remote-desktop-picture.tsx +2 -1
  127. package/src/components/ui/device-wallpaper.ts +7 -0
  128. package/src/components/ui/feature-list.tsx +24 -30
  129. package/src/components/ui/index.ts +3 -1
  130. package/src/components/ui/notification-stack.tsx +133 -0
  131. package/src/components/ui/numbered-step.tsx +81 -0
  132. package/src/components/ui/phone-frame.tsx +83 -19
  133. package/src/components/ui/phone-glyphs/lock-camera-glyph.tsx +14 -0
  134. package/src/components/ui/phone-glyphs/lock-flashlight-glyph.tsx +14 -0
  135. package/src/components/ui/phone-glyphs/status-bar-glyphs.tsx +45 -0
  136. package/src/components/ui/searchable-select.tsx +124 -32
  137. package/src/components/ui/snap-carousel.tsx +6 -38
  138. package/src/components/ui/tab-navigation.tsx +49 -21
  139. package/src/hooks/ui/use-autoplay.ts +144 -27
  140. package/src/hooks/ui/use-in-view.ts +31 -38
  141. package/src/hooks/use-agent-identities.ts +6 -0
  142. package/src/hooks/use-scenario-player.ts +44 -20
  143. package/dist/chunk-2WXLQ5R5.cjs +0 -99
  144. package/dist/chunk-BE2WAMG5.cjs +0 -54
  145. package/dist/chunk-LCTDHLDL.cjs +0 -43
  146. package/dist/components/ui/playback-toggle.d.ts +0 -24
  147. package/dist/components/ui/playback-toggle.d.ts.map +0 -1
  148. package/dist/components/ui/playback-toggle.js +0 -32
  149. package/src/components/ui/playback-toggle.tsx +0 -53
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkBE2WAMG5cjs = require('./chunk-BE2WAMG5.cjs');
6
+ var _chunkFCGLSWKRcjs = require('./chunk-FCGLSWKR.cjs');
7
7
 
8
8
 
9
9
 
@@ -15,7 +15,7 @@ var _chunkBE2WAMG5cjs = require('./chunk-BE2WAMG5.cjs');
15
15
  var _chunkYADG5Q7Ccjs = require('./chunk-YADG5Q7C.cjs');
16
16
 
17
17
 
18
- var _chunkNYY25425cjs = require('./chunk-NYY25425.cjs');
18
+ var _chunkMYBTNOS6cjs = require('./chunk-MYBTNOS6.cjs');
19
19
 
20
20
 
21
21
 
@@ -27,7 +27,7 @@ var _chunkNYY25425cjs = require('./chunk-NYY25425.cjs');
27
27
 
28
28
 
29
29
 
30
- var _chunkKLXHCNDCcjs = require('./chunk-KLXHCNDC.cjs');
30
+ var _chunkFTTLBMHUcjs = require('./chunk-FTTLBMHU.cjs');
31
31
 
32
32
 
33
33
  var _chunk32ASZMTVcjs = require('./chunk-32ASZMTV.cjs');
@@ -50,12 +50,12 @@ var _chunkEAY6ZUEScjs = require('./chunk-EAY6ZUES.cjs');
50
50
  var _chunkCW3ML76Ucjs = require('./chunk-CW3ML76U.cjs');
51
51
 
52
52
 
53
- var _chunk7DUXR4HLcjs = require('./chunk-7DUXR4HL.cjs');
53
+ var _chunkGVTDVS5Ucjs = require('./chunk-GVTDVS5U.cjs');
54
54
 
55
55
 
56
56
 
57
57
 
58
- var _chunkMANNIJ42cjs = require('./chunk-MANNIJ42.cjs');
58
+ var _chunkFICJS5OAcjs = require('./chunk-FICJS5OA.cjs');
59
59
 
60
60
 
61
61
  var _chunkUR4K2NSLcjs = require('./chunk-UR4K2NSL.cjs');
@@ -223,7 +223,7 @@ var Modal = _react.forwardRef.call(void 0, ({ isOpen, onClose, children, classNa
223
223
  ),
224
224
  role: "dialog",
225
225
  "aria-modal": "true",
226
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7DUXR4HLcjs.ViewportBreakpoints, { children })
226
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGVTDVS5Ucjs.ViewportBreakpoints, { children })
227
227
  }
228
228
  )
229
229
  ] });
@@ -878,7 +878,7 @@ function EntityIcon({
878
878
  size = 20,
879
879
  className
880
880
  }) {
881
- const identity = _chunkBE2WAMG5cjs.useAgentIdentityIcon.call(void 0, _optionalChain([icon, 'optionalAccess', _17 => _17.url]) ? null : _optionalChain([icon, 'optionalAccess', _18 => _18.name]));
881
+ const identity = _chunkFCGLSWKRcjs.useAgentIdentityIcon.call(void 0, _optionalChain([icon, 'optionalAccess', _17 => _17.url]) ? null : _optionalChain([icon, 'optionalAccess', _18 => _18.name]));
882
882
  if (!_optionalChain([icon, 'optionalAccess', _19 => _19.url]) && _optionalChain([identity, 'optionalAccess', _20 => _20.url])) {
883
883
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
884
884
  _chunkUR4K2NSLcjs.next_image_default,
@@ -887,7 +887,7 @@ function EntityIcon({
887
887
  alt: "",
888
888
  width: size,
889
889
  height: size,
890
- className: _chunk3ATAYP36cjs.cn.call(void 0, _chunkBE2WAMG5cjs.AGENT_PICTURE_CLASS, className),
890
+ className: _chunk3ATAYP36cjs.cn.call(void 0, _chunkFCGLSWKRcjs.AGENT_PICTURE_CLASS, className),
891
891
  unoptimized: true
892
892
  }
893
893
  );
@@ -906,8 +906,8 @@ function EntityIcon({
906
906
  }
907
907
  );
908
908
  }
909
- const Glyph = _chunkMANNIJ42cjs.resolveIcon.call(void 0, _nullishCoalesce(_nullishCoalesce(_optionalChain([identity, 'optionalAccess', _22 => _22.name]), () => ( _optionalChain([icon, 'optionalAccess', _23 => _23.name]))), () => ( void 0)));
910
- const agentColor = identity ? { color: _chunkBE2WAMG5cjs.AGENT_GLYPH_COLOR } : {};
909
+ const Glyph = _chunkFICJS5OAcjs.resolveIcon.call(void 0, _nullishCoalesce(_nullishCoalesce(_optionalChain([identity, 'optionalAccess', _22 => _22.name]), () => ( _optionalChain([icon, 'optionalAccess', _23 => _23.name]))), () => ( void 0)));
910
+ const agentColor = identity ? { color: _chunkFCGLSWKRcjs.AGENT_GLYPH_COLOR } : {};
911
911
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Glyph, { size, className, ...agentColor, ..._nullishCoalesce(_optionalChain([identity, 'optionalAccess', _24 => _24.props]), () => ( {})), ..._nullishCoalesce(_optionalChain([icon, 'optionalAccess', _25 => _25.props]), () => ( {})) });
912
912
  }
913
913
 
@@ -920,7 +920,7 @@ function escapeRegExp(value) {
920
920
  function formatDayHead(dateString, style) {
921
921
  const ymd = splitYmd(dateString);
922
922
  if (!ymd) return dateString;
923
- return _chunkKLXHCNDCcjs.formatDateWithTimezone.call(void 0, ymd.join("-"), null, style) || dateString;
923
+ return _chunkFTTLBMHUcjs.formatDateWithTimezone.call(void 0, ymd.join("-"), null, style) || dateString;
924
924
  }
925
925
  function splitYmd(dateString) {
926
926
  const head = dateString.split("T")[0];
@@ -1375,9 +1375,9 @@ function programMetaFormatters(fmt, opts = {}) {
1375
1375
 
1376
1376
  // src/utils/program-meta-renderers.ts
1377
1377
  var PROGRAM_META_RENDERERS = {
1378
- date: _chunkKLXHCNDCcjs.formatProgramDate,
1379
- duration: _chunkKLXHCNDCcjs.formatDurationCompact,
1380
- webinarMeta: _chunkKLXHCNDCcjs.formatWebinarTimeMeta
1378
+ date: _chunkFTTLBMHUcjs.formatProgramDate,
1379
+ duration: _chunkFTTLBMHUcjs.formatDurationCompact,
1380
+ webinarMeta: _chunkFTTLBMHUcjs.formatWebinarTimeMeta
1381
1381
  };
1382
1382
 
1383
1383
  // src/components/chat/utils/decide-new-tab.ts
@@ -1448,11 +1448,11 @@ function EntityMetadataAuthorCell({
1448
1448
  const fullName = trimmedName || "Unknown Author";
1449
1449
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex items-center gap-3 p-4 ${_nullishCoalesce(className, () => ( ""))}`, children: [
1450
1450
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1451
- _chunkKLXHCNDCcjs.SquareAvatar,
1451
+ _chunkFTTLBMHUcjs.SquareAvatar,
1452
1452
  {
1453
1453
  src: author.avatar_url || "",
1454
1454
  alt: fullName,
1455
- fallback: _chunkKLXHCNDCcjs.nameInitials.call(void 0, fullName, ""),
1455
+ fallback: _chunkFTTLBMHUcjs.nameInitials.call(void 0, fullName, ""),
1456
1456
  size: "md",
1457
1457
  variant: "round"
1458
1458
  }
@@ -1476,7 +1476,7 @@ function EntityAuthorCard({
1476
1476
  const hasAuthor = !!_optionalChain([author, 'optionalAccess', _33 => _33.full_name]);
1477
1477
  if (!hasAuthor && !renderEmptyAuthor) return null;
1478
1478
  const effectiveAuthor = hasAuthor ? author : EMPTY_AUTHOR_PLACEHOLDER;
1479
- const formatted = publishedAt ? _chunkKLXHCNDCcjs.formatDate.call(void 0, publishedAt) : "";
1479
+ const formatted = publishedAt ? _chunkFTTLBMHUcjs.formatDate.call(void 0, publishedAt) : "";
1480
1480
  const dateLabel = formatted === "Invalid Date" ? "" : formatted;
1481
1481
  const showDateCell = !!dateLabel;
1482
1482
  const extras = _nullishCoalesce(extraCells, () => ( []));
@@ -1684,7 +1684,7 @@ function PlatformBadge({ platform, size = "sm", showLabel = true, className }) {
1684
1684
  return null;
1685
1685
  }
1686
1686
  const sizes = sizeClasses[size];
1687
- const colors = _chunkMANNIJ42cjs.getPlatformBrandClasses.call(void 0, platform.name);
1687
+ const colors = _chunkFICJS5OAcjs.getPlatformBrandClasses.call(void 0, platform.name);
1688
1688
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1689
1689
  "div",
1690
1690
  {
@@ -1698,7 +1698,7 @@ function PlatformBadge({ platform, size = "sm", showLabel = true, className }) {
1698
1698
  className
1699
1699
  ),
1700
1700
  children: [
1701
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMANNIJ42cjs.PlatformMark, { platform: platform.name, className: sizes.icon }),
1701
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFICJS5OAcjs.PlatformMark, { platform: platform.name, className: sizes.icon }),
1702
1702
  showLabel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: sizes.text, children: platform.display_name || platform.name })
1703
1703
  ]
1704
1704
  }
@@ -1795,7 +1795,7 @@ var SENTENCE_MARK = /([.:?!]+)(?=\s|$)/g;
1795
1795
  var ONLY_MARKS = /^\s*[.:?!]+\s*$/;
1796
1796
  function headingAccentClass(platform, tone = "accent") {
1797
1797
  if (!platform) return "text-ods-accent";
1798
- const classes = _chunkMANNIJ42cjs.getPlatformBrandClasses.call(void 0, platform);
1798
+ const classes = _chunkFICJS5OAcjs.getPlatformBrandClasses.call(void 0, platform);
1799
1799
  return tone === "secondary" ? classes.secondaryText : classes.accentText;
1800
1800
  }
1801
1801
  function accentSentenceMarks(node, platform, tone = "accent") {
@@ -2135,7 +2135,7 @@ function ProductReleaseCard({
2135
2135
  ] }) }, `${cell.label}-${i}`)),
2136
2136
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 p-4", children: [
2137
2137
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2138
- _chunkKLXHCNDCcjs.SquareAvatar,
2138
+ _chunkFTTLBMHUcjs.SquareAvatar,
2139
2139
  {
2140
2140
  src: _nullishCoalesce(effectiveAuthor.avatar_url, () => ( void 0)),
2141
2141
  alt: effectiveAuthor.full_name,
@@ -2470,7 +2470,7 @@ function BlogCard({
2470
2470
  });
2471
2471
  const { src: displayImage, onError: onImageError } = useCoverImageFallback(post.featured_image, placeholderUrl);
2472
2472
  if (size === "sm") {
2473
- const dateStr2 = post.published_at ? _chunkKLXHCNDCcjs.formatDateWithTimezone.call(void 0, post.published_at, null, "medium") : "";
2473
+ const dateStr2 = post.published_at ? _chunkFTTLBMHUcjs.formatDateWithTimezone.call(void 0, post.published_at, null, "medium") : "";
2474
2474
  const firstCategory = _optionalChain([post, 'access', _57 => _57.categories, 'optionalAccess', _58 => _58.find, 'call', _59 => _59((c) => c && c.name), 'optionalAccess', _60 => _60.name]);
2475
2475
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkV45KLJQPcjs.next_link_default, { href, target, rel, className: _chunk3ATAYP36cjs.cn.call(void 0, COMPACT_CARD_OUTER, className), children: [
2476
2476
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: COMPACT_CARD_IMAGE_SLOT, children: displayImage ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2500,7 +2500,7 @@ function BlogCard({
2500
2500
  ] });
2501
2501
  }
2502
2502
  if (size === "portrait") {
2503
- const dateStr2 = post.published_at ? _chunkKLXHCNDCcjs.formatDateWithTimezone.call(void 0, post.published_at, null, "medium") : "";
2503
+ const dateStr2 = post.published_at ? _chunkFTTLBMHUcjs.formatDateWithTimezone.call(void 0, post.published_at, null, "medium") : "";
2504
2504
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2505
2505
  EntityPortraitCard,
2506
2506
  {
@@ -2521,7 +2521,7 @@ function BlogCard({
2521
2521
  }
2522
2522
  );
2523
2523
  }
2524
- const dateStr = post.published_at ? _chunkKLXHCNDCcjs.formatDateWithTimezone.call(void 0, post.published_at, null, "medium") : "";
2524
+ const dateStr = post.published_at ? _chunkFTTLBMHUcjs.formatDateWithTimezone.call(void 0, post.published_at, null, "medium") : "";
2525
2525
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "article", { className: _chunk3ATAYP36cjs.cn.call(void 0, CONTENT_CARD_FRAME_CLASS, "flex h-full flex-col", className), role: "article", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkV45KLJQPcjs.next_link_default, { href, target, rel, className: "flex h-full flex-col focus:outline-none", children: [
2526
2526
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative aspect-[1200/630] w-full overflow-hidden bg-ods-bg", children: displayImage ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2527
2527
  _chunkUR4K2NSLcjs.next_image_default,
@@ -3021,7 +3021,7 @@ function CustomerInterviewCard({
3021
3021
  // src/components/chat/types/entities/investor-update.ts
3022
3022
  function formatInvestorUpdatePeriod(start, end, options) {
3023
3023
  if (!start && !end) return "";
3024
- const fmt = (d) => _chunkKLXHCNDCcjs.formatDateWithTimezone.call(void 0, d, null, _optionalChain([options, 'optionalAccess', _128 => _128.monthFormat]) === "long" ? "monthYear" : "monthYearShort") || "?";
3024
+ const fmt = (d) => _chunkFTTLBMHUcjs.formatDateWithTimezone.call(void 0, d, null, _optionalChain([options, 'optionalAccess', _128 => _128.monthFormat]) === "long" ? "monthYear" : "monthYearShort") || "?";
3025
3025
  const s = start ? fmt(start) : "?";
3026
3026
  const e = end ? fmt(end) : "?";
3027
3027
  return `${s} - ${e}`;
@@ -3268,7 +3268,7 @@ function OnboardingGuideCard({
3268
3268
  const coverImage = guide.featured_image || guide.main_video_thumbnail || guide.og_image_url || null;
3269
3269
  const hasVideoCover = !!(guide.main_video_thumbnail || guide.highlight_video_thumbnail);
3270
3270
  const stepLabel = typeof guide.step_order === "number" ? String(guide.step_order).padStart(2, "0") : "\u2014";
3271
- const durationLabel = typeof guide.highlight_video_duration_ms === "number" && guide.highlight_video_duration_ms > 0 ? _chunkKLXHCNDCcjs.formatDurationMMSS.call(void 0, Math.floor(guide.highlight_video_duration_ms / 1e3)) : "";
3271
+ const durationLabel = typeof guide.highlight_video_duration_ms === "number" && guide.highlight_video_duration_ms > 0 ? _chunkFTTLBMHUcjs.formatDurationMMSS.call(void 0, Math.floor(guide.highlight_video_duration_ms / 1e3)) : "";
3272
3272
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3273
3273
  _chunkV45KLJQPcjs.next_link_default,
3274
3274
  {
@@ -3626,7 +3626,7 @@ function RoadmapCard({
3626
3626
  ]
3627
3627
  }
3628
3628
  ) : null,
3629
- item.assignees && item.assignees.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYY25425cjs.AvatarStack, { size: "xs", people: assigneePeople(item.assignees), className: "shrink-0" }) : null
3629
+ item.assignees && item.assignees.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMYBTNOS6cjs.AvatarStack, { size: "xs", people: assigneePeople(item.assignees), className: "shrink-0" }) : null
3630
3630
  ] }),
3631
3631
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: COMPACT_CARD_SUMMARY, children: item.description || COMPACT_CARD_ROW_FILLER }) })
3632
3632
  ] })
@@ -3713,7 +3713,7 @@ function RoadmapCard({
3713
3713
  )
3714
3714
  ] }),
3715
3715
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 items-center gap-2", children: [
3716
- item.assignees && item.assignees.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYY25425cjs.AvatarStack, { size: "xs", people: assigneePeople(item.assignees), className: "shrink-0" }) : null,
3716
+ item.assignees && item.assignees.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMYBTNOS6cjs.AvatarStack, { size: "xs", people: assigneePeople(item.assignees), className: "shrink-0" }) : null,
3717
3717
  item.screenshots && item.screenshots.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3718
3718
  _chunkAZL332TKcjs.Button,
3719
3719
  {
@@ -3974,7 +3974,7 @@ function ProgramEditorialCard({
3974
3974
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-clamp-3 min-h-[3lh] text-ods-text-secondary text-h4", children: description }),
3975
3975
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: EDITORIAL_PERSON_ROW, children: profile && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3976
3976
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3977
- _chunkKLXHCNDCcjs.SquareAvatar,
3977
+ _chunkFTTLBMHUcjs.SquareAvatar,
3978
3978
  {
3979
3979
  variant: "round",
3980
3980
  src: profile.avatarUrl || void 0,
@@ -4034,7 +4034,7 @@ function ProgramCard({
4034
4034
  // Compact densities join plain strings, so the zone rides inline here; the
4035
4035
  // default density below renders it as its own styled span instead.
4036
4036
  } = programMetaLine(item, config.type, programMetaFormatters(PROGRAM_META_RENDERERS));
4037
- const compactDate = _chunkKLXHCNDCcjs.formatProgramDate.call(void 0, zonedDate, "medium");
4037
+ const compactDate = _chunkFTTLBMHUcjs.formatProgramDate.call(void 0, zonedDate, "medium");
4038
4038
  if (size === "portrait") {
4039
4039
  const profile = programItemToStripProfile(item);
4040
4040
  const dateMeta = compactMetaLine;
@@ -4067,7 +4067,7 @@ function ProgramCard({
4067
4067
  description: item.description,
4068
4068
  cover: coverImage || placeholderUrl || null,
4069
4069
  eyebrow,
4070
- date: _chunkKLXHCNDCcjs.formatProgramDate.call(void 0, zonedDate, "weekday"),
4070
+ date: _chunkFTTLBMHUcjs.formatProgramDate.call(void 0, zonedDate, "weekday"),
4071
4071
  typeMeta: compactTypeMetaValue,
4072
4072
  profile: programItemToStripProfile(item),
4073
4073
  playable: isPlayable,
@@ -4095,7 +4095,7 @@ function ProgramCard({
4095
4095
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex h-5 shrink-0 items-center self-start text-ods-text-secondary", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-3.5 w-3.5" }) })
4096
4096
  ] });
4097
4097
  }
4098
- const dateFormat = _chunkKLXHCNDCcjs.formatProgramDate.call(void 0, zonedDate, "weekday");
4098
+ const dateFormat = _chunkFTTLBMHUcjs.formatProgramDate.call(void 0, zonedDate, "weekday");
4099
4099
  const { typeMeta: defaultTypeMeta, audience: defaultAudience } = programMetaLine(
4100
4100
  item,
4101
4101
  config.type,
@@ -4126,7 +4126,7 @@ function ProgramCard({
4126
4126
  return null;
4127
4127
  };
4128
4128
  const endAt = "end_at" in item && typeof item.end_at === "string" ? item.end_at : null;
4129
- const dateLabel = _nullishCoalesce(_chunkKLXHCNDCcjs.formatProgramDateRange.call(void 0, zonedDate, endAt), () => ( dateFormat));
4129
+ const dateLabel = _nullishCoalesce(_chunkFTTLBMHUcjs.formatProgramDateRange.call(void 0, zonedDate, endAt), () => ( dateFormat));
4130
4130
  const cardHeader = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: DEFAULT_HEADER, children: [
4131
4131
  coverImage && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: DEFAULT_COVER_FRAME, children: [
4132
4132
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -4155,10 +4155,10 @@ function ProgramCard({
4155
4155
  ] })
4156
4156
  ] }),
4157
4157
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: DEFAULT_DESCRIPTION, children: item.description }),
4158
- tags.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: DEFAULT_TAG_ROW, children: tags.map((tag) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKLXHCNDCcjs.Tag, { as: "span", label: tag, variant: "outline" }, tag)) })
4158
+ tags.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: DEFAULT_TAG_ROW, children: tags.map((tag) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTTLBMHUcjs.Tag, { as: "span", label: tag, variant: "outline" }, tag)) })
4159
4159
  ] }),
4160
4160
  hosts.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-2 md:justify-end", children: hosts.map((host, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4161
- _chunkKLXHCNDCcjs.SquareAvatar,
4161
+ _chunkFTTLBMHUcjs.SquareAvatar,
4162
4162
  {
4163
4163
  variant: "round",
4164
4164
  src: host.avatar || void 0,
@@ -0,0 +1,114 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+
3
+
4
+
5
+ var _chunkVOX4E6AXcjs = require('./chunk-VOX4E6AX.cjs');
6
+
7
+ // src/utils/common.ts
8
+ var _clsx = require('clsx');
9
+ var _tailwindmerge = require('tailwind-merge');
10
+ function errorMessage(error, fallback = "Something went wrong") {
11
+ if (error instanceof Error && error.message) return error.message;
12
+ if (typeof error === "string" && error) return error;
13
+ if (typeof error === "object" && error !== null) {
14
+ const message = error.message;
15
+ if (typeof message === "string" && message) return message;
16
+ }
17
+ return fallback;
18
+ }
19
+ function apiErrorMessage(payload, fallback) {
20
+ if (typeof payload === "object" && payload !== null && "error" in payload) {
21
+ const { error } = payload;
22
+ if (typeof error === "string" && error) return error;
23
+ }
24
+ return errorMessage(payload, fallback);
25
+ }
26
+ function delay(ms) {
27
+ return new Promise((resolve) => setTimeout(resolve, ms));
28
+ }
29
+ function generateRandomString(length = 8) {
30
+ const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
31
+ let result = "";
32
+ for (let i = 0; i < length; i++) {
33
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
34
+ }
35
+ return result;
36
+ }
37
+ function truncateString(str, maxLength, suffix = "...") {
38
+ if (str.length <= maxLength) return str;
39
+ return str.substring(0, maxLength - suffix.length) + suffix;
40
+ }
41
+ function serializeJsonLd(schema) {
42
+ return JSON.stringify(schema).replace(/</g, "\\u003c");
43
+ }
44
+ function deepClone(obj) {
45
+ return JSON.parse(JSON.stringify(obj));
46
+ }
47
+ function getSlackCommunityJoinUrl() {
48
+ const url = process.env.NEXT_PUBLIC_SLACK_COMMUNITY_JOIN_URL;
49
+ if (!url) {
50
+ console.warn("NEXT_PUBLIC_SLACK_COMMUNITY_JOIN_URL is not defined in environment variables");
51
+ return "https://join.slack.com/t/openmsp/shared_invite/zt-36bl7mx0h-3~U2nFH6nqHqoTPXMaHEHA";
52
+ }
53
+ return url;
54
+ }
55
+ function clamp(value, min, max) {
56
+ return Math.min(Math.max(value, min), max);
57
+ }
58
+ function pick(source, keys) {
59
+ const out = {};
60
+ for (const key of keys) {
61
+ if (key in source) out[key] = source[key];
62
+ }
63
+ return out;
64
+ }
65
+ var NO_CLIENT_CACHE = { staleTime: 0 };
66
+
67
+ // src/hooks/use-agent-identities.ts
68
+ var _reactquery = require('@tanstack/react-query');
69
+
70
+ // src/utils/embed-content-fetch.ts
71
+ var contentFetch = (input, init) => {
72
+ if (!_chunkVOX4E6AXcjs.hasEmbedAuthAdapter.call(void 0, )) return fetch(input, init);
73
+ const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
74
+ return _chunkVOX4E6AXcjs.embedAuthedFetch.call(void 0, url, init);
75
+ };
76
+
77
+ // src/hooks/use-agent-identities.ts
78
+ var AGENT_IDENTITIES_API_PATH = "/api/ai-agents";
79
+ async function fetchAgentIdentities(endpoint, signal) {
80
+ const response = await contentFetch(endpoint, { signal });
81
+ if (!response.ok) throw new Error(`agent identities read failed (${response.status})`);
82
+ const body = await response.json();
83
+ const icons = {};
84
+ for (const agent of _nullishCoalesce(_optionalChain([body, 'optionalAccess', _ => _.agents]), () => ( []))) if (agent.slug && agent.icon) icons[agent.slug] = agent.icon;
85
+ return icons;
86
+ }
87
+ function useAgentIdentities(endpoint = AGENT_IDENTITIES_API_PATH, enabled = true) {
88
+ const { data } = _reactquery.useQuery.call(void 0, {
89
+ queryKey: ["agent-identities", endpoint],
90
+ queryFn: ({ signal }) => fetchAgentIdentities(endpoint, signal),
91
+ staleTime: Infinity,
92
+ gcTime: Infinity,
93
+ retry: false,
94
+ enabled
95
+ });
96
+ return data;
97
+ }
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ exports.errorMessage = errorMessage; exports.apiErrorMessage = apiErrorMessage; exports.delay = delay; exports.generateRandomString = generateRandomString; exports.truncateString = truncateString; exports.serializeJsonLd = serializeJsonLd; exports.deepClone = deepClone; exports.getSlackCommunityJoinUrl = getSlackCommunityJoinUrl; exports.clamp = clamp; exports.pick = pick; exports.NO_CLIENT_CACHE = NO_CLIENT_CACHE; exports.contentFetch = contentFetch; exports.AGENT_IDENTITIES_API_PATH = AGENT_IDENTITIES_API_PATH; exports.useAgentIdentities = useAgentIdentities;
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
2
 
3
3
 
4
- var _chunkMANNIJ42cjs = require('./chunk-MANNIJ42.cjs');
4
+ var _chunkFICJS5OAcjs = require('./chunk-FICJS5OA.cjs');
5
5
 
6
6
  // src/hooks/ui/use-debounce.ts
7
7
  var _react = require('react');
@@ -131,10 +131,10 @@ function useSuppressCloneFocus(active) {
131
131
  // src/hooks/ui/use-prefers-reduced-motion.ts
132
132
  var PREFERS_REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
133
133
  function usePrefersReducedMotion() {
134
- return _chunkMANNIJ42cjs.useMediaQuery.call(void 0, PREFERS_REDUCED_MOTION_QUERY) === true;
134
+ return _chunkFICJS5OAcjs.useMediaQuery.call(void 0, PREFERS_REDUCED_MOTION_QUERY) === true;
135
135
  }
136
136
  function usePrefersReducedMotionState() {
137
- return _chunkMANNIJ42cjs.useMediaQuery.call(void 0, PREFERS_REDUCED_MOTION_QUERY);
137
+ return _chunkFICJS5OAcjs.useMediaQuery.call(void 0, PREFERS_REDUCED_MOTION_QUERY);
138
138
  }
139
139
 
140
140
  // src/hooks/ui/use-in-view.ts
@@ -145,63 +145,111 @@ function useInView({
145
145
  rootMargin = "0px",
146
146
  initial = false
147
147
  } = {}) {
148
- const [inView, setInView] = _react.useState.call(void 0, initial);
149
- const observerRef = _react.useRef.call(void 0, null);
150
- const disconnect = _react.useCallback.call(void 0, () => {
151
- _optionalChain([observerRef, 'access', _7 => _7.current, 'optionalAccess', _8 => _8.disconnect, 'call', _9 => _9()]);
152
- observerRef.current = null;
153
- }, []);
154
- const ref = _react.useCallback.call(void 0,
155
- (node) => {
156
- disconnect();
157
- if (!node) {
158
- setInView(false);
159
- return;
160
- }
161
- if (typeof IntersectionObserver === "undefined") {
162
- setInView(initial);
163
- return;
164
- }
165
- const observer = new IntersectionObserver(
166
- (entries) => {
167
- const entry = entries[entries.length - 1];
168
- if (!entry) return;
169
- const ofElement = entry.intersectionRatio >= threshold;
170
- const viewportHeight = _nullishCoalesce(_optionalChain([entry, 'access', _10 => _10.rootBounds, 'optionalAccess', _11 => _11.height]), () => ( 0));
171
- const ofViewport = viewportHeight > 0 && (_nullishCoalesce(_optionalChain([entry, 'access', _12 => _12.intersectionRect, 'optionalAccess', _13 => _13.height]), () => ( 0))) >= viewportHeight * threshold;
172
- setInView(entry.isIntersecting && (ofElement || ofViewport));
173
- },
174
- { threshold: STEPS, rootMargin }
175
- );
176
- observer.observe(node);
177
- observerRef.current = observer;
178
- },
179
- [disconnect, threshold, rootMargin, initial]
180
- );
181
- _react.useEffect.call(void 0, () => disconnect, [disconnect]);
182
- return { ref, inView };
148
+ const [node, setNode] = _react.useState.call(void 0, null);
149
+ const [seen, setSeen] = _react.useState.call(void 0, null);
150
+ _react.useEffect.call(void 0, () => {
151
+ if (!node || typeof IntersectionObserver === "undefined") return void 0;
152
+ const observer = new IntersectionObserver(
153
+ (entries) => {
154
+ const entry = entries[entries.length - 1];
155
+ if (!entry) return;
156
+ const ofElement = entry.intersectionRatio >= threshold;
157
+ const viewportHeight = _nullishCoalesce(_optionalChain([entry, 'access', _7 => _7.rootBounds, 'optionalAccess', _8 => _8.height]), () => ( 0));
158
+ const ofViewport = viewportHeight > 0 && (_nullishCoalesce(_optionalChain([entry, 'access', _9 => _9.intersectionRect, 'optionalAccess', _10 => _10.height]), () => ( 0))) >= viewportHeight * threshold;
159
+ setSeen({ node, inView: entry.isIntersecting && (ofElement || ofViewport) });
160
+ },
161
+ { threshold: STEPS, rootMargin }
162
+ );
163
+ observer.observe(node);
164
+ return () => observer.disconnect();
165
+ }, [node, threshold, rootMargin]);
166
+ const inView = !node ? false : _optionalChain([seen, 'optionalAccess', _11 => _11.node]) === node ? seen.inView : initial;
167
+ return { ref: setNode, inView };
183
168
  }
184
169
 
185
170
  // src/hooks/ui/use-autoplay.ts
186
171
 
172
+ function listen(target, events, onChange) {
173
+ const controller = new AbortController();
174
+ for (const event of events) target.addEventListener(event, onChange, { signal: controller.signal });
175
+ return () => controller.abort();
176
+ }
177
+ var subscribeToTab = (onChange) => {
178
+ const stopDocument = listen(document, ["visibilitychange"], onChange);
179
+ const stopWindow = listen(window, ["pageshow"], onChange);
180
+ return () => {
181
+ stopDocument();
182
+ stopWindow();
183
+ };
184
+ };
185
+ var tabIsHidden = () => document.visibilityState === "hidden";
186
+ var never = () => false;
187
+ var RELEASE_EVENTS = ["pointerup", "pointercancel", "mouseup", "touchend", "dragend", "blur"];
187
188
  function useAutoplay(onScreen) {
188
189
  const reducedState = usePrefersReducedMotionState();
189
- const [paused, setPaused] = _react.useState.call(void 0, false);
190
- const [tabHidden, setTabHidden] = _react.useState.call(void 0, false);
191
- _react.useEffect.call(void 0, () => {
192
- const sync = () => setTabHidden(document.visibilityState === "hidden");
193
- sync();
194
- document.addEventListener("visibilitychange", sync);
195
- window.addEventListener("pageshow", sync);
190
+ const tabHidden = _react.useSyncExternalStore.call(void 0, subscribeToTab, tabIsHidden, never);
191
+ const host = _react.useRef.call(void 0, null);
192
+ const keyboardCameIn = _react.useRef.call(void 0, false);
193
+ const subscribeToKeyboard = _react.useCallback.call(void 0, (onChange) => {
194
+ const usedPointer = () => {
195
+ keyboardCameIn.current = false;
196
+ onChange();
197
+ };
198
+ const stopFocus = listen(document, ["focusin", "focusout", "visibilitychange"], onChange);
199
+ const stopPointer = listen(document, ["pointerdown", "pointermove"], usedPointer);
200
+ const stopWindow = listen(window, ["focus", "blur"], onChange);
196
201
  return () => {
197
- document.removeEventListener("visibilitychange", sync);
198
- window.removeEventListener("pageshow", sync);
202
+ stopFocus();
203
+ stopPointer();
204
+ stopWindow();
199
205
  };
200
206
  }, []);
207
+ const keyboardIsInside = _react.useCallback.call(void 0, () => {
208
+ if (!keyboardCameIn.current) return false;
209
+ const inside = !!_optionalChain([host, 'access', _12 => _12.current, 'optionalAccess', _13 => _13.isConnected]) && host.current.contains(document.activeElement);
210
+ if (!inside) keyboardCameIn.current = false;
211
+ return inside;
212
+ }, []);
213
+ const focused = _react.useSyncExternalStore.call(void 0, subscribeToKeyboard, keyboardIsInside, never);
214
+ const [pressed, setPressed] = _react.useState.call(void 0, false);
215
+ const holdProps = _react.useMemo.call(void 0,
216
+ () => ({
217
+ onPointerDown: (event) => {
218
+ host.current = event.currentTarget;
219
+ setPressed(true);
220
+ const released = new AbortController();
221
+ const release2 = () => {
222
+ setPressed(false);
223
+ released.abort();
224
+ };
225
+ for (const type of RELEASE_EVENTS) window.addEventListener(type, release2, { signal: released.signal });
226
+ window.addEventListener(
227
+ "pointermove",
228
+ (move) => {
229
+ if (move.buttons === 0) release2();
230
+ },
231
+ { signal: released.signal }
232
+ );
233
+ },
234
+ onFocus: (event) => {
235
+ host.current = event.currentTarget;
236
+ if (event.target.matches(":focus-visible")) keyboardCameIn.current = true;
237
+ }
238
+ }),
239
+ []
240
+ );
241
+ const [, setReleases] = _react.useState.call(void 0, 0);
242
+ const release = _react.useCallback.call(void 0, () => {
243
+ keyboardCameIn.current = false;
244
+ setPressed(false);
245
+ setReleases((count) => count + 1);
246
+ }, []);
247
+ const held = pressed || focused;
201
248
  return {
202
- playing: onScreen && !paused && !tabHidden && reducedState === false,
203
- paused,
204
- setPaused,
249
+ playing: onScreen && !held && !tabHidden && reducedState === false,
250
+ held,
251
+ holdProps,
252
+ release,
205
253
  reducedMotion: reducedState === true
206
254
  };
207
255
  }