@flamingo-stack/openframe-frontend-core 0.0.285 → 0.0.286-snapshot.20260618154650

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 (224) hide show
  1. package/dist/chunk-3MCHAFHB.js +89 -0
  2. package/dist/chunk-3MCHAFHB.js.map +1 -0
  3. package/dist/chunk-3SDBXXDP.cjs +1594 -0
  4. package/dist/chunk-3SDBXXDP.cjs.map +1 -0
  5. package/dist/{chunk-IMNGGLKL.js → chunk-3ZXUQQL4.js} +2 -2
  6. package/dist/chunk-5KD3S25X.cjs +312 -0
  7. package/dist/chunk-5KD3S25X.cjs.map +1 -0
  8. package/dist/{chunk-44ZFLMYC.cjs → chunk-6AW25OS6.cjs} +30 -30
  9. package/dist/{chunk-44ZFLMYC.cjs.map → chunk-6AW25OS6.cjs.map} +1 -1
  10. package/dist/{chunk-XDI5JSWB.cjs → chunk-6CSW5TMS.cjs} +45 -41
  11. package/dist/chunk-6CSW5TMS.cjs.map +1 -0
  12. package/dist/chunk-7EYWERFT.js +1594 -0
  13. package/dist/chunk-7EYWERFT.js.map +1 -0
  14. package/dist/{chunk-XX7P4IL2.js → chunk-7NM7DEUK.js} +4 -143
  15. package/dist/chunk-7NM7DEUK.js.map +1 -0
  16. package/dist/{chunk-GVSTRN36.cjs → chunk-D3LEFMOA.cjs} +3 -3
  17. package/dist/{chunk-GVSTRN36.cjs.map → chunk-D3LEFMOA.cjs.map} +1 -1
  18. package/dist/chunk-D6RK5YXX.cjs +2439 -0
  19. package/dist/chunk-D6RK5YXX.cjs.map +1 -0
  20. package/dist/{chunk-VQW7CEGS.js → chunk-EFYXPR43.js} +1831 -3672
  21. package/dist/chunk-EFYXPR43.js.map +1 -0
  22. package/dist/{chunk-PVXCVPJD.cjs → chunk-EI4WALN2.cjs} +67 -1626
  23. package/dist/chunk-EI4WALN2.cjs.map +1 -0
  24. package/dist/{chunk-ZIODAAFY.cjs → chunk-EL5GCMPU.cjs} +20 -159
  25. package/dist/chunk-EL5GCMPU.cjs.map +1 -0
  26. package/dist/{chunk-53CFL7PH.js → chunk-GJDXIVEQ.js} +11 -7
  27. package/dist/{chunk-53CFL7PH.js.map → chunk-GJDXIVEQ.js.map} +1 -1
  28. package/dist/chunk-I6ZPGKZ2.cjs +151 -0
  29. package/dist/chunk-I6ZPGKZ2.cjs.map +1 -0
  30. package/dist/{chunk-P45Q4QCU.cjs → chunk-JQ4I743L.cjs} +19 -15
  31. package/dist/chunk-JQ4I743L.cjs.map +1 -0
  32. package/dist/{chunk-J66U3LPZ.cjs → chunk-KBKZYJRI.cjs} +33 -332
  33. package/dist/chunk-KBKZYJRI.cjs.map +1 -0
  34. package/dist/chunk-MV67MBV3.js +290 -0
  35. package/dist/chunk-MV67MBV3.js.map +1 -0
  36. package/dist/chunk-MWS25U4U.cjs +290 -0
  37. package/dist/chunk-MWS25U4U.cjs.map +1 -0
  38. package/dist/{chunk-USPATRSC.js → chunk-N6ZM5PYZ.js} +45 -344
  39. package/dist/chunk-N6ZM5PYZ.js.map +1 -0
  40. package/dist/chunk-ODR6A6FC.js +2439 -0
  41. package/dist/chunk-ODR6A6FC.js.map +1 -0
  42. package/dist/{chunk-DPKUSBQH.cjs → chunk-OXC72UIP.cjs} +1073 -2914
  43. package/dist/chunk-OXC72UIP.cjs.map +1 -0
  44. package/dist/{chunk-RGALV4UX.js → chunk-POKKCWKF.js} +3 -82
  45. package/dist/chunk-POKKCWKF.js.map +1 -0
  46. package/dist/{chunk-Z3V2SGQZ.js → chunk-R2KT5GDD.js} +324 -1883
  47. package/dist/chunk-R2KT5GDD.js.map +1 -0
  48. package/dist/{chunk-RJUGNL2A.cjs → chunk-RG6FNZUA.cjs} +73 -31
  49. package/dist/chunk-RG6FNZUA.cjs.map +1 -0
  50. package/dist/{chunk-23UOJUDF.js → chunk-RWCA2ZQK.js} +4 -4
  51. package/dist/chunk-TFSYSWPS.cjs +89 -0
  52. package/dist/chunk-TFSYSWPS.cjs.map +1 -0
  53. package/dist/{chunk-KNCDUWY2.js → chunk-TY2EB7VK.js} +65 -23
  54. package/dist/chunk-TY2EB7VK.js.map +1 -0
  55. package/dist/chunk-TYZEMPPH.js +312 -0
  56. package/dist/chunk-TYZEMPPH.js.map +1 -0
  57. package/dist/chunk-VRSXJ5QJ.js +1599 -0
  58. package/dist/chunk-VRSXJ5QJ.js.map +1 -0
  59. package/dist/chunk-Y4JNA4W6.cjs +1599 -0
  60. package/dist/chunk-Y4JNA4W6.cjs.map +1 -0
  61. package/dist/{chunk-ZSUNQJRO.cjs → chunk-YETA25JW.cjs} +2 -81
  62. package/dist/chunk-YETA25JW.cjs.map +1 -0
  63. package/dist/chunk-ZLN6SM2U.js +151 -0
  64. package/dist/chunk-ZLN6SM2U.js.map +1 -0
  65. package/dist/{chunk-O5N57CRV.js → chunk-ZYLQMCHW.js} +12 -8
  66. package/dist/{chunk-O5N57CRV.js.map → chunk-ZYLQMCHW.js.map} +1 -1
  67. package/dist/components/chat/chat-attachment-bar.d.ts.map +1 -1
  68. package/dist/components/chat/index.cjs +12 -6
  69. package/dist/components/chat/index.cjs.map +1 -1
  70. package/dist/components/chat/index.js +45 -39
  71. package/dist/components/contact/index.cjs +11 -7
  72. package/dist/components/contact/index.cjs.map +1 -1
  73. package/dist/components/contact/index.js +10 -6
  74. package/dist/components/docs/doc-navigation-context.d.ts +39 -0
  75. package/dist/components/docs/doc-navigation-context.d.ts.map +1 -0
  76. package/dist/components/docs/doc-viewer.d.ts +66 -0
  77. package/dist/components/docs/doc-viewer.d.ts.map +1 -0
  78. package/dist/components/docs/index.cjs +34 -0
  79. package/dist/components/docs/index.cjs.map +1 -0
  80. package/dist/components/docs/index.d.ts +8 -0
  81. package/dist/components/docs/index.d.ts.map +1 -0
  82. package/dist/components/docs/index.js +34 -0
  83. package/dist/components/docs/index.js.map +1 -0
  84. package/dist/components/docs/use-document-tree.d.ts +41 -0
  85. package/dist/components/docs/use-document-tree.d.ts.map +1 -0
  86. package/dist/components/docs/use-scroll-spy.d.ts +16 -0
  87. package/dist/components/docs/use-scroll-spy.d.ts.map +1 -0
  88. package/dist/components/embeds/embed-iframe.d.ts +29 -0
  89. package/dist/components/embeds/embed-iframe.d.ts.map +1 -0
  90. package/dist/components/embeds/figma-embed.d.ts +27 -0
  91. package/dist/components/embeds/figma-embed.d.ts.map +1 -0
  92. package/dist/components/embeds/google-sheets-viewer.d.ts +8 -0
  93. package/dist/components/embeds/google-sheets-viewer.d.ts.map +1 -0
  94. package/dist/components/embeds/index.cjs +37 -0
  95. package/dist/components/embeds/index.cjs.map +1 -0
  96. package/dist/components/embeds/index.d.ts +9 -0
  97. package/dist/components/embeds/index.d.ts.map +1 -0
  98. package/dist/components/embeds/index.js +37 -0
  99. package/dist/components/embeds/index.js.map +1 -0
  100. package/dist/components/embeds/pdf-viewer.d.ts +10 -0
  101. package/dist/components/embeds/pdf-viewer.d.ts.map +1 -0
  102. package/dist/components/faq/faq-section.d.ts.map +1 -1
  103. package/dist/components/faq/index.cjs +12 -8
  104. package/dist/components/faq/index.cjs.map +1 -1
  105. package/dist/components/faq/index.js +11 -7
  106. package/dist/components/faq-accordion.d.ts.map +1 -1
  107. package/dist/components/features/index.cjs +10 -6
  108. package/dist/components/features/index.cjs.map +1 -1
  109. package/dist/components/features/index.js +9 -5
  110. package/dist/components/index.cjs +247 -1120
  111. package/dist/components/index.cjs.map +1 -1
  112. package/dist/components/index.d.ts +2 -0
  113. package/dist/components/index.d.ts.map +1 -1
  114. package/dist/components/index.js +645 -1518
  115. package/dist/components/index.js.map +1 -1
  116. package/dist/components/navigation/index.cjs +15 -6
  117. package/dist/components/navigation/index.cjs.map +1 -1
  118. package/dist/components/navigation/index.d.ts +2 -0
  119. package/dist/components/navigation/index.d.ts.map +1 -1
  120. package/dist/components/navigation/index.js +15 -6
  121. package/dist/components/navigation/multi-level-navigation.d.ts +28 -0
  122. package/dist/components/navigation/multi-level-navigation.d.ts.map +1 -0
  123. package/dist/components/onboarding-guides/index.cjs +34 -29
  124. package/dist/components/onboarding-guides/index.cjs.map +1 -1
  125. package/dist/components/onboarding-guides/index.js +13 -8
  126. package/dist/components/onboarding-guides/index.js.map +1 -1
  127. package/dist/components/related-content/index.cjs +12 -8
  128. package/dist/components/related-content/index.cjs.map +1 -1
  129. package/dist/components/related-content/index.js +11 -7
  130. package/dist/components/tickets/index.cjs +75 -70
  131. package/dist/components/tickets/index.cjs.map +1 -1
  132. package/dist/components/tickets/index.js +16 -11
  133. package/dist/components/tickets/index.js.map +1 -1
  134. package/dist/components/ui/index.cjs +12 -6
  135. package/dist/components/ui/index.cjs.map +1 -1
  136. package/dist/components/ui/index.js +65 -59
  137. package/dist/embed-shims/index.cjs +3 -3
  138. package/dist/embed-shims/index.cjs.map +1 -1
  139. package/dist/embed-shims/index.js +8 -8
  140. package/dist/hooks/index.cjs +6 -3
  141. package/dist/hooks/index.cjs.map +1 -1
  142. package/dist/hooks/index.js +7 -4
  143. package/dist/index.cjs +68 -6
  144. package/dist/index.cjs.map +1 -1
  145. package/dist/index.js +263 -201
  146. package/dist/types/doc-source.cjs +4 -0
  147. package/dist/types/doc-source.cjs.map +1 -0
  148. package/dist/types/doc-source.d.ts +86 -0
  149. package/dist/types/doc-source.d.ts.map +1 -0
  150. package/dist/types/doc-source.js +3 -0
  151. package/dist/types/doc-source.js.map +1 -0
  152. package/dist/types/index.d.ts +1 -0
  153. package/dist/types/index.d.ts.map +1 -1
  154. package/dist/types/marketing.d.ts +1 -1
  155. package/dist/types/marketing.d.ts.map +1 -1
  156. package/dist/utils/doc-path-utils.d.ts +24 -0
  157. package/dist/utils/doc-path-utils.d.ts.map +1 -0
  158. package/dist/utils/doc-tree-nav.d.ts +35 -0
  159. package/dist/utils/doc-tree-nav.d.ts.map +1 -0
  160. package/dist/utils/embed-url-converters.d.ts +16 -0
  161. package/dist/utils/embed-url-converters.d.ts.map +1 -0
  162. package/dist/utils/faq-anchor.d.ts +51 -0
  163. package/dist/utils/faq-anchor.d.ts.map +1 -0
  164. package/dist/utils/format.d.ts +9 -0
  165. package/dist/utils/format.d.ts.map +1 -1
  166. package/dist/utils/index.cjs +320 -1
  167. package/dist/utils/index.cjs.map +1 -1
  168. package/dist/utils/index.d.ts +9 -1
  169. package/dist/utils/index.d.ts.map +1 -1
  170. package/dist/utils/index.js +296 -2
  171. package/dist/utils/index.js.map +1 -1
  172. package/dist/utils/list-url.d.ts.map +1 -1
  173. package/dist/utils/markdown-section-extractor.d.ts +23 -0
  174. package/dist/utils/markdown-section-extractor.d.ts.map +1 -0
  175. package/dist/utils/markdown-to-plain.d.ts +32 -0
  176. package/dist/utils/markdown-to-plain.d.ts.map +1 -0
  177. package/dist/utils/tree-builder.d.ts +30 -0
  178. package/dist/utils/tree-builder.d.ts.map +1 -0
  179. package/package.json +19 -1
  180. package/src/components/chat/chat-attachment-bar.tsx +6 -11
  181. package/src/components/docs/doc-navigation-context.tsx +123 -0
  182. package/src/components/docs/doc-viewer.tsx +345 -0
  183. package/src/components/docs/index.ts +12 -0
  184. package/src/components/docs/use-document-tree.ts +427 -0
  185. package/src/components/docs/use-scroll-spy.ts +93 -0
  186. package/src/components/embeds/embed-iframe.tsx +103 -0
  187. package/src/components/embeds/figma-embed.tsx +147 -0
  188. package/src/components/embeds/google-sheets-viewer.tsx +54 -0
  189. package/src/components/embeds/index.ts +11 -0
  190. package/src/components/embeds/pdf-viewer.tsx +64 -0
  191. package/src/components/faq/faq-section.tsx +78 -26
  192. package/src/components/faq-accordion.tsx +8 -1
  193. package/src/components/index.ts +2 -0
  194. package/src/components/navigation/index.ts +5 -0
  195. package/src/components/navigation/multi-level-navigation.tsx +358 -0
  196. package/src/types/doc-source.ts +88 -0
  197. package/src/types/index.ts +4 -0
  198. package/src/types/marketing.ts +1 -0
  199. package/src/utils/doc-path-utils.ts +47 -0
  200. package/src/utils/doc-tree-nav.ts +111 -0
  201. package/src/utils/embed-url-converters.ts +77 -0
  202. package/src/utils/faq-anchor.ts +70 -0
  203. package/src/utils/format.ts +16 -0
  204. package/src/utils/index.ts +18 -0
  205. package/src/utils/list-url.ts +1 -0
  206. package/src/utils/markdown-section-extractor.ts +106 -0
  207. package/src/utils/markdown-to-plain.ts +69 -0
  208. package/src/utils/tree-builder.ts +114 -0
  209. package/dist/chunk-DPKUSBQH.cjs.map +0 -1
  210. package/dist/chunk-J66U3LPZ.cjs.map +0 -1
  211. package/dist/chunk-KNCDUWY2.js.map +0 -1
  212. package/dist/chunk-P45Q4QCU.cjs.map +0 -1
  213. package/dist/chunk-PVXCVPJD.cjs.map +0 -1
  214. package/dist/chunk-RGALV4UX.js.map +0 -1
  215. package/dist/chunk-RJUGNL2A.cjs.map +0 -1
  216. package/dist/chunk-USPATRSC.js.map +0 -1
  217. package/dist/chunk-VQW7CEGS.js.map +0 -1
  218. package/dist/chunk-XDI5JSWB.cjs.map +0 -1
  219. package/dist/chunk-XX7P4IL2.js.map +0 -1
  220. package/dist/chunk-Z3V2SGQZ.js.map +0 -1
  221. package/dist/chunk-ZIODAAFY.cjs.map +0 -1
  222. package/dist/chunk-ZSUNQJRO.cjs.map +0 -1
  223. /package/dist/{chunk-IMNGGLKL.js.map → chunk-3ZXUQQL4.js.map} +0 -0
  224. /package/dist/{chunk-23UOJUDF.js.map → chunk-RWCA2ZQK.js.map} +0 -0
@@ -23,7 +23,7 @@ export * from './country-phone-utils';
23
23
  export * from './generic-domain-utils';
24
24
  export * from './color-analysis';
25
25
  export { type GetProxiedImageUrlOptions, getProxiedImageUrl, urlPathLooksLikeSvg, shouldProxyImage, generateImageSizes, } from './image-proxy';
26
- export { formatLargeNumber, formatAbbreviatedNumber, nameInitials, getFirstLastInitials, formatDurationMMSS, formatDurationCompact, formatTimeWithTimezone, formatDurationFromRange, type FormatDateUTCOptions, formatDateUTC, formatEntryMonthUTC, formatCurrency, formatPercent, formatWholeDollars, formatLegalDate, formatBytesShort, formatDateTimeAt, formatDurationFromMs, type MetricFormat, type TrendPolarity, formatCompactMetric, getTrendColors, formatDateRange, formatDuration, formatUnderscoreText, stripHtml, formatBioText, formatClassification, formatPricingModel, } from './format';
26
+ export { formatLargeNumber, formatAbbreviatedNumber, nameInitials, getFirstLastInitials, formatDurationMMSS, formatDurationCompact, formatTimeWithTimezone, formatDurationFromRange, type FormatDateUTCOptions, formatDateUTC, formatEntryMonthUTC, formatCurrency, formatPercent, formatWholeDollars, formatLegalDate, formatBytesShort, formatFileSize, formatDateTimeAt, formatDurationFromMs, type MetricFormat, type TrendPolarity, formatCompactMetric, getTrendColors, formatDateRange, formatDuration, formatUnderscoreText, stripHtml, formatBioText, formatClassification, formatPricingModel, } from './format';
27
27
  export { formatRelativeTime, formatAbsoluteDate, formatDateTime, getDetailedTimeDifference, isToday, isWithinMinutes, createUTCTimestamp, formatTicketRelativeTime, formatTicketFullTimestamp, } from './date-utils';
28
28
  export { SOURCE_ICON_NAMES, getSourceIconName, SOURCE_LABELS_BY_TABLE, getSourceLabel, } from './source-icons';
29
29
  export { embedAuthedFetch, setEmbedAuthAdapter, type EmbedAuthAdapter, } from './embed-authed-fetch';
@@ -42,9 +42,17 @@ export { fetchPriorityProp, type FetchPriorityValue } from './fetch-priority';
42
42
  export * from './dev-sections';
43
43
  export { type ScrollElementIntoViewOptions, scrollElementIntoView, } from './scroll-into-view';
44
44
  export { buildListUrl, canonicalContentRefType } from './list-url';
45
+ export { faqSectionSlug, faqItemAnchor, parseFaqHash } from './faq-anchor';
46
+ export type { FaqHashTarget } from './faq-anchor';
45
47
  export { CONTENT_REF_GROUPS, getContentRefLabel, getContentRefLabelOrTitleCase, orderContentRefTypes, type ContentRefGroupConfig, type ContentRefLayout, type ContentRefGridSize, } from './content-ref-groups';
46
48
  export { extractItems, extractItemId } from './extract-items';
47
49
  export { buildSuggestionUrl, type SuggestionUrlOptions } from './suggestion-url';
48
50
  export { DEFAULT_CONTENT_SUFFIXES, makeComposeContentUrl, buildDefaultHref, type ContentHrefOptions, type ComposeContentUrl, } from './content-href';
49
51
  export * from './humanity-signals';
52
+ export * from './doc-path-utils';
53
+ export * from './doc-tree-nav';
54
+ export * from './tree-builder';
55
+ export * from './markdown-section-extractor';
56
+ export * from './markdown-to-plain';
57
+ export * from './embed-url-converters';
50
58
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AAKzB,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAIzF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,2DAA2D,CAAA;AAC1F,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,aAAa,EAClB,WAAW,EAGX,oBAAoB,EACpB,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC5H,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AAEpC,cAAc,oBAAoB,CAAA;AAGlC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,mBAAmB,CAAA;AAGjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAI/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAK9E,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,wBAAwB,IAAI,eAAe,EAAE,M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,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAMlE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC1E,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAKjD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAKhF,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAA;AAMvB,cAAc,oBAAoB,CAAA;AAKlC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA"}
@@ -184,6 +184,13 @@ function formatBytesShort(bytes) {
184
184
  const i = Math.floor(Math.log(bytes) / Math.log(k));
185
185
  return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
186
186
  }
187
+ function formatFileSize(bytes) {
188
+ if (bytes === 0) return "0 B";
189
+ const k = 1024;
190
+ const sizes = ["B", "KB", "MB", "GB"];
191
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
192
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`;
193
+ }
187
194
  function formatLargeNumber(num) {
188
195
  if (num === 0) return "0";
189
196
  const isNegative = num < 0;
@@ -3362,7 +3369,8 @@ var BUILDERS = {
3362
3369
  case_study: (ids, b) => `${b}/api/case-studies?ids=${ids.join(",")}&limit=${ids.length}`,
3363
3370
  product_release: (ids, b) => `${b}/api/releases?ids=${ids.join(",")}&limit=${ids.length}`,
3364
3371
  customer_interview: (ids, b) => `${b}/api/customer-interviews?ids=${ids.join(",")}&limit=${ids.length}`,
3365
- investor_update: (ids, b) => `${b}/api/investor-updates?ids=${ids.join(",")}&limit=${ids.length}`
3372
+ investor_update: (ids, b) => `${b}/api/investor-updates?ids=${ids.join(",")}&limit=${ids.length}`,
3373
+ faq: (ids, b) => `${b}/api/faqs?ids=${ids.join(",")}&limit=${ids.length}`
3366
3374
  };
3367
3375
  function buildListUrl(contentRefType, ids, base = "") {
3368
3376
  if (ids.length === 0) return null;
@@ -3374,6 +3382,24 @@ function buildListUrl(contentRefType, ids, base = "") {
3374
3382
  return fn ? fn(ids, base) : null;
3375
3383
  }
3376
3384
 
3385
+ // src/utils/faq-anchor.ts
3386
+ function faqSectionSlug(section) {
3387
+ return "faq-" + section.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
3388
+ }
3389
+ function faqItemAnchor(id) {
3390
+ return `faq-item-${id}`;
3391
+ }
3392
+ var FAQ_ITEM_HASH_RE = /^faq-item-(\d+)$/;
3393
+ function parseFaqHash(hash) {
3394
+ if (!hash) return null;
3395
+ const trimmed = hash.replace(/^#/, "");
3396
+ if (!trimmed) return null;
3397
+ const itemMatch = FAQ_ITEM_HASH_RE.exec(trimmed);
3398
+ if (itemMatch) return { kind: "item", rawId: itemMatch[1] };
3399
+ if (trimmed.startsWith("faq-")) return { kind: "section", slug: trimmed };
3400
+ return null;
3401
+ }
3402
+
3377
3403
  // src/utils/content-ref-groups.ts
3378
3404
  var CONTENT_REF_GROUPS = {
3379
3405
  investor_update: { label: "Investor Updates", order: 1, layout: "grid", gridSize: "default" },
@@ -3509,6 +3535,274 @@ function evaluateHumanitySignals(body, opts) {
3509
3535
  }
3510
3536
  var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [];
3511
3537
 
3512
- export { ANTHROPIC_SUPPORTED_IMAGE_MIME, AUTO_CONTINUATION_DIRECTIVE_PREFIX, CHAT_ATTACHMENT_MARKDOWN_PATTERN, CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM, CHAT_ATTACHMENT_VIEW_URL_PREFIX, CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED, CONTENT_REF_GROUPS, CUSTOM_ITEM_ID, DEFAULT_CONTENT_SUFFIXES, DEFAULT_MIN_FILL_MS, DEFAULT_OS_PLATFORM, DELIVERY_TASK_TYPE_OPTIONS, DESIGN_PALETTE, DEV_SECTION_PARAM_KEYS, ELAPSED_MS_FIELD, GENERIC_EMAIL_DOMAINS, HEX_PATTERN, HONEYPOT_FIELD, ICON_REGISTRY, OPENFRAME_DEV_SECTIONS, OS_PLATFORMS, PLAY_ICON_PATH, ROADMAP_STATUS_OPTIONS, SCROLL_ANCHOR, SCROLL_ANCHOR_WIRE_KEY, SOURCE_ICON_NAMES, SOURCE_LABELS_BY_TABLE, TICKET_STATUS_OPTIONS, analyzeImageColor, applyProxyAuth, buildAutoContinuationDirective, buildChatAttachmentViewUrl, buildDefaultHref, buildDiscussAddendum, buildListUrl, buildSuggestionUrl, canonicalContentRefType, cleanEmailDomain, clearEmbedProxyAuth, clickupTaskUrl, cn, consumeAccessCode, createUTCTimestamp, deepClone, delay, deriveActiveColor, deriveHoverColor, embedAuthedFetch, escapeMarkdownInline, evaluateHumanitySignals, extractDomainFromEmail, extractDominantColor, extractEntityIdFilter, extractHumanitySignals, extractImageEdgeColorAsync, extractItemId, extractItems, fetchPriorityProp, flattenAssistantContent, formatAbbreviatedNumber, formatAbsoluteDate, formatBioText, formatBytes, formatBytesShort, formatChatAttachmentMarkdownForBubble, formatClassification, formatCompactMetric, formatCurrency, formatDate, formatDateRange, formatDateShort, formatDateSlashUTC, formatDateTime, formatDateTimeAt, formatDateUTC, formatDuration, formatDurationCompact, formatDurationFromMs, formatDurationFromRange, formatDurationMMSS, formatEntryMonthUTC, formatLargeNumber, formatLegalDate, formatNumber, formatPercent, formatPhoneE164, formatPrice, formatPricingModel, formatRelativeTime, formatReleaseDate, formatSingularLookupInvocation, formatTicketFullTimestamp, formatTicketRelativeTime, formatTimeWithTimezone, formatUnderscoreText, formatWholeDollars, generateImageSizes, generateRandomString, getAllPlatformBaseDomains, getBaseUrl, getBestContrastColor, getConfidenceBgClass, getConfidenceBorderClass, getConfidenceColorClass, getConfidenceLabel, getConfidenceLevel, getConfidenceTextClass, getContentRefLabel, getContentRefLabelOrTitleCase, getContrastRatio, getCountryByCode, getCountryPhoneData, getCurrentPlatform, getDefaultColorForPlatform, getDefaultIconForPlatform, getDetailedTimeDifference, getDynamicIcon, getEmbedProxyAuth, getFirstLastInitials, getIconComponent, getOSIcon, getOSLabel, getOSPlatformId, getOSTypeDefinition, getPersistedProxyEmail, getPlatformAccentColor, getPlatformColor, getPlatformDescription, getPlatformDisplayName, getPlatformIcon, getPlatformIconComponent, getPlatformIconComponent as getPlatformLogo, getPlatformProductionUrl, getPlatformSlogan, getProxiedImageUrl, getReadableTextColor, getShellIcon, getShellLabel, getSlackCommunityJoinUrl, getSmallPlatformIcon, getSourceIconName, getSourceLabel, getStatusColorScheme, getTaskTypeLabel, getToolLabel, getToolTypeAliases, getTrendColors, hasGenericEmailDomain, hexToRgb, isCrossOriginUrl, isGenericDomain, isGenericWebsiteDomain, isOSPlatform, isToday, isValidEmailDomain, isValidToolType, isWithinMinutes, makeComposeContentUrl, nameInitials, normalizeDomain, normalizeIconKey, normalizeOSType, normalizeToolType, normalizeToolTypeWithFallback, orderContentRefTypes, parseScrollAnchor, parseWireCommandOverride, platformColors, platformDescriptions, platformDisplayNames, platformHexColors, platformIconNames, platformIcons, platformSlogans, readLeadingDecisionFrame, releaseTypeToBadgeColor, resolveReleaseCover, rgbToHex, sanitizeTitleForChat, scrollElementIntoView, serializeJsonLd, setEmbedAuthAdapter, setEmbedProxyAuth, shouldProxyImage, splitCsvEnv, stripChatAttachmentMarkdown, stripHtml, toToolLabel, transformPlatformConfigsToOptions, truncateString, urlPathLooksLikeSvg, validateAccessCode, validateAndConsumeAccessCode, validateEmailDomain, validateEmailDomainList, validatePhoneNumber };
3538
+ // src/utils/doc-tree-nav.ts
3539
+ var DEFAULT_FOLDER_INDEX_FILE = "README.md";
3540
+ var DEFAULT_FOLDER_INDEX = DEFAULT_FOLDER_INDEX_FILE;
3541
+ function stripFolderIndexFromPath(path, folderIndexFile = DEFAULT_FOLDER_INDEX) {
3542
+ const suffix = `/${folderIndexFile}`;
3543
+ if (path.endsWith(suffix)) return path.slice(0, -suffix.length);
3544
+ if (path === folderIndexFile) return "";
3545
+ return path;
3546
+ }
3547
+ function findDocNodeByPath(path, nodes) {
3548
+ for (const node of nodes) {
3549
+ if (node.path === path) return node;
3550
+ if (node.children) {
3551
+ const found = findDocNodeByPath(path, node.children);
3552
+ if (found) return found;
3553
+ }
3554
+ }
3555
+ return null;
3556
+ }
3557
+ function getDocAncestorNodeIds(nodePath) {
3558
+ const parts = nodePath.split("/");
3559
+ const ids = [];
3560
+ let current = "";
3561
+ for (const part of parts) {
3562
+ current = current ? `${current}-${part}` : part;
3563
+ ids.push(current.toLowerCase());
3564
+ }
3565
+ return ids;
3566
+ }
3567
+ function resolveContentFetchPath(selectedPath, structure, folderIndexFile = DEFAULT_FOLDER_INDEX) {
3568
+ if (selectedPath === "") {
3569
+ return folderIndexFile;
3570
+ }
3571
+ const node = findDocNodeByPath(selectedPath, structure);
3572
+ if (node && node.type === "folder" && !node.hasReadme) {
3573
+ return null;
3574
+ }
3575
+ let pathToFetch = selectedPath;
3576
+ if (node && node.type === "folder" && node.hasReadme) {
3577
+ pathToFetch = `${selectedPath}/${folderIndexFile}`;
3578
+ }
3579
+ return pathToFetch;
3580
+ }
3581
+ function getInitialExpandedNodeIds(cleanInitialPath) {
3582
+ if (!cleanInitialPath) return [];
3583
+ const pathForExpansion = cleanInitialPath.includes(".") ? cleanInitialPath.substring(0, cleanInitialPath.lastIndexOf("/")) : cleanInitialPath;
3584
+ if (!pathForExpansion) return [];
3585
+ return getDocAncestorNodeIds(pathForExpansion);
3586
+ }
3587
+ function getDocSourceDefaultPath(structure, folderIndexFile = DEFAULT_FOLDER_INDEX) {
3588
+ if (!structure.length) return null;
3589
+ const hasRootIndex = structure.some(
3590
+ (node) => node.type === "file" && node.path === folderIndexFile
3591
+ );
3592
+ if (hasRootIndex) return null;
3593
+ const firstFolderWithReadme = structure.find(
3594
+ (node) => node.type === "folder" && node.hasReadme && !!node.path
3595
+ );
3596
+ return firstFolderWithReadme?.path ?? null;
3597
+ }
3598
+
3599
+ // src/utils/doc-path-utils.ts
3600
+ function toDocSlug(name) {
3601
+ return name.trim().toLowerCase().replace(/\s+/g, "-");
3602
+ }
3603
+ function pathToNodeId(path) {
3604
+ return path.replace(/[\/\s]/g, "-").toLowerCase();
3605
+ }
3606
+ function normalizeDocPath(segments, folderIndexFile = DEFAULT_FOLDER_INDEX_FILE) {
3607
+ const lowerPath = (segments?.join("/") || "").toLowerCase();
3608
+ const lowerIndex = folderIndexFile.toLowerCase();
3609
+ const suffix = `/${lowerIndex}`;
3610
+ if (lowerPath.endsWith(suffix)) return lowerPath.slice(0, -suffix.length);
3611
+ if (lowerPath === lowerIndex) return "";
3612
+ return lowerPath;
3613
+ }
3614
+
3615
+ // src/utils/tree-builder.ts
3616
+ function formatDocName(name) {
3617
+ let displayName = name;
3618
+ if (displayName.endsWith(".md")) {
3619
+ displayName = displayName.slice(0, -3);
3620
+ }
3621
+ if (displayName.toLowerCase() === "readme") {
3622
+ return "README";
3623
+ }
3624
+ return displayName.charAt(0).toUpperCase() + displayName.slice(1).replace(/-/g, " ");
3625
+ }
3626
+ function sortTreeChildren(nodes) {
3627
+ nodes.sort((a, b) => {
3628
+ const aIsReadme = a.name.toLowerCase() === "readme" || a.name.toLowerCase() === "readme.md";
3629
+ const bIsReadme = b.name.toLowerCase() === "readme" || b.name.toLowerCase() === "readme.md";
3630
+ if (aIsReadme && !bIsReadme) return -1;
3631
+ if (!aIsReadme && bIsReadme) return 1;
3632
+ if (a.type === "folder" && b.type !== "folder") return -1;
3633
+ if (a.type !== "folder" && b.type === "folder") return 1;
3634
+ const aOrder = a.sortOrder ?? Infinity;
3635
+ const bOrder = b.sortOrder ?? Infinity;
3636
+ if (aOrder !== bOrder) return aOrder - bOrder;
3637
+ return a.name.localeCompare(b.name, void 0, { sensitivity: "base" });
3638
+ });
3639
+ for (const node of nodes) {
3640
+ if (node.type === "folder" && node.children) {
3641
+ node.children = sortTreeChildren(node.children);
3642
+ }
3643
+ }
3644
+ return nodes;
3645
+ }
3646
+ function buildDocumentTree(docs, mapFn, getParentPath, getPath) {
3647
+ const nodeMap = /* @__PURE__ */ new Map();
3648
+ const rootNodes = [];
3649
+ for (const doc of docs) {
3650
+ const node = mapFn(doc);
3651
+ nodeMap.set(getPath(doc), node);
3652
+ }
3653
+ for (const doc of docs) {
3654
+ const node = nodeMap.get(getPath(doc));
3655
+ let resolvedParentPath = getParentPath(doc);
3656
+ if (!resolvedParentPath) {
3657
+ const nodePath = getPath(doc);
3658
+ const lastSlash = nodePath.lastIndexOf("/");
3659
+ if (lastSlash > 0) {
3660
+ resolvedParentPath = nodePath.substring(0, lastSlash);
3661
+ }
3662
+ }
3663
+ if (resolvedParentPath) {
3664
+ const parent = nodeMap.get(resolvedParentPath);
3665
+ if (parent) {
3666
+ if (!parent.children) parent.children = [];
3667
+ parent.children.push(node);
3668
+ } else {
3669
+ rootNodes.push(node);
3670
+ }
3671
+ } else {
3672
+ rootNodes.push(node);
3673
+ }
3674
+ }
3675
+ return sortTreeChildren(rootNodes);
3676
+ }
3677
+
3678
+ // src/utils/markdown-to-plain.ts
3679
+ function stripInlineMarkdown(s) {
3680
+ return s.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/`([^`]+)`/g, "$1");
3681
+ }
3682
+ function markdownToPlainText(markdown, options = {}) {
3683
+ const { mode = "article", maxChars } = options;
3684
+ let out = markdown.replace(/```[\s\S]*?```/g, "").replace(/!\[[^\]]*\]\([^)]+\)/g, "");
3685
+ out = stripInlineMarkdown(out).replace(/^#+\s*/gm, "").replace(/^\s*[-*+]\s+/gm, "");
3686
+ if (mode === "preview") {
3687
+ out = out.replace(/\s+/g, " ").trim();
3688
+ } else {
3689
+ out = out.replace(/\n{3,}/g, "\n\n").trim();
3690
+ }
3691
+ if (maxChars != null && out.length > maxChars) {
3692
+ out = out.slice(0, maxChars);
3693
+ }
3694
+ return out;
3695
+ }
3696
+
3697
+ // src/utils/markdown-section-extractor.ts
3698
+ var DEFAULT_OPTIONS = {
3699
+ maxLevel: 2,
3700
+ removeEmojis: true,
3701
+ handleDuplicateIds: true,
3702
+ stripFormattingMarkers: true,
3703
+ skipCodeAndYamlBlocks: true
3704
+ };
3705
+ function extractSections(markdown, options = {}) {
3706
+ const opts = { ...DEFAULT_OPTIONS, ...options };
3707
+ const sections = [];
3708
+ const lines = markdown.split("\n");
3709
+ const idCounts = {};
3710
+ let inCodeBlock = false;
3711
+ let inYamlBlock = false;
3712
+ for (const line of lines) {
3713
+ if (opts.skipCodeAndYamlBlocks) {
3714
+ if (line.startsWith("```")) {
3715
+ inCodeBlock = !inCodeBlock;
3716
+ continue;
3717
+ }
3718
+ if (line === "---") {
3719
+ inYamlBlock = !inYamlBlock;
3720
+ continue;
3721
+ }
3722
+ if (inCodeBlock || inYamlBlock) continue;
3723
+ }
3724
+ const pattern = new RegExp(`^(#{1,${opts.maxLevel}})\\s+(.+)`);
3725
+ const match = line.match(pattern);
3726
+ if (!match) continue;
3727
+ const level = match[1].length;
3728
+ if (level > opts.maxLevel) continue;
3729
+ let title = match[2].trim();
3730
+ if (opts.stripFormattingMarkers) {
3731
+ title = stripInlineMarkdown(title).trim();
3732
+ }
3733
+ let baseId = title;
3734
+ if (opts.removeEmojis) {
3735
+ baseId = baseId.replace(
3736
+ /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu,
3737
+ ""
3738
+ ).trim();
3739
+ }
3740
+ baseId = baseId.toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/^-+|-+$/g, "");
3741
+ const cleanId = baseId || `section-${sections.length + 1}`;
3742
+ let id = cleanId;
3743
+ if (opts.handleDuplicateIds) {
3744
+ if (idCounts[cleanId]) {
3745
+ idCounts[cleanId]++;
3746
+ id = `${cleanId}-${idCounts[cleanId]}`;
3747
+ } else {
3748
+ idCounts[cleanId] = 1;
3749
+ }
3750
+ }
3751
+ sections.push({ id, title, level });
3752
+ }
3753
+ return sections;
3754
+ }
3755
+
3756
+ // src/utils/embed-url-converters.ts
3757
+ function toGoogleSheetsEmbedUrl(url) {
3758
+ if (url.includes("/htmlembed")) return url;
3759
+ const match = url.match(/\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/);
3760
+ if (!match) return url;
3761
+ const gidMatch = url.match(/[#?&]gid=(\d+)/);
3762
+ const gid = gidMatch ? gidMatch[1] : "0";
3763
+ return `https://docs.google.com/spreadsheets/d/${match[1]}/htmlembed?widget=true&chrome=false&headers=false&gid=${gid}`;
3764
+ }
3765
+ function toGoogleSheetsOriginalUrl(url) {
3766
+ const match = url.match(/\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/);
3767
+ if (!match) return url;
3768
+ const gidMatch = url.match(/[#?&]gid=(\d+)/);
3769
+ const gid = gidMatch ? gidMatch[1] : "0";
3770
+ return `https://docs.google.com/spreadsheets/d/${match[1]}/edit#gid=${gid}`;
3771
+ }
3772
+ function toFigmaEmbedUrl(url, opts) {
3773
+ if (url.includes("embed.figma.com")) return url;
3774
+ if (url.includes("figma.com/embed")) return url;
3775
+ const match = url.match(
3776
+ /figma\.com\/(design|file|proto|board|slides|deck)\/([a-zA-Z0-9]+)(?:\/([^?]*))?(\?.*)?$/
3777
+ );
3778
+ if (match) {
3779
+ const [, urlType, fileKey, titleSlug, queryString] = match;
3780
+ const isSlides = urlType === "slides" || urlType === "deck";
3781
+ const embedType = urlType === "proto" ? "proto" : isSlides ? opts?.slidesView === "browse" ? "slides" : "deck" : "design";
3782
+ const pathSuffix = titleSlug ? `/${titleSlug}` : "";
3783
+ const params = new URLSearchParams(queryString?.replace(/^\?/, "") || "");
3784
+ if (!params.has("embed-host")) {
3785
+ params.set("embed-host", "flamingo");
3786
+ }
3787
+ const clientId = process.env.NEXT_PUBLIC_FIGMA_CLIENT_ID;
3788
+ if (clientId && !params.has("client-id")) {
3789
+ params.set("client-id", clientId);
3790
+ }
3791
+ return `https://embed.figma.com/${embedType}/${fileKey}${pathSuffix}?${params.toString()}`;
3792
+ }
3793
+ return `https://www.figma.com/embed?embed-host=flamingo&url=${encodeURIComponent(url)}`;
3794
+ }
3795
+ function isFigmaSlidesUrl(url) {
3796
+ if (!url) return false;
3797
+ return /(?:www\.|embed\.)?figma\.com\/(?:slides|deck)\/[a-zA-Z0-9]+/.test(url);
3798
+ }
3799
+ function toFigmaOriginalUrl(url) {
3800
+ if (url.includes("embed.figma.com")) {
3801
+ return url.replace("embed.figma.com", "www.figma.com").replace(/\?.*$/, "");
3802
+ }
3803
+ return url.replace(/\?.*$/, "");
3804
+ }
3805
+
3806
+ export { ANTHROPIC_SUPPORTED_IMAGE_MIME, AUTO_CONTINUATION_DIRECTIVE_PREFIX, CHAT_ATTACHMENT_MARKDOWN_PATTERN, CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM, CHAT_ATTACHMENT_VIEW_URL_PREFIX, CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED, CONTENT_REF_GROUPS, CUSTOM_ITEM_ID, DEFAULT_CONTENT_SUFFIXES, DEFAULT_FOLDER_INDEX_FILE, DEFAULT_MIN_FILL_MS, DEFAULT_OS_PLATFORM, DELIVERY_TASK_TYPE_OPTIONS, DESIGN_PALETTE, DEV_SECTION_PARAM_KEYS, ELAPSED_MS_FIELD, GENERIC_EMAIL_DOMAINS, HEX_PATTERN, HONEYPOT_FIELD, ICON_REGISTRY, OPENFRAME_DEV_SECTIONS, OS_PLATFORMS, PLAY_ICON_PATH, ROADMAP_STATUS_OPTIONS, SCROLL_ANCHOR, SCROLL_ANCHOR_WIRE_KEY, SOURCE_ICON_NAMES, SOURCE_LABELS_BY_TABLE, TICKET_STATUS_OPTIONS, analyzeImageColor, applyProxyAuth, buildAutoContinuationDirective, buildChatAttachmentViewUrl, buildDefaultHref, buildDiscussAddendum, buildDocumentTree, buildListUrl, buildSuggestionUrl, canonicalContentRefType, cleanEmailDomain, clearEmbedProxyAuth, clickupTaskUrl, cn, consumeAccessCode, createUTCTimestamp, deepClone, delay, deriveActiveColor, deriveHoverColor, embedAuthedFetch, escapeMarkdownInline, evaluateHumanitySignals, extractDomainFromEmail, extractDominantColor, extractEntityIdFilter, extractHumanitySignals, extractImageEdgeColorAsync, extractItemId, extractItems, extractSections, faqItemAnchor, faqSectionSlug, fetchPriorityProp, findDocNodeByPath, flattenAssistantContent, formatAbbreviatedNumber, formatAbsoluteDate, formatBioText, formatBytes, formatBytesShort, formatChatAttachmentMarkdownForBubble, formatClassification, formatCompactMetric, formatCurrency, formatDate, formatDateRange, formatDateShort, formatDateSlashUTC, formatDateTime, formatDateTimeAt, formatDateUTC, formatDocName, formatDuration, formatDurationCompact, formatDurationFromMs, formatDurationFromRange, formatDurationMMSS, formatEntryMonthUTC, formatFileSize, formatLargeNumber, formatLegalDate, formatNumber, formatPercent, formatPhoneE164, formatPrice, formatPricingModel, formatRelativeTime, formatReleaseDate, formatSingularLookupInvocation, formatTicketFullTimestamp, formatTicketRelativeTime, formatTimeWithTimezone, formatUnderscoreText, formatWholeDollars, generateImageSizes, generateRandomString, getAllPlatformBaseDomains, getBaseUrl, getBestContrastColor, getConfidenceBgClass, getConfidenceBorderClass, getConfidenceColorClass, getConfidenceLabel, getConfidenceLevel, getConfidenceTextClass, getContentRefLabel, getContentRefLabelOrTitleCase, getContrastRatio, getCountryByCode, getCountryPhoneData, getCurrentPlatform, getDefaultColorForPlatform, getDefaultIconForPlatform, getDetailedTimeDifference, getDocAncestorNodeIds, getDocSourceDefaultPath, getDynamicIcon, getEmbedProxyAuth, getFirstLastInitials, getIconComponent, getInitialExpandedNodeIds, getOSIcon, getOSLabel, getOSPlatformId, getOSTypeDefinition, getPersistedProxyEmail, getPlatformAccentColor, getPlatformColor, getPlatformDescription, getPlatformDisplayName, getPlatformIcon, getPlatformIconComponent, getPlatformIconComponent as getPlatformLogo, getPlatformProductionUrl, getPlatformSlogan, getProxiedImageUrl, getReadableTextColor, getShellIcon, getShellLabel, getSlackCommunityJoinUrl, getSmallPlatformIcon, getSourceIconName, getSourceLabel, getStatusColorScheme, getTaskTypeLabel, getToolLabel, getToolTypeAliases, getTrendColors, hasGenericEmailDomain, hexToRgb, isCrossOriginUrl, isFigmaSlidesUrl, isGenericDomain, isGenericWebsiteDomain, isOSPlatform, isToday, isValidEmailDomain, isValidToolType, isWithinMinutes, makeComposeContentUrl, markdownToPlainText, nameInitials, normalizeDocPath, normalizeDomain, normalizeIconKey, normalizeOSType, normalizeToolType, normalizeToolTypeWithFallback, orderContentRefTypes, parseFaqHash, parseScrollAnchor, parseWireCommandOverride, pathToNodeId, platformColors, platformDescriptions, platformDisplayNames, platformHexColors, platformIconNames, platformIcons, platformSlogans, readLeadingDecisionFrame, releaseTypeToBadgeColor, resolveContentFetchPath, resolveReleaseCover, rgbToHex, sanitizeTitleForChat, scrollElementIntoView, serializeJsonLd, setEmbedAuthAdapter, setEmbedProxyAuth, shouldProxyImage, sortTreeChildren, splitCsvEnv, stripChatAttachmentMarkdown, stripFolderIndexFromPath, stripHtml, stripInlineMarkdown, toDocSlug, toFigmaEmbedUrl, toFigmaOriginalUrl, toGoogleSheetsEmbedUrl, toGoogleSheetsOriginalUrl, toToolLabel, transformPlatformConfigsToOptions, truncateString, urlPathLooksLikeSvg, validateAccessCode, validateAndConsumeAccessCode, validateEmailDomain, validateEmailDomainList, validatePhoneNumber };
3513
3807
  //# sourceMappingURL=index.js.map
3514
3808
  //# sourceMappingURL=index.js.map