@flamingo-stack/openframe-frontend-core 0.0.629-2171.6182.1 → 0.0.629

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 (182) hide show
  1. package/dist/{chunk-RAPPN6MN.cjs → chunk-2MMEPNSX.cjs} +3 -3
  2. package/dist/{chunk-RAPPN6MN.cjs.map → chunk-2MMEPNSX.cjs.map} +1 -1
  3. package/dist/{chunk-NBM7ZB6T.js → chunk-2MXKO5BN.js} +12 -12
  4. package/dist/{chunk-R46TW4LX.cjs → chunk-2ZSGDKZI.cjs} +9 -9
  5. package/dist/{chunk-R46TW4LX.cjs.map → chunk-2ZSGDKZI.cjs.map} +1 -1
  6. package/dist/{chunk-P7UT2YSC.cjs → chunk-3IXDZI3R.cjs} +3 -3
  7. package/dist/{chunk-P7UT2YSC.cjs.map → chunk-3IXDZI3R.cjs.map} +1 -1
  8. package/dist/{chunk-FYC3W72E.cjs → chunk-3ZY4CE7N.cjs} +6 -6
  9. package/dist/{chunk-FYC3W72E.cjs.map → chunk-3ZY4CE7N.cjs.map} +1 -1
  10. package/dist/{chunk-HRRKZWFF.js → chunk-4NMVDTHA.js} +8 -10
  11. package/dist/{chunk-HRRKZWFF.js.map → chunk-4NMVDTHA.js.map} +1 -1
  12. package/dist/{chunk-MIOE7FYN.js → chunk-4VPCIREO.js} +3 -3
  13. package/dist/{chunk-FTWVYXNP.cjs → chunk-5JAB5LVO.cjs} +34 -34
  14. package/dist/{chunk-FTWVYXNP.cjs.map → chunk-5JAB5LVO.cjs.map} +1 -1
  15. package/dist/{chunk-JRYS4VMV.js → chunk-5LIDR7HL.js} +79 -4
  16. package/dist/{chunk-JRYS4VMV.js.map → chunk-5LIDR7HL.js.map} +1 -1
  17. package/dist/{chunk-DDUG42FK.cjs → chunk-5OMBSMRI.cjs} +26 -28
  18. package/dist/chunk-5OMBSMRI.cjs.map +1 -0
  19. package/dist/{chunk-CHRPZ5PV.cjs → chunk-7P6M5G3W.cjs} +25 -25
  20. package/dist/{chunk-CHRPZ5PV.cjs.map → chunk-7P6M5G3W.cjs.map} +1 -1
  21. package/dist/{chunk-ZOMGXH7C.js → chunk-BVQEU5JB.js} +2 -2
  22. package/dist/{chunk-VOZZQ6HQ.cjs → chunk-CCWI3622.cjs} +4 -4
  23. package/dist/{chunk-VOZZQ6HQ.cjs.map → chunk-CCWI3622.cjs.map} +1 -1
  24. package/dist/{chunk-GUCKPOPQ.cjs → chunk-CKMJQ46H.cjs} +42 -42
  25. package/dist/{chunk-GUCKPOPQ.cjs.map → chunk-CKMJQ46H.cjs.map} +1 -1
  26. package/dist/{chunk-JQSN7D7X.cjs → chunk-CV2SESZT.cjs} +7 -7
  27. package/dist/{chunk-JQSN7D7X.cjs.map → chunk-CV2SESZT.cjs.map} +1 -1
  28. package/dist/{chunk-LZB2UZJY.js → chunk-D5CKXMMC.js} +4 -4
  29. package/dist/{chunk-FENZRLVO.js → chunk-DGY4NVIB.js} +8 -10
  30. package/dist/{chunk-FENZRLVO.js.map → chunk-DGY4NVIB.js.map} +1 -1
  31. package/dist/{chunk-BQ6QZUZ6.cjs → chunk-DLHGJYYA.cjs} +83 -83
  32. package/dist/{chunk-BQ6QZUZ6.cjs.map → chunk-DLHGJYYA.cjs.map} +1 -1
  33. package/dist/{chunk-4E7XCEV3.cjs → chunk-EHAYNUOL.cjs} +2 -77
  34. package/dist/chunk-EHAYNUOL.cjs.map +1 -0
  35. package/dist/{chunk-X5NN4NJM.js → chunk-F2KBCLUG.js} +2 -2
  36. package/dist/{chunk-USIRWQJ3.js → chunk-FKBM6U43.js} +1 -76
  37. package/dist/{chunk-USIRWQJ3.js.map → chunk-FKBM6U43.js.map} +1 -1
  38. package/dist/{chunk-5BUEB2WQ.js → chunk-GR3WOOM7.js} +12 -12
  39. package/dist/{chunk-TV6NXNKO.cjs → chunk-HVWNOPDV.cjs} +5 -5
  40. package/dist/{chunk-TV6NXNKO.cjs.map → chunk-HVWNOPDV.cjs.map} +1 -1
  41. package/dist/{chunk-QIVX7F3N.cjs → chunk-JJUV7Z4L.cjs} +27 -27
  42. package/dist/{chunk-QIVX7F3N.cjs.map → chunk-JJUV7Z4L.cjs.map} +1 -1
  43. package/dist/{chunk-53ARMJHM.cjs → chunk-JONR3BDJ.cjs} +37 -37
  44. package/dist/{chunk-53ARMJHM.cjs.map → chunk-JONR3BDJ.cjs.map} +1 -1
  45. package/dist/{chunk-G5FL4QTN.cjs → chunk-K7EJ7HYJ.cjs} +18 -18
  46. package/dist/{chunk-G5FL4QTN.cjs.map → chunk-K7EJ7HYJ.cjs.map} +1 -1
  47. package/dist/{chunk-KAG3SX3R.cjs → chunk-KO52PXL4.cjs} +20 -22
  48. package/dist/chunk-KO52PXL4.cjs.map +1 -0
  49. package/dist/{chunk-F4JGAGI3.cjs → chunk-LHYRLL64.cjs} +47 -49
  50. package/dist/chunk-LHYRLL64.cjs.map +1 -0
  51. package/dist/{chunk-65IVNHBS.js → chunk-LQLL4S4V.js} +4 -4
  52. package/dist/{chunk-CIRD5P4U.js → chunk-MOB5AA3X.js} +7 -7
  53. package/dist/{chunk-LUBIWC3N.js → chunk-MTLDYBXK.js} +8 -8
  54. package/dist/{chunk-L5FEAOGJ.js → chunk-ON7663OW.js} +354 -8
  55. package/dist/chunk-ON7663OW.js.map +1 -0
  56. package/dist/{chunk-55X46LKR.cjs → chunk-OQHFHKUG.cjs} +100 -450
  57. package/dist/chunk-OQHFHKUG.cjs.map +1 -0
  58. package/dist/{chunk-7ZDPJ6SW.js → chunk-OXTV63QO.js} +4 -4
  59. package/dist/{chunk-WYELOUP4.js → chunk-PFBMVQ5R.js} +6 -6
  60. package/dist/{chunk-SOUGXQJE.js → chunk-PJZYJDR7.js} +4 -4
  61. package/dist/{chunk-NDIPDU36.js → chunk-QGWBMPQY.js} +28 -16
  62. package/dist/{chunk-NDIPDU36.js.map → chunk-QGWBMPQY.js.map} +1 -1
  63. package/dist/{chunk-2J7EFH4V.js → chunk-QS2QCXBH.js} +30 -380
  64. package/dist/chunk-QS2QCXBH.js.map +1 -0
  65. package/dist/{chunk-76HB456V.js → chunk-S6WBBSII.js} +5 -5
  66. package/dist/{chunk-BS6ASI3D.js → chunk-SCPJ53CM.js} +3 -3
  67. package/dist/{chunk-D7VNHPJB.js → chunk-T46STYS2.js} +8 -10
  68. package/dist/{chunk-D7VNHPJB.js.map → chunk-T46STYS2.js.map} +1 -1
  69. package/dist/{chunk-6I3KNDBF.cjs → chunk-U7TTQV4N.cjs} +3 -3
  70. package/dist/{chunk-6I3KNDBF.cjs.map → chunk-U7TTQV4N.cjs.map} +1 -1
  71. package/dist/{chunk-ZYDNPUSH.cjs → chunk-UNI3POHU.cjs} +625 -279
  72. package/dist/chunk-UNI3POHU.cjs.map +1 -0
  73. package/dist/{chunk-Y2ZRUCYH.cjs → chunk-W523NIJ6.cjs} +15 -15
  74. package/dist/{chunk-Y2ZRUCYH.cjs.map → chunk-W523NIJ6.cjs.map} +1 -1
  75. package/dist/{chunk-J6ATJUEE.js → chunk-WBZ4HP7D.js} +4 -4
  76. package/dist/{chunk-CP3R4GRA.cjs → chunk-WR67VM2J.cjs} +293 -281
  77. package/dist/chunk-WR67VM2J.cjs.map +1 -0
  78. package/dist/{chunk-32P6KUZP.js → chunk-X3LC6R37.js} +2 -2
  79. package/dist/{chunk-ELKTBTGR.cjs → chunk-XNC37UQP.cjs} +105 -105
  80. package/dist/{chunk-ELKTBTGR.cjs.map → chunk-XNC37UQP.cjs.map} +1 -1
  81. package/dist/{chunk-CMUNJZWN.js → chunk-YQCA4ZEJ.js} +2 -2
  82. package/dist/{chunk-ZI27ALYX.cjs → chunk-YXWGSDK4.cjs} +80 -5
  83. package/dist/chunk-YXWGSDK4.cjs.map +1 -0
  84. package/dist/components/case-studies/index.cjs +14 -14
  85. package/dist/components/case-studies/index.js +8 -8
  86. package/dist/components/chat/index.cjs +5 -5
  87. package/dist/components/chat/index.js +4 -4
  88. package/dist/components/contact/index.cjs +9 -9
  89. package/dist/components/contact/index.js +8 -8
  90. package/dist/components/docs/index.cjs +12 -12
  91. package/dist/components/docs/index.js +11 -11
  92. package/dist/components/embeds/index.cjs +9 -9
  93. package/dist/components/embeds/index.js +8 -8
  94. package/dist/components/faq/index.cjs +10 -10
  95. package/dist/components/faq/index.js +9 -9
  96. package/dist/components/features/index.cjs +8 -8
  97. package/dist/components/features/index.js +7 -7
  98. package/dist/components/help-center-pages/index.cjs +31 -31
  99. package/dist/components/help-center-pages/index.js +22 -22
  100. package/dist/components/index.cjs +69 -71
  101. package/dist/components/index.cjs.map +1 -1
  102. package/dist/components/index.js +24 -26
  103. package/dist/components/index.js.map +1 -1
  104. package/dist/components/meeting-scheduler/index.cjs +49 -49
  105. package/dist/components/meeting-scheduler/index.js +9 -9
  106. package/dist/components/navigation/index.cjs +11 -11
  107. package/dist/components/navigation/index.js +10 -10
  108. package/dist/components/onboarding-guides/index.cjs +12 -12
  109. package/dist/components/onboarding-guides/index.js +11 -11
  110. package/dist/components/related-content/index.cjs +6 -6
  111. package/dist/components/related-content/index.js +5 -5
  112. package/dist/components/tickets/index.cjs +13 -13
  113. package/dist/components/tickets/index.js +12 -12
  114. package/dist/components/ui/color-preset-select.d.ts +5 -4
  115. package/dist/components/ui/color-preset-select.d.ts.map +1 -1
  116. package/dist/components/ui/department-badge.d.ts +3 -3
  117. package/dist/components/ui/index.cjs +8 -10
  118. package/dist/components/ui/index.cjs.map +1 -1
  119. package/dist/components/ui/index.js +7 -9
  120. package/dist/components/ui/palette-badge.d.ts +6 -8
  121. package/dist/components/ui/palette-badge.d.ts.map +1 -1
  122. package/dist/components/ui/status-badge.d.ts +1 -1
  123. package/dist/components/ui/status-badge.d.ts.map +1 -1
  124. package/dist/hooks/index.cjs +5 -5
  125. package/dist/hooks/index.js +4 -4
  126. package/dist/index.cjs +18 -18
  127. package/dist/index.cjs.map +1 -1
  128. package/dist/index.js +46 -46
  129. package/dist/types/department.d.ts +1 -1
  130. package/dist/types/department.d.ts.map +1 -1
  131. package/dist/utils/badge-palette.d.ts +18 -0
  132. package/dist/utils/badge-palette.d.ts.map +1 -0
  133. package/dist/utils/index.cjs +21 -24
  134. package/dist/utils/index.cjs.map +1 -1
  135. package/dist/utils/index.d.ts +1 -1
  136. package/dist/utils/index.d.ts.map +1 -1
  137. package/dist/utils/index.js +19 -22
  138. package/dist/utils/index.js.map +1 -1
  139. package/package.json +1 -1
  140. package/src/components/ui/.department-badge.md +2 -2
  141. package/src/components/ui/.palette-badge.md +2 -2
  142. package/src/components/ui/.status-badge.md +2 -2
  143. package/src/components/ui/__tests__/department-badge.test.tsx +23 -21
  144. package/src/components/ui/color-preset-select.tsx +21 -5
  145. package/src/components/ui/department-badge.tsx +3 -3
  146. package/src/components/ui/palette-badge.tsx +8 -13
  147. package/src/components/ui/status-badge.tsx +5 -0
  148. package/src/types/department.ts +1 -1
  149. package/src/utils/.badge-palette.md +2 -0
  150. package/src/utils/badge-palette.ts +38 -0
  151. package/src/utils/index.ts +2 -1
  152. package/dist/chunk-2J7EFH4V.js.map +0 -1
  153. package/dist/chunk-4E7XCEV3.cjs.map +0 -1
  154. package/dist/chunk-55X46LKR.cjs.map +0 -1
  155. package/dist/chunk-CP3R4GRA.cjs.map +0 -1
  156. package/dist/chunk-DDUG42FK.cjs.map +0 -1
  157. package/dist/chunk-F4JGAGI3.cjs.map +0 -1
  158. package/dist/chunk-KAG3SX3R.cjs.map +0 -1
  159. package/dist/chunk-L5FEAOGJ.js.map +0 -1
  160. package/dist/chunk-ZI27ALYX.cjs.map +0 -1
  161. package/dist/chunk-ZYDNPUSH.cjs.map +0 -1
  162. package/dist/utils/color-presets.d.ts +0 -24
  163. package/dist/utils/color-presets.d.ts.map +0 -1
  164. package/src/utils/.color-presets.md +0 -2
  165. package/src/utils/color-presets.ts +0 -48
  166. /package/dist/{chunk-NBM7ZB6T.js.map → chunk-2MXKO5BN.js.map} +0 -0
  167. /package/dist/{chunk-MIOE7FYN.js.map → chunk-4VPCIREO.js.map} +0 -0
  168. /package/dist/{chunk-ZOMGXH7C.js.map → chunk-BVQEU5JB.js.map} +0 -0
  169. /package/dist/{chunk-LZB2UZJY.js.map → chunk-D5CKXMMC.js.map} +0 -0
  170. /package/dist/{chunk-X5NN4NJM.js.map → chunk-F2KBCLUG.js.map} +0 -0
  171. /package/dist/{chunk-5BUEB2WQ.js.map → chunk-GR3WOOM7.js.map} +0 -0
  172. /package/dist/{chunk-65IVNHBS.js.map → chunk-LQLL4S4V.js.map} +0 -0
  173. /package/dist/{chunk-CIRD5P4U.js.map → chunk-MOB5AA3X.js.map} +0 -0
  174. /package/dist/{chunk-LUBIWC3N.js.map → chunk-MTLDYBXK.js.map} +0 -0
  175. /package/dist/{chunk-7ZDPJ6SW.js.map → chunk-OXTV63QO.js.map} +0 -0
  176. /package/dist/{chunk-WYELOUP4.js.map → chunk-PFBMVQ5R.js.map} +0 -0
  177. /package/dist/{chunk-SOUGXQJE.js.map → chunk-PJZYJDR7.js.map} +0 -0
  178. /package/dist/{chunk-76HB456V.js.map → chunk-S6WBBSII.js.map} +0 -0
  179. /package/dist/{chunk-BS6ASI3D.js.map → chunk-SCPJ53CM.js.map} +0 -0
  180. /package/dist/{chunk-J6ATJUEE.js.map → chunk-WBZ4HP7D.js.map} +0 -0
  181. /package/dist/{chunk-32P6KUZP.js.map → chunk-X3LC6R37.js.map} +0 -0
  182. /package/dist/{chunk-CMUNJZWN.js.map → chunk-YQCA4ZEJ.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useOptionalTicketLive
4
- } from "./chunk-7ZDPJ6SW.js";
4
+ } from "./chunk-OXTV63QO.js";
5
5
  import {
6
6
  AppLayoutDrawerContainerContext,
7
7
  AppLayoutDrawerCoordinationContext,
@@ -13,21 +13,21 @@ import {
13
13
  UnreadDot,
14
14
  buildTicketOpenHref,
15
15
  useOptionalNotifications
16
- } from "./chunk-NDIPDU36.js";
16
+ } from "./chunk-QGWBMPQY.js";
17
17
  import {
18
18
  useFocusTrap,
19
19
  useLocalStorage
20
- } from "./chunk-76HB456V.js";
20
+ } from "./chunk-S6WBBSII.js";
21
21
  import {
22
22
  OVERLAY_BACKDROP_CLASS,
23
23
  useIsHydrated
24
- } from "./chunk-L5FEAOGJ.js";
24
+ } from "./chunk-ON7663OW.js";
25
25
  import {
26
26
  useHeaderHeight,
27
27
  useIsomorphicLayoutEffect,
28
28
  useLgUp,
29
29
  useMdUp
30
- } from "./chunk-JRYS4VMV.js";
30
+ } from "./chunk-5LIDR7HL.js";
31
31
  import {
32
32
  LogOutIcon,
33
33
  MingoIcon,
@@ -47,7 +47,7 @@ import {
47
47
  } from "./chunk-IMDG23LW.js";
48
48
  import {
49
49
  SquareAvatar
50
- } from "./chunk-2J7EFH4V.js";
50
+ } from "./chunk-QS2QCXBH.js";
51
51
  import {
52
52
  OpenFrameLogo
53
53
  } from "./chunk-OTX6XNSA.js";
@@ -1890,4 +1890,4 @@ export {
1890
1890
  MobileBurgerMenu,
1891
1891
  AppLayout
1892
1892
  };
1893
- //# sourceMappingURL=chunk-CIRD5P4U.js.map
1893
+ //# sourceMappingURL=chunk-MOB5AA3X.js.map
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  ArticleAuthorByline,
4
4
  DetailPageSkeleton
5
- } from "./chunk-BS6ASI3D.js";
5
+ } from "./chunk-SCPJ53CM.js";
6
6
  import {
7
7
  DocSearchBar,
8
8
  useDocSearch
9
- } from "./chunk-WYELOUP4.js";
9
+ } from "./chunk-PFBMVQ5R.js";
10
10
  import {
11
11
  useSelfFetch
12
- } from "./chunk-X5NN4NJM.js";
12
+ } from "./chunk-F2KBCLUG.js";
13
13
  import {
14
14
  EntityTagBadges,
15
15
  FilterPillRow,
@@ -18,13 +18,13 @@ import {
18
18
  PageShell,
19
19
  RichMarkdownRenderer,
20
20
  resolveContentHref
21
- } from "./chunk-NDIPDU36.js";
21
+ } from "./chunk-QGWBMPQY.js";
22
22
  import {
23
23
  EntityVideoSection,
24
24
  VideoBitesStrip,
25
25
  useCaptions,
26
26
  useVideoWarmup
27
- } from "./chunk-L5FEAOGJ.js";
27
+ } from "./chunk-ON7663OW.js";
28
28
  import {
29
29
  useRouter,
30
30
  useSearchParams
@@ -34,10 +34,10 @@ import {
34
34
  OnboardingGuideCard,
35
35
  OnboardingGuideCardSkeleton,
36
36
  toStripProfile
37
- } from "./chunk-2J7EFH4V.js";
37
+ } from "./chunk-QS2QCXBH.js";
38
38
  import {
39
39
  buildOgPlaceholderUrl
40
- } from "./chunk-USIRWQJ3.js";
40
+ } from "./chunk-FKBM6U43.js";
41
41
  import {
42
42
  useChatRuntime
43
43
  } from "./chunk-YB6FI2G3.js";
@@ -389,4 +389,4 @@ export {
389
389
  useOnboardingGuide,
390
390
  useOnboardingGuideSections
391
391
  };
392
- //# sourceMappingURL=chunk-LUBIWC3N.js.map
392
+ //# sourceMappingURL=chunk-MTLDYBXK.js.map
@@ -4,6 +4,7 @@ import {
4
4
  NEAR_VIEWPORT_ROOT_MARGIN,
5
5
  STICKY_HEADER_OFFSET_PX,
6
6
  ToolIcon,
7
+ clamp,
7
8
  createFenceTracker,
8
9
  createHeadingIdDeduper,
9
10
  getHashTargetElement,
@@ -21,7 +22,7 @@ import {
21
22
  useNearViewport,
22
23
  useResetOnPageHidden,
23
24
  useSuppressCloneFocus
24
- } from "./chunk-JRYS4VMV.js";
25
+ } from "./chunk-5LIDR7HL.js";
25
26
  import {
26
27
  useRouter
27
28
  } from "./chunk-XXMHLZ3Y.js";
@@ -154,8 +155,6 @@ import {
154
155
  canonicalContentRefType,
155
156
  computeIsNewTab,
156
157
  defaultBuildProductReleaseCardProps,
157
- deriveActiveColor,
158
- deriveHoverColor,
159
158
  extractItemId,
160
159
  extractItems,
161
160
  formatDateShort,
@@ -166,7 +165,6 @@ import {
166
165
  formatInvestorUpdatePeriod,
167
166
  formatTimeWithTimezone,
168
167
  getProxiedImageUrl,
169
- getReadableTextColor,
170
168
  getStatusColorScheme,
171
169
  isSameOriginAbsoluteHref,
172
170
  newTabAnchorAttrs,
@@ -174,18 +172,20 @@ import {
174
172
  safeHref,
175
173
  sortBitesByCreatedAtDesc,
176
174
  useCoverImageFallback
177
- } from "./chunk-2J7EFH4V.js";
175
+ } from "./chunk-QS2QCXBH.js";
178
176
  import {
179
177
  next_image_default
180
178
  } from "./chunk-MDKCTSDS.js";
181
179
  import {
182
- clamp,
180
+ PLATFORM_THEME,
183
181
  createLocalStorageAdapter,
184
182
  embedAuthedFetch,
185
183
  getEmbedProxyAuth,
184
+ getPlatformAccentColor,
185
+ getPlatformDisplayName,
186
186
  useAuthedAssetSrc,
187
187
  useAuthedImageSrc
188
- } from "./chunk-USIRWQJ3.js";
188
+ } from "./chunk-FKBM6U43.js";
189
189
  import {
190
190
  OpenFrameLogo
191
191
  } from "./chunk-OTX6XNSA.js";
@@ -3878,6 +3878,332 @@ function PlusCircleIcon2({ className, whiteOverlay = false, iconSize = 24, ...pr
3878
3878
  );
3879
3879
  }
3880
3880
 
3881
+ // src/utils/color-analysis.ts
3882
+ var DESIGN_PALETTE = [
3883
+ { name: "yellow", hex: "#FFC008", rgb: [255, 192, 8] },
3884
+ { name: "black", hex: "#161616", rgb: [22, 22, 22] },
3885
+ { name: "gray", hex: "#888888", rgb: [136, 136, 136] }
3886
+ ];
3887
+ function hexToRgb(hex) {
3888
+ const normalized = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (_, r, g, b) => `${r}${r}${g}${g}${b}${b}`);
3889
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(normalized);
3890
+ return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : [0, 0, 0];
3891
+ }
3892
+ function getLuminance(rgb) {
3893
+ const [r, g, b] = rgb.map((channel) => {
3894
+ const c = channel / 255;
3895
+ return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
3896
+ });
3897
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
3898
+ }
3899
+ function getContrastRatio(color1, color2) {
3900
+ const lum1 = getLuminance(color1);
3901
+ const lum2 = getLuminance(color2);
3902
+ const brightest = Math.max(lum1, lum2);
3903
+ const darkest = Math.min(lum1, lum2);
3904
+ return (brightest + 0.05) / (darkest + 0.05);
3905
+ }
3906
+ function pickReadableTextColor(bgHex) {
3907
+ const bg = hexToRgb(bgHex);
3908
+ const darkContrast = getContrastRatio(bg, [26, 26, 26]);
3909
+ const lightContrast = getContrastRatio(bg, [250, 250, 250]);
3910
+ return darkContrast >= lightContrast ? "dark" : "light";
3911
+ }
3912
+ function extractDominantColor(canvas) {
3913
+ const ctx = canvas.getContext("2d");
3914
+ if (!ctx) return [128, 128, 128];
3915
+ const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
3916
+ const data = imageData.data;
3917
+ const sampleSize = Math.max(1, Math.floor(data.length / (4 * 1e3)));
3918
+ const colorCounts = {};
3919
+ for (let i = 0; i < data.length; i += 4 * sampleSize) {
3920
+ const r = data[i];
3921
+ const g = data[i + 1];
3922
+ const b = data[i + 2];
3923
+ const alpha = data[i + 3];
3924
+ if (alpha < 128) continue;
3925
+ const bucketR = Math.round(r / 32) * 32;
3926
+ const bucketG = Math.round(g / 32) * 32;
3927
+ const bucketB = Math.round(b / 32) * 32;
3928
+ const key = `${bucketR},${bucketG},${bucketB}`;
3929
+ colorCounts[key] = (colorCounts[key] || 0) + 1;
3930
+ }
3931
+ let maxCount = 0;
3932
+ let dominantColor = [128, 128, 128];
3933
+ for (const [colorKey, count] of Object.entries(colorCounts)) {
3934
+ if (count > maxCount) {
3935
+ maxCount = count;
3936
+ const [r, g, b] = colorKey.split(",").map(Number);
3937
+ dominantColor = [r, g, b];
3938
+ }
3939
+ }
3940
+ return dominantColor;
3941
+ }
3942
+ function getBestContrastColor(imageColor) {
3943
+ let bestColor = DESIGN_PALETTE[0];
3944
+ let bestContrast = 0;
3945
+ for (const color of DESIGN_PALETTE) {
3946
+ const contrast = getContrastRatio(imageColor, color.rgb);
3947
+ if (contrast > bestContrast) {
3948
+ bestContrast = contrast;
3949
+ bestColor = color;
3950
+ }
3951
+ }
3952
+ return bestContrast >= 3 ? bestColor : DESIGN_PALETTE.find((c) => c.name === "black") || bestColor;
3953
+ }
3954
+ function analyzeImageColor(imageSrc) {
3955
+ return new Promise((resolve, reject) => {
3956
+ const img = new Image();
3957
+ img.crossOrigin = "anonymous";
3958
+ img.onload = () => {
3959
+ try {
3960
+ const canvas = document.createElement("canvas");
3961
+ const ctx = canvas.getContext("2d");
3962
+ if (!ctx) {
3963
+ reject(new Error("Could not get canvas context"));
3964
+ return;
3965
+ }
3966
+ const maxSize = 100;
3967
+ const scale = Math.min(maxSize / img.width, maxSize / img.height);
3968
+ canvas.width = img.width * scale;
3969
+ canvas.height = img.height * scale;
3970
+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
3971
+ const dominantColor = extractDominantColor(canvas);
3972
+ const bestContrastColor = getBestContrastColor(dominantColor);
3973
+ resolve(bestContrastColor);
3974
+ } catch (error) {
3975
+ reject(error);
3976
+ }
3977
+ };
3978
+ img.onerror = () => reject(new Error("Failed to load image"));
3979
+ img.src = imageSrc;
3980
+ });
3981
+ }
3982
+ async function extractImageEdgeColorAsync(imageUrl) {
3983
+ return new Promise((resolve) => {
3984
+ if (typeof window === "undefined") {
3985
+ resolve("#000000");
3986
+ return;
3987
+ }
3988
+ const img = new Image();
3989
+ img.crossOrigin = "anonymous";
3990
+ img.onload = () => {
3991
+ try {
3992
+ const canvas = document.createElement("canvas");
3993
+ const ctx = canvas.getContext("2d");
3994
+ if (!ctx) {
3995
+ resolve("#000000");
3996
+ return;
3997
+ }
3998
+ const maxSize = 50;
3999
+ const scale = Math.min(maxSize / img.naturalWidth, maxSize / img.naturalHeight);
4000
+ const w = Math.round(img.naturalWidth * scale);
4001
+ const h = Math.round(img.naturalHeight * scale);
4002
+ canvas.width = w;
4003
+ canvas.height = h;
4004
+ ctx.drawImage(img, 0, 0, w, h);
4005
+ const data = ctx.getImageData(0, 0, w, h).data;
4006
+ const edgeW = Math.max(2, Math.round(w * 0.15));
4007
+ const edgeH = Math.max(2, Math.round(h * 0.15));
4008
+ const bucketSize = 32;
4009
+ const buckets = /* @__PURE__ */ new Map();
4010
+ for (let y = 0; y < h; y++) {
4011
+ for (let x = 0; x < w; x++) {
4012
+ if (!(x < edgeW || x >= w - edgeW || y < edgeH || y >= h - edgeH)) continue;
4013
+ const i = (y * w + x) * 4;
4014
+ if (data[i + 3] < 128) continue;
4015
+ const br = Math.floor(data[i] / bucketSize) * bucketSize;
4016
+ const bg = Math.floor(data[i + 1] / bucketSize) * bucketSize;
4017
+ const bb = Math.floor(data[i + 2] / bucketSize) * bucketSize;
4018
+ const key = `${br},${bg},${bb}`;
4019
+ const existing = buckets.get(key);
4020
+ if (existing) {
4021
+ existing.r += data[i];
4022
+ existing.g += data[i + 1];
4023
+ existing.b += data[i + 2];
4024
+ existing.count++;
4025
+ } else {
4026
+ buckets.set(key, { r: data[i], g: data[i + 1], b: data[i + 2], count: 1 });
4027
+ }
4028
+ }
4029
+ }
4030
+ let best = { r: 0, g: 0, b: 0, count: 0 };
4031
+ for (const b2 of buckets.values()) {
4032
+ if (b2.count > best.count) best = b2;
4033
+ }
4034
+ if (best.count === 0) {
4035
+ resolve("#000000");
4036
+ return;
4037
+ }
4038
+ const r = Math.round(best.r / best.count), g = Math.round(best.g / best.count), b = Math.round(best.b / best.count);
4039
+ resolve(
4040
+ `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`
4041
+ );
4042
+ } catch {
4043
+ resolve("#000000");
4044
+ }
4045
+ };
4046
+ img.onerror = () => resolve("#000000");
4047
+ img.src = imageUrl;
4048
+ });
4049
+ }
4050
+
4051
+ // src/utils/ods-color-tokens-stub.ts
4052
+ var colorTokens = {
4053
+ primary: "#FFC008",
4054
+ secondary: "#161616",
4055
+ background: "#FAFAFA",
4056
+ surface: "#FFFFFF",
4057
+ text: {
4058
+ primary: "#161616",
4059
+ secondary: "#666666",
4060
+ inverse: "#FFFFFF"
4061
+ },
4062
+ border: "#E5E5E5"
4063
+ };
4064
+
4065
+ // src/utils/ods-color-utils.ts
4066
+ var TOKEN_MAP = colorTokens;
4067
+ function lookupToken(tokenKey) {
4068
+ const value = TOKEN_MAP[tokenKey];
4069
+ return typeof value === "string" ? value : void 0;
4070
+ }
4071
+ function getODSToken(category, color, variant = "base") {
4072
+ const tokenKey = `${category}-${color}-${variant}`;
4073
+ return lookupToken(tokenKey);
4074
+ }
4075
+ function getCurrentPlatform() {
4076
+ if (typeof window === "undefined") {
4077
+ return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
4078
+ }
4079
+ const domPlatform = document.documentElement.getAttribute("data-app-type");
4080
+ if (domPlatform) {
4081
+ return domPlatform;
4082
+ }
4083
+ return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
4084
+ }
4085
+ function switchPlatformTheme(platform) {
4086
+ if (typeof window === "undefined") return;
4087
+ const root = document.documentElement;
4088
+ root.setAttribute("data-app-type", platform);
4089
+ window.dispatchEvent(
4090
+ new CustomEvent("platformThemeChanged", {
4091
+ detail: { platform }
4092
+ })
4093
+ );
4094
+ }
4095
+ function getSemanticColor(semanticName, platform) {
4096
+ if (typeof window === "undefined") return void 0;
4097
+ const currentPlatform = platform || getCurrentPlatform();
4098
+ const originalPlatform = getCurrentPlatform();
4099
+ if (currentPlatform !== originalPlatform) {
4100
+ switchPlatformTheme(currentPlatform);
4101
+ }
4102
+ const testElement = document.createElement("div");
4103
+ document.body.appendChild(testElement);
4104
+ const computedStyle = getComputedStyle(testElement);
4105
+ const colorValue = computedStyle.getPropertyValue(`--color-${semanticName}`);
4106
+ document.body.removeChild(testElement);
4107
+ if (currentPlatform !== originalPlatform) {
4108
+ switchPlatformTheme(originalPlatform);
4109
+ }
4110
+ return colorValue.trim() || void 0;
4111
+ }
4112
+ function getPlatformConfig(platform) {
4113
+ const currentPlatform = platform || getCurrentPlatform();
4114
+ const isDarkTheme = PLATFORM_THEME === "dark";
4115
+ return {
4116
+ platform: currentPlatform,
4117
+ accentColor: getPlatformAccentColor(currentPlatform),
4118
+ isDarkTheme,
4119
+ isLightTheme: !isDarkTheme,
4120
+ brandName: getPlatformDisplayName(currentPlatform)
4121
+ };
4122
+ }
4123
+ function usePlatformColors(platform) {
4124
+ const currentPlatform = platform || getCurrentPlatform();
4125
+ const config = getPlatformConfig(currentPlatform);
4126
+ return {
4127
+ platform: currentPlatform,
4128
+ accentColor: config.accentColor,
4129
+ isDarkTheme: config.isDarkTheme,
4130
+ isLightTheme: config.isLightTheme,
4131
+ brandName: config.brandName,
4132
+ getToken: (category, color, variant) => getODSToken(category, color, variant),
4133
+ switchTheme: (newPlatform) => switchPlatformTheme(newPlatform),
4134
+ getSemanticColor: (semanticName) => getSemanticColor(semanticName, currentPlatform)
4135
+ };
4136
+ }
4137
+ function getReadableTextColor(hex) {
4138
+ return pickReadableTextColor(hex) === "dark" ? "#212121" : "#fafafa";
4139
+ }
4140
+ var HEX_PATTERN = /^#[0-9a-fA-F]{6}$/;
4141
+ function hexToRgb2(hex) {
4142
+ if (!HEX_PATTERN.test(hex)) return null;
4143
+ const n = Number.parseInt(hex.slice(1), 16);
4144
+ return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255 };
4145
+ }
4146
+ function rgbToHex(r, g, b) {
4147
+ const to = (n) => clamp(Math.round(n), 0, 255).toString(16).padStart(2, "0");
4148
+ return `#${to(r)}${to(g)}${to(b)}`;
4149
+ }
4150
+ var HOVER_DARKEN_STEP = 10;
4151
+ var ACTIVE_DARKEN_STEP = 20;
4152
+ function darkenByStep(hex, step) {
4153
+ const rgb = hexToRgb2(hex);
4154
+ if (!rgb) return hex;
4155
+ return rgbToHex(rgb.r - step, rgb.g - step, rgb.b - step);
4156
+ }
4157
+ function deriveHoverColor(hex) {
4158
+ return darkenByStep(hex, HOVER_DARKEN_STEP);
4159
+ }
4160
+ function deriveActiveColor(hex) {
4161
+ return darkenByStep(hex, ACTIVE_DARKEN_STEP);
4162
+ }
4163
+ function rgbToHsl(r, g, b) {
4164
+ const rn = r / 255;
4165
+ const gn = g / 255;
4166
+ const bn = b / 255;
4167
+ const max = Math.max(rn, gn, bn);
4168
+ const min = Math.min(rn, gn, bn);
4169
+ const l = (max + min) / 2;
4170
+ if (max === min) return { h: 0, s: 0, l: Math.round(l * 100) };
4171
+ const d = max - min;
4172
+ const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
4173
+ let h;
4174
+ if (max === rn) h = (gn - bn) / d + (gn < bn ? 6 : 0);
4175
+ else if (max === gn) h = (bn - rn) / d + 2;
4176
+ else h = (rn - gn) / d + 4;
4177
+ h *= 60;
4178
+ return { h: Math.round(h), s: Math.round(s * 100), l: Math.round(l * 100) };
4179
+ }
4180
+ function hslToRgb(h, s, l) {
4181
+ const sn = clamp(s, 0, 100) / 100;
4182
+ const ln = clamp(l, 0, 100) / 100;
4183
+ const hn = (h % 360 + 360) % 360;
4184
+ if (sn === 0) {
4185
+ const v = Math.round(ln * 255);
4186
+ return { r: v, g: v, b: v };
4187
+ }
4188
+ const q = ln < 0.5 ? ln * (1 + sn) : ln + sn - ln * sn;
4189
+ const p = 2 * ln - q;
4190
+ const hue2rgb = (t) => {
4191
+ let tn = t;
4192
+ if (tn < 0) tn += 1;
4193
+ if (tn > 1) tn -= 1;
4194
+ if (tn < 1 / 6) return p + (q - p) * 6 * tn;
4195
+ if (tn < 1 / 2) return q;
4196
+ if (tn < 2 / 3) return p + (q - p) * (2 / 3 - tn) * 6;
4197
+ return p;
4198
+ };
4199
+ const hk = hn / 360;
4200
+ return {
4201
+ r: Math.round(hue2rgb(hk + 1 / 3) * 255),
4202
+ g: Math.round(hue2rgb(hk) * 255),
4203
+ b: Math.round(hue2rgb(hk - 1 / 3) * 255)
4204
+ };
4205
+ }
4206
+
3881
4207
  // src/components/ui/actions-menu.tsx
3882
4208
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3883
4209
  import { useControllableState } from "@radix-ui/react-use-controllable-state";
@@ -25256,6 +25582,26 @@ export {
25256
25582
  isToday,
25257
25583
  isWithinMinutes,
25258
25584
  createUTCTimestamp,
25585
+ DESIGN_PALETTE,
25586
+ getContrastRatio,
25587
+ pickReadableTextColor,
25588
+ extractDominantColor,
25589
+ getBestContrastColor,
25590
+ analyzeImageColor,
25591
+ extractImageEdgeColorAsync,
25592
+ getCurrentPlatform,
25593
+ switchPlatformTheme,
25594
+ getSemanticColor,
25595
+ getPlatformConfig,
25596
+ usePlatformColors,
25597
+ getReadableTextColor,
25598
+ HEX_PATTERN,
25599
+ hexToRgb2 as hexToRgb,
25600
+ rgbToHex,
25601
+ deriveHoverColor,
25602
+ deriveActiveColor,
25603
+ rgbToHsl,
25604
+ hslToRgb,
25259
25605
  ActionsMenu,
25260
25606
  ActionsMenuDropdown,
25261
25607
  ColorSwatch,
@@ -25601,4 +25947,4 @@ export {
25601
25947
  buildStreamFrames,
25602
25948
  EmbeddableChat
25603
25949
  };
25604
- //# sourceMappingURL=chunk-L5FEAOGJ.js.map
25950
+ //# sourceMappingURL=chunk-ON7663OW.js.map